(globalThis["TURBOPACK_remote_chunk_loading_global_wx-next-web"]||(globalThis["TURBOPACK_remote_chunk_loading_global_wx-next-web"]=[])).push(["object"==typeof document?document.currentScript:void 0,806262,e=>{"use strict";e.i(247865);var t=e.i(546446);e.i(284007),e.i(981030);let r=new WeakMap;e.s(["useHydrateAtoms",0,function(e,i){var a;let n,s=(0,t.useStore)(i),o=(a=s,(n=r.get(a))||(n=new WeakSet,r.set(a,n)),n);for(let[t,...r]of e)(!o.has(t)||(null==i?void 0:i.dangerouslyForceHydrate))&&(o.add(t),s.set(t,...r))}])},990033,e=>{"use strict";let t,r="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),i=new Uint8Array(16),a=[];for(let e=0;e= 16");if(c[6]=15&c[6]|64,c[8]=63&c[8]|128,n){if((u=u||0)n.length)throw RangeError(`UUID byte range ${u}:${u+15} is out of buffer bounds`);for(let e=0;e{"use strict";let t=(0,e.i(981030).atom)("");e.s(["adsMetricsUnitAndZoneAtom",0,t])},604323,e=>{"use strict";let t=(0,e.i(981030).atom)();e.s(["metricsArticleDataAtom",0,t])},513539,e=>{"use strict";var t=e.i(981030);let r=(0,t.atom)(null),i=(0,t.atom)(null);e.s(["activeEventAtom",0,i,"layoutStateAtom",0,r])},236433,e=>{"use strict";let t=(0,e.i(981030).atom)(null);e.s(["pageAtomsPathnameAtom",0,t])},529603,e=>{"use strict";let t=null,r=null,i=e=>{if(t&&e.event.context){let i={...t,...r};e.event.context.traits=e.event.userId?{...i,twcId:String(e.event.userId)}:i}return e};e.s(["setPluginTraits",0,e=>{t=e},"setSignInTraits",0,e=>{r=e},"traitsPlugin",0,{name:"traits-plugin",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:i,page:i}])},658547,e=>{"use strict";var t=e.i(247865),r=e.i(839315),i=e.i(491240);let a=(e,t)=>{let i,a=Date.now()+2e3;return(i=!1,Promise.race([new Promise(e=>{let t=()=>{if(!i){if(window.mParticle?.ready)return void window.mParticle.ready(()=>e());setTimeout(t,50)}};t()}),new Promise((e,t)=>{setTimeout(()=>{t(Error("MParticle did not become ready in time"))},2e3)})]).finally(()=>{i=!0})).then(()=>new Promise(i=>{let n=setTimeout(i,Math.max(0,a-Date.now()));window.mParticle?.Identity?.[e]?.(t,e=>{clearTimeout(n);let t=e?.getUser?.()?.getMPID?.();t&&(0,r.setStoredmParticleId)(t),i()})}))};e.s(["useUserIdentity",0,()=>{let e=(0,t.useCallback)(e=>a("identify",{userIdentities:{customerid:e.customerid,email:e.email,other:(0,i.truncateIdentityValue)(e.other)}}),[]);return{identify:e,login:(0,t.useCallback)(e=>a("login",{userIdentities:{customerid:e.customerid,email:e.email,facebook:e.facebook,facebookcustomaudienceid:e.facebookcustomaudienceid,google:e.google,microsoft:e.microsoft,other:(0,i.truncateIdentityValue)(e.other),other2:(0,i.truncateIdentityValue)(e.other2),other3:(0,i.truncateIdentityValue)(e.other3),other4:(0,i.truncateIdentityValue)(e.other4),twitter:e.twitter,yahoo:e.yahoo}}),[]),logout:(0,t.useCallback)(()=>a("logout",{userIdentities:{}}),[])}}])},491240,e=>{"use strict";let t=(0,e.i(695881).createLogger)("MParticleIdentity");e.s(["truncateIdentityValue",0,e=>"string"==typeof e&&e.length>256?(t.warn(`identity value exceeded 256 chars (${e.length}); truncating`),e.slice(0,256)):e])},671525,e=>{"use strict";var t=e.i(725287);let r=()=>{let e=(0,t.useRouter)();return{navigate:(t,r={})=>{let{mpa:i=!0,replace:a=!1}=r;i?a?window.location.replace(t):window.location.href=t:a?e.replace(t):e.push(t)},refresh:(t={})=>{let{mpa:r=!0}=t;r?window.location.reload():e.refresh()},router:e}};e.s(["default",0,r,"usePageNavigation",0,r])},725296,e=>{"use strict";var t,r=e.i(965586),i=((t={}).CA="ca",t.CA_QC="ca-qc",t.EXEMPT="exempt",t.GDPR="gdpr",t.JP="jp",t.KR="kr",t.LATAM_CO="latam-co",t.LATAM_DO="latam-do",t.LATAM_PE="latam-pe",t.LGPD="lgpd",t.PIPL="pipl",t.TR_KVKK="tr-kvkk",t.USA="usa",t.USA_CCPA="usa-ccpa",t.USA_CO="usa-co",t.USA_CT="usa-ct",t.USA_VA="usa-va",t);Object.values(i);let a={"usa-ut":"usa"},n=e=>e?a[e]??e:void 0;e.s(["RESTRICTIVE_REGIMES",0,["ca-qc","gdpr","latam-co","latam-do","latam-pe","lgpd","pipl","tr-kvkk"],"Regime",()=>i,"US_REGIMES",0,["usa","usa-ccpa","usa-co","usa-ct","usa-va"],"default",0,i,"getRegime",0,()=>(()=>{let e=(0,r.getCookie)("ci")?.toString();if(e)for(let t of e.split("&")){let e=t.indexOf("=");if(e>-1&&"TWC-Privacy"===t.slice(0,e))return n(t.slice(e+1))}})()??n((0,r.getCookie)("twc-privacy")?.toString())??"exempt"])},617874,e=>{"use strict";let t="Imperial",r="Metric",i="Hybrid",a={code:"e",name:t,temp:"F",speed:"mph",distance:"mi",accumulation:"in",precip:"in",pressure:"in"},n={code:"m",name:r,temp:"C",speed:"km/h",distance:"km",accumulation:"cm",precip:"mm",pressure:"mb"},s={code:"h",name:i,temp:"C",speed:"mph",distance:"mi",accumulation:"in",precip:"in",pressure:"mb"};e.s(["UNITS_COOKIE_KEY",0,"unitOfMeasurement","UNIT_HYBRID",0,i,"UNIT_IMPERIAL",0,t,"UNIT_METRIC",0,r,"imperial",0,a,"unitsSystemByCode",0,function(e){switch(e?.toLowerCase()){case"e":case"f":return a;case"m":case"c":return n;case"h":return s;default:return null}},"unitsSystemByName",0,function(e=""){switch(e.toLowerCase()){case"imperial":case"Imperial":return a;case"metric":case"Metric":return n;case"hybrid":case"Hybrid":return s;default:return null}}])},756227,e=>{"use strict";var t=e.i(546446),r=e.i(284007),i=e.i(889753),a=e.i(905059),n=e.i(310847),s=e.i(960576),o=e.i(317298),u=e.i(839315),c=e.i(391174),l=e.i(735526),d=e.i(90543),m=e.i(529603);e.s(["useResetAuthState",0,function(){let e=(0,t.useSetAtom)(i.userProfileAtom),p=(0,t.useSetAtom)(n.wxuUserAccountUserAccountResponseAtom),f=(0,t.useSetAtom)(a.mapLayerOrderAtom);return()=>{(0,c.invalidateUpsxCache)(),(0,o.clearNextSessionIntent)(),e(r.RESET),p(null),f(r.RESET),(0,s.clearEarlyAnonId)(),(0,l.clearAccountCreated)(),(0,m.setSignInTraits)(null),(0,u.clearStoredmParticleId)(),(0,d.bumpAuthEpoch)()}}])},735526,e=>{"use strict";let t="wx-next/account-created";e.s(["clearAccountCreated",0,function(){try{sessionStorage.removeItem(t)}catch{}},"markAccountCreated",0,function(){try{sessionStorage.setItem(t,"true")}catch{}},"wasAccountCreated",0,function(){try{return"true"===sessionStorage.getItem(t)}catch{return!1}}])},90543,e=>{"use strict";var t=e.i(521350);let r="wxu-auth-epoch",i="wxu-rendered-tier";function a(e){return(0,t.isLocalStorageAvailable)()?localStorage.getItem(e):null}function n(e,r){(0,t.isLocalStorageAvailable)()&&localStorage.setItem(e,r)}e.s(["bumpAuthEpoch",0,function(){n(r,String(Date.now()))},"isStaleRestore",0,function({renderedTier:e,recordedTier:t,epochAtLoad:r,currentEpoch:i}){return null!==t&&t!==e||void 0!==r&&r!==i},"readAuthEpoch",0,function(){return a(r)},"readRecordedTier",0,function(){return a(i)},"recordTier",0,function(e){n(i,e)}])},391174,95870,e=>{"use strict";var t=e.i(613646);e.s(["mutate",()=>t.j],95870);var t=t,r=e.i(892504);e.s(["invalidateUpsxCache",0,()=>{(0,t.j)(e=>"string"==typeof e&&e.startsWith("upsx/"),void 0,{revalidate:!1}),(0,r.clearPurchaseChecked)()}],391174)},45846,e=>{"use strict";e.i(288906);var t=e.i(245943),r=e.i(810564);let i=new t.UPSXClient({baseUrl:(0,r.upsxApiUrl)("https://upsx.weather.com")});e.s(["upsxClient",0,i])},378869,e=>{"use strict";let t=(0,e.i(284007).atomWithStorage)("wxu-web/keyval:emailSubscriptions",null,void 0,{getOnInit:!0});e.s(["emailPreferencesAtom",0,t])},889753,301904,e=>{"use strict";var t=e.i(284007),r=e.i(617874),i=e.i(990033),a=e.i(981030),n=e.i(543512);let s={animationSpeed:1,autoplay:!0,opacity:90,roadOverlay:"default",style:"default"};e.s(["DEFAULT_MAP_SETTINGS",0,s],301904);let o=(0,a.atom)(n.UserSubscriptionTiers.none),u=(0,t.atomWithStorage)("userProfile",null,void 0,{getOnInit:!0}),c=(0,t.atomWithStorage)("userPreferences",{userID:(0,i.v4)(),unit:r.UNIT_IMPERIAL,locations:[],locale:"en_US",mapSettings:s,favoriteWeatherComponents:[],favoriteActivityComponents:[],dashboard:[]},void 0,{getOnInit:!0});e.s(["userPreferencesAtom",0,c,"userProfileAtom",0,u,"userTierAtom",0,o],889753)},905059,e=>{"use strict";let t=(0,e.i(284007).atomWithStorage)("wx-next/user:mapLayerOrder",null,void 0,{getOnInit:!0});e.s(["mapLayerOrderAtom",0,t])},776169,809991,e=>{"use strict";var t=e.i(546446),r=e.i(889753),i=e.i(301904),a=e.i(905059),n=e.i(901351),s=e.i(310847),o=e.i(528600),u=e.i(617874),c=e.i(540768),l=e.i(553329),d=e.i(247865),m=e.i(245943);let p=(0,e.i(695881).createLogger)("useMapSettings");e.s(["WEB_MAP_SETTINGS_PLATFORM",0,"twc","useMapSettings",0,function(e="twc"){let{user:{isUserLoggedIn:r}}=(0,o.useUser)(),i=(0,t.useSetAtom)(a.mapLayerOrderAtom),s=(0,d.useCallback)(async t=>{if(!r)return!1;let{error:i}=await (0,l.tryCatch)(n.upsxClient.preference.updateMapSettings(e,t));if(!i)return!0;if(i instanceof m.APIError&&404===i.code){let{error:r}=await (0,l.tryCatch)(n.upsxClient.preference.createMapSettings(e,t));return!r||(p.warn("Failed to create map settings",r),!1)}return p.warn("Failed to update map settings",i),!1},[r,e]),u=(0,d.useCallback)((e,t)=>{i(e?.layerOrder??t)},[i]),c=(0,d.useCallback)(async t=>{if(!r||0===t.length)return!1;i(t);let{data:a,error:s}=await (0,l.tryCatch)(n.upsxClient.preference.reorderMapSettingsLayers(e,{order:t}));if(!s)return u(a,t),!0;if(s instanceof m.APIError&&404===s.code){let{data:r,error:i}=await (0,l.tryCatch)(n.upsxClient.preference.createMapSettings(e,{layerOrder:t}));if(!i)return u(r,t),!0;if(i instanceof m.APIError&&409===i.code){let{data:r,error:i}=await (0,l.tryCatch)(n.upsxClient.preference.reorderMapSettingsLayers(e,{order:t}));return i?(p.warn("Failed to reorder map layers after create",i),!1):(u(r,t),!0)}return p.warn("Failed to create map settings layer order",i),!1}return p.warn("Failed to reorder map layers",s),!1},[r,e,u,i]),f=(0,d.useCallback)(async(t,a,s)=>{if(!r)return!1;i(s);let{data:o,error:d}=await (0,l.tryCatch)(n.upsxClient.preference.moveMapSettingsLayer(e,t,{placement:a}));return d?d instanceof m.APIError&&(404===d.code||400===d.code)?c(s):(p.warn("Failed to move map layer",d),!1):(u(o,s),!0)},[r,e,u,c,i]);return{saveMapSettings:s,saveLayerOrder:c,moveLayer:f}}],809991),e.s(["usePreferences",0,function(){let{user:{isUserLoggedIn:e}}=(0,o.useUser)(),[d,m]=(0,t.useAtom)(r.userPreferencesAtom),[p,f]=(0,t.useAtom)(s.wxuUserPreferenceAtom),g=(0,t.useSetAtom)(a.mapLayerOrderAtom),y=async()=>{let{data:e,error:t}=await (0,l.tryCatch)(n.upsxClient.preference.getMapSettings("twc"));if(t)return{ok:!1,mapSettings:null,layerOrder:null};if(!e)return{ok:!0,mapSettings:null,layerOrder:null};let{animationSpeed:r,autoplay:i,opacity:a,roadOverlay:s,style:o}=e,u={...void 0!==r&&{animationSpeed:r},...void 0!==i&&{autoplay:i},...void 0!==a&&{opacity:a},...void 0!==s&&{roadOverlay:s},...void 0!==o&&{style:o}};return{ok:!0,mapSettings:Object.keys(u).length>0?u:null,layerOrder:e.layerOrder?.length?e.layerOrder:null}},S=async e=>{try{await n.upsxClient.preference.updatePreference(e)}catch(e){return console.error("Failed to sync preferences with server:",e),null}},h=async(t,r=!0)=>{try{let i,a=(i={...d,...t},m(i),f({...p,...t,locations:i.locations}),i);if(t?.unit){let e=(0,u.unitsSystemByName)(t.unit),r=e?.code||"e";(0,c.setCookie)(u.UNITS_COOKIE_KEY,r,{domain:"weather.com"})}return r&&e&&await S(a),{success:!0}}catch(e){return console.error("Failed to update preferences:",e),{success:!1,error:e instanceof Error?e.message:"Failed to update preferences"}}};return{syncPreferencesFromUpsx:async()=>{try{let[e,t]=await Promise.all([n.upsxClient.preference.getPreference(),y()]);if(!e?.userID)return null;let{mapSettings:r,layerOrder:a,ok:s}=t;s&&g(a);let{mapSettings:o,...u}=e,c={...u,mapSettings:{...i.DEFAULT_MAP_SETTINGS,...r}};return h(c,!1),c}catch{return null}},updatePreferences:h}}],776169)},528600,949920,e=>{"use strict";let t;var r=e.i(247865),i=e.i(546446),a=e.i(381477);let n=(0,e.i(66396).withMiddleware)(a.default,e=>(t,r,i)=>(i.revalidateOnFocus=!1,i.revalidateIfStale=!1,i.revalidateOnReconnect=!1,e(t,r,i)));e.s(["default",0,n],949920);var s=e.i(889753),o=e.i(901351),u=e.i(310847),c=e.i(543512),l=e.i(990033),d=e.i(333350),m=e.i(495110),p=e.i(513513),f=e.i(960576);e.s(["useUser",0,function(){let[e,a]=(0,i.useAtom)(s.userProfileAtom),[g,y]=(0,i.useAtom)(u.wxuUserAnonymousIdAtom),[S,h]=(0,i.useAtom)(u.wxuUserAccountUserAccountResponseAtom),[I,A]=(0,r.useState)(!1),w=(0,i.useSetAtom)(u.wxuLoginRedirectPageAtom),v=(0,m.useIsHydratingRender)();d.default&&!I&&(w(window.location.href),A(!0));let P=(0,i.useAtomValue)(s.userTierAtom),U=(0,p.isUserLoggedIn)(P),b=g;!b&&d.default&&(t||(t=(0,f.readEarlyAnonId)()??(0,l.v4)()),b=t),d.default&&!g&&b&&y(b),!e&&S&&a(S);let C=n(U?"upsx/id":null,()=>o.upsxClient.account.getAccountId(),{shouldRetryOnError:e=>"APIError"!==e.name}),{userID:T=""}=C?.data||{},x=n(T&&e?.userID!==T?"upsx/account":null,()=>o.upsxClient.account.getAccount(),{shouldRetryOnError:e=>"APIError"!==e.name,onSuccess:e=>{a(e),h(e)}});return{user:{anonId:b,userID:T,isUserLoggedIn:U,subscriptionTier:P,isUserPremium:(0,p.isUserTierPremium)(P),isUserAdFree:P===c.UserSubscriptionTiers.adFree},userProfile:v?null:e,isUserIdLoading:C.isLoading,profileError:x.error}}],528600)},543512,e=>{"use strict";var t,r=((t={})[t.none=-1]="none",t[t.standard=0]="standard",t[t.premium=1]="premium",t[t.adFree=2]="adFree",t[t.premiumWithAd=3]="premiumWithAd",t);let i=Object.entries(r).reduce((e,[t,r])=>(e[r]=t,e),{});Object.entries(r).reduce((e,[t,r])=>(e[r.toString()]=r,e),{}),e.s(["UserSubscriptionPremiumTiers",0,[1,2,3],"UserSubscriptionTierKeysMap",0,i,"UserSubscriptionTiers",()=>r,"UserSubscriptionTiersMap",0,{standard:0,tier0:1,tier1:1,"ad-free-v2":2,tier3:3}])},960576,e=>{"use strict";let t="wxu-exp-anon-id";e.s(["clearEarlyAnonId",0,function(){try{window.localStorage.removeItem(t)}catch{}},"readEarlyAnonId",0,function(){let e=window.__wxExperimentDeviceId;if("string"==typeof e&&e)return e;try{return window.localStorage.getItem(t)||void 0}catch{return}}])},160317,e=>{"use strict";var t=e.i(543512);e.s(["getSubscriptionTierKey",0,function(e){return t.UserSubscriptionTierKeysMap[e]??t.UserSubscriptionTierKeysMap[t.UserSubscriptionTiers.none]}])},513513,e=>{"use strict";var t=e.i(543512);t.UserSubscriptionTiers.none,t.UserSubscriptionTiers.standard,t.UserSubscriptionTiers.adFree,t.UserSubscriptionTiers.premium,t.UserSubscriptionTiers.premiumWithAd,e.s(["hasRadarFeature",0,function(e){return void 0!==e&&t.UserSubscriptionPremiumTiers.includes(e)},"isUserLoggedIn",0,function(e){return void 0!==e&&e>t.UserSubscriptionTiers.none},"isUserTierPremium",0,function(e){return t.UserSubscriptionPremiumTiers.includes(e)}],513513)},317298,e=>{"use strict";let t="wxu-next-session-intent",r=["fpdprobnsitop1intent","fpdprobnsitop2intent","fpdprobnsitop3intent"];e.s(["clearNextSessionIntent",0,function(){try{localStorage.removeItem(t)}catch{}},"hasRadarIntent",0,function(e){return!!e&&r.some(t=>{let r=e[t];return"string"==typeof r&&"radar"===r.trim().toLowerCase()})},"readNextSessionIntent",0,function(){try{let e=localStorage.getItem(t);if(!e)return null;let r=JSON.parse(e);if(r&&"object"==typeof r&&"promotesRadar"in r&&"boolean"==typeof r.promotesRadar)return{promotesRadar:r.promotesRadar};return null}catch{return null}},"writeNextSessionIntent",0,function(e){try{localStorage.setItem(t,JSON.stringify({promotesRadar:e.promotesRadar}))}catch{}}])},839315,e=>{"use strict";e.i(965586);let t="wxu-web/keyval:mparticleUser";e.s(["clearStoredmParticleId",0,()=>{try{localStorage.removeItem(t)}catch{}},"getStoredmParticleId",0,()=>{try{let e=JSON.parse(localStorage.getItem(t)||"{}");return e?.value?.mpid||null}catch{return null}},"getmParticleCustomerId",0,()=>window?.mParticle?.Identity?.getCurrentUser?.()?.getUserIdentities?.()?.userIdentities?.customerid||null,"getmParticleId",0,()=>{let e=window?.mParticle?.Identity?.getCurrentUser?.()?.getMPID?.();return e||null},"setStoredmParticleId",0,e=>{try{localStorage.setItem(t,JSON.stringify({value:{mpid:e},updatedAt:Date.now()}))}catch{}}])},892504,e=>{"use strict";let t="upsx-purchase-checked-at";e.s(["clearPurchaseChecked",0,()=>{try{localStorage.removeItem(t)}catch{}},"markPurchaseChecked",0,()=>{try{localStorage.setItem(t,String(Date.now()))}catch{}},"purchaseCheckedRecently",0,()=>{try{let e=localStorage.getItem(t);if(!e)return!1;let r=Number(e);if(!Number.isFinite(r))return!1;return Date.now()-r{"use strict";e.i(288906);var t=e.i(245943),r=e.i(810564);let i=new t.UPSXClient({baseUrl:(0,r.upsxApiUrl)("https://upsx.weather.com")});e.s(["upsxClient",0,i])},991511,e=>{"use strict";var t=e.i(247865),r=e.i(806262),i=e.i(546446);e.s(["useRehydrateAtoms",0,e=>{(0,r.useHydrateAtoms)(e);let a=(0,i.useStore)(),n=(0,t.useRef)(e);n.current=e,(0,t.useEffect)(()=>{for(let[e,t]of n.current)a.get(e)!==t&&a.set(e,t)})}])},553329,e=>{"use strict";async function t(e){try{return{data:await e,error:null}}catch(e){return{data:null,error:e}}}e.s(["tryCatch",0,t])}]);