1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3302],{3302:(e,t,n)=>{n.r(t),n.d(t,{default:()=>en});var i=n(37876),o=n(14232),r=n(88520),a=n(6407),d=n(5646),s=n(22112);let{lg:l,md:c}=s.fi,p=d.Ay.div.withConfig({componentId:"sc-65245e60-0"})(["width:100%;margin-top:40px;",""],e=>{let{open:t}=e;return t&&"z-index: 2;"}),h=d.Ay.div.withConfig({componentId:"sc-65245e60-1"})(["display:flex;flex-direction:column;position:relative;z-index:9;"]);d.Ay.div.withConfig({componentId:"sc-65245e60-2"})(["display:flex;flex-direction:column;position:relative;z-index:1;"]);let x=d.Ay.div.withConfig({componentId:"sc-65245e60-3"})(["max-height:calc(80vh - 195px);overflow:scroll;width:100%;position:absolute;top:calc(100% + 8px);left:0px;display:flex;flex-wrap:wrap;border-radius:12px;background:",";padding:16px 17px;box-shadow:2px 2px 4px 4px rgba(0,0,0,0.2);display:flex;flex-direction:column;overflow-x:hidden;> div{&:not(:last-child){margin-bottom:24px;}}&::-webkit-scrollbar{width:10px;}&::-webkit-scrollbar-thumb{background-color:rgba(96,96,96,0.8);border-radius:4px;}&::-webkit-scrollbar-track{background:transparent;}","{background:transparent;box-shadow:unset;max-height:calc(100vh - 195px);}"],s.Tj.c17,c),g=d.Ay.div.withConfig({componentId:"sc-65245e60-4"})(["display:flex;flex-direction:column;"]),u=(0,d.AH)(["font-size:24px;font-weight:bold;margin-left:10px;"]),m=(0,d.AH)(["margin-left:10px;font-size:18px;color:",";"],s.Tj.c4),f=(0,d.AH)(["color:",";"],s.Tj.c4);d.Ay.div.withConfig({componentId:"sc-65245e60-5"})(["display:flex;flex-direction:column;margin-left:25px;margin-bottom:12px;cursor:pointer;&:last-child{margin-bottom:none;}> a{&:hover{color:",";}}"," "," ",""],s.Tj.c9,e=>{let{$groupHeader:t}=e;return t&&u},e=>{let{$groupTag:t}=e;return t&&m},e=>{let{$noResult:t}=e;return t&&f});let w=d.Ay.div.withConfig({componentId:"sc-65245e60-6"})(["width:100%;position:absolute;top:calc(100% + 8px);left:0px;display:flex;flex-wrap:wrap;justify-content:center;border-radius:16px;overflow:hidden;background:",";padding:16px 17px;box-shadow:2px 2px 4px 4px rgba(0,0,0,0.2);display:flex;flex-direction:column;","{background:unset;box-shadow:unset;align-items:center;}"],s.Tj.c17,c),v=(0,d.AH)(["background:",";> svg{transform:rotate(0deg);}"],s.Tj.buttonBackground);d.Ay.div.withConfig({componentId:"sc-65245e60-7"})(["padding:8px 13px;font-size:12px;line-height:16px;cursor:pointer;color:",";width:calc((100% / 3) - 4px);margin:4px 2px;display:flex;align-items:center;background:",";border-radius:50px;word-break:break-word;font-weight:600;","{width:calc((100% / 2) - 4px);}","{width:calc((100% / 2) - 4px);}> span{flex:1;}> svg{height:10px;width:10px;flex-shrink:0;transform:rotate(45deg);transition:300ms ease;}&:hover{background:",";}"," ",""],s.Tj.mainText,s.Tj.c18,l,c,s.Tj.buttonBackground,e=>{let{isMobile:t}=e;return t&&` 2 background: transparent; 3 border-bottom: 1px solid ${s.Tj.c12}; 4 font-size: 14px; 5 `},e=>{let{isActive:t}=e;return t&&v});let b=d.Ay.div.withConfig({componentId:"sc-65245e60-8"})(["display:flex;width:100%;position:relative;background:transparent;overflow:hidden;align-items:center;&:focus-within{svg{color:",";}label{color:",";}}"],s.Tj.mainText,s.Tj.mainText),j=d.Ay.div.withConfig({componentId:"sc-65245e60-9"})(["display:flex;flex-direction:column;flex:1;cursor:pointer;padding-left:6px;> div{> div{border-radius:30px;}}"]);d.Ay.div.withConfig({componentId:"sc-65245e60-10"})(["height:56px;display:flex;flex-wrap:wrap;align-items:center;input{flex:1;width:100%;border:none;letter-spacing:0px;color:",";background:transparent !important;font-size:16px;line-height:19px;font-weight:500;&::placeholder{color:",";}}"],s.Tj.mainText,s.Tj.secondaryText),d.Ay.div.withConfig({componentId:"sc-65245e60-11"})(["display:flex;flex-direction:column;align-items:center;> p{margin-bottom:20px;}> div{width:100%;}"]);let y=d.Ay.p.withConfig({componentId:"sc-65245e60-12"})(["font-size:16px;","{font-size:13px;}"],c),A=d.Ay.div.withConfig({componentId:"sc-65245e60-13"})(["cursor:pointer;height:130px;display:flex;"]),k=d.Ay.div.withConfig({componentId:"sc-65245e60-14"})(["margin-bottom:18px;"]),C=d.Ay.div.withConfig({componentId:"sc-65245e60-15"})(["background:url(",");background-position:center;background-size:cover;height:100%;width:45%;border-radius:10px;"],e=>{let{$imageUrl:t}=e;return t}),_=d.Ay.div.withConfig({componentId:"sc-65245e60-16"})(["width:55%;padding-left:12px;padding-top:15px;padding-bottom:15px;
5display:flex;flex-direction:column;justify-content:space-between;> h1{font-size:12px;font-weight:600;}> p{font-size:11px;}> span{font-size:11px;font-weight:600;}"]);d.Ay.div.withConfig({componentId:"sc-65245e60-17"})([""]);let T=d.Ay.div.withConfig({componentId:"sc-65245e60-18"})(["color:",";font-weight:bold;font-size:14px;margin-top:8px;margin-bottom:8px;text-transform:uppercase;"],s.Tj.c4);var I=n(62477),S=n(25656);let{md:z,sm:$}=s.fi,E=d.Ay.div.withConfig({componentId:"sc-1b1d3cad-0"})(["display:flex;flex-direction:column;"]),H=(0,d.AH)(["border-color:",";"],s.Tj.error),q=d.Ay.div.withConfig({componentId:"sc-1b1d3cad-1"})(["display:flex;flex-direction:row;justify-content:space-between;padding:10px 16px;border-radius:8px;color:",";position:relative;",";height:56px;align-items:center;> input{-webkit-text-fill-color:",";background:none;\xdf ","{height:24px;}}"," > button{width:unset;font-weight:normal;padding:0 14px;font-size:16px;height:34px;","{height:unset;padding:unset;}}"],s.Tj.mainText,e=>{let{$withError:t}=e;return t&&H},s.Tj.mainText,z,e=>{let{$transparent:t}=e;return t?(0,d.AH)(["background:none;"]):(0,d.AH)(["background:",";"],s.Tj.c17)},z),M=d.Ay.input.withConfig({componentId:"sc-1b1d3cad-2"})(["background:none;border:none;padding:0px 6px;color:",";font-size:16px;width:100%;","{font-size:16px;}"],s.Tj.mainText,z),R=d.Ay.button.withConfig({componentId:"sc-1b1d3cad-3"})(["background:transparent;border:none;> svg{height:13px;width:20px;color:white;}"]),N=d.Ay.div.withConfig({componentId:"sc-1b1d3cad-4"})(["> svg{height:20px;width:20px;transform:translate(-3px,2px);}"]);d.Ay.div.withConfig({componentId:"sc-1b1d3cad-5"})(["color:",";font-size:14px;margin-top:12px;margin-bottom:12px;"],s.Tj.error);var O=n(75314),V=n(27797);let B=e=>{let{onChange:t,returnValueOnChange:n=!0,value:r="",label:a,placeholder:d,error:s,tooltip:l,onClickOverride:c,icon:p,type:h,onSearch:x,withButton:g=!0,clear:u,handleClear:m,transparent:f,...w}=e,v=(0,o.useMemo)(()=>!!u&&!!r.length,[u,r]);return(0,i.jsx)(E,{children:(0,i.jsxs)(q,{$transparent:f,onClick:c,$withError:!!s,children:[p&&(0,i.jsx)(N,{children:(0,i.jsx)(O.A,{name:"search"})}),(0,i.jsx)(M,{value:r,onChange:e=>{n?t(e.target.value):t(e)},placeholder:d,type:"text",autoComplete:"off",enterKeyHint:"search",...w}),v&&(0,i.jsx)(R,{onClick:m,children:(0,i.jsx)(O.A,{name:"close"})}),g&&(0,i.jsx)(V.A,{"aria-label":"Search",onClick:x,children:"Search"})]})})};var J=n(79350),P=n(45920),U=n(51152),D=n(53519),F=n(22296),G=n(89099),K=n(68144);let Q=(0,J.J1)` 6 query getAllEvents($where: events_bool_exp) { 7 events(where: $where) { 8 id 9 name 10 venue { 11 name 12 } 13 event_search_tags { 14 tag { 15 name 16 } 17 } 18 } 19 } 20`,W=(0,J.J1)` 21 query getAllVenues { 22 venues { 23 id 24 name 25 venue_search_tags { 26 tag { 27 name 28 } 29 } 30 } 31 } 32`,Y=(0,J.J1)` 33 query getEventResults($limit: Int!, $where: events_bool_exp = {}) { 34 events(limit: $limit, where: $where) { 35 id 36 name 37 slug 38 location 39 start_date 40 end_date 41 event_images { 42 id 43 name 44 } 45 cover_image_id 46 } 47 } 48`,L=(0,J.J1)` 49 query getVenueResults($limit: Int!, $where: venues_bool_exp = {}) { 50 venues(limit: $limit, where: $where) { 51 id 52 slug 53 name 54 venue_image { 55 name 56 } 57 venue_tags { 58 id 59 tag_id 60 } 61 } 62 } 63`,X=e=>{let[t,n]=(0,o.useState)(!1),r=(0,o.useRef)(),[a,d]=(0,o.useState)(""),s=(0,G.useRouter)(),[l,c]=(0,o.useState)([]),[u,m]=(0,o.useState)([]),[f,v]=(0,o.useState)([]),{dispatch:z}=(0,F.SE)("dispatch"),$=(0,D.GP)(new Date,"P"),{data:E}=(0,P.I)(Q,{variables:{where:{end_date:{_gte:$}}}}),{data:H}=(0,P.I)(W),[q,{loading:M,data:R}]=(0,U._)(Y),[N,{loading:O,data:V}]=(0,U._)(L);(0,I.Wr)(r,()=>n(!1));let{searchValue:J}=e;function X(e){let{text:t,limit:n}=e,[r,a]=(0,o.useState)(t);return(0,o.useEffect)(()=>{(null==t?void 0:t.length)>n&&a((null==t?void 0:t.slice(0,n))+"...")},[]),(0,i.jsx)(o.Fragment,{children:r})}return(0,o.useEffect)(()=>{d(J)},[J]),(0,o.useEffect)(()=>
63{if(a&&E&&H){let e=E.events,t=H.venues,n={includeScore:!0,threshold:.3,shouldSort:!0,keys:["name","venue.name","event_search_tags.tag.name","venue_search_tags.tag.name"]},i=new K.A(e,n),o=new K.A(t,n),r=i.search(a),d=o.search(a),s=(0,I.YV)();v(new K.A(s,n).search(a).map(e=>e.item)),c(r.map(e=>e.item.id)),m(d.map(e=>e.item.id)),q({variables:{limit:50,where:{_or:r.map(e=>({id:{_eq:e.item.id}})),end_date:{_gte:$}}}}),N({variables:{limit:50,where:{_or:d.map(e=>({id:{_eq:e.item.id}}))}}})}},[a,E,H]),(0,i.jsx)(p,{ref:r,children:(0,i.jsxs)(h,{children:[(0,i.jsx)(b,{children:(0,i.jsx)(j,{onClick:()=>n(!0),children:(0,i.jsx)(B,{placeholder:e.searchText??"Search by performance, arts org, etc.",value:a,returnValueOnChange:!1,onChange:e=>{e.stopPropagation();let t=e.target.value;""===t?n(!1):n(!0),d(t)},name:"search",withButton:!1,clear:!0,icon:!0,handleClear:e=>{e.stopPropagation(),n(!1),d("")}})})}),t&&a&&(()=>{var e;if(M||O||!R||!V)return(0,i.jsx)(w,{children:(0,i.jsx)(S.A,{})});let t=[...null==R?void 0:R.events].sort((e,t)=>l.indexOf(e.id)-l.indexOf(t.id)),n=new Set(t.map(e=>e.slug)),o=[...f.filter(e=>!n.has(e.slug)),...t],r=null==(e=[...null==V?void 0:V.venues].sort((e,t)=>u.indexOf(e.id)-u.indexOf(t.id)))?void 0:e.slice(0,2);return(0,i.jsx)(x,{children:((null==o?void 0:o.length)>0||(null==r?void 0:r.length)>0)&&(0,i.jsxs)(g,{children:[(0,i.jsx)(T,{children:"Venues"}),r.length>0?r.map((e,t)=>{let{venue_image:n,id:o,name:r,slug:a}=e,d=n?(0,I.hg)({ownerType:4,ownerId:o,name:n.name}):(0,I.sn)("https://cpworldgroup.com/wp-content/uploads/2021/01/placeholder.png");return(0,i.jsx)(k,{children:(0,i.jsxs)(A,{onClick:()=>{z("setShowSearchModal",!1),s.push(`/venue/${a}`)},children:[(0,i.jsx)(C,{$imageUrl:d}),(0,i.jsx)(_,{children:(0,i.jsx)("h1",{children:r})})]})},t)}):(0,i.jsx)(k,{$noResult:!0,children:"No venues from your search."}),(0,i.jsx)(T,{children:"Events"}),o.length>0?o.map((e,t)=>{let{cover_image_id:n,event_images:o,imageUrl:r,start_date:a,end_date:d,id:l,name:c,location:p,slug:h}=e,x=(0,I._f)({id:l,imageUrl:r,coverImageId:n,eventImages:o});return(0,i.jsx)(k,{children:(0,i.jsxs)(A,{onClick:()=>{z("setShowSearchModal",!1),s.push(`/events/${h}`)},children:[(0,i.jsx)(C,{$imageUrl:x}),(0,i.jsxs)(_,{children:[(0,i.jsx)("h1",{children:(0,i.jsx)(X,{text:c,limit:50})}),(0,i.jsx)("p",{children:(0,i.jsx)(X,{text:p,limit:50})}),(0,i.jsxs)("span",{children:[(0,I.aj)(a)," - ",(0,I.aj)(d)]})]})]})},t)}):(0,i.jsx)(k,{$noResult:!0,children:"No events from your search."})]})||(0,i.jsx)(y,{children:a&&"No results from your search. Try different terms."})})})()]})})},Z=d.Ay.div.withConfig({componentId:"sc-c5cef96f-0"})(["display:flex;flex-direction:column;width:100%;"]),ee=d.Ay.div.withConfig({componentId:"sc-c5cef96f-1"})(["min-width:50vw;min-height:80vh;"]),et=d.Ay.div.withConfig({componentId:"sc-c5cef96f-2"})(['height:48px;width:64px;background-size:contain;background-position:center;background-repeat:no-repeat;background-image:url("https://red-curtain-addict.imgix.net/static/rcafit.png?fm=webp&fit=crop&q=60&w=600&dpr=1.5&strip=true");']),en=e=>{let[t,n]=(0,o.useState)(!0),{dispatch:d,user:s,showSearchModal:l}=(0,F.SE)("isMobile","user","userData","showSearchModal");return(0,i.jsx)(r.A,{open:l,onClose:()=>d("setShowSearchModal",!1),closeButton:!0,children:(0,i.jsx)(Z,{children:(0,I.Qs)()&&t&&!s?(0,i.jsx)(a.A,{onCancel:()=>{n(!1)}}):(0,i.jsxs)(ee,{children:[(0,i.jsx)(et,{}),(0,i.jsx)(X,{searchText:e.searchText})]})})})}}}]);
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.