PageSourceSearch

https://www.thefair.com/component---src-templates-global-finder-tsx-cd08f8b8574b6f926c85.js

js thefair.com collected 2026-10-02 03:03:40 UTC 13,897 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkwsfec_website=self.webpackChunkwsfec_website||[]).push([[7286],{3334:function(e,t,l){l.r(t),l.d(t,{Head:function(){return I},default:function(){return _}});var i=l(4506),n=l(6540),a=l(4129),o=l(6462),s=l(9602),r=l(1042),d=l(7654),c=l(4625),u=l(1608),m=l(3094),p=l(9163),v=l(7496),g=l(7689),h=l(3806),f=l(1592),C=l(3628),y=l(9747),b=l(3957),S=l(5655),F=l(2495),w=l.n(F),k=l(4019);const A=(e,t,l,i,n)=>e.map(e=>{const a=D(e.id,e.title);return i.includes(e.id)?{id:e.id,name:e.title,slug:a,checked:t.includes(a),onChange:()=>n(l,e.id)}:null}).filter(e=>null!==e),D=(e,t)=>`${e.split("-")[0].toLowerCase().replace("datocms","")}-${w()(t,{lower:!0,strict:!0})}`,P=(e,t,l,i,n,a,o,s)=>{let r=l.map(e=>{if(!o.includes(e.id))return null;const t=E(e.id,e.title);return{id:e.id,name:e.title,slug:t,selected:i.includes(t),onChange:()=>s(a,e.id)}}).filter(e=>null!==e);return{id:e,name:t,type:n,datoType:l[0].__typename,options:r}},E=(e,t)=>`${e.split("-")[0].toLowerCase().replace("datocms","")}-${w()(t,{lower:!0,strict:!0})}`;var T=l(4609),G=l(9519),x=l(4653),q=l(2849),M=l(2251),L=l(8275),R=l(138);const $=(e,t)=>{const l=t[e],n=l.quickFilters.map(e=>e.checked?e.id:null).filter(e=>null!==e),a=l.dropdownFilters.flatMap(e=>e.options.filter(e=>e.selected).map(e=>e.id)),o=[].concat((0,i.A)(n),(0,i.A)(a)),s=Array.from(new Set(o));return(0,T.H)(s)};var O=l(6004),U=l(8097);var _=({data:e,pageContext:t})=>{var l,r,S,F,A,D,P,E,T,_;const I=(0,s.U)("only screen and (max-width: 889px)"),H={performances:(0,v.k)(),activities:(0,g.y)(),animalExhibits:(0,h.l)(),vendors:(0,f.C)(),rides:(0,C.o)(),services:(0,y.X)(),allSitePageData:(0,b.F)()},K=(e,t)=>{ie(l=>{const i=l[e],n=i.quickFilters.map(e=>e.id===t?{...e,checked:!e.checked}:e),a=i.dropdownFilters.map(e=>({...e,options:e.options.map(e=>e.id===t?{...e,selected:!e.selected}:e)}));return{...l,[e]:{quickFilters:n,dropdownFilters:a}}})},N=(e,t)=>{ie(l=>{const i=l[e],n=i.quickFilters.map(e=>e.id===t?{...e,checked:!1}:e),a=i.dropdownFilters.map(e=>({...e,options:e.options.map(e=>e.id===t?{...e,selected:!1}:e)}));return{...l,[e]:{quickFilters:n,dropdownFilters:a}}})},W=e=>{ye(he),Se(fe),we(!0),I&&Ae(!0),ge(t=>t.map(t=>{var l;const i=t.id===e;return{...t,isActive:i,locations:null===(l=t.locations)||void 0===l?void 0:l.map(e=>({...e,active:i}))}}))},X=(0,o.useLocation)();let B=((e,t,l)=>{const i=[];return i.push({id:"all",title:"All Events",slug:"all",buttonText:"All",isActive:"all"===e,onClick:()=>l("all")}),t.forEach(t=>{var n;if(!t||!t.id||!t.contentType)return;const a=(0,k.M)(null===(n=t.model)||void 0===n?void 0:n.fields,"content_type",t.contentType)||t.contentType,o=w()(t.contentType,{lower:!0,strict:!0});let s=e===o;i.push({id:t.id,buttonText:a,title:a,slug:`${o}`,isActive:s,onClick:()=>l(t.id)})}),i})("all",null===(l=e.datoCmsGlobalFinderPage)||void 0===l?void 0:l.findersContent,e=>{pe(!0),Q(t=>t.map(t=>({...t,isActive:t.id===e})));const t=J.find(t=>t.id===e)||J[0];te(t)});const{0:J,1:Q}=(0,n.useState)(B);let Y=z(B);const{0:ee,1:te}=(0,n.useState)(Y),{0:le,1:ie}=(0,n.useState)({}),{0:ne,1:ae}=(0,n.useState)({}),{0:oe,1:se}=(0,n.useState)(void 0),{0:re,1:de}=(0,n.useState)({}),{0:ce,1:ue}
1=(0,n.useState)([]),{0:me,1:pe}=(0,n.useState)(!0),{0:ve,1:ge}=(0,n.useState)([]),he={lat:parseFloat("47.181132"),lng:parseFloat("-122.298221")},fe=parseInt("16"),{0:Ce,1:ye}=(0,n.useState)(he),{0:be,1:Se}=(0,n.useState)(fe),{0:Fe,1:we}=(0,n.useState)(!1),{0:ke,1:Ae}=(0,n.useState)(!1),De=["DatoCmsPerformance","DatoCmsActivity","DatoCmsAnimalExhibit","DatoCmsVendor","DatoCmsRide","DatoCmsService"],Pe=()=>{const t=new URLSearchParams(X.search).get("tab")||"all",l=Z(X);se(l),de(j(e,X)),te(J.find(e=>e.slug===t)||J[0])};return(0,n.useEffect)(()=>{Pe();const e=()=>{Pe()};return window.addEventListener("popstate",e),()=>{window.removeEventListener("popstate",e)}},[]),(0,n.useEffect)(()=>{var t,l;let i=De;switch(ee.slug){case"musicentertainment":i=["DatoCmsPerformance"];break;case"activity":i=["DatoCmsActivity"];break;case"animal-exhibit":i=["DatoCmsAnimalExhibit"];break;case"vendor":i=["DatoCmsVendor"];break;case"ride":i=["DatoCmsRide"];break;case"service":i=["DatoCmsService"];break;default:i=De}ue((0,O.f)(H,i,oe,null===(t=e.datoCmsGlobalFinderPage)||void 0===t||null===(l=t.signatureEvent)||void 0===l?void 0:l.id))},[oe,ee]),(0,n.useEffect)(()=>{ie(V(e,re,ce,K)),Q(e=>e.map(e=>{const t=ee.slug===e.slug;return{...e,isActive:t}}))},[re,ce]),(0,n.useEffect)(()=>{var t,l;ge(((e,t,l,n,a,o)=>{if(!n[l]||!n[l].quickFilters)return[];const s=$(l,n);let r=[];switch(l){case"activity":r=(0,G.u)(e.activities,e.allSitePageData,t,s,a,o);break;case"animal-exhibit":r=(0,x.Z)(e.animalExhibits,e.allSitePageData,t,s,a,o);break;case"musicentertainment":r=(0,q.e)(e.performances,e.allSitePageData,t,s,a,o);break;case"vendor":r=(0,M.i)(e.vendors,e.allSitePageData,t,s,a,o);break;case"ride":r=(0,L.e)(e.rides,e.allSitePageData,t,s,a,o);break;case"service":r=(0,R.R)(e.services,e.allSitePageData,s,a);break;case"all":const l=(0,G.u)(e.activities,e.allSitePageData,t,s,a,o),n=(0,x.Z)(e.animalExhibits,e.allSitePageData,t,s,a,o),d=(0,q.e)(e.performances,e.allSitePageData,t,s,a,o),c=(0,M.i)(e.vendors,e.allSitePageData,t,s,a,o),u=(0,L.e)(e.rides,e.allSitePageData,t,s,a,o),m=(0,R.R)(e.services,e.allSitePageData,s,a);r=[].concat((0,i.A)(l),(0,i.A)(n),(0,i.A)(d),(0,i.A)(c),(0,i.A)(u),(0,i.A)(m));break;default:r=[]}return r.sort((e,t)=>{var l,i;const n=null!==(l=e.headline)&&void 0!==l?l:"",a=null!==(i=t.headline)&&void 0!==i?i:"";return n.localeCompare(a)}),r})(H,(null===(t=e.datoCmsGlobalFinderPage)||void 0===t||null===(l=t.signatureEvent)||void 0===l?void 0:l.id)||"",ee.slug||"",le,W,oe)),pe(!1);let n={};Object.entries(le).forEach(([e,t])=>{const l=t.quickFilters.filter(e=>e.checked).map(t=>({id:t.id,name:t.name,onClick:()=>N(e,t.id)})),a=t.dropdownFilters.flatMap(t=>t.options.filter(e=>e.selected).map(t=>({id:t.id,name:t.name,onClick:()=>N(e,t.id)}))),o=[].concat((0,i.A)(l),(0,i.A)(a)).filter((e,t,l)=>t===l.findIndex(t=>t.id===e.id));n[e]=o}),ae(e=>({...e,...n})),((e,t,l)=>{const n=new URLSearchParams(window.location.search);n.set("tab",e.slug||"all"),Object.entries(t).forEach(([e,t])=>{const l=t.quickFilters.filter(e=>e.checked).map(e=>e.slug),a=t.dropdownFilters.map(e=>e.options.filter(e=>e.selected).map(e=>e.slug)).flat(),o=[].concat((0,i.A)(l),(0,i.A)(a)),s=(0,i.A)(new Set(o));s.length>0?n.set(`${e}-ids`,s.join(",")):n.delete(`${e}-ids`)}),l&&n.set("date",l.toFormat("yyyy-MM-dd"));const a=`${window.location.pathname}?${n.toString()}`;window.history.replaceState({},"",a)})(ee,le,oe)},[ee,le,oe]),n.createElement(a.A,{navSection:t.navSection,breadcrumbs:t.breadcrumbs,currentPageId:t.id},n.createElement(d.A,{title:(null===(r=e.datoCmsGlobalFinderPage)||void 0===r?void 0:r.title)||"Finder Page",filters:J,titleComponent:"h1"}),me?n.createElement(m.A,{loadingText:"Loading..."}):n.createElement(n.Fragment,null,n.createElement(c.A,{pillFilters:ne[(null==ee?void 0:ee.slug)||"all"],clearAllPillFilters:e=>{const t=e.currentTarget.getAttribute("data-clear-all-key");t&&ie(e=>{const l=e[t],i=l.quickFilters.map(e=>({...e,checked:!1})),n=l.dropdownFilters.map(e=>({...e,options:e.options.map(e=>({...e,selected:!1}))}));return{...e,[t]:{quickFilters:i,dropdownFilters:n}}})},allFilters:le[(null==ee?void 0:ee.slug)||"all"],includeSearch:!1,initialDate:oe,selectedDateOnChange:e=>{const t=U.c9.fromISO(e,{zone:"America/Los_Angeles"});se(t)},itemCount:ve.length,clearAllKey:(null==ee?void 0:ee.slug)||"all"}),oe&&ee.slug&&(null===(S=e.datoCmsGlobalFinderPage)||void 0===S||null===(F=S.signatureEvent)||void 0===F?void 0:F.id)&&ve.length>0&&n.createElement(u.A,{mapCards:ve,mapCenter:Ce,mapZoom:be,shouldUpdateMap:Fe,setShouldUpdateMap:we,shouldShowMap:ke,setShouldShowMap:Ae,setActiveCards:(e,t)=>{ge(l=>l.map(l=>{var i;const n=e.includes(l.id);let a=!1;return 1===e.length&&!1===I&&n&&!l.isActive&&(a=!0),{...l,isActive:n,scrollIntoView:a,locations:null===(i=l.locations)||void 0===i?void 0:i.map(e=>{const l=t.includes(e.id);return{...e,active:l}})}}))},signatureEventLogo:null!==(A=null===(D=e.datoCmsSignatureEvent)||void 0===D?void 0:D.logo)&&void 0!==A?A:void 0,signatureEventTitle:null!==(P=null===(E=e.datoCmsSignatureEvent)||void 0===E?void 0:E.title)&&void 0!==P?P:void 0,searchDate:oe}),oe&&ee.slug&&(null===(T=e.datoCmsGlobalFinderPage)||void 0===T||null===(_=T.signatureEvent)||void 0===_?void 0:_.id)&&ve.length<=0&&n.createElement(p.A,{fullWidth:!0,content:"No items match your current filters. Please change your filters and try again."})))};const I=e=>{var t,l,i,a;const o=null!==(t=null===(l=e.data.datoCmsGlobalFinderPage)||void 0===l?void 0:l.title)&&void 0!==t?t:"Finder Page",s=H(e.data);return n.createElement(r.A,{title:o,pageSeoMetaTags:null===(i=e.data.datoCmsGlobalFinderPage)||void 0===i||null===(a=i.seoMetaTags)||void 0===a?void 0:a.tags},s&&n.createElement("link",{rel:"canonical",href:s}))},H=e=>{var t,l,i,n;let a=(0,S.zC)(null!==(t=null===(l=e.datoCmsGlobalFinderPage)||void 0===l?void 0:l.id)&&void 0!==t?t:null,null!==(i=null===(n=e.datoCmsSignatureEvent)||void 0===n?void 0:n.id)&&void 0!==i?i:null);if(null!==a){var s;const e=(0,o.useLocation)();a=`${null!==(s=null==e?void 0:e.origin)&&void 0!==s?s:""}${a}`}return a},Z=e=>{const t=new URLSearchParams(e.search),l=U.c9.now().setZone("America/Los_Angeles").startOf("day"),i=t.get("date");return i?U.c9.fromFormat(i,"yyyy-MM-dd").startOf("day"):l},j=(e,t)=>{var l,i,n,a;const o=new URLSearchParams(t.search),s={"all-ids":null!==(l=null===(i=o.get("all-ids"))||void 0===i?void 0:i.split(","))&&void 0!==l?l:[]};return null===(n=e.datoCmsGlobalFinderPage)||void 0===n||null===(a=n.findersContent)||void 0===a||a.forEach(e
1=>{var t,l;if(!e||!e.contentType)return;const i=w()(e.contentType,{lower:!0,strict:!0}),n=null!==(t=null===(l=o.get(`${i}-ids`))||void 0===l?void 0:l.split(","))&&void 0!==t?t:[];s[`${i}-ids`]=n}),s},V=(e,t,l,i)=>{var n,a;const o={},s="all-ids",r=s in t?t[s]:[],d=K(e,r,l,i);return o.all=d,null===(n=e.datoCmsGlobalFinderPage)||void 0===n||null===(a=n.findersContent)||void 0===a||a.forEach(n=>{if(!n||!n.contentType)return;const a=w()(n.contentType,{lower:!0,strict:!0}),s=`${a}-ids`,r=s in t?t[s]:[],d=((e,t,l,i,n)=>{var a,o,s,r,d,c,u,m,p,v,g,h,f;if(!t||!t.contentType)return{quickFilters:[],dropdownFilters:[]};const C=w()(t.contentType,{lower:!0,strict:!0});let y=null!==(a=t.quickFilters)&&void 0!==a?a:[],b=A(y,l,C,i,n),S=[];const F=e.allDatoCmsAgeGroup.edges.map(e=>e.node);let k=null!==(o=null==t?void 0:t.ageGroup)&&void 0!==o&&o?P("ageGroup","Age Group",F,l,"multi",C,i,n):null;k&&k.options.length>0&&S.push(k);const D=e.allDatoCmsSubcategory.edges.map(e=>e.node);let E=null!==(s=null==t?void 0:t.subcategory)&&void 0!==s&&s?P("subcategory","Subcategory",D,l,"multi",C,i,n):null;E&&E.options.length>0&&S.push(E);const T=e.allDatoCmsCost.edges.map(e=>e.node);let G=null!==(r=null==t?void 0:t.cost)&&void 0!==r&&r?P("cost","Cost",T,l,"multi",C,i,n):null;G&&G.options.length>0&&S.push(G);const x=e.allDatoCmsAnimal.edges.map(e=>e.node);let q=null!==(d=null==t?void 0:t.animal)&&void 0!==d&&d?P("animal","Animal",x,l,"multi",C,i,n):null;q&&q.options.length>0&&S.push(q);const M=e.allDatoCmsPerformanceType.edges.map(e=>e.node);let L=null!==(c=null==t?void 0:t.performanceType)&&void 0!==c&&c?P("performanceType","Performance Type",M,l,"multi",C,i,n):null;L&&L.options.length>0&&S.push(L);const R=e.allDatoCmsMusicGenre.edges.map(e=>e.node);let $=null!==(u=null==t?void 0:t.musicGenre)&&void 0!==u&&u?P("musicGenre","Music Genre",R,l,"multi",C,i,n):null;$&&$.options.length>0&&S.push($);const O=e.allDatoCmsCuisine.edges.map(e=>e.node);let U=null!==(m=null==t?void 0:t.cuisine)&&void 0!==m&&m?P("cuisine","Cuisine",O,l,"multi",C,i,n):null;U&&U.options.length>0&&S.push(U);const _=e.allDatoCmsDietaryOption.edges.map(e=>e.node);let I=null!==(p=null==t?void 0:t.dietaryOptions)&&void 0!==p&&p?P("dietaryOptions","Dietary Options",_,l,"multi",C,i,n):null;I&&I.options.length>0&&S.push(I);const H=e.allDatoCmsRideType.edges.map(e=>e.node);let Z=null!==(v=null==t?void 0:t.rideType)&&void 0!==v&&v?P("rideType","Ride Type",H,l,"multi",C,i,n):null;Z&&Z.options.length>0&&S.push(Z);const j=e.allDatoCmsRideExperience.edges.map(e=>e.node);let V=null!==(g=null==t?void 0:t.rideExperience)&&void 0!==g&&g?P("rideExperience","Ride Experience",j,l,"multi",C,i,n):null;V&&V.options.length>0&&S.push(V);const z=e.allDatoCmsHeightRequirement.edges.map(e=>e.node);let K=null!==(h=null==t?void 0:t.height)&&void 0!==h&&h?P("height","Height Requirement",z,l,"multi",C,i,n):null;K&&K.options.length>0&&S.push(K);const N=e.allDatoCmsServiceCategory.edges.map(e=>e.node);let W=null!==(f=null==t?void 0:t.serviceCategory)&&void 0!==f&&f?P("serviceCategory","Service Category",N,l,"multi",C,i,n):null;return W&&W.options.length>0&&S.push(W),{quickFilters:b,dropdownFilters:S}})(e,n,r,l,i);o[a]=d}),o},z=e=>e.find(e=>e.isActive)||e[0],K=(e,t,l,i)=>{var n,a,o,s,r,d;let c=null!==(n=null===(a=e.datoCmsGlobalFinderPage)||void 0===a?void 0:a.quickFilters)&&void 0!==n?n:[],u=A(c,t,"all",l,i),m=[],p=e.allDatoCmsSubcategory.edges.map(e=>e.node);let v=null!==(o=null===(s=e.datoCmsGlobalFinderPage)||void 0===s?void 0:s.subcategory)&&void 0!==o&&o?P("subcategory","Subcategory",p,t,"multi","all",l,i):null;v&&v.options.length>0&&m.push(v);let g=e.allDatoCmsCost.edges.map(e=>e.node);let h=null!==(r=null===(d=e.datoCmsGlobalFinderPage)||void 0===d?void 0:d.cost)&&void 0!==r&&r?P("cost","Cost",g,t,"multi","all",l,i):null;return h&&h.options.length>0&&m.push(h),{quickFilters:u,dropdownFilters:m}}},4019:function(e,t,l){l.d(t,{M:function(){return i}});const i=(e,t,l)=>{const i=e.find(e=>e.apiKey===t);if(!i)return;let n=i.appeareance;if(!n)return;let a=n.parameters.options.find(e=>e.value===l);return a?a.label:void 0}}}]);
2//# sourceMappingURL=component---src-templates-global-finder-tsx-cd08f8b8574b6f926c85.js.map

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.