/* Copyright (c) Microsoft Corporation. All rights reserved. */ /* Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419. */ /* * @overview es6-promise - a tiny implementation of Promises/A+. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) * @license Licensed under MIT license * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE * @version 2.3.0 */ // Sources: // osfweb: 16.0\14704.10000 // runtime: 16.0\14704.10000 // core: 16.0\14704.10000 // host: 16.0\14704.10000 var OfficeExt,__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(){function e(){}return e.prototype.isMsAjaxLoaded=function(){return!!("undefined"!==typeof Sys&&"undefined"!==typeof Type&&Sys.StringBuilder&&"function"===typeof Sys.StringBuilder&&Type.registerNamespace&&"function"===typeof Type.registerNamespace&&Type.registerClass&&"function"===typeof Type.registerClass&&"function"===typeof Function._validateParams&&Sys.Serialization&&Sys.Serialization.JavaScriptSerializer&&"function"===typeof Sys.Serialization.JavaScriptSerializer.serialize)},e.prototype.loadMsAjaxFull=function(e){var t=("https:"===window.location.protocol.toLowerCase()?"https:":"http:")+"//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js";OSF.OUtil.loadScript(t,e)},Object.defineProperty(e.prototype,"msAjaxError",{get:function(){return null==this._msAjaxError&&this.isMsAjaxLoaded()&&(this._msAjaxError=Error),this._msAjaxError},set:function(e){this._msAjaxError=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"msAjaxString",{get:function(){return null==this._msAjaxString&&this.isMsAjaxLoaded()&&(this._msAjaxString=String),this._msAjaxString},set:function(e){this._msAjaxString=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"msAjaxDebug",{get:function(){return null==this._msAjaxDebug&&this.isMsAjaxLoaded()&&(this._msAjaxDebug=Sys.Debug),this._msAjaxDebug},set:function(e){this._msAjaxDebug=e},enumerable:!0,configurable:!0}),e}();e.MicrosoftAjaxFactory=t}(OfficeExt||(OfficeExt={}));var OSFLog,Logger,OSFAriaLogger,OSFAppTelemetry,OSFPerfUtil,OSFWebAuth,OSF_DDA_Marshaling_FilePropertiesKeys,OSF_DDA_Marshaling_File_FilePropertiesKeys,OSF_DDA_Marshaling_File_SlicePropertiesKeys,OSF_DDA_Marshaling_File_FileType,OSF_DDA_Marshaling_File_ParameterKeys,OSF_DDA_Marshaling_AppCommand_AppCommandInvokedEventKeys,OSF_DDA_Marshaling_AppCommand_AppCommandCompletedMethodParameterKeys,OsfMsAjaxFactory=new OfficeExt.MicrosoftAjaxFactory,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;o0?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)}return{set_entropy:function(e){if("string"==typeof e)for(var t=0;t6&&t.slice(0,5)===OSF.DDA.SettingsManager.DateJSONPrefix&&t.slice(-1)===OSF.DDA.SettingsManager.DataJSONSuffix&&(n=new Date(parseInt(t.slice(5,-1))))?n:t})):Sys.Serialization.JavaScriptSerializer.deserialize(o,!0),t[n]=o}catch(e){}}return t},loadScript:function(e,t,o){if(e&&t){var r=window.document,i=n[e];if(i)i.loaded?t():i.pendingCallbacks.push(t);else{var a=r.createElement("script");a.type="text/javascript",i={loaded:!1,pendingCallbacks:[t],timer:null},n[e]=i;var s=function(){null!=i.timer&&(clearTimeout(i.timer),delete i.timer),i.loaded=!0;for(var e=i.pendingCallbacks.length,t=0;t0?c(null):c(new Event("Script load timed out"))}),o),a.setAttribute("crossOrigin","anonymous"),a.src=e,r.getElementsByTagName("head")[0].appendChild(a)}}},loadCSS:function(e){if(e){var t=window.document,n=t.createElement("link");n.type="text/css",n.rel="stylesheet",n.href=e,t.getElementsByTagName("head")[0].appendChild(n)}},parseEnum:function(e,t){var n=t[e.trim()];if("undefined"==typeof n)throw OsfMsAjaxFactory.msAjaxDebug.trace("invalid enumeration string:"+e),OsfMsAjaxFactory.msAjaxError.argument("str");return n},delayExecutionAndCache:function(){var e={calc:arguments[0]};return function(){return e.calc&&(e.val=e.calc.apply(this,arguments),delete e.calc),e.val}},getUniqueId:function(){return(e+=1).toString()},formatString:function(){var e=arguments,t=e[0];return t.replace(/{(\d+)}/gm,(function(t,n){var o=parseInt(n,10)+1;return void 0===e[o]?"{"+n+"}":e[o]}))},generateConversationId:function(){return[a(),a(),(new Date).getTime().toString()].join("_")},getFrameName:function(e){return"_xdm_"+e+this.generateConversationId()},addXdmInfoAsHash:function(e,t){return OSF.OUtil.addInfoAsHash(e,"&_xdm_Info=",t,!1)},addSerializerVersionAsHash:function(e,t){return OSF.OUtil.addInfoAsHash(e,"&_serializer_version=",t,!0)},addFlightsAsHash:function(e,t){return OSF.OUtil.addInfoAsHash(e,"&_flights=",t,!0)},addInfoAsHash:function(e,n,o,r){var i,a=(e=e.trim()||"").split(t),s=a.shift(),c=a.join(t);return i=r?[n,encodeURIComponent(o),c].join(""):[c,n,o].join(""),[s,t,i].join("")},parseHostInfoFromWindowName:function(e,t){return OSF.OUtil.parseInfoFromWindowName(e,t,OSF.WindowNameItemKeys.HostInfo)},parseXdmInfo:function(e){var t=OSF.OUtil.parseXdmInfoWithGivenFragment(e,window.location.hash);return t||(t=OSF.OUtil.parseXdmInfoFromWindowName(e,window.name)),t},parseXdmInfoFromWindowName:function(e,t){return OSF.OUtil.parseInfoFromWindowName(e,t,OSF.WindowNameItemKeys.XdmInfo)},parseXdmInfoWithGivenFragment:function(e,t){return OSF.OUtil.parseInfoWithGivenFragment("&_xdm_Info=","_xdm_",!1,e,t)},parseSerializerVersion:function(e){var t=OSF.OUtil.parseSerializerVersionWithGivenFragment(e,window.location.hash);return isNaN(t)&&(t=OSF.OUtil.parseSerializerVersionFromWindowName(e,window.name)),t},parseSerializerVersionFromWindowName:function(e,t){return parseInt(OSF.OUtil.parseInfoFromWindowName(e,t,OSF.WindowNameItemKeys.SerializerVersion))},parseSerializerVersionWithGivenFragment:function(e,t){return parseInt(OSF.OUtil.parseInfoWithGivenFragment("&_serializer_version=","_serializer_version=",!0,e,t))},parseFlights:function(e){var t=OSF.OUtil.parseFlightsWithGivenFragment(e,window.location.hash);return 0==t.length&&(t=OSF.OUtil.parseFlightsFromWindowName(e,window.name)),t},checkFlight:function(e){return OSF.Flights&&OSF.Flights.indexOf(e)>=0},pushFlight:function(e){return OSF.Flights.indexOf(e)<0&&(OSF.Flights.push(e),!0)},getBooleanSetting:function(e){return OSF.OUtil.getBooleanFromDictionary(OSF.Settings,e)},getBooleanFromDictionary:function(e,t){var n=e&&t&&void 0!==e[t]&&e[t]&&("string"===typeof e[t]&&"TRUE"===e[t].toUpperCase()||"boolean"===typeof e[t]&&e[t]);return void 0!==n&&n},parseFlightsFromWindowName:function(e,t){return OSF.OUtil.parseArrayWithDefault(OSF.OUtil.parseInfoFromWindowName(e,t,OSF.WindowNameItemKeys.Flights))},parseFlightsWithGivenFragment:function(e,t){return OSF.OUtil.parseArrayWithDefault(OSF.OUtil.parseInfoWithGivenFragment("&_flights=","_flights=",!0,e,t))},parseArrayWithDefault:function(e){var t=[];try{t=JSON.parse(e)}catch(e){}return Array.isArray(t)||(t=[]),t},parseInfoFromWindowName:function(e,t,n){try{var o=JSON.parse(t),r=null!=o?o[n]:null,i=s();if(!e&&i&&null!=o){var a=o[OSF.WindowNameItemKeys.BaseFrameName]+n;r?i.setItem(a,r):r=i.getItem(a)}return r}catch(e){return null}},parseInfoWithGivenFragment:function(e,t,n,o,r){var i=r.split(e),a=i.length>1?i[i.length-1]:null;n&&null!=a&&(a.indexOf("&")>=0&&(a=a.split("&")[0]),a=decodeURIComponent(a));var c=s();if(!o&&c){var l=window.name.indexOf(t);if(l>-1){var u=window.name.indexOf(";",l);-1==u&&(u=window.name.length);var p=window.name.substring(l,u);a?c.setItem(p,a):a=c.getItem(p)}}return a},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},getInfoItems:function(e){var t=e.split("$");return"undefined"==typeof t[1]&&(t=e.split("|")),"undefined"==typeof t[1]&&(t=e.split("%7C")),t},getXdmFieldValue:function(e,t){var n="",o=OSF.OUtil.parseXdmInfo(t);if(o){var r=OSF.OUtil.getInfoItems(o);if(void 0!=r&&r.length>=3)switch(e){case OSF.XdmFieldName.ConversationUrl:n=r[2];break;case OSF.XdmFieldName.AppId:n=r[1]}}return n},validateParamObject:function(e,t,n){var o=Function._validateParams(arguments,[{name:"params",type:Object,mayBeNull:!1},{name:"expectedProperties",type:Object,mayBeNull:!1},{name:"callback",type:Function,mayBeNull:!0}]);if(o)throw o;for(var r in t)if(o=Function._validateParameter(e[r],t[r],r))throw o},writeProfilerMark:function(e){window.msWriteProfilerMark&&(window.msWriteProfilerMark(e),OsfMsAjaxFactory.msAjaxDebug.trace(e))},outputDebug:function(e){"undefined"!==typeof OsfMsAjaxFactory&&OsfMsAjaxFactory.msAjaxDebug&&OsfMsAjaxFactory.msAjaxDebug.trace&&OsfMsAjaxFactory.msAjaxDebug.trace(e)},defineNondefaultProperty:function(e,t,n,o){for(var r in n=n||{},o){var i=o[r];void 0==n[i]&&(n[i]=!0)}return Object.defineProperty(e,t,n),e},defineNondefaultProperties:function(e,t,n){for(var o in t=t||{})OSF.OUtil.defineNondefaultProperty(e,o,t[o],n);return e},defineEnumerableProperty:function(e,t,n){return OSF.OUtil.defineNondefaultProperty(e,t,n,["enumerable"])},defineEnumerableProperties:function(e,t){return OSF.OUtil.defineNondefaultProperties(e,t,["enumerable"])},defineMutableProperty:function(e,t,n){return OSF.OUtil.defineNondefaultProperty(e,t,n,["writable","enumerable","configurable"])},defineMutableProperties:function(e,t){return OSF.OUtil.defineNondefaultProperties(e,t,["writable","enumerable","configurable"])},finalizeProperties:function(e,t){t=t||{};for(var n=Object.getOwnPropertyNames(e),o=n.length,r=0;r>8,a=255&n,u[s++]=r>>2,u[s++]=(3&r)<<4|i>>4,u[s++]=(15&i)<<2|a>>6,u[s++]=63&a,isNaN(n)||(r=n>>8,i=255&o,a=o>>8,u[s++]=r>>2,u[s++]=(3&r)<<4|i>>4,u[s++]=(15&i)<<2|a>>6,u[s++]=63&a),isNaN(n)?u[s-1]=64:isNaN(o)&&(u[s-2]=64,u[s-1]=64);for(var f=0;f=2?n[o-2]+"."+n[o-1]:1==o?n[0]:void 0},isiOS:function(){return!!window.navigator.userAgent.match(/(iPad|iPhone|iPod)/g)},isChrome:function(){return window.navigator.userAgent.indexOf("Chrome")>0&&!OSF.OUtil.isEdge()},isEdge:function(){return window.navigator.userAgent.indexOf("Edge")>0},isIE:function(){return window.navigator.userAgent.indexOf("Trident")>0},isFirefox:function(){return window.navigator.userAgent.indexOf("Firefox")>0},startsWith:function(e,t,n){return n?e.substr(0,t.length)===t:e.startsWith(t)},containsPort:function(e,t,n,o){return this.startsWith(e,t+"//"+n+":"+o,!0)||this.startsWith(e,n+":"+o,!0)},getRedundandPortString:function(e,t){return e&&t?"https:"==t.protocol&&this.containsPort(e,"https:",t.hostname,"443")?":443":"http:"==t.protocol&&this.containsPort(e,"http:",t.hostname,"80")?":80":"":""},removeChar:function(e,t){return t=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},cleanUrl:function(e){if(e=this.cleanUrlOfChar(e,"/"),e=this.cleanUrlOfChar(e,"?"),"https://"==(e=this.cleanUrlOfChar(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},parseUrl:function(e,t){if(void 0===t&&(t=!1),"undefined"!==typeof e&&e){var n=this.isIE(),o={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(n){var r=document.createElement("a");if(r.href=e,!r||!r.protocol||!r.host||!r.hostname||!r.href||this.cleanUrl(r.href).toLowerCase()!==this.cleanUrl(e).toLowerCase())throw"InvalidUrl";if(OSF.OUtil.checkFlight(OSF.FlightNames.AddinEnforceHttps)&&t&&"https:"!=r.protocol)throw new Error("NotHttps");var i=this.getRedundandPortString(e,r);o.protocol=r.protocol,o.hostname=r.hostname,o.port=""==i?r.port:"",o.host=""!=i?r.hostname:r.host,o.pathname=(n?"/":"")+r.pathname,o.search=r.search,o.hash=r.hash,o.isPortPartOfUrl=this.containsPort(e,r.protocol,r.hostname,r.port)}else{var a=new URL(e);if(a&&a.protocol&&a.host&&a.hostname){if(OSF.OUtil.checkFlight(OSF.FlightNames.AddinEnforceHttps)&&t&&"https:"!=a.protocol)throw new Error("NotHttps");o.protocol=a.protocol,o.hostname=a.hostname,o.port=a.port,o.host=a.host,o.pathname=a.pathname,o.search=a.search,o.hash=a.hash,o.isPortPartOfUrl=a.host.lastIndexOf(":"+a.port)==a.host.length-a.port.length-1}}}catch(e){if("NotHttps"===e.message)throw e}return o}},shallowCopy:function(e){if(null==e)return null;if(e instanceof Object){if(Array.isArray(e)){for(var t=[],n=0;ne||0===t&&n?-1:t!==e-1||n?n?t-1:t+1:-1};if(e=c(e),n=t?e.length-1:0,0===e.length)return null;for(;!r&&n>=0&&ne||0===t&&n?-1:t!==e-1||n?n?t-1:t+1:-1};if(o=function(e,t){for(var n=0;n=0&&re.length)return!1;if(e.substr(e.length-t.length)===t)return!0}return!1},hashCode:function(e){var t=0;if(!OSF.OUtil.isNullOrUndefined(e))for(var n=0,o=e.length;n0;o++)8!=o&&12!=o&&16!=o&&20!=o||(t+="-"),t+=e[n%16],n=Math.floor(n/16);for(;o<32;o++)8!=o&&12!=o&&16!=o&&20!=o||(t+="-"),t+=e[Math.floor(16*Math.random())];return t}}}();try{!function(){OSF.Flights=OSF.OUtil.parseFlights(!0)}()}catch(e){}window.OSF=OSF,OSF.OUtil.setNamespace("OSF",window),OSF.MessageIDs={FetchBundleUrl:0,LoadReactBundle:1,LoadBundleSuccess:2,LoadBundleError:3},OSF.AppName={Unsupported:0,Excel:1,Word:2,PowerPoint:4,Outlook:8,ExcelWebApp:16,WordWebApp:32,OutlookWebApp:64,Project:128,AccessWebApp:256,PowerpointWebApp:512,ExcelIOS:1024,Sway:2048,WordIOS:4096,PowerPointIOS:8192,Access:16384,Lync:32768,OutlookIOS:65536,OneNoteWebApp:131072,OneNote:262144,ExcelWinRT:524288,WordWinRT:1048576,PowerpointWinRT:2097152,OutlookAndroid:4194304,OneNoteWinRT:8388608,ExcelAndroid:8388609,VisioWebApp:8388610,OneNoteIOS:8388611,WordAndroid:8388613,PowerpointAndroid:8388614,Visio:8388615,OneNoteAndroid:4194305},OSF.InternalPerfMarker={DataCoercionBegin:"Agave.HostCall.CoerceDataStart",DataCoercionEnd:"Agave.HostCall.CoerceDataEnd"},OSF.HostCallPerfMarker={IssueCall:"Agave.HostCall.IssueCall",ReceiveResponse:"Agave.HostCall.ReceiveResponse",RuntimeExceptionRaised:"Agave.HostCall.RuntimeExecptionRaised"},OSF.AgaveHostAction={Select:0,UnSelect:1,CancelDialog:2,InsertAgave:3,CtrlF6In:4,CtrlF6Exit:5,CtrlF6ExitShift:6,SelectWithError:7,NotifyHostError:8,RefreshAddinCommands:9,PageIsReady:10,TabIn:11,TabInShift:12,TabExit:13,TabExitShift:14,EscExit:15,F2Exit:16,ExitNoFocusable:17,ExitNoFocusableShift:18,MouseEnter:19,MouseLeave:20,UpdateTargetUrl:21,InstallCustomFunctions:22,SendTelemetryEvent:23,UninstallCustomFunctions:24,SendMessage:25,LaunchExtensionComponent:26,StopExtensionComponent:27,RestartExtensionComponent:28,EnableTaskPaneHeaderButton:29,DisableTaskPaneHeaderButton:30,TaskPaneHeaderButtonClicked:31,RemoveAppCommandsAddin:32,RefreshRibbonGallery:33,GetOriginalControlId:34,OfficeJsReady:35,InsertDevManifest:36,InsertDevManifestError:37,SendCustomerContent:38,KeyboardShortcuts:39},OSF.SharedConstants={NotificationConversationIdSuffix:"_ntf"},OSF.DialogMessageType={DialogMessageReceived:0,DialogParentMessageReceived:1,DialogClosed:12006},OSF.OfficeAppContext=function(e,t,n,o,r,i,a,s,c,l,u,p,d,f,h,m,g,y,O,_,b,v,S,A,D,P,C){this._id=e,this._appName=t,this._appVersion=n,this._appUILocale=o,this._dataLocale=r,this._docUrl=i,this._clientMode=a,this._settings=s,this._reason=c,this._osfControlType=l,this._eToken=u,this._correlationId=p,this._appInstanceId=d,this._touchEnabled=f,this._commerceAllowed=h,this._appMinorVersion=m,this._requirementMatrix=g,this._hostCustomMessage=y,this._hostFullVersion=O,this._isDialog=!1,this._clientWindowHeight=_,this._clientWindowWidth=b,this._addinName=v,this._appDomains=S,this._dialogRequirementMatrix=A,this._featureGates=D,this._officeTheme=P,this._initialDisplayMode=C,this.get_id=function(){return this._id},this.get_appName=function(){return this._appName},this.get_appVersion=function(){return this._appVersion},this.get_appUILocale=function(){return this._appUILocale},this.get_dataLocale=function(){return this._dataLocale},this.get_docUrl=function(){return this._docUrl},this.get_clientMode=function(){return this._clientMode},this.get_bindings=function(){return this._bindings},this.get_settings=function(){return this._settings},this.get_reason=function(){return this._reason},this.get_osfControlType=function(){return this._osfControlType},this.get_eToken=function(){return this._eToken},this.get_correlationId=function(){return this._correlationId},this.get_appInstanceId=function(){return this._appInstanceId},this.get_touchEnabled=function(){return this._touchEnabled},this.get_commerceAllowed=function(){return this._commerceAllowed},this.get_appMinorVersion=function(){return this._appMinorVersion},this.get_requirementMatrix=function(){return this._requirementMatrix},this.get_dialogRequirementMatrix=function(){return this._dialogRequirementMatrix},this.get_hostCustomMessage=function(){return this._hostCustomMessage},this.get_hostFullVersion=function(){return this._hostFullVersion},this.get_isDialog=function(){return this._isDialog},this.get_clientWindowHeight=function(){return this._clientWindowHeight},this.get_clientWindowWidth=function(){return this._clientWindowWidth},this.get_addinName=function(){return this._addinName},this.get_appDomains=function(){return this._appDomains},this.get_featureGates=function(){return this._featureGates},this.get_officeTheme=function(){return this._officeTheme},this.get_initialDisplayMode=function(){return this._initialDisplayMode?this._initialDisplayMode:0}},OSF.OsfControlType={DocumentLevel:0,ContainerLevel:1},OSF.ClientMode={ReadOnly:0,ReadWrite:1},OSF.OUtil.setNamespace("Microsoft",window),OSF.OUtil.setNamespace("Office",Microsoft),OSF.OUtil.setNamespace("Client",Microsoft.Office),OSF.OUtil.setNamespace("WebExtension",Microsoft.Office),Microsoft.Office.WebExtension.InitializationReason={Inserted:"inserted",DocumentOpened:"documentOpened",ControlActivation:"controlActivation"},Microsoft.Office.WebExtension.ValueFormat={Unformatted:"unformatted",Formatted:"formatted"},Microsoft.Office.WebExtension.FilterType={All:"all"},Microsoft.Office.WebExtension.Parameters={BindingType:"bindingType",CoercionType:"coercionType",ValueFormat:"valueFormat",FilterType:"filterType",Columns:"columns",SampleData:"sampleData",GoToType:"goToType",SelectionMode:"selectionMode",Id:"id",PromptText:"promptText",ItemName:"itemName",FailOnCollision:"failOnCollision",StartRow:"startRow",StartColumn:"startColumn",RowCount:"rowCount",ColumnCount:"columnCount",Callback:"callback",AsyncContext:"asyncContext",Data:"data",Rows:"rows",OverwriteIfStale:"overwriteIfStale",FileType:"fileType",EventType:"eventType",Handler:"handler",SliceSize:"sliceSize",SliceIndex:"sliceIndex",ActiveView:"activeView",Status:"status",PlatformType:"platformType",HostType:"hostType",ForceConsent:"forceConsent",ForceAddAccount:"forceAddAccount",AuthChallenge:"authChallenge",AllowConsentPrompt:"allowConsentPrompt",ForMSGraphAccess:"forMSGraphAccess",AllowSignInPrompt:"allowSignInPrompt",JsonPayload:"jsonPayload",EnableNewHosts:"enableNewHosts",AccountTypeFilter:"accountTypeFilter",AddinTrustId:"addinTrustId",Reserved:"reserved",Tcid:"tcid",Xml:"xml",Namespace:"namespace",Prefix:"prefix",XPath:"xPath",Text:"text",ImageLeft:"imageLeft",ImageTop:"imageTop",ImageWidth:"imageWidth",ImageHeight:"imageHeight",TaskId:"taskId",FieldId:"fieldId",FieldValue:"fieldValue",ServerUrl:"serverUrl",ListName:"listName",ResourceId:"resourceId",ViewType:"viewType",ViewName:"viewName",GetRawValue:"getRawValue",CellFormat:"cellFormat",TableOptions:"tableOptions",TaskIndex:"taskIndex",ResourceIndex:"resourceIndex",CustomFieldId:"customFieldId",Url:"url",MessageHandler:"messageHandler",Width:"width",Height:"height",RequireHTTPs:"requireHTTPS",MessageToParent:"messageToParent",DisplayInIframe:"displayInIframe",MessageContent:"messageContent",HideTitle:"hideTitle",UseDeviceIndependentPixels:"useDeviceIndependentPixels",PromptBeforeOpen:"promptBeforeOpen",EnforceAppDomain:"enforceAppDomain",UrlNoHostInfo:"urlNoHostInfo",TargetOrigin:"targetOrigin",AppCommandInvocationCompletedData:"appCommandInvocationCompletedData",Base64:"base64",FormId:"formId"},OSF.OUtil.setNamespace("DDA",OSF),OSF.DDA.DocumentMode={ReadOnly:1,ReadWrite:0},OSF.DDA.PropertyDescriptors={AsyncResultStatus:"AsyncResultStatus"},OSF.DDA.EventDescriptors={},OSF.DDA.ListDescriptors={},OSF.DDA.UI={},OSF.DDA.getXdmEventName=function(e,t){return t==Microsoft.Office.WebExtension.EventType.BindingSelectionChanged||t==Microsoft.Office.WebExtension.EventType.BindingDataChanged||t==Microsoft.Office.WebExtension.EventType.DataNodeDeleted||t==Microsoft.Office.WebExtension.EventType.DataNodeInserted||t==Microsoft.Office.WebExtension.EventType.DataNodeReplaced?e+"_"+t:t},OSF.DDA.MethodDispId={dispidMethodMin:64,dispidGetSelectedDataMethod:64,dispidSetSelectedDataMethod:65,dispidAddBindingFromSelectionMethod:66,dispidAddBindingFromPromptMethod:67,dispidGetBindingMethod:68,dispidReleaseBindingMethod:69,dispidGetBindingDataMethod:70,dispidSetBindingDataMethod:71,dispidAddRowsMethod:72,dispidClearAllRowsMethod:73,dispidGetAllBindingsMethod:74,dispidLoadSettingsMethod:75,dispidSaveSettingsMethod:76,dispidGetDocumentCopyMethod:77,dispidAddBindingFromNamedItemMethod:78,dispidAddColumnsMethod:79,dispidGetDocumentCopyChunkMethod:80,dispidReleaseDocumentCopyMethod:81,dispidNavigateToMethod:82,dispidGetActiveViewMethod:83,dispidGetDocumentThemeMethod:84,dispidGetOfficeThemeMethod:85,dispidGetFilePropertiesMethod:86,dispidClearFormatsMethod:87,dispidSetTableOptionsMethod:88,dispidSetFormatsMethod:89,dispidExecuteRichApiRequestMethod:93,dispidAppCommandInvocationCompletedMethod:94,dispidCloseContainerMethod:97,dispidGetAccessTokenMethod:98,dispidGetAuthContextMethod:99,dispidOpenBrowserWindow:102,dispidCreateDocumentMethod:105,dispidInsertFormMethod:106,dispidDisplayRibbonCalloutAsyncMethod:109,dispidGetSelectedTaskMethod:110,dispidGetSelectedResourceMethod:111,dispidGetTaskMethod:112,dispidGetResourceFieldMethod:113,dispidGetWSSUrlMethod:114,dispidGetTaskFieldMethod:115,dispidGetProjectFieldMethod:116,dispidGetSelectedViewMethod:117,dispidGetTaskByIndexMethod:118,dispidGetResourceByIndexMethod:119,dispidSetTaskFieldMethod:120,dispidSetResourceFieldMethod:121,dispidGetMaxTaskIndexMethod:122,dispidGetMaxResourceIndexMethod:123,dispidCreateTaskMethod:124,dispidAddDataPartMethod:128,dispidGetDataPartByIdMethod:129,dispidGetDataPartsByNamespaceMethod:130,dispidGetDataPartXmlMethod:131,dispidGetDataPartNodesMethod:132,dispidDeleteDataPartMethod:133,dispidGetDataNodeValueMethod:134,dispidGetDataNodeXmlMethod:135,dispidGetDataNodesMethod:136,dispidSetDataNodeValueMethod:137,dispidSetDataNodeXmlMethod:138,dispidAddDataNamespaceMethod:139,dispidGetDataUriByPrefixMethod:140,dispidGetDataPrefixByUriMethod:141,dispidGetDataNodeTextMethod:142,dispidSetDataNodeTextMethod:143,dispidMessageParentMethod:144,dispidSendMessageMethod:145,dispidExecuteFeature:146,dispidQueryFeature:147,dispidMethodMax:147},OSF.DDA.EventDispId={dispidEventMin:0,dispidInitializeEvent:0,dispidSettingsChangedEvent:1,dispidDocumentSelectionChangedEvent:2,dispidBindingSelectionChangedEvent:3,dispidBindingDataChangedEvent:4,dispidDocumentOpenEvent:5,dispidDocumentCloseEvent:6,dispidActiveViewChangedEvent:7,dispidDocumentThemeChangedEvent:8,dispidOfficeThemeChangedEvent:9,dispidDialogMessageReceivedEvent:10,dispidDialogNotificationShownInAddinEvent:11,dispidDialogParentMessageReceivedEvent:12,dispidObjectDeletedEvent:13,dispidObjectSelectionChangedEvent:14,dispidObjectDataChangedEvent:15,dispidContentControlAddedEvent:16,dispidActivationStatusChangedEvent:32,dispidRichApiMessageEvent:33,dispidAppCommandInvokedEvent:39,dispidOlkItemSelectedChangedEvent:46,dispidOlkRecipientsChangedEvent:47,dispidOlkAppointmentTimeChangedEvent:48,dispidOlkRecurrenceChangedEvent:49,dispidOlkAttachmentsChangedEvent:50,dispidOlkEnhancedLocationsChangedEvent:51,dispidOlkInfobarClickedEvent:52,dispidTaskSelectionChangedEvent:56,dispidResourceSelectionChangedEvent:57,dispidViewSelectionChangedEvent:58,dispidDataNodeAddedEvent:60,dispidDataNodeReplacedEvent:61,dispidDataNodeDeletedEvent:62,dispidEventMax:63},OSF.DDA.ErrorCodeManager=function(){var e={};return{getErrorArgs:function(t){var n=e[t];return n?(n.name||(n.name=e[this.errorCodes.ooeInternalError].name),n.message||(n.message=e[this.errorCodes.ooeInternalError].message)):n=e[this.errorCodes.ooeInternalError],n},addErrorMessage:function(t,n){e[t]=n},errorCodes:{ooeSuccess:0,ooeChunkResult:1,ooeCoercionTypeNotSupported:1e3,ooeGetSelectionNotMatchDataType:1001,ooeCoercionTypeNotMatchBinding:1002,ooeInvalidGetRowColumnCounts:1003,ooeSelectionNotSupportCoercionType:1004,ooeInvalidGetStartRowColumn:1005,ooeNonUniformPartialGetNotSupported:1006,ooeGetDataIsTooLarge:1008,ooeFileTypeNotSupported:1009,ooeGetDataParametersConflict:1010,ooeInvalidGetColumns:1011,ooeInvalidGetRows:1012,ooeInvalidReadForBlankRow:1013,ooeUnsupportedDataObject:2e3,ooeCannotWriteToSelection:2001,ooeDataNotMatchSelection:2002,ooeOverwriteWorksheetData:2003,ooeDataNotMatchBindingSize:2004,ooeInvalidSetStartRowColumn:2005,ooeInvalidDataFormat:2006,ooeDataNotMatchCoercionType:2007,ooeDataNotMatchBindingType:2008,ooeSetDataIsTooLarge:2009,ooeNonUniformPartialSetNotSupported:2010,ooeInvalidSetColumns:2011,ooeInvalidSetRows:2012,ooeSetDataParametersConflict:2013,ooeCellDataAmountBeyondLimits:2014,ooeSelectionCannotBound:3e3,ooeBindingNotExist:3002,ooeBindingToMultipleSelection:3003,ooeInvalidSelectionForBindingType:3004,ooeOperationNotSupportedOnThisBindingType:3005,ooeNamedItemNotFound:3006,ooeMultipleNamedItemFound:3007,ooeInvalidNamedItemForBindingType:3008,ooeUnknownBindingType:3009,ooeOperationNotSupportedOnMatrixData:3010,ooeInvalidColumnsForBinding:3011,ooeSettingNameNotExist:4e3,ooeSettingsCannotSave:4001,ooeSettingsAreStale:4002,ooeOperationNotSupported:5e3,ooeInternalError:5001,ooeDocumentReadOnly:5002,ooeEventHandlerNotExist:5003,ooeInvalidApiCallInContext:5004,ooeShuttingDown:5005,ooeUnsupportedEnumeration:5007,ooeIndexOutOfRange:5008,ooeBrowserAPINotSupported:5009,ooeInvalidParam:5010,ooeRequestTimeout:5011,ooeInvalidOrTimedOutSession:5012,ooeInvalidApiArguments:5013,ooeOperationCancelled:5014,ooeWorkbookHidden:5015,ooeWriteNotSupportedWhenModalDialogOpen:5016,ooeTooManyIncompleteRequests:5100,ooeRequestTokenUnavailable:5101,ooeActivityLimitReached:5102,ooeRequestPayloadSizeLimitExceeded:5103,ooeResponsePayloadSizeLimitExceeded:5104,ooeCustomXmlNodeNotFound:6e3,ooeCustomXmlError:6100,ooeCustomXmlExceedQuota:6101,ooeCustomXmlOutOfDate:6102,ooeNoCapability:7e3,ooeCannotNavTo:7001,ooeSpecifiedIdNotExist:7002,ooeNavOutOfBound:7004,ooeElementMissing:8e3,ooeProtectedError:8001,ooeInvalidCellsValue:8010,ooeInvalidTableOptionValue:8011,ooeInvalidFormatValue:8012,ooeRowIndexOutOfRange:8020,ooeColIndexOutOfRange:8021,ooeFormatValueOutOfRange:8022,ooeCellFormatAmountBeyondLimits:8023,ooeMemoryFileLimit:11e3,ooeNetworkProblemRetrieveFile:11001,ooeInvalidSliceSize:11002,ooeInvalidCallback:11101,ooeInvalidWidth:12e3,ooeInvalidHeight:12001,ooeNavigationError:12002,ooeInvalidScheme:12003,ooeAppDomains:12004,ooeRequireHTTPS:12005,ooeWebDialogClosed:12006,ooeDialogAlreadyOpened:12007,ooeEndUserAllow:12008,ooeEndUserIgnore:12009,ooeNotUILessDialog:12010,ooeCrossZone:12011,ooeNotSSOAgave:13e3,ooeSSOUserNotSignedIn:13001,ooeSSOUserAborted:13002,ooeSSOUnsupportedUserIdentity:13003,ooeSSOInvalidResourceUrl:13004,ooeSSOInvalidGrant:13005,ooeSSOClientError:13006,ooeSSOServerError:13007,ooeAddinIsAlreadyRequestingToken:13008,ooeSSOUserConsentNotSupportedByCurrentAddinCategory:13009,ooeSSOConnectionLost:13010,ooeResourceNotAllowed:13011,ooeSSOUnsupportedPlatform:13012,ooeSSOCallThrottled:13013,ooeAccessDenied:13990,ooeGeneralException:13991},initializeErrorMessages:function(t){e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported]={name:t.L_InvalidCoercion,message:t.L_CoercionTypeNotSupported},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType]={name:t.L_DataReadError,message:t.L_GetSelectionNotSupported},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding]={name:t.L_InvalidCoercion,message:t.L_CoercionTypeNotMatchBinding},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts]={name:t.L_DataReadError,message:t.L_InvalidGetRowColumnCounts},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType]={name:t.L_DataReadError,message:t.L_SelectionNotSupportCoercionType},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn]={name:t.L_DataReadError,message:t.L_InvalidGetStartRowColumn},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported]={name:t.L_DataReadError,message:t.L_NonUniformPartialGetNotSupported},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge]={name:t.L_DataReadError,message:t.L_GetDataIsTooLarge},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported]={name:t.L_DataReadError,message:t.L_FileTypeNotSupported},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict]={name:t.L_DataReadError,message:t.L_GetDataParametersConflict},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns]={name:t.L_DataReadError,message:t.L_InvalidGetColumns},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows]={name:t.L_DataReadError,message:t.L_InvalidGetRows},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow]={name:t.L_DataReadError,message:t.L_InvalidReadForBlankRow},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject]={name:t.L_DataWriteError,message:t.L_UnsupportedDataObject},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection]={name:t.L_DataWriteError,message:t.L_CannotWriteToSelection},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection]={name:t.L_DataWriteError,message:t.L_DataNotMatchSelection},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData]={name:t.L_DataWriteError,message:t.L_OverwriteWorksheetData},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize]={name:t.L_DataWriteError,message:t.L_DataNotMatchBindingSize},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn]={name:t.L_DataWriteError,message:t.L_InvalidSetStartRowColumn},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat]={name:t.L_InvalidFormat,message:t.L_InvalidDataFormat},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType]={name:t.L_InvalidDataObject,message:t.L_DataNotMatchCoercionType},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType]={name:t.L_InvalidDataObject,message:t.L_DataNotMatchBindingType},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge]={name:t.L_DataWriteError,message:t.L_SetDataIsTooLarge},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported]={name:t.L_DataWriteError,message:t.L_NonUniformPartialSetNotSupported},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns]={name:t.L_DataWriteError,message:t.L_InvalidSetColumns},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows]={name:t.L_DataWriteError,message:t.L_InvalidSetRows},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict]={name:t.L_DataWriteError,message:t.L_SetDataParametersConflict},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound]={name:t.L_BindingCreationError,message:t.L_SelectionCannotBound},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist]={name:t.L_InvalidBindingError,message:t.L_BindingNotExist},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection]={name:t.L_BindingCreationError,message:t.L_BindingToMultipleSelection},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType]={name:t.L_BindingCreationError,message:t.L_InvalidSelectionForBindingType},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType]={name:t.L_InvalidBindingOperation,message:t.L_OperationNotSupportedOnThisBindingType},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound]={name:t.L_BindingCreationError,message:t.L_NamedItemNotFound},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound]={name:t.L_BindingCreationError,message:t.L_MultipleNamedItemFound},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType]={name:t.L_BindingCreationError,message:t.L_InvalidNamedItemForBindingType},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType]={name:t.L_InvalidBinding,message:t.L_UnknownBindingType},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData]={name:t.L_InvalidBindingOperation,message:t.L_OperationNotSupportedOnMatrixData},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding]={name:t.L_InvalidBinding,message:t.L_InvalidColumnsForBinding},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist]={name:t.L_ReadSettingsError,message:t.L_SettingNameNotExist},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave]={name:t.L_SaveSettingsError,message:t.L_SettingsCannotSave},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale]={name:t.L_SettingsStaleError,message:t.L_SettingsAreStale},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported]={name:t.L_HostError,message:t.L_OperationNotSupported},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError]={name:t.L_InternalError,message:t.L_InternalErrorDescription},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly]={name:t.L_PermissionDenied,message:t.L_DocumentReadOnly},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist]={name:t.L_EventRegistrationError,message:t.L_EventHandlerNotExist},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext]={name:t.L_InvalidAPICall,message:t.L_InvalidApiCallInContext},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown]={name:t.L_ShuttingDown,message:t.L_ShuttingDown},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration]={name:t.L_UnsupportedEnumeration,message:t.L_UnsupportedEnumerationMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange]={name:t.L_IndexOutOfRange,message:t.L_IndexOutOfRange},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported]={name:t.L_APINotSupported,message:t.L_BrowserAPINotSupported},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout]={name:t.L_APICallFailed,message:t.L_RequestTimeout},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidOrTimedOutSession]={name:t.L_InvalidOrTimedOutSession,message:t.L_InvalidOrTimedOutSessionMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiArguments]={name:t.L_APICallFailed,message:t.L_InvalidApiArgumentsMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeWorkbookHidden]={name:t.L_APICallFailed,message:t.L_WorkbookHiddenMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeWriteNotSupportedWhenModalDialogOpen]={name:t.L_APICallFailed,message:t.L_WriteNotSupportedWhenModalDialogOpen},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests]={name:t.L_APICallFailed,message:t.L_TooManyIncompleteRequests},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable]={name:t.L_APICallFailed,message:t.L_RequestTokenUnavailable},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached]={name:t.L_APICallFailed,message:t.L_ActivityLimitReached},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestPayloadSizeLimitExceeded]={name:t.L_APICallFailed,message:t.L_RequestPayloadSizeLimitExceededMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeResponsePayloadSizeLimitExceeded]={name:t.L_APICallFailed,message:t.L_ResponsePayloadSizeLimitExceededMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound]={name:t.L_InvalidNode,message:t.L_CustomXmlNodeNotFound},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError]={name:t.L_CustomXmlError,message:t.L_CustomXmlError},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota]={name:t.L_CustomXmlExceedQuotaName,message:t.L_CustomXmlExceedQuotaMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate]={name:t.L_CustomXmlOutOfDateName,message:t.L_CustomXmlOutOfDateMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability]={name:t.L_PermissionDenied,message:t.L_NoCapability},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo]={name:t.L_CannotNavigateTo,message:t.L_CannotNavigateTo},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist]={name:t.L_SpecifiedIdNotExist,message:t.L_SpecifiedIdNotExist},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound]={name:t.L_NavOutOfBound,message:t.L_NavOutOfBound},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits]={name:t.L_DataWriteReminder,message:t.L_CellDataAmountBeyondLimits},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing]={name:t.L_MissingParameter,message:t.L_ElementMissing},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError]={name:t.L_PermissionDenied,message:t.L_NoCapability},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue]={name:t.L_InvalidValue,message:t.L_InvalidCellsValue},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue]={name:t.L_InvalidValue,message:t.L_InvalidTableOptionValue},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue]={name:t.L_InvalidValue,message:t.L_InvalidFormatValue},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange]={name:t.L_OutOfRange,message:t.L_RowIndexOutOfRange},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange]={name:t.L_OutOfRange,message:t.L_ColIndexOutOfRange},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange]={name:t.L_OutOfRange,message:t.L_FormatValueOutOfRange},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits]={name:t.L_FormattingReminder,message:t.L_CellFormatAmountBeyondLimits},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit]={name:t.L_MemoryLimit,message:t.L_CloseFileBeforeRetrieve},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile]={name:t.L_NetworkProblem,message:t.L_NetworkProblemRetrieveFile},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize]={name:t.L_InvalidValue,message:t.L_SliceSizeNotSupported},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeDialogAlreadyOpened]={name:t.L_DisplayDialogError,message:t.L_DialogAlreadyOpened},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidWidth]={name:t.L_IndexOutOfRange,message:t.L_IndexOutOfRange},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidHeight]={name:t.L_IndexOutOfRange,message:t.L_IndexOutOfRange},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavigationError]={name:t.L_DisplayDialogError,message:t.L_NetworkProblem},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidScheme]={name:t.L_DialogNavigateError,message:t.L_DialogInvalidScheme},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeAppDomains]={name:t.L_DisplayDialogError,message:t.L_DialogAddressNotTrusted},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequireHTTPS]={name:t.L_DisplayDialogError,message:t.L_DialogRequireHTTPS},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeEndUserIgnore]={name:t.L_DisplayDialogError,message:t.L_UserClickIgnore},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeCrossZone]={name:t.L_DisplayDialogError,message:t.L_NewWindowCrossZoneErrorString},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeNotSSOAgave]={name:t.L_APINotSupported,message:t.L_InvalidSSOAddinMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOUserNotSignedIn]={name:t.L_UserNotSignedIn,message:t.L_UserNotSignedIn},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOUserAborted]={name:t.L_UserAborted,message:t.L_UserAbortedMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOUnsupportedUserIdentity]={name:t.L_UnsupportedUserIdentity,message:t.L_UnsupportedUserIdentityMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOInvalidResourceUrl]={name:t.L_InvalidResourceUrl,message:t.L_InvalidResourceUrlMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOInvalidGrant]={name:t.L_InvalidGrant,message:t.L_InvalidGrantMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOClientError]={name:t.L_SSOClientError,message:t.L_SSOClientErrorMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOServerError]={name:t.L_SSOServerError,message:t.L_SSOServerErrorMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeAddinIsAlreadyRequestingToken]={name:t.L_AddinIsAlreadyRequestingToken,message:t.L_AddinIsAlreadyRequestingTokenMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOUserConsentNotSupportedByCurrentAddinCategory]={name:t.L_SSOUserConsentNotSupportedByCurrentAddinCategory,message:t.L_SSOUserConsentNotSupportedByCurrentAddinCategoryMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOConnectionLost]={name:t.L_SSOConnectionLostError,message:t.L_SSOConnectionLostErrorMessage},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOUnsupportedPlatform]={name:t.L_APINotSupported,message:t.L_SSOUnsupportedPlatform},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeSSOCallThrottled]={name:t.L_APICallFailed,message:t.L_RequestTokenUnavailable},e[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationCancelled]={name:t.L_OperationCancelledError,message:t.L_OperationCancelledErrorMessage}}}}(),function(e){!function(e){var t=function(){return function(){}}();e.RequirementVersion=t;var n=function(){return function(e){this.isSetSupported=function(e,t){if(void 0==e)return!1;void 0==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},this._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}},this._setMap=e,this.isSetSupported=this.isSetSupported.bind(this)}}();e.RequirementMatrix=n;var o=function(){return function(e){this._addSetMap=function(e){for(var t in e)this._sets[t]=e[t]},this._sets=e}}();e.DefaultSetRequirement=o;var r=function(e){function t(){return e.call(this,{dialogapi:1.1})||this}return __extends(t,e),t}(o);e.DefaultRequiredDialogSetRequirement=r;var i=function(e){function t(){return e.call(this,{dialogorigin:1.1})||this}return __extends(t,e),t}(o);e.DefaultOptionalDialogSetRequirement=i;var a=function(e){function t(){return e.call(this,{bindingevents:1.1,documentevents:1.1,excelapi:1.1,matrixbindings:1.1,matrixcoercion:1.1,selection:1.1,settings:1.1,tablebindings:1.1,tablecoercion:1.1,textbindings:1.1,textcoercion:1.1})||this}return __extends(t,e),t}(o);e.ExcelClientDefaultSetRequirement=a;var s=function(e){function t(){var t=e.call(this)||this;return t._addSetMap({imagecoercion:1.1}),t}return __extends(t,e),t}(a);e.ExcelClientV1DefaultSetRequirement=s;var c=function(e){function t(){return e.call(this,{mailbox:1.3})||this}return __extends(t,e),t}(o);e.OutlookClientDefaultSetRequirement=c;var l=function(e){function t(){return e.call(this,{bindingevents:1.1,compressedfile:1.1,customxmlparts:1.1,documentevents:1.1,file:1.1,htmlcoercion:1.1,matrixbindings:1.1,matrixcoercion:1.1,ooxmlcoercion:1.1,pdffile:1.1,selection:1.1,settings:1.1,tablebindings:1.1,tablecoercion:1.1,textbindings:1.1,textcoercion:1.1,textfile:1.1,wordapi:1.1})||this}return __extends(t,e),t}(o);e.WordClientDefaultSetRequirement=l;var u=function(e){function t(){var t=e.call(this)||this;return t._addSetMap({customxmlparts:1.2,wordapi:1.2,imagecoercion:1.1}),t}return __extends(t,e),t}(l);e.WordClientV1DefaultSetRequirement=u;var p=function(e){function t(){return e.call(this,{activeview:1.1,compressedfile:1.1,documentevents:1.1,file:1.1,pdffile:1.1,selection:1.1,settings:1.1,textcoercion:1.1})||this}return __extends(t,e),t}(o);e.PowerpointClientDefaultSetRequirement=p;var d=function(e){function t(){var t=e.call(this)||this;return t._addSetMap({imagecoercion:1.1}),t}return __extends(t,e),t}(p);e.PowerpointClientV1DefaultSetRequirement=d;var f=function(e){function t(){return e.call(this,{selection:1.1,textcoercion:1.1})||this}return __extends(t,e),t}(o);e.ProjectClientDefaultSetRequirement=f;var h=function(e){function t(){return e.call(this,{bindingevents:1.1,documentevents:1.1,matrixbindings:1.1,matrixcoercion:1.1,selection:1.1,settings:1.1,tablebindings:1.1,tablecoercion:1.1,textbindings:1.1,textcoercion:1.1,file:1.1})||this}return __extends(t,e),t}(o);e.ExcelWebDefaultSetRequirement=h;var m=function(e){function t(){return e.call(this,{compressedfile:1.1,documentevents:1.1,file:1.1,imagecoercion:1.1,matrixcoercion:1.1,ooxmlcoercion:1.1,pdffile:1.1,selection:1.1,settings:1.1,tablecoercion:1.1,textcoercion:1.1,textfile:1.1})||this}return __extends(t,e),t}(o);e.WordWebDefaultSetRequirement=m;var g=function(e){function t(){return e.call(this,{activeview:1.1,settings:1.1})||this}return __extends(t,e),t}(o);e.PowerpointWebDefaultSetRequirement=g;var y=function(e){function t(){return e.call(this,{mailbox:1.3})||this}return __extends(t,e),t}(o);e.OutlookWebDefaultSetRequirement=y;var O=function(e){function t(){return e.call(this,{activeview:1.1,documentevents:1.1,selection:1.1,settings:1.1,textcoercion:1.1})||this}return __extends(t,e),t}(o);e.SwayWebDefaultSetRequirement=O;var _=function(e){function t(){return e.call(this,{bindingevents:1.1,partialtablebindings:1.1,settings:1.1,tablebindings:1.1,tablecoercion:1.1})||this}return __extends(t,e),t}(o);e.AccessWebDefaultSetRequirement=_;var b=function(e){function t(){return e.call(this,{bindingevents:1.1,documentevents:1.1,matrixbindings:1.1,matrixcoercion:1.1,selection:1.1,settings:1.1,tablebindings:1.1,tablecoercion:1.1,textbindings:1.1,textcoercion:1.1})||this}return __extends(t,e),t}(o);e.ExcelIOSDefaultSetRequirement=b;var v=function(e){function t(){return e.call(this,{bindingevents:1.1,compressedfile:1.1,customxmlparts:1.1,documentevents:1.1,file:1.1,htmlcoercion:1.1,matrixbindings:1.1,matrixcoercion:1.1,ooxmlcoercion:1.1,pdffile:1.1,selection:1.1,settings:1.1,tablebindings:1.1,tablecoercion:1.1,textbindings:1.1,textcoercion:1.1,textfile:1.1})||this}return __extends(t,e),t}(o);e.WordIOSDefaultSetRequirement=v;var S=function(e){function t(){var t=e.call(this)||this;return t._addSetMap({customxmlparts:1.2,wordapi:1.2}),t}return __extends(t,e),t}(v);e.WordIOSV1DefaultSetRequirement=S;var A=function(e){function t(){return e.call(this,{activeview:1.1,compressedfile:1.1,documentevents:1.1,file:1.1,pdffile:1.1,selection:1.1,settings:1.1,textcoercion:1.1})||this}return __extends(t,e),t}(o);e.PowerpointIOSDefaultSetRequirement=A;var D=function(e){function t(){return e.call(this,{mailbox:1.1})||this}return __extends(t,e),t}(o);e.OutlookIOSDefaultSetRequirement=D;var P=function(){function e(){}return e.initializeOsfDda=function(){OSF.OUtil.setNamespace("Requirement",OSF.DDA)},e.getDefaultRequirementMatrix=function(t){this.initializeDefaultSetMatrix();var r=void 0,i=t.get_requirementMatrix();if(void 0!=i&&i.length>0&&"undefined"!==typeof JSON){var a=JSON.parse(t.get_requirementMatrix().toLowerCase());try{a.hasOwnProperty("dialogorigin")||(a.dialogorigin=1.1)}catch(e){}r=new n(new o(a))}else{var s=e.getClientFullVersionString(t);r=void 0!=e.DefaultSetArrayMatrix&&void 0!=e.DefaultSetArrayMatrix[s]?new n(e.DefaultSetArrayMatrix[s]):new n(new o({}))}return r},e.getDefaultDialogRequirementMatrix=function(e){var t=void 0,a=e.get_dialogRequirementMatrix();if(void 0!=a&&a.length>0&&"undefined"!==typeof JSON){var s=JSON.parse(e.get_requirementMatrix().toLowerCase());t=new o(s)}else{t=new r;var c=e.get_requirementMatrix();if(void 0!=c&&c.length>0&&"undefined"!==typeof JSON){s=JSON.parse(c.toLowerCase());for(var l in t._sets)s.hasOwnProperty(l)&&(t._sets[l]=s[l]);var u=new i;for(var l in u._sets)s.hasOwnProperty(l)&&(t._sets[l]=s[l])}}try{!t._sets.hasOwnProperty("dialogorigin")&&window.opener&&(t._sets.dialogorigin=1.1)}catch(e){}return new n(t)},e.getClientFullVersionString=function(e){var t=e.get_appMinorVersion(),n="",o="",r=e.get_appName();return(1024==r||4096==r||8192==r||65536==r)&&1==e.get_appVersion()?o=4096==r&&t>=15?"16.00.01":"16.00":64==e.get_appName()?o=e.get_appVersion():(n=t<10?"0"+t:""+t,o=e.get_appVersion()+"."+n),e.get_appName()+"-"+o},e.initializeDefaultSetMatrix=function(){e.DefaultSetArrayMatrix[e.Excel_RCLIENT_1600]=new a,e.DefaultSetArrayMatrix[e.Word_RCLIENT_1600]=new l,e.DefaultSetArrayMatrix[e.PowerPoint_RCLIENT_1600]=new p,e.DefaultSetArrayMatrix[e.Excel_RCLIENT_1601]=new s,e.DefaultSetArrayMatrix[e.Word_RCLIENT_1601]=new u,e.DefaultSetArrayMatrix[e.PowerPoint_RCLIENT_1601]=new d,e.DefaultSetArrayMatrix[e.Outlook_RCLIENT_1600]=new c,e.DefaultSetArrayMatrix[e.Excel_WAC_1600]=new h,e.DefaultSetArrayMatrix[e.Word_WAC_1600]=new m,e.DefaultSetArrayMatrix[e.Outlook_WAC_1600]=new y,e.DefaultSetArrayMatrix[e.Outlook_WAC_1601]=new y,e.DefaultSetArrayMatrix[e.Project_RCLIENT_1600]=new f,e.DefaultSetArrayMatrix[e.Access_WAC_1600]=new _,e.DefaultSetArrayMatrix[e.PowerPoint_WAC_1600]=new g,e.DefaultSetArrayMatrix[e.Excel_IOS_1600]=new b,e.DefaultSetArrayMatrix[e.SWAY_WAC_1600]=new O,e.DefaultSetArrayMatrix[e.Word_IOS_1600]=new v,e.DefaultSetArrayMatrix[e.Word_IOS_16001]=new S,e.DefaultSetArrayMatrix[e.PowerPoint_IOS_1600]=new A,e.DefaultSetArrayMatrix[e.Outlook_IOS_1600]=new D},e.Excel_RCLIENT_1600="1-16.00",e.Excel_RCLIENT_1601="1-16.01",e.Word_RCLIENT_1600="2-16.00",e.Word_RCLIENT_1601="2-16.01",e.PowerPoint_RCLIENT_1600="4-16.00",e.PowerPoint_RCLIENT_1601="4-16.01",e.Outlook_RCLIENT_1600="8-16.00",e.Excel_WAC_1600="16-16.00",e.Word_WAC_1600="32-16.00",e.Outlook_WAC_1600="64-16.00",e.Outlook_WAC_1601="64-16.01",e.Project_RCLIENT_1600="128-16.00",e.Access_WAC_1600="256-16.00",e.PowerPoint_WAC_1600="512-16.00",e.Excel_IOS_1600="1024-16.00",e.SWAY_WAC_1600="2048-16.00",e.Word_IOS_1600="4096-16.00",e.Word_IOS_16001="4096-16.00.01",e.PowerPoint_IOS_1600="8192-16.00",e.Outlook_IOS_1600="65536-16.00",e.DefaultSetArrayMatrix={},e}();e.RequirementsMatrixFactory=P}(e.Requirement||(e.Requirement={}))}(OfficeExt||(OfficeExt={})),OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda(),Microsoft.Office.WebExtension.ApplicationMode={WebEditor:"webEditor",WebViewer:"webViewer",Client:"client"},Microsoft.Office.WebExtension.DocumentMode={ReadOnly:"readOnly",ReadWrite:"readWrite"},OSF.NamespaceManager=function(){var e,t=!1;return{enableShortcut:function(){t||(window.Office?e=window.Office:OSF.OUtil.setNamespace("Office",window),window.Office=Microsoft.Office.WebExtension,t=!0)},disableShortcut:function(){t&&(e?window.Office=e:OSF.OUtil.unsetNamespace("Office",window),t=!1)}}}(),OSF.NamespaceManager.enableShortcut(),Microsoft.Office.WebExtension.useShortNamespace=function(e){e?OSF.NamespaceManager.enableShortcut():OSF.NamespaceManager.disableShortcut()},Microsoft.Office.WebExtension.select=function(e,t){var n;if(e&&"string"==typeof e){var o=e.indexOf("#");if(-1!=o){var r=e.substring(0,o),i=e.substring(o+1);switch(r){case"binding":case"bindings":i&&(n=new OSF.DDA.BindingPromise(i))}}}if(n)return n.onFail=t,n;if(t){var a=typeof t;if("function"!=a)throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction,a);var s={};s[Microsoft.Office.WebExtension.Parameters.Callback]=t,OSF.DDA.issueAsyncResult(s,OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext,OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext))}},OSF.DDA.Context=function(e,t,n,o,r){if(OSF.OUtil.defineEnumerableProperties(this,{contentLanguage:{value:e.get_dataLocale()},displayLanguage:{value:e.get_appUILocale()},touchEnabled:{value:e.get_touchEnabled()},commerceAllowed:{value:e.get_commerceAllowed()},host:{value:OfficeExt.HostName.Host.getInstance().getHost()},platform:{value:OfficeExt.HostName.Host.getInstance().getPlatform()},isDialog:{value:OSF._OfficeAppFactory.getHostInfo().isDialog},diagnostics:{value:OfficeExt.HostName.Host.getInstance().getDiagnostics(e.get_hostFullVersion())}}),n&&OSF.OUtil.defineEnumerableProperty(this,"license",{value:n}),e.ui&&OSF.OUtil.defineEnumerableProperty(this,"ui",{value:e.ui}),e.auth&&OSF.OUtil.defineEnumerableProperty(this,"auth",{value:e.auth}),e.webAuth&&OSF.OUtil.defineEnumerableProperty(this,"webAuth",{value:e.webAuth}),e.application&&OSF.OUtil.defineEnumerableProperty(this,"application",{value:e.application}),e.extensionLifeCycle&&OSF.OUtil.defineEnumerableProperty(this,"extensionLifeCycle",{value:e.extensionLifeCycle}),e.messaging&&OSF.OUtil.defineEnumerableProperty(this,"messaging",{value:e.messaging}),e.ui&&e.ui.taskPaneAction&&OSF.OUtil.defineEnumerableProperty(this,"taskPaneAction",{value:e.ui.taskPaneAction}),e.ui&&e.ui.ribbonGallery&&OSF.OUtil.defineEnumerableProperty(this,"ribbonGallery",{value:e.ui.ribbonGallery}),e.get_isDialog()){var i=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultDialogRequirementMatrix(e);OSF.OUtil.defineEnumerableProperty(this,"requirements",{value:i})}else{if(t&&OSF.OUtil.defineEnumerableProperty(this,"document",{value:t}),o){var a=o.displayName||"appOM";delete o.displayName,OSF.OUtil.defineEnumerableProperty(this,a,{value:o})}e.get_officeTheme()?OSF.OUtil.defineEnumerableProperty(this,"officeTheme",{get:function(){return e.get_officeTheme()}}):r&&OSF.OUtil.defineEnumerableProperty(this,"officeTheme",{get:function(){return r()}});i=OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(e);OSF.OUtil.defineEnumerableProperty(this,"requirements",{value:i})}},OSF.DDA.OutlookContext=function(e,t,n,o,r){OSF.DDA.OutlookContext.uber.constructor.call(this,e,null,n,o,r),t&&OSF.OUtil.defineEnumerableProperty(this,"roamingSettings",{value:t})},OSF.OUtil.extend(OSF.DDA.OutlookContext,OSF.DDA.Context),OSF.DDA.OutlookAppOm=function(e,t,n){},OSF.DDA.Application=function(e){},OSF.DDA.Document=function(e,t){var n;switch(e.get_clientMode()){case OSF.ClientMode.ReadOnly:n=Microsoft.Office.WebExtension.DocumentMode.ReadOnly;break;case OSF.ClientMode.ReadWrite:n=Microsoft.Office.WebExtension.DocumentMode.ReadWrite}t&&OSF.OUtil.defineEnumerableProperty(this,"settings",{value:t}),OSF.OUtil.defineMutableProperties(this,{mode:{value:n},url:{value:e.get_docUrl()}})},OSF.DDA.JsomDocument=function(e,t,n){OSF.DDA.JsomDocument.uber.constructor.call(this,e,n),t&&OSF.OUtil.defineEnumerableProperty(this,"bindings",{get:function(){return t}});var o=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[o.GetSelectedDataAsync,o.SetSelectedDataAsync]),OSF.DDA.DispIdHost.addEventSupport(this,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged]))},OSF.OUtil.extend(OSF.DDA.JsomDocument,OSF.DDA.Document),OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension,"context",{get:function(){var e;return OSF&&OSF._OfficeAppFactory&&(e=OSF._OfficeAppFactory.getContext()),e}}),OSF.DDA.License=function(e){OSF.OUtil.defineEnumerableProperty(this,"value",{value:e})},OSF.DDA.ApiMethodCall=function(e,t,n,o,r){var i=e.length,a=OSF.OUtil.delayExecutionAndCache((function(){return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters,r)}));this.verifyArguments=function(e,t){for(var n in e){var o=e[n],r=t[n];if(o.enum)switch(typeof r){case"string":if(OSF.OUtil.listContainsValue(o.enum,r))break;case"undefined":throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration;default:throw a()}if(o.types&&!OSF.OUtil.listContainsValue(o.types,typeof r))throw a()}},this.extractRequiredArguments=function(t,n,o){if(t.lengths+2)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);for(var i,a,l=e.length-1;l>=s;l--){var u=e[l];switch(typeof u){case"object":if(i)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);i=u;break;case"function":if(a)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction);a=u;break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument)}}if(i=c.fillOptions(i,n,o,r),a){if(i[Microsoft.Office.WebExtension.Parameters.Callback])throw Strings.OfficeOM.L_RedundantCallbackSpecification;i[Microsoft.Office.WebExtension.Parameters.Callback]=a}return c.verifyArguments(t,i),i}(e,r,n,o);return c.constructCallArgs(r,i,n,o)},this.processResponse=function(e,t,n,i){return e==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess?o?o(t,n,i):t:r?r(e,t):OSF.DDA.ErrorCodeManager.getErrorArgs(e)},this.getCallArgs=function(e){for(var t,n,o=e.length-1;o>=s;o--){var r=e[o];switch(typeof r){case"object":t=r;break;case"function":n=r}}return t=t||{},n&&(t[Microsoft.Office.WebExtension.Parameters.Callback]=n),t}},OSF.DDA.AsyncMethodCallFactory=function(){return{manufacture:function(e){var t=e.supportedOptions?OSF.OUtil.createObject(e.supportedOptions):[],n=e.privateStateCallbacks?OSF.OUtil.createObject(e.privateStateCallbacks):[];return new OSF.DDA.AsyncMethodCall(e.requiredArguments||[],t,n,e.onSucceeded,e.onFailed,e.checkCallArgs,e.method.displayName)}}}(),OSF.DDA.AsyncMethodCalls={},OSF.DDA.AsyncMethodCalls.define=function(e){OSF.DDA.AsyncMethodCalls[e.method.id]=OSF.DDA.AsyncMethodCallFactory.manufacture(e)},OSF.DDA.Error=function(e,t,n){OSF.OUtil.defineEnumerableProperties(this,{name:{value:e},message:{value:t},code:{value:n}})},OSF.DDA.AsyncResult=function(e,t){OSF.OUtil.defineEnumerableProperties(this,{value:{value:e[OSF.DDA.AsyncResultEnum.Properties.Value]},status:{value:t?Microsoft.Office.WebExtension.AsyncResultStatus.Failed:Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded}}),e[OSF.DDA.AsyncResultEnum.Properties.Context]&&OSF.OUtil.defineEnumerableProperty(this,"asyncContext",{value:e[OSF.DDA.AsyncResultEnum.Properties.Context]}),t&&OSF.OUtil.defineEnumerableProperty(this,"error",{value:new OSF.DDA.Error(t[OSF.DDA.AsyncResultEnum.ErrorProperties.Name],t[OSF.DDA.AsyncResultEnum.ErrorProperties.Message],t[OSF.DDA.AsyncResultEnum.ErrorProperties.Code])})},OSF.DDA.issueAsyncResult=function(e,t,n){var o=e[Microsoft.Office.WebExtension.Parameters.Callback];if(o){var r,i={};i[OSF.DDA.AsyncResultEnum.Properties.Context]=e[Microsoft.Office.WebExtension.Parameters.AsyncContext],t==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess?i[OSF.DDA.AsyncResultEnum.Properties.Value]=n:(r={},n=n||OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError),r[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]=t||OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError,r[OSF.DDA.AsyncResultEnum.ErrorProperties.Name]=n.name||n,r[OSF.DDA.AsyncResultEnum.ErrorProperties.Message]=n.message||n),o(new OSF.DDA.AsyncResult(i,r))}},OSF.DDA.SyncMethodNames={},OSF.DDA.SyncMethodNames.addNames=function(e){for(var t in e){var n={};OSF.OUtil.defineEnumerableProperties(n,{id:{value:t},displayName:{value:e[t]}}),OSF.DDA.SyncMethodNames[t]=n}},OSF.DDA.SyncMethodCall=function(e,t,n,o,r){var i=e.length,a=new OSF.DDA.ApiMethodCall(e,t,n,o,r);this.verifyAndExtractCall=function(e,n,o){var r=a.extractRequiredArguments(e,n,o),s=function(e,n,o,r){if(e.length>i+1)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);for(var s,c=e.length-1;c>=i;c--){var l=e[c];switch(typeof l){case"object":if(s)throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);s=l;break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument)}}return s=a.fillOptions(s,n,o,r),a.verifyArguments(t,s),s}(e,r,n,o);return a.constructCallArgs(r,s,n,o)}},OSF.DDA.SyncMethodCallFactory=function(){return{manufacture:function(e){var t=e.supportedOptions?OSF.OUtil.createObject(e.supportedOptions):[];return new OSF.DDA.SyncMethodCall(e.requiredArguments||[],t,e.privateStateCallbacks,e.checkCallArgs,e.method.displayName)}}}(),OSF.DDA.SyncMethodCalls={},OSF.DDA.SyncMethodCalls.define=function(e){OSF.DDA.SyncMethodCalls[e.method.id]=OSF.DDA.SyncMethodCallFactory.manufacture(e)},OSF.DDA.ListType=function(){var e={};return{setListType:function(t,n){e[t]=n},isListType:function(t){return OSF.OUtil.listContainsKey(e,t)},getDescriptor:function(t){return e[t]}}}(),OSF.DDA.HostParameterMap=function(e,t){var n={};function o(r,i){var a=r?{}:void 0;for(var s in r){var c,l=r[s];if(OSF.DDA.ListType.isListType(s))for(var u in c=[],l)c.push(o(l[u],i));else if(OSF.OUtil.listContainsKey(n,s))c=n[s][i](l);else if("fromHost"==i&&e.preserveNesting(s))c=o(l,i);else{var p=t[s];if(p){var d=p[i];d&&void 0===(c=d[l])&&(c=l)}else c=l}a[s]=c}return a}function r(n,r,i){var a,s=t[n][i];if("toHost"==i)a=function n(o,r){var i;for(var a in r){var s;if(void 0!=(s=e.isComplexType(a)?n(o,t[a].toHost):o[a])){i||(i={});var c=r[a];"self"==c&&(c=a),i[c]=e.pack(a,s)}}return i}(o(r,i),s);else if("fromHost"==i){a=o(function n(o,r,i){for(var a in i||(i={}),r){var s,c,l=r[a];if("self"==l)s=o;else{if("sourceData"==l){i[a]=o.toArray();continue}s=o[l]}if(null===s||void 0===s)i[a]=void 0;else if(s=e.unpack(a,s),e.isComplexType(a))c=t[a].fromHost,e.preserveNesting(a)?i[a]=n(s,c):n(s,c,i);else if(OSF.DDA.ListType.isListType(a)){(c={})[OSF.DDA.ListType.getDescriptor(a)]="self";var u=new Array(s.length);for(var p in s)u[p]=n(s[p],c);i[a]=u}else i[a]=s}return i}(r,s),i)}return a}n[Microsoft.Office.WebExtension.Parameters.Data]={toHost:function(e){if(null!=e&&void 0!==e.rows){var t={};t[OSF.DDA.TableDataProperties.TableRows]=e.rows,t[OSF.DDA.TableDataProperties.TableHeaders]=e.headers,e=t}return e},fromHost:function(e){return e}},n[Microsoft.Office.WebExtension.Parameters.SampleData]=n[Microsoft.Office.WebExtension.Parameters.Data],t||(t={}),this.addMapping=function(e,n){var o,r;if(n.map)for(var i in r={},o=n.map){var a=o[i];"self"==a&&(a=i),r[a]=i}else o=n.toHost,r=n.fromHost;var s=t[e];if(s){var c=s.toHost;for(var l in c)o[l]=c[l];for(var u in c=s.fromHost)r[u]=c[u]}else s=t[e]={};s.toHost=o,s.fromHost=r},this.toHost=function(e,t){return r(e,t,"toHost")},this.fromHost=function(e,t){return r(e,t,"fromHost")},this.self="self",this.sourceData="sourceData",this.addComplexType=function(t){e.addComplexType(t)},this.getDynamicType=function(t){return e.getDynamicType(t)},this.setDynamicType=function(t,n){e.setDynamicType(t,n)},this.dynamicTypes=n,this.doMapValues=function(e,t){return o(e,t)}},OSF.DDA.SpecialProcessor=function(e,t){this.addComplexType=function(t){e.push(t)},this.getDynamicType=function(e){return t[e]},this.setDynamicType=function(e,n){t[e]=n},this.isComplexType=function(t){return OSF.OUtil.listContainsValue(e,t)},this.isDynamicType=function(e){return OSF.OUtil.listContainsKey(t,e)},this.preserveNesting=function(e){var t=[];return OSF.DDA.PropertyDescriptors&&t.push(OSF.DDA.PropertyDescriptors.Subset),OSF.DDA.DataNodeEventProperties&&(t=t.concat([OSF.DDA.DataNodeEventProperties.OldNode,OSF.DDA.DataNodeEventProperties.NewNode,OSF.DDA.DataNodeEventProperties.NextSiblingNode])),OSF.OUtil.listContainsValue(t,e)},this.pack=function(e,n){return this.isDynamicType(e)?t[e].toHost(n):n},this.unpack=function(e,n){return this.isDynamicType(e)?t[e].fromHost(n):n}},OSF.DDA.getDecoratedParameterMap=function(e,t){var n=new OSF.DDA.HostParameterMap(e);n.self;function o(e){var t=null;if(e){t={};for(var n=e.length,o=0;o-1||e.indexOf("Trident/")>-1||e.indexOf("Edge/")>-1}catch(e){return o("Error happens in isInternetExplorer.",e),!1}}function o(e,n){OsfMsAjaxFactory.msAjaxDebug.trace(e+" Exception details: "+t(n))}e.parseAppContextFromWindowName=function(e,t){return OSF.OUtil.parseInfoFromWindowName(e,t,OSF.WindowNameItemKeys.AppContext)},e.serializeObjectToString=t,e.isHostTrusted=function(){return new RegExp("^https://[a-z0-9-]+.(officeapps.live|officeapps-df.live|partner.officewebapps).com/").test(OSF.getClientEndPoint()._targetUrl.toLowerCase())},e.addHostInfoAsQueryParam=function(e,t){if(!e)return null;var n,o="#",r=(e=e.trim()||"").split(o),i=r.shift(),a=r.join(o),s=i.split("?");return s.length>1?n=i+"&_host_Info="+t:s.length>0&&(n=i+"?_host_Info="+t),a?[n,o,a].join(""):n},e.getDomainForUrl=function(e){if(!e)return null;var t=document.createElement("a");return t.href=e,t.protocol+"//"+t.host},e.shouldUseLocalStorageToPassMessage=function(){try{for(var e=["Windows NT 6.1","Windows NT 6.2","Windows NT 6.3","Windows NT 10.0"],t=window.navigator.userAgent,r=0,i=e.length;r-1)return n();return!1}catch(e){return o("Error happens in shouldUseLocalStorageToPassMessage.",e),!1}},e.isInternetExplorer=n,e.removeMatchesFromLocalStorage=function(e){for(var t=OSF.OUtil.getLocalStorage(),n=t.getKeysWithPrefix(""),o=0,r=n.length;o0){for(var o=[],r=0;r=r)break;if(o=Function._validateParameter(e[i],s,c))return o.popStackFrame(),o}return null}),Function._validateParameterCount||(Function._validateParameterCount=function(e,t,o){var r,i,a=t.length,s=e.length;if(sa)for(i=!0,r=0;r0?u(e.shift()):(clearInterval(n),n=null)):OsfMsAjaxFactory.msAjaxDebug.trace("channel is not ready.")}function u(e){o=e.getInvokeBlockingFlag(),e.invoke(),t=(new Date).getTime()}function p(){if(r){var e,t,n=0,o=new Date;for(var a in s)for(var c in(e=s[a])._callbackList){var l=e._callbackList[c];if((t=l.timeout?l.timeout:i)>=0&&Math.abs(o.getTime()-l.createdOn)>=t)try{l.callback&&l.callback(Microsoft.Office.Common.InvokeResultCode.errorHandlingMethodCallTimedout,null)}finally{delete e._callbackList[c]}else n++}0===n&&(clearInterval(r),r=null)}else OsfMsAjaxFactory.msAjaxDebug.trace("channel is not ready.")}function d(){o=!1}function f(e,t){var n=!1;if(!t||"null"===t||!t.length||!e||!(e instanceof Array)||!e.length)return n;var o=document.createElement("a"),r=document.createElement("a");o.href=t;for(var i=0;is.length+1&&(l=a.slice(-(s.length+1))==="."+s),i&&r&&(c||l)}function g(e,t){return y(OSF.OUtil.parseUrl(e,!0),OSF.OUtil.parseUrl(t,!0))}function y(e,t){return e.hostname==t.hostname&&e.protocol==t.protocol&&O(e,t)}function O(e,t){return e.port==t.port||""==e.port&&"http:"==e.protocol&&"80"==t.port||""==e.port&&"https:"==e.protocol&&"443"==t.port||""==t.port&&"http:"==t.protocol&&"80"==e.port||""==t.port&&"https:"==t.protocol&&"443"==e.port}function _(r){if(OSF&&""!=r.data){var i,c=OSF.SerializerVersion.Browser,p=r.data;try{c=null!=(i=Microsoft.Office.Common.MessagePackager.unenvelope(p,OSF.SerializerVersion.Browser))._serializerVersion?i._serializerVersion:c}catch(e){return}if(i._messageType===Microsoft.Office.Common.MessageType.request){var O=null==r.origin||"null"===r.origin?i._origin:r.origin;try{var _=function(e){for(var t in a)if(a[t]._conversations[e])return a[t];throw OsfMsAjaxFactory.msAjaxDebug.trace("Unknown conversation Id."),OsfMsAjaxFactory.msAjaxError.argument("conversationId")}(i._conversationId),b=_._conversations[i._conversationId];c=null!=b.serializerVersion?b.serializerVersion:c;var v=[b.url].concat(_._appDomains[i._conversationId]);if(!f(v,r.origin))if(!OfficeExt.appSpecificCheckOrigin(v,r,i._origin,f))if(!m(b.url,r.origin))throw"Failed origin check";var S=null!=i._data?i._data:{};S.SecurityOrigin=r.origin;var A=_.getPolicyManager();if(A&&!A.checkPermission(i._conversationId,i._actionName,S))throw"Access Denied";var D=function(e,t){var n=e._methodObjectList[t._actionName];if(!n)throw OsfMsAjaxFactory.msAjaxDebug.trace("The specified method is not registered on service endpoint:"+t._actionName),OsfMsAjaxFactory.msAjaxError.argument("messageObject");return t._actionType===Microsoft.Office.Common.ActionType.invoke?n:t._actionType===Microsoft.Office.Common.ActionType.registerEvent?n.getRegisterMethodObject():n.getUnregisterMethodObject()}(_,i),P=new Microsoft.Office.Common.InvokeCompleteCallback(r.source,O,i._actionName,i._conversationId,i._correlationId,d,c),C=new Microsoft.Office.Common.Invoker(D,S,P,_._eventHandlerProxyList,i._conversationId,i._actionName,c),I=!0;null==n&&((null==t||(new Date).getTime()-t>10)&&!o?(u(C),I=!1):n=setInterval(l,10)),I&&function(t){e.push(t)}(C)}catch(e){_&&_._onHandleRequestError&&_._onHandleRequestError(i,e);var F=Microsoft.Office.Common.InvokeResultCode.errorHandlingRequest;"Access Denied"==e&&(F=Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied);var E=new Microsoft.Office.Common.Response(i._actionName,i._conversationId,i._correlationId,F,Microsoft.Office.Common.ResponseType.forCalling,e),R=Microsoft.Office.Common.MessagePackager.envelope(E,c),N=!1;try{N=!(!r.source||!r.source.postMessage)}catch(e){}var M=!1;if(window.location.href&&r.origin&&"null"!==r.origin&&m(window.location.href,r.origin))M=!0;else if(r.origin&&"null"!==r.origin)if(OSF.OUtil.checkFlight(OSF.FlightNames.AddinEnforceHttps)){M=h(OSF.OUtil.parseUrl(r.origin,!0).hostname)}else{var x=document.createElement("a");x.href=r.origin,M=h(x.hostname)}N&&M&&r.source.postMessage(R,O)}}else{if(i._messageType!==Microsoft.Office.Common.MessageType.response)return;var T=function(e){var t=s[e];return t||OsfMsAjaxFactory.msAjaxDebug.trace("Unknown conversation Id."),t}(i._conversationId);if(!T)return;if(T._serializerVersion=c,!function(e,t){var n,o,r=!1;return e&&t&&"null"!==e&&"null"!==t&&e.length&&t.length?(OSF.OUtil.checkFlight(OSF.FlightNames.AddinEnforceHttps)?r=g(e,t):(n=document.createElement("a"),o=document.createElement("a"),n.href=e,o.href=t,r=y(n,o)),r):r}(T._targetUrl,r.origin))throw"Failed orgin check";if(i._responseType===Microsoft.Office.Common.ResponseType.forCalling){var j=T._callbackList[i._correlationId];if(j)try{j.callback&&j.callback(i._errorCode,i._data)}finally{delete T._callbackList[i._correlationId]}}else{var w=T._eventHandlerList[i._actionName];void 0!==w&&null!==w&&w(i._data)}}}}function b(){c||(!function(e){if(window.addEventListener)window.addEventListener("message",e,!1);else{if(!(navigator.userAgent.indexOf("MSIE")>-1&&window.attachEvent))throw OsfMsAjaxFactory.msAjaxDebug.trace("Browser doesn't support the required API."),OsfMsAjaxFactory.msAjaxError.argument("Browser");window.attachEvent("onmessage",e)}}(_),c=!0)}return{connect:function(e,t,n,o){var r=s[e];return r||(b(),r=new Microsoft.Office.Common.ClientEndPoint(e,t,n,o),s[e]=r),r},getClientEndPoint:function(e){var t=Function._validateParams(arguments,[{name:"conversationId",type:String,mayBeNull:!1}]);if(t)throw t;return s[e]},createServiceEndPoint:function(e){b();var t=new Microsoft.Office.Common.ServiceEndPoint(e);return a[e]=t,t},getServiceEndPoint:function(e){var t=Function._validateParams(arguments,[{name:"serviceEndPointId",type:String,mayBeNull:!1}]);if(t)throw t;return a[e]},deleteClientEndPoint:function(e){var t=Function._validateParams(arguments,[{name:"conversationId",type:String,mayBeNull:!1}]);if(t)throw t;delete s[e]},deleteServiceEndPoint:function(e){var t=Function._validateParams(arguments,[{name:"serviceEndPointId",type:String,mayBeNull:!1}]);if(t)throw t;delete a[e]},urlCompare:function(e,t){return y(e,t)},checkUrlWithAppDomains:function(e,t){return f(e,t)},isTargetSubdomainOfSourceLocation:function(e,t){return m(e,t)},_setMethodTimeout:function(e){var t=Function._validateParams(arguments,[{name:"methodTimeout",type:Number,mayBeNull:!1}]);if(t)throw t;i=e<=0?65e3:e},_startMethodTimeoutTimer:function(){r||(r=setInterval(p,2e3))},isHostNameValidWacDomain:function(e){return h(e)},_hasSamePort:function(e,t){return O(e,t)}}}(),Microsoft.Office.Common.Message=function(e,t,n,o,r){var i=Function._validateParams(arguments,[{name:"messageType",type:Number,mayBeNull:!1},{name:"actionName",type:String,mayBeNull:!1},{name:"conversationId",type:String,mayBeNull:!1},{name:"correlationId",mayBeNull:!1},{name:"data",mayBeNull:!0,optional:!0}]);if(i)throw i;this._messageType=e,this._actionName=t,this._conversationId=n,this._correlationId=o,this._origin=window.location.origin,this._data="undefined"==typeof r?null:r},Microsoft.Office.Common.Message.prototype={getActionName:function(){return this._actionName},getConversationId:function(){return this._conversationId},getCorrelationId:function(){return this._correlationId},getOrigin:function(){return this._origin},getData:function(){return this._data},getMessageType:function(){return this._messageType}},Microsoft.Office.Common.Request=function(e,t,n,o,r){Microsoft.Office.Common.Request.uber.constructor.call(this,Microsoft.Office.Common.MessageType.request,e,n,o,r),this._actionType=t},OSF.OUtil.extend(Microsoft.Office.Common.Request,Microsoft.Office.Common.Message),Microsoft.Office.Common.Request.prototype.getActionType=function(){return this._actionType},Microsoft.Office.Common.Response=function(e,t,n,o,r,i){Microsoft.Office.Common.Response.uber.constructor.call(this,Microsoft.Office.Common.MessageType.response,e,t,n,i),this._errorCode=o,this._responseType=r},OSF.OUtil.extend(Microsoft.Office.Common.Response,Microsoft.Office.Common.Message),Microsoft.Office.Common.Response.prototype.getErrorCode=function(){return this._errorCode},Microsoft.Office.Common.Response.prototype.getResponseType=function(){return this._responseType},Microsoft.Office.Common.MessagePackager={envelope:function(e,t){return"object"===typeof e&&(e._serializerVersion=OSF.SerializerVersion.Browser),JSON.stringify(e)},unenvelope:function(e,t){return JSON.parse(e)}},Microsoft.Office.Common.ResponseSender=function(e,t,n,o,r,i,a){var s=Function._validateParams(arguments,[{name:"requesterWindow",mayBeNull:!1},{name:"requesterUrl",type:String,mayBeNull:!1},{name:"actionName",type:String,mayBeNull:!1},{name:"conversationId",type:String,mayBeNull:!1},{name:"correlationId",mayBeNull:!1},{name:"responsetype",type:Number,maybeNull:!1},{name:"serializerVersion",type:Number,maybeNull:!0,optional:!0}]);if(s)throw s;this._requesterWindow=e,this._requesterUrl=t,this._actionName=n,this._conversationId=o,this._correlationId=r,this._invokeResultCode=Microsoft.Office.Common.InvokeResultCode.noError,this._responseType=i;var c=this;this._send=function(e){var t=function(e,t){var n=OSF.OUtil.parseUrl(e),o=OSF.OUtil.parseUrl(t);if(!(n&&n.hostname&&o&&o.hostname)){var r="Failed to execute 'postMessage' on 'DOMWindow': The target origin provided or the recipient window's origin are undefined.";return console.log(r),!1}if(!Microsoft.Office.Common.XdmCommunicationManager.urlCompare(n,o)){r="Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('"+(n?n.protocol+"//"+n.hostname+(n.port?":"+n.port:""):"undefined")+"') does not match the recipient window's origin ('"+(o?o.protocol+"//"+o.hostname+(o.port?":"+o.port:""):"undefined")+"').";return console.log(r),!1}return!0};try{if("dialogMessageReceived"===c._actionName&&"*"!==e.targetOrigin){if(e.targetOrigin&&!t(e.targetOrigin,c._requesterUrl))return}else if("dialogParentMessageReceived"===c._actionName&&e.targetOrigin&&"*"!==e.targetOrigin&&!t(e.targetOrigin,c._requesterUrl))return;var n=new Microsoft.Office.Common.Response(c._actionName,c._conversationId,c._correlationId,c._invokeResultCode,c._responseType,e),o=Microsoft.Office.Common.MessagePackager.envelope(n,a);c._requesterWindow.postMessage(o,c._requesterUrl)}catch(e){OsfMsAjaxFactory.msAjaxDebug.trace("ResponseSender._send error:"+e.message)}}},Microsoft.Office.Common.ResponseSender.prototype={getRequesterWindow:function(){return this._requesterWindow},getRequesterUrl:function(){return this._requesterUrl},getActionName:function(){return this._actionName},getConversationId:function(){return this._conversationId},getCorrelationId:function(){return this._correlationId},getSend:function(){return this._send},setResultCode:function(e){this._invokeResultCode=e}},Microsoft.Office.Common.InvokeCompleteCallback=function(e,t,n,o,r,i,a){Microsoft.Office.Common.InvokeCompleteCallback.uber.constructor.call(this,e,t,n,o,r,Microsoft.Office.Common.ResponseType.forCalling,a),this._postCallbackHandler=i;var s=this;this._send=function(e,t){void 0!=t&&(s._invokeResultCode=t);try{var n=new Microsoft.Office.Common.Response(s._actionName,s._conversationId,s._correlationId,s._invokeResultCode,s._responseType,e),o=Microsoft.Office.Common.MessagePackager.envelope(n,a);s._requesterWindow.postMessage(o,s._requesterUrl),s._postCallbackHandler()}catch(e){OsfMsAjaxFactory.msAjaxDebug.trace("InvokeCompleteCallback._send error:"+e.message)}}},OSF.OUtil.extend(Microsoft.Office.Common.InvokeCompleteCallback,Microsoft.Office.Common.ResponseSender),Microsoft.Office.Common.Invoker=function(e,t,n,o,r,i,a){var s=Function._validateParams(arguments,[{name:"methodObject",mayBeNull:!1},{name:"paramValue",mayBeNull:!0},{name:"invokeCompleteCallback",mayBeNull:!1},{name:"eventHandlerProxyList",mayBeNull:!0},{name:"conversationId",type:String,mayBeNull:!1},{name:"eventName",type:String,mayBeNull:!1},{name:"serializerVersion",type:Number,mayBeNull:!0,optional:!0}]);if(s)throw s;this._methodObject=e,this._param=t,this._invokeCompleteCallback=n,this._eventHandlerProxyList=o,this._conversationId=r,this._eventName=i,this._serializerVersion=a},Microsoft.Office.Common.Invoker.prototype={invoke:function(){try{var e;switch(this._methodObject.getInvokeType()){case Microsoft.Office.Common.InvokeType.async:this._methodObject.getMethod()(this._param,this._invokeCompleteCallback.getSend());break;case Microsoft.Office.Common.InvokeType.sync:e=this._methodObject.getMethod()(this._param),this._invokeCompleteCallback.getSend()(e);break;case Microsoft.Office.Common.InvokeType.syncRegisterEvent: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 Microsoft.Office.Common.InvokeType.syncUnregisterEvent: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 Microsoft.Office.Common.InvokeType.asyncRegisterEvent: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 Microsoft.Office.Common.InvokeType.asyncUnregisterEvent: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(Microsoft.Office.Common.InvokeResultCode.errorInResponse),this._invokeCompleteCallback.getSend()(e)}},getInvokeBlockingFlag:function(){return this._methodObject.getBlockingFlag()},_createEventHandlerProxyObject:function(e){return new Microsoft.Office.Common.ResponseSender(e.getRequesterWindow(),e.getRequesterUrl(),e.getActionName(),e.getConversationId(),e.getCorrelationId(),Microsoft.Office.Common.ResponseType.forEventing,this._serializerVersion)}},OSF.OUtil.setNamespace("WAC",OSF.DDA),OSF.DDA.WAC.UniqueArguments={Data:"Data",Properties:"Properties",BindingRequest:"DdaBindingsMethod",BindingResponse:"Bindings",SingleBindingResponse:"singleBindingResponse",GetData:"DdaGetBindingData",AddRowsColumns:"DdaAddRowsColumns",SetData:"DdaSetBindingData",ClearFormats:"DdaClearBindingFormats",SetFormats:"DdaSetBindingFormats",SettingsRequest:"DdaSettingsMethod",BindingEventSource:"ddaBinding",ArrayData:"ArrayData"},OSF.OUtil.setNamespace("Delegate",OSF.DDA.WAC),OSF.DDA.WAC.Delegate.SpecialProcessor=function(){var e=[OSF.DDA.WAC.UniqueArguments.SingleBindingResponse,OSF.DDA.WAC.UniqueArguments.BindingRequest,OSF.DDA.WAC.UniqueArguments.BindingResponse,OSF.DDA.WAC.UniqueArguments.GetData,OSF.DDA.WAC.UniqueArguments.AddRowsColumns,OSF.DDA.WAC.UniqueArguments.SetData,OSF.DDA.WAC.UniqueArguments.ClearFormats,OSF.DDA.WAC.UniqueArguments.SetFormats,OSF.DDA.WAC.UniqueArguments.SettingsRequest,OSF.DDA.WAC.UniqueArguments.BindingEventSource];OSF.DDA.WAC.Delegate.SpecialProcessor.uber.constructor.call(this,e,{})},OSF.OUtil.extend(OSF.DDA.WAC.Delegate.SpecialProcessor,OSF.DDA.SpecialProcessor),OSF.DDA.WAC.Delegate.ParameterMap=OSF.DDA.getDecoratedParameterMap(new OSF.DDA.WAC.Delegate.SpecialProcessor,[]),OSF.OUtil.setNamespace("WAC",OSF.DDA),OSF.OUtil.setNamespace("Delegate",OSF.DDA.WAC),OSF.DDA.WAC.getDelegateMethods=function(){var e={};return e[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.WAC.Delegate.executeAsync,e[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.WAC.Delegate.registerEventAsync,e[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.WAC.Delegate.unregisterEventAsync,e[OSF.DDA.DispIdHost.Delegates.OpenDialog]=OSF.DDA.WAC.Delegate.openDialog,e[OSF.DDA.DispIdHost.Delegates.MessageParent]=OSF.DDA.WAC.Delegate.messageParent,e[OSF.DDA.DispIdHost.Delegates.SendMessage]=OSF.DDA.WAC.Delegate.sendMessage,e[OSF.DDA.DispIdHost.Delegates.CloseDialog]=OSF.DDA.WAC.Delegate.closeDialog,e},OSF.DDA.WAC.Delegate.version=1,OSF.DDA.WAC.Delegate.executeAsync=function(e){e.hostCallArgs||(e.hostCallArgs={}),e.hostCallArgs.DdaMethod={ControlId:OSF._OfficeAppFactory.getId(),Version:OSF.DDA.WAC.Delegate.version,DispatchId:e.dispId},e.hostCallArgs.__timeout__=-1,e.onCalling&&e.onCalling(),OSF.getClientEndPoint()&&OSF.getClientEndPoint().invoke("executeMethod",(function(t,n){var o;if(e.onReceiving&&e.onReceiving(),t==Microsoft.Office.Common.InvokeResultCode.noError)OSF.DDA.WAC.Delegate.version=n.Version,o=n.Error;else switch(t){case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied:o=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;break;default:o=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError}e.onComplete&&e.onComplete(o,n)}),e.hostCallArgs)},OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent=function(e,t){var n=(new Date).getTime();return function(o,r){var i;if(t.onReceiving&&t.onReceiving(),o!=Microsoft.Office.Common.InvokeResultCode.noError)switch(o){case Microsoft.Office.Common.InvokeResultCode.errorHandlingRequestAccessDenied:i=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;break;default:i=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError}else i=r?r.Error?r.Error:OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess:OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;t.onComplete&&t.onComplete(i),OSF.AppTelemetry&&OSF.AppTelemetry.onRegisterDone(e,t.dispId,Math.abs((new Date).getTime()-n),i)}},OSF.DDA.WAC.Delegate.registerEventAsync=function(e){e.onCalling&&e.onCalling(),OSF.getClientEndPoint()&&OSF.getClientEndPoint().registerForEvent(OSF.DDA.getXdmEventName(e.targetId,e.eventType),(function(t){e.onEvent&&e.onEvent(t),OSF.AppTelemetry&&OSF.AppTelemetry.onEventDone(e.dispId)}),OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(!0,e),{controlId:OSF._OfficeAppFactory.getId(),eventDispId:e.dispId,targetId:e.targetId})},OSF.DDA.WAC.Delegate.unregisterEventAsync=function(e){e.onCalling&&e.onCalling(),OSF.getClientEndPoint()&&OSF.getClientEndPoint().unregisterForEvent(OSF.DDA.getXdmEventName(e.targetId,e.eventType),OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(!1,e),{controlId:OSF._OfficeAppFactory.getId(),eventDispId:e.dispId,targetId:e.targetId})},OSF.OUtil.setNamespace("WebApp",OSF),OSF.OUtil.setNamespace("Messaging",OSF),OSF.OUtil.setNamespace("ExtensionLifeCycle",OSF),OSF.OUtil.setNamespace("TaskPaneAction",OSF),OSF.OUtil.setNamespace("RibbonGallery",OSF),OSF.WebApp.AddHostInfoAndXdmInfo=function(e){return OSF._OfficeAppFactory.getWindowLocationSearch&&OSF._OfficeAppFactory.getWindowLocationHash?e+OSF._OfficeAppFactory.getWindowLocationSearch()+OSF._OfficeAppFactory.getWindowLocationHash():e},OSF.WebApp._UpdateLinksForHostAndXdmInfo=function(){for(var e=document.querySelectorAll("a[data-officejs-navigate]"),t=0;t0?e.substr(0,t):null,o=null===n||("http"===n.toLowerCase()||"https"===n.toLowerCase());return o=o&&"#"!=e&&"/"!=e&&""!=e&&e!=OSF._OfficeAppFactory.getWebAppState().webAppUrl},OSF.InitializationHelper=function(e,t,n,o,r){this._hostInfo=e,this._webAppState=t,this._context=n,this._settings=o,this._hostFacade=r,this._appContext={},this._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'])",this._initializeSettings=function(e,t){var n=e.get_settings(),o=OSF.OUtil.getSessionStorage();if(o){var r=o.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey());r?n=JSON.parse(r):(r=JSON.stringify(n),o.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(),r))}var i=OSF.DDA.SettingsManager.deserializeSettings(n);return t?new OSF.DDA.RefreshableSettings(i):new OSF.DDA.Settings(i)};!function(e){var t=window.open;e.open=function(e,n,o){var r=null;try{r=t(e,n,o)}catch(e){OSF.AppTelemetry&&OSF.AppTelemetry.logAppCommonMessage("Exception happens at windowOpen."+e)}if(!r){var i={strUrl:e,strWindowName:n,strWindowFeatures:o};OSF._OfficeAppFactory.getClientEndPoint()&&OSF._OfficeAppFactory.getClientEndPoint().invoke("ContextActivationManager_openWindowInHost",null,i)}return r}}(window)},OSF.InitializationHelper.prototype.saveAndSetDialogInfo=function(e){var t=OSF.OUtil.getSessionStorage();if(t){if(e||(e=OSF.OUtil.parseHostInfoFromWindowName(!0,OSF._OfficeAppFactory.getWindowName())),e&&e.indexOf("isDialog")>-1){var n=function(){var e=OSF.OUtil.parseXdmInfo(!0);return e?e.split("|")[1]:null}();return null!=n&&t.setItem(n+"IsDialog","true"),void(this._hostInfo.isDialog=!0)}this._hostInfo.isDialog=null!=t.getItem(OSF.OUtil.getXdmFieldValue(OSF.XdmFieldName.AppId,!1)+"IsDialog")}},OSF.InitializationHelper.prototype.getAppContext=function(e,t){OSF.AppTelemetry&&OSF.AppTelemetry.logAppCommonMessage("OsfControl activation lifecycle: getAppContext got called.");var n=this,o=function(e,o){var r;if(o._appName===OSF.AppName.ExcelWebApp){var i=o._settings;for(var a in r={},i){var s=i[a];r[s[0]]=s[1]}}else r=o._settings;if(o._appName===OSF.AppName.OutlookWebApp&&o._requirementMatrix&&-1==o._requirementMatrix.indexOf("react")&&(OSF.AgaveHostAction.SendTelemetryEvent=void 0),!n._hostInfo.isDialog||null==window.opener){var c=window.location.origin;n._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[n._webAppState.id,OSF.AgaveHostAction.UpdateTargetUrl,c])}if(0!==e||void 0==o._id||void 0==o._appName||void 0==o._appVersion||void 0==o._appUILocale||void 0==o._dataLocale||void 0==o._docUrl||void 0==o._clientMode||void 0==o._settings||void 0==o._reason){var l="Function ContextActivationManager_getAppContextAsync call failed. ErrorCode is "+e+", exception: "+o;throw OSF.AppTelemetry&&OSF.AppTelemetry.logAppException(l),l}n._appContext=o;var u=o._appInstanceId?o._appInstanceId:o._id,p=0;void 0!=o._appMinorVersion&&(p=o._appMinorVersion);var d=void 0;void 0!=o._requirementMatrix&&(d=o._requirementMatrix),o.eToken=o.eToken?o.eToken:"";var f=new OSF.OfficeAppContext(o._id,o._appName,o._appVersion,o._appUILocale,o._dataLocale,o._docUrl,o._clientMode,r,o._reason,o._osfControlType,o._eToken,o._correlationId,u,!1,!0,p,d,o._hostCustomMessage,o._hostFullVersion,o._clientWindowHeight,o._clientWindowWidth,o._addinName,o._appDomains,o._dialogRequirementMatrix,o._featureGates,void 0,o._initialDisplayMode);f._wacHostEnvironment=o._wacHostEnvironment||"0",f._isFromWacAutomation=!!o._isFromWacAutomation,OSF.AppTelemetry&&OSF.AppTelemetry.initialize(f),t(f)};try{if(this._hostInfo.isDialog&&null!=window.opener)o(0,OfficeExt.WACUtils.parseAppContextFromWindowName(!1,OSF._OfficeAppFactory.getWindowName()));else this._webAppState.clientEndPoint.invoke("ContextActivationManager_getAppContextAsync",o,this._webAppState.id)}catch(e){throw OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Exception thrown when trying to invoke getAppContextAsync. Exception:["+e+"]"),e}},OSF.InitializationHelper.prototype.isHostOriginTrusted=function(e){},OSF.InitializationHelper.prototype.checkReceiverOriginAndRun=function(e){var t=this,n=OSF.OUtil.parseUrl(t._webAppState.clientEndPoint._targetUrl,!1),o="https:"==n.protocol;if(t._webAppState.clientEndPoint._hostTrustCheckStatus===Microsoft.Office.Common.HostTrustStatus.unknown&&(o||(t._webAppState.clientEndPoint._hostTrustCheckStatus=Microsoft.Office.Common.HostTrustStatus.nothttps),t._webAppState.clientEndPoint._hostTrustCheckStatus!=Microsoft.Office.Common.HostTrustStatus.nothttps)){var r=Microsoft.Office.Common.XdmCommunicationManager.isHostNameValidWacDomain(n.hostname);t.isHostOriginTrusted&&(r=r||t.isHostOriginTrusted(n.hostname)),r&&(t._webAppState.clientEndPoint._hostTrustCheckStatus=Microsoft.Office.Common.HostTrustStatus.trusted)}if(t._webAppState.clientEndPoint._checkStatusLogged||null==t._hostInfo||void 0===t._hostInfo||(OSF.AppTelemetry.onCheckWACHost(t._webAppState.clientEndPoint._hostTrustCheckStatus,t._webAppState.id,t._hostInfo.hostType,t._hostInfo.hostPlatform,t._webAppState.clientEndPoint._targetUrl),t._webAppState.clientEndPoint._checkStatusLogged=!0),t._webAppState.clientEndPoint._hostTrustCheckStatus!=Microsoft.Office.Common.HostTrustStatus.trusted){var i=function(){var r=OSF._OfficeAppFactory.getLoadScriptHelper().getOfficeJsBasePath().match(/^https?:\/\/[^:/?#]*(?::([0-9]+))?/);if(r&&r[0]){var i=OSF._OfficeAppFactory.getLoadScriptHelper().getOfficeJsBasePath()+"AgaveErrorUX/index.html#",a={error:"NotTrustedWAC",locale:OSF.getSupportedLocale(t._hostInfo.hostLocale,OSF.ConstantNames.DefaultLocale),hostname:n.hostname,noHttps:!o,validate:!1},s=document.createElement("iframe");s.style.visibility="hidden",s.style.height="0",s.style.width="0",OSF.OUtil.addEventListener(window,"message",(function n(o){if(o.source==s.contentWindow&&o.origin==r[0])try{var c=JSON.parse(o.data);Function._validateParams(c,[{name:"hostUserTrusted",type:Boolean,mayBeNull:!1}]);!0===c.hostUserTrusted?(t._webAppState.clientEndPoint._hostTrustCheckStatus=Microsoft.Office.Common.HostTrustStatus.trusted,OSF.OUtil.removeEventListener(window,"message",n),document.body.removeChild(s)):(a.validate=!1,window.location.replace(i+encodeURIComponent(JSON.stringify(a)))),e()}catch(e){document.body.innerHTML=Strings.OfficeOM.L_NotTrustedWAC}})),a.validate=!0,s.setAttribute("src",i+encodeURIComponent(JSON.stringify(a))),s.onload=function(){var e={hostname:n.hostname,noHttps:!o};s.contentWindow.postMessage(JSON.stringify(e),r[0])},document.body.appendChild(s)}else document.body.innerHTML=Strings.OfficeOM.L_NotTrustedWAC;if(OSF.OUtil.checkFlight(OSF.FlightNames.AddinEnforceHttps)&&!o)throw new Error("NotHttps")};if(document.body)i();else{var a=!1;document.addEventListener("DOMContentLoaded",(function(){a||(a=!0,i())}))}}else e()},OSF.InitializationHelper.prototype.setAgaveHostCommunication=function(){try{var e=this,t=OSF.OUtil.parseXdmInfoWithGivenFragment(!1,OSF._OfficeAppFactory.getWindowLocationHash());if(!t&&OSF._OfficeAppFactory.getWindowName&&(t=OSF.OUtil.parseXdmInfoFromWindowName(!1,OSF._OfficeAppFactory.getWindowName())),t){var n=OSF.OUtil.getInfoItems(t);void 0!=n&&n.length>=3&&(e._webAppState.conversationID=n[0],e._webAppState.id=n[1],e._webAppState.webAppUrl=n[2].indexOf(":")>=0?n[2]:decodeURIComponent(n[2]))}e._webAppState.wnd=null!=window.opener?window.opener:window.parent;var o=OSF.OUtil.parseSerializerVersionWithGivenFragment(!1,OSF._OfficeAppFactory.getWindowLocationHash());if(isNaN(o)&&OSF._OfficeAppFactory.getWindowName&&(o=OSF.OUtil.parseSerializerVersionFromWindowName(!1,OSF._OfficeAppFactory.getWindowName())),e._webAppState.serializerVersion=o,this._hostInfo.isDialog&&null!=window.opener)return;e._webAppState.clientEndPoint=Microsoft.Office.Common.XdmCommunicationManager.connect(e._webAppState.conversationID,e._webAppState.wnd,e._webAppState.webAppUrl,e._webAppState.serializerVersion),e._webAppState.serviceEndPoint=Microsoft.Office.Common.XdmCommunicationManager.createServiceEndPoint(e._webAppState.id),e._webAppState.clientEndPoint._checkReceiverOriginAndRun=function(t){e.checkReceiverOriginAndRun(t)};var r=e._webAppState.conversationID+OSF.SharedConstants.NotificationConversationIdSuffix;e._webAppState.serviceEndPoint.registerConversation(r,e._webAppState.webAppUrl);e._webAppState.serviceEndPoint.registerMethod("Office_notifyAgave",(function(t){var n;switch(n="string"==typeof t?t:t[0]){case OSF.AgaveHostAction.Select:e._webAppState.focused=!0;break;case OSF.AgaveHostAction.UnSelect:e._webAppState.focused=!1;break;case OSF.AgaveHostAction.TabIn:case OSF.AgaveHostAction.CtrlF6In:window.focus();var o=document.querySelectorAll(e._tabbableElements);OSF.OUtil.focusToFirstTabbable(o,!1)||(window.blur(),e._webAppState.focused=!1,e._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[e._webAppState.id,OSF.AgaveHostAction.ExitNoFocusable]));break;case OSF.AgaveHostAction.TabInShift:window.focus();o=document.querySelectorAll(e._tabbableElements);OSF.OUtil.focusToFirstTabbable(o,!0)||(window.blur(),e._webAppState.focused=!1,e._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[e._webAppState.id,OSF.AgaveHostAction.ExitNoFocusableShift]));break;case OSF.AgaveHostAction.SendMessage:if(window.Office.context.messaging.onMessage){var r=t[1];window.Office.context.messaging.onMessage(r)}break;case OSF.AgaveHostAction.TaskPaneHeaderButtonClicked:window.Office.context.ui.taskPaneAction.onHeaderButtonClick&&window.Office.context.ui.taskPaneAction.onHeaderButtonClick();break;default:OsfMsAjaxFactory.msAjaxDebug.trace("actionId "+n+" notifyAgave is wrong.")}}),Microsoft.Office.Common.InvokeType.async,!1),e.addOrRemoveEventListenersForWindow(!0)}catch(e){throw OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Exception thrown in setAgaveHostCommunication. Exception:["+e+"]"),e}},OSF.InitializationHelper.prototype.addOrRemoveEventListenersForWindow=function(e){var t=this,n=function(){t._webAppState.focused||(t._webAppState.focused=!0),t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,OSF.AgaveHostAction.Select])},o=function(){OSF&&(t._webAppState.focused&&(t._webAppState.focused=!1),t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,OSF.AgaveHostAction.UnSelect]))},r=function(e){if(e.preventDefault=e.preventDefault||function(){e.returnValue=!1},117==e.keyCode&&(e.ctrlKey||e.metaKey)){e.preventDefault();var n=OSF.AgaveHostAction.CtrlF6Exit;e.shiftKey&&(n=OSF.AgaveHostAction.CtrlF6ExitShift),t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,n])}else if(9==e.keyCode){var o=t._appContext._appSettings&&(t._appContext._appSettings.PowerPointModernSlideShowEnabled||!1)&&t._appContext._appName==OSF.AppName.PowerpointWebApp&&t._appContext._clientMode==OSF.ClientMode.ReadOnly&&t._appContext._osfControlType==OSF.OsfControlType.DocumentLevel;o||e.preventDefault();var r=document.querySelectorAll(t._tabbableElements);OSF.OUtil.focusToNextTabbable(r,e.target||e.srcElement,e.shiftKey)?o&&e.preventDefault():t._hostInfo.isDialog?OSF.OUtil.focusToFirstTabbable(r,e.shiftKey):e.shiftKey?o||t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,OSF.AgaveHostAction.TabExitShift]):OSF.OUtil.checkFlight(OSF.FlightNames.SetFocusToTaskpaneIsEnabled)&&e.target&&"BODY"===e.target.tagName.toUpperCase()?OSF.OUtil.focusToFirstTabbable(r,e.shiftKey):o||t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,OSF.AgaveHostAction.TabExit])}else if(27==e.keyCode)e.preventDefault(),t.dismissDialogNotification&&t.dismissDialogNotification(),t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,OSF.AgaveHostAction.EscExit]);else if(113==e.keyCode)e.preventDefault(),t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,OSF.AgaveHostAction.F2Exit]);else if((e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)&&e.keyCode>=1&&e.keyCode<=255){var i={keyCode:e.keyCode,shiftKey:e.shiftKey,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey};t._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[t._webAppState.id,OSF.AgaveHostAction.KeyboardShortcuts,i])}},i=function(e){117==e.keyCode&&e.ctrlKey&&(e.preventDefault?e.preventDefault():e.returnValue=!1)};e?(OSF.OUtil.addEventListener(window,"focus",n),OSF.OUtil.addEventListener(window,"blur",o),OSF.OUtil.addEventListener(window,"keydown",r),OSF.OUtil.addEventListener(window,"keypress",i)):(OSF.OUtil.removeEventListener(window,"focus",n),OSF.OUtil.removeEventListener(window,"blur",o),OSF.OUtil.removeEventListener(window,"keydown",r),OSF.OUtil.removeEventListener(window,"keypress",i))},OSF.InitializationHelper.prototype.initWebDialog=function(e){if(e.get_isDialog()){if(OSF.DDA.UI.ChildUI){var t=null!=window.opener;e.ui=new OSF.DDA.UI.ChildUI(t),t&&this.registerMessageReceivedEventForWindowDialog&&this.registerMessageReceivedEventForWindowDialog()}}else OSF.DDA.UI.ParentUI&&(e.ui=new OSF.DDA.UI.ParentUI,OfficeExt.Container&&OSF.DDA.DispIdHost.addAsyncMethods(e.ui,[OSF.DDA.AsyncMethodNames.CloseContainerAsync]))},OSF.InitializationHelper.prototype.initWebAuth=function(e){OSF.DDA.Auth&&(e.auth=new OSF.DDA.Auth,OSF.DDA.DispIdHost.addAsyncMethods(e.auth,[OSF.DDA.AsyncMethodNames.GetAccessTokenAsync]))},OSF.InitializationHelper.prototype.initWebAuthImplicit=function(e){OSF.DDA.WebAuth&&(e.webAuth=new OSF.DDA.WebAuth,OSF.DDA.DispIdHost.addAsyncMethods(e.webAuth,[OSF.DDA.AsyncMethodNames.GetAuthContextAsync]))},OSF.getClientEndPoint=function(){return OSF._OfficeAppFactory.getInitializationHelper()._webAppState.clientEndPoint},OSF.InitializationHelper.prototype.prepareRightAfterWebExtensionInitialize=function(){if(this._hostInfo.isDialog){window.focus();var e=document.querySelectorAll(this._tabbableElements);OSF.OUtil.focusToFirstTabbable(e,!1)||(window.blur(),this._webAppState.focused=!1,this._webAppState.clientEndPoint&&this._webAppState.clientEndPoint.invoke("ContextActivationManager_notifyHost",null,[this._webAppState.id,OSF.AgaveHostAction.ExitNoFocusable]))}},OSF.Messaging.sendMessage=function(e){OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[OSF._OfficeAppFactory.getWebAppState().id,OSF.AgaveHostAction.SendMessage,e])},OSF.ExtensionLifeCycle.launchExtensionComponent=function(e){OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[OSF._OfficeAppFactory.getWebAppState().id,OSF.AgaveHostAction.LaunchExtensionComponent,e])},OSF.ExtensionLifeCycle.stopExtensionComponent=function(e){OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[OSF._OfficeAppFactory.getWebAppState().id,OSF.AgaveHostAction.StopExtensionComponent,e])},OSF.ExtensionLifeCycle.restartExtensionComponent=function(e){OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[OSF._OfficeAppFactory.getWebAppState().id,OSF.AgaveHostAction.RestartExtensionComponent,e])},OSF.TaskPaneAction.enableHeaderButton=function(e){OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[OSF._OfficeAppFactory.getWebAppState().id,OSF.AgaveHostAction.EnableTaskPaneHeaderButton,e])},OSF.TaskPaneAction.disableHeaderButton=function(){OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[OSF._OfficeAppFactory.getWebAppState().id,OSF.AgaveHostAction.DisableTaskPaneHeaderButton])},OSF.RibbonGallery.refreshRibbon=function(e){OSF.getClientEndPoint().invoke("ContextActivationManager_notifyHost",null,[OSF._OfficeAppFactory.getWebAppState().id,OSF.AgaveHostAction.RefreshRibbonGallery,e])},function(e){var t=function(){function e(e){this._table=e,this._fields={}}return Object.defineProperty(e.prototype,"Fields",{get:function(){return this._fields},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"Table",{get:function(){return this._table},enumerable:!0,configurable:!0}),e.prototype.SerializeFields=function(){},e.prototype.SetSerializedField=function(e,t){"undefined"!==typeof t&&null!==t&&(this._serializedFields[e]=t.toString())},e.prototype.SerializeRow=function(){return this._serializedFields={},this.SetSerializedField("Table",this._table),this.SerializeFields(),JSON.stringify(this._serializedFields)},e}();e.BaseUsageData=t;var n=function(e){function t(){return e.call(this,"AppActivated")||this}return __extends(t,e),Object.defineProperty(t.prototype,"CorrelationId",{get:function(){return this.Fields.CorrelationId},set:function(e){this.Fields.CorrelationId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"SessionId",{get:function(){return this.Fields.SessionId},set:function(e){this.Fields.SessionId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"AppId",{get:function(){return this.Fields.AppId},set:function(e){this.Fields.AppId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"AppInstanceId",{get:function(){return this.Fields.AppInstanceId},set:function(e){this.Fields.AppInstanceId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"AppURL",{get:function(){return this.Fields.AppURL},set:function(e){this.Fields.AppURL=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"AssetId",{get:function(){return this.Fields.AssetId},set:function(e){this.Fields.AssetId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Browser",{get:function(){return this.Fields.Browser},set:function(e){this.Fields.Browser=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"UserId",{get:function(){return this.Fields.UserId},set:function(e){this.Fields.UserId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Host",{get:function(){return this.Fields.Host},set:function(e){this.Fields.Host=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"HostVersion",{get:function(){return this.Fields.HostVersion},set:function(e){this.Fields.HostVersion=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ClientId",{get:function(){return this.Fields.ClientId},set:function(e){this.Fields.ClientId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"AppSizeWidth",{get:function(){return this.Fields.AppSizeWidth},set:function(e){this.Fields.AppSizeWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"AppSizeHeight",{get:function(){return this.Fields.AppSizeHeight},set:function(e){this.Fields.AppSizeHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Message",{get:function(){return this.Fields.Message},set:function(e){this.Fields.Message=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"DocUrl",{get:function(){return this.Fields.DocUrl},set:function(e){this.Fields.DocUrl=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"OfficeJSVersion",{get:function(){return this.Fields.OfficeJSVersion},set:function(e){this.Fields.OfficeJSVersion=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"HostJSVersion",{get:function(){return this.Fields.HostJSVersion},set:function(e){this.Fields.HostJSVersion=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"WacHostEnvironment",{get:function(){return this.Fields.WacHostEnvironment},set:function(e){this.Fields.WacHostEnvironment=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"IsFromWacAutomation",{get:function(){return this.Fields.IsFromWacAutomation},set:function(e){this.Fields.IsFromWacAutomation=e},enumerable:!0,configurable:!0}),t.prototype.SerializeFields=function(){this.SetSerializedField("CorrelationId",this.CorrelationId),this.SetSerializedField("SessionId",this.SessionId),this.SetSerializedField("AppId",this.AppId),this.SetSerializedField("AppInstanceId",this.AppInstanceId),this.SetSerializedField("AppURL",this.AppURL),this.SetSerializedField("AssetId",this.AssetId),this.SetSerializedField("Browser",this.Browser),this.SetSerializedField("UserId",this.UserId),this.SetSerializedField("Host",this.Host),this.SetSerializedField("HostVersion",this.HostVersion),this.SetSerializedField("ClientId",this.ClientId),this.SetSerializedField("AppSizeWidth",this.AppSizeWidth),this.SetSerializedField("AppSizeHeight",this.AppSizeHeight),this.SetSerializedField("Message",this.Message),this.SetSerializedField("DocUrl",this.DocUrl),this.SetSerializedField("OfficeJSVersion",this.OfficeJSVersion),this.SetSerializedField("HostJSVersion",this.HostJSVersion),this.SetSerializedField("WacHostEnvironment",this.WacHostEnvironment),this.SetSerializedField("IsFromWacAutomation",this.IsFromWacAutomation)},t}(t);e.AppActivatedUsageData=n;var o=function(e){function t(){return e.call(this,"ScriptLoad")||this}return __extends(t,e),Object.defineProperty(t.prototype,"CorrelationId",{get:function(){return this.Fields.CorrelationId},set:function(e){this.Fields.CorrelationId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"SessionId",{get:function(){return this.Fields.SessionId},set:function(e){this.Fields.SessionId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ScriptId",{get:function(){return this.Fields.ScriptId},set:function(e){this.Fields.ScriptId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"StartTime",{get:function(){return this.Fields.StartTime},set:function(e){this.Fields.StartTime=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ResponseTime",{get:function(){return this.Fields.ResponseTime},set:function(e){this.Fields.ResponseTime=e},enumerable:!0,configurable:!0}),t.prototype.SerializeFields=function(){this.SetSerializedField("CorrelationId",this.CorrelationId),this.SetSerializedField("SessionId",this.SessionId),this.SetSerializedField("ScriptId",this.ScriptId),this.SetSerializedField("StartTime",this.StartTime),this.SetSerializedField("ResponseTime",this.ResponseTime)},t}(t);e.ScriptLoadUsageData=o;var r=function(e){function t(){return e.call(this,"AppClosed")||this}return __extends(t,e),Object.defineProperty(t.prototype,"CorrelationId",{get:function(){return this.Fields.CorrelationId},set:function(e){this.Fields.CorrelationId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"SessionId",{get:function(){return this.Fields.SessionId},set:function(e){this.Fields.SessionId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"FocusTime",{get:function(){return this.Fields.FocusTime},set:function(e){this.Fields.FocusTime=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"AppSizeFinalWidth",{get:function(){return this.Fields.AppSizeFinalWidth},set:function(e){this.Fields.AppSizeFinalWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"AppSizeFinalHeight",{get:function(){return this.Fields.AppSizeFinalHeight},set:function(e){this.Fields.AppSizeFinalHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"OpenTime",{get:function(){return this.Fields.OpenTime},set:function(e){this.Fields.OpenTime=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"CloseMethod",{get:function(){return this.Fields.CloseMethod},set:function(e){this.Fields.CloseMethod=e},enumerable:!0,configurable:!0}),t.prototype.SerializeFields=function(){this.SetSerializedField("CorrelationId",this.CorrelationId),this.SetSerializedField("SessionId",this.SessionId),this.SetSerializedField("FocusTime",this.FocusTime),this.SetSerializedField("AppSizeFinalWidth",this.AppSizeFinalWidth),this.SetSerializedField("AppSizeFinalHeight",this.AppSizeFinalHeight),this.SetSerializedField("OpenTime",this.OpenTime),this.SetSerializedField("CloseMethod",this.CloseMethod)},t}(t);e.AppClosedUsageData=r;var i=function(e){function t(){return e.call(this,"APIUsage")||this}return __extends(t,e),Object.defineProperty(t.prototype,"CorrelationId",{get:function(){return this.Fields.CorrelationId},set:function(e){this.Fields.CorrelationId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"SessionId",{get:function(){return this.Fields.SessionId},set:function(e){this.Fields.SessionId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"APIType",{get:function(){return this.Fields.APIType},set:function(e){this.Fields.APIType=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"APIID",{get:function(){return this.Fields.APIID},set:function(e){this.Fields.APIID=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Parameters",{get:function(){return this.Fields.Parameters},set:function(e){this.Fields.Parameters=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ResponseTime",{get:function(){return this.Fields.ResponseTime},set:function(e){this.Fields.ResponseTime=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ErrorType",{get:function(){return this.Fields.ErrorType},set:function(e){this.Fields.ErrorType=e},enumerable:!0,configurable:!0}),t.prototype.SerializeFields=function(){this.SetSerializedField("CorrelationId",this.CorrelationId),this.SetSerializedField("SessionId",this.SessionId),this.SetSerializedField("APIType",this.APIType),this.SetSerializedField("APIID",this.APIID),this.SetSerializedField("Parameters",this.Parameters),this.SetSerializedField("ResponseTime",this.ResponseTime),this.SetSerializedField("ErrorType",this.ErrorType)},t}(t);e.APIUsageUsageData=i;var a=function(e){function t(){return e.call(this,"AppInitialization")||this}return __extends(t,e),Object.defineProperty(t.prototype,"CorrelationId",{get:function(){return this.Fields.CorrelationId},set:function(e){this.Fields.CorrelationId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"SessionId",{get:function(){return this.Fields.SessionId},set:function(e){this.Fields.SessionId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"SuccessCode",{get:function(){return this.Fields.SuccessCode},set:function(e){this.Fields.SuccessCode=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Message",{get:function(){return this.Fields.Message},set:function(e){this.Fields.Message=e},enumerable:!0,configurable:!0}),t.prototype.SerializeFields=function(){this.SetSerializedField("CorrelationId",this.CorrelationId),this.SetSerializedField("SessionId",this.SessionId),this.SetSerializedField("SuccessCode",this.SuccessCode),this.SetSerializedField("Message",this.Message)},t}(t);e.AppInitializationUsageData=a;var s=function(e){function t(){return e.call(this,"CheckWACHost")||this}return __extends(t,e),Object.defineProperty(t.prototype,"isWacKnownHost",{get:function(){return this.Fields.isWacKnownHost},set:function(e){this.Fields.isWacKnownHost=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"instanceId",{get:function(){return this.Fields.instanceId},set:function(e){this.Fields.instanceId=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hostType",{get:function(){return this.Fields.hostType},set:function(e){this.Fields.hostType=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hostPlatform",{get:function(){return this.Fields.hostPlatform},set:function(e){this.Fields.hostPlatform=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"wacDomain",{get:function(){return this.Fields.wacDomain},set:function(e){this.Fields.wacDomain=e},enumerable:!0,configurable:!0}),t.prototype.SerializeFields=function(){this.SetSerializedField("isWacKnownHost",this.isWacKnownHost),this.SetSerializedField("instanceId",this.instanceId),this.SetSerializedField("hostType",this.hostType),this.SetSerializedField("hostPlatform",this.hostPlatform),this.SetSerializedField("wacDomain",this.wacDomain)},t}(t);e.CheckWACHostUsageData=s}(OSFLog||(OSFLog={})),function(e){"use strict";!function(e){e[e.info=0]="info",e[e.warning=1]="warning",e[e.error=2]="error"}(e.TraceLevel||(e.TraceLevel={})),function(e){e[e.none=0]="none",e[e.flush=1]="flush"}(e.SendFlag||(e.SendFlag={})),e.allowUploadingData=function(){},e.sendLog=function(e,t,n){};var t=function(){function e(){}return e.prototype.writeLog=function(e){},e.prototype.loadProxyFrame=function(){},e}();OSF.Logger||(OSF.Logger=e),e.ulsEndpoint=function(){try{return new t}catch(e){return null}}()}(Logger||(Logger={})),function(e){var t=[{name:"AppActivated",enabled:!0,critical:!0,points:[{name:"Browser",type:"string"},{name:"Message",type:"string"},{name:"Host",type:"string"},{name:"AppSizeWidth",type:"int64"},{name:"AppSizeHeight",type:"int64"},{name:"IsFromWacAutomation",type:"string"}]},{name:"ScriptLoad",enabled:!0,critical:!1,points:[{name:"ScriptId",type:"string"},{name:"StartTime",type:"double"},{name:"ResponseTime",type:"double"}]},{name:"APIUsage",enabled:function(){if(!OSF._OfficeAppFactory||!OSF._OfficeAppFactory.getHostInfo)return!1;var e=OSF._OfficeAppFactory.getHostInfo();if(!e)return!1;switch(e.hostType){case"outlook":switch(e.hostPlatform){case"mac":case"web":return!0;default:return!1}default:return!1}}(),critical:!1,points:[{name:"APIType",type:"string"},{name:"APIID",type:"int64"},{name:"Parameters",type:"string"},{name:"ResponseTime",type:"int64"},{name:"ErrorType",type:"int64"}]},{name:"AppInitialization",enabled:!0,critical:!1,points:[{name:"SuccessCode",type:"int64"},{name:"Message",type:"string"}]},{name:"AppClosed",enabled:!0,critical:!1,points:[{name:"FocusTime",type:"int64"},{name:"AppSizeFinalWidth",type:"int64"},{name:"AppSizeFinalHeight",type:"int64"},{name:"OpenTime",type:"int64"}]},{name:"CheckWACHost",enabled:!0,critical:!1,points:[{name:"isWacKnownHost",type:"int64"},{name:"solutionId",type:"string"},{name:"hostType",type:"string"},{name:"hostPlatform",type:"string"},{name:"correlationId",type:"string"}]}];function n(e,t){var n=void 0===t.rename?t.name:t.rename,o=void 0;switch(t.type){case"string":o=oteljs.makeStringDataField(n,e);break;case"double":"string"===typeof e&&(e=parseFloat(e)),o=oteljs.makeDoubleDataField(n,e);break;case"int64":"string"===typeof e&&(e=parseInt(e)),o=oteljs.makeInt64DataField(n,e);break;case"boolean":"string"===typeof e&&(e="true"===e),o=oteljs.makeBooleanDataField(n,e)}return o}function o(e){for(var n=0,o=t;nn[r])return!1}return!1},e.prototype.isDirectToAriaEnabled=function(){if(void 0===this.EnableDirectToAria||null===this.EnableDirectToAria){var e=void 0,t=void 0;OSF._OfficeAppFactory&&OSF._OfficeAppFactory.getHostInfo&&(e=OSF._OfficeAppFactory.getHostInfo().hostPlatform),window.external&&"undefined"!==typeof window.external.GetContext&&"undefined"!==typeof window.external.GetContext().GetHostFullVersion&&(t=window.external.GetContext().GetHostFullVersion()),this.EnableDirectToAria=this.shouldSendDirectToAria(e,t)}return this.EnableDirectToAria},e.prototype.sendTelemetry=function(t,n){e.EnableSendingTelemetryWithLegacyAria&&this.isDirectToAriaEnabled()&&OSF.OUtil.loadScript(this.getAriaCDNLocation(),(function(){try{if(!this.ALogger){this.ALogger=AWTLogManager.initialize("db334b301e7b474db5e0f02f07c51a47-a1b5bc36-1bbe-482f-a64a-c2d9cb606706-7439")}var e=new AWTEventProperties;for(var o in e.setName("Office.Extensibility.OfficeJS."+t),n)"table"!==o.toLowerCase()&&e.setProperty(o,n[o]);var r=new Date;e.setProperty("Date",r.toISOString()),this.ALogger.logEvent(e)}catch(e){}}),1e3),e.EnableSendingTelemetryWithOTel&&r(t,n)},e.prototype.logData=function(e){this.isIUsageData(e)?this.sendTelemetry(e.Table,e.Fields):this.sendTelemetry(e.Table,e)},e.EnableSendingTelemetryWithOTel=!0,e.EnableSendingTelemetryWithLegacyAria=!1,e}();e.AriaLogger=i}(OSFAriaLogger||(OSFAriaLogger={})),function(e){"use strict";var t,n=OSF.OUtil.Guid.generateNewGuid(),o="",r=new RegExp("^https?://store\\.office(ppe|-int)?\\.com/","i");e.enableTelemetry=!0;var i=function(){return function(){}}();e.AppInfo=i;var a=function(){return function(e,t){this.name=e,this.handler=t}}(),s=function(){function e(){this.clientIDKey="Office API client",this.logIdSetKey="Office App Log Id Set"}return e.prototype.getClientId=function(){var e=this.getValue(this.clientIDKey);return(!e||e.length<=0||e.length>40)&&(e=OSF.OUtil.Guid.generateNewGuid(),this.setValue(this.clientIDKey,e)),e},e.prototype.saveLog=function(e,t){var n=this.getValue(this.logIdSetKey);n=(n&&n.length>0?n+";":"")+e,this.setValue(this.logIdSetKey,n),this.setValue(e,t)},e.prototype.enumerateLog=function(e,t){var n=this.getValue(this.logIdSetKey);if(n){var o=n.split(";");for(var r in o){var i=o[r],a=this.getValue(i);a&&(e&&e(i,a),t&&this.remove(i))}t&&this.remove(this.logIdSetKey)}},e.prototype.getValue=function(e){var t=OSF.OUtil.getLocalStorage(),n="";return t&&(n=t.getItem(e)),n},e.prototype.setValue=function(e,t){var n=OSF.OUtil.getLocalStorage();n&&n.setItem(e,t)},e.prototype.remove=function(e){var t=OSF.OUtil.getLocalStorage();if(t)try{t.removeItem(e)}catch(e){}},e}(),c=function(){function t(){}return t.prototype.LogData=function(t){if(e.enableTelemetry)try{OSFAriaLogger.AriaLogger.getInstance().logData(t)}catch(e){}},t.prototype.LogRawData=function(t){if(e.enableTelemetry)try{OSFAriaLogger.AriaLogger.getInstance().logData(JSON.parse(t))}catch(e){}},t}();function l(e){return e&&(e=e.replace(/[{}]/g,"").toLowerCase()),e||""}function u(e,t){var r=new OSFLog.AppInitializationUsageData;r.CorrelationId=l(o),r.SessionId=n,r.SuccessCode=e?1:0,r.Message=t,(new c).LogData(r)}function p(){var e=0!=(OSF._OfficeAppFactory.getHostInfo().flags&OSF.HostInfoFlags.PublicAddin);return e||!!t&&f(OSF._OfficeAppFactory.getHostInfo().hostPlatform,t.hostVersion)}function d(e,t){return p()||t!==e?t:"PRIVATE"}function f(e,t){var n=!1,o=/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/.exec(t);if(o){var r=parseInt(o[1]),i=parseInt(o[2]),a=parseInt(o[3]);"win32"==e?(r<16||16==r&&a<14225)&&(n=!0):"mac"==e&&(r<16||16==r&&(i<52||52==i&&a<808))&&(n=!0)}return n}e.initialize=function(o){if(e.enableTelemetry&&!t){t=new i,o.get_hostFullVersion()?t.hostVersion=o.get_hostFullVersion():t.hostVersion=o.get_appVersion(),t.appId=p()?o.get_id():"PRIVATE",t.browser=window.navigator.userAgent,t.correlationId=l(o.get_correlationId()),t.clientId=(new s).getClientId(),t.appInstanceId=o.get_appInstanceId(),t.appInstanceId&&(t.appInstanceId=l(t.appInstanceId),t.appInstanceId=d(o.get_id(),t.appInstanceId)),t.message=o.get_hostCustomMessage(),t.officeJSVersion=OSF.ConstantNames.FileVersion,t.hostJSVersion="16.0.14704.10000",o._wacHostEnvironment&&(t.wacHostEnvironment=o._wacHostEnvironment),void 0!==o._isFromWacAutomation&&null!==o._isFromWacAutomation&&(t.isFromWacAutomation=o._isFromWacAutomation.toString().toLowerCase());var c=o.get_docUrl();t.docUrl=r.test(c)?c:"";var u=location.href;u&&(u=u.split("?")[0].split("#")[0]),t.appURL="",function(e,t){var n,o;t.assetId="",t.userId="";try{n=decodeURIComponent(e);var r=(o=(new DOMParser).parseFromString(n,"text/xml")).getElementsByTagName("t")[0].attributes.getNamedItem("cid"),i=o.getElementsByTagName("t")[0].attributes.getNamedItem("oid");r&&r.nodeValue?t.userId=r.nodeValue:i&&i.nodeValue&&(t.userId=i.nodeValue),t.assetId=o.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue}catch(e){}finally{n=null,o=null,null}}(o.get_eToken(),t),t.sessionId=n,"undefined"!==typeof OTel&&OTel.OTelLogger.initialize(t),function(){var t=new Date,n=null,o=0,r=!1,i=function(){document.hasFocus()?null==n&&(n=new Date):n&&(o+=Math.abs((new Date).getTime()-n.getTime()),n=null)},s=[];s.push(new a("focus",i)),s.push(new a("blur",i)),s.push(new a("focusout",i)),s.push(new a("focusin",i));var c=function(){for(var i=0;ie.config.loadDelay)&&(a(t,n),clearInterval(s))}),500);else a(t,n)}))}))}():function(){e.loadAttempts++;var t=OSF._OfficeAppFactory.getLoadScriptHelper().getOfficeJsBasePath()+(e.config&&e.config.debugging?"webauth/webauth.implicit.debug.js":"webauth/webauth.implicit.js");return new OfficeExtension.Promise((function(n,o){OSF.OUtil.loadScript(t,(function(t){"boolean"!==typeof t||t||o(t),"boolean"!==typeof t&&t&&o(t),Implicit||o(new Error("Missing Implicit namespace, Implicit is not loaded.")),e.config?n(Implicit.Load(e.config,OSF._OfficeAppFactory.getHostInfo().osfControlAppCorrelationId)):Implicit.GetAuthConfig().then((function(t){e.config=t,n(Implicit.Load(e.config,OSF._OfficeAppFactory.getHostInfo().osfControlAppCorrelationId))}),(function(){o(null)}))}))}))}()},e.getToken=function(n,o,r,i){return(e.config&&e.config.authFlow===t.AuthCode?BrowserAuth:Implicit).GetToken(n,o,r,!!i)},OSF.WebAuth=e}(OSFWebAuth||(OSFWebAuth={})),Microsoft.Office.WebExtension.TableData=function(e,t){function n(e){if(null==e||void 0==e)return null;try{for(var t=OSF.DDA.DataCoercion.findArrayDimensionality(e,2);t<2;t++)e=[e];return e}catch(e){}}OSF.OUtil.defineEnumerableProperties(this,{headers:{get:function(){return t},set:function(e){t=n(e)}},rows:{get:function(){return e},set:function(t){e=null==t||OSF.OUtil.isArray(t)&&0==t.length?[]:n(t)}}}),this.headers=t,this.rows=e},OSF.DDA.OMFactory=OSF.DDA.OMFactory||{},OSF.DDA.OMFactory.manufactureTableData=function(e){return new Microsoft.Office.WebExtension.TableData(e[OSF.DDA.TableDataProperties.TableRows],e[OSF.DDA.TableDataProperties.TableHeaders])},Microsoft.Office.WebExtension.CoercionType={Text:"text",Matrix:"matrix",Table:"table"},OSF.DDA.DataCoercion=function(){return{findArrayDimensionality:function(e){if(OSF.OUtil.isArray(e)){for(var t=0,n=0;n0)for(var o=0;o0)for(var o=0;o0&&(this._eventHandlers[e]=[],!0)},clearObjectEventHandlers:function(e,t){return null!=this._objectEventHandlers[e]&&null!=this._objectEventHandlers[e][t]&&(this._objectEventHandlers[e][t]=[],!0)},getEventHandlerCount:function(e){return void 0!=this._eventHandlers[e]?this._eventHandlers[e].length:-1},getObjectEventHandlerCount:function(e,t){return null==this._objectEventHandlers[e]||null==this._objectEventHandlers[e][t]?0:this._objectEventHandlers[e][t].length},fireEvent:function(e){if(void 0==e.type)return!1;var t=e.type;if(t&&this._eventHandlers[t]){for(var n=this._eventHandlers[t],o=0;o0){for(var o=t[0];n.length>0;){o(n.shift())}return!0}}return!1},clearQueuedEvent:function(e){e&&this._eventHandlers[e]&&(this._queuedEventsArgs[e]&&(this._queuedEventsArgs[e]=[]))}},OSF.DDA.OMFactory=OSF.DDA.OMFactory||{},OSF.DDA.OMFactory.manufactureEventArgs=function(e,t,n){var o;switch(e){case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged:o=new OSF.DDA.DocumentSelectionChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged:o=new OSF.DDA.BindingSelectionChangedEventArgs(this.manufactureBinding(n,t.document),n[OSF.DDA.PropertyDescriptors.Subset]);break;case Microsoft.Office.WebExtension.EventType.BindingDataChanged:o=new OSF.DDA.BindingDataChangedEventArgs(this.manufactureBinding(n,t.document));break;case Microsoft.Office.WebExtension.EventType.SettingsChanged:o=new OSF.DDA.SettingsChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.ActiveViewChanged:o=new OSF.DDA.ActiveViewChangedEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged:o=new OSF.DDA.Theming.OfficeThemeChangedEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged:o=new OSF.DDA.Theming.DocumentThemeChangedEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.AppCommandInvoked:o=OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(n);break;case Microsoft.Office.WebExtension.EventType.ObjectDeleted:case Microsoft.Office.WebExtension.EventType.ObjectSelectionChanged:case Microsoft.Office.WebExtension.EventType.ObjectDataChanged:case Microsoft.Office.WebExtension.EventType.ContentControlAdded:o=new OSF.DDA.ObjectEventArgs(e,n[Microsoft.Office.WebExtension.Parameters.Id]);break;case Microsoft.Office.WebExtension.EventType.RichApiMessage:o=new OSF.DDA.RichApiMessageEventArgs(e,n);break;case Microsoft.Office.WebExtension.EventType.DataNodeInserted:o=new OSF.DDA.NodeInsertedEventArgs(this.manufactureDataNode(n[OSF.DDA.DataNodeEventProperties.NewNode]),n[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeReplaced:o=new OSF.DDA.NodeReplacedEventArgs(this.manufactureDataNode(n[OSF.DDA.DataNodeEventProperties.OldNode]),this.manufactureDataNode(n[OSF.DDA.DataNodeEventProperties.NewNode]),n[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.DataNodeDeleted:o=new OSF.DDA.NodeDeletedEventArgs(this.manufactureDataNode(n[OSF.DDA.DataNodeEventProperties.OldNode]),this.manufactureDataNode(n[OSF.DDA.DataNodeEventProperties.NextSiblingNode]),n[OSF.DDA.DataNodeEventProperties.InUndoRedo]);break;case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged:o=new OSF.DDA.TaskSelectionChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged:o=new OSF.DDA.ResourceSelectionChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged:o=new OSF.DDA.ViewSelectionChangedEventArgs(t);break;case Microsoft.Office.WebExtension.EventType.DialogMessageReceived:o=new OSF.DDA.DialogEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived:o=new OSF.DDA.DialogParentEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.ItemChanged:if("outlook"!=OSF._OfficeAppFactory.getHostInfo().hostType)throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e));o=new OSF.DDA.OlkItemSelectedChangedEventArgs(n),t.initialize(o.initialData),"win32"!=OSF._OfficeAppFactory.getHostInfo().hostPlatform&&"mac"!=OSF._OfficeAppFactory.getHostInfo().hostPlatform||t.setCurrentItemNumber(o.itemNumber.itemNumber);break;case Microsoft.Office.WebExtension.EventType.RecipientsChanged:if("outlook"!=OSF._OfficeAppFactory.getHostInfo().hostType)throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e));o=new OSF.DDA.OlkRecipientsChangedEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.AppointmentTimeChanged:if("outlook"!=OSF._OfficeAppFactory.getHostInfo().hostType)throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e));o=new OSF.DDA.OlkAppointmentTimeChangedEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.RecurrenceChanged:if("outlook"!=OSF._OfficeAppFactory.getHostInfo().hostType)throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e));o=new OSF.DDA.OlkRecurrenceChangedEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.AttachmentsChanged:if("outlook"!=OSF._OfficeAppFactory.getHostInfo().hostType)throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e));o=new OSF.DDA.OlkAttachmentsChangedEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.EnhancedLocationsChanged:if("outlook"!=OSF._OfficeAppFactory.getHostInfo().hostType)throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e));o=new OSF.DDA.OlkEnhancedLocationsChangedEventArgs(n);break;case Microsoft.Office.WebExtension.EventType.InfobarClicked:if("outlook"!=OSF._OfficeAppFactory.getHostInfo().hostType)throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e));o=new OSF.DDA.OlkInfobarClickedEventArgs(n);break;default:throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType,OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType,e))}return o},OSF.DDA.AsyncMethodNames.addNames({AddHandlerAsync:"addHandlerAsync",RemoveHandlerAsync:"removeHandlerAsync"}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,enum:Microsoft.Office.WebExtension.EventType,verify:function(e,t,n){return n.supportsEvent(e)}},{name:Microsoft.Office.WebExtension.Parameters.Handler,types:["function"]}],supportedOptions:[],privateStateCallbacks:[]}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.RemoveHandlerAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,enum:Microsoft.Office.WebExtension.EventType,verify:function(e,t,n){return n.supportsEvent(e)}}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.Handler,value:{types:["function","object"],defaultValue:null}}],privateStateCallbacks:[]}),OSF.OUtil.augmentList(OSF.DDA.EventDescriptors,{DialogParentMessageReceivedEvent:"DialogParentMessageReceivedEvent"}),OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{DialogParentMessageReceived:"dialogParentMessageReceived",DialogParentEventReceived:"dialogParentEventReceived"}),OSF.DialogParentMessageEventDispatch=new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived,Microsoft.Office.WebExtension.EventType.DialogParentEventReceived]),OSF.DDA.UI.EnableSendMessageDialogAPI=!0,OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType,{Image:"image"}),OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType,{XmlSvg:"xmlSvg"}),OSF.OUtil.augmentList(Microsoft.Office.WebExtension.CoercionType,{Ooxml:"ooxml"}),OSF.DDA.DataPartProperties={Id:Microsoft.Office.WebExtension.Parameters.Id,BuiltIn:"DataPartBuiltIn"},OSF.DDA.DataNodeProperties={Handle:"DataNodeHandle",BaseName:"DataNodeBaseName",NamespaceUri:"DataNodeNamespaceUri",NodeType:"DataNodeType"},OSF.DDA.DataNodeEventProperties={OldNode:"OldNode",NewNode:"NewNode",NextSiblingNode:"NextSiblingNode",InUndoRedo:"InUndoRedo"},OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{DataPartProperties:"DataPartProperties",DataNodeProperties:"DataNodeProperties"}),OSF.OUtil.augmentList(OSF.DDA.ListDescriptors,{DataPartList:"DataPartList",DataNodeList:"DataNodeList"}),OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.DataPartList,OSF.DDA.PropertyDescriptors.DataPartProperties),OSF.DDA.ListType.setListType(OSF.DDA.ListDescriptors.DataNodeList,OSF.DDA.PropertyDescriptors.DataNodeProperties),OSF.OUtil.augmentList(OSF.DDA.EventDescriptors,{DataNodeInsertedEvent:"DataNodeInsertedEvent",DataNodeReplacedEvent:"DataNodeReplacedEvent",DataNodeDeletedEvent:"DataNodeDeletedEvent"}),OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{DataNodeDeleted:"nodeDeleted",DataNodeInserted:"nodeInserted",DataNodeReplaced:"nodeReplaced",NodeDeleted:"nodeDeleted",NodeInserted:"nodeInserted",NodeReplaced:"nodeReplaced"}),OSF.DDA.CustomXmlParts=function(){this._eventDispatches=[];var e=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[e.AddDataPartAsync,e.GetDataPartByIdAsync,e.GetDataPartsByNameSpaceAsync])},OSF.DDA.CustomXmlPart=function(e,t,n){OSF.OUtil.defineEnumerableProperties(this,{builtIn:{value:n},id:{value:t},namespaceManager:{value:new OSF.DDA.CustomXmlPrefixMappings(t)}});var o=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[o.DeleteDataPartAsync,o.GetPartNodesAsync,o.GetPartXmlAsync]);var r=e._eventDispatches,i=r[t];if(!i){var a=Microsoft.Office.WebExtension.EventType;i=new OSF.EventDispatch([a.DataNodeDeleted,a.DataNodeInserted,a.DataNodeReplaced]),r[t]=i}OSF.DDA.DispIdHost.addEventSupport(this,i)},OSF.DDA.CustomXmlPrefixMappings=function(e){var t=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[t.AddDataPartNamespaceAsync,t.GetDataPartNamespaceAsync,t.GetDataPartPrefixAsync],e)},OSF.DDA.CustomXmlNode=function(e,t,n,o){OSF.OUtil.defineEnumerableProperties(this,{baseName:{value:o},namespaceUri:{value:n},nodeType:{value:t}});var r=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[r.GetRelativeNodesAsync,r.GetNodeValueAsync,r.GetNodeXmlAsync,r.SetNodeValueAsync,r.SetNodeXmlAsync,r.GetNodeTextAsync,r.SetNodeTextAsync],e)},OSF.DDA.NodeInsertedEventArgs=function(e,t){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DataNodeInserted},newNode:{value:e},inUndoRedo:{value:t}})},OSF.DDA.NodeReplacedEventArgs=function(e,t,n){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DataNodeReplaced},oldNode:{value:e},newNode:{value:t},inUndoRedo:{value:n}})},OSF.DDA.NodeDeletedEventArgs=function(e,t,n){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DataNodeDeleted},oldNode:{value:e},oldNextSibling:{value:t},inUndoRedo:{value:n}})},OSF.DDA.OMFactory=OSF.DDA.OMFactory||{},OSF.DDA.OMFactory.manufactureDataNode=function(e){if(e)return new OSF.DDA.CustomXmlNode(e[OSF.DDA.DataNodeProperties.Handle],e[OSF.DDA.DataNodeProperties.NodeType],e[OSF.DDA.DataNodeProperties.NamespaceUri],e[OSF.DDA.DataNodeProperties.BaseName])},OSF.DDA.OMFactory.manufactureDataPart=function(e,t){return new OSF.DDA.CustomXmlPart(t,e[OSF.DDA.DataPartProperties.Id],e[OSF.DDA.DataPartProperties.BuiltIn])},OSF.DDA.AsyncMethodNames.addNames({AddDataPartAsync:"addAsync",GetDataPartByIdAsync:"getByIdAsync",GetDataPartsByNameSpaceAsync:"getByNamespaceAsync",DeleteDataPartAsync:"deleteAsync",GetPartNodesAsync:"getNodesAsync",GetPartXmlAsync:"getXmlAsync",AddDataPartNamespaceAsync:"addNamespaceAsync",GetDataPartNamespaceAsync:"getNamespaceAsync",GetDataPartPrefixAsync:"getPrefixAsync",GetRelativeNodesAsync:"getNodesAsync",GetNodeValueAsync:"getNodeValueAsync",GetNodeXmlAsync:"getXmlAsync",SetNodeValueAsync:"setNodeValueAsync",SetNodeXmlAsync:"setXmlAsync",GetNodeTextAsync:"getTextAsync",SetNodeTextAsync:"setTextAsync"}),function(){function e(e){return OSF.DDA.OMFactory.manufactureDataPart(e,Microsoft.Office.WebExtension.context.document.customXmlParts)}function t(e){return OSF.DDA.OMFactory.manufactureDataNode(e)}function n(e,t,n){var o=e[Microsoft.Office.WebExtension.Parameters.Data];return void 0==o?null:o}function o(e){return e.id}function r(e,t){return t}function i(e,t){return t}OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddDataPartAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Xml,types:["string"]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:e}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDataPartByIdAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:["string"]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:e}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDataPartsByNameSpaceAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Namespace,types:["string"]}],supportedOptions:[],privateStateCallbacks:[],onSucceeded:function(t){return OSF.OUtil.mapList(t[OSF.DDA.ListDescriptors.DataPartList],e)}}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.DeleteDataPartAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataPartProperties.Id,value:o}]}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetPartNodesAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.XPath,types:["string"]}],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataPartProperties.Id,value:o}],onSucceeded:function(e){return OSF.OUtil.mapList(e[OSF.DDA.ListDescriptors.DataNodeList],t)}}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetPartXmlAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataPartProperties.Id,value:o}],onSucceeded:n}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AddDataPartNamespaceAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Prefix,types:["string"]},{name:Microsoft.Office.WebExtension.Parameters.Namespace,types:["string"]}],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataPartProperties.Id,value:r}]}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDataPartNamespaceAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Prefix,types:["string"]}],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataPartProperties.Id,value:r}],onSucceeded:n}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDataPartPrefixAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Namespace,types:["string"]}],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataPartProperties.Id,value:r}],onSucceeded:n}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetRelativeNodesAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.XPath,types:["string"]}],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataNodeProperties.Handle,value:i}],onSucceeded:function(e){return OSF.OUtil.mapList(e[OSF.DDA.ListDescriptors.DataNodeList],t)}}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetNodeValueAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataNodeProperties.Handle,value:i}],onSucceeded:n}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetNodeXmlAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataNodeProperties.Handle,value:i}],onSucceeded:n}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetNodeValueAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["string"]}],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataNodeProperties.Handle,value:i}]}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetNodeXmlAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Xml,types:["string"]}],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataNodeProperties.Handle,value:i}]}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetNodeTextAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataNodeProperties.Handle,value:i}],onSucceeded:n}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetNodeTextAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Text,types:["string"]}],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.DataNodeProperties.Handle,value:i}]})}(),OSF.OUtil.setNamespace("Marshaling",OSF.DDA),OSF.DDA.Marshaling.CustomXmlPartsKeys={Id:"id",Namespace:"namespace",Xml:"xml",XPath:"xpath",Prefix:"prefix"},OSF.DDA.Marshaling.DataPartProperties={Id:"id",BuiltIn:"DataPartBuiltIn"},OSF.DDA.Marshaling.PropertyDescriptors={DataPartProperties:"DataPartProperties",DataNodeProperties:"DataNodeProperties"},OSF.DDA.Marshaling.DataNodeProperties={Handle:"DataNodeHandle",BaseName:"DataNodeBaseName",NamespaceUri:"DataNodeNamespaceUri",NodeType:"DataNodeType"},OSF.DDA.Marshaling.ListDescriptors={DataPartList:"DataPartList",DataNodeList:"DataNodeList"},OSF.DDA.Marshaling.DataNodeEventProperties={OldNode:"OldNode",NewNode:"NewNode",NextSiblingNode:"NextSiblingNode",InUndoRedo:"InUndoRedo"},OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.DataPartProperties,fromHost:[{name:OSF.DDA.DataPartProperties.Id,value:OSF.DDA.Marshaling.DataPartProperties.Id},{name:OSF.DDA.DataPartProperties.BuiltIn,value:OSF.DDA.Marshaling.DataPartProperties.BuiltIn}],isComplexType:!0}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.DataNodeProperties,fromHost:[{name:OSF.DDA.DataNodeProperties.Handle,value:OSF.DDA.Marshaling.DataNodeProperties.Handle},{name:OSF.DDA.DataNodeProperties.BaseName,value:OSF.DDA.Marshaling.DataNodeProperties.BaseName},{name:OSF.DDA.DataNodeProperties.NamespaceUri,value:OSF.DDA.Marshaling.DataNodeProperties.NamespaceUri},{name:OSF.DDA.DataNodeProperties.NodeType,value:OSF.DDA.Marshaling.DataNodeProperties.NodeType}],isComplexType:!0}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDescriptors.DataNodeInsertedEvent,fromHost:[{name:OSF.DDA.DataNodeEventProperties.InUndoRedo,value:OSF.DDA.Marshaling.DataNodeEventProperties.InUndoRedo},{name:OSF.DDA.DataNodeEventProperties.NewNode,value:OSF.DDA.Marshaling.DataNodeEventProperties.NewNode}],isComplexType:!0}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDescriptors.DataNodeReplacedEvent,fromHost:[{name:OSF.DDA.DataNodeEventProperties.InUndoRedo,value:OSF.DDA.Marshaling.DataNodeEventProperties.InUndoRedo},{name:OSF.DDA.DataNodeEventProperties.OldNode,value:OSF.DDA.Marshaling.DataNodeEventProperties.OldNode},{name:OSF.DDA.DataNodeEventProperties.NewNode,value:OSF.DDA.Marshaling.DataNodeEventProperties.NewNode}],isComplexType:!0}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDescriptors.DataNodeDeletedEvent,fromHost:[{name:OSF.DDA.DataNodeEventProperties.InUndoRedo,value:OSF.DDA.Marshaling.DataNodeEventProperties.InUndoRedo},{name:OSF.DDA.DataNodeEventProperties.OldNode,value:OSF.DDA.Marshaling.DataNodeEventProperties.OldNode},{name:OSF.DDA.DataNodeEventProperties.NextSiblingNode,value:OSF.DDA.Marshaling.DataNodeEventProperties.NextSiblingNode}],isComplexType:!0}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.DataNodeEventProperties.OldNode,fromHost:[{name:OSF.DDA.PropertyDescriptors.DataNodeProperties,value:OSF.DDA.WAC.Delegate.ParameterMap.self}],isComplexType:!0}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.DataNodeEventProperties.NewNode,fromHost:[{name:OSF.DDA.PropertyDescriptors.DataNodeProperties,value:OSF.DDA.WAC.Delegate.ParameterMap.self}],isComplexType:!0}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.DataNodeEventProperties.NextSiblingNode,fromHost:[{name:OSF.DDA.PropertyDescriptors.DataNodeProperties,value:OSF.DDA.WAC.Delegate.ParameterMap.self}],isComplexType:!0}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddDataPartMethod,fromHost:[{name:OSF.DDA.PropertyDescriptors.DataPartProperties,value:OSF.DDA.Marshaling.PropertyDescriptors.DataPartProperties}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.Xml,value:OSF.DDA.Marshaling.CustomXmlPartsKeys.Xml}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDataPartByIdMethod,fromHost:[{name:OSF.DDA.PropertyDescriptors.DataPartProperties,value:OSF.DDA.Marshaling.PropertyDescriptors.DataPartProperties}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:OSF.DDA.Marshaling.CustomXmlPartsKeys.Id}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDataPartsByNamespaceMethod,fromHost:[{name:OSF.DDA.ListDescriptors.DataPartList,value:OSF.DDA.Marshaling.ListDescriptors.DataPartList}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.Namespace,value:OSF.DDA.Marshaling.CustomXmlPartsKeys.Namespace}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDataPartXmlMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:OSF.DDA.Marshaling.CustomXmlPartsKeys.Id}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDataPartNodesMethod,fromHost:[{name:OSF.DDA.ListDescriptors.DataNodeList,value:OSF.DDA.Marshaling.ListDescriptors.DataNodeList}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:OSF.DDA.Marshaling.CustomXmlPartsKeys.Id},{name:Microsoft.Office.WebExtension.Parameters.XPath,value:OSF.DDA.Marshaling.CustomXmlPartsKeys.XPath}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidDeleteDataPartMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:OSF.DDA.Marshaling.CustomXmlPartsKeys.Id}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDataNodeValueMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}],toHost:[{name:OSF.DDA.DataNodeProperties.Handle,value:OSF.DDA.Marshaling.DataNodeProperties.Handle}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDataNodeXmlMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}],toHost:[{name:OSF.DDA.DataNodeProperties.Handle,value:OSF.DDA.Marshaling.DataNodeProperties.Handle}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDataNodeTextMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}],toHost:[{name:OSF.DDA.DataNodeProperties.Handle,value:OSF.DDA.Marshaling.DataNodeProperties.Handle}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDataNodesMethod,fromHost:[{name:OSF.DDA.ListDescriptors.DataNodeList,value:OSF.DDA.Marshaling.ListDescriptors.DataNodeList}],toHost:[{name:OSF.DDA.DataNodeProperties.Handle,value:OSF.DDA.Marshaling.DataNodeProperties.Handle},{name:Microsoft.Office.WebExtension.Parameters.XPath,value:OSF.DDA.Marshaling.CustomXmlPartsKeys.XPath}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetDataNodeValueMethod,toHost:[{name:OSF.DDA.DataNodeProperties.Handle,value:OSF.DDA.Marshaling.DataNodeProperties.Handle},{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetDataNodeXmlMethod,toHost:[{name:OSF.DDA.DataNodeProperties.Handle,value:OSF.DDA.Marshaling.DataNodeProperties.Handle},{name:Microsoft.Office.WebExtension.Parameters.Xml,value:OSF.DDA.Marshaling.CustomXmlPartsKeys.Xml}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetDataNodeTextMethod,toHost:[{name:OSF.DDA.DataNodeProperties.Handle,value:OSF.DDA.Marshaling.DataNodeProperties.Handle},{name:Microsoft.Office.WebExtension.Parameters.Text,value:OSF.DDA.Marshaling.CustomXmlPartsKeys.Text}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidAddDataNamespaceMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:OSF.DDA.Marshaling.DataPartProperties.Id},{name:Microsoft.Office.WebExtension.Parameters.Prefix,value:OSF.DDA.Marshaling.CustomXmlPartsKeys.Prefix},{name:Microsoft.Office.WebExtension.Parameters.Namespace,value:OSF.DDA.Marshaling.CustomXmlPartsKeys.Namespace}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDataUriByPrefixMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:OSF.DDA.Marshaling.DataPartProperties.Id},{name:Microsoft.Office.WebExtension.Parameters.Prefix,value:OSF.DDA.Marshaling.CustomXmlPartsKeys.Prefix}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDataPrefixByUriMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}],toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:OSF.DDA.Marshaling.DataPartProperties.Id},{name:Microsoft.Office.WebExtension.Parameters.Namespace,value:OSF.DDA.Marshaling.CustomXmlPartsKeys.Namespace}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidDataNodeAddedEvent,fromHost:[{name:OSF.DDA.EventDescriptors.DataNodeInsertedEvent,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidDataNodeReplacedEvent,fromHost:[{name:OSF.DDA.EventDescriptors.DataNodeReplacedEvent,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidDataNodeDeletedEvent,fromHost:[{name:OSF.DDA.EventDescriptors.DataNodeDeletedEvent,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.AsyncMethodNames.addNames({GetSelectedDataAsync:"getSelectedDataAsync",SetSelectedDataAsync:"setSelectedDataAsync"}),function(){OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetSelectedDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,enum:Microsoft.Office.WebExtension.CoercionType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.ValueFormat,value:{enum:Microsoft.Office.WebExtension.ValueFormat,defaultValue:Microsoft.Office.WebExtension.ValueFormat.Unformatted}},{name:Microsoft.Office.WebExtension.Parameters.FilterType,value:{enum:Microsoft.Office.WebExtension.FilterType,defaultValue:Microsoft.Office.WebExtension.FilterType.All}}],privateStateCallbacks:[],onSucceeded:function(e,t,n){var o=e[Microsoft.Office.WebExtension.Parameters.Data];return OSF.DDA.TableDataProperties&&o&&(void 0!=o[OSF.DDA.TableDataProperties.TableRows]||void 0!=o[OSF.DDA.TableDataProperties.TableHeaders])&&(o=OSF.DDA.OMFactory.manufactureTableData(o)),void 0==(o=OSF.DDA.DataCoercion.coerceData(o,n[Microsoft.Office.WebExtension.Parameters.CoercionType]))?null:o}}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["string","object","number","boolean"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:{enum:Microsoft.Office.WebExtension.CoercionType,calculate:function(e){return OSF.DDA.DataCoercion.determineCoercionType(e[Microsoft.Office.WebExtension.Parameters.Data])}}},{name:Microsoft.Office.WebExtension.Parameters.ImageLeft,value:{types:["number","boolean"],defaultValue:!1}},{name:Microsoft.Office.WebExtension.Parameters.ImageTop,value:{types:["number","boolean"],defaultValue:!1}},{name:Microsoft.Office.WebExtension.Parameters.ImageWidth,value:{types:["number","boolean"],defaultValue:!1}},{name:Microsoft.Office.WebExtension.Parameters.ImageHeight,value:{types:["number","boolean"],defaultValue:!1}}],privateStateCallbacks:[]})}(),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.WAC.UniqueArguments.GetData,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:"BindingId"},{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:"CoerceType"},{name:Microsoft.Office.WebExtension.Parameters.ValueFormat,value:"ValueFormat"},{name:Microsoft.Office.WebExtension.Parameters.FilterType,value:"FilterType"},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:"Rows"},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:"Columns"},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:"StartRow"},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:"StartCol"},{name:Microsoft.Office.WebExtension.Parameters.RowCount,value:"RowCount"},{name:Microsoft.Office.WebExtension.Parameters.ColumnCount,value:"ColCount"}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.WAC.UniqueArguments.SetData,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Id,value:"BindingId"},{name:Microsoft.Office.WebExtension.Parameters.CoercionType,value:"CoerceType"},{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data},{name:Microsoft.Office.WebExtension.Parameters.Rows,value:"Rows"},{name:Microsoft.Office.WebExtension.Parameters.Columns,value:"Columns"},{name:Microsoft.Office.WebExtension.Parameters.StartRow,value:"StartRow"},{name:Microsoft.Office.WebExtension.Parameters.StartColumn,value:"StartCol"},{name:Microsoft.Office.WebExtension.Parameters.ImageLeft,value:"ImageLeft"},{name:Microsoft.Office.WebExtension.Parameters.ImageTop,value:"ImageTop"},{name:Microsoft.Office.WebExtension.Parameters.ImageWidth,value:"ImageWidth"},{name:Microsoft.Office.WebExtension.Parameters.ImageHeight,value:"ImageHeight"}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetSelectedDataMethod,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}],toHost:[{name:OSF.DDA.WAC.UniqueArguments.GetData,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSetSelectedDataMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.SetData,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.SettingsManager={SerializedSettings:"serializedSettings",RefreshingSettings:"refreshingSettings",DateJSONPrefix:"Date(",DataJSONSuffix:")",serializeSettings:function(e){return OSF.OUtil.serializeSettings(e)},deserializeSettings:function(e){return OSF.OUtil.deserializeSettings(e)}},OSF.DDA.Settings=function(e){e=e||{};var t=function(e){var t=OSF.OUtil.getSessionStorage();if(t){var n=OSF.DDA.SettingsManager.serializeSettings(e),o=JSON?JSON.stringify(n):Sys.Serialization.JavaScriptSerializer.serialize(n);t.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(),o)}};OSF.OUtil.defineEnumerableProperties(this,{get:{value:function(t){var n=Function._validateParams(arguments,[{name:"name",type:String,mayBeNull:!1}]);if(n)throw n;var o=e[t];return"undefined"===typeof o?null:o}},set:{value:function(n,o){var r=Function._validateParams(arguments,[{name:"name",type:String,mayBeNull:!1},{name:"value",mayBeNull:!0}]);if(r)throw r;e[n]=o,t(e)}},remove:{value:function(n){var o=Function._validateParams(arguments,[{name:"name",type:String,mayBeNull:!1}]);if(o)throw o;delete e[n],t(e)}}}),OSF.DDA.DispIdHost.addAsyncMethods(this,[OSF.DDA.AsyncMethodNames.SaveAsync],e)},OSF.DDA.RefreshableSettings=function(e){OSF.DDA.RefreshableSettings.uber.constructor.call(this,e),OSF.DDA.DispIdHost.addAsyncMethods(this,[OSF.DDA.AsyncMethodNames.RefreshAsync],e),OSF.DDA.DispIdHost.addEventSupport(this,new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged]))},OSF.OUtil.extend(OSF.DDA.RefreshableSettings,OSF.DDA.Settings),OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{SettingsChanged:"settingsChanged"}),OSF.DDA.SettingsChangedEventArgs=function(e){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.SettingsChanged},settings:{value:e}})},OSF.DDA.AsyncMethodNames.addNames({RefreshAsync:"refreshAsync",SaveAsync:"saveAsync"}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.RefreshAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[{name:OSF.DDA.SettingsManager.RefreshingSettings,value:function(e,t){return t}}],onSucceeded:function(e,t,n){var o=e[OSF.DDA.SettingsManager.SerializedSettings],r=OSF.DDA.SettingsManager.deserializeSettings(o),i=n[OSF.DDA.SettingsManager.RefreshingSettings];for(var a in i)t.remove(a);for(var a in r)t.set(a,r[a]);return t}}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.SaveAsync,requiredArguments:[],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,value:{types:["boolean"],defaultValue:!0}}],privateStateCallbacks:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:function(e,t){return OSF.DDA.SettingsManager.serializeSettings(t)}}]}),OSF.DDA.WAC.SettingsTranslator=function(){return{read:function(e){var t=OSF.DDA.ExcelDocument&&Microsoft.Office.WebExtension.context.document&&Microsoft.Office.WebExtension.context.document instanceof OSF.DDA.ExcelDocument,n={},o=e.Settings;for(var r in o){var i=o[r];t?n[i.Name]=i.Value:n[i[0]]=i[1]}return n},write:function(e){var t=[];for(var n in e){var o=[];o[0]=n,o[1]=e[n],t.push(o)}return t}}}(),OSF.DDA.WAC.Delegate.ParameterMap.setDynamicType(OSF.DDA.SettingsManager.SerializedSettings,{toHost:OSF.DDA.WAC.SettingsTranslator.write,fromHost:OSF.DDA.WAC.SettingsTranslator.read}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.WAC.UniqueArguments.SettingsRequest,toHost:[{name:Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,value:"OverwriteIfStale"},{name:OSF.DDA.SettingsManager.SerializedSettings,value:OSF.DDA.WAC.UniqueArguments.Properties}],invertible:!0}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidLoadSettingsMethod,fromHost:[{name:OSF.DDA.SettingsManager.SerializedSettings,value:OSF.DDA.WAC.UniqueArguments.Properties}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSaveSettingsMethod,toHost:[{name:OSF.DDA.WAC.UniqueArguments.SettingsRequest,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidSettingsChangedEvent}),OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{DocumentSelectionChanged:"documentSelectionChanged"}),OSF.DDA.DocumentSelectionChangedEventArgs=function(e){OSF.OUtil.defineEnumerableProperties(this,{type:{value:Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged},document:{value:e}})},OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{ObjectDeleted:"objectDeleted"}),OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{ObjectSelectionChanged:"objectSelectionChanged"}),OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{ObjectDataChanged:"objectDataChanged"}),OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{ContentControlAdded:"contentControlAdded"}),OSF.DDA.ObjectEventArgs=function(e,t){OSF.OUtil.defineEnumerableProperties(this,{type:{value:e},object:{value:t}})},OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidDocumentSelectionChangedEvent}),OSF.DDA.FilePropertiesDescriptor={Url:"Url"},OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{FilePropertiesDescriptor:"FilePropertiesDescriptor"}),Microsoft.Office.WebExtension.FileProperties=function(e){OSF.OUtil.defineEnumerableProperties(this,{url:{value:e[OSF.DDA.FilePropertiesDescriptor.Url]}})},OSF.DDA.AsyncMethodNames.addNames({GetFilePropertiesAsync:"getFilePropertiesAsync"}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync,fromHost:[{name:OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,value:0}],requiredArguments:[],supportedOptions:[],onSucceeded:function(e,t,n){return new Microsoft.Office.WebExtension.FileProperties(e)}}),OSF.OUtil.setNamespace("Marshaling",OSF.DDA),function(e){e[e.Properties=0]="Properties",e[e.Url=1]="Url"}(OSF_DDA_Marshaling_FilePropertiesKeys||(OSF_DDA_Marshaling_FilePropertiesKeys={})),OSF.DDA.Marshaling.FilePropertiesKeys=OSF_DDA_Marshaling_FilePropertiesKeys,OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,fromHost:[{name:OSF.DDA.FilePropertiesDescriptor.Url,value:OSF.DDA.Marshaling.FilePropertiesKeys.Url}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetFilePropertiesMethod,fromHost:[{name:OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,value:OSF.DDA.Marshaling.FilePropertiesKeys.Properties}]}),Microsoft.Office.WebExtension.FileType={Text:"text",Compressed:"compressed",Pdf:"pdf"},OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors,{FileProperties:"FileProperties",FileSliceProperties:"FileSliceProperties"}),OSF.DDA.FileProperties={Handle:"FileHandle",FileSize:"FileSize",SliceSize:Microsoft.Office.WebExtension.Parameters.SliceSize},OSF.DDA.File=function(e,t,n){OSF.OUtil.defineEnumerableProperties(this,{size:{value:t},sliceCount:{value:Math.ceil(t/n)}});var o={};o[OSF.DDA.FileProperties.Handle]=e,o[OSF.DDA.FileProperties.SliceSize]=n;var r=OSF.DDA.AsyncMethodNames;OSF.DDA.DispIdHost.addAsyncMethods(this,[r.GetDocumentCopyChunkAsync,r.ReleaseDocumentCopyAsync],o)},OSF.DDA.FileSliceOffset="fileSliceoffset",OSF.DDA.AsyncMethodNames.addNames({GetDocumentCopyAsync:"getFileAsync",GetDocumentCopyChunkAsync:"getSliceAsync",ReleaseDocumentCopyAsync:"closeAsync"}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDocumentCopyAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.FileType,enum:Microsoft.Office.WebExtension.FileType}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.SliceSize,value:{types:["number"],defaultValue:4194304}}],checkCallArgs:function(e,t,n){var o=e[Microsoft.Office.WebExtension.Parameters.SliceSize];if(o<=0||o>4194304)throw OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize;return e},onSucceeded:function(e,t,n){return new OSF.DDA.File(e[OSF.DDA.FileProperties.Handle],e[OSF.DDA.FileProperties.FileSize],n[Microsoft.Office.WebExtension.Parameters.SliceSize])}}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetDocumentCopyChunkAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.SliceIndex,types:["number"]}],privateStateCallbacks:[{name:OSF.DDA.FileProperties.Handle,value:function(e,t){return t[OSF.DDA.FileProperties.Handle]}},{name:OSF.DDA.FileProperties.SliceSize,value:function(e,t){return t[OSF.DDA.FileProperties.SliceSize]}}],checkCallArgs:function(e,t,n){var o=e[Microsoft.Office.WebExtension.Parameters.SliceIndex];if(o<0||o>=t.sliceCount)throw OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange;return e[OSF.DDA.FileSliceOffset]=parseInt((o*n[OSF.DDA.FileProperties.SliceSize]).toString()),e},onSucceeded:function(e,t,n){var o={};return OSF.OUtil.defineEnumerableProperties(o,{data:{value:e[Microsoft.Office.WebExtension.Parameters.Data]},index:{value:n[Microsoft.Office.WebExtension.Parameters.SliceIndex]},size:{value:e[OSF.DDA.FileProperties.SliceSize]}}),o}}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.ReleaseDocumentCopyAsync,privateStateCallbacks:[{name:OSF.DDA.FileProperties.Handle,value:function(e,t){return t[OSF.DDA.FileProperties.Handle]}}]}),OSF.OUtil.setNamespace("Marshaling",OSF.DDA),OSF.OUtil.setNamespace("File",OSF.DDA.Marshaling),function(e){e[e.Handle=0]="Handle",e[e.FileSize=1]="FileSize"}(OSF_DDA_Marshaling_File_FilePropertiesKeys||(OSF_DDA_Marshaling_File_FilePropertiesKeys={})),OSF.DDA.Marshaling.File.FilePropertiesKeys=OSF_DDA_Marshaling_File_FilePropertiesKeys,function(e){e[e.Data=0]="Data",e[e.SliceSize=1]="SliceSize"}(OSF_DDA_Marshaling_File_SlicePropertiesKeys||(OSF_DDA_Marshaling_File_SlicePropertiesKeys={})),OSF.DDA.Marshaling.File.SlicePropertiesKeys=OSF_DDA_Marshaling_File_SlicePropertiesKeys,function(e){e[e.Text=0]="Text",e[e.Compressed=1]="Compressed",e[e.Pdf=2]="Pdf"}(OSF_DDA_Marshaling_File_FileType||(OSF_DDA_Marshaling_File_FileType={})),OSF.DDA.Marshaling.File.FileType=OSF_DDA_Marshaling_File_FileType,function(e){e[e.FileType=0]="FileType",e[e.SliceSize=1]="SliceSize",e[e.Handle=2]="Handle",e[e.SliceIndex=3]="SliceIndex"}(OSF_DDA_Marshaling_File_ParameterKeys||(OSF_DDA_Marshaling_File_ParameterKeys={})),OSF.DDA.Marshaling.File.ParameterKeys=OSF_DDA_Marshaling_File_ParameterKeys,OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.FileProperties),OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.PropertyDescriptors.FileSliceProperties),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.FileProperties,fromHost:[{name:OSF.DDA.FileProperties.Handle,value:OSF.DDA.Marshaling.File.FilePropertiesKeys.Handle},{name:OSF.DDA.FileProperties.FileSize,value:OSF.DDA.Marshaling.File.FilePropertiesKeys.FileSize}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.PropertyDescriptors.FileSliceProperties,fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.Marshaling.File.SlicePropertiesKeys.Data},{name:OSF.DDA.FileProperties.SliceSize,value:OSF.DDA.Marshaling.File.SlicePropertiesKeys.SliceSize}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:Microsoft.Office.WebExtension.Parameters.FileType,toHost:[{name:Microsoft.Office.WebExtension.FileType.Text,value:OSF.DDA.Marshaling.File.FileType.Text},{name:Microsoft.Office.WebExtension.FileType.Compressed,value:OSF.DDA.Marshaling.File.FileType.Compressed},{name:Microsoft.Office.WebExtension.FileType.Pdf,value:OSF.DDA.Marshaling.File.FileType.Pdf}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDocumentCopyMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.FileType,value:OSF.DDA.Marshaling.File.ParameterKeys.FileType},{name:Microsoft.Office.WebExtension.Parameters.SliceSize,value:OSF.DDA.Marshaling.File.ParameterKeys.SliceSize}],fromHost:[{name:OSF.DDA.PropertyDescriptors.FileProperties,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetDocumentCopyChunkMethod,toHost:[{name:OSF.DDA.FileProperties.Handle,value:OSF.DDA.Marshaling.File.ParameterKeys.Handle},{name:Microsoft.Office.WebExtension.Parameters.SliceIndex,value:OSF.DDA.Marshaling.File.ParameterKeys.SliceIndex}],fromHost:[{name:OSF.DDA.PropertyDescriptors.FileSliceProperties,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidReleaseDocumentCopyMethod,toHost:[{name:OSF.DDA.FileProperties.Handle,value:OSF.DDA.Marshaling.File.ParameterKeys.Handle}]}),OSF.DDA.AsyncMethodNames.addNames({ExecuteRichApiRequestAsync:"executeRichApiRequestAsync"}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.ExecuteRichApiRequestAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Data,types:["object"]}],supportedOptions:[]}),OSF.OUtil.setNamespace("RichApi",OSF.DDA),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidExecuteRichApiRequestMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.ArrayData}],fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.WAC.UniqueArguments.Data}]}),function(e){!function(t){var n=function(){function n(){var e=this;this._pseudoDocument=null,this._eventDispatch=null,this._processAppCommandInvocation=function(t){var n=e._verifyManifestCallback(t.callbackName);if(n.errorCode==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess){var o=e._constructEventObjectForCallback(t);o?window.setTimeout((function(){n.callback(o)}),0):e._invokeAppCommandCompletedMethod(t.appCommandId,OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError,"")}else e._invokeAppCommandCompletedMethod(t.appCommandId,n.errorCode,"")}}return n.initializeOsfDda=function(){OSF.DDA.AsyncMethodNames.addNames({AppCommandInvocationCompletedAsync:"appCommandInvocationCompletedAsync"}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.AppCommandInvocationCompletedAsync,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.Id,types:["string"]},{name:Microsoft.Office.WebExtension.Parameters.Status,types:["number"]},{name:Microsoft.Office.WebExtension.Parameters.AppCommandInvocationCompletedData,types:["string"]}]}),OSF.OUtil.augmentList(OSF.DDA.EventDescriptors,{AppCommandInvokedEvent:"AppCommandInvokedEvent"}),OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{AppCommandInvoked:"appCommandInvoked"}),OSF.OUtil.setNamespace("AppCommand",OSF.DDA),OSF.DDA.AppCommand.AppCommandInvokedEventArgs=e.AppCommand.AppCommandInvokedEventArgs},n.prototype.initializeAndChangeOnce=function(e){t.registerDdaFacade(),this._pseudoDocument={},OSF.DDA.DispIdHost.addAsyncMethods(this._pseudoDocument,[OSF.DDA.AsyncMethodNames.AppCommandInvocationCompletedAsync]),this._eventDispatch=new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.AppCommandInvoked]);OSF.DDA.DispIdHost.addEventSupport(this._pseudoDocument,this._eventDispatch),this._pseudoDocument.addHandlerAsync(Microsoft.Office.WebExtension.EventType.AppCommandInvoked,this._processAppCommandInvocation,(function(t){e&&("succeeded"==t.status?e(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess):e(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError))}))},n.prototype._verifyManifestCallback=function(e){var t={callback:null,errorCode:OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCallback};e=e.trim();try{var n=this._getCallbackFunc(e);if("function"!=typeof n)return t}catch(e){return t}return{callback:n,errorCode:OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess}},n.prototype._getCallbackFuncFromWindow=function(e){for(var t=e.split("."),n=window,o=0;o100&&(e[Microsoft.Office.WebExtension.Parameters.Width]=99),e[Microsoft.Office.WebExtension.Parameters.Height]<=0&&(e[Microsoft.Office.WebExtension.Parameters.Height]=1),!e[Microsoft.Office.WebExtension.Parameters.UseDeviceIndependentPixels]&&e[Microsoft.Office.WebExtension.Parameters.Height]>100&&(e[Microsoft.Office.WebExtension.Parameters.Height]=99),e[Microsoft.Office.WebExtension.Parameters.RequireHTTPs]||(e[Microsoft.Office.WebExtension.Parameters.RequireHTTPs]=!0),e}}),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.CloseAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[]}),OSF.DDA.SyncMethodCalls.define({method:OSF.DDA.SyncMethodNames.MessageParent,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.MessageToParent,types:["string","number","boolean"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.TargetOrigin,value:{types:["string"],defaultValue:""}}]}),OSF.DDA.SyncMethodCalls.define({method:OSF.DDA.SyncMethodNames.AddMessageHandler,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.EventType,enum:Microsoft.Office.WebExtension.EventType,verify:function(e,t,n){return n.supportsEvent(e)}},{name:Microsoft.Office.WebExtension.Parameters.Handler,types:["function"]}],supportedOptions:[]}),OSF.DDA.SyncMethodCalls.define({method:OSF.DDA.SyncMethodNames.SendMessage,requiredArguments:[{name:Microsoft.Office.WebExtension.Parameters.MessageContent,types:["string"]}],supportedOptions:[{name:Microsoft.Office.WebExtension.Parameters.TargetOrigin,value:{types:["string"],defaultValue:""}}],privateStateCallbacks:[]}),OSF.OUtil.setNamespace("Marshaling",OSF.DDA),OSF.OUtil.setNamespace("Dialog",OSF.DDA.Marshaling),OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys={MessageType:"messageType",MessageContent:"messageContent",MessageOrigin:"messageOrigin",TargetOrigin:"targetOrigin"},OSF.DDA.Marshaling.Dialog.DialogParentMessageReceivedEventKeys={MessageType:"messageType",MessageContent:"messageContent",MessageOrigin:"messageOrigin",TargetOrigin:"targetOrigin"},OSF.DDA.Marshaling.MessageParentKeys={MessageToParent:"messageToParent",TargetOrigin:"targetOrigin"},OSF.DDA.Marshaling.DialogNotificationShownEventType={DialogNotificationShown:"dialogNotificationShown"},OSF.DDA.Marshaling.SendMessageKeys={MessageContent:"messageContent",TargetOrigin:"targetOrigin"},function(e){!function(e){var t="excel",n="word",o="powerpoint",r="outlook",i="visio";e.getDialogCssManager=function(e){switch(e){case t:case n:case o:case r:case i:default:return new a}return null};var a=function(){function e(){this.overlayElementCSS=["position: absolute","top: 0","left: 0","width: 100%","height: 100%","background-color: rgba(198, 198, 198, 0.5)","z-index: 99998"],this.dialogNotificationPanelCSS=["width: 100%","height: 190px","position: absolute","z-index: 99999","background-color: rgba(255, 255, 255, 1)","left: 0px","top: 50%","margin-top: -95px"],this.newWindowNotificationTextPanelCSS=["margin: 20px 14px","font-family: Segoe UI,Arial,Verdana,sans-serif","font-size: 14px","height: 100px","line-height: 100px"],this.newWindowNotificationTextSpanCSS=["display: inline-block","line-height: normal","vertical-align: middle"],this.crossZoneNotificationTextPanelCSS=["margin: 20px 14px","font-family: Segoe UI,Arial,Verdana,sans-serif","font-size: 14px","height: 100px"],this.dialogNotificationButtonPanelCSS="margin:0px 9px",this.buttonStyleCSS=["text-align: center","width: 70px","height: 25px","font-size: 14px","font-family: Segoe UI,Arial,Verdana,sans-serif","margin: 0px 5px","border-width: 1px","border-style: solid"]}return e.prototype.getOverlayElementCSS=function(){return this.overlayElementCSS.join(";")},e.prototype.getDialogNotificationPanelCSS=function(){return this.dialogNotificationPanelCSS.join(";")},e.prototype.getNewWindowNotificationTextPanelCSS=function(){return this.newWindowNotificationTextPanelCSS.join(";")},e.prototype.getNewWindowNotificationTextSpanCSS=function(){return this.newWindowNotificationTextSpanCSS.join(";")},e.prototype.getCrossZoneNotificationTextPanelCSS=function(){return this.crossZoneNotificationTextPanelCSS.join(";")},e.prototype.getDialogNotificationButtonPanelCSS=function(){return this.dialogNotificationButtonPanelCSS},e.prototype.getDialogButtonCSS=function(){return this.buttonStyleCSS.join(";")},e}();e.DefaultDialogCSSManager=a}(e.WacCommonUICssManager||(e.WacCommonUICssManager={}))}(OfficeExt||(OfficeExt={})),function(e){!function(t){!function(t){var n=null,o=null,r=null,i=null,a=null,s=!1,c=-1,l=null,u=e.WACUtils.shouldUseLocalStorageToPassMessage(),p={dispId:OSF.DDA.EventDispId.dispidDialogNotificationShownInAddinEvent,eventType:OSF.DDA.Marshaling.DialogNotificationShownEventType.DialogNotificationShown,onComplete:null,onCalling:null};function d(t,n){var o=!1,a=e.WacCommonUICssManager.getDialogCssManager(n);r=v(a),document.body.insertBefore(r,document.body.firstChild),(i=function(t,n){var o=document.createElement("div");o.style.cssText=t.getDialogNotificationPanelCSS(),D(o);var r=document.createElement("div");r.style.cssText=t.getCrossZoneNotificationTextPanelCSS(),r.id="dialogNotificationTextPanel";var i=document.createElement("a");i.id="configureBrowserLink",i.href="#",i.innerText=Strings.OfficeOM.L_NewWindowCrossZoneConfigureBrowserLink,i.setAttribute("onclick","window.open('https://support.microsoft.com/en-us/help/17479/windows-internet-explorer-11-change-security-privacy-settings', '_blank', 'fullscreen=1')");var a=document.createElement("span");Strings.OfficeOM.L_NewWindowCrossZone&&(a.innerHTML=OSF.OUtil.formatString(Strings.OfficeOM.L_NewWindowCrossZone,i.outerHTML,e.WACUtils.getDomainForUrl(n)));return r.appendChild(a),o.appendChild(r),o}(a,t)).id="crossZoneNotification";var c=S(a),l=g(a,Strings.OfficeOM.L_DialogOK?Strings.OfficeOM.L_DialogOK:"OK");c.appendChild(l),i.appendChild(c),document.body.insertBefore(i,document.body.firstChild),s=!0,l.onclick=function(){_()},l.addEventListener("keydown",(function(e){9==e.keyCode?(document.getElementById("configureBrowserLink").focus(),e.preventDefault(),e.stopPropagation()):13==e.keyCode&&(o=!0,e.preventDefault(),e.stopPropagation())}),!1),l.addEventListener("keyup",(function(e){13==e.keyCode&&o&&(o=!1,_(),e.preventDefault(),e.stopPropagation())}),!1),document.getElementById("configureBrowserLink").addEventListener("keydown",(function(e){9==e.keyCode&&(l.focus(),e.preventDefault(),e.stopPropagation())}),!1),window.focus(),l.focus()}function f(e){if(e.source==n)try{var t=e.origin,r=OSF._OfficeAppFactory.getInitializationHelper()._appContext._addInSourceUrl;if(r||(r=window.location.origin)||(r=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")),!function(e,t,n){if(void 0===n&&(n=!0),!e||!t)return!1;var o=OSF.OUtil.parseUrl(e),r=OSF.OUtil.parseUrl(t),i=OSF._OfficeAppFactory.getInitializationHelper()._appContext._appDomains;if(!("https:"===o.protocol))return!1;var a=o.protocol===r.protocol&&o.hostname===r.hostname&&o.port===r.port,s=Microsoft.Office.Common.XdmCommunicationManager.checkUrlWithAppDomains(i,e),c=a||s;return!c&&n&&(c=Microsoft.Office.Common.XdmCommunicationManager.isTargetSubdomainOfSourceLocation(t,e)),c}(t,r,!0))throw new Error("Received a message from a dialog with an untrusted domain.");var i={};i[OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageType]=OSF.DialogMessageType.DialogMessageReceived,i[OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageContent]=e.data,i[OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageOrigin]=t,o(i)}catch(e){OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Error happened during receive message handler."+e)}}function h(e){var t=OSF._OfficeAppFactory.getInitializationHelper()._webAppState.id+"messageParentKey";if(e.key==t)try{var n={};n[OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageType]=OSF.DialogMessageType.DialogMessageReceived,n[OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageContent]=e.newValue,n[OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageOrigin]=e.origin,o(n)}catch(e){OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Error happened during storage changed handler."+e)}}function m(t){var r=OSF._OfficeAppFactory.getInitializationHelper()._hostInfo,i=[r.hostType,r.hostPlatform,r.hostSpecificFileVersion,r.hostLocale,r.osfControlAppCorrelationId,"isDialog",r.disableLogging?"disableLogging":"",r.flags&OSF.HostInfoFlags.PublicAddin].join("$"),s=OSF._OfficeAppFactory.getInitializationHelper()._appContext;s._taskpaneUrl=window.location.origin,s._taskpaneUrl||(s._taskpaneUrl=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""));var l=t[OSF.ShowWindowDialogParameterKeys.Url];t[OSF.ShowWindowDialogParameterKeys.UrlNoHostInfo]||(l=e.WACUtils.addHostInfoAsQueryParam(l,i));var p=JSON.parse(window.name);p[OSF.WindowNameItemKeys.HostInfo]=i,p[OSF.WindowNameItemKeys.AppContext]=s;var m=t[OSF.ShowWindowDialogParameterKeys.Width]*screen.width/100,g=t[OSF.ShowWindowDialogParameterKeys.Height]*screen.height/100,y="width="+m+", height="+g+", left="+(s._clientWindowWidth/2-m/2)+", top="+(s._clientWindowHeight/2-g/2)+",channelmode=no,directories=no,fullscreen=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=yes,toolbar=no";if(null==(n=window.open(l,e.WACUtils.serializeObjectToString(p),y)))return OSF.AppTelemetry.logAppCommonMessage("Encountered cross zone issue in displayDialogAsync api."),b(),d(l,r.hostType),void a(OSF.DDA.ErrorCodeManager.errorCodes.ooeCrossZone);u?window.addEventListener("storage",h):window.addEventListener("message",f),c=window.setInterval((function(){try{if(null==n||n.closed){window.clearInterval(c),u?window.removeEventListener("storage",h):window.removeEventListener("message",f);var e={};e[OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageType]=OSF.DialogMessageType.DialogClosed,o(e)}}catch(e){OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Error happened during check or handle window close."+e)}}),1e3),null!=a?a(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess):OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("showDialogCallback can not be null.")}function g(e,t){var n=document.createElement("input");n.setAttribute("type","button"),n.style.cssText=e.getDialogButtonCSS(),n.style.borderColor="#ababab",n.style.backgroundColor="#ffffff",n.setAttribute("value",t);var o=function(){y(n)},r=function(){O(n)};return n.addEventListener("mouseover",o),n.addEventListener("focus",o),n.addEventListener("mouseout",r),n.addEventListener("focusout",r),n}function y(e){null!=l?(e.style.borderColor=l.HostButtonBorderColor,e.style.backgroundColor=l.HostButtonBackgroundColor):OSF.CommonUI&&OSF.CommonUI.HostButtonBorderColor&&OSF.CommonUI.HostButtonBackgroundColor?(e.style.borderColor=OSF.CommonUI.HostButtonBorderColor,e.style.backgroundColor=OSF.CommonUI.HostButtonBackgroundColor):e.style.backgroundColor="#ccc"}function O(e){e.style.borderColor="#ababab",e.style.backgroundColor="#ffffff"}function _(){p.onCalling=function(e){b(),A(e)},OSF.DDA.WAC.Delegate.unregisterEventAsync(p)}function b(){null!=i&&(document.body.removeChild(i),i=null),null!=r&&(document.body.removeChild(r),r=null)}function v(e){var t=document.createElement("div");return t.style.cssText=e.getOverlayElementCSS(),t}function S(e){var t=document.createElement("div");return t.style.cssText=e.getDialogNotificationButtonPanelCSS(),"rtl"==document.documentElement.getAttribute("dir")?t.style.cssFloat="left":t.style.cssFloat="right",t}function A(e){if(e!=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess){var t=document.querySelectorAll(OSF._OfficeAppFactory.getInitializationHelper()._tabbableElements);OSF.OUtil.focusToFirstTabbable(t,!1)}}function D(e){e.setAttribute("role","dialog"),e.setAttribute("aria-describedby","dialogNotificationTextPanel")}t.setHostThemeButtonStyle=function(e){var t=e.input;null!=t&&(l={HostButtonBorderColor:t[OSF.HostThemeButtonStyleKeys.ButtonBorderColor],HostButtonBackgroundColor:t[OSF.HostThemeButtonStyleKeys.ButtonBackgroundColor]}),e.completed()},t.removeEventListenersForDialog=function(e){OSF._OfficeAppFactory.getInitializationHelper().addOrRemoveEventListenersForWindow(!1),e.completed()},t.handleNewWindowDialog=function(t){try{if(!function(e){var t=OSF._OfficeAppFactory.getInitializationHelper()._appContext._appDomains,n=e[OSF.ShowWindowDialogParameterKeys.Url],o=Microsoft.Office.Common.XdmCommunicationManager.checkUrlWithAppDomains(t,n);if(!o){var r=OSF._OfficeAppFactory.getInitializationHelper()._appContext._addInSourceUrl;return r||(r=window.location.origin)||(r=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")),r&&Microsoft.Office.Common.XdmCommunicationManager.isTargetSubdomainOfSourceLocation(r,n)}return o}(t))return void a(OSF.DDA.ErrorCodeManager.errorCodes.ooeAppDomains);if(!t[OSF.ShowWindowDialogParameterKeys.PromptBeforeOpen])return void m(t);s=!1;var n=!1,o=OSF._OfficeAppFactory.getInitializationHelper()._hostInfo,c=e.WacCommonUICssManager.getDialogCssManager(o.hostType),l=OSF.OUtil.formatString(Strings.OfficeOM.L_ShowWindowDialogNotification,OSF._OfficeAppFactory.getInitializationHelper()._appContext._addinName);r=v(c);var u=function(e){var t=[];try{for(;e.firstChild&&null!=e.firstChild;)t.push(e.firstChild),e.removeChild(e.firstChild)}catch(e){}return t}(document.body);document.body.appendChild(r),(i=function(e,t){var n=document.createElement("div");n.style.cssText=e.getDialogNotificationPanelCSS(),D(n);var o=document.createElement("div");o.style.cssText=e.getNewWindowNotificationTextPanelCSS(),o.id="dialogNotificationTextPanel","rtl"==document.documentElement.getAttribute("dir")?o.style.paddingRight="30px":o.style.paddingLeft="30px";var r=document.createElement("span");return r.style.cssText=e.getNewWindowNotificationTextSpanCSS(),r.innerText=t,o.appendChild(r),n.appendChild(o),n}(c,l)).id="newWindowNotificaiton";var d=S(c),f=g(c,Strings.OfficeOM.L_ShowWindowDialogNotificationAllow),h=g(c,Strings.OfficeOM.L_ShowWindowDialogNotificationIgnore);function P(e,t){try{for(var n=0;n-1)window.close();else{var t=e.data,n=typeof t;if(t&&("object"==n||"string"==n)){var o="string"==n?JSON.parse(t):t,r={};r[OSF.DDA.PropertyDescriptors.MessageContent]=o.messageContent,r[OSF.DDA.PropertyDescriptors.MessageOrigin]=e.origin;var i=OSF.DDA.OMFactory.manufactureEventArgs(Microsoft.Office.WebExtension.EventType.DialogParentMessageReceived,null,r);OSF.DialogParentMessageEventDispatch.fireEvent(i)}}}))},t.setHandlerAndShowDialogCallback=function(e,t){o=e,a=t},t.escDismissDialogNotification=function(){try{i&&"newWindowNotificaiton"==i.id&&a&&a(OSF.DDA.ErrorCodeManager.errorCodes.ooeEndUserIgnore)}catch(e){OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Error happened during executing displayDialogAsync callback."+e)}_()},t.showCrossZoneNotification=d}(t.Dialog||(t.Dialog={}))}(e.AddinNativeAction||(e.AddinNativeAction={}))}(OfficeExt||(OfficeExt={})),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidDialogMessageReceivedEvent,fromHost:[{name:OSF.DDA.EventDescriptors.DialogMessageReceivedEvent,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.EventDescriptors.DialogMessageReceivedEvent),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDescriptors.DialogMessageReceivedEvent,fromHost:[{name:OSF.DDA.PropertyDescriptors.MessageType,value:OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageType},{name:OSF.DDA.PropertyDescriptors.MessageContent,value:OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageContent},{name:OSF.DDA.PropertyDescriptors.MessageOrigin,value:OSF.DDA.Marshaling.Dialog.DialogMessageReceivedEventKeys.MessageOrigin}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDispId.dispidDialogParentMessageReceivedEvent,fromHost:[{name:OSF.DDA.EventDescriptors.DialogParentMessageReceivedEvent,value:OSF.DDA.WAC.Delegate.ParameterMap.self}]}),OSF.DDA.WAC.Delegate.ParameterMap.addComplexType(OSF.DDA.EventDescriptors.DialogParentMessageReceivedEvent),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.EventDescriptors.DialogParentMessageReceivedEvent,fromHost:[{name:OSF.DDA.PropertyDescriptors.MessageType,value:OSF.DDA.Marshaling.Dialog.DialogParentMessageReceivedEventKeys.MessageType},{name:OSF.DDA.PropertyDescriptors.MessageContent,value:OSF.DDA.Marshaling.Dialog.DialogParentMessageReceivedEventKeys.MessageContent},{name:OSF.DDA.PropertyDescriptors.MessageOrigin,value:OSF.DDA.Marshaling.Dialog.DialogParentMessageReceivedEventKeys.MessageOrigin}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidMessageParentMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.MessageToParent,value:OSF.DDA.Marshaling.MessageParentKeys.MessageToParent},{name:Microsoft.Office.WebExtension.Parameters.TargetOrigin,value:OSF.DDA.Marshaling.MessageParentKeys.TargetOrigin}]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidSendMessageMethod,toHost:[{name:Microsoft.Office.WebExtension.Parameters.MessageContent,value:OSF.DDA.Marshaling.SendMessageKeys.MessageContent},{name:Microsoft.Office.WebExtension.Parameters.TargetOrigin,value:OSF.DDA.Marshaling.MessageParentKeys.TargetOrigin}]}),OSF.DDA.WAC.Delegate.openDialog=function(e){var t=JSON.parse(e.targetId),n=OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(!0,e);function o(e){var t={Error:e};try{n(Microsoft.Office.Common.InvokeResultCode.noError,t)}catch(e){OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Exception happens at showDialogCallback."+e)}}if(OSF.DialogShownStatus.hasDialogShown)o(OSF.DDA.ErrorCodeManager.errorCodes.ooeDialogAlreadyOpened);else{var r=t[OSF.ShowWindowDialogParameterKeys.Url].toLowerCase(),i=window.location.href.toLowerCase();if(OSF.AppTelemetry){var a=!1,s=!1,c=!1,l=!1,u="",p="";if(OSF.OUtil){var d=OSF.OUtil.parseUrl(r),f=OSF.OUtil.parseUrl(i);a=d.protocol===f.protocol&&d.hostname===f.hostname&&d.port===f.port,u=OSF.OUtil.getHostnamePortionForLogging(d.hostname),a?p=u:(p=OSF.OUtil.getHostnamePortionForLogging(f.hostname),s=Microsoft.Office.Common.XdmCommunicationManager.isTargetSubdomainOfSourceLocation(r,i),c=Microsoft.Office.Common.XdmCommunicationManager.isTargetSubdomainOfSourceLocation(i,r));var h=OSF._OfficeAppFactory.getInitializationHelper()._appContext._appDomains;l=Microsoft.Office.Common.XdmCommunicationManager.checkUrlWithAppDomains(h,r)}var m="openDialog isInline: "+t[OSF.ShowWindowDialogParameterKeys.DisplayInIframe].toString()+", taskpaneHostname: "+p+", dialogHostName: "+u+", isSameDomain: "+a.toString()+", parentIsSubdomain: "+s.toString()+", childIsSubdomain: "+c.toString()+", isAppDomain: "+l.toString();OSF.AppTelemetry.logAppCommonMessage(m)}null!=r&&"https://"===r.substr(0,"https://".length)?t[OSF.ShowWindowDialogParameterKeys.DisplayInIframe]?(OSF.DialogShownStatus.isWindowDialog=!1,OSF.DDA.WAC.Delegate.registerEventAsync(e)):(OSF.DialogShownStatus.isWindowDialog=!0,OfficeExt.AddinNativeAction.Dialog.setHandlerAndShowDialogCallback((function(t){e.onEvent&&e.onEvent(t),OSF.AppTelemetry&&OSF.AppTelemetry.onEventDone(e.dispId)}),o),OfficeExt.AddinNativeAction.Dialog.handleNewWindowDialog(t)):"http://"===r.substr(0,"http://".length)?o(OSF.DDA.ErrorCodeManager.errorCodes.ooeRequireHTTPS):o(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidScheme)}},OSF.DDA.WAC.Delegate.messageParent=function(e){null!=window.opener?OfficeExt.AddinNativeAction.Dialog.messageParent(e):OSF.DDA.WAC.Delegate.executeAsync(e)},OSF.DDA.WAC.Delegate.sendMessage=function(e){OSF.DialogShownStatus.hasDialogShown&&(OSF.DialogShownStatus.isWindowDialog?OfficeExt.AddinNativeAction.Dialog.sendMessage(e):OSF.DDA.WAC.Delegate.executeAsync(e))},OSF.DDA.WAC.Delegate.closeDialog=function(e){var t=OSF.DDA.WAC.Delegate._getOnAfterRegisterEvent(!1,e);function n(e){var n={Error:e};try{t(Microsoft.Office.Common.InvokeResultCode.noError,n)}catch(e){OSF.AppTelemetry&&OSF.AppTelemetry.logAppException("Exception happens at closeDialogCallback."+e)}}OSF.DialogShownStatus.hasDialogShown?OSF.DialogShownStatus.isWindowDialog?(e.onCalling&&e.onCalling(),OfficeExt.AddinNativeAction.Dialog.closeDialog(n)):OSF.DDA.WAC.Delegate.unregisterEventAsync(e):n(OSF.DDA.ErrorCodeManager.errorCodes.ooeWebDialogClosed)},OSF.InitializationHelper.prototype.dismissDialogNotification=function(){OfficeExt.AddinNativeAction.Dialog.escDismissDialogNotification()},OSF.InitializationHelper.prototype.registerMessageReceivedEventForWindowDialog=function(){OfficeExt.AddinNativeAction.Dialog.registerMessageReceivedEvent()},OSF.DDA.AsyncMethodNames.addNames({CloseContainerAsync:"closeContainer"}),function(e){var t=function(){return function(e){}}();e.Container=t}(OfficeExt||(OfficeExt={})),OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.CloseContainerAsync,requiredArguments:[],supportedOptions:[],privateStateCallbacks:[]}),OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidCloseContainerMethod,fromHost:[],toHost:[]}),OSF.DDA.AsyncMethodNames.addNames({GetAuthContextAsync:"getAuthContextAsync"}),OSF.DDA.WebAuth=function(){},OSF.DDA.AsyncMethodCalls.define({method:OSF.DDA.AsyncMethodNames.GetAuthContextAsync,requiredArguments:[],supportedOptions:[],onSucceeded:function(e,t,n){return e[Microsoft.Office.WebExtension.Parameters.Data]}}),OSF.OUtil.setNamespace("Marshaling",OSF.DDA),OSF.OUtil.setNamespace("WebAuth",OSF.DDA.Marshaling),OSF.DDA.Marshaling.WebAuth.GetAuthContextKeys={},OSF.DDA.Marshaling.WebAuth.GetAuthContextResultKeys={AuthContext:"authContext",AppId:"appId",MsaAppId:"msaAppId",Upn:"upn",UserId:"userId",Authority:"authority",AuthorityType:"authorityType",IsAnonymous:"isAnonymous",TenantId:"tenantId",Error:"error",SupportsAuthToken:"supportsAuthToken"},OSF.DDA.WAC.Delegate.ParameterMap.define({type:OSF.DDA.MethodDispId.dispidGetAuthContextMethod,toHost:[],fromHost:[{name:Microsoft.Office.WebExtension.Parameters.Data,value:OSF.DDA.Marshaling.WebAuth.GetAuthContextResultKeys.AuthContext}]}),OSF.DDA.AsyncMethodNames.addNames({GetOfficeThemeAsync:"getOfficeThemeAsync",GetDocumentThemeAsync:"getDocumentThemeAsync"}),OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType,{OfficeThemeChanged:"officeThemeChanged",DocumentThemeChanged:"documentThemeChanged"}),OSF.OUtil.augmentList(Microsoft.Office.WebExtension.Parameters,{DocumentTheme:"documentTheme",OfficeTheme:"officeTheme"}),OSF.OUtil.augmentList(OSF.DDA.EventDescriptors,{DocumentThemeChangedEvent:"DocumentThemeChangedEvent",OfficeThemeChangedEvent:"OfficeThemeChangedEvent"}),OSF.OUtil.setNamespace("Theming",OSF.DDA),OSF.DDA.Theming.OfficeThemeEnum={PrimaryFontColor:"primaryFontColor",PrimaryBackgroundColor:"primaryBackgroundColor",SecondaryFontColor:"secondaryFontColor",SecondaryBackgroundColor:"secondaryBackgroundColor"},OSF.DDA.Theming.DocumentThemeEnum={PrimaryFontColor:"primaryFontColor",PrimaryBackgroundColor:"primaryBackgroundColor",SecondaryFontColor:"secondaryFontColor",SecondaryBackgroundColor:"secondaryBackgroundColor",Accent1:"accent1",Accent2:"accent2",Accent3:"accent3",Accent4:"accent4",Accent5:"accent5",Accent6:"accent6",Hyperlink:"hyperlink",FollowedHyperlink:"followedHyperlink",HeaderLatinFont:"headerLatinFont",HeaderEastAsianFont:"headerEastAsianFont",HeaderScriptFont:"headerScriptFont",HeaderLocalizedFont:"headerLocalizedFont",BodyLatinFont:"bodyLatinFont",BodyEastAsianFont:"bodyEastAsianFont",BodyScriptFont:"bodyScriptFont",BodyLocalizedFont:"bodyLocalizedFont"},OSF.DDA.Theming.ConvertToDocumentTheme=function(e){for(var t=[{name:"primaryFontColor",needToConvertToHex:!0},{name:"primaryBackgroundColor",needToConvertToHex:!0},{name:"secondaryFontColor",needToConvertToHex:!0},{name:"secondaryBackgroundColor",needToConvertToHex:!0},{name:"accent1",needToConvertToHex:!0},{name:"accent2",needToConvertToHex:!0},{name:"accent3",needToConvertToHex:!0},{name:"accent4",needToConvertToHex:!0},{name:"accent5",needToConvertToHex:!0},{name:"accent6",needToConvertToHex:!0},{name:"hyperlink",needToConvertToHex:!0},{name:"followedHyperlink",needToConvertToHex:!0},{name:"headerLatinFont",needToConvertToHex:!1},{name:"headerEastAsianFont",needToConvertToHex:!1},{name:"headerScriptFont",needToConvertToHex:!1},{name:"headerLocalizedFont",needToConvertToHex:!1},{name:"bodyLatinFont",needToConvertToHex:!1},{name:"bodyEastAsianFont",needToConvertToHex:!1},{name:"bodyScriptFont",needToConvertToHex:!1},{name:"bodyLocalizedFont",needToConvertToHex:!1}],n={},o=0;o=0&&(e=e.substring(t+5,e.length))<"14.14393"}()?e.PromiseImpl.Init():window.Promise:e.PromiseImpl.Init()}()}(t=e._Internal||(e._Internal={}));var n=t.OfficePromise;e.Promise=n}(OfficeExtension||(OfficeExtension={})),function(e){var t=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=t;var n=function(){function e(){}return e.setCustomSendRequestFunc=function(t){e.s_customSendRequestFunc=t},e.xhrSendRequestFunc=function(e){return l.createPromise((function(t,n){var r=new XMLHttpRequest;if(r.open(e.method,e.url),r.onload=function(){var e={statusCode:r.status,headers:l._parseHttpResponseHeaders(r.getAllResponseHeaders()),body:r.responseText};t(e)},r.onerror=function(){n(new o.RuntimeError({code:i.connectionFailure,httpStatusCode:r.status,message:l._getResourceString(a.connectionFailureWithStatus,r.statusText)}))},e.headers)for(var s in e.headers)r.setRequestHeader(s,e.headers[s]);r.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:c.getResponseStatusCode(t),headers:c.getResponseHeaders(t),body:c.getResponseBody(t)}:c.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 o.RuntimeError._createInvalidArgError({argumentName:"request"});l.isNullOrEmptyString(e.method)&&(e.method="GET"),e.method=e.method.toUpperCase()},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=n;var o,r=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=0){var i=t.url.substr(r+1),a=l._parseRequestFlagsAndCustomDataFromQueryStringIfAny(i);a.flags>=0&&(n=a.flags)}"string"===typeof t.body&&(t.body=JSON.parse(t.body));var s={id:e.nextId(),type:1,flags:n,message:t};return o.sendMessageToHostAndExpectResponse(s).then((function(e){return e.message}))}));for(var r=0;r=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;n0},e._getLocalDocumentUrlPrefixLength=function(e){for(var t=["http://document.localhost","https://document.localhost","//document.localhost"],n=e.toLowerCase().trim(),o=0;o0){var i=t.url.substr(r+1),a=e._parseRequestFlagsAndCustomDataFromQueryStringIfAny(i);a.flags>=0&&(n=a.flags),o=a.customData}}return c.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;i0){var c=a.substr(0,s),l=a.substr(s+1);c=e.trim(c),l=e.trim(l),n[c.toUpperCase()]=l}}}return n},e._parseErrorResponse=function(t){var n=e._parseErrorResponseBody(t),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:i.connectionFailure,errorMessage:e._getResourceString(a.connectionFailureWithStatus,t)}},e._createErrorResponse=function(t,n,o){return{errorCode:t,errorMessage:e._getResourceString(a.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 u=function(){function e(){}return e.setMock=function(t){e.s_isMock=t},e.isMock=function(){return e.s_isMock},e}();e.TestUtility=u,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 p=function(){function t(){}return t.createSetPropertyAction=function(t,n,o,r,i){S.validateObjectPath(n);var a={Id:t._nextId(),ActionType:4,Name:o,ObjectPathId:n._objectPath.objectPathInfo.Id,ArgumentInfo:{}},s=[r],c=S.setMethodArguments(t,a.ArgumentInfo,s);S.validateReferencedObjectPaths(c);var l=new f(a,0,i);if(l.referencedObjectPath=n._objectPath,l.referencedArgumentObjectPaths=c,e._internalConfig.enablePreviewExecution&&0!==(16&i)){var u={Id:t._nextId(),ActionType:4,Name:o,ObjectId:"",ObjectType:"",Arguments:[r]};n._addPreviewExecutionAction(u)}return n._addAction(l)},t.createQueryAction=function(e,t,n,o){S.validateObjectPath(t);var r={Id:e._nextId(),ActionType:2,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,QueryInfo:n},i=new f(r,1,4);return i.referencedObjectPath=t._objectPath,t._addAction(i,o)},t.createQueryAsJsonAction=function(e,t,n,o){S.validateObjectPath(t);var r={Id:e._nextId(),ActionType:7,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,QueryInfo:n},i=new f(r,1,4);return i.referencedObjectPath=t._objectPath,t._addAction(i,o)},t.createUpdateAction=function(e,t,n){S.validateObjectPath(t);var o={Id:e._nextId(),ActionType:9,Name:"",ObjectPathId:t._objectPath.objectPathInfo.Id,ObjectState:n},r=new f(o,0,0);return r.referencedObjectPath=t._objectPath,t._addAction(r)},t}();e.CommonActionFactory=p;var d=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=!S.isSetSupported("RichApiRuntime","1.1"));var r=m._parseQueryOption(t);return o?p.createQueryAction(this._context,this,r,n):p.createQueryAsJsonAction(this._context,this,r,n)},t.prototype._recursivelyUpdate=function(t){var n=e._internalConfig.alwaysPolyfillClientObjectUpdateMethod;n||(n=!S.isSetSupported("RichApiRuntime","1.2"));try{var r=this[v.scalarPropertyNames];r||(r=[]);var s=this[v.scalarPropertyUpdateable];if(!s){s=[];for(var c=0;c=0){if(!s[g])throw new o.RuntimeError({code:i.invalidArgument,httpStatusCode:400,message:l._getResourceString(A.attemptingToSetReadOnlyProperty,m),debugInfo:{errorLocation:m}});d[m]=t[m],++h}else{if(!(u.indexOf(m)>=0))throw new o.RuntimeError({code:i.invalidArgument,httpStatusCode:400,message:l._getResourceString(A.propertyDoesNotExist,m),debugInfo:{errorLocation:m}});f[m]=t[m]}}if(h>0)if(n)for(c=0;c0)throw o.RuntimeError._createInvalidArgError({argumentName:e.combineQueryPath(r,a,".")});t.Top=s}else if("$skip"===a){if("number"!==typeof s||n.length>0)throw o.RuntimeError._createInvalidArgError({argumentName:e.combineQueryPath(r,a,".")});t.Skip=s}else if("boolean"===typeof s)s&&t.Select.push(e.combineQueryPath(n,a,"/"));else{if("object"!==typeof s)throw o.RuntimeError._createInvalidArgError({argumentName:e.combineQueryPath(r,a,".")});e.parseStrictLoadOptionHelper(t,e.combineQueryPath(n,a,"/"),e.combineQueryPath(r,a,"."),s)}}},e}();e.ClientRequestContextBase=m;var g=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 f(t,1,4);n.referencedObjectPath=e,this.addReferencedObjectPath(e),this.addAction(n);var o=new g(e);this.addActionResultHandler(n,o)}}},t.prototype.ensureInstantiateObjectPaths=function(e){if(e)for(var t=0;t0&&(l.PreviewExecutionActions=this.m_previewExecutionActions,n|=4096),{body:l,flags:n}},t.prototype.processResponse=function(e){if(e)for(var t=0;t=0;t--){var n=this.m_actions[t].actionInfo;if(n.ObjectPathId===e&&3===n.ActionType&&n.Name===v.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=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;c0?d.actionInfo.L=f:d.actionInfo.L&&delete d.actionInfo.L}},t}();e.ClientRequestBase=y;var O=function(){function e(e){this.m_type=e}return Object.defineProperty(e.prototype,"value",{get:function(){if(!this.m_isLoaded)throw new o.RuntimeError({code:i.valueNotLoaded,httpStatusCode:400,message:l._getResourceString(a.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=S.adjustToDateTime(e):this.m_value=e)},e}();e.ClientResult=O;var _=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=65&&e.charCodeAt(t)<=90;)t++;return t0?".":"")+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 o.RuntimeError({code:i.invalidRequestContext,httpStatusCode:400,message:l._getResourceString(a.invalidRequestContext)})},t.isSetSupported=function(e,t){return!("undefined"!==typeof window&&window.Office&&window.Office.context&&window.Office.context.requirements)||window.Office.context.requirements.isSetSupported(e,t)},t.throwIfApiNotSupported=function(e,n,r,s){if(t._doApiNotSupportedCheck&&!t.isSetSupported(n,r)){var c=l._getResourceString(a.apiNotFoundDetails,[e,n+" "+r,s]);throw new o.RuntimeError({code:i.apiNotFound,httpStatusCode:404,message:c,debugInfo:{errorLocation:e}})}},t.calculateApiFlags=function(e,n,o){return t.isSetSupported(n,o)||(e&=-3),e},t._parseSelectExpand=function(e){var t=[];if(!l.isNullOrEmptyString(e))for(var n=e.split(","),o=0;o0&&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=0){var a=new $(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 $(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(!Y.isNullOrEmptyString(n.ErrorCode))return new o.RuntimeError({code:n.ErrorCode,httpStatusCode:n.HttpStatusCode,message:n.ErrorMessage,traceMessages:r});if(n.Body&&n.Body.Error){var l={errorLocation:n.Body.Error.Location};return i&&(l.statement=i.statement,l.surroundingStatements=i.surroundingStatements,l.fullStatements=i.fullStatements),new o.RuntimeError({code:n.Body.Error.Code,httpStatusCode:n.Body.Error.HttpStatusCode,message:n.Body.Error.Message,traceMessages:r,debugInfo:l})}return null},r.prototype.processPendingEventHandlers=function(e){for(var t=Y._createPromiseFromResult(null),n=0;n0)if(r.isValidRequestInfo(n[0]))d=n[0],h=1;else if(Y.isPlainJsonObject(n[0])){if(null!=(d=(m=n[0]).session)&&!r.isValidRequestInfo(d))return r.createErrorPromise(t);f=m.previousObjects,h=1}if(n.length==h+1)p=n[h+0];else{if(null!=m||n.length!=h+2)return r.createErrorPromise(t);f=n[h+0],p=n[h+1]}if(null!=f)if(f instanceof j)u=function(){return f.context};else if(f instanceof r)u=function(){return f};else{if(!Array.isArray(f))return r.createErrorPromise(t);var g=f;if(0==g.length)return r.createErrorPromise(t);for(var y=0;y0&&h._onRunFinishedNotifiers.shift()();if(O)return m;throw m}))},r}(m);e.ClientRequestContext=U;var L=function(){function e(e,t){this.m_proxy=e,this.m_shouldPolyfill=t;var n=e[H.scalarPropertyNames],o=e[H.navigationPropertyNames],r=e[H.className],i=e[H.isCollection];if(n)for(var a=0;a=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;n0},e.prototype.register=function(e,t,n){if(!n)throw o.RuntimeError._createInvalidArgError({argumentName:"handler"});var r=this.getHandlers(e,t);return r.push(n),1===r.length?this.m_registerEventImpl(e,t):Y._createPromiseFromResult(null)},e.prototype.unregister=function(e,t,n){if(!n)throw o.RuntimeError._createInvalidArgError({argumentName:"handler"});for(var r=this.getHandlers(e,t),i=r.length-1;i>=0;i--)if(r[i]===n){r.splice(i,1);break}return 0===r.length?this.m_unregisterEventImpl(e,t):Y._createPromiseFromResult(null)},e}();e.EventRegistration=q;var V=function(){function e(){this.m_eventRegistration=new q(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})):r.instance?this.m_ready=Y._createPromiseFromResult(null).then((function(){t.m_isReady=!0})):this.m_ready=o.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 Y._createPromiseFromResult(null)},e.prototype._unregisterEventImpl=function(e,t){return Y._createPromiseFromResult(null)},e.prototype._handleRichApiMessage=function(e){if(e&&e.entries)for(var t=0;t=0;r--)if(o[r]===e){o.splice(r,1);break}0==o.length&&V.getGenericEventRegistration(n).unregister(t.m_genericEventInfo.eventType,t.m_genericEventInfo.getTargetIdFunc(),t._callback)}))},t.prototype.removeAll=function(){},t}(B);e.GenericEventHandlers=z;var K=function(){function e(e){this.m_clientObject=e}return e.prototype._handleResult=function(e){this.m_clientObject._handleIdResult(e)},e}(),J=function(){function e(){}return e.createGlobalObjectObjectPath=function(e){var t={Id:e._nextId(),ObjectPathType:1,Name:""};return new h(t,null,!1,!1,1,4)},e.createNewObjectObjectPath=function(e,t,n,o){var r={Id:e._nextId(),ObjectPathType:2,Name:t};return new h(r,null,n,!1,1,Y._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 h(a,t._objectPath,o,r,1,Y._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 h(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 h(o,t,!1,!1,1,4)},e.createMethodObjectPath=function(e,t,n,o,r,i,a,s,c){var l={Id:e._nextId(),ObjectPathType:3,Name:n,ParentObjectPathId:t._objectPath.objectPathInfo.Id,ArgumentInfo:{}},u=Y.setMethodArguments(e,l.ArgumentInfo,r),p=new h(l,t._objectPath,i,a,o,Y._fixupApiFlags(c));return p.argumentObjectPaths=u,p.getByIdMethodName=s,p},e.createReferenceIdObjectPath=function(e,t){var n={Id:e._nextId(),ObjectPathType:6,Name:t,ArgumentInfo:{}};return new h(n,null,!1,!1,1,4)},e.createChildItemObjectPathUsingIndexerOrGetItemAt=function(t,n,o,r,i){var a=Y.tryGetObjectIdFromLoadOrRetrieveResult(r);return t&&!Y.isNullOrUndefined(a)?e.createChildItemObjectPathUsingIndexer(n,o,r):e.createChildItemObjectPathUsingGetItemAt(n,o,r,i)},e.createChildItemObjectPathUsingIndexer=function(e,t,n){var o=Y.tryGetObjectIdFromLoadOrRetrieveResult(n),r=r={Id:e._nextId(),ObjectPathType:5,Name:"",ParentObjectPathId:t._objectPath.objectPathInfo.Id,ArgumentInfo:{}};return r.ArgumentInfo.Arguments=[o],new h(r,t._objectPath,!1,!1,1,4)},e.createChildItemObjectPathUsingGetItemAt=function(e,t,n,o){var r=n[H.index];r&&(o=r);var i={Id:e._nextId(),ObjectPathType:3,Name:H.getItemAt,ParentObjectPathId:t._objectPath.objectPathInfo.Id,ArgumentInfo:{}};return i.ArgumentInfo.Arguments=[o],new h(i,t._objectPath,!1,!1,1,4)},e}();e.ObjectPathFactory=J;var X=function(){function t(e){this.m_context=e}return t.prototype.executeAsync=function(n,o,r){var i=this,a=c.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=c.buildResponseOnSuccess(c.getResponseBody(t),c.getResponseHeaders(t)):(n=c.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[H.isTracked]&&e!==this.m_context._rootObject&&t&&!Y.isNullOrEmptyString(t[H.referenceId])&&(this._autoCleanupList[e._objectPath.objectPathInfo.Id]=e,e[H.isTracked]=!0)},e.prototype._addCommon=function(e,t){if(e[H.isTracked])t&&this.m_context._autoCleanup&&delete this._autoCleanupList[e._objectPath.objectPathInfo.Id];else{var n=e[H.referenceId];if(e._objectPath.objectPathInfo[H.objectPathInfoDoNotKeepReferenceFieldName])throw Y.createRuntimeError(i.generalException,l._getResourceString(Z.objectIsUntracked),null);Y.isNullOrEmptyString(n)&&e._KeepReference&&(e._KeepReference(),T.createInstantiateAction(this.m_context,e),t&&this.m_context._autoCleanup&&delete this._autoCleanupList[e._objectPath.objectPathInfo.Id],e[H.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[H.objectPathInfoDoNotKeepReferenceFieldName]=!0,e.context._pendingRequest._removeKeepReferenceAction(e._objectPath.objectPathInfo.Id);var t=e[H.referenceId];if(!Y.isNullOrEmptyString(t)){var n=this.m_context._rootObject;n._RemoveReference&&n._RemoveReference(t)}delete e[H.isTracked]},e.prototype._retrieveAndClearAutoCleanupList=function(){var e=this._autoCleanupList;return this._autoCleanupList={},e},e}();e.TrackedObjects=Q;var $=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&&W._calculateLastUsedObjectPathIds(this.m_actions);for(var e=0;e=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>>>>"),i.push(this.m_statements[t]),i.push("// <<<<<");for(var s=t+1;s0)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,"undefined"===typeof t.top&&"undefined"===typeof t.skip&&"undefined"===typeof t.expand?"undefined"===typeof t.select?"":JSON.stringify(t.select):JSON.stringify(t)}return""},t.prototype.buildObjectPathExpressionWithParent=function(e){return(5==e.objectPathInfo.ObjectPathType||3==e.objectPathInfo.ObjectPathType||4==e.objectPathInfo.ObjectPathType)&&e.objectPathInfo.ParentObjectPathId?this.getObjVarName(e.objectPathInfo.ParentObjectPathId)+"."+this.buildObjectPathExpression(e):this.buildObjectPathExpression(e)},t.prototype.buildObjectPathExpression=function(e){var t=this.buildObjectPathInfoExpression(e.objectPathInfo),n=e.originalObjectPathInfo;return n&&(t=t+" /* originally "+this.buildObjectPathInfoExpression(n)+" */"),t},t.prototype.buildObjectPathInfoExpression=function(e){switch(e.ObjectPathType){case 1:return"context."+this.m_globalObjName;case 5:return"getItem("+this.buildArgumentsExpression(e.ArgumentInfo)+")";case 3:return Y._toCamelLowerCase(e.Name)+"("+this.buildArgumentsExpression(e.ArgumentInfo)+")";case 2:return e.Name+".newObject()";case 7:return"null";case 4:return Y._toCamelLowerCase(e.Name);case 6:return"context."+this.m_globalObjName+"._getObjectByReferenceId("+JSON.stringify(e.Name)+")"}},t.prototype.buildArgumentsExpression=function(e){var t="";if(!e.Arguments||0===e.Arguments.length)return t;if(this.m_removePII)return"undefined"===typeof e.Arguments[0]?t:"...";for(var n=0;n0&&(t+=", "),t+=this.buildArgumentLiteral(e.Arguments[n],e.ReferencedObjectPathIds?e.ReferencedObjectPathIds[n]:null);return"undefined"===t&&(t=""),t},t.prototype.buildArgumentLiteral=function(e,t){return"number"==typeof e&&e===t?this.getObjVarName(t):JSON.stringify(e)},t.prototype.getObjVarNameBase=function(e){var t="v",n=this.m_referencedObjectPaths[e];if(n)switch(n.objectPathInfo.ObjectPathType){case 1:t=this.m_globalObjName;break;case 4:t=Y._toCamelLowerCase(n.objectPathInfo.Name);break;case 3:var o=n.objectPathInfo.Name;o.length>3&&"Get"===o.substr(0,3)&&(o=o.substr(3)),t=Y._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}(),Z=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}(A);e.ResourceStrings=Z,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 Y=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),n.fixObjectPathIfNecessary=function(e,t){e&&e._objectPath&&t&&e._objectPath.updateUsingObjectData(t,e)},n.load=function(e,t){return e.context.load(e,t),e},n.loadAndSync=function(e,t){return e.context.load(e,t),e.context.sync().then((function(){return e}))},n.retrieve=function(t,o){var r=e._internalConfig.alwaysPolyfillClientObjectRetrieveMethod;r||(r=!n.isSetSupported("RichApiRuntime","1.1"));var i=new L(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){"undefined"!==typeof(s=t[a])&&(i[a]=s)}for(var a in o){var s;"undefined"!==typeof(s=o[a])&&(s[n.fieldName_isCollection]&&"undefined"!==typeof 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 o.RuntimeError({code:e,httpStatusCode:400,message:l._getResourceString(e,t),debugInfo:n?{errorLocation:n}:void 0})},n.createRuntimeError=function(e,t,n,r,i){return new o.RuntimeError({code:e,httpStatusCode:r,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 o.RuntimeError({code:M.propertyNotLoaded,httpStatusCode:400,message:l._getResourceString(Z.propertyNotLoaded,t),debugInfo:e?{errorLocation:e+"."+t}:void 0})},n.createCannotUpdateReadOnlyPropertyException=function(e,t){return new o.RuntimeError({code:M.cannotUpdateReadOnlyProperty,httpStatusCode:400,message:l._getResourceString(Z.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;o0;)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;on)return!1;return!0},t.prototype.evaluateEventType=function(t){if(Y.isNullOrEmptyString(t))return 0;if(this.isAllDigits(t))return parseInt(t);var n=this.resolveObjectByFullName(t);if("number"!==typeof n)throw new e.Error("Invalid event type: "+t);return n},t.prototype.buildPrototype=function(e,t){this.buildScalarProperties(e,t),this.buildNavigationProperties(e,t),this.buildScalarMethods(e,t),this.buildNavigationMethods(e,t),this.buildEvents(e,t),this.buildHandleResult(e,t),this.buildHandleIdResult(e,t),this.buildHandleRetrieveResult(e,t),this.buildLoad(e,t),this.buildRetrieve(e,t),this.buildSetMockData(e,t),this.buildEnsureUnchanged(e,t),this.buildUpdate(e,t),this.buildSet(e,t),this.buildToJSON(e,t),this.buildItems(e,t),this.buildTypeMetadataInfo(e,t),this.buildTrackUntrack(e,t),this.buildMixin(e,t)},t.prototype.toSimpleCamelUpperCase=function(e){return e.substr(0,1).toUpperCase()+e.substr(1)},t.prototype.ensureOriginalName=function(e){null===e.originalName&&(e.originalName=this.toSimpleCamelUpperCase(e.name))},t.prototype.getFieldName=function(e){return"m_"+e.name},t.prototype.throwIfApiNotSupported=function(e,t){if(this.m_apiSets&&t.apiSetInfoOrdinal>0){var n=this.m_apiSets[t.apiSetInfoOrdinal-1];n&&Y.throwIfApiNotSupported(e.name+"."+t.name,n.name,n.version,this.m_hostName)}},t.prototype.buildScalarProperties=function(e,t){if(Array.isArray(t.scalarProperties))for(var n=0;n0){var n=this.m_apiSets[t-1];n&&(e=S.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 Y.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);ee.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;n0){for(var i=0;i0){for(var i=0;i0&&(Object.defineProperty(e.prototype,"_scalarPropertyNames",{get:function(){return this.m__scalarPropertyNames||(this.m__scalarPropertyNames=t.scalarProperties.map((function(e){return e.name}))),this.m__scalarPropertyNames},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_scalarPropertyOriginalNames",{get:function(){return this.m__scalarPropertyOriginalNames||(this.m__scalarPropertyOriginalNames=t.scalarProperties.map((function(e){return e.originalName}))),this.m__scalarPropertyOriginalNames},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_scalarPropertyUpdateable",{get:function(){return this.m__scalarPropertyUpdateable||(this.m__scalarPropertyUpdateable=t.scalarProperties.map((function(e){return 0===(2&e.behaviorFlags)}))),this.m__scalarPropertyUpdateable},enumerable:!0,configurable:!0})),t.navigationProperties&&t.navigationProperties.length>0&&Object.defineProperty(e.prototype,"_navigationPropertyNames",{get:function(){return this.m__navigationPropertyNames||(this.m__navigationPropertyNames=t.navigationProperties.map((function(e){return e.name}))),this.m__navigationPropertyNames},enumerable:!0,configurable:!0})},t.prototype.buildTrackUntrack=function(e,t){2&t.behaviorFlags&&(e.prototype.track=function(){return this.context.trackedObjects.add(this),this},e.prototype.untrack=function(){return this.context.trackedObjects.remove(this),this})},t.prototype.buildMixin=function(e,t){if(4&t.behaviorFlags){var n=this.getFunction(t.name+"Custom");Y.applyMixin(e,n)}},t.prototype.getOnEventName=function(e){return"_"===e[0]?"_on"+e.substr(1):"on"+e},t.prototype.buildEvents=function(e,t){if(t.events)for(var n=0;n0||this.m_url.toLowerCase().indexOf("/_layouts/15/preauth.aspx")>0)&&(n=!0);var o=document.createElement("a");if(o.href=this.m_url,this.m_options.webApplication){var r=ae.embeddingPageOrigin+"="+e+"&"+ae.embeddingPageSessionInfo+"="+this.m_options.sessionKey;0===o.search.length||"?"===o.search?o.search="?"+ae.sessionContext+"="+encodeURIComponent(r):o.search=o.search+"&"+ae.sessionContext+"="+encodeURIComponent(r)}else n?0===o.hash.length||"#"===o.hash?o.hash="#"+t:o.hash=o.hash+"&"+t:0===o.search.length||"?"===o.search?o.search="?"+t:o.search=o.search+"&"+t;return o.href},t.prototype.init=function(){var e=this;window.addEventListener("message",this.m_onMessageHandler);var t=this._getIFrameSrc();return l.createPromise((function(n,o){var r=document.createElement("iframe");if(e.m_options.id&&(r.id=e.m_options.id,r.name=e.m_options.id),r.style.height=e.m_options.height,r.style.width=e.m_options.width,e.m_options.webApplication){var s=document.createElement("form");s.setAttribute("action",t),s.setAttribute("method","post"),s.setAttribute("target",r.name),e.m_options.container.appendChild(s);var c=document.createElement("input");c.setAttribute("type","hidden"),c.setAttribute("name","access_token"),c.setAttribute("value",e.m_options.webApplication.accessToken),s.appendChild(c);var u=document.createElement("input");u.setAttribute("type","hidden"),u.setAttribute("name","access_token_ttl"),u.setAttribute("value",e.m_options.webApplication.accessTokenTtl),s.appendChild(u),e.m_options.container.appendChild(r),s.submit()}else r.src=t,e.m_options.container.appendChild(r);e.m_timeoutId=window.setTimeout((function(){e.close();var t=Y.createRuntimeError(i.timeout,l._getResourceString(a.timeout),"EmbeddedSession.init");o(t)}),e.m_options.timeoutInMilliseconds),e.m_promiseResolver=n}))},t.prototype._invoke=function(e,t,n){this.m_enabled?(re&&(n=re(n)),this._sendMessageWithCallback(this.m_id++,e,n,(function(e){ie&&(e=ie(e));var n=e.Error;delete e.Error,t(n||0,e)}))):t(5001,null)},t.prototype.close=function(){window.removeEventListener("message",this.m_onMessageHandler),window.clearTimeout(this.m_timeoutId),this.m_enabled=!1},Object.defineProperty(t.prototype,"eventRegistration",{get:function(){return this.m_sessionEventManager||(this.m_sessionEventManager=new q(this._registerEventImpl.bind(this),this._unregisterEventImpl.bind(this))),this.m_sessionEventManager},enumerable:!0,configurable:!0}),t.prototype._createRequestExecutorOrNull=function(){return new ce(this)},t.prototype._resolveRequestUrlAndHeaderInfo=function(){return l._createPromiseFromResult(null)},t.prototype._registerEventImpl=function(e,t){var n=this;return l.createPromise((function(o,r){n._sendMessageWithCallback(n.m_id++,ne.RegisterEventCommand,{EventId:e,TargetId:t},(function(){o(null)}))}))},t.prototype._unregisterEventImpl=function(e,t){var n=this;return l.createPromise((function(o,r){n._sendMessageWithCallback(n.m_id++,ne.UnregisterEventCommand,{EventId:e,TargetId:t},(function(){o()}))}))},t.prototype._onMessage=function(e){var t=this;if(this.m_enabled&&(!this.m_chosenWindow||this.m_chosenWindow===e.source&&this.m_chosenOrigin===e.origin)){var n=e.data;if(n&&n[ne.CommandKey]===ne.ApiReadyCommand)!this.m_chosenWindow&&this._isValidDescendant(e.source)&&n[ne.SessionInfoKey]===this.m_options.sessionKey&&(this.m_chosenWindow=e.source,this.m_chosenOrigin=e.origin,this._sendMessageWithCallback(this.m_id++,ne.GetAppContextCommand,null,(function(e){t._setupContext(e),window.clearTimeout(t.m_timeoutId),t.m_promiseResolver()})));else if(n&&n[ne.CommandKey]===ne.FireEventCommand){var o=n[ne.ParamsKey],r=o.EventId,i=o.TargetId,a=o.Data;if(this.m_sessionEventManager)for(var s=this.m_sessionEventManager.getHandlers(r,i),c=0;c0&&r[r.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]=2){var s=t[n].message[1];s&&(o=a(s)?JSON.parse(s):s)}"undefined"!==typeof OSF&&OSF.AppTelemetry&&OSF.AppTelemetry.CallOnAppActivatedIfPending&&OSF.AppTelemetry.CallOnAppActivatedIfPending(),i.apply(null,[o])}else OfficeExtension.Utility.log("ActionProxy._handleMessage unknown message type "+t[n].messageType)}catch(e){throw function(e){var t=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}(e);OfficeExtension.Utility.log(t)}(e),e}return OfficeExtension.Utility._createPromiseFromResult(null)}function a(e){return"string"===typeof e&&"{"===e[0]}function s(){try{Microsoft.Office.WebExtension.onReadyInternal().then((function(){return function(){if("undefined"!==typeof OSF&&OSF.DDA&&OSF.DDA.RichApi&&OSF.DDA.RichApi.richApiMessageManager)return(new OfficeExtension.ClientRequestContext).eventRegistration.register(5,"",i)}()})).then((function(){var e=OSF._OfficeAppFactory.getHostInfo();return"web"===e.hostPlatform&&"word"!==e.hostType&&"excel"!==e.hostType?void 0:function(){var e=new OfficeExtension.ClientRequestContext,t=OfficeCore.AddinInternalService.newObject(e);return e._customData="WacPartition",t.notifyActionHandlerReady(),e.sync()}()}))}catch(e){}}!function(){OfficeExtension.Utility.log("ActionProxy.initOnce"),"undefined"!=typeof e.actions&&function(e){n=e}(e.actions._association),"undefined"!==typeof document&&(document.readyState&&"loading"!==document.readyState?(OfficeExtension.Utility.log("ActionProxy.initOnce: document.readyState is not loading state"),s()):document.addEventListener&&document.addEventListener("DOMContentLoaded",(function(){OfficeExtension.Utility.log("ActionProxy.initOnce: DOMContentLoaded event triggered"),s()}))),OfficeExtension.HostBridge.onInited((function(e){!function(e){e.addHostMessageHandler((function(e){3===e.type&&i(e.message)}))}(e)}))}()}(t||(t={}))}(Office||(Office={})),function(e){!function(e){function t(){var e=new OfficeCore.RequestContext;return"web"==OSF._OfficeAppFactory.getHostInfo().hostPlatform&&(e._customData="WacPartition"),e}e.areShortcutsInUse=function(e){return __awaiter(this,void 0,void 0,(function(){var n,o,r,i,a;return __generator(this,(function(s){switch(s.label){case 0:return n=t(),o=OfficeCore.ActionService.newObject(n),r=o.areShortcutsInUse(e),[4,n.sync()];case 1:for(s.sent(),i=[],a=0;a