ocearo-ui 2.1.1 → 2.1.2

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.
Files changed (55) hide show
  1. package/404.html +1 -1
  2. package/__next.__PAGE__.txt +3 -3
  3. package/__next._full.txt +3 -3
  4. package/__next._tree.txt +2 -2
  5. package/_next/static/chunks/0-19-ljntm5ig.js +1 -0
  6. package/_next/static/chunks/{096zaxs1gf_3q.js → 0-g-ujyrfgutp.js} +2 -2
  7. package/_next/static/chunks/0c91q-13wh8hk.js +1 -0
  8. package/_next/static/chunks/{2aivnrnff0avu.js → 0fv1wwxeyagln.js} +2 -2
  9. package/_next/static/chunks/0nq1o9-m7bhjg.js +1 -0
  10. package/_next/static/chunks/0o7hu-sypv2u9.js +1 -0
  11. package/_next/static/chunks/{2wayx8t5r5fi9.js → 0ujzg6ofy2r73.js} +1 -1
  12. package/_next/static/chunks/162bfkgcudvew.js +9 -0
  13. package/_next/static/chunks/{1l-jew0-1-3eq.js → 1bvrvkcwf3ge-.js} +2 -2
  14. package/_next/static/chunks/{33u782y6vhw-f.js → 1do-2zwq3ws0f.js} +1 -1
  15. package/_next/static/chunks/{2mzecccvvbjr1.js → 1ho2ekxa9io1_.js} +1 -1
  16. package/_next/static/chunks/1m3-nchdgcxy1.css +3 -0
  17. package/_next/static/chunks/{3qik_nv7zlj4e.js → 1quvj-861o57h.js} +1 -1
  18. package/_next/static/chunks/{0j11dppxb9l0b.js → 1zuex-na8y-w4.js} +1 -1
  19. package/_next/static/chunks/{2r98jty3a4wel.js → 271ys-u920uqd.js} +5 -5
  20. package/_next/static/chunks/2_iau6x7s0vil.js +1131 -0
  21. package/_next/static/chunks/2ab6q6u6uo_bf.js +1 -0
  22. package/_next/static/chunks/2pt-apz8_pa4j.js +1 -0
  23. package/_next/static/chunks/2rnpgrmuyhpkd.js +119 -0
  24. package/_next/static/chunks/3e5jmzthktu9w.js +1 -0
  25. package/_next/static/chunks/3l25j666ze4c1.js +1 -0
  26. package/_next/static/chunks/{2gr1d26f-ymoh.js → 3utjjgdhnlx86.js} +1 -1
  27. package/_next/static/chunks/44f5hh9caupby.js +1 -0
  28. package/_not-found/__next._full.txt +2 -2
  29. package/_not-found/__next._not-found.__PAGE__.txt +2 -2
  30. package/_not-found/__next._tree.txt +2 -2
  31. package/_not-found.html +1 -1
  32. package/_not-found.txt +2 -2
  33. package/index.html +1 -1
  34. package/index.txt +3 -3
  35. package/package.json +1 -1
  36. package/settings/__next._full.txt +2 -2
  37. package/settings/__next._tree.txt +2 -2
  38. package/settings/__next.settings.__PAGE__.txt +2 -2
  39. package/settings.html +1 -1
  40. package/settings.txt +2 -2
  41. package/_next/static/chunks/0b3cus8izqkmg.js +0 -119
  42. package/_next/static/chunks/0zvzu5fnwh4_a.js +0 -9
  43. package/_next/static/chunks/1_g85m2d7jjpo.css +0 -3
  44. package/_next/static/chunks/1arvue9o-atui.js +0 -739
  45. package/_next/static/chunks/1cp1kkarm5gxz.js +0 -1
  46. package/_next/static/chunks/1hz_mzl8l35j8.js +0 -1
  47. package/_next/static/chunks/1k72cpd0x8veh.js +0 -1
  48. package/_next/static/chunks/2fthh9f57zzm2.js +0 -1
  49. package/_next/static/chunks/2v6ebsavxlgyw.js +0 -1
  50. package/_next/static/chunks/3qzb9nvvw-b-k.js +0 -1
  51. package/_next/static/chunks/3td9mnhvcj9cq.js +0 -1
  52. package/_next/static/chunks/432vtxrssprta.js +0 -1
  53. /package/_next/static/{QMD1VkISjzTIQCzLSHPpB → m52l9mE01yTljNwbWjYQ7}/_buildManifest.js +0 -0
  54. /package/_next/static/{QMD1VkISjzTIQCzLSHPpB → m52l9mE01yTljNwbWjYQ7}/_clientMiddlewareManifest.js +0 -0
  55. /package/_next/static/{QMD1VkISjzTIQCzLSHPpB → m52l9mE01yTljNwbWjYQ7}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,78461,e=>{"use strict";var t=e.i(71645),r=e.i(85709),i=e.i(67561);let n=["navigation.headingTrue","navigation.headingMagnetic","navigation.courseOverGroundTrue","navigation.courseOverGroundMagnetic","navigation.position"],a=null;e.s(["default",0,()=>{let{convertLatLonToXY:e}=(0,i.useOcearoContext)(),o=(0,r.useSignalKPaths)(n),s=o["navigation.headingTrue"]??o["navigation.headingMagnetic"]??o["navigation.courseOverGroundTrue"]??o["navigation.courseOverGroundMagnetic"],l=Number.isFinite(s),u=o["navigation.position"],c=Number.isFinite(u?.latitude)&&Number.isFinite(u?.longitude);return{heading:l?s:0,offset:(0,t.useMemo)(()=>{if(!c)return{x:0,y:0};let t={lat:u.latitude,lon:u.longitude};return e(t,(a||(a=t),a))},[u,c,e]),hasFix:c,hasHeading:l}},"getSessionOrigin",0,()=>a])},3666,3950,e=>{"use strict";let t="ocearo-offline-v2",r=["ocearo-offline-v1"],i=!1,n=async(e,{kind:n="tile"}={})=>{if(!("u">typeof caches))return fetch(e,{referrerPolicy:"strict-origin-when-cross-origin"});i||(i=!0,r.forEach(e=>caches.delete(e).catch(()=>{})));let a=await caches.open(t);if("tile"===n){let t=await a.match(e);if(t)return t}try{let t=await fetch(e,{mode:"cors",referrerPolicy:"strict-origin-when-cross-origin"});return t.ok&&await a.put(e,t.clone()),t}catch(r){let t=await a.match(e);if(t)return t;throw r}},a=async e=>{let t=await n(e,{kind:"tile"});if(!t.ok)throw Error(`${t.status} ${e}`);return createImageBitmap(await t.blob())},o=(e,t,r,i)=>{let n=2**i,a=(e,t)=>({x:Math.floor((t+180)/360*n),y:Math.floor((1-Math.log(Math.tan(e*Math.PI/180)+1/Math.cos(e*Math.PI/180))/Math.PI)/2*n)}),o=r/111320,s=r/(111320*Math.cos(e*Math.PI/180)),l=a(e+o,t-s),u=a(e-o,t+s),c=[];for(let e=l.x;e<=u.x;e++)for(let t=l.y;t<=u.y;t++)c.push({z:i,x:e,y:t});return c},s=async({lat:e,lon:t,radiusM:r,layers:i,urls:a=[],onProgress:s})=>{let l=[];for(let{template:n,zooms:a}of i)for(let i of a)for(let a of o(e,t,r,i))l.push(n.replace("{z}",a.z).replace("{x}",a.x).replace("{y}",a.y));l.push(...a);let u=0,c=0,d=[...l],f=async()=>{for(;d.length;){let e=d.shift();try{!(await n(e,{kind:e.includes("forecast")?"forecast":"tile"})).ok&&c++}catch{c++}u++,s?.(u,l.length,c)}};return await Promise.all(Array.from({length:4},f)),{done:u,failed:c,total:l.length}},l=async()=>{if(navigator.storage?.estimate){let{usage:e}=await navigator.storage.estimate();return e}return null},u=async(e,r)=>{if(!("u">typeof caches))return!1;let i=await caches.open(t);return await i.put(e,r),!0},c=async e=>{if(!("u">typeof caches))return null;let r=await caches.open(t);return await r.match(e)||null};e.s(["cachedFetch",0,n,"cachedImage",0,a,"clearOfflineCache",0,()=>"u">typeof caches?caches.delete(t):Promise.resolve(!1),"offlineCacheSize",0,l,"prefetchArea",0,s,"readCached",0,c,"storeCached",0,u],3950);let d={key:null,at:0,field:null},f=(e,t,r,i)=>({lat:e+(i/8*2-1)*4e4/6371e3*180/Math.PI,lon:t+(r/8*2-1)*4e4/(6371e3*Math.cos(e*Math.PI/180))*180/Math.PI}),h=(e,t)=>{let r=[],i=[];for(let n=0;n<9;n++)for(let a=0;a<9;a++){let o=f(e,t,a,n);r.push(o.lat.toFixed(4)),i.push(o.lon.toFixed(4))}return`https://api.open-meteo.com/v1/forecast?latitude=${r.join(",")}&longitude=${i.join(",")}&hourly=wind_speed_10m,wind_direction_10m&wind_speed_unit=ms&forecast_hours=48&timezone=GMT`},m=async(e,t)=>{let r=`${e.toFixed(1)},${t.toFixed(1)}`;if(d.field&&d.key===r&&Date.now()-d.at<18e5)return d.field;let i=h(e,t),a=await n(i,{kind:"forecast"});if(!a.ok)throw Error(`Open-Meteo ${a.status}`);let o=await a.json(),s=Array.isArray(o)?o:[o],l=s[0]?.hourly?.time||[],u=l.length,c=[],f=[];for(let e=0;e<u;e++){let t=new Float32Array(81),r=new Float32Array(81);s.forEach((i,n)=>{let a=i.hourly.wind_speed_10m[e]??0,o=(i.hourly.wind_direction_10m[e]??0)*Math.PI/180;t[n]=-a*Math.sin(o),r[n]=-a*Math.cos(o)}),c.push(t),f.push(r)}let m={origin:{lat:e,lon:t},start:Date.parse(`${l[0]}Z`),hours:u,u:c,v:f,source:"open-meteo"};return d={key:r,at:Date.now(),field:m},m},p=[[0,[98,113,183]],[1,[57,97,159]],[3,[74,148,169]],[5,[77,141,123]],[7,[83,165,83]],[9,[53,159,53]],[11,[167,157,81]],[13,[159,127,58]],[15,[161,108,92]],[17,[129,58,78]],[19,[175,80,136]],[21,[117,74,147]],[24,[109,97,163]],[27,[68,105,141]],[29,[92,144,152]],[36,[125,68,165]]];e.s(["HALF_EXTENT_M",0,4e4,"WINDY_SCALE",0,p,"fetchWindField",0,m,"sampleWind",0,(e,t,r,i=0)=>{let n=Math.min(9-1.001,Math.max(0,(t/4e4+1)/2*8)),a=Math.min(9-1.001,Math.max(0,(r/4e4+1)/2*8)),o=Math.floor(n),s=Math.floor(a),l=n-o,u=a-s,c=Math.min(e.hours-1,Math.max(0,Math.floor(i))),d=Math.min(e.hours-1,c+1),f=Math.min(1,Math.max(0,i-c)),h=(e,t)=>{let r=e[t],i=9*s+o;return(r[i]*(1-l)+r[i+1]*l)*(1-u)+(r[i+9]*(1-l)+r[i+9+1]*l)*u};return{u:h(e.u,c)*(1-f)+h(e.u,d)*f,v:h(e.v,c)*(1-f)+h(e.v,d)*f}},"uniformField",0,(e,t,r,i)=>{let n=new Float32Array(81).fill(-r*Math.sin(i)),a=new Float32Array(81).fill(-r*Math.cos(i));return{origin:{lat:e,lon:t},start:Date.now(),hours:1,u:[n],v:[a],source:"boat"}},"windColor",0,e=>{if(e<=p[0][0])return p[0][1];for(let t=1;t<p.length;t++)if(e<=p[t][0]){let[r,i]=p[t-1],[n,a]=p[t],o=(e-r)/(n-r);return i.map((e,t)=>e+(a[t]-e)*o)}return p[p.length-1][1]},"windFieldUrl",0,h],3666)},71415,e=>{"use strict";var t=e.i(43476),r=e.i(71645),i=e.i(90072),n=e.i(60099),a=e.i(43216),o=e.i(83646),s=e.i(83402),l=e.i(85709),u=e.i(78461),c=e.i(3950),d=e.i(48390);e.i(85269);var f=e.i(22831);let h="https://elevation-tiles-prod.s3.amazonaws.com/terrarium/{z}/{x}/{y}.png",m=10,p=.1,v=["navigation.position","design.draft","environment.tide.heightNow","environment.tide.heightHigh","environment.tide.heightLow","environment.depth.belowSurface","environment.depth.belowKeel"],g=(e,t,r)=>{let i=2**r,n=e*Math.PI/180,a=(1-Math.log(Math.tan(n)+1/Math.cos(n))/Math.PI)/2*i;return{x:(t+180)/360*i,y:a}},y=(e,t,r)=>{let i=2**r;return{lat:180*Math.atan(Math.sinh(Math.PI*(1-2*t/i)))/Math.PI,lon:e/i*360-180}},w=new Map,x=async(e,t,r=h,i=m)=>{let n=g(e,t,i),a=Math.floor(n.x)-1,o=Math.floor(n.y)-1,s=`${r}|${i}/${a},${o}`;if(w.has(s))return w.get(s);let l=document.createElement("canvas");l.width=768,l.height=768;let u=l.getContext("2d",{willReadFrequently:!0});if(!(await Promise.all(Array.from({length:9},async(e,t)=>{let n=a+t%3,s=o+Math.floor(t/3),l=r.replace("{z}",i).replace("{x}",n).replace("{y}",s);try{let e=await (0,c.cachedImage)(l);return u.drawImage(e,t%3*256,256*Math.floor(t/3)),!0}catch{return!1}}))).some(Boolean))return null;let d=u.getImageData(0,0,768,768).data,f=new Float32Array(589824);for(let e=0;e<589824;e++)f[e]=d[4*e+3]<255?NaN:256*d[4*e]+d[4*e+1]+d[4*e+2]/256-32768;let p={heights:f,size:768,nw:y(a,o,i),se:y(a+3,o+3,i),z:i};return w.set(s,p),p},b=async(e,t)=>{let r=(0,d.bathymetryTileTemplate)(),[i,n]=await Promise.all([x(e,t),r?x(e,t,r,13).catch(()=>null):null]);if(!i&&!n)throw Error("No bathymetry");return{global:i,shom:n}},M=(e,t,r)=>{let{heights:i,size:n,nw:a,se:o,z:s}=e,l=(r-a.lon)/(o.lon-a.lon)*(n-1),u=g(a.lat,a.lon,s),c=g(o.lat,o.lon,s),d=(g(t,r,s).y-u.y)/(c.y-u.y)*(n-1);if(l<0||d<0||l>n-1||d>n-1)return NaN;let f=Math.min(n-2,Math.floor(l)),h=Math.min(n-2,Math.floor(d)),m=l-f,p=d-h,v=(e,t)=>i[t*n+e];return(v(f,h)*(1-m)+v(f+1,h)*m)*(1-p)+(v(f,h+1)*(1-m)+v(f+1,h+1)*m)*p},S=`
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,78461,e=>{"use strict";var t=e.i(71645),r=e.i(85709),i=e.i(67561);let n=["navigation.headingTrue","navigation.headingMagnetic","navigation.courseOverGroundTrue","navigation.courseOverGroundMagnetic","navigation.position"],a=null;e.s(["default",0,()=>{let{convertLatLonToXY:e}=(0,i.useOcearoContext)(),o=(0,r.useSignalKPaths)(n),s=o["navigation.headingTrue"]??o["navigation.headingMagnetic"]??o["navigation.courseOverGroundTrue"]??o["navigation.courseOverGroundMagnetic"],l=Number.isFinite(s),u=o["navigation.position"],c=Number.isFinite(u?.latitude)&&Number.isFinite(u?.longitude);return{heading:l?s:0,offset:(0,t.useMemo)(()=>{if(!c)return{x:0,y:0};let t={lat:u.latitude,lon:u.longitude};return e(t,(a||(a=t),a))},[u,c,e]),hasFix:c,hasHeading:l}},"getSessionOrigin",0,()=>a])},3666,3950,e=>{"use strict";let t="ocearo-offline-v2",r=["ocearo-offline-v1"],i=!1,n=async(e,{kind:n="tile"}={})=>{if(!("u">typeof caches))return fetch(e,{referrerPolicy:"strict-origin-when-cross-origin"});i||(i=!0,r.forEach(e=>caches.delete(e).catch(()=>{})));let a=await caches.open(t);if("tile"===n){let t=await a.match(e);if(t)return t}try{let t=await fetch(e,{mode:"cors",referrerPolicy:"strict-origin-when-cross-origin"});if(t.ok)await a.put(e,t.clone());else{let t=await a.match(e);if(t)return t}return t}catch(r){let t=await a.match(e);if(t)return t;throw r}},a=async e=>{let t=await n(e,{kind:"tile"});if(!t.ok)throw Error(`${t.status} ${e}`);return createImageBitmap(await t.blob())},o=(e,t,r,i)=>{let n=2**i,a=(e,t)=>({x:Math.floor((t+180)/360*n),y:Math.floor((1-Math.log(Math.tan(e*Math.PI/180)+1/Math.cos(e*Math.PI/180))/Math.PI)/2*n)}),o=r/111320,s=r/(111320*Math.cos(e*Math.PI/180)),l=a(e+o,t-s),u=a(e-o,t+s),c=[];for(let e=l.x;e<=u.x;e++)for(let t=l.y;t<=u.y;t++)c.push({z:i,x:e,y:t});return c},s=async({lat:e,lon:t,radiusM:r,layers:i,urls:a=[],onProgress:s})=>{let l=[];for(let{template:n,zooms:a}of i)for(let i of a)for(let a of o(e,t,r,i))l.push(n.replace("{z}",a.z).replace("{x}",a.x).replace("{y}",a.y));l.push(...a);let u=0,c=0,d=[...l],f=async()=>{for(;d.length;){let e=d.shift();try{!(await n(e,{kind:e.includes("forecast")?"forecast":"tile"})).ok&&c++}catch{c++}u++,s?.(u,l.length,c)}};return await Promise.all(Array.from({length:4},f)),{done:u,failed:c,total:l.length}},l=async()=>{if(navigator.storage?.estimate){let{usage:e}=await navigator.storage.estimate();return e}return null},u=async(e,r)=>{if(!("u">typeof caches))return!1;let i=await caches.open(t);return await i.put(e,r),!0},c=async e=>{if(!("u">typeof caches))return null;let r=await caches.open(t);return await r.match(e)||null};e.s(["cachedFetch",0,n,"cachedImage",0,a,"clearOfflineCache",0,()=>"u">typeof caches?caches.delete(t):Promise.resolve(!1),"offlineCacheSize",0,l,"prefetchArea",0,s,"readCached",0,c,"storeCached",0,u],3950);let d={key:null,at:0,field:null},f=(e,t,r,i)=>({lat:e+(i/8*2-1)*4e4/6371e3*180/Math.PI,lon:t+(r/8*2-1)*4e4/(6371e3*Math.cos(e*Math.PI/180))*180/Math.PI}),h=(e,t)=>{let r=[],i=[];for(let n=0;n<9;n++)for(let a=0;a<9;a++){let o=f(e,t,a,n);r.push(o.lat.toFixed(4)),i.push(o.lon.toFixed(4))}return`https://api.open-meteo.com/v1/forecast?latitude=${r.join(",")}&longitude=${i.join(",")}&hourly=wind_speed_10m,wind_direction_10m&wind_speed_unit=ms&forecast_hours=48&timezone=GMT`},m=async(e,t)=>{let r=`${e.toFixed(1)},${t.toFixed(1)}`;if(d.field&&d.key===r&&Date.now()-d.at<18e5)return d.field;let i=h(e,t),a=await n(i,{kind:"forecast"});if(!a.ok)throw Error(`Open-Meteo ${a.status}`);let o=await a.json(),s=Array.isArray(o)?o:[o],l=s[0]?.hourly?.time||[],u=l.length,c=[],f=[];for(let e=0;e<u;e++){let t=new Float32Array(81),r=new Float32Array(81);s.forEach((i,n)=>{let a=i.hourly.wind_speed_10m[e]??0,o=(i.hourly.wind_direction_10m[e]??0)*Math.PI/180;t[n]=-a*Math.sin(o),r[n]=-a*Math.cos(o)}),c.push(t),f.push(r)}let m={origin:{lat:e,lon:t},start:Date.parse(`${l[0]}Z`),hours:u,u:c,v:f,source:"open-meteo"};return d={key:r,at:Date.now(),field:m},m},p=[[0,[98,113,183]],[1,[57,97,159]],[3,[74,148,169]],[5,[77,141,123]],[7,[83,165,83]],[9,[53,159,53]],[11,[167,157,81]],[13,[159,127,58]],[15,[161,108,92]],[17,[129,58,78]],[19,[175,80,136]],[21,[117,74,147]],[24,[109,97,163]],[27,[68,105,141]],[29,[92,144,152]],[36,[125,68,165]]];e.s(["HALF_EXTENT_M",0,4e4,"WINDY_SCALE",0,p,"fetchWindField",0,m,"sampleWind",0,(e,t,r,i=0)=>{let n=Math.min(9-1.001,Math.max(0,(t/4e4+1)/2*8)),a=Math.min(9-1.001,Math.max(0,(r/4e4+1)/2*8)),o=Math.floor(n),s=Math.floor(a),l=n-o,u=a-s,c=Math.min(e.hours-1,Math.max(0,Math.floor(i))),d=Math.min(e.hours-1,c+1),f=Math.min(1,Math.max(0,i-c)),h=(e,t)=>{let r=e[t],i=9*s+o;return(r[i]*(1-l)+r[i+1]*l)*(1-u)+(r[i+9]*(1-l)+r[i+9+1]*l)*u};return{u:h(e.u,c)*(1-f)+h(e.u,d)*f,v:h(e.v,c)*(1-f)+h(e.v,d)*f}},"uniformField",0,(e,t,r,i)=>{let n=new Float32Array(81).fill(-r*Math.sin(i)),a=new Float32Array(81).fill(-r*Math.cos(i));return{origin:{lat:e,lon:t},start:Date.now(),hours:1,u:[n],v:[a],source:"boat"}},"windColor",0,e=>{if(e<=p[0][0])return p[0][1];for(let t=1;t<p.length;t++)if(e<=p[t][0]){let[r,i]=p[t-1],[n,a]=p[t],o=(e-r)/(n-r);return i.map((e,t)=>e+(a[t]-e)*o)}return p[p.length-1][1]},"windFieldUrl",0,h],3666)},71415,e=>{"use strict";var t=e.i(43476),r=e.i(71645),i=e.i(90072),n=e.i(60099),a=e.i(43216),o=e.i(83646),s=e.i(83402),l=e.i(85709),u=e.i(78461),c=e.i(3950),d=e.i(48390);e.i(85269);var f=e.i(22831);let h="https://elevation-tiles-prod.s3.amazonaws.com/terrarium/{z}/{x}/{y}.png",m=10,p=.1,v=["navigation.position","design.draft","environment.tide.heightNow","environment.tide.heightHigh","environment.tide.heightLow","environment.depth.belowSurface","environment.depth.belowKeel","environment.depth.belowTransducer","environment.depth.surfaceToTransducer"],g=(e,t,r)=>{let i=2**r,n=e*Math.PI/180,a=(1-Math.log(Math.tan(n)+1/Math.cos(n))/Math.PI)/2*i;return{x:(t+180)/360*i,y:a}},y=(e,t,r)=>{let i=2**r;return{lat:180*Math.atan(Math.sinh(Math.PI*(1-2*t/i)))/Math.PI,lon:e/i*360-180}},w=new Map,x=async(e,t,r=h,i=m)=>{let n=g(e,t,i),a=Math.floor(n.x)-1,o=Math.floor(n.y)-1,s=`${r}|${i}/${a},${o}`;if(w.has(s))return w.get(s);let l=document.createElement("canvas");l.width=768,l.height=768;let u=l.getContext("2d",{willReadFrequently:!0});if(!(await Promise.all(Array.from({length:9},async(e,t)=>{let n=a+t%3,s=o+Math.floor(t/3),l=r.replace("{z}",i).replace("{x}",n).replace("{y}",s);try{let e=await (0,c.cachedImage)(l);return u.drawImage(e,t%3*256,256*Math.floor(t/3)),!0}catch{return!1}}))).some(Boolean))return null;let d=u.getImageData(0,0,768,768).data,f=new Float32Array(589824);for(let e=0;e<589824;e++)f[e]=d[4*e+3]<255?NaN:256*d[4*e]+d[4*e+1]+d[4*e+2]/256-32768;let p={heights:f,size:768,nw:y(a,o,i),se:y(a+3,o+3,i),z:i};return w.set(s,p),p},b=async(e,t)=>{let r=(0,d.bathymetryTileTemplate)(),[i,n]=await Promise.all([x(e,t),r?x(e,t,r,13).catch(()=>null):null]);if(!i&&!n)throw Error("No bathymetry");return{global:i,shom:n}},M=(e,t,r)=>{let{heights:i,size:n,nw:a,se:o,z:s}=e,l=(r-a.lon)/(o.lon-a.lon)*(n-1),u=g(a.lat,a.lon,s),c=g(o.lat,o.lon,s),d=(g(t,r,s).y-u.y)/(c.y-u.y)*(n-1);if(l<0||d<0||l>n-1||d>n-1)return NaN;let f=Math.min(n-2,Math.floor(l)),h=Math.min(n-2,Math.floor(d)),m=l-f,p=d-h,v=(e,t)=>i[t*n+e];return(v(f,h)*(1-m)+v(f+1,h)*m)*(1-p)+(v(f,h+1)*(1-m)+v(f+1,h+1)*m)*p},S=`
2
2
  attribute float aDepth;
3
3
  attribute float aDrying;
4
4
  attribute vec2 aGround;
@@ -104,7 +104,7 @@
104
104
  gl_FragColor = vec4(t.rgb, t.a * vFade);
105
105
  #include <colorspace_fragment>
106
106
  }
