UNPKG

@microsoft/office-js

Version:

Office JavaScript Library ESM Module for Excel/Word/PowerPoint/Outlook

15 lines • 594 kB
/*
 * Office JavaScript API library
 *
 * Copyright (c) Microsoft Corporation.  All rights reserved.
 *
 * Your use of this file is governed by the license terms for the Microsoft Office JavaScript (Office.js) API library: https://github.com/OfficeDev/office-js/blob/release/LICENSE.md
 *
 * This file also contains the following Promise implementation (with a few small modifications):
 *      * @overview es6-promise - a tiny implementation of Promises/A+.
 *      * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
 *      * @license   Licensed under MIT license
 *      *            See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE
 *      * @version   2.3.0
 */
window.Type&&window.Type.registerNamespace?Type.registerNamespace("Strings"):void 0===window.Strings&&(window.Strings=new Object,window.Strings.__namespace=!0),(Strings=window.Strings).OfficeOM=function(){},Strings.OfficeOM.registerClass&&Strings.OfficeOM.registerClass("Strings.OfficeOM"),Strings.OfficeOM.L_APICallFailed="API Call Failed",Strings.OfficeOM.L_APINotSupported="API Not Supported",Strings.OfficeOM.L_ActivityLimitReached="Activity limit has been reached.",Strings.OfficeOM.L_AddBindingFromPromptDefaultText="Please make a selection.",Strings.OfficeOM.L_AddinIsAlreadyRequestingToken="Add-in is already requesting an access token.",Strings.OfficeOM.L_AddinIsAlreadyRequestingTokenMessage="The operation failed because this add-in is already requesting an access token.",Strings.OfficeOM.L_ApiNotFoundDetails="The method or property {0} is part of the {1} requirement set, which is not available in your version of {2}.",Strings.OfficeOM.L_AppNameNotExist="Add-in Name for {0} doesn't exist.",Strings.OfficeOM.L_AppNotExistInitializeNotCalled="Application {0} does not exist. Microsoft.Office.WebExtension.initialize(reason) is not called.",Strings.OfficeOM.L_AttemptingToSetReadOnlyProperty="Attempting to set read-only property '{0}'.",Strings.OfficeOM.L_BadSelectorString="The string passed into the selector is improperly formatted or unsupported.",Strings.OfficeOM.L_BindingCreationError="Binding Creation Error",Strings.OfficeOM.L_BindingNotExist="The specified binding does not exist.",Strings.OfficeOM.L_BindingToMultipleSelection="Noncontiguous selections are not supported.",Strings.OfficeOM.L_BrowserAPINotSupported="This browser does not support the requested API.",Strings.OfficeOM.L_CallbackNotAFunction="Callback must be of type function, was of type {0}.",Strings.OfficeOM.L_CancelButton="Cancel",Strings.OfficeOM.L_CannotApplyPropertyThroughSetMethod="Changes to property '{0}' cannot be applied through an \"object.set\" method.",Strings.OfficeOM.L_CannotNavigateTo="The object is located in a place where navigation is not supported.",Strings.OfficeOM.L_CannotRegisterEvent="The event handler cannot be registered.",Strings.OfficeOM.L_CannotWriteToSelection="Cannot write to the current selection.",Strings.OfficeOM.L_CellDataAmountBeyondLimits="Note: The number of cells in a table is suggested to be below 20,000 cells.",Strings.OfficeOM.L_CellFormatAmountBeyondLimits="Note: The formatting sets set by a Formatting API call is suggested to be below 100.",Strings.OfficeOM.L_CloseFileBeforeRetrieve="Call closeAsync on the current File before retrieving another.",Strings.OfficeOM.L_CoercionTypeNotMatchBinding="The specified coercion type is not compatible with this binding type.",Strings.OfficeOM.L_CoercionTypeNotSupported="The specified coercion type is not supported.",Strings.OfficeOM.L_ColIndexOutOfRange="The column index value is out of the allowed range. Use a value (0 or higher) that's less than the number of columns.",Strings.OfficeOM.L_ConfirmCancelMessage="Sorry, we can't continue.",Strings.OfficeOM.L_ConfirmDialog="The domain {0} is acting as Microsoft Office and can run Office add-ins, which may access your personal data. If you trust the domain to run as Office and access your data, click OK to continue.",Strings.OfficeOM.L_ConfirmDialogApiTrustsParent="You are about to send and receive potentially sensitive information from {0}. Only click OK if you trust the following website recieving the sensitive information: {1}.",Strings.OfficeOM.L_ConfirmDialogConsent="By clicking OK, you will allow {0} access to your content and personal information. ",Strings.OfficeOM.L_ConfirmDialogConsentTitle="One moment ...",Strings.OfficeOM.L_ConfirmRefreshMessage="To continue, remove the add-in and add it again, or refresh the page.",Strings.OfficeOM.L_ConnectionFailureWithDetails="The request failed with status code of {0}, error code {1} and the following error message: {2}",Strings.OfficeOM.L_ConnectionFailureWithStatus="The request failed with status code of {0}.",Strings.OfficeOM.L_ContinueButton="Continue",Strings.OfficeOM.L_CustomFunctionDefinitionMissing="A property with this name that represents the function's definition must exist on Excel.Script.CustomFunctions.",Strings.OfficeOM.L_CustomFunctionImplementationMissing="The property with this name on Excel.Script.CustomFunctions that represents the function's definition must contain a 'call' property that implements the function.",Strings.OfficeOM.L_CustomFunctionNameCannotSplit="The function name must contain a non-empty namespace and a non-empty short name.",Strings.OfficeOM.L_CustomFunctionNameContainsBadChars="The function name may only contain letters, digits, underscores, and periods.",Strings.OfficeOM.L_CustomXmlError="Custom XML Error.",Strings.OfficeOM.L_CustomXmlExceedQuotaMessage="XPath limits selection to 1024 items.",Strings.OfficeOM.L_CustomXmlExceedQuotaName="Selection Limit Reached",Strings.OfficeOM.L_CustomXmlNodeNotFound="The specified node was not found.",Strings.OfficeOM.L_CustomXmlOutOfDateMessage="The data is out of date. Retrieve the object again.",Strings.OfficeOM.L_CustomXmlOutOfDateName="Data Not Current",Strings.OfficeOM.L_DataNotMatchBindingSize="The supplied data object does not match the size of the current selection.",Strings.OfficeOM.L_DataNotMatchBindingType="The specified data object is not compatible with the binding type.",Strings.OfficeOM.L_DataNotMatchCoercionType="The type of the specified data object is not compatible with the current selection.",Strings.OfficeOM.L_DataNotMatchSelection="The supplied data object is not compatible with the shape or dimensions of the current selection.",Strings.OfficeOM.L_DataReadError="Data Read Error",Strings.OfficeOM.L_DataStale="Data Not Current",Strings.OfficeOM.L_DataWriteError="Data Write Error",Strings.OfficeOM.L_DataWriteReminder="Data Write Reminder",Strings.OfficeOM.L_DialogAddressNotTrusted="The domain of the URL is not included in the AppDomains element in the manifest, and is not subdomain of source location.",Strings.OfficeOM.L_DialogAlreadyOpened="The operation failed because this add-in already has an active dialog.",Strings.OfficeOM.L_DialogInvalidScheme="The URL scheme is not supported. Use HTTPS instead.",Strings.OfficeOM.L_DialogNavigateError="Dialog Navigation Error",Strings.OfficeOM.L_DialogOK="OK",Strings.OfficeOM.L_DialogParentIsMinimized="The operation failed because parent window is minimized.",Strings.OfficeOM.L_DialogRequireHTTPS="The HTTP protocol is not supported. Use HTTPS instead",Strings.OfficeOM.L_DisplayDialogError="Display Dialog Error",Strings.OfficeOM.L_DocumentIsInactive="The operation failed because the document containing this add-in is inactive.",Strings.OfficeOM.L_DocumentReadOnly="The requested operation is not allowed on the current document mode.",Strings.OfficeOM.L_ElementMissing="We couldn't format the table cell because some parameter values are missing. Double-check the parameters and try again.",Strings.OfficeOM.L_EventHandlerAdditionFailed="Failed to add the event handler.",Strings.OfficeOM.L_EventHandlerNotExist="The specified event handler was not found for this binding.",Strings.OfficeOM.L_EventHandlerRemovalFailed="Failed to remove the event handler.",Strings.OfficeOM.L_EventRegistrationError="Event Registration Error",Strings.OfficeOM.L_FileTypeNotSupported="The specified file type is not supported.",Strings.OfficeOM.L_FormatValueOutOfRange="The value is out of the allowed range.",Strings.OfficeOM.L_FormattingReminder="Formatting Reminder",Strings.OfficeOM.L_FunctionCallFailed="Function {0} call failed, error code: {1}.",Strings.OfficeOM.L_GetDataIsTooLarge="The requested data set is too large.",Strings.OfficeOM.L_GetDataParametersConflict="The specified parameters conflict.",Strings.OfficeOM.L_GetSelectionNotSupported="The current selection is not supported.",Strings.OfficeOM.L_HostError="Host Error",Strings.OfficeOM.L_ImplicitGetAuthContextMissing="The function to get authentication context is missing",Strings.OfficeOM.L_ImplicitNotLoaded="The module is not loaded before acquire a token",Strings.OfficeOM.L_InValidOptionalArgument="invalid optional argument",Strings.OfficeOM.L_IndexOutOfRange="Index out of range.",Strings.OfficeOM.L_InitializeNotReady="Office.js has not been fully loaded yet. Please try again later or make sure to add your initialization code on the Office.initialize function.",Strings.OfficeOM.L_InternalError="Internal Error",Strings.OfficeOM.L_InternalErrorDescription="An internal error has occurred.",Strings.OfficeOM.L_InvalidAPICall="Invalid API Call",Strings.OfficeOM.L_InvalidApiArgumentsMessage="Invalid input arguments.",Strings.OfficeOM.L_InvalidApiCallInContext="Invalid API call in the current context.",Strings.OfficeOM.L_InvalidArgument="The argument '{0}' doesn't work for this situation, is missing, or isn't in the right format.",Strings.OfficeOM.L_InvalidArgumentGeneric="The argument(s) passed into the function don't work for this situation, are missing, or aren't in the right format.",Strings.OfficeOM.L_InvalidBinding="Invalid Binding",Strings.OfficeOM.L_InvalidBindingError="Invalid Binding Error",Strings.OfficeOM.L_InvalidBindingOperation="Invalid Binding Operation",Strings.OfficeOM.L_InvalidCellsValue="One or more of the cells parameters have values that aren't allowed. Double-check the values and try again.",Strings.OfficeOM.L_InvalidCoercion="Invalid Coercion Type",Strings.OfficeOM.L_InvalidColumnsForBinding="The specified columns are invalid.",Strings.OfficeOM.L_InvalidDataFormat="The format of the specified data object is invalid.",Strings.OfficeOM.L_InvalidDataObject="Invalid Data Object",Strings.OfficeOM.L_InvalidFormat="Invalid Format Error",Strings.OfficeOM.L_InvalidFormatValue="One or more of the format parameters have values that aren't allowed. Double-check the values and try again.",Strings.OfficeOM.L_InvalidGetColumns="The specified columns are invalid.",Strings.OfficeOM.L_InvalidGetRowColumnCounts="The specified rowCount or columnCount values are invalid.",Strings.OfficeOM.L_InvalidGetRows="The specified rows are invalid.",Strings.OfficeOM.L_InvalidGetStartRowColumn="The specified startRow or startColumn values are invalid.",Strings.OfficeOM.L_InvalidGrant="Preauthorization missing.",Strings.OfficeOM.L_InvalidGrantMessage="Missing grant for this add-in.",Strings.OfficeOM.L_InvalidNamedItemForBindingType="The specified binding type is not compatible with the supplied named item.",Strings.OfficeOM.L_InvalidNode="Invalid Node",Strings.OfficeOM.L_InvalidObjectPath='The object path \'{0}\' isn\'t working for what you\'re trying to do. If you\'re using the object across multiple "context.sync" calls and outside the sequential execution of a ".run" batch, please use the "context.trackedObjects.add()" and "context.trackedObjects.remove()" methods to manage the object\'s lifetime.',Strings.OfficeOM.L_InvalidOperationInCellEditMode="Excel is in cell-editing mode. Please exit the edit mode by pressing ENTER or TAB or selecting another cell, and then try again.",Strings.OfficeOM.L_InvalidOrTimedOutSession="Invalid Or Timed Out Session",Strings.OfficeOM.L_InvalidOrTimedOutSessionMessage="Your Office session has expired or is invalid. To continue, refresh the page.",Strings.OfficeOM.L_InvalidParameters="Function {0} has invalid parameters.",Strings.OfficeOM.L_InvalidReadForBlankRow="The specified row is blank.",Strings.OfficeOM.L_InvalidRequestContext="Cannot use the object across different request contexts.",Strings.OfficeOM.L_InvalidResourceUrl="Invalid application resource Url provided.",Strings.OfficeOM.L_InvalidResourceUrlMessage="Invalid resource Url specified in the manifest.",Strings.OfficeOM.L_InvalidSSOAddinMessage="The identity API is not supported for this add-in.",Strings.OfficeOM.L_InvalidSelectionForBindingType="A binding cannot be created with the current selection and the specified binding type.",Strings.OfficeOM.L_InvalidSetColumns="The specified columns are invalid.",Strings.OfficeOM.L_InvalidSetRows="The specified rows are invalid.",Strings.OfficeOM.L_InvalidSetStartRowColumn="The specified startRow or startColumn values are invalid.",Strings.OfficeOM.L_InvalidTableOptionValue="One or more of the tableOptions parameters have values that aren't allowed. Double-check the values and try again.",Strings.OfficeOM.L_InvalidValue="Invalid Value",Strings.OfficeOM.L_MemoryLimit="Memory Limit Exceeded",Strings.OfficeOM.L_MissingParameter="Missing Parameter",Strings.OfficeOM.L_MissingRequiredArguments="missing some required arguments",Strings.OfficeOM.L_ModalDialogOpeng="The operation failed because this add-in already has an active modal dialog.",Strings.OfficeOM.L_MultipleNamedItemFound="Multiple objects with the same name were found.",Strings.OfficeOM.L_NamedItemNotFound="The named item does not exist.",Strings.OfficeOM.L_NavOutOfBound="The operation failed because the index is out of range.",Strings.OfficeOM.L_NetworkProblem="Network Problem",Strings.OfficeOM.L_NetworkProblemRetrieveFile="A network problem has prevented retrieval of the file.",Strings.OfficeOM.L_NewWindowCrossZone="The security settings in your browser prevent us from creating a dialog box. Try a different browser, or {0} so that '{1}' and the domain shown in your address bar are in the same security zone.",Strings.OfficeOM.L_NewWindowCrossZoneConfigureBrowserLink="configure your browser",Strings.OfficeOM.L_NewWindowCrossZoneErrorString="Browser restrictions prevented us from creating the dialog box. The domain of dialog box and the domain of the add-in host are not in the same security zone.",Strings.OfficeOM.L_NoCapability="You don't have sufficient permissions for this action.",Strings.OfficeOM.L_NoHttpsWAC="This Office session is not using a secure connection. We recommend that you take extra precautions.",Strings.OfficeOM.L_NonUniformPartialGetNotSupported="Coordinate parameters cannot be used with coercion type Table when the table contains merged cells.",Strings.OfficeOM.L_NonUniformPartialSetNotSupported="Coordinate parameters cannot be used with coercion type Table when the table contains merged cells.",Strings.OfficeOM.L_NotImplemented="Function {0} is not implemented.",Strings.OfficeOM.L_NotSupported="Function {0} is not supported.",Strings.OfficeOM.L_NotSupportedBindingType="The specified binding type {0} is not supported.",Strings.OfficeOM.L_NotSupportedEventType="The specified event type {0} is not supported.",Strings.OfficeOM.L_NotTrustedWAC="This add-in has been disabled to help keep you safe. To continue using the add-in, validate that this item is hosted in a trusted domain or open it in the Office desktop app.",Strings.OfficeOM.L_OKButton="OK",Strings.OfficeOM.L_OperationCancelledError="Operation Cancelled",Strings.OfficeOM.L_OperationCancelledErrorMessage="The operation was cancelled by the user.",Strings.OfficeOM.L_OperationNotSupported="The operation is not supported.",Strings.OfficeOM.L_OperationNotSupportedOnMatrixData="Selected content needs to be in table format. Format the data as a table and try again.",Strings.OfficeOM.L_OperationNotSupportedOnThisBindingType="Operation is not supported on this binding type.",Strings.OfficeOM.L_OsfControlTypeNotSupported="OsfControl type not supported.",Strings.OfficeOM.L_OutOfRange="Out of Range",Strings.OfficeOM.L_OverwriteWorksheetData="The set operation failed because the supplied data object will overwrite or shift data.",Strings.OfficeOM.L_PermissionDenied="Permission Denied",Strings.OfficeOM.L_PropertyDoesNotExist="Property '{0}' does not exist on the object.",Strings.OfficeOM.L_PropertyNotLoaded="The property '{0}' is not available. Before reading the property's value, call the load method on the containing object and call \"context.sync()\" on the associated request context.",Strings.OfficeOM.L_ReadSettingsError="Read Settings Error",Strings.OfficeOM.L_RedundantCallbackSpecification="Callback cannot be specified both in argument list and in optional object.",Strings.OfficeOM.L_RequestPayloadSizeLimitExceededMessage='The request payload size has exceeded the limit. Please refer to the documentation: "https://docs.microsoft.com/office/dev/add-ins/concepts/resource-limits-and-performance-optimization#excel-add-ins".',Strings.OfficeOM.L_RequestTimeout="The call took too long to execute.",Strings.OfficeOM.L_RequestTimeoutAPITookLong="The call took too long to run.",Strings.OfficeOM.L_RequestTokenUnavailable="This API has been throttled to slow the call frequency.",Strings.OfficeOM.L_ResponsePayloadSizeLimitExceededMessage='The response payload size has exceeded the limit. Please refer to the documentation: "https://docs.microsoft.com/office/dev/add-ins/concepts/resource-limits-and-performance-optimization#excel-add-ins".',Strings.OfficeOM.L_RowIndexOutOfRange="The row index value is out of the allowed range. Use a value (0 or higher) that's less than the number of rows.",Strings.OfficeOM.L_RunMustReturnPromise='The batch function passed to the ".run" method didn\'t return a promise. The function must return a promise, so that any automatically-tracked objects can be released at the completion of the batch operation. Typically, you return a promise by returning the response from "context.sync()".',Strings.OfficeOM.L_SSOClientError="Error occurred in the authentication request from Office.",Strings.OfficeOM.L_SSOClientErrorMessage="An unexpected error occurred in the client.",Strings.OfficeOM.L_SSOConnectionLostError="A connection was lost during the sign in process.",Strings.OfficeOM.L_SSOConnectionLostErrorMessage="A connection was lost during the sign in process, and the user may not be signed in. This was likely due to the user's browser configuration settings, such as security zones.",Strings.OfficeOM.L_SSOServerError="Error occurred in the authentication provider.",Strings.OfficeOM.L_SSOServerErrorMessage="An unexpected error occurred on the server.",Strings.OfficeOM.L_SSOUnsupportedPlatform="API is not supported in this platform.",Strings.OfficeOM.L_SSOUserConsentNotSupportedByCurrentAddinCategory="This add-in does not support user consent.",Strings.OfficeOM.L_SSOUserConsentNotSupportedByCurrentAddinCategoryMessage="The operation failed because this add-in does not support user consent in this category",Strings.OfficeOM.L_SaveSettingsError="Save Settings Error",Strings.OfficeOM.L_SelectionCannotBound="Cannot bind to the current selection.",Strings.OfficeOM.L_SelectionNotSupportCoercionType="The current selection is not compatible with the specified coercion type.",Strings.OfficeOM.L_SetDataIsTooLarge="The specified data object is too large.",Strings.OfficeOM.L_SetDataParametersConflict="The specified parameters conflict.",Strings.OfficeOM.L_SettingNameNotExist="The specified setting name does not exist.",Strings.OfficeOM.L_SettingsAreStale="Settings could not be saved because they are not current.",Strings.OfficeOM.L_SettingsCannotSave="The settings could not be saved.",Strings.OfficeOM.L_SettingsStaleError="Settings Stale Error",Strings.OfficeOM.L_ShowWindowDialogNotification="{0} wants to display a new window.",Strings.OfficeOM.L_ShowWindowDialogNotificationAllow="Allow",Strings.OfficeOM.L_ShowWindowDialogNotificationIgnore="Ignore",Strings.OfficeOM.L_ShuttingDown="Operation failed because the data is not current on the server.",Strings.OfficeOM.L_SliceSizeNotSupported="The specified slice size is not supported.",Strings.OfficeOM.L_SpecifiedIdNotExist="The specified ID does not exist.",Strings.OfficeOM.L_Timeout="The operation has timed out.",Strings.OfficeOM.L_TooManyArguments="too many arguments",Strings.OfficeOM.L_TooManyIncompleteRequests="Wait until the previous call completes.",Strings.OfficeOM.L_TooManyOptionalFunction="multiple optional functions in parameter list",Strings.OfficeOM.L_TooManyOptionalObjects="multiple optional objects in parameter list",Strings.OfficeOM.L_UndoNotSupportedMessage="The JavaScript API request failed due to the lack of support for the undo operation.",Strings.OfficeOM.L_UnknownBindingType="The binding type is not supported.",Strings.OfficeOM.L_UnsupportedDataObject="The supplied data object type is not supported.",Strings.OfficeOM.L_UnsupportedEnumeration="Unsupported Enumeration",Strings.OfficeOM.L_UnsupportedEnumerationMessage="The enumeration isn't supported in the current host application.",Strings.OfficeOM.L_UnsupportedUserIdentity="User identity type is not supported.",Strings.OfficeOM.L_UnsupportedUserIdentityMessage="The identity type of the user is not supported.",Strings.OfficeOM.L_UserAborted="User aborted the consent request.",Strings.OfficeOM.L_UserAbortedMessage="The user did not consent the add-in permissions.",Strings.OfficeOM.L_UserClickIgnore="The user chose to ignore the dialog box.",Strings.OfficeOM.L_UserNotSignedIn="No user is signed into Office.",Strings.OfficeOM.L_ValueNotLoaded='The value of the result object has not been loaded yet. Before reading the value property, call "context.sync()" on the associated request context.',Strings.OfficeOM.L_WorkbookHiddenMessage="The JavaScript API request failed because the workbook was hidden. Please unhide the workbook and try again.",Strings.OfficeOM.L_WriteNotSupportedWhenModalDialogOpen="Write operation is not supported for Office when a modal dialog is open.",window.Type&&window.Type.registerNamespace?Type.registerNamespace("_u"):void 0===window._u&&(window._u=new Object,window._u.__namespace=!0);var OSFPerformance,CustomFunctionMappings,CustomFunctions,Strings,_u=window._u;_u.ExtensibilityStrings=function(){},_u.ExtensibilityStrings.registerClass&&_u.ExtensibilityStrings.registerClass("_u.ExtensibilityStrings"),_u.ExtensibilityStrings.I_ExceededMaxNumberOfSelectedItems_Text="Too many items selected. Please select fewer items.",_u.ExtensibilityStrings.l_APICallFailedDueToItemChange_Text="The selected item has been changed.",_u.ExtensibilityStrings.l_API_Not_Supported_By_ExtensionPoint_Error_Text="API not supported for extension point.",_u.ExtensibilityStrings.l_API_Not_Supported_For_Shared_Folders_Error="API not supported for shared folders.",_u.ExtensibilityStrings.l_ActionsDefinitionMultipleActionsError_Text="Only a single action is currently supported.",_u.ExtensibilityStrings.l_ActionsDefinitionWrongNotificationMessageError_Text="Actions can't be defined for this notification message type.",_u.ExtensibilityStrings.l_AttachmentDeleteGeneralFailure_Text="The attachment cannot be deleted from the item.",_u.ExtensibilityStrings.l_AttachmentDeletedBeforeUploadCompletes_Text="The user removed the attachment before upload has completed.",_u.ExtensibilityStrings.l_AttachmentErrorName_Text="Attachment Error",_u.ExtensibilityStrings.l_AttachmentExceededSize_Text="The attachment cannot be added because it is too big.",_u.ExtensibilityStrings.l_AttachmentItemIdTooLong_Text="One or more of the attachment IDs is too long.",_u.ExtensibilityStrings.l_AttachmentNameTooLong_Text="One or more of the attachment names is too long.",_u.ExtensibilityStrings.l_AttachmentNotSupported_Text="The attachment type is not supported.",_u.ExtensibilityStrings.l_AttachmentUploadGeneralFailure_Text="The attachment cannot be added to the item.",_u.ExtensibilityStrings.l_AttachmentUrlTooLong_Text="One or more of the attachment URLs is too long.",_u.ExtensibilityStrings.l_Attachment_Download_Failed_Generic_Error="Downloading the attachment failed.",_u.ExtensibilityStrings.l_Attachment_Resource_Not_Found="The attachment was not found.",_u.ExtensibilityStrings.l_Attachment_Resource_UnAuthorizedAccess="Unauthorized access to the attachment.",_u.ExtensibilityStrings.l_CallSaveAsyncBeforeToken_Text="The token can't be retrieved until the item is saved.",_u.ExtensibilityStrings.l_CannotAddAttachmentBeforeUpgrade_Text="Attachments cannot be added while the full reply or forward is being retrieved from the server.",_u.ExtensibilityStrings.l_CannotPersistPropertyInUnsavedDraftError_Text="Notifications can't be persisted in unsaved drafts. Save the item before you call this API.",_u.ExtensibilityStrings.l_CrossMailboxSelectionNotAllowed_Text="Messages must be from the same user mailbox. Cross-mailbox selection is not supported.",_u.ExtensibilityStrings.l_CursorPositionChanged_Text="The user changed the position of the cursor while the data was being inserted.",_u.ExtensibilityStrings.l_DataWriteErrorName_Text="Data Write Error",_u.ExtensibilityStrings.l_DeleteAttachmentDoesNotExist_Text="The attachment cannot be deleted because attachment with the attachment index cannot be found.",_u.ExtensibilityStrings.l_DisplayNameTooLong_Text="One or more of the display names provided is too long.",_u.ExtensibilityStrings.l_DisplayReplyFormHtmlBodyRequired_Text="The 'htmlBody' is required.",_u.ExtensibilityStrings.l_DuplicateNotificationKey_Text="A notification with the provided key already exists.",_u.ExtensibilityStrings.l_Duplicate_Category_Error_Text="One of the categories provided is already in the master category list.",_u.ExtensibilityStrings.l_ElevatedPermissionNeededForMethod_Text="Elevated permission is required to call the method: '{0}'.",_u.ExtensibilityStrings.l_ElevatedPermissionNeeded_Text="Elevated permission is required to access protected members of the JavaScript API for Office.",_u.ExtensibilityStrings.l_EmailAddressTooLong_Text="One or more of the email addresses provided is too long.",_u.ExtensibilityStrings.l_EwsRequestOversized_Text="The request exceeds the 1 MB size limit. Please modify your EWS request.",_u.ExtensibilityStrings.l_ExceededMaxNumberOfAttachments_Text="Attachments cannot be added because the message already has the maximum number of attachments",_u.ExtensibilityStrings.l_FailedToGetLabel_Text="Unable to get sensitivity label.",_u.ExtensibilityStrings.l_FailedToGetLabelsCatalog_Text="Unable to get sensitivity labels catalog.",_u.ExtensibilityStrings.l_FailedToSetLabel_Text="Unable to set sensitivity label.",_u.ExtensibilityStrings.l_HtmlSanitizationFailure_Text="The HTML santization has failed.",_u.ExtensibilityStrings.l_Insufficient_Item_Permissions_Text="The user doesn't have the permissions required to perform this operation.",_u.ExtensibilityStrings.l_InternalFormatError_Text="There was an internal format error.",_u.ExtensibilityStrings.l_InternalProtocolError_Text="Internal protocol error: '{0}'.",_u.ExtensibilityStrings.l_Internal_Server_Error_Text="The Exchange server returned an error. Please look at the diagnostics object for more information.",_u.ExtensibilityStrings.l_Internet_Not_Connected_Error_Text="The user is no longer connected to the network. Please check your network connection and try again.",_u.ExtensibilityStrings.l_InvalidActionType_Text="The value of the parameter 'actionType' is invalid. The accepted value is \"showTaskPane\".",_u.ExtensibilityStrings.l_InvalidAttachmentId_Text="The attachment ID was invalid.",_u.ExtensibilityStrings.l_InvalidAttachmentPath_Text="The attachment path was invalid.",_u.ExtensibilityStrings.l_InvalidCommandIdError_Text="The value of the parameter 'commandId' is invalid.",_u.ExtensibilityStrings.l_InvalidDate_Text="The input doesn't resolve to a valid date.",_u.ExtensibilityStrings.l_InvalidEndTime_Text="The end time cannot be before the start time.",_u.ExtensibilityStrings.l_InvalidEventDates_Text="The end date occurs before the start date.",_u.ExtensibilityStrings.l_InvalidOpenLocationInput_Text="OpenLocation is invalid.",_u.ExtensibilityStrings.l_InvalidParameterValueError_Text="The value of the '{0}' parameter is invalid.",_u.ExtensibilityStrings.l_InvalidSaveLocationInput_Text="SaveLocation is invalid.",_u.ExtensibilityStrings.l_InvalidSelection_Text="The selection is invalid.",_u.ExtensibilityStrings.l_InvalidTime_Text="The input doesn't resolve to a valid time.",_u.ExtensibilityStrings.l_Invalid_Category_Error_Text="Invalid categories were provided.",_u.ExtensibilityStrings.l_ItemNotFound_Text="The item does not exist or has not been created.",_u.ExtensibilityStrings.l_Item_Not_Saved_Error_Text="The id can't be retrieved until the item is saved.",_u.ExtensibilityStrings.l_KeyNotFound_Text="The specified key was not found.",_u.ExtensibilityStrings.l_MAMServiceNotAvailable_Text="Failed to retrieve MAM Policy.",_u.ExtensibilityStrings.l_MessageInDifferentStoreError_Text="The EWS ID can't be retrieved because the message is saved in a different store.",_u.ExtensibilityStrings.l_Missing_Extended_Permissions_For_API="Extended Permission missing for the API call.",_u.ExtensibilityStrings.l_NativeLabelingNotEnabled_Text="Sensitivity labels are not enabled.",_u.ExtensibilityStrings.l_NoValidRecipientsProvided_Text="No valid recipients were provided.",_u.ExtensibilityStrings.l_NotificationKeyNotFound_Text="There are no notifications with the provided key.",_u.ExtensibilityStrings.l_NullOrEmptyParameterError_Text="The parameter '{0}' is mandatory and it can't be null or empty.",_u.ExtensibilityStrings.l_NumberOfNotificationsExceeded_Text="The notification couldn't be added because the notification limit has been reached.",_u.ExtensibilityStrings.l_NumberOfRecipientsExceeded_Text="The total number of recipients in the field can't exceed {0}.",_u.ExtensibilityStrings.l_OffsetNotfound_Text="An offset for this time stamp couldn't be found.",_u.ExtensibilityStrings.l_Olk_Http_Error_Text="The request has failed. Please look at the diagnostics object for the HTTP error code.",_u.ExtensibilityStrings.l_OnlineMeetingsUserDenied_Text="User denied.",_u.ExtensibilityStrings.l_ParameterValueTooLongError_Text="The value of the '{0}' parameter is too long. The maximum number of characters is '{1}'.",_u.ExtensibilityStrings.l_ParametersNotAsExpected_Text="The given parameters do not match the expected format.",_u.ExtensibilityStrings.l_PersistedNotificationArrayReadError_Text="The API call you made failed because the persisted notifications couldn't be retrieved.",_u.ExtensibilityStrings.l_PersistedNotificationArraySaveError_Text="The API call you made failed because notifications couldn't be persisted.",_u.ExtensibilityStrings.l_RecurrenceErrorMaxOccurrences_Text="The recurring series exceeds the maximum limit of 999 occurrences.",_u.ExtensibilityStrings.l_RecurrenceErrorZeroOccurrences_Text="The recurring series has no occurrences in the specified date range.",_u.ExtensibilityStrings.l_RecurrenceInvalidTimeZone_Text="The specified time zone is not supported.",_u.ExtensibilityStrings.l_RecurrenceUnsupportedAlternateCalendar_Text="The recurrence pattern was set by the user using an alternate calendar that is not supported.",_u.ExtensibilityStrings.l_Recurrence_Error_Instance_SetAsync_Text="A recurrence pattern can't be set for a single occurrence in a series.",_u.ExtensibilityStrings.l_Recurrence_Error_Properties_Invalid_Text="The recurrence pattern isn't valid. Please check that the specified recurrence properties align with the recurrence type.",_u.ExtensibilityStrings.l_RoamingSettingsExceededSize_Text="Invalid parameter size. Roaming settings can't exceed the 32 KB size limit.",_u.ExtensibilityStrings.l_SaveError_Text="Connection error occurred while trying to save the item on the server.",_u.ExtensibilityStrings.l_SensitivityUnableToSetParent_Text="Unable to set Sensitivity with children.",_u.ExtensibilityStrings.l_SessionDataObjectMaxLengthExceeded_Text="The 'sessionData' object surpassed its maximum length of '{0}' characters.",_u.ExtensibilityStrings.l_TokenAccessDeniedWithoutItemContext_Text="A REST token is only available with ReadWriteMailbox permission when there is no item context.",_u.ExtensibilityStrings.l_UserHasNoLabelsToSet_Text="User has no labels to set.",function(e){e.now=function(){return"undefined"!=typeof performance&&performance.now?performance.now():0},e.getTotalJSHeapSize=function(){return"undefined"!=typeof performance&&performance.memory?performance.memory.totalJSHeapSize:0},e.getUsedJSHeapSize=function(){return"undefined"!=typeof performance&&performance.memory?performance.memory.usedJSHeapSize:0},e.getJSHeapSizeLimit=function(){return"undefined"!=typeof performance&&performance.memory?performance.memory.jsHeapSizeLimit:0},e.officeExecuteStartDate=e.officeExecuteStartDate||Date.now(),e.officeExecuteStart=e.officeExecuteStart||0,e.officeExecuteEnd=e.officeExecuteEnd||0,e.hostInitializationStart=0,e.hostInitializationEnd=0,e.totalJSHeapSize=0,e.usedJSHeapSize=0,e.jsHeapSizeLimit=0,e.createOMEnd=0,e.hostSpecificFileName="",e.getAppContextStart=0,e.getAppContextEnd=0,e.getAppContextXdmStart=0,e.getAppContextXdmEnd=0,e.officeOnReady=0}(OSFPerformance||(OSFPerformance={})),function(e){e.definePropertyOnNamespace=function(e,t,n){Object.defineProperty(e,t,{get:function(){return n()},configurable:!0,enumerable:!0})}}(OSF||(OSF={})),OSFPerformance.hostInitializationStart=OSFPerformance.now(),function(e){!function(e){function t(){return e.m_association||(e.m_association=new OSF.Association),e.m_association}e.m_association=e.m_association,e.associate=function(){OTel&&OTel.OTelLogger&&OTel.OTelLogger.onTelemetryLoaded((function(){Microsoft.Office.WebExtension.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.ApiCall",dataFields:[oteljs.makeStringDataField("Api","Office.actions.associate")],eventFlags:{dataCategories:2,diagnosticLevel:110}})})),t().associate.apply(t(),arguments)},OSF.definePropertyOnNamespace(e,"_association",t)}(e.actions||(e.actions={}))}(Office||(Office={})),function(e){!function(e){e[e.Select=0]="Select",e[e.UnSelect=1]="UnSelect",e[e.CancelDialog=2]="CancelDialog",e[e.InsertAgave=3]="InsertAgave",e[e.CtrlF6In=4]="CtrlF6In",e[e.CtrlF6Exit=5]="CtrlF6Exit",e[e.CtrlF6ExitShift=6]="CtrlF6ExitShift",e[e.SelectWithError=7]="SelectWithError",e[e.NotifyHostError=8]="NotifyHostError",e[e.RefreshAddinCommands=9]="RefreshAddinCommands",e[e.PageIsReady=10]="PageIsReady",e[e.TabIn=11]="TabIn",e[e.TabInShift=12]="TabInShift",e[e.TabExit=13]="TabExit",e[e.TabExitShift=14]="TabExitShift",e[e.EscExit=15]="EscExit",e[e.F2Exit=16]="F2Exit",e[e.ExitNoFocusable=17]="ExitNoFocusable",e[e.ExitNoFocusableShift=18]="ExitNoFocusableShift",e[e.MouseEnter=19]="MouseEnter",e[e.MouseLeave=20]="MouseLeave",e[e.UpdateTargetUrl=21]="UpdateTargetUrl",e[e.InstallCustomFunctions=22]="InstallCustomFunctions",e[e.SendTelemetryEvent=23]="SendTelemetryEvent",e[e.UninstallCustomFunctions=24]="UninstallCustomFunctions",e[e.SendMessage=25]="SendMessage",e[e.LaunchExtensionComponent=26]="LaunchExtensionComponent",e[e.StopExtensionComponent=27]="StopExtensionComponent",e[e.RestartExtensionComponent=28]="RestartExtensionComponent",e[e.EnableTaskPaneHeaderButton=29]="EnableTaskPaneHeaderButton",e[e.DisableTaskPaneHeaderButton=30]="DisableTaskPaneHeaderButton",e[e.TaskPaneHeaderButtonClicked=31]="TaskPaneHeaderButtonClicked",e[e.RemoveAppCommandsAddin=32]="RemoveAppCommandsAddin",e[e.RefreshRibbonGallery=33]="RefreshRibbonGallery",e[e.GetOriginalControlId=34]="GetOriginalControlId",e[e.OfficeJsReady=35]="OfficeJsReady",e[e.InsertDevManifest=36]="InsertDevManifest",e[e.InsertDevManifestError=37]="InsertDevManifestError",e[e.SendCustomerContent=38]="SendCustomerContent",e[e.KeyboardShortcuts=39]="KeyboardShortcuts",e[e.CloseSDXDialog=42]="CloseSDXDialog",e[e.ResizeSDXDialog=43]="ResizeSDXDialog",e[e.SendNonStandardEvent=44]="SendNonStandardEvent",e[e.Interactive=48]="Interactive",e[e.OfficeJsRuntimeInfo=49]="OfficeJsRuntimeInfo"}(e.AgaveHostAction||(e.AgaveHostAction={}))}(OSF||(OSF={})),function(e){var t=function(){function t(){var t=this;this._processAppCommandInvocation=function(e){var n=t._verifyManifestCallback(e.callbackName);if(0==n.errorCode){var r=t._constructEventObjectForCallback(e);r?window.setTimeout((function(){n.callback(r)}),0):t._invokeAppCommandCompletedMethod(e.appCommandId,5001,"")}else t._invokeAppCommandCompletedMethod(e.appCommandId,n.errorCode,"")},this._eventDispatch=new e.EventDispatch([{type:e.EventType.AppCommandInvoked,id:e.EventDispId.dispidAppCommandInvokedEvent,getTargetId:function(){return""},fromSafeArrayHost:function(t){return{type:e.EventType.AppCommandInvoked,appCommandId:t[0],callbackName:t[1],eventObjStr:t[2]}},fromWebHost:function(t){return{type:e.EventType.AppCommandInvoked,appCommandId:t[0],callbackName:t[1],eventObjStr:t[2]}}}])}return t.prototype.initializeEventHandler=function(t){var n=this;this.addHandlerAsync(e.EventType.AppCommandInvoked,(function(e){n._processAppCommandInvocation(e)}),t)},t.prototype.appCommandInvocationCompletedAsync=function(t,n,r,i){e._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(94,{fromSafeArrayHost:function(e){return e},fromWebHost:function(e){return e},toSafeArrayHost:function(){return[t,n,r]},toWebHost:function(){var e={};return e[0]=t,e[1]=n,e[2]=r,e}},i)},t.prototype.addHandlerAsync=function(t,n,r){e.EventHelper.addEventHandler(t,n,r,this._eventDispatch,void 0,e.OUtil.isPopupWindow())},t.prototype._verifyManifestCallback=function(e){var t={callback:null,errorCode:11101};e=e.trim();try{var n=this._getCallbackFunc(e);if("function"!=typeof n)return t}catch(e){return t}return{callback:n,errorCode:0}},t.prototype._getCallbackFuncFromActionAssociateTable=function(e){var t=e.toUpperCase();return Office.actions._association.mappings[t]},t.prototype._getCallbackFunc=function(e){return this._getCallbackFuncFromActionAssociateTable(e)},t.prototype._invokeAppCommandCompletedMethod=function(e,t,n){this.appCommandInvocationCompletedAsync(e,t,n,(function(e){e.status!==Office.AsyncResultStatus.Succeeded&&console.error("Failed to notify the host thta app command is completed")}))},t.prototype._constructEventObjectForCallback=function(e){var t,n,r=this;try{t=JSON.parse(e.eventObjStr),n=JSON.parse(e.eventObjStr)}catch(e){}return t||(t={}),n||(n={}),t.completed=function(t){n.completedContext=t;var i=JSON.stringify(n);r._invokeAppCommandCompletedMethod(e.appCommandId,0,i)},t},t.initialize=function(){null==t._instance&&(t._instance=new t,t._instance.initializeEventHandler((function(e){e.status!==Office.AsyncResultStatus.Succeeded&&console.error("Cannot initialize app command: "+JSON.stringify(e))})))},t._instance=null,t}();e.AppCommandManager=t}(OSF||(OSF={})),function(e){!function(e){e[e.Unsupported=0]="Unsupported",e[e.Excel=1]="Excel",e[e.Word=2]="Word",e[e.PowerPoint=4]="PowerPoint",e[e.Outlook=8]="Outlook",e[e.ExcelWebApp=16]="ExcelWebApp",e[e.WordWebApp=32]="WordWebApp",e[e.OutlookWebApp=64]="OutlookWebApp",e[e.Project=128]="Project",e[e.AccessWebApp=256]="AccessWebApp",e[e.PowerpointWebApp=512]="PowerpointWebApp",e[e.ExcelIOS=1024]="ExcelIOS",e[e.Sway=2048]="Sway",e[e.WordIOS=4096]="WordIOS",e[e.PowerPointIOS=8192]="PowerPointIOS",e[e.Access=16384]="Access",e[e.Lync=32768]="Lync",e[e.OutlookIOS=65536]="OutlookIOS",e[e.OneNoteWebApp=131072]="OneNoteWebApp",e[e.OneNote=262144]="OneNote",e[e.ExcelWinRT=524288]="ExcelWinRT",e[e.WordWinRT=1048576]="WordWinRT",e[e.PowerpointWinRT=2097152]="PowerpointWinRT",e[e.OutlookAndroid=4194304]="OutlookAndroid",e[e.OneNoteWinRT=8388608]="OneNoteWinRT",e[e.ExcelAndroid=8388609]="ExcelAndroid",e[e.VisioWebApp=8388610]="VisioWebApp",e[e.OneNoteIOS=8388611]="OneNoteIOS",e[e.WordAndroid=8388613]="WordAndroid",e[e.PowerpointAndroid=8388614]="PowerpointAndroid",e[e.Visio=8388615]="Visio",e[e.OneNoteAndroid=4194305]="OneNoteAndroid"}(e.AppName||(e.AppName={}))}(OSF||(OSF={})),function(e){var t=function(){function e(){this.m_mappings={},this.m_onchangeHandlers=[]}return e.prototype.associate=function(e,t){function n(e){"undefined"!=typeof console&&console.warn&&console.warn(e)}if(1==arguments.length&&"object"==typeof arguments[0]&&arguments[0]){var r=arguments[0];for(var i in r)this.associate(i,r[i])}else if(2==arguments.length){var o=arguments[0],a=arguments[1];if("string"!=typeof o)return void n("[InvalidArg] Function=associate");if("function"!=typeof a)return void n("[InvalidArg] Function=associate");var s=o.toUpperCase();this.m_mappings[s]&&n("[DuplicatedName] Function="+o),this.m_mappings[s]=a;for(var c=0;c<this.m_onchangeHandlers.length;c++)this.m_onchangeHandlers[c]()}else n("[InvalidArg] Function=associate")},e.prototype.onchange=function(e){e&&this.m_onchangeHandlers.push(e)},Object.defineProperty(e.prototype,"mappings",{get:function(){return this.m_mappings},enumerable:!0,configurable:!0}),e}();e.Association=t}(OSF||(OSF={})),function(e){var t=function(){function e(){}return e.prototype.invokeCallback=function(e,t,n,r,i){if(0==n){var o={status:Office.AsyncResultStatus.Succeeded,value:r,asyncContext:i};"function"==typeof t&&t(o)}else{var a={status:Office.AsyncResultStatus.Failed,error:{code:n},asyncContext:i};"function"==typeof t&&t(a)}},e}();e.AsyncMethodExecutor=t}(OSF||(OSF={})),function(e){var t=function(){function t(e){this._asyncMethodExecutor=e}return t.prototype.handleSafeArrayHostResponse=function(t,n,r,i,o,a,s){var c,l;if("number"==typeof(t=e.Utility.fromSafeArray(t))?(c=[],l=t):l=(c=t)[0],1==l)return null!=(d=c[1])&&(r[d[0]]=d[1]),!1;if(i){var d;if(0==l){if(c.length>2){d=[];for(var u=1;u<c.length;u++)d[u-1]=c[u]}else d=c[1];if(r.length>0&&null!=d){var f=d[d.length-1];r.length==f?d[d.length-1]=r:l=5001}}else d=c[1];var p=null;0==l&&(p=o.fromSafeArrayHost(d)),this._asyncMethodExecutor.invokeCallback(a,i,l,p,s)}return!0},t.prototype.handleWebHostResponse=function(e,t,n,r,i,o){var a=null;0==t&&(a=r.fromWebHost(e)),this._asyncMethodExecutor.invokeCallback(i,n,t,a,o)},t}();e.AsyncMethodExecutorHelper=t}(OSF||(OSF={})),function(e){!function(e){!function(e){!function(e){e.Context="Context",e.Value="Value",e.Status="Status",e.Error="Error"}(e.Properties||(e.Properties={})),function(e){e[e.Success=0]="Success",e[e.Failed=1]="Failed"}(e.ErrorCode||(e.ErrorCode={})),function(e){e.Name="Name",e.Message="Message",e.Code="Code"}(e.ErrorProperties||(e.ErrorProperties={}))}(e.AsyncResultEnum||(e.AsyncResultEnum={}));var t=function(e,t){this.value=e.Value,this.status=t?Office.AsyncResultStatus.Failed:Office.AsyncResultStatus.Succeeded,e.Context&&(this.asyncContext=e.Context),t&&(this.error=new n(t.Name,t.Message,t.Code))};e.AsyncResult=t;var n=function(e,t,n){this.name=e,this.message=t,this.code=n};e.Error=n}(e.DDA||(e.DDA={}))}(OSF||(OSF={})),function(e){!function(t){t.createWebClientHostControllerHelper=function(t,n){return new e.WebClientHostControllerHelper(t,n)},t.createAsyncMethodExecutorHelper=function(t){return new e.AsyncMethodExecutorHelper(t)}}(e.BootStrapExtension||(e.BootStrapExtension={}))}(OSF||(OSF={})),function(e){!function(e){e.DefaultLocale="en-us",e.OfficeJS="office.js",e.OfficeDebugJS="office.debug.js",e.OfficeStringsId="OFFICESTRINGS",e.OfficeJsId="OFFICEJS",e.HostFileId="HOST",e.OfficeStringJS="office_strings.js",e.OfficeStringDebugJS="office_strings.debug.js",e.FileVersion="16.0.20717.15040"}(e.ConstantNames||(e.ConstantNames={}))}(OSF||(OSF={})),function(e){var t=function(){function e(){}return e.NotificationConversationIdSuffix="_ntf",e}();e.Constants=t}(OSF||(OSF={})),CustomFunctionMappings||(CustomFunctionMappings={}),function(e){e.delayInitialization=function(){CustomFunctionMappings.__delay__=!0},e._association=e._association||new OSF.Association,e.associate=function(){e._association.associate.apply(e._association,arguments),delete CustomFunctionMappings.__delay__}}(CustomFunctions||(CustomFunctions={})),function(e){!function(t){!function(t){var n={},r=!1;t.getErrorArgs=function(t){r||(n[1e3]={name:e.ErrorNames.InvalidCoercion},n[1001]={name:e.ErrorNames.DataReadError},n[1002]={name:e.ErrorNames.InvalidCoercion},n[1003]={name:e.ErrorNames.DataReadError},n[1004]={name:e.ErrorNames.DataReadError},n[1005]={name:e.ErrorNames.DataReadError},n[1006]={name:e.ErrorNames.DataReadError},n[1008]={name:e.ErrorNames.DataReadError},n[1009]={name:e.ErrorNames.DataReadError},n[1010]={name:e.ErrorNames.DataReadError},n[1011]={name:e.ErrorNames.DataReadError},n[1012]={name:e.ErrorNames.DataReadError},n[1013]={name:e.ErrorNames.DataReadError},n[2e3]={name:e.ErrorNames.DataWriteError},n[2001]={name:e.ErrorNames.DataWriteError},n[2002]={name:e.ErrorNames.DataWriteError},n[2003]={name:e.ErrorNames.DataWriteError},n[2004]={name:e.ErrorNames.DataWriteError},n[2005]={name:e.ErrorNames.DataWriteError},n[2006]={name:e.ErrorNames.InvalidFormat},n[2007]={name:e.ErrorNames.InvalidDataObject},n[2008]={name:e.ErrorNames.InvalidDataObject},n[2009]={name:e.ErrorNames.DataWriteError},n[2010]={name:e.ErrorNames.DataWriteError},n[2011]={name:e.ErrorNames.DataWriteError},n[2012]={name:e.ErrorNames.DataWriteError},n[2013]={name:e.ErrorNames.DataWriteError},n[3e3]={name:e.ErrorNames.BindingCreationError},n[3002]={name:e.ErrorNames.InvalidBindingError},n[3003]={name:e.ErrorNames.BindingCreationError},n[3004]={name:e.ErrorNames.BindingCreationError},n[3005]={name:e.ErrorNames.InvalidBindingOperation},n[3006]={name:e.ErrorNames.BindingCreationError},n[3007]={name:e.ErrorNames.BindingCreationError},n[3008]={name:e.ErrorNames.BindingCreationError},n[3009]={name:e.ErrorNames.InvalidBinding},n[3010]={name:e.ErrorNames.InvalidBindingOperation},n[3011]={name:e.ErrorNames.InvalidBinding},n[4e3]={name:e.ErrorNames.ReadSettingsError},n[4001]={name:e.ErrorNames.SaveSettingsError},n[4002]={name:e.ErrorNames.SettingsStaleError},n[5e3]={name:e.ErrorNames.HostError},n[5001]={name:e.ErrorNames.InternalError},n[5002]={name:e.ErrorNames.PermissionDenied},n[5003]={name:e.ErrorNames.EventRegistrationError},n[5004]={name:e.ErrorNames.InvalidAPICall},n[5005]={name:e.ErrorNames.ShuttingDown},n[5007]={name:e.ErrorNames.UnsupportedEnumeration},n[5008]={name:e.ErrorNames.IndexOutOfRange},n[5009]={name:e.ErrorNames.APINotSupported},n[5011]={name:e.ErrorNames.APICallFailed},n[5012]={name:e.ErrorNames.InvalidOrTimedOutSession},n[5013]={name:e.ErrorNames.APICallFailed},n[5015]={name:e.ErrorNames.APICallFailed},n[5016]={name:e.ErrorNames.APICallFailed},n[5017]={name:e.ErrorNames.APICallFailed},n[5018]={name:e.ErrorNames.APICallFailed},n[5100]={name:e.ErrorNames.APICallFailed},n[5101]={name:e.ErrorNames.APICallFailed},n[5102]={name:e.ErrorNames.APICallFailed},n[5103]={name:e.ErrorNames.APICallFailed},n[5104]={name:e.ErrorNames.APICallFailed},n[6e3]={name:e.ErrorNames.InvalidNode},n[6100]={name:e.ErrorNames.CustomXmlError},n[6101]={name:e.ErrorNames.CustomXmlExceedQuotaName},n[6102]={name:e.ErrorNames.CustomXmlOutOfDateName},n[7e3]={name:e.ErrorNames.PermissionDenied},n[7001]={name:e.ErrorNames.CannotNavigateTo},n[7002]={name:e.ErrorNames.SpecifiedIdNotExist},n[7004]={name:e.ErrorNames.NavOutOfBounds},n[2014]={name:e.ErrorNames.DataWriteReminder},n[8e3]={name:e.ErrorNames.MissingParameter},n[8001]={name:e.ErrorNames.PermissionDenied},n[8010]={name:e.ErrorNames.InvalidValue},n[8011]={name:e.ErrorNames.InvalidValue},n[8012]={name:e.ErrorNames.InvalidValue},n[8020]={name:e.ErrorNames.OutOfRange},n[8021]={name:e.ErrorNames.OutOfRange},n[8022]={name:e.ErrorNames.OutOfRange},n[8023]={name:e.ErrorNames.FormattingReminder},n[1e4]={name:e.ErrorNames.UserNotSignedIn},n[11e3]={name:e.ErrorNames.MemoryLimitExceeded},n[11001]={name:e.ErrorNames.NetworkProblem},n[11002]={name:e.ErrorNames.InvalidValue},n[12007]={name:e.ErrorNames.DisplayDialogError},n[12e3]={name:e.ErrorNames.IndexOutOfRange},n[12001]={name:e.ErrorNames.IndexOutOfRange},n[12002]={name:e.ErrorNames.DisplayDialogError},n[12003]={name:e.ErrorNames.DialogNavigateError},n[12004]={name:e.ErrorNames.DisplayDialogError},n[12005]={name:e.ErrorNames.DisplayDialogError},n[12009]={name:e.ErrorNames.DisplayDialogError},n[12011]={name:e.ErrorNames.DisplayDialogError},n[13e3]={name:e.ErrorNames.APINotSupported},n[13001]={name:e.ErrorNames.UserNotSignedIn},n[13002]={name:e.ErrorNames.UserAborted},n[13003]={name:e.ErrorNames.UnsupportedUserIdentity},n[13004]={name:e.ErrorNames.InvalidResourceUrl},n[13005]={name:e.ErrorNames.InvalidGrant},n[13006]={name:e.ErrorNames.SSOClientError},n[13007]={name:e.ErrorNames.SSOServerError},n[13008]={name:e.ErrorNames.AddinIsAlreadyRequestingToken},n[13009]={name:e.ErrorNames.SSOUserConsentNotSupportedByCurrentAddinCategory},n[13010]={name:e.ErrorNames.SSOConnectionLostError},n[13012]={name:e.ErrorNames.APINotSupported},n[13013]={name:e.ErrorNames.APICallFailed},n[5014]={name:e.ErrorNames.OperationCancelledError},r=!0);var i=n[t];return i||(i=n[5001]),i.name||(i.name=n[5001].name),i.message||(i.message=i.name),i},t.addErrorMessage=function(e,t){n[e]=t}}(t.ErrorCodeManager||(t.ErrorCodeManager={}))}(e.DDA||(e.DDA={}))}(OSF||(OSF={})),function(e){e.ErrorNames={AddinIsAlreadyRequestingToken:"AddinIsAlreadyRequestingToken",APICallFailed:"APICallFailed",APINotSupported:"APINotSupported",BindingCreationError:"BindingCreationError",CallbackNotFunction:"CallbackNotFunction",CannotNavigateTo:"CannotNavigateTo",CustomXmlError:"CustomXmlError",CustomXmlExceedQuotaName:"CustomXmlExceedQuota",CustomXmlOutOfDateName:"CustomXmlOutOfDate",DataReadError:"DataReadError",DataWriteError:"DataWriteError",DataWriteReminder:"DataWriteReminder",DialogNavigateError:"DialogNavigateError",DisplayDialogError:"DisplayDialogError",EventRegistrationError:"EventRegistrationError",FormattingReminder:"FormattingReminder",HostError:"HostError",IndexOutOfRange:"IndexOutOfRange",InternalError:"InternalError",InvalidAPICall:"InvalidAPICall",InvalidBinding:"InvalidBinding",InvalidBindingError:"InvalidBindingError",InvalidBindingOperation:"InvalidBindingOperation",InvalidCoercion:"InvalidCoercion",InvalidDataObject:"InvalidDataObject",InvalidFormat:"InvalidFormat",InvalidGrant:"InvalidGrant",InvalidNode:"InvalidNode",InvalidOptionalArgument:"InvalidOptionalArgument",InvalidOrTimedOutSession:"InvalidOrTimedOutSession",InvalidResourceUrl:"InvalidResourceUrl",InvalidValue:"InvalidValue",MemoryLimitExceeded:"MemoryLimitExceeded",MissingParameter:"MissingParameter",MissingRequiredArguments:"MissingRequiredArguments",NavOutOfBounds:"NavOutOfBounds",NetworkProblem:"NetworkProblem",OperationCancelledError:"OperationCancelledError",OutOfRange:"OutOfRange",PermissionDenied:"PermissionDenied",ReadSettingsError:"ReadSettingsError",RedundantCallbackSpecification:"RedundantCallbackSpecification",SaveSettingsError:"SaveSettingsError",SettingsStaleError:"SettingsStaleError",ShuttingDown:"ShuttingDown",SSOClientError:"SSOClientError",SSOConnectionLostError:"SSOConnectionLostError",SSOServerError:"SSOServerError",SSOUserConsentNotSupportedByCurrentAddinCategory:"SSOUserConsentNotSupportedByCurrentAddinCategory",SpecifiedIdNotExist:"SpecifiedIdNotExist",TooManyArguments:"TooManyArguments",TooManyOptionalFunctions:"TooManyOptionalFunctions",TooManyOptionalObjects:"TooManyOptionalObjects",UnsupportedEnumeration:"UnsupportedEnumeration",UnsupportedUserIdentity:"UnsupportedUserIdentity",UserAborted:"UserAborted",UserNotSignedIn:"UserNotSignedIn"}}(OSF||(OSF={})),function(e){var t=function(){function e(e){if(this._eventInfos={},this._queuedEventsArgs={},this._eventHandlers={},this._queuedEventsArgs={},null!=e)for(var t=0;t<e.length;t++)if("string"==typeof e[t]){var n=e[t];this._eventHandlers[n]=[],this._queuedEventsArgs[n]=[]}else{n=e[t].type;this._eventInfos[n]=e[t],this._eventHandlers[n]=[],this._queuedEventsArgs[n]=[]}}return e.prototype.getSupportedEvents=function(){var e=[];for(var t in this._eventHandlers)e.push(t);return e},e.prototype.supportsEvent=function(e){for(var t in this._eventHandlers)if(e==t)return!0;return!1},e.prototype.hasEventHandler=function(e,t){var n=this._eventHandlers[e];if(n&&n.length>0)for(var r=0;r<n.length;r++)if(n[r]===t)return!0;return!1},e.prototype.addEventHandler=function(e,t){if("function"!=typeof t)return!1;var n=this._eventHandlers[e];return!(!n||this.hasEventHandler(e,t))&&(n.push(t),!0)},e.prototype.addEventHandlerAndFireQueuedEvent=function(e,t){var n=this._eventHandlers[e],r=!n||0==n.length,i=this.addEventHandler(e,t);return r&&i&&this.fireQueuedEvent(e),i},e.prototype.removeEventHandler=function(e,t){var n=this._eventHandlers[e];if(n&&n.length>0)for(var r=0;r<n.length;r++)if(n[r]===t)return n.splice(r,1),!0;return!1},e.prototype.clearEventHandlers=function(e){return void 0!==this._eventHandlers[e]&&this._eventHandlers[e].length>0&&(this._eventHandlers[e]=[],!0)},e.prototype.getEventHandlerCount=function(e){return null!=this._eventHandlers[e]?this._eventHandlers[e].length:-1},e.prototype.getEventInfo=function(e){return this._eventInfos[e]},e.prototype.fireEvent=function(e){if(null==e.type)return!1;var t=e.type;if(t&&this._eventHandlers[t]){for(var n=this._eventHandlers[t],r=0;r<n.length;r++)n[r](e);return!0}return!1},e.prototype.fireOrQueueEvent=function(e){if(null==e.type)return!1;var t=e.type;if(t&&this._eventHandlers[t]){var n=this._eventHandlers[t],r=this._queuedEventsArgs[t];return 0==n.length?r.push(e):this.fireEvent(e),!0}return!1},e.prototype.fireQueuedEvent=function(e){if(e&&this._eventHandlers[e]){var t=this._eventHandlers[e],n=this._queuedEventsArgs[e];if(t.length>0){for(var r=t[0];n.length>0;){r(n.shift())}return!0}}return!1},e.prototype.clearQueuedEvent=function(e){e&&this._eventHandlers[e]&&(this._queuedEventsArgs[e]&&(this._queuedEventsArgs[e]=[]))},e}();e.EventDispatch=t}(OSF||(OSF={})),function(e){!function(e){e.dispidEventMin=0,e.dispidInitializeEvent=0,e.dispidSettingsChangedEvent=1,e.dispidDocumentSelectionChangedEvent=2,e.dispidBindingSelectionChangedEvent=3,e.dispidBindingDataChangedEvent=4,e.dispidDocumentOpenEvent=5,e.dispidDocumentCloseEvent=6,e.dispidActiveViewChangedEvent=7,e.dispidDocumentThemeChangedEvent=8,e.dispidOfficeThemeChangedEvent=9,e.dispidDialogMessageReceivedEvent=10,e.dispidDialogNotificationShownInAddinEvent=11,e.dispidDialogParentMessageReceivedEvent=12,e.dispidObjectDeletedEvent=13,e.dispidObjectSelectionChangedEvent=14,e.dispidObjectDataChangedEvent=15,e.dispidContentControlAddedEvent=16,e.dispidLiveShareStateChangedEvent=17,e.dispidActivationStatusChangedEvent=32,e.dispidRichApiMessageEvent=33,e.dispidAppCommandInvokedEvent=39,e.dispidOnSdxSendMessageEvent=40,e.dispidDataNodeAddedEvent=60,e.dispidDataNodeReplacedEvent=61,e.dispidDataNodeDeletedEvent=62}(e.EventDispId||(e.EventDispId={}))}(OSF||(OSF={})),function(e){var t=function(){function t(){}return t.addEventHandler=function(n,r,i,o,a,s){var c=0;function l(t){0==t&&(o.hasEventHandler(n,r)||o.addEventHandler(n,r)||(t=5010));e._OfficeAppFactory.getAsyncMethodExecutor().invokeCallback(c,i,t,null,a)}var d=o.getEventInfo(n);if(d)try{if(s)return void l(0);c=d.id;var u=d.getTargetId();if(0==o.getEventHandlerCount(n))e._OfficeAppFactory.getAsyncMethodExecutor().registerEventAsync(c,d.type,u,(function(e){o.fireEvent(e)}),d,(function(t){l(e.Utility.getErrorCodeFromAsyncResult(t))}),a);else l(0)}catch(e){t.onException(c,e,i)}else l(5010)},t.removeEventHandler=function(n,r,i,o,a,s){var c=0;function l(t){e._OfficeAppFactory.getAsyncMethodExecutor().invokeCallback(c,i,t,null,a)}var d=o.getEventInfo(n);if(d)try{c=d.id;var u=d.getTargetId(),f=0,p=!0;null===r?(p=o.clearEventHandlers(n),f=0):f=(p=o.removeEventHandler(n,r))?0:5003;var m=o.getEventHandlerCount(n);if(p&&0==m)e._OfficeAppFactory.getAsyncMethodExecutor().unregisterEventAsync(c,d.type,u,(function(t){l(e.Utility.getErrorCodeFromAsyncResult(t))}),a);else l(f)}catch(e){t.onException(c,e,i)}else l(5010)},t.onException=function(t,n,r){if("number"!=typeof n)throw n;e._OfficeAppFactory.getAsyncMethodExecutor().invokeCallback(t,r,n,null)},t}();e.EventHelper=t}(OSF||(OSF={})),function(e){!function(e){e.ActiveViewChanged="activeViewChanged",e.AppCommandInvoked="appCommandInvoked",e.RichApiMessage="richApiMessage",e.DocumentSelectionChanged="documentSelectionChanged",e.BindingSelectionChanged="bindingSelectionChanged",e.BindingDataChanged="bindingDataChanged",e.OfficeThemeChanged="officeThemeChanged",e.DocumentThemeChanged="documentThemeChanged",e.LiveShareStateChanged="liveShareStateChanged",e.DataNodeDeleted="nodeDeleted",e.DataNodeInserted="nodeInserted",e.DataNodeReplaced="nodeReplaced",e.DialogMessageReceived="dialogMessageReceived",e.DialogParentMessageReceived="dialogParentMessageReceived",e.DialogParentEventReceived="dialogParentEventReceived",e.DialogEventReceived="dialogEventReceived",e.NodeDeleted="nodeDeleted",e.NodeInserted="nodeInserted",e.NodeReplaced="nodeReplaced",e.SettingsChanged="settingsChanged"}(e.EventType||(e.EventType={}))}(OSF||(OSF={})),function(e){!function(t){var n=function(){function t(){this.platformRemappings={web:Office.PlatformType.OfficeOnline,winrt:Office.PlatformType.Universal,win32:Office.PlatformType.PC,mac:Office.PlatformType.Mac,ios:Office.PlatformType.iOS,android:Office.PlatformType.Android},this.camelCaseMappings={powerpoint:Office.HostType.PowerPoint,onenote:Office.HostType.OneNote},this.hostInfo=e._OfficeAppFactory.getHostInfo()}return t.prototype.capitalizeFirstLetter=function(e){return e?e[0].toUpperCase()+e.slice(1).toLowerCase():e},t.getInstance=function(){return void 0===t.hostObj&&(t.hostObj=new t),t.hostObj},t.prototype.getPlatform=function(e){if(this.hostInfo&&this.hostInfo.hostPlatform){var t=this.hostInfo.hostPlatform.toLowerCase();if(this.platformRemappings[t])return this.platformRemappings[t]}return null},t.prototype.getHost=function(e){if(this.hostInfo&&this.hostInfo.hostType){var t=this.hostInfo.hostType.toLowerCase();if(this.camelCaseMappings[t])return this.camelCaseMappings[t];if(t=this.capitalizeFirstLetter(this.hostInfo.hostType),Office.HostType[t])return Office.HostType[t]}return null},t.prototype.getDefaultVersion=function(){return this.getHost()?"16.0.0000.0000":null},t.prototype.getDiagnostics=function(e){return{host:this.getHost(),version:e||this.getDefaultVersion(),platform:this.getPlatform()}},t}();t.Host=n}(e.HostName||(e.HostName={}))}(OSF||(OSF={})),function(e){!function(e){e[e.SharedApp=1]="SharedApp",e[e.CustomFunction=2]="CustomFunction",e[e.ProtectedDocDisable=4]="ProtectedDocDisable",e[e.ExperimentJsEnabled=8]="ExperimentJsEnabled",e[e.PublicAddin=16]="PublicAddin",e[e.BundleJsEnabled=32]="BundleJsEnabled",e[e.IsMos=64]="IsMos",e[e.IsMonarch=128]="IsMonarch",e[e.CustomFunctionsInitAfterCFRuntimeReady=256]="CustomFunctionsInitAfterCFRuntimeReady"}(e.HostInfoFlags||(e.HostInfoFlags={}))}(OSF||(OSF={})),function(e){!function(e){e.excel="excel",e.word="word"}(e.HostInfoHostType||(e.HostInfoHostType={}))}(OSF||(OSF={})),function(e){!function(e){e.web="web",e.winrt="winrt",e.win32="win32",e.mac="mac",e.ios="ios",e.android="android"}(e.HostInfoPlatform||(e.HostInfoPlatform={}))}(OSF||(OSF={})),function(e){var t=function(){function t(e,t,n,r){this._hostInfo=e,this._webAppState=t,this._context=n,this._hostFacade=r}return t.prototype.saveAndSetDialogInfo=function(e){},t.prototype.setAgaveHostCommunication=function(){},t.prototype.createClientHostController=function(){return null},t.prototype.createAsyncMethodExecutor=function(){return null},t.prototype.createClientSettingsManager=function(){return null},t.prototype.createSettings=function(t){var n=e.OUtil.getSessionStorage();if(n){var r=n.getItem(e._OfficeAppFactory.getCachedSessionSettingsKey());r?t=JSON.parse(r):(r=JSON.stringify(t),n.setItem(e._OfficeAppFactory.getCachedSessionSettingsKey(),r))}var i=e.OUtil.deserializeSettings(t),o=this.createClientSettingsManager();return new Office.Settings(i,o)},t.prototype.prepareApiSurface=function(t){var n=t.get_featureGates();n&&(Microsoft.Office.WebExtension.FeatureGates=n),e.BootStrapExtension.prepareApiSurface&&e.BootStrapExtension.prepareApiSurface(),e.BootStrapExtension.prepareHostSpecificSurface&&e.BootStrapExtension.prepareHostSpecificSurface(),OSFPerformance.createOMEnd=OSFPerformance.now()},t.prototype.getTabbableElements=function(){return null},t.prototype.setupNestedAppAuthDependencies=function(){},t.prototype.setCreateNaaBridge=function(e){this._createNaaBridge=e},t}();e.InitializationHelper=t}(OSF||(OSF={})),function(e){!function(e){e.Inserted="inserted",e.DocumentOpened="documentOpened"}(e.InitializationReason||(e.InitializationReason={}))}(OSF||(OSF={})),OSF||(OSF={}),function(e){var t;e.DisabledChangeGates=[],function(t){var n=0,r="resources.office.net",i="officeapps.live.com";t.getLibraryReleaseVehicle=function(){return n},t.setLibraryReleaseVehicle=function(e){n=e},t.isChangeGateEnabled=function(t){return!e.DisabledChangeGates||-1===e.DisabledChangeGates.indexOf(t)};var o=null,a=null,s=[];function c(){if(!a&&o&&o.officeCdnEndpoint)if(o.officeCdnEndpoint.origin&&o.officeCdnEndpoint.origin.length>0){var e="";e=o.officeCdnEndpoint.isOCDICompliant?"/"===o.officeCdnEndpoint.origin[o.officeCdnEndpoint.origin.length-1]?"beta/":"/beta/":"/"===o.officeCdnEndpoint.origin[o.officeCdnEndpoint.origin.length-1]?"appsforoffice/lib/beta/hosted/":"/appsforoffice/lib/beta/hosted/",a=o.officeCdnEndpoint.origin+e}else{var t=function(e){var t=new URL(e).hostname.toLowerCase();if(-1!==t.indexOf(r,t.length-r.length))return r;if(-1!==t.indexOf(i,t.length-i.length))return i;var n=t.split(".");return n.length<5||"mro1cdnstorage"!==n[1]?void 0:n.slice(2).join(".")}(window.location.href);t&&"public.onecdn.static.microsoft"!==t?"public.cdn.office.net"===t||t===r||t===i?(o.officeCdnEndpoint.isOCDICompliant=!1,o.officeCdnEndpoint.isSovereign=!1,a="https://appsforoffice.microsoft.com/lib/beta/hosted/"):(o.officeCdnEndpoint.isOCDICompliant=!1,o.officeCdnEndpoint.isSovereign=!0,a="https://appsforoffice."+t+"/appsforoffice/lib/beta/hosted/"):(o.officeCdnEndpoint.isOCDICompliant=!0,o.officeCdnEndpoint.isSovereign=!1,a="https://officeapis.public.onecdn.static.microsoft/beta/")}}function l(e){var t=[];return Array.isArray(e)?(e.forEach((function(e){if("string"==typeof e){e=e.toLowerCase();try{var n=new URL(e);if("https:"===n.protocol){var r=n.hostname;-1===t.indexOf(r)&&t.push(r)}}catch(e){}}})),t):t}function d(){if(!e.OUtil.isChangeGateEnabled("Microsoft.Office.SharedOnline.ChangeGate.OfficeVSO_10910853_OfficeJsNPMDownloadTrustedDomainList"))return"object"==typeof officeInitializationSettings&&officeInitializationSettings?officeInitializationSettings:{};if(!o){var t="officeInitializationSettings";if(window.hasOwnProperty(t)){var n=window.officeInitializationSettings;"object"==typeof n&&null!==n&&(o=n)}1!==e.OUtil.getLibraryReleaseVehicle()?o?(o.officeCdnEndpoint={},s=l(o.addinTrustedOrigins)):o={trustAllCloudEnvironments:!1,officeCdnEndpoint:{},addinTrustedOrigins:[]}:(o?(o.trustAllCloudEnvironments=!1,o.officeCdnEndpoint&&"object"==typeof o.officeCdnEndpoint||(o.officeCdnEndpoint={origin:"",isSovereign:!1,isOCDICompliant:!1,isSdx:!1,trustedTypesOptIn:!1}),"string"==typeof o.officeCdnEndpoint.origin?o.officeCdnEndpoint.origin=o.officeCdnEndpoint.origin.trim():o.officeCdnEndpoint.origin="",s=l(o.addinTrustedOrigins)):o={trustAllCloudEnvironments:!1,officeCdnEndpoint:{origin:"",isSovereign:!1,isOCDICompliant:!1,isSdx:!1,trustedTypesOptIn:!1},addinTrustedOrigins:[]},c())}return o}t.isHostNameInAddinTrustedDomains=function(e){return!!e&&(d(),!!s&&-1!==s.indexOf(e.toLowerCase()))},t.getCustomOfficeInitializationSettings=d,t.getAppsForOfficeBaseForNpm=function(){return a||d(),a||""}}(t=e.OUtil||(e.OUtil={})),function(n){var r,i=null,o=!1,a=["excel","word","powerpoint","onenote","outlook","visio","office-common","office.common","office","officebase"],s=[".js",".debug.js"],c="_osfDisableHostCheck",l=function(){try{return document.currentScript}catch(e){return null}}();function d(){return 1===e.OUtil.getLibraryReleaseVehicle()?e.OUtil.getCustomOfficeInitializationSettings().officeCdnEndpoint.trustedTypesOptIn:(f(),r.trustedTypesOptIn)}function u(e,t){var n=null!=e?e.src:null;if(!n)return null;var r=n.toLowerCase(),i="",o=!1,a=!0,s=void 0,c=!1;if(t){var l=r.indexOf(t);if(!(l>=0)||0!==l&&"/"!==n.charAt(l-1)&&"\\"!==n.charAt(l-1)||l+t.length!==n.length&&"?"!==n.charAt(l+t.length))a=!1;else{i=n.substring(0,l),o=r.indexOf(".debug.js",l)>0;var d=e.getAttribute("data-is-sdx");c="1"===d||"true"===d;var u=e.getAttribute("data-enable-trusted-types");s=null!=u?"1"===u||"true"===u:void 0}}return a?{basePath:i,name:t||"",isDebugJs:o,isSdx:c,trustedTypesOptIn:s}:null}function f(){if(!r){if(e.OUtil.isChangeGateEnabled("Microsoft.Office.SharedOnline.ChangeGate.OfficeVSO_10910853_OfficeJsNPMDownloadTrustedDomainList")){var t=function(e){for(var t=0;t<a.length;t++)for(var n=0;n<s.length;n++){var r=u(e,a[t]+s[n]);if(r)return r}return null};if(1===e.OUtil.getLibraryReleaseVehicle())return void(r={basePath:"",name:"",isDebugJs:!1,isSdx:!1,trustedTypesOptIn:!1});if(r=t(l))return;for(var n=document.getElementsByTagName("script"),i=n.length,o=0;o<i;o++)if(r=t(n[o]))return}else{var c=function(e){var t=null!=e?e.src:null;if(!t)return null;for(var n=t.toLowerCase(),r=0;r<a.length;r++)for(var i=0;i<s.length;i++){var o=a[r]+s[i],c=n.indexOf(o);if(c>=0&&(0===c||"/"===t.charAt(c-1)||"\\"===t.charAt(c-1))&&(c+o.length===t.length||"?"===t.charAt(c+o.length))){var l=t.substring(0,c),d=n.indexOf(".debug.js",c)>0,u=e.getAttribute("data-is-sdx"),f="1"===u||"true"===u,p=e.getAttribute("data-enable-trusted-types");return{basePath:l,name:o,isDebugJs:d,isSdx:f,trustedTypesOptIn:null!=p?"1"===p||"true"===p:void 0}}}return null};if(r=c(l))return;var d=document.getElementsByTagName("script"),f=d.length;for(o=0;o<f;o++)if(r=c(d[o]))return}r={basePath:"",name:"",isDebugJs:!1,isSdx:!1,trustedTypesOptIn:!1}}}n.getHostBundleJsBasePath=function(){return e.OUtil.isChangeGateEnabled("Microsoft.Office.SharedOnline.ChangeGate.OfficeVSO_10910853_OfficeJsNPMDownloadTrustedDomainList")&&1===e.OUtil.getLibraryReleaseVehicle()?e.OUtil.getAppsForOfficeBaseForNpm():(f(),r.basePath)},n.getHostBundleJsName=function(){return f(),r.name},n.getOfficeStringJsName=function(){return f(),r.isDebugJs?e.ConstantNames.OfficeStringDebugJS:e.ConstantNames.OfficeStringJS},n.isSdx=function(){return 1===e.OUtil.getLibraryReleaseVehicle()?e.OUtil.getCustomOfficeInitializationSettings().officeCdnEndpoint.isSdx:(f(),r.isSdx)},n.setIsSdx=function(t){1===e.OUtil.getLibraryReleaseVehicle()&&(e.OUtil.getCustomOfficeInitializationSettings().officeCdnEndpoint.isSdx=t)},n.disableHostCheck=function(){return f(),window.hasOwnProperty(c)&&!0===window._osfDisableHostCheck},n.getTrustedTypesOptIn=d,n.loadScriptWithBasename=function(e,n,i){f();var o=e+(r.isDebugJs?".debug.js":".js");o=o.toLowerCase();var a=r.basePath+o;t.loadScript(a,n,m())};var p=["https://alcdn.msauth.net/browser-1p/2.28.1/js/msal-browser-1p.min.js"];function m(){if(!o){o=!0;try{var t=d();if(!(null!=t?t:e.OUtil.isSecureDefaultsEnabled())||!window.trustedTypes||!window.trustedTypes.createPolicy)return null;var n=l.src,r=new URL(n).origin.toLowerCase();if(!r)return null;i=window.trustedTypes.createPolicy("officejs",{createScriptURL:function(e){var t=e.toLowerCase(),n=new URL(t).origin;if(r&&r===n)return e;for(var i=0,o=p;i<o.length;i++){if(t===o[i])return e}throw new Error("Untrusted script URL")}})}catch(e){}}return i}n.getTrustedTypesPolicy=m}(e.LoadScriptHelper||(e.LoadScriptHelper={}))}(OSF||(OSF={})),function(e){var t;!function(e){e[e.MaxLiveShareStateDataSizeInBytes=1024]="MaxLiveShareStateDataSizeInBytes"}(t=e.LiveShareStateParams||(e.LiveShareStateParams={}));var n=function(){function e(e){var t=this;e=e||null,this._liveShareState=e,this._eventDispatch=new OSF.EventDispatch([{id:OSF.EventDispId.dispidLiveShareStateChangedEvent,type:OSF.EventType.LiveShareStateChanged,getTargetId:function(){return""},fromSafeArrayHost:function(e){return{type:OSF.EventType.LiveShareStateChanged,liveShareState:t}},fromWebHost:function(e){return{type:OSF.EventType.LiveShareStateChanged,liveShareState:t}}}])}return e.prototype.get=function(){return this._liveShareState},e.prototype.set=function(e){if((new TextEncoder).encode(e).length>t.MaxLiveShareStateDataSizeInBytes)throw new Error("State data size is limited to "+t.MaxLiveShareStateDataSizeInBytes+" bytes.");this._liveShareState=e},e.prototype.addHandlerAsync=function(e,t,n){OSF.EventHelper.addEventHandler(e,t,n,this._eventDispatch)},e.prototype.removeHandlerAsync=function(e,t,n){OSF.EventHelper.removeEventHandler(e,t,n,this._eventDispatch)},e}();e.LiveShareState=n}(Office||(Office={})),function(e){var t={"ar-sa":!0,"bg-bg":!0,"bn-in":!0,"ca-es":!0,"cs-cz":!0,"da-dk":!0,"de-de":!0,"el-gr":!0,"en-us":!0,"es-es":!0,"et-ee":!0,"eu-es":!0,"fa-ir":!0,"fi-fi":!0,"fr-fr":!0,"gl-es":!0,"he-il":!0,"hi-in":!0,"hr-hr":!0,"hu-hu":!0,"id-id":!0,"it-it":!0,"ja-jp":!0,"kk-kz":!0,"ko-kr":!0,"lo-la":!0,"lt-lt":!0,"lv-lv":!0,"ms-my":!0,"nb-no":!0,"nl-nl":!0,"nn-no":!0,"pl-pl":!0,"pt-br":!0,"pt-pt":!0,"ro-ro":!0,"ru-ru":!0,"sk-sk":!0,"sl-si":!0,"sr-cyrl-cs":!0,"sr-cyrl-rs":!0,"sr-latn-cs":!0,"sr-latn-rs":!0,"sv-se":!0,"th-th":!0,"tr-tr":!0,"uk-ua":!0,"ur-pk":!0,"vi-vn":!0,"zh-cn":!0,"zh-tw":!0},n={ar:"ar-sa",bg:"bg-bg",bn:"bn-in",ca:"ca-es",cs:"cs-cz",da:"da-dk",de:"de-de",el:"el-gr",en:"en-us",es:"es-es",et:"et-ee",eu:"eu-es",fa:"fa-ir",fi:"fi-fi",fr:"fr-fr",gl:"gl-es",he:"he-il",hi:"hi-in",hr:"hr-hr",hu:"hu-hu",id:"id-id",it:"it-it",ja:"ja-jp",kk:"kk-kz",ko:"ko-kr",lo:"lo-la",lt:"lt-lt",lv:"lv-lv",ms:"ms-my",nb:"nb-no",nl:"nl-nl",nn:"nn-no",pl:"pl-pl",pt:"pt-br",ro:"ro-ro",ru:"ru-ru",sk:"sk-sk",sl:"sl-si",sr:"sr-cyrl-cs",sv:"sv-se",th:"th-th",tr:"tr-tr",uk:"uk-ua",ur:"ur-pk",vi:"vi-vn",zh:"zh-cn"};e.getSupportedLocale=function(e,r){if(void 0===r&&(r="en-us"),!e)return r;var i;if((e=e.toLowerCase())in t)i=e;else{var o=e.split("-",1);o&&o.length>0&&(i=n[o[0]])}return i||(i=r),i}}(OSF||(OSF={})),function(e){e.OfficeOM||(e.OfficeOM={})}(Strings||(Strings={})),function(e){!function(t){var n;t.ensureOfficeStringsJs=function(){return n||(n=1==e.OUtil.getLibraryReleaseVehicle()?new Office.Promise((function(e,t){e()})):new Office.Promise((function(n,r){if(e.OUtil.isChangeGateEnabled("Microsoft.Office.SharedOnline.ChangeGate.OfficeVSO_9441111_DefaultLocaleOfficeStrings")){var i=e.LoadScriptHelper.getHostBundleJsBasePath()+e.ConstantNames.DefaultLocale+"/"+e.LoadScriptHelper.getOfficeStringJsName();e.OUtil.loadScript(i,(function(t){t?n():r(new Error("Cannot load "+e.ConstantNames.OfficeStringJS))}),e.LoadScriptHelper.getTrustedTypesPolicy())}else{if(!e._OfficeAppFactory.getHostInfo().hostLocale)return void r(new Error("No host locale"));i=e.LoadScriptHelper.getHostBundleJsBasePath()+e._OfficeAppFactory.getHostInfo().hostLocale+"/"+e.LoadScriptHelper.getOfficeStringJsName();e.OUtil.loadScript(i,(function(i){if(i)n();else{var o=e.LoadScriptHelper.getHostBundleJsBasePath()+e.ConstantNames.DefaultLocale+"/"+e.LoadScriptHelper.getOfficeStringJsName();t.loadScript(o,(function(t){t?n():r(new Error("Cannot load "+e.ConstantNames.OfficeStringJS))}),e.LoadScriptHelper.getTrustedTypesPolicy())}}),e.LoadScriptHelper.getTrustedTypesPolicy())}}))),n}}(e.OUtil||(e.OUtil={}))}(OSF||(OSF={})),function(e){!function(t){!function(t){var n;OSF.definePropertyOnNamespace(t,"url",(function(){return OSF._OfficeAppFactory.getOfficeAppContext().get_docUrl()})),OSF.definePropertyOnNamespace(t,"mode",(function(){return 0==OSF._OfficeAppFactory.getOfficeAppContext().get_clientMode()?e.DocumentMode.ReadOnly:e.DocumentMode.ReadWrite})),OSF.definePropertyOnNamespace(t,"settings",(function(){if(!n){var e=OSF._OfficeAppFactory.getOfficeAppContext().get_settingsFunc()();n=OSF._OfficeAppFactory.getInitializationHelper().createSettings(e)}return n})),t.goToByIdAsync=function(t,n,r,i){var o={};o[e.GoToType.Binding]=0,o[e.GoToType.NamedItem]=1,o[e.GoToType.Slide]=2,o[e.GoToType.Index]=3;var a={};a[e.SelectionMode.Default]=0,a[e.SelectionMode.Selected]=1,a[e.SelectionMode.None]=2;var s=o[n],c=0,l=i;"function"==typeof r?l=r:void 0!==r&&(c=a[r]);var d={toSafeArrayHost:function(){return[t,s,c]},fromSafeArrayHost:function(e){return e},toWebHost:function(){return{DdaGoToByIdMethod:{Id:t,GoToType:s,SelectionMode:c}}},fromWebHost:function(e){return e}};OSF._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(82,d,l)}}(t.document||(t.document={}))}(e.context||(e.context={}))}(Office||(Office={})),function(e){!function(e){!function(e){e.sendMessage=function(e){if(OSF._OfficeAppFactory.getHostInfo().hostPlatform==OSF.HostInfoPlatform.web){var t=OSF._OfficeAppFactory.getWebAppState();t.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t.id,OSF.AgaveHostAction.SendMessage,e])}else{var n=JSON.stringify(e);OSF._OfficeAppFactory.getClientHostController().execute(208,[n],null)}},e.registerOnMessageEventHandler=function(t){if(OSF._OfficeAppFactory.getHostInfo().hostPlatform==OSF.HostInfoPlatform.web)e.onMessage=t;else{OSF._OfficeAppFactory.getClientHostController().registerEvent(OSF.EventDispId.dispidOnSdxSendMessageEvent,"","",(function(e,n){var r=n.toArray();t(JSON.parse(r[0]))}),null)}}}(e.messaging||(e.messaging={}))}(e.context||(e.context={}))}(Office||(Office={})),function(e){!function(t){var n,r;OSF.definePropertyOnNamespace(t,"contentLanguage",(function(){return OSF._OfficeAppFactory.getOfficeAppContext().get_dataLocale()})),OSF.definePropertyOnNamespace(t,"displayLanguage",(function(){return OSF._OfficeAppFactory.getOfficeAppContext().get_appUILocale()})),OSF.definePropertyOnNamespace(t,"partitionKey",(function(){return OSF._OfficeAppFactory.getOfficeAppContext().get_partitionKey()})),OSF.definePropertyOnNamespace(t,"isDialog",(function(){return OSF._OfficeAppFactory.getHostInfo().isDialog})),OSF.definePropertyOnNamespace(t,"touchEnabled",(function(){return OSF._OfficeAppFactory.getOfficeAppContext().get_touchEnabled()})),OSF.definePropertyOnNamespace(t,"commerceAllowed",(function(){return OSF._OfficeAppFactory.getOfficeAppContext().get_commerceAllowed()})),OSF.definePropertyOnNamespace(t,"host",(function(){return OSF.HostName.Host.getInstance().getHost()})),OSF.definePropertyOnNamespace(t,"platform",(function(){return OSF.HostName.Host.getInstance().getPlatform()})),OSF.definePropertyOnNamespace(t,"diagnostics",(function(){return OSF.HostName.Host.getInstance().getDiagnostics(OSF._OfficeAppFactory.getOfficeAppContext().get_hostFullVersion())})),OSF.definePropertyOnNamespace(t,"requirements",(function(){if(!n){var e=OSF._OfficeAppFactory.getOfficeAppContext();e&&(n=e.get_isDialog()?OSF.Requirement.RequirementsMatrixFactory.getDefaultDialogRequirementMatrix(e):OSF.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(e))}return n})),OSF.definePropertyOnNamespace(t,"officeTheme",(function(){var e=OSF._OfficeAppFactory.getOfficeAppContext().get_officeThemeFunc();return e?"function"==typeof e?e():e:void 0})),OSF.definePropertyOnNamespace(t,"webAuth",(function(){if(OSF.DDA.WebAuth)return OSF.DDA.WebAuth})),OSF.definePropertyOnNamespace(t,"auth",(function(){if(OSF.DDA.Auth)return OSF.DDA.Auth})),OSF.definePropertyOnNamespace(t,"license",(function(){return OSF._OfficeAppFactory.getOfficeAppContext().get_eToken()})),OSF.definePropertyOnNamespace(t,"hostSettings",(function(){if(!r){var t=OSF._OfficeAppFactory.getOfficeAppContext().get_hostSettingsFunc();if(void 0!==t){var n=t(),i=OSF.OUtil.deserializeSettings(n);r=new e.Settings(i,void 0)}}return r}))}(e.context||(e.context={}))}(Office||(Office={})),function(e){!function(e){!function(e){e.refreshRibbon=function(e){OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[OSF._OfficeAppFactory.getWebAppState().id,OSF.AgaveHostAction.RefreshRibbonGallery,e])}}(e.ribbonGallery||(e.ribbonGallery={}))}(e.context||(e.context={}))}(Office||(Office={})),function(e){!function(e){!function(e){e.taskPaneAction||(e.taskPaneAction={})}(e.ui||(e.ui={}))}(e.context||(e.context={}))}(Office||(Office={}));var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};!function(e){function t(){e._officeOnReadyState.officeOnReadyPromise||(e._officeOnReadyState.officeOnReadyPromise=new e.Promise((function(t,n){e._officeOnReadyState.officeOnReadyPromiseResolve=t,e._officeOnReadyState.officeOnReadyPromiseReject=n})))}function n(){if(!e._officeOnReadyState.onReadyAllowsRejection||!e._officeOnReadyState.officeOnReadyRejected){for(OSFPerformance.officeOnReady||(OSFPerformance.officeOnReady=OSFPerformance.now()),e._officeOnReadyState.officeOnReadyPromiseResolve(e._officeOnReadyState.officeOnReadyHostAndPlatformInfo),e._officeOnReadyState.officeOnReadyPromiseReject=null;e._officeOnReadyState.officeOnReadyExternalCallbacks.length>0;)e._officeOnReadyState.officeOnReadyExternalCallbacks.shift()(e._officeOnReadyState.officeOnReadyHostAndPlatformInfo);e._officeOnReadyState.isOfficeOnReadyCalled||OSF.OUtil.waitForFunction((function(){return"function"==typeof e.initialize}),(function(t){t&&e.initialize(OSF._OfficeAppFactory.getOfficeAppContext().get_reason())}),400,50)}}function r(n,r){t();var i=e._officeOnReadyState.officeOnReadyFired&&(!r||0===Object.keys(e._officeOnReadyState.heldLocks).length);return r&&e._officeOnReadyState.onReadyAllowsRejection&&e._officeOnReadyState.officeOnReadyRejected||n&&(i?n(e._officeOnReadyState.officeOnReadyHostAndPlatformInfo):r?e._officeOnReadyState.officeOnReadyExternalCallbacks.push(n):e._officeOnReadyState.officeOnReadyInternalCallbacks.push(n)),e._officeOnReadyState.officeOnReadyPromise}e.OnReadyLockId=e.OnReadyLockId||{CustomFunctionsRuntimeReady:"CustomFunctionsRuntimeReady"},e._officeOnReadyState=e._officeOnReadyState||{isOfficeOnReadyCalled:!1,officeOnReadyPromise:null,officeOnReadyPromiseResolve:null,officeOnReadyPromiseReject:null,officeOnReadyInternalCallbacks:[],officeOnReadyExternalCallbacks:[],officeOnReadyHostAndPlatformInfo:null,officeOnReadyFired:!1,officeOnReadyRejected:!1,officeOnReadyRejectionError:null,heldLocks:{},onReadyAllowsRejection:!1},e.initialize=e.initialize,e.onReadyInternal=function(e){return r(e,!1)},e.onReady=function(t){return e._officeOnReadyState.isOfficeOnReadyCalled=!0,r(t,!0)},e.onReadyOptions=e.onReadyOptions||{setRejectionEnabled:function(){e._officeOnReadyState.onReadyAllowsRejection=!0}},e.rejectOfficeOnReady=function(n){e._officeOnReadyState.officeOnReadyRejected||(e._officeOnReadyState.officeOnReadyRejectionError=n,e._officeOnReadyState.officeOnReadyRejected=!0,e._officeOnReadyState.onReadyAllowsRejection&&(t(),e._officeOnReadyState.officeOnReadyPromiseReject&&(e._officeOnReadyState.officeOnReadyPromiseReject(n),e._officeOnReadyState.officeOnReadyExternalCallbacks=[])))},e.fireOnReady=function(r){t(),e._officeOnReadyState.officeOnReadyHostAndPlatformInfo=__assign({},r),e._officeOnReadyState.officeOnReadyFired=!0,function(){for(;e._officeOnReadyState.officeOnReadyInternalCallbacks.length>0;)e._officeOnReadyState.officeOnReadyInternalCallbacks.shift()(e._officeOnReadyState.officeOnReadyHostAndPlatformInfo)}(),Object.keys(e._officeOnReadyState.heldLocks).length>0||n()},e.acquireOnReadyLock=function(t){return Object.keys(e.OnReadyLockId).some((function(n){return e.OnReadyLockId[n]===t}))?(e._officeOnReadyState.heldLocks[t]=!0,t):null},e.releaseOnReadyLock=function(t){e._officeOnReadyState.heldLocks[t]&&(delete e._officeOnReadyState.heldLocks[t],0===Object.keys(e._officeOnReadyState.heldLocks).length&&e._officeOnReadyState.officeOnReadyPromise&&e._officeOnReadyState.officeOnReadyFired&&n())}}(Office||(Office={})),function(e){var t=function(){function t(t,n,r,i,o,a,s,c,l,d,u,f,p,m,g,h,y,v,S,b,O,_,A,T,C,E,I,P,w,D,x,M,N,F){this._id=t,this._appName=n,this._appVersion=r,this._appUILocale=i,this._dataLocale=o,this._docUrl=a,this._clientMode=s,this._settingsFunc=c,this._reason=l,this._osfControlType=d,this._eToken=u,this._correlationId=f,this._appInstanceId=p,this._touchEnabled=m,this._commerceAllowed=g,this._appMinorVersion=h,this._requirementMatrix=y,this._hostCustomMessage=v,this._hostFullVersion=S,this._isDialog=e.OUtil.isDialog(),this._clientWindowHeight=b,this._clientWindowWidth=O,this._addinName=_,this._appDomains=A,this._dialogRequirementMatrix=T,this._featureGates=C,this._officeThemeFunc=E,this._initialDisplayMode=I,this._isFromWacAutomation=P,this._wopiHostOriginForSingleSignOn=w,this._hostSettingsFunc=D,this._isWeb=x,this._nestedAppAuthBridgeType=M,this._partitionKey=N,this._topFrameOrigin=F}return t.prototype.get_id=function(){return this._id},t.prototype.get_appName=function(){return this._appName},t.prototype.get_appVersion=function(){return this._appVersion},t.prototype.get_appUILocale=function(){return this._appUILocale},t.prototype.get_dataLocale=function(){return this._dataLocale},t.prototype.get_docUrl=function(){return this._docUrl},t.prototype.get_clientMode=function(){return this._isWeb?this._clientMode:0==this._clientMode?Office.DocumentMode.ReadWrite:Office.DocumentMode.ReadOnly},t.prototype.get_settingsFunc=function(){return this._settingsFunc},t.prototype.get_reason=function(){return this._reason},t.prototype.get_osfControlType=function(){return this._osfControlType},t.prototype.get_eToken=function(){return this._eToken},t.prototype.get_correlationId=function(){return this._correlationId},t.prototype.get_appInstanceId=function(){return this._appInstanceId},t.prototype.get_touchEnabled=function(){return this._touchEnabled},t.prototype.get_commerceAllowed=function(){return this._commerceAllowed},t.prototype.get_appMinorVersion=function(){return this._appMinorVersion},t.prototype.get_requirementMatrix=function(){return this._requirementMatrix},t.prototype.get_dialogRequirementMatrix=function(){return this._dialogRequirementMatrix},t.prototype.get_hostCustomMessage=function(){return this._hostCustomMessage},t.prototype.get_hostFullVersion=function(){return this._hostFullVersion},t.prototype.get_isDialog=function(){return this._isDialog},t.prototype.get_clientWindowHeight=function(){return this._clientWindowHeight},t.prototype.get_clientWindowWidth=function(){return this._clientWindowWidth},t.prototype.get_addinName=function(){return this._addinName},t.prototype.get_appDomains=function(){return this._appDomains},t.prototype.get_taskpaneUrl=function(){return this._taskpaneUrl},t.prototype.set_taskpaneUrl=function(e){this._taskpaneUrl=e},t.prototype.get_featureGates=function(){return this._featureGates},t.prototype.get_officeThemeFunc=function(){return this._officeThemeFunc},t.prototype.get_initialDisplayMode=function(){return this._initialDisplayMode?this._initialDisplayMode:0},t.prototype.get_isFromWacAutomation=function(){return this._isFromWacAutomation},t.prototype.get_wopiHostOriginForSingleSignOn=function(){return this._wopiHostOriginForSingleSignOn},t.prototype.get_hostSettingsFunc=function(){return this._hostSettingsFunc},t.prototype.get_isWeb=function(){return this._isWeb},t.prototype.get_nestedAppAuthBridgeType=function(){return this._nestedAppAuthBridgeType},t.prototype.get_partitionKey=function(){return this._partitionKey},t.prototype.get_topFrameOrigin=function(){return this._topFrameOrigin},t}();e.OfficeAppContext=t}(OSF||(OSF={})),function(e){!function(t){t.retrieveHostInfo=function(){var t={isO15:!0,isRichClient:!0,hostType:"",hostPlatform:"",hostSpecificFileVersion:"",hostLocale:"",osfControlAppCorrelationId:"",isDialog:!1,disableLogging:!1,flags:0},n="_host_Info",r=null;try{if(window.external=window.external||{},"undefined"!=typeof agaveHost&&agaveHost.GetHostInfo&&(window.external.GetHostInfo=function(){return agaveHost.GetHostInfo()}),window.external.GetHostInfo){var i=window.external.GetHostInfo();if("isDialog"==i)t.isO15=!0,t.isDialog=!0;else{var o=i.split("_host_Info=");r=o.length>1?o[1]:i}}}catch(t){e.Utility.log(JSON.stringify(t))}if(!r)try{var a=window.name;if(a){var s=JSON.parse(a);r=s?s.hostInfo:null}}catch(t){e.Utility.log(JSON.stringify(t))}r||(r=e.Utility.getQueryStringValue(n));var c=e.OUtil.getSessionStorage();if(!r&&c.getItem("hostInfoValue")&&(r=c.getItem("hostInfoValue")),r){r=decodeURIComponent(r),t.isO15=!1;var l=r.split("$");void 0===l[2]&&(l=r.split("|")),t.hostType=void 0===l[0]?"":l[0].toLowerCase(),t.hostPlatform=void 0===l[1]?"":l[1].toLowerCase(),t.hostSpecificFileVersion=void 0===l[2]?"":l[2].toLowerCase(),t.hostLocale=void 0===l[3]?"":l[3].toLowerCase(),t.osfControlAppCorrelationId=void 0===l[4]?"":l[4],"telemetry"==t.osfControlAppCorrelationId&&(t.osfControlAppCorrelationId=""),t.isDialog=void 0!==l[5]&&"isDialog"==l[5],t.disableLogging=void 0!==l[6]&&"disableLogging"==l[6],t.flags="string"==typeof l[7]&&l[7].length>0?parseInt(l[7]):0,c.setItem("hostInfoValue",r)}else t.isO15=!0,t.hostLocale=e.Utility.getQueryStringValue("locale");return t}}(e._OfficeAppFactory||(e._OfficeAppFactory={}))}(OSF||(OSF={})),function(e){var t;!function(t){var n,r,i,o,a,s,c,l,d;"undefined"!=typeof window&&(window.location&&(n=window.location.hash,r=window.location.search),i=window.name);var u={0:"Unknown",1:"Hidden",2:"Taskpane",3:"Dialog"};function f(t,n){e.AppCommandManager.initialize();var r=t.get_appName(),i=null;0!=(o.flags&e.HostInfoFlags.SharedApp)&&(i={visibilityMode:u[t.get_initialDisplayMode()]});var s={host:e.HostName.Host.getInstance().getHost(r),platform:e.HostName.Host.getInstance().getPlatform(r),addin:i};0==(o.flags&e.HostInfoFlags.CustomFunctionsInitAfterCFRuntimeReady)||0==(o.flags&e.HostInfoFlags.CustomFunction)||t.get_isDialog()||"function"==typeof Office.acquireOnReadyLock&&Office.OnReadyLockId,o.hostPlatform!=e.HostInfoPlatform.web||Microsoft.Office.WebExtension.Interactive||(Microsoft.Office.WebExtension.Interactive=function(t){null!=a.clientEndPoint&&a.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[a.id,e.AgaveHostAction.Interactive,{isInteractive:t,timestamp:Date.now()}])}),Office.fireOnReady(s),o.hostPlatform==e.HostInfoPlatform.web&&null!=a.clientEndPoint&&a.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[a.id,e.AgaveHostAction.OfficeJsReady,Date.now()]),n(t)}function p(t,n,r,i){var o={schemaVersion:1,libraryVersion:i,timestamp:Date.now()};try{if(t==e.HostInfoPlatform.web)null!=n.clientEndPoint&&n.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n.id,e.AgaveHostAction.OfficeJsRuntimeInfo,o]);else if(r&&e.Utility.externalNativeFunctionExists(typeof r.GetContext)){var a=r.GetContext();a&&e.Utility.externalNativeFunctionExists(typeof a.NotifyOfficeJsRuntimeInfo)&&a.NotifyOfficeJsRuntimeInfo(JSON.stringify(o))}}catch(e){}}t.bootstrap=function(n,r){if(a={id:null,webAppUrl:null,conversationID:null,clientEndPoint:null,wnd:window.parent,focused:!1,serviceEndPoint:null},o=t.retrieveHostInfo(),function(){!0;try{if(o.disableLogging)return void!1;window.external=window.external||{},void 0===window.external.GetLoggingAllowed||window.external.GetLoggingAllowed()}catch(e){}}(),function(){if(o.hostPlatform===e.HostInfoPlatform.web)s=new e.WebInitializationHelper(o,a,null,null);else if(o.hostPlatform===e.HostInfoPlatform.win32)s=new e.RichClientInitializationHelper(o,a,null,null);else if(o.hostPlatform===e.HostInfoPlatform.ios||o.hostPlatform===e.HostInfoPlatform.mac){if(!(window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.Agave))throw e.Utility.createNotImplementedException();s=new e.WebkitInitializationHelper(o,a,null,null)}else o.hostPlatform===e.HostInfoPlatform.android||o.hostPlatform===e.HostInfoPlatform.winrt?s=new e.WebViewInitializationHelper(o,a,null,null):console.warn("Office.js is loaded inside in unknown host or platform "+o.hostPlatform)}(),s){o.hostPlatform===e.HostInfoPlatform.web&&s.saveAndSetDialogInfo(e.Utility.getQueryStringValue("_host_Info")),s.setAgaveHostCommunication(),p(o.hostPlatform,a,window.external,e.ConstantNames.FileVersion),s.setupNestedAppAuthDependencies(),OSFPerformance.getAppContextStart=OSFPerformance.now();s.getAppContext(window,(function(t){OSFPerformance.getAppContextEnd=OSFPerformance.now(),e.AppTelemetry.initialize(t),l=t,d=s.createClientHostController(),c=s.createAsyncMethodExecutor(),s.prepareApiSurface(t),e.BootStrapExtension.onGetAppContext?e.BootStrapExtension.onGetAppContext(t,a.wnd).then((function(){f(t,n)})):f(t,n)}),(function(e){r(e)}))}else r(new Error("Office.js cannot be initialized."))},t.notifyHostOfficeJsRuntimeInfo=p,t.getWindowName=function(){return i},t.getWindowLocationHash=function(){return n},t.getWindowLocationSearch=function(){return r},t.getAsyncMethodExecutor=function(){return c},t.getOfficeAppContext=function(){return l},t.getHostInfo=function(){return o},t.getCachedSessionSettingsKey=function(){return(null!=a.conversationID?a.conversationID:l.get_appInstanceId())+"CachedSessionSettings"},t.getWebAppState=function(){return a},t.getId=function(){return a.id},t.getInitializationHelper=function(){return s},t.getClientHostController=function(){return d}}(t=e._OfficeAppFactory||(e._OfficeAppFactory={})),e.getClientEndPoint=function(){return t.getWebAppState().clientEndPoint}}(OSF||(OSF={})),function(e){!function(e){e.Succeeded="succeeded",e.Failed="failed"}(e.AsyncResultStatus||(e.AsyncResultStatus={})),function(e){e.ReadOnly="readOnly",e.ReadWrite="readWrite"}(e.DocumentMode||(e.DocumentMode={})),function(e){e.Word="Word",e.Excel="Excel",e.PowerPoint="PowerPoint",e.Outlook="Outlook",e.OneNote="OneNote",e.Project="Project",e.Access="Access",e.Visio="Visio"}(e.HostType||(e.HostType={})),function(e){e.Inserted="inserted",e.DocumentOpened="documentOpened"}(e.InitializationReason||(e.InitializationReason={})),function(e){e.PC="PC",e.OfficeOnline="OfficeOnline",e.Mac="Mac",e.iOS="iOS",e.Android="Android",e.Universal="Universal"}(e.PlatformType||(e.PlatformType={})),function(e){e.Binding="binding",e.NamedItem="namedItem",e.Slide="slide",e.Index="index"}(e.GoToType||(e.GoToType={})),function(e){e.Default="default",e.Selected="selected",e.None="none"}(e.SelectionMode||(e.SelectionMode={})),function(e){e.Unformatted="unformatted",e.Formatted="formatted"}(e.ValueFormat||(e.ValueFormat={})),function(e){e.Text="text",e.Compressed="compressed",e.Pdf="pdf"}(e.FileType||(e.FileType={})),e.CoercionType={Html:"html",Matrix:"matrix",Ooxml:"ooxml",OoxmlPackage:"ooxmlPackage",PdfFile:"pdfFile",SlideRange:"slideRange",Table:"table",Text:"text"},function(e){e.Table="table",e.Text="text",e.Matrix="matrix"}(e.BindingType||(e.BindingType={})),function(e){e.OnlyVisible="onlyVisible",e.All="all"}(e.FilterType||(e.FilterType={})),function(e){e[e.All=0]="All",e[e.Data=1]="Data",e[e.Headers=2]="Headers"}(e.Table||(e.Table={})),function(e){e.Read="read",e.Edit="edit"}(e.ActiveView||(e.ActiveView={})),function(e){e[e.None=0]="None",e[e.EditOccurred=1]="EditOccurred",e[e.NewUndoEntry=2]="NewUndoEntry",e[e.UndoPerformed=4]="UndoPerformed",e[e.RedoPerformed=8]="RedoPerformed",e[e.UndoStackCleared=16]="UndoStackCleared"}(e.UndoStackChangedReason||(e.UndoStackChangedReason={}))}(Office||(Office={}));var OSFPerfUtil,OSFWebkit,SDX,OTel,__extends=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),__awaiter=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new n((function(t){t(e.value)})).then(a,s)}c((r=r.apply(e,t||[])).next())}))},__generator=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};!function(e){e.appSpecificCheckOrigin=function(e,t,n,r){return!1}}(OfficeExt||(OfficeExt={})),function(e){var t=function(){function e(e,t,n){this._method=e,this._invokeType=t,this._blockingOthers=n}return e.prototype.getMethod=function(){return this._method},e.prototype.getInvokeType=function(){return this._invokeType},e.prototype.getBlockingFlag=function(){return this._blockingOthers},e}();e.XdmMethodObject=t;var n=function(){function e(e,t){this._registerMethodObject=e,this._unregisterMethodObject=t}return e.prototype.getRegisterMethodObject=function(){return this._registerMethodObject},e.prototype.getUnregisterMethodObject=function(){return this._unregisterMethodObject},e}();e.XdmEventMethodObject=n;var r=function(){function r(e){this._methodObjectList={},this._eventHandlerProxyList={},this._conversations={},this._policyManager=null,this._appDomains={},this._onHandleRequestError=null,this._methodObjectList={},this._eventHandlerProxyList={},this._Id=e,this._conversations={},this._policyManager=null,this._appDomains={},this._onHandleRequestError=null}return r.prototype.registerMethod=function(n,r,i,o){if(0!==i&&1!==i)throw e.Utility.createArgumentException("invokeType");var a=new t(r,i,o);this._methodObjectList[n]=a},r.prototype.unregisterMethod=function(e){delete this._methodObjectList[e]},r.prototype.registerEvent=function(e,r,i){var o=new n(new t(r,4,!1),new t(i,5,!1));this._methodObjectList[e]=o},r.prototype.registerEventEx=function(e,r,i,o,a){var s=new n(new t(r,i,!1),new t(o,a,!1));this._methodObjectList[e]=s},r.prototype.unregisterEvent=function(e){this.unregisterMethod(e)},r.prototype.registerConversation=function(t,n,r){if(e.Utility.xdmDebugLog("registerConversation: cId="+t+" Url="+n),r){if(!Array.isArray(r))throw e.Utility.createArgumentException("appDomains");this._appDomains[t]=r}this._conversations[t]={url:n}},r.prototype.unregisterConversation=function(e){delete this._conversations[e]},r.prototype.setPolicyManager=function(t){if(!t.checkPermission)throw e.Utility.createArgumentException("policyManager");this._policyManager=t},r.prototype.getPolicyManager=function(){return this._policyManager},r.prototype.dispose=function(){this._methodObjectList=null,this._eventHandlerProxyList=null,this._Id=null,this._conversations=null,this._policyManager=null,this._appDomains=null,this._onHandleRequestError=null},r}();e.XdmServiceEndPoint=r;var i,o=function(){function e(e,t,n){this._callbackList={},this._eventHandlerList={},this._hostTrustCheckStatus=0,this._checkStatusLogged=!1,this._fHostTrusted=!1,this._conversationId=e,this._targetWindow=t,this._targetUrl=n,this._callingIndex=0,this._callbackList={},this._eventHandlerList={},this._checkReceiverOriginAndRun=null}return Object.defineProperty(e.prototype,"targetUrl",{get:function(){return this._targetUrl},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hostTrustCheckStatus",{get:function(){return this._hostTrustCheckStatus},set:function(e){this._hostTrustCheckStatus=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fHostTrusted",{get:function(){return this._fHostTrusted},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"checkStatusLogged",{get:function(){return this._checkStatusLogged},set:function(e){this._checkStatusLogged=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"checkReceiverOriginAndRun",{get:function(){return this._checkReceiverOriginAndRun},set:function(e){this._checkReceiverOriginAndRun=e},enumerable:!0,configurable:!0}),e.prototype.invoke=function(e,t,n){var r=this,o=function(){var o=r._callingIndex++,a=new Date,c={callback:t,createdOn:a.getTime()};n&&"object"==typeof n&&"number"==typeof n.__timeout__&&(c.timeout=n.__timeout__,delete n.__timeout__),r._callbackList[o]=c;try{if(3!==r._hostTrustCheckStatus&&"ContextActivationManager_getAppContextAsync"!==e)throw"Access Denied";var d=new s(e,0,r._conversationId,o,n),u=l.envelope(d);r._targetWindow.postMessage(u,r._targetUrl),i._startMethodTimeoutTimer()}catch(e){try{null!==t&&t(-1,e)}finally{delete r._callbackList[o]}}};this._checkReceiverOriginAndRun?this._checkReceiverOriginAndRun(o):(this._hostTrustCheckStatus=3,o())},e.prototype.registerForEvent=function(e,t,n,r){var o=this._callingIndex++,a=new Date;this._callbackList[o]={callback:n,createdOn:a.getTime()};try{var c=new s(e,1,this._conversationId,o,r),d=l.envelope(c);this._targetWindow.postMessage(d,this._targetUrl),i._startMethodTimeoutTimer(),this._eventHandlerList[e]=t}catch(e){try{null!==n&&n(-1,e)}finally{delete this._callbackList[o]}}},e.prototype.unregisterForEvent=function(e,t,n){var r=this._callingIndex++,o=new Date;this._callbackList[r]={callback:t,createdOn:o.getTime()};try{var a=new s(e,2,this._conversationId,r,n),c=l.envelope(a);this._targetWindow.postMessage(c,this._targetUrl),i._startMethodTimeoutTimer()}catch(e){try{null!==t&&t(-1,e)}finally{delete this._callbackList[r]}}finally{delete this._eventHandlerList[e]}},e}();e.XdmClientEndPoint=o,function(t){var n,i=[],a=null,s=null,d=!1,p={},m={},g=!1;function h(t){for(var n in p)if(p[n]._conversations[t])return p[n];throw e.Utility.createArgumentException("conversationId")}function y(t){var n=m[t];return n||e.Utility.xdmDebugLog("Unknown conversation Id."),n}function v(t,n){var r=t._methodObjectList[n._actionName];if(!r)throw e.Utility.xdmDebugLog("The specified method is not registered on service endpoint:"+n._actionName),e.Utility.createArgumentException("messageObject");return 0===n._actionType?r:1===n._actionType?r.getRegisterMethodObject():r.getUnregisterMethodObject()}function S(e){i.push(e)}function b(){null!==s?d||(i.length>0?O(i.shift()):(clearInterval(s),s=null)):e.Utility.xdmDebugLog("channel is not ready.")}function O(e){d=e.getInvokeBlockingFlag(),e.invoke(),a=(new Date).getTime()}function _(){d=!1}function A(t){if(window.addEventListener)window.addEventListener("message",t,!1);else{if(!(navigator.userAgent.indexOf("MSIE")>-1&&window.attachEvent))throw e.Utility.xdmDebugLog("Browser doesn't support the required API."),e.Utility.createArgumentException("Browser");window.attachEvent("onmessage",t)}}function T(t,n){return!!(t&&n&&"null"!==t&&"null"!==n&&t.length&&n.length)&&M(e.OUtil.parseUrl(t,!0),e.OUtil.parseUrl(n,!0))}function C(t){try{return e.OUtil.parseUrl(t,!0)}catch(e){return}}function E(e){if(e&&e.length){var t=e.indexOf("://"),n=-1!==t,r=n?e.substring(0,t).toLowerCase():"",i=n?e.substring(t+3):e,o=0;if(!n||"https"===r)for(;0===i.indexOf("*.");)o++,i=i.substring("*.".length);if(o>0&&o<=2){var a=C("https://"+i);if(a&&a.hostname)return{parser:a,wildcardLabelCount:o}}var s=C(n?e:"https://"+e);if(s&&s.hostname)return{parser:s,wildcardLabelCount:0}}}function I(e,t){return 0===e.wildcardLabelCount?M(e.parser,t):!!t&&t.protocol===e.parser.protocol&&e.parser.port===t.port&&function(e,t,n){var r=e.length-t.length-1;if(r<=0||e.substring(r)!=="."+t)return!1;var i=e.substring(0,r).split(".");return i.length===n&&-1===i.indexOf("")}(t.hostname,e.parser.hostname,e.wildcardLabelCount)}function P(t,n){var r=!1;if(!(n&&"null"!==n&&n.length&&t&&t instanceof Array&&t.length))return r;if(!e.OUtil.checkFlight(e.FlightTreatmentNames.MetaOSJsonManifestAppDomainWildcards)){for(var i=0;i<t.length&&!r;i++)if(-1!==t[i].indexOf("://")){var o=e.OUtil.parseUrl(n,!0);r=M(e.OUtil.parseUrl(t[i],!0),o)}return r}var a=e.OUtil.parseUrl(n,!0);for(i=0;i<t.length&&!r;i++){var s=E(t[i]);s&&(r=I(s,a))}return r}function w(t){if(!t||"null"===t)return!1;var n=new Array("^outlook\\.office\\.com$","^outlook-sdf\\.office\\.com$","^outlook\\.live\\.com$","^outlook-sdf\\.live\\.com$","^consumer\\.live-int\\.com$","^outlook-tdf\\.live\\.com$","^sdfpilot\\.live\\.com$","^outlook\\.office365\\.us$","^outlook\\.office365\\.com$","^exchangelabs\\.live-int\\.com$","^outlook\\.cloud\\.microsoft$","^sdf\\.outlook\\.cloud\\.microsoft$","^.*\\.dod\\.online\\.office365\\.us$","^.*\\.gov\\.online\\.office365\\.us$","^.*\\.officeapps\\.live\\.com$","^.*\\.officeapps-df\\.live\\.com$","^"+document.domain.replace(new RegExp("\\.","g"),"\\.")+"$");return!0===e.OUtil.getCustomOfficeInitializationSettings().trustAllCloudEnvironments&&n.push("^partner\\.outlook\\.cn$","^.*\\.partner\\.officewebapps\\.cn$"),new RegExp(n.join("|")).test(t)}function D(t){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(i){switch(i.label){case 0:return n||(n=new e.SovereignHelper),[4,(r=n).isConfigAvailable()];case 1:return i.sent()?[4,r.isSovereignHostTrusted(t)]:[2,!1];case 2:return[2,i.sent()]}}))}))}function x(t,n){if(!t||!n||"null"===t||"null"===n)return!1;var r=e.OUtil.parseUrl(t,!0),i=e.OUtil.parseUrl(n,!0);if(null==r||null==i)return!1;var o=r.protocol===i.protocol,a=r.port===i.port,s=i.hostname,c=r.hostname,l=s===c,d=!1;return!l&&s.length>c.length+1&&(d=s.slice(-(c.length+1))==="."+c),a&&o&&(l||d)}function M(e,t){return e.hostname==t.hostname&&e.protocol==t.protocol&&e.port==t.port}function N(t){return __awaiter(this,void 0,void 0,(function(){var n,r,i,o,p,m,g,A,C,E,I,w,D,M,N,F,R,H,j,L,U,B;return __generator(this,(function(W){switch(W.label){case 0:if(""==t.data)return[3,10];r=t.data;try{n=l.unenvelope(r)}catch(e){return[2]}if(e.Utility.xdmDebugLog(r),0!==n._messageType)return[3,9];i=null==t.origin||"null"===t.origin?n._origin:t.origin,W.label=1;case 1:if(W.trys.push([1,2,,8]),o=h(n._conversationId),e.Utility.xdmDebugLog("_receiveAsync: request, origin="+i+" sourceURL:"+o._conversations[n._conversationId]),p=o._conversations[n._conversationId],e.Utility.xdmDebugLog("_receiveAsync: request, origin="+i+" sourceURL:"+p.url),!P(m=[p.url].concat(o._appDomains[n._conversationId]),t.origin)&&!OfficeExt.appSpecificCheckOrigin(m,t,n._origin,P)&&!x(p.url,t.origin))throw"Failed origin check";if((g=o.getPolicyManager())&&!g.checkPermission(n._conversationId,n._actionName,n._data))throw"Access Denied";return A=v(o,n),C=new u(t.source,i,n._actionName,n._conversationId,n._correlationId,_),E=new f(A,n._data,C,o._eventHandlerProxyList,n._conversationId,n._actionName),I=!0,null==s&&((null==a||(new Date).getTime()-a>10)&&!d?(O(E),I=!1):s=setInterval(b,10)),I&&S(E),[3,8];case 2:w=W.sent(),o&&o._onHandleRequestError&&o._onHandleRequestError(n,w),D=-2,"Access Denied"==w&&(D=-5),M=new c(n._actionName,n._conversationId,n._correlationId,D,0,w),N=l.envelope(M),F=!1;try{F=!(!t.source||!t.source.postMessage)}catch(e){}return R=!1,window.location.href&&t.origin&&"null"!==t.origin&&x(window.location.href,t.origin)?(R=!0,[3,7]):[3,3];case 3:if(!t.origin||"null"===t.origin)return[3,7];H=e.OUtil.parseUrl(t.origin,!0).hostname,W.label=4;case 4:return W.trys.push([4,6,,7]),[4,k(H,null)];case 5:return R=W.sent(),[3,7];case 6:return j=W.sent(),e.Utility.xdmDebugLog("isHostNameValidWacDomainAsync failed with exception: "+j),R=!1,[3,7];case 7:return F&&R&&t.source.postMessage(N,i),[3,8];case 8:return[3,10];case 9:if(1!==n._messageType)return[2];if(!(L=y(n._conversationId)))return[2];if(e.Utility.xdmDebugLog("_receiveAsync: response, origin="+t.origin+" targetURL:"+L._targetUrl),!T(L._targetUrl,t.origin))throw"Failed orgin check";if(3==L._hostTrustCheckStatus&&(L._fHostTrusted=!0),0===n._responseType){if(U=L._callbackList[n._correlationId])try{U.callback&&U.callback(n._errorCode,n._data)}finally{delete L._callbackList[n._correlationId]}}else null!=(B=L._eventHandlerList[n._actionName])&&B(n._data);W.label=10;case 10:return[2]}}))}))}function F(t){if(""!=t.data){var n,r=t.data;try{n=l.unenvelope(r)}catch(e){return}if(e.Utility.xdmDebugLog(r),0===n._messageType){var i=null==t.origin||"null"===t.origin?n._origin:t.origin;try{var o=h(n._conversationId);e.Utility.xdmDebugLog("_receive: request, origin="+i+" sourceURL:"+o._conversations[n._conversationId]);var p=o._conversations[n._conversationId];e.Utility.xdmDebugLog("_receive: request, origin="+i+" sourceURL:"+p.url);var m=[p.url].concat(o._appDomains[n._conversationId]);if(!P(m,t.origin))if(!OfficeExt.appSpecificCheckOrigin(m,t,n._origin,P))if(!x(p.url,t.origin))throw"Failed origin check";var g=o.getPolicyManager();if(g&&!g.checkPermission(n._conversationId,n._actionName,n._data))throw"Access Denied";var A=v(o,n),C=new u(t.source,i,n._actionName,n._conversationId,n._correlationId,_),E=new f(A,n._data,C,o._eventHandlerProxyList,n._conversationId,n._actionName),I=!0;null==s&&((null==a||(new Date).getTime()-a>10)&&!d?(O(E),I=!1):s=setInterval(b,10)),I&&S(E)}catch(r){o&&o._onHandleRequestError&&o._onHandleRequestError(n,r);var D=-2;"Access Denied"==r&&(D=-5);var M=new c(n._actionName,n._conversationId,n._correlationId,D,0,r),N=l.envelope(M),F=!1;try{F=!(!t.source||!t.source.postMessage)}catch(e){}var R=!1;if(window.location.href&&t.origin&&"null"!==t.origin&&x(window.location.href,t.origin))R=!0;else if(t.origin&&"null"!==t.origin)R=w(e.OUtil.parseUrl(t.origin,!0).hostname);F&&R&&t.source.postMessage(N,i)}}else{if(1!==n._messageType)return;var k=y(n._conversationId);if(!k)return;if(e.Utility.xdmDebugLog("_receive: response, origin="+t.origin+" targetURL:"+k._targetUrl),!T(k._targetUrl,t.origin))throw"Failed orgin check";if(3==k._hostTrustCheckStatus&&(k._fHostTrusted=!0),0===n._responseType){var H=k._callbackList[n._correlationId];if(H)try{H.callback&&H.callback(n._errorCode,n._data)}finally{delete k._callbackList[n._correlationId]}}else{var j=k._eventHandlerList[n._actionName];null!=j&&j(n._data)}}}}function R(){g||(e.OUtil.isChangeGateEnabled("Microsoft.Office.SharedOnline.ChangeGate.OfficeVSO_10910853_OfficeJsNPMDownloadTrustedDomainList")?A(N):A(F),g=!0)}function k(t,n){return __awaiter(this,void 0,void 0,(function(){var r,i;return __generator(this,(function(o){switch(o.label){case 0:return r=!1,1===e.OUtil.getLibraryReleaseVehicle()?[3,3]:((i=e.SovereignHelper.isSovereignVersion())&&!0!==e.OUtil.getCustomOfficeInitializationSettings().trustAllCloudEnvironments||(r=w(t),n&&(r=r||n(t))),r||!i?[3,2]:[4,D(t)]);case 1:r=o.sent(),o.label=2;case 2:return[3,5];case 3:return(r=e.OUtil.isHostNameInAddinTrustedDomains(t))||!e.LoadScriptHelper.isSdx()||e.SovereignHelper.isSovereignVersion()||(r=w(t)),r?[3,5]:[4,D(t)];case 4:r=o.sent(),o.label=5;case 5:return[2,r]}}))}))}t.connect=function(e,t,n){var r=m[e];return r||(R(),r=new o(e,t,n),m[e]=r),r},t.getClientEndPoint=function(e){return m[e]},t.createServiceEndPoint=function(e){R();var t=new r(e);return p[e]=t,t},t.getServiceEndPoint=function(e){return p[e]},t.deleteClientEndPoint=function(e){delete m[e]},t.deleteServiceEndPoint=function(e){delete p[e]},t.checkUrlWithAppDomains=function(e,t){return P(e,t)},t.isTargetSubdomainOfSourceLocation=function(e,t){return x(e,t)},t._setMethodTimeout=function(e){e<=0?65e3:e},t._startMethodTimeoutTimer=function(){},t.isHostNameValidWacDomain=function(e){return w(e)},t.isHostNameValidWacDomainAsync=k}(i=e.XdmCommunicationManager||(e.XdmCommunicationManager={}));var a=function(){function e(e,t,n,r,i){this._messageType=e,this._actionName=t,this._conversationId=n,this._correlationId=r,this._origin=window.location.origin,this._data=void 0===i?null:i}return e.prototype.getActionName=function(){return this._actionName},e.prototype.getConversationId=function(){return this._conversationId},e.prototype.getCorrelationId=function(){return this._correlationId},e.prototype.getOrigin=function(){return this._origin},e.prototype.getData=function(){return this._data},e.prototype.getMessageType=function(){return this._messageType},e}(),s=function(e){function t(t,n,r,i,o){var a=e.call(this,0,t,r,i,o)||this;return a._actionType=n,a}return __extends(t,e),t.prototype.getActionType=function(){return this._actionType},t}(a),c=function(e){function t(t,n,r,i,o,a){var s=e.call(this,1,t,n,r,a)||this;return s._errorCode=i,s._responseType=o,s}return __extends(t,e),t.prototype.getErrorCode=function(){return this._errorCode},t.prototype.getResponseType=function(){return this._responseType},t}(a),l=function(){function e(){}return e.envelope=function(e){return JSON.stringify(e)},e.unenvelope=function(e){return JSON.parse(e)},e}(),d=function(){function t(t,n,r,i,o,a){var s=this;this._invokeResultCode=0,this._requesterWindow=t,this._requesterUrl=n,this._actionName=r,this._conversationId=i,this._correlationId=o,this._invokeResultCode=0,this._responseType=a,this._send=function(t){try{var n=new c(s._actionName,s._conversationId,s._correlationId,s._invokeResultCode,s._responseType,t),r=l.envelope(n);s._requesterWindow.postMessage(r,s._requesterUrl),e.Utility.xdmDebugLog("_send: requestUrl="+s._requesterUrl+" _actionName:"+s._actionName)}catch(t){e.Utility.xdmDebugLog("ResponseSender._send error:"+t.message)}}}return t.prototype.getRequesterWindow=function(){return this._requesterWindow},t.prototype.getRequesterUrl=function(){return this._requesterUrl},t.prototype.getActionName=function(){return this._actionName},t.prototype.getConversationId=function(){return this._conversationId},t.prototype.getCorrelationId=function(){return this._correlationId},t.prototype.getSend=function(){return this._send},t.prototype.setResultCode=function(e){this._invokeResultCode=e},t}(),u=function(t){function n(n,r,i,o,a,s){var d=t.call(this,n,r,i,o,a,0)||this;return d._postCallbackHandler=s,d._send=function(t,n){null!=n&&(d._invokeResultCode=n);try{var r=new c(d._actionName,d._conversationId,d._correlationId,d._invokeResultCode,d._responseType,t),i=l.envelope(r);d._requesterWindow.postMessage(i,d._requesterUrl),d._postCallbackHandler()}catch(t){e.Utility.xdmDebugLog("InvokeCompleteCallback._send error:"+t.message)}},d}return __extends(n,t),n}(d),f=function(){function e(e,t,n,r,i,o){this._callerId="",this._methodObject=e,this._param=t,this._invokeCompleteCallback=n,this._eventHandlerProxyList=r,this._conversationId=i,this._eventName=o}return e.prototype.invoke=function(){try{var e;switch(this._methodObject.getInvokeType()){case 0:this._methodObject.getMethod()(this._param,this._invokeCompleteCallback.getSend());break;case 1:e=this._methodObject.getMethod()(this._param),this._invokeCompleteCallback.getSend()(e);break;case 4:var t=this._createEventHandlerProxyObject(this._invokeCompleteCallback);e=this._methodObject.getMethod()(t.getSend(),this._param),this._eventHandlerProxyList[this._conversationId+this._eventName]=t.getSend(),this._invokeCompleteCallback.getSend()(e);break;case 5:var n=this._eventHandlerProxyList[this._conversationId+this._eventName];e=this._methodObject.getMethod()(n,this._param),delete this._eventHandlerProxyList[this._conversationId+this._eventName],this._invokeCompleteCallback.getSend()(e);break;case 2:var r=this._createEventHandlerProxyObject(this._invokeCompleteCallback);this._methodObject.getMethod()(r.getSend(),this._invokeCompleteCallback.getSend(),this._param),this._eventHandlerProxyList[this._callerId+this._eventName]=r.getSend();break;case 3:var i=this._eventHandlerProxyList[this._callerId+this._eventName];this._methodObject.getMethod()(i,this._invokeCompleteCallback.getSend(),this._param),delete this._eventHandlerProxyList[this._callerId+this._eventName]}}catch(e){this._invokeCompleteCallback.setResultCode(-3),this._invokeCompleteCallback.getSend()(e)}},e.prototype.getInvokeBlockingFlag=function(){return this._methodObject.getBlockingFlag()},e.prototype._createEventHandlerProxyObject=function(e){return new d(e.getRequesterWindow(),e.getRequesterUrl(),e.getActionName(),e.getConversationId(),e.getCorrelationId(),1)},e}()}(OSF||(OSF={})),function(e){function t(e,t){return t+="_Resource",void 0!==oteljs?[oteljs.makeDoubleDataField(t+"_responseEnd",e.responseEnd),oteljs.makeDoubleDataField(t+"_responseStart",e.responseStart),oteljs.makeDoubleDataField(t+"_startTime",e.startTime),oteljs.makeDoubleDataField(t+"_transferSize",e.transferSize)]:[]}e.sendPerformanceTelemetry=function(){if(OSF.AppTelemetry.enableTelemetry&&"undefined"!=typeof performance&&performance.getEntriesByType){var e,n,r=OSF.LoadScriptHelper.getHostBundleJsName().toLowerCase();performance.getEntriesByType("resource").forEach((function(t){var i=t.name.toLowerCase();OSF.Utility.stringEndsWith(i,r)?e=t:(OSF.Utility.stringEndsWith(i,OSF.ConstantNames.OfficeDebugJS)||OSF.Utility.stringEndsWith(i,OSF.ConstantNames.OfficeJS))&&(n=t)})),OTel.OTelLogger.onTelemetryLoaded((function(){var r=[];e&&(r=r.concat(t(e,"HostJs"))),n&&(r=r.concat(t(n,"OfficeJs"))),r=r.concat([oteljs.makeDoubleDataField("officeExecuteStartDate",OSFPerformance.officeExecuteStartDate),oteljs.makeDoubleDataField("officeExecuteStart",OSFPerformance.officeExecuteStart),oteljs.makeDoubleDataField("officeExecuteEnd",OSFPerformance.officeExecuteEnd),oteljs.makeDoubleDataField("hostInitializationStart",OSFPerformance.hostInitializationStart),oteljs.makeDoubleDataField("hostInitializationEnd",OSFPerformance.hostInitializationEnd),oteljs.makeDoubleDataField("totalJSHeapSize",OSFPerformance.totalJSHeapSize),oteljs.makeDoubleDataField("usedJSHeapSize",OSFPerformance.usedJSHeapSize),oteljs.makeDoubleDataField("jsHeapSizeLimit",OSFPerformance.jsHeapSizeLimit),oteljs.makeDoubleDataField("getAppContextStart",OSFPerformance.getAppContextStart),oteljs.makeDoubleDataField("getAppContextEnd",OSFPerformance.getAppContextEnd),oteljs.makeDoubleDataField("getAppContextXdmStart",OSFPerformance.getAppContextXdmStart),oteljs.makeDoubleDataField("getAppContextXdmEnd",OSFPerformance.getAppContextXdmEnd),oteljs.makeDoubleDataField("createOMEnd",OSFPerformance.createOMEnd),oteljs.makeDoubleDataField("officeOnReady",OSFPerformance.officeOnReady),oteljs.makeBooleanDataField("isSharedRuntime",0!=(OSF._OfficeAppFactory.getHostInfo().flags&OSF.HostInfoFlags.SharedApp)),oteljs.makeBooleanDataField("isExperimentJsEnabled",0!=(OSF._OfficeAppFactory.getHostInfo().flags&OSF.HostInfoFlags.ExperimentJsEnabled))]),Microsoft.Office.WebExtension.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.JSPerformanceTelemetryV06",dataFields:r,eventFlags:{dataCategories:2,diagnosticLevel:110}})}))}}}(OSFPerfUtil||(OSFPerfUtil={})),function(e){!function(t){var n,r,i={};function o(e,t,n,r){if(e&&t){var o=window.document,a=i[e];if(a)a.loaded?t(!0):a.pendingCallbacks.push(t);else{var s=o.createElement("script");s.type="text/javascript",a={loaded:!1,pendingCallbacks:[t],timer:null},i[e]=a;var c=function(){null!=a.timer&&(clearTimeout(a.timer),delete a.timer),a.loaded=!0;for(var e=a.pendingCallbacks.length,t=0;t<e;t++){a.pendingCallbacks.shift()(!0)}},l=function(){delete i[e],null!=a.timer&&(clearTimeout(a.timer),delete a.timer);for(var t=a.pendingCallbacks.length,n=0;n<t;n++){a.pendingCallbacks.shift()(!1)}};s.readyState?s.onreadystatechange=function(){"loaded"!=s.readyState&&"complete"!=s.readyState||(s.onreadystatechange=null,c())}:s.onload=c,s.onerror=l,r=r||3e4,a.timer=setTimeout(l,r),s.setAttribute("crossOrigin","anonymous"),s.src=n?n.createScriptURL(e):e,o.getElementsByTagName("head")[0].appendChild(s)}}}!function(e){var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];e.generateNewGuid=function(){for(var e="",n=(new Date).getTime(),r=0;r<32&&n>0;r++)8!=r&&12!=r&&16!=r&&20!=r||(e+="-"),e+=t[n%16],n=Math.floor(n/16);for(;r<32;r++)8!=r&&12!=r&&16!=r&&20!=r||(e+="-"),e+=t[Math.floor(16*Math.random())];return e}}(t.Guid||(t.Guid={})),t.loadScriptPromise=function(e,t,n){return new Promise((function(r,i){o(e,(function(e){r(e)}),t,n)}))},t.loadScript=o,t.getSessionStorage=function(){if(!n){try{var t=window.sessionStorage}catch(e){t=null}n=new e.SafeStorage(t)}return n},t.getLocalStorage=function(){if(!r){try{var t=window.localStorage}catch(e){t=null}r=new e.SafeStorage(t)}return r},t.waitForFunction=function(e,t,n,r){var i,o=n,a=function(){o--,e()?t(!0):o>0?(i=window.setTimeout(a,r),o--):(window.clearTimeout(i),t(!1))};a()},t.isSecureDefaultsEnabled=function(){return"undefined"!=typeof isOsfSecurityDefaultsEnabled&&!0===isOsfSecurityDefaultsEnabled}}(e.OUtil||(e.OUtil={}))}(OSF||(OSF={})),function(e){e.Flights=[];e.FlightTreatmentNames={MetaOSJsonManifestAppDomainWildcards:"Microsoft.Office.SharedOnline.MetaOSJsonManifestAppDomainWildcards",ForceUpgradeMsal5:"Microsoft.Office.SharedOnline.ForceUpgradeMsal5"},function(t){var n="&_flights=",r="&_disabledChangeGates=",i="_flights=",o="_disabledChangeGates=";function a(e,t){return e.substr(0,t.length)===t}function s(e,t,n,r){return a(e,t+"//"+n+":"+r)||a(e,n+":"+r)}t.isArray=function(e){return"[object Array]"===Object.prototype.toString.apply(e)},t.isFunction=function(e){return"[object Function]"===Object.prototype.toString.apply(e)},t.isDate=function(e){return"[object Date]"===Object.prototype.toString.apply(e)},t.addEventListener=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else{if(!e.attachEvent)throw new Error("Cannot attach event");e.attachEvent("on"+t,n)}},t.removeEventListener=function(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else{if(!e.detachEvent)throw new Error("Cannot remove event");e.detachEvent("on"+t,n)}};var c="Date(";function l(e){var t=[];try{t=JSON.parse(e)}catch(e){}return Array.isArray(t)||(t=[]),t}function d(e,n,r){try{var i=JSON.parse(n),o=null!=i?i[r]:null,a=t.getSessionStorage();if(!e&&a&&null!=i){var s=i.baseFrameName+r;o?a.setItem(s,o):o=a.getItem(s)}return o}catch(e){return null}}function u(e,n,r,i,o){var a=o.split(e),s=a.length>1?a[a.length-1]:null;r&&null!=s&&(s.indexOf("&")>=0&&(s=s.split("&")[0]),s=decodeURIComponent(s));var c=t.getSessionStorage();if(!i&&c){var l=window.name.indexOf(n);if(l>-1){var d=window.name.indexOf(";",l);-1==d&&(d=window.name.length);var u=window.name.substring(l,d);s?c.setItem(u,s):s=c.getItem(u)}}return s}function f(e,t){for(var n=0;n<e.length;n++)if(e.charAt(n)===t){if(n+1>=e.length)return this.removeChar(e,n);if("/"===t){if("?"===e.charAt(n+1)||"#"===e.charAt(n+1))return this.removeChar(e,n)}else if("?"===t&&"#"===e.charAt(n+1))return this.removeChar(e,n)}return e}function p(e){if(e=f(e,"/"),e=f(e,"?"),"https://"==(e=f(e,"#")).substr(0,8))-1!=(t=e.indexOf(":443"))&&(t!=e.length-4&&"/"!=e.charAt(t+4)&&"?"!=e.charAt(t+4)&&"#"!=e.charAt(t+4)||(e=e.substring(0,t)+e.substring(t+4)));else if("http://"==e.substr(0,7)){var t;-1!=(t=e.indexOf(":80"))&&(t!=e.length-3&&"/"!=e.charAt(t+3)&&"?"!=e.charAt(t+3)&&"#"!=e.charAt(t+3)||(e=e.substring(0,t)+e.substring(t+3)))}return e}function m(e){var t,n,r=[],i=[],o=e.length;for(t=0;t<o;t++)(n=e[t]).tabIndex?n.tabIndex>0?i.push(n):0===n.tabIndex&&r.push(n):r.push(n);return i=i.sort((function(e,t){var n=e.tabIndex-t.tabIndex;return 0===n&&(n=i.indexOf(e)-i.indexOf(t)),n})),[].concat(i,r)}t.serializeSettings=function(t){var n={};for(var r in t){var i=t[r];try{i=JSON.stringify(i,(function(t,n){return e.OUtil.isDate(this[t])?c+this[t].getTime()+")":n})),n[r]=i}catch(e){}}return n},t.deserializeSettings=function(e){var t={};for(var n in e=e||{}){var r=e[n];try{r=JSON.parse(r,(function(e,t){var n;return"string"==typeof t&&t&&t.length>6&&t.slice(0,5)===c&&")"===t.slice(-1)&&(n=new Date(parseInt(t.slice(5,-1))))?n:t})),t[n]=r}catch(e){}}return t},t.convertIntToCssHexColor=function(e){return"#"+(Number(e)+16777216).toString(16).slice(-6)},t.parseAppContextFromWindowName=function(e,n){return t.parseInfoFromWindowName(e,n,"appContext")},t.parseHostInfoFromWindowName=function(t,n){return e.OUtil.parseInfoFromWindowName(t,n,"hostInfo")},t.parseXdmInfo=function(e){var n=t.parseXdmInfoWithGivenFragment(e,window.location.hash);return n||(n=t.parseXdmInfoFromWindowName(e,window.name)),n},t.parseXdmInfoFromWindowName=function(t,n){return e.OUtil.parseInfoFromWindowName(t,n,"xdmInfo")},t.parseXdmInfoWithGivenFragment=function(t,n){return e.OUtil.parseInfoWithGivenFragment("&_xdm_Info=","_xdm_",!1,t,n)},t.parseFlights=function(e){var t=function(e,t){return l(u(n,i,!0,e,t))}(e,window.location.hash);return 0==t.length&&(t=function(e,t){return l(d(e,t,"flights"))}(e,window.name)),t},t.parseDisabledChangeGates=function(e){var t=function(e,t){return l(u(r,o,!0,e,t))}(e,window.location.hash);return 0==t.length&&(t=function(e,t){return l(d(e,t,"disabledChangeGates"))}(e,window.name)),t},t.checkFlight=function(t){return e.Flights&&e.Flights.indexOf(t)>=0},t.parseInfoFromWindowName=d,t.parseInfoWithGivenFragment=u,t.getConversationId=function(){var e=window.location.search,t=null;if(e){var n=e.indexOf("&");(t=n>0?e.substring(1,n):e.substr(1))&&"="===t.charAt(t.length-1)&&(t=t.substring(0,t.length-1))&&(t=decodeURIComponent(t))}return t},t.getInfoItems=function(e){var t=e.split("$");return void 0===t[1]&&(t=e.split("|")),void 0===t[1]&&(t=e.split("%7C")),t},t.getXdmFieldValue=function(t,n){var r="",i=e.OUtil.parseXdmInfo(n);if(i){var o=e.OUtil.getInfoItems(i);if(null!=o&&o.length>=3)switch(t){case"ConversationUrl":r=o[2];break;case"AppId":r=o[1]}}return r},t.parseUrl=function(t,n){if(void 0===n&&(n=!1),void 0!==t&&t){var r="NotHttps",i="undefined"!=typeof window&&void 0!==window.navigator&&window.navigator.userAgent.indexOf("Trident")>0,o=("undefined"!=typeof window&&void 0!==window.navigator&&window.navigator.userAgent.indexOf("Edge"),{protocol:void 0,hostname:void 0,host:void 0,port:void 0,pathname:void 0,search:void 0,hash:void 0,isPortPartOfUrl:void 0});try{if(i){var a=document.createElement("a");if(a.href=t,!(a&&a.protocol&&a.host&&a.hostname&&a.href&&p(a.href).toLowerCase()===p(t).toLowerCase()))throw"InvalidUrl";if(e.OUtil.checkFlight(2)&&n&&"https:"!=a.protocol)throw new Error(r);var c=function(e,t){return e&&t?"https:"==t.protocol&&s(e,"https:",t.hostname,"443")?":443":"http:"==t.protocol&&s(e,"http:",t.hostname,"80")?":80":"":""}(t,a);o.protocol=a.protocol,o.hostname=a.hostname,o.port=""==c?a.port:"",o.host=""!=c?a.hostname:a.host,o.pathname=(i?"/":"")+a.pathname,o.search=a.search,o.hash=a.hash,o.isPortPartOfUrl=s(t,a.protocol,a.hostname,a.port)}else{var l=new URL(t);if(l&&l.protocol&&l.host&&l.hostname){if(e.OUtil.checkFlight(2)&&n&&"https:"!=l.protocol)throw new Error(r);o.protocol=l.protocol,o.hostname=l.hostname,o.port=l.port,o.host=l.host,o.pathname=l.pathname,o.search=l.search,o.hash=l.hash,o.isPortPartOfUrl=l.host.lastIndexOf(":"+l.port)==l.host.length-l.port.length-1}}}catch(e){if(e.message===r)throw e}return o}},t.focusToFirstTabbable=function(e,t){var n,r,i=!1,o=function(e){i=!0},a=function(e,t,n){return t<0||t>e||0===t&&n?-1:t!==e-1||n?n?t-1:t+1:-1};if(e=m(e),n=t?e.length-1:0,0===e.length)return null;for(;!i&&n>=0&&n<e.length;)r=e[n],window.focus(),r.addEventListener("focus",o),r.focus(),r.removeEventListener("focus",o),n=a(e.length,n,t),i||r!==document.activeElement||(i=!0);return i?r:null},t.focusToNextTabbable=function(e,t,n){var r,i,o,a=!1,s=function(e){a=!0},c=function(e,t,n){return t<0||t>e||0===t&&n?-1:t!==e-1||n?n?t-1:t+1:-1};if(r=function(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1}(e=m(e),t),(i=c(e.length,r,n))<0)return null;for(;!a&&i>=0&&i<e.length;)(o=e[i]).addEventListener("focus",s),o.focus(),o.removeEventListener("focus",s),i=c(e.length,i,n),a||o!==document.activeElement||(a=!0);return a?o:null},t.defineMethodOnNamespace=function(e,t,n){e[t]=n},t.isDialog=function(){return e._OfficeAppFactory.getHostInfo().isDialog},t.isPopupWindow=function(){return e.OUtil.isDialog()&&e._OfficeAppFactory.getHostInfo().hostPlatform==e.HostInfoPlatform.web&&null!=window.opener},t.getHostPlatform=function(){return e._OfficeAppFactory.getHostInfo().hostPlatform}}(e.OUtil||(e.OUtil={}))}(OSF||(OSF={})),function(e){!function(e){e.Callback="callback",e.AsyncContext="asyncContext",e.Data="data",e.MessageToParent="messageToParent",e.MessageContent="messageContent",e.MessageOrigin="messageOrigin",e.TargetOrigin="targetOrigin",e.AppCommandInvocationCompletedData="appCommandInvocationCompletedData"}(e.ParameterNames||(e.ParameterNames={}))}(OSF||(OSF={})),function(e){!function(t){var n=function(){};t.RequirementVersion=n;var r=function(){function e(e){this._setMap=e}return e.prototype.isSetSupported=function(e,t){if(null==e)return!1;null==t&&(t=0);var n=this._setMap._sets;if(n.hasOwnProperty(e.toLowerCase())){var r=n[e.toLowerCase()];try{var i=this._getVersion(r+"");t+="";var o=this._getVersion(t);if(i.major>0&&i.major>o.major)return!0;if(i.major>0&&i.minor>=0&&i.major==o.major&&i.minor>=o.minor)return!0}catch(e){return!1}}return!1},e.prototype._getVersion=function(e){var t=(e+="").split("."),n=0,r=0;if(t.length<2&&isNaN(Number(e)))throw"version format incorrect";if(n=Number(t[0]),t.length>=2&&(r=Number(t[1])),isNaN(n)||isNaN(r))throw"version format incorrect";return{minor:r,major:n}},e}();t.RequirementMatrix=r;var i=function(){function e(e){this._sets=e}return e.prototype._addSetMap=function(e){for(var t in e)this._sets[t]=e[t]},e}();t.DefaultSetRequirement=i;var o=function(e){function t(){return e.call(this,{dialogapi:1.1})||this}return __extends(t,e),t}(i);t.DefaultRequiredDialogSetRequirement=o;var a=function(e){function t(){return e.call(this,{dialogorigin:1.1})||this}return __extends(t,e),t}(i);t.DefaultOptionalDialogSetRequirement=a;var s=function(){function t(){}return t.getDefaultRequirementMatrix=function(t){var n=void 0,o=t.get_requirementMatrix();if(null!=o&&o.length>0){var a=JSON.parse(t.get_requirementMatrix().toLowerCase());if(e._OfficeAppFactory.getHostInfo().hostPlatform==e.HostInfoPlatform.web)try{var s="dialogorigin";a.hasOwnProperty(s)||(a[s]=1.1)}catch(e){}n=new r(new i(a))}else n=new r(new i({}));return n},t.getDefaultDialogRequirementMatrix=function(t){var n=void 0,s=t.get_dialogRequirementMatrix();if(null!=s&&s.length>0){var c=JSON.parse(t.get_requirementMatrix().toLowerCase());n=new i(c)}else{n=new o;var l=t.get_requirementMatrix();if(null!=l&&l.length>0&&"undefined"!=typeof JSON){c=JSON.parse(l.toLowerCase());for(var d in n._sets)c.hasOwnProperty(d)&&(n._sets[d]=c[d]);var u=new a;for(var d in u._sets)c.hasOwnProperty(d)&&(n._sets[d]=c[d])}}if(e._OfficeAppFactory.getHostInfo().hostPlatform==e.HostInfoPlatform.web)try{var f="dialogorigin";!n._sets.hasOwnProperty(f)&&window.opener&&(n._sets[f]=1.1)}catch(e){}return new r(n)},t}();t.RequirementsMatrixFactory=s}(e.Requirement||(e.Requirement={}))}(OSF||(OSF={})),function(e){!function(t){!function(t){var n;t.executeRichApiRequestAsync=function(t,n){var r={toSafeArrayHost:function(){return[t]},fromSafeArrayHost:function(e){return{data:e}},toWebHost:function(){return{ArrayData:t}},fromWebHost:function(e){return{data:e.Data}}};e._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(93,r,n)},Object.defineProperty(t,"richApiMessageManager",{get:function(){return n||(n=new e.RichApiMessageManager),n}})}(t.RichApi||(t.RichApi={}))}(e.DDA||(e.DDA={}))}(OSF||(OSF={})),function(e){var t=function(){function t(){this._registerHandlers=[],this._eventDispatch=new e.EventDispatch([{type:e.EventType.RichApiMessage,id:e.EventDispId.dispidRichApiMessageEvent,getTargetId:function(){return""},fromSafeArrayHost:function(e){var n=e;return t.transferEventArgument(n)},fromWebHost:function(e){var n=e.ArrayData;return t.transferEventArgument(n)}}])}return t.transferEventArgument=function(t){var n=[];if(t)for(var r=0;r<t.length;r++){var i=t[r];i.toArray&&(i=i.toArray()),n.push({messageCategory:i[0],messageType:i[1],targetId:i[2],message:i[3],id:i[4],isRemoteOverride:i[5]})}return{type:e.EventType.RichApiMessage,entries:n}},t.prototype.addHandlerAsync=function(t,n,r){e.EventHelper.addEventHandler(t,n,r,this._eventDispatch)},t.prototype.removeHandlerAsync=function(t,n,r){e.EventHelper.removeEventHandler(t,n,r,this._eventDispatch)},t.prototype.register=function(t){var n=this;return this._registerPromise||(this._registerPromise=new Office.Promise((function(t,r){n.addHandlerAsync(e.EventType.RichApiMessage,(function(e){n._registerHandlers.forEach((function(t){t&&t(e)}))}),(function(e){"failed"==e.status?r(e.error):t()}))}))),this._registerPromise.then((function(){n._registerHandlers.push(t)}))},t}();e.RichApiMessageManager=t}(OSF||(OSF={})),function(e){var t=function(){function t(){}return t.prototype.execute=function(e,t,n){"undefined"!=typeof OsfOMToken&&OsfOMToken?window.external.Execute(e,t,n,OsfOMToken):window.external.Execute(e,t,n)},t.prototype.registerEvent=function(e,t,n,r,i){"undefined"!=typeof OsfOMToken&&OsfOMToken?window.external.RegisterEvent(e,n,r,i,OsfOMToken):window.external.RegisterEvent(e,n,r,i)},t.prototype.unregisterEvent=function(e,t,n,r){"undefined"!=typeof OsfOMToken&&OsfOMToken?window.external.UnregisterEvent(e,n,r,OsfOMToken):window.external.UnregisterEvent(e,n,r)},t.prototype.closeSdxDialog=function(t){throw e.Utility.createNotImplementedException()},t.prototype.resizeSdxDialog=function(t,n){throw e.Utility.createNotImplementedException()},t}();e.RichClientHostController=t}(OSF||(OSF={})),function(e){var t=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.officeThemeTimeStamp=null,e.officeTheme=null,e}return __extends(n,t),n.prototype.getOsfControlContext=function(){if(!this._osfControlContext){var t="Warning: Office.js is loaded outside of Office client";try{if(!window.external)return console.error("There is no window.external."),e.Utility.trace(t),null;this._osfControlContext=window.external.GetContext()}catch(n){return console.error("Error when call window.external.GetContext() :"+JSON.stringify(n)),e.Utility.trace(t),null}}return this._osfControlContext},n.prototype.getAppContext=function(t,n,r){var i=this,o=this.getOsfControlContext();if(o){var a,s,c,l,d,u,f,p,m,g,h,y,v,S,b,O,_,A,T,C,E,I,P,w,D,x,M=0,N=!1;if((F=e.Utility.externalNativeFunctionExists)(typeof o.GetContextDataInJson))if("undefined"!=typeof OsfOMToken&&OsfOMToken)if((D=o.GetContextDataInJson(OsfOMToken))&&(x=JSON.parse(D)),x)a=x.appType,s=x.solutionRef,c=x.versionMajor,l=x.versionMinor,d=x.uiLocale,u=x.dataLocale,f=x.docUrl,p=x.clientMode,m=x.activationMode,h=x.controlType,y=x.eToken,v=x.correlationId,S=x.appInstanceId,b=x.touchEnabled,O=o.commerceAllowed,_=x.requirementMatrix,T=x.hostFullVersion,C=x.requirementMatrix,(R=x.featureGates)&&(E=JSON.parse(R)),M=x.initialDisplayMode,I=function(){var t={};if(x.settings)try{var n=JSON.parse(x.settings);if(n)for(var r=[n.names,n.values],i=r[0],o=r[1],a=0;a<i.length;a++)t[i[a]]=o[a]}catch(t){e.Utility.trace("Exception while parsing settings. Details: "+t)}return t},P=function(){var e=x.themeInfo;return i.getOfficeThemeFromInfoString(e)};else N=!0;else N=!0;else N=!0;if(N){a=o.GetAppType(),s=o.GetSolutionRef(),c=o.GetAppVersionMajor(),l=o.GetAppVersionMinor(),d=o.GetAppUILocale(),u=o.GetAppDataLocale(),f=o.GetDocUrl(),p=o.GetAppCapabilities(),m=o.GetActivationMode(),h=o.GetControlIntegrationLevel();try{y=o.GetSolutionToken()}catch(e){}var F;if((F=e.Utility.externalNativeFunctionExists)(typeof o.GetCorrelationId)&&(v=o.GetCorrelationId()),F(typeof o.GetInstanceId)&&(S=o.GetInstanceId()),F(typeof o.GetTouchEnabled)&&(b=o.GetTouchEnabled()),F(typeof o.GetCommerceAllowed)&&(O=o.GetCommerceAllowed()),F(typeof o.GetSupportedMatrix)&&(_=o.GetSupportedMatrix()),F(typeof o.GetHostCustomMessage)&&(A=o.GetHostCustomMessage()),F(typeof o.GetHostFullVersion)&&(T=o.GetHostFullVersion()),F(typeof o.GetDialogRequirementMatrix)&&(C=o.GetDialogRequirementMatrix()),F(typeof o.GetFeaturesForSolution))try{var R;(R=o.GetFeaturesForSolution())&&(E=JSON.parse(R))}catch(t){e.Utility.trace("Exception while creating the SDX FeatureGates object. Details: "+t)}F(typeof o.GetInitialDisplayMode)&&(M=o.GetInitialDisplayMode()),I=function(){return i.getSerializedSettings()},P=function(){return i.getOfficeTheme()},w=function(){return i.getSerializedHostSettings()}}g=2===m?Office.InitializationReason.DocumentOpened:Office.InitializationReason.Inserted,y=y?y.toString():"",n(new e.OfficeAppContext(s,a,c,d,u,f,p,I,g,h,y,v,S,b,O,l,_,A,T,void 0,void 0,void 0,void 0,C,E,P,M,void 0,void 0,w,!1,void 0,void 0,void 0))}else r(new Error("The Office.js is loaded outside of Office client"))},n.prototype.createClientHostController=function(){if(!this._clientHostController){if(this._hostInfo.hostPlatform!==e.HostInfoPlatform.win32)throw e.Utility.createNotImplementedException();this._clientHostController=new e.Win32RichClientHostController}return this._clientHostController},n.prototype.createAsyncMethodExecutor=function(){return new e.SafeArrayAsyncMethodExecutor(this._clientHostController)},n.prototype.createClientSettingsManager=function(){return new e.RichClientSettingsManager(this.getOsfControlContext())},n.prototype.getSerializedSettings=function(){var e=this.getOsfControlContext(),t=[],n=[];"undefined"!=typeof OsfOMToken&&OsfOMToken?e.GetSettings(OsfOMToken).Read(t,n):e.GetSettings().Read(t,n);for(var r={},i=0;i<t.length;i++)r[t[i]]=n[i];return r},n.prototype.getOfficeTheme=function(){var e=this.getOsfControlContext();if(e){if(!(this.officeTheme&&this.officeThemeTimeStamp&&(new Date).getTime()-this.officeThemeTimeStamp<n.officeThemeCacheValidPeriod)){var t=e.GetOfficeThemeInfo();this.officeTheme=this.getOfficeThemeFromInfoString(t),this.officeThemeTimeStamp=(new Date).getTime()}return this.officeTheme}},n.prototype.getOfficeThemeFromInfoString=function(t){var n=null;if(t)try{n=JSON.parse(t)}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Exception while parsing officeThemeInfo. Details: "+t)}var r={};if(n){var i={bodyBackgroundColor:{name:"bodyBackgroundColor",convertToHex:!0},bodyForegroundColor:{name:"bodyForegroundColor",convertToHex:!0},controlBackgroundColor:{name:"controlBackgroundColor",convertToHex:!0},controlForegroundColor:{name:"controlForegroundColor",convertToHex:!0},primaryFontColor:{name:"bodyForegroundColor",convertToHex:!0},primaryBackgroundColor:{name:"bodyBackgroundColor",convertToHex:!0},secondaryFontColor:{name:"controlForegroundColor",convertToHex:!0},secondaryBackgroundColor:{name:"controlBackgroundColor",convertToHex:!0},fluentThemeData:{name:"fluentThemeData",convertToHex:!1}};for(var o in n){var a=!1,s=o;i[o]&&(s=i[o].name,a=i[o].convertToHex),r[s]=a?e.OUtil.convertIntToCssHexColor(n[o]):n[o]}}return r},n.prototype.getSerializedHostSettings=function(){var e=this.getOsfControlContext(),t=[],n=[];"function"==typeof e.GetSettings().ReadHost&&("undefined"!=typeof OsfOMToken&&OsfOMToken?e.GetSettings(OsfOMToken).ReadHost(t,n):e.GetSettings().ReadHost(t,n));for(var r={},i=0;i<t.length;i++)r[t[i]]=n[i];return r},n.officeThemeCacheValidPeriod=5e3,n}(e.InitializationHelper);e.RichClientInitializationHelper=t}(OSF||(OSF={})),function(e){var t=function(){function e(e){this._osfClientContext=e}return e.prototype.read=function(e){var t,n=this._osfClientContext;t="undefined"!=typeof OsfOMToken&&OsfOMToken?n.GetSettings(OsfOMToken):n.GetSettings();var r=function(){var n=[],r=[];t.Read(n,r);for(var i={},o=0;o<n.length;o++)i[n[o]]=r[o];e&&e(0,i)};t.RefreshAsync?t.RefreshAsync((function(){r()})):r()},e.prototype.write=function(e,t){var n=[],r=[];for(var i in e)n.push(i),r.push(e[i]);var o,a=this._osfClientContext;void 0!==(o="undefined"!=typeof OsfOMToken&&OsfOMToken?a.GetSettings(OsfOMToken):a.GetSettings()).WriteAsync?o.WriteAsync(n,r,t):(o.Write(n,r),t(0))},e}();e.RichClientSettingsManager=t}(OSF||(OSF={})),function(e){var t=function(t){function n(n){var r=t.call(this)||this;return r._clientHostController=n,r._asyncMethodExecutorHelper=e.BootStrapExtension.createAsyncMethodExecutorHelper(r),r}return __extends(n,t),n.prototype.executeAsync=function(t,n,r,i){var o=this;try{var a=new Array;this._clientHostController.execute(t,n.toSafeArrayHost(),(function(s,c){var l=e.Utility.fromSafeArray(s);return o._asyncMethodExecutorHelper.handleSafeArrayHostResponse(l,c,a,r,n,t,i)}))}catch(e){this.onException(e,t,r)}},n.prototype.registerEventAsync=function(t,n,r,i,o,a,s){var c=this;try{this._clientHostController.registerEvent(t,n,r,(function(t,n){var r=e.Utility.fromSafeArray(n),a=o.fromSafeArrayHost(r);i(a)}),(function(n){var r,i=e.Utility.fromSafeArray(n);return"number"==typeof i?([],r=i):r=i[0],c.invokeCallback(t,a,r,null,s),!0}))}catch(e){this.onException(e,t,a)}},n.prototype.unregisterEventAsync=function(t,n,r,i,o){var a=this;try{this._clientHostController.unregisterEvent(t,n,r,(function(n,r){var s,c=e.Utility.fromSafeArray(n);return"number"==typeof c?([],s=c):s=c[0],a.invokeCallback(t,i,s,null,o),!0}))}catch(e){this.onException(e,t,i)}},n.prototype.onException=function(t,n,r){var i,o=t.number;if(o)switch(o){case-2146828218:i=7e3;break;case-2147467259:i=n==e.EventDispId.dispidDialogMessageReceivedEvent?12007:5001;break;case-2146828283:case-2147209089:i=5010;break;case-2147208704:i=5100;break;case-2146827850:default:i=5001}r&&this.invokeCallback(n,r,i||5001,null)},n}(e.AsyncMethodExecutor);e.SafeArrayAsyncMethodExecutor=t}(OSF||(OSF={})),function(e){var t=function(){function e(e){this._internalStorage=e}return e.prototype.getItem=function(e){try{return this._internalStorage&&this._internalStorage.getItem(e)}catch(e){return null}},e.prototype.setItem=function(e,t){try{this._internalStorage&&this._internalStorage.setItem(e,t)}catch(e){}},e.prototype.clear=function(){try{this._internalStorage&&this._internalStorage.clear()}catch(e){}},e.prototype.removeItem=function(e){try{this._internalStorage&&this._internalStorage.removeItem(e)}catch(e){}},e.prototype.getKeysWithPrefix=function(e){var t=[];try{for(var n=this._internalStorage&&this._internalStorage.length||0,r=0;r<n;r++){var i=this._internalStorage.key(r);0===i.indexOf(e)&&t.push(i)}}catch(e){}return t},e}();e.SafeStorage=t}(OSF||(OSF={})),function(e){var t=function(){function t(e,t){var n=this;this._clientSettingsManager=t,e=e||{},this._settings=e,this._eventDispatch=new OSF.EventDispatch([{id:OSF.EventDispId.dispidSettingsChangedEvent,type:OSF.EventType.SettingsChanged,getTargetId:function(){return""},fromSafeArrayHost:function(e){return{type:OSF.EventType.SettingsChanged,settings:n}},fromWebHost:function(e){return{type:OSF.EventType.SettingsChanged,settings:n}}}])}return t.prototype.cacheSessionSettings=function(e){var t=OSF.OUtil.getSessionStorage();if(t){var n=OSF.OUtil.serializeSettings(e),r=JSON.stringify(n);t.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(),r)}},t.prototype.get=function(e){var t=this._settings[e];return void 0===t?null:t},t.prototype.set=function(e,t){this._settings[e]=t,this.cacheSessionSettings(this._settings)},t.prototype.remove=function(e){delete this._settings[e],this.cacheSessionSettings(this._settings)},t.prototype.saveAsync=function(e){var t=this._clientSettingsManager,n=OSF.OUtil.serializeSettings(this._settings);t.write(n,(function(t){var n=OSF.Utility.asyncResultFromErrorCode(t);e&&e(n)}))},t.prototype.refreshAsync=function(t){var n=this;this._clientSettingsManager.read((function(r,i){var o=OSF.Utility.asyncResultFromErrorCode(r);o.status===e.AsyncResultStatus.Succeeded&&(n._settings=OSF.OUtil.deserializeSettings(i),o.value=n),t&&t(o)}))},t.prototype.addHandlerAsync=function(e,t,n){OSF.EventHelper.addEventHandler(e,t,n,this._eventDispatch)},t.prototype.removeHandlerAsync=function(e,t,n){OSF.EventHelper.removeEventHandler(e,t,n,this._eventDispatch)},t.prototype.toJSON=function(){return this._settings},t}();e.Settings=t}(Office||(Office={})),function(e){var t=function(){function t(){}return t.isSovereignVersion=function(){return 1!==e.OUtil.getLibraryReleaseVehicle()?"undefined"!=typeof isOsfSovereignVersion&&!0===isOsfSovereignVersion:e.OUtil.getCustomOfficeInitializationSettings().officeCdnEndpoint.isSovereign},t.prototype.getEnvironmentName=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,this.getConfig()];case 1:return[2,null!=(e=t.sent())&&e.envName?e.envName:null]}}))}))},t.prototype.getEnvironmentType=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,this.getConfig()];case 1:return[2,null!=(e=t.sent())&&e.envType?e.envType:null]}}))}))},t.prototype.getTrustedHostOrigins=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,this.getConfig()];case 1:return[2,null!=(e=t.sent())?e.trustedHostOrigins:null]}}))}))},t.prototype.isConfigAvailable=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.getConfig()];case 1:return[2,!!e.sent()]}}))}))},t.prototype.isSovereignHostTrusted=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:return e?e===window.location.hostname?[2,!0]:[4,this.getTrustedHostOrigins()]:[2,!1];case 1:return(t=n.sent())&&0!=t.length?[2,new RegExp(t.join("|")).test(e)]:[2,!1]}}))}))},t.prototype.getConfigPath=function(){var t=e.LoadScriptHelper.getHostBundleJsBasePath(),n="undefined"!=typeof isOsfSecurityDefaultsEnabled&&!0===isOsfSecurityDefaultsEnabled;if(t){if(t=t.toLowerCase(),e.OUtil.isChangeGateEnabled("Microsoft.Office.SharedOnline.ChangeGate.OfficeVSO_10910853_OfficeJsNPMDownloadTrustedDomainList")&&1===e.OUtil.getLibraryReleaseVehicle()){var r="/lib/";if(e.OUtil.getCustomOfficeInitializationSettings().officeCdnEndpoint.isOCDICompliant){var i=t.indexOf("beta/");return i>-1?t.substring(0,i)+"officeconfig.json":""}return(o=t.indexOf(r))>-1?t.substring(0,o+r.length)+"officeconfig.json":""}if(n)try{return new URL(t).origin.toLowerCase()+"/officeconfig.json"}catch(e){}else{var o,a="/lib/";if((o=t.indexOf(a))>-1)return t.toLowerCase().substring(0,o+a.length)+"officeconfig.json"}}return""},t.prototype.getConfig=function(){return this._configPromise||(this._configPromise=this.tryLoadConfig()),this._configPromise},t.prototype.tryLoadConfig=function(){return __awaiter(this,void 0,void 0,(function(){var t,n,r,i,o,a,s;return __generator(this,(function(c){switch(c.label){case 0:if(!(t=this.getConfigPath()))return[3,2];if(n=e.OUtil.getLocalStorage(),r=t+"_cache",i=n.getItem(r),o=null,i){try{o=JSON.parse(i)}catch(e){}if(864e5,a=(new Date).getTime(),o&&o.config&&o.createTime<=a&&o.createTime+864e5>=a)return[2,o.config]}return[4,this.downloadConfig(t)];case 1:return(s=c.sent())?(o={createTime:(new Date).getTime(),config:s},n.setItem(r,JSON.stringify(o))):o&&(s=o.config),[2,s];case 2:return[2,null]}}))}))},t.prototype.downloadConfig=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),[4,fetch(e)];case 1:return[4,t.sent().json()];case 2:return[2,t.sent()];case 3:return t.sent(),[3,4];case 4:return[2,null]}}))}))},t}();e.SovereignHelper=t}(OSF||(OSF={})),function(e){!function(e){function t(e){return void 0===e||null===e}e.createParameterException=function(e){return new Error("Parameter count mismatch: "+e)},e.createArgumentException=function(e){return new Error("Invalid argument "+e)},e.createNotImplementedException=function(){return new Error("Not implemented yet")},e.log=function(e){console.log(e)},e.trace=function(e){console.log(e)},e.debugLog=function(e){console.log(e)},e.getQueryStringValue=function(e){if("undefined"!=typeof window&&window.location&&window.location.search){var t=new RegExp("[?&]"+e+"=([^&]*)").exec(window.location.search);if(t)return t[1]}return null},e.isNullOrUndefined=t,e.isNullOrEmpty=function(e){return!!t(e)||0===e.length},e.isInUnittest=function(){return"boolean"==typeof g_osfUnittest&&g_osfUnittest}}(e.Utility||(e.Utility={}))}(OSF||(OSF={})),function(e){e.isOfficeReactNative=function(){try{return"undefined"!=typeof OfficePlatformGlobal&&void 0!==OfficePlatformGlobal.ReactNativeReka}catch(e){return!1}},function(e){function t(e){return new Promise(e)}function n(e){var t=e,i=1;if(("object"==typeof e||"unknown"==typeof e)&&null!=e&&e.toArray)if(e.dimensions&&(i=e.dimensions()),2===i)t=r(e);else{var o=e.toArray();t=new Array(o.length);for(var a=0;a<o.length;a++)t[a]=n(o[a])}return t}function r(e){var t;try{var n=e.ubound(1),r=e.ubound(2);if(e=e.toArray(),1==n&&1==r)t=[e];else{t=[];for(var i=0;i<n;i++){for(var o=[],a=0;a<r;a++){var s=e[i*r+a];"{66e7831f-81b2-42e2-823c-89e872d541b3}"!=s&&o.push(s)}o.length>0&&t.push(o)}}}catch(e){}return t}e.xdmDebugLog=function(t){e._DebugXdm&&console.log(t)},e.enableDebugXdm=function(){e._DebugXdm=!0},e.createPromiseFromResult=function(e){return Promise.resolve(e)},e.createPromise=t,e.promisify=function(e,n){return t((function(t,r){e((function(e){0===e?t():r()})),setTimeout((function(){r()}),n)}))},e.compareVersions=function(e,t){var n,r=e.split("."),i=t.split(".");for(n in r){if(parseInt(r[n])<parseInt(i[n]))return!1;if(parseInt(r[n])>parseInt(i[n]))return!0}return!1},e.getErrorCodeFromAsyncResult=function(e){return e.status===Office.AsyncResultStatus.Succeeded?0:e.error&&e.error.code?e.error.code:5001},e.externalNativeFunctionExists=function(e){return"unknown"===e||"undefined"!==e},e.stringEndsWith=function(t,n){if(e.isNullOrUndefined(t))throw e.createArgumentException("value");if(e.isNullOrUndefined(n))throw e.createArgumentException("subString");return!(n.length>t.length)&&t.substr(t.length-n.length)===n},e.fromSafeArray=function(e){var t=e;if(("object"==typeof e||"unknown"==typeof e)&&null!=e&&e.toArray){var r=e.toArray();t=new Array(r.length);for(var i=0;i<r.length;i++)t[i]=n(r[i])}return t},e.twoDVBArrayToJaggedArray=r,e.asyncResultFromErrorCode=function(e){return Array.isArray(e)&&1===e.length&&(e=e[0]),0===e?{status:Office.AsyncResultStatus.Succeeded}:{status:Office.AsyncResultStatus.Failed,error:{code:e}}},e._DebugXdm=!1}(e.Utility||(e.Utility={}))}(OSF||(OSF={})),function(e){var t=function(t){function n(n){var r=t.call(this)||this;return r._clientHostController=n,r._asyncMethodExecutorHelper=e.BootStrapExtension.createAsyncMethodExecutorHelper(r),r}return __extends(n,t),n.prototype.executeAsync=function(e,t,n,r){var i=this;this._clientHostController.execute(e,t.toWebHost(),(function(o,a){return n&&i._asyncMethodExecutorHelper.handleWebHostResponse(a,o,n,t,e,r),!0}))},n.prototype.registerEventAsync=function(e,t,n,r,i,o,a){var s=this;this._clientHostController.registerEvent(e,t,n,(function(e){var t=e,n=i.fromWebHost(t);r(n)}),(function(t,n){return o&&s.invokeCallback(e,o,t,null,a),!0}))},n.prototype.unregisterEventAsync=function(e,t,n,r,i){var o=this;this._clientHostController.unregisterEvent(e,t,n,(function(t,n){return r&&o.invokeCallback(e,r,t,null,i),!0}))},n}(e.AsyncMethodExecutor);e.WebAsyncMethodExecutor=t}(OSF||(OSF={})),function(e){!function(t){!function(t){t.getAuthContextAsync=function(t){e._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(99,{toSafeArrayHost:function(){return[]},fromSafeArrayHost:function(e){return null},toWebHost:function(){return{}},fromWebHost:function(e){return e.authContext}},t)}}(t.WebAuth||(t.WebAuth={}))}(e.DDA||(e.DDA={})),function(t){var n;!function(e){e.AuthCode="authcode",e.Broker="broker",e.Implicit="implicit"}(n=t.AuthFlow||(t.AuthFlow={})),t.loadAttempts=0;var r="webauth/",i="webauth.browserauth.debug.js",o="webauth.browserauth.js",a=!0,s=!1;t.load=function(c){if(t.config&&t.config.authFlow===n.AuthCode){t.loadAttempts++,t.msalVersion=void 0;var l=!0!==t.config.useMsal5&&e.OUtil.checkFlight(e.FlightTreatmentNames.ForceUpgradeMsal5);return!0===t.config.useMsal5||l?(i="webauth.browserauth.msal5.debug.js",o="webauth.browserauth.msal5.js",s=!0):(t.config&&!1===t.config.useMsal3&&(a=!1),a&&(i="webauth.browserauth.msal3.debug.js",o="webauth.browserauth.msal3.js",s=!0)),new Promise((function(n,a){var d=function(t,n,r){return new Promise((function(i,o){t?e.OUtil.loadScript(t,(function(e){if("boolean"!=typeof e||e)if(e instanceof Event&&e)o(new Event("loadScript: "+e.type+" '"+t+"'"));else if(r&&!n())var a=0,s=setInterval((function(){a+=500,!(n()||a>r)||(clearInterval(s),n())||o(new Event("Missing expected object after loaded."))}),500);else i(null);else o(new Event("loadScript: failed to load '"+t+"'"))}),e.LoadScriptHelper.getTrustedTypesPolicy(),r):i(null)}))},u=[d(t.config&&t.config.authVersion?e.LoadScriptHelper.getHostBundleJsBasePath()+r+t.config.authVersion+"/"+(t.config&&t.config.debugging?i:o):e.LoadScriptHelper.getHostBundleJsBasePath()+r+(t.config&&t.config.debugging?i:o),(function(){return!!BrowserAuth}),t.config.delayWebAuth)];s||u.push(d(t.config.msal,(function(){return!!msal}),t.config.delayMsal)),Promise.all(u).then((function(){if(t.msalVersion=s?BrowserAuth.msalVersion:"undefined"!=typeof msal?msal.version:void 0,t.config){var r=__assign({},t.config);l&&(r.useMsal5=!0,r.enableLegacyPolling=!0),c&&(r.appIds=c.appIds,r.redirectUri=c.redirectUri,r.prefetch=c.prefetch,r.clientCapabilities=c.clientCapabilities,r.usePairwiseBroker=c.usePairwiseBroker,r.trustedBrokerDomain=c.trustedBrokerDomain),BrowserAuth.Load(r,e._OfficeAppFactory.getHostInfo().osfControlAppCorrelationId).then((function(e){n(e)}),(function(e){a(e)}))}else a(new Event("config is empty."))}),(function(e){a(e)}))}))}return new Promise((function(e,t){return t(new Event("'authcode' as authFlow is only supported"))}))},t.getToken=function(e,r,i,o,a,c){return t.config&&t.config.authFlow===n.AuthCode?s?BrowserAuth.GetToken({resource:e,scopes:r,applicationId:i,correlationId:o,popup:!!a,claims:c}):BrowserAuth.GetToken(e,i,o,!!a,!!a,!1,c):Promise.reject(new Event("'authcode' as authFlow is only supported"))}}(e.WebAuth||(e.WebAuth={}))}(OSF||(OSF={})),function(e){var t=function(){function t(t){this._delegateVersion=1,this._webAppState=t,this._webClientHostControllerHelper=e.BootStrapExtension.createWebClientHostControllerHelper(this._webAppState,this._delegateVersion)}return t.prototype.execute=function(e,t,n){var r=this,i=this._webClientHostControllerHelper.getHostCallArgs(e,t),o=this._webClientHostControllerHelper.getTargetMethodName(e);this._webAppState.clientEndPoint.invoke(o,(function(t,i){var o=0;if(0==t)r._delegateVersion=i.Version,o=r._webClientHostControllerHelper.parseErrorFromPayload(e,i);else switch(t){case-5:o=7e3;break;default:o=5001}n&&n(o,i)}),i)},t.prototype.registerEvent=function(e,t,n,r,i){this._webAppState.clientEndPoint.registerForEvent(this.getXdmEventName(n,t),(function(e){r&&r(e)}),this._getOnAfterRegisterEvent(!0,e,i),{controlId:this._webAppState.id,eventDispId:e,targetId:n,__timeout__:-1})},t.prototype.unregisterEvent=function(e,t,n,r){this._webAppState.clientEndPoint.unregisterForEvent(this.getXdmEventName(n,t),this._getOnAfterRegisterEvent(!1,e,r),{controlId:this._webAppState.id,eventDispId:e,targetId:n,__timeout__:-1})},t.prototype.messageParent=function(t){throw e.Utility.createNotImplementedException()},t.prototype.openDialog=function(t,n,r,i,o){throw e.Utility.createNotImplementedException()},t.prototype.closeDialog=function(t,n,r,i){throw e.Utility.createNotImplementedException()},t.prototype.sendMessage=function(t){throw e.Utility.createNotImplementedException()},t.prototype.closeSdxDialog=function(t){this._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[this._webAppState.id,e.AgaveHostAction.CloseSDXDialog,{InstanceId:this._webAppState.id,DialogCloseCallbackParam:t}])},t.prototype.resizeSdxDialog=function(t,n){this._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[this._webAppState.id,e.AgaveHostAction.ResizeSDXDialog,{InstanceId:this._webAppState.id,DialogWidth:t+"px",DialogHeight:n+"px"}])},t.prototype.getXdmEventName=function(t,n){return n==e.EventType.BindingSelectionChanged||n==e.EventType.BindingDataChanged||n==e.EventType.DataNodeDeleted||n==e.EventType.DataNodeInserted||n==e.EventType.DataNodeReplaced?t+"_"+n:n},t.prototype._getOnAfterRegisterEvent=function(t,n,r){var i=(new Date).getTime();return function(o,a){var s;if(0!=o)switch(o){case-5:s=7e3;break;default:s=5001}else s=a?a.Error?a.Error:0:5001;r&&r(s),e.AppTelemetry&&e.AppTelemetry.onRegisterDone(t,n,Math.abs((new Date).getTime()-i),s)}},t}();e.WebClientHostController=t}(OSF||(OSF={})),function(e){var t=function(){function e(e,t){this._webAppState=e,this._delegateVersion=t}return e.prototype.getHostCallArgs=function(e,t){var n=t;return n||(n={}),n.DdaMethod={ControlId:this.getControlId(),DispatchId:e,Version:this._delegateVersion},n.__timeout__=-1,n},e.prototype.getTargetMethodName=function(e){return"executeMethod"},e.prototype.parseErrorFromPayload=function(e,t){return t.Error},e.prototype.getControlId=function(){return this._webAppState.id},e}();e.WebClientHostControllerHelper=t}(OSF||(OSF={})),function(e){var t=function(){function t(){}return t.prototype.read=function(t){e._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(75,{toSafeArrayHost:function(){return[]},fromSafeArrayHost:function(e){return null},toWebHost:function(){return{}},fromWebHost:function(e){return e.Properties.Settings}},(function(e){if(e.status===Office.AsyncResultStatus.Succeeded){for(var n={},r=0;r<e.value.length;r++){var i=e.value[r];Array.isArray(i)?n[i[0]]=i[1]:n[i.Name]=i.Value}t(0,n)}else{var o=e.error.code;t(o,{})}}))},t.prototype.write=function(t,n){var r=e._OfficeAppFactory.getAsyncMethodExecutor(),i=[];for(var o in t){var a=[];a.push(o),a.push(t[o]),i.push(a)}var s={toSafeArrayHost:function(){return null},fromSafeArrayHost:function(e){return null},toWebHost:function(){return{DdaSettingsMethod:{OverwriteIfStale:!0,Properties:i}}},fromWebHost:function(e){return null}};r.executeAsync(76,s,(function(e){if(e.status===Office.AsyncResultStatus.Succeeded)n(0);else{var t=e.error.code;n(t)}}))},t}();e.WebClientSettingsManager=t}(OSF||(OSF={})),function(e){var t=function(t){function n(e,n,r,i){var o=t.call(this,e,n,r,i)||this;return o._serializedSettings={},o._serializedHostSettings={},o._initializeNestedAppAuthPromise=null,o._appContext={},o._tabbableElements="a[href]:not([tabindex='-1']),area[href]:not([tabindex='-1']),button:not([disabled]):not([tabindex='-1']),input:not([disabled]):not([tabindex='-1']),select:not([disabled]):not([tabindex='-1']),textarea:not([disabled]):not([tabindex='-1']),*[tabindex]:not([tabindex='-1']),*[contenteditable]:not([disabled]):not([tabindex='-1'])",o}return __extends(n,t),n.prototype.get_addInSourceUrlFromAppContext=function(){var e=this._appContext&&this._appContext._addInSourceUrl;return"string"==typeof e&&e?e:""},Object.defineProperty(n.prototype,"isHostOriginTrusted",{get:function(){return this._isHostOriginTrustedFunc},set:function(e){this._isHostOriginTrustedFunc=e},enumerable:!0,configurable:!0}),n.prototype.saveAndSetDialogInfo=function(t){var n,r=e.OUtil.getSessionStorage();if(r){if(t||(t=e.OUtil.parseHostInfoFromWindowName(!0,e._OfficeAppFactory.getWindowName())),t&&t.indexOf("isDialog")>-1){var i=(n=e.OUtil.parseXdmInfo(!0))?n.split("|")[1]:null;return null!=i&&r.setItem(i+"IsDialog","true"),void(this._hostInfo.isDialog=!0)}this._hostInfo.isDialog=null!=r.getItem(e.OUtil.getXdmFieldValue("AppId",!1)+"IsDialog")}},n.prototype.checkReceiverOriginAndRun=function(t){return __awaiter(this,void 0,void 0,(function(){var n,r,i,o,a,s,c,l,d,u,f;return __generator(this,(function(p){switch(p.label){case 0:return 3===(n=this)._webAppState.clientEndPoint.hostTrustCheckStatus?(t(),[2]):(r=e.OUtil.parseUrl(n._webAppState.clientEndPoint.targetUrl,!1),i="https:"==r.protocol,o=r.hostname,a="NotHttps",0!==n._webAppState.clientEndPoint.hostTrustCheckStatus?[3,6]:(i||(n._webAppState.clientEndPoint.hostTrustCheckStatus=2),2==n._webAppState.clientEndPoint.hostTrustCheckStatus?[3,6]:(s=!1,e.OUtil.isChangeGateEnabled("Microsoft.Office.SharedOnline.ChangeGate.OfficeVSO_10910853_OfficeJsNPMDownloadTrustedDomainList")?[4,e.XdmCommunicationManager.isHostNameValidWacDomainAsync(o,n.isHostOriginTrusted)]:[3,2])));case 1:return s=p.sent(),[3,5];case 2:return(c=e.SovereignHelper.isSovereignVersion())&&!0!==e.OUtil.getCustomOfficeInitializationSettings().trustAllCloudEnvironments||(s=e.XdmCommunicationManager.isHostNameValidWacDomain(o),n.isHostOriginTrusted&&(s=s||n.isHostOriginTrusted(o))),s||!c?[3,5]:(n._sovereignHelper||(n._sovereignHelper=new e.SovereignHelper),[4,(l=n._sovereignHelper).isConfigAvailable()]);case 3:return p.sent()?[4,l.isSovereignHostTrusted(o)]:[2];case 4:s=p.sent(),p.label=5;case 5:s&&(n._webAppState.clientEndPoint.hostTrustCheckStatus=3),p.label=6;case 6:if(n._webAppState.clientEndPoint.checkStatusLogged||null==n._hostInfo||void 0===n._hostInfo||(e.AppTelemetry.onCheckWACHost(n._webAppState.clientEndPoint.hostTrustCheckStatus,n._webAppState.id,n._hostInfo.hostType,n._hostInfo.hostPlatform,n._webAppState.clientEndPoint.targetUrl),n._webAppState.clientEndPoint.checkStatusLogged=!0),3===n._webAppState.clientEndPoint.hostTrustCheckStatus||e.LoadScriptHelper.disableHostCheck())t();else{if(d=e.OUtil.isChangeGateEnabled("Microsoft.Office.SharedOnline.ChangeGate.OfficeVSO_10910853_OfficeJsNPMDownloadTrustedDomainList")&&1===e.OUtil.getLibraryReleaseVehicle(),e.LoadScriptHelper.isSdx()||d)throw new Error("Not supported host");u=function(){var r=e.LoadScriptHelper.getHostBundleJsBasePath().match(/^https?:\/\/[^:/?#]*(?::([0-9]+))?/);if(r&&r[0]){var s=e.LoadScriptHelper.getHostBundleJsBasePath()+"AgaveErrorUX/index.html#",c={error:"NotTrustedWAC",locale:e.getSupportedLocale(n._hostInfo.hostLocale,e.ConstantNames.DefaultLocale),hostname:o,noHttps:!i,validate:!1},l=document.createElement("iframe");l.style.visibility="hidden",l.style.height="0",l.style.width="0";var d=function(i){if(i.source==l.contentWindow&&i.origin==r[0])try{!0===JSON.parse(i.data).hostUserTrusted?(n._webAppState.clientEndPoint.hostTrustCheckStatus=3,e.OUtil.removeEventListener(window,"message",d),document.body.removeChild(l)):(c.validate=!1,window.location.replace(s+encodeURIComponent(JSON.stringify(c)))),t()}catch(t){e.OUtil.ensureOfficeStringsJs().then((function(){document.body.textContent=Strings.OfficeOM.L_NotTrustedWAC}))}};e.OUtil.addEventListener(window,"message",d),c.validate=!0,l.setAttribute("src",s+encodeURIComponent(JSON.stringify(c))),l.onload=function(){var e={hostname:o,noHttps:!i};l.contentWindow.postMessage(JSON.stringify(e),r[0])},document.body.appendChild(l)}else e.OUtil.ensureOfficeStringsJs().then((function(){document.body.textContent=Strings.OfficeOM.L_NotTrustedWAC}));if(e.OUtil.checkFlight(2)&&!i)throw new Error(a)},document.body?u():(f=!1,document.addEventListener("DOMContentLoaded",(function(){f||(f=!0,u())})))}return[2]}}))}))},n.prototype.setAgaveHostCommunication=function(){try{var t=this,n=e.OUtil.parseXdmInfoWithGivenFragment(!1,e._OfficeAppFactory.getWindowLocationHash());if(n||(n=e.OUtil.parseXdmInfoFromWindowName(!1,e._OfficeAppFactory.getWindowName())),n){var r=e.OUtil.getInfoItems(n);null!=r&&r.length>=3&&(t._webAppState.conversationID=r[0],t._webAppState.id=r[1],t._webAppState.webAppUrl=r[2].indexOf(":")>=0?r[2]:decodeURIComponent(r[2]))}if(t._webAppState.wnd=null!=window.opener?window.opener:window.parent,this._hostInfo.isDialog&&null!=window.opener)return;t._webAppState.clientEndPoint=e.XdmCommunicationManager.connect(t._webAppState.conversationID,t._webAppState.wnd,t._webAppState.webAppUrl),t._webAppState.serviceEndPoint=e.XdmCommunicationManager.createServiceEndPoint(t._webAppState.id),t._webAppState.clientEndPoint.checkReceiverOriginAndRun=function(e){t.checkReceiverOriginAndRun(e)};var i=t._webAppState.conversationID+e.Constants.NotificationConversationIdSuffix;t._webAppState.serviceEndPoint.registerConversation(i,t._webAppState.webAppUrl);t._webAppState.serviceEndPoint.registerMethod("Office_notifyAgave",(function(n){var r;switch(r="string"==typeof n?n:n[0]){case e.AgaveHostAction.Select:t._webAppState.focused=!0;break;case e.AgaveHostAction.UnSelect:t._webAppState.focused=!1;break;case e.AgaveHostAction.TabIn:case e.AgaveHostAction.CtrlF6In:window.focus();var i=document.querySelectorAll(t._tabbableElements);e.OUtil.focusToFirstTabbable(i,!1)||(window.blur(),t._webAppState.focused=!1,t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,e.AgaveHostAction.ExitNoFocusable]));break;case e.AgaveHostAction.TabInShift:window.focus();i=document.querySelectorAll(t._tabbableElements);e.OUtil.focusToFirstTabbable(i,!0)||(window.blur(),t._webAppState.focused=!1,t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,e.AgaveHostAction.ExitNoFocusableShift]));break;case e.AgaveHostAction.SendMessage:if(Office.context.messaging.onMessage){var o=n[1];Office.context.messaging.onMessage(o)}break;case e.AgaveHostAction.TaskPaneHeaderButtonClicked:Office.context.ui.taskPaneAction.onHeaderButtonClick&&Office.context.ui.taskPaneAction.onHeaderButtonClick();break;default:e.Utility.trace("actionId "+r+" notifyAgave is wrong.")}}),0,!1),t.addOrRemoveEventListenersForWindow(!0)}catch(t){throw e.AppTelemetry&&e.AppTelemetry.logAppException("Exception thrown in setAgaveHostCommunication. Exception:["+t+"]"),t}},n.prototype.getAppContext=function(t,n,r){var i=this,o=this,a=function(t,a){if(OSFPerformance.getAppContextXdmEnd=OSFPerformance.now(),a._appName===e.AppName.ExcelWebApp&&Array.isArray(a._settings))for(var s=0,c=a._settings;s<c.length;s++){var l=c[s],d=l[0],u=l[1];i._serializedSettings[d]=u}else i._serializedSettings=a._settings||{};if(a._appName===e.AppName.ExcelWebApp&&Array.isArray(a._hostSettings))for(var f=0,p=a._hostSettings;f<p.length;f++){var m=p[f];d=m[0],u=m[1];i._serializedHostSettings[d]=u}else i._serializedHostSettings=a._hostSettings||{};if(a._appAndHostSettingsEqual&&(i._serializedHostSettings=__assign({},i._serializedSettings)),!o._hostInfo.isDialog||null==window.opener){var g=window.location.origin;o._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[o._webAppState.id,e.AgaveHostAction.UpdateTargetUrl,g])}if(0===t&&null!=a._id&&null!=a._appName&&null!=a._appVersion&&null!=a._appUILocale&&null!=a._dataLocale&&null!=a._docUrl&&null!=a._clientMode&&null!=a._reason){o._appContext=a;var h=a._appInstanceId?a._appInstanceId:a._id,y=0;null!=a._appMinorVersion&&(y=a._appMinorVersion);var v=void 0;null!=a._requirementMatrix&&(v=a._requirementMatrix),a.eToken=a.eToken?a.eToken:"";var S=new e.OfficeAppContext(a._id,a._appName,a._appVersion,a._appUILocale,a._dataLocale,a._docUrl,a._clientMode,(function(){return i._serializedSettings}),a._reason,a._osfControlType,a._eToken,a._correlationId,h,!1,!0,y,v,a._hostCustomMessage,a._hostFullVersion,a._clientWindowHeight,a._clientWindowWidth,a._addinName,a._appDomains,a._dialogRequirementMatrix,a._featureGates,a._officeTheme,a._initialDisplayMode,a._isFromWacAutomation,a._wopiHostOriginForSingleSignOn,(function(){return i._serializedHostSettings}),!0,a._nestedAppAuthBridgeType,a._partitionKey,a._topFrameOrigin);S.set_taskpaneUrl(a._taskpaneUrl),n(S)}else{var b="Function ContextActivationManager_getAppContextAsync call failed. ErrorCode is "+t+", exception: "+a;e.AppTelemetry&&e.AppTelemetry.logAppException(b),r(b)}};try{var s=!0;this._hostInfo.isDialog&&null!=window.opener&&(s=!1);var c=e.OUtil.parseAppContextFromWindowName(s,e._OfficeAppFactory.getWindowName());c?a(0,c):(OSFPerformance.getAppContextXdmStart=OSFPerformance.now(),this._webAppState.clientEndPoint.invoke("ContextActivationManager_getAppContextAsync",a,this._webAppState.id))}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Exception thrown when trying to invoke getAppContextAsync. Exception:["+t+"]"),r(t)}},n.prototype.createClientHostController=function(){return this._clientHostController||(this._clientHostController=new e.WebClientHostController(this._webAppState)),this._clientHostController},n.prototype.createAsyncMethodExecutor=function(){return new e.WebAsyncMethodExecutor(this._clientHostController)},n.prototype.createClientSettingsManager=function(){return new e.WebClientSettingsManager},n.prototype.addOrRemoveEventListenersForWindow=function(t){var n=this,r=function(){n._webAppState.focused||(n._webAppState.focused=!0),n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.Select])},i=function(){e&&(n._webAppState.focused&&(n._webAppState.focused=!1),n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.UnSelect]))},o=function(t){if(t.preventDefault=t.preventDefault||function(){t.returnValue=!1},117==t.keyCode&&(t.ctrlKey||t.metaKey)){t.preventDefault();var r=e.AgaveHostAction.CtrlF6Exit;t.shiftKey&&(r=e.AgaveHostAction.CtrlF6ExitShift),n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,r])}else if(9==t.keyCode){t.preventDefault();var i=document.querySelectorAll(n._tabbableElements);e.OUtil.focusToNextTabbable(i,t.target||t.srcElement,t.shiftKey)||(n._hostInfo.isDialog?e.OUtil.focusToFirstTabbable(i,t.shiftKey):t.shiftKey?n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.TabExitShift]):n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.TabExit]))}else if(27==t.keyCode)t.preventDefault(),n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.EscExit]);else if(113==t.keyCode)t.preventDefault(),n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.F2Exit]);else if((t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)&&t.keyCode>=1&&t.keyCode<=255){var o={keyCode:t.keyCode,shiftKey:t.shiftKey,altKey:t.altKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey};n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.KeyboardShortcuts,o])}},a=function(e){117==e.keyCode&&e.ctrlKey&&(e.preventDefault?e.preventDefault():e.returnValue=!1)};e.Utility._DebugXdm||(t?(e.OUtil.addEventListener(window,"focus",r),e.OUtil.addEventListener(window,"blur",i),e.OUtil.addEventListener(window,"keydown",o),e.OUtil.addEventListener(window,"keypress",a)):(e.OUtil.removeEventListener(window,"focus",r),e.OUtil.removeEventListener(window,"blur",i),e.OUtil.removeEventListener(window,"keydown",o),e.OUtil.removeEventListener(window,"keypress",a)))},n.prototype.getTabbableElements=function(){return this._tabbableElements},n.prototype.setupNestedAppAuthDependencies=function(){var e=this;window.__initializeNestedAppAuth=function(){return e._initializeNestedAppAuthPromise||(e._initializeNestedAppAuthPromise=__awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,Office.onReadyInternal()];case 1:return e.sent(),this._createNaaBridge?[4,this._createNaaBridge()]:[3,3];case 2:e.sent(),e.label=3;case 3:return[2]}}))}))),e._initializeNestedAppAuthPromise}},n}(e.InitializationHelper);e.WebInitializationHelper=t}(OSF||(OSF={})),function(e){var t=function(){function t(e,t){this._initializationHelper=e,this._scriptMessager=t}return t.prototype.read=function(e){this._initializationHelper.getAppContext(null,(function(t){if(e){var n=t.get_settingsFunc()();e(0,n)}}),(function(t){e&&e(5001,{})}))},t.prototype.write=function(t,n){var r={},i=[],o=[];for(var a in t)i.push(a),o.push(t[a]);r.keys=i,r.values=o;this._scriptMessager.invokeMethod(e.Webkit.MessageHandlerName,e.Webkit.MethodId.WriteSettings,r,(function(e){n&&n(e[0])}))},t}();e.WebkitClientSettingsManager=t}(OSF||(OSF={})),function(e){!function(t){t.MessageHandlerName="Agave",t.PopupMessageHandlerName="WefPopupHandler",function(e){e[e.Settings=0]="Settings",e[e.SolutionReferenceId=1]="SolutionReferenceId",e[e.AppType=2]="AppType",e[e.MajorVersion=3]="MajorVersion",e[e.MinorVersion=4]="MinorVersion",e[e.RevisionVersion=5]="RevisionVersion",e[e.APIVersionSequence=6]="APIVersionSequence",e[e.AppCapabilities=7]="AppCapabilities",e[e.APPUILocale=8]="APPUILocale",e[e.AppDataLocale=9]="AppDataLocale",e[e.BindingCount=10]="BindingCount",e[e.DocumentUrl=11]="DocumentUrl",e[e.ActivationMode=12]="ActivationMode",e[e.ControlIntegrationLevel=13]="ControlIntegrationLevel",e[e.SolutionToken=14]="SolutionToken",e[e.APISetVersion=15]="APISetVersion",e[e.CorrelationId=16]="CorrelationId",e[e.InstanceId=17]="InstanceId",e[e.TouchEnabled=18]="TouchEnabled",e[e.CommerceAllowed=19]="CommerceAllowed",e[e.RequirementMatrix=20]="RequirementMatrix",e[e.HostCustomMessage=21]="HostCustomMessage",e[e.HostFullVersion=22]="HostFullVersion",e[e.InitialDisplayMode=23]="InitialDisplayMode",e[e.FeatureGates=24]="FeatureGates",e[e.HostSettings=25]="HostSettings",e[e.OfficeThemeInfo=26]="OfficeThemeInfo"}(t.AppContextProperties||(t.AppContextProperties={})),function(e){e[e.Execute=1]="Execute",e[e.RegisterEvent=2]="RegisterEvent",e[e.UnregisterEvent=3]="UnregisterEvent",e[e.WriteSettings=4]="WriteSettings",e[e.GetContext=5]="GetContext",e[e.SendMessage=6]="SendMessage",e[e.MessageParent=7]="MessageParent",e[e.SendMessage2=8]="SendMessage2",e[e.MessageParent2=9]="MessageParent2",e[e.CloseSdxDialog=10]="CloseSdxDialog",e[e.ResizeSdxDialog=11]="ResizeSdxDialog"}(t.MethodId||(t.MethodId={}));var n=function(){function t(e){this.hostScriptProxy=e,this.useFullDialogAPI=!!window._enableFullDialogAPI,this.osfSupportsDialogOrigin=!!window._osfEnableDialogOrigin}return t.prototype.execute=function(t,n,r){var i={id:t,apiArgs:n};this.hostScriptProxy.invokeMethod(e.Webkit.MessageHandlerName,e.Webkit.MethodId.Execute,i,(function(t){if(r){var n=[];if(e.OUtil.isArray(t))for(var i=0;i<t.length;i++){var o=t[i];e.OUtil.isArray(o)&&(o=new e.WebkitSafeArray(o)),n.unshift(o)}return r.apply(null,n)}}))},t.prototype.registerEvent=function(t,n,r,i,o){this.hostScriptProxy.registerEvent(e.Webkit.MessageHandlerName,e.Webkit.MethodId.RegisterEvent,t,r,(function(t){var n=t,r=0;e.OUtil.isArray(t)&&t.length>=2&&(n=t[0],r=t[1]),i&&i(r,new e.WebkitSafeArray(n))}),(function(t){if(o)return o(new e.WebkitSafeArray(t))}))},t.prototype.unregisterEvent=function(t,n,r,i){this.hostScriptProxy.unregisterEvent(e.Webkit.MessageHandlerName,e.Webkit.MethodId.UnregisterEvent,t,r,(function(t){return i(new e.WebkitSafeArray(t))}))},t.prototype.messageParent=function(t){var n,r;if(this.osfSupportsDialogOrigin&&t[e.ParameterNames.TargetOrigin]?(n=this.useFullDialogAPI?JSON.stringify(t):t[e.ParameterNames.MessageToParent],r=e.Webkit.MethodId.MessageParent2):(n=t[e.ParameterNames.MessageToParent],r=e.Webkit.MethodId.MessageParent),this.useFullDialogAPI)this.hostScriptProxy.invokeMethod(e.Webkit.MessageHandlerName,r,n,null);else{var i={dialogMessage:{messageType:0,messageContent:n}},o=r==e.Webkit.MethodId.MessageParent2?t[e.ParameterNames.TargetOrigin]:window.location.origin;window.opener.postMessage(JSON.stringify(i),o)}},t.prototype.openDialog=function(n,r,i,o,a){if(this.useFullDialogAPI)this.registerEvent(n,r,i,o,a);else if(!t.popup||t.popup.closed){t.OpenDialogCallback=void 0;var s=JSON.parse(i),c=s.url;if(c){var l=c.split("#"),d="?";l[0].indexOf("?")>-1&&(d="&");var u="width="+screen.width*s.width/100+", height="+screen.height*s.height/100;l[0]=l[0].concat(d).concat("action=displayDialog");var f=l.join("#");t.popup=window.open(f,"",u),t.DialogEventListener=function(t){if(t.origin==window.location.origin)try{var r=JSON.parse(t.data);r.dialogMessage&&o(n,[0,r.dialogMessage.messageContent,t.origin])}catch(n){e.Utility.trace("messages received cannot be handlered. Message:"+t.data)}},t.OpenDialogCallback=function(e){0==e&&(window.addEventListener("message",t.DialogEventListener),t.interval=window.setInterval(p,1e3),t.NotifyError=function(e){o(n,[e])}),a(e)}}else a(12003)}else a(12007);function p(){try{(null==t.popup||t.popup.closed)&&(window.clearInterval(t.interval),window.removeEventListener("message",t.DialogEventListener),t.NotifyError=null,t.popup=null,o(n,[12006]))}catch(t){e.Utility.trace("Error happened when popup window closed.")}}},t.prototype.closeDialog=function(e,n,r,i){this.useFullDialogAPI?this.unregisterEvent(e,n,r,i):t.popup?(t.interval&&window.clearInterval(t.interval),t.popup.close(),t.popup=null,window.removeEventListener("message",t.DialogEventListener),t.NotifyError=null,i(0)):i(5001)},t.prototype.sendMessage=function(t){var n,r;this.osfSupportsDialogOrigin&&t[e.ParameterNames.TargetOrigin]?(n=JSON.stringify(t),r=e.Webkit.MethodId.SendMessage2):(n=t[e.ParameterNames.MessageContent],r=e.Webkit.MethodId.SendMessage,!isNaN(parseFloat(n))&&isFinite(n)&&(n=n.toString())),this.hostScriptProxy.invokeMethod(e.Webkit.MessageHandlerName,r,n,null)},t.prototype.closeSdxDialog=function(t){var n=[t],r=e.Webkit.MethodId.CloseSdxDialog;this.hostScriptProxy.invokeMethod(e.Webkit.MessageHandlerName,r,n,null)},t.prototype.resizeSdxDialog=function(t,n){var r=[t,n],i=e.Webkit.MethodId.ResizeSdxDialog;this.hostScriptProxy.invokeMethod(e.Webkit.MessageHandlerName,i,r,null)},t}();t.WebkitHostController=n}(e.Webkit||(e.Webkit={}))}(OSF||(OSF={})),function(e){var t=function(t){function n(e,n,r,i){var o=t.call(this,e,n,r,i)||this;return o._serializedSettings={},o._serializedHostSettings={},o.initializeWebkitMessaging(),o}return __extends(n,t),n.prototype.initializeWebkitMessaging=function(){e.ScriptMessaging=OSFWebkit.ScriptMessaging},n.prototype.getAppContext=function(t,n,r){var i,o=this;i=this._hostInfo.isDialog&&window.webkit.messageHandlers[e.Webkit.PopupMessageHandlerName]?e.Webkit.PopupMessageHandlerName:e.Webkit.MessageHandlerName,e.ScriptMessaging.GetScriptMessenger().invokeMethod(i,e.Webkit.MethodId.GetContext,[],(function(t){var r,i=e.Webkit.AppContextProperties,a=t[i.AppType],s=t[i.Settings];if(s&&2===s.length)for(var c=s[0],l=s[1],d=0;d<c.length;d++)o._serializedSettings[c[d]]=l[d];var u=t[i.HostSettings];if(u&&2===u.length)for(c=u[0],l=u[1],d=0;d<c.length;d++)o._serializedHostSettings[c[d]]=l[d];var f=t[i.SolutionReferenceId],p=t[i.MajorVersion],m=t[i.MinorVersion],g=t[i.AppCapabilities],h=t[i.APPUILocale],y=t[i.AppDataLocale],v=t[i.DocumentUrl],S=t[i.ActivationMode],b=t[i.ControlIntegrationLevel],O=t[i.SolutionToken];O=O?O.toString():"";var _,A=t[i.CorrelationId],T=t[i.InstanceId],C=t[i.TouchEnabled],E=t[i.CommerceAllowed],I=t[i.RequirementMatrix],P=t[i.HostCustomMessage],w=t[i.HostFullVersion],D=t[i.InitialDisplayMode],x=t[i.FeatureGates];if(x)try{_=JSON.parse(x)}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Exception trying to parse FeatureGates."+t)}var M=null;if(t[i.OfficeThemeInfo])try{M=JSON.parse(t[i.OfficeThemeInfo])}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Exception while parsing officeThemeInfo. Details: "+t)}var N={};if(M){var F={bodyBackgroundColor:{name:"bodyBackgroundColor",convertToHex:!0},bodyForegroundColor:{name:"bodyForegroundColor",convertToHex:!0},controlBackgroundColor:{name:"controlBackgroundColor",convertToHex:!0},controlForegroundColor:{name:"controlForegroundColor",convertToHex:!0},primaryFontColor:{name:"bodyForegroundColor",convertToHex:!0},primaryBackgroundColor:{name:"bodyBackgroundColor",convertToHex:!0},secondaryFontColor:{name:"controlForegroundColor",convertToHex:!0},secondaryBackgroundColor:{name:"controlBackgroundColor",convertToHex:!0},fluentThemeData:{name:"fluentThemeData",convertToHex:!1}};for(var R in M){var k=!1,H=R;F[R]&&(H=F[R].name,k=F[R].convertToHex),N[H]=k?e.OUtil.convertIntToCssHexColor(M[R]):M[R]}}r=new e.OfficeAppContext(f,a,p,h,y,v,g,(function(){return o._serializedSettings}),S,b,O,A,T,C,E,m,I,P,w,void 0,void 0,void 0,void 0,void 0,_,N,D,void 0,void 0,(function(){return o._serializedHostSettings}),!1,void 0,void 0,void 0),n(r)}))},n.prototype.createClientHostController=function(){return this._clientHostController||(this._clientHostController=new e.Webkit.WebkitHostController(e.ScriptMessaging.GetScriptMessenger())),this._clientHostController},n.prototype.createAsyncMethodExecutor=function(){return new e.SafeArrayAsyncMethodExecutor(this.createClientHostController())},n.prototype.createClientSettingsManager=function(){return new e.WebkitClientSettingsManager(this,e.ScriptMessaging.GetScriptMessenger())},n}(e.InitializationHelper);e.WebkitInitializationHelper=t}(OSF||(OSF={})),function(e){var t=function(){function t(e){this.data=e,this.safeArrayFlag=this.isSafeArray(e)}return t.prototype.dimensions=function(){var e=0;return this.safeArrayFlag?e=this.data[0][0]:this.isArray()&&(e=2),e},t.prototype.getItem=function(){var e=null;e=this.safeArrayFlag?this.toArray():this.data;for(var t=0;t<arguments.length;t++)e=e[arguments[t]];return e},t.prototype.lbound=function(e){return 0},t.prototype.ubound=function(t){var n=0;if(this.safeArrayFlag)n=this.data[0][t];else if(this.isArray()){if(1==t)return this.data.length;if(2==t){if(e.OUtil.isArray(this.data[0]))return this.data[0].length;if(null!=this.data[0])return 1}}return n},t.prototype.toArray=function(){if(0==this.isArray())return this.data;for(var e=[],n=this.safeArrayFlag?1:0;n<this.data.length;n++){var r=this.data[n];this.isSafeArray(r)?e.push(new t(r)):e.push(r)}return e},t.prototype.isArray=function(){return e.OUtil.isArray(this.data)},t.prototype.isSafeArray=function(t){var n=!1;if(e.OUtil.isArray(t)&&e.OUtil.isArray(t[0])){var r=t[0],i=r[0];if(r.length!=i+1)return!1;for(var o=1,a=1;a<r.length;a++){var s=r[a];if(0==isFinite(s))return!1;o*=s}n=++o==t.length}return n},t}();e.WebkitSafeArray=t}(OSF||(OSF={})),function(e){!function(e){var t=null;e.agaveHostCallback=function(e,n){t.agaveHostCallback(e,n)},e.agaveHostEventCallback=function(e,n){t.agaveHostEventCallback(e,n)},e.GetScriptMessenger=function(){return null==t&&(t=r.IsSupportedByHost()?new r:new i("OSF.ScriptMessaging.agaveHostCallback","OSF.ScriptMessaging.agaveHostEventCallback")),t};var n=function(e,t,n){this.id=e,this.targetId=t,this.handler=n},r=function(){function e(){this.eventHandlers=[]}return e.IsSupportedByHost=function(){return!!window._osfHostAPI},e.prototype.invokeMethod=function(e,t,n,r){window._osfHostAPI(e,this.constructMessagingArgs(t,n),(function(e){var t=r(e);return void 0===t||!0===t}))},e.prototype.registerEvent=function(e,t,n,r,i,o){var a={id:n,targetId:r},s=window._osfHostRegisterEvent(e,this.constructMessagingArgs(t,a),(function(e){return i(e),!1}),(function(e){return o(e),!0}));this.eventHandlers.push({targetId:r,dispId:n,callbackId:s.eventCallbackId})},e.prototype.unregisterEvent=function(e,t,n,r,i){var o={id:n,targetId:r};window._osfHostAPI(e,this.constructMessagingArgs(t,o),(function(e){return i(e),!0}));for(var a=this.eventHandlers.length-1;a>=0;a--){var s=this.eventHandlers[a];s.dispId===n&&s.targetId===r&&(this.eventHandlers.splice(a,1),window._osfHostUnregisterCallback(s.callbackId))}},e.prototype.agaveHostCallback=function(e,t){},e.prototype.agaveHostEventCallback=function(e,t){},e.prototype.constructMessagingArgs=function(e,t){return{params:t,methodId:e}},e}(),i=function(){function e(t,n){this.callingIndex=0,this.callbackList={},this.eventHandlerList={},this.asyncMethodCallbackFunctionName=t,this.eventCallbackFunctionName=n,this.conversationId=e.getCurrentTimeMS().toString()}return e.prototype.invokeMethod=function(e,t,n,r){this.postWebkitMessage({},e,t,n,r)},e.prototype.registerEvent=function(e,t,r,i,o,a){var s={eventCallbackFunction:this.eventCallbackFunctionName},c={id:r,targetId:i},l=this.postWebkitMessage(s,e,t,c,a);this.eventHandlerList[l]=new n(r,i,o)},e.prototype.unregisterEvent=function(e,t,n,r,i){var o={id:n,targetId:r};for(var a in this.eventHandlerList)if(this.eventHandlerList.hasOwnProperty(a)){var s=this.eventHandlerList[a];s.id==n&&s.targetId==r&&delete this.eventHandlerList[a]}this.invokeMethod(e,t,o,i)},e.prototype.agaveHostCallback=function(e,t){var n=this.callbackList[e];if(n){var r=n(t);void 0!==r&&!0!==r||delete this.callbackList[e]}},e.prototype.agaveHostEventCallback=function(e,t){var n=this.eventHandlerList[e];n&&n.handler(t)},e.prototype.postWebkitMessage=function(t,n,r,i,o){t.methodId=r,t.params=i;var a="";o&&(a=this.generateCorrelationId(),this.callbackList[a]=o,t.callbackId=a,t.callbackFunction=this.asyncMethodCallbackFunctionName);var s=function(){window.webkit.messageHandlers[n].postMessage(JSON.stringify(t))},c=e.getCurrentTimeMS();return null==this.lastMessageTimestamp||c-this.lastMessageTimestamp>=e.MESSAGE_TIME_DELTA?(s(),this.lastMessageTimestamp=c):(this.lastMessageTimestamp+=e.MESSAGE_TIME_DELTA,setTimeout((function(){s()}),this.lastMessageTimestamp-c)),a},e.prototype.generateCorrelationId=function(){return++this.callingIndex,this.conversationId+this.callingIndex},e.getCurrentTimeMS=function(){return(new Date).getTime()},e.MESSAGE_TIME_DELTA=10,e}()}(e.ScriptMessaging||(e.ScriptMessaging={}))}(OSFWebkit||(OSFWebkit={})),function(e){var t=function(){function t(e,t){this._initializationHelper=e,this._scriptMessager=t}return t.prototype.read=function(e){this._initializationHelper.getAppContext(null,(function(t){if(e){var n=t.get_settingsFunc()();e(0,n)}}),(function(t){e&&e(5001,{})}))},t.prototype.write=function(t,n){var r={},i=[],o=[];for(var a in t)i.push(a),o.push(t[a]);r.keys=i,r.values=o;this._scriptMessager.invokeMethod(e.WebView.MessageHandlerName,e.WebView.MethodId.WriteSettings,r,(function(e){n&&n(e[0])}))},t}();e.WebViewClientSettingsManager=t}(OSF||(OSF={})),function(e){!function(t){t.MessageHandlerName="Agave",t.PopupMessageHandlerName="WefPopupHandler",function(e){e[e.Settings=0]="Settings",e[e.SolutionReferenceId=1]="SolutionReferenceId",e[e.AppType=2]="AppType",e[e.MajorVersion=3]="MajorVersion",e[e.MinorVersion=4]="MinorVersion",e[e.RevisionVersion=5]="RevisionVersion",e[e.APIVersionSequence=6]="APIVersionSequence",e[e.AppCapabilities=7]="AppCapabilities",e[e.APPUILocale=8]="APPUILocale",e[e.AppDataLocale=9]="AppDataLocale",e[e.BindingCount=10]="BindingCount",e[e.DocumentUrl=11]="DocumentUrl",e[e.ActivationMode=12]="ActivationMode",e[e.ControlIntegrationLevel=13]="ControlIntegrationLevel",e[e.SolutionToken=14]="SolutionToken",e[e.APISetVersion=15]="APISetVersion",e[e.CorrelationId=16]="CorrelationId",e[e.InstanceId=17]="InstanceId",e[e.TouchEnabled=18]="TouchEnabled",e[e.CommerceAllowed=19]="CommerceAllowed",e[e.RequirementMatrix=20]="RequirementMatrix",e[e.OfficeThemeInfo=21]="OfficeThemeInfo"}(t.AppContextProperties||(t.AppContextProperties={})),function(e){e[e.Execute=1]="Execute",e[e.RegisterEvent=2]="RegisterEvent",e[e.UnregisterEvent=3]="UnregisterEvent",e[e.WriteSettings=4]="WriteSettings",e[e.GetContext=5]="GetContext",e[e.OnKeydown=6]="OnKeydown",e[e.AddinInitialized=7]="AddinInitialized",e[e.OpenWindow=8]="OpenWindow",e[e.MessageParent=9]="MessageParent",e[e.SendMessage=10]="SendMessage"}(t.MethodId||(t.MethodId={}));var n=function(){function t(e){this.hostScriptProxy=e}return t.prototype.execute=function(t,n,r){var i=n;null==i&&(i=[]);var o={id:t,apiArgs:i};this.hostScriptProxy.invokeMethod(e.WebView.MessageHandlerName,e.WebView.MethodId.Execute,o,(function(t){var n=t;if(e.OUtil.isArray(t)&&t.length>=2){t[0];n=t[1]}if(r)return r(new e.WebkitSafeArray(n))}))},t.prototype.registerEvent=function(t,n,r,i,o){this.hostScriptProxy.registerEvent(e.WebView.MessageHandlerName,e.WebView.MethodId.RegisterEvent,t,r,(function(t){var n=t,r=0;e.OUtil.isArray(t)&&t.length>=2&&(r=t[0],n=t[1]),i&&i(r,new e.WebkitSafeArray(n))}),(function(t){if(o)return o(new e.WebkitSafeArray(t))}))},t.prototype.unregisterEvent=function(t,n,r,i){this.hostScriptProxy.unregisterEvent(e.WebView.MessageHandlerName,e.WebView.MethodId.UnregisterEvent,t,r,(function(t){return i(new e.WebkitSafeArray(t))}))},t.prototype.messageParent=function(t){var n={dialogMessage:{messageType:0,messageContent:t[e.ParameterNames.MessageToParent]}};window.opener.postMessage(JSON.stringify(n),window.location.origin)},t.prototype.openDialog=function(n,r,i,o,a){var s=JSON.parse(i),c=s.url;if(c){var l=c.split("#"),d="?";c.indexOf("?")>-1&&(d="&");var u="width="+screen.width*s.width/100+", height="+screen.height*s.height/100;l[0]=l[0].concat(d).concat("action=displayDialog");var f,p=l.join("#");t.popup=window.open(p,"",u),window.addEventListener("message",(function(r){if(r.source==t.popup)try{var i=JSON.parse(r.data);i.dialogMessage&&o(n,[0,i.dialogMessage.messageContent])}catch(t){e.Utility.trace("messages received cannot be handled. Message:"+r.data)}})),f=window.setInterval((function(){try{(null==t.popup||t.popup.closed)&&(window.clearInterval(f),o(n,[12006]))}catch(t){e.Utility.trace("Error happened when popup window closed.")}}),1e3),a(0)}},t.prototype.closeDialog=function(e,n,r,i){t.popup?(t.popup.close(),t.popup=null,i(0)):i(5001)},t.prototype.sendMessage=function(t){var n=t[e.ParameterNames.MessageContent];!isNaN(parseFloat(n))&&isFinite(n)&&(n=n.toString()),this.hostScriptProxy.invokeMethod(e.WebView.MessageHandlerName,e.WebView.MethodId.SendMessage,n,null)},t.prototype.closeSdxDialog=function(t){throw e.Utility.createNotImplementedException()},t.prototype.resizeSdxDialog=function(t,n){throw e.Utility.createNotImplementedException()},t}();t.WebViewHostController=n}(e.WebView||(e.WebView={}))}(OSF||(OSF={})),function(e){var t=function(t){function n(e,n,r,i){var o=t.call(this,e,n,r,i)||this;return o._serializedSettings={},o.initializeWebViewMessaging(),o}return __extends(n,t),n.prototype.initializeWebViewMessaging=function(){e.ScriptMessaging=e.WebView.ScriptMessaging},n.prototype.getAppContext=function(t,n,r){var i,o=this;i=this._hostInfo.isDialog?e.WebView.PopupMessageHandlerName:e.WebView.MessageHandlerName,e.ScriptMessaging.GetScriptMessenger().invokeMethod(i,e.WebView.MethodId.GetContext,[],(function(t){var r,i=e.Webkit.AppContextProperties,a=t[i.AppType],s=t[i.Settings];if(s&&2===s.length)for(var c=s[0],l=s[1],d=0;d<c.length;d++)o._serializedSettings[c[d]]=l[d];var u=t[i.SolutionReferenceId],f=t[i.MajorVersion],p=t[i.MinorVersion],m=t[i.AppCapabilities],g=t[i.APPUILocale],h=t[i.AppDataLocale],y=t[i.DocumentUrl],v=t[i.ActivationMode],S=t[i.ControlIntegrationLevel],b=t[i.SolutionToken];b=b?b.toString():"";var O,_=t[i.CorrelationId],A=t[i.InstanceId],T=t[i.TouchEnabled],C=t[i.CommerceAllowed],E=t[i.RequirementMatrix],I=t[i.HostCustomMessage],P=t[i.HostFullVersion],w=t[i.InitialDisplayMode],D=t[i.FeatureGates];if(D)try{O=JSON.parse(D)}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Exception trying to parse FeatureGates."+t)}r=new e.OfficeAppContext(u,a,f,g,h,y,m,(function(){return o._serializedSettings}),v,S,b,_,A,T,C,p,E,I,P,void 0,void 0,void 0,void 0,void 0,O,void 0,w,void 0,void 0,void 0,!1,void 0,void 0,void 0),n(r)}))},n.prototype.createClientHostController=function(){return this._clientHostController||(this._clientHostController=new e.WebView.WebViewHostController(e.ScriptMessaging.GetScriptMessenger())),this._clientHostController},n.prototype.createAsyncMethodExecutor=function(){return new e.SafeArrayAsyncMethodExecutor(this.createClientHostController())},n.prototype.createClientSettingsManager=function(){return new e.WebViewClientSettingsManager(this,e.ScriptMessaging.GetScriptMessenger())},n}(e.InitializationHelper);e.WebViewInitializationHelper=t}(OSF||(OSF={})),function(e){var t;!function(e){!function(e){e[e.MethodCallback=0]="MethodCallback",e[e.EventCallback=1]="EventCallback"}(e.CallbackType||(e.CallbackType={}));var t=function(e,t,n){this.callbackType=e,this.callbackId=t,this.params=n};e.CallbackData=t}(t||(t={})),function(n){var r=function(){function n(){}return n.getInstance=function(){return null==n.uniqueInstance&&(n.uniqueInstance=new n),n.uniqueInstance},n.prototype.postMessage=function(e,t){agaveHost.postMessage(t)},n.prototype.ReceiveMessage=function(n){switch(n.callbackType){case t.CallbackType.MethodCallback:e.WebView.ScriptMessaging.agaveHostCallback(n.callbackId,n.params);break;case t.CallbackType.EventCallback:e.WebView.ScriptMessaging.agaveHostEventCallback(n.callbackId,n.params)}},n}();n.Poster=r}(e.Android||(e.Android={})),function(n){var r=function(){function n(){window.addEventListener("message",this.OnReceiveMessage.bind(this))}return n.prototype.postMessage=function(e,t){window.parent.postMessage(t,"*")},n.prototype.OnReceiveMessage=function(n){if(n.source==window.parent&&window.parent==window.top&&n.origin.startsWith("ms-appx-web://")){var r;try{r=JSON.parse(n.data)}catch(e){return}switch(r.callbackType){case t.CallbackType.MethodCallback:e.WebView.ScriptMessaging.agaveHostCallback(r.callbackId,JSON.parse(r.params));break;case t.CallbackType.EventCallback:e.WebView.ScriptMessaging.agaveHostEventCallback(r.callbackId,JSON.parse(r.params))}}},n}();n.Poster=r}(e.WinRT||(e.WinRT={}))}(OSF||(OSF={})),function(e){!function(t){!function(t){var n=null;t.agaveHostCallback=function(e,t){n.agaveHostCallback(e,t)},t.agaveHostEventCallback=function(e,t){n.agaveHostEventCallback(e,t)},t.GetScriptMessenger=function(){if(null==n){var t=e._OfficeAppFactory.getHostInfo().hostPlatform;if(t===e.HostInfoPlatform.android)n=new i("OSF.ScriptMessaging.agaveHostCallback","OSF.ScriptMessaging.agaveHostEventCallback",e.Android.Poster.getInstance());else{if(t!==e.HostInfoPlatform.winrt)throw e.Utility.createNotImplementedException();n=new i("agaveHostCallback","agaveHostEventCallback",new e.WinRT.Poster)}}return n};var r=function(e,t,n){this.id=e,this.targetId=t,this.handler=n},i=function(){function e(t,n,r){this.callingIndex=0,this.callbackList={},this.eventHandlerList={},this.asyncMethodCallbackFunctionName=t,this.eventCallbackFunctionName=n,this.poster=r,this.conversationId=e.getCurrentTimeMS().toString()}return e.prototype.invokeMethod=function(e,t,n,r){this.postMessage({},e,t,n,r)},e.prototype.registerEvent=function(e,t,n,i,o,a){var s={eventCallbackFunction:this.eventCallbackFunctionName},c={id:n,targetId:i},l=this.postMessage(s,e,t,c,a);this.eventHandlerList[l]=new r(n,i,o)},e.prototype.unregisterEvent=function(e,t,n,r,i){var o={id:n,targetId:r};for(var a in this.eventHandlerList)if(this.eventHandlerList.hasOwnProperty(a)){var s=this.eventHandlerList[a];s.id==n&&s.targetId==r&&delete this.eventHandlerList[a]}this.invokeMethod(e,t,o,i)},e.prototype.agaveHostCallback=function(e,t){var n=this.callbackList[e];if(n){var r=n(t);void 0!==r&&!0!==r||delete this.callbackList[e]}},e.prototype.agaveHostEventCallback=function(e,t){var n=this.eventHandlerList[e];n&&n.handler(t)},e.prototype.postMessage=function(e,t,n,r,i){var o=this.generateCorrelationId();return this.callbackList[o]=i,e.methodId=n,e.params=r,e.callbackId=o,e.callbackFunction=this.asyncMethodCallbackFunctionName,this.poster.postMessage(t,JSON.stringify(e)),o},e.prototype.generateCorrelationId=function(){return++this.callingIndex,this.conversationId+this.callingIndex},e.getCurrentTimeMS=function(){return(new Date).getTime()},e.MESSAGE_TIME_DELTA=10,e}()}(t.ScriptMessaging||(t.ScriptMessaging={}))}(e.WebView||(e.WebView={}))}(OSF||(OSF={})),function(e){var t=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),n.prototype.messageParent=function(t){if(e.Utility.externalNativeFunctionExists(typeof window.external.MessageParent2))"undefined"!=typeof OsfOMToken&&OsfOMToken?window.external.MessageParent2(JSON.stringify(t),OsfOMToken):window.external.MessageParent2(JSON.stringify(t));else{var n=t[e.ParameterNames.MessageToParent];window.external.MessageParent(n)}},n.prototype.openDialog=function(e,t,n,r,i){this.registerEvent(e,t,n,r,i)},n.prototype.closeDialog=function(e,t,n,r){this.unregisterEvent(e,t,n,r)},n.prototype.sendMessage=function(t){if(e.Utility.externalNativeFunctionExists(typeof window.external.MessageChild2))"undefined"!=typeof OsfOMToken&&OsfOMToken?window.external.MessageChild2(JSON.stringify(t),OsfOMToken):window.external.MessageChild2(JSON.stringify(t));else{var n=t[e.ParameterNames.MessageContent];window.external.MessageChild(n)}},n.prototype.closeSdxDialog=function(t){e.Utility.externalNativeFunctionExists(typeof window.external.closeSdxDialog)&&window.external.closeSdxDialog(t)},n.prototype.resizeSdxDialog=function(t,n){e.Utility.externalNativeFunctionExists(typeof window.external.resizeSdxDialog)&&window.external.resizeSdxDialog(t,n)},n}(e.RichClientHostController);e.Win32RichClientHostController=t}(OSF||(OSF={})),function(e){var t=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),n.prototype.openDialog=function(t,r,i,o,a){if(!n.popup||n.popup.closed){window.dialogAPIErrorCode=void 0;var s=JSON.parse(i),c=s.url;if(c){var l=c.split("#"),d="?";l[0].indexOf("?")>-1&&(d="&");var u="width="+screen.width*s.width/100+", height="+screen.height*s.height/100;l[0]=l[0].concat(d).concat("action=displayDialog");var f=l.join("#");if(n.popup=window.open(f,"",u),n.DialogEventListener=function(r){if(r.source==n.popup)try{var i=JSON.parse(r.data);i.dialogMessage&&o(t,[0,i.dialogMessage.messageContent])}catch(t){e.Utility.trace("messages received cannot be handlered. Message:"+r.data)}},null!=n.popup&&null==window.dialogAPIErrorCode)window.addEventListener("message",n.DialogEventListener),n.interval=window.setInterval((function(){try{(null==n.popup||n.popup.closed)&&(window.clearInterval(n.interval),window.removeEventListener("message",n.DialogEventListener),n.NotifyError=null,o(t,[12006]))}catch(t){e.Utility.trace("Error happened when popup window closed.")}}),500),n.NotifyError=function(e){o(t,[e])},a(0);else{var p=5001;window.dialogAPIErrorCode&&(p=window.dialogAPIErrorCode),a(p)}}else a(12003)}else a(12007)},n.prototype.messageParent=function(t){var n={dialogMessage:{messageType:0,messageContent:t[e.ParameterNames.MessageToParent]}};window.opener.postMessage(JSON.stringify(n),window.location.origin)},n.prototype.closeDialog=function(e,t,r,i){n.popup?(n.interval&&window.clearInterval(n.interval),n.popup.close(),n.popup=null,window.removeEventListener("message",n.DialogEventListener),n.NotifyError=null,i(0)):i(5001)},n}(e.Webkit.WebkitHostController);e.MacRichClientHostController=t}(OSF||(OSF={})),function(e){var t;!function(e){!function(e){e.Init=function(){return function(){"use strict";function e(e){return"function"==typeof e}var t,n=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},r=0,i=function(e,n){f[r]=e,f[r+1]=n,2===(r+=2)&&(t?t(p):c())};var o=("undefined"!=typeof window?window:void 0)||{},a=(o.MutationObserver||o.WebKitMutationObserver,"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)),s="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;var c,l,d,u,f=new Array(1e3);function p(){for(var e=0;e<r;e+=2){(0,f[e])(f[e+1]),f[e]=void 0,f[e+1]=void 0}r=0}function m(){}a?(d=process.nextTick,u=process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/),Array.isArray(u)&&"0"===u[1]&&"10"===u[2]&&(d=setImmediate),c=function(){d(p)}):s?((l=new MessageChannel).port1.onmessage=p,c=function(){l.port2.postMessage(0)}):c=function(){setTimeout(p,1)};var g=void 0,h=new T;function y(t,n){if(n.constructor===t.constructor)!function(e,t){1===t._state?b(e,t._result):2===t._state?O(e,t._result):_(t,void 0,(function(t){v(e,t)}),(function(t){O(e,t)}))}(t,n);else{var r=function(e){try{return e.then}catch(e){return h.error=e,h}}(n);r===h?O(t,h.error):void 0===r?b(t,n):e(r)?function(e,t,n){i((function(e){var r=!1,i=function(e,t,n,r){try{e.call(t,n,r)}catch(e){return e}}(n,t,(function(n){r||(r=!0,t!==n?v(e,n):b(e,n))}),(function(t){r||(r=!0,O(e,t))}),e._label);!r&&i&&(r=!0,O(e,i))}),e)}(t,n,r):b(t,n)}}function v(e,t){var n;e===t?O(e,new TypeError("You cannot resolve a promise with itself")):"function"==typeof(n=t)||"object"==typeof n&&null!==n?y(e,t):b(e,t)}function S(e){e._onerror&&e._onerror(e._result),A(e)}function b(e,t){e._state===g&&(e._result=t,e._state=1,0!==e._subscribers.length&&i(A,e))}function O(e,t){e._state===g&&(e._state=2,e._result=t,i(S,e))}function _(e,t,n,r){var o=e._subscribers,a=o.length;e._onerror=null,o[a]=t,o[a+1]=n,o[a+2]=r,0===a&&e._state&&i(A,e)}function A(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r,i,o=e._result,a=0;a<t.length;a+=3)r=t[a],i=t[a+n],r?E(n,r,i,o):i(o);e._subscribers.length=0}}function T(){this.error=null}var C=new T;function E(t,n,r,i){var o,a,s,c,l=e(r);if(l){if((o=function(e,t){try{return e(t)}catch(e){return C.error=e,C}}(r,i))===C?(c=!0,a=o.error,o=null):s=!0,n===o)return void O(n,new TypeError("A promises callback cannot return that same promise."))}else o=i,s=!0;n._state!==g||(l&&s?v(n,o):c?O(n,a):1===t?b(n,o):2===t&&O(n,o))}function I(e,t){var n=this;n._instanceConstructor=e,n.promise=new e(m),n._validateInput(t)?(n._input=t,n.length=t.length,n._remaining=t.length,n._init(),0===n.length?b(n.promise,n._result):(n.length=n.length||0,n._enumerate(),0===n._remaining&&b(n.promise,n._result))):O(n.promise,n._validationError())}I.prototype._validateInput=function(e){return n(e)},I.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},I.prototype._init=function(){this._result=new Array(this.length)};var P=I;I.prototype._enumerate=function(){for(var e=this,t=e.length,n=e.promise,r=e._input,i=0;n._state===g&&i<t;i++)e._eachEntry(r[i],i)},I.prototype._eachEntry=function(e,t){var n,r=this,i=r._instanceConstructor;"object"==typeof(n=e)&&null!==n?e.constructor===i&&e._state!==g?(e._onerror=null,r._settledAt(e._state,t,e._result)):r._willSettleAt(i.resolve(e),t):(r._remaining--,r._result[t]=e)},I.prototype._settledAt=function(e,t,n){var r=this,i=r.promise;i._state===g&&(r._remaining--,2===e?O(i,n):r._result[t]=n),0===r._remaining&&b(i,r._result)},I.prototype._willSettleAt=function(e,t){var n=this;_(e,void 0,(function(e){n._settledAt(1,t,e)}),(function(e){n._settledAt(2,t,e)}))};var w=function(e){return new P(this,e).promise};var D=function(e){var t=new this(m);if(!n(e))return O(t,new TypeError("You must pass an array to race.")),t;var r=e.length;function i(e){v(t,e)}function o(e){O(t,e)}for(var a=0;t._state===g&&a<r;a++)_(this.resolve(e[a]),void 0,i,o);return t};var x=function(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(m);return v(t,e),t};var M=function(e){var t=new this(m);return O(t,e),t},N=0;var F=R;function R(t){this._id=N++,this._state=void 0,this._result=void 0,this._subscribers=[],m!==t&&(e(t)||function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof R||function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}(),function(e,t){try{t((function(t){v(e,t)}),(function(t){O(e,t)}))}catch(t){O(e,t)}}(this,t))}return R.all=w,R.race=D,R.resolve=x,R.reject=M,R._setScheduler=function(e){t=e},R._setAsap=function(e){i=e},R._asap=i,R.prototype={constructor:R,then:function(e,t){var n=this,r=n._state;if(1===r&&!e||2===r&&!t)return this;var o=new this.constructor(m),a=n._result;if(r){var s=arguments[r-1];i((function(){E(r,o,s,a)}))}else _(n,o,e,t);return o},catch:function(e){return this.then(null,e)}},F}.call(this)}}(e.PromiseImpl||(e.PromiseImpl={}))}(e._Internal||(e._Internal={})),function(e){e.OfficePromise=function(){if("undefined"==typeof window&&"function"==typeof Promise)return Promise;if("undefined"!=typeof window){if(window.Promise)return window.Promise;var t=e.PromiseImpl.Init();return window.Promise=t,t}}()}(t=e._Internal||(e._Internal={})),e.OfficePromise=t.OfficePromise,e.Promise=e.OfficePromise}(Office||(Office={})),function(e){e.getFields=function(e,t){var n=[];return void 0!==t.id&&n.push(oteljs.makeStringDataField(e+".Id",t.id)),void 0!==t.version&&n.push(oteljs.makeStringDataField(e+".Version",t.version)),void 0!==t.instanceId&&n.push(oteljs.makeStringDataField(e+".InstanceId",t.instanceId)),void 0!==t.name&&n.push(oteljs.makeStringDataField(e+".Name",t.name)),void 0!==t.marketplaceType&&n.push(oteljs.makeStringDataField(e+".MarketplaceType",t.marketplaceType)),void 0!==t.sessionId&&n.push(oteljs.makeStringDataField(e+".SessionId",t.sessionId)),void 0!==t.browserToken&&n.push(oteljs.makeStringDataField(e+".BrowserToken",t.browserToken)),void 0!==t.osfRuntimeVersion&&n.push(oteljs.makeStringDataField(e+".OsfRuntimeVersion",t.osfRuntimeVersion)),void 0!==t.officeJsVersion&&n.push(oteljs.makeStringDataField(e+".OfficeJsVersion",t.officeJsVersion)),void 0!==t.hostJsVersion&&n.push(oteljs.makeStringDataField(e+".HostJsVersion",t.hostJsVersion)),void 0!==t.assetId&&n.push(oteljs.makeStringDataField(e+".AssetId",t.assetId)),void 0!==t.providerName&&n.push(oteljs.makeStringDataField(e+".ProviderName",t.providerName)),void 0!==t.type&&n.push(oteljs.makeStringDataField(e+".Type",t.type)),void 0!==t.officeJSSource&&n.push(oteljs.makeInt64DataField(e+".OfficeJSSource",t.officeJSSource)),void 0!==t.isSecureDefaultsEnabled&&n.push(oteljs.makeBooleanDataField(e+".IsSecureDefaultsEnabled",t.isSecureDefaultsEnabled)),void 0!==t.hasAppSetIsSdx&&n.push(oteljs.makeBooleanDataField(e+".HasAppSetIsSdx",t.hasAppSetIsSdx)),n}}(SDX||(SDX={})),function(e){!function(t){var n,r=e.OUtil.Guid.generateNewGuid(),i=new RegExp("^https?://store\\.office(ppe|-int)?\\.com/","i"),o=!1,a="PRIVATE";t.enableTelemetry=!0;var s=function(){};t.AppInfo=s;var c=function(){function t(){this.clientIDKey="Office API client",this.logIdSetKey="Office App Log Id Set"}return t.prototype.getClientId=function(){var t=this.getValue(this.clientIDKey);return(!t||t.length<=0||t.length>40)&&(t=e.OUtil.Guid.generateNewGuid(),this.setValue(this.clientIDKey,t)),t},t.prototype.getValue=function(t){var n=e.OUtil.getLocalStorage(),r="";return n&&(r=n.getItem(t)),r},t.prototype.setValue=function(t,n){var r=e.OUtil.getLocalStorage();r&&r.setItem(t,n)},t}();function l(e){return e&&(e=e.replace(/[{}]/g,"").toLowerCase()),e||""}function d(e){try{return JSON.parse(e)}catch(t){return e}}function u(){n&&(o||OTel.OTelLogger.onTelemetryLoaded((function(){var t=[],r=n.isMos?1:0;t=t.concat([oteljs.makeStringDataField("Browser",n.browser),oteljs.makeInt64DataField("AppSizeWidth",window.innerWidth),oteljs.makeInt64DataField("AppSizeHeight",window.innerHeight),oteljs.makeInt64DataField("IsMOS",r)]),e.OUtil.isChangeGateEnabled("Microsoft.Office.SharedOnline.ChangeGate.OfficeVSO_10045620_CopilotAgentTelSettings")&&n.launchSource&&n.launchReason&&(t.push(oteljs.makeStringDataField("LaunchSource",n.launchSource)),t.push(oteljs.makeStringDataField("LaunchReason",n.launchReason))),Microsoft.Office.WebExtension.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.AppActivatedX",dataFields:t,eventFlags:{dataCategories:2,diagnosticLevel:110,samplingPolicy:191}})})))}function f(e,t){}function p(){var t=0!=(e._OfficeAppFactory.getHostInfo().flags&e.HostInfoFlags.PublicAddin);return t||!!n&&g(e._OfficeAppFactory.getHostInfo().hostPlatform,n.hostVersion)}function m(e,t){return p()||t!==e?t:a}function g(t,n){var r=!1,i=/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/.exec(n);if(i){var o=parseInt(i[1]),a=parseInt(i[2]),s=parseInt(i[3]);t==e.HostInfoPlatform.win32?(o<16||16==o&&s<14225)&&(r=!0):t==e.HostInfoPlatform.mac&&(o<16||16==o&&(a<52||52==a&&s<808))&&(r=!0)}return r}function h(){return 0!=(e._OfficeAppFactory.getHostInfo().flags&e.HostInfoFlags.IsMos)}t.initialize=function(u){if(t.enableTelemetry&&!n){n=new s,u.get_hostFullVersion()?n.hostVersion=u.get_hostFullVersion():n.hostVersion=u.get_appVersion(),n.appId=p()?u.get_id():a,n.marketplaceType=u._marketplaceType,n.host=""+u.get_appName(),n.browser=window.navigator.userAgent,n.correlationId=l(u.get_correlationId()),n.clientId=(new c).getClientId(),n.appInstanceId=u.get_appInstanceId(),n.appInstanceId&&(n.appInstanceId=l(n.appInstanceId),n.appInstanceId=m(u.get_id(),n.appInstanceId)),n.message=u.get_hostCustomMessage(),n.officeJSVersion=e.ConstantNames.FileVersion,n.hostJSVersion="NA",u._wacHostEnvironment&&(n.wacHostEnvironment=u._wacHostEnvironment);var f=u.get_isFromWacAutomation();null!=f&&(n.isFromWacAutomation=f.toString().toLowerCase()),n.officeJSSource=e.OUtil.getLibraryReleaseVehicle(),n.isSecureDefaultsEnabled="undefined"!=typeof isOsfSecurityDefaultsEnabled&&!0===isOsfSecurityDefaultsEnabled,n.hasAppSetIsSdx=e.LoadScriptHelper.isSdx();var g=u.get_docUrl();n.docUrl=i.test(g)?g:"";var y=location.href;if(y&&(n.isPreload=-1!==y.indexOf("preload=1"),y=y.split("?")[0].split("#")[0]),n.isMos=h(),e.OUtil.isChangeGateEnabled("Microsoft.Office.SharedOnline.ChangeGate.OfficeVSO_10045620_CopilotAgentTelSettings")){var v=u.get_settingsFunc()();v&&v.LaunchSource&&v.LaunchReason&&(n.launchSource=d(v.LaunchSource),n.launchReason=d(v.LaunchReason))}!function(t,n){n.assetId="",n.userId="";try{if(!e.Utility.isNullOrEmpty(t)){var r=decodeURIComponent(t),i=new DOMParser,o=void 0,a=e.LoadScriptHelper.getTrustedTypesOptIn();if((null!=a?a:e.OUtil.isSecureDefaultsEnabled())&&window.trustedTypes&&window.trustedTypes.createPolicy)o=window.trustedTypes.createPolicy("officejs-domparser",{createHTML:function(e){return e}}).createHTML(r);else o=r;var s=i.parseFromString(o,"text/xml"),c=s.getElementsByTagName("t")[0].attributes.getNamedItem("cid"),l=s.getElementsByTagName("t")[0].attributes.getNamedItem("oid");c&&c.nodeValue?n.userId=c.nodeValue:l&&l.nodeValue&&(n.userId=l.nodeValue),n.assetId=s.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue}}catch(e){}}(u.get_eToken(),n),n.sessionId=r,OTel.OTelLogger.initialize(n),n.isPreload?(o=!0,function(){try{Microsoft.Office.WebExtension.onReadyInternal().then((function(){var t=Office,n=OfficeCore;t.addin&&t.addin.onVisibilityModeChanged&&t.addin.onVisibilityModeChanged((function(n){n.visibilityMode===t.VisibilityMode.taskpane&&e.AppTelemetry.CallOnAppActivatedIfPending()})),t.addin&&t.addin._getState&&t.addin._getState().then((function(t){n.AppRuntimeState&&t===n.AppRuntimeState.visible&&e.AppTelemetry.CallOnAppActivatedIfPending()}))}))}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Exception happens at registerVisibilityEventOnPreload"+t)}}()):t.onAppActivated()}},t.onAppActivated=u,t.onScriptDone=function(e,t,n,r){},t.onCallDone=function(e,t,n,r,i){},t.onMethodDone=function(e,t,n,r){},t.onPropertyDone=function(t,n){e.AppTelemetry.onCallDone("property",-1,t,n,0)},t.onCheckWACHost=function(e,t,n,r,i){},t.onEventDone=function(t,n){e.AppTelemetry.onCallDone("event",t,null,0,n)},t.onRegisterDone=function(t,n,r,i){e.AppTelemetry.onCallDone(t?"registerevent":"unregisterevent",n,null,r,i)},t.onAppClosed=function(e,t){},t.setOsfControlAppCorrelationId=function(e){l(e)},t.doAppInitializationLogging=f,t.logAppCommonMessage=function(e){},t.logAppException=function(e){},t.CallOnAppActivatedIfPending=function(){o&&(o=!1,u())},t.canSendAddinId=p,t.getCompliantAppInstanceId=m,t._isComplianceExceptedHost=g,t.isMos=h}(e.AppTelemetry||(e.AppTelemetry={}))}(OSF||(OSF={})),function(e){var t=function(){function t(){}return t.loaded=function(){return!(void 0===t.logger)},t.ensureValue=function(e,t){return e||t},t.create=function(n){var r,i={id:n.appId,marketplaceType:n.marketplaceType,assetId:n.assetId,officeJsVersion:n.officeJSVersion,hostJsVersion:n.hostJSVersion,browserToken:n.clientId,instanceId:n.appInstanceId,sessionId:n.sessionId,officeJSSource:n.officeJSSource,isSecureDefaultsEnabled:n.isSecureDefaultsEnabled,hasAppSetIsSdx:n.hasAppSetIsSdx},o=SDX.getFields("SDX",i),a=OSF._OfficeAppFactory.getHostInfo().hostPlatform;if("web"===a)r=new e.SdxWacSink;else if(Office.context.requirements.isSetSupported("Telemetry","1.2"))r=new e.RichApiSink,this.richApiSink=r;else{if(!oteljs.AgaveSink)return console.error("Cannot create telemetry sink successfully"),null;var s={"App.Name":OSF._OfficeAppFactory.getHostInfo().hostType,"App.Platform":a,"App.Version":n.hostVersion,"Session.Id":t.ensureValue(n.correlationId,"00000000-0000-0000-0000-000000000000")};r=oteljs.AgaveSink.createInstance(s)}var c=new oteljs.SimpleTelemetryLogger(void 0,o);return c.addSink(r),c.setTenantToken("Office.Extensibility.OfficeJs","db334b301e7b474db5e0f02f07c51a47-a1b5bc36-1bbe-482f-a64a-c2d9cb606706-7439",1755),oteljs.onNotification().addListener((function(e){OSF.Utility.debugLog(e.message())})),c},t.checkAndResolvePromises=function(){t.loaded()&&(t.promises.forEach((function(e){e()})),t.promises=[])},t.initialize=function(e){t.Enabled?Office.onReadyInternal().then((function(){t.loaded()||(OSF.Utility.debugLog("Creating OTelLogger"),t.logger=t.create(e),t.checkAndResolvePromises())})):t.promises=[]},t.sendTelemetryEvent=function(e){t.onTelemetryLoaded((function(){try{t.logger.sendTelemetryEvent(e)}catch(e){console.error("Cannot send telemetry event: "+JSON.stringify(e))}}))},t.sendNonStandardEvent=function(e,n){t.onTelemetryLoaded((function(){try{t.logger.sendNonStandardEvent(e,n)}catch(e){console.error("Cannot send telemetry event: "+JSON.stringify(e))}}))},t.flushTelemetryQueue=function(){var e=this;return new Office.Promise((function(n){t.onTelemetryLoaded((function(){e.richApiSink?e.richApiSink.flushTelemetryQueue().then((function(){n()})):n()}))}))},t.onTelemetryLoaded=function(e){t.Enabled&&(t.loaded()?e():t.promises.push(e))},t.promises=[],t.Enabled=!0,t}();e.OTelLogger=t}(OTel||(OTel={})),function(e){var t=262144,n='{"version":1,"events":[',r="Microsoft.Office.SharedOnline.ChangeGate.OfficeVSO_11435062_TelemetryBatching",i="Office.Extensibility.OfficeJs.TelemetryStartupPerf",o=function(){function o(){var e=this;this._requestIsPending=!0,this._telemetryQueue=[],this._batchingDisabledForSession=!1,this._telemetryStartupPerfWindowEndMs=0,this._telemetryStartupPerfActiveMs=0,this._telemetryStartupPerfEventCount=0,this._telemetryStartupPerfDrainCount=0,this._telemetryStartupPerfMaxQueueDepth=0,this._telemetryStartupPerfEmitted=!1,this._telemetryStartupPerfFallbackOccurred=!1,this._telemetryStartupPerfUseDateNow=!1;var t=OSFPerformance.now();this._telemetryStartupPerfUseDateNow=t<=0,this._telemetryStartupPerfWindowEndMs=(this._telemetryStartupPerfUseDateNow?Date.now():t)+15e3,setTimeout((function(){return e.emitTelemetryStartupPerf()}),15e3),this.pause(1e3).then((function(){var t=e._telemetryQueue;e._telemetryQueue=[],e._requestIsPending=!1,e.processTelemetryEvents(t)}))}return o.prototype.sendTelemetryEvent=function(e){this._telemetryQueue.push([e,1]),this.recordTelemetryStartupPerfQueueDepth(e),this._requestIsPending||this.processWorkBacklog()},o.prototype.sendNonStandardEvent=function(e,t){this._telemetryQueue.push([e,t]),this.recordTelemetryStartupPerfQueueDepth(e),this._requestIsPending||this.processWorkBacklog()},o.prototype.flushTelemetryQueue=function(){var e=this;return new Office.Promise((function(t){var n=e._telemetryQueue;e._telemetryQueue=[],e.processTelemetryEvents(n).then((function(){t()}))}))},o.prototype.processWorkBacklog=function(){var e=this;this._requestIsPending=!0;var t=this._telemetryQueue;this._telemetryQueue=[],this.processTelemetryEvents(t).then(this.waitAndProcessMore.bind(this)).catch((function(t){oteljs.logError(1,"RichApiSink Error",t),e.waitAndProcessMore.bind(e)()}))},o.prototype.waitAndProcessMore=function(){var e=this;this.pause(1e3).then((function(){e._telemetryQueue.length>0&&setTimeout((function(){return e.processWorkBacklog()}),0),e._requestIsPending=!1})).catch((function(){}))},o.prototype.processTelemetryEvents=function(e){var t=this,n=this._processingPromise||this.createResolvedPromise();return this._processingPromise=n.then((function(){return t.processTelemetryEventsMeasured(e)})).catch((function(e){oteljs.logError(1,"RichApiSink Error",e)})),this._processingPromise},o.prototype.processTelemetryEventsMeasured=function(e){var t,n=this,r=this.startTelemetryStartupPerfDrain(e);try{t=this.processTelemetryEventsInternal(e)}catch(e){throw this.completeTelemetryStartupPerfDrain(r),e}return void 0===r?t:t.then((function(){return n.completeTelemetryStartupPerfDrain(r)}),(function(e){throw n.completeTelemetryStartupPerfDrain(r),e}))},o.prototype.processTelemetryEventsInternal=function(e){if(this.shouldProcessTelemetryEventsBatched())try{return this.processTelemetryEventsBatched(e)}catch(e){this._batchingDisabledForSession=!0,this.markTelemetryStartupPerfFallback()}return this.processTelemetryEventsUnbatched(e)},o.prototype.shouldProcessTelemetryEventsBatched=function(){return!(!OSF.OUtil.isChangeGateEnabled(r)||this._batchingDisabledForSession)&&this.isBatchingCapabilityAvailable()},o.prototype.isBatchingCapabilityAvailable=function(){try{var e=OfficeCore.TelemetryService;return!!(Office&&Office.context&&Office.context.requirements&&Office.context.requirements.isSetSupported("Telemetry","1.5")&&e&&e.prototype&&"function"==typeof e.prototype.sendTelemetryEventBatch)}catch(e){return!1}},o.prototype.processTelemetryEventsUnbatched=function(e){var t=this;try{var n=new OfficeCore.RequestContext;return e.forEach((function(e){var r=e[0],i=e[1];r.telemetryProperties&&t.queueTelemetryEventUnbatched(n,r,i)})),n.sync().catch((function(){oteljs.logNotification(2,1,(function(){return"RichApi telemetry call failed."}))}))}catch(e){return oteljs.logNotification(2,1,(function(){return"RichApi telemetry call failed."})),this.createResolvedPromise()}},o.prototype.queueTelemetryEventUnbatched=function(e,t,n){var r=[];this.addDataFields(r,t.dataFields);var i=t.eventContract?t.eventContract.name:"";t.eventContract&&this.addDataFields(r,t.eventContract.dataFields),1===n?e.telemetry.sendTelemetryEvent(t.telemetryProperties,t.eventName,i,oteljs.getEffectiveEventFlags(t),r):e.telemetry.sendNonStandardEvent(t.telemetryProperties,t.eventName,i,oteljs.getEffectiveEventFlags(t),r,n)},o.prototype.processTelemetryEventsBatched=function(e){var r=this,i=[],o=[],a=[],s=0,c=function(){0!==a.length&&(i.push({payload:n+a.join(",")+"]}",events:o}),o=[],a=[],s=0)};e.forEach((function(e){var n=e[0],l=e[1];if(n.telemetryProperties){var d=JSON.stringify(r.createBatchEvent(n,l));if(r.getBatchPayloadLength(1,d.length)>t)return r.markTelemetryStartupPerfFallback(),c(),void i.push({events:[e]});r.shouldStartNewBatch(a.length,s,d.length)&&c(),o.push(e),a.push(d),s+=d.length}})),c();var l=this.createResolvedPromise();return i.forEach((function(e){l=l.then((function(){if(void 0===e.payload||r._batchingDisabledForSession)return r.processTelemetryEventsUnbatched(e.events);try{return r.sendJsonTelemetryBatchChunk(e.payload,e.events)}catch(t){return r._batchingDisabledForSession=!0,r.markTelemetryStartupPerfFallback(),r.processTelemetryEventsUnbatched(e.events)}}))})),l},o.prototype.shouldStartNewBatch=function(e,n,r){return 0!==e&&(e>=1e3||this.getBatchPayloadLength(e+1,n+r)>t)},o.prototype.getBatchPayloadLength=function(e,t){var r=Math.max(0,e-1);return n.length+t+r+"]}".length},o.prototype.sendJsonTelemetryBatchChunk=function(e,t){var n=this;try{var r=new OfficeCore.RequestContext;return r.telemetry.sendTelemetryEventBatch(e),r.sync().catch((function(){return n._batchingDisabledForSession=!0,n.markTelemetryStartupPerfFallback(),oteljs.logNotification(2,1,(function(){return"RichApi telemetry batch call failed; falling back to per-event telemetry."})),n.processTelemetryEventsUnbatched(t)}))}catch(e){return this._batchingDisabledForSession=!0,this.markTelemetryStartupPerfFallback(),oteljs.logNotification(2,1,(function(){return"RichApi telemetry batch call failed; falling back to per-event telemetry."})),this.processTelemetryEventsUnbatched(t)}},o.prototype.startTelemetryStartupPerfDrain=function(e){if(!this._telemetryStartupPerfEmitted&&e&&0!==e.length){var t=this.getTimestampMilliseconds();if(!(t>=this._telemetryStartupPerfWindowEndMs)){var n=0;if(e.forEach((function(e){var t=e[0];t&&t.eventName!==i&&t.telemetryProperties&&n++})),0!==n)return this._telemetryStartupPerfActiveDrainStartMs=t,this._telemetryStartupPerfEventCount+=n,this._telemetryStartupPerfDrainCount++,t}}},o.prototype.completeTelemetryStartupPerfDrain=function(e){if(void 0!==e){var t=this.getTimestampMilliseconds();if(!this._telemetryStartupPerfEmitted){var n=Math.min(t,this._telemetryStartupPerfWindowEndMs);this._telemetryStartupPerfActiveMs+=Math.max(0,n-e)}this._telemetryStartupPerfActiveDrainStartMs=void 0,!this._telemetryStartupPerfEmitted&&t>=this._telemetryStartupPerfWindowEndMs&&this.emitTelemetryStartupPerf()}},o.prototype.emitTelemetryStartupPerf=function(){this._telemetryStartupPerfEmitted||void 0===this._telemetryStartupPerfActiveDrainStartMs&&(this._telemetryStartupPerfEmitted=!0,e.OTelLogger.sendTelemetryEvent({eventName:i,dataFields:[oteljs.makeDoubleDataField("StartupTelemetryDrainActiveMs",this._telemetryStartupPerfActiveMs),oteljs.makeStringDataField("AssignedTreatment",OSF.OUtil.isChangeGateEnabled(r)?"JsonStringBatch":"PerEvent"),oteljs.makeBooleanDataField("BatchingCapabilityAvailable",this.isBatchingCapabilityAvailable()),oteljs.makeBooleanDataField("FallbackOccurred",this._telemetryStartupPerfFallbackOccurred),oteljs.makeInt64DataField("MeasuredEventCount",this._telemetryStartupPerfEventCount),oteljs.makeInt64DataField("MeasuredDrainCount",this._telemetryStartupPerfDrainCount),oteljs.makeInt64DataField("MaxQueueDepth",this._telemetryStartupPerfMaxQueueDepth)],eventFlags:{dataCategories:6,diagnosticLevel:110,samplingPolicy:1}}))},o.prototype.recordTelemetryStartupPerfQueueDepth=function(e){this._telemetryStartupPerfEmitted||!e||e.eventName===i||this.getTimestampMilliseconds()>=this._telemetryStartupPerfWindowEndMs||(this._telemetryStartupPerfMaxQueueDepth=Math.max(this._telemetryStartupPerfMaxQueueDepth,this._telemetryQueue.length))},o.prototype.markTelemetryStartupPerfFallback=function(){!this._telemetryStartupPerfEmitted&&(void 0!==this._telemetryStartupPerfActiveDrainStartMs||this.getTimestampMilliseconds()<this._telemetryStartupPerfWindowEndMs)&&(this._telemetryStartupPerfFallbackOccurred=!0)},o.prototype.getTimestampMilliseconds=function(){return this._telemetryStartupPerfUseDateNow?Date.now():OSFPerformance.now()},o.prototype.createBatchEvent=function(e,t){var n=e.telemetryProperties,r=oteljs.getEffectiveEventFlags(e);return{eventName:e.eventName||"",eventType:this.numberOrDefault(t,0),telemetryProperties:{nexusTenantToken:this.numberOrDefault(n.nexusTenantToken,0),ariaTenantToken:n.ariaTenantToken||"",customerContentVersion:this.numberOrDefault(n.customerContentVersion,0),customerContentType:this.numberOrDefault(n.customerContentType,0),dnmInterval:this.numberOrDefault(n.dnmInterval,1)},eventFlags:{samplingPolicy:this.numberOrDefault(r.samplingPolicy,0),costPriority:this.numberOrDefault(r.costPriority,0),persistencePriority:this.numberOrDefault(r.persistencePriority,0),dataCategories:this.numberOrDefault(r.dataCategories,0),diagnosticLevel:this.numberOrDefault(r.diagnosticLevel,0)},dataFields:this.createBatchDataFields(e.dataFields),eventContract:{name:e.eventContract?e.eventContract.name:"",dataFields:this.createBatchDataFields(e.eventContract?e.eventContract.dataFields:void 0)}}},o.prototype.createBatchDataFields=function(e){var t=this,n=[];return e&&e.forEach((function(e){void 0!==e.value&&n.push(t.createBatchDataField(e))})),n},o.prototype.createBatchDataField=function(e){var t=e.classification?e.classification:4;return{name:e.name||"",dataType:this.dataFieldTypeToBatchNumber(this.getNativeCompatibleDataFieldType(e.dataType)),value:this.normalizeBatchDataFieldValue(e.value),dataClassification:t}},o.prototype.normalizeBatchDataFieldValue=function(e){return"number"==typeof e?isFinite(e)?e:String(e):"string"==typeof e||"boolean"==typeof e?e:String(e)},o.prototype.dataFieldTypeToBatchNumber=function(e){if("number"==typeof e)return e;switch(e){case"String":return 0;case"Boolean":return 1;case"Int64":return 2;case"Double":return 3;case"Guid":return 4;default:return-1}},o.prototype.numberOrDefault=function(e,t){return"number"==typeof e&&isFinite(e)?e:t},o.prototype.getNativeCompatibleDataFieldType=function(e){return 4!==e&&"Guid"!==e||!OSF.OUtil.isChangeGateEnabled("Microsoft.Office.SharedOnline.ChangeGate.OfficeJsRichApiGuidFieldsAsString")?e:0},o.prototype.addDataFields=function(e,t){var n=this;t&&t.forEach((function(t){e.push({name:t.name,value:t.value,classification:t.classification?t.classification:4,type:n.getNativeCompatibleDataFieldType(t.dataType)})}))},o.prototype.pause=function(e){return new Office.Promise((function(t){return setTimeout(t,e)}))},o.prototype.createResolvedPromise=function(){return new Office.Promise((function(e){return e()}))},o}();e.RichApiSink=o}(OTel||(OTel={})),function(e){var t=function(){function e(){}return e.prototype.sendTelemetryEvent=function(e,t){try{if(e.dataFields&&e.dataFields.filter((function(e){var t=e.classification;return t&&4!==t&&1!==t})).length>0)return;var n=OSF._OfficeAppFactory.getId(),r=OSF.AgaveHostAction.SendTelemetryEvent;OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[n,r,e])}catch(e){oteljs.logError(1,"AgaveWacSink",e)}},e.prototype.sendNonStandardEvent=function(e,t){try{if(1===t)throw new Error("Please call sendTelemetryEvent for events of type "+t);if(e.dataFields&&e.dataFields.filter((function(e){var t=e.classification;return t&&4!==t&&1!==t&&32!==t&&2048!==t})).length>0)return;var n=OSF._OfficeAppFactory.getId(),r=OSF.AgaveHostAction.SendNonStandardEvent;OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[n,r,e])}catch(e){oteljs.logError(1,"AgaveWacSink",e)}},e}();e.SdxWacSink=t}(OTel||(OTel={})),function(e){var t,n=[];function r(e,t,n){OTel.OTelLogger.onTelemetryLoaded((function(){Microsoft.Office.WebExtension.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.AddinSpecialPermissionRequest",dataFields:[oteljs.makeStringDataField("invocationId",e),oteljs.makeStringDataField("methodPath",t),oteljs.makeStringDataField("params",n)],eventFlags:{dataCategories:2,diagnosticLevel:110}})}))}function i(e,t,n){OTel.OTelLogger.onTelemetryLoaded((function(){Microsoft.Office.WebExtension.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.AddinSpecialPermissionResponse",dataFields:[oteljs.makeStringDataField("invocationId",e),oteljs.makeBooleanDataField("isSuccessful",t),oteljs.makeStringDataField("error",n?JSON.stringify({name:n.name,code:n.code,message:n.message}):void 0)],eventFlags:{dataCategories:2,diagnosticLevel:110}})}))}try{for(var o=0,a=function(e){var t=Navigator.prototype[e];t&&(Navigator.prototype[e]=function(n,a,s){if(3===arguments.length&&Function.prototype.isPrototypeOf(a)&&Function.prototype.isPrototypeOf(s)){var c=(o++).toString();return r(c,"Navigator.prototype."+e,JSON.stringify([{audio:!!n.audio,video:!!n.video}])),t.apply(this,[n,function(){return i(c,!0),a.apply(this,arguments)},function(){return i(c,!1,arguments[0]),s.apply(this,arguments)}])}return t.apply(this,arguments)},n.push("Navigator.prototype."+e))},s=0,c=["getUserMedia","webkitGetUserMedia","mozGetUserMedia"];s<c.length;s++){a(c[s])}var l=MediaDevices.prototype.getUserMedia;l&&(MediaDevices.prototype.getUserMedia=function(e){var t=(o++).toString();return 1===arguments.length&&void 0!==e?(r(t,"MediaDevices.prototype.getUserMedia",JSON.stringify([{audio:!!e.audio,video:!!e.video}])),l.apply(this,arguments).then((function(){return i(t,!0),arguments[0]}),(function(){throw i(t,!1,arguments[0]),arguments[0]}))):l.apply(this,arguments)},n.push("MediaDevices.prototype.getUserMedia"));for(var d=function(e){var t=Geolocation.prototype[e];t&&(Geolocation.prototype[e]=function(n,a,s){for(var c=[],l=3;l<arguments.length;l++)c[l-3]=arguments[l];var d=(o++).toString(),u=!1;r(d,"Geolocation.prototype."+e,JSON.stringify([]));var f=Function.prototype.isPrototypeOf(n)?function(){return u||(i(d,!0),u=!0),n.apply(this,arguments)}:n,p=Function.prototype.isPrototypeOf(a)?function(){return u||(i(d,!1,arguments[0]),u=!0),a.apply(this,arguments)}:a;return t.apply(this,[f,p,s].concat(c))},n.push("Geolocation.prototype."+e))},u=0,f=["getCurrentPosition","watchPosition"];u<f.length;u++){d(f[u])}}catch(e){t=e.toString()}OTel.OTelLogger.onTelemetryLoaded((function(){Microsoft.Office.WebExtension.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.AddinSpecialPermissionHookInstall",dataFields:[oteljs.makeStringDataField("hooksInstalled",JSON.stringify(n)),oteljs.makeStringDataField("error",t)],eventFlags:{dataCategories:2,diagnosticLevel:110}})}))}(Office||(Office={})),function(e){!function(e){!function(e){e.FeatureGates={},e.EventType=OSF.EventType,e.sendTelemetryEvent=function(e){OTel.OTelLogger.sendTelemetryEvent(e)},e.sendNonStandardEvent=function(e,t){OTel.OTelLogger.sendNonStandardEvent(e,t)},e.flushTelemetryQueue=function(){return OTel.OTelLogger.flushTelemetryQueue()},e.telemetrySink=OTel.OTelLogger}(e.WebExtension||(e.WebExtension={}))}(e.Office||(e.Office={}))}(Microsoft||(Microsoft={})),function(e){e.sendTelemetryEvent=function(e){Microsoft.Office.WebExtension.sendTelemetryEvent(e)},e.sendNonStandardEvent=function(e,t){Microsoft.Office.WebExtension.sendNonStandardEvent(e,t)},e.flushTelemetryQueue=function(){return Microsoft.Office.WebExtension.flushTelemetryQueue()},e.telemetrySink=Microsoft.Office.WebExtension.telemetrySink,e.isTrustedHost=function(){return __awaiter(this,void 0,void 0,(function(){var t,n,r,i,o;return __generator(this,(function(a){switch(a.label){case 0:return a.trys.push([0,10,,11]),OSF._OfficeAppFactory.getHostInfo().hostPlatform===OSF.HostInfoPlatform.web?[3,2]:[4,e.onReady()];case 1:return a.sent(),[2,!0];case 2:return null!=(t=OSF._OfficeAppFactory.getWebAppState().clientEndPoint)&&t.fHostTrusted?[2,!0]:null==document.referrer?[3,6]:(n=OSF.OUtil.parseUrl(document.referrer,!1),r="https:"==n.protocol,i=!1,OSF.OUtil.isChangeGateEnabled("Microsoft.Office.SharedOnline.ChangeGate.OfficeVSO_10910853_OfficeJsNPMDownloadTrustedDomainList")?[4,OSF.XdmCommunicationManager.isHostNameValidWacDomainAsync(n.hostname,null)]:[3,4]);case 3:return i=a.sent(),[3,5];case 4:i=OSF.XdmCommunicationManager.isHostNameValidWacDomain(n.hostname),a.label=5;case 5:if(r&&i&&!new RegExp("^"+document.domain.replace(new RegExp("\\.","g"),"\\.")+"$").test(n.hostname))return[2,!0];a.label=6;case 6:return null==t?[3,8]:[4,OSF.Utility.promisify((function(e){t.invoke("ContextActivationManager_getAppContextAsync",e,OSF._OfficeAppFactory.getWebAppState().id)}),1e4)];case 7:return a.sent(),[2,!0];case 8:return[2,!1];case 9:return[3,11];case 10:return o=a.sent(),OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Exception happens at Office.isTrustedHost."+o),[2,!1];case 11:return[2]}}))}))},Microsoft.Office.WebExtension.onReadyInternal=e.onReadyInternal}(Office||(Office={}));var OfficeExtension,Microsoft;__extends=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(e){var t;!function(e){e.graph="graph",e.wfe="wfe"}(t=e.RemoteEndpointType||(e.RemoteEndpointType={})),function(e){e[e.None=0]="None",e[e.Create=1]="Create",e[e.Edit=2]="Edit"}(e.MarkOfAi||(e.MarkOfAi={}));var n=function(){function e(){}return e.prototype._resolveRequestUrlAndHeaderInfo=function(){return d._createPromiseFromResult(null)},e.prototype._createRequestExecutorOrNull=function(){return null},e.prototype.getEventRegistration=function(e){return null},e}();e.SessionBase=n;var r=function(){function e(){}return e.setCustomSendRequestFunc=function(t){e.s_customSendRequestFunc=t},e.xhrSendRequestFunc=function(e){return d.createPromise((function(t,n){var r=new XMLHttpRequest;if(r.open(e.method,e.url),r.onload=function(){var e={statusCode:r.status,headers:d._parseHttpResponseHeaders(r.getAllResponseHeaders()),body:r.responseText};t(e)},r.onerror=function(){n(new i.RuntimeError({code:a.connectionFailure,httpStatusCode:r.status,message:d._getResourceString(s.connectionFailureWithStatus,r.statusText)}))},e.headers)for(var o in e.headers)r.setRequestHeader(o,e.headers[o]);r.send(d._getRequestBodyText(e))}))},e.fetchSendRequestFunc=function(e){var t=d._getRequestBodyText(e);return""===t&&(t=void 0),fetch(e.url,{method:e.method,headers:e.headers,body:t}).then((function(e){return e.text().then((function(t){var n=e.status,r={};return e.headers.forEach((function(e,t){r[t]=e})),{statusCode:n,headers:r,body:t}}))}))},e.sendRequest=function(t){e.validateAndNormalizeRequest(t);var n=e.s_customSendRequestFunc;return n||(n="undefined"!=typeof fetch?e.fetchSendRequestFunc:e.xhrSendRequestFunc),n(t)},e.setCustomSendLocalDocumentRequestFunc=function(t){e.s_customSendLocalDocumentRequestFunc=t},e.sendLocalDocumentRequest=function(t){return e.validateAndNormalizeRequest(t),(e.s_customSendLocalDocumentRequestFunc||e.officeJsSendLocalDocumentRequestFunc)(t)},e.officeJsSendLocalDocumentRequestFunc=function(e){e=d._validateLocalDocumentRequest(e);var t=d._buildRequestMessageSafeArray(e);return d.createPromise((function(e,n){OSF.DDA.RichApi.executeRichApiRequestAsync(t,(function(t){var n;n="succeeded"==t.status?{statusCode:l.getResponseStatusCode(t),headers:l.getResponseHeaders(t),body:l.getResponseBody(t)}:l.buildHttpResponseFromOfficeJsError(t.error.code,t.error.message),d.log("Response:"),d.log(JSON.stringify(n)),e(n)}))}))},e.validateAndNormalizeRequest=function(e){if(d.isNullOrUndefined(e))throw i.RuntimeError._createInvalidArgError({argumentName:"request"});d.isNullOrEmptyString(e.method)&&(e.method="GET"),e.method=e.method.toUpperCase();var t=!1;if("object"==typeof e.headers&&e.headers[c.testRequestNameHeader]&&(t=!0),!t){var n=u._getCurrentTestNameWithSequenceId();n&&(e.headers||(e.headers={}),e.headers[c.testRequestNameHeader]=n)}},e.logRequest=function(t){if(d._logEnabled){if(d.log("---HTTP Request---"),d.log(t.method+" "+t.url),t.headers)for(var n in t.headers)d.log(n+": "+t.headers[n]);e._logBodyEnabled&&d.log(d._getRequestBodyText(t))}},e.logResponse=function(t){if(d._logEnabled){if(d.log("---HTTP Response---"),d.log(""+t.statusCode),t.headers)for(var n in t.headers)d.log(n+": "+t.headers[n]);e._logBodyEnabled&&d.log(t.body)}},e._logBodyEnabled=!1,e}();e.HttpUtility=r;var i,o=function(){function e(e){var t=this;this.m_bridge=e,this.m_promiseResolver={},this.m_handlers=[],this.m_bridge.onMessageFromHost=function(e){var n=JSON.parse(e);if(3==n.type){var r=n.message;if(r&&r.entries)for(var i=0;i<r.entries.length;i++){var o=r.entries[i];if(Array.isArray(o)){var a={messageCategory:o[0],messageType:o[1],targetId:o[2],message:o[3],id:o[4]};r.entries[i]=a}}}t.dispatchMessage(n)}}return e.init=function(t){if("object"==typeof t&&t){var n=new e(t);e.s_instance=n,r.setCustomSendLocalDocumentRequestFunc((function(t){t=d._validateLocalDocumentRequest(t);var r=0;d.isReadonlyRestRequest(t.method)||(r=1);var i=t.url.indexOf("?");if(i>=0){var o=t.url.substr(i+1),a=d._parseRequestFlagsAndCustomDataFromQueryStringIfAny(o);a.flags>=0&&(r=a.flags)}"string"==typeof t.body&&(t.body=JSON.parse(t.body));var s={id:e.nextId(),type:1,flags:r,message:t};return n.sendMessageToHostAndExpectResponse(s).then((function(e){return e.message}))}));for(var i=0;i<e.s_onInitedHandlers.length;i++)e.s_onInitedHandlers[i](n)}},Object.defineProperty(e,"instance",{get:function(){return e.s_instance},enumerable:!0,configurable:!0}),e.prototype.sendMessageToHost=function(e){this.m_bridge.sendMessageToHost(JSON.stringify(e))},e.prototype.sendMessageToHostAndExpectResponse=function(e){var t=this,n=d.createPromise((function(n,r){t.m_promiseResolver[e.id]=n}));return this.m_bridge.sendMessageToHost(JSON.stringify(e)),n},e.prototype.addHostMessageHandler=function(e){this.m_handlers.push(e)},e.prototype.removeHostMessageHandler=function(e){var t=this.m_handlers.indexOf(e);t>=0&&this.m_handlers.splice(t,1)},e.onInited=function(t){e.s_onInitedHandlers.push(t),e.s_instance&&t(e.s_instance)},e.prototype.dispatchMessage=function(e){if("number"==typeof e.id){var t=this.m_promiseResolver[e.id];if(t)return t(e),void delete this.m_promiseResolver[e.id]}for(var n=0;n<this.m_handlers.length;n++)this.m_handlers[n](e)},e.nextId=function(){return e.s_nextId++},e.s_onInitedHandlers=[],e.s_nextId=1,e}();e.HostBridge=o,"object"==typeof _richApiNativeBridge&&_richApiNativeBridge&&o.init(_richApiNativeBridge),function(e){var t=function(t){function n(e){var r=t.call(this,"string"==typeof e?e:e.message)||this;if(Object.setPrototypeOf(r,n.prototype),r.name="RichApi.Error","string"==typeof e?r.message=e:(r.code=e.code,r.message=e.message,r.traceMessages=e.traceMessages||[],r.innerError=e.innerError||null,r.debugInfo=r._createDebugInfo(e.debugInfo||{}),r.httpStatusCode=e.httpStatusCode,r.data=e.data),d.isNullOrUndefined(r.httpStatusCode)||200===r.httpStatusCode){var i={};i[a.accessDenied]=401,i[a.connectionFailure]=500,i[a.generalException]=500,i[a.invalidArgument]=400,i[a.invalidObjectPath]=400,i[a.invalidOrTimedOutSession]=408,i[a.invalidRequestContext]=400,i[a.timeout]=408,i[a.valueNotLoaded]=400,r.httpStatusCode=i[r.code]}return d.isNullOrUndefined(r.httpStatusCode)&&(r.httpStatusCode=500),r}return __extends(n,t),n.prototype.toString=function(){return this.code+": "+this.message},n.prototype._createDebugInfo=function(t){var n={code:this.code,message:this.message,toString:function(){return JSON.stringify(this)}};for(var r in t)n[r]=t[r];return this.innerError&&(this.innerError instanceof e.RuntimeError?n.innerError=this.innerError.debugInfo:n.innerError=this.innerError),n},n._createInvalidArgError=function(t){return new e.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:d.isNullOrEmptyString(t.argumentName)?d._getResourceString(s.invalidArgumentGeneric):d._getResourceString(s.invalidArgument,t.argumentName),debugInfo:t.errorLocation?{errorLocation:t.errorLocation}:{},innerError:t.innerError})},n}(Error);e.RuntimeError=t}(i=e._Internal||(e._Internal={})),e.Error=i.RuntimeError;var a=function(){function e(){}return e.apiNotFound="ApiNotFound",e.accessDenied="AccessDenied",e.generalException="GeneralException",e.activityLimitReached="ActivityLimitReached",e.invalidArgument="InvalidArgument",e.connectionFailure="ConnectionFailure",e.timeout="Timeout",e.invalidOrTimedOutSession="InvalidOrTimedOutSession",e.invalidObjectPath="InvalidObjectPath",e.invalidRequestContext="InvalidRequestContext",e.valueNotLoaded="ValueNotLoaded",e.requestPayloadSizeLimitExceeded="RequestPayloadSizeLimitExceeded",e.responsePayloadSizeLimitExceeded="ResponsePayloadSizeLimitExceeded",e.writeNotSupportedWhenModalDialogOpen="WriteNotSupportedWhenModalDialogOpen",e.undoNotSupported="UndoNotSupported",e}();e.CoreErrorCodes=a;var s=function(){function e(){}return e.apiNotFoundDetails="ApiNotFoundDetails",e.connectionFailureWithStatus="ConnectionFailureWithStatus",e.connectionFailureWithDetails="ConnectionFailureWithDetails",e.invalidArgument="InvalidArgument",e.invalidArgumentGeneric="InvalidArgumentGeneric",e.timeout="Timeout",e.invalidOrTimedOutSessionMessage="InvalidOrTimedOutSessionMessage",e.invalidSheetName="InvalidSheetName",e.invalidObjectPath="InvalidObjectPath",e.invalidRequestContext="InvalidRequestContext",e.valueNotLoaded="ValueNotLoaded",e}();e.CoreResourceStrings=s;var c=function(){function e(){}return e.flags="flags",e.sourceLibHeader="SdkVersion",e.processQuery="ProcessQuery",e.localDocument="http://document.localhost/",e.localDocumentApiPrefix="http://document.localhost/_api/",e.customData="customdata",e.testRequestNameHeader="x-test-request-name",e.maxAdditionalDataLength=4096,e}();e.CoreConstants=c;var l=function(){function t(){}return t.buildMessageArrayForIRequestExecutor=function(e,n,r,i,o,a){var s=JSON.stringify(r.Body);d.log("Request:"),d.log(s);var l={};return d._copyHeaders(r.Headers,l),l[c.sourceLibHeader]=i,t.buildRequestMessageSafeArray(e,n,"POST",c.processQuery,l,s,o,a)},t.buildResponseOnSuccess=function(e,t){var n={HttpStatusCode:200,ErrorCode:"",ErrorMessage:"",Headers:null,Body:null};return n.Body=JSON.parse(e),n.Headers=t,n},t.buildResponseOnError=function(e,n){var r={HttpStatusCode:500,ErrorCode:"",ErrorMessage:"",Headers:null,Body:null};return r.ErrorCode=a.generalException,r.ErrorMessage=n,e==t.OfficeJsErrorCode_ooeNoCapability?(r.ErrorCode=a.accessDenied,r.HttpStatusCode=401):e==t.OfficeJsErrorCode_ooeActivityLimitReached?(r.ErrorCode=a.activityLimitReached,r.HttpStatusCode=429):e==t.OfficeJsErrorCode_ooeInvalidOrTimedOutSession?(r.ErrorCode=a.invalidOrTimedOutSession,r.HttpStatusCode=408,r.ErrorMessage=d._getResourceString(s.invalidOrTimedOutSessionMessage)):e==t.OfficeJsErrorCode_ooeRequestPayloadSizeLimitExceeded?(r.ErrorCode=a.requestPayloadSizeLimitExceeded,r.HttpStatusCode=400):e==t.OfficeJsErrorCode_ooeResponsePayloadSizeLimitExceeded?(r.ErrorCode=a.responsePayloadSizeLimitExceeded,r.HttpStatusCode=400):e==t.OfficeJsErrorCode_ooeWriteNotSupportedWhenModalDialogOpen?(r.ErrorCode=a.writeNotSupportedWhenModalDialogOpen,r.HttpStatusCode=400):e==t.OfficeJsErrorCode_ooeInvalidSheetName?(r.ErrorCode=a.invalidRequestContext,r.HttpStatusCode=400,r.ErrorMessage=d._getResourceString(s.invalidSheetName)):e==t.OfficeJsErrorCode_ooeUndoNotSupported&&(r.ErrorCode=a.undoNotSupported,r.HttpStatusCode=400),r},t.buildHttpResponseFromOfficeJsError=function(e,n){var r=500,i={error:{}};return i.error.code=a.generalException,i.error.message=n,e===t.OfficeJsErrorCode_ooeNoCapability?(r=403,i.error.code=a.accessDenied):e===t.OfficeJsErrorCode_ooeActivityLimitReached&&(r=429,i.error.code=a.activityLimitReached),{statusCode:r,headers:{},body:JSON.stringify(i)}},t.buildRequestMessageSafeArray=function(e,t,n,r,i,o,a,s){var c=[];if(i)for(var l in i)c.push(l),c.push(i[l]);return[e,n,r,c,o,0,t,"","","","","","","",a||0,s||""]},t._buildAdditionalData=function(t){if(!t)return"";var n;try{n=JSON.stringify({options:t})}catch(t){throw i.RuntimeError._createInvalidArgError({argumentName:"requestOptions",innerError:t instanceof e.Error?t:void 0})}if(!n||n.length>c.maxAdditionalDataLength)throw i.RuntimeError._createInvalidArgError({argumentName:"requestOptions"});return n},t.getResponseBody=function(e){return t.getResponseBodyFromSafeArray(e.value.data)},t.getResponseHeaders=function(e){return t.getResponseHeadersFromSafeArray(e.value.data)},t.getResponseBodyFromSafeArray=function(e){var t=e[2];return"string"==typeof t?t:t.join("")},t.getResponseHeadersFromSafeArray=function(e){var t=e[1];if(!t)return null;for(var n={},r=0;r<t.length-1;r+=2)n[t[r]]=t[r+1];return n},t.getResponseStatusCode=function(e){return t.getResponseStatusCodeFromSafeArray(e.value.data)},t.getResponseStatusCodeFromSafeArray=function(e){return e[0]},t.OfficeJsErrorCode_ooeInvalidOrTimedOutSession=5012,t.OfficeJsErrorCode_ooeActivityLimitReached=5102,t.OfficeJsErrorCode_ooeNoCapability=7e3,t.OfficeJsErrorCode_ooeRequestPayloadSizeLimitExceeded=5103,t.OfficeJsErrorCode_ooeResponsePayloadSizeLimitExceeded=5104,t.OfficeJsErrorCode_ooeWriteNotSupportedWhenModalDialogOpen=5016,t.OfficeJsErrorCode_ooeInvalidSheetName=1014,t.OfficeJsErrorCode_ooeUndoNotSupported=5017,t}();e.RichApiMessageUtility=l,function(e){e.getPromiseType=function(){if("undefined"!=typeof Promise)return Promise;if(void 0!==Office&&Office.Promise)return Office.Promise;if(void 0!==OfficeExtension&&OfficeExtension.Promise)return OfficeExtension.Promise;throw new e.Error("No Promise implementation found")}}(i=e._Internal||(e._Internal={}));var d=function(){function e(){}return e.log=function(t){e._logEnabled&&"undefined"!=typeof console&&console.log&&console.log(t)},e.checkArgumentNull=function(t,n){if(e.isNullOrUndefined(t))throw i.RuntimeError._createInvalidArgError({argumentName:n})},e.isNullOrUndefined=function(e){return null===e||void 0===e},e.isUndefined=function(e){return void 0===e},e.isNullOrEmptyString=function(e){return null===e||(void 0===e||0==e.length)},e.isPlainJsonObject=function(t){if(e.isNullOrUndefined(t))return!1;if("object"!=typeof t)return!1;if("[object Object]"!==Object.prototype.toString.apply(t))return!1;if(t.constructor&&!Object.prototype.hasOwnProperty.call(t,"constructor")&&!Object.prototype.hasOwnProperty.call(t.constructor.prototype,"hasOwnProperty"))return!1;for(var n in t)if(!Object.prototype.hasOwnProperty.call(t,n))return!1;return!0},e.trim=function(e){return e.replace(new RegExp("^\\s+|\\s+$","g"),"")},e.caseInsensitiveCompareString=function(t,n){return e.isNullOrUndefined(t)?e.isNullOrUndefined(n):!e.isNullOrUndefined(n)&&t.toUpperCase()==n.toUpperCase()},e.isReadonlyRestRequest=function(t){return e.caseInsensitiveCompareString(t,"GET")},e._getResourceString=function(t,n){var r;if("undefined"!=typeof window&&window.Strings&&window.Strings.OfficeOM){var i="L_"+t,o=window.Strings.OfficeOM[i];o&&(r=o)}if(r||(r=e.s_resourceStringValues[t]),r||(r=t),!e.isNullOrUndefined(n))if(Array.isArray(n)){var a=n;r=e._formatString(r,a)}else r=r.replace("{0}",n);return r},e._formatString=function(e,t){return e.replace(/\{\d\}/g,(function(e){var n=parseInt(e.substr(1,e.length-2));if(n<t.length)return t[n];throw i.RuntimeError._createInvalidArgError({argumentName:"format"})}))},Object.defineProperty(e,"Promise",{get:function(){return i.getPromiseType()},enumerable:!0,configurable:!0}),e.createPromise=function(t){return new e.Promise(t)},e._createPromiseFromResult=function(t){return e.createPromise((function(e,n){e(t)}))},e._createPromiseFromException=function(t){return e.createPromise((function(e,n){n(t)}))},e._createTimeoutPromise=function(t){return e.createPromise((function(e,n){setTimeout((function(){e(null)}),t)}))},e._createInvalidArgError=function(e){return i.RuntimeError._createInvalidArgError(e)},e._isLocalDocumentUrl=function(t){return e._getLocalDocumentUrlPrefixLength(t)>0},e._getLocalDocumentUrlPrefixLength=function(e){for(var t=["http://document.localhost","https://document.localhost","//document.localhost"],n=e.toLowerCase().trim(),r=0;r<t.length;r++){if(n===t[r])return t[r].length;if(n.substr(0,t[r].length+1)===t[r]+"/")return t[r].length+1}return 0},e._validateLocalDocumentRequest=function(t){var n=e._getLocalDocumentUrlPrefixLength(t.url);if(n<=0)throw i.RuntimeError._createInvalidArgError({argumentName:"request"});var r=t.url.substr(n),o=r.toLowerCase();return"_api"===o?r="":"_api/"===o.substr(0,"_api/".length)&&(r=r.substr("_api/".length)),{method:t.method,url:r,headers:t.headers,body:t.body}},e._parseRequestFlagsAndCustomDataFromQueryStringIfAny=function(e){for(var t={flags:-1,customData:""},n=e.split("&"),r=0;r<n.length;r++){var i=n[r].split("=");if(i[0].toLowerCase()===c.flags){var o=parseInt(i[1]);o&=65535,t.flags=o}else i[0].toLowerCase()===c.customData&&(t.customData=decodeURIComponent(i[1]))}return t},e._getRequestBodyText=function(e){var t="";return"string"==typeof e.body?t=e.body:e.body&&"object"==typeof e.body&&(t=JSON.stringify(e.body)),t},e._parseResponseBody=function(t){if("string"==typeof t.body){var n=e.trim(t.body);return JSON.parse(n)}return t.body},e._buildRequestMessageSafeArray=function(t){var n=0;e.isReadonlyRestRequest(t.method)||(n=1);var r="";if(t.url.substr(0,c.processQuery.length).toLowerCase()===c.processQuery.toLowerCase()){var i=t.url.indexOf("?");if(i>0){var o=t.url.substr(i+1),a=e._parseRequestFlagsAndCustomDataFromQueryStringIfAny(o);a.flags>=0&&(n=a.flags),r=a.customData}}return l.buildRequestMessageSafeArray(r,n,t.method,t.url,t.headers,e._getRequestBodyText(t))},e._parseHttpResponseHeaders=function(t){var n={};if(!e.isNullOrEmptyString(t))for(var r=new RegExp("\r?\n"),i=t.split(r),o=0;o<i.length;o++){var a=i[o];if(null!=a){var s=a.indexOf(":");if(s>0){var c=a.substr(0,s),l=a.substr(s+1);c=e.trim(c),l=e.trim(l),n[c.toUpperCase()]=l}}}return n},e._parseErrorResponse=function(t){var n=e._parseErrorResponseBody(t),r=t.statusCode.toString();if(e.isNullOrUndefined(n)||"object"!=typeof n||!n.error)return e._createDefaultErrorResponse(r);var i=n.error,o=i.innerError;return o&&o.code?e._createErrorResponse(o.code,r,o.message):i.code?e._createErrorResponse(i.code,r,i.message):e._createDefaultErrorResponse(r)},e._parseErrorResponseBody=function(t){if(e.isPlainJsonObject(t.body))return t.body;if(!e.isNullOrEmptyString(t.body)){var n=e.trim(t.body);try{return JSON.parse(n)}catch(t){e.log("Error when parse "+n)}}},e._createDefaultErrorResponse=function(t){return{errorCode:a.connectionFailure,errorMessage:e._getResourceString(s.connectionFailureWithStatus,t)}},e._createErrorResponse=function(t,n,r){return{errorCode:t,errorMessage:e._getResourceString(s.connectionFailureWithDetails,[n,t,r])}},e._copyHeaders=function(e,t){if(e&&t)for(var n in e)t[n]=e[n]},e.addResourceStringValues=function(t){for(var n in t)e.s_resourceStringValues[n]=t[n]},e._logEnabled=!1,e.s_resourceStringValues={ApiNotFoundDetails:"The method or property {0} is part of the {1} requirement set, which is not available in your version of {2}.",ConnectionFailureWithStatus:"The request failed with status code of {0}.",ConnectionFailureWithDetails:"The request failed with status code of {0}, error code {1} and the following error message: {2}",InvalidArgument:"The argument '{0}' doesn't work for this situation, is missing, or isn't in the right format.",InvalidObjectPath:'The object path \'{0}\' isn\'t working for what you\'re trying to do. If you\'re using the object across multiple "context.sync" calls and outside the sequential execution of a ".run" batch, please use the "context.trackedObjects.add()" and "context.trackedObjects.remove()" methods to manage the object\'s lifetime.',InvalidRequestContext:"Cannot use the object across different request contexts.",Timeout:"The operation has timed out.",ValueNotLoaded:'The value of the result object has not been loaded yet. Before reading the value property, call "context.sync()" on the associated request context.'},e}();e.CoreUtility=d;var u=function(){function e(){}return e.setMock=function(t){e.s_isMock=t},e.isMock=function(){return e.s_isMock},e._setCurrentTestName=function(t){e.s_currentTestName=t,e.s_currentTestSequenceId=0},e._getCurrentTestNameWithSequenceId=function(){return e.s_currentTestName?(e.s_currentTestSequenceId++,e.s_currentTestName+"."+e.s_currentTestSequenceId):null},e}();e.TestUtility=u,e._internalConfig={showDisposeInfoInDebugInfo:!1,showInternalApiInDebugInfo:!1,enableEarlyDispose:!0,alwaysPolyfillClientObjectUpdateMethod:!1,alwaysPolyfillClientObjectRetrieveMethod:!1,enableConcurrentFlag:!0,enableUndoableFlag:!0,appendTypeNameToObjectPathInfo:!1,enablePreviewExecution:!1,enableIndexedKeepReferenceRemoval:!0,enableEmptyPreviousObjectsArray:!0,enableExcelWebDeletedSheetRetry:!0,forceExcelWebDeletedSheetRetryOn:!1},e._emptyPreviousObjectsArrayGateName="Microsoft.Office.OEP.EnableEmptyPreviousObjectsArray";var f=!0,p=!1;function m(){return!!e._internalConfig.enableEmptyPreviousObjectsArray&&(p||function(){try{var t="undefined"!=typeof self?self:"undefined"!=typeof window?window:null,n=t&&t.OfficeRuntime&&t.OfficeRuntime.experimentation;if(!n)return;"function"==typeof n.getChangeGate?f=!1!==n.getChangeGate(e._emptyPreviousObjectsArrayGateName):"function"==typeof n.getBooleanFeatureGate&&(f=!1!==n.getBooleanFeatureGate(e._emptyPreviousObjectsArrayGateName,!0)),p=!0}catch(e){}}(),f)}function g(){return!!e._internalConfig.enableExcelWebDeletedSheetRetry&&(!!e._internalConfig.forceExcelWebDeletedSheetRetryOn||function(e,t){if(Object.prototype.hasOwnProperty.call(h,e))return h[e];try{var n="undefined"!=typeof self?self:"undefined"!=typeof window?window:null,r=n&&n.OfficeRuntime&&n.OfficeRuntime.experimentation;if(r&&"function"==typeof r.getBooleanFeatureGate){var i=!0===r.getBooleanFeatureGate(e,t);return h[e]=i,i}}catch(e){}return t}("Microsoft.Office.OEP.ExcelWebRetryOnDeletedSheet",!1))}e._isEmptyPreviousObjectsArrayEnabled=m,e._isExcelWebDeletedSheetRetryEnabled=g;var h={};e.config={extendedErrorLogging:!1};var y=function(){function t(){}return t.createSetPropertyAction=function(t,n,r,i,o){P.validateObjectPath(n);var a={Id:t._nextId(),ActionType:4,Name:r,ObjectPathId:n._objectPath.objectPathInfo.Id,ArgumentInfo:{}},s=[i],c=P.setMethodArguments(t,a.ArgumentInfo,s);P.validateReferencedObjectPaths(c);var l=new S(a,0,o);if(l.referencedObjectPath=n._objectPath,l.referencedArgumentObjectPaths=c,e._internalConfig.enablePreviewExecution&&0!=(16&o)){var d={Id:t._nextId(),ActionType:4,Name:r,ObjectId:"",ObjectType:"",Arguments:[i]};n._addPreviewExecutionAction(d)}return n._addAction(l)},t.createQueryAction=function(e,t,n,r){P.validateObjectPath(t);var i={Id:e._nextId(),ActionType:2,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,QueryInfo:n},o=new S(i,1,4);return o.referencedObjectPath=t._objectPath,t._addAction(o,r)},t.createQueryAsJsonAction=function(e,t,n,r){P.validateObjectPath(t);var i={Id:e._nextId(),ActionType:7,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,QueryInfo:n},o=new S(i,1,4);return o.referencedObjectPath=t._objectPath,t._addAction(o,r)},t.createUpdateAction=function(e,t,n){P.validateObjectPath(t);var r={Id:e._nextId(),ActionType:9,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,ObjectState:n},i=new S(r,0,0);return i.referencedObjectPath=t._objectPath,t._addAction(i)},t}();e.CommonActionFactory=y;var v=function(){function t(e,t){this.m_contextBase=e,this.m_objectPath=t}return Object.defineProperty(t.prototype,"_objectPath",{get:function(){return this.m_objectPath},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_context",{get:function(){return this.m_contextBase},enumerable:!0,configurable:!0}),t.prototype._addAction=function(e,t){var n=this;return void 0===t&&(t=null),d.createPromise((function(r,i){n._context._addServiceApiAction(e,t,r,i)}))},t.prototype._addPreviewExecutionAction=function(e){},t.prototype._retrieve=function(t,n){var r=e._internalConfig.alwaysPolyfillClientObjectRetrieveMethod;r||(r=!P.isSetSupported("RichApiRuntime","1.1"));var i=O._parseQueryOption(t);return r?y.createQueryAction(this._context,this,i,n):y.createQueryAsJsonAction(this._context,this,i,n)},t.prototype._recursivelyUpdate=function(t){var n=e._internalConfig.alwaysPolyfillClientObjectUpdateMethod;n||(n=!P.isSetSupported("RichApiRuntime","1.2"));try{var r=this[I.scalarPropertyNames];r||(r=[]);var o=this[I.scalarPropertyUpdateable];if(!o){o=[];for(var c=0;c<r.length;c++)o.push(!1)}var l=this[I.navigationPropertyNames];l||(l=[]);var u={},f={},p=0;for(var m in t){var g=r.indexOf(m);if(g>=0){if(!o[g])throw new i.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:d._getResourceString(w.attemptingToSetReadOnlyProperty,m),debugInfo:{errorLocation:m}});u[m]=t[m],++p}else{if(!(l.indexOf(m)>=0))throw new i.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:d._getResourceString(w.propertyDoesNotExist,m),debugInfo:{errorLocation:m}});f[m]=t[m]}}if(p>0)if(n)for(c=0;c<r.length;c++){var h=u[m=r[c]];P.isUndefined(h)||y.createSetPropertyAction(this._context,this,m,h)}else y.createUpdateAction(this._context,this,u);for(var m in f){var v=this[m],S=f[m];v._recursivelyUpdate(S)}}catch(e){throw new i.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:d._getResourceString(s.invalidArgument,"properties"),debugInfo:{errorLocation:this._className+".update"},innerError:e})}},t}();e.ClientObjectBase=v;var S=function(){function e(e,t,n){this.m_actionInfo=e,this.m_operationType=t,this.m_flags=n}return Object.defineProperty(e.prototype,"actionInfo",{get:function(){return this.m_actionInfo},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"operationType",{get:function(){return this.m_operationType},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"flags",{get:function(){return this.m_flags},enumerable:!0,configurable:!0}),e}();e.Action=S;var b=function(){function t(e,t,n,r,i,o){this.m_objectPathInfo=e,this.m_parentObjectPath=t,this.m_isCollection=n,this.m_isInvalidAfterRequest=r,this.m_isValid=!0,this.m_operationType=i,this.m_flags=o}return Object.defineProperty(t.prototype,"id",{get:function(){var e=this.m_objectPathInfo.ArgumentInfo;if(e){var t=e.Arguments;if(t)return t[0]}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){var e=this.m_parentObjectPath;if(e)return e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parentId",{get:function(){return this.parent?this.parent.id:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectPathInfo",{get:function(){return this.m_objectPathInfo},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"operationType",{get:function(){return this.m_operationType},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flags",{get:function(){return this.m_flags},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isCollection",{get:function(){return this.m_isCollection},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isInvalidAfterRequest",{get:function(){return this.m_isInvalidAfterRequest},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parentObjectPath",{get:function(){return this.m_parentObjectPath},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"argumentObjectPaths",{get:function(){return this.m_argumentObjectPaths},set:function(e){this.m_argumentObjectPaths=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isValid",{get:function(){return this.m_isValid},set:function(e){this.m_isValid=e,!e&&6===this.m_objectPathInfo.ObjectPathType&&this.m_savedObjectPathInfo&&(t.copyObjectPathInfo(this.m_savedObjectPathInfo.pathInfo,this.m_objectPathInfo),this.m_parentObjectPath=this.m_savedObjectPathInfo.parent,this.m_isValid=!0,this.m_savedObjectPathInfo=null)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"originalObjectPathInfo",{get:function(){return this.m_originalObjectPathInfo},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"getByIdMethodName",{get:function(){return this.m_getByIdMethodName},set:function(e){this.m_getByIdMethodName=e},enumerable:!0,configurable:!0}),t.prototype._updateAsNullObject=function(){this.resetForUpdateUsingObjectData(),this.m_objectPathInfo.ObjectPathType=7,this.m_objectPathInfo.Name="",this.m_parentObjectPath=null},t.prototype.saveOriginalObjectPathInfo=function(){e.config.extendedErrorLogging&&!this.m_originalObjectPathInfo&&(this.m_originalObjectPathInfo={},t.copyObjectPathInfo(this.m_objectPathInfo,this.m_originalObjectPathInfo))},t.prototype.updateUsingObjectData=function(e,n){var r=e[I.referenceId];if(!d.isNullOrEmptyString(r)){if(!this.m_savedObjectPathInfo&&!this.isInvalidAfterRequest&&t.isRestorableObjectPath(this.m_objectPathInfo.ObjectPathType)){var i={};t.copyObjectPathInfo(this.m_objectPathInfo,i),this.m_savedObjectPathInfo={pathInfo:i,parent:this.m_parentObjectPath}}return this.saveOriginalObjectPathInfo(),this.resetForUpdateUsingObjectData(),this.m_objectPathInfo.ObjectPathType=6,this.m_objectPathInfo.Name=r,delete this.m_objectPathInfo.ParentObjectPathId,void(this.m_parentObjectPath=null)}if(n){var o=n[I.collectionPropertyPath];if(!d.isNullOrEmptyString(o)&&n.context){var a=P.tryGetObjectIdFromLoadOrRetrieveResult(e);if(!d.isNullOrUndefined(a)){for(var s=o.split("."),c=n.context[s[0]],l=1;l<s.length;l++)c=c[s[l]];return this.saveOriginalObjectPathInfo(),this.resetForUpdateUsingObjectData(),this.m_parentObjectPath=c._objectPath,this.m_objectPathInfo.ParentObjectPathId=this.m_parentObjectPath.objectPathInfo.Id,this.m_objectPathInfo.ObjectPathType=5,this.m_objectPathInfo.Name="",void(this.m_objectPathInfo.ArgumentInfo.Arguments=[a])}}}var u=this.parentObjectPath&&this.parentObjectPath.isCollection,f=this.getByIdMethodName;if(u||!d.isNullOrEmptyString(f)){a=P.tryGetObjectIdFromLoadOrRetrieveResult(e);if(!d.isNullOrUndefined(a))return this.saveOriginalObjectPathInfo(),this.resetForUpdateUsingObjectData(),d.isNullOrEmptyString(f)?(this.m_objectPathInfo.ObjectPathType=5,this.m_objectPathInfo.Name=""):(this.m_objectPathInfo.ObjectPathType=3,this.m_objectPathInfo.Name=f),void(this.m_objectPathInfo.ArgumentInfo.Arguments=[a])}},t.prototype.resetForUpdateUsingObjectData=function(){this.m_isInvalidAfterRequest=!1,this.m_isValid=!0,this.m_operationType=1,this.m_flags=4,this.m_objectPathInfo.ArgumentInfo={},this.m_argumentObjectPaths=null,this.m_getByIdMethodName=null},t.isRestorableObjectPath=function(e){return 1===e||5===e||3===e||4===e},t.copyObjectPathInfo=function(e,t){t.Id=e.Id,t.ArgumentInfo=e.ArgumentInfo,t.Name=e.Name,t.ObjectPathType=e.ObjectPathType,t.ParentObjectPathId=e.ParentObjectPathId},t}();e.ObjectPath=b;var O=function(){function e(){this._additionalData={},this.m_nextId=0}return Object.defineProperty(e.prototype,"additionalData",{get:function(){return this._additionalData},enumerable:!0,configurable:!0}),e.prototype._nextId=function(){return++this.m_nextId},e.prototype._addServiceApiAction=function(e,t,n,r){this.m_serviceApiQueue||(this.m_serviceApiQueue=new C(this)),this.m_serviceApiQueue.add(e,t,n,r)},e._parseQueryOption=function(t){var n={};if("string"==typeof t){var r=t;n.Select=P._parseSelectExpand(r)}else if(Array.isArray(t))n.Select=P._parseSelectExpand(t);else if("object"==typeof t){var o=t;if(e.isLoadOption(o)){if("string"==typeof o.select)n.Select=P._parseSelectExpand(o.select);else if(Array.isArray(o.select))n.Select=P._parseSelectExpand(o.select);else if(!P.isNullOrUndefined(o.select))throw i.RuntimeError._createInvalidArgError({argumentName:"option.select"});if("string"==typeof o.expand)n.Expand=P._parseSelectExpand(o.expand);else if(Array.isArray(o.expand))n.Expand=P._parseSelectExpand(o.expand);else if(!P.isNullOrUndefined(o.expand))throw i.RuntimeError._createInvalidArgError({argumentName:"option.expand"});if("number"==typeof o.top)n.Top=o.top;else if(!P.isNullOrUndefined(o.top))throw i.RuntimeError._createInvalidArgError({argumentName:"option.top"});if("number"==typeof o.skip)n.Skip=o.skip;else if(!P.isNullOrUndefined(o.skip))throw i.RuntimeError._createInvalidArgError({argumentName:"option.skip"})}else n=e.parseStrictLoadOption(t)}else if(!P.isNullOrUndefined(t))throw i.RuntimeError._createInvalidArgError({argumentName:"option"});return n},e.isLoadOption=function(e){if(!P.isUndefined(e.select)&&("string"==typeof e.select||Array.isArray(e.select)))return!0;if(!P.isUndefined(e.expand)&&("string"==typeof e.expand||Array.isArray(e.expand)))return!0;if(!P.isUndefined(e.top)&&"number"==typeof e.top)return!0;if(!P.isUndefined(e.skip)&&"number"==typeof e.skip)return!0;for(var t in e)return!1;return!0},e.parseStrictLoadOption=function(t){var n={Select:[]};return e.parseStrictLoadOptionHelper(n,"","option",t),n},e.combineQueryPath=function(e,t,n){return 0===e.length?t:e+n+t},e.parseStrictLoadOptionHelper=function(t,n,r,o){for(var a in o){var s=o[a];if("$all"===a){if("boolean"!=typeof s)throw i.RuntimeError._createInvalidArgError({argumentName:e.combineQueryPath(r,a,".")});s&&t.Select.push(e.combineQueryPath(n,"*","/"))}else if("$top"===a){if("number"!=typeof s||n.length>0)throw i.RuntimeError._createInvalidArgError({argumentName:e.combineQueryPath(r,a,".")});t.Top=s}else if("$skip"===a){if("number"!=typeof s||n.length>0)throw i.RuntimeError._createInvalidArgError({argumentName:e.combineQueryPath(r,a,".")});t.Skip=s}else if("boolean"==typeof s)s&&t.Select.push(e.combineQueryPath(n,a,"/"));else{if("object"!=typeof s)throw i.RuntimeError._createInvalidArgError({argumentName:e.combineQueryPath(r,a,".")});e.parseStrictLoadOptionHelper(t,e.combineQueryPath(n,a,"/"),e.combineQueryPath(r,a,"."),s)}}},e}();e.ClientRequestContextBase=O;var _=function(){function e(e){this.m_objectPath=e}return e.prototype._handleResult=function(e){d.isNullOrUndefined(e)?this.m_objectPath._updateAsNullObject():this.m_objectPath.updateUsingObjectData(e,null)},e}(),A=function(){function t(e){this.m_contextBase=e,this.m_actions=[],this.m_actionResultHandler={},this.m_referencedObjectPaths={},this.m_instantiatedObjectPaths={},this.m_keepReferenceActionIndicesByObjectPathId={},this.m_preSyncPromises=[],this.m_previewExecutionActions=[]}return t.prototype.addAction=function(t){if(this.m_actions.push(t),1==t.actionInfo.ActionType)this.m_instantiatedObjectPaths[t.actionInfo.ObjectPathId]=t;else if(e._internalConfig.enableIndexedKeepReferenceRemoval&&3==t.actionInfo.ActionType&&t.actionInfo.Name===I.keepReference){var n=t.actionInfo.ObjectPathId,r=this.m_actions.length-1;this.m_keepReferenceActionIndicesByObjectPathId[n]||(this.m_keepReferenceActionIndicesByObjectPathId[n]=[]),this.m_keepReferenceActionIndicesByObjectPathId[n].push(r)}},t.prototype.addPreviewExecutionAction=function(e){this.m_previewExecutionActions.push(e)},Object.defineProperty(t.prototype,"hasActions",{get:function(){return e._internalConfig.enableIndexedKeepReferenceRemoval?this.m_actions.some((function(e){return void 0!==e})):this.m_actions.length>0},enumerable:!0,configurable:!0}),t.prototype._getLastAction=function(){if(!e._internalConfig.enableIndexedKeepReferenceRemoval)return this.m_actions[this.m_actions.length-1];for(var t=this.m_actions.length-1;t>=0;t--){var n=this.m_actions[t];if(void 0!==n)return n}},t.prototype.ensureInstantiateObjectPath=function(e){if(e){if(this.m_instantiatedObjectPaths[e.objectPathInfo.Id])return;if(this.ensureInstantiateObjectPath(e.parentObjectPath),this.ensureInstantiateObjectPaths(e.argumentObjectPaths),!this.m_instantiatedObjectPaths[e.objectPathInfo.Id]){var t={Id:this.m_contextBase._nextId(),ActionType:1,Name:"",ObjectPathId:e.objectPathInfo.Id},n=new S(t,1,4);n.referencedObjectPath=e,this.addReferencedObjectPath(e),this.addAction(n);var r=new _(e);this.addActionResultHandler(n,r)}}},t.prototype.ensureInstantiateObjectPaths=function(e){if(e)for(var t=0;t<e.length;t++)this.ensureInstantiateObjectPath(e[t])},t.prototype.addReferencedObjectPath=function(e){if(e&&!this.m_referencedObjectPaths[e.objectPathInfo.Id]){if(!e.isValid)throw new i.RuntimeError({code:a.invalidObjectPath,httpStatusCode:400,message:d._getResourceString(s.invalidObjectPath,P.getObjectPathExpression(e)),debugInfo:{errorLocation:P.getObjectPathExpression(e)}});for(;e;)this.m_referencedObjectPaths[e.objectPathInfo.Id]=e,3==e.objectPathInfo.ObjectPathType&&this.addReferencedObjectPaths(e.argumentObjectPaths),e=e.parentObjectPath}},t.prototype.addReferencedObjectPaths=function(e){if(e)for(var t=0;t<e.length;t++)this.addReferencedObjectPath(e[t])},t.prototype.addActionResultHandler=function(e,t){this.m_actionResultHandler[e.actionInfo.Id]=t},t.prototype.aggregrateRequestFlags=function(e,t,n){return 0===t&&(e|=1,0==(2&n)&&(e&=-17),0==(8&n)&&(e&=-257),e&=-5),1&n&&(e|=2),0==(4&n)&&(e&=-5),e},t.prototype.finallyNormalizeFlags=function(t){return 0==(1&t)&&(t&=-17,t&=-257),e._internalConfig.enableConcurrentFlag||(t&=-5),e._internalConfig.enableUndoableFlag||(t&=-17),P.isSetSupported("RichApiRuntimeFlag","1.1")||(t&=-5,t&=-17),P.isSetSupported("RichApiRuntimeFlag","1.2")||(t&=-257),"number"==typeof this.m_flagsForTesting&&(t=this.m_flagsForTesting),t},t.prototype.buildRequestMessageBodyAndRequestFlags=function(){e._internalConfig.enableEarlyDispose&&t._calculateLastUsedObjectPathIds(this.m_actions);var n=276,r={};for(var i in this.m_referencedObjectPaths)n=this.aggregrateRequestFlags(n,this.m_referencedObjectPaths[i].operationType,this.m_referencedObjectPaths[i].flags),r[i]=this.m_referencedObjectPaths[i].objectPathInfo;for(var o=[],a=!1,s=0;s<this.m_actions.length;s++){var c=this.m_actions[s];if(!e._internalConfig.enableIndexedKeepReferenceRemoval||c){var l=c;3===l.actionInfo.ActionType&&l.actionInfo.Name===I.keepReference&&(a=!0),n=this.aggregrateRequestFlags(n,l.operationType,l.flags),o.push(l.actionInfo)}}n=this.finallyNormalizeFlags(n);var d={AutoKeepReference:this.m_contextBase._autoCleanup&&a,Actions:o,ObjectPaths:r,AdditionalData:this.m_contextBase._additionalData};return this.m_previewExecutionActions.length>0&&(d.PreviewExecutionActions=this.m_previewExecutionActions,n|=4096),{body:d,flags:n}},t.prototype.processResponse=function(e){if(e)for(var t=0;t<e.length;t++){var n=e[t],r=this.m_actionResultHandler[n.ActionId];r&&r._handleResult(n.Value)}},t.prototype.invalidatePendingInvalidObjectPaths=function(){for(var e in this.m_referencedObjectPaths)this.m_referencedObjectPaths[e].isInvalidAfterRequest&&(this.m_referencedObjectPaths[e].isValid=!1)},t.prototype._addPreSyncPromise=function(e){this.m_preSyncPromises.push(e)},Object.defineProperty(t.prototype,"_preSyncPromises",{get:function(){return this.m_preSyncPromises},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_actions",{get:function(){return e._internalConfig.enableIndexedKeepReferenceRemoval?this.m_actions.filter((function(e){return void 0!==e})):this.m_actions},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_objectPaths",{get:function(){return this.m_referencedObjectPaths},enumerable:!0,configurable:!0}),t.prototype._removeKeepReferenceAction=function(t){if(e._internalConfig.enableIndexedKeepReferenceRemoval){var n=this.m_keepReferenceActionIndicesByObjectPathId[t];if(!n||0===n.length)return;var r=n.pop();return this.m_actions[r]=void 0,void(0===n.length&&delete this.m_keepReferenceActionIndicesByObjectPathId[t])}for(var i=this.m_actions.length-1;i>=0;i--){var o=this.m_actions[i];if(o&&o.actionInfo.ObjectPathId===t&&3===o.actionInfo.ActionType&&o.actionInfo.Name===I.keepReference){this.m_actions.splice(i,1);break}}},t._updateLastUsedActionIdOfObjectPathId=function(e,n,r){for(;n;){if(e[n.objectPathInfo.Id])return;e[n.objectPathInfo.Id]=r;var i=n.argumentObjectPaths;if(i)for(var o=i.length,a=0;a<o;a++)t._updateLastUsedActionIdOfObjectPathId(e,i[a],r);n=n.parentObjectPath}},t._calculateLastUsedObjectPathIds=function(n){for(var r={},i=n.length,o=i-1;o>=0;--o){var a=n[o];if(!e._internalConfig.enableIndexedKeepReferenceRemoval||a){var s=(m=a).actionInfo.Id;m.referencedObjectPath&&t._updateLastUsedActionIdOfObjectPathId(r,m.referencedObjectPath,s);var c=m.referencedArgumentObjectPaths;if(c)for(var l=c.length,d=0;d<l;d++)t._updateLastUsedActionIdOfObjectPathId(r,c[d],s)}}var u={};for(var f in r){var p=u[s=r[f]];p||(p=[],u[s]=p),p.push(parseInt(f))}for(o=0;o<i;o++){a=n[o];if(!e._internalConfig.enableIndexedKeepReferenceRemoval||a){var m,g=u[(m=a).actionInfo.Id];g&&g.length>0?m.actionInfo.L=g:m.actionInfo.L&&delete m.actionInfo.L}}},t}();e.ClientRequestBase=A;var T=function(){function e(e){this.m_type=e}return Object.defineProperty(e.prototype,"value",{get:function(){if(!this.m_isLoaded)throw new i.RuntimeError({code:a.valueNotLoaded,httpStatusCode:400,message:d._getResourceString(s.valueNotLoaded),debugInfo:{errorLocation:"clientResult.value"}});return this.m_value},enumerable:!0,configurable:!0}),e.prototype._handleResult=function(e){this.m_isLoaded=!0,"object"==typeof e&&e&&e._IsNull||(1===this.m_type?this.m_value=P.adjustToDateTime(e):this.m_value=e)},e}();e.ClientResult=T;var C=function(){function e(e){this.m_context=e,this.m_actions=[]}return e.prototype.add=function(e,t,n,r){var i=this;this.m_actions.push({action:e,resultHandler:t,resolve:n,reject:r}),1===this.m_actions.length&&setTimeout((function(){return i.processActions()}),0)},e.prototype.processActions=function(){var e=this;if(0!==this.m_actions.length){var t=this.m_actions;this.m_actions=[];for(var n=new A(this.m_context),r=0;r<t.length;r++){var i=t[r];n.ensureInstantiateObjectPath(i.action.referencedObjectPath),n.ensureInstantiateObjectPaths(i.action.referencedArgumentObjectPaths),n.addAction(i.action),n.addReferencedObjectPath(i.action.referencedObjectPath),n.addReferencedObjectPaths(i.action.referencedArgumentObjectPaths)}var o=n.buildRequestMessageBodyAndRequestFlags(),a=o.body,s=o.flags,l={Url:c.localDocumentApiPrefix,Headers:null,Body:a};d.log("Request:"),d.log(JSON.stringify(a)),(new E).executeAsync(this.m_context._customData,s,l).then((function(r){e.processResponse(n,t,r)})).catch((function(e){for(var n=0;n<t.length;n++){t[n].reject(e)}}))}},e.prototype.processResponse=function(e,t,n){var r=this.getErrorFromResponse(n),i=null;n.Body.Results?i=n.Body.Results:n.Body.ProcessedResults&&n.Body.ProcessedResults.Results&&(i=n.Body.ProcessedResults.Results),i||(i=[]),this.processActionResults(e,t,i,r)},e.prototype.getErrorFromResponse=function(e){return d.isNullOrEmptyString(e.ErrorCode)?e.Body&&e.Body.Error?new i.RuntimeError({code:e.Body.Error.Code,httpStatusCode:e.Body.Error.HttpStatusCode,message:e.Body.Error.Message}):null:new i.RuntimeError({code:e.ErrorCode,httpStatusCode:e.HttpStatusCode,message:e.ErrorMessage})},e.prototype.processActionResults=function(e,t,n,r){e.processResponse(n);for(var i=0;i<t.length;i++){for(var o=t[i],a=o.action.actionInfo.Id,s=!1,c=0;c<n.length;c++)if(a==n[c].ActionId){var l=n[c].Value;o.resultHandler&&(o.resultHandler._handleResult(l),l=o.resultHandler.value),o.resolve&&o.resolve(l),s=!0;break}!s&&o.reject&&(r?o.reject(r):o.reject("No response for the action."))}},e}(),E=function(){function e(){}return e.prototype.getRequestUrl=function(e,n,r){void 0===r&&(r=t.graph.toString());var i=c.flags+"="+n.toString();switch(r){case t.graph.toString():"/"!=e.charAt(e.length-1)&&(e+="/"),e=(e+=c.processQuery)+"?"+i;break;case t.wfe.toString():e=(e=e+"&"+i)+"&wdRestPart=_api/"+c.processQuery}return e},e.prototype.executeAsync=function(n,i,o){var a=o.Headers?o.Headers[I.remoteEndpointTypeHeaderKey]:t.graph.toString(),s={method:"POST",url:this.getRequestUrl(o.Url,i,a),headers:{},body:o.Body};if(s.headers[c.sourceLibHeader]=e.SourceLibHeaderValue,s.headers["CONTENT-TYPE"]="application/json",o.Headers)for(var l in o.Headers)s.headers[l]=o.Headers[l];return(d._isLocalDocumentUrl(s.url)?r.sendLocalDocumentRequest:r.sendRequest)(s).then((function(e){var t;if(200===e.statusCode)t={HttpStatusCode:e.statusCode,ErrorCode:null,ErrorMessage:null,Headers:e.headers,Body:d._parseResponseBody(e)};else{d.log("Error Response:"+e.body);var n=d._parseErrorResponse(e);t={HttpStatusCode:e.statusCode,ErrorCode:n.errorCode,ErrorMessage:n.errorMessage,Headers:e.headers,Body:null,RawErrorResponseBody:d._parseErrorResponseBody(e)}}return t}))},e.SourceLibHeaderValue="officejs-rest",e}();e.HttpRequestExecutor=E;var I=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.collectionPropertyPath="_collectionPropertyPath",t.id="Id",t.idLowerCase="id",t.idPrivate="_Id",t.keepReference="_KeepReference",t.objectPathIdPrivate="_ObjectPathId",t.referenceId="_ReferenceId",t.items="_Items",t.itemsLowerCase="items",t.scalarPropertyNames="_scalarPropertyNames",t.scalarPropertyOriginalNames="_scalarPropertyOriginalNames",t.navigationPropertyNames="_navigationPropertyNames",t.scalarPropertyUpdateable="_scalarPropertyUpdateable",t.previewExecutionObjectId="_previewExecutionObjectId",t.remoteEndpointTypeHeaderKey="X-EndpointType",t}(c);e.CommonConstants=I;var P=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.validateObjectPath=function(e){for(var n=e._objectPath;n;){if(!n.isValid)throw new i.RuntimeError({code:a.invalidObjectPath,httpStatusCode:400,message:d._getResourceString(s.invalidObjectPath,t.getObjectPathExpression(n)),debugInfo:{errorLocation:t.getObjectPathExpression(n)}});n=n.parentObjectPath}},t.validateReferencedObjectPaths=function(e){if(e)for(var n=0;n<e.length;n++)for(var r=e[n];r;){if(!r.isValid)throw new i.RuntimeError({code:a.invalidObjectPath,httpStatusCode:400,message:d._getResourceString(s.invalidObjectPath,t.getObjectPathExpression(r))});r=r.parentObjectPath}},t._toCamelLowerCase=function(e){if(d.isNullOrEmptyString(e))return e;for(var t=0;t<e.length&&e.charCodeAt(t)>=65&&e.charCodeAt(t)<=90;)t++;return t<e.length?e.substr(0,t).toLowerCase()+e.substr(t):e.toLowerCase()},t.adjustToDateTime=function(e){if(d.isNullOrUndefined(e))return null;if("string"==typeof e)return new Date(e);if(Array.isArray(e)){for(var n=e,r=0;r<n.length;r++)n[r]=t.adjustToDateTime(n[r]);return n}throw d._createInvalidArgError({argumentName:"date"})},t.tryGetObjectIdFromLoadOrRetrieveResult=function(e){var t=e[I.id];return d.isNullOrUndefined(t)&&(t=e[I.idLowerCase]),d.isNullOrUndefined(t)&&(t=e[I.idPrivate]),t},t.getObjectPathExpression=function(e){for(var n="";e;){switch(e.objectPathInfo.ObjectPathType){case 1:n=n;break;case 2:n="new()"+(n.length>0?".":"")+n;break;case 3:n=t.normalizeName(e.objectPathInfo.Name)+"()"+(n.length>0?".":"")+n;break;case 4:n=t.normalizeName(e.objectPathInfo.Name)+(n.length>0?".":"")+n;break;case 5:n="getItem()"+(n.length>0?".":"")+n;break;case 6:n="_reference()"+(n.length>0?".":"")+n}e=e.parentObjectPath}return n},t.setMethodArguments=function(e,n,r){if(d.isNullOrUndefined(r))return null;var i=new Array,o=new Array,a=t.collectObjectPathInfos(e,r,i,o);return n.Arguments=r,a&&(n.ReferencedObjectPathIds=o),i},t.validateContext=function(e,t){if(e&&t&&t._context!==e)throw new i.RuntimeError({code:a.invalidRequestContext,httpStatusCode:400,message:d._getResourceString(s.invalidRequestContext)})},t.isSetSupported=function(e,n){return"function"==typeof t.isSetSupportedOverride?t.isSetSupportedOverride(e,n):!("undefined"!=typeof window&&window.Office&&window.Office.context&&window.Office.context.requirements)||window.Office.context.requirements.isSetSupported(e,n)},t.throwIfApiNotSupported=function(e,n,r,o){if(t._doApiNotSupportedCheck&&!t.isSetSupported(n,r)){var c=d._getResourceString(s.apiNotFoundDetails,[e,n+" "+r,o]);throw new i.RuntimeError({code:a.apiNotFound,httpStatusCode:404,message:c,debugInfo:{errorLocation:e}})}},t.calculateApiFlags=function(e,n,r){var i="undefined"!=typeof window&&window&&window.location&&window.location.href&&-1!==window.location.href.indexOf("eed0a086-3498-4f91-a377-1e0265ecc0cc");return("function"==typeof t.isSetSupportedOverride?t.isSetSupportedOverride(n,r):!i&&t.isSetSupported(n,r))||(e&=-3),e},t._parseSelectExpand=function(e){var t,n=[];if(Array.isArray(e))t=e;else{if(d.isNullOrEmptyString(e))return n;t=e.split(",")}for(var r=0;r<t.length;r++){var o=t[r];if("string"!=typeof o)throw i.RuntimeError._createInvalidArgError({argumentName:"select"});(o=a(o.trim())).length>0&&n.push(o)}return n;function a(e){var t=e.toLowerCase();if("items"===t||"items/"===t)return"*";return("items/"===t.substr(0,6)||"items."===t.substr(0,6))&&(e=e.substr(6)),e.replace(new RegExp("[/.]items[/.]","gi"),"/")}},t.changePropertyNameToCamelLowerCase=function(e){if(Array.isArray(e)){for(var n=[],r=0;r<e.length;r++)n.push(this.changePropertyNameToCamelLowerCase(e[r]));return n}if("object"==typeof e&&null!==e){n={};for(var i in e){var o=e[i];if(i===I.items){(n={})[I.itemsLowerCase]=this.changePropertyNameToCamelLowerCase(o);break}n[t._toCamelLowerCase(i)]=this.changePropertyNameToCamelLowerCase(o)}return n}return e},t.purifyJson=function(e){if(Array.isArray(e)){for(var t=[],n=0;n<e.length;n++)t.push(this.purifyJson(e[n]));return t}if("object"==typeof e&&null!==e){t={};for(var r in e)if(95!==r.charCodeAt(0)){var i=e[r];"object"==typeof i&&null!==i&&Array.isArray(i.items)&&(i=i.items),t[r]=this.purifyJson(i)}return t}return e},t.collectObjectPathInfos=function(e,n,r,i){for(var o=!1,a=0;a<n.length;a++)if(n[a]instanceof v){var s=n[a];t.validateContext(e,s),n[a]=s._objectPath.objectPathInfo.Id,i.push(s._objectPath.objectPathInfo.Id),r.push(s._objectPath),o=!0}else if(Array.isArray(n[a])){var c=new Array;t.collectObjectPathInfos(e,n[a],r,c)?(i.push(c),o=!0):i.push(0)}else d.isPlainJsonObject(n[a])?(i.push(0),t.replaceClientObjectPropertiesWithObjectPathIds(n[a],r)):i.push(0);return o},t.replaceClientObjectPropertiesWithObjectPathIds=function(e,n){var r,i;for(var o in e){var a=e[o];if(a instanceof v)n.push(a._objectPath),e[o]=((r={})[I.objectPathIdPrivate]=a._objectPath.objectPathInfo.Id,r);else if(Array.isArray(a))for(var s=0;s<a.length;s++)if(a[s]instanceof v){var c=a[s];n.push(c._objectPath),a[s]=((i={})[I.objectPathIdPrivate]=c._objectPath.objectPathInfo.Id,i)}else d.isPlainJsonObject(a[s])&&t.replaceClientObjectPropertiesWithObjectPathIds(a[s],n);else d.isPlainJsonObject(a)&&t.replaceClientObjectPropertiesWithObjectPathIds(a,n)}},t.normalizeName=function(e){return e.substr(0,1).toLowerCase()+e.substr(1)},t._doApiNotSupportedCheck=!1,t}(d);e.CommonUtility=P;var w=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.propertyDoesNotExist="PropertyDoesNotExist",t.attemptingToSetReadOnlyProperty="AttemptingToSetReadOnlyProperty",t}(s);e.CommonResourceStrings=w;var D=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.propertyNotLoaded="PropertyNotLoaded",t.runMustReturnPromise="RunMustReturnPromise",t.cannotRegisterEvent="CannotRegisterEvent",t.invalidOrTimedOutSession="InvalidOrTimedOutSession",t.cannotUpdateReadOnlyProperty="CannotUpdateReadOnlyProperty",t}(a);e.ErrorCodes=D;var x=function(){function e(e){this.m_callback=e}return e.prototype._handleResult=function(e){this.m_callback&&this.m_callback()},e}(),M=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),n.createMethodAction=function(t,n,r,i,o,a){Y.validateObjectPath(n);var s={Id:t._nextId(),ActionType:3,Name:r,ObjectPathId:n._objectPath.objectPathInfo.Id,ArgumentInfo:{}},c=Y.setMethodArguments(t,s.ArgumentInfo,o);Y.validateReferencedObjectPaths(c);var l=Y._fixupApiFlags(a),d=new S(s,i,l);if(d.referencedObjectPath=n._objectPath,d.referencedArgumentObjectPaths=c,n._addAction(d),e._internalConfig.enablePreviewExecution&&0!=(16&l)){var u={Id:t._nextId(),ActionType:3,Name:r,Arguments:o,ObjectId:"",ObjectType:""};n._addPreviewExecutionAction(u)}return d},n.createRecursiveQueryAction=function(e,t,n){Y.validateObjectPath(t);var r={Id:e._nextId(),ActionType:6,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,RecursiveQueryInfo:n},i=new S(r,1,4);return i.referencedObjectPath=t._objectPath,t._addAction(i),i},n.createEnsureUnchangedAction=function(e,t,n){Y.validateObjectPath(t);var r={Id:e._nextId(),ActionType:8,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,ObjectState:n},i=new S(r,1,4);return i.referencedObjectPath=t._objectPath,t._addAction(i),i},n.createInstantiateAction=function(e,t){Y.validateObjectPath(t),e._pendingRequest.ensureInstantiateObjectPath(t._objectPath.parentObjectPath),e._pendingRequest.ensureInstantiateObjectPaths(t._objectPath.argumentObjectPaths);var n={Id:e._nextId(),ActionType:1,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id},r=new S(n,1,4);return r.referencedObjectPath=t._objectPath,t._addAction(r,new J(t),!0),r},n.createTraceAction=function(e,t,n){var r={Id:e._nextId(),ActionType:5,Name:"Trace",ObjectPathId:0},i=new S(r,1,4);return e._pendingRequest.addAction(i),n&&e._pendingRequest.addTrace(r.Id,t),i},n.createTraceMarkerForCallback=function(e,t){var r=n.createTraceAction(e,null,!1);e._pendingRequest.addActionResultHandler(r,new x(t))},n}(y);e.ActionFactory=M;var N=function(t){function n(n,r){var i=t.call(this,n,r)||this;return Y.checkArgumentNull(n,"context"),i.m_context=n,i._objectPath&&(!n._processingResult&&n._pendingRequest&&(M.createInstantiateAction(n,i),n._autoCleanup&&i._KeepReference&&n.trackedObjects._autoAdd(i)),e._internalConfig.appendTypeNameToObjectPathInfo&&i._objectPath.objectPathInfo&&i._className&&(i._objectPath.objectPathInfo.T=i._className)),i}return __extends(n,t),Object.defineProperty(n.prototype,"context",{get:function(){return this.m_context},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isNull",{get:function(){return(void 0!==this.m_isNull||!u.isMock())&&(Y.throwIfNotLoaded("isNull",this._isNull,null,this._isNull),this._isNull)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isNullObject",{get:function(){return(void 0!==this.m_isNull||!u.isMock())&&(Y.throwIfNotLoaded("isNullObject",this._isNull,null,this._isNull),this._isNull)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_isNull",{get:function(){return this.m_isNull},set:function(e){this.m_isNull=e,e&&this._objectPath&&this._objectPath._updateAsNullObject()},enumerable:!0,configurable:!0}),n.prototype._addAction=function(e,t,n){return void 0===t&&(t=null),n||(this.context._pendingRequest.ensureInstantiateObjectPath(this._objectPath),this.context._pendingRequest.ensureInstantiateObjectPaths(e.referencedArgumentObjectPaths)),this.context._pendingRequest.addAction(e),this.context._pendingRequest.addReferencedObjectPath(this._objectPath),this.context._pendingRequest.addReferencedObjectPaths(e.referencedArgumentObjectPaths),this.context._pendingRequest.addActionResultHandler(e,t),d._createPromiseFromResult(null)},n.prototype._addPreviewExecutionAction=function(e){if(!Y.isUndefined(this._className)){e.ObjectType=this._className;var t=Y._getPropertyValueWithoutCheckLoaded(this,j.idLowerCase);Y.isUndefined(t)&&(t=Y._getPropertyValueWithoutCheckLoaded(this,j.idPrivate)),Y.isUndefined(t)&&(t=Y._getPropertyValueWithoutCheckLoaded(this,j.previewExecutionObjectId)),e.ObjectId=t,this.context._pendingRequest.addPreviewExecutionAction(e)}},n.prototype._handleResult=function(e){this._isNull=Y.isNullOrUndefined(e),this.context.trackedObjects._autoTrackIfNecessaryWhenHandleObjectResultValue(this,e)},n.prototype._handleIdResult=function(e){this._isNull=Y.isNullOrUndefined(e),Y.fixObjectPathIfNecessary(this,e),this.context.trackedObjects._autoTrackIfNecessaryWhenHandleObjectResultValue(this,e)},n.prototype._handleRetrieveResult=function(e,t){this._handleIdResult(e)},n.prototype._recursivelySet=function(e,t,r,o,c){var l=e instanceof n,u=e;if(l){if(Object.getPrototypeOf(this)!==Object.getPrototypeOf(e))throw i.RuntimeError._createInvalidArgError({argumentName:"properties",errorLocation:this._className+".set"});e=JSON.parse(JSON.stringify(e))}try{for(var f,p=0;p<r.length;p++)f=r[p],e.hasOwnProperty(f)&&void 0!==e[f]&&(this[f]=e[f]);for(p=0;p<o.length;p++)if(f=o[p],e.hasOwnProperty(f)&&void 0!==e[f]){var m=l?u[f]:e[f];this[f].set(m,t)}var g=!l;t&&!Y.isNullOrUndefined(g)&&(g=t.throwOnReadOnly);for(p=0;p<c.length;p++)if(f=c[p],e.hasOwnProperty(f)&&void 0!==e[f]&&g)throw new i.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:d._getResourceString(X.cannotApplyPropertyThroughSetMethod,f),debugInfo:{errorLocation:f}});for(f in e)if(r.indexOf(f)<0&&o.indexOf(f)<0){var h=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),f);if(!h)throw new i.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:d._getResourceString(w.propertyDoesNotExist,f),debugInfo:{errorLocation:f}});if(g&&!h.set)throw new i.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:d._getResourceString(w.attemptingToSetReadOnlyProperty,f),debugInfo:{errorLocation:f}})}}catch(e){throw new i.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:d._getResourceString(s.invalidArgument,"properties"),debugInfo:{errorLocation:this._className+".set"},innerError:e})}},n}(v);e.ClientObject=N;var F=function(){function e(e){this.m_session=e}return e.prototype.executeAsync=function(e,t,n){var r={url:c.processQuery,method:"POST",headers:n.Headers,body:n.Body},i="";n.Headers&&(i=n.Headers[j.officeControlId]);var a={id:o.nextId(),type:1,flags:t,controlId:i,message:r,customData:e};return d.log(JSON.stringify(a)),this.m_session.sendMessageToHost(a).then((function(e){d.log("Received response: "+JSON.stringify(e));var t,n=e.message;if(200===n.statusCode)t={HttpStatusCode:n.statusCode,ErrorCode:null,ErrorMessage:null,Headers:n.headers,Body:d._parseResponseBody(n)};else{d.log("Error Response:"+n.body);var r=d._parseErrorResponse(n);t={HttpStatusCode:n.statusCode,ErrorCode:r.errorCode,ErrorMessage:r.errorMessage,Headers:n.headers,Body:null}}return t}))},e}(),R=function(e){function t(t){var n=e.call(this)||this;return n.m_bridge=t,n.m_bridge.addHostMessageHandler((function(e){if(3===e.type){var t=e.controlId;if(d.isNullOrEmptyString(t))q.getGenericEventRegistration(t)._handleRichApiMessage(e.message);else{var n=q.peekGenericEventRegistrationOrNull(t);n&&n._handleRichApiMessage(e.message),(n=q.peekGenericEventRegistrationOrNull(""))&&n._handleRichApiMessage(e.message)}}})),n}return __extends(t,e),t.getInstanceIfHostBridgeInited=function(){return o.instance?((d.isNullOrUndefined(t.s_instance)||t.s_instance.m_bridge!==o.instance)&&(t.s_instance=new t(o.instance)),t.s_instance):null},t.prototype._resolveRequestUrlAndHeaderInfo=function(){return d._createPromiseFromResult(null)},t.prototype._createRequestExecutorOrNull=function(){return d.log("NativeBridgeSession::CreateRequestExecutor"),new F(this)},t.prototype.getEventRegistration=function(e){return q.getGenericEventRegistration(e)},t.prototype.sendMessageToHost=function(e){return this.m_bridge.sendMessageToHostAndExpectResponse(e)},t}(n);e.HostBridgeSession=R;var k=function(t){function r(e){var o=t.call(this)||this;if(o.m_customRequestHeaders={},o.m_additionalData="",o.m_batchMode=0,o._onRunFinishedNotifiers=[],n._overrideSession)o.m_requestUrlAndHeaderInfoResolver=n._overrideSession;else if((Y.isNullOrUndefined(e)||"string"==typeof e&&0===e.length)&&((e=r.defaultRequestUrlAndHeaders)||(e={url:c.localDocument,headers:{}})),"string"==typeof e)o.m_requestUrlAndHeaderInfo={url:e,headers:{}};else if(r.isRequestUrlAndHeaderInfoResolver(e))o.m_requestUrlAndHeaderInfoResolver=e;else{if(!r.isRequestUrlAndHeaderInfo(e))throw i.RuntimeError._createInvalidArgError({argumentName:"url"});var a=e;o.m_requestUrlAndHeaderInfo={url:a.url,headers:{}},d._copyHeaders(a.headers,o.m_requestUrlAndHeaderInfo.headers)}return!o.m_requestUrlAndHeaderInfoResolver&&o.m_requestUrlAndHeaderInfo&&d._isLocalDocumentUrl(o.m_requestUrlAndHeaderInfo.url)&&R.getInstanceIfHostBridgeInited()&&(o.m_requestUrlAndHeaderInfo=null,o.m_requestUrlAndHeaderInfoResolver=R.getInstanceIfHostBridgeInited()),o.m_requestUrlAndHeaderInfoResolver instanceof n&&(o.m_session=o.m_requestUrlAndHeaderInfoResolver),o._processingResult=!1,o._customData=j.iterativeExecutor,o.sync=o.sync.bind(o),o}return __extends(r,t),Object.defineProperty(r.prototype,"session",{get:function(){return this.m_session},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"eventRegistration",{get:function(){return this.m_session?this.m_session.getEventRegistration(this._controlId):i.officeJsEventRegistration},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"_url",{get:function(){return this.m_requestUrlAndHeaderInfo?this.m_requestUrlAndHeaderInfo.url:null},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"_pendingRequest",{get:function(){return null==this.m_pendingRequest&&(this.m_pendingRequest=new L(this)),this.m_pendingRequest},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"_controlId",{get:function(){var e=this.m_customRequestHeaders[j.officeControlId];return d.isNullOrUndefined(e)&&(e=""),e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"debugInfo",{get:function(){return{pendingStatements:new Q(this._rootObjectPropertyName,this._pendingRequest._objectPaths,this._pendingRequest._actions,e._internalConfig.showDisposeInfoInDebugInfo).process()}},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"trackedObjects",{get:function(){return this.m_trackedObjects||(this.m_trackedObjects=new K(this)),this.m_trackedObjects},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"requestHeaders",{get:function(){return this.m_customRequestHeaders},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"requestOptions",{set:function(e){this.m_additionalData=l._buildAdditionalData(e)},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"batchMode",{get:function(){return this.m_batchMode},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"getAdditionalHeaders",{set:function(e){this.m_getAdditionalHeaders=e},enumerable:!0,configurable:!0}),r.prototype.ensureInProgressBatchIfBatchMode=function(){if(1===this.m_batchMode&&!this.m_explicitBatchInProgress)throw Y.createRuntimeError(a.generalException,d._getResourceString(X.notInsideBatch),null)},r.prototype.load=function(e,t){Y.validateContext(this,e);var n=r._parseQueryOption(t);y.createQueryAction(this,e,n,e)},r.prototype.loadRecursive=function(e,t,n){if(!Y.isPlainJsonObject(t))throw i.RuntimeError._createInvalidArgError({argumentName:"options"});var o={};for(var a in t)o[a]=r._parseQueryOption(t[a]);var s=M.createRecursiveQueryAction(this,e,{Queries:o,MaxDepth:n});this._pendingRequest.addActionResultHandler(s,e)},r.prototype.trace=function(e){M.createTraceAction(this,e,!0)},r.prototype._processOfficeJsErrorResponse=function(e,t){},r.prototype.ensureRequestUrlAndHeaderInfo=function(){var e=this;return Y._createPromiseFromResult(null).then((function(){if(!e.m_requestUrlAndHeaderInfo)return e.m_requestUrlAndHeaderInfoResolver._resolveRequestUrlAndHeaderInfo().then((function(t){if(e.m_requestUrlAndHeaderInfo=t,e.m_requestUrlAndHeaderInfo||(e.m_requestUrlAndHeaderInfo={url:c.localDocument,headers:{}}),Y.isNullOrEmptyString(e.m_requestUrlAndHeaderInfo.url)&&(e.m_requestUrlAndHeaderInfo.url=c.localDocument),e.m_requestUrlAndHeaderInfo.headers||(e.m_requestUrlAndHeaderInfo.headers={}),"function"==typeof e.m_requestUrlAndHeaderInfoResolver._createRequestExecutorOrNull){var n=e.m_requestUrlAndHeaderInfoResolver._createRequestExecutorOrNull();n&&(e._requestExecutor=n)}}))}))},r.prototype.syncPrivateMain=function(){var e=this;return this.ensureRequestUrlAndHeaderInfo().then((function(){var t=e._pendingRequest;return e.m_pendingRequest=null,e.processPreSyncPromises(t).then((function(){return e.syncPrivate(t)}))}))},r.prototype.syncPrivate=function(t){var n=this;if(u.isMock())return d._createPromiseFromResult(null);if(!t.hasActions)return this.processPendingEventHandlers(t);var r=t.buildRequestMessageBodyAndRequestFlags(),o=r.body,a=r.flags;this._requestFlagModifier&&(a|=this._requestFlagModifier),this._requestExecutor||(d._isLocalDocumentUrl(this.m_requestUrlAndHeaderInfo.url)?this._requestExecutor=new z(this):this._requestExecutor=new E);var s=this._requestExecutor,l={};d._copyHeaders(this.m_requestUrlAndHeaderInfo.headers,l),d._copyHeaders(this.m_customRequestHeaders,l),delete this.m_customRequestHeaders[j.officeScriptEventId],this.m_getAdditionalHeaders&&d._copyHeaders(this.m_getAdditionalHeaders(),l);var f=u._getCurrentTestNameWithSequenceId();f&&(l[c.testRequestNameHeader]=f);var p={Url:this.m_requestUrlAndHeaderInfo.url,Headers:l,Body:o};t.invalidatePendingInvalidObjectPaths();var m=null,g=null;return this._lastSyncStart="undefined"==typeof performance?Date.now():performance.now(),this._lastRequestFlags=a,s.executeAsync(this._customData,a,p,this._invocationId,this.m_additionalData).then((function(r){return n._lastSyncEnd="undefined"==typeof performance?Date.now():performance.now(),e.config.executePerfLogFunc&&e.config.executePerfLogFunc({syncStart:n._lastSyncStart,syncEnd:n._lastSyncEnd}),m=n.processRequestExecutorResponseMessage(t,r),n.processPendingEventHandlers(t).catch((function(e){d.log("Error in processPendingEventHandlers"),d.log(JSON.stringify(e)),g=e}))})).then((function(){if(m)throw d.log("Throw error from response: "+JSON.stringify(m)),m;if(g){d.log("Throw error from ProcessEventHandler: "+JSON.stringify(g));var e=null;if(g instanceof i.RuntimeError)(e=g).traceMessages=t._responseTraceMessages;else{var n=null;n="string"==typeof g?g:g.message,Y.isNullOrEmptyString(n)&&(n=d._getResourceString(X.cannotRegisterEvent)),e=new i.RuntimeError({code:D.cannotRegisterEvent,httpStatusCode:400,message:n,traceMessages:t._responseTraceMessages})}throw e}}))},r.prototype.processRequestExecutorResponseMessage=function(t,n){n.Body&&n.Body.TraceIds&&t._setResponseTraceIds(n.Body.TraceIds);var r=t._responseTraceMessages,o=null;if(n.Body){if(n.Body.Error&&n.Body.Error.ActionIndex>=0){var a=new Q(this._rootObjectPropertyName,t._objectPaths,t._actions,!1,!0),s=a.processForDebugStatementInfo(n.Body.Error.ActionIndex);o={statement:s.statement,surroundingStatements:s.surroundingStatements,fullStatements:["Please enable config.extendedErrorLogging to see full statements."]},e.config.extendedErrorLogging&&(a=new Q(this._rootObjectPropertyName,t._objectPaths,t._actions,!1,!1),o.fullStatements=a.process())}var c=null;if(n.Body.Results?c=n.Body.Results:n.Body.ProcessedResults&&n.Body.ProcessedResults.Results&&(c=n.Body.ProcessedResults.Results),c){this._processingResult=!0;try{t.processResponse(c)}finally{this._processingResult=!1}}}if(!Y.isNullOrEmptyString(n.ErrorCode))return new i.RuntimeError({code:n.ErrorCode,httpStatusCode:n.HttpStatusCode,message:n.ErrorMessage,traceMessages:r,data:{responseBody:n.RawErrorResponseBody}});if(n.Body&&n.Body.Error){var l={errorLocation:n.Body.Error.Location};return o&&(l.statement=o.statement,l.surroundingStatements=o.surroundingStatements,l.fullStatements=o.fullStatements),new i.RuntimeError({code:n.Body.Error.Code,httpStatusCode:n.Body.Error.HttpStatusCode,message:n.Body.Error.Message,traceMessages:r,debugInfo:l})}return null},r.prototype.processPendingEventHandlers=function(e){for(var t=Y._createPromiseFromResult(null),n=0;n<e._pendingProcessEventHandlers.length;n++){var r=e._pendingProcessEventHandlers[n];t=t.then(this.createProcessOneEventHandlersFunc(r,e))}return t},r.prototype.createProcessOneEventHandlersFunc=function(e,t){return function(){return e._processRegistration(t)}},r.prototype.processPreSyncPromises=function(e){for(var t=Y._createPromiseFromResult(null),n=0;n<e._preSyncPromises.length;n++){var r=e._preSyncPromises[n];t=t.then(this.createProcessOneProSyncFunc(r))}return t},r.prototype.createProcessOneProSyncFunc=function(e){return function(){return e}},r.prototype.sync=function(e){return u.isMock()?d._createPromiseFromResult(e):this.syncPrivateMain().then((function(){return e}))},r.prototype.batch=function(e){var t=this;if(1!==this.m_batchMode)return d._createPromiseFromException(Y.createRuntimeError(a.generalException,null,null));if(this.m_explicitBatchInProgress)return d._createPromiseFromException(Y.createRuntimeError(a.generalException,d._getResourceString(X.pendingBatchInProgress),null));if(Y.isNullOrUndefined(e))return Y._createPromiseFromResult(null);this.m_explicitBatchInProgress=!0;var n,r,i,o=this.m_pendingRequest;this.m_pendingRequest=new L(this);try{n=e(this._rootObject,this)}catch(e){return this.m_explicitBatchInProgress=!1,this.m_pendingRequest=o,d._createPromiseFromException(e)}return"object"==typeof n&&n&&"function"==typeof n.then?i=Y._createPromiseFromResult(null).then((function(){return n})).then((function(e){return t.m_explicitBatchInProgress=!1,r=t.m_pendingRequest,t.m_pendingRequest=o,e})).catch((function(e){return t.m_explicitBatchInProgress=!1,r=t.m_pendingRequest,t.m_pendingRequest=o,d._createPromiseFromException(e)})):(this.m_explicitBatchInProgress=!1,r=this.m_pendingRequest,this.m_pendingRequest=o,i=Y._createPromiseFromResult(n)),i.then((function(e){return t.ensureRequestUrlAndHeaderInfo().then((function(){return t.syncPrivate(r)})).then((function(){return e}))}))},r._run=function(e,t,n,i,o,a){return void 0===n&&(n=3),void 0===i&&(i=5e3),r._runCommon("run",null,e,0,t,n,i,null,null,o,a)},r.isValidRequestInfo=function(e){return"string"==typeof e||r.isRequestUrlAndHeaderInfo(e)||r.isRequestUrlAndHeaderInfoResolver(e)},r.isRequestUrlAndHeaderInfo=function(e){return"object"==typeof e&&null!==e&&Object.getPrototypeOf(e)===Object.getPrototypeOf({})&&!Y.isNullOrUndefined(e.url)},r.isRequestUrlAndHeaderInfoResolver=function(e){return"object"==typeof e&&null!==e&&"function"==typeof e._resolveRequestUrlAndHeaderInfo},r._runBatch=function(e,t,n,i,o,a,s,c,l){return void 0===a&&(a=3),void 0===s&&(s=5e3),r._runBatchCommon(0,e,t,n,a,s,i,o,c,l)},r._runExplicitBatch=function(e,t,n,i,o,a,s,c,l){return void 0===a&&(a=3),void 0===s&&(s=5e3),r._runBatchCommon(1,e,t,n,a,s,i,o,c,l)},r._runBatchCommon=function(e,t,n,i,o,a,s,c,l,d){var u,f;void 0===o&&(o=3),void 0===a&&(a=5e3);var p=null,g=null,h=null,y=0,v=null;if(n.length>0)if(r.isValidRequestInfo(n[0]))p=n[0],y=1;else if(Y.isPlainJsonObject(n[0])){if(null!=(p=(v=n[0]).session)&&!r.isValidRequestInfo(p))return r.createErrorPromise(t);g=v.getAdditionalHeaders,h=v.previousObjects,y=1}if(n.length==y+1)f=n[y+0];else{if(null!=v||n.length!=y+2)return r.createErrorPromise(t);h=n[y+0],f=n[y+1]}if(null!=h)if(h instanceof N)u=function(){return h.context};else if(h instanceof r)u=function(){return h};else{if(!Array.isArray(h))return r.createErrorPromise(t);var S=h;if(0==S.length){if(!m())return r.createErrorPromise(t);u=i}else{for(var b=0;b<S.length;b++){if(!(S[b]instanceof N))return r.createErrorPromise(t);if(S[b].context!=S[0].context)return r.createErrorPromise(t,X.invalidRequestContext)}u=function(){return S[0].context}}}else u=i;var O=null;s&&(O=function(e){return s(v||{},e)});var _=null;return c&&(_=function(e){return c(v||{},e)}),r._runCommon(t,p,u,e,f,o,a,O,_,l,d,g)},r.createErrorPromise=function(e,t){return void 0===t&&(t=s.invalidArgument),d._createPromiseFromException(Y.createRuntimeError(t,d._getResourceString(t),e))},r._runCommon=function(t,i,o,a,s,c,l,u,f,p,m,g){n._overrideSession&&(i=n._overrideSession);var h,y,v,S=d.createPromise((function(e,t){e()})),b=!1;return S.then((function(){if((h=o(i)).getAdditionalHeaders=g,h._autoCleanup)return new e.Promise((function(e,t){h._onRunFinishedNotifiers.push((function(){h._autoCleanup=!0,e()}))}));h._autoCleanup=!0})).then((function(){return"function"!=typeof s?r.createErrorPromise(t):(v=h.m_batchMode,h.m_batchMode=a,u&&u(h),e=s(1==a?h.batch.bind(h):h),(Y.isNullOrUndefined(e)||"function"!=typeof e.then)&&Y.throwError(X.runMustReturnPromise),e);var e})).then((function(e){return 1===a?e:h.sync(e)})).then((function(e){b=!0,y=e})).catch((function(e){y=e})).then((function(){var e=h.trackedObjects._retrieveAndClearAutoCleanupList();for(var t in h._autoCleanup=!1,h.m_batchMode=v,e)e[t]._objectPath.isValid=!1;var n=0;if(Y._synchronousCleanup||r.isRequestUrlAndHeaderInfoResolver(i))return o();function o(){n++;var t=h.m_pendingRequest,r=h.m_batchMode,i=new L(h);h.m_pendingRequest=i,h.m_batchMode=0;try{for(var a in e)h.trackedObjects.remove(e[a]);f&&f(h)}finally{h.m_batchMode=r,h.m_pendingRequest=t}return h.syncPrivate(i).then((function(){p&&p(n)})).catch((function(){m&&m(n),n<c&&setTimeout((function(){o()}),l)}))}o()})).then((function(){h._onRunFinishedNotifiers&&h._onRunFinishedNotifiers.length>0&&h._onRunFinishedNotifiers.shift()();if(b)return y;throw y}))},r}(O);e.ClientRequestContext=k;var H=function(){function e(e,t){this.m_proxy=e,this.m_shouldPolyfill=t;var n=e[j.scalarPropertyNames],r=e[j.navigationPropertyNames],i=e[j.className],o=e[j.isCollection];if(n)for(var a=0;a<n.length;a++)Y.definePropertyThrowUnloadedException(this,i,n[a]);if(r)for(a=0;a<r.length;a++)Y.definePropertyThrowUnloadedException(this,i,r[a]);o&&Y.definePropertyThrowUnloadedException(this,i,j.itemsLowerCase)}return Object.defineProperty(e.prototype,"$proxy",{get:function(){return this.m_proxy},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"$isNullObject",{get:function(){if(!this.m_isLoaded)throw new i.RuntimeError({code:D.valueNotLoaded,httpStatusCode:400,message:d._getResourceString(X.valueNotLoaded),debugInfo:{errorLocation:"retrieveResult.$isNullObject"}});return this.m_isNullObject},enumerable:!0,configurable:!0}),e.prototype.toJSON=function(){if(this.m_isLoaded)return this.m_isNullObject?null:(Y.isUndefined(this.m_json)&&(this.m_json=Y.purifyJson(this.m_value)),this.m_json)},e.prototype.toString=function(){return JSON.stringify(this.toJSON())},e.prototype._handleResult=function(e){this.m_isLoaded=!0,null===e||"object"==typeof e&&e&&e._IsNull?(this.m_isNullObject=!0,e=null):this.m_isNullObject=!1,this.m_shouldPolyfill&&(e=Y.changePropertyNameToCamelLowerCase(e)),this.m_value=e,this.m_proxy._handleRetrieveResult(e,this)},e}(),j=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.getItemAt="GetItemAt",t.index="_Index",t.iterativeExecutor="IterativeExecutor",t.isTracked="_IsTracked",t.eventMessageCategory=65536,t.eventWorkbookId="Workbook",t.eventSourceRemote="Remote",t.proxy="$proxy",t.className="_className",t.isCollection="_isCollection",t.collectionPropertyPath="_collectionPropertyPath",t.objectPathInfoDoNotKeepReferenceFieldName="D",t.officeScriptEventId="X-OfficeScriptEventId",t.officeScriptFireRecordingEvent="X-OfficeScriptFireRecordingEvent",t.officeControlId="X-OfficeControlId",t}(I);e.Constants=j;var L=function(e){function t(t){var n=e.call(this,t)||this;return n.m_context=t,n.m_pendingProcessEventHandlers=[],n.m_pendingEventHandlerActions={},n.m_traceInfos={},n.m_responseTraceIds={},n.m_responseTraceMessages=[],n}return __extends(t,e),Object.defineProperty(t.prototype,"traceInfos",{get:function(){return this.m_traceInfos},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_responseTraceMessages",{get:function(){return this.m_responseTraceMessages},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_responseTraceIds",{get:function(){return this.m_responseTraceIds},enumerable:!0,configurable:!0}),t.prototype._setResponseTraceIds=function(e){if(e)for(var t=0;t<e.length;t++){var n=e[t];this.m_responseTraceIds[n]=n;var r=this.m_traceInfos[n];d.isNullOrUndefined(r)||this.m_responseTraceMessages.push(r)}},t.prototype.addTrace=function(e,t){this.m_traceInfos[e]=t},t.prototype._addPendingEventHandlerAction=function(e,t){this.m_pendingEventHandlerActions[e._id]||(this.m_pendingEventHandlerActions[e._id]=[],this.m_pendingProcessEventHandlers.push(e)),this.m_pendingEventHandlerActions[e._id].push(t)},Object.defineProperty(t.prototype,"_pendingProcessEventHandlers",{get:function(){return this.m_pendingProcessEventHandlers},enumerable:!0,configurable:!0}),t.prototype._getPendingEventHandlerActions=function(e){return this.m_pendingEventHandlerActions[e._id]},t}(A);e.ClientRequest=L;var U=function(){function e(e,t,n,r){var i=this;this.m_id=e._nextId(),this.m_context=e,this.m_name=n,this.m_handlers=[],this.m_registered=!1,this.m_eventInfo=r,this.m_callback=function(e){i.m_eventInfo.eventArgsTransformFunc(e).then((function(e){return i.fireEvent(e)}))}}return Object.defineProperty(e.prototype,"_registered",{get:function(){return this.m_registered},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_id",{get:function(){return this.m_id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_handlers",{get:function(){return this.m_handlers},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_context",{get:function(){return this.m_context},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_callback",{get:function(){return this.m_callback},enumerable:!0,configurable:!0}),e.prototype.add=function(e){var t=M.createTraceAction(this.m_context,null,!1);return this.m_context._pendingRequest._addPendingEventHandlerAction(this,{id:t.actionInfo.Id,handler:e,operation:0}),new B(this.m_context,this,e)},e.prototype.remove=function(e){var t=M.createTraceAction(this.m_context,null,!1);this.m_context._pendingRequest._addPendingEventHandlerAction(this,{id:t.actionInfo.Id,handler:e,operation:1})},e.prototype.removeAll=function(){var e=M.createTraceAction(this.m_context,null,!1);this.m_context._pendingRequest._addPendingEventHandlerAction(this,{id:e.actionInfo.Id,handler:null,operation:2})},e.prototype._processRegistration=function(e){var t=this,n=d._createPromiseFromResult(null),r=e._getPendingEventHandlerActions(this);if(!r)return n;for(var i=[],o=0;o<this.m_handlers.length;o++)i.push(this.m_handlers[o]);var a=!1;for(o=0;o<r.length;o++)if(e._responseTraceIds[r[o].id])switch(a=!0,r[o].operation){case 0:i.push(r[o].handler);break;case 1:for(var s=i.length-1;s>=0;s--)if(i[s]===r[o].handler){i.splice(s,1);break}break;case 2:i=[]}return a&&(!this.m_registered&&i.length>0?n=n.then((function(){return t.m_eventInfo.registerFunc(t.m_callback)})).then((function(){return t.m_registered=!0})):this.m_registered&&0==i.length&&(n=n.then((function(){return t.m_eventInfo.unregisterFunc(t.m_callback)})).catch((function(e){d.log("Error when unregister event: "+JSON.stringify(e))})).then((function(){return t.m_registered=!1}))),n=n.then((function(){return t.m_handlers=i}))),n},e.prototype.fireEvent=function(e){for(var t=[],n=0;n<this.m_handlers.length;n++){var r=this.m_handlers[n],i=d._createPromiseFromResult(null).then(this.createFireOneEventHandlerFunc(r,e)).catch((function(e){d.log("Error when invoke handler: "+JSON.stringify(e))}));t.push(i)}d.Promise.all(t)},e.prototype.createFireOneEventHandlerFunc=function(e,t){return function(){return e(t)}},e}();e.EventHandlers=U;var B=function(){function e(e,t,n){this.m_context=e,this.m_allHandlers=t,this.m_handler=n}return Object.defineProperty(e.prototype,"context",{get:function(){return this.m_context},enumerable:!0,configurable:!0}),e.prototype.remove=function(){this.m_allHandlers&&this.m_handler&&(this.m_allHandlers.remove(this.m_handler),this.m_allHandlers=null,this.m_handler=null)},e}();e.EventHandlerResult=B,function(e){var t=function(){function t(){}return t.prototype.register=function(t,n,r){switch(t){case 4:return Y.promisify((function(e){return Office.context.document.bindings.getByIdAsync(n,e)})).then((function(e){return Y.promisify((function(t){return e.addHandlerAsync(Office.EventType.BindingDataChanged,r,t)}))}));case 3:return Y.promisify((function(e){return Office.context.document.bindings.getByIdAsync(n,e)})).then((function(e){return Y.promisify((function(t){return e.addHandlerAsync(Office.EventType.BindingSelectionChanged,r,t)}))}));case 2:return Y.promisify((function(e){return Office.context.document.addHandlerAsync(Office.EventType.DocumentSelectionChanged,r,e)}));case 1:return Y.promisify((function(e){return Office.context.document.settings.addHandlerAsync(Office.EventType.SettingsChanged,r,e)}));case 5:return OSF.DDA.RichApi.richApiMessageManager.register(r);case 13:return Y.promisify((function(e){return Office.context.document.addHandlerAsync(Office.EventType.ObjectDeleted,r,{id:n},e)}));case 14:return Y.promisify((function(e){return Office.context.document.addHandlerAsync(Office.EventType.ObjectSelectionChanged,r,{id:n},e)}));case 15:return Y.promisify((function(e){return Office.context.document.addHandlerAsync(Office.EventType.ObjectDataChanged,r,{id:n},e)}));case 16:return Y.promisify((function(e){return Office.context.document.addHandlerAsync(Office.EventType.ContentControlAdded,r,{id:n},e)}));default:throw e.RuntimeError._createInvalidArgError({argumentName:"eventId"})}},t.prototype.unregister=function(t,n,r){switch(t){case 4:return Y.promisify((function(e){return Office.context.document.bindings.getByIdAsync(n,e)})).then((function(e){return Y.promisify((function(t){return e.removeHandlerAsync(Office.EventType.BindingDataChanged,{handler:r},t)}))}));case 3:return Y.promisify((function(e){return Office.context.document.bindings.getByIdAsync(n,e)})).then((function(e){return Y.promisify((function(t){return e.removeHandlerAsync(Office.EventType.BindingSelectionChanged,{handler:r},t)}))}));case 2:return Y.promisify((function(e){return Office.context.document.removeHandlerAsync(Office.EventType.DocumentSelectionChanged,{handler:r},e)}));case 1:return Y.promisify((function(e){return Office.context.document.settings.removeHandlerAsync(Office.EventType.SettingsChanged,{handler:r},e)}));case 5:return Y.promisify((function(e){return OSF.DDA.RichApi.richApiMessageManager.removeHandlerAsync("richApiMessage",{handler:r},e)}));case 13:return Y.promisify((function(e){return Office.context.document.removeHandlerAsync(Office.EventType.ObjectDeleted,{id:n,handler:r},e)}));case 14:return Y.promisify((function(e){return Office.context.document.removeHandlerAsync(Office.EventType.ObjectSelectionChanged,{id:n,handler:r},e)}));case 15:return Y.promisify((function(e){return Office.context.document.removeHandlerAsync(Office.EventType.ObjectDataChanged,{id:n,handler:r},e)}));case 16:return Y.promisify((function(e){return Office.context.document.removeHandlerAsync(Office.EventType.ContentControlAdded,{id:n,handler:r},e)}));default:throw e.RuntimeError._createInvalidArgError({argumentName:"eventId"})}},t}();e.officeJsEventRegistration=new t}(i=e._Internal||(e._Internal={}));var W=function(){function e(e,t){this.m_handlersByEventByTarget={},this.m_registerEventImpl=e,this.m_unregisterEventImpl=t}return e.getTargetIdOrDefault=function(e){return Y.isNullOrUndefined(e)?"":e},e.prototype.getHandlers=function(t,n){n=e.getTargetIdOrDefault(n);var r=this.m_handlersByEventByTarget[t];r||(r={},this.m_handlersByEventByTarget[t]=r);var i=r[n];return i||(i=[],r[n]=i),i},e.prototype.callHandlers=function(e,t,n){for(var r=this.getHandlers(e,t),i=0;i<r.length;i++)r[i](n)},e.prototype.hasHandlers=function(e,t){return this.getHandlers(e,t).length>0},e.prototype.register=function(e,t,n){if(!n)throw i.RuntimeError._createInvalidArgError({argumentName:"handler"});var r=this.getHandlers(e,t);return r.push(n),1===r.length?this.m_registerEventImpl(e,t):Y._createPromiseFromResult(null)},e.prototype.unregister=function(e,t,n){if(!n)throw i.RuntimeError._createInvalidArgError({argumentName:"handler"});for(var r=this.getHandlers(e,t),o=r.length-1;o>=0;o--)if(r[o]===n){r.splice(o,1);break}return 0===r.length?this.m_unregisterEventImpl(e,t):Y._createPromiseFromResult(null)},e}();e.EventRegistration=W;var q=function(){function e(){this.m_eventRegistration=new W(this._registerEventImpl.bind(this),this._unregisterEventImpl.bind(this)),this.m_richApiMessageHandler=this._handleRichApiMessage.bind(this)}return e.prototype.ready=function(){var t=this;return this.m_ready||(e._testReadyImpl?this.m_ready=e._testReadyImpl().then((function(){t.m_isReady=!0})):o.instance?this.m_ready=Y._createPromiseFromResult(null).then((function(){t.m_isReady=!0})):this.m_ready=i.officeJsEventRegistration.register(5,"",this.m_richApiMessageHandler).then((function(){t.m_isReady=!0}))),this.m_ready},Object.defineProperty(e.prototype,"isReady",{get:function(){return this.m_isReady},enumerable:!0,configurable:!0}),e.prototype.register=function(e,t,n){var r=this;return this.ready().then((function(){return r.m_eventRegistration.register(e,t,n)}))},e.prototype.unregister=function(e,t,n){var r=this;return this.ready().then((function(){return r.m_eventRegistration.unregister(e,t,n)}))},e.prototype._registerEventImpl=function(e,t){return Y._createPromiseFromResult(null)},e.prototype._unregisterEventImpl=function(e,t){return Y._createPromiseFromResult(null)},e.prototype._handleRichApiMessage=function(e){if(e&&e.entries)for(var t=0;t<e.entries.length;t++){var n=e.entries[t];if(n.messageCategory==j.eventMessageCategory){d._logEnabled&&d.log(JSON.stringify(n));var r=n.messageType,i=n.targetId;if(this.m_eventRegistration.hasHandlers(r,i)){var o=JSON.parse(n.message);n.isRemoteOverride&&(o.source=j.eventSourceRemote),this.m_eventRegistration.callHandlers(r,i,o)}}}},e.getGenericEventRegistration=function(t){d.isNullOrUndefined(t)&&(t="");var n=e.s_genericEventRegistrations[t];return n||(n=new e,e.s_genericEventRegistrations[t]=n),n},e.peekGenericEventRegistrationOrNull=function(t){return d.isNullOrUndefined(t)&&(t=""),e.s_genericEventRegistrations[t]},e.richApiMessageEventCategory=65536,e.s_genericEventRegistrations={},e}();e.GenericEventRegistration=q,e._testSetRichApiMessageReadyImpl=function(e){q._testReadyImpl=e},e._testTriggerRichApiMessageEvent=function(e){q.getGenericEventRegistration("")._handleRichApiMessage(e)};var V=function(e){function t(t,n,r,i){var o=e.call(this,t,n,r,i)||this;return o.m_genericEventInfo=i,o}return __extends(t,e),t.prototype.add=function(e){var t=this;0==this._handlers.length&&this.m_genericEventInfo.registerFunc&&this.m_genericEventInfo.registerFunc();var n=this._context._controlId;return q.getGenericEventRegistration(n).isReady||this._context._pendingRequest._addPreSyncPromise(q.getGenericEventRegistration(n).ready()),M.createTraceMarkerForCallback(this._context,(function(){t._handlers.push(e),1==t._handlers.length&&q.getGenericEventRegistration(n).register(t.m_genericEventInfo.eventType,t.m_genericEventInfo.getTargetIdFunc(),t._callback)})),new B(this._context,this,e)},t.prototype.remove=function(e){var t=this;1==this._handlers.length&&this.m_genericEventInfo.unregisterFunc&&this.m_genericEventInfo.unregisterFunc();var n=this._context._controlId;M.createTraceMarkerForCallback(this._context,(function(){for(var r=t._handlers,i=r.length-1;i>=0;i--)if(r[i]===e){r.splice(i,1);break}0==r.length&&q.getGenericEventRegistration(n).unregister(t.m_genericEventInfo.eventType,t.m_genericEventInfo.getTargetIdFunc(),t._callback)}))},t.prototype.removeAll=function(){},t}(U);e.GenericEventHandlers=V;var J=function(){function e(e){this.m_clientObject=e}return e.prototype._handleResult=function(e){this.m_clientObject._handleIdResult(e)},e}(),G=function(){function e(){}return e.createGlobalObjectObjectPath=function(e){var t={Id:e._nextId(),ObjectPathType:1,Name:""};return new b(t,null,!1,!1,1,4)},e.createNewObjectObjectPath=function(e,t,n,r){var i={Id:e._nextId(),ObjectPathType:2,Name:t};return new b(i,null,n,!1,1,Y._fixupApiFlags(r))},e.createPropertyObjectPath=function(e,t,n,r,i,o){var a={Id:e._nextId(),ObjectPathType:4,Name:n,ParentObjectPathId:t._objectPath.objectPathInfo.Id};return new b(a,t._objectPath,r,i,1,Y._fixupApiFlags(o))},e.createIndexerObjectPath=function(e,t,n){var r={Id:e._nextId(),ObjectPathType:5,Name:"",ParentObjectPathId:t._objectPath.objectPathInfo.Id,ArgumentInfo:{}};return r.ArgumentInfo.Arguments=n,new b(r,t._objectPath,!1,!1,1,4)},e.createIndexerObjectPathUsingParentPath=function(e,t,n){var r={Id:e._nextId(),ObjectPathType:5,Name:"",ParentObjectPathId:t.objectPathInfo.Id,ArgumentInfo:{}};return r.ArgumentInfo.Arguments=n,new b(r,t,!1,!1,1,4)},e.createMethodObjectPath=function(e,t,n,r,i,o,a,s,c){var l={Id:e._nextId(),ObjectPathType:3,Name:n,ParentObjectPathId:t._objectPath.objectPathInfo.Id,ArgumentInfo:{}},d=Y.setMethodArguments(e,l.ArgumentInfo,i),u=new b(l,t._objectPath,o,a,r,Y._fixupApiFlags(c));return u.argumentObjectPaths=d,u.getByIdMethodName=s,u},e.createReferenceIdObjectPath=function(e,t){var n={Id:e._nextId(),ObjectPathType:6,Name:t,ArgumentInfo:{}};return new b(n,null,!1,!1,1,4)},e.createChildItemObjectPathUsingIndexerOrGetItemAt=function(t,n,r,i,o){var a=Y.tryGetObjectIdFromLoadOrRetrieveResult(i);return t&&!Y.isNullOrUndefined(a)?e.createChildItemObjectPathUsingIndexer(n,r,i):e.createChildItemObjectPathUsingGetItemAt(n,r,i,o)},e.createChildItemObjectPathUsingIndexer=function(e,t,n){var r=Y.tryGetObjectIdFromLoadOrRetrieveResult(n),i=i={Id:e._nextId(),ObjectPathType:5,Name:"",ParentObjectPathId:t._objectPath.objectPathInfo.Id,ArgumentInfo:{}};return i.ArgumentInfo.Arguments=[r],new b(i,t._objectPath,!1,!1,1,4)},e.createChildItemObjectPathUsingGetItemAt=function(e,t,n,r){var i=n[j.index];i&&(r=i);var o={Id:e._nextId(),ObjectPathType:3,Name:j.getItemAt,ParentObjectPathId:t._objectPath.objectPathInfo.Id,ArgumentInfo:{}};return o.ArgumentInfo.Arguments=[r],new b(o,t._objectPath,!1,!1,1,4)},e}();e.ObjectPathFactory=G;var z=function(){function t(e){this.m_context=e}return t.prototype.executeAsync=function(n,r,i,o,a){var s=this,c=l.buildMessageArrayForIRequestExecutor(n,r,i,t.SourceLibHeaderValue,o,a),u=this.m_context._blockWrite&&0!=(1&r);if(u)throw"Block Write: "+u;return new e.Promise((function(e,n){var r=!1,i=function(){OSF.DDA.RichApi.executeRichApiRequestAsync(c,(function(n){var o;if(d.log("Response:"),d.log(JSON.stringify(n)),"succeeded"==n.status)r&&t._logDeletedSheetRetry("succeeded"),o=l.buildResponseOnSuccess(l.getResponseBody(n),l.getResponseHeaders(n));else{if(t._shouldRetryOnDeletedSheet(n.error.code)){if(!r)return r=!0,t._logDeletedSheetRetry("attempted"),void setTimeout(i,t.DeletedSheetRetryDelayInMs);t._logDeletedSheetRetry("exhausted")}o=l.buildResponseOnError(n.error.code,n.error.message),s.m_context._processOfficeJsErrorResponse(n.error.code,o)}e(o)}))};i()}))},t._shouldRetryOnDeletedSheet=function(e){return g()&&t._isExcelOnTheWeb()&&e===t.InvalidSheetNameErrorCode},t._isExcelOnTheWeb=function(){try{var e="undefined"!=typeof self?self:"undefined"!=typeof window?window:null,t=e&&e.Office&&e.Office.context;return!(!t||"OfficeOnline"!==t.platform)&&(!t.host||"Excel"===t.host)}catch(e){return!1}},t._logDeletedSheetRetry=function(e){try{var t="undefined"!=typeof self?self:"undefined"!=typeof window?window:null,n=t&&t.OSF&&t.OSF.AppTelemetry;n&&"function"==typeof n.logAppCommonMessage&&n.logAppCommonMessage("RichApi.ExcelWebDeletedSheetRetry."+e)}catch(e){}},t.SourceLibHeaderValue="officejs",t.InvalidSheetNameErrorCode=1014,t.DeletedSheetRetryDelayInMs=50,t}(),K=function(){function e(e){this._autoCleanupList={},this.m_context=e}return e.prototype.add=function(e){var t=this;Array.isArray(e)?e.forEach((function(e){return t._addCommon(e,!0)})):this._addCommon(e,!0)},e.prototype._autoAdd=function(e){this._addCommon(e,!1),this._autoCleanupList[e._objectPath.objectPathInfo.Id]=e},e.prototype._autoTrackIfNecessaryWhenHandleObjectResultValue=function(e,t){this.m_context._autoCleanup&&!e[j.isTracked]&&e!==this.m_context._rootObject&&t&&!Y.isNullOrEmptyString(t[j.referenceId])&&(this._autoCleanupList[e._objectPath.objectPathInfo.Id]=e,e[j.isTracked]=!0)},e.prototype._addCommon=function(e,t){if(e[j.isTracked])t&&this.m_context._autoCleanup&&delete this._autoCleanupList[e._objectPath.objectPathInfo.Id];else{var n=e[j.referenceId];if(e._objectPath.objectPathInfo[j.objectPathInfoDoNotKeepReferenceFieldName])throw Y.createRuntimeError(a.generalException,d._getResourceString(X.objectIsUntracked),null);Y.isNullOrEmptyString(n)&&e._KeepReference&&(e._KeepReference(),M.createInstantiateAction(this.m_context,e),t&&this.m_context._autoCleanup&&delete this._autoCleanupList[e._objectPath.objectPathInfo.Id],e[j.isTracked]=!0)}},e.prototype.remove=function(e){var t=this;Array.isArray(e)?e.forEach((function(e){return t._removeCommon(e)})):this._removeCommon(e)},e.prototype._removeCommon=function(e){e._objectPath.objectPathInfo[j.objectPathInfoDoNotKeepReferenceFieldName]=!0,e.context._pendingRequest._removeKeepReferenceAction(e._objectPath.objectPathInfo.Id);var t=e[j.referenceId];if(!Y.isNullOrEmptyString(t)){var n=this.m_context._rootObject;n._RemoveReference&&n._RemoveReference(t)}delete e[j.isTracked]},e.prototype._retrieveAndClearAutoCleanupList=function(){var e=this._autoCleanupList;return this._autoCleanupList={},e},e}();e.TrackedObjects=K;var Q=function(){function t(e,t,n,r,i){e||(e="root"),this.m_globalObjName=e,this.m_referencedObjectPaths=t,this.m_actions=n,this.m_statements=[],this.m_variableNameForObjectPathMap={},this.m_variableNameToObjectPathMap={},this.m_declaredObjectPathMap={},this.m_showDispose=r,this.m_removePII=i}return t.prototype.process=function(){this.m_showDispose&&L._calculateLastUsedObjectPathIds(this.m_actions);for(var e=0;e<this.m_actions.length;e++)this.processOneAction(this.m_actions[e]);return this.m_statements},t.prototype.processForDebugStatementInfo=function(e){this.m_showDispose&&L._calculateLastUsedObjectPathIds(this.m_actions);this.m_statements=[];for(var t=-1,n=0;n<this.m_actions.length&&(this.processOneAction(this.m_actions[n]),e==n&&(t=this.m_statements.length-1),!(t>=0&&this.m_statements.length>t+5+1));n++);if(t<0)return null;var r=t-5;r<0&&(r=0);var i=t+1+5;i>this.m_statements.length&&(i=this.m_statements.length);var o=[];0!=r&&o.push("...");for(var a=r;a<t;a++)o.push(this.m_statements[a]);o.push("// >>>>>"),o.push(this.m_statements[t]),o.push("// <<<<<");for(var s=t+1;s<i;s++)o.push(this.m_statements[s]);return i<this.m_statements.length&&o.push("..."),{statement:this.m_statements[t],surroundingStatements:o}},t.prototype.processOneAction=function(e){switch(e.actionInfo.ActionType){case 1:this.processInstantiateAction(e);break;case 3:this.processMethodAction(e);break;case 2:this.processQueryAction(e);break;case 7:this.processQueryAsJsonAction(e);break;case 6:this.processRecursiveQueryAction(e);break;case 4:this.processSetPropertyAction(e);break;case 5:this.processTraceAction(e);break;case 8:this.processEnsureUnchangedAction(e);break;case 9:this.processUpdateAction(e)}},t.prototype.processInstantiateAction=function(e){var t=e.actionInfo.ObjectPathId,n=this.m_referencedObjectPaths[t],r=this.getObjVarName(t);if(this.m_declaredObjectPathMap[t]){i="// Instantiate {"+r+"}";i=this.appendDisposeCommentIfRelevant(i,e),this.m_statements.push(i)}else{var i="var "+r+" = "+this.buildObjectPathExpressionWithParent(n)+";";i=this.appendDisposeCommentIfRelevant(i,e),this.m_statements.push(i),this.m_declaredObjectPathMap[t]=r}},t.prototype.processMethodAction=function(t){var n=t.actionInfo.Name;if("_KeepReference"===n){if(!e._internalConfig.showInternalApiInDebugInfo)return;n="track"}var r=this.getObjVarName(t.actionInfo.ObjectPathId)+"."+Y._toCamelLowerCase(n)+"("+this.buildArgumentsExpression(t.actionInfo.ArgumentInfo)+");";r=this.appendDisposeCommentIfRelevant(r,t),this.m_statements.push(r)},t.prototype.processQueryAction=function(e){var t=this.buildQueryExpression(e),n=this.getObjVarName(e.actionInfo.ObjectPathId)+".load("+t+");";n=this.appendDisposeCommentIfRelevant(n,e),this.m_statements.push(n)},t.prototype.processQueryAsJsonAction=function(e){var t=this.buildQueryExpression(e),n=this.getObjVarName(e.actionInfo.ObjectPathId)+".retrieve("+t+");";n=this.appendDisposeCommentIfRelevant(n,e),this.m_statements.push(n)},t.prototype.processRecursiveQueryAction=function(e){var t="";e.actionInfo.RecursiveQueryInfo&&(t=JSON.stringify(e.actionInfo.RecursiveQueryInfo));var n=this.getObjVarName(e.actionInfo.ObjectPathId)+".loadRecursive("+t+");";n=this.appendDisposeCommentIfRelevant(n,e),this.m_statements.push(n)},t.prototype.processSetPropertyAction=function(e){var t=this.getObjVarName(e.actionInfo.ObjectPathId)+"."+Y._toCamelLowerCase(e.actionInfo.Name)+" = "+this.buildArgumentsExpression(e.actionInfo.ArgumentInfo)+";";t=this.appendDisposeCommentIfRelevant(t,e),this.m_statements.push(t)},t.prototype.processTraceAction=function(e){var t="context.trace();";t=this.appendDisposeCommentIfRelevant(t,e),this.m_statements.push(t)},t.prototype.processEnsureUnchangedAction=function(e){var t=this.getObjVarName(e.actionInfo.ObjectPathId)+".ensureUnchanged("+JSON.stringify(e.actionInfo.ObjectState)+");";t=this.appendDisposeCommentIfRelevant(t,e),this.m_statements.push(t)},t.prototype.processUpdateAction=function(e){var t=this.getObjVarName(e.actionInfo.ObjectPathId)+".update("+JSON.stringify(e.actionInfo.ObjectState)+");";t=this.appendDisposeCommentIfRelevant(t,e),this.m_statements.push(t)},t.prototype.appendDisposeCommentIfRelevant=function(e,t){var n=this;if(this.m_showDispose){var r=t.actionInfo.L;if(r&&r.length>0)return e+" // And then dispose {"+r.map((function(e){return n.getObjVarName(e)})).join(", ")+"}"}return e},t.prototype.buildQueryExpression=function(e){if(e.actionInfo.QueryInfo){var t={};return t.select=e.actionInfo.QueryInfo.Select,t.expand=e.actionInfo.QueryInfo.Expand,t.skip=e.actionInfo.QueryInfo.Skip,t.top=e.actionInfo.QueryInfo.Top,void 0===t.top&&void 0===t.skip&&void 0===t.expand?void 0===t.select?"":JSON.stringify(t.select):JSON.stringify(t)}return""},t.prototype.buildObjectPathExpressionWithParent=function(e){return(5==e.objectPathInfo.ObjectPathType||3==e.objectPathInfo.ObjectPathType||4==e.objectPathInfo.ObjectPathType)&&e.objectPathInfo.ParentObjectPathId?this.getObjVarName(e.objectPathInfo.ParentObjectPathId)+"."+this.buildObjectPathExpression(e):this.buildObjectPathExpression(e)},t.prototype.buildObjectPathExpression=function(e){var t=this.buildObjectPathInfoExpression(e.objectPathInfo),n=e.originalObjectPathInfo;return n&&(t=t+" /* originally "+this.buildObjectPathInfoExpression(n)+" */"),t},t.prototype.buildObjectPathInfoExpression=function(e){switch(e.ObjectPathType){case 1:return"context."+this.m_globalObjName;case 5:return"getItem("+this.buildArgumentsExpression(e.ArgumentInfo)+")";case 3:return Y._toCamelLowerCase(e.Name)+"("+this.buildArgumentsExpression(e.ArgumentInfo)+")";case 2:return e.Name+".newObject()";case 7:return"null";case 4:return Y._toCamelLowerCase(e.Name);case 6:return"context."+this.m_globalObjName+"._getObjectByReferenceId("+JSON.stringify(e.Name)+")"}},t.prototype.buildArgumentsExpression=function(e){var t="";if(!e.Arguments||0===e.Arguments.length)return t;if(this.m_removePII)return void 0===e.Arguments[0]?t:"...";for(var n=0;n<e.Arguments.length;n++)n>0&&(t+=", "),t+=this.buildArgumentLiteral(e.Arguments[n],e.ReferencedObjectPathIds?e.ReferencedObjectPathIds[n]:null);return"undefined"===t&&(t=""),t},t.prototype.buildArgumentLiteral=function(e,t){return"number"==typeof e&&e===t?this.getObjVarName(t):JSON.stringify(e)},t.prototype.getObjVarNameBase=function(e){var t="v",n=this.m_referencedObjectPaths[e];if(n)switch(n.objectPathInfo.ObjectPathType){case 1:t=this.m_globalObjName;break;case 4:t=Y._toCamelLowerCase(n.objectPathInfo.Name);break;case 3:var r=n.objectPathInfo.Name;r.length>3&&"Get"===r.substr(0,3)&&(r=r.substr(3)),t=Y._toCamelLowerCase(r);break;case 5:var i=this.getObjVarNameBase(n.objectPathInfo.ParentObjectPathId);t="s"===i.charAt(i.length-1)?i.substr(0,i.length-1):i+"Item"}return t},t.prototype.getObjVarName=function(e){if(this.m_variableNameForObjectPathMap[e])return this.m_variableNameForObjectPathMap[e];var t=this.getObjVarNameBase(e);if(!this.m_variableNameToObjectPathMap[t])return this.m_variableNameForObjectPathMap[e]=t,this.m_variableNameToObjectPathMap[t]=e,t;for(var n=1;this.m_variableNameToObjectPathMap[t+n.toString()];)n++;return t+=n.toString(),this.m_variableNameForObjectPathMap[e]=t,this.m_variableNameToObjectPathMap[t]=e,t},t}(),X=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.cannotRegisterEvent="CannotRegisterEvent",t.connectionFailureWithStatus="ConnectionFailureWithStatus",t.connectionFailureWithDetails="ConnectionFailureWithDetails",t.propertyNotLoaded="PropertyNotLoaded",t.runMustReturnPromise="RunMustReturnPromise",t.moreInfoInnerError="MoreInfoInnerError",t.cannotApplyPropertyThroughSetMethod="CannotApplyPropertyThroughSetMethod",t.invalidOperationInCellEditMode="InvalidOperationInCellEditMode",t.objectIsUntracked="ObjectIsUntracked",t.customFunctionDefintionMissing="CustomFunctionDefintionMissing",t.customFunctionImplementationMissing="CustomFunctionImplementationMissing",t.customFunctionNameContainsBadChars="CustomFunctionNameContainsBadChars",t.customFunctionNameCannotSplit="CustomFunctionNameCannotSplit",t.customFunctionUnexpectedNumberOfEntriesInResultBatch="CustomFunctionUnexpectedNumberOfEntriesInResultBatch",t.customFunctionCancellationHandlerMissing="CustomFunctionCancellationHandlerMissing",t.customFunctionInvalidFunction="CustomFunctionInvalidFunction",t.customFunctionInvalidFunctionMapping="CustomFunctionInvalidFunctionMapping",t.customFunctionWindowMissing="CustomFunctionWindowMissing",t.customFunctionDefintionMissingOnWindow="CustomFunctionDefintionMissingOnWindow",t.pendingBatchInProgress="PendingBatchInProgress",t.notInsideBatch="NotInsideBatch",t.cannotUpdateReadOnlyProperty="CannotUpdateReadOnlyProperty",t}(w);e.ResourceStrings=X,d.addResourceStringValues({CannotRegisterEvent:"The event handler cannot be registered.",PropertyNotLoaded:"The property '{0}' is not available. Before reading the property's value, call the load method on the containing object and call \"context.sync()\" on the associated request context.",RunMustReturnPromise:'The batch function passed to the ".run" method didn\'t return a promise. The function must return a promise, so that any automatically-tracked objects can be released at the completion of the batch operation. Typically, you return a promise by returning the response from "context.sync()".',InvalidOrTimedOutSessionMessage:"Your Office Online session has expired or is invalid. To continue, refresh the page.",InvalidOperationInCellEditMode:"Excel is in cell-editing mode. Please exit the edit mode by pressing ENTER or TAB or selecting another cell, and then try again.",InvalidSheetName:"The request cannot be processed because the specified worksheet cannot be found. Please try again.",CustomFunctionDefintionMissing:"A property with the name '{0}' that represents the function's definition must exist on Excel.Script.CustomFunctions.",CustomFunctionDefintionMissingOnWindow:"A property with the name '{0}' that represents the function's definition must exist on the window object.",CustomFunctionImplementationMissing:"The property with the name '{0}' on Excel.Script.CustomFunctions that represents the function's definition must contain a 'call' property that implements the function.",CustomFunctionNameContainsBadChars:"The function name may only contain letters, digits, underscores, and periods.",CustomFunctionNameCannotSplit:"The function name must contain a non-empty namespace and a non-empty short name.",CustomFunctionUnexpectedNumberOfEntriesInResultBatch:"The batching function returned a number of results that doesn't match the number of parameter value sets that were passed into it.",CustomFunctionCancellationHandlerMissing:"The cancellation handler onCanceled is missing in the function. The handler must be present as the function is defined as cancelable.",CustomFunctionInvalidFunction:"The property with the name '{0}' that represents the function's definition is not a valid function.",CustomFunctionInvalidFunctionMapping:"The property with the name '{0}' on CustomFunctionMappings that represents the function's definition is not a valid function.",CustomFunctionWindowMissing:"The window object was not found.",PendingBatchInProgress:"There is a pending batch in progress. The batch method may not be called inside another batch, or simultaneously with another batch.",NotInsideBatch:"Operations may not be invoked outside of a batch method.",CannotUpdateReadOnlyProperty:"The property '{0}' is read-only and it cannot be updated.",ObjectIsUntracked:"The object is untracked."});var Y=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),n.fixObjectPathIfNecessary=function(e,t){e&&e._objectPath&&t&&e._objectPath.updateUsingObjectData(t,e)},n.load=function(e,t){return e.context.load(e,t),e},n.loadAndSync=function(e,t){return e.context.load(e,t),e.context.sync().then((function(){return e}))},n.retrieve=function(t,r){var i=e._internalConfig.alwaysPolyfillClientObjectRetrieveMethod;i||(i=!n.isSetSupported("RichApiRuntime","1.1"));var o=new H(t,i);return t._retrieve(r,o),o},n.retrieveAndSync=function(e,t){var r=n.retrieve(e,t);return e.context.sync().then((function(){return r}))},n.toJson=function(e,t,r,i){var o={};for(var a in t){void 0!==(s=t[a])&&(o[a]=s)}for(var a in r){var s;void 0!==(s=r[a])&&(s[n.fieldName_isCollection]&&void 0!==s[n.fieldName_m__items]?o[a]=s.toJSON().items:o[a]=s.toJSON())}return i&&(o.items=i.map((function(e){return e.toJSON()}))),o},n.throwError=function(e,t,n){throw new i.RuntimeError({code:e,httpStatusCode:400,message:d._getResourceString(e,t),debugInfo:n?{errorLocation:n}:void 0})},n.createRuntimeError=function(e,t,n,r,o){return new i.RuntimeError({code:e,httpStatusCode:r,message:t,debugInfo:{errorLocation:n},data:o})},n.throwIfNotLoaded=function(e,t,r,i){if(!i&&d.isUndefined(t)&&e.charCodeAt(0)!=n.s_underscoreCharCode&&!n.s_suppressPropertyNotLoadedException)throw n.createPropertyNotLoadedException(r,e)},n._getPropertyValueWithoutCheckLoaded=function(e,t){n.s_suppressPropertyNotLoadedException=!0;try{return e[t]}finally{n.s_suppressPropertyNotLoadedException=!1}},n.createPropertyNotLoadedException=function(e,t){return new i.RuntimeError({code:D.propertyNotLoaded,httpStatusCode:400,message:d._getResourceString(X.propertyNotLoaded,t),debugInfo:e?{errorLocation:e+"."+t}:void 0})},n.createCannotUpdateReadOnlyPropertyException=function(e,t){return new i.RuntimeError({code:D.cannotUpdateReadOnlyProperty,httpStatusCode:400,message:d._getResourceString(X.cannotUpdateReadOnlyProperty,t),debugInfo:e?{errorLocation:e+"."+t}:void 0})},n.promisify=function(t){return new e.Promise((function(e,n){t((function(t){"failed"==t.status?n(t.error):e(t.value)}))}))},n._addActionResultHandler=function(e,t,n){e.context._pendingRequest.addActionResultHandler(t,n)},n._handleNavigationPropertyResults=function(e,t,n){for(var r=0;r<n.length-1;r+=2)d.isUndefined(t[n[r+1]])||e[n[r]]._handleResult(t[n[r+1]])},n._fixupApiFlags=function(e){return"boolean"==typeof e&&(e=e?1:0),e},n.definePropertyThrowUnloadedException=function(e,t,r){Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get:function(){throw n.createPropertyNotLoadedException(t,r)},set:function(){throw n.createCannotUpdateReadOnlyPropertyException(t,r)}})},n.defineReadOnlyPropertyWithValue=function(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return r},set:function(){throw n.createCannotUpdateReadOnlyPropertyException(null,t)}})},n.processRetrieveResult=function(e,t,r,i){if(!d.isNullOrUndefined(t))if(i){var o=t[j.itemsLowerCase];if(Array.isArray(o)){for(var a=[],s=0;s<o.length;s++){var c=i(o[s],s),l={};l[j.proxy]=c,c._handleRetrieveResult(o[s],l),a.push(l)}n.defineReadOnlyPropertyWithValue(r,j.itemsLowerCase,a)}}else{var u=e[j.scalarPropertyNames],f=e[j.navigationPropertyNames],p=e[j.className];if(u)for(s=0;s<u.length;s++){var m=t[g=u[s]];d.isUndefined(m)?n.definePropertyThrowUnloadedException(r,p,g):n.defineReadOnlyPropertyWithValue(r,g,m)}if(f)for(s=0;s<f.length;s++){var g;m=t[g=f[s]];if(d.isUndefined(m))n.definePropertyThrowUnloadedException(r,p,g);else{var h=e[g],y={};h._handleRetrieveResult(m,y),y[j.proxy]=h,Array.isArray(y[j.itemsLowerCase])&&(y=y[j.itemsLowerCase]),n.defineReadOnlyPropertyWithValue(r,g,y)}}}},n.setMockData=function(e,t,r,i){if(d.isNullOrUndefined(t))e._handleResult(t);else{if(e[j.scalarPropertyOriginalNames]){for(var o={},a=e[j.scalarPropertyOriginalNames],s=e[j.scalarPropertyNames],c=0;c<s.length;c++)void 0!==t[s[c]]&&(o[a[c]]=t[s[c]]);e._handleResult(o)}if(e[j.navigationPropertyNames]){var l=e[j.navigationPropertyNames];for(c=0;c<l.length;c++)if(void 0!==t[l[c]]){var u=e[l[c]];u.setMockData&&u.setMockData(t[l[c]])}}if(e[j.isCollection]&&r){var f=Array.isArray(t)?t:t[j.itemsLowerCase];if(Array.isArray(f)){var p=[];for(c=0;c<f.length;c++){var m=r(f,c);n.setMockData(m,f[c]),p.push(m)}i(p)}}}},n.applyMixin=function(e,t){Object.getOwnPropertyNames(t.prototype).forEach((function(n){"constructor"!==n&&Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(t.prototype,n))}))},n.ensureTypeInitialized=function(e){var t=new k;new e(t,G.createNewObjectObjectPath(t,"Temp",!1,0))},n.fieldName_m__items="m__items",n.fieldName_isCollection="_isCollection",n._synchronousCleanup=!1,n.s_underscoreCharCode="_".charCodeAt(0),n.s_suppressPropertyNotLoadedException=!1,n}(P);e.Utility=Y;var Z=function(){function e(){}return e.invokeMethod=function(e,t,n,r,i,o){var a=M.createMethodAction(e.context,e,t,n,r,i),s=new T(o);return Y._addActionResultHandler(e,a,s),s},e.invokeEnsureUnchanged=function(e,t){M.createEnsureUnchangedAction(e.context,e,t)},e.invokeSetProperty=function(e,t,n,r){M.createSetPropertyAction(e.context,e,t,n,r)},e.createRootServiceObject=function(e,t){return new e(t,G.createGlobalObjectObjectPath(t))},e.createObjectFromReferenceId=function(e,t,n){return new e(t,G.createReferenceIdObjectPath(t,n))},e.createTopLevelServiceObject=function(e,t,n,r,i){return new e(t,G.createNewObjectObjectPath(t,n,r,i))},e.createPropertyObject=function(e,t,n,r,i){var o=G.createPropertyObjectPath(t.context,t,n,r,!1,i);return new e(t.context,o)},e.createIndexerObject=function(e,t,n){var r=G.createIndexerObjectPath(t.context,t,n);return new e(t.context,r)},e.createMethodObject=function(e,t,n,r,i,o,a,s,c){var l=G.createMethodObjectPath(t.context,t,n,r,i,o,a,s,c);return new e(t.context,l)},e.createChildItemObject=function(e,t,n,r,i){var o=G.createChildItemObjectPathUsingIndexerOrGetItemAt(t,n.context,n,r,i);return new e(n.context,o)},e}();e.BatchApiHelper=Z;var $=function(){function t(e){if(this.m_namespaceMap={},this.m_namespace=e.metadata.name,this.m_targetNamespaceObject=e.targetNamespaceObject,this.m_namespaceMap[this.m_namespace]=e.targetNamespaceObject,e.namespaceMap)for(var t in e.namespaceMap)this.m_namespaceMap[t]=e.namespaceMap[t];this.m_defaultApiSetName=e.metadata.defaultApiSetName,this.m_hostName=e.metadata.hostName;var n=e.metadata;if(n.enumTypes)for(var r=0;r<n.enumTypes.length;r++)this.buildEnumType(n.enumTypes[r]);if(n.apiSets){for(r=0;r<n.apiSets.length;r++){var i=n.apiSets[r];Array.isArray(i)&&(n.apiSets[r]={version:i[0],name:i[1]||this.m_defaultApiSetName})}this.m_apiSets=n.apiSets}if(this.m_strings=n.strings,n.clientObjectTypes)for(r=0;r<n.clientObjectTypes.length;r++){i=n.clientObjectTypes[r];Array.isArray(i)&&(this.ensureArraySize(i,11),n.clientObjectTypes[r]={name:this.getString(i[0]),behaviorFlags:i[1],collectionPropertyPath:this.getString(i[6]),newObjectServerTypeFullName:this.getString(i[9]),newObjectApiFlags:i[10],childItemTypeFullName:this.getString(i[7]),scalarProperties:i[2],navigationProperties:i[3],scalarMethods:i[4],navigationMethods:i[5],events:i[8]}),this.buildClientObjectType(n.clientObjectTypes[r],e.fullyInitialize)}}return t.prototype.ensureArraySize=function(e,t){for(var n=t-e.length;n>0;)e.push(0),n--},t.prototype.getString=function(e){return"number"==typeof e?e>0?this.m_strings[e-1]:null:e},t.prototype.buildEnumType=function(e){var t;if(Array.isArray(e)){(t={name:e[0],fields:e[2]}).fields||(t.fields={});var n=e[1];if(Array.isArray(n))for(var r=0;r<n.length;r++)t.fields[n[r]]=this.toSimpleCamelUpperCase(n[r])}else t=e;this.m_targetNamespaceObject[t.name]=t.fields},t.prototype.buildClientObjectType=function(n,r){var i=this,o=function(t,r){N.apply(this,arguments),i.m_targetNamespaceObject[n.name]._typeInited||(i.buildPrototype(i.m_targetNamespaceObject[n.name],n),i.m_targetNamespaceObject[n.name]._typeInited=!0),e._internalConfig.appendTypeNameToObjectPathInfo&&this._objectPath&&this._objectPath.objectPathInfo&&this._className&&(this._objectPath.objectPathInfo.T=this._className)};(this.m_targetNamespaceObject[n.name]=o,this.extendsType(o,N),this.buildNewObject(o,n),0!=(2&n.behaviorFlags)&&(o.prototype._KeepReference=function(){Z.invokeMethod(this,"_KeepReference",1,[],0,0)}),0!=(32&n.behaviorFlags))&&this.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_StaticCustomize").call(null,o);r&&(this.buildPrototype(o,n),o._typeInited=!0)},t.prototype.extendsType=function(e,t){function n(){this.constructor=e}e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},t.prototype.findObjectUnderPath=function(t,n,r){for(var i=t,o=r;o<n.length;o++){if("object"!=typeof i)throw new e.Error("Cannot find "+n.join("."));i=i[n[o]]}return i},t.prototype.getFunction=function(t){var n=this.resolveObjectByFullName(t);if("function"!=typeof n)throw new e.Error("Cannot find function or type: "+t);return n},t.prototype.resolveObjectByFullName=function(e){var t=e.split(".");if(1===t.length)return this.m_targetNamespaceObject[t[0]];var n=t[0];return n===this.m_namespace?this.findObjectUnderPath(this.m_targetNamespaceObject,t,1):this.m_namespaceMap[n]?this.findObjectUnderPath(this.m_namespaceMap[n],t,1):this.findObjectUnderPath(this.m_targetNamespaceObject,t,0)},t.prototype.evaluateSimpleExpression=function(t,n){if(Y.isNullOrUndefined(t))return null;var r=t.split(".");if(3===r.length&&"OfficeExtension"===r[0]&&"Constants"===r[1])return j[r[2]];if("this"===r[0]){for(var i=n,o=1;o<r.length;o++)i="toString()"==r[o]?i.toString():"()"===r[o].substr(r[o].length-2)?i[r[o].substr(0,r[o].length-2)]():i[r[o]];return i}throw new e.Error("Cannot evaluate: "+t)},t.prototype.evaluateEventTargetId=function(e,t){return Y.isNullOrEmptyString(e)?"":this.evaluateSimpleExpression(e,t)},t.prototype.isAllDigits=function(e){for(var t="0".charCodeAt(0),n="9".charCodeAt(0),r=0;r<e.length;r++)if(e.charCodeAt(r)<t||e.charCodeAt(r)>n)return!1;return!0},t.prototype.evaluateEventType=function(t){if(Y.isNullOrEmptyString(t))return 0;if(this.isAllDigits(t))return parseInt(t);var n=this.resolveObjectByFullName(t);if("number"!=typeof n)throw new e.Error("Invalid event type: "+t);return n},t.prototype.buildPrototype=function(e,t){this.buildScalarProperties(e,t),this.buildNavigationProperties(e,t),this.buildScalarMethods(e,t),this.buildNavigationMethods(e,t),this.buildEvents(e,t),this.buildHandleResult(e,t),this.buildHandleIdResult(e,t),this.buildHandleRetrieveResult(e,t),this.buildLoad(e,t),this.buildRetrieve(e,t),this.buildSetMockData(e,t),this.buildEnsureUnchanged(e,t),this.buildUpdate(e,t),this.buildSet(e,t),this.buildToJSON(e,t),this.buildItems(e,t),this.buildTypeMetadataInfo(e,t),this.buildTrackUntrack(e,t),this.buildMixin(e,t)},t.prototype.toSimpleCamelUpperCase=function(e){return e.substr(0,1).toUpperCase()+e.substr(1)},t.prototype.ensureOriginalName=function(e){null===e.originalName&&(e.originalName=this.toSimpleCamelUpperCase(e.name))},t.prototype.getFieldName=function(e){return"m_"+e.name},t.prototype.throwIfApiNotSupported=function(e,t){if(this.m_apiSets&&t.apiSetInfoOrdinal>0){var n=this.m_apiSets[t.apiSetInfoOrdinal-1];n&&Y.throwIfApiNotSupported(e.name+"."+t.name,n.name,n.version,this.m_hostName)}},t.prototype.buildScalarProperties=function(e,t){if(Array.isArray(t.scalarProperties))for(var n=0;n<t.scalarProperties.length;n++){var r=t.scalarProperties[n];Array.isArray(r)&&(this.ensureArraySize(r,6),t.scalarProperties[n]={name:this.getString(r[0]),behaviorFlags:r[1],apiSetInfoOrdinal:r[2],originalName:this.getString(r[3]),setMethodApiFlags:r[4],undoableApiSetInfoOrdinal:r[5]}),this.buildScalarProperty(e,t,t.scalarProperties[n])}},t.prototype.calculateApiFlags=function(e,t){if(t>0){var n=this.m_apiSets[t-1];n&&(e=P.calculateApiFlags(e,n.name,n.version))}return e},t.prototype.buildScalarProperty=function(e,n,r){this.ensureOriginalName(r);var i=this,o=this.getFieldName(r),a={get:function(){return Y.throwIfNotLoaded(r.name,this[o],n.name,this._isNull),i.throwIfApiNotSupported(n,r),this[o]},enumerable:!0,configurable:!0};0==(2&r.behaviorFlags)&&(a.set=function(e){if(4&r.behaviorFlags&&i.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+r.originalName+"_Set").call(this,this,e).handled)return;this[o]=e;var a=i.calculateApiFlags(r.setMethodApiFlags,r.undoableApiSetInfoOrdinal);Z.invokeSetProperty(this,r.originalName,e,a)}),Object.defineProperty(e.prototype,r.name,a)},t.prototype.buildNavigationProperties=function(e,t){if(Array.isArray(t.navigationProperties))for(var n=0;n<t.navigationProperties.length;n++){var r=t.navigationProperties[n];Array.isArray(r)&&(this.ensureArraySize(r,8),t.navigationProperties[n]={name:this.getString(r[0]),behaviorFlags:r[2],apiSetInfoOrdinal:r[3],originalName:this.getString(r[4]),getMethodApiFlags:r[5],setMethodApiFlags:r[6],propertyTypeFullName:this.getString(r[1]),undoableApiSetInfoOrdinal:r[7]}),this.buildNavigationProperty(e,t,t.navigationProperties[n])}},t.prototype.buildNavigationProperty=function(e,n,r){this.ensureOriginalName(r);var i=this,o=this.getFieldName(r),a={get:function(){(this[i.getFieldName(r)]||(i.throwIfApiNotSupported(n,r),this[o]=Z.createPropertyObject(i.getFunction(r.propertyTypeFullName),this,r.originalName,0!=(16&r.behaviorFlags),r.getMethodApiFlags)),64&r.behaviorFlags)&&i.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+r.originalName+"_Get").call(this,this,this[o]);return this[o]},enumerable:!0,configurable:!0};0==(2&r.behaviorFlags)&&(a.set=function(e){if(4&r.behaviorFlags&&i.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+r.originalName+"_Set").call(this,this,e).handled)return;this[o]=e;var a=i.calculateApiFlags(r.setMethodApiFlags,r.undoableApiSetInfoOrdinal);Z.invokeSetProperty(this,r.originalName,e,a)}),Object.defineProperty(e.prototype,r.name,a)},t.prototype.buildScalarMethods=function(e,t){if(Array.isArray(t.scalarMethods))for(var n=0;n<t.scalarMethods.length;n++){var r=t.scalarMethods[n];Array.isArray(r)&&(this.ensureArraySize(r,7),t.scalarMethods[n]={name:this.getString(r[0]),behaviorFlags:r[2],apiSetInfoOrdinal:r[3],originalName:this.getString(r[5]),apiFlags:r[4],parameterCount:r[1],undoableApiSetInfoOrdinal:r[6]}),this.buildScalarMethod(e,t,t.scalarMethods[n])}},t.prototype.buildScalarMethod=function(e,n,r){this.ensureOriginalName(r);var i=this;e.prototype[r.name]=function(){var e=[];if(64&r.behaviorFlags&&r.parameterCount>0){for(var o=0;o<r.parameterCount-1;o++)e.push(arguments[o]);var a=[];for(o=r.parameterCount-1;o<arguments.length;o++)a.push(arguments[o]);e.push(a)}else for(o=0;o<arguments.length;o++)e.push(arguments[o]);if(1&r.behaviorFlags){var s=i.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+r.originalName),c=[this];for(o=0;o<e.length;o++)c.push(e[o]);var l=s.apply(this,c),d=l.handled,u=l.result;if(d)return u}i.throwIfApiNotSupported(n,r);var f=0;32&r.behaviorFlags&&(f=1);var p=0;2&r.behaviorFlags&&(p=1);var m=i.calculateApiFlags(r.apiFlags,r.undoableApiSetInfoOrdinal);return Z.invokeMethod(this,r.originalName,p,e,m,f)}},t.prototype.buildNavigationMethods=function(e,t){if(Array.isArray(t.navigationMethods))for(var n=0;n<t.navigationMethods.length;n++){var r=t.navigationMethods[n];Array.isArray(r)&&(this.ensureArraySize(r,9),t.navigationMethods[n]={name:this.getString(r[0]),behaviorFlags:r[3],apiSetInfoOrdinal:r[4],originalName:this.getString(r[6]),apiFlags:r[5],parameterCount:r[2],returnTypeFullName:this.getString(r[1]),returnObjectGetByIdMethodName:this.getString(r[7]),undoableApiSetInfoOrdinal:r[8]}),this.buildNavigationMethod(e,t,t.navigationMethods[n])}},t.prototype.buildNavigationMethod=function(e,n,r){this.ensureOriginalName(r);var i=this;e.prototype[r.name]=function(){var e=[];if(64&r.behaviorFlags&&r.parameterCount>0){for(var o=0;o<r.parameterCount-1;o++)e.push(arguments[o]);var a=[];for(o=r.parameterCount-1;o<arguments.length;o++)a.push(arguments[o]);e.push(a)}else for(o=0;o<arguments.length;o++)e.push(arguments[o]);if(1&r.behaviorFlags){var s=i.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+r.originalName),c=[this];for(o=0;o<e.length;o++)c.push(e[o]);var l=s.apply(this,c),d=l.handled,u=l.result;if(d)return u}if(i.throwIfApiNotSupported(n,r),0!=(16&r.behaviorFlags))return Z.createIndexerObject(i.getFunction(r.returnTypeFullName),this,e);var f=0;2&r.behaviorFlags&&(f=1);var p=i.calculateApiFlags(r.apiFlags,r.undoableApiSetInfoOrdinal);return Z.createMethodObject(i.getFunction(r.returnTypeFullName),this,r.originalName,f,e,0!=(4&r.behaviorFlags),0!=(8&r.behaviorFlags),r.returnObjectGetByIdMethodName,p)}},t.prototype.buildHandleResult=function(e,n){var r=this;e.prototype._handleResult=function(e){if(N.prototype._handleResult.call(this,e),!Y.isNullOrUndefined(e)){if(Y.fixObjectPathIfNecessary(this,e),8&n.behaviorFlags)r.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_HandleResult").call(this,this,e);if(n.scalarProperties)for(var i=0;i<n.scalarProperties.length;i++)Y.isUndefined(e[n.scalarProperties[i].originalName])||(0!=(8&n.scalarProperties[i].behaviorFlags)?this[r.getFieldName(n.scalarProperties[i])]=Y.adjustToDateTime(e[n.scalarProperties[i].originalName]):this[r.getFieldName(n.scalarProperties[i])]=e[n.scalarProperties[i].originalName]);if(n.navigationProperties){for(var o=[],a=0;a<n.navigationProperties.length;a++)o.push(n.navigationProperties[a].name),o.push(n.navigationProperties[a].originalName);Y._handleNavigationPropertyResults(this,e,o)}if(0!=(1&n.behaviorFlags)){var s=r.hasIndexMethod(n);if(!Y.isNullOrUndefined(e[j.items])){this.m__items=[];for(var c=e[j.items],l=r.getFunction(n.childItemTypeFullName),d=0;d<c.length;d++){var u=Z.createChildItemObject(l,s,this,c[d],d);u._handleResult(c[d]),this.m__items.push(u)}}}}}},t.prototype.buildHandleRetrieveResult=function(e,t){var n=this;e.prototype._handleRetrieveResult=function(e,r){if(N.prototype._handleRetrieveResult.call(this,e,r),!Y.isNullOrUndefined(e)){if(t.scalarProperties)for(var i=0;i<t.scalarProperties.length;i++)8&t.scalarProperties[i].behaviorFlags&&(Y.isNullOrUndefined(e[t.scalarProperties[i].name])||(e[t.scalarProperties[i].name]=Y.adjustToDateTime(e[t.scalarProperties[i].name])));if(1&t.behaviorFlags){var o=n.hasIndexMethod(t),a=n.getFunction(t.childItemTypeFullName),s=this;Y.processRetrieveResult(s,e,r,(function(e,t){return Z.createChildItemObject(a,o,s,e,t)}))}else Y.processRetrieveResult(this,e,r)}}},t.prototype.buildHandleIdResult=function(e,n){var r=this;e.prototype._handleIdResult=function(e){if(N.prototype._handleIdResult.call(this,e),!Y.isNullOrUndefined(e)){if(16&n.behaviorFlags)r.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_HandleIdResult").call(this,this,e);if(n.scalarProperties)for(var i=0;i<n.scalarProperties.length;i++){var o=n.scalarProperties[i].originalName;"Id"!==o&&"_Id"!==o&&"_ReferenceId"!==o||Y.isNullOrUndefined(e[n.scalarProperties[i].originalName])||(this[r.getFieldName(n.scalarProperties[i])]=e[n.scalarProperties[i].originalName])}}}},t.prototype.buildLoad=function(e,t){e.prototype.load=function(e){return Y.load(this,e)}},t.prototype.buildRetrieve=function(e,t){e.prototype.retrieve=function(e){return Y.retrieve(this,e)}},t.prototype.buildNewObject=function(e,t){Y.isNullOrEmptyString(t.newObjectServerTypeFullName)||(e.newObject=function(n){return Z.createTopLevelServiceObject(e,n,t.newObjectServerTypeFullName,0!=(1&t.behaviorFlags),t.newObjectApiFlags)})},t.prototype.buildSetMockData=function(e,t){var n=this;if(1&t.behaviorFlags){var r=n.hasIndexMethod(t);e.prototype.setMockData=function(e){var i=this;Y.setMockData(i,e,(function(e,o){return Z.createChildItemObject(n.getFunction(t.childItemTypeFullName),r,i,e,o)}),(function(e){i.m__items=e}))}}else e.prototype.setMockData=function(e){Y.setMockData(this,e)}},t.prototype.buildEnsureUnchanged=function(e,t){e.prototype.ensureUnchanged=function(e){Z.invokeEnsureUnchanged(this,e)}},t.prototype.buildUpdate=function(e,t){e.prototype.update=function(e){this._recursivelyUpdate(e)}},t.prototype.buildSet=function(e,t){if(0==(1&t.behaviorFlags)){var n=[],r=[];if(t.scalarProperties)for(var i=0;i<t.scalarProperties.length;i++)0==(2&t.scalarProperties[i].behaviorFlags)&&0!=(1&t.scalarProperties[i].behaviorFlags)?r.push(t.scalarProperties[i].name):n.push(t.scalarProperties[i].name);var o=[];if(t.navigationProperties)for(i=0;i<t.navigationProperties.length;i++)0!=(16&t.navigationProperties[i].behaviorFlags)||0==(1&t.navigationProperties[i].behaviorFlags)||0==(32&t.navigationProperties[i].behaviorFlags)?n.push(t.navigationProperties[i].name):o.push(t.navigationProperties[i].name);0===o.length&&0===r.length||(e.prototype.set=function(e,t){this._recursivelySet(e,t,r,o,n)})}},t.prototype.buildItems=function(e,t){0!=(1&t.behaviorFlags)&&Object.defineProperty(e.prototype,"items",{get:function(){return Y.throwIfNotLoaded("items",this.m__items,t.name,this._isNull),this.m__items},enumerable:!0,configurable:!0})},t.prototype.buildToJSON=function(e,t){var n=this;0==(1&t.behaviorFlags)?e.prototype.toJSON=function(){var e={};if(t.scalarProperties)for(var r=0;r<t.scalarProperties.length;r++)0!=(1&t.scalarProperties[r].behaviorFlags)&&(e[t.scalarProperties[r].name]=this[n.getFieldName(t.scalarProperties[r])]);var i={};if(t.navigationProperties)for(r=0;r<t.navigationProperties.length;r++)0!=(1&t.navigationProperties[r].behaviorFlags)&&(i[t.navigationProperties[r].name]=this[n.getFieldName(t.navigationProperties[r])]);return Y.toJson(this,e,i)}:e.prototype.toJSON=function(){return Y.toJson(this,{},{},this.m__items)}},t.prototype.buildTypeMetadataInfo=function(e,t){Object.defineProperty(e.prototype,"_className",{get:function(){return t.name},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_isCollection",{get:function(){return 0!=(1&t.behaviorFlags)},enumerable:!0,configurable:!0}),Y.isNullOrEmptyString(t.collectionPropertyPath)||Object.defineProperty(e.prototype,"_collectionPropertyPath",{get:function(){return t.collectionPropertyPath},enumerable:!0,configurable:!0}),t.scalarProperties&&t.scalarProperties.length>0&&(Object.defineProperty(e.prototype,"_scalarPropertyNames",{get:function(){return this.m__scalarPropertyNames||(this.m__scalarPropertyNames=t.scalarProperties.map((function(e){return e.name}))),this.m__scalarPropertyNames},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_scalarPropertyOriginalNames",{get:function(){return this.m__scalarPropertyOriginalNames||(this.m__scalarPropertyOriginalNames=t.scalarProperties.map((function(e){return e.originalName}))),this.m__scalarPropertyOriginalNames},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_scalarPropertyUpdateable",{get:function(){return this.m__scalarPropertyUpdateable||(this.m__scalarPropertyUpdateable=t.scalarProperties.map((function(e){return 0==(2&e.behaviorFlags)}))),this.m__scalarPropertyUpdateable},enumerable:!0,configurable:!0})),t.navigationProperties&&t.navigationProperties.length>0&&Object.defineProperty(e.prototype,"_navigationPropertyNames",{get:function(){return this.m__navigationPropertyNames||(this.m__navigationPropertyNames=t.navigationProperties.map((function(e){return e.name}))),this.m__navigationPropertyNames},enumerable:!0,configurable:!0})},t.prototype.buildTrackUntrack=function(e,t){2&t.behaviorFlags&&(e.prototype.track=function(){return this.context.trackedObjects.add(this),this},e.prototype.untrack=function(){return this.context.trackedObjects.remove(this),this})},t.prototype.buildMixin=function(e,t){if(4&t.behaviorFlags){var n=this.getFunction(t.name+"Custom");Y.applyMixin(e,n)}},t.prototype.getOnEventName=function(e){return"_"===e[0]?"_on"+e.substr(1):"on"+e},t.prototype.buildEvents=function(e,t){if(t.events)for(var n=0;n<t.events.length;n++){var r=t.events[n];Array.isArray(r)&&(this.ensureArraySize(r,7),t.events[n]={name:this.getString(r[0]),behaviorFlags:r[1],apiSetInfoOrdinal:r[2],typeExpression:this.getString(r[3]),targetIdExpression:this.getString(r[4]),register:this.getString(r[5]),unregister:this.getString(r[6])}),this.buildEvent(e,t,t.events[n])}},t.prototype.buildEvent=function(e,t,n){1&n.behaviorFlags?this.buildV0Event(e,t,n):this.buildV2Event(e,t,n)},t.prototype.buildV2Event=function(e,n,r){var i=this,o=this.getOnEventName(r.name),a=this.getFieldName(r);Object.defineProperty(e.prototype,o,{get:function(){if(!this[a]){i.throwIfApiNotSupported(n,r);var e=this,o=null;"null"!==r.register&&(o=this[r.register].bind(this));var s=null;"null"!==r.unregister&&(s=this[r.unregister].bind(this));var c=null;2&r.behaviorFlags&&(c=i.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+r.name+"_EventArgsTransform"));var l=i.evaluateEventType(r.typeExpression);this[a]=new V(this.context,this,r.name,{eventType:l,getTargetIdFunc:function(){return i.evaluateEventTargetId(r.targetIdExpression,e)},registerFunc:o,unregisterFunc:s,eventArgsTransformFunc:function(t){return c&&(t=c.call(e,e,t)),Y._createPromiseFromResult(t)}})}return this[a]},enumerable:!0,configurable:!0})},t.prototype.buildV0Event=function(e,n,r){var i=this,o=this.getOnEventName(r.name),a=this.getFieldName(r);Object.defineProperty(e.prototype,o,{get:function(){if(!this[a]){i.throwIfApiNotSupported(n,r);var e=this,o=null;if(Y.isNullOrEmptyString(r.register)){var s=i.evaluateEventType(r.typeExpression);o=function(t){var n=i.evaluateEventTargetId(r.targetIdExpression,e);return e.context.eventRegistration.register(s,n,t)}}else if("null"!==r.register){var c=i.getFunction(r.register);o=function(t){return c.call(e,e,t)}}var l=null;if(Y.isNullOrEmptyString(r.unregister)){var d=i.evaluateEventType(r.typeExpression);l=function(t){var n=i.evaluateEventTargetId(r.targetIdExpression,e);return e.context.eventRegistration.unregister(d,n,t)}}else if("null"!==r.unregister){var u=i.getFunction(r.unregister);l=function(t){return u.call(e,e,t)}}var f=null;2&r.behaviorFlags&&(f=i.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+r.name+"_EventArgsTransform"));this[a]=new U(this.context,this,r.name,{registerFunc:o,unregisterFunc:l,eventArgsTransformFunc:function(t){return f&&(t=f.call(e,e,t)),Y._createPromiseFromResult(t)}})}return this[a]},enumerable:!0,configurable:!0})},t.prototype.hasIndexMethod=function(e){var t=!1;if(e.navigationMethods)for(var n=0;n<e.navigationMethods.length;n++)if(0!=(16&e.navigationMethods[n].behaviorFlags)){t=!0;break}return t},t.CustomizationCodeNamespace="_CC",t}();e.LibraryBuilder=$}(OfficeExtension||(OfficeExtension={})),function(e){var t;!function(t){t.getPromiseType=function(){if("undefined"!=typeof Promise)return Promise;if(void 0!==Office&&Office.Promise)return Office.Promise;throw new e.Error("No Promise implementation found")}}(t||(t={})),Object.defineProperty(e,"Promise",{get:function(){return t.getPromiseType()},enumerable:!0,configurable:!0})}(OfficeExtension||(OfficeExtension={}));try{if("undefined"!=typeof OfficePlatformGlobal&&void 0!==OfficePlatformGlobal.ReactNativeReka){var RichApiBridgeImpl=function(){function e(){}return e.prototype.sendMessageToHost=function(e){OfficePlatformGlobal.ReactNativeReka.RekaInstance.InvokeNative("RichApiDataService","ProcessMessageToHost",e)},e}(),RichApiBridge_1=new RichApiBridgeImpl,RichApiDataService_1=function(){function e(){}return e.prototype.Invoke=function(e,t){"ProcessMessageFromHost"===e&&RichApiBridge_1.onMessageFromHost&&RichApiBridge_1.onMessageFromHost(t)},e}();OfficePlatformGlobal.ReactNativeReka.initReka(),OfficePlatformGlobal.ReactNativeReka.RekaInstance.RegisterService("RichApiDataService",(function(){return new RichApiDataService_1})),OfficeExtension.HostBridge.init(RichApiBridge_1),OfficeExtension.HostBridgeSession.getInstanceIfHostBridgeInited()}}catch(e){}!function(e){!function(e){e.dispidOlkItemSelectedChangedEvent=46,e.dispidOlkRecipientsChangedEvent=47,e.dispidOlkAppointmentTimeChangedEvent=48,e.dispidOlkRecurrenceChangedEvent=49,e.dispidOlkAttachmentsChangedEvent=50,e.dispidOlkEnhancedLocationsChangedEvent=51,e.dispidOlkInfobarClickedEvent=52}(e.EventDispId||(e.EventDispId={})),e.commonApiDispId=[93,209,205]}(OSF||(OSF={})),function(e){!function(e){e.ItemChanged="olkItemSelectedChanged",e.RecipientsChanged="olkRecipientsChanged",e.AppointmentTimeChanged="olkAppointmentTimeChanged",e.AttachmentsChanged="olkAttachmentsChanged",e.EnhancedLocationsChanged="olkEnhancedLocationsChanged",e.InfobarClicked="olkInfobarClicked",e.RecurrenceChanged="olkRecurrenceChanged"}(e.EventType||(e.EventType={}))}(OSF||(OSF={})),function(e){!function(e){!function(e){e.OutlookBase||(e.OutlookBase={})}(e.WebExtension||(e.WebExtension={}))}(e.Office||(e.Office={}))}(Microsoft||(Microsoft={})),function(e){!function(e){var t,n,r;OSF.definePropertyOnNamespace(e,"mailbox",(function(){return t||(t=OSF.OutlookInitializeManager.getMailboxObject()),t})),OSF.definePropertyOnNamespace(e,"roamingSettings",(function(){if(!n){var e=OSF._OfficeAppFactory.getOfficeAppContext().get_settingsFunc()(),t=OSF.OUtil.deserializeSettings(e);n=new OSF.DDA.Settings(t),OSF.DDA.ClientSettingsManager=OSF._OfficeAppFactory.getInitializationHelper().createClientSettingsManager()}return n})),OSF.definePropertyOnNamespace(e,"sensitivityLabelsCatalog",(function(){return r||(r=e.mailbox.officeAppContext.sensitivityLabelsCatalog()),r}))}(e.context||(e.context={}))}(Office||(Office={})),function(e){!function(e){!function(e){e.MeetingSuggestion="meetingSuggestion",e.TaskSuggestion="taskSuggestion",e.Address="address",e.EmailAddress="emailAddress",e.Url="url",e.PhoneNumber="phoneNumber",e.Contact="contact",e.FlightReservations="flightReservations",e.ParcelDeliveries="parcelDeliveries"}(e.EntityType||(e.EntityType={})),function(e){e.Message="message",e.Appointment="appointment"}(e.ItemType||(e.ItemType={})),function(e){e.None="none",e.Organizer="organizer",e.Tentative="tentative",e.Accepted="accepted",e.Declined="declined"}(e.ResponseType||(e.ResponseType={})),function(e){e.Other="other",e.DistributionList="distributionList",e.User="user",e.ExternalUser="externalUser"}(e.RecipientType||(e.RecipientType={})),function(e){e.File="file",e.Item="item",e.Cloud="cloud",e.Base64="base64"}(e.AttachmentType||(e.AttachmentType={})),function(e){e.Added="added",e.Removed="removed"}(e.AttachmentStatus||(e.AttachmentStatus={})),function(e){e.Base64="base64",e.Url="url",e.Eml="eml",e.ICalendar="iCalendar"}(e.AttachmentContentFormat||(e.AttachmentContentFormat={})),function(e){e.Text="text",e.Html="html"}(e.BodyType||(e.BodyType={})),function(e){e.ProgressIndicator="progressIndicator",e.InformationalMessage="informationalMessage",e.ErrorMessage="errorMessage",e.InsightMessage="insightMessage"}(e.ItemNotificationMessageType||(e.ItemNotificationMessageType={})),function(e){e.Inbox="inbox",e.Junk="junk",e.DeletedItems="deletedItems"}(e.Folder||(e.Folder={})),function(e){e.Forward="forward",e.NewMail="newMail",e.Reply="reply"}(e.ComposeType||(e.ComposeType={})),function(e){e.Text="text",e.Html="html"}(e.CoercionType||(e.CoercionType={})),function(e){e.Office365="office365",e.OutlookCom="outlookCom",e.Enterprise="enterprise"}(e.UserProfileType||(e.UserProfileType={})),function(e){e.v1_0="v1.0",e.v2_0="v2.0",e.Beta="beta"}(e.RestVersion||(e.RestVersion={})),function(e){e.Addins="addins"}(e.ModuleType||(e.ModuleType={})),function(e){e.ShowTaskPane="showTaskPane",e.ExecuteFunction="executeFunction"}(e.ActionType||(e.ActionType={})),function(e){e.PromptUser="promptUser"}(e.SendModeOverride||(e.SendModeOverride={})),function(e){e.Mon="mon",e.Tue="tue",e.Wed="wed",e.Thu="thu",e.Fri="fri",e.Sat="sat",e.Sun="sun",e.Weekday="weekday",e.WeekendDay="weekendDay",e.Day="day"}(e.Days||(e.Days={})),function(e){e.First="first",e.Second="second",e.Third="third",e.Fourth="fourth",e.Last="last"}(e.WeekNumber||(e.WeekNumber={})),function(e){e.Daily="daily",e.Weekday="weekday",e.Weekly="weekly",e.Monthly="monthly",e.Yearly="yearly"}(e.RecurrenceType||(e.RecurrenceType={})),function(e){e.Jan="jan",e.Feb="feb",e.Mar="mar",e.Apr="apr",e.May="may",e.Jun="jun",e.Jul="jul",e.Aug="aug",e.Sep="sep",e.Oct="oct",e.Nov="nov",e.Dec="dec"}(e.Month||(e.Month={})),function(e){e[e.Read=1]="Read",e[e.Write=2]="Write",e[e.DeleteOwn=4]="DeleteOwn",e[e.DeleteAll=8]="DeleteAll",e[e.EditOwn=16]="EditOwn",e[e.EditAll=32]="EditAll"}(e.DelegatePermissions||(e.DelegatePermissions={})),function(e){e.AfghanistanStandardTime="Afghanistan Standard Time",e.AlaskanStandardTime="Alaskan Standard Time",e.AleutianStandardTime="Aleutian Standard Time",e.AltaiStandardTime="Altai Standard Time",e.ArabStandardTime="Arab Standard Time",e.ArabianStandardTime="Arabian Standard Time",e.ArabicStandardTime="Arabic Standard Time",e.ArgentinaStandardTime="Argentina Standard Time",e.AstrakhanStandardTime="Astrakhan Standard Time",e.AtlanticStandardTime="Atlantic Standard Time",e.AUSCentralStandardTime="AUS Central Standard Time",e.AusCentralWStandardTime="Aus Central W. Standard Time",e.AUSEasternStandardTime="AUS Eastern Standard Time",e.AzerbaijanStandardTime="Azerbaijan Standard Time",e.AzoresStandardTime="Azores Standard Time",e.BahiaStandardTime="Bahia Standard Time",e.BangladeshStandardTime="Bangladesh Standard Time",e.BelarusStandardTime="Belarus Standard Time",e.BougainvilleStandardTime="Bougainville Standard Time",e.CanadaCentralStandardTime="Canada Central Standard Time",e.CapeVerdeStandardTime="Cape Verde Standard Time",e.CaucasusStandardTime="Caucasus Standard Time",e.CenAustraliaStandardTime="Cen. Australia Standard Time",e.CentralAmericaStandardTime="Central America Standard Time",e.CentralAsiaStandardTime="Central Asia Standard Time",e.CentralBrazilianStandardTime="Central Brazilian Standard Time",e.CentralEuropeStandardTime="Central Europe Standard Time",e.CentralEuropeanStandardTime="Central European Standard Time",e.CentralPacificStandardTime="Central Pacific Standard Time",e.CentralStandardTime="Central Standard Time",e.CentralStandardTime_Mexico="Central Standard Time (Mexico)",e.ChathamIslandsStandardTime="Chatham Islands Standard Time",e.ChinaStandardTime="China Standard Time",e.CubaStandardTime="Cuba Standard Time",e.DatelineStandardTime="Dateline Standard Time",e.EAfricaStandardTime="E. Africa Standard Time",e.EAustraliaStandardTime="E. Australia Standard Time",e.EEuropeStandardTime="E. Europe Standard Time",e.ESouthAmericaStandardTime="E. South America Standard Time",e.EasterIslandStandardTime="Easter Island Standard Time",e.EasternStandardTime="Eastern Standard Time",e.EasternStandardTime_Mexico="Eastern Standard Time (Mexico)",e.EgyptStandardTime="Egypt Standard Time",e.EkaterinburgStandardTime="Ekaterinburg Standard Time",e.FijiStandardTime="Fiji Standard Time",e.FLEStandardTime="FLE Standard Time",e.GeorgianStandardTime="Georgian Standard Time",e.GMTStandardTime="GMT Standard Time",e.GreenlandStandardTime="Greenland Standard Time",e.GreenwichStandardTime="Greenwich Standard Time",e.GTBStandardTime="GTB Standard Time",e.HaitiStandardTime="Haiti Standard Time",e.HawaiianStandardTime="Hawaiian Standard Time",e.IndiaStandardTime="India Standard Time",e.IranStandardTime="Iran Standard Time",e.IsraelStandardTime="Israel Standard Time",e.JordanStandardTime="Jordan Standard Time",e.KaliningradStandardTime="Kaliningrad Standard Time",e.KamchatkaStandardTime="Kamchatka Standard Time",e.KoreaStandardTime="Korea Standard Time",e.LibyaStandardTime="Libya Standard Time",e.LineIslandsStandardTime="Line Islands Standard Time",e.LordHoweStandardTime="Lord Howe Standard Time",e.MagadanStandardTime="Magadan Standard Time",e.MagallanesStandardTime="Magallanes Standard Time",e.MarquesasStandardTime="Marquesas Standard Time",e.MauritiusStandardTime="Mauritius Standard Time",e.MidAtlanticStandardTime="Mid-Atlantic Standard Time",e.MiddleEastStandardTime="Middle East Standard Time",e.MontevideoStandardTime="Montevideo Standard Time",e.MoroccoStandardTime="Morocco Standard Time",e.MountainStandardTime="Mountain Standard Time",e.MountainStandardTime_Mexico="Mountain Standard Time (Mexico)",e.MyanmarStandardTime="Myanmar Standard Time",e.NCentralAsiaStandardTime="N. Central Asia Standard Time",e.NamibiaStandardTime="Namibia Standard Time",e.NepalStandardTime="Nepal Standard Time",e.NewZealandStandardTime="New Zealand Standard Time",e.NewfoundlandStandardTime="Newfoundland Standard Time",e.NorfolkStandardTime="Norfolk Standard Time",e.NorthAsiaEastStandardTime="North Asia East Standard Time",e.NorthAsiaStandardTime="North Asia Standard Time",e.NorthKoreaStandardTime="North Korea Standard Time",e.OmskStandardTime="Omsk Standard Time",e.PacificSAStandardTime="Pacific SA Standard Time",e.PacificStandardTime="Pacific Standard Time",e.PacificStandardTime_Mexico="Pacific Standard Time (Mexico)",e.PakistanStandardTime="Pakistan Standard Time",e.ParaguayStandardTime="Paraguay Standard Time",e.RomanceStandardTime="Romance Standard Time",e.RussiaTimeZone10="Russia Time Zone 10",e.RussiaTimeZone11="Russia Time Zone 11",e.RussiaTimeZone3="Russia Time Zone 3",e.RussianStandardTime="Russian Standard Time",e.SAEasternStandardTime="SA Eastern Standard Time",e.SAPacificStandardTime="SA Pacific Standard Time",e.SAWesternStandardTime="SA Western Standard Time",e.SaintPierreStandardTime="Saint Pierre Standard Time",e.SakhalinStandardTime="Sakhalin Standard Time",e.SamoaStandardTime="Samoa Standard Time",e.SaratovStandardTime="Saratov Standard Time",e.SEAsiaStandardTime="SE Asia Standard Time",e.SingaporeStandardTime="Singapore Standard Time",e.SouthAfricaStandardTime="South Africa Standard Time",e.SriLankaStandardTime="Sri Lanka Standard Time",e.SudanStandardTime="Sudan Standard Time",e.SyriaStandardTime="Syria Standard Time",e.TaipeiStandardTime="Taipei Standard Time",e.TasmaniaStandardTime="Tasmania Standard Time",e.TocantinsStandardTime="Tocantins Standard Time",e.TokyoStandardTime="Tokyo Standard Time",e.TomskStandardTime="Tomsk Standard Time",e.TongaStandardTime="Tonga Standard Time",e.TransbaikalStandardTime="Transbaikal Standard Time",e.TurkeyStandardTime="Turkey Standard Time",e.TurksAndCaicosStandardTime="Turks And Caicos Standard Time",e.UlaanbaatarStandardTime="Ulaanbaatar Standard Time",e.USEasternStandardTime="US Eastern Standard Time",e.USMountainStandardTime="US Mountain Standard Time",e.UTC="UTC",e.UTCPLUS12="UTC+12",e.UTCPLUS13="UTC+13",e.UTCMINUS02="UTC-02",e.UTCMINUS08="UTC-08",e.UTCMINUS09="UTC-09",e.UTCMINUS11="UTC-11",e.VenezuelaStandardTime="Venezuela Standard Time",e.VladivostokStandardTime="Vladivostok Standard Time",e.WAustraliaStandardTime="W. Australia Standard Time",e.WCentralAfricaStandardTime="W. Central Africa Standard Time",e.WEuropeStandardTime="W. Europe Standard Time",e.WMongoliaStandardTime="W. Mongolia Standard Time",e.WestAsiaStandardTime="West Asia Standard Time",e.WestBankStandardTime="West Bank Standard Time",e.WestPacificStandardTime="West Pacific Standard Time",e.YakutskStandardTime="Yakutsk Standard Time"}(e.TimeZone||(e.TimeZone={})),function(e){e.Custom="custom",e.Room="room"}(e.LocationType||(e.LocationType={})),function(e){e.Normal="normal",e.Personal="personal",e.Private="private",e.Confidential="confidential"}(e.AppointmentSensitivityType||(e.AppointmentSensitivityType={})),function(e){e.None="None",e.Preset0="Preset0",e.Preset1="Preset1",e.Preset2="Preset2",e.Preset3="Preset3",e.Preset4="Preset4",e.Preset5="Preset5",e.Preset6="Preset6",e.Preset7="Preset7",e.Preset8="Preset8",e.Preset9="Preset9",e.Preset10="Preset10",e.Preset11="Preset11",e.Preset12="Preset12",e.Preset13="Preset13",e.Preset14="Preset14",e.Preset15="Preset15",e.Preset16="Preset16",e.Preset17="Preset17",e.Preset18="Preset18",e.Preset19="Preset19",e.Preset20="Preset20",e.Preset21="Preset21",e.Preset22="Preset22",e.Preset23="Preset23",e.Preset24="Preset24"}(e.CategoryColor||(e.CategoryColor={})),function(e){e.DeletedItemsFolder="deletedItemsFolder",e.CustomFolder="customFolder",e.JunkFolder="junkFolder",e.NoMove="noMove"}(e.MoveSpamItemTo||(e.MoveSpamItemTo={})),function(e){e[e.OnedriveForBusiness=1]="OnedriveForBusiness",e[e.SharePoint=2]="SharePoint",e[e.Box=4]="Box",e[e.Dropbox=8]="Dropbox",e[e.GoogleDrive=16]="GoogleDrive",e[e.Local=32]="Local",e[e.AccountDocument=64]="AccountDocument",e[e.PhotoLibrary=128]="PhotoLibrary",e[e.Other=-2147483648]="Other"}(e.SaveLocation||(e.SaveLocation={})),function(e){e[e.OnedriveForBusiness=1]="OnedriveForBusiness",e[e.SharePoint=2]="SharePoint",e[e.Camera=4]="Camera",e[e.Local=8]="Local",e[e.AccountDocument=16]="AccountDocument",e[e.PhotoLibrary=32]="PhotoLibrary",e[e.Other=-2147483648]="Other"}(e.OpenLocation||(e.OpenLocation={})),function(e){e[e.FullBody=0]="FullBody",e[e.HostConfig=1]="HostConfig"}(e.BodyMode||(e.BodyMode={})),function(e){e[e.camera=0]="camera",e[e.microphone=1]="microphone",e[e.geolocation=2]="geolocation"}(e.DevicePermissionType||(e.DevicePermissionType={})),function(e){e[e.Disabled=0]="Disabled",e[e.Enabled=1]="Enabled",e[e.Removed=2]="Removed"}(e.TokenStatus||(e.TokenStatus={}))}(e.MailboxEnums||(e.MailboxEnums={})),function(e){e.ItemChanged="olkItemSelectedChanged",e.RecipientsChanged="olkRecipientsChanged",e.AppointmentTimeChanged="olkAppointmentTimeChanged",e.AttachmentsChanged="olkAttachmentsChanged",e.EnhancedLocationsChanged="olkEnhancedLocationsChanged",e.InfobarClicked="olkInfobarClicked",e.RecurrenceChanged="olkRecurrenceChanged"}(e.EventType||(e.EventType={}))}(Office||(Office={}));__extends=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(e){var t=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),n.prototype.handleSafeArrayHostResponse=function(n,r,i,o,a,s,c){return"function"!=typeof o||(e.commonApiDispId.indexOf(s)>=0?t.prototype.handleSafeArrayHostResponse.call(this,n,r,i,o,a,s,c):o(r,n))},n.prototype.handleWebHostResponse=function(n,r,i,o,a,s){if("function"==typeof i)return e.commonApiDispId.indexOf(a)>=0?t.prototype.handleWebHostResponse.call(this,n,r,i,o,a,s):i(r,n)},n}(e.AsyncMethodExecutorHelper);e.OutlookAsyncMethodExecutorHelper=t}(OSF||(OSF={})),function(e){!function(t){function n(t){var n=null,r=null;try{n=JSON.parse(t[0]),r=JSON.parse(t[1])}catch(e){}return{safeArrayHost:{type:e.EventType.ItemChanged,initialData:n,itemNumber:r},webHost:{type:e.EventType.ItemChanged,initialData:t[0]}}}function r(t){var n=null,r={};try{for(var i in n=JSON.parse(t[0]))r[i]=e.OUtil.convertIntToCssHexColor(n[i])}catch(e){}return{safeArrayHost:{type:e.EventType.OfficeThemeChanged,officeTheme:r},webHost:{type:e.EventType.OfficeThemeChanged,officeTheme:r}}}function i(t){var n=null;try{n=JSON.parse(t[0])}catch(e){}return{safeArrayHost:{type:e.EventType.RecipientsChanged,changedRecipientFields:n},webHost:{type:e.EventType.RecipientsChanged,changedRecipientFields:n}}}function o(t){var n=null,r=null;try{var i=JSON.parse(t[0]);n=new Date(i.start).toISOString(),r=new Date(i.end).toISOString()}catch(e){}return{safeArrayHost:{type:e.EventType.AppointmentTimeChanged,start:n,end:r},webHost:{type:e.EventType.AppointmentTimeChanged,start:n,end:r}}}function a(t){var n=null,r=null;try{var i=JSON.parse(t[0]);n=i.attachmentStatus,r=Microsoft.Office.WebExtension.OutlookBase.CreateAttachmentDetails(i.attachmentDetails)}catch(e){}return{safeArrayHost:{type:e.EventType.AttachmentsChanged,attachmentStatus:n,attachmentDetails:r},webHost:{type:e.EventType.AttachmentsChanged,attachmentStatus:n,attachmentDetails:r}}}function s(t){var n=null;try{n=JSON.parse(t[0]).enhancedLocations}catch(e){}return{safeArrayHost:{type:e.EventType.EnhancedLocationsChanged,enhancedLocations:n},webHost:{type:e.EventType.EnhancedLocationsChanged,enhancedLocations:n}}}function c(t){var n=null;try{var r=JSON.parse(t[0]);null!=r.recurrence&&(n=JSON.parse(r.recurrence),n=Microsoft.Office.WebExtension.OutlookBase.SeriesTimeJsonConverter(n))}catch(e){}return{safeArrayHost:{type:e.EventType.RecurrenceChanged,recurrence:n},webHost:{type:e.EventType.RecurrenceChanged,recurrence:n}}}t.addEventDispatchToTarget=function(t,n){t.addHandlerAsync||e.OUtil.defineMethodOnNamespace(t,"addHandlerAsync",(function(t,r,i,o){e.EventHelper.addEventHandler(t,r,o,n,i&&i.asyncContext)})),t.removeHandlerAsync||e.OUtil.defineMethodOnNamespace(t,"removeHandlerAsync",(function(t,r,i){e.EventHelper.removeEventHandler(t,null,i,n,r&&r.asyncContext)}))},t.getMailboxItemEventDispatch=function(){return new e.EventDispatch([{type:e.EventType.RecipientsChanged,id:e.EventDispId.dispidOlkRecipientsChangedEvent,getTargetId:function(){return""},fromSafeArrayHost:function(e){return i(e).safeArrayHost},fromWebHost:function(e){return i(e).webHost}},{type:e.EventType.AppointmentTimeChanged,id:e.EventDispId.dispidOlkAppointmentTimeChangedEvent,getTargetId:function(){return""},fromSafeArrayHost:function(e){return o(e).safeArrayHost},fromWebHost:function(e){return o(e).webHost}},{type:e.EventType.AttachmentsChanged,id:e.EventDispId.dispidOlkAttachmentsChangedEvent,getTargetId:function(){return""},fromSafeArrayHost:function(e){return a(e).safeArrayHost},fromWebHost:function(e){return a(e).webHost}},{type:e.EventType.EnhancedLocationsChanged,id:e.EventDispId.dispidOlkEnhancedLocationsChangedEvent,getTargetId:function(){return""},fromSafeArrayHost:function(e){return s(e).safeArrayHost},fromWebHost:function(e){return s(e).webHost}},{type:e.EventType.InfobarClicked,id:e.EventDispId.dispidOlkInfobarClickedEvent,getTargetId:function(){return""},fromSafeArrayHost:function(t){return{type:e.EventType.InfobarClicked,infobarDetails:t[0]}},fromWebHost:function(t){return{type:e.EventType.InfobarClicked,infobarDetails:t[0]}}},{type:e.EventType.RecurrenceChanged,id:e.EventDispId.dispidOlkRecurrenceChangedEvent,getTargetId:function(){return""},fromSafeArrayHost:function(e){return c(e).safeArrayHost},fromWebHost:function(e){return c(e).webHost}}])},t.getMailboxEventDispatch=function(){return new e.EventDispatch([{type:e.EventType.ItemChanged,id:e.EventDispId.dispidOlkItemSelectedChangedEvent,getTargetId:function(){return""},fromSafeArrayHost:function(e){return n(e).safeArrayHost},fromWebHost:function(e){return n(e).webHost}},{type:e.EventType.OfficeThemeChanged,id:e.EventDispId.dispidOfficeThemeChangedEvent,getTargetId:function(){return""},fromSafeArrayHost:function(e){return r(e).safeArrayHost},fromWebHost:function(e){return r(e).webHost}}])}}(e.OutlookInitializationHelper||(e.OutlookInitializationHelper={}))}(OSF||(OSF={})),function(e){e.DDA||(e.DDA={}),function(t){var n;t.initializeMailboxObject=function(t,r,i){n||(n=new e.DDA.OutlookAppOm(t,r,i),e.OutlookInitializationHelper.addEventDispatchToTarget(n,e.OutlookInitializationHelper.getMailboxEventDispatch()))},t.getMailboxObject=function(){return n}}(e.OutlookInitializeManager||(e.OutlookInitializeManager={}))}(OSF||(OSF={})),function(e){var t=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),n.prototype.getHostCallArgs=function(e,t){return 1==e?{MethodData:{ControlId:this.getControlId(),DispatchId:e}}:{ApiParams:t,MethodData:{ControlId:this.getControlId(),DispatchId:e}}},n.prototype.getTargetMethodName=function(e){return 1==e?"GetInitialData":"ExecuteMethod"},n.prototype.parseErrorFromPayload=function(t,n){var r=0;return e.commonApiDispId.indexOf(t)>=0?r=n.Error:1!=t&&(r=n.error),r},n}(e.WebClientHostControllerHelper);e.OutlookWebClientHostControllerHelper=t}(OSF||(OSF={})),function(e){!function(t){!function(t){t.serializeSettings=function(t){return e.OUtil.serializeSettings(t)},t.deserializeSettings=function(t){return e.OUtil.deserializeSettings(t)}}(t.SettingsManager||(t.SettingsManager={}))}(e.DDA||(e.DDA={}))}(OSF||(OSF={})),function(e){e.BootStrapExtension.onGetAppContext=function(t,n){var r=function(){return new Promise((function(r,i){e.OutlookInitializeManager.initializeMailboxObject(t,n,(function(){r()}))}))};return"undefined"!=typeof _osfSkipStringLoad&&!0===_osfSkipStringLoad?r():e.OUtil.ensureOfficeStringsJs().then(r)},e.BootStrapExtension.createWebClientHostControllerHelper=function(t,n){return new e.OutlookWebClientHostControllerHelper(t,n)},e.BootStrapExtension.createAsyncMethodExecutorHelper=function(t){return new e.OutlookAsyncMethodExecutorHelper(t)}}(OSF||(OSF={})),function(e){var t=function(){function t(e){this.m_activeView=e}return Object.defineProperty(t.prototype,"type",{get:function(){return e.EventType.ActiveViewChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activeView",{get:function(){return this.m_activeView.activeView},enumerable:!0,configurable:!0}),t}();e.ActiveViewChangedEventArgs=t}(OSF||(OSF={})),function(e){var t=function(){function t(e,t,n,r,i){this._requiredParameters=e,this._supportedOptions=t,this._privateStateCallbacks=n,this._checkCallArgs=r,this._displayName=i,this._requiredCount=e.length}return t.prototype.verifyArguments=function(t,n){for(var r in t){var i=t[r],o=n[r];if(i.enum)switch(typeof o){case"string":if(e.OUtil.listContainsValue(i.enum,o))break;case"undefined":throw 5007;default:throw e.Utility.createArgumentException(this._displayName)}if(i.types&&!e.OUtil.listContainsValue(i.types,typeof o))throw e.Utility.createArgumentException(this._displayName)}},t.prototype.extractRequiredArguments=function(t,n,r){if(t.length<this._requiredCount)throw e.Utility.createParameterException(e.ErrorNames.MissingRequiredArguments);var i,o=[];for(i=0;i<this._requiredCount;i++)o.push(t[i]);this.verifyArguments(this._requiredParameters,o);var a={};for(i=0;i<this._requiredCount;i++){var s=this._requiredParameters[i],c=o[i];if(s.verify)if(!s.verify(c,n,r))throw e.Utility.createArgumentException(this._displayName);a[s.name]=c}return a},t.prototype.fillOptions=function(t,n,r,i){for(var o in t=t||{},this._supportedOptions)if(!e.OUtil.listContainsKey(t,o)){var a=void 0,s=this._supportedOptions[o];s.calculate&&n&&(a=s.calculate(n,r,i)),a||void 0===s.defaultValue||(a=s.defaultValue),t[o]=a}return t},t.prototype.constructCallArgs=function(e,t,n,r){var i={};for(var o in e)i[o]=e[o];for(var a in t)i[a]=t[a];for(var s in this._privateStateCallbacks)i[s]=this._privateStateCallbacks[s](n,r);return this._checkCallArgs&&(i=this._checkCallArgs(i,n,r)),i},t}();e.ApiMethodCall=t}(OSF||(OSF={})),function(e){var t=function(){function t(t,n,r,i,o,a,s){this._requiredParameters=t,this._supportedOptions=n,this._privateStateCallbacks=r,this._onSucceeded=i,this._onFailed=o,this._displayName=s,this._checkCallArgs=a,this._requiredCount=t.length,this._apiMethods=new e.ApiMethodCall(t,n,r,a,s)}return t.prototype.verifyAndExtractCall=function(e,t,n){var r=this._apiMethods.extractRequiredArguments(e,t,n),i=this.extractOptions(e,r,t,n);return this._apiMethods.constructCallArgs(r,i,t,n)},t.prototype.processResponse=function(t,n,r,i){return 0==t?this._onSucceeded?this._onSucceeded(n,r,i):n:this._onFailed?this._onFailed(t,n):e.DDA.ErrorCodeManager.getErrorArgs(t)},t.prototype.getCallArgs=function(t){for(var n,r,i=t.length-1;i>=this._requiredCount;i--){var o=t[i];switch(typeof o){case"object":n=o;break;case"function":r=o}}return n=n||{},r&&(n[e.ParameterNames.Callback]=r),n},t.prototype.extractOptions=function(t,n,r,i){if(t.length>this._requiredCount+2)throw e.Utility.createParameterException(e.ErrorNames.TooManyArguments);for(var o,a,s=t.length-1;s>=this._requiredCount;s--){var c=t[s];switch(typeof c){case"object":if(o)throw e.Utility.createParameterException(e.ErrorNames.TooManyOptionalObjects);o=c;break;case"function":if(a)throw e.Utility.createParameterException(e.ErrorNames.TooManyOptionalFunctions);a=c;break;default:throw e.Utility.createArgumentException(e.ErrorNames.InvalidValue)}}if(o=this._apiMethods.fillOptions(o,n,r,i),a){if(o[e.ParameterNames.Callback])throw e.ErrorNames.RedundantCallbackSpecification;o[e.ParameterNames.Callback]=a}return this._apiMethods.verifyArguments(this._supportedOptions,o),o},t}();e.AsyncMethodCall=t}(OSF||(OSF={})),function(e){!function(t){var n={};t.define=function(t){var r,i,o;n[t.method]=(i=(r=t).supportedOptions?e.OUtil.createObject(r.supportedOptions):[],o=r.privateStateCallbacks?e.OUtil.createObject(r.privateStateCallbacks):[],new e.AsyncMethodCall(r.requiredArguments||[],i,o,r.onSucceeded,r.onFailed,r.checkCallArgs,r.method))},t.get=function(e){return n[e]}}(e.AsyncMethodCalls||(e.AsyncMethodCalls={}))}(OSF||(OSF={})),function(e){e.AsyncMethods={AddColumnsAsync:"addColumnsAsync",AddFromSelectionAsync:"addFromSelectionAsync",AddFromNamedItemAsync:"addFromNamedItemAsync",AddFromPromptAsync:"addFromPromptAsync",AddHandlerAsync:"addHandlerAsync",AddRowsAsync:"addRowsAsync",BindingSelectionChanged:"bindingSelectionChanged",BindingDataChanged:"bindingDataChanged",ClearFormatsAsync:"clearFormatsAsync",CloseAsync:"close",CloseContainerAsync:"closeContainer",DeleteAllDataValuesAsync:"deleteAllDataValuesAsync",DisplayDialogAsync:"displayDialogAsync",ExecuteFeature:"executeFeature",ExecuteRichApiRequestAsync:"executeRichApiRequestAsync",GetAllAsync:"getAllAsync",GetAccessTokenAsync:"getAccessTokenAsync",GetByIdAsync:"getByIdAsync",GetDataAsync:"getDataAsync",GetDocumentCopyAsync:"getFileAsync",GetDocumentCopyChunkAsync:"getSliceAsync",GetFilePropertiesAsync:"getFilePropertiesAsync",GetSelectedDataAsync:"getSelectedDataAsync",GoToByIdAsync:"goToByIdAsync",OpenBrowserWindow:"openBrowserWindow",QueryFeature:"queryFeature",ReleaseByIdAsync:"releaseByIdAsync",RemoveHandlerAsync:"removeHandlerAsync",ReleaseDocumentCopyAsync:"closeAsync",SetDataAsync:"setDataAsync",SetFormatsAsync:"setFormatsAsync",SetSelectedDataAsync:"setSelectedDataAsync",SetTableOptionsAsync:"setTableOptionsAsync",GetOfficeThemeAsync:"getOfficeThemeAsync",GetDocumentThemeAsync:"getDocumentThemeAsync"}}(OSF||(OSF={})),function(e){!function(e){e.Subset="subset",e.BindingProperties="BindingProperties"}(e.PropertyDescriptors||(e.PropertyDescriptors={}));var t=function(){function t(e,t){this.m_bindingInstance=e,this.m_subset=t}return Object.defineProperty(t.prototype,"startRow",{get:function(){return this.m_subset.startRow},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"startColumn",{get:function(){return this.m_subset.startColumn},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rowCount",{get:function(){return this.m_subset.rowCount},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"columnCount",{get:function(){return this.m_subset.columnCount},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return e.EventType.BindingSelectionChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"binding",{get:function(){return this.m_bindingInstance},enumerable:!0,configurable:!0}),t}();e.BindingSelectionChangedEventArgs=t;var n=function(){function t(e){this.m_bindingInstance=e}return Object.defineProperty(t.prototype,"type",{get:function(){return e.EventType.BindingDataChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"binding",{get:function(){return this.m_bindingInstance},enumerable:!0,configurable:!0}),t}();e.BindingDataChangedEventArgs=n}(OSF||(OSF={})),function(e){!function(e){e.DataPartProperties="DataPartProperties",e.DataNodeProperties="DataNodeProperties"}(e.PropertyDescriptors||(e.PropertyDescriptors={})),function(e){!function(e){!function(e){e.OldNode="OldNode",e.NewNode="NewNode",e.NextSiblingNode="NextSiblingNode",e.InUndoRedo="InUndoRedo"}(e.DataNodeEventProperties||(e.DataNodeEventProperties={}))}(e.Customxml||(e.Customxml={}))}(e.Marshaling||(e.Marshaling={})),function(e){e.DataNodeInsertedEvent="DataNodeInsertedEvent",e.DataNodeReplacedEvent="DataNodeReplacedEvent",e.DataNodeDeletedEvent="DataNodeDeletedEvent"}(e.EventDescriptors||(e.EventDescriptors={})),function(e){e.OldNode="OldNode",e.NewNode="NewNode",e.NextSiblingNode="NextSiblingNode",e.InUndoRedo="InUndoRedo"}(e.DataNodeEventProperties||(e.DataNodeEventProperties={}));var t=function(){function t(e,t){this.m_newNode=e,this.m_inUndoRedo=t}return Object.defineProperty(t.prototype,"type",{get:function(){return e.EventType.DataNodeInserted},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"newNode",{get:function(){return this.m_newNode},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"inUndoRedo",{get:function(){return this.m_inUndoRedo},enumerable:!0,configurable:!0}),t}();e.NodeInsertedEventArgs=t;var n=function(){function t(e,t,n){this.m_oldNode=e,this.m_newNode=t,this.m_inUndoRedo=n}return Object.defineProperty(t.prototype,"type",{get:function(){return e.EventType.DataNodeReplaced},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"oldNode",{get:function(){return this.m_oldNode},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"newNode",{get:function(){return this.m_newNode},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"inUndoRedo",{get:function(){return this.m_inUndoRedo},enumerable:!0,configurable:!0}),t}();e.NodeReplacedEventArgs=n;var r=function(){function t(e,t,n){this.m_oldNode=e,this.m_oldNextSibling=t,this.m_inUndoRedo=n}return Object.defineProperty(t.prototype,"type",{get:function(){return e.EventType.DataNodeDeleted},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"oldNode",{get:function(){return this.m_oldNode},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"oldNextSibling",{get:function(){return this.m_oldNextSibling},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"inUndoRedo",{get:function(){return this.m_inUndoRedo},enumerable:!0,configurable:!0}),t}();e.NodeDeletedEventArgs=r}(OSF||(OSF={})),function(e){var t=function(t){0==t[e.PropertyDescriptors.MessageType]?e.OUtil.defineEnumerableProperties(this,{type:{value:e.EventType.DialogMessageReceived},message:{value:t[e.PropertyDescriptors.MessageContent]},origin:{value:t[e.PropertyDescriptors.MessageOrigin]}}):e.OUtil.defineEnumerableProperties(this,{type:{value:e.EventType.DialogEventReceived},error:{value:t[e.PropertyDescriptors.MessageType]}})};e.DialogEventArgs=t,function(e){e.MessageType="messageType",e.MessageContent="messageContent",e.MessageOrigin="messageOrigin"}(e.PropertyDescriptors||(e.PropertyDescriptors={}))}(OSF||(OSF={})),function(e){var t=function(){function t(e){this.m_docInstance=e}return Object.defineProperty(t.prototype,"type",{get:function(){return e.EventType.DocumentSelectionChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"document",{get:function(){return this.m_docInstance},enumerable:!0,configurable:!0}),t}();e.DocumentSelectionChangedEventArgs=t}(OSF||(OSF={})),function(e){var t=function(t){e.OUtil.defineEnumerableProperties(this,{type:{value:e.EventType.DialogParentMessageReceived},message:{value:t[e.PropertyDescriptors.MessageContent]},origin:{value:t[e.PropertyDescriptors.MessageOrigin]}})};e.DialogParentEventArgs=t}(OSF||(OSF={})),function(e){e.DialogShownStatus={hasDialogShown:!1,isWindowDialog:!1},function(t){var n;function r(t){return t==e.EventDispId.dispidObjectDeletedEvent||t==e.EventDispId.dispidObjectSelectionChangedEvent||t==e.EventDispId.dispidObjectDataChangedEvent||t==e.EventDispId.dispidContentControlAddedEvent}function i(t,n,r,i){if("number"!=typeof t)throw t;i||(i=n.getCallArgs(r)),s(i,t,e.DDA.ErrorCodeManager.getErrorArgs(t))}function o(t){return(e._OfficeAppFactory.getHostInfo().hostPlatform==e.HostInfoPlatform.web?e.WACDelegate:e.SafeArrayDelegate)[t]}function a(){return n||function(){n={};var t={GoToByIdAsync:82,GetSelectedDataAsync:64,SetSelectedDataAsync:65,GetDocumentCopyChunkAsync:80,ReleaseDocumentCopyAsync:81,GetDocumentCopyAsync:77,AddFromSelectionAsync:66,AddFromPromptAsync:67,AddFromNamedItemAsync:78,GetAllAsync:74,GetByIdAsync:68,ReleaseByIdAsync:69,GetDataAsync:70,SetDataAsync:71,AddRowsAsync:72,AddColumnsAsync:79,DeleteAllDataValuesAsync:73,RefreshAsync:75,SaveAsync:76,GetActiveViewAsync:83,GetFilePropertiesAsync:86,GetOfficeThemeAsync:85,GetDocumentThemeAsync:84,ClearFormatsAsync:87,SetTableOptionsAsync:88,SetFormatsAsync:89,GetUserIdentityInfoAsync:92,GetAccessTokenAsync:98,GetAuthContextAsync:99,ExecuteRichApiRequestAsync:93,AppCommandInvocationCompletedAsync:94,CloseContainerAsync:97,OpenBrowserWindow:102,CreateDocumentAsync:105,InsertFormAsync:106,ExecuteFeature:146,QueryFeature:147,AddDataPartAsync:128,GetDataPartByIdAsync:129,GetDataPartsByNameSpaceAsync:130,GetPartXmlAsync:131,GetPartNodesAsync:132,DeleteDataPartAsync:133,GetNodeValueAsync:134,GetNodeXmlAsync:135,GetRelativeNodesAsync:136,SetNodeValueAsync:137,SetNodeXmlAsync:138,AddDataPartNamespaceAsync:139,GetDataPartNamespaceAsync:140,GetDataPartPrefixAsync:141,GetNodeTextAsync:142,SetNodeTextAsync:143,GetSelectedTask:110,GetTask:112,GetWSSUrl:114,GetTaskField:115,GetSelectedResource:111,GetResourceField:113,GetProjectField:116,GetSelectedView:117,GetTaskByIndex:118,GetResourceByIndex:119,SetTaskField:120,SetResourceField:121,GetMaxTaskIndex:122,GetMaxResourceIndex:123,CreateTask:124};for(var r in t)e.AsyncMethods[r]&&(n[e.AsyncMethods[r]]=t[r]);var i={MessageParent:144,SendMessage:145};for(var r in i)e.SyncMethods[r]&&(n[e.SyncMethods[r]]=i[r]);var o={SettingsChanged:e.EventDispId.dispidSettingsChangedEvent,DocumentSelectionChanged:e.EventDispId.dispidDocumentSelectionChangedEvent,BindingSelectionChanged:e.EventDispId.dispidBindingSelectionChangedEvent,BindingDataChanged:e.EventDispId.dispidBindingDataChangedEvent,ActiveViewChanged:e.EventDispId.dispidActiveViewChangedEvent,OfficeThemeChanged:e.EventDispId.dispidOfficeThemeChangedEvent,DocumentThemeChanged:e.EventDispId.dispidDocumentThemeChangedEvent,AppCommandInvoked:e.EventDispId.dispidAppCommandInvokedEvent,DialogMessageReceived:e.EventDispId.dispidDialogMessageReceivedEvent,DialogParentMessageReceived:e.EventDispId.dispidDialogParentMessageReceivedEvent,ObjectDeleted:e.EventDispId.dispidObjectDeletedEvent,ObjectSelectionChanged:e.EventDispId.dispidObjectSelectionChangedEvent,ObjectDataChanged:e.EventDispId.dispidObjectDataChangedEvent,ContentControlAdded:e.EventDispId.dispidContentControlAddedEvent,LiveShareStateChanged:e.EventDispId.dispidLiveShareStateChangedEvent,RichApiMessage:e.EventDispId.dispidRichApiMessageEvent,DataNodeInserted:e.EventDispId.dispidDataNodeAddedEvent,DataNodeReplaced:e.EventDispId.dispidDataNodeReplacedEvent,DataNodeDeleted:e.EventDispId.dispidDataNodeDeletedEvent};for(var a in o)e.EventType[a]&&(n[e.EventType[a]]=o[a])}(),n}function s(t,n,r){var i=t[e.ParameterNames.Callback];if(i){var o,a={};a[e.DDA.AsyncResultEnum.Properties.Context]=t[e.ParameterNames.AsyncContext],0==n?a[e.DDA.AsyncResultEnum.Properties.Value]=r:(o={},r=r||e.DDA.ErrorCodeManager.getErrorArgs(5001),o[e.DDA.AsyncResultEnum.ErrorProperties.Code]=n||5001,o[e.DDA.AsyncResultEnum.ErrorProperties.Name]=r.name||r,o[e.DDA.AsyncResultEnum.ErrorProperties.Message]=r.message||r),i(new e.DDA.AsyncResult(a,o))}}t.InvokeMethod=function(t,n,r,c){var l,d;try{var u=e.AsyncMethodCalls.get(t);d=u.verifyAndExtractCall(n,r,c);var f=a()[t],p=o("executeAsync"),m=null,g=!1,h=void 0;if(window.Excel&&window.Office.context.requirements.isSetSupported("RedirectV1Api")&&(window.Excel._RedirectV1APIs=!0,l=function(t){var n=!1,r=void 0;if(void 0!==e&&e._OfficeAppFactory&&"function"==typeof e._OfficeAppFactory.getHostInfo&&e.HostInfoPlatform&&e.HostInfoPlatform.ios){var i=e._OfficeAppFactory.getHostInfo();if(i&&i.hostPlatform&&(n=i.hostPlatform===e.HostInfoPlatform.ios)&&e.AsyncMethods)for(var o=Object.keys(e.AsyncMethods),a=0;a<o.length;a++){var s=o[a];if(e.AsyncMethods[s]===t){r=s;break}}}return{isIOSPlatformDetected:n,methodId:r}}(t),g=l.isIOSPlatformDetected,h=l.methodId),window.Excel&&window.Excel._RedirectV1APIs&&(m=window.Excel._V1APIMap[g&&void 0!==h?h:t])){var y=e.OUtil.shallowCopy(d);delete y[e.ParameterNames.AsyncContext],m.preprocess&&(y=m.preprocess(y));var v=new window.Excel.RequestContext,S=m.call(v,y);v.sync().then((function(){var t=S.value,n=t.status;delete t.status,delete t["@odata.type"],m.postprocess&&(t=m.postprocess(t,y)),0!=n&&(t=e.DDA.ErrorCodeManager.getErrorArgs(n)),s(d,n,t)})).catch((function(e){s(d,13991,null)}))}else{var b;b=e.HostParameterMap.toHost(f,d);var O=(new Date).getTime();p({dispId:f,hostCallArgs:b,onCalling:function(){},onReceiving:function(){},onComplete:function(t,n){var i;i=0==t?e.HostParameterMap.fromHost(f,n):n;var o=u.processResponse(t,i,r,d);s(d,t,o),e.AppTelemetry&&e.AppTelemetry.onMethodDone(f,b,Math.abs((new Date).getTime()-O),t)}})}}catch(e){i(e,u,n,d)}},t.AddEventHandler=function(t,n,c,l){var d,u,f,p=!1;function m(t){var r;0==t&&((p?n.addObjectEventHandler(u,d[e.ParameterNames.Id],f):n.addEventHandler(u,f))||(t=13991));0!=t&&(r=e.DDA.ErrorCodeManager.getErrorArgs(t)),s(d,t,r)}try{var g=e.AsyncMethodCalls.get(e.AsyncMethods.AddHandlerAsync);if(d=g.verifyAndExtractCall(t,c,n),u=d[e.ParameterNames.EventType],f=d[e.ParameterNames.Handler],l)return void m(0);var h=a()[u],y=(p=r(h))?d[e.ParameterNames.Id]:c.id||"";if(0==(p?n.getObjectEventHandlerCount(u,y):n.getEventHandlerCount(u)))o("registerEventAsync")({eventType:u,dispId:h,targetId:y,onCalling:function(){},onReceiving:function(){},onComplete:m,onEvent:function(t){var r=e.HostParameterMap.fromHost(h,t);p?n.fireObjectEvent(y,e.manufactureEventArgs(u,y,r)):n.fireEvent(e.manufactureEventArgs(u,c,r))}});else m(0)}catch(e){i(e,g,t,d)}},t.RemoveEventHandler=function(t,n,c){var l,d,u,f=!1;function p(t){var n;0!=t&&(n=e.DDA.ErrorCodeManager.getErrorArgs(t)),s(l,t,n)}try{var m=e.AsyncMethodCalls.get(e.AsyncMethods.RemoveHandlerAsync);d=(l=m.verifyAndExtractCall(t,c,n))[e.ParameterNames.EventType],u=l[e.ParameterNames.Handler];var g,h,y=a()[d],v=(f=r(y))?l[e.ParameterNames.Id]:c.id||"";null===u?(h=f?n.clearObjectEventHandlers(d,v):n.clearEventHandlers(d),g=0):g=(h=f?n.removeObjectEventHandler(d,v,u):n.removeEventHandler(d,u))?0:5003;var S=f?n.getObjectEventHandlerCount(d,v):n.getEventHandlerCount(d);if(h&&0==S)o("unregisterEventAsync")({eventType:d,dispId:y,targetId:v,onCalling:function(){},onReceiving:function(){},onComplete:p});else p(g)}catch(e){i(e,m,t,l)}},t.OpenDialog=function(t,n,r){var c,l,d=e.EventType.DialogMessageReceived,u=e.EventType.DialogEventReceived;function f(t){if(0!=t)o=e.DDA.ErrorCodeManager.getErrorArgs(t);else{var i={};i.id=l,i.data=n;var o=p.processResponse(t,i,r,c);e.DialogShownStatus.hasDialogShown=!0,n.clearEventHandlers(d),n.clearEventHandlers(u)}s(c,t,o)}try{if(null!=d&&null!=u||f(5e3),null==e.AsyncMethods.DisplayDialogAsync)return void f(5001);var p=e.AsyncMethodCalls.get(e.AsyncMethods.DisplayDialogAsync);c=p.verifyAndExtractCall(t,r,n);var m=a()[d],g=o("openDialog");l=JSON.stringify(c),e.DialogShownStatus.hasDialogShown||(n.clearQueuedEvent(d),n.clearQueuedEvent(u),n.clearQueuedEvent(e.EventType.DialogParentMessageReceived)),g({eventType:d,dispId:m,targetId:l,onCalling:function(){},onReceiving:function(){},onComplete:f,onEvent:function(t){var i=e.HostParameterMap.fromHost(m,t),o=e.manufactureEventArgs(d,r,i);if(o.type==u){e.DDA.ErrorCodeManager.getErrorArgs(o.error);var a={};a.code=status||5001,o.error=new e.DDA.Error(a[e.DDA.AsyncResultEnum.ErrorProperties.Name],a[e.DDA.AsyncResultEnum.ErrorProperties.Message],a[e.DDA.AsyncResultEnum.ErrorProperties.Code])}n.fireOrQueueEvent(o),12006==i.messageType&&(n.clearEventHandlers(d),n.clearEventHandlers(u),n.clearEventHandlers(e.EventType.DialogParentMessageReceived),e.DialogShownStatus.hasDialogShown=!1)}})}catch(e){i(e,p,t,c)}},t.CloseDialog=function(t,n,r,s){var c,l,d;try{var u=e.AsyncMethodCalls.get(e.AsyncMethods.CloseAsync);c=u.verifyAndExtractCall(t,s,r),l=e.EventType.DialogMessageReceived,d=e.EventType.DialogEventReceived,r.clearEventHandlers(l),r.clearEventHandlers(d);var f=a()[l];o("closeDialog")({eventType:l,dispId:f,targetId:n,onCalling:function(){},onReceiving:function(){},onComplete:function(t){t,e.DialogShownStatus.hasDialogShown=!1}})}catch(e){i(e,u,t,c)}},t.MessageParent=function(t,n){var r=e.SyncMethodCalls.get(e.SyncMethods.MessageParent).verifyAndExtractCall(t,n,{});return o("messageParent")({dispId:a()[e.SyncMethods.MessageParent],hostCallArgs:r,onCalling:function(){},onReceiving:function(){}})},t.SendMessage=function(t,n,r){var i=e.SyncMethodCalls.get(e.SyncMethods.SendMessage).verifyAndExtractCall(t,r,{});return o("sendMessage")({dispId:a()[e.SyncMethods.SendMessage],hostCallArgs:i,onCalling:function(){},onReceiving:function(){}})},t.addAsyncMethods=function(t,n,r){for(var i in n){var o=n[i];t[o]||e.OUtil.defineEnumerableProperty(t,o,{value:function(n){return function(){var i=e.DispIdHost.InvokeMethod;i(n,arguments,t,r)}}(o)})}},t.addEventSupport=function(t,n,r){var i=e.AsyncMethods.AddHandlerAsync,o=e.AsyncMethods.RemoveHandlerAsync;t[i]||e.OUtil.defineEnumerableProperty(t,i,{value:function(){var i=e.DispIdHost.AddEventHandler;i(arguments,n,t,r)}}),t[o]||e.OUtil.defineEnumerableProperty(t,o,{value:function(){var r=e.DispIdHost.RemoveEventHandler;r(arguments,n,t)}})},t.issueAsyncResult=s}(e.DispIdHost||(e.DispIdHost={}))}(OSF||(OSF={})),function(e){e.manufactureEventArgs=function(t,n,r){var i;switch(t){case e.EventType.DocumentSelectionChanged:i=new e.DocumentSelectionChangedEventArgs(n);break;case e.EventType.BindingSelectionChanged:i=new e.BindingSelectionChangedEventArgs(e.manufactureBinding(r,n.document),r[e.PropertyDescriptors.Subset]);break;case e.EventType.BindingDataChanged:i=new e.BindingDataChangedEventArgs(e.manufactureBinding(r,n.document));break;case e.EventType.SettingsChanged:i=new e.SettingsChangedEventArgs(n);break;case e.EventType.ActiveViewChanged:i=new e.ActiveViewChangedEventArgs(r);break;case e.EventType.LiveShareStateChanged:i=new e.LiveShareStateChangedEventArgs(r);break;case e.EventType.OfficeThemeChanged:i=new e.DDA.Theming.OfficeThemeChangedEventArgs(r);break;case e.EventType.DocumentThemeChanged:i=new e.DDA.Theming.DocumentThemeChangedEventArgs(r);break;case e.EventType.DataNodeInserted:i=new e.NodeInsertedEventArgs(e.manufactureDataNode(r[e.DataNodeEventProperties.NewNode]),r[e.DataNodeEventProperties.InUndoRedo]);break;case e.EventType.DataNodeReplaced:i=new e.NodeReplacedEventArgs(e.manufactureDataNode(r[e.DataNodeEventProperties.OldNode]),e.manufactureDataNode(r[e.DataNodeEventProperties.NewNode]),r[e.DataNodeEventProperties.InUndoRedo]);break;case e.EventType.DataNodeDeleted:i=new e.NodeDeletedEventArgs(e.manufactureDataNode(r[e.DataNodeEventProperties.OldNode]),e.manufactureDataNode(r[e.DataNodeEventProperties.NextSiblingNode]),r[e.DataNodeEventProperties.InUndoRedo]);break;case e.EventType.DialogMessageReceived:i=new e.DialogEventArgs(r);break;case e.EventType.DialogParentMessageReceived:i=new e.DialogParentEventArgs(r)}return i}}(OSF||(OSF={})),function(e){var t="toHost",n="fromHost";!function(r){var i;r.self="self",r.dynamicTypes={},r.dynamicTypes[e.ParameterNames.Data]={toHost:function(t){if(null!=t&&void 0!==t.rows){var n={};n[e.TableDataProperties.TableRows]=t.rows,n[e.TableDataProperties.TableHeaders]=t.headers,t=n}return t},fromHost:function(e){return e}},r.dynamicTypes.sampleData=r.dynamicTypes.data;var o={};function a(e,t){var n,i;if(t.map)for(var a in i={},n=t.map){var s=n[a];s==r.self&&(s=a),i[s]=a}else n=t.toHost,i=t.fromHost;var c=o[e];if(c){var l=c.toHost;for(var d in l)n[d]=l[d];for(var u in l=c.fromHost)i[u]=l[u]}else c=o[e]={};c.toHost=n,c.fromHost=i}function s(e){d().addComplexType(e)}function c(t,i){var a=t?{}:void 0;for(var s in t){var l,u=t[s];if(e.ListType.isListType(s))for(var f in l=[],u)l.push(c(u[f],i));else if(e.OUtil.listContainsKey(r.dynamicTypes,s))l=r.dynamicTypes[s][i](u);else if(i==n&&d().preserveNesting(s))l=c(u,i);else{var p=o[s];if(p){var m=p[i];m&&void 0===(l=m[u])&&(l=u)}else l=u}a[s]=l}return a}function l(t,n,i){var a,s=o[t][i];if("toHost"==i)a=function e(t,n){var i;for(var a in n){var s;if(null!=(s=d().isComplexType(a)?e(t,o[a].toHost):t[a])){i||(i={});var c=n[a];c==r.self&&(c=a),i[c]=d().pack(a,s)}}return i}(c(n,i),s);else if("fromHost"==i){a=c(function t(n,i,a){for(var s in a||(a={}),i){var c,l,u=i[s];if(u==r.self)c=n;else{if("sourceData"==u){a[s]=n.toArray();continue}c=n[u]}if(null==c)a[s]=void 0;else if(c=d().unpack(s,c),d().isComplexType(s))l=o[s].fromHost,d().preserveNesting(s)?a[s]=t(c,l):t(c,l,a);else if(e.ListType.isListType(s)){(l={})[e.ListType.getDescriptor(s)]=r.self;var f=new Array(c.length);for(var p in c)f[p]=t(c[p],l);a[s]=f}else a[s]=c}return a}(n,s),i)}return a}function d(){if(!i){var t=e._OfficeAppFactory.getHostInfo();i=t.hostPlatform==e.HostInfoPlatform.web?new e.WebSpecialProcessor:new e.SafeArraySpecialProcessor}return i}function u(e){var t=null;if(e){t={};for(var n=e.length,r=0;r<n;r++)t[e[r].name]=e[r].value}return t}r.define=function(e){var t={},n=u(e.toHost);e.invertible?t.map=n:e.canonical?t.toHost=t.fromHost=n:(t.toHost=n,t.fromHost=u(e.fromHost)),a(e.type,t),e.isComplexType&&s(e.type)},r.toHost=function(e,n){return l(e,n,t)},r.fromHost=function(e,t){return l(e,t,n)},r.addMapping=a,r.addComplexType=s,r.getDynamicType=function(e){return d().getDynamicType(e)},r.setDynamicType=function(e,t){d().setDynamicType(e,t)},r.doMapValues=function(e,t){return c(e,t)}}(e.HostParameterMap||(e.HostParameterMap={}))}(OSF||(OSF={})),function(e){!function(t){var n={};t.setListType=function(e,t){n[e]=t},t.isListType=function(t){return e.OUtil.listContainsKey(n,t)},t.getDescriptor=function(e){return n[e]}}(e.ListType||(e.ListType={}))}(OSF||(OSF={})),function(e){var t=function(){function t(e){this.m_liveShareStateInstance=e}return Object.defineProperty(t.prototype,"type",{get:function(){return e.EventType.LiveShareStateChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"liveShareState",{get:function(){return this.m_liveShareStateInstance},enumerable:!0,configurable:!0}),t}();e.LiveShareStateChangedEventArgs=t}(OSF||(OSF={})),function(e){!function(e){e.ActiveViewChanged="activeViewChanged",e.DialogMessageReceived="dialogMessageReceived",e.DialogParentMessageReceived="dialogParentMessageReceived",e.DialogParentEventReceived="dialogParentEventReceived",e.DialogEventReceived="dialogEventReceived",e.BindingDataChanged="bindingDataChanged",e.BindingSelectionChanged="bindingSelectionChanged",e.OfficeThemeChanged="officeThemeChanged",e.DocumentThemeChanged="documentThemeChanged",e.DataNodeDeleted="nodeDeleted",e.DataNodeInserted="nodeInserted",e.DataNodeReplaced="nodeReplaced",e.DocumentSelectionChanged="documentSelectionChanged",e.LiveShareStateChanged="liveShareStateChanged",e.NodeDeleted="nodeDeleted",e.NodeInserted="nodeInserted",e.NodeReplaced="nodeReplaced",e.SettingsChanged="settingsChanged"}(e.EventType||(e.EventType={}))}(Office||(Office={})),function(e){!function(e){e.TableRows="TableRows",e.TableHeaders="TableHeaders"}(e.TableDataProperties||(e.TableDataProperties={}))}(OSF||(OSF={})),function(e){!function(t){var n,r,i;function o(){try{var e=window.navigator.userAgent;return e.indexOf("MSIE ")>-1||e.indexOf("Trident/")>-1||e.indexOf("Edge/")>-1}catch(e){return l("Error happens in isInternetExplorer.",e),!1}}function a(e){if("undefined"!=typeof JSON)try{return JSON.stringify(e)}catch(e){}return""}!function(e){e.ButtonBorderColor="buttonBorderColor",e.ButtonBackgroundColor="buttonBackgroundColor"}(t.HostThemeButtonStyleKeys||(t.HostThemeButtonStyleKeys={})),function(e){e.HostButtonBorderColor="#86bfa0",e.HostButtonBackgroundColor="#d3f0e0"}(n||(n={})),function(e){e.HostButtonBorderColor="#a3bde3",e.HostButtonBackgroundColor="#d5e1f2"}(r||(r={})),function(e){e.HostButtonBorderColor="#f5ba9d",e.HostButtonBackgroundColor="#fcf0ed"}(i||(i={})),t.finalizeProperties=function(e,t){t=t||{};for(var n=Object.getOwnPropertyNames(e),r=n.length,i=0;i<r;i++){var o=n[i],a=Object.getOwnPropertyDescriptor(e,o);a.get||a.set||(a.writable=t.writable||!1),a.configurable=t.configurable||!1,a.enumerable=t.enumerable||!0,Object.defineProperty(e,o,a)}return e},t.defineEnumerableProperties=function(e,t){return function(e,t,n){for(var r in t=t||{})c(e,r,t[r],n);return e}(e,t,["enumerable"])},t.defineEnumerableProperty=function(e,t,n){return c(e,t,n,["enumerable"])},t.listContainsKey=function(e,t){for(var n in e)if(t==n)return!0;return!1},t.augmentList=function(e,t){var n=e.push?function(t,n){e.push(n)}:function(t,n){e[t]=n};for(var r in t)n(r,t[r])},t.createObject=function(e){var t=null;if(e){t={};for(var n=e.length,r=0;r<n;r++)t[e[r].name]=e[r].value}return t},t.listContainsValue=function(e,t){for(var n in e)if(t==e[n])return!0;return!1},t.shouldUseLocalStorageToPassMessage=function(){try{for(var e=["Windows NT 6.1","Windows NT 6.2","Windows NT 6.3","Windows NT 10.0"],t=window.navigator.userAgent,n=0,r=e.length;n<r;n++)if(t.indexOf(e[n])>-1)return o();return!1}catch(e){return l("Error happens in shouldUseLocalStorageToPassMessage.",e),!1}},t.isInternetExplorer=o,t.serializeObjectToString=a,t.formatString=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e,r=n[0];return r.replace(/{(\d+)}/gm,(function(e,t){var r=parseInt(t,10)+1;return void 0===n[r]?"{"+t+"}":n[r]}))},t.addHostInfoAsQueryParam=function(e,t){if(!e)return null;var n,r="#",i=(e=e.trim()||"").split(r),o=i.shift(),a=i.join(r),s=o.split("?");return s.length>1?n=o+"&_host_Info="+t:s.length>0&&(n=o+"?_host_Info="+t),a?[n,r,a].join(""):n},t.getHostnamePortionForLogging=function(e){var t=e.split("."),n=t.length;return n>=2?t[n-2]+"."+t[n-1]:1==n?t[0]:void 0},t.shallowCopy=function(e){if(null==e)return null;if(e instanceof Object){if(Array.isArray(e)){for(var t=[],n=0;n<e.length;n++)t.push(e[n]);return t}var r=e.constructor();for(var i in e)e.hasOwnProperty(i)&&(r[i]=e[i]);return r}return e},t.getXdmEventName=function(t,n){return n==e.EventType.BindingSelectionChanged||n==e.EventType.BindingDataChanged||n==e.EventType.DataNodeDeleted||n==e.EventType.DataNodeInserted||n==e.EventType.DataNodeReplaced?t+"_"+n:n},t.getCommonUI=function(){switch(Office.context.host){case Office.HostType.Excel:return n;case Office.HostType.Word:return r;case Office.HostType.PowerPoint:return i}return null},t.getDomainForUrl=function(e){if(!e)return null;var t=document.createElement("a");return t.href=e,t.protocol+"//"+t.host};var s=-1;function c(e,t,n,r){for(var i in n=n||{},r){var o=r[i];null==n[o]&&(n[o]=!0)}return Object.defineProperty(e,t,n),e}function l(t,n){e.Utility.trace(t+" Exception details: "+a(n))}t.getUniqueId=function(){return(s+=1).toString()}}(e.OUtil||(e.OUtil={}))}(OSF||(OSF={})),function(e){!function(e){e.BindingType="bindingType",e.CoercionType="coercionType",e.ValueFormat="valueFormat",e.FilterType="filterType",e.Columns="columns",e.SampleData="sampleData",e.GoToType="goToType",e.SelectionMode="selectionMode",e.Id="id",e.PromptText="promptText",e.ItemName="itemName",e.FailOnCollision="failOnCollision",e.StartRow="startRow",e.StartColumn="startColumn",e.RowCount="rowCount",e.ColumnCount="columnCount",e.Rows="rows",e.OverwriteIfStale="overwriteIfStale",e.FileType="fileType",e.EventType="eventType",e.Handler="handler",e.SliceSize="sliceSize",e.SliceIndex="sliceIndex",e.ActiveView="activeView",e.Status="status",e.PlatformType="platformType",e.HostType="hostType",e.Email="email",e.OfficeTheme="officeTheme",e.DocumentTheme="documentTheme",e.ForceConsent="forceConsent",e.ForceAddAccount="forceAddAccount",e.AuthChallenge="authChallenge",e.AllowConsentPrompt="allowConsentPrompt",e.ForMSGraphAccess="forMSGraphAccess",e.AllowSignInPrompt="allowSignInPrompt",e.JsonPayload="jsonPayload",e.EnableNewHosts="enableNewHosts",e.AccountTypeFilter="accountTypeFilter",e.AddinTrustId="addinTrustId",e.Reserved="reserved",e.Tcid="tcid",e.Xml="xml",e.Namespace="namespace",e.Prefix="prefix",e.XPath="xPath",e.Text="text",e.ImageLeft="imageLeft",e.ImageTop="imageTop",e.ImageWidth="imageWidth",e.ImageHeight="imageHeight",e.TaskId="taskId",e.FieldId="fieldId",e.FieldValue="fieldValue",e.ServerUrl="serverUrl",e.ListName="listName",e.ResourceId="resourceId",e.ViewType="viewType",e.ViewName="viewName",e.GetRawValue="getRawValue",e.CellFormat="cellFormat",e.TableOptions="tableOptions",e.TaskIndex="taskIndex",e.ResourceIndex="resourceIndex",e.CustomFieldId="customFieldId",e.Url="url",e.MessageHandler="messageHandler",e.Width="width",e.Height="height",e.RequireHTTPs="requireHTTPS",e.DisplayInIframe="displayInIframe",e.HideTitle="hideTitle",e.UseDeviceIndependentPixels="useDeviceIndependentPixels",e.PromptBeforeOpen="promptBeforeOpen",e.EnforceAppDomain="enforceAppDomain",e.UrlNoHostInfo="urlNoHostInfo",e.Base64="base64",e.FormId="formId"}(e.ParameterNames||(e.ParameterNames={}))}(OSF||(OSF={})),function(e){!function(t){function n(t,n){var r=(new Date).getTime();return function(i){n.onReceiving&&n.onReceiving();var o=i.toArray?i.toArray()[0]:i;return n.onComplete&&n.onComplete(o),e.AppTelemetry&&e.AppTelemetry.onRegisterDone(t,n.dispId,Math.abs((new Date).getTime()-r),o),!0}}function r(e){var t=e;if(null!=e&&e.toArray){var n=e.toArray();t=new Array(n.length);for(var i=0;i<n.length;i++)t[i]=r(n[i])}return t}t.executeAsync=function(t){try{t.onCalling&&t.onCalling(),e._OfficeAppFactory.getClientHostController().execute(t.dispId,function t(n){var r=n;if(e.OUtil.isArray(n))for(var i=r.length,o=0;o<i;o++)r[o]=t(r[o]);else if(e.OUtil.isDate(n))r=n.getVarDate();else if("object"==typeof n&&!e.OUtil.isArray(n))for(var a in r=[],n)e.OUtil.isFunction(n[a])||(r[a]=t(n[a]));return r}(t.hostCallArgs),(function(e,n){var i,o;if("number"==typeof e?(i=[],o=e):o=(i=e.toArray())[0],1==o)return null!=(a=r(a=i[1]))&&(t._chunkResultData||(t._chunkResultData=new Array),t._chunkResultData[a[0]]=a[1]),!1;if(t.onReceiving&&t.onReceiving(),t.onComplete){var a;if(0==o){if(i.length>2){a=[];for(var s=1;s<i.length;s++)a[s-1]=i[s]}else a=i[1];if(t._chunkResultData&&null!=(a=r(a))){var c=a[a.length-1];t._chunkResultData.length==c?a[a.length-1]=t._chunkResultData:o=5001}}else a=i[1];t.onComplete(o,a)}return!0}))}catch(n){e.SafeArrayDelegate.onException(n,t)}},t.registerEventAsync=function(t){t.onCalling&&t.onCalling();var r=n(!0,t);try{e._OfficeAppFactory.getClientHostController().registerEvent(t.dispId,void 0,t.targetId,(function(n,r){t.onEvent&&t.onEvent(r),e.AppTelemetry&&e.AppTelemetry.onEventDone(t.dispId)}),r)}catch(n){e.SafeArrayDelegate.onException(n,t)}},t.unregisterEventAsync=function(t){t.onCalling&&t.onCalling();var r=n(!1,t);try{e._OfficeAppFactory.getClientHostController().unregisterEvent(t.dispId,void 0,t.targetId,r)}catch(n){e.SafeArrayDelegate.onException(n,t)}},t.onException=function(t,n){var r,i=t.number;if(i)switch(i){case-2146828218:r=7e3;break;case-2147467259:r=n.dispId==e.EventDispId.dispidDialogMessageReceivedEvent?12007:5001;break;case-2146828283:case-2147209089:r=5010;break;case-2147208704:r=5100;break;case-2146827850:default:r=5001}n.onComplete&&n.onComplete(r||5001)},t.onExceptionSyncMethod=function(e,t){var n,r=e.number;if(r)switch(r){case-2146828218:n=7e3;break;case-2146827850:default:n=5001}return n||5001},t.getOnAfterRegisterEvent=n}(e.SafeArrayDelegate||(e.SafeArrayDelegate={}))}(OSF||(OSF={})),function(e){var t=function(){function t(e){this.m_settingsInstance=e}return Object.defineProperty(t.prototype,"type",{get:function(){return e.EventType.SettingsChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"settings",{get:function(){return this.m_settingsInstance},enumerable:!0,configurable:!0}),t}();e.SettingsChangedEventArgs=t}(OSF||(OSF={})),function(e){var t=function(){function t(e,t){this._complexTypes=e,this.dynamicTypes=t}return t.prototype.addComplexType=function(e){this._complexTypes.push(e)},t.prototype.getDynamicType=function(e){return this.dynamicTypes[e]},t.prototype.setDynamicType=function(e,t){this.dynamicTypes[e]=t},t.prototype.isComplexType=function(t){return e.OUtil.listContainsValue(this._complexTypes,t)},t.prototype.isDynamicType=function(t){return e.OUtil.listContainsKey(this.dynamicTypes,t)},t.prototype.preserveNesting=function(e){return!1},t.prototype.pack=function(e,t){return this.isDynamicType(e)?this.dynamicTypes[e].toHost(t):t},t.prototype.unpack=function(e,t){return this.isDynamicType(e)?this.dynamicTypes[e].fromHost(t):t},t}();e.SpecialProcessor=t}(OSF||(OSF={}));__extends=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(e){var t=function(t){function n(){var n={};return n[e.ParameterNames.Data]={toHost:function(t){if(e.TableDataProperties&&"string"!=typeof t&&void 0!==t[e.TableDataProperties.TableRows]){var n=[];n[0]=t[e.TableDataProperties.TableRows],n[1]=t[e.TableDataProperties.TableHeaders],t=n}return t},fromHost:function(t){var n;if(t.toArray)if(2===t.dimensions())n=e.Utility.twoDVBArrayToJaggedArray(t);else{var r=t.toArray();2===r.length&&(null!=r[0]&&r[0].toArray||null!=r[1]&&r[1].toArray)?((n={})[e.TableDataProperties.TableRows]=e.Utility.twoDVBArrayToJaggedArray(r[0]),n[e.TableDataProperties.TableHeaders]=e.Utility.twoDVBArrayToJaggedArray(r[1])):n=r}else n=t;return n}},t.call(this,[],n)||this}return __extends(n,t),n.prototype.unpack=function(t,n){var r;this.isComplexType(t)||e.ListType.isListType(t)?r=void 0!==n&&void 0!==n.toArray?n.toArray():n||{}:r=this.isDynamicType(t)?this.dynamicTypes[t].fromHost(n):n;return r},n}(e.SpecialProcessor);e.SafeArraySpecialProcessor=t}(OSF||(OSF={})),function(e){var t=function(){function t(t,n,r,i,o){this._requiredCount=t.length,this._apiMethods=new e.ApiMethodCall(t,n,r,i,o),this._supportedOptions=n}return t.prototype.verifyAndExtractCall=function(e,t,n){var r=this._apiMethods.extractRequiredArguments(e,t,n),i=this.extractOptions(e,r,t,n);return this._apiMethods.constructCallArgs(r,i,t,n)},t.prototype.extractOptions=function(t,n,r,i){if(t.length>this._requiredCount+1)throw e.Utility.createParameterException(e.ErrorNames.TooManyArguments);for(var o,a=t.length-1;a>=this._requiredCount;a--){var s=t[a];switch(typeof s){case"object":if(o)throw e.Utility.createParameterException(e.ErrorNames.TooManyArguments);o=s;break;default:throw e.Utility.createArgumentException(e.ErrorNames.InvalidOptionalArgument)}}return o=this._apiMethods.fillOptions(o,n,r,i),this._apiMethods.verifyArguments(this._supportedOptions,o),o},t}();e.SyncMethodCall=t}(OSF||(OSF={})),function(e){!function(t){var n={};t.define=function(t){var r,i;n[t.method]=(i=(r=t).supportedOptions?e.OUtil.createObject(r.supportedOptions):[],new e.SyncMethodCall(r.requiredArguments||[],i,r.privateStateCallbacks,r.checkCallArgs,r.method.displayName))},t.get=function(e){return n[e]}}(e.SyncMethodCalls||(e.SyncMethodCalls={}))}(OSF||(OSF={})),function(e){e.SyncMethods={MessageParent:"messageParent",MessageChild:"messageChild",SendMessage:"sendMessage",AddMessageHandler:"addEventHandler"}}(OSF||(OSF={})),function(e){!function(t){!function(t){function n(t){for(var n=[{name:e.DDA.Theming.DocumentThemeEnum.PrimaryFontColor,needToConvertToHex:!0},{name:e.DDA.Theming.DocumentThemeEnum.PrimaryBackgroundColor,needToConvertToHex:!0},{name:e.DDA.Theming.DocumentThemeEnum.SecondaryFontColor,needToConvertToHex:!0},{name:e.DDA.Theming.DocumentThemeEnum.SecondaryBackgroundColor,needToConvertToHex:!0},{name:e.DDA.Theming.DocumentThemeEnum.Accent1,needToConvertToHex:!0},{name:e.DDA.Theming.DocumentThemeEnum.Accent2,needToConvertToHex:!0},{name:e.DDA.Theming.DocumentThemeEnum.Accent3,needToConvertToHex:!0},{name:e.DDA.Theming.DocumentThemeEnum.Accent4,needToConvertToHex:!0},{name:e.DDA.Theming.DocumentThemeEnum.Accent5,needToConvertToHex:!0},{name:e.DDA.Theming.DocumentThemeEnum.Accent6,needToConvertToHex:!0},{name:e.DDA.Theming.DocumentThemeEnum.Hyperlink,needToConvertToHex:!0},{name:e.DDA.Theming.DocumentThemeEnum.FollowedHyperlink,needToConvertToHex:!0},{name:e.DDA.Theming.DocumentThemeEnum.HeaderLatinFont,needToConvertToHex:!1},{name:e.DDA.Theming.DocumentThemeEnum.HeaderEastAsianFont,needToConvertToHex:!1},{name:e.DDA.Theming.DocumentThemeEnum.HeaderScriptFont,needToConvertToHex:!1},{name:e.DDA.Theming.DocumentThemeEnum.HeaderLocalizedFont,needToConvertToHex:!1},{name:e.DDA.Theming.DocumentThemeEnum.BodyLatinFont,needToConvertToHex:!1},{name:e.DDA.Theming.DocumentThemeEnum.BodyEastAsianFont,needToConvertToHex:!1},{name:e.DDA.Theming.DocumentThemeEnum.BodyScriptFont,needToConvertToHex:!1},{name:e.DDA.Theming.DocumentThemeEnum.BodyLocalizedFont,needToConvertToHex:!1}],r={},i=0;i<n.length;i++)n[i].needToConvertToHex?r[n[i].name]=e.OUtil.convertIntToCssHexColor(t[n[i].name]):r[n[i].name]=t[n[i].name];return r}function r(t){var n={};if(t){var r=e.DDA.Theming.OfficeThemeEnum,i={bodyBackgroundColor:{name:r.BodyBackgroundColor,convertToHex:!0},bodyForegroundColor:{name:r.BodyForegroundColor,convertToHex:!0},controlBackgroundColor:{name:r.ControlBackgroundColor,convertToHex:!0},controlForegroundColor:{name:r.ControlForegroundColor,convertToHex:!0},primaryFontColor:{name:r.BodyForegroundColor,convertToHex:!0},primaryBackgroundColor:{name:r.BodyBackgroundColor,convertToHex:!0},secondaryFontColor:{name:r.ControlForegroundColor,convertToHex:!0},secondaryBackgroundColor:{name:r.ControlBackgroundColor,convertToHex:!0},fluentThemeData:{name:r.FluentThemeData,convertToHex:!1}};for(var o in t){var a=!1,s=o;i[o]&&(s=i[o].name,a=i[o].convertToHex),n[s]=a?e.OUtil.convertIntToCssHexColor(t[o]):t[o]}null==n[r.IsDarkTheme]&&(n[r.IsDarkTheme]=e.DDA.Theming.GetIsDarkThemeFromCSSHexColor(n[r.BodyBackgroundColor])),null==n[r.ThemeId]&&(n[r.ThemeId]=n[r.IsDarkTheme]?e.DDA.Theming.ThemeId.Black:e.DDA.Theming.ThemeId.White)}return n}!function(e){e.PrimaryFontColor="primaryFontColor",e.PrimaryBackgroundColor="primaryBackgroundColor",e.SecondaryFontColor="secondaryFontColor",e.SecondaryBackgroundColor="secondaryBackgroundColor",e.Accent1="accent1",e.Accent2="accent2",e.Accent3="accent3",e.Accent4="accent4",e.Accent5="accent5",e.Accent6="accent6",e.Hyperlink="hyperlink",e.FollowedHyperlink="followedHyperlink",e.HeaderLatinFont="headerLatinFont",e.HeaderEastAsianFont="headerEastAsianFont",e.HeaderScriptFont="headerScriptFont",e.HeaderLocalizedFont="headerLocalizedFont",e.BodyLatinFont="bodyLatinFont",e.BodyEastAsianFont="bodyEastAsianFont",e.BodyScriptFont="bodyScriptFont",e.BodyLocalizedFont="bodyLocalizedFont"}(t.DocumentThemeEnum||(t.DocumentThemeEnum={})),function(e){e.BodyBackgroundColor="bodyBackgroundColor",e.BodyForegroundColor="bodyForegroundColor",e.ControlBackgroundColor="controlBackgroundColor",e.ControlForegroundColor="controlForegroundColor",e.IsDarkTheme="isDarkTheme",e.ThemeId="themeId",e.FluentThemeData="fluentThemeData"}(t.OfficeThemeEnum||(t.OfficeThemeEnum={})),function(e){e.PrimaryFontColor="primaryFontColor",e.PrimaryBackgroundColor="primaryBackgroundColor",e.SecondaryFontColor="secondaryFontColor",e.SecondaryBackgroundColor="secondaryBackgroundColor",e.IsDarkTheme="isDarkTheme",e.ThemeId="themeId"}(t.OfficeThemeEnumWac||(t.OfficeThemeEnumWac={})),function(e){e[e.Colorful=0]="Colorful",e[e.DarkGray=1]="DarkGray",e[e.Black=2]="Black",e[e.White=3]="White"}(t.ThemeId||(t.ThemeId={})),t.ConvertToDocumentTheme=n,t.GetIsDarkThemeFromCSSHexColor=function(e){var t="#"===e.charAt(0)?e.substring(1,7):e;return.299*parseInt(t.substring(0,2),16)+.587*parseInt(t.substring(2,4),16)+.114*parseInt(t.substring(4,6),16)<186},t.ConvertToOfficeTheme=r;var i=function(t){var n=null,i=e._OfficeAppFactory.getHostInfo();n=i.hostPlatform==e.HostInfoPlatform.web?t:r(t);var o=e.DDA.Theming.OfficeThemeEnum;void 0===n[o.IsDarkTheme]&&(n.isDarkTheme=e.DDA.Theming.GetIsDarkThemeFromCSSHexColor(t[o.BodyBackgroundColor])),void 0===n[o.ThemeId]&&(n.themeId=n.isDarkTheme?e.DDA.Theming.ThemeId.Black:e.DDA.Theming.ThemeId.White),i.hostPlatform!=e.HostInfoPlatform.web&&"mac"!=i.hostPlatform.toLowerCase()&&"ios"!=i.hostPlatform.toLowerCase()||Office.context&&Office.context.officeTheme&&(Office.context.officeTheme.bodyBackgroundColor=n.bodyBackgroundColor,Office.context.officeTheme.bodyForegroundColor=n.bodyForegroundColor,Office.context.officeTheme.controlBackgroundColor=n.controlBackgroundColor,Office.context.officeTheme.controlForegroundColor=n.controlForegroundColor,Office.context.officeTheme.isDarkTheme=n.isDarkTheme,Office.context.officeTheme.themeId=n.themeId),e.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.OfficeThemeChanged},officeTheme:{value:n}})};t.OfficeThemeChangedEventArgs=i;var o=function(t){var r=n(t);e.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DocumentThemeChanged},documentTheme:{value:r}})};t.DocumentThemeChangedEventArgs=o}(t.Theming||(t.Theming={}))}(e.DDA||(e.DDA={}))}(OSF||(OSF={})),function(e){!function(t){var n=[];t.initialize=function(){n.forEach((function(t){t.defineMethodsFunc(),e.OUtil.getHostPlatform()==e.HostInfoPlatform.web?"function"==typeof t.defineWebParameterMapFunc&&t.defineWebParameterMapFunc():"function"==typeof t.defineSafeArrayParameterMapFunc&&t.defineSafeArrayParameterMapFunc(),"function"==typeof t.initializeFunc&&t.initializeFunc()}))},t.register=function(e){n.push(e)}}(e.V10ApiFeatureRegistry||(e.V10ApiFeatureRegistry={}))}(OSF||(OSF={})),function(e){!function(t){function n(t,n){var r=(new Date).getTime();return function(i,o){var a;if(n.onReceiving&&n.onReceiving(),0!=i)switch(i){case-5:a=7e3;break;default:a=5001}else a=o?o.Error?o.Error:0:5001;n.onComplete&&n.onComplete(a),e.AppTelemetry&&e.AppTelemetry.onRegisterDone(t,n.dispId,Math.abs((new Date).getTime()-r),a)}}t.version=1,function(e){e.Data="Data",e.Properties="Properties",e.BindingRequest="DdaBindingsMethod",e.BindingResponse="Bindings",e.SingleBindingResponse="singleBindingResponse",e.GetData="DdaGetBindingData",e.AddRowsColumns="DdaAddRowsColumns",e.SetData="DdaSetBindingData",e.ClearFormats="DdaClearBindingFormats",e.SetFormats="DdaSetBindingFormats",e.SettingsRequest="DdaSettingsMethod",e.BindingEventSource="ddaBinding",e.ArrayData="ArrayData"}(t.UniqueArguments||(t.UniqueArguments={})),t.executeAsync=function(t){t.hostCallArgs||(t.hostCallArgs={}),t.hostCallArgs.DdaMethod={ControlId:e._OfficeAppFactory.getId(),Version:e.WACDelegate.version,DispatchId:t.dispId},t.hostCallArgs.__timeout__=-1,t.onCalling&&t.onCalling(),e.getClientEndPoint()&&e.getClientEndPoint().invoke("executeMethod",(function(n,r){var i;if(t.onReceiving&&t.onReceiving(),0==n)e.WACDelegate.version=r.Version,i=r.Error;else switch(n){case-5:i=7e3;break;default:i=5001}t.onComplete&&t.onComplete(i,r)}),t.hostCallArgs)},t.getOnAfterRegisterEvent=n,t.registerEventAsync=function(t){t.onCalling&&t.onCalling(),e.getClientEndPoint()&&e.getClientEndPoint().registerForEvent(e.OUtil.getXdmEventName(t.targetId,t.eventType),(function(n){t.onEvent&&t.onEvent(n),e.AppTelemetry&&e.AppTelemetry.onEventDone(t.dispId)}),n(!0,t),{controlId:e._OfficeAppFactory.getId(),eventDispId:t.dispId,targetId:t.targetId})},t.unregisterEventAsync=function(t){t.onCalling&&t.onCalling(),e.getClientEndPoint()&&e.getClientEndPoint().unregisterForEvent(e.OUtil.getXdmEventName(t.targetId,t.eventType),n(!1,t),{controlId:e._OfficeAppFactory.getId(),eventDispId:t.dispId,targetId:t.targetId})}}(e.WACDelegate||(e.WACDelegate={}))}(OSF||(OSF={})),function(e){var t=function(t){function n(){var n=[e.WACDelegate.UniqueArguments.SingleBindingResponse,e.WACDelegate.UniqueArguments.BindingRequest,e.WACDelegate.UniqueArguments.BindingResponse,e.WACDelegate.UniqueArguments.GetData,e.WACDelegate.UniqueArguments.AddRowsColumns,e.WACDelegate.UniqueArguments.SetData,e.WACDelegate.UniqueArguments.ClearFormats,e.WACDelegate.UniqueArguments.SetFormats,e.WACDelegate.UniqueArguments.SettingsRequest,e.WACDelegate.UniqueArguments.BindingEventSource];return t.call(this,n,{})||this}return __extends(n,t),n}(e.SpecialProcessor);e.WebSpecialProcessor=t}(OSF||(OSF={})),function(e){var t=function(e){};e.Container=t}(OfficeExt||(OfficeExt={})),function(e){var t;t||(t={}),e.V10ApiFeatureRegistry.register({defineMethodsFunc:function(){e.AsyncMethodCalls.define({method:e.AsyncMethods.CloseContainerAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[]})},defineSafeArrayParameterMapFunc:function(){e.HostParameterMap.define({type:97,fromHost:[],toHost:[]})},defineWebParameterMapFunc:function(){e.HostParameterMap.define({type:97,fromHost:[],toHost:[]})},initializeFunc:function(){var t=Office.context.ui;e.OUtil.isDialog()||OfficeExt.Container&&e.DispIdHost.addAsyncMethods(t,[e.AsyncMethods.CloseContainerAsync])}})}(OSF||(OSF={})),function(e){!function(e){!function(e){e.MessageType="messageType",e.MessageContent="messageContent",e.MessageOrigin="messageOrigin"}(e.DialogMessageReceivedEventKeys||(e.DialogMessageReceivedEventKeys={})),function(e){e.MessageType="messageType",e.MessageContent="messageContent",e.MessageOrigin="messageOrigin"}(e.DialogParentMessageReceivedEventKeys||(e.DialogParentMessageReceivedEventKeys={})),function(e){e.MessageToParent="messageToParent",e.TargetOrigin="targetOrigin"}(e.MessageParentKeys||(e.MessageParentKeys={})),function(e){e.DialogNotificationShown="dialogNotificationShown"}(e.DialogNotificationShownEventType||(e.DialogNotificationShownEventType={})),function(e){e.MessageContent="messageContent",e.TargetOrigin="targetOrigin"}(e.SendMessageKeys||(e.SendMessageKeys={}))}(e.Marshaling||(e.Marshaling={}))}(OSF||(OSF={})),function(e){var t;!function(e){e.DialogParentMessageReceivedEvent="DialogParentMessageReceivedEvent",e.DialogMessageReceivedEvent="DialogMessageReceivedEvent"}(e.EventDescriptors||(e.EventDescriptors={})),e.DialogParentMessageEventDispatch=new e.EventDispatch([e.EventType.DialogParentMessageReceived,e.EventType.DialogParentEventReceived]),t||(t={}),e.V10ApiFeatureRegistry.register({defineMethodsFunc:function(){e.AsyncMethodCalls.define({method:e.AsyncMethods.DisplayDialogAsync,requiredArguments:[{name:e.ParameterNames.Url,types:["string"]}],supportedOptions:[{name:e.ParameterNames.Width,value:{types:["number"],defaultValue:99}},{name:e.ParameterNames.Height,value:{types:["number"],defaultValue:99}},{name:e.ParameterNames.RequireHTTPs,value:{types:["boolean"],defaultValue:!0}},{name:e.ParameterNames.DisplayInIframe,value:{types:["boolean"],defaultValue:!1}},{name:e.ParameterNames.HideTitle,value:{types:["boolean"],defaultValue:!1}},{name:e.ParameterNames.UseDeviceIndependentPixels,value:{types:["boolean"],defaultValue:!1}},{name:e.ParameterNames.PromptBeforeOpen,value:{types:["boolean"],defaultValue:!0}},{name:e.ParameterNames.EnforceAppDomain,value:{types:["boolean"],defaultValue:!0}},{name:e.ParameterNames.UrlNoHostInfo,value:{types:["boolean"],defaultValue:!1}}],privateStateCallbacks:[],onSucceeded:function(t,n,r){var i=t[e.ParameterNames.Id],o=t[e.ParameterNames.Data],a={},s=e.AsyncMethods.CloseAsync;e.OUtil.defineEnumerableProperty(a,s,{value:function(){var t=e.DispIdHost.CloseDialog;t(arguments,i,o,a)}});var c=e.SyncMethods.AddMessageHandler;if(e.OUtil.defineEnumerableProperty(a,c,{value:function(){var t=e.SyncMethodCalls.get(e.SyncMethods.AddMessageHandler),n=t.verifyAndExtractCall(arguments,a,o),r=n[e.ParameterNames.EventType],i=n[e.ParameterNames.Handler];return o.addEventHandlerAndFireQueuedEvent(r,i)}}),!0===e.EnableSendMessageDialogAPI){var l=e.SyncMethods.SendMessage;e.OUtil.defineEnumerableProperty(a,l,{value:function(){var t=e.DispIdHost.SendMessage;return t(arguments,o,a)}})}if(!0===e.EnableMessageChildDialogAPI){var d=e.SyncMethods.MessageChild;e.OUtil.defineEnumerableProperty(a,d,{value:function(){var t=e.DispIdHost.SendMessage;return t(arguments,o,a)}})}return a},checkCallArgs:function(t,n,r){return t[e.ParameterNames.Width]<=0&&(t[e.ParameterNames.Width]=1),!t[e.ParameterNames.UseDeviceIndependentPixels]&&t[e.ParameterNames.Width]>100&&(t[e.ParameterNames.Width]=99),t[e.ParameterNames.Height]<=0&&(t[e.ParameterNames.Height]=1),!t[e.ParameterNames.UseDeviceIndependentPixels]&&t[e.ParameterNames.Height]>100&&(t[e.ParameterNames.Height]=99),t[e.ParameterNames.RequireHTTPs]||(t[e.ParameterNames.RequireHTTPs]=!0),t}}),e.AsyncMethodCalls.define({method:e.AsyncMethods.CloseAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[]}),e.SyncMethodCalls.define({method:e.SyncMethods.MessageParent,requiredArguments:[{name:e.ParameterNames.MessageToParent,types:["string","number","boolean"]}],supportedOptions:[{name:e.ParameterNames.TargetOrigin,value:{types:["string"],defaultValue:""}}]}),e.SyncMethodCalls.define({method:e.SyncMethods.AddMessageHandler,requiredArguments:[{name:e.ParameterNames.EventType,enum:e.EventType,verify:function(e,t,n){return n.supportsEvent(e)}},{name:e.ParameterNames.Handler,types:["function"]}],supportedOptions:[]}),e.SyncMethodCalls.define({method:e.SyncMethods.SendMessage,requiredArguments:[{name:e.ParameterNames.MessageContent,types:["string"]}],supportedOptions:[{name:e.ParameterNames.TargetOrigin,value:{types:["string"],defaultValue:""}}],privateStateCallbacks:[]})},defineSafeArrayParameterMapFunc:function(){e.HostParameterMap.define({type:e.EventDispId.dispidDialogMessageReceivedEvent,fromHost:[{name:e.EventDescriptors.DialogMessageReceivedEvent,value:e.HostParameterMap.self}],isComplexType:!0}),e.HostParameterMap.define({type:e.EventDescriptors.DialogMessageReceivedEvent,fromHost:[{name:e.PropertyDescriptors.MessageType,value:0},{name:e.PropertyDescriptors.MessageContent,value:1},{name:e.PropertyDescriptors.MessageOrigin,value:2}],isComplexType:!0}),e.HostParameterMap.define({type:e.EventDispId.dispidDialogParentMessageReceivedEvent,fromHost:[{name:e.EventDescriptors.DialogParentMessageReceivedEvent,value:e.HostParameterMap.self}],isComplexType:!0}),e.HostParameterMap.define({type:e.EventDescriptors.DialogParentMessageReceivedEvent,fromHost:[{name:e.PropertyDescriptors.MessageType,value:0},{name:e.PropertyDescriptors.MessageContent,value:1},{name:e.PropertyDescriptors.MessageOrigin,value:2}],isComplexType:!0})},defineWebParameterMapFunc:function(){e.HostParameterMap.define({type:e.EventDispId.dispidDialogMessageReceivedEvent,fromHost:[{name:e.EventDescriptors.DialogMessageReceivedEvent,value:e.HostParameterMap.self}]}),e.HostParameterMap.addComplexType(e.EventDescriptors.DialogMessageReceivedEvent),e.HostParameterMap.define({type:e.EventDescriptors.DialogMessageReceivedEvent,fromHost:[{name:e.PropertyDescriptors.MessageType,value:e.Marshaling.DialogMessageReceivedEventKeys.MessageType},{name:e.PropertyDescriptors.MessageContent,value:e.Marshaling.DialogMessageReceivedEventKeys.MessageContent},{name:e.PropertyDescriptors.MessageOrigin,value:e.Marshaling.DialogMessageReceivedEventKeys.MessageOrigin}]}),e.HostParameterMap.define({type:e.EventDispId.dispidDialogParentMessageReceivedEvent,fromHost:[{name:e.EventDescriptors.DialogParentMessageReceivedEvent,value:e.HostParameterMap.self}]}),e.HostParameterMap.addComplexType(e.EventDescriptors.DialogParentMessageReceivedEvent),e.HostParameterMap.define({type:e.EventDescriptors.DialogParentMessageReceivedEvent,fromHost:[{name:e.PropertyDescriptors.MessageType,value:e.Marshaling.DialogParentMessageReceivedEventKeys.MessageType},{name:e.PropertyDescriptors.MessageContent,value:e.Marshaling.DialogParentMessageReceivedEventKeys.MessageContent},{name:e.PropertyDescriptors.MessageOrigin,value:e.Marshaling.DialogMessageReceivedEventKeys.MessageOrigin}]}),e.HostParameterMap.define({type:144,toHost:[{name:e.ParameterNames.MessageToParent,value:e.Marshaling.MessageParentKeys.MessageToParent},{name:e.ParameterNames.TargetOrigin,value:e.Marshaling.MessageParentKeys.TargetOrigin}]}),e.HostParameterMap.define({type:145,toHost:[{name:e.ParameterNames.MessageContent,value:e.Marshaling.SendMessageKeys.MessageContent},{name:e.ParameterNames.TargetOrigin,value:e.Marshaling.MessageParentKeys.TargetOrigin}]})},initializeFunc:function(){var t=e.OUtil.isPopupWindow();e.EnableMessageChildDialogAPI=!0,"onenote"==e._OfficeAppFactory.getHostInfo().hostType?e.EnableSendMessageDialogAPI=!1:e.EnableSendMessageDialogAPI=!0;var n=Office.context.ui;if(e.OUtil.isDialog()){var r=e.SyncMethods.MessageParent;n[r]||e.OUtil.defineEnumerableProperty(n,r,{value:function(){var t=e.DispIdHost.MessageParent;return t(arguments,n)}});var i=e.SyncMethods.AddMessageHandler;n[i]||void 0===e.DialogParentMessageEventDispatch||e.DispIdHost.addEventSupport(n,e.DialogParentMessageEventDispatch,t),t&&e.WacDialogAction.registerMessageReceivedEvent()}else{var o;o=null!=e.EventType.DialogParentMessageReceived?new e.EventDispatch([e.EventType.DialogMessageReceived,e.EventType.DialogEventReceived,e.EventType.DialogParentMessageReceived]):new e.EventDispatch([e.EventType.DialogMessageReceived,e.EventType.DialogEventReceived]);var a=e.AsyncMethods.DisplayDialogAsync;n[a]||e.OUtil.defineEnumerableProperty(n,a,{value:function(){var t=e.DispIdHost.OpenDialog;t(arguments,o,n)}})}e.OUtil.finalizeProperties(n)}})}(OSF||(OSF={}));var Office,OfficeExt,DialogApiManager=function(){function e(){}return e.messageChildRichApiBridge=function(){if(!0===OSF.EnableMessageChildDialogAPI){var e=OSF.DispIdHost.SendMessage;return e(arguments,null,null)}},e}();__assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},__awaiter=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new n((function(t){t(e.value)})).then(a,s)}c((r=r.apply(e,t||[])).next())}))},__generator=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};!function(e){!function(e){e.Url="url",e.Width="width",e.Height="height",e.DisplayInIframe="displayInIframe",e.HideTitle="hideTitle",e.UseDeviceIndependentPixels="useDeviceIndependentPixels",e.PromptBeforeOpen="promptBeforeOpen",e.EnforceAppDomain="enforceAppDomain",e.UrlNoHostInfo="urlNoHostInfo",e.TargetOrigin="targetOrigin"}(e.ShowWindowDialogParameterKeys||(e.ShowWindowDialogParameterKeys={})),function(e){var t="excel",n="word",r="powerpoint",i="outlook",o="visio";e.getDialogCssManager=function(e){switch(e){case t:case n:case r:case i:case o:default:return new a}};var a=function(){function e(){this.overlayElementCSS=["position: absolute","top: 0","left: 0","width: 100%","height: 100%","background-color: rgba(198, 198, 198, 0.5)","z-index: 99998"],this.dialogNotificationPanelCSS=["width: 100%","height: 190px","position: absolute","z-index: 99999","background-color: rgba(255, 255, 255, 1)","left: 0px","top: 50%","margin-top: -95px"],this.newWindowNotificationTextPanelCSS=["margin: 20px 14px","font-family: Segoe UI,Arial,Verdana,sans-serif","font-size: 14px","height: 100px","line-height: 100px"],this.newWindowNotificationTextSpanCSS=["display: inline-block","line-height: normal","vertical-align: middle"],this.crossZoneNotificationTextPanelCSS=["margin: 20px 14px","font-family: Segoe UI,Arial,Verdana,sans-serif","font-size: 14px","height: 100px"],this.dialogNotificationButtonPanelCSS="margin:0px 9px",this.buttonStyleCSS=["text-align: center","width: 70px","height: 25px","font-size: 14px","font-family: Segoe UI,Arial,Verdana,sans-serif","margin: 0px 5px","border-width: 1px","border-style: solid"]}return e.prototype.getOverlayElementCSS=function(){return this.overlayElementCSS.join(";")},e.prototype.getDialogNotificationPanelCSS=function(){return this.dialogNotificationPanelCSS.join(";")},e.prototype.getNewWindowNotificationTextPanelCSS=function(){return this.newWindowNotificationTextPanelCSS.join(";")},e.prototype.getNewWindowNotificationTextSpanCSS=function(){return this.newWindowNotificationTextSpanCSS.join(";")},e.prototype.getCrossZoneNotificationTextPanelCSS=function(){return this.crossZoneNotificationTextPanelCSS.join(";")},e.prototype.getDialogNotificationButtonPanelCSS=function(){return this.dialogNotificationButtonPanelCSS},e.prototype.getDialogButtonCSS=function(){return this.buttonStyleCSS.join(";")},e}();e.DefaultDialogCSSManager=a}(e.WacCommonUICssManager||(e.WacCommonUICssManager={})),function(t){var n=null,r=null,i=null,o=null,a="osfDialogInternal:action=closeDialog",s=null,c=!1,l=-1,d="messageParentKey",u=null,f="#ababab",p="#ffffff",m="newWindowNotificaiton",g="configureBrowserLink",h="dialogNotificationTextPanel",y={dispId:e.EventDispId.dispidDialogNotificationShownInAddinEvent,eventType:e.Marshaling.DialogNotificationShownEventType.DialogNotificationShown,onComplete:null,onCalling:null};function v(e,t){var n=t.message,r=t.targetOrigin;if(r)e.postMessage(n,r);else{var i=window.location.origin;i||(i=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")),e.postMessage(n,i)}}function S(){try{o&&o.id==m&&s&&s(12009)}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Error happened during executing displayDialogAsync callback."+t)}P()}function b(t,n){return __awaiter(this,void 0,void 0,(function(){var r,a,s,l;return __generator(this,(function(d){switch(d.label){case 0:return[4,e.OUtil.ensureOfficeStringsJs()];case 1:return d.sent(),r=!1,a=e.WacCommonUICssManager.getDialogCssManager(n),i=D(a),document.body.insertBefore(i,document.body.firstChild),(o=function(t,n){var r=document.createElement("div");r.style.cssText=t.getDialogNotificationPanelCSS(),N(r);var i=document.createElement("div");i.style.cssText=t.getCrossZoneNotificationTextPanelCSS(),i.id=h;var o=document.createElement("a");o.id=g,o.href="#",o.innerText=Strings.OfficeOM.L_NewWindowCrossZoneConfigureBrowserLink,o.setAttribute("onclick","window.open('https://support.microsoft.com/en-us/help/17479/windows-internet-explorer-11-change-security-privacy-settings', '_blank', 'fullscreen=1')");var a=document.createElement("span");if(Strings.OfficeOM.L_NewWindowCrossZone){var s=Strings.OfficeOM.L_NewWindowCrossZone.replace(/{1+}/gm,e.OUtil.getDomainForUrl(n)).split("{0}");a.appendChild(document.createTextNode(s[0])),a.appendChild(o),a.appendChild(document.createTextNode(s[1]))}return i.appendChild(a),r.appendChild(i),r}(a,t)).id="crossZoneNotification",s=x(a),l=C(a,Strings.OfficeOM.L_DialogOK?Strings.OfficeOM.L_DialogOK:"OK"),s.appendChild(l),o.appendChild(s),document.body.insertBefore(o,document.body.firstChild),c=!0,l.onclick=function(){P()},l.addEventListener("keydown",(function(e){9==e.keyCode?(document.getElementById(g).focus(),e.preventDefault(),e.stopPropagation()):13==e.keyCode&&(r=!0,e.preventDefault(),e.stopPropagation())}),!1),l.addEventListener("keyup",(function(e){13==e.keyCode&&r&&(r=!1,P(),e.preventDefault(),e.stopPropagation())}),!1),document.getElementById(g).addEventListener("keydown",(function(e){9==e.keyCode&&(l.focus(),e.preventDefault(),e.stopPropagation())}),!1),window.focus(),l.focus(),[2]}}))}))}function O(){return e._OfficeAppFactory.getInitializationHelper()instanceof e.WebInitializationHelper?e._OfficeAppFactory.getInitializationHelper().get_addInSourceUrlFromAppContext():""}function _(t){if(t.source==n)try{var i=t.origin;if(!function(t,n,r){if(void 0===r&&(r=!0),!t||!n)return!1;var i=e.OUtil.parseUrl(t),o=e.OUtil.parseUrl(n),a=e._OfficeAppFactory.getOfficeAppContext().get_appDomains();if("https:"!==i.protocol)return!1;var s=i.protocol===o.protocol&&i.hostname===o.hostname&&i.port===o.port,c=e.XdmCommunicationManager.checkUrlWithAppDomains(a,t),l=s||c;return!l&&r&&(l=e.XdmCommunicationManager.isTargetSubdomainOfSourceLocation(n,t)),l}(i,O(),!0))throw new Error("Received a message from a dialog with an untrusted domain.");var o={};o[e.Marshaling.DialogMessageReceivedEventKeys.MessageType]=0,o[e.Marshaling.DialogMessageReceivedEventKeys.MessageContent]=t.data,o[e.Marshaling.DialogMessageReceivedEventKeys.MessageOrigin]=i,r(o)}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Error happened during receive message handler."+t)}}function A(t){var n=e._OfficeAppFactory.getId()+d;if(t.key==n)try{var i={};i[e.Marshaling.DialogMessageReceivedEventKeys.MessageType]=0,i[e.Marshaling.DialogMessageReceivedEventKeys.MessageContent]=t.newValue,i[e.Marshaling.DialogMessageReceivedEventKeys.MessageOrigin]=t.origin,r(i)}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Error happened during storage changed handler."+t)}}function T(t){var i=e._OfficeAppFactory.getHostInfo(),o=[i.hostType,i.hostPlatform,i.hostSpecificFileVersion,i.hostLocale,i.osfControlAppCorrelationId,"isDialog",i.disableLogging?"disableLogging":"",i.flags&e.HostInfoFlags.PublicAddin].join("$"),a=e._OfficeAppFactory.getOfficeAppContext();a.set_taskpaneUrl(window.location.origin),a.get_taskpaneUrl()||a.set_taskpaneUrl(window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""));var c=t.url;t[e.ShowWindowDialogParameterKeys.UrlNoHostInfo]||(c=e.OUtil.addHostInfoAsQueryParam(c,o));var d=JSON.parse(window.name);d.hostInfo=o;var u=__assign({},a);if(u._appName===e.AppName.ExcelWebApp){if(!u._settings&&u._settingsFunc){var f=u._settingsFunc();u._settings=Object.keys(f).map((function(e){return[e,f[e]]}))}if(!u._hostSettings&&u._hostSettingsFunc){var p=u._hostSettingsFunc();u._hostSettings=Object.keys(p).map((function(e){return[e,p[e]]}))}d.appContext=u}else d.appContext=a;var m=t[e.ShowWindowDialogParameterKeys.Width]*screen.width/100,g=t[e.ShowWindowDialogParameterKeys.Height]*screen.height/100,h="width="+m+", height="+g+", left="+(a.get_clientWindowWidth()/2-m/2)+", top="+(a.get_clientWindowHeight()/2-g/2)+",channelmode=no,directories=no,fullscreen=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=yes,toolbar=no";if(null==(n=window.open(c,e.OUtil.serializeObjectToString(d),h)))return e.AppTelemetry.logAppCommonMessage("Encountered cross zone issue in displayDialogAsync api."),w(),b(c,i.hostType),void s(12011);e.OUtil.shouldUseLocalStorageToPassMessage()?window.addEventListener("storage",A):window.addEventListener("message",_),l=window.setInterval((function(){try{if(null==n||n.closed){window.clearInterval(l),e.OUtil.shouldUseLocalStorageToPassMessage()?window.removeEventListener("storage",A):window.removeEventListener("message",_);var t={};t[e.Marshaling.DialogMessageReceivedEventKeys.MessageType]=12006,r(t)}}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Error happened during check or handle window close."+t)}}),1e3),null!=s?s(0):e.AppTelemetry&&e.AppTelemetry.logAppException("showDialogCallback can not be null.")}function C(e,t){var n=document.createElement("input");n.setAttribute("type","button"),n.style.cssText=e.getDialogButtonCSS(),n.style.borderColor=f,n.style.backgroundColor=p,n.setAttribute("value",t);var r=function(){E(n)},i=function(){I(n)};return n.addEventListener("mouseover",r),n.addEventListener("focus",r),n.addEventListener("mouseout",i),n.addEventListener("focusout",i),n}function E(t){null!=u?(t.style.borderColor=u.HostButtonBorderColor,t.style.backgroundColor=u.HostButtonBackgroundColor):e.OUtil.getCommonUI()?(t.style.borderColor=e.OUtil.getCommonUI().HostButtonBorderColor,t.style.backgroundColor=e.OUtil.getCommonUI().HostButtonBackgroundColor):t.style.backgroundColor="#ccc"}function I(e){e.style.borderColor=f,e.style.backgroundColor=p}function P(){y.onCalling=function(e){w(),M(e)},e.WACDelegate.unregisterEventAsync(y)}function w(){null!=o&&(document.body.removeChild(o),o=null),null!=i&&(document.body.removeChild(i),i=null)}function D(e){var t=document.createElement("div");return t.style.cssText=e.getOverlayElementCSS(),t}function x(e){var t=document.createElement("div");return t.style.cssText=e.getDialogNotificationButtonPanelCSS(),"rtl"==document.documentElement.getAttribute("dir")?t.style.cssFloat="left":t.style.cssFloat="right",t}function M(t){if(0!=t){var n=document.querySelectorAll(e._OfficeAppFactory.getInitializationHelper().getTabbableElements());e.OUtil.focusToFirstTabbable(n,!1)}}function N(e){e.setAttribute("role","dialog"),e.setAttribute("aria-describedby",h)}t.setHostThemeButtonStyle=function(t){var n=t.input;null!=n&&(u={HostButtonBorderColor:n[e.OUtil.HostThemeButtonStyleKeys.ButtonBorderColor],HostButtonBackgroundColor:n[e.OUtil.HostThemeButtonStyleKeys.ButtonBackgroundColor]}),t.completed()},t.removeEventListenersForDialog=function(t){!function(t){var n=this,r=function(){e._OfficeAppFactory.getWebAppState().focused||(e._OfficeAppFactory.getWebAppState().focused=!0),e.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.Select])},i=function(){e&&(e._OfficeAppFactory.getWebAppState().focused&&(e._OfficeAppFactory.getWebAppState().focused=!1),e.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.UnSelect]))},o=function(t){if(t.preventDefault=t.preventDefault||function(){t.returnValue=!1},117==t.keyCode&&(t.ctrlKey||t.metaKey)){t.preventDefault();var r=e.AgaveHostAction.CtrlF6Exit;t.shiftKey&&(r=e.AgaveHostAction.CtrlF6ExitShift),e.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,r])}else if(9==t.keyCode){t.preventDefault();var i=document.querySelectorAll(n._tabbableElements);e.OUtil.focusToNextTabbable(i,t.target||t.srcElement,t.shiftKey)||(n._hostInfo.isDialog?e.OUtil.focusToFirstTabbable(i,t.shiftKey):t.shiftKey?e.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.TabExitShift]):e.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.TabExit]))}else if(27==t.keyCode)t.preventDefault(),S(),e.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.EscExit]);else if(113==t.keyCode)t.preventDefault(),e.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.F2Exit]);else if((t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)&&t.keyCode>=1&&t.keyCode<=255){var o={keyCode:t.keyCode,shiftKey:t.shiftKey,altKey:t.altKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey};e.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.KeyboardShortcuts,o])}},a=function(e){117==e.keyCode&&e.ctrlKey&&(e.preventDefault?e.preventDefault():e.returnValue=!1)};t?(e.OUtil.addEventListener(window,"focus",r),e.OUtil.addEventListener(window,"blur",i),e.OUtil.addEventListener(window,"keydown",o),e.OUtil.addEventListener(window,"keypress",a)):(e.OUtil.removeEventListener(window,"focus",r),e.OUtil.removeEventListener(window,"blur",i),e.OUtil.removeEventListener(window,"keydown",o),e.OUtil.removeEventListener(window,"keypress",a))}(!1),t.completed()},t.handleNewWindowDialog=function(t){return __awaiter(this,void 0,void 0,(function(){function n(t){y.onCalling=function(e){w(),M(e),s(12009)},e.WACDelegate.unregisterEventAsync(y),t.preventDefault(),t.stopPropagation()}function r(e){p.focus()}var a,l,d,u,f,p,g,v;return __generator(this,(function(S){switch(S.label){case 0:return S.trys.push([0,2,,3]),function(t){var n=e._OfficeAppFactory.getOfficeAppContext().get_appDomains(),r=t.url,i=e.XdmCommunicationManager.checkUrlWithAppDomains(n,r);if(!i){var o=O();return Boolean(o)&&e.XdmCommunicationManager.isTargetSubdomainOfSourceLocation(o,r)}return i}(t)?t[e.ShowWindowDialogParameterKeys.PromptBeforeOpen]?[4,e.OUtil.ensureOfficeStringsJs()]:(T(t),[2]):(s(12004),[2]);case 1:return S.sent(),c=!1,a=!1,l=e._OfficeAppFactory.getHostInfo(),d=e.WacCommonUICssManager.getDialogCssManager(l.hostType),u=e.OUtil.formatString(Strings.OfficeOM.L_ShowWindowDialogNotification,e._OfficeAppFactory.getOfficeAppContext().get_addinName()),i=D(d),document.body.insertBefore(i,document.body.firstChild),(o=function(e,t){var n=document.createElement("div");n.style.cssText=e.getDialogNotificationPanelCSS(),N(n);var r=document.createElement("div");r.style.cssText=e.getNewWindowNotificationTextPanelCSS(),r.id=h,"rtl"==document.documentElement.getAttribute("dir")?r.style.paddingRight="30px":r.style.paddingLeft="30px";var i=document.createElement("span");return i.style.cssText=e.getNewWindowNotificationTextSpanCSS(),i.innerText=t,r.appendChild(i),n.appendChild(r),n}(d,u)).id=m,f=x(d),p=C(d,Strings.OfficeOM.L_ShowWindowDialogNotificationAllow),g=C(d,Strings.OfficeOM.L_ShowWindowDialogNotificationIgnore),f.appendChild(p),f.appendChild(g),o.appendChild(f),document.body.insertBefore(o,document.body.firstChild),p.onclick=function(e){T(t),c||P(),e.preventDefault(),e.stopPropagation()},g.onclick=n,p.addEventListener("keydown",(function(e){e.shiftKey&&9==e.keyCode&&(I(p),E(g),g.focus(),e.preventDefault(),e.stopPropagation())}),!1),g.addEventListener("keydown",(function(e){e.shiftKey||9!=e.keyCode?13==e.keyCode&&(a=!0,e.preventDefault(),e.stopPropagation()):(I(g),E(p),p.focus(),e.preventDefault(),e.stopPropagation())}),!1),g.addEventListener("keyup",(function(e){13==e.keyCode&&a&&(a=!1,n(e))}),!1),window.focus(),y.onCalling=r,e.WACDelegate.registerEventAsync(y),[3,3];case 2:return v=S.sent(),e.AppTelemetry&&e.AppTelemetry.logAppException("Exception happens at new window dialog."+v),s(5001),[3,3];case 3:return[2]}}))}))},t.closeDialog=function(t){try{if(null!=n){if(!e.OUtil.checkFlight(e.FlightTreatmentNames.MetaOSJsonManifestAppDomainWildcards)){var r=e._OfficeAppFactory.getOfficeAppContext().get_appDomains();if(r)for(var i=0;i<r.length&&-1!==r[i].indexOf("://");i++)n.postMessage(a,r[i])}null==n||n.closed||n.close(),e.OUtil.shouldUseLocalStorageToPassMessage()?window.removeEventListener("storage",A):window.removeEventListener("message",_),window.clearInterval(l),n=null,t(0)}else t(5001)}catch(n){e.AppTelemetry&&e.AppTelemetry.logAppException("Exception happens at close window dialog."+n),t(5001)}},t.messageParent=function(t){var n=t.hostCallArgs[e.ParameterNames.MessageToParent],r=t.hostCallArgs[e.ParameterNames.TargetOrigin]||null;if(e.OUtil.shouldUseLocalStorageToPassMessage())try{var i=e._OfficeAppFactory.getId()+d;window.localStorage.setItem(i,n)}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Error happened during messageParent method:"+t)}else v(window.opener,{message:n,targetOrigin:r})},t.sendMessage=function(t){if(null!=n){var r=t.hostCallArgs,i=r[e.ParameterNames.TargetOrigin]||null;delete r[e.ParameterNames.TargetOrigin],"string"!=typeof r&&(r=JSON.stringify(r)),v(n,{message:r,targetOrigin:i})}},t.postDialogMessage=v,t.registerMessageReceivedEvent=function(){window.addEventListener("message",(function(t){if(t.source==window.opener)if("string"==typeof t.data&&t.data.indexOf(a)>-1)window.close();else{var n=t.data,r=typeof n;if(n&&("object"==r||"string"==r)){var i="string"==r?JSON.parse(n):n,o={};o[e.Marshaling.DialogMessageReceivedEventKeys.MessageContent]=i.messageContent,o[e.Marshaling.DialogMessageReceivedEventKeys.MessageOrigin]=t.origin;var s=e.manufactureEventArgs(e.EventType.DialogParentMessageReceived,null,o);e.DialogParentMessageEventDispatch.fireEvent(s)}}}))},t.setHandlerAndShowDialogCallback=function(e,t){r=e,s=t},t.escDismissDialogNotification=S,t.showCrossZoneNotification=b,t.getUrlProtocolHostnamePort=function(e){var t=e.port?":"+e.port:"";return e.protocol+"//"+e.hostname+t}}(e.WacDialogAction||(e.WacDialogAction={}))}(OSF||(OSF={})),function(e){!function(t){t.openDialog=function(t){try{t.onCalling&&t.onCalling();var n=e.SafeArrayDelegate.getOnAfterRegisterEvent(!0,t);e._OfficeAppFactory.getClientHostController().openDialog(t.dispId,void 0,t.targetId,(function(n,r){t.onEvent&&t.onEvent(r),e.AppTelemetry&&e.AppTelemetry.onEventDone(t.dispId)}),n)}catch(n){e.SafeArrayDelegate.onException(n,t)}},t.closeDialog=function(t){t.onCalling&&t.onCalling();var n=e.SafeArrayDelegate.getOnAfterRegisterEvent(!1,t);try{e._OfficeAppFactory.getClientHostController().closeDialog(t.dispId,void 0,t.targetId,n)}catch(n){e.SafeArrayDelegate.onException(n,t)}},t.messageParent=function(t){try{t.onCalling&&t.onCalling();var n=(new Date).getTime(),r=e._OfficeAppFactory.getClientHostController().messageParent(t.hostCallArgs);return t.onReceiving&&t.onReceiving(),e.AppTelemetry&&e.AppTelemetry.onMethodDone(t.dispId,t.hostCallArgs,Math.abs((new Date).getTime()-n),r),r}catch(t){return e.SafeArrayDelegate.onExceptionSyncMethod(t)}},t.sendMessage=function(t){try{t.onCalling&&t.onCalling();(new Date).getTime();var n=e._OfficeAppFactory.getClientHostController().sendMessage(t.hostCallArgs);return t.onReceiving&&t.onReceiving(),n}catch(t){return e.SafeArrayDelegate.onExceptionSyncMethod(t)}}}(e.SafeArrayDelegate||(e.SafeArrayDelegate={}))}(OSF||(OSF={})),function(e){!function(t){t.openDialog=function(n){var r="https://",i="http://",o=JSON.parse(n.targetId),a=t.getOnAfterRegisterEvent(!0,n);function s(t){var n={Error:t};try{a(0,n)}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Exception happens at showDialogCallback."+t)}}if(e.DialogShownStatus.hasDialogShown)s(12007);else{var c=o[e.ShowWindowDialogParameterKeys.Url].toLowerCase(),l=window.location.href.toLowerCase();if(e.AppTelemetry){var d=!1,u=!1,f=!1,p=!1,m="",g="";if(e.OUtil){var h=e.OUtil.parseUrl(c),y=e.OUtil.parseUrl(l);d=h.protocol===y.protocol&&h.hostname===y.hostname&&h.port===y.port,m=e.OUtil.getHostnamePortionForLogging(h.hostname),d?g=m:(g=e.OUtil.getHostnamePortionForLogging(y.hostname),u=e.XdmCommunicationManager.isTargetSubdomainOfSourceLocation(c,l),f=e.XdmCommunicationManager.isTargetSubdomainOfSourceLocation(l,c));var v=e._OfficeAppFactory.getOfficeAppContext().get_appDomains();p=e.XdmCommunicationManager.checkUrlWithAppDomains(v,c)}var S="openDialog isInline: "+o[e.ShowWindowDialogParameterKeys.DisplayInIframe].toString()+", taskpaneHostname: "+g+", dialogHostName: "+m+", isSameDomain: "+d.toString()+", parentIsSubdomain: "+u.toString()+", childIsSubdomain: "+f.toString()+", isAppDomain: "+p.toString();e.AppTelemetry.logAppCommonMessage(S)}null!=c&&c.substr(0,r.length)===r?o[e.ShowWindowDialogParameterKeys.DisplayInIframe]?(e.DialogShownStatus.isWindowDialog=!1,e.WACDelegate.registerEventAsync(n)):(e.DialogShownStatus.isWindowDialog=!0,e.WacDialogAction.setHandlerAndShowDialogCallback((function(t){n.onEvent&&n.onEvent(t),e.AppTelemetry&&e.AppTelemetry.onEventDone(n.dispId)}),s),e.WacDialogAction.handleNewWindowDialog(o)):c.substr(0,i.length)===i?s(12005):s(12003)}},t.messageParent=function(t){var n=!!t.hostCallArgs.targetOrigin;if(null!=window.opener)e.WacDialogAction.messageParent(t);else{var r=window.location.origin;r||(r=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")),n||(t.hostCallArgs.targetOrigin=r),e.WACDelegate.executeAsync(t)}},t.sendMessage=function(t){e.DialogShownStatus.hasDialogShown&&(e.DialogShownStatus.isWindowDialog?e.WacDialogAction.sendMessage(t):e.WACDelegate.executeAsync(t))},t.closeDialog=function(n){var r=t.getOnAfterRegisterEvent(!1,n);function i(t){var n={Error:t};try{r(0,n)}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Exception happens at closeDialogCallback."+t)}}e.DialogShownStatus.hasDialogShown?e.DialogShownStatus.isWindowDialog?(n.onCalling&&n.onCalling(),e.WacDialogAction.closeDialog(i)):e.WACDelegate.unregisterEventAsync(n):i(12006)}}(e.WACDelegate||(e.WACDelegate={}))}(OSF||(OSF={})),function(e){var t;t||(t={}),e.V10ApiFeatureRegistry.register({defineMethodsFunc:function(){e.AsyncMethodCalls.define({method:e.AsyncMethods.AddHandlerAsync,requiredArguments:[{name:e.ParameterNames.EventType,enum:e.EventType,verify:function(e,t,n){return n.supportsEvent(e)}},{name:e.ParameterNames.Handler,types:["function"]}],supportedOptions:[],privateStateCallbacks:[]}),e.AsyncMethodCalls.define({method:e.AsyncMethods.RemoveHandlerAsync,requiredArguments:[{name:e.ParameterNames.EventType,enum:e.EventType,verify:function(e,t,n){return n.supportsEvent(e)}}],supportedOptions:[{name:e.ParameterNames.Handler,value:{types:["function","object"],defaultValue:null}}],privateStateCallbacks:[]})}})}(OSF||(OSF={})),function(e){var t;e.NestedAppAuth||(e.NestedAppAuth={}),t=function(){function t(){this._events=[]}return t.prototype.postMessage=function(t){var n=this;!function(t,n){var r=e._OfficeAppFactory.getAsyncMethodExecutor(),i={toSafeArrayHost:function(){return[]},fromSafeArrayHost:function(e){return null},toWebHost:function(){return{requestPayload:t}},fromWebHost:function(e){return e.responsePayload}};r.executeAsync(209,i,n)}(t,(function(e){"succeeded"==e.status&&n._events.forEach((function(t){t(e.value)}))}))},t.prototype.addEventListener=function(e,t){"message"===e&&this._events.push(t)},t.prototype.removeEventListener=function(e,t){"message"===e&&(this._events=this._events.filter((function(e){return e!=t})))},t}(),e.V10ApiFeatureRegistry.register({defineMethodsFunc:function(){},initializeFunc:function(){var n=e._OfficeAppFactory.getOfficeAppContext(),r=n.get_nestedAppAuthBridgeType();if(1===r)window.nestedAppAuthBridge=new t;else if(2!==r||window.nestedAppAuthBridge){if(3===r){var i=n.get_topFrameOrigin();e.pairwiseBrokerConfig={enabled:!0,trustedBrokerDomain:i||void 0}}}else{var o=n.get_topFrameOrigin();o&&e._OfficeAppFactory.getInitializationHelper().setCreateNaaBridge((function(){return function(t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),n=e.LoadScriptHelper.getHostBundleJsBasePath()+"webauth/hubsdknaabridge.min.js",[4,e.OUtil.loadScriptPromise(n,e.LoadScriptHelper.getTrustedTypesPolicy())];case 1:return r.sent()&&HubSdkNaaBridge.initializeBridge(t),[3,3];case 2:return r.sent(),[3,3];case 3:return[2]}}))}))}(o)}))}}})}(OSF||(OSF={})),function(e){!function(t){!function(t){t.getAuthContextAsync=function(t){function n(e){var t=e.userObjectId||"",n=e.tenantId||"",r=e.userPrincipalName||"";return{userObjectId:t,tenantId:n,userPrincipalName:r,authorityType:e.authorityType||"",authorityBaseUrl:e.authorityBaseUrl||"",puid:e.puid||"",loginHint:e.loginHint||r}}var r={toSafeArrayHost:function(){return[]},fromSafeArrayHost:function(e){try{return n(JSON.parse(e))}catch(e){return null}},toWebHost:function(){return{}},fromWebHost:function(e){return n(e)}};e._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(205,r,t)}}(t.Auth||(t.Auth={}))}(e.DDA||(e.DDA={}))}(OSF||(OSF={})),function(e){!function(t){t.getAuthContext=function(){return new e.Promise((function(t,n){OSF.DDA.Auth.getAuthContextAsync((function(r){r.status===e.AsyncResultStatus.Succeeded?t(r.value):n(r.error)}))}))}}(e.auth||(e.auth={}))}(Office||(Office={})),function(e){var t;t||(t={}),e.V10ApiFeatureRegistry.register({defineMethodsFunc:function(){e.AsyncMethodCalls.define({method:e.AsyncMethods.OpenBrowserWindow,requiredArguments:[{name:e.ParameterNames.Url,types:["string"]}],supportedOptions:[{name:e.ParameterNames.Reserved,value:{types:["number"],defaultValue:0}}],privateStateCallbacks:[]})},defineSafeArrayParameterMapFunc:function(){e.HostParameterMap.define({type:102,toHost:[{name:e.ParameterNames.Reserved,value:0},{name:e.ParameterNames.Url,value:1}]})},initializeFunc:function(){if(e.OUtil.getHostPlatform()!=e.HostInfoPlatform.web){var t=Office.context.ui;e.DispIdHost.addAsyncMethods(t,[e.AsyncMethods.OpenBrowserWindow])}}})}(OSF||(OSF={})),function(e){!function(e){e.NoFilter="noFilter",e.AAD="aad",e.MSA="msa"}(e.AccountTypeFilter||(e.AccountTypeFilter={}))}(OSF||(OSF={})),function(e){!function(e){!function(e){e.ForceConsent="forceConsent",e.ForceAddAccount="forceAddAccount",e.AuthChallenge="authChallenge",e.AllowConsentPrompt="allowConsentPrompt",e.ForMSGraphAccess="forMSGraphAccess",e.AllowSignInPrompt="allowSignInPrompt",e.EnableNewHosts="enableNewHosts",e.AccountTypeFilter="accountTypeFilter",e.AddinTrustId="addinTrustId"}(e.GetAccessTokenKeys||(e.GetAccessTokenKeys={})),function(e){e.AccessToken="accessToken"}(e.AccessTokenResultKeys||(e.AccessTokenResultKeys={}))}(e.Marshaling||(e.Marshaling={}))}(OSF||(OSF={})),function(e){var t=function(e){};e.SingleSignOn=t}(OfficeExt||(OfficeExt={})),function(e){e.SingleSignOn||(e.SingleSignOn={}),e.V10ApiFeatureRegistry.register({defineMethodsFunc:function(){e.AsyncMethodCalls.define({method:e.AsyncMethods.GetAccessTokenAsync,requiredArguments:[],supportedOptions:[{name:e.ParameterNames.ForceConsent,value:{types:["boolean"],defaultValue:!1}},{name:e.ParameterNames.ForceAddAccount,value:{types:["boolean"],defaultValue:!1}},{name:e.ParameterNames.AuthChallenge,value:{types:["string"],defaultValue:""}},{name:e.ParameterNames.AllowConsentPrompt,value:{types:["boolean"],defaultValue:!1}},{name:e.ParameterNames.ForMSGraphAccess,value:{types:["boolean"],defaultValue:!1}},{name:e.ParameterNames.AllowSignInPrompt,value:{types:["boolean"],defaultValue:!1}},{name:e.ParameterNames.EnableNewHosts,value:{types:["number"],defaultValue:0}},{name:e.ParameterNames.AccountTypeFilter,value:{enum:e.AccountTypeFilter,defaultValue:e.AccountTypeFilter.NoFilter}}],checkCallArgs:function(t,n,r){var i,o=e._OfficeAppFactory.getOfficeAppContext();if(o&&o.get_wopiHostOriginForSingleSignOn()){var a=e.OUtil.Guid.generateNewGuid();window.parent.parent.postMessage('{"MessageId":"AddinTrustedOrigin","AddinTrustId":"'+a+'"}',o.get_wopiHostOriginForSingleSignOn()),t[e.ParameterNames.AddinTrustId]=a}if(window.Office.context.requirements.isSetSupported("JsonPayloadSSO")){for(var s=((i={})[e.ParameterNames.ForceConsent]=!1,i[e.ParameterNames.ForceAddAccount]=!1,i[e.ParameterNames.AuthChallenge]=!0,i[e.ParameterNames.AllowConsentPrompt]=!0,i[e.ParameterNames.ForMSGraphAccess]=!0,i[e.ParameterNames.AllowSignInPrompt]=!0,i[e.ParameterNames.EnableNewHosts]=!0,i[e.ParameterNames.AccountTypeFilter]=!0,i),c={},l=0,d=Object.keys(s);l<d.length;l++){var u=d[l];s[u]&&(c[u]=t[u]),delete t[u]}t[e.ParameterNames.JsonPayload]=JSON.stringify(c)}return t},onSucceeded:function(t,n,r){return t[e.ParameterNames.Data]}})},defineSafeArrayParameterMapFunc:function(){e.HostParameterMap.define({type:98,toHost:[{name:e.ParameterNames.JsonPayload,value:0},{name:e.ParameterNames.ForceConsent,value:0},{name:e.ParameterNames.ForceAddAccount,value:1},{name:e.ParameterNames.AuthChallenge,value:2},{name:e.ParameterNames.AllowConsentPrompt,value:3},{name:e.ParameterNames.ForMSGraphAccess,value:4},{name:e.ParameterNames.AllowSignInPrompt,value:5}],fromHost:[{name:e.ParameterNames.Data,value:e.HostParameterMap.self}]})},defineWebParameterMapFunc:function(){e.HostParameterMap.define({type:98,toHost:[{name:e.ParameterNames.ForceConsent,value:e.Marshaling.GetAccessTokenKeys.ForceConsent},{name:e.ParameterNames.ForceAddAccount,value:e.Marshaling.GetAccessTokenKeys.ForceAddAccount},{name:e.ParameterNames.AuthChallenge,value:e.Marshaling.GetAccessTokenKeys.AuthChallenge},{name:e.ParameterNames.AllowConsentPrompt,value:e.Marshaling.GetAccessTokenKeys.AllowConsentPrompt},{name:e.ParameterNames.ForMSGraphAccess,value:e.Marshaling.GetAccessTokenKeys.ForMSGraphAccess},{name:e.ParameterNames.AllowSignInPrompt,value:e.Marshaling.GetAccessTokenKeys.AllowSignInPrompt},{name:e.ParameterNames.EnableNewHosts,value:e.Marshaling.GetAccessTokenKeys.EnableNewHosts},{name:e.ParameterNames.AccountTypeFilter,value:e.Marshaling.GetAccessTokenKeys.AccountTypeFilter},{name:e.ParameterNames.AddinTrustId,value:e.Marshaling.GetAccessTokenKeys.AddinTrustId}],fromHost:[{name:e.ParameterNames.Data,value:e.Marshaling.AccessTokenResultKeys.AccessToken}]})},initializeFunc:function(){var t=Office.context.auth;e.DispIdHost.addAsyncMethods(t,[e.AsyncMethods.GetAccessTokenAsync])}})}(OSF||(OSF={})),function(e){e.BootStrapExtension.prepareApiSurface=function(){return new Promise((function(){e.V10ApiFeatureRegistry.initialize()}))}}(OSF||(OSF={}));var oteljs,OSF,Outlook;__assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};!function(e){function t(e,t,n,r){return{name:e,dataType:t,value:n,classification:r||4}}e.makeBooleanDataField=function(e,n,r){return t(e,1,n,r)},e.makeInt64DataField=function(e,n,r){return t(e,2,n,r)},e.makeDoubleDataField=function(e,n,r){return t(e,3,n,r)},e.makeStringDataField=function(e,n,r){return t(e,0,n,r)},e.makeGuidDataField=function(e,n,r){return t(e,4,n,r)}}(oteljs||(oteljs={})),function(e){!function(e){e[e.EssentialServiceMetadata=1]="EssentialServiceMetadata",e[e.AccountData=2]="AccountData",e[e.SystemMetadata=4]="SystemMetadata",e[e.OrganizationIdentifiableInformation=8]="OrganizationIdentifiableInformation",e[e.EndUserIdentifiableInformation=16]="EndUserIdentifiableInformation",e[e.CustomerContent=32]="CustomerContent",e[e.AccessControl=64]="AccessControl",e[e.PublicNonPersonalData=128]="PublicNonPersonalData",e[e.EndUserPseudonymousInformation=256]="EndUserPseudonymousInformation",e[e.PublicPersonalData=512]="PublicPersonalData",e[e.SupportData=1024]="SupportData",e[e.DirectMeasurementData=2048]="DirectMeasurementData",e[e.Everything=65535]="Everything"}(e.DataClassification||(e.DataClassification={})),function(e){e[e.String=0]="String",e[e.Boolean=1]="Boolean",e[e.Int64=2]="Int64",e[e.Double=3]="Double",e[e.Guid=4]="Guid"}(e.DataFieldType||(e.DataFieldType={})),function(e){e[e.NotSet=0]="NotSet",e[e.Measure=1]="Measure",e[e.Diagnostics=2]="Diagnostics",e[e.CriticalBusinessImpact=191]="CriticalBusinessImpact",e[e.CriticalCensus=192]="CriticalCensus",e[e.CriticalExperimentation=193]="CriticalExperimentation",e[e.CriticalUsage=194]="CriticalUsage"}(e.SamplingPolicy||(e.SamplingPolicy={})),function(e){e[e.NotSet=0]="NotSet",e[e.Normal=1]="Normal",e[e.High=2]="High"}(e.PersistencePriority||(e.PersistencePriority={})),function(e){e[e.NotSet=0]="NotSet",e[e.Normal=1]="Normal",e[e.High=2]="High"}(e.CostPriority||(e.CostPriority={})),function(e){e[e.NotSet=0]="NotSet",e[e.SoftwareSetup=1]="SoftwareSetup",e[e.ProductServiceUsage=2]="ProductServiceUsage",e[e.ProductServicePerformance=4]="ProductServicePerformance",e[e.DeviceConfiguration=8]="DeviceConfiguration",e[e.InkingTypingSpeech=16]="InkingTypingSpeech"}(e.DataCategories||(e.DataCategories={})),function(e){e[e.ReservedDoNotUse=0]="ReservedDoNotUse",e[e.Required=10]="Required",e[e.BasicEvent=10]="BasicEvent",e[e.Optional=100]="Optional",e[e.FullEvent=100]="FullEvent",e[e.RequiredServiceData=110]="RequiredServiceData",e[e.NecessaryServiceDataEvent=110]="NecessaryServiceDataEvent",e[e.RequiredServiceDataForEssentialServices=120]="RequiredServiceDataForEssentialServices",e[e.AlwaysOnNecessaryServiceDataEvent=120]="AlwaysOnNecessaryServiceDataEvent"}(e.DiagnosticLevel||(e.DiagnosticLevel={})),function(e){e[e.None=0]="None",e[e.MocaAddIn=1]="MocaAddIn"}(e.CustomerContentType||(e.CustomerContentType={})),function(e){e[e.Error=0]="Error",e[e.Warning=1]="Warning",e[e.Info=2]="Info",e[e.Verbose=3]="Verbose"}(e.LogLevel||(e.LogLevel={})),function(e){e[e.Core=0]="Core",e[e.Sink=1]="Sink",e[e.Transport=2]="Transport"}(e.Category||(e.Category={})),function(e){e[e.Hourly=1]="Hourly",e[e.Daily=2]="Daily"}(e.DnmInterval||(e.DnmInterval={})),function(e){e[e.ReleaseAudienceGroup=1]="ReleaseAudienceGroup",e[e.WacRing=2]="WacRing",e[e.AppName=3]="AppName",e[e.AppPlatform=4]="AppPlatform",e[e.AppVersion=5]="AppVersion"}(e.AllowedPartA||(e.AllowedPartA={})),function(e){e[e.SendTelemetryEvent=1]="SendTelemetryEvent",e[e.CustomerContent=2]="CustomerContent",e[e.DirectNumericEvent=3]="DirectNumericEvent"}(e.EventType||(e.EventType={}))}(oteljs||(oteljs={})),function(e){e.getEffectiveEventFlags=function(t){var n={costPriority:1,samplingPolicy:1,persistencePriority:1,dataCategories:0,diagnosticLevel:100};return t.eventFlags&&t.eventFlags.dataCategories||e.logNotification(0,0,(function(){return"DataCategories"})),t.eventFlags?(t.eventFlags.costPriority&&(n.costPriority=t.eventFlags.costPriority),t.eventFlags.samplingPolicy&&(n.samplingPolicy=t.eventFlags.samplingPolicy),t.eventFlags.persistencePriority&&(n.persistencePriority=t.eventFlags.persistencePriority),t.eventFlags.dataCategories&&(n.dataCategories=t.eventFlags.dataCategories),t.eventFlags.diagnosticLevel&&(n.diagnosticLevel=t.eventFlags.diagnosticLevel),n):n}}(oteljs||(oteljs={})),function(e){var t,n=(t=[],{fireEvent:function(e){t.forEach((function(t){return t(e)}))},addListener:function(e){e&&t.push(e)}});function r(e,t,r){n.fireEvent({level:e,category:t,message:r})}e.onNotification=function(){return n},e.logNotification=r,e.logError=function(e,t,n){r(0,e,(function(){var e=n instanceof Error?n.message:"";return"".concat(t,": ").concat(e)}))}}(oteljs||(oteljs={})),function(e){var t;function n(e){var t={eventName:e.eventName,eventFlags:e.eventFlags||{},telemetryProperties:e.telemetryProperties?__assign({},e.telemetryProperties):{},dataFields:e.dataFields?e.dataFields.slice():[],timestamp:e.timestamp||(new Date).getTime()};return e.eventContract&&(t.eventContract={name:e.eventContract.name,dataFields:e.eventContract.dataFields.slice()}),t}!function(e){e[e.TelemetryData=0]="TelemetryData",e[e.AnonymousData=1]="AnonymousData",e[e.CustomerContent=2]="CustomerContent"}(t||(t={})),e.SuppressNexus=-1,e.cloneEvent=n;var r=function(){function t(e,t,n){var r,i,o;this.telemetrySinks=[],this.persistentDataFields=[],this.partAFields=[],this.eventQueue=[],this.config=n||{},e&&(this.telemetrySinks=e.telemetrySinks,(r=this.persistentDataFields).push.apply(r,e.persistentDataFields),this.config=__assign(__assign({},e.getConfig()),this.config),(i=this.partAFields).push.apply(i,e.partAFields)),t&&(o=this.persistentDataFields).push.apply(o,t)}return t.prototype.addEventContentType=function(t,n){t.push(e.makeInt64DataField("EventContent.Type",n))},t.prototype.sendTelemetryEvent=function(t){var r=n(t),i=r.telemetryProperties;i.nexusTenantToken=e.SuppressNexus;var o=i.ariaTenantToken;if(!o&&(!e.fillTenantTokens(r.eventName,i)&&!o))return void e.logNotification(0,0,(function(){return"No tenant token: "+t.eventName}));this.sendTelemetryEventInternal(r,1)},t.prototype.sendNonStandardEvent=function(e,t){var r=n(e);this.sendTelemetryEventInternal(r,t)},t.prototype.sendCustomerContent=function(e){var t=n(e),r=t.telemetryProperties,i=r.customerContentVersion;return(!i||i>2)&&(r.customerContentVersion=2),r.ariaTenantToken=void 0,r.nexusTenantToken=void 0,r.dnmToken=void 0,this.addEventContentType(t.dataFields,2),this.sendTelemetryEventInternal(t,2)},t.prototype.sendDirectNumericEvent=function(t){var r=n(t),i=r.telemetryProperties;if(!i.dnmToken&&(!e.fillTenantTokens(r.eventName,i)&&!i.dnmToken))return void e.logNotification(0,0,(function(){return"No dnm token: "+r.eventName}));this.addEventContentType(r.dataFields,1),this.sendTelemetryEventInternal(r,3)},t.prototype.sendTelemetryEventInternal=function(t,n){if(2===n||!t.telemetryProperties.customerContentVersion&&!t.telemetryProperties.customerContentType){try{if(0===this.telemetrySinks.length)return void(this.config.enableQueue&&this.eventQueue.length<1e3?this.eventQueue.push([t,n]):e.logNotification(1,0,(function(){return"No telemetry sinks are attached."})));this.processTelemetryEvent(t,n)}catch(t){return void e.logError(0,"SendTelemetryEvent",t)}this.telemetrySinks.forEach((function(e){try{3===n||2===n?e.sendNonStandardEvent&&e.sendNonStandardEvent(t,n):e.sendTelemetryEvent(t)}catch(e){}}))}else e.logNotification(0,0,(function(){return"Customer content"}))},t.prototype.processTelemetryEvent=function(t,n){var r,i,o;if(t.dataFields&&(null===(o=t.dataFields)||void 0===o||o.unshift(e.makeStringDataField("OTelJS.Version",e.oteljsVersion)),3!==n&&this.persistentDataFields&&(r=t.dataFields).unshift.apply(r,this.persistentDataFields)),this.partAFields.length>0){var a=t.eventContract||{name:"",dataFields:[]};(i=a.dataFields).push.apply(i,this.partAFields),t.eventContract=a}this.config.disableValidation||e.validateTelemetryEvent(t)},t.prototype.addSink=function(e){this.telemetrySinks.push(e),this.flushQueue()},t.prototype.flushQueue=function(){var e=this.eventQueue;if(this.eventQueue=[],this.telemetrySinks.length>0)for(var t=0,n=e;t<n.length;t++){var r=n[t],i=r[0],o=r[1];this.sendTelemetryEventInternal(i,o)}},t.prototype.setTenantToken=function(t,n,r){e.setTenantTokens(t,{ariaTenantToken:n,nexusTenantToken:r})},t.prototype.setDNMToken=function(t,n){e.setTenantTokens(t,{dnmToken:n})},t.prototype.cloneEvent=function(e){return n(e)},t.prototype.getConfig=function(){return this.config},t}();e.SimpleTelemetryLogger=r}(oteljs||(oteljs={})),function(e){var t=9007199254740991,n=/^Office(\.[A-Z][a-zA-Z0-9]*){2,}$/,r=/^[a-zA-Z0-9_\.]{1,95}$/;function i(e){return r.test(e)}function o(e){e&&e.forEach((function(e){if("string"!=typeof e.name||!i(e.name))throw new Error("Invalid dataField name");2===e.dataType&&a(e.value)}))}function a(e){if("number"!=typeof e||!isFinite(e)||Math.floor(e)!==e||e<-9007199254740991||e>t)throw new Error("Invalid integer ".concat(JSON.stringify(e)))}e.validateTelemetryEvent=function(e){if(!function(e){if(!e||e.length>98)return!1;return n.test(e)}(e.eventName))throw new Error("Invalid eventName");var t=e.eventContract;if(t){if(t.name&&!i(t.name))throw new Error("Invalid eventContract");o(t.dataFields)}o(e.dataFields)},e.validateInt=a}(oteljs||(oteljs={})),function(e){var t={};e.setTenantTokens=function(n,r){"Office."===n.substring(0,7)&&"."!==n[n.length-1]?t[n]?(r.ariaTenantToken&&(t[n].ariaTenantToken=r.ariaTenantToken),r.dnmToken&&(t[n].dnmToken=r.dnmToken)):t[n]=r:e.logNotification(0,0,(function(){return"Namespace: ".concat(n)}))},e.fillTenantTokens=function(e,n){for(var r=e.length;r>0;){var i=e.substr(0,r);if(t[i]){var o=t[i];return n.ariaTenantToken=o.ariaTenantToken,n.dnmToken=o.dnmToken,!0}r=e.lastIndexOf(".",r-1)}return!1},e.clear=function(){t={}}}(oteljs||(oteljs={})),function(e){e.oteljsVersion="4.18.0"}(oteljs||(oteljs={})),function(e){var t="AppTelemetry is disabled for this platform.",n="AgaveSink has no available sink",r=function(){function r(t){e.TelemetryContext.setTelemetryContext(t),this.initialize()}return r.createInstance=function(e){void 0===e&&(e={});var t=new r(e);if(t._sink)return t},r.prototype.initialize=function(){if(!this.isTelemetryEnabled())return this.failToInitialize(t);if(e.RichApiSink.isSupportedByDeclaration())this.connectRichApiSink();else if(e.OutlookSink.isSupported())this.connectSink("OutlookSink",new e.OutlookSink);else{if(!e.TelemetryContext.isWacAgave()||!e.SdxWacSink.isSupported())return this.failToInitialize();this.connectSink("SdxWacSink",new e.SdxWacSink)}},r.prototype.failToInitialize=function(t){this._sink=void 0;var r=t||n;e.logNotification(0,1,(function(){return r}))},r.prototype.sendTelemetryEvent=function(t){if(this._sink)try{this._sink.sendTelemetryEvent(t)}catch(t){e.logError(1,"AgaveSink",t)}else e.logNotification(0,1,(function(){return n}))},r.prototype.sendCustomerContent=function(t){if(this._sink&&this._sink.sendCustomerContent)try{this._sink.sendCustomerContent(t)}catch(t){e.logError(1,"AgaveSink",t)}else e.logNotification(0,1,(function(){return n}))},r.prototype.connectSink=function(t,n){this._sink=n,e.logNotification(2,1,(function(){return"AgaveSink is using "+t}))},r.prototype.connectRichApiSink=function(){this.connectSink("RichApiSink",new e.RichApiSink)},r.prototype.isTelemetryEnabled=function(){return!(void 0===OSF||void 0===OSF.AppTelemetry||"boolean"!=typeof OSF.AppTelemetry.enableTelemetry||!OSF.AppTelemetry.enableTelemetry)||(e.logNotification(1,0,(function(){return t})),!1)},r}();e.AgaveSink=r}(oteljs||(oteljs={})),function(e){function t(e){return Office.context.requirements.isSetSupported("OutlookTelemetry",e)}var n=function(){function n(){this._supportsAllEvents=!1,this._contextDataFields=[],this._supportsAllEvents=t("1.1");var n=e.TelemetryContext.getAppPlatform();"iOS"!==n&&"Android"!==n||(this._contextDataFields=e.TelemetryContext.getDataFieldsFromContext())}return n.isSupported=function(){try{return t()}catch(e){return!1}},n.prototype.sendTelemetryEvent=function(t){this._supportsAllEvents||t.eventName.match(/^Office\.Extensibility\.OfficeJs\.[a-zA-Z]*$/)?(this.addAdditionalDataFields(t),Office.context.mailbox.logTelemetry(JSON.stringify(t))):e.logNotification(2,1,(function(){return"This version of Outlook only accepts OfficeJS telemetry events"}))},n.prototype.sendCustomerContent=function(e){t("1.2")&&(this.addAdditionalDataFields(e),Office.context.mailbox.logCustomerContentTelemetry(JSON.stringify(e)))},n.prototype.addAdditionalDataFields=function(e){var t;e.dataFields=e.dataFields||[],(t=e.dataFields).push.apply(t,this._contextDataFields)},n}();e.OutlookSink=n}(oteljs||(oteljs={})),function(e){var t=function(){function t(){var e=this;this._requestIsPending=!0,this._telemetryQueue=[],this._customerContentQueue=[],this.pause(1e3).then((function(){return e._requestIsPending=!1,e.processTelemetryEvents()})).catch()}return t.isSupportedByDeclaration=function(){return t.isSupportedVersion("1.2")},t.isSupportedVersion=function(e){return Office.context.requirements.isSetSupported("Telemetry",e)},t.prototype.sendCustomerContent=function(e){t.isSupportedVersion("1.3")&&(this._customerContentQueue.push(e),this.processWorkBacklog())},t.prototype.sendTelemetryEvent=function(e){this._telemetryQueue.push(e),this.processWorkBacklog()},t.prototype.processWorkBacklog=function(){var t=this;this._requestIsPending||(this._requestIsPending=!0,this.processTelemetryEvents().then((function(){t.waitAndProcessMore()})).catch((function(n){e.logError(1,"RichApiSink Error",n),t.waitAndProcessMore()})))},t.prototype.waitAndProcessMore=function(){var e=this;this.pause(1e3).then((function(){e._requestIsPending=!1,e._telemetryQueue.length>0&&setTimeout((function(){return e.processWorkBacklog()}),0)})).catch((function(){e._requestIsPending=!1}))},t.prototype.processTelemetryEvents=function(){var t=this,n=this._telemetryQueue;this._telemetryQueue=[];var r=this._customerContentQueue;this._customerContentQueue=[];var i=new OfficeCore.RequestContext,o=function(n,r){if(n.telemetryProperties){var i=[];t.addDataFields(i,n.dataFields);var o=n.eventContract?n.eventContract.name:"";n.eventContract&&t.addDataFields(i,n.eventContract.dataFields),r(n.telemetryProperties,n.eventName,o,e.getEffectiveEventFlags(n),i)}};return n.forEach((function(e){o(e,(function(e,t,n,r,o){i.telemetry.sendTelemetryEvent(e,t,n,r,o)}))})),r.forEach((function(e){o(e,(function(e,t,n,r,o){i.telemetry.sendCustomerContent(e,t,n,r,o)}))})),i.sync().catch((function(t){e.logError(1,"RichApi telemetry failed.",t)}))},t.prototype.addDataFields=function(e,t){t&&t.forEach((function(t){e.push({name:t.name,value:t.value,classification:t.classification?t.classification:4,type:4===t.dataType?0:t.dataType})}))},t.prototype.pause=function(e){return new Office.Promise((function(t){return setTimeout(t,e)}))},t}();e.RichApiSink=t}(oteljs||(oteljs={})),function(e){!function(t){!function(t){!function(t){!function(t){t.getFields=function(t,n){var r=[];return void 0!==n.id&&r.push(e.makeStringDataField("".concat(t,".Id"),n.id)),void 0!==n.version&&r.push(e.makeStringDataField("".concat(t,".Version"),n.version)),void 0!==n.instanceId&&r.push(e.makeStringDataField("".concat(t,".InstanceId"),n.instanceId)),void 0!==n.name&&r.push(e.makeStringDataField("".concat(t,".Name"),n.name)),void 0!==n.marketplaceType&&r.push(e.makeStringDataField("".concat(t,".MarketplaceType"),n.marketplaceType)),void 0!==n.sessionId&&r.push(e.makeStringDataField("".concat(t,".SessionId"),n.sessionId)),void 0!==n.browserToken&&r.push(e.makeStringDataField("".concat(t,".BrowserToken"),n.browserToken)),void 0!==n.osfRuntimeVersion&&r.push(e.makeStringDataField("".concat(t,".OsfRuntimeVersion"),n.osfRuntimeVersion)),void 0!==n.officeJsVersion&&r.push(e.makeStringDataField("".concat(t,".OfficeJsVersion"),n.officeJsVersion)),void 0!==n.hostJsVersion&&r.push(e.makeStringDataField("".concat(t,".HostJsVersion"),n.hostJsVersion)),void 0!==n.assetId&&r.push(e.makeStringDataField("".concat(t,".AssetId"),n.assetId)),void 0!==n.providerName&&r.push(e.makeStringDataField("".concat(t,".ProviderName"),n.providerName)),void 0!==n.type&&r.push(e.makeStringDataField("".concat(t,".Type"),n.type)),r}}(t.SDX||(t.SDX={}))}(t.System||(t.System={}))}(t.Office||(t.Office={}))}(e.Contracts||(e.Contracts={}))}(oteljs||(oteljs={})),function(e){var t=function(){function t(){}return t.isSupported=function(){return Office.context&&Office.context.platform?Office.context.platform===Office.PlatformType.OfficeOnline:OfficeExt&&OfficeExt.HostName&&OfficeExt.HostName.Host&&OfficeExt.HostName.Host.getInstance().getPlatform()===Office.PlatformType.OfficeOnline},t.prototype.sendTelemetryEvent=function(t,n){try{if(t.dataFields&&t.dataFields.filter((function(e){var t=e.classification;return t&&4!==t&&1!==t})).length>0)return;var r=OSF._OfficeAppFactory.getId(),i=OSF.AgaveHostAction.SendTelemetryEvent;OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[r,i,t])}catch(t){e.logError(1,"AgaveWacSink",t)}},t.prototype.sendCustomerContent=function(t,n){try{if(t.dataFields&&t.dataFields.filter((function(e){var t=e.classification;return t&&4!==t&&1!==t&&32!==t})).length>0)return;var r=OSF._OfficeAppFactory.getId(),i=OSF.AgaveHostAction.SendCustomerContent;OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[r,i,t])}catch(t){e.logError(1,"AgaveWacSink",t)}},t}();e.SdxWacSink=t}(oteljs||(oteljs={})),function(e){var t=function(){function e(){}return e.setTelemetryContext=function(e){this._steContext=e},e.getDataFieldsFromContext=function(){var e=this,t=[];return Object.keys(this._steContext).forEach((function(n){t.push({name:n,value:e._steContext[n],dataType:0})})),t},e.getAppName=function(){return this._steContext["App.Name"]},e.getAppPlatform=function(){return this._steContext["App.Platform"]},e.getAppVersion=function(){return this._steContext["App.Version"]},e.isWacAgave=function(){return"Web"===this._steContext["App.Platform"]},e._steContext={},e}();e.TelemetryContext=t}(oteljs||(oteljs={})),function(e){e.OUtil.setLibraryReleaseVehicle(1)}(OSF||(OSF={})),(()=>{"use strict";var e={721(e){e.exports=Microsoft},301(e){e.exports=OSF}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};function i(e){return null==e}n.d(r,{default:()=>Za});var o,a="office_strings.js",s="office_strings.debug.js",c="outlook_strings.js",l=window;function d(e){return o[e]}var u,f="",p="",m=null,g=!1;function h(e){var t,n,r=document.createElement("script");return r.type="text/javascript",r.src=null!==(n=null===(t=OSF.TrustedTypesPolicy)||void 0===t?void 0:t.createScriptURL(e))&&void 0!==n?n:e,r}function y(){g=!0,i(u)||!i(m.readyState)&&(i(m.readyState)||"loaded"!==m.readyState&&"complete"!==m.readyState)||(m.onload=null,m.onreadystatechange=null,void 0!==l._u&&(o=l._u.ExtensibilityStrings),u())}function v(){if(!g){var e=document.getElementsByTagName("head")[0],t=p+"en-us/"+c;m.onload=null,m.onreadystatechange=null,(m=h(t)).onload=y,m.onreadystatechange=y,e.appendChild(m)}}function S(e,t,n){var r=n.substring(0,t),i=r.lastIndexOf("/",r.length-2);return-1===i&&(i=r.lastIndexOf("\\",r.length-2)),-1!==i&&r.length>i+1&&(e=r.substring(0,i+1)),e}var b,O=function(){function e(){}return e.success=0,e.noResponseDictionary=-900,e.noErrorCodeForStandardInvokeMethod=-901,e.genericProxyError=-902,e.genericLegacyApiError=-903,e.genericUnknownError=-904,e}(),_=function(e){switch(e){case 402:case 401:case 400:case 403:return!0;default:return!1}};!function(e){e[e.noError=0]="noError",e[e.errorInRequest=-1]="errorInRequest",e[e.errorHandlingRequest=-2]="errorHandlingRequest",e[e.errorInResponse=-3]="errorInResponse",e[e.errorHandlingResponse=-4]="errorHandlingResponse",e[e.errorHandlingRequestAccessDenied=-5]="errorHandlingRequestAccessDenied",e[e.errorHandlingMethodCallTimedout=-6]="errorHandlingMethodCallTimedout"}(b||(b={}));var A=n(301),T=!1;function C(e){return T||(E(9e3,"AttachmentSizeExceeded",d("l_AttachmentExceededSize_Text")),E(9001,"NumberOfAttachmentsExceeded",d("l_ExceededMaxNumberOfAttachments_Text")),E(9002,"InternalFormatError",d("l_InternalFormatError_Text")),E(9003,"InvalidAttachmentId",d("l_InvalidAttachmentId_Text")),E(9004,"InvalidAttachmentPath",d("l_InvalidAttachmentPath_Text")),E(9005,"CannotAddAttachmentBeforeUpgrade",d("l_CannotAddAttachmentBeforeUpgrade_Text")),E(9006,"AttachmentDeletedBeforeUploadCompletes",d("l_AttachmentDeletedBeforeUploadCompletes_Text")),E(9007,"AttachmentUploadGeneralFailure",d("l_AttachmentUploadGeneralFailure_Text")),E(9008,"AttachmentToDeleteDoesNotExist",d("l_DeleteAttachmentDoesNotExist_Text")),E(9009,"AttachmentDeleteGeneralFailure",d("l_AttachmentDeleteGeneralFailure_Text")),E(9010,"InvalidEndTime",d("l_InvalidEndTime_Text")),E(9011,"HtmlSanitizationFailure",d("l_HtmlSanitizationFailure_Text")),E(9012,"NumberOfRecipientsExceeded",d("l_NumberOfRecipientsExceeded_Text").replace("{0}",1e3)),E(9013,"NoValidRecipientsProvided",d("l_NoValidRecipientsProvided_Text")),E(9014,"CursorPositionChanged",d("l_CursorPositionChanged_Text")),E(9016,"InvalidSelection",d("l_InvalidSelection_Text")),E(9017,"AccessRestricted",""),E(9018,"GenericTokenError",""),E(9019,"GenericSettingsError",""),E(9020,"GenericResponseError",""),E(9021,"SaveError",d("l_SaveError_Text")),E(9022,"MessageInDifferentStoreError",d("l_MessageInDifferentStoreError_Text")),E(9023,"DuplicateNotificationKey",d("l_DuplicateNotificationKey_Text")),E(9024,"NotificationKeyNotFound",d("l_NotificationKeyNotFound_Text")),E(9025,"NumberOfNotificationsExceeded",d("l_NumberOfNotificationsExceeded_Text")),E(9026,"PersistedNotificationArrayReadError",d("l_PersistedNotificationArrayReadError_Text")),E(9027,"PersistedNotificationArraySaveError",d("l_PersistedNotificationArraySaveError_Text")),E(9028,"CannotPersistPropertyInUnsavedDraftError",d("l_CannotPersistPropertyInUnsavedDraftError_Text")),E(9029,"CanOnlyGetTokenForSavedItem",d("l_CallSaveAsyncBeforeToken_Text")),E(9030,"APICallFailedDueToItemChange",d("l_APICallFailedDueToItemChange_Text")),E(9031,"InvalidParameterValueError",d("l_InvalidParameterValueError_Text")),E(9032,"ApiCallNotSupportedByExtensionPoint",d("l_API_Not_Supported_By_ExtensionPoint_Error_Text")),E(9033,"SetRecurrenceOnInstanceError",d("l_Recurrence_Error_Instance_SetAsync_Text")),E(9034,"InvalidRecurrenceError",d("l_Recurrence_Error_Properties_Invalid_Text")),E(9035,"RecurrenceZeroOccurrences",d("l_RecurrenceErrorZeroOccurrences_Text")),E(9036,"RecurrenceMaxOccurrences",d("l_RecurrenceErrorMaxOccurrences_Text")),E(9037,"RecurrenceInvalidTimeZone",d("l_RecurrenceInvalidTimeZone_Text")),E(9038,"InsufficientItemPermissionsError",d("l_Insufficient_Item_Permissions_Text")),E(9039,"RecurrenceUnsupportedAlternateCalendar",d("l_RecurrenceUnsupportedAlternateCalendar_Text")),E(9040,"HTTPRequestFailure",d("l_Olk_Http_Error_Text")),E(9041,"NetworkError",d("l_Internet_Not_Connected_Error_Text")),E(9042,"InternalServerError",d("l_Internal_Server_Error_Text")),E(9043,"AttachmentTypeNotSupported",d("l_AttachmentNotSupported_Text")),E(9044,"InvalidCategory",d("l_Invalid_Category_Error_Text")),E(9045,"DuplicateCategory",d("l_Duplicate_Category_Error_Text")),E(9046,"ItemNotSaved",d("l_Item_Not_Saved_Error_Text")),E(9047,"MissingExtendedPermissionsForAPIError",d("l_Missing_Extended_Permissions_For_API")),E(9048,"TokenAccessDenied",d("l_TokenAccessDeniedWithoutItemContext_Text")),E(9049,"ItemNotFound",d("l_ItemNotFound_Text")),E(9050,"KeyNotFound",d("l_KeyNotFound_Text")),E(9051,"SessionObjectMaxLengthExceeded",d("l_SessionDataObjectMaxLengthExceeded_Text").replace("{0}",5e4)),E(9052,"AttachmentResourceNotFound",d("l_Attachment_Resource_Not_Found")),E(9053,"AttachmentResourceUnAuthorizedAccess",d("l_Attachment_Resource_UnAuthorizedAccess")),E(9054,"AttachmentDownloadFailed",d("l_Attachment_Download_Failed_Generic_Error")),E(9055,"APINotSupportedForSharedFolders",d("l_API_Not_Supported_For_Shared_Folders_Error")),E(9057,"RoamingSettingsExceededSize",d("l_RoamingSettingsExceededSize_Text")),E(9058,"NativeLabelingNotEnabled",d("l_NativeLabelingNotEnabled_Text")),E(9059,"SensitivityUnableToSetParent",d("l_SensitivityUnableToSetParent_Text")),E(9060,"UserHasNoLabelsToSet",d("l_UserHasNoLabelsToSet_Text")),E(9061,"FailedToGetLabelsCatalog",d("l_FailedToGetLabelsCatalog_Text")),E(9062,"FailedToGetLabel",d("l_FailedToGetLabel_Text")),E(9063,"FailedToSetLabel",d("l_FailedToSetLabel_Text")),E(9064,"ExceededMaxNumberOfSelectedItems",d("I_ExceededMaxNumberOfSelectedItems_Text")),E(9065,"MAMServiceNotAvailable",d("l_MAMServiceNotAvailable_Text")),E(9066,"InvalidOpenLocationInput",d("l_InvalidOpenLocationInput_Text")),E(9067,"InvalidSaveLocationInput",d("l_InvalidSaveLocationInput_Text")),E(9068,"OperationFailed",d("l_OperationFailed_Text")),E(5018,"RequestTimeout",d("l_RequestTimeout_Text")),E(9069,"CrossMailboxSelectionNotAllowed",d("l_CrossMailboxSelectionNotAllowed_Text")),T=!0),A.DDA.ErrorCodeManager.getErrorArgs(e)}function E(e,t,n){A.DDA.ErrorCodeManager.addErrorMessage(e,{name:t,message:n})}var I,P=!1,w=new Map;function D(e){return N(),w.get(e)}function x(e,t){return N(),w.get(e)===t}function M(e){return N(),Boolean(w.get(e))}function N(){if(!P){w.clear();var e=ja("nativeFlights");null!=e&&(Object.keys(e).forEach((function(t){w.set(t,e[t])})),P=!0)}}var F=function(){return I},R=function(e){return(I=new k).parameterBlobSupported=!0,I},k=function(){function e(){this._parameterBlobSupported=!0,this._itemNumber=0,this._itemNumberForLoadedItem=0,I=this}return Object.defineProperty(e.prototype,"parameterBlobSupported",{set:function(e){this._parameterBlobSupported=e},enumerable:!1,configurable:!0}),e.prototype.setActionsDefinition=function(e){this._actionsDefinition=e},e.prototype.setCurrentItemNumber=function(e){e>0&&(this._itemNumber=e)},Object.defineProperty(e.prototype,"itemNumber",{get:function(){return this._itemNumber},enumerable:!1,configurable:!0}),e.prototype.setItemNumberForLoadedItem=function(e){e>0&&(this._itemNumberForLoadedItem=e)},Object.defineProperty(e.prototype,"itemNumberForLoadedItem",{get:function(){return this._itemNumberForLoadedItem},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"actionsDefinition",{get:function(){return this._actionsDefinition},enumerable:!1,configurable:!0}),e.prototype.updateOutlookExecuteParameters=function(e,t,n){var r=e;if(this._parameterBlobSupported){if(this._itemNumber>0&&(M("MultiSelectV2")&&n&&this._itemNumber!=this._itemNumberForLoadedItem?(t.itemNumber=this._itemNumberForLoadedItem.toString(),t.isNoUI=!0):t.itemNumber=this._itemNumber.toString()),null!=this._actionsDefinition&&(t.actions=this.actionsDefinition),0===Object.keys(t).length)return r;null==r&&(r=[]),r.push(JSON.stringify(t))}return r},e}(),H=n(301),j=function(e){return H._OfficeAppFactory.getHostInfo().hostPlatform==e},L=(n(301),function(e,t){if(0==e.length)return null;var n=q(e);V(e);var r=n>0,i=0;return F()&&(i=F().itemNumber),J(e,r&&i>0&&n>i&&!t)}),U=function(e,t,n){var r=null,i={};switch(e){case 12:i.isRest=t.isRest;break;case 4:r=[JSON.stringify(t.customProperties)];break;case 5:r=new Array(t.body);break;case 8:case 9:case 179:case 180:r=new Array(t.itemId);break;case 7:case 177:r=new Array(B(t.requiredAttendees),B(t.optionalAttendees),t.start,t.end,t.location,B(t.resources),t.subject,t.body);break;case 44:case 178:r=[B(t.toRecipients),B(t.ccRecipients),B(t.bccRecipients),t.subject,t.htmlBody,t.attachments];break;case 43:r=[t.ewsIdOrEmail];break;case 45:r=[t.module,t.queryString];break;case 40:r=[t.extensionId,t.consentState];break;case 11:case 10:case 184:case 183:r=[t.htmlBody];break;case 31:case 30:case 182:case 181:r=[t.htmlBody,t.attachments];break;case 23:case 13:case 38:case 29:r=[t.data,t.coercionType];break;case 37:r=j("ios")||j("android")?[t.coercionType,t.bodyMode]:[t.coercionType];break;case 28:r=[t.coercionType];break;case 17:r=[t.subject];break;case 15:r=[t.recipientField];break;case 22:case 21:r=[t.recipientField,W(t.recipientArray)];break;case 19:r=[t.itemId,t.name];break;case 16:r=[t.uri,t.name,t.isInline];break;case 148:r=[t.base64String,t.name,t.isInline];break;case 20:r=[t.attachmentIndex];break;case 25:r=[t.TimeProperty,t.time];break;case 24:r=[t.TimeProperty];break;case 27:r=[t.location];break;case 33:case 35:r=[t.key,t.type,t.persistent,t.message,t.icon],F().setActionsDefinition(t.actions);break;case 36:r=[t.key];break;default:i=t||{}}return 1!==e&&(r=F().updateOutlookExecuteParameters(r,i,n)),r},B=function(e){return null!=e?e.join(";"):""},W=function(e){var t=[];if(null==e)return t;for(var n=0;n<e.length;n++){var r=[e[n].address,e[n].name];t.push(r)}return t},q=function(e){var t=0;if(e.length>2){var n=JSON.parse(e[2]);n&&"object"==typeof n&&(t=n.itemNumber)}return t},V=function(e){if(e.length>2){var t=JSON.parse(e[2]);t&&"object"==typeof t&&t.itemNumberForLoadedItem&&F().setItemNumberForLoadedItem(t.itemNumberForLoadedItem)}},J=function(e,t){var n=null,r=JSON.parse(e[0]);if("number"==typeof r)n=z(e,t);else{if(!r||"object"!=typeof r)throw new Error("Return data type from host must be Object or Number");n=G(e,t)}return n},G=function(e,t){var n=JSON.parse(e[0]);if(t)n.error=!0,n.errorCode=9030;else if(e.length>1&&0!==e[1]){if(n.error=!0,n.errorCode=e[1],e.length>2){var r=JSON.parse(e[2]);n.diagnostics=r.Diagnostics}e.length>=5&&(n.errorMessage=e[3],n.errorName=e[4])}else n.error=!1;return n},z=function(e,t){var n={error:!0};return n.errorCode=e[0],n};var K=n(301);function Q(e,t,n,r,i,o,a){Z(e,r,(function(e,r){if(n){var a=void 0,s=!0;if("object"==typeof r&&null!==r){if(void 0!==r.wasSuccessful&&(s=r.wasSuccessful),void 0!==r.error||void 0!==r.errorCode||void 0!==r.data)if(r.error){var c=r.errorCode;a=X(void 0,K.DDA.AsyncResultEnum.ErrorCode.Failed,c,t)}else{a=X(i?i(r.data):r.data,K.DDA.AsyncResultEnum.ErrorCode.Success,0,t)}o&&(a=o(r,t,e)),a||e===b.noError||(a=X(void 0,K.DDA.AsyncResultEnum.ErrorCode.Failed,9002,t)),a||e!==b.noError||!1!==s||(a=X(void 0,K.DDA.AsyncResultEnum.ErrorCode.Failed,K.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported,t)),n(a)}}}),a)}function X(e,t,n,r,i,o){var a,s={};if(s[K.DDA.AsyncResultEnum.Properties.Value]=e,s[K.DDA.AsyncResultEnum.Properties.Context]=r,K.DDA.AsyncResultEnum.ErrorCode.Success!==t){a={};var c;c=C(n),a[K.DDA.AsyncResultEnum.ErrorProperties.Name]=o||c.name,a[K.DDA.AsyncResultEnum.ErrorProperties.Message]=i||c.message,a[K.DDA.AsyncResultEnum.ErrorProperties.Code]=n}return new K.DDA.AsyncResult(s,a)}var Y,Z=function(e,t,n,r){$(e,t,n)},$=function(e,t,n){if(K.AppName.OutlookWebApp!==Ua()&&_(e))n(b.errorHandlingRequest,null);else{var r=te(e,t),i=performance&&performance.now();K._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(e,r,(function(t,r){if(ee(t,r,e,i),n){var o=r;K.AppName.OutlookWebApp!==Ua()&&(o=L(r,!1)),n(t,o)}}))}},ee=function(e,t,n,r){if(K.AppTelemetry){var o=function(e,t){if(t){if("error"in t)return t.error?"errorCode"in t?t.errorCode:O.noErrorCodeForStandardInvokeMethod:O.success;if("wasProxySuccessful"in t)return t.wasProxySuccessful?O.success:O.genericProxyError;if("wasSuccessful"in t)return t.wasSuccessful?O.success:O.genericLegacyApiError}return i(e)?O.genericUnknownError:e}(e,t),a=performance&&performance.now();K.AppTelemetry.onMethodDone(n,null,Math.round(a-r),o)}},te=function(e,t){return{toSafeArrayHost:function(){return U(e,t,!1)},fromSafeArrayHost:function(e){return e},toWebHost:function(){return t},fromWebHost:function(e){return e}}},ne=function(){var e=ja("permissionLevel");return i(e)?-1:e};function re(e,t){var n=new Error(e);if(n.message=e||"",t)for(var r in t)n[r]=t[r];return n}function ie(e,t){var n="Sys.ArgumentException: "+(t||"Value does not fall within the expected range.");return e&&(n+="\n"+"Parameter name: {0}".replace("{0}",e)),re(n,{name:"Sys.ArgumentException",paramName:e})}function oe(e,t){var n="Sys.ArgumentNullException: "+(t||"Value cannot be null.");return e&&(n+="\n"+"Parameter name: {0}".replace("{0}",e)),re(n,{name:"Sys.ArgumentNullException",paramName:e})}function ae(e,t,n){var r="Sys.ArgumentOutOfRangeException: "+(n||"Specified argument was out of the range of valid values.");return e&&(r+="\n"+"Parameter name: {0}".replace("{0}",e)),null!=t&&(r+="\n"+"Actual value was {0}.".replace("{0}",t)),re(r,{name:"Sys.ArgumentOutOfRangeException",paramName:e,actualValue:t})}function se(e,t,n,r){var i="Sys.ArgumentTypeException: ";return i+=r||(t&&n?"Object of type '{0}' cannot be converted to type '{1}'.".replace("{0}",t.getName?t.getName():t).replace("{1}",n.getName?n.getName():n):"Object cannot be converted to the required type."),e&&(i+="\n"+"Parameter name: {0}".replace("{0}",e)),re(i,{name:"Sys.ArgumentTypeException",paramName:e,actualType:t,expectedType:n})}function ce(e,t){if(-1==ne())throw function(e){return re("Invalid operation ({0}) when Office.context.mailbox.item is null.".replace("{0}",e))}(t);if(ne()<e)throw re(d("l_ElevatedPermissionNeededForMethod_Text").replace("{0}",t))}function le(e,t,n){var r={};if(n&&(r=function(e){var t={};if(1===e.length||2===e.length)return"function"!=typeof e[0]||(t.callback=e[0],2===e.length&&(t.asyncContext=e[1])),t;return t}(e)).callback)return r;if(1===e.length)if("function"==typeof e[0])r.callback=e[0];else{if("object"!=typeof e[0])throw se();r.options=e[0]}else if(2===e.length){if("object"!=typeof e[0])throw ie("options");if("function"!=typeof e[1])throw ie("callback");r.callback=e[1],r.options=e[0]}else if(0!==e.length)throw re("Sys.ParameterCountException: "+(d("l_ParametersNotAsExpected_Text")||"Parameter count mismatch."),{name:"Sys.ParameterCountException"});if(t&&!r.callback)throw oe("callback");return r.options&&r.options.asyncContext&&(r.asyncContext=r.options.asyncContext),r}!function(e){e[e.to=0]="to",e[e.cc=1]="cc",e[e.bcc=2]="bcc",e[e.requiredAttendees=0]="requiredAttendees",e[e.optionalAttendees=1]="optionalAttendees"}(Y||(Y={}));var de=571,ue=32768,fe=2048;function pe(e,t,n,r){if(e<t||e>n)throw ae(String(r))}var me,ge={EntityType:{MeetingSuggestion:"meetingSuggestion",TaskSuggestion:"taskSuggestion",Address:"address",EmailAddress:"emailAddress",Url:"url",PhoneNumber:"phoneNumber",Contact:"contact",FlightReservations:"flightReservations",ParcelDeliveries:"parcelDeliveries"},ItemType:{Message:"message",Appointment:"appointment"},ResponseType:{None:"none",Organizer:"organizer",Tentative:"tentative",Accepted:"accepted",Declined:"declined"},RecipientType:{Other:"other",DistributionList:"distributionList",User:"user",ExternalUser:"externalUser"},AttachmentType:{File:"file",Item:"item",Cloud:"cloud",Base64:"base64"},AttachmentStatus:{Added:"added",Removed:"removed"},AttachmentContentFormat:{Base64:"base64",Url:"url",Eml:"eml",ICalendar:"iCalendar"},BodyType:{Text:"text",Html:"html"},ItemNotificationMessageType:{ProgressIndicator:"progressIndicator",InformationalMessage:"informationalMessage",ErrorMessage:"errorMessage",InsightMessage:"insightMessage"},Folder:{Inbox:"inbox",Junk:"junk",DeletedItems:"deletedItems"},ComposeType:{Forward:"forward",NewMail:"newMail",Reply:"reply"}},he={Text:"text",Html:"html"};function ye(e){if(null==e)throw oe(e);if(e!==ge.RestVersion.v1_0&&e!==ge.RestVersion.v2_0&&e!==ge.RestVersion.Beta)throw ie(e)}function ve(e,t){if(null==e)throw oe(e);return ye(t),e.replace(new RegExp("[/]","g"),"-").replace(new RegExp("[+]","g"),"_")}function Se(e,t){if(null==e)throw oe(e);return ye(t),e.replace(new RegExp("[-]","g"),"/").replace(new RegExp("[_]","g"),"+")}function be(e,t){if(!Array.isArray(e))throw se("name");pe(e.length,0,100,"{0}.length".replace("{0}",t))}function Oe(e,t){for(var n=e,r=[],i=0;i<n.length;i++)if("object"==typeof n[i]){if(_e(n[i]),r[i]=n[i].emailAddress,"string"!=typeof r[i])throw ie("{0}[{1}]".replace(t,String(i)))}else{if("string"!=typeof n[i])throw ie("{0}[{1}]".replace(t,String(i)));r[i]=n[i]}return r}function _e(e){if(!i(e.displayName)&&"string"==typeof e.displayName&&e.displayName.length>255)throw ae("displayName");if(!i(e.emailAddress)&&"string"==typeof e.emailAddress&&e.emailAddress.length>571)throw ae("emailAddress");if(!i(e.appointmentResponse)&&"string"!=typeof e.appointmentResponse)throw ae("appointmentResponse");if(!i(e.recipientType)&&"string"!=typeof e.recipientType)throw ae("recipientType")}function Ae(e){if("string"!=typeof e)throw se("itemId");!function(e){if(i(e)||""===e)throw oe("itemId")}(e)}function Te(e){return ja("isRestIdSupported")?ve(e,ge.RestVersion.v1_0):Se(e,ge.RestVersion.v1_0)}ge.UserProfileType={Office365:"office365",OutlookCom:"outlookCom",Enterprise:"enterprise"},ge.RestVersion={v1_0:"v1.0",v2_0:"v2.0",Beta:"beta"},ge.ModuleType={Addins:"addins"},ge.ActionType={ShowTaskPane:"showTaskPane",ExecuteFunction:"executeFunction"},ge.SendModeOverride={PromptUser:"promptUser"},ge.Days={Mon:"mon",Tue:"tue",Wed:"wed",Thu:"thu",Fri:"fri",Sat:"sat",Sun:"sun",Weekday:"weekday",WeekendDay:"weekendDay",Day:"day"},ge.WeekNumber={First:"first",Second:"second",Third:"third",Fourth:"fourth",Last:"last"},ge.RecurrenceType={Daily:"daily",Weekday:"weekday",Weekly:"weekly",Monthly:"monthly",Yearly:"yearly"},ge.Month={Jan:"jan",Feb:"feb",Mar:"mar",Apr:"apr",May:"may",Jun:"jun",Jul:"jul",Aug:"aug",Sep:"sep",Oct:"oct",Nov:"nov",Dec:"dec"},ge.DelegatePermissions={Read:1,Write:2,DeleteOwn:4,DeleteAll:8,EditOwn:16,EditAll:32},ge.TimeZone={AfghanistanStandardTime:"Afghanistan Standard Time",AlaskanStandardTime:"Alaskan Standard Time",AleutianStandardTime:"Aleutian Standard Time",AltaiStandardTime:"Altai Standard Time",ArabStandardTime:"Arab Standard Time",ArabianStandardTime:"Arabian Standard Time",ArabicStandardTime:"Arabic Standard Time",ArgentinaStandardTime:"Argentina Standard Time",AstrakhanStandardTime:"Astrakhan Standard Time",AtlanticStandardTime:"Atlantic Standard Time",AUSCentralStandardTime:"AUS Central Standard Time",AusCentralWStandardTime:"Aus Central W. Standard Time",AUSEasternStandardTime:"AUS Eastern Standard Time",AzerbaijanStandardTime:"Azerbaijan Standard Time",AzoresStandardTime:"Azores Standard Time",BahiaStandardTime:"Bahia Standard Time",BangladeshStandardTime:"Bangladesh Standard Time",BelarusStandardTime:"Belarus Standard Time",BougainvilleStandardTime:"Bougainville Standard Time",CanadaCentralStandardTime:"Canada Central Standard Time",CapeVerdeStandardTime:"Cape Verde Standard Time",CaucasusStandardTime:"Caucasus Standard Time",CenAustraliaStandardTime:"Cen. Australia Standard Time",CentralAmericaStandardTime:"Central America Standard Time",CentralAsiaStandardTime:"Central Asia Standard Time",CentralBrazilianStandardTime:"Central Brazilian Standard Time",CentralEuropeStandardTime:"Central Europe Standard Time",CentralEuropeanStandardTime:"Central European Standard Time",CentralPacificStandardTime:"Central Pacific Standard Time",CentralStandardTime:"Central Standard Time",CentralStandardTime_Mexico:"Central Standard Time (Mexico)",ChathamIslandsStandardTime:"Chatham Islands Standard Time",ChinaStandardTime:"China Standard Time",CubaStandardTime:"Cuba Standard Time",DatelineStandardTime:"Dateline Standard Time",EAfricaStandardTime:"E. Africa Standard Time",EAustraliaStandardTime:"E. Australia Standard Time",EEuropeStandardTime:"E. Europe Standard Time",ESouthAmericaStandardTime:"E. South America Standard Time",EasterIslandStandardTime:"Easter Island Standard Time",EasternStandardTime:"Eastern Standard Time",EasternStandardTime_Mexico:"Eastern Standard Time (Mexico)",EgyptStandardTime:"Egypt Standard Time",EkaterinburgStandardTime:"Ekaterinburg Standard Time",FijiStandardTime:"Fiji Standard Time",FLEStandardTime:"FLE Standard Time",GeorgianStandardTime:"Georgian Standard Time",GMTStandardTime:"GMT Standard Time",GreenlandStandardTime:"Greenland Standard Time",GreenwichStandardTime:"Greenwich Standard Time",GTBStandardTime:"GTB Standard Time",HaitiStandardTime:"Haiti Standard Time",HawaiianStandardTime:"Hawaiian Standard Time",IndiaStandardTime:"India Standard Time",IranStandardTime:"Iran Standard Time",IsraelStandardTime:"Israel Standard Time",JordanStandardTime:"Jordan Standard Time",KaliningradStandardTime:"Kaliningrad Standard Time",KamchatkaStandardTime:"Kamchatka Standard Time",KoreaStandardTime:"Korea Standard Time",LibyaStandardTime:"Libya Standard Time",LineIslandsStandardTime:"Line Islands Standard Time",LordHoweStandardTime:"Lord Howe Standard Time",MagadanStandardTime:"Magadan Standard Time",MagallanesStandardTime:"Magallanes Standard Time",MarquesasStandardTime:"Marquesas Standard Time",MauritiusStandardTime:"Mauritius Standard Time",MidAtlanticStandardTime:"Mid-Atlantic Standard Time",MiddleEastStandardTime:"Middle East Standard Time",MontevideoStandardTime:"Montevideo Standard Time",MoroccoStandardTime:"Morocco Standard Time",MountainStandardTime:"Mountain Standard Time",MountainStandardTime_Mexico:"Mountain Standard Time (Mexico)",MyanmarStandardTime:"Myanmar Standard Time",NCentralAsiaStandardTime:"N. Central Asia Standard Time",NamibiaStandardTime:"Namibia Standard Time",NepalStandardTime:"Nepal Standard Time",NewZealandStandardTime:"New Zealand Standard Time",NewfoundlandStandardTime:"Newfoundland Standard Time",NorfolkStandardTime:"Norfolk Standard Time",NorthAsiaEastStandardTime:"North Asia East Standard Time",NorthAsiaStandardTime:"North Asia Standard Time",NorthKoreaStandardTime:"North Korea Standard Time",OmskStandardTime:"Omsk Standard Time",PacificSAStandardTime:"Pacific SA Standard Time",PacificStandardTime:"Pacific Standard Time",PacificStandardTime_Mexico:"Pacific Standard Time (Mexico)",PakistanStandardTime:"Pakistan Standard Time",ParaguayStandardTime:"Paraguay Standard Time",RomanceStandardTime:"Romance Standard Time",RussiaTimeZone10:"Russia Time Zone 10",RussiaTimeZone11:"Russia Time Zone 11",RussiaTimeZone3:"Russia Time Zone 3",RussianStandardTime:"Russian Standard Time",SAEasternStandardTime:"SA Eastern Standard Time",SAPacificStandardTime:"SA Pacific Standard Time",SAWesternStandardTime:"SA Western Standard Time",SaintPierreStandardTime:"Saint Pierre Standard Time",SakhalinStandardTime:"Sakhalin Standard Time",SamoaStandardTime:"Samoa Standard Time",SaratovStandardTime:"Saratov Standard Time",SEAsiaStandardTime:"SE Asia Standard Time",SingaporeStandardTime:"Singapore Standard Time",SouthAfricaStandardTime:"South Africa Standard Time",SriLankaStandardTime:"Sri Lanka Standard Time",SudanStandardTime:"Sudan Standard Time",SyriaStandardTime:"Syria Standard Time",TaipeiStandardTime:"Taipei Standard Time",TasmaniaStandardTime:"Tasmania Standard Time",TocantinsStandardTime:"Tocantins Standard Time",TokyoStandardTime:"Tokyo Standard Time",TomskStandardTime:"Tomsk Standard Time",TongaStandardTime:"Tonga Standard Time",TransbaikalStandardTime:"Transbaikal Standard Time",TurkeyStandardTime:"Turkey Standard Time",TurksAndCaicosStandardTime:"Turks And Caicos Standard Time",UlaanbaatarStandardTime:"Ulaanbaatar Standard Time",USEasternStandardTime:"US Eastern Standard Time",USMountainStandardTime:"US Mountain Standard Time",UTC:"UTC",UTCPLUS12:"UTC+12",UTCPLUS13:"UTC+13",UTCMINUS02:"UTC-02",UTCMINUS08:"UTC-08",UTCMINUS09:"UTC-09",UTCMINUS11:"UTC-11",VenezuelaStandardTime:"Venezuela Standard Time",VladivostokStandardTime:"Vladivostok Standard Time",WAustraliaStandardTime:"W. Australia Standard Time",WCentralAfricaStandardTime:"W. Central Africa Standard Time",WEuropeStandardTime:"W. Europe Standard Time",WMongoliaStandardTime:"W. Mongolia Standard Time",WestAsiaStandardTime:"West Asia Standard Time",WestBankStandardTime:"West Bank Standard Time",WestPacificStandardTime:"West Pacific Standard Time",YakutskStandardTime:"Yakutsk Standard Time"},ge.LocationType={Custom:"custom",Room:"room"},ge.AppointmentSensitivityType={Normal:"normal",Personal:"personal",Private:"private",Confidential:"confidential"},ge.CategoryColor={None:"None",Preset0:"Preset0",Preset1:"Preset1",Preset2:"Preset2",Preset3:"Preset3",Preset4:"Preset4",Preset5:"Preset5",Preset6:"Preset6",Preset7:"Preset7",Preset8:"Preset8",Preset9:"Preset9",Preset10:"Preset10",Preset11:"Preset11",Preset12:"Preset12",Preset13:"Preset13",Preset14:"Preset14",Preset15:"Preset15",Preset16:"Preset16",Preset17:"Preset17",Preset18:"Preset18",Preset19:"Preset19",Preset20:"Preset20",Preset21:"Preset21",Preset22:"Preset22",Preset23:"Preset23",Preset24:"Preset24"},ge.MoveSpamItemTo={DeletedItemsFolder:"deletedItemsFolder",CustomFolder:"customFolder",JunkFolder:"junkFolder",NoMove:"noMove"},ge.SaveLocation={OnedriveForBusiness:1,SharePoint:2,Box:4,Dropbox:8,GoogleDrive:16,Local:32,AccountDocument:64,PhotoLibrary:128,Other:1<<31},ge.OpenLocation={OnedriveForBusiness:1,SharePoint:2,Camera:4,Local:8,AccountDocument:16,PhotoLibrary:32,Other:1<<31},ge.BodyMode={FullBody:0,HostConfig:1},function(e){e[e.camera=0]="camera",e[e.microphone=1]="microphone",e[e.geolocation=2]="geolocation"}(me||(me={})),ge.TokenStatus={Disabled:0,Enabled:1,Removed:2};var Ce=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};function Ee(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Pe.apply(void 0,Ce([9,e],t,!1))}function Ie(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Pe.apply(void 0,Ce([180,e],t,!1))}function Pe(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];ce(1,"mailbox.displayAppointmentForm");var i=le(n,!1,!1),o={itemId:t};we(o),Q(e,i.asyncContext,i.callback,{itemId:Te(o.itemId)},void 0,void 0,void 0)}function we(e){Ae(e.itemId)}var De=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};function xe(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Ne.apply(void 0,De([8,e],t,!1))}function Me(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Ne.apply(void 0,De([179,e],t,!1))}function Ne(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];ce(1,"mailbox.displayMessageForm");var i=le(n,!1,!1),o={itemId:t};Fe(o),Q(e,i.asyncContext,i.callback,{itemId:Te(o.itemId)},void 0,void 0,void 0)}function Fe(e){Ae(e.itemId)}function Re(e,t,n,r){if("string"!=typeof e)throw ie(String(r));pe(e.length,t,n,r)}var ke=function(e){return e instanceof Date||"[object Date]"==Object.prototype.toString.call(e)},He=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};function je(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return Ue.apply(void 0,He([7,e],t,!1))}function Le(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return Ue.apply(void 0,He([177,e],t,!1))}function Ue(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];ce(1,"mailbox.displayNewAppointmentForm");var i=le(n,!1,!1);Be(t);var o=We(t);Q(e,i.asyncContext,i.callback,o,void 0,void 0,void 0)}function Be(e){if(i(e.requiredAttendees)||be(e.requiredAttendees,"requiredAttendees"),i(e.optionalAttendees)||be(e.optionalAttendees,"optionalAttendees"),i(e.location)||Re(e.location,0,255,"location"),i(e.body)||Re(e.body,0,ue,"body"),i(e.subject)||Re(e.subject,0,255,"subject"),!i(e.start)){if(!ke(e.start))throw ie("start");if(!i(e.end)){if(!ke(e.end))throw ie("end");if(e.end&&e.start&&e.end<e.start)throw ie("end",d("l_InvalidEventDates_Text"))}}}function We(e){var t=null,n=null;if(i(e.requiredAttendees)||(t=Oe(e.requiredAttendees,"requiredAttendees")),i(e.optionalAttendees)||(n=Oe(e.optionalAttendees,"optionalAttendees")),!i(e.start)){var r=e.start;e.start=r.getTime()}if(!i(e.end)){var o=e.end;e.end=o.getTime()}var a=JSON.parse(JSON.stringify(e));return(t||n)&&(i(e.requiredAttendees)||(a.requiredAttendees=t),i(e.optionalAttendees)||(a.optionalAttendees=n)),a}var qe=6e5,Ve=27892122,Je=function(){return(Je=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function Ge(e){var t=[];return null!=e&&"object"==typeof e?(Array.isArray(null==e?void 0:e.attachments)&&(t=e.attachments.map((function(e){return e.type==ge.AttachmentType.File&&e.url?fetch(e.url).then((function(e){return e.blob()})).then((function(t){return new Promise((function(n,r){var i=new FileReader;i.onloadend=function(){var t;n(Je(Je({},e),{type:ge.AttachmentType.Base64,base64file:(t=i.result,t.replace("data:","").replace(/^.+,/,"")),url:void 0}))},i.onerror=r,i.readAsDataURL(t)}))})):Promise.resolve(e)}))),Promise.all(t).then((function(t){return e.attachments=t,e})).catch((function(e){return Promise.reject(new Error(d("l_AttachmentUploadGeneralFailure_Text")))}))):Promise.resolve(e)}var ze=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};function Ke(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return Xe.apply(void 0,ze([44,e],t,!1))}function Qe(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return Xe.apply(void 0,ze([178,e],t,!1))}function Xe(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];ce(1,"mailbox.displayNewMessageForm");var i=le(n,!1,!1),o=function(e,t,n){var r=9007;e instanceof Error&&"Sys.ArgumentOutOfRangeException"===e.name&&(r=9e3);var i=X(void 0,OSF.DDA.AsyncResultEnum.ErrorCode.Failed,r,n,"");t&&setTimeout((function(){return t(i)}),0)};if(Ye(t),j("web"))Ge(t).then((function(n){var r=Ze(n||t);Q(e,i.asyncContext,i.callback,null==r?t:r,void 0,void 0,void 0)})).catch((function(e){return o(e,i.callback,i.asyncContext)}));else{var a=Ze(t);Q(e,i.asyncContext,i.callback,null==a?t:a,void 0,void 0,void 0)}}function Ye(e){null!==e&&null!==e&&(i(e.toRecipients)||be(e.toRecipients,"toRecipients"),i(e.ccRecipients)||be(e.ccRecipients,"ccRecipients"),i(e.bccRecipients)||be(e.bccRecipients,"bccRecipients"),i(e.htmlBody)||Re(e.htmlBody,0,ue,"htmlBody"),i(e.subject)||Re(e.subject,0,255,"subject"))}function Ze(e){var t=JSON.parse(JSON.stringify(e));if(!i(e)){e.toRecipients&&(t.toRecipients=Oe(e.toRecipients,"toRecipients")),e.ccRecipients&&(t.ccRecipients=Oe(e.ccRecipients,"ccRecipients")),e.bccRecipients&&(t.bccRecipients=Oe(e.bccRecipients,"bccRecipients"));var n=function(e){var t=[];e.attachments&&$e(t=e.attachments);return t}(e);e.attachments&&(t.attachments=et(n))}return t}function $e(e){if(!i(e)&&!Array.isArray(e))throw ie("attachments")}function et(e){for(var t=[],n=0;n<e.length;n++){if("object"!=typeof e[n])throw ie("attachments");var r=e[n];tt(r),t.push(nt(r))}return t}function tt(e){if("object"!=typeof e)throw ie("attachments");if(!e.type||!e.name)throw ie("attachments");if(!e.url&&!e.itemId&&!e.base64file)throw ie("attachments")}function nt(e){var t,n=null;if(t=j("win32"),e.type===ge.AttachmentType.File){var r=e.url,i=e.name,o=!!e.isInline;!function(e,t){if("string"!=typeof e&&"string"!=typeof t)throw ie("attachments");if(e.length>fe)throw ae("attachments",e.length,d("l_AttachmentUrlTooLong_Text"));rt(t)}(r,i),n=[ge.AttachmentType.File,i,r,o]}else if(e.type===ge.AttachmentType.Item){var a=Te(e.itemId),s=e.name;!function(e,t){if("string"!=typeof e||"string"!=typeof t)throw ie("attachments");if(e.length>200)throw ae("attachments",e.length,d("l_AttachmentItemIdTooLong_Text"));rt(t)}(a,s),n=[ge.AttachmentType.Item,s,a]}else{if(!M("ReplyFormBase64Support")&&t||e.type!==ge.AttachmentType.Base64)throw ie("attachments");var c=e.base64file,l=e.name;o=!!e.isInline;!function(e,t){if("string"!=typeof e||"string"!=typeof t)throw ie("attachments");if(e.length>Ve)throw ae("attachments",e.length,d("l_AttachmentExceededSize_Text"));rt(t)}(c,l),n=[ge.AttachmentType.Base64,l,c,o]}return n}function rt(e){if(e.length>255)throw ae("attachments",e.length,d("l_AttachmentNameTooLong_Text"))}var it=n(301);function ot(e,t,n){var r=void 0;return Ua()===it.AppName.Outlook&&void 0!==e.error&&void 0!==e.errorCode&&e.error&&9030===e.errorCode?r=X(void 0,it.DDA.AsyncResultEnum.ErrorCode.Failed,e.errorCode,t,e.errorMessage,e.errorName):n&&n!==b.noError?(r=X(void 0,it.DDA.AsyncResultEnum.ErrorCode.Failed,9017,t,d("l_InternalProtocolError_Text").replace("{0}",n)))&&(r.diagnostics={InvokeCodeResult:n}):(r=e.wasSuccessful?X(e.token,it.DDA.AsyncResultEnum.ErrorCode.Success,0,t):X(void 0,it.DDA.AsyncResultEnum.ErrorCode.Failed,e.errorCode,t,e.errorMessage,e.errorName),e.diagnostics&&(r.diagnostics=e.diagnostics)),r}function at(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];ce(1,"mailbox.getCallbackTokenAsync");var n=le(e,!0,!0),r=!1;if(n.options&&n.options.isRest&&(r=!0),La()&&(!r||ne()<3))throw re(d("l_TokenAccessDeniedWithoutItemContext_Text"));Q(12,n.asyncContext,n.callback,{isRest:r},void 0,ot,void 0)}function st(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];ce(1,"mailbox.getUserIdentityToken");var n=le(e,!0,!0);Q(2,n.asyncContext,n.callback,void 0,void 0,ot,void 0)}var ct=function(e){if(!i(e)){var t=ja("hostVersion").split("."),n=e.split("."),r=0;if(t.length>=4&&n.length>=4){for(var o=0;o<4;o++){var a=parseInt(t[o]),s=parseInt(n[o]);if(isNaN(a)||isNaN(s)||a<s)return!1;if(a>s)return!0;r++}return 4==r}}return!1},lt=n(301),dt=1e6,ut=5242880,ft="16.0.16224.10000";function pt(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];ce(3,"mailbox.makeEwsRequest");var r=le(t,!0,!0);if(null==e)throw oe("data");if("string"!=typeof e)throw se("data",typeof e,"string");if(Ua()==lt.AppName.Outlook&&"win32"==lt._OfficeAppFactory.getHostInfo().hostPlatform&&ct(ft)){if(e.length>ut)throw ie("data",d("l_NewEwsRequestOversized_Text"))}else if(e.length>dt)throw ie("data",d("l_EwsRequestOversized_Text"));Q(5,r.asyncContext,r.callback,{body:e},void 0,mt,void 0)}function mt(e,t,n){return n&&n!==b.noError?X(void 0,lt.DDA.AsyncResultEnum.ErrorCode.Failed,9017,t,d("l_InternalProtocolError_Text").replace("{0}",n)):!1===e.wasProxySuccessful?X(void 0,lt.DDA.AsyncResultEnum.ErrorCode.Failed,9020,t,e.errorMessage):X(e.body,lt.DDA.AsyncResultEnum.ErrorCode.Success,0,t)}var gt=function(e,t){var n=Object.keys(t),r=n.map((function(e){return{value:t[e],writable:!1}})),i={};return n.forEach((function(e,t){i[e]=r[t]})),Object.defineProperties(e,i)},ht=n(301);function yt(e,t){return e.error?X("",ht.DDA.AsyncResultEnum.ErrorCode.Failed,9068,t,d("l_OperationFailed_Text"),"OperationFailed"):X(e.data,ht.DDA.AsyncResultEnum.ErrorCode.Success,0,t)}function vt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];ce(1,"mailbox.getTokenStatusAsync");var n=le(e,!0,!0),r=!1;if(n.options&&!0===n.options.isRest&&(r=!0),La()&&(!r||ne()<3))throw re(d("l_TokenAccessDeniedWithoutItemContext_Text"));Q(10002,n.asyncContext,n.callback,{isRest:r},void 0,yt,void 0)}var St=n(301),bt=function(){switch(Ua()){case St.AppName.Outlook:return"Outlook";case St.AppName.OutlookWebApp:return Ot()?"newOutlookWindows":"OutlookWebApp";case St.AppName.OutlookIOS:return"OutlookIOS";case St.AppName.OutlookAndroid:return"OutlookAndroid";default:return}};var Ot=function(){return 0!=(St._OfficeAppFactory.getHostInfo().flags&St.HostInfoFlags.IsMonarch)};var _t=ge.CategoryColor,At=[_t.None,_t.Preset0,_t.Preset1,_t.Preset2,_t.Preset3,_t.Preset4,_t.Preset5,_t.Preset6,_t.Preset7,_t.Preset8,_t.Preset9,_t.Preset10,_t.Preset11,_t.Preset12,_t.Preset13,_t.Preset14,_t.Preset15,_t.Preset16,_t.Preset17,_t.Preset18,_t.Preset19,_t.Preset20,_t.Preset21,_t.Preset22,_t.Preset23,_t.Preset24];function Tt(e){if(!e)throw ie("categoryDetails");if(!Array.isArray(e))throw se("categoryDetails",typeof e,typeof[]);if(0===e.length)throw ie("categoryDetails");e.forEach(Ct)}function Ct(e){if(!e)throw ie("categoryDetails");if(!e.color||!e.displayName)throw ie("categoryDetails");if("string"!=typeof e.color)throw se("categoryDetails.color",typeof e.color,"string");if("string"!=typeof e.displayName)throw se("categoryDetails.displayName",typeof e.displayName,"string");if(e.displayName.length>255)throw ae("categoryDetails.displayName",e.displayName.length);if(-1===At.indexOf(e.color))throw ie("categoryDetails.color")}function Et(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];ce(3,"masterCategories.addAsync");var r=le(t,!1,!1),i={categoryDetails:e};Tt(e),Q(161,r.asyncContext,r.callback,i,void 0,void 0,void 0)}function It(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];ce(3,"masterCategories.getAsync");var n=le(e,!0,!1);Q(160,n.asyncContext,n.callback,void 0,void 0,void 0,void 0)}function Pt(e){if(!e)throw ie("categories");if(!Array.isArray(e))throw se("categories",typeof e,typeof Array);if(0===e.length)throw ie("categories");e.forEach(wt)}function wt(e){if(!e)throw ie("categories");if("string"!=typeof e)throw se("categories",typeof e,"string");if(e.length>255)throw ae("categories",e.length)}function Dt(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];ce(3,"masterCategories.removeAsync");var r=le(t,!1,!1),i={categories:e};Pt(e),Q(162,r.asyncContext,r.callback,i,void 0,void 0,void 0)}function xt(){Q(42,void 0,void 0,void 0,void 0,void 0,void 0)}var Mt,Nt=function(){return ja("itemType")};!function(e){e[e.Message=1]="Message",e[e.Appointment=2]="Appointment",e[e.MeetingRequest=3]="MeetingRequest",e[e.MessageCompose=4]="MessageCompose",e[e.AppointmentCompose=5]="AppointmentCompose",e[e.ItemLess=6]="ItemLess"}(Mt||(Mt={}));var Ft=n(301);function Rt(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];ce(1,"item.getInitializationContext");var r=le(t,!0,!1);j("win32")&&ct("16.0.17215.10000")?Q(99,r.asyncContext,r.callback,void 0,void 0,kt,e):Q(99,r.asyncContext,r.callback,void 0,void 0,void 0,void 0)}}function kt(e,t,n){return n&&n!==b.noError?X(void 0,Ft.DDA.AsyncResultEnum.ErrorCode.Failed,9017,t,d("l_InternalProtocolError_Text").replace("{0}",n)):e.wasSuccessful?""===e.data?X(void 0,Ft.DDA.AsyncResultEnum.ErrorCode.Success,0,t):X(JSON.parse(e.data),Ft.DDA.AsyncResultEnum.ErrorCode.Success,0,t):X(void 0,Ft.DDA.AsyncResultEnum.ErrorCode.Failed,e.errorCode,t,e.errorMessage,e.errorName)}var Ht,jt="Date(";function Lt(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];ce(1,"item.saveCustomProperties");var r=this&&this.isLoadedItem,i=le(t,!1,!0);Ut(e),Q(4,i.asyncContext,i.callback,{customProperties:e},void 0,void 0,r)}function Ut(e){if(JSON.stringify(e).length>2500)throw ae("customProperties")}!function(e){e[e.NonTransmittable=0]="NonTransmittable"}(Ht||(Ht={}));var Bt=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},Wt=function(){function e(e,t){if(this.isLoadedItem=!1,i(e)&&oe("data"),Array.isArray(e)){var n=e;if(!(n.length>Ht.NonTransmittable))throw ie("data");e=n[Ht.NonTransmittable]}else this.rawData=e;this.isLoadedItem=1==t}return e.prototype.get=function(e){var t=this.rawData[e];if("string"==typeof t){var n=t;if(n.length>jt.length+")".length&&n.startsWith(jt)&&n.endsWith(")")){var r=n.substring(jt.length,n.length-1),o=parseInt(r);if(!isNaN(o)){var a=new Date(o);i(a)||(t=a)}}}return t},e.prototype.set=function(e,t){ke(t)&&(t=jt+t.getTime()+")"),this.rawData[e]=t},e.prototype.remove=function(e){delete this.rawData[e]},e.prototype.saveAsync=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];Lt.apply(void 0,Bt([this.rawData],e,!1))},e.prototype.getAll=function(){var e=this,t={};return Object.keys(this.rawData).forEach((function(n){t[n]=e.get(n)})),t},e}(),qt=n(301);function Vt(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=le(t,!0,!0);Q(3,r.asyncContext,r.callback,void 0,void 0,Jt,e)}}function Jt(e,t,n){if(void 0!==n&&n!==b.noError)return X(void 0,qt.DDA.AsyncResultEnum.ErrorCode.Failed,9017,t,d("l_InternalProtocolError_Text").replace("{0}",n));if(e.wasSuccessful){var r=JSON.parse(e.customProperties),i=this&&this.isLoadedItem;return X(new Wt(r,i),qt.DDA.AsyncResultEnum.ErrorCode.Success,0,t)}return X(void 0,qt.DDA.AsyncResultEnum.ErrorCode.Failed,9020,t,e.errorMessage)}var Gt,zt,Kt=n(301);function Qt(e,t){t.options&&"string"==typeof t.options.coercionType?e.coercionType=Xt(t.options.coercionType):e.coercionType=zt.Text}function Xt(e){return e===he.Html?zt.Html:e===he.Text?zt.Text:void 0}function Yt(e){e.callback&&e.callback(X(void 0,Kt.DDA.AsyncResultEnum.ErrorCode.Failed,1e3,e.asyncContext))}function Zt(e){if(e!==ge.BodyMode.FullBody&&e!==ge.BodyMode.HostConfig)throw ie("bodyMode")}function $t(e){return function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];ce(1,"body.getAsync");var i=le(n,!0,!1),o=ge.BodyMode.FullBody;i.options&&void 0!==i.options.bodyMode&&(Zt(i.options.bodyMode),o=i.options.bodyMode);var a={coercionType:Xt(t),bodyMode:o};if(void 0===a.coercionType)throw ie("coercionType");Q(37,i.asyncContext,i.callback,a,void 0,void 0,e)}}function en(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];ce(1,"body.getTypeAsync");var r=le(t,!0,!1);Q(14,r.asyncContext,r.callback,void 0,void 0,void 0,e)}}!function(e){e[e.Compose=0]="Compose",e[e.Read=1]="Read",e[e.ReadUI=2]="ReadUI"}(Gt||(Gt={})),function(e){e[e.Text=0]="Text",e[e.Html=3]="Html"}(zt||(zt={}));function tn(e){if("string"!=typeof e.data)throw se("data",typeof e.data,"string");if(e.data.length>1e6)throw ae("data",e.data.length)}function nn(e){if("string"!=typeof e.data)throw se("data",typeof e.data,"string");if(e.data.length>12e4)throw ae("data",e.data.length)}var rn,on=n(301);function an(e,t){var n=X(void 0,on.DDA.AsyncResultEnum.ErrorCode.Failed,5e3,e,"");t&&setTimeout((function(){t&&t(n)}),0)}function sn(e,t){return function(n){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];if(38==e)ce(2,"body.setAsync");else{if(206!=e)throw"Unexpected dispid";ce(2,"display.body.setAsync")}var o=le(r,!1,!1);if(t)an(o.asyncContext,o.callback);else{var a=ge.BodyMode.FullBody;o.options&&void 0!==o.options.bodyMode&&(Zt(o.options.bodyMode),a=o.options.bodyMode);var s={data:n,bodyMode:a};tn(s),Qt(s,o),void 0!==s.coercionType?Q(e,o.asyncContext,o.callback,s,void 0,void 0,t):Yt(o)}}}function cn(e){return function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];ce(2,"body.prependAsync");var i=le(n,!1,!1);if(e)an(i.asyncContext,i.callback);else{var o={data:t};tn(o),Qt(o,i),void 0!==o.coercionType?Q(23,i.asyncContext,i.callback,o,void 0,void 0,e):Yt(i)}}}function ln(e,t,n,r,o){ce(2,t);var a=le(r,!1,!1);if(o)an(a.asyncContext,a.callback);else{var s={appendTxt:n};i(s.appendTxt)?s.appendTxt="":function(e){if("string"!=typeof e.appendTxt)throw se("data",typeof e.appendTxt,"string");if(e.appendTxt.length>5e3)throw ae("data",e.appendTxt.length)}(s),Qt(s,a),void 0!==s.coercionType?Q(e,a.asyncContext,a.callback,s,void 0,void 0,o):Yt(a)}}function dn(e){return function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];ln(100,"body.appendOnSendAsync",t,n,e)}}function un(e,t){return function(n){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var o=le(r,!1,!1);if(M("MultiSelectV2")&&t)an(o.asyncContext,o.callback);else{ce(2,"body.setSelectedDataAsync");var a={data:n};tn(a),Qt(a,o),void 0!==a.coercionType?Q(e,o.asyncContext,o.callback,a,void 0,void 0,void 0):Yt(o)}}}function fn(e){return function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];ce(2,"item.body.setSignatureAsync");var o=le(n,!1,!1);if(e)an(o.asyncContext,o.callback);else{var a={data:t};i(a.data)?a.data="":nn(a),Qt(a,o),void 0!==a.coercionType?Q(173,o.asyncContext,o.callback,a,void 0,void 0,e):Yt(o)}}}function pn(e){return function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];ln(197,"body.prependOnSendAsync",t,n,e)}}function mn(e,t){return!M("MultiSelectV2")||i(t)?ja(e):t&&t[e]}function gn(e,t,n){var r=gt({},{});if(e==Gt.Compose)gt(r,{appendOnSendAsync:dn(t),getTypeAsync:en(t),prependAsync:cn(t),setAsync:sn(38,t),setSelectedDataAsync:un(13,t),setSignatureAsync:fn(t),prependOnSendAsync:pn(t),getAsync:$t(t)});else if(e==Gt.Read)gt(r,{getAsync:$t(t),type:mn("bodyType",n)});else{if(e!=Gt.ReadUI)throw"Unexpected ItemSurfaceType";gt(r,{setAsync:sn(206,t)})}return r}function hn(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];ce(1,"item.getAllInternetHeadersAsync");var r=le(t,!0,!1);Q(168,r.asyncContext,r.callback,void 0,void 0,void 0,e)}}function yn(e,t){if(i(t)||""===t)throw oe(e);if("string"!=typeof t)throw se(e,typeof t,"string")}!function(e){e[e.informationalMessage=0]="informationalMessage",e[e.progressIndicator=1]="progressIndicator",e[e.errorMessage=2]="errorMessage",e[e.insightMessage=3]="insightMessage"}(rn||(rn={}));var vn="icon",Sn="message",bn="persistent",On="actions",_n="actionType",An="actionText",Tn="commandId",Cn="showTaskPane",En="executeFunction",In=n(301);function Pn(e){if(yn("key",e),e.length>32)throw ae("key",e.length)}function wn(e){if(yn("type",e.type),e.type===ge.ItemNotificationMessageType.InformationalMessage){if(yn(vn,e.icon),e.icon.length>32)throw ae(vn,e.icon.length);if(i(e.persistent))throw oe(bn);if("boolean"!=typeof e.persistent)throw se(bn,typeof e.persistent,"boolean");if(!i(e.actions))throw ie(On,d("l_ActionsDefinitionWrongNotificationMessageError_Text"))}else if(e.type===ge.ItemNotificationMessageType.InsightMessage)!function(e){if(yn(vn,e.icon),e.icon.length>32)throw ae(vn,e.icon.length);if(!(j("win32")&&ct("16.0.14620.10000")||i(e.persistent)))throw ie(bn);if(i(e.actions))throw oe(On);!function(e){var t=function(e){var t=null;if(!Array.isArray(e))throw ie(On);if(1===e.length)t=e[0];else if(e.length>1)throw ie(On,d("l_ActionsDefinitionMultipleActionsError_Text"));return t}(e);if(i(t))return;(function(e){if(i(e.actionType))throw oe(_n);var t=e.actionType,n=[Cn];In.AppName.OutlookWebApp===Ua()&&n.push(En);if(-1===n.indexOf(t))throw ie(_n,d("l_InvalidActionType_Text"));if(i(e.commandId)||"string"!=typeof e.commandId||""===e.commandId)throw ie(Tn,d("l_InvalidCommandIdError_Text"))})(t),function(e){if(i(e.actionText)||""===e.actionText||"string"!=typeof e.actionText)throw oe(An);if(e.actionText.length>30)throw ae(An,e.actionText.length)}(t)}(e.actions)}(e);else{if(!i(e.icon))throw ie(vn);if(!i(e.persistent))throw ie(bn);if(!i(e.actions))throw ie(On,d("l_ActionsDefinitionWrongNotificationMessageError_Text"))}if(yn(Sn,e.message),e.message.length>150)throw ae(Sn,e.message.length)}function Dn(e){return function(t,n){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];ce(1,"notificationMessages.addAsync");var a=le(r,!1,!1);if(e)an(a.asyncContext,a.callback);else{Pn(t),wn(n);var s,c,l=rn[n.type];if(i(l))throw ie("type");s=j("win32")&&ct("16.0.17215.10000"),c=j("win32")&&ct("16.0.17803.10000");var d,u=D("notificationActionsPassByValue"),f=c&&(!0===u||void 0===u),p=n.message,m=n.icon,g=n.persistent;null==(d=n.actions&&f?JSON.parse(JSON.stringify(n.actions)):n.actions)||d.forEach((function(e){if(s)try{e.contextData=JSON.stringify(e.contextData)}catch(t){e.contextData=void 0}else void 0===e.contextData||null!==e.contextData&&""!==e.contextData||(e.contextData="{}")}));var h={key:t,message:p,type:l,icon:m,persistent:g,actions:d};Q(33,a.asyncContext,a.callback,h,void 0,void 0,e)}}}var xn=n(301);function Mn(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];ce(1,"notificationMessages.getAllAsync");var r,i=le(t,!0,!1);r=j("win32")&&ct("16.0.17215.10000"),Q(34,i.asyncContext,i.callback,void 0,void 0,r?Nn:void 0,e)}}function Nn(e,t,n){if(n&&n!==b.noError)return X(void 0,xn.DDA.AsyncResultEnum.ErrorCode.Failed,9017,t,d("l_InternalProtocolError_Text").replace("{0}",n));if(e.wasSuccessful){for(var r=[],i=0;i<e.data.length;i++){var o=e.data[i];o.action&&void 0!==o.action.contextData&&(o.action.contextData=JSON.parse(o.action.contextData)),r.push(o)}return X(r,xn.DDA.AsyncResultEnum.ErrorCode.Success,0,t)}return X(void 0,xn.DDA.AsyncResultEnum.ErrorCode.Failed,e.errorCode,t,e.errorMessage,e.errorName)}function Fn(e){return function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];ce(1,"notificationMessages.removeAsync");var i=le(n,!1,!1);if(e)an(i.asyncContext,i.callback);else{Pn(t);var o={key:t};Q(36,i.asyncContext,i.callback,o,void 0,void 0,e)}}}function Rn(e){return function(t,n){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];ce(1,"notificationMessages.replaceAsync");var a=le(r,!1,!1);if(e)an(a.asyncContext,a.callback);else{Pn(t),wn(n);var s,c,l=rn[n.type];if(i(l))throw ie("type");s=j("win32")&&ct("16.0.17215.10000"),c=j("win32")&&ct("16.0.17803.10000");var d,u=D("notificationActionsPassByValue"),f=c&&(!0===u||void 0===u),p=n.message,m=n.icon,g=n.persistent;null==(d=n.actions&&f?JSON.parse(JSON.stringify(n.actions)):n.actions)||d.forEach((function(e){if(s)try{e.contextData=JSON.stringify(e.contextData)}catch(t){e.contextData=void 0}else void 0===e.contextData||null!==e.contextData&&""!==e.contextData||(e.contextData="{}")}));var h={key:t,message:p,type:l,icon:m,persistent:g,actions:d};Q(35,a.asyncContext,a.callback,h,void 0,void 0,e)}}}function kn(e){return gt({},{addAsync:Dn(e),getAllAsync:Mn(e),removeAsync:Fn(e),replaceAsync:Rn(e)})}function Hn(e){i(e)||pe(e.length,0,ue,"htmlBody")}function jn(e){var t="";return e.htmlBody&&(!function(e){if("string"!=typeof e)throw se("htmlBody",typeof e,"string");if(i(e))throw oe("htmlBody");pe(e.length,0,ue,"htmlBody")}(e.htmlBody),t=e.htmlBody),t}function Ln(e){var t=[];return e.attachments&&$e(t=e.attachments),t}function Un(e){var t=[];return i(e.options)||(t[0]=e.options),i(e.callback)||(t[t.length]=e.callback),t}var Bn=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};function Wn(e){return function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];Gn.apply(void 0,Bn([!1,!1,t,e],n,!1))}}function qn(e){return function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];Gn.apply(void 0,Bn([!0,!1,t,e],n,!1))}}function Vn(e){return function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];Gn.apply(void 0,Bn([!1,!0,t,e],n,!1))}}function Jn(e){return function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];Gn.apply(void 0,Bn([!0,!0,t,e],n,!1))}}function Gn(e,t,n,r){for(var o=[],a=4;a<arguments.length;a++)o[a-4]=arguments[a];var s=le(Un(n),!1,!1);if(M("MultiSelectV2")&&r&&!t)an(s.asyncContext,s.callback);else{var c;ce(1,"mailbox.displayReplyForm"),(i(s)||void 0===s.options&&void 0===s.callback)&&(s=le(o,!1,!1));var l={formData:n},d=null,u=null;if("string"==typeof l.formData)c=e?t?184:11:t?183:10,Hn(l.formData),Q(c,s.asyncContext,s.callback,{htmlBody:l.formData},void 0,void 0,r);else{if("object"!=typeof l.formData)throw ie();d=jn(l.formData);var f=function(e,t){Q(e?t?182:31:t?181:30,s.asyncContext,s.callback,{htmlBody:d,attachments:u},void 0,void 0,r)};j("web")?Ge(l.formData).then((function(n){u=et(Ln(n)),f(e,t)})).catch((function(e){var t=9007;e instanceof Error&&"Sys.ArgumentOutOfRangeException"===e.name&&(t=9e3);var n=X(void 0,OSF.DDA.AsyncResultEnum.ErrorCode.Failed,t,s.asyncContext,"");s.callback&&setTimeout((function(){s.callback&&s.callback(n)}),0)})):(u=et(Ln(l.formData)),f(e,t))}}}function zn(e){return function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];ce(2,"categories.addAsync");var i=le(n,!1,!1),o={categories:t};Pt(t),Q(158,i.asyncContext,i.callback,o,void 0,void 0,e)}}function Kn(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];ce(1,"categories.getAsync");var r=le(t,!0,!1);Q(157,r.asyncContext,r.callback,void 0,void 0,void 0,e)}}function Qn(e){return function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];ce(2,"categories.removeAsync");var i=le(n,!1,!1),o={categories:t};Pt(t),Q(159,i.asyncContext,i.callback,o,void 0,void 0,e)}}function Xn(e){return gt({},{addAsync:zn(e),removeAsync:Qn(e),getAsync:Kn(e)})}function Yn(e){return function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];ce(1,"item.getAttachmentContentAsync");var i=le(n,!0,!1),o={id:t};Zn(o),Q(150,i.asyncContext,i.callback,o,void 0,void 0,e)}}function Zn(e){yn("attachmentId",e.id)}var $n=ge.Folder;function er(e){return function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];ce(3,"item.move");var i=le(n,!1,!1),o={destinationFolder:t};tr(t),Q(101,i.asyncContext,i.callback,o,void 0,void 0,e)}}function tr(e){if(e!==$n.Inbox&&e!==$n.Junk&&e!==$n.DeletedItems)throw ie("destinationFolder")}var nr=ge.ResponseType,rr=ge.RecipientType,ir=[nr.None,nr.Organizer,nr.Tentative,nr.Accepted,nr.Declined],or=[rr.Other,rr.DistributionList,rr.User,rr.ExternalUser],ar=function(e){var t=e.appointmentResponse,n=e.recipientType,r={emailAddress:e.address,displayName:e.name};return"number"==typeof e.appointmentResponse&&(r.appointmentResponse=t<ir.length?ir[t]:nr.None),"number"==typeof e.recipientType&&(r.recipientType=n<or.length?or[n]:rr.Other),r};function sr(e){return ar({name:e.Name||"",address:e.UserId||""})}function cr(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];ce(1,"delayDeliveryTime.getAsync");var r=le(t,!0,!1);Q(166,r.asyncContext,r.callback,void 0,void 0,void 0,e)}}function lr(e){return function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];ce(2,"delayDeliveryTime.setAsync");var i=le(n,!1,!1);e?an(i.asyncContext,i.callback):(dr(t),Q(167,i.asyncContext,i.callback,{time:t.getTime()},void 0,void 0,e))}}function dr(e){if(i(e))throw oe("dateTime","You cannot conduct to a null dateTime");if(!ke(e))throw se("dateTime",typeof e,typeof Date);if(isNaN(e.getTime()))throw ie("dateTime");pe(e.getTime(),-864e13,864e13,"dateTime")}function ur(e,t){var n=gt({},{getAsync:cr(t)});return e&&gt(n,{setAsync:lr(t)}),n}function fr(e,t){for(var n=e.length-1;n>=0;n--){for(var r=!1,i=n-1;i>=0;i--)if(t(e[n],e[i])){r=!0;break}r&&e.splice(n,1)}return e}var pr=function(e,t){return e===t},mr=function(e,t){return e===t||!(!e||!t)&&e.meetingString===t.meetingString},gr=function(e,t){return e===t||!(!e||!t)&&e.taskString===t.taskString},hr=function(e,t){return e===t||!(!e||!t)&&e.contactString===t.contactString};function yr(){return!!ja("entities")&&void 0!==ja("entities").IsLegacyExtraction&&ja("entities").IsLegacyExtraction}var vr,Sr=864e5,br=new Date("0001-01-01T00:00:00Z");function Or(e,t){if(!t)return e;var n=null;try{var r=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0),o=function(e){var t=32767,n=0;if(null==e)return;n=yr()?Ar(e):_r(e);var r=(e.getTime()-n-br.getTime())/Sr;if(r<0)return;if(r>=262144)return;var i=r>>15;switch(r&=t,i){case 0:return function(e){var t=15,n=31,r=127,i=0,o=0,a=0,s=e>>12&7;if(4==(4&s)){if(i=e>>5&r,2==(2&s)){if(1==(1&s))return;o=e>>1&t}}else 2==(2&s)&&(o=e>>8&t),1==(1&s)&&(a=e>>3&n);return function(e,t,n){return{day:e,month:t,year:n%100}}(a,o,i)}(r);case 1:return function(e){var t=7,n=3,r=15&e,i=function(e,t){var n=1<<t-1,r=(1<<t)-1;return(e&n)==n?-(1+(e^r)):e}(63&(e>>=4),6),o=(e>>=6)&t,a=(e>>=3)&n;try{return function(e,t,n,r){return{modifier:e,offset:t,unit:n,tag:r}}(a,i,o,r)}catch(e){return}}(r);default:return}}(e);if(!o)return e;var a=o;if(a.day&&a.month&&void 0!==a.year)n=function(e,t){var n,r=t.year,o=0==t.month?e.getMonth():t.month-1,a=t.day;if(0==a)return e;i(r)?(n=new Date(e.getFullYear(),o,a)).getTime()<e.getTime()&&(n=new Date(e.getFullYear()+1,o,a)):n=new Date(r<50?2e3+r:1900+r,o,a);if(n.getMonth()!=o)return e;return n}(r,o);else{var s=o;n=void 0!==s.modifier&&void 0!==s.offset&&void 0!==s.tag&&void 0!==s.unit?function(e,t){var n;switch(t.unit){case 0:return(n=new Date(e.getFullYear(),e.getMonth(),e.getDate())).setDate(n.getDate()+t.offset),n;case 5:return function(e,t,n){if(t>-5&&t<5){var r=7*t+((n+6)%7+1-e.getDay());return e.setDate(e.getDate()+r),e}return(r=(n-e.getDay())%7)<0&&(r+=7),e.setDate(e.getDate()+r),e}(e,t.offset,t.tag);case 2:var r=1;switch(t.modifier){case 1:break;case 2:r=16;break;default:0==t.offset&&(r=e.getDate())}return(n=new Date(e.getFullYear(),e.getMonth(),r)).setMonth(n.getMonth()+t.offset),n.getTime()<e.getTime()&&n.setDate(n.getDate()+e.getDate()-1),n;case 1:if((n=new Date(e.getFullYear(),e.getMonth(),e.getDate())).setDate(e.getDate()+7*t.offset),1==t.modifier||0==t.modifier)return n.setDate(n.getDate()+1-n.getDay()),n.getTime()<e.getTime()?e:n;if(2==t.modifier)return n.setDate(n.getDate()+5-n.getDay()),n;break;case 4:return function(e,t){var n,r,i;if(n=e,t.tag<=0||t.tag>12||t.offset<=0||t.offset>5)return e;var o=(12+t.tag-n.getMonth()-1)%12;if(r=new Date(n.getFullYear(),n.getMonth()+o,1),1==t.modifier)return 1==t.offset&&6!=r.getDay()&&0!=r.getDay()?r:((i=new Date(r.getFullYear(),r.getMonth(),r.getDate())).setDate(i.getDate()+(1-r.getDay()+7)%7),6!=r.getDay()&&0!=r.getDay()&&1!=r.getDay()&&i.setDate(i.getDate()-7),i.setDate(i.getDate()+7*(t.offset-1)),i.getMonth()+1!=t.tag?e:i);var a=1-(i=new Date(r.getFullYear(),r.getMonth(),(s=r.getMonth(),c=r.getFullYear(),32-new Date(c,s,32).getDate()))).getDay();return a>0&&(a-=7),i.setDate(i.getDate()+a),i.setDate(i.getDate()+7*(1-t.offset)),i.getMonth()+1!=t.tag?6!=r.getDay()&&0!=r.getDay()?r:e:i;var s,c}(e,t);case 3:if(t.offset>0)return new Date(e.getFullYear()+t.offset,0,1)}return e}(r,o):r}return isNaN(n.getTime())?t:(n.setMilliseconds(n.getMilliseconds()+(yr()?Ar(e):_r(e))),n)}catch(e){return t}}function _r(e){var t=0;return t+=3600*e.getHours(),t+=60*e.getMinutes(),t+=e.getSeconds(),t*=1e3,t+=e.getMilliseconds()}function Ar(e){var t=0;return t+=3600*e.getUTCHours(),t+=60*e.getUTCMinutes(),t+=e.getUTCSeconds(),t*=1e3,t+=e.getUTCMilliseconds()}function Tr(e){for(var t=ja("timeZoneOffsets"),n=0;n<t.length;n++){var r=t[n],i=parseInt(r.start),o=parseInt(r.end);if(e.getTime()-i>=0&&e.getTime()-o<0)return parseInt(r.offset)}throw ie("input",d("l_InvalidDate_Text"))}function Cr(e){var t=function(e){var t=new Date(e.year,e.month,e.date,e.hours,e.minutes,e.seconds,null===e.milliseconds?0:e.milliseconds);if(isNaN(t.getTime()))throw ie("input",d("l_InvalidDate_Text"));return t}(e);if(!i(ja("timeZoneOffsets"))){var n=Tr(t);t.setUTCMinutes(t.getUTCMinutes()-n),n=e.timezoneOffset?e.timezoneOffset:-1*t.getTimezoneOffset(),t.setUTCMinutes(t.getUTCMinutes()+n)}return t}function Er(e){return{month:e.getMonth(),date:e.getDate(),year:e.getFullYear(),hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds(),milliseconds:e.getMilliseconds()}}function Ir(e){return i(e)?{addresses:[],emailAddresses:[],urls:[],taskSuggestions:[],meetingSuggestions:[],phoneNumbers:[],contacts:[],flightReservations:[],parcelDelivery:[]}:{addresses:Pr(e[vr.address]),emailAddresses:wr(e[vr.emailAddress]),urls:Dr(e[vr.url]),taskSuggestions:xr(e[vr.taskSuggestion]),meetingSuggestions:Mr(e[vr.meetingSuggestion]),phoneNumbers:Rr(e[vr.phoneNumber]),contacts:kr(e[vr.contact]),flightReservations:Hr(e[vr.flightReservations]),parcelDelivery:Hr(e[vr.parcelDeliveries])}}!function(e){e.meetingSuggestion="MeetingSuggestions",e.taskSuggestion="TaskSuggestions",e.address="Addresses",e.emailAddress="EmailAddresses",e.url="Urls",e.phoneNumber="PhoneNumbers",e.contact="Contacts",e.flightReservations="FlightReservations",e.parcelDeliveries="ParcelDeliveries"}(vr||(vr={}));var Pr=function(e){return fr(e||[],pr)},wr=function(e){return 0===ne()?[]:e||[]},Dr=function(e){return e||[]},xr=function(e){if(0===ne())return[];var t=e||[];return fr(t=t.map((function(e){return{assignees:(e.Assignees||[]).map(sr),taskString:e.TaskString}})),gr)},Mr=function(e){if(0===ne())return[];var t=e||[];return fr(t=t.map((function(e){var t=""!==e.StartTime?Nr(e.StartTime):void 0,n=""!==e.EndTime?Nr(e.EndTime):void 0;return{meetingString:e.MeetingString,attendees:(e.Attendees||[]).map(sr),location:e.Location,subject:e.Subject,start:void 0!==e.StartTime?t:void 0,end:void 0!==e.EndTime?n:void 0}})),mr)};function Nr(e){var t=Or(new Date(e),new Date(ja("dateTimeSent")));return t.getTime()!==new Date(e).getTime()?Cr(Er(t)):new Date(e)}var Fr,Rr=function(e){return(e||[]).map((function(e){return{phoneString:e.PhoneString,originalPhoneString:e.OriginalPhoneString,type:e.Type}}))},kr=function(e){if(0===ne())return[];var t=e||[];return fr(t=t.map((function(e){return{personName:e.PersonName,businessName:e.BusinessName,phoneNumbers:Rr(e.PhoneNumbers||[]),emailAddresses:e.EmailAddresses||[],urls:e.Urls||[],addresses:e.Addresses||[],contactString:e.ContactString}})),hr)},Hr=function(e){return 0===ne()?[]:e||[]},jr={meetingSuggestion:1,taskSuggestion:1,address:0,emailAddress:1,url:0,phoneNumber:0,contact:1,flightReservations:1,parcelDeliveries:1},Lr={meetingSuggestion:"meetingSuggestions",taskSuggestion:"taskSuggestions",address:"addresses",emailAddress:"emailAddresses",url:"urls",phoneNumber:"phoneNumbers",contact:"contacts",flightReservations:"flightReservations",parcelDeliveries:"parcelDeliveries"},Ur=function(e){return function(){return Ir(mn("entities",e))}},Br=function(e){return function(t){var n=Ir(mn("entities",e));ce(void 0!==jr[t]?jr[t]:1,t);var r=Lr[t];return void 0===r?null:n[r]}},Wr=function(e){return function(t){return function(e,t){ce(1,"item.getFilteredEntitiesByName");var n=Object.keys(e).map((function(n){return e[n][t]?{entityType:n,name:t,entities:e[n][t]}:void 0})).filter((function(e){return void 0!==e}));if(0===n.length)return null;var r=n[0];switch(r.entityType){case vr.meetingSuggestion:return Mr(r.entities);case vr.address:return Pr(r.entities);case vr.contact:return kr(r.entities);case vr.emailAddress:return wr(r.entities);case vr.phoneNumber:return Rr(r.entities);case vr.taskSuggestion:return xr(r.entities);case vr.url:return Dr(r.entities);default:return Hr(r.entities)}}(mn("filteredEntities",e),t)}},qr=function(e){return function(){return mn("regExMatches",e)}},Vr=function(e){return function(t){return(mn("regExMatches",e)||{})[t]}},Jr=function(e){return function(){return Ir(mn("selectedEntities",e))}},Gr=function(e){return function(){return mn("selectedRegExMatches",e)}};function zr(e){var t=[];if(0===ne())return[];if(e)for(var n=0;n<e.length;n++)if(e[n]){var r=Kr(e[n]);t.push(r)}return t}function Kr(e){if(null!==e.attachmentType||void 0!==e.attachmentType)switch(e.attachmentType){case Fr.File:e.attachmentType=ge.AttachmentType.File;break;case Fr.Item:e.attachmentType=ge.AttachmentType.Item;break;case Fr.Cloud:e.attachmentType=ge.AttachmentType.Cloud}return e}function Qr(e){return JSON.parse(JSON.stringify(e))}!function(e){e[e.File=0]="File",e[e.Item=1]="Item",e[e.Cloud=2]="Cloud"}(Fr||(Fr={}));var Xr="recurrenceType",Yr="seriesTime",Zr="name",$r="interval",ei="days",ti="dayOfMonth",ni="dayOfWeek",ri="weekNumber",ii="month",oi="firstDayOfWeek";function ai(e){return e<0&&(e=1),e<10?"0"+e.toString():e.toString()}function si(e,t,n){if(!ci(e,t,n))throw ie(Yr,d("l_InvalidDate_Text"))}function ci(e,t,n){return!(e<1601||t<1||t>12||n<1||n>31)}var li=function(){function e(){this.startYear=0,this.startMonth=0,this.startDay=0,this.endYear=0,this.endMonth=0,this.endDay=0,this.startTimeMinutes=0,this.durationMinutes=0}return e.prototype.getDuration=function(){return this.durationMinutes},e.prototype.getEndTime=function(){var e=this.startTimeMinutes+this.durationMinutes,t=e%60;return"T"+ai(Math.floor(e/60)%24)+":"+ai(t)+":00.000"},e.prototype.getEndDate=function(){return 0===this.endYear&&0===this.endMonth&&0===this.endDay?null:this.endYear.toString()+"-"+ai(this.endMonth)+"-"+ai(this.endDay)},e.prototype.getStartDate=function(){return this.startYear.toString()+"-"+ai(this.startMonth)+"-"+ai(this.startDay)},e.prototype.getStartTime=function(){var e=this.startTimeMinutes%60;return"T"+ai(Math.floor(this.startTimeMinutes/60))+":"+ai(e)+":00.000"},e.prototype.setDuration=function(e){if(!(e>=0))throw ie(void 0,d("l_InvalidTime_Text"));this.durationMinutes=e},e.prototype.setEndDate=function(e,t,n){null===e||i(t)||null===n?null!==e?this.setDateHelper(!1,e):null==e&&(this.endYear=0,this.endMonth=0,this.endDay=0):this.setDateHelper(!1,e,t,n)},e.prototype.setStartDate=function(e,t,n){null===e||i(t)||null===n?null!==e&&this.setDateHelper(!0,e):this.setDateHelper(!0,e,t,n)},e.prototype.setStartTime=function(e,t){if(i(e)||i(t)){if(!i(e)){var n=e,r="2017-01-15"+n+"Z";if(!new RegExp("^T[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d{3}$").test(n))throw ie(void 0,d("l_InvalidTime_Text"));var o=new Date(r);if(i(o)||isNaN(o.getUTCHours())||isNaN(o.getUTCMinutes()))throw ie(void 0,d("l_InvalidTime_Text"));this.startTimeMinutes=60*o.getUTCHours()+o.getUTCMinutes()}}else{var a=60*e+t;if(!(a>=0))throw ie(void 0,d("l_InvalidTime_Text"));this.startTimeMinutes=a}},e.prototype.isValid=function(){return!!ci(this.startYear,this.startMonth,this.startDay)&&(!(0!==this.endDay&&0!==this.endMonth&&0!==this.endYear&&!ci(this.endYear,this.endMonth,this.endDay))&&!(this.startTimeMinutes<0||this.durationMinutes<=0))},e.prototype.exportToSeriesTimeJson=function(){var e={};return e.startYear=this.startYear,e.startMonth=this.startMonth,e.startDay=this.startDay,0===this.endYear&&0===this.endMonth&&0===this.endDay?e.noEndDate=!0:(e.endYear=this.endYear,e.endMonth=this.endMonth,e.endDay=this.endDay),e.startTimeMin=this.startTimeMinutes,this.durationMinutes>0&&(e.durationMin=this.durationMinutes),e},e.prototype.importFromSeriesTimeJsonObject=function(e){this.startYear=e.startYear,this.startMonth=e.startMonth,this.startDay=e.startDay,null!=e.noEndDate&&"boolean"==typeof e.noEndDate?(this.endYear=0,this.endMonth=0,this.endDay=0):(this.endYear=e.endYear,this.endMonth=e.endMonth,this.endDay=e.endDay),this.startTimeMinutes=e.startTimeMin,this.durationMinutes=e.durationMin},e.prototype.setDateHelper=function(e,t,n,r){var o=0,a=0,s=0;if(null===t||i(n)||null===r){if(null!==t){var c=t;!function(e){if(!new RegExp("^\\d{4}-(?:[0]\\d|1[0-2])-(?:[0-2]\\d|3[01])$").test(e))throw ie(Yr,d("l_InvalidDate_Text"))}(c);var l=new Date(c);null===l||isNaN(l.getUTCFullYear())||isNaN(l.getUTCMonth())||isNaN(l.getUTCDate())||(si(l.getUTCFullYear(),l.getUTCMonth()+1,l.getUTCDate()),o=l.getUTCFullYear(),a=l.getUTCMonth()+1,s=l.getUTCDate())}}else si(t,n+1,r),o=t,a=n+1,s=r;0!==o&&0!==a&&0!==s&&(e?(this.startYear=o,this.startMonth=a,this.startDay=s):(this.endYear=o,this.endMonth=a,this.endDay=s))},e.prototype.isEndAfterStart=function(){if(0===this.endYear&&0===this.endMonth&&0===this.endDay)return!0;var e=new Date;e.setFullYear(this.startYear),e.setMonth(this.startMonth-1),e.setDate(this.startDay);var t=new Date;return t.setFullYear(this.endYear),t.setMonth(this.endMonth-1),t.setDate(this.endDay),t>=e},e}();function di(e){if(i(e)||i(e.seriesTimeJson))return e;var t={recurrenceType:"",recurrenceProperties:null,recurrenceTimeZone:null},n=new li;return i(e.recurrenceProperties)||(t.recurrenceProperties=Qr(e.recurrenceProperties)),t.recurrenceType=e.recurrenceType,i(e.recurrenceTimeZone)||(t.recurrenceTimeZone=Qr(e.recurrenceTimeZone)),n.importFromSeriesTimeJsonObject(e.seriesTimeJson),t.seriesTime=n,t}function ui(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];ce(1,"getAsFileAsync");var r=le(t,!0,!1);Q(204,r.asyncContext,r.callback,void 0,void 0,void 0,e)}}function fi(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];ce(1,"subject.getAsync");var r=le(t,!0,!1);Q(18,r.asyncContext,r.callback,void 0,void 0,void 0,e)}}function pi(e){if("string"!=typeof e.subject)throw se("subject",typeof e.subject,"string");pe(e.subject.length,0,255,"subject")}function mi(e,t){return function(n){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];if(17==e)ce(2,"subject.setAsync");else{if(207!=e)throw"Unexpected dispid";ce(2,"display.subject.setAsync")}var o=le(r,!1,!1);if(t)an(o.asyncContext,o.callback);else{var a={subject:n};pi(a),Q(e,o.asyncContext,o.callback,a,void 0,void 0,t)}}}function gi(e,t){var n=gt({},{getAsync:fi(t)});return gt(n,e?{setAsync:mi(207,t)}:{setAsync:mi(17,t)}),n}function hi(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];ce(2,"item.unloadAsync");var n=le(e,!1,!1);Q(212,n.asyncContext,n.callback,void 0,void 0,void 0,void 0)}function yi(e,t){var n=mn("sender",t),r=mn("from",t),i=mn("dateTimeCreated",t),o=mn("dateTimeModified",t),a=mn("end",t),s=mn("start",t),c=gt({},{attachments:zr(mn("attachments",t)),bcc:(mn("bcc",t)||[]).map(ar),body:gn(Gt.Read,e,t),categories:Xn(e),cc:(mn("cc",t)||[]).map(ar),conversationId:mn("conversationId",t),dateTimeCreated:i?new Date(i):void 0,dateTimeModified:o?new Date(o):void 0,display:gt({},{body:gn(Gt.ReadUI),subject:gi(!0)}),end:a?new Date(a):void 0,from:r?ar(r):void 0,getAllInternetHeadersAsync:hn(e),internetMessageId:mn("internetMessageId",t),itemClass:mn("itemClass",t),itemId:mn("id",t),itemType:"message",location:mn("location",t),move:er(e),normalizedSubject:mn("normalizedSubject",t),notificationMessages:kn(e),recurrence:di(mn("recurrence",t)),seriesId:mn("seriesId",t),sender:n?ar(n):void 0,start:s?new Date(s):void 0,subject:mn("subject",t),to:(mn("to",t)||[]).map(ar),displayReplyForm:Wn(e),displayReplyFormAsync:Vn(e),displayReplyAllForm:qn(e),displayReplyAllFormAsync:Jn(e),getAttachmentContentAsync:Yn(e),getEntities:Ur(t),getEntitiesByType:Br(t),getFilteredEntitiesByName:Wr(t),getInitializationContextAsync:Rt(e),getRegExMatches:qr(t),getRegExMatchesByName:Vr(t),getSelectedEntities:Jr(t),getSelectedRegExMatches:Gr(t),loadCustomPropertiesAsync:Vt(e),delayDeliveryTime:ur(!1,e),isAllDayEvent:mn("isAllDayEvent",t),sensitivity:mn("sensitivity",t),getAsFileAsync:ui(e)});return M("MultiSelectV2")&&e&&gt(c,{isLoadedItem:e,unloadAsync:hi}),c}function vi(e){if(i(e)||""===e||"string"!=typeof e)throw ie("attachmentName");pe(e.length,0,255,"attachmentName")}function Si(e){return function(t,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];ce(2,"item.addBase64FileAttachmentAsync");var o=le(r,!1,!1);if(e)an(o.asyncContext,o.callback);else{var a=!1;o.options&&(a=!!o.options.isInline);var s={base64String:t,name:n,isInline:a,__timeout__:qe};bi(s),Q(148,o.asyncContext,o.callback,s,void 0,void 0,e)}}}function bi(e){yn("base64Encoded",e.base64String),pe(e.base64String.length,0,Ve,"base64File"),vi(e.name)}var Oi=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};function _i(e){return function(t,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];ce(2,"item.addFileAttachmentAsync");var o=le(r,!1,!1);if(e)an(o.asyncContext,o.callback);else{var a=!1;o.options&&(a=!!o.options.isInline);var s=n,c={uri:t,name:s,isInline:a,__timeout__:qe};if(Ai(c),j("web"))try{fetch(t).then((function(e){return e.blob()})).then((function(e){var t=new FileReader;t.onloadend=function(){try{var e=t.result;Si().apply(void 0,Oi([Ti(e),n],r,!1))}catch(e){if(e instanceof Error&&"Sys.ArgumentOutOfRangeException"===e.name){var i=X(void 0,OSF.DDA.AsyncResultEnum.ErrorCode.Failed,9e3,o.asyncContext,"");return void(o.callback&&setTimeout((function(){o.callback&&o.callback(i)}),0))}}},t.readAsDataURL(e)})).catch((function(e){var t=X(void 0,OSF.DDA.AsyncResultEnum.ErrorCode.Failed,9007,o.asyncContext,"");o.callback&&setTimeout((function(){o.callback&&o.callback(t)}),0)}))}catch(e){var l=X(void 0,OSF.DDA.AsyncResultEnum.ErrorCode.Failed,9007,o.asyncContext,"");throw o.callback&&setTimeout((function(){o.callback&&o.callback(l)}),0),re(d("l_AttachmentUploadGeneralFailure_Text"))}else Q(16,o.asyncContext,o.callback,c,void 0,void 0,e)}}}function Ai(e){yn("uri",e.uri),pe(e.uri.length,0,fe,"uri"),vi(e.name)}var Ti=function(e){return e.replace("data:","").replace(/^.+,/,"")};function Ci(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];ce(2,"item.addItemAttachmentAsync");var i=this&&this.isLoadedItem,o=le(n,!1,!1);if(i)an(o.asyncContext,o.callback);else{var a={itemId:e,name:t};Ei(a),Q(19,o.asyncContext,o.callback,{itemId:Te(a.itemId),name:a.name,__timeout__:qe},void 0,void 0,void 0)}}function Ei(e){yn("itemId",e.itemId),yn("attachmentName",e.name),pe(e.itemId.length,0,200,"itemId"),pe(e.name.length,0,255,"attachmentName")}function Ii(){Q(41,void 0,void 0,void 0,void 0,void 0,void 0)}function Pi(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];ce(1,"item.getAttachmentsAsync");var r=le(t,!0,!1);Q(149,r.asyncContext,r.callback,void 0,zr,void 0,e)}}function wi(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];ce(2,"item.getSelectedDataAsync");var r=le(t,!0,!1),i={coercionType:Xt(e)};if(void 0===i.coercionType)throw ie("coercionType");Q(28,r.asyncContext,r.callback,i,void 0,void 0,void 0)}function Di(e){return function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=le(n,!0,!1);if(e)an(i.asyncContext,i.callback);else{ce(2,"item.getSelectedDataAsync");var o={coercionType:Xt(t)};if(void 0===o.coercionType)throw ie("coercionType");Q(28,i.asyncContext,i.callback,o,void 0,void 0,e)}}}function xi(e){return function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];ce(2,"item.removeAttachmentAsync");var i=le(n,!1,!1);if(e)an(i.asyncContext,i.callback);else{var o={attachmentIndex:t};Mi(o),Q(20,i.asyncContext,i.callback,o,void 0,void 0,e)}}}function Mi(e){yn("attachmentId",e.attachmentIndex),pe(e.attachmentIndex.length,0,200,"attachmentId")}function Ni(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];ce(2,"item.saveAsync");var r=le(t,!1,!1);Q(32,r.asyncContext,r.callback,void 0,void 0,void 0,e)}}function Fi(e){if(!Array.isArray(e.recipientArray))throw ie("recipients");if(e.recipientArray.length>100)throw ae("recipients",e.recipientArray.length);var t=e.recipientArray.map((function(e){if(i(e))throw ie("recipients");if("string"==typeof e)return Ri(e,e),ki(e,e);if("object"==typeof e)return Ri(e.displayName,e.emailAddress),ki(e.displayName,e.emailAddress);throw ie("recipients")}));e.recipientArray=t}function Ri(e,t){if(!e&&!t)throw ie("recipients");if("string"==typeof e&&e.length>255)throw ae("recipients",e.length,d("l_DisplayNameTooLong_Text"));if("string"==typeof t&&t.length>571)throw ae("recipients",t.length,d("l_EmailAddressTooLong_Text"));if("string"!=typeof e&&"string"!=typeof t)throw ie("recipients")}function ki(e,t){return{address:t,name:e}}function Hi(e,t){return function(n){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];ce(2,e+".addAsync");var o=le(r,!1,!1);if(t)an(o.asyncContext,o.callback);else{var a={recipientField:Y[e],recipientArray:n};Fi(a),Q(22,o.asyncContext,o.callback,a,void 0,void 0,t)}}}function ji(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];ce(1,e+".getAsync");var i=le(n,!0,!1);Q(15,i.asyncContext,i.callback,{recipientField:Y[e]},Li,void 0,t)}}function Li(e){return null==e?[]:e.map((function(e){return ar(e)}))}function Ui(e,t){return function(n){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];ce(2,e+".setAsync");var o=le(r,!1,!1);if(t)an(o.asyncContext,o.callback);else{var a={recipientField:Y[e],recipientArray:n};Fi(a),Q(21,o.asyncContext,o.callback,a,void 0,void 0,t)}}}function Bi(e,t){return gt({},{addAsync:Hi(e,t),getAsync:ji(e,t),setAsync:Ui(e,t)})}function Wi(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];ce(1,e+".getAsync");var i=le(n,!0,!1);Q(107,i.asyncContext,i.callback,void 0,qi,void 0,t)}}function qi(e){return i(e)?null:ar(e)}function Vi(e,t){return gt({},{getAsync:Wi(e,t)})}function Ji(e){if(i(e))throw ie("internetHeaders");if(!Array.isArray(e))throw se("internetHeaders",typeof e,"Array");if(0===e.length)throw ie("internetHeaders");for(var t=0,n=e;t<n.length;t++){yn("internetHeaders",n[t])}}function Gi(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];ce(2,"internetHeaders.removeAsync");var r=this&&this.isLoadedItem,i=le(t,!1,!1);if(r)an(i.asyncContext,i.callback);else{var o={internetHeaderKeys:e};zi(o),Q(153,i.asyncContext,i.callback,o,void 0,void 0,r)}}function zi(e){Ji(e.internetHeaderKeys)}function Ki(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];ce(1,"internetHeaders.getAsync");var r=this&&this.isLoadedItem,i=le(t,!0,!1),o={internetHeaderKeys:e};Qi(o),Q(151,i.asyncContext,i.callback,o,void 0,void 0,r)}function Qi(e){Ji(e.internetHeaderKeys)}var Xi;function Yi(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];ce(2,"internetHeaders.setAsync");var r=this&&this.isLoadedItem,i=le(t,!1,!1);if(r)an(i.asyncContext,i.callback);else{var o={internetHeaderNameValuePairs:e};Zi(o),Q(152,i.asyncContext,i.callback,o,void 0,void 0,r)}}function Zi(e){if(i(e.internetHeaderNameValuePairs))throw oe("internetHeaders");var t=Object.keys(e.internetHeaderNameValuePairs);if(0===t.length)throw ie("internetHeaders");for(var n=0,r=t;n<r.length;n++){var o=r[n],a=e.internetHeaderNameValuePairs[o];if(yn("internetHeaders",o),"string"!=typeof a)throw se("internetHeaders",typeof a,"string");pe(o.length+a.length,0,998,o)}}function $i(e,t){var n=gt({},{isLoadedItem:t,getAsync:Ki});return e&&gt(n,{removeAsync:Gi,setAsync:Yi}),n}function eo(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];ce(1,"item.getItemIdAsync");var r=le(t,!0,!1);Q(164,r.asyncContext,r.callback,void 0,void 0,void 0,e)}}function to(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];ce(1,"item.getComposeTypeAsync");var r=le(t,!0,!1);Q(174,r.asyncContext,r.callback,void 0,void 0,void 0,e)}}function no(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];ce(1,"isClientSignatureEnabledAsync");var r=le(t,!0,!1);Q(175,r.asyncContext,r.callback,void 0,void 0,void 0,e)}}function ro(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];ce(2,"disableClientSignatureAsync");var r=le(t,!0,!1);e?an(r.asyncContext,r.callback):Q(176,r.asyncContext,r.callback,void 0,void 0,void 0,e)}}function io(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];ce(2,"sessionData.getAsync");var r=le(t,!0,!1),i={name:e};ao(i),Q(186,r.asyncContext,r.callback,i,void 0,void 0,void 0)}function oo(e){return function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=le(n,!0,!1);if(e)an(i.asyncContext,i.callback);else{ce(2,"sessionData.getAsync");var o={name:t};ao(o),Q(186,i.asyncContext,i.callback,o,void 0,void 0,e)}}}function ao(e){yn("name",e.name)}function so(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];ce(2,"sessionData.setAsync");var i=le(n,!1,!1),o={name:e,value:t};lo(o),Q(185,i.asyncContext,i.callback,o,void 0,void 0,void 0)}function co(e){return function(t,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var o=le(r,!1,!1);if(e)an(o.asyncContext,o.callback);else{ce(2,"sessionData.setAsync");var a={name:t,value:n};lo(a),Q(185,o.asyncContext,o.callback,a,void 0,void 0,e)}}}function lo(e){yn("name",e.name),function(e,t){if(i(t))throw oe(e);if("string"!=typeof t)throw se(e,typeof t,"string")}("value",e.value)}function uo(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];ce(2,"sessionData.getAllAsync");var n=le(e,!0,!1);Q(187,n.asyncContext,n.callback,void 0,void 0,void 0,void 0)}function fo(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=le(t,!0,!1);e?an(r.asyncContext,r.callback):(ce(2,"sessionData.getAllAsync"),Q(187,r.asyncContext,r.callback,void 0,void 0,void 0,e))}}function po(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];ce(2,"sessionData.clearAsync");var n=le(e,!1,!1);Q(188,n.asyncContext,n.callback,void 0,void 0,void 0,void 0)}function mo(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=le(t,!1,!1);e?an(r.asyncContext,r.callback):(ce(2,"sessionData.clearAsync"),Q(188,r.asyncContext,r.callback,void 0,void 0,void 0,e))}}function go(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];ce(2,"sessionData.removeAsync");var r=le(t,!1,!1),i={name:e};yo(i),Q(189,r.asyncContext,r.callback,i,void 0,void 0,void 0)}function ho(e){return function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=le(n,!1,!1);if(e)an(i.asyncContext,i.callback);else{ce(2,"sessionData.removeAsync");var o={name:t};yo(o),Q(189,i.asyncContext,i.callback,o,void 0,void 0,e)}}}function yo(e){yn("name",e.name)}function vo(e){return M("MultiSelectV2")?gt({},{getAsync:oo(e),setAsync:co(e),getAllAsync:fo(e),clearAsync:mo(e),removeAsync:ho(e)}):gt({},{getAsync:io,setAsync:so,getAllAsync:uo,clearAsync:po,removeAsync:go})}function So(e){if(!e)throw ie("sensitivityLabel");if("string"!=typeof e&&!e.id)throw ie("sensitivityLabel.id",void 0);if("string"!=typeof e&&e.id&&null!=(e=e).children)throw ie(void 0,d("l_SensitivityUnableToSetParent_Text"))}function bo(e){return function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];ce(2,"sensitivityLabel.setAsync");var i=le(n,!1,!1);if(e)an(i.asyncContext,i.callback);else{So(t);var o=Oo(t),a={sensitivityLabelID:o};Q(200,i.asyncContext,i.callback,a,void 0,void 0,e)}}}function Oo(e){return"string"!=typeof e&&void 0!==e.id?e.id:e}function _o(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];ce(2,"sensitivityLabel.getAsync");var r=le(t,!0,!1);Q(201,r.asyncContext,r.callback,void 0,void 0,void 0,e)}}function Ao(e){return gt({},{getAsync:_o(e),setAsync:bo(e)})}function To(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];ce(2,"item.closeAsync");var n=le(e,!1,!1),r=!1;n.options&&(r=!!n.options.discardItem);var i={discardItem:r};Q(203,n.asyncContext,n.callback,i,void 0,void 0,void 0)}function Co(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];ce(1,"item.getItemClassAsync");var r=le(t,!0,!1);Q(210,r.asyncContext,r.callback,void 0,void 0,void 0,e)}}function Eo(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];ce(1,"item.getConversationIndexAsync");var r=le(t,!0,!1);Q(213,r.asyncContext,r.callback,void 0,void 0,void 0,e)}}function Io(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=le(t,!1,!1);e||x("UILessCommandsV2",!1)?an(r.asyncContext,r.callback):(ce(2,"item.sendAsync"),Q(215,r.asyncContext,r.callback,void 0,void 0,void 0,e))}}function Po(e,t){var n=gt({},{bcc:Bi("bcc",e),body:gn(Gt.Compose,e,t),categories:Xn(e),cc:Bi("cc",e),conversationId:mn("conversationId",t),from:Vi("from",e),internetHeaders:$i(!0,e),itemType:"message",notificationMessages:kn(e),seriesId:mn("seriesId",t),subject:gi(!1,e),to:Bi("to",e),addFileAttachmentAsync:_i(e),addFileAttachmentFromBase64Async:Si(e),addItemAttachmentAsync:Ci,close:Ii,closeAsync:To,getAttachmentsAsync:Pi(e),getAttachmentContentAsync:Yn(e),getInitializationContextAsync:Rt(e),getItemIdAsync:eo(e),getSelectedDataAsync:M("MultiSelectV2")?Di(e):wi,loadCustomPropertiesAsync:Vt(e),removeAttachmentAsync:xi(e),saveAsync:Ni(e),setSelectedDataAsync:un(29,e),delayDeliveryTime:ur(!0,e),getComposeTypeAsync:to(e),isClientSignatureEnabledAsync:no(e),disableClientSignatureAsync:ro(e),sessionData:vo(e),sensitivityLabel:Ao(e),getItemClassAsync:Co(e),inReplyTo:mn("inReplyTo",t),getConversationIndexAsync:Eo(e),sendAsync:Io(e)});return M("MultiSelectV2")&&e&&gt(n,{isLoadedItem:e,unloadAsync:hi}),n}function wo(e){if(i(e))throw oe("locationIdentifier");if(!Array.isArray(e))throw se("locationIdentifier",typeof e,"Array");if(0===e.length)throw ie("locationIdentifier");for(var t=0,n=e;t<n.length;t++){Do(n[t])}}function Do(e){if(i(e)||i(e.id)||i(e.type))throw oe("locationIdentifier");if(e.type!==ge.LocationType.Room&&e.type!==ge.LocationType.Custom)throw ie("type");!function(e,t){if(""===e)throw ie("id");if(t===ge.LocationType.Room&&e.length>de)throw ie("id")}(e.id,e.type)}function xo(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];ce(2,"enhancedLocations.addAsync");var r=le(t,!1,!1),i={enhancedLocations:e};Mo(i),Q(155,r.asyncContext,r.callback,i,void 0,void 0,void 0)}function Mo(e){wo(e.enhancedLocations)}function No(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];ce(1,"enhancedLocations.getAsync");var n=le(e,!0,!1);Q(154,n.asyncContext,n.callback,void 0,void 0,void 0,void 0)}function Fo(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];ce(2,"enhancedLocations.removeAsync");var r=le(t,!1,!1),i={enhancedLocations:e};Ro(i),Q(156,r.asyncContext,r.callback,i,void 0,void 0,void 0)}function Ro(e){wo(e.enhancedLocations)}function ko(e){var t=gt({},{getAsync:No});return e&&gt(t,{addAsync:xo,removeAsync:Fo}),t}function Ho(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];ce(1,e+".getAsync");var r=le(t,!0,!1);Q(24,r.asyncContext,r.callback,{TimeProperty:Xi[e]},jo,void 0,void 0)}}function jo(e){return new Date(e)}!function(e){e[e.start=1]="start",e[e.end=2]="end"}(Xi||(Xi={}));function Lo(e){return function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];ce(2,e+".setAsync");var i=le(n,!1,!1),o={date:t};Uo(o),Q(25,i.asyncContext,i.callback,{TimeProperty:Xi[e],time:o.date.getTime()},void 0,void 0,void 0)}}function Uo(e){if(!ke(e.date))throw se("dateTime",typeof e.date,typeof Date);if(isNaN(e.date.getTime()))throw ie("dateTime");if(e.date.getTime()<-864e13||e.date.getTime()>864e13)throw ae("dateTime")}function Bo(e){return gt({},{getAsync:Ho(e),setAsync:Lo(e)})}function Wo(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];ce(1,"location.getAsync");var n=le(e,!0,!1);Q(26,n.asyncContext,n.callback,void 0,void 0,void 0,void 0)}function qo(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];ce(2,"location.setAsync");var r=le(t,!1,!1),i={location:e};Vo(i),Q(27,r.asyncContext,r.callback,i,void 0,void 0,void 0)}function Vo(e){if(i(e.location))throw oe("location");if("string"!=typeof e.location)throw se("location",typeof e.location,"string");pe(e.location.length,0,255,"location")}function Jo(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];ce(1,"recurrenceProperties.getAsync");var n=le(e,!0,!1);Q(103,n.asyncContext,n.callback,void 0,Go,void 0,void 0)}function Go(e){if(null!==e&&null!==e.seriesTimeJson){var t=new li;t.importFromSeriesTimeJsonObject(e.seriesTimeJson),delete e.seriesTimeJson,e.seriesTime=t}return e}function zo(e){if(!i(e)){if(i((e=e).recurrenceType))throw oe(Xr);if(i(e.seriesTime))throw oe(Yr);if(!(e.seriesTime instanceof li&&e.seriesTime.isValid()))throw ie(Yr);if(!e.seriesTime.isEndAfterStart())throw ie(Yr,d("l_InvalidEventDates_Text"));if(function(e){if(e!==ge.RecurrenceType.Daily&&e!==ge.RecurrenceType.Weekly&&e!==ge.RecurrenceType.Weekday&&e!==ge.RecurrenceType.Yearly&&e!==ge.RecurrenceType.Monthly)throw ie(Xr)}(e.recurrenceType),e.recurrenceType!==ge.RecurrenceType.Weekday&&i(e.recurrenceProperties))throw oe(Xr);if(!i(e.recurrenceTimeZone)){if(i(e.recurrenceTimeZone.name))throw oe(Zr);if("string"!=typeof e.recurrenceTimeZone.name)throw se(Zr,typeof e.recurrenceTimeZone.name,"string")}e.recurrenceType===ge.RecurrenceType.Daily?Ko(e.recurrenceProperties):e.recurrenceType===ge.RecurrenceType.Weekly?function(e){if(Ko(e),i(e.days))throw se(ei);if(!Array.isArray(e.days))throw se(ei);if(function(e){for(var t=0;t<e.length;t++)if(!Qo(e[t],!1))throw ie(ei)}(e.days),!i(e.firstDayOfWeek)){if("string"!=typeof e.firstDayOfWeek)throw se(oi);if(!Qo(e.firstDayOfWeek,!1))throw ie(oi)}}(e.recurrenceProperties):e.recurrenceType===ge.RecurrenceType.Monthly?function(e){if(i(e.interval))throw oe($r);if("number"!=typeof e.interval)throw se($r,typeof e.interval,"number");if(i(e.dayOfMonth)){if(i(e.dayOfWeek)||i(e.weekNumber))throw ie(void 0,d("l_Recurrence_Error_Properties_Invalid_Text"));if("string"!=typeof e.dayOfWeek)throw se(ni,typeof e.dayOfWeek,"string");if(!Qo(e.dayOfWeek,!0))throw ie(ni);if("string"!=typeof e.weekNumber)throw se(ri,typeof e.weekNumber,"string");Xo(e.weekNumber)}else{if("number"!=typeof e.dayOfMonth)throw se(ti,typeof e.dayOfMonth,"number");Yo(e.dayOfMonth)}}(e.recurrenceProperties):e.recurrenceType===ge.RecurrenceType.Yearly&&function(e){if(i(e.interval))throw oe($r);if("number"!=typeof e.interval)throw se($r,typeof e.interval,"number");if(i(e.month))throw oe(ii);if("string"!=typeof e.month)throw se(ii,typeof e.month,"string");if(function(e){if(e!==ge.Month.Jan&&e!==ge.Month.Feb&&e!==ge.Month.Mar&&e!==ge.Month.Apr&&e!==ge.Month.May&&e!==ge.Month.Jun&&e!==ge.Month.Jul&&e!==ge.Month.Aug&&e!==ge.Month.Sep&&e!==ge.Month.Oct&&e!==ge.Month.Nov&&e!==ge.Month.Dec)throw ie(ii)}(e.month),i(e.dayOfMonth)){if(i(e.weekNumber)||i(e.dayOfWeek))throw ie(void 0,d("l_Recurrence_Error_Properties_Invalid_Text"));if("string"!=typeof e.dayOfWeek)throw se(ni,typeof e.dayOfWeek,"string");if(!Qo(e.dayOfWeek,!0))throw ie(ni);if("string"!=typeof e.weekNumber)throw se(ri,typeof e.weekNumber,"string");Xo(e.weekNumber)}else{if("number"!=typeof e.dayOfMonth)throw se(ti,typeof e.dayOfMonth,"number");Yo(e.dayOfMonth)}}(e.recurrenceProperties)}}function Ko(e){if(i(e.interval))throw oe($r);if("number"!=typeof e.interval)throw se($r,typeof e.interval,"number");if(e.interval<=0)throw ie($r)}function Qo(e,t){var n=e===ge.Days.Mon||e===ge.Days.Tue||e===ge.Days.Wed||e===ge.Days.Thu||e===ge.Days.Fri||e===ge.Days.Sat||e===ge.Days.Sun;return t&&(e===ge.Days.WeekendDay||e===ge.Days.Weekday||e===ge.Days.Day)||n}function Xo(e){if(e!==ge.WeekNumber.First&&e!==ge.WeekNumber.Second&&e!==ge.WeekNumber.Third&&e!==ge.WeekNumber.Fourth&&e!==ge.WeekNumber.Last)throw ie(ri)}function Yo(e){if(e<1||e>31)throw ie(ti)}function Zo(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];ce(2,"recurrenceProperties.setAsync");var r=aa().seriesId;if(!i(r)&&r.length>0)throw ie(void 0,d("l_Recurrence_Error_Instance_SetAsync_Text"));zo(e);var o=le(t,!1,!1),a=$o(e),s={recurrenceData:a};Q(104,o.asyncContext,o.callback,s,void 0,void 0,void 0)}function $o(e){if(null!==e&&null!==e.seriesTime&&e.seriesTime instanceof li)return{recurrenceProperties:e.recurrenceProperties,recurrenceTimeZone:e.recurrenceTimeZone,recurrenceType:e.recurrenceType,seriesTimeJson:e.seriesTime.exportToSeriesTimeJson()};return e}function ea(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];ce(1,"isAllDayEvent.getAsync");var n=le(e,!0,!1);Q(169,n.asyncContext,n.callback,void 0,void 0,void 0,void 0)}function ta(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];ce(2,"isAllDayEvent.setAsync");var r=le(t,!0,!1),i={isAllDayEvent:e};na(i),Q(170,r.asyncContext,r.callback,i,void 0,void 0,void 0)}function na(e){if(i(e.isAllDayEvent))throw oe("isAllDayEvent");if("boolean"!=typeof e.isAllDayEvent)throw se("isAllDayEvent",typeof e.isAllDayEvent,"boolean")}function ra(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];ce(2,"sensitivity.setAsync");var r=le(t,!0,!1),i={sensitivity:e};ia(i),Q(172,r.asyncContext,r.callback,i,void 0,void 0,void 0)}function ia(e){yn("sensitivity",e.sensitivity),function(e){if(e!==ge.AppointmentSensitivityType.Normal&&e!==ge.AppointmentSensitivityType.Personal&&e!==ge.AppointmentSensitivityType.Private&&e!==ge.AppointmentSensitivityType.Confidential)throw ie("sensitivity")}(e.sensitivity)}function oa(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];ce(1,"sensitivity.getAsync");var n=le(e,!0,!1);Q(171,n.asyncContext,n.callback,void 0,void 0,void 0,void 0)}function aa(){var e,t;return gt({},{body:gn(Gt.Compose),categories:Xn(),end:Bo("end"),enhancedLocation:ko(!0),itemType:"appointment",location:gt({},{getAsync:Wo,setAsync:qo}),notificationMessages:kn(),optionalAttendees:Bi("optionalAttendees"),organizer:Vi("organizer"),recurrence:(e=!0,t=gt({},{getAsync:Jo}),e&&gt(t,{setAsync:Zo}),t),requiredAttendees:Bi("requiredAttendees"),seriesId:ja("seriesId"),start:Bo("start"),subject:gi(!1),addFileAttachmentAsync:_i(),addFileAttachmentFromBase64Async:Si(),addItemAttachmentAsync:Ci,close:Ii,getAttachmentsAsync:Pi(),getAttachmentContentAsync:Yn(),getInitializationContextAsync:Rt(),getItemIdAsync:eo(),getSelectedDataAsync:M("MultiSelectV2")?Di():wi,loadCustomPropertiesAsync:Vt(),removeAttachmentAsync:xi(),saveAsync:Ni(),setSelectedDataAsync:un(29),isAllDayEvent:gt({},{getAsync:ea,setAsync:ta}),sensitivity:gt({},{getAsync:oa,setAsync:ra}),isClientSignatureEnabledAsync:no(),disableClientSignatureAsync:ro(),sensitivityLabel:Ao(),sessionData:vo(),sendAsync:Io()})}var sa;n(301),n(721);function ca(e){var t={consentState:e,extensionId:ja("extensionId")};!function(e){if(e!==sa.Consented&&e!==sa.NotConsented&&e!==sa.NotResponded)throw ae("consentState")}(e),Q(40,void 0,void 0,t,void 0,void 0,void 0)}function la(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=le(t,!1,!1),i={module:e};da(e),e===ge.ModuleType.Addins&&(r.options&&r.options.queryString?i.queryString=r.options.queryString:i.queryString=""),Q(45,r.asyncContext,r.callback,i,void 0,void 0,void 0)}function da(e){if(i(e))throw oe("module");if(""===e)throw ie("module");if(e!==ge.ModuleType.Addins)throw ie("module")}function ua(e){if(i(e))throw oe("data");Q(402,void 0,void 0,e,void 0,void 0,void 0)}function fa(e){if(i(e))throw oe("data");Q(401,void 0,void 0,e,void 0,void 0,void 0)}function pa(e){if(i(e))throw oe("data");Q(400,void 0,void 0,e,void 0,void 0,void 0)}function ma(e,t,n){return Q(403,void 0,void 0,{launchUrl:e},void 0,void 0,void 0),window}function ga(e){if(i(e))throw oe("data");Q(163,void 0,void 0,{telemetryData:e},void 0,void 0,void 0)}function ha(e){if(i(e))throw oe("data");Q(193,void 0,void 0,{telemetryData:e},void 0,void 0,void 0)}!function(e){e[e.NotResponded=0]="NotResponded",e[e.NotConsented=1]="NotConsented",e[e.Consented=2]="Consented"}(sa||(sa={}));var ya=function(){return(ya=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function va(e){if(!ke(e))throw ie("timeValue");var t=new Date(e.getTime()),n=-1*t.getTimezoneOffset();return i(ja("timeZoneOffsets"))||(t.setUTCMinutes(t.getUTCMinutes()-n),n=Tr(t),t.setUTCMinutes(t.getUTCMinutes()+n)),ya({timezoneOffset:n},Er(t))}function Sa(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=le(t,!1,!1),i={ewsIdOrEmail:e};ba(i),Q(43,r.asyncContext,r.callback,{ewsIdOrEmail:e.trim()},void 0,void 0,void 0)}function ba(e){if(i(e.ewsIdOrEmail))throw oe("ewsIdOrEmail");if(function(e){if("string"!=typeof e)throw ie("ewsIdOrEmail")}(e.ewsIdOrEmail),""===e.ewsIdOrEmail)throw ie("ewsIdOrEmail","ewsIdOrEmail cannot be empty.")}function Oa(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];ce(1,"item.getSharedPropertiesAsync");var r=le(t,!0,!1);Q(108,r.asyncContext,r.callback,void 0,void 0,void 0,e)}}var _a=function(e,t){e&&ja("isFromSharedFolder")&&Nt()!==Mt.ItemLess&&gt(e,{getSharedPropertiesAsync:Oa(t)})};function Aa(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];ce(3,"getSelectedItemsAsync");var n=le(e,!0,!1);Q(196,n.asyncContext,n.callback,void 0,void 0,void 0,void 0)}var Ta=n(301);function Ca(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];ce(3,"mailbox.loadItemByIdAsync");var r=le(t,!1,!1),i={itemId:e};Ea(i),Q(211,r.asyncContext,r.callback,{itemId:Te(i.itemId)},void 0,Ia,void 0)}function Ea(e){Ae(e.itemId)}function Ia(e,t,n){if(e.error)return X(void 0,Ta.DDA.AsyncResultEnum.ErrorCode.Failed,e.errorCode,t,e.errorMessage,e.errorName);if(n&&n!==b.noError)return X(void 0,Ta.DDA.AsyncResultEnum.ErrorCode.Failed,9002,t);var r=!0;if(null!=e.wasSuccessful&&(r=e.wasSuccessful),r){var i=void 0,o=void 0,a=Ta.DDA.AsyncResultEnum.ErrorCode.Success,s=0,c=void 0;return null!=e.data&&((i=JSON.parse(e.data)).itemType==Mt.Message||i.itemType==Mt.MeetingRequest?o=yi(!0,i):i.itemType==Mt.MessageCompose?o=Po(!0,i):(a=Ta.DDA.AsyncResultEnum.ErrorCode.Failed,s=9016,c=d("l_InvalidSelection_Text")),_a(o,!0)),X(o,a,s,t,c)}return X(void 0,Ta.DDA.AsyncResultEnum.ErrorCode.Failed,5e3,t)}var Pa=n(301),wa=function(){var e,t,n,r,i,o=void 0;switch(Nt()){case Mt.Message:o=yi();break;case Mt.MessageCompose:o=Po();break;case Mt.Appointment:e=ja("organizer"),t=ja("dateTimeCreated"),n=ja("dateTimeModified"),r=ja("end"),i=ja("start"),o=gt({},{attachments:zr(ja("attachments")),body:gn(Gt.Read),categories:Xn(),dateTimeCreated:t?new Date(t):void 0,dateTimeModified:n?new Date(n):void 0,end:r?new Date(r):void 0,enhancedLocation:ko(!1),itemClass:ja("itemClass"),itemId:ja("id"),itemType:"appointment",location:ja("location"),normalizedSubject:ja("normalizedSubject"),notificationMessages:kn(),optionalAttendees:(ja("cc")||[]).map(ar),organizer:e?ar(e):void 0,recurrence:di(ja("recurrence")),requiredAttendees:(ja("to")||[]).map(ar),start:i?new Date(i):void 0,seriesId:ja("seriesId"),subject:ja("subject"),displayReplyForm:Wn(void 0),displayReplyFormAsync:Vn(void 0),displayReplyAllForm:qn(void 0),displayReplyAllFormAsync:Jn(void 0),getAttachmentContentAsync:Yn(),getEntities:Ur(),getEntitiesByType:Br(),getFilteredEntitiesByName:Wr(),getInitializationContextAsync:Rt(),getRegExMatches:qr(),getRegExMatchesByName:Vr(),getSelectedEntities:Jr(),getSelectedRegExMatches:Gr(),loadCustomPropertiesAsync:Vt(),isAllDayEvent:ja("isAllDayEvent"),sensitivity:ja("sensitivity")});break;case Mt.AppointmentCompose:o=aa();break;case Mt.MeetingRequest:o=yi();break;default:return}return Pa.OutlookInitializationHelper.addEventDispatchToTarget(o,Pa.OutlookInitializationHelper.getMailboxItemEventDispatch()),_a(o,!1),o};function Da(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];ce(2,"sensitivityLabelsCatalog.getAsync");var n=le(e,!0,!1);Q(199,n.asyncContext,n.callback,void 0,void 0,void 0,void 0)}function xa(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];ce(2,"sensitivityLabelsCatalog.getIsEnabledAsync");var n=le(e,!0,!1);Q(202,n.asyncContext,n.callback,void 0,void 0,void 0,void 0)}function Ma(){return gt({},{getAsync:Da,getIsEnabledAsync:xa})}function Na(e){if(!e)throw oe("permissions");if(!Array.isArray(e))throw se("permissions",typeof e,typeof Array);if(0===e.length)throw oe("permissions");e.forEach((function(e){if(!(e in me))throw ae("permissions",e)}))}function Fa(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];ce(2,"devicePermission.requestPermissionsAsync");var r=le(t,!0,!1);Na(e);var i={permissions:e};Q(214,r.asyncContext,r.callback,i,void 0,void 0,void 0)}function Ra(){return gt({},{requestPermissionsAsync:Fa})}var ka,Ha=n(301),ja=function(e){return ka&&ka.getInitialDataProp(e)},La=function(){return!ka||!ka.item},Ua=function(){return ka&&ka.getAppName()},Ba=function(){function e(e,t,n){var r=this;this.displayName="mailbox",this.stringLoadedCallback=function(){r.appReadyCallback&&(r.officeAppContext.get_isDialog()?setTimeout((function(){return r.appReadyCallback()}),0):Z(1,void 0,r.onInitialDataResponse))},this.initialize=function(e){if(null==e)R(),r.initialData=null,r.item=null;else{r.initialData=e,r.initialData.permissionLevel=Wa(),r.item=wa();Ua()!==Ha.AppName.Outlook||(t=ja("hostVersion"),n=0,o=0,i(t)||(n=t.indexOf("."),o=parseInt(t.substring(0,n))),o>=16)||function(e,t){var n=!1;try{var r=JSON.parse(t.get_requirementMatrix()).Mailbox.split("."),i=e.split(".");(parseInt(r[0])>parseInt(i[0])||parseInt(r[0])===parseInt(i[0])&&parseInt(r[1])>=parseInt(i[1]))&&(n=!0)}catch(e){}return n}("1.5",r.officeAppContext),R(),void 0!==e.itemNumber&&F().setCurrentItemNumber(e.itemNumber)}var t,n,o},this.exposeDevicePermissionApi=function(){if(Ua()==Ha.AppName.OutlookWebApp){window.OfficeCore||(window.OfficeCore={}),window.OfficeCore.DevicePermissionType={camera:0,microphone:1,geolocation:2},r.officeAppContext.devicePermission=Ra}},this.onInitialDataResponse=function(e,t){if(!e||e===b.noError){var n;r.initialize(t),gt(n=r,{ewsUrl:ja("ewsUrl"),restUrl:ja("restUrl"),displayAppointmentForm:Ee,displayAppointmentFormAsync:Ie,displayMessageForm:xe,displayMessageFormAsync:Me,displayPersonaCardAsync:Sa,getCallbackTokenAsync:at,getUserIdentityTokenAsync:st,logTelemetry:ga,logCustomerContentTelemetry:ha,makeEwsRequestAsync:pt,masterCategories:gt({},{addAsync:Et,getAsync:It,removeAsync:Dt}),navigateToModuleAsync:la,diagnostics:gt({},{hostName:bt(),hostVersion:ja("hostVersion"),OWAView:ja("owaView"),ews:{getTokenStatusAsync:vt}}),userProfile:gt({},{accountType:ja("userProfileType"),displayName:ja("userDisplayName"),emailAddress:ja("userEmailAddress"),timeZone:ja("userTimeZone")}),convertToEwsId:Se,convertToLocalClientTime:va,convertToRestId:ve,convertToUtcClientTime:Cr,getSelectedItemsAsync:Aa,RegisterConsentAsync:ca,GetIsRead:function(){return ja("isRead")},GetEndPointUrl:function(){return ja("endNodeUrl")},GetConsentMetaData:function(){return ja("consentMetadata")},GetMarketplaceContentMarket:function(){return ja("marketplaceContentMarket")},GetMarketplaceAssetId:function(){return ja("marketplaceAssetId")},GetExtensionId:function(){return ja("extensionId")},CloseApp:xt,recordDataPoint:ua,recordTrace:fa,trackCtq:pa}),Nt()!==Mt.MessageCompose&&Nt()!==Mt.AppointmentCompose&&gt(n,{displayNewAppointmentForm:je,displayNewMessageForm:Ke,displayNewAppointmentFormAsync:Le,displayNewMessageFormAsync:Qe}),M("MultiSelectV2")&&gt(n,{loadItemByIdAsync:Ca}),Ua()===Pa.AppName.OutlookWebApp&&ja("openWindowOpen")&&(window.open=ma);var i=r.officeAppContext;i.sensitivityLabelsCatalog=Ma,r.exposeDevicePermissionApi(),i.urls=ja("urls"),setTimeout((function(){return r.appReadyCallback()}),0)}},this.officeAppContext=e,this.targetWindow=window,this.appReadyCallback=n,ka=this,function(e){if(u=e,void 0!==OSF.OUtil.getLibraryReleaseVehicle&&1==OSF.OUtil.getLibraryReleaseVehicle()||"undefined"!=typeof _osfSkipStringLoad&&!0===_osfSkipStringLoad)return void 0!==l._u&&(o=l._u.ExtensibilityStrings),void u();for(var t,n=document.getElementsByTagName("script"),r=0;r<n.length;r++){var i=n.item(r);if(i&&i.src){var d=i.src||"";if(t=(d=d.toLowerCase()).indexOf(a),d&&t>0){f=d.replace(a,c),p=S(p,t,d);break}if(t=d.indexOf(s),d&&t>0){f=d.replace(s,c),p=S(p,t,d);break}}}if(f){var g=document.getElementsByTagName("head")[0];(m=h(f)).onload=y,m.onreadystatechange=y,window.setTimeout(v,2e3),g.appendChild(m)}}(this.stringLoadedCallback)}return e.prototype.getAppName=function(){return this.officeAppContext.get_appName()},e.prototype.getInitialDataProp=function(e){return this.initialData&&this.initialData[e]},e.prototype.setCurrentItemNumber=function(e){F().setCurrentItemNumber(e)},e.addAdditionalArgs=function(e,t){return t},e.shouldRunInitialDataResponse=function(){return!0},e}(),Wa=function(){var e=ja("permissionLevel");if(void 0===e)return 0;switch(e){case 1:return 1;case 3:return 2;case 2:return 3;default:return 0}},qa=n(301);function Va(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=le(t,!1,!1),i=qa.DDA.SettingsManager.serializeSettings(e);if(JSON.stringify(i).length>32768){var o=X(void 0,qa.DDA.AsyncResultEnum.ErrorCode.Failed,9057,r.asyncContext,"");r.callback&&setTimeout((function(){r.callback&&r.callback(o)}),0)}else qa.AppName.OutlookWebApp===Ua()?Ja(r,i):Ga(r,i)}function Ja(e,t){Q(404,e.asyncContext,e.callback,[t],void 0,void 0,void 0)}function Ga(e,t){var n=-1,r=null;try{var i=JSON.stringify(t),o={};o.SettingsKey=i,qa.DDA.ClientSettingsManager.write(o)}catch(e){r=e}var a=void 0;null!=r?(n=9019,a=X(void 0,qa.DDA.AsyncResultEnum.ErrorCode.Failed,n,e.asyncContext,r)):(n=0,a=X(void 0,qa.DDA.AsyncResultEnum.ErrorCode.Success,n,e.asyncContext)),e.callback&&e.callback(a)}var za=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},Ka=n(301),Qa=function(){function e(e){this.rawData=e,this.settingsData=null}return e.prototype.getSettingsData=function(){return null==this.settingsData&&(this.settingsData=this.convertFromRawSettings(this.rawData),this.rawData=null),this.settingsData},e.prototype.get=function(e){return this.getSettingsData()[e]},e.prototype.set=function(e,t){this.getSettingsData()[e]=t},e.prototype.remove=function(e){delete this.getSettingsData()[e]},e.prototype.saveAsync=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];Va.apply(void 0,za([this.getSettingsData()],e,!1))},e.prototype.convertFromRawSettings=function(e){if(null==e)return{};if(Ua()!==Ka.AppName.OutlookWebApp){var t=e.SettingsKey;if(t)return Ka.DDA.SettingsManager.deserializeSettings(t)}return e},e}(),Xa={toItemRead:function(e){var t=Nt();if(t===Mt.Message||t===Mt.Appointment||t===Mt.MeetingRequest)return e;throw se()},toItemCompose:function(e){var t=Nt();if(t===Mt.MessageCompose||t===Mt.AppointmentCompose)return e;throw se()},toMessage:function(e){return Xa.toMessageRead(e)},toMessageRead:function(e){if(Nt()===Mt.Message||Nt()===Mt.MeetingRequest)return e;throw se()},toMessageCompose:function(e){if(Nt()===Mt.MessageCompose)return e;throw se()},toMeetingRequest:function(e){if(Nt()===Mt.MeetingRequest)return e;throw se()},toAppointment:function(e){if(Nt()===Mt.Appointment)return e;throw se()},toAppointmentRead:function(e){if(Nt()===Mt.Appointment)return e;throw se()},toAppointmentCompose:function(e){if(Nt()===Mt.AppointmentCompose)return e;throw se()}},Ya={SeriesTimeJsonConverter:function(e){if(null!==e&&"object"==typeof e&&null!==e.seriesTimeJson){var t=new li;t.importFromSeriesTimeJsonObject(e.seriesTimeJson),delete e.seriesTimeJson,e.seriesTime=t}return e},CreateAttachmentDetails:function(e){return Kr(e),e},GetCoercionTypeFromString:function(e){return Xt(e)},GetAttachmentTypeFromString:function(e){return function(e){switch(e.toLowerCase()){case"file":return Fr.File;case"item":return Fr.Item;case"cloud":return Fr.Cloud;default:return}}(e)}};(OSF="object"==typeof OSF?OSF:{}).DDA=OSF.DDA||{},OSF.DDA.Settings=Qa,(OSF="object"==typeof OSF?OSF:{}).DDA=OSF.DDA||{},OSF.DDA.OutlookAppOm=Ba,(Office="object"==typeof Office?Office:{}).cast=Office.cast||{},Office.cast.item=Xa,Microsoft.Office.WebExtension.MailboxEnums=ge,Microsoft.Office.WebExtension.CoercionType=he,Microsoft.Office.WebExtension.SeriesTime=li,Microsoft.Office.WebExtension.OutlookBase=Ya,Microsoft.Office.WebExtension.DevicePermissionType=me;const Za=Ba;var $a=window;$a.$h="object"==typeof $h?$h:{},$a.$h.Message=$h.Message||{},$a.$h.Appointment=$h.Appointment||{},$a.$h.Message.isInstanceOfType=function(e){return e&&"message"===e.itemType},$a.$h.Appointment.isInstanceOfType=function(e){return e&&"appointment"===e.itemType},(Outlook=void 0===Outlook?{}:Outlook).OutlookAppOm=r.default})(),function(e){if(!function(){try{return"object"==typeof process&&"[object process]"===String(process)}catch(e){return!1}}()&&!e.isOfficeReactNative()){try{e.Flights=e.OUtil.parseFlights(!0),e.DisabledChangeGates=e.OUtil.parseDisabledChangeGates(!0)}catch(e){}function t(){OSFPerformance.hostSpecificFileName=e.LoadScriptHelper.getHostBundleJsName(),Office.onReadyInternal((function(){OSFPerfUtil.sendPerformanceTelemetry()}))}e._OfficeAppFactory.bootstrap((function(){}),(function(e){e instanceof Error?console.warn(e.message):console.warn(JSON.stringify(e))})),"complete"===document.readyState||"interactive"===document.readyState?t():window.addEventListener("DOMContentLoaded",(function(e){t()}))}}(OSF||(OSF={})),OSFPerformance.hostInitializationEnd=OSFPerformance.now(),OSFPerformance.totalJSHeapSize=OSFPerformance.getTotalJSHeapSize(),OSFPerformance.usedJSHeapSize=OSFPerformance.getUsedJSHeapSize(),OSFPerformance.jsHeapSizeLimit=OSFPerformance.getJSHeapSizeLimit();export{oteljs,OTel,Microsoft,OfficeExtension,Office,Outlook};