PageSourceSearch

https://www.birminghamal.gov/_next/static/chunks/pages/events/calendar/[date]-8ad62efc13e818c5.js

js birminghamal.gov collected 2026-10-02 02:57:48 UTC 12,293 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[240],{7726:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/events/calendar/[date]",function(){return a(5523)}])},37:function(e,t,a){"use strict";a.d(t,{Y:function(){return m}});var n=a(2322),r=a(2784),l=a(9097),s=a.n(l),i=a(1286),o=a(5632),c=a(5705),d=a(6925),p=a(4978);let u="https://content.birminghamal.gov/api/alerts/www";function m(e){var t;let{midSection:a,children:l,header:m,footer:h,topSection:v,extraPrefaceWrapperClasses:f,extraChildWrapperClasses:g}=e,y=(0,o.useRouter)(),{data:x,error:_}=(0,i.ZP)(u,p.C,{refreshInterval:3e4,revalidateOnFocus:!0,revalidateIfStale:!0,dedupingInterval:0,keepPreviousData:!1,revalidateOnReconnect:!0}),w=null!==(t=null==x?void 0:x.alerts)&&void 0!==t?t:[];_&&console.log("Error fetching alerts:",_),(0,r.useEffect)(()=>{let e=()=>(0,i.JG)(u);return y.events.on("routeChangeComplete",e),()=>{y.events.off("routeChangeComplete",e)}},[y.events]);let S=(0,r.useRef)(null);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(d.n,{}),w.length>0&&w.map(e=>{var t;return(0,n.jsx)("section",{id:"alert-content","aria-label":"Site alert",children:(0,n.jsx)(c.bZ,{id:e.id,severity:e.severity,title:e.title,body:"string"==typeof e.body?e.body:(null===(t=e.body)||void 0===t?void 0:t.processed)||"",icon:"message-exclamation",dismissible:"emergency"!==e.severity})},e.id)}),(0,n.jsx)(s(),{href:"#main-content",className:"absolute overflow-hidden h-[1px] w-[1px] focus:static focus:w-auto focus:h-auto focus:border-2 focus:border-black",onKeyDown:e=>{if("Enter"===e.key||" "===e.key){var t;e.preventDefault(),null===(t=S.current)||void 0===t||t.focus()}},tabIndex:0,children:"Skip to main content"}),(0,n.jsx)(c.h4,{...m}),(0,n.jsx)("main",{className:"pb-s dark:bg-coolGray-10 dark:text-white",id:"main-content",tabIndex:-1,ref:S,children:(0,n.jsxs)("div",{className:"container",children:[v&&(0,n.jsx)("div",{className:"w-full",children:v}),a&&(0,n.jsx)("div",{className:f,children:a}),(0,n.jsxs)("div",{className:g,children:[l?null:(0,n.jsx)(c.Vm,{}),l]})]})}),(0,n.jsx)(c.$_,{...h})]})}},542:function(e,t,a){"use strict";function n(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;void 0===window.mixpanel&&function(e,t){if(!t.__SV){var a,n,r,l;window.mixpanel=t,t._i=[],t.init=function(e,a,n){var s=t;for(void 0!==n?s=t[n]=[]:n="mixpanel",s.people=s.people||[],s.toString=function(e){var t="mixpanel";return"mixpanel"!==n&&(t+="."+n),e||(t+=" (stub)"),t},s.people.toString=function(){return s.toString(1)+".people (stub)"},r="disable time_event track track_pageview track_links track_forms track_with_groups add_group set_group remove_group register register_once alias unregister identify name_tag set_config reset opt_in_tracking opt_out_tracking has_opted_in_tracking has_opted_out_tracking clear_opt_in_out_tracking start_batch_senders people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user people.remove".split(" "),l=0;l<r.length;l++)!function(e,t){var a=t.split(".");2==a.length&&(e=e[a[0]],t=a[1]),e[t]=function(){e.push([t].concat(Array.prototype.slice.call(arguments,0)))}}(s,r[l]);var i="set set_once union unset remove delete".split(" ");s.get_group=function(){for(var e={},t=["get_group"].concat(Array.prototype.slice.call(arguments,0)),a=0;a<i.length;a++)!function(a){e[a]=function(){call2_args=arguments,call2=[a].concat(Array.prototype.slice.call(call2_args,0)),s.push([t,call2])}}(i[a]);return e},t._i.push([e,a,n])},t.__SV=1.2,(a=e.createElement("script")).type="text/javascript",a.async=!0,a.src="undefined"!=typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===e.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js",(n=e.getElementsByTagName("script")[0]).parentNode.insertBefore(a,n)}}(document,window.mixpanel||[]),mixpanel.init("f6049e293b681dae7303948b362cff82",{track_pageview:!1,persistence:"localStorage"});let s={subsite:"www",page_title:r||t.title,protected_access:l||null};null===r&&(s.page_title=t.title,s.page_type=e,s.department=a,s.categories=n,null!==e&&(s.node_id=t.id,s.last_updated=t.changed)),mixpanel.track_pageview(s)}a.d(t,{c:function(){return n}})},5523:function(e,t,a){"use strict";a.r(t),a.d(t,{__N_SSG:function(){return m}});var n=a(2322),r=a(2784),l=a(5632),s=a(5705),i=a(31),o=a(37),c=a(4100),d=a(542),p=a(9734);let u=e=>Array.isArray(e)?e[0]||"":e||"";var m=!0;t.default=e=>{let{layout:t,date:a,categories:m,departments:h,districts:v}=e,f=(0,l.useRouter)(),[g,y]=(0,r.useState)(""),{query:x}=f,[_,w]=(0,r.useState)(""),S=t.name,[j,b]=(0,r.useState)([]),[C]=(0,r.useState)(0),[k,D]=(0,r.useState)(u(x.search)),[E,N]=(0,r.useState)(u(x.category)),[T,A]=(0,r.useState)(u(x.department)),[I,L]=(0,r.useState)(u(x.district)),[R,q]=(0,r.useState)(!0),O=f.query,P=e=>Array.isArray(e)?e[0]:e||"",[U,W]=(0,r.useState)(O.search||""),[B,M]=(0,r.useState)(O.category||""),[F,$]=(0,r.useState)(O.department||""),[z,K]=(0,r.useState)(O.district||""),[V,X]=(0,r.useState)(!1);(0,r.useEffect)(()=>
1{if(f.isReady){var e;let t=null===(e=f.asPath.split("/").pop())||void 0===e?void 0:e.split("?")[0];if(t&&/^\d{4}-\d{2}-\d{2}$/.test(t))y(t),Z(t),J(t);else{let e=new Date().toISOString().split("T")[0];y(e),Z(e),J(e)}}},[f.isReady,f.asPath]),(0,r.useEffect)(()=>{(0,d.c)(null,null,null,null,"Event Calendar By Date")},[]),(0,r.useEffect)(()=>{w(new Date().toISOString().split("T")[0])},[]);let[G]=(0,r.useState)(()=>{let e=f.asPath.split("/").pop();return e&&/^\d{4}-\d{2}-\d{2}$/.test(e)?e:a&&/^\d{4}-\d{2}-\d{2}$/.test(a)?a:new Date().toISOString().split("T")[0]}),[H,Z]=(0,r.useState)(G),[Y,J]=(0,r.useState)(G);(0,r.useEffect)(()=>{let e=e=>{var t;let a=null===(t=e.split("/").pop())||void 0===t?void 0:t.split("?")[0];a&&/^\d{4}-\d{2}-\d{2}$/.test(a)&&(Z(a),J(a),y(a))};return f.events.on("routeChangeComplete",e),()=>{f.events.off("routeChangeComplete",e)}},[f.events]);let[Q,ee]=(0,r.useState)([]);(0,r.useEffect)(()=>{(async e=>{let t=e.slice(0,7),a=new Date(t+"-01T00:00:00Z");a.setUTCMonth(a.getUTCMonth()+1),a.setUTCDate(0);let n=a.toISOString().split("T")[0];try{let e=new URLSearchParams({fromDate:"".concat(t,"-01"),toDate:n,search:k||"",department:T||"",category:E||"",district:I||""}),a=await fetch("/api/search/events-calendar?".concat(e.toString())),r=await a.json();if(r&&r.graphqlEventsCalendarSearchWww){let e=r.graphqlEventsCalendarSearchWww.results.map(e=>{let t=e=>{let t="America/Chicago",a=new Date(e),n=(0,p.zW)(a,t);return(0,p.WU)(n,"yyyy-MM-dd'T'HH:mm:ss",{timeZone:t})};return{...e,startDate:{...e.startDate,time:t(e.startDate.time)},endDate:{...e.endDate,time:t(e.endDate.time)}}});ee(e);let t=new Set,a=new Set;r.graphqlEventsCalendarSearchWww.results.forEach(e=>{e.category&&t.add(e.category),e.department&&a.add(e.department)})}}catch(e){console.error("Failed to fetch events",e)}finally{q(!1)}})(Y)},[Y,k,T,E,I]);let et=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"";try{let i=await fetch("/api/search/events-calendar?offset=".concat(e,"&search=").concat(t,"&fromDate=").concat(a,"&toDate=").concat(n,"&department=").concat(r,"&category=").concat(l,"&district=").concat(s)),o=await i.json();if(o&&o.graphqlEventsCalendarSearchWww){b(o.graphqlEventsCalendarSearchWww.results||[]);let e=new Set,t=new Set;o.graphqlEventsCalendarSearchWww.results.forEach(a=>{a.category&&e.add(a.category),a.department&&t.add(a.department)})}else console.error("Unexpected data structure:",o)}catch(e){console.error("Failed to fetch events",e)}finally{q(!1)}},ea=e=>({fromDate:"".concat(e,"T00:00:00"),toDate:"".concat(e,"T23:59:59")});return(0,r.useEffect)(()=>{let{fromDate:e,toDate:t}=ea(H);et(C,k,e,t,T,E,I)},[C,k,H,T,E,I]),(0,n.jsx)(i.W,{children:(0,n.jsxs)(o.Y,{header:t.header,footer:t.footer,topSection:(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(s.KI,{heading:"Daily",date:_,padding:!0,page:"date",breadcrumbs:[{title:"Home",url:"/",internal:!0,__typename:"Link"},{title:"Events",url:"/events",internal:!0,__typename:"Link"},{title:"Calendar",url:"/events/calendar",internal:!0,__typename:"Link"},{title:"Daily",url:"#",internal:!0,__typename:"Link"}]})}),midSection:function(e,t,a){let l=()=>{D(P(U)),N(P(B)),A(P(F)),D(P(U)),N(P(B)),L(P(z)),X(!0),f.push({pathname:f.pathname,query:{...f.query,search:P(U),category:P(B),department:P(F),district:P(z)}},void 0,{shallow:!0})};return(0,r.useEffect)(()=>{if(f.isReady){let e=f.query;(e.search||e.category||e.department||e.eventType)&&(D(P(e.search)),N(P(e.category)),A(P(e.department)),L(P(e.district)),X(!0))}}),(0,n.jsxs)(s.S6,{title:"Filters",children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("label",{className:"font-medium dark:text-white",children:"Search"}),(0,n.jsx)("input",{type:"text",value:U,onChange:e=>W(e.target.value),placeholder:"Search by title or summary","aria-label":"Search",onKeyDown:e=>{"Enter"===e.key&&l()}})]}),(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("label",{className:"font-medium dark:text-white",children:"By Category"}),(0,n.jsxs)("select",{name:"Category",id:"CategoryTerm",onChange:e=>M(e.target.value),value:B,"aria-label":"Select category",children:[(0,n.jsx)("option",{value:"",children:"Any"}),e&&e.map(e=>(0,n.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("label",{className:"font-medium dark:text-white",children:"By Department"}),(0,n.jsxs)("select",{name:"Departments",id:"DepartmentTerm",onChange:e=>$(e.target.value),value:F,"aria-label":"Select department",children:[(0,n.jsx)("option",{value:"",children:"Any"}),t&&t.map(e=>(0,n.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("label",{className:"font-medium dark:text-white",children:"By District"}),(0,n.jsxs)("select",{name:"District",id:"DistrictTerm",onChange:e=>K(e.target.value),value:z,"aria-label":"District",children:[(0,n.jsx)("option",{value:"",children:"Any"}),a&&a.map(e=>(0,n.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,n.jsxs)("div",{className:"flex",children:[(0,n.jsx)(s.zx,{onClick:l,title:"Ap
1ply",ariaLabel:"Apply",additionalClasses:"mr-3"}),V&&(0,n.jsx)(s.zx,{onClick:()=>{W(""),M(""),$(""),D(""),N(""),A(""),L(""),X(!1),f.push({pathname:"/events/calendar/"+f.query.date,query:{}},void 0,{shallow:!0}),X(!1)},title:"Reset",buttonStyle:"secondary",ariaLabel:"Reset filters"})]})]})}(m,h,v),extraChildWrapperClasses:"relative grid xl:grid-cols-12 xl:col-span-4",extraPrefaceWrapperClasses:"w-full mb-[2.4rem]",children:[(0,n.jsx)(c.S,{title:"Daily Calendar | ".concat(S),description:"View a list of ".concat(S," events by day that you can filter to find what you need."),norobots:"true"}),R?(0,n.jsx)(s.tv,{}):(0,n.jsx)(s.B3,{events:Q,currentDate:Y,setCurrentDate:J,handleDateClick:e=>{let t=e.toISOString().split("T")[0];Z(t),f.push("/events/calendar/".concat(t),void 0,{shallow:!0})},selectedDate:H}),(0,n.jsx)("div",{className:"grid gap-s xl:gap-s-desktop mb-s xl:mb-s-desktop xl:col-span-8",children:R?(0,n.jsx)(s.Rl,{}):j.length>0?(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"flex items-center justify-between pt-2 pb-1",children:(0,n.jsxs)("h2",{children:["Events for ",H]})}),j.map((e,t)=>{var a;return(0,n.jsx)(s.K7,{title:e.title,date:{timestamp:(a=e.startDate).timestamp||new Date(a.time).getTime()/1e3,time:a.time,timezone:"UTC",offset:0,__typename:"DateTime"},link:e.path,border:"bottom"},t)})]}):(0,n.jsxs)("p",{children:["No events found for ",H,"."]})})]})})}}},function(e){e.O(0,[538,436,335,888,774,179],function(){return e(e.s=7726)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.