107
- `,L=({items:e,palette:n})=>{let{geometry:a,material:o}=(0,r.useMemo)(()=>{if(!e.length)return{};let[t,r]=_,a=Math.ceil(e.length/16),o=document.createElement("canvas");o.width=16*t,o.height=r*a;let s=o.getContext("2d");s.textAlign="center",s.textBaseline="middle";let l=new i.PlaneGeometry(1,1),u=new i.InstancedBufferGeometry;u.index=l.index,u.setAttribute("position",l.attributes.position);let c=new Float32Array(3*e.length),d=new Float32Array(2*e.length);e.forEach((e,i)=>{let a=i%16*t,o=Math.floor(i/16)*r;s.font=`${e.danger?700:600} 28px Inter, Roboto, Arial, sans-serif`,s.lineWidth=7,s.strokeStyle=n.halo,s.strokeText(e.text,a+t/2,o+r/2+1),s.fillStyle=e.danger?n.danger:n.text,s.fillText(e.text,a+t/2,o+r/2+1),c.set(e.position,3*i),d.set([i%16,Math.floor(i/16)],2*i)}),u.setAttribute("aCenter",new i.InstancedBufferAttribute(c,3)),u.setAttribute("aCell",new i.InstancedBufferAttribute(d,2)),u.instanceCount=e.length;let f=new i.CanvasTexture(o);f.colorSpace=i.SRGBColorSpace,f.flipY=!1,f.anisotropy=4;let h=new i.ShaderMaterial({uniforms:{uMap:{value:f},uAtlas:{value:new i.Vector2(16,a)},uSize:{value:.03}},vertexShader:D,fragmentShader:C,transparent:!0,depthWrite:!1});return l.dispose(),{geometry:u,material:h}},[e,n]);return((0,r.useEffect)(()=>()=>{a?.dispose(),o?.uniforms.uMap.value.dispose(),o?.dispose()},[a,o]),a)?(0,t.jsx)("mesh",{geometry:a,material:o,frustumCulled:!1,renderOrder:3}):null},F=e=>e<10?e.toFixed(1):String(Math.round(e));e.s(["BATHY_ZOOM",0,10,"TERRARIUM",0,h,"default",0,({y:e=-.1})=>{let c,d=(0,l.useSignalKPaths)(v),{t:h}=(0,f.useTranslation)(),{id:y}=(0,o.default)(),w=d["navigation.position"],{heading:x}=(0,u.default)(),[_,D]=(0,r.useState)(null),C=s.default.get("aisLengthScalingFactor")||.7,P=Number.isFinite(d["design.draft"]?.maximum)?d["design.draft"].maximum:Number(s.default.get("boatDraft"))||2,z=d["environment.depth.belowSurface"],O=d["environment.depth.belowKeel"],N=Number.isFinite(z)?z:Number.isFinite(O)?O+P:null,U=A[y]||A.light,I=w?.latitude,B=w?.longitude,j=Number.isFinite(I)?(c=g(I,B,m),`${Math.floor(c.x)},${Math.floor(c.y)}`):null;(0,r.useEffect)(()=>{if(!j)return;let e=!1;return b(I,B).then(t=>{e||D(t)}).catch(()=>{}),()=>{e=!0}},[j]);let T=Number.isFinite(I)?Math.round(5e3*I):null,R=Number.isFinite(B)?Math.round(5e3*B):null,$=(0,r.useMemo)(()=>_&&null!==T?{survey:_.shom?M(_.shom,I,B):NaN,global:_.global?M(_.global,I,B):NaN}:{},[_,T,R]),k=(({tideNow:e,tideHigh:t,tideLow:r,measured:i,surveyHere:n,globalHere:a})=>{let o=(e,t=p)=>Math.round(e/t)*t;if(Number.isFinite(e)){let i=Number.isFinite(t)&&Number.isFinite(r)?e-(t+r)/2:0;return{cd:o(e),msl:o(i),source:"tide"}}if(Number.isFinite(i)&&(Number.isFinite(n)||Number.isFinite(a))){let e=Number.isFinite(n)?i+n:0,t=Number.isFinite(a)?i+a:0;return{cd:o(e,.5),msl:o(t,.5),source:"sounder"}}return{cd:0,msl:0,source:"datum"}})({tideNow:d["environment.tide.heightNow"],tideHigh:d["environment.tide.heightHigh"],tideLow:d["environment.tide.heightLow"],measured:N,surveyHere:$.survey,globalHere:$.global}),W=k.cd,G=k.msl,H=(0,r.useMemo)(()=>_?(e,t)=>{let r=_.shom?M(_.shom,e,t):NaN;if(Number.isFinite(r))return{h:r-W,drying:r<6.5};let i=_.global?M(_.global,e,t):NaN;return Number.isFinite(i)?{h:i-G,drying:i<3}:null}:null,[_,W,G]),V=(0,r.useMemo)(()=>{let e,t;if(!H||!Number.isFinite(I))return null;let r=_.shom?240:160,n=_.shom?9:5,a=new i.PlaneGeometry(6e3*C,6e3*C,r,r),o=a.attributes.position,s=new Float32Array(o.count),l=new Float32Array(o.count),u=new Float32Array(2*o.count),c=111320*Math.cos(I*Math.PI/180),d=(e=Math.round(10*I)/10,t=Math.round(10*B)/10,{east:(B-t)*111320*Math.cos(e*Math.PI/180),north:(I-e)*111320});for(let e=0;e<o.count;e++){let t=o.getX(e)/C,r=o.getY(e)/C,i=H(I+r/111320,B+t/c),a=i?i.h:0;s[e]=-a,l[e]=+!!i?.drying,u[2*e]=d.east+t,u[2*e+1]=d.north+r,o.setZ(e,a<0?a*n*C:(.15+3*Math.min(a,4))*C)}a.setAttribute("aDepth",new i.BufferAttribute(s,1)),a.setAttribute("aDrying",new i.BufferAttribute(l,1)),a.setAttribute("aGround",new i.BufferAttribute(u,2)),a.computeVertexNormals();let f=[],h=250*Math.ceil((d.east-1500)/250),m=250*Math.ceil((d.north-1500)/250);for(let e=h;e<=d.east+1500;e+=250)for(let t=m;t<=d.north+1500;t+=250){let r=e-d.east+125,i=t-d.north+125;if(Math.hypot(r,i)>1500)continue;let a=H(I+i/111320,B+r/c);if(!a||a.h>=-.1)continue;let o=-a.h;f.push({text:F(o),danger:o<P+1,position:[r*C,a.h*n*C+2,-i*C]})}let p=H(I,B);return{geometry:a,items:f,exaggeration:n,bottom:p&&p.h<0?p.h*n*C:null,depthHere:p?-p.h:null}},[H,C,P,I&&Math.round(500*I),B&&Math.round(500*B)]);(0,r.useEffect)(()=>()=>V?.geometry.dispose(),[V]);let q=(0,r.useMemo)(()=>new i.ShaderMaterial({uniforms:{uDanger:{value:3},uShallow:{value:new i.Color},uMid:{value:new i.Color},uDeep:{value:new i.Color},uLand:{value:new i.Color},uDrying:{value:new i.Color},uLine:{value:new i.Color},uDangerColor:{value:new i.Color},uFade:{value:new i.Color},uFadeNear:{value:1500},uFadeFar:{value:2100}},vertexShader:S,fragmentShader:E}),[]);(0,r.useEffect)(()=>{let e=q.uniforms;e.uDanger.value=P+1,e.uShallow.value.set(U.shallow),e.uMid.value.set(U.mid),e.uDeep.value.set(U.deep),e.uLand.value.set(U.land),e.uDrying.value.set(U.drying),e.uLine.value.set(U.line),e.uDangerColor.value.set(U.danger),e.uFade.value.set(U.fade)},[q,P,U]),(0,r.useEffect)(()=>()=>q.dispose(),[q]);let K=(0,r.useMemo)(()=>new i.ShaderMaterial({uniforms:{uColor:{value:new i.Color},uOpacity:{value:.16}},vertexShader:`
107
+ `,F=({items:e,palette:n})=>{let{geometry:a,material:o}=(0,r.useMemo)(()=>{if(!e.length)return{};let[t,r]=_,a=Math.ceil(e.length/16),o=document.createElement("canvas");o.width=16*t,o.height=r*a;let s=o.getContext("2d");s.textAlign="center",s.textBaseline="middle";let l=new i.PlaneGeometry(1,1),u=new i.InstancedBufferGeometry;u.index=l.index,u.setAttribute("position",l.attributes.position);let c=new Float32Array(3*e.length),d=new Float32Array(2*e.length);e.forEach((e,i)=>{let a=i%16*t,o=Math.floor(i/16)*r;s.font=`${e.danger?700:600} 28px Inter, Roboto, Arial, sans-serif`,s.lineWidth=7,s.strokeStyle=n.halo,s.strokeText(e.text,a+t/2,o+r/2+1),s.fillStyle=e.danger?n.danger:n.text,s.fillText(e.text,a+t/2,o+r/2+1),c.set(e.position,3*i),d.set([i%16,Math.floor(i/16)],2*i)}),u.setAttribute("aCenter",new i.InstancedBufferAttribute(c,3)),u.setAttribute("aCell",new i.InstancedBufferAttribute(d,2)),u.instanceCount=e.length;let f=new i.CanvasTexture(o);f.colorSpace=i.SRGBColorSpace,f.flipY=!1,f.anisotropy=4;let h=new i.ShaderMaterial({uniforms:{uMap:{value:f},uAtlas:{value:new i.Vector2(16,a)},uSize:{value:.03}},vertexShader:D,fragmentShader:C,transparent:!0,depthWrite:!1});return l.dispose(),{geometry:u,material:h}},[e,n]);return((0,r.useEffect)(()=>()=>{a?.dispose(),o?.uniforms.uMap.value.dispose(),o?.dispose()},[a,o]),a)?(0,t.jsx)("mesh",{geometry:a,material:o,frustumCulled:!1,renderOrder:3}):null},L=e=>e<10?e.toFixed(1):String(Math.round(e));e.s(["BATHY_ZOOM",0,10,"TERRARIUM",0,h,"default",0,({y:e=-.1})=>{let c,h=(0,l.useSignalKPaths)(v),{t:y}=(0,f.useTranslation)(),{id:w}=(0,o.default)(),x=h["navigation.position"],{heading:_}=(0,u.default)(),[D,C]=(0,r.useState)(null),P=s.default.get("aisLengthScalingFactor")||.7,z=Number.isFinite(h["design.draft"]?.maximum)?h["design.draft"].maximum:Number(s.default.get("boatDraft"))||2,N=h["environment.depth.belowSurface"],O=h["environment.depth.belowKeel"],U=h["environment.depth.belowTransducer"],I=h["environment.depth.surfaceToTransducer"],T=Number.isFinite(N)?N:Number.isFinite(O)?O+z:Number.isFinite(U)?U+(Number.isFinite(I)?I:0):null,B=A[w]||A.light,j=x?.latitude,R=x?.longitude,$=Number.isFinite(j)?(c=g(j,R,m),`${Math.floor(c.x)},${Math.floor(c.y)}`):null;(0,r.useEffect)(()=>{if(!$)return;let e=!1,t=null,r=()=>b(j,R).then(i=>{!e&&(C(i),!i.shom&&(0,d.bathymetryTileTemplate)()&&(t=setTimeout(r,6e4)))}).catch(()=>{e||(t=setTimeout(r,6e4))});return r(),()=>{e=!0,clearTimeout(t)}},[$]);let k=Number.isFinite(j)?Math.round(5e3*j):null,W=Number.isFinite(R)?Math.round(5e3*R):null,G=(0,r.useMemo)(()=>D&&null!==k?{survey:D.shom?M(D.shom,j,R):NaN,global:D.global?M(D.global,j,R):NaN}:{},[D,k,W]),H=(({tideNow:e,tideHigh:t,tideLow:r,measured:i,surveyHere:n,globalHere:a})=>{let o=(e,t=p)=>Math.round(e/t)*t;if(Number.isFinite(e)){let i=Number.isFinite(t)&&Number.isFinite(r)?e-(t+r)/2:0;return{cd:o(e),msl:o(i),source:"tide"}}if(Number.isFinite(i)&&(Number.isFinite(n)||Number.isFinite(a))){let e=Number.isFinite(n)?i+n:0,t=Number.isFinite(a)?i+a:0;return{cd:o(e,.5),msl:o(t,.5),source:"sounder"}}return{cd:0,msl:0,source:"datum"}})({tideNow:h["environment.tide.heightNow"],tideHigh:h["environment.tide.heightHigh"],tideLow:h["environment.tide.heightLow"],measured:T,surveyHere:G.survey,globalHere:G.global}),V=H.cd,q=H.msl,K=(0,r.useMemo)(()=>D?(e,t)=>{let r=D.shom?M(D.shom,e,t):NaN;if(Number.isFinite(r))return{h:r-V,drying:r<6.5};let i=D.global?M(D.global,e,t):NaN;return Number.isFinite(i)?{h:i-q,drying:i<3}:null}:null,[D,V,q]),Y=Math.round((Number.isFinite(T)?T:z+1)*2)/2,Z=(0,r.useMemo)(()=>{if(!K||!Number.isFinite(j))return K;let e=D.shom&&Number.isFinite(M(D.shom,j,R));return((e,t,r,i,n)=>{let a=e(t,r),o=-i;if(!a||a.h<=o)return e;let s=o-a.h,l=111320*Math.cos(t*Math.PI/180);return(i,a)=>{let o=e(i,a);if(!o)return o;let u=Math.hypot((i-t)*111320,(a-r)*l)/n;if(u>=1)return o;let c=1-u*u*(3-2*u);return{h:o.h+s*c,drying:!(c>.5)&&o.drying}}})(K,j,R,Y,e?60:350)},[K,Y,k,W]),X=(0,r.useMemo)(()=>{let e,t;if(!Z||!Number.isFinite(j))return null;let r=D.shom?240:160,n=(D.shom,1),a=new i.PlaneGeometry(6e3*P,6e3*P,r,r),o=a.attributes.position,s=new Float32Array(o.count),l=new Float32Array(o.count),u=new Float32Array(2*o.count),c=111320*Math.cos(j*Math.PI/180),d=(e=Math.round(10*j)/10,t=Math.round(10*R)/10,{east:(R-t)*111320*Math.cos(e*Math.PI/180),north:(j-e)*111320});for(let e=0;e<o.count;e++){let t=o.getX(e)/P,r=o.getY(e)/P,i=Z(j+r/111320,R+t/c),a=i?i.h:0;s[e]=-a,l[e]=+!!i?.drying,u[2*e]=d.east+t,u[2*e+1]=d.north+r,o.setZ(e,a<0?a*n*P:(.15+ +Math.min(a,4))*P)}a.setAttribute("aDepth",new i.BufferAttribute(s,1)),a.setAttribute("aDrying",new i.BufferAttribute(l,1)),a.setAttribute("aGround",new i.BufferAttribute(u,2)),a.computeVertexNormals();let f=[],h=250*Math.ceil((d.east-1500)/250),m=250*Math.ceil((d.north-1500)/250);for(let e=h;e<=d.east+1500;e+=250)for(let t=m;t<=d.north+1500;t+=250){let r=e-d.east+125,i=t-d.north+125;if(Math.hypot(r,i)>1500)continue;let a=Z(j+i/111320,R+r/c);if(!a||a.h>=-.1)continue;let o=-a.h;f.push({text:L(o),danger:o<z+1,position:[r*P,a.h*n*P+2,-i*P]})}let p=Z(j,R);return{geometry:a,items:f,exaggeration:n,bottom:p&&p.h<0?p.h*n*P:null,depthHere:p?-p.h:null}},[Z,P,z,j&&Math.round(500*j),R&&Math.round(500*R)]);(0,r.useEffect)(()=>()=>X?.geometry.dispose(),[X]);let J=(0,r.useMemo)(()=>new i.ShaderMaterial({uniforms:{uDanger:{value:3},uShallow:{value:new i.Color},uMid:{value:new i.Color},uDeep:{value:new i.Color},uLand:{value:new i.Color},uDrying:{value:new i.Color},uLine:{value:new i.Color},uDangerColor:{value:new i.Color},uFade:{value:new i.Color},uFadeNear:{value:1500},uFadeFar:{value:2100}},vertexShader:S,fragmentShader:E}),[]);(0,r.useEffect)(()=>{let e=J.uniforms;e.uDanger.value=z+1,e.uShallow.value.set(B.shallow),e.uMid.value.set(B.mid),e.uDeep.value.set(B.deep),e.uLand.value.set(B.land),e.uDrying.value.set(B.drying),e.uLine.value.set(B.line),e.uDangerColor.value.set(B.danger),e.uFade.value.set(B.fade)},[J,z,B]),(0,r.useEffect)(()=>()=>J.dispose(),[J]);let Q=(0,r.useMemo)(()=>new i.ShaderMaterial({uniforms:{uColor:{value:new i.Color},uOpacity:{value:.16}},vertexShader:`
108
108
  varying float vDist;
