1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`da86e5a790ffce7d6549f3aeec10b934acc7a606-dirty`}}catch{}})();import{I as e,N as t,t as n,z as r}from"./jsx-runtime-CVnPtKBq.js";import{r as i}from"./chunk-RJYABSBD-PerHHaxc.js";import{c as a}from"./clerk-B0TtVmgL.js";import{n as o,v as s}from"./client-DVFyi2dg.js";import{t as c}from"./loading-spinner-BzDioXFb.js";import{t as l}from"./button-D9oTyZf_.js";import{i as u,n as d,r as f,t as p}from"./mapkit-token-Bcbtrv-N.js";import{n as m,t as h}from"./card-BO6nKduf.js";import{a as g}from"./location-DfjMuNB4.js";var _=r(e(),1),v=r(n(),1),y=`#f37231`,b=`#16a34a`,x=`#6b7280`,S=`#ffffff`;function C(e){return e.status===`buyout`?{color:x,glyphColor:S,glyphText:`·`}:e.has_reached_funding_goal||e.view_status===`fully_funded`||e.view_status===`sold_out`?{color:b,glyphColor:S,glyphText:`â`}:{color:y,glyphColor:S,glyphText:`·`}}async function w(e){let{data:t}=await s({client:o});return a(t,`publicClientLoader will fail if no screenings are found`),t}function T({marker:e}){let t=e.funding_goal>0?Math.max(0,Math.min(100,Math.round(e.funded_amount/e.funding_goal*100))):0,n=i(`/screening/:screeningId`,{screeningId:e.id});return(0,v.jsxs)(`div`,{className:`min-w-[200px] px-1 py-0.5 text-left`,"data-sentry-component":`ScreeningCallout`,"data-sentry-source-file":`map.tsx`,children:[(0,v.jsx)(`div`,{className:`text-foreground mb-2 text-sm leading-snug font-semibold`,children:g(e)}),e.view_status===`sold_out`&&(0,v.jsx)(`div`,{className:`mb-3 text-sm font-semibold text-green-600`,children:`Sold Out`}),e.view_status===`fully_funded`&&(0,v.jsx)(`div`,{className:`mb-3 text-sm font-medium text-green-600`,children:`Funded · Tickets Available`}),e.view_status!==`fully_funded`&&e.view_status!==`sold_out`&&(0,v.jsxs)(`div`,{className:`mb-3`,children:[(0,v.jsxs)(`div`,{className:`text-muted-foreground mb-1.5 text-xs font-medium`,children:[t,`% funded`]}),(0,v.jsx)(`div`,{className:`h-1.5 overflow-hidden rounded-full bg-gray-200`,children:(0,v.jsx)(`div`,{className:`h-full rounded-full bg-gradient-to-r from-green-500 to-emerald-600`,style:{width:`${t}%`}})})]}),(0,v.jsx)(`a`,{target:`_blank`,href:n,rel:`noreferrer`,className:`bg-primary text-primary-foreground inline-flex items-center justify-center rounded-md px-3 py-1.5 text-xs font-medium no-underline`,children:`View Screening`})]})}function E(){return(0,v.jsx)(`div`,{className:`text-muted-foreground min-w-[140px] px-1 py-0.5 text-sm`,"data-sentry-component":`BuyoutCallout`,"data-sentry-source-file":`map.tsx`,children:`Private Screening`})}function D(e){let t=e.filter(e=>e.location);if(!t.length)return{centerLatitude:39.8283,centerLongitude:-98.5795,latitudeDelta:40,longitudeDelta:60};let n=t.map(e=>e.location[1]),r=t.map(e=>e.location[0]),i=Math.min(...n),a=Math.max(...n),o=Math.min(...r),s=Math.max(...r);return{centerLatitude:(i+a)/2,centerLongitude:(o+s)/2,latitudeDelta:Math.max(a-i,1)*1.3,longitudeDelta:Math.max(s-o,1)*1.3}}var O=t(function({loaderData:e}){let t=e,[n,r]=(0,_.useState)(!1),i=new Set,a=t.filter(e=>{if(e.status!==`buyout`)return!0;if(!e.location)return!1;let t=`${e.location[0]},${e.location[1]}`;return i.has(t)?!1:(i.add(t),!0)}),o=D(t);return(0,v.jsxs)(`div`,{className:`relative h-screen w-full bg-gray-100`,"data-sentry-component":`MapPage`,"data-sentry-source-file":`map.tsx`,children:[!n&&(0,v.jsx)(`div`,{className:`absolute inset-0 z-10 grid place-items-center bg-gray-100`,children:(0,v.jsx)(c,{})}),(0,v.jsx)(`div`,{className:`h-full w-full`,id:`apple-map`,children:(0,v.jsx)(d,{token:p,initialRegion:o,onLoad:()=>r(!0),"data-sentry-element":`Map`,"data-sentry-source-file":`map.tsx`,children:a.map(e=>{if(!e.location)return null;let[t,n]=e.location,r=e.status===`buyout`,i=C(e);return(0,v.jsx)(f,{latitude:n,longitude:t,color:i.color,glyphColor:i.glyphColor,glyphText:i.glyphText,titleVisibility:u.Hidden,subtitleVisibility:u.Hidden,animates:!1,calloutContent:r?(0,v.jsx)(E,{}):(0,v.jsx)(T,{marker:e})},e.id)})})}),(0,v.jsx)(`div`,{className:`pointer-events-none absolute bottom-4 left-1/2 z-10 -translate-x-1/2`,children:(0,v.jsx)(h,{className:`bg-background/90 pointer-events-auto hidden backdrop-blur-sm`,"data-sentry-element":`Card`,"data-sentry-source-file":`map.tsx`,children:(0,v.jsx)(m,{className:`flex items-center gap-2 p-2`,"data-sentry-element":`CardContent`,"data-sentry-source-file":`map.tsx`,children:(0,v.jsx)(l,{size:`sm`,"data-sentry-element":`Button`,"data-sentry-source-file":`map.tsx`,children:`Use my location`})})})})]})});export{w as clientLoader,O as default};
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.