PageSourceSearch

https://otowah.com/_next/static/chunks/761.6a6bdba65d2e9fbb.js

js otowah.com collected 2026-10-02 16:04:15 UTC 10,844 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[761],{6761:function(e,t,l){l.r(t);var n=l(5893),i=l(7294),r=l(5396),a=l.n(r),s=l(3044),o=l(5510),u=l(3835),d=l(133),c=l(3369),h=l(7997),v=l(3618),m=l(1957),g=l(2033),f=l(1955);let x=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function p(e,t,l,n){let i=Math.sin((l-e)*Math.PI/180/2)**2+Math.cos(e*Math.PI/180)*Math.cos(l*Math.PI/180)*Math.sin((n-t)*Math.PI/180/2)**2;return 2*Math.atan2(Math.sqrt(i),Math.sqrt(1-i))*6371}function b(e){let t=null==e?void 0:e.venueLat,l=null==e?void 0:e.venueLng;if(null!=t&&null!=l){let e=Number(t),n=Number(l);if(!Number.isNaN(e)&&!Number.isNaN(n))return{lat:e,lng:n}}let n="string"==typeof(null==e?void 0:e.geohash)?e.geohash.trim():"";if(n.length>=4)try{let e=a().decode(n);if(e&&"number"==typeof e.latitude&&"number"==typeof e.longitude&&!Number.isNaN(e.latitude)&&!Number.isNaN(e.longitude))return{lat:e.latitude,lng:e.longitude}}catch(e){}return null}function w(e){let{events:t,savedVenueIds:l=[],savedEventIds:r=[]}=e,a=(0,i.useRef)(null),[s,o]=(0,i.useState)(0),[u,d]=(0,i.useState)(!1),[c,h]=(0,i.useState)(!1),[v,g]=(0,i.useState)(!1),f=(0,i.useCallback)(()=>{let e=a.current;if(!e)return;let{scrollLeft:t,scrollWidth:l,clientWidth:n}=e,i=l-n;if(i<=0){d(!1),o(0),h(!1),g(!1);return}d(!0),o(Math.min(t/i,1)),h(t>0),g(t<i-1)},[]);(0,i.useEffect)(()=>{let e=a.current;if(!e)return;f();let t=new ResizeObserver(f);return t.observe(e),()=>t.disconnect()},[t.length,f]);let x=(0,i.useCallback)(()=>{let e=a.current;e&&e.scrollBy({left:-380,behavior:"smooth"})},[]),p=(0,i.useCallback)(()=>{let e=a.current;e&&e.scrollBy({left:380,behavior:"smooth"})},[]);return t.length?(0,n.jsxs)("div",{className:"px-4 relative",children:[(0,n.jsx)("div",{ref:a,onScroll:f,className:"flex overflow-x-auto gap-3 sm:gap-4 scroll-smooth scrollbar-hide",children:t.map(e=>(0,n.jsx)("div",{className:"flex-shrink-0 w-[260px] sm:w-[320px] md:w-[380px]",children:(0,n.jsx)(m.Z,{variant:"guide",event:e,showDate:!1})},e.eventsId||e.id))}),u&&(0,n.jsxs)(n.Fragment,{children:[c&&(0,n.jsx)("button",{type:"button","aria-label":"Scroll left",onClick:x,className:"absolute left-6 top-1/2 -translate-y-1/2 z-10 w-8 h-8 rounded-full flex items-center justify-center text-white border border-white/30 bg-black/50 hover:bg-black/70 transition-colors",children:(0,n.jsx)(N,{className:"w-4 h-4"})}),v&&(0,n.jsx)("button",{type:"button","aria-label":"Scroll right",onClick:p,className:"absolute right-6 top-1/2 -translate-y-1/2 z-10 w-8 h-8 rounded-full flex items-center justify-center text-white border border-white/30 bg-black/50 hover:bg-black/70 transition-colors",children:(0,n.jsx)(j,{className:"w-4 h-4"})})]}),u&&(0,n.jsx)("div",{className:"mt-2 px-1",children:(0,n.jsx)("div",{className:"w-full h-0.5 rounded-full overflow-hidden",style:{backgroundColor:"var(--grey-med-black)"},children:(0,n.jsx)("div",{className:"h-full rounded-full",style:{width:"".concat(100*s,"%"),backgroundColor:"var(--vivace-neon-green)"}})})})]}):null}function N(e){let{className:t="w-5 h-5"}=e;return(0,n.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("path",{d:"M15 18l-6-6 6-6"})})}function j(e){let{className:t="w-5 h-5"}=e;return(0,n.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("path",{d:"M9 18l6-6-6-6"})})}t.default=i.memo(function(){let e=(0,o.TL)(),t=(0,o.CG)(e=>e.location.value),l=(0,o.CG)(e=>{var t,l;return null!==(l=null===(t=e.savedVenues)||void 0===t?void 0:t.ids)&&void 0!==l?l:[]}),r=(0,o.CG)(c.Hh),a=(0,o.CG)(h.$R),m=(0,o.CG)(e=>e.weeklyEvents);(0,o.CG)(e=>{var t,l;return null!==(l=null===(t=e.search)||void 0===t?void 0:t.keyword)&&void 0!==l?l:""});let N=(0,o.CG)(e=>{var t,l;return null!==(l=null===(t=e.search)||void 0===t?void 0:t.dateFilter)&&void 0!==l?l:d.iI}),j=(0,o.CG)(e=>{var t,l;return null!==(l=null===(t=e.search)||void 0===t?void 0:t.selectedDate)&&void 0!==l?l:null}),[y,k]=(0,i.useState)([]),[S,D]=(0,i.useState)(!0),[C,M]=(0,i.useState)(null),T=(0,i.useRef)(!1),I=(0,i.useRef)(null),F=(0,i.useRef)(null);if((0,i.useEffect)(()=>{let e=null==m?void 0:m.eventsByDate;!F.current&&e&&0!==Object.keys(e).length&&(F.current=e,I.current=m.lastLocation||"no-location")},[m.eventsByDate,m.lastLocation]),(0,i.useEffect)(()=>
1{if(!(l.length>0))try{let t=window.localStorage.getItem("otowah_saved_venue_ids");if(!t)return;let l=JSON.parse(t);Array.isArray(l)&&l.length>0&&e((0,u.a7)(l))}catch(e){}},[l.length,e]),(0,i.useEffect)(()=>{let l=!1;return async function(){let n=(null==t?void 0:t.latitude)!=null&&(null==t?void 0:t.longitude)!=null?t:null,i=n?"".concat(n.latitude,",").concat(n.longitude):"no-location",o=I.current!==i,u=!T.current,c=null!=m.lastFetchTime&&Date.now()-m.lastFetchTime>3e5;(u&&!F.current||o)&&(D(!0),M(null));let h=new Date;h.setHours(0,0,0,0);let f="".concat(h.getFullYear(),"-").concat(String(h.getMonth()+1).padStart(2,"0"),"-").concat(String(h.getDate()).padStart(2,"0")),w=N===d.SZ?1:N===d.Zw?7:N===d.iI?7:14;try{var y;let u;if(N===d.V_&&j){if(D(!0),u=await (0,s.Vk)(n,j),l)return}else if(o||!F.current||c){if(u=await (0,s.uD)(n,w),l)return;F.current=u,I.current=i,e((0,v.Fl)(u)),e((0,v.l6)(i)),e((0,v.Nk)(Date.now()))}else u=F.current;let h=(null==t?void 0:t.latitude)!=null?Number(t.latitude):null,m=(null==t?void 0:t.longitude)!=null?Number(t.longitude):null,S={};Object.keys(u).forEach(e=>{"timestamp"!==e&&Array.isArray(u[e])&&(S[e]=function(e,t,l){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,r=new Set(Array.isArray(n)?n.map(String):[]),a=i instanceof Set?i:new Set;return[...e].sort((e,n)=>{var i,s,o,u,d,c,h,v,m,g,f,x,w,N;let j=String(null!==(c=null!==(d=null==e?void 0:e.eventsId)&&void 0!==d?d:null==e?void 0:e.id)&&void 0!==c?c:""),y=String(null!==(v=null!==(h=null==n?void 0:n.eventsId)&&void 0!==h?h:null==n?void 0:n.id)&&void 0!==v?v:""),k=(null==e?void 0:null===(i=e.boost)||void 0===i?void 0:i.pinnedUntil)!=null?Number(e.boost.pinnedUntil):null,S=(null==n?void 0:null===(s=n.boost)||void 0===s?void 0:s.pinnedUntil)!=null?Number(n.boost.pinnedUntil):null,D=(null==e?void 0:null===(o=e.boost)||void 0===o?void 0:o.isBoosted)===!0&&null!=k&&!Number.isNaN(k)&&k>Date.now(),C=(null==n?void 0:null===(u=n.boost)||void 0===u?void 0:u.isBoosted)===!0&&null!=S&&!Number.isNaN(S)&&S>Date.now(),M=j&&r.has(j),T=y&&r.has(y),I=j&&a.has(j),F=y&&a.has(y);if(D&&!C)return -1;if(!D&&C)return 1;if(D&&C)return(S||0)-(k||0);if(M&&!T)return -1;if(!M&&T)return 1;if(I&&!F)return -1;if(!I&&F)return 1;if(null!=t&&null!=l){let i=b(e),r=b(n),a=i?p(t,l,i.lat,i.lng):1/0,s=r?p(t,l,r.lat,r.lng):1/0;if(a!==s)return a-s}let A=String(null!==(m=null==e?void 0:e.title)&&void 0!==m?m:"").localeCompare(String(null!==(g=null==n?void 0:n.title)&&void 0!==g?g:""),void 0,{sensitivity:"base"});return 0!==A?A:String(null!==(x=null!==(f=null==e?void 0:e.eventsId)&&void 0!==f?f:null==e?void 0:e.id)&&void 0!==x?x:"").localeCompare(String(null!==(N=null!==(w=null==n?void 0:n.eventsId)&&void 0!==w?w:null==n?void 0:n.id)&&void 0!==N?N:""))})}(u[e],h,m,r,a))}),null!=u.timestamp&&(S.timestamp=u.timestamp);let C=function(e){let t=new Date;t.setHours(0,0,0,0);let l="".concat(t.getFullYear(),"-").concat(String(t.getMonth()+1).padStart(2,"0"),"-").concat(String(t.getDate()).padStart(2,"0")),n=Object.keys(e).filter(t=>"timestamp"!==t&&Array.isArray(e[t])&&e[t].length>0&&t>=l);return 0===n.length?[]:(n.sort((e,t)=>new Date(e).getTime()-new Date(t).getTime()),n.map(t=>({date:t,displayDate:function(e){if(!e)return"";let t=new Date(e),l=t.getDate().toString().padStart(2,"0");return"".concat(x[t.getDay()]," ").concat(l)}(t),subheading:function(e){if(!e)return"";let t=new Date(e);t.setHours(0,0,0,0);let l=new Date;l.setHours(0,0,0,0);let n=new Date(l);return(n.setDate(n.getDate()+1),t.getTime()===l.getTime())?"TODAY":t.getTime()===n.getTime()?"TOMORROW":"".concat(x[t.getDay()]," ").concat(function(e){let t=["th","st","nd","rd"],l=e%100;return e+(t[(l-20)%10]||t[l]||"th")}(t.getDate()))}(t),events:(e[t]||[]).filter(e=>!(0,g.Ic)(e))})).filter(e=>e.events.length>0))}(S);C=(y=C).length&&N!==d.Bv?N===d.V_&&j?y.filter(e=>e.date===j):N===d.SZ?y.filter(e=>e.date===f):N===d.Zw?y.filter(e=>{let t=new Date(e.date).getDay();return 0===t||5===t||6===t}):N===d.iI?y.slice(0,7):y:y,k(C),T.current=!0}catch(e){l||M((null==e?void 0:e.message)||"Failed to load gig guide")}finally{l||D(!1)}}(),()=>{l=!0}},[null==t?void 0:t.geohash,null==t?void 0:t.latitude,null==t?void 0:t.longitude,N,j,r,a]),C){let e=[null==t?void 0:t.city,null==t?void 0:t.state].filter(
1Boolean).join(", ")||"this area";return(0,n.jsxs)("div",{className:"mt-6 sm:mt-8 px-4",children:[(0,n.jsx)("h2",{className:f.RF,children:"This week"}),(0,n.jsxs)("p",{className:"mt-2 text-sm text-white/50",children:["Couldn't load gigs in ",e,". Try another location."]})]})}if(0===y.length&&!S){let e=[null==t?void 0:t.city,null==t?void 0:t.state].filter(Boolean).join(", ")||"this area";return(0,n.jsxs)("div",{className:"mt-6 sm:mt-8 px-4",children:[(0,n.jsx)("h2",{className:f.RF,children:"This week"}),(0,n.jsxs)("p",{className:"mt-2 text-sm text-white/50",children:["No upcoming gigs in ",e," yet."]})]})}return(0,n.jsxs)("div",{className:"mt-6 sm:mt-8",style:{backgroundColor:"var(--vivace-background)"},children:[(0,n.jsx)("h2",{className:f.RF,children:"This week"}),S&&0===y.length?Array.from({length:3}).map((e,t)=>(0,n.jsxs)("div",{className:"pb-6",children:[(0,n.jsx)("div",{className:"px-4 pb-2",children:(0,n.jsx)("div",{className:"h-6 bg-white/10 rounded w-32 animate-pulse"})}),(0,n.jsx)("div",{className:"px-4",children:(0,n.jsx)("div",{className:"flex overflow-x-auto gap-3 sm:gap-4 scrollbar-hide",children:Array.from({length:4}).map((e,t)=>(0,n.jsx)("div",{className:"flex-shrink-0 w-[260px] sm:w-[320px] md:w-[380px]",children:(0,n.jsxs)("div",{className:"overflow-hidden",children:[(0,n.jsx)("div",{className:"w-full h-[168px] sm:h-[184px] md:h-[194px] lg:h-[204px] rounded-xl bg-white/10 animate-pulse"}),(0,n.jsxs)("div",{className:"pt-3 space-y-2",children:[(0,n.jsx)("div",{className:"h-4 sm:h-5 bg-white/10 rounded animate-pulse w-3/4"}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("div",{className:"h-3 w-3 sm:h-4 sm:w-4 bg-white/10 rounded animate-pulse flex-shrink-0"}),(0,n.jsx)("div",{className:"h-3 sm:h-4 bg-white/10 rounded animate-pulse w-20 sm:w-24"})]})]})]})},"skeleton-card-".concat(t)))})})]},"skeleton-section-".concat(t))):y.map(e=>(0,n.jsxs)("div",{className:"pb-6",children:[(0,n.jsx)("h3",{className:f.f7,children:e.subheading}),(0,n.jsx)(w,{events:e.events,savedVenueIds:l,savedEventIds:r})]},e.date))]})})}}]);

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.