MSN

[]
MSN e.startsWith(“f:”))))||””).includes(e)}n.g=function(){if(“object”==typeof globalThis)return globalThis;try{return this||new Function(“return this”)()}catch(e){if(“object”==typeof window)return window}}(),function(){if(void 0!==n){const t=n.e,o={};var e;document.head.getAttribute(“data-info”);n.e=function(i){return t(i).catch((function(t){const s=o.hasOwnProperty(i)?o[i]:2;if(void 0===e&&(e=!1),e&&2===s&&(n.p=n.p.replace(“/assets.”,”/assets2.”)),s<1)throw t;return new Promise((function(e){setTimeout((function(){o[i]=s-1,e(n.e(i))}),100)}))}))}}}();function d(e){try{return decodeURIComponent(e)}catch(e){}}function l(e,t){if(!e)return null;if(t)return u(e);if(!s){const e="undefined"!=typeof document&&document.cookie.split("; ");s={};const t=e&&e.length;for(let n=0;n0&&void 0!==arguments[0]?arguments[0]:20;this.maxLength=20,this.list=[],this.maxLength=e}push(e){this.list.push(e),this.list.length>this.maxLength&&this.list.shift()}get data(){return this.list}};function w(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:h.Alert,s=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0;try{const d=function(){if(!o){const e=document.head.getAttribute(“data-client-settings”);e&&(o=JSON.parse(e))}return o}(),u=c(),p=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}(d);let w=””;p&&p.apikey&&””!==p.apikey&&(w=function(e){if(e){const t=e.indexOf(“-“);if(t>0)return e.substring(0,t)}return””}(p.apikey));const f=function(e,t,n,o,i,s){let r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:h.Alert;if(n){i=i||{};const{apptype:a,audienceMode:d,pagetype:u,pageGenTime:p,bundleInfo:h,deviceFormFactor:g=””,fd_muid:w,os:f}=n;i.pageGenTime=p,i.build=h&&h.v,i.appType=a;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]}(a,d,g),v=b||a,y=document.getElementsByTagName(“html”)[0].getAttribute(“lang”);let k,S=””,A=”muid”;try{if(“edgeChromium”===a&&”object”==typeof window&&window.location&&window.location.search){const e=new URLSearchParams(window.location.search);k=e.has(“startpage”)?”msedgdhp”:”msedgntp”,”enterprise”===d?k=”entnewsntp”:”xbox”===f&&(k=”xboxntp”)}window&&window.getCookieConsentRequired&&”function”==typeof window.getCookieConsentRequired&&window.getCookieConsentRequired()||(S=l(“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 c;if(S&&”muid”===A)C.ext={…null==C?void 0:C.ext,user:{…null==C||null===(c=C.ext)||void 0===c?void 0:c.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,d,w,n,u,i);if(a&&!function(e){if(null==e)return!1;return e.startsWith(“2”)||e.startsWith(“3″)}(null==d?void 0:d.aid))return console.error(f),void console.error(`This App error Id: ${t} will not be sent due to app error sampling!`);if(p&&f){console.error(f),g.push(f);const e=”https://”+r+”/OneCollector/1.0″+function(e){return”?”+Object.keys(e).map((function(t){return t+”=”+encodeURIComponent(e[t])})).join(“&”)}(p);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 f=”visibilitychange”;function b(){return”visible”===document.visibilityState?Promise.resolve():new Promise((e=>{document.addEventListener(f,(()=>{“visible”===document.visibilityState&&e()}),{once:!0})}))}function v(e){const t=window&&window.chrome&&window.chrome.ntpSettingsPrivate;t&&t.logLoadingError&&b().then((()=>{t.logLoadingError(e)}))}function y(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}const k=223300,S=223301;function A(e,t){const n=y(t);if(n){const t=n.createScriptURL(e),o=t&&t.toString();return t&&”about:blank#error”!==o?t:(w(“URL is not trusted types compliant.”,S,{customMessage:”Failed URL is: “+e},h.Deprecated,!0),e)}return w(“Trusted types policy is not available.”,k,{},h.Deprecated,!0),e}const C={},I=3;function E(e){if(!e)return;const t=e.src;let n=C[t]||1;if(nE(t),t}(t);C[t]=++n,setTimeout((()=>e.replaceWith(o)),100)}else w(“Error when loading bundle: “+t,20202,{retryCount:n,timeElapsed:Math.round(performance.now())})}function _(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];window.addEventListener(“load”,(()=>{window.requestIdleCallback((()=>{const i=function(e){const t=window.homePageWebpackChunks;if(!t)return[…e,”experience”];const n=t.length;if(n>e.length)return[];if(n===e.length)return[“experience”];t.slice(0,n+1).forEach((t=>e.splice(e.indexOf(t[0][0]),1)));const o=q(“experience”);o&&0!==o.decodedBodySize||e.push(“experience”);return e}(e);i.length&&Promise.race([b(),O(Math.max(t,5e5))]).then((e=>{“timeout”!==e||o?i.forEach((e=>x(e))):w(n+i.toString(),20202,{reason:”retry timeout”,timeout:t,timeElapsed:Math.round(performance.now())})}))}))}),{once:!0})}function x(e){const t=q(e);t&&(0===t.responseEnd?setTimeout((()=>{window.requestIdleCallback((()=>{x(e)}))}),100):0===t.decodedBodySize&&E(Array.from(document.scripts).find((e=>e.src===t.name))))}function q(e){const t=performance.getEntriesByType(“resource”).filter((t=>”script”===t.initiatorType&&t.name.indexOf(`/${e}.`)>-1));return t[t.length-1]}function O(e){return new Promise((t=>setTimeout((()=>t(“timeout”)),e)))}function P(e){w(“Error when loading bundle: “+e,20202,{…arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}})}function T(e,t,n,o,i){w(“JS Exception”,20203,{source:t,customMessage:e,line:n,column:o,stack:i&&i.stack})}function N(e){w(“JS Exception”,20203,{customMessage:e&&e.reason&&e.reason.message,stack:e&&e.reason&&e.reason.stack})}function L(e){try{if(e)return JSON.parse(e)}catch(e){}return null}function R(){return!(“undefined”==typeof window||!window.document||!window.document.createElement||window.isRenderServiceEnv)}”undefined”!=typeof window&&window.document&&window.document.createElement&&(window.requestIdleCallback=window.requestIdleCallback||window.setTimeout);const M=”Authorization”;var W,D;!function(e){e.Presentation=”presentation”}(W||(W={})),function(e){e.Unknown=”Unknown”,e.Portrait=”Portrait”,e.Landscape=”Landscape”}(D||(D={}));var U,F;!function(e){e[e.Undefined=0]=”Undefined”,e[e.Basic=1]=”Basic”,e[e.Advanced=2]=”Advanced”,e[e.Premium=3]=”Premium”}(U||(U={})),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”}(F||(F={}));new Set([“winp0dash”,”winp1taskbar”,”winp1taskbarent”,”winp1taskbardirect”,”winp1taskbardirectent”,”winp1taskbarent”,”winp2juntaskbar”,”winp2juntaskbarent”,”winp2″,”winp2ent”,”winp2fp”,”winp2fpent”,”winp2fptaskbar”,”winp2fptaskbarent”,”winp2fptaskbarhover”,”winp2fptaskbarhoverent”,”winp2widget”,”winp2widgetent”]);const $=new Set([“finance-app-win”,”weather-app-win”,”winpstoreapp”]),B=(new Set([“msedgdhp”,”msedgdhphdr”,”msedgntphdr”,”msedgntp”,”msedgdhp”,”entnewsntp”]),new Set([“hpmsn”]));function H(){var e;return R()?L(document.head.dataset.clientSettings||(null===(e=document.getElementsByClassName(“peregrine-widget-settings”)[0])||void 0===e?void 0:e.getAttribute(“data-client-settings”))):null}const j=”feed/personalize/settings”;var G,J,V;function z(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,” “))||””}!function(e){e[e.Unknown=0]=”Unknown”,e[e.NotSignedIn=1]=”NotSignedIn”,e[e.SignedIn=2]=”SignedIn”}(G||(G={})),function(e){e.MSA=”MSA”,e.AAD=”AAD”,e.UNSUPPORTED_SOVEREIGNTY=”UNSUPPORTED_SOVEREIGNTY”}(J||(J={})),function(e){e[e.NonAadAccount=0]=”NonAadAccount”,e[e.AadAccount=1]=”AadAccount”,e[e.Unknown=2]=”Unknown”}(V||(V={}));let K=new class{constructor(){R()?(this.isDebugEnabled=(z(window.location.href,”debug”)||””).toLowerCase()in{1:1,true:1}||”vp”===(z(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 X{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=L(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 L(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;K.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”}(Z||(Z={}));const re=”currentaccount”,ce=se((()=>{const e=l(re,!0),t=e&&L(e),{login_hint:n}=t||{};return n&&t})),ae=se((()=>!!l(re)));let de=new Map;const le=Object.freeze({set(e,t){return de.set(e,t),this},get:function(e,t){let n=de.get(e);return void 0===n&&t&&(n=t(),de.set(e,n)),n},clear(){de.clear()},delete:e=>de.delete(e),has:e=>de.has(e)});const ue=”__RequestDataInstance__”;class pe{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=he(“OSATE”,this.cookie),t=!!e&&”1″===e,n=he(“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=le.get(ue);return e||(n.g.TEST_ENV?ge({href:”http://localhost:8080/”,innerHeight:768,devicePixelRatio:1,canUseCssGrid:!1,requestId:”0″,cookie:””,userAgent:””,referer:””,oneServiceHeaders:””}):ge({href:”http://localhost:8080/”,innerHeight:0,devicePixelRatio:0,canUseCssGrid:!1,requestId:”0″,cookie:””,userAgent:””,referer:””,oneServiceHeaders:””}))}static resetInstance(e){const t=new pe(e,arguments.length>1&&void 0!==arguments[1]&&arguments[1]);return le.set(ue,t),t}}function he(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 ge=pe.resetInstance,we=()=>pe.getInstance();function me(){try{return localStorage}catch(e){return null}}const fe=”__PageExperimentInstance__”;function be(e){le.set(fe,e)}function ve(e){if(!le.has(fe)&&R()){var t;be(ye(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=le.get(fe);return n&&n.has(e)}function ye(e){const t=(e||””).replace(/(^f:|;.*$)/g,””).split(“,”);return new Set(t)}const ke=”uxlogin”,Se=”uxlogout”,Ae=”uxedit”,Ce=”useRedirect”,Ie=”uxswitch”,Ee=se((()=>{const e=me();return e&&”1″===e.getItem(ke)||R()&&location.search&&location.search.includes(`${ke}=1`)}));const _e=se((()=>{const e=function(){try{return sessionStorage}catch(e){return null}}();return e&&!!e.getItem(Se)}));const xe=se((()=>{const e=me();return e&&”1″===e.getItem(Ae)}));const qe=se((()=>{const e=me(),t=!ve(“prg-noredirect”)&&e&&”1″===e.getItem(Ce)&&function(){const e=document.head.dataset.clientSettings||””,{browser:t}=L(e)||{},{browserType:n=””}=t||{};return!!/safari/i.test(n)}();return t}));const Oe=se((()=>{const e=me();return e&&”1″===e.getItem(Ie)}));const Pe={bingHomepageMobile:”binghomepagemobile”,outlookMobile:”OnOOutlookMobile”,officeMobile:”OnOOfficeMobile”,sapphire:”OnOStartApp”,skype:”OnOSkype”,freFullPage:”emmxFre”,winWeatherApp:”weather-app-win”,xiaomiApp:”xmweather-“,launcher:”launcherntp”,launcherInterests:”launcherInterests”,moto:”moto”,swiftKey:”swiftKey”,winMoneyApp:”finance-app-win”},Te=”superappdhp”,Ne=[“ios”,”android”,”ipados”];let Le=ze(“ocid”).toLowerCase(),Re=ze(“chpltfm”),[Me,We]=Re.toLowerCase().split(“-“);function De(){if(!R()||Ge())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 Ue(){const e=Re&&”outlook”===Me&&Ne.includes(We),t=Le===Pe.outlookMobile.toLowerCase();return e||t}function Fe(){const e=Re&&[“office”,”union”].includes(Me)&&Ne.includes(We),t=Le===Pe.officeMobile.toLowerCase();return e||t}function $e(){const e=Le===Pe.skype.toLowerCase()||”skype”===Me;return R()&&(null===(t=window.skypeWebviewBridge)||void 0===t?void 0:t.isSkype)||e;var t}function Be(){return!(!R()||Ge())&&(De()||Le===Pe.sapphire.toLowerCase()||Le===Te.toLowerCase())}function He(){const e=ze(“edge”);return(“emmx”===Me||”1″===e)&&Be()||”mmx”===Le}function je(){return”3rdp”===Me||Le.startsWith(Pe.xiaomiApp)||Le===Pe.moto.toLowerCase()||Ge()}function Ge(){return Le.toLowerCase()===Pe.swiftKey.toLowerCase()||”swiftkey”==Me.toLowerCase()}function Je(){return-1!==location.href.indexOf(“huawei”)||-1!==location.href.indexOf(“airfind”)||-1!==location.href.indexOf(“aloha”)||”vivo”===Le&&je()}const Ve=se((()=>De()||$e()||Fe()||Ue()||Be()||Le===Pe.winWeatherApp.toLowerCase()||Le===Pe.winMoneyApp.toLowerCase()||He()||je()||[Pe.launcher.toLowerCase(),Pe.launcherInterests.toLowerCase()].includes(Le)&&Be()||Ge()||Je()||-1!==location.href.indexOf(“metaos=true”)));function ze(e){try{return new URL(location.href).searchParams.get(e)||””}catch(e){return””}}const Ke=H()||{},Xe={newsAndInterests:1,windowsNewsbar:1,windowsNewsPlus:1,winWidgets:1,windowsShell:1,windowsShellV2:1,distribution:1,superApp:1,channeldesktop:1,channelmobile:1,edgeMobile:1},Ye={edgeChromium:1},Qe={winWidgets:1},Ze={edgeChromium:1,shopping:1,newsAndInterests:1,windowsNewsbar:1,windowsNewsPlus:1,winWidgets:1,windowsShell:1,windowsShellV2:1},et={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},tt=se((()=>Ke&&Ke.apptype)),nt=(se((()=>R()&&tt()in Qe)),se((()=>R()&&!Ve()&&!(tt()in Xe)&&!st()&&!rt()))),ot=se((()=>nt()&&!(tt()in Ye)));se((()=>nt()&&(!(tt()in Ye)||!ae()))),se((()=>nt()&&!lt()&&!ut()));function it(){return ut()||lt()}const st=se((()=>{const e=!(tt()in Ze)&&pt()&&function(){const e=new URLSearchParams(R()?window.location.search:we().url.search).get(“ocid”)||(null==Ke?void 0:Ke.ocid),t=null==e?void 0:e.toLowerCase(),n=!B.has(t)&&”homePage”!==tt()&&!$.has(t);return n}()&&!function(){const e=”windows”==tt()&&”windowshp”==(Ke&&Ke.pagetype)&&(R()?window.location.href:we().url.href).includes(`${j}`);return e}();return e})),rt=()=>R()&&document&&document.body&&document.body.getElementsByClassName(“peregrine-widgets”).length>0,ct=se((()=>ve(“prg-1s-workid”)||ve(“prg-1s-sm-workid”)||ve(“prg-1s-twid”)||ve(“prg-1s-mm-wid-t”)));se((()=>tt()in et||st()));function at(){const e=te;if(e)return K.log(“dual-auth: tryGet1SAuthToken returned live tokens”),e;const t=ne();if(t)return K.log(`dual-auth: tryGet1SAuthToken returned cached tokens that are ${oe()}`),t;K.log(“dual-auth: tryGet1SAuthToken returned empty tokens”)}function dt(e){const t={};return e&&(t[M]=`Bearer ${e}`),t}function lt(){return ot()&&Ee()||function(){const e=ot()&&!ht()&&!Ee()&&ce()&&(“expired”==oe()||xe());return e}()||_e()||qe()}function ut(){return ot()&&!ce()&&Oe()}const pt=se((()=>{const{browser:e}=Ke,{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)}));se((()=>ot()&&!st()));const ht=()=>{if(!ve(“bypass-early-token”))return!1;const e=ce();if(!e)return!1;let t;switch(e.account_type){case J.MSA:t=ot()?”ace”:”aace”;break;case J.AAD:t=ot()?”WID”:”APP_WID”;break;default:return!1}return!!l(t)};const gt=”__core_auth_authHeaderPromiseParts__”,wt=()=>le.get(gt);var mt;!function(){let e;const t={promise:new Promise((t=>e=t)),resolver:e};le.set(gt,t)}(),function(e){e.GLOBAL=”GLOBAL”,e.GCC_MODERATE=”GCC_MODERATE”}(mt||(mt={}));let ft;function bt(){return ft}function vt(e){const t=e||bt()||”al_app_anon”,n=yt();return!!(n&&([“anon”,”al_anon”].includes(t)&&n.AL_ANON||[“app_anon”,”al_app_anon”].includes(t)&&n.AL_APP_ANON))}const yt=se((()=>L(l(“AL_STATE”,!0))));const kt=()=>{const e=l(“elt”,!0),t=e&&L(e),{access_token:n,account_type:o,login_hint:i,region_scope:s}=t||{};return(n||o||i||s)&&t};var St;!function(e){e.Adult=”adult”,e.Enterprise=”enterprise”,e.Kids=”kids”}(St||(St={}));class At{constructor(){this.childCookieName=”child”,this.domInfo=document.head.dataset.info,this.command=”command”}init(e,t){this.clientSettings=e||H(),this.authCookieName=bt()||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===St.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:dt(e)})})):i.postMessage({id:”AuthTokenEnterprise”,type:this.command,payload:{}}),e!==St.Adult&&e!==St.Enterprise||this.sendPageConfiguration()}it()&&wt().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=R()?window.devicePixelRatio:we().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(p(this.authCookieName),”aace”,”1″)+this.qs(p(“muid”),”muid”)+this.qs(p(this.childCookieName),”child”)+this.qs(p(“cbypass”),”cbypass”)+this.qs(this.cookieBannerConsentRequired().toString(),”ccRequired”)+this.qs(p(“ecasession”),”ecasession”)+this.qs(p(“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 t;try{const n=me();n&&(t=n.getItem(e))}catch(e){console.warn(“Error getting pivot id from local storage. “+e)}return this.qs(t,e)}qsXboxXToken(){const e=”xboxXTokenId”;let t;try{const n=me();n&&(t=n.getItem(e))}catch(e){console.warn(“Error getting xbox XToken from local storage. “+e)}return this.qs(t,e)}appendWpoFlightsToInfo(e,t){const n=this.getWpoFlightsFromLocalStorage(e);if(n&&n.length){const e=”;”,o=t.split(e);for(let e=0;ee.id))}}catch(e){console.warn(`Error getting wpo flights from ls for ${o} Error:${e}`)}return null}getHighestCbid(e,t){try{const n=me(),o=parseInt(e),i=parseInt(JSON.parse(n.getItem(`cbid_${t||””}`)));let s;if(o&&!isNaN(o)&&i&&!isNaN(i)&&(s=o>i?o:i),s=s||o||i,s)return window._cbid=s.toString()}catch(e){console.warn(“Error getting highest CBID”+e)}}getAudienceMode(e){me();const t=l(this.authCookieName),n=l(this.childCookieName),{child:o}=t&&JSON.parse(t)||{};return t&&(1===o||n)?”kids”:e.audienceMode||St.Adult}sendPageConfiguration(){const e=this.clientSettings.pagetype;if(e){const t=l&&l(“pglt-edgeChromium-“+e);if(t)return void window.webWorker.postMessage({id:”PageConfiguration”,type:this.command,payload:t})}window.webWorker.postMessage({id:”PageConfiguration”,type:this.command,payload:!1})}qsFromDataAttribute(e){let t,n;const o=me();if(o){const i=JSON.parse(o.getItem(“shd_”+e.pagetype)||null);i&&i.clientSettings&&i.info&&(t={…i.clientSettings,bundleInfo:e.bundleInfo},n=i.info)}return(!t||!n||e.pageGenTime>=t.pageGenTime)&&(t=e,n=this.domInfo),t.audienceMode=this.getAudienceMode(t),this.qsFromDataAttributeHelper(t,n)}qsFromUrl(){const e=location.search;return e&&e.length?e.substring(1,e.length):””}getEnterpriseAccessToken(){return new Promise((e=>{window.chrome&&window.chrome.authPrivate?window.chrome.authPrivate.getPrimaryAccountInfo((t=>{t&&”GCC_MODERATE”!==t.region_scope||e(“”);const n={account_id:t.account_id,account_type:t.account_type,client_id:”d7b530a4-7680-4c23-a8bf-c52c121d2e87″,scope_or_resource:”https://enterprisenews.microsoft.com”};window.chrome.authPrivate.acquireAccessTokenSilently(n,(t=>{t.is_success?e(t.access_token):e(“”)}))})):e(“”)}))}qsMisc(e){return this.qs(performance.timeOrigin&&performance.timeOrigin.toString(),”mainTimeOrigin”)+this.qs(e.disableWWConfig&&”1″,”disableWWConfig”)}qsAuth(e){let t=this.qs(ot()&&”1″,”disableWWAuth”);if(!it()){const e=ot()&&at()||{};t+=this.qs(encodeURIComponent(JSON.stringify(dt(e.accessToken))),”authHeaders”)}return t+=this.qs(vt()&&”1″,”isAccountLinked”),t+=this.qs(this.shouldFetchAppAnonCookie()&&”1″,”fetchAppAnonCookie”),t}getSingleColRequest(e){const t=”render_single_column”,n=”feed_layout”;let o,i;for(const s of e){const{key:e,value:r}=s;e===t?o=r:e===n&&(i=r)}return”boolean”==typeof o?o:!!i&&(i&&”single”===i.type)}cookieBannerConsentRequired(){const e=null!=document.getElementById(“consent-banner-container”)&&null===l(“MSCC”),t=null!=document.getElementById(“onetrust-sdk”)&&null===l(“eupubconsent-v2”);return e||t}shouldFetchAppAnonCookie(){if(!pt())return!0;const e=(()=>{const e=kt();if(e){if(“MSA”===e.account_type)return J.MSA;if(“AAD”===e.account_type)return J.AAD}})();return e===J.MSA||u(“lt”)?!u(“aace”):e===J.AAD?vt()&&!ct():void 0}tryGetWebWorkerUsingPolicy(e,t){const n=y(t);if(n){const t=n.createScriptURL(e),o=t&&t.toString();if(!o||”about:blank#error”===o)return;window.webWorker=new Worker(t,{name:”web-worker”})}else window.webWorker=new Worker(e,{name:”web-worker”});return window.webWorker}getFlightList(){return((/^f:s*([^;]+)/i.exec(this.domInfo)||{})[1]||””).toLowerCase().split(“,”)}}function Ct(e){return new Promise((t=>setTimeout(t,e)))}var It,Et;!function(e){e.Anon=”ANON”,e.AppAnon=”APP_ANON”,e.Unknown=””}(It||(It={})),function(e){e.AnonCookieExists=”ace”,e.AppAnonCookieExists=”aace”}(Et||(Et={}));const _t=”child”;function xt(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}const qt=”prg-“;function Ot(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qt;const n=t.length,o=[];return e&&e.length&&(e.forEach((e=>{const i=e&&e.trim();i&&i.length>=n&&i.substring(0,n).toLowerCase()===t&&o.push(i.toLowerCase())})),o.sort()),o}function Pt(e){var t;return document.head.dataset[e]||(null===(t=Nt())||void 0===t?void 0:t.dataset[e])}let Tt;function Nt(){return void 0===Tt&&(Tt=document.getElementsByClassName(“peregrine-widget-settings”)[0]||null),Tt}!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={};try{var n;if(!R())return t;const{all:o,prg:i}=function(){const e=Pt(“info”),t=(e&&e.match(/f:s*([^;]+)/i)||[])[1]||””,n=t.split(“,”);return{all:n,prg:Ot(n)}}(),s=L(Pt(“clientSettings”))||{},r=null===(n=s.apptype)||void 0===n?void 0:n.toLocaleLowerCase(),c=e.crsOptions||{};”winwidgets”!==r&&”homepage”!==r||(c.crsPrefetch=!0);(c.crsPrefetch||o.includes(“inlinecrscall”)||o.includes(`icrscall-${r}`))&&(!function(e,t,n){const o=function(e,t){let n;const o=decodeURIComponent(xt(e,”aace”)),{child:i}=o&&L(o)||{},s=xt(e,_t);return n=o&&(1===i||s)?St.Kids:t.audienceMode||St.Adult,n}(document.cookie,e),{apptype:i,browser:s,domain:r=””,bundleInfo:{v:c}={},deviceFormFactor:a=””,locale:{content:d,display:l}={},ocid:u,os:p=””,pagetype:h=””,servicesEndpoints:{crs:g}={}}=e,w=(Nt()?R()?window.location.hostname:we().url.hostname:r)||””;if(!i||!c||!g)return;const m={audienceMode:o,browser:s,deviceFormFactor:a,domain:w,locale:{content:d,display:l},ocid:u,os:p,platform:”web”,pageType:h,pageExperiments:t},f=new URLSearchParams([[“expType”,”AppConfig”],[“expInstance”,”default”],[“apptype”,i],[“v”,c]]),b=`${g.path}${g.v}/config/?${f}&targetScope=${JSON.stringify(m)}`,v=e=>{const t=new URL(`https://${e}${b}`),{timeout:o=5e3}=n;let i;if(window.crsRequestData={url:t.toString()},o>=0){const e=new AbortController;setTimeout((()=>e.abort()),o),i=e.signal}return fetch(t,{signal:i})},y=”msn.”+(function(e,t){return!!(e.hostname.toLowerCase().endsWith(“.cn”)||t.isChinaCompliance||t.useCnDomain||e.search.match(/item=revip:cn/))}(location,e)?”cn”:”com”),{domain:k}=g,S=k&&new URL(k).host;let A=v(S||`assets.${y}`);n.disableFallback||(A=A.catch((()=>{const{hostname:e}=location,t=e.match(/.msn.(com|cn)$/)?e:`www.${y}`;return v(t)})));window.crsPromise=A}(s,i,c),t.inlineCRS=!0)}catch(e){console.error(“InlineHeadCommon: “+e)}}();const Lt=document.head.attributes[“data-info”].value;let Rt;if(Lt){const e=Lt.split(“;”).find((e=>e.startsWith(“f:”)));e&&(Rt=e.substring(2),Rt.indexOf(“1sw-pcsreturnhp”)>-1&&w(“PCS returned. Executing inline JS.”,8e4,{customMessage:location.href},h.Deprecated))}function Mt(e){var t;return((null===(t=document.head)||void 0===t||null===(t=t.getAttribute(“data-info”))||void 0===t?void 0:t.split(“;”).find((e=>e.startsWith(“f:”))))||””).includes(e)}Mt(“hp-noww”)||(new At).init(),window.onerror=T,void 0!==window.onunhandledrejection&&(window.onunhandledrejection=N),window.onErrorHandler=P,function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[“vendors”,”common”,”microsoft”],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:”Error when loading bundle(s): “,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e5,o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;const s=a(“msn-bndl-rtry”);s||a(“msn-bndl-trtry”)?_(e,n,t,s):b().then((()=>{setTimeout((()=>{const n=window.homePageWebpackChunks;if(n){const s=n.length,r=e.length+1;if(s{t.length&&t[0][0]&&e.splice(e.indexOf(t[0][0]),1)}))}v(20202),w(t+e.toString(),20202,{}),i&&(v(o),i(o,{customMessage:e.toString()}))}}}),n)}))}(),(Mt(“prg-sdkpreload”)||Mt(“prg-renderoptimize”))&&async function(){window.apntag=window.apntag||{anq:[]},window.apntag.anq=window.apntag.anq||[],await async function(e){if(!R())return;const{src:t,id:n,async:o=!0,container:i=document.head,retryNumber:s=0,retryDelayMs:r=0}=e;try{await async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100;if(t<=1)return e();let o,i=1;do{try{o=await e()}catch(e){if(i===t)throw e&&e.message&&(e.message=`${e.message} after ${i} attempts`),e;await Ct(n)}}while(!o&&++ifunction(e,t,n){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return new Promise(((i,s)=>{const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:”anonymous”,i=arguments.length>4?arguments[4]:void 0,s=arguments.length>5?arguments[5]:void 0;if(!R())throw new Error(“createScriptTag is unsupported server side. This call should be wrapped in canUseDOM().”);const r=document.createElement(“script”);return t&&(r.id=t),i&&r.setAttribute(“class”,i),s&&(r.onload=s),r.type=”text/javascript”,e&&(window&&window.trustedTypesURLValidation?r.src=window.trustedTypesURLValidation(e,”scriptSrcUrlPolicy”):r.src=e,r.async=n,r.crossOrigin=o),window&&window.NONCE_ID&&(r.nonce=window.NONCE_ID),r}(e,t,o,void 0,void 0,(()=>i(!0)));r.crossOrigin=void 0,r.onerror=s,n.prepend(r)}))}(t,n,i,o)),s,r)}catch(e){w(“Failed to download Static JS”,11103,{scriptId:n,scriptSrc:t},h.Alert)}}({id:”display-sdk”,src:”https://acdn.adnxs.com/ast/ast.js”,container:document.head,retryDelayMs:200,retryNumber:5})}()}(); ]]> {t=o,s=e}),window._idbConfigOpenPromise=(()=>{try{const d=o.open(“wwConfigs”,1);return new Promise((o,c)=>{d.onerror=(()=>{c(new Error(“Config IDB preload open failure: “+d.error))}),d.onsuccess=(()=>{r[n+”open-End”]=performance.now();const c=d.result;o(c),r[n+”getAllObjects-Start”]=performance.now();const a=c.transaction(e,”readonly”).objectStore(e).openCursor();a.onsuccess=function(){const o=this.result;o?(i[o.key]=o.value,o.continue()):(r[n+”getAllObjects-End”]=performance.now(),t())},a.onerror=(()=>{s(new Error(“Config IDB preload read failure”))})}),d.onupgradeneeded=(()=>{d.result.createObjectStore(e)})})}catch(o){return Promise.reject(new Error(“Config IDB preload open failure: “+o))}})()}preloadConfigIDB(); ]]> onErrorHandler(s.src);s.nonce=””;s.crossOrigin=”anonymous”;document.body.appendChild(s);} ]]>

You May Also Like

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다