(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,609858,674339,e=>{"use strict";var t=e.i(546446),r=e.i(592121);let i=(0,e.i(981030).atom)({timestamp:new Date().toISOString()});e.s(["debugDataAtom",0,i],674339),e.s(["useDebugSystem",0,function(){let[e,n]=(0,t.useAtom)(i),a=(0,r.useCallback)((e,t)=>{n(r=>{let i=r?.[e]||{},n="object"==typeof t&&null!==t&&"object"==typeof i?{...i,...t}:t;return{...r,[e]:n}})},[n]),s=(0,r.useCallback)((e,t)=>{n(r=>{let i=r||{timestamp:new Date().toISOString()},n=i.components||{};if(null===t){let t={...n};return delete t[e],{...i,components:t}}return{...i,components:{...n,[e]:t}}})},[n]),o=(0,r.useCallback)(e=>{a("page",e)},[a]),l=(0,r.useCallback)(e=>{a("route",e)},[a]),u=(0,r.useCallback)(e=>{Object.entries(e).forEach(([e,t])=>{t&&a(e,t)})},[a]);return{debugData:e,updateSection:a,updateComponentData:s,setPageData:o,clearAllDebugData:(0,r.useCallback)(()=>{n({timestamp:new Date().toISOString()})},[n]),updateRouteInfo:l,updatePageDebug:u}}],609858)},752496,e=>{"use strict";var t=e.i(592121),r=e.i(609858);let i=(0,e.i(695881).createLogger)("DebugCollector");e.s(["DebugCollectorClient",0,function({componentName:e,data:n,page:a,onUpdateData:s,onSetPageData:o}){let{updateComponentData:l,setPageData:u}=(0,r.useDebugSystem)(),c=(0,t.useRef)(!1),d=s||l,p=o||u;return(0,t.useEffect)(()=>{if(n)return i.lifecycle(`Collecting component data for ${e}`,{dataKeys:Object.keys(n),hasPerformance:!!n.performance,hasContext:!!n.context}),d(e,{...n,_collectedAt:new Date().toISOString()}),()=>{i.lifecycle(`Cleaning up data for ${e}`),d(e,null)}},[e,n,d]),(0,t.useEffect)(()=>{a&&!c.current&&(i.lifecycle("Setting page metadata",{title:a.title,assetName:a.assetName,collection:a.collection}),p({...a,_updatedAt:new Date().toISOString()}),c.current=!0)},[a,p]),null}])},837879,e=>{"use strict";var t=e.i(592121),r=e.i(546446),i=e.i(961123),n=e.i(485737),a=e.i(739971),s=e.i(725296),o=e.i(394481),l=e.i(763886),u=e.i(132084);e.s(["useSubscriptionsEnabled",0,()=>{let e=(0,r.useAtomValue)(a.subscriptionsEnabledAtom),c=(0,r.useAtomValue)(n.geoipCountry),d=(0,i.useParams)()?.locale,p=(0,r.useAtomValue)(o.privacyRegimeAtom)??s.Regime.EXEMPT,m=(0,r.useAtomValue)(l.partnerAtom);return(0,t.useMemo)(()=>null!==e?e:"US"===c&&"en-US"===d&&s.US_REGIMES.includes(p)&&m!==u.Partner.OPPO,[e,c,d,p,m])}])},18358,e=>{"use strict";var t=e.i(947118),r=e.i(737801),i=e.i(592121);e.s(["useTrackEvent",0,()=>{let e=(0,t.useIsInitialized)(),n=(0,r.useEventAttributes)(),a=(0,i.useCallback)((t,r={})=>{let i={...n,...r};if(!e)return void console.warn("MParticle is not initialized");try{window.mParticle.logEvent(t,window.mParticle.EventType.Other,i),console.debug(`MParticle: Event "${t}" tracked`,i)}catch(e){console.error(`MParticle: Event "${t}" failed`,e)}return a},[n,e]);return a}])},756227,95870,391174,e=>{"use strict";var t=e.i(546446),r=e.i(284007),i=e.i(889753),n=e.i(310847),a=e.i(613646);e.s(["mutate",()=>a.j],95870);var a=a,s=e.i(318849);let o=()=>{(0,a.j)(e=>"string"==typeof e&&e.startsWith("upsx/"),void 0,{revalidate:!1});try{localStorage.removeItem(s.SWR_CACHE_STORAGE_KEY)}catch{}};e.s(["invalidateUpsxCache",0,o],391174),e.s(["useResetAuthState",0,function(){let e=(0,t.useSetAtom)(i.userProfileAtom),a=(0,t.useSetAtom)(n.wxuUserAccountUserAccountResponseAtom);return()=>{o(),e(r.RESET),a(null)}}],756227)},806262,e=>{"use strict";e.i(592121);var t=e.i(546446);e.i(284007),e.i(981030);let r=new WeakMap;e.s(["useHydrateAtoms",0,function(e,i){var n;let a,s=(0,t.useStore)(i),o=(n=s,(a=r.get(n))||(a=new WeakSet,r.set(n,a)),a);for(let[t,...r]of e)(!o.has(t)||(null==i?void 0:i.dangerouslyForceHydrate))&&(o.add(t),s.set(t,...r))}])},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])},991511,e=>{"use strict";var t=e.i(592121),r=e.i(806262),i=e.i(546446);e.s(["useRehydrateAtoms",0,e=>{(0,r.useHydrateAtoms)(e);let n=(0,i.useStore)(),a=(0,t.useRef)(e);a.current=e,(0,t.useEffect)(()=>{for(let[e,t]of a.current)n.get(e)!==t&&n.set(e,t)})}])},797770,e=>{"use strict";let t=(0,e.i(981030).atom)("");e.s(["adsMetricsUnitAndZoneAtom",0,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])},776169,809991,e=>{"use strict";var t=e.i(546446),r=e.i(889753),i=e.i(301904),n=e.i(901351),a=e.i(310847),s=e.i(528600),o=e.i(617874),l=e.i(864723),u=e.i(553329),c=e.i(592121),d=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:t}}=(0,s.useUser)();return{saveMapSettings:(0,c.useCallback)(async r=>{if(!t)return!1;let{error:i}=await (0,u.tryCatch)(n.upsxClient.preference.updateMapSettings(e,r));if(!i)return!0;if(i instanceof d.APIError&&404===i.code){let{error:t}=await (0,u.tryCatch)(n.upsxClient.preference.createMapSettings(e,r));return!t||(p.warn("Failed to create map settings",t),!1)}return p.warn("Failed to update map settings",i),!1},[t,e])}}],809991),e.s(["usePreferences",0,function(){let{user:{isUserLoggedIn:e}}=(0,s.useUser)(),[c,d]=(0,t.useAtom)(r.userPreferencesAtom),[p,m]=(0,t.useAtom)(a.wxuUserPreferenceAtom),f=async()=>{let{data:e,error:t}=await (0,u.tryCatch)(n.upsxClient.preference.getMapSettings("twc"));if(t||!e)return null;let{animationSpeed:r,autoplay:i,opacity:a,roadOverlay:s,style:o}=e,l={...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 Object.keys(l).length>0?l:null},g=async e=>{try{await n.upsxClient.preference.updatePreference(e)}catch(e){return console.error("Failed to sync preferences with server:",e),null}},v=async(t,r=!0)=>{try{let i,n=(i={...c,...t},d(i),m({...p,...t,locations:i.locations}),i);if(t?.unit){let e=(0,o.unitsSystemByName)(t.unit),r=e?.code||"e";(0,l.setCookie)(o.UNITS_COOKIE_KEY,r,{domain:"weather.com"})}return r&&e&&await g(n),{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(),f()]);if(!e?.userID)return null;let{mapSettings:r,...a}=e,s={...a,mapSettings:{...i.DEFAULT_MAP_SETTINGS,...t}};return v(s,!1),s}catch{return null}},updatePreferences:v}}],776169)},318849,e=>{"use strict";let t=!1,r="upsx-recent-purchase-at";e.s(["SWR_CACHE_LEGACY_STORAGE_KEY",0,"app-cache","SWR_CACHE_STORAGE_KEY",0,"wxu-swr-cache-v1","disableSwrPersist",0,()=>{t=!0},"hasRecentPurchase",0,e=>{try{let t=localStorage.getItem(r);if(!t)return!1;let i=Number(t);if(!Number.isFinite(i))return!1;return Date.now()-it,"markRecentPurchase",0,()=>{try{localStorage.setItem(r,String(Date.now()))}catch{}}])},45846,e=>{"use strict";let t=new(e.i(245943)).UPSXClient({baseUrl:"https://upsx.weather.com"});e.s(["upsxClient",0,t])},491045,e=>{"use strict";var t=e.i(284007);let r=(0,t.createJSONStorage)(()=>sessionStorage),i=(0,t.atomWithStorage)("wx-purchase-source-attribution",null,r);e.s(["purchaseSourceAttributionAtom",0,i])},185312,(e,t,r)=>{t.exports=e.r(16129)},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])},688070,e=>{"use strict";let t=(0,e.i(981030).atom)(!1);e.s(["isWebViewOnlyAtom",0,t])},328343,e=>{"use strict";var t=e.i(592121),r=e.i(546446),i=e.i(737801),n=e.i(688070);e.s(["useEnrolledInExperimentEvent",0,()=>{let e=(0,i.useEventAttributes)(),a=(0,r.useAtomValue)(n.isWebViewOnlyAtom);return(0,t.useCallback)((t,r={})=>{if(a)return void console.debug("Skipping enrolled-in-experiment in webview mode");if(!window.mParticle?.isInitialized?.())return void console.warn("MParticle is not initialized");if(!t)return void console.warn("No exposure data provided to trackEnrolledInExperiment");if(!t.experiment_key)return void console.debug(`[Experiment] Skipping exposure tracking for ${t.flag_key} - no experiment_key (feature flag only)`);try{let i={...e,newVariant:t.variant||"",newExperiment:t.experiment_key,newExperimentReceivedAt:Date.now()};window.mParticle?.logEvent?.("enrolled-in-experiment",window.mParticle?.EventType?.Other,i,r),console.debug(`MParticle: Event tracked - enrolled-in-experiment for ${t.flag_key||"unknown"}:${t.variant}`)}catch(e){console.error("MParticle: Failed to track event",e)}},[e,a])}])},912555,e=>{"use strict";e.s(["AMPLITUDE_VARIANTS_COOKIE",0,"amplitude-variants","SUBS_OFFER_LAYOUT_FLAG_KEY",0,"subs-offer-page-hero-section"])},562209,e=>{"use strict";var t=e.i(546584),r=e.i(553329);let i="production"!==t.default.env.VERCEL_TARGET_ENV,n=new Set;e.s(["resetTrackedExposures",0,function(){n.clear()},"trackAmplitudeExposure",0,function({exposure:e,userId:t,deviceId:a}){if(!e.experiment_key){i&&console.debug(`[Experiment] Skipping Amplitude HTTP exposure for ${e.flag_key} — no experiment_key (feature flag only)`);return}if(!t&&!a){i&&console.debug("[Experiment] Skipping Amplitude HTTP exposure — no user identity");return}let s=`${e.flag_key}::${e.variant??""}`;if(n.has(s)){i&&console.debug(`[Experiment] Skipping duplicate Amplitude HTTP exposure: ${s}`);return}n.add(s);let o={api_key:"bb1117981ed2a95dc4fa64b75661d681",events:[{event_type:"$exposure",user_id:t,device_id:a,ip:"$remote",event_properties:{flag_key:e.flag_key,variant:e.variant,experiment_key:e.experiment_key,platform:"web",app_name:"wx-next-web",environment:i?"dev":"prod",experimentation_platform:"amplitude_experiment"}}]};(async()=>{let{data:t,error:n}=await (0,r.tryCatch)(fetch("https://api2.amplitude.com/2/httpapi",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o),keepalive:!0}));return n?console.error("[Experiment] Failed to send exposure to Amplitude HTTP API:",n):t&&!t.ok?console.error(`[Experiment] Amplitude HTTP API returned ${t.status}`):i&&console.debug("[Experiment] Amplitude HTTP exposure sent:",{flag_key:e.flag_key,variant:e.variant})})()}])},283366,e=>{"use strict";e.s(["getExposureVariantOverride",()=>g,"resetExposures",()=>v,"useExposure",()=>h]);var t=e.i(592121),r=e.i(695881),i=e.i(333350),n=e.i(358273),a=e.i(742436);let s=(0,r.createLogger)("useExposure"),o="wxu-exp-exposed:",l=new Set,u=()=>{try{return(0,n.getMetricsSession)()?.sessionId||null}catch{return null}},c=e=>{try{let t=localStorage.getItem(o+e);return new Set(t?JSON.parse(t):[])}catch{return new Set}},d=(e,t)=>{try{for(let t=localStorage.length-1;t>=0;t--){let r=localStorage.key(t);r?.startsWith(o)&&r!==o+e&&localStorage.removeItem(r)}localStorage.setItem(o+e,JSON.stringify([...t]))}catch{}},p=e=>{if(0===l.size)return;let t=c(e);for(let e of l)t.add(e);d(e,t),l.clear()},m=e=>{let t=u();return t?(p(t),c(t).has(e)):l.has(e)},f=new Map;function g(e){return f.get(e)}function v(){l.clear(),f.clear();let e=u();if(e)try{localStorage.removeItem(o+e)}catch{}}function h(e,r){let n=void 0!==r,o=r?.variant,g=(0,t.useContext)(a.ExperimentContext);(0,t.useEffect)(()=>{if(!i.default||!g||m(e)||n&&void 0===o)return;let{client:t}=g;if(!t)return;let r=()=>{if(!m(e)){(e=>{let t=u();if(!t)return l.add(e);p(t);let r=c(t);r.add(e),d(t,r)})(e),void 0!==o&&f.set(e,o);try{t.exposure(e)}catch(e){s.error("Failed to track exposure:",e)}}};window.mParticle?.isInitialized?.()?r():window.mParticle?.ready?.(r)},[g,e,n,o])}},742436,e=>{"use strict";e.s(["ExperimentContext",()=>h,"ExperimentProvider",()=>x,"default",()=>y,"useExperimentContext",()=>b],742436);var t=e.i(546584),r=e.i(699173),i=e.i(592121),n=e.i(185312),a=e.i(333350),s=e.i(310847),o=e.i(546446),l=e.i(328343),u=e.i(158662),c=e.i(528600),d=e.i(646341),p=e.i(912555),m=e.i(562209),f=e.i(283366);let g="client-a74nh7wdmymfO9eOcl5awe1cgB30BDRV",v="production"!==t.default.env.VERCEL_TARGET_ENV,h=(0,i.createContext)(null),x=({children:e,scriptSrc:t})=>{let x=(0,o.useAtomValue)(s.wxuUserAnonymousIdAtom),b=(0,l.useEnrolledInExperimentEvent)(),y=(0,o.useSetAtom)(u.experimentJoinListAtom),{user:S}=(0,c.useUser)(),[E,w]=(0,i.useState)(!1),[A,k]=(0,i.useState)(!1),[,_]=(0,i.useState)(0),C=(0,i.useRef)(void 0),I=(0,i.useRef)(void 0),P=(0,d.getCookie)("ANON_C")?.toString();C.current=S.userID||void 0,I.current=P||x;let O=(0,i.useRef)(new Set),T=(0,i.useCallback)(e=>{let t=(0,f.getExposureVariantOverride)(e.flag_key),r=void 0!==t?{...e,variant:t}:e,i=`${r.flag_key}::${r.variant??""}`;O.current.has(i)||(O.current.add(i),b(r),(0,m.trackAmplitudeExposure)({exposure:r,userId:C.current,deviceId:I.current}))},[b]),[R,D]=(0,i.useState)({});(0,i.useEffect)(()=>{if(a.default){let e=(0,d.getCookie)(p.AMPLITUDE_VARIANTS_COOKIE);if(e)try{let t=JSON.parse(e.toString());D(t),v&&Object.keys(t).length>0&&console.debug("[Experiment] Loaded server variants from cookie:",Object.keys(t))}catch(e){console.error("[Experiment] Failed to parse variants cookie:",e)}}},[]),(0,i.useEffect)(()=>{0===Object.keys(R).length?y(null):y(JSON.stringify(Object.entries(R).filter(([,e])=>!!e?.key).map(([e,t])=>{let r=t.key??"",i=Math.floor(Date.now()/1e3);return`${e},${r},${i}`})))},[R,y]);let N=function(e,t,r){let n=(0,i.useRef)(null),[s,o]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{if(!s&&a.default&&g&&t){if(!window.Experiment)return void console.error("Amplitude Experiment SDK not loaded. Script may still be loading.");try{let t=Object.keys(r).length>0;n.current=window.Experiment.initialize(g,{debug:v,fetchTimeoutMillis:5e3,retryFetchOnFailure:!0,fetchOnStart:!1,automaticExposureTracking:!1,exposureTrackingProvider:{track:t=>{try{e(t),v&&console.debug("[Experiment] Exposure tracked:",t)}catch(e){console.error("[Experiment] Failed to track exposure:",e)}}},initialVariants:t?r:void 0,source:t?"initialVariants":"localStorage"}),o(!0),v&&(t?console.debug("[Experiment] SDK initialized with server variants:",Object.keys(r)):console.debug("[Experiment] SDK initialized (will fetch from API)"))}catch(e){console.error("Failed to initialize Amplitude Experiment SDK:",e)}}},[s,t,e,r]),n.current}(T,E,R);return(0,i.useEffect)(()=>{(async()=>{if(!N)return;let e=(0,d.getCookie)("ANON_C")?.toString()||x;if(!e&&!S.userID){v&&console.debug("[Experiment] No user identifier available"),k(!0);return}let t={device_id:e,...S.userID?{user_id:S.userID}:{},user_properties:{}};v&&console.debug("[Experiment] Fetching experiments from API for user:",t);try{await N.fetch(t)}catch(e){console.error("[Experiment] Failed to fetch experiments:",e)}finally{k(!0)}})()},[N,x,S.userID]),(0,i.useEffect)(()=>{O.current.clear(),(0,m.resetTrackedExposures)(),(0,f.resetExposures)(),_(e=>e+1)},[S.userID]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.default,{src:t,strategy:"afterInteractive",onLoad:()=>{w(!0),v&&console.debug("Amplitude Experiment script loaded")},onError:e=>{console.error("Failed to load Amplitude Experiment script:",e)}}),(0,r.jsx)(h.Provider,{value:{client:N,variant:(e,t)=>{if(!N)return t;let r=N.variant(e,t);return v&&console.debug("[Experiment] Current Variant:",r),r},fetch:e=>{if(!N)return Promise.resolve();if(!e){let e=(0,d.getCookie)("ANON_C")?.toString()||x;if(e||S.userID){let t={device_id:e,...S.userID?{user_id:S.userID}:{},user_properties:{}};return N.fetch(t)}}return N.fetch(e)},isFetchComplete:A},children:e})]})},b=()=>{let e=(0,i.useContext)(h);if(!e)throw Error("useExperimentContext must be used within an AmplitudeExperimentProvider");return e},y=x},5397,e=>{"use strict";let t=(0,e.i(981030).atom)();e.s(["showAdminHeaderAtom",0,t])},630986,e=>{"use strict";var t=e.i(546446),r=e.i(604323);e.s(["useCMSAttributes",0,()=>(0,t.useAtomValue)(r.metricsArticleDataAtom)])},37423,e=>{"use strict";let t=(0,e.i(981030).atom)(!1);e.s(["dprSdkIsInitializedAtom",0,t])},436028,e=>{"use strict";e.s(["hasLength",0,e=>Array.isArray(e)&&e.length>0])},49893,e=>{"use strict";let t=(0,e.i(981030).atom)();e.s(["adsKillswitchAtom",0,t])},21121,e=>{"use strict";let t=(0,e.i(981030).atom)(!1);e.s(["showVelvetcakeModuleAtom",0,t])},235577,e=>{"use strict";var t=e.i(699173),r=e.i(523084),i=e.i(47524),n=e.i(632137),a=e.i(877957);e.s(["ScrollButton",0,function({direction:e,onClick:s,hidden:o,size:l="default",variant:u="light",className:c}){let d="sm"===l,p=(0,n.cn)("text-current",d?"size-4":"size-6 transition-[width,height] duration-150 group-hover:size-7 group-active:size-6 group-active:duration-100");return(0,t.jsx)(a.Button,{type:"button",onClick:s,"aria-hidden":"true",tabIndex:-1,className:(0,n.cn)("group z-sticky absolute top-1/2 flex -translate-y-1/2 cursor-pointer items-center justify-center rounded-full p-0 transition-all duration-150 ease-in-out active:duration-100","dark"===u?"bg-[#252422] text-white hover:bg-[#3a3937] active:bg-[#1a1918]":"solid"===u?"bg-black/80 text-white hover:bg-black/90 active:bg-black":"white"===u?"bg-white/80 text-gray-900 backdrop-blur-[2px] hover:bg-white/95 active:bg-white":"bg-transparent text-gray-900 hover:bg-gray-100 active:bg-gray-200",d?"size-8":"size-12","left"===e&&"left-1","right"===e&&"right-1",o&&"left"===e&&"-translate-x-[calc(100%+1.5rem)]",o&&"right"===e&&"translate-x-[calc(100%+1.5rem)]",o&&"pointer-events-none opacity-0",c),children:"left"===e?(0,t.jsx)(r.ChevronLeft,{className:p}):(0,t.jsx)(i.ChevronRight,{className:p})})}])},315730,e=>{"use strict";var t=e.i(147732),r=e.i(592121);e.s(["useHorizontalScroll",0,function({enabled:e=!0,scrollAmount:i=200,contentKey:n}={}){let a=(0,r.useRef)(null),s=(0,r.useRef)(null),o=(0,r.useRef)(!1),[l,u]=(0,r.useState)(!1),[c,d]=(0,r.useState)(!1),p=(0,r.useCallback)(()=>{let t=a.current;if(!t||!e){u(!1),d(!1);return}let{scrollLeft:r,scrollWidth:i,clientWidth:n}=t,s=Math.abs(r),l=s>2,c=s+n(0,t.debounce)(p,150),[p]),f=(0,r.useCallback)(()=>{null===s.current&&(s.current=requestAnimationFrame(()=>{p(),s.current=null}))},[p]);(0,r.useEffect)(()=>{let t=a.current;return t&&(o.current="rtl"===getComputedStyle(t).direction),p(),e&&(t?.addEventListener("scroll",f),window.addEventListener("resize",m)),()=>{null!==s.current&&cancelAnimationFrame(s.current),s.current=null,t?.removeEventListener("scroll",f),m.cancel(),window.removeEventListener("resize",m)}},[e,p,f,m,n]);let g=(0,r.useCallback)(()=>a.current?.scrollBy({left:-i,behavior:"smooth"}),[i]),v=(0,r.useCallback)(()=>a.current?.scrollBy({left:i,behavior:"smooth"}),[i]);return{ref:a,showLeft:l,showRight:c,scrollLeft:g,scrollRight:v}}])},457492,e=>{"use strict";var t=e.i(699173),r=e.i(592121),i=e.i(632137),n=e.i(546446),a=e.i(663333),s=e.i(235577),o=e.i(315730),l=e.i(240058);let u=(0,i.cn)("h-full rounded-3xl px-4 text-sm whitespace-nowrap transition-colors text-gray-900 font-bold","inline-flex items-center hover:bg-gray-100 active:bg-gray-200 focus-visible:outline-none focus-visible:bg-gray-100"),c=e=>{let{activeIndex:r,index:n,link:a}=e,s=r===n,o=(0,i.cn)(u,{"bg-gray-100 text-blue-500":s});if(e.onSelect){let{onSelect:r}=e;return(0,t.jsx)("button",{type:"button",onClick:()=>r(n,a),className:(0,i.cn)("cursor-pointer",o),"aria-current":s?"page":void 0,children:a.label})}let{basePath:c,mpa:d}=e,p=a.href??("/"===a.slug?c||"/":`${c}/${a.slug}`);return(0,t.jsx)(l.default,{href:p,mpa:d,className:o,"aria-current":s?"page":void 0,sourceModule:"subnavigation",children:a.label})},d=(0,r.memo)(e=>{let{links:r,activeIndex:l,className:u,constrained:d=!0}=e,p=(0,n.useAtomValue)(a.deviceClassAtom),{ref:m,showLeft:f,showRight:g,scrollLeft:v,scrollRight:h}=(0,o.useHorizontalScroll)({enabled:"mobile"!==p&&"tablet"!==p,scrollAmount:200,contentKey:r});return(0,t.jsxs)("div",{className:(0,i.cn)("relative overflow-hidden rounded-3xl bg-white p-1 shadow-[0_4px_16px_0_rgba(0,0,0,0.08),_0_0_32px_0_rgba(0,0,0,0.12)]","md:rounded-4xl md:rounded-[28px]",d&&"md:mr-auto md:max-w-[min(958px,100%)]",u),"data-testid":"subnavigation",children:[(0,t.jsx)("div",{className:(0,i.cn)("pointer-events-none absolute top-0 -left-25 h-full w-24 bg-gradient-to-r from-white from-0% via-white via-60% to-transparent transition-[left] md:-top-1 md:h-14 md:rounded-s-[28px]",{"-left-1":f}),"aria-hidden":"true"}),(0,t.jsx)(s.ScrollButton,{hidden:!f,onClick:v,direction:"left"}),(0,t.jsx)("div",{ref:m,className:(0,i.cn)("scrollbar-hide flex h-10 items-center gap-1 overflow-x-auto md:h-12"),children:r.map((r,i)=>e.onSelect?(0,t.jsx)(c,{link:r,index:i,activeIndex:l,onSelect:e.onSelect},`${r.label}_${r.slug}`):(0,t.jsx)(c,{link:r,index:i,activeIndex:l,basePath:e.basePath,mpa:e.mpa},`${r.label}_${r.slug}`))}),(0,t.jsx)("div",{className:(0,i.cn)("pointer-events-none absolute top-0 -right-25 h-full w-24 bg-gradient-to-l from-white from-0% via-white via-60% to-transparent transition-[right] md:-top-1 md:h-14 md:rounded-e-[28px]",{"-right-1":g}),"aria-hidden":"true"}),(0,t.jsx)(s.ScrollButton,{hidden:!g,onClick:h,direction:"right"})]})},(e,t)=>e.activeIndex===t.activeIndex&&e.basePath===t.basePath&&e.mpa===t.mpa&&e.onSelect===t.onSelect&&e.constrained===t.constrained&&e.links.length===t.links.length&&e.links.every((e,r)=>e.label===t.links[r]?.label&&e.slug===t.links[r]?.slug&&e.href===t.links[r]?.href));d.displayName="SubnavigationUI",e.s(["SubnavigationUI",0,d],457492)}]);