(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,45776,(e,l,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPollenRiskLevel=function(e){return null==e||""===e?null:a[Number(e)]??null},t.getPollenObservationByType=function(e,l){return e?.pollenobservation.find(e=>e.pollen_type===l)};let a={1:"low",2:"moderate",3:"high",4:"veryHigh"}},533694,e=>{"use strict";let l=new Set(["AK","HI"]);e.s(["isConus",0,e=>e?.countryCode==="US"&&!l.has(e.adminDistrictCode??"")])},564599,e=>{"use strict";var l=e.i(902875),t=e.i(389379),a=e.i(64412),r=e.i(860082),n=e.i(546446),s=e.i(730921),o=e.i(581014),i=e.i(16838),d=e.i(5397),c=e.i(731947),u=e.i(923931),m=e.i(381477),h=e.i(674885),y=e.i(617874),p=e.i(738634),g=e.i(349262);let f=e=>e?.slice(0,10)??"";var x=e.i(380993),v=e.i(316078),_=e.i(632137),b=e.i(385636),L=e.i(175424);let j="grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_8.5rem] items-center gap-x-4 @xl/card:grid-cols-[1.2fr_1.3fr_1fr_1fr_0.8fr_0.8fr]",C="order-3 justify-self-end @xl/card:order-none",N="order-2 justify-self-start @xl/card:order-none @xl/card:justify-self-center",P="hidden @xl/card:flex",w=({rows:e,speedUnit:t,isLoading:a=!1})=>{let r=(0,o.useTranslations)("AllergyForecast");return(0,l.jsxs)(x.Card,{"data-testid":"AllergyForecastModule","aria-label":r("daily"),"aria-busy":a||void 0,children:[(0,l.jsx)(x.CardHeader,{text:r("daily")}),(0,l.jsx)(x.CardContent,{children:(0,l.jsxs)("div",{role:"table",className:"text-base",children:[(0,l.jsxs)("div",{role:"row",className:(0,_.cn)(j,"sr-only border-b border-gray-200 pb-3 text-xs text-gray-600 @xl/card:not-sr-only"),children:[(0,l.jsx)("span",{role:"columnheader",children:r("day")}),(0,l.jsx)("span",{role:"columnheader",className:C,children:r("pollenLevel")}),(0,l.jsx)("span",{role:"columnheader",className:N,children:r("pollenCount")}),(0,l.jsx)("span",{role:"columnheader",className:P,children:r("conditions")}),(0,l.jsx)("span",{role:"columnheader",className:(0,_.cn)(P,"justify-end"),children:r("humidity")}),(0,l.jsx)("span",{role:"columnheader",className:(0,_.cn)(P,"justify-end"),children:r("wind")})]}),a&&Array.from({length:6},(e,t)=>(0,l.jsx)("div",{className:"border-b border-gray-200 py-5",children:(0,l.jsx)("div",{className:"h-5 w-full animate-pulse rounded bg-gray-200"})},t)),!a&&e.map(e=>(0,l.jsxs)("div",{role:"row",className:(0,_.cn)(j,"min-h-16 border-b border-gray-200 py-3",e.isYesterday?"text-gray-500":"text-gray-900"),children:[(0,l.jsx)("span",{role:"cell",children:e.label}),(0,l.jsx)("span",{role:"cell",className:C,children:e.risk?(0,l.jsx)(b.PollenRiskIndicator,{level:e.risk,reserveSpace:!0}):"–"}),(0,l.jsx)("span",{role:"cell",className:N,children:null!==e.count?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"font-bold",children:e.count}),(0,l.jsx)("span",{className:"text-xs",children:L.POLLEN_COUNT_UNIT})]}):"–"}),(0,l.jsxs)("span",{role:"cell",className:(0,_.cn)(P,"items-center gap-1.5"),children:[e.weather?.iconCode!==void 0&&(0,l.jsx)(v.WxIcon,{iconCode:e.weather.iconCode,size:"md"}),(0,l.jsx)("span",{className:(0,_.cn)("text-sm",(e.weather?.precipChance??0)>=L.PRECIP_ACCENT_THRESHOLD&&!e.isYesterday?"text-[#1866e1]":"text-gray-500"),children:e.weather?.precipChance!==void 0?`${e.weather.precipChance}%`:"–"})]}),(0,l.jsx)("span",{role:"cell",className:(0,_.cn)(P,"justify-end"),children:e.weather?.humidity!==void 0?`${e.weather.humidity}%`:"–"}),(0,l.jsx)("span",{role:"cell",className:(0,_.cn)(P,"justify-end"),children:e.weather?.windSpeed!==void 0?`${e.weather.windSpeed} ${t}`:"–"})]},e.key))]})})]})},S=({location:e})=>{var t,a;let r,x=(0,o.useTranslations)("AllergyForecast"),v=(0,s.useLocale)(),{data:_,error:b,isPending:L}=(0,c.usePollenForecast)(e),{weatherByDate:j,speedUnit:C}=function(e){let l=(0,s.useLocale)(),t=(0,n.useAtomValue)(h.userUnitPreferenceAtom),a=(0,y.unitsSystemByName)(t),r=a?.code??"e",{data:o,error:i}=(0,m.default)(e?.geocode?["get-daily-forecast",e.geocode,g.ForecastDuration.FIVE_DAY,r,l]:null,([,e,l,t,a])=>(0,p.getDailyForecast)({geocode:e,duration:l,units:t,language:a}),{revalidateOnFocus:!1,dedupingInterval:6e4});return{weatherByDate:o?function(e){let l={};for(let t of e){let e=f(t.validTimeLocal);if(!e)continue;let a=t.daypart[0]??t.daypart[1];l[e]={iconCode:a?.iconCode,precipChance:a?.precipChance,humidity:a?.relativeHumidity,windSpeed:a?.windSpeed}}return l}(o):void 0,speedUnit:a?.speed??"mph",error:i}}(e),N=(0,n.useAtomValue)(d.showAdminHeaderAtom);if(b||!L&&!_)return null;let P=_?(t={yesterday:x("yesterday"),today:x("today")},a=e?.ianaTimeZone,r=[],_.yesterday&&r.push({key:"yesterday",label:t.yesterday,isYesterday:!0,risk:_.yesterday.risk,count:_.yesterday.count}),_.days.forEach((e,l)=>{r.push({key:e.validTimeLocal,label:0===l?t.today:(0,u.formatPollenDayLabel)(e.validTimeLocal,v,a),risk:e.risk,count:e.count,weather:j?.[f(e.validTimeLocal)]})}),r):[];return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(i.DebugCollector,{componentName:"AllergyForecast",data:{props:{location:e},state:{rows:P,error:b,componentState:L?"loading":"ready"}},enabled:N}),(0,l.jsx)(w,{rows:P,speedUnit:C,isLoading:L})]})},k=(0,t.default)(()=>e.A(178135),{loadableGenerated:{modules:[515900]}}),E=({globalPageProps:e})=>{let{location:t}=(0,a.useLocation)();return(0,r.hasAmbeeCoverage)(t,e)?(0,l.jsx)(S,{location:t}):(0,l.jsx)(k,{location:t})};e.s(["AllergyForecastBlockClient",0,E,"default",0,E],564599)},513722,function(e){e.n(e.i(564599))},178135,e=>{e.v(l=>Promise.all(["static/immutable/chunks/2391w5-jagsqe.js"].map(l=>e.l(l))).then(()=>l(515900)))},385636,e=>{"use strict";var l=e.i(902875),t=e.i(581014),a=e.i(632137),r=e.i(175424);let n=({level:e,reserveSpace:t=!1,className:n})=>{let s=r.POLLEN_RISK_BARS[e];return(0,l.jsx)("span",{"aria-hidden":"true",className:(0,a.cn)("inline-flex h-3 shrink-0 items-end gap-0.5",n),children:Array.from({length:t?4:s},(t,a)=>(0,l.jsx)("span",{className:"h-full w-1 rounded-xs",style:a{let u=(0,t.useTranslations)("Pollen"),m=(0,l.jsx)(n,{level:e,reserveSpace:i});return(0,l.jsxs)("span",{className:(0,a.cn)("inline-flex items-center","badge"===s?"h-6 gap-1 rounded bg-[#f2f2f2] px-2 text-xs font-bold":"gap-2",d),children:[o&&m,(0,l.jsx)("span",{className:c,children:u(r.POLLEN_RISK_LABEL_KEYS[e])}),!o&&m]})}])},923931,e=>{"use strict";var l=e.i(873598);e.s(["formatPollenDayLabel",0,function(e,t,a){let r,n=new Date(e);if(Number.isNaN(n.getTime()))return"";let s=new Intl.DateTimeFormat(t,(r={weekday:"short",day:"numeric"},a?{...r,timeZone:(0,l.getCompatibleTimezone)(a)}:r));if(!t.startsWith("en"))return s.format(n);let o=s.formatToParts(n),i=o.find(e=>"weekday"===e.type)?.value??"",d=o.find(e=>"day"===e.type)?.value??"";return`${i} ${d}`.trim()},"formatPollenMonth",0,function(e,l,t="long"){return e12?"":new Intl.DateTimeFormat(l,{month:t,timeZone:"UTC"}).format(new Date(Date.UTC(2e3,e-1,15,12)))}])},860082,e=>{"use strict";var l=e.i(533694),t=e.i(181462);e.s(["hasAmbeeCoverage",0,(e,a,r=!0)=>e?(0,l.isConus)(e):(0,t.getServerLocationIsConus)(a)??r])},175424,e=>{"use strict";e.s(["POLLEN_COUNT_UNIT",0,"/m³","POLLEN_RISK_BARS",0,{low:1,moderate:2,high:3,veryHigh:4},"POLLEN_RISK_COLORS",0,{low:"#4ed07b",moderate:"#ffb900",high:"#ff4c00",veryHigh:"#ba0d00"},"POLLEN_RISK_LABEL_KEYS",0,{low:"riskLow",moderate:"riskModerate",high:"riskHigh",veryHigh:"riskVeryHigh"},"POLLEN_RISK_LEVELS",0,["low","moderate","high","veryHigh"],"POLLEN_SPECIES",0,["tree","grass","ragweed"],"PRECIP_ACCENT_THRESHOLD",0,30])},731947,e=>{"use strict";var l=e.i(381477),t=e.i(730921),a=e.i(550008),r=e.i(45776),n=e.i(533694),s=e.i(175424);let o={tree:"tree",grass:"grass",ragweed:"weed"},i=(e,l)=>e?.[l]??null;e.s(["usePollenForecast",0,function(e){let d=(0,t.useLocale)(),c=!!e&&!(0,n.isConus)(e),u=c?void 0:e?.geocode,{data:m,error:h}=(0,l.default)(u?["pollenForecastDaily",u,d]:null,([,e,l])=>(0,a.getPollenForecastDaily)({geocode:e,language:l}),{revalidateOnFocus:!1,dedupingInterval:6e4}),{data:y,error:p}=(0,l.default)(u?["pollenObservations",u,d]:null,([,e,l])=>(0,a.getPollenObservations)({geocode:e,language:l}),{revalidateOnFocus:!1,dedupingInterval:6e4}),g=!!(y||p);return{data:m&&g?function(e,l){let t=(e.validTimeLocal??[]).map((l,t)=>{let a={};for(let l of s.POLLEN_SPECIES){let n=o[l];a[l]={count:i(e[`${n}PollenCountMean`],t),risk:(0,r.getPollenRiskLevel)(i(e[`${n}PollenIndexMean`],t))}}return{validTimeLocal:l,count:i(e.totalPollenCountMean,t),peak:i(e.totalPollenCountMax,t),risk:(0,r.getPollenRiskLevel)(i(e.totalPollenIndexMean,t)),species:a}});if(!t.length)return null;let a=function(e){if(!e)return null;let l=(0,r.getPollenRiskLevel)(e.total_pollen_idx);return null!==e.total_pollen_cnt||l?{count:e.total_pollen_cnt,risk:l}:null}(l?.pollenobservations?.[0]),n=t[0]?.count??null,d=null!==n&&a?.count!=null?n-a.count:null;return{days:t,yesterday:a,changeFromYesterday:d}}(m,y):null,observations:y??null,error:h,isPending:!c&&!h&&(!m||!g)}}])}]);