MSN 3&&void 0!==arguments[3]?arguments[3]:p.Alert,s=arguments.length>4?arguments[4]:void 0,c=arguments.length>5?arguments[5]:void 0;try{const l=function(){if(!o){const e=document.head.getAttribute(“data-client-settings”);e&&(o=JSON.parse(e))}return o}(),u=a(),g=function(e){if(e){const{pcsInfo:t,pageGenTime:n}=e,o=new Date(n).getTime(),i=!t||[“prod”,”prod-ssr”,”prod-ssrntp”].includes(t.env);r=i?”browser.events.data.msn.com”:”events-sandbox.data.msn.com”;return{cors:”true”,”content-type”:”application/x-json-stream”,”client-id”:”NO_AUTH”,”client-version”:”1DS-Web-JS-2.2.2″,apikey:i?”0ded60c75e44443aa3484c42c1c43fe8-9fc57d3f-fdac-4bcf-b927-75eafe60192e-7279″:”f8857dedc6f54ca8962cfb713e01e7d7-e9250191-fe0b-446f-95ae-07516262f98c-7028″,”upload-time”:o,w:”0″,anoncknm:”app_anon”}}return null}(l);let w=””;g&&g.apikey&&””!==g.apikey&&(w=function(e){if(e){const t=e.indexOf(“-“);if(t>0)return e.substring(0,t)}return””}(g.apikey));const f=function(e,t,n,o,i,s){let r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:p.Alert;if(n){i=i||{};const{apptype:c,audienceMode:l,pagetype:u,pageGenTime:p,bundleInfo:h,deviceFormFactor:g=””,fd_muid:w,os:f}=n;i.pageGenTime=p,i.build=h&&h.v,i.appType=c;const b=function(e,t,n){const o=n&&”phone”===n.toLowerCase(),i=t&&”enterprise”===t;return{bingHomepage:”binghomepage”,mmx:”emmx”,edge:”spartan”,edgeChromium:i?”entnews”:”anaheim”,hybrid:”spartan”,hub:o?”prime_mobile”:”prime”,microsoftNews:”msnews”,office:”entnews”,views:o?”prime_mobile”:”prime”,windowsShell:”windowsshell”}[e]}(c,l,g),v=b||c,y=document.getElementsByTagName(“html”)[0].getAttribute(“lang”);let k,S=””,A=”muid”;try{if(“edgeChromium”===c&&”object”==typeof window&&window.location&&window.location.search){const e=new URLSearchParams(window.location.search);k=e.has(“startpage”)?”msedgdhp”:”msedgntp”,”enterprise”===l?k=”entnewsntp”:”xbox”===f&&(k=”xboxntp”)}window&&window.getCookieConsentRequired&&”function”==typeof window.getCookieConsentRequired&&window.getCookieConsentRequired()||(S=d(“muid”))}catch{}S||(S=n.aid,A=”aid”);const C={name:”MS.News.Web.AppError”,time:p,ver:”4.0″,iKey:`o:${o}`,data:{baseData:{},baseType:”MS.News.Web.Base”,page:{name:”default”,product:v,type:m(u),content:{category:”standaloneError”},ocid:k},browser:{clientId:S,clientIdType:A},flight:{id:s},request:{activityId:n.aid,requestId:n.aid,afdMuid:w},locale:{mkt:y},extSchema:{id:e,severity:r,pb:i,message:t}}};var a;if(S&&”muid”===A)C.ext={…null==C?void 0:C.ext,user:{…null==C||null===(a=C.ext)||void 0===a?void 0:a.user,localId:`t:${S}`}};return C.data.flight.tmpl=””,”object”==typeof window&&(window.isSSREnabled&&(C.data.flight.tmpl+=”;ssr-enabled:1″),window.isSSRCompleted&&(C.data.flight.tmpl+=”;ssr-completed:1″)),C?JSON.stringify(C):null}return null}(t,e,l,w,n,u,i);if(c&&!function(e){if(null==e)return!1;return e.startsWith(“2”)||e.startsWith(“3″)}(null==l?void 0:l.aid))return console.error(f),void console.error(`This App error Id: ${t} will not be sent due to app error sampling!`);if(g&&f){console.error(f),h.push(f);const e=”https://”+r+”/OneCollector/1.0″+function(e){return”?”+Object.keys(e).map((function(t){return t+”=”+encodeURIComponent(e[t])})).join(“&”)}(g);if(s&&!performance.getEntriesByType(“visibility-state”).some((e=>”visible”===e.name))){const t=()=>{“visible”===document.visibilityState&&navigator.sendBeacon(e,f)};document.addEventListener(“visibilitychange”,t,{once:!0})}else navigator.sendBeacon(e,f)}}catch{}}function m(e){let t=e;switch(e){case”windowsshellhp”:t=”dhp”;break;case”video”:t=”watch”}return t}const w=”visibilitychange”;function f(){return”visible”===document.visibilityState?Promise.resolve():new Promise((e=>{document.addEventListener(w,(()=>{“visible”===document.visibilityState&&e()}))}))}function b(e){const t=window&&window.chrome&&window.chrome.ntpSettingsPrivate;t&&t.logLoadingError&&f().then((()=>{t.logLoadingError(e)}))}function v(e){try{if(e)return JSON.parse(e)}catch(e){}return null}function y(){return!(“undefined”==typeof window||!window.document||!window.document.createElement||window.isRenderServiceEnv)}const k=”Authorization”;var S,A;!function(e){e.Presentation=”presentation”}(S||(S={})),function(e){e.Unknown=”Unknown”,e.Portrait=”Portrait”,e.Landscape=”Landscape”}(A||(A={}));var C,x;!function(e){e[e.Undefined=0]=”Undefined”,e[e.Basic=1]=”Basic”,e[e.Advanced=2]=”Advanced”,e[e.Premium=3]=”Premium”}(C||(C={})),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”}(x||(x={}));new Set([“winp0dash”,”winp1taskbar”,”winp1taskbarent”,”winp1taskbardirect”,”winp1taskbardirectent”,”winp1taskbarent”,”winp2juntaskbar”,”winp2juntaskbarent”,”winp2″,”winp2ent”,”winp2fp”,”winp2fpent”,”winp2fptaskbar”,”winp2fptaskbarent”,”winp2fptaskbarhover”,”winp2fptaskbarhoverent”,”winp2widget”,”winp2widgetent”]);const I=new Set([“finance-app-win”,”weather-app-win”,”winpstoreapp”]),E=(new Set([“msedgdhp”,”msedgdhphdr”,”msedgntphdr”,”msedgntp”,”msedgdhp”,”entnewsntp”]),new Set([“hpmsn”]));function _(){var e;return y()?v(document.head.dataset.clientSettings||(null===(e=document.getElementsByClassName(“peregrine-widget-settings”)[0])||void 0===e?void 0:e.getAttribute(“data-client-settings”))):null}const q=”feed/personalize/settings”;function O(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(){y()?(this.isDebugEnabled=(O(window.location.href,”debug”)||””).toLowerCase()in{1:1,true:1}||”vp”===(O(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 N{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=v(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 v(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{n=!1,t=void 0}},o}!function(e){e.NotAvailable=”notAvailable”,e.Expired=”expired”,e.Valid=”valid”}(R||(R={}));const H=”currentaccount”,B=$((()=>{const e=d(H,!0),t=e&&v(e),{login_hint:n}=t||{};return n&&t})),j=$((()=>!!d(H)));let G=new Map;const J=Object.freeze({set(e,t){return G.set(e,t),this},get:function(e,t){let n=G.get(e);return void 0===n&&t&&(n=t(),G.set(e,n)),n},clear(){G.clear()},delete:e=>G.delete(e),has:e=>G.has(e)});const V=”__RequestDataInstance__”;class z{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=K(“OSATE”,this.cookie),t=!!e&&”1″===e,n=K(“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=J.get(V);return e||(n.g.TEST_ENV?X({href:”http://localhost:8080/”,innerHeight:768,devicePixelRatio:1,canUseCssGrid:!1,requestId:”0″,cookie:””,userAgent:””,referer:””,oneServiceHeaders:””}):X({href:”http://localhost:8080/”,innerHeight:0,devicePixelRatio:0,canUseCssGrid:!1,requestId:”0″,cookie:””,userAgent:””,referer:””,oneServiceHeaders:””}))}static resetInstance(e){const t=new z(e,arguments.length>1&&void 0!==arguments[1]&&arguments[1]);return J.set(V,t),t}}function K(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 X=z.resetInstance,Y=()=>z.getInstance();function Z(){try{return localStorage}catch(e){return null}}const Q=”__PageExperimentInstance__”;function ee(e){J.set(Q,e)}function te(e){if(!J.has(Q)&&y()){var t;ee(ne(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=J.get(Q);return n&&n.has(e)}function ne(e){const t=(e||””).replace(/(^f:|;.*$)/g,””).split(“,”);return new Set(t)}const oe=”uxlogin”,ie=”uxlogout”,se=”uxedit”,re=”useRedirect”,ae=”uxswitch”,ce=$((()=>{const e=Z();return e&&”1″===e.getItem(oe)||y()&&location.search&&location.search.includes(`${oe}=1`)}));const de=$((()=>{const e=function(){try{return sessionStorage}catch(e){return null}}();return e&&!!e.getItem(ie)}));const le=$((()=>{const e=Z();return e&&”1″===e.getItem(se)}));const ue=$((()=>{const e=Z(),t=!te(“prg-noredirect”)&&e&&”1″===e.getItem(re)&&function(){const e=document.head.dataset.clientSettings||””,{browser:t}=v(e)||{},{browserType:n=””}=t||{};return!!/safari/i.test(n)}();return t}));const pe=$((()=>{const e=Z();return e&&”1″===e.getItem(ae)}));const he={bingHomepageMobile:”binghomepagemobile”,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”},ge=”superappdhp”,me=[“ios”,”android”,”ipados”];let we=Oe(“ocid”).toLowerCase(),fe=Oe(“chpltfm”),[be,ve]=fe.toLowerCase().split(“-“);function ye(){if(!y()||Ee())return!1;const e=window.sapphireWebViewBridge,t=window.webkit,n=e&&e.send,o=t&&t.messageHandlers&&t.messageHandlers.send&&t.messageHandlers.send.postMessage;return!(!n&&!o)}function ke(){const e=fe&&”outlook”===be&&me.includes(ve),t=we===he.outlookMobile.toLowerCase();return e||t}function Se(){const e=fe&&[“office”,”union”].includes(be)&&me.includes(ve),t=we===he.officeMobile.toLowerCase();return e||t}function Ae(){const e=we===he.skype.toLowerCase()||”skype”===be;return y()&&(null===(t=window.skypeWebviewBridge)||void 0===t?void 0:t.isSkype)||e;var t}function Ce(){return!(!y()||Ee())&&(ye()||we===he.sapphire.toLowerCase()||we===ge.toLowerCase())}function xe(){const e=Oe(“edge”);return(“emmx”===be||”1″===e)&&Ce()||”mmx”===we}function Ie(){return”3rdp”===be||we.startsWith(he.xiaomiApp)||we===he.moto.toLowerCase()||Ee()}function Ee(){return we.toLowerCase()===he.swiftKey.toLowerCase()||”swiftkey”==be.toLowerCase()}function _e(){return-1!==location.href.indexOf(“huawei”)||-1!==location.href.indexOf(“airfind”)||-1!==location.href.indexOf(“aloha”)||”vivo”===we&&Ie()}const qe=$((()=>we.toLowerCase()===he.bingHomepageMobile.toLowerCase()||-1!==location.href.indexOf(“bingHomepageMobile”)||ye()||Ae()||Se()||ke()||Ce()||we===he.winWeatherApp.toLowerCase()||we===he.winMoneyApp.toLowerCase()||xe()||Ie()||[he.launcher.toLowerCase(),he.launcherInterests.toLowerCase()].includes(we)&&Ce()||Ee()||_e()||-1!==location.href.indexOf(“metaos=true”)));function Oe(e){try{return new URL(location.href).searchParams.get(e)||””}catch(e){return””}}const Le=_()||{},Ne={newsAndInterests:1,windowsNewsbar:1,windowsNewsPlus:1,winWidgets:1,windowsShell:1,windowsShellV2:1,distribution:1,superApp:1,channeldesktop:1,channelmobile:1,edgeMobile:1},Te={edgeChromium:1},Pe={winWidgets:1},Re={edgeChromium:1,shopping:1,newsAndInterests:1,windowsNewsbar:1,windowsNewsPlus:1,winWidgets:1,windowsShell:1,windowsShellV2:1},Me={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},We=$((()=>Le&&Le.apptype)),Ue=($((()=>y()&&We()in Pe)),$((()=>y()&&!qe()&&!(We()in Ne)&&!$e()&&!He()))),De=$((()=>Ue()&&!(We()in Te)));$((()=>Ue()&&(!(We()in Te)||!j()))),$((()=>Ue()&&!Je()&&!Ve()));function Fe(){return Ve()||Je()}const $e=$((()=>{const e=!(We()in Re)&&ze()&&function(){const e=new URLSearchParams(y()?window.location.search:Y().url.search).get(“ocid”)||(null==Le?void 0:Le.ocid),t=null==e?void 0:e.toLowerCase(),n=!E.has(t)&&”homePage”!==We()&&!I.has(t);return n}()&&!function(){const e=”windows”==We()&&”windowshp”==(Le&&Le.pagetype)&&(y()?window.location.href:Y().url.href).includes(`${q}`);return e}();return e})),He=()=>y()&&document&&document.body&&document.body.getElementsByClassName(“peregrine-widgets”).length>0,Be=$((()=>te(“prg-1s-workid”)||te(“prg-1s-sm-workid”)||te(“prg-1s-twid”)||te(“prg-1s-mm-wid-t”)));$((()=>We()in Me||$e()));function je(){const e=W;if(e)return L.log(“dual-auth: tryGet1SAuthToken returned…
Continue reading