1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="0e066988-ceff-4705-9045-c8f869ba6ee7",e._sentryDebugIdIdentifier="sentry-dbid-0e066988-ceff-4705-9045-c8f869ba6ee7")}()}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7385],{68393:function(e,t,a){a.d(t,{Q:function(){return s}}),a(83079);var s=(0,a(12119).$)("ed1ff400684852eb4a4f450b2010a60205195ea5")},72598:function(e,t,a){a.r(t),a.d(t,{default:function(){return eP}});var s=a(57437),r=a(2265),l=a(17917),i=a(20904),n=a(81288),o=a(33632),d=a(61850),c=a(84170),m=a(21047),u=a(91734),p=a(2207),x=a(32489),h=a(30401),f=a(1098),g=a(17814),v=a(95186),b=a(19378),y=a(53647),j=a(85897),_=a(12339);function N(e){var t;let{title:a,message:l,fields:i,onSubmit:n,loading:o}=e,[d,c]=(0,r.useState)({}),[N,k]=(0,r.useState)(!1),[w,C]=(0,r.useState)((null==i?void 0:null===(t=i[0])||void 0===t?void 0:t.name)||""),[A,z]=(0,r.useState)(0),S=(0,r.useRef)(null),[D,E]=(0,r.useState)(void 0),M=e=>{if(!S.current)return;let t=S.current.querySelector('[data-state="active"]');t&&t.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},T=(0,r.useMemo)(()=>{let e=(null==i?void 0:i.filter(e=>"child_ages"!==e.name&&"start_date"!==e.name&&"end_date"!==e.name))||[],t=i.find(e=>"start_date"===e.name),a=i.find(e=>"end_date"===e.name),s=t&&a?[{name:"travel_dates",label:"Travel Dates",type:"date-range",required:(null==t?void 0:t.required)||(null==a?void 0:a.required)||!1,placeholder:""}]:[];return[...e.slice(0,2),...s,...e.slice(2)]},[i]),I=e=>e?e.toLocaleDateString("en-IN",{year:"2-digit",month:"2-digit",day:"2-digit"}):"--/--/--",F=(e,t)=>{c(a=>({...a,[e]:t}))};(0,r.useEffect)(()=>{c(e=>({...e,adult_count:e.adult_count||2,child_count:e.child_count||0}));let e=d.start_date?new Date(d.start_date):void 0,t=d.end_date?new Date(d.end_date):void 0;(e||t)&&E({from:e,to:t})},[]),(0,r.useEffect)(()=>{w&&M(w)},[w]);let O=(e,t)=>{let a;let s=d[e]||("adult_count"===e?2:0),r="adult_count"===e?1:0;a=t?Math.min(s+1,10):Math.max(s-1,r);let l={...d,[e]:a};if("child_count"===e){let e=d.child_count||0,t=d.child_ages||"";if(0===a)l.child_ages="";else if(a>e){let e=t?t.split(",").map(e=>e.trim()).filter(e=>e):[];for(;e.length<a;)e.push("");l.child_ages=e.join(", ")}else if(a<e){let e=t?t.split(",").map(e=>e.trim()).filter(e=>e):[];l.child_ages=e.slice(0,a).join(", ")}}c(l)},L=e=>{let t=d[e.name]||("adult_count"===e.name?2:0),a="adult_count"===e.name?1:0;return(0,s.jsxs)("div",{className:"flex items-center justify-center space-x-4",children:[(0,s.jsx)("button",{type:"button",onClick:()=>O(e.name,!1),disabled:t<=a,className:"flex size-16 items-center justify-center rounded-2xl bg-[--purple-primary] text-black transition-colors ".concat(t<=a&&" cursor-not-allowed"),children:(0,s.jsx)(m.Z,{size:20})}),(0,s.jsx)("div",{className:"w-3/5 rounded-2xl border-1 border-[--border] py-3 text-center",children:(0,s.jsx)("p",{className:"text-2xl font-normal",children:t})}),(0,s.jsx)("button",{type:"button",onClick:()=>O(e.name,!0),disabled:t>=10,className:"flex size-16 items-center justify-center rounded-2xl bg-[--purple-primary] text-black transition-colors ".concat(t>=10&&" cursor-not-allowed"),children:(0,s.jsx)(u.Z,{size:20})})]})},q=()=>{let e=d.child_count||0;if(0===e)return null;let t=d.child_ages||"",a=t?t.split(",").map(e=>e.trim()):[];for(;a.length<e;)a.push("");let r=Array.from({length:12},(e,t)=>({value:(t+1).toString(),label:"".concat(t+1)})),l=(e,t)=>
1{let s=[...a];s[e]=t,F("child_ages",s.join(", "))};return(0,s.jsxs)("div",{className:"mt-6 space-y-4",children:[(0,s.jsx)("h4",{className:"text-lg font-medium text-gray-900",children:"Children Ages"}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:Array.from({length:e},(e,t)=>(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("label",{className:"block text-sm font-medium text-gray-700",children:["Child ",t+1," Age"]}),(0,s.jsxs)(y.Ph,{value:a[t]||"",onValueChange:e=>l(t,e),children:[(0,s.jsx)(y.i4,{className:"w-full",children:(0,s.jsx)(y.ki,{placeholder:"Select age"})}),(0,s.jsx)(y.Bw,{className:"w-10",children:r.map(e=>(0,s.jsx)(y.Ql,{value:e.value,children:e.label},e.value))})]})]},t))})]})},Z=()=>(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"mb-6 flex items-stretch rounded-lg border border-[--border] p-2",children:[(0,s.jsxs)("div",{className:"flex-1 text-center",children:[(0,s.jsx)("p",{className:"mb-1 text-xs text-gray-500",children:"Start"}),(0,s.jsx)("p",{className:"text-base font-normal",children:I(null==D?void 0:D.from)})]}),(0,s.jsx)("div",{className:"mx-4 self-stretch border-l border-[--border]"}),(0,s.jsxs)("div",{className:"flex-1 text-center",children:[(0,s.jsx)("p",{className:"mb-1 text-xs text-gray-500",children:"End"}),(0,s.jsx)("p",{className:"text-base font-normal",children:I(null==D?void 0:D.to)})]})]}),(0,s.jsx)(f.f,{mode:"range",className:"mx-auto w-full font-medium",classNames:{months:"w-full text-primary-text pt-1 pb-2 px-3",caption:"flex items-center justify-center relative py-3 mb-3",caption_label:"text-xl font-bold",nav_button:"h-9 w-9 bg-[--purple-primary] text-black rounded-lg flex items-center justify-center hover:bg-[--purple-primary]/80 absolute top-1/2 -translate-y-1/2",nav_button_previous:"left-3",nav_button_next:"right-3",head_row:"flex justify-around mb-2",head_cell:"w-10 h-10 flex items-center justify-center text-xs font-medium",table:"w-full border-collapse px-1",tbody:"w-full",row:"flex justify-around mb-px",day:"w-10 h-10 flex items-center justify-center rounded-full text-sm hover:bg-[--purple-primary] cursor-pointer",day_selected:"bg-[--purple-primary] !text-black font-semibold rounded-full focus:bg-[--purple-primary]",day_today:"text-[--purple-primary] border border-[--purple-primary] rounded-full",day_disabled:"text-gray-400 line-through !bg-transparent cursor-not-allowed hover:!bg-transparent",day_range_middle:"rounded-full aria-selected:bg-[--purple-primary]/40 aria-selected:text-black",day_outside:"text-gray-400",day_hidden:"invisible"},selected:D,onSelect:e=>{E(t=>{let a;if(a=t&&t.from&&t.to&&e?e.from&&e.from.getTime()!==t.from.getTime()?{from:e.from,to:void 0}:e.to&&e.to.getTime()!==t.to.getTime()?{from:e.to,to:void 0}:e:e){if(a.from){let e=a.from.getFullYear(),t=String(a.from.getMonth()+1).padStart(2,"0"),s=String(a.from.getDate()).padStart(2,"0");F("start_date","".concat(e,"-").concat(t,"-").concat(s))}if(a.to){let e=a.to.getFullYear(),t=String(a.to.getMonth()+1).padStart(2,"0"),s=String(a.to.getDate()).padStart(2,"0");F("end_date","".concat(e,"-").concat(t,"-").concat(s))}}else F("start_date",""),F("end_date","");return a})},fromDate:new Date,modifiers:{startOnly:e=>!!((null==D?void 0:D.from)&&!(null==D?void 0:D.to)&&e.getTime()===D.from.getTime())},modifiersClassNames:{startOnly:"bg-yellow-400 text-black font-semibold rounded-full"}})]}),R=e=>{var t,a,r,l;let i="w-full p-3 h-12 border border-gray-300 rounded-xl shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition",n=d[e.name]||e.value||"";switch(e.type){case"text":return(0,s.jsx)(v.I,{type:"text",className:"".concat(i," h- text-black dark:text-white"),placeholder:e.placeholder,value:n,onChange:t=>F(e.name,t.target.value)});case"number":if("adult_count"===e.name||"child_count"===e.name)return(0,s.jsxs)("div",{className:"space-y-6",children:[L(e),"child_count"===e.name&&q()]});if("number_of_days"===e.name)return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("span",{className:"text-sm text-gray-500",children:[e.min||0," days"]}),(0,s.jsxs)("span",{className:"text-lg font-semibold ",children:[n||e.min||1," days"]}),(0,s.jsxs)("span",{className:"text-sm text-gray-500",children:[e.max||30," days"]})]}),(0,s.jsx)(j.i,{value:[n||e.min||1],onValueChange:t=>
1F(e.name,t[0]),max:e.max||30,min:e.min||1,step:1,className:"w-full bg-gray-500",thumbClassName:"bg-[--purple-primary] border-black size-6 border-3",rangeClassName:"bg-[--purple-primary]"})]});return(0,s.jsx)(v.I,{type:"number",className:"".concat(i," text-black dark:text-white"),min:e.min,max:e.max,value:n,onChange:t=>F(e.name,+t.target.value)});case"select":if(("budget"===e.name||"pace"===e.name)&&e.options){let t=n||(null===(a=e.options[1])||void 0===a?void 0:a.value)||"",l=e.options.findIndex(e=>e.value===t),i=l>=0?l:0;return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)("div",{className:"mx-auto flex items-center justify-center",children:(0,s.jsx)("span",{className:"text-center text-lg font-semibold",children:null===(r=e.options[i])||void 0===r?void 0:r.label})}),(0,s.jsx)(j.i,{value:[i],onValueChange:t=>{var a;let s=null===(a=e.options)||void 0===a?void 0:a[t[0]];s&&F(e.name,s.value)},max:e.options.length-1,min:0,step:1,className:"w-full bg-gray-500",thumbClassName:"bg-[--purple-primary] border-black size-6 border-3",rangeClassName:"bg-[--purple-primary]"}),(0,s.jsx)("div",{className:"flex justify-between px-1 text-xs text-gray-400",children:e.options.map((e,t)=>(0,s.jsx)("span",{className:t===i?"font-bold":"",children:e.label},e.value))})]})}return(0,s.jsxs)("select",{className:i,value:n,onChange:t=>F(e.name,t.target.value),children:[(0,s.jsx)("option",{value:"",children:"Select an option"}),null===(t=e.options)||void 0===t?void 0:t.map(e=>(0,s.jsx)("option",{value:e.value,children:e.label},e.value))]});case"multi-select":return(0,s.jsx)("div",{className:"max-h-48 space-y-2 overflow-y-auto",children:null===(l=e.options)||void 0===l?void 0:l.map(t=>(0,s.jsxs)("label",{className:"flex items-center space-x-2",children:[(0,s.jsx)("input",{type:"checkbox",className:"form-checkbox rounded text-[--secondary] focus:text-[--secondary]",checked:(n||[]).includes(t.value),onChange:a=>{let s=n||[],r=a.target.checked?[...s,t.value]:s.filter(e=>e!==t.value);F(e.name,r)}}),(0,s.jsx)("span",{className:"",children:t.label})]},t.value))});case"date-range":return Z();default:return null}},P=A===((null==T?void 0:T.length)||0)-1;return(0,s.jsxs)("div",{className:"mx-auto max-w-2xl bg-transparent p-6 text-[--primary-text]",children:[(0,s.jsx)("h2",{className:"mb-1 text-2xl font-semibold",children:a}),(0,s.jsx)("p",{className:"mb-6 text-sm",children:l}),(0,s.jsx)("div",{className:"mb-6 space-y-4",children:null==T?void 0:T.map(e=>(0,s.jsx)("div",{className:" rounded-lg p-4",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("div",{className:"flex-1",children:(0,s.jsxs)("label",{className:"mb-1 block text-sm font-medium",children:[e.label,e.required&&(0,s.jsx)("span",{className:"ml-1 text-red-500",children:"*"})]})}),(0,s.jsx)("div",{className:"flex items-center space-x-2",children:(0,s.jsx)("button",{className:"rounded-full p-2 text-gray-400 transition-colors hover:bg-blue-50 hover:text-blue-600",onClick:()=>{C(e.name),k(!0)},children:(0,s.jsx)(p.Z,{size:16})})})]})},e.name))}),(0,s.jsx)(g.dy,{modal:!1,open:N,onOpenChange:k,dismissible:!1,children:(0,s.jsxs)(g.sc,{className:"mx-auto h-[70%] w-screen bg-[--background] text-[--primary-text] focus:outline-none md:w-[28rem]",children:[(0,s.jsx)("div",{className:"mt-4 overflow-y-auto px-4 pb-4",children:(0,s.jsxs)(_.Tabs,{value:w,onValueChange:e=>{C(e),z((null==T?void 0:T.findIndex(t=>t.name===e))||0)},className:"w-full",children:[(0,s.jsxs)(b.ScrollArea,{className:"w-screen whitespace-nowrap rounded-md md:w-[28rem]",children:[(0,s.jsx)(_.TabsList,{className:"mb-6 flex w-max flex-row gap-3 px-4 pr-6",style:{gridTemplateColumns:"repeat(".concat((null==i?void 0:i.length)||1,", 1fr)")},children:null==T?void 0:T.map(e=>(0,s.jsx)(_.TabsTrigger,{value:e.name,className:"relative rounded-xl border border-[--secondary] bg-[--background] px-4 py-2 text-xs text-black data-[state=active]:bg-[--secondary] data-[state=active]:text-black dark:text-[--secondary] dark:data-[state=active]:text-black",children:e.label},e.name))}),(0,s.jsx)(b.ScrollBar,{orientation:"horizontal",className:"my-3"})]}),null==T?void 0:T.map(e=>(0,s.jsx)(_.TabsContent,{value:e.name,className:"mt-0",children:(0,s.jsxs)("div",{className:"space-y-4 text-[--primary-text]",children:[(0,s.jsxs)("div",{className:"mx-auto flex flex-col items-center justify-center",children:[(0,s.jsx)("p",{className:"mb-2 text-base font-normal opacity-50",children:e.label}),(null==e?void 0:e.placeholder)&&(0,s.jsx)("p",{className:"mb-4 text-sm text-gray-500",children:null==e?void 0:e.placeholder})]}),(0,s.jsx)("div",{className:"min-h-[120px]",children:R(e)})]})},e.name))]})}),(0,s.jsxs)(g.ze,{className:"flex flex-row space-x-2",children:[0===A?(0,s.jsxs)("button",{onClick:()=>{let e={...d};
1i.forEach(t=>{if(void 0===e[t.name]||null===e[t.name]||""===e[t.name]){if("destination_city"===t.name)e[t.name]="Goa";else if("multi-select"===t.type)e[t.name]=[];else if("number"===t.type){var a;e[t.name]="adult_count"===t.name?2:null!==(a=t.min)&&void 0!==a?a:0}else e[t.name]=""}}),n(e),k(!1)},className:"text flex flex-1 items-center justify-center space-x-2 rounded-2xl bg-red-600 px-8 py-3 text-base font-normal text-white transition-colors",children:[(0,s.jsx)(x.Z,{size:16}),(0,s.jsx)("p",{children:"Skip"})]}):(0,s.jsx)("button",{onClick:()=>{if(A>0){var e;let t=A-1;z(t),C((null==T?void 0:null===(e=T[t])||void 0===e?void 0:e.name)||"")}},className:"flex flex-1 items-center justify-center space-x-2 rounded-2xl border border-[--secondary] px-8 py-3 text-base font-normal text-black transition-colors hover:bg-[--secondary] hover:text-black dark:text-[--secondary] dark:hover:text-black",children:(0,s.jsx)("span",{children:"â Prev"})}),P?(0,s.jsxs)("button",{onClick:()=>{let e={...d};i.forEach(t=>{if(void 0===e[t.name]||null===e[t.name]||""===e[t.name]){if("destination_city"===t.name)e[t.name]="Goa";else if("multi-select"===t.type)e[t.name]=[];else if("number"===t.type){var a;e[t.name]="adult_count"===t.name?2:null!==(a=t.min)&&void 0!==a?a:0}else e[t.name]=""}}),n(e),k(!1)},disabled:o,className:"flex flex-1 items-center justify-center space-x-2 rounded-2xl bg-[--secondary] px-8 py-3 text-base font-normal text-black transition-colors ".concat(o&&" cursor-not-allowed "),children:[(0,s.jsx)(h.Z,{size:16}),(0,s.jsx)("span",{children:o?"Submitting...":"Confirm"})]}):(0,s.jsx)("button",{onClick:()=>{if(A<((null==T?void 0:T.length)||0)-1){var e;let t=A+1;z(t),C((null==T?void 0:null===(e=T[t])||void 0===e?void 0:e.name)||"")}},className:"flex flex-1 items-center justify-center space-x-2 rounded-2xl border border-[--secondary] px-8 py-3 text-base font-normal text-black transition-colors hover:bg-[--secondary] hover:text-black dark:text-[--secondary] dark:hover:text-black",children:(0,s.jsx)("span",{children:"Next â"})})]})]})}),(0,s.jsx)("div",{className:"flex items-center justify-between border-t border-gray-200 pt-4",children:(0,s.jsx)("button",{className:"rounded-xl bg-[--secondary] px-4 py-2 text-black transition-colors",onClick:()=>k(!0),children:"Edit Details"})})]})}var k=a(92451),w=a(10407),C=a(4216),A=a(62869),z=a(94508);let S=["Su","Mo","Tu","We","Th","Fr","Sa"],D=["January","February","March","April","May","June","July","August","September","October","November","December"];function E(e){let{open:t,onOpenChange:a,value:l,onChange:i,title:n="Choose dates",fixedDurationDays:o}=e,[d,c]=(0,r.useState)(()=>{let e=l.start||new Date;return new Date(e.getFullYear(),e.getMonth(),1)}),[m,u]=(0,r.useState)("start"),[p,x]=(0,r.useState)(l);(0,r.useEffect)(()=>{x(l),l.start&&c(new Date(l.start.getFullYear(),l.start.getMonth(),1))},[l]);let h=e=>new Date(e.getFullYear(),e.getMonth()+1,0).getDate(),f=e=>new Date(e.getFullYear(),e.getMonth(),1).getDay(),g=e=>{if(!e)return"";let t=String(e.getDate()).padStart(2,"0"),a=String(e.getMonth()+1).padStart(2,"0"),s=String(e.getFullYear()).slice(-2);return"".concat(t,"/").concat(a,"/").concat(s)},v=e=>!!p.start&&!!p.end&&e>=p.start&&e<=p.end,b=e=>!!p.start&&e.toDateString()===p.start.toDateString()||!!p.end&&e.toDateString()===p.end.toDateString(),y=e=>p.start&&e.toDateString()===p.start.toDateString(),j=e=>p.end&&e.toDateString()===p.end.toDateString(),_=e=>{if(!e)return null;let t=new Date(e);return t.setDate(t.getDate()+Math.max((null!=o?o:0)-1,0)),t},N=()=>void 0!==o?!!p.start:!!p.start&&!!p.end&&p.start.toDateString()!==p.end.toDateString(),E=e=>{let t=new Date;if(t.setHours(0,0,0,0),!(e<t)){if(void 0!==o){x({start:e,end:_(e)}),u("start");return}if("start"===m)x({start:e,end:null}),u("end");else{if(p.start&&e.toDateString()===p.start.toDateString())return;p.start&&e<p.start?x({start:e,end:p.start}):x(t=>({...t,end:e})),u("start")}}},M=e=>void 0===o&&"end"===m&&!!p.start&&e.toDateString()===p.start.toDateString();return(0,s.jsx)(C.d.Root,{open:t,onOpenChange:e=>{(e||N())&&a(e)},dismissible:N(),children:(0,s.jsxs)(C.d.Portal,{children:[(0,s.jsx)(C.d.Overlay,{className:"fixed inset-0 z-[600] bg-black/80"}),(0,s.jsxs)(C.d.Content,{className:"fixed inset-x-0 bottom-0 z-[600] mx-auto mt-24 flex h-auto max-w-lg flex-col rounded-t-[10px] border bg-background",onPointerDownOutside:e=>{N()||e.preventDefault()},onInteractOutside:e=>{N()||e.preventDefault()},onEscapeKeyDown:e=>{N()||e.preventDefault()},children:[(0,s.jsx)("div",{className:"mx-auto mt-4 h-1 w-[30px] rounded-full bg-border"}),(0,s.jsxs)("div",{className:"flex flex-row items-center gap-2 p-4 pb-0",children:[(0,s.jsx)(A.z,{variant:"transparent",size:"icon",className:"size-8 text-primary-text",onClick:()=>{N()&&a(!1)},disabled:!N(),children:(0,s.jsx)(k.Z,{className:"size-5"})}),(0,s.jsx)(C.d.Title,{className:"text-lg font-semibold text-primary-text",children:n})]}),(0,s.jsxs)("div",{className:"p-4 pt-2",children:[(0,s.jsxs)("div",{className:"mb-6 flex overflow-hidden rounded-xl border border-[--purple-primary]",children:[(0,s.jsxs)("div",{className:(0,z.cn)("flex-1 cursor-pointer px-4 py-3 transition-colors","start"===m&&"bg-[--purple-primary]/10"),onClick:()=>void 0===o&&u("start"),children:[(0,s.jsx)("p",{className:"text-xs text-primary-text",children:"Start"}),(0,s.jsx)("p",{className:"text-sm font-medium text-primary-text",children:g(p.start)||"Select date"})]}),(0,s.jsx)("div",{className:"bg-[--purple-primary]/30 w-px"}),(0,s.jsxs)("div",{className:(0,z.cn)("flex-1 cursor-pointer px-4 py-3 transition-colors","end"===m&&"bg-[--purple-primary]/10"),onClick:()=>void 0===o&&u("end"),children:[(0,s.jsx)("p",{className:"text-xs text-primary-text",children:"End"}),(0,s.jsx)("p",{className:"text-sm font-medium text-primary-text",children:g(p.end)||"Select date"})]})]}),(0,s.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,s.jsx)(A.z,{variant:"ghost",size:"icon",onClick:()=>{c(e=>new Date(e.getFullYear(),e.getMonth()-1,1))},className:"rounded-full border border-[--purple-primary] text-[--purple-primary]",children:(0,s.jsx)(k.Z,{className:"size-4"})}),(0,s.jsxs)("h3",{className:"text-lg font-semibold text-primary-text",children:[D[d.getMonth()]," ",d.getFullYear()]}),(0,s.jsx)(A.z,{variant:"ghost",size:"icon",onClick:()=>{c(e=>
1new Date(e.getFullYear(),e.getMonth()+1,1))},className:"rounded-full border border-[--purple-primary] bg-[--purple-primary] text-black hover:opacity-90",children:(0,s.jsx)(w.Z,{className:"size-4"})})]}),(0,s.jsx)("div",{className:"mb-2 grid grid-cols-7 gap-1",children:S.map(e=>(0,s.jsx)("div",{className:"flex size-10 items-center justify-center text-xs font-medium text-primary-text",children:e},e))}),(0,s.jsx)("div",{className:"grid grid-cols-7 gap-1",children:(()=>{let e=h(d),t=f(d),a=new Date;a.setHours(0,0,0,0);let r=[];for(let e=0;e<t;e++)r.push((0,s.jsx)("div",{className:"size-10"},"empty-".concat(e)));for(let t=1;t<=e;t++){let e=new Date(d.getFullYear(),d.getMonth(),t),l=e<a,i=b(e),n=v(e),o=y(e),c=j(e),m=M(e),u=l||m;r.push((0,s.jsx)("button",{type:"button",disabled:u,onClick:()=>E(e),className:(0,z.cn)("relative flex size-10 items-center justify-center rounded-full text-sm transition-colors",l&&"cursor-not-allowed line-through text-gray-300 dark:text-gray-600",m&&!l&&"cursor-not-allowed opacity-80 text-gray-400 dark:text-gray-500",!u&&!i&&!n&&"text-primary-text hover:bg-muted",n&&!i&&"bg-[--purple-primary] text-black",i&&"bg-[--purple-primary] font-medium text-black",o&&n&&"rounded-full",c&&n&&"rounded-full"),children:t},t))}return r})()}),(0,s.jsx)(A.z,{onClick:()=>{p.start&&p.end&&i({start:p.start,end:p.end}),a(!1)},disabled:!N(),className:"mt-6 w-full rounded-full bg-[--purple-primary] py-6 text-black hover:opacity-90",children:"Confirm"})]})]})]})})}let M=[{value:"jan",label:"Jan"},{value:"feb",label:"Feb"},{value:"mar",label:"Mar"},{value:"apr",label:"Apr"},{value:"may",label:"May"},{value:"jun",label:"Jun"},{value:"jul",label:"Jul"},{value:"aug",label:"Aug"},{value:"sep",label:"Sep"},{value:"oct",label:"Oct"},{value:"nov",label:"Nov"},{value:"dec",label:"Dec"}],T=[{value:"weekend",label:"Weekend (2-3 days)"},{value:"short",label:"Short trip (4-6 days)"},{value:"long",label:"Long trip (7-10 days)"}],I=[{value:"any",label:"Any"},{value:"avoid_peak",label:"Avoid peak season"},{value:"best_weather",label:"Best weather"}];function F(e){let{open:t,onOpenChange:a,value:l,onChange:i,title:n="Select preferences"}=e,[o,d]=(0,r.useState)(l),c=e=>{d(t=>{let a=t.preferredMonths||[],s=a.includes(e)?a.filter(t=>t!==e):[...a,e];return{...t,preferredMonths:s}})},m=e=>{d(t=>({...t,tripLength:e}))},u=e=>{d(t=>({...t,seasonPreference:e}))};return(0,s.jsx)(C.d.Root,{open:t,onOpenChange:a,children:(0,s.jsxs)(C.d.Portal,{children:[(0,s.jsx)(C.d.Overlay,{className:"fixed inset-0 z-[600] bg-black/80"}),(0,s.jsxs)(C.d.Content,{className:"fixed inset-x-0 bottom-0 z-[600] mx-auto mt-24 flex h-auto max-h-[85vh] max-w-lg flex-col rounded-t-[10px] border bg-background",children:[(0,s.jsx)("div",{className:"mx-auto mt-4 h-1 w-[30px] rounded-full bg-border"}),(0,s.jsxs)("div",{className:"flex flex-row items-center gap-2 p-4 pb-0",children:[(0,s.jsx)(A.z,{variant:"transparent",size:"icon",className:"size-8 text-primary-text",onClick:()=>a(!1),children:(0,s.jsx)(k.Z,{className:"size-5"})}),(0,s.jsx)(C.d.Title,{className:"text-lg font-semibold text-primary-text",children:n})]}),(0,s.jsxs)("div",{className:"flex-1 space-y-6 overflow-y-auto p-4",children:[(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("p",{className:"font-medium text-primary-text",children:"Preferred month(s)"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:M.map(e=>{var t;let a=null===(t=o.preferredMonths)||void 0===t?void 0:t.includes(e.value);return(0,s.jsx)("button",{type:"button",onClick:()=>c(e.value),className:(0,z.cn)("inline-flex items-center gap-2 rounded-full border px-4 py-2 text-sm font-medium transition-all",a?"border-[--purple-primary] bg-[--purple-primary] text-white hover:bg-[--purple-primary]/90":"border-border bg-card text-primary-text hover:border-[--purple-primary]/50"),children:e.label},e.value)})})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("p",{className:"font-medium text-primary-text",children:"Trip length"}),(0,s.jsx)("div",{className:"space-y-2",children:T.map(e=>{let t=o.tripLength===e.value;return(0,s.jsxs)("button",{type:"button",onClick:()=>m(e.value),className:(0,z.cn)("flex w-full items-center justify-between rounded-xl border-2 p-4 text-left font-medium transition-all",t?"border-[--purple-primary] bg-[--purple-primary] text-white hover:bg-[--purple-primary]/90":"border-border bg-card text-primary-text hover:border-[--purple-primary]/50"),children:[(0,s.jsx)("span",{className:(0,z.cn)("font-medium",t?"text-white":"text-primary-text"),children:e.label}),(0,s.jsx)("div",{className:(0,z.cn)("flex size-6 items-center justify-center rounded-full border-2 transition-colors",t?"bg-white border-0":"border-black dark:border-white"),children:t&&(0,s.jsx)(h.Z,{className:"size-4 text-purple-primary"})})]},e.value)})})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("p",{className:"font-medium text-primary-text",children:"Season preference"}),(0,s.jsx)("div",{className:"space-y-2",children:I.map(e=>
1{let t=o.seasonPreference===e.value;return(0,s.jsxs)("button",{type:"button",onClick:()=>u(e.value),className:(0,z.cn)("flex w-full items-center justify-between rounded-xl border-2 p-4 text-left font-medium transition-all",t?"border-[--purple-primary] bg-[--purple-primary] text-white hover:bg-[--purple-primary]/90":"border-border bg-card text-primary-text hover:border-[--purple-primary]/50"),children:[(0,s.jsx)("span",{className:(0,z.cn)("font-medium",t?"text-white":"text-primary-text"),children:e.label}),(0,s.jsx)("div",{className:(0,z.cn)("flex size-6 items-center justify-center rounded-full border-2 transition-colors",t?"bg-white border-0":"border-black dark:border-white"),children:t&&(0,s.jsx)(h.Z,{className:"size-4 text-purple-primary"})})]},e.value)})})]}),(0,s.jsx)(A.z,{onClick:()=>{i(o),a(!1)},className:"w-full rounded-full bg-[--purple-primary] py-6 text-black hover:opacity-90",children:"Confirm"})]})]})]})})}var O=a(42820),L=a(82023),q=a(68575),Z=a(70268),R=a(67064),P=a(66774),B=a(10795),Y=a(84314),K=a(93662),W=a(92850),V=a(5095),J=a(20879),Q=a(33145),U=a(47062),G=a(14438),H=a(50856),$=a(35974),X=a(26110),ee=a(32759),et=a(73247);function ea(e){let{open:t,onOpenChange:a,title:l,placeholder:i="Search...",query:n,onQueryChange:o,results:d,isLoading:c,onSelect:m,renderItem:u,emptyMessage:p="No results found"}=e,h=(0,r.useRef)(null);return(0,r.useEffect)(()=>{t&&setTimeout(()=>{var e;null===(e=h.current)||void 0===e||e.focus()},100)},[t]),(0,s.jsx)(C.d.Root,{open:t,onOpenChange:a,children:(0,s.jsxs)(C.d.Portal,{children:[(0,s.jsx)(C.d.Overlay,{className:"fixed inset-0 z-[800] bg-black/40"}),(0,s.jsxs)(C.d.Content,{className:"fixed inset-x-0 bottom-0 z-[800] mx-auto mt-24 flex h-[85vh] max-h-[85vh] max-w-lg flex-col rounded-t-[10px] border bg-background outline-none",children:[(0,s.jsx)("div",{className:"mx-auto mt-4 h-1 w-[30px] rounded-full bg-border"}),(0,s.jsxs)("div",{className:"relative flex items-center justify-center border-b p-4",children:[(0,s.jsx)("button",{onClick:()=>a(!1),className:"absolute left-4 rounded-full p-1 transition-colors hover:bg-muted",children:(0,s.jsx)(k.Z,{className:"size-6 text-primary-text"})}),(0,s.jsx)(C.d.Title,{className:"text-lg font-semibold text-primary-text",children:l})]}),(0,s.jsxs)("div",{className:"flex h-full flex-col overflow-hidden p-4",children:[(0,s.jsxs)("div",{className:"relative mb-4",children:[(0,s.jsx)(et.Z,{className:"absolute left-3 top-1/2 size-4 -translate-y-1/2 text-primary-text"}),(0,s.jsx)(v.I,{ref:h,value:n,onChange:e=>o(e.target.value),placeholder:i,className:"border-muted-foreground/20 bg-muted/30 pl-9 text-primary-text"}),n.length>0&&(0,s.jsx)("button",{onClick:()=>o(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-primary-text hover:text-foreground",children:(0,s.jsx)(x.Z,{className:"size-4"})})]}),(0,s.jsx)("div",{className:"-mx-4 flex-1 overflow-y-auto px-4 pb-8",children:c?(0,s.jsx)("div",{className:"py-8 text-center text-sm text-primary-text",children:"Searching..."}):d.length>0?(0,s.jsx)("div",{className:"space-y-1",children:d.map((e,t)=>(0,s.jsx)("div",{onClick:()=>{m(e),a(!1)},className:"cursor-pointer rounded-lg p-3 transition-colors hover:bg-muted/50",children:u(e)},t))}):n.length>0?(0,s.jsx)("div",{className:"py-8 text-center text-sm text-primary-text opacity-60",children:p}):null})]})]})]})})}function es(e){let{open:t,onOpenChange:a,value:l,onChange:i,title:n="How many travelers?",showKids:o=!0}=e,[d,c]=(0,r.useState)(l);(0,r.useEffect)(()=>{t&&c(o?l:{...l,kids:0,kidAges:[]})},[t,l,o]);let p=e=>{c(t=>({...t,adults:Math.max(1,Math.min(10,t.adults+e))}))},x=e=>{let t=Math.max(0,Math.min(6,d.kids+e)),a=[...d.kidAges];t>d.kids?a.push(5):t<d.kids&&(a=a.slice(0,t)),c(e=>({...e,kids:t,kidAges:a}))},h=(e,t)=>{c(a=>{let s=[...a.kidAges];return s[e]=Math.max(0,Math.min(12,s[e]+t)),{...a,kidAges:s}})};return(0,s.jsx)(C.d.Root,{open:t,onOpenChange:a,children:(0,s.jsxs)(C.d.Portal,{children:[(0,s.jsx)(C.d.Overlay,{className:"fixed inset-0 z-[600] bg-black/80"}),(0,s.jsxs)(C.d.Content,{className:"fixed inset-x-0 bottom-0 z-[600] mx-auto mt-24 flex h-auto max-w-lg flex-col rounded-t-[10px] border bg-background",children:[(0,s.jsx)("div",{className:"mx-auto mt-4 h-1 w-[30px] rounded-full bg-border"}),(0,s.jsxs)("div",{className:"flex flex-row items-center gap-2 p-4 pb-0",children:[(0,s.jsx)(A.z,{variant:"ghost",size:"icon",className:"size-8 text-primary-text",onClick:()=>a(!1),children:(0,s.jsx)(k.Z,{className:"size-5"})}),(0,s.jsx)(C.d.Title,{className:"text-lg font-semibold text-primary-text",children:n})]}),(0,s.jsxs)("div",{className:"space-y-6 p-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between rounded-xl bg-muted/50 p-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"font-medium text-primary-text",children:"Adults"}),(0,s.jsx)("p",{className:"text-sm text-primary-text opacity-50",children:"Ages 18+"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)(A.z,{variant:"outline",size:"icon",className:"size-10 rounded-full border-[--purple-primary] bg-[--purple-primary]",onClick:()=>p(-1),disabled:d.adults<=1,children:(0,s.jsx)(m.Z,{className:"size-4"})}),(0,s.jsx)("span",{className:"w-8 text-center text-lg font-semibold text-primary-text",children:d.adults}),(0,s.jsx)(A.z,{variant:"outline",size:"icon",className:"hover:bg-[--purple-primary]/90 size-10 rounded-full border-[--purple-primary] bg-[--purple-primary] text-black",onClick:()=>p(1),disabled:d.adults>=10,children:(0,s.jsx)(u.Z,{className:"size-4"})})]})]}),o&&(0,s.jsxs)("div",{className:"flex items-center justify-between rounded-xl bg-muted/50 p-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"font-medium text-primary-text",children:"Kids"}),(0,s.jsx)("p",{className:"text-sm text-primary-text opacity-50",children:"Ages 0-12"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)(A.z,{variant:"outline",size:"icon",className:"size-10 rounded-full border-[--purple-primary] bg-[--purple-primary]",onClick:()=>x(-1),disabled:d.kids<=0,children:(0,s.jsx)(m.Z,{className:"size-4"})}),(0,s.jsx)("span",{className:"w-8 text-center text-lg font-semibold text-primary-text",children:d.kids}),(0,s.jsx)(A.z,{variant:"outline",size:"icon",className:"hover:bg-[--purple-primary]/90 size-10 rounded-full border-[--purple-primary] bg-[--purple-primary] text-black",onClick:()=>x(1),disabled:d.kids>=6,children:(0,s.jsx)(u.Z,{className:"size-4"})})]})]}),o&&d.kids>0&&(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-primary-text",children:"Kids' Ages"}),d.kidAges.map((e,t)=>(0,s.jsxs)("div",{className:"flex items-center justify-between rounded-xl bg-muted/30 p-3",children:[(0,s.jsxs)("p",{className:"text-sm text-primary-text",children:["Child ",t+1]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(A.z,{variant:"outline",size:"icon",className:"size-8 rounded-full border-[--purple-primary] bg-[--purple-primary]",onClick:()=>h(t,-1),disabled:e<=0,children:(0,s.jsx)(m.Z,{className:"size-3"})}),(0,s.jsxs)("span",{className:"w-8 text-center text-sm font-medium text-primary-text",children:[e," yrs"]}),(0,s.jsx)(A.z,{variant:"outline",size:"icon",className:"size-8 rounded-full border-[--purple-primary] bg-[--purple-primary]",onClick:()=>h(t,1),disabled:e>=12,children:(0,s.jsx)(u.Z,{className:"size-3"})})]})]},t))]}),(0,s.jsx)(A.z,{onClick:()=>{i(d),a(!1)},className:"hover:bg-[--purple-primary]/90 w-full rounded-full bg-[--purple-primary] py-6 text-black",children:"Confirm"})]})]})]})})}var er=a(59892),el=a(41905),ei=a(4987),en=a(22953),eo=a(19060);function ed(e){let{destination:t,index:a,onPOIChange:l,onDeselectAll:i,onNumberOfDaysChange:o,onAddPOI:d,onHotelRequiredChange:c,onDelete:m,canDelete:u}=e,{attributes:p,listeners:h,setNodeRef:f,setActivatorNodeRef:g,transform:v,transition:b,isDragging:j}=(0,K.nB)({id:t.order,data:{type:"destination",destination:t}}),_={transform:er.ux.Transform.toString(v),transition:b,opacity:j?.5:1,touchAction:j?"none":"auto"},[N,k]=(0,r.useState)(""),[w,C]=(0,r.useState)(""),S=(0,n.MM)("place-search");(0,r.useEffect)(()=>{let e=setTimeout(()=>{C(N)},300);return()=>clearTimeout(e)},[N]);let{data:D=[],isLoading:E}=(0,W.a)({queryKey:["poi-search",w,t.city],queryFn:async()=>await (0,ei.fo)(w,t.city),enabled:w.length>0&&!!t.city,staleTime:3e5}),M=(0,r.useMemo)(()=>t.preselected_pois.map(e=>{var t,a,s,r,l,i,n,o,d,c,m,u;let p=e.place_data||{},x=null===(t=p.photos)||void 0===t?void 0:t[0];return{...e,is_preselected:null!==(a=e.is_preselected)&&void 0!==a?a:"USER_ADDED_MANUAL"!==e.source,google_place_id:null!==(s=e.google_place_id)&&void 0!==s?s:e.place_id,thumbnail:null!==(l=null!==(r=e.thumbnail)&&void 0!==r?r:null==x?void 0:x.photo_reference)&&void 0!==l?l:null,rating:null!==(n=null!==(i=e.rating)&&void 0!==i?i:p.rating)&&void 0!==n?n:void 0,review_count:null!==(c=null!==(d=null!==(o=e.review_count)&&void 0!==o?o:p.review_count)&&void 0!==d?d:p.user_ratings_total)&&void 0!==c?c:void 0,user_notes:null!==(m=e.user_notes)&&void 0!==m?m:void 0,source_url:null!==(u=e.source_url)&&void 0!==u?u:void 0}}),[t.preselected_pois]),T=(0,r.useMemo)(()=>D.filter(e=>!t.preselected_pois.some(t=>t.google_place_id===e.google_place_id)).slice(0,5).map(e=>{var t,a,s,r,l;return{name:e.name,description:e.description||e.address,google_place_id:e.google_place_id,thumbnail:(null===(s=e.google_place_data)||void 0===s?void 0:null===(a=s.photos)||void 0===a?void 0:null===(t=a[0])||void 0===t?void 0:t.photo_reference)||null,source_url:null,user_notes:null,category:e.category,rating:null===(r=e.google_place_data)||void 0===r?void 0:r.rating,review_count:null===(l=e.google_place_data)||void 0===l?void 0:l.review_count,address:e.address,place_data:e.google_place_data,item_type:e.item_type}}),[t.preselected_pois,D]),I=M.length>0&&M.every(e=>"SELECTED"===e.status);return(0,s.jsxs)("section",{ref:f,style:_,className:(0,z.cn)("sortable-item relative space-y-4 rounded-xl border bg-transparent p-4",j&&"opacity-75"),children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("button",{ref:g,...p,...h,"aria-label":"Drag to reorder destination",className:"text-muted-foreground",style:{touchAction:"none"},children:(0,s.jsx)(el.Z,{className:"size-5 text-gray-500 dark:text-[--muted-foreground]"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs uppercase text-primary-text opacity-60",children:"Destination"}),(0,s.jsxs)("h3",{className:"text-base font-medium text-primary-text",children:[t.city,t.country?", ".concat(t.country):""]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("p",{className:"pl-2 text-xs uppercase text-primary-text opacity-60",children:"Duration"}),(0,s.jsxs)(y.Ph,{value:t.number_of_days.toString(),onValueChange:e=>o(a,parseInt(e,10)),children:[(0,s.jsx)(y.i4,{className:"w-[110px] border-none text-primary-text shadow-none outline-none",children:(0,s.jsx)(y.ki,{placeholder:"Days"})}),(0,s.jsx)(y.Bw,{className:"z-[500] border-2 border-[--border] bg-gray-200 text-primary-text dark:bg-background",children:[...Array(10)].map((e,t)=>(0,s.jsxs)(y.Ql,{value:(t+1).toString(),children:[t+1," ",0===t?"Day":"Days"]},t+1))})]})]}),u&&(0,s.jsx)(x.Z,{className:"size-6 cursor-pointer rounded-full bg-gray-300 p-1 text-black dark:bg-[--muted-foreground]",onClick:()=>m(a)})]})]}),M.length>0?(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between pr-3",children:[(0,s.jsx)("p",{className:"text-base font-normal text-primary-text",children:"Points of Interest"}),(0,s.jsx)(eo.X,{checked:I,onClick:()=>i(a),"aria-label":"Toggle all POIs",className:"size-5 rounded-full border-2 border-[--primary-text] data-[state=checked]:border-[--purple-primary] data-[state=checked]:bg-transparent data-[state=checked]:text-[--purple-primary]"})]}),(0,s.jsx)("div",{className:"grid gap-2",children:M.map((e,t)=>(0,s.jsx)(en.Z,{poi:e,onChange:e=>l(a,t,!!e)},"".concat(e.google_place_id,"-").concat(t)))})]}):(0,s.jsx)("p",{className:"text-sm text-primary-text opacity-60",children:"No POIs added yet."}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsxs)(A.z,{variant:"outline",className:"h-11 w-full justify-start bg-[--hitl-select-input] text-muted-foreground hover:bg-accent dark:border-gray-600 dark:bg-[#242424] dark:text-[#cecece]",onClick:()=>S.open(),children:[(0,s.jsx)(et.Z,{className:"mr-2 size-4"}),"Add places"]}),(0,s.jsx)(ea,{open:S.isOpen,onOpenChange:S.handleOpenChange,title:"Add places in ".concat(t.city),placeholder:"Search places...",query:N,onQueryChange:k,results:T,isLoading:E,onSelect:e=>{d(a,e),k("")},renderItem:e=>(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"font-medium text-primary-text",children:e.name}),(0,s.jsx)("p",{className:"text-xs text-primary-text opacity-60",children:e.description})]})})]}
1),(0,s.jsxs)("div",{className:"flex items-center gap-4 rounded-lg bg-muted/30 px-3 py-2",children:[(0,s.jsx)("span",{className:"text-sm font-normal text-primary-text",children:"Include hotels?"}),(0,s.jsx)(eo.X,{checked:t.is_hotel_required,onCheckedChange:e=>c(a,!!e),"aria-label":"Include hotels toggle",className:"size-5 rounded-full border-2 border-[--primary-text] data-[state=checked]:border-[--purple-primary] data-[state=checked]:bg-transparent data-[state=checked]:text-[--purple-primary]"})]})]})}let ec=e=>{let{label:t,emoji:a,selected:r,onClick:l,children:i,className:n}=e;return(0,s.jsxs)("button",{type:"button",onClick:l,className:(0,z.cn)("flex w-full items-center justify-between rounded-xl border-2 p-3 text-sm transition-all",r?"border-[--purple-primary] bg-[--purple-primary] text-white hover:bg-[--purple-primary]/90":"border-border bg-[--hitl-select-input] hover:border-[--purple-primary]/50",n),children:[(0,s.jsxs)("div",{className:"text-left",children:[(0,s.jsxs)("p",{className:(0,z.cn)("font-medium",r?"text-white":"text-primary-text"),children:[a&&(0,s.jsx)("span",{className:"mr-2",children:a}),t]}),i]}),(0,s.jsx)("div",{className:(0,z.cn)("flex size-6 items-center justify-center rounded-full border-2 transition-colors",r?"bg-white border-0":"border-black dark:border-white"),children:r&&(0,s.jsx)(h.Z,{className:"size-4 text-purple-primary"})})]})},em=e=>{let{label:t,emoji:a,selected:r,onClick:l}=e;return(0,s.jsx)("button",{type:"button",onClick:l,className:(0,z.cn)("inline-flex items-center gap-2 rounded-full px-4 py-2 text-sm transition-all",r?"border-[--purple-primary] bg-[--purple-primary] text-white hover:bg-[--purple-primary]/90":"border-border bg-[--hitl-select-input] text-primary-text hover:border-[--purple-primary]/50"),children:(0,s.jsxs)("span",{className:(0,z.cn)("font-medium",r?"text-white":"text-primary-text"),children:[a&&(0,s.jsx)("span",{className:"mr-1",children:a}),t]})})},eu=e=>{let{rangeMin:t,rangeMax:a,sliderMin:r,sliderMax:l,step:i=1e3,onChange:n,suffix:o}=e,d=e=>{n(Math.min(Math.max(r,e),a),a)},c=e=>{let a=Math.max(Math.min(l,e),t);n(t,a)};return(0,s.jsxs)("div",{className:"space-y-8",children:[(0,s.jsxs)("div",{className:"px-2",children:[(0,s.jsx)(j.i,{min:r,max:l,step:i,value:[t,a],onValueChange:e=>
1{let[t,a]=e;n(t,a)},className:"w-full bg-card",rangeClassName:"bg-[--purple-primary]",thumbClassName:"border-[--purple-primary] size-5"}),(0,s.jsxs)("div",{className:"mt-2 flex justify-between text-sm text-primary-text",children:[(0,s.jsxs)("span",{children:["â¹",r.toLocaleString("en-IN")]}),(0,s.jsxs)("span",{children:["â¹",l.toLocaleString("en-IN"),"+"]})]})]}),(0,s.jsx)("div",{className:"flex flex-col gap-4",children:(0,s.jsxs)("div",{className:"flex items-end justify-between px-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs font-medium text-primary-text opacity-70",children:"Min"}),(0,s.jsxs)("div",{className:"relative w-32",children:[(0,s.jsx)("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm font-medium text-primary-text",children:"â¹"}),(0,s.jsx)(v.I,{type:"number",value:t,onChange:e=>d(""===e.target.value?r:parseInt(e.target.value)),className:"h-12 rounded-xl border-2 pl-7 pr-3 text-center text-lg font-bold text-primary-text [appearance:textfield] focus-visible:ring-[--purple-primary] focus-visible:ring-offset-0 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"})]})]}),(0,s.jsxs)("div",{className:"flex w-32 items-center justify-between",children:[(0,s.jsx)(A.z,{variant:"outline",size:"icon",className:"size-10 shrink-0 rounded-full border-2 text-primary-text",onClick:()=>d(Math.max(r,t-i)),disabled:t<=r,children:(0,s.jsx)(m.Z,{className:"size-4"})}),(0,s.jsx)(A.z,{variant:"outline",size:"icon",className:"size-10 shrink-0 rounded-full border-2 text-primary-text hover:bg-muted/50",onClick:()=>d(Math.min(a,t+i)),disabled:t>=a,children:(0,s.jsx)(u.Z,{className:"size-4"})})]})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,s.jsxs)("span",{className:"text-xs font-medium text-primary-text opacity-70",children:["Max",o?" ".concat(o):""]}),(0,s.jsxs)("div",{className:"relative w-32",children:[(0,s.jsx)("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm font-medium text-primary-text",children:"â¹"}),(0,s.jsx)(v.I,{type:"number",value:a,onChange:e=>c(""===e.target.value?l:parseInt(e.target.value)),className:"h-12 rounded-xl border-2 pl-7 pr-3 text-center text-lg font-bold text-primary-text [appearance:textfield] focus-visible:ring-[--purple-primary] focus-visible:ring-offset-0 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"}),a===l&&(0,s.jsx)(u.Z,{className:"pointer-events-none absolute right-2 top-1/2 size-3 -translate-y-1/2 font-bold text-primary-text"})]})]}),(0,s.jsxs)("div",{className:"flex w-32 items-center justify-between",children:[(0,s.jsx)(A.z,{variant:"outline",size:"icon",className:"size-10 shrink-0 rounded-full border-2 text-primary-text",onClick:()=>c(Math.max(t,a-i)),disabled:a<=t,children:(0,s.jsx)(m.Z,{className:"size-4"})}),(0,s.jsx)(A.z,{variant:"outline",size:"icon",className:"size-10 shrink-0 rounded-full border-2 text-primary-text hover:bg-muted/50",onClick:()=>c(Math.min(l,a+i)),disabled:a>=l,children:(0,s.jsx)(u.Z,{className:"size-4"})})]})]})]})})]})},ep=e=>Array.isArray(e)?e:e&&"object"==typeof e&&"categories"in e?e.categories.flatMap(e=>e&&Array.isArray(e.fields)?e.fields:[]):[],ex=(e,t)=>{let a=e?{...e}:{};if(t&&!Array.isArray(t)&&"categories"in t){let e=t.categories.find(e=>"basic_trip_info"===e.category);e&&e.fields&&!Array.isArray(e.fields)&&(a={...a,...e.fields})}return a},eh=e=>e&&0!==e.length?e.map((e,t)=>{var a;return{...e,order:e.order||t+1,number_of_days:e.number_of_days||(null==e?void 0:e.days)||1,is_hotel_required:null===(a=e.is_hotel_required)||void 0===a||a,preselected_pois:e.preselected_pois||[]}}):[],ef=(e,t)=>{var a,s,r;return{city:(null===(a=e.structured_formatting)||void 0===a?void 0:a.main_text)||e.description,country:(null===(r=((null===(s=e.structured_formatting)||void 0===s?void 0:s.secondary_text)||"").split(",").pop())||void 0===r?void 0:r.trim())||"",order:t,number_of_days:1,is_hotel_required:!0,preselected_pois:[],place_id:e.place_id||null}},eg=e=>Array.isArray(e)?e.map(e=>{let{is_preselected:t,status:a,selected:s,...r}=e,l=null!=s?s:"DESELECTED"!==a;return{...r,selected:l,status:null!=a?a:l?"SELECTED":"DESELECTED"}}):[],ev=e=>e.map(e=>({...e,preselected_pois:eg(e.preselected_pois)})),eb=(e,t)=>{let a=new Date(e);return a.setDate(a.getDate()+t),a},ey=(e,t)=>e?eb(e,Math.max((null!=t?t:0)-1,0)):null,ej=function(e,t){let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=[],r=!Array.isArray(e)&&"categories"in e,l=ep(e),i=new Set;a&&s.push({id:"destinations",title:"Destinations",question:"Let's figure out where you're going",fields:[],type:"destinations"});let n=!1,o=!1;if(r){let a=e.categories.find(e=>"basic_trip_info"===e.category);if(a&&a.fields&&!Array.isArray(a.fields)){o=!0;let e=a.fields;"hotel"===t?n="checkin_date"in e||"checkout_date"in e:"itinerary"===t&&(n="start_date"in e||"end_date"in e)}}if(o||(n=l.some(e=>/date|checkin|checkout|start_time|end_time|travel_flexibility|month|season|trip_length/i.test(e.name))),n&&s.push({id:"dates",title:"Travel Dates",question:"When are you planning to travel?",fields:[],type:"date"}),!r){let e=l.filter(e=>"traveler_type"===e.name);
1e.forEach(e=>i.add(e.name)),e.length>0&&s.push({id:"travelers",title:"Travel Companions",question:"Who are you travelling with?",fields:e,type:"travelers"});let a=l.filter(e=>"hotel"===t?(e.name.includes("budget")||e.name.includes("price")||e.name.includes("max_price"))&&!i.has(e.name):"budget"===e.name&&!i.has(e.name));a.forEach(e=>i.add(e.name)),a.length>0&&s.push({id:"budget",title:"Budget",question:"hotel"===t?"What's your budget per night?":"What's your overall trip budget?",fields:a,type:"budget"})}return r?(e.categories.forEach((e,t)=>{if(!e)return;let a=(Array.isArray(e.fields)?e.fields:[]).filter(e=>!i.has(e.name));a.length>0&&(a.forEach(e=>i.add(e.name)),s.push({id:"category_".concat(t,"_").concat(e.category),title:e.title||"".concat(e.category," preferences"),question:e.title,fields:a,type:"category"}))}),l.filter(e=>!i.has(e.name)).forEach(e=>{let t="multi-select"===e.type?"multi-select":"textarea"===e.type?"textarea":"single-select";s.push({id:e.name,title:e.label,question:e.label,fields:[e],type:t})})):l.forEach(e=>{if(!i.has(e.name)){let t="multi-select"===e.type?"multi-select":"textarea"===e.type?"textarea":"number"===e.type||"dual-range"===e.type?"budget":"single-select";s.push({id:e.name,title:e.label,question:e.label,fields:[e],type:t})}}),s.push({id:"review",title:"Review",question:"Review your preferences",fields:[],type:"review"}),s},e_=e=>{var t,a;let s=null!==(t=e.min)&&void 0!==t?t:0,r=null!==(a=e.max)&&void 0!==a?a:1e5,l=e.value&&"object"==typeof e.value&&"min"in e.value&&"max"in e.value,i=l?Number(e.value.min):NaN,n=l?Number(e.value.max):NaN,o=Number.isFinite(i)?i:s,d=Number.isFinite(n)?n:r;return{sliderMin:s,sliderMax:r,selectedMin:o,selectedMax:d}};function eN(e){let{open:t,onOpenChange:a,title:i,message:o,currentParameters:d,fields:c,loading:m,onSubmit:u,onSkip:p,onCancel:f,wizardType:b,tripPlanData:y}=e,j=e=>{var t;if(!e)return;let a=e;if("string"==typeof e)try{a=JSON.parse(e)}catch(t){a=e}return(null==a?void 0:null===(t=a.approval_request)||void 0===t?void 0:t.trip_plan_data)?a.approval_request.trip_plan_data:(null==a?void 0:a.trip_plan_data)?a.trip_plan_data:void 0},_=(0,r.useMemo)(()=>null!=y?y:j(o),[o,y]),N=(0,r.useMemo)(()=>{let e=ex(d,c);return _?{...e,trip_plan_data:_,destinations:_.destinations||e.destinations}:e},[d,c,_]),w=(0,r.useMemo)(()=>{var e,t,a;return!!((null==d?void 0:null===(t=d.trip_plan_data)||void 0===t?void 0:null===(e=t.destinations)||void 0===e?void 0:e.length)||(null==_?void 0:null===(a=_.destinations)||void 0===a?void 0:a.length))},[d,_]),C=(0,r.useMemo)(()=>ej(c,b,w),[c,b,w]),[S,D]=(0,r.useState)(0),[M,T]=(0,r.useState)(()=>{let e={};return ep(c).forEach(t=>{if(null!==t.value&&void 0!==t.value&&""!==t.value){if("multi-select"===t.type&&"string"==typeof t.value)e[t.name]=[t.value];else if("dual-range"===t.type){let{selectedMin:a,selectedMax:s}=e_(t);e[t.name]={value:a,min:a,max:s}}else e[t.name]=t.value}}),e}),[I,O]=(0,r.useState)(()=>{var e,t;let a=(null==d?void 0:null===(e=d.trip_plan_data)||void 0===e?void 0:e.destinations)||(null==_?void 0:_.destinations)||(null===(t=N.trip_plan_data)||void 0===t?void 0:t.destinations);return eh(Array.isArray(a)?a:[])}),L=(0,r.useMemo)(()=>I.reduce((e,t)=>e+(t.number_of_days||0),0),[I]),q=(0,r.useMemo)(()=>I.length>0&&L>0,[I.length,L]),[Z,R]=(0,r.useState)(""),[P,et]=(0,r.useState)(""),[er,el]=(0,r.useState)(null),[ei,en]=(0,r.useState)(!1),[eo,eg]=(0,r.useState)(!1),[eb,eN]=(0,r.useState)(null),[ek,ew]=(0,r.useState)(!0),eC=(0,n.MM)("date-drawer"),eA=(0,n.MM)("destination-search"),ez=(0,n.MM)("setup-wizard"),[eS,eD]=(0,r.useState)(()=>{let e=N.checkin_date||N.start_date,t=N.checkout_date||N.end_date;return{start:e?new Date(e):null,end:t?new Date(t):null}}),[eE,eM]=(0,r.useState)(()=>N.checkin_date||N.start_date?"have_dates":null);(0,r.useEffect)(()=>{let e=N.checkin_date||N.start_date,t=N.checkout_date||N.end_date;if(e){let a=new Date(e),s=q?ey(a,L):null,r=t?new Date(t):null;eD({start:a,end:s||r||a}),eM("have_dates")}},[N.checkin_date,N.checkout_date,N.start_date,N.end_date,L,q]),(0,r.useEffect)(()=>{if(!eS.start||!q)return;let e=ey(eS.start,L);e&&(eS.end&&e.toDateString()===eS.end.toDateString()||eD(t=>({...t,end:e})),T(t=>{let a=tu(eS.start),s=tu(e);return"hotel"===b?t.checkin_date===a&&t.checkout_date===s?t:{...t,checkin_date:a,checkout_date:s}:t.start_date===a&&t.end_date===s&&"fixed"===t.travel_flexibility?t:{...t,start_date:a,end_date:s,travel_flexibility:"fixed"}}))},[eS.start,eS.end,L,b,q]);let[eT,eI]=(0,r.useState)({preferredMonths:[],tripLength:"",seasonPreference:""}),[eF,eO]=(0,r.useState)(()=>
1{if("hotel"===b&&N.room_occupancies){let e=N.room_occupancies,t=e.reduce((e,t)=>e+t.adults,0)||2,a=e.flatMap(e=>e.child_ages);return{adults:t,kids:a.length,kidAges:a}}return{adults:N.adults||2,kids:N.kids||0,kidAges:N.kid_ages||[]}}),[eL,eq]=(0,r.useState)(()=>{let e=ep(c).find(e=>"dual-range"===e.type);if(e){let{selectedMin:t,selectedMax:a}=e_(e);return{min:t,max:a}}return{min:0,max:1e5}}),[eZ,eR]=(0,r.useState)(!1),[eP,eB]=(0,r.useState)(null),[eY,eK]=(0,r.useState)(!1),eW=(0,r.useRef)(null),eV=(0,r.useRef)({});(0,r.useEffect)(()=>{let e=eW.current;e&&e.scrollTo({top:0,behavior:"smooth"})},[S]);let eJ=C.length>0?(S+1)/C.length*100:100,eQ=(0,B.Dy)((0,B.VT)(B.we,{activationConstraint:{distance:8}}),(0,B.VT)(B.Lg,{coordinateGetter:K.is}),(0,B.VT)(B.LO,{activationConstraint:{distance:10,tolerance:5,delay:250}}));(0,r.useEffect)(()=>{let e=setTimeout(()=>{et(Z)},300);return()=>clearTimeout(e)},[Z]);let{data:eU=[],isLoading:eG}=(0,W.a)({queryKey:["destinations-search",P],queryFn:()=>(0,H.b8)(P),enabled:P.length>2,staleTime:3e5}),eH=(e,t)=>{O(a=>a.map((a,s)=>s===e?t(a):a))},e$=(e,t)=>null==t||("string"==typeof t?0===t.trim().length:Array.isArray(t)?0===t.length:"dual-range"!==e.type&&"composite-select"===e.type&&(!t||!t.primary)),eX=()=>{let e=C[S];if(!e||"review"===e.type)return null;for(let t of e.fields.filter(e=>e.required)){let e=M[t.name];if(e$(t,e))return t}return null},e0=e=>{let t=eW.current,a=eV.current[e];if(t&&a){t.scrollTo({top:Math.max(a.offsetTop-12,0),behavior:"smooth"});return}a&&a.scrollIntoView({behavior:"smooth",block:"start"})},e1=()=>{let e=eX();if(e){e0(e.name),G.A.error("Please answer the required question to continue.",{position:"top-center"});return}if(eZ){let e=C.findIndex(e=>"review"===e.type);if(-1!==e){D(e),eR(!1);return}}S<C.length-1&&D(e=>e+1),l.u.emit("track-event",{event_name:"site_interaction",properties:{site_section:"hitl_wizard_continue_click",type:b}})},e2=()=>{var e;if((null===(e=C[S])||void 0===e?void 0:e.type)==="review"&&null!==eP){D(eP),eB(null);return}if(eZ){let e=C.findIndex(e=>"review"===e.type);if(-1!==e){D(e),eR(!1);return}}S>0&&D(e=>e-1),l.u.emit("track-event",{event_name:"site_interaction",properties:{site_section:"hitl_wizard_back_click",type:b}})},e4=e=>{D(e)},e5=function(e,t){let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];a?T(a=>{let s=a[e]||[],r=Array.isArray(s)?s:[s],l=r.includes(t)?r.filter(e=>e!==t):[...r,t];return{...a,[e]:l}}):(T(a=>({...a,[e]:t})),s&&setTimeout(()=>{e1()},300))},e3=e=>{eM(e),"have_dates"===e?setTimeout(()=>eC.open(),0):"flexible"===e&&(T(e=>({...e,travel_flexibility:"flexible"})),setTimeout(()=>en(!0),0))},e6=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];T(t=>({...t,traveler_type:e})),eK(t),"solo"!==e.toLowerCase()&&"couple"!==e.toLowerCase()?setTimeout(()=>eg(!0),0):t&&setTimeout(()=>{e1()},300)},e8=e=>{if(eO(e),"hotel"===b){let t=[{adults:e.adults,child_ages:e.kidAges}];T(e=>({...e,room_occupancies:t}))}else T(t=>({...t,adults:e.adults,kids:e.kids,kid_ages:e.kidAges}));eY&&setTimeout(()=>{e1()},300)},e9=(e,t,a)=>{var s;eN(e);let r=!a||"children_ages"in a;ew(r);let l=null!==(s=null==t?void 0:t.adult_count)&&void 0!==s?s:2,i=null==t?void 0:t.children_ages,n=Array.isArray(i)?i:"string"==typeof i&&i.trim()?i.split(",").map(e=>parseInt(e.trim(),10)).filter(e=>!isNaN(e)):[];eO({adults:l,kids:r?n.length:0,kidAges:r?n:[]}),setTimeout(()=>eg(!0),0)},e7=e=>{O(t=>[...t,ef(e,t.length+1)]),R("")},te=e=>{O(t=>eh(t.filter((t,a)=>a!==e)))},tt=(e,t)=>{eH(e,e=>({...e,number_of_days:t}))},ta=(e,t)=>{eH(e,e=>({...e,is_hotel_required:t}))},ts=(e,t,a)=>{eH(e,e=>({...e,preselected_pois:e.preselected_pois.map((e,s)=>s===t?{...e,status:a?"SELECTED":"DESELECTED"}:e)}))},tr=(e,t)=>{eH(e,e=>({...e,preselected_pois:[...e.preselected_pois,{...t,status:"SELECTED",source:"USER_ADDED_MANUAL",user_notes:null}]}))},tl=e=>{eH(e,e=>{let t=e.preselected_pois.every(e=>"SELECTED"===e.status);return{...e,preselected_pois:e.preselected_pois.map(e=>({...e,status:t?"DESELECTED":"SELECTED"}))}})},ti=e=>{el(e.active.id)},tn=e=>{let{active:t,over:a}=e;if(!a||t.id===a.id){el(null);return}O(e=>{let s=e.findIndex(e=>e.order===t.id),r=e.findIndex(e=>e.order===a.id);return eh((0,K.Rp)(e,s,r))}),el(null)},to=()=>{el(null)},td=()=>{let e={...M};if(eS.start&&q){let t=ey(eS.start,L)||eS.end||eS.start,a=tu(eS.start),s=tu(t),r=L>0?L:1;"hotel"===b?(e.checkin_date=a,e.checkout_date=s):(e.start_date=a,e.end_date=s,e.travel_flexibility="fixed"),e.total_trip_days=r}
1return ep(c).forEach(t=>{var a,s,r,l,i,n,o,d,c,m,u,p,x,h,f;if(void 0===e[t.name]||null===e[t.name]||""===e[t.name]){if("multi-select"===t.type)e[t.name]=[];else if("dual-range"===t.type){let{selectedMin:a,selectedMax:s}=e_(t);e[t.name]={value:a,min:a,max:s}}else"composite-select"===t.type?e[t.name]=null!==(a=t.value)&&void 0!==a?a:{primary:null,adult_count:null,children_ages:""}:"textarea"===t.type?e[t.name]="":"number"===t.type?e[t.name]=null!==(r=null!==(s=t.value)&&void 0!==s?s:t.min)&&void 0!==r?r:0:e[t.name]=""}else if("multi-select"===t.type&&"string"==typeof e[t.name])e[t.name]=[e[t.name]];else if("select"===t.type&&Array.isArray(e[t.name]))e[t.name]=null!==(l=e[t.name][0])&&void 0!==l?l:"";else if("composite-select"===t.type){let a=e[t.name];a&&"object"==typeof a&&a.primary&&(e[t.name]={primary:a.primary,adult_count:null!==(i=a.adult_count)&&void 0!==i?i:null,children_ages:"string"==typeof a.children_ages?a.children_ages:Array.isArray(a.children_ages)?a.children_ages.join(", "):""})}else if("dual-range"===t.type){let a=e[t.name];"object"==typeof a&&null!==a?e[t.name]={value:null!==(c=null!==(d=null!==(o=null!==(n=a.value)&&void 0!==n?n:t.value)&&void 0!==o?o:a.min)&&void 0!==d?d:t.min)&&void 0!==c?c:0,min:null!==(u=null!==(m=a.min)&&void 0!==m?m:t.min)&&void 0!==u?u:0,max:null!==(x=null!==(p=a.max)&&void 0!==p?p:t.max)&&void 0!==x?x:1e5}:"number"==typeof a&&(e[t.name]={value:a,min:null!==(h=t.min)&&void 0!==h?h:0,max:null!==(f=t.max)&&void 0!==f?f:1e5})}}),I.length>0&&(e.destinations=ev(I)),e},tc=async()=>{let e=td();await u(e),a(!1),l.u.emit("track-event",{event_name:"site_interaction",properties:{site_section:"hitl_wizard_submit_click",type:b}})},tm=async()=>{f&&await f(),a(!1),l.u.emit("track-event",{event_name:"site_interaction",properties:{site_section:"hitl_wizard_cancel_click",type:b}})},tu=e=>{let t=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),s=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(a,"-").concat(s)},tp=e=>e?e.toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"}):"",tx=(e,t)=>{var a;let s=ep(c).find(t=>t.name===e),r=null==s?void 0:null===(a=s.options)||void 0===a?void 0:a.find(e=>e.value===t);return(null==r?void 0:r.label)||t},th=(e,t)=>{var a;let s=ep(c).find(t=>t.name===e),r=null==s?void 0:null===(a=s.options)||void 0===a?void 0:a.find(e=>e.value===t);return null==r?void 0:r.emoji},tf=e=>tx("traveler_type",e),tg=(e,t)=>tx(e,t),tv=(e,t)=>(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)("span",{children:e}),t?(0,s.jsx)("span",{className:"text-red-500",children:"*"}):null]}),tb=(e,t,a)=>0===t.length?null:(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("h3",{className:"text-xl font-medium text-primary-text",children:e}),(0,s.jsx)("button",{type:"button",onClick:()=>{eR(!0),e4(a)},className:"text-primary-text",children:(0,s.jsx)(U.VJJ,{className:"size-4"})})]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:t.map((e,t)=>(0,s.jsxs)($.C,{variant:"default",className:"rounded-full bg-[--hitl-select-input] px-3 py-1.5 text-xs font-normal text-primary-text",children:[e.emoji&&(0,s.jsx)("span",{className:"mr-1",children:e.emoji}),e.label]},t))})]});(0,r.useEffect)(()=>{if(!t||0===C.length)return;let e=C[S];e&&l.u.emit("track-event",{event_name:"site_interaction",properties:{site_section:"hitl_wizard_step_view",type:b,step_id:e.id,step_title:e.title}})},[t,S,C,b]);let ty=S===C.length-1,tj=C[S],t_=(null==tj?void 0:tj.type)==="review";return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(g.dy,{open:t,onOpenChange:e=>{e&&a(e)},dismissible:!1,children:[(0,s.jsx)(g.P1,{className:"z-[500] bg-black/20"}),(0,s.jsx)(g.sc,{className:"z-[500] mx-auto h-[95dvh] max-h-[95vh] min-h-[95dvh] w-full max-w-[750px] rounded-t-2xl border-t border-border bg-[--background] shadow-2xl dark:bg-[--foreground] [@media(max-width:768px)]:h-[95dvh] [@media(max-width:768px)]:min-h-[95dvh]",onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:(0,s.jsxs)("div",{className:"-mt-2 flex size-full flex-col",children:[!t_&&(0,s.jsxs)("div",{className:"flex items-center justify-between px-4",children:[(0,s.jsx)("button",{type:"button",onClick:()=>ez.open(),className:"flex size-10 items-center justify-center rounded-full hover:bg-muted",children:(0,s.jsx)(x.Z,{className:"size-5 text-primary-text"})}),(0,s.jsx)("div",{className:"flex-1 px-4",children:(0,s.jsx)(ee.Progress,{value:eJ,className:"h-1.5 bg-muted",indicatorClassName:"bg-[--purple-primary]"})}),(0,s.jsx)("button",{type:"button",onClick:()=>{let e=C.findIndex(e=>"review"===e.type);-1!==e&&(eB(S),D(e),eR(!1)),l.u.emit("track-event",{event_name:"site_interaction",properties:{site_section:"hitl_wizard_skip_click",type:b}})},className:"text-sm font-medium text-primary-text hover:text-primary-text",children:"Skip"})]}),!t_&&(0,s.jsxs)("div",{className:"flex items-start gap-3 px-4 pb-4",children:[(0,s.jsx)("div",{className:"relative size-16 shrink-0",children:(0,s.jsx)(Q.default,{src:"/GumoEmojiWithStars.webp",alt:"Gumo",fill:!0,className:"object-contain"})}),(0,s.jsx)("div",{className:"self-center",children:(0,s.jsx)("h1",{className:"text-xl font-semibold text-primary-text",children:i})})]}),t_&&(0,s.jsxs)("div",{className:"flex items-center gap-3 px-4 pb-8",children:[(0,s.jsx)("button",{type:"button",onClick:e2,className:"flex size-10 items-center justify-center",children:(0,s.jsx)(k.Z,{className:"size-6 text-primary-text"})}),(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("h1",{className:"text-2xl font-bold text-primary-text",children:"Let's Review Your Trip Details"}),(0,s.jsx)("p",{className:"text-xs text-primary-text opacity-70",children:"Take a quick look at your trip summary below â you can edit or update anything if needed."})]})]}),!t_&&C[S]&&(0,s.jsx)("div",{className:"shrink-0 px-4 pb-2",children:(0,s.jsx)(V.M,{mode:"wait",children:(0,s.jsx)(J.E.div,{initial:{opacity:0,y:10}
1,animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,s.jsx)("p",{className:"text-lg font-medium text-primary-text",children:C[S].question})},S)})}),(0,s.jsx)("div",{ref:eW,className:"flex-1 overflow-y-auto px-4 pb-24",children:(0,s.jsx)(V.M,{mode:"wait",children:(0,s.jsx)(J.E.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.2},children:(()=>{if(0===C.length)return null;let e=C[S];if(!e)return null;if("review"===e.type){let e=[];if(I.length>0){let t=C.findIndex(e=>"destinations"===e.id);e.push({title:"Destinations",stepIndex:-1!==t?t:0,items:I.map(e=>({label:"".concat(e.city).concat(e.country?", ".concat(e.country):""," (").concat(e.number_of_days," day").concat(e.number_of_days>1?"s":"",")"),emoji:"\uD83D\uDCCD"}))})}if("flexible"===eE||eS.start){let t=[];if("flexible"===eE?eT.preferredMonths.length>0?t.push({label:"Flexible ⢠".concat(eT.preferredMonths.length," month(s)")}):t.push({label:"Flexible dates"}):eS.start&&t.push({label:"".concat(tp(eS.start)," - ").concat(tp(eS.end))}),t.length>0){let a=C.findIndex(e=>"dates"===e.id);e.push({title:"Travel Dates",stepIndex:-1!==a?a:0,items:t})}}
1return C.forEach((t,a)=>{if("review"===t.type||"dates"===t.id)return;let s=[];t.fields.forEach(e=>{let t=M[e.name];if(null!=t&&""!==t){if("composite-select"===e.type&&"object"==typeof t){var a;if(!t.primary)return;let r=null===(a=e.options)||void 0===a?void 0:a.find(e=>e.value===t.primary),l=(null==r?void 0:r.label)||t.primary,i=null==r?void 0:r.emoji;if(t.adult_count){l+=" (".concat(t.adult_count," adults");let e="string"==typeof t.children_ages&&t.children_ages.trim()?t.children_ages:Array.isArray(t.children_ages)&&t.children_ages.length>0?t.children_ages.join(", "):"";e&&(l+=", kids: ".concat(e)),l+=")"}s.push({label:l,emoji:i});return}if("textarea"===e.type&&"string"==typeof t&&t.trim()){s.push({label:t.length>50?t.slice(0,50)+"...":t});return}if(Array.isArray(t))t.forEach(t=>{s.push({label:tx(e.name,t),emoji:th(e.name,t)})});else{let a,r=t;"traveler_type"===e.name?(r=tf(t),a=th(e.name,t)):e.name.includes("budget")||e.name.includes("price")?r="object"==typeof t&&null!==t&&"min"in t&&"max"in t?"â¹".concat(t.min.toLocaleString("en-IN")," - â¹").concat(t.max.toLocaleString("en-IN")):"number"==typeof t?"â¹".concat(t.toLocaleString("en-IN")):tg(e.name,t):(r=tx(e.name,t),a=th(e.name,t)),s.push({label:String(r),emoji:a})}}}),s.length>0&&e.push({title:t.title,stepIndex:a,items:s})}),(0,s.jsx)("div",{className:"space-y-6",children:e.map((e,t)=>(0,s.jsx)("div",{children:tb(e.title,e.items,e.stepIndex)},t))})}if("destinations"===e.id||"destinations"===e.type){let e=I.map(e=>e.order),t=I.find(e=>e.order===er);return(0,s.jsxs)(B.LB,{sensors:eQ,collisionDetection:B.pE,onDragStart:ti,onDragEnd:tn,onDragCancel:to,modifiers:[Y.DL,Y.F4],children:[(0,s.jsxs)("div",{className:"dnd-context space-y-4",children:[(0,s.jsx)(K.Fo,{items:e,strategy:K.qw,children:I.map((e,t)=>(0,s.jsx)(ed,{destination:e,index:t,onPOIChange:ts,onDeselectAll:tl,onNumberOfDaysChange:tt,onAddPOI:tr,onHotelRequiredChange:ta,onDelete:te,canDelete:I.length>1},e.order))}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(A.z,{variant:"outline",className:"h-11 w-full justify-center border-1 border-[#CCCCCC] bg-transparent text-center text-primary-text shadow-none hover:bg-accent hover:text-primary-text dark:border-[#282828]",onClick:()=>eA.open(),children:"Add destination"}),(0,s.jsx)(ea,{open:eA.isOpen,onOpenChange:eA.handleOpenChange,title:"Add Destination",placeholder:"Search destinations...",query:Z,onQueryChange:R,results:eU,isLoading:eG,onSelect:e7,emptyMessage:Z.length>2?"No results found":"Type at least 3 characters",renderItem:e=>{var t,a;return(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"font-medium text-primary-text",children:(null===(t=e.structured_formatting)||void 0===t?void 0:t.main_text)||e.description}),(0,s.jsx)("p",{className:"text-sm text-primary-text opacity-70",children:null===(a=e.structured_formatting)||void 0===a?void 0:a.secondary_text})]})}})]})]}),(0,s.jsx)(B.y9,{children:er&&t?(0,s.jsx)(ed,{destination:t,index:I.findIndex(e=>e.order===er),onPOIChange:()=>{},onDeselectAll:()=>{},onNumberOfDaysChange:()=>{},onAddPOI:()=>{},onHotelRequiredChange:()=>{},onDelete:()=>{},canDelete:!1}):null})]})}if("dates"===e.id)return(0,s.jsx)("div",{className:"space-y-3",children:(0,s.jsxs)("button",{type:"button",onClick:()=>e3("have_dates"),className:(0,z.cn)("flex w-full items-center justify-between rounded-xl border-2 p-4 transition-all","have_dates"===eE?"border-[--purple-primary] bg-[--purple-primary] text-white hover:bg-[--purple-primary]/90":"border-border bg-card hover:border-[--purple-primary]/50"),children:[(0,s.jsxs)("div",{className:"text-left",children:[(0,s.jsx)("p",{className:(0,z.cn)("font-medium","have_dates"===eE?"text-white":"text-primary-text"),children:"I have my dates"}),eS.start&&(0,s.jsxs)("p",{className:(0,z.cn)("mt-1 text-sm","have_dates"===eE?"text-white/80":"text-[--purple-primary]"),children:[tp(eS.start)," -"," ",tp(eS.end),(0,s.jsx)("span",{className:"ml-2 text-xs",children:"âï¸"})]})]}),(0,s.jsx)("div",{className:(0,z.cn)("flex size-6 items-center justify-center rounded-full border-2 transition-colors","have_dates"===eE?"border-[--purple-primary] bg-[--purple-primary]":"border-muted-foreground"),children:"have_dates"===eE&&(0,s.jsx)(h.Z,{className:"size-4 text-white"})})]})});if("travelers"===e.id||"travelers"===e.type){let t=e.fields.find(e=>"traveler_type"===e.name),a=(null==t?void 0:t.options)||[],r=M.traveler_type;return(0,s.jsx)("div",{ref:e=>{eV.current.traveler_type=e},className:"space-y-3",children:a.map(e=>{let t=r===e.value;return(0,s.jsx)(ec,{label:e.label,emoji:e.emoji,selected:t,onClick:()=>e6(e.value,!0),children:t&&"Solo"!==e.value&&"Couple"!==e.value&&(0,s.jsxs)("p",{className:"mt-1 text-sm text-white/80",children:[eF.adults," adults, ",eF.kids," kids",(0,s.jsx)("span",{className:"ml-2 text-xs",children:"âï¸"})]})},e.value)})})}if("budget"===e.id||"budget"===e.type){let i=e.fields.find(e=>e.name.includes("budget")||e.name.includes("price"));if(i&&"dual-range"===i.type&&"hotel"===b){var t,a,r,l;let{sliderMin:e,sliderMax:n}=e_(i),o=M[i.name],d=null!==(a=null!==(t=null==o?void 0:o.min)&&void 0!==t?t:eL.min)&&void 0!==a?a:e,c=null!==(l=null!==(r=null==o?void 0:o.max)&&void 0!==r?r:eL.max)&&void 0!==l?l:n;return(0,s.jsxs)("div",{ref:e=>{eV.current[i.name]=e},className:"space-y-20",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-primary-text",children:tv(i.label,i.required)}),(0,s.jsx)(eu,{rangeMin:d,rangeMax:c,sliderMin:e,sliderMax:n,onChange:(e,t)=>
1{eq({min:e,max:t}),T(a=>({...a,[i.name]:{value:e,min:e,max:t}}))},suffix:"/ night"})]})}return(0,s.jsx)("div",{className:"space-y-3",children:e.fields.map((t,a)=>(0,s.jsxs)("div",{ref:e=>{eV.current[t.name]=e},className:"space-y-3",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-primary-text",children:tv(t.label,t.required)}),t.options?(0,s.jsx)("div",{className:"space-y-2",children:t.options.map(r=>{var l;let i=M[t.name]===r.value,n=null!==(l=r.emoji)&&void 0!==l?l:th(t.name,r.value);return(0,s.jsx)(ec,{label:r.label,emoji:n,selected:i,onClick:()=>e5(t.name,r.value,!1,a===e.fields.length-1)},r.value)})}):(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-primary-text",children:"â¹"}),(0,s.jsx)(v.I,{type:"number",placeholder:"Enter amount",value:M[t.name]||"",onChange:e=>T(a=>({...a,[t.name]:+e.target.value})),className:"pl-8 text-primary-text"})]})]},t.name))})}if("category"===e.type)return(0,s.jsx)("div",{className:"space-y-8",children:e.fields.map((t,a)=>{var r,l,i,n,o;if("traveler_type"===t.name){let r=t.options||[],l=M.traveler_type;return(0,s.jsxs)("div",{ref:e=>{eV.current[t.name]=e},className:"space-y-3",children:[(0,s.jsx)("div",{className:"sticky top-0 z-10 -mx-4 bg-[--background] px-4 pb-2 dark:bg-[--foreground]",children:(0,s.jsx)("p",{className:"text-sm font-medium text-primary-text",children:tv(t.label,t.required)})}),(0,s.jsx)("div",{className:"space-y-2",children:r.map(r=>{var i;let n=l===r.value,o=null!==(i=r.emoji)&&void 0!==i?i:th(t.name,r.value);return(0,s.jsx)(ec,{label:r.label,emoji:o,selected:n,onClick:()=>e6(r.value,a===e.fields.length-1),children:n&&"Solo"!==r.value&&"Couple"!==r.value&&(0,s.jsxs)("p",{className:"mt-1 text-sm text-white/80",children:[eF.adults," adults,"," ",eF.kids," kids",(0,s.jsx)("span",{className:"ml-2 text-xs",children:"âï¸"})]})},r.value)})})]},t.name)}if("dual-range"===t.type&&(t.name.includes("budget")||t.name.includes("price"))){let{sliderMin:e,sliderMax:a}=e_(t),o=M[t.name],d=null!==(l=null!==(r=null==o?void 0:o.min)&&void 0!==r?r:eL.min)&&void 0!==l?l:e,c=null!==(n=null!==(i=null==o?void 0:o.max)&&void 0!==i?i:eL.max)&&void 0!==n?n:a;return(0,s.jsxs)("div",{ref:e=>{eV.current[t.name]=e},className:"space-y-12",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-primary-text",children:tv(t.label,t.required)}),(0,s.jsx)(eu,{rangeMin:d,rangeMax:c,sliderMin:e,sliderMax:a,onChange:(e,a)=>{eq({min:e,max:a}),T(s=>({...s,[t.name]:{value:e,min:e,max:a}}))},suffix:"/ night"})]},t.name)}if("multi-select"===t.type)return(0,s.jsxs)("div",{ref:e=>{eV.current[t.name]=e},className:"space-y-3",children:[(0,s.jsx)("div",{className:"sticky top-0 z-10 -mx-4 bg-[--background] px-4 pb-2 dark:bg-[--foreground]",children:(0,s.jsx)("p",{className:"text-sm font-medium text-primary-text",children:tv(t.label,t.required)})}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:null===(o=t.options)||void 0===o?void 0:o.map(e=>{var a;let r=(M[t.name]||[]).includes(e.value),l=null!==(a=e.emoji)&&void 0!==a?a:th(t.name,e.value);return(0,s.jsx)(em,{label:e.label,emoji:l,selected:r,onClick:()=>e5(t.name,e.value,!0)},e.value)})})]},t.name);if("textarea"===t.type){let e=M[t.name]||"";return(0,s.jsxs)("div",{ref:e=>{eV.current[t.name]=e},className:"space-y-3",children:[(0,s.jsx)("div",{className:"sticky top-0 z-10 -mx-4 bg-[--background] px-4 pb-2 dark:bg-[--foreground]",children:(0,s.jsx)("p",{className:"text-sm font-medium text-primary-text",children:tv(t.label,t.required)})}),(0,s.jsx)("textarea",{placeholder:t.placeholder||"Type here...",value:e,onChange:e=>T(a=>({...a,[t.name]:e.target.value})),rows:4,className:"w-full rounded-xl border-2 border-border bg-[--hitl-select-input] p-3 text-sm text-primary-text placeholder:text-muted-foreground focus:border-[--purple-primary] focus:outline-none focus:ring-0"}),t.help_text&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:t.help_text})]},t.name)}if("composite-select"===t.type){let e=M[t.name]||{primary:null,adult_count:null,children_ages:[]},a="object"==typeof e?e.primary:e,r=t.options||[];return(0,s.jsxs)("div",{ref:e=>{eV.current[t.name]=e},className:"space-y-3",children:[(0,s.jsx)("div",{className:"sticky top-0 z-10 -mx-4 bg-[--background] px-4 pb-2 dark:bg-[--foreground]",children:(0,s.jsx)("p",{className:"text-sm font-medium text-primary-text",children:tv(t.label,t.required)})}),(0,s.jsx)("div",{className:"space-y-2",children:r.map(r=>{var l,i;let n=a===r.value,o=null!==(l=r.emoji)&&void 0!==l?l:th(t.name,r.value);return(0,s.jsx)("div",{children:(0,s.jsx)(ec,{label:r.label,emoji:o,selected:n,onClick:()=>
1{if(r.requires_composition){var e,a;let s=M[t.name],l=!r.sub_fields||"children_ages"in r.sub_fields,i={primary:r.value,adult_count:null!==(e=null==s?void 0:s.adult_count)&&void 0!==e?e:2,children_ages:l&&null!==(a=null==s?void 0:s.children_ages)&&void 0!==a?a:[]};T(e=>({...e,[t.name]:i})),e9(t.name,i,r.sub_fields)}else T(e=>({...e,[t.name]:{primary:r.value,adult_count:null,children_ages:[]}}))},children:n&&r.requires_composition&&(0,s.jsxs)("button",{type:"button",onClick:a=>{a.stopPropagation(),e9(t.name,e,r.sub_fields)},className:"mt-1 text-sm text-white/80",children:[null!==(i=e.adult_count)&&void 0!==i?i:2," adults",e.children_ages&&("string"==typeof e.children_ages&&e.children_ages.trim()?", kids: ".concat(e.children_ages):Array.isArray(e.children_ages)&&e.children_ages.length>0?", kids: ".concat(e.children_ages.join(", ")):""),(0,s.jsx)("span",{className:"ml-2 text-xs",children:"âï¸"})]})})},r.value)})}),t.help_text&&(0,s.jsx)("p",{className:"text-xs text-secondary-text",children:t.help_text})]},t.name)}
1let d=t.options||[],c=M[t.name];return(0,s.jsxs)("div",{ref:e=>{eV.current[t.name]=e},className:"space-y-3",children:[(0,s.jsx)("div",{className:"sticky top-0 z-10 -mx-4 bg-[--background] px-4 pb-2 dark:bg-[--foreground]",children:(0,s.jsx)("p",{className:"text-sm font-medium text-primary-text",children:tv(t.label,t.required)})}),(0,s.jsx)("div",{className:"space-y-2",children:d.map(r=>{var l;let i=null!==(l=r.emoji)&&void 0!==l?l:th(t.name,r.value);return(0,s.jsx)(ec,{label:r.label,emoji:i,selected:c===r.value,onClick:()=>e5(t.name,r.value,!1,a===e.fields.length-1)},r.value)})})]},t.name)})});if("textarea"===e.type||e.fields.length>0&&"textarea"===e.fields[0].type){let t=e.fields[0],a=M[t.name]||"";return(0,s.jsxs)("div",{ref:e=>{eV.current[t.name]=e},className:"space-y-2",children:[(0,s.jsx)("textarea",{placeholder:t.placeholder||"Type here...",value:a,onChange:e=>T(a=>({...a,[t.name]:e.target.value})),rows:4,className:"w-full rounded-xl border-2 border-border bg-[--hitl-select-input] p-3 text-sm text-primary-text placeholder:text-muted-foreground focus:border-[--purple-primary] focus:outline-none focus:ring-0"}),t.help_text&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:t.help_text})]})}if(e.fields.length>0&&"text"===e.fields[0].type){let t=e.fields[0],a=M[t.name]||"";return(0,s.jsxs)("div",{ref:e=>{eV.current[t.name]=e},className:"space-y-2",children:[(0,s.jsx)(v.I,{type:"number",placeholder:t.placeholder||"Enter a number",value:a,onChange:e=>{let a=e.target.value;(""===a||/^\d+$/.test(a))&&T(e=>({...e,[t.name]:a}))},min:t.min,max:t.max,className:"text-primary-text"}),void 0!==t.min&&void 0!==t.max&&(0,s.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Enter a value between ",t.min," and ",t.max]})]})}if("single-select"===e.type&&e.fields.length>0){let t=e.fields[0],a=t.options||[],r=M[t.name];return(0,s.jsx)("div",{ref:e=>{eV.current[t.name]=e},className:"space-y-3",children:a.map(e=>{var a;let l=null!==(a=e.emoji)&&void 0!==a?a:th(t.name,e.value);return(0,s.jsx)(ec,{label:e.label,emoji:l,selected:r===e.value,onClick:()=>e5(t.name,e.value,!1,!0)},e.value)})})}return"multi-select"===e.type?(0,s.jsx)("div",{className:"space-y-4",children:e.fields.map(e=>{var t;return(0,s.jsxs)("div",{ref:t=>{eV.current[e.name]=t},className:"mb-4 space-y-3",children:[(0,s.jsx)("div",{className:"sticky top-0 z-10 -mx-4 bg-[--background] px-4 pb-2 dark:bg-[--foreground]",children:(0,s.jsx)("p",{className:"text-sm font-medium text-primary-text",children:tv(e.label,e.required)})}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:null===(t=e.options)||void 0===t?void 0:t.map(t=>{var a;let r=(M[e.name]||[]).includes(t.value),l=null!==(a=t.emoji)&&void 0!==a?a:th(e.name,t.value);return(0,s.jsx)(em,{label:t.label,emoji:l,selected:r,onClick:()=>e5(e.name,t.value,!0)},t.value)})})]},e.name)})}):null})()},S)})}),!t_&&(0,s.jsxs)("div",{className:"flex w-full gap-3 bg-[--background] p-4 pb-8 dark:bg-[--foreground]",children:[S>0&&(0,s.jsx)(A.z,{variant:"outline",onClick:e2,className:"flex-1 rounded-full border-2 border-border bg-transparent py-6 text-primary-text opacity-80 hover:bg-transparent hover:text-primary-text",children:"Back"}),(0,s.jsx)(A.z,{onClick:ty?tc:e1,disabled:m,className:(0,z.cn)("rounded-full bg-[--purple-primary] py-6 text-black hover:bg-[--purple-primary]/90",S>0?"flex-1":"w-full"),children:m?"Submitting...":ty?"Confirm":"Continue"})]}),t_&&(0,s.jsx)("div",{className:"bg-[--background] p-4 pb-8 dark:bg-[--foreground]",children:(0,s.jsx)(A.z,{onClick:tc,disabled:m,className:"hover:bg-[--purple-primary]/90 w-full rounded-full bg-[--purple-primary] py-6 text-black",children:m?"Submitting...":"Confirm"})})]})})]}),(0,s.jsxs)(X.Dialog,{open:ez.isOpen,onOpenChange:ez.handleOpenChange,modal:!0,children:[(0,s.jsx)(X.t9,{className:"z-[600]"}),(0,s.jsxs)(X.DialogContent,{hideCross:!0,className:"z-[600] bg-background text-primary-text",children:[(0,s.jsxs)(X.DialogHeader,{className:"flex items-center justify-center",children:[(0,s.jsx)(X.DialogTitle,{className:"text-center text-xl font-medium",children:"Qu
1it trip planning"}),(0,s.jsx)(X.DialogDescription,{className:"text-xs font-normal",children:"If you close setup now, your selections won't be saved"})]}),(0,s.jsxs)("div",{className:"mx-auto flex flex-row items-center gap-3 sm:justify-between",children:[(0,s.jsx)(A.z,{className:"rounded-full bg-purple-primary px-6 py-2 text-base font-semibold text-primary-text",onClick:e=>{e.stopPropagation(),ez.close()},children:"Continue"}),(0,s.jsx)(A.z,{className:"rounded-full bg-card px-6 py-2 text-base font-medium text-primary-text",onClick:async()=>{ez.close(),await tm()},children:"Exit setup"})]})]})]}),(0,s.jsx)(E,{open:eC.isOpen,onOpenChange:eC.handleOpenChange,value:eS,onChange:e=>{if(!e.start)return;let t=q?ey(e.start,L):null,a={start:e.start,end:t||e.end||e.start};eD(a);let s={};"hotel"===b?(s.checkin_date=tu(a.start),s.checkout_date=tu(a.end)):(s.start_date=tu(a.start),s.end_date=tu(a.end),s.travel_flexibility="fixed"),T(e=>({...e,...s})),eI({preferredMonths:[],tripLength:"",seasonPreference:""}),setTimeout(()=>{e1()},300)},fixedDurationDays:q?L:void 0}),(0,s.jsx)(F,{open:ei,onOpenChange:en,value:eT,onChange:e=>{eI(e),T(t=>({...t,preferred_months:e.preferredMonths,trip_length:e.tripLength,season_preference:e.seasonPreference,travel_flexibility:"flexible"})),setTimeout(()=>{e1()},300)}}),(0,s.jsx)(es,{open:eo,onOpenChange:e=>{eg(e),e||(eN(null),ew(!0))},value:eF,onChange:e=>{if(eb){let t=e.kidAges.length>0?e.kidAges.join(", "):"";T(a=>({...a,[eb]:{...a[eb],adult_count:e.adults,children_ages:t}})),eN(null)}else e8(e)},showKids:ek})]})}function ek(e){let{type:t,title:a,message:i,currentParameters:o,tripPlanData:d,fields:c,loading:m,onSubmit:u,onSkip:p,onCancel:x}=e,h=(0,q.I0)(),f=(0,q.v9)(e=>e.other.token),g=Array.isArray(c)?c:Array.isArray(null==c?void 0:c.categories)?c.categories.flatMap(e=>Array.isArray(null==e?void 0:e.fields)?e.fields:[]):[],[v,b]=(0,r.useState)(!1);(0,r.useEffect)(()=>((0,n.BR)(v),()=>(0,n.BR)(!1)),[v]);let y=()=>!f&&((0,Z.Z)()?(0,R.Z)():h((0,P.TS)(!0)),!0),j=async()=>{if(y())return;let e={};g.forEach(t=>{if(null!==t.value&&void 0!==t.value&&""!==t.value){if("multi-select"===t.type&&"string"==typeof t.value)e[t.name]=[t.value];else if("dual-range"===t.type&&"object"==typeof t.value&&null!==t.value){var a,s,r,l;let i=t.value;e[t.name]={value:null!==(s=null!==(a=i.value)&&void 0!==a?a:i.min)&&void 0!==s?s:0,min:null!==(r=i.min)&&void 0!==r?r:0,max:null!==(l=i.max)&&void 0!==l?l:1e5}}else e[t.name]=t.value}});let a=o||{},s=a.checkin_date||a.start_date,r=a.checkout_date||a.end_date;if(s){let a=new Date(s),l=r?new Date(r):null,i=e=>e.toISOString().split("T")[0];"hotel"===t?(e.checkin_date||(e.checkin_date=i(a)),e.checkout_date||(e.checkout_date=i(l||a))):(e.start_date||(e.start_date=i(a)),e.end_date||(e.end_date=i(l||a)))}if(g.forEach(t=>{if(void 0===e[t.name]||null===e[t.name]||""===e[t.name]){var a,s,r,l;if("multi-select"===t.type)e[t.name]=[];else if("number"===t.type)e[t.name]=null!==(a=t.min)&&void 0!==a?a:0;else if("dual-range"===t.type){let a=null!==(s=t.min)&&void 0!==s?s:0,l=null!==(r=t.max)&&void 0!==r?r:1e5;e[t.name]={value:a,min:a,max:l}}else"composite-select"===t.type?e[t.name]=null!==(l=t.value)&&void 0!==l?l:{primary:null,adult_count:null,children_ages:""}:e[t.name]=""}else"multi-select"===t.type&&"string"==typeof e[t.name]&&(e[t.name]=[e[t.name]])}),"itinerary"===t){var i;let t=(null==o?void 0:null===(i=o.trip_plan_data)||void 0===i?void 0:i.destinations)||(null==o?void 0:o.destinations),a=null==d?void 0:d.destinations;if(Array.isArray(t)&&t.length>0){let s=t.map((e,t)=>{var s,r,l,i,n,o;let d=e.order&&"number"==typeof e.order?e.order:t+1,c=null!==(r=null!==(s=e.number_of_days)&&void 0!==s?s:e.days)&&void 0!==r?r:1,m=Array.isArray(e.preselected_pois)?e.preselected_pois:[];if(0===m.length&&Array.isArray(a)&&a.length>0){let t=a.find(t=>t.city===e.city&&t.country===e.country);t&&Array.isArray(t.preselected_pois)&&t.preselected_pois.length>0&&(m=t.preselected_pois)}return{city:e.city,country:e.country,is_hotel_required:null===(l=e.is_hotel_required)||void 0===l||l,place_id:null!==(i=e.place_id)&&void 0!==i?i:null,order:d,number_of_days:c,arrival_transport:null!==(n=e.arr
1ival_transport)&&void 0!==n?n:null,departure_transport:null!==(o=e.departure_transport)&&void 0!==o?o:null,preselected_pois:m}});e.destinations=s}}await p(e),l.u.emit("track-event",{event_name:"site_interaction",properties:{site_section:"hitl_wizard_skip&surpriseme_click",type:t}})};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex flex-wrap gap-3",children:[(0,s.jsxs)(A.z,{onClick:()=>{y()||(b(!0),l.u.emit("track-event",{event_name:"site_interaction",properties:{site_section:"hitl_wizard_start_click",type:t}}))},className:"flex items-center gap-2 rounded-full bg-[--purple-primary] px-5 py-2.5 text-sm font-medium text-black hover:opacity-90",children:[(0,s.jsx)(O.Z,{className:"size-4"}),"hotel"===t?"Share Your Stay Preferences":"Start trip setup"]}),(0,s.jsxs)(A.z,{onClick:j,disabled:m,className:"flex items-center gap-2 rounded-full border-2 border-border bg-transparent px-5 py-2.5 text-sm font-medium text-primary-text opacity-80",children:[(0,s.jsx)(L.Z,{className:"size-4"}),"Skip & surprise me"]})]}),(0,s.jsx)(eN,{open:v,onOpenChange:b,title:a,message:i,currentParameters:o,tripPlanData:d,fields:c,loading:m,onSubmit:u,onSkip:p,onCancel:x,wizardType:t})]})}var ew=a(29810),eC=a(14168),eA=a(63508),ez=a(3830),eS=a(52841),eD=e=>{var t;let{message:a,onContentChange:o,token:c}=e,[m,u]=(0,r.useState)(null),[p,x]=(0,r.useState)(!0),[h,f]=(0,r.useState)(null),g=(0,n.MM)("destination-view"),[v,b]=(0,r.useState)(null),y=(0,i.a)("(min-width: 1024px)"),j=(0,r.useCallback)(()=>{if(a.trip_id)return{trip_id:a.trip_id,trip_name:"",saved_days:0,saved_items:0,status:"completed"};if(a.streamingData){for(let e of a.streamingData)if(e.trip_data)return e.trip_data}return null},[a.streamingData,a.trip_id]),_=(0,r.useCallback)(()=>y&&"/chat"===window.location.pathname,[y]),N=e=>{_()&&y?l.u.emit("destination_overlay_open",{cityName:e,componentType:"destination_detail"}):(b(e),g.open())},k=()=>{m&&(y?l.u.emit("itinerary_overlay_open",{tripData:m,title:"Itinerary"}):l.u.emit("mobile_itinerary_map_open",{tripData:m,title:m.name||"Your Itinerary"}),l.u.emit("track-event",{event_name:"site_interaction",properties:{site_section:y?"Show_Itinerary_Desktop_Click":"Show_Itinerary_Mobile_Click"}}))},w=(0,r.useCallback)(()=>!!a.trip_id||!!a.streamingData&&a.streamingData.some(e=>"generate_high_level_plan"===e.step||"response"===e.status&&e.trip_data),[a.streamingData,a.trip_id]);(0,r.useEffect)(()=>{let e=async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=j();if(!(null==a?void 0:a.trip_id)){x(!1);return}1===t&&(x(!0),f(null));try{let e=await (0,ez.Ig)(a.trip_id);u(e),x(!1),setTimeout(()=>{null==o||o()},500)}catch(a){if(console.error("Error fetching trip details (attempt ".concat(t,"):"),a),c&&t<3){console.warn("Trip details fetch failed. Retrying in 1.5s... (Attempt ".concat(t+1,")")),setTimeout(()=>e(t+1),100);return}f("Failed to load trip details. Please try again. Coz trip id didnt make it from anon to real user"),x(!1)}};w()&&(!a.status||"completed"===a.status)&&e()},[a.status,j,w,c,o]),(0,r.useEffect)(()=>{m&&!p&&o&&setTimeout(()=>{o()},200)},[m,p,o]);let C=()=>{var e,t,r,l,i,n,o,d;let c;if(!m||0===m.days.length)return null;if(!y)return(0,s.jsx)("div",{className:"my-4",children:(0,s.jsxs)("button",{onClick:k,className:"hover:bg-purple-primary/90 flex w-full items-center justify-center gap-3 rounded-lg bg-purple-primary py-3 text-center font-poppins text-base font-medium text-white transition-colors",children:[(0,s.jsx)(eC.Z,{}),"View Itinerary"]})});let u=null===(t=m.days[0])||void 0===t?void 0:null===(e=t.items)||void 0===e?void 0:e[0],p=null==u?void 0:null===(l=u.place_details)||void 0===l?void 0:null===(r=l.google_places)||void 0===r?void 0:r.photos,x=null==p?void 0:p[0];"string"==typeof x?c=x:x&&"object"==typeof x&&(c=x.photo_reference?(0,eS.v)(x.photo_reference,800):x.photo_uri);let h=((null===(n=m.days[0])||void 0===n?void 0:null===(i=n.items)||void 0===i?void 0:i.slice(1,4))||[]).map(e=>{var t,a;let s,r;let l=null===(a=e.place_details)||void 0===a?void 0:null===(t=a.google_places)||void 0===t?void 0:t.photos,i=null==l?void 0:l[0];return"string"==typeof i?r=i:i&&"object"==typeof i&&(i.photo_reference&&(s=i.photo_reference),r=i.photo_uri),{photoReference:s,imageUrl:r,name:e.name}}).filter(e=>e.photoReference||e.imageUrl),f=m.name||"Your Itinerary",g=(a.ai_response.llm_response_to_user||"").replace(/<city_name>(.*?)<\/city_name>/g,"$1"),v=(null===(d=m.days[0])||void 0===d?void 0:null===(o=d.items)||void 0===o?void 0:o.slice(0,3).map(e=>e.name))||[];return(0,s.jsx)("div",{className:"my-4 flex justify-start",children:(0,s.jsxs)("div",{className:"relative z-0 w-full max-w-[calc(100vw-4rem)] cursor-pointer sm:max-w-md",onClick:k,children:[(0,s.jsxs)("div",{className:"relative z-20 overflow-hidden rounded-2xl shadow-[0_12px_25px_rgba(190,139,255,0.9)] transition-transform hover:scale-[1.01] dark:shadow-[0_12px_20px_rgba(255,245,81,0.25)] ",style:{backgroundImage:c?"url(".concat(c,")"):"linear-gradient(135deg, #667eea 0%, #764ba2 100%)",backgroundSize:"cover",backgroundPosition:"center",minHeight:"200px"},children:[(0,s.jsx)("div",{className:"pointer-events-none absolute inset-0 overflow-hidden rounded-2xl",children:(0,s.jsx)("div",{className:"absolute left-0 top-0 h-full w-[72%] [clip-path:ellipse(68%_90%_at_25%_50%)]",style:{background:"linear-gradient(to right, rgba(0,0,0,1.0) 0%, rgba(0,0,0,0.9) 50%, rgba(0,0,0,0.5) 80%, rgba(0,0,0,0.3) 100%)"}})}),(0,s.jsxs)("div",{className:"relative z-20 max-w-[70%] p-6 text-white sm:max-w-[60%]",children:[(0,s.jsx)("h3",{className:"mb-3 text-lg font-bold md:text-xl",children:f}),(0,s.jsx)("p",{className:"mb-4 line-clamp-3 text-xs leading-relaxed text-white/90 md:text-sm",children:g}),(0,s.jsx)("div",{className:"space-y-1",children:v.map((e,t)=>(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"size-1 shrink-0 rounded-full bg-white/80"}),(0,s.jsx)("span",{className:"truncate text-xs font-medium text-white/90 md:text-sm",children:e})]},t))}),(0,s.jsxs)("div",{className:"mt-4 flex items-center gap-2 text-[11px] text-white/80 md:text-xs",children:[(0,s.jsx)("span",{children:"VIEW FULL ITINERARY"}),(0,s.jsx)("svg",{className:"size-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]})]}),h.length>0&&(0,s.jsx)("div",{className:"absolute right-[-84px] top-4 z-10 hidden h-[calc(100%-2rem)] cursor-pointer flex-col justify-between gap-2 sm:flex",children:h.map((e,t)=>(0,s.jsx)("div",{className:"relative h-20 w-28 overflow-hidden rounded-2xl shadow-[0_0_25px_rgba(190,139,255,0.8)] dark:shadow-[0_0_20px_rgba(255,245,81,0.25)]",children:(0,s.jsx)(eA.w,{photoReference:e.photoReference,photoUri:e.imageUrl,fallbackSrc:"/city/delhi.webp",alt:"itinerary side ".concat(t+1),className:"size-full object-cover",maxWidth:400,filename:"itinerary-chat-response.tsx",sizes:"(max-width: 768px) 28vw, 20vw",priority:0===t})},t))})]})})};if(!w())return null;if(p)return(0,s.jsx)("div",{className:"mb-4 flex w-full justify-start",children:(0,s.jsx)("div",{className:"max-w-[80%] rounded-2xl bg-card p-4",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"size-4 animate-spin rounded-full border-2 border-purple-primary border-t-transparent dark:border-primary"}),(0,s.jsx)("span",{className:"text-sm text-secondary-text",children:"Loading itinerary details..."})]})})});if(h)return(0,s.jsx)("div",{className:"mb-4 flex w-full justify-start",children:(0,s.jsx)("div",{className:"bg-destructive/10 max-w-[80%] rounded-2xl p-4",children:(0,s.jsx)("p",{className:"text-sm text-destructive",children:h})})});if(!m)return null;let A=null===(t=a.ai_response.llm_response_to_user)||void 0===t?void 0:t.includes("Now I'll search for hotels"),z=()=>(0,s.jsx)("div",{className:"md:py-4",children:a.ai_response.llm_response_to_user&&(0,s.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-base leading-6 text-primary-text",children:a.ai_response.llm_response_to_user.split(/<city_name>(.*?)<\/city_name>/g).map((e,t)=>t%2==1?(0,s.jsx)("button",{className:"inline font-semibold text-purple-primary hover:underline dark:text-primary",onClick:()=>N(e),children:e},t):e)})}),S=()=>(0,s.jsx)("div",{className:"space-y-3",children:(0,s.jsx)("ul",{className:"mt-2 list-disc pl-4 font-poppins text-base text-primary-text md:pl-6",children:m.days.map(e=>{let t=e.description&&e.description.length>0?e.description:(e.items||[]).map(e=>
1e.name).filter(Boolean).join(", ");return t?(0,s.jsxs)("li",{className:"whitespace-pre-wrap leading-6",children:[(0,s.jsx)("span",{className:"font-bold text-black dark:text-white",children:"Day ".concat(e.day_number," : ")})," ",t]},e.id):null})})});return(0,s.jsx)("div",{className:"mb-4 flex w-full justify-start",children:(0,s.jsxs)("div",{className:"w-full",children:[y?(0,s.jsxs)(s.Fragment,{children:[z(),S(),C()]}):(0,s.jsx)(s.Fragment,{children:A?(0,s.jsxs)(s.Fragment,{children:[S(),z(),C()]}):(0,s.jsxs)(s.Fragment,{children:[z(),S(),C()]})}),v&&!_()&&(0,s.jsx)(d.Z,{open:g.isOpen,onOpenChange:g.handleOpenChange,cityName:v})]})})},eE=a(85146),eM=a(29),eT=a.n(eM),eI=a(96395);let eF=(0,r.memo)(function(e){let{text:t,speed:a=20,className:l="",isActive:i=!0}=e,[n,o]=(0,r.useState)(""),d=(0,r.useRef)(0),c=(0,r.useRef)("");return(0,r.useEffect)(()=>{if(t!==c.current&&(t.startsWith(c.current)?d.current=c.current.length:(d.current=0,o("")),c.current=t),!i){o(t),d.current=t.length;return}if(d.current>=t.length)return;let e=setInterval(()=>{if(d.current<t.length){let e=Math.min(2,t.length-d.current);d.current+=e,o(t.slice(0,d.current))}else clearInterval(e)},a);return()=>clearInterval(e)},[t,a,i]),(0,s.jsx)("span",{className:l,children:n})}),eO=[{label:"Insta...",color:"#E1306C",bgColor:"#FCE4EC"},{label:"This hidden cafe in...",color:"#E1306C",bgColor:"#FCE4EC"},{label:"rdfv...",color:"#6B7280",bgColor:"#F3F4F6"},{label:"7 day itinerary for a...",color:"#6B7280",bgColor:"#F3F4F6"},{label:"Yout...",color:"#FF0000",bgColor:"#FFEBEE"},{label:"Delhi to Kasol Full Ro...",color:"#FF0000",bgColor:"#FFEBEE"}],eL=e=>{let{streamingData:t=[]}=e,[a,l]=(0,r.useState)(!0),i=t.filter(e=>"thinking"===e.status),n=e=>e<i.length-1?"completed":e===i.length-1?"current":"pending";return(0,s.jsxs)("div",{className:"jsx-2c815b0a4b02534e mb-4 flex w-full justify-start",children:[(0,s.jsxs)("div",{className:"jsx-2c815b0a4b02534e w-full",children:[(0,s.jsxs)("div",{onClick:()=>l(!a),className:"jsx-2c815b0a4b02534e flex cursor-pointer select-none items-center gap-2",children:[(0,s.jsx)("span",{className:"jsx-2c815b0a4b02534e inline-block size-4 animate-spin rounded-full border-2 border-gray-400 border-t-transparent"}),(0,s.jsx)("div",{style:{backgroundImage:"linear-gradient(120deg, transparent 40%, currentColor 50%, transparent 60%)",backgroundSize:"200% 100%",WebkitBackgroundClip:"text",animationDuration:"1s"},className:"jsx-2c815b0a4b02534e inline-block animate-shine bg-clip-text font-medium text-gray-600/50 dark:text-gray-400/50 ",children:"Thinking"}),(0,s.jsx)("svg",{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",className:"jsx-2c815b0a4b02534e "+"size-3 text-gray-300 transition-transform duration-200 ".concat(a?"rotate-180":""),children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7",className:"jsx-2c815b0a4b02534e"})})]}),a&&(0,s.jsx)("div",{className:"jsx-2c815b0a4b02534e mt-4",children:i.length>0?(0,s.jsx)("div",{className:"jsx-2c815b0a4b02534e relative",children:i.map((e,t)=>{let a=n(t),r=t===i.length-1,l=Array.isArray(e.descriptions)&&e.descriptions.length>0?e.descriptions:[],o=e.title;return(0,s.jsxs)("div",{className:"jsx-2c815b0a4b02534e relative mb-4 flex items-start",children:[(0,s.jsx)("div",{className:"jsx-2c815b0a4b02534e z-10 mr-3 flex size-5 items-center justify-center",children:"completed"===a?(0,s.jsx)("div",{className:"jsx-2c815b0a4b02534e flex size-4 items-center justify-center rounded-full bg-purple-primary dark:bg-primary",children:(0,s.jsx)("svg",{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",className:"jsx-2c815b0a4b02534e size-3 text-black",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7",className:"jsx-2c815b0a4b02534e"})})}):"current"===a?(0,s.jsx)("div",{className:"jsx-2c815b0a4b02534e size-4 animate-spin rounded-full border-2 border-gray-400 border-t-transparent"}):(0,s.jsx)("div",{className:"jsx-2c815b0a4b02534e size-2 rounded-full bg-gray-400 opacity-30"})}),(0,s.jsxs)("div",{className:"jsx-2c815b0a4b02534e flex-1 pt-0",children:[o&&(0,s.jsx)("div",{className:"jsx-2c815b0a4b02534e font-poppins text-sm font-normal leading-[24px] tracking-normal text-black dark:text-white",children:o}),l.length>0?(0,s.jsx)("div",{className:"jsx-2c815b0a4b02534e mt-1 space-y-1",children:l.map((e,t)=>(0,s.jsx)("div",{className:"jsx-2c815b0a4b02534e font-poppins text-[13px] font-normal leading-[20px] tracking-normal text-gray-700 opacity-70 dark:text-gray-400",children:(0,s.jsx)(eF,{text:e,speed:15,isActive:"current"===a})},t))}):(0,s.jsx)("div",{className:"jsx-2c815b0a4b02534e text-secondary-text/70 mt-1 text-[12px] leading-[18px]",children:"Getting the scoop on your travel wishes â dialing in y
1our vibe."}),eI.bv&&r&&eO.length?(0,s.jsx)("div",{className:"jsx-2c815b0a4b02534e mt-3 flex flex-wrap gap-2",children:eO.map((e,t)=>(0,s.jsxs)("span",{style:{backgroundColor:e.bgColor,color:e.color},className:"jsx-2c815b0a4b02534e inline-flex items-center gap-1 rounded-full px-2.5 py-1 text-[11px] font-medium",children:[e.label.startsWith("Insta")&&(0,s.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"jsx-2c815b0a4b02534e size-3",children:(0,s.jsx)("path",{d:"M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z",className:"jsx-2c815b0a4b02534e"})}),e.label.startsWith("Yout")&&(0,s.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"jsx-2c815b0a4b02534e size-3",children:(0,s.jsx)("path",{d:"M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z",className:"jsx-2c815b0a4b02534e"})}),e.label]},"".concat(e.label,"-").concat(t)))}):null]}),t<i.length-1&&(0,s.jsx)("div",{className:"jsx-2c815b0a4b02534e "+"absolute bottom-0 left-2.5 top-5 z-0 w-0.5 ".concat("completed"===a?"bg-purple-primary opacity-60 dark:bg-primary":"bg-gray-400 opacity-20")})]},t)})}):(0,s.jsx)("div",{className:"jsx-2c815b0a4b02534e font-poppins text-[16px] font-normal leading-[24px] tracking-normal text-secondary-text",children:"No steps yet."})})]}),(0,s.jsx)(eT(),{id:"2c815b0a4b02534e",children:".shimmer.jsx-2c815b0a4b02534e{position:relative;overflow:hidden;background:-webkit-linear-gradient(left,#222 25%,#444 50%,#222 75%);background:-moz-linear-gradient(left,#222 25%,#444 50%,#222 75%);background:-o-linear-gradient(left,#222 25%,#444 50%,#222 75%);background:linear-gradient(90deg,#222 25%,#444 50%,#222 75%);-webkit-background-size:200%100%;-moz-background-size:200%100%;-o-background-size:200%100%;background-size:200%100%;-webkit-animation:shimmer 1.5s infinite linear;-moz-animation:shimmer 1.5s infinite linear;-o-animation:shimmer 1.5s infinite linear;animation:shimmer 1.5s infinite linear;color:transparent!important;-webkit-background-clip:text;background-clip:text}@-webkit-keyframes shimmer{0%{background-position:200%0}100%{background-position:-200%0}}@-moz-keyframes shimmer{0%{background-position:200%0}100%{background-position:-200%0}}@-o-keyframes shimmer{0%{background-position:200%0}100%{background-position:-200%0}}@keyframes shimmer{0%{background-position:200%0}100%{background-position:-200%0}}"})]})},eq=(0,r.memo)(e=>{let{text:t,onComplete:a,onTick:l,onCityClick:i}=e,[n,d]=(0,r.useState)(""),[c,m]=(0,r.useState)(0);return(0,r.useEffect)(()=>{if(t&&c<t.length){let e=setTimeout(()=>{d(e=>e+t[c]),m(e=>e+1),null==l||l()},5);return()=>clearTimeout(e)}c===(null==t?void 0:t.length)&&a&&(null==t?void 0:t.length)>0&&a()},[c,t,a,l]),(0,s.jsx)("span",{className:"whitespace-pre-wrap",children:n.split(/<city_name>(.*?)<\/city_name>/g).map((e,t)=>t%2==1?(0,s.jsx)("button",{className:"inline font-semibold text-purple-primary hover:underline dark:text-primary",onClick:()=>i(e),children:e},t):(0,s.jsx)("span",{dangerouslySetInnerHTML:{__html:(0,o.P)(e)}},t))})});eq.displayName="TypeWriter";let eZ=(0,r.memo)(e=>{var t,a,l,m,u,p;let{message:x,isFirstRender:h,onContentChange:f,onTypewriterTick:g,token:v,pendingData:b,onDynamicFormSubmit:y,isSubmitting:j,onSendMessage:_,feedbackStatus:k,onFeedbackUpdate:w}=e,[C,A]=(0,r.useState)(!1),z=(0,r.useRef)(0);z.current++;let[S,D]=(0,r.useState)(null),[E,M]=(0,r.useState)(!1),T=(0,i.a)("(min-width: 768px)"),I=(0,n.MM)("thinking-sources"),F=(x.thinking_steps&&x.thinking_steps.length>0?x.thinking_steps.map(e=>
1({status:"thinking",step:e.step,title:e.title,description:e.title,descriptions:e.descriptions})):x.streamingData)||[];(0,r.useEffect)(()=>{"SYSTEM"===x.role&&x.thinking_steps},[x.id,x.role,x.thinking_steps]);let O=(0,r.useCallback)(e=>{D(e),M(!0)},[]),L=(0,r.useCallback)((e,t)=>e?e.split(/<city_name>(.*?)<\/city_name>/g).map((e,t)=>t%2==1?(0,s.jsx)("button",{className:"inline font-semibold text-purple-primary hover:underline dark:text-primary",onClick:()=>O(e),children:e},t):(0,s.jsx)("span",{dangerouslySetInnerHTML:{__html:(0,o.P)(e)}},t)):null,[O]);if("USER"===x.role)return x.user_message&&(x.user_message.includes("Provided parameters:")||x.user_message.includes("trip_metadata:")||x.user_message.includes("backend context")||x.user_message.startsWith("Provided parameters:"))?null:(0,s.jsx)("div",{className:"mb-4 flex w-full justify-end",children:(0,s.jsx)("div",{className:"max-w-[90%] whitespace-pre-wrap rounded-2xl bg-card px-4 py-3 text-left font-poppins text-base leading-relaxed text-primary-text",children:x.user_message})});if("error"===x.status)return(0,s.jsx)("div",{className:"mb-4 flex w-full justify-start",children:(0,s.jsx)("div",{className:"flex flex-col items-start",children:(0,s.jsx)("div",{className:"max-w-[80%] whitespace-pre-wrap rounded-2xl bg-card px-4 py-3 text-base leading-relaxed text-destructive",children:(null===(p=x.ai_response)||void 0===p?void 0:p.llm_response_to_user)||"Sorry, there was an error processing your request."})})});if("thinking"===x.status)return(0,s.jsx)(eL,{streamingData:x.streamingData});if(x.status&&"completed"!==x.status&&"SYSTEM"===x.role)return(0,s.jsx)("div",{className:"mb-4 flex w-full justify-start py-12",children:(0,s.jsx)("div",{className:"flex max-w-[80%] items-center gap-2",children:(0,s.jsxs)("div",{className:"flex space-x-1",children:[(0,s.jsx)("div",{className:"size-2 animate-bounce rounded-full bg-gray-400",style:{animationDelay:"0ms"}}),(0,s.jsx)("div",{className:"size-2 animate-bounce rounded-full bg-gray-400",style:{animationDelay:"150ms"}}),(0,s.jsx)("div",{className:"size-2 animate-bounce rounded-full bg-gray-400",style:{animationDelay:"300ms"}})]})})});let q=(null===(t=x.ai_response)||void 0===t?void 0:t.human_approval_request)||(null===(a=x.streamingData)||void 0===a?void 0:a.some(e=>"human_approval_required"===e.status&&e.approval_request)),Z=(null==b?void 0:b.status)==="human_approval_required"&&q,R=x.trip_id||(null===(l=x.streamingData)||void 0===l?void 0:l.some(e=>"response"===e.status&&e.trip_data)),P=x.hotel_selection_id||(null===(m=x.streamingData)||void 0===m?void 0:m.some(e=>"response"===e.status&&e.hotel_selection_id)),B=x.destination_research_id||(null===(u=x.streamingData)||void 0===u?void 0:u.some(e=>"response"===e.status&&e.destination_research_id)),Y=F.length>0,K="completed"===x.status||!x.status&&"SYSTEM"===x.role&&F.length>0,W=!!Y&&K;if(R)return(0,s.jsxs)("div",{className:"mb-4 flex w-full justify-start",children:[(0,s.jsxs)("div",{className:"flex w-full flex-col items-start",children:[(0,s.jsx)(eD,{message:x,onContentChange:f,token:v,onSendMessage:_}),W&&(0,s.jsx)("div",{className:"mt-3",children:(0,s.jsx)(eI.JD,{onClick:()=>I.open(),isDesktop:T,streamingData:F,messageId:x.identifier||x.id})})]}),!T&&(0,s.jsx)(eI.NY,{isOpen:I.isOpen,onClose:()=>I.close(),streamingData:F})]});if(P){let e=x.identifier&&!x.identifier.startsWith("msg_")&&!x.identifier.startsWith("research_")&&!x.identifier.startsWith("hotel_");return(0,s.jsxs)("div",{className:"mb-4 flex w-full justify-start",children:[(0,s.jsxs)("div",{className:"flex w-full flex-col items-start",children:[(0,s.jsx)(ew.Z,{message:x,onContentChange:f,token:v,hideLikeDislike:!0}),(e||W)&&(0,s.jsxs)("div",{className:"mt-10 flex items-center gap-3",children:[e&&(0,s.jsx)(eE.Z,{identifier:x.identifier,token:v,feedbackStatus:k,onFeedbackUpdate:w}),W&&(0,s.jsx)("div",{className:e?"-mt-9":"",children:(0,s.jsx)(eI.JD,{onClick:()=>I.open(),isDesktop:T,streamingData:F,messageId:x.identifier||x.id})})]})]}),!T&&(0,s.jsx)(eI.NY,{isOpen:I.isOpen,onClose:()=>I.close(),streamingData:F})]})}if(B){let e=x.identifier&&!x.identifier.startsWith("msg_")&&!x.identifier.startsWith("research_")&&!x.identifier.startsWith("hotel_");return(0,s.jsxs)("div",{className:"mb-4 flex w-full justify-start",children:[(0,s.jsxs)("div",{className:"flex w-full flex-col items-start",children:[(0,s.jsx)(c.Z,{message:x,onContentChange:f,token:v,onSendMessage:_,hideLikeDislike:!0}),(e||W)&&(0,s.jsxs)("div",{className:"mt-10 flex items-center gap-3",children:[e&&(0,s.jsx)(eE.Z,{identifier:x.identifier,token:v,feedbackStatus:k,onFeedbackUpdate:w}),W&&(0,s.jsx)("div",{className:e?"-mt-9":"",children:(0,s.jsx)(eI.JD,{onClick:()=>I.open(),isDesktop:T,streamingData:F,messageId:x.identifier||x.id})})]})]}),!T&&(0,s.jsx)(eI.NY,{isOpen:I.isOpen,onClose:()=>I.close(),streamingData:F})]})}if(q&&!Z)return null;if(Z&&(null==b?void 0:b.approval_request)){let e=b.approval_request;if("itinerary_parameter_collection_with_pois"===e.type)return(0,s.jsx)("div",{className:"mb-4 flex w-full justify-start",children:(0,s.jsxs)("div",{className:"flex flex-col items-start gap-2",children:[(0,s.jsx)("p",{className:"whitespace-pre-wrap font-poppins text-[16px] font-normal leading-[24px] tracking-normal text-primary-text",children:e.message}),(0,s.jsx)(ek,{type:"itinerary",title:e.title||"Tell me about your trip",message:e.message,currentParameters:e.current_parameters||{},tripPlanData:e.trip_plan_data,fields:e.parameter_fields,loading:j||!1,onSubmit:async e=>{try{await (null==y?void 0:y({...e,approval_request_type:"itinerary_parameter_collection_with_pois"}))}catch(e){console.error("Failed to submit itinerary refinement:",e)}},onSkip:async t=>{try{let s=t||{};if(!t){var a;
1null===(a=e.parameter_fields)||void 0===a||a.forEach(e=>{if("multi-select"===e.type)s[e.name]=[];else if("number"===e.type){var t;s[e.name]=null!==(t=e.min)&&void 0!==t?t:0}else s[e.name]=""})}await (null==y?void 0:y({...s,approval_request_type:"itinerary_parameter_collection_with_pois"}))}catch(e){console.error("Failed to skip:",e)}},onCancel:async()=>{try{await (null==y?void 0:y({__cancellation:!0,approval_request_type:"user_cancellation"}))}catch(e){console.error("Failed to cancel trip:",e)}}})]})});if("itinerary_parameter_collection"===e.type)return(0,s.jsx)("div",{className:"mb-4 flex w-full justify-start",children:(0,s.jsx)("div",{className:"max-w-[80%] rounded-xl bg-muted p-4 text-sm text-muted-foreground",children:(0,s.jsx)(N,{title:e.title,message:e.message,fields:e.parameter_fields,loading:j||!1,onSubmit:async e=>{try{await (null==y?void 0:y(e))}catch(e){console.error("Failed to submit and stream:",e)}}})})});if("destination_research_refinement"===e.type)return(0,s.jsx)("div",{className:"mb-4 flex w-full justify-start",children:(0,s.jsxs)("div",{className:"flex flex-col items-start gap-2",children:[(0,s.jsx)("p",{className:"whitespace-pre-wrap font-poppins text-[16px] font-normal leading-[24px] tracking-normal text-primary-text",children:e.message}),(0,s.jsx)(ek,{type:"destination",title:e.title||"Tell me about the basic of your trip",message:e.message,currentParameters:e.current_parameters,tripPlanData:e.trip_plan_data,fields:e.parameter_fields,loading:j||!1,onSubmit:async t=>{try{var a;await (null==y?void 0:y({...t,approval_request_type:"destination_research_refinement",research_db_id:null===(a=e.current_parameters)||void 0===a?void 0:a.research_db_id}))}catch(e){console.error("Failed to submit destination refinement:",e)}},onSkip:async t=>{try{var a,s;let r=t||{};t||null===(s=e.parameter_fields)||void 0===s||s.forEach(e=>{if("multi-select"===e.type)r[e.name]=[];else if("number"===e.type){var t;r[e.name]=null!==(t=e.min)&&void 0!==t?t:0}else r[e.name]=""}),await (null==y?void 0:y({...r,approval_request_type:"destination_research_refinement",research_db_id:null===(a=e.current_parameters)||void 0===a?void 0:a.research_db_id}))}catch(e){console.error("Failed to skip:",e)}},onCancel:async()=>{try{await (null==y?void 0:y({__cancellation:!0,approval_request_type:"user_cancellation"}))}catch(e){console.error("Failed to cancel destination research:",e)}}})]})});if("hotel_parameter_refinement"===e.type)return(0,s.jsx)("div",{className:"mb-4 flex w-full justify-start",children:(0,s.jsxs)("div",{className:"flex flex-col items-start gap-2",children:[(0,s.jsx)("p",{className:"whitespace-pre-wrap font-poppins text-[16px] font-normal leading-[24px] tracking-normal text-primary-text",children:e.message}),(0,s.jsx)(ek,{type:"hotel",title:e.title||"Tell me about your hotel preferences",message:e.message,currentParameters:e.current_parameters,tripPlanData:e.trip_plan_data,fields:e.parameter_fields,loading:j||!1,onSubmit:async t=>{try{var a,s,r,l,i;await (null==y?void 0:y({...t,approval_request_type:"hotel_parameter_refinement",search_destination:null===(a=e.current_parameters)||void 0===a?void 0:a.search_destination,search_country:null===(s=e.current_parameters)||void 0===s?void 0:s.search_country,checkin_date:t.checkin_date||(null===(r=e.current_parameters)||void 0===r?void 0:r.checkin_date),checkout_date:t.checkout_date||(null===(l=e.current_parameters)||void 0===l?void 0:l.checkout_date),room_occupancies:t.room_occupancies||(null===(i=e.current_parameters)||void 0===i?void 0:i.room_occupancies)}))}catch(e){console.error("Failed to submit hotel refinement:",e)}},onSkip:async t=>{try{var a,s,r,l,i,n;let o=t||{};t||null===(n=e.parameter_fields)||void 0===n||n.forEach(e=>{if("multi-select"===e.type)o[e.name]=[];else if("number"===e.type){var t;o[e.name]=null!==(t=e.min)&&void 0!==t?t:0}else o[e.name]=""}),await (null==y?void 0:y({approval_request_type:"hotel_parameter_refinement",search_destination:null===(a=e.current_parameters)||void 0===a?void 0:a.search_destination,search_country:null===(s=e.current_parameters)||void 0===s?void 0:s.search_country,checkin_date:null===(r=e.current_parameters)||void 0===r?void 0:r.checkin_date,checkout_date:null===(l=e.current_parameters)||void 0===l?void 0:l.checkout_date,room_occupancies:null===(i=e.current_parameters)||void 0===i?void 0:i.room_occupancies,...o}))}catch(e){console.error("Failed to skip:",e)}},onCancel:async()=>{try{await (null==y?void 0:y({__cancellation:!0,approval_request_type:"user_cancellation"}))}catch(e){console.error("Failed to cancel hotel search:",e)}}})]})})}let V=F.length>0,J=(!h||C)&&x.ai_response.llm_response_to_user,Q=V&&K&&J;return(0,s.jsxs)("div",{className:"mb-4 flex w-full justify-start",children:[(0,s.jsxs)("div",{className:"flex w-full flex-col items-start",children:[(0,s.jsx)("div",{className:"whitespace-pre-wrap font-poppins text-base font-normal leading-[24px] tracking-normal text-primary-text",children:h&&x.ai_response.llm_response_to_user?(0,s.jsx)(eq,{text:x.ai_response.llm_response_to_user,onComplete:()=>{A(!0),f&&f()},onTick:g,onCityClick:O}):L(x.ai_response.llm_response_to_user,!1)}),J&&(0,s.jsxs)("div",{className:"mt-10 flex items-center gap-3",children:[(0,s.jsx)(eE.Z,{identifier:x.identifier,token:v,feedbackStatus:k,onFeedbackUpdate:w}),Q&&(0,s.jsx)("div",{className:"-mt-9",children:(0,s.jsx)(eI.JD,{onClick:()=>I.open(),isDesktop:T,streamingData:F,messageId:x.identifier||x.id})})]})]}),S&&(0,s.jsx)(d.Z,{open:E,onOpenChange:M,cityName:S}),!T&&(0,s.jsx)(eI.NY,{isOpen:I.isOpen,onClose:()=>I.close(),streamingData:F})]})},(e,t)=>e.message.id===t.message.id&&e.message.ai_response.llm_response_to_user===t.message.ai_response.llm_response_to_user&&e.message.status===t.message.status&&e.message.currentStep===t.message.currentStep&&e.message.trip_id===t.message.trip_id&&e.message.hotel_selection_id===t.message.hotel_selection_id&&e.message.destination_research_id===t.message.destination_research_id&&JSON.stringify(e.message.streamingData)===JSON.stringify(t.message.streamingData)&&JSON.stringify(e.message.ai_response.human_approval_request)===JSON.stringify(t.message.ai_response.human_approval_request)&&e.isFirstRender===t.isFirstRender&&e.token===t.token&&e.pendingData===t.pendingData&&e.isSubmitting===t.isSubmitting);eZ.displayName="ChatMessageItem";let eR=(0,r.memo)(e=>{let{chatMessages:t,isLoadingMessages:a,isHistoryConversation:i=!1,onTypewriterComplete:n,onTypewriterTick:o,token:d,currentConversationId:c,onDynamicFormSubmit:m,isSubmitting:u,pendingData:p,onSendMessage:x,messageFeedback:h={},onFeedbackUpdate:f}=e,[g,v]=(0,r.useState)(new Set),b=(0,r.useRef)(0),y=(0,r.useRef)([]),j=(0,r.useRef)(new Set),_=(0,r.useCallback)(()=>{null==n||n()},[n]);return((0,r.useEffect)(()=>{var e,a;let s=t.length;if(y.current.length>0&&t.length>0&&(null===(e=y.current[0])||void 0===e?void 0:e.id)!==(null===(a=t[0])||void 0===a?void 0:a.id)||i){v(new Set(t.map(e=>e.id.toString()))),b.current=s,y.current=[...t];return}if(s>b.current){let e=t.slice(b.current);setTimeout(()=>{v(t=>{let a=new Set(t);
1return e.forEach(e=>{"SYSTEM"===e.role&&"completed"===e.status&&a.add(null==e?void 0:e.id.toString())}),a})},100)}b.current=s,y.current=[...t]},[t,i]),(0,r.useEffect)(()=>{t.forEach(e=>{var t,a,s;if("completed"!==e.status)return;let r="".concat(e.id,"-").concat(e.role);if(j.current.has(r))return;if(e.trip_id){l.u.emit("panel_content_update",{type:"trip",data:e,id:e.trip_id}),j.current.add(r);return}if((null===(a=e.streamingData)||void 0===a?void 0:null===(t=a.find(e=>e.hotel_selection_id))||void 0===t?void 0:t.hotel_selection_id)||e.hotel_selection_id){j.current.add(r);return}let i=e.destination_research_id;if(!i&&(null===(s=e.streamingData)||void 0===s?void 0:s.length)){let t=e.streamingData.find(e=>e.destination_research_id);(null==t?void 0:t.destination_research_id)&&(i=t.destination_research_id)}if(i){j.current.add(r);return}})},[t]),(0,r.useEffect)(()=>{j.current.clear()},[c]),a)?(0,s.jsx)("div",{className:"flex h-full items-center justify-center p-2 text-gray-500",children:(0,s.jsx)("p",{children:"Loading conversation..."})}):0===t.length?(0,s.jsx)("div",{className:"flex h-full items-center justify-center p-2 text-gray-500",children:(0,s.jsx)("p",{children:"Start a conversation..."})}):(0,s.jsx)("div",{className:"flex flex-col px-1 py-4 md:px-2",children:t.map(e=>{let t=!g.has(e.id.toString())&&"SYSTEM"===e.role&&"completed"===e.status&&!i;return(0,s.jsx)(eZ,{message:e,isFirstRender:t,onContentChange:_,onTypewriterTick:o,token:d,pendingData:p,onDynamicFormSubmit:m,isSubmitting:u,onSendMessage:x,feedbackStatus:h[e.identifier||""],onFeedbackUpdate:f},e.id)})})},(e,t)=>e.isLoadingMessages===t.isLoadingMessages&&e.chatMessages.length===t.chatMessages.length&&e.isHistoryConversation===t.isHistoryConversation&&JSON.stringify(e.chatMessages)===JSON.stringify(t.chatMessages)&&e.token===t.token&&e.pendingData===t.pendingData&&e.isSubmitting===t.isSubmitting);eR.displayName="ChatMessagesList";var eP=eR},39823:function(e,t,a){var s=a(57437),r=a(32660),l=a(52048),i=a(58293),n=a(1
15863),o=a(2265),d=a(54887),c=a(69121),m=a(9555),u=a(93022),p=a(18453),x=a(64065),h=a(3844),f=a(43155);t.Z=e=>{var t,a,g,v,b,y;let{open:j,onOpenChange:_,poi:N}=e,[k,w]=(0,o.useState)("list"),[C,A]=(0,o.useState)([]),[z,S]=(0,o.useState)(null),[D,E]=(0,o.useState)(!1);(0,o.useEffect)(()=>{(async()=>{if(j&&N){if((0,x.R)(N)&&N.identifier){E(!0);try{let e=await (0,p.v)(N.identifier,"attraction","recommendation_id");S(e)}catch(e){console.error("Failed to fetch POI AI insights:",e),S(null)}finally{E(!1)}}else S(null)}})()},[j,N]);let M=e=>{if(e===k)return;let t={tab:"Overview",mode:k};A(e=>(0,c.G)({previousStates:e,newState:t,preventAllDuplicates:!0})),w(e)};if(!j||!N)return null;let T=(0,x.R)(N),I=(0,x.u)(N)?null===(a=N.google_place_data)||void 0===a?void 0:null===(t=a.geometry)||void 0===t?void 0:t.location:null,F=(null==z?void 0:null===(g=z.place)||void 0===g?void 0:g.name)||N.name,O=(null==z?void 0:null===(v=z.place)||void 0===v?void 0:v.address)||((0,x.u)(N)?N.address:""),L=(null==z?void 0:null===(b=z.place)||void 0===b?void 0:b.description)||(null==z?void 0:null===(y=z.place)||void 0===y?void 0:y.ai_summary)||((0,x.u)(N)?N.description:(0,x.R)(N)?N.selection_rationale:""),q=(0,s.jsx)("div",{className:"fixed inset-0 z-[300] bg-background text-primary-text",children:(0,s.jsxs)("div",{className:"relative mx-auto flex size-full max-w-[450px] flex-col",children:[(0,s.jsx)("div",{className:"shrink-0 p-4",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{onClick:()=>{C.length>0?(w(C[C.length-1].mode),A(e=>e.slice(0,-1))):_(!1)},className:"p-2",children:(0,s.jsx)(r.Z,{size:24})}),(0,s.jsx)("h1",{className:"line-clamp-1 text-xl font-bold",children:F})]}),I&&(0,s.jsx)("button",{onClick:()=>M("list"===k?"map":"list"),className:"p-2",children:"list"===k?(0,s.jsx)(l.Z,{size:24}):(0,s.jsx)(i.Z,{size:24})})]})}),(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto scrollbar-hide",children:["list"===k&&(0,s.jsxs)(s.Fragment,{children:[D&&T&&(0,s.jsxs)("div",{className:"space-y-6 p-4",children:[(0,s.jsx)(u.O,{className:"h-64 w-full rounded-xl"}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)(u.O,{className:"h-8 w-2/3"}),(0,s.jsx)(u.O,{className:"h-4 w-1/3"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(u.O,{className:"h-5 w-12"}),(0,s.jsx)(u.O,{className:"h-5 w-24"}),(0,s.jsx)(u.O,{className:"h-4 w-20"})]}),(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)(u.O,{className:"size-4 shrink-0"}),(0,s.jsx)(u.O,{className:"h-4 w-3/4"})]}),(0,s.jsx)(u.O,{className:"h-12 w-full rounded-lg"}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)(u.O,{className:"h-5 w-1/4"}),Array.from({length:4}).map((e,t)=>(0,s.jsx)(u.O,{className:"h-4 w-full"},t))]})]}),!D&&(0,s.jsx)(f.Z,{poi:N,onViewModeChange:w,poiAiInsights:z})]}),"map"===k&&(0,s.jsx)("div",{className:"h-full",children:I?(0,s.jsxs)("div",{className:"size-full",children:[(0,s.jsx)(h.Z,{center:I,zoom:14,markerPosition:I}),(0,s.jsx)(m._,{hotelName:F,address:O,description:L||"No description available."})]}):(0,s.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(n.Z,{className:"size-6 animate-spin"}),(0,s.jsx)("span",{className:"text-sm text-secondary-text",children:"Loading map..."})]})})})]})]})});return(0,d.createPortal)(q,document.body)}},96395:function(e,t,a){a.d(t,{JD:function(){return p},NY:function(){return u},bv:function(){return n},sj:function(){return m}});var s=a(57437),r=a(32660),l=a(33145);a(2265);var i=a(17917);let n=!1,o=e=>e&&0!==e.length?e.filter(e=>"thinking"===e.status&&!!e.title).map(e=>{var t;return{text:null!==(t=e.title)&&void 0!==t?t:"",completed:!0,additionalDescriptions:e.descriptions}}):[],d=()=>[{title:"This hidden cafe in Kasol will blow your mind",description:"Locals swear by this riverside caf\xe9 tucked between pine trails â cozy vibes, Israeli platters, and views that make time stop.",platform:"instagram"},{title:"Delhi to Kasol: Full Trip",description:"A complete travel vlog covering routes, pit stops, and scenic detours from Delhi to Kasol â perfect for first-timers planning the...",platform:"youtube"},{title:"Kasol Travel Guide: Where to go, stay, eat, shop",description:"A detailed guide to Kasol's best caf\xe9s, homestays, treks, and flea markets â from riverside stays to must-try local food.",platform:"ndtv"},{title:"This hidden cafe in Kasol will blow your mind",description:"Locals swear by this riverside caf\xe9 tucked between pine trails â
1cozy vibes, Israeli platters, and views that make time stop.",platform:"instagram"},{title:"Delhi to Kasol: Full Trip",description:"A complete travel vlog covering routes, pit stops, and scenic detours from Delhi to Kasol â perfect for first-timers planning the...",platform:"youtube"},{title:"Kasol Travel Guide: Where to go, stay, eat, shop",description:"A detailed guide to Kasol's best caf\xe9s, homestays, treks, and flea markets â from riverside stays to must-try local food.",platform:"ndtv"}],c=e=>{let{platform:t}=e;switch(t){case"instagram":return(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("svg",{className:"size-4",viewBox:"0 0 24 24",fill:"#E1306C",children:(0,s.jsx)("path",{d:"M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"})}),(0,s.jsx)("span",{className:"text-xs text-gray-500",children:"Instagram"})]});case"youtube":return(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("svg",{className:"size-4",viewBox:"0 0 24 24",fill:"#FF0000",children:(0,s.jsx)("path",{d:"M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"})}),(0,s.jsx)("span",{className:"text-xs text-gray-500",children:"Youtube"})]});case"ndtv":return(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("svg",{className:"size-4 text-gray-500",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,s.jsx)("path",{d:"M4 6h16M4 12h16M4 18h16"})}),(0,s.jsx)("span",{className:"text-xs text-gray-500",children:"NDTV"})]});case"tripadvisor":return(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("svg",{className:"size-4",viewBox:"0 0 24 24",fill:"#00AF87",children:(0,s.jsx)("circle",{cx:"12",cy:"12",r:"10"})}),(0,s.jsx)("span",{className:"text-xs text-gray-500",children:"TripAdvisor"})]});default:return(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsxs)("svg",{className:"size-4 text-gray-500",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,s.jsx)("path",{d:"M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]}),(0,s.jsx)("span",{className:"text-xs text-gray-500",children:"Web"})]})}},m=e=>{let{onClose:t,hideHeader:a=!1,streamingData:l}=e,i=o(l),m=d();return(0,s.jsxs)("div",{className:"flex h-full flex-col",children:[!a&&(0,s.jsxs)("div",{className:"sticky top-0 z-10 flex items-center gap-3 border-b border-gray-100 bg-white p-4 dark:border-gray-800 dark:bg-gray-900",children:[(0,s.jsx)("button",{onClick:t,className:"rounded-full p-1 text-gray-500 transition-colors hover:bg-gray-100 dark:hover:bg-gray-800",children:(0,s.jsx)(r.Z,{className:"size-5"})}),(0,s.jsx)("span",{className:"font-semibold text-gray-800 dark:text-gray-100",children:"Thinking and sources"})]}),(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto p-5",children:[(0,s.jsxs)("div",{className:"mb-8",children:[(0,s.jsx)("h3",{className:"mb-4 text-base font-semibold text-gray-800 dark:text-gray-100",children:"Overview: How I Planned Your Trip"}),i.length>0?(0,s.jsx)("div",{className:"relative",children:i.map((e,t)=>{let a=t===i.length-1;return(0,s.jsxs)("div",{className:"relative mb-4 flex items-start gap-3",children:[(0,s.jsx)("div",{className:"z-10 mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full bg-purple-500",children:(0,s.jsx)("svg",{className:"size-3 text-white",f
1ill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M5 13l4 4L19 7"})})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm leading-relaxed text-gray-900 dark:text-gray-100",children:e.text}),e.additionalDescriptions&&e.additionalDescriptions.length>0&&(0,s.jsx)("div",{className:"mt-1 space-y-0.5",children:e.additionalDescriptions.map((e,t)=>(0,s.jsx)("p",{className:"text-sm leading-relaxed text-gray-400 dark:text-gray-400",children:e},t))})]}),!a&&(0,s.jsx)("div",{className:"absolute bottom-0 left-2.5 top-5 z-0 w-0.5 bg-purple-primary opacity-60"})]},t)})}):(0,s.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"No thinking steps available."})]}),n&&(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"mb-4 text-base font-semibold text-gray-800 dark:text-gray-100",children:"Sources Analysed"}),(0,s.jsx)("div",{className:"space-y-4",children:m.map((e,t)=>(0,s.jsxs)("div",{className:"rounded-xl border border-gray-100 bg-gray-50/50 p-4 dark:border-gray-800 dark:bg-gray-800/50",children:[(0,s.jsx)("h4",{className:"mb-1.5 font-medium text-gray-800 dark:text-gray-100",children:e.title}),(0,s.jsx)("p",{className:"mb-3 text-sm leading-relaxed text-gray-500 dark:text-gray-400",children:e.description}),(0,s.jsx)(c,{platform:e.platform})]},t))})]})]})]})},u=e=>{let{isOpen:t,onClose:a,streamingData:r}=e;return t?(0,s.jsx)("div",{className:"fixed inset-0 z-[999] bg-white dark:bg-gray-900 md:hidden",children:(0,s.jsx)(m,{onClose:a,streamingData:r})}):null},p=e=>{let{onClick:t,isDesktop:a=!1,streamingData:r,messageId:n}=e;return o(r).length>=1?(0,s.jsxs)("button",{onClick:()=>{a?i.u.emit("thinking_sources_open",{streamingData:r,messageId:n}):t()},className:"inline-flex items-center gap-1.5 rounded-full border border-gray-300 bg-white px-3 py-1.5 text-xs font-medium text-gray-600 shadow-sm transition-all hover:border-purple-200 hover:bg-purple-50 hover:text-purple-600 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-300 dark:hover:border-purple-800 dark:hover:bg-purple-900/20 dark:hover:text-purple-400",children:[(0,s.jsx)(l.default,{src:"/sourceschip.webp",alt:"Thinking & Sources",width:28,height:28}),"Sources"]}):null}},69121:function(e,t,a){a.d(t,{G:function(){return r}});let s=(e,t)=>e.tab===t.tab&&e.mode===t.mode,r=e=>{let t,{previousStates:a,newState:r,preventAllDuplicates:l=!1,maxHistoryLength:i=10}=e;return a.length>0&&s(a[a.length-1],r)?a:(t=l?[...a.filter(e=>!s(e,r)),r]:[...a,r]).length>i?t.slice(-i):t}},13856:function(e,t,a){a.d(t,{$$:function(){return n},J7:function(){return l},PR:function(){return r},qM:function(){return i}}),a(83079);var s=a(12119),r=(0,s.$)("e0902b2a80b5d6aad1d402eee3e582c89be031fc"),l=(0,s.$)("ec4393fc3bd04445cd36378012a9f1c2ac24ffff"),i=(0,s.$)("623804c705ce8d2162daeaeebe29470f9658a9cf"),n=(0,s.$)("943e32d63b7ff6c174ae53b3257121915e48f2ab")},22953:function(e,t,a){var s=a(57437),r=a(86595),l=a(33145);a(2265);var i=a(19060);t.Z=e=>{let{poi:t,onChange:a}=e,n="number"!=typeof t.rating||Number.isNaN(t.rating)?"N/A":t.rating.toFixed(1);return(0,s.jsx)("div",{className:"overflow-hidden rounded-2xl bg-[--hitl-select-input] p-3 shadow-sm transition hover:shadow-lg dark:bg-[#242424]",children:(0,s.jsxs)("div",{className:"flex gap-3",children:[(0,s.jsx)("div",{className:"relative size-20 shrink-0 overflow-hidden rounded-lg bg-[--muted]",children:(null==t?void 0:t.thumbnail)?(0,s.jsx)(l.default,{src:"https://places.googleapis.com/v1/".concat(t.thumbnail,"/media?key=").concat("AIzaSyCYKpGyutsyjzZWd7D6hRU4CbGj8SLpVCw","&maxWidthPx=400"),alt:"".concat(t.name," thumbnail"),width:100,height:100,className:"size-full object-cover",onError:e=>{console.error("Failed to load image:",t.thumbnail)}}):(0,s.jsx)("div",{className:"flex size-full items-center justify-center text-[10px] text-[--secondary-text]",children:"No image"})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,s.jsx)("p",{className:"truncate text-sm font-medium text-[--primary-text]",children:t.name}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1 text-sm font-medium text-[--primary-text]",children:[(0,s.jsx)(r.Z,{className:"size-4 text-amber-400",fill:"#fbbf24"}),(0,s.jsx)("span",{children:n})]}),"number"==typeof t.review_count&&(0,s.jsxs)("span",{className:"text-sm font-normal text-primary-text opacity-75",children:["(",t.review_count," ratings)"]})]})]}),(0,s.jsx)(i.X,{checked:"SELECTED"===t.status,onCheckedChange:e=>a(!!e),"aria-label":"Select ".concat(t.name),className:"mt-1 size-5 shrink-0 rounded-full border-2 border-[--primary-text] data-[state=checked]:border-[--purple-primary] data-[state=checked]:bg-transparent data-[state=checked]:text-[--purple-primary]"})]}),t.address&&(0,s.jsx)("p",{className:"text-xs leading-relaxed text-[--secondary-text]",children:t.address}),t.is_preselected&&(0,s.jsx)("p",{className:"text-[11px] italic text-[--purple-primary]",children:"Added from our chat"}),!t.is_preselected&&t.user_notes&&(0,s.jsx)("p",{className:"text-[10px] italic text-[--secondary-text]",children:t.user_notes})]})]})})}},63508:function(e,t,a){a.d(t,{w:function(){return n}});var s=a(57437),r=a(33145),l=a(2265),i=a(52841);let n=e=>{let{photoReference:t,photoUri:a,fallbackSrc:n="/city/delhi.webp",alt:o,className:d="size-full object-cover",maxWidth:c=4
100,filename:m="lazy-image.tsx",placeholder:u,priority:p=!1,sizes:x="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw",quality:h=85}=e,[f,g]=(0,l.useState)(!1),[v,b]=(0,l.useState)(!1),{ref:y,hasIntersected:j}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{threshold:t=.1,rootMargin:a="0px",freezeOnceVisible:s=!0}=e,[r,i]=(0,l.useState)(!1),[n,o]=(0,l.useState)(!1),d=(0,l.useRef)(null);return(0,l.useEffect)(()=>{let e=d.current;if(!e||n&&s)return;let r=new IntersectionObserver(e=>{let[t]=e,a=t.isIntersecting;i(a),a&&!n&&o(!0)},{threshold:t,rootMargin:a});return r.observe(e),()=>{r.unobserve(e)}},[t,a,n,s]),{ref:d,isIntersecting:r,hasIntersected:n}}({threshold:.1,rootMargin:"50px",freezeOnceVisible:!0}),_=p||j,N=l.useMemo(()=>_?t?(0,i.v)(t,c):a||n:n,[_,t,a,n,c]);return(0,s.jsxs)("div",{ref:y,className:"relative ".concat(d),children:[!_&&u&&(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-200",children:u}),(0,s.jsx)(r.default,{src:N,alt:o,fill:!0,
1className:"".concat(!f&&_?"opacity-0":"opacity-100"," transition-opacity duration-300"),onLoad:()=>{g(!0)},onError:()=>{b(!0)},loading:p?"eager":"lazy",sizes:x,quality:h,placeholder:"blur",blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwCdABmX/9k="}),v&&(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-200 text-gray-500",children:(0,s.jsx)("span",{className:"text-xs",children:"Image unavailable"})})]})}},35974:function(e,t,a){a.d(t,{C:function(){return n}});var s=a(57437),r=a(77712);a(2265);var l=a(94508);let i=(0,r.j)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"hover:bg-primary/80 border-transparent bg-primary text-primary-foreground shadow",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"hover:bg-destructive/80 border-transparent bg-destructive text-destructive-foreground shadow",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function n(e){let{className:t,variant:a,...r}=e;return(0,s.jsx)("div",{className:(0,l.cn)(i({variant:a}),t),...r})}},95186:function(e,t,a){a.d(t,{I:function(){return i}});var s=a(57437),r=a(2265),l=a(94508);let i=r.forwardRef((e,t)=>{let{className:a,type:r,...i}=e;return(0,s.jsx)("input",{type:r,className:(0,l.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",a),ref:t,...i})});i.displayName="Input"},32759:function(e,t,a){a.d(t,{Progress:function(){return n}});var s=a(57437),r=a(60610),l=a(2265),i=a(94508);let n=l.forwardRef((e,t)=>{let{className:a,indicatorClassName:l,value:n,...o}=e;return(0,s.jsx)(r.fC,{ref:t,className:(0,i.cn)("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",a),...o,children:(0,s.jsx)(r.z$,{className:(0,i.cn)("h-full w-full flex-1 bg-primary transition-all",l),style:{transform:"translateX(-".concat(100-(n||0),"%)")}})})});n.displayName=r.fC.displayName},85897:function(e,t,a){a.d(t,{i:function(){return n}});var s=a(57437),r=a(67912),l=a(2265),i=a(94508);let n=l.forwardRef((e,t)=>{let{className:a,thumbClassName:n,rangeClassName:o,...d}=e,c=Array.isArray(d.value)?d.value:[d.min,d.max];return(0,s.jsxs)(r.fC,{ref:t,className:(0,i.cn)("relative flex w-full touch-none select-none items-center",a),...d,children:[(0,s.jsx)(r.fQ,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:(0,s.jsx)(r.e6,{className:(0,i.cn)("absolute h-full bg-primary",o)})}),c.map((e,t)=>(0,s.jsx)(l.Fragment,{children:(0,s.jsx)(r.bU,{className:(0,i.cn)("block size-4 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",n)})},t))]})});n.displayName=r.fC.displayName},12339:function(e,t,a){a.d(t,{Tabs:function(){return n},TabsContent:function(){return c},TabsList:function(){return o},TabsTrigger:function(){return d}});var s=a(57437),r=a(41312),l=a(2265),i=a(94508);let n=r.fC,o=l.forwardRef((e,t)=>{let{className:a,...l}=e;return(0,s.jsx)(r.aV,{ref:t,className:(0,i.cn)("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",a),...l})});o.displayName=r.aV.displayName;let d=l.forwardRef((e,t)=>{let{className:a,...l}=e;return(0,s.jsx)(r.xz,{ref:t,className:(0,i.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",a),...l})});d.displayName=r.xz.displayName;let c=l.forwardRef((e,t)=>
1{let{className:a,...l}=e;return(0,s.jsx)(r.VY,{ref:t,className:(0,i.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a),...l})});c.displayName=r.VY.displayName}}]);
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.