_linear_694_328824" x1="0" y1="0" x2="586.719" y2="140.422" gradientUnits="userSpaceOnUse">
            <stop stop-color="#AA62F1"/>
            <stop offset="1" stop-color="#3D7BF3"/>
        </linearGradient>
        <linearGradient id="paint1_linear_694_328824" x1="249.683" y1="57" x2="249.683" y2="114.851" gradientUnits="userSpaceOnUse">
            <stop stop-color="#0078D7" stop-opacity="0.5"/>
            <stop offset="1" stop-color="#0078D7" stop-opacity="0"/>
        </linearGradient>
        <linearGradient id="paint2_linear_694_328824" x1="275.094" y1="16.5926" x2="275.094" y2="111.593" gradientUnits="userSpaceOnUse">
            <stop stop-color="#00B4DC" stop-opacity="0.49"/>
            <stop offset="1" stop-color="#0855C7" stop-opacity="0"/>
        </linearGradient>
        <linearGradient id="paint3_linear_694_328824" x1="289.554" y1="68.3571" x2="289.554" y2="139.691" gradientUnits="userSpaceOnUse">
            <stop stop-color="white"/>
            <stop offset="1" stop-color="white" stop-opacity="0"/>
        </linearGradient>
    </defs>
</svg>
`,b=d.d`
<svg width="594" height="110" viewBox="0 0 594 110" fill="none" xmlns="http://www.w3.org/2000/svg">
    <rect width="594" height="110" rx="6" fill="#2F3135"/>
    <rect width="594" height="110" rx="6" fill="url(#paint0_radial_694_328829)" fill-opacity="0.3"/>
    <rect width="594" height="110" rx="6" fill="url(#paint1_linear_694_328829)"/>
    <g opacity="0.1">
        <path d="M89.625 54.8731C21.1569 54.8731 -6 72.0878 -6 79.1194V114L606 113.575C606 113.575 546.756 38 439.427 38C332.099 38 278.407 60.6866 203.141 60.6866C134.056 60.6866 158.093 54.8731 89.625 54.8731Z" fill="url(#paint2_linear_694_328829)" fill-opacity="0.5"/>
        <path d="M601 31.037C601 45.1111 597.434 113.444 600.999 113.444H510.649L-16 114C-16 114 1.83191 14 145.085 14C272.884 14 312.71 46.7778 416.732 46.7778C520.754 46.7778 601 31.037 601 31.037Z" fill="url(#paint3_linear_694_328829)" fill-opacity="0.8"/>
        <path d="M199.591 74.56C278.177 74.56 346.169 100.499 432.557 100.499C518.946 100.499 611 63 611 63L607.459 137.999H-2.21942C-2.21942 137.999 -17.0896 138.563 -42.5814 115.161C-51.8112 106.688 -57.4397 99.0896 11.9427 99.0896C103.996 99.0896 149.315 74.56 199.591 74.56Z" fill="url(#paint4_linear_694_328829)" fill-opacity="0.5"/>
    </g>
    <defs>
        <radialGradient id="paint0_radial_694_328829" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(-0.000112979 1.80923) rotate(10.3227) scale(603.773 1445.09)">
            <stop stop-color="#A9BBE9"/>
            <stop offset="0.262145" stop-color="#B489D5"/>
            <stop offset="0.659467" stop-color="#6DA5D8"/>
            <stop offset="0.881556" stop-color="#8A8EE9"/>
            <stop offset="1" stop-color="#7CD6E3"/>
        </radialGradient>
        <linearGradient id="paint1_linear_694_328829" x1="297" y1="0" x2="297" y2="110" gradientUnits="userSpaceOnUse">
            <stop stop-color="#616168" stop-opacity="0"/>
            <stop offset="0.526042" stop-color="#616168" stop-opacity="0.4"/>
            <stop offset="1" stop-color="#616168"/>
        </linearGradient>
        <linearGradient id="paint2_linear_694_328829" x1="292.521" y1="43.4285" x2="292.521" y2="115.713" gradientUnits="userSpaceOnUse">
            <stop stop-color="#3E92D4"/>
            <stop offset="1" stop-color="#3E92D4" stop-opacity="0"/>
        </linearGradient>
        <linearGradient id="paint3_linear_694_328829" x1="343.228" y1="39" x2="343.228" y2="115.119" gradientUnits="userSpaceOnUse">
            <stop stop-color="#8DFFF1" stop-opacity="0.5"/>
            <stop offset="1" stop-color="#8DFFF1" stop-opacity="0"/>
        </linearGradient>
        <linearGradient id="paint4_linear_694_328829" x1="611" y1="63" x2="11.2156" y2="292.653" gradientUnits="userSpaceOnUse">
            <stop stop-color="#C8BDE6"/>
            <stop offset="1" stop-color="#C8BDE6"/>
        </linearGradient>
    </defs>