109
109
  void main() {
110
110
  vDist = length(position.xy);
@@ -116,7 +116,7 @@
116
116
  void main() {
117
117
  gl_FragColor = vec4(uColor, uOpacity * (1.0 - smoothstep(1500.0, 2100.0, vDist)));
118
118
  #include <colorspace_fragment>
119
- }`,transparent:!0,depthWrite:!1,side:i.DoubleSide}),[]);if((0,r.useEffect)(()=>{let e=K.uniforms;e.uColor.value.set(U.water),e.uOpacity.value=U.waterOpacity},[K,U]),(0,r.useEffect)(()=>()=>K.dispose(),[K]),!V||!Number.isFinite(I))return null;let Y=V.depthHere,Z=Number.isFinite(N)&&Number.isFinite(Y)&&"tide"===k.source?N-Y:null,X=(Number.isFinite(N)?-N*V.exaggeration*C:null)??V.bottom,J=null!==Z&&Math.abs(Z)>=.3,Q=Number.isFinite(N)?N:Y,ee=-P*C;return(0,t.jsxs)("group",{rotation:[0,x,0],position:[0,e,0],children:[(0,t.jsx)("mesh",{rotation:[-Math.PI/2,0,0],geometry:V.geometry,material:q,renderOrder:-2}),(0,t.jsx)("mesh",{rotation:[-Math.PI/2,0,0],material:K,renderOrder:1,children:(0,t.jsx)("circleGeometry",{args:[3e3*C,96]})}),(0,t.jsx)(L,{items:V.items,palette:U}),null!==X&&X<ee&&(0,t.jsxs)("group",{children:[(0,t.jsx)(a.Line,{points:[[0,ee,0],[0,X,0]],color:U.line,lineWidth:2,dashed:!0,dashSize:1.2,gapSize:.8}),(0,t.jsxs)("mesh",{position:[0,X,0],rotation:[-Math.PI/2,0,0],children:[(0,t.jsx)("ringGeometry",{args:[1.2,1.8,32]}),(0,t.jsx)("meshBasicMaterial",{color:U.line,transparent:!0,opacity:.8,side:i.DoubleSide})]}),J&&null!==V.bottom&&(0,t.jsxs)("mesh",{position:[0,V.bottom,0],rotation:[-Math.PI/2,0,0],children:[(0,t.jsx)("ringGeometry",{args:[1,1.4,32]}),(0,t.jsx)("meshBasicMaterial",{color:U.danger,transparent:!0,opacity:.8,side:i.DoubleSide})]}),Number.isFinite(Q)&&(0,t.jsx)(n.Html,{position:[0,X/2,0],zIndexRange:[5,0],style:{pointerEvents:"none"},children:(0,t.jsxs)("div",{className:"ml-3 -translate-y-1/2 whitespace-nowrap px-1.5 py-px rounded-md text-caption font-semibold tabular-nums text-hud-main bg-hud-bg/70 backdrop-blur-sm",children:[F(Q)," m",J&&(0,t.jsxs)("span",{className:"ml-1.5 font-normal text-hud-muted",children:[h("bathymetry.chartDepth",{depth:F(Y)})," ","(",Z>0?"+":"−",Math.abs(Z).toFixed(1),")"]}),"sounder"===k.source&&(0,t.jsx)("span",{className:"ml-1.5 font-normal text-hud-muted",children:h("bathymetry.levelFromSounder")})]})})]})]})}])},97776,e=>{"use strict";var t=e.i(3950);let r=["https://overpass-api.de/api/interpreter","https://maps.mail.ru/osm/tools/overpass/api/interpreter"],i=["cardinal","lateral","isolated_danger","safe_water","special_purpose"],n=`^(buoy|beacon)_(${i.join("|")})$`,a=e=>Math.round(10*e)/10,o=(e,t,r)=>{let i=r/111320,n=r/(111320*Math.max(.1,Math.cos(e*Math.PI/180))),o=[];for(let r=Math.floor((e-i)/.1);r<=Math.floor((e+i)/.1);r++)for(let e=Math.floor((t-n)/.1);e<=Math.floor((t+n)/.1);e++)o.push({s:a(.1*r),w:a(.1*e),key:`${r}:${e}`});return o},s=({s:e,w:t})=>`${r[0]}?data=${encodeURIComponent(`[out:json];node["seamark:type"~"${n}"](${e},${t},${a(e+.1)},${a(t+.1)});out body;`)}`,l=e=>e?String(e).split(";").map(e=>e.trim().toLowerCase()).filter(Boolean):[],u=e=>{let t=parseFloat(e);return Number.isFinite(t)?t:null},c=e=>{let t=e.tags||{},r=t["seamark:type"]||"",[i,...n]=r.split("_"),a=n.join("_"),o=e=>t[`seamark:${r}:${e}`],s=t["seamark:light:character"]?{character:t["seamark:light:character"],group:t["seamark:light:group"]||"",period:u(t["seamark:light:period"]),colour:l(t["seamark:light:colour"])[0]||"white"}:null;return{id:e.id,lat:e.lat,lon:e.lon,name:t["seamark:name"]||t.name||"",kind:a,beacon:"beacon"===i,category:(o("category")||"").toLowerCase(),shape:(o("shape")||"").toLowerCase(),colours:l(o("colour")),pattern:(o("colour_pattern")||"").toLowerCase(),system:(o("system")||"").toLowerCase(),height:u(o("height")),topmark:t["seamark:topmark:shape"]?{shape:t["seamark:topmark:shape"].toLowerCase(),colours:l(t["seamark:topmark:colour"])}:null,light:s}},d=0,f=e=>e.filter(e=>"node"===e.type&&Number.isFinite(e.lat)&&Number.isFinite(e.lon)).map(c).filter(e=>i.includes(e.kind)),h=async(e,i=25)=>{let o=Math.min(...e.map(e=>e.s)),l=Math.min(...e.map(e=>e.w)),u=a(Math.max(...e.map(e=>e.s))+.1),c=a(Math.max(...e.map(e=>e.w))+.1),d=`[out:json][timeout:${i}];node["seamark:type"~"${n}"](${o},${l},${u},${c});out body;`;for(let i of r)try{let r=await fetch(`${i}?data=${encodeURIComponent(d)}`,{referrerPolicy:"strict-origin-when-cross-origin"});if(!r.ok)continue;let n=await r.json();if(n.remark&&/error|timeout|runtime/i.test(n.remark))continue;let a=n.elements||[],o={};return await Promise.all(e.map(e=>{o[e.key]=a.filter(t=>t.lat>=e.s&&t.lat<e.s+.1&&t.lon>=e.w&&t.lon<e.w+.1);let r=JSON.stringify({elements:o[e.key]});return(0,t.storeCached)(s(e),new Response(r,{headers:{"Content-Type":"application/json"}}))})),o}catch{}throw Error("Overpass unreachable")},m=async e=>{let r={},i=[];for(let n of e){let e=await (0,t.readCached)(s(n)).catch(()=>null);e?r[n.key]=f((await e.json()).elements||[]):i.push(n)}if(i.length&&Date.now()>=d)try{let e=await h(i);Object.entries(e).forEach(([e,t])=>{r[e]=f(t)})}catch{d=Date.now()+12e4}return r},p=async(e,t,r)=>{let i=o(e,t,r);return i.length?Object.keys(await h(i,90)).length:0};e.s(["cellsAround",0,o,"loadCells",0,m,"prefetchSeamarks",0,p])},83646,e=>{"use strict";var t=e.i(67561);e.s(["default",0,()=>(0,t.useOcearoContext)().tokens])},58567,e=>{"use strict";var t=e.i(83402);e.s(["RENDER_QUALITIES",0,["auto","high","pi"],"getRenderProfile",0,()=>{let e=t.default.get("renderQuality")||"auto";return"pi"===e||"auto"===e&&(()=>{if("u"<typeof navigator)return!1;if(/aarch64|armv7|armv8|arm64|raspbian|raspberry/i.test(navigator.userAgent))return!0;let e=navigator.hardwareConcurrency||8,t=navigator.deviceMemory||8;return e<=4&&t<=4})()?{id:"pi",fps:30,dpr:1,antialias:!1}:{id:"high",fps:60,dpr:Math.min(window.devicePixelRatio||1,1.5),antialias:!0}}])},31067,e=>{"use strict";function t(){return(t=Object.assign.bind()).apply(null,arguments)}e.s(["default",()=>t])},43216,e=>{"use strict";let t,r;var i=e.i(31067),n=e.i(71645),a=e.i(90072),o=e.i(90874),s=a,l=e.i(32533),u=a,c=e.i(8560),d=e.i(31497);class f extends u.ShaderMaterial{constructor(e){super({type:"LineMaterial",uniforms:u.UniformsUtils.clone(u.UniformsUtils.merge([c.UniformsLib.common,c.UniformsLib.fog,{worldUnits:{value:1},linewidth:{value:1},resolution:{value:new u.Vector2(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}}])),vertexShader:`
119
+ }`,transparent:!0,depthWrite:!1,side:i.DoubleSide}),[]);if((0,r.useEffect)(()=>{let e=Q.uniforms;e.uColor.value.set(B.water),e.uOpacity.value=B.waterOpacity},[Q,B]),(0,r.useEffect)(()=>()=>Q.dispose(),[Q]),!X||!Number.isFinite(j))return null;let ee=X.depthHere,et=Number.isFinite(T)&&Number.isFinite(ee)&&"tide"===H.source?T-ee:null,er=(Number.isFinite(T)?-T*X.exaggeration*P:null)??X.bottom,ei=null!==et&&Math.abs(et)>=.3,en=Number.isFinite(T)?T:ee,ea=-z*P;return(0,t.jsxs)("group",{rotation:[0,_,0],position:[0,e,0],children:[(0,t.jsx)("mesh",{rotation:[-Math.PI/2,0,0],geometry:X.geometry,material:J,renderOrder:-2}),(0,t.jsx)("mesh",{rotation:[-Math.PI/2,0,0],material:Q,renderOrder:1,children:(0,t.jsx)("circleGeometry",{args:[3e3*P,96]})}),(0,t.jsx)(F,{items:X.items,palette:B}),null!==er&&er<ea&&(0,t.jsxs)("group",{children:[(0,t.jsx)(a.Line,{points:[[0,ea,0],[0,er,0]],color:B.line,lineWidth:2,dashed:!0,dashSize:1.2,gapSize:.8}),(0,t.jsxs)("mesh",{position:[0,er,0],rotation:[-Math.PI/2,0,0],children:[(0,t.jsx)("ringGeometry",{args:[1.2,1.8,32]}),(0,t.jsx)("meshBasicMaterial",{color:B.line,transparent:!0,opacity:.8,side:i.DoubleSide})]}),ei&&null!==X.bottom&&(0,t.jsxs)("mesh",{position:[0,X.bottom,0],rotation:[-Math.PI/2,0,0],children:[(0,t.jsx)("ringGeometry",{args:[1,1.4,32]}),(0,t.jsx)("meshBasicMaterial",{color:B.danger,transparent:!0,opacity:.8,side:i.DoubleSide})]}),Number.isFinite(en)&&(0,t.jsx)(n.Html,{position:[0,er/2,0],zIndexRange:[5,0],style:{pointerEvents:"none"},children:(0,t.jsxs)("div",{className:"ml-3 -translate-y-1/2 whitespace-nowrap px-1.5 py-px rounded-md text-caption font-semibold tabular-nums text-hud-main bg-hud-bg/70 backdrop-blur-sm",children:[L(en)," m",ei&&(0,t.jsxs)("span",{className:"ml-1.5 font-normal text-hud-muted",children:[y("bathymetry.chartDepth",{depth:L(ee)})," ","(",et>0?"+":"−",Math.abs(et).toFixed(1),")"]}),"sounder"===H.source&&(0,t.jsx)("span",{className:"ml-1.5 font-normal text-hud-muted",children:y("bathymetry.levelFromSounder")})]})})]})]})}])},97776,e=>{"use strict";var t=e.i(3950);let r=["https://overpass-api.de/api/interpreter","https://maps.mail.ru/osm/tools/overpass/api/interpreter"],i=["cardinal","lateral","isolated_danger","safe_water","special_purpose"],n=`^(buoy|beacon)_(${i.join("|")})$`,a=e=>Math.round(10*e)/10,o=(e,t,r)=>{let i=r/111320,n=r/(111320*Math.max(.1,Math.cos(e*Math.PI/180))),o=[];for(let r=Math.floor((e-i)/.1);r<=Math.floor((e+i)/.1);r++)for(let e=Math.floor((t-n)/.1);e<=Math.floor((t+n)/.1);e++)o.push({s:a(.1*r),w:a(.1*e),key:`${r}:${e}`});return o},s=({s:e,w:t})=>`${r[0]}?data=${encodeURIComponent(`[out:json];node["seamark:type"~"${n}"](${e},${t},${a(e+.1)},${a(t+.1)});out body;`)}`,l=e=>e?String(e).split(";").map(e=>e.trim().toLowerCase()).filter(Boolean):[],u=e=>{let t=parseFloat(e);return Number.isFinite(t)?t:null},c=e=>{let t=e.tags||{},r=t["seamark:type"]||"",[i,...n]=r.split("_"),a=n.join("_"),o=e=>t[`seamark:${r}:${e}`],s=t["seamark:light:character"]?{character:t["seamark:light:character"],group:t["seamark:light:group"]||"",period:u(t["seamark:light:period"]),colour:l(t["seamark:light:colour"])[0]||"white"}:null;return{id:e.id,lat:e.lat,lon:e.lon,name:t["seamark:name"]||t.name||"",kind:a,beacon:"beacon"===i,category:(o("category")||"").toLowerCase(),shape:(o("shape")||"").toLowerCase(),colours:l(o("colour")),pattern:(o("colour_pattern")||"").toLowerCase(),system:(o("system")||"").toLowerCase(),height:u(o("height")),topmark:t["seamark:topmark:shape"]?{shape:t["seamark:topmark:shape"].toLowerCase(),colours:l(t["seamark:topmark:colour"])}:null,light:s}},d=0,f=e=>e.filter(e=>"node"===e.type&&Number.isFinite(e.lat)&&Number.isFinite(e.lon)).map(c).filter(e=>i.includes(e.kind)),h=async(e,i=25)=>{let o=Math.min(...e.map(e=>e.s)),l=Math.min(...e.map(e=>e.w)),u=a(Math.max(...e.map(e=>e.s))+.1),c=a(Math.max(...e.map(e=>e.w))+.1),d=`[out:json][timeout:${i}];node["seamark:type"~"${n}"](${o},${l},${u},${c});out body;`;for(let i of r)try{let r=await fetch(`${i}?data=${encodeURIComponent(d)}`,{referrerPolicy:"strict-origin-when-cross-origin"});if(!r.ok)continue;let n=await r.json();if(n.remark&&/error|timeout|runtime/i.test(n.remark))continue;let a=n.elements||[],o={};return await Promise.all(e.map(e=>{o[e.key]=a.filter(t=>t.lat>=e.s&&t.lat<e.s+.1&&t.lon>=e.w&&t.lon<e.w+.1);let r=JSON.stringify({elements:o[e.key]});return(0,t.storeCached)(s(e),new Response(r,{headers:{"Content-Type":"application/json"}}))})),o}catch{}throw Error("Overpass unreachable")},m=async e=>{let r={},i=[];for(let n of e){let e=await (0,t.readCached)(s(n)).catch(()=>null);e?r[n.key]=f((await e.json()).elements||[]):i.push(n)}if(i.length&&Date.now()>=d)try{let e=await h(i);Object.entries(e).forEach(([e,t])=>{r[e]=f(t)})}catch{d=Date.now()+12e4}return r},p=async(e,t,r)=>{let i=o(e,t,r);return i.length?Object.keys(await h(i,90)).length:0};e.s(["cellsAround",0,o,"loadCells",0,m,"prefetchSeamarks",0,p])},83646,e=>{"use strict";var t=e.i(67561);e.s(["default",0,()=>(0,t.useOcearoContext)().tokens])},58567,e=>{"use strict";var t=e.i(83402);e.s(["RENDER_QUALITIES",0,["auto","high","pi"],"getRenderProfile",0,()=>{let e=t.default.get("renderQuality")||"auto";return"pi"===e||"auto"===e&&(()=>{if("u"<typeof navigator)return!1;if(/aarch64|armv7|armv8|arm64|raspbian|raspberry/i.test(navigator.userAgent))return!0;let e=navigator.hardwareConcurrency||8,t=navigator.deviceMemory||8;return e<=4&&t<=4})()?{id:"pi",fps:30,dpr:1,antialias:!1}:{id:"high",fps:60,dpr:Math.min(window.devicePixelRatio||1,1.5),antialias:!0}}])},31067,e=>{"use strict";function t(){return(t=Object.assign.bind()).apply(null,arguments)}e.s(["default",()=>t])},43216,e=>{"use strict";let t,r;var i=e.i(31067),n=e.i(71645),a=e.i(90072),o=e.i(90874),s=a,l=e.i(32533),u=a,c=e.i(8560),d=e.i(31497);class f extends u.ShaderMaterial{constructor(e){super({type:"LineMaterial",uniforms:u.UniformsUtils.clone(u.UniformsUtils.merge([c.UniformsLib.common,c.UniformsLib.fog,{worldUnits:{value:1},linewidth:{value:1},resolution:{value:new u.Vector2(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}}])),vertexShader:`
120
120
  #include <common>
