1import{a,j as e}from"./query-vendor-BB0JUlq_.js";import{c as X,B as P,g as M}from"./index-CVuSjWCq.js";import{L as U}from"./react-vendor-BIjsaQ6L.js";import{S as le}from"./SEO-wcQthF5D.js";import{g as re}from"./schedule-D1M9yW21.js";import{M as ie}from"./mic-vocal-C6EuetjW.js";import"./ui-vendor-CwH6wFZJ.js";const de=[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]],D=X("headphones",de);const ce=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],me=X("star",ce);function ue(){const[s,r]=a.useState(""),[c,f]=a.useState(""),[m,i]=a.useState(""),[d,b]=a.useState(""),[g,w]=a.useState(""),[S,h]=a.useState(""),[v,C]=a.useState(""),[x,k]=a.useState(""),[I,F]=a.useState(""),[A,G]=a.useState(""),[z,R]=a.useState(""),[_,q]=a.useState(""),[O,$]=a.useState(""),[N,H]=a.useState(["Guitar"]),[u,ee]=a.useState(new Date().toISOString().slice(0,10)),[xe,te]=a.useState([]),[y,T]=a.useState([]),[p,B]=a.useState(null),[W,V]=a.useState(""),[E,l]=a.useState(""),[Z,Y]=a.useState(!1),[J,K]=a.useState(!1),ae=["Guitar","Piano","Keyboard","Singing","Drums","Bass"],Q=g?(t=>{if(!t)return 0;const o=new Date(t),n=new Date;let j=n.getFullYear()-o.getFullYear();const L=n.getMonth()-o.getMonth();return(L<0||L===0&&n.getDate()<o.getDate())&&j--,j})(g)<18:!1,se=async()=>{try{K(!0),l("Loading available slots..."),console.log("ð [BookingForm] Loading slots for date:",u);const t=await fetch(`/api/public/available-lessons/${u}/${u}`);if(!t.ok)throw new Error("Failed to fetch available slots");const n=(await t.json()).availableSlots||[];console.log("â
[BookingForm] Loaded slots:",{totalSlots:n.length,availableSlots:n,date:u});const j=re(u,8,17);te(j),T(n),B(null),l(n.length===0?"No available slots for this date. Please try another date or contact us directly.":"")}catch(t){console.error("â [BookingForm] Failed to load slots:",t),l("Failed to load slots. Please try again.")}finally{K(!1)}},oe=t=>{H(o=>o.includes(t)?o.filter(n=>n!==t):[...o,t])},ne=async t=>{if(t.preventDefault(),console.log("ð [BookingForm] Submitting trial booking:",{selectedSlot:p,availableSlots:y,date:u,instruments:N,firstName:s,lastName:c,email:m}),!p){l("Please select an available slot");return}if(!y.includes(p)){console.error("â [BookingForm] Selected slot not available:",{selectedSlot:p,availableSlots:y}),l("Selected slot is no longer available. Please choose another slot.");return}if(!s||!c||!m||!d||!g){l("Please fill in all required fields");return}if(N.length===0){l("Please select at least one instrument");return}if(Q&&(!v||!x)){l("Guardian information is required for students under 18");return}Y(!0),l("");try{const n=await(await fetch("/api/public/trial-booking",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({firstName:s,lastName:c,email:m,phone:d,dateOfBirth:g,address:S,guardianName:v,guardianPhone:x,emergencyContactName:I,emergencyContactPhone:A,emergencyContactRelationship:z,allergies:_,medications:O,instruments:N,date:u,time:p,notes:W})})).json();n.ok?(l("Booking successful! Check your email for confirmation."),r(""),f(""),i(""),b(""),w(""),h(""),C(""),k(""),F(""),G(""),R(""),q(""),$(""),V(""),B(null),H(["Guitar"]),T(j=>j.filter(L=>L!==p))):l(n.error||"Booking failed. Please try again.")}catch(o){console.error("Booking error:",o),l("An error occurred. Please try again.")}finally{Y(!1)}};return e.jsx("div",{children:e.jsxs("form",{onSubmit:ne,className:"mt-4 grid gap-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx("input",{name:"firstName",className:"h-10 rounded-md border px-3",placeholder:"First name *",value:s,onChange:t=>r(t.target.value),required:!0,autoComplete:"given-name"}),e.jsx("input",{name:"lastName",className:"h-10 rounded-md border px-3",placeholder:"Last name *",value:c,onChange:t=>f(t.target.value),required:!0,autoComplete:"family-name"})]}),e.jsx("input",{name:"email",type:"email",className:"h-10 rounded-md border px-3",placeholder:"Email *",value:m,onChange:t=>i(t.target.value),required:!0,autoComplete:"email"}),e.jsx("input",{name:"phone",type:"tel",className:"h-10 rounded-md border px-3",placeholder:"Phone *",value:d,onChange:t=>b(t.target.value),required:!0,autoComplete:"tel"}),e.jsx("input",{name:"dateOfBirth",type:"date",className:"h-10 rounded-md border px-3",placeholder:"Date of Birth *",value:g,onChange:t=>w(t.target.value),required:!0,autoComplete:"bday"}),e.jsx("textarea",{name:"address",className:"rounded-md border px-3 py-2 min-h-[80px]",placeholder:"Address (optional)",value:S,onChange:t=>h(t.target.value),autoComplete:"street-address"}),Q&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-sm font-medium text-muted-foreground mt-2 mb-1",children:"Guardian Information (Required - student is under 18)"}),e.jsx("input",{name:"guardianName",className:"h-10 rounded-md border px-3",placeholder:"Guardian name *",value:v,onCh
1ange:t=>C(t.target.value),required:!0,autoComplete:"name"}),e.jsx("input",{name:"guardianPhone",type:"tel",className:"h-10 rounded-md border px-3",placeholder:"Guardian phone *",value:x,onChange:t=>k(t.target.value),required:!0,autoComplete:"tel"})]}),e.jsx("div",{className:"text-sm font-medium text-muted-foreground mt-2 mb-1",children:"Emergency Contact"}),e.jsx("input",{name:"emergencyContactName",className:"h-10 rounded-md border px-3",placeholder:"Emergency contact name",value:I,onChange:t=>F(t.target.value),autoComplete:"name"}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx("input",{name:"emergencyContactPhone",type:"tel",className:"h-10 rounded-md border px-3",placeholder:"Emergency contact phone",value:A,onChange:t=>G(t.target.value),autoComplete:"tel"}),e.jsx("input",{name:"emergencyContactRelationship",className:"h-10 rounded-md border px-3",placeholder:"Relationship",value:z,onChange:t=>R(t.target.value)})]}),e.jsx("div",{className:"text-sm font-medium text-muted-foreground mt-2 mb-1",children:"Medical Information"}),e.jsx("textarea",{name:"allergies",className:"rounded-md border px-3 py-2 min-h-[60px]",placeholder:"Allergies (if any)",value:_,onChange:t=>q(t.target.value)}),e.jsx("textarea",{name:"medications",className:"rounded-md border px-3 py-2 min-h-[60px]",placeholder:"Current medications (if any)",value:O,onChange:t=>$(t.target.value)}),e.jsx("div",{className:"text-sm font-medium text-muted-foreground mt-2 mb-1",children:"Lesson Details"}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-2",children:"Select Instruments (choose one or more)"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:ae.map(t=>e.jsxs("label",{className:`flex items-center gap-2 p-3 rounded-md border cursor-pointer transition-colors ${N.includes(t)?"bg-primary text-primary-foreground border-primary":"hover:bg-accent"}`,children:[e.jsx("input",{type:"checkbox",checked:N.includes(t),onChange:()=>oe(t),className:"w-4 h-4"}),e.jsx("span",{className:"text-sm",children:t})]},t))})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("label",{htmlFor:"bookingDate",className:"text-sm font-medium",children:"Choose a date for your trial lesson"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{id:"bookingDate",type:"date",name:"bookingDate",className:"h-10 rounded-md border px-3",value:u,onChange:t=>ee(t.target.value),autoComplete:"off","aria-label":"Select booking date"}),e.jsx("button",{type:"button",onClick:se,disabled:J,className:"px-3 py-2 rounded-md border hover:bg-accent disabled:opacity-50 disabled:cursor-not-allowed","aria-label":"Find available time slots",children:J?"Loading...":"Find slots"})]})]}),y.length>0&&e.jsxs("div",{className:"mt-2",children:[e.jsx("div",{className:"text-sm font-medium mb-2",children:"Available slots"}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:y.map(t=>e.jsx("button",{type:"button",onClick:()=>B(t),className:`h-10 rounded-md ${p===t?"bg-primary text-primary-foreground":"bg-muted border"}`,children:t},t))})]}),e.jsx("textarea",{name:"notes",className:"rounded-md border px-3 py-2 min-h-[60px]",placeholder:"Additional notes (optional)",value:W,onChange:t=>V(t.target.value)}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(P,{size:"lg",variant:"gradient",type:"submit",disabled:Z,children:Z?"Booking...":"Book Trial Lesson"}),e.jsx("a",{href:`tel:${M().phone}`,className:"inline-block",onClick:t=>{t.preventDefault();const o=`tel:${M().phone}`;(/Mobi|Android|iPhone|iPad|iPod|Windows Phone/.test(navigator.userAgent)||window.confirm(`Call ${M().phone}?`))&&(window.location.href=o)},children:e.jsx(P,{size:"lg",variant:"ghost",type:"button",children:"Call"})})]}),E&&e.jsx("div",{className:`text-sm mt-2 p-3 rounded-md ${E.includes("successful")?"bg-green-50 text-green-800":"bg-yellow-50 text-yellow-800"}`,children:E})]})})}function ge({src:s,alt:r,width:c,height:f,className:m="",priority:i=!1,aspectRatio:d="16/9"}){const[b,g]=a.useState(!1),[w,S]=a.useState(i),h=a.useRef(null);a.useEffect(()=>{if(i||!h.current)return;const x=new IntersectionObserver(([k])=>{k.isIntersecting&&(S(!0),x.disconnect())},{rootMargin:"50px"});return x.observe(h.current),()=>x.disconnect()},[i]);const v=c||800,C=f||600;return e.jsx("div",{className:`relative overflow-hidden bg-muted ${m}`,style:{aspectRatio:d},children:w?e.jsx("img",{ref:h,src:s,alt:r,width:v,height:C,loading:i?"eager":"lazy",decoding:"async",onLoad:()=>g(!0),className:`w-full h-full object-cover transition-opacity duration-300 ${b?"opacity-100":"opacity-0"}`}):e.jsx("div",{ref:h,className:"w-full h-full bg-muted animate-pulse","aria-label":"Loading image"})})}function he({title:s="location",src:r,className:c=""}){const[f,m]=a.useState(!1),i=a.useRef(null);return a.useEffect(()=>{if(!i.current)return;const d=new IntersectionObserver(([b])=>{b.isIntersecting&&(m(!0),d.disconnect())},{rootMargin:"100px"});return d.observe(i.current),()=>d.disconnect()},[]),e.jsx("div",{ref:i,className:c,children:f?e.jsx("iframe",{title:s,src:r,className:"w-full h-full rounded-md border",loading:"lazy",referrerPolicy:"no-referrer-when-downgrade","aria-label":"Google Maps location"}):e.jsx("div",{className:"w-full h-full rounded-md border bg-muted flex items-center justify-center","aria-label":"Map loading placeholder",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading map..."})})})}function Se(){const s=M();return e.jsxs(e.Fragment,{children:[e.jsx(le,{}),e.jsxs("div",{className:"min-h-screen",children:[e.jsx("section",{className:"hero-bg py-20 bg-cover bg-center bg-foreground
1/10",children:e.jsxs("div",{className:"container mx-auto grid grid-cols-1 lg:grid-cols-12 gap-8 items-center",children:[e.jsxs("div",{className:"lg:col-span-7 text-foreground max-w-2xl",style:{textShadow:"0 1px 2px rgba(0,0,0,0.6)"},children:[e.jsxs("div",{className:"inline-flex items-center gap-3 rounded-full bg-white/10 px-3 py-1 text-sm text-white/90 dark:text-foreground/90",children:[e.jsx(me,{className:"size-4 text-yellow-300"}),"West Lothianâs award-winning tuition"]}),e.jsx("h1",{className:"mt-6 text-4xl md:text-5xl lg:text-6xl font-extrabold leading-tight text-white dark:text-foreground",children:s.heroHeading}),e.jsx("p",{className:"mt-4 text-lg text-white/90 dark:text-foreground/90",children:s.heroSubheading}),e.jsxs("div",{className:"mt-6 flex flex-col sm:flex-row gap-3",children:[e.jsx(U,{to:"/contact",children:e.jsx(P,{size:"lg",variant:"gradient",children:s.ctaPrimary})}),e.jsx(U,{to:"/lessons",children:e.jsx(P,{size:"lg",variant:"outline",children:s.ctaSecondary})})]}),e.jsxs("div",{className:"mt-8 grid grid-cols-2 sm:grid-cols-4 gap-3 text-white/90 dark:text-foreground/90 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(D,{className:"size-4 text-white/90 dark:text-foreground/90"}),"Guitar"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ie,{className:"size-4 text-white/90 dark:text-foreground/90"}),"Singing"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(D,{className:"size-4 text-white/90 dark:text-foreground/90"}),"Piano"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(D,{className:"size-4 text-white/90 dark:text-foreground/90"}),"Drums"]})]})]}),e.jsx("aside",{className:"lg:col-span-5",children:e.jsxs("div",{id:"book",className:"bg-card rounded-xl p-6 shadow-lg max-w-md mx-auto",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"Book a free trial"}),e.jsx("p",{className:"text-sm text-foreground/70 mt-1",children:"No commitment â try a 30 minute lesson."}),e.jsx(ue,{})]})})]})}),e.jsx("section",{className:"container mx-auto py-16",children:e.jsxs("div",{className:"p-6 bg-muted rounded-lg",children:[e.jsx("h2",{className:"text-2xl font-bold text-foreground",children:"Programs"}),e.jsx("p",{className:"mt-2 text-foreground/70 max-w-2xl",children:s.programsIntro}),e.jsx("div",{className:"mt-6 grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4",children:[{title:"Guitar",img:"https://static.wixstatic.com/media/11062b_5a22f499b68b4cb4bd26d6c7b59b005f~mv2.jpg"},{title:"Singing",img:"https://static.wixstatic.com/media/7bc411_238d51c0e12341719cb19ee6ed9c56a5~mv2.jpeg"},{title:"Piano",img:"https://static.wixstatic.com/media/11062b_d1a6434bf6ad4d508d7c3e0d5a5c4e95~mv2.jpg"},{title:"Bass",img:"https://static.wixstatic.com/media/11062b_2523f4cfd4a94f45a97f561665934b4c~mv2_d_5195_3362_s_4_2.jpg"},{title:"Drums",img:"https://images.unsplash.com/photo-1519892300165-cb5542fb47c7?w=800&auto=format&fit=crop"},{title:"Music Tech",img:"https://imgs.search.brave.com/0EKJxAeZgw01El91CYdTsRjQyAVMi4BshOdLWpjEENk/rs:fit:500:0:1:0/g:ce/aHR0cHM6Ly9pMC53/cC5jb20vd3d3Lm9t/Z3VidW50dS5jby51/ay93cC1jb250ZW50/L3VwbG9hZHMvMjAy/MC8wNS9hdWRhY2l0/eS1kYXJrLWNvbG91/ci10aGVtZS5qcGc_/Zml0PTE5MjAsMTA4/MCZzc2w9MQ"},{title:"Bandjam",img:"https://static.wixstatic.com/media/11062b_67da4c327ae14c4a8fed63e683be364ef000.jpg"},{title:"Masterclass",img:"https://images.unsplash.com/photo-1511379938547-c1f69419868d?w=800&auto=format&fit=crop"}].map(r=>e.jsxs("div",{className:"rounded-lg overflow-hidden border bg-card shadow-sm",children:[e.jsx(ge,{src:r.img,alt:r.title,width:256,height:144,aspectRatio:"16/9",className:"w-full"}),e.jsx("div",{className:"p-3 bg-card",children:e.jsx("h3",{className:"font-semibold text-foreground",children:r.title})})]},r.title))})]})}),e.jsx("section",{className:"container mx-auto py-12",children:e.jsxs("div",{className:"grid md:grid-cols-2 gap-6 items-center",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-semibold",children:"Location"}),e.jsxs("p",{className:"mt-2 text-foreground/70",children:["Music Studio, East Pavilion, Blackburn House",e.jsx("br",{}),"Redhouse Road, Seafield, West Lothian, EH47 7AQ, UK"]}),e.jsxs("p",{className:"mt-4 text-sm",children:["Email:"," ",e.jsx("a",{href:"mailto:[email protected]",className:"text-primary hover:underline",children:"[email protected]"})]}),e.jsxs("p",{className:"text-sm",children:["Phone:"," ",e.jsx("a",{href:"tel:+447764501732",className:"text-primary hover:underline",children:"+44 7764 501732"})]})]}),e.jsx(he,{title:"InTune Music Tuition Location",src:"https://www.google.com/maps/embed?pb=!1m2!2m1!1sBlackburn+House+Seafield",className:"w-full h-64"})]})})]})]})}export{Se 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.