MSN i.delete(e),has:e=>i.has(e)});const r=”__RequestDataInstance__”;class c{constructor(e,t){if(this.url=new URL(e.href),this.innerHeight=e.innerHeight,this.devicePixelRatio=e.devicePixelRatio,this.canUseCssGrid=e.canUseCssGrid,this.requestId=e.requestId,this.cookie=e.cookie,this.referer=e.referer,this.userAgent=e.userAgent,this.clientData=e.clientData,this.oneServiceHeaders=function(e){try{if(e)return JSON.parse(e)}catch(e){}}(e.oneServiceHeaders)||{},this.isPssrMode=t,t){const e=a(“OSATE”,this.cookie),t=!!e&&”1″===e,n=a(“OSAT”,this.cookie);if(t&&n||!e&&!n)return this.msalAuthReady=!0,void(n&&(this.oneServiceHeaders.Authorization=`Bearer ${n}`));this.msalAuthReady=!1,this.pssrRejectedReason=e&&!t?”interactiveLogin”:e&&!n?”missOSAT”:”missOSATE”}}static getInstance(){const e=s.get(r);return e||(n.g.TEST_ENV?d({href:”http://localhost:8080/”,innerHeight:768,devicePixelRatio:1,canUseCssGrid:!1,requestId:”0″,cookie:””,userAgent:””,referer:””,oneServiceHeaders:””}):d({href:”http://localhost:8080/”,innerHeight:0,devicePixelRatio:0,canUseCssGrid:!1,requestId:”0″,cookie:””,userAgent:””,referer:””,oneServiceHeaders:””}))}static resetInstance(e){const t=new c(e,arguments.length>1&&void 0!==arguments[1]&&arguments[1]);return s.set(r,t),t}}function a(e,t){if(t&&e){const n=new RegExp(“\b”+e+”\s*=\s*([^;]*)”,”i”).exec(t);return n&&n.length>1?n[1]:null}return null}const d=c.resetInstance,l=()=>c.getInstance();var u,p;!function(e){e.Anon=”ANON”,e.AppAnon=”APP_ANON”,e.Unknown=””}(u||(u={})),function(e){e.AnonCookieExists=”ace”,e.AppAnonCookieExists=”aace”}(p||(p={}));const h=”child”;function g(e,t){if(e){const n=new RegExp(“\b”+t+”\s*=\s*([^;]*)”,”i”).exec(e);return n&&n.length>1?n[1]:null}return null}function w(e){try{if(e)return JSON.parse(e)}catch(e){}return null}var m;!function(e){e.Adult=”adult”,e.Enterprise=”enterprise”,e.Kids=”kids”}(m||(m={}));const f=”prg-“;function v(e){const t=f.length,n=[];return e&&e.length&&(e.forEach((e=>{const o=e&&e.trim();o&&o.length>=t&&o.substring(0,t).toLowerCase()===f&&n.push(o.toLowerCase())})),n.sort()),n}function b(e){var t;return document.head.dataset[e]||(null===(t=k())||void 0===t?void 0:t.dataset[e])}let y;function k(){return void 0===y&&(y=document.getElementsByClassName(“peregrine-widget-settings”)[0]||null),y}const S=”Authorization”;var A,C;!function(e){e.Presentation=”presentation”}(A||(A={})),function(e){e.Unknown=”Unknown”,e.Portrait=”Portrait”,e.Landscape=”Landscape”}(C||(C={}));var I,_;!function(e){e[e.Undefined=0]=”Undefined”,e[e.Basic=1]=”Basic”,e[e.Advanced=2]=”Advanced”,e[e.Premium=3]=”Premium”}(I||(I={})),function(e){e.Init=”init”,e.Config=”config”,e.Targeted=”targeted”,e.Sticky=”sticky”,e.NoSticky=”no_sticky”,e.Admin=”admin”,e.Forced=”forced”,e.Manual=”manual”}(_||(_={}));new Set([“winp0dash”,”winp1taskbar”,”winp1taskbarent”,”winp1taskbardirect”,”winp1taskbardirectent”,”winp1taskbarent”,”winp2juntaskbar”,”winp2juntaskbarent”,”winp2″,”winp2ent”,”winp2fp”,”winp2fpent”,”winp2fptaskbar”,”winp2fptaskbarent”,”winp2fptaskbarhover”,”winp2fptaskbarhoverent”,”winp2widget”,”winp2widgetent”]);const E=new Set([“finance-app-win”,”weather-app-win”,”winpstoreapp”]),q=(new Set([“msedgdhp”,”msedgdhphdr”,”msedgntphdr”,”msedgntp”,”msedgdhp”,”entnewsntp”]),new Set([“hpmsn”]));function O(){var e;return o()?w(document.head.dataset.clientSettings||(null===(e=document.getElementsByClassName(“peregrine-widget-settings”)[0])||void 0===e?void 0:e.getAttribute(“data-client-settings”))):null}const N=”feed/personalize/settings”;function x(e,t){const n=t.replace(/[[]]/g,”\$&”),o=new RegExp(“[?&]”+n+”(=([^&#]*)|&|#|$)”).exec(e);if(!o)return null;const i=o[2];return decodeURIComponent(i.replace(/+/g,” “))||””}let L=new class{constructor(){o()?(this.isDebugEnabled=(x(window.location.href,”debug”)||””).toLowerCase()in{1:1,true:1}||”vp”===(x(window.location.href,”reqsrc”)||””).toLowerCase(),this.isDebugEnabled&&!n.g.TEST_ENV&&(window.webpackRequire=n)):this.isDebugEnabled=!1}getLoggingService(){return null}isDebug(){return this.isDebugEnabled}setDebug(e){this.isDebugEnabled=e}setTags(e){}log(e,t){this.isDebug()&&console.info(e)}logError(e){console.error(e)}logCallback(e){this.isDebug()&&console.info(e())}logObjects(){this.isDebug()&&console.log(…arguments)}logSingleObject(e,t){this.isDebug()&&console.log(e)}};class P{get supported(){return!!this.storage}constructor(e){this.storage=e}getItem(e){if(this.supported)return this.storage.getItem(e)}getObject(e,t){const n=this.getItem(e);if(null!=n){const e=w(n);if(null!=e)return e}return t}key(e){if(this.supported&&e>=0)return this.storage.key(e)}keys(){return this.supported?Object.keys(this.storage):[]}setObject(e,t){void 0!==t?this.setItem(e,JSON.stringify(t)):this.removeItem(e)}removeObject(e){const t=this.removeItem(e);if(null!=t)return w(t)}setItem(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(this.supported)try{if(!t)throw”Attempted to store null/undefined value: “+t;this.storage.setItem(e,t)}catch(e){if(!n)throw e;L.logError(e)}else if(!n)throw new Error(“WebStorage not supported”)}get length(){if(this.supported)return this.storage.length}removeItem(e){if(this.supported){const t=this.getItem(e);return this.storage.removeItem(e),t}}clear(){this.supported&&this.storage.clear()}removeSubstringKeys(e){if(!this.supported||!e)return;const t=[];for(let n=0;n[]{const e=j(K,!0),t=e&&w(e),{login_hint:n}=t||{};return n&&t})),X=V((()=>!!j(K)));function Y(){try{return localStorage}catch(e){return null}}const Q=”__PageExperimentInstance__”;function Z(e){s.set(Q,e)}function ee(e){if(!s.has(Q)&&o()){var t;Z(te(document.head.dataset.info||(null===(t=window.document.getElementsByClassName(“peregrine-widget-settings”)[0])||void 0===t||null===(t=t.dataset)||void 0===t?void 0:t.info)||””))}const n=s.get(Q);return n&&n.has(e)}function te(e){const t=(e||””).replace(/(^f:|;.*$)/g,””).split(“,”);return new Set(t)}const ne=”uxlogin”,oe=”uxlogout”,ie=”uxedit”,se=”useRedirect”,re=”uxswitch”,ce=V((()=>{const e=Y();return e&&”1″===e.getItem(ne)||o()&&location.search&&location.search.includes(`${ne}=1`)}));const ae=V((()=>{const e=function(){try{return sessionStorage}catch(e){return null}}();return e&&!!e.getItem(oe)}));const de=V((()=>{const e=Y();return e&&”1″===e.getItem(ie)}));const le=V((()=>{const e=Y(),t=!ee(“prg-noredirect”)&&e&&”1″===e.getItem(se)&&function(){const e=document.head.dataset.clientSettings||””,{browser:t}=w(e)||{},{browserType:n=””}=t||{};return!!/safari/i.test(n)}();return t}));const ue=V((()=>{const e=Y();return e&&”1″===e.getItem(re)}));const pe={outlookMobile:”OnOOutlookMobile”,officeMobile:”OnOOfficeMobile”,sapphire:”OnOStartApp”,skype:”OnOSkype”,winWeatherApp:”weather-app-win”,xiaomiApp:”xmweather-“,launcher:”launcherntp”,launcherInterests:”launcherInterests”,moto:”moto”,swiftKey:”swiftKey”,winMoneyApp:”finance-app-win”},he=”superappdhp”,ge=[“ios”,”android”,”ipados”];let we=Oe(“ocid”).toLowerCase(),me=Oe(“chpltfm”),[fe,ve]=me.toLowerCase().split(“-“);function be(){if(!o())return!1;const e=window.sapphireWebViewBridge,t=window.webkit,n=e&&e.send,i=t&&t.messageHandlers&&t.messageHandlers.send&&t.messageHandlers.send.postMessage;return!(!n&&!i)}function ye(){const e=me&&”outlook”===fe&&ge.includes(ve),t=we===pe.outlookMobile.toLowerCase();return e||t}function ke(){const e=me&&[“office”,”union”].includes(fe)&&ge.includes(ve),t=we===pe.officeMobile.toLowerCase();return e||t}function Se(){const e=we===pe.skype.toLowerCase()||”skype”===fe;return o()&&(null===(t=window.skypeWebviewBridge)||void 0===t?void 0:t.isSkype)||e;var t}function Ae(){return be()||we===pe.sapphire.toLowerCase()||we===he.toLowerCase()}function Ce(){const e=Oe(“edge”);return(“emmx”===fe||”1″===e)&&Ae()||”mmx”===we}function Ie(){return”3rdp”===fe||we.startsWith(pe.xiaomiApp)||we===pe.moto.toLowerCase()||_e()}function _e(){return we.toLowerCase()===pe.swiftKey.toLowerCase()||”swiftkey”==fe.toLowerCase()}function Ee(){return-1!==location.href.indexOf(“huawei”)||-1!==location.href.indexOf(“airfind”)||-1!==location.href.indexOf(“aloha”)||”vivo”===we&&Ie()}const qe=V((()=>be()||Se()||ke()||ye()||Ae()||we===pe.winWeatherApp.toLowerCase()||we===pe.winMoneyApp.toLowerCase()||Ce()||Ie()||[pe.launcher.toLowerCase(),pe.launcherInterests.toLowerCase()].includes(we)&&Ae()||_e()||Ee()||-1!==location.href.indexOf(“metaos=true”)));function Oe(e){try{return new URL(location.href).searchParams.get(e)||””}catch(e){return””}}const Ne=O()||{},xe={newsAndInterests:1,windowsNewsbar:1,windowsNewsPlus:1,winWidgets:1,windowsShell:1,windowsShellV2:1,distribution:1,superApp:1,channeldesktop:1,channelmobile:1,edgeMobile:1},Le={edgeChromium:1},Pe={winWidgets:1},Re={edgeChromium:1,shopping:1,newsAndInterests:1,windowsNewsbar:1,windowsNewsPlus:1,winWidgets:1,windowsShell:1,windowsShellV2:1},Te={edgeChromium:1,channeldesktop:1,channelmobile:1,cgHomePage:1,distribution:1,newsAndInterests:1,windowsNewsbar:1,windowsNewsPlus:1,winWidgets:1,windowsShell:1,windowsShellV2:1,superApp:1,edgeMobile:1},Me=V((()=>Ne&&Ne.apptype)),We=(V((()=>o()&&Me()in Pe)),V((()=>o()&&!qe()&&!(Me()in xe)&&!Fe()&&!$e()))),Ue=V((()=>We()&&!(Me()in Le)));V((()=>We()&&(!(Me()in Le)||!X()))),V((()=>We()&&!Ge()&&!Je()));function De(){return Je()||Ge()}const Fe=V((()=>{const e=!(Me()in Re)&&Ve()&&function(){const e=new URLSearchParams(o()?window.location.search:l().url.search).get(“ocid”)||(null==Ne?void 0:Ne.ocid),t=null==e?void 0:e.toLowerCase(),n=!q.has(t)&&”homePage”!==Me()&&!E.has(t);return n}()&&!function(){const e=”windows”==Me()&&”windowshp”==(Ne&&Ne.pagetype)&&(o()?window.location.href:l().url.href).includes(`${N}`);return e}();return e})),$e=()=>o()&&document&&document.body&&document.body.getElementsByClassName(“peregrine-widgets”).length>0,He=V((()=>ee(“prg-1s-workid”)||ee(“prg-1s-sm-workid”)||ee(“prg-1s-twid”)||ee(“prg-1s-mm-wid-t”)));V((()=>Me()in Te||Fe()));function Be(){const e=U;if(e)return L.log(“dual-auth: tryGet1SAuthToken returned live tokens”),e;const t=F();if(t)return L.log(`dual-auth: tryGet1SAuthToken returned cached tokens that are ${$()}`),t;L.log(“dual-auth: tryGet1SAuthToken returned empty tokens”)}function je(e){const t={};return e&&(t[S]=`Bearer ${e}`),t}function Ge(){return Ue()&&ce()||function(){const e=Ue()&&!ce()&&z()&&(“expired”==$()||de());return e}()||ae()||le()}function Je(){return Ue()&&!z()&&ue()}const Ve=V((()=>{const{browser:e}=Ne,{browserType:t=””,detected:n={}}=e||{},{browserType:o=””}=n||{};return/edgeChromium/i.test(t)||/edgeAndroid/i.test(t)||/edgeiOS/i.test(t)||/edge/i.test(o)}));V((()=>Ue()&&!Fe()));const Ke=”__core_auth_authHeaderPromiseParts__”,ze=()=>s.get(Ke);var Xe;!function(){let e;const t={promise:new Promise((t=>e=t)),resolver:e};s.set(Ke,t)}(),function(e){e.GLOBAL=”GLOBAL”,e.GCC_MODERATE=”GCC_MODERATE”}(Xe||(Xe={}));let Ye;function Qe(){return Ye}function Ze(e){const t=e||Qe()||”al_app_anon”,n=et();return!!(n&&([“anon”,”al_anon”].includes(t)&&n.AL_ANON||[“app_anon”,”al_app_anon”].includes(t)&&n.AL_APP_ANON))}const et=V((()=>w(j(“AL_STATE”,!0))));var tt,nt,ot;!function(e){e[e.Unknown=0]=”Unknown”,e[e.NotSignedIn=1]=”NotSignedIn”,e[e.SignedIn=2]=”SignedIn”}(tt||(tt={})),function(e){e.MSA=”MSA”,e.AAD=”AAD”,e.UNSUPPORTED_SOVEREIGNTY=”UNSUPPORTED_SOVEREIGNTY”}(nt||(nt={})),function(e){e[e.NonAadAccount=0]=”NonAadAccount”,e[e.AadAccount=1]=”AadAccount”,e[e.Unknown=2]=”Unknown”}(ot||(ot={}));const it=()=>{const e=j(“elt”,!0),t=e&&w(e),{access_token:n,account_type:o,login_hint:i,region_scope:s}=t||{};return(n||o||i||s)&&t};function st(e){if(“undefined”==typeof window||!window.document||window.isRenderServiceEnv)return;const t=window.trustedTypes;if(!t||!t.createPolicy)return;const n=window.trustedTypePolicies||(window.trustedTypePolicies={});if(n[e])return n[e];const o=t.createPolicy(e,{createScriptURL:e=>{const t=function(e){const t=[“ntp.msn.com”,”ntp.msn.cn”,”assets.msn.cn”,”assets.msn.com”,”www.bing.com”,”assets2.msn.com”,”assets2.msn.cn”,”www.clarity.ms”,”int.msn.com”,”r.bing.com”,”business.bing.com”,”staticview.msn.com”,”staticview.msn.cn”,document.location.hostname];let n;try{n=new URL(e,location.origin)}catch(e){return”about:blank#error”}if(n.hostname&&!t.includes(n.hostname))return”about:blank#error”;return e}(e);return t}});return n[e]=o,o}class rt{constructor(){this.childCookieName=”child”,this.domInfo=document.head.dataset.info,this.command=”command”}init(e,t){this.clientSettings=e||O(),this.authCookieName=Qe()||window._authCookieName||””,this.bundle=window._webWorkerBundle||””,t=t||{};const n=this.buildWebWorkerUrl(this.clientSettings,t),o=this.clientSettings.apptype;let i;if(o&&”edgeChromium”===o){if(i=this.tryGetWebWorkerUsingPolicy(n,”webWorkerUrlPolicy”),!i)return void console.warn(“Error in creating trusted types compliant web worker”)}else i=window.webWorker=new Worker(n,{name:”web-worker”});const s=window.webWorkerMessages=[];i.onmessage=e=>{s.push(e.data)};const r=window.webWorkerErrors=[];if(i.onerror=e=>{r.push(e)},window.chrome){const e=this.getAudienceMode(this.clientSettings),t=window.webWorker&&window.chrome&&window.chrome.ntpSettingsPrivate;t&&”function”==typeof t.getPref&&(t.getPref(“ntp.news_feed_display”,(e=>{e&&e.value&&i.postMessage({id:”FeedDisplaySetting”,type:this.command,payload:e.value})})),t.getPref(“ntp.layout_mode”,(e=>{e&&e.value&&i.postMessage({id:”LayoutModeSetting”,type:this.command,payload:e.value})})),t.getPref(“ntp.user_nurturing”,(e=>{let t=!1;e&&e.value&&e.value.length&&(t=this.getSingleColRequest(e.value)),i.postMessage({id:”RenderSingleColumn”,type:this.command,payload:t})})),t.getPref(“new_device_fre.has_user_seen_new_fre”,(e=>{e&&i.postMessage({id:”NewUserFre”,type:this.command,payload:e.value})}))),t&&”function”==typeof t.getConfigData&&t.getConfigData((e=>{const t=(null==e?void 0:e.enabledFeatures)||[];t.includes(“msReducedNtpAdsForNewDevice_stage1″)&&i.postMessage({id:”EdgeNoAds”,type:this.command,payload:!0}),t.includes(“msReducedNtpAdsForNewDevice_stage2″)&&i.postMessage({id:”EdgeReduceAds”,type:this.command,payload:!0})})),e===m.Enterprise&&this.clientSettings.browser&&”edgeChromium”===this.clientSettings.browser.browserType&&parseInt(this.clientSettings.browser.version)>=87?this.getEnterpriseAccessToken().then((e=>{e&&i.postMessage({id:”AuthTokenEnterprise”,type:this.command,payload:je(e)})})):i.postMessage({id:”AuthTokenEnterprise”,type:this.command,payload:{}}),e!==m.Adult&&e!==m.Enterprise||this.sendPageConfiguration()}De()&&ze().promise.then((e=>i.postMessage({id:”AuthHeaders”,type:this.command,payload:e||{}})))}buildWebWorkerUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return(this.bundle||””)+”#”+this.qsFromDocument()+this.qsFromCookies()+this.qsFromDataAttribute(e||this.clientSettings)+this.qsMisc(t)+this.qsAuth(e||this.clientSettings)+this.qsFromUrl()+this.qsFromServiceWorker()+this.qsSelectedPivot()+this.qsXboxXToken()}qs(e,t,n){return e?t+”=”+(n||e)+”&”:””}qsFromDocument(){var e;return this.qs(document.getElementsByTagName(“html”)[0].getAttribute(“lang”),”lang”)+this.qs(encodeURIComponent(window.location.href),”adsReferer”)+this.qs(null===(e=o()?window.devicePixelRatio:l().devicePixelRatio)||void 0===e?void 0:e.toString(),”devicePixelRatio”)}qsFromServiceWorker(){if(!navigator.serviceWorker||!navigator.serviceWorker.controller)return””;const e=navigator.serviceWorker.controller;if(“activated”!==e.state||!e.scriptURL)return””;if(e.scriptURL){const t=new URL(e.scriptURL).searchParams.toString();return t?”&”+t+”&”:””}return””}qsFromCookies(){return this.qs(J(this.authCookieName),”aace”,”1″)+this.qs(J(“muid”),”muid”)+this.qs(J(this.childCookieName),”child”)+this.qs(J(“cbypass”),”cbypass”)+this.qs(this.cookieBannerConsentRequired().toString(),”ccRequired”)+this.qs(J(“ecasession”),”ecasession”)+this.qs(J(“TOptOut”),”browserOptOut”)}qsFromDataAttributeHelper(e,t){return e&&e.featureFlags&&e.featureFlags.wpoEnabled&&t&&!t.includes(“remwpofltww”)&&(t=this.appendWpoFlightsToInfo(e,t)),this.qs(e.pcsInfo&&e.pcsInfo.env||e.env,”env”)+this.qs(e.aid,”aid”)+this.qs(e.apptype,”apptype”)+this.qs(e.pagetype,”pagetype”)+this.qs(e.audienceMode,”audienceMode”)+this.qs(e.configIndexDocId,”configIndexDocId”)+this.qs(e.deviceFormFactor,”deviceFormFactor”)+this.qs(e.domain,”domain”)+this.qs(e.configRootUrl,”configRootUrl”)+this.qs(this.getHighestCbid(e.cbid,e.apptype),”cbid”)+this.qs(e.ocid,”ocid”)+this.qs(e.os,”os”)+this.qs(JSON.stringify(e.locale),”locale”)+this.qs(e.geo_lat,”lat”)+this.qs(e.geo_long,”long”)+this.qs(JSON.stringify(e.featureFlags),”featureFlags”)+this.qs(JSON.stringify(e.browser),”browser”)+this.qs(JSON.stringify(e.servicesEndpoints),”servicesEndpoints”)+this.qs(e.bundleInfo&&e.bundleInfo.v||””,”buildVersion”)+this.qs(t,”dataInfo”)}qsSelectedPivot(){const e=”selectedPivot”;let…
Continue reading