c1-onenote-15.cdn.office.net
Open in
urlscan Pro
2a02:26f0:6c00:294::4b36
Public Scan
URL:
https://c1-onenote-15.cdn.office.net/o/s/h19E7C1840088466A_App_Scripts/onenote-boot.min.js
Submission: On November 09 via manual from TR — Scanned from DE
Submission: On November 09 via manual from TR — Scanned from DE
Form analysis
0 forms found in the DOMText Content
var Microsoft="object"==typeof Microsoft?Microsoft:{};Microsoft.Office=Microsoft.Office||{},Microsoft.Office.OneNote=function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=24)}({24:function(t,e,n){"use strict";n.r(e);var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function o(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var r,s,a=function(){return(a=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function c(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))}function u(t,e){var n,i,o,r,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){s.label=r[1];break}if(6===r[0]&&s.label<o[1]){s.label=o[1],o=r;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(r);break}o[2]&&s.ops.pop(),s.trys.pop();continue}r=e.call(t,s)}catch(t){r=[6,t],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}!function(t){t[t.u=0]="msoulscat_ES_EWAJS",t[t.h=1]="msoulscat_ES_EWAJSGrid",t[t.v=6]="msoulscat_ES_EWAJSChart",t[t.g=202]="msoulscat_MSOSP_FileMenuCommands",t[t._=225]="msoulscat_MSOSP_OTelJS",t[t.A=227]="msoulscat_MSOSP_OTelJSInWebWoker",t[t.O=228]="msoulscat_MSOSP_OTelJSWebWorkerPrototype",t[t.U=301]="msoulscat_Wac_WordViewer",t[t.R=306]="msoulscat_Wac_BrowserGeneral",t[t.F=320]="msoulscat_Wac_TaskPane",t[t.P=339]="msoulscat_Wac_OneNoteGeneral",t[t.W=340]="msoulscat_Wac_Ribbon",t[t.N=379]="msoulscat_Wac_WopiPendingApplication",t[t.k=383]="msoulscat_Wac_Telemetry",t[t.H=391]="msoulscat_Wac_WacCatchUpActivities",t[t.J=394]="msoulscat_Wac_Dictation",t[t.B=395]="msoulscat_Wac_OneNoteSync",t[t.j=700]="msoulscat_Wac_VisioApp",t[t.q=1601]="msoulscat_OneNoteOnline_EditableCache",t[t.K=800]="msoulscat_Wac_PptAnimation",t[t.$=833]="msoulscat_Wac_PptLive",t[t.X=834]="msoulscat_Wac_PptMWeb",t[t.Z=815]="msoulscat_Wac_PptShape",t[t.Y=817]="msoulscat_Wac_PptSession",t[t.tt=830]="msoulscat_Wac_PptSlideshow",t[t.et=822]="msoulscat_Wac_PptView",t[t.nt=2300]="msoulscat_Wac_VersionHistory",t[t.it=302]="msoulscat_Wac_WordPresence",t[t.ot=3005]="msoulscat_Wac_WordVersionHistory",t[t.rt=3006]="msoulscat_Wac_LivePersonaCard",t[t.st=3012]="msoulscat_Wac_CatchUpFlyout",t[t.at=3016]="msoulscat_Wac_WordDesigner",t[t.ct=3021]="msoulscat_Wac_ModernFontPicker",t[t.ut=3027]="msoulscat_Wac_UnifiedUiHost",t[t.ft=3033]="msoulscat_Wac_EquationTools"}(r||(r={})),function(t){t[t.Error=10]="Error",t[t.Warning=15]="Warning",t[t.Info=50]="Info",t[t.Verbose=100]="Verbose",t[t.Spam=200]="Spam"}(s||(s={}));var f=["eurppc"];function l(t){return 8===t.toLowerCase().indexOf("ffc")}function d(t){return 8===t.toLowerCase().indexOf("ppc")}function h(t){var e=t.match(/^https:\/\/((?!word)\w+)(-\w+)+\..*$/i);return e&&e[1]?e[1]:"public"}function p(t){var e=t.match(/^(.*?\/\/[^\/]+)(.*)$/);if(!e)throw new Error("Invalid URL");return e[1]}function m(t,e){var n=t.match(/^(.*?\/\/)([^\/:]+)(.*)$/);if(!n)throw new Error("Invalid URL");var i=n[2];if(void 0===e)return i;if(e<0)throw new Error("subDomainParts should be at least 1");return i.split(".").slice(-(e+1)).join(".")}function v(t,e,n){n&&(t[e.toLowerCase()]=n)}function w(t,e){var n=t.toLowerCase(),i=e.toLowerCase(),o=n.indexOf("&"+i+"=");if(-1===o&&(o=n.indexOf("?"+i+"=")),-1===o)return"";var r=o+(e.length+2),s=t.indexOf("&",r);return t.substring(r,-1===s?void 0:s)}function g(t,e,n,i){if(!n)return t;var o=t,r=o.indexOf("?"),s="&";r===o.length-1||"&"===o.slice(-1)||"&>"===o.slice(-2)?s="":-1===r&&(s="?");var a=e.toLowerCase()+"=",c=o.toLowerCase().indexOf(a,r);if("?"!==s&&c>=0){if(i){var u=o.indexOf("&",c);o=o.substring(0,c)+a+n+(-1===u?"":o.substring(u))}return o}return o.concat(s,a,n)}function S(t,e,n){var i=new RegExp("[?&]"+e+"=("+(n||"1")+")\\b","i"),o=t.match(i);return!!o&&(!n||o[1]===n)}function _(t){return t?t.indexOf("://")>-1?t.split("/")[2]:t.split("/")[0]:""}var b= "16.0.14702.41023";function y(){return b}function I(t,e,n){if(""!==e){var i=window.navigator;if(i&&i.sendBeacon)i.sendBeacon(e,t);else{var o=new XMLHttpRequest;o.readyState!==XMLHttpRequest.UNSENT&&o.readyState!==XMLHttpRequest.DONE||(o.open("POST",e,n),o.send(t))}}}function T(t,e,n){!function(t,e,n,i){void 0===i&&(i=!0);var o={type:e,payloadJson:JSON.stringify(n)};I(JSON.stringify(o),t,i)}(t,"JSAPI_STATE",{application:e,build:y(),state:n})}var C,A,O=function(){try{var t=window.performance;return t&&t.now&&t.now()!==1/0}catch(t){return!1}}();function U(){return O?window.performance.now():Date.now()}function R(){if(!C){var t=window.performance;C=O&&t.timing&&t.timing.navigationStart?function(){return Math.round(t.now()+t.timing.navigationStart)}:Date.now?Date.now:function(){return(new Date).getTime()}}return C()}function E(t){return JSON.stringify(t,Object.getOwnPropertyNames(t))}function F(){var t=new Uint8Array(31),e=function(t){var e={crypto:!1,perfNow:!1,exceptions:[]},n=window.crypto||window.msCrypto;if(n){e.crypto=!0;try{return n.getRandomValues(t),e}catch(t){e.exceptions.push("crypto: "+E(t))}}e.perfNow=O;for(var i=0;i<t.length;i+=1){try{if(O){var o=Math.floor(100*window.performance.now())%10;(o<0||o>9)&&(o=0);for(var r=0;r<o;r+=1)Math.random()}}catch(t){e.exceptions.push("Math.random: "+E(t))}t[i]=Math.floor(16*Math.random())}return e}(t),n=0;return["xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var i=15&t[n];return n+=1,("x"===e?i:3&i|8).toString(16)})),e]}function P(t,e,n,i){var o=t.map((function(t){return function(t,e){var n={};n.G=t.tag,n.T=t.timestamp-e,n.M=t.message,n.C=t.category;var i=1e3*t.type+t.level;return n.D=i,n}(t,i)})),r=function(t,e,n,i){var o={};return o.T=t,o.L=e,o.S=n,o.I=i,o.V=1,o}(i,o,e,n);return JSON.stringify(r)}!function(t){t[t.Trace=0]="Trace",t[t.Assert=1]="Assert"}(A||(A={}));var W,N,M=function(){function t(t){var e=this;this.lt=3e4,this.dt=30,this.ht=0,this.pt=[],this.vt=R(),this.wt="",this.gt=0,this.flushOnClose=function(){e.St(!1,!1)},this.flush=function(){e._t()},this._t=function(){window.setTimeout((function(){return e.St(!0,!0)}),0)},this.St=function(t,n){var i=U();if(window.clearTimeout(e.bt),e.yt){if(e.pt.length>0)e.ht+=1,I(P(e.pt.splice(0,t?e.dt:e.pt.length),e.wt,e.ht,e.vt),e.yt,n),e.vt=R();t&&(e.bt=window.setTimeout(e._t,e.pt.length>e.dt?1e3:e.lt)),e.gt+=U()-i}},t&&this.configure(t)}return t.prototype.getTimeSpentLogging=function(){return this.gt},t.prototype.addLoggingTime=function(t){this.gt+=t},t.prototype.configure=function(t){var e=this,n=U();if(t.uploadCadenceInMs&&(this.lt=t.uploadCadenceInMs),t.uploadTriggerSize&&(this.dt=t.uploadTriggerSize),t.sessionId&&(this.wt=t.sessionId),t.remoteUlsEndpoint){if(!t.sessionId&&this.yt)throw new Error("Remote ULS endpoint is already set");this.yt=t.remoteUlsEndpoint+"?usid="+this.wt+"&officeserverversion="+y(),this.vt=R(),window.setTimeout((function(){return e.St(!0,!0)}),0)}this.gt+=U()-n},t.prototype.handleTrace=function(t){var e=U();t.message.length>3072&&(t.message=t.message.substring(0,3072-"... [Trimmed]".length)+"... [Trimmed]"),this.pt.push(t),(this.pt.length>this.dt||t.level===s.Error)&&this._t(),this.gt+=U()-e},t}(),x=[];!function(t){t.It="BootstrapperMaxUlsHeartbeatTime",t.Tt="BootstrapperNoCompleteWarning1Time",t.Ct="BootstrapperNoCompleteWarning2Time",t.At="RemoteUlsETag",t.Ot="RemoteUlsSuppressions",t.Ut="BootstrapperSettingsFetchPeriod",t.Rt="timestamp",t.Et="BootstrapperUlsHeartbeatIntervalMs",t.Ft="BootstrapperUlsHeartBeatIsEnabled",t.Pt="BootstrapperUlsUploadCadenceMs",t.Wt="WordConsumptionViewToEditRedirectIsEnabled",t.Nt="RequestedCallThrottlingDefaultToViewMinimumValue"}(N||(N={}));var k;function D(t){var e=new M(t);function n(t,n,i,o){var r=U();if(!function(t){return 1===x[t]}(t)){var s={timestamp:R(),category:n,tag:t,level:i,type:A.Trace,message:o};e.addLoggingTime(U()-r),e.handleTrace(s)}}return{ULS:{Mt:function(t,e,i,o){n(t,e,i,o)},shipAssertTag:function(t,e,i,o){i&&n(t,e,s.Error,o)},debugAssertTag:function(t,e,n,i){throw new Error("Debug Asserts not Implemented in the TypeScript bULS module")},flush:e.flush,flushOnClose:e.flushOnClose},configure:function(t){e.configure(t)},settingsChangeHandler:function(t){var n,i;n=t.xt.getValue(N.Ot,""),i=t.xt.getValue(N.At,""),W&&i===W||(x=[],W=i,n&&n.split(",").forEach((function(t){var e=parseInt(t,10);e&&(x[e]=1)}))),e.configure({uploadCadenceInMs:t.xt.getValue(N.Pt,6e4)})},getTimeSpentLogging:function(){return e.getTimeSpentLogging()}}}!function(t){t[t.Firefox=0]="Firefox",t[t.Opera=1]="Opera",t[t.IE=2]="IE",t[t.Edge=3]="Edge",t[t.Chrome=4]="Chrome",t[t.Safari=5]="Safari",t[t.Unknown=6]="Unknown"}(k||(k={}));var H,J,B=window.navigator,j=B?B.userAgent:void 0;function L(){if(j){if(j.indexOf("Firefox")>-1)return k.Firefox;if(j.indexOf("Opera")>-1||j.indexOf("OPR")>-1)return k.Opera;if(j.indexOf("Trident")>-1)return k.IE;if(j.indexOf("Edg")>-1)return k.Edge;if(j.indexOf("Chrome")>-1)return k.Chrome;if(j.indexOf("Safari")>-1)return k.Safari}return k.Unknown}function V(){try{return!!j&&j.indexOf("iPad")>=0||!!j&&j.indexOf("Macintosh")>=0&&$()&&!K()||!!j&&j.indexOf("Android")>=0||$()}catch(t){return!1}}function z(){try{return window.matchMedia("screen and (-ms-high-contrast: active)").matches}catch(t){return!1}}function q(){return L()===k.IE&&!function(){if(L()!==k.IE)return!1;if(null==document.documentMode||void 0===document.documentMode)return!1;return document.documentMode>=11}()}function G(){try{return window.external&&window.external.getHostEnvironmentValue&&'{"os-sku":"189"}'===window.external.getHostEnvironmentValue("os-sku")}catch(t){return!1}}function K(){return!!j&&j.indexOf("iPhone")>=0}function $(){return!!B&&(B.maxTouchPoints>0||B.msMaxTouchPoints>0)}function X(t,e){try{if(void 0===window.performance)return void e.ULS.Mt(595948609,r.N,s.Info,"Performance not supported");var n=window.performance.getEntriesByType("resource");if(void 0===n||n.length<=0)return void e.ULS.Mt(595948610,r.N,s.Info,"No resources under performance");for(var i=new RegExp(t+"(-boot.min|(.(app|preview))?.boot).js","i"),o=n.length-1;o>=0;o-=1){var a=n[o],c=a.name.match(i);if(c){var u=JSON.stringify(a);return u=u.replace(new RegExp(a.name,"g"),c[0]),void e.ULS.Mt(595948616,r.N,s.Info,u)}}e.ULS.Mt(595948484,r.N,s.Info,"Could not find JSAPI resource timing entry")}catch(t){e.ULS.Mt(595948617,r.N,s.Info,"Could not trace the resource timing: "+E(t))}}function Z(t,e){return void 0===e&&(e=100),"transferSize"in t?0===t.transferSize?1:0:void 0!==t.responseEnd&&void 0!==t.fetchStart&&t.responseEnd-t.fetchStart<e?1:0}function Y(){var t={perfNowSupported:O,browser:k[L()],touchMode:V(),highContrast:z(),windows10x:G()};try{var e=window.navigator,n=e.connection||e.mozConnection||e.webkitConnection;n&&(t.netDownlink=n.downlink,t.netDownlinkMax=n.downlinkMax,t.netEffectiveType=n.effectiveType,t.netRtt=n.rtt,t.netSaveData=n.saveData,t.netType=n.type),t.deviceMemory=e.deviceMemory,t.logicalProcessors=e.hardwareConcurrency}catch(t){}return t}!function(t){t.kt="App_AccessibilityLoopComplete",t.Dt="Wac_ActionComplete",t.Ht="WacInitialize_Ready",t.Jt="Wac_AppFailed",t.Bt="Wac_AppBootState",t.jt="Wac_AppCompleted",t.Lt="BrowserEvent",t.Vt="UI_Close",t.zt="App_CloseTab",t.qt="UI_Conversation",t.Gt="UI_CopyAndEdit",t.Kt="App_CreateNewDocument",t.$t="Wac_AppDataSavedStatus",t.Xt="UI_Download",t.Zt="UI_Edit",t.Yt="Error",t.Qt="UI_FileEmbed",t.te="UI_FileProperties",t.ee="File_Rename",t.ne="File_RenameFailed",t.ie="UI_FileVersions",t.oe="StateChanged",t.re="App_IsFrameTrusted",t.se="GetAccessToken",t.ae="App_GetAuthToken",t.ce="App_GetCustomAuthConfig",t.ue="App_GetHostKeyValue",t.fe="App_WopiInfoFromUrl",t.le="App_DavUrlFromIds",t.de="App_LoadingStatus",t.he="App_SwitchMode",t.pe="App_MoveToFolder",t.me="UI_OpenInBrowser",t.ve="UI_OpenInClient",t.we="PageChanged",t.ge="App_PushCommentContext",t.Se="App_PushState",t._e="App_DocReboot",t.be="UI_RedeemForCommenting",t.ye="App_RefreshSessionInfo",t.Ie="UI_ReplyWithChanges",t.Te="UI_ReportAbuse",t.Ce="App_FilePicker",t.Ae="UI_SaveStatus",t.Oe="WopiSession_Complete_Ack",t.Ue="SetOverlayContent",t.Re="UI_Sharing",t.Ee="UI_ShareForm",t.Fe="UI_SignIn",t.Pe="App_StoreHostKeyValue",t.We="App_Unloaded",t.Ne="Wac_UnloadingApp",t.Me="App_UpdateBootComplete",t.xe="PageCount",t.ke="UI_CheckUserAccessAndGrantPermissions",t.De="User_Activity",t.He="Edit_Notification",t.Je="UI_Workflow",t.Be="ZoomChanged",t.je="Excel_HostFrameCacheSave",t.Le="Excel_HostFrameCacheEvict",t.Ve="Excel_RegenerateFileBundle",t.ze="App_SwitchToWacFrame",t.qe="App_SaveSSRData",t.Ge="App_PurgeDataInHostCache",t.Ke="App_SaveHostRenderingV2Data",t.$e="App_SaveHostUtilsData"}(H||(H={})),function(t){t.Xe="EnterpriseTemplates",t.Ze="ExcelAdaptiveLayoutDownload",t.Ye="ExcelLandingPageOfflineTelemetry",t.Qe="ExcelLandingPageObserverRetry",t.tn="H2StaticContent",t.en="HashedUrl",t.nn="ODCShareLinkPreload",t.in="OfficeComExcelJsApiV2",t.on="OfficeComPptJsApiV2",t.rn="OfficeComUiHost",t.sn="OfficeComWordJsApiV2",t.an="OfficeHwaUiHost",t.cn="OfficeUnifiedUiHostTeams",t.un="WordViewToUnifiedRead"}(J||(J={}));var Q,tt,et;function nt(t,e){e&&e.Diagnostics&&Object.keys(e.Diagnostics).forEach((function(n){return t[n]=e.Diagnostics[n]}))}function it(t,e,n){e.ULS.Mt(596459999,r.N,n,"SessionTraces: "+JSON.stringify(t))}function ot(t,e){e.stop();var n=e.getVisibilityChangeEvents();null!=n&&n.length>0&&(t.AppInitDiagnostics.documentLoadedWithTabSwitch=!0,t.SessionTraces.tabSwitchDiagnostics=JSON.stringify(n)),e.dispose()}function rt(t,e,n){try{var i=function(t,e){var n=a({},e);delete n.UserId,delete n.OwnerId,delete n.SiteId,delete n.WebId,delete n.Upn,delete n.TenantId,delete n.UiHostTabId,delete n.WdParams;var i=n,o=e.WdParams?JSON.parse(JSON.stringify(e.WdParams).toLowerCase()):{};return i.WdParams={},["wdorigin","wdpreviouscorrelation","wdprevioussession","wdtf"].forEach((function(t){o[t]&&(i.WdParams[t]=o[t])})),i.UiEmbedMode=S(t,"uiembed"),i.UiHostName=w(t,"uih")||"N/A",i.HostDomain=location?location.hostname:"",i}(e.applicationUrl,e.sessionInformation);i.Build=y(),i.Region=h(e.applicationUrl);var o=a({},e.rebootOverrideData);delete o.ackExpected,delete o["ui-language"],delete o.wdUserSession,delete o.rebootMode,delete o.documentUrl,i.RebootOverride=o;var c=e.diagnostics.HostInitDiagnostics;c&&(t.ULS.Mt(596444238,r.N,s.Info,"HostInitDiagnostics: "+JSON.stringify(e.diagnostics.HostInitDiagnostics)),i.SessionOrigin=c.entryPoint),n&&t.ULS.Mt(595937313,r.N,s.Info,JSON.stringify(n));var u=e.wopiInfo;u&&u.AccessToken&&u.AccessTokenExpiry||t.ULS.Mt(595894553,r.N,s.Warning,"There are some missing parameters"),u&&(u.AccessToken&&(i.AccessTokenLength=u.AccessToken.length),i.AccessTokenExpiry=u.AccessTokenExpiry),i.JsApiVersion="v1",t.ULS.Mt(596444237,r.N,s.Info,JSON.stringify({session:i,client:e.diagnostics.ClientDiagnostics}))}catch(e){t.ULS.Mt(558155802,r.N,s.Error,"Failed to log initialization info: "+E(e))}}!function(t){t[t.Unknown=0]="Unknown",t[t.Normal=1]="Normal",t[t.Minor=2]="Minor",t[t.Medium=3]="Medium",t[t.Major=4]="Major",t[t.Critical=5]="Critical"}(Q||(Q={})),function(t){t.fn="Ack",t.ln="WacInitialize_Ready_Ack",t.dn="Wac_BeforeUnloadApp",t.hn="Blur_Focus",t.pn="Wac_AppFailed_Ack",t.mn="Wac_AppCompleted_Ack",t.vn="WopiStartSession_Complete",t.wn="WopiPendingSession_Complete",t.gn="Host_AccessibilityLoopComplete",t.re="Host_IsFrameTrusted",t.Sn="Grab_Focus",t._n="HostCacheDiagnostic",t.bn="Host_KeyValue",t.yn="JsApiDiagnostics",t.pe="Host_MoveToFolder",t.In="PageChanged_Ack",t.Tn="App_PopState",t.Cn="File_Rename",t.Ce="Host_FilePicker",t.An="PostAccessToken",t.On="Host_SetAuthToken",t.Un="Host_SetCustomAuthConfig",t.Rn="App_PushCommentContext",t.En="CanEmbed",t.Fn="Host_RefreshSessionInfo",t.Pn="CheckUserAccessAndGrantPermissions_Result",t.Wn="Host_WopiInfoFromUrl",t.Nn="Host_DavUrlFromIds",t.Mn="SetCurrentPage",t.xn="SetZoomLevel",t.kn="WopiPendingSession_Fail",t.Dn="SetOverlayContent",t.Hn="WopiPendingApplicationComplete_Received",t.Jn="Host_SwitchMode",t.Bn="Host_Unload",t.jn="PageCount_Ack",t.Ln="ZoomChanged_Ack",t.Vn="Host_ShareUI",t.zn="Host_Telemetry"}(tt||(tt={})),function(t){t.AppInitError="AppInitError",t.ApiDisabledError="ApiDisabledError",t.CannotLoadFirstPage="CannotLoadFirstPage",t.InvalidWopiInfo="InvalidWopiInfo",t.TimeoutWacReady="TimeoutWacReady",t.WacFailed="WacFailed"}(et||(et={}));var st=function(){function t(){this.qn=[]}return t.prototype.add=function(t){t&&this.qn.push(t)},t.prototype.remove=function(t){if(t){var e=this.qn.indexOf(t);e>-1&&this.qn.splice(e,1)}},t.prototype.removeAll=function(){this.qn=[]},t.prototype.dispatch=function(t,e){this.qn.forEach((function(n){try{n(t)}catch(t){e&&e(t)}}))},t}(),at=function(){function t(t,e){var n=this;this.Gn=0,this.Kn=function(){try{if(!window||!window.localStorage)return;var t=window.localStorage.getItem(n.$n);if(!t)return;var e=JSON.parse(t);n.Xn(e)}catch(t){n.Zn.ULS.Mt(592836768,r.N,s.Warning,"Failed to get settings from localStorage: "+E(t))}},this.Xn=function(t){return!!n.Yn(t)&&(n.Qn=t,n.ti.dispatch({xt:n},(function(t){n.Zn.ULS.Mt(592836769,r.N,s.Error,"Settings listener error: "+E(t))})),!0)},this.Yn=function(t){if(t&&"object"==typeof t){if(t.hasOwnProperty(N.Rt)&&!isNaN(t.timestamp))return!0;n.Zn.ULS.Mt(592836770,r.N,s.Error,"Received invalid settings")}return!1},this.ei=function(){if(n.ni){var t=new XMLHttpRequest;t.open("GET",n.ni),t.responseType="json",t.timeout=5e3,t.send(),t.onload=function(){if(200===t.status&&t.response?(n.ii(t.response),n.Gn=0):(n.Zn.ULS.Mt(592836771,r.N,s.Error,"Fetch settings error. Status: "+t.status+", curErrors: "+n.Gn),n.Gn+=1),!(n.Gn>7)){var e=n.getValue(N.Ut,3e5);n.Gn>3&&(e+=(n.Gn-3+1)*(e/2)),n.oi=window.setTimeout(n.ei,e)}}}},this.ii=function(t){"requestIdleCallback"in window?(n.ri&&self.cancelIdleCallback(n.ri),n.ri=window.requestIdleCallback((function(){return n.si(t)}),{timeout:1e4})):window.setTimeout((function(){return n.si(t)}),0)},this.si=function(t){if(n.Xn(t)&&window&&window.localStorage){var e=JSON.stringify(t);try{window.localStorage.setItem(n.$n,e)}catch(t){n.Zn.ULS.Mt(592836800,r.N,s.Warning,"Failed to set localStorage: "+E(t))}}},this.ai=t,this.$n="Prod"+t+"Settings",this.Zn=e,this.ti=new st,this.Kn()}return t.prototype.initializePeriodicFetch=function(t,e){this.$n=(l(t)?"FF":"Prod")+this.ai+"Settings",this.Kn(),this.ni=t+"AppSettingsHandler.ashx?app="+this.ai+"&usid="+e+"&build="+y(),this.oi||(this.oi=window.setTimeout(this.ei,3e4))},t.prototype.getValue=function(t,e){if(this.Qn||this.Kn(),!this.Qn||!this.Qn.hasOwnProperty(t))return e;var n=this.Qn[t],i=typeof e;if(typeof n===i)return n;if("string"==typeof n){if("number"===i)return parseInt(n,10);if("boolean"===i)return"true"===n}return e},t.prototype.addSettingsChangeListener=function(t){this.ti.add(t)},t.prototype.removeSettingsChangeListener=function(t){this.ti.remove(t)},t.prototype.dispose=function(){this.oi&&window.clearTimeout(this.oi),this.ri&&self.cancelIdleCallback(this.ri),this.oi=void 0,this.ri=void 0,this.Qn=void 0,this.ti.removeAll()},t}();function ct(t,e){return{isFeatureEnabled:function(n){return function(t,e,n){if(!e)return;try{return e(t)}catch(t){n&&n.ULS.Mt(594883024,r.N,s.Error,"IsFeatureEnabled callback error: "+E(t))}return}(n,t,e)}}}var ut=function(){function t(t,e){this.ci=function(){return ft(t,"OnBeforeUnload",e)},this.fi=function(){return ft(t,"OnPageHide",e)},this.li=function(){return ft(t,"VisibilityChange_"+document.visibilityState,e)},this.di=function(){return ft(t,"OnUnload",e)},window.addEventListener("beforeunload",this.ci,{capture:!0,once:!0}),window.addEventListener("pagehide",this.fi,{capture:!0}),window.addEventListener("visibilitychange",this.li,{capture:!0}),window.addEventListener("unload",this.di,{capture:!0,once:!0})}return t.prototype.dispose=function(){window.removeEventListener("beforeunload",this.ci,{capture:!0}),window.removeEventListener("pagehide",this.fi,{capture:!0}),window.removeEventListener("visibilitychange",this.li,{capture:!0}),window.removeEventListener("unload",this.di,{capture:!0})},t}();function ft(t,e,n){t.ULS.Mt(595957843,r.N,s.Info,"Page lifecycle: "+e+" fired"+(n?", flushing logger":"")),n&&t.ULS.flush()}function lt(t){return t+"RemoteTelemetry.ashx"}function dt(t){return lt(pt(t))}function ht(t,e,n,i,o,r){void 0===r&&(r=!1),t.SessionInformation.IsCore&&(t.SessionInformation.HideViewerToolbar=!0),function(t,e){var n=t.SessionInformation;n.WdParams||(n.WdParams={});if(n.WdParams.wd)return;e.substring(1).split("&").filter((function(t){if(0===t.indexOf("wd")){var e=t.split("=");e[0].length>2&&(n.WdParams[e[0]]=e[1])}}));var i=t.RebootOverrideData;i&&i.previousSessionId&&(n.WdParams.wdprevioussession=i.previousSessionId)}(t,window.location.search);var s=o||new at("OneNote",n),a=pt(t.ApplicationUrl);return{container:t.Container,sessionInformation:t.SessionInformation,applicationUrl:t.ApplicationUrl,wopiPrecheckInfo:t.WopiPrecheckInfo,applicationCustomSettings:t.ApplicationCustomSettings,diagnostics:{HostInitDiagnostics:t.Diagnostics,ClientDiagnostics:Y(),AppInitDiagnostics:{officeSessionId:e,officeBootstrapperVersion:y(),hostName:t.SessionInformation.HostName},SessionTraces:{}},fnOnInitializeSuccess:t.FnOnInitializeSuccess,fnOnInitializeFailure:t.FnOnInitializeFailure,sessionId:e,applicationBasePath:a,remoteTelemetryUrl:lt(a),wopiInfo:t.WopiInfo,forceSingleStepBoot:r,isCreateNew:t.WopiPrecheckInfo.IsNewFile||S(t.ApplicationUrl,"new"),featureManager:i||ct(t.FnIsFeatureEnabled,n),xt:s,newFileTemplateSource:t.NewFileTemplateSource,rebootOverrideData:t.RebootOverrideData,pageStateObserver:new ut(n,!0)}}function pt(t){var e=t.match(/^(.*?\/\/[^\/]+\/[^\/]+\/)(.*)$/);if(!e)throw new Error("Invalid URL");return e[1]}var mt,vt=function(){function t(t,e,n,i,o){var a=this;this.hi=0,this.pi=[];var c=e.getValue(N.Ft,!1);this.hi=U()+(o||e.getValue(N.It,3e5));var u=t?3e3:5e3;this.mi=window.setInterval((function(){c&&n.ULS.Mt(595724178,r.N,s.Info,"Boot_HeartBeat"),U()>a.hi&&(a.stop(),wt(n),i&&i())}),e.getValue(N.Et,u)),this.pi.push(window.setTimeout(wt,e.getValue(N.Tt,6e4),n,1)),this.pi.push(window.setTimeout(wt,e.getValue(N.Ct,18e4),n,2))}return t.prototype.stop=function(){this.hi=0,this.mi&&(window.clearInterval(this.mi),this.mi=void 0),this.pi.forEach((function(t){window.clearTimeout(t)})),this.pi=[]},t}();function wt(t,e){t.ULS.Mt(594901218,r.N,s.Warning,"Boot_NotComplete_"+(e||"Final")),t.ULS.flush()}!function(t){t.vi="access_token",t.wi="access_token_ttl",t.gi="bundleSrc",t.Si="bundleStaleness",t._i="DocID",t.bi="SiteID",t.yi="WebID",t.Ii="ETag",t.Ti="feature_status",t.Ci="fileExtension",t.Ai="fileGetUrl",t.Oi="customFontCatalogUrl",t.Ui="fileName",t.Ri="fileSize",t.Ei="forceSLR",t.Fi="frameHeightPx",t.Pi="frameWidthtPx",t.Wi="highContrast",t.Ni="highDpi",t.Mi="host_diagnostics",t.xi="hostName",t.ki="huictrls",t.Di="owner_id",t.Hi="sc",t.Ji="softBlockedBrowser",t.Bi="templateUrl",t.ji="touchMode",t.Li="user_id",t.Vi="hfck",t.zi="hfcv",t.qi="timeZoneId"}(mt||(mt={}));function gt(t){var e=window.navigator;if(e&&e.virtualKeyboard&&void 0!==e.virtualKeyboard.overlaysContent&&window===top)return e.virtualKeyboard.overlaysContent=t}var St;function _t(t){if(!t)return"";var e=""+document.cookie,n=new RegExp("(?:^|; )"+t+"=([^;]*)"),i=e.match(n);return!i||i.length<2?"":i[1]}function bt(t){return _t(t.hostKey)}!function(t){t[t.doNotSet=0]="doNotSet",t[t.none=1]="none",t[t.lax=2]="lax",t[t.strict=3]="strict"}(St||(St={}));function yt(t){!function t(e,n,i,o){void 0===o&&(o=St.none);var r=e+"="+n,s="",a=new Date;a.setTime(a.getTime()+31536e6);var c=new Date;c.setTime(c.getTime()+864e5*i),c>a&&(c=a),c&&(s=";expires="+c.toUTCString());var u=";SameSite="+St[o];return document.cookie=r+s+u,!(!document.cookie||-1===document.cookie.indexOf(r))||o===St.none&&t(e,n,i,St.doNotSet)}(t.hostKey,t.hostValue,365)}var It;!function(t){t.bootWithoutWopiInfo="",t.unifiedSingleFlush="Unified_SingleFlush",t.unifiedIrmEnabled="Unified_IrmEnabled",t.unifiedViewActionUrl="Unified_ViewActionUrl",t.unifiedNotEditOrViewActionUrl="Unified_NotEditOrViewActionUrl",t.forceSingleStepBoot="Force_SingleStepBoot",t.wordUiEmbedReadOnlyEarlyRedirect="WordUiEmbed_ReadOnlyEarlyRedirect",t.wordUiEmbedIrmEnabledEarlyRedirect="WordUiEmbed_IrmEnabledEarlyRedirect",t.wordViewToUnifiedReadRedirect="WordView_UnifiedReadRedirect"}(It||(It={}));var Tt="WebApplicationFrame";function Ct(t,e,n,i,o,r,s){return function(t,e,n,i){!function(t,e){v(e,mt.Fi,String(t.offsetHeight)),v(e,mt.Pi,String(t.offsetWidth)),v(e,mt.ji,String(V())),v(e,mt.Wi,String(z())),v(e,mt.Ei,String(G()))}(t,i);var o=e.ownerDocument,r=o.createElement("form");for(var s in r.id="office_form",r.name="office_form",r.action=n,r.target=t.name,r.method="POST",i){var a=o.createElement("input");a.type="hidden",a.name=s,a.value=i[s],r.appendChild(a)}return e.appendChild(r),r.submit(),t}(function(t,e,n){var i=t.ownerDocument.createElement("iframe");i.name=n||Tt,i.id=Tt,i.src="",i.title="Office Online Frame",i.width="100%",i.height="100%",i.marginWidth="0",i.marginHeight="0",i.style.left="0",i.style.top="0",i.style.right="0",i.style.bottom="0",i.style.display="block",i.style.position="absolute",i.style.backgroundColor="transparent",i.style.border="none",i.frameBorder="0",i.setAttribute("allowfullscreen","true"),i.setAttribute("allowTransparency","true");var o=p(e);return i.setAttribute("allow","microphone "+o+"; camera "+o+"; clipboard-read "+o+"; clipboard-write "+o+";"),t.appendChild(i),i}(t,e,s),t,e,n)}function At(t,e){var n={};if(t.wopiInfo&&(n[mt.vi]=t.wopiInfo.AccessToken,n[mt.wi]=Ut(t.wopiInfo)),t.wopiPrecheckInfo.BundleInfo&&t.wopiPrecheckInfo.BundleInfo.Url&&t.wopiPrecheckInfo.BundleInfo.Url.length>0)if(n[mt.gi]=t.wopiPrecheckInfo.BundleInfo.Url,null!=t.wopiPrecheckInfo.BundleInfo.BundleStaleness&&void 0!==t.wopiPrecheckInfo.BundleInfo.BundleStaleness){var i=t.wopiPrecheckInfo.BundleInfo.BundleStaleness.toString();e.ULS.Mt(593503580,r.N,s.Info,"Content bundle staleness - "+i),n[mt.Si]=i}else e.ULS.Mt(593503581,r.N,s.Info,"Content bundle staleness does not exist");if(t.wopiPrecheckInfo.FileGetUrl&&(n[mt.Ai]=t.wopiPrecheckInfo.FileGetUrl),t.wopiPrecheckInfo.CustomFontCatalogUrl&&(n[mt.Oi]=t.wopiPrecheckInfo.CustomFontCatalogUrl),t.wopiPrecheckInfo.FileName){var o=function(t){if(t){var e=t.lastIndexOf(".");if(-1!==e)return t.substring(e+1).toLowerCase()}return""}(t.wopiPrecheckInfo.FileName);o&&(n[mt.Ci]=o),n[mt.Ui]=t.wopiPrecheckInfo.FileName}t.newFileTemplateSource&&t.newFileTemplateSource.FileSize?n[mt.Ri]=t.newFileTemplateSource.FileSize.toString():t.wopiPrecheckInfo.FileSize&&(n[mt.Ri]=t.wopiPrecheckInfo.FileSize.toString()),t.sessionInformation.UserId&&(n[mt.Li]=t.sessionInformation.UserId),t.sessionInformation.OwnerId&&(n[mt.Di]=t.sessionInformation.OwnerId),t.sessionInformation.SessionContext&&(n[mt.Hi]=t.sessionInformation.SessionContext),t.diagnostics.HostInitDiagnostics&&(n[mt.Mi]=JSON.stringify({HostInitializeDiagnostics:t.diagnostics.HostInitDiagnostics,ClientDiagnostics:t.diagnostics.ClientDiagnostics})),n[mt.Ti]=function(t,e){var n={};if(Object.keys(J).forEach((function(e){var i=t.isFeatureEnabled(J[e]);void 0!==i&&(n[J[e]]=i?"1":"0")})),e&&e.wdFlights)for(var i=0,o=e.wdFlights.toLowerCase().split(",");i<o.length;i++){var r=o[i];"et-treatment"!==r&&"et-control"!==r||(n[J.Xe]="et-treatment"===r?"1":"0")}return JSON.stringify(n)}(t.featureManager,t.sessionInformation.WdParams),t.applicationCustomSettings&&t.applicationCustomSettings.HostUIControls&&(n[mt.ki]=JSON.stringify(t.applicationCustomSettings.HostUIControls)),n[mt.Ni]=String(window.devicePixelRatio>1.24),n[mt.Ji]=String(q()),n[mt.xi]=t.sessionInformation.HostName;var a=t.newFileTemplateSource;return a&&a.FileGetUrl&&(n[mt.Bi]=a.FileGetUrl),a&&a.DocUniqueId?n[mt._i]=a.DocUniqueId:t.wopiPrecheckInfo.DocUniqueId&&(n[mt._i]=t.wopiPrecheckInfo.DocUniqueId),t.sessionInformation.SiteId&&(n[mt.bi]=t.sessionInformation.SiteId),t.sessionInformation.WebId&&(n[mt.yi]=t.sessionInformation.WebId),a&&a.ETag?n[mt.Ii]=a.ETag:t.wopiPrecheckInfo.ETag&&(n[mt.Ii]=t.wopiPrecheckInfo.ETag),n}function Ot(t,e,n){var i,o;void 0===n&&(n=!1);var r=t.applicationUrl;var s={};if(S(t.applicationUrl,"uiembed")&&-1!==(null===(i=t.sessionInformation.SessionContext)||void 0===i?void 0:i.indexOf("pmshare"))&&-1===(null===(o=t.sessionInformation.SessionContext)||void 0===o?void 0:o.indexOf('"pmshare":true'))&&(s.removeshareui="1"),s.jsApi="1",s.jsapiver="v1",n&&(s.NewSession="1"),s.corrid=t.sessionId,s.usid=t.sessionId,s.sftc="1",(t.applicationCustomSettings&&t.applicationCustomSettings.IsCore||t.sessionInformation.IsCore)&&(s.core="1"),t.sessionInformation.HideViewerToolbar&&(s.hvt="1"),t.sessionInformation.DisableFocusOnBoot&&(s.disableFocusOnBoot="1"),t.sessionInformation.HighContrastMode&&(s.hcm=encodeURIComponent(t.sessionInformation.HighContrastMode)),t.sessionInformation.SupportsAtMentions&&(s.sams="1"),t.sessionInformation.SupportsAccessibilityLoop&&(s.accloop="1"),t.sessionInformation.SupportsDocReboot){var c=t.sessionInformation.SupportsDocReboot;s.sdr=!0===c?"1":c.toString()}return t.sessionInformation.SupportsCreateNewDocument&&(s.scnd="1"),t.sessionInformation.SupportsAuthToken&&(s.sat="1"),t.sessionInformation.SupportsCustomAuthConfig&&(s.cac="1"),t.sessionInformation.SupportsMoveToFolder&&(s.mtf="1"),t.sessionInformation.SupportsCommonFilePicker&&(s.sfp="1"),t.sessionInformation.OpenLinksInNewWindow&&(s.onw="1"),t.sessionInformation.HideHeader&&(s.hhdr="1"),t.sessionInformation.HideAppLauncherInHeader&&(s.halh="1"),t.sessionInformation.HideChatInHeader&&(s.hch="1"),t.sessionInformation.HideMeInHeader&&(s.hmh="1"),t.sessionInformation.HideSearchInHeader&&(s.hsh="1"),t.sessionInformation.HideWorkflowInHeader&&(s.hwfh="1"),t.sessionInformation.HideSettingsInHeader&&(s.hsth="1"),t.sessionInformation.ShowAppIconInHeader&&(s.sih="1"),t.sessionInformation.UseNeutralColorInHeader&&(s.unh="1"),t.sessionInformation.HideBreadCrumbInViewer&&(s.hbcv="1"),t.sessionInformation.HideTitleInViewer&&(s.htv="1"),t.sessionInformation.HideWACOneDriveFileLocationPicker&&(s.hodflp="1"),t.sessionInformation.NoBrowserModalDialogs&&(s.nbmd="1"),t.applicationCustomSettings&&t.applicationCustomSettings.FixDiagnosticsJson&&(s.fixdiag="1"),t.wopiPrecheckInfo.ReadOnly&&(s.readOnly="1"),t.sessionInformation.UIEmbed&&(s.uiEmbed="1"),t.sessionInformation.UiHostIntegrationType&&(s.uihit=encodeURIComponent(t.sessionInformation.UiHostIntegrationType)),t.sessionInformation.MetaUiHostVersion&&(s.muv=encodeURIComponent(t.sessionInformation.MetaUiHostVersion)),t.applicationCustomSettings&&t.applicationCustomSettings.InAppDocumentPreview&&(s.InAppDocPreview="1"),e.isSingleStepBoot?(e.bootFlowType===It.unifiedSingleFlush&&(t.isCreateNew||(s.instantedit="1",s.wopicomplete="1")),s.wdRedirectionReason=e.bootFlowType):(s.instantedit="1",s.fileSrc=encodeURIComponent(t.sessionInformation.HostName),s.pmOrigin=encodeURIComponent(p(window.location.href)),t.isCreateNew&&(s.new="1",t.wopiPrecheckInfo.IsNewFileFromHostTemplate&&(s.wdTpl="fromhost"))),t.wopiPrecheckInfo.PreseededSessionKey&&(s.preseededSessionKey=encodeURIComponent(t.wopiPrecheckInfo.PreseededSessionKey)),t.wopiPrecheckInfo.PreseededWacSessionId&&(s.preseededWacSessionId=encodeURIComponent(t.wopiPrecheckInfo.PreseededWacSessionId)),t.wopiPrecheckInfo.RequestedCallThrottling&&(s.rct=t.wopiPrecheckInfo.RequestedCallThrottling),t.wopiPrecheckInfo.ClientThrottlingProtection&&(s.ctp=t.wopiPrecheckInfo.ClientThrottlingProtection),t.applicationCustomSettings&&t.applicationCustomSettings.additionalApplicationParameters&&(s=a(a({},t.applicationCustomSettings.additionalApplicationParameters),s)),t.rebootOverrideData&&t.rebootOverrideData.queryOverrides&&(s=a(a({},s),t.rebootOverrideData.queryOverrides)),function(t,e,n,i,o){var r=function(t){var e={},n=t.indexOf("?");return-1===n||n===t.length-1||t.substring(n+1).replace(new RegExp(/<.*?>/g),"").split("&").forEach((function(t){if(t){var n=t.indexOf("=");-1!==n&&n!==t.length-1&&(e[t.substring(0,n).toLowerCase()]=t.substring(n+1))}})),e}(t);("teams"===r.uih&&"UnifiedUiHostTeams"!==e.UiHostIntegrationType||"owa"===r.uih)&&(r.hhdr="1");var s=t.indexOf("?"),c=-1===s?t.concat("?"):t.substring(0,s+1);e.UiLocale&&(r.ui=encodeURIComponent(e.UiLocale));e.DataLocale&&(r.rs=encodeURIComponent(e.DataLocale));e.HostSessionId&&(r.hid=encodeURIComponent(e.HostSessionId));e.DisableChat&&(r.dchat="1");e.SessionContext&&(r.sc=encodeURIComponent(e.SessionContext));n&&n.WopiSrc&&(r.wopisrc=encodeURIComponent(n.WopiSrc));e.CookieCompliant&&(r.mscc="1");i&&(i.entryPoint&&(r.wdorigin=encodeURI(i.entryPoint)),i.userClickTime&&(r.wdhostclicktime=i.userClickTime.toString()));r=a(a(a({},r),e.WdParams),o);var u={};for(var f in r)u[f.toLowerCase()]=r[f];var l=[];for(var f in u)u[f]&&l.push(f.concat("=",u[f]));return c.concat(l.join("&"))}(r,t.sessionInformation,t.wopiInfo,t.diagnostics.HostInitDiagnostics,s)}function Ut(t){return t.AccessTokenExpiry?t.AccessTokenExpiry.getTime().toString():"0"}var Rt=function(){function t(){}return t.logger=D(),t}(),Et=function(t){var e=this;this.Gi={},this.resetCache=function(){if(!window.localStorage)return!1;try{return localStorage.removeItem(e.dataSettingsCacheKey),!0}catch(t){return Rt.logger.ULS.Mt(557114832,r.N,s.Error,e.dataSettingsCacheKey+": Failure trying to Delete data in localStorage: "+E(t)),!1}},this.setCache=function(t){if(t&&window.localStorage)try{localStorage.setItem(e.dataSettingsCacheKey,JSON.stringify(t))}catch(t){Rt.logger.ULS.Mt(557114833,r.N,s.Error,e.dataSettingsCacheKey+": Error while saving settings in cache: "+E(t))}},this.getIntegerSetting=function(t){var n=e.Ki(t);if(null!=n&&"number"==typeof n){var i=n;if(!isNaN(i))return i}return null},this.getBooleanSetting=function(t){var n=e.Ki(t);return null!=n&&"boolean"==typeof n?n:null},this.getStringSetting=function(t){var n=e.Ki(t);return null!=n&&"string"==typeof n?n:null},this.Ki=function(t){if(!window.localStorage)return null;try{if(t in e.Gi)return e.Gi[t];var n=localStorage.getItem(e.dataSettingsCacheKey);if(null!==n){var i=JSON.parse(n)[t];return e.Gi[t]=i,i}}catch(n){Rt.logger.ULS.Mt(557114834,r.N,s.Error,e.dataSettingsCacheKey+": Failure trying to find "+t+" setting in localStorage: "+E(n))}return null},this.dataSettingsCacheKey=t},Ft=function(t){function e(){return t.call(this,e.$i)||this}return o(e,t),Object.defineProperty(e,"Instance",{get:function(){return e.Xi||(e.Xi=new e)},enumerable:!0,configurable:!0}),e.$i="OneNote_hostUtilsSettingsCache",e}(Et),Pt=function(){function t(t,e,n,i,o,a){var c=this;if(this.Zi=!1,this.Yi=function(t,e){c.Qi.officeFrameCreateTime=R(),c.to.frameCreateStartTime=c.Qi.officeFrameCreateTime;var n=c.eo.applicationCustomSettings&&c.eo.applicationCustomSettings.appFrameName;c.no=Ct(c.eo.container,t,e,c.eo.featureManager,c.Zn,c.eo.sessionId,n),c.io.activate(c.no)},this.oo=function(t){c.io.registerMessagePayloadHandler(H.jt,c.ro),c.io.registerMessagePayloadHandler(H.Jt,c.so),c.bt=window.setTimeout(c.ao,15e3),c.co=new vt(t,c.eo.xt,c.Zn,(function(){T(c.eo.remoteTelemetryUrl,"OneNote","bootTimeout")}))},this.uo=function(t){var e=t&&t.state?t.state:"unknown";c.Zn.ULS.Mt(595714271,r.N,s.Info,"WAC Boot App state:["+e+"]")},this.fo=function(t){var e=function(t){try{return window===window.top||window.parent===window.top&&window.location.origin===window.top.origin}catch(e){return t&&t.ULS.Mt(591525084,r.N,s.Info,"Trust check error: "+E(e)),!1}}(c.Zn);c.Zn.ULS.Mt(595653903,r.N,s.Info,"Top frame is trusted: "+e),c.lo(tt.re,{isTopFrameTrusted:e})},this.do=function(t){var e=gt(t&&t.overlayContent);c.Zn.ULS.Mt(587487432,r.N,s.Info,"Overlay content: "+e),c.lo(tt.Dn,void 0)},this.ro=function(t){if(c.Zn.ULS.Mt(595986314,r.N,s.Info,"Received wac complete message"),c.Zn.ULS.flush(),window.clearTimeout(c.bt),c.co&&c.co.stop(),c.Zi)c.Zn.ULS.Mt(596444234,r.N,s.Info,"Received multiple wac complete or failure messages");else{c.Zi=!0,c.lo(tt.mn,{}),nt(c.Qi,t);var e=c.ho();c.po(e),Ft.Instance.getBooleanSetting("OneNoteHostResourceDownloadHighResTimeIsEnabled")&&c.mo(),c.vo(c.eo.diagnostics)}},this.wo=function(){c.Zn.ULS.Mt(579342464,r.N,s.Info,"Received close tab message");try{window.close()}catch(t){c.Zn.ULS.Mt(579213188,r.N,s.Warning,"Failed to close the browser tab")}},this.mo=function(){var t=function(t){if(window.performance&&window.performance.getEntriesByType("resource")){var e=window.performance.getEntriesByType("resource"),n={},i={unixTimestamp:Date.now(),highResTimestamp:window.performance.now()};return e.forEach((function(t){var e=t.name.split("?")[0];if(e.indexOf(".js")>0||e.indexOf(".css")>0){var i=e.substr(e.lastIndexOf("/"));n[i]={startTime:t.startTime,fetchStart:t.fetchStart,requestStart:t.requestStart,responseStart:t.responseStart,responseEnd:t.responseEnd,cacheHit:Z(t)}}})),{coreResourceDownloadMap:n,referenceTimestampMarkers:i}}t.ULS.Mt(544494928,r.N,s.Info,"Browser does not support getEntriesByType in the Performance API.")}(c.Zn);t&&(c.eo.diagnostics.HostInitDiagnostics?c.eo.diagnostics.HostInitDiagnostics.hostResourceDownloadHighResTime=t:c.eo.diagnostics.HostInitDiagnostics={hostResourceDownloadHighResTime:t})},this.ho=function(){return{innerApplicationFrame:c.no}},this.so=function(t){if(c.Zn.ULS.Mt(595986315,r.N,s.Error,"Received wac failed message"),c.Zn.ULS.flush(),window.clearTimeout(c.bt),c.co&&c.co.stop(),c.Zi)c.Zn.ULS.Mt(596444235,r.N,s.Info,"Received multiple wac complete or failure messages");else{c.Zi=!0,c.lo(tt.pn,{});var e={errorType:et.WacFailed,errorObject:{}};t&&(e.errorObject=t.Error,c.to.error=e),c.So(e)}},this._o=function(t){var e=t.hostKey;c.Zn.ULS.Mt(574433173,r.N,s.Info,"GetHostKeyValue "+e);var n=bt(t);null!=n&&c.lo(tt.bn,{hostKey:e,hostValue:n})},this.bo=function(t){var e=t.hostKey,n=t.hostValue;c.Zn.ULS.Mt(574433174,r.N,s.Info,"storeHostKeyValue "+e+": "+n),yt(t)},this.ao=function(){c.Zi||c.Zn.ULS.Mt(596444236,r.N,s.Warning,"Timeout. SessionTraces:"+JSON.stringify(c.to))},this.vo=function(t){c.lo(tt.yn,{HostInitializeDiagnostics:t.HostInitDiagnostics,ClientDiagnostics:t.ClientDiagnostics})},this.lo=function(t,e){c.no&&c.no.contentWindow?c.io.sendPostMessage(c.no,t,e):c.Zn.ULS.Mt(595955718,r.N,s.Info,"Attempted to send postmessage: "+t)},void 0===e)throw new TypeError("bootFlowInfo");if(e.isSingleStepBoot&&void 0===t.wopiInfo)throw new TypeError("wopiInfo");this.eo=t,this.yo=e,this.Zn=n,this.io=i,this.po=o,this.So=a,this.Qi=t.diagnostics.AppInitDiagnostics,this.to=t.diagnostics.SessionTraces,this.to.wopiInitializeTime=R()}return t.prototype.Boot=function(){this.Zn.ULS.Mt(596444241,r.N,s.Info,"Initializing WAC frame");var t=Ot(this.eo,this.yo,!0),e=At(this.eo,this.Zn);if(this.io.registerMessagePayloadHandler(H.Bt,this.uo),this.io.registerMessagePayloadHandler(H.zt,this.wo),this.io.registerMessagePayloadHandler(H.re,this.fo),this.io.registerMessagePayloadHandler(H.Ue,this.do),this.io.registerMessagePayloadHandler(H.ue,this._o),this.io.registerMessagePayloadHandler(H.Pe,this.bo),this.yo.ignoreWacFramePostMessages||this.oo(l(t)),this.Yi(t,e),this.yo.ignoreWacFramePostMessages){var n=this.ho();this.po(n)}return this.Zn.ULS.Mt(595661019,r.N,s.Info,"Created Wac Frame"),this.no},t}(),Wt=!1,Nt=!1;function Mt(){Wt=!1}function xt(t,e,n,i,o,a,c){if(e.ULS.Mt(595714433,r.N,s.Info,"Starting disposing the application. unloadApp:"+t+"; disposed:"+Wt+"; unloading:"+Nt),Wt||Nt&&t)e.ULS.Mt(595714908,r.N,s.Info,"Application is already disposed or unloading");else{var u,f={logger:e,postMessenger:n,innerApplicationFrame:i,onDisposed:o,onFrameRemoved:a,unloadTimeoutInMs:c||1e3,forceAppUnload:!1,disposeStartTime:R(),appUnloadTimedOut:!1};if(t&&i)return Nt=!0,f.forceAppUnload=!0,(u=f).forceAppUnloadStartTime=R(),u.logger.ULS.Mt(595855490,r.N,s.Info,"Sending postmessage to unload app"),u.logger.ULS.flush(),u.postMessenger.registerMessagePayloadHandler(H.We,(function(t){return function(t,e){t.forceAppUnloadEndTime=R(),t.appUnloadedMessageValues=e,t.logger.ULS.Mt(595855491,r.N,s.Info,"AppUnloaded received from app"),kt(t)}(u,t)})),u.postMessenger.sendPostMessage(u.innerApplicationFrame,tt.Bn,{}),void window.setTimeout((function(){return function(t){!Nt&&Wt||(t.appUnloadTimedOut=!0,t.logger.ULS.Mt(595855492,r.N,s.Info,"ApplicationUnload timed out, forcing dispose"),kt(t))}(u)}),u.unloadTimeoutInMs);kt(f)}}function kt(t){if(!Wt)try{Wt=!0,Nt=!1,function(t){if(!t.innerApplicationFrame)return;t.innerApplicationFrame.src="about:blank",window.setTimeout((function(){t.innerApplicationFrame&&t.innerApplicationFrame.parentElement&&t.innerApplicationFrame.parentElement.removeChild(t.innerApplicationFrame),t.onFrameRemoved&&t.onFrameRemoved()}),0)}(t),function(t){var e={disposeStartTime:t.disposeStartTime,disposeEndTime:R(),forceAppUnload:t.forceAppUnload,appUnloadTimedOut:t.appUnloadTimedOut};t.forceAppUnloadStartTime&&(e.appUnloadStartTime=t.forceAppUnloadStartTime);t.forceAppUnloadEndTime&&(e.appUnloadEndTime=t.forceAppUnloadEndTime);if(t.appUnloadedMessageValues){var n=t.appUnloadedMessageValues,i=Number(n.hostMessageReceived);t.forceAppUnloadStartTime&&!isNaN(i)&&(e.hostToAppPostMessageLatency=i-t.forceAppUnloadStartTime);var o=Number(n.appMessageSent);!isNaN(o)&&t.forceAppUnloadEndTime&&(e.appToHostPostMessageLatency=t.forceAppUnloadEndTime-o);var a=Number(n.appUnloadStart),c=Number(n.appUnloadEnd);if(isNaN(a)||isNaN(c)||(e.appUnloadLatency=c-a),n.serverTimings){var u=n.serverTimings;for(var f in u)e["st-"+f.toString()]=u[f]}}t.logger.ULS.Mt(595855436,r.N,s.Info,"App disposed "+JSON.stringify(e)),t.logger.ULS.flushOnClose()}(t),t.onDisposed&&t.onDisposed()}catch(e){t.logger.ULS.Mt(595714434,r.N,s.Error,"Error disposing: "+E(e))}}var Dt,Ht,Jt=function(){function t(t,e,n,i,o,a,c){var u=this;this.Io=!1,this.To=!1,this.Co=!1,this.Ao=null,this.Oo=!0,this.Uo=!1,this.Ro=!1,this.Eo=function(){u.Zn.ULS.Mt(596444231,r.N,s.Info,"Initializing Office frame WITHOUT WOPI info - first step of two step flow."),window.setTimeout(u.Fo,5e3),u.io.registerMessagePayloadHandler(H.Ht,u.Po),u.io.registerMessagePayloadHandler(H.Oe,u.Wo);var t=new Pt(u.eo,u.yo,u.Zn,u.io,u.po,u.So);u.no=t.Boot()},this.No=function(){var t={ParallelizeStartSession:u.Oo,WacFrameIsLoaded:u.Io,WacAcceptsStartSessionComplete:u.Uo};u.Zn.ULS.Mt(596444232,r.N,s.Info,"Completing the initialized application WITH the WOPI info - second step of two step flow. Current app state - "+JSON.stringify(t)),!u.Oo||u.Io&&!u.Uo?u.Io&&u.Mo():u.xo()},this.ko=function(){u.Zn.ULS.Mt(596444233,r.N,s.Info,"Initializing Office frame WITH WOPI info - single step WOPI boot flow."),u.eo.wopiInfo=u.Do;var t=new Pt(u.eo,u.yo,u.Zn,u.io,u.po,u.So);u.no=t.Boot()},this.Ho=function(t){u.Io?(u.Zn.ULS.Mt(595968481,r.N,s.Warning,"Fail called and wacframe is able to accept postmessages"),u.Jo(t)):(u.Zn.ULS.Mt(595968482,r.N,s.Warning,"Fail was called on the session prior to WacReady."),u.Ao=t)},this.Jo=function(t){u.Zn.ULS.Mt(596444189,r.N,s.Warning,"Fail called, sending the failure postmessage to IFrame"),u.lo(tt.kn,t)},this.Bo=function(){u.Zn.ULS.Mt(596444190,r.N,s.Warning,"Fail called during single step boot, calling host failure callback..."),u.So({errorType:et.InvalidWopiInfo,errorObject:new TypeError("wopiInfo")})},this.Fo=function(){u.Io||(u.Zn.ULS.Mt(596444191,r.N,s.Warning,"Timeout Wac Ready"),u.So({errorType:et.TimeoutWacReady,errorObject:void 0}))},this.jo=function(){u.Co||(u.to.timeoutCompleteOrFail=R(),u.Zn.ULS.Mt(596444192,r.N,s.Warning,"Timeout Complete or Fail. SessionTraces:"+JSON.stringify(u.to)))},this.Lo=function(t,e,n){u.Ro||(u.Zn.ULS.Mt(596444193,r.N,s.Info,"SessionCompletion timed out with no ack."),u.Vo(t,e,n+1))},this.Po=function(t){if(u.to.readyMessageReceiveTime=R(),u.lo(tt.ln,{}),u.Io)u.Zn.ULS.Mt(596444194,r.N,s.Info,"Received multiple ready messages - frame is already loaded.");else{u.Io=!0,u.Uo=t&&t.CanAcceptStartSessionComplete;var e={AcceptStartSessionComplete:u.Uo,ParallelizeStartSession:u.Oo,StartSessionResponseAvailable:!!u.zo,WopiInfoAvailable:!!u.Do};u.Zn.ULS.Mt(596444195,r.N,s.Info,"HandleWacReadyMessage - "+JSON.stringify(e)),u.Co&&(u.Ao?u.Jo(u.Ao):u.lo(tt.Hn,{})),u.Oo&&u.Uo?u.zo&&u.qo():u.Do&&u.Mo(),nt(u.Qi,t)}},this.Wo=function(t){u.Ro=!0,u.to.sessionCompleteAckReceivedTime=R()},this.lo=function(t,e){u.io.sendPostMessage(u.no,t,e)},this.Go=function(t,e){u.Vo(t,e,1)},this.Vo=function(t,e,n){if(n>3)u.Zn.ULS.Mt(596444224,r.N,s.Error,"Attempted to call complete, but received no ack from the frame. Time: "+R());else{u.Zn.ULS.Mt(596444225,r.N,s.Info,"Sending completion message to frame. Attempt number: "+n+", Time: "+R());var i=R();1===n&&(u.zo&&u.zo.Diagnostics&&(u.zo.Diagnostics.completeMessageCreateTime=i),u.to.completeMessageCreateTime=i),e.Diagnostics.completeMessageSendTime=i,u.to.completeMessageSendTime=i,u.lo(t,e),window.setTimeout((function(){return u.Lo(t,e,n)}),1e3)}},this.xo=function(){u.Zn.ULS.Mt(596444226,r.N,s.Info,"Making parallelized startSession request.");var t=u.Ko(u.Do),e={"Content-Type":"application/x-www-form-urlencoded"},n="access_token="+encodeURIComponent(u.Do.AccessToken)+"&access_token_ttl="+encodeURIComponent(Ut(u.Do));u.to.startSessionStartTime=R(),function(t,e,n,i){var o=new XMLHttpRequest;for(var r in o.onreadystatechange=function(){if(o&&4===o.readyState){if(void 0===o.status||0===o.status)return;try{i&&i(o)}finally{null!=o&&(o.onreadystatechange=function(){})}}},o.open("POST",t),n)o.setRequestHeader(r,n[r]);o.send(e)}(t,n,e,u.$o)},this.$o=function(t){if(u.to.startSessionCompleteTime=R(),u.to.startSessionResponseStatus=t.status,u.zo={StartSessionResponse:{RequestStatus:t.status,ResponseText:t.responseText},Diagnostics:{wopiPendingInitializeTime:u.to.wopiPendingInitializeTime,wopiPendingCompleteTime:u.to.wopiPendingCompleteTime,startSessionStartTime:u.to.startSessionStartTime,startSessionCompleteTime:u.to.startSessionCompleteTime,readyMessageReceiveTime:u.to.readyMessageReceiveTime}},u.Zn.ULS.Mt(596444227,r.N,s.Info,"StartSession request completed with status code: "+u.zo.StartSessionResponse.RequestStatus+", Time: "+R()),u.Io&&u.Uo)u.qo();else{var e={WacFrameIsLoaded:u.Io,InitializeCompleted:u.To};u.Zn.ULS.Mt(596444228,r.N,s.Info,"StartSessionCompleted not called - "+JSON.stringify(e))}},this.Mo=function(){if(!u.To){u.To=!0,u.Zn.ULS.Mt(596444229,r.N,s.Info,"Sending wopi info to the frame.");var t={WopiDetails:{WopiSrc:u.Do.WopiSrc,AccessToken:u.Do.AccessToken,AccessTokenTtl:Ut(u.Do)},Diagnostics:{wopiPendingInitializeTime:u.to.wopiPendingInitializeTime,wopiPendingCompleteTime:u.to.wopiPendingCompleteTime,readyMessageReceiveTime:u.to.readyMessageReceiveTime}};u.Go(tt.wn,t)}},this.qo=function(){200===u.zo.StartSessionResponse.RequestStatus?u.To||(u.To=!0,u.Go(tt.vn,u.zo)):u.Mo()},this.Ko=function(t){var e=u.eo.applicationBasePath+"wordeditorstartsession.ashx",n=Ot(u.eo,u.yo,!1);return e=g(e+="?"+n.substring(n.indexOf("?")+1),"WOPISrc",encodeURIComponent(t.WopiSrc)),e=g(e,"build",encodeURIComponent(y())),e=g(e,"WacUserType",encodeURIComponent("WOPI")),u.eo.wopiPrecheckInfo.FileGetUrl&&(e=g(e,"fileGetUrlPresent","1")),e},this.Xo=function(t){if(u.eo.isCreateNew){if(!t||!t.NewFilePath)return void u.Zn.ULS.Mt(596444230,r.N,s.Error,"Either NewFileInfo or NewFilePath are not provided for a new file.");history.replaceState({},"",t.NewFilePath),t.UpdatedPageTitle&&(document.title=t.UpdatedPageTitle)}},this.eo=t,this.yo=e,this.Qi=t.diagnostics.AppInitDiagnostics,this.Zn=n,this.io=i,this.po=a,this.So=c,this.to=t.diagnostics.SessionTraces,this.to.wopiPendingInitializeTime=R(),this.Zo=o,Mt(),window.setTimeout(this.jo,5e3)}return t.prototype.Complete=function(t,e){if(this.Co)this.Zn.ULS.Mt(596444184,r.N,s.Warning,"Complete called after Complete/Fail already called");else{this.Zn.ULS.Mt(596444185,r.N,s.Info,"Complete called."),this.Co=!0,this.Do=t,this.to.wopiPendingCompleteTime=R();try{this.yo.isSingleStepBoot?this.ko():this.No(),this.Io&&this.lo(tt.Hn,{}),this.Xo(e)}catch(t){this.Zn.ULS.Mt(596444186,r.N,s.Error,"Unexpected script error: "+E(t)),T(this.eo.remoteTelemetryUrl,"OneNote","bootException")}finally{this.Zn.ULS.flush()}}},t.prototype.Fail=function(t){this.Co?this.Zn.ULS.Mt(596444187,r.N,s.Warning,"Fail called after Complete/Fail already called"):(this.Zn.ULS.Mt(596444188,r.N,s.Warning,"Fail called. Reason: "+(t?JSON.stringify(t):"N/A")),this.Co=!0,this.yo.isSingleStepBoot?this.Bo():this.Ho(t),this.Zn.ULS.flush())},t.prototype.Dispose=function(t,e,n){var i=this;xt(t||!1,this.Zn,this.io,this.no,(function(){delete i.no,e&&e(),i.Zo(),i.io.dispose()}),void 0,n)},t.prototype.Boot=function(){this.yo.isSingleStepBoot||this.Eo(),this.Zn.ULS.flush()},t}();!function(t){t.blurFocus="blurFocus",t.boot="boot",t.completeCreateNew="completeCreateNew",t.continueAccessibilityLoop="continueAccessibilityLoop",t.createNew="createNew",t.dispose="dispose",t.grabFocus="grabFocus",t.moveToFolder="moveToFolder",t.popState="popState",t.rename="rename",t.completeSharedFilePicker="completeSharedFilePicker",t.sendAccessToken="sendAccessToken",t.sendAuthToken="sendAuthToken",t.sendCustomAuthConfig="sendCustomAuthConfig",t.sendEmbeddedViewUrl="sendEmbeddedViewUrl",t.sendSessionInfo="sendSessionInfo",t.sendUserAccessAndPermissions="sendUserAccessAndPermissions",t.sendWopiInfo="sendWopiInfo",t.sendDavUrl="sendDavUrl",t.switchMode="switchMode",t.signalShared="signalShared"}(Dt||(Dt={}));var Bt=((Ht={})[Dt.blurFocus]=tt.hn,Ht[Dt.continueAccessibilityLoop]=tt.gn,Ht[Dt.grabFocus]=tt.Sn,Ht[Dt.moveToFolder]=tt.pe,Ht[Dt.popState]=tt.Tn,Ht[Dt.rename]=tt.Cn,Ht[Dt.sendAccessToken]=tt.An,Ht[Dt.sendAuthToken]=tt.On,Ht[Dt.sendCustomAuthConfig]=tt.Un,Ht[Dt.sendEmbeddedViewUrl]=tt.En,Ht[Dt.sendSessionInfo]=tt.Fn,Ht[Dt.sendUserAccessAndPermissions]=tt.Pn,Ht[Dt.sendWopiInfo]=tt.Wn,Ht[Dt.sendDavUrl]=tt.Nn,Ht[Dt.completeSharedFilePicker]=tt.Ce,Ht[Dt.switchMode]=tt.Jn,Ht[Dt.signalShared]=tt.Vn,Ht),jt=function(){function t(t,e){var n=this;if(this.Yo=!1,this.Qo={},this.tr="",this.er="",this.nr=!1,this.ir=!1,this.or=!1,this.rr=[],this.sr=!0,this.ar=function(t,e,i){if(t){var o={MessageId:tt.fn,CorrelationId:i,SendTime:R()};n.Zn.ULS.Mt(595732176,r.N,s.Info,"Sending Ack back"),t.postMessage(JSON.stringify(o),e)}else n.Zn.ULS.Mt(595736136,r.N,s.Info,"Missing target to send Ack back")},this.cr=function(t){var e=!1,i=!0,o="",a=!1;if(n.no&&n.no.contentWindow&&(e=!0,i=t.source===n.no.contentWindow),t.origin&&(a=(o=m(t.origin,2).toLowerCase())===n.er),!n.ir&&(!n.or||a&&i)||n.Zn.ULS.Mt(595730526,r.N,s.Info,"Window is available: "+e+", window is valid: "+i+", origin is valid: "+a+", expected origin: "+n.er+", actual origin: "+o),a&&(!n.nr||i)){var c;try{c=JSON.parse(t.data)}catch(t){return void n.Zn.ULS.Mt(596464282,r.N,s.Info,"Failed to parse event data: "+E(t)+".")}var u=c.MessageId;if(u){n.Zn.ULS.Mt(595714715,r.N,s.Info,"Received messageId: "+u+", correlation: "+c.CorrelationId),u!==H.jt&&u!==H.de||n.ur(t.origin),c.Values&&c.Values.ackExpected&&n.ar(t.source,t.origin,c.CorrelationId);var f=n.Qo[u];if(!f)return n.Zn.ULS.Mt(596464289,r.N,s.Info,"No handler found for message id: "+u),void(n.sr&&u===H.ae&&(n.rr.push(c),n.Zn.ULS.Mt(543207888,r.N,s.Info,"Kept for later process: "+u)));n.Zn.ULS.Mt(596464288,r.N,s.Info,"Processing message: "+u);try{f(c.Values||{})}catch(t){n.Zn.ULS.Mt(593773704,r.N,s.Error,"Handler error: "+E(t))}n.sr&&u===H.jt&&n.lr()}else(n.ir||n.or)&&n.Zn.ULS.Mt(595730520,r.N,s.Info,"Could not find message id")}},this.lr=function(){n.sr=!1,n.rr.forEach((function(t){var e=t.MessageId,i=n.Qo[e];if(i){n.Zn.ULS.Mt(543207890,r.N,s.Info,"Processing message after boot complete: "+e);try{i(t.Values||{})}catch(t){n.Zn.ULS.Mt(543207891,r.N,s.Error,"Handler error: "+E(t))}}else n.Zn.ULS.Mt(543207889,r.N,s.Info,"No handler found after boot complete: "+e)})),n.rr=[]},this.dr=function(t,e,n){t.postMessage(e,n)},this.ur=function(t){var e=t.toLowerCase();n.tr&&n.tr!==e&&n.Zn.ULS.Mt(596128131,r.N,s.Warning,"Updating origin: ["+_(n.tr)+"]->["+_(e)+"]"),n.tr=e,n.er=m(e,2),n.ir=l(e),n.or=d(e)},!t)throw new Error("Missing origin for PostMessageHandler");this.ir=l(t),this.or=d(t),this.Zn=e,this.ur(t)}return t.prototype.registerMessagePayloadHandler=function(t,e){if(this.Qo[t])throw new Error("Duplicate registration!");this.Qo[t]=e},t.prototype.removeMessageHandler=function(t){delete this.Qo[t]},t.prototype.sendPostMessage=function(t,e,n){if(t&&t.contentWindow){this.Zn.ULS.Mt(596464334,r.N,s.Info,"Sending message: "+e);var i={MessageId:e,SendTime:R(),Values:n};this.dr(t.contentWindow,JSON.stringify(i),this.tr)}else this.Zn.ULS.Mt(595948308,r.N,s.Info,"Missing target for SendPostMessage")},t.prototype.activate=function(t,e){this.no=t,this.nr=!!e,this.Yo||(window.addEventListener("message",this.cr,!1),this.Yo=!0)},t.prototype.postMessageForCommand=function(t,e,n){var i=Bt[e];i?(this.Zn.ULS.Mt(595702598,r.N,s.Info,"Sending message "+i+" for command "+e),this.sendPostMessage(t,i,n)):this.Zn.ULS.Mt(595702599,r.N,s.Warning,"No mapping for command "+e)},t.prototype.dispose=function(){this.Qo={},this.Yo&&(window.removeEventListener("message",this.cr,!1),this.Yo=!1)},t}(),Lt=function(){function t(){var t=this;if(this.hr=[],this.Qo=[],this.pr=function(){var e={visibility:document.visibilityState,time:R(),initialState:!1};t.hr.push(e);for(var n=0,i=t.Qo;n<i.length;n++){var o=i[n];o&&o(e)}},"hidden"===document.visibilityState){var e={visibility:document.visibilityState,time:R(),initialState:!0};this.hr.push(e)}document.addEventListener("visibilitychange",this.pr)}return t.prototype.registerEventHandler=function(t){this.Qo.push(t)},t.prototype.removeEventHandler=function(t){if(t){var e=this.Qo.indexOf(t);this.Qo.splice(e,1)}},t.prototype.stop=function(){document.removeEventListener("visibilitychange",this.pr)},t.prototype.getVisibilityChangeEvents=function(){return this.hr},t.prototype.dispose=function(){this.stop(),this.Qo=[],this.hr=[]},t}();var Vt,zt,qt=function(){function t(t,e){if(!t)throw new Error("ConstantKey must be defined");this.constantKey=t,this.maxSize=e}return t.prototype.getCacheEntry=function(t,e,n){var i=this.getCacheEntriesPrivate(t,e);if(i&&i.cachedObjects)return i.cachedObjects[n]},t.prototype.setCacheEntry=function(t,e,n,i){var o=this.getCacheEntriesPrivate(t,e);o||(o={tenantId:e,userUpn:t,cachedObjects:{}}),delete o.cachedObjects[n],o.cachedObjects[n]=i;var r=Object.keys(o.cachedObjects);this.maxSize&&r.length>this.maxSize&&delete o.cachedObjects[r[0]],this.storeCacheObject(t,e,this.mapCacheEntriesToEntryArray(o))},t.prototype.clearCacheEntry=function(t,e,n){var i=this.getCacheEntriesPrivate(t,e);i&&i.cachedObjects&&void 0!==i.cachedObjects[n]&&(delete i.cachedObjects[n],this.storeCacheObject(t,e,this.mapCacheEntriesToEntryArray(i)))},t.prototype.storeCacheObject=function(t,e,n){if(localStorage)try{var i=this.mapEntryArrayToCacheEntries(t,e,n);localStorage.setItem(this.constantKey,JSON.stringify(i))}catch(t){this.loggingForError(E(t))}else this.loggingForLocalStorageNotSupported()},t.prototype.getCacheEntries=function(t,e){var n=this.getCacheEntriesPrivate(t,e);if(n)return this.mapCacheEntriesToEntryArray(n)},t.prototype.getCacheEntriesPrivate=function(t,e){if(localStorage)if(t&&e){var n=null;try{n=localStorage.getItem(this.constantKey)}catch(t){return void this.loggingForError(E(t))}if(n)try{var i=JSON.parse(n);return i&&i.tenantId&&i.userUpn&&i.tenantId===e&&i.userUpn===t?i.cachedObjects?i:(this.clearEntireCache(),void Rt.logger.ULS.Mt(543528077,r.N,s.Error,"No cache objects present - clearing cache")):(this.clearEntireCache(),void Rt.logger.ULS.Mt(543528076,r.N,s.Error,"TenantIds or UPN do not match - clearing cache"))}catch(t){return void this.loggingForError(E(t))}}else Rt.logger.ULS.Mt(543528075,r.N,s.Error,"No tenantid provided");else this.loggingForLocalStorageNotSupported()},t.prototype.mapCacheEntriesToEntryArray=function(t){return Object.entries(t.cachedObjects).map((function(t){return{key:t[0],value:t[1]}}))},t.prototype.mapEntryArrayToCacheEntries=function(t,e,n){return{tenantId:e,userUpn:t,cachedObjects:n.reduce((function(t,e){return t[e.key]=e.value,t}),{})}},t.prototype.clearEntireCache=function(){if(localStorage)try{localStorage.removeItem(this.constantKey)}catch(t){this.loggingForError(E(t))}else this.loggingForLocalStorageNotSupported()},t.prototype.loggingForError=function(t){Rt.logger.ULS.Mt(543528078,r.N,s.Error,"Error thrown from UserSpecificCaches "+t)},t.prototype.loggingForLocalStorageNotSupported=function(){Rt.logger.ULS.Mt(543528079,r.N,s.Error,"Local storage not supported")},t}(),Gt=function(){function t(){this.getEntityId=function(){return t.entityId},this.setTabIdAsEntityId=function(e){e?t.entityId=e:Rt.logger.ULS.Mt(544277186,r.N,s.Error,"Error while setting tab-id for Resume functionality")},this.shouldUpdateWdParam=function(t){return!w(t,"wd")},this.setSourceDocIdAsEntityId=function(e){var n=e.match(/\/wopi(\.ashx)?\/folders\/(.+)$/i);n?t.entityId=n[2]:Rt.logger.ULS.Mt(554446868,r.N,s.Error,"Error while setting sourcedoc-id for Resume functionality")},this.getWdParam=function(e,n,i){if(e&&i&&n){var o=t.mr.getCacheEntry(e,n,i);if(o)return o.wdValue}},this.setWdParam=function(e,n,i,o){var a=w(e,"wd");a?t.mr.setCacheEntry(n,i,o,{datePersisted:Date.now(),wdValue:a}):Rt.logger.ULS.Mt(554796570,r.N,s.Error,"Error while getting wdparam from App_PushState URL in Resume functionality")}}return Object.defineProperty(t,"Instance",{get:function(){return t.Xi||(t.Xi=new t)},enumerable:!0,configurable:!0}),t.mr=new qt("OneNote_ResumeBootFunctionality"),t}(),Kt=function(t){function e(){return t.call(this,e.vr)||this}return o(e,t),Object.defineProperty(e,"Instance",{get:function(){return e.Xi||(e.Xi=new e)},enumerable:!0,configurable:!0}),e.vr="OneNote_fastViewDataSettingsCache",e}(Et),$t=n(5),Xt=function(){function t(){}return t.isBootContainerRemoved=!1,t.hostWindowRenderingMetrics={},t.wr="contentViewable",t.gr="bootContainerRemoved",t.Sr="ssrExtractionStart",t._r="ssrExtractionDuration",t.br="decompressedSSRSize",t.yr="compressedSSRSize",t.Ir="ssrCacheHit",t.Tr="resourceDownloadStart",t.Cr="resourceDownloadDuration",t.Ar="ssrDecompressionStart",t.Or="ssrDecompressionDuration",t.Ur="isFastViewShownInHost",t.Rr="removeBootContainerEntryPoint",t.Er="wdValueObtained",t.initialize=function(e){t.Fr=e},t.addMetric=function(e,n){t.hostWindowRenderingMetrics[e]=n},t.addDurationMetric=function(e,n,i){if(t.Pr(e)){var o=i-t.hostWindowRenderingMetrics[e];t.hostWindowRenderingMetrics[n]=o}else Rt.logger.ULS.Mt(557114831,r.N,s.Warning,"Trying to access invalid metric: "+e+" from hostWindowRenderingMetrics")},t.Pr=function(e){return void 0!==t.hostWindowRenderingMetrics[e]},t.Wr=function(){return document.getElementById(Tt)},t.sendTelemetryToWac=function(){try{var e={};if(e[t.wr]=t.hostWindowRenderingMetrics[t.wr],t.Fr)if(e[t.wr])t.Fr.sendPostMessage(t.Wr(),tt.zn,e);else{var n=t.Pr(t.Tr)&&!t.Pr(t.Cr)?"Failure trying to load CSS Resources":"Other Failure";Rt.logger.ULS.Mt(556863651,r.N,s.Info,"ContentViewable Empty: "+n)}}catch(t){Rt.logger.ULS.Mt(556865153,r.N,s.Error,"Failure trying to send Host Telemetry to WAC: "+E(t))}},t}(),Zt=function(){function t(){}return t.Nr="OneNote_PageSSR_",t.getPageHtmlData=function(e){var n=null;if(window.localStorage)try{var i=localStorage.getItem(t.Mr(e));if(i){var o=JSON.parse(i);Xt.addMetric(Xt.Ar,(new Date).getTime()),Xt.addMetric(Xt.yr,o.PageHtml.length),n=Object($t.decompressFromUTF16)(o.PageHtml),Xt.addDurationMetric(Xt.Ar,Xt.Or,(new Date).getTime())}}catch(t){Rt.logger.ULS.Mt(557114835,r.N,s.Warning,"Failure trying to get Page SRR data from localStorage: "+E(t))}return n},t.savePageHtmlData=function(e,n){if(window.localStorage){try{if(!n||n.length<=0||!e||e.length<=0)return localStorage.removeItem(t.Mr(e)),void Rt.logger.ULS.Mt(557114836,r.N,s.Error,"Save SSR Called with invalid args")}catch(t){Rt.logger.ULS.Mt(557114837,r.N,s.Error,"Failure trying to delete SSR data while saving in localStorage: "+E(t))}try{var i=t.Mr(e),o={PageHtml:Object($t.compressToUTF16)(n),LastAccessTime:R()};localStorage.setItem(i,JSON.stringify(o))}catch(t){Rt.logger.ULS.Mt(557114838,r.N,s.Error,"Failure trying to save SSR data in localStorage: "+E(t))}}},t.evictStaleCache=function(e){if(window.localStorage)try{var n=R(),i=[];Object.keys(localStorage).filter((function(e){return e.substring(0,t.Nr.length)===t.Nr})).forEach((function(t){var e=localStorage.getItem(t);if(e){var n=JSON.parse(e);if(n){var o=n.LastAccessTime,r=n.PageHtml;o&&r&&r.length>0?i.push({key:t,lastAccessTime:o,cacheItemLength:r.length}):localStorage.removeItem(t)}else localStorage.removeItem(t)}else localStorage.removeItem(t)})),i.sort((function(t,e){return e.lastAccessTime-t.lastAccessTime}));var o=0,a=0;if(i.forEach((function(t){(o+=2*t.cacheItemLength)>e&&(localStorage.removeItem(t.key),a+=1,o-=2*t.cacheItemLength)})),a>0){var c=i.length-a;Rt.logger.ULS.Mt(557114839,r.N,s.Info,"Operation=EvictStaleCache, Duration="+(R()-n)+", count="+a+", remaining="+c)}}catch(t){Rt.logger.ULS.Mt(557114840,r.N,s.Error,"Failure to Evict Stale SSR from Cache: "+E(t))}},t.deletePageHtmlData=function(e){if(window.localStorage)try{localStorage.removeItem(t.Mr(e))}catch(t){Rt.logger.ULS.Mt(557114841,r.N,s.Error,"Failure trying to Delete SSR data in localStorage: "+E(t))}},t.Mr=function(e){return t.Nr+t.xr(e)},t.xr=function(t){var e=0,n=t.length,i=0;if(n>0)for(;i<n;)e=(e<<5)-e+t.charCodeAt(i)|0,i+=1;return e},t}(),Yt=!1,Qt="",te=null,ee=function(t){t&&t.ssrKey&&t.ssrValue&&ne(t.ssrKey,t.ssrValue)},ne=function(t,e){if(Qt){var n=ie(Qt);Zt.deletePageHtmlData(n)}var i=ie(t);Zt.savePageHtmlData(i,e),Qt=t,null!==te&&setTimeout((function(){Zt.evictStaleCache(1024*te*1024)}),6e3)},ie=function(t){return(t.split(/target\(/i).length<2?"target(".concat(t).concat(")"):t).concat(zt||"",Vt||"")};function oe(t){var e=document.getElementById("BootContainer");null!==e&&null!==e.parentNode&&(e.parentNode.removeChild(e),Xt.addMetric(Xt.gr,(new Date).getTime()),Xt.addMetric(Xt.Rr,t.entryPoint),Xt.isBootContainerRemoved=!0),"SetInitialSelection"===t.entryPoint&&Xt.isBootContainerRemoved&&Xt.sendTelemetryToWac()}var re=function(){function t(t,e){var n=this;this.kr=function(t,e){return window.setInterval((function(){n.Prefetch({BootstrapperUrl:t}),e.ULS.Mt(595895774,r.N,s.Info,"Prefetching "+function(t){if(!t)return"";var e=-1===t.indexOf("#")?t.length:t.indexOf("#"),n=t.lastIndexOf("/",e);if(-1!==n&&n+1===t.indexOf("://")+"://".length)return"";n+=1;var i=t.indexOf("?");if(-1!==(i=i>=e?-1:i)&&n>i)return"";var o=-1===i?e:i;return n>=o?"":t.substring(n,o)}(t))}),36e5)},this.Dr=t,this.Hr=e}return t.prototype.GetVersion=function(){return y()},t.prototype.GetMinContentVersion=function(){throw new Error("Not implemented")},t.prototype.Prefetch=function(t){if(null!=t&&void 0!==t){var e=document.createElement("link");e.rel="prefetch";var n=t.BootstrapperUrl;".js"!==n.toString().slice(-3)&&(n+=".js"),e.href=n;var i=document.getElementsByTagName("head")[0];null!=i&&void 0!==i&&i.appendChild(e)}},t.prototype.InitializeWopiPending=function(t,e,n,i,o,a){var c,u,l,d,h,m,v,g,S=!1;try{T(dt(t.ApplicationUrl),"OneNote","init");var _=R();!function(t){if(void 0===t)throw new TypeError("initParams");var e=t.Container;if(void 0===e||void 0===e.appendChild)throw new TypeError("Container");var n=t.SessionInformation;if(void 0===n||void 0===n.HostName||void 0===n.HostSessionId||void 0===n.UserId)throw new TypeError("SessionInformation");var i=t.ApplicationUrl;if(void 0===i||"string"!=typeof i)throw new TypeError("ApplicationUrl");var o=t.WopiPrecheckInfo;if(void 0===o||void 0===o.FileName)throw new TypeError("WopiPrecheckInfo");if(void 0===t.FnOnInitializeSuccess)throw new TypeError("FnOnInitializeSuccess");if(void 0===t.FnOnInitializeFailure)throw new TypeError("FnOnInitializeFailure")}(t),t.ApplicationUrl=function(t,e){if(!e||-1===f.indexOf(e.toLowerCase()))return t;var n=t.match(/(^http[s]:\/\/)((?!word)\w*[-])?(.*)/i);return n?""+n[1]+e+"-"+n[3]:t}(t.ApplicationUrl,w(t.ApplicationUrl,"region")),t.ApplicationUrl=function(t,e){if(!t)return t;var n=t,i=n.indexOf("?"),o=e.toLowerCase()+"=",r=n.toLowerCase().indexOf(o,i);if(r>=0){var s=n.indexOf("&",r);return"&"===(n=n.substring(0,r)+(-1===s?"":n.substring(s+1))).slice(-1)&&(n=n.slice(0,-1)),n}return t}(t.ApplicationUrl,"region"),function(t){if(t.RebootOverrideData);}(t),n?d=n:(d=(c=F())[0],h=c[1]),l=e||D({remoteUlsEndpoint:pt(t.ApplicationUrl)+"RemoteUls.ashx",sessionId:d}),m=ht(t,d,l,o,a,this.Hr.forceSingleStepBoot),a||(m.xt.addSettingsChangeListener(l.settingsChangeHandler),m.xt.initializePeriodicFetch(m.applicationBasePath,d)),m.diagnostics.HostInitDiagnostics&&(m.diagnostics.HostInitDiagnostics.hostInitializeCallTime=_);var b,y=m.diagnostics.HostInitDiagnostics;if(y&&window.performance&&window.performance.timing){var I=window.performance.timing.navigationStart;y.hostPageNavigationStartTime=I,y.userClickTime||(y.userClickTime=I,y.clickTimeIsNavStartTime=!0)}rt(l,m,h),S=!0;var C=t.BootstrapperUrl;C&&(b=this.kr(C,l));var A=function(){m.xt.dispose(),m.pageStateObserver.dispose(),window.clearInterval(b)},O=p(t.ApplicationUrl),U=i||new jt(O,l),P=new Lt,W=function(t,e){var n={isSingleStepBoot:t.forceSingleStepBoot,bootFlowType:t.forceSingleStepBoot?It.forceSingleStepBoot:It.bootWithoutWopiInfo,ignoreWacFramePostMessages:!1};if(t.forceSingleStepBoot,n.isSingleStepBoot){var i={singleStepBootIsRequired:!0,singleStepBootReason:n.bootFlowType,irmEnabled:t.wopiPrecheckInfo.IrmEnabled,readOnly:t.wopiPrecheckInfo.ReadOnly,ignoreWacFramePostMessages:n.ignoreWacFramePostMessages};e.ULS.Mt(596444182,r.N,i.irmEnabled?s.Warning:s.Info,JSON.stringify(i))}else e.ULS.Mt(596444183,r.N,s.Info,"Received input valid for two step flow");return n}(m,l),N=function(t,e,n,i,o,a,c){return function(u){var f=t.diagnostics;ot(f,i),it(f.SessionTraces,n,s.Info);var l=ae(f);n.ULS.Mt(596448985,r.N,s.Info,JSON.stringify(l)),T(t.remoteTelemetryUrl,"OneNote","bootSuccess");var d=c(t.sessionId,n,e,o,u);try{a(d,l)}catch(t){n.ULS.Mt(595719171,r.N,s.Error,"Exception thrown from host's success callback: "+E(t))}X("onenote",n),se(n)}}(m,U,l,P,A,t.FnOnInitializeSuccess,this.Dr),M=function(t,e,n,i){return function(o){var a=t.diagnostics;ot(a,n),it(a.SessionTraces,e,s.Warning);var c=ae(a);e.ULS.Mt(596448986,r.N,s.Error,JSON.stringify({error:o,appInitDiagnostics:c})),T(t.remoteTelemetryUrl,"OneNote","bootFailure");try{i(o,c)}catch(t){e.ULS.Mt(595719172,r.N,s.Error,"Exception thrown from host's failure callback: "+E(t))}X("onenote",e),se(e)}}(m,l,P,t.FnOnInitializeFailure);"undefined"!=typeof PerformanceResourceTiming&&void 0===PerformanceResourceTiming.prototype.toJSON&&(PerformanceResourceTiming.prototype.toJSON=function(){return{name:this.name,connectStart:this.connectStart,connectEnd:this.connectEnd}}),t.FnOnAppModeSwitched&&U.registerMessagePayloadHandler(H.he,t.FnOnAppModeSwitched);!function(t){Yt&&(Xt.initialize(t),t.registerMessagePayloadHandler(H.ze,(function(t){oe(t)}))),function(t){t.registerMessagePayloadHandler(H.qe,(function(t){ee(t)})),t.registerMessagePayloadHandler(H.Ge,(function(t){Zt.evictStaleCache(0)})),t.registerMessagePayloadHandler(H.Ke,(function(t){Kt.Instance.setCache(t)}))}(t)}(U),v=t.SessionInformation.Upn,g=t.SessionInformation.TenantId,v&&g&&(Vt=v,zt=g),U.registerMessagePayloadHandler(H.$e,(function(t){Ft.Instance.setCache(t)}));var x=t.SessionInformation.HostName.toLowerCase(),k=null===(u=t.SessionInformation.UiHostIntegrationType)||void 0===u?void 0:u.toLowerCase();if(Ft.Instance.getBooleanSetting("OneNoteResumeWhereYouLeftIsEnabled")){U.registerMessagePayloadHandler(H.Se,(function(e){Gt.Instance.setWdParam(e.Url,t.SessionInformation.Upn,t.SessionInformation.TenantId,Gt.Instance.getEntityId())})),-1===x.indexOf("teams")||"tab"!==k&&"edutab"!==k?Gt.Instance.setSourceDocIdAsEntityId(t.WopiInfo.WopiSrc):Gt.Instance.setTabIdAsEntityId(t.SessionInformation.UiHostTabId);var B=Gt.Instance.getWdParam(t.SessionInformation.Upn,t.SessionInformation.TenantId,Gt.Instance.getEntityId()),j=Gt.Instance.shouldUpdateWdParam(t.ApplicationUrl);if(B&&j){var L=t.SessionInformation;L.WdParams||(L.WdParams={}),L.WdParams.wd=B,l.ULS.Mt(543528080,r.N,s.Info,"OneNote Resume: Overriding WdParam")}}if(t.WopiPrecheckInfo.ReadOnly&&t.FnOnAppModeSwitched&&t.FnOnAppModeSwitched({NewMode:"view"}),C&&this.Hr.preloader&&this.Hr.preloader.shouldPreload(m.applicationUrl))try{var V=C;0,m.featureManager.isFeatureEnabled(J.tn)&&(l.ULS.Mt(595645891,r.N,s.Info,"HTTP2 preload enabled"),V=function(t){var e=new RegExp("(c[1-5])h?(-)");return t.replace(e,"$1h$2")}(C));var z=m.sessionInformation.UiLocale;z||(z=decodeURIComponent(w(m.applicationUrl,"ui"))),this.Hr.preloader.preload(V,z,l,m.featureManager)}catch(t){l.ULS.Mt(595943884,r.N,s.Error,E(t))}var q=new Jt(m,W,l,U,A,N,M);return q.Boot(),q}catch(e){return l&&(l.ULS.Mt(596459925,r.N,s.Error,et.AppInitError+": "+E(e)),S||rt(l,m||ht(t,d,l,o,a,this.Hr.forceSingleStepBoot),h),l.ULS.flushOnClose()),void(t&&(t.ApplicationUrl&&T(dt(t.ApplicationUrl),"OneNote","bootException"),t.FnOnInitializeFailure&&t.FnOnInitializeFailure({errorType:et.AppInitError,errorObject:e})))}},t}();function se(t){t.ULS.Mt(590914655,r.N,s.Info,"Time spent logging: "+t.getTimeSpentLogging())}function ae(t){return a(a(a({},t.AppInitDiagnostics),t.HostInitDiagnostics),{SessionTraces:t.SessionTraces})}var ce,ue=["https://augloop.office.com/v2","api://visio.officeapps.live.com/va/00695ed2-3202-4156-8da1-69f60065e255","394866fc-eedb-4f01-8536-3ff84b16be2a","https://officescripting.microsoft.com","https://nleditor.osi.office.net/nleditor","e03a13ee-9730-4cae-8525-47559c8cf18a"],fe=function(){function t(t){var e=this;this.Jr={},this.Br=[],this.jr=function(t){if(t&&t.origin)try{var n=t.data;if("string"==typeof n&&n.includes("AddinTrustedOrigin")){var i=JSON.parse(n),o=i.AddinTrustId;o&&"AddinTrustedOrigin"===i.MessageId&&(e.Zn.ULS.Mt(560754784,r.N,s.Info,"didReceiveMessage addinTrustId "+o),e.Jr[o]=t.origin,e.Br.forEach((function(e){e(o,t.origin)})))}}catch(t){e.Zn.ULS.Mt(560754785,r.N,s.Error,"AuthTokenTrustValidator didReceiveMessage failed")}},this.Zn=t,window.addEventListener("message",this.jr)}return t.prototype.isResourceTrustedForMessage=function(t){return c(this,void 0,void 0,(function(){var e,n,i,o,a,c,f,l,d=this;return u(this,(function(u){switch(u.label){case 0:return t&&t.Resource?(e=t.Resource,n=t.AddinTrustId,(i=function(t){if(!t)return!1;for(var e=t.toLowerCase(),n=0,i=ue;n<i.length;n++){var o=i[n];if(o===e||o+"/"===e)return!0}return!1}(e))||!n?[2,i]:this.Jr[n]?[2,le(e,this.Jr[n])]:(a=new Promise((function(t){o=function(i,o){n===i&&t(le(e,o))},d.Br.push(o)})),c=-1,2e3,f=new Promise((function(t){c=window.setTimeout((function(){d.Zn.ULS.Mt(560754786,r.N,s.Warning,"isResourceTrustedForMessage - timeout waiting for addinTrustId: "+n),t(!1)}),2e3)})),[4,Promise.race([a,f])])):[2,!1];case 1:return l=u.sent(),this.Br=this.Br.filter((function(t){return t!==o})),window.clearTimeout(c),[2,l]}}))}))},t.prototype.dispose=function(){this.Jr={},this.Br=[],window.removeEventListener("message",this.jr)},t}();function le(t,e){try{if(!t||!e)return!1;for(var n=/[?&#%\\]/,i=0;i<t.length;i+=1){var o=t.charCodeAt(i);if(o<33||o>126)return!1;var r=t.charAt(i);if(n.test(r))return!1}var s=t;"api:"===s.substring(0,"api:".length).toLowerCase()&&(s="https:"+s.substring("api:".length));var a=new URL(s);return"https:"===a.protocol&&e.toLowerCase()===a.origin.toLowerCase()}catch(t){return!1}}!function(t){t.BrowserEvent="BrowserEvent",t.PageChanged="PageChanged",t.ZoomChanged="ZoomChanged",t.ContentRefreshBegin="ContentRefreshBegin",t.ContentRefreshEnd="ContentRefreshEnd",t.AppClosed="UI_Close",t.UserEdit="Edit_Notification",t.FileRename="File_Rename",t.FileShare="UI_Sharing",t.ShowFileVersions="UI_FileVersions",t.UIWorkflow="UI_Workflow",t.IsDisabled="IsDisabled",t.AccessibilityLoopComplete="App_AccessibilityLoopComplete",t.Unloaded="Unloaded",t.Disposed="Disposed",t.SwitchMode="App_SwitchMode",t.DocumentReboot="DocReboot",t.WopiInfoFromUrl="WopiInfoFromUrl",t.DavUrlFromIds="DavUrlFromIds",t.ModeSwitched="ModeSwitched",t.CreateNewDocument="App_CreateNewDocument",t.GetAuthToken="GetAuthToken",t.GetCustomAuthConfig="GetCustomAuthConfig",t.SetOverlayContent="SetOverlayContent",t.MoveToFolder="MoveToFolder",t.SharedFilePicker="SharedFilePicker"}(ce||(ce={}));var de=function(){function t(t,e,n,i,o){var a=this;this.Qo={},this.Lr=function(){a.io.registerMessagePayloadHandler(H._e,a.Vr),a.io.registerMessagePayloadHandler(H.fe,a.zr),a.io.registerMessagePayloadHandler(H.le,a.qr),a.io.registerMessagePayloadHandler(H.ae,a.Gr),a.io.registerMessagePayloadHandler(H.Re,a.Kr),a.io.registerMessagePayloadHandler(H.ce,a.$r),a.io.registerMessagePayloadHandler(H.pe,a.Xr),a.io.registerMessagePayloadHandler(H.Ce,a.Zr)},this.Yr=function(t,e){var n=a.Qo[t];if(n)try{n(e||{})}catch(t){a.Zn.ULS.Mt(593773706,r.N,s.Error,"Handler error: "+E(t))}},this.Vr=function(t){t.previousSessionId=a.Qr,a.Yr(ce.DocumentReboot,t)},this.zr=function(t){a.Yr(ce.WopiInfoFromUrl,t)},this.qr=function(t){a.Yr(ce.DavUrlFromIds,t)},this.Gr=function(t){Promise?a.ts.isResourceTrustedForMessage(t).then((function(e){e?a.Yr(ce.GetAuthToken,t):a.io.sendPostMessage(a.no,tt.On,{AuthToken:"",Error:"accessDenied",RequestId:t.RequestId,IdentityType:t.IdentityType})}),(function(){a.io.sendPostMessage(a.no,tt.On,{AuthToken:"",Error:"Exception encountered in AuthTokenTrustValidator.isResourceTrustedForMessage",RequestId:t.RequestId,IdentityType:t.IdentityType})})):a.io.sendPostMessage(a.no,tt.On,{AuthToken:"",Error:'"Promise" does not exist natively in browser',RequestId:t.RequestId,IdentityType:t.IdentityType})},this.Kr=function(t){a.Yr(ce.FileShare,t)},this.$r=function(t){a.Yr(ce.GetCustomAuthConfig,t)},this.Xr=function(t){a.Yr(ce.MoveToFolder,t)},this.Zr=function(t){a.Yr(ce.SharedFilePicker,t)},this.Qr=t,this.Zn=e,this.no=o.innerApplicationFrame,this.io=n,this.es=i,this.ts=new fe(e),this.Lr(),Mt()}return t.prototype.GetApplicationType=function(){return"OneNote"},t.prototype.GetVersion=function(){return y()},t.prototype.GetSessionId=function(){return this.Qr},t.prototype.RegisterEventHandler=function(t,e){switch(t){case ce.Unloaded:case ce.Disposed:case ce.DocumentReboot:case ce.WopiInfoFromUrl:case ce.DavUrlFromIds:case ce.GetAuthToken:case ce.GetCustomAuthConfig:case ce.MoveToFolder:case ce.SharedFilePicker:case ce.SetOverlayContent:case ce.FileShare:if(this.Qo[t])throw new Error("Duplicate registration");this.Qo[t]=e;break;default:this.io.registerMessagePayloadHandler(t,e)}},t.prototype.RemoveEventHandler=function(t,e){switch(t){case ce.Unloaded:case ce.Disposed:case ce.DocumentReboot:case ce.FileShare:case ce.WopiInfoFromUrl:case ce.DavUrlFromIds:case ce.GetAuthToken:case ce.GetCustomAuthConfig:case ce.MoveToFolder:case ce.SharedFilePicker:case ce.SetOverlayContent:if(this.Qo[t]!==e)throw new Error("The handler requested to be removed does not exist for the eventType");delete this.Qo[t];break;default:this.io.removeMessageHandler(t)}},t.prototype.RegisterErrorHandler=function(t){},t.prototype.RemoveErrorHandler=function(t){},t.prototype.PostCommand=function(t,e){this.io.postMessageForCommand(this.no,t,e)},t.prototype.Dispose=function(t,e){var n=this;xt(t||!1,this.Zn,this.io,this.no,(function(){delete n.no,n.es(),n.io.dispose(),n.Yr(ce.Unloaded,{})}),(function(){try{n.Yr(ce.Disposed,{}),n.Qo={}}catch(t){n.Zn.ULS.Mt(589108815,r.N,s.Error,"onFrameRemoved error: "+E(t))}}),e)},t}();function he(t,e,n,i,o){return new de(t,e,n,i,o)}function pe(t){var e={entryPoint:t.diagnostics.entryPoint,userClickTime:t.diagnostics.userClickTime,hostPageNavigationStartTime:t.diagnostics.hostPageNavigationStartTime,hostPageFetchStartTime:t.diagnostics.hostPageFetchStartTime,hostPageRequestStartTime:t.diagnostics.hostPageRequestStartTime,hostPageResponseStartTime:t.diagnostics.hostPageResponseStartTime,hostPageFirstFlushTime:t.diagnostics.hostPageFirstFlushTime,getAccessTokenStartTime:t.diagnostics.getAccessTokenStartTime,getAccessTokenEndTime:t.diagnostics.getAccessTokenEndTime,getAccessTokenCacheHit:t.diagnostics.getAccessTokenCacheHit,getWopiPropertiesStartTime:t.diagnostics.getWopiPropertiesStartTime,getWopiPropertiesEndTime:t.diagnostics.getWopiPropertiesEndTime,getWopiPropertiesCacheHit:t.diagnostics.getWopiPropertiesCacheHit,hostInitializeCallTime:t.diagnostics.hostInitializeCallTime,hostCompleteCallTime:t.diagnostics.hostCompleteCallTime,officeBootstrapperStartTime:t.diagnostics.officeBootstrapperStartTime,officeBootstrapperEndTime:t.diagnostics.officeBootstrapperEndTime,officeInitializationTime:t.diagnostics.officeInitializationTime,hostWindowRenderingTelemetry:Xt.hostWindowRenderingMetrics};return function(t){var e=window.performance.timing;e&&(t.hostPageNavigationStartTime||(t.hostPageNavigationStartTime=e.navigationStart),t.hostPageFetchStartTime||(t.hostPageFetchStartTime=e.fetchStart),t.hostPageRequestStartTime||(t.hostPageRequestStartTime=e.requestStart),t.hostPageResponseStartTime||(t.hostPageResponseStartTime=e.responseStart),t.hostPageResponseEndTime||(t.hostPageResponseEndTime=e.responseEnd),t.hostPageDomCompleteTime||(t.hostPageDomCompleteTime=e.domComplete));var n=window.performance.navigation;n&&void 0===t.hostPageRedirectCount&&(t.hostPageRedirectCount=n.redirectCount)}(e),e}var me=function(){function t(t,e,n){this.ns=t,this.Fr=e,this.Zn=n,this.applicationName="Word",this.sessionId=t.GetSessionId(),this.version=t.GetVersion(),this.no=document.getElementById(Tt)}return t.prototype.focus=function(){this.Fr.sendPostMessage(this.no,tt.Sn,{})},t.prototype.blur=function(){this.Fr.sendPostMessage(this.no,tt.hn,{})},t.prototype.renameFile=function(t){this.Fr.sendPostMessage(this.no,tt.Cn,{NewName:t})},t.prototype.registerEventHandler=function(t,e){this.Fr.registerMessagePayloadHandler(t,e)},t.prototype.removeEventHandler=function(t,e){this.Fr.removeMessageHandler(t)},t.prototype.registerErrorHandler=function(t){this.os=t},t.prototype.removeErrorHandler=function(t){if(this.os!==t)throw new Error("The handler requested to be removed does not exist");delete this.os},t.prototype.dispose=function(){this.Fr.dispose(),this.Zn&&this.Zn.ULS.flushOnClose(),this.no&&this.no.parentElement&&this.no.parentElement.removeChild(this.no),delete this.no,this.ns&&this.ns.Dispose()},t.prototype.closeOneNoteAfterSync=function(t){var e=this;this.Fr.registerMessagePayloadHandler(H.Ne,(function(n){t&&t.onUnloadingApp&&t.onUnloadingApp(n),n.HasUnsavedData||(e.dispose(),t.onClose())})),this.Fr.registerMessagePayloadHandler(H.$t,(function(n){t&&t.onAppDataSavedStatus&&t.onAppDataSavedStatus(n),e.dispose(),t.onClose()})),this.Fr.sendPostMessage(this.no,tt.dn,{})},t}();var ve,we=function(){function t(t){var e=this;this.version=y(),this.ss=function(t,n){return function(i,o){e.as&&e.as(new me(i,t,n),o)}},this.cs=function(t,n){e.us&&e.us(t,n)},this.Hr=t,this.fs=new re(he,t)}return t.prototype.prefetch=function(){},t.prototype.initialize=function(t){var e=this;this.as=t.onInitializeSuccess,this.us=t.onInitializeFailure;var n=F(),i=n[0],o=n[1],a=function(t,e,n,i){var o=p(t);o=o.replace("onenote",e);var r=[];if(i)for(var s in i)i[s]&&r.push(s.concat("=",i[s]));return o.concat(n,"?",r.join("&"),r.length>0?"&":"","<ui=UI_LLCC&><rs=DC_LLCC&><dchat=DISABLE_CHAT&><hid=HOST_SESSION_ID&><showpagestats=PERFSTATS&><IsLicensedUser=BUSINESS_USER&><actnavid=ACTIVITY_NAVIGATION_ID&>")}(t.discoveryUrl,this.Hr.applicationUrlSubdomain||"onenote",this.Hr.applicationUrlPath||"/o/onenoteframe.aspx"),c=Rt.logger;c?c.configure({remoteUlsEndpoint:pt(a)+"RemoteUls.ashx",sessionId:i,uploadCadenceInMs:6e4}):c=D({remoteUlsEndpoint:pt(a)+"RemoteUls.ashx",sessionId:i,uploadCadenceInMs:6e4}),c.ULS.Mt(595937311,r.N,s.Info,JSON.stringify(o));var u=new jt(p(a),c);if(this.Hr.additionalApplicationParameters)for(var f in t.customSettings.additionalApplicationParameters=t.customSettings.additionalApplicationParameters||{},this.Hr.additionalApplicationParameters)t.customSettings.additionalApplicationParameters[f]||(t.customSettings.additionalApplicationParameters[f]=this.Hr.additionalApplicationParameters[f]);var l=function(t,e,n,i){return{Container:t.container,BootstrapperUrl:t.discoveryUrl,SessionInformation:{HostName:t.sessionInfo.hostName,HostSessionId:t.sessionInfo.hostSessionId,UserId:t.sessionInfo.userId,OwnerId:t.sessionInfo.ownerId,UiLocale:t.sessionInfo.uiLocale,DataLocale:t.sessionInfo.dataLocale,DisableChat:t.sessionInfo.disableChat,CookieCompliant:t.sessionInfo.cookieCompliant,SessionContext:t.sessionInfo.sessionContext,WdParams:t.sessionInfo.WdParams,HighContrastMode:t.sessionInfo.highContrastMode,SupportsDocReboot:t.sessionInfo.supportsDocReboot,SupportsAccessibilityLoop:t.sessionInfo.supportsAccessibilityLoop,UiHostIntegrationType:t.sessionInfo.uiHostIntegrationType,MetaUiHostVersion:t.sessionInfo.metaUiHostVersion,SiteId:t.sessionInfo.siteId,WebId:t.sessionInfo.webId,Upn:t.sessionInfo.upn,TenantId:t.sessionInfo.tenantId,UiHostTabId:t.sessionInfo.uiHostTabId},ApplicationUrl:i,WopiPrecheckInfo:{FileName:t.sessionInfo.fileName,FileGetUrl:t.sessionInfo.fileUrl,FileSize:t.sessionInfo.fileSize,BundleInfo:t.sessionInfo.bundleInfo?{MajorVersion:t.sessionInfo.bundleInfo.majorVersion,Url:t.sessionInfo.bundleInfo.url,BundleStaleness:t.sessionInfo.bundleInfo.bundleStaleness}:void 0,IsNewFile:!1,IsNewFileFromHostTemplate:!1,ReadOnly:t.sessionInfo.permissionsHint?t.sessionInfo.permissionsHint.readOnly:void 0},ApplicationCustomSettings:{additionalApplicationParameters:t.customSettings.additionalApplicationParameters,HostUIControls:t.customSettings.hostUIControls},Diagnostics:pe(t),WopiInfo:{WopiSrc:t.wopiInfo.wopiSrc,AccessToken:t.wopiInfo.accessToken,AccessTokenExpiry:t.wopiInfo.accessTokenExpiry},FnOnInitializeSuccess:e,FnOnInitializeFailure:n}}(t,this.ss(u,c),this.cs,a);if(this.ls=this.fs.InitializeWopiPending(l,c,i,u),void 0===this.ls){var d={errorType:et.AppInitError,errorObject:{}};this.us(d)}return this.ls&&l.WopiInfo&&this.ls.Complete(l.WopiInfo),{dispose:function(){e.ls&&e.ls.Fail("Cancelled")}}},t}();!function(t){t[t.NotSupported=0]="NotSupported",t[t.SameDocOnly=1]="SameDocOnly",t[t.AnyDoc=2]="AnyDoc",t[t.OtherMode=4]="OtherMode"}(ve||(ve={})),n.d(e,"Application",(function(){return ge})),n.d(e,"EmbedApplication",(function(){return be})),n.d(e,"StaffOrClassEmbedApplication",(function(){return ye})),n.d(e,"DocRebootSupportMode",(function(){return ve}));var ge=new re(he,{forceSingleStepBoot:!0}),Se={forceSingleStepBoot:!0,applicationUrlSubdomain:"onenote",applicationUrlPath:"/o/onenoteframe.aspx"},_e={embed:"1",embedded:"1",removeshareui:"1",hideheader:"1",hidepagesearch:"1",disablefile:"0",disableview:"0",disableprint:"0",disablechat:"1",uiembed:"1",hhdr:"1"},be=new we(a(a({},Se),{additionalApplicationParameters:_e})),ye=new we(a(a({},Se),{additionalApplicationParameters:a(a({},_e),{hidesections:"1"})}))},5:function(t,e,n){var i,o=function(){var t=String.fromCharCode,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",i={};function o(t,e){if(!i[t]){i[t]={};for(var n=0;n<t.length;n++)i[t][t.charAt(n)]=n}return i[t][e]}var r={compressToBase64:function(t){if(null==t)return"";var n=r.ds(t,6,(function(t){return e.charAt(t)}));switch(n.length%4){default:case 0:return n;case 1:return n+"===";case 2:return n+"==";case 3:return n+"="}},decompressFromBase64:function(t){return null==t?"":""==t?null:r.hs(t.length,32,(function(n){return o(e,t.charAt(n))}))},compressToUTF16:function(e){return null==e?"":r.ds(e,15,(function(e){return t(e+32)}))+" "},decompressFromUTF16:function(t){return null==t?"":""==t?null:r.hs(t.length,16384,(function(e){return t.charCodeAt(e)-32}))},compressToUint8Array:function(t){for(var e=r.compress(t),n=new Uint8Array(2*e.length),i=0,o=e.length;i<o;i++){var s=e.charCodeAt(i);n[2*i]=s>>>8,n[2*i+1]=s%256}return n},decompressFromUint8Array:function(e){if(null==e)return r.decompress(e);for(var n=new Array(e.length/2),i=0,o=n.length;i<o;i++)n[i]=256*e[2*i]+e[2*i+1];var s=[];return n.forEach((function(e){s.push(t(e))})),r.decompress(s.join(""))},compressToEncodedURIComponent:function(t){return null==t?"":r.ds(t,6,(function(t){return n.charAt(t)}))},decompressFromEncodedURIComponent:function(t){return null==t?"":""==t?null:(t=t.replace(/ /g,"+"),r.hs(t.length,32,(function(e){return o(n,t.charAt(e))})))},compress:function(e){return r.ds(e,16,(function(e){return t(e)}))},ds:function(t,e,n){if(null==t)return"";var i,o,r,s={},a={},c="",u="",f="",l=2,d=3,h=2,p=[],m=0,v=0;for(r=0;r<t.length;r+=1)if(c=t.charAt(r),Object.prototype.hasOwnProperty.call(s,c)||(s[c]=d++,a[c]=!0),u=f+c,Object.prototype.hasOwnProperty.call(s,u))f=u;else{if(Object.prototype.hasOwnProperty.call(a,f)){if(f.charCodeAt(0)<256){for(i=0;i<h;i++)m<<=1,v==e-1?(v=0,p.push(n(m)),m=0):v++;for(o=f.charCodeAt(0),i=0;i<8;i++)m=m<<1|1&o,v==e-1?(v=0,p.push(n(m)),m=0):v++,o>>=1}else{for(o=1,i=0;i<h;i++)m=m<<1|o,v==e-1?(v=0,p.push(n(m)),m=0):v++,o=0;for(o=f.charCodeAt(0),i=0;i<16;i++)m=m<<1|1&o,v==e-1?(v=0,p.push(n(m)),m=0):v++,o>>=1}0==--l&&(l=Math.pow(2,h),h++),delete a[f]}else for(o=s[f],i=0;i<h;i++)m=m<<1|1&o,v==e-1?(v=0,p.push(n(m)),m=0):v++,o>>=1;0==--l&&(l=Math.pow(2,h),h++),s[u]=d++,f=String(c)}if(""!==f){if(Object.prototype.hasOwnProperty.call(a,f)){if(f.charCodeAt(0)<256){for(i=0;i<h;i++)m<<=1,v==e-1?(v=0,p.push(n(m)),m=0):v++;for(o=f.charCodeAt(0),i=0;i<8;i++)m=m<<1|1&o,v==e-1?(v=0,p.push(n(m)),m=0):v++,o>>=1}else{for(o=1,i=0;i<h;i++)m=m<<1|o,v==e-1?(v=0,p.push(n(m)),m=0):v++,o=0;for(o=f.charCodeAt(0),i=0;i<16;i++)m=m<<1|1&o,v==e-1?(v=0,p.push(n(m)),m=0):v++,o>>=1}0==--l&&(l=Math.pow(2,h),h++),delete a[f]}else for(o=s[f],i=0;i<h;i++)m=m<<1|1&o,v==e-1?(v=0,p.push(n(m)),m=0):v++,o>>=1;0==--l&&(l=Math.pow(2,h),h++)}for(o=2,i=0;i<h;i++)m=m<<1|1&o,v==e-1?(v=0,p.push(n(m)),m=0):v++,o>>=1;for(;;){if(m<<=1,v==e-1){p.push(n(m));break}v++}return p.join("")},decompress:function(t){return null==t?"":""==t?null:r.hs(t.length,32768,(function(e){return t.charCodeAt(e)}))},hs:function(e,n,i){var o,r,s,a,c,u,f,l=[],d=4,h=4,p=3,m="",v=[],w={val:i(0),position:n,index:1};for(o=0;o<3;o+=1)l[o]=o;for(s=0,c=Math.pow(2,2),u=1;u!=c;)a=w.val&w.position,w.position>>=1,0==w.position&&(w.position=n,w.val=i(w.index++)),s|=(a>0?1:0)*u,u<<=1;switch(s){case 0:for(s=0,c=Math.pow(2,8),u=1;u!=c;)a=w.val&w.position,w.position>>=1,0==w.position&&(w.position=n,w.val=i(w.index++)),s|=(a>0?1:0)*u,u<<=1;f=t(s);break;case 1:for(s=0,c=Math.pow(2,16),u=1;u!=c;)a=w.val&w.position,w.position>>=1,0==w.position&&(w.position=n,w.val=i(w.index++)),s|=(a>0?1:0)*u,u<<=1;f=t(s);break;case 2:return""}for(l[3]=f,r=f,v.push(f);;){if(w.index>e)return"";for(s=0,c=Math.pow(2,p),u=1;u!=c;)a=w.val&w.position,w.position>>=1,0==w.position&&(w.position=n,w.val=i(w.index++)),s|=(a>0?1:0)*u,u<<=1;switch(f=s){case 0:for(s=0,c=Math.pow(2,8),u=1;u!=c;)a=w.val&w.position,w.position>>=1,0==w.position&&(w.position=n,w.val=i(w.index++)),s|=(a>0?1:0)*u,u<<=1;l[h++]=t(s),f=h-1,d--;break;case 1:for(s=0,c=Math.pow(2,16),u=1;u!=c;)a=w.val&w.position,w.position>>=1,0==w.position&&(w.position=n,w.val=i(w.index++)),s|=(a>0?1:0)*u,u<<=1;l[h++]=t(s),f=h-1,d--;break;case 2:return v.join("")}if(0==d&&(d=Math.pow(2,p),p++),l[f])m=l[f];else{if(f!==h)return null;m=r+r.charAt(0)}v.push(m),l[h++]=r+m.charAt(0),r=m,0==--d&&(d=Math.pow(2,p),p++)}}};return r}();void 0===(i=function(){return o}.call(e,n,e,t))||(t.exports=i)}});