(globalThis.TURBOPACK_remote_chunk_loading_global_prj_Ea8QNpCs22Ye85AIRZ6hT1aa8n7z||(globalThis.TURBOPACK_remote_chunk_loading_global_prj_Ea8QNpCs22Ye85AIRZ6hT1aa8n7z=[])).push(["object"==typeof document?document.currentScript:void 0,12089,65408,86274,e=>{"use strict";var t=e.i(43476),n=e.i(71645),r=e.i(52236),i=e.i(32628),a=e.i(48322);function o({issues:e,onOpen:n}){return 0===e.length?null:(0,t.jsxs)("section",{"data-testid":"current-issues","aria-label":"Right now",style:{borderBottom:"1px solid var(--border-color-subtle)"},children:[(0,t.jsx)("h3",{className:"px-4 pt-3 pb-1 text-xs font-bold tracking-wide uppercase",style:{color:"var(--color-fg-secondary)"},children:"Right now"}),(0,t.jsx)("ul",{children:e.map(e=>(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button","data-testid":"current-issue","data-status-level":e.level,onClick:()=>n(e.target),className:"flex w-full items-start gap-3 px-4 py-2 text-left hover:bg-surface-sunken",children:[(0,t.jsx)(a.default,{level:e.level,className:"mt-1.5 shrink-0"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("span",{className:"block text-sm font-semibold",style:{color:"var(--color-fg)"},children:[e.ident,(0,t.jsxs)("span",{className:"font-normal",style:{color:"var(--color-fg-secondary)"},children:[" ","· ",e.routeLabel]})]}),(0,t.jsx)("span",{className:"block text-xs",style:{color:"var(--color-fg-secondary)"},children:e.reasons.map(e=>e.text).join(" · ")}),e.note&&(0,t.jsx)("span",{className:"block text-xs",style:{color:"var(--color-fg-secondary)"},children:e.note})]})]})},e.key))})]})}var s=e.i(81800),l=e.i(30086),c=e.i(75254);let d=(0,c.default)("ban",[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),u=(0,c.default)("corner-up-right",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M4 20v-7a4 4 0 0 1 4-4h12",key:"1lu4f8"}]]);var f=e.i(75787);let p=(0,c.default)("route",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]),h={cancelled:d,diverted:u,delay:l.Clock,"risk-changed":l.CloudLightning,"gate-change":f.DoorOpen,connection:p,landed:l.PlaneLanding,deicing:l.CloudSnow},g={info:"text-fg-interactive",warning:"text-fg-sev-moderate",critical:"text-fg-danger"};function m({alerts:e,issues:n,onOpen:r,onOpenIssue:i,onMarkAllRead:a,head:l=!0}){let c=e.some(e=>!e.readAt);return(0,t.jsxs)("div",{"data-testid":"alerts-panel",className:"flex h-full min-h-0 flex-col",children:[l&&(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--border-color-subtle)"},children:[(0,t.jsx)("h2",{className:"text-base font-bold",style:{color:"var(--color-fg)"},children:"Alerts"}),c&&(0,t.jsx)("button",{type:"button",onClick:a,className:"text-xs font-semibold",style:{color:"var(--color-fg-interactive)"},children:"Mark all read"})]}),(0,t.jsxs)("div",{"data-testid":"alerts-feed",className:"min-h-0 flex-1 overflow-y-auto",children:[(0,t.jsx)(o,{issues:n,onOpen:i}),0===e.length?(0,t.jsxs)("p",{className:"px-4 py-8 text-center text-sm",style:{color:"var(--color-fg-secondary)"},children:[n.length>0?"No changes yet. ":"No alerts yet. ","We'll tell you here when a tracked flight's delay, gate, delay risk or connection changes."]}):(0,t.jsxs)(t.Fragment,{children:[n.length>0&&(0,t.jsx)("h3",{className:"px-4 pt-3 pb-1 text-xs font-bold tracking-wide uppercase",style:{color:"var(--color-fg-secondary)"},children:"Recent changes"}),(0,t.jsx)("ul",{children:e.map(e=>{let n=h[e.kind];return(0,t.jsx)("li",{style:{borderBottom:"1px solid var(--border-color-subtle)"},children:(0,t.jsxs)("button",{type:"button","data-testid":"alert-item","data-unread":e.readAt?"false":"true",onClick:()=>r(e),className:"flex w-full items-start gap-3 px-4 py-3 text-left hover:bg-surface-sunken",children:[(0,t.jsx)(n,{size:18,className:`mt-0.5 shrink-0 ${g[e.severity]}`,"aria-hidden":"true"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"block text-sm",style:{color:"var(--color-fg)",fontWeight:e.readAt?500:700},children:e.title}),(0,t.jsx)("span",{className:"mt-0.5 block text-xs",style:{color:"var(--color-fg-secondary)"},children:e.body}),(0,t.jsx)("span",{className:"mt-1 block text-xs",style:{color:"var(--color-fg-secondary)"},children:(0,s.timeAgo)(e.createdAt)})]}),!e.readAt&&(0,t.jsx)("span",{"aria-label":"Unread",className:"mt-1.5 h-2 w-2 shrink-0 rounded-full",style:{backgroundColor:"var(--color-interactive)"}})]})},e.id)})})]})]})]})}e.s(["ALERT_COLOR_CLASS",0,g,"ALERT_ICON",0,h],65408),e.s(["default",0,m],86274),e.s(["default",0,function({alerts:e,issues:a,unread:o,onOpenAlert:s,onOpenIssue:l,onMarkAllRead:c,variant:d}){let[u,f]=(0,n.useState)(!1),p=(0,n.useRef)(null),[h,g]=(0,n.useState)(!1),[x,b]=(0,n.useState)(u);return u!==x&&(b(u),g(!u)),(0,n.useEffect)(()=>{if(!u)return;let e=e=>{p.current&&!p.current.contains(e.target)&&f(!1)},t=e=>{"Escape"===e.key&&f(!1)};return document.addEventListener("pointerdown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",t)}},[u]),(0,t.jsxs)("div",{ref:p,className:"relative",children:[(0,t.jsx)(i.default,{unread:o,open:u,onClick:()=>f(e=>!e),variant:d}),(u||h)&&(0,t.jsx)("div",{role:"dialog","aria-label":"Alerts",inert:!u,onAnimationEnd:e=>{e.target!==e.currentTarget||u||g(!1)},className:(0,r.cn)("absolute top-full right-0 z-50 mt-2 w-[380px] max-w-[90vw] overflow-hidden rounded-card","flint"===d?"bg-surface-floating shadow-floating":"bg-surface-raised shadow-lg","origin-top-right",u?"animate-menu-in":"animate-menu-out"),style:{border:"1px solid var(--border-color-subtle)",maxHeight:"70vh"},children:(0,t.jsx)(m,{alerts:e,issues:a,onMarkAllRead:c,onOpenIssue:e=>{f(!1),l(e)},onOpen:e=>{f(!1),s(e)}})})]})}],12089)},70499,e=>{"use strict";var t=e.i(43476),n=e.i(71645),r=e.i(62876),i=e.i(57005),a=e.i(67512),o=e.i(90230),s=e.i(36966),l=e.i(30086),c=e.i(83086),d=e.i(82879),u=e.i(80279),f=e.i(43480),p=e.i(58785),h=e.i(26320);e.i(73052);var g=e.i(84275),m=e.i(30374),x=e.i(53233),b=e.i(52236),v=e.i(67795),y=e.i(38049),j=e.i(4534),C=e.i(41975),w=e.i(74985),A=e.i(68553),S=e.i(72080),N=e.i(19749),k=e.i(47448),R=e.i(93549);let M=(e,t)=>new Date(`${e}T12:00:00`).toLocaleDateString("en-US",t),I=(e,t)=>{if(!e)return"—";try{let n=new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit",timeZone:t??"UTC"}).format(new Date(e));return t?n:`${n} UTC`}catch{return"—"}};function D({className:e,children:n}){return(0,t.jsx)("p",{className:(0,b.cn)("mx-1 mt-1 text-overline-strong text-fg-tertiary uppercase",e),children:n})}function T({title:e,testId:n,children:r}){return(0,t.jsxs)("div",{"data-testid":n,className:"flex flex-col gap-1.5 px-1 py-3.5",children:[e&&(0,t.jsx)("p",{className:"text-title font-bold text-fg",children:e}),(0,t.jsx)("p",{className:"text-body-sm text-fg-tertiary",children:r})]})}function P({phone:e,signedOut:r,onTrack:i}){let[a,o]=(0,n.useState)({kind:"pick",error:null}),[s,d]=(0,n.useState)(r),[u,f]=(0,n.useState)(!1),[p,h]=(0,n.useState)(!1);(0,n.useEffect)(()=>{h((0,N.canCaptureScreen)())},[]);let g=(0,n.useRef)(null),m=(0,n.useRef)(null),x=(0,n.useRef)(null);(0,n.useEffect)(()=>()=>x.current?.abort(),[]);let v=(0,n.useCallback)(async e=>{let t=new AbortController;x.current=t,o({kind:"reading"});let n=await (0,N.readBookingImage)(e,t.signal);n.ok?o({kind:"read",legs:n.legs,landed:n.landed,tracked:!1}):n.aborted||(401===n.status&&d(!0),o({kind:"pick",error:n.message}))},[]),y="pick"===a.kind&&!s;(0,n.useEffect)(()=>{if(!y)return;let e=e=>{let t=e.clipboardData&&(0,N.imageIn)(e.clipboardData);t&&(e.preventDefault(),v(t))};return document.addEventListener("paste",e),()=>document.removeEventListener("paste",e)},[y,v]);let C=async e=>{let t=await e();t.ok?v(t.file):t.message&&o({kind:"pick",error:t.message})},w=e=>{let t=e.files?.[0];e.value="",t&&v(t)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"-mx-1 scrollbar-none flex min-h-0 flex-1 animate-swap-in flex-col gap-2 overflow-y-auto px-1 pb-3",children:s?(0,t.jsxs)(O,{testId:"import-sign-in-gate",children:[(0,t.jsx)(L,{icon:c.Sparkles}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-body-strong font-bold text-fg",children:"Sign in to import your flights"}),(0,t.jsx)("p",{className:"mt-0.5 text-body-sm text-fg-tertiary",children:"It's free with a weather.com account."})]}),(0,t.jsx)(R.default,{className:"rounded-full bg-interactive px-4 py-2 text-label font-bold text-fg-on-interactive hover:bg-interactive-hover",children:"Sign in"})]}):"reading"===a.kind?(0,t.jsxs)(O,{testId:"add-flight-import-reading",status:!0,children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"size-5 animate-spin rounded-full border-2 border-current border-t-transparent text-fg-interactive"}),(0,t.jsx)("p",{className:"text-body-strong font-bold text-fg",children:"Reading your booking…"}),(0,t.jsx)("button",{type:"button",onClick:()=>{x.current?.abort(),o({kind:"pick",error:null})},className:"text-label font-semibold text-fg-interactive hover:underline",children:"Cancel"})]}):"read"===a.kind?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(D,{children:"In this booking"}),a.legs.map((e,n)=>(0,t.jsx)(j.Rise,{i:n,children:(0,t.jsx)(B,{leg:e})},e.id)),a.landed.length>0&&(0,t.jsx)("p",{"data-testid":"add-flight-import-landed",className:"text-caption text-fg-secondary",children:(0,N.landedImportMessage)(a.landed,0===a.legs.length)}),a.legs.length>0&&(0,t.jsx)("button",{type:"button","data-testid":"add-flight-import-track",disabled:a.tracked,onClick:()=>{i(a.legs)&&o({...a,tracked:!0})},className:(0,b.cn)("mt-1 flex press-97 items-center justify-center gap-1.5 rounded-full px-4 py-2.5 text-label font-bold focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none",a.tracked?"bg-success-subtle text-fg-success":"bg-interactive text-fg-on-interactive hover:bg-interactive-hover"),children:a.tracked?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.Check,{size:16,strokeWidth:2.6,"aria-hidden":!0}),"Tracking"]}):1===a.legs.length?"Track this flight":`Track these ${a.legs.length} flights`}),(0,t.jsx)("button",{type:"button",onClick:()=>o({kind:"pick",error:null}),className:"mx-auto mt-1 text-label font-semibold text-fg-interactive hover:underline",children:"Import another booking"})]}):(0,t.jsxs)(t.Fragment,{children:[e?(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,t.jsx)(E,{icon:S.ImagePlus,testId:"add-flight-import-choose",onClick:()=>g.current?.click(),children:"Choose photo"}),(0,t.jsx)(E,{icon:A.Camera,testId:"add-flight-import-camera",onClick:()=>m.current?.click(),children:"Take photo"})]}):(0,t.jsxs)("div",{"data-testid":"add-flight-import-drop",onDragOver:e=>{e.preventDefault(),f(!0)},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||f(!1)},onDrop:e=>{e.preventDefault(),f(!1);let t=(0,N.imageIn)(e.dataTransfer);t&&v(t)},className:(0,b.cn)("flex flex-col items-center gap-3 rounded-card border-[1.5px] border-dashed px-4 py-8 text-center transition-hover",u?"border-interactive bg-interactive-subtle":"border-default bg-surface"),children:[(0,t.jsx)(L,{icon:S.ImagePlus}),(0,t.jsx)("p",{className:"text-body-strong font-bold text-fg",children:u?"Drop to import":"Drag or paste a screenshot here"}),(0,t.jsxs)("div",{className:"mt-1 flex flex-wrap justify-center gap-2",children:[(0,t.jsx)(F,{primary:!0,onClick:()=>g.current?.click(),children:"Choose image"}),p&&(0,t.jsx)(F,{onClick:()=>void C(N.imageFromScreen),children:"Take screenshot"})]})]}),a.error&&(0,t.jsxs)("p",{role:"alert","data-testid":"add-flight-import-error",className:"flex items-start gap-2 rounded-control border border-danger-subtle bg-danger-subtle px-3 py-2.5 text-body-sm text-fg-danger",children:[(0,t.jsx)(l.CircleAlert,{size:16,"aria-hidden":!0,className:"mt-0.5 shrink-0"}),a.error]})]})}),(0,t.jsx)("input",{ref:g,type:"file",accept:"image/*",className:"hidden","data-testid":"add-flight-import-file",onChange:e=>w(e.currentTarget)}),(0,t.jsx)("input",{ref:m,type:"file",accept:"image/*",capture:"environment",className:"hidden",onChange:e=>w(e.currentTarget)})]})}function L({icon:e,className:n}){return(0,t.jsx)("span",{className:(0,b.cn)("flex size-11 shrink-0 items-center justify-center rounded-[14px] bg-interactive-subtle text-fg-interactive",n),children:(0,t.jsx)(e,{size:20,"aria-hidden":!0})})}function E({icon:e,testId:n,onClick:r,children:i}){return(0,t.jsxs)("button",{type:"button","data-testid":n,onClick:r,className:"flex press-97 flex-col items-center gap-2 rounded-[18px] border border-subtle bg-surface px-1.5 pt-3.5 pb-3 hover-ring focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none",children:[(0,t.jsx)(L,{icon:e,className:"size-10 rounded-[12px]"}),(0,t.jsx)("span",{className:"text-body-strong text-fg",children:i})]})}function O({testId:e,status:n=!1,children:r}){return(0,t.jsx)("div",{"data-testid":e,role:n?"status":void 0,className:"flex flex-col items-center gap-3 rounded-card border border-subtle bg-surface px-5 py-7 text-center",children:r})}function F({primary:e=!1,onClick:n,children:r}){return(0,t.jsx)("button",{type:"button",onClick:n,className:(0,b.cn)("flex press-95 items-center rounded-full px-3.5 py-2 text-label font-bold whitespace-nowrap focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none",e?"bg-interactive text-fg-on-interactive hover:bg-interactive-hover":"bg-surface-muted text-fg hover:bg-surface-muted-hover"),children:r})}function B({leg:e}){let n=(0,k.useKnownAirportTimezone)(e.originIata),r=(0,k.useKnownAirportTimezone)(e.destinationIata);return(0,t.jsxs)("div",{"data-testid":"add-flight-import-leg",className:"flex items-center gap-3 rounded-card border border-subtle bg-surface p-3",children:[(0,t.jsx)(v.default,{iata:e.identIcao&&e.identIata!==e.identIcao?e.identIata.slice(0,2):"",size:38}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-px text-card-title font-bold text-fg",children:[e.originIata,(0,t.jsx)(l.PlaneGlyph,{size:16,className:"mx-0.5"}),e.destinationIata,(0,t.jsx)("span",{className:"ml-1.5 text-caption font-normal text-fg-tertiary",children:e.identIata})]}),(0,t.jsxs)("p",{className:"truncate text-caption text-fg-secondary tabular",children:[M(e.scheduledDate,{weekday:"short",month:"short",day:"numeric"})," ","· ",I(e.scheduledDepartureAt,n)," →"," ",I(e.scheduledArrivalAt,r)]})]})]})}let U={neutral:"text-fg-tertiary",success:"text-fg-success",warning:"text-fg-warning",danger:"text-fg-danger"},K={neutral:"bg-fg-tertiary",success:"bg-success",warning:"bg-warning",danger:"bg-danger"},H=null;function G({phone:e,itineraries:o,remainingFreeLegs:s,onTrack:d,onView:u,onLiveFlight:f,connectFrom:y,onLimit:A,onClose:S,inputRef:N}){let[k,R]=(0,n.useState)(!1),I=(0,n.useRef)(null),[L,E]=(0,n.useState)(0),O=e=>L?(0,t.jsx)(C.default,{dir:L,className:"flex min-h-0 flex-1 flex-col",children:e},k?"import":"search"):e,F=(0,h.useUnits)(),B=(0,n.useRef)(null),U=(0,n.useMemo)(()=>(0,r.dateChips)(),[]),[K,W]=(0,n.useState)(""),Z=(0,n.useRef)(""),J=e=>{Z.current=e,W(e)},[X,Q]=(0,n.useState)(null),q=(0,n.useRef)(null),ee=e=>{q.current=e,Q(e)},et=y?(0,g.legArrivalCode)(y):null,en=(0,n.useMemo)(()=>y?(0,g.connectionWindow)(y):null,[y]),[er,ei]=(0,n.useState)(et?[et]:[]),[ea,eo]=(0,n.useState)(()=>y?(0,r.connectionDate)(y):null),[es,el]=(0,n.useState)(""),[ec,ed]=(0,n.useState)(""),[eu,ef]=(0,n.useState)(!1),[ep,eh]=(0,n.useState)(null),[eg,em]=(0,n.useState)(!1),[ex,eb]=(0,n.useState)(!1),[ev,ey]=(0,n.useState)({}),ej=(e,t)=>ey(n=>({...n,[e.key]:{state:t,flight:e}})),eC=(0,r.ymdIn)(r.TRACK_LEAD_DAYS),ew=(0,r.ymdIn)(r.MAX_DAYS_AHEAD),eA=(0,r.onlyConnectPill)(er,et),eS=!!en,eN=(0,r.addFlightQuery)({q:K,airline:X,from:es,to:ec,airports:er,connectCode:et}),ek=(0,r.parseQuery)(eN),eR=en&&ep?(0,i.connectionResults)(ep,en):ep,eM=(0,r.addFlightStep)({query:ek,date:ea,today:U[0].ymd,airline:!!X,busy:eg,found:eR?.length??null,failed:ex}),eI=!!X&&!/^\d/.test(K.trim()),eD=(0,n.useRef)(null),eT=e=>{eo(e),ef(!1),(0,r.needsDestination)(ek,e,U[0].ymd)&&(eI?eD:N).current?.focus()},eP="day"===eM,eL=ea===U[0].ymd,eE=!!ea&&!U.some(e=>e.ymd===ea),eO="to"===eM,eF=eP||eO?"none":ek.kind,eB=!X&&(!er.length||eA)&&(0,r.isNameText)(K.trim())?(0,r.findAirlines)(K):[],[eU,eK]=(0,n.useState)(null),[eH,eG]=(0,n.useState)(!1),e$=(er.length?K.replace(/^\s*to\s+/i,""):K).trim(),e_=!X&&er.length=r.MIN_PLACE_TEXT&&(0,r.isNameText)(e$);(0,n.useEffect)(()=>{if(!e_||eU)return;let e=!0;return(0,x.airportPlaces)().then(t=>{e&&(eK(t),eG(!1))},()=>e&&eG(!0)),()=>{e=!1}},[e_,eU,e$]);let ez=(0,n.useMemo)(()=>e_&&eU?(0,r.findPlaceAirports)(e$,eU).filter(e=>!er.includes(e.iata)):[],[e_,eU,e$,er]),eV=(0,r.airportFirst)(K,eB,ez);(0,n.useEffect)(()=>{if("none"===eF){eh(null),eb(!1),em(!1);return}let e=!0;em(!0),eb(!1);let t=setTimeout(async()=>{let t=await (0,x.searchFlights)(ek,ea,{airline:X?.iata,departsBetween:eS&&en&&"airport"===ek.kind?en:void 0}).catch(()=>null);e&&(eb(!t?.ok),eh(t?.ok?t.data:[]),em(!1))},i.SEARCH_DEBOUNCE_MS);return()=>{e=!1,clearTimeout(t)}},[eN,ea,eF,X?.iata,eS]);let eW=(0,n.useMemo)(()=>(0,i.trackedLegOf)(o.flatMap(e=>e.legs)),[o]),eZ=()=>null===s?null:s-Object.values(ev).filter(e=>"done"===e.state&&null===eW(e.flight)).length,eJ=e=>{ee(e),J(""),N.current?.focus()},eY=e=>{ei(t=>t.lengthArray.from(B.current?.querySelectorAll("[data-nav]")??[]),eQ=(0,r.addFlightPrompt)(eM,X?.short??null),eq=X?`${X.short} flight number`:1===er.length?"Where to?":er.length?"":"Airline, flight number, route, or airport",e0=M(ea??U[0].ymd,{weekday:"short",month:"short",day:"numeric"}),e1=M(ea??U[0].ymd,{month:"short",day:"numeric"}),e2="airport"===ek.kind?ek.code:"";if(k)return O((0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.PageSheetHead,{title:"Import a booking",subtitle:"We'll read the flights from your confirmation.",onBack:()=>{R(!1),E(-1),requestAnimationFrame(()=>I.current?.focus())},backLabel:"Back to search",backTestId:"add-flight-import-back",onClose:S,closeTestId:"add-flight-close"}),(0,t.jsx)(P,{phone:e,signedOut:null!==s,onTrack:e=>{let t=eZ();return null!==t&&t0&&(0,t.jsxs)("div",{className:"mb-2 flex flex-col gap-1.5",children:[(0,t.jsx)(D,{children:"Airlines"}),eB.map((e,n)=>(0,t.jsx)(j.Rise,{i:n,children:(0,t.jsxs)("button",{type:"button","data-nav":!0,"data-testid":`add-flight-airline-${e.iata}`,onClick:()=>eJ(e),className:"flex w-full press-97 items-center gap-3 rounded-[14px] border border-subtle bg-surface px-3 py-2.5 text-left hover-ring focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none",children:[(0,t.jsx)(v.default,{iata:e.iata,size:30}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-card-title font-bold text-fg",children:e.name}),(0,t.jsx)("span",{className:"text-caption text-fg-tertiary",children:e.iata}),(0,t.jsx)(l.ChevronRight,{size:14,"aria-hidden":!0,className:"text-fg-tertiary"})]})},e.iata))]}),e4=ez.length>0&&(0,t.jsxs)("div",{className:"mb-2 flex flex-col gap-1.5",children:[(0,t.jsx)(D,{children:"Airports"}),ez.map((e,n)=>(0,t.jsx)(j.Rise,{i:n,children:(0,t.jsxs)("button",{type:"button","data-nav":!0,"data-testid":`add-flight-place-${e.iata}`,onClick:()=>eY(e.iata),className:"flex w-full press-97 items-center gap-3 rounded-[14px] border border-subtle bg-surface px-3 py-2.5 text-left hover-ring focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none",children:[(0,t.jsx)("span",{className:"flex h-6.5 w-14 shrink-0 items-center justify-center rounded-full bg-interactive-subtle text-body-strong tracking-wide text-fg tabular",children:e.iata}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"block truncate text-body-strong font-bold text-fg",children:e.name}),(0,t.jsx)("span",{className:"block truncate text-caption text-fg-tertiary",children:(e=>{if("US"===e.country||!e.country)return e.city;let t=(H??=new Intl.DisplayNames(["en"],{type:"region"})).of(e.country)??e.country;return e.city?`${e.city}, ${t}`:t})(e)})]}),null!==e.miles&&(0,t.jsx)("span",{className:"shrink-0 text-caption text-fg-tertiary tabular",children:(0,p.formatMiles)(e.miles,F)}),(0,t.jsx)(l.ChevronRight,{size:14,"aria-hidden":!0,className:"shrink-0 text-fg-tertiary"})]})},e.iata))]});return O((0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.PageSheetHead,{title:y?"Add a connecting flight":"Add a flight",subtitle:eQ??(y?`After ${y.identIata}${et?` into ${et}`:""}.`:"We'll forecast the weather along the way."),onClose:S,closeTestId:"add-flight-close"}),(0,t.jsxs)("div",{className:"shrink-0",children:[(0,t.jsxs)("div",{className:"flex h-13 items-center gap-2.5 rounded-[14px] border-[1.5px] border-default bg-surface px-3.5 transition-hover focus-within:border-interactive focus-within:ring-4 focus-within:ring-interactive/20",children:[(0,t.jsx)(l.Search,{size:18,"aria-hidden":!0,className:"shrink-0 text-fg-tertiary"}),X&&(0,t.jsxs)(z,{label:`Remove ${X.name}`,testId:"add-flight-remove-airline",className:"gap-1.5 pl-0.75",onRemove:()=>{ee(null),N.current?.focus()},children:[(0,t.jsx)(v.default,{iata:X.iata,size:20}),X.short]}),er.map(e=>(0,t.jsx)(z,{label:`Remove ${e}`,testId:`add-flight-airport-${e}`,className:"pl-2.5 tracking-wide tabular",onRemove:()=>{ei(t=>t.filter(t=>t!==e)),N.current?.focus()},children:e},e)),(0,t.jsx)("input",{ref:N,value:K,onChange:e=>{var t;let n;return J(t=e.target.value),!X&&(!er.length||eA)&&(0,r.airlineLockCandidate)(t)&&(0,x.airportPlaces)().catch(()=>null).then(e=>{let t=q.current?null:(0,r.airlineLock)(Z.current,e);t&&(ee(t.airline),J(t.rest))}),void((n=(0,r.lockCandidate)(t,{airports:er,airline:!!X}))&&Promise.all([(0,m.icaoOf)(n),(0,x.airportPlaces)().catch(()=>null)]).then(([e,t])=>{let i=(0,r.afterLocked)(Z.current,n);!e||!t||null===i||q.current||(0,r.isPlaceWord)(n,t)||(ei(e=>e.length{if("Backspace"===e.key&&!K&&er.length?(e.preventDefault(),J(er.at(-1)),ei(e=>e.slice(0,-1))):"Backspace"===e.key&&!K&&X&&ee(null),"Enter"===e.key&&eB[0]&&!eV?(e.preventDefault(),eJ(eB[0])):"Enter"===e.key&&ez[0]&&(e.preventDefault(),eY(ez[0].iata)),"ArrowDown"===e.key){let t=eX()[0];t&&(e.preventDefault(),t.focus())}},placeholder:eq,"aria-label":"Airline, flight number, route, or airport","data-testid":"flight-search-input",inputMode:"search",enterKeyHint:"search",autoComplete:"off",autoCorrect:"off",autoCapitalize:"characters",spellCheck:!1,className:(0,b.cn)("h-12 min-w-0 flex-1 bg-transparent text-fg outline-none placeholder:text-fg-tertiary",K?"text-title":"text-body")})]}),eI&&(0,t.jsxs)(j.Rise,{className:"mt-2.5 flex items-center gap-2.5",children:[(0,t.jsx)($,{label:"From",value:es,placeholder:"BOS",onChange:el,testId:"add-flight-from"}),(0,t.jsx)(l.PlaneGlyph,{size:22,className:"shrink-0 opacity-60"}),(0,t.jsx)($,{label:eL||!ea?"To · optional":"To",value:ec,placeholder:"LAX",onChange:ed,testId:"add-flight-to",inputRef:eD})]}),eP||ea?(0,t.jsx)(j.Rise,{className:"my-3",children:(0,t.jsxs)("div",{className:"flex flex-wrap gap-1.5",role:"group","aria-label":"Day of the flight",children:[U.map((e,n)=>(0,t.jsx)(_,{on:ea===e.ymd,testId:0===n?"date-tab-today":"date-tab-tomorrow",onClick:()=>eT(e.ymd),children:e.label},e.ymd)),(0,t.jsxs)(_,{on:eE,open:eu,testId:"add-flight-pick-date",onClick:()=>ef(!eu),ariaExpanded:eu,children:[(0,t.jsx)(l.Calendar,{size:14,"aria-hidden":!0}),(0,t.jsx)("span",{className:"truncate",children:eE?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"max-sm:hidden",children:e0}),(0,t.jsx)("span",{className:"sm:hidden",children:e1})]}):"Pick a date"}),(0,t.jsx)(l.ChevronDown,{size:12,strokeWidth:2.6,"aria-hidden":!0,className:(0,b.cn)("opacity-70 transition-reveal max-sm:hidden",eu&&"rotate-180")})]})]})}):(0,t.jsx)("div",{"aria-hidden":!0,className:"h-3"})]}),(0,t.jsxs)("div",{ref:B,onKeyDown:e=>{if("ArrowDown"!==e.key&&"ArrowUp"!==e.key)return;let t=eX(),n=t.indexOf(document.activeElement);if(n{let n=(0,r.findAirlines)(e)[0];return n?(0,t.jsxs)("button",{type:"button","data-nav":!0,"data-testid":`add-flight-popular-airline-${n.iata}`,onClick:()=>eJ(n),className:"flex press-97 flex-col items-center gap-2 rounded-[18px] border border-subtle bg-surface px-1.5 pt-3.5 pb-3 hover-ring focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none",children:[(0,t.jsx)(v.default,{iata:e,size:40}),(0,t.jsx)("span",{className:"text-body-strong text-fg",children:n.short})]},e):null})}),!y&&(0,t.jsxs)("button",{ref:I,type:"button","data-nav":!0,"data-testid":"add-flight-import",onClick:()=>{R(!0),E(1)},className:"mt-2 flex w-full press-97 items-center gap-3 rounded-[14px] border border-subtle bg-surface px-3 py-2.5 text-left hover-ring focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none",children:[(0,t.jsx)("span",{className:"flex size-[30px] shrink-0 items-center justify-center rounded-[10px] bg-interactive-subtle text-fg-interactive",children:(0,t.jsx)(c.Sparkles,{size:16,"aria-hidden":!0})}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"block truncate text-body-strong font-bold text-fg",children:"Import a booking"}),(0,t.jsx)("span",{className:"block truncate text-caption text-fg-tertiary",children:"From a screenshot or a photo of your confirmation"})]}),(0,t.jsx)(l.ChevronRight,{size:14,"aria-hidden":!0,className:"shrink-0 text-fg-tertiary"})]})]}),"none"!==eF&&(0,t.jsx)(D,{children:"Flights"}),(0,t.jsx)("p",{role:"status",className:"sr-only",children:"none"===eF?"":eg?"Searching":ex?"Couldn't search right now":eR?.length===0?eS&&(ep?.length||"airport"===eF)?"No connections found":"No flights found":eR?`${eR.length} ${1===eR.length?"flight":"flights"} found`:""}),"none"!==eF&&eg&&(0,t.jsx)("div",{className:"flex flex-col gap-2","aria-hidden":!0,children:[0,1,2].map(e=>(0,t.jsx)("div",{className:"h-18 animate-pulse rounded-card border border-subtle bg-surface"},e))}),"none"!==eF&&!eg&&ex&&(0,t.jsx)(T,{title:"Couldn't search right now",children:"Check your connection and try again."}),"none"!==eF&&!eg&&!ex&&eS&&eR?.length===0&&(!!ep?.length||"airport"===eF)&&(0,t.jsxs)(T,{title:"No connections found",children:["No flight from ",et," that day leaves after"," ",y.identIata," lands. Try another date."]}),"none"!==eF&&!eg&&!ex&&!(eS&&"airport"===eF)&&ep?.length===0&&(0,t.jsx)(T,{title:"No flights found",children:"flight"!==eF?`No ${X?`${X.short} `:""}flights on this route that day. Try another date.`:ea>eC?`Flight numbers can be looked up about ${r.TRACK_LEAD_DAYS} days ahead. For a later trip, search the route, like BOS LAX.`:"Check the flight number or try another date."}),!eg&&!ex&&eR?.map((e,n)=>{var r;let o;return(0,t.jsx)(j.Rise,{i:Math.min(n,6),children:(0,t.jsx)(V,{f:e,state:(r=e,o=ev[r.key]?.state,null!==eW(r)?"done":o??"idle"),onView:()=>(e=>{let t=eW(e);if(t)return u(t),S();let n=eZ();if(null!==n&&ne&&f(r.id,e)).catch(e=>console.warn("The live flight did not load after View",e))})(e)})},e.key)})]})]}))}function $({label:e,value:n,placeholder:i,onChange:a,testId:o,inputRef:s}){return(0,t.jsxs)("label",{className:"flex min-w-0 flex-1 flex-col gap-0.5 rounded-control border-[1.5px] border-default bg-surface px-3 py-2 transition-hover focus-within:border-interactive",children:[(0,t.jsx)("span",{className:"text-overline font-bold text-fg-tertiary",children:e}),(0,t.jsx)("input",{ref:s,value:n,onChange:e=>a((0,r.upper3)(e.target.value)),placeholder:i,"data-testid":o,autoComplete:"off",autoCorrect:"off",autoCapitalize:"characters",spellCheck:!1,className:"w-full min-w-0 bg-transparent text-stat font-bold tracking-widest text-fg outline-none placeholder:text-fg-disabled"})]})}function _({on:e,open:n=!1,onClick:r,testId:i,ariaExpanded:a,children:o}){return(0,t.jsx)("button",{type:"button",onClick:r,"data-testid":i,"aria-pressed":void 0===a?e:void 0,"aria-expanded":a,className:(0,b.cn)("flex h-8.5 min-w-0 flex-1 press-95 items-center justify-center gap-1 rounded-full border-[1.5px] px-2 text-label font-semibold whitespace-nowrap focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none sm:flex-none sm:gap-1.5 sm:px-3.5",e?"border-transparent bg-interactive text-fg-on-interactive":n?"border-interactive bg-surface text-fg-secondary":"border-transparent bg-surface text-fg-secondary hover:bg-surface-muted"),children:o})}function z({label:e,testId:n,className:r,onRemove:i,children:a}){return(0,t.jsxs)("button",{type:"button",onClick:i,"aria-label":e,"data-testid":n,className:(0,b.cn)("group/token flex h-6.5 shrink-0 press-95 animate-swap-in items-center rounded-full bg-interactive-subtle pr-2 text-body-strong text-fg focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none",r),children:[a,(0,t.jsx)("span",{"aria-hidden":!0,className:"flex w-0 justify-end overflow-hidden opacity-0 transition-[width,opacity] duration-fast ease-standard group-hover/token:w-4 group-hover/token:opacity-100 group-focus-visible/token:w-4 group-focus-visible/token:opacity-100 pointer-coarse:w-4 pointer-coarse:opacity-100",children:(0,t.jsx)(l.X,{size:11,strokeWidth:3,className:"shrink-0 text-fg-secondary"})})]})}function V({f:e,state:n,onView:a}){let c=(0,i.displayCode)(e.origin),d=(0,i.displayIdent)(e.ident),f=(0,u.useAirportImpact)(e.origin.icao),p=f?(0,o.impactNoteAt)(f,e.out,c):null,h=p?s.IMPACT_LEVEL_PRESENTATION[p.level].tone:"neutral",g=(0,r.trackableFrom)(Date.parse(e.scheduledOut));return(0,t.jsxs)("div",{"data-testid":"route-result",className:"flex items-center gap-3 rounded-card border border-subtle bg-surface p-3",children:[(0,t.jsx)(v.default,{iata:e.ident.airline.iata??"",size:38}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-px text-card-title font-bold text-fg",children:[c,(0,t.jsx)(l.PlaneGlyph,{size:22}),(0,i.displayCode)(e.destination),(0,t.jsx)("span",{className:"ml-1.5 text-caption font-normal text-fg-tertiary",children:d})]}),(0,t.jsxs)("p",{className:"truncate text-caption text-fg-secondary tabular",children:[I(e.out,e.origin.timezone)," →"," ",I(e.in,e.destination.timezone),e.aircraftType?` \xb7 ${e.aircraftType}`:"",e.lateMinutes>0?` \xb7 ${e.lateMinutes}m late`:""]}),p&&(0,t.jsxs)("p",{className:(0,b.cn)("mt-1 flex items-center gap-1.5 text-caption font-semibold",U[h]),children:[(0,t.jsx)("span",{"aria-hidden":!0,className:(0,b.cn)("size-2 shrink-0 rounded-full",K[h])}),p.text]}),!e.live&&g>Date.now()&&(0,t.jsxs)("p",{className:"mt-1 flex items-center gap-1.5 text-caption font-semibold text-fg-tertiary",children:[(0,t.jsx)(l.Calendar,{size:12,"aria-hidden":!0}),"Live tracking starts"," ",new Date(g).toLocaleDateString("en-US",{month:"short",day:"numeric"})]}),"error"===n&&(0,t.jsx)("p",{className:"mt-1 text-caption font-semibold text-fg-danger",children:"Could not add it. Try again."}),"cannot-connect"===n&&(0,t.jsx)("p",{className:"mt-1 text-caption font-semibold text-fg-danger",children:"It can't connect to this trip now."})]}),(0,t.jsx)("button",{type:"button","data-nav":!0,"data-testid":"add-flight-view",onClick:a,"aria-label":`View ${d}`,className:"flex shrink-0 press-95 items-center gap-1.25 rounded-full bg-interactive px-3.5 py-2 text-label font-bold whitespace-nowrap text-fg-on-interactive hover:bg-interactive-hover focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none",children:"View"})]})}let W=["S","M","T","W","T","F","S"],Z=e=>String(e).padStart(2,"0"),J=e=>{let[t,n]=e.split("-").map(Number);return 12*t+n-1};function Y({value:e,min:i,max:a,liveUntil:o,onPick:s}){let[c,d]=(0,n.useState)(()=>{let[t,n]=(e??i).split("-").map(Number);return{y:t,m:n-1}}),u=new Date(c.y,c.m,1).getDay(),f=new Date(c.y,c.m+1,0).getDate(),p=12*c.y+c.m,h=p>J(i),g=pd(({y:t,m:n})=>{let r=new Date(t,n+e,1);return{y:r.getFullYear(),m:r.getMonth()}}),x=[...Array(u).fill(null),...Array.from({length:f},(e,t)=>t+1)],v="flex size-8 press-92 items-center justify-center rounded-[10px] text-fg-secondary hover:bg-surface-muted disabled:pointer-events-none disabled:opacity-25 focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none";return(0,t.jsxs)("div",{"data-testid":"add-flight-calendar",className:"rounded-sheet border border-subtle bg-surface p-3.5",children:[(0,t.jsxs)("div",{className:"mb-2.5 flex items-center justify-between",children:[(0,t.jsx)("button",{type:"button",disabled:!h,onClick:()=>m(-1),"aria-label":"Previous month",className:v,children:(0,t.jsx)(l.ChevronLeft,{size:16,strokeWidth:2.4,"aria-hidden":!0})}),(0,t.jsx)("span",{className:"text-body-strong font-bold text-fg",children:new Date(c.y,c.m,1).toLocaleDateString("en-US",{month:"long",year:"numeric"})}),(0,t.jsx)("button",{type:"button",disabled:!g,onClick:()=>m(1),"aria-label":"Next month",className:v,children:(0,t.jsx)(l.ChevronRight,{size:16,strokeWidth:2.4,"aria-hidden":!0})})]}),(0,t.jsxs)("div",{className:"grid grid-cols-7",children:[W.map((e,n)=>(0,t.jsx)("span",{"aria-hidden":!0,className:"pt-1 pb-1.5 text-center text-overline font-bold text-fg-tertiary",children:e},n)),x.map((n,r)=>{if(!n)return(0,t.jsx)("span",{},r);let l=`${c.y}-${Z(c.m+1)}-${Z(n)}`,d=la,u=l===e;return(0,t.jsx)("span",{className:"p-px",children:(0,t.jsxs)("button",{type:"button",disabled:d,onClick:()=>s(l),"aria-label":M(l,{weekday:"long",month:"long",day:"numeric"}),"aria-pressed":u,"data-testid":`add-flight-day-${l}`,className:(0,b.cn)("relative flex h-9.5 w-full press-92 items-center justify-center rounded-control text-body-strong tabular focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none",u?"bg-interactive text-fg-on-interactive":d?"text-fg-tertiary opacity-35":"text-fg hover:bg-surface-muted",l===i&&!u&&"border-[1.5px] border-interactive"),children:[n,!d&&lr(!1),C=(0,n.useRef)(null);if(p)return(0,t.jsx)(y.default,{open:e,onClose:j,signUpOnly:!0});let A=(0,t.jsx)(G,{phone:g,itineraries:i,remainingFreeLegs:a,onTrack:o,onView:s,onLiveFlight:l,connectFrom:c,onLimit:()=>h(!0),onClose:j,inputRef:C},c?.id??"new");return(0,t.jsx)(w.default,{open:e,onOpenChange:r,phone:g,testId:"add-flight-sheet",onOpenAutoFocus:e=>{e.preventDefault(),C.current?.focus()},body:"flush",dialogClassName:d.FLINT_SHEET_HEIGHT,children:(0,t.jsx)("div",{className:(0,b.cn)("flex min-h-0 flex-1 flex-col px-card",!g&&"pb-card"),children:A})})}],70499)},96223,e=>{"use strict";var t=e.i(43476),n=e.i(71645),r=e.i(98041),i=e.i(30086),a=e.i(65408),o=e.i(7146),s=e.i(52236),l=e.i(67795);function c({alert:e,onOpen:d,onDismiss:u}){let[f,p]=(0,n.useState)(!1),[h,g]=(0,n.useState)(null),[m,x]=(0,n.useState)(null),b=(0,n.useRef)(null),v=(0,n.useRef)(!1),y=(0,n.useRef)(null),j=a.ALERT_ICON[e.kind],C=(0,o.splitFlightIdent)(e.ident)?.airline,w=(0,n.useCallback)((e,t={x:0,y:0})=>{let n=y.current?.offsetWidth??0;g(r=>r??{how:e,from:t,width:n})},[]);(0,n.useEffect)(()=>{if(f||h)return;let e=setTimeout(()=>w("fade"),6500);return()=>clearTimeout(e)},[f,h,w]),(0,n.useEffect)(()=>{if(!h)return;let t=setTimeout(()=>u(e.id),r.TOAST_MOTION.outMs);return()=>clearTimeout(t)},[h,e.id,u]);let A=e=>{let t=b.current;if(!t||e.pointerId!==t.id||(b.current=null,"mouse"!==e.pointerType&&p(!1),!v.current))return;setTimeout(()=>v.current=!1);let n=(0,r.toastDrag)(e.clientX-t.x,e.clientY-t.y),i="pointerup"===e.type?(0,r.toastSwipe)(n.x,n.y):null;x(null),i&&w(i,n)};return(0,t.jsxs)("div",{ref:y,"data-testid":"alert-toast",role:"status",onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),onFocus:()=>p(!0),onBlur:()=>p(!1),onPointerDown:e=>{!h&&e.isPrimary&&0===e.button&&(b.current={x:e.clientX,y:e.clientY,id:e.pointerId},v.current=!1,"mouse"!==e.pointerType&&p(!0))},onPointerMove:e=>{let t=b.current;if(!t||e.pointerId!==t.id)return;let n=e.clientX-t.x,i=e.clientY-t.y;!v.current&&Math.hypot(n,i){v.current?t.preventDefault():(d(e),w("fade"))},className:"flex w-full min-w-0 items-center gap-inline rounded-card px-3.5 py-3 text-left focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none",children:[(0,t.jsx)("span",{className:(0,s.cn)("flex size-8 shrink-0 items-center justify-center rounded-tile bg-current/16",a.ALERT_COLOR_CLASS[e.severity]),children:(0,t.jsx)(j,{size:16,"aria-hidden":"true"})}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{"data-testid":"alert-toast-title",className:"block truncate text-toast-title text-fg",children:e.title}),(0,t.jsx)("span",{className:"block truncate text-toast-body text-fg-secondary",children:e.body})]}),C&&(0,t.jsx)(l.default,{iata:C,size:26})]}),(0,t.jsx)("button",{type:"button",onClick:()=>w("fade"),"aria-label":"Dismiss notification",className:"absolute -top-2 -left-2 flex size-5.5 press-90 items-center justify-center rounded-full border border-subtle bg-surface-muted text-fg shadow-sm before:absolute before:-inset-3 before:rounded-full before:content-[''] focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none",children:(0,t.jsx)(i.X,{size:10,strokeWidth:3.4,"aria-hidden":"true"})})]})}e.s(["default",0,function({alerts:e,onOpen:r}){let[i,a]=(0,n.useState)([]),o=(0,n.useRef)(new Set),s=(0,n.useRef)(null);(0,n.useEffect)(()=>{var t,n;s.current??=Date.now();let r=(t=o.current,n=s.current,e.filter(e=>!e.readAt&&!t.has(e.id)&&Date.parse(e.createdAt)>=n).sort((e,t)=>Date.parse(e.createdAt)-Date.parse(t.createdAt)));if(0!==r.length){for(let e of r)o.current.add(e.id);a(e=>0===r.length?e:[...e,...r].slice(-3))}},[e]);let l=(0,n.useCallback)(e=>a(t=>t.filter(t=>t.id!==e)),[]);return(0,t.jsx)("div",{role:"region","aria-label":"Notifications",className:"pointer-events-none fixed top-17 right-4 z-[70] flex w-98 max-w-[calc(100vw-2rem)] flex-col gap-2",children:i.map(e=>(0,t.jsx)(c,{alert:e,onOpen:r,onDismiss:l},e.id))})}],96223)},79764,55117,35396,e=>{"use strict";var t=e.i(43476),n=e.i(55104),r=e.i(71645),i=e.i(13737),a=e.i(84275),o=e.i(30086);e.i(73052);var s=e.i(7146),l=e.i(55529);e.i(72461);var c=e.i(75471),d=e.i(57556),u=e.i(21291),f=e.i(52236),p=e.i(82697),h=e.i(11084),g=e.i(67795),m=e.i(59611);let x=(0,r.createContext)({compact:!1,dragProps:{},onActiveCardTap:()=>{},wasDrag:()=>!1,pastFlights:{open:!1,onOpenChange:()=>{}},pickFlight:!1}),b=x.Provider,v=()=>(0,r.useContext)(x);e.s(["FlintSheetProvider",0,b,"useFlintSheetContext",0,v],55117);let y=e=>(e.firstElementChild instanceof HTMLElement?e.firstElementChild.offsetWidth:300)+10;function j({label:e,activeIndex:n,activeKey:i,onActiveChange:a,children:o}){let{compact:s,dragProps:l}=v(),c=(0,r.useRef)(null),d=(0,r.useRef)(null),u=o.length,p=(0,r.useRef)(void 0),h=(0,r.useRef)(!1),g=(0,r.useRef)(-1),x=(0,r.useRef)(n);x.current=n;let b=(0,r.useCallback)(()=>{d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{d.current=null;let e=c.current;if(!e)return;if(h.current){h.current=!1;let t=x.current*y(e);x.current>=0&&Math.abs(e.scrollLeft-t)>4&&e.scrollTo({left:t,behavior:"auto"});return}let t=(0,m.carouselIndex)(e.scrollLeft,y(e),u);t!==n&&(g.current=t,a(t))},120)},[n,u,a]);(0,r.useEffect)(()=>()=>{d.current&&clearTimeout(d.current)},[]);let C=(0,r.useRef)(null),w=(0,r.useRef)(null);return(0,r.useEffect)(()=>()=>w.current?.(),[]),(0,r.useLayoutEffect)(()=>{let e=c.current;if(!e||n4){let n=window.matchMedia("(prefers-reduced-motion: reduce)").matches;e.scrollTo({left:t,behavior:n||r?"auto":"smooth"})}},[n,i,u]),(0,t.jsxs)("div",{"data-testid":"flint-carousel","data-compact":s||void 0,className:"flex flex-1 flex-col",children:[(0,t.jsx)("div",{ref:c,role:"region","aria-roledescription":"carousel","aria-label":e,onScroll:b,onPointerDown:e=>{if(!e.currentTarget.contains(e.target))return;l.onPointerDown?.(e);let t=c.current;if(!t||"mouse"!==e.pointerType||0!==e.button)return;C.current={x:e.clientX,left:t.scrollLeft,moved:!1};let n=e=>{let n=C.current;if(!n)return;let r=e.clientX-n.x;!n.moved&&5>=Math.abs(r)||(n.moved||(n.moved=!0,t.style.scrollSnapType="none",t.style.userSelect="none"),t.scrollLeft=n.left-r)},r=()=>{window.removeEventListener("pointermove",n),window.removeEventListener("pointerup",i),window.removeEventListener("pointercancel",i),w.current=null,C.current=null,t.style.scrollSnapType="",t.style.userSelect=""};w.current=r;let i=e=>{let n=C.current;if(r(),!n?.moved)return;let i=(0,m.carouselIndex)(n.left-(e.clientX-n.x),y(t),u);t.scrollTo({left:i*y(t),behavior:"smooth"});let a=e=>{e.preventDefault(),e.stopPropagation()};window.addEventListener("click",a,{capture:!0,once:!0}),setTimeout(()=>window.removeEventListener("click",a,!0),0)};window.addEventListener("pointermove",n),window.addEventListener("pointerup",i),window.addEventListener("pointercancel",i)},className:(0,f.cn)("flex flex-1 touch-pan-x snap-x snap-mandatory [scrollbar-width:none] gap-2.5 overflow-x-auto overscroll-x-contain px-3.5 pt-0.5 [&::-webkit-scrollbar]:hidden","transition-[max-height,padding] duration-[450ms] ease-out",s?"max-h-[90px] pb-2":"max-h-[260px] pb-3.5"),children:o.map((e,n)=>(0,t.jsx)("div",{role:"group","aria-roledescription":"slide","aria-label":`${n+1} of ${u}`,className:"w-full flex-none press-97 snap-center",children:e},n))}),(0,t.jsx)("div",{"aria-hidden":"true",className:(0,f.cn)("-mt-1.5 flex justify-center gap-[5px] transition-[height,opacity,margin] duration-300",s?"mb-0 h-0 opacity-0":"mb-2 h-1.5"),children:o.slice(0,12).map((e,r)=>(0,t.jsx)("i",{className:(0,f.cn)("h-1.5 rounded-[3px] transition-[width,background-color] duration-300",r===n?"w-[18px] bg-fg":"w-1.5 bg-fg-disabled/40")},r))})]})}function C({kind:e,hasItems:n,compact:r=!1}){let i="airport"===e;return(0,t.jsxs)("section",{"data-testid":"details-empty","data-kind":e,className:(0,f.cn)("flex flex-col items-center justify-center gap-stack-xs px-6 text-center",r?"py-4":"min-h-60 py-section"),children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"mb-stack-xs flex size-12 items-center justify-center rounded-card bg-surface-muted text-fg-secondary",children:i?(0,t.jsx)(o.MapPin,{size:22}):(0,t.jsx)(o.PlaneGlyph,{size:36})}),(0,t.jsx)("h2",{className:"text-title text-fg",children:i?"Select an airport":"Select a flight"}),(0,t.jsx)("p",{className:"max-w-72 text-body-sm text-fg-secondary",children:i?n?"Pick one of your airports to see its delays and weather.":"Search for an airport to see its delays and weather.":n?"Pick one of your flights to see its delay risk and weather.":"Add a flight to see its delay risk and weather."})]})}e.s(["default",0,C],35396);var w=e.i(93086),A=e.i(6895),S=e.i(10845),N=e.i(70727);let k=!1;function R({card:e,active:i,onSelect:m,onRemove:x,onAddConnecting:b}){let{group:y,leg:j,index:C}=e,k=(0,n.useRefreshState)(),{compact:M,onActiveCardTap:I,wasDrag:D}=v(),T=(0,u.useLegRisk)(j),P=(0,h.useWeatherConnectionAccess)(),L=(0,r.useMemo)(()=>(0,d.summarizeTripRisk)([[j]],()=>T,{weatherConnections:P}),[j,T,P]),E=j.snapshot?.origin.iata||j.originIata||"—",O=j.snapshot?.destination.iata||j.destinationIata||"—",F=j.snapshot?.origin.gate??null,B=(0,s.splitFlightIdent)(j.identIata),U=(0,l.legFlightChip)(j,Date.now(),k),K=U?.kind==="stale",{depart:H,arrive:G}=(0,c.legCardTimes)(j),$=(0,c.legProgress)(j),_=y.legs[C+1],z=y.legs.length>1||null!==y.journey||y.itinerary.legs.length>y.legs.length,V=z?[y.itinerary.name,"return"===y.journey?"Return":null,y.legs.length>1?`${C+1} of ${y.legs.length}`:null].filter(Boolean).join(" · "):null,W={onAddConnecting:b,onRemove:x};(0,A.usePublishTripActions)(i,y.itinerary.id,j.identIata,W);let Z=()=>{i?D()||I():m()};return(0,t.jsx)(S.TripMenu,{name:j.identIata,buttonLabel:`${E} to ${O}`,multi:!1,...W,withButton:i,disabled:!i,buttonClassName:(0,f.cn)("absolute right-2",M?"top-2":V?"top-[37px]":"top-[15px]"),children:e=>{var n;let r;return(0,t.jsxs)("div",{"data-testid":"flint-carousel-card","data-selected":i||void 0,className:(0,f.cn)("relative flex h-full flex-col gap-2 overflow-hidden rounded-[20px] border border-subtle bg-surface transition-[opacity,box-shadow] duration-300",i?"shadow-[inset_0_0_0_1.5px_var(--color-interactive)]":"opacity-55",M?"px-3 py-2.5":"p-3.5"),children:[V&&!M&&(0,t.jsx)("span",{"data-testid":"flint-carousel-trip",className:"block truncate text-caption text-fg-secondary",children:V}),(0,t.jsxs)("button",{type:"button",onClick:Z,"aria-label":`${j.identIata} ${E} to ${O}`,"aria-current":i||void 0,className:"block w-full rounded-card text-left focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2.5 pr-8",children:[(0,t.jsx)(g.default,{iata:B?.airline??j.identIata.slice(0,2),size:M?28:34}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"block truncate text-title font-semibold text-fg",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-0.5",children:[E,(0,t.jsx)(o.PlaneGlyph,{size:22,className:"-mx-0.5"}),O]})}),(0,t.jsx)("span",{className:"block truncate text-caption text-fg-tertiary uppercase",children:M?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{className:"font-semibold text-fg",children:H.label??"—"})," → ",(0,t.jsx)("b",{className:"font-semibold text-fg",children:G.label??"—"}),F?` \xb7 Gate ${F}`:""]}):`${B?`${B.airline} ${B.number}`:j.identIata} • ${n=j.scheduledDate,Number.isNaN((r=new Date(`${n}T12:00:00`)).getTime())?"":new Intl.DateTimeFormat("en-US",{weekday:"short",day:"numeric",month:"short"}).format(r).toUpperCase()}`})]}),U&&(0,t.jsx)(N.default,{chip:U})]}),!M&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"mt-3 flex items-end justify-between",children:[(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"block text-label text-fg-tertiary uppercase",children:"Depart"}),(0,t.jsx)("span",{className:(0,f.cn)("block text-headline font-semibold tabular",H.late&&!K&&"text-fg-danger"),children:H.label??"—"})]}),(0,t.jsxs)("span",{className:"text-right",children:[(0,t.jsx)("span",{className:"block text-label text-fg-tertiary uppercase",children:"Arrive"}),(0,t.jsx)("span",{className:(0,f.cn)("block text-headline font-semibold tabular",G.late&&!K&&"text-fg-danger"),children:G.label??"—"})]})]}),(0,t.jsx)("span",{"aria-hidden":"true",className:"relative my-2.5 block h-1 rounded-sm bg-surface-muted",children:(0,t.jsx)("i",{className:"absolute inset-y-0 left-0 rounded-sm bg-interactive",style:{width:`${100*$}%`}})}),(0,t.jsxs)("span",{className:"flex items-center justify-between text-caption text-fg-secondary",children:[(0,t.jsx)("span",{className:"flex items-center gap-1.5",children:K?(0,t.jsx)("span",{"data-testid":"stale-note",children:"Delay risk out of date"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.default,{summary:L}),!L.delay&&(0,t.jsx)("span",{children:"No delay risk flagged"})]})}),F&&(0,t.jsxs)("span",{children:["Gate ",F]})]})]})]}),e,!M&&_&&(0,t.jsx)(w.LayoverRow,{prev:j,leg:_,then:!0,className:"mt-auto border-t border-subtle pt-2"}),!M&&!_&&z&&b&&i&&(0,t.jsxs)("button",{type:"button","data-testid":"trip-add-connection",onClick:b,className:"mt-auto flex w-full items-center gap-1.5 border-t border-subtle pt-2 text-caption text-fg-secondary",children:[(0,t.jsx)(o.Plus,{size:14,"aria-hidden":"true"}),"Add a connection from ",(0,a.legArrivalCode)(j)]})]})}})}e.s(["default",0,function(e){let{itineraries:n,onSelectLeg:o,onAddConnecting:s,selectedItineraryId:l,selectedLegId:c}=e,{pastFlights:d,pickFlight:u}=v();(0,w.useProvidePastFlightsFor)(e,()=>d.onOpenChange(!0));let p=Date.now(),h=(0,a.sortedTripGroups)(n,p),g=(0,w.pastTrips)(h.filter(e=>(0,a.isGroupPast)(e,p))),m=h.filter(e=>!(0,a.isGroupPast)(e,p)||e.legs.some(e=>e.id===c)).flatMap(e=>e.legs.map((t,n)=>({group:e,leg:t,index:n}))),x=m.findIndex(e=>c?e.leg.id===c:e.group.itinerary.id===l),b=(0,r.useRef)(0);x>=0&&(b.current=x);let y=x>=0?x:Math.min(b.current,m.length-1),A=(0,r.useRef)(null);c&&x>=0&&(A.current=c);let S=u?m.find(e=>e.leg.id===A.current)?.leg??(0,a.pickNextLeg)(m.map(e=>e.leg),p):null,N=S?m.find(e=>e.leg===S):void 0;(0,r.useEffect)(()=>{N&&o(N.group.itinerary.id,N.leg)},[N?.leg.id]);let[M,I]=(0,r.useState)(null);return null===M&&m.length>0&&I(!k),(0,r.useEffect)(()=>{if(!M)return;k=!0;let e=setTimeout(()=>I(!1),i.CAROUSEL_RISE.durationMs+i.CAROUSEL_RISE.staggerMs*(i.CAROUSEL_RISE.cards-1));return()=>clearTimeout(e)},[M]),(0,t.jsxs)("div",{"data-testid":"flint-flight-carousel",className:"flex flex-1 flex-col",children:[0===m.length?(0,t.jsx)(C,{kind:"flight",hasItems:!1,compact:!0}):(0,t.jsx)(j,{label:"My flights",activeIndex:y,onActiveChange:e=>{let t=m[e];t&&o(t.group.itinerary.id,t.leg)},children:[...m.map((n,r)=>{let l=s?(0,a.connectingTail)(n.group):null,c=(0,t.jsx)(R,{card:n,active:r===y,onSelect:()=>o(n.group.itinerary.id,n.leg),onRemove:()=>(({group:t,leg:n})=>(0,w.removeWithUndo)(e,t.itinerary.id,[n],(0,w.flightName)(n)))(n),onAddConnecting:l===n.leg?()=>s?.(n.group.itinerary.id,l):void 0},n.leg.id),d=r-y,u=M&&d>=0&&d{"use strict";var t=e.i(43476),n=e.i(55104),r=e.i(71645),i=e.i(30086),a=e.i(41071),o=e.i(95692);e.i(73052);var s=e.i(84275),l=e.i(7146),c=e.i(55529),d=e.i(47401),u=e.i(42132),f=e.i(21291),p=e.i(37202),h=e.i(52236),g=e.i(74985),m=e.i(72928),x=e.i(84209),b=e.i(58785),v=e.i(26320),y=e.i(11084),j=e.i(33283),C=e.i(67795),w=e.i(41091),A=e.i(70727),S=e.i(6895),N=e.i(10845),k=e.i(16390);let R=(0,r.createContext)(null);function M(e){let t=(0,r.useRef)(e);t.current=e;let n=(0,r.useContext)(R)?.setOpener;(0,r.useEffect)(()=>{if(!n)return;let e=e=>t.current(e);return n(()=>e),()=>n(t=>t===e?null:t)},[n])}e.s(["PastFlightsBridge",0,function({children:e}){let[n,i]=(0,r.useState)(null),a=(0,r.useMemo)(()=>({opener:n,setOpener:i}),[n]);return(0,t.jsx)(R.Provider,{value:a,children:e})},"useProvidePastFlights",0,M],50638);let I=null,D=1,T=new Set,P=()=>T.forEach(e=>e()),L=e=>e?.onExpire?.();function E(e,t,n){L(I),I={id:D++,message:e,undo:t,onExpire:n},P()}function O(e){if(I?.id!==e)return;let t=I;I=null,P(),L(t)}window.addEventListener("pagehide",()=>{I&&O(I.id)}),e.s(["dismissUndo",0,O,"runUndo",0,function(e){if(I?.id!==e)return;let{undo:t}=I;I=null,P(),t()},"showUndo",0,E,"useUndoToast",0,function(){return(0,r.useSyncExternalStore)(e=>(T.add(e),()=>T.delete(e)),()=>I,()=>null)}],22517);let F=e=>`Removed ${e}`;function B(e,t,n,r){let i=e.itineraries.find(e=>e.id===t);if(!i)return;let a=i.legs.find(t=>t.id===e.selectedLegId);if(!e.onRemoveUndoable){if(n.length>=i.legs.length)e.onDeleteItinerary(i.id);else for(let t of n)e.onRemoveLeg(i.id,t.id);return}let o=e.onRemoveUndoable(i.id,n.map(e=>e.id));o&&E(F(r),()=>{o.undo(),a&&e.onSelectLeg(i.id,a)},o.finish)}e.s(["UNDO_TOAST_MS",0,5e3,"removedMessage",0,F],43471);let U=e=>{let t=(0,l.splitFlightIdent)(e.identIata);return t?`${t.airline} ${t.number}`:e.identIata};function K(e){let t=new Date(`${e}T12:00:00`);if(Number.isNaN(t.getTime()))return"";let n=new Intl.DateTimeFormat("en-US",{weekday:"short",day:"numeric",month:"short"}).formatToParts(t),r=e=>n.find(t=>t.type===e)?.value??"";return`${r("weekday")}, ${r("day")} ${r("month")}`}let H="relative flex w-full items-center gap-3 rounded-card bg-surface text-left",G=`${H} press-97 hover-ring`;function $({label:e,onDelete:n}){return(0,t.jsxs)(o.DropdownMenu.Root,{children:[(0,t.jsx)(o.DropdownMenu.Trigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button","aria-label":`${e}: more actions`,onClick:e=>e.stopPropagation(),className:"mr-2 flex size-8 shrink-0 items-center justify-center rounded-full text-fg-tertiary transition-colors hover:bg-surface-muted hover:text-fg",children:(0,t.jsx)(a.MoreHorizontal,{size:16,"aria-hidden":"true"})})}),(0,t.jsx)(o.DropdownMenu.Portal,{children:(0,t.jsx)(o.DropdownMenu.Content,{align:"end",sideOffset:4,className:N.menuContentClass,children:(0,t.jsx)(o.DropdownMenu.Item,{className:(0,h.cn)(N.menuItemClass,"text-fg-danger"),onSelect:n,children:"Delete trip"})})})]})}function _({onDelete:e}){return(0,t.jsx)("div",{"data-testid":"flint-empty-trip",className:"relative",children:(0,t.jsxs)("div",{className:(0,h.cn)(G,"h-16 px-4 text-fg-tertiary"),children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-body-sm",children:"New trip — add a flight"}),(0,t.jsx)($,{label:"New trip",onDelete:e})]})})}function z({leg:e,itineraryId:r,isSelected:a,onSelect:o,onRemove:s,onAddConnecting:d,publishActions:u,showChip:f=!0}){let p=(0,n.useRefreshState)(),g=(0,l.splitFlightIdent)(e.identIata),m=e.snapshot?.origin.iata||e.originIata||"—",x=e.snapshot?.destination.iata||e.destinationIata||"—",b=`${e.identIata} ${m} to ${x}`,v={onAddConnecting:d,onRemove:s};return(0,S.usePublishTripActions)(u&&a,r,e.identIata,v),(0,t.jsx)("div",{"data-testid":"flint-flight-row","data-selected":a||void 0,"data-disabled":!o||void 0,children:(0,t.jsx)(N.TripMenu,{name:e.identIata,buttonLabel:`${m} to ${x}`,multi:!1,...v,buttonClassName:"mr-2 -ml-3",children:n=>(0,t.jsxs)("div",{className:(0,h.cn)(o?G:H,"group @container/row min-h-16 gap-0",a&&"selected-ring"),children:[(0,t.jsxs)("button",{type:"button",onClick:o,disabled:!o,"aria-label":b,"aria-current":a||void 0,className:"grid min-h-16 min-w-0 flex-1 grid-cols-[auto_minmax(0,1fr)] items-center gap-x-3 rounded-card px-4 py-2 text-left focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none disabled:opacity-60 @[17.5rem]/row:h-16 @[17.5rem]/row:grid-cols-[auto_minmax(0,1fr)_auto] @[17.5rem]/row:py-0",children:[(0,t.jsx)("span",{className:"row-span-2 self-center @[17.5rem]/row:row-span-1",children:(0,t.jsx)(C.default,{iata:g?.airline??e.identIata.slice(0,2)})}),(0,t.jsxs)("span",{className:"min-w-0",children:[(0,t.jsxs)("span",{className:"flex items-center gap-px text-route text-fg",children:[m,(0,t.jsx)(i.PlaneGlyph,{size:24}),x]}),(0,t.jsxs)("span",{className:"block truncate text-caption text-fg-tertiary uppercase",children:[g?`${g.airline} ${g.number}`:e.identIata," • ",K(e.scheduledDate)]})]}),f&&(0,t.jsx)("span",{className:"col-start-2 mt-1 justify-self-start @[17.5rem]/row:col-start-3 @[17.5rem]/row:mt-0 @[17.5rem]/row:justify-self-end",children:(0,t.jsx)(A.default,{chip:(0,c.legFlightChip)(e,Date.now(),p)})})]}),n]})})})}let V={safe:"bg-success-chip text-fg-success",tight:"bg-warning-chip text-fg-warning","at-risk":"bg-danger-chip text-fg-danger",impossible:"bg-danger-chip text-fg-danger"};function W({prev:e,leg:r,then:a=!1,className:o}){let l=(0,n.useRefreshState)(),d=(0,f.useLegRisk)(e),g=(0,f.useLegRisk)(r),m=(0,y.useWeatherConnectionAccess)(),b=(0,s.analyzeConnection)(e,r);if(!b)return null;let v=Date.now(),j=[e,r].some(e=>(0,c.legFlightChip)(e,v,l)?.kind==="stale"),C=m?(0,u.escalateConnection)(b,d,g):b,w=r.snapshot?.origin.iata||r.originIata||"";return(0,t.jsxs)("div",{"data-testid":"trip-layover","data-risk-level":C.riskLevel,"data-weather-adjusted":C.weatherAdjusted?"true":"false",className:(0,h.cn)("flex h-7 items-center gap-2",o??"pr-3 pl-7"),children:[!a&&(0,t.jsx)("span",{"aria-hidden":"true",className:"h-full border-l-[1.5px] border-dashed border-strong"}),(0,t.jsx)(i.Clock,{size:13,"aria-hidden":"true",className:"text-fg-tertiary"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 truncate text-caption text-fg-secondary",children:[a?"Then ":"",(0,x.formatMinutes)(C.estimatedLayoverMinutes)," in ",w]}),!j&&(0,t.jsx)("span",{className:(0,h.cn)("rounded-full px-2 py-0.5 text-caption font-semibold",V[C.riskLevel]),children:p.RISK_CONFIG[C.riskLevel].label})]})}function Z({group:e,onSelect:n,onRename:i,onRemove:a}){let{itinerary:o,legs:s,journey:l}=e,[c,d]=(0,r.useState)(!1),[u,f]=(0,r.useState)(o.name),p=s[0],h=s.at(-1),g=s.length-1,m=[`${p.originIata??"—"} → ${h.destinationIata??"—"}`,0===g?"Nonstop":`${g} stop${1===g?"":"s"}`,K(p.scheduledDate)].join(" · "),x=()=>{let e=u.trim();e&&e!==o.name?i(e):f(o.name),d(!1)};return(0,t.jsx)(N.TripMenu,{name:o.name,buttonLabel:o.name,multi:!0,onRename:()=>{f(o.name),d(!0)},onRemove:a,disabled:c,children:e=>(0,t.jsxs)("div",{"data-testid":"flint-trip-header",className:"flex items-center gap-2 pt-1.5 pr-1 pl-1",children:[(0,t.jsx)("div",{className:"min-w-0 flex-1",children:c?(0,t.jsx)("input",{value:u,autoFocus:!0,onChange:e=>f(e.target.value),onBlur:x,onKeyDown:e=>{"Enter"===e.key&&x(),"Escape"===e.key&&(f(o.name),d(!1))},"aria-label":"Trip name",className:"w-full min-w-0 rounded border border-interactive bg-surface-sunken px-2 py-1 text-body-strong text-fg outline-none"}):(0,t.jsxs)("button",{type:"button",onClick:n,disabled:!n,className:"block w-full min-w-0 text-left focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none disabled:opacity-60",children:[(0,t.jsx)("span",{className:"block truncate text-body-strong text-fg",children:o.name}),(0,t.jsx)("span",{className:"block truncate text-caption text-fg-tertiary uppercase",children:m})]})}),l&&(0,t.jsx)("span",{"data-testid":"flint-trip-journey",className:"shrink-0 rounded-full border border-strong px-2 py-0.5 text-caption text-fg-secondary",children:"return"===l?"Return":"Outbound"}),e]})})}function J({totals:e}){let n=(0,v.useUnits)(),r=[["Flights",String(e.flights)]];return null!=e.onTimePct&&r.push(["On time",`${e.onTimePct}%`,`${e.onTime} of ${e.judged}`]),null!=e.airMinutes&&r.push(["In the air",(0,x.formatMinutes)(e.airMinutes)]),null!=e.miles&&r.push(["Distance",(0,b.formatMiles)(e.miles,n)]),(0,t.jsx)("div",{"data-testid":"past-flights-totals",className:"grid shrink-0 grid-cols-2 overflow-hidden rounded-card border border-subtle bg-surface",children:r.map(([e,n,r],i)=>(0,t.jsxs)("div",{className:(0,h.cn)("p-4",i%2==1&&"border-l border-subtle",i>1&&"border-t border-subtle"),children:[(0,t.jsx)("b",{className:"block text-display font-bold text-fg",children:n}),(0,t.jsxs)("span",{className:"text-body-sm text-fg-secondary",children:[e,r?` \xb7 ${r}`:""]})]},e))})}function Y(){return(0,t.jsxs)("section",{"data-testid":"past-flights-empty",className:"flex min-h-60 flex-col items-center justify-center gap-stack-xs px-6 py-section text-center",children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"mb-stack-xs flex size-12 items-center justify-center rounded-card bg-surface-muted text-fg-secondary",children:(0,t.jsx)(i.PastFlights,{size:22})}),(0,t.jsx)("h2",{className:"text-title text-fg",children:"No past flights yet"}),(0,t.jsx)("p",{className:"max-w-72 text-body-sm text-fg-secondary",children:"When a flight you track lands, it moves here."})]})}function X({open:e,onOpenChange:n,count:r,onConfirm:i}){return(0,t.jsx)(k.ActionSheet,{open:e,onOpenChange:n,title:1===r?"Delete this past flight?":`Delete all ${r} past flights?`,message:"You can’t undo this.",actions:[{label:1===r?"Delete":"Delete all",destructive:!0,testId:"clear-history-confirm",onSelect:i}]})}function Q({open:e,onOpenChange:n,past:i,list:a}){let[o,l]=(0,r.useState)(!1),c=()=>n(!1),d=(0,t.jsxs)(t.Fragment,{children:[i.length>0&&(0,t.jsx)(J,{totals:(0,m.pastTotals)(i)}),(0,t.jsxs)("div",{"data-testid":"past-flights-sheet",className:"min-h-0 flex-1 space-y-2 overflow-y-auto",children:[0===i.length&&(0,t.jsx)(Y,{}),(0,s.sortedTripGroups)(i).map(e=>ee(a,e,{afterPick:c,publishActions:!1,past:!0})),i.length>0&&(0,t.jsx)("button",{type:"button","data-testid":"past-flights-clear",onClick:()=>l(!0),className:"mx-auto flex press-95 rounded-full px-3 py-1.5 text-label font-semibold text-fg-danger hover:bg-surface-muted focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none",children:"Clear history"})]}),(0,t.jsx)(X,{open:o,onOpenChange:l,count:(0,m.countLegs)(i),onConfirm:()=>{for(let e of i){let t=a.itineraries.find(t=>t.id===e.id);if(t&&t.legs.length!==e.legs.length)for(let t of e.legs)a.onRemoveLeg(e.id,t.id);else a.onDeleteItinerary(e.id)}l(!1),c()}})]});return(0,t.jsx)(g.default,{open:e,onOpenChange:n,title:"Past flights",subtitle:"Flights you tracked, once they have landed.",children:d})}function q(e,t){M(n=>{for(let t of e.itineraries){let r=n&&t.legs.find(e=>e.id===n);if(r)return e.onSelectLeg(t.id,r)}t()})}function ee(e,n,{afterPick:r,publishActions:a=!0,past:o=!1}={}){let{itinerary:l,legs:c}=n,u=t=>{e.onSelectLeg(l.id,t),r?.()},f=Date.now(),p=e=>!o||(0,d.isLegOpenable)(e,f),h=o?[...c].reverse().find(p):c.find(e=>!(0,s.isLegPast)(e))??c.at(-1),g=e.itineraries.find(e=>e.id===l.id)??l,m=e.onAddConnecting?(0,s.connectingTail)(n):null,x=m?()=>e.onAddConnecting?.(l.id,m):void 0,b=c.length>1||null!==n.journey||l.legs.length>c.length;return(0,t.jsxs)("div",{"data-testid":"flint-trip-group","data-trip":l.id,className:"space-y-1.5",children:[b&&(0,t.jsx)(Z,{group:n,onSelect:h&&(()=>u(h)),onRename:t=>e.onRename(l.id,t),onRemove:()=>B(e,g.id,l.legs,l.name)}),c.map((n,r)=>(0,t.jsxs)("div",{className:"space-y-1.5",children:[r>0&&(0,t.jsx)(W,{prev:c[r-1],leg:n}),(0,t.jsx)(z,{leg:n,itineraryId:l.id,isSelected:n.id===e.selectedLegId,onSelect:p(n)?()=>u(n):void 0,onRemove:()=>B(e,g.id,[n],U(n)),onAddConnecting:n===m?x:void 0,publishActions:a,showChip:!o})]},n.id)),b&&x&&a&&(0,t.jsxs)("button",{type:"button","data-testid":"trip-add-connection",onClick:x,className:"flex h-9 w-full press-97 items-center gap-1.5 rounded-card px-3 text-caption text-fg-secondary hover:bg-surface-muted focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none",children:[(0,t.jsx)(i.Plus,{size:14,"aria-hidden":"true"}),"Add a connection from ",(0,s.legArrivalCode)(m)]})]},n.key)}function et(e){let t=new Map;for(let n of e){let e=t.get(n.itinerary.id);t.set(n.itinerary.id,{...n.itinerary,legs:[...e?.legs??[],...n.legs]})}return[...t.values()]}function en({count:e,onClick:n}){return(0,t.jsx)("div",{className:"sticky bottom-0 mt-auto bg-gradient-to-t from-canvas from-65% to-transparent pt-6",children:(0,t.jsxs)("button",{type:"button","data-testid":"past-flights-button",onClick:n,className:"mx-auto flex items-center gap-2 rounded-full px-3 py-1.5 text-[13px] font-semibold text-fg-tertiary transition-colors hover:bg-surface-muted hover:text-fg focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none",children:[(0,t.jsx)(i.PastFlights,{size:14,"aria-hidden":"true"}),(0,m.pastFlightsLabel)(e,"visible")]})})}e.s(["LayoverRow",0,W,"PastFlightsSheet",0,Q,"default",0,function(e){let{itineraries:n,onNewItinerary:a}=e,o=Date.now(),l=(0,s.sortedTripGroups)(n,o),c=l.filter(e=>!(0,s.isGroupPast)(e,o)),d=et(l.filter(e=>(0,s.isGroupPast)(e,o))),u=n.filter(e=>0===e.legs.length),f=c.reduce((e,t)=>e+t.legs.length,0),[p,h]=(0,r.useState)(!1);q(e,()=>h(!0));let g=(0,j.useListPresence)(c,e=>e.key,6);return(0,t.jsxs)("div",{"data-testid":"flint-flight-list",className:"flex flex-1 flex-col gap-2",children:[0===c.length&&0===u.length?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.default,{onAddFlight:a,addTestId:"flint-create-trip-button"}),(0,t.jsx)(en,{count:(0,m.countLegs)(d),onClick:()=>h(!0)})]}):(0,t.jsxs)(t.Fragment,{children:[c.length>0&&(0,t.jsxs)("p",{className:"mt-4 text-overline-strong text-fg-tertiary",children:["Tracking · ",f]}),(0,t.jsxs)("div",{className:"space-y-2",children:[g.rows.map(n=>(0,t.jsx)(j.ListRow,{motion:n.motion,rise:n.rise,gap:8,onGone:()=>g.gone(n.key),children:ee(e,n.item,{publishActions:"leave"!==n.motion})},n.key)),u.map(n=>(0,t.jsx)(_,{onDelete:()=>e.onDeleteItinerary(n.id)},n.id))]}),(0,t.jsxs)("button",{type:"button","data-testid":"new-itinerary-button",onClick:a,className:"mx-auto mt-1 flex press-95 items-center justify-center gap-1.5 rounded-full bg-surface-muted px-4 py-2.25 text-label font-bold text-fg hover:bg-surface-muted-hover focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none",children:[(0,t.jsx)(i.Plus,{size:15,"aria-hidden":"true"}),"Add a flight"]}),(0,t.jsx)(en,{count:(0,m.countLegs)(d),onClick:()=>h(!0)})]}),(0,t.jsx)(Q,{open:p,onOpenChange:h,past:d,list:e})]})},"flightName",0,U,"pastTrips",0,et,"removeWithUndo",0,B,"useProvidePastFlightsFor",0,q],93086)},15503,e=>{"use strict";var t=e.i(43476);let n="animate-shimmer bg-[linear-gradient(90deg,transparent,color-mix(in_srgb,var(--color-fg)_7%,transparent),transparent)] bg-[length:240px_100%] bg-no-repeat motion-reduce:bg-none";e.s(["default",0,function(){return(0,t.jsxs)("div",{"data-testid":"flint-skeleton",role:"status","aria-label":"Loading flights",className:"flint-layout-scope flex h-full w-full flex-col bg-canvas",children:[(0,t.jsxs)("div",{className:"flex h-15 shrink-0 items-center gap-3 border-b border-subtle px-5",children:[(0,t.jsx)("div",{className:`h-7.75 w-7 ${n} rounded bg-surface-muted`}),(0,t.jsx)("div",{className:`hidden h-8.75 w-full max-w-[420px] ${n} rounded-full bg-surface-field sm:block`})]}),(0,t.jsxs)("div",{className:"grid min-h-0 flex-1 grid-cols-1 min-[640px]:grid-cols-[76px_minmax(0,1fr)] min-[1100px]:grid-cols-[clamp(320px,28vw,420px)_minmax(0,1fr)_400px] min-[1281px]:grid-cols-[clamp(320px,28vw,420px)_minmax(0,1fr)_460px]",children:[(0,t.jsxs)("div",{className:"hidden flex-col gap-2 border-r border-subtle p-2.5 min-[640px]:flex min-[1100px]:p-4",children:[(0,t.jsx)("div",{className:`mb-10 hidden h-9 ${n} rounded-full bg-surface-muted min-[1100px]:block`}),[void 0,void 0,void 0,void 0].map((e,r)=>(0,t.jsx)("div",{className:`h-14 ${n} rounded-card bg-surface min-[1100px]:h-16`},r))]}),(0,t.jsx)("div",{className:`${n} bg-surface-muted`}),(0,t.jsx)("div",{className:"hidden space-y-3 border-l border-subtle p-4 min-[1100px]:block",children:[void 0,void 0,void 0].map((e,r)=>(0,t.jsx)("div",{className:`h-28 ${n} rounded-card bg-surface`},r))})]})]})}])},69719,e=>{"use strict";var t=e.i(43476),n=e.i(30086);let r="Add a flight — number, route, or airport";e.s(["default",0,function({onClick:e}){let i=/Mac|iPhone|iPad/.test(navigator.userAgent);return(0,t.jsxs)("button",{type:"button",onClick:e,"data-testid":"flint-add-flight-search","aria-label":r,"aria-keyshortcuts":"Meta+K Control+K",className:"@container flex h-8.75 w-full max-w-105 min-w-9.5 press-98 cursor-text items-center gap-inline-sm overflow-hidden rounded-full bg-surface-field px-3.5 text-left text-fg-tertiary hover:bg-surface-field-hover",children:[(0,t.jsx)(n.Search,{size:16,"aria-hidden":!0,className:"shrink-0"}),(0,t.jsxs)("span",{"aria-hidden":"true",className:"min-w-0 flex-1 truncate text-search",children:[(0,t.jsx)("span",{className:"@search-full:hidden",children:"Add a flight"}),(0,t.jsx)("span",{className:"hidden @search-full:inline",children:r})]}),(0,t.jsx)("span",{"aria-hidden":"true",className:"hidden shrink-0 text-caption @search-hint:inline",children:i?"⌘K":"Ctrl K"})]})}])},59976,e=>{"use strict";var t=e.i(43476),n=e.i(48322),r=e.i(52236),i=e.i(67491);let a=[["flights","My flights"],["airports","Airports"]];e.s(["default",0,function({tab:e,onTabChange:o,flightsStatus:s}){return(0,t.jsxs)("div",{role:"group","aria-label":"Show",className:(0,r.cn)("relative flex flex-1 rounded-xl bg-surface-muted p-[3px]"),children:[(0,t.jsx)(i.SegmentPill,{className:"inset-y-[3px] rounded-[9px] bg-surface-raised"}),a.map(([i,a])=>(0,t.jsxs)("button",{type:"button","aria-pressed":e===i,onClick:()=>o(i),className:(0,r.cn)("flex flex-1 items-center justify-center gap-1.5 rounded-[9px] py-[7px] text-body-sm font-semibold","relative press-95",e===i?"text-fg":"text-fg-secondary"),children:[a,"flights"===i&&s?.level&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.default,{level:s.level}),(0,t.jsxs)("span",{className:"sr-only",children:[", ",(0,n.statusDescription)(s.level,s.label)]})]})]},i))]})}])},42433,16390,e=>{"use strict";var t=e.i(43476),n=e.i(64053),r=e.i(94527),i=e.i(82879),a=e.i(43480),o=e.i(52236),s=e.i(98617);let l="press-95 rounded-full px-4 py-2 text-label font-semibold focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none",c="flex h-14 w-full items-center justify-center px-4 text-title outline-none active:bg-surface-muted focus-visible:bg-surface-muted";function d({open:e,onOpenChange:u,title:f,message:p,actions:h,testId:g,cancelTestId:m=g&&`${g}-cancel`}){let x="phone"===(0,a.useFlintBand)(),b=e=>{u(!1),e.onSelect()};return x?(0,t.jsx)(r.Drawer.Root,{open:e,onOpenChange:u,children:(0,t.jsxs)(r.Drawer.Portal,{children:[(0,t.jsx)(r.Drawer.Overlay,{className:s.phoneSheetOverlayClass}),(0,t.jsxs)(r.Drawer.Content,{"data-testid":g,"data-action-sheet":"",className:"sheet-motion fixed inset-x-2 bottom-[max(8px,env(safe-area-inset-bottom,0px))] z-50 flex flex-col gap-2 outline-none",children:[(0,t.jsxs)("div",{className:"overflow-hidden rounded-card bg-surface-floating",children:[(0,t.jsxs)("div",{className:"px-4 pt-3.5 pb-3 text-center",children:[(0,t.jsx)(n.Dialog.Title,{className:"text-label font-semibold text-fg-secondary",children:f}),p?(0,t.jsx)(n.Dialog.Description,{className:"mt-0.5 text-caption text-fg-tertiary",children:p}):(0,t.jsx)(n.Dialog.Description,{className:"sr-only",children:f})]}),(0,t.jsx)("div",{className:"divide-y divide-subtle border-t border-subtle",children:h.map(e=>(0,t.jsx)("button",{type:"button","data-testid":e.testId,onClick:()=>b(e),className:(0,o.cn)(c,e.destructive?"text-fg-danger":"text-fg-interactive"),children:e.label},e.label))})]}),(0,t.jsx)(n.Dialog.Close,{asChild:!0,children:(0,t.jsx)("button",{type:"button","data-testid":m,className:(0,o.cn)(c,"rounded-card bg-surface-floating font-semibold text-fg-interactive"),children:"Cancel"})})]})]})}):(0,t.jsx)(i.Dialog,{open:e,onOpenChange:u,children:(0,t.jsxs)(i.DialogContent,{variant:"flint",showCloseButton:!1,"data-testid":g,className:"top-1/2 w-[min(400px,calc(100vw-2rem))] -translate-y-1/2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(i.DialogTitle,{className:"text-title text-fg",children:f}),(0,t.jsx)(i.DialogDescription,{className:p?"mt-1 text-body-sm text-fg-secondary":"sr-only",children:p??f})]}),(0,t.jsxs)("div",{className:"flex justify-end gap-inline-sm",children:[(0,t.jsx)(i.DialogClose,{asChild:!0,children:(0,t.jsx)("button",{type:"button","data-testid":m,className:(0,o.cn)(l,"bg-surface-muted text-fg hover:bg-surface-muted-hover"),children:"Cancel"})}),h.map(e=>(0,t.jsx)("button",{type:"button","data-testid":e.testId,onClick:()=>b(e),className:(0,o.cn)(l,e.destructive?"bg-danger text-fg-on-solid":"bg-interactive text-fg-on-interactive hover:bg-interactive-hover"),children:e.label},e.label))]})]})})}e.s(["ActionSheet",0,d],16390),e.s(["RemoveTripDialog",0,function({open:e,onOpenChange:n,name:r,title:i,onConfirm:a}){return(0,t.jsx)(d,{open:e,onOpenChange:n,testId:"trip-remove-dialog",cancelTestId:"trip-remove-cancel",title:i??`Stop tracking ${r}?`,message:"You can’t undo this.",actions:[{label:"Remove",destructive:!0,testId:"trip-remove-confirm",onSelect:a}]})}],42433)},6895,e=>{"use strict";var t=e.i(43476),n=e.i(71645),r=e.i(30086),i=e.i(42433),a=e.i(52236);let o=(0,n.createContext)({actions:null,setActions:()=>{}}),s="flex flex-col items-center gap-1.5 rounded-[14px] px-1.5 pt-3.5 pb-3 text-tile transition-colors focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none";e.s(["TripActionsBar",0,function({className:e}){let{actions:l}=(0,n.useContext)(o),[c,d]=(0,n.useState)(!1),u=l?.itineraryId;return((0,n.useEffect)(()=>d(!1),[u]),l)?(0,t.jsxs)("div",{"data-testid":"trip-actions","data-trip":l.itineraryId,className:(0,a.cn)("grid grid-cols-2 gap-2",e),children:[l.onAddConnecting&&(0,t.jsxs)("button",{type:"button",onClick:l.onAddConnecting,className:(0,a.cn)(s,"col-span-2","bg-surface text-fg-secondary hover:bg-surface-muted hover:text-fg"),children:[(0,t.jsx)(r.Plus,{size:18,"aria-hidden":"true"}),"Add connecting flight"]}),(0,t.jsxs)("button",{type:"button","data-testid":"trip-remove-button",onClick:()=>d(!0),className:(0,a.cn)(s,"col-span-2","bg-[color-mix(in_srgb,var(--color-fg-danger)_16%,transparent)] text-fg-danger hover:bg-[color-mix(in_srgb,var(--color-fg-danger)_26%,transparent)]"),children:[(0,t.jsx)(r.Trash2,{size:18,"aria-hidden":"true"}),"Remove"]}),(0,t.jsx)(i.RemoveTripDialog,{open:c,onOpenChange:d,name:l.label,onConfirm:l.onRemove})]}):null},"TripActionsProvider",0,function({children:e}){let[r,i]=(0,n.useState)(null),a=(0,n.useMemo)(()=>({actions:r,setActions:i}),[r]);return(0,t.jsx)(o.Provider,{value:a,children:e})},"useHasTripActions",0,function(){return null!=(0,n.useContext)(o).actions},"usePublishTripActions",0,function(e,t,r,i){let{setActions:a}=(0,n.useContext)(o),s=(0,n.useRef)(i);s.current=i;let l=!!i.onAddConnecting,c=(0,n.useCallback)(()=>s.current.onAddConnecting?.(),[]),d=(0,n.useCallback)(()=>s.current.onRemove(),[]);(0,n.useEffect)(()=>{if(e)return a({itineraryId:t,label:r,onAddConnecting:l?c:void 0,onRemove:d}),()=>a(null)},[e,t,r,l,c,d,a])}])},10845,e=>{"use strict";var t=e.i(43476),n=e.i(71645),r=e.i(92482),i=e.i(95692),a=e.i(86011),o=e.i(98041);e.i(30086);var s=e.i(41071),l=e.i(43480),c=e.i(52236),d=e.i(16390),u=e.i(42433);function f({onLongPress:e,disabled:r=!1,children:i}){let s=(0,n.useRef)(null),l=(0,n.useRef)(!1),c=()=>{s.current&&clearTimeout(s.current.timer),s.current=null};return((0,n.useEffect)(()=>c,[r]),r)?i:(0,t.jsx)(a.Slot.Root,{onPointerDown:t=>{l.current=!1,"mouse"!==t.pointerType&&(c(),s.current={x:t.clientX,y:t.clientY,timer:setTimeout(()=>{s.current=null,l.current=!0,e()},o.LONG_PRESS_MS)})},onPointerMove:e=>{let t=s.current;t&&Math.hypot(e.clientX-t.x,e.clientY-t.y)>o.LONG_PRESS_SLOP&&c()},onPointerUp:c,onPointerCancel:c,onContextMenu:t=>{t.preventDefault(),c(),l.current=!0,e()},onClickCapture:e=>{l.current&&(l.current=!1,e.preventDefault(),e.stopPropagation())},children:i})}let p="z-50 min-w-44 rounded-card border border-subtle bg-surface-raised p-1 shadow-lg",h="text-body-sm flex cursor-pointer items-center rounded-md px-3 py-2 text-fg outline-none select-none data-[highlighted]:bg-surface-muted";e.s(["LongPress",0,f,"TripMenu",0,function({name:e,buttonLabel:a,multi:o,onAddConnecting:g,onRename:m,onRemove:x,withButton:b=!0,disabled:v=!1,buttonClassName:y,remove:j,children:C}){let w=j?.label??(o?"Remove trip":"Remove flight"),A=j?.testId??"trip-menu-remove",[S,N]=(0,n.useState)(!1),[k,R]=(0,n.useState)(!1);if("phone"===(0,l.useFlintBand)()){let n=[...m?[{label:"Rename trip",onSelect:m}]:[],...g?[{label:"Add connecting flight",onSelect:g}]:[],{label:w,destructive:!0,testId:A,onSelect:x}],r=b&&(0,t.jsx)("button",{type:"button","data-testid":"trip-menu-button","aria-label":`${a}: more actions`,"aria-haspopup":"dialog",onClick:e=>{e.stopPropagation(),R(!0)},className:(0,c.cn)("flex h-8 w-8 shrink-0 press-92 items-center justify-center rounded-full text-fg-tertiary focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none",k&&"bg-surface-muted text-fg",y),children:(0,t.jsx)(s.MoreHorizontal,{size:16,"aria-hidden":"true"})});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(f,{disabled:v,onLongPress:()=>R(!0),children:C(r)}),(0,t.jsx)(d.ActionSheet,{open:k,onOpenChange:R,testId:"trip-menu-sheet",title:e,message:a,actions:n})]})}let M=e=>(0,t.jsxs)(t.Fragment,{children:[m&&(0,t.jsx)(e,{className:h,onSelect:m,children:"Rename trip"}),g&&(0,t.jsx)(e,{className:h,onSelect:g,children:"Add connecting flight"}),(0,t.jsx)(e,{"data-testid":A,className:(0,c.cn)(h,"text-fg-danger"),onSelect:()=>N(!0),children:w})]}),I=b&&(0,t.jsx)(i.DropdownMenu.Trigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button","data-testid":"trip-menu-button","aria-label":`${a}: more actions`,onClick:e=>e.stopPropagation(),className:(0,c.cn)("flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-fg-tertiary transition-colors hover:bg-surface-muted hover:text-fg focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none data-[state=open]:bg-surface-muted data-[state=open]:text-fg",y),children:(0,t.jsx)(s.MoreHorizontal,{size:16,"aria-hidden":"true"})})});return(0,t.jsxs)(i.DropdownMenu.Root,{modal:!1,children:[(0,t.jsxs)(r.ContextMenu.Root,{modal:!1,children:[(0,t.jsx)(r.ContextMenu.Trigger,{asChild:!0,disabled:v,children:C(I)}),(0,t.jsx)(r.ContextMenu.Portal,{children:(0,t.jsx)(r.ContextMenu.Content,{className:(0,c.cn)(p,"origin-(--radix-context-menu-content-transform-origin) data-[state=open]:animate-menu-in data-[state=closed]:animate-menu-out"),children:M(r.ContextMenu.Item)})})]}),b&&(0,t.jsx)(i.DropdownMenu.Portal,{children:(0,t.jsx)(i.DropdownMenu.Content,{align:"end",sideOffset:4,className:(0,c.cn)(p,"origin-(--radix-dropdown-menu-content-transform-origin) data-[state=open]:animate-menu-in data-[state=closed]:animate-menu-out"),children:M(i.DropdownMenu.Item)})}),(0,t.jsx)(u.RemoveTripDialog,{open:S,onOpenChange:N,name:e,title:j?.confirmTitle,onConfirm:x})]})},"menuContentClass",0,p,"menuItemClass",0,h])},33283,41091,e=>{"use strict";var t=e.i(43476),n=e.i(71645),r=e.i(13737),i=e.i(4534);e.s(["ListRow",0,function({motion:e,rise:a,gap:o,onGone:s,children:l}){let c=(0,n.useRef)(null),d=(0,n.useRef)(null),u=(0,n.useRef)(s);return u.current=s,(0,n.useLayoutEffect)(()=>{let t=c.current,n=d.current;if(!t||!n||"stay"===e)return;let a=[...t.getAnimations(),...n.getAnimations()].filter(e=>"list-leave"===e.id);if("return"===e&&a.length>0){a.forEach(e=>{e.onfinish=null,e.reverse()}),a[0].finished.then(()=>{a.forEach(e=>e.cancel()),t.style.overflow=""});return}if((0,i.reducedMotion)()){let t=n.animate({opacity:"leave"===e?[1,0]:[0,1]},{duration:r.REDUCED_FADE_MS,fill:"both"});"leave"===e?t.onfinish=()=>u.current():t.onfinish=()=>t.cancel();return}let s=n.offsetHeight,l=[{height:"0px",marginTop:`${-o}px`},{height:`${s}px`,marginTop:"0px"}],f=[{opacity:0,transform:`translateX(${-r.LEAVE.slidePx}px)`},{opacity:1,transform:"none"}];t.style.overflow="hidden";let p=()=>t.style.overflow="";"board"===e?(t.animate(l,{duration:r.BOARD.roomMs,easing:(0,i.ease)("glide")}).onfinish=p,n.animate([{opacity:0,transform:"translateY(16px) scale(0.985)"},{opacity:1,transform:"none"}],{duration:600,delay:r.BOARD.riseAt,easing:(0,i.ease)("arrive"),fill:"backwards"})):"return"===e?(t.animate(l,{duration:r.LEAVE.closeMs,easing:(0,i.ease)("glide")}).onfinish=p,n.animate(f,{duration:r.LEAVE.fadeMs,delay:r.LEAVE.closeMs,easing:(0,i.ease)("arrive"),fill:"backwards"})):(n.animate([...f].reverse(),{id:"list-leave",duration:r.LEAVE.fadeMs,easing:(0,i.ease)("depart"),fill:"forwards"}),t.animate([...l].reverse(),{id:"list-leave",duration:r.LEAVE.closeMs,delay:r.LEAVE.fadeMs,easing:(0,i.ease)("glide"),fill:"forwards"}).onfinish=()=>u.current())},[e,o]),(0,t.jsx)("div",{ref:c,inert:"leave"===e,"aria-hidden":"leave"===e||void 0,children:(0,t.jsx)("div",{ref:d,className:null!=a?"animate-rise":void 0,style:null!=a?{"--rise-i":a}:void 0,children:l})})},"useListPresence",0,function(e,t,i){let a=e.map(t),o=a.join("\n"),[s,l]=(0,n.useState)(()=>({sig:o,rows:a.map(e=>({key:e,motion:"stay"})),first:new Map(a.map((e,t)=>[e,Math.min(t,i-1)])),left:new Set,last:new Map(e.map(e=>[t(e),e]))}));s.sig!==o&&l({...s,sig:o,rows:(0,r.nextRows)(s.rows,a,s.left),last:new Map([...s.last,...e.map(e=>[t(e),e])])});let c=(0,n.useCallback)(e=>l(t=>{let n=new Map(t.first);return n.delete(e),{...t,rows:t.rows.filter(t=>t.key!==e||"leave"!==t.motion),first:n,left:new Set(t.left).add(e)}}),[]),d=new Map(e.map(e=>[t(e),e]));return{rows:s.rows.flatMap(e=>{let t=d.get(e.key)??s.last.get(e.key);return void 0===t?[]:[{...e,item:t,rise:s.first.get(e.key)??null}]}),gone:c}}],33283);var a=e.i(30086),o=e.i(522),s=e.i(12901),l=e.i(96095);e.s(["default",0,function({onAddFlight:e,addTestId:r}){let i=(0,l.useSignedIn)(),c=(0,s.useLoginHref)(),d=(0,n.useId)(),u=(0,t.jsx)("span",{"aria-hidden":"true",className:"flex size-12 shrink-0 items-center justify-center rounded-card bg-interactive-subtle",children:(0,t.jsx)(o.default,{size:36,children:(0,t.jsx)(a.PlaneGlyph,{size:36})})}),f=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("h2",{id:d,className:"text-title text-fg",children:"Track your first flight"}),(0,t.jsx)("p",{className:"max-w-80 text-body-sm text-fg-secondary",children:"See the delay risk, what's causing it, and the weather for your trip."})]}),p=(0,t.jsxs)("button",{type:"button","data-testid":r,onClick:e,className:"mt-1 flex press-95 items-center gap-1.5 rounded-full bg-interactive px-4 py-2 text-label font-semibold whitespace-nowrap text-fg-on-interactive transition-colors hover:bg-interactive-hover focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none",children:[(0,t.jsx)(a.Plus,{size:15,"aria-hidden":"true"}),"Add a flight"]}),h=!1===i&&(0,t.jsx)("a",{href:c,"data-testid":"flint-empty-flights-sign-in",className:"rounded-full px-3 py-1.5 text-label font-semibold whitespace-nowrap text-fg-interactive hover:bg-surface-muted focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none",children:"Sign in to track more flights"});return(0,t.jsxs)("section",{"data-testid":"flint-empty-flights","aria-labelledby":d,className:"flex flex-col items-center gap-3 rounded-card border border-dashed border-subtle bg-surface px-6 py-10 text-center",children:[u,f,p,h]})}],41091)},11084,e=>{"use strict";var t=e.i(71645);let n=(0,t.createContext)(!1),r=n.Provider;e.s(["ConnectionAccessProvider",0,r,"useWeatherConnectionAccess",0,function(){return(0,t.useContext)(n)}])},44311,12293,e=>{"use strict";var t=e.i(43476),n=e.i(40875),r=e.i(54834),i=e.i(30086),a=e.i(18566),o=e.i(36966),s=e.i(31287),l=e.i(52236),c=e.i(9875),d=e.i(10845);let u={severe:"text-fg-sev-severe",major:"text-fg-sev-moderate",moderate:"text-fg-sev-light",normal:"text-fg-sev-none","no-data":"text-fg-info",unknown:"text-fg-info"},f=(e,t)=>u[e]?void 0:t.text;function p({airport:e,status:h,onSelect:g,onRemove:m,highlighted:x}){let b=(0,a.useRouter)(),{time:v}=(0,r.useLocalTime)(e.timezone??"UTC"),y=h?.level,j=y&&(0,n.airportLevelWords)(y),C=y&&s.AIRPORT_LEVEL_COLOURS[y],w=h?[...h.cause?[h.cause]:[],...h.hazards.map(e=>o.HAZARD_KIND_PRESENTATION[e].label)]:[],A=w[0]??e.name,S=h?(0,n.airportDelayLine)(h):null,N=`${e.city}${e.state?`, ${e.state}`:""}`,k=()=>{g?g():e.icao&&b.push(`${(0,c.scopeFor)()}?icao=${e.icao}`)},R=n=>(0,t.jsxs)("div",{"data-testid":"flint-airport-row","data-iata":e.iata,"data-highlighted":x||void 0,className:(0,l.cn)("group relative flex w-full press-97 items-center gap-1 rounded-card bg-surface text-left hover-ring",x&&"selected-ring"),children:[(0,t.jsxs)("button",{type:"button",onClick:k,"aria-label":`${e.iata} ${N}`,"aria-current":x||void 0,className:"flex min-h-16 min-w-0 flex-1 items-center gap-3 rounded-card py-1.5 pl-4 text-left focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none",children:[(0,t.jsxs)("span",{className:"w-13 shrink-0",children:[(0,t.jsx)("span",{className:"block text-route text-fg",children:e.iata}),(0,t.jsx)("span",{className:"block text-caption whitespace-nowrap text-fg-tertiary tabular",children:v})]}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("span",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"min-w-0 truncate text-row-title text-fg",children:N}),h&&j&&C&&(0,t.jsx)("span",{"data-testid":"airport-level","data-level":h.level,className:(0,l.cn)("shrink-0 rounded-inner px-1.5 py-px text-tag",u[h.level]),style:{backgroundColor:`color-mix(in srgb, ${C.flint} 18%, transparent)`,color:f(h.level,C)},children:j.short})]}),(0,t.jsx)("span",{className:"mt-0.75 block truncate text-row-note text-fg-secondary",children:A}),S&&h&&C&&(0,t.jsx)("span",{className:(0,l.cn)("mt-0.75 block truncate text-row-stat",u[h.level]),style:{color:f(h.level,C)},children:S})]})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5 pr-2",children:[w.length>0&&(0,t.jsxs)("span",{title:w.join(" • "),className:"p-1 text-fg-warning",children:[(0,t.jsx)(i.AlertTriangle,{size:16,"aria-hidden":"true"}),(0,t.jsx)("span",{className:"sr-only",children:w.join(". ")})]}),n]})]});return m?(0,t.jsx)(d.TripMenu,{name:e.iata,buttonLabel:`${e.iata} ${N}`,multi:!1,onRemove:m,remove:{label:"Remove airport",testId:"airport-menu-remove",confirmTitle:`Remove ${e.iata} from your airports?`},children:R}):R()}function h({field:e,sortField:n,sortDir:r}){let i=e===n;return(0,t.jsxs)("svg",{width:"8",height:"10",viewBox:"0 0 8 10",style:{marginLeft:3,flexShrink:0},children:[(0,t.jsx)("path",{d:"M4 0L7.5 4H0.5L4 0Z",fill:i&&"asc"===r?"var(--color-fg)":"var(--color-fg-disabled)"}),(0,t.jsx)("path",{d:"M4 10L0.5 6H7.5L4 10Z",fill:i&&"desc"===r?"var(--color-fg)":"var(--color-fg-disabled)"})]})}function g({label:e,field:n,sortField:r,sortDir:i,onSort:a,width:o}){let s=n===r;return(0,t.jsxs)("button",{onClick:()=>a?.(n),style:{width:o,flexShrink:0,display:"flex",alignItems:"center",background:"none",border:"none",padding:0,cursor:a?"pointer":"default"},children:[(0,t.jsx)("span",{className:"text-xs font-semibold tracking-wider uppercase",style:{color:s?"var(--color-fg)":"var(--color-fg-tertiary)"},children:e}),a&&(0,t.jsx)(h,{field:n,sortField:r,sortDir:i})]})}e.s(["LEVEL_TEXT",0,u,"default",0,p,"levelColor",0,f],12293),e.s(["default",0,function({airports:e,airportStatuses:i,showHeaders:a,onAirportSelect:o,pinnedIatas:s,onTogglePin:l,onRemoveAirport:c,sortField:d,sortDir:u,onSort:f,highlightedIatas:h,hideEmptyState:m,rowVariant:x="classic",emptyState:b}){let v="flint"===x,y=e=>i&&e.icao?(0,n.airportStatusOf)(i,e.icao)??void 0:void 0;return 0===e.length?m?null:b?(0,t.jsx)(t.Fragment,{children:b}):(0,t.jsx)("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:(0,t.jsx)("p",{className:"text-sm",style:{color:"var(--color-fg-secondary)"},children:"No airports match your search."})}):(0,t.jsxs)(t.Fragment,{children:[a&&!v&&(0,t.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2",style:{borderBottom:"1px solid var(--border-color-subtle)",position:"sticky",top:0,backgroundColor:"var(--color-surface)",zIndex:10},children:[(0,t.jsx)("div",{style:{width:64,flexShrink:0},children:(0,t.jsx)("span",{className:"text-xs font-semibold tracking-wider uppercase",style:{color:"var(--color-fg-tertiary)"},children:"Airport"})}),(0,t.jsx)("div",{className:"min-w-0",style:{flex:"1 1 0%"}}),(0,t.jsx)(g,{label:"City",field:"city",sortField:d,sortDir:u,onSort:f,width:130}),(0,t.jsx)("div",{style:{width:180,flexShrink:0},children:(0,t.jsx)("span",{className:"text-xs font-semibold tracking-wider uppercase",style:{color:"var(--color-fg-tertiary)"},children:"Time Zone"})}),(0,t.jsx)(g,{label:"Departures",field:"depDelay",sortField:d,sortDir:u,onSort:f,width:140}),(0,t.jsx)(g,{label:"Arrivals",field:"arrDelay",sortField:d,sortDir:u,onSort:f,width:140}),(0,t.jsx)("div",{style:{width:18,flexShrink:0}}),(0,t.jsx)("div",{style:{width:13,flexShrink:0}}),(0,t.jsx)("div",{style:{width:14,flexShrink:0}})]}),(0,t.jsx)("ul",{className:v?"space-y-2 px-4 pb-4":void 0,children:e.map((e,n)=>(0,t.jsx)("li",{"data-iata":e.iata,className:v?"animate-rise":void 0,style:v?{"--rise-i":Math.min(n,5)}:void 0,children:v?(0,t.jsx)(p,{airport:e,status:y(e),onSelect:o?()=>o(e):void 0,onRemove:c&&s?.has(e.iata)?()=>c(e):void 0,highlighted:h?.has(e.iata)}):(0,t.jsx)(r.default,{airport:e,status:y(e),onSelect:o?()=>o(e):void 0,pinned:s?.has(e.iata),onTogglePin:l?()=>l(e.iata):void 0,highlighted:h?.has(e.iata)})},e.iata))})]})}],44311)},54834,e=>{"use strict";var t=e.i(43476),n=e.i(71645),r=e.i(18566),i=e.i(22016),a=e.i(36966),o=e.i(31287);function s(){return(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,t.jsx)("polyline",{points:"12 7 12 12 15 15"})]})}function l(){return(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,t.jsx)("line",{x1:"9",y1:"9",x2:"15",y2:"15"}),(0,t.jsx)("line",{x1:"15",y1:"9",x2:"9",y2:"15"})]})}function c({filled:e}){return(0,t.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("line",{x1:"12",y1:"17",x2:"12",y2:"22"}),(0,t.jsx)("path",{d:"M5 17h14v-1.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V6h1a2 2 0 0 0 0-4H8a2 2 0 0 0 0 4h1v4.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V17z"})]})}function d(){return(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"}),(0,t.jsx)("circle",{cx:"12",cy:"10",r:"3"})]})}let u=new Set,f=null;function p(e){let[t,r]=(0,n.useState)({time:"",tzAbbr:""});return(0,n.useEffect)(()=>{let t=new Intl.DateTimeFormat("en-US",{timeZone:e,hour:"numeric",minute:"2-digit",hour12:!0}),n=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"short"}),i=()=>{let e=new Date;r({time:t.format(e),tzAbbr:n.formatToParts(e).find(e=>"timeZoneName"===e.type)?.value??""})};return i(),u.add(i),null===f&&(f=setInterval(()=>{for(let e of u)e()},3e4)),()=>{u.delete(i),0===u.size&&null!==f&&(clearInterval(f),f=null)}},[e]),t}function h({mins:e,delayPct:r,cancelPct:i,color:a,label:o}){let c=(0,n.useRef)(null),[d,u]=(0,n.useState)(null);return(0,t.jsxs)("div",{ref:c,className:"flex items-center gap-2",style:{width:140,flexShrink:0,cursor:"default"},onMouseEnter:()=>{if(c.current){let e=c.current.getBoundingClientRect();u({top:e.bottom+6,left:e.left})}},onMouseLeave:()=>u(null),children:[(0,t.jsxs)("span",{className:"font-mono text-sm font-bold",style:{color:a},children:[e,"m"]}),(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs",style:{color:"var(--color-fg-secondary)"},children:[(0,t.jsx)(s,{}),r,"%"]}),(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs",style:{color:"var(--color-fg-secondary)"},children:[(0,t.jsx)(l,{}),i,"%"]}),d&&(0,t.jsxs)("div",{style:{position:"fixed",top:d.top,left:d.left,background:"#252422",color:"var(--color-fg-on-solid)",fontSize:11,padding:"8px 10px",borderRadius:6,width:200,zIndex:9999,pointerEvents:"none",lineHeight:1.6},children:[(0,t.jsx)("p",{style:{margin:0,fontWeight:600,marginBottom:4},children:o}),(0,t.jsxs)("p",{style:{margin:0},children:["Avg delay: ",e," min"]}),(0,t.jsxs)("p",{style:{margin:0},children:[r,"% of flights delayed"]}),(0,t.jsxs)("p",{style:{margin:0},children:[i,"% of flights cancelled"]})]})]})}let g=new Set(["moderate","major","severe"]);function m({flow:e,color:n,label:r}){return(0,t.jsx)(h,{mins:e.averageDelayMinutes??0,delayPct:e.delayedPercent??0,cancelPct:e.cancelledPercent??0,color:n,label:r})}e.s(["default",0,function({airport:e,status:s,onSelect:l,pinned:u,onTogglePin:f,highlighted:h}){let x=(0,r.useRouter)(),b=void 0!==s,v=o.AIRPORT_LEVEL_COLOURS[s&&g.has(s.level)?s.level:"normal"].classic,y=s&&o.AIRPORT_LEVEL_COLOURS[s.level].classic,j=s?[...s.cause?[s.cause]:[],...s.hazards.map(e=>a.HAZARD_KIND_PRESENTATION[e].label)]:[],C=p(e.timezone??"UTC"),w=(0,n.useRef)(null),[A,S]=(0,n.useState)(null),N=e.icao?`/?icao=${e.icao}`:null,k="-m-1 flex-shrink-0 rounded p-1 transition-colors hover:bg-surface-muted",R={color:"var(--color-fg-disabled)"},M=f&&(0,t.jsx)("button",{onClick:e=>{e.preventDefault(),e.stopPropagation(),f()},className:`-m-1 flex-shrink-0 rounded p-1 transition-colors hover:bg-surface-muted ${u?"":"opacity-0 group-hover:opacity-100"}`,style:{color:u?"var(--color-fg-interactive)":"var(--color-fg-disabled)"},"aria-label":`${u?"Unpin":"Pin"} airport ${e.iata}`,children:(0,t.jsx)(c,{filled:u})}),I=(0,t.jsx)("div",{ref:w,onMouseEnter:j.length>0?()=>{if(w.current){let e=w.current.getBoundingClientRect();S({top:e.bottom+8,left:e.left})}}:void 0,onMouseLeave:j.length>0?()=>S(null):void 0,style:{width:18,height:18,flexShrink:0,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:j.length>0?"default":void 0},children:j.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"#f97316",stroke:"#f97316",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"}),(0,t.jsx)("line",{x1:"12",y1:"9",x2:"12",y2:"13",stroke:"white",strokeWidth:"2"}),(0,t.jsx)("line",{x1:"12",y1:"17",x2:"12.01",y2:"17",stroke:"white",strokeWidth:"3"})]}),A&&(0,t.jsx)("div",{style:{position:"fixed",top:A.top,left:A.left,background:"#252422",color:"var(--color-fg-on-solid)",fontSize:11,padding:"8px 10px",borderRadius:6,width:220,zIndex:9999,pointerEvents:"none"},children:j.map((e,n)=>(0,t.jsx)("p",{style:{margin:n>0?"4px 0 0":0,lineHeight:1.4},children:e},n))})]})}),D=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",style:{width:64,flexShrink:0},children:[y&&(0,t.jsx)("span",{"aria-hidden":!0,style:{width:8,height:8,borderRadius:"50%",backgroundColor:y,flexShrink:0}}),(0,t.jsx)("span",{className:"font-mono text-sm font-bold",style:{color:"var(--color-fg-interactive)"},children:e.iata})]}),(0,t.jsxs)("div",{className:"min-w-0",style:{flex:"1 1 0%"},children:[(0,t.jsx)("p",{className:"truncate text-sm",style:{color:"var(--color-fg)"},children:e.name}),!b&&(0,t.jsxs)("p",{className:"truncate text-xs",style:{color:"var(--color-fg-secondary)"},children:[e.city,e.state?`, ${e.state}`:""]})]}),b&&(0,t.jsxs)("div",{className:"flex-shrink-0 truncate text-sm",style:{width:130,color:"var(--color-fg)"},children:[e.city,e.state?`, ${e.state}`:""]}),b&&(0,t.jsxs)("div",{className:"flex-shrink-0",style:{width:180},children:[(0,t.jsx)("p",{className:"font-mono text-xs",style:{color:"var(--color-fg)"},children:C.time}),C.tzAbbr&&(0,t.jsxs)("p",{className:"truncate text-xs",style:{color:"var(--color-fg-disabled)"},children:[C.tzAbbr," – ",e.timezone]})]}),s&&(0,t.jsx)(m,{flow:s.departures,color:v,label:"Departures"}),s&&(0,t.jsx)(m,{flow:s.arrivals,color:v,label:"Arrivals"}),I]}),T=h?{borderBottom:"1px solid var(--border-color-subtle)",backgroundColor:"var(--color-interactive-subtle)"}:{borderBottom:"1px solid var(--border-color-subtle)"};return l?(0,t.jsxs)("div",{onClick:l,className:"group flex cursor-pointer items-center gap-3 px-4 py-3 transition-colors hover:bg-surface-sunken",style:T,children:[D,M,(0,t.jsx)("div",{className:"flex flex-shrink-0 items-center gap-0.5",children:(0,t.jsx)("button",{onClick:e=>{e.stopPropagation(),l()},className:k,style:R,"aria-label":"View on map",children:(0,t.jsx)(d,{})})})]}):(0,t.jsxs)("div",{onClick:N?()=>x.push(N):void 0,className:`group flex items-center gap-3 px-4 py-3 transition-colors hover:bg-surface-sunken ${N?"cursor-pointer":""}`,style:T,children:[D,M,N&&(0,t.jsx)("div",{className:"flex flex-shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100",children:(0,t.jsx)(i.default,{href:N,onClick:e=>e.stopPropagation(),className:k,style:R,"aria-label":"View on map",children:(0,t.jsx)(d,{})})})]})},"useLocalTime",0,p])},48322,e=>{"use strict";var t=e.i(43476);let n={minor:"#edb200",moderate:"#f97316",severe:"#e40014"},r={minor:"minor issue",moderate:"delay",severe:"serious delay"};e.s(["default",0,function({level:e,className:r=""}){return(0,t.jsx)("span",{"aria-hidden":"true","data-testid":"flights-status-dot","data-status-level":e,className:`inline-block h-2 w-2 rounded-full ${r}`,style:{backgroundColor:n[e]}})},"statusDescription",0,function(e,t){return t?`${r[e]}: ${t}`:r[e]}])},82697,e=>{"use strict";var t=e.i(43476),n=e.i(30086),r=e.i(37202);let i={elevated:{color:"var(--color-fg-warning)",bg:"var(--color-warning-subtle)",label:"Elevated"},high:{color:"var(--color-fg-danger)",bg:"var(--color-danger-subtle)",label:"High"}};e.s(["default",0,function({summary:e}){let{delay:a,connection:o}=e;if(!a&&!o)return null;let s=o?r.RISK_CONFIG[o.level]:null;return(0,t.jsxs)("span",{"data-testid":"trip-risk",className:"flex shrink-0 items-center gap-0.5 sm:gap-1",children:[a&&(0,t.jsxs)("span",{"data-testid":"trip-risk-delay","data-risk-level":a.level,role:"img","aria-label":`Delay risk ${i[a.level].label}: ${a.label}`,title:`Delay risk ${i[a.level].label}: ${a.label}`,className:"inline-flex items-center gap-0.5 rounded-full px-1 py-0.5 text-[11px] leading-none font-semibold sm:px-1.5",style:{color:i[a.level].color,backgroundColor:i[a.level].bg},children:[(0,t.jsx)(n.TriangleAlert,{size:12,"aria-hidden":"true"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:i[a.level].label})]}),o&&s&&(0,t.jsxs)("span",{"data-testid":"trip-risk-connection","data-risk-level":o.level,role:"img","aria-label":`Connection ${s.label}: ${o.label}`,title:`Connection ${s.label}: ${o.label}`,className:"inline-flex items-center gap-0.5 rounded-full px-1 py-0.5 text-[11px] leading-none font-semibold sm:px-1.5",style:{color:s.color,backgroundColor:s.bg},children:[(0,t.jsx)(n.Timer,{size:12,"aria-hidden":"true"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:s.label})]})]})}])},60116,32628,e=>{"use strict";var t=e.i(43476),n=e.i(54495),r=e.i(45188),i=e.i(4534),a=e.i(45291),o=e.i(920),s=e.i(70225),l=e.i(55529);function c({expanded:e}){return(0,t.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e?(0,t.jsx)("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"}):(0,t.jsx)("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})})}e.s(["default",0,function({flightLegContext:e,airportContext:d,airportLookupFailure:u,layoverInfo:f,gridClassName:p,expanded:h,onToggleExpand:g,variant:m="classic",emptyState:x=null}){let b,v,y,j,C=e?.data?.arc?.identIata||e?.identIcao,w=e?.data?.flight,A=w?(0,l.tripStageOf)(w):"before",S=e?`${C} \xb7 ${e.originIata??"—"} → ${e.destinationIata??"—"}`:(d?.name||d?.iata)??"",N=e?`flight:${e.identIcao}:${e.date??""}:${e.originIata}:${e.destinationIata}`:`airport:${d?.icao??u?.iata??""}`;return(0,t.jsxs)(n.CardVariantContext.Provider,{value:m,children:["flint"!==m&&(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{className:"sticky top-0 z-10 flex shrink-0 items-center justify-between gap-2 px-4 py-3",style:{backgroundColor:"var(--color-surface)",borderBottom:"1px solid var(--border-color-subtle)"},children:[(0,t.jsx)("h2",{className:"truncate text-lg font-bold",style:{color:"var(--color-fg)"},children:S}),o.SHARING_ENABLED&&e&&(0,t.jsx)(a.default,{flight:e.identIcao,origin:e.originIata,destination:e.destinationIata,date:e.date,destinationCity:e.data?.flight?.destination.city}),g&&(0,t.jsx)("button",{onClick:g,"aria-label":h?"Collapse card view":"Expand card view",style:{background:"transparent",border:"none",cursor:"pointer",color:"var(--color-fg-secondary)",padding:4,flexShrink:0},children:(0,t.jsx)(c,{expanded:!!h})})]})}),u&&(e||d)&&(0,t.jsxs)("p",{role:"status",className:"mx-4 mt-4 rounded-lg border border-subtle px-3 py-2 text-body-sm text-fg-secondary",children:[[u.iata,u.name].filter(Boolean).join(" · ")," ","could not be loaded. Try again in a moment."]}),(j=e?(0,t.jsxs)("div",{className:"flex flex-col px-4 py-4",children:[f&&(0,t.jsxs)("div",{className:"mb-3 rounded-lg px-3 py-2 text-xs",style:{border:"1px solid var(--border-color-info-subtle)",backgroundColor:"var(--color-interactive-subtle)",color:"var(--color-fg-interactive)"},children:["On the ground at ",f.iata,f.departingLeg&&` \xb7 connects to ${f.departingLeg.identIata||f.departingLeg.ident} in ${v=Math.floor((b=Math.round(f.remainingMs/6e4))/60),y=b%60,v0?`Alerts, ${e} unread`:"Alerts",title:e>0?`${e} unread alerts`:"Alerts",className:"away"===i?"relative flex size-9 shrink-0 press-90 items-center justify-center rounded-full border border-subtle bg-surface/80 text-fg backdrop-blur-[14px] focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none":a?"relative flex size-9.5 press-90 items-center justify-center rounded-xl bg-fg/6 text-fg hover:bg-fg/10 focus-visible:ring-2 focus-visible:ring-focus focus-visible:outline-none":"relative flex h-9 w-9 items-center justify-center rounded-full hover:bg-surface-muted",style:a?void 0:{color:"var(--color-fg)"},children:[(0,t.jsx)(u.Bell,{size:"away"===i?16:a?17:20}),e>0&&(a?(0,t.jsx)("span",{"data-testid":"alerts-unread-count","aria-hidden":"true",className:(0,p.cn)("absolute size-2.5 rounded-full bg-danger","away"===i?"top-1.5 right-2":"top-1.5 right-1.5",l&&"animate-badge-pop"),children:(0,t.jsx)("span",{className:"sr-only",children:(0,f.badgeText)(e)})},l?e:void 0):(0,t.jsx)("span",{"data-testid":"alerts-unread-count","aria-hidden":"true",className:"absolute top-0 right-0 flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-[10px] leading-none font-bold text-white",style:{backgroundColor:"var(--color-danger)"},children:(0,f.badgeText)(e)}))]})}],32628)},19749,59737,e=>{"use strict";var t=e.i(67512);function n(e,t=Date.now()){let r=e=>(e.scheduledArrivalAt?Date.parse(e.scheduledArrivalAt):NaN)+216e5!r(e))},landed:{...e,legs:e.legs.filter(r)}}}function r(e,{makeId:n=t.newId,now:i=Date.now()}={}){let a=[...e.legs].sort((e,t)=>e.scheduledDepartureAt.localeCompare(t.scheduledDepartureAt)),o=new Date(i).toISOString(),s=[];for(let t=0;t0?s[t-1]:null,l=t>0?a[t-1]:null,c=i&&l&&r.origin.icao===l.destination.icao&&function(e,t){if(!e||!t)return!1;let n=new Date(t).getTime()-new Date(e).getTime();return n>=0&&n({ok:!1,aborted:!1,message:e,status:t});async function o(e,t){try{let o=(await new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(r.result),r.onerror=()=>n(r.error),r.readAsDataURL(e)})).split(",")[1]??"",s=await fetch((0,i.withBase)("/api/v1/flight-parse"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({image:o,imageContentType:e.type||"image/jpeg"}),signal:t}),l=await s.json();if(!s.ok||!("candidates"in l))return a("error"in l&&l.error?.message||"Could not read flight details from that image",s.status);let c=l.candidates[0];if(!c)return a("Could not confidently read flight details from that image");let{upcoming:d,landed:u}=n(c),f=r(d),p=r(u);if(0===f.length&&0===p.length)return a("No confirmed flights found in that image");return{ok:!0,legs:f,landed:p}}catch(e){if(t?.aborted)return{ok:!1,aborted:!0};return console.error("[readBookingImage]",e),a("Failed to read that image")}}async function s(){try{for(let e of(await navigator.clipboard.read())){let t=e.types.find(e=>e.startsWith("image/"));if(t){let n=await e.getType(t);return{ok:!0,file:new File([n],"clipboard-image",{type:t})}}}return{ok:!1,message:"No image found on the clipboard"}}catch{return{ok:!1,message:"Could not read the clipboard — try Cmd/Ctrl+V over this area instead"}}}async function l(){let e,t=window.CaptureController,n=t?new t:void 0;try{let t,r=(e=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"window"},controller:n})).getVideoTracks()[0];if(!r)throw Error("No video track in captured stream");let i=r.getSettings().displaySurface;if(("browser"===i||"window"===i)&&n?.setFocusBehavior("no-focus-change"),"ImageCapture"in window){let e=new ImageCapture(r),n=await e.grabFrame(),i=document.createElement("canvas");i.width=n.width,i.height=n.height;let a=i.getContext("2d");if(!a)return{ok:!1,message:"Failed to capture screenshot"};a.drawImage(n,0,0),t=await new Promise(e=>i.toBlob(e,"image/png"))}else{let n=document.createElement("video");n.srcObject=e;let r=new Promise((e,t)=>{n.readyState>=2?e():(n.onloadeddata=()=>e(),setTimeout(()=>t(Error("Timed out waiting for video frame")),5e3))});await n.play(),await r;let i=document.createElement("canvas");i.width=n.videoWidth,i.height=n.videoHeight;let a=i.getContext("2d");if(!a)return{ok:!1,message:"Failed to capture screenshot"};a.drawImage(n,0,0,i.width,i.height),t=await new Promise(e=>i.toBlob(e,"image/png"))}if(!t)return{ok:!1,message:"Failed to capture screenshot"};return{ok:!0,file:new File([t],"screenshot.png",{type:"image/png"})}}catch(e){if(e instanceof DOMException&&"NotAllowedError"===e.name)return{ok:!1,message:null};return console.error("[imageFromScreen]",e),{ok:!1,message:"Failed to capture screenshot"}}finally{e?.getTracks().forEach(e=>e.stop())}}e.s(["canCaptureScreen",0,()=>"u">typeof navigator&&!!navigator.mediaDevices?.getDisplayMedia,"imageFromClipboard",0,s,"imageFromScreen",0,l,"imageIn",0,function(e){let t=Array.from(e.files??[]).find(e=>e.type.startsWith("image/"));if(t)return t;let n=Array.from(e.items??[]).find(e=>"file"===e.kind&&e.type.startsWith("image/"));return n?.getAsFile()??null},"landedImportMessage",0,function(e,t){let n=e.map(e=>`${e.identIata} ${e.originIata} → ${e.destinationIata}`),r=n.length>1?`${n.slice(0,-1).join(", ")} and ${n.at(-1)}`:n[0]??"",i=1===n.length;return t?`${r} ${i?"has":"have"} already landed, so there's nothing to add.`:`${r} ${i?"has":"have"} already landed, so ${i?"it":"they"} won't be added.`},"readBookingImage",0,o],19749)},37202,e=>{"use strict";e.s(["RISK_CONFIG",0,{safe:{label:"Comfortable",color:"#00a544",bg:"#f0fdf4",border:"#bbf7d0"},tight:{label:"Tight",color:"#edb200",bg:"#fefce8",border:"#fef08a"},"at-risk":{label:"At Risk",color:"#f97316",bg:"#fff7ed",border:"#fed7aa"},impossible:{label:"Missed",color:"#e40014",bg:"#fef2f2",border:"#fecaca"}}])},72461,75471,e=>{"use strict";var t=e.i(56669),n=e.i(55529);let r=e=>e&&(0,t.getAirportByIata)(e)?.timezone||"UTC";e.s(["legCardTimes",0,function(e){let t=e.snapshot;return t?{depart:{label:(0,n.endTime)(t,"departure").time,late:(0,n.endDelay)(t,"departure").late},arrive:{label:(0,n.endTime)(t,"arrival").time,late:(0,n.endDelay)(t,"arrival").late}}:{depart:{label:(0,n.formatClock)(e.scheduledDepartureAt,r(e.originIata)),late:!1},arrive:{label:(0,n.formatClock)(e.scheduledArrivalAt,r(e.destinationIata)),late:!1}}},"legProgress",0,function(e){return e.snapshot?(0,n.flightProgress)(e.snapshot):0}],75471),e.s([],72461)},28278,e=>{"use strict";var t=e.i(56669);let n=e=>({lat:e.position.lat,lon:e.position.lon,code:e.iata??e.icao,city:e.city});e.s(["mapFlightFromV1",0,function(e,t,r){let i=e.track?.flown??[],a=e.track?.planned??[],o=e.position;return{ident:e.ident.icao,requestIdent:t,identIata:e.ident.iata??e.ident.icao,date:r??null,origin:n(e.origin),destination:n(e.destination),position:o?{lat:o.lat,lon:o.lon,altitude:o.altitudeFt,groundspeed:o.groundspeedKt,heading:o.headingDeg,timestamp:o.reportedAt}:void 0,trackPositions:i.length?i.map(e=>({lat:e.lat,lon:e.lon,timestamp:e.reportedAt})):void 0,routeWaypoints:a.length?a.map(e=>({lat:e.lat,lon:e.lon})):void 0,flight:e}},"scheduledArc",0,function(e,n,r,i,a,o=null){let s=r?(0,t.getAirportByIcao)(r):void 0,l=i?(0,t.getAirportByIcao)(i):void 0;return s&&l?{ident:e,requestIdent:e,identIata:a||o?.ident.iata||e,origin:{lat:s.lat,lon:s.lng,code:s.iata,city:s.city},destination:{lat:l.lat,lon:l.lng,code:l.iata,city:l.city},date:n??null,flight:o}:null},"trackedIdentIata",0,function(e,t,n){let r=e.flatMap(e=>e.legs).filter(e=>e.faFlightId===t||e.identIcao===t||e.identIata===t),i=n?r.find(e=>e.scheduledDate===n):null;return(i??r[0])?.identIata||null}])},53233,41975,68553,72080,e=>{"use strict";var t=e.i(62876),n=e.i(57005),r=e.i(30374),i=e.i(81789);let a=(0,n.createFlightSearch)({searchFlights:e=>r.v1.searchFlights(e),dayDepartures:(e,t,n)=>r.v1.dayDepartures(e,t,n),icaoOf:r.icaoOf});async function o(e,t=Date.now()){if(!e.id||!(0,n.loadsOnTrack)(e,t))return null;let r=await (0,i.loadFlight)(e.id);return r.data?.resolution==="live"?r.data:null}let s=null;async function l(){let e=await (0,r.loadAirportIndex)();return s??=(0,t.placeIndex)(e.airportIndex.map(e=>({iata:e.iata,name:e.name,city:e.city,country:e.iso_cc,icao:e.icao||void 0})))}e.s(["airportPlaces",0,l,"liveFlightFor",0,o,"searchFlights",0,a],53233);var c=e.i(43476),d=e.i(52236);e.s(["default",0,function({dir:e,className:t,children:n}){return(0,c.jsx)("div",{className:(0,d.cn)("animate-page-in",t),style:{"--page-dir":e},children:n})}],41975);var u=e.i(75254);let f=(0,u.default)("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);e.s(["Camera",0,f],68553);let p=(0,u.default)("image-plus",[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);e.s(["ImagePlus",0,p],72080)},92482,e=>{"use strict";var t=e.i(71645),n=e.i(5844),r=e.i(81140),i=e.i(30030),a=e.i(48425),o=e.i(32006),s=e.i(69340),l=e.i(43476),c=Object.defineProperty,d=(e,t)=>c(e,"name",{value:t,configurable:!0}),u="ContextMenu",[f,p]=(0,i.createContextScope)(u,[o.createMenuScope]),h=(0,o.createMenuScope)(),[g,m]=f(u),x=d(e=>{let{__scopeContextMenu:r,children:i,onOpenChange:a,open:c,dir:d,modal:f=!0}=e,p=t.useRef(!1);if(n.IS_DEVELOPMENT){let e=t.useRef(!1);t.useEffect(()=>{!0!==c||p.current||e.current||(e.current=!0,console.warn("ContextMenu: The `open` prop has been set to `true` before the user has interacted with the trigger, so its position is indeterminate. This is likely unintended and will result in the menu being anchored to the top-left corner of the viewport."))},[c])}let[m,x]=(0,s.useControllableState)({prop:c,defaultProp:!1,onChange:a,caller:u}),b=h(r);return(0,l.jsx)(g,{scope:r,open:m,onOpenChange:x,modal:f,hasInteractedRef:p,children:(0,l.jsx)(o.Root,{...b,dir:d,open:m,onOpenChange:x,modal:f,children:i})})},"ContextMenu"),b=t.forwardRef(d(function(e,n){let{__scopeContextMenu:i,disabled:s=!1,...c}=e,u=m("ContextMenuTrigger",i),f=h(i),[p,g]=t.useState({x:0,y:0}),x=t.useMemo(()=>({current:{getBoundingClientRect:d(()=>DOMRect.fromRect({width:0,height:0,...p}),"getBoundingClientRect")}}),[p]),b=t.useRef(0),v=t.useCallback(()=>window.clearTimeout(b.current),[]),y=d(e=>{u.hasInteractedRef.current=!0,g({x:e.clientX,y:e.clientY}),u.onOpenChange(!0)},"handleOpen");return t.useEffect(()=>v,[v]),t.useEffect(()=>void(s&&v()),[s,v]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(o.Anchor,{...f,virtualRef:x}),(0,l.jsx)(a.Primitive.span,{"data-state":u.open?"open":"closed","data-disabled":s?"":void 0,...c,ref:n,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:s?e.onContextMenu:(0,r.composeEventHandlers)(e.onContextMenu,e=>{v(),y(e),e.preventDefault()}),onPointerDown:s?e.onPointerDown:(0,r.composeEventHandlers)(e.onPointerDown,P(e=>{v(),u.open&&u.onOpenChange(!1),b.current=window.setTimeout(()=>y(e),700)})),onPointerMove:s?e.onPointerMove:(0,r.composeEventHandlers)(e.onPointerMove,P(v)),onPointerCancel:s?e.onPointerCancel:(0,r.composeEventHandlers)(e.onPointerCancel,P(v)),onPointerUp:s?e.onPointerUp:(0,r.composeEventHandlers)(e.onPointerUp,P(v))})]})},"ContextMenuTrigger")),v=d(e=>{let{__scopeContextMenu:t,...n}=e,r=h(t);return(0,l.jsx)(o.Portal,{...r,...n})},"ContextMenuPortal"),y=t.forwardRef(d(function(e,n){let{__scopeContextMenu:r,...i}=e,a=m("ContextMenuContent",r),s=h(r),c=t.useRef(!1);return(0,l.jsx)(o.Content,{...s,...i,ref:n,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),!t.defaultPrevented&&c.current&&t.preventDefault(),c.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||a.modal||(c.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuContent")),j=t.forwardRef(d(function(e,t){let{__scopeContextMenu:n,...r}=e,i=h(n);return(0,l.jsx)(o.Group,{...i,...r,ref:t})},"ContextMenuGroup")),C=t.forwardRef(d(function(e,t){let{__scopeContextMenu:n,...r}=e,i=h(n);return(0,l.jsx)(o.Label,{...i,...r,ref:t})},"ContextMenuLabel")),w=t.forwardRef(d(function(e,t){let{__scopeContextMenu:n,...r}=e,i=h(n);return(0,l.jsx)(o.Item,{...i,...r,ref:t})},"ContextMenuItem")),A=t.forwardRef(d(function(e,t){let{__scopeContextMenu:n,...r}=e,i=h(n);return(0,l.jsx)(o.CheckboxItem,{...i,...r,ref:t})},"ContextMenuCheckboxItem")),S=t.forwardRef(d(function(e,t){let{__scopeContextMenu:n,...r}=e,i=h(n);return(0,l.jsx)(o.RadioGroup,{...i,...r,ref:t})},"ContextMenuRadioGroup")),N=t.forwardRef(d(function(e,t){let{__scopeContextMenu:n,...r}=e,i=h(n);return(0,l.jsx)(o.RadioItem,{...i,...r,ref:t})},"ContextMenuRadioItem")),k=t.forwardRef(d(function(e,t){let{__scopeContextMenu:n,...r}=e,i=h(n);return(0,l.jsx)(o.ItemIndicator,{...i,...r,ref:t})},"ContextMenuItemIndicator")),R=t.forwardRef(d(function(e,t){let{__scopeContextMenu:n,...r}=e,i=h(n);return(0,l.jsx)(o.Separator,{...i,...r,ref:t})},"ContextMenuSeparator")),M=t.forwardRef(d(function(e,t){let{__scopeContextMenu:n,...r}=e,i=h(n);return(0,l.jsx)(o.Arrow,{...i,...r,ref:t})},"ContextMenuArrow")),I=d(e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,defaultOpen:a}=e,c=h(t),[d,u]=(0,s.useControllableState)({prop:i,defaultProp:a??!1,onChange:r,caller:"ContextMenuSub"});return(0,l.jsx)(o.Sub,{...c,open:d,onOpenChange:u,children:n})},"ContextMenuSub"),D=t.forwardRef(d(function(e,t){let{__scopeContextMenu:n,...r}=e,i=h(n);return(0,l.jsx)(o.SubTrigger,{...i,...r,ref:t})},"ContextMenuSubTrigger")),T=t.forwardRef(d(function(e,t){let{__scopeContextMenu:n,...r}=e,i=h(n);return(0,l.jsx)(o.SubContent,{...i,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuSubContent"));function P(e){return t=>"mouse"!==t.pointerType?e(t):void 0}d(P,"whenTouchOrPen"),e.s(["Arrow",0,M,"CheckboxItem",0,A,"Content",0,y,"ContextMenu",0,x,"ContextMenuArrow",0,M,"ContextMenuCheckboxItem",0,A,"ContextMenuContent",0,y,"ContextMenuGroup",0,j,"ContextMenuItem",0,w,"ContextMenuItemIndicator",0,k,"ContextMenuLabel",0,C,"ContextMenuPortal",0,v,"ContextMenuRadioGroup",0,S,"ContextMenuRadioItem",0,N,"ContextMenuSeparator",0,R,"ContextMenuSub",0,I,"ContextMenuSubContent",0,T,"ContextMenuSubTrigger",0,D,"ContextMenuTrigger",0,b,"Group",0,j,"Item",0,w,"ItemIndicator",0,k,"Label",0,C,"Portal",0,v,"RadioGroup",0,S,"RadioItem",0,N,"Root",0,x,"Separator",0,R,"Sub",0,I,"SubContent",0,T,"SubTrigger",0,D,"Trigger",0,b,"createContextMenuScope",0,p],79602);var L=e.i(79602);e.s(["ContextMenu",0,L],92482)},95692,e=>{"use strict";var t=e.i(71645),n=e.i(81140),r=e.i(20783),i=e.i(30030),a=e.i(69340),o=e.i(48425),s=e.i(32006),l=e.i(10772),c=e.i(43476),d=Object.defineProperty,u=(e,t)=>d(e,"name",{value:t,configurable:!0}),f="DropdownMenu",[p,h]=(0,i.createContextScope)(f,[s.createMenuScope]),g=(0,s.createMenuScope)(),[m,x]=p(f),b=u(e=>{let{__scopeDropdownMenu:n,children:r,dir:i,open:o,defaultOpen:d,onOpenChange:u,modal:p=!0}=e,h=g(n),x=t.useRef(null),[b,v]=(0,a.useControllableState)({prop:o,defaultProp:d??!1,onChange:u,caller:f});return(0,c.jsx)(m,{scope:n,triggerId:(0,l.useId)(),triggerRef:x,contentId:(0,l.useId)(),open:b,onOpenChange:v,onOpenToggle:t.useCallback(()=>v(e=>!e),[v]),modal:p,children:(0,c.jsx)(s.Root,{...h,open:b,onOpenChange:v,dir:i,modal:p,children:r})})},"DropdownMenu"),v=t.forwardRef(u(function(e,t){let{__scopeDropdownMenu:i,disabled:a=!1,...l}=e,d=x("DropdownMenuTrigger",i),u=g(i),f=(0,r.useComposedRefs)(t,d.triggerRef);return(0,c.jsx)(s.Anchor,{asChild:!0,...u,children:(0,c.jsx)(o.Primitive.button,{type:"button",id:d.triggerId,"aria-haspopup":"menu","aria-expanded":d.open,"aria-controls":d.open?d.contentId:void 0,"data-state":d.open?"open":"closed","data-disabled":a?"":void 0,disabled:a,...l,ref:f,onPointerDown:(0,n.composeEventHandlers)(e.onPointerDown,e=>{!a&&0===e.button&&!1===e.ctrlKey&&(d.onOpenToggle(),d.open||e.preventDefault())}),onKeyDown:(0,n.composeEventHandlers)(e.onKeyDown,e=>{!a&&(["Enter"," "].includes(e.key)&&d.onOpenToggle(),"ArrowDown"===e.key&&d.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})},"DropdownMenuTrigger")),y=u(e=>{let{__scopeDropdownMenu:t,...n}=e,r=g(t);return(0,c.jsx)(s.Portal,{...r,...n})},"DropdownMenuPortal"),j=t.forwardRef(u(function(e,r){let{__scopeDropdownMenu:i,...a}=e,o=x("DropdownMenuContent",i),l=g(i),d=t.useRef(!1);return(0,c.jsx)(s.Content,{id:o.contentId,"aria-labelledby":o.triggerId,...l,...a,ref:r,onCloseAutoFocus:(0,n.composeEventHandlers)(e.onCloseAutoFocus,e=>{d.current||o.triggerRef.current?.focus(),d.current=!1,e.preventDefault()}),onInteractOutside:(0,n.composeEventHandlers)(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;(!o.modal||r)&&(d.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),C=t.forwardRef(u(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=g(n);return(0,c.jsx)(s.Group,{...i,...r,ref:t})},"DropdownMenuGroup")),w=t.forwardRef(u(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=g(n);return(0,c.jsx)(s.Label,{...i,...r,ref:t})},"DropdownMenuLabel")),A=t.forwardRef(u(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=g(n);return(0,c.jsx)(s.Item,{...i,...r,ref:t})},"DropdownMenuItem")),S=t.forwardRef(u(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=g(n);return(0,c.jsx)(s.CheckboxItem,{...i,...r,ref:t})},"DropdownMenuCheckboxItem")),N=t.forwardRef(u(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=g(n);return(0,c.jsx)(s.RadioGroup,{...i,...r,ref:t})},"DropdownMenuRadioGroup")),k=t.forwardRef(u(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=g(n);return(0,c.jsx)(s.RadioItem,{...i,...r,ref:t})},"DropdownMenuRadioItem")),R=t.forwardRef(u(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=g(n);return(0,c.jsx)(s.ItemIndicator,{...i,...r,ref:t})},"DropdownMenuItemIndicator")),M=t.forwardRef(u(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=g(n);return(0,c.jsx)(s.Separator,{...i,...r,ref:t})},"DropdownMenuSeparator")),I=t.forwardRef(u(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=g(n);return(0,c.jsx)(s.Arrow,{...i,...r,ref:t})},"DropdownMenuArrow")),D=u(e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:o}=e,l=g(t),[d,u]=(0,a.useControllableState)({prop:r,defaultProp:o??!1,onChange:i,caller:"DropdownMenuSub"});return(0,c.jsx)(s.Sub,{...l,open:d,onOpenChange:u,children:n})},"DropdownMenuSub"),T=t.forwardRef(u(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=g(n);return(0,c.jsx)(s.SubTrigger,{...i,...r,ref:t})},"DropdownMenuSubTrigger")),P=t.forwardRef(u(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=g(n);return(0,c.jsx)(s.SubContent,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent"));e.s(["Arrow",0,I,"CheckboxItem",0,S,"Content",0,j,"DropdownMenu",0,b,"DropdownMenuArrow",0,I,"DropdownMenuCheckboxItem",0,S,"DropdownMenuContent",0,j,"DropdownMenuGroup",0,C,"DropdownMenuItem",0,A,"DropdownMenuItemIndicator",0,R,"DropdownMenuLabel",0,w,"DropdownMenuPortal",0,y,"DropdownMenuRadioGroup",0,N,"DropdownMenuRadioItem",0,k,"DropdownMenuSeparator",0,M,"DropdownMenuSub",0,D,"DropdownMenuSubContent",0,P,"DropdownMenuSubTrigger",0,T,"DropdownMenuTrigger",0,v,"Group",0,C,"Item",0,A,"ItemIndicator",0,R,"Label",0,w,"Portal",0,y,"RadioGroup",0,N,"RadioItem",0,k,"Root",0,b,"Separator",0,M,"Sub",0,D,"SubContent",0,P,"SubTrigger",0,T,"Trigger",0,v,"createDropdownMenuScope",0,h],40666);var L=e.i(40666);e.s(["DropdownMenu",0,L],95692)},32006,e=>{"use strict";var t=e.i(71645),n=e.i(81140),r=e.i(75830),i=e.i(20783),a=e.i(30030),o=e.i(86318),s=e.i(26330),l=e.i(3536),c=e.i(65491),d=e.i(10772),u=e.i(53660),f=e.i(74606),p=e.i(96626),h=e.i(48425),g=e.i(84606),m=e.i(91918),x=e.i(30207),b=e.i(86312),v=e.i(85369),y=e.i(43476),j=Object.defineProperty,C=(e,t)=>j(e,"name",{value:t,configurable:!0}),w=["Enter"," "],A=["ArrowUp","PageDown","End"],S=["ArrowDown","PageUp","Home",...A],N={ltr:[...w,"ArrowRight"],rtl:[...w,"ArrowLeft"]},k={ltr:["ArrowLeft"],rtl:["ArrowRight"]},R="Menu",[M,I,D]=(0,r.createCollection)(R),[T,P]=(0,a.createContextScope)(R,[D,u.createPopperScope,g.createRovingFocusGroupScope]),L=(0,u.createPopperScope)(),E=(0,g.createRovingFocusGroupScope)(),[O,F]=T(R),[B,U]=T(R),K=C(e=>{let{__scopeMenu:n,open:r=!1,children:i,dir:a,onOpenChange:s,modal:l=!0}=e,c=L(n),[d,f]=t.useState(null),p=t.useRef(!1),h=(0,x.useCallbackRef)(s),g=(0,o.useDirection)(a);return t.useEffect(()=>{let e=C(()=>{p.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},"handleKeyDown"),t=C(()=>p.current=!1,"handlePointer");return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),t.useEffect(()=>{if(!r)return;let e=C(()=>h(!1),"handleBlur");return window.addEventListener("blur",e),()=>window.removeEventListener("blur",e)},[r,h]),(0,y.jsx)(u.Root,{...c,children:(0,y.jsx)(O,{scope:n,open:r,onOpenChange:h,content:d,onContentChange:f,children:(0,y.jsx)(B,{scope:n,onClose:t.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:p,dir:g,modal:l,children:i})})})},"Menu"),H=t.forwardRef(C(function(e,t){let{__scopeMenu:n,...r}=e,i=L(n);return(0,y.jsx)(u.Anchor,{...i,...r,ref:t})},"MenuAnchor")),G="MenuPortal",[$,_]=T(G,{forceMount:void 0}),z=C(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=F(G,t);return(0,y.jsx)($,{scope:t,forceMount:n,children:(0,y.jsx)(p.Presence,{present:n||a.open,children:(0,y.jsx)(f.Portal,{asChild:!0,container:i,children:r})})})},"MenuPortal"),V="MenuContent",[W,Z]=T(V),J=t.forwardRef(C(function(e,t){let n=_(V,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=F(V,e.__scopeMenu),o=U(V,e.__scopeMenu);return(0,y.jsx)(M.Provider,{scope:e.__scopeMenu,children:(0,y.jsx)(p.Presence,{present:r||a.open,children:(0,y.jsx)(M.Slot,{scope:e.__scopeMenu,children:o.modal?(0,y.jsx)(Y,{...i,ref:t}):(0,y.jsx)(X,{...i,ref:t})})})})},"MenuContent")),Y=t.forwardRef(C(function(e,r){let a=F(V,e.__scopeMenu),o=t.useRef(null),s=(0,i.useComposedRefs)(r,o);return t.useEffect(()=>{let e=o.current;if(e)return(0,b.hideOthers)(e)},[]),(0,y.jsx)(q,{...e,ref:s,trapFocus:a.open,disableOutsidePointerEvents:a.open,disableOutsideScroll:!0,onFocusOutside:(0,n.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>a.onOpenChange(!1)})},"MenuRootContentModal")),X=t.forwardRef(C(function(e,t){let n=F(V,e.__scopeMenu);return(0,y.jsx)(q,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},"MenuRootContentNonModal")),Q=(0,m.createSlot)("MenuContent.ScrollLock"),q=t.forwardRef(C(function(e,r){let{__scopeMenu:a,loop:o=!1,trapFocus:d,onOpenAutoFocus:f,onCloseAutoFocus:p,disableOutsidePointerEvents:h,onEntryFocus:m,onEscapeKeyDown:x,onPointerDownOutside:b,onFocusOutside:j,onInteractOutside:w,onDismiss:N,disableOutsideScroll:k,...R}=e,M=F(V,a),D=U(V,a),T=L(a),P=E(a),O=I(a),[B,K]=t.useState(null),H=t.useRef(null),G=(0,i.useComposedRefs)(r,H,M.onContentChange),$=t.useRef(0),_=t.useRef(""),z=t.useRef(0),Z=t.useRef(null),J=t.useRef("right"),Y=t.useRef(0),X=k?v.RemoveScroll:t.Fragment,q=C(e=>{let t=_.current+e,n=O().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=eM(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;o&&setTimeout(()=>o.focus())},"handleTypeaheadSearch");t.useEffect(()=>()=>window.clearTimeout($.current),[]),(0,l.useFocusGuards)();let ee=t.useCallback(e=>J.current===Z.current?.side&&eD(e,Z.current?.area),[]);return(0,y.jsx)(W,{scope:a,searchRef:_,onItemEnter:t.useCallback(e=>{ee(e)&&e.preventDefault()},[ee]),onItemLeave:t.useCallback(e=>{ee(e)||(H.current?.focus(),K(null))},[ee]),onTriggerLeave:t.useCallback(e=>{ee(e)&&e.preventDefault()},[ee]),pointerGraceTimerRef:z,onPointerGraceIntentChange:t.useCallback(e=>{Z.current=e},[]),children:(0,y.jsx)(X,{...k?{as:Q,allowPinchZoom:!0}:void 0,children:(0,y.jsx)(c.FocusScope,{asChild:!0,trapped:d,onMountAutoFocus:(0,n.composeEventHandlers)(f,e=>{e.preventDefault(),H.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:p,children:(0,y.jsx)(s.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:h,onEscapeKeyDown:x,onPointerDownOutside:b,onFocusOutside:j,onInteractOutside:w,onDismiss:N,children:(0,y.jsx)(g.Root,{asChild:!0,...P,dir:D.dir,orientation:"vertical",loop:o,currentTabStopId:B,onCurrentTabStopIdChange:K,onEntryFocus:(0,n.composeEventHandlers)(m,e=>{D.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,y.jsx)(u.Content,{role:"menu","aria-orientation":"vertical","data-state":eA(M.open),"data-radix-menu-content":"",dir:D.dir,...T,...R,ref:G,style:{outline:"none",...R.style},onKeyDown:(0,n.composeEventHandlers)(R.onKeyDown,e=>{let t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&q(e.key));let i=H.current;if(e.target!==i||!S.includes(e.key))return;e.preventDefault();let a=O().filter(e=>!e.disabled).map(e=>e.ref.current);A.includes(e.key)&&a.reverse(),ek(a)}),onBlur:(0,n.composeEventHandlers)(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout($.current),_.current="")}),onPointerMove:(0,n.composeEventHandlers)(e.onPointerMove,eT(e=>{let t=e.target,n=Y.current!==e.clientX;e.currentTarget.contains(t)&&n&&(J.current=e.clientX>Y.current?"right":"left",Y.current=e.clientX)}))})})})})})})},"MenuContentImpl")),ee=t.forwardRef(C(function(e,t){let{__scopeMenu:n,...r}=e;return(0,y.jsx)(h.Primitive.div,{role:"group",...r,ref:t})},"MenuGroup")),et=t.forwardRef(C(function(e,t){let{__scopeMenu:n,...r}=e;return(0,y.jsx)(h.Primitive.div,{...r,ref:t})},"MenuLabel")),en="MenuItem",er="menu.itemSelect",ei=t.forwardRef(C(function(e,r){let{disabled:a=!1,onSelect:o,...s}=e,l=t.useRef(null),c=U(en,e.__scopeMenu),d=Z(en,e.__scopeMenu),u=(0,i.useComposedRefs)(r,l),f=t.useRef(!1),p=C(()=>{let e=l.current;if(!a&&e){let t=new CustomEvent(er,{bubbles:!0,cancelable:!0});e.addEventListener(er,e=>o?.(e),{once:!0}),(0,h.dispatchDiscreteCustomEvent)(e,t),t.defaultPrevented?f.current=!1:c.onClose()}},"handleSelect");return(0,y.jsx)(ea,{...s,ref:u,disabled:a,onClick:(0,n.composeEventHandlers)(e.onClick,p),onPointerDown:t=>{e.onPointerDown?.(t),f.current=!0},onPointerUp:(0,n.composeEventHandlers)(e.onPointerUp,e=>{f.current||e.currentTarget?.click()}),onKeyDown:(0,n.composeEventHandlers)(e.onKeyDown,e=>{a||e.target!==e.currentTarget||(""===d.searchRef.current||" "!==e.key)&&w.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},"MenuItem")),ea=t.forwardRef(C(function(e,r){let{__scopeMenu:a,disabled:o=!1,textValue:s,...l}=e,c=Z(en,a),d=E(a),u=t.useRef(null),f=(0,i.useComposedRefs)(r,u),[p,m]=t.useState(!1),[x,b]=t.useState("");return t.useEffect(()=>{let e=u.current;e&&b((e.textContent??"").trim())},[l.children]),(0,y.jsx)(M.ItemSlot,{scope:a,disabled:o,textValue:s??x,children:(0,y.jsx)(g.Item,{asChild:!0,...d,focusable:!o,children:(0,y.jsx)(h.Primitive.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...l,ref:f,onPointerMove:(0,n.composeEventHandlers)(e.onPointerMove,eT(e=>{o?c.onItemLeave(e):(c.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:(0,n.composeEventHandlers)(e.onPointerLeave,eT(e=>c.onItemLeave(e))),onFocus:(0,n.composeEventHandlers)(e.onFocus,()=>m(!0)),onBlur:(0,n.composeEventHandlers)(e.onBlur,()=>m(!1))})})})},"MenuItemImpl")),eo=t.forwardRef(C(function(e,t){let{checked:r=!1,onCheckedChange:i,...a}=e;return(0,y.jsx)(ef,{scope:e.__scopeMenu,checked:r,children:(0,y.jsx)(ei,{role:"menuitemcheckbox","aria-checked":eS(r)?"mixed":r,...a,ref:t,"data-state":eN(r),onSelect:(0,n.composeEventHandlers)(a.onSelect,()=>i?.(!!eS(r)||!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),[es,el]=T("MenuRadioGroup",{value:void 0,onValueChange:C(()=>{},"onValueChange")}),ec=t.forwardRef(C(function(e,t){let{value:n,onValueChange:r,...i}=e,a=(0,x.useCallbackRef)(r);return(0,y.jsx)(es,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,y.jsx)(ee,{...i,ref:t})})},"MenuRadioGroup")),ed=t.forwardRef(C(function(e,t){let{value:r,...i}=e,a=el("MenuRadioItem",e.__scopeMenu),o=r===a.value;return(0,y.jsx)(ef,{scope:e.__scopeMenu,checked:o,children:(0,y.jsx)(ei,{role:"menuitemradio","aria-checked":o,...i,ref:t,"data-state":eN(o),onSelect:(0,n.composeEventHandlers)(i.onSelect,()=>a.onValueChange?.(r),{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),eu="MenuItemIndicator",[ef,ep]=T(eu,{checked:!1}),eh=t.forwardRef(C(function(e,t){let{__scopeMenu:n,forceMount:r,...i}=e,a=ep(eu,n);return(0,y.jsx)(p.Presence,{present:r||eS(a.checked)||!0===a.checked,children:(0,y.jsx)(h.Primitive.span,{...i,ref:t,"data-state":eN(a.checked)})})},"MenuItemIndicator")),eg=t.forwardRef(C(function(e,t){let{__scopeMenu:n,...r}=e;return(0,y.jsx)(h.Primitive.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})},"MenuSeparator")),em=t.forwardRef(C(function(e,t){let{__scopeMenu:n,...r}=e,i=L(n);return(0,y.jsx)(u.Arrow,{...i,...r,ref:t})},"MenuArrow")),ex="MenuSub",[eb,ev]=T(ex),ey=C(e=>{let{__scopeMenu:n,children:r,open:i=!1,onOpenChange:a}=e,o=F(ex,n),s=L(n),[l,c]=t.useState(null),[f,p]=t.useState(null),h=(0,x.useCallbackRef)(a);return t.useEffect(()=>(!1===o.open&&h(!1),()=>h(!1)),[o.open,h]),(0,y.jsx)(u.Root,{...s,children:(0,y.jsx)(O,{scope:n,open:i,onOpenChange:h,content:f,onContentChange:p,children:(0,y.jsx)(eb,{scope:n,contentId:(0,d.useId)(),triggerId:(0,d.useId)(),trigger:l,onTriggerChange:c,children:r})})})},"MenuSub"),ej="MenuSubTrigger",eC=t.forwardRef(C(function(e,r){let a=F(ej,e.__scopeMenu),o=U(ej,e.__scopeMenu),s=ev(ej,e.__scopeMenu),l=Z(ej,e.__scopeMenu),c=t.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:u}=l,f={__scopeMenu:e.__scopeMenu},p=t.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);t.useEffect(()=>p,[p]),t.useEffect(()=>{let e=d.current;return()=>{window.clearTimeout(e),u(null)}},[d,u]);let h=(0,i.useComposedRefs)(r,s.onTriggerChange);return(0,y.jsx)(H,{asChild:!0,...f,children:(0,y.jsx)(ea,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?s.contentId:void 0,"data-state":eA(a.open),...e,ref:h,onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),a.open||a.onOpenChange(!0))},onPointerMove:(0,n.composeEventHandlers)(e.onPointerMove,eT(t=>{l.onItemEnter(t),!t.defaultPrevented&&(e.disabled||a.open||c.current||(l.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{a.onOpenChange(!0),p()},100)))})),onPointerLeave:(0,n.composeEventHandlers)(e.onPointerLeave,eT(e=>{p();let t=a.content?.getBoundingClientRect();if(t){let n=a.content?.dataset.side,r="right"===n,i=t[r?"left":"right"],o=t[r?"right":"left"];l.onPointerGraceIntentChange({area:[{x:e.clientX+(r?-5:5),y:e.clientY},{x:i,y:t.top},{x:o,y:t.top},{x:o,y:t.bottom},{x:i,y:t.bottom}],side:n}),window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(e),e.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:(0,n.composeEventHandlers)(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||(""===l.searchRef.current||" "!==t.key)&&N[o.dir].includes(t.key)&&(a.onOpenChange(!0),a.content?.focus(),t.preventDefault())})})})},"MenuSubTrigger")),ew=t.forwardRef(C(function(e,r){let a=_(V,e.__scopeMenu),{forceMount:o=a.forceMount,align:s="start",...l}=e,c=F(V,e.__scopeMenu),d=U(V,e.__scopeMenu),u=ev("MenuSubContent",e.__scopeMenu),f=t.useRef(null),h=(0,i.useComposedRefs)(r,f);return(0,y.jsx)(M.Provider,{scope:e.__scopeMenu,children:(0,y.jsx)(p.Presence,{present:o||c.open,children:(0,y.jsx)(M.Slot,{scope:e.__scopeMenu,children:(0,y.jsx)(q,{id:u.contentId,"aria-labelledby":u.triggerId,...l,ref:h,align:s,side:"rtl"===d.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{d.isUsingKeyboardRef.current&&f.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:(0,n.composeEventHandlers)(e.onFocusOutside,e=>{e.target!==u.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:(0,n.composeEventHandlers)(e.onEscapeKeyDown,e=>{d.onClose(),e.preventDefault()}),onKeyDown:(0,n.composeEventHandlers)(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=k[d.dir].includes(e.key);t&&n&&(c.onOpenChange(!1),u.trigger?.focus(),e.preventDefault())})})})})})},"MenuSubContent"));function eA(e){return e?"open":"closed"}function eS(e){return"indeterminate"===e}function eN(e){return eS(e)?"indeterminate":e?"checked":"unchecked"}function ek(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function eR(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function eM(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=eR(e,Math.max(i,0));1===r.length&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o!==n?o:void 0}function eI(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;er!=u>r&&n"mouse"===t.pointerType?e(t):void 0}C(eA,"getOpenState"),C(eS,"isIndeterminate"),C(eN,"getCheckedState"),C(ek,"focusFirst"),C(eR,"wrapArray"),C(eM,"getNextMatch"),C(eI,"isPointInPolygon"),C(eD,"isPointerInGraceArea"),C(eT,"whenMouse"),e.s(["Anchor",0,H,"Arrow",0,em,"CheckboxItem",0,eo,"Content",0,J,"Group",0,ee,"Item",0,ei,"ItemIndicator",0,eh,"Label",0,et,"Portal",0,z,"RadioGroup",0,ec,"RadioItem",0,ed,"Root",0,K,"Separator",0,eg,"Sub",0,ey,"SubContent",0,ew,"SubTrigger",0,eC,"createMenuScope",0,P])},84606,75830,86318,e=>{"use strict";var t=e.i(71645),n=e.i(81140),r=e.i(30030),i=e.i(20783),a=e.i(91918),o=e.i(43476),s=Object.defineProperty,l=(e,t)=>s(e,"name",{value:t,configurable:!0});function c(e){let n=e+"CollectionProvider",[s,c]=(0,r.createContextScope)(n),[d,u]=s(n,{collectionRef:{current:null},itemMap:new Map}),f=l(e=>{let{scope:n,children:r}=e,i=t.useRef(null),a=t.useRef(new Map).current;return(0,o.jsx)(d,{scope:n,itemMap:a,collectionRef:i,children:r})},"CollectionProvider");f.displayName=n;let p=e+"CollectionSlot",h=(0,a.createSlot)(p),g=t.forwardRef((e,t)=>{let{scope:n,children:r}=e,a=u(p,n),s=(0,i.useComposedRefs)(t,a.collectionRef);return(0,o.jsx)(h,{ref:s,children:r})});g.displayName=p;let m=e+"CollectionItemSlot",x="data-radix-collection-item",b=(0,a.createSlot)(m),v=t.forwardRef((e,n)=>{let{scope:r,children:a,...s}=e,l=t.useRef(null),c=(0,i.useComposedRefs)(n,l),d=u(m,r);return t.useEffect(()=>(d.itemMap.set(l,{ref:l,...s}),()=>void d.itemMap.delete(l))),(0,o.jsx)(b,{...{[x]:""},ref:c,children:a})});function y(n){let r=u(e+"CollectionConsumer",n);return t.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${x}]`));return Array.from(r.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[r.collectionRef,r.itemMap])}return v.displayName=m,l(y,"useCollection"),[{Provider:f,Slot:g,ItemSlot:v},y,c]}l(c,"createCollection");var d=new WeakMap,u=class e extends Map{static{l(this,"OrderedDict")}#e;constructor(e){super(e),this.#e=[...super.keys()],d.set(this,!0)}set(e,t){return d.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r,i=this.has(t),a=this.#e.length,o=h(e),s=o>=0?o:a+o,l=s=a?-1:s;if(l===this.size||i&&l===this.size-1||-1===l)return this.set(t,n),this;let c=this.size+ +!i;o=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(-1===n)return;let r=n+t;return r=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return -1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=0===r&&1===e.length?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&1===e.length?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(void 0===t)return r;t0&&(i=n-1);for(let e=t;e=0?r:n+r;return i=n?-1:i}function h(e){return e!=e||0===e?0:Math.trunc(e)}function g(e,t){if(e===t)return!0;if("object"!=typeof e||"object"!=typeof t||null==e||null==t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}function m(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function x(e,t){return e[1].element&&t[1].element?m(e[1].element,t[1].element)?-1:1:0}function b(e){return new MutationObserver(t=>{for(let n of t)if("childList"===n.type)return void e()})}l(f,"at"),l(p,"toSafeIndex"),l(h,"toSafeInteger"),l(function(e){let n=e+"CollectionProvider",[s,c]=(0,r.createContextScope)(n),[d,f]=s(n,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new u,setItemMap:l(()=>void 0,"setItemMap")}),p=l(({state:e,...t})=>e?(0,o.jsx)(m,{...t,state:e}):(0,o.jsx)(h,{...t}),"CollectionProvider");p.displayName=n;let h=l(e=>{let t=S();return(0,o.jsx)(m,{...e,state:t})},"CollectionInit");h.displayName=n+"Init";let m=l(e=>{let{scope:n,children:r,state:a}=e,s=t.useRef(null),[l,c]=t.useState(null),u=(0,i.useComposedRefs)(s,c),[f,p]=a;return t.useEffect(()=>{if(!l)return;let e=b(()=>{});return e.observe(l,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[l]),(0,o.jsx)(d,{scope:n,itemMap:f,setItemMap:p,collectionRef:u,collectionRefObject:s,collectionElement:l,children:r})},"CollectionProviderImpl");m.displayName=n+"Impl";let v=e+"CollectionSlot",y=(0,a.createSlot)(v),j=t.forwardRef((e,t)=>{let{scope:n,children:r}=e,a=f(v,n),s=(0,i.useComposedRefs)(t,a.collectionRef);return(0,o.jsx)(y,{ref:s,children:r})});j.displayName=v;let C=e+"CollectionItemSlot",w=(0,a.createSlot)(C),A=t.forwardRef((e,n)=>{let{scope:r,children:a,...s}=e,l=t.useRef(null),[c,d]=t.useState(null),p=(0,i.useComposedRefs)(n,l,d),{setItemMap:h}=f(C,r),m=t.useRef(s);g(m.current,s)||(m.current=s);let b=m.current;return t.useEffect(()=>(h(e=>c?e.has(c)?e.set(c,{...b,element:c}).toSorted(x):(e.set(c,{...b,element:c}),e.toSorted(x)):e),()=>{h(e=>c&&e.has(c)?(e.delete(c),new u(e)):e)}),[c,b,h]),(0,o.jsx)(w,{"data-radix-collection-item":"",ref:p,children:a})});function S(){return t.useState(new u)}function N(t){let{itemMap:n}=f(e+"CollectionConsumer",t);return n}return A.displayName=C,l(S,"useInitCollection"),l(N,"useCollection"),[{Provider:p,Slot:j,ItemSlot:A},{createCollectionScope:c,useCollection:N,useInitCollection:S}]},"createCollection"),l(g,"shallowEqual"),l(m,"isElementPreceding"),l(x,"sortByDocumentPosition"),l(b,"getChildListObserver"),e.s(["createCollection",0,c],75830);var v=e.i(10772),y=e.i(48425),j=e.i(30207),C=e.i(69340),w=Object.defineProperty,A=t.createContext(void 0);function S(e){let n=t.useContext(A);return e||n||"ltr"}w(S,"name",{value:"useDirection",configurable:!0}),e.s(["useDirection",0,S],86318);var N=e.i(34620),k=Object.defineProperty,R=(e,t)=>k(e,"name",{value:t,configurable:!0}),M=!1;function I(){let[e,n]=t.useState(M);return t.useEffect(()=>{M||(M=!0,n(!0))},[]),e}R(I,"useIsHydrated");var D=t[" useSyncExternalStore ".trim().toString()];function T(){return()=>{}}function P(){return D(T,()=>!0,()=>!1)}R(T,"subscribe"),R(P,"useIsHydratedModern");var L="function"==typeof D?P:I,E=Object.defineProperty,O=(e,t)=>E(e,"name",{value:t,configurable:!0}),F="rovingFocusGroup.onEntryFocus",B={bubbles:!1,cancelable:!0},U="RovingFocusGroup",[K,H,G]=c(U),[$,_]=(0,r.createContextScope)(U,[G]),[z,V]=$(U),W=t.forwardRef(O(function(e,t){return(0,o.jsx)(K.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,o.jsx)(K.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,o.jsx)(Z,{...e,ref:t})})})},"RovingFocusGroup")),Z=t.forwardRef(O(function(e,r){let{__scopeRovingFocusGroup:a,orientation:s,loop:l=!1,dir:c,currentTabStopId:d,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:f,onEntryFocus:p,preventScrollOnEntryFocus:h=!1,...g}=e,m=t.useRef(null),x=(0,i.useComposedRefs)(r,m),b=S(c),[v,w]=(0,C.useControllableState)({prop:d,defaultProp:u??null,onChange:f,caller:U}),[A,N]=t.useState(!1),k=(0,j.useCallbackRef)(p),R=H(a),M=t.useRef(!1),[I,D]=t.useState(0);return t.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(F,k),()=>e.removeEventListener(F,k)},[k]),(0,o.jsx)(z,{scope:a,orientation:s,dir:b,loop:l,currentTabStopId:v,onItemFocus:t.useCallback(e=>w(e),[w]),onItemShiftTab:t.useCallback(()=>N(!0),[]),onFocusableItemAdd:t.useCallback(()=>D(e=>e+1),[]),onFocusableItemRemove:t.useCallback(()=>D(e=>e-1),[]),children:(0,o.jsx)(y.Primitive.div,{tabIndex:A||0===I?-1:0,"data-orientation":s,...g,ref:x,style:{outline:"none",...e.style},onMouseDown:(0,n.composeEventHandlers)(e.onMouseDown,()=>{M.current=!0}),onFocus:(0,n.composeEventHandlers)(e.onFocus,e=>{let t=!M.current;if(e.target===e.currentTarget&&t&&!A){let t=new CustomEvent(F,B);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=R().filter(e=>e.focusable);q([e.find(e=>e.active),e.find(e=>e.id===v),...e].filter(Boolean).map(e=>e.ref.current),h)}}M.current=!1}),onBlur:(0,n.composeEventHandlers)(e.onBlur,()=>N(!1))})})},"RovingFocusGroupImpl")),J=t.forwardRef(O(function(e,r){let{__scopeRovingFocusGroup:i,focusable:a=!0,active:s=!1,tabStopId:l,children:c,...d}=e,u=(0,v.useId)(),f=l||u,p=V("RovingFocusGroupItem",i),h=p.currentTabStopId===f,g=H(i),{onFocusableItemAdd:m,onFocusableItemRemove:x,currentTabStopId:b}=p,j=L();return(0,N.useLayoutEffect)(()=>{if(j&&a)return m(),()=>x()},[j,a,m,x]),t.useEffect(()=>{if(!j&&a)return m(),()=>x()},[j,a,m,x]),(0,o.jsx)(K.ItemSlot,{scope:i,id:f,focusable:a,active:s,children:(0,o.jsx)(y.Primitive.span,{tabIndex:h?0:-1,"data-orientation":p.orientation,...d,ref:r,onMouseDown:(0,n.composeEventHandlers)(e.onMouseDown,e=>{a?p.onItemFocus(f):e.preventDefault()}),onFocus:(0,n.composeEventHandlers)(e.onFocus,()=>p.onItemFocus(f)),onKeyDown:(0,n.composeEventHandlers)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=Q(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=g().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)n.reverse();else if("prev"===t||"next"===t){"prev"===t&&n.reverse();let r=n.indexOf(e.currentTarget);n=p.loop?ee(n,r+1):n.slice(r+1)}setTimeout(()=>q(n))}}),children:"function"==typeof c?c({isCurrentTabStop:h,hasTabStop:null!=b}):c})})},"RovingFocusGroupItem")),Y={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function X(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}function Q(e,t,n){let r=X(e.key,n);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(r))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)))return Y[r]}function q(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function ee(e,t){return e.map((n,r)=>e[(t+r)%e.length])}O(X,"getDirectionAwareKey"),O(Q,"getFocusIntent"),O(q,"focusFirst"),O(ee,"wrapArray"),e.s(["Item",0,J,"Root",0,W,"createRovingFocusGroupScope",0,_],84606)},41071,e=>{"use strict";let t=(0,e.i(75254).default)("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);e.s(["MoreHorizontal",0,t],41071)},83086,e=>{"use strict";let t=(0,e.i(75254).default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);e.s(["Sparkles",0,t],83086)},22016,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0});var r={default:function(){return x},useLinkStatus:function(){return v}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});let a=e.r(90809),o=e.r(43476),s=a._(e.r(71645)),l=e.r(95057),c=e.r(8372),d=e.r(18581),u=e.r(18967),f=e.r(5550),p=e.r(88540),h=e.r(91949),g=e.r(73668),m=e.r(9396);function x(t){var n;let r,i,a,[x,v]=(0,s.useOptimistic)(h.IDLE_LINK_STATUS),y=(0,s.useRef)(null),{href:j,as:C,children:w,prefetch:A=null,passHref:S,replace:N,shallow:k,scroll:R,onClick:M,onMouseEnter:I,onTouchStart:D,legacyBehavior:T=!1,onNavigate:P,transitionTypes:L,ref:E,unstable_dynamicOnHover:O,...F}=t;r=w,T&&("string"==typeof r||"number"==typeof r)&&(r=(0,o.jsx)("a",{children:r}));let B=s.default.useContext(c.AppRouterContext),U=!1!==A,K=!1===A?"none":!0===A?"full":"auto",H="none"!==K?"auto"===K?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,G="string"==typeof(n=C||j)?n:(0,l.formatUrl)(n);if(T){if(r?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});i=s.default.Children.only(r)}let $=T?i&&"object"==typeof i&&i.ref:E,_,z=s.default.useCallback(e=>(null!==B&&(y.current=(0,h.mountLinkInstance)(e,G,B,H,U,v,_)),()=>{y.current&&((0,h.unmountLinkForCurrentNavigation)(y.current),y.current=null),(0,h.unmountPrefetchableInstance)(e)}),[U,G,B,H,v,_]),V={ref:(0,d.useMergedRef)(z,$),onClick(t){T||"function"!=typeof M||M(t),T&&i.props&&"function"==typeof i.props.onClick&&i.props.onClick(t),!B||t.defaultPrevented||function(t,n,r,i,a,o,l,c="none"){if("u">typeof window){let d,{nodeName:u}=t.currentTarget;if("A"===u.toUpperCase()&&((d=t.currentTarget.getAttribute("target"))&&"_self"!==d||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,g.isLocalURL)(n)){i&&(t.preventDefault(),location.replace(n));return}if(t.preventDefault(),o){let e=!1;if(o({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:f}=e.r(99781);s.default.startTransition(()=>{f(n,i?"replace":"push",!1===a?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,r.current,l,c)})}}(t,G,y,N,R,P,L,K)},onMouseEnter(e){T||"function"!=typeof I||I(e),T&&i.props&&"function"==typeof i.props.onMouseEnter&&i.props.onMouseEnter(e),B&&U&&(0,h.onNavigationIntent)(e.currentTarget,!0===O)},onTouchStart:function(e){T||"function"!=typeof D||D(e),T&&i.props&&"function"==typeof i.props.onTouchStart&&i.props.onTouchStart(e),B&&U&&(0,h.onNavigationIntent)(e.currentTarget,!0===O)}};return(0,u.isAbsoluteUrl)(G)?V.href=G:T&&!S&&("a"!==i.type||"href"in i.props)||(V.href=(0,f.addBasePath)(G)),a=T?s.default.cloneElement(i,V):(0,o.jsx)("a",{...F,...V,children:r}),(0,o.jsx)(b.Provider,{value:x,children:a})}let b=(0,s.createContext)(h.IDLE_LINK_STATUS),v=()=>(0,s.useContext)(b);("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},73668,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"isLocalURL",{enumerable:!0,get:function(){return a}});let r=e.r(18967),i=e.r(52817);function a(e){if(!(0,r.isAbsoluteUrl)(e))return!0;try{let t=(0,r.getLocationOrigin)(),n=new URL(e,t);return n.origin===t&&(0,i.hasBasePath)(n.pathname)}catch(e){return!1}}},98183,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={assign:function(){return l},searchParamsToUrlQuery:function(){return a},urlQueryToSearchParams:function(){return s}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});function a(e){let t={};for(let[n,r]of e.entries()){let e=t[n];void 0===e?t[n]=r:Array.isArray(e)?e.push(r):t[n]=[e,r]}return t}function o(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function s(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(Array.isArray(r))for(let e of r)t.append(n,o(e));else t.set(n,o(r));return t}function l(e,...t){for(let n of t){for(let t of n.keys())e.delete(t);for(let[t,r]of n.entries())e.append(t,r)}return e}},95057,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0});var r={formatUrl:function(){return s},formatWithValidation:function(){return c},urlObjectKeys:function(){return l}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});let a=e.r(90809)._(e.r(98183)),o=/https?|ftp|gopher|file/;function s(e){let{auth:t,hostname:n}=e,r=e.protocol||"",i=e.pathname||"",s=e.hash||"",l=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:n&&(c=t+(~n.indexOf(":")?`[${n}]`:n),e.port&&(c+=":"+e.port)),l&&"object"==typeof l&&(l=String(a.urlQueryToSearchParams(l)));let d=e.search||l&&`?${l}`||"";return r&&!r.endsWith(":")&&(r+=":"),e.slashes||(!r||o.test(r))&&!1!==c?(c="//"+(c||""),i&&"/"!==i[0]&&(i="/"+i)):c||(c=""),s&&"#"!==s[0]&&(s="#"+s),d&&"?"!==d[0]&&(d="?"+d),i=i.replace(/[?#]/g,encodeURIComponent),d=d.replace("#","%23"),`${r}${c}${i}${d}${s}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return s(e)}},18967,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0});var r={DecodeError:function(){return x},MiddlewareNotFoundError:function(){return j},MissingStaticPage:function(){return y},NormalizeError:function(){return b},PageNotFoundError:function(){return v},SP:function(){return g},ST:function(){return m},WEB_VITALS:function(){return a},execOnce:function(){return o},getDisplayName:function(){return u},getLocationOrigin:function(){return c},getURL:function(){return d},isAbsoluteUrl:function(){return l},isResSent:function(){return f},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return C}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});let a=["CLS","FCP","FID","INP","LCP","TTFB"];function o(e){let t,n=!1;return(...r)=>(n||(n=!0,t=e(...r)),t)}let s=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>{let t=e.charCodeAt(0);return!!(t>=65&&t=97&&ttypeof performance,m=g&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class x extends Error{}class b extends Error{}class v extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class y extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class j extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function C(e){return JSON.stringify({message:e.message,stack:e.stack})}},62876,57005,90230,e=>{"use strict";let t;var n=e.i(56669),r=e.i(77620),i=e.i(30929),a=e.i(2052);let o={DL:"Delta",AA:"American",UA:"United",AS:"Alaska",WN:"Southwest",B6:"JetBlue",NK:"Spirit",F9:"Frontier",HA:"Hawaiian",MQ:"Envoy",OO:"SkyWest",YX:"Republic",OH:"PSA","9E":"Endeavor"},s={DL:"Delta Air Lines",AA:"American Airlines",UA:"United Airlines",AS:"Alaska Airlines",WN:"Southwest Airlines",B6:"JetBlue Airways",NK:"Spirit Airlines",F9:"Frontier Airlines",HA:"Hawaiian Airlines",G4:"Allegiant Air",SY:"Sun Country Airlines",MX:"Breeze Airways",AC:"Air Canada",WS:"WestJet",AM:"Aeroméxico",BA:"British Airways",VS:"Virgin Atlantic",LH:"Lufthansa",AF:"Air France",KL:"KLM Royal Dutch Airlines",EI:"Aer Lingus",IB:"Iberia",LX:"Swiss",TK:"Turkish Airlines",EK:"Emirates",QR:"Qatar Airways",EY:"Etihad Airways",NH:"ANA All Nippon Airways",JL:"Japan Airlines",CX:"Cathay Pacific",SQ:"Singapore Airlines",KE:"Korean Air",QF:"Qantas",NZ:"Air New Zealand",LA:"LATAM Airlines",AV:"Avianca",CM:"Copa Airlines",MQ:"Envoy Air",OO:"SkyWest Airlines",YX:"Republic Airways",OH:"PSA Airlines","9E":"Endeavor Air",QX:"Horizon Air"},l=e=>e.normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase();function c(e){let t=l(e.trim());return t?Object.entries(s).map(([e,n])=>{let r=l(n),i=e.toLowerCase()===t?0:r.startsWith(t)?1:(" "+r).includes(" "+t)?2:-1;return{iata:e,name:n,short:o[e]??n,rank:i}}).filter(e=>e.rank>=0).sort((e,t)=>e.rank-t.rank||e.name.localeCompare(t.name)).slice(0,6):[]}let d=new Set(Object.values(s).flatMap(e=>l(e).split(" ")));try{t=RegExp("^[\\p{L} .'-]{2,}$","u")}catch{t=/^[A-Za-zÀ-ÖØ-öø-ÿ .'-]{2,}$/}let u=e=>/^[A-Z]{3}$/.test(e)?e:"",f=null;function p(e){let t=(0,n.getAirportByIata)(e)?.rank;return void 0!==t?{size:0,rank:t}:{size:(f??=new Set("AAC|AAE|AAL|AAN|AAR|ABA|ABB|ABD|ABJ|ABQ|ABV|ABZ|ACA|ACC|ACE|ADB|ADD|ADE|ADJ|ADL|ADZ|AEP|AER|AES|AEY|AGA|AGP|AGT|AGU|AHB|AJF|AKL|AKX|ALA|ALB|ALC|ALG|ALP|AMD|AMM|AMQ|AMS|ANC|ANF|ANU|AOE|AOJ|APL|APW|AQI|AQJ|AQP|ARN|ASB|ASF|ASR|ASU|ASW|ATH|ATL|ATQ|ATZ|AUA|AUH|AUS|AVV|AWA|AWZ|AYT|BAH|BAQ|BAV|BAX|BBI|BBK|BBU|BCD|BCM|BCN|BCU|BDA|BDJ|BDL|BDQ|BDS|BEG|BEL|BEM|BEN|BER|BES|BEW|BEY|BFN|BFS|BGF|BGI|BGO|BGW|BGY|BHK|BHM|BHO|BHX|BIA|BIO|BJA|BJL|BJM|BJV|BJX|BKI|BKK|BKO|BLA|BLJ|BLL|BLQ|BLR|BLZ|BME|BNA|BND|BNE|BNX|BOD|BOG|BOI|BOJ|BOM|BON|BOO|BOS|BOY|BPN|BPS|BQT|BRC|BRE|BRI|BRM|BRS|BRU|BSA|BSB|BSG|BSK|BSL|BSR|BSZ|BTH|BTJ|BTS|BUD|BUF|BUQ|BUR|BUS|BVA|BVB|BVC|BWA|BWI|BWN|BXY|BZE|BZV|CAG|CAI|CAN|CAP|CAY|CBB|CCJ|CCK|CCP|CCS|CCU|CDG|CEB|CEI|CEK|CFE|CFK|CFU|CGB|CGH|CGK|CGN|CGO|CGP|CGQ|CGY|CHC|CHQ|CHS|CIA|CIT|CIX|CJB|CJJ|CJS|CJU|CKG|CKY|CLE|CLJ|CLO|CLT|CMB|CMH|CMN|CMW|CND|CNF|CNN|CNS|CNX|COK|COO|COR|COS|COV|CPH|CPT|CRA|CRD|CRK|CRL|CRZ|CSX|CTA|CTG|CTS|CTU|CUL|CUN|CUR|CUU|CUZ|CVG|CWB|CWL|CXI|CXR|CZL|CZM|DAC|DAD|DAL|DAM|DAR|DAT|DBB|DBV|DCA|DEB|DEL|DEN|DFW|DIL|DIR|DJE|DJG|DJJ|DJT|DLA|DLC|DLM|DMB|DME|DMK|DMM|DNH|DOH|DPS|DQM|DRP|DRS|DRW|DSM|DSN|DSS|DSY|DTM|DTW|DUB|DUR|DUS|DVO|DWC|DXB|DXN|DYG|DYU|DZA|DZN|EBB|EBL|ECN|EDI|EDL|EDO|EFL|EHU|EIN|EIS|ELP|ELQ|ELS|EMA|ENO|ENU|ERF|ESB|ESM|ETM|EUN|EVE|EVN|EWR|EZE|FAE|FAO|FAT|FBM|FCO|FDF|FDH|FEZ|FIH|FJR|FKB|FKI|FLL|FLN|FLR|FMM|FMO|FNA|FNC|FNJ|FOC|FOR|FPO|FRA|FRW|FSC|FSZ|FUE|FUK|GAN|GAU|GBE|GCM|GDL|GDN|GEG|GEO|GES|GHV|GIB|GIG|GJL|GLA|GMP|GND|GNJ|GNY|GOA|GOH|GOI|GOJ|GOM|GOT|GOU|GOX|GRJ|GRO|GRQ|GRR|GRU|GRV|GRZ|GSM|GSO|GSV|GUA|GUM|GUW|GVA|GWD|GXF|GYD|GYE|GYN|GZT|HAJ|HAK|HAM|HAN|HAQ|HAS|HAV|HBA|HBE|HDY|HEA|HEL|HER|HET|HFE|HGA|HGH|HHN|HIA|HIJ|HIR|HKD|HKG|HKT|HLA|HLD|HLP|HMB|HMO|HND|HNL|HOF|HOG|HOU|HPH|HRB|HRE|HRG|HSA|HSG|HSN|HSR|HSS|HTA|HUI|HUN|HUX|HWR|HYD|IAD|IAH|IAR|IAS|IBR|IBZ|ICN|IDR|IFN|IGU|IKA|IKT|IKU|ILO|ILR|IMF|INC|IND|INI|INN|IOM|IPC|IPH|IQQ|IQT|ISB|ISK|IST|ITM|IVL|IXB|IXC|IXE|IXZ|JAF|JAI|JAV|JAX|JCL|JED|JFK|JGN|JHB|JHG|JIB|JIJ|JJN|JNB|JPA|JRO|JTR|JUB|JUJ|JUL|KAD|KAN|KBL|KBV|KCH|KCZ|KDH|KDU|KEF|KEJ|KER|KGD|KGF|KGL|KGS|KHG|KHH|KHI|KHN|KIH|KIJ|KIK|KIM|KIN|KIS|KIX|KJA|KKJ|KLO|KLU|KLV|KMG|KMI|KMJ|KMQ|KMS|KNO|KOA|KOJ|KOS|KOV|KQT|KRK|KRN|KRR|KRS|KRT|KSA|KSF|KSN|KTI|KTM|KTT|KTW|KUF|KUL|KUN|KUO|KUT|KVA|KWE|KWI|KWL|KYA|KZN|KZO|LAE|LAO|LAQ|LAS|LAX|LBA|LBD|LBV|LCA|LCJ|LED|LEJ|LFW|LGA|LGB|LGK|LGW|LHE|LHR|LHW|LIH|LIL|LIM|LIN|LIR|LIS|LJG|LJU|LKO|LLA|LLW|LNZ|LOP|LOS|LPA|LPB|LPI|LPL|LPP|LPQ|LRM|LTN|LTO|LUN|LUX|LUZ|LVI|LWN|LXA|LXR|LYA|LYG|LYP|LYS|MAA|MAD|MAH|MAJ|MAN|MAO|MAR|MBA|MBJ|MCI|MCO|MCT|MCX|MCY|MCZ|MDC|MDE|MDL|MDW|MDZ|MED|MEL|MEM|MEX|MFM|MFU|MGA|MGQ|MHD|MIA|MID|MIU|MJI|MJN|MKE|MLA|MLE|MLM|MMK|MMX|MNI|MNL|MPL|MPM|MQF|MQP|MRS|MRU|MRV|MSP|MSQ|MST|MSU|MSY|MTY|MUB|MUC|MUH|MUX|MVD|MWX|MWZ|MXP|MYJ|MYR|MZG|MZR|MZT|NAG|NAJ|NAN|NAP|NAS|NAT|NAV|NBJ|NBO|NCE|NCL|NCU|NDB|NDG|NDJ|NDR|NGB|NGO|NGS|NIM|NJC|NJF|NKC|NKG|NLA|NLU|NMA|NMI|NNG|NOC|NOS|NOU|NQN|NQZ|NRN|NRT|NSI|NSK|NTE|NTL|NUE|NUM|NVT|NYO|NYT|OAK|OAX|OCS|ODE|OEC|OGG|OHD|OHS|OKA|OKC|OKJ|OLB|OMA|OMO|OMR|OMS|ONT|OOL|OPO|ORD|ORF|ORK|ORN|ORU|ORY|OSL|OSR|OSS|OST|OTP|OUA|OUD|OUL|OVB|OVD|OXB|OZG|OZZ|PAD|PAP|PBC|PBH|PBM|PCL|PDG|PDL|PDV|PDX|PED|PEE|PEG|PEK|PEN|PER|PEV|PEW|PFO|PHC|PHE|PHH|PHL|PHX|PIE|PIK|PIT|PKC|PKX|PKZ|PLQ|PLS|PLX|PLZ|PMC|PMI|PMO|PMV|PNK|PNQ|PNR|PNS|POA|POG|POM|POS|POZ|PPG|PPK|PPS|PPT|PQC|PRG|PRN|PSA|PSD|PSP|PSR|PTG|PTP|PTY|PUJ|PUQ|PUS|PUY|PVD|PVG|PVH|PVR|PWM|PWQ|PYK|PZO|PZU|QRO|RAI|RAK|RAR|RBA|RBR|RDU|REC|RES|REU|RGL|RGN|RHO|RIC|RIX|RIY|RJK|RKT|RKZ|RMF|RMI|RML|RMO|RMQ|RMU|RNO|ROB|ROC|ROP|ROR|ROS|RSI|RSW|RTB|RTM|RUH|RUN|RVN|RZE|SAG|SAH|SAI|SAL|SAN|SAP|SAT|SAV|SAW|SBD|SBZ|SCL|SCO|SCQ|SCR|SCU|SCV|SDF|SDJ|SDQ|SDU|SEA|SEZ|SFB|SFO|SFS|SGC|SGN|SHA|SHE|SHJ|SHO|SID|SIN|SJC|SJD|SJJ|SJO|SJU|SJW|SKB|SKD|SKG|SKO|SKP|SKT|SKX|SLA|SLC|SLL|SLZ|SMF|SNA|SNC|SNN|SNU|SOC|SOF|SPU|SPX|SRE|SRG|SRQ|SSA|SSG|SSH|STI|STL|STN|STR|STT|STV|SUB|SUF|SUI|SUV|SVD|SVG|SVO|SVQ|SVX|SWA|SXB|SXM|SXR|SYD|SYR|SYX|SYZ|SZB|SZG|SZX|SZZ|TAB|TAE|TAG|TAK|TAO|TAS|TAZ|TBS|TBU|TBZ|TET|TFN|TFS|TFU|TGD|THR|TIA|TIF|TIJ|TIR|TJM|TJU|TKK|TKS|TKU|TLC|TLL|TLM|TLS|TLV|TML|TMM|TMP|TMR|TMS|TNA|TNG|TNN|TNR|TOF|TOM|TOS|TPA|TPE|TQO|TRD|TRF|TRN|TRS|TRU|TRV|TRW|TRZ|TSA|TSF|TSN|TSR|TTU|TUC|TUK|TUL|TUN|TUS|TUU|TXN|TYN|TYS|TZL|UBN|UET|UFA|UGC|UIO|UKB|UKK|ULH|UME|UPG|URA|URC|USM|UTH|UTP|UUD|UUS|UVF|UYU|VAA|VAR|VAV|VBY|VCA|VCE|VCP|VER|VFA|VGA|VIE|VIL|VIX|VKO|VLC|VLI|VLN|VNO|VNS|VOG|VRA|VRN|VSA|VST|VTE|VTZ|VVI|VVO|VXE|WAW|WDH|WLG|WLS|WMI|WNZ|WRO|WSI|WTB|WUH|WUX|WVB|XBJ|XIY|XMN|XNN|XPL|YAP|YCU|YEG|YHM|YHZ|YIA|YIW|YKS|YLW|YNB|YNT|YNY|YNZ|YOW|YQB|YQG|YUL|YVR|YWG|YXE|YYC|YYJ|YYT|YYZ|ZAD|ZAG|ZAH|ZAM|ZAZ|ZCO|ZHA|ZIA|ZIH|ZNZ|ZQN|ZRH|ZSA|ZSE|ZTH|ZUH|ZYL".split("|"))).has(e)?1:(0,r.airportCoords)(e)?2:3,rank:0}}let h=(e,t)=>e.size-t.size||e.rank-t.rank,g=e=>l(e).replace(/\s*\(.*$/,"").split(/[,/]/)[0].trim(),m=(e,t)=>(0,i.greatCircleDistanceMeters)(e,t)/1609.344,x=e=>Math.min(e.size,2);function b(e,t){let n=l(e.trim());if(!n)return!1;let r=p(n.toUpperCase());return t.some(e=>e.city.startsWith(n+" ")&&0>h(e.size,r))}let v=/^([a-z0-9]{2})(\s*)(\d{0,4})$/i;function y(e){let t=e.match(v);if(!t||!t[2]&&!t[3])return null;let n=c(t[1])[0];return n?.rank===0?{airline:n,rest:t[3]}:null}function j(e){let t=e.trim().toUpperCase().replace(/\s+TO\s+/," "),n=t.match(/^([A-Z0-9]{2})\s?(\d{1,4})$/);if(n)return{kind:"flight",ident:n[1]+n[2]};if(n=t.match(/^(.*[A-Z].*?)\s+(\d{1,4})$/)){let e=c(n[1])[0];if(e&&e.rank→/]+([A-Z]{3})$/))&&n[1]!==n[2]?{kind:"route",from:n[1],to:n[2]}:(n=t.match(/^([A-Z]{3})$/))?{kind:"airport",code:n[1]}:{kind:"none"}}let C=e=>String(e).padStart(2,"0"),w=e=>`${e.getFullYear()}-${C(e.getMonth()+1)}-${C(e.getDate())}`,A=(e,t=new Date)=>{let n=new Date(t);return n.setDate(n.getDate()+e),w(n)},S=(e,t)=>!!t&&1===e.length&&e[0]===t,N=(e,t,n)=>"airport"===e.kind&&!!t&&t!==n,k=e=>e-1728e5;e.s(["MAX_DAYS_AHEAD",0,330,"MIN_PLACE_TEXT",0,3,"POPULAR_AIRLINES",0,["DL","AA","UA","WN","B6","AS"],"TRACK_LEAD_DAYS",0,2,"addFlightPrompt",0,function(e,t){switch(e){case"number":return t?`Enter the ${t} flight number`:"Enter the flight number";case"day":return"Which day is the flight?";case"to":return"Where is it going?";case"searching":return"Finding flights…";case"pick":return"Pick your flight.";default:return null}},"addFlightQuery",0,function({q:e,airline:t,from:n,to:r,airports:i,connectCode:a=null}){let o=e.trim();return t&&/^\d{1,4}$/.test(o)?t.iata+o:t&&!o&&u(n)?u(r)?`${n} ${r}`:n:S(i,a)&&"flight"===j(o).kind?o:[...i,o].filter(Boolean).join(" ")},"addFlightStep",0,function({query:e,date:t,today:n,airline:r,busy:i,found:a,failed:o}){return"none"===e.kind?r?"number":"start":t?N(e,t,n)?"to":i||null===a&&!o?"searching":o||0===a?"none-found":"pick":"day"},"afterLocked",0,function(e,t){let n=e.match(RegExp(`^(?:to\\s+)?${t}\\s+`,"i"));return n?e.slice(n[0].length):null},"airlineLock",0,function(e,t){let n=y(e);return!n||!n.rest&&(!t||b(n.airline.iata,t))?null:n},"airlineLockCandidate",0,y,"airportFirst",0,function(e,t,n){let r=e.trim().toUpperCase();return/^[A-Z]{3}$/.test(r)&&n[0]?.iata===r&&t.every(e=>e.rank>0)},"connectionDate",0,(e,t=new Date)=>{let n=e.snapshot?.destination.timezone,r=e.scheduledDate;if(e.scheduledArrivalAt&&n)try{r=(0,a.localDateStr)(e.scheduledArrivalAt,n)}catch{}let i=w(t);return r>i?r:i},"dateChips",0,(e=new Date)=>[0,1].map(t=>({ymd:A(t,e),label:0===t?"Today":"Tomorrow"})),"findAirlines",0,c,"findPlaceAirports",0,function(e,t){let n=l(e.trim());if(n.length{let t=e.cityKey===n?0:e.city.startsWith(n)?1:e.cityWords.includes(" "+n)?2:e.nameWords.includes(" "+n)?3:null;return null===t?[]:[{e,match:t}]}).sort((e,t)=>Math.max(e.match,1)-Math.max(t.match,1)||h(e.e.size,t.e.size)).map(e=>e.e),i=b(e,t)?void 0:t.find(e=>e.codes.includes(n));i&&r.unshift(i);let a=r[0];if(!a)return[];let o=new Set(t.filter(e=>e===a||!!a.cityKey&&e.cityKey===a.cityKey&&e.place.country===a.place.country&&60>=m(e.at,a.at))),s=[...o],c=[s.reduce((e,t)=>e+t.at[0],0)/s.length,s.reduce((e,t)=>e+t.at[1],0)/s.length],d=t.filter(e=>e!==a).map(e=>({e,own:o.has(e),miles:m(c,e.at)})).filter(e=>e.own||e.milesx(e.e.size)-x(t.e.size)||Number(t.own)-Number(e.own)||e.miles-t.miles),u=new Set([a,...d.map(e=>e.e)]);return[{...a.place,miles:null},...d.map(e=>({...e.e.place,miles:e.own?null:Math.round(e.miles)})),...r.filter(e=>!u.has(e)).map(e=>({...e.place,miles:null}))].slice(0,6)},"isNameText",0,e=>t.test(e),"isPlaceWord",0,b,"lockCandidate",0,function(e,t){let n;if(t.airline||t.airports.length>=2)return null;let r=t.airports.length?/^(?:to\s+)?([a-z]{3})\s$/i:/^([a-z]{3})\s$/i,i=e.match(r)?.[1]?.toUpperCase();return!i||t.airports.includes(i)||(n=l(i.trim()))&&d.has(n)?null:i},"needsDestination",0,N,"onlyConnectPill",0,S,"parseQuery",0,j,"placeIndex",0,function(e){let t=new Set,n=[];for(let i of e){let e=(0,r.airportCoords)(i.iata);if(!e||t.has(i.iata))continue;t.add(i.iata);let a=l(i.city);n.push({place:i,at:e,size:p(i.iata),city:a,cityKey:g(i.city),codes:[l(i.iata),...i.icao?[l(i.icao)]:[]],cityWords:" "+a,nameWords:" "+l(i.name)})}return n},"trackableFrom",0,k,"upper3",0,e=>e.toUpperCase().replace(/[^A-Z]/g,"").slice(0,3),"ymdIn",0,A],62876);let R=e=>e.iata??e.icao,M=e=>e.iata??e.icao,I=[400,404],D=e=>"http"===e.reason&&I.includes(e.status),T=e=>({ok:!0,data:e}),P=(e,t,n)=>`${e}|${t}|${n}`;e.s(["SEARCH_DEBOUNCE_MS",0,350,"connectionResults",0,(e,t)=>e.filter(e=>{let n=Date.parse(e.scheduledOut);return R(e.origin)===t.airport&&n>=t.from&&n!e.past).map(e=>{let t,r,i;return r=(t=e.delay)&&"none"!==t.level&&"unknown"!==t.level?Math.max(t.departureMinutes??0,t.arrivalMinutes??0):0,i=e.times.gateIn.scheduled,{key:e.id,id:e.id,ident:e.ident,origin:e.origin,destination:e.destination,departureDate:n,scheduledOut:e.scheduledDepartureAt,scheduledIn:i,out:e.times.gateOut.best??e.scheduledDepartureAt,in:e.times.gateIn.best??i,aircraftType:e.aircraftType,lateMinutes:r,live:"live"===e.resolution}})):D(r)?T([]):r}let l="route"===t.kind?t.from:t.code,c="route"===t.kind?t.to:null,[d,u]=await Promise.all([e.icaoOf(l),c?e.icaoOf(c):null]);if(!d||c&&!u)return T([]);let f=await e.dayDepartures(d,n,u??void 0);return f.ok?T((o=f.data.flights.filter(e=>{if(r&&![e.ident,e.operating,...e.codeshares].some(e=>e?.airline.iata===r))return!1;if(!i)return!0;let t=Date.parse(e.scheduledDepartureAt);return t>=i.from&&tDate.parse(e.scheduledArrivalAt??e.scheduledDepartureAt)+36e5>a).slice(0,s)).map(e=>(function(e,t){let{icao:n,iata:r,timezone:i}=t.origin;return{key:e.id??`${e.ident.icao}@${e.scheduledDepartureAt}`,id:e.id,ident:e.ident,origin:{icao:n,iata:r,timezone:i},destination:{icao:e.destination.icao,iata:e.destination.iata,timezone:e.destination.timezone},departureDate:t.departureDate,scheduledOut:e.scheduledDepartureAt,scheduledIn:e.scheduledArrivalAt,out:e.scheduledDepartureAt,in:e.scheduledArrivalAt,aircraftType:e.aircraftType,lateMinutes:0,live:!1}})(e,f.data))):D(f)?T([]):f}},"displayCode",0,R,"displayIdent",0,M,"legStub",0,function(e,t,n){return{id:t,identIata:M(e.ident),identIcao:e.ident.icao,faFlightId:null,flightId:e.id,scheduledDate:e.departureDate,originIata:R(e.origin),destinationIata:R(e.destination),scheduledDepartureAt:e.scheduledOut,scheduledArrivalAt:e.scheduledIn,snapshot:null,dataSource:"schedule",addedAt:n}},"loadsOnTrack",0,(e,t=Date.now())=>!!e.id&&k(Date.parse(e.scheduledOut))(e.id?t.get(e.id):void 0)??n.get(P(M(e.ident),R(e.origin),e.departureDate))??null}],57005);var L=e.i(81614),E=e.i(36966);e.s(["impactNoteAt",0,function(e,t,n){let r=(0,L.hourIndexAt)(e,t),i=null==r?null:e[r];if(!i||"unknown"===i.level)return null;let a=i.hazards[0],o="minimal"===i.level?`Clear at ${n}`:a?`${E.HAZARD_KIND_PRESENTATION[a].label} at ${n}`:`Weather at ${n}`;return{level:i.level,text:o}}],90230)},72928,e=>{"use strict";var t=e.i(77620),n=e.i(29517),r=e.i(58785);e.s(["countLegs",0,function(e){return e.reduce((e,t)=>e+t.legs.length,0)},"pastFlightsLabel",0,function(e,t){return 0===e?"Past flights":"visible"===t?`Past flights \xb7 ${e}`:`Past flights, ${e}`},"pastTotals",0,function(e){let i=0,a=0,o=0,s=0,l=!1,c=0,d=!1;for(let u of e)for(let e of u.legs){i+=1;let u=e.snapshot;if(!u){let r=(0,t.airportCoords)(e.originIata),i=(0,t.airportCoords)(e.destinationIata),a=r&&i?(0,n.greatCircleMiles)(r,i):0;a>0&&(s+=a,l=!0);continue}if(u.cancelled||"cancelled"===u.status)continue;let f=u.delay.arrivalLevel;"unknown"!==f&&null!=u.delay.arrivalMinutes&&(a+=1,"none"===f&&(o+=1));let p=null!=u.routeDistanceNm?u.routeDistanceNm*r.MI_PER_NM:(0,n.greatCircleMiles)([u.origin.position.lon,u.origin.position.lat],[u.destination.position.lon,u.destination.position.lat]);p>0&&(s+=p,l=!0);let{takeoff:h,landing:g}=u.times,m=h.actual&&g.actual?(Date.parse(g.actual)-Date.parse(h.actual))/6e4:0;m>0&&(c+=m,d=!0)}return{flights:i,judged:a,onTime:o,onTimePct:a>0?Math.round(o/a*100):null,miles:l?Math.round(s):null,airMinutes:d?Math.round(c):null}}])},98041,e=>{"use strict";let t={inMs:550,outMs:320,riseY:18,fromScale:.96,swipeX:90,throwX:1.2,swipeUp:40,throwUp:140,fadePx:260,maxFade:.6,tapSlop:4};e.s(["LONG_PRESS_MS",0,700,"LONG_PRESS_SLOP",0,10,"TOAST_MOTION",0,t,"toastAwayOffset",0,function(e,n,r,i){let a="right"===e?1:"left"===e?-1:0;return{x:a?a*t.throwX*i:n,y:("up"===e?-t.throwUp:r)-t.riseY}},"toastDrag",0,function(e,t){return{x:e,y:Math.min(0,t)}},"toastDragOpacity",0,function(e){return 1-Math.min(t.maxFade,Math.abs(e)/t.fadePx)},"toastSwipe",0,function(e,n){return Math.abs(e)>t.swipeX?e>0?"right":"left":n