PageSourceSearch

https://askcolette.ai/assets/MapView-DF1rI5LI.js

js askcolette.ai collected 2026-10-05 11:49:16 UTC 12,972 bytes, 1 lines download raw bytes

1import{r as x,j as e,a as S}from"./vendor-react-BwVVGUU0.js";import{N as I}from"./Navbar-CfAzaU-b.js";import{b as N,e as y,B as C,F as E,c as L}from"./index-DHCg6uwy.js";import{S as B}from"./SEOHead-CGOhbo9D.js";import{B as v}from"./badge-Tibd3Oj5.js";import{u as z}from"./usePromotions-CJetoa0d.js";import{M as R}from"./map-pin-BvhZa1Rd.js";import{M as P,L as A,E as D}from"./vendor-icons-CD7r61he.js";import"./dropdown-menu-N0bu4AF-.js";import"./index-C8KtyBkB.js";import"./Combination-B4qWFlDC.js";import"./vendor-supabase-BiO_zEF0.js";import"./index-ZWeTCxcj.js";import"./chevron-right-D0DOK_Q6.js";import"./vendor-motion-CumRUquI.js";import"./markdownComponents-DnXKmDRO.js";import"./vendor-query-Bz-HlmEJ.js";import"./copy-Dz3GO3Yi.js";import"./check-4PsGsy9B.js";import"./TaskTicket-CvVG0tfy.js";import"./collapsible-DAohS7fa.js";import"./component-styles-SMbORtni.js";import"./input-BismReYU.js";import"./textarea-DW1wwIoG.js";import"./sheet-Cq0QZok4.js";import"./index-Dzyh4DOJ.js";import"./select-BFPPs8cF.js";import"./clock-D8HWD1Wt.js";import"./alert-circle-BstJnnhE.js";import"./file-text-BbHDXI3f.js";import"./format-utils-DnUXRhUz.js";import"./eye-D-SIMv0B.js";import"./user-C6f6wH7j.js";import"./popover-DuUVkOxs.js";import"./index-CRnR8rM-.js";import"./index-DvYvMmuj.js";import"./index-Nqsbd8PU.js";import"./vendor-recharts-DQotx4ft.js";import"./command-DMLjfAiQ.js";import"./dialog-BpMWpC85.js";import"./plus-Ch-uotWP.js";import"./users-CVciMXmn.js";import"./vendor-date-fns-CAZ5PJV8.js";import"./chevron-left-RxUAawsG.js";import"./calendar-days-CyhD0dYN.js";import"./send-BN0Y3_Th.js";import"./square-pen-CMGk00qI.js";import"./delete-C0WSFZff.js";import"./SafeHTML-DUQaRvBC.js";import"./alert-dialog-CtQnBLY9.js";import"./x-circle-CdVigTka.js";import"./stat-card-B3e2OoHi.js";import"./chart-utils-DJHVMFEE.js";import"./funnel-chart-7EPQJAc2.js";import"./trending-up-7k3N-lIS.js";import"./alert-triangle-C-GSX7Cc.js";import"./dollar-sign-pdBLFSa2.js";import"./trending-down-BZz-MPXT.js";import"./arrow-right-CLnEYaMi.js";import"./building-CXZ3kjAF.js";import"./briefcase-DhdtWhXW.js";import"./bar-chart-DPyKu_e4.js";import"./client-DzUN7L4U.js";import"./progress-B25Tz-Qp.js";import"./external-link-eTiwJ9uA.js";import"./activity-1f9yyhBn.js";import"./archive-gHfzzDoI.js";import"./search-Bs8WjxTl.js";import"./tabs-DrEzcK-A.js";import"./arrow-left-yPvJNKKy.js";import"./zap-BjYGBOp4.js";import"./useConnectProviderPage-Da4LeArA.js";import"./useBackendBusinessService-GeJHVqOM.js";import"./validation-utils-Cr_B-6Lh.js";import"./safeInternalPath-DUUaoZTq.js";import"./ConnectWizard-BqMF_a_a.js";import"./label-CYI-kJro.js";import"./eye-off-guwEOQBQ.js";import"./mail-B_fidK9o.js";import"./skeleton-CLcgBwWv.js";import"./radio-group-Du03vtJc.js";import"./refresh-cw-CEREosM7.js";import"./Button-IcbitGFs.js";import"./grip-vertical-Cp_aRARU.js";import"./trash-2-5MFT4Kdq.js";import"./switch-VMqyUvEV.js";import"./index-CVOGP2-e.js";import"./vendor-sentry-C-F243Ew.js";const _="AIzaSyDIPWOfIH2qp4uYkZGwQtSQlhX6toR4vh8",T="3cc3189a-1561-4380-8c92-56f5d9afc5be",U=({center:o={lat:43.6591,lng:-70.2568},zoom:l=13})=>{const a=x.useRef(null),[c,u]=x.useState(),[f,d]=x.useState(null),[n,g]=x.useState([]),{data:w,isLoading:M}=z(T,!0);x.useEffect(()=>{if(typeof window>"u")return;if(window.google&&window.google.maps){if(a.current&&!c){const r=new window.google.maps.Map(a.current,{center:o,zoom:l,styles:[{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]}]});u(r)}return}if(document.querySelector('script[src*="maps.googleapis.com"]')){const r=setInterval(()=>{if(window.google&&window.google.maps&&(clearInterval(r),a.current&&!c)){const h=new window.google.maps.Map(a.current,{center:o,zoom:l,styles:[{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]}]});u(h)}},100);return()=>clearInterval(r)}const i=document.createElement("script");return i.src=`https://maps.googleapis.com/maps/api/js?key=${_}&libraries=places`,i.async=!0,i.defer=!0,i.onload=()=>{if(a.current&&!c)try{const r=new window.google.maps.Map(a.current,{center:o,zoom:l,styles:[{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]}]});u(r)}catch(r){console.error("Google Maps initialization error:",r)}},i.onerror=()=>{console.error("Failed to load Google Maps script")},document.head.appendChild(i),()=>{const r=document.querySelector('script[src*="maps.googleapis.com"]');r&&r.remove()}},[a,c,o,l,_]),x.useEffect(()=>{if(!c||!w)return;
1n.forEach(t=>t.setMap(null)),g([]);const i=new Map;w.forEach(t=>{if(!t.business_latitude||!t.business_longitude)return;const b=i.get(t.business_id);b?b.promotions.push(t):i.set(t.business_id,{businessId:t.business_id,businessName:t.business_name,businessLogoUrl:t.business_logo_url||void 0,latitude:t.business_latitude,longitude:t.business_longitude,promotions:[t]})});const r=[],h=[];return i.forEach(t=>{if(!t.latitude||!t.longitude)return;const b=k(t.businessLogoUrl).then(p=>{const s=new google.maps.Marker({map:c,position:{lat:t.latitude,lng:t.longitude},title:t.businessName,icon:{url:p,scaledSize:new google.maps.Size(40,40),anchor:new google.maps.Point(20,20)},optimized:!1});s.addListener("click",()=>{d(t)}),r.push(s)});h.push(b)}),Promise.all(h).then(()=>{g(r)}),()=>{r.forEach(t=>t.setMap(null))}},[c,w]);const k=i=>new Promise(r=>{const p=document.createElement("canvas");p.width=120,p.height=120;const s=p.getContext("2d");if(!s){r("https://maps.google.com/mapfiles/ms/icons/blue-dot.png");return}s.imageSmoothingEnabled=!0,s.imageSmoothingQuality="high";const m=6;if(i){const j=new Image;j.crossOrigin="anonymous",j.onload=()=>{s.save(),s.beginPath(),s.arc(120/2,120/2,120/2-m,0,Math.PI*2),s.clip(),s.fillStyle="#ffffff",s.fillRect(0,0,120,120),s.drawImage(j,0,0,120,120),s.restore(),s.beginPath(),s.arc(120/2,120/2,120/2-m/2,0,Math.PI*2),s.lineWidth=m,s.strokeStyle="#ffffff",s.stroke(),s.shadowColor="rgba(0, 0, 0, 0.3)",s.shadowBlur=36,s.shadowOffsetX=0,s.shadowOffsetY=18,r(p.toDataURL("image/png",1))},j.onerror=()=>{s.fillStyle="#3b82f6",s.beginPath(),s.arc(120/2,120/2,120/2-m,0,Math.PI*2),s.fill(),s.beginPath(),s.arc(120/2,120/2,120/2-m/2,0,Math.PI*2),s.lineWidth=m,s.strokeStyle="#ffffff",s.stroke(),s.font="144px Arial",s.textAlign="center",s.textBaseline="middle",s.fillStyle="#ffffff",s.fillText("🏢",120/2,120/2),r(p.toDataURL("image/png",1))},j.src=i}else s.fillStyle="#3b82f6",s.beginPath(),s.arc(120/2,120/2,120/2-m,0,Math.PI*2),s.fill(),s.beginPath(),s.arc(120/2,120/2,120/2-m/2,0,Math.PI*2),s.lineWidth=m,s.strokeStyle="#ffffff",s.stroke(),s.font="144px Arial",s.textAlign="center",s.textBaseline="middle",s.fillStyle="#ffffff",s.fillText("🏢",120/2,120/2),r(p.toDataURL("image/png",1))});return M?e.jsx("div",{className:"flex items-center justify-center h-96",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:"Loading business locations..."})]})}):e.jsxs("div",{className:"relative",children:[e.jsx("div",{ref:a,className:"w-full h-96 rounded-lg border border-border"}),f&&e.jsx(N,{className:"absolute top-4 right-4 w-80 max-h-96 overflow-y-auto bg-card/95 backdrop-blur-sm border-border/50",children:e.jsxs(y,{className:"p-4",children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsx("h3",{className:"font-semibold text-foreground",children:f.businessName}),e.jsx("button",{onClick:()=>d(null),className:"text-muted-foreground hover:text-foreground",children:"×"})]}),e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsxs("div",{className:"flex items-center text-muted-foreground",children:[e.jsx(R,{size:16,className:"mr-2"}),"Portland, Maine"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium text-foreground",children:"Available Promotions:"}),f.promotions.map(i=>e.jsxs("div",{className:"flex items-center space-x-2 p-2 bg-secondary/20 rounded-lg",children:[e.jsx("span",{className:"text-2xl",children:i.reward_emoji}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"font-medium text-sm",children:i.promotion_name}),e.jsx("p",{className:"text-xs text-muted-foreground",children:i.reward_description})]})]},i.id))]}),e.jsx("div",{className:"mt-3",children:e.jsx(v,{variant:"secondary",className:"text-xs",children:"Industry Card Partner"})}),e.jsx("p",{className:"text-muted-foreground text-xs mt-3",children:"Click on other markers to explore more Portland businesses with exclusive offers."})]})]})})]})},G="3cc3189a-1561-4380-8c92-56f5d9afc5be",O=({business:o})=>{const l=o.promotions[0];return e.jsxs(N,{className:"group hover:shadow-glow transition-all duration-300 hover:scale-105 bg-card/80 backdrop-blur border-border/50",children:[e.jsxs(L,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx("div",{className:"mb-2",children:o.logo_url?e.jsx("img",{src:o.logo_url,alt:`${o.name} logo`,className:"w-16 h-16 object-contain rounded-lg"}):e.jsx("div",{className:"w-16 h-16 flex items-center justify-center bg-muted rounded-lg text-3xl",children:l.reward_emoji||"🍽️"})}),e.jsx(v,{variant:"secondary",className:"bg-secondary/20 text-secondary-foreground border-secondary/50 font-bold",children:l.reward_description})]}),e.jsx("h3",{className:"text-xl font-bold text-foreground group-hover:text-secondary transition-colors",children:o.name})]}),e.jsx(y,{className:"pt-0",children:e.jsxs("div",{className:"space-y-2",children:[o.address&&e.jsxs("div",{className:"flex items-center text-sm text-foreground
1/80",children:[e.jsx(P,{className:"w-4 h-4 mr-2 text-foreground"}),o.address]}),o.promotions.length>1&&e.jsxs("div",{className:"flex items-center text-sm text-secondary font-bold",children:[e.jsx(D,{className:"w-4 h-4 mr-2"}),o.promotions.length," exclusive offers"]})]})})]})},ws=()=>{const o=S(),{data:l,isLoading:a,error:c}=z(G,!0),u=x.useMemo(()=>{if(!l)return[];const d=new Map;return l.forEach(n=>{const g=d.get(n.business_id);g?g.promotions.push(n):d.set(n.business_id,{id:n.business_id,name:n.business_name,logo_url:n.business_logo_url||null,address:n.business_address||null,latitude:n.business_latitude||null,longitude:n.business_longitude||null,promotions:[n]})}),Array.from(d.values())},[l]),f=()=>{o("/login?userType=business_owner")};return e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-background to-accent",children:[e.jsx(B,{path:"/restaurants"}),e.jsx(I,{}),e.jsxs("main",{className:"container mx-auto px-4 py-12",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsxs(v,{variant:"secondary",className:"mb-4 bg-secondary/20 text-secondary-foreground border-secondary/50 font-bold",children:[e.jsx(P,{className:"w-4 h-4 mr-2"}),"Portland's Finest"]}),e.jsx("h2",{className:"text-4xl md:text-5xl font-bold text-foreground mb-4",children:"Exclusive Industry Discounts"}),e.jsx("p",{className:"text-xl text-foreground/80 max-w-2xl mx-auto",children:"Explore participating businesses on the map and discover exclusive discounts reserved for hospitality workers with Industry Cards."})]}),e.jsx("div",{className:"mb-8",children:e.jsx(U,{center:{lat:43.6591,lng:-70.2568},zoom:13})}),a&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-20",children:[e.jsx(A,{className:"w-12 h-12 text-foreground animate-spin mb-4"}),e.jsx("p",{className:"text-foreground/70",children:"Loading participating businesses..."})]}),c&&e.jsx(N,{className:"max-w-2xl mx-auto bg-destructive/10 border-destructive/20",children:e.jsxs(y,{className:"p-8 text-center",children:[e.jsx("h3",{className:"text-xl font-bold text-foreground mb-2",children:"Unable to Load Businesses"}),e.jsx("p",{className:"text-foreground/70",children:"Please try again later or contact support if the problem persists."})]})}),!a&&!c&&u.length>0&&e.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:u.map(d=>e.jsx("div",{className:"animate-fade-in",children:e.jsx(O,{business:d})},d.id))}),!a&&!c&&u.length===0&&e.jsx(N,{className:"max-w-2xl mx-auto bg-muted/10 border-muted/20",children:e.jsxs(y,{className:"p-8 text-center",children:[e.jsx("h3",{className:"text-xl font-bold text-foreground mb-2",children:"No Businesses Yet"}),e.jsx("p",{className:"text-foreground/70",children:"We're actively onboarding new partners. Check back soon!"})]})}),e.jsx("div",{className:"mt-16 text-center",children:e.jsx(N,{className:"max-w-2xl mx-auto bg-secondary/10 border-secondary/30",children:e.jsxs(y,{className:"p-8",children:[e.jsx("h3",{className:"text-2xl font-bold text-foreground mb-4",children:"Want to Add Your Business?"}),e.jsx("p",{className:"text-foreground/70 mb-6",children:"Join our growing network of businesses supporting Portland's hospitality workers."}),e.jsx(C,{variant:"secondary",size:"lg",onClick:f,children:"Partner With Us"})]})})})]}),e.jsx(E,{})]})};export{ws 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.