@cloudparse/up-miniapps-sdk 0.2.5 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.browser.min.js +1 -1
- package/dist/index.browser.min.js.map +1 -1
- package/dist/index.cjs +15 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -3
- package/dist/index.d.ts +29 -3
- package/dist/index.js +15 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -853,7 +853,7 @@ Error generating stack: `+f.message+`
|
|
|
853
853
|
.no-scrollbar::-webkit-scrollbar {
|
|
854
854
|
display: none;
|
|
855
855
|
}
|
|
856
|
-
`}),(0,At.jsx)("div",{className:`absolute inset-0 bg-black/45 backdrop-blur-[1px] transition-opacity duration-300 z-30 ${gt}`,onClick:()=>u("closed")}),f==="left"?(0,At.jsxs)(At.Fragment,{children:[i==="closed"&&(0,At.jsx)(Oa,{className:"absolute top-4 left-4 z-40 w-12 h-12 rounded-full bg-zinc-950/80 backdrop-blur-md border border-white/10 shadow-lg flex items-center justify-center text-white active:scale-95 transition-all cursor-pointer hover:bg-zinc-900 hover:text-white p-0!",onClick:()=>u("full"),variant:"ghost",children:(0,At.jsxs)("svg",{fill:"none",height:"24",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:[(0,At.jsx)("line",{x1:"4",x2:"20",y1:"12",y2:"12"}),(0,At.jsx)("line",{x1:"4",x2:"20",y1:"6",y2:"6"}),(0,At.jsx)("line",{x1:"4",x2:"20",y1:"18",y2:"18"})]})}),(0,At.jsx)(DC,{onOpenChange:ut=>u(ut?"full":"closed"),open:i!=="closed",children:(0,At.jsxs)(rv,{className:"w-80 bg-zinc-950/85 backdrop-blur-md border-r border-y border-white/10 rounded-r-2xl shadow-2xl p-4 text-white flex flex-col h-full overflow-hidden",portal:!1,side:"left",children:[(0,At.jsx)(iv,{className:"pb-3 border-b border-white/10 mb-2 text-left",children:(0,At.jsx)(ov,{className:"text-sm font-bold tracking-wider text-zinc-400 uppercase",children:"Menu"})}),(0,At.jsx)("div",{className:"flex-1 overflow-y-auto no-scrollbar pr-2",onScroll:ve,ref:Pe,children:ye||(0,At.jsx)("div",{className:"flex flex-col gap-1.5",children:a.map(ut=>(0,At.jsxs)(Oa,{className:`flex items-center gap-3 w-full py-3 px-3.5 rounded-xl text-left cursor-pointer transition-all duration-150 justify-start hover:bg-white/5 hover:text-white active:bg-white/10 text-white ${ut.disabled?"opacity-45 cursor-not-allowed pointer-events-none":""}`,disabled:ut.disabled,onClick:()=>{ut.disabled||(ut.onPress(),u("closed"))},variant:"ghost",children:[(0,At.jsxs)("div",{className:"relative flex items-center justify-center w-8 h-8 rounded-lg bg-white/5 text-zinc-300",children:[ut.icon,ut.badge!==void 0&&(0,At.jsx)("span",{className:"absolute -top-1 -right-1 bg-cyan-500 text-black text-[9px] font-extrabold min-w-[15px] h-3.5 rounded-full flex items-center justify-center px-1 border border-zinc-950 shadow",children:ut.badge})]}),(0,At.jsx)("span",{className:"text-sm font-medium tracking-wide flex-1",children:ut.label})]},ut.id))})}),ue&&Z&&(0,At.jsx)(Oa,{className:"absolute bottom-6 right-6 z-50 flex items-center justify-center w-10 h-10 rounded-full bg-cyan-500 hover:bg-cyan-400 active:scale-95 text-black hover:text-black shadow-lg shadow-cyan-500/25 transition-all duration-200 cursor-pointer p-0!",onClick:()=>{Pe.current?.scrollTo({behavior:"smooth",top:0})},variant:"ghost",children:(0,At.jsx)("svg",{fill:"none",height:"20",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",viewBox:"0 0 24 24",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,At.jsx)("polyline",{points:"18 15 12 9 6 15"})})})]})})]}):(0,At.jsxs)("div",{className:`absolute w-full bg-zinc-950/85 backdrop-blur-md border border-white/10 rounded-t-2xl shadow-2xl flex flex-col z-40 select-none ${te?"transition-none":"transition-transform duration-300 ease-out"}`,ref:Le,style:{bottom:"0px",height:typeof Q=="number"?`${Q}px`:Q||"85%",marginBottom:i==="closed"?`${fe.bottom}px`:"0px",transform:Va(),transition:te?"none":"transform 300ms ease-out, margin-bottom 250ms ease-in-out"},children:[(0,At.jsx)("div",{className:"w-full h-8 flex flex-col items-center justify-center cursor-pointer hover:bg-white/5 rounded-t-2xl transition-colors border-b border-white/5",onClick:H,children:(0,At.jsx)("div",{className:"w-12 h-1 bg-white/25 rounded-full"})}),(0,At.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden px-4 pb-4 pt-2 transition-[margin-top] duration-250 ease-in-out relative",style:{marginTop:i==="closed"?`${fe.bottom}px`:"0px"},children:[(0,At.jsx)("div",{className:"flex-1 overflow-y-auto no-scrollbar",onScroll:ve,ref:Pe,style:{paddingBottom:i==="peek"?`${ga}px`:"0px"},children:ye||(0,At.jsx)("div",{className:"flex flex-col gap-1",children:a.map(ut=>(0,At.jsxs)(Oa,{className:`flex items-center gap-3 w-full py-3 px-3.5 rounded-xl text-left cursor-pointer transition-all duration-150 justify-start hover:bg-white/5 hover:text-white active:bg-white/10 text-white ${ut.disabled?"opacity-45 cursor-not-allowed pointer-events-none":""}`,disabled:ut.disabled,onClick:()=>{ut.disabled||(ut.onPress(),u("closed"))},variant:"ghost",children:[(0,At.jsxs)("div",{className:"relative flex items-center justify-center w-8 h-8 rounded-lg bg-white/5 text-zinc-300",children:[ut.icon,ut.badge!==void 0&&(0,At.jsx)("span",{className:"absolute -top-1 -right-1 bg-cyan-500 text-black text-[9px] font-extrabold min-w-[15px] h-3.5 rounded-full flex items-center justify-center px-1 border border-zinc-950 shadow",children:ut.badge})]}),(0,At.jsx)("span",{className:"text-sm font-medium tracking-wide",children:ut.label})]},ut.id))})}),ue&&Z&&(0,At.jsx)(Oa,{className:"absolute right-6 z-50 flex items-center justify-center w-10 h-10 rounded-full bg-cyan-500 hover:bg-cyan-400 active:scale-95 text-black hover:text-black shadow-lg shadow-cyan-500/25 transition-all duration-200 cursor-pointer p-0!",onClick:()=>{Pe.current?.scrollTo({behavior:"smooth",top:0})},style:{bottom:i==="peek"?`calc(${24+ga}px + var(--drag-offset, 0px))`:"calc(24px + var(--drag-offset, 0px))"},variant:"ghost",children:(0,At.jsx)("svg",{fill:"none",height:"20",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",viewBox:"0 0 24 24",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,At.jsx)("polyline",{points:"18 15 12 9 6 15"})})})]})]})]})});var uc=Ue(nt(),1),cc=Ue(Mt(),1),G0=uc.forwardRef(({className:a,...i},u)=>(0,cc.jsx)("div",{className:wi("rounded-lg border bg-card text-card-foreground shadow-sm",a),ref:u,...i}));G0.displayName="Card";var mD=uc.forwardRef(({className:a,...i},u)=>(0,cc.jsx)("div",{className:wi("flex flex-col space-y-1.5 p-6",a),ref:u,...i}));mD.displayName="CardHeader";var gD=uc.forwardRef(({className:a,...i},u)=>(0,cc.jsx)("div",{className:wi("text-2xl font-semibold leading-none tracking-tight",a),ref:u,...i}));gD.displayName="CardTitle";var yD=uc.forwardRef(({className:a,...i},u)=>(0,cc.jsx)("div",{className:wi("text-sm text-muted-foreground",a),ref:u,...i}));yD.displayName="CardDescription";var H0=uc.forwardRef(({className:a,...i},u)=>(0,cc.jsx)("div",{className:wi("p-6 pt-0",a),ref:u,...i}));H0.displayName="CardContent";var _D=uc.forwardRef(({className:a,...i},u)=>(0,cc.jsx)("div",{className:wi("flex items-center p-6 pt-0",a),ref:u,...i}));_D.displayName="CardFooter";var lt=Ue(Mt(),1),BC=({etaData:a,layoutMode:i,onHeaderClick:u,style:f,isDragging:m=!1})=>i==="closed-banner"?(0,lt.jsxs)("div",{className:"w-full h-10 flex items-center justify-between px-4 pb-2 pt-1 border-b border-white/5 bg-zinc-950/15 relative overflow-hidden",children:[(0,lt.jsxs)("div",{className:"flex items-center gap-2 cursor-pointer flex-1",onClick:u,children:[(0,lt.jsx)("span",{className:"w-2 h-2 rounded-full bg-emerald-500 animate-pulse"}),(0,lt.jsxs)("span",{className:"text-xs font-bold text-emerald-400",children:[a.etaMins," min (",a.distanceRemainingKm.toFixed(1)," km)"]})]}),a.onAbort&&(0,lt.jsx)(Oa,{className:"px-1 py-1 text-[10px] font-black bg-red-500/20 text-red-400 hover:bg-red-500/30 border border-red-500/25 active:scale-95 rounded-md transition-all cursor-pointer pointer-events-auto h-auto p-0!",onClick:s=>{s.stopPropagation(),a.onAbort?.()},variant:"ghost",children:(0,lt.jsxs)("svg",{className:"lucide lucide-x",fill:"none",height:"18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",viewBox:"0 0 24 24",width:"18",xmlns:"http://www.w3.org/2000/svg",children:[(0,lt.jsx)("path",{d:"M18 6 6 18"}),(0,lt.jsx)("path",{d:"m6 6 12 12"})]})}),a.progress!==void 0&&(0,lt.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-[2px] bg-white/5",children:(0,lt.jsx)("div",{className:"h-full bg-cyan-400",style:{width:`${a.progress}%`}})})]}):i==="open-card"?(0,lt.jsxs)(G0,{className:"mx-4 mt-2 p-4 bg-white/5 border border-white/10 rounded-xl flex flex-col text-card-foreground",children:[(0,lt.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,lt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,lt.jsx)("span",{className:"w-2 h-2 rounded-full bg-emerald-500 animate-pulse"}),(0,lt.jsx)("span",{className:"text-[10px] font-bold text-emerald-400 uppercase tracking-wider",children:a.label||"Journey Active"})]}),a.onAbort&&(0,lt.jsx)(Oa,{className:"px-1 py-1 text-xs font-bold bg-red-500/20 text-red-400 hover:bg-red-500/30 border border-red-500/30 active:scale-95 rounded-lg transition-all cursor-pointer pointer-events-auto h-auto p-0!",onClick:a.onAbort,variant:"ghost",children:(0,lt.jsxs)("svg",{className:"lucide lucide-x",fill:"none",height:"18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",viewBox:"0 0 24 24",width:"18",xmlns:"http://www.w3.org/2000/svg",children:[(0,lt.jsx)("path",{d:"M18 6 6 18"}),(0,lt.jsx)("path",{d:"m6 6 12 12"})]})})]}),(0,lt.jsxs)(H0,{className:"p-0 flex flex-col",children:[(0,lt.jsxs)("div",{className:"grid grid-cols-2 divide-x divide-white/10 py-1.5 mb-2.5",children:[(0,lt.jsxs)("div",{className:"text-center",children:[(0,lt.jsxs)("div",{className:"text-xl font-black text-white leading-none",children:[a.etaMins,(0,lt.jsx)("span",{className:"text-xs text-zinc-400 font-normal",children:" min"})]}),(0,lt.jsx)("div",{className:"text-[8px] text-zinc-500 font-bold uppercase tracking-wider mt-1",children:"Time Remaining"})]}),(0,lt.jsxs)("div",{className:"text-center",children:[(0,lt.jsxs)("div",{className:"text-xl font-black text-white leading-none",children:[a.distanceRemainingKm.toFixed(1),(0,lt.jsx)("span",{className:"text-xs text-zinc-400 font-normal",children:" km"})]}),(0,lt.jsx)("div",{className:"text-[8px] text-zinc-500 font-bold uppercase tracking-wider mt-1",children:"Distance Remaining"})]})]}),a.progress!==void 0&&(0,lt.jsxs)("div",{className:"mb-3",children:[(0,lt.jsxs)("div",{className:"flex justify-between text-[9px] font-bold text-zinc-400 mb-1",children:[(0,lt.jsx)("span",{children:"Progress"}),(0,lt.jsxs)("span",{children:[Math.round(a.progress),"%"]})]}),(0,lt.jsx)("div",{className:"h-1 bg-white/10 rounded-full overflow-hidden",children:(0,lt.jsx)("div",{className:"h-full bg-cyan-400 rounded-full",style:{width:`${a.progress}%`}})})]}),a.mode==="preview"&&a.onStart&&(0,lt.jsx)(Oa,{className:"w-full py-2.5 text-xs font-bold bg-cyan-500 text-black hover:bg-cyan-400 hover:text-black active:scale-95 rounded-lg transition-all cursor-pointer h-auto",onClick:a.onStart,variant:"ghost",children:"Start Guidance"})]})]}):(0,lt.jsxs)(G0,{className:`absolute left-1/2 -translate-x-1/2 z-40 w-[calc(100%-2rem)] max-w-[320px] sm:max-w-[380px] bg-zinc-950/85 backdrop-blur-md border border-white/10 rounded-2xl shadow-2xl p-3 sm:p-4 flex flex-col pointer-events-auto select-none text-card-foreground ${m?"transition-none":"transition-all duration-300 ease-out"}`,style:f,children:[(0,lt.jsxs)("div",{className:"flex items-center justify-between mb-2 sm:mb-3",children:[(0,lt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,lt.jsx)("span",{className:"w-1.5 h-1.5 sm:w-2 sm:h-2 rounded-full bg-emerald-500 animate-pulse"}),(0,lt.jsx)("span",{className:"text-[9px] sm:text-[10px] font-bold text-emerald-400 uppercase tracking-wider",children:a.label||"Guidance Active"})]}),a.onAbort&&(0,lt.jsx)(Oa,{className:"px-1 py-1 text-[10px] sm:text-xs font-bold bg-red-500/20 text-red-400 hover:bg-red-500/30 border border-red-500/30 active:scale-95 rounded-lg transition-all cursor-pointer h-auto p-0!",onClick:a.onAbort,variant:"ghost",children:(0,lt.jsxs)("svg",{className:"lucide lucide-x",fill:"none",height:"18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",viewBox:"0 0 24 24",width:"18",xmlns:"http://www.w3.org/2000/svg",children:[(0,lt.jsx)("path",{d:"M18 6 6 18"}),(0,lt.jsx)("path",{d:"m6 6 12 12"})]})})]}),(0,lt.jsxs)(H0,{className:"p-0 flex flex-col",children:[(0,lt.jsxs)("div",{className:"grid grid-cols-2 divide-x divide-white/10 py-0.5 sm:py-1 mb-2 sm:mb-3",children:[(0,lt.jsx)("div",{className:"text-center",children:(0,lt.jsxs)("div",{className:"text-base sm:text-lg font-black text-white leading-none",children:[a.etaMins,(0,lt.jsxs)("span",{className:"text-[10px] sm:text-xs text-zinc-400 font-normal",children:[" ","min"]})]})}),(0,lt.jsx)("div",{className:"text-center",children:(0,lt.jsxs)("div",{className:"text-base sm:text-lg font-black text-white leading-none",children:[a.distanceRemainingKm.toFixed(1),(0,lt.jsxs)("span",{className:"text-[10px] sm:text-xs text-zinc-400 font-normal",children:[" ","km"]})]})})]}),a.progress!==void 0&&(0,lt.jsxs)("div",{children:[(0,lt.jsxs)("div",{className:"flex justify-between text-[8px] sm:text-[9px] font-bold text-zinc-400 mb-1",children:[(0,lt.jsx)("span",{children:"Progress"}),(0,lt.jsxs)("span",{children:[Math.round(a.progress),"%"]})]}),(0,lt.jsx)("div",{className:"h-1 sm:h-1.5 bg-white/10 rounded-full overflow-hidden",children:(0,lt.jsx)("div",{className:"h-full bg-cyan-400 rounded-full",style:{width:`${a.progress}%`}})})]}),a.mode==="preview"&&a.onStart&&(0,lt.jsx)(Oa,{className:"mt-2.5 sm:mt-3 py-1.5 sm:py-2 text-[11px] sm:text-xs font-bold bg-cyan-500 text-black hover:bg-cyan-400 hover:text-black active:scale-95 rounded-lg transition-all cursor-pointer h-auto",onClick:a.onStart,variant:"ghost",children:"Start Guidance"})]})]});var Zt=Ue(Mt(),1),OC=({customControls:a=[],etaBarHeight:i,onRecenter:u,isMapCentered:f,mapBearing:m,mapPitch:s,onResetBearing:I,initialViewState:D,drawerState:q,side:j,etaData:te,isDragging:J,clampedDragOffset:ae,customRecenterButton:Q,customCompassButton:Ie,drawerPeekHeight:ye,insets:pe={bottom:0,left:0,right:0,top:0}})=>{let ue=a.filter(K=>K.position==="above-recenter"),re=a.filter(K=>K.position==="below-recenter"),fe=Math.abs(m)>=.5||Math.abs(s)>=.5,ge="32px",Pe=te?i:q==="closed"?pe.bottom:0,Le=typeof ye=="number"?`${ye}px`:ye||"15%",H=j==="bottom"?q==="closed"?`calc(${ge} + 1rem + ${Pe}px - var(--drag-offset, 0px))`:`calc(${Le} + 1rem + ${te?i:0}px - var(--drag-offset, 0px))`:`calc(1rem + ${pe.bottom}px)`;return(0,Zt.jsxs)("div",{className:`absolute right-4 z-30 flex flex-col items-center gap-3 select-none pointer-events-none ${J?"transition-none":"transition-all duration-300 ease-out"} ${j!=="bottom"||q!=="full"?"opacity-100 scale-100 pointer-events-auto":"opacity-0 scale-75 pointer-events-none"}`,style:{bottom:H},children:[ue.length>0&&(0,Zt.jsx)("div",{className:"flex flex-col gap-2 pointer-events-auto",children:ue.map(K=>(0,Zt.jsxs)("div",{className:"relative group flex items-center",children:[K.tooltip&&(0,Zt.jsx)("div",{className:"absolute right-14 pointer-events-none opacity-0 scale-95 origin-right group-hover:opacity-100 group-hover:scale-100 transition-all duration-150 bg-zinc-900/95 border border-white/10 text-white text-xs px-2.5 py-1.5 rounded-lg shadow-xl whitespace-nowrap",children:K.tooltip}),(0,Zt.jsx)(Oa,{className:`w-12 h-12 rounded-full bg-zinc-950/80 backdrop-blur-md border border-white/10 shadow-lg flex items-center justify-center text-white active:scale-95 transition-all cursor-pointer p-0! hover:bg-zinc-900 hover:text-white ${K.activeState?"ring-2 ring-cyan-400 ring-offset-2 ring-offset-zinc-950":""}`,onClick:K.onPress,variant:"ghost",children:K.icon})]},K.id))}),fe&&(Ie?(0,Zt.jsx)("div",{className:"pointer-events-auto",children:Ie}):(0,Zt.jsx)("div",{className:"pointer-events-auto",children:(0,Zt.jsx)(Oa,{className:`w-12 h-12 rounded-full bg-zinc-950/80 backdrop-blur-md border border-white/10 shadow-lg flex items-center justify-center text-white active:scale-95 transition-all duration-300 p-0! hover:bg-zinc-900 hover:text-white ${fe?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none h-0 w-0 border-none m-0 p-0 overflow-hidden"}`,onClick:()=>I({pitch:D?.pitch??0}),style:{transform:fe?"scale(1) rotate(0deg)":"scale(0.7) rotate(0deg)"},title:"Reset bearing to North",variant:"ghost",children:(0,Zt.jsxs)("svg",{className:"w-7 h-7 transition-transform duration-75 ease-out",fill:"none",style:{transform:`rotate(${-m}deg)`},viewBox:"0 0 24 24",children:[(0,Zt.jsx)("circle",{cx:"12",cy:"12",r:"9.5",stroke:"white",strokeOpacity:"0.2",strokeWidth:"1"}),(0,Zt.jsx)("path",{d:"M12 4.5L15 12H9L12 4.5Z",fill:"#ef4444"}),(0,Zt.jsx)("path",{d:"M12 19.5L9 12H15L12 19.5Z",fill:"#f4f4f5"}),(0,Zt.jsx)("circle",{cx:"12",cy:"12",fill:"#18181b",r:"1.5"})]})})})),Q?(0,Zt.jsx)("div",{className:"pointer-events-auto",children:Q}):(0,Zt.jsx)("div",{className:"pointer-events-auto",children:(0,Zt.jsx)(Oa,{className:`w-12 h-12 rounded-full bg-zinc-950/80 backdrop-blur-md border border-white/10 shadow-lg flex items-center justify-center text-white active:scale-95 transition-all cursor-pointer p-0! hover:bg-zinc-900 hover:text-white ${f?"ring-2 ring-cyan-400 ring-offset-2 ring-offset-zinc-950":""}`,onClick:()=>u(),title:"Recenter Map",variant:"ghost",children:f?(0,Zt.jsxs)("svg",{className:"w-6 h-6 text-cyan-400",fill:"none",stroke:"currentColor",strokeWidth:"2.2",viewBox:"0 0 24 24",children:[(0,Zt.jsx)("circle",{cx:"12",cy:"12",r:"8"}),(0,Zt.jsx)("circle",{cx:"12",cy:"12",fill:"currentColor",r:"3"}),(0,Zt.jsx)("line",{x1:"12",x2:"12",y1:"2",y2:"4"}),(0,Zt.jsx)("line",{x1:"12",x2:"12",y1:"20",y2:"22"}),(0,Zt.jsx)("line",{x1:"2",x2:"4",y1:"12",y2:"12"}),(0,Zt.jsx)("line",{x1:"20",x2:"22",y1:"12",y2:"12"})]}):(0,Zt.jsxs)("svg",{className:"w-6 h-6 text-zinc-300",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,Zt.jsx)("circle",{cx:"12",cy:"12",r:"8"}),(0,Zt.jsx)("line",{x1:"12",x2:"12",y1:"2",y2:"4"}),(0,Zt.jsx)("line",{x1:"12",x2:"12",y1:"20",y2:"22"}),(0,Zt.jsx)("line",{x1:"2",x2:"4",y1:"12",y2:"12"}),(0,Zt.jsx)("line",{x1:"20",x2:"22",y1:"12",y2:"12"})]})})}),re.length>0&&(0,Zt.jsx)("div",{className:"flex flex-col gap-2 pointer-events-auto",children:re.map(K=>(0,Zt.jsxs)("div",{className:"relative group flex items-center",children:[K.tooltip&&(0,Zt.jsx)("div",{className:"absolute right-14 pointer-events-none opacity-0 scale-95 origin-right group-hover:opacity-100 group-hover:scale-100 transition-all duration-150 bg-zinc-900/95 border border-white/10 text-white text-xs px-2.5 py-1.5 rounded-lg shadow-xl whitespace-nowrap",children:K.tooltip}),(0,Zt.jsx)(Oa,{className:`w-12 h-12 rounded-full bg-zinc-950/80 backdrop-blur-md border border-white/10 shadow-lg flex items-center justify-center text-white active:scale-95 transition-all cursor-pointer p-0! hover:bg-zinc-900 hover:text-white ${K.activeState?"ring-2 ring-cyan-400 ring-offset-2 ring-offset-zinc-950":""}`,onClick:K.onPress,variant:"ghost",children:K.icon})]},K.id))})]})};var fa=Ue(nt(),1),FC=Ue(Mt(),1),jn=(0,fa.createContext)(null),nv=({children:a})=>{let[i,u]=(0,fa.useState)(!0),[f,m]=(0,fa.useState)(0),[s,I]=(0,fa.useState)(0),[D,q]=(0,fa.useState)("closed"),j=(0,fa.useRef)(null),te=(0,fa.useCallback)(Re=>{q(Re)},[]),[J,ae]=(0,fa.useState)(!1),Q=(0,fa.useCallback)(Re=>{ae(Fe=>Fe===Re?Fe:Re)},[]),[Ie,ye]=(0,fa.useState)(void 0),pe=(0,fa.useCallback)(Re=>{ye(Fe=>!Fe&&!Re?Fe:!Fe||!Re?Re:Fe.etaMins===Re.etaMins&&Fe.distanceRemainingKm===Re.distanceRemainingKm&&Fe.label===Re.label&&Fe.progress===Re.progress&&Fe.mode===Re.mode&&Fe.isCalculating===Re.isCalculating&&Fe.error===Re.error?Fe:Re)},[]),[ue,re]=(0,fa.useState)({bottom:0,left:0,right:0,top:0}),fe=(0,fa.useCallback)(Re=>{re(Fe=>({...Fe,...Re}))},[]),ge=(0,fa.useRef)(null),Pe=(0,fa.useRef)(null),Le=(0,fa.useCallback)(Re=>{ge.current&&ge.current(Re)},[]),H=(0,fa.useCallback)(Re=>{Pe.current&&Pe.current(Re)},[]),Z=(0,fa.useCallback)(Re=>{ge.current=Re},[]),K=(0,fa.useCallback)(Re=>{Pe.current=Re},[]),ve=(0,fa.useCallback)(Re=>{m(Re)},[]),De=(0,fa.useCallback)(Re=>{I(Re)},[]),et=(0,fa.useMemo)(()=>({_registerCenterCallback:Z,_registerResetBearingCallback:K,bearing:f,centerOnUser:Le,drawerContentRef:j,drawerState:D,etaData:Ie,hasControls:J,insets:ue,isFollowing:i,pitch:s,resetBearing:H,setBearing:ve,setDrawerState:te,setEtaData:pe,setHasControls:Q,setInsets:fe,setIsFollowing:u,setPitch:De}),[Z,K,f,Le,D,Ie,J,i,s,H,ve,te,pe,Q,De,ue,fe]);return(0,FC.jsx)(jn.Provider,{value:et,children:a})},xD=()=>{let a=(0,fa.useContext)(jn);if(!a)throw new Error("useMapControls must be used within a MapControlsProvider");return a};var Wr=Ue(nt(),1),Ps=Ue(Mt(),1),NC=(a,i)=>typeof a=="number"?a:a.endsWith("%")?parseFloat(a)/100*i:parseFloat(a),sv=({menuItems:a=[],drawerSide:i,customControls:u=[],etaBarHeight:f=100,onRecenter:m,isMapCentered:s,mapBearing:I,onResetBearing:D,etaData:q,customRecenterButton:j,defaultState:te,initialViewState:J,customCompassButton:ae,drawerPeekHeight:Q,drawerFullHeight:Ie,drawerContentRef:ye,menuContent:pe,children:ue,enableTouchDrag:re=!1,showScrollToTopButton:fe=!0,scrollToTopThreshold:ge=300,isInternal:Pe=!1})=>{let Le=(0,Wr.useContext)(jn),H=Le?.drawerContentRef,Z=(0,Wr.useCallback)(Et=>{ye&&(typeof ye=="function"?ye(Et):ye.current=Et),H&&(H.current=Et)},[ye,H]),[K,ve]=(0,Wr.useState)(te??"closed"),De=Le?Le.drawerState:K,et=(0,Wr.useCallback)(Et=>{Le?Le.setDrawerState(Et):ve(Et)},[Le]);(0,Wr.useEffect)(()=>{te&&Le&&Le.setDrawerState(te)},[]);let[Re,Fe]=(0,Wr.useState)("left"),qe=(0,Wr.useRef)(null),[Ne,Xe]=(0,Wr.useState)(600);(0,Wr.useEffect)(()=>{let Et=qe.current?.parentElement;if(!Et)return;let ua=()=>{Xe(Et.getBoundingClientRect().height)};ua();let Jr=new ResizeObserver(ua);return Jr.observe(Et),()=>{Jr.disconnect()}},[]);let gt=Le?.setHasControls;(0,Wr.useEffect)(()=>{if(gt&&!Pe)return gt(!0),()=>gt(!1)},[gt,Pe]);let xt=s!==void 0?s:Le?Le.isFollowing:!0,Qe=I!==void 0?I:Le?Le.bearing:0,qt=Et=>{m?m(Et):Le&&Le.centerOnUser(Et)},ga=Et=>{D?D(Et):Le&&Le.resetBearing(Et)},Va=Le?Le.pitch:0,ut=q!==void 0?q:Le?.etaData,[ft,kt]=(0,Wr.useState)(null),[va,la]=(0,Wr.useState)(null);(0,Wr.useEffect)(()=>{if(typeof window>"u")return;let Et=()=>{i?Fe(i):window.innerWidth<768?Fe("bottom"):Fe("left")};return Et(),window.addEventListener("resize",Et),()=>window.removeEventListener("resize",Et)},[i]);let pt=ft!==null&&va!==null,Kt=pt?va-ft:0,Ze=NC(Ie||"85%",Ne),Ct=NC(Q||"15%",Ne),Yt=Le?.insets.bottom||0,ea=32+(De==="closed"?Yt:0),jt=Kt;De==="full"?jt=Math.max(0,Math.min(Ze-ea,Kt)):De==="peek"?jt=Math.max(-(Ze-Ct),Math.min(Ct-ea,Kt)):De==="closed"&&(jt=Math.min(0,Math.max(-(Ze-ea),Kt)));let Pt=32;De==="peek"?Pt=Ct:De==="full"&&(Pt=Ze);let La=Pt-jt,Qr=Ct+20,Or=Ct+(Ze-Ct)*.35,ja=1,nr="1rem";return Re==="bottom"?(La<=Qr?ja=1:La>=Or?ja=0:ja=1-(La-Qr)/(Or-Qr),nr=`calc(${Pt+(De==="closed"?Yt:0)+16}px - var(--drag-offset, 0px))`):(ja=De==="full"?0:1,nr=`calc(1rem + ${Yt}px)`),(0,Ps.jsxs)(Ps.Fragment,{children:[(0,Ps.jsx)("div",{ref:qe,style:{display:"none"}}),(0,Ps.jsx)(zC,{clampedDragOffset:jt,containerHeight:Ne,currentTouchY:va,drawerFullHeight:Ie,drawerPeekHeight:Q,enableTouchDrag:re,etaBarHeight:f,etaData:ut,isDragging:pt,menuContent:ue||pe,menuItems:a,onChangeState:et,ref:Z,safeAreaInsets:Le?.insets,scrollToTopThreshold:ge,setCurrentTouchY:la,setTouchStartY:kt,showScrollToTopButton:fe,side:Re,state:De,touchStartY:ft}),(0,Ps.jsx)(OC,{clampedDragOffset:jt,customCompassButton:ae,customControls:u,customRecenterButton:j,drawerPeekHeight:Q,drawerState:De,etaBarHeight:f+(De==="closed"?Yt:0),etaData:ut,initialViewState:J,insets:Le?.insets,isDragging:pt,isMapCentered:xt,mapBearing:Qe,mapPitch:Va,onRecenter:()=>qt(),onResetBearing:ga,side:Re}),ut&&(0,Ps.jsx)(BC,{etaData:ut,isDragging:pt,layoutMode:"floating-card",style:{bottom:nr,opacity:ja,pointerEvents:ja>.1?"auto":"none",transition:pt?"none":"bottom 250ms ease-in-out, opacity 300ms ease-out"}})]})};var UC=Ue(nt(),1),xn=Ue(Mt(),1),Pp=({children:a})=>(0,xn.jsx)("div",{className:"flex flex-col gap-1.5",children:a}),Z0=({id:a,label:i,icon:u,onPress:f,badge:m,disabled:s=!1,children:I})=>{let D=(0,UC.useContext)(jn);return(0,xn.jsxs)("button",{className:`flex items-center gap-3 w-full py-3 px-3.5 rounded-xl text-left cursor-pointer transition-all duration-150 ${s?"opacity-45 cursor-not-allowed pointer-events-none":"hover:bg-white/5 active:bg-white/10 text-white"}`,disabled:s,onClick:j=>{s||(f&&f(),D&&D.setDrawerState&&D.setDrawerState("closed"))},type:"button",children:[u&&(0,xn.jsxs)("div",{className:"relative flex items-center justify-center w-8 h-8 rounded-lg bg-white/5 text-zinc-300",children:[u,m!==void 0&&(0,xn.jsx)("span",{className:"absolute -top-1 -right-1 bg-cyan-500 text-black text-[9px] font-extrabold min-w-[15px] h-3.5 rounded-full flex items-center justify-center px-1 border border-zinc-950 shadow",children:m})]}),(0,xn.jsxs)("div",{className:"flex-1 flex flex-col justify-center",children:[(0,xn.jsx)("span",{className:"text-sm font-medium tracking-wide flex-1",children:i}),I]})]})};Pp.displayName="MapMenu";Z0.displayName="MapMenuItem";var W0=({children:a,showDivider:i=!0,className:u=""})=>(0,xn.jsx)("div",{className:`flex items-center justify-between pb-3 first:mt-0 px-3.5 ${u} ${i?"border-b border-white/10 mb-2 mt-4":""}`,children:a});W0.displayName="MapMenuTitle";var X0=({className:a=""})=>(0,xn.jsx)("div",{className:`h-[1px] bg-white/10 my-3 mx-3.5 ${a}`});X0.displayName="MapMenuDivider";var $0=({children:a,className:i=""})=>(0,xn.jsx)("div",{className:`mt-auto pt-4 border-t border-white/10 px-3.5 text-xs text-zinc-500 font-medium ${i}`,children:a});$0.displayName="MapMenuFooter";var qC=(f=>(f.TOP_SCROLL_MORE="TOP_SCROLL_MORE",f.BOTTOM_SCROLL_MORE="BOTTOM_SCROLL_MORE",f.BACK_GESTURE="BACK_GESTURE",f))(qC||{}),Rp=(u=>(u.LOCATION_UPDATE="LOCATION_UPDATE",u.LOCATION_STREAM_UPDATE="LOCATION_STREAM_UPDATE",u))(Rp||{}),VC=(i=>(i.UPDATE_CONTEXT="UPDATE_CONTEXT",i))(VC||{});var Rs=Ue(nt(),1),lv=.12,Dp=()=>{let[a,i]=(0,Rs.useState)({accuracy:null,coords:null,heading:null}),u=(0,Rs.useRef)({accuracy:null,coords:null,heading:null}),f=(0,Rs.useRef)({accuracy:null,coords:null,heading:null}),m=(0,Rs.useCallback)(s=>{let I=s.location?.coords||s.coords,D=s.heading||s.coords,q=I?[I.longitude,I.latitude]:null,j=null;return D?.trueHeading!==void 0&&D.trueHeading>=0?j=D.trueHeading:D?.magneticHeading!==void 0&&D.magneticHeading>=0?j=D.magneticHeading:D?.heading!==null&&D.heading>=0&&(j=D.heading),{accuracy:I?.accuracy||null,coords:q,heading:j}},[]);return(0,Rs.useEffect)(()=>{let s,I=()=>{let j=!1;if(u.current.coords)if(!f.current.coords)f.current.coords=[...u.current.coords],j=!0;else{let[te,J]=u.current.coords,[ae,Q]=f.current.coords,Ie=ae+(te-ae)*lv,ye=Q+(J-Q)*lv;(Math.abs(Ie-ae)>1e-7||Math.abs(ye-Q)>1e-7)&&(f.current.coords=[Ie,ye],j=!0)}if(u.current.heading!==null)if(f.current.heading===null)f.current.heading=u.current.heading,j=!0;else{let te=u.current.heading,J=f.current.heading,ae=te-J;ae>180&&(ae-=360),ae<-180&&(ae+=360);let Ie=((J+ae*lv)%360+360)%360;Math.abs(ae)>.1&&(f.current.heading=Ie,j=!0)}j&&i({accuracy:u.current.accuracy,coords:f.current.coords?[...f.current.coords]:null,heading:f.current.heading}),s=requestAnimationFrame(I)};s=requestAnimationFrame(I),er.location.getCurrentPosition().then(j=>{let te=m(j);u.current=te}).catch(j=>console.warn("Initial location fetch failed",j));let D=er.on("LOCATION_STREAM_UPDATE",j=>{u.current=m(j)}),q=er.on("LOCATION_UPDATE",j=>{u.current=m(j)});return er.location.startStream({distanceFilter:1,headingThreshold:2}).catch(j=>console.warn("Failed to start location stream",j)),()=>{cancelAnimationFrame(s),D(),q(),er.location.stopStream().catch(()=>{})}},[m]),a};var cr=Ue(nt(),1),uv=({origin:a,destination:i,profile:u="driving",recalculateThreshold:f=50,enabled:m=!0,initialMode:s="preview"})=>{let[I,D]=(0,cr.useState)(null),[q,j]=(0,cr.useState)(null),[te,J]=(0,cr.useState)(!1),[ae,Q]=(0,cr.useState)(null),[Ie,ye]=(0,cr.useState)(s),pe=Dp(),ue=a||pe.coords,re=pe.coords||a,fe=(0,cr.useRef)(null),ge=(0,cr.useRef)(null),Pe=(0,cr.useRef)(!1),Le=(0,cr.useCallback)((K,ve)=>{let et=K[1]*Math.PI/180,Re=ve[1]*Math.PI/180,Fe=(ve[1]-K[1])*Math.PI/180,qe=(ve[0]-K[0])*Math.PI/180,Ne=Math.sin(Fe/2)*Math.sin(Fe/2)+Math.cos(et)*Math.cos(Re)*Math.sin(qe/2)*Math.sin(qe/2);return 6371e3*(2*Math.atan2(Math.sqrt(Ne),Math.sqrt(1-Ne)))},[]),H=(0,cr.useMemo)(()=>{if(!re||!I||I.geometry.coordinates.length<2)return re&&i?Le(re,i):null;let K=I.geometry.coordinates,ve=1/0,De=0,et=(Ne,Xe)=>(Ne[0]-Xe[0])**2+(Ne[1]-Xe[1])**2;for(let Ne=0;Ne<K.length;Ne++){let Xe=et(re,K[Ne]);Xe<ve&&(ve=Xe,De=Ne)}let Re=K.slice(De+1),Fe=0,qe=re;for(let Ne of Re)Fe+=Le(qe,Ne),qe=Ne;return Fe},[re,I,i,Le]),Z=(0,cr.useCallback)(async(K,ve,De)=>{if(!Pe.current){Pe.current=!0,J(!0);try{let et=await er.routing.getRoute({destination:ve,origin:K,profile:u});if(D(et),Q(null),De){let Re=et.geometry.coordinates,Fe=0;for(let qe=0;qe<Re.length-1;qe++)Fe+=Le(Re[qe],Re[qe+1]);j(Fe)}fe.current=K,ge.current=ve}catch(et){Q(et.message||"Failed to fetch route")}finally{J(!1),Pe.current=!1}}},[u,Le]);return(0,cr.useEffect)(()=>{if(!m||!i||!ue){(!m||!i)&&(D(null),j(null),fe.current=null,ge.current=null);return}if(!ge.current||ge.current[0]!==i[0]||ge.current[1]!==i[1])Z(ue,i,!0);else if(fe.current){let ve=re||ue;Le(ve,fe.current)>f&&Z(ve,i,!1)}else Z(ue,i,!0)},[ue,re,i,m,f,Z,Le]),{currentDistanceMeters:H,error:ae,isCalculating:te,mode:Ie,recalculate:()=>ue&&i&&Z(ue,i,!1),route:I,start:()=>ye("navigation"),totalDistance:q}},vD=(a,i,u="driving")=>{let[f,m]=(0,cr.useState)(null),[s,I]=(0,cr.useState)(!1),[D,q]=(0,cr.useState)(null);return(0,cr.useEffect)(()=>{if(!a||!i){m(null);return}(async()=>{I(!0);try{let te=await er.routing.getRoute({destination:i,origin:a,profile:u});m(te),q(null)}catch(te){q(te.message||"Failed to fetch route")}finally{I(!1)}})()},[a,i,u]),{error:D,isCalculating:s,route:f}};var jC=Ue(nt(),1),cv=(a,i)=>(0,jC.useMemo)(()=>{if(!a||!i||a.coordinates.length<2)return a;let u=a.coordinates,f=1/0,m=0,s=(D,q)=>(D[0]-q[0])**2+(D[1]-q[1])**2;for(let D=0;D<u.length;D++){let q=s(i,u[D]);q<f&&(f=q,m=D)}let I=u.slice(m+1);return{coordinates:[i,...I],type:"LineString"}},[a,i]);var Nl=Ue(nt(),1),go=Ue(nt(),1);var Y0=Ue(nt(),1),Gn=Ue(nt(),1);var K0=Y0.createContext(null),dv=a=>{let[i,u]=(0,Gn.useState)({}),f=(0,Gn.useCallback)((s,I="default")=>{u(D=>{if(I==="current")throw new Error("'current' cannot be used as map id");if(D[I])throw new Error(`Multiple maps with the same id: ${I}`);return{...D,[I]:s}})},[]),m=(0,Gn.useCallback)((s="default")=>{u(I=>{if(I[s]){let D={...I};return delete D[s],D}return I})},[]);return Y0.createElement(K0.Provider,{value:{maps:i,onMapMount:f,onMapUnmount:m}},a.children)};function fv(){let a=(0,Gn.useContext)(K0)?.maps,i=(0,Gn.useContext)(mo);return(0,Gn.useMemo)(()=>({...a,current:i?.map}),[a,i])}function GC(a,i){let u=Array.isArray(a)?a[0]:a?a.x:0,f=Array.isArray(a)?a[1]:a?a.y:0,m=Array.isArray(i)?i[0]:i?i.x:0,s=Array.isArray(i)?i[1]:i?i.y:0;return u===m&&f===s}function kr(a,i){if(a===i)return!0;if(!a||!i)return!1;if(Array.isArray(a)){if(!Array.isArray(i)||a.length!==i.length)return!1;for(let u=0;u<a.length;u++)if(!kr(a[u],i[u]))return!1;return!0}else if(Array.isArray(i))return!1;if(typeof a=="object"&&typeof i=="object"){let u=Object.keys(a),f=Object.keys(i);if(u.length!==f.length)return!1;for(let m of u)if(!i.hasOwnProperty(m)||!kr(a[m],i[m]))return!1;return!0}return!1}function hv(a){return{longitude:a.center.lng,latitude:a.center.lat,zoom:a.zoom,pitch:a.pitch,bearing:a.bearing,padding:a.padding}}function pv(a,i){let u=i.viewState||i,f={};if("longitude"in u&&"latitude"in u&&(u.longitude!==a.center.lng||u.latitude!==a.center.lat)){let m=a.center.constructor;f.center=new m(u.longitude,u.latitude)}return"zoom"in u&&u.zoom!==a.zoom&&(f.zoom=u.zoom),"bearing"in u&&u.bearing!==a.bearing&&(f.bearing=u.bearing),"pitch"in u&&u.pitch!==a.pitch&&(f.pitch=u.pitch),u.padding&&a.padding&&!kr(u.padding,a.padding)&&(f.padding=u.padding),f}var bD=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function mv(a){if(!a)return null;if(typeof a=="string"||("toJS"in a&&(a=a.toJS()),!a.layers))return a;let i={};for(let f of a.layers)i[f.id]=f;let u=a.layers.map(f=>{let m=null;"interactive"in f&&(m=Object.assign({},f),delete m.interactive);let s=i[f.ref];if(s){m=m||Object.assign({},f),delete m.ref;for(let I of bD)I in s&&(m[I]=s[I])}return m||f});return{...a,layers:u}}var HC={version:8,sources:{},layers:[]},wD={minZoom:0,maxZoom:22,minPitch:0,maxPitch:85,maxBounds:[-180,-85.051129,180,85.051129],projection:"mercator",renderWorldCopies:!0},ZC={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},WC={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},XC={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},SD=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],CD=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"],Q0=class a{constructor(i,u,f){this._map=null,this._internalUpdate=!1,this._hoveredFeatures=null,this._propsedCameraUpdate=null,this._styleComponents={},this._onEvent=m=>{let s=this.props[XC[m.type]];s?s(m):m.type==="error"&&console.error(m.error)},this._onCameraEvent=m=>{if(this._internalUpdate)return;m.viewState=this._propsedCameraUpdate||hv(this._map.transform);let s=this.props[WC[m.type]];s&&s(m)},this._onCameraUpdate=m=>this._internalUpdate?m:(this._propsedCameraUpdate=hv(m),pv(m,this.props)),this._onPointerEvent=m=>{(m.type==="mousemove"||m.type==="mouseout")&&this._updateHover(m);let s=this.props[ZC[m.type]];s&&(this.props.interactiveLayerIds&&m.type!=="mouseover"&&m.type!=="mouseout"&&(m.features=this._hoveredFeatures||this._queryRenderedFeatures(m.point)),s(m),delete m.features)},this._MapClass=i,this.props=u,this._initialize(f)}get map(){return this._map}setProps(i){let u=this.props;this.props=i;let f=this._updateSettings(i,u),m=this._updateSize(i),s=this._updateViewState(i);this._updateStyle(i,u),this._updateStyleComponents(i),this._updateHandlers(i,u),(f||m||s&&!this._map.isMoving())&&this.redraw()}static reuse(i,u){let f=a.savedMaps.pop();if(!f)return null;let m=f.map,s=m.getContainer();for(u.className=s.className;s.childNodes.length>0;)u.appendChild(s.childNodes[0]);m._container=u;let I=m._resizeObserver;I&&(I.disconnect(),I.observe(u)),f.setProps({...i,styleDiffing:!1}),m.resize();let{initialViewState:D}=i;return D&&(D.bounds?m.fitBounds(D.bounds,{...D.fitBoundsOptions,duration:0}):f._updateViewState(D)),m.isStyleLoaded()?m.fire("load"):m.once("style.load",()=>m.fire("load")),m._update(),f}_initialize(i){let{props:u}=this,{mapStyle:f=HC}=u,m={...u,...u.initialViewState,container:i,style:mv(f)},s=m.initialViewState||m.viewState||m;if(Object.assign(m,{center:[s.longitude||0,s.latitude||0],zoom:s.zoom||0,pitch:s.pitch||0,bearing:s.bearing||0}),u.gl){let D=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=D,u.gl)}let I=new this._MapClass(m);s.padding&&I.setPadding(s.padding),u.cursor&&(I.getCanvas().style.cursor=u.cursor),I.transformCameraUpdate=this._onCameraUpdate,I.on("style.load",()=>{this._styleComponents={light:I.getLight(),sky:I.getSky(),projection:I.getProjection?.(),terrain:I.getTerrain()},this._updateStyleComponents(this.props)}),I.on("sourcedata",()=>{this._updateStyleComponents(this.props)});for(let D in ZC)I.on(D,this._onPointerEvent);for(let D in WC)I.on(D,this._onCameraEvent);for(let D in XC)I.on(D,this._onEvent);this._map=I}recycle(){this.map.getContainer().querySelector("[mapboxgl-children]")?.remove(),a.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){let i=this._map;i.style&&(i._frame&&(i._frame.cancel(),i._frame=null),i._render())}_updateSize(i){let{viewState:u}=i;if(u){let f=this._map;if(u.width!==f.transform.width||u.height!==f.transform.height)return f.resize(),!0}return!1}_updateViewState(i){let u=this._map,f=u.transform;if(!u.isMoving()){let s=pv(f,i);if(Object.keys(s).length>0)return this._internalUpdate=!0,u.jumpTo(s),this._internalUpdate=!1,!0}return!1}_updateSettings(i,u){let f=this._map,m=!1;for(let s of SD)if((s in i||s in u)&&!kr(i[s],u[s])){m=!0;let D=s in i?i[s]:wD[s];f[`set${s[0].toUpperCase()}${s.slice(1)}`]?.call(f,D)}return m}_updateStyle(i,u){if(i.cursor!==u.cursor&&(this._map.getCanvas().style.cursor=i.cursor||""),i.mapStyle!==u.mapStyle){let{mapStyle:f=HC,styleDiffing:m=!0}=i,s={diff:m};"localIdeographFontFamily"in i&&(s.localIdeographFontFamily=i.localIdeographFontFamily),this._map.setStyle(mv(f),s)}}_updateStyleComponents({light:i,projection:u,sky:f,terrain:m}){let s=this._map,I=this._styleComponents;s.style?._loaded&&(i&&!kr(i,I.light)&&(I.light=i,s.setLight(i)),u&&!kr(u,I.projection)&&u!==I.projection?.type&&(I.projection=typeof u=="string"?{type:u}:u,s.setProjection?.(I.projection)),f&&!kr(f,I.sky)&&(I.sky=f,s.setSky(f)),m!==void 0&&!kr(m,I.terrain)&&(!m||s.getSource(m.source))&&(I.terrain=m,s.setTerrain(m)))}_updateHandlers(i,u){let f=this._map;for(let m of CD){let s=i[m]??!0,I=u[m]??!0;kr(s,I)||(s?f[m].enable(s):f[m].disable())}}_queryRenderedFeatures(i){let u=this._map,{interactiveLayerIds:f=[]}=this.props;try{return u.queryRenderedFeatures(i,{layers:f.filter(u.getLayer.bind(u))})}catch{return[]}}_updateHover(i){let{props:u}=this;if(u.interactiveLayerIds&&(u.onMouseMove||u.onMouseEnter||u.onMouseLeave)){let m=i.type,s=this._hoveredFeatures?.length>0,I=this._queryRenderedFeatures(i.point),D=I.length>0;!D&&s&&(i.type="mouseleave",this._onPointerEvent(i)),this._hoveredFeatures=I,D&&!s&&(i.type="mouseenter",this._onPointerEvent(i)),i.type=m}else this._hoveredFeatures=null}};Q0.savedMaps=[];var gv=Q0;var LD=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function yv(a){if(!a)return null;let i=a.map,u={getMap:()=>i};for(let f of TD(i))!(f in u)&&!LD.includes(f)&&(u[f]=i[f].bind(i));return u}function TD(a){let i=new Set,u=a;for(;u;){for(let f of Object.getOwnPropertyNames(u))f[0]!=="_"&&typeof a[f]=="function"&&f!=="fire"&&f!=="setEventedParent"&&i.add(f);u=Object.getPrototypeOf(u)}return Array.from(i)}var J0=Ue(nt(),1),ID=typeof document<"u"?J0.useLayoutEffect:J0.useEffect,$C=ID;function _v(a,i){let{RTLTextPlugin:u,maxParallelImageRequests:f,workerCount:m,workerUrl:s}=i;if(u&&a.getRTLTextPluginStatus&&a.getRTLTextPluginStatus()==="unavailable"){let{pluginUrl:I,lazy:D=!0}=typeof u=="string"?{pluginUrl:u}:u;a.setRTLTextPlugin(I,q=>{q&&console.error(q)},D)}f!==void 0&&a.setMaxParallelImageRequests(f),m!==void 0&&a.setWorkerCount(m),s!==void 0&&a.setWorkerUrl(s)}var mo=Nl.createContext(null);function MD(a,i){let u=(0,go.useContext)(K0),[f,m]=(0,go.useState)(null),s=(0,go.useRef)(),{current:I}=(0,go.useRef)({mapLib:null,map:null});(0,go.useEffect)(()=>{let j=a.mapLib,te=!0,J;return Promise.resolve(j||Promise.resolve().then(()=>Ue(KC(),1))).then(ae=>{if(!te)return;if(!ae)throw new Error("Invalid mapLib");let Q="Map"in ae?ae:ae.default;if(!Q.Map)throw new Error("Invalid mapLib");_v(Q,a),a.reuseMaps&&(J=gv.reuse(a,s.current)),J||(J=new gv(Q.Map,a,s.current)),I.map=yv(J),I.mapLib=Q,m(J),u?.onMapMount(I.map,a.id)}).catch(ae=>{let{onError:Q}=a;Q?Q({type:"error",target:null,originalEvent:null,error:ae}):console.error(ae)}),()=>{te=!1,J&&(u?.onMapUnmount(a.id),a.reuseMaps?J.recycle():J.destroy())}},[]),$C(()=>{f&&f.setProps(a)}),(0,go.useImperativeHandle)(i,()=>I.map,[f]);let D=(0,go.useMemo)(()=>({position:"relative",width:"100%",height:"100%",...a.style}),[a.style]),q={height:"100%"};return Nl.createElement("div",{id:a.id,ref:s,style:D},f&&Nl.createElement(mo.Provider,{value:I},Nl.createElement("div",{"mapboxgl-children":"",style:q},a.children)))}var bv=Nl.forwardRef(MD);var JC=Ue(nt(),1),eL=Ue(Kd(),1),Fi=Ue(nt(),1);var ED=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function Xr(a,i){if(!a||!i)return;let u=a.style;for(let f in i){let m=i[f];Number.isFinite(m)&&!ED.test(f)?u[f]=`${m}px`:u[f]=m}}function e1(a,i){if(a===i)return null;let u=QC(a),f=QC(i),m=[];for(let s of f)u.has(s)||m.push(s);for(let s of u)f.has(s)||m.push(s);return m.length===0?null:m}function QC(a){return new Set(a?a.trim().split(/\s+/):[])}var kp=(0,Fi.memo)((0,Fi.forwardRef)((a,i)=>{let{map:u,mapLib:f}=(0,Fi.useContext)(mo),m=(0,Fi.useRef)({props:a}),s=(0,Fi.useMemo)(()=>{let ue=!1;JC.Children.forEach(a.children,ge=>{ge&&(ue=!0)});let re={...a,element:ue?document.createElement("div"):void 0},fe=new f.Marker(re);return fe.setLngLat([a.longitude,a.latitude]),fe.getElement().addEventListener("click",ge=>{m.current.props.onClick?.({type:"click",target:fe,originalEvent:ge})}),fe.on("dragstart",ge=>{let Pe=ge;Pe.lngLat=s.getLngLat(),m.current.props.onDragStart?.(Pe)}),fe.on("drag",ge=>{let Pe=ge;Pe.lngLat=s.getLngLat(),m.current.props.onDrag?.(Pe)}),fe.on("dragend",ge=>{let Pe=ge;Pe.lngLat=s.getLngLat(),m.current.props.onDragEnd?.(Pe)}),fe},[]);(0,Fi.useEffect)(()=>(s.addTo(u.getMap()),()=>{s.remove()}),[]);let{longitude:I,latitude:D,offset:q,style:j,draggable:te=!1,popup:J=null,rotation:ae=0,rotationAlignment:Q="auto",pitchAlignment:Ie="auto"}=a;(0,Fi.useEffect)(()=>{Xr(s.getElement(),j)},[j]),(0,Fi.useImperativeHandle)(i,()=>s,[]);let ye=m.current.props;(s.getLngLat().lng!==I||s.getLngLat().lat!==D)&&s.setLngLat([I,D]),q&&!GC(s.getOffset(),q)&&s.setOffset(q),s.isDraggable()!==te&&s.setDraggable(te),s.getRotation()!==ae&&s.setRotation(ae),s.getRotationAlignment()!==Q&&s.setRotationAlignment(Q),s.getPitchAlignment()!==Ie&&s.setPitchAlignment(Ie),s.getPopup()!==J&&s.setPopup(J);let pe=e1(ye.className,a.className);if(pe)for(let ue of pe)s.toggleClassName(ue);return m.current.props=a,(0,eL.createPortal)(a.children,s.getElement())}));var tL=Ue(Kd(),1),Li=Ue(nt(),1);var AD=(0,Li.memo)((0,Li.forwardRef)((a,i)=>{let{map:u,mapLib:f}=(0,Li.useContext)(mo),m=(0,Li.useMemo)(()=>document.createElement("div"),[]),s=(0,Li.useRef)({props:a}),I=(0,Li.useMemo)(()=>{let D={...a},q=new f.Popup(D);return q.setLngLat([a.longitude,a.latitude]),q.once("open",j=>{s.current.props.onOpen?.(j)}),q},[]);if((0,Li.useEffect)(()=>{let D=q=>{s.current.props.onClose?.(q)};return I.on("close",D),I.setDOMContent(m).addTo(u.getMap()),()=>{I.off("close",D),I.isOpen()&&I.remove()}},[]),(0,Li.useEffect)(()=>{Xr(I.getElement(),a.style)},[a.style]),(0,Li.useImperativeHandle)(i,()=>I,[]),I.isOpen()){let D=s.current.props;(I.getLngLat().lng!==a.longitude||I.getLngLat().lat!==a.latitude)&&I.setLngLat([a.longitude,a.latitude]),a.offset&&!kr(D.offset,a.offset)&&I.setOffset(a.offset),(D.anchor!==a.anchor||D.maxWidth!==a.maxWidth)&&(I.options.anchor=a.anchor,I.setMaxWidth(a.maxWidth));let q=e1(D.className,a.className);if(q)for(let j of q)I.toggleClassName(j);s.current.props=a}return(0,tL.createPortal)(a.children,m)}));var t1=Ue(nt(),1);var lf=Ue(nt(),1);function Ni(a,i,u,f){let m=(0,lf.useContext)(mo),s=(0,lf.useMemo)(()=>a(m),[]);return(0,lf.useEffect)(()=>{let I=f||u||i,D=typeof i=="function"&&typeof u=="function"?i:null,q=typeof u=="function"?u:typeof i=="function"?i:null,{map:j}=m;return j.hasControl(s)||(j.addControl(s,I?.position),D&&D(m)),()=>{q&&q(m),j.hasControl(s)&&j.removeControl(s)}},[]),s}function PD(a){let i=Ni(({mapLib:u})=>new u.AttributionControl(a),{position:a.position});return(0,t1.useEffect)(()=>{Xr(i._container,a.style)},[a.style]),null}var RD=(0,t1.memo)(PD);var a1=Ue(nt(),1);function DD(a){let i=Ni(({mapLib:u})=>new u.FullscreenControl({container:a.containerId&&document.getElementById(a.containerId)}),{position:a.position});return(0,a1.useEffect)(()=>{Xr(i._controlContainer,a.style)},[a.style]),null}var kD=(0,a1.memo)(DD);var Hn=Ue(nt(),1);function zD(a,i){let u=(0,Hn.useRef)({props:a}),f=Ni(({mapLib:m})=>{let s=new m.GeolocateControl(a),I=s._setupUI;return s._setupUI=()=>{s._container.hasChildNodes()||I()},s.on("geolocate",D=>{u.current.props.onGeolocate?.(D)}),s.on("error",D=>{u.current.props.onError?.(D)}),s.on("outofmaxbounds",D=>{u.current.props.onOutOfMaxBounds?.(D)}),s.on("trackuserlocationstart",D=>{u.current.props.onTrackUserLocationStart?.(D)}),s.on("trackuserlocationend",D=>{u.current.props.onTrackUserLocationEnd?.(D)}),s},{position:a.position});return u.current.props=a,(0,Hn.useImperativeHandle)(i,()=>f,[]),(0,Hn.useEffect)(()=>{Xr(f._container,a.style)},[a.style]),null}var BD=(0,Hn.memo)((0,Hn.forwardRef)(zD));var r1=Ue(nt(),1);function OD(a){let i=Ni(({mapLib:u})=>new u.NavigationControl(a),{position:a.position});return(0,r1.useEffect)(()=>{Xr(i._container,a.style)},[a.style]),null}var FD=(0,r1.memo)(OD);var uf=Ue(nt(),1);function ND(a){let i=Ni(({mapLib:s})=>new s.ScaleControl(a),{position:a.position}),u=(0,uf.useRef)(a),f=u.current;u.current=a;let{style:m}=a;return a.maxWidth!==void 0&&a.maxWidth!==f.maxWidth&&(i.options.maxWidth=a.maxWidth),a.unit!==void 0&&a.unit!==f.unit&&i.setUnit(a.unit),(0,uf.useEffect)(()=>{Xr(i._container,m)},[m]),null}var UD=(0,uf.memo)(ND);var i1=Ue(nt(),1);function qD(a){let i=Ni(({mapLib:u})=>new u.TerrainControl(a),{position:a.position});return(0,i1.useEffect)(()=>{Xr(i._container,a.style)},[a.style]),null}var VD=(0,i1.memo)(qD);var o1=Ue(nt(),1);function jD(a){let i=Ni(({mapLib:u})=>new u.LogoControl(a),{position:a.position});return(0,o1.useEffect)(()=>{Xr(i._container,a.style)},[a.style]),null}var GD=(0,o1.memo)(jD);var aL=Ue(nt(),1),Fo=Ue(nt(),1);function dc(a,i){if(!a)throw new Error(i)}var HD=0;function ZD(a,i,u){if(a.style&&a.style._loaded){let f={...u};return delete f.id,delete f.children,a.addSource(i,f),a.getSource(i)}return null}function WD(a,i,u){dc(i.id===u.id,"source id changed"),dc(i.type===u.type,"source type changed");let f="",m=0;for(let I in i)I!=="children"&&I!=="id"&&!kr(u[I],i[I])&&(f=I,m++);if(!m)return;let s=i.type;if(s==="geojson")a.setData(i.data);else if(s==="image")a.updateImage({url:i.url,coordinates:i.coordinates});else switch(f){case"coordinates":a.setCoordinates?.(i.coordinates);break;case"url":a.setUrl?.(i.url);break;case"tiles":a.setTiles?.(i.tiles);break;default:console.warn(`Unable to update <Source> prop: ${f}`)}}function zp(a){let i=(0,Fo.useContext)(mo).map.getMap(),u=(0,Fo.useRef)(a),[,f]=(0,Fo.useState)(0),m=(0,Fo.useMemo)(()=>a.id||`jsx-source-${HD++}`,[]);(0,Fo.useEffect)(()=>{if(i){let I=()=>setTimeout(()=>f(D=>D+1),0);return i.on("styledata",I),I(),()=>{if(i.off("styledata",I),i.style&&i.style._loaded&&i.getSource(m)){let D=i.getStyle()?.layers;if(D)for(let q of D)q.source===m&&i.removeLayer(q.id);i.removeSource(m)}}}},[i]);let s=i&&i.style&&i.getSource(m);return s?WD(s,a,u.current):s=ZD(i,m,a),u.current=a,s&&aL.Children.map(a.children,I=>I&&(0,Fo.cloneElement)(I,{source:m}))||null}var Zn=Ue(nt(),1);function XD(a,i,u,f){if(dc(u.id===f.id,"layer id changed"),dc(u.type===f.type,"layer type changed"),u.type==="custom"||f.type==="custom")return;let{layout:m={},paint:s={},filter:I,minzoom:D,maxzoom:q,beforeId:j}=u;if(j!==f.beforeId&&a.moveLayer(i,j),m!==f.layout){let te=f.layout||{};for(let J in m)kr(m[J],te[J])||a.setLayoutProperty(i,J,m[J]);for(let J in te)m.hasOwnProperty(J)||a.setLayoutProperty(i,J,void 0)}if(s!==f.paint){let te=f.paint||{};for(let J in s)kr(s[J],te[J])||a.setPaintProperty(i,J,s[J]);for(let J in te)s.hasOwnProperty(J)||a.setPaintProperty(i,J,void 0)}kr(I,f.filter)||a.setFilter(i,I),(D!==f.minzoom||q!==f.maxzoom)&&a.setLayerZoomRange(i,D,q)}function $D(a,i,u){if(a.style&&a.style._loaded&&(!("source"in u)||a.getSource(u.source))){let f={...u,id:i};delete f.beforeId,a.addLayer(f,u.beforeId)}}var YD=0;function cf(a){let i=(0,Zn.useContext)(mo).map.getMap(),u=(0,Zn.useRef)(a),[,f]=(0,Zn.useState)(0),m=(0,Zn.useMemo)(()=>a.id||`jsx-layer-${YD++}`,[]);if((0,Zn.useEffect)(()=>{if(i){let I=()=>f(D=>D+1);return i.on("styledata",I),I(),()=>{i.off("styledata",I),i.style&&i.style._loaded&&i.getLayer(m)&&i.removeLayer(m)}}},[i]),i&&i.style&&i.getLayer(m))try{XD(i,m,a,u.current)}catch(I){console.warn(I)}else $D(i,m,a);return u.current=a,null}var Bp=Ue(Mt(),1),wv=({geometry:a,color:i="#3b82f6",width:u=5,opacity:f=.8})=>a?(0,Bp.jsxs)(zp,{data:{geometry:a,properties:{},type:"Feature"},id:"sdk-route-source",type:"geojson",children:[(0,Bp.jsx)(cf,{id:"sdk-route-layer-casing",paint:{"line-blur":1,"line-color":"#ffffff","line-opacity":f,"line-width":u+2},type:"line"}),(0,Bp.jsx)(cf,{id:"sdk-route-layer",layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":i,"line-opacity":f,"line-width":u},type:"line"})]}):null;var Bt=Ue(nt(),1);var fc=Ue(nt(),1),Sv=Ue(Mt(),1);function rL(a,i=64){let u=document.createElement("canvas");u.width=i,u.height=i;let f=u.getContext("2d");return f.font=`${i*.75}px serif`,f.textAlign="center",f.textBaseline="middle",f.fillText(a,i/2,i/2),f.getImageData(0,0,i,i)}var iL=({pois:a})=>{let[i,u]=(0,fc.useState)(0),{current:f}=fv(),m=(0,fc.useMemo)(()=>a.filter(I=>!I.displayMode||I.displayMode==="gl"),[a]);(0,fc.useEffect)(()=>{if(!f)return;let I=f.getMap();[{emoji:"\u{1F37A}",name:"sdk-default-bar"},{emoji:"\u{1F37D}\uFE0F",name:"sdk-default-restaurant"},{emoji:"\u{1F4CD}",name:"sdk-default-poi"}].forEach(j=>{I.hasImage(j.name)||I.addImage(j.name,rL(j.emoji),{pixelRatio:2})});let q=0;m.forEach(j=>{if(j.imageUrl){let te=`custom-url-${j.id}`;I.hasImage(te)||I.loadImage(j.imageUrl,(J,ae)=>{!J&&ae&&(I.hasImage(te)||(I.addImage(te,ae),u(Q=>Q+1)))})}if(j.emoji){let te=`custom-emoji-${j.emoji}`;I.hasImage(te)||(I.addImage(te,rL(j.emoji),{pixelRatio:2}),q++)}}),q>0&&u(j=>j+q)},[f,m]);let s=(0,fc.useMemo)(()=>({features:m.map(I=>({geometry:{coordinates:[I.longitude,I.latitude],type:"Point"},properties:{...I,"sdk-icon":I.imageUrl?`custom-url-${I.id}`:I.spriteName?I.spriteName:I.emoji?`custom-emoji-${I.emoji}`:I.type==="bar"?"sdk-default-bar":I.type==="restaurant"?"sdk-default-restaurant":"sdk-default-poi"},type:"Feature"})),type:"FeatureCollection"}),[m]);return(0,Sv.jsx)(zp,{data:s,id:"sdk-pois",type:"geojson",children:(0,Sv.jsx)(cf,{id:"sdk-poi-layer",layout:{"icon-allow-overlap":!0,"icon-image":["get","sdk-icon"],"icon-size":1,"text-anchor":"top","text-field":["step",["zoom"],"",14,["get","name"]],"text-font":["Open Sans Bold"],"text-offset":[0,1.5],"text-optional":!0,"text-size":11},paint:{"icon-opacity":["interpolate",["linear"],["zoom"],11,0,12,1],"text-color":"#ffffff","text-halo-color":"#000000","text-halo-width":1,"text-opacity":["interpolate",["linear"],["zoom"],13.5,0,14,1]},type:"symbol"})})};var vn=Ue(Mt(),1),oL=({pois:a,onClick:i})=>{let u=a.filter(f=>f.displayMode==="marker");return u.length===0?null:(0,vn.jsx)(vn.Fragment,{children:u.map(f=>(0,vn.jsx)(kp,{anchor:"bottom",latitude:f.latitude,longitude:f.longitude,onClick:m=>{m.originalEvent.stopPropagation(),i&&i(f)},children:f.markerComponent?f.markerComponent:(0,vn.jsxs)("div",{style:{cursor:"pointer",filter:"drop-shadow(0 4px 6px rgba(0,0,0,0.1))",transform:"transition-transform duration-200 hover:scale-110"},children:[(0,vn.jsx)("div",{style:{alignItems:"center",backgroundColor:f.type==="bar"?"#f97316":"#10b981",border:"2px solid white",borderRadius:"50%",display:"flex",height:"32px",justifyContent:"center",width:"32px"},children:f.emoji?(0,vn.jsx)("span",{style:{fontSize:"16px"},children:f.emoji}):(0,vn.jsx)("div",{style:{backgroundColor:"white",borderRadius:"50%",height:"8px",width:"8px"}})}),(0,vn.jsx)("div",{style:{borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderTop:`8px solid ${f.type==="bar"?"#f97316":"#10b981"}`,height:0,margin:"-2px auto 0",width:0}})]})},f.id))})};var Ui=Ue(Mt(),1),nL=({forcedLocation:a,heading:i})=>a?(0,Ui.jsx)(kp,{anchor:"center",latitude:a[1],longitude:a[0],children:(0,Ui.jsxs)("div",{style:{alignItems:"center",display:"flex",justifyContent:"center",position:"relative"},children:[(0,Ui.jsx)("div",{style:{animation:"pulse 2s infinite",backgroundColor:"rgba(59, 130, 246, 0.4)",borderRadius:"50%",height:"40px",position:"absolute",width:"40px"}}),i!=null&&(0,Ui.jsx)("div",{style:{height:"60px",position:"absolute",transform:`rotate(${i}deg)`,width:"60px",zIndex:0},children:(0,Ui.jsxs)("svg",{style:{height:"100%",width:"100%"},viewBox:"0 0 100 100",children:[(0,Ui.jsx)("defs",{children:(0,Ui.jsxs)("radialGradient",{cx:"50%",cy:"50%",fx:"50%",fy:"50%",id:"grad1",r:"50%",children:[(0,Ui.jsx)("stop",{offset:"0%",style:{stopColor:"rgba(37, 99, 235, 0.6)",stopOpacity:1}}),(0,Ui.jsx)("stop",{offset:"100%",style:{stopColor:"rgba(37, 99, 235, 0)",stopOpacity:0}})]})}),(0,Ui.jsx)("path",{d:"M 50 50 L 35 0 A 50 50 0 0 1 65 0 Z",fill:"url(#grad1)"})]})}),(0,Ui.jsx)("div",{style:{alignItems:"center",backgroundColor:"white",borderRadius:"50%",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(37, 99, 235, 0.2)",display:"flex",height:"20px",justifyContent:"center",width:"20px",zIndex:1},children:(0,Ui.jsx)("div",{style:{backgroundColor:"#2563eb",border:"2px solid white",borderRadius:"50%",height:"12px",width:"12px"}})}),(0,Ui.jsx)("style",{children:"@keyframes pulse { 0% { transform: scale(0.95); opacity: 0.7; } 70% { transform: scale(1.5); opacity: 0; } 100% { transform: scale(0.95); opacity: 0; } }"})]})}):null;var dr=Ue(Mt(),1),KD=({initialViewState:a={latitude:45.90583599233422,longitude:6.12589018919138,zoom:12},style:i={},mapStyle:u="https://tiles.cloudparse.fr/style/up_dark_matter",className:f="",maxBounds:m,children:s,onClick:I,onMapClickMiss:D,onContextMenu:q,interactiveLayerIds:j=[],onLoad:te,showUserLocation:J=!0,followUser:ae=!1,showUserLocationButton:Q=!0,renderUserLocation:Ie,pois:ye=[],onPoiClick:pe,route:ue,showNavigationUI:re,navigationData:fe,onNavigationAbort:ge,onNavigationModeChange:Pe,navigation:Le,showControls:H=!0,menuItems:Z,menuContent:K,drawerState:ve,drawerContentRef:De,controlProps:et={},enableTouchDrag:Re=!1})=>{let Fe=(0,Bt.useContext)(jn),qe=(0,Bt.useRef)(null),Ne=Dp(),[Xe,gt]=(0,Bt.useState)(null),[xt,Qe]=(0,Bt.useState)(!1);(0,Bt.useEffect)(()=>{let Gt=er.on("SDK_NAVIGATION_CREATE",ba=>{Qe(!1),gt(ba)}),Fr=er.on("SDK_NAVIGATION_START",()=>{Qe(!1),gt(ba=>ba?{...ba,mode:"navigation"}:null)}),Se=er.on("SDK_NAVIGATION_ABORT",()=>{Qe(!0),gt(null)});return()=>{Gt(),Fr(),Se()}},[]);let qt=Xe||Le,ga=uv({destination:qt?.destination||null,enabled:!!qt?.destination,initialMode:qt?.mode||"preview",origin:qt?.origin,profile:qt?.profile||"driving",recalculateThreshold:qt?.recalculateThreshold||50});(0,Bt.useEffect)(()=>{Pe&&Le&&Pe(ga.mode)},[ga.mode,Pe,Le]);let Va=(0,Bt.useRef)(null),ut=qt?.destination;(0,Bt.useEffect)(()=>{ut&&(!Va.current||Va.current[0]!==ut[0]||Va.current[1]!==ut[1])&&Qe(!1),Va.current=ut},[ut]);let ft=xt?void 0:qt?ga:fe,kt=xt?void 0:qt?ga.route?.geometry:ue,va=!xt&&qt?.showUI!==!1&&(qt?!!qt.destination:re),la=ft?.mode||"preview",pt=Fe?Fe.isFollowing:ae,Kt=(0,Bt.useRef)(pt),Ze=(0,Bt.useRef)(!1),[Ct,Yt]=(0,Bt.useState)(pt),ea=Fe?Fe.isFollowing:Ct,jt=Fe?.setIsFollowing,Pt=(0,Bt.useCallback)(Gt=>{Kt.current=Gt,Yt(Gt),jt&&jt(Gt)},[jt]);(0,Bt.useEffect)(()=>{Fe&&Fe.isFollowing!==Kt.current&&(Kt.current=Fe.isFollowing)},[Fe?.isFollowing,Fe]);let La=[...j];ye.length>0&&!La.includes("sdk-poi-layer")&&La.push("sdk-poi-layer");let Qr=(0,Bt.useRef)(ae);(0,Bt.useEffect)(()=>{ae!==Qr.current&&(Pt(ae),Qr.current=ae,ae&&Ne.coords&&qe.current&&(Ze.current=!0,qe.current.flyTo({center:Ne.coords,duration:1e3,essential:!0,zoom:Math.max(qe.current.getZoom(),16)}),setTimeout(()=>{Ze.current=!1},1050)))},[ae,Pt,Ne.coords]);let Or=(0,Bt.useRef)(null),ja=(0,Bt.useRef)(null);(0,Bt.useEffect)(()=>{if(!kt||!qe.current){kt||(Or.current=null);return}let Gt=kt!==Or.current,Fr=ja.current!==la;if(la==="navigation")Pt(!0),(Fr||Gt)&&Ne.coords&&qe.current&&(Ze.current=!0,qe.current.flyTo({center:Ne.coords,duration:1e3,essential:!0,zoom:17}),setTimeout(()=>{Ze.current=!1},1050));else if(la==="preview"&&Gt){Pt(!1);let Se=kt.coordinates;if(Se.length>0){let ba=Se.reduce((mr,It)=>[[Math.min(mr[0][0],It[0]),Math.min(mr[0][1],It[1])],[Math.max(mr[1][0],It[0]),Math.max(mr[1][1],It[1])]],[[Se[0][0],Se[0][1]],[Se[0][0],Se[0][1]]]);qe.current.fitBounds([ba[0][0],ba[0][1],ba[1][0],ba[1][1]],{padding:100,speed:1.2})}}Or.current=kt,ja.current=la},[kt,la,Pt,Ne.coords]),(0,Bt.useEffect)(()=>{Kt.current&&!Ze.current&&Ne.coords&&qe.current&&qe.current.easeTo({center:Ne.coords,duration:50,easing:Gt=>Gt,essential:!0})},[Ne.coords]);let nr=cv(kt,J?Ne.coords:null),Et=ft?.currentDistanceMeters??null,ua=ft?.totalDistance??null,Jr=ft?.route?.durationSeconds??null,Yo=Et??0,Io=(()=>{if(!Jr||!ua||!Et)return 0;let Gt=Et/ua;return Math.ceil(Jr*Gt/60)})(),el=Yo/1e3,ts=ua&&ua>0?Math.min(100,Math.max(0,(ua-Yo)/ua*100)):0,tl=ft&&kt?{distanceRemainingKm:el,etaMins:Io,label:la==="navigation"?"Walking Guidance Active":"Route Preview",mode:la,onAbort:()=>{Qe(!0),gt(null),er.navigation.abort(),ge&&ge()},onStart:ft.start,progress:ts}:void 0,Cn=Fe?.setEtaData;(0,Bt.useEffect)(()=>{Cn&&Cn(tl)},[tl,Cn]);let Vi=Fe?.setDrawerState;(0,Bt.useEffect)(()=>{Vi&&ve!==void 0&&Vi(ve)},[ve,Vi]);let io=(0,Bt.useMemo)(()=>[{icon:(0,dr.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,dr.jsx)("path",{d:"M12 11c0 3.517-1.009 6.799-2.753 9.571m-3.44-2.04l.054-.09A13.916 13.916 0 008 11a4 4 0 118 0c0 1.017-.07 2.019-.203 3m-2.118 6.844A21.88 21.88 0 0015.171 17m3.839 1.132c.645-2.266.99-4.659.99-7.132A8 8 0 008 4.07M3 15.364c.64-1.319 1-2.8 1-4.364 0-1.457.39-2.823 1.07-4",strokeLinecap:"round",strokeLinejoin:"round"})}),id:"walking",label:"Walking Mode",onPress:()=>{}}],[]),mi=Z||io,{mapLibreChildren:Ln,menuContentFromChildren:hu}=(0,Bt.useMemo)(()=>{let Gt=[],Fr=[];Bt.default.Children.forEach(s,ba=>{if(Bt.default.isValidElement(ba)){let mr=ba.type,It=mr?.displayName||mr?.name,Ir=mr===Pp||It==="MapMenu",en=Ir||mr===Z0||mr===W0||mr===X0||mr===$0||["MapMenuItem","MapMenuTitle","MapMenuDivider","MapMenuFooter"].includes(It);Ir?Bt.default.Children.forEach(ba.props.children,pu=>{pu&&Fr.push(pu)}):en?Fr.push(ba):Gt.push(ba)}else Gt.push(ba)});let Se=Fr.length>0?(0,dr.jsx)(Pp,{children:Fr}):null;return{mapLibreChildren:Gt,menuContentFromChildren:Se}},[s]),Ko=Gt=>{let Fr=Gt.features||[];if(pe){let ba=Fr.find(mr=>mr.layer.id==="sdk-poi-layer");if(ba){pe(ba.properties);return}}Fr.some(ba=>La.includes(ba.layer.id))||D&&D(Gt),I&&I(Gt)},gi=(0,Bt.useCallback)(Gt=>{Ne.coords&&qe.current&&(Pt(!0),Ze.current=!0,qe.current.flyTo({center:Ne.coords,duration:1e3,essential:!0,pitch:Gt?.pitch||0,zoom:Math.max(qe.current.getZoom(),16)}),setTimeout(()=>{Ze.current=!1},1050))},[Ne.coords,Pt]),Qo=(0,Bt.useCallback)(Gt=>{qe.current&&qe.current.easeTo({bearing:0,duration:500,essential:!0,pitch:Gt?.pitch??0})},[]);(0,Bt.useEffect)(()=>{Fe&&(Fe._registerCenterCallback(gi),Fe._registerResetBearingCallback(Qo))},[Fe,gi,Qo]);let Jo=(0,Bt.useCallback)(()=>{qe.current&&Fe&&(Fe.setBearing(qe.current.getBearing()),Fe.setPitch(qe.current.getPitch()))},[Fe]),Mo=()=>{Kt.current&&(console.log("[SDK:Map] Manual interaction detected. Halting tracking."),Pt(!1),qe.current&&qe.current.stop())};return(0,dr.jsxs)("div",{className:`w-full h-full overflow-hidden relative ${f}`,style:i,children:[(0,dr.jsxs)(bv,{attributionControl:!1,initialViewState:a,interactiveLayerIds:La,mapStyle:u,maxBounds:m,onClick:Ko,onContextMenu:q,onDragStart:Mo,onLoad:Gt=>{te&&te(Gt),ae&&Ne.coords&&qe.current&&qe.current.jumpTo({center:Ne.coords,zoom:16})},onMouseDown:Mo,onMove:Jo,onTouchStart:Mo,onWheel:Mo,ref:qe,children:[J&&Ne.coords&&(Ie?Ie({coords:Ne.coords,heading:Ne.heading}):(0,dr.jsx)(nL,{forcedLocation:Ne.coords,heading:Ne.heading})),nr&&(0,dr.jsx)(wv,{geometry:nr}),ye.length>0&&(0,dr.jsxs)(dr.Fragment,{children:[(0,dr.jsx)(iL,{pois:ye}),(0,dr.jsx)(oL,{onClick:pe,pois:ye})]}),Ln]}),H&&Fe&&!Fe.hasControls&&(0,dr.jsx)(sv,{drawerContentRef:De,enableTouchDrag:Re,etaData:tl,initialViewState:a,isInternal:!0,menuContent:K||hu,menuItems:mi,...et})]})},QD=({children:a})=>(0,Bt.useContext)(jn)?(0,dr.jsx)(dr.Fragment,{children:a}):(0,dr.jsx)(nv,{children:a}),Cv=a=>(0,dr.jsx)(QD,{children:(0,dr.jsx)(dv,{children:(0,dr.jsx)(KD,{...a})})});var k4=Ue(nt(),1),z4=Ue(D4(),1);function rw(a,i={}){let u=document.getElementById(a);if(!u)throw new Error(`Container with id "${a}" not found.`);let f=(0,z4.createRoot)(u);return f.render(k4.default.createElement(Cv,i)),f}var ky={createErrorResponse(a,i,u){return{error:{code:i,message:u},requestId:a.requestId,sdkVersion:a.sdkVersion,success:!1,type:"SDK_ROUTING_GETROUTE_RESPONSE"}},decodePolyline(a,i){let u=0,f=0,m=0,s=[],I=10**i;for(;u<a.length;){let D,q=0,j=0;do D=a.charCodeAt(u++)-63,j|=(D&31)<<q,q+=5;while(D>=32);let te=j&1?~(j>>1):j>>1;f+=te,q=0,j=0;do D=a.charCodeAt(u++)-63,j|=(D&31)<<q,q+=5;while(D>=32);let J=j&1?~(j>>1):j>>1;m+=J,s.push([m/I,f/I])}return s},async fetchOSRMRoute(a,i,u,f){let m=i.map(J=>`${J[0]},${J[1]}`).join(";"),I=`${f}/route/v1/${u==="walking"?"foot":u==="driving"?"car":"bike"}/${m}?overview=full&geometries=geojson&steps=true`,D=await fetch(I);if(!D.ok)throw new Error(`OSRM Error: ${D.statusText}`);let q=await D.json();if(q.code!=="Ok"||!q.routes||q.routes.length===0)throw new Error("NO_ROUTE");let j=q.routes[0],te=j.legs?.flatMap(J=>J.steps?.map(ae=>({distance:ae.distance,duration:ae.duration,instruction:ae.maneuver?.instruction||"Continue"})))||[];return{data:{distanceMeters:j.distance,durationSeconds:j.duration,geometry:j.geometry,steps:te},requestId:a.requestId,sdkVersion:a.sdkVersion,success:!0,type:"SDK_ROUTING_GETROUTE_RESPONSE"}},async fetchRoute(a,i){let{origin:u,destination:f,waypoints:m,profile:s,language:I}=a.payload;if(!this.isValidCoordinate(u)||!this.isValidCoordinate(f))return this.createErrorResponse(a,"INVALID_INPUT","Origin or destination coordinates are invalid.");if(m&&!m.every(this.isValidCoordinate))return this.createErrorResponse(a,"INVALID_INPUT","One or more waypoints are invalid.");let D=[u,...m||[],f];try{return i.backend==="osrm"?await this.fetchOSRMRoute(a,D,s,i.baseUrl):await this.fetchValhallaRoute(a,D,s,I,i.baseUrl)}catch(q){return q instanceof Error&&q.message.includes("NO_ROUTE")?this.createErrorResponse(a,"NO_ROUTE","No route could be found for the given points."):q instanceof TypeError?this.createErrorResponse(a,"NETWORK_ERROR","Failed to connect to the routing backend."):this.createErrorResponse(a,"BACKEND_ERROR",`Routing backend error: ${q instanceof Error?q.message:"Unknown error"}`)}},async fetchValhallaRoute(a,i,u,f,m){let I={costing:u==="driving"?"auto":u==="walking"?"pedestrian":"bicycle",directions_options:{language:f||"en-US"},locations:i.map(ae=>({lat:ae[1],lon:ae[0]}))},D=await fetch(`${m}/route`,{body:JSON.stringify(I),headers:{"Content-Type":"application/json"},method:"POST"});if(!D.ok)throw new Error(`Valhalla Error: ${D.statusText}`);let q=await D.json();if(!q.trip||!q.trip.legs||q.trip.legs.length===0)throw new Error("NO_ROUTE");let j=q.trip,te=this.decodePolyline(j.legs[0].shape,6),J=j.legs.flatMap(ae=>ae.maneuvers?.map(Q=>({distance:Q.length*1e3,duration:Q.time,instruction:Q.instruction||"Continue"})))||[];return{data:{distanceMeters:j.summary.length*1e3,durationSeconds:j.summary.time,geometry:{coordinates:te,type:"LineString"},steps:J},requestId:a.requestId,sdkVersion:a.sdkVersion,success:!0,type:"SDK_ROUTING_GETROUTE_RESPONSE"}},isValidCoordinate(a){let[i,u]=a;return i>=-180&&i<=180&&u>=-90&&u<=90}};var Om="0.2.5";function B4(a){let i=Object.getOwnPropertyNames(a);for(let u of i){let f=a[u];f&&typeof f=="object"&&!Object.isFrozen(f)&&!(f instanceof wp)&&B4(f)}return Object.freeze(a)}var iw=null,Fm=class{maps=Object.freeze({render:rw});bridge;storage=Object.freeze({get:i=>this.bridge.send("STORAGE_GET",{key:i}),getAll:()=>this.bridge.send("STORAGE_GET_ALL"),set:(i,u)=>this.bridge.send("STORAGE_SET",{key:i,value:u})});secureStore=Object.freeze({get:i=>this.bridge.send("SECURE_GET",{key:i}),set:(i,u)=>this.bridge.send("SECURE_SET",{key:i,value:u})});database=Object.freeze({getUserData:()=>this.bridge.send("DATABASE_GET_USER_DATA"),setUserData:i=>this.bridge.send("DATABASE_SET_USER_DATA",{data:i})});location=Object.freeze({getCurrentPosition:()=>this.bridge.send("GET_CURRENT_POSITION"),startStream:i=>this.bridge.send("START_LOCATION_STREAM",i),stopStream:()=>this.bridge.send("STOP_LOCATION_STREAM")});user=Object.freeze({getProfile:i=>this.bridge.send("GET_USER_PROFILE",{fields:i}),getProfilePicture:(i=>this.bridge.send("GET_PROFILE_PICTURE",{uuids:i||[]}))});permission=Object.freeze({request:((i,u)=>this.bridge.send("REQUEST_PERMISSION",{fields:u,type:i}))});payment=Object.freeze({request:i=>this.bridge.send("PAYMENT_REQUEST",i)});activity=Object.freeze({start:(i,u,f)=>this.bridge.send("START_ACTIVITY",{id:i,status:f,title:u})});haptic=Object.freeze({trigger:i=>this.bridge.send("TRIGGER_HAPTIC",{style:i})});network=Object.freeze({request:async i=>this.bridge.send("NETWORK_REQUEST",i)});navigation=Object.freeze({abort:()=>{this.bridge.handleNativeMessage({eventName:"SDK_NAVIGATION_ABORT",type:"EVENT"})},createJourney:i=>{this.bridge.handleNativeMessage({eventName:"SDK_NAVIGATION_CREATE",payload:{...i,mode:"preview"},type:"EVENT"})},start:()=>{this.bridge.handleNativeMessage({eventName:"SDK_NAVIGATION_START",type:"EVENT"})}});fidelity=Object.freeze({getFidelityBalance:()=>this.bridge.send("GET_FIDELITY_BALANCE"),getFidelityHistory:i=>this.bridge.send("GET_FIDELITY_HISTORY",i),showHistory:()=>this.bridge.send("SHOW_FIDELITY_HISTORY"),spendFPoints:i=>this.bridge.send("SPEND_FPOINTS",{intentUuid:i})});ui=Object.freeze({exit:()=>this.bridge.send("EXIT"),setScrollConfig:i=>this.bridge.send("SET_SCROLL_CONFIG",i)});debug=Object.freeze({log:(...i)=>this.bridge.send("DEBUG_LOG",{message:i})});routing=Object.freeze({clearRoute:()=>{let i=crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).substring(2);return this.bridge.send("SDK_ROUTING_CLEARROUTE",{requestId:i,sdkVersion:Om})},drawRoute:i=>{let u=crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).substring(2);return this.bridge.send("SDK_ROUTING_DRAWROUTE",{payload:{routeData:i},requestId:u,sdkVersion:Om})},getRoute:async i=>{let u=crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).substring(2),f={payload:i,requestId:u,sdkVersion:Om,type:"SDK_ROUTING_GETROUTE"};if(iw){let m=await ky.fetchRoute(f,iw);if(m.success&&m.data)return m.data;throw new Error(m.error?.message||"Routing failed")}return this.bridge.send("SDK_ROUTING_GETROUTE",{payload:i,requestId:u,sdkVersion:Om})}});constructor(){this.bridge=new wp,this.initialize=this.initialize.bind(this),this.on=this.on.bind(this),this.off=this.off.bind(this)}config(i){i.routingBackend&&(iw=i.routingBackend)}updateContext(i){return this.bridge.send("UPDATE_CONTEXT",i)}initialize(i){return this.bridge.send("INITIALIZE",i)}on(i,u){return this.bridge.on(i,u)}off(i,u){this.bridge.off(i,u)}},er=B4(new Fm);var pr=Ue(nt(),1),Ot=Ue(Mt(),1),T8=(a,i)=>{let u=a[1]*Math.PI/180,f=i[1]*Math.PI/180,m=(i[0]-a[0])*Math.PI/180,s=Math.sin(m)*Math.cos(f),I=Math.cos(u)*Math.sin(f)-Math.sin(u)*Math.cos(f)*Math.cos(m);return(Math.atan2(s,I)*180/Math.PI+360)%360},ow=({appId:a,initialLocation:i=[6.1258,45.9058],isMoving:u=!1,simulationPath:f,simulationSpeed:m=1,mockJWTToken:s,children:I})=>{let[D,q]=(0,pr.useState)(u),[j,te]=(0,pr.useState)(i),[J,ae]=(0,pr.useState)(0),[Q,Ie]=(0,pr.useState)(m),[ye,pe]=(0,pr.useState)(!1),[ue,re]=(0,pr.useState)(!0),fe=(0,pr.useRef)(null),ge=(0,pr.useRef)(0),Pe=(0,pr.useRef)(null),Le=(0,pr.useRef)({autoMove:D,heading:J,location:j,mockJWTToken:s,pushLocationUpdate:()=>{},setHeading:ae,setLocation:te,simulationPath:f,speedMultiplier:Q}),H=(0,pr.useCallback)(()=>{let Z=Le.current,K={accelerometer:null,heading:{accuracy:3,magneticHeading:Z.heading,trueHeading:Z.heading},location:{coords:{accuracy:10,altitude:0,altitudeAccuracy:null,heading:Z.heading,latitude:Z.location[1],longitude:Z.location[0],speed:Z.autoMove?1.5*Z.speedMultiplier:0},timestamp:Date.now()},timestamp:Date.now()};window.__MiniAppBridge?.onNativeMessage({eventName:"LOCATION_STREAM_UPDATE",payload:K,type:"EVENT"})},[]);return(0,pr.useEffect)(()=>{Le.current={autoMove:D,heading:J,location:j,mockJWTToken:s,pushLocationUpdate:H,setHeading:ae,setLocation:te,simulationPath:f,speedMultiplier:Q}},[j,J,D,H,f,Q,s]),(0,pr.useEffect)(()=>{q(u)},[u]),(0,pr.useEffect)(()=>{Ie(m)},[m]),(0,pr.useEffect)(()=>{f&&f.length>0&&(ge.current=0,te(f[0]))},[f]),(0,pr.useEffect)(()=>{fe.current&&Pe.current&&er.bridge.send("START_LOCATION_STREAM",Pe.current)},[Q]),(0,pr.useEffect)(()=>{let Z=er.bridge,K=Z.send.bind(Z),ve=()=>{fe.current&&(clearInterval(fe.current),fe.current=null),Pe.current=null},De=Re=>{ve(),Pe.current=Re||{};let Fe=Re?.interval||500,qe=Math.max(10,Fe/Le.current.speedMultiplier);fe.current=setInterval(()=>{let Ne=Le.current;if(Ne.autoMove)if(Ne.simulationPath&&Ne.simulationPath.length>0)if(ge.current<Ne.simulationPath.length-1){let Xe=Ne.simulationPath[ge.current],gt=Ne.simulationPath[ge.current+1];ge.current+=1;let xt=T8(Xe,gt);Ne.setHeading(xt),Ne.setLocation(gt)}else Ne.setLocation(Ne.simulationPath[Ne.simulationPath.length-1]);else Ne.setLocation(Xe=>[Xe[0]+(Math.random()-.5)*1e-4,Xe[1]+(Math.random()-.5)*1e-4]);Ne.pushLocationUpdate()},qe)},et=async Re=>{let{url:Fe,method:qe="GET",headers:Ne={},body:Xe}=Re,gt=Le.current,xt=new Headers(Ne);gt.mockJWTToken&&xt.set("Authorization",`Bearer ${gt.mockJWTToken.replace("Bearer ","")}`),Xe&&typeof Xe=="object"&&!xt.has("Content-Type")&&xt.set("Content-Type","application/json");try{let Qe=await fetch(Fe,{body:Xe?typeof Xe=="string"?Xe:JSON.stringify(Xe):void 0,headers:xt,method:qe}),qt=Qe.headers.get("content-type"),ga;qt?.includes("application/json")?ga=await Qe.json():ga=await Qe.text();let Va={};return Qe.headers.forEach((ut,ft)=>{Va[ft]=ut}),{data:ga,headers:Va,status:Qe.status,statusText:Qe.statusText}}catch(Qe){throw{error:Qe.message||"Network request failed",status:0}}};return Z.send=async(Re,Fe)=>{if(Re==="INITIALIZE")return Promise.resolve({appId:a,context:{theme:"dark"},description:"Mocked for Dev",env:{},insets:{bottom:0,left:0,right:0,top:0},name:"Vite Dev (Mock)",params:{},profile:{countryCode:"FR",email:"caveman@up.app",fullName:"Smart Caveman",localNumber:"0600000000",username:"smart_caveman",uuid:"mock-user-42"},success:!0,userData:{},uuid:a||"mock-app-id",version:"1.0.0"});if(Re==="GET_CURRENT_POSITION"){let qe=Le.current;return Promise.resolve({coords:{accuracy:10,altitude:0,altitudeAccuracy:0,heading:qe.heading,latitude:qe.location[1],longitude:qe.location[0],speed:qe.autoMove?1.5*qe.speedMultiplier:0},timestamp:Date.now()})}if(Re==="START_LOCATION_STREAM")return De(Fe),Promise.resolve();if(Re==="STOP_LOCATION_STREAM")return ve(),Promise.resolve();if(Re==="NETWORK_REQUEST")return et(Fe);if(Re==="STORAGE_GET"||Re==="SECURE_GET")return Promise.resolve(localStorage.getItem(`mock_sdk_${Fe.key}`));if(Re==="STORAGE_SET"||Re==="SECURE_SET")return localStorage.setItem(`mock_sdk_${Fe.key}`,Fe.value),Promise.resolve();if(Re==="GET_USER_PROFILE")return Promise.resolve({countryCode:"FR",email:"caveman@up.app",fullName:"Smart Caveman",localNumber:"0600000000",username:"smart_caveman",uuid:"mock-user-42"});if(Re==="GET_PROFILE_PICTURE"){let qe=Fe?.uuids||[];if(qe.length===0)return Promise.resolve("https://api.dicebear.com/9.x/rings/png?seed=dummy");let Ne={};for(let Xe of qe)Ne[Xe]=`https://api.dicebear.com/9.x/rings/png?seed=${Xe}`;return Promise.resolve(Ne)}return Re==="GET_FIDELITY_BALANCE"?Promise.resolve({balance:1337,currency:"FPoints"}):Re==="PAYMENT_REQUEST"?Promise.resolve({success:!0,transactionId:`tx_${Math.random().toString(36).slice(2)}`}):Re==="TRIGGER_HAPTIC"||Re==="EXIT"||Re==="UPDATE_CONTEXT"?Promise.resolve({success:!0}):K(Re,Fe)},pe(!0),()=>{ve(),Z.send=K}},[a]),ye?(0,Ot.jsxs)("div",{className:"relative w-full h-full",children:[(0,Ot.jsx)("div",{className:"w-full h-full",children:I}),ue?(0,Ot.jsx)(Oa,{className:"fixed bottom-4 right-4 w-8 h-8 rounded-full bg-slate-900/60 backdrop-blur-sm border border-slate-700/50 flex items-center justify-center text-slate-400 hover:text-blue-400 hover:bg-slate-900/80 z-[9999] transition-all shadow-lg group p-0!",onClick:()=>re(!1),title:"Open Simulation Controls",type:"button",variant:"ghost",children:(0,Ot.jsxs)("svg",{className:"group-hover:scale-110 transition-transform",fill:"none",height:"14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"14",xmlns:"http://www.w3.org/2000/svg",children:[(0,Ot.jsx)("path",{d:"M21 4H3"}),(0,Ot.jsx)("path",{d:"M10 8H3"}),(0,Ot.jsx)("path",{d:"M21 12H3"}),(0,Ot.jsx)("path",{d:"M10 16H3"}),(0,Ot.jsx)("path",{d:"M21 20H3"}),(0,Ot.jsx)("circle",{cx:"14",cy:"8",r:"2"}),(0,Ot.jsx)("circle",{cx:"14",cy:"16",r:"2"})]})}):(0,Ot.jsxs)("div",{className:"fixed bottom-4 right-4 bg-slate-900 text-slate-300 font-mono text-xs rounded-xl shadow-2xl border border-slate-700 pointer-events-auto flex flex-col w-80 overflow-hidden animate-in slide-in-from-right duration-300",style:{zIndex:9998},children:[(0,Ot.jsxs)("div",{className:"flex justify-between items-center p-3 border-b border-slate-800 cursor-pointer bg-slate-800/50 hover:bg-slate-800 transition-colors",onClick:()=>re(!0),children:[(0,Ot.jsxs)("span",{className:"font-bold text-slate-100 flex items-center gap-2",children:[(0,Ot.jsx)("span",{className:"text-lg",children:"\u{1F6E0}\uFE0F"})," Simulation Controls"]}),(0,Ot.jsx)(Oa,{className:"text-slate-500 hover:text-white p-0 h-auto hover:bg-transparent cursor-pointer",type:"button",variant:"ghost",children:"\u25BC"})]}),(0,Ot.jsxs)("div",{className:"p-4 flex flex-col gap-3",children:[(0,Ot.jsxs)("div",{className:"flex justify-between items-center",children:[(0,Ot.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,Ot.jsx)("input",{checked:D,className:"accent-blue-500 w-4 h-4",onChange:Z=>q(Z.target.checked),type:"checkbox"}),(0,Ot.jsxs)("span",{className:"text-slate-200 font-bold",children:["Auto-Move ",f?"(Path)":"(Random)"]})]}),(0,Ot.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ot.jsx)("span",{className:"text-[10px] text-slate-500",children:"Speed:"}),(0,Ot.jsx)("select",{className:"bg-slate-800 border border-slate-700 rounded px-1 py-0.5 text-white focus:outline-none focus:border-blue-500 text-[10px]",onChange:Z=>Ie(Number(Z.target.value)),value:Q,children:[1,2,5,10,50,100,250].map(Z=>(0,Ot.jsxs)("option",{value:Z,children:[Z,"x"]},Z))})]})]}),(0,Ot.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,Ot.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Ot.jsx)("span",{className:"text-[10px] text-slate-500 text-left",children:"Lng"}),(0,Ot.jsx)("input",{className:"bg-slate-800 border border-slate-700 rounded px-2 py-1 text-white focus:outline-none focus:border-blue-500",onChange:Z=>{let K=parseFloat(Z.target.value)||0;te([K,j[1]]),H()},step:"0.001",type:"number",value:j[0]})]}),(0,Ot.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Ot.jsx)("span",{className:"text-[10px] text-slate-500 text-left",children:"Lat"}),(0,Ot.jsx)("input",{className:"bg-slate-800 border border-slate-700 rounded px-2 py-1 text-white focus:outline-none focus:border-blue-500",onChange:Z=>{let K=parseFloat(Z.target.value)||0;te([j[0],K]),H()},step:"0.001",type:"number",value:j[1]})]}),(0,Ot.jsxs)("div",{className:"flex flex-col gap-1 col-span-2",children:[(0,Ot.jsx)("span",{className:"text-[10px] text-slate-500",children:"Heading (Degrees)"}),(0,Ot.jsx)("input",{className:"w-full accent-blue-500",max:"360",min:"0",onChange:Z=>{ae(parseInt(Z.target.value,10)),H()},type:"range",value:J}),(0,Ot.jsxs)("div",{className:"text-right text-slate-400",children:[J,"\xB0"]})]})]})]})]})]}):null};var es=Ue(nt(),1),ma=Ue(Mt(),1),nw=({isOpen:a=!1,onClose:i})=>{let[u,f]=(0,es.useState)(a),[m,s]=(0,es.useState)([]),I=(0,es.useRef)(null);(0,es.useEffect)(()=>{f(a)},[a]);let D=()=>s([]),q=(0,es.useCallback)((j,te)=>{if(j.includes("LOCATION_STREAM_UPDATE"))return;let J={content:typeof te=="string"?te:JSON.stringify(te,null,2),id:Math.random().toString(36).slice(2),label:j,time:new Date().toLocaleTimeString()};s(ae=>[J,...ae].slice(0,100))},[]);return(0,es.useEffect)(()=>{if(typeof window>"u")return;let j=er.bridge,te=j.send.bind(j);j.send=async(ae,Q)=>(q(`OUT: ${ae}`,Q),te(ae,Q));let J=j.handleNativeMessage.bind(j);return j.handleNativeMessage=ae=>{let Q=ae.eventName||ae.event||ae.type||"MSG";typeof Q=="string"&&(q(`IN: ${Q}`,ae.payload||ae.value||ae),J(ae))},()=>{j.send=te,j.handleNativeMessage=J}},[q]),u?(0,ma.jsxs)("div",{className:"fixed inset-x-0 bottom-0 w-full bg-[#0a080f] border-t border-slate-800 z-[9998] p-4 shadow-2xl flex flex-col animate-in slide-in-from-bottom duration-300",children:[(0,ma.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,ma.jsxs)("span",{className:"text-[10px] font-bold uppercase tracking-widest text-slate-400 flex items-center gap-2",children:[(0,ma.jsx)("span",{className:"w-2 h-2 rounded-full bg-emerald-500 animate-pulse"}),"UP SDK Debug Console"]}),(0,ma.jsxs)("div",{className:"flex gap-4",children:[(0,ma.jsx)(Oa,{className:"text-[10px] text-slate-500 font-bold uppercase hover:text-slate-300 hover:bg-transparent transition-colors p-0 h-auto cursor-pointer",onClick:D,type:"button",variant:"ghost",children:"Clear"}),(0,ma.jsx)(Oa,{className:"text-[10px] text-pink-500 font-bold uppercase hover:text-pink-400 hover:bg-transparent transition-colors p-0 h-auto cursor-pointer",onClick:()=>{f(!1),i&&i()},type:"button",variant:"ghost",children:"Close"})]})]}),(0,ma.jsx)("div",{className:"bg-black/80 rounded-xl p-3 font-mono text-[10px] text-emerald-400 min-h-[120px] max-h-[240px] overflow-y-auto border border-slate-900 custom-scrollbar",ref:I,children:m.length===0?(0,ma.jsx)("div",{className:"text-slate-600 italic text-center py-8",children:"No logs yet. Interacting with the SDK will show events here."}):m.map(j=>(0,ma.jsxs)("div",{className:"mb-3 pb-3 border-b border-slate-900/50 last:border-0 last:mb-0 last:pb-0",children:[(0,ma.jsxs)("div",{className:"flex gap-2 text-slate-500 mb-1 items-center",children:[(0,ma.jsx)("span",{className:"text-[8px]",children:j.time}),(0,ma.jsx)("span",{className:"font-bold text-white uppercase text-[8px] bg-slate-800 px-1.5 py-0.5 rounded leading-none",children:j.label})]}),(0,ma.jsx)("pre",{className:"whitespace-pre-wrap break-all opacity-90",children:j.content})]},j.id))})]}):(0,ma.jsx)(Oa,{className:"fixed bottom-4 left-4 w-8 h-8 rounded-full bg-slate-900/60 backdrop-blur-sm border border-slate-700/50 flex items-center justify-center text-slate-400 hover:text-emerald-400 hover:bg-slate-900/80 transition-all z-[9998] shadow-lg group p-0!",onClick:()=>f(!0),title:"Open Debug Console",type:"button",variant:"ghost",children:(0,ma.jsxs)("svg",{className:"group-hover:scale-110 transition-transform",fill:"none",height:"14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"14",xmlns:"http://www.w3.org/2000/svg",children:[(0,ma.jsx)("path",{d:"m8 2 1.88 1.88"}),(0,ma.jsx)("path",{d:"M14.12 3.88 16 2"}),(0,ma.jsx)("path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1"}),(0,ma.jsx)("path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6"}),(0,ma.jsx)("path",{d:"M12 20v-9"}),(0,ma.jsx)("path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5"}),(0,ma.jsx)("path",{d:"M6 13H2"}),(0,ma.jsx)("path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4"}),(0,ma.jsx)("path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4"}),(0,ma.jsx)("path",{d:"M22 13h-4"}),(0,ma.jsx)("path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4"})]})})};var th=Ue(nt(),1);var Js=Ue(Mt(),1),sw=(0,th.createContext)({isMocked:!1}),I8=()=>(0,th.useContext)(sw).isMocked,M8=({children:a,debug:i=!1,...u})=>{let f=typeof window<"u"&&!(window.__UP_REACT_NATIVE_APP__===!0||window.ReactNativeWebView),m=(0,th.useMemo)(()=>({isMocked:f}),[f]),s=(0,Js.jsxs)(Js.Fragment,{children:[a,(i||f)&&(0,Js.jsx)(nw,{})]});return f?(0,Js.jsx)(sw.Provider,{value:m,children:(0,Js.jsx)(ow,{...u,children:s})}):(0,Js.jsx)(sw.Provider,{value:m,children:s})};async function E8(a,i){return ky.fetchRoute(a,i)}function A8(a,i,u){let f=`sdk-route-${i}`,m=`sdk-route-casing-${i}`,s=`sdk-route-line-${i}`,I={features:[{geometry:u.payload.routeData.geometry,properties:{},type:"Feature"}],type:"FeatureCollection"},D=a.getSource(f);D?D.setData(I):(a.addSource(f,{data:I,type:"geojson"}),a.addLayer({id:m,layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#111111","line-opacity":.8,"line-width":8},source:f,type:"line"}),a.addLayer({id:s,layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#3b82f6","line-width":4},source:f,type:"line"}))}function P8(a,i){let u=`sdk-route-${i}`,f=`sdk-route-casing-${i}`,m=`sdk-route-line-${i}`;a.getLayer(m)&&a.removeLayer(m),a.getLayer(f)&&a.removeLayer(f),a.getSource(u)&&a.removeSource(u)}var R8=er;return O6(D8);})();
|
|
856
|
+
`}),(0,At.jsx)("div",{className:`absolute inset-0 bg-black/45 backdrop-blur-[1px] transition-opacity duration-300 z-30 ${gt}`,onClick:()=>u("closed")}),f==="left"?(0,At.jsxs)(At.Fragment,{children:[i==="closed"&&(0,At.jsx)(Oa,{className:"absolute top-4 left-4 z-40 w-12 h-12 rounded-full bg-zinc-950/80 backdrop-blur-md border border-white/10 shadow-lg flex items-center justify-center text-white active:scale-95 transition-all cursor-pointer hover:bg-zinc-900 hover:text-white p-0!",onClick:()=>u("full"),variant:"ghost",children:(0,At.jsxs)("svg",{fill:"none",height:"24",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:[(0,At.jsx)("line",{x1:"4",x2:"20",y1:"12",y2:"12"}),(0,At.jsx)("line",{x1:"4",x2:"20",y1:"6",y2:"6"}),(0,At.jsx)("line",{x1:"4",x2:"20",y1:"18",y2:"18"})]})}),(0,At.jsx)(DC,{onOpenChange:ut=>u(ut?"full":"closed"),open:i!=="closed",children:(0,At.jsxs)(rv,{className:"w-80 bg-zinc-950/85 backdrop-blur-md border-r border-y border-white/10 rounded-r-2xl shadow-2xl p-4 text-white flex flex-col h-full overflow-hidden",portal:!1,side:"left",children:[(0,At.jsx)(iv,{className:"pb-3 border-b border-white/10 mb-2 text-left",children:(0,At.jsx)(ov,{className:"text-sm font-bold tracking-wider text-zinc-400 uppercase",children:"Menu"})}),(0,At.jsx)("div",{className:"flex-1 overflow-y-auto no-scrollbar pr-2",onScroll:ve,ref:Pe,children:ye||(0,At.jsx)("div",{className:"flex flex-col gap-1.5",children:a.map(ut=>(0,At.jsxs)(Oa,{className:`flex items-center gap-3 w-full py-3 px-3.5 rounded-xl text-left cursor-pointer transition-all duration-150 justify-start hover:bg-white/5 hover:text-white active:bg-white/10 text-white ${ut.disabled?"opacity-45 cursor-not-allowed pointer-events-none":""}`,disabled:ut.disabled,onClick:()=>{ut.disabled||(ut.onPress(),u("closed"))},variant:"ghost",children:[(0,At.jsxs)("div",{className:"relative flex items-center justify-center w-8 h-8 rounded-lg bg-white/5 text-zinc-300",children:[ut.icon,ut.badge!==void 0&&(0,At.jsx)("span",{className:"absolute -top-1 -right-1 bg-cyan-500 text-black text-[9px] font-extrabold min-w-[15px] h-3.5 rounded-full flex items-center justify-center px-1 border border-zinc-950 shadow",children:ut.badge})]}),(0,At.jsx)("span",{className:"text-sm font-medium tracking-wide flex-1",children:ut.label})]},ut.id))})}),ue&&Z&&(0,At.jsx)(Oa,{className:"absolute bottom-6 right-6 z-50 flex items-center justify-center w-10 h-10 rounded-full bg-cyan-500 hover:bg-cyan-400 active:scale-95 text-black hover:text-black shadow-lg shadow-cyan-500/25 transition-all duration-200 cursor-pointer p-0!",onClick:()=>{Pe.current?.scrollTo({behavior:"smooth",top:0})},variant:"ghost",children:(0,At.jsx)("svg",{fill:"none",height:"20",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",viewBox:"0 0 24 24",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,At.jsx)("polyline",{points:"18 15 12 9 6 15"})})})]})})]}):(0,At.jsxs)("div",{className:`absolute w-full bg-zinc-950/85 backdrop-blur-md border border-white/10 rounded-t-2xl shadow-2xl flex flex-col z-40 select-none ${te?"transition-none":"transition-transform duration-300 ease-out"}`,ref:Le,style:{bottom:"0px",height:typeof Q=="number"?`${Q}px`:Q||"85%",marginBottom:i==="closed"?`${fe.bottom}px`:"0px",transform:Va(),transition:te?"none":"transform 300ms ease-out, margin-bottom 250ms ease-in-out"},children:[(0,At.jsx)("div",{className:"w-full h-8 flex flex-col items-center justify-center cursor-pointer hover:bg-white/5 rounded-t-2xl transition-colors border-b border-white/5",onClick:H,children:(0,At.jsx)("div",{className:"w-12 h-1 bg-white/25 rounded-full"})}),(0,At.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden px-4 pb-4 pt-2 transition-[margin-top] duration-250 ease-in-out relative",style:{marginTop:i==="closed"?`${fe.bottom}px`:"0px"},children:[(0,At.jsx)("div",{className:"flex-1 overflow-y-auto no-scrollbar",onScroll:ve,ref:Pe,style:{paddingBottom:i==="peek"?`${ga}px`:"0px"},children:ye||(0,At.jsx)("div",{className:"flex flex-col gap-1",children:a.map(ut=>(0,At.jsxs)(Oa,{className:`flex items-center gap-3 w-full py-3 px-3.5 rounded-xl text-left cursor-pointer transition-all duration-150 justify-start hover:bg-white/5 hover:text-white active:bg-white/10 text-white ${ut.disabled?"opacity-45 cursor-not-allowed pointer-events-none":""}`,disabled:ut.disabled,onClick:()=>{ut.disabled||(ut.onPress(),u("closed"))},variant:"ghost",children:[(0,At.jsxs)("div",{className:"relative flex items-center justify-center w-8 h-8 rounded-lg bg-white/5 text-zinc-300",children:[ut.icon,ut.badge!==void 0&&(0,At.jsx)("span",{className:"absolute -top-1 -right-1 bg-cyan-500 text-black text-[9px] font-extrabold min-w-[15px] h-3.5 rounded-full flex items-center justify-center px-1 border border-zinc-950 shadow",children:ut.badge})]}),(0,At.jsx)("span",{className:"text-sm font-medium tracking-wide",children:ut.label})]},ut.id))})}),ue&&Z&&(0,At.jsx)(Oa,{className:"absolute right-6 z-50 flex items-center justify-center w-10 h-10 rounded-full bg-cyan-500 hover:bg-cyan-400 active:scale-95 text-black hover:text-black shadow-lg shadow-cyan-500/25 transition-all duration-200 cursor-pointer p-0!",onClick:()=>{Pe.current?.scrollTo({behavior:"smooth",top:0})},style:{bottom:i==="peek"?`calc(${24+ga}px + var(--drag-offset, 0px))`:"calc(24px + var(--drag-offset, 0px))"},variant:"ghost",children:(0,At.jsx)("svg",{fill:"none",height:"20",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",viewBox:"0 0 24 24",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,At.jsx)("polyline",{points:"18 15 12 9 6 15"})})})]})]})]})});var uc=Ue(nt(),1),cc=Ue(Mt(),1),G0=uc.forwardRef(({className:a,...i},u)=>(0,cc.jsx)("div",{className:wi("rounded-lg border bg-card text-card-foreground shadow-sm",a),ref:u,...i}));G0.displayName="Card";var mD=uc.forwardRef(({className:a,...i},u)=>(0,cc.jsx)("div",{className:wi("flex flex-col space-y-1.5 p-6",a),ref:u,...i}));mD.displayName="CardHeader";var gD=uc.forwardRef(({className:a,...i},u)=>(0,cc.jsx)("div",{className:wi("text-2xl font-semibold leading-none tracking-tight",a),ref:u,...i}));gD.displayName="CardTitle";var yD=uc.forwardRef(({className:a,...i},u)=>(0,cc.jsx)("div",{className:wi("text-sm text-muted-foreground",a),ref:u,...i}));yD.displayName="CardDescription";var H0=uc.forwardRef(({className:a,...i},u)=>(0,cc.jsx)("div",{className:wi("p-6 pt-0",a),ref:u,...i}));H0.displayName="CardContent";var _D=uc.forwardRef(({className:a,...i},u)=>(0,cc.jsx)("div",{className:wi("flex items-center p-6 pt-0",a),ref:u,...i}));_D.displayName="CardFooter";var lt=Ue(Mt(),1),BC=({etaData:a,layoutMode:i,onHeaderClick:u,style:f,isDragging:m=!1})=>i==="closed-banner"?(0,lt.jsxs)("div",{className:"w-full h-10 flex items-center justify-between px-4 pb-2 pt-1 border-b border-white/5 bg-zinc-950/15 relative overflow-hidden",children:[(0,lt.jsxs)("div",{className:"flex items-center gap-2 cursor-pointer flex-1",onClick:u,children:[(0,lt.jsx)("span",{className:"w-2 h-2 rounded-full bg-emerald-500 animate-pulse"}),(0,lt.jsxs)("span",{className:"text-xs font-bold text-emerald-400",children:[a.etaMins," min (",a.distanceRemainingKm.toFixed(1)," km)"]})]}),a.onAbort&&(0,lt.jsx)(Oa,{className:"px-1 py-1 text-[10px] font-black bg-red-500/20 text-red-400 hover:bg-red-500/30 border border-red-500/25 active:scale-95 rounded-md transition-all cursor-pointer pointer-events-auto h-auto p-0!",onClick:s=>{s.stopPropagation(),a.onAbort?.()},variant:"ghost",children:(0,lt.jsxs)("svg",{className:"lucide lucide-x",fill:"none",height:"18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",viewBox:"0 0 24 24",width:"18",xmlns:"http://www.w3.org/2000/svg",children:[(0,lt.jsx)("path",{d:"M18 6 6 18"}),(0,lt.jsx)("path",{d:"m6 6 12 12"})]})}),a.progress!==void 0&&(0,lt.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-[2px] bg-white/5",children:(0,lt.jsx)("div",{className:"h-full bg-cyan-400",style:{width:`${a.progress}%`}})})]}):i==="open-card"?(0,lt.jsxs)(G0,{className:"mx-4 mt-2 p-4 bg-white/5 border border-white/10 rounded-xl flex flex-col text-card-foreground",children:[(0,lt.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,lt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,lt.jsx)("span",{className:"w-2 h-2 rounded-full bg-emerald-500 animate-pulse"}),(0,lt.jsx)("span",{className:"text-[10px] font-bold text-emerald-400 uppercase tracking-wider",children:a.label||"Journey Active"})]}),a.onAbort&&(0,lt.jsx)(Oa,{className:"px-1 py-1 text-xs font-bold bg-red-500/20 text-red-400 hover:bg-red-500/30 border border-red-500/30 active:scale-95 rounded-lg transition-all cursor-pointer pointer-events-auto h-auto p-0!",onClick:a.onAbort,variant:"ghost",children:(0,lt.jsxs)("svg",{className:"lucide lucide-x",fill:"none",height:"18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",viewBox:"0 0 24 24",width:"18",xmlns:"http://www.w3.org/2000/svg",children:[(0,lt.jsx)("path",{d:"M18 6 6 18"}),(0,lt.jsx)("path",{d:"m6 6 12 12"})]})})]}),(0,lt.jsxs)(H0,{className:"p-0 flex flex-col",children:[(0,lt.jsxs)("div",{className:"grid grid-cols-2 divide-x divide-white/10 py-1.5 mb-2.5",children:[(0,lt.jsxs)("div",{className:"text-center",children:[(0,lt.jsxs)("div",{className:"text-xl font-black text-white leading-none",children:[a.etaMins,(0,lt.jsx)("span",{className:"text-xs text-zinc-400 font-normal",children:" min"})]}),(0,lt.jsx)("div",{className:"text-[8px] text-zinc-500 font-bold uppercase tracking-wider mt-1",children:"Time Remaining"})]}),(0,lt.jsxs)("div",{className:"text-center",children:[(0,lt.jsxs)("div",{className:"text-xl font-black text-white leading-none",children:[a.distanceRemainingKm.toFixed(1),(0,lt.jsx)("span",{className:"text-xs text-zinc-400 font-normal",children:" km"})]}),(0,lt.jsx)("div",{className:"text-[8px] text-zinc-500 font-bold uppercase tracking-wider mt-1",children:"Distance Remaining"})]})]}),a.progress!==void 0&&(0,lt.jsxs)("div",{className:"mb-3",children:[(0,lt.jsxs)("div",{className:"flex justify-between text-[9px] font-bold text-zinc-400 mb-1",children:[(0,lt.jsx)("span",{children:"Progress"}),(0,lt.jsxs)("span",{children:[Math.round(a.progress),"%"]})]}),(0,lt.jsx)("div",{className:"h-1 bg-white/10 rounded-full overflow-hidden",children:(0,lt.jsx)("div",{className:"h-full bg-cyan-400 rounded-full",style:{width:`${a.progress}%`}})})]}),a.mode==="preview"&&a.onStart&&(0,lt.jsx)(Oa,{className:"w-full py-2.5 text-xs font-bold bg-cyan-500 text-black hover:bg-cyan-400 hover:text-black active:scale-95 rounded-lg transition-all cursor-pointer h-auto",onClick:a.onStart,variant:"ghost",children:"Start Guidance"})]})]}):(0,lt.jsxs)(G0,{className:`absolute left-1/2 -translate-x-1/2 z-40 w-[calc(100%-2rem)] max-w-[320px] sm:max-w-[380px] bg-zinc-950/85 backdrop-blur-md border border-white/10 rounded-2xl shadow-2xl p-3 sm:p-4 flex flex-col pointer-events-auto select-none text-card-foreground ${m?"transition-none":"transition-all duration-300 ease-out"}`,style:f,children:[(0,lt.jsxs)("div",{className:"flex items-center justify-between mb-2 sm:mb-3",children:[(0,lt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,lt.jsx)("span",{className:"w-1.5 h-1.5 sm:w-2 sm:h-2 rounded-full bg-emerald-500 animate-pulse"}),(0,lt.jsx)("span",{className:"text-[9px] sm:text-[10px] font-bold text-emerald-400 uppercase tracking-wider",children:a.label||"Guidance Active"})]}),a.onAbort&&(0,lt.jsx)(Oa,{className:"px-1 py-1 text-[10px] sm:text-xs font-bold bg-red-500/20 text-red-400 hover:bg-red-500/30 border border-red-500/30 active:scale-95 rounded-lg transition-all cursor-pointer h-auto p-0!",onClick:a.onAbort,variant:"ghost",children:(0,lt.jsxs)("svg",{className:"lucide lucide-x",fill:"none",height:"18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",viewBox:"0 0 24 24",width:"18",xmlns:"http://www.w3.org/2000/svg",children:[(0,lt.jsx)("path",{d:"M18 6 6 18"}),(0,lt.jsx)("path",{d:"m6 6 12 12"})]})})]}),(0,lt.jsxs)(H0,{className:"p-0 flex flex-col",children:[(0,lt.jsxs)("div",{className:"grid grid-cols-2 divide-x divide-white/10 py-0.5 sm:py-1 mb-2 sm:mb-3",children:[(0,lt.jsx)("div",{className:"text-center",children:(0,lt.jsxs)("div",{className:"text-base sm:text-lg font-black text-white leading-none",children:[a.etaMins,(0,lt.jsxs)("span",{className:"text-[10px] sm:text-xs text-zinc-400 font-normal",children:[" ","min"]})]})}),(0,lt.jsx)("div",{className:"text-center",children:(0,lt.jsxs)("div",{className:"text-base sm:text-lg font-black text-white leading-none",children:[a.distanceRemainingKm.toFixed(1),(0,lt.jsxs)("span",{className:"text-[10px] sm:text-xs text-zinc-400 font-normal",children:[" ","km"]})]})})]}),a.progress!==void 0&&(0,lt.jsxs)("div",{children:[(0,lt.jsxs)("div",{className:"flex justify-between text-[8px] sm:text-[9px] font-bold text-zinc-400 mb-1",children:[(0,lt.jsx)("span",{children:"Progress"}),(0,lt.jsxs)("span",{children:[Math.round(a.progress),"%"]})]}),(0,lt.jsx)("div",{className:"h-1 sm:h-1.5 bg-white/10 rounded-full overflow-hidden",children:(0,lt.jsx)("div",{className:"h-full bg-cyan-400 rounded-full",style:{width:`${a.progress}%`}})})]}),a.mode==="preview"&&a.onStart&&(0,lt.jsx)(Oa,{className:"mt-2.5 sm:mt-3 py-1.5 sm:py-2 text-[11px] sm:text-xs font-bold bg-cyan-500 text-black hover:bg-cyan-400 hover:text-black active:scale-95 rounded-lg transition-all cursor-pointer h-auto",onClick:a.onStart,variant:"ghost",children:"Start Guidance"})]})]});var Zt=Ue(Mt(),1),OC=({customControls:a=[],etaBarHeight:i,onRecenter:u,isMapCentered:f,mapBearing:m,mapPitch:s,onResetBearing:I,initialViewState:D,drawerState:q,side:j,etaData:te,isDragging:J,clampedDragOffset:ae,customRecenterButton:Q,customCompassButton:Ie,drawerPeekHeight:ye,insets:pe={bottom:0,left:0,right:0,top:0}})=>{let ue=a.filter(K=>K.position==="above-recenter"),re=a.filter(K=>K.position==="below-recenter"),fe=Math.abs(m)>=.5||Math.abs(s)>=.5,ge="32px",Pe=te?i:q==="closed"?pe.bottom:0,Le=typeof ye=="number"?`${ye}px`:ye||"15%",H=j==="bottom"?q==="closed"?`calc(${ge} + 1rem + ${Pe}px - var(--drag-offset, 0px))`:`calc(${Le} + 1rem + ${te?i:0}px - var(--drag-offset, 0px))`:`calc(1rem + ${pe.bottom}px)`;return(0,Zt.jsxs)("div",{className:`absolute right-4 z-30 flex flex-col items-center gap-3 select-none pointer-events-none ${J?"transition-none":"transition-all duration-300 ease-out"} ${j!=="bottom"||q!=="full"?"opacity-100 scale-100 pointer-events-auto":"opacity-0 scale-75 pointer-events-none"}`,style:{bottom:H},children:[ue.length>0&&(0,Zt.jsx)("div",{className:"flex flex-col gap-2 pointer-events-auto",children:ue.map(K=>(0,Zt.jsxs)("div",{className:"relative group flex items-center",children:[K.tooltip&&(0,Zt.jsx)("div",{className:"absolute right-14 pointer-events-none opacity-0 scale-95 origin-right group-hover:opacity-100 group-hover:scale-100 transition-all duration-150 bg-zinc-900/95 border border-white/10 text-white text-xs px-2.5 py-1.5 rounded-lg shadow-xl whitespace-nowrap",children:K.tooltip}),(0,Zt.jsx)(Oa,{className:`w-12 h-12 rounded-full bg-zinc-950/80 backdrop-blur-md border border-white/10 shadow-lg flex items-center justify-center text-white active:scale-95 transition-all cursor-pointer p-0! hover:bg-zinc-900 hover:text-white ${K.activeState?"ring-2 ring-cyan-400 ring-offset-2 ring-offset-zinc-950":""}`,onClick:K.onPress,variant:"ghost",children:K.icon})]},K.id))}),fe&&(Ie?(0,Zt.jsx)("div",{className:"pointer-events-auto",children:Ie}):(0,Zt.jsx)("div",{className:"pointer-events-auto",children:(0,Zt.jsx)(Oa,{className:`w-12 h-12 rounded-full bg-zinc-950/80 backdrop-blur-md border border-white/10 shadow-lg flex items-center justify-center text-white active:scale-95 transition-all duration-300 p-0! hover:bg-zinc-900 hover:text-white ${fe?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none h-0 w-0 border-none m-0 p-0 overflow-hidden"}`,onClick:()=>I({pitch:D?.pitch??0}),style:{transform:fe?"scale(1) rotate(0deg)":"scale(0.7) rotate(0deg)"},title:"Reset bearing to North",variant:"ghost",children:(0,Zt.jsxs)("svg",{className:"w-7 h-7 transition-transform duration-75 ease-out",fill:"none",style:{transform:`rotate(${-m}deg)`},viewBox:"0 0 24 24",children:[(0,Zt.jsx)("circle",{cx:"12",cy:"12",r:"9.5",stroke:"white",strokeOpacity:"0.2",strokeWidth:"1"}),(0,Zt.jsx)("path",{d:"M12 4.5L15 12H9L12 4.5Z",fill:"#ef4444"}),(0,Zt.jsx)("path",{d:"M12 19.5L9 12H15L12 19.5Z",fill:"#f4f4f5"}),(0,Zt.jsx)("circle",{cx:"12",cy:"12",fill:"#18181b",r:"1.5"})]})})})),Q?(0,Zt.jsx)("div",{className:"pointer-events-auto",children:Q}):(0,Zt.jsx)("div",{className:"pointer-events-auto",children:(0,Zt.jsx)(Oa,{className:`w-12 h-12 rounded-full bg-zinc-950/80 backdrop-blur-md border border-white/10 shadow-lg flex items-center justify-center text-white active:scale-95 transition-all cursor-pointer p-0! hover:bg-zinc-900 hover:text-white ${f?"ring-2 ring-cyan-400 ring-offset-2 ring-offset-zinc-950":""}`,onClick:()=>u(),title:"Recenter Map",variant:"ghost",children:f?(0,Zt.jsxs)("svg",{className:"w-6 h-6 text-cyan-400",fill:"none",stroke:"currentColor",strokeWidth:"2.2",viewBox:"0 0 24 24",children:[(0,Zt.jsx)("circle",{cx:"12",cy:"12",r:"8"}),(0,Zt.jsx)("circle",{cx:"12",cy:"12",fill:"currentColor",r:"3"}),(0,Zt.jsx)("line",{x1:"12",x2:"12",y1:"2",y2:"4"}),(0,Zt.jsx)("line",{x1:"12",x2:"12",y1:"20",y2:"22"}),(0,Zt.jsx)("line",{x1:"2",x2:"4",y1:"12",y2:"12"}),(0,Zt.jsx)("line",{x1:"20",x2:"22",y1:"12",y2:"12"})]}):(0,Zt.jsxs)("svg",{className:"w-6 h-6 text-zinc-300",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,Zt.jsx)("circle",{cx:"12",cy:"12",r:"8"}),(0,Zt.jsx)("line",{x1:"12",x2:"12",y1:"2",y2:"4"}),(0,Zt.jsx)("line",{x1:"12",x2:"12",y1:"20",y2:"22"}),(0,Zt.jsx)("line",{x1:"2",x2:"4",y1:"12",y2:"12"}),(0,Zt.jsx)("line",{x1:"20",x2:"22",y1:"12",y2:"12"})]})})}),re.length>0&&(0,Zt.jsx)("div",{className:"flex flex-col gap-2 pointer-events-auto",children:re.map(K=>(0,Zt.jsxs)("div",{className:"relative group flex items-center",children:[K.tooltip&&(0,Zt.jsx)("div",{className:"absolute right-14 pointer-events-none opacity-0 scale-95 origin-right group-hover:opacity-100 group-hover:scale-100 transition-all duration-150 bg-zinc-900/95 border border-white/10 text-white text-xs px-2.5 py-1.5 rounded-lg shadow-xl whitespace-nowrap",children:K.tooltip}),(0,Zt.jsx)(Oa,{className:`w-12 h-12 rounded-full bg-zinc-950/80 backdrop-blur-md border border-white/10 shadow-lg flex items-center justify-center text-white active:scale-95 transition-all cursor-pointer p-0! hover:bg-zinc-900 hover:text-white ${K.activeState?"ring-2 ring-cyan-400 ring-offset-2 ring-offset-zinc-950":""}`,onClick:K.onPress,variant:"ghost",children:K.icon})]},K.id))})]})};var fa=Ue(nt(),1),FC=Ue(Mt(),1),jn=(0,fa.createContext)(null),nv=({children:a})=>{let[i,u]=(0,fa.useState)(!0),[f,m]=(0,fa.useState)(0),[s,I]=(0,fa.useState)(0),[D,q]=(0,fa.useState)("closed"),j=(0,fa.useRef)(null),te=(0,fa.useCallback)(Re=>{q(Re)},[]),[J,ae]=(0,fa.useState)(!1),Q=(0,fa.useCallback)(Re=>{ae(Fe=>Fe===Re?Fe:Re)},[]),[Ie,ye]=(0,fa.useState)(void 0),pe=(0,fa.useCallback)(Re=>{ye(Fe=>!Fe&&!Re?Fe:!Fe||!Re?Re:Fe.etaMins===Re.etaMins&&Fe.distanceRemainingKm===Re.distanceRemainingKm&&Fe.label===Re.label&&Fe.progress===Re.progress&&Fe.mode===Re.mode&&Fe.isCalculating===Re.isCalculating&&Fe.error===Re.error?Fe:Re)},[]),[ue,re]=(0,fa.useState)({bottom:0,left:0,right:0,top:0}),fe=(0,fa.useCallback)(Re=>{re(Fe=>({...Fe,...Re}))},[]),ge=(0,fa.useRef)(null),Pe=(0,fa.useRef)(null),Le=(0,fa.useCallback)(Re=>{ge.current&&ge.current(Re)},[]),H=(0,fa.useCallback)(Re=>{Pe.current&&Pe.current(Re)},[]),Z=(0,fa.useCallback)(Re=>{ge.current=Re},[]),K=(0,fa.useCallback)(Re=>{Pe.current=Re},[]),ve=(0,fa.useCallback)(Re=>{m(Re)},[]),De=(0,fa.useCallback)(Re=>{I(Re)},[]),et=(0,fa.useMemo)(()=>({_registerCenterCallback:Z,_registerResetBearingCallback:K,bearing:f,centerOnUser:Le,drawerContentRef:j,drawerState:D,etaData:Ie,hasControls:J,insets:ue,isFollowing:i,pitch:s,resetBearing:H,setBearing:ve,setDrawerState:te,setEtaData:pe,setHasControls:Q,setInsets:fe,setIsFollowing:u,setPitch:De}),[Z,K,f,Le,D,Ie,J,i,s,H,ve,te,pe,Q,De,ue,fe]);return(0,FC.jsx)(jn.Provider,{value:et,children:a})},xD=()=>{let a=(0,fa.useContext)(jn);if(!a)throw new Error("useMapControls must be used within a MapControlsProvider");return a};var Wr=Ue(nt(),1),Ps=Ue(Mt(),1),NC=(a,i)=>typeof a=="number"?a:a.endsWith("%")?parseFloat(a)/100*i:parseFloat(a),sv=({menuItems:a=[],drawerSide:i,customControls:u=[],etaBarHeight:f=100,onRecenter:m,isMapCentered:s,mapBearing:I,onResetBearing:D,etaData:q,customRecenterButton:j,defaultState:te,initialViewState:J,customCompassButton:ae,drawerPeekHeight:Q,drawerFullHeight:Ie,drawerContentRef:ye,menuContent:pe,children:ue,enableTouchDrag:re=!1,showScrollToTopButton:fe=!0,scrollToTopThreshold:ge=300,isInternal:Pe=!1})=>{let Le=(0,Wr.useContext)(jn),H=Le?.drawerContentRef,Z=(0,Wr.useCallback)(Et=>{ye&&(typeof ye=="function"?ye(Et):ye.current=Et),H&&(H.current=Et)},[ye,H]),[K,ve]=(0,Wr.useState)(te??"closed"),De=Le?Le.drawerState:K,et=(0,Wr.useCallback)(Et=>{Le?Le.setDrawerState(Et):ve(Et)},[Le]);(0,Wr.useEffect)(()=>{te&&Le&&Le.setDrawerState(te)},[]);let[Re,Fe]=(0,Wr.useState)("left"),qe=(0,Wr.useRef)(null),[Ne,Xe]=(0,Wr.useState)(600);(0,Wr.useEffect)(()=>{let Et=qe.current?.parentElement;if(!Et)return;let ua=()=>{Xe(Et.getBoundingClientRect().height)};ua();let Jr=new ResizeObserver(ua);return Jr.observe(Et),()=>{Jr.disconnect()}},[]);let gt=Le?.setHasControls;(0,Wr.useEffect)(()=>{if(gt&&!Pe)return gt(!0),()=>gt(!1)},[gt,Pe]);let xt=s!==void 0?s:Le?Le.isFollowing:!0,Qe=I!==void 0?I:Le?Le.bearing:0,qt=Et=>{m?m(Et):Le&&Le.centerOnUser(Et)},ga=Et=>{D?D(Et):Le&&Le.resetBearing(Et)},Va=Le?Le.pitch:0,ut=q!==void 0?q:Le?.etaData,[ft,kt]=(0,Wr.useState)(null),[va,la]=(0,Wr.useState)(null);(0,Wr.useEffect)(()=>{if(typeof window>"u")return;let Et=()=>{i?Fe(i):window.innerWidth<768?Fe("bottom"):Fe("left")};return Et(),window.addEventListener("resize",Et),()=>window.removeEventListener("resize",Et)},[i]);let pt=ft!==null&&va!==null,Kt=pt?va-ft:0,Ze=NC(Ie||"85%",Ne),Ct=NC(Q||"15%",Ne),Yt=Le?.insets.bottom||0,ea=32+(De==="closed"?Yt:0),jt=Kt;De==="full"?jt=Math.max(0,Math.min(Ze-ea,Kt)):De==="peek"?jt=Math.max(-(Ze-Ct),Math.min(Ct-ea,Kt)):De==="closed"&&(jt=Math.min(0,Math.max(-(Ze-ea),Kt)));let Pt=32;De==="peek"?Pt=Ct:De==="full"&&(Pt=Ze);let La=Pt-jt,Qr=Ct+20,Or=Ct+(Ze-Ct)*.35,ja=1,nr="1rem";return Re==="bottom"?(La<=Qr?ja=1:La>=Or?ja=0:ja=1-(La-Qr)/(Or-Qr),nr=`calc(${Pt+(De==="closed"?Yt:0)+16}px - var(--drag-offset, 0px))`):(ja=De==="full"?0:1,nr=`calc(1rem + ${Yt}px)`),(0,Ps.jsxs)(Ps.Fragment,{children:[(0,Ps.jsx)("div",{ref:qe,style:{display:"none"}}),(0,Ps.jsx)(zC,{clampedDragOffset:jt,containerHeight:Ne,currentTouchY:va,drawerFullHeight:Ie,drawerPeekHeight:Q,enableTouchDrag:re,etaBarHeight:f,etaData:ut,isDragging:pt,menuContent:ue||pe,menuItems:a,onChangeState:et,ref:Z,safeAreaInsets:Le?.insets,scrollToTopThreshold:ge,setCurrentTouchY:la,setTouchStartY:kt,showScrollToTopButton:fe,side:Re,state:De,touchStartY:ft}),(0,Ps.jsx)(OC,{clampedDragOffset:jt,customCompassButton:ae,customControls:u,customRecenterButton:j,drawerPeekHeight:Q,drawerState:De,etaBarHeight:f+(De==="closed"?Yt:0),etaData:ut,initialViewState:J,insets:Le?.insets,isDragging:pt,isMapCentered:xt,mapBearing:Qe,mapPitch:Va,onRecenter:()=>qt(),onResetBearing:ga,side:Re}),ut&&(0,Ps.jsx)(BC,{etaData:ut,isDragging:pt,layoutMode:"floating-card",style:{bottom:nr,opacity:ja,pointerEvents:ja>.1?"auto":"none",transition:pt?"none":"bottom 250ms ease-in-out, opacity 300ms ease-out"}})]})};var UC=Ue(nt(),1),xn=Ue(Mt(),1),Pp=({children:a})=>(0,xn.jsx)("div",{className:"flex flex-col gap-1.5",children:a}),Z0=({id:a,label:i,icon:u,onPress:f,badge:m,disabled:s=!1,children:I})=>{let D=(0,UC.useContext)(jn);return(0,xn.jsxs)("button",{className:`flex items-center gap-3 w-full py-3 px-3.5 rounded-xl text-left cursor-pointer transition-all duration-150 ${s?"opacity-45 cursor-not-allowed pointer-events-none":"hover:bg-white/5 active:bg-white/10 text-white"}`,disabled:s,onClick:j=>{s||(f&&f(),D&&D.setDrawerState&&D.setDrawerState("closed"))},type:"button",children:[u&&(0,xn.jsxs)("div",{className:"relative flex items-center justify-center w-8 h-8 rounded-lg bg-white/5 text-zinc-300",children:[u,m!==void 0&&(0,xn.jsx)("span",{className:"absolute -top-1 -right-1 bg-cyan-500 text-black text-[9px] font-extrabold min-w-[15px] h-3.5 rounded-full flex items-center justify-center px-1 border border-zinc-950 shadow",children:m})]}),(0,xn.jsxs)("div",{className:"flex-1 flex flex-col justify-center",children:[(0,xn.jsx)("span",{className:"text-sm font-medium tracking-wide flex-1",children:i}),I]})]})};Pp.displayName="MapMenu";Z0.displayName="MapMenuItem";var W0=({children:a,showDivider:i=!0,className:u=""})=>(0,xn.jsx)("div",{className:`flex items-center justify-between pb-3 first:mt-0 px-3.5 ${u} ${i?"border-b border-white/10 mb-2 mt-4":""}`,children:a});W0.displayName="MapMenuTitle";var X0=({className:a=""})=>(0,xn.jsx)("div",{className:`h-[1px] bg-white/10 my-3 mx-3.5 ${a}`});X0.displayName="MapMenuDivider";var $0=({children:a,className:i=""})=>(0,xn.jsx)("div",{className:`mt-auto pt-4 border-t border-white/10 px-3.5 text-xs text-zinc-500 font-medium ${i}`,children:a});$0.displayName="MapMenuFooter";var qC=(f=>(f.TOP_SCROLL_MORE="TOP_SCROLL_MORE",f.BOTTOM_SCROLL_MORE="BOTTOM_SCROLL_MORE",f.BACK_GESTURE="BACK_GESTURE",f))(qC||{}),Rp=(u=>(u.LOCATION_UPDATE="LOCATION_UPDATE",u.LOCATION_STREAM_UPDATE="LOCATION_STREAM_UPDATE",u))(Rp||{}),VC=(i=>(i.UPDATE_CONTEXT="UPDATE_CONTEXT",i))(VC||{});var Rs=Ue(nt(),1),lv=.12,Dp=()=>{let[a,i]=(0,Rs.useState)({accuracy:null,coords:null,heading:null}),u=(0,Rs.useRef)({accuracy:null,coords:null,heading:null}),f=(0,Rs.useRef)({accuracy:null,coords:null,heading:null}),m=(0,Rs.useCallback)(s=>{let I=s.location?.coords||s.coords,D=s.heading||s.coords,q=I?[I.longitude,I.latitude]:null,j=null;return D?.trueHeading!==void 0&&D.trueHeading>=0?j=D.trueHeading:D?.magneticHeading!==void 0&&D.magneticHeading>=0?j=D.magneticHeading:D?.heading!==null&&D.heading>=0&&(j=D.heading),{accuracy:I?.accuracy||null,coords:q,heading:j}},[]);return(0,Rs.useEffect)(()=>{let s,I=()=>{let j=!1;if(u.current.coords)if(!f.current.coords)f.current.coords=[...u.current.coords],j=!0;else{let[te,J]=u.current.coords,[ae,Q]=f.current.coords,Ie=ae+(te-ae)*lv,ye=Q+(J-Q)*lv;(Math.abs(Ie-ae)>1e-7||Math.abs(ye-Q)>1e-7)&&(f.current.coords=[Ie,ye],j=!0)}if(u.current.heading!==null)if(f.current.heading===null)f.current.heading=u.current.heading,j=!0;else{let te=u.current.heading,J=f.current.heading,ae=te-J;ae>180&&(ae-=360),ae<-180&&(ae+=360);let Ie=((J+ae*lv)%360+360)%360;Math.abs(ae)>.1&&(f.current.heading=Ie,j=!0)}j&&i({accuracy:u.current.accuracy,coords:f.current.coords?[...f.current.coords]:null,heading:f.current.heading}),s=requestAnimationFrame(I)};s=requestAnimationFrame(I),er.location.getCurrentPosition().then(j=>{let te=m(j);u.current=te}).catch(j=>console.warn("Initial location fetch failed",j));let D=er.on("LOCATION_STREAM_UPDATE",j=>{u.current=m(j)}),q=er.on("LOCATION_UPDATE",j=>{u.current=m(j)});return er.location.startStream({distanceFilter:1,headingThreshold:2}).catch(j=>console.warn("Failed to start location stream",j)),()=>{cancelAnimationFrame(s),D(),q(),er.location.stopStream().catch(()=>{})}},[m]),a};var cr=Ue(nt(),1),uv=({origin:a,destination:i,profile:u="driving",recalculateThreshold:f=50,enabled:m=!0,initialMode:s="preview"})=>{let[I,D]=(0,cr.useState)(null),[q,j]=(0,cr.useState)(null),[te,J]=(0,cr.useState)(!1),[ae,Q]=(0,cr.useState)(null),[Ie,ye]=(0,cr.useState)(s),pe=Dp(),ue=a||pe.coords,re=pe.coords||a,fe=(0,cr.useRef)(null),ge=(0,cr.useRef)(null),Pe=(0,cr.useRef)(!1),Le=(0,cr.useCallback)((K,ve)=>{let et=K[1]*Math.PI/180,Re=ve[1]*Math.PI/180,Fe=(ve[1]-K[1])*Math.PI/180,qe=(ve[0]-K[0])*Math.PI/180,Ne=Math.sin(Fe/2)*Math.sin(Fe/2)+Math.cos(et)*Math.cos(Re)*Math.sin(qe/2)*Math.sin(qe/2);return 6371e3*(2*Math.atan2(Math.sqrt(Ne),Math.sqrt(1-Ne)))},[]),H=(0,cr.useMemo)(()=>{if(!re||!I||I.geometry.coordinates.length<2)return re&&i?Le(re,i):null;let K=I.geometry.coordinates,ve=1/0,De=0,et=(Ne,Xe)=>(Ne[0]-Xe[0])**2+(Ne[1]-Xe[1])**2;for(let Ne=0;Ne<K.length;Ne++){let Xe=et(re,K[Ne]);Xe<ve&&(ve=Xe,De=Ne)}let Re=K.slice(De+1),Fe=0,qe=re;for(let Ne of Re)Fe+=Le(qe,Ne),qe=Ne;return Fe},[re,I,i,Le]),Z=(0,cr.useCallback)(async(K,ve,De)=>{if(!Pe.current){Pe.current=!0,J(!0);try{let et=await er.routing.getRoute({destination:ve,origin:K,profile:u});if(D(et),Q(null),De){let Re=et.geometry.coordinates,Fe=0;for(let qe=0;qe<Re.length-1;qe++)Fe+=Le(Re[qe],Re[qe+1]);j(Fe)}fe.current=K,ge.current=ve}catch(et){Q(et.message||"Failed to fetch route")}finally{J(!1),Pe.current=!1}}},[u,Le]);return(0,cr.useEffect)(()=>{if(!m||!i||!ue){(!m||!i)&&(D(null),j(null),fe.current=null,ge.current=null);return}if(!ge.current||ge.current[0]!==i[0]||ge.current[1]!==i[1])Z(ue,i,!0);else if(fe.current){let ve=re||ue;Le(ve,fe.current)>f&&Z(ve,i,!1)}else Z(ue,i,!0)},[ue,re,i,m,f,Z,Le]),{currentDistanceMeters:H,error:ae,isCalculating:te,mode:Ie,recalculate:()=>ue&&i&&Z(ue,i,!1),route:I,start:()=>ye("navigation"),totalDistance:q}},vD=(a,i,u="driving")=>{let[f,m]=(0,cr.useState)(null),[s,I]=(0,cr.useState)(!1),[D,q]=(0,cr.useState)(null);return(0,cr.useEffect)(()=>{if(!a||!i){m(null);return}(async()=>{I(!0);try{let te=await er.routing.getRoute({destination:i,origin:a,profile:u});m(te),q(null)}catch(te){q(te.message||"Failed to fetch route")}finally{I(!1)}})()},[a,i,u]),{error:D,isCalculating:s,route:f}};var jC=Ue(nt(),1),cv=(a,i)=>(0,jC.useMemo)(()=>{if(!a||!i||a.coordinates.length<2)return a;let u=a.coordinates,f=1/0,m=0,s=(D,q)=>(D[0]-q[0])**2+(D[1]-q[1])**2;for(let D=0;D<u.length;D++){let q=s(i,u[D]);q<f&&(f=q,m=D)}let I=u.slice(m+1);return{coordinates:[i,...I],type:"LineString"}},[a,i]);var Nl=Ue(nt(),1),go=Ue(nt(),1);var Y0=Ue(nt(),1),Gn=Ue(nt(),1);var K0=Y0.createContext(null),dv=a=>{let[i,u]=(0,Gn.useState)({}),f=(0,Gn.useCallback)((s,I="default")=>{u(D=>{if(I==="current")throw new Error("'current' cannot be used as map id");if(D[I])throw new Error(`Multiple maps with the same id: ${I}`);return{...D,[I]:s}})},[]),m=(0,Gn.useCallback)((s="default")=>{u(I=>{if(I[s]){let D={...I};return delete D[s],D}return I})},[]);return Y0.createElement(K0.Provider,{value:{maps:i,onMapMount:f,onMapUnmount:m}},a.children)};function fv(){let a=(0,Gn.useContext)(K0)?.maps,i=(0,Gn.useContext)(mo);return(0,Gn.useMemo)(()=>({...a,current:i?.map}),[a,i])}function GC(a,i){let u=Array.isArray(a)?a[0]:a?a.x:0,f=Array.isArray(a)?a[1]:a?a.y:0,m=Array.isArray(i)?i[0]:i?i.x:0,s=Array.isArray(i)?i[1]:i?i.y:0;return u===m&&f===s}function kr(a,i){if(a===i)return!0;if(!a||!i)return!1;if(Array.isArray(a)){if(!Array.isArray(i)||a.length!==i.length)return!1;for(let u=0;u<a.length;u++)if(!kr(a[u],i[u]))return!1;return!0}else if(Array.isArray(i))return!1;if(typeof a=="object"&&typeof i=="object"){let u=Object.keys(a),f=Object.keys(i);if(u.length!==f.length)return!1;for(let m of u)if(!i.hasOwnProperty(m)||!kr(a[m],i[m]))return!1;return!0}return!1}function hv(a){return{longitude:a.center.lng,latitude:a.center.lat,zoom:a.zoom,pitch:a.pitch,bearing:a.bearing,padding:a.padding}}function pv(a,i){let u=i.viewState||i,f={};if("longitude"in u&&"latitude"in u&&(u.longitude!==a.center.lng||u.latitude!==a.center.lat)){let m=a.center.constructor;f.center=new m(u.longitude,u.latitude)}return"zoom"in u&&u.zoom!==a.zoom&&(f.zoom=u.zoom),"bearing"in u&&u.bearing!==a.bearing&&(f.bearing=u.bearing),"pitch"in u&&u.pitch!==a.pitch&&(f.pitch=u.pitch),u.padding&&a.padding&&!kr(u.padding,a.padding)&&(f.padding=u.padding),f}var bD=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function mv(a){if(!a)return null;if(typeof a=="string"||("toJS"in a&&(a=a.toJS()),!a.layers))return a;let i={};for(let f of a.layers)i[f.id]=f;let u=a.layers.map(f=>{let m=null;"interactive"in f&&(m=Object.assign({},f),delete m.interactive);let s=i[f.ref];if(s){m=m||Object.assign({},f),delete m.ref;for(let I of bD)I in s&&(m[I]=s[I])}return m||f});return{...a,layers:u}}var HC={version:8,sources:{},layers:[]},wD={minZoom:0,maxZoom:22,minPitch:0,maxPitch:85,maxBounds:[-180,-85.051129,180,85.051129],projection:"mercator",renderWorldCopies:!0},ZC={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},WC={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},XC={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},SD=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],CD=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"],Q0=class a{constructor(i,u,f){this._map=null,this._internalUpdate=!1,this._hoveredFeatures=null,this._propsedCameraUpdate=null,this._styleComponents={},this._onEvent=m=>{let s=this.props[XC[m.type]];s?s(m):m.type==="error"&&console.error(m.error)},this._onCameraEvent=m=>{if(this._internalUpdate)return;m.viewState=this._propsedCameraUpdate||hv(this._map.transform);let s=this.props[WC[m.type]];s&&s(m)},this._onCameraUpdate=m=>this._internalUpdate?m:(this._propsedCameraUpdate=hv(m),pv(m,this.props)),this._onPointerEvent=m=>{(m.type==="mousemove"||m.type==="mouseout")&&this._updateHover(m);let s=this.props[ZC[m.type]];s&&(this.props.interactiveLayerIds&&m.type!=="mouseover"&&m.type!=="mouseout"&&(m.features=this._hoveredFeatures||this._queryRenderedFeatures(m.point)),s(m),delete m.features)},this._MapClass=i,this.props=u,this._initialize(f)}get map(){return this._map}setProps(i){let u=this.props;this.props=i;let f=this._updateSettings(i,u),m=this._updateSize(i),s=this._updateViewState(i);this._updateStyle(i,u),this._updateStyleComponents(i),this._updateHandlers(i,u),(f||m||s&&!this._map.isMoving())&&this.redraw()}static reuse(i,u){let f=a.savedMaps.pop();if(!f)return null;let m=f.map,s=m.getContainer();for(u.className=s.className;s.childNodes.length>0;)u.appendChild(s.childNodes[0]);m._container=u;let I=m._resizeObserver;I&&(I.disconnect(),I.observe(u)),f.setProps({...i,styleDiffing:!1}),m.resize();let{initialViewState:D}=i;return D&&(D.bounds?m.fitBounds(D.bounds,{...D.fitBoundsOptions,duration:0}):f._updateViewState(D)),m.isStyleLoaded()?m.fire("load"):m.once("style.load",()=>m.fire("load")),m._update(),f}_initialize(i){let{props:u}=this,{mapStyle:f=HC}=u,m={...u,...u.initialViewState,container:i,style:mv(f)},s=m.initialViewState||m.viewState||m;if(Object.assign(m,{center:[s.longitude||0,s.latitude||0],zoom:s.zoom||0,pitch:s.pitch||0,bearing:s.bearing||0}),u.gl){let D=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=D,u.gl)}let I=new this._MapClass(m);s.padding&&I.setPadding(s.padding),u.cursor&&(I.getCanvas().style.cursor=u.cursor),I.transformCameraUpdate=this._onCameraUpdate,I.on("style.load",()=>{this._styleComponents={light:I.getLight(),sky:I.getSky(),projection:I.getProjection?.(),terrain:I.getTerrain()},this._updateStyleComponents(this.props)}),I.on("sourcedata",()=>{this._updateStyleComponents(this.props)});for(let D in ZC)I.on(D,this._onPointerEvent);for(let D in WC)I.on(D,this._onCameraEvent);for(let D in XC)I.on(D,this._onEvent);this._map=I}recycle(){this.map.getContainer().querySelector("[mapboxgl-children]")?.remove(),a.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){let i=this._map;i.style&&(i._frame&&(i._frame.cancel(),i._frame=null),i._render())}_updateSize(i){let{viewState:u}=i;if(u){let f=this._map;if(u.width!==f.transform.width||u.height!==f.transform.height)return f.resize(),!0}return!1}_updateViewState(i){let u=this._map,f=u.transform;if(!u.isMoving()){let s=pv(f,i);if(Object.keys(s).length>0)return this._internalUpdate=!0,u.jumpTo(s),this._internalUpdate=!1,!0}return!1}_updateSettings(i,u){let f=this._map,m=!1;for(let s of SD)if((s in i||s in u)&&!kr(i[s],u[s])){m=!0;let D=s in i?i[s]:wD[s];f[`set${s[0].toUpperCase()}${s.slice(1)}`]?.call(f,D)}return m}_updateStyle(i,u){if(i.cursor!==u.cursor&&(this._map.getCanvas().style.cursor=i.cursor||""),i.mapStyle!==u.mapStyle){let{mapStyle:f=HC,styleDiffing:m=!0}=i,s={diff:m};"localIdeographFontFamily"in i&&(s.localIdeographFontFamily=i.localIdeographFontFamily),this._map.setStyle(mv(f),s)}}_updateStyleComponents({light:i,projection:u,sky:f,terrain:m}){let s=this._map,I=this._styleComponents;s.style?._loaded&&(i&&!kr(i,I.light)&&(I.light=i,s.setLight(i)),u&&!kr(u,I.projection)&&u!==I.projection?.type&&(I.projection=typeof u=="string"?{type:u}:u,s.setProjection?.(I.projection)),f&&!kr(f,I.sky)&&(I.sky=f,s.setSky(f)),m!==void 0&&!kr(m,I.terrain)&&(!m||s.getSource(m.source))&&(I.terrain=m,s.setTerrain(m)))}_updateHandlers(i,u){let f=this._map;for(let m of CD){let s=i[m]??!0,I=u[m]??!0;kr(s,I)||(s?f[m].enable(s):f[m].disable())}}_queryRenderedFeatures(i){let u=this._map,{interactiveLayerIds:f=[]}=this.props;try{return u.queryRenderedFeatures(i,{layers:f.filter(u.getLayer.bind(u))})}catch{return[]}}_updateHover(i){let{props:u}=this;if(u.interactiveLayerIds&&(u.onMouseMove||u.onMouseEnter||u.onMouseLeave)){let m=i.type,s=this._hoveredFeatures?.length>0,I=this._queryRenderedFeatures(i.point),D=I.length>0;!D&&s&&(i.type="mouseleave",this._onPointerEvent(i)),this._hoveredFeatures=I,D&&!s&&(i.type="mouseenter",this._onPointerEvent(i)),i.type=m}else this._hoveredFeatures=null}};Q0.savedMaps=[];var gv=Q0;var LD=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function yv(a){if(!a)return null;let i=a.map,u={getMap:()=>i};for(let f of TD(i))!(f in u)&&!LD.includes(f)&&(u[f]=i[f].bind(i));return u}function TD(a){let i=new Set,u=a;for(;u;){for(let f of Object.getOwnPropertyNames(u))f[0]!=="_"&&typeof a[f]=="function"&&f!=="fire"&&f!=="setEventedParent"&&i.add(f);u=Object.getPrototypeOf(u)}return Array.from(i)}var J0=Ue(nt(),1),ID=typeof document<"u"?J0.useLayoutEffect:J0.useEffect,$C=ID;function _v(a,i){let{RTLTextPlugin:u,maxParallelImageRequests:f,workerCount:m,workerUrl:s}=i;if(u&&a.getRTLTextPluginStatus&&a.getRTLTextPluginStatus()==="unavailable"){let{pluginUrl:I,lazy:D=!0}=typeof u=="string"?{pluginUrl:u}:u;a.setRTLTextPlugin(I,q=>{q&&console.error(q)},D)}f!==void 0&&a.setMaxParallelImageRequests(f),m!==void 0&&a.setWorkerCount(m),s!==void 0&&a.setWorkerUrl(s)}var mo=Nl.createContext(null);function MD(a,i){let u=(0,go.useContext)(K0),[f,m]=(0,go.useState)(null),s=(0,go.useRef)(),{current:I}=(0,go.useRef)({mapLib:null,map:null});(0,go.useEffect)(()=>{let j=a.mapLib,te=!0,J;return Promise.resolve(j||Promise.resolve().then(()=>Ue(KC(),1))).then(ae=>{if(!te)return;if(!ae)throw new Error("Invalid mapLib");let Q="Map"in ae?ae:ae.default;if(!Q.Map)throw new Error("Invalid mapLib");_v(Q,a),a.reuseMaps&&(J=gv.reuse(a,s.current)),J||(J=new gv(Q.Map,a,s.current)),I.map=yv(J),I.mapLib=Q,m(J),u?.onMapMount(I.map,a.id)}).catch(ae=>{let{onError:Q}=a;Q?Q({type:"error",target:null,originalEvent:null,error:ae}):console.error(ae)}),()=>{te=!1,J&&(u?.onMapUnmount(a.id),a.reuseMaps?J.recycle():J.destroy())}},[]),$C(()=>{f&&f.setProps(a)}),(0,go.useImperativeHandle)(i,()=>I.map,[f]);let D=(0,go.useMemo)(()=>({position:"relative",width:"100%",height:"100%",...a.style}),[a.style]),q={height:"100%"};return Nl.createElement("div",{id:a.id,ref:s,style:D},f&&Nl.createElement(mo.Provider,{value:I},Nl.createElement("div",{"mapboxgl-children":"",style:q},a.children)))}var bv=Nl.forwardRef(MD);var JC=Ue(nt(),1),eL=Ue(Kd(),1),Fi=Ue(nt(),1);var ED=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function Xr(a,i){if(!a||!i)return;let u=a.style;for(let f in i){let m=i[f];Number.isFinite(m)&&!ED.test(f)?u[f]=`${m}px`:u[f]=m}}function e1(a,i){if(a===i)return null;let u=QC(a),f=QC(i),m=[];for(let s of f)u.has(s)||m.push(s);for(let s of u)f.has(s)||m.push(s);return m.length===0?null:m}function QC(a){return new Set(a?a.trim().split(/\s+/):[])}var kp=(0,Fi.memo)((0,Fi.forwardRef)((a,i)=>{let{map:u,mapLib:f}=(0,Fi.useContext)(mo),m=(0,Fi.useRef)({props:a}),s=(0,Fi.useMemo)(()=>{let ue=!1;JC.Children.forEach(a.children,ge=>{ge&&(ue=!0)});let re={...a,element:ue?document.createElement("div"):void 0},fe=new f.Marker(re);return fe.setLngLat([a.longitude,a.latitude]),fe.getElement().addEventListener("click",ge=>{m.current.props.onClick?.({type:"click",target:fe,originalEvent:ge})}),fe.on("dragstart",ge=>{let Pe=ge;Pe.lngLat=s.getLngLat(),m.current.props.onDragStart?.(Pe)}),fe.on("drag",ge=>{let Pe=ge;Pe.lngLat=s.getLngLat(),m.current.props.onDrag?.(Pe)}),fe.on("dragend",ge=>{let Pe=ge;Pe.lngLat=s.getLngLat(),m.current.props.onDragEnd?.(Pe)}),fe},[]);(0,Fi.useEffect)(()=>(s.addTo(u.getMap()),()=>{s.remove()}),[]);let{longitude:I,latitude:D,offset:q,style:j,draggable:te=!1,popup:J=null,rotation:ae=0,rotationAlignment:Q="auto",pitchAlignment:Ie="auto"}=a;(0,Fi.useEffect)(()=>{Xr(s.getElement(),j)},[j]),(0,Fi.useImperativeHandle)(i,()=>s,[]);let ye=m.current.props;(s.getLngLat().lng!==I||s.getLngLat().lat!==D)&&s.setLngLat([I,D]),q&&!GC(s.getOffset(),q)&&s.setOffset(q),s.isDraggable()!==te&&s.setDraggable(te),s.getRotation()!==ae&&s.setRotation(ae),s.getRotationAlignment()!==Q&&s.setRotationAlignment(Q),s.getPitchAlignment()!==Ie&&s.setPitchAlignment(Ie),s.getPopup()!==J&&s.setPopup(J);let pe=e1(ye.className,a.className);if(pe)for(let ue of pe)s.toggleClassName(ue);return m.current.props=a,(0,eL.createPortal)(a.children,s.getElement())}));var tL=Ue(Kd(),1),Li=Ue(nt(),1);var AD=(0,Li.memo)((0,Li.forwardRef)((a,i)=>{let{map:u,mapLib:f}=(0,Li.useContext)(mo),m=(0,Li.useMemo)(()=>document.createElement("div"),[]),s=(0,Li.useRef)({props:a}),I=(0,Li.useMemo)(()=>{let D={...a},q=new f.Popup(D);return q.setLngLat([a.longitude,a.latitude]),q.once("open",j=>{s.current.props.onOpen?.(j)}),q},[]);if((0,Li.useEffect)(()=>{let D=q=>{s.current.props.onClose?.(q)};return I.on("close",D),I.setDOMContent(m).addTo(u.getMap()),()=>{I.off("close",D),I.isOpen()&&I.remove()}},[]),(0,Li.useEffect)(()=>{Xr(I.getElement(),a.style)},[a.style]),(0,Li.useImperativeHandle)(i,()=>I,[]),I.isOpen()){let D=s.current.props;(I.getLngLat().lng!==a.longitude||I.getLngLat().lat!==a.latitude)&&I.setLngLat([a.longitude,a.latitude]),a.offset&&!kr(D.offset,a.offset)&&I.setOffset(a.offset),(D.anchor!==a.anchor||D.maxWidth!==a.maxWidth)&&(I.options.anchor=a.anchor,I.setMaxWidth(a.maxWidth));let q=e1(D.className,a.className);if(q)for(let j of q)I.toggleClassName(j);s.current.props=a}return(0,tL.createPortal)(a.children,m)}));var t1=Ue(nt(),1);var lf=Ue(nt(),1);function Ni(a,i,u,f){let m=(0,lf.useContext)(mo),s=(0,lf.useMemo)(()=>a(m),[]);return(0,lf.useEffect)(()=>{let I=f||u||i,D=typeof i=="function"&&typeof u=="function"?i:null,q=typeof u=="function"?u:typeof i=="function"?i:null,{map:j}=m;return j.hasControl(s)||(j.addControl(s,I?.position),D&&D(m)),()=>{q&&q(m),j.hasControl(s)&&j.removeControl(s)}},[]),s}function PD(a){let i=Ni(({mapLib:u})=>new u.AttributionControl(a),{position:a.position});return(0,t1.useEffect)(()=>{Xr(i._container,a.style)},[a.style]),null}var RD=(0,t1.memo)(PD);var a1=Ue(nt(),1);function DD(a){let i=Ni(({mapLib:u})=>new u.FullscreenControl({container:a.containerId&&document.getElementById(a.containerId)}),{position:a.position});return(0,a1.useEffect)(()=>{Xr(i._controlContainer,a.style)},[a.style]),null}var kD=(0,a1.memo)(DD);var Hn=Ue(nt(),1);function zD(a,i){let u=(0,Hn.useRef)({props:a}),f=Ni(({mapLib:m})=>{let s=new m.GeolocateControl(a),I=s._setupUI;return s._setupUI=()=>{s._container.hasChildNodes()||I()},s.on("geolocate",D=>{u.current.props.onGeolocate?.(D)}),s.on("error",D=>{u.current.props.onError?.(D)}),s.on("outofmaxbounds",D=>{u.current.props.onOutOfMaxBounds?.(D)}),s.on("trackuserlocationstart",D=>{u.current.props.onTrackUserLocationStart?.(D)}),s.on("trackuserlocationend",D=>{u.current.props.onTrackUserLocationEnd?.(D)}),s},{position:a.position});return u.current.props=a,(0,Hn.useImperativeHandle)(i,()=>f,[]),(0,Hn.useEffect)(()=>{Xr(f._container,a.style)},[a.style]),null}var BD=(0,Hn.memo)((0,Hn.forwardRef)(zD));var r1=Ue(nt(),1);function OD(a){let i=Ni(({mapLib:u})=>new u.NavigationControl(a),{position:a.position});return(0,r1.useEffect)(()=>{Xr(i._container,a.style)},[a.style]),null}var FD=(0,r1.memo)(OD);var uf=Ue(nt(),1);function ND(a){let i=Ni(({mapLib:s})=>new s.ScaleControl(a),{position:a.position}),u=(0,uf.useRef)(a),f=u.current;u.current=a;let{style:m}=a;return a.maxWidth!==void 0&&a.maxWidth!==f.maxWidth&&(i.options.maxWidth=a.maxWidth),a.unit!==void 0&&a.unit!==f.unit&&i.setUnit(a.unit),(0,uf.useEffect)(()=>{Xr(i._container,m)},[m]),null}var UD=(0,uf.memo)(ND);var i1=Ue(nt(),1);function qD(a){let i=Ni(({mapLib:u})=>new u.TerrainControl(a),{position:a.position});return(0,i1.useEffect)(()=>{Xr(i._container,a.style)},[a.style]),null}var VD=(0,i1.memo)(qD);var o1=Ue(nt(),1);function jD(a){let i=Ni(({mapLib:u})=>new u.LogoControl(a),{position:a.position});return(0,o1.useEffect)(()=>{Xr(i._container,a.style)},[a.style]),null}var GD=(0,o1.memo)(jD);var aL=Ue(nt(),1),Fo=Ue(nt(),1);function dc(a,i){if(!a)throw new Error(i)}var HD=0;function ZD(a,i,u){if(a.style&&a.style._loaded){let f={...u};return delete f.id,delete f.children,a.addSource(i,f),a.getSource(i)}return null}function WD(a,i,u){dc(i.id===u.id,"source id changed"),dc(i.type===u.type,"source type changed");let f="",m=0;for(let I in i)I!=="children"&&I!=="id"&&!kr(u[I],i[I])&&(f=I,m++);if(!m)return;let s=i.type;if(s==="geojson")a.setData(i.data);else if(s==="image")a.updateImage({url:i.url,coordinates:i.coordinates});else switch(f){case"coordinates":a.setCoordinates?.(i.coordinates);break;case"url":a.setUrl?.(i.url);break;case"tiles":a.setTiles?.(i.tiles);break;default:console.warn(`Unable to update <Source> prop: ${f}`)}}function zp(a){let i=(0,Fo.useContext)(mo).map.getMap(),u=(0,Fo.useRef)(a),[,f]=(0,Fo.useState)(0),m=(0,Fo.useMemo)(()=>a.id||`jsx-source-${HD++}`,[]);(0,Fo.useEffect)(()=>{if(i){let I=()=>setTimeout(()=>f(D=>D+1),0);return i.on("styledata",I),I(),()=>{if(i.off("styledata",I),i.style&&i.style._loaded&&i.getSource(m)){let D=i.getStyle()?.layers;if(D)for(let q of D)q.source===m&&i.removeLayer(q.id);i.removeSource(m)}}}},[i]);let s=i&&i.style&&i.getSource(m);return s?WD(s,a,u.current):s=ZD(i,m,a),u.current=a,s&&aL.Children.map(a.children,I=>I&&(0,Fo.cloneElement)(I,{source:m}))||null}var Zn=Ue(nt(),1);function XD(a,i,u,f){if(dc(u.id===f.id,"layer id changed"),dc(u.type===f.type,"layer type changed"),u.type==="custom"||f.type==="custom")return;let{layout:m={},paint:s={},filter:I,minzoom:D,maxzoom:q,beforeId:j}=u;if(j!==f.beforeId&&a.moveLayer(i,j),m!==f.layout){let te=f.layout||{};for(let J in m)kr(m[J],te[J])||a.setLayoutProperty(i,J,m[J]);for(let J in te)m.hasOwnProperty(J)||a.setLayoutProperty(i,J,void 0)}if(s!==f.paint){let te=f.paint||{};for(let J in s)kr(s[J],te[J])||a.setPaintProperty(i,J,s[J]);for(let J in te)s.hasOwnProperty(J)||a.setPaintProperty(i,J,void 0)}kr(I,f.filter)||a.setFilter(i,I),(D!==f.minzoom||q!==f.maxzoom)&&a.setLayerZoomRange(i,D,q)}function $D(a,i,u){if(a.style&&a.style._loaded&&(!("source"in u)||a.getSource(u.source))){let f={...u,id:i};delete f.beforeId,a.addLayer(f,u.beforeId)}}var YD=0;function cf(a){let i=(0,Zn.useContext)(mo).map.getMap(),u=(0,Zn.useRef)(a),[,f]=(0,Zn.useState)(0),m=(0,Zn.useMemo)(()=>a.id||`jsx-layer-${YD++}`,[]);if((0,Zn.useEffect)(()=>{if(i){let I=()=>f(D=>D+1);return i.on("styledata",I),I(),()=>{i.off("styledata",I),i.style&&i.style._loaded&&i.getLayer(m)&&i.removeLayer(m)}}},[i]),i&&i.style&&i.getLayer(m))try{XD(i,m,a,u.current)}catch(I){console.warn(I)}else $D(i,m,a);return u.current=a,null}var Bp=Ue(Mt(),1),wv=({geometry:a,color:i="#3b82f6",width:u=5,opacity:f=.8})=>a?(0,Bp.jsxs)(zp,{data:{geometry:a,properties:{},type:"Feature"},id:"sdk-route-source",type:"geojson",children:[(0,Bp.jsx)(cf,{id:"sdk-route-layer-casing",paint:{"line-blur":1,"line-color":"#ffffff","line-opacity":f,"line-width":u+2},type:"line"}),(0,Bp.jsx)(cf,{id:"sdk-route-layer",layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":i,"line-opacity":f,"line-width":u},type:"line"})]}):null;var Bt=Ue(nt(),1);var fc=Ue(nt(),1),Sv=Ue(Mt(),1);function rL(a,i=64){let u=document.createElement("canvas");u.width=i,u.height=i;let f=u.getContext("2d");return f.font=`${i*.75}px serif`,f.textAlign="center",f.textBaseline="middle",f.fillText(a,i/2,i/2),f.getImageData(0,0,i,i)}var iL=({pois:a})=>{let[i,u]=(0,fc.useState)(0),{current:f}=fv(),m=(0,fc.useMemo)(()=>a.filter(I=>!I.displayMode||I.displayMode==="gl"),[a]);(0,fc.useEffect)(()=>{if(!f)return;let I=f.getMap();[{emoji:"\u{1F37A}",name:"sdk-default-bar"},{emoji:"\u{1F37D}\uFE0F",name:"sdk-default-restaurant"},{emoji:"\u{1F4CD}",name:"sdk-default-poi"}].forEach(j=>{I.hasImage(j.name)||I.addImage(j.name,rL(j.emoji),{pixelRatio:2})});let q=0;m.forEach(j=>{if(j.imageUrl){let te=`custom-url-${j.id}`;I.hasImage(te)||I.loadImage(j.imageUrl,(J,ae)=>{!J&&ae&&(I.hasImage(te)||(I.addImage(te,ae),u(Q=>Q+1)))})}if(j.emoji){let te=`custom-emoji-${j.emoji}`;I.hasImage(te)||(I.addImage(te,rL(j.emoji),{pixelRatio:2}),q++)}}),q>0&&u(j=>j+q)},[f,m]);let s=(0,fc.useMemo)(()=>({features:m.map(I=>({geometry:{coordinates:[I.longitude,I.latitude],type:"Point"},properties:{...I,"sdk-icon":I.imageUrl?`custom-url-${I.id}`:I.spriteName?I.spriteName:I.emoji?`custom-emoji-${I.emoji}`:I.type==="bar"?"sdk-default-bar":I.type==="restaurant"?"sdk-default-restaurant":"sdk-default-poi"},type:"Feature"})),type:"FeatureCollection"}),[m]);return(0,Sv.jsx)(zp,{data:s,id:"sdk-pois",type:"geojson",children:(0,Sv.jsx)(cf,{id:"sdk-poi-layer",layout:{"icon-allow-overlap":!0,"icon-image":["get","sdk-icon"],"icon-size":1,"text-anchor":"top","text-field":["step",["zoom"],"",14,["get","name"]],"text-font":["Open Sans Bold"],"text-offset":[0,1.5],"text-optional":!0,"text-size":11},paint:{"icon-opacity":["interpolate",["linear"],["zoom"],11,0,12,1],"text-color":"#ffffff","text-halo-color":"#000000","text-halo-width":1,"text-opacity":["interpolate",["linear"],["zoom"],13.5,0,14,1]},type:"symbol"})})};var vn=Ue(Mt(),1),oL=({pois:a,onClick:i})=>{let u=a.filter(f=>f.displayMode==="marker");return u.length===0?null:(0,vn.jsx)(vn.Fragment,{children:u.map(f=>(0,vn.jsx)(kp,{anchor:"bottom",latitude:f.latitude,longitude:f.longitude,onClick:m=>{m.originalEvent.stopPropagation(),i&&i(f)},children:f.markerComponent?f.markerComponent:(0,vn.jsxs)("div",{style:{cursor:"pointer",filter:"drop-shadow(0 4px 6px rgba(0,0,0,0.1))",transform:"transition-transform duration-200 hover:scale-110"},children:[(0,vn.jsx)("div",{style:{alignItems:"center",backgroundColor:f.type==="bar"?"#f97316":"#10b981",border:"2px solid white",borderRadius:"50%",display:"flex",height:"32px",justifyContent:"center",width:"32px"},children:f.emoji?(0,vn.jsx)("span",{style:{fontSize:"16px"},children:f.emoji}):(0,vn.jsx)("div",{style:{backgroundColor:"white",borderRadius:"50%",height:"8px",width:"8px"}})}),(0,vn.jsx)("div",{style:{borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderTop:`8px solid ${f.type==="bar"?"#f97316":"#10b981"}`,height:0,margin:"-2px auto 0",width:0}})]})},f.id))})};var Ui=Ue(Mt(),1),nL=({forcedLocation:a,heading:i})=>a?(0,Ui.jsx)(kp,{anchor:"center",latitude:a[1],longitude:a[0],children:(0,Ui.jsxs)("div",{style:{alignItems:"center",display:"flex",justifyContent:"center",position:"relative"},children:[(0,Ui.jsx)("div",{style:{animation:"pulse 2s infinite",backgroundColor:"rgba(59, 130, 246, 0.4)",borderRadius:"50%",height:"40px",position:"absolute",width:"40px"}}),i!=null&&(0,Ui.jsx)("div",{style:{height:"60px",position:"absolute",transform:`rotate(${i}deg)`,width:"60px",zIndex:0},children:(0,Ui.jsxs)("svg",{style:{height:"100%",width:"100%"},viewBox:"0 0 100 100",children:[(0,Ui.jsx)("defs",{children:(0,Ui.jsxs)("radialGradient",{cx:"50%",cy:"50%",fx:"50%",fy:"50%",id:"grad1",r:"50%",children:[(0,Ui.jsx)("stop",{offset:"0%",style:{stopColor:"rgba(37, 99, 235, 0.6)",stopOpacity:1}}),(0,Ui.jsx)("stop",{offset:"100%",style:{stopColor:"rgba(37, 99, 235, 0)",stopOpacity:0}})]})}),(0,Ui.jsx)("path",{d:"M 50 50 L 35 0 A 50 50 0 0 1 65 0 Z",fill:"url(#grad1)"})]})}),(0,Ui.jsx)("div",{style:{alignItems:"center",backgroundColor:"white",borderRadius:"50%",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(37, 99, 235, 0.2)",display:"flex",height:"20px",justifyContent:"center",width:"20px",zIndex:1},children:(0,Ui.jsx)("div",{style:{backgroundColor:"#2563eb",border:"2px solid white",borderRadius:"50%",height:"12px",width:"12px"}})}),(0,Ui.jsx)("style",{children:"@keyframes pulse { 0% { transform: scale(0.95); opacity: 0.7; } 70% { transform: scale(1.5); opacity: 0; } 100% { transform: scale(0.95); opacity: 0; } }"})]})}):null;var dr=Ue(Mt(),1),KD=({initialViewState:a={latitude:45.90583599233422,longitude:6.12589018919138,zoom:12},style:i={},mapStyle:u="https://tiles.cloudparse.fr/style/up_dark_matter",className:f="",maxBounds:m,children:s,onClick:I,onMapClickMiss:D,onContextMenu:q,interactiveLayerIds:j=[],onLoad:te,showUserLocation:J=!0,followUser:ae=!1,showUserLocationButton:Q=!0,renderUserLocation:Ie,pois:ye=[],onPoiClick:pe,route:ue,showNavigationUI:re,navigationData:fe,onNavigationAbort:ge,onNavigationModeChange:Pe,navigation:Le,showControls:H=!0,menuItems:Z,menuContent:K,drawerState:ve,drawerContentRef:De,controlProps:et={},enableTouchDrag:Re=!1})=>{let Fe=(0,Bt.useContext)(jn),qe=(0,Bt.useRef)(null),Ne=Dp(),[Xe,gt]=(0,Bt.useState)(null),[xt,Qe]=(0,Bt.useState)(!1);(0,Bt.useEffect)(()=>{let Gt=er.on("SDK_NAVIGATION_CREATE",ba=>{Qe(!1),gt(ba)}),Fr=er.on("SDK_NAVIGATION_START",()=>{Qe(!1),gt(ba=>ba?{...ba,mode:"navigation"}:null)}),Se=er.on("SDK_NAVIGATION_ABORT",()=>{Qe(!0),gt(null)});return()=>{Gt(),Fr(),Se()}},[]);let qt=Xe||Le,ga=uv({destination:qt?.destination||null,enabled:!!qt?.destination,initialMode:qt?.mode||"preview",origin:qt?.origin,profile:qt?.profile||"driving",recalculateThreshold:qt?.recalculateThreshold||50});(0,Bt.useEffect)(()=>{Pe&&Le&&Pe(ga.mode)},[ga.mode,Pe,Le]);let Va=(0,Bt.useRef)(null),ut=qt?.destination;(0,Bt.useEffect)(()=>{ut&&(!Va.current||Va.current[0]!==ut[0]||Va.current[1]!==ut[1])&&Qe(!1),Va.current=ut},[ut]);let ft=xt?void 0:qt?ga:fe,kt=xt?void 0:qt?ga.route?.geometry:ue,va=!xt&&qt?.showUI!==!1&&(qt?!!qt.destination:re),la=ft?.mode||"preview",pt=Fe?Fe.isFollowing:ae,Kt=(0,Bt.useRef)(pt),Ze=(0,Bt.useRef)(!1),[Ct,Yt]=(0,Bt.useState)(pt),ea=Fe?Fe.isFollowing:Ct,jt=Fe?.setIsFollowing,Pt=(0,Bt.useCallback)(Gt=>{Kt.current=Gt,Yt(Gt),jt&&jt(Gt)},[jt]);(0,Bt.useEffect)(()=>{Fe&&Fe.isFollowing!==Kt.current&&(Kt.current=Fe.isFollowing)},[Fe?.isFollowing,Fe]);let La=[...j];ye.length>0&&!La.includes("sdk-poi-layer")&&La.push("sdk-poi-layer");let Qr=(0,Bt.useRef)(ae);(0,Bt.useEffect)(()=>{ae!==Qr.current&&(Pt(ae),Qr.current=ae,ae&&Ne.coords&&qe.current&&(Ze.current=!0,qe.current.flyTo({center:Ne.coords,duration:1e3,essential:!0,zoom:Math.max(qe.current.getZoom(),16)}),setTimeout(()=>{Ze.current=!1},1050)))},[ae,Pt,Ne.coords]);let Or=(0,Bt.useRef)(null),ja=(0,Bt.useRef)(null);(0,Bt.useEffect)(()=>{if(!kt||!qe.current){kt||(Or.current=null);return}let Gt=kt!==Or.current,Fr=ja.current!==la;if(la==="navigation")Pt(!0),(Fr||Gt)&&Ne.coords&&qe.current&&(Ze.current=!0,qe.current.flyTo({center:Ne.coords,duration:1e3,essential:!0,zoom:17}),setTimeout(()=>{Ze.current=!1},1050));else if(la==="preview"&&Gt){Pt(!1);let Se=kt.coordinates;if(Se.length>0){let ba=Se.reduce((mr,It)=>[[Math.min(mr[0][0],It[0]),Math.min(mr[0][1],It[1])],[Math.max(mr[1][0],It[0]),Math.max(mr[1][1],It[1])]],[[Se[0][0],Se[0][1]],[Se[0][0],Se[0][1]]]);qe.current.fitBounds([ba[0][0],ba[0][1],ba[1][0],ba[1][1]],{padding:100,speed:1.2})}}Or.current=kt,ja.current=la},[kt,la,Pt,Ne.coords]),(0,Bt.useEffect)(()=>{Kt.current&&!Ze.current&&Ne.coords&&qe.current&&qe.current.easeTo({center:Ne.coords,duration:50,easing:Gt=>Gt,essential:!0})},[Ne.coords]);let nr=cv(kt,J?Ne.coords:null),Et=ft?.currentDistanceMeters??null,ua=ft?.totalDistance??null,Jr=ft?.route?.durationSeconds??null,Yo=Et??0,Io=(()=>{if(!Jr||!ua||!Et)return 0;let Gt=Et/ua;return Math.ceil(Jr*Gt/60)})(),el=Yo/1e3,ts=ua&&ua>0?Math.min(100,Math.max(0,(ua-Yo)/ua*100)):0,tl=ft&&kt?{distanceRemainingKm:el,etaMins:Io,label:la==="navigation"?"Walking Guidance Active":"Route Preview",mode:la,onAbort:()=>{Qe(!0),gt(null),er.navigation.abort(),ge&&ge()},onStart:ft.start,progress:ts}:void 0,Cn=Fe?.setEtaData;(0,Bt.useEffect)(()=>{Cn&&Cn(tl)},[tl,Cn]);let Vi=Fe?.setDrawerState;(0,Bt.useEffect)(()=>{Vi&&ve!==void 0&&Vi(ve)},[ve,Vi]);let io=(0,Bt.useMemo)(()=>[{icon:(0,dr.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,dr.jsx)("path",{d:"M12 11c0 3.517-1.009 6.799-2.753 9.571m-3.44-2.04l.054-.09A13.916 13.916 0 008 11a4 4 0 118 0c0 1.017-.07 2.019-.203 3m-2.118 6.844A21.88 21.88 0 0015.171 17m3.839 1.132c.645-2.266.99-4.659.99-7.132A8 8 0 008 4.07M3 15.364c.64-1.319 1-2.8 1-4.364 0-1.457.39-2.823 1.07-4",strokeLinecap:"round",strokeLinejoin:"round"})}),id:"walking",label:"Walking Mode",onPress:()=>{}}],[]),mi=Z||io,{mapLibreChildren:Ln,menuContentFromChildren:hu}=(0,Bt.useMemo)(()=>{let Gt=[],Fr=[];Bt.default.Children.forEach(s,ba=>{if(Bt.default.isValidElement(ba)){let mr=ba.type,It=mr?.displayName||mr?.name,Ir=mr===Pp||It==="MapMenu",en=Ir||mr===Z0||mr===W0||mr===X0||mr===$0||["MapMenuItem","MapMenuTitle","MapMenuDivider","MapMenuFooter"].includes(It);Ir?Bt.default.Children.forEach(ba.props.children,pu=>{pu&&Fr.push(pu)}):en?Fr.push(ba):Gt.push(ba)}else Gt.push(ba)});let Se=Fr.length>0?(0,dr.jsx)(Pp,{children:Fr}):null;return{mapLibreChildren:Gt,menuContentFromChildren:Se}},[s]),Ko=Gt=>{let Fr=Gt.features||[];if(pe){let ba=Fr.find(mr=>mr.layer.id==="sdk-poi-layer");if(ba){pe(ba.properties);return}}Fr.some(ba=>La.includes(ba.layer.id))||D&&D(Gt),I&&I(Gt)},gi=(0,Bt.useCallback)(Gt=>{Ne.coords&&qe.current&&(Pt(!0),Ze.current=!0,qe.current.flyTo({center:Ne.coords,duration:1e3,essential:!0,pitch:Gt?.pitch||0,zoom:Math.max(qe.current.getZoom(),16)}),setTimeout(()=>{Ze.current=!1},1050))},[Ne.coords,Pt]),Qo=(0,Bt.useCallback)(Gt=>{qe.current&&qe.current.easeTo({bearing:0,duration:500,essential:!0,pitch:Gt?.pitch??0})},[]);(0,Bt.useEffect)(()=>{Fe&&(Fe._registerCenterCallback(gi),Fe._registerResetBearingCallback(Qo))},[Fe,gi,Qo]);let Jo=(0,Bt.useCallback)(()=>{qe.current&&Fe&&(Fe.setBearing(qe.current.getBearing()),Fe.setPitch(qe.current.getPitch()))},[Fe]),Mo=()=>{Kt.current&&(console.log("[SDK:Map] Manual interaction detected. Halting tracking."),Pt(!1),qe.current&&qe.current.stop())};return(0,dr.jsxs)("div",{className:`w-full h-full overflow-hidden relative ${f}`,style:i,children:[(0,dr.jsxs)(bv,{attributionControl:!1,initialViewState:a,interactiveLayerIds:La,mapStyle:u,maxBounds:m,onClick:Ko,onContextMenu:q,onDragStart:Mo,onLoad:Gt=>{te&&te(Gt),ae&&Ne.coords&&qe.current&&qe.current.jumpTo({center:Ne.coords,zoom:16})},onMouseDown:Mo,onMove:Jo,onTouchStart:Mo,onWheel:Mo,ref:qe,children:[J&&Ne.coords&&(Ie?Ie({coords:Ne.coords,heading:Ne.heading}):(0,dr.jsx)(nL,{forcedLocation:Ne.coords,heading:Ne.heading})),nr&&(0,dr.jsx)(wv,{geometry:nr}),ye.length>0&&(0,dr.jsxs)(dr.Fragment,{children:[(0,dr.jsx)(iL,{pois:ye}),(0,dr.jsx)(oL,{onClick:pe,pois:ye})]}),Ln]}),H&&Fe&&!Fe.hasControls&&(0,dr.jsx)(sv,{drawerContentRef:De,enableTouchDrag:Re,etaData:tl,initialViewState:a,isInternal:!0,menuContent:K||hu,menuItems:mi,...et})]})},QD=({children:a})=>(0,Bt.useContext)(jn)?(0,dr.jsx)(dr.Fragment,{children:a}):(0,dr.jsx)(nv,{children:a}),Cv=a=>(0,dr.jsx)(QD,{children:(0,dr.jsx)(dv,{children:(0,dr.jsx)(KD,{...a})})});var k4=Ue(nt(),1),z4=Ue(D4(),1);function rw(a,i={}){let u=document.getElementById(a);if(!u)throw new Error(`Container with id "${a}" not found.`);let f=(0,z4.createRoot)(u);return f.render(k4.default.createElement(Cv,i)),f}var ky={createErrorResponse(a,i,u){return{error:{code:i,message:u},requestId:a.requestId,sdkVersion:a.sdkVersion,success:!1,type:"SDK_ROUTING_GETROUTE_RESPONSE"}},decodePolyline(a,i){let u=0,f=0,m=0,s=[],I=10**i;for(;u<a.length;){let D,q=0,j=0;do D=a.charCodeAt(u++)-63,j|=(D&31)<<q,q+=5;while(D>=32);let te=j&1?~(j>>1):j>>1;f+=te,q=0,j=0;do D=a.charCodeAt(u++)-63,j|=(D&31)<<q,q+=5;while(D>=32);let J=j&1?~(j>>1):j>>1;m+=J,s.push([m/I,f/I])}return s},async fetchOSRMRoute(a,i,u,f){let m=i.map(J=>`${J[0]},${J[1]}`).join(";"),I=`${f}/route/v1/${u==="walking"?"foot":u==="driving"?"car":"bike"}/${m}?overview=full&geometries=geojson&steps=true`,D=await fetch(I);if(!D.ok)throw new Error(`OSRM Error: ${D.statusText}`);let q=await D.json();if(q.code!=="Ok"||!q.routes||q.routes.length===0)throw new Error("NO_ROUTE");let j=q.routes[0],te=j.legs?.flatMap(J=>J.steps?.map(ae=>({distance:ae.distance,duration:ae.duration,instruction:ae.maneuver?.instruction||"Continue"})))||[];return{data:{distanceMeters:j.distance,durationSeconds:j.duration,geometry:j.geometry,steps:te},requestId:a.requestId,sdkVersion:a.sdkVersion,success:!0,type:"SDK_ROUTING_GETROUTE_RESPONSE"}},async fetchRoute(a,i){let{origin:u,destination:f,waypoints:m,profile:s,language:I}=a.payload;if(!this.isValidCoordinate(u)||!this.isValidCoordinate(f))return this.createErrorResponse(a,"INVALID_INPUT","Origin or destination coordinates are invalid.");if(m&&!m.every(this.isValidCoordinate))return this.createErrorResponse(a,"INVALID_INPUT","One or more waypoints are invalid.");let D=[u,...m||[],f];try{return i.backend==="osrm"?await this.fetchOSRMRoute(a,D,s,i.baseUrl):await this.fetchValhallaRoute(a,D,s,I,i.baseUrl)}catch(q){return q instanceof Error&&q.message.includes("NO_ROUTE")?this.createErrorResponse(a,"NO_ROUTE","No route could be found for the given points."):q instanceof TypeError?this.createErrorResponse(a,"NETWORK_ERROR","Failed to connect to the routing backend."):this.createErrorResponse(a,"BACKEND_ERROR",`Routing backend error: ${q instanceof Error?q.message:"Unknown error"}`)}},async fetchValhallaRoute(a,i,u,f,m){let I={costing:u==="driving"?"auto":u==="walking"?"pedestrian":"bicycle",directions_options:{language:f||"en-US"},locations:i.map(ae=>({lat:ae[1],lon:ae[0]}))},D=await fetch(`${m}/route`,{body:JSON.stringify(I),headers:{"Content-Type":"application/json"},method:"POST"});if(!D.ok)throw new Error(`Valhalla Error: ${D.statusText}`);let q=await D.json();if(!q.trip||!q.trip.legs||q.trip.legs.length===0)throw new Error("NO_ROUTE");let j=q.trip,te=this.decodePolyline(j.legs[0].shape,6),J=j.legs.flatMap(ae=>ae.maneuvers?.map(Q=>({distance:Q.length*1e3,duration:Q.time,instruction:Q.instruction||"Continue"})))||[];return{data:{distanceMeters:j.summary.length*1e3,durationSeconds:j.summary.time,geometry:{coordinates:te,type:"LineString"},steps:J},requestId:a.requestId,sdkVersion:a.sdkVersion,success:!0,type:"SDK_ROUTING_GETROUTE_RESPONSE"}},isValidCoordinate(a){let[i,u]=a;return i>=-180&&i<=180&&u>=-90&&u<=90}};var Om="0.2.7";function B4(a){let i=Object.getOwnPropertyNames(a);for(let u of i){let f=a[u];f&&typeof f=="object"&&!Object.isFrozen(f)&&!(f instanceof wp)&&B4(f)}return Object.freeze(a)}var iw=null,Fm=class{maps=Object.freeze({render:rw});bridge;storage=Object.freeze({get:i=>this.bridge.send("STORAGE_GET",{key:i}),getAll:()=>this.bridge.send("STORAGE_GET_ALL"),set:(i,u)=>this.bridge.send("STORAGE_SET",{key:i,value:u})});secureStore=Object.freeze({get:i=>this.bridge.send("SECURE_GET",{key:i}),set:(i,u)=>this.bridge.send("SECURE_SET",{key:i,value:u})});database=Object.freeze({getUserData:()=>this.bridge.send("DATABASE_GET_USER_DATA"),setUserData:i=>this.bridge.send("DATABASE_SET_USER_DATA",{data:i})});location=Object.freeze({getCurrentPosition:()=>this.bridge.send("GET_CURRENT_POSITION"),startStream:i=>this.bridge.send("START_LOCATION_STREAM",i),stopStream:()=>this.bridge.send("STOP_LOCATION_STREAM")});user=Object.freeze({getProfile:i=>this.bridge.send("GET_USER_PROFILE",{fields:i}),getProfilePicture:(i=>this.bridge.send("GET_PROFILE_PICTURE",{uuids:i||[]}))});permission=Object.freeze({request:((i,u)=>this.bridge.send("REQUEST_PERMISSION",{fields:u,type:i}))});payment=Object.freeze({request:i=>this.bridge.send("PAYMENT_REQUEST",i)});activity=Object.freeze({start:(i,u,f)=>this.bridge.send("START_ACTIVITY",{id:i,status:f,title:u})});haptic=Object.freeze({trigger:i=>this.bridge.send("TRIGGER_HAPTIC",{style:i})});network=Object.freeze({request:async i=>this.bridge.send("NETWORK_REQUEST",i)});navigation=Object.freeze({abort:()=>{this.bridge.handleNativeMessage({eventName:"SDK_NAVIGATION_ABORT",type:"EVENT"})},createJourney:i=>{this.bridge.handleNativeMessage({eventName:"SDK_NAVIGATION_CREATE",payload:{...i,mode:"preview"},type:"EVENT"})},start:()=>{this.bridge.handleNativeMessage({eventName:"SDK_NAVIGATION_START",type:"EVENT"})}});fidelity=Object.freeze({getFidelityBalance:()=>this.bridge.send("GET_FIDELITY_BALANCE"),getFidelityHistory:i=>this.bridge.send("GET_FIDELITY_HISTORY",i),showHistory:()=>this.bridge.send("SHOW_FIDELITY_HISTORY"),spendFPoints:i=>this.bridge.send("SPEND_FPOINTS",{intentUuid:i})});ui=Object.freeze({exit:()=>this.bridge.send("EXIT"),setScrollConfig:i=>this.bridge.send("SET_SCROLL_CONFIG",i)});debug=Object.freeze({log:(...i)=>this.bridge.send("DEBUG_LOG",{message:i})});routing=Object.freeze({clearRoute:()=>{let i=crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).substring(2);return this.bridge.send("SDK_ROUTING_CLEARROUTE",{requestId:i,sdkVersion:Om})},drawRoute:i=>{let u=crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).substring(2);return this.bridge.send("SDK_ROUTING_DRAWROUTE",{payload:{routeData:i},requestId:u,sdkVersion:Om})},getRoute:async i=>{let u=crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).substring(2),f={payload:i,requestId:u,sdkVersion:Om,type:"SDK_ROUTING_GETROUTE"};if(iw){let m=await ky.fetchRoute(f,iw);if(m.success&&m.data)return m.data;throw new Error(m.error?.message||"Routing failed")}return this.bridge.send("SDK_ROUTING_GETROUTE",{payload:i,requestId:u,sdkVersion:Om})}});constructor(){this.bridge=new wp,this.initialize=this.initialize.bind(this),this.on=this.on.bind(this),this.off=this.off.bind(this)}config(i){i.routingBackend&&(iw=i.routingBackend)}updateContext(i){return this.bridge.send("UPDATE_CONTEXT",i)}initialize(i){return this.bridge.send("INITIALIZE",i)}on(i,u){return this.bridge.on(i,u)}off(i,u){this.bridge.off(i,u)}},er=B4(new Fm);var pr=Ue(nt(),1),Ot=Ue(Mt(),1),T8=(a,i)=>{let u=a[1]*Math.PI/180,f=i[1]*Math.PI/180,m=(i[0]-a[0])*Math.PI/180,s=Math.sin(m)*Math.cos(f),I=Math.cos(u)*Math.sin(f)-Math.sin(u)*Math.cos(f)*Math.cos(m);return(Math.atan2(s,I)*180/Math.PI+360)%360},ow=({appId:a,initialLocation:i=[6.1258,45.9058],isMoving:u=!1,simulationPath:f,simulationSpeed:m=1,mockJWTToken:s,children:I})=>{let[D,q]=(0,pr.useState)(u),[j,te]=(0,pr.useState)(i),[J,ae]=(0,pr.useState)(0),[Q,Ie]=(0,pr.useState)(m),[ye,pe]=(0,pr.useState)(!1),[ue,re]=(0,pr.useState)(!0),fe=(0,pr.useRef)(null),ge=(0,pr.useRef)(0),Pe=(0,pr.useRef)(null),Le=(0,pr.useRef)({autoMove:D,heading:J,location:j,mockJWTToken:s,pushLocationUpdate:()=>{},setHeading:ae,setLocation:te,simulationPath:f,speedMultiplier:Q}),H=(0,pr.useCallback)(()=>{let Z=Le.current,K={accelerometer:null,heading:{accuracy:3,magneticHeading:Z.heading,trueHeading:Z.heading},location:{coords:{accuracy:10,altitude:0,altitudeAccuracy:null,heading:Z.heading,latitude:Z.location[1],longitude:Z.location[0],speed:Z.autoMove?1.5*Z.speedMultiplier:0},timestamp:Date.now()},timestamp:Date.now()};window.__MiniAppBridge?.onNativeMessage({eventName:"LOCATION_STREAM_UPDATE",payload:K,type:"EVENT"})},[]);return(0,pr.useEffect)(()=>{Le.current={autoMove:D,heading:J,location:j,mockJWTToken:s,pushLocationUpdate:H,setHeading:ae,setLocation:te,simulationPath:f,speedMultiplier:Q}},[j,J,D,H,f,Q,s]),(0,pr.useEffect)(()=>{q(u)},[u]),(0,pr.useEffect)(()=>{Ie(m)},[m]),(0,pr.useEffect)(()=>{f&&f.length>0&&(ge.current=0,te(f[0]))},[f]),(0,pr.useEffect)(()=>{fe.current&&Pe.current&&er.bridge.send("START_LOCATION_STREAM",Pe.current)},[Q]),(0,pr.useEffect)(()=>{let Z=er.bridge,K=Z.send.bind(Z),ve=()=>{fe.current&&(clearInterval(fe.current),fe.current=null),Pe.current=null},De=Re=>{ve(),Pe.current=Re||{};let Fe=Re?.interval||500,qe=Math.max(10,Fe/Le.current.speedMultiplier);fe.current=setInterval(()=>{let Ne=Le.current;if(Ne.autoMove)if(Ne.simulationPath&&Ne.simulationPath.length>0)if(ge.current<Ne.simulationPath.length-1){let Xe=Ne.simulationPath[ge.current],gt=Ne.simulationPath[ge.current+1];ge.current+=1;let xt=T8(Xe,gt);Ne.setHeading(xt),Ne.setLocation(gt)}else Ne.setLocation(Ne.simulationPath[Ne.simulationPath.length-1]);else Ne.setLocation(Xe=>[Xe[0]+(Math.random()-.5)*1e-4,Xe[1]+(Math.random()-.5)*1e-4]);Ne.pushLocationUpdate()},qe)},et=async Re=>{let{url:Fe,method:qe="GET",headers:Ne={},body:Xe}=Re,gt=Le.current,xt=new Headers(Ne);gt.mockJWTToken&&xt.set("Authorization",`Bearer ${gt.mockJWTToken.replace("Bearer ","")}`),Xe&&typeof Xe=="object"&&!xt.has("Content-Type")&&xt.set("Content-Type","application/json");try{let Qe=await fetch(Fe,{body:Xe?typeof Xe=="string"?Xe:JSON.stringify(Xe):void 0,headers:xt,method:qe}),qt=Qe.headers.get("content-type"),ga;qt?.includes("application/json")?ga=await Qe.json():ga=await Qe.text();let Va={};return Qe.headers.forEach((ut,ft)=>{Va[ft]=ut}),{data:ga,headers:Va,status:Qe.status,statusText:Qe.statusText}}catch(Qe){throw{error:Qe.message||"Network request failed",status:0}}};return Z.send=async(Re,Fe)=>{if(Re==="INITIALIZE")return Promise.resolve({appId:a,context:{theme:"dark"},description:"Mocked for Dev",env:{},insets:{bottom:0,left:0,right:0,top:0},name:"Vite Dev (Mock)",params:{},profile:{admin:!0,countryCode:"FR",createdAt:new Date().toISOString(),email:"caveman@up.app",firstName:"Smart",fullName:"Smart Caveman",lastName:"Caveman",localNumber:"0600000000",ups:100,username:"smart_caveman",uuid:"mock-user-42",xp:500},success:!0,userData:{},uuid:a||"mock-app-id",version:"1.0.0"});if(Re==="GET_CURRENT_POSITION"){let qe=Le.current;return Promise.resolve({coords:{accuracy:10,altitude:0,altitudeAccuracy:0,heading:qe.heading,latitude:qe.location[1],longitude:qe.location[0],speed:qe.autoMove?1.5*qe.speedMultiplier:0},timestamp:Date.now()})}if(Re==="START_LOCATION_STREAM")return De(Fe),Promise.resolve();if(Re==="STOP_LOCATION_STREAM")return ve(),Promise.resolve();if(Re==="NETWORK_REQUEST")return et(Fe);if(Re==="STORAGE_GET"||Re==="SECURE_GET")return Promise.resolve(localStorage.getItem(`mock_sdk_${Fe.key}`));if(Re==="STORAGE_SET"||Re==="SECURE_SET")return localStorage.setItem(`mock_sdk_${Fe.key}`,Fe.value),Promise.resolve();if(Re==="GET_USER_PROFILE")return Promise.resolve({admin:!0,countryCode:"FR",createdAt:new Date().toISOString(),email:"caveman@up.app",firstName:"Smart",fullName:"Smart Caveman",lastName:"Caveman",localNumber:"0600000000",ups:100,username:"smart_caveman",uuid:"mock-user-42",xp:500});if(Re==="GET_PROFILE_PICTURE"){let qe=Fe?.uuids||[];if(qe.length===0)return Promise.resolve("https://api.dicebear.com/9.x/rings/png?seed=dummy");let Ne={};for(let Xe of qe)Ne[Xe]=`https://api.dicebear.com/9.x/rings/png?seed=${Xe}`;return Promise.resolve(Ne)}return Re==="GET_FIDELITY_BALANCE"?Promise.resolve({balance:1337,currency:"FPoints"}):Re==="PAYMENT_REQUEST"?Promise.resolve({success:!0,transactionId:`tx_${Math.random().toString(36).slice(2)}`}):Re==="TRIGGER_HAPTIC"||Re==="EXIT"||Re==="UPDATE_CONTEXT"?Promise.resolve({success:!0}):K(Re,Fe)},pe(!0),()=>{ve(),Z.send=K}},[a]),ye?(0,Ot.jsxs)("div",{className:"relative w-full h-full",children:[(0,Ot.jsx)("div",{className:"w-full h-full",children:I}),ue?(0,Ot.jsx)(Oa,{className:"fixed bottom-4 right-4 w-8 h-8 rounded-full bg-slate-900/60 backdrop-blur-sm border border-slate-700/50 flex items-center justify-center text-slate-400 hover:text-blue-400 hover:bg-slate-900/80 z-[9999] transition-all shadow-lg group p-0!",onClick:()=>re(!1),title:"Open Simulation Controls",type:"button",variant:"ghost",children:(0,Ot.jsxs)("svg",{className:"group-hover:scale-110 transition-transform",fill:"none",height:"14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"14",xmlns:"http://www.w3.org/2000/svg",children:[(0,Ot.jsx)("path",{d:"M21 4H3"}),(0,Ot.jsx)("path",{d:"M10 8H3"}),(0,Ot.jsx)("path",{d:"M21 12H3"}),(0,Ot.jsx)("path",{d:"M10 16H3"}),(0,Ot.jsx)("path",{d:"M21 20H3"}),(0,Ot.jsx)("circle",{cx:"14",cy:"8",r:"2"}),(0,Ot.jsx)("circle",{cx:"14",cy:"16",r:"2"})]})}):(0,Ot.jsxs)("div",{className:"fixed bottom-4 right-4 bg-slate-900 text-slate-300 font-mono text-xs rounded-xl shadow-2xl border border-slate-700 pointer-events-auto flex flex-col w-80 overflow-hidden animate-in slide-in-from-right duration-300",style:{zIndex:9998},children:[(0,Ot.jsxs)("div",{className:"flex justify-between items-center p-3 border-b border-slate-800 cursor-pointer bg-slate-800/50 hover:bg-slate-800 transition-colors",onClick:()=>re(!0),children:[(0,Ot.jsxs)("span",{className:"font-bold text-slate-100 flex items-center gap-2",children:[(0,Ot.jsx)("span",{className:"text-lg",children:"\u{1F6E0}\uFE0F"})," Simulation Controls"]}),(0,Ot.jsx)(Oa,{className:"text-slate-500 hover:text-white p-0 h-auto hover:bg-transparent cursor-pointer",type:"button",variant:"ghost",children:"\u25BC"})]}),(0,Ot.jsxs)("div",{className:"p-4 flex flex-col gap-3",children:[(0,Ot.jsxs)("div",{className:"flex justify-between items-center",children:[(0,Ot.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,Ot.jsx)("input",{checked:D,className:"accent-blue-500 w-4 h-4",onChange:Z=>q(Z.target.checked),type:"checkbox"}),(0,Ot.jsxs)("span",{className:"text-slate-200 font-bold",children:["Auto-Move ",f?"(Path)":"(Random)"]})]}),(0,Ot.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ot.jsx)("span",{className:"text-[10px] text-slate-500",children:"Speed:"}),(0,Ot.jsx)("select",{className:"bg-slate-800 border border-slate-700 rounded px-1 py-0.5 text-white focus:outline-none focus:border-blue-500 text-[10px]",onChange:Z=>Ie(Number(Z.target.value)),value:Q,children:[1,2,5,10,50,100,250].map(Z=>(0,Ot.jsxs)("option",{value:Z,children:[Z,"x"]},Z))})]})]}),(0,Ot.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,Ot.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Ot.jsx)("span",{className:"text-[10px] text-slate-500 text-left",children:"Lng"}),(0,Ot.jsx)("input",{className:"bg-slate-800 border border-slate-700 rounded px-2 py-1 text-white focus:outline-none focus:border-blue-500",onChange:Z=>{let K=parseFloat(Z.target.value)||0;te([K,j[1]]),H()},step:"0.001",type:"number",value:j[0]})]}),(0,Ot.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Ot.jsx)("span",{className:"text-[10px] text-slate-500 text-left",children:"Lat"}),(0,Ot.jsx)("input",{className:"bg-slate-800 border border-slate-700 rounded px-2 py-1 text-white focus:outline-none focus:border-blue-500",onChange:Z=>{let K=parseFloat(Z.target.value)||0;te([j[0],K]),H()},step:"0.001",type:"number",value:j[1]})]}),(0,Ot.jsxs)("div",{className:"flex flex-col gap-1 col-span-2",children:[(0,Ot.jsx)("span",{className:"text-[10px] text-slate-500",children:"Heading (Degrees)"}),(0,Ot.jsx)("input",{className:"w-full accent-blue-500",max:"360",min:"0",onChange:Z=>{ae(parseInt(Z.target.value,10)),H()},type:"range",value:J}),(0,Ot.jsxs)("div",{className:"text-right text-slate-400",children:[J,"\xB0"]})]})]})]})]})]}):null};var es=Ue(nt(),1),ma=Ue(Mt(),1),nw=({isOpen:a=!1,onClose:i})=>{let[u,f]=(0,es.useState)(a),[m,s]=(0,es.useState)([]),I=(0,es.useRef)(null);(0,es.useEffect)(()=>{f(a)},[a]);let D=()=>s([]),q=(0,es.useCallback)((j,te)=>{if(j.includes("LOCATION_STREAM_UPDATE"))return;let J={content:typeof te=="string"?te:JSON.stringify(te,null,2),id:Math.random().toString(36).slice(2),label:j,time:new Date().toLocaleTimeString()};s(ae=>[J,...ae].slice(0,100))},[]);return(0,es.useEffect)(()=>{if(typeof window>"u")return;let j=er.bridge,te=j.send.bind(j);j.send=async(ae,Q)=>(q(`OUT: ${ae}`,Q),te(ae,Q));let J=j.handleNativeMessage.bind(j);return j.handleNativeMessage=ae=>{let Q=ae.eventName||ae.event||ae.type||"MSG";typeof Q=="string"&&(q(`IN: ${Q}`,ae.payload||ae.value||ae),J(ae))},()=>{j.send=te,j.handleNativeMessage=J}},[q]),u?(0,ma.jsxs)("div",{className:"fixed inset-x-0 bottom-0 w-full bg-[#0a080f] border-t border-slate-800 z-[9998] p-4 shadow-2xl flex flex-col animate-in slide-in-from-bottom duration-300",children:[(0,ma.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,ma.jsxs)("span",{className:"text-[10px] font-bold uppercase tracking-widest text-slate-400 flex items-center gap-2",children:[(0,ma.jsx)("span",{className:"w-2 h-2 rounded-full bg-emerald-500 animate-pulse"}),"UP SDK Debug Console"]}),(0,ma.jsxs)("div",{className:"flex gap-4",children:[(0,ma.jsx)(Oa,{className:"text-[10px] text-slate-500 font-bold uppercase hover:text-slate-300 hover:bg-transparent transition-colors p-0 h-auto cursor-pointer",onClick:D,type:"button",variant:"ghost",children:"Clear"}),(0,ma.jsx)(Oa,{className:"text-[10px] text-pink-500 font-bold uppercase hover:text-pink-400 hover:bg-transparent transition-colors p-0 h-auto cursor-pointer",onClick:()=>{f(!1),i&&i()},type:"button",variant:"ghost",children:"Close"})]})]}),(0,ma.jsx)("div",{className:"bg-black/80 rounded-xl p-3 font-mono text-[10px] text-emerald-400 min-h-[120px] max-h-[240px] overflow-y-auto border border-slate-900 custom-scrollbar",ref:I,children:m.length===0?(0,ma.jsx)("div",{className:"text-slate-600 italic text-center py-8",children:"No logs yet. Interacting with the SDK will show events here."}):m.map(j=>(0,ma.jsxs)("div",{className:"mb-3 pb-3 border-b border-slate-900/50 last:border-0 last:mb-0 last:pb-0",children:[(0,ma.jsxs)("div",{className:"flex gap-2 text-slate-500 mb-1 items-center",children:[(0,ma.jsx)("span",{className:"text-[8px]",children:j.time}),(0,ma.jsx)("span",{className:"font-bold text-white uppercase text-[8px] bg-slate-800 px-1.5 py-0.5 rounded leading-none",children:j.label})]}),(0,ma.jsx)("pre",{className:"whitespace-pre-wrap break-all opacity-90",children:j.content})]},j.id))})]}):(0,ma.jsx)(Oa,{className:"fixed bottom-4 left-4 w-8 h-8 rounded-full bg-slate-900/60 backdrop-blur-sm border border-slate-700/50 flex items-center justify-center text-slate-400 hover:text-emerald-400 hover:bg-slate-900/80 transition-all z-[9998] shadow-lg group p-0!",onClick:()=>f(!0),title:"Open Debug Console",type:"button",variant:"ghost",children:(0,ma.jsxs)("svg",{className:"group-hover:scale-110 transition-transform",fill:"none",height:"14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"14",xmlns:"http://www.w3.org/2000/svg",children:[(0,ma.jsx)("path",{d:"m8 2 1.88 1.88"}),(0,ma.jsx)("path",{d:"M14.12 3.88 16 2"}),(0,ma.jsx)("path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1"}),(0,ma.jsx)("path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6"}),(0,ma.jsx)("path",{d:"M12 20v-9"}),(0,ma.jsx)("path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5"}),(0,ma.jsx)("path",{d:"M6 13H2"}),(0,ma.jsx)("path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4"}),(0,ma.jsx)("path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4"}),(0,ma.jsx)("path",{d:"M22 13h-4"}),(0,ma.jsx)("path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4"})]})})};var th=Ue(nt(),1);var Js=Ue(Mt(),1),sw=(0,th.createContext)({isMocked:!1}),I8=()=>(0,th.useContext)(sw).isMocked,M8=({children:a,debug:i=!1,...u})=>{let f=typeof window<"u"&&!(window.__UP_REACT_NATIVE_APP__===!0||window.ReactNativeWebView),m=(0,th.useMemo)(()=>({isMocked:f}),[f]),s=(0,Js.jsxs)(Js.Fragment,{children:[a,(i||f)&&(0,Js.jsx)(nw,{})]});return f?(0,Js.jsx)(sw.Provider,{value:m,children:(0,Js.jsx)(ow,{...u,children:s})}):(0,Js.jsx)(sw.Provider,{value:m,children:s})};async function E8(a,i){return ky.fetchRoute(a,i)}function A8(a,i,u){let f=`sdk-route-${i}`,m=`sdk-route-casing-${i}`,s=`sdk-route-line-${i}`,I={features:[{geometry:u.payload.routeData.geometry,properties:{},type:"Feature"}],type:"FeatureCollection"},D=a.getSource(f);D?D.setData(I):(a.addSource(f,{data:I,type:"geojson"}),a.addLayer({id:m,layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#111111","line-opacity":.8,"line-width":8},source:f,type:"line"}),a.addLayer({id:s,layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#3b82f6","line-width":4},source:f,type:"line"}))}function P8(a,i){let u=`sdk-route-${i}`,f=`sdk-route-casing-${i}`,m=`sdk-route-line-${i}`;a.getLayer(m)&&a.removeLayer(m),a.getLayer(f)&&a.removeLayer(f),a.getSource(u)&&a.removeSource(u)}var R8=er;return O6(D8);})();
|
|
857
857
|
/*! Bundled license information:
|
|
858
858
|
|
|
859
859
|
react/cjs/react.production.js:
|