</svg>
`;var C=r(9610),I=r(97975),$=r(86331),G=r(66925),k=r(85334),U=r(9683),A=r(68364),F=r(26415),x=r(65135),H=r(88828),L=r(14989),q=r(32717);const W=2629743;class D extends C.l{constructor(){super(...arguments),this._scrollRenderingHandler=this.scrollRenderingHandler.bind(this)}experienceConnected(){var e;return(0,a.mG)(this,void 0,void 0,(function*(){let t;yield(0,q.eC)(),this.freServiceClient=(0,U._n)();try{t=yield this.freServiceClient.getFreState()}catch(e){return void(0,A.OO)(e.message,F.Cri.GetFreStateFailError,"Failed to get Fre state data in Inline Tuning Upsell")}const r=Math.floor(Date.now()/1e3);this.impressionTimestampList=(null==t?void 0:t.inlineTuningImpressionTimestampList)||[];const i=this.impressionTimestampList.filter((e=>r-e<86400)).length,n=this.impressionTimestampList.filter((e=>r-e<W)).length;if(i>=1||n>=3)return;if(!((null==t?void 0:t.inlineTuningDismissExpireTimestamp)>r)){if(this.config.enableDwellBasedTrigger)this.setToastRenderingTimer();else if(this.config.enableScrollTrigger)window.addEventListener("scroll",this._scrollRenderingHandler);else if(this.config.enableColdUserTrigger){const t=null===(e=x.M0.getPageMetadata())||void 0===e?void 0:e.tmplString,r=/(^|;)SageUserStatus:._._._[0-4]($|;)/.test(t);(this.isColdStart||r)&&(this.renderToast(),this.renderCoachMark())}(0,H.Bn)().subscribe(this.columnChangeHandler)}}))}disconnectedCallback(){window.removeEventListener("scroll",this._scrollRenderingHandler),(0,H.Bn)().unsubscribe(this.columnChangeHandler)}getExperienceType(){return s.x.inlineTuningUpsell}renderToast(){G.h.renderToast({expirationInMs:3e4,freLightModeBackground:P,freDarkModeBackground:b,freBackgroundStyles:S,freDataSource:this,freImage:O,freSubtitle:w,freTitle:T,hasCloseButton:!0,id:"fre-toast",onFreCloseButtonClose:()=>this.closeButtonHandler(),toastType:k.p.Fre}),x.M0.addOrUpdateTmplProperty("inlineTuningUpsellShown","1"),this.impressionTimestampList.push(Math.floor(Date.now()/1e3)),this.freServiceClient.setFreState(JSON.stringify({inlineTuningImpressionTimestampList:this.impressionTimestampList}),F.Cri.SetFreStateFailError)}setToastRenderingTimer(){this.renderTimer&&clearTimeout(this.renderTimer),this.renderTimer=window.setTimeout((()=>{this.renderToast(),this.renderCoachMark()}),3e4)}scrollRenderingHandler(){var e,t,r,i;const n=null===(i=null===(r=null===(t=null===(e=document.querySelector("edge-chromium-page"))||void 0===e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector("pivot-content"))||void 0===r?void 0:r.shadowRoot)||void 0===i?void 0:i.querySelector("grid-view-feed");(null==n?void 0:n.getBoundingClientRect().top)<-100&&(this.renderToast(),this.renderCoachMark(),window.removeEventListener("scroll",this._scrollRenderingHandler))}renderCoachMark(){var e,t,r,i,n,s;const o=null===(i=null===(r=null===(t=null===(e=document.querySelector("edge-chromium-page"))||void 0===e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector("pivot-content"))||void 0===r?void 0:r.shadowRoot)||void 0===i?void 0:i.querySelector("grid-view-feed"),a=null===(n=null==o?void 0:o.shadowRoot)||void 0===n?void 0:n.querySelectorAll("msft-feed-layout");let d;if(a)for(let e=0;e<a.length;e++){const t=null===(s=a[e].shadowRoot)||void 0===s?void 0:s.querySelectorAll("msft-article-card.contentCard msn-card-button[select-title='See more']");if(t)for(let e=0;e<t.length;e++){const r=t[e].getBoundingClientRect().top,i=window.innerHeight-r;if(r>200&&i>250){d=t[e];break}}if(d)break}d&&(I.W.getInstance().registerItemAnchorElement($.gz.InlineTuningUpsell,d),I.W.getInstance().registerItemTriggerMessage($.gz.InlineTuningUpsell,!0))}closeButtonHandler(){this.freServiceClient.setFreState(JSON.stringify({inlineTuningDismissExpireTimestamp:Math.floor(Date.now()/1e3)+W}),F.Cri.SetFreStateFailError)}columnChangeHandler(e){e===L.K$.c1&&G.h.expireToast("fre-toast")}}const j=r(53046).i``,M={experienceConfigSchema:o}},48328:function(e,t,r){"use strict";var i;r.d(t,{Hf:function(){return o},Ik:function(){return s},Kr:function(){return n},e7:function(){return i},hp:function(){return a}}),function(e){e.Publisher="Publisher",e.Article="Article",e.Topic="Topic"}(i||(i={}));const n={Publisher:{actionType:"More",targetType:"SourceProvider"},Article:{actionType:"Like"},Topic:{actionType:"Follow"}};var s,o;!function(e){e.Get="GET",e.Post="POST",e.Delete="DELETE"}(s||(s={})),function(e){e.Providers="Providers",e.ArticlesMulti="ArticlesMulti",e.Confirmation="Confirmation",e.Topics="Topics",e.Upsell="Upsell"}(o||(o={}));const a=-1},9683:function(e,t,r){"use strict";r.d(t,{_n:function(){return T}});var i=r(33940),n=r(48328),s=r(33954),o=r(26415),a=r(33799),d=r(16517),c=r(67267),l=r(63535),u=r(51671),h=r(87298);class p{constructor(e){this.fetchImpl=e,this.actionsEndpoint="./Graph/Actions",this.defaultOcid="Peregrine"}sendPostActionRequest(e,t=this.defaultOcid,r=!0){return(0,i.mG)(this,void 0,void 0,(function*(){const n=JSON.stringify(e),s={method:"POST",body:n,headers:yield c.$.getOneServiceHeaders()};(yield(0,u.hC)())&&(s.credentials="include");const o=(0,l.PH)(this.actionsEndpoint);(yield c.$.getCommonParams2(t,r)).forEach((e=>e.value&&o.searchParams.set(e.key,e.value)));return yield(0,h.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(o.href,s);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for Post request: ${o.href} with params ${JSON.stringify(s)}`;throw new Error(t)}return e}))),`postAction${n}`)}))}sendDeleteActionRequest(e,t=this.defaultOcid,r=!0){return(0,i.mG)(this,void 0,void 0,(function*(){const n=yield c.$.getBaseRequestData("DELETE");(yield(0,u.hC)())&&(n.credentials="include");let s="";const o=Object.keys(e),a=o.length;for(let t=0;t<a;t++)s+=`${o[t]} eq '${e[o[t]]}'`,t!=a-1&&a>1&&(s+=" and ");const d={key:"$filter",value:s},p=(0,l.PH)(this.actionsEndpoint);[d,...yield c.$.getCommonParams2(t,r)].forEach((e=>e.value&&p.searchParams.set(e.key,e.value)));return yield(0,h.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(p.href,n);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for Delete request: ${p.href} with params: ${JSON.stringify(n)}`;throw new Error(t)}return e}))),`deleteAction${s}`)}))}}var f=r(51125),g=r(65135),v=r(33379),y=r(791);class m extends class{constructor(e){this.fetchImpl=e,this.ocid="feeds",this.freServiceEndpoint="news/fre",this.userEndpoint="./msn/user",this.addPageInfoToOcid=!0,this.actionsClient=new p(e),"newsAndInterests"===d.jG.AppType||"windowsNewsPlus"===d.jG.AppType||"winWidgets"===d.jG.AppType?(this.addPageInfoToOcid=!1,this.ocid="winp2"):"gaming"===d.jG.AppType&&(this.addPageInfoToOcid=!1,this.ocid="startgg-feeds")}getFreArtifacts(e,t){return(0,i.mG)(this,void 0,void 0,(function*(){const r=(0,l.PH)(this.freServiceEndpoint);r.searchParams.set("bypass_trigger","true"),e&&r.searchParams.set("query",e),t&&r.searchParams.set("$top",t.toString());return[...(yield(0,u.XJ)())===a.Hy.SignedIn?c.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,this.addPageInfoToOcid):c.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,this.addPageInfoToOcid),{key:f.i$,value:Date.now().toString()}].forEach((e=>{e.value&&r.searchParams.set(e.key,e.value)})),this.getFreArtifactsWithUrl(r.href)}))}getFreArtifactsWithUrl(e){return(0,i.mG)(this,void 0,void 0,(function*(){if(!e||"-1"===e)return null;const t={method:n.Ik.Get,credentials:"include",headers:yield c.$.getOneServiceHeaders()};try{const r=yield(0,h.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){return yield this.fetchImpl(e,t)}))),"getFreArtifacts");if(!r.ok)throw Error(`[FreServiceClient.getFreArtifacts] Failed with response: ${JSON.stringify(r)}`);const n=r.headers&&r.headers.get("ddd-tmpl");return g.M0.addOrUpdateTmplString(n),r.json()}catch(e){throw s.k.logError(e.message),e}}))}setFreArtifactForUser(e,t){return(0,i.mG)(this,void 0,void 0,(function*(){if(e&&t){const r={method:t,credentials:"include",headers:yield c.$.getOneServiceHeaders()};(0,l.PH)(this.freServiceEndpoint);let n=0;try{if(n=(yield(0,h.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){return yield this.fetchImpl(e,r)}))),"setFreArtifact")).status,n>=400){const e=`OneService returned error response. Status: ${n} for done action`;throw new Error(e)}}catch(e){return s.k.logError(e.message),n}return n}return g.M0.sendAppErrorEvent(Object.assign(Object.assign({},o.G7x),{message:`Any of the required parameters was not properly set by the caller. callbackUrl: ${e} method: ${t}.`})),0}))}updateArtifactInActionsEndpoint(e,t){return(0,i.mG)(this,void 0,void 0,(function*(){let r;n.Kr[e.type]&&(r=Object.assign({},n.Kr[e.type])),r.targetId=e.id;try{t?yield this.actionsClient.sendPostActionRequest(r,this.ocid,this.addPageInfoToOcid):yield this.actionsClient.sendDeleteActionRequest(r,this.ocid,this.addPageInfoToOcid),(0,f.T1)()}catch(r){return g.M0.sendAppErrorEvent(Object.assign(Object.assign({},o.rNk),{message:"Fre Actions call failed",pb:Object.assign(Object.assign({},o.rNk.pb),{customMessage:`artifact: ${JSON.stringify(e)} following: ${t} error message: ${r}`})})),!1}return!0}))}setDoneFreState(e){return(0,i.mG)(this,void 0,void 0,(function*(){yield this.setFreState(JSON.stringify({stage:e||n.hp}),o.YVg)}))}setMaybeLaterFreState(){return(0,i.mG)(this,void 0,void 0,(function*(){yield this.setFreState(JSON.stringify({dismiss_timestamp:new Date(Date.now()).toJSON()}),o.GJW)}))}incrementUserImpression(){return(0,i.mG)(this,void 0,void 0,(function*(){let e=0;try{const t=yield this.getFreState();e=Number(t.impressionCount)||0}catch(e){if(g.M0.sendAppErrorEvent(Object.assign(Object.assign({},o.tCQ),{message:"Error getting the stored count",pb:Object.assign(Object.assign({},o.tCQ.pb),{customMessage:`${e}`})})),!(e instanceof SyntaxError))return}yield this.setFreState(JSON.stringify({impressionCount:e+1}),o.yRR)}))}getFreState(){return(0,i.mG)(this,void 0,void 0,(function*(){const e=yield y.N.getPdpUserPreference(!0),t=e&&(e.is404?{}:e.value&&e.value[0]);if(!t)throw"User object invalid or missing from response";return t.freMultiStepState?JSON.parse(t.freMultiStepState):{}}))}setFreState(e,t){return(0,i.mG)(this,void 0,void 0,(function*(){const r={method:"POST",body:JSON.stringify({freMultiStepState:e}),headers:yield c.$.getOneServiceHeaders()};(yield(0,u.XJ)())===a.Hy.SignedIn&&(r.credentials="include");const n=(0,l.PH)(this.userEndpoint);(yield c.$.getCommonParams2(this.ocid,this.addPageInfoToOcid)).forEach((e=>e.value&&n.searchParams.set(e.key,e.value)));try{yield(0,h.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(n.href,r);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for call to set user state`;throw new Error(t)}return e.json()}))),"sendFreDoneAction")}catch(r){g.M0.sendAppErrorEvent(Object.assign(Object.assign({},t),{message:"Service call to set fre state failed",pb:Object.assign(Object.assign({},t.pb),{customMessage:`state: ${e} error: ${r}`})}))}}))}getShuffleState(){return(0,i.mG)(this,void 0,void 0,(function*(){try{const e=(yield this.getFreState()).shuffle||{};e.impressionCount||(e.impressionCount=0),e.dismissTimestamp=e.dismissTimestamp?new Date(e.dismissTimestamp):null,e.impressionDates=e.impressionDates?e.impressionDates.map((e=>new Date(e))):[],e.setNumbersSeenOn||(e.setNumbersSeenOn={});for(const t in e.setNumbersSeenOn)e.setNumbersSeenOn[t]=new Date(e.setNumbersSeenOn[t]);return e}catch(e){return g.M0.sendAppErrorEvent(Object.assign(Object.assign({},o.rNk),{message:"Service call to get fre state failed",pb:Object.assign(Object.assign({},o.rNk.pb),{customMessage:e.message})})),null}}))}setShuffleState(e){return(0,i.mG)(this,void 0,void 0,(function*(){yield this.setFreState(JSON.stringify({shuffle:e}),o.pY1)}))}}{constructor(e){let t;t=e||((0,v.N)()?window.fetch.bind(window):fetch),super(t)}}let S;const T=e=>S||(S=new m(e),S)},30113:function(e,t,r){"use strict";var i;r.d(t,{m:function(){return i}}),function(e){e.small="OneByOne",e.medium="OneByTwo",e.large="OneByThree"}(i||(i={}))},11708:function(e,t,r){"use strict";var i;r.d(t,{f:function(){return i}}),function(e){e.AiCharacter="aicharacterCardEnabled",e.AutosMarketplaceCard="autosmarketplaceCardEnabled",e.HoroscopeCard="horoscopeCardEnabled",e.WeatherCard="weatherCardEnabled",e.SportsCard="sportsCardEnabled",e.MoneyCard="moneyCardEnabled",e.FinanceCard="financeCardEnabled",e.OnThisDayCard="onthisdayCardEnabled",e.ShoppingCard="shoppingCardEnabled",e.ShoppingEventCard="eventSDCardShoppingEnabled",e.TrafficCard="trafficCardEnabled",e.EsportsCard="esportsCardEnabled",e.EsportsStreamsCard="esportsStreamsCardEnabled",e.ElectionsCard="genericelectionCardEnabled",e.LotteryCard="lotteryCardEnabled",e.QnaCard="qnaCardEnabled",e.RecipesCard="recipeCardEnabled",e.InspirationCard="inspirationCardEnabled",e.TravelCard="travelCardEnabled",e.HealthCard="healthCardEnabled",e.TopStoriesCard="topstoriesCardEnabled",e.TrendingTopics="TrendingTopicsUpsellEnabled",e.LocalGuideCard="localGuideCardEnabled",e.GroceryCard="groceryCardEnabled",e.RewardsCard="rewardsCardEnabled",e.RecommendedSearchesCard="recommendedSearchesCardEnabled",e.PersonalizedOffersCard="personalizedoffersCardEnabled",e.PollsCard="pollsCardEnabled",e.MarketPlaceCard="marketplaceCardEnabled",e.QuizCard="quizCardEnabled",e.CasualGamesCard="esportsCardEnabled",e.CommuteCard="commuteCardEnabled",e.Crypto="CryptoCard",e.MarketBrief="MarketBriefCard"}(i||(i={}))},83152:function(e,t,r){"use strict";var i;r.d(t,{L:function(){return i}}),function(e){e.Location="Location",e.Weather="Weather",e.Finance="Finance",e.Team="Team",e.League="League",e.Player="Player",e.Traffic="Traffic",e.Widget="Widget",e.TopicFeed="TopicFeed"}(i||(i={}))},791:function(e,t,r){"use strict";r.d(t,{N:function(){return S}});var i=r(33940),n=r(33954),s=r(26415),o=r(68364),a=r(33799),d=r(16517),c=r(94788),l=r(67267),u=r(63535),h=r(87298),p=r(83152),f=r(11708),g=r(30113),v=r(65135),y=r(33379),m=r(51671);const S=new class extends class{constructor(e){this.fetchImpl=e,this.userUpdateEndpoint="msn/user",this.pdpServiceEndpoint="graph/actions",this.locationsServiceEndPoint="v1/news/users/me/locations",this.userActionServiceEndPoint="news/users/me/actions",this.ocid="Peregrine",this.ocidOverride=!1}getUserDefaultLocation(e){return(0,i.mG)(this,void 0,void 0,(function*(){const t={method:"GET",headers:yield l.$.getOneServiceHeaders(),credentials:"include"},r=(0,u.PH)(this.locationsServiceEndPoint);let n;[...l.$.getCommonParams2(this.ocid,!this.ocidOverride),{key:"autodetect",value:e&&`${e}`}].forEach((e=>{e.value&&r.searchParams.set(e.key,e.value)}));try{n=yield(0,h.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(r.href,t);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: getUserDefaultLocation}`;throw new Error(t)}return e}))),"getUserDefaultLocation")}catch(e){return n}return n}))}addToFavoriteLocation(e,t){return(0,i.mG)(this,void 0,void 0,(function*(){const r="Location",n="Follow",s={method:"POST",body:JSON.stringify({actionType:n,targetType:r,definitionName:t,degree:"FavoriteLocation",metaData:e}),headers:yield l.$.getOneServiceHeaders(),credentials:"include"},o=(0,u.PH)(this.pdpServiceEndpoint);let c;((yield(0,m.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&o.searchParams.set(e.key,e.value)}));try{c=yield(0,h.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(o.href,s);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: Location`;throw new Error(t)}return e.json()}))),"addToFavoriteLocation")}catch(e){return!1}return!0}))}removeFavoriteLocation(e){return(0,i.mG)(this,void 0,void 0,(function*(){return yield this.deleteFromPdp(p.L.Location,"definitionName",[e])}))}removeLocation(e){return(0,i.mG)(this,void 0,void 0,(function*(){return yield this.deleteFromPdp(p.L.Location,"definitionName",[e])}))}updatePdpHomeLocation(e,t,r={},n){return(0,i.mG)(this,void 0,void 0,(function*(){const s=p.L.Location,o="Follow",c=yield this.getRequestInit({method:"POST"},r);c.body=JSON.stringify({actionType:o,targetType:s,definitionName:t,degree:"DefaultLocation",metaData:e});const f=(0,u.PH)(this.pdpServiceEndpoint);return((yield(0,m.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth(null!=n?n:(0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth(null!=n?n:(0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&f.searchParams.set(e.key,e.value)})),yield(0,h.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(f.href,c);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: ${s}`;throw new Error(t)}return e}))),"setPdpHomeLocation"),this.tryInvalidateBulkFetchedPdpTargetType(s),!0}))}updateTrafficMyRoutes(e,t,r,s,o,a){return(0,i.mG)(this,void 0,void 0,(function*(){const d=r.replace(/[^a-zA-Z0-9\-.,_]/g,""),c=p.L.Traffic,u="Follow",f={method:"POST",body:JSON.stringify({actionType:u,targetType:c,targetId:d,degree:e,definitionName:t,metadata:s,createdDateTime:a}),headers:yield l.$.getOneServiceHeaders(),credentials:"include"},g=yield this.getTrafficPdpUrl(null,null,o);try{yield(0,h.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(g.href,f);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: ${c}`;throw new Error(t)}return e.json()}))),"updateTrafficMyRoutes");this.tryInvalidateBulkFetchedPdpTargetType(c)}catch(e){return n.k.logError(e.message),!1}return!0}))}deleteTrafficMyRoutes(e,t,r){return(0,i.mG)(this,void 0,void 0,(function*(){const n={method:"DELETE",headers:yield this.getOneserviceHeaders(),credentials:"include"},s=yield this.getTrafficPdpUrl(e,t,r);try{yield(0,h.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(s.href,n);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: ${p.L.Traffic}`;throw new Error(t)}return e}))),"deleteTrafficFromPdp"),this.tryInvalidateBulkFetchedPdpTargetType(p.L.Traffic)}catch(e){return!1}return!0}))}getTrafficMyRoutes(e,t){var r;return(0,i.mG)(this,void 0,void 0,(function*(){const n={method:"GET",headers:yield this.getOneserviceHeaders(),credentials:"include"},s=yield this.getTrafficPdpUrl(e,null,t);try{const e=yield(0,h.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(s.href,n);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: ${p.L.Traffic}`;throw new Error(t)}return e}))),"getTrafficFromPdp");return null===(r=yield e.json())||void 0===r?void 0:r.value}catch(e){return null}}))}getTrafficPdpUrl(e,t,r){return(0,i.mG)(this,void 0,void 0,(function*(){const i=(0,u.PH)(this.pdpServiceEndpoint),n=(yield(0,m.XJ)())===a.Hy.SignedIn,s=(0,d.Yq)().UserId,o=n?l.$.getOneServiceParamsWithAuth(s,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth(s,this.ocid,!this.ocidOverride);if(e||t){const r=`targetType eq '${p.L.Traffic}'`,n=e?`degree eq '${e}'`:"",s=t?`definitionName eq '${t}'`:"";i.searchParams.set("$filter",`actionType eq 'Follow' and (${r})${n?` and (${n})`:""}${s?` and (${s})`:""}`)}return[...o,...r||[]].forEach((e=>{e.value&&i.searchParams.set(e.key,e.value)})),i}))}addToWatchList(e,t=0,r={},n={}){return(0,i.mG)(this,void 0,void 0,(function*(){const s=p.L.Finance,o="Follow",c={method:"POST",body:JSON.stringify({actionType:o,targetType:s,targetId:e,metadata:Object.assign({securityType:t,tickerId:this.generateUUID()},n)}),headers:yield this.getOneserviceHeaders(r),credentials:"include"},f=(0,u.PH)(this.pdpServiceEndpoint),g="zh-cn"!==(0,d.Yq)().CurrentMarket;let v;((yield(0,m.XJ)())===a.Hy.SignedIn&&g?l.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&f.searchParams.set(e.key,e.value)}));try{v=yield(0,h.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(f.href,c);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: ${s}`;throw new Error(t)}return e.json()}))),"addToWatchList"),this.tryInvalidateBulkFetchedPdpTargetType(s)}catch(e){return!1}return!0}))}addListToWatchList(e,t={},r={}){return(0,i.mG)(this,void 0,void 0,(function*(){const n=p.L.Finance,s="Follow",o={method:"POST",body:JSON.stringify(e.map((e=>({actionType:s,targetType:n,targetId:e.key,metadata:Object.assign({securityType:e.value,tickerId:this.generateUUID()},r)})))),headers:yield this.getOneserviceHeaders(t),credentials:"include"},c=(0,u.PH)(this.pdpServiceEndpoint),f="zh-cn"!==(0,d.Yq)().CurrentMarket;let g;((yield(0,m.XJ)())===a.Hy.SignedIn&&f?l.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&c.searchParams.set(e.key,e.value)}));try{g=yield(0,h.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(c.href,o);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: ${n}`;throw new Error(t)}return e.json()}))),"addToWatchList"),this.tryInvalidateBulkFetchedPdpTargetType(n)}catch(e){return!1}return!0}))}generateUUID(){let e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){const r=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?r:3&r|8).toString(16)}))}sortWatchList(e,t={}){var r;return(0,i.mG)(this,void 0,void 0,(function*(){const n=p.L.Finance,s="Follow",o=yield S.readPdpWithTargetType(p.L.Finance,!0,200,t),c=o&&(null===(r=o.value)||void 0===r?void 0:r.filter((e=>e.actionType===s&&e.targetId)));if(!c||c.length<e.length)return!1;const f={};let g=e.length;c.forEach((t=>{let r=e.findIndex((e=>e===t.targetId));r<0&&(r=g,g++),f[t.targetId]=JSON.stringify({actionType:s,targetId:t.targetId,targetType:n,rank:r,metadata:t.metadata})}));const v={method:"PUT",body:JSON.stringify(f),headers:yield this.getOneserviceHeaders(t),credentials:"include"},y=(0,u.PH)(this.pdpServiceEndpoint);((yield(0,m.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&y.searchParams.set(e.key,e.value)}));try{yield(0,h.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(y.href,v);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for actionType: Follow, targetType: ${n}`;throw new Error(t)}return e.json()}))),"sortWatchList"),this.tryInvalidateBulkFetchedPdpTargetType(p.L.Finance)}catch(e){return!1}return!0}))}updateWeatherInterests(e,t,r,s={},o){return(0,i.mG)(this,void 0,void 0,(function*(){const t=p.L.Weather,i={method:"POST",body:JSON.stringify({actionType:"Follow",targetType:t,targetId:e,metadata:{UserAction:{0:{UpdateTime:new Date,Location:r}}}}),headers:yield this.getOneserviceHeaders(s),credentials:"include"},c=(0,u.PH)(this.pdpServiceEndpoint);((yield(0,m.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth(null!=o?o:(0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth(null!=o?o:(0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&c.searchParams.set(e.key,e.value)}));try{const e=yield this.fetchImpl(c.href,i);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for update weather interests call`;throw new Error(t)}}catch(e){return n.k.logError(e.message),!1}return!0}))}updateWeatherSettings(e,t,r={},n){return(0,i.mG)(this,void 0,void 0,(function*(){if(!e&&!t)return!0;let i="";i=e&&!t?'{"weatherDisplayUnit":"'+e+'"}':!e&&t?'{"userSettings":{"weatherLocationSettingMode":"'+t+'"}}':'{"weatherDisplayUnit":"'+e+'","userSettings":{"weatherLocationSettingMode":"'+t+'"}}';const s=yield this.getRequestInit({method:"POST"},r);s.body=i;const o=(0,u.PH)(this.userUpdateEndpoint);((yield(0,m.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth(null!=n?n:(0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth(null!=n?n:(0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&o.searchParams.set(e.key,e.value)}));const c=yield this.fetchImpl(o.href,s);if(c.status>=400){const e=`OneService returned error response. Status: ${c.status} for update weather setting call`;throw new Error(e)}return!0}))}updateFinanceInterests(e){return(0,i.mG)(this,void 0,void 0,(function*(){if(!e)return!1;const t={financeInterests:e},r=JSON.stringify(t),i=yield this.getRequestInit({method:"POST"});i.body=r;const n=(0,u.PH)(this.userUpdateEndpoint),s="zh-cn"!==(0,d.Yq)().CurrentMarket;((yield(0,m.XJ)())===a.Hy.SignedIn&&s?l.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&n.searchParams.set(e.key,e.value)}));const o=yield this.fetchImpl(n.href,i);if(o.status>=400){const e=`OneService returned error response. Status: ${o.status} for update finance interests call`;throw new Error(e)}return!0}))}updateUserSettings(e,t={},r){return(0,i.mG)(this,void 0,void 0,(function*(){if(!e)return!0;const i=[];let s;for(s in e)null!=e[s]&&i.push('"'+s+'": '+JSON.stringify(e[s]));const o='{"userSettings":{'+i.join(", ")+"}}",c=yield this.getRequestInit({method:"POST"},t);c.body=o;const h=(0,u.PH)(this.userUpdateEndpoint);((yield(0,m.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth(null!=r?r:(0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth(null!=r?r:(0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&h.searchParams.set(e.key,e.value)}));try{const e=yield this.fetchImpl(h.href,c);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for update weather setting call`;throw new Error(t)}}catch(e){return n.k.logError(e.message),!1}return!0}))}getPdpUserPreference(e,t={},r){return(0,i.mG)(this,void 0,void 0,(function*(){const s=yield this.getRequestInit({method:"GET"},t),o=(0,u.PH)(this.userUpdateEndpoint);[...(yield(0,m.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth(r||(0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth(r||(0,d.Yq)().UserId,this.ocid,!this.ocidOverride)].forEach((e=>{e.value&&o.searchParams.set(e.key,e.value)}));try{const e=yield(0,h.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(o.href,s);if(!e.ok){if(e.status>=400&&e.status<500&&408!=e.status)return e;throw Error(e.statusText)}return e}))),"readPDPData");if(!e.ok&&404!=e.status)throw Error(`code=${e.status}, ${e.statusText}`);return Object.assign(Object.assign({},yield e.json()),{is404:404==e.status})}catch(t){if(n.k.logError(t.message),e)throw Error(t.message);return null}}))}updatePdpLayoutPreference(e){return(0,i.mG)(this,void 0,void 0,(function*(){const t={method:"PUT",credentials:"include",body:JSON.stringify({dummyid:{userLayoutPreference:e}})},r=(0,u.PH)(this.userUpdateEndpoint);((yield(0,m.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&r.searchParams.set(e.key,e.value)}));try{const e=yield this.fetchImpl(r.href,t);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for update layout preference setting call`;throw new Error(t)}}catch(e){return n.k.logError(e.message),!1}return!0}))}updateSegmentCardsEnableStatus(e,t=null){return(0,i.mG)(this,void 0,void 0,(function*(){if(!e&&!e.length)return!0;const r=[];if(t){let e;for(e in t)null!=t[e]&&r.push('"'+e+'": '+JSON.stringify(t[e]))}const i=e.map((e=>e.cardType!=f.f.TopStoriesCard?`\\"${e.cardType}\\":${e.enabled?'\\"1\\"':'\\"0\\"'}`:"")).join(","),n=r.length>0?'{"segmentCardSettings":"{'+i+'}","userSettings":{'+r.join(", ")+"}}":'{"segmentCardSettings":"{'+i+'}"}';return this.updateUserPreference(n)}))}updateProductivityCardsEnableStatus(e){return(0,i.mG)(this,void 0,void 0,(function*(){if(!e&&!e.length)return!0;const t=`{userSettings:{enterpriseCardsEnabled:"{${e.map((e=>`\\"is${e.cardType}Enabled\\":${e.enabled?"true":"false"}`)).join(",")}}"}}`;return this.updateUserPreference(t)}))}updateGamingCardsEnableStatus(e){return(0,i.mG)(this,void 0,void 0,(function*(){if(!e&&!e.length)return!0;const t=`{userSettings:{gamingCards:"{${e.map((e=>`\\"is${e.cardType}Enabled\\":${e.enabled?"true":"false"}`)).join(",")}}"}}`;return this.updateUserPreference(t)}))}updateCommunitySettingsOptOutStatus(e){return(0,i.mG)(this,void 0,void 0,(function*(){if(!e&&!e.length)return!0;const t={};e.forEach((e=>{t[e.settingType]=e.optedOut?"1":"0"}));const r={communitySettings:t};return this.updateUserPreference(JSON.stringify(r))}))}updateWidgetSettings(e,t={},r){return(0,i.mG)(this,void 0,void 0,(function*(){if(!e)return!1;const i=e.map((e=>({actionType:"Follow",targetId:e.cardType,targetType:p.L.Widget,metadata:{prongsv2:{region:e.region,size:g.m[e.size],position:e.position}}})));return this.sendGenericActionRequest({additionalHeaders:t,endpoint:this.pdpServiceEndpoint,method:"POST",payload:JSON.stringify(i),appError:r})}))}muteWidget(e,t={},r){return(0,i.mG)(this,void 0,void 0,(function*(){if(!e||!e.length)return!1;const i=e.map((e=>({actionType:"Mute",targetId:e,targetType:p.L.Widget})));return this.sendGenericActionRequest({additionalHeaders:t,endpoint:this.pdpServiceEndpoint,method:"POST",payload:JSON.stringify(i),appError:r})}))}disableSpotlightCard(e,t){return(0,i.mG)(this,void 0,void 0,(function*(){if(!e)return!1;const r={actionType:"Disabled",definitionName:e,targetType:p.L.TopicFeed};return this.sendGenericActionRequest({endpoint:this.pdpServiceEndpoint,method:"POST",payload:JSON.stringify(r),appError:t})}))}enableSpotlightCard(e,t){return(0,i.mG)(this,void 0,void 0,(function*(){return!!e&&(yield this.deleteFromPdp(p.L.TopicFeed,"definitionName",[e],{},void 0,"Disabled",t))}))}sendGenericActionRequest(e){return(0,i.mG)(this,void 0,void 0,(function*(){const{additionalHeaders:t,additionalParams:r,endpoint:n,method:s,payload:o,appError:c}=e;if(!n||!s)return this.logError(new Error("Missing arguments: 'endpoint' and 'method' should be provided and valid"),c),!1;const p=(0,u.PH)(n);let f;((yield(0,m.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&p.searchParams.set(e.key,e.value)})),r&&r.forEach((e=>{e.value&&p.searchParams.set(e.key,e.value)}));try{JSON.parse(o),f=o}catch(e){f=JSON.stringify(o)}const g={method:s,body:f,headers:yield this.getOneserviceHeaders(t),credentials:"include"},v="GET"==s;try{return yield(0,h.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(p.href,g);if(e.status>=400){const t=`OneService returned error response. Status: ${e.status} for payload: ${o}`;throw new Error(t)}return!v||(yield e.json())}))),"sendActions")}catch(e){return this.logError(e,c),!1}}))}getUserActions(e){return(0,i.mG)(this,void 0,void 0,(function*(){const t=[{key:"actionType",value:e}],r=yield this.sendGenericActionRequest({additionalParams:t,endpoint:this.userActionServiceEndPoint,method:"GET"});return r&&r.value}))}setUserAction(e,t){return(0,i.mG)(this,void 0,void 0,(function*(){return!!(yield this.sendGenericActionRequest({endpoint:this.userActionServiceEndPoint,method:"POST",payload:Object.assign({actionType:e},t)}))}))}deleteUserAction(e,t){return(0,i.mG)(this,void 0,void 0,(function*(){const r=[{key:"actionType",value:e},{key:"targetId",value:t.targetId},{key:"definitionName",value:t.definitionName}];return!!(yield this.sendGenericActionRequest({additionalParams:r,endpoint:this.userActionServiceEndPoint,method:"DELETE"}))}))}updateUserPreference(e){return(0,i.mG)(this,void 0,void 0,(function*(){const t=yield this.getRequestInit({method:"POST"});t.body=e;const r=(0,u.PH)(this.userUpdateEndpoint);((yield(0,m.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&r.searchParams.set(e.key,e.value)}));try{const i=yield this.fetchImpl(r.href,t);if(i.status>=400){const t=`OneService returned error response while updating user preference. Status: ${i.status}, payload: ${e}`;throw new Error(t)}}catch(e){return!1}return!0}))}setPdpTargetTypesForBulkLoad(e){e&&e.length&&!this.bulkGraphActionTargetTypes&&(this.bulkGraphActionTargetTypes=e)}readPdpWithTargetType(e,t=!1,r,n={},o=!0,a=[]){return(0,i.mG)(this,void 0,void 0,(function*(){if(o){const t=yield this.getFromWebWorker(e);if(t)return t}if(this.bulkGraphActionTargetTypes&&this.bulkGraphActionTargetTypes.length)if(this.bulkGraphActionTargetTypes.indexOf(e)>=0){this.bulkGraphActionResultCache=this.bulkGraphActionResultCache||(yield this.bulkGraphActionPromise||(this.bulkGraphActionPromise=this.fetchPdpWithTargetTypes(this.bulkGraphActionTargetTypes,t,r,n,a)));const i=this.bulkGraphActionResultCache.get(e);if(i)return{value:i}}else v.M0.sendAppErrorEvent(Object.assign(Object.assign({},s.srQ),{message:`Received an unknown target type "${e}" that was not in the bulk graph action target types list "${this.bulkGraphActionTargetTypes}". Falling back to new network call. Please update the EntryPoint config's "graphActionsToBulkLoad" property to include this type.`}));const i=(yield this.fetchPdpWithTargetTypes([e],t,r,n,a)).get(e);if(i)return{value:i}}))}deleteFromPdp(e,t,r,n={},s,o="Follow",c,p=[]){return(0,i.mG)(this,void 0,void 0,(function*(){const f={method:"DELETE",headers:yield this.getOneserviceHeaders(n),credentials:"include"},g=(0,u.PH)(this.pdpServiceEndpoint),y=(yield(0,m.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride),S=`targetType eq '${e}'`,T=r.map((e=>`${t} eq '${e}'`)).join(" or ");let w=`actionType eq '${o}' and (${T}) and (${S})`;s&&(w+=` and (degree eq '${s}')`),g.searchParams.set("$filter",w),[...y,...p].forEach((e=>{e.value&&g.searchParams.set(e.key,e.value)}));try{yield(0,h.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const t=yield this.fetchImpl(g.href,f);if(t.status>=400){const r=`OneService returned error response. Status: ${t.status} for actionType: ${o}, targetType: ${e}`;throw new Error(r)}return t}))),"deleteFromPdp"),this.tryInvalidateBulkFetchedPdpTargetType(e)}catch(e){return c&&v.M0.sendAppErrorEvent(Object.assign(Object.assign({},c),{pb:Object.assign(Object.assign({},c.pb),{actionType:o,error:e.message})})),!1}return!0}))}tryInvalidateBulkFetchedPdpTargetType(e){this.bulkGraphActionResultCache&&this.bulkGraphActionResultCache.delete(e)}fetchPdpWithTargetTypes(e,t=!1,r,n={},s=[]){return(0,i.mG)(this,void 0,void 0,(function*(){if(!e.length)return new Map;const o=e.map((e=>`targetType eq '${e}'`)).join(" or "),c=[{key:"$top",value:`${r=r||10*e.length*2}`},{key:"$filter",value:`actionType eq 'Follow' and (${o})`}],p=yield this.getRequestInit({method:"GET"},n);!0===t&&(p.cache="no-store");const f=(0,u.PH)(this.pdpServiceEndpoint);[...c,...(yield(0,m.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride),...s].forEach((e=>{e.value&&f.searchParams.set(e.key,e.value)}));const g=yield(0,h.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(f.href,p);if(!e.ok){if(e.status>=400&&e.status<500&&408!=e.status)return e;throw Error(e.statusText)}return e}))),"readPDPData");if(!g.ok)throw Error(`code=${g.status}, ${g.statusText}`);const v=new Map,y=yield g.json();if(!y)return v;if(y.value)for(const e of y.value){let t=v.get(e.targetType);t||v.set(e.targetType,t=[]),t.push(e)}for(const t of e)v.get(t)||v.set(t,[]);return v}))}updateMarketPreference(e){return(0,i.mG)(this,void 0,void 0,(function*(){const t={method:"POST",credentials:"include",body:JSON.stringify({userSettings:{preferredMarket:e}})},r=(0,u.PH)(this.userUpdateEndpoint);((yield(0,m.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&r.searchParams.set(e.key,e.value)}));try{const e=yield this.fetchImpl(r.href,t);if(!e.ok)throw new Error(`Failed to update market preference: Status: ${e.status}`);return!0}catch(e){return n.k.logError(e.message),!1}}))}getFromWebWorker(e){return(0,i.mG)(this,void 0,void 0,(function*(){let t=null;if(c.yb){const r=this.maptoWebWorkerId(e);if(r&&r.trim()){const r=yield(0,c.ot)({id:this.maptoWebWorkerId(e)});r.fetched&&(t=r.payload)}}return t}))}maptoWebWorkerId(e){switch(e){case p.L.Location:return"weatherpdp";case p.L.League:return"sportsleaguepdp";case p.L.Player:return"sportsplayerpdp";case p.L.Team:return"sportsteampdp";case p.L.Finance:return"moneypdp";default:return""}}getRequestInit(e={method:"GET"},t={}){return(0,i.mG)(this,void 0,void 0,(function*(){const r=yield l.$.getOneServiceHeaders();return e.headers=Object.assign(Object.assign({},r),t),e.credentials="include",e}))}getOneserviceHeaders(e={}){return(0,i.mG)(this,void 0,void 0,(function*(){const t=yield l.$.getOneServiceHeaders();return Object.assign(Object.assign({},t),e)}))}getFollowedLists(){return(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.getRequestInit({method:"GET"}),t=(0,u.PH)(this.userUpdateEndpoint);[...(yield(0,m.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)].forEach((e=>{e.value&&t.searchParams.set(e.key,e.value)}));try{const r=yield(0,h.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const r=yield this.fetchImpl(t.href,e);if(!r.ok){if(r.status>=400&&r.status<500&&408!=r.status)return r;(0,o.OO)(null,s.G9t,"Error get followed list")}return r}))),"getFollowedLists");return r.ok||(0,o.OO)(null,s.G9t,"Error get followed list"),yield r.json()}catch(e){return n.k.logError(e.message),null}}))}addToFollowedLists(e){return(0,i.mG)(this,void 0,void 0,(function*(){const t=p.L.Finance,r={method:"POST",body:JSON.stringify({financeListIds:e}),headers:yield l.$.getOneServiceHeaders(),credentials:"include"},n=(0,u.PH)(this.userUpdateEndpoint);let s;((yield(0,m.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride)).forEach((e=>{e.value&&n.searchParams.set(e.key,e.value)}));try{s=yield(0,h.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(n.href,r);if(e.status>=400){const r=`OneService returned error response. Status: ${e.status} for actionType: FollowList, targetType: ${t}`;throw new Error(r)}return e.json()}))),"addToFollowedLists")}catch(e){return!1}return!0}))}deleteFromFollowedLists(e){return(0,i.mG)(this,void 0,void 0,(function*(){const t=p.L.Finance,r={method:"DELETE",body:null,headers:yield l.$.getOneServiceHeaders(),credentials:"include"},n=(0,u.PH)(this.userUpdateEndpoint);let s;[...(yield(0,m.XJ)())===a.Hy.SignedIn?l.$.getOneServiceParamsWithAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride):l.$.getOneServiceParamsWithoutAuth((0,d.Yq)().UserId,this.ocid,!this.ocidOverride),...[{key:"financeListIds",value:e.toString()}]].forEach((e=>{e.value&&n.searchParams.set(e.key,e.value)}));try{s=yield(0,h.w)((()=>(0,i.mG)(this,void 0,void 0,(function*(){const e=yield this.fetchImpl(n.href,r);if(e.status>=400){const r=`OneService returned error response. Status: ${e.status} for actionType: UnFollowList, targetType: ${t}`;throw new Error(r)}return e.json()}))),"deleteFromFollowedLists")}catch(e){return!1}return!0}))}logError(e,t){t?v.M0.sendAppErrorEvent(Object.assign(Object.assign({},t),{pb:Object.assign(Object.assign({},t.pb),{error:e.message})})):n.k.logError(e.message)}}{constructor(){super((0,y.N)()?window.fetch.bind(window):fetch),"windowsNewsPlus"===d.jG.AppType||"newsAndInterests"===d.jG.AppType||"winWidgets"===d.jG.AppType?(this.ocid="winp2",this.ocidOverride=!0):"sharedWidgets"===d.jG.AppType?(this.ocid="hpwidget",this.ocidOverride=!0):"windowsNewsbar"===d.jG.AppType?(this.ocid="winp0dash",this.ocidOverride=!0):"travel"===d.jG.AppType?(this.ocid="travel-verthp-feeds",this.ocidOverride=!0):"gaming"===d.jG.AppType&&(this.ocid="startgg-feeds",this.ocidOverride=!0)}}},66925:function(e,t,r){"use strict";r.d(t,{h:function(){return o}});var i=r(65135),n=r(68364),s=r(26415);class o{static renderToast(e){this.renderToastCallback?this.renderToastCallback(e):i.M0.sendAppErrorEvent((0,n.Tr)(s.PMq,"Undefined toast render callback function"))}static setRenderToastCallback(e){this.renderToastCallback=e,this.readyResolveFn()}static expireToast(e){this.expireToastCallback?this.expireToastCallback(e):i.M0.sendAppErrorEvent((0,n.Tr)(s.hxo,"Undefined toast expire callback function"))}static setExpireToastCallback(e){this.expireToastCallback=e}static setCurrentToast(e,t){this.currentToastId!==e&&(this.currentToastId=e,this.renderToastCallback=t,this.currentToastIdChangeCallbacks.forEach((t=>t(e))),this.renderToast())}static addCurrentToastIdChangeCallback(e){e&&this.currentToastIdChangeCallbacks.push(e)}}o.ready=new Promise((e=>o.readyResolveFn=e)),o.currentToastIdChangeCallbacks=[]},85334:function(e,t,r){"use strict";var i;r.d(t,{p:function(){return i}}),function(e){e.Save="Save",e.Unsave="Unsave",e.Mute="Mute",e.Follow="Follow",e.Unfollow="Unfollow",e.InterestFailure="InterestFailure",e.ShowMore="ShowMore",e.ShowFewer="ShowFewer",e.Hide="Hide",e.DisableNotification="DisableNotification",e.EnableNotification="EnableNotification",e.RecommendedInterestsFailure="RecommendedInterestsFailure",e.Refresh="Refresh",e.Pin="Pin",e.Unpin="Unpin",e.HideTopic="HideTopic",e.UnhideTopic="UnhideTopic",e.HideSource="HideSource",e.UnhideSource="UnhideSource",e.WindowsInformation="WindowsInformation",e.Error="Error",e.Default="Default",e.ConnectionError="ConnectionError",e.Fre="Fre",e.TuneYourFeed="TuneYourFeed"}(i||(i={}))},99478:function(e,t,r){"use strict";function i(e,...t){return e.replace(/{(\d+)}/g,(function(e,r){if(r>=t.length)return e;const i=t[r];return"number"==typeof i||i?i:""}))}function n(e){return!e||!e.trim()}r.d(t,{TF:function(){return n},WU:function(){return i}})},70146:function(e){e.exports='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M12.48 18.3c-.8.83-2.09.38-2.43-.6-.28-.8-.64-1.77-1-2.48C8 13.1 7.38 11.9 5.67 10.37c-.23-.2-.52-.36-.84-.49-1.13-.44-2.2-1.61-1.91-3l.35-1.77a2.5 2.5 0 011.8-1.92l5.6-1.53a4.5 4.5 0 015.6 3.54l.69 3.76A3 3 0 0114 12.5h-.89l.01.05c.08.41.18.97.24 1.58.07.62.1 1.29.05 1.92a3.68 3.68 0 01-.5 1.73c-.11.16-.27.35-.44.52z"></path></svg>'},92572:function(e){e.exports='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10.05 17.7c.34.98 1.63 1.43 2.43.6.17-.17.33-.36.44-.52.32-.48.45-1.12.5-1.73.05-.63.02-1.3-.05-1.92-.06-.6-.16-1.17-.24-1.58v-.05H14a3 3 0 002.95-3.54l-.69-3.76a4.5 4.5 0 00-5.6-3.54L5.06 3.2c-.92.25-1.62 1-1.8 1.92l-.35 1.77c-.28 1.39.78 2.56 1.9 3 .33.13.62.3.85.5 1.7 1.5 2.32 2.72 3.38 4.84.36.71.72 1.68 1 2.49zm1.97-5.58v.04a14.2 14.2 0 01.36 2.08c.06.58.09 1.18.04 1.73-.04.55-.15.98-.33 1.25-.06.1-.18.22-.33.39-.2.2-.63.16-.76-.23-.29-.82-.67-1.83-1.05-2.6-1.07-2.14-1.76-3.5-3.62-5.15-.34-.3-.74-.52-1.13-.68-.88-.34-1.45-1.14-1.3-1.87l.35-1.77c.11-.56.53-1 1.08-1.15l5.6-1.53a3.5 3.5 0 014.36 2.75l.68 3.76a2 2 0 01-1.96 2.36h-1.5a.5.5 0 00-.5.62z"></path></svg>'},88898:function(e){e.exports='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M12.48 1.7c-.8-.83-2.09-.38-2.43.6-.28.8-.64 1.77-1 2.48C8 6.9 7.38 8.1 5.67 9.63c-.23.2-.52.36-.84.49-1.13.44-2.2 1.61-1.91 3l.35 1.77a2.5 2.5 0 001.8 1.92l5.6 1.52a4.5 4.5 0 005.6-3.53l.69-3.76A3 3 0 0014 7.5h-.89l.01-.05c.08-.41.18-.97.24-1.59.07-.6.1-1.28.05-1.9a3.68 3.68 0 00-.5-1.74 4.16 4.16 0 00-.44-.52z"></path></svg>'},86775:function(e){e.exports='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10.05 2.3c.34-.98 1.63-1.43 2.43-.6.17.17.33.36.44.52.32.48.45 1.12.5 1.73.05.63.02 1.3-.05 1.91-.06.62-.16 1.18-.24 1.59v.05H14a3 3 0 012.95 3.54l-.69 3.76a4.5 4.5 0 01-5.6 3.53l-5.6-1.52a2.5 2.5 0 01-1.8-1.92l-.35-1.77c-.28-1.39.78-2.56 1.9-3 .33-.13.62-.3.85-.5 1.7-1.5 2.32-2.72 3.38-4.84.36-.71.72-1.68 1-2.49zm1.97 5.58v-.04a13.7 13.7 0 00.13-.58c.08-.4.17-.93.23-1.5.06-.58.09-1.18.04-1.73a2.73 2.73 0 00-.33-1.25 3.26 3.26 0 00-.33-.39c-.2-.2-.63-.16-.76.23-.29.82-.67 1.83-1.05 2.6-1.07 2.14-1.76 3.5-3.62 5.15-.34.3-.74.52-1.13.68-.88.34-1.45 1.14-1.3 1.87l.35 1.77c.11.56.53 1 1.08 1.15l5.6 1.53c1.98.54 4-.73 4.36-2.75l.68-3.76a2 2 0 00-1.96-2.36h-1.5a.5.5 0 01-.5-.62z"></path></svg>'}}]);A
Eo