Mini Kabibi Habibi

Current Path : C:/Program Files/Microsoft Office/root/Office16/
Upload File :
Current File : C:/Program Files/Microsoft Office/root/Office16/excel-udf-host.win32.new.bundle

var OSFPerformance,CustomFunctionMappings,Strings;!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.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 o=t._constructEventObjectForCallback(e);o?window.setTimeout((function(){n.callback(o)}),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,o,r){e._OfficeAppFactory.getAsyncMethodExecutor().executeAsync(94,{fromSafeArrayHost:function(e){return e},fromWebHost:function(e){return e},toSafeArrayHost:function(){return[t,n,o]},toWebHost:function(){var e={};return e[0]=t,e[1]=n,e[2]=o,e}},r)},t.prototype.addHandlerAsync=function(t,n,o){e.EventHelper.addEventHandler(t,n,o,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,o=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 r=JSON.stringify(n);o._invokeAppCommandCompletedMethod(e.appCommandId,0,r)},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 o=arguments[0];for(var r in o)this.associate(r,o[r])}else if(2==arguments.length){var i=arguments[0],a=arguments[1];if("string"!=typeof i)return void n("[InvalidArg] Function=associate");if("function"!=typeof a)return void n("[InvalidArg] Function=associate");var s=i.toUpperCase();this.m_mappings[s]&&n("[DuplicatedName] Function="+i),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,o,r){if(0==n){var i={status:Office.AsyncResultStatus.Succeeded,value:o,asyncContext:r};"function"==typeof t&&t(i)}else{var a={status:Office.AsyncResultStatus.Failed,error:{code:n},asyncContext:r};"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,o,r,i,a,s){var c,u;if("number"==typeof(t=e.Utility.fromSafeArray(t))?(c=[],u=t):u=(c=t)[0],1==u)return null!=(l=c[1])&&(o[l[0]]=l[1]),!1;if(r){var l;if(0==u){if(c.length>2){l=[];for(var f=1;f<c.length;f++)l[f-1]=c[f]}else l=c[1];if(o.length>0&&null!=l){var d=l[l.length-1];o.length==d?l[l.length-1]=o:u=5001}}else l=c[1];var p=null;0==u&&(p=i.fromSafeArrayHost(l)),this._asyncMethodExecutor.invokeCallback(a,r,u,p,s)}return!0},t.prototype.handleWebHostResponse=function(e,t,n,o,r,i){var a=null;0==t&&(a=o.fromWebHost(e)),this._asyncMethodExecutor.invokeCallback(r,n,t,a,i)},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="0.0.0.0"}(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(e){!function(e){var t={},n=!1;e.getErrorArgs=function(e){var o;n||(o=Strings.OfficeOM,t[1e3]={name:o.L_InvalidCoercion,message:o.L_CoercionTypeNotSupported},t[1001]={name:o.L_DataReadError,message:o.L_GetSelectionNotSupported},t[1002]={name:o.L_InvalidCoercion,message:o.L_CoercionTypeNotMatchBinding},t[1003]={name:o.L_DataReadError,message:o.L_InvalidGetRowColumnCounts},t[1004]={name:o.L_DataReadError,message:o.L_SelectionNotSupportCoercionType},t[1005]={name:o.L_DataReadError,message:o.L_InvalidGetStartRowColumn},t[1006]={name:o.L_DataReadError,message:o.L_NonUniformPartialGetNotSupported},t[1008]={name:o.L_DataReadError,message:o.L_GetDataIsTooLarge},t[1009]={name:o.L_DataReadError,message:o.L_FileTypeNotSupported},t[1010]={name:o.L_DataReadError,message:o.L_GetDataParametersConflict},t[1011]={name:o.L_DataReadError,message:o.L_InvalidGetColumns},t[1012]={name:o.L_DataReadError,message:o.L_InvalidGetRows},t[1013]={name:o.L_DataReadError,message:o.L_InvalidReadForBlankRow},t[2e3]={name:o.L_DataWriteError,message:o.L_UnsupportedDataObject},t[2001]={name:o.L_DataWriteError,message:o.L_CannotWriteToSelection},t[2002]={name:o.L_DataWriteError,message:o.L_DataNotMatchSelection},t[2003]={name:o.L_DataWriteError,message:o.L_OverwriteWorksheetData},t[2004]={name:o.L_DataWriteError,message:o.L_DataNotMatchBindingSize},t[2005]={name:o.L_DataWriteError,message:o.L_InvalidSetStartRowColumn},t[2006]={name:o.L_InvalidFormat,message:o.L_InvalidDataFormat},t[2007]={name:o.L_InvalidDataObject,message:o.L_DataNotMatchCoercionType},t[2008]={name:o.L_InvalidDataObject,message:o.L_DataNotMatchBindingType},t[2009]={name:o.L_DataWriteError,message:o.L_SetDataIsTooLarge},t[2010]={name:o.L_DataWriteError,message:o.L_NonUniformPartialSetNotSupported},t[2011]={name:o.L_DataWriteError,message:o.L_InvalidSetColumns},t[2012]={name:o.L_DataWriteError,message:o.L_InvalidSetRows},t[2013]={name:o.L_DataWriteError,message:o.L_SetDataParametersConflict},t[3e3]={name:o.L_BindingCreationError,message:o.L_SelectionCannotBound},t[3002]={name:o.L_InvalidBindingError,message:o.L_BindingNotExist},t[3003]={name:o.L_BindingCreationError,message:o.L_BindingToMultipleSelection},t[3004]={name:o.L_BindingCreationError,message:o.L_InvalidSelectionForBindingType},t[3005]={name:o.L_InvalidBindingOperation,message:o.L_OperationNotSupportedOnThisBindingType},t[3006]={name:o.L_BindingCreationError,message:o.L_NamedItemNotFound},t[3007]={name:o.L_BindingCreationError,message:o.L_MultipleNamedItemFound},t[3008]={name:o.L_BindingCreationError,message:o.L_InvalidNamedItemForBindingType},t[3009]={name:o.L_InvalidBinding,message:o.L_UnknownBindingType},t[3010]={name:o.L_InvalidBindingOperation,message:o.L_OperationNotSupportedOnMatrixData},t[3011]={name:o.L_InvalidBinding,message:o.L_InvalidColumnsForBinding},t[4e3]={name:o.L_ReadSettingsError,message:o.L_SettingNameNotExist},t[4001]={name:o.L_SaveSettingsError,message:o.L_SettingsCannotSave},t[4002]={name:o.L_SettingsStaleError,message:o.L_SettingsAreStale},t[5e3]={name:o.L_HostError,message:o.L_OperationNotSupported},t[5001]={name:o.L_InternalError,message:o.L_InternalErrorDescription},t[5002]={name:o.L_PermissionDenied,message:o.L_DocumentReadOnly},t[5003]={name:o.L_EventRegistrationError,message:o.L_EventHandlerNotExist},t[5004]={name:o.L_InvalidAPICall,message:o.L_InvalidApiCallInContext},t[5005]={name:o.L_ShuttingDown,message:o.L_ShuttingDown},t[5007]={name:o.L_UnsupportedEnumeration,message:o.L_UnsupportedEnumerationMessage},t[5008]={name:o.L_IndexOutOfRange,message:o.L_IndexOutOfRange},t[5009]={name:o.L_APINotSupported,message:o.L_BrowserAPINotSupported},t[5011]={name:o.L_APICallFailed,message:o.L_RequestTimeout},t[5012]={name:o.L_InvalidOrTimedOutSession,message:o.L_InvalidOrTimedOutSessionMessage},t[5013]={name:o.L_APICallFailed,message:o.L_InvalidApiArgumentsMessage},t[5015]={name:o.L_APICallFailed,message:o.L_WorkbookHiddenMessage},t[5016]={name:o.L_APICallFailed,message:o.L_WriteNotSupportedWhenModalDialogOpen},t[5017]={name:o.L_APICallFailed,message:o.L_UndoNotSupportedMessage},t[5100]={name:o.L_APICallFailed,message:o.L_TooManyIncompleteRequests},t[5101]={name:o.L_APICallFailed,message:o.L_RequestTokenUnavailable},t[5102]={name:o.L_APICallFailed,message:o.L_ActivityLimitReached},t[5103]={name:o.L_APICallFailed,message:o.L_RequestPayloadSizeLimitExceededMessage},t[5104]={name:o.L_APICallFailed,message:o.L_ResponsePayloadSizeLimitExceededMessage},t[6e3]={name:o.L_InvalidNode,message:o.L_CustomXmlNodeNotFound},t[6100]={name:o.L_CustomXmlError,message:o.L_CustomXmlError},t[6101]={name:o.L_CustomXmlExceedQuotaName,message:o.L_CustomXmlExceedQuotaMessage},t[6102]={name:o.L_CustomXmlOutOfDateName,message:o.L_CustomXmlOutOfDateMessage},t[7e3]={name:o.L_PermissionDenied,message:o.L_NoCapability},t[7001]={name:o.L_CannotNavigateTo,message:o.L_CannotNavigateTo},t[7002]={name:o.L_SpecifiedIdNotExist,message:o.L_SpecifiedIdNotExist},t[7004]={name:o.L_NavOutOfBound,message:o.L_NavOutOfBound},t[2014]={name:o.L_DataWriteReminder,message:o.L_CellDataAmountBeyondLimits},t[8e3]={name:o.L_MissingParameter,message:o.L_ElementMissing},t[8001]={name:o.L_PermissionDenied,message:o.L_NoCapability},t[8010]={name:o.L_InvalidValue,message:o.L_InvalidCellsValue},t[8011]={name:o.L_InvalidValue,message:o.L_InvalidTableOptionValue},t[8012]={name:o.L_InvalidValue,message:o.L_InvalidFormatValue},t[8020]={name:o.L_OutOfRange,message:o.L_RowIndexOutOfRange},t[8021]={name:o.L_OutOfRange,message:o.L_ColIndexOutOfRange},t[8022]={name:o.L_OutOfRange,message:o.L_FormatValueOutOfRange},t[8023]={name:o.L_FormattingReminder,message:o.L_CellFormatAmountBeyondLimits},t[1e4]={name:o.L_UserNotSignedIn,message:o.L_UserNotSignedIn},t[11e3]={name:o.L_MemoryLimit,message:o.L_CloseFileBeforeRetrieve},t[11001]={name:o.L_NetworkProblem,message:o.L_NetworkProblemRetrieveFile},t[11002]={name:o.L_InvalidValue,message:o.L_SliceSizeNotSupported},t[12007]={name:o.L_DisplayDialogError,message:o.L_DialogAlreadyOpened},t[12e3]={name:o.L_IndexOutOfRange,message:o.L_IndexOutOfRange},t[12001]={name:o.L_IndexOutOfRange,message:o.L_IndexOutOfRange},t[12002]={name:o.L_DisplayDialogError,message:o.L_NetworkProblem},t[12003]={name:o.L_DialogNavigateError,message:o.L_DialogInvalidScheme},t[12004]={name:o.L_DisplayDialogError,message:o.L_DialogAddressNotTrusted},t[12005]={name:o.L_DisplayDialogError,message:o.L_DialogRequireHTTPS},t[12009]={name:o.L_DisplayDialogError,message:o.L_UserClickIgnore},t[12011]={name:o.L_DisplayDialogError,message:o.L_NewWindowCrossZoneErrorString},t[13e3]={name:o.L_APINotSupported,message:o.L_InvalidSSOAddinMessage},t[13001]={name:o.L_UserNotSignedIn,message:o.L_UserNotSignedIn},t[13002]={name:o.L_UserAborted,message:o.L_UserAbortedMessage},t[13003]={name:o.L_UnsupportedUserIdentity,message:o.L_UnsupportedUserIdentityMessage},t[13004]={name:o.L_InvalidResourceUrl,message:o.L_InvalidResourceUrlMessage},t[13005]={name:o.L_InvalidGrant,message:o.L_InvalidGrantMessage},t[13006]={name:o.L_SSOClientError,message:o.L_SSOClientErrorMessage},t[13007]={name:o.L_SSOServerError,message:o.L_SSOServerErrorMessage},t[13008]={name:o.L_AddinIsAlreadyRequestingToken,message:o.L_AddinIsAlreadyRequestingTokenMessage},t[13009]={name:o.L_SSOUserConsentNotSupportedByCurrentAddinCategory,message:o.L_SSOUserConsentNotSupportedByCurrentAddinCategoryMessage},t[13010]={name:o.L_SSOConnectionLostError,message:o.L_SSOConnectionLostErrorMessage},t[13012]={name:o.L_APINotSupported,message:o.L_SSOUnsupportedPlatform},t[13013]={name:o.L_APICallFailed,message:o.L_RequestTokenUnavailable},t[5014]={name:o.L_OperationCancelledError,message:o.L_OperationCancelledErrorMessage},n=!0);var r=t[e];return r?(r.name||(r.name=t[5001].name),r.message||(r.message=t[5001].message)):r=t[5001],r},e.addErrorMessage=function(e,n){t[e]=n}}(e.ErrorCodeManager||(e.ErrorCodeManager={}))}(e.DDA||(e.DDA={}))}(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 o=0;o<n.length;o++)if(n[o]===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],o=!n||0==n.length,r=this.addEventHandler(e,t);return o&&r&&this.fireQueuedEvent(e),r},e.prototype.removeEventHandler=function(e,t){var n=this._eventHandlers[e];if(n&&n.length>0)for(var o=0;o<n.length;o++)if(n[o]===t)return n.splice(o,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],o=0;o<n.length;o++)n[o](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],o=this._queuedEventsArgs[t];return 0==n.length?o.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 o=t[0];n.length>0;){o(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,o,r,i,a,s){var c=0;function u(t){0==t&&(i.hasEventHandler(n,o)||i.addEventHandler(n,o)||(t=5010));e._OfficeAppFactory.getAsyncMethodExecutor().invokeCallback(c,r,t,null,a)}var l=i.getEventInfo(n);if(l)try{if(s)return void u(0);c=l.id;var f=l.getTargetId();if(0==i.getEventHandlerCount(n))e._OfficeAppFactory.getAsyncMethodExecutor().registerEventAsync(c,l.type,f,(function(e){i.fireEvent(e)}),l,(function(t){u(e.Utility.getErrorCodeFromAsyncResult(t))}),a);else u(0)}catch(e){t.onException(c,e,r)}else u(5010)},t.removeEventHandler=function(n,o,r,i,a,s){var c=0;function u(t){e._OfficeAppFactory.getAsyncMethodExecutor().invokeCallback(c,r,t,null,a)}var l=i.getEventInfo(n);if(l)try{c=l.id;var f=l.getTargetId(),d=0,p=!0;null===o?(p=i.clearEventHandlers(n),d=0):d=(p=i.removeEventHandler(n,o))?0:5003;var h=i.getEventHandlerCount(n);if(p&&0==h)e._OfficeAppFactory.getAsyncMethodExecutor().unregisterEventAsync(c,l.type,f,(function(t){u(e.Utility.getErrorCodeFromAsyncResult(t))}),a);else u(d)}catch(e){t.onException(c,e,r)}else u(5010)},t.onException=function(t,n,o){if("number"!=typeof n)throw n;e._OfficeAppFactory.getAsyncMethodExecutor().invokeCallback(t,o,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.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,o){this._hostInfo=e,this._webAppState=t,this._context=n,this._hostFacade=o}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 o=n.getItem(e._OfficeAppFactory.getCachedSessionSettingsKey());o?t=JSON.parse(o):(o=JSON.stringify(t),n.setItem(e._OfficeAppFactory.getCachedSessionSettingsKey(),o))}var r=e.OUtil.deserializeSettings(t),i=this.createClientSettingsManager();return new Office.Settings(r,i)},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}();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){!function(t){var n,o=null,r=!1,i=["excel","word","powerpoint","onenote","outlook","visio","office-common","office.common","office","officebase"],a=[".js",".debug.js"],s="_osfDisableHostCheck",c=function(){try{return document.currentScript}catch(e){return null}}();function u(){return l(),n.trustedTypesOptIn}function l(){if(!n){var e=function(e){var t=null!=e?e.src:null;if(!t)return null;for(var n=t.toLowerCase(),o=0;o<i.length;o++)for(var r=0;r<a.length;r++){var c=i[o]+a[r],u=n.indexOf(c);if(u>=0&&(0===u||"/"===t.charAt(u-1)||"\\"===t.charAt(u-1))&&(u+c.length===t.length||"?"===t.charAt(u+c.length))){var l=t.substring(0,u),f=n.indexOf(".debug.js",u)>0,d=e.getAttribute("data-is-sdx"),p="1"===d||"true"===d,h=e.getAttribute("data-enable-trusted-types"),g="1"===h||"true"===h;return{basePath:l,name:c,isDebugJs:f,isSdx:p,disableHostCheck:window.hasOwnProperty(s)&&!0===window._osfDisableHostCheck,trustedTypesOptIn:g}}}return null};if(!(n=e(c))){for(var t=document.getElementsByTagName("script"),o=t.length,r=0;r<o;r++)if(n=e(t[r]))return;n={basePath:"",name:"",isDebugJs:!1,isSdx:!1,disableHostCheck:!1,trustedTypesOptIn:!1}}}}t.getHostBundleJsBasePath=function(){return l(),n.basePath},t.getHostBundleJsName=function(){return l(),n.name},t.getOfficeStringJsName=function(){return l(),n.isDebugJs?e.ConstantNames.OfficeStringDebugJS:e.ConstantNames.OfficeStringJS},t.isSdx=function(){return l(),n.isSdx},t.disableHostCheck=function(){return l(),n.disableHostCheck},t.trustedTypesOptIn=u,t.loadScriptWithBasename=function(t,o,r){l();var i=t+(n.isDebugJs?".debug.js":".js");i=i.toLowerCase();var a=n.basePath+i;e.OUtil.loadScript(a,o,d())};var f=["https://alcdn.msauth.net/browser-1p/2.28.1/js/msal-browser-1p.min.js"];function d(){if(!r){r=!0;try{if(!u()||!window.trustedTypes||!window.trustedTypes.createPolicy)return null;var e=c.src,t=new URL(e).origin.toLowerCase();if(!t)return null;o=window.trustedTypes.createPolicy("officejs",{createScriptURL:function(e){var n=e.toLowerCase(),o=new URL(n).origin;if(t&&t===o)return e;for(var r=0,i=f;r<i.length;r++){if(n===i[r])return e}throw new Error("Untrusted script URL")}})}catch(e){}}return o}t.getTrustedTypesPolicy=d}(e.LoadScriptHelper||(e.LoadScriptHelper={}))}(OSF||(OSF={})),function(e){!function(t){!function(t){t.getAuthContextAsync=function(t){function n(e){var t=e.userObjectId||"",n=e.tenantId||"",o=e.userPrincipalName||"";return{userObjectId:t,tenantId:n,userPrincipalName:o,authorityType:e.authorityType||"",authorityBaseUrl:e.authorityBaseUrl||"",puid:e.puid||"",loginHint:e.loginHint||o}}var o={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,o,t)}}(t.Auth||(t.Auth={}))}(e.DDA||(e.DDA={}))}(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,o){if(void 0===o&&(o="en-us"),!e)return o;var r;if((e=e.toLowerCase())in t)r=e;else{var i=e.split("-",1);i&&i.length>0&&(r=n[i[0]])}return r||(r=o),r}}(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,o){if(e._OfficeAppFactory.getHostInfo().hostLocale){var r=e.LoadScriptHelper.getHostBundleJsBasePath()+e._OfficeAppFactory.getHostInfo().hostLocale+"/"+e.LoadScriptHelper.getOfficeStringJsName();e.OUtil.loadScript(r,(function(r){if(r)n();else{var i=e.LoadScriptHelper.getHostBundleJsBasePath()+e.ConstantNames.DefaultLocale+"/"+e.LoadScriptHelper.getOfficeStringJsName();t.loadScript(i,(function(t){t?n():o(new Error("Cannot load "+e.ConstantNames.OfficeStringJS))}),e.LoadScriptHelper.getTrustedTypesPolicy())}}),e.LoadScriptHelper.getTrustedTypesPolicy())}else o(new Error("No host locale"))}))),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,o,r){var i={};i[e.GoToType.Binding]=0,i[e.GoToType.NamedItem]=1,i[e.GoToType.Slide]=2,i[e.GoToType.Index]=3;var a={};a[e.SelectionMode.Default]=0,a[e.SelectionMode.Selected]=1,a[e.SelectionMode.None]=2;var s=i[n],c=0,u=r;"function"==typeof o?u=o:void 0!==o&&(c=a[o]);var l={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,l,u)}}(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 o=n.toArray();t(JSON.parse(o[0]))}),null)}}}(e.messaging||(e.messaging={}))}(e.context||(e.context={}))}(Office||(Office={})),function(e){!function(t){var n,o;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(!o){var t=OSF._OfficeAppFactory.getOfficeAppContext().get_hostSettingsFunc();if(void 0!==t){var n=t(),r=OSF.OUtil.deserializeSettings(n);o=new e.Settings(r,void 0)}}return o}))}(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,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);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})))}function n(n){return t(),n&&(e._officeOnReadyState.officeOnReadyFired?n(e._officeOnReadyState.officeOnReadyHostAndPlatformInfo):e._officeOnReadyState.officeOnReadyCallbacks.push(n)),e._officeOnReadyState.officeOnReadyPromise}e._officeOnReadyState=e._officeOnReadyState||{isOfficeOnReadyCalled:!1,officeOnReadyPromise:null,officeOnReadyPromiseResolve:null,officeOnReadyCallbacks:[],officeOnReadyHostAndPlatformInfo:null,officeOnReadyFired:!1},e.initialize=e.initialize,e.onReadyInternal=n,e.onReady=function(t){return e._officeOnReadyState.isOfficeOnReadyCalled=!0,n(t)},e.fireOnReady=function(n){for(t(),e._officeOnReadyState.officeOnReadyHostAndPlatformInfo=__assign({},n),e._officeOnReadyState.officeOnReadyFired=!0,OSFPerformance.officeOnReady=OSFPerformance.now();e._officeOnReadyState.officeOnReadyCallbacks.length>0;)e._officeOnReadyState.officeOnReadyCallbacks.shift()(e._officeOnReadyState.officeOnReadyHostAndPlatformInfo);e._officeOnReadyState.officeOnReadyPromiseResolve(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)}}(Office||(Office={})),function(e){var t=function(){function t(t,n,o,r,i,a,s,c,u,l,f,d,p,h,g,m,v,y,_,b,O,S,I,E,C,A,P,w,x,F,R,N,M){this._id=t,this._appName=n,this._appVersion=o,this._appUILocale=r,this._dataLocale=i,this._docUrl=a,this._clientMode=s,this._settingsFunc=c,this._reason=u,this._osfControlType=l,this._eToken=f,this._correlationId=d,this._appInstanceId=p,this._touchEnabled=h,this._commerceAllowed=g,this._appMinorVersion=m,this._requirementMatrix=v,this._hostCustomMessage=y,this._hostFullVersion=_,this._isDialog=e.OUtil.isDialog(),this._clientWindowHeight=b,this._clientWindowWidth=O,this._addinName=S,this._appDomains=I,this._dialogRequirementMatrix=E,this._featureGates=C,this._officeThemeFunc=A,this._initialDisplayMode=P,this._isFromWacAutomation=w,this._wopiHostOriginForSingleSignOn=x,this._hostSettingsFunc=F,this._isWeb=R,this._nestedAppAuthBridgeType=N,this._partitionKey=M}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}();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",o=null;try{if(window.external=window.external||{},"undefined"!=typeof agaveHost&&agaveHost.GetHostInfo&&(window.external.GetHostInfo=function(){return agaveHost.GetHostInfo()}),window.external.GetHostInfo){var r=window.external.GetHostInfo();if("isDialog"==r)t.isO15=!0,t.isDialog=!0;else{var i=r.split("_host_Info=");o=i.length>1?i[1]:r}}}catch(t){e.Utility.log(JSON.stringify(t))}if(!o)try{var a=window.name;if(a){var s=JSON.parse(a);o=s?s.hostInfo:null}}catch(t){e.Utility.log(JSON.stringify(t))}o||(o=e.Utility.getQueryStringValue(n));var c=e.OUtil.getSessionStorage();if(!o&&c.getItem("hostInfoValue")&&(o=c.getItem("hostInfoValue")),o){o=decodeURIComponent(o),t.isO15=!1;var u=o.split("$");void 0===u[2]&&(u=o.split("|")),t.hostType=void 0===u[0]?"":u[0].toLowerCase(),t.hostPlatform=void 0===u[1]?"":u[1].toLowerCase(),t.hostSpecificFileVersion=void 0===u[2]?"":u[2].toLowerCase(),t.hostLocale=void 0===u[3]?"":u[3].toLowerCase(),t.osfControlAppCorrelationId=void 0===u[4]?"":u[4],"telemetry"==t.osfControlAppCorrelationId&&(t.osfControlAppCorrelationId=""),t.isDialog=void 0!==u[5]&&"isDialog"==u[5],t.disableLogging=void 0!==u[6]&&"disableLogging"==u[6],t.flags="string"==typeof u[7]&&u[7].length>0?parseInt(u[7]):0,c.setItem("hostInfoValue",o)}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,o,r,i,a,s,c,u,l;"undefined"!=typeof window&&(window.location&&(n=window.location.hash,o=window.location.search),r=window.name);var f={0:"Unknown",1:"Hidden",2:"Taskpane",3:"Dialog"};function d(t,n){e.AppCommandManager.initialize();var o=t.get_appName(),r=null;0!=(i.flags&e.HostInfoFlags.SharedApp)&&(r={visibilityMode:f[t.get_initialDisplayMode()]}),Office.fireOnReady({host:e.HostName.Host.getInstance().getHost(o),platform:e.HostName.Host.getInstance().getPlatform(o),addin:r}),i.hostPlatform==e.HostInfoPlatform.web&&null!=a.clientEndPoint&&a.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[a.id,e.AgaveHostAction.OfficeJsReady,Date.now()]),n(t)}t.bootstrap=function(n,o){if(a={id:null,webAppUrl:null,conversationID:null,clientEndPoint:null,wnd:window.parent,focused:!1,serviceEndPoint:null},i=t.retrieveHostInfo(),function(){!0;try{if(i.disableLogging)return void!1;window.external=window.external||{},void 0===window.external.GetLoggingAllowed||window.external.GetLoggingAllowed()}catch(e){}}(),function(){if(i.hostPlatform===e.HostInfoPlatform.web)s=new e.WebInitializationHelper(i,a,null,null);else if(i.hostPlatform===e.HostInfoPlatform.win32)s=new e.RichClientInitializationHelper(i,a,null,null);else if(i.hostPlatform===e.HostInfoPlatform.ios||i.hostPlatform===e.HostInfoPlatform.mac){if(!(window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.Agave))throw e.Utility.createNotImplementedException();s=new e.WebkitInitializationHelper(i,a,null,null)}else i.hostPlatform===e.HostInfoPlatform.android||i.hostPlatform===e.HostInfoPlatform.winrt?s=new e.WebViewInitializationHelper(i,a,null,null):console.warn("Office.js is loaded inside in unknown host or platform "+i.hostPlatform)}(),s){i.hostPlatform===e.HostInfoPlatform.web&&s.saveAndSetDialogInfo(e.Utility.getQueryStringValue("_host_Info")),s.setAgaveHostCommunication(),OSFPerformance.getAppContextStart=OSFPerformance.now();s.getAppContext(window,(function(t){OSFPerformance.getAppContextEnd=OSFPerformance.now(),e.AppTelemetry.initialize(t),u=t,l=s.createClientHostController(),c=s.createAsyncMethodExecutor(),s.prepareApiSurface(t),e.BootStrapExtension.onGetAppContext?e.BootStrapExtension.onGetAppContext(t,a.wnd).then((function(){d(t,n)})):d(t,n)}),(function(e){o(e)}))}else o(new Error("Office.js cannot be initialized."))},t.getWindowName=function(){return r},t.getWindowLocationHash=function(){return n},t.getWindowLocationSearch=function(){return o},t.getAsyncMethodExecutor=function(){return c},t.getOfficeAppContext=function(){return u},t.getHostInfo=function(){return i},t.getCachedSessionSettingsKey=function(){return(null!=a.conversationID?a.conversationID:u.get_appInstanceId())+"CachedSessionSettings"},t.getWebAppState=function(){return a},t.getId=function(){return a.id},t.getInitializationHelper=function(){return s},t.getClientHostController=function(){return l}}(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={}))}(Office||(Office={}));var OfficeExt,OSFPerfUtil,__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 o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();!function(e){e.appSpecificCheckOrigin=function(e,t,n,o){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 o=function(){function o(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 o.prototype.registerMethod=function(n,o,r,i){if(0!==r&&1!==r)throw e.Utility.createArgumentException("invokeType");var a=new t(o,r,i);this._methodObjectList[n]=a},o.prototype.unregisterMethod=function(e){delete this._methodObjectList[e]},o.prototype.registerEvent=function(e,o,r){var i=new n(new t(o,4,!1),new t(r,5,!1));this._methodObjectList[e]=i},o.prototype.registerEventEx=function(e,o,r,i,a){var s=new n(new t(o,r,!1),new t(i,a,!1));this._methodObjectList[e]=s},o.prototype.unregisterEvent=function(e){this.unregisterMethod(e)},o.prototype.registerConversation=function(t,n,o){if(e.Utility.xdmDebugLog("registerConversation: cId="+t+" Url="+n),o){if(!Array.isArray(o))throw e.Utility.createArgumentException("appDomains");this._appDomains[t]=o}this._conversations[t]={url:n}},o.prototype.unregisterConversation=function(e){delete this._conversations[e]},o.prototype.setPolicyManager=function(t){if(!t.checkPermission)throw e.Utility.createArgumentException("policyManager");this._policyManager=t},o.prototype.getPolicyManager=function(){return this._policyManager},o.prototype.dispose=function(){this._methodObjectList=null,this._eventHandlerProxyList=null,this._Id=null,this._conversations=null,this._policyManager=null,this._appDomains=null,this._onHandleRequestError=null},o}();e.XdmServiceEndPoint=o;var r,i=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 o=this,i=function(){var i=o._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__),o._callbackList[i]=c;try{if(3!==o._hostTrustCheckStatus&&"ContextActivationManager_getAppContextAsync"!==e)throw"Access Denied";var l=new s(e,0,o._conversationId,i,n),f=u.envelope(l);o._targetWindow.postMessage(f,o._targetUrl),r._startMethodTimeoutTimer()}catch(e){try{null!==t&&t(-1,e)}finally{delete o._callbackList[i]}}};this._checkReceiverOriginAndRun?this._checkReceiverOriginAndRun(i):(this._hostTrustCheckStatus=3,i())},e.prototype.registerForEvent=function(e,t,n,o){var i=this._callingIndex++,a=new Date;this._callbackList[i]={callback:n,createdOn:a.getTime()};try{var c=new s(e,1,this._conversationId,i,o),l=u.envelope(c);this._targetWindow.postMessage(l,this._targetUrl),r._startMethodTimeoutTimer(),this._eventHandlerList[e]=t}catch(e){try{null!==n&&n(-1,e)}finally{delete this._callbackList[i]}}},e.prototype.unregisterForEvent=function(e,t,n){var o=this._callingIndex++,i=new Date;this._callbackList[o]={callback:t,createdOn:i.getTime()};try{var a=new s(e,2,this._conversationId,o,n),c=u.envelope(a);this._targetWindow.postMessage(c,this._targetUrl),r._startMethodTimeoutTimer()}catch(e){try{null!==t&&t(-1,e)}finally{delete this._callbackList[o]}}finally{delete this._eventHandlerList[e]}},e}();e.XdmClientEndPoint=i,function(t){var n=[],r=null,a=null,s=!1,l={},p={},h=!1;function g(){null!==a?s||(n.length>0?m(n.shift()):(clearInterval(a),a=null)):e.Utility.xdmDebugLog("channel is not ready.")}function m(e){s=e.getInvokeBlockingFlag(),e.invoke(),r=(new Date).getTime()}function v(){s=!1}function y(t,n){var o=!1;if(!(n&&"null"!==n&&n.length&&t&&t instanceof Array&&t.length))return o;for(var r=0;r<t.length&&!o;r++)if(-1!==t[r].indexOf("://")){var i=e.OUtil.parseUrl(n,!0);o=O(e.OUtil.parseUrl(t[r],!0),i)}return o}function _(t){if(!t||"null"===t)return!1;var n=new Array("^outlook\\.office\\.com$","^outlook-sdf\\.office\\.com$","^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$","^.*\\.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 b(t,n){if(!t||!n||"null"===t||"null"===n)return!1;var o=e.OUtil.parseUrl(t,!0),r=e.OUtil.parseUrl(n,!0);if(null==o||null==r)return!1;var i=o.protocol===r.protocol,a=o.port===r.port,s=r.hostname,c=o.hostname,u=s===c,l=!1;return!u&&s.length>c.length+1&&(l=s.slice(-(c.length+1))==="."+c),a&&i&&(u||l)}function O(e,t){return e.hostname==t.hostname&&e.protocol==t.protocol&&e.port==t.port}function S(t){if(""!=t.data){var o,i=t.data;try{o=u.unenvelope(i)}catch(e){return}if(e.Utility.xdmDebugLog(i),0===o._messageType){var h=null==t.origin||"null"===t.origin?o._origin:t.origin;try{var S=function(t){for(var n in l)if(l[n]._conversations[t])return l[n];throw e.Utility.createArgumentException("conversationId")}(o._conversationId);e.Utility.xdmDebugLog("_receive: request, origin="+h+" sourceURL:"+S._conversations[o._conversationId]);var I=S._conversations[o._conversationId];e.Utility.xdmDebugLog("_receive: request, origin="+h+" sourceURL:"+I.url);var E=[I.url].concat(S._appDomains[o._conversationId]);if(!y(E,t.origin))if(!OfficeExt.appSpecificCheckOrigin(E,t,o._origin,y))if(!b(I.url,t.origin))throw"Failed origin check";var C=S.getPolicyManager();if(C&&!C.checkPermission(o._conversationId,o._actionName,o._data))throw"Access Denied";var A=function(t,n){var o=t._methodObjectList[n._actionName];if(!o)throw e.Utility.xdmDebugLog("The specified method is not registered on service endpoint:"+n._actionName),e.Utility.createArgumentException("messageObject");return 0===n._actionType?o:1===n._actionType?o.getRegisterMethodObject():o.getUnregisterMethodObject()}(S,o),P=new f(t.source,h,o._actionName,o._conversationId,o._correlationId,v),w=new d(A,o._data,P,S._eventHandlerProxyList,o._conversationId,o._actionName),x=!0;null==a&&((null==r||(new Date).getTime()-r>10)&&!s?(m(w),x=!1):a=setInterval(g,10)),x&&function(e){n.push(e)}(w)}catch(n){S&&S._onHandleRequestError&&S._onHandleRequestError(o,n);var F=-2;"Access Denied"==n&&(F=-5);var R=new c(o._actionName,o._conversationId,o._correlationId,F,0,n),N=u.envelope(R),M=!1;try{M=!(!t.source||!t.source.postMessage)}catch(e){}var T=!1;if(window.location.href&&t.origin&&"null"!==t.origin&&b(window.location.href,t.origin))T=!0;else if(t.origin&&"null"!==t.origin)T=_(e.OUtil.parseUrl(t.origin,!0).hostname);M&&T&&t.source.postMessage(N,h)}}else{if(1!==o._messageType)return;var j=function(t){var n=p[t];return n||e.Utility.xdmDebugLog("Unknown conversation Id."),n}(o._conversationId);if(!j)return;if(e.Utility.xdmDebugLog("_receive: response, origin="+t.origin+" targetURL:"+j._targetUrl),L=j._targetUrl,D=t.origin,!(L&&D&&"null"!==L&&"null"!==D&&L.length&&D.length&&O(e.OUtil.parseUrl(L,!0),e.OUtil.parseUrl(D,!0))))throw"Failed orgin check";if(3==j._hostTrustCheckStatus&&(j._fHostTrusted=!0),0===o._responseType){var H=j._callbackList[o._correlationId];if(H)try{H.callback&&H.callback(o._errorCode,o._data)}finally{delete j._callbackList[o._correlationId]}}else{var k=j._eventHandlerList[o._actionName];null!=k&&k(o._data)}}}var L,D}function I(){h||(!function(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)}}(S),h=!0)}t.connect=function(e,t,n){var o=p[e];return o||(I(),o=new i(e,t,n),p[e]=o),o},t.getClientEndPoint=function(e){return p[e]},t.createServiceEndPoint=function(e){I();var t=new o(e);return l[e]=t,t},t.getServiceEndPoint=function(e){return l[e]},t.deleteClientEndPoint=function(e){delete p[e]},t.deleteServiceEndPoint=function(e){delete l[e]},t.checkUrlWithAppDomains=function(e,t){return y(e,t)},t.isTargetSubdomainOfSourceLocation=function(e,t){return b(e,t)},t._setMethodTimeout=function(e){e<=0?65e3:e},t._startMethodTimeoutTimer=function(){},t.isHostNameValidWacDomain=function(e){return _(e)}}(r=e.XdmCommunicationManager||(e.XdmCommunicationManager={}));var a=function(){function e(e,t,n,o,r){this._messageType=e,this._actionName=t,this._conversationId=n,this._correlationId=o,this._origin=window.location.origin,this._data=void 0===r?null:r}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,o,r,i){var a=e.call(this,0,t,o,r,i)||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,o,r,i,a){var s=e.call(this,1,t,n,o,a)||this;return s._errorCode=r,s._responseType=i,s}return __extends(t,e),t.prototype.getErrorCode=function(){return this._errorCode},t.prototype.getResponseType=function(){return this._responseType},t}(a),u=function(){function e(){}return e.envelope=function(e){return JSON.stringify(e)},e.unenvelope=function(e){return JSON.parse(e)},e}(),l=function(){function t(t,n,o,r,i,a){var s=this;this._invokeResultCode=0,this._requesterWindow=t,this._requesterUrl=n,this._actionName=o,this._conversationId=r,this._correlationId=i,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),o=u.envelope(n);s._requesterWindow.postMessage(o,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}(),f=function(t){function n(n,o,r,i,a,s){var l=t.call(this,n,o,r,i,a,0)||this;return l._postCallbackHandler=s,l._send=function(t,n){null!=n&&(l._invokeResultCode=n);try{var o=new c(l._actionName,l._conversationId,l._correlationId,l._invokeResultCode,l._responseType,t),r=u.envelope(o);l._requesterWindow.postMessage(r,l._requesterUrl),l._postCallbackHandler()}catch(t){e.Utility.xdmDebugLog("InvokeCompleteCallback._send error:"+t.message)}},l}return __extends(n,t),n}(l),d=function(){function e(e,t,n,o,r,i){this._callerId="",this._methodObject=e,this._param=t,this._invokeCompleteCallback=n,this._eventHandlerProxyList=o,this._conversationId=r,this._eventName=i}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 o=this._createEventHandlerProxyObject(this._invokeCompleteCallback);this._methodObject.getMethod()(o.getSend(),this._invokeCompleteCallback.getSend(),this._param),this._eventHandlerProxyList[this._callerId+this._eventName]=o.getSend();break;case 3:var r=this._eventHandlerProxyList[this._callerId+this._eventName];this._methodObject.getMethod()(r,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 l(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,o=OSF.LoadScriptHelper.getHostBundleJsName().toLowerCase();performance.getEntriesByType("resource").forEach((function(t){var r=t.name.toLowerCase();OSF.Utility.stringEndsWith(r,o)?e=t:(OSF.Utility.stringEndsWith(r,OSF.ConstantNames.OfficeDebugJS)||OSF.Utility.stringEndsWith(r,OSF.ConstantNames.OfficeJS))&&(n=t)})),OTel.OTelLogger.onTelemetryLoaded((function(){var o=[];e&&(o=o.concat(t(e,"HostJs"))),n&&(o=o.concat(t(n,"OfficeJs"))),o=o.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))]),Microsoft.Office.WebExtension.sendTelemetryEvent({eventName:"Office.Extensibility.OfficeJs.JSPerformanceTelemetryV06",dataFields:o,eventFlags:{dataCategories:2,diagnosticLevel:110}})}))}}}(OSFPerfUtil||(OSFPerfUtil={})),function(e){!function(t){var n,o,r={};!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(),o=0;o<32&&n>0;o++)8!=o&&12!=o&&16!=o&&20!=o||(e+="-"),e+=t[n%16],n=Math.floor(n/16);for(;o<32;o++)8!=o&&12!=o&&16!=o&&20!=o||(e+="-"),e+=t[Math.floor(16*Math.random())];return e}}(t.Guid||(t.Guid={})),t.loadScript=function(e,t,n,o){if(e&&t){var i=window.document,a=r[e];if(a)a.loaded?t(!0):a.pendingCallbacks.push(t);else{var s=i.createElement("script");s.type="text/javascript",a={loaded:!1,pendingCallbacks:[t],timer:null},r[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)}},u=function(){delete r[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=u,o=o||3e4,a.timer=setTimeout(u,o),s.setAttribute("crossOrigin","anonymous"),s.src=n?n.createScriptURL(e):e,i.getElementsByTagName("head")[0].appendChild(s)}}},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(!o){try{var t=window.localStorage}catch(e){t=null}o=new e.SafeStorage(t)}return o},t.waitForFunction=function(e,t,n,o){var r,i=n,a=function(){i--,e()?t(!0):i>0?(r=window.setTimeout(a,o),i--):(window.clearTimeout(r),t(!1))};a()}}(e.OUtil||(e.OUtil={}))}(OSF||(OSF={})),function(e){e.Flights=[],e.DisabledChangeGates=[];e.FlightTreatmentNames={EnableMsal3SsoApi:"Microsoft.Office.SharedOnline.EnableMsal3SsoApi"},function(t){var n="&_flights=",o="&_disabledChangeGates=",r="_flights=",i="_disabledChangeGates=";function a(e,t){return e.substr(0,t.length)===t}function s(e,t,n,o){return a(e,t+"//"+n+":"+o)||a(e,n+":"+o)}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 u(e){var t=[];try{t=JSON.parse(e)}catch(e){}return Array.isArray(t)||(t=[]),t}function l(e,n,o){try{var r=JSON.parse(n),i=null!=r?r[o]:null,a=t.getSessionStorage();if(!e&&a&&null!=r){var s=r.baseFrameName+o;i?a.setItem(s,i):i=a.getItem(s)}return i}catch(e){return null}}function f(e,n,o,r,i){var a=i.split(e),s=a.length>1?a[a.length-1]:null;o&&null!=s&&(s.indexOf("&")>=0&&(s=s.split("&")[0]),s=decodeURIComponent(s));var c=t.getSessionStorage();if(!r&&c){var u=window.name.indexOf(n);if(u>-1){var l=window.name.indexOf(";",u);-1==l&&(l=window.name.length);var f=window.name.substring(u,l);s?c.setItem(f,s):s=c.getItem(f)}}return s}function d(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=d(e,"/"),e=d(e,"?"),"https://"==(e=d(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 h(e){var t,n,o=[],r=[],i=e.length;for(t=0;t<i;t++)(n=e[t]).tabIndex?n.tabIndex>0?r.push(n):0===n.tabIndex&&o.push(n):o.push(n);return r=r.sort((function(e,t){var n=e.tabIndex-t.tabIndex;return 0===n&&(n=r.indexOf(e)-r.indexOf(t)),n})),[].concat(r,o)}t.serializeSettings=function(t){var n={};for(var o in t){var r=t[o];try{r=JSON.stringify(r,(function(t,n){return e.OUtil.isDate(this[t])?c+this[t].getTime()+")":n})),n[o]=r}catch(e){}}return n},t.deserializeSettings=function(e){var t={};for(var n in e=e||{}){var o=e[n];try{o=JSON.parse(o,(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]=o}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 u(f(n,r,!0,e,t))}(e,window.location.hash);return 0==t.length&&(t=function(e,t){return u(l(e,t,"flights"))}(e,window.name)),t},t.parseDisabledChangeGates=function(e){var t=function(e,t){return u(f(o,i,!0,e,t))}(e,window.location.hash);return 0==t.length&&(t=function(e,t){return u(l(e,t,"disabledChangeGates"))}(e,window.name)),t},t.checkFlight=function(t){return e.Flights&&e.Flights.indexOf(t)>=0},t.isChangeGateEnabled=function(t){return!e.DisabledChangeGates||-1===e.DisabledChangeGates.indexOf(t)},t.parseInfoFromWindowName=l,t.parseInfoWithGivenFragment=f,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 o="",r=e.OUtil.parseXdmInfo(n);if(r){var i=e.OUtil.getInfoItems(r);if(null!=i&&i.length>=3)switch(t){case"ConversationUrl":o=i[2];break;case"AppId":o=i[1]}}return o},t.parseUrl=function(t,n){if(void 0===n&&(n=!1),void 0!==t&&t){var o="NotHttps",r="undefined"!=typeof window&&void 0!==window.navigator&&window.navigator.userAgent.indexOf("Trident")>0,i=("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(r){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(o);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);i.protocol=a.protocol,i.hostname=a.hostname,i.port=""==c?a.port:"",i.host=""!=c?a.hostname:a.host,i.pathname=(r?"/":"")+a.pathname,i.search=a.search,i.hash=a.hash,i.isPortPartOfUrl=s(t,a.protocol,a.hostname,a.port)}else{var u=new URL(t);if(u&&u.protocol&&u.host&&u.hostname){if(e.OUtil.checkFlight(2)&&n&&"https:"!=u.protocol)throw new Error(o);i.protocol=u.protocol,i.hostname=u.hostname,i.port=u.port,i.host=u.host,i.pathname=u.pathname,i.search=u.search,i.hash=u.hash,i.isPortPartOfUrl=u.host.lastIndexOf(":"+u.port)==u.host.length-u.port.length-1}}}catch(e){if(e.message===o)throw e}return i}},t.focusToFirstTabbable=function(e,t){var n,o,r=!1,i=function(e){r=!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=h(e),n=t?e.length-1:0,0===e.length)return null;for(;!r&&n>=0&&n<e.length;)o=e[n],window.focus(),o.addEventListener("focus",i),o.focus(),o.removeEventListener("focus",i),n=a(e.length,n,t),r||o!==document.activeElement||(r=!0);return r?o:null},t.focusToNextTabbable=function(e,t,n){var o,r,i,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(o=function(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1}(e=h(e),t),(r=c(e.length,o,n))<0)return null;for(;!a&&r>=0&&r<e.length;)(i=e[r]).addEventListener("focus",s),i.focus(),i.removeEventListener("focus",s),r=c(e.length,r,n),a||i!==document.activeElement||(a=!0);return a?i: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},t.getCustomOfficeInitializationSettings=function(){return"object"==typeof officeInitializationSettings?officeInitializationSettings:{}};var g=0;t.getLibraryReleaseVehicle=function(){return g},t.setLibraryReleaseVehicle=function(e){g=e}}(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 o=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 o=n[e.toLowerCase()];try{var r=this._getVersion(o+"");t+="";var i=this._getVersion(t);if(r.major>0&&r.major>i.major)return!0;if(r.major>0&&r.minor>=0&&r.major==i.major&&r.minor>=i.minor)return!0}catch(e){return!1}}return!1},e.prototype._getVersion=function(e){var t=(e+="").split("."),n=0,o=0;if(t.length<2&&isNaN(Number(e)))throw"version format incorrect";if(n=Number(t[0]),t.length>=2&&(o=Number(t[1])),isNaN(n)||isNaN(o))throw"version format incorrect";return{minor:o,major:n}},e}();t.RequirementMatrix=o;var r=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=r;var i=function(e){function t(){return e.call(this,{dialogapi:1.1})||this}return __extends(t,e),t}(r);t.DefaultRequiredDialogSetRequirement=i;var a=function(e){function t(){return e.call(this,{dialogorigin:1.1})||this}return __extends(t,e),t}(r);t.DefaultOptionalDialogSetRequirement=a;var s=function(){function t(){}return t.getDefaultRequirementMatrix=function(t){var n=void 0,i=t.get_requirementMatrix();if(null!=i&&i.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 o(new r(a))}else n=new o(new r({}));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 r(c)}else{n=new i;var u=t.get_requirementMatrix();if(null!=u&&u.length>0&&"undefined"!=typeof JSON){c=JSON.parse(u.toLowerCase());for(var l in n._sets)c.hasOwnProperty(l)&&(n._sets[l]=c[l]);var f=new a;for(var l in f._sets)c.hasOwnProperty(l)&&(n._sets[l]=c[l])}}if(e._OfficeAppFactory.getHostInfo().hostPlatform==e.HostInfoPlatform.web)try{var d="dialogorigin";!n._sets.hasOwnProperty(d)&&window.opener&&(n._sets[d]=1.1)}catch(e){}return new o(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 o={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,o,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 o=0;o<t.length;o++){var r=t[o];r.toArray&&(r=r.toArray()),n.push({messageCategory:r[0],messageType:r[1],targetId:r[2],message:r[3],id:r[4],isRemoteOverride:r[5]})}return{type:e.EventType.RichApiMessage,entries:n}},t.prototype.addHandlerAsync=function(t,n,o){e.EventHelper.addEventHandler(t,n,o,this._eventDispatch)},t.prototype.removeHandlerAsync=function(t,n,o){e.EventHelper.removeEventHandler(t,n,o,this._eventDispatch)},t.prototype.register=function(t){var n=this;return this._registerPromise||(this._registerPromise=new Office.Promise((function(t,o){n.addHandlerAsync(e.EventType.RichApiMessage,(function(e){n._registerHandlers.forEach((function(t){t&&t(e)}))}),(function(e){"failed"==e.status?o(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,o,r){"undefined"!=typeof OsfOMToken&&OsfOMToken?window.external.RegisterEvent(e,n,o,r,OsfOMToken):window.external.RegisterEvent(e,n,o,r)},t.prototype.unregisterEvent=function(e,t,n,o){"undefined"!=typeof OsfOMToken&&OsfOMToken?window.external.UnregisterEvent(e,n,o,OsfOMToken):window.external.UnregisterEvent(e,n,o)},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,o){var r=this,i=this.getOsfControlContext();if(i){var a,s,c,u,l,f,d,p,h,g,m,v,y,_,b,O,S,I,E,C,A,P,w,x,F,R,N=0,M=!1;if((T=e.Utility.externalNativeFunctionExists)(typeof i.GetContextDataInJson))if("undefined"!=typeof OsfOMToken&&OsfOMToken)if((F=i.GetContextDataInJson(OsfOMToken))&&(R=JSON.parse(F)),R)a=R.appType,s=R.solutionRef,c=R.versionMajor,u=R.versionMinor,l=R.uiLocale,f=R.dataLocale,d=R.docUrl,p=R.clientMode,h=R.activationMode,m=R.controlType,v=R.eToken,y=R.correlationId,_=R.appInstanceId,b=R.touchEnabled,O=i.commerceAllowed,S=R.requirementMatrix,E=R.hostFullVersion,C=R.requirementMatrix,(j=R.featureGates)&&(A=JSON.parse(j)),N=R.initialDisplayMode,P=function(){var t={};if(R.settings)try{var n=JSON.parse(R.settings);if(n)for(var o=[n.names,n.values],r=o[0],i=o[1],a=0;a<r.length;a++)t[r[a]]=i[a]}catch(t){e.Utility.trace("Exception while parsing settings. Details: "+t)}return t},w=function(){var e=R.themeInfo;return r.getOfficeThemeFromInfoString(e)};else M=!0;else M=!0;else M=!0;if(M){a=i.GetAppType(),s=i.GetSolutionRef(),c=i.GetAppVersionMajor(),u=i.GetAppVersionMinor(),l=i.GetAppUILocale(),f=i.GetAppDataLocale(),d=i.GetDocUrl(),p=i.GetAppCapabilities(),h=i.GetActivationMode(),m=i.GetControlIntegrationLevel();try{v=i.GetSolutionToken()}catch(e){}var T;if((T=e.Utility.externalNativeFunctionExists)(typeof i.GetCorrelationId)&&(y=i.GetCorrelationId()),T(typeof i.GetInstanceId)&&(_=i.GetInstanceId()),T(typeof i.GetTouchEnabled)&&(b=i.GetTouchEnabled()),T(typeof i.GetCommerceAllowed)&&(O=i.GetCommerceAllowed()),T(typeof i.GetSupportedMatrix)&&(S=i.GetSupportedMatrix()),T(typeof i.GetHostCustomMessage)&&(I=i.GetHostCustomMessage()),T(typeof i.GetHostFullVersion)&&(E=i.GetHostFullVersion()),T(typeof i.GetDialogRequirementMatrix)&&(C=i.GetDialogRequirementMatrix()),T(typeof i.GetFeaturesForSolution))try{var j;(j=i.GetFeaturesForSolution())&&(A=JSON.parse(j))}catch(t){e.Utility.trace("Exception while creating the SDX FeatureGates object. Details: "+t)}T(typeof i.GetInitialDisplayMode)&&(N=i.GetInitialDisplayMode()),P=function(){return r.getSerializedSettings()},w=function(){return r.getOfficeTheme()},x=function(){return r.getSerializedHostSettings()}}g=2===h?Office.InitializationReason.DocumentOpened:Office.InitializationReason.Inserted,v=v?v.toString():"",n(new e.OfficeAppContext(s,a,c,l,f,d,p,P,g,m,v,y,_,b,O,u,S,I,E,void 0,void 0,void 0,void 0,C,A,w,N,void 0,void 0,x,!1,void 0,void 0))}else o(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 o={},r=0;r<t.length;r++)o[t[r]]=n[r];return o},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 o={};if(n){var r={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 i in n){var a=!1,s=i;r[i]&&(s=r[i].name,a=r[i].convertToHex),o[s]=a?e.OUtil.convertIntToCssHexColor(n[i]):n[i]}}return o},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 o={},r=0;r<t.length;r++)o[t[r]]=n[r];return o},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 o=function(){var n=[],o=[];t.Read(n,o);for(var r={},i=0;i<n.length;i++)r[n[i]]=o[i];e&&e(0,r)};t.RefreshAsync?t.RefreshAsync((function(){o()})):o()},e.prototype.write=function(e,t){var n=[],o=[];for(var r in e)n.push(r),o.push(e[r]);var i,a=this._osfClientContext;void 0!==(i="undefined"!=typeof OsfOMToken&&OsfOMToken?a.GetSettings(OsfOMToken):a.GetSettings()).WriteAsync?i.WriteAsync(n,o,t):(i.Write(n,o),t(0))},e}();e.RichClientSettingsManager=t}(OSF||(OSF={})),function(e){var t=function(t){function n(n){var o=t.call(this)||this;return o._clientHostController=n,o._asyncMethodExecutorHelper=e.BootStrapExtension.createAsyncMethodExecutorHelper(o),o}return __extends(n,t),n.prototype.executeAsync=function(t,n,o,r){var i=this;try{var a=new Array;this._clientHostController.execute(t,n.toSafeArrayHost(),(function(s,c){var u=e.Utility.fromSafeArray(s);return i._asyncMethodExecutorHelper.handleSafeArrayHostResponse(u,c,a,o,n,t,r)}))}catch(e){this.onException(e,t,o)}},n.prototype.registerEventAsync=function(t,n,o,r,i,a,s){var c=this;try{this._clientHostController.registerEvent(t,n,o,(function(t,n){var o=e.Utility.fromSafeArray(n),a=i.fromSafeArrayHost(o);r(a)}),(function(n){var o,r=e.Utility.fromSafeArray(n);return"number"==typeof r?([],o=r):o=r[0],c.invokeCallback(t,a,o,null,s),!0}))}catch(e){this.onException(e,t,a)}},n.prototype.unregisterEventAsync=function(t,n,o,r,i){var a=this;try{this._clientHostController.unregisterEvent(t,n,o,(function(n,o){var s,c=e.Utility.fromSafeArray(n);return"number"==typeof c?([],s=c):s=c[0],a.invokeCallback(t,r,s,null,i),!0}))}catch(e){this.onException(e,t,r)}},n.prototype.onException=function(t,n,o){var r,i=t.number;if(i)switch(i){case-2146828218:r=7e3;break;case-2147467259:r=n==e.EventDispId.dispidDialogMessageReceivedEvent?12007:5001;break;case-2146828283:case-2147209089:r=5010;break;case-2147208704:r=5100;break;case-2146827850:default:r=5001}o&&this.invokeCallback(n,o,r||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,o=0;o<n;o++){var r=this._internalStorage.key(o);0===r.indexOf(e)&&t.push(r)}}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),o=JSON.stringify(n);t.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(),o)}},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(o,r){var i=OSF.Utility.asyncResultFromErrorCode(o);i.status===e.AsyncResultStatus.Succeeded&&(n._settings=OSF.OUtil.deserializeSettings(r),i.value=n),t&&t(i)}))},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={}));var OSFWebkit,OSF,OTel,Microsoft,Office,__awaiter=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){e.done?r(e.value):new n((function(t){t(e.value)})).then(a,s)}c((o=o.apply(e,t||[])).next())}))},__generator=this&&this.__generator||function(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};!function(e){var t=function(){function t(){}return t.isSovereignVersion=function(){return"undefined"!=typeof isOsfSovereignVersion&&!0===isOsfSovereignVersion},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();if(t){var n="/lib/",o=(t=t.toLowerCase()).indexOf(n);if(o>-1)return t.toLowerCase().substring(0,o+n.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,o,r,i,a,s;return __generator(this,(function(c){switch(c.label){case 0:if(!(t=this.getConfigPath()))return[3,2];if(n=e.OUtil.getLocalStorage(),o=t+"_cache",r=n.getItem(o),i=null,r){try{i=JSON.parse(r)}catch(e){}if(864e5,a=(new Date).getTime(),i&&i.config&&i.createTime<=a&&i.createTime+864e5>=a)return[2,i.config]}return[4,this.downloadConfig(t)];case 1:return(s=c.sent())?(i={createTime:(new Date).getTime(),config:s},n.setItem(o,JSON.stringify(i))):i&&(s=i.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,r=1;if(("object"==typeof e||"unknown"==typeof e)&&null!=e&&e.toArray)if(e.dimensions&&(r=e.dimensions()),2===r)t=o(e);else{var i=e.toArray();t=new Array(i.length);for(var a=0;a<i.length;a++)t[a]=n(i[a])}return t}function o(e){var t;try{var n=e.ubound(1),o=e.ubound(2);if(e=e.toArray(),1==n&&1==o)t=[e];else{t=[];for(var r=0;r<n;r++){for(var i=[],a=0;a<o;a++){var s=e[r*o+a];"{66e7831f-81b2-42e2-823c-89e872d541b3}"!=s&&i.push(s)}i.length>0&&t.push(i)}}}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,o){e((function(e){0===e?t():o()})),setTimeout((function(){o()}),n)}))},e.compareVersions=function(e,t){var n,o=e.split("."),r=t.split(".");for(n in o){if(parseInt(o[n])<parseInt(r[n]))return!1;if(parseInt(o[n])>parseInt(r[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 o=e.toArray();t=new Array(o.length);for(var r=0;r<o.length;r++)t[r]=n(o[r])}return t},e.twoDVBArrayToJaggedArray=o,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 o=t.call(this)||this;return o._clientHostController=n,o._asyncMethodExecutorHelper=e.BootStrapExtension.createAsyncMethodExecutorHelper(o),o}return __extends(n,t),n.prototype.executeAsync=function(e,t,n,o){var r=this;this._clientHostController.execute(e,t.toWebHost(),(function(i,a){return n&&r._asyncMethodExecutorHelper.handleWebHostResponse(a,i,n,t,e,o),!0}))},n.prototype.registerEventAsync=function(e,t,n,o,r,i,a){var s=this;this._clientHostController.registerEvent(e,t,n,(function(e){var t=e,n=r.fromWebHost(t);o(n)}),(function(t,n){return i&&s.invokeCallback(e,i,t,null,a),!0}))},n.prototype.unregisterEventAsync=function(e,t,n,o,r){var i=this;this._clientHostController.unregisterEvent(e,t,n,(function(t,n){return o&&i.invokeCallback(e,o,t,null,r),!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 o="webauth/",r="webauth.browserauth.debug.js",i="webauth.browserauth.js",a=!1;t.load=function(){return t.config&&t.config.authFlow===n.AuthCode?(t.loadAttempts++,(a=t.config&&(!0===t.config.useMsal3||!1!==t.config.useMsal3&&e.OUtil.checkFlight(e.FlightTreatmentNames.EnableMsal3SsoApi)))&&(r="webauth.browserauth.msal3.debug.js",i="webauth.browserauth.msal3.js"),new Promise((function(n,s){var c=function(t,n,o){return new Promise((function(r,i){t?e.OUtil.loadScript(t,(function(e){if("boolean"!=typeof e||e)if(e instanceof Event&&e)i(new Event("loadScript: "+e.type+" '"+t+"'"));else if(o&&!n())var a=0,s=setInterval((function(){a+=500,!(n()||a>o)||(clearInterval(s),n())||i(new Event("Missing expected object after loaded."))}),500);else r(null);else i(new Event("loadScript: failed to load '"+t+"'"))}),e.LoadScriptHelper.getTrustedTypesPolicy(),o):r(null)}))},u=[c(t.config&&t.config.authVersion?e.LoadScriptHelper.getHostBundleJsBasePath()+o+t.config.authVersion+"/"+(t.config&&t.config.debugging?r:i):e.LoadScriptHelper.getHostBundleJsBasePath()+o+(t.config&&t.config.debugging?r:i),(function(){return!!BrowserAuth}),t.config.delayWebAuth)];a||u.push(c(t.config.msal,(function(){return!!msal}),t.config.delayMsal)),Promise.all(u).then((function(){t.config?BrowserAuth.Load(t.config,e._OfficeAppFactory.getHostInfo().osfControlAppCorrelationId).then((function(e){n(e)}),(function(e){s(e)})):s(new Event("config is empty."))}),(function(e){s(e)}))}))):new Promise((function(e,t){return t(new Event("'authcode' as authFlow is only supported"))}))},t.getToken=function(e,o,r,i,s,c){return t.config&&t.config.authFlow===n.AuthCode?a?BrowserAuth.GetToken({resource:e,scopes:o,applicationId:r,correlationId:i,popup:!!s,claims:c}):BrowserAuth.GetToken(e,r,i,!!s,!!s,!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 o=this,r=this._webClientHostControllerHelper.getHostCallArgs(e,t),i=this._webClientHostControllerHelper.getTargetMethodName(e);this._webAppState.clientEndPoint.invoke(i,(function(t,r){var i=0;if(0==t)o._delegateVersion=r.Version,i=o._webClientHostControllerHelper.parseErrorFromPayload(e,r);else switch(t){case-5:i=7e3;break;default:i=5001}n&&n(i,r)}),r)},t.prototype.registerEvent=function(e,t,n,o,r){this._webAppState.clientEndPoint.registerForEvent(this.getXdmEventName(n,t),(function(e){o&&o(e)}),this._getOnAfterRegisterEvent(!0,e,r),{controlId:this._webAppState.id,eventDispId:e,targetId:n,__timeout__:-1})},t.prototype.unregisterEvent=function(e,t,n,o){this._webAppState.clientEndPoint.unregisterForEvent(this.getXdmEventName(n,t),this._getOnAfterRegisterEvent(!1,e,o),{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,o,r,i){throw e.Utility.createNotImplementedException()},t.prototype.closeDialog=function(t,n,o,r){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,o){var r=(new Date).getTime();return function(i,a){var s;if(0!=i)switch(i){case-5:s=7e3;break;default:s=5001}else s=a?a.Error?a.Error:0:5001;o&&o(s),e.AppTelemetry&&e.AppTelemetry.onRegisterDone(t,n,Math.abs((new Date).getTime()-r),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={},o=0;o<e.value.length;o++){var r=e.value[o];Array.isArray(r)?n[r[0]]=r[1]:n[r.Name]=r.Value}t(0,n)}else{var i=e.error.code;t(i,{})}}))},t.prototype.write=function(t,n){var o=e._OfficeAppFactory.getAsyncMethodExecutor(),r=[];for(var i in t){var a=[];a.push(i),a.push(t[i]),r.push(a)}var s={toSafeArrayHost:function(){return null},fromSafeArrayHost:function(e){return null},toWebHost:function(){return{DdaSettingsMethod:{OverwriteIfStale:!0,Properties:r}}},fromWebHost:function(e){return null}};o.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,o,r){var i=t.call(this,e,n,o,r)||this;return i._serializedSettings={},i._serializedHostSettings={},i._appContext={},i._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'])",i}return __extends(n,t),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,o=e.OUtil.getSessionStorage();if(o){if(t||(t=e.OUtil.parseHostInfoFromWindowName(!0,e._OfficeAppFactory.getWindowName())),t&&t.indexOf("isDialog")>-1){var r=(n=e.OUtil.parseXdmInfo(!0))?n.split("|")[1]:null;return null!=r&&o.setItem(r+"IsDialog","true"),void(this._hostInfo.isDialog=!0)}this._hostInfo.isDialog=null!=o.getItem(e.OUtil.getXdmFieldValue("AppId",!1)+"IsDialog")}},n.prototype.checkReceiverOriginAndRun=function(t){return __awaiter(this,void 0,void 0,(function(){var n,o,r,i,a,s,c,u,l,f;return __generator(this,(function(d){switch(d.label){case 0:return 3===(n=this)._webAppState.clientEndPoint.hostTrustCheckStatus?(t(),[2]):(o=e.OUtil.parseUrl(n._webAppState.clientEndPoint.targetUrl,!1),r="https:"==o.protocol,i=o.hostname,a="NotHttps",0!==n._webAppState.clientEndPoint.hostTrustCheckStatus?[3,4]:(r||(n._webAppState.clientEndPoint.hostTrustCheckStatus=2),2==n._webAppState.clientEndPoint.hostTrustCheckStatus?[3,4]:(s=!1,(c=e.SovereignHelper.isSovereignVersion())&&!0!==e.OUtil.getCustomOfficeInitializationSettings().trustAllCloudEnvironments||(s=e.XdmCommunicationManager.isHostNameValidWacDomain(i),n.isHostOriginTrusted&&(s=s||n.isHostOriginTrusted(i))),s||!c?[3,3]:(n._sovereignHelper||(n._sovereignHelper=new e.SovereignHelper),[4,(u=n._sovereignHelper).isConfigAvailable()]))));case 1:return d.sent()?[4,u.isSovereignHostTrusted(i)]:[2];case 2:s=d.sent(),d.label=3;case 3:s&&(n._webAppState.clientEndPoint.hostTrustCheckStatus=3),d.label=4;case 4: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(e.LoadScriptHelper.isSdx())throw new Error("Not supported host");l=function(){var o=e.LoadScriptHelper.getHostBundleJsBasePath().match(/^https?:\/\/[^:/?#]*(?::([0-9]+))?/);if(o&&o[0]){var s=e.LoadScriptHelper.getHostBundleJsBasePath()+"AgaveErrorUX/index.html#",c={error:"NotTrustedWAC",locale:e.getSupportedLocale(n._hostInfo.hostLocale,e.ConstantNames.DefaultLocale),hostname:i,noHttps:!r,validate:!1},u=document.createElement("iframe");u.style.visibility="hidden",u.style.height="0",u.style.width="0";var l=function(r){if(r.source==u.contentWindow&&r.origin==o[0])try{!0===JSON.parse(r.data).hostUserTrusted?(n._webAppState.clientEndPoint.hostTrustCheckStatus=3,e.OUtil.removeEventListener(window,"message",l),document.body.removeChild(u)):(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",l),c.validate=!0,u.setAttribute("src",s+encodeURIComponent(JSON.stringify(c))),u.onload=function(){var e={hostname:i,noHttps:!r};u.contentWindow.postMessage(JSON.stringify(e),o[0])},document.body.appendChild(u)}else e.OUtil.ensureOfficeStringsJs().then((function(){document.body.textContent=Strings.OfficeOM.L_NotTrustedWAC}));if(e.OUtil.checkFlight(2)&&!r)throw new Error(a)},document.body?l():(f=!1,document.addEventListener("DOMContentLoaded",(function(){f||(f=!0,l())})))}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 o=e.OUtil.getInfoItems(n);null!=o&&o.length>=3&&(t._webAppState.conversationID=o[0],t._webAppState.id=o[1],t._webAppState.webAppUrl=o[2].indexOf(":")>=0?o[2]:decodeURIComponent(o[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 r=t._webAppState.conversationID+e.Constants.NotificationConversationIdSuffix;t._webAppState.serviceEndPoint.registerConversation(r,t._webAppState.webAppUrl);t._webAppState.serviceEndPoint.registerMethod("Office_notifyAgave",(function(n){var o;switch(o="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 r=document.querySelectorAll(t._tabbableElements);e.OUtil.focusToFirstTabbable(r,!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();r=document.querySelectorAll(t._tabbableElements);e.OUtil.focusToFirstTabbable(r,!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 i=n[1];Office.context.messaging.onMessage(i)}break;case e.AgaveHostAction.TaskPaneHeaderButtonClicked:Office.context.ui.taskPaneAction.onHeaderButtonClick&&Office.context.ui.taskPaneAction.onHeaderButtonClick();break;default:e.Utility.trace("actionId "+o+" 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,o){var r=this,i=this,a=function(t,a){if(OSFPerformance.getAppContextXdmEnd=OSFPerformance.now(),a._appName===e.AppName.ExcelWebApp){for(var s=0,c=a._settings;s<c.length;s++){var u=c[s],l=u[0],f=u[1];r._serializedSettings[l]=f}for(var d=0,p=a._hostSettings;d<p.length;d++){var h=p[d];l=h[0],f=h[1];r._serializedHostSettings[l]=f}}else r._serializedSettings=a._settings||{},r._serializedHostSettings=a._hostSettings||{};if(!i._hostInfo.isDialog||null==window.opener){var g=window.location.href;i._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[i._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){i._appContext=a;var m=a._appInstanceId?a._appInstanceId:a._id,v=0;null!=a._appMinorVersion&&(v=a._appMinorVersion);var y=void 0;null!=a._requirementMatrix&&(y=a._requirementMatrix),a.eToken=a.eToken?a.eToken:"";var _=new e.OfficeAppContext(a._id,a._appName,a._appVersion,a._appUILocale,a._dataLocale,a._docUrl,a._clientMode,(function(){return r._serializedSettings}),a._reason,a._osfControlType,a._eToken,a._correlationId,m,!1,!0,v,y,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 r._serializedHostSettings}),!0,a._nestedAppAuthBridgeType,a._partitionKey);_.set_taskpaneUrl(a._taskpaneUrl),n(_)}else{var b="Function ContextActivationManager_getAppContextAsync call failed. ErrorCode is "+t+", exception: "+a;e.AppTelemetry&&e.AppTelemetry.logAppException(b),o(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+"]"),o(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,o=function(){n._webAppState.focused||(n._webAppState.focused=!0),n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.Select])},r=function(){e&&(n._webAppState.focused&&(n._webAppState.focused=!1),n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,e.AgaveHostAction.UnSelect]))},i=function(t){if(t.preventDefault=t.preventDefault||function(){t.returnValue=!1},117==t.keyCode&&(t.ctrlKey||t.metaKey)){t.preventDefault();var o=e.AgaveHostAction.CtrlF6Exit;t.shiftKey&&(o=e.AgaveHostAction.CtrlF6ExitShift),n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,o])}else if(9==t.keyCode){t.preventDefault();var r=document.querySelectorAll(n._tabbableElements);e.OUtil.focusToNextTabbable(r,t.target||t.srcElement,t.shiftKey)||(n._hostInfo.isDialog?e.OUtil.focusToFirstTabbable(r,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 i={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,i])}},a=function(e){117==e.keyCode&&e.ctrlKey&&(e.preventDefault?e.preventDefault():e.returnValue=!1)};e.Utility._DebugXdm||(t?(e.OUtil.addEventListener(window,"focus",o),e.OUtil.addEventListener(window,"blur",r),e.OUtil.addEventListener(window,"keydown",i),e.OUtil.addEventListener(window,"keypress",a)):(e.OUtil.removeEventListener(window,"focus",o),e.OUtil.removeEventListener(window,"blur",r),e.OUtil.removeEventListener(window,"keydown",i),e.OUtil.removeEventListener(window,"keypress",a)))},n.prototype.getTabbableElements=function(){return this._tabbableElements},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 o={},r=[],i=[];for(var a in t)r.push(a),i.push(t[a]);o.keys=r,o.values=i;this._scriptMessager.invokeMethod(e.Webkit.MessageHandlerName,e.Webkit.MethodId.WriteSettings,o,(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,o){var r={id:t,apiArgs:n};this.hostScriptProxy.invokeMethod(e.Webkit.MessageHandlerName,e.Webkit.MethodId.Execute,r,(function(t){if(o){var n=[];if(e.OUtil.isArray(t))for(var r=0;r<t.length;r++){var i=t[r];e.OUtil.isArray(i)&&(i=new e.WebkitSafeArray(i)),n.unshift(i)}return o.apply(null,n)}}))},t.prototype.registerEvent=function(t,n,o,r,i){this.hostScriptProxy.registerEvent(e.Webkit.MessageHandlerName,e.Webkit.MethodId.RegisterEvent,t,o,(function(t){var n=t,o=0;e.OUtil.isArray(t)&&t.length>=2&&(n=t[0],o=t[1]),r&&r(o,new e.WebkitSafeArray(n))}),(function(t){if(i)return i(new e.WebkitSafeArray(t))}))},t.prototype.unregisterEvent=function(t,n,o,r){this.hostScriptProxy.unregisterEvent(e.Webkit.MessageHandlerName,e.Webkit.MethodId.UnregisterEvent,t,o,(function(t){return r(new e.WebkitSafeArray(t))}))},t.prototype.messageParent=function(t){var n,o;if(this.osfSupportsDialogOrigin&&t[e.ParameterNames.TargetOrigin]?(n=this.useFullDialogAPI?JSON.stringify(t):t[e.ParameterNames.MessageToParent],o=e.Webkit.MethodId.MessageParent2):(n=t[e.ParameterNames.MessageToParent],o=e.Webkit.MethodId.MessageParent),this.useFullDialogAPI)this.hostScriptProxy.invokeMethod(e.Webkit.MessageHandlerName,o,n,null);else{var r={dialogMessage:{messageType:0,messageContent:n}},i=o==e.Webkit.MethodId.MessageParent2?t[e.ParameterNames.TargetOrigin]:window.location.origin;window.opener.postMessage(JSON.stringify(r),i)}},t.prototype.openDialog=function(n,o,r,i,a){if(this.useFullDialogAPI)this.registerEvent(n,o,r,i,a);else if(!t.popup||t.popup.closed){t.OpenDialogCallback=void 0;var s=JSON.parse(r),c=s.url;if(c){var u=c.split("#"),l="?";u[0].indexOf("?")>-1&&(l="&");var f="width="+screen.width*s.width/100+", height="+screen.height*s.height/100;u[0]=u[0].concat(l).concat("action=displayDialog");var d=u.join("#");t.popup=window.open(d,"",f),t.DialogEventListener=function(t){if(t.origin==window.location.origin)try{var o=JSON.parse(t.data);o.dialogMessage&&i(n,[0,o.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){i(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,i(n,[12006]))}catch(t){e.Utility.trace("Error happened when popup window closed.")}}},t.prototype.closeDialog=function(e,n,o,r){this.useFullDialogAPI?this.unregisterEvent(e,n,o,r):t.popup?(t.interval&&window.clearInterval(t.interval),t.popup.close(),t.popup=null,window.removeEventListener("message",t.DialogEventListener),t.NotifyError=null,r(0)):r(5001)},t.prototype.sendMessage=function(t){var n,o;this.osfSupportsDialogOrigin&&t[e.ParameterNames.TargetOrigin]?(n=JSON.stringify(t),o=e.Webkit.MethodId.SendMessage2):(n=t[e.ParameterNames.MessageContent],o=e.Webkit.MethodId.SendMessage,!isNaN(parseFloat(n))&&isFinite(n)&&(n=n.toString())),this.hostScriptProxy.invokeMethod(e.Webkit.MessageHandlerName,o,n,null)},t.prototype.closeSdxDialog=function(t){var n=[t],o=e.Webkit.MethodId.CloseSdxDialog;this.hostScriptProxy.invokeMethod(e.Webkit.MessageHandlerName,o,n,null)},t.prototype.resizeSdxDialog=function(t,n){var o=[t,n],r=e.Webkit.MethodId.ResizeSdxDialog;this.hostScriptProxy.invokeMethod(e.Webkit.MessageHandlerName,r,o,null)},t}();t.WebkitHostController=n}(e.Webkit||(e.Webkit={}))}(OSF||(OSF={})),function(e){var t=function(t){function n(e,n,o,r){var i=t.call(this,e,n,o,r)||this;return i._serializedSettings={},i._serializedHostSettings={},i.initializeWebkitMessaging(),i}return __extends(n,t),n.prototype.initializeWebkitMessaging=function(){e.ScriptMessaging=OSFWebkit.ScriptMessaging},n.prototype.getAppContext=function(t,n,o){var r,i=this;r=this._hostInfo.isDialog&&window.webkit.messageHandlers[e.Webkit.PopupMessageHandlerName]?e.Webkit.PopupMessageHandlerName:e.Webkit.MessageHandlerName,e.ScriptMessaging.GetScriptMessenger().invokeMethod(r,e.Webkit.MethodId.GetContext,[],(function(t){var o,r=e.Webkit.AppContextProperties,a=t[r.AppType],s=t[r.Settings];if(s&&2===s.length)for(var c=s[0],u=s[1],l=0;l<c.length;l++)i._serializedSettings[c[l]]=u[l];var f=t[r.HostSettings];if(f&&2===f.length)for(c=f[0],u=f[1],l=0;l<c.length;l++)i._serializedHostSettings[c[l]]=u[l];var d=t[r.SolutionReferenceId],p=t[r.MajorVersion],h=t[r.MinorVersion],g=t[r.AppCapabilities],m=t[r.APPUILocale],v=t[r.AppDataLocale],y=t[r.DocumentUrl],_=t[r.ActivationMode],b=t[r.ControlIntegrationLevel],O=t[r.SolutionToken];O=O?O.toString():"";var S,I=t[r.CorrelationId],E=t[r.InstanceId],C=t[r.TouchEnabled],A=t[r.CommerceAllowed],P=t[r.RequirementMatrix],w=t[r.HostCustomMessage],x=t[r.HostFullVersion],F=t[r.InitialDisplayMode],R=t[r.FeatureGates];if(R)try{S=JSON.parse(R)}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Exception trying to parse FeatureGates."+t)}var N=null;if(t[r.OfficeThemeInfo])try{N=JSON.parse(t[r.OfficeThemeInfo])}catch(t){e.AppTelemetry&&e.AppTelemetry.logAppException("Exception while parsing officeThemeInfo. Details: "+t)}var M={};if(N){var T={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 j in N){var H=!1,k=j;T[j]&&(k=T[j].name,H=T[j].convertToHex),M[k]=H?e.OUtil.convertIntToCssHexColor(N[j]):N[j]}}o=new e.OfficeAppContext(d,a,p,m,v,y,g,(function(){return i._serializedSettings}),_,b,O,I,E,C,A,h,P,w,x,void 0,void 0,void 0,void 0,void 0,S,M,F,void 0,void 0,(function(){return i._serializedHostSettings}),!1,void 0,void 0),n(o)}))},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 o=this.data[n];this.isSafeArray(o)?e.push(new t(o)):e.push(o)}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 o=t[0],r=o[0];if(o.length!=r+1)return!1;for(var i=1,a=1;a<o.length;a++){var s=o[a];if(0==isFinite(s))return!1;i*=s}n=++i==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=o.IsSupportedByHost()?new o:new r("OSF.ScriptMessaging.agaveHostCallback","OSF.ScriptMessaging.agaveHostEventCallback")),t};var n=function(e,t,n){this.id=e,this.targetId=t,this.handler=n},o=function(){function e(){this.eventHandlers=[]}return e.IsSupportedByHost=function(){return!!window._osfHostAPI},e.prototype.invokeMethod=function(e,t,n,o){window._osfHostAPI(e,this.constructMessagingArgs(t,n),(function(e){var t=o(e);return void 0===t||!0===t}))},e.prototype.registerEvent=function(e,t,n,o,r,i){var a={id:n,targetId:o},s=window._osfHostRegisterEvent(e,this.constructMessagingArgs(t,a),(function(e){return r(e),!1}),(function(e){return i(e),!0}));this.eventHandlers.push({targetId:o,dispId:n,callbackId:s.eventCallbackId})},e.prototype.unregisterEvent=function(e,t,n,o,r){var i={id:n,targetId:o};window._osfHostAPI(e,this.constructMessagingArgs(t,i),(function(e){return r(e),!0}));for(var a=this.eventHandlers.length-1;a>=0;a--){var s=this.eventHandlers[a];s.dispId===n&&s.targetId===o&&(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}(),r=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,o){this.postWebkitMessage({},e,t,n,o)},e.prototype.registerEvent=function(e,t,o,r,i,a){var s={eventCallbackFunction:this.eventCallbackFunctionName},c={id:o,targetId:r},u=this.postWebkitMessage(s,e,t,c,a);this.eventHandlerList[u]=new n(o,r,i)},e.prototype.unregisterEvent=function(e,t,n,o,r){var i={id:n,targetId:o};for(var a in this.eventHandlerList)if(this.eventHandlerList.hasOwnProperty(a)){var s=this.eventHandlerList[a];s.id==n&&s.targetId==o&&delete this.eventHandlerList[a]}this.invokeMethod(e,t,i,r)},e.prototype.agaveHostCallback=function(e,t){var n=this.callbackList[e];if(n){var o=n(t);void 0!==o&&!0!==o||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,o,r,i){t.methodId=o,t.params=r;var a="";i&&(a=this.generateCorrelationId(),this.callbackList[a]=i,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 o={},r=[],i=[];for(var a in t)r.push(a),i.push(t[a]);o.keys=r,o.values=i;this._scriptMessager.invokeMethod(e.WebView.MessageHandlerName,e.WebView.MethodId.WriteSettings,o,(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,o){var r=n;null==r&&(r=[]);var i={id:t,apiArgs:r};this.hostScriptProxy.invokeMethod(e.WebView.MessageHandlerName,e.WebView.MethodId.Execute,i,(function(t){var n=t;if(e.OUtil.isArray(t)&&t.length>=2){t[0];n=t[1]}if(o)return o(new e.WebkitSafeArray(n))}))},t.prototype.registerEvent=function(t,n,o,r,i){this.hostScriptProxy.registerEvent(e.WebView.MessageHandlerName,e.WebView.MethodId.RegisterEvent,t,o,(function(t){var n=t,o=0;e.OUtil.isArray(t)&&t.length>=2&&(o=t[0],n=t[1]),r&&r(o,new e.WebkitSafeArray(n))}),(function(t){if(i)return i(new e.WebkitSafeArray(t))}))},t.prototype.unregisterEvent=function(t,n,o,r){this.hostScriptProxy.unregisterEvent(e.WebView.MessageHandlerName,e.WebView.MethodId.UnregisterEvent,t,o,(function(t){return r(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,o,r,i,a){var s=JSON.parse(r),c=s.url;if(c){var u=c.split("#"),l="?";c.indexOf("?")>-1&&(l="&");var f="width="+screen.width*s.width/100+", height="+screen.height*s.height/100;u[0]=u[0].concat(l).concat("action=displayDialog");var d,p=u.join("#");t.popup=window.open(p,"",f),window.addEventListener("message",(function(o){if(o.source==t.popup)try{var r=JSON.parse(o.data);r.dialogMessage&&i(n,[0,r.dialogMessage.messageContent])}catch(t){e.Utility.trace("messages received cannot be handled. Message:"+o.data)}})),d=window.setInterval((function(){try{(null==t.popup||t.popup.closed)&&(window.clearInterval(d),i(n,[12006]))}catch(t){e.Utility.trace("Error happened when popup window closed.")}}),1e3),a(0)}},t.prototype.closeDialog=function(e,n,o,r){t.popup?(t.popup.close(),t.popup=null,r(0)):r(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,o,r){var i=t.call(this,e,n,o,r)||this;return i._serializedSettings={},i.initializeWebViewMessaging(),i}return __extends(n,t),n.prototype.initializeWebViewMessaging=function(){e.ScriptMessaging=e.WebView.ScriptMessaging},n.prototype.getAppContext=function(t,n,o){var r,i=this;r=this._hostInfo.isDialog?e.WebView.PopupMessageHandlerName:e.WebView.MessageHandlerName,e.ScriptMessaging.GetScriptMessenger().invokeMethod(r,e.WebView.MethodId.GetContext,[],(function(t){var o,r=e.Webkit.AppContextProperties,a=t[r.AppType],s=t[r.Settings];if(s&&2===s.length)for(var c=s[0],u=s[1],l=0;l<c.length;l++)i._serializedSettings[c[l]]=u[l];var f=t[r.SolutionReferenceId],d=t[r.MajorVersion],p=t[r.MinorVersion],h=t[r.AppCapabilities],g=t[r.APPUILocale],m=t[r.AppDataLocale],v=t[r.DocumentUrl],y=t[r.ActivationMode],_=t[r.ControlIntegrationLevel],b=t[r.SolutionToken];b=b?b.toString():"";var O=t[r.CorrelationId],S=t[r.InstanceId],I=t[r.TouchEnabled],E=t[r.CommerceAllowed],C=t[r.RequirementMatrix],A=t[r.HostCustomMessage],P=t[r.HostFullVersion],w=t[r.InitialDisplayMode];o=new e.OfficeAppContext(f,a,d,g,m,v,h,(function(){return i._serializedSettings}),y,_,b,O,S,I,E,p,C,A,P,void 0,void 0,void 0,void 0,void 0,void 0,void 0,w,void 0,void 0,void 0,!1,void 0,void 0),n(o)}))},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 o=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=o}(e.Android||(e.Android={})),function(n){var o=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 o;try{o=JSON.parse(n.data)}catch(e){return}switch(o.callbackType){case t.CallbackType.MethodCallback:e.WebView.ScriptMessaging.agaveHostCallback(o.callbackId,JSON.parse(o.params));break;case t.CallbackType.EventCallback:e.WebView.ScriptMessaging.agaveHostEventCallback(o.callbackId,JSON.parse(o.params))}}},n}();n.Poster=o}(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 r("OSF.ScriptMessaging.agaveHostCallback","OSF.ScriptMessaging.agaveHostEventCallback",e.Android.Poster.getInstance());else{if(t!==e.HostInfoPlatform.winrt)throw e.Utility.createNotImplementedException();n=new r("agaveHostCallback","agaveHostEventCallback",new e.WinRT.Poster)}}return n};var o=function(e,t,n){this.id=e,this.targetId=t,this.handler=n},r=function(){function e(t,n,o){this.callingIndex=0,this.callbackList={},this.eventHandlerList={},this.asyncMethodCallbackFunctionName=t,this.eventCallbackFunctionName=n,this.poster=o,this.conversationId=e.getCurrentTimeMS().toString()}return e.prototype.invokeMethod=function(e,t,n,o){this.postMessage({},e,t,n,o)},e.prototype.registerEvent=function(e,t,n,r,i,a){var s={eventCallbackFunction:this.eventCallbackFunctionName},c={id:n,targetId:r},u=this.postMessage(s,e,t,c,a);this.eventHandlerList[u]=new o(n,r,i)},e.prototype.unregisterEvent=function(e,t,n,o,r){var i={id:n,targetId:o};for(var a in this.eventHandlerList)if(this.eventHandlerList.hasOwnProperty(a)){var s=this.eventHandlerList[a];s.id==n&&s.targetId==o&&delete this.eventHandlerList[a]}this.invokeMethod(e,t,i,r)},e.prototype.agaveHostCallback=function(e,t){var n=this.callbackList[e];if(n){var o=n(t);void 0!==o&&!0!==o||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,o,r){var i=this.generateCorrelationId();return this.callbackList[i]=r,e.methodId=n,e.params=o,e.callbackId=i,e.callbackFunction=this.asyncMethodCallbackFunctionName,this.poster.postMessage(t,JSON.stringify(e)),i},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,o,r){this.registerEvent(e,t,n,o,r)},n.prototype.closeDialog=function(e,t,n,o){this.unregisterEvent(e,t,n,o)},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,o,r,i,a){if(!n.popup||n.popup.closed){window.dialogAPIErrorCode=void 0;var s=JSON.parse(r),c=s.url;if(c){var u=c.split("#"),l="?";u[0].indexOf("?")>-1&&(l="&");var f="width="+screen.width*s.width/100+", height="+screen.height*s.height/100;u[0]=u[0].concat(l).concat("action=displayDialog");var d=u.join("#");if(n.popup=window.open(d,"",f),n.DialogEventListener=function(o){if(o.source==n.popup)try{var r=JSON.parse(o.data);r.dialogMessage&&i(t,[0,r.dialogMessage.messageContent])}catch(t){e.Utility.trace("messages received cannot be handlered. Message:"+o.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,i(t,[12006]))}catch(t){e.Utility.trace("Error happened when popup window closed.")}}),500),n.NotifyError=function(e){i(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,o,r){n.popup?(n.interval&&window.clearInterval(n.interval),n.popup.close(),n.popup=null,window.removeEventListener("message",n.DialogEventListener),n.NotifyError=null,r(0)):r(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)},o=0,r=function(e,n){d[o]=e,d[o+1]=n,2===(o+=2)&&(t?t(p):c())};var i=("undefined"!=typeof window?window:void 0)||{},a=(i.MutationObserver||i.WebKitMutationObserver,"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)),s="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;var c,u,l,f,d=new Array(1e3);function p(){for(var e=0;e<o;e+=2){(0,d[e])(d[e+1]),d[e]=void 0,d[e+1]=void 0}o=0}function h(){}a?(l=process.nextTick,f=process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/),Array.isArray(f)&&"0"===f[1]&&"10"===f[2]&&(l=setImmediate),c=function(){l(p)}):s?((u=new MessageChannel).port1.onmessage=p,c=function(){u.port2.postMessage(0)}):c=function(){setTimeout(p,1)};var g=void 0,m=new E;function v(t,n){if(n.constructor===t.constructor)!function(e,t){1===t._state?b(e,t._result):2===t._state?O(e,t._result):S(t,void 0,(function(t){y(e,t)}),(function(t){O(e,t)}))}(t,n);else{var o=function(e){try{return e.then}catch(e){return m.error=e,m}}(n);o===m?O(t,m.error):void 0===o?b(t,n):e(o)?function(e,t,n){r((function(e){var o=!1,r=function(e,t,n,o){try{e.call(t,n,o)}catch(e){return e}}(n,t,(function(n){o||(o=!0,t!==n?y(e,n):b(e,n))}),(function(t){o||(o=!0,O(e,t))}),e._label);!o&&r&&(o=!0,O(e,r))}),e)}(t,n,o):b(t,n)}}function y(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?v(e,t):b(e,t)}function _(e){e._onerror&&e._onerror(e._result),I(e)}function b(e,t){e._state===g&&(e._result=t,e._state=1,0!==e._subscribers.length&&r(I,e))}function O(e,t){e._state===g&&(e._state=2,e._result=t,r(_,e))}function S(e,t,n,o){var i=e._subscribers,a=i.length;e._onerror=null,i[a]=t,i[a+1]=n,i[a+2]=o,0===a&&e._state&&r(I,e)}function I(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var o,r,i=e._result,a=0;a<t.length;a+=3)o=t[a],r=t[a+n],o?A(n,o,r,i):r(i);e._subscribers.length=0}}function E(){this.error=null}var C=new E;function A(t,n,o,r){var i,a,s,c,u=e(o);if(u){if((i=function(e,t){try{return e(t)}catch(e){return C.error=e,C}}(o,r))===C?(c=!0,a=i.error,i=null):s=!0,n===i)return void O(n,new TypeError("A promises callback cannot return that same promise."))}else i=r,s=!0;n._state!==g||(u&&s?y(n,i):c?O(n,a):1===t?b(n,i):2===t&&O(n,i))}function P(e,t){var n=this;n._instanceConstructor=e,n.promise=new e(h),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())}P.prototype._validateInput=function(e){return n(e)},P.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},P.prototype._init=function(){this._result=new Array(this.length)};var w=P;P.prototype._enumerate=function(){for(var e=this,t=e.length,n=e.promise,o=e._input,r=0;n._state===g&&r<t;r++)e._eachEntry(o[r],r)},P.prototype._eachEntry=function(e,t){var n,o=this,r=o._instanceConstructor;"object"==typeof(n=e)&&null!==n?e.constructor===r&&e._state!==g?(e._onerror=null,o._settledAt(e._state,t,e._result)):o._willSettleAt(r.resolve(e),t):(o._remaining--,o._result[t]=e)},P.prototype._settledAt=function(e,t,n){var o=this,r=o.promise;r._state===g&&(o._remaining--,2===e?O(r,n):o._result[t]=n),0===o._remaining&&b(r,o._result)},P.prototype._willSettleAt=function(e,t){var n=this;S(e,void 0,(function(e){n._settledAt(1,t,e)}),(function(e){n._settledAt(2,t,e)}))};var x=function(e){return new w(this,e).promise};var F=function(e){var t=new this(h);if(!n(e))return O(t,new TypeError("You must pass an array to race.")),t;var o=e.length;function r(e){y(t,e)}function i(e){O(t,e)}for(var a=0;t._state===g&&a<o;a++)S(this.resolve(e[a]),void 0,r,i);return t};var R=function(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(h);return y(t,e),t};var N=function(e){var t=new this(h);return O(t,e),t},M=0;var T=j;function j(t){this._id=M++,this._state=void 0,this._result=void 0,this._subscribers=[],h!==t&&(e(t)||function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof j||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){y(e,t)}),(function(t){O(e,t)}))}catch(t){O(e,t)}}(this,t))}return j.all=x,j.race=F,j.resolve=R,j.reject=N,j._setScheduler=function(e){t=e},j._setAsap=function(e){r=e},j._asap=r,j.prototype={constructor:j,then:function(e,t){var n=this,o=n._state;if(1===o&&!e||2===o&&!t)return this;var i=new this.constructor(h),a=n._result;if(o){var s=arguments[o-1];r((function(){A(o,i,s,a)}))}else S(n,i,e,t);return i},catch:function(e){return this.then(null,e)}},T}.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){!function(t){var n,o=e.OUtil.Guid.generateNewGuid(),r=new RegExp("^https?://store\\.office(ppe|-int)?\\.com/","i"),i=!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(),o="";return n&&(o=n.getItem(t)),o},t.prototype.setValue=function(t,n){var o=e.OUtil.getLocalStorage();o&&o.setItem(t,n)},t}();function u(e){return e&&(e=e.replace(/[{}]/g,"").toLowerCase()),e||""}function l(e){try{return JSON.parse(e)}catch(t){return e}}function f(){n&&(i||OTel.OTelLogger.onTelemetryLoaded((function(){var t=[],o=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",o)]),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 d(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 h(e,t){return p()||t!==e?t:a}function g(t,n){var o=!1,r=/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/.exec(n);if(r){var i=parseInt(r[1]),a=parseInt(r[2]),s=parseInt(r[3]);t==e.HostInfoPlatform.win32?(i<16||16==i&&s<14225)&&(o=!0):t==e.HostInfoPlatform.mac&&(i<16||16==i&&(a<52||52==a&&s<808))&&(o=!0)}return o}function m(){return 0!=(e._OfficeAppFactory.getHostInfo().flags&e.HostInfoFlags.IsMos)}t.initialize=function(f){if(t.enableTelemetry&&!n){n=new s,f.get_hostFullVersion()?n.hostVersion=f.get_hostFullVersion():n.hostVersion=f.get_appVersion(),n.appId=p()?f.get_id():a,n.marketplaceType=f._marketplaceType,n.host=""+f.get_appName(),n.browser=window.navigator.userAgent,n.correlationId=u(f.get_correlationId()),n.clientId=(new c).getClientId(),n.appInstanceId=f.get_appInstanceId(),n.appInstanceId&&(n.appInstanceId=u(n.appInstanceId),n.appInstanceId=h(f.get_id(),n.appInstanceId)),n.message=f.get_hostCustomMessage(),n.officeJSVersion=e.ConstantNames.FileVersion,n.hostJSVersion="NA",f._wacHostEnvironment&&(n.wacHostEnvironment=f._wacHostEnvironment);var d=f.get_isFromWacAutomation();null!=d&&(n.isFromWacAutomation=d.toString().toLowerCase());var g=f.get_docUrl();n.docUrl=r.test(g)?g:"";var v=location.href;if(v&&(n.isPreload=-1!==v.indexOf("preload=1"),v=v.split("?")[0].split("#")[0]),n.isMos=m(),e.OUtil.isChangeGateEnabled("Microsoft.Office.SharedOnline.ChangeGate.OfficeVSO_10045620_CopilotAgentTelSettings")){var y=f.get_settingsFunc()();y&&y.LaunchSource&&y.LaunchReason&&(n.launchSource=l(y.LaunchSource),n.launchReason=l(y.LaunchReason))}!function(t,n){n.assetId="",n.userId="";try{if(!e.Utility.isNullOrEmpty(t)){var o=decodeURIComponent(t),r=new DOMParser,i=void 0;if(e.LoadScriptHelper.trustedTypesOptIn()&&window.trustedTypes&&window.trustedTypes.createPolicy)i=window.trustedTypes.createPolicy("officejs-domparser",{createHTML:function(e){return e}}).createHTML(o);else i=o;var a=r.parseFromString(i,"text/xml"),s=a.getElementsByTagName("t")[0].attributes.getNamedItem("cid"),c=a.getElementsByTagName("t")[0].attributes.getNamedItem("oid");s&&s.nodeValue?n.userId=s.nodeValue:c&&c.nodeValue&&(n.userId=c.nodeValue),n.assetId=a.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue}}catch(e){}}(f.get_eToken(),n),n.sessionId=o,OTel.OTelLogger.initialize(n),n.isPreload?i=!0:t.onAppActivated()}},t.onAppActivated=f,t.onScriptDone=function(e,t,n,o){},t.onCallDone=function(e,t,n,o,r){},t.onMethodDone=function(e,t,n,o){},t.onPropertyDone=function(t,n){e.AppTelemetry.onCallDone("property",-1,t,n,0)},t.onCheckWACHost=function(e,t,n,o,r){},t.onEventDone=function(t,n){e.AppTelemetry.onCallDone("event",t,null,0,n)},t.onRegisterDone=function(t,n,o,r){e.AppTelemetry.onCallDone(t?"registerevent":"unregisterevent",n,null,o,r)},t.onAppClosed=function(e,t){},t.setOsfControlAppCorrelationId=function(e){u(e)},t.doAppInitializationLogging=d,t.logAppCommonMessage=function(e){},t.logAppException=function(e){},t.CallOnAppActivatedIfPending=function(){i&&(i=!1,f())},t.canSendAddinId=p,t.getCompliantAppInstanceId=h,t._isComplianceExceptedHost=g,t.isMos=m}(e.AppTelemetry||(e.AppTelemetry={}))}(OSF||(OSF={})),function(e){var t=function(){function t(){}return t.loaded=function(){return!(void 0===t.logger)},t.create=function(t){var n,o={id:t.appId,marketplaceType:t.marketplaceType,assetId:t.assetId,officeJsVersion:t.officeJSVersion,hostJsVersion:t.hostJSVersion,browserToken:t.clientId,instanceId:t.appInstanceId,sessionId:t.sessionId},r=oteljs.Contracts.Office.System.SDX.getFields("SDX",o);if("web"===OSF._OfficeAppFactory.getHostInfo().hostPlatform)n=new e.SdxWacSink;else{if(!Office.context.requirements.isSetSupported("Telemetry","1.2"))return console.error("Cannot create telemetry sink successfully"),null;n=new e.RichApiSink,this.richApiSink=n}var i=new oteljs.SimpleTelemetryLogger(void 0,r);return i.addSink(n),i.setTenantToken("Office.Extensibility.OfficeJs","db334b301e7b474db5e0f02f07c51a47-a1b5bc36-1bbe-482f-a64a-c2d9cb606706-7439",1755),oteljs.onNotification().addListener((function(e){OSF.Utility.debugLog(e.message())})),i},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=function(){function e(){var e=this;this._requestIsPending=!0,this._telemetryQueue=[],this.pause(1e3).then((function(){var t=e._telemetryQueue;e._telemetryQueue=[],e._requestIsPending=!1,e.processTelemetryEvents(t)}))}return e.prototype.sendTelemetryEvent=function(e){this._telemetryQueue.push([e,1]),this._requestIsPending||this.processWorkBacklog()},e.prototype.sendNonStandardEvent=function(e,t){this._telemetryQueue.push([e,t]),this._requestIsPending||this.processWorkBacklog()},e.prototype.flushTelemetryQueue=function(){var e=this;return new Office.Promise((function(t){var n=e._telemetryQueue;e._telemetryQueue=[],e.processTelemetryEvents(n).then((function(){t()}))}))},e.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)()}))},e.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(){}))},e.prototype.processTelemetryEvents=function(e){var t=this,n=new OfficeCore.RequestContext;return e.forEach((function(e){var o=e[0],r=e[1];if(o.telemetryProperties){var i=[];t.addDataFields(i,o.dataFields);var a=o.eventContract?o.eventContract.name:"";o.eventContract&&t.addDataFields(i,o.eventContract.dataFields),1===r?n.telemetry.sendTelemetryEvent(o.telemetryProperties,o.eventName,a,oteljs.getEffectiveEventFlags(o),i):n.telemetry.sendNonStandardEvent(o.telemetryProperties,o.eventName,a,oteljs.getEffectiveEventFlags(o),i,r)}})),n.sync().catch((function(){oteljs.logNotification(2,1,(function(){return"RichApi telemetry call failed."}))}))},e.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:t.dataType})}))},e.prototype.pause=function(e){return new Office.Promise((function(t){return setTimeout(t,e)}))},e}();e.RichApiSink=t}(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(),o=OSF.AgaveHostAction.SendTelemetryEvent;OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[n,o,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(),o=OSF.AgaveHostAction.SendNonStandardEvent;OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[n,o,e])}catch(e){oteljs.logError(1,"AgaveWacSink",e)}},e}();e.SdxWacSink=t}(OTel||(OTel={})),function(e){var t,n=[];function o(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 r(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 i=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=(i++).toString();return o(c,"Navigator.prototype."+e,JSON.stringify([{audio:!!n.audio,video:!!n.video}])),t.apply(this,[n,function(){return r(c,!0),a.apply(this,arguments)},function(){return r(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 u=MediaDevices.prototype.getUserMedia;u&&(MediaDevices.prototype.getUserMedia=function(e){var t=(i++).toString();return 1===arguments.length&&void 0!==e?(o(t,"MediaDevices.prototype.getUserMedia",JSON.stringify([{audio:!!e.audio,video:!!e.video}])),u.apply(this,arguments).then((function(){return r(t,!0),arguments[0]}),(function(){throw r(t,!1,arguments[0]),arguments[0]}))):u.apply(this,arguments)},n.push("MediaDevices.prototype.getUserMedia"));for(var l=function(e){var t=Geolocation.prototype[e];t&&(Geolocation.prototype[e]=function(n,a,s){for(var c=[],u=3;u<arguments.length;u++)c[u-3]=arguments[u];var l=(i++).toString(),f=!1;o(l,"Geolocation.prototype."+e,JSON.stringify([]));var d=Function.prototype.isPrototypeOf(n)?function(){return f||(r(l,!0),f=!0),n.apply(this,arguments)}:n,p=Function.prototype.isPrototypeOf(a)?function(){return f||(r(l,!1,arguments[0]),f=!0),a.apply(this,arguments)}:a;return t.apply(this,[d,p,s].concat(c))},n.push("Geolocation.prototype."+e))},f=0,d=["getCurrentPosition","watchPosition"];f<d.length;f++){l(d[f])}}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,o;return __generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,6,,7]),OSF._OfficeAppFactory.getHostInfo().hostPlatform===OSF.HostInfoPlatform.web?[3,2]:[4,e.onReady()];case 1:return r.sent(),[2,!0];case 2:return null!=(t=OSF._OfficeAppFactory.getWebAppState().clientEndPoint)&&t.fHostTrusted||null!=document.referrer&&(n=OSF.OUtil.parseUrl(document.referrer,!1),"https:"==n.protocol&&OSF.XdmCommunicationManager.isHostNameValidWacDomain(n.hostname)&&!new RegExp("^"+document.domain.replace(new RegExp("\\.","g"),"\\.")+"$").test(n.hostname))?[2,!0]:null==t?[3,4]:[4,OSF.Utility.promisify((function(e){t.invoke("ContextActivationManager_getAppContextAsync",e,OSF._OfficeAppFactory.getWebAppState().id)}),1e4)];case 3:return r.sent(),[2,!0];case 4:return[2,!1];case 5:return[3,7];case 6:return o=r.sent(),OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Exception happens at Office.isTrustedHost."+o),[2,!1];case 7:return[2]}}))}))},Microsoft.Office.WebExtension.onReadyInternal=e.onReadyInternal}(Office||(Office={}));var OfficeExtension;__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 o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();!function(e){var t;!function(e){e.graph="graph",e.wfe="wfe"}(t=e.RemoteEndpointType||(e.RemoteEndpointType={}));var n=function(){function e(){}return e.prototype._resolveRequestUrlAndHeaderInfo=function(){return l._createPromiseFromResult(null)},e.prototype._createRequestExecutorOrNull=function(){return null},e.prototype.getEventRegistration=function(e){return null},e}();e.SessionBase=n;var o=function(){function e(){}return e.setCustomSendRequestFunc=function(t){e.s_customSendRequestFunc=t},e.xhrSendRequestFunc=function(e){return l.createPromise((function(t,n){var o=new XMLHttpRequest;if(o.open(e.method,e.url),o.onload=function(){var e={statusCode:o.status,headers:l._parseHttpResponseHeaders(o.getAllResponseHeaders()),body:o.responseText};t(e)},o.onerror=function(){n(new r.RuntimeError({code:a.connectionFailure,httpStatusCode:o.status,message:l._getResourceString(s.connectionFailureWithStatus,o.statusText)}))},e.headers)for(var i in e.headers)o.setRequestHeader(i,e.headers[i]);o.send(l._getRequestBodyText(e))}))},e.fetchSendRequestFunc=function(e){var t=l._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,o={};return e.headers.forEach((function(e,t){o[t]=e})),{statusCode:n,headers:o,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=l._validateLocalDocumentRequest(e);var t=l._buildRequestMessageSafeArray(e);return l.createPromise((function(e,n){OSF.DDA.RichApi.executeRichApiRequestAsync(t,(function(t){var n;n="succeeded"==t.status?{statusCode:u.getResponseStatusCode(t),headers:u.getResponseHeaders(t),body:u.getResponseBody(t)}:u.buildHttpResponseFromOfficeJsError(t.error.code,t.error.message),l.log("Response:"),l.log(JSON.stringify(n)),e(n)}))}))},e.validateAndNormalizeRequest=function(e){if(l.isNullOrUndefined(e))throw r.RuntimeError._createInvalidArgError({argumentName:"request"});l.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=f._getCurrentTestNameWithSequenceId();n&&(e.headers||(e.headers={}),e.headers[c.testRequestNameHeader]=n)}},e.logRequest=function(t){if(l._logEnabled){if(l.log("---HTTP Request---"),l.log(t.method+" "+t.url),t.headers)for(var n in t.headers)l.log(n+": "+t.headers[n]);e._logBodyEnabled&&l.log(l._getRequestBodyText(t))}},e.logResponse=function(t){if(l._logEnabled){if(l.log("---HTTP Response---"),l.log(""+t.statusCode),t.headers)for(var n in t.headers)l.log(n+": "+t.headers[n]);e._logBodyEnabled&&l.log(t.body)}},e._logBodyEnabled=!1,e}();e.HttpUtility=o;var r,i=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 o=n.message;if(o&&o.entries)for(var r=0;r<o.entries.length;r++){var i=o.entries[r];if(Array.isArray(i)){var a={messageCategory:i[0],messageType:i[1],targetId:i[2],message:i[3],id:i[4]};o.entries[r]=a}}}t.dispatchMessage(n)}}return e.init=function(t){if("object"==typeof t&&t){var n=new e(t);e.s_instance=n,o.setCustomSendLocalDocumentRequestFunc((function(t){t=l._validateLocalDocumentRequest(t);var o=0;l.isReadonlyRestRequest(t.method)||(o=1);var r=t.url.indexOf("?");if(r>=0){var i=t.url.substr(r+1),a=l._parseRequestFlagsAndCustomDataFromQueryStringIfAny(i);a.flags>=0&&(o=a.flags)}"string"==typeof t.body&&(t.body=JSON.parse(t.body));var s={id:e.nextId(),type:1,flags:o,message:t};return n.sendMessageToHostAndExpectResponse(s).then((function(e){return e.message}))}));for(var r=0;r<e.s_onInitedHandlers.length;r++)e.s_onInitedHandlers[r](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=l.createPromise((function(n,o){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=i,"object"==typeof _richApiNativeBridge&&_richApiNativeBridge&&i.init(_richApiNativeBridge),function(e){var t=function(t){function n(e){var o=t.call(this,"string"==typeof e?e:e.message)||this;if(Object.setPrototypeOf(o,n.prototype),o.name="RichApi.Error","string"==typeof e?o.message=e:(o.code=e.code,o.message=e.message,o.traceMessages=e.traceMessages||[],o.innerError=e.innerError||null,o.debugInfo=o._createDebugInfo(e.debugInfo||{}),o.httpStatusCode=e.httpStatusCode,o.data=e.data),l.isNullOrUndefined(o.httpStatusCode)||200===o.httpStatusCode){var r={};r[a.accessDenied]=401,r[a.connectionFailure]=500,r[a.generalException]=500,r[a.invalidArgument]=400,r[a.invalidObjectPath]=400,r[a.invalidOrTimedOutSession]=408,r[a.invalidRequestContext]=400,r[a.timeout]=408,r[a.valueNotLoaded]=400,o.httpStatusCode=r[o.code]}return l.isNullOrUndefined(o.httpStatusCode)&&(o.httpStatusCode=500),o}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 o in t)n[o]=t[o];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:l.isNullOrEmptyString(t.argumentName)?l._getResourceString(s.invalidArgumentGeneric):l._getResourceString(s.invalidArgument,t.argumentName),debugInfo:t.errorLocation?{errorLocation:t.errorLocation}:{},innerError:t.innerError})},n}(Error);e.RuntimeError=t}(r=e._Internal||(e._Internal={})),e.Error=r.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}();e.CoreConstants=c;var u=function(){function e(){}return e.buildMessageArrayForIRequestExecutor=function(t,n,o,r){var i=JSON.stringify(o.Body);l.log("Request:"),l.log(i);var a={};return l._copyHeaders(o.Headers,a),a[c.sourceLibHeader]=r,e.buildRequestMessageSafeArray(t,n,"POST",c.processQuery,a,i)},e.buildResponseOnSuccess=function(e,t){var n={HttpStatusCode:200,ErrorCode:"",ErrorMessage:"",Headers:null,Body:null};return n.Body=JSON.parse(e),n.Headers=t,n},e.buildResponseOnError=function(t,n){var o={HttpStatusCode:500,ErrorCode:"",ErrorMessage:"",Headers:null,Body:null};return o.ErrorCode=a.generalException,o.ErrorMessage=n,t==e.OfficeJsErrorCode_ooeNoCapability?(o.ErrorCode=a.accessDenied,o.HttpStatusCode=401):t==e.OfficeJsErrorCode_ooeActivityLimitReached?(o.ErrorCode=a.activityLimitReached,o.HttpStatusCode=429):t==e.OfficeJsErrorCode_ooeInvalidOrTimedOutSession?(o.ErrorCode=a.invalidOrTimedOutSession,o.HttpStatusCode=408,o.ErrorMessage=l._getResourceString(s.invalidOrTimedOutSessionMessage)):t==e.OfficeJsErrorCode_ooeRequestPayloadSizeLimitExceeded?(o.ErrorCode=a.requestPayloadSizeLimitExceeded,o.HttpStatusCode=400):t==e.OfficeJsErrorCode_ooeResponsePayloadSizeLimitExceeded?(o.ErrorCode=a.responsePayloadSizeLimitExceeded,o.HttpStatusCode=400):t==e.OfficeJsErrorCode_ooeWriteNotSupportedWhenModalDialogOpen?(o.ErrorCode=a.writeNotSupportedWhenModalDialogOpen,o.HttpStatusCode=400):t==e.OfficeJsErrorCode_ooeInvalidSheetName?(o.ErrorCode=a.invalidRequestContext,o.HttpStatusCode=400,o.ErrorMessage=l._getResourceString(s.invalidSheetName)):t==e.OfficeJsErrorCode_ooeUndoNotSupported&&(o.ErrorCode=a.undoNotSupported,o.HttpStatusCode=400),o},e.buildHttpResponseFromOfficeJsError=function(t,n){var o=500,r={error:{}};return r.error.code=a.generalException,r.error.message=n,t===e.OfficeJsErrorCode_ooeNoCapability?(o=403,r.error.code=a.accessDenied):t===e.OfficeJsErrorCode_ooeActivityLimitReached&&(o=429,r.error.code=a.activityLimitReached),{statusCode:o,headers:{},body:JSON.stringify(r)}},e.buildRequestMessageSafeArray=function(e,t,n,o,r,i){var a=[];if(r)for(var s in r)a.push(s),a.push(r[s]);return[e,n,o,a,i,0,t,"","","","","",""]},e.getResponseBody=function(t){return e.getResponseBodyFromSafeArray(t.value.data)},e.getResponseHeaders=function(t){return e.getResponseHeadersFromSafeArray(t.value.data)},e.getResponseBodyFromSafeArray=function(e){var t=e[2];return"string"==typeof t?t:t.join("")},e.getResponseHeadersFromSafeArray=function(e){var t=e[1];if(!t)return null;for(var n={},o=0;o<t.length-1;o+=2)n[t[o]]=t[o+1];return n},e.getResponseStatusCode=function(t){return e.getResponseStatusCodeFromSafeArray(t.value.data)},e.getResponseStatusCodeFromSafeArray=function(e){return e[0]},e.OfficeJsErrorCode_ooeInvalidOrTimedOutSession=5012,e.OfficeJsErrorCode_ooeActivityLimitReached=5102,e.OfficeJsErrorCode_ooeNoCapability=7e3,e.OfficeJsErrorCode_ooeRequestPayloadSizeLimitExceeded=5103,e.OfficeJsErrorCode_ooeResponsePayloadSizeLimitExceeded=5104,e.OfficeJsErrorCode_ooeWriteNotSupportedWhenModalDialogOpen=5016,e.OfficeJsErrorCode_ooeInvalidSheetName=1014,e.OfficeJsErrorCode_ooeUndoNotSupported=5017,e}();e.RichApiMessageUtility=u,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")}}(r=e._Internal||(e._Internal={}));var l=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 r.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 o;if("undefined"!=typeof window&&window.Strings&&window.Strings.OfficeOM){var r="L_"+t,i=window.Strings.OfficeOM[r];i&&(o=i)}if(o||(o=e.s_resourceStringValues[t]),o||(o=t),!e.isNullOrUndefined(n))if(Array.isArray(n)){var a=n;o=e._formatString(o,a)}else o=o.replace("{0}",n);return o},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 r.RuntimeError._createInvalidArgError({argumentName:"format"})}))},Object.defineProperty(e,"Promise",{get:function(){return r.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 r.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(),o=0;o<t.length;o++){if(n===t[o])return t[o].length;if(n.substr(0,t[o].length+1)===t[o]+"/")return t[o].length+1}return 0},e._validateLocalDocumentRequest=function(t){var n=e._getLocalDocumentUrlPrefixLength(t.url);if(n<=0)throw r.RuntimeError._createInvalidArgError({argumentName:"request"});var o=t.url.substr(n),i=o.toLowerCase();return"_api"===i?o="":"_api/"===i.substr(0,"_api/".length)&&(o=o.substr("_api/".length)),{method:t.method,url:o,headers:t.headers,body:t.body}},e._parseRequestFlagsAndCustomDataFromQueryStringIfAny=function(e){for(var t={flags:-1,customData:""},n=e.split("&"),o=0;o<n.length;o++){var r=n[o].split("=");if(r[0].toLowerCase()===c.flags){var i=parseInt(r[1]);i&=65535,t.flags=i}else r[0].toLowerCase()===c.customData&&(t.customData=decodeURIComponent(r[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 o="";if(t.url.substr(0,c.processQuery.length).toLowerCase()===c.processQuery.toLowerCase()){var r=t.url.indexOf("?");if(r>0){var i=t.url.substr(r+1),a=e._parseRequestFlagsAndCustomDataFromQueryStringIfAny(i);a.flags>=0&&(n=a.flags),o=a.customData}}return u.buildRequestMessageSafeArray(o,n,t.method,t.url,t.headers,e._getRequestBodyText(t))},e._parseHttpResponseHeaders=function(t){var n={};if(!e.isNullOrEmptyString(t))for(var o=new RegExp("\r?\n"),r=t.split(o),i=0;i<r.length;i++){var a=r[i];if(null!=a){var s=a.indexOf(":");if(s>0){var c=a.substr(0,s),u=a.substr(s+1);c=e.trim(c),u=e.trim(u),n[c.toUpperCase()]=u}}}return n},e._parseErrorResponse=function(t){var n=e._parseErrorResponseBody(t),o=t.statusCode.toString();if(e.isNullOrUndefined(n)||"object"!=typeof n||!n.error)return e._createDefaultErrorResponse(o);var r=n.error,i=r.innerError;return i&&i.code?e._createErrorResponse(i.code,o,i.message):r.code?e._createErrorResponse(r.code,o,r.message):e._createDefaultErrorResponse(o)},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,o){return{errorCode:t,errorMessage:e._getResourceString(s.connectionFailureWithDetails,[n,t,o])}},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=l;var f=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=f,e._internalConfig={showDisposeInfoInDebugInfo:!1,showInternalApiInDebugInfo:!1,enableEarlyDispose:!0,alwaysPolyfillClientObjectUpdateMethod:!1,alwaysPolyfillClientObjectRetrieveMethod:!1,enableConcurrentFlag:!0,enableUndoableFlag:!0,appendTypeNameToObjectPathInfo:!1,enablePreviewExecution:!1},e.config={extendedErrorLogging:!1};var d=function(){function t(){}return t.createSetPropertyAction=function(t,n,o,r,i){I.validateObjectPath(n);var a={Id:t._nextId(),ActionType:4,Name:o,ObjectPathId:n._objectPath.objectPathInfo.Id,ArgumentInfo:{}},s=[r],c=I.setMethodArguments(t,a.ArgumentInfo,s);I.validateReferencedObjectPaths(c);var u=new h(a,0,i);if(u.referencedObjectPath=n._objectPath,u.referencedArgumentObjectPaths=c,e._internalConfig.enablePreviewExecution&&0!=(16&i)){var l={Id:t._nextId(),ActionType:4,Name:o,ObjectId:"",ObjectType:"",Arguments:[r]};n._addPreviewExecutionAction(l)}return n._addAction(u)},t.createQueryAction=function(e,t,n,o){I.validateObjectPath(t);var r={Id:e._nextId(),ActionType:2,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,QueryInfo:n},i=new h(r,1,4);return i.referencedObjectPath=t._objectPath,t._addAction(i,o)},t.createQueryAsJsonAction=function(e,t,n,o){I.validateObjectPath(t);var r={Id:e._nextId(),ActionType:7,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,QueryInfo:n},i=new h(r,1,4);return i.referencedObjectPath=t._objectPath,t._addAction(i,o)},t.createUpdateAction=function(e,t,n){I.validateObjectPath(t);var o={Id:e._nextId(),ActionType:9,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,ObjectState:n},r=new h(o,0,0);return r.referencedObjectPath=t._objectPath,t._addAction(r)},t}();e.CommonActionFactory=d;var p=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),l.createPromise((function(o,r){n._context._addServiceApiAction(e,t,o,r)}))},t.prototype._addPreviewExecutionAction=function(e){},t.prototype._retrieve=function(t,n){var o=e._internalConfig.alwaysPolyfillClientObjectRetrieveMethod;o||(o=!I.isSetSupported("RichApiRuntime","1.1"));var r=m._parseQueryOption(t);return o?d.createQueryAction(this._context,this,r,n):d.createQueryAsJsonAction(this._context,this,r,n)},t.prototype._recursivelyUpdate=function(t){var n=e._internalConfig.alwaysPolyfillClientObjectUpdateMethod;n||(n=!I.isSetSupported("RichApiRuntime","1.2"));try{var o=this[S.scalarPropertyNames];o||(o=[]);var i=this[S.scalarPropertyUpdateable];if(!i){i=[];for(var c=0;c<o.length;c++)i.push(!1)}var u=this[S.navigationPropertyNames];u||(u=[]);var f={},p={},h=0;for(var g in t){var m=o.indexOf(g);if(m>=0){if(!i[m])throw new r.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:l._getResourceString(E.attemptingToSetReadOnlyProperty,g),debugInfo:{errorLocation:g}});f[g]=t[g],++h}else{if(!(u.indexOf(g)>=0))throw new r.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:l._getResourceString(E.propertyDoesNotExist,g),debugInfo:{errorLocation:g}});p[g]=t[g]}}if(h>0)if(n)for(c=0;c<o.length;c++){var v=f[g=o[c]];I.isUndefined(v)||d.createSetPropertyAction(this._context,this,g,v)}else d.createUpdateAction(this._context,this,f);for(var g in p){var y=this[g],_=p[g];y._recursivelyUpdate(_)}}catch(e){throw new r.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:l._getResourceString(s.invalidArgument,"properties"),debugInfo:{errorLocation:this._className+".update"},innerError:e})}},t}();e.ClientObjectBase=p;var h=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=h;var g=function(){function t(e,t,n,o,r,i){this.m_objectPathInfo=e,this.m_parentObjectPath=t,this.m_isCollection=n,this.m_isInvalidAfterRequest=o,this.m_isValid=!0,this.m_operationType=r,this.m_flags=i}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 o=e[S.referenceId];if(!l.isNullOrEmptyString(o)){if(!this.m_savedObjectPathInfo&&!this.isInvalidAfterRequest&&t.isRestorableObjectPath(this.m_objectPathInfo.ObjectPathType)){var r={};t.copyObjectPathInfo(this.m_objectPathInfo,r),this.m_savedObjectPathInfo={pathInfo:r,parent:this.m_parentObjectPath}}return this.saveOriginalObjectPathInfo(),this.resetForUpdateUsingObjectData(),this.m_objectPathInfo.ObjectPathType=6,this.m_objectPathInfo.Name=o,delete this.m_objectPathInfo.ParentObjectPathId,void(this.m_parentObjectPath=null)}if(n){var i=n[S.collectionPropertyPath];if(!l.isNullOrEmptyString(i)&&n.context){var a=I.tryGetObjectIdFromLoadOrRetrieveResult(e);if(!l.isNullOrUndefined(a)){for(var s=i.split("."),c=n.context[s[0]],u=1;u<s.length;u++)c=c[s[u]];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 f=this.parentObjectPath&&this.parentObjectPath.isCollection,d=this.getByIdMethodName;if(f||!l.isNullOrEmptyString(d)){a=I.tryGetObjectIdFromLoadOrRetrieveResult(e);if(!l.isNullOrUndefined(a))return this.saveOriginalObjectPathInfo(),this.resetForUpdateUsingObjectData(),l.isNullOrEmptyString(d)?(this.m_objectPathInfo.ObjectPathType=5,this.m_objectPathInfo.Name=""):(this.m_objectPathInfo.ObjectPathType=3,this.m_objectPathInfo.Name=d),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=g;var m=function(){function e(){this.m_nextId=0}return e.prototype._nextId=function(){return++this.m_nextId},e.prototype._addServiceApiAction=function(e,t,n,o){this.m_serviceApiQueue||(this.m_serviceApiQueue=new b(this)),this.m_serviceApiQueue.add(e,t,n,o)},e._parseQueryOption=function(t){var n={};if("string"==typeof t){var o=t;n.Select=I._parseSelectExpand(o)}else if(Array.isArray(t))n.Select=t;else if("object"==typeof t){var i=t;if(e.isLoadOption(i)){if("string"==typeof i.select)n.Select=I._parseSelectExpand(i.select);else if(Array.isArray(i.select))n.Select=i.select;else if(!I.isNullOrUndefined(i.select))throw r.RuntimeError._createInvalidArgError({argumentName:"option.select"});if("string"==typeof i.expand)n.Expand=I._parseSelectExpand(i.expand);else if(Array.isArray(i.expand))n.Expand=i.expand;else if(!I.isNullOrUndefined(i.expand))throw r.RuntimeError._createInvalidArgError({argumentName:"option.expand"});if("number"==typeof i.top)n.Top=i.top;else if(!I.isNullOrUndefined(i.top))throw r.RuntimeError._createInvalidArgError({argumentName:"option.top"});if("number"==typeof i.skip)n.Skip=i.skip;else if(!I.isNullOrUndefined(i.skip))throw r.RuntimeError._createInvalidArgError({argumentName:"option.skip"})}else n=e.parseStrictLoadOption(t)}else if(!I.isNullOrUndefined(t))throw r.RuntimeError._createInvalidArgError({argumentName:"option"});return n},e.isLoadOption=function(e){if(!I.isUndefined(e.select)&&("string"==typeof e.select||Array.isArray(e.select)))return!0;if(!I.isUndefined(e.expand)&&("string"==typeof e.expand||Array.isArray(e.expand)))return!0;if(!I.isUndefined(e.top)&&"number"==typeof e.top)return!0;if(!I.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,o,i){for(var a in i){var s=i[a];if("$all"===a){if("boolean"!=typeof s)throw r.RuntimeError._createInvalidArgError({argumentName:e.combineQueryPath(o,a,".")});s&&t.Select.push(e.combineQueryPath(n,"*","/"))}else if("$top"===a){if("number"!=typeof s||n.length>0)throw r.RuntimeError._createInvalidArgError({argumentName:e.combineQueryPath(o,a,".")});t.Top=s}else if("$skip"===a){if("number"!=typeof s||n.length>0)throw r.RuntimeError._createInvalidArgError({argumentName:e.combineQueryPath(o,a,".")});t.Skip=s}else if("boolean"==typeof s)s&&t.Select.push(e.combineQueryPath(n,a,"/"));else{if("object"!=typeof s)throw r.RuntimeError._createInvalidArgError({argumentName:e.combineQueryPath(o,a,".")});e.parseStrictLoadOptionHelper(t,e.combineQueryPath(n,a,"/"),e.combineQueryPath(o,a,"."),s)}}},e}();e.ClientRequestContextBase=m;var v=function(){function e(e){this.m_objectPath=e}return e.prototype._handleResult=function(e){l.isNullOrUndefined(e)?this.m_objectPath._updateAsNullObject():this.m_objectPath.updateUsingObjectData(e,null)},e}(),y=function(){function t(e){this.m_contextBase=e,this.m_actions=[],this.m_actionResultHandler={},this.m_referencedObjectPaths={},this.m_instantiatedObjectPaths={},this.m_preSyncPromises=[],this.m_previewExecutionActions=[]}return t.prototype.addAction=function(e){this.m_actions.push(e),1==e.actionInfo.ActionType&&(this.m_instantiatedObjectPaths[e.actionInfo.ObjectPathId]=e)},t.prototype.addPreviewExecutionAction=function(e){this.m_previewExecutionActions.push(e)},Object.defineProperty(t.prototype,"hasActions",{get:function(){return this.m_actions.length>0},enumerable:!0,configurable:!0}),t.prototype._getLastAction=function(){return this.m_actions[this.m_actions.length-1]},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 h(t,1,4);n.referencedObjectPath=e,this.addReferencedObjectPath(e),this.addAction(n);var o=new v(e);this.addActionResultHandler(n,o)}}},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 r.RuntimeError({code:a.invalidObjectPath,httpStatusCode:400,message:l._getResourceString(s.invalidObjectPath,I.getObjectPathExpression(e)),debugInfo:{errorLocation:I.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),I.isSetSupported("RichApiRuntimeFlag","1.1")||(t&=-5,t&=-17),I.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,o={};for(var r in this.m_referencedObjectPaths)n=this.aggregrateRequestFlags(n,this.m_referencedObjectPaths[r].operationType,this.m_referencedObjectPaths[r].flags),o[r]=this.m_referencedObjectPaths[r].objectPathInfo;for(var i=[],a=!1,s=0;s<this.m_actions.length;s++){var c=this.m_actions[s];3===c.actionInfo.ActionType&&c.actionInfo.Name===S.keepReference&&(a=!0),n=this.aggregrateRequestFlags(n,c.operationType,c.flags),i.push(c.actionInfo)}n=this.finallyNormalizeFlags(n);var u={AutoKeepReference:this.m_contextBase._autoCleanup&&a,Actions:i,ObjectPaths:o};return this.m_previewExecutionActions.length>0&&(u.PreviewExecutionActions=this.m_previewExecutionActions,n|=4096),{body:u,flags:n}},t.prototype.processResponse=function(e){if(e)for(var t=0;t<e.length;t++){var n=e[t],o=this.m_actionResultHandler[n.ActionId];o&&o._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 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(e){for(var t=this.m_actions.length-1;t>=0;t--){var n=this.m_actions[t].actionInfo;if(n.ObjectPathId===e&&3===n.ActionType&&n.Name===S.keepReference){this.m_actions.splice(t,1);break}}},t._updateLastUsedActionIdOfObjectPathId=function(e,n,o){for(;n;){if(e[n.objectPathInfo.Id])return;e[n.objectPathInfo.Id]=o;var r=n.argumentObjectPaths;if(r)for(var i=r.length,a=0;a<i;a++)t._updateLastUsedActionIdOfObjectPathId(e,r[a],o);n=n.parentObjectPath}},t._calculateLastUsedObjectPathIds=function(e){for(var n={},o=e.length,r=o-1;r>=0;--r){var i=(d=e[r]).actionInfo.Id;d.referencedObjectPath&&t._updateLastUsedActionIdOfObjectPathId(n,d.referencedObjectPath,i);var a=d.referencedArgumentObjectPaths;if(a)for(var s=a.length,c=0;c<s;c++)t._updateLastUsedActionIdOfObjectPathId(n,a[c],i)}var u={};for(var l in n){var f=u[i=n[l]];f||(f=[],u[i]=f),f.push(parseInt(l))}for(r=0;r<o;r++){var d,p=u[(d=e[r]).actionInfo.Id];p&&p.length>0?d.actionInfo.L=p:d.actionInfo.L&&delete d.actionInfo.L}},t}();e.ClientRequestBase=y;var _=function(){function e(e){this.m_type=e}return Object.defineProperty(e.prototype,"value",{get:function(){if(!this.m_isLoaded)throw new r.RuntimeError({code:a.valueNotLoaded,httpStatusCode:400,message:l._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=I.adjustToDateTime(e):this.m_value=e)},e}();e.ClientResult=_;var b=function(){function e(e){this.m_context=e,this.m_actions=[]}return e.prototype.add=function(e,t,n,o){var r=this;this.m_actions.push({action:e,resultHandler:t,resolve:n,reject:o}),1===this.m_actions.length&&setTimeout((function(){return r.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 y(this.m_context),o=0;o<t.length;o++){var r=t[o];n.ensureInstantiateObjectPath(r.action.referencedObjectPath),n.ensureInstantiateObjectPaths(r.action.referencedArgumentObjectPaths),n.addAction(r.action),n.addReferencedObjectPath(r.action.referencedObjectPath),n.addReferencedObjectPaths(r.action.referencedArgumentObjectPaths)}var i=n.buildRequestMessageBodyAndRequestFlags(),a=i.body,s=i.flags,u={Url:c.localDocumentApiPrefix,Headers:null,Body:a};l.log("Request:"),l.log(JSON.stringify(a)),(new O).executeAsync(this.m_context._customData,s,u).then((function(o){e.processResponse(n,t,o)})).catch((function(e){for(var n=0;n<t.length;n++){t[n].reject(e)}}))}},e.prototype.processResponse=function(e,t,n){var o=this.getErrorFromResponse(n),r=null;n.Body.Results?r=n.Body.Results:n.Body.ProcessedResults&&n.Body.ProcessedResults.Results&&(r=n.Body.ProcessedResults.Results),r||(r=[]),this.processActionResults(e,t,r,o)},e.prototype.getErrorFromResponse=function(e){return l.isNullOrEmptyString(e.ErrorCode)?e.Body&&e.Body.Error?new r.RuntimeError({code:e.Body.Error.Code,httpStatusCode:e.Body.Error.HttpStatusCode,message:e.Body.Error.Message}):null:new r.RuntimeError({code:e.ErrorCode,httpStatusCode:e.HttpStatusCode,message:e.ErrorMessage})},e.prototype.processActionResults=function(e,t,n,o){e.processResponse(n);for(var r=0;r<t.length;r++){for(var i=t[r],a=i.action.actionInfo.Id,s=!1,c=0;c<n.length;c++)if(a==n[c].ActionId){var u=n[c].Value;i.resultHandler&&(i.resultHandler._handleResult(u),u=i.resultHandler.value),i.resolve&&i.resolve(u),s=!0;break}!s&&i.reject&&(o?i.reject(o):i.reject("No response for the action."))}},e}(),O=function(){function e(){}return e.prototype.getRequestUrl=function(e,n,o){void 0===o&&(o=t.graph.toString());var r=c.flags+"="+n.toString();switch(o){case t.graph.toString():"/"!=e.charAt(e.length-1)&&(e+="/"),e=(e+=c.processQuery)+"?"+r;break;case t.wfe.toString():e=(e=e+"&"+r)+"&wdRestPart=_api/"+c.processQuery}return e},e.prototype.executeAsync=function(n,r,i){var a=i.Headers?i.Headers[S.remoteEndpointTypeHeaderKey]:t.graph.toString(),s={method:"POST",url:this.getRequestUrl(i.Url,r,a),headers:{},body:i.Body};if(s.headers[c.sourceLibHeader]=e.SourceLibHeaderValue,s.headers["CONTENT-TYPE"]="application/json",i.Headers)for(var u in i.Headers)s.headers[u]=i.Headers[u];return(l._isLocalDocumentUrl(s.url)?o.sendLocalDocumentRequest:o.sendRequest)(s).then((function(e){var t;if(200===e.statusCode)t={HttpStatusCode:e.statusCode,ErrorCode:null,ErrorMessage:null,Headers:e.headers,Body:l._parseResponseBody(e)};else{l.log("Error Response:"+e.body);var n=l._parseErrorResponse(e);t={HttpStatusCode:e.statusCode,ErrorCode:n.errorCode,ErrorMessage:n.errorMessage,Headers:e.headers,Body:null,RawErrorResponseBody:l._parseErrorResponseBody(e)}}return t}))},e.SourceLibHeaderValue="officejs-rest",e}();e.HttpRequestExecutor=O;var S=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=S;var I=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 r.RuntimeError({code:a.invalidObjectPath,httpStatusCode:400,message:l._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 o=e[n];o;){if(!o.isValid)throw new r.RuntimeError({code:a.invalidObjectPath,httpStatusCode:400,message:l._getResourceString(s.invalidObjectPath,t.getObjectPathExpression(o))});o=o.parentObjectPath}},t._toCamelLowerCase=function(e){if(l.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(l.isNullOrUndefined(e))return null;if("string"==typeof e)return new Date(e);if(Array.isArray(e)){for(var n=e,o=0;o<n.length;o++)n[o]=t.adjustToDateTime(n[o]);return n}throw l._createInvalidArgError({argumentName:"date"})},t.tryGetObjectIdFromLoadOrRetrieveResult=function(e){var t=e[S.id];return l.isNullOrUndefined(t)&&(t=e[S.idLowerCase]),l.isNullOrUndefined(t)&&(t=e[S.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,o){if(l.isNullOrUndefined(o))return null;var r=new Array,i=new Array,a=t.collectObjectPathInfos(e,o,r,i);return n.Arguments=o,a&&(n.ReferencedObjectPathIds=i),r},t.validateContext=function(e,t){if(e&&t&&t._context!==e)throw new r.RuntimeError({code:a.invalidRequestContext,httpStatusCode:400,message:l._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,o,i){if(t._doApiNotSupportedCheck&&!t.isSetSupported(n,o)){var c=l._getResourceString(s.apiNotFoundDetails,[e,n+" "+o,i]);throw new r.RuntimeError({code:a.apiNotFound,httpStatusCode:404,message:c,debugInfo:{errorLocation:e}})}},t.calculateApiFlags=function(e,n,o){var r=window&&window.location&&window.location.href&&-1!==window.location.href.indexOf("eed0a086-3498-4f91-a377-1e0265ecc0cc");return("function"==typeof t.isSetSupportedOverride?t.isSetSupportedOverride(n,o):!r&&t.isSetSupported(n,o))||(e&=-3),e},t._parseSelectExpand=function(e){var t=[];if(!l.isNullOrEmptyString(e))for(var n=e.split(","),o=0;o<n.length;o++){var r=n[o];(r=i(r.trim())).length>0&&t.push(r)}return t;function i(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=[],o=0;o<e.length;o++)n.push(this.changePropertyNameToCamelLowerCase(e[o]));return n}if("object"==typeof e&&null!==e){n={};for(var r in e){var i=e[r];if(r===S.items){(n={})[S.itemsLowerCase]=this.changePropertyNameToCamelLowerCase(i);break}n[t._toCamelLowerCase(r)]=this.changePropertyNameToCamelLowerCase(i)}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 o in e)if(95!==o.charCodeAt(0)){var r=e[o];"object"==typeof r&&null!==r&&Array.isArray(r.items)&&(r=r.items),t[o]=this.purifyJson(r)}return t}return e},t.collectObjectPathInfos=function(e,n,o,r){for(var i=!1,a=0;a<n.length;a++)if(n[a]instanceof p){var s=n[a];t.validateContext(e,s),n[a]=s._objectPath.objectPathInfo.Id,r.push(s._objectPath.objectPathInfo.Id),o.push(s._objectPath),i=!0}else if(Array.isArray(n[a])){var c=new Array;t.collectObjectPathInfos(e,n[a],o,c)?(r.push(c),i=!0):r.push(0)}else l.isPlainJsonObject(n[a])?(r.push(0),t.replaceClientObjectPropertiesWithObjectPathIds(n[a],o)):r.push(0);return i},t.replaceClientObjectPropertiesWithObjectPathIds=function(e,n){var o,r;for(var i in e){var a=e[i];if(a instanceof p)n.push(a._objectPath),e[i]=((o={})[S.objectPathIdPrivate]=a._objectPath.objectPathInfo.Id,o);else if(Array.isArray(a))for(var s=0;s<a.length;s++)if(a[s]instanceof p){var c=a[s];n.push(c._objectPath),a[s]=((r={})[S.objectPathIdPrivate]=c._objectPath.objectPathInfo.Id,r)}else l.isPlainJsonObject(a[s])&&t.replaceClientObjectPropertiesWithObjectPathIds(a[s],n);else l.isPlainJsonObject(a)&&t.replaceClientObjectPropertiesWithObjectPathIds(a,n)}},t.normalizeName=function(e){return e.substr(0,1).toLowerCase()+e.substr(1)},t._doApiNotSupportedCheck=!1,t}(l);e.CommonUtility=I;var E=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=E;var C=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=C;var A=function(){function e(e){this.m_callback=e}return e.prototype._handleResult=function(e){this.m_callback&&this.m_callback()},e}(),P=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),n.createMethodAction=function(t,n,o,r,i,a){G.validateObjectPath(n);var s={Id:t._nextId(),ActionType:3,Name:o,ObjectPathId:n._objectPath.objectPathInfo.Id,ArgumentInfo:{}},c=G.setMethodArguments(t,s.ArgumentInfo,i);G.validateReferencedObjectPaths(c);var u=G._fixupApiFlags(a),l=new h(s,r,u);if(l.referencedObjectPath=n._objectPath,l.referencedArgumentObjectPaths=c,n._addAction(l),e._internalConfig.enablePreviewExecution&&0!=(16&u)){var f={Id:t._nextId(),ActionType:3,Name:o,Arguments:i,ObjectId:"",ObjectType:""};n._addPreviewExecutionAction(f)}return l},n.createRecursiveQueryAction=function(e,t,n){G.validateObjectPath(t);var o={Id:e._nextId(),ActionType:6,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,RecursiveQueryInfo:n},r=new h(o,1,4);return r.referencedObjectPath=t._objectPath,t._addAction(r),r},n.createEnsureUnchangedAction=function(e,t,n){G.validateObjectPath(t);var o={Id:e._nextId(),ActionType:8,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,ObjectState:n},r=new h(o,1,4);return r.referencedObjectPath=t._objectPath,t._addAction(r),r},n.createInstantiateAction=function(e,t){G.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},o=new h(n,1,4);return o.referencedObjectPath=t._objectPath,t._addAction(o,new U(t),!0),o},n.createTraceAction=function(e,t,n){var o={Id:e._nextId(),ActionType:5,Name:"Trace",ObjectPathId:0},r=new h(o,1,4);return e._pendingRequest.addAction(r),n&&e._pendingRequest.addTrace(o.Id,t),r},n.createTraceMarkerForCallback=function(e,t){var o=n.createTraceAction(e,null,!1);e._pendingRequest.addActionResultHandler(o,new A(t))},n}(d);e.ActionFactory=P;var w=function(t){function n(n,o){var r=t.call(this,n,o)||this;return G.checkArgumentNull(n,"context"),r.m_context=n,r._objectPath&&(!n._processingResult&&n._pendingRequest&&(P.createInstantiateAction(n,r),n._autoCleanup&&r._KeepReference&&n.trackedObjects._autoAdd(r)),e._internalConfig.appendTypeNameToObjectPathInfo&&r._objectPath.objectPathInfo&&r._className&&(r._objectPath.objectPathInfo.T=r._className)),r}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||!f.isMock())&&(G.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||!f.isMock())&&(G.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),l._createPromiseFromResult(null)},n.prototype._addPreviewExecutionAction=function(e){if(!G.isUndefined(this._className)){e.ObjectType=this._className;var t=G._getPropertyValueWithoutCheckLoaded(this,M.idLowerCase);G.isUndefined(t)&&(t=G._getPropertyValueWithoutCheckLoaded(this,M.idPrivate)),G.isUndefined(t)&&(t=G._getPropertyValueWithoutCheckLoaded(this,M.previewExecutionObjectId)),e.ObjectId=t,this.context._pendingRequest.addPreviewExecutionAction(e)}},n.prototype._handleResult=function(e){this._isNull=G.isNullOrUndefined(e),this.context.trackedObjects._autoTrackIfNecessaryWhenHandleObjectResultValue(this,e)},n.prototype._handleIdResult=function(e){this._isNull=G.isNullOrUndefined(e),G.fixObjectPathIfNecessary(this,e),this.context.trackedObjects._autoTrackIfNecessaryWhenHandleObjectResultValue(this,e)},n.prototype._handleRetrieveResult=function(e,t){this._handleIdResult(e)},n.prototype._recursivelySet=function(e,t,o,i,c){var u=e instanceof n,f=e;if(u){if(Object.getPrototypeOf(this)!==Object.getPrototypeOf(e))throw r.RuntimeError._createInvalidArgError({argumentName:"properties",errorLocation:this._className+".set"});e=JSON.parse(JSON.stringify(e))}try{for(var d,p=0;p<o.length;p++)d=o[p],e.hasOwnProperty(d)&&void 0!==e[d]&&(this[d]=e[d]);for(p=0;p<i.length;p++)if(d=i[p],e.hasOwnProperty(d)&&void 0!==e[d]){var h=u?f[d]:e[d];this[d].set(h,t)}var g=!u;t&&!G.isNullOrUndefined(g)&&(g=t.throwOnReadOnly);for(p=0;p<c.length;p++)if(d=c[p],e.hasOwnProperty(d)&&void 0!==e[d]&&g)throw new r.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:l._getResourceString(J.cannotApplyPropertyThroughSetMethod,d),debugInfo:{errorLocation:d}});for(d in e)if(o.indexOf(d)<0&&i.indexOf(d)<0){var m=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),d);if(!m)throw new r.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:l._getResourceString(E.propertyDoesNotExist,d),debugInfo:{errorLocation:d}});if(g&&!m.set)throw new r.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:l._getResourceString(E.attemptingToSetReadOnlyProperty,d),debugInfo:{errorLocation:d}})}}catch(e){throw new r.RuntimeError({code:a.invalidArgument,httpStatusCode:400,message:l._getResourceString(s.invalidArgument,"properties"),debugInfo:{errorLocation:this._className+".set"},innerError:e})}},n}(p);e.ClientObject=w;var x=function(){function e(e){this.m_session=e}return e.prototype.executeAsync=function(e,t,n){var o={url:c.processQuery,method:"POST",headers:n.Headers,body:n.Body},r="";n.Headers&&(r=n.Headers[M.officeControlId]);var a={id:i.nextId(),type:1,flags:t,controlId:r,message:o,customData:e};return l.log(JSON.stringify(a)),this.m_session.sendMessageToHost(a).then((function(e){l.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:l._parseResponseBody(n)};else{l.log("Error Response:"+n.body);var o=l._parseErrorResponse(n);t={HttpStatusCode:n.statusCode,ErrorCode:o.errorCode,ErrorMessage:o.errorMessage,Headers:n.headers,Body:null}}return t}))},e}(),F=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(l.isNullOrEmptyString(t))L.getGenericEventRegistration(t)._handleRichApiMessage(e.message);else{var n=L.peekGenericEventRegistrationOrNull(t);n&&n._handleRichApiMessage(e.message),(n=L.peekGenericEventRegistrationOrNull(""))&&n._handleRichApiMessage(e.message)}}})),n}return __extends(t,e),t.getInstanceIfHostBridgeInited=function(){return i.instance?((l.isNullOrUndefined(t.s_instance)||t.s_instance.m_bridge!==i.instance)&&(t.s_instance=new t(i.instance)),t.s_instance):null},t.prototype._resolveRequestUrlAndHeaderInfo=function(){return l._createPromiseFromResult(null)},t.prototype._createRequestExecutorOrNull=function(){return l.log("NativeBridgeSession::CreateRequestExecutor"),new x(this)},t.prototype.getEventRegistration=function(e){return L.getGenericEventRegistration(e)},t.prototype.sendMessageToHost=function(e){return this.m_bridge.sendMessageToHostAndExpectResponse(e)},t}(n);e.HostBridgeSession=F;var R=function(t){function o(e){var i=t.call(this)||this;if(i.m_customRequestHeaders={},i.m_batchMode=0,i._onRunFinishedNotifiers=[],n._overrideSession)i.m_requestUrlAndHeaderInfoResolver=n._overrideSession;else if((G.isNullOrUndefined(e)||"string"==typeof e&&0===e.length)&&((e=o.defaultRequestUrlAndHeaders)||(e={url:c.localDocument,headers:{}})),"string"==typeof e)i.m_requestUrlAndHeaderInfo={url:e,headers:{}};else if(o.isRequestUrlAndHeaderInfoResolver(e))i.m_requestUrlAndHeaderInfoResolver=e;else{if(!o.isRequestUrlAndHeaderInfo(e))throw r.RuntimeError._createInvalidArgError({argumentName:"url"});var a=e;i.m_requestUrlAndHeaderInfo={url:a.url,headers:{}},l._copyHeaders(a.headers,i.m_requestUrlAndHeaderInfo.headers)}return!i.m_requestUrlAndHeaderInfoResolver&&i.m_requestUrlAndHeaderInfo&&l._isLocalDocumentUrl(i.m_requestUrlAndHeaderInfo.url)&&F.getInstanceIfHostBridgeInited()&&(i.m_requestUrlAndHeaderInfo=null,i.m_requestUrlAndHeaderInfoResolver=F.getInstanceIfHostBridgeInited()),i.m_requestUrlAndHeaderInfoResolver instanceof n&&(i.m_session=i.m_requestUrlAndHeaderInfoResolver),i._processingResult=!1,i._customData=M.iterativeExecutor,i.sync=i.sync.bind(i),i}return __extends(o,t),Object.defineProperty(o.prototype,"session",{get:function(){return this.m_session},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"eventRegistration",{get:function(){return this.m_session?this.m_session.getEventRegistration(this._controlId):r.officeJsEventRegistration},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"_url",{get:function(){return this.m_requestUrlAndHeaderInfo?this.m_requestUrlAndHeaderInfo.url:null},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"_pendingRequest",{get:function(){return null==this.m_pendingRequest&&(this.m_pendingRequest=new T(this)),this.m_pendingRequest},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"_controlId",{get:function(){var e=this.m_customRequestHeaders[M.officeControlId];return l.isNullOrUndefined(e)&&(e=""),e},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"debugInfo",{get:function(){return{pendingStatements:new V(this._rootObjectPropertyName,this._pendingRequest._objectPaths,this._pendingRequest._actions,e._internalConfig.showDisposeInfoInDebugInfo).process()}},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"trackedObjects",{get:function(){return this.m_trackedObjects||(this.m_trackedObjects=new q(this)),this.m_trackedObjects},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"requestHeaders",{get:function(){return this.m_customRequestHeaders},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"batchMode",{get:function(){return this.m_batchMode},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"getAdditionalHeaders",{set:function(e){this.m_getAdditionalHeaders=e},enumerable:!0,configurable:!0}),o.prototype.ensureInProgressBatchIfBatchMode=function(){if(1===this.m_batchMode&&!this.m_explicitBatchInProgress)throw G.createRuntimeError(a.generalException,l._getResourceString(J.notInsideBatch),null)},o.prototype.load=function(e,t){G.validateContext(this,e);var n=o._parseQueryOption(t);d.createQueryAction(this,e,n,e)},o.prototype.loadRecursive=function(e,t,n){if(!G.isPlainJsonObject(t))throw r.RuntimeError._createInvalidArgError({argumentName:"options"});var i={};for(var a in t)i[a]=o._parseQueryOption(t[a]);var s=P.createRecursiveQueryAction(this,e,{Queries:i,MaxDepth:n});this._pendingRequest.addActionResultHandler(s,e)},o.prototype.trace=function(e){P.createTraceAction(this,e,!0)},o.prototype._processOfficeJsErrorResponse=function(e,t){},o.prototype.ensureRequestUrlAndHeaderInfo=function(){var e=this;return G._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:{}}),G.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)}}))}))},o.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)}))}))},o.prototype.syncPrivate=function(t){var n=this;if(f.isMock())return l._createPromiseFromResult(null);if(!t.hasActions)return this.processPendingEventHandlers(t);var o=t.buildRequestMessageBodyAndRequestFlags(),i=o.body,a=o.flags;this._requestFlagModifier&&(a|=this._requestFlagModifier),this._requestExecutor||(l._isLocalDocumentUrl(this.m_requestUrlAndHeaderInfo.url)?this._requestExecutor=new B(this):this._requestExecutor=new O);var s=this._requestExecutor,u={};l._copyHeaders(this.m_requestUrlAndHeaderInfo.headers,u),l._copyHeaders(this.m_customRequestHeaders,u),delete this.m_customRequestHeaders[M.officeScriptEventId],this.m_getAdditionalHeaders&&l._copyHeaders(this.m_getAdditionalHeaders(),u);var d=f._getCurrentTestNameWithSequenceId();d&&(u[c.testRequestNameHeader]=d);var p={Url:this.m_requestUrlAndHeaderInfo.url,Headers:u,Body:i};t.invalidatePendingInvalidObjectPaths();var h=null,g=null;return this._lastSyncStart="undefined"==typeof performance?Date.now():performance.now(),this._lastRequestFlags=a,s.executeAsync(this._customData,a,p).then((function(o){return n._lastSyncEnd="undefined"==typeof performance?Date.now():performance.now(),e.config.executePerfLogFunc&&e.config.executePerfLogFunc({syncStart:n._lastSyncStart,syncEnd:n._lastSyncEnd}),h=n.processRequestExecutorResponseMessage(t,o),n.processPendingEventHandlers(t).catch((function(e){l.log("Error in processPendingEventHandlers"),l.log(JSON.stringify(e)),g=e}))})).then((function(){if(h)throw l.log("Throw error from response: "+JSON.stringify(h)),h;if(g){l.log("Throw error from ProcessEventHandler: "+JSON.stringify(g));var e=null;if(g instanceof r.RuntimeError)(e=g).traceMessages=t._responseTraceMessages;else{var n=null;n="string"==typeof g?g:g.message,G.isNullOrEmptyString(n)&&(n=l._getResourceString(J.cannotRegisterEvent)),e=new r.RuntimeError({code:C.cannotRegisterEvent,httpStatusCode:400,message:n,traceMessages:t._responseTraceMessages})}throw e}}))},o.prototype.processRequestExecutorResponseMessage=function(t,n){n.Body&&n.Body.TraceIds&&t._setResponseTraceIds(n.Body.TraceIds);var o=t._responseTraceMessages,i=null;if(n.Body){if(n.Body.Error&&n.Body.Error.ActionIndex>=0){var a=new V(this._rootObjectPropertyName,t._objectPaths,t._actions,!1,!0),s=a.processForDebugStatementInfo(n.Body.Error.ActionIndex);i={statement:s.statement,surroundingStatements:s.surroundingStatements,fullStatements:["Please enable config.extendedErrorLogging to see full statements."]},e.config.extendedErrorLogging&&(a=new V(this._rootObjectPropertyName,t._objectPaths,t._actions,!1,!1),i.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(!G.isNullOrEmptyString(n.ErrorCode))return new r.RuntimeError({code:n.ErrorCode,httpStatusCode:n.HttpStatusCode,message:n.ErrorMessage,traceMessages:o,data:{responseBody:n.RawErrorResponseBody}});if(n.Body&&n.Body.Error){var u={errorLocation:n.Body.Error.Location};return i&&(u.statement=i.statement,u.surroundingStatements=i.surroundingStatements,u.fullStatements=i.fullStatements),new r.RuntimeError({code:n.Body.Error.Code,httpStatusCode:n.Body.Error.HttpStatusCode,message:n.Body.Error.Message,traceMessages:o,debugInfo:u})}return null},o.prototype.processPendingEventHandlers=function(e){for(var t=G._createPromiseFromResult(null),n=0;n<e._pendingProcessEventHandlers.length;n++){var o=e._pendingProcessEventHandlers[n];t=t.then(this.createProcessOneEventHandlersFunc(o,e))}return t},o.prototype.createProcessOneEventHandlersFunc=function(e,t){return function(){return e._processRegistration(t)}},o.prototype.processPreSyncPromises=function(e){for(var t=G._createPromiseFromResult(null),n=0;n<e._preSyncPromises.length;n++){var o=e._preSyncPromises[n];t=t.then(this.createProcessOneProSyncFunc(o))}return t},o.prototype.createProcessOneProSyncFunc=function(e){return function(){return e}},o.prototype.sync=function(e){return f.isMock()?l._createPromiseFromResult(e):this.syncPrivateMain().then((function(){return e}))},o.prototype.batch=function(e){var t=this;if(1!==this.m_batchMode)return l._createPromiseFromException(G.createRuntimeError(a.generalException,null,null));if(this.m_explicitBatchInProgress)return l._createPromiseFromException(G.createRuntimeError(a.generalException,l._getResourceString(J.pendingBatchInProgress),null));if(G.isNullOrUndefined(e))return G._createPromiseFromResult(null);this.m_explicitBatchInProgress=!0;var n,o,r,i=this.m_pendingRequest;this.m_pendingRequest=new T(this);try{n=e(this._rootObject,this)}catch(e){return this.m_explicitBatchInProgress=!1,this.m_pendingRequest=i,l._createPromiseFromException(e)}return"object"==typeof n&&n&&"function"==typeof n.then?r=G._createPromiseFromResult(null).then((function(){return n})).then((function(e){return t.m_explicitBatchInProgress=!1,o=t.m_pendingRequest,t.m_pendingRequest=i,e})).catch((function(e){return t.m_explicitBatchInProgress=!1,o=t.m_pendingRequest,t.m_pendingRequest=i,l._createPromiseFromException(e)})):(this.m_explicitBatchInProgress=!1,o=this.m_pendingRequest,this.m_pendingRequest=i,r=G._createPromiseFromResult(n)),r.then((function(e){return t.ensureRequestUrlAndHeaderInfo().then((function(){return t.syncPrivate(o)})).then((function(){return e}))}))},o._run=function(e,t,n,r,i,a){return void 0===n&&(n=3),void 0===r&&(r=5e3),o._runCommon("run",null,e,0,t,n,r,null,null,i,a)},o.isValidRequestInfo=function(e){return"string"==typeof e||o.isRequestUrlAndHeaderInfo(e)||o.isRequestUrlAndHeaderInfoResolver(e)},o.isRequestUrlAndHeaderInfo=function(e){return"object"==typeof e&&null!==e&&Object.getPrototypeOf(e)===Object.getPrototypeOf({})&&!G.isNullOrUndefined(e.url)},o.isRequestUrlAndHeaderInfoResolver=function(e){return"object"==typeof e&&null!==e&&"function"==typeof e._resolveRequestUrlAndHeaderInfo},o._runBatch=function(e,t,n,r,i,a,s,c,u){return void 0===a&&(a=3),void 0===s&&(s=5e3),o._runBatchCommon(0,e,t,n,a,s,r,i,c,u)},o._runExplicitBatch=function(e,t,n,r,i,a,s,c,u){return void 0===a&&(a=3),void 0===s&&(s=5e3),o._runBatchCommon(1,e,t,n,a,s,r,i,c,u)},o._runBatchCommon=function(e,t,n,r,i,a,s,c,u,l){var f,d;void 0===i&&(i=3),void 0===a&&(a=5e3);var p=null,h=null,g=null,m=0,v=null;if(n.length>0)if(o.isValidRequestInfo(n[0]))p=n[0],m=1;else if(G.isPlainJsonObject(n[0])){if(null!=(p=(v=n[0]).session)&&!o.isValidRequestInfo(p))return o.createErrorPromise(t);h=v.getAdditionalHeaders,g=v.previousObjects,m=1}if(n.length==m+1)d=n[m+0];else{if(null!=v||n.length!=m+2)return o.createErrorPromise(t);g=n[m+0],d=n[m+1]}if(null!=g)if(g instanceof w)f=function(){return g.context};else if(g instanceof o)f=function(){return g};else{if(!Array.isArray(g))return o.createErrorPromise(t);var y=g;if(0==y.length)return o.createErrorPromise(t);for(var _=0;_<y.length;_++){if(!(y[_]instanceof w))return o.createErrorPromise(t);if(y[_].context!=y[0].context)return o.createErrorPromise(t,J.invalidRequestContext)}f=function(){return y[0].context}}else f=r;var b=null;s&&(b=function(e){return s(v||{},e)});var O=null;return c&&(O=function(e){return c(v||{},e)}),o._runCommon(t,p,f,e,d,i,a,b,O,u,l,h)},o.createErrorPromise=function(e,t){return void 0===t&&(t=s.invalidArgument),l._createPromiseFromException(G.createRuntimeError(t,l._getResourceString(t),e))},o._runCommon=function(t,r,i,a,s,c,u,f,d,p,h,g){n._overrideSession&&(r=n._overrideSession);var m,v,y,_=l.createPromise((function(e,t){e()})),b=!1;return _.then((function(){if((m=i(r)).getAdditionalHeaders=g,m._autoCleanup)return new e.Promise((function(e,t){m._onRunFinishedNotifiers.push((function(){m._autoCleanup=!0,e()}))}));m._autoCleanup=!0})).then((function(){return"function"!=typeof s?o.createErrorPromise(t):(y=m.m_batchMode,m.m_batchMode=a,f&&f(m),e=s(1==a?m.batch.bind(m):m),(G.isNullOrUndefined(e)||"function"!=typeof e.then)&&G.throwError(J.runMustReturnPromise),e);var e})).then((function(e){return 1===a?e:m.sync(e)})).then((function(e){b=!0,v=e})).catch((function(e){v=e})).then((function(){var e=m.trackedObjects._retrieveAndClearAutoCleanupList();for(var t in m._autoCleanup=!1,m.m_batchMode=y,e)e[t]._objectPath.isValid=!1;var n=0;if(G._synchronousCleanup||o.isRequestUrlAndHeaderInfoResolver(r))return i();function i(){n++;var t=m.m_pendingRequest,o=m.m_batchMode,r=new T(m);m.m_pendingRequest=r,m.m_batchMode=0;try{for(var a in e)m.trackedObjects.remove(e[a]);d&&d(m)}finally{m.m_batchMode=o,m.m_pendingRequest=t}return m.syncPrivate(r).then((function(){p&&p(n)})).catch((function(){h&&h(n),n<c&&setTimeout((function(){i()}),u)}))}i()})).then((function(){m._onRunFinishedNotifiers&&m._onRunFinishedNotifiers.length>0&&m._onRunFinishedNotifiers.shift()();if(b)return v;throw v}))},o}(m);e.ClientRequestContext=R;var N=function(){function e(e,t){this.m_proxy=e,this.m_shouldPolyfill=t;var n=e[M.scalarPropertyNames],o=e[M.navigationPropertyNames],r=e[M.className],i=e[M.isCollection];if(n)for(var a=0;a<n.length;a++)G.definePropertyThrowUnloadedException(this,r,n[a]);if(o)for(a=0;a<o.length;a++)G.definePropertyThrowUnloadedException(this,r,o[a]);i&&G.definePropertyThrowUnloadedException(this,r,M.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 r.RuntimeError({code:C.valueNotLoaded,httpStatusCode:400,message:l._getResourceString(J.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:(G.isUndefined(this.m_json)&&(this.m_json=G.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=G.changePropertyNameToCamelLowerCase(e)),this.m_value=e,this.m_proxy._handleRetrieveResult(e,this)},e}(),M=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}(S);e.Constants=M;var T=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 o=this.m_traceInfos[n];l.isNullOrUndefined(o)||this.m_responseTraceMessages.push(o)}},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}(y);e.ClientRequest=T;var j=function(){function e(e,t,n,o){var r=this;this.m_id=e._nextId(),this.m_context=e,this.m_name=n,this.m_handlers=[],this.m_registered=!1,this.m_eventInfo=o,this.m_callback=function(e){r.m_eventInfo.eventArgsTransformFunc(e).then((function(e){return r.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=P.createTraceAction(this.m_context,null,!1);return this.m_context._pendingRequest._addPendingEventHandlerAction(this,{id:t.actionInfo.Id,handler:e,operation:0}),new H(this.m_context,this,e)},e.prototype.remove=function(e){var t=P.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=P.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=l._createPromiseFromResult(null),o=e._getPendingEventHandlerActions(this);if(!o)return n;for(var r=[],i=0;i<this.m_handlers.length;i++)r.push(this.m_handlers[i]);var a=!1;for(i=0;i<o.length;i++)if(e._responseTraceIds[o[i].id])switch(a=!0,o[i].operation){case 0:r.push(o[i].handler);break;case 1:for(var s=r.length-1;s>=0;s--)if(r[s]===o[i].handler){r.splice(s,1);break}break;case 2:r=[]}return a&&(!this.m_registered&&r.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==r.length&&(n=n.then((function(){return t.m_eventInfo.unregisterFunc(t.m_callback)})).catch((function(e){l.log("Error when unregister event: "+JSON.stringify(e))})).then((function(){return t.m_registered=!1}))),n=n.then((function(){return t.m_handlers=r}))),n},e.prototype.fireEvent=function(e){for(var t=[],n=0;n<this.m_handlers.length;n++){var o=this.m_handlers[n],r=l._createPromiseFromResult(null).then(this.createFireOneEventHandlerFunc(o,e)).catch((function(e){l.log("Error when invoke handler: "+JSON.stringify(e))}));t.push(r)}l.Promise.all(t)},e.prototype.createFireOneEventHandlerFunc=function(e,t){return function(){return e(t)}},e}();e.EventHandlers=j;var H=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=H,function(e){var t=function(){function t(){}return t.prototype.register=function(t,n,o){switch(t){case 4:return G.promisify((function(e){return Office.context.document.bindings.getByIdAsync(n,e)})).then((function(e){return G.promisify((function(t){return e.addHandlerAsync(Office.EventType.BindingDataChanged,o,t)}))}));case 3:return G.promisify((function(e){return Office.context.document.bindings.getByIdAsync(n,e)})).then((function(e){return G.promisify((function(t){return e.addHandlerAsync(Office.EventType.BindingSelectionChanged,o,t)}))}));case 2:return G.promisify((function(e){return Office.context.document.addHandlerAsync(Office.EventType.DocumentSelectionChanged,o,e)}));case 1:return G.promisify((function(e){return Office.context.document.settings.addHandlerAsync(Office.EventType.SettingsChanged,o,e)}));case 5:return OSF.DDA.RichApi.richApiMessageManager.register(o);case 13:return G.promisify((function(e){return Office.context.document.addHandlerAsync(Office.EventType.ObjectDeleted,o,{id:n},e)}));case 14:return G.promisify((function(e){return Office.context.document.addHandlerAsync(Office.EventType.ObjectSelectionChanged,o,{id:n},e)}));case 15:return G.promisify((function(e){return Office.context.document.addHandlerAsync(Office.EventType.ObjectDataChanged,o,{id:n},e)}));case 16:return G.promisify((function(e){return Office.context.document.addHandlerAsync(Office.EventType.ContentControlAdded,o,{id:n},e)}));default:throw e.RuntimeError._createInvalidArgError({argumentName:"eventId"})}},t.prototype.unregister=function(t,n,o){switch(t){case 4:return G.promisify((function(e){return Office.context.document.bindings.getByIdAsync(n,e)})).then((function(e){return G.promisify((function(t){return e.removeHandlerAsync(Office.EventType.BindingDataChanged,{handler:o},t)}))}));case 3:return G.promisify((function(e){return Office.context.document.bindings.getByIdAsync(n,e)})).then((function(e){return G.promisify((function(t){return e.removeHandlerAsync(Office.EventType.BindingSelectionChanged,{handler:o},t)}))}));case 2:return G.promisify((function(e){return Office.context.document.removeHandlerAsync(Office.EventType.DocumentSelectionChanged,{handler:o},e)}));case 1:return G.promisify((function(e){return Office.context.document.settings.removeHandlerAsync(Office.EventType.SettingsChanged,{handler:o},e)}));case 5:return G.promisify((function(e){return OSF.DDA.RichApi.richApiMessageManager.removeHandlerAsync("richApiMessage",{handler:o},e)}));case 13:return G.promisify((function(e){return Office.context.document.removeHandlerAsync(Office.EventType.ObjectDeleted,{id:n,handler:o},e)}));case 14:return G.promisify((function(e){return Office.context.document.removeHandlerAsync(Office.EventType.ObjectSelectionChanged,{id:n,handler:o},e)}));case 15:return G.promisify((function(e){return Office.context.document.removeHandlerAsync(Office.EventType.ObjectDataChanged,{id:n,handler:o},e)}));case 16:return G.promisify((function(e){return Office.context.document.removeHandlerAsync(Office.EventType.ContentControlAdded,{id:n,handler:o},e)}));default:throw e.RuntimeError._createInvalidArgError({argumentName:"eventId"})}},t}();e.officeJsEventRegistration=new t}(r=e._Internal||(e._Internal={}));var k=function(){function e(e,t){this.m_handlersByEventByTarget={},this.m_registerEventImpl=e,this.m_unregisterEventImpl=t}return e.getTargetIdOrDefault=function(e){return G.isNullOrUndefined(e)?"":e},e.prototype.getHandlers=function(t,n){n=e.getTargetIdOrDefault(n);var o=this.m_handlersByEventByTarget[t];o||(o={},this.m_handlersByEventByTarget[t]=o);var r=o[n];return r||(r=[],o[n]=r),r},e.prototype.callHandlers=function(e,t,n){for(var o=this.getHandlers(e,t),r=0;r<o.length;r++)o[r](n)},e.prototype.hasHandlers=function(e,t){return this.getHandlers(e,t).length>0},e.prototype.register=function(e,t,n){if(!n)throw r.RuntimeError._createInvalidArgError({argumentName:"handler"});var o=this.getHandlers(e,t);return o.push(n),1===o.length?this.m_registerEventImpl(e,t):G._createPromiseFromResult(null)},e.prototype.unregister=function(e,t,n){if(!n)throw r.RuntimeError._createInvalidArgError({argumentName:"handler"});for(var o=this.getHandlers(e,t),i=o.length-1;i>=0;i--)if(o[i]===n){o.splice(i,1);break}return 0===o.length?this.m_unregisterEventImpl(e,t):G._createPromiseFromResult(null)},e}();e.EventRegistration=k;var L=function(){function e(){this.m_eventRegistration=new k(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})):i.instance?this.m_ready=G._createPromiseFromResult(null).then((function(){t.m_isReady=!0})):this.m_ready=r.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 o=this;return this.ready().then((function(){return o.m_eventRegistration.register(e,t,n)}))},e.prototype.unregister=function(e,t,n){var o=this;return this.ready().then((function(){return o.m_eventRegistration.unregister(e,t,n)}))},e.prototype._registerEventImpl=function(e,t){return G._createPromiseFromResult(null)},e.prototype._unregisterEventImpl=function(e,t){return G._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==M.eventMessageCategory){l._logEnabled&&l.log(JSON.stringify(n));var o=n.messageType,r=n.targetId;if(this.m_eventRegistration.hasHandlers(o,r)){var i=JSON.parse(n.message);n.isRemoteOverride&&(i.source=M.eventSourceRemote),this.m_eventRegistration.callHandlers(o,r,i)}}}},e.getGenericEventRegistration=function(t){l.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 l.isNullOrUndefined(t)&&(t=""),e.s_genericEventRegistrations[t]},e.richApiMessageEventCategory=65536,e.s_genericEventRegistrations={},e}();e.GenericEventRegistration=L,e._testSetRichApiMessageReadyImpl=function(e){L._testReadyImpl=e},e._testTriggerRichApiMessageEvent=function(e){L.getGenericEventRegistration("")._handleRichApiMessage(e)};var D=function(e){function t(t,n,o,r){var i=e.call(this,t,n,o,r)||this;return i.m_genericEventInfo=r,i}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 L.getGenericEventRegistration(n).isReady||this._context._pendingRequest._addPreSyncPromise(L.getGenericEventRegistration(n).ready()),P.createTraceMarkerForCallback(this._context,(function(){t._handlers.push(e),1==t._handlers.length&&L.getGenericEventRegistration(n).register(t.m_genericEventInfo.eventType,t.m_genericEventInfo.getTargetIdFunc(),t._callback)})),new H(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;P.createTraceMarkerForCallback(this._context,(function(){for(var o=t._handlers,r=o.length-1;r>=0;r--)if(o[r]===e){o.splice(r,1);break}0==o.length&&L.getGenericEventRegistration(n).unregister(t.m_genericEventInfo.eventType,t.m_genericEventInfo.getTargetIdFunc(),t._callback)}))},t.prototype.removeAll=function(){},t}(j);e.GenericEventHandlers=D;var U=function(){function e(e){this.m_clientObject=e}return e.prototype._handleResult=function(e){this.m_clientObject._handleIdResult(e)},e}(),W=function(){function e(){}return e.createGlobalObjectObjectPath=function(e){var t={Id:e._nextId(),ObjectPathType:1,Name:""};return new g(t,null,!1,!1,1,4)},e.createNewObjectObjectPath=function(e,t,n,o){var r={Id:e._nextId(),ObjectPathType:2,Name:t};return new g(r,null,n,!1,1,G._fixupApiFlags(o))},e.createPropertyObjectPath=function(e,t,n,o,r,i){var a={Id:e._nextId(),ObjectPathType:4,Name:n,ParentObjectPathId:t._objectPath.objectPathInfo.Id};return new g(a,t._objectPath,o,r,1,G._fixupApiFlags(i))},e.createIndexerObjectPath=function(e,t,n){var o={Id:e._nextId(),ObjectPathType:5,Name:"",ParentObjectPathId:t._objectPath.objectPathInfo.Id,ArgumentInfo:{}};return o.ArgumentInfo.Arguments=n,new g(o,t._objectPath,!1,!1,1,4)},e.createIndexerObjectPathUsingParentPath=function(e,t,n){var o={Id:e._nextId(),ObjectPathType:5,Name:"",ParentObjectPathId:t.objectPathInfo.Id,ArgumentInfo:{}};return o.ArgumentInfo.Arguments=n,new g(o,t,!1,!1,1,4)},e.createMethodObjectPath=function(e,t,n,o,r,i,a,s,c){var u={Id:e._nextId(),ObjectPathType:3,Name:n,ParentObjectPathId:t._objectPath.objectPathInfo.Id,ArgumentInfo:{}},l=G.setMethodArguments(e,u.ArgumentInfo,r),f=new g(u,t._objectPath,i,a,o,G._fixupApiFlags(c));return f.argumentObjectPaths=l,f.getByIdMethodName=s,f},e.createReferenceIdObjectPath=function(e,t){var n={Id:e._nextId(),ObjectPathType:6,Name:t,ArgumentInfo:{}};return new g(n,null,!1,!1,1,4)},e.createChildItemObjectPathUsingIndexerOrGetItemAt=function(t,n,o,r,i){var a=G.tryGetObjectIdFromLoadOrRetrieveResult(r);return t&&!G.isNullOrUndefined(a)?e.createChildItemObjectPathUsingIndexer(n,o,r):e.createChildItemObjectPathUsingGetItemAt(n,o,r,i)},e.createChildItemObjectPathUsingIndexer=function(e,t,n){var o=G.tryGetObjectIdFromLoadOrRetrieveResult(n),r=r={Id:e._nextId(),ObjectPathType:5,Name:"",ParentObjectPathId:t._objectPath.objectPathInfo.Id,ArgumentInfo:{}};return r.ArgumentInfo.Arguments=[o],new g(r,t._objectPath,!1,!1,1,4)},e.createChildItemObjectPathUsingGetItemAt=function(e,t,n,o){var r=n[M.index];r&&(o=r);var i={Id:e._nextId(),ObjectPathType:3,Name:M.getItemAt,ParentObjectPathId:t._objectPath.objectPathInfo.Id,ArgumentInfo:{}};return i.ArgumentInfo.Arguments=[o],new g(i,t._objectPath,!1,!1,1,4)},e}();e.ObjectPathFactory=W;var B=function(){function t(e){this.m_context=e}return t.prototype.executeAsync=function(n,o,r){var i=this,a=u.buildMessageArrayForIRequestExecutor(n,o,r,t.SourceLibHeaderValue);return new e.Promise((function(e,t){OSF.DDA.RichApi.executeRichApiRequestAsync(a,(function(t){var n;l.log("Response:"),l.log(JSON.stringify(t)),"succeeded"==t.status?n=u.buildResponseOnSuccess(u.getResponseBody(t),u.getResponseHeaders(t)):(n=u.buildResponseOnError(t.error.code,t.error.message),i.m_context._processOfficeJsErrorResponse(t.error.code,n)),e(n)}))}))},t.SourceLibHeaderValue="officejs",t}(),q=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[M.isTracked]&&e!==this.m_context._rootObject&&t&&!G.isNullOrEmptyString(t[M.referenceId])&&(this._autoCleanupList[e._objectPath.objectPathInfo.Id]=e,e[M.isTracked]=!0)},e.prototype._addCommon=function(e,t){if(e[M.isTracked])t&&this.m_context._autoCleanup&&delete this._autoCleanupList[e._objectPath.objectPathInfo.Id];else{var n=e[M.referenceId];if(e._objectPath.objectPathInfo[M.objectPathInfoDoNotKeepReferenceFieldName])throw G.createRuntimeError(a.generalException,l._getResourceString(J.objectIsUntracked),null);G.isNullOrEmptyString(n)&&e._KeepReference&&(e._KeepReference(),P.createInstantiateAction(this.m_context,e),t&&this.m_context._autoCleanup&&delete this._autoCleanupList[e._objectPath.objectPathInfo.Id],e[M.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[M.objectPathInfoDoNotKeepReferenceFieldName]=!0,e.context._pendingRequest._removeKeepReferenceAction(e._objectPath.objectPathInfo.Id);var t=e[M.referenceId];if(!G.isNullOrEmptyString(t)){var n=this.m_context._rootObject;n._RemoveReference&&n._RemoveReference(t)}delete e[M.isTracked]},e.prototype._retrieveAndClearAutoCleanupList=function(){var e=this._autoCleanupList;return this._autoCleanupList={},e},e}();e.TrackedObjects=q;var V=function(){function t(e,t,n,o,r){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=o,this.m_removePII=r}return t.prototype.process=function(){this.m_showDispose&&T._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&&T._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 o=t-5;o<0&&(o=0);var r=t+1+5;r>this.m_statements.length&&(r=this.m_statements.length);var i=[];0!=o&&i.push("...");for(var a=o;a<t;a++)i.push(this.m_statements[a]);i.push("// >>>>>"),i.push(this.m_statements[t]),i.push("// <<<<<");for(var s=t+1;s<r;s++)i.push(this.m_statements[s]);return r<this.m_statements.length&&i.push("..."),{statement:this.m_statements[t],surroundingStatements:i}},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],o=this.getObjVarName(t);if(this.m_declaredObjectPathMap[t]){r="// Instantiate {"+o+"}";r=this.appendDisposeCommentIfRelevant(r,e),this.m_statements.push(r)}else{var r="var "+o+" = "+this.buildObjectPathExpressionWithParent(n)+";";r=this.appendDisposeCommentIfRelevant(r,e),this.m_statements.push(r),this.m_declaredObjectPathMap[t]=o}},t.prototype.processMethodAction=function(t){var n=t.actionInfo.Name;if("_KeepReference"===n){if(!e._internalConfig.showInternalApiInDebugInfo)return;n="track"}var o=this.getObjVarName(t.actionInfo.ObjectPathId)+"."+G._toCamelLowerCase(n)+"("+this.buildArgumentsExpression(t.actionInfo.ArgumentInfo)+");";o=this.appendDisposeCommentIfRelevant(o,t),this.m_statements.push(o)},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)+"."+G._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 o=t.actionInfo.L;if(o&&o.length>0)return e+" // And then dispose {"+o.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 G._toCamelLowerCase(e.Name)+"("+this.buildArgumentsExpression(e.ArgumentInfo)+")";case 2:return e.Name+".newObject()";case 7:return"null";case 4:return G._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=G._toCamelLowerCase(n.objectPathInfo.Name);break;case 3:var o=n.objectPathInfo.Name;o.length>3&&"Get"===o.substr(0,3)&&(o=o.substr(3)),t=G._toCamelLowerCase(o);break;case 5:var r=this.getObjVarNameBase(n.objectPathInfo.ParentObjectPathId);t="s"===r.charAt(r.length-1)?r.substr(0,r.length-1):r+"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}(),J=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}(E);e.ResourceStrings=J,l.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 G=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,o){var r=e._internalConfig.alwaysPolyfillClientObjectRetrieveMethod;r||(r=!n.isSetSupported("RichApiRuntime","1.1"));var i=new N(t,r);return t._retrieve(o,i),i},n.retrieveAndSync=function(e,t){var o=n.retrieve(e,t);return e.context.sync().then((function(){return o}))},n.toJson=function(e,t,o,r){var i={};for(var a in t){void 0!==(s=t[a])&&(i[a]=s)}for(var a in o){var s;void 0!==(s=o[a])&&(s[n.fieldName_isCollection]&&void 0!==s[n.fieldName_m__items]?i[a]=s.toJSON().items:i[a]=s.toJSON())}return r&&(i.items=r.map((function(e){return e.toJSON()}))),i},n.throwError=function(e,t,n){throw new r.RuntimeError({code:e,httpStatusCode:400,message:l._getResourceString(e,t),debugInfo:n?{errorLocation:n}:void 0})},n.createRuntimeError=function(e,t,n,o,i){return new r.RuntimeError({code:e,httpStatusCode:o,message:t,debugInfo:{errorLocation:n},data:i})},n.throwIfNotLoaded=function(e,t,o,r){if(!r&&l.isUndefined(t)&&e.charCodeAt(0)!=n.s_underscoreCharCode&&!n.s_suppressPropertyNotLoadedException)throw n.createPropertyNotLoadedException(o,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 r.RuntimeError({code:C.propertyNotLoaded,httpStatusCode:400,message:l._getResourceString(J.propertyNotLoaded,t),debugInfo:e?{errorLocation:e+"."+t}:void 0})},n.createCannotUpdateReadOnlyPropertyException=function(e,t){return new r.RuntimeError({code:C.cannotUpdateReadOnlyProperty,httpStatusCode:400,message:l._getResourceString(J.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 o=0;o<n.length-1;o+=2)l.isUndefined(t[n[o+1]])||e[n[o]]._handleResult(t[n[o+1]])},n._fixupApiFlags=function(e){return"boolean"==typeof e&&(e=e?1:0),e},n.definePropertyThrowUnloadedException=function(e,t,o){Object.defineProperty(e,o,{configurable:!0,enumerable:!0,get:function(){throw n.createPropertyNotLoadedException(t,o)},set:function(){throw n.createCannotUpdateReadOnlyPropertyException(t,o)}})},n.defineReadOnlyPropertyWithValue=function(e,t,o){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return o},set:function(){throw n.createCannotUpdateReadOnlyPropertyException(null,t)}})},n.processRetrieveResult=function(e,t,o,r){if(!l.isNullOrUndefined(t))if(r){var i=t[M.itemsLowerCase];if(Array.isArray(i)){for(var a=[],s=0;s<i.length;s++){var c=r(i[s],s),u={};u[M.proxy]=c,c._handleRetrieveResult(i[s],u),a.push(u)}n.defineReadOnlyPropertyWithValue(o,M.itemsLowerCase,a)}}else{var f=e[M.scalarPropertyNames],d=e[M.navigationPropertyNames],p=e[M.className];if(f)for(s=0;s<f.length;s++){var h=t[g=f[s]];l.isUndefined(h)?n.definePropertyThrowUnloadedException(o,p,g):n.defineReadOnlyPropertyWithValue(o,g,h)}if(d)for(s=0;s<d.length;s++){var g;h=t[g=d[s]];if(l.isUndefined(h))n.definePropertyThrowUnloadedException(o,p,g);else{var m=e[g],v={};m._handleRetrieveResult(h,v),v[M.proxy]=m,Array.isArray(v[M.itemsLowerCase])&&(v=v[M.itemsLowerCase]),n.defineReadOnlyPropertyWithValue(o,g,v)}}}},n.setMockData=function(e,t,o,r){if(l.isNullOrUndefined(t))e._handleResult(t);else{if(e[M.scalarPropertyOriginalNames]){for(var i={},a=e[M.scalarPropertyOriginalNames],s=e[M.scalarPropertyNames],c=0;c<s.length;c++)void 0!==t[s[c]]&&(i[a[c]]=t[s[c]]);e._handleResult(i)}if(e[M.navigationPropertyNames]){var u=e[M.navigationPropertyNames];for(c=0;c<u.length;c++)if(void 0!==t[u[c]]){var f=e[u[c]];f.setMockData&&f.setMockData(t[u[c]])}}if(e[M.isCollection]&&o){var d=Array.isArray(t)?t:t[M.itemsLowerCase];if(Array.isArray(d)){var p=[];for(c=0;c<d.length;c++){var h=o(d,c);n.setMockData(h,d[c]),p.push(h)}r(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 R;new e(t,W.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}(I);e.Utility=G;var z=function(){function e(){}return e.invokeMethod=function(e,t,n,o,r,i){var a=P.createMethodAction(e.context,e,t,n,o,r),s=new _(i);return G._addActionResultHandler(e,a,s),s},e.invokeEnsureUnchanged=function(e,t){P.createEnsureUnchangedAction(e.context,e,t)},e.invokeSetProperty=function(e,t,n,o){P.createSetPropertyAction(e.context,e,t,n,o)},e.createRootServiceObject=function(e,t){return new e(t,W.createGlobalObjectObjectPath(t))},e.createObjectFromReferenceId=function(e,t,n){return new e(t,W.createReferenceIdObjectPath(t,n))},e.createTopLevelServiceObject=function(e,t,n,o,r){return new e(t,W.createNewObjectObjectPath(t,n,o,r))},e.createPropertyObject=function(e,t,n,o,r){var i=W.createPropertyObjectPath(t.context,t,n,o,!1,r);return new e(t.context,i)},e.createIndexerObject=function(e,t,n){var o=W.createIndexerObjectPath(t.context,t,n);return new e(t.context,o)},e.createMethodObject=function(e,t,n,o,r,i,a,s,c){var u=W.createMethodObjectPath(t.context,t,n,o,r,i,a,s,c);return new e(t.context,u)},e.createChildItemObject=function(e,t,n,o,r){var i=W.createChildItemObjectPathUsingIndexerOrGetItemAt(t,n.context,n,o,r);return new e(n.context,i)},e}();e.BatchApiHelper=z;var Q=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 o=0;o<n.enumTypes.length;o++)this.buildEnumType(n.enumTypes[o]);if(n.apiSets){for(o=0;o<n.apiSets.length;o++){var r=n.apiSets[o];Array.isArray(r)&&(n.apiSets[o]={version:r[0],name:r[1]||this.m_defaultApiSetName})}this.m_apiSets=n.apiSets}if(this.m_strings=n.strings,n.clientObjectTypes)for(o=0;o<n.clientObjectTypes.length;o++){r=n.clientObjectTypes[o];Array.isArray(r)&&(this.ensureArraySize(r,11),n.clientObjectTypes[o]={name:this.getString(r[0]),behaviorFlags:r[1],collectionPropertyPath:this.getString(r[6]),newObjectServerTypeFullName:this.getString(r[9]),newObjectApiFlags:r[10],childItemTypeFullName:this.getString(r[7]),scalarProperties:r[2],navigationProperties:r[3],scalarMethods:r[4],navigationMethods:r[5],events:r[8]}),this.buildClientObjectType(n.clientObjectTypes[o],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 o=0;o<n.length;o++)t.fields[n[o]]=this.toSimpleCamelUpperCase(n[o])}else t=e;this.m_targetNamespaceObject[t.name]=t.fields},t.prototype.buildClientObjectType=function(n,o){var r=this,i=function(t,o){w.apply(this,arguments),r.m_targetNamespaceObject[n.name]._typeInited||(r.buildPrototype(r.m_targetNamespaceObject[n.name],n),r.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]=i,this.extendsType(i,w),this.buildNewObject(i,n),0!=(2&n.behaviorFlags)&&(i.prototype._KeepReference=function(){z.invokeMethod(this,"_KeepReference",1,[],0,0)}),0!=(32&n.behaviorFlags))&&this.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_StaticCustomize").call(null,i);o&&(this.buildPrototype(i,n),i._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,o){for(var r=t,i=o;i<n.length;i++){if("object"!=typeof r)throw new e.Error("Cannot find "+n.join("."));r=r[n[i]]}return r},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(G.isNullOrUndefined(t))return null;var o=t.split(".");if(3===o.length&&"OfficeExtension"===o[0]&&"Constants"===o[1])return M[o[2]];if("this"===o[0]){for(var r=n,i=1;i<o.length;i++)r="toString()"==o[i]?r.toString():"()"===o[i].substr(o[i].length-2)?r[o[i].substr(0,o[i].length-2)]():r[o[i]];return r}throw new e.Error("Cannot evaluate: "+t)},t.prototype.evaluateEventTargetId=function(e,t){return G.isNullOrEmptyString(e)?"":this.evaluateSimpleExpression(e,t)},t.prototype.isAllDigits=function(e){for(var t="0".charCodeAt(0),n="9".charCodeAt(0),o=0;o<e.length;o++)if(e.charCodeAt(o)<t||e.charCodeAt(o)>n)return!1;return!0},t.prototype.evaluateEventType=function(t){if(G.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&&G.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 o=t.scalarProperties[n];Array.isArray(o)&&(this.ensureArraySize(o,6),t.scalarProperties[n]={name:this.getString(o[0]),behaviorFlags:o[1],apiSetInfoOrdinal:o[2],originalName:this.getString(o[3]),setMethodApiFlags:o[4],undoableApiSetInfoOrdinal:o[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=I.calculateApiFlags(e,n.name,n.version))}return e},t.prototype.buildScalarProperty=function(e,n,o){this.ensureOriginalName(o);var r=this,i=this.getFieldName(o),a={get:function(){return G.throwIfNotLoaded(o.name,this[i],n.name,this._isNull),r.throwIfApiNotSupported(n,o),this[i]},enumerable:!0,configurable:!0};0==(2&o.behaviorFlags)&&(a.set=function(e){if(4&o.behaviorFlags&&r.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+o.originalName+"_Set").call(this,this,e).handled)return;this[i]=e;var a=r.calculateApiFlags(o.setMethodApiFlags,o.undoableApiSetInfoOrdinal);z.invokeSetProperty(this,o.originalName,e,a)}),Object.defineProperty(e.prototype,o.name,a)},t.prototype.buildNavigationProperties=function(e,t){if(Array.isArray(t.navigationProperties))for(var n=0;n<t.navigationProperties.length;n++){var o=t.navigationProperties[n];Array.isArray(o)&&(this.ensureArraySize(o,8),t.navigationProperties[n]={name:this.getString(o[0]),behaviorFlags:o[2],apiSetInfoOrdinal:o[3],originalName:this.getString(o[4]),getMethodApiFlags:o[5],setMethodApiFlags:o[6],propertyTypeFullName:this.getString(o[1]),undoableApiSetInfoOrdinal:o[7]}),this.buildNavigationProperty(e,t,t.navigationProperties[n])}},t.prototype.buildNavigationProperty=function(e,n,o){this.ensureOriginalName(o);var r=this,i=this.getFieldName(o),a={get:function(){(this[r.getFieldName(o)]||(r.throwIfApiNotSupported(n,o),this[i]=z.createPropertyObject(r.getFunction(o.propertyTypeFullName),this,o.originalName,0!=(16&o.behaviorFlags),o.getMethodApiFlags)),64&o.behaviorFlags)&&r.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+o.originalName+"_Get").call(this,this,this[i]);return this[i]},enumerable:!0,configurable:!0};0==(2&o.behaviorFlags)&&(a.set=function(e){if(4&o.behaviorFlags&&r.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+o.originalName+"_Set").call(this,this,e).handled)return;this[i]=e;var a=r.calculateApiFlags(o.setMethodApiFlags,o.undoableApiSetInfoOrdinal);z.invokeSetProperty(this,o.originalName,e,a)}),Object.defineProperty(e.prototype,o.name,a)},t.prototype.buildScalarMethods=function(e,t){if(Array.isArray(t.scalarMethods))for(var n=0;n<t.scalarMethods.length;n++){var o=t.scalarMethods[n];Array.isArray(o)&&(this.ensureArraySize(o,7),t.scalarMethods[n]={name:this.getString(o[0]),behaviorFlags:o[2],apiSetInfoOrdinal:o[3],originalName:this.getString(o[5]),apiFlags:o[4],parameterCount:o[1],undoableApiSetInfoOrdinal:o[6]}),this.buildScalarMethod(e,t,t.scalarMethods[n])}},t.prototype.buildScalarMethod=function(e,n,o){this.ensureOriginalName(o);var r=this;e.prototype[o.name]=function(){var e=[];if(64&o.behaviorFlags&&o.parameterCount>0){for(var i=0;i<o.parameterCount-1;i++)e.push(arguments[i]);var a=[];for(i=o.parameterCount-1;i<arguments.length;i++)a.push(arguments[i]);e.push(a)}else for(i=0;i<arguments.length;i++)e.push(arguments[i]);if(1&o.behaviorFlags){var s=r.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+o.originalName),c=[this];for(i=0;i<e.length;i++)c.push(e[i]);var u=s.apply(this,c),l=u.handled,f=u.result;if(l)return f}r.throwIfApiNotSupported(n,o);var d=0;32&o.behaviorFlags&&(d=1);var p=0;2&o.behaviorFlags&&(p=1);var h=r.calculateApiFlags(o.apiFlags,o.undoableApiSetInfoOrdinal);return z.invokeMethod(this,o.originalName,p,e,h,d)}},t.prototype.buildNavigationMethods=function(e,t){if(Array.isArray(t.navigationMethods))for(var n=0;n<t.navigationMethods.length;n++){var o=t.navigationMethods[n];Array.isArray(o)&&(this.ensureArraySize(o,9),t.navigationMethods[n]={name:this.getString(o[0]),behaviorFlags:o[3],apiSetInfoOrdinal:o[4],originalName:this.getString(o[6]),apiFlags:o[5],parameterCount:o[2],returnTypeFullName:this.getString(o[1]),returnObjectGetByIdMethodName:this.getString(o[7]),undoableApiSetInfoOrdinal:o[8]}),this.buildNavigationMethod(e,t,t.navigationMethods[n])}},t.prototype.buildNavigationMethod=function(e,n,o){this.ensureOriginalName(o);var r=this;e.prototype[o.name]=function(){var e=[];if(64&o.behaviorFlags&&o.parameterCount>0){for(var i=0;i<o.parameterCount-1;i++)e.push(arguments[i]);var a=[];for(i=o.parameterCount-1;i<arguments.length;i++)a.push(arguments[i]);e.push(a)}else for(i=0;i<arguments.length;i++)e.push(arguments[i]);if(1&o.behaviorFlags){var s=r.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+o.originalName),c=[this];for(i=0;i<e.length;i++)c.push(e[i]);var u=s.apply(this,c),l=u.handled,f=u.result;if(l)return f}if(r.throwIfApiNotSupported(n,o),0!=(16&o.behaviorFlags))return z.createIndexerObject(r.getFunction(o.returnTypeFullName),this,e);var d=0;2&o.behaviorFlags&&(d=1);var p=r.calculateApiFlags(o.apiFlags,o.undoableApiSetInfoOrdinal);return z.createMethodObject(r.getFunction(o.returnTypeFullName),this,o.originalName,d,e,0!=(4&o.behaviorFlags),0!=(8&o.behaviorFlags),o.returnObjectGetByIdMethodName,p)}},t.prototype.buildHandleResult=function(e,n){var o=this;e.prototype._handleResult=function(e){if(w.prototype._handleResult.call(this,e),!G.isNullOrUndefined(e)){if(G.fixObjectPathIfNecessary(this,e),8&n.behaviorFlags)o.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_HandleResult").call(this,this,e);if(n.scalarProperties)for(var r=0;r<n.scalarProperties.length;r++)G.isUndefined(e[n.scalarProperties[r].originalName])||(0!=(8&n.scalarProperties[r].behaviorFlags)?this[o.getFieldName(n.scalarProperties[r])]=G.adjustToDateTime(e[n.scalarProperties[r].originalName]):this[o.getFieldName(n.scalarProperties[r])]=e[n.scalarProperties[r].originalName]);if(n.navigationProperties){for(var i=[],a=0;a<n.navigationProperties.length;a++)i.push(n.navigationProperties[a].name),i.push(n.navigationProperties[a].originalName);G._handleNavigationPropertyResults(this,e,i)}if(0!=(1&n.behaviorFlags)){var s=o.hasIndexMethod(n);if(!G.isNullOrUndefined(e[M.items])){this.m__items=[];for(var c=e[M.items],u=o.getFunction(n.childItemTypeFullName),l=0;l<c.length;l++){var f=z.createChildItemObject(u,s,this,c[l],l);f._handleResult(c[l]),this.m__items.push(f)}}}}}},t.prototype.buildHandleRetrieveResult=function(e,t){var n=this;e.prototype._handleRetrieveResult=function(e,o){if(w.prototype._handleRetrieveResult.call(this,e,o),!G.isNullOrUndefined(e)){if(t.scalarProperties)for(var r=0;r<t.scalarProperties.length;r++)8&t.scalarProperties[r].behaviorFlags&&(G.isNullOrUndefined(e[t.scalarProperties[r].name])||(e[t.scalarProperties[r].name]=G.adjustToDateTime(e[t.scalarProperties[r].name])));if(1&t.behaviorFlags){var i=n.hasIndexMethod(t),a=n.getFunction(t.childItemTypeFullName),s=this;G.processRetrieveResult(s,e,o,(function(e,t){return z.createChildItemObject(a,i,s,e,t)}))}else G.processRetrieveResult(this,e,o)}}},t.prototype.buildHandleIdResult=function(e,n){var o=this;e.prototype._handleIdResult=function(e){if(w.prototype._handleIdResult.call(this,e),!G.isNullOrUndefined(e)){if(16&n.behaviorFlags)o.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_HandleIdResult").call(this,this,e);if(n.scalarProperties)for(var r=0;r<n.scalarProperties.length;r++){var i=n.scalarProperties[r].originalName;"Id"!==i&&"_Id"!==i&&"_ReferenceId"!==i||G.isNullOrUndefined(e[n.scalarProperties[r].originalName])||(this[o.getFieldName(n.scalarProperties[r])]=e[n.scalarProperties[r].originalName])}}}},t.prototype.buildLoad=function(e,t){e.prototype.load=function(e){return G.load(this,e)}},t.prototype.buildRetrieve=function(e,t){e.prototype.retrieve=function(e){return G.retrieve(this,e)}},t.prototype.buildNewObject=function(e,t){G.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 o=n.hasIndexMethod(t);e.prototype.setMockData=function(e){var r=this;G.setMockData(r,e,(function(e,i){return z.createChildItemObject(n.getFunction(t.childItemTypeFullName),o,r,e,i)}),(function(e){r.m__items=e}))}}else e.prototype.setMockData=function(e){G.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=[],o=[];if(t.scalarProperties)for(var r=0;r<t.scalarProperties.length;r++)0==(2&t.scalarProperties[r].behaviorFlags)&&0!=(1&t.scalarProperties[r].behaviorFlags)?o.push(t.scalarProperties[r].name):n.push(t.scalarProperties[r].name);var i=[];if(t.navigationProperties)for(r=0;r<t.navigationProperties.length;r++)0!=(16&t.navigationProperties[r].behaviorFlags)||0==(1&t.navigationProperties[r].behaviorFlags)||0==(32&t.navigationProperties[r].behaviorFlags)?n.push(t.navigationProperties[r].name):i.push(t.navigationProperties[r].name);0===i.length&&0===o.length||(e.prototype.set=function(e,t){this._recursivelySet(e,t,o,i,n)})}},t.prototype.buildItems=function(e,t){0!=(1&t.behaviorFlags)&&Object.defineProperty(e.prototype,"items",{get:function(){return G.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 o=0;o<t.scalarProperties.length;o++)0!=(1&t.scalarProperties[o].behaviorFlags)&&(e[t.scalarProperties[o].name]=this[n.getFieldName(t.scalarProperties[o])]);var r={};if(t.navigationProperties)for(o=0;o<t.navigationProperties.length;o++)0!=(1&t.navigationProperties[o].behaviorFlags)&&(r[t.navigationProperties[o].name]=this[n.getFieldName(t.navigationProperties[o])]);return G.toJson(this,e,r)}:e.prototype.toJSON=function(){return G.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}),G.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");G.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 o=t.events[n];Array.isArray(o)&&(this.ensureArraySize(o,7),t.events[n]={name:this.getString(o[0]),behaviorFlags:o[1],apiSetInfoOrdinal:o[2],typeExpression:this.getString(o[3]),targetIdExpression:this.getString(o[4]),register:this.getString(o[5]),unregister:this.getString(o[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,o){var r=this,i=this.getOnEventName(o.name),a=this.getFieldName(o);Object.defineProperty(e.prototype,i,{get:function(){if(!this[a]){r.throwIfApiNotSupported(n,o);var e=this,i=null;"null"!==o.register&&(i=this[o.register].bind(this));var s=null;"null"!==o.unregister&&(s=this[o.unregister].bind(this));var c=null;2&o.behaviorFlags&&(c=r.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+o.name+"_EventArgsTransform"));var u=r.evaluateEventType(o.typeExpression);this[a]=new D(this.context,this,o.name,{eventType:u,getTargetIdFunc:function(){return r.evaluateEventTargetId(o.targetIdExpression,e)},registerFunc:i,unregisterFunc:s,eventArgsTransformFunc:function(t){return c&&(t=c.call(e,e,t)),G._createPromiseFromResult(t)}})}return this[a]},enumerable:!0,configurable:!0})},t.prototype.buildV0Event=function(e,n,o){var r=this,i=this.getOnEventName(o.name),a=this.getFieldName(o);Object.defineProperty(e.prototype,i,{get:function(){if(!this[a]){r.throwIfApiNotSupported(n,o);var e=this,i=null;if(G.isNullOrEmptyString(o.register)){var s=r.evaluateEventType(o.typeExpression);i=function(t){var n=r.evaluateEventTargetId(o.targetIdExpression,e);return e.context.eventRegistration.register(s,n,t)}}else if("null"!==o.register){var c=r.getFunction(o.register);i=function(t){return c.call(e,e,t)}}var u=null;if(G.isNullOrEmptyString(o.unregister)){var l=r.evaluateEventType(o.typeExpression);u=function(t){var n=r.evaluateEventTargetId(o.targetIdExpression,e);return e.context.eventRegistration.unregister(l,n,t)}}else if("null"!==o.unregister){var f=r.getFunction(o.unregister);u=function(t){return f.call(e,e,t)}}var d=null;2&o.behaviorFlags&&(d=r.getFunction(t.CustomizationCodeNamespace+"."+n.name+"_"+o.name+"_EventArgsTransform"));this[a]=new j(this.context,this,o.name,{registerFunc:i,unregisterFunc:u,eventArgsTransformFunc:function(t){return d&&(t=d.call(e,e,t)),G._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=Q}(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){}var Excel;__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 o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();!function(e){var t="Excel",n=OfficeExtension.BatchApiHelper.createPropertyObject,o=(OfficeExtension.BatchApiHelper.createMethodObject,OfficeExtension.BatchApiHelper.createIndexerObject,OfficeExtension.BatchApiHelper.createRootServiceObject),r=OfficeExtension.BatchApiHelper.createTopLevelServiceObject,i=(OfficeExtension.BatchApiHelper.createChildItemObject,OfficeExtension.BatchApiHelper.invokeMethod),a=(OfficeExtension.BatchApiHelper.invokeEnsureUnchanged,OfficeExtension.BatchApiHelper.invokeSetProperty,OfficeExtension.Utility.isNullOrUndefined),s=(OfficeExtension.Utility.isUndefined,OfficeExtension.Utility.throwIfNotLoaded,OfficeExtension.Utility.throwIfApiNotSupported),c=OfficeExtension.Utility.load,u=(OfficeExtension.Utility.retrieve,OfficeExtension.Utility.toJson),l=OfficeExtension.Utility.fixObjectPathIfNecessary,f=OfficeExtension.Utility._handleNavigationPropertyResults,d=(OfficeExtension.Utility.adjustToDateTime,OfficeExtension.Utility.processRetrieveResult),p=(OfficeExtension.Utility.setMockData,OfficeExtension.CommonUtility.calculateApiFlags,function(e){function t(t){var n=e.call(this,t)||this;return n.m_customFunctions=A.newObject(n),n.m_container=o(w,n),n._rootObject=n.m_container,n._rootObjectPropertyName="customFunctionsContainer",n._requestFlagModifier=2176,n}return __extends(t,e),Object.defineProperty(t.prototype,"customFunctions",{get:function(){return this.m_customFunctions},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"customFunctionsContainer",{get:function(){return this.m_container},enumerable:!0,configurable:!0}),t.prototype._processOfficeJsErrorResponse=function(e,t){5004===e&&(t.ErrorCode=P.invalidOperationInCellEditMode,t.ErrorMessage=OfficeExtension.Utility._getResourceString(OfficeExtension.ResourceStrings.invalidOperationInCellEditMode))},t}(OfficeExtension.ClientRequestContext));e.Script={_CustomFunctionMetadata:{}};var h,g=function(){function e(e,t,n,o,r,i){this._functionName=e,a(t)||(this._address=t),a(n)||(this._parameterAddresses=n),this._isInValuePreview=o,this.setResult=r,this.setError=i}return Object.defineProperty(e.prototype,"onCanceled",{get:function(){if(!a(this._onCanceled)&&"function"==typeof this._onCanceled)return this._onCanceled},set:function(e){this._onCanceled=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"functionName",{get:function(){return this._functionName},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"address",{get:function(){return this._address},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parameterAddresses",{get:function(){return this._parameterAddresses},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isInValuePreview",{get:function(){return this._isInValuePreview},enumerable:!0,configurable:!0}),e}();e.InvocationContext=g,function(e){e.Info="Medium",e.Error="Unexpected",e.Verbose="Verbose"}(h||(h={}));var m,v=function(e,t){this.Severity=e,this.Message=t},y=function(){function e(){}return e.logEvent=function(t,n,o){if(e.s_shouldLog||OfficeExtension.CoreUtility._logEnabled){var r=t.Severity+" "+t.Message+n;if(o&&(r=r+" "+o),OfficeExtension.Utility.log(r),e.s_shouldLog)switch(t.Severity){case h.Verbose:null!==console.log&&console.log(r);break;case h.Info:null!==console.info&&console.info(r);break;case h.Error:null!==console.error&&console.error(r)}}},e.shouldLog=function(){try{return!a(console)&&!a(window)&&window.name&&"string"==typeof window.name&&JSON.parse(window.name)[e.CustomFunctionLoggingFlag]}catch(e){return OfficeExtension.Utility.log(JSON.stringify(e)),!1}},e.CustomFunctionLoggingFlag="CustomFunctionsRuntimeLogging",e.s_shouldLog=e.shouldLog(),e}();!function(e){e.invalidValue="#VALUE!",e.notAvailable="#N/A",e.divisionByZero="#DIV/0!",e.invalidNumber="#NUM!",e.nullReference="#NULL!",e.invalidName="#NAME?",e.invalidReference="#REF!"}(m=e.ErrorCode||(e.ErrorCode={}));var _=function(e){function t(n,o,r){var i=e.call(this,o||"")||this;return i.type=t.valueType,i.basicType=t.valueType,Object.setPrototypeOf(i,t.prototype),i.code=n||m.invalidValue,i.basicValue=n||m.invalidValue,i.errorSubType=r,i.stack=void 0,i}return __extends(t,e),t.prototype.toJSON=function(){return{valueType:"CustomFunctionError",code:this.code,type:this.type,basicValue:this.basicValue,basicType:this.type,errorSubType:this.errorSubType,message:this._getMessage(),errorType:this._getErrorType()}},t.prototype._getErrorType=function(){switch(this.basicValue){case m.invalidValue:return"Value";case m.divisionByZero:return"Div0";case m.notAvailable:return"NotAvailable";case m.invalidNumber:return"Num";case m.invalidName:return"Name";case m.invalidReference:return"Ref";case m.nullReference:return"Null";default:return}},t.prototype._getMessage=function(){switch(this.basicValue){case m.invalidValue:case m.notAvailable:return""==this.message?void 0:this.message;case m.divisionByZero:case m.invalidNumber:case m.invalidName:case m.invalidReference:case m.nullReference:default:return}},t.valueType="Error",t}(Error);e.CustomFunctionError=_;var b=function(){function e(t,n){this.type=e.valueType,this.basicValue="#VALUE!",this.basicType="Error",Object.setPrototypeOf(this,e.prototype),this.text=t,this.properties=n}return e.prototype.toJSON=function(){return{type:this.type,text:this.text,basicValue:this.basicValue,basicType:this.basicType,properties:this.properties}},e.valueType="Entity",e}();e.CustomFunctionEntity=b;var O=function(){function e(t,n){this.type=e.valueType,this.basicValue=t,this.numberFormat=n}return e.prototype.toJSON=function(){return{type:this.type,basicValue:this.basicValue,numberFormat:this.numberFormat}},e.valueType="FormattedNumber",e}();e.CustomFunctionFormattedNumber=O;var S=function(){function e(t,n,o,r,i){this.type=e.valueType,this.basicValue="#VALUE!",this.basicType="Error",this.address=t,null!=r&&(this.attribution=r),null!=i&&(this.provider=i),null!=n&&(this.altText=n),null!=o&&(this.relatedImagesAddress=o)}return e.prototype.toJSON=function(){return{type:this.type,basicValue:this.basicValue,basicType:this.basicType,address:this.address,altText:this.altText,relatedImagesAddress:this.relatedImagesAddress,attribution:null==this.attribution?void 0:this.attribution.map((function(e){return e.toJSON()})),provider:null==this.provider?void 0:this.provider.toJSON()}},e.valueType="WebImage",e}();e.CustomFunctionWebImage=S;var I=function(){function e(e,t,n,o){null!=e&&(this.licenseAddress=e),null!=t&&(this.licenseText=t),null!=n&&(this.sourceAddress=n),null!=o&&(this.sourceText=o)}return e.prototype.toJSON=function(){return{licenseAddress:this.licenseAddress,licenseText:this.licenseText,sourceAddress:this.sourceAddress,sourceText:this.sourceText}},e}();e.CustomFunctionAttribution=I;var E=function(){function e(e,t,n){this.description=e,null!=t&&(this.logoSourceAddress=t),null!=n&&(this.logoTargetAddress=n)}return e.prototype.toJSON=function(){return{description:this.description,logoSourceAddress:this.logoSourceAddress,logoTargetAddress:this.logoTargetAddress}},e}();e.CustomFunctionProvider=E,e.CreateCustomFunctionInstance=function e(t){if(t instanceof Array)return t.map((function(t){return e(t)}));if(!(t instanceof Object))return t;var n=JSON.parse(t.value);switch(n.type){case b.valueType:return new b(n.text,n.properties);case O.valueType:return new O(n.primitive,n.numberFormat);case _.valueType:return new _(n.primitive,void 0,n.errorSubCode);case S.valueType:return new S(n.address,n.altText,n.relatedImagesAddress,n.attribution,n.provider);case"Double":case"String":case"Boolean":return n.primitive;default:throw OfficeExtension.Utility.createRuntimeError(P.generalException,"message","CustomFunctionProxy.createRichDataFromJsonString")}};var C=function(){function t(){this._whenInit=void 0,this._isInit=!1,this._setResultsDelayMillis=50,this._setResultsOverdueDelayMillis=2e3,this._maxContextSyncExecutionDurationMills=15e3,this._minContextSyncIntervalMills=500,this._smallerMinContextSyncIntervalMills=200,this._maxContextSyncIntervalMills=2e3,this._setResultsLifeMillis=6e4,this._ensureInitRetryDelayMillis=500,this._resultEntryBuffer={},this._resultEntryRetryBuffer={},this._retryBufferBodySize=0,this._isSetResultsTaskScheduled=!1,this._setResultsTaskOverdueTime=0,this._inProgressContextSyncExpectedFinishTime=0,this._batchQuotaMillis=1e3,this._invocationContextMap={},this._maxResultSize=2e6}return t.prototype._initSettings=function(){if("object"==typeof e.Script&&"object"==typeof e.Script._CustomFunctionSettings){if("number"==typeof e.Script._CustomFunctionSettings.setResultsDelayMillis){var t=e.Script._CustomFunctionSettings.setResultsDelayMillis;t=Math.max(0,t),t=Math.min(1e3,t),this._setResultsDelayMillis=t}if("number"==typeof e.Script._CustomFunctionSettings.ensureInitRetryDelayMillis){var n=e.Script._CustomFunctionSettings.ensureInitRetryDelayMillis;n=Math.max(0,n),n=Math.min(2e3,n),this._ensureInitRetryDelayMillis=n}if("number"==typeof e.Script._CustomFunctionSettings.setResultsLifeMillis){var o=e.Script._CustomFunctionSettings.setResultsLifeMillis;o=Math.max(0,o),o=Math.min(6e5,o),this._setResultsLifeMillis=o}if("number"==typeof e.Script._CustomFunctionSettings.batchQuotaMillis){var r=e.Script._CustomFunctionSettings.batchQuotaMillis;r=Math.max(0,r),r=Math.min(1e3,r),this._batchQuotaMillis=r}}},t.prototype.ensureInit=function(e){var t=this;return this._initSettings(),void 0===this._whenInit&&(this._whenInit=OfficeExtension.Utility._createPromiseFromResult(null).then((function(){if(!t._isInit)return e.eventRegistration.register(5,"",t._handleMessage.bind(t))})).then((function(){t._isInit=!0}))),this._isInit||e._pendingRequest._addPreSyncPromise(this._whenInit),this._whenInit},t.prototype.setCustomFunctionInvoker=function(e){"object"==typeof CustomFunctionMappings&&delete CustomFunctionMappings.__delay__,this._invoker=e},t.prototype.setCustomFunctionAssociation=function(e){var t=this;this._customFunctionMappingsUpperCase=void 0,this._association=e,this._association&&this._association.onchange((function(){t._customFunctionMappingsUpperCase=void 0}))},t.prototype._initFromHostBridge=function(e){var t=this;this._initSettings(),e.addHostMessageHandler((function(e){3===e.type?t._handleMessage(e.message):4===e.type&&t._handleSettings(e.message)})),this._isInit=!0,this._whenInit=OfficeExtension.CoreUtility.Promise.resolve()},t.prototype._handleSettings=function(e){OfficeExtension.Utility.log("CustomFunctionProxy._handleSettings:"+JSON.stringify(e)),e&&"object"==typeof e&&(y.s_shouldLog=e[y.CustomFunctionLoggingFlag])},t.prototype._handleMessage=function(e){try{OfficeExtension.Utility.log("CustomFunctionProxy._handleMessage"),OfficeExtension.Utility.checkArgumentNull(e,"args");for(var n=e.entries,o=[],r=[],i=[],a=0;a<n.length;a++)1===n[a].messageCategory&&("string"==typeof n[a].message&&(n[a].message=JSON.parse(n[a].message)),1e3===n[a].messageType?o.push(n[a]):1001===n[a].messageType?r.push(n[a]):1002===n[a].messageType?i.push(n[a]):OfficeExtension.Utility.log("CustomFunctionProxy._handleMessage unknown message type "+n[a].messageType));if(i.length>0&&this._handleMetadataEntries(i),o.length>0){var s=this._batchInvocationEntries(o);s.length>0&&this._invokeRemainingBatchEntries(s,0)}r.length>0&&this._handleCancellationEntries(r)}catch(e){throw t._tryLog(e),e}return OfficeExtension.Utility._createPromiseFromResult(null)},t.toLogMessage=function(e){var t="Unknown Error";if(e)try{e.toString&&(t=e.toString()),t=t+" "+JSON.stringify(e)}catch(e){t="Unexpected Error"}return t},t._tryLog=function(e){var n=t.toLogMessage(e);OfficeExtension.Utility.log(n)},t.prototype._handleMetadataEntries=function(t){for(var n=0;n<t.length;n++){var o=t[n].message;if(a(o))throw OfficeExtension.Utility.createRuntimeError(P.generalException,"message","CustomFunctionProxy._handleMetadataEntries");e.Script._CustomFunctionMetadata[o.functionName]={options:{stream:o.isStream,cancelable:o.isCancelable}}}},t.prototype._handleCancellationEntries=function(e){for(var n=0;n<e.length;n++){var o=e[n].message;if(a(o))throw OfficeExtension.Utility.createRuntimeError(P.generalException,"message","CustomFunctionProxy._handleCancellationEntries");var r=o.invocationId,i=this._invocationContextMap[r];a(i)||(delete this._invocationContextMap[r],y.logEvent(t.CustomFunctionCancellation,i.functionName),a(i.onCanceled)||i.onCanceled())}},t.prototype._transferCustomFunctionError=function(e){var t=this;return e.map((function(e,n){return null===e?e:null!=e.code&&"CustomFunctionError"==e.type?new _(e.code):e instanceof Array?t._transferCustomFunctionError(e):e}))},t.prototype._transferCustomFunctionRichData=function(e){var t=this;return e.map((function(e,n){return e instanceof Array?t._transferCustomFunctionRichData(e):e instanceof Object?JSON.parse(e.value):e}))},t.prototype._batchInvocationEntries=function(n){for(var o=this,r=[],i=function(i){var c,u=n[i].message;if(Array.isArray(u)?(c={invocationId:u[0],functionName:u[1],parameterValues:u[2],address:u[3],flags:u[4],parameterAddresses:null,isInValuePreview:u[6]},a(u[5])||(c.parameterAddresses=u[5])):c=u,a(c))throw OfficeExtension.Utility.createRuntimeError(P.generalException,"message","CustomFunctionProxy._batchInvocationEntries");if(a(c.invocationId)||c.invocationId<0)throw OfficeExtension.Utility.createRuntimeError(P.generalException,"invocationId","CustomFunctionProxy._batchInvocationEntries");if(a(c.functionName))throw OfficeExtension.Utility.createRuntimeError(P.generalException,"functionName","CustomFunctionProxy._batchInvocationEntries");var l=null,f=!1,d=!1,p=!1;if("number"==typeof c.flags)f=0!=(1&c.flags),d=0!=(2&c.flags),p=0!=(4&c.flags),0!=(8&c.flags)&&(c.parameterValues=s._transferCustomFunctionRichData(c.parameterValues)),p&&(c.parameterValues=s._transferCustomFunctionError(c.parameterValues));else{var h=e.Script._CustomFunctionMetadata[c.functionName];if(a(h))return y.logEvent(t.CustomFunctionExecutionNotFoundLog,c.functionName),OfficeExtension.Utility.isSetSupported("CustomFunctions","1.8")?s._setError(c.invocationId,c.isInValuePreview,null,9):s._setError(c.invocationId,c.isInValuePreview,"N/A",1),"continue";f=h.options.cancelable,d=h.options.stream}if(s._invoker&&!s._customFunctionMappingsContains(c.functionName))return s._invokeFunctionUsingInvoker(c),"continue";try{l=s._getFunction(c.functionName)}catch(e){return y.logEvent(t.CustomFunctionExecutionNotFoundLog,c.functionName),OfficeExtension.Utility.isSetSupported("CustomFunctions","1.8")?s._setError(c.invocationId,c.isInValuePreview,e,10):s._setError(c.invocationId,c.isInValuePreview,e,1),"continue"}var m=void 0;if(d||f){var v=void 0,_=void 0;d&&(v=function(e){o._invocationContextMap[c.invocationId]?o._setResult(c.invocationId,c.isInValuePreview,e):y.logEvent(t.CustomFunctionAlreadyCancelled,c.functionName)},_=function(e){o._invocationContextMap[c.invocationId]?o._setError(c.invocationId,c.isInValuePreview,e.message,o._getCustomFunctionResultErrorCodeFromErrorCode(e.code)):y.logEvent(t.CustomFunctionAlreadyCancelled,c.functionName)}),m=new g(c.functionName,c.address,c.parameterAddresses,c.isInValuePreview,v,_),s._invocationContextMap[c.invocationId]=m}else m=new g(c.functionName,c.address,c.parameterAddresses,c.isInValuePreview);c.parameterValues.push(m),r.push({call:l,isBatching:!1,isStreaming:d,invocationIds:[c.invocationId],parameterValueSets:[c.parameterValues],functionName:c.functionName,isInValuePreview:c.isInValuePreview})},s=this,c=0;c<n.length;c++)i(c);return r},t.prototype._invokeFunctionUsingInvoker=function(e){var t=this,n=0!=(1&e.flags),o=0!=(2&e.flags),r=e.invocationId,i=void 0,a=void 0;if(o)i=function(n){t._invocationContextMap[r]&&t._setResult(r,e.isInValuePreview,n)},a=function(n){t._invocationContextMap[r]&&t._setError(r,e.isInValuePreview,n.message,t._getCustomFunctionResultErrorCodeFromErrorCode(n.code))};else{var s=!1;i=function(n){s||t._setResult(r,e.isInValuePreview,n),s=!0},a=function(n){s||t._setError(r,e.isInValuePreview,n.message,t._getCustomFunctionResultErrorCodeFromErrorCode(n.code)),s=!0}}var c=new g(e.functionName,e.address,e.parameterAddresses,e.isInValuePreview,i,a);(o||n)&&(this._invocationContextMap[r]=c),this._invoker.invoke(e.functionName,e.parameterValues,c)},t.prototype._ensureCustomFunctionMappingsUpperCase=function(){if(a(this._customFunctionMappingsUpperCase)){if(this._customFunctionMappingsUpperCase={},"object"==typeof CustomFunctionMappings)for(var e in OfficeExtension.CoreUtility.log("CustomFunctionMappings.Keys="+JSON.stringify(Object.keys(CustomFunctionMappings))),CustomFunctionMappings)this._customFunctionMappingsUpperCase[e.toUpperCase()]&&y.logEvent(t.CustomFunctionDuplicatedName,e),this._customFunctionMappingsUpperCase[e.toUpperCase()]=CustomFunctionMappings[e];if(this._association)for(var e in OfficeExtension.CoreUtility.log("CustomFunctionAssociateMappings.Keys="+JSON.stringify(Object.keys(this._association.mappings))),this._association.mappings)this._customFunctionMappingsUpperCase[e.toUpperCase()]&&y.logEvent(t.CustomFunctionDuplicatedName,e),this._customFunctionMappingsUpperCase[e.toUpperCase()]=this._association.mappings[e]}},t.prototype._customFunctionMappingsContains=function(e){this._ensureCustomFunctionMappingsUpperCase();var t=e.toUpperCase();if(!a(this._customFunctionMappingsUpperCase[t]))return!0;if("undefined"!=typeof window){for(var n=window,o=e.split("."),r=0;r<o.length-1;r++)if(n=n[o[r]],a(n)||"object"!=typeof n)return!1;if("function"==typeof n[o[o.length-1]])return!0}return!1},t.prototype._getCustomFunctionMappings=function(e){this._ensureCustomFunctionMappingsUpperCase();var t=e.toUpperCase();if(!a(this._customFunctionMappingsUpperCase[t])){if("function"==typeof this._customFunctionMappingsUpperCase[t])return this._customFunctionMappingsUpperCase[t];throw OfficeExtension.Utility.createRuntimeError(P.invalidOperation,OfficeExtension.Utility._getResourceString(OfficeExtension.ResourceStrings.customFunctionInvalidFunctionMapping,e),"CustomFunctionProxy._getCustomFunctionMappings")}},t.prototype._getFunction=function(e){return this._getCustomFunctionMappings(e)},t.prototype._invokeRemainingBatchEntries=function(e,t,n){void 0===n&&(n=-1),OfficeExtension.Utility.log("CustomFunctionProxy._invokeRemainingBatchEntries");for(var o=Date.now(),r=t;r<e.length;r++){if(!(Date.now()-o<this._batchQuotaMillis)){OfficeExtension.Utility.log("setTimeout(CustomFunctionProxy._invokeRemainingBatchEntries)"),setTimeout(this._invokeRemainingBatchEntries.bind(this),0,e,r,n>0?n:o);break}this._invokeFunctionAndSetResult(e[r],n>0?n:o)}},t.prototype._invokeFunctionAndSetResult=function(e,n){var o,r=this;y.logEvent(t.CustomFunctionExecutionStartLog,e.functionName);var i=Date.now(),s=i-n;try{o=e.isBatching?e.call.call(null,e.parameterValueSets):[e.call.apply(null,e.parameterValueSets[0])]}catch(n){var c=[];c.push(Date.now()-i),A.isFeatureEnabled(6)&&c.push(s);for(var u=0;u<e.invocationIds.length;u++)n instanceof _?this._setErrorWithOutboundData(e.invocationIds[u],e.isInValuePreview,n.message,this._getCustomFunctionResultErrorCodeFromErrorCode(n.code),c):this._setErrorWithOutboundData(e.invocationIds[u],e.isInValuePreview,n,2,c);return void y.logEvent(t.CustomFunctionExecutionExceptionThrownLog,e.functionName,t.toLogMessage(n))}var l=[];if(A.isFeatureEnabled(3)||l.push(Date.now()-i),e.isStreaming);else if(o.length===e.parameterValueSets.length){var f=function(n){a(o[n])||"object"!=typeof o[n]||"function"!=typeof o[n].then?(A.isFeatureEnabled(3)&&(l.push(Date.now()-i),A.isFeatureEnabled(6)&&l.push(s)),y.logEvent(t.CustomFunctionExecutionFinishLog,e.functionName),d._setResultWithOutboundData(e.invocationIds[n],e.isInValuePreview,o[n],l)):o[n].then((function(o){A.isFeatureEnabled(3)&&(l.push(Date.now()-i),A.isFeatureEnabled(6)&&l.push(s)),y.logEvent(t.CustomFunctionExecutionFinishLog,e.functionName),r._setResultWithOutboundData(e.invocationIds[n],e.isInValuePreview,o,l)}),(function(o){A.isFeatureEnabled(3)&&(l.push(Date.now()-i),A.isFeatureEnabled(6)&&l.push(s)),y.logEvent(t.CustomFunctionExecutionRejectedPromoseLog,e.functionName,t.toLogMessage(o)),o instanceof _?r._setErrorWithOutboundData(e.invocationIds[n],e.isInValuePreview,o,r._getCustomFunctionResultErrorCodeFromErrorCode(o.code),l):r._setErrorWithOutboundData(e.invocationIds[n],e.isInValuePreview,o,3,l)}))},d=this;for(u=0;u<o.length;u++)f(u)}else{A.isFeatureEnabled(3)&&(l.push(Date.now()-i),A.isFeatureEnabled(6)&&l.push(s)),y.logEvent(t.CustomFunctionExecutionBatchMismatchLog,e.functionName);for(u=0;u<e.invocationIds.length;u++)this._setErrorWithOutboundData(e.invocationIds[u],e.isInValuePreview,OfficeExtension.Utility._getResourceString(OfficeExtension.ResourceStrings.customFunctionUnexpectedNumberOfEntriesInResultBatch),4,l)}},t.prototype._setResult=function(e,t,n){var o=[];o.push(0),this._setResultWithOutboundData(e,t,n,o)},t.prototype._setResultWithOutboundData=function(e,n,o,r){var i={id:e,value:o,outboundData:r};"number"==typeof o?isNaN(o)?(i.failed=!0,i.value="NaN"):isFinite(o)||(i.failed=!0,i.value="Infinity",i.errorCode=6):o instanceof _||o instanceof b||o instanceof O||o instanceof S?(i.failed=!1,i.value=o.toJSON()):o instanceof Error&&(i.failed=!0,i.value=t.toLogMessage(o),i.errorCode=0);var a=Date.now();this._resultEntryBuffer[e]={timeCreated:a,allowImmediateExecution:n,result:i},this._ensureSetResultsTaskIsScheduled(a)},t.prototype._setError=function(e,t,n,o){var r=[];r.push(0),this._setErrorWithOutboundData(e,t,n,o,r)},t.prototype._setErrorWithOutboundData=function(e,t,n,o,r){var i="";a(n)||(n instanceof _&&!a(n.message)?i=n.message:"string"==typeof n&&(i=n));var s={id:e,failed:!0,value:i,errorCode:o,outboundData:r},c=Date.now();this._resultEntryBuffer[e]={timeCreated:c,allowImmediateExecution:t,result:s},this._ensureSetResultsTaskIsScheduled(c)},t.prototype._getCustomFunctionResultErrorCodeFromErrorCode=function(e){var t;switch(e){case m.notAvailable:t=1;break;case m.divisionByZero:t=5;break;case m.invalidValue:t=7;break;case m.invalidNumber:t=6;break;case m.nullReference:t=8;break;default:t=7}return t},t.prototype._ensureSetResultsTaskIsScheduled=function(e){if(this._setResultsTaskOverdueTime>0&&e>this._setResultsTaskOverdueTime)return OfficeExtension.Utility.log("SetResultsTask overdue"),void this._executeSetResultsTask();this._isSetResultsTaskScheduled||(OfficeExtension.Utility.log("setTimeout(CustomFunctionProxy._executeSetResultsTask)"),setTimeout(this._executeSetResultsTask.bind(this),this._setResultsDelayMillis),this._isSetResultsTaskScheduled=!0,this._setResultsTaskOverdueTime=e+this._setResultsDelayMillis+this._setResultsOverdueDelayMillis)},t.prototype._convertCustomFunctionInvocationResultToArray=function(e){var t=[];return t.push(e.id),t.push(!e.failed),OfficeExtension.CoreUtility.isUndefined(e.value)?t.push(null):t.push(e.value),e.failed&&(OfficeExtension.CoreUtility.isUndefined(e.errorCode)?t.push(0):t.push(e.errorCode)),OfficeExtension.Utility.isSetSupported("CustomFunctions","1.9")&&t.push(e.outboundData),t},t.prototype._executeSetResultsTask=function(){var e=this;OfficeExtension.Utility.log("CustomFunctionProxy._executeSetResultsTask");var t=Date.now();if(this._inProgressContextSyncExpectedFinishTime>0&&this._inProgressContextSyncExpectedFinishTime>t)return OfficeExtension.Utility.log("context.sync() is in progress. setTimeout(CustomFunctionProxy._executeSetResultsTask)"),setTimeout(this._executeSetResultsTask.bind(this),this._setResultsDelayMillis),void(this._setResultsTaskOverdueTime=t+this._setResultsDelayMillis+this._setResultsOverdueDelayMillis);this._isSetResultsTaskScheduled=!1,this._setResultsTaskOverdueTime=0;var n={},o=!1;A.isFeatureEnabled(1)&&Object.keys(this._resultEntryRetryBuffer).length>0?(n=this._resultEntryRetryBuffer,this._resultEntryRetryBuffer={},this._retryBufferBodySize=2,o=!0):(n=this._resultEntryBuffer,this._resultEntryBuffer={});var r=OfficeExtension.Utility.isSetSupported("CustomFunctions","1.7"),i=[],a=[];for(var s in n)n[s].allowImmediateExecution?(r?a.push(this._convertCustomFunctionInvocationResultToArray(n[s].result)):a.push(n[s].result),delete n[s]):r?i.push(this._convertCustomFunctionInvocationResultToArray(n[s].result)):i.push(n[s].result);if(0!==i.length||0!==a.length){var c=new p;c._requestFlagModifier|=16384,a.length>0&&(c._requestFlagModifier|=8192,this._restoreResultEntries(t,n),i=a),r?c.customFunctions.setInvocationArrayResults(i):c.customFunctions.setInvocationResults(i);var u=Date.now();this._inProgressContextSyncExpectedFinishTime=u+this._maxContextSyncExecutionDurationMills,c.sync().then((function(t){var n=Date.now();e._clearInProgressContextSyncExpectedFinishTimeAfterMinInterval(n-u),o&&e._ensureSetResultsTaskIsScheduled(n)}),(function(t){var o=Date.now();e._clearInProgressContextSyncExpectedFinishTimeAfterMinInterval(o-u),A.isFeatureEnabled(1)&&t.code==OfficeExtension.ErrorCodes.requestPayloadSizeLimitExceeded?e._restoreAndSliceResultEntries(o,n):e._restoreResultEntries(o,n),e._ensureSetResultsTaskIsScheduled(o)}))}},t.prototype._restoreResultEntries=function(e,t){for(var n in t){var o=t[n];e-o.timeCreated<=this._setResultsLifeMillis&&(this._resultEntryBuffer[n]||(this._resultEntryBuffer[n]=o))}},t.prototype._restoreAndSliceResultEntries=function(e,t){for(var n in t){var o=t[n],r=void 0;if(e-o.timeCreated<=this._setResultsLifeMillis&&!this._resultEntryBuffer[n]){try{r=JSON.stringify(this._convertCustomFunctionInvocationResultToArray(o.result)).length+1}catch(e){this._resultEntryBuffer[n]=o,OfficeExtension.Utility.log("Result can't pass in JSON.stringify");continue}this._retryBufferBodySize+r<this._maxResultSize?(this._resultEntryRetryBuffer[n]=o,this._retryBufferBodySize+=r):this._resultEntryBuffer[n]=o}}},t.prototype._clearInProgressContextSyncExpectedFinishTimeAfterMinInterval=function(e){var t=this,n=A.isFeatureEnabled(2)?this._smallerMinContextSyncIntervalMills:this._minContextSyncIntervalMills,o=Math.max(n,2*e),r=A.isFeatureEnabled(4)?Math.min(this._maxContextSyncIntervalMills,o):o;OfficeExtension.Utility.log("setTimeout(clearInProgressContestSyncExpectedFinishedTime,"+o+")"),setTimeout((function(){OfficeExtension.Utility.log("clearInProgressContestSyncExpectedFinishedTime"),t._inProgressContextSyncExpectedFinishTime=0}),r)},t.CustomFunctionExecutionStartLog=new v(h.Verbose,"CustomFunctions [Execution] [Begin] Function="),t.CustomFunctionExecutionFailureLog=new v(h.Error,"CustomFunctions [Execution] [End] [Failure] Function="),t.CustomFunctionExecutionRejectedPromoseLog=new v(h.Error,"CustomFunctions [Execution] [End] [Failure] [RejectedPromise] Function="),t.CustomFunctionExecutionExceptionThrownLog=new v(h.Error,"CustomFunctions [Execution] [End] [Failure] [ExceptionThrown] Function="),t.CustomFunctionExecutionBatchMismatchLog=new v(h.Error,"CustomFunctions [Execution] [End] [Failure] [BatchMismatch] Function="),t.CustomFunctionExecutionFinishLog=new v(h.Info,"CustomFunctions [Execution] [End] [Success] Function="),t.CustomFunctionExecutionNotFoundLog=new v(h.Error,"CustomFunctions [Execution] [NotFound] Function="),t.CustomFunctionCancellation=new v(h.Info,"CustomFunctions [Cancellation] Function="),t.CustomFunctionAlreadyCancelled=new v(h.Info,"CustomFunctions [AlreadyCancelled] Function="),t.CustomFunctionDuplicatedName=new v(h.Error,"CustomFunctions [DuplicatedName] Function="),t.CustomFunctionInvalidArg=new v(h.Error,"CustomFunctions [InvalidArg] Name="),t}();e.CustomFunctionProxy=C,e.customFunctionProxy=new C,e.setCustomFunctionAssociation=e.customFunctionProxy.setCustomFunctionAssociation.bind(e.customFunctionProxy),e.setCustomFunctionInvoker=e.customFunctionProxy.setCustomFunctionInvoker.bind(e.customFunctionProxy),OfficeExtension.HostBridge.onInited((function(t){e.customFunctionProxy._initFromHostBridge(t)}));var A=function(n){function o(){return null!==n&&n.apply(this,arguments)||this}return __extends(o,n),Object.defineProperty(o.prototype,"_className",{get:function(){return"CustomFunctions"},enumerable:!0,configurable:!0}),o.isFeatureEnabled=function(e){return this._enabledFeature instanceof Array&&this._enabledFeature.indexOf(e)>=0},o.initialize=function(){var t=this,n=new p;return e.customFunctionProxy.ensureInit(n).then((function(){var r;return n.customFunctions._SetOsfControlContainerReadyForCustomFunctions(),OfficeExtension.Utility.isSetSupported("CustomFunctions","1.9")&&(r=n.customFunctions._GetEnabledFeatures()),OfficeExtension.Utility.log("OsfControl activation lifecycle: Set OsfControlContainer ready for CustomFunctions"),n._customData="SetOsfControlContainerReadyForCustomFunctions",n.sync().then((function(){a(r)||(t._enabledFeature=r.value)})).catch((function(t){!function(t,n){var r=t instanceof OfficeExtension.Error&&t.code===P.invalidOperationInCellEditMode;if(OfficeExtension.CoreUtility.log("Error on starting custom functions: "+t),r){OfficeExtension.CoreUtility.log("Was in cell-edit mode, will try again");var i=e.customFunctionProxy._ensureInitRetryDelayMillis;return new OfficeExtension.CoreUtility.Promise((function(e){return setTimeout(e,i)})).then((function(){return o.initialize()}))}if(n)throw t}(t,!0)}))}))},o.logRuntime=function(e,t){var n=new p;n.customFunctions.logCustomFunctionsRuntime(e,t),n.sync()},o.prototype.logCustomFunctionsRuntime=function(e,n){s("CustomFunctions.logCustomFunctionsRuntime","CustomFunctions","1.6",t),i(this,"LogCustomFunctionsRuntime",1,[e,n],4,0)},o.prototype.setInvocationArrayResults=function(e){i(this,"SetInvocationArrayResults",0,[e],2,0)},o.prototype.setInvocationResults=function(e){i(this,"SetInvocationResults",0,[e],2,0)},o.prototype._GetEnabledFeatures=function(){return i(this,"_GetEnabledFeatures",1,[],4,0)},o.prototype._SetInvocationError=function(e,t){i(this,"_SetInvocationError",0,[e,t],2,0)},o.prototype._SetInvocationResult=function(e,t){i(this,"_SetInvocationResult",0,[e,t],2,0)},o.prototype._SetOsfControlContainerReadyForCustomFunctions=function(){i(this,"_SetOsfControlContainerReadyForCustomFunctions",0,[],10,0)},o.prototype._handleResult=function(e){(n.prototype._handleResult.call(this,e),a(e))||l(this,e)},o.prototype._handleRetrieveResult=function(e,t){n.prototype._handleRetrieveResult.call(this,e,t),d(this,e,t)},o.newObject=function(t){return r(e.CustomFunctions,t,"Microsoft.ExcelServices.CustomFunctions",!1,4)},o.prototype.toJSON=function(){return u(this,{},{})},o}(OfficeExtension.ClientObject);e.CustomFunctions=A;var P,w=function(o){function r(){return null!==o&&o.apply(this,arguments)||this}return __extends(r,o),Object.defineProperty(r.prototype,"_className",{get:function(){return"CustomFunctionsContainer"},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"_navigationPropertyNames",{get:function(){return["customFunctions"]},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"customFunctions",{get:function(){return s("CustomFunctionsContainer.customFunctions","CustomFunctions","1.2",t),this._C||(this._C=n(e.CustomFunctions,this,"CustomFunctions",!1,4)),this._C},enumerable:!0,configurable:!0}),r.prototype._handleResult=function(e){if(o.prototype._handleResult.call(this,e),!a(e)){var t=e;l(this,t),f(this,t,["customFunctions","CustomFunctions"])}},r.prototype.load=function(e){return c(this,e)},r.prototype._handleRetrieveResult=function(e,t){o.prototype._handleRetrieveResult.call(this,e,t),d(this,e,t)},r.prototype.toJSON=function(){return u(this,{},{})},r}(OfficeExtension.ClientObject);e.CustomFunctionsContainer=w,function(e){e.generalException="GeneralException",e.invalidOperation="InvalidOperation",e.invalidOperationInCellEditMode="InvalidOperationInCellEditMode"}(P||(P={}))}(Excel||(Excel={})),function(e){!function(e){function t(){try{if(void 0!==OSF&&void 0!==OSF.isOfficeReactNative&&OSF.isOfficeReactNative())return!0}catch(e){}return!1}function n(){var e="web";try{void 0!==OSF&&void 0!==OSF._OfficeAppFactory&&void 0!==OSF._OfficeAppFactory.getHostInfo&&(e=OSF._OfficeAppFactory.getHostInfo().hostPlatform)}catch(e){}return e}e.isNativeStorage=function(){var e=n();return!(function(){try{if(void 0!==OSF&&void 0!==OSF._OfficeAppFactory&&void 0!==OSF._OfficeAppFactory.getHostInfo&&OSF._OfficeAppFactory.getHostInfo().flags&OSF.HostInfoFlags.SharedApp)return!0}catch(e){}return!1}()||!(t()||"win32"===e||"mac"===e&&window._useSDXSandbox))},e.isNativeApiInfomation=function(){var e=n();return!!(t()||"win32"===e||"mac"===e&&window._useSDXSandbox)},e.isNativeDialog=function(){var e=n();return!(!t()&&"win32"!==e)}}(e.ApiHelper||(e.ApiHelper={}))}(OfficeRuntime||(OfficeRuntime={})),function(e){e.ApiHelper.isNativeApiInfomation()?e.apiInformation=t:e.apiInformation=n;var t={isSetSupported:function(e,t){if("string"!=typeof e)return!1;if(null==t&&(t="0.0.0"),void 0===global.__apiSets)return!1;var n=global.__apiSets,r=Object.keys(n).map((function(e){return e.toLowerCase()})).indexOf(e.toLowerCase());if(r>-1){var i=n[Object.keys(n)[r]];try{var a=o(t),s=void 0;if((s=Array.isArray(i)?function(e,t){for(var n=0;n<e.length;n++){var r=o(e[n]);if(r.major==t)return r}return{major:0,minor:0,patch:0}}(i,a.major):o(i)).major>0){if(s.major>a.major)return!0;if(s.major==a.major&&s.minor>a.minor)return!0;if(s.major==a.major&&s.minor==a.minor&&s.patch>=a.patch)return!0}}catch(e){return!1}}return!1}},n={isSetSupported:function(e,t){try{return!!(Office&&Office.context&&Office.context.requirements)&&Office.context.requirements.isSetSupported(e,Number(t))}catch(e){return!1}}};function o(e){var t=e.split("."),n=0,o=0,r=0;if(t.length<2&&isNaN(Number(e)))throw"version format incorrect";if(n=Number(t[0]),t.length>=2&&(o=Number(t[1])),t.length>=3&&(r=Number(t[2])),isNaN(n)||isNaN(o)||isNaN(r))throw"version format incorrect";return{major:n,minor:o,patch:r}}}(OfficeRuntime||(OfficeRuntime={}));var OfficeRuntime,CustomFunctions;__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 o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();!function(e){OfficeExtension.BatchApiHelper.createPropertyObject,OfficeExtension.BatchApiHelper.createMethodObject,OfficeExtension.BatchApiHelper.createIndexerObject,OfficeExtension.BatchApiHelper.createRootServiceObject;var t=OfficeExtension.BatchApiHelper.createTopLevelServiceObject,n=(OfficeExtension.BatchApiHelper.createChildItemObject,OfficeExtension.BatchApiHelper.invokeMethod),o=(OfficeExtension.BatchApiHelper.invokeEnsureUnchanged,OfficeExtension.BatchApiHelper.invokeSetProperty,OfficeExtension.Utility.isNullOrUndefined),r=(OfficeExtension.Utility.isUndefined,OfficeExtension.Utility.throwIfNotLoaded,OfficeExtension.Utility.throwIfApiNotSupported,OfficeExtension.Utility.load,OfficeExtension.Utility.retrieve,OfficeExtension.Utility.toJson),i=OfficeExtension.Utility.fixObjectPathIfNecessary,a=(OfficeExtension.Utility._handleNavigationPropertyResults,OfficeExtension.Utility.adjustToDateTime,OfficeExtension.Utility.processRetrieveResult),s=(OfficeExtension.Utility.setMockData,OfficeExtension.CommonUtility.calculateApiFlags,function(e){this._dialogService=e});e.Dialog=s;var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.close=function(){return this._dialogService.close(),OfficeExtension.CoreUtility.Promise.resolve()},t}(s),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.close=function(){return this._dialogService.close(),this._dialogService.context.sync()},t}(s);function l(e){return/^(\-|\+)?([0-9]+)%?$/.test(e)}function f(e){var t,n=((t={})[12002]={code:"InvalidUrl",message:"Cannot load URL, no such page or bad URL syntax."},t[12003]={code:"InvalidUrl",message:"HTTPS is required."},t[12004]={code:"Untrusted",message:"Domain is not trusted."},t[12005]={code:"InvalidUrl",message:"HTTPS is required."},t[12007]={code:"FailedToOpen",message:"Another dialog is already opened."},t);return n[e]?n[e]:{code:"Unknown",message:"An unknown error has occured with code: "+e}}e.displayWebDialog=function(t,n){return void 0===n&&(n={}),new OfficeExtension.CoreUtility.Promise((function(o,r){if(n.width&&n.height&&(!l(n.width)||!l(n.height)))throw new OfficeExtension.Error({code:"InvalidArgument",message:'Dimensions must be "number%" or number.'});var i={width:n.width?parseInt(n.width):50,height:n.height?parseInt(n.height):50,displayInIFrame:n.displayInIFrame};e.ApiHelper.isNativeDialog()?function(e,t,n,o,r){void 0===r&&(r={});var i=new OfficeExtension.ClientRequestContext,a=p.newObject(i),s=new u(a),c=a.onDialogMessage.add((function(e){switch(OfficeExtension.Utility.log("dialogMessageHandler:"+JSON.stringify(e)),e.type){case 17:e.error?n(e.error):t(s);break;case 12:r.onMessage&&r.onMessage(e.message,s);break;case 10:default:12006===e.originalErrorCode?(c&&(c.remove(),i.sync()),r.onClose&&r.onClose()):r.onRuntimeError&&(r.onRuntimeError(e.error,s),n(e.error))}return OfficeExtension.CoreUtility.Promise.resolve()}));i.sync().then((function(){return a.displayDialog(o,e),i.sync()})).catch((function(e){n(e)}))}(i,o,r,t,n):function(e,t,n,o,r){void 0===r&&(r={});var i;function a(e){"failed"===e.status?n(new OfficeExtension.Error(f(e.error.code))):((i=e.value).addEventHandler(Office.EventType.DialogMessageReceived,s),i.addEventHandler(Office.EventType.DialogEventReceived,u),t(new c(i)))}function s(e){r.onMessage&&r.onMessage(e.message,i,e.origin)}function u(e){12006===e.error?r.onClose&&r.onClose():r.onRuntimeError&&r.onRuntimeError(new OfficeExtension.Error(f(e.error)),i)}Office.context.ui.displayDialogAsync(o,e,a)}(i,o,r,t,n)}))};var d,p=function(s){function c(){return null!==s&&s.apply(this,arguments)||this}return __extends(c,s),Object.defineProperty(c.prototype,"_className",{get:function(){return"DialogService"},enumerable:!0,configurable:!0}),c.prototype.close=function(){n(this,"Close",1,[],4,0)},c.prototype.displayDialog=function(e,t){n(this,"DisplayDialog",1,[e,t],4,0)},c.prototype._handleResult=function(e){(s.prototype._handleResult.call(this,e),o(e))||i(this,e)},c.prototype._handleRetrieveResult=function(e,t){s.prototype._handleRetrieveResult.call(this,e,t),a(this,e,t)},c.newObject=function(n){return t(e.DialogService,n,"Microsoft.Dialog.DialogService",!1,4)},Object.defineProperty(c.prototype,"onDialogMessage",{get:function(){return this.m_dialogMessage||(this.m_dialogMessage=new OfficeExtension.GenericEventHandlers(this.context,this,"DialogMessage",{eventType:65536,registerFunc:function(){},unregisterFunc:function(){},getTargetIdFunc:function(){return null},eventArgsTransformFunc:function(e){var t;try{var n=JSON.parse(e.message),o=n.errorCode?new OfficeExtension.Error(f(n.errorCode)):null;t={originalErrorCode:n.errorCode,type:n.type,error:o,message:n.message,origin:n.origin}}catch(e){t={originalErrorCode:null,type:17,error:new OfficeExtension.Error({code:"GenericException",message:"Unknown error"}),message:e.message}}return OfficeExtension.Utility._createPromiseFromResult(t)}})),this.m_dialogMessage},enumerable:!0,configurable:!0}),c.prototype.toJSON=function(){return r(this,{},{})},c}(OfficeExtension.ClientObject);e.DialogService=p,function(e){e[e.dialogMessageReceived=0]="dialogMessageReceived",e[e.dialogEventReceived=1]="dialogEventReceived"}(d||(d={})),function(e){e.generalException="GeneralException"}(e.DialogErrorCodes||(e.DialogErrorCodes={}))}(OfficeRuntime||(OfficeRuntime={})),function(e){!function(e){function t(e,t){try{var n=Microsoft.Office.WebExtension.FeatureGates[e];return null==n?t:"true"===n.toString().toLowerCase()}catch(e){return t}}function n(e,t){try{var n=Microsoft.Office.WebExtension.FeatureGates,o=parseInt(n[e]);return isNaN(o)?t:o}catch(e){return t}}function o(e,t){try{var n=Microsoft.Office.WebExtension.FeatureGates[e];return null==n?t:n}catch(e){return t}}e.getBooleanFeatureGate=t,e.getIntFeatureGate=n,e.getStringFeatureGate=o,e.getBooleanFeatureGateAsync=function(e,n){return Promise.resolve(t(e,n))},e.getIntFeatureGateAsync=function(e,t){return Promise.resolve(n(e,t))},e.getStringFeatureGateAsync=function(e,t){return Promise.resolve(o(e,t))}}(e.experimentation||(e.experimentation={}))}(OfficeRuntime||(OfficeRuntime={})),function(e){!function(e){var n={};function o(e){var t=e.eventName,o=e.message;n.hasOwnProperty(t)&&n[t].call(o)}e.on=function(e,r){return function(e,r){n.hasOwnProperty(e)||(n[e]=new t,function(){Office&&Office.context&&Office.context.messaging&&!Office.context.messaging.onMessage&&(Office.context.messaging.onMessage=o.bind(this))}());n[e].add(r)}(e,r),new Promise((function(e){e()}))},e.off=function(e,t){return function(e,t){n.hasOwnProperty(e)&&(t?n[e].remove(t):delete n[e])}(e,t),new Promise((function(e){e()}))},e.emit=function(e,t){return function(e,t){var n={eventName:e,message:t};Office&&Office.context&&Office.context.messaging&&Office.context.messaging.sendMessage&&Office.context.messaging.sendMessage(n)}(e,t),new Promise((function(e){e()}))}}(e.message||(e.message={}));var t=function(){function e(){this.listeners=[]}return e.prototype.add=function(e){this.listeners.push(e)},e.prototype.remove=function(e){var t=this.listeners.lastIndexOf(e);-1!==t&&this.listeners.splice(t,1)},e.prototype.call=function(e){this.listeners.forEach((function(t){return t(e)}))},e}();e.ListenerManager=t}(OfficeRuntime||(OfficeRuntime={})),function(e){OfficeExtension.BatchApiHelper.createPropertyObject,OfficeExtension.BatchApiHelper.createMethodObject,OfficeExtension.BatchApiHelper.createIndexerObject,OfficeExtension.BatchApiHelper.createRootServiceObject;var t=OfficeExtension.BatchApiHelper.createTopLevelServiceObject,n=(OfficeExtension.BatchApiHelper.createChildItemObject,OfficeExtension.BatchApiHelper.invokeMethod),o=(OfficeExtension.BatchApiHelper.invokeEnsureUnchanged,OfficeExtension.BatchApiHelper.invokeSetProperty,OfficeExtension.Utility.isNullOrUndefined),r=(OfficeExtension.Utility.isUndefined,OfficeExtension.Utility.throwIfNotLoaded,OfficeExtension.Utility.throwIfApiNotSupported,OfficeExtension.Utility.load,OfficeExtension.Utility.retrieve,OfficeExtension.Utility.toJson),i=OfficeExtension.Utility.fixObjectPathIfNecessary,a=(OfficeExtension.Utility._handleNavigationPropertyResults,OfficeExtension.Utility.adjustToDateTime,OfficeExtension.Utility.processRetrieveResult),s=(OfficeExtension.Utility.setMockData,OfficeExtension.CommonUtility.calculateApiFlags,"_Office_AsyncStorage_"),c=s+"|_unusedKey_",u={getItem:function(e){return p((function(t,n){return t.multiGet(n,JSON.stringify([e]))}),(function(e){var t=JSON.parse(e);return t&&t[0]&&t[0][1]?t[0][1]:null}))},setItem:function(e,t){return p((function(n,o){return n.multiSet(o,JSON.stringify([[e,t]]))}),(function(){return null}))},removeItem:function(e){return p((function(t,n){return t.multiRemove(n,JSON.stringify([e]))}),(function(){return null}))},getItems:function(e){return p((function(t,n){return t.multiGet(n,JSON.stringify(e))}),(function(t){var n=JSON.parse(t),o={};return n&&n.forEach((function(e){var t=e[0],n=e[1];return o[t]=n,n})),e&&e.forEach((function(e){o[e]&&o[e]})),o}))},setItems:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push([n,e[n]]);return p((function(e,n){return e.multiSet(n,JSON.stringify(t))}),(function(){return null}))},removeItems:function(e){return p((function(t,n){return t.multiRemove(n,JSON.stringify(e))}),(function(){return null}))},getKeys:function(){return p((function(e,t){return e.getAllKeys(t)}),(function(e){return JSON.parse(e)}))}},l={getItem:function(e){return m((function(){return f(e)}))},setItem:function(e,t){return g((function(){return d(e,t)}))},removeItem:function(e){return g((function(){return window.localStorage.removeItem(s+e)}))},getItems:function(e){return new Promise((function(t,n){var o={},r=[];try{h()}catch(e){n(e)}e.forEach((function(e){try{var t=f(e);o[e]=t||null}catch(e){r.push(e)}})),r.length>0?n(new Error("Unknown error.")):t(o)}))},setItems:function(e){return v(e,(function(t){return d(t,e[t])}))},removeItems:function(e){return v(e,(function(e){return window.localStorage.removeItem(s+e)}))},getKeys:function(){return m((function(){return Object.keys(window.localStorage).filter((function(e){return 0===e.indexOf(s)})).map((function(e){return e.substr(s.length)}))}))}};function f(e){return window.localStorage.getItem(s+e)}function d(e,t){window.localStorage.setItem(s+e,t)}function p(e,t){return new OfficeExtension.CoreUtility.Promise((function(n,o){var r=y.getInstance(),i=r.setCallBack((function(e,r){if(r)o(r);else{var i=t(e);n(i)}}));r.ctx.sync().then((function(){var t=r.getPersistentKvStorageService();return e(t,i),r.ctx.sync()})).catch((function(e){o(e)}))}))}function h(){d(c,null),window.localStorage.removeItem(c)}function g(e,t){return void 0===t&&(t=function(){}),new Promise((function(n,o){try{h(),e(),t(null),n()}catch(e){t(e),o(e)}}))}function m(e,t){return void 0===t&&(t=function(){}),new Promise((function(n,o){try{h();var r=e();t(null,r),n(r)}catch(e){t(e,null),o(e)}}))}function v(e,t,n){return void 0===n&&(n=function(){}),new Promise((function(o,r){var i=[];try{h()}catch(e){i.push(e)}for(var a in e)if(e.hasOwnProperty(a)||Array.isArray(e))try{Array.isArray(e)?t(e[a]):t(a)}catch(e){i.push(e)}n(i),i.length>0?r(i):o()}))}e.ApiHelper.isNativeStorage()?e.storage=u:e.storage=l;var y=function(){function e(){var e=this;this._invokeId=0,this._callDict={},this.ctx=new OfficeExtension.ClientRequestContext,this._perkvstorService=_.newObject(this.ctx),this._eventResult=this._perkvstorService.onPersistentStorageMessage.add((function(t){OfficeExtension.Utility.log("persistentKvStoragegMessageHandler:"+JSON.stringify(t));var n=e._callDict[t.invokeId];n&&(n(t.message,t.error),delete e._callDict[t.invokeId])}))}return e.getInstance=function(){return void 0===e.instance?e.instance=new e:e.instance._perkvstorService=_.newObject(e.instance.ctx),e.instance},e.prototype.getPersistentKvStorageService=function(){return this._perkvstorService},e.prototype.getCallBack=function(e){return this._callDict[e]},e.prototype.setCallBack=function(e){var t=this._invokeId;return this._callDict[this._invokeId++]=e,t},e}(),_=function(s){function c(){return null!==s&&s.apply(this,arguments)||this}return __extends(c,s),Object.defineProperty(c.prototype,"_className",{get:function(){return"PersistentKvStorageService"},enumerable:!0,configurable:!0}),c.prototype.clear=function(e){n(this,"Clear",1,[e],4,0)},c.prototype.getAllKeys=function(e){n(this,"GetAllKeys",1,[e],4,0)},c.prototype.multiGet=function(e,t){n(this,"MultiGet",1,[e,t],4,0)},c.prototype.multiRemove=function(e,t){n(this,"MultiRemove",1,[e,t],4,0)},c.prototype.multiSet=function(e,t){n(this,"MultiSet",1,[e,t],4,0)},c.prototype._handleResult=function(e){(s.prototype._handleResult.call(this,e),o(e))||i(this,e)},c.prototype._handleRetrieveResult=function(e,t){s.prototype._handleRetrieveResult.call(this,e,t),a(this,e,t)},c.newObject=function(n){return t(e.PersistentKvStorageService,n,"Microsoft.PersistentKvStorage.PersistentKvStorageService",!1,4)},Object.defineProperty(c.prototype,"onPersistentStorageMessage",{get:function(){return this.m_persistentStorageMessage||(this.m_persistentStorageMessage=new OfficeExtension.GenericEventHandlers(this.context,this,"PersistentStorageMessage",{eventType:65537,registerFunc:function(){},unregisterFunc:function(){},getTargetIdFunc:function(){return null},eventArgsTransformFunc:function(e){var t,n,o,r;try{var i=JSON.parse(e.message),a=parseInt(i.errorCode),s=0!=a?new OfficeExtension.Error((n=a,(o={})[16389]={code:"GenericException",message:"Unknown error."},o[65535]={code:"Unexcepted",message:"Catastrophic failure."},o[14]={code:"OutOfMemory",message:"Ran out of memory."},o[87]={code:"InvalidArg",message:"One or more arguments are invalid."},o[16385]={code:"NotImplemented",message:"Not implemented."},o[6]={code:"BadHandle",message:"File Handle is not Set."},o[5]={code:"AccessDenied",message:"Can't read the Storage File."},(r=o)[n]?r[n]:{code:"Unknown",message:"An unknown error has occured"})):null;t={invokeId:i.invokeId,message:i.message,error:s}}catch(e){t={invokeId:-1,message:e.message,error:new OfficeExtension.Error({code:"GenericException",message:"Unknown error"})}}return OfficeExtension.Utility._createPromiseFromResult(t)}})),this.m_persistentStorageMessage},enumerable:!0,configurable:!0}),c.prototype.toJSON=function(){return r(this,{},{})},c}(OfficeExtension.ClientObject);e.PersistentKvStorageService=_,function(e){e.generalException="GeneralException"}(e.ErrorCodes||(e.ErrorCodes={}))}(OfficeRuntime||(OfficeRuntime={})),function(e){e.setCustomFunctionInvoker=Excel.customFunctionProxy.setCustomFunctionInvoker.bind(Excel.customFunctionProxy),e.Error=Excel.CustomFunctionError,e.ErrorCode=Excel.ErrorCode,e.Entity=Excel.CustomFunctionEntity,e.FormattedNumber=Excel.CustomFunctionFormattedNumber,e.Attribution=Excel.CustomFunctionAttribution,e.Provider=Excel.CustomFunctionProvider,e.WebImage=Excel.CustomFunctionWebImage,Excel.customFunctionProxy.setCustomFunctionAssociation(e._association),setTimeout((function(){Excel.CustomFunctions.initialize()}),500)}(CustomFunctions||(CustomFunctions={}));