121
121
  #include <fog_pars_vertex>
122
122
  #include <logdepthbuf_pars_vertex>
@@ -524,7 +524,7 @@
524
524
  #include <premultiplied_alpha_fragment>
525
525
 
526
526
  }
527
- `,clipping:!0}),this.isLineMaterial=!0,this.onBeforeCompile=function(){this.transparent?this.defines.USE_LINE_COLOR_ALPHA="1":delete this.defines.USE_LINE_COLOR_ALPHA},Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(e){!0===e?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(e){!!e!="USE_DASH"in this.defines&&(this.needsUpdate=!0),!0===e?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(e){this.uniforms.dashOffset.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},alphaToCoverage:{enumerable:!0,get:function(){return"USE_ALPHA_TO_COVERAGE"in this.defines},set:function(e){!!e!="USE_ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),!0===e?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(e)}}let h=d.version>=125?"uv1":"uv2",m=new s.Vector4,p=new s.Vector3,v=new s.Vector3,g=new s.Vector4,y=new s.Vector4,w=new s.Vector4,x=new s.Vector3,b=new s.Matrix4,M=new s.Line3,S=new s.Vector3,E=new s.Box3,A=new s.Sphere,_=new s.Vector4;function D(e,t,i){return _.set(0,0,-t,1).applyMatrix4(e.projectionMatrix),_.multiplyScalar(1/_.w),_.x=r/i.width,_.y=r/i.height,_.applyMatrix4(e.projectionMatrixInverse),_.multiplyScalar(1/_.w),Math.abs(Math.max(_.x,_.y))}class C extends s.Mesh{constructor(e=new l.LineSegmentsGeometry,t=new f({color:0xffffff*Math.random()})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){let e=this.geometry,t=e.attributes.instanceStart,r=e.attributes.instanceEnd,i=new Float32Array(2*t.count);for(let e=0,n=0,a=t.count;e<a;e++,n+=2)p.fromBufferAttribute(t,e),v.fromBufferAttribute(r,e),i[n]=0===n?0:i[n-1],i[n+1]=i[n]+p.distanceTo(v);let n=new s.InstancedInterleavedBuffer(i,2,1);return e.setAttribute("instanceDistanceStart",new s.InterleavedBufferAttribute(n,1,0)),e.setAttribute("instanceDistanceEnd",new s.InterleavedBufferAttribute(n,1,1)),this}raycast(e,i){let n,a,o=this.material.worldUnits,l=e.camera;null!==l||o||console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');let u=void 0!==e.params.Line2&&e.params.Line2.threshold||0;t=e.ray;let c=this.matrixWorld,d=this.geometry,f=this.material;if(r=f.linewidth+u,null===d.boundingSphere&&d.computeBoundingSphere(),A.copy(d.boundingSphere).applyMatrix4(c),o)n=.5*r;else{let e=Math.max(l.near,A.distanceToPoint(t.origin));n=D(l,e,f.resolution)}if(A.radius+=n,!1!==t.intersectsSphere(A)){if(null===d.boundingBox&&d.computeBoundingBox(),E.copy(d.boundingBox).applyMatrix4(c),o)a=.5*r;else{let e=Math.max(l.near,E.distanceToPoint(t.origin));a=D(l,e,f.resolution)}E.expandByScalar(a),!1!==t.intersectsBox(E)&&(o?function(e,i){let n=e.matrixWorld,a=e.geometry,o=a.attributes.instanceStart,l=a.attributes.instanceEnd,u=Math.min(a.instanceCount,o.count);for(let a=0;a<u;a++){M.start.fromBufferAttribute(o,a),M.end.fromBufferAttribute(l,a),M.applyMatrix4(n);let u=new s.Vector3,c=new s.Vector3;t.distanceSqToSegment(M.start,M.end,c,u),c.distanceTo(u)<.5*r&&i.push({point:c,pointOnLine:u,distance:t.origin.distanceTo(c),object:e,face:null,faceIndex:a,uv:null,[h]:null})}}(this,i):function(e,i,n){let a=i.projectionMatrix,o=e.material.resolution,l=e.matrixWorld,u=e.geometry,c=u.attributes.instanceStart,d=u.attributes.instanceEnd,f=Math.min(u.instanceCount,c.count),m=-i.near;t.at(1,w),w.w=1,w.applyMatrix4(i.matrixWorldInverse),w.applyMatrix4(a),w.multiplyScalar(1/w.w),w.x*=o.x/2,w.y*=o.y/2,w.z=0,x.copy(w),b.multiplyMatrices(i.matrixWorldInverse,l);for(let i=0;i<f;i++){if(g.fromBufferAttribute(c,i),y.fromBufferAttribute(d,i),g.w=1,y.w=1,g.applyMatrix4(b),y.applyMatrix4(b),g.z>m&&y.z>m)continue;if(g.z>m){let e=g.z-y.z,t=(g.z-m)/e;g.lerp(y,t)}else if(y.z>m){let e=y.z-g.z,t=(y.z-m)/e;y.lerp(g,t)}g.applyMatrix4(a),y.applyMatrix4(a),g.multiplyScalar(1/g.w),y.multiplyScalar(1/y.w),g.x*=o.x/2,g.y*=o.y/2,y.x*=o.x/2,y.y*=o.y/2,M.start.copy(g),M.start.z=0,M.end.copy(y),M.end.z=0;let u=M.closestPointToPointParameter(x,!0);M.at(u,S);let f=s.MathUtils.lerp(g.z,y.z,u),p=f>=-1&&f<=1,v=x.distanceTo(S)<.5*r;if(p&&v){M.start.fromBufferAttribute(c,i),M.end.fromBufferAttribute(d,i),M.start.applyMatrix4(l),M.end.applyMatrix4(l);let r=new s.Vector3,a=new s.Vector3;t.distanceSqToSegment(M.start,M.end,a,r),n.push({point:a,pointOnLine:r,distance:t.origin.distanceTo(a),object:e,face:null,faceIndex:i,uv:null,[h]:null})}}}(this,l,i))}}onBeforeRender(e){let t=this.material.uniforms;t&&t.resolution&&(e.getViewport(m),this.material.uniforms.resolution.value.set(m.z,m.w))}}var L=l;class F extends L.LineSegmentsGeometry{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){let t=e.length-3,r=new Float32Array(2*t);for(let i=0;i<t;i+=3)r[2*i]=e[i],r[2*i+1]=e[i+1],r[2*i+2]=e[i+2],r[2*i+3]=e[i+3],r[2*i+4]=e[i+4],r[2*i+5]=e[i+5];return super.setPositions(r),this}setColors(e,t=3){let r=e.length-t,i=new Float32Array(2*r);if(3===t)for(let n=0;n<r;n+=t)i[2*n]=e[n],i[2*n+1]=e[n+1],i[2*n+2]=e[n+2],i[2*n+3]=e[n+3],i[2*n+4]=e[n+4],i[2*n+5]=e[n+5];else for(let n=0;n<r;n+=t)i[2*n]=e[n],i[2*n+1]=e[n+1],i[2*n+2]=e[n+2],i[2*n+3]=e[n+3],i[2*n+4]=e[n+4],i[2*n+5]=e[n+5],i[2*n+6]=e[n+6],i[2*n+7]=e[n+7];return super.setColors(i,t),this}fromLine(e){let t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class P extends C{constructor(e=new F,t=new f({color:0xffffff*Math.random()})){super(e,t),this.isLine2=!0,this.type="Line2"}}let z=n.forwardRef(function({points:e,color:t=0xffffff,vertexColors:r,linewidth:s,lineWidth:u,segments:c,dashed:d,...h},m){var p,v;let g=(0,o.useThree)(e=>e.size),y=n.useMemo(()=>c?new C:new P,[c]),[w]=n.useState(()=>new f),x=(null==r||null==(p=r[0])?void 0:p.length)===4?4:3,b=n.useMemo(()=>{let i=c?new l.LineSegmentsGeometry:new F,n=e.map(e=>{let t=Array.isArray(e);return e instanceof a.Vector3||e instanceof a.Vector4?[e.x,e.y,e.z]:e instanceof a.Vector2?[e.x,e.y,0]:t&&3===e.length?[e[0],e[1],e[2]]:t&&2===e.length?[e[0],e[1],0]:e});if(i.setPositions(n.flat()),r){t=0xffffff;let e=r.map(e=>e instanceof a.Color?e.toArray():e);i.setColors(e.flat(),x)}return i},[e,c,r,x]);return n.useLayoutEffect(()=>{y.computeLineDistances()},[e,y]),n.useLayoutEffect(()=>{d?w.defines.USE_DASH="":delete w.defines.USE_DASH,w.needsUpdate=!0},[d,w]),n.useEffect(()=>()=>{b.dispose(),w.dispose()},[b]),n.createElement("primitive",(0,i.default)({object:y,ref:m},h),n.createElement("primitive",{object:b,attach:"geometry"}),n.createElement("primitive",(0,i.default)({object:w,attach:"material",color:t,vertexColors:!!r,resolution:[g.width,g.height],linewidth:null!=(v=null!=s?s:u)?v:1,dashed:d,transparent:4===x},h)))});e.s(["Line",0,z],43216)},60099,95393,e=>{"use strict";let t,r;var i=e.i(31067),n=e.i(71645),a=e.i(88014),o=e.i(90072),s=e.i(90874),l=e.i(61949);e.s(["useFrame",()=>l.F],95393);var l=l;let u=new o.Vector3,c=new o.Vector3,d=new o.Vector3,f=new o.Vector2;function h(e,t,r){let i=u.setFromMatrixPosition(e.matrixWorld);i.project(t);let n=r.width/2,a=r.height/2;return[i.x*n+n,-(i.y*a)+a]}let m=e=>1e-10>Math.abs(e)?0:e;function p(e,t,r=""){let i="matrix3d(";for(let r=0;16!==r;r++)i+=m(t[r]*e.elements[r])+(15!==r?",":")");return r+i}let v=(t=[1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1],e=>p(e,t)),g=(r=e=>[1/e,1/e,1/e,1,-1/e,-1/e,-1/e,-1,1/e,1/e,1/e,1,1,1,1,1],(e,t)=>p(e,r(t),"translate(-50%,-50%)")),y=n.forwardRef(({children:e,eps:t=.001,style:r,className:p,prepend:y,center:w,fullscreen:x,portal:b,distanceFactor:M,sprite:S=!1,transform:E=!1,occlude:A,onOcclude:_,castShadow:D,receiveShadow:C,material:L,geometry:F,zIndexRange:P=[0x1000037,0],calculatePosition:z=h,as:O="div",wrapperClass:N,pointerEvents:U="auto",...I},B)=>{let{gl:j,camera:T,scene:R,size:$,raycaster:k,events:W,viewport:G}=(0,s.useThree)(),[H]=n.useState(()=>document.createElement(O)),V=n.useRef(null),q=n.useRef(null),K=n.useRef(0),Y=n.useRef([0,0]),Z=n.useRef(null),X=n.useRef(null),J=(null==b?void 0:b.current)||W.connected||j.domElement.parentNode,Q=n.useRef(null),ee=n.useRef(!1),et=n.useMemo(()=>{var e;return A&&"blending"!==A||Array.isArray(A)&&A.length&&(e=A[0])&&"object"==typeof e&&"current"in e},[A]);n.useLayoutEffect(()=>{let e=j.domElement;A&&"blending"===A?(e.style.zIndex=`${Math.floor(P[0]/2)}`,e.style.position="absolute",e.style.pointerEvents="none"):(e.style.zIndex=null,e.style.position=null,e.style.pointerEvents=null)},[A]),n.useLayoutEffect(()=>{if(q.current){let e=V.current=a.createRoot(H);if(R.updateMatrixWorld(),E)H.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{let e=z(q.current,T,$);H.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${e[0]}px,${e[1]}px,0);transform-origin:0 0;`}return J&&(y?J.prepend(H):J.appendChild(H)),()=>{J&&J.removeChild(H),e.unmount()}}},[J,E]),n.useLayoutEffect(()=>{N&&(H.className=N)},[N]);let er=n.useMemo(()=>E?{position:"absolute",top:0,left:0,width:$.width,height:$.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:w?"translate3d(-50%,-50%,0)":"none",...x&&{top:-$.height/2,left:-$.width/2,width:$.width,height:$.height},...r},[r,w,x,$,E]),ei=n.useMemo(()=>({position:"absolute",pointerEvents:U}),[U]);n.useLayoutEffect(()=>{var t,i;ee.current=!1,E?null==(t=V.current)||t.render(n.createElement("div",{ref:Z,style:er},n.createElement("div",{ref:X,style:ei},n.createElement("div",{ref:B,className:p,style:r,children:e})))):null==(i=V.current)||i.render(n.createElement("div",{ref:B,style:er,className:p,children:e}))});let en=n.useRef(!0);(0,l.F)(e=>{if(q.current){T.updateMatrixWorld(),q.current.updateWorldMatrix(!0,!1);let e=E?Y.current:z(q.current,T,$);if(E||Math.abs(K.current-T.zoom)>t||Math.abs(Y.current[0]-e[0])>t||Math.abs(Y.current[1]-e[1])>t){var r;let t,i,n,a,s=(r=q.current,t=u.setFromMatrixPosition(r.matrixWorld),i=c.setFromMatrixPosition(T.matrixWorld),n=t.sub(i),a=T.getWorldDirection(d),n.angleTo(a)>Math.PI/2),l=!1;et&&(Array.isArray(A)?l=A.map(e=>e.current):"blending"!==A&&(l=[R]));let h=en.current;l?en.current=function(e,t,r,i){let n=u.setFromMatrixPosition(e.matrixWorld),a=n.clone();a.project(t),f.set(a.x,a.y),r.setFromCamera(f,t);let o=r.intersectObjects(i,!0);if(o.length){let e=o[0].distance;return n.distanceTo(r.ray.origin)<e}return!0}(q.current,T,k,l)&&!s:en.current=!s,h!==en.current&&(_?_(!en.current):H.style.display=en.current?"block":"none");let p=Math.floor(P[0]/2),y=A?et?[P[0],p]:[p-1,0]:P;if(H.style.zIndex=`${function(e,t,r){if(t instanceof o.PerspectiveCamera||t instanceof o.OrthographicCamera){let i=u.setFromMatrixPosition(e.matrixWorld),n=c.setFromMatrixPosition(t.matrixWorld),a=i.distanceTo(n),o=(r[1]-r[0])/(t.far-t.near),s=r[1]-o*t.far;return Math.round(o*a+s)}}(q.current,T,y)}`,E){let[e,t]=[$.width/2,$.height/2],r=T.projectionMatrix.elements[5]*t,{isOrthographicCamera:i,top:n,left:a,bottom:o,right:s}=T,l=v(T.matrixWorldInverse),u=i?`scale(${r})translate(${m(-(s+a)/2)}px,${m((n+o)/2)}px)`:`translateZ(${r}px)`,c=q.current.matrixWorld;S&&((c=T.matrixWorldInverse.clone().transpose().copyPosition(c).scale(q.current.scale)).elements[3]=c.elements[7]=c.elements[11]=0,c.elements[15]=1),H.style.width=$.width+"px",H.style.height=$.height+"px",H.style.perspective=i?"":`${r}px`,Z.current&&X.current&&(Z.current.style.transform=`${u}${l}translate(${e}px,${t}px)`,X.current.style.transform=g(c,1/((M||10)/400)))}else{let t=void 0===M?1:function(e,t){if(t instanceof o.OrthographicCamera)return t.zoom;if(!(t instanceof o.PerspectiveCamera))return 1;{let r=u.setFromMatrixPosition(e.matrixWorld),i=c.setFromMatrixPosition(t.matrixWorld);return 1/(2*Math.tan(t.fov*Math.PI/180/2)*r.distanceTo(i))}}(q.current,T)*M;H.style.transform=`translate3d(${e[0]}px,${e[1]}px,0) scale(${t})`}Y.current=e,K.current=T.zoom}}if(!et&&Q.current&&!ee.current)if(E){if(Z.current){let e=Z.current.children[0];if(null!=e&&e.clientWidth&&null!=e&&e.clientHeight){let{isOrthographicCamera:t}=T;if(t||F)I.scale&&(Array.isArray(I.scale)?I.scale instanceof o.Vector3?Q.current.scale.copy(I.scale.clone().divideScalar(1)):Q.current.scale.set(1/I.scale[0],1/I.scale[1],1/I.scale[2]):Q.current.scale.setScalar(1/I.scale));else{let t=(M||10)/400,r=e.clientWidth*t,i=e.clientHeight*t;Q.current.scale.set(r,i,1)}ee.current=!0}}}else{let t=H.children[0];if(null!=t&&t.clientWidth&&null!=t&&t.clientHeight){let e=1/G.factor,r=t.clientWidth*e,i=t.clientHeight*e;Q.current.scale.set(r,i,1),ee.current=!0}Q.current.lookAt(e.camera.position)}});let ea=n.useMemo(()=>({vertexShader:E?void 0:`
527
+ `,clipping:!0}),this.isLineMaterial=!0,this.onBeforeCompile=function(){this.transparent?this.defines.USE_LINE_COLOR_ALPHA="1":delete this.defines.USE_LINE_COLOR_ALPHA},Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(e){!0===e?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(e){!!e!="USE_DASH"in this.defines&&(this.needsUpdate=!0),!0===e?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(e){this.uniforms.dashOffset.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},alphaToCoverage:{enumerable:!0,get:function(){return"USE_ALPHA_TO_COVERAGE"in this.defines},set:function(e){!!e!="USE_ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),!0===e?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(e)}}let h=d.version>=125?"uv1":"uv2",m=new s.Vector4,p=new s.Vector3,v=new s.Vector3,g=new s.Vector4,y=new s.Vector4,w=new s.Vector4,x=new s.Vector3,b=new s.Matrix4,M=new s.Line3,S=new s.Vector3,E=new s.Box3,A=new s.Sphere,_=new s.Vector4;function D(e,t,i){return _.set(0,0,-t,1).applyMatrix4(e.projectionMatrix),_.multiplyScalar(1/_.w),_.x=r/i.width,_.y=r/i.height,_.applyMatrix4(e.projectionMatrixInverse),_.multiplyScalar(1/_.w),Math.abs(Math.max(_.x,_.y))}class C extends s.Mesh{constructor(e=new l.LineSegmentsGeometry,t=new f({color:0xffffff*Math.random()})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){let e=this.geometry,t=e.attributes.instanceStart,r=e.attributes.instanceEnd,i=new Float32Array(2*t.count);for(let e=0,n=0,a=t.count;e<a;e++,n+=2)p.fromBufferAttribute(t,e),v.fromBufferAttribute(r,e),i[n]=0===n?0:i[n-1],i[n+1]=i[n]+p.distanceTo(v);let n=new s.InstancedInterleavedBuffer(i,2,1);return e.setAttribute("instanceDistanceStart",new s.InterleavedBufferAttribute(n,1,0)),e.setAttribute("instanceDistanceEnd",new s.InterleavedBufferAttribute(n,1,1)),this}raycast(e,i){let n,a,o=this.material.worldUnits,l=e.camera;null!==l||o||console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');let u=void 0!==e.params.Line2&&e.params.Line2.threshold||0;t=e.ray;let c=this.matrixWorld,d=this.geometry,f=this.material;if(r=f.linewidth+u,null===d.boundingSphere&&d.computeBoundingSphere(),A.copy(d.boundingSphere).applyMatrix4(c),o)n=.5*r;else{let e=Math.max(l.near,A.distanceToPoint(t.origin));n=D(l,e,f.resolution)}if(A.radius+=n,!1!==t.intersectsSphere(A)){if(null===d.boundingBox&&d.computeBoundingBox(),E.copy(d.boundingBox).applyMatrix4(c),o)a=.5*r;else{let e=Math.max(l.near,E.distanceToPoint(t.origin));a=D(l,e,f.resolution)}E.expandByScalar(a),!1!==t.intersectsBox(E)&&(o?function(e,i){let n=e.matrixWorld,a=e.geometry,o=a.attributes.instanceStart,l=a.attributes.instanceEnd,u=Math.min(a.instanceCount,o.count);for(let a=0;a<u;a++){M.start.fromBufferAttribute(o,a),M.end.fromBufferAttribute(l,a),M.applyMatrix4(n);let u=new s.Vector3,c=new s.Vector3;t.distanceSqToSegment(M.start,M.end,c,u),c.distanceTo(u)<.5*r&&i.push({point:c,pointOnLine:u,distance:t.origin.distanceTo(c),object:e,face:null,faceIndex:a,uv:null,[h]:null})}}(this,i):function(e,i,n){let a=i.projectionMatrix,o=e.material.resolution,l=e.matrixWorld,u=e.geometry,c=u.attributes.instanceStart,d=u.attributes.instanceEnd,f=Math.min(u.instanceCount,c.count),m=-i.near;t.at(1,w),w.w=1,w.applyMatrix4(i.matrixWorldInverse),w.applyMatrix4(a),w.multiplyScalar(1/w.w),w.x*=o.x/2,w.y*=o.y/2,w.z=0,x.copy(w),b.multiplyMatrices(i.matrixWorldInverse,l);for(let i=0;i<f;i++){if(g.fromBufferAttribute(c,i),y.fromBufferAttribute(d,i),g.w=1,y.w=1,g.applyMatrix4(b),y.applyMatrix4(b),g.z>m&&y.z>m)continue;if(g.z>m){let e=g.z-y.z,t=(g.z-m)/e;g.lerp(y,t)}else if(y.z>m){let e=y.z-g.z,t=(y.z-m)/e;y.lerp(g,t)}g.applyMatrix4(a),y.applyMatrix4(a),g.multiplyScalar(1/g.w),y.multiplyScalar(1/y.w),g.x*=o.x/2,g.y*=o.y/2,y.x*=o.x/2,y.y*=o.y/2,M.start.copy(g),M.start.z=0,M.end.copy(y),M.end.z=0;let u=M.closestPointToPointParameter(x,!0);M.at(u,S);let f=s.MathUtils.lerp(g.z,y.z,u),p=f>=-1&&f<=1,v=x.distanceTo(S)<.5*r;if(p&&v){M.start.fromBufferAttribute(c,i),M.end.fromBufferAttribute(d,i),M.start.applyMatrix4(l),M.end.applyMatrix4(l);let r=new s.Vector3,a=new s.Vector3;t.distanceSqToSegment(M.start,M.end,a,r),n.push({point:a,pointOnLine:r,distance:t.origin.distanceTo(a),object:e,face:null,faceIndex:i,uv:null,[h]:null})}}}(this,l,i))}}onBeforeRender(e){let t=this.material.uniforms;t&&t.resolution&&(e.getViewport(m),this.material.uniforms.resolution.value.set(m.z,m.w))}}var F=l;class L extends F.LineSegmentsGeometry{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){let t=e.length-3,r=new Float32Array(2*t);for(let i=0;i<t;i+=3)r[2*i]=e[i],r[2*i+1]=e[i+1],r[2*i+2]=e[i+2],r[2*i+3]=e[i+3],r[2*i+4]=e[i+4],r[2*i+5]=e[i+5];return super.setPositions(r),this}setColors(e,t=3){let r=e.length-t,i=new Float32Array(2*r);if(3===t)for(let n=0;n<r;n+=t)i[2*n]=e[n],i[2*n+1]=e[n+1],i[2*n+2]=e[n+2],i[2*n+3]=e[n+3],i[2*n+4]=e[n+4],i[2*n+5]=e[n+5];else for(let n=0;n<r;n+=t)i[2*n]=e[n],i[2*n+1]=e[n+1],i[2*n+2]=e[n+2],i[2*n+3]=e[n+3],i[2*n+4]=e[n+4],i[2*n+5]=e[n+5],i[2*n+6]=e[n+6],i[2*n+7]=e[n+7];return super.setColors(i,t),this}fromLine(e){let t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class P extends C{constructor(e=new L,t=new f({color:0xffffff*Math.random()})){super(e,t),this.isLine2=!0,this.type="Line2"}}let z=n.forwardRef(function({points:e,color:t=0xffffff,vertexColors:r,linewidth:s,lineWidth:u,segments:c,dashed:d,...h},m){var p,v;let g=(0,o.useThree)(e=>e.size),y=n.useMemo(()=>c?new C:new P,[c]),[w]=n.useState(()=>new f),x=(null==r||null==(p=r[0])?void 0:p.length)===4?4:3,b=n.useMemo(()=>{let i=c?new l.LineSegmentsGeometry:new L,n=e.map(e=>{let t=Array.isArray(e);return e instanceof a.Vector3||e instanceof a.Vector4?[e.x,e.y,e.z]:e instanceof a.Vector2?[e.x,e.y,0]:t&&3===e.length?[e[0],e[1],e[2]]:t&&2===e.length?[e[0],e[1],0]:e});if(i.setPositions(n.flat()),r){t=0xffffff;let e=r.map(e=>e instanceof a.Color?e.toArray():e);i.setColors(e.flat(),x)}return i},[e,c,r,x]);return n.useLayoutEffect(()=>{y.computeLineDistances()},[e,y]),n.useLayoutEffect(()=>{d?w.defines.USE_DASH="":delete w.defines.USE_DASH,w.needsUpdate=!0},[d,w]),n.useEffect(()=>()=>{b.dispose(),w.dispose()},[b]),n.createElement("primitive",(0,i.default)({object:y,ref:m},h),n.createElement("primitive",{object:b,attach:"geometry"}),n.createElement("primitive",(0,i.default)({object:w,attach:"material",color:t,vertexColors:!!r,resolution:[g.width,g.height],linewidth:null!=(v=null!=s?s:u)?v:1,dashed:d,transparent:4===x},h)))});e.s(["Line",0,z],43216)},60099,95393,e=>{"use strict";let t,r;var i=e.i(31067),n=e.i(71645),a=e.i(88014),o=e.i(90072),s=e.i(90874),l=e.i(61949);e.s(["useFrame",()=>l.F],95393);var l=l;let u=new o.Vector3,c=new o.Vector3,d=new o.Vector3,f=new o.Vector2;function h(e,t,r){let i=u.setFromMatrixPosition(e.matrixWorld);i.project(t);let n=r.width/2,a=r.height/2;return[i.x*n+n,-(i.y*a)+a]}let m=e=>1e-10>Math.abs(e)?0:e;function p(e,t,r=""){let i="matrix3d(";for(let r=0;16!==r;r++)i+=m(t[r]*e.elements[r])+(15!==r?",":")");return r+i}let v=(t=[1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1],e=>p(e,t)),g=(r=e=>[1/e,1/e,1/e,1,-1/e,-1/e,-1/e,-1,1/e,1/e,1/e,1,1,1,1,1],(e,t)=>p(e,r(t),"translate(-50%,-50%)")),y=n.forwardRef(({children:e,eps:t=.001,style:r,className:p,prepend:y,center:w,fullscreen:x,portal:b,distanceFactor:M,sprite:S=!1,transform:E=!1,occlude:A,onOcclude:_,castShadow:D,receiveShadow:C,material:F,geometry:L,zIndexRange:P=[0x1000037,0],calculatePosition:z=h,as:N="div",wrapperClass:O,pointerEvents:U="auto",...I},T)=>{let{gl:B,camera:j,scene:R,size:$,raycaster:k,events:W,viewport:G}=(0,s.useThree)(),[H]=n.useState(()=>document.createElement(N)),V=n.useRef(null),q=n.useRef(null),K=n.useRef(0),Y=n.useRef([0,0]),Z=n.useRef(null),X=n.useRef(null),J=(null==b?void 0:b.current)||W.connected||B.domElement.parentNode,Q=n.useRef(null),ee=n.useRef(!1),et=n.useMemo(()=>{var e;return A&&"blending"!==A||Array.isArray(A)&&A.length&&(e=A[0])&&"object"==typeof e&&"current"in e},[A]);n.useLayoutEffect(()=>{let e=B.domElement;A&&"blending"===A?(e.style.zIndex=`${Math.floor(P[0]/2)}`,e.style.position="absolute",e.style.pointerEvents="none"):(e.style.zIndex=null,e.style.position=null,e.style.pointerEvents=null)},[A]),n.useLayoutEffect(()=>{if(q.current){let e=V.current=a.createRoot(H);if(R.updateMatrixWorld(),E)H.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{let e=z(q.current,j,$);H.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${e[0]}px,${e[1]}px,0);transform-origin:0 0;`}return J&&(y?J.prepend(H):J.appendChild(H)),()=>{J&&J.removeChild(H),e.unmount()}}},[J,E]),n.useLayoutEffect(()=>{O&&(H.className=O)},[O]);let er=n.useMemo(()=>E?{position:"absolute",top:0,left:0,width:$.width,height:$.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:w?"translate3d(-50%,-50%,0)":"none",...x&&{top:-$.height/2,left:-$.width/2,width:$.width,height:$.height},...r},[r,w,x,$,E]),ei=n.useMemo(()=>({position:"absolute",pointerEvents:U}),[U]);n.useLayoutEffect(()=>{var t,i;ee.current=!1,E?null==(t=V.current)||t.render(n.createElement("div",{ref:Z,style:er},n.createElement("div",{ref:X,style:ei},n.createElement("div",{ref:T,className:p,style:r,children:e})))):null==(i=V.current)||i.render(n.createElement("div",{ref:T,style:er,className:p,children:e}))});let en=n.useRef(!0);(0,l.F)(e=>{if(q.current){j.updateMatrixWorld(),q.current.updateWorldMatrix(!0,!1);let e=E?Y.current:z(q.current,j,$);if(E||Math.abs(K.current-j.zoom)>t||Math.abs(Y.current[0]-e[0])>t||Math.abs(Y.current[1]-e[1])>t){var r;let t,i,n,a,s=(r=q.current,t=u.setFromMatrixPosition(r.matrixWorld),i=c.setFromMatrixPosition(j.matrixWorld),n=t.sub(i),a=j.getWorldDirection(d),n.angleTo(a)>Math.PI/2),l=!1;et&&(Array.isArray(A)?l=A.map(e=>e.current):"blending"!==A&&(l=[R]));let h=en.current;l?en.current=function(e,t,r,i){let n=u.setFromMatrixPosition(e.matrixWorld),a=n.clone();a.project(t),f.set(a.x,a.y),r.setFromCamera(f,t);let o=r.intersectObjects(i,!0);if(o.length){let e=o[0].distance;return n.distanceTo(r.ray.origin)<e}return!0}(q.current,j,k,l)&&!s:en.current=!s,h!==en.current&&(_?_(!en.current):H.style.display=en.current?"block":"none");let p=Math.floor(P[0]/2),y=A?et?[P[0],p]:[p-1,0]:P;if(H.style.zIndex=`${function(e,t,r){if(t instanceof o.PerspectiveCamera||t instanceof o.OrthographicCamera){let i=u.setFromMatrixPosition(e.matrixWorld),n=c.setFromMatrixPosition(t.matrixWorld),a=i.distanceTo(n),o=(r[1]-r[0])/(t.far-t.near),s=r[1]-o*t.far;return Math.round(o*a+s)}}(q.current,j,y)}`,E){let[e,t]=[$.width/2,$.height/2],r=j.projectionMatrix.elements[5]*t,{isOrthographicCamera:i,top:n,left:a,bottom:o,right:s}=j,l=v(j.matrixWorldInverse),u=i?`scale(${r})translate(${m(-(s+a)/2)}px,${m((n+o)/2)}px)`:`translateZ(${r}px)`,c=q.current.matrixWorld;S&&((c=j.matrixWorldInverse.clone().transpose().copyPosition(c).scale(q.current.scale)).elements[3]=c.elements[7]=c.elements[11]=0,c.elements[15]=1),H.style.width=$.width+"px",H.style.height=$.height+"px",H.style.perspective=i?"":`${r}px`,Z.current&&X.current&&(Z.current.style.transform=`${u}${l}translate(${e}px,${t}px)`,X.current.style.transform=g(c,1/((M||10)/400)))}else{let t=void 0===M?1:function(e,t){if(t instanceof o.OrthographicCamera)return t.zoom;if(!(t instanceof o.PerspectiveCamera))return 1;{let r=u.setFromMatrixPosition(e.matrixWorld),i=c.setFromMatrixPosition(t.matrixWorld);return 1/(2*Math.tan(t.fov*Math.PI/180/2)*r.distanceTo(i))}}(q.current,j)*M;H.style.transform=`translate3d(${e[0]}px,${e[1]}px,0) scale(${t})`}Y.current=e,K.current=j.zoom}}if(!et&&Q.current&&!ee.current)if(E){if(Z.current){let e=Z.current.children[0];if(null!=e&&e.clientWidth&&null!=e&&e.clientHeight){let{isOrthographicCamera:t}=j;if(t||L)I.scale&&(Array.isArray(I.scale)?I.scale instanceof o.Vector3?Q.current.scale.copy(I.scale.clone().divideScalar(1)):Q.current.scale.set(1/I.scale[0],1/I.scale[1],1/I.scale[2]):Q.current.scale.setScalar(1/I.scale));else{let t=(M||10)/400,r=e.clientWidth*t,i=e.clientHeight*t;Q.current.scale.set(r,i,1)}ee.current=!0}}}else{let t=H.children[0];if(null!=t&&t.clientWidth&&null!=t&&t.clientHeight){let e=1/G.factor,r=t.clientWidth*e,i=t.clientHeight*e;Q.current.scale.set(r,i,1),ee.current=!0}Q.current.lookAt(e.camera.position)}});let ea=n.useMemo(()=>({vertexShader:E?void 0:`
528
528
  /*
529
529
  This shader is from the THREE's SpriteMaterial.
530
530
  We need to turn the backing plane into a Sprite
@@ -561,4 +561,4 @@
561
561
  void main() {
562
562
  gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
563
563
  }
564
- `}),[E]);return n.createElement("group",(0,i.default)({},I,{ref:q}),A&&!et&&n.createElement("mesh",{castShadow:D,receiveShadow:C,ref:Q},F||n.createElement("planeGeometry",null),L||n.createElement("shaderMaterial",{side:o.DoubleSide,vertexShader:ea.vertexShader,fragmentShader:ea.fragmentShader})))});e.s(["Html",0,y],60099)},31497,e=>{"use strict";let t=parseInt(e.i(90072).REVISION.replace(/\D+/g,""));e.s(["version",0,t])},32533,e=>{"use strict";var t=e.i(90072);let r=new t.Box3,i=new t.Vector3;class n extends t.InstancedBufferGeometry{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry",this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new t.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new t.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(e){let t=this.attributes.instanceStart,r=this.attributes.instanceEnd;return void 0!==t&&(t.applyMatrix4(e),r.applyMatrix4(e),t.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}setPositions(e){let r;e instanceof Float32Array?r=e:Array.isArray(e)&&(r=new Float32Array(e));let i=new t.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceStart",new t.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceEnd",new t.InterleavedBufferAttribute(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e,r=3){let i;e instanceof Float32Array?i=e:Array.isArray(e)&&(i=new Float32Array(e));let n=new t.InstancedInterleavedBuffer(i,2*r,1);return this.setAttribute("instanceColorStart",new t.InterleavedBufferAttribute(n,r,0)),this.setAttribute("instanceColorEnd",new t.InterleavedBufferAttribute(n,r,r)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new t.WireframeGeometry(e.geometry)),this}fromLineSegments(e){let t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new t.Box3);let e=this.attributes.instanceStart,i=this.attributes.instanceEnd;void 0!==e&&void 0!==i&&(this.boundingBox.setFromBufferAttribute(e),r.setFromBufferAttribute(i),this.boundingBox.union(r))}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new t.Sphere),null===this.boundingBox&&this.computeBoundingBox();let e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(void 0!==e&&void 0!==r){let t=this.boundingSphere.center;this.boundingBox.getCenter(t);let n=0;for(let a=0,o=e.count;a<o;a++)i.fromBufferAttribute(e,a),n=Math.max(n,t.distanceToSquared(i)),i.fromBufferAttribute(r,a),n=Math.max(n,t.distanceToSquared(i));this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(e){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(e)}}e.s(["LineSegmentsGeometry",0,n])},52822,(e,t,r)=>{"use strict";var i=e.r(71645),n=e.r(2239),a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,s=i.useRef,l=i.useEffect,u=i.useMemo,c=i.useDebugValue;r.useSyncExternalStoreWithSelector=function(e,t,r,i,n){var d=s(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;var h=o(e,(d=u(function(){function e(e){if(!l){if(l=!0,o=e,e=i(e),void 0!==n&&f.hasValue){var t=f.value;if(n(t,e))return s=t}return s=e}if(t=s,a(o,e))return t;var r=i(e);return void 0!==n&&n(t,r)?(o=e,t):(o=e,s=r)}var o,s,l=!1,u=void 0===r?null:r;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]},[t,r,i,n]))[0],d[1]);return l(function(){f.hasValue=!0,f.value=h},[h]),c(h),h}},30224,(e,t,r)=>{"use strict";e.i(47167),t.exports=e.r(52822)}]);
564
+ `}),[E]);return n.createElement("group",(0,i.default)({},I,{ref:q}),A&&!et&&n.createElement("mesh",{castShadow:D,receiveShadow:C,ref:Q},L||n.createElement("planeGeometry",null),F||n.createElement("shaderMaterial",{side:o.DoubleSide,vertexShader:ea.vertexShader,fragmentShader:ea.fragmentShader})))});e.s(["Html",0,y],60099)},31497,e=>{"use strict";let t=parseInt(e.i(90072).REVISION.replace(/\D+/g,""));e.s(["version",0,t])},32533,e=>{"use strict";var t=e.i(90072);let r=new t.Box3,i=new t.Vector3;class n extends t.InstancedBufferGeometry{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry",this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new t.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new t.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(e){let t=this.attributes.instanceStart,r=this.attributes.instanceEnd;return void 0!==t&&(t.applyMatrix4(e),r.applyMatrix4(e),t.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}setPositions(e){let r;e instanceof Float32Array?r=e:Array.isArray(e)&&(r=new Float32Array(e));let i=new t.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceStart",new t.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceEnd",new t.InterleavedBufferAttribute(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e,r=3){let i;e instanceof Float32Array?i=e:Array.isArray(e)&&(i=new Float32Array(e));let n=new t.InstancedInterleavedBuffer(i,2*r,1);return this.setAttribute("instanceColorStart",new t.InterleavedBufferAttribute(n,r,0)),this.setAttribute("instanceColorEnd",new t.InterleavedBufferAttribute(n,r,r)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new t.WireframeGeometry(e.geometry)),this}fromLineSegments(e){let t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new t.Box3);let e=this.attributes.instanceStart,i=this.attributes.instanceEnd;void 0!==e&&void 0!==i&&(this.boundingBox.setFromBufferAttribute(e),r.setFromBufferAttribute(i),this.boundingBox.union(r))}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new t.Sphere),null===this.boundingBox&&this.computeBoundingBox();let e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(void 0!==e&&void 0!==r){let t=this.boundingSphere.center;this.boundingBox.getCenter(t);let n=0;for(let a=0,o=e.count;a<o;a++)i.fromBufferAttribute(e,a),n=Math.max(n,t.distanceToSquared(i)),i.fromBufferAttribute(r,a),n=Math.max(n,t.distanceToSquared(i));this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(e){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(e)}}e.s(["LineSegmentsGeometry",0,n])},52822,(e,t,r)=>{"use strict";var i=e.r(71645),n=e.r(2239),a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,s=i.useRef,l=i.useEffect,u=i.useMemo,c=i.useDebugValue;r.useSyncExternalStoreWithSelector=function(e,t,r,i,n){var d=s(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;var h=o(e,(d=u(function(){function e(e){if(!l){if(l=!0,o=e,e=i(e),void 0!==n&&f.hasValue){var t=f.value;if(n(t,e))return s=t}return s=e}if(t=s,a(o,e))return t;var r=i(e);return void 0!==n&&n(t,r)?(o=e,t):(o=e,s=r)}var o,s,l=!1,u=void 0===r?null:r;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]},[t,r,i,n]))[0],d[1]);return l(function(){f.hasValue=!0,f.value=h},[h]),c(h),h}},30224,(e,t,r)=>{"use strict";e.i(47167),t.exports=e.r(52822)}]);