react-route-profile 0.1.27 → 0.1.29
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.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {Status,Wrapper}from'@googlemaps/react-wrapper';import*as
|
|
1
|
+
import {Status,Wrapper}from'@googlemaps/react-wrapper';import*as k from'react';import {createContext,useContext,useMemo,useState,useEffect,useCallback,useRef,useId}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import Ge from'./Loader.module-M6WPG37K.module.css';import {ResponsiveContainer,ComposedChart,CartesianGrid,Customized,XAxis,YAxis,Tooltip,Line,ReferenceDot,ReferenceLine}from'recharts';import rt from'./surface_asphalt-ZUAYWE5E.png';import nt from'./surface_compacted-JVQXEHW6.png';import ot from'./surface_concrete-TRX2AGHQ.png';import st from'./surface_natural-AFI6LXRM.png';import it from'./surface_penetrated-4K24DL3E.png';import Dt from'./GoogleMapCanvas.module-GCGVA6T4.module.css';import Ne from'./RouteMap.module-4GSEMCKC.module.css';import'./index-DIK6ZNA4.css';var X=()=>typeof window>"u"?true:window.innerWidth>=window.innerHeight,G=()=>{let[e,r]=useState(X);return useEffect(()=>{let n=()=>r(X());return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),{isHorizontal:e,isVertical:!e}};var w={colors:{primary:"rgba(14, 165, 233, 1)",primaryMuted:"rgba(14, 165, 233, 0.7)",accent:"rgba(132, 204, 22, 1)",surface:"rgba(248, 250, 252, 1)"},marker:{outer:"rgba(132, 204, 22, 1)",inner:"rgba(248, 250, 252, 1)",startInner:"rgba(34, 197, 94, 1)",finishInner:"rgba(239, 68, 68, 1)"},dots:{mapActive:"rgba(132, 204, 22, 1)",chart:"rgba(132, 204, 22, 1)",chartActive:"rgba(132, 204, 22, 1)"},map:{strokeWeight:10,markerSize:50,markerLabelFontSize:20,markerLabelFontWeight:"bold",hoverMarkerScale:6},chart:{margin:{top:4,right:8,bottom:4,left:8},gridStroke:"rgba(255,255,255,0.08)",gridDasharray:"3 3",axisStroke:"rgba(226, 232, 240, 0.7)",cursorStroke:"rgba(226,232,240,0.4)",cursorStrokeWidth:1,yAxisWidth:60,lineStrokeWidth:1,dotRadius:3,dotOpacity:.9,activeDotRadius:3,referenceDotRadius:7,referenceLineOpacity:.5,gradientStartOpacity:.6,gradientEndOpacity:.1,xTickFontSize:12,xTickDy:12,xTickUnitFontSize:10,xTickUnitDx:2,yTickFontSize:12,yTickDy:4,yTickUnitFontSize:10,yTickUnitDx:2},tooltip:{background:"rgba(15,23,42,0.9)",textColor:"#e2e8f0",padding:"6px 8px",borderRadius:6},markerShape:{size:33,lift:20,text:{fontSize:12,fontWeight:300,letterSpacing:2,xOffset:15,lineHeight:12,startLiftPerWord:10}}};var V=createContext(w),$e=e=>({colors:{...w.colors,...e?.colors??{}},marker:{...w.marker,...e?.marker??{}},dots:{...w.dots,...e?.dots??{}},map:{...w.map,...e?.map??{}},chart:{...w.chart,...e?.chart??{}},tooltip:{...w.tooltip,...e?.tooltip??{}},markerShape:{...w.markerShape,...e?.markerShape??{},text:{...w.markerShape.text,...e?.markerShape?.text??{}}}}),N=({theme:e,children:r})=>{let n=useMemo(()=>$e(e),[e]);return jsx(V.Provider,{value:n,children:r})},h=()=>useContext(V);var Ve=({message:e="Loading map...",height:r="100dvh"})=>{let n=h(),t={height:r,background:n.colors.surface,color:n.colors.primary};return jsx("div",{className:Ge.rrpLoader,style:t,children:e})},J=Ve;var Z=e=>{let{x:r,y:n,payload:t}=e,o=h(),s=Math.round((t?.value??0)/1e3);return jsxs("text",{x:r,y:n,fill:o.chart.axisStroke,fontSize:o.chart.xTickFontSize,textAnchor:"middle",dy:o.chart.xTickDy,children:[jsx("tspan",{children:s}),jsx("tspan",{fontSize:o.chart.xTickUnitFontSize,dx:o.chart.xTickUnitDx,children:"km"})]})};var q=createContext(void 0),j=({children:e})=>{let[r,n]=useState({}),t=useCallback(i=>n(i),[]),o=useCallback(()=>n({}),[]),s=useMemo(()=>({hover:r,setHover:t,clearHover:o}),[r,t,o]);return jsx(q.Provider,{value:s,children:e})},H=()=>{let e=useContext(q);if(!e)throw new Error("useHover must be used within HoverProvider");return e};var ee=e=>{let{cx:r,cy:n,fill:t}=e,o=h();return r===void 0||n===void 0?null:jsx("circle",{cx:r,cy:n,r:o.chart.dotRadius,fill:t,opacity:o.chart.dotOpacity})},te=e=>{let r=h();return jsx(ee,{...e,fill:r.dots.chart})},re=e=>{let r=h();return jsx(ee,{...e,fill:r.dots.mapActive})};var oe=e=>{let{x:r,y:n,payload:t}=e,o=h(),s=Math.round(t?.value??0);return jsxs("text",{x:r,y:n,fill:o.chart.axisStroke,fontSize:o.chart.yTickFontSize,textAnchor:"end",dy:o.chart.yTickDy,children:[jsx("tspan",{children:s}),jsx("tspan",{fontSize:o.chart.yTickUnitFontSize,dx:o.chart.yTickUnitDx,children:"m"})]})};var se=(s=>(s.Asphalt="asphalt",s.Compacted="compacted",s.Concrete="concrete",s.Natural="natural",s.Penetrated="penetrated",s))(se||{});var ie=30,A=16,U={asphalt:{file:rt,width:30,height:22},compacted:{file:nt,width:200,height:16},concrete:{file:ot},natural:{file:st,width:30,height:22},penetrated:{file:it,width:30,height:22}},ce=({route:e,maxDistance:r,xAxisMap:n,offset:t})=>{let o=e.surface??[];if(!o.length)return null;let s=n?Object.values(n)[0]:void 0,i=s?.scale,a=s?.x??t?.left??0,c=s?.width??t?.width??0,m=s?.y??(t?.top??0)+(t?.height??0),l=A,d=m-l;return !i||c<=0?null:jsxs(Fragment,{children:[jsx("defs",{children:Object.entries(U).map(([u,{file:y,width:p,height:v}])=>jsx("pattern",{id:`surface-${u}`,patternUnits:u==="compacted"?void 0:"userSpaceOnUse",width:p??ie,height:v??A,children:jsx("image",{href:y,x:"0",y:"0",width:p??ie,height:v??A})},u))}),jsxs("g",{children:[jsx("rect",{x:a,y:d,width:c,height:l,fill:"none"}),o.map((u,y)=>{let[p,v]=u.segment,S=Math.max(0,Math.min(p,r)),f=Math.max(0,Math.min(v,r)),x=Math.min(S,f),b=Math.max(S,f);if(b<=x)return null;let R=i(x),C=i(b),O=Math.min(R,C),I=Math.max(0,Math.abs(C-R));return I<=0?null:jsx("rect",{x:O,y:d,width:I,height:l,fill:`url(#surface-${u.type})`},`${u.type}-${y}`)})]})]})};var ct=300,ut=(e,r)=>e?.length?e.find(n=>{let[t,o]=n.segment,s=Math.min(t,o),i=Math.max(t,o);return r>=s&&r<=i})??null:null,lt=(e,r)=>e?.length?e.find(n=>{let[t,o]=n.segment,s=Math.min(t,o),i=Math.max(t,o);return r>=s&&r<=i})??null:null,mt=e=>e.charAt(0).toUpperCase()+e.slice(1),ue=e=>{let[r,n]=e,t=Math.min(r,n),o=Math.max(r,n),s=i=>{let c=(i/1e3).toFixed(1);return c.endsWith(".0")?c.slice(0,-2):c};return `(${s(t)} km - ${s(o)} km)`},le=({active:e,payload:r,label:n,accent:t,primary:o,markers:s,surfaces:i,routes:a})=>{let{tooltip:c}=h();if(!e||!r?.length)return null;let m=r[0]?.payload,l=m?.distance??n,d=s.find(f=>Math.abs((f?.distance??-1)-(m?.distance??0))<=ct),u=ut(i,l),y=u?.type?U[u.type]:null,p=lt(a,l),v=Math.trunc(n/1e3),S=Math.round(n%1e3);return jsxs("div",{style:{background:c.background,border:"none",color:c.textColor,padding:"4px 6px",borderRadius:c.borderRadius,fontSize:13,lineHeight:1.2},children:[jsxs("div",{style:{fontWeight:600,color:o},children:[v," km ",S," m"]}),jsxs("div",{children:["Elevation: ",jsxs("strong",{children:[Math.round(m?.elevation??0)," m"]})]}),u?.type?jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[jsx("svg",{width:"20",height:"14","aria-hidden":"true",style:{display:"block"},children:y?jsx("image",{href:y.file,x:"0",y:"0",width:"20",height:"14",preserveAspectRatio:"xMidYMid slice"}):jsx("rect",{width:"20",height:"14",fill:c.textColor})}),jsx("span",{children:mt(u.type)}),jsx("span",{children:ue(u.segment)})]}):null,p?jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[jsx("svg",{width:"20",height:"14","aria-hidden":"true",style:{display:"block"},children:jsx("rect",{width:"20",height:"14",fill:p.color})}),jsx("span",{children:p.id}),jsx("span",{children:ue(p.segment)})]}):null,d?.name?jsx("div",{style:{color:t,fontWeight:600},children:d.name}):null]})};var me=`<svg stroke="currentColor" fill="#84CC16" stroke-width="2" viewBox="0 0 24 24" aria-hidden="true" height="200px" width="200px" xmlns="http://www.w3.org/2000/svg">
|
|
2
2
|
<path stroke-linecap="round" stroke-linejoin="round" d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"></path>
|
|
3
3
|
<path fill="white" stroke-linecap="round" stroke-linejoin="round" d="M15 11a3 3 0 11-6 0 3 3 0 016 0z"></path>
|
|
4
4
|
</svg>
|
|
5
|
-
`;var
|
|
5
|
+
`;var pt=(e,r,n)=>{let t=0;return e.replace(/fill="[^"]*"/g,o=>(t+=1,t===1?`fill="${r}"`:t===2?`fill="${n}"`:o))},L=(e,r)=>{let n=pt(me,e,r).trim();return `data:image/svg+xml,${encodeURIComponent(n).replace(/'/g,"%27").replace(/"/g,"%22")}`};var de=e=>{let{cx:r,cy:n,fill:t,name:o}=e,s=h(),i=s.markerShape,a=i.size,c=useMemo(()=>L(s.marker.outer,s.marker.inner),[s.marker.inner,s.marker.outer]);if(r===void 0||n===void 0)return null;let m=typeof o=="string"?o.split(/\s+/).map(l=>l.trim()).filter(Boolean):[];return jsxs("g",{children:[jsx(re,{cx:r,cy:n}),jsx("image",{x:r-a/2,y:n-a/2-i.lift,width:a,height:a,href:c}),o?jsx(gt,{words:m,cx:r,cy:n,fill:t}):null]})},gt=({words:e,cx:r,cy:n,fill:t})=>{let s=h().markerShape.text;return jsx("text",{y:n-e.length*s.startLiftPerWord,fill:t||"#fff",fontSize:s.fontSize,fontWeight:s.fontWeight,letterSpacing:s.letterSpacing,style:{userSelect:"none"},children:e.map((i,a)=>jsx(vt,{word:i,index:a,cx:r},i))})},vt=({word:e,index:r,cx:n})=>{let o=h().markerShape.text,s=useId();return jsx("tspan",{x:n+o.xOffset,dy:r===0?0:o.lineHeight,children:e},s)};var fe=({route:e,maxDistance:r,belowHeight:n=0,xAxisMap:t,offset:o})=>{let s=e.routes??[];if(!s.length)return null;let i=t?Object.values(t)[0]:void 0,a=i?.scale,c=i?.x??o?.left??0,m=i?.width??o?.width??0,l=i?.y??(o?.top??0)+(o?.height??0),d=16,u=l-n-d;return !a||m<=0?null:jsxs("g",{children:[jsx("rect",{x:c,y:u,width:m,height:d,fill:"none"}),s.map((y,p)=>{let[v,S]=y.segment,f=Math.max(0,Math.min(v,r)),x=Math.max(0,Math.min(S,r)),b=Math.min(f,x),R=Math.max(f,x);if(R<=b)return null;let C=a(b),O=a(R),I=Math.min(C,O),z=Math.max(0,Math.abs(O-C));return z<=0?null:jsxs("g",{children:[jsx("rect",{x:I,y:u,width:z,height:d,fill:y.color}),jsx("text",{x:I+z/2,y:u+d/2,fill:"#000000",fontSize:10,fontWeight:600,textAnchor:"middle",dominantBaseline:"middle",children:y.id})]},`${y.id}-${p}`)})]})};function ge(e){let[r,n]=useState(null),t=useMemo(()=>r!=null?e[r]:null,[r,e]),o=useCallback(()=>{n(null);},[]),s=useCallback(i=>{if(!e.length)return;let a=0,c=e.length-1;for(;a<c;){let l=Math.floor((a+c)/2);e[l].distance<i?a=l+1:c=l;}let m=a;if(a>0){let l=e[a-1],d=e[a];Math.abs(l.distance-i)<Math.abs(d.distance-i)&&(m=a-1);}n(m);},[e]);return {activeIndex:r,activePoint:t,triggerByXValue:s,clearActiveIndex:o}}var ve=e=>e.length?e[e.length-1].distance:0,ye=(e,r=2e3)=>{let n=[];for(let t=0;t<=e;t+=r)n.push(t);return n[n.length-1]<e&&n.push(e),n},Se=e=>[...e.geoJson?.features?.find(o=>o?.geometry?.type==="LineString"&&o?.properties?.elevationProfile?.points)?.properties?.elevationProfile?.points||[]].sort((o,s)=>(o?.distance??0)-(s?.distance??0)),xe=e=>(e.geoJson?.features?.find(t=>t?.geometry?.type==="LineString"&&t?.geometry?.coordinates)).geometry.coordinates,we=e=>{if(!e.length)return [0,0];let r=e.map(s=>s.elevation),n=Math.min(...r),t=Math.max(...r),o=Math.max(10,(t-n)*.05);return [Math.floor(n-o),Math.ceil(t+o)]},be=(e,r=false)=>{let[n,t]=e,o=(t-n)*1.2,s=Math.max(10,Math.round(o/6/10)*10||50),i=r?-20:0,a=Math.floor((n-(o-(t-n))/2)/s)*s+i,c=Math.ceil((t+(o-(t-n))/2)/s)*s+i,m=[];for(let l=a;l<=c+s/2;l+=s)m.push(l);return [a,c,m]},Ee=(e,r)=>{if(!e?.length)return [];let t=(r?.features??[]).filter(s=>s?.geometry?.type==="Point"),o=[];return t.forEach(s=>{let i=s?.geometry?.coordinates;if(!Array.isArray(i)||i.length<2)return;let[a,c]=i;if(!Number.isFinite(c)||!Number.isFinite(a))return;let m=e.reduce((l,d)=>{let u=Math.pow(d.lat-c,2)+Math.pow(d.lng-a,2);return u<l.dist?{point:d,dist:u}:l},{point:null,dist:Number.POSITIVE_INFINITY});if(m.point){if(m.point.distance===0)return;o.push({distance:m.point.distance,elevation:m.point.elevation,name:s?.properties?.name});}}),o.sort((s,i)=>(s.distance??0)-(i.distance??0))},Re=(e,r)=>{if(!e.length)return null;let n=null,t=Number.POSITIVE_INFINITY;return e.forEach(([o,s])=>{let i=(s-r.lat)**2+(o-r.lng)**2;i<t&&(t=i,n={lat:s,lng:o});}),n},ke=(e,r)=>{if(!e.length)return null;let n=null,t=Number.POSITIVE_INFINITY;return e.forEach(o=>{let s=(o.lat-r[0])**2+(o.lng-r[1])**2;s<t&&(t=s,n=o);}),n};var Te=(e,r,n=1e3)=>r&&Math.abs((r.distance??0)-(e.distance??0))<n;var Y=({route:e})=>{let{hover:r,setHover:n}=H(),t=h(),o=useMemo(()=>Se(e),[e]),s=useMemo(()=>Ee(o,e.geoJson),[o,e.geoJson]),i=ve(o),a=ye(i),[c,m]=we(o),[l,d,u]=useMemo(()=>be([c,m],!!e.surface?.length),[c,m,e.surface?.length]),{activeIndex:y,activePoint:p,triggerByXValue:v,clearActiveIndex:S}=ge(o);return useEffect(()=>{if(r.source==="chart"||!r.lat||!r.lng)return;let f=ke(o,[r.lat,r.lng]);f&&v(f.distance);},[r,o,v]),o.length?jsx(ResponsiveContainer,{width:"100%",height:"100%",style:{userSelect:"none"},children:jsxs(ComposedChart,{data:o,margin:t.chart.margin,onMouseMove:({activePayload:f})=>{y&&S();let x=f?.[0];if(!x)return;let{lat:b,lng:R}=x.payload;n({lat:b,lng:R,source:"chart"});},onMouseEnter:()=>S(),children:[jsx("defs",{children:jsxs("linearGradient",{id:"elevationGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[jsx("stop",{offset:"0%",stopColor:t.colors.primary,stopOpacity:t.chart.gradientStartOpacity}),jsx("stop",{offset:"100%",stopColor:t.colors.primaryMuted,stopOpacity:t.chart.gradientEndOpacity})]})}),jsx(CartesianGrid,{stroke:t.chart.gridStroke,strokeDasharray:t.chart.gridDasharray}),jsx(Customized,{component:jsx(fe,{route:e,maxDistance:i,belowHeight:A})}),jsx(Customized,{component:jsx(ce,{route:e,maxDistance:i})}),jsx(XAxis,{dataKey:"distance",type:"number",domain:[0,i],ticks:a,tick:jsx(Z,{}),stroke:t.chart.axisStroke}),jsx(YAxis,{dataKey:"elevation",tick:jsx(oe,{}),domain:[l,d],ticks:u,stroke:t.chart.axisStroke,width:t.chart.yAxisWidth}),jsx(Tooltip,{cursor:{stroke:t.chart.cursorStroke,strokeWidth:t.chart.cursorStrokeWidth},content:jsx(le,{accent:t.colors.accent,primary:t.colors.primary,markers:s,surfaces:e.surface,routes:e.routes})}),jsx(Line,{type:"monotone",dataKey:"elevation",stroke:t.colors.primary,strokeWidth:t.chart.lineStrokeWidth,dot:f=>{let{cx:x,cy:b,index:R}=f;if(R===y&&p)return jsx(te,{cx:x,cy:b},`dot-${x}-${b}`)},activeDot:{r:t.chart.activeDotRadius,fill:t.dots.chartActive,strokeWidth:0},fill:"url(#elevationGradient)",isAnimationActive:false}),s.length>0&&s.map((f,x)=>{let b=Te(s[x],s[x+1]);return jsx(ReferenceDot,{x:f.distance,y:f.elevation,r:t.chart.referenceDotRadius,shape:R=>jsx(de,{...R,name:b?void 0:f.name,fill:t.colors.accent})},`${f.distance}-${x}`)}),p&&jsx(ReferenceLine,{x:p.distance,opacity:t.chart.referenceLineOpacity})]})}):null};var Le={lat:48.9325937,lng:20.3452306},Pe=13,Ie=12;var Oe=({route:e,height:r,isHorizontal:n})=>{let t=h(),{hover:o,setHover:s}=H(),i=useRef(null),a=useRef(null),c=useRef(null),m=useMemo(()=>xe(e),[e]),l=useMemo(()=>({default:L(t.marker.outer,t.marker.inner),start:L(t.marker.outer,t.marker.startInner),finish:L(t.marker.outer,t.marker.finishInner)}),[t.marker]);return useEffect(()=>{if(!i.current||!window.google?.maps)return;let d=n&&(e.zoomHorizontal||Pe)||e.zoomVertical||Ie,u=new window.google.maps.Map(i.current,{center:e.center||Le,zoom:d,mapTypeId:window.google.maps.MapTypeId.SATELLITE,streetViewControl:false});c.current=u,u.data.setStyle(p=>{let v=p.getProperty("name"),S=p.getProperty("first"),f=p.getProperty("last");return {strokeColor:t.colors.primaryMuted,strokeWeight:t.map.strokeWeight,icon:{url:S?l.start:f?l.finish:l.default,scaledSize:new window.google.maps.Size(t.map.markerSize,t.map.markerSize),optimized:false,zIndex:S||f?100:10,collisionBehavior:window.google?.maps?.CollisionBehavior?.REQUIRED_AND_HIDES_OPTIONAL},label:{className:"rrpMarkerLabel",fontSize:`${t.map.markerLabelFontSize}px`,fontWeight:t.map.markerLabelFontWeight,color:t.colors.accent,text:v}}}),u.data.addGeoJson(e.geoJson);let y=u.addListener("mousemove",p=>{let v=p.latLng;if(!v)return;let S=Re(m,{lat:v.lat(),lng:v.lng()});S&&s({lat:S.lat,lng:S.lng,source:"map"});});return ()=>{y.remove(),u.data.forEach(p=>{u.data.remove(p);}),c.current=null;}},[e,n,t,m,s,l]),useEffect(()=>{if(!i.current||!window.google?.maps)return;let d=c.current;if(!d)return;if(!o.lat||!o.lng){a.current&&(a.current.setMap(null),a.current=null);return}let u={path:window.google.maps.SymbolPath.CIRCLE,scale:t.map.hoverMarkerScale,fillColor:t.dots.mapActive,fillOpacity:1,strokeWeight:0};a.current?a.current.setIcon(u):a.current=new window.google.maps.Marker({map:d,icon:u}),a.current.setPosition({lat:o.lat,lng:o.lng}),a.current.setMap(d);},[o,t]),jsx("div",{ref:i,className:Dt.rrpMapCanvas,style:{height:r}})};var Nt={apiKey:"Oops! Cannot display the map: Google Maps API key missing",[Status.FAILURE]:"Unable to load Google Maps API. Check your API key or network.",[Status.LOADING]:void 0,[Status.SUCCESS]:void 0},He=({type:e,height:r})=>jsx("div",{style:{height:r},children:jsx(J,{message:Nt[e],height:r})}),Ht=(e,r)=>jsx(He,{type:e,height:r}),ze=({apiKey:e,route:r,height:n="100dvh",className:t,style:o,theme:s=w})=>{let{isHorizontal:i}=G();if(!e)return jsx(N,{theme:s,children:jsx(He,{type:"apiKey",height:n})});let a={height:n,width:"100%",...o};return jsx(N,{theme:s,children:jsx(j,{children:jsxs("div",{className:t,style:a,children:[jsx(Wrapper,{apiKey:e,render:c=>Ht(c,n),children:jsx(Oe,{route:r,height:n,isHorizontal:i})}),jsx("div",{className:Ne.rrpChartLayer,children:jsx("div",{className:Ne.rrpChartBody,children:jsx(Y,{route:r})})})]})})})};function Fe(){let[e,r]=k.useState({width:null,height:null}),n=k.useRef(null);return [k.useCallback(o=>{if(n.current&&(n.current.disconnect(),n.current=null),o?.nodeType===Node.ELEMENT_NODE){let s=new ResizeObserver(([i])=>{if(i&&i.borderBoxSize){let{inlineSize:a,blockSize:c}=i.borderBoxSize[0];r({width:a,height:c});}});s.observe(o),n.current=s;}},[]),e]}var Ft=()=>{let[e,{height:r}]=Fe(),n=!!r,t=n?`calc(100dvh - ${r}px)`:"0px";return {refHeader:e,isHeaderReady:n,headerHeight:r,mapHeight:t}};export{ze as RouteMap,se as SurfaceType,N as ThemeProvider,w as theme,Ft as useMapHeader,h as useTheme};//# sourceMappingURL=index.js.map
|
|
6
6
|
//# sourceMappingURL=index.js.map
|