PageSourceSearch

https://travelese.ai/_next/static/chunks/2u6-6k8944xsg.js?dpl=a2e84b1661c86897de0de8e6b24bc65b169517d7

js travelese.ai collected 2026-10-05 15:55:55 UTC 40,977 bytes, 4 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="2e8d6e0a-3408-886e-d2f2-8cbd09878deb")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,903839,e=>{"use strict";var t=e.i(618566),r=e.i(271645);function n(e){return"string"==typeof e&&e.trim()?e:Array.isArray(e)&&"string"==typeof e[0]&&e[0].trim()?e[0]:null}e.s(["useFlightSearchParams",0,function(){let e=(0,t.useRouter)(),l=(0,t.usePathname)(),s=(0,t.useParams)(),o=n(s?.chatId),a=n(s?.flightSearchId)??function(e){if(!e)return null;let t=e.match(/\/flight-search\/([^/]+)\/?$/);if(!t?.[1])return null;try{return decodeURIComponent(t[1])}catch{return t[1]}}(l),i=(0,r.useMemo)(()=>o?`/chat/${o}`:null,[o]);return{flightSearchId:a,isOpen:!!a,open:(0,r.useCallback)(t=>{t&&i&&e.push(`${i}/flight-search/${encodeURIComponent(t)}`)},[i,e]),close:(0,r.useCallback)(()=>{i&&l!==i&&e.replace(i)},[i,l,e])}}])},601051,914123,462229,641302,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(769464),l=e.i(182050);let s=r.forwardRef((e,t)=>r.createElement(n.default,{ref:t,...e,weights:l.default}));function o(...e){let t={};for(let n of e)if(n)for(let e of Object.keys(n)){var r;let l=n[e];if(void 0===l)continue;let s=t[e];"className"===e?t[e]=[s,l].filter(Boolean).join(" "):"style"===e?t[e]={...s,...l}:"ref"===e?t[e]=a(s,l):(r=e,/^on[A-Z]/.test(r)&&"function"==typeof s&&"function"==typeof l)?t[e]=function(e,t){return function(r){e(r),r.defaultPrevented||t(r)}}(l,s):t[e]=l}return t}function a(...e){let t=e.filter(Boolean);if(0!==t.length)return e=>{for(let r of t)"function"==typeof r?r(e):r&&(r.current=e)}}s.displayName="ArrowDownIcon";var i=new Set(["ArrowDown","ArrowUp","End","Home","PageDown","PageUp"," "]),c={start:!1,end:!1},u={currentAnchorId:null,visibleMessageIds:[]};function d(e,t){return Array.from(e.children).filter(e=>e instanceof HTMLElement&&e!==t)}function f(e,t){let r=e.getBoundingClientRect(),n=t.getBoundingClientRect();return r.top-n.top+t.scrollTop}function p(e,t){return e.getBoundingClientRect().top-t.getBoundingClientRect().top}function m({content:e,spacer:t,viewport:r}){let n=d(e,t),l=g(e),s=r.getBoundingClientRect(),o=r.scrollTop,a=l.start+l.end;for(let e of n)a=Math.max(a,e.getBoundingClientRect().bottom-s.top+o+l.end);return a}function g(e){let t=window.getComputedStyle(e);return{end:h(t.paddingBlockEnd||t.paddingBottom),start:h(t.paddingBlockStart||t.paddingTop)}}function h(e){if(!e)return 0;let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function b(e,t){let r=e,n=new Set;return{getSnapshot:()=>r,hasListeners:()=>n.size>0,setSnapshot:e=>{t(r,e)||(r=e,n.forEach(e=>e()))},subscribe:(e,t,r)=>{let l=0===n.size;return n.add(e),l&&t?.(),()=>{n.delete(e),0===n.size&&r?.()}}}}function v(e,t){return e.start===t.start&&e.end===t.end}function x(e,t){return e.currentAnchorId===t.currentAnchorId&&e.visibleMessageIds.length===t.visibleMessageIds.length&&e.visibleMessageIds.every((e,r)=>e===t.visibleMessageIds[r])}function y(e){e.pendingDefaultScrollStore.setSnapshot(!1)}function w(e){e.defaultScrollPositionAppliedRef.current=!0,y(e)}function S(e,t){return r.useCallback(r=>{e.current=r,r&&t()},[e,t])}var R=r.createContext(null),I=r.createContext(null);function j(){let e=r.useContext(R);if(!e)throw Error("useMessageScroller must be used within a MessageScroller.");return e}function C(){let{pendingDefaultScrollStore:e}=j();return r.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}var T={Provider:function({autoScroll:e=!1,children:n,defaultScrollPosition:l="end",scrollEdgeThreshold:s,scrollPreviousItemPeek:o,scrollMargin:a}){let{context:i,registerMessage:j}=function({autoScroll:e=!1,defaultScrollPosition:t="end",scrollEdgeThreshold:n=8,scrollPreviousItemPeek:l=64,scrollMargin:s=0}){let o=function({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:n,scrollMargin:l,scrollPreviousItemPeek:s}){let o=r.useRef(e),a=r.useRef(!1),i=r.useRef(null),d=r.useRef(!1),f=r.useRef(n),p=r.useRef(0),m=r.useRef(null),g=r.useRef(0),h=r.useRef(e?"following-bottom":"free-scrolling"),y=r.useRef(new Map),w=r.useRef(null),S=r.useRef(null),R=r.useRef(null),I=r.useRef(s),j=r.useRef(!0),C=r.useRef(null),T=r.useRef(l),k=r.useRef(null),P=r.useRef(0),N=r.useRef(0),M=r.useRef(null),A=r.useRef(null),E=r.useRef(null),_=r.useRef(null),O=r.useRef(null),z=r.useRef(null),B=r.useRef(null),L=r.useRef(null),$=r.useRef(null),F=r.useRef(new Set),U=r.useRef(new WeakSet);return null===E.current&&(E.current=b("end"===t||"last-anchor"===t,(e,t)=>e===t)),null===_.current&&(_.current=b(c,v)),null===$.current&&($.current=b(u,x)),o.current=e,f.current=n,T.current=l,I.current=s,{autoScrollRef:o,autoscrollingRef:a,autoscrollingTimeoutRef:O,
2streamingTurnRef:R,contentRef:i,defaultScrollPositionAppliedRef:d,firstItemRef:m,itemCountRef:p,lastScrollTopRef:g,messageElementsRef:y,modeRef:h,pendingScrollFrameRef:k,pendingScrollToMessageRef:w,prependRestoreRef:S,preserveScrollOnPrependRef:j,pendingDefaultScrollStore:E.current,rootRef:C,scrollEdgeThresholdRef:f,scrollMarginRef:T,scrollPreviousItemPeekRef:I,spacerGapRef:P,spacerHeightRef:N,spacerRef:M,stateFrameRef:A,stateStore:_.current,viewportRef:z,visibilityFrameRef:B,visibilityObserverRef:L,visibilityStore:$.current,visibleMessageIdsRef:F,handledScrollAnchorsRef:U}}({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:n,scrollMargin:s,scrollPreviousItemPeek:l}),{streamingTurnRef:a,autoScrollRef:i,autoscrollingRef:R,autoscrollingTimeoutRef:I,contentRef:j,defaultScrollPositionAppliedRef:C,firstItemRef:T,itemCountRef:k,lastScrollTopRef:P,messageElementsRef:N,modeRef:M,pendingScrollFrameRef:A,pendingScrollToMessageRef:E,prependRestoreRef:_,preserveScrollOnPrependRef:O,pendingDefaultScrollStore:z,rootRef:B,scrollEdgeThresholdRef:L,scrollMarginRef:$,scrollPreviousItemPeekRef:F,spacerGapRef:U,spacerHeightRef:D,spacerRef:H,stateFrameRef:V,stateStore:q,viewportRef:W,visibilityFrameRef:G,visibilityObserverRef:K,visibilityStore:Q,visibleMessageIdsRef:Z,handledScrollAnchorsRef:J}=o,X=r.useRef(t);X.current!==t&&(X.current=t,C.current=!1);let Y=r.useCallback(e=>{let t=B.current,r=W.current,n=[e.start&&"start",e.end&&"end"].filter(
2Boolean).join(" "),l=R.current;for(let e of[t,r])e&&(n?e.setAttribute("data-scrollable",n):e.removeAttribute("data-scrollable"),e.toggleAttribute("data-autoscrolling",l))},[]),ee=r.useCallback(e=>{let t=W.current?.scrollTop??0,r=t<P.current-.5;P.current=t,i.current&&!e.end&&"settling-jump"!==M.current&&"anchored-to-message"!==M.current?M.current="following-bottom":"following-bottom"===M.current&&e.end&&r&&!R.current&&(M.current="free-scrolling")},[]),et=r.useCallback(()=>{let e=function({content:e,scrollEdgeThreshold:t,spacer:r,viewport:n}){if(!n||!e)return c;let l=m({content:e,spacer:r,viewport:n});return{start:n.scrollTop>t,end:l-n.scrollTop-n.clientHeight>t}}({content:j.current,scrollEdgeThreshold:L.current,spacer:H.current,viewport:W.current});ee(e);let t="following-bottom"===M.current?{...e,end:!1}:e;Y(t),q.setSnapshot(t)},[ee,q,Y]),er=r.useCallback(()=>{null===V.current&&(V.current=window.requestAnimationFrame(()=>{V.current=null,et()}))},[et]),en=r.useCallback(()=>{Q.hasListeners()&&null===G.current&&(G.current=window.requestAnimationFrame(()=>{G.current=null,Q.hasListeners()&&Q.setSnapshot(function({content:e,scrollMargin:t,scrollPreviousItemPeek:r,spacer:n,viewport:l,visibleMessageIds:s}){if(!e||!l)return u;let o=l.getBoundingClientRect(),a=o.top+t+r,i=typeof IntersectionObserver>"u",c=[],f=null;for(let t of d(e,n)){let e=t.dataset.messageId;if(!e)continue;let r="true"===t.dataset.scrollAnchor,n=r||i?t.getBoundingClientRect():null;(i&&n?n.bottom>a&&n.top<o.bottom:s.has(e))&&c.push(e),r&&n&&n.top<=a+.5&&(f=e)}return 0===c.length&&null===f?u:{currentAnchorId:f,visibleMessageIds:c}}({content:j.current,scrollMargin:$.current,scrollPreviousItemPeek:F.current,spacer:H.current,viewport:W.current,visibleMessageIds:Z.current}))}))},[Q]),{flushPendingScrollToMessage:el,reanchorToAnchoredMessage:es,scrollToElement:eo,scrollToEnd:ea,scrollToMessage:ei,scrollToStart:ec}=function({refs:e,commitScrollState:t,scheduleStateCommit:n,scheduleVisibilitySync:l}){let{streamingTurnRef:s,autoScrollRef:o,autoscrollingRef:a,autoscrollingTimeoutRef:i,contentRef:c,itemCountRef:u,messageElementsRef:d,modeRef:h,pendingScrollToMessageRef:b,prependRestoreRef:v,scrollMarginRef:x,scrollPreviousItemPeekRef:y,spacerGapRef:S,spacerHeightRef:R,spacerRef:I,viewportRef:j}=e,C=r.useCallback(e=>{null!==i.current&&(window.clearTimeout(i.current),i.current=null),a.current!==e&&(a.current=e,t()),e&&(i.current=window.setTimeout(()=>{i.current=null,a.current=!1,t()},180))},[t]),T=r.useCallback(e=>{let t=I.current;if(!t)return;let r=Math.max(0,Math.ceil(e));R.current!==r&&(R.current=r,t.hidden=0===r,t.style.height=`${r}px`,t.style.marginTop=r>0?`${-S.current}px`:"")},[]),k=r.useCallback((e,{behavior:r="auto",autoscrolling:l=!1}={})=>{let s=j.current;if(!s)return;let o=Math.max(0,e);if(.5>=Math.abs(s.scrollTop-o)){s.scrollTop=o,t();return}l&&C(!0),s.scrollTo({top:o,behavior:r}),n()},[t,n,C]),P=r.useCallback(({behavior:e="auto"}={})=>!!j.current&&(T(0),s.current=null,h.current="free-scrolling",k(0,{behavior:e}),l(),!0),[l,k,T]),N=r.useCallback(({behavior:e="auto"}={})=>{let t=j.current;return!!t&&(T(0),s.current=null,h.current=o.current?"following-bottom":"free-scrolling",k(Math.max(0,t.scrollHeight-t.clientHeight),{autoscrolling:!0,behavior:e}),l(),!0)},[l,k,T]),M=r.useCallback((e,{align:t="start",behavior:r="auto",scrollMargin:n=x.current}={},{keepPreviousPeek:o=!1}={})=>{let a=c.current,i=j.current;if(!a||!i||!a.contains(e))return!1;let u=function({align:e,element:t,scrollMargin:r,spacer:n,viewport:l}){var s;let o,a=f(t,l),i=t.getBoundingClientRect().height,c=(s=n,(o=s?.parentElement)?g(o):{end:0,start:0});if("center"===e){let e=Math.max(0,l.clientHeight-c.start-c.end);return a-c.start-(e-i)/2-r}if("end"===e)return a-l.clientHeight+i+c.end+r;if("nearest"===e){let e=a+i,t=l.scrollTop+c.start,n=l.scrollTop+l.clientHeight-c.end;return a>=t&&e<=n?l.scrollTop:a<t?a-c.start-r:e-l.clientHeight+c.end+r}return a-c.start-r}({align:t,element:e,scrollMargin:o?n+y.current:n,spacer:I.current,viewport:i});return T(function({content:e,scrollTop:t,spacer:r,viewport:n}){let l=m({content:e,spacer:r,viewport:n});return t+n.clientHeight-l}({content:a,scrollTop:u,spacer:I.current,viewport:i})),v.current={element:e,viewportTop:p(e,i)},h.current=o?"anchored-to-message":"settling-jump",s.current=o?e:null,k(u,{behavior:r}),l(),!0},[l,k,T]),A=r.useCallback(()=>{let e=s.current;return!!e&&!!e.isConnected&&"anchored-to-message"===h.current&&M(e,{align:"start"},{keepPreviousPeek:!0})},[M]),E=r.useCallback((t,r)=>{let n=d.current.get(t);return n?(w(e),M(n,r)?b.current=null:b.current={messageId:t,options:r},!0):0===u.current&&(b.current={messageId:t,options:r},w(e),!0)},[M]);return{flushPendingScrollToMessage:r.useCallback(()=>{let t=b.current;if(!t)return!1;let r=d.current.get(t.messageId);return!!r&&!!M(r,t.options)&&(b.current=null,w(e),!0)},[M]),reanchorToAnchoredMessage:A,scrollToElement:M,scrollToEnd:N,scrollToMessage:E,scrollToStart:P}}({refs:o,commitScrollState:et,scheduleStateCommit:er,scheduleVisibilitySync:en}),eu=r.useCallback(()=>{let e=_.current,t=W.current;if(!e||!t||!e.element.isConnected)return!1;let r=p(e.element,t)-e.viewportTop;return!(.5>=Math.abs(r))&&(t.scrollTop+=r,e.viewportTop=p(e.element,t),er(),en(),!0)},[er,en]),ed=r.useCallback(()=>{let e=j.current,t=W.current;if(!e||!t){_.current=null;return}let r=function({content:e,spacer:t,viewport:r}){let n=r.getBoundingClientRect();for(let r of d(e,t)){if(!r.dataset.messageId)continue;let e=r.getBoundingClientRect();if(e.bottom>n.top&&e.top<n.bottom)return r}return null}({content:e,spacer:H.current,viewport:t});_.current=r?{element:r,viewportTop:p(r,t)}:null},[]),ef=r.useCallback(()=>{null===A.current&&(A.current=window.requestAnimationFrame(()=>{A.current=null,el()&&ed()}))},[ed,el]),ep=r.useCallback(()=>
2{if(!t||C.current||0===k.current)return!1;let e=!1;if("last-anchor"===t){let t=j.current,r=W.current,n=t&&r?function(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(r?.dataset.scrollAnchor==="true")return r}return null}(d(t,H.current)):null;if(t&&r&&n){let l=f(n,r);e=m({content:t,spacer:H.current,viewport:r})-l<=r.clientHeight?ea({behavior:"auto"}):eo(n,{align:"start"},{keepPreviousPeek:!0})}else e=ea({behavior:"auto"})}else e="end"===t?ea({behavior:"auto"}):ec({behavior:"auto"});return!!e&&(w(o),!0)},[t,eo,ea,ec]),em=r.useCallback(()=>{let e=j.current;if(!e)return;let t=d(e,H.current),r=k.current,n=T.current;k.current=t.length,T.current=t[0]??null,(()=>{if(el())return;if(0===r){if(ep()||t.length>0&&i.current&&ea({behavior:"auto"}))return;et(),en();return}let e=n?t.indexOf(n):-1;if(O.current&&e>0)return eu();if(t.length>r){let e=function(e,t){for(let r=t;r<e.length;r++){let t=e[r];if(t?.dataset.scrollAnchor==="true")return t}return null}(t,r);if(e)return i.current&&"following-bottom"===M.current&&function(e,t){let r=0;for(let n=t;n<e.length;n++)if(e[n]?.dataset.scrollAnchor==="true"&&(r+=1)>1)return!0;return!1}(t,r)?ea({behavior:"auto"}):(eo(e,{align:"start"},{keepPreviousPeek:!0}),J.current.add(e))}if(t.length===r){let e=function(e,t){for(let r of e)if("true"===r.dataset.scrollAnchor&&!t.has(r))return r;return null}(t,J.current);if(e){eo(e,{align:"start"},{keepPreviousPeek:!0}),J.current.add(e);return}}"following-bottom"===M.current&&i.current?ea({behavior:"auto"}):(et(),en())})(),ed()},[ep,ed,et,el,eu,en,eo,ea]),eg=r.useCallback(()=>{if("following-bottom"===M.current&&i.current)return void ea({behavior:"auto"});let e=D.current;if(es()){i.current&&e>0&&0===D.current&&ea({behavior:"auto"});return}er(),en()},[es,er,en,ea]),eh=r.useCallback(()=>{let e=W.current;if(!(!e||!Q.hasListeners())){if(typeof IntersectionObserver>"u")return void en();K.current||(K.current=new IntersectionObserver(e=>{for(let t of e){let e=t.target.dataset.messageId;e&&(t.isIntersecting?Z.current.add(e):Z.current.delete(e))}en()},{root:e,rootMargin:`${-($.current+F.current)}px 0px 0px 0px`,threshold:[0,.01,.5,1]})),N.current.forEach(e=>{K.current?.observe(e)}),en()}},[en,Q]),eb=r.useCallback(()=>{null!==G.current&&(window.cancelAnimationFrame(G.current),G.current=null),K.current?.disconnect(),K.current=null,Z.current.clear(),Q.setSnapshot(u)},[Q]),ev=r.useCallback((e,t,r)=>{if(t){N.current.set(e,t),K.current?.observe(t),en(),E.current?.messageId===e&&ef();return}r&&N.current.get(e)===r&&(N.current.delete(e),Z.current.delete(e),K.current?.unobserve(r),en())},[ef,en]),ex=r.useCallback(()=>{("following-bottom"===M.current||"anchored-to-message"===M.current||"settling-jump"===M.current)&&(a.current=null,M.current="free-scrolling")},[]),ey=r.useCallback(()=>Y(q.getSnapshot()),[q,Y]),ew=S(B,ey),eS=S(W,ey),eR=r.useCallback(e=>{j.current=e},[]),eI=r.useCallback(e=>{H.current=e,U.current=function(e){if(!e)return 0;let t=window.getComputedStyle(e);return h("normal"===t.rowGap?t.gap:t.rowGap)}(e?.parentElement??null)},[]),ej=r.useCallback(()=>{et(),en(),ed()},[ed,et,en]),eC=r.useMemo(()=>({handleContentChange:em,handleResize:eg,observeVisibility:eh,pendingDefaultScrollStore:z,preserveScrollOnPrependRef:O,scrollToEnd:ea,scrollToMessage:ei,scrollToStart:ec,setContentElement:eR,setRootElement:ew,setSpacerElement:eI,setViewportElement:eS,stateStore:q,syncAfterScroll:ej,unobserveVisibility:eb,userScrollIntent:ex,viewportRef:W,visibilityStore:Q}),[em,eg,eh,z,ea,ei,ec,eR,ew,eI,eS,q,ej,eb,ex,Q]);return r.useLayoutEffect(()=>{ep()||0===k.current&&y(o)},[ep]),r.useEffect(()=>()=>{null!==V.current&&(window.cancelAnimationFrame(V.current),V.current=null),null!==G.current&&(window.cancelAnimationFrame(G.current),G.current=null),null!==I.current&&(window.clearTimeout(I.current),I.current=null),null!==A.current&&(window.cancelAnimationFrame(A.current),A.current=null),K.current?.disconnect(),K.current=null},[]),r.useLayoutEffect(()=>{e&&"following-bottom"===M.current&&k.current>0?ea({behavior:"auto"}):et()},[e,et,ea]),{context:eC,registerMessage:ev}}({autoScroll:e,defaultScrollPosition:l,scrollEdgeThreshold:s,scrollPreviousItemPeek:o,scrollMargin:a});return(0,t.jsx)(R.Provider,{value:i,children:(0,t.jsx)(I.Provider,{value:j,children:n})})},Root:function({children:e,...r}){let{setRootElement:n}=j(),l=C();return(0,t.jsx)("div",{ref:n,...r,...l?{"data-pending-scroll":""}:null,children:e})},Viewport:function({"aria-label":e,children:n,onKeyDown:l,onScroll:s,onTouchMove:o,onWheel:c,preserveScrollOnPrepend:u=!0,ref:d,role:f,tabIndex:p,...m}
2){let{handleResize:g,preserveScrollOnPrependRef:h,setViewportElement:b,syncAfterScroll:v,userScrollIntent:x,viewportRef:y}=j(),w=C();h.current=u;let S=r.useCallback(e=>{b(e),a(d)?.(e)},[d,b]);return r.useEffect(()=>{let e=y.current;if(!e||typeof ResizeObserver>"u")return;let t=0,r=new ResizeObserver(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(g)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.disconnect()}},[g,y]),(0,t.jsx)("div",{ref:S,role:f??"region","aria-label":e??"Messages",tabIndex:p??0,onKeyDown:function(e){i.has(e.key)&&x(),l?.(e)},onScroll:function(e){v(),s?.(e)},onTouchMove:function(e){x(),o?.(e)},onWheel:function(e){x(),c?.(e)},...m,...w?{"data-pending-scroll":""}:null,children:n})},Content:function({"aria-relevant":e,children:n,ref:l,role:s,spacerClassName:o,...i}){let{handleContentChange:c,handleResize:u,setContentElement:d,setSpacerElement:f}=j(),p=r.useRef(null),m=r.useCallback(e=>{p.current=e,d(e),a(l)?.(e)},[l,d]);return r.useLayoutEffect(()=>{let e=p.current;if(!e||(c(),typeof MutationObserver>"u"))return;let t=new MutationObserver(()=>{c()});return t.observe(e,{childList:!0}),()=>t.disconnect()},[c]),r.useEffect(()=>{let e=p.current;if(!e||typeof ResizeObserver>"u")return;let t=0,r=new ResizeObserver(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(u)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.disconnect()}},[u]),(0,t.jsxs)("div",{ref:m,role:s??"log","aria-relevant":e??"additions",...i,children:[n,(0,t.jsx)("div",{ref:f,"aria-hidden":"true","data-message-scroller-spacer":"",hidden:!0,className:o})]})},Item:function({messageId:e,ref:n,scrollAnchor:l=!1,...s}){let o=function(){let e=r.useContext(I);if(!e)throw Error("MessageScrollerItem must be used within a MessageScroller.");return e}(),i=r.useRef(null),c=r.useCallback(t=>{let r=i.current;i.current=t,e&&o(e,t,r),a(n)?.(t)},[e,n,o]);return(0,t.jsx)("div",{ref:c,"data-message-id":e,"data-scroll-anchor":l?"true":"false",...s})},Button:function({behavior:e="smooth",children:n,direction:l="end",onClick:s,render:i,tabIndex:c,type:u="button",...d}){let f,{scrollToEnd:p,scrollToStart:m,stateStore:g}=j(),h=((f=r.useRef(s)).current=s,f),b=r.useCallback(e=>g.subscribe(e),[g]),v=r.useCallback(()=>{let e=g.getSnapshot();return"start"===l?e.start:e.end},[l,g]),x=r.useSyncExternalStore(b,v,v),y=r.useCallback(t=>{x&&(h.current?.(t),t.defaultPrevented||(t.currentTarget.blur(),"start"===l?m({behavior:e}):p({behavior:e})))},[e,l,x,h,p,m]);return function({defaultTagName:e,props:t,render:n,state:l={},stateAttributesMapping:s}){let i=o(function(e,t){let r={};for(let n of Object.keys(e)){let l=e[n],s=t?.[n]?.(l);if(s){Object.assign(r,s);continue}if("slot"===n){r["data-slot"]=l;continue}let o=`data-${String(n).replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}`;"boolean"==typeof l?r[o]=l?"":void 0:null!=l&&(r[o]=String(l))}return r}(l,s),t);if(!n)return r.createElement(e,i);if("function"==typeof n)return n(i,l);if(!r.isValidElement(n))return null;let c=n.props,u={...o(i,c),ref:a(i.ref,c.ref)};return r.cloneElement(n,u)}({defaultTagName:"button",props:o({type:u,inert:!x,tabIndex:x?c:-1,children:n??(0,t.jsxs)("span",{children:["Scroll to ",l]}),onClick:y},d),render:i,state:{active:x,direction:l},stateAttributesMapping:{active:e=>({"data-active":e?"true":"false"})}})}};e.s(["MessageScroller",0,T,"useMessageScroller",0,function(){let{scrollToEnd:e,scrollToMessage:t,scrollToStart:n}=j();return r.useMemo(()=>({scrollToEnd:e,scrollToMessage:t,scrollToStart:n}),[e,t,n])},"useMessageScrollerScrollable",0,function(){let{stateStore:e}=j();return r.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)},"useMessageScrollerVisibility",0,function(){let{observeVisibility:e,unobserveVisibility:t,visibilityStore:n}=j(),l=r.useCallback(r=>n.subscribe(r,e,t),[e,t,n]);return r.useSyncExternalStore(l,n.getSnapshot,n.getSnapshot)}],914123);var k=e.i(864618),P=e.i(981831);function N({className:e,scrollAnchor:r=!1,...n}){return(0,t.jsx)(T.Item,{"data-slot":"message-scroller-item",scrollAnchor:r,className:(0,k.cn)("min-w-0 shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]",e),...n})}e.s(["MessageScroller",0,function({className:e,...r}){return(0,t.jsx)(T.Root,{"data-slot":"message-scroller",className:(0,k.cn)("group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden",e),...r})},"MessageScrollerButton",0,function({direction:e="end",className:r,children:n,render:l,variant:o="outline",size:a="icon-sm",...i}){return(0,t.jsx)(T.Button,{"data-slot":"message-scroller-button","data-direction":e,"data-variant":
2o,"data-size":a,direction:e,className:(0,k.cn)("absolute inset-s-1/2 -translate-x-1/2 border-border/50 bg-background/50 text-foreground shadow-xs backdrop-blur-xl backdrop-saturate-150 transition-[translate,scale,opacity] duration-200 hover:bg-background/70 hover:text-foreground data-[active=false]:pointer-events-none data-[active=false]:scale-95 data-[active=false]:opacity-0 data-[active=false]:duration-400 data-[active=false]:ease-[cubic-bezier(0.7,0,0.84,0)] data-[active=true]:translate-y-0 data-[active=true]:scale-100 data-[active=true]:opacity-100 data-[active=true]:ease-[cubic-bezier(0.23,1,0.32,1)] data-[direction=end]:bottom-4 data-[direction=end]:data-[active=false]:translate-y-full data-[direction=start]:top-4 data-[direction=start]:data-[active=false]:-translate-y-full rtl:translate-x-1/2 data-[direction=start]:[&_svg]:rotate-180",r),render:l??(0,t.jsx)(P.Button,{variant:o,size:a}),...i,children:n??(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s,{}),(0,t.jsx)("span",{className:"sr-only",children:"end"===e?"Scroll to end":"Scroll to start"})]})})},"MessageScrollerContent",0,function({className:e,...r}){return(0,t.jsx)(T.Content,{"data-slot":"message-scroller-content",className:(0,k.cn)("flex h-max min-h-full flex-col gap-8",e),...r})},"MessageScrollerItem",0,N,"MessageScrollerProvider",0,function(e){return(0,t.jsx)(T.Provider,{...e})},"MessageScrollerViewport",0,function({className:e,...r}){return(0,t.jsx)(T.Viewport,{"data-slot":"message-scroller-viewport",className:(0,k.cn)("size-full min-h-0 min-w-0 scroll-fade-b scrollbar-thin scrollbar-gutter-stable overflow-y-auto overscroll-contain contain-content data-autoscrolling:scrollbar-none",e),...r})}],601051),e.i(146696);var M=e.i(623673),A=e.i(502242),E=e.i(233696),_=e.i(703803),O=e.i(266027),z=e.i(228620),B=e.i(335880);e.i(948009);var L=e.i(655206),$=e.i(618566),F=e.i(477130),U=e.i(650561),D=e.i(670102),H=e.i(458773),V=e.i(657688);function q({label:e,title:n,imageUrl:l,ctaLabel:s,onOpen:o,secondaryCta:a,disabled:i,icon:c,fallbackIcon:u,className:d}){let[f,p]=(0,r.useState)(!1);(0,r.useEffect)(()=>{p(!1)},[l]);let m=!!l;return(0,t.jsx)(H.motion.div,{className:(0,k.cn)("w-full max-w-md",d),initial:{x:-28,opacity:0}
2,animate:{x:0,opacity:1},transition:{type:"spring",stiffness:400,damping:40},children:(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)("div",{className:"flex flex-row items-center gap-1.5 px-0.5",children:(0,t.jsxs)(F.Badge,{size:"sm",variant:"secondary",children:[c?(0,t.jsx)(c,{"aria-hidden":!0,className:"size-3.5",weight:"duotone"}):null,e]})}),(0,t.jsx)(U.Card,{size:"sm",className:(0,k.cn)("w-full overflow-hidden",!i&&"cursor-pointer relative after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:bg-accent after:opacity-0 after:transition-opacity hover:after:opacity-100",i&&"opacity-90"),onClick:i?void 0:o,onKeyDown:i?void 0:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),o())},role:i?void 0:"button",tabIndex:i?void 0:0,children:(0,t.jsxs)(U.CardPanel,{className:"flex flex-row items-stretch gap-3 p-2.5",children:[(0,t.jsx)("div",{className:"relative z-[1] flex size-14 shrink-0 items-center justify-center overflow-hidden rounded-md bg-muted sm:size-16",children:m?(0,t.jsxs)(t.Fragment,{children:[f?null:(0,t.jsx)(D.Skeleton,{className:"absolute inset-0 size-full rounded-md"}),(0,t.jsx)(V.default,{src:l,alt:"",fill:!0,sizes:"64px",className:"object-cover",onLoad:()=>p(!0)})]}):(0,t.jsx)("span",{className:"text-muted-foreground/40",children:u})}),(0,t.jsxs)("div",{className:"relative z-[1] flex min-w-0 flex-1 flex-col justify-center gap-2 py-0.5",children:[(0,t.jsx)("p",{className:"line-clamp-2 font-medium text-foreground text-sm sm:text-base",children:n}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[s?(0,t.jsx)(P.Button,{type:"button",variant:"secondary",size:"sm",className:"w-fit",tabIndex:-1,disabled:i,onClick:e=>{e.stopPropagation(),i||o()},children:s}):null,a?(0,t.jsx)(P.Button,{type:"button",variant:"outline",size:"sm",className:"w-fit",tabIndex:-1,disabled:i,onClick:e=>{e.stopPropagation(),i||a.onClick()},children:a.label}):null]})]})]})})]})})}var W=e.i(775499),G=e.i(218650),K=e.i(767998),Q=e.i(295616);function Z({destinations:e,destinationsPrompt:r,className:n}){let l,s=e[0],o=(0,K.useI18n)(),{track:a}=(0,z.useOpenPanel)(),i=(0,$.useParams)(),c="string"==typeof i.chatId?i.chatId:void 0,u=(0,Q.useTRPC)(),{setParams:d}=(0,W.useDestinationParams)(),{setParams:f}=(0,G.useTripMapParams)(),p=e.length>1,m="string"==typeof s?.id?s.id:null,{data:g}=(0,O.useQuery)(u.destinations.getById.queryOptions({id:m??""},{enabled:!!m,staleTime:3e5}));if(!s)return null;let h=g??s,b=h.country?.trim()||null,v="string"==typeof h.countryCode?(l=h.countryCode.trim().toUpperCase(),/^[A-Z]{2}$/.test(l)?String.fromCodePoint(127462+(l.charCodeAt(0)-65),127462+(l.charCodeAt(1)-65)):null):null,x=b&&b.toLowerCase()!==h.displayName.toLowerCase()?b:null,y=[h.displayName,x].filter(Boolean).join(", ")+(v?` ${v}`:""),w=r?.trim();return(0,t.jsx)(q,{className:n,label:o(p?"destinations":"destination"),title:p&&w||y,imageUrl:g?.imageUrl||(h.city&&h.country?(0,L.destImageUrl)(h.country,h.city):null),ctaLabel:o("open"),onOpen:()=>{let t="string"==typeof h.id?h.id:m;t&&(a(B.LogEvents.DestinationCardOpened.name,{conversationId:c,destCount:e.length}),d({destination:t}),f({tripMap:null}))},disabled:!h.id,icon:_.MapPinIcon,fallbackIcon:(0,t.jsx)(_.MapPinIcon,{className:"size-8",weight:"duotone","aria-hidden":!0})})}var J=e.i(44821),X=e.i(903839);function Y({flightSearchId:e,title:r,imageUrl:n,className:l}){let s=(0,K.useI18n)(),{open:o}=(0,X.useFlightSearchParams)();return(0,t.jsx)(q,{className:l,label:s("flights"),title:r?.trim()||s("flights"),imageUrl:n??null,ctaLabel:s("see_all_flights_cta"),onOpen:()=>o(e),disabled:!e,icon:J.AirplaneTiltIcon,fallbackIcon:(0,t.jsx)(J.AirplaneTiltIcon,{className:"size-8",weight:"duotone","aria-hidden":!0})})}var ee=e.i(566314),et=e.i(639572);function er({hotelSearchId:e,placeLabel:r,imageUrl:n,className:l}){let s=(0,K.useI18n)(),{open:o}=(0,et.useHotelSearchParams)(),a=r.trim()||s("your_trip"),i=a.toLowerCase().startsWith("hotels")?a:s("hotels_in",{place:a});return(0,t.jsx)(q,{className:l,label:s("hotels"),title:i,imageUrl:n??null,ctaLabel:s("see_all_hotels"),onOpen:()=>o(e),disabled:!e,icon:ee.BuildingsIcon,fallbackIcon:(0,t.jsx)(ee.BuildingsIcon,{className:"size-8",weight:"duotone","aria-hidden":!0})})}var en=e.i(618770),el=e.i(619273),es=e.i(466863),eo=e.i(964873);function ea({tripId:e,title:r,versionNumber:n,latestTripId:l,className:s}){let o=(0,K.useI18n)(),{conversationId:a}=(0,eo.useConversationState)(),i=(0,$.useParams)(),c=(0,$.useRouter)(),u=(0,Q.useTRPC)(),{data:d}=(0,O.useQuery)({...u.conversations.getById.queryOptions({id:a}),enabled:!!a,staleTime:3e4}),f=es.tripProgressSchema.safeParse(d?.tripProgress),p=f.success&&(0,es.tripProgressIsGenerating)(f.data),m="string"==typeof i?.chatId?i.chatId:null,g="string"==typeof i?.tripId?i.tripId:null,h="string"==typeof i?.slug?i.slug:null,{data:b}=(0,O.useQuery)(u.trips.getById.queryOptions(e&&!p?{id:e}:el.skipToken,{staleTime:6e4})),v=e===l,x=!v&&g===e,y=r||b?.title||d?.name||"Trip",w=b?.legs?.find(e=>"destination"===e.type)?.destination,S=w?.city?.trim(),R=w?.country?.trim(),I=S&&R?(0,L.destImageUrl)(R,S):null,j=e=>
2{let t=b?.conversationId?.trim()||m||(a&&!a.startsWith("trip-")?a:null);t?c.push(`/chat/${t}/trip/${e}`):h&&c.push(`/trip/${encodeURIComponent(h)}/${e}`)},C=o(v?"latest_version":"previous_trip_version",{n:n});return(0,t.jsx)(q,{className:s,label:C,title:y,imageUrl:I,ctaLabel:o(v?"open":"restore"),onOpen:()=>j(e),secondaryCta:v?void 0:{label:o(x?"back_to_latest":"preview"),onClick:()=>j(x?l:e)},disabled:!e,icon:en.SuitcaseRollingIcon,fallbackIcon:(0,t.jsx)(en.SuitcaseRollingIcon,{className:"size-8",weight:"duotone","aria-hidden":!0})})}var ei=e.i(777781),ec=e.i(527473),eu=e.i(88653),ed=e.i(510972);function ef({sources:e}){return 0===e.length?null:(0,t.jsx)(ec.TooltipProvider,{delayDuration:150,children:(0,t.jsxs)("div",{className:"flex items-center not-prose mt-3",children:[(0,t.jsx)("div",{className:"flex items-center",children:(0,t.jsx)(eu.AnimatePresence,{mode:"popLayout",children:e.map((r,n)=>{let l=(0,ei.getRootDomain)(r.url);return(0,t.jsxs)(ec.Tooltip,{children:[(0,t.jsx)(ec.TooltipTrigger,{render:(0,t.jsx)(H.motion.div,{initial:{opacity:0,scale:.6,x:50,filter:"blur(4px)"},animate:{opacity:1,scale:1,x:0,filter:"blur(0px)",zIndex:e.length-n},exit:{opacity:0,scale:.8,x:-20,filter:"blur(4px)"},transition:{duration:.4,delay:.04*n,ease:[.16,1,.3,1]},className:"relative -ml-2 first:ml-0",style:{zIndex:e.length-n}}),children:(0,t.jsx)("a",{href:(0,ed.attributeOutboundUrl)(r.url)??r.url,target:"_blank",rel:"noopener noreferrer",onClick:()=>(0,ed.trackAffiliateOutbound)(r.url),children:(0,t.jsx)("div",{className:"relative size-5 rounded-md bg-background border-2 border-border overflow-hidden flex items-center justify-center shadow-sm cursor-pointer",children:(0,t.jsx)("img",{src:l?`https://img.logo.dev/${l}?token=pk_EEZFSTstR9qLTTTJnIEg6w&size=180&retina=true`:"",alt:l,className:"size-full object-cover"})})})}),(0,t.jsx)(ec.TooltipContent,{side:"bottom",children:r.title||l})]},r.sourceId)})})}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground ml-2",children:[e.length," ",1===e.length?"source":"sources"]})]})})}var ep=e.i(107120),em=e.i(522016);let eg={CheckIcon:ep.Icons.Check,CopyIcon:ep.Icons.Copy,DownloadIcon:ep.Icons.ArrowDownward,XIcon:ep.Icons.Close,ExternalLinkIcon:ep.Icons.OpenInNew,RotateCcwIcon:ep.Icons.RefreshOutline},eh={table:{copy:!0,download:!0,fullscreen:!1}},eb=(0,k.cn)("font-sans text-base text-muted-foreground sm:text-sm [&>*:first-child]:mt-0 [&>*:last-child]:mb-0 space-y-3","[&_[data-streamdown=strong]]:font-bold [&_[data-streamdown=strong]]:text-foreground","[&_[data-streamdown=table-wrapper]]:rounded-none [&_[data-streamdown=table-wrapper]]:bg-transparent [&_[data-streamdown=table-wrapper]]:p-0 [&_[data-streamdown=table-wrapper]]:border-0 [&_[data-streamdown=table-wrapper]]:gap-1","[&_[data-streamdown=table-wrapper]_>div:last-child]:rounded-none","[&_[data-streamdown=table]]:text-sm","[&_[data-streamdown=table-wrapper]_button_svg]:!w-3 [&_[data-streamdown=table-wrapper]_button_svg]:!h-3 [&_[data-streamdown=table-wrapper]_button]:p-0.5","[&_[data-streamdown=table-wrapper]_.relative>div]:rounded-none [&_[data-streamdown=table-wrapper]_.relative>div]:shadow-sm [&_[data-streamdown=table-wrapper]_.relative>div>button]:text-xs [&_[data-streamdown=table-wrapper]_.relative>div>button]:px-2.5 [&_[data-streamdown=table-wrapper]_.relative>div>button]:py-1.5"),ev="border-b border-dashed border-muted-foreground";var ex=e.i(876524),ey=e.i(336539);function ew({label:e}){let r=(0,K.useI18n)();return(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-base sm:text-sm",children:[(0,t.jsx)(ey.Travelese,{className:"text-muted-foreground"}),(0,t.jsx)(ex.TextShimmer,{as:"span",className:"font-normal",duration:.75,children:e??r("companion_thinking")})]})}e.s(["ThinkingIndicator",0,ew],462229);let eS=(0,r.memo)(function({message:e}){return(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)("div",{className:"max-w-[85%] text-base bg-secondary px-4 py-2 rounded-2xl rounded-br-none sm:text-sm",children:(0,t.jsx)("span",{children:e.parts.filter(e=>"text"===e.type).map(e=>e.text).join("")})})})}),eR=(0,r.memo)(function({message:e,isStreaming:n,isLastMessage:l,versionNumber:s,latestTripId:o,generating:a,streamStatus:i,components:c}){let u=(0,K.useI18n)(),d=(0,ei.messageTripCards)(e),f=function(e){let t=null;
2for(let r of e.parts){if("stays_search"!==eI(r)||"output-available"!==r.state)continue;let e=ej(r.output)[0],n=r.output&&"object"==typeof r.output?r.output:null,l=n?.structuredContent&&"object"==typeof n.structuredContent?n.structuredContent:null,s=String(l?.hotelSearchId??n?.hotelSearchId??"").trim();if(!s)continue;let o=r.input,a=e?.photos,i=Array.isArray(a)&&"string"==typeof a[0]?a[0]:null;t={hotelSearchId:s,placeLabel:"string"==typeof o?.place?o.place:"",imageUrl:i}}return t}(e),{open:p}=(0,et.useHotelSearchParams)();(0,r.useEffect)(()=>{let e=f?.hotelSearchId;l&&e&&p(e)},[l,f?.hotelSearchId,p]);let m=function(e){let t=null;for(let r of e.parts){if("flights_search"!==eI(r)||"output-available"!==r.state)continue;let e=r.output,n=e?.structuredContent&&"object"==typeof e.structuredContent?e.structuredContent:null,l=String(n?.offerRequestId??e?.offerRequestId??"").trim(),s=ej(r.output)[0],o=l||("string"==typeof s?.id?s.id.trim():"");if(!o)continue;let a="string"==typeof s?.fromCityName?s.fromCityName:"string"==typeof s?.fromCity?s.fromCity:"",i="string"==typeof s?.fromIata?s.fromIata:"",c="string"==typeof s?.toCityName?s.toCityName:"string"==typeof s?.toCity?s.toCity:"",u="string"==typeof s?.toIata?s.toIata:"",d=[a,i&&`(${i})`].filter(Boolean).join(" "),f=[c,u&&`(${u})`].filter(Boolean).join(" "),p=s?.carriers;t={flightSearchId:o,title:d&&f?`${d} → ${f}`:null,imageUrl:Array.isArray(p)&&p[0]&&"object"==typeof p[0]&&"string"==typeof p[0].imageUrl?p[0].imageUrl:"string"==typeof s?.thumbnailUrl?s.thumbnailUrl:null}}return t}(e),g=(0,ei.messageDestinations)(e),h=e.parts??[],b=h.filter(e=>"source-url"===e.type&&"url"in e&&"string"==typeof e.url&&(0,ei.isTravelWebSource)(e.url)),v=[],x=h.filter(e=>"text"===e.type&&"text"in e&&"string"==typeof e.text).map(e=>e.text).join("");x.trim()&&(x.includes("Travelese.ai")?v.push((0,t.jsx)("div",{className:eb,children:x.split("\n\n").map(e=>(0,t.jsx)("p",{children:(0,ey.renderWithTravelese)(e)},e))},`${e.id}-text`)):v.push((0,t.jsx)(M.Streamdown,{mode:l?"streaming":"static",isAnimating:l&&n,dir:"auto",icons:eg,controls:eh,className:eb,components:c,children:x},`${e.id}-text`))),g.length>0&&v.push((0,t.jsx)("div",{children:(0,t.jsx)(Z,{destinations:g,destinationsPrompt:(0,ei.messageDestinationsPrompt)(e)})},`${e.id}-destinations`)),f&&v.push((0,t.jsx)("div",{children:(0,t.jsx)(er,{hotelSearchId:f.hotelSearchId,placeLabel:f.placeLabel,imageUrl:f.imageUrl})},`${e.id}-hotels`)),m&&v.push((0,t.jsx)("div",{children:(0,t.jsx)(Y,{flightSearchId:m.flightSearchId,title:m.title,imageUrl:m.imageUrl})},`${e.id}-flights`)),b.length>0&&v.push((0,t.jsx)("div",{children:(0,t.jsx)(ef,{sources:b.slice(0,8)})},`${e.id}-sources`));let y=d[0];y&&!a&&v.push((0,t.jsx)("div",{className:"flex flex-col gap-2 overflow-visible",children:(0,t.jsx)(ea,{tripId:y.id,title:y.title,versionNumber:s??1,latestTripId:o??y.id})},`${e.id}-trip`));let w=h.filter(e=>(0,ei.isToolPart)(e)).map(e=>(0,ei.normalizeToolPart)(e)).find(e=>"trip_completion"!==e.toolName&&"output-available"!==e.state&&"output-error"!==e.state),S=a?u("companion_generating"):i??(w?(0,ei.formatToolName)(w.toolName,u):void 0);return(l&&n&&(0===v.length||S)&&v.push((0,t.jsx)(ew,{label:S},`${e.id}-status`)),0===v.length)?null:(0,t.jsx)("div",{className:"flex justify-start",children:(0,t.jsx)("div",{className:"w-full space-y-3 text-base text-muted-foreground sm:text-sm",children:v})})},(e,t)=>!e.isLastMessage&&!t.isLastMessage&&e.message===t.message&&e.versionNumber===t.versionNumber&&e.latestTripId===t.latestTripId&&e.generating===t.generating&&e.streamStatus===t.streamStatus);function eI(e){return"dynamic-tool"===e.type?e.toolName??null:e.type.startsWith("tool-")?e.type.slice(5):null}function ej(e){if(Array.isArray(e))return e.filter(e=>!!e&&"object"==typeof e);if(!e||"object"!=typeof e)return[];if(Array.isArray(e.data))return e.data.filter(e=>!!e&&"object"==typeof e);let t=e.structuredContent;if(t&&"object"==typeof t){let e=t.data;if(Array.isArray(e))return e.filter(e=>!!e&&"object"==typeof e)}return[]}e.s(["ConversationMessages",0,function({messages:e,status:n}){let{conversationId:l}=(0,eo.useConversationState)(),s=(0,$.useParams)(),o=(0,Q.useTRPC)(),{data:a}=(0,O.useQuery)({...o.conversations.getById.queryOptions({id:l}),enabled:"string"==typeof s.chatId&&s.chatId===l}),i=es.tripProgressSchema.safeParse(a?.tripProgress),c=i.success&&(0,es.tripProgressIsGenerating)(i.data),u=(0,K.useI18n)();(0,E.useConversationToolInvalidation)(e);let{setParams:d}
2=(0,A.useSupportParams)(),f=(0,r.useCallback)(e=>!!(0,ei.isSupportHref)(e)&&(d({support:!0,errorId:null}),!0),[d]),p=(0,r.useMemo)(()=>({a:({href:e,children:r,className:n})=>{if(e?.startsWith("#trip:"))return(0,t.jsx)("span",{className:(0,k.cn)(ev,"text-muted-foreground",n),children:r});if(e&&(0,ei.isSupportHref)(e))return(0,t.jsx)("button",{type:"button",className:(0,k.cn)(ev,"cursor-pointer text-left transition-colors hover:text-foreground",n),onClick:()=>f(e),children:r});let l=(0,ed.attributeOutboundUrl)(e)||e||"#";return l.startsWith("http://")||l.startsWith("https://")||l.startsWith("//")?(0,t.jsx)("a",{href:l,target:"_blank",rel:"noopener noreferrer",onClick:()=>(0,ed.trackAffiliateOutbound)(l),className:(0,k.cn)(ev,"transition-colors hover:text-foreground",n),children:r}):(0,t.jsx)(em.default,{href:l,className:(0,k.cn)(ev,"transition-colors hover:text-foreground",n),children:r})},p:({children:e})=>(0,t.jsx)("p",{className:"text-base leading-relaxed text-muted-foreground sm:text-sm",children:e}),ul:({children:e})=>(0,t.jsx)("ul",{className:"my-2 list-disc space-y-1.5 pl-5 marker:text-muted-foreground",children:e}),ol:({children:e})=>(0,t.jsx)("ol",{className:"my-2 list-decimal space-y-1.5 pl-5 marker:text-muted-foreground",children:e}),li:({children:e})=>(0,t.jsx)("li",{className:"text-base leading-relaxed text-muted-foreground sm:text-sm",children:e}),h1:({children:e})=>(0,t.jsx)("h1",{className:"mt-6 mb-2 text-lg text-primary",children:e}),h2:({children:e})=>(0,t.jsx)("h2",{className:"mt-6 mb-2 text-lg text-primary",children:e}),h3:({children:e})=>(0,t.jsx)("h3",{className:"mt-4 mb-1.5 text-base text-primary",children:e}),strong:({children:e})=>(0,t.jsx)("strong",{className:"font-bold text-foreground",children:e}),code:({children:e})=>(0,t.jsx)("code",{className:"bg-secondary px-1 py-0.5 text-primary text-sm",children:e}),pre:({children:e})=>(0,t.jsx)("pre",{className:"overflow-x-auto bg-secondary p-3 text-primary text-sm",children:e}),thead:({children:e})=>(0,t.jsx)("thead",{className:"border-border border-b",children:e}),tbody:({children:e})=>(0,t.jsx)("tbody",{className:"[&_tr:last-child]:border-0",children:e}),tr:({children:e})=>(0,t.jsx)("tr",{className:"border-border border-b",children:e}),th:({children:e})=>(0,t.jsx)("th",{className:"h-10 whitespace-nowrap px-4 text-left align-middle font-medium text-muted-foreground",children:e}),td:({children:e})=>(0,t.jsx)("td",{className:"whitespace-nowrap px-4 py-2 align-middle text-muted-foreground",children:e})}),[f]);if(0===e.length)return null;let m="streaming"===n||"submitted"===n,g=e[e.length-1]?.id,h=[];for(let t of e)if("assistant"===t.role)for(let e of(0,ei.messageTripCards)(t))h.push({messageId:t.id,tripId:e.id});let b=h.at(-1)?.tripId;return(0,t.jsxs)("div",{className:"flex flex-col gap-4 mb-4",children:[e.map(e=>{let r=m&&e.id===g,n=h.findIndex(t=>t.messageId===e.id);return(0,t.jsx)(N,{messageId:e.id,scrollAnchor:"user"===e.role,children:"user"===e.role?(0,t.jsx)(eS,{message:e}):(0,t.jsx)(eR,{message:e,isStreaming:m,isLastMessage:r,versionNumber:-1===n?void 0:n+1,latestTripId:b,generating:c,streamStatus:null,components:p})},e.id)}),m&&e[e.length-1]?.role==="user"||c&&!m?(0,t.jsx)("div",{className:"flex justify-start",children:(0,t.jsx)("div",{className:"w-full text-base text-muted-foreground sm:text-sm",children:(0,t.jsx)(ew,{label:c?u("companion_generating"):void 0})})}):null]})}],641302)}]);
3
4//# debugId=2e8d6e0a-3408-886e-d2f2-8cbd09878deb

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.