1import{r as d,b as Je,j as a}from"./vendor-react-Dxo5VVMX.js";import{c as O,X as pe,d as ge,e as he}from"./NavBar-BJaF1Gp_.js";import{L as We}from"./vendor-maps-C2kLvZeU.js";import{g as Ye,y as k,t as be,m as qe}from"./index-xsCBv_jq.js";import{D as fe}from"./DateTimeOverlay-BRZtpVso.js";import{d as Qe,n as xe,c as Ze,E as Xe,f as ea,v as aa}from"./rentalDateValidation-3R8wSROm.js";import{g as ye,a as ke,r as ve,f as we}from"./reverseGeocode-ncXyatfR.js";import{mixpanel as Ce}from"./mixpanel-CmVRJZ7N.js";import"./vendor-analytics-BolNmaul.js";import"./firebaseCore-DdWO-lul.js";import"./vendor-firebase-core-Bea8MryS.js";import"./vendor-query-BGDNI3Fe.js";import"./useAccessibleModal-CVIlD6tv.js";import"./calendar-nLEFjWc4.js";import"./chevron-left-B6QySiNu.js";import"./chevron-right-C9quOlla.js";import"./clock-DXiOnoGa.js";import"./chevron-up-B1INmWzj.js";import"./chevron-down-BTSuEglj.js";const ta=["delhi","bangalore","mumbai","hyderabad","chennai","pune","kolkata","ahmedabad","noida","gurgaon","mangalore","thane","dombivli","palava","amritsar","bhubaneswar","chandigarh","coimbatore","jaipur","kochi","nashik","madurai","ghaziabad","meerut","goa","lucknow","bhopal","guwahati","indore","cochin","mysore","modinagar","muradnagar","gurugram","nagpur","siliguri","trichy","vadodara","vijayawada","vizag","udupi","visakhapatnam","udaipur","jodhpur","haridwar","rishikesh","surat","ranchi","navi-mumbai","faridabad"],De=g=>{if(!g)return!1;const v=g.toLowerCase().replace(/\s+/g,"-");return ta.includes(v)},u={bengaluru:"Bangalore",bangalore:"Bangalore","bengaluru urban":"Bangalore","bangalore urban":"Bangalore","bangalore division":"Bangalore",mysuru:"Mysore",mysore:"Mysore",mangaluru:"Mangalore",mangalore:"Mangalore",udupi:"Udupi",mumbai:"Mumbai","mumbai city":"Mumbai","mumbai suburban":"Mumbai","konkan division":"Mumbai",thane:"Thane","navi mumbai":"Navi Mumbai",pune:"Pune","pune division":"Pune",nashik:"Nashik",nasik:"Nashik","nashik division":"Nashik",nagpur:"Nagpur","nagpur division":"Nagpur",dombivli:"Dombivli",palava:"Palava","new delhi":"Delhi",delhi:"Delhi","central delhi":"Delhi","south delhi":"Delhi","north delhi":"Delhi","east delhi":"Delhi","west delhi":"Delhi","south west delhi":"Delhi","north west delhi":"Delhi","north east delhi":"Delhi","south east delhi":"Delhi",noida:"Noida","greater noida":"Noida","gautam buddha nagar":"Noida",gurugram:"Gurugram",gurgaon:"Gurugram","gurgaon division":"Gurugram",ghaziabad:"Ghaziabad",faridabad:"Faridabad",meerut:"Meerut",modinagar:"Modinagar",muradnagar:"Muradnagar",hyderabad:"Hyderabad",secunderabad:"Hyderabad",rangareddy:"Hyderabad","ranga reddy":"Hyderabad",visakhapatnam:"Vizag",vizag:"Vizag",vijayawada:"Vijayawada",chennai:"Chennai",coimbatore:"Coimbatore",madurai:"Madurai",tiruchirappalli:"Trichy",trichy:"Trichy",kolkata:"Kolkata",calcutta:"Kolkata","presidency division":"Kolkata",siliguri:"Siliguri",ahmedabad:"Ahmedabad",vadodara:"Vadodara",baroda:"Vadodara",surat:"Surat",rajkot:"Rajkot",jaipur:"Jaipur","jaipur division":"Jaipur",jodhpur:"Jodhpur",udaipur:"Udaipur",bikaner:"Bikaner",jaisalmer:"Jaisalmer",kota:"Kota",chandigarh:"Chandigarh",amritsar:"Amritsar",ludhiana:"Ludhiana",bhopal:"Bhopal",indore:"Indore","indore division":"Indore",dehradun:"Dehradun",haridwar:"Haridwar",rishikesh:"Rishikesh",goa:"Goa",panaji:"Goa","north goa":"Goa","south goa":"Goa",lucknow:"Lucknow","lucknow division":"Lucknow",agra:"Agra",varanasi:"Varanasi",kochi:"Kochi",cochin:"Kochi",ernakulam:"Kochi",thiruvananthapuram:"Trivandrum",trivandrum:"Trivandrum",kozhikode:"Kozhikode",calicut:"Kozhikode",bhubaneswar:"Bhubaneswar",bhubaneshwar:"Bhubaneswar",ranchi:"Ranchi",guwahati:"Guwahati",gauhati:"Guwahati"},E={karnataka:"Bangalore",maharashtra:"Mumbai",delhi:"Delhi",haryana:"Gurugram","uttar pradesh":"Noida",telangana:"Hyderabad","andhra pradesh":"Hyderabad","tamil nadu":"Chennai","west bengal":"Kolkata",gujarat:"Ahmedabad",rajasthan:"Jaipur",punjab:"Chandigarh","madhya pradesh":"Indore",kerala:"Kochi",goa:"Goa",uttarakhand:"Dehradun",odisha:"Bhubane
1swar",jharkhand:"Ranchi",assam:"Guwahati"},G={400:"Mumbai",401:"Thane",411:"Pune",412:"Pune",560:"Bangalore",561:"Bangalore",562:"Bangalore",500:"Hyderabad",501:"Hyderabad",502:"Hyderabad",600:"Chennai",601:"Chennai",602:"Chennai",603:"Chennai",110:"Delhi",700:"Kolkata",380:"Ahmedabad",382:"Ahmedabad",302:"Jaipur",403:"Goa",682:"Kochi",683:"Kochi",226:"Lucknow",160:"Chandigarh",452:"Indore",462:"Bhopal",440:"Nagpur",530:"Vizag",122:"Gurugram",201:"Noida",121:"Faridabad"},ra={delhi:{lat:28.6139,lng:77.209,name:"Delhi"},bangalore:{lat:12.9716,lng:77.5946,name:"Bangalore"},mumbai:{lat:19.076,lng:72.8777,name:"Mumbai"},hyderabad:{lat:17.385,lng:78.4867,name:"Hyderabad"},chennai:{lat:13.0827,lng:80.2707,name:"Chennai"},pune:{lat:18.5204,lng:73.8567,name:"Pune"},kolkata:{lat:22.5726,lng:88.3639,name:"Kolkata"},ahmedabad:{lat:23.0225,lng:72.5714,name:"Ahmedabad"},noida:{lat:28.5355,lng:77.391,name:"Noida"},gurgaon:{lat:28.4595,lng:77.0266,name:"Gurgaon"},gurugram:{lat:28.4595,lng:77.0266,name:"Gurugram"},ghaziabad:{lat:28.6692,lng:77.4538,name:"Ghaziabad"},faridabad:{lat:28.4089,lng:77.3178,name:"Faridabad"},meerut:{lat:28.9845,lng:77.7064,name:"Meerut"},modinagar:{lat:28.832,lng:77.5774,name:"Modinagar"},muradnagar:{lat:28.778,lng:77.4912,name:"Muradnagar"},thane:{lat:19.2183,lng:72.9781,name:"Thane"},"navi-mumbai":{lat:19.033,lng:73.0297,name:"Navi Mumbai"},nashik:{lat:19.9975,lng:73.7898,name:"Nashik"},nagpur:{lat:21.1458,lng:79.0882,name:"Nagpur"},dombivli:{lat:19.2183,lng:73.0867,name:"Dombivli"},palava:{lat:19.1657,lng:73.0942,name:"Palava"},mangalore:{lat:12.9141,lng:74.856,name:"Mangalore"},mysore:{lat:12.2958,lng:76.6394,name:"Mysore"},udupi:{lat:13.3409,lng:74.7421,name:"Udupi"},coimbatore:{lat:11.0168,lng:76.9558,name:"Coimbatore"},madurai:{lat:9.9252,lng:78.1198,name:"Madurai"},trichy:{lat:10.7905,lng:78.7047,name:"Trichy"},vijayawada:{lat:16.5062,lng:80.648,name:"Vijayawada"},vizag:{lat:17.6868,lng:83.2185,name:"Vizag"},visakhapatnam:{lat:17.6868,lng:83.2185,name:"Visakhapatnam"}
1,vadodara:{lat:22.3072,lng:73.1812,name:"Vadodara"},surat:{lat:21.1702,lng:72.8311,name:"Surat"},jaipur:{lat:26.9124,lng:75.7873,name:"Jaipur"},jodhpur:{lat:26.2389,lng:73.0243,name:"Jodhpur"},udaipur:{lat:24.5854,lng:73.7125,name:"Udaipur"},chandigarh:{lat:30.7333,lng:76.7794,name:"Chandigarh"},amritsar:{lat:31.634,lng:74.8723,name:"Amritsar"},bhopal:{lat:23.2599,lng:77.4126,name:"Bhopal"},indore:{lat:22.7196,lng:75.8577,name:"Indore"},haridwar:{lat:29.9457,lng:78.1642,name:"Haridwar"},rishikesh:{lat:30.0869,lng:78.2676,name:"Rishikesh"},goa:{lat:15.2993,lng:74.124,name:"Goa"},lucknow:{lat:26.8467,lng:80.9462,name:"Lucknow"},guwahati:{lat:26.1445,lng:91.7362,name:"Guwahati"},kochi:{lat:9.9312,lng:76.2673,name:"Kochi"},cochin:{lat:9.9312,lng:76.2673,name:"Cochin"},bhubaneswar:{lat:20.2961,lng:85.8245,name:"Bhubaneswar"},ranchi:{lat:23.3441,lng:85.3096,name:"Ranchi"},siliguri:{lat:26.7271,lng:88.3953,name:"Siliguri"}},Ne=g=>{if(!g)return"";const v=g.toLowerCase().replace(/-/g," ");return u[v]?u[v]:g.split("-").map(h=>h.charAt(0).toUpperCase()+h.slice(1).toLowerCase()).join(" ")},je=d.memo(({sugg:g,onClick:v})=>a.jsxs("li",{role:"option","aria-selected":!1,onClick:()=>v(g),className:"flex items-center px-4 py-3 hover:bg-gradient-to-r hover:from-purple-50 hover:to-blue-50 dark:hover:from-purple-900/20 dark:hover:to-blue-900/20 cursor-pointer text-sm text-gray-700 dark:text-gray-200 transition-all duration-200 border-b border-gray-50 dark:border-zinc-700 last:border-b-0",children:[a.jsx("div",{className:"p-1.5 bg-red-100 dark:bg-red-900/30 rounded-lg mr-3","aria-hidden":"true",children:a.jsx(O,{className:"w-4 h-4 text-red-500"})}),a.jsx("span",{className:"truncate",children:g.displayName||g.fullAddress})]}));je.displayName="SuggestionItem";const Ca=({urlcity:g,tone:v="default"})=>{const[h,Se]=d.useState("rent"),U=g?Ne(g):"",[x,C]=d.useState(U),[D,T]=d.useState(null),[$,L]=d.useState([]),[I,N]=d.useState(U),[_e,V]=d.useState(""),J=ye(),Te=ke(J),[m,z]=d.useState(J),[f,j]=d.useState(Te),[B,K]=d.useState("24 hours"),[M,Le]=d.useState(""),[Ie,A]=d.useState(!1),[ze,P]=d.useState(!1),[Me,W]=d.useState(!1),[Ae,Y]=d.useState(!1),[Pe,Ee]=d.useState(""),[Ge,$e]=d.useState("Error"),[Be,H]=d.useState(!1),[q,Q]=d.useState(!1),[Ke,He]=d.useState(!1),Z=Je(),[,X]=d.useTransition(),S=d.useRef(!1),Re=d.useMemo(()=>["places"],[]),ee="AIzaSyD4d4ZEpEFIc290yb6WNaiTQsnM-rt4cJQ",R=d.useRef(!0);d.useEffect(()=>{if(R.current){if(g){const o=Ne(g);C(o),N(o);const l=g.toLowerCase(),i=ra[l];i&&T({lat:i.lat,lng:i.lng,name:i.name||o}),S.current=!0,R.current=!1;return}const t=localStorage.getItem("pickupLocation");t&&(C(t),S.current=!0),R.current=!1;return}if(S.current)return;if(!x){L([]);return}const n=setTimeout(async()=>{var t,o,l,i;try{if((l=(o=(t=window.google)==null?void 0:t.maps)==null?void 0:o.places)!=null&&l.AutocompleteSuggestion){const p=new window.google.maps.places.AutocompleteSessionToken,c=await window.google.maps.places.AutocompleteSuggestion.fetchAutocompleteSuggestions({input:x,includedRegionCodes:["IN"],language:"en",sessionToken:p}),y=((i=c==null?void 0:c.suggestions)==null?void 0:i.map(s=>{var ce,ue,me;const r=s==null?void 0:s.placePrediction,b=(r==null?void 0:r.placeId)||"",w=((ce=r==null?void 0:r.text)==null?void 0:ce.text)||"",de=((ue=r==null?void 0:r.mainText)==null?void 0:ue.text)||"",F=((me=r==null?void 0:r.secondaryText)==null?void 0:me.text)||"";return{placeId:b,fullAddress:w,displayName:`${de}${F?", "+F:""}`,city:F}}))||[];L(y)}}catch(p){console.error("Error fetching autocomplete suggestions:",p)}},200);return()=>clearTimeout(n)},[x,Ke]);const Fe=d.useCallback(async e=>{S.current=!0,X(()=>{C(e.fullAddress),L([])}),localStorage.setItem("pickupLocation",e.fullAddress);const n=await Oe(e.placeId);if(n){let t=ae(n);const o=n.location,l=o?o.lat():0,i=o?o.lng():0,p=(t==null?void 0:t.toLowerCase().replace(/\s+/g,"-"))||"";if(!De(p)&&l&&i)try{const c=await ve(l,i);if(c.length>0){const y=we(c);if(y){const s=oe(y);s&&(t=s)}}}catch(c){console.error("Reverse geocode fallback failed:",c)}N(t),T({name:String(n.displayName||e.fullAddress),lat:l,lng:i,addressComponents:n.addressComponents||[]})}},[ee]),Oe=async e=>{try{const t=(await window.google.maps.importLibrary("places")).Place,o=new t({id:e,requestedLanguage:"en"});return await o.fetchFields({fields:["addressComponents","displayName","formattedAddress","location"]}),o}catch(n){return console.error("Error fetching place details:",n),null}},ae=e=>{var s;if(!(e!=null&&e.addressComponents))return console.warn("No address components found"),"";const n=Array.isArray(e.addressComponents)?e.addressComponents:[],t=r=>{const b=n.find(w=>(Array.isArray(w.types)?w.types:[]).includes(r));return b&&(b.longText||b.shortText)||""},o=t("locality");if(o){const r=o.toLowerCase().trim();if(u[r])return u[r]}const l=["administrative_area_level_2","administrative_area_level_3"];for(const r of l){const b=t(r);if(b){const w=b.toLowerCase().trim();if(u[w])return u[w]}}const i=t("sublocality_level_1");if(i){const r=i.toLowerCase().trim();if(u[r])return u[r]}const p=t("administrative_area_level_1");if(p){const r=p.toLowerCase().trim();if(E[r])return E[r]}
1const c=n.map(r=>r.longText||r.shortText).join(", "),y=c.match(/\b(\d{6})\b/);if(y){const r=y[1].substring(0,3);if(G[r])return G[r]}for(const r of n){const b=(r.longText||r.shortText||"").toLowerCase().trim();if(b&&u[b])return u[b]}return c.toLowerCase().includes("india")?"Delhi":o||((s=n[0])==null?void 0:s.longText)||""},te=e=>{if(!e)return"";const n=e.split(",").map(t=>t.trim().toLowerCase());for(const t of n)if(u[t])return u[t];return e.split(",")[0].trim()},Ue=e=>{if(Se(e),e==="buy")Ce.track("HomeScreen page details",{section:"buy",location:null,startDate:null,endDate:null,page:window.location.pathname}),Z("/buy-car");else if(e==="subscribe"){const n=new Date(m);n.setDate(n.getDate()+30),j(n),_(m,n)}},re=e=>{localStorage.removeItem("pickupLocation"),C(e.target.value),S.current=!1},ne=()=>{C(""),T(null),N(""),L([]),localStorage.removeItem("pickupLocation"),S.current=!1},oe=e=>{const n=(e==null?void 0:e.address_components)||[],t=s=>{const r=n.find(b=>{var w;return(w=b.types)==null?void 0:w.includes(s)});return r&&r.long_name||""},o=["administrative_area_level_2","administrative_area_level_3"];for(const s of o){const r=t(s);if(r){const b=r.toLowerCase().trim();if(u[b])return u[b]}}const l=t("locality");if(l){const s=l.toLowerCase().trim();if(u[s])return u[s]}const i=t("sublocality_level_1");if(i){const s=i.toLowerCase().trim();if(u[s])return u[s]}const p=t("administrative_area_level_1");if(p){const s=p.toLowerCase().trim();if(E[s])return E[s]}const c=n.map(s=>s.long_name).join(", "),y=c.match(/\b(\d{6})\b/);if(y){const s=y[1].substring(0,3);if(G[s])return G[s]}for(const s of n){const r=(s.long_name||"").toLowerCase().trim();if(r&&u[r])return u[r]}return c.toLowerCase().includes("india")?"Delhi":l||""},ie=()=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(e=>{const{latitude:n,longitude:t}=e.coords;ve(n,t).then(o=>{if(o.length>0){const l=we(o);if(!l){k.error("Unable to determine location details",{position:"top-center",autoClose:1e3*5});return}const i=n,p=t;T({name:l.formatted_address,lat:i,lng:p});const c=l.formatted_address.split(",");V(c.length>2?`${c[0]}, ${c[1]}, ${c.at(-2)}`:c);const y=oe(l);N(y),C(l.formatted_address)}else k.error("Unable to fetch location details",{position:"top-center",autoClose:1e3*5})}).catch(o=>{k.error("Error fetching location details",{position:"top-center",autoClose:1e3*5})})},e=>{k.error("Unable to retrieve your location",{position:"top-center",autoClose:1e3*5})}):k.error("Geolocation is not supported by this browser",{position:"top-center",autoClose:1e3*5})},_=(e,n)=>{const t=new Date(e);let o;if(h==="subscribe"?(o=new Date(t),o.setDate(o.getDate()+30),j(o)):o=new Date(n),isNaN(t.getTime())||isNaN(o.getTime())){K("Invalid Date");return}const l=o.getTime()-t.getTime();if(l<8*60*60*1e3){W(!0),$e("Invalid Duration"),Ee("Trip duration should be more than 8 hours!"),Y(!0),K("Select both dates");return}else W(!1);const i=Math.floor(l/(1e3*60*60));Le(i);const p=Math.floor(i/24),c=i%24;K(ea(p,c))},Ve=()=>{if(!I){k.error("Please select a valid city",{position:"top-center",autoClose:5e3});return}if(!m){k.error("Please select a start date",{position:"top-center",autoClose:5e3});return}if(!f){k.error("Please select an end date",{position:"top-center",autoClose:5e3});return}
1const e=aa(m,f);if(e.reason==="pickup-too-soon"){k.error("Choose a pickup time at least 2 hours from now.",{position:"top-center",autoClose:5e3});return}if(e.reason==="invalid-date"){k.error("Please select valid pickup and drop-off dates.",{position:"top-center",autoClose:5e3});return}if(!e.isValid){k.error("Choose a drop-off time at least 8 hours after pickup.",{position:"top-center",autoClose:5e3});return}if(!D||!D.lat||!D.lng){k.error("Please select a valid location",{position:"top-center",autoClose:5e3});return}const n=I.toLowerCase().replace(/\s+/g,"-"),t={city:I||"Unknown",start_date:m?m.toISOString():null,end_date:f?f.toISOString():null,rental_days:M?Math.ceil(Number(M)/24):null,trip_duration:B,section:h,tripDurationHours:M,page:window.location.pathname};requestAnimationFrame(()=>setTimeout(()=>{be("search_submitted",{city:t.city,start_date:t.start_date,end_date:t.end_date,rental_days:t.rental_days,trip_duration:t.trip_duration}),De(n)||be("search_submitted_wildcard_city",{city:t.city,start_date:t.start_date,end_date:t.end_date,rental_days:t.rental_days,trip_duration:t.trip_duration}),Ce.track("HomeScreen page details",{section:t.section,location:t.city,startDate:t.start_date,endDate:t.end_date,TripDuration:t.trip_duration,TripDurationHours:t.tripDurationHours,page:t.page}),qe(x,m,f,D,I),sessionStorage.setItem("fromSearch","true")},0));const o={address:_e||D.name,lat:D.lat,lng:D.lng,startDate:m,endDate:f,tripDuration:B,tripDurationHours:M,activeTab:h};X(()=>{Z(`/self-drive-car-rental-in-${n}/cars`,{state:o})})},se=()=>{A(!0),P(!1)},le=()=>{h!=="subscribe"&&(P(!0),A(!1))};return d.useEffect(()=>{var t;if(g)return;const e=Ye(),n=new Date;if(e.location&&(C(e.location),e.placeDetails)){const o={name:e.placeDetails.name,lat:e.placeDetails.lat,lng:e.placeDetails.lng,addressComponents:e.placeDetails.addressComponents};if(T(o),V(e.placeDetails.name||e.location),e.city)N(e.city);else if(((t=e.placeDetails.addressComponents)==null?void 0:t.length)>0){const l=ae({addressComponents:e.placeDetails.addressComponents});N(l||te(e.location))}else N(te(e.location))}if(e.startDate){const o=new Date(e.startDate),l=e.endDate?new Date(e.endDate):null;if(Number.isNaN(o.getTime())||o.getTime()<Qe(n).getTime()){const i=ye(),p=ke(i);z(i),j(p),_(i,p)}else{z(o);const i=xe(o,l);i.dropoff&&(j(i.dropoff),_(o,i.dropoff),H(i.wasNormalized))}}},[]),a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"mx-auto w-full max-w-[95%] sm:max-w-[90%] md:max-w-[75%] lg:max-w-[900px] px-1 sm:px-0",children:a.jsxs("div",{className:"rounded-2xl p-4 sm:p-6 md:p-8 shadow-xl border border-transparent",children:[a.jsx("div",{className:"flex justify-center mb-4 sm:mb-6",children:a.jsx("div",{role:"tablist","aria-label":"Booking type",className:"inline-flex bg-gray-100 dark:bg-zinc-800 rounded-full p-1 shadow-inner",children:["rent","subscribe","buy"].map(e=>a.jsx("button",{role:"tab","aria-selected":h===e,tabIndex:h===e?0:-1,onClick:()=>Ue(e),className:`px-5 sm:px-5 md:px-8 py-3 sm:py-2.5 min-w-[44px] min-h-[44px] rounded-full text-sm sm:text-sm md:text-base font-semibold transition-all duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-purple-400 focus-visible:ring-offset-2 ${h===e?"bg-z2-brand-blue text-white shadow-md shadow-purple-500/30":"text-gray-600 dark:text-gray-300 hover:text-purple-600 dark:hover:text-purple-400"}`,children:e.charAt(0).toUpperCase()+e.slice(1)},e))})}),q||x?a.jsx(We,{googleMapsApiKey:ee,libraries:Re,version:"beta",onLoad:()=>He(!0),loadingElement:a.jsx("div",{"aria-hidden":"true",className:"flex items-center rounded-xl px-4 py-3 w-full bg-gray-50 dark:bg-white/[0.03] border border-gray-200 dark:border-white/10 mb-4 animate-pulse",children:a.jsx("div",{className:"h-5 w-40 bg-gray-200 dark:bg-zinc-700 rounded"})}),children:a.jsxs("div",{className:`flex items-center rounded-xl px-4 py-3 w-full shadow-sm transition-all duration-300 ease-in-out bg-gray-50 dark:bg-white/[0.03] relative mb-4 border ${x?"border-purple-400 dark:border-purple-500/40":"border-gray-200 dark:border-white/10 hover:border-purple-300"}`,children:[a.jsx("div",{className:`p-2 rounded-lg mr-3 ${x?"bg-purple-100":"bg-gray-100 dark:bg-zinc-600"}`,"aria-hidden":"true",children:a.jsx(O,{className:`w-5 h-5 ${x?"text-purple-600":"text-gray-600 dark:text-gray-300"}`})}),a.jsx("div",{className:"w-full min-w-0",children:a.jsx("input",{id:"pickup-location",name:"pickup_location",type:"text",placeholder:"Where do you need a car?","aria-label":"Pickup location",autoComplete:"off",enterKeyHint:"search",role:"combobox","aria-autocomplete":"list","aria-expanded":$.length>0,"aria-controls":"pickup-location-suggestions","aria-haspopup":"listbox",className:"bg-transparent outline-none w-full placeholder-gray-500 dark:placeholder-gray-500 text-gray-800 dark:text-white font-medium text-base focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-purple-400 focus-visible:ring-offset-2 rounded-sm",value:x,onChange:re,onFocus:()=>{q||Q(!0)}})}),x&&a.jsx("button",{className:"flex items-center justify-center ml-2 flex-shrink-0 w-11 h-11 rounded-full bg-gray-100 dark:bg-zinc-600 text-gray-500 dark:text-gray-300 hover:bg-red-100 hover:text-red-500 dark:hover:bg-red-900/30 dark:hover:text-red-400 transition-colors duration-200",onClick:ne,type:"button","aria-label":"Clear location",children:a.jsx(pe,{className:"w-4 h-4"})}),a.jsxs("button",{className:"flex items-center ml-2 flex-shrink-0 px-3 sm:px-4 py-2.5 rounded-lg bg-blue-50 dark:bg-blue-900/30 text-blue-600 dar
1k:text-blue-400 hover:bg-blue-100 dark:hover:bg-blue-900/50 transition-colors duration-200 min-w-[44px] min-h-[44px] justify-center",onClick:ie,type:"button","aria-label":"Get current location",children:[a.jsx(ge,{className:"w-5 h-5 sm:w-4 sm:h-4 sm:mr-1.5"}),a.jsx("span",{className:"text-sm font-medium hidden sm:inline",children:"Locate"})]}),$.length>0&&a.jsx("ul",{id:"pickup-location-suggestions",role:"listbox","aria-label":"Location suggestions",className:"absolute left-0 right-0 top-full mt-2 z-50 bg-white dark:bg-zinc-800 rounded-xl shadow-lg max-h-60 overflow-y-auto border border-gray-100 dark:border-zinc-700 text-left",children:$.map((e,n)=>a.jsx(je,{sugg:e,onClick:Fe},n))})]})}):a.jsxs("div",{className:`flex items-center rounded-xl px-4 py-3 w-full shadow-sm transition-all duration-300 ease-in-out bg-gray-50 dark:bg-white/[0.03] relative mb-4 border ${x?"border-purple-400 dark:border-purple-500/40":"border-gray-200 dark:border-white/10 hover:border-purple-300"}`,children:[a.jsx("div",{className:`p-2 rounded-lg mr-3 ${x?"bg-purple-100":"bg-gray-100 dark:bg-zinc-600"}`,"aria-hidden":"true",children:a.jsx(O,{className:`w-5 h-5 ${x?"text-purple-600":"text-gray-600 dark:text-gray-300"}`})}),a.jsx("div",{className:"relative w-full",children:a.jsx("input",{id:"pickup-location",name:"pickup_location",type:"text",placeholder:"Where do you need a car?","aria-label":"Pickup location",autoComplete:"off",enterKeyHint:"search",role:"combobox","aria-autocomplete":"list","aria-expanded":!1,"aria-controls":"pickup-location-suggestions","aria-haspopup":"listbox",className:"bg-transparent outline-none w-full placeholder-gray-500 dark:placeholder-gray-500 text-gray-800 dark:text-white font-medium text-base focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-purple-400 focus-visible:ring-offset-2 rounded-sm",value:x,onChange:re,onFocus:()=>Q(!0)})}),x&&a.jsx("button",{className:"flex items-center justify-center ml-2 flex-shrink-0 w-11 h-11 rounded-full bg-gray-100 dark:bg-zinc-600 text-gray-500 dark:text-gray-300 hover:bg-red-100 hover:text-red-500 dark:hover:bg-red-900/30 dark:hover:text-red-400 transition-colors duration-200",onClick:ne,type:"button","aria-label":"Clear location",children:a.jsx(pe,{className:"w-4 h-4"})}),a.jsxs("button",{className:"flex items-center ml-2 flex-shrink-0 px-3 sm:px-4 py-2.5 rounded-lg bg-blue-50 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400 hover:bg-blue-100 dark:hover:bg-blue-900/50 transition-colors duration-200 min-w-[44px] min-h-[44px] justify-center",onClick:ie,type:"button","aria-label":"Get current location",children:[a.jsx(ge,{className:"w-5 h-5 sm:w-4 sm:h-4 sm:mr-1.5"}),a.jsx("span",{className:"text-sm font-medium hidden sm:inline",children:"Locate"})]})]}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-4",children:[a.jsxs("div",{className:`relative w-full ${h==="subscribe"?"sm:col-span-2":""}`,children:[a.jsx("label",{className:"text-xs font-semibold text-gray-600 dark:text-gray-600 mb-1.5 block ml-1",children:"Start Date & Time"}),a.jsxs("div",{role:"button",tabIndex:0,"aria-label":"Start date and time",className:`rounded-xl p-3 flex items-center cursor-pointer transition-all duration-300 bg-gray-50 dark:bg-white/[0.03] border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-purple-400 focus-visible:ring-offset-2 ${m?"border-purple-400 dark:border-purple-500/40":"border-gray-200 dark:border-white/10 hover:border-purple-300"}`,onClick:se,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),se())},children:[a.jsx("div",{className:`p-2 rounded-lg mr-3 ${m?"bg-purple-100":"bg-gray-100 dark:bg-zinc-600"}`,children:a.jsx(he,{className:`w-4 h-4 ${m?"text-purple-600":"text-gray-600 dark:text-gray-300"}`})}),a.jsx("span",{className:`font-medium text-sm ${m?"text-gray-800 dark:text-white":"text-gray-500"}`,children:m?new Intl.DateTimeFormat("en-US",{month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!0}).format(new Date(m)):"Select date & time"})]}),Ie&&a.jsx(fe,{selectedDate:m,setSelectedDate:z,onSave:e=>{if(z(e),H(!1),h==="subscribe")f&&_(e,f);else{const n=xe(e,f);n.dropoff&&(j(n.dropoff),_(e,n.dropoff))}A(!1)},onClose:()=>A(!1),minDate:new Date})]}),a.jsxs("div",{className:`${h=="subscribe"?"hidden":"relative w-full"}`,children:[a.jsx("label",{className:"text-xs font-semibold text-gray-600 dark:text-gray-600 mb-1.5 block ml-1",children:"End Date & Time"}),a.jsxs("div",{role:"button",tabIndex:h==="subscribe"?-1:0,"aria-label":"End date and time",className:`rounded-xl p-3 flex items-center cursor-pointer transition-all duration-300 bg-gray-50 dark:bg-white/[0.03] border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-purple-400 focus-visible:ring-offset-2 ${h==="subscribe"?"opacity-50 cursor-not-allowed border-gray-200":""} ${f?"border-purple-400 dark:border-purple-500/40":"border-gray-200 dark:border-white/10 hover:border-purple-300"}`,onClick:le,onKeyDown:e=>{h!=="subscribe"&&(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),le())},"aria-disabled":h==="subscribe",children:[a.jsx("div",{className:`p-2 rounded-lg mr-3 ${f?"bg-purple-100":"bg-gray-100 dark:bg-zinc-600"}`,children:a.jsx(he,{className:`w-4 h-4 ${f?"text-purple-600":"text-gray-600 dark:text-gray-300"}`})}),a.jsx("span",{className:`font-medium text-sm ${f?"text-gray-800 dark:text-white":"text-gray-500"}`,children:f?new Intl.DateTimeFormat("en-US",{month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!0}).format(new Date(f)):"Select date & time"})]}),ze&&a.jsx(fe,{selectedDate:f||new Date,setSelectedDate:j,onSave:e=>{j(e),H(!1),m&&_(m,e),P(!1)},onClose:()=>P(!1),minDate:m,minimumInstant:Ze(m)})]})]}),Be&&a.jsx("p",{role:"status",className:"mb-4 text-center text-sm text-gray-600 dark:text-gray-300",children:"Your previous drop-off time is no longer valid. Weâve updated it to a valid time."}),a.jsxs("div",{className:v==="muted"?"rounded-xl p-3 sm:p-4 mb-4 sm:mb-6 text-center border border-white/10 bg-white/[0.03]":"bg-gradient-to-r from-blue-50 to-purple-50 dark:from-blue-900/20 dark:to-purple-900/20 rounded-xl p-3 sm:p-4 mb-4 sm:mb-6 text-center border border-purple-100 dar
1k:border-purple-900/30",children:[a.jsx("div",{className:"text-gray-500 dark:text-gray-300 text-xs font-semibold uppercase tracking-wider mb-1",children:"Trip Duration"}),a.jsx("div",{className:v==="muted"?"text-gray-200 text-lg sm:text-xl md:text-2xl font-bold":"bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent text-lg sm:text-xl md:text-2xl font-bold",children:B})]}),a.jsxs("div",{className:"flex items-center gap-3 sm:gap-4",children:[a.jsxs("div",{className:`hidden sm:block text-sm whitespace-nowrap ${v==="muted"?"text-gray-300":"text-gray-600 dark:text-gray-400"}`,children:["Cars from ",a.jsx("strong",{className:"text-gray-900 dark:text-white text-base font-bold",children:"â¹40/hr"})]}),Me?a.jsx("button",{disabled:!0,className:"flex-1 bg-gray-100 dark:bg-zinc-700 cursor-not-allowed text-gray-600 dark:text-gray-400 font-semibold py-4 rounded-xl",children:"Search cars"}):a.jsx("button",{onClick:Ve,className:"flex-1 bg-z2-brand-blue text-white font-bold py-4 rounded-xl transition-all duration-300 hover:shadow-xl hover:shadow-purple-500/25 hover:scale-[1.02] active:scale-[0.98] shadow-lg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-purple-400 focus-visible:ring-offset-2",children:"Search cars"})]})]})}),a.jsx(Xe,{isOpen:Ae,onClose:()=>Y(!1),title:Ge,message:Pe})]})};export{Ca 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.