@rr0/ufoathome 0.204.0 → 0.204.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 (91) hide show
  1. package/dist-embed-scene/rr0-scene.mjs +215 -215
  2. package/dist-embed-sighting/{CaseReportExport-CUy_3oyV.js → CaseReportExport-DQ4bO4eb.js} +1 -1
  3. package/dist-embed-sighting/SightingMessages_en-Bih7ljAQ.js +1 -0
  4. package/dist-embed-sighting/SightingMessages_es-CHrrXx-N.js +1 -0
  5. package/dist-embed-sighting/SightingMessages_fr-B2NUAkiz.js +1 -0
  6. package/dist-embed-sighting/SightingMessages_it-OGLqMUWg.js +1 -0
  7. package/dist-embed-sighting/rr0-sighting.mjs +233 -229
  8. package/dist-embed-sighting-editor/{CaseElement-CC4gimF1.js → CaseElement-zFqMRzIe.js} +2 -2
  9. package/dist-embed-sighting-editor/{CaseReportExport-DmvvH_GH.js → CaseReportExport-C7dPT0eH.js} +1 -1
  10. package/{dist-embed-ufoathome/SightingEditorMessages_en-V_dJYjNb.js → dist-embed-sighting-editor/SightingEditorMessages_en-CS2iXwDm.js} +1 -1
  11. package/{dist-embed-ufoathome/SightingEditorMessages_es-DauDuhPa.js → dist-embed-sighting-editor/SightingEditorMessages_es-C8Vw_4b_.js} +1 -1
  12. package/dist-embed-sighting-editor/{SightingEditorMessages_fr-zxTvQa2I.js → SightingEditorMessages_fr-AYgrnKFD.js} +1 -1
  13. package/dist-embed-sighting-editor/{SightingEditorMessages_it-vvaao68O.js → SightingEditorMessages_it-DZyzwScx.js} +1 -1
  14. package/dist-embed-sighting-editor/{SightingElement-BpYuBmJB.js → SightingElement-Bf654S_I.js} +5 -5
  15. package/dist-embed-sighting-editor/{SightingLabels_en-dOsFjVRL.js → SightingLabels_en-trAaLk8Q.js} +1 -1
  16. package/{dist-embed-ufoathome/SightingLabels_es-CKlP2BDO.js → dist-embed-sighting-editor/SightingLabels_es-Geji-Hhz.js} +1 -1
  17. package/dist-embed-sighting-editor/{SightingLabels_fr-Cpkcf5_9.js → SightingLabels_fr-BVnntoiD.js} +1 -1
  18. package/{dist-embed-ufoathome/SightingLabels_it-3127rMXm.js → dist-embed-sighting-editor/SightingLabels_it-B9FWbLXW.js} +1 -1
  19. package/dist-embed-sighting-editor/{SightingMessages_en-Drcr3k4V.js → SightingMessages_en-D90vDTQ7.js} +1 -1
  20. package/dist-embed-sighting-editor/{SightingMessages_es-BcaWM7Oy.js → SightingMessages_es-D8laK6OY.js} +1 -1
  21. package/dist-embed-sighting-editor/{SightingMessages_fr-7IYuW095.js → SightingMessages_fr-Gq3IMFTE.js} +1 -1
  22. package/dist-embed-sighting-editor/{SightingMessages_it-BhDmZn6p.js → SightingMessages_it-BXDxv-lE.js} +1 -1
  23. package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +245 -241
  24. package/dist-embed-ufoathome/{AdsbLolArchiveProvider-Ck345V92.js → AdsbLolArchiveProvider-JK7ddZzC.js} +1 -1
  25. package/dist-embed-ufoathome/{Aurora-CMORgA2p.js → Aurora-UBzKnuxt.js} +1 -1
  26. package/dist-embed-ufoathome/{AuroraEditor-CDZgVOlI.js → AuroraEditor-B0Q9h5C6.js} +1 -1
  27. package/dist-embed-ufoathome/{AuroraSimulation-DqfSBul6.js → AuroraSimulation-Cj8dyvm4.js} +1 -1
  28. package/dist-embed-ufoathome/{BallesterGuaspAssessor-DUNQZ9e8.js → BallesterGuaspAssessor-DZ5guaNx.js} +1 -1
  29. package/dist-embed-ufoathome/{BalloonEditor-Cx3fRab8.js → BalloonEditor-BBAtMeVM.js} +1 -1
  30. package/dist-embed-ufoathome/{BeamEditor-gxTjO6Pr.js → BeamEditor-Dgo8WSF9.js} +1 -1
  31. package/dist-embed-ufoathome/{BeamSystem-C8jjTJtB.js → BeamSystem-BbSsBbZk.js} +1 -1
  32. package/dist-embed-ufoathome/{BodyEditor-DGaBo74A.js → BodyEditor-Cav_-OeQ.js} +1 -1
  33. package/dist-embed-ufoathome/{CaseEditorElement-BOp207Tr.js → CaseEditorElement-CK82yjEn.js} +6 -6
  34. package/dist-embed-ufoathome/{CaseElement-BGO5UZLP.js → CaseElement-Bm6xPD0e.js} +3 -3
  35. package/dist-embed-ufoathome/{CaseReportExport-6DFaJzfO.js → CaseReportExport-D_I2ml6F.js} +3 -3
  36. package/dist-embed-ufoathome/{ColumnResize-DnX89ynB.js → ColumnResize-DksRZriL.js} +4 -4
  37. package/dist-embed-ufoathome/{ControlPasses-CeExr5X1.js → ControlPasses-BpLNDq5G.js} +1 -1
  38. package/dist-embed-ufoathome/{CoverageAssessor-BbqRqh0C.js → CoverageAssessor-UyH_dVvr.js} +1 -1
  39. package/dist-embed-ufoathome/{Flightradar24Provider-MzQcuUHn.js → Flightradar24Provider-XASYwL-N.js} +1 -1
  40. package/dist-embed-ufoathome/{GLTFLoader-CPUffC65.js → GLTFLoader-s3EU9qS0.js} +1 -1
  41. package/dist-embed-ufoathome/{GeoJsonExport-D7QhWNRC.js → GeoJsonExport-BCtJzQ9B.js} +1 -1
  42. package/dist-embed-ufoathome/{GeographicFigures-BvEeCtxr.js → GeographicFigures-DINsiWL0.js} +1 -1
  43. package/dist-embed-ufoathome/{HynekAssessor-BwjRkQWT.js → HynekAssessor-D5zxfJ44.js} +1 -1
  44. package/dist-embed-ufoathome/{InterviewEditorElement-CVCOicLD.js → InterviewEditorElement-CQNMEirl.js} +1 -1
  45. package/dist-embed-ufoathome/{InterviewElement-ZI42DKRx.js → InterviewElement-BouR8Xii.js} +1 -1
  46. package/dist-embed-ufoathome/{KmlExport-BX0nxAaA.js → KmlExport-C8zEY6ew.js} +1 -1
  47. package/dist-embed-ufoathome/{LanternEditor-BROUv-vx.js → LanternEditor-DEeA3Kf_.js} +1 -1
  48. package/dist-embed-ufoathome/{LaserBeam-ChD9aV-N.js → LaserBeam-CDTsYUwS.js} +1 -1
  49. package/dist-embed-ufoathome/{LaunchEditor-CM2Wcjv2.js → LaunchEditor-C91_y6bJ.js} +1 -1
  50. package/dist-embed-ufoathome/{LaunchPlume-DeVRe05u.js → LaunchPlume-Je5cyuGE.js} +1 -1
  51. package/dist-embed-ufoathome/{LaunchSimulation-RROdYccW.js → LaunchSimulation-BsCQGsdb.js} +1 -1
  52. package/dist-embed-ufoathome/{ModelSource-nXZ6eIH5.js → ModelSource-7jnvikmB.js} +1 -1
  53. package/dist-embed-ufoathome/{ModelThumbnails-CRSm49vm.js → ModelThumbnails-DhEg69n0.js} +1 -1
  54. package/dist-embed-ufoathome/{ModelViewer-BQsl_Nfn.js → ModelViewer-BQJyyY66.js} +1 -1
  55. package/dist-embed-ufoathome/{ModulesPanelElement-BvzY1GUF.js → ModulesPanelElement-Ct9DMG0-.js} +1 -1
  56. package/dist-embed-ufoathome/{NearestApproach-DbUpe1iw.js → NearestApproach-BFKGUqFb.js} +1 -1
  57. package/dist-embed-ufoathome/{PoherAssessor-Dmro58tC.js → PoherAssessor-Cmw5u2Nv.js} +1 -1
  58. package/dist-embed-ufoathome/{PoherSelfCheck-pcYj_hQ1.js → PoherSelfCheck-BjmenygA.js} +1 -1
  59. package/dist-embed-ufoathome/{ReentryEditor-Di0KzYeZ.js → ReentryEditor-x_C9chQN.js} +1 -1
  60. package/dist-embed-ufoathome/{ReentrySimulation-HhdlSVkR.js → ReentrySimulation-D0XIfeyt.js} +1 -1
  61. package/dist-embed-ufoathome/{ReferenceSystem-B30-UBHY.js → ReferenceSystem-Cv556rkv.js} +1 -1
  62. package/dist-embed-ufoathome/{ScenarioReadings-EAUAsx9t.js → ScenarioReadings-YJ8iIjyw.js} +1 -1
  63. package/dist-embed-ufoathome/{ScenarioSweep-jTxLjnaW.js → ScenarioSweep-DTqJSF5a.js} +1 -1
  64. package/dist-embed-ufoathome/{SearchlightEditor-B6_BW8FD.js → SearchlightEditor-Dy-gMDUN.js} +1 -1
  65. package/dist-embed-ufoathome/{SearchlightSystem-D_DTpDNC.js → SearchlightSystem-C-qAMIFS.js} +1 -1
  66. package/dist-embed-ufoathome/{ShareDialogElement-C0oFh0X4.js → ShareDialogElement-DMDY7Hlo.js} +17 -13
  67. package/dist-embed-ufoathome/Sighting-C1yj2-s5.js +1 -0
  68. package/{dist-embed-sighting-editor/SightingEditorMessages_en-V_dJYjNb.js → dist-embed-ufoathome/SightingEditorMessages_en-CS2iXwDm.js} +1 -1
  69. package/{dist-embed-sighting-editor/SightingEditorMessages_es-DauDuhPa.js → dist-embed-ufoathome/SightingEditorMessages_es-C8Vw_4b_.js} +1 -1
  70. package/dist-embed-ufoathome/{SightingEditorMessages_fr-zxTvQa2I.js → SightingEditorMessages_fr-AYgrnKFD.js} +1 -1
  71. package/dist-embed-ufoathome/{SightingEditorMessages_it-vvaao68O.js → SightingEditorMessages_it-DZyzwScx.js} +1 -1
  72. package/dist-embed-ufoathome/{SightingElement-DzxTvvLN.js → SightingElement-DZlh5u4N.js} +5 -5
  73. package/dist-embed-ufoathome/{SightingLabels_en-dOsFjVRL.js → SightingLabels_en-trAaLk8Q.js} +1 -1
  74. package/{dist-embed-sighting-editor/SightingLabels_es-CKlP2BDO.js → dist-embed-ufoathome/SightingLabels_es-Geji-Hhz.js} +1 -1
  75. package/dist-embed-ufoathome/{SightingLabels_fr-Cpkcf5_9.js → SightingLabels_fr-BVnntoiD.js} +1 -1
  76. package/{dist-embed-sighting-editor/SightingLabels_it-3127rMXm.js → dist-embed-ufoathome/SightingLabels_it-B9FWbLXW.js} +1 -1
  77. package/dist-embed-ufoathome/{SightingMessages_en-Drcr3k4V.js → SightingMessages_en-D90vDTQ7.js} +1 -1
  78. package/dist-embed-ufoathome/{SightingMessages_es-BcaWM7Oy.js → SightingMessages_es-D8laK6OY.js} +1 -1
  79. package/dist-embed-ufoathome/{SightingMessages_fr-7IYuW095.js → SightingMessages_fr-Gq3IMFTE.js} +1 -1
  80. package/dist-embed-ufoathome/{SightingMessages_it-BhDmZn6p.js → SightingMessages_it-BXDxv-lE.js} +1 -1
  81. package/dist-embed-ufoathome/{TraceSystem-CiBRo1aU.js → TraceSystem-DYmjmB9_.js} +1 -1
  82. package/dist-embed-ufoathome/{VideoButton-BseBKx2r.js → VideoButton-CvAmQpx0.js} +1 -1
  83. package/dist-embed-ufoathome/rr0-ufoathome.mjs +3 -3
  84. package/dist-embed-ufoathome/{surroundingsSources-BSh42KUu.js → surroundingsSources-DtoCfflQ.js} +1 -1
  85. package/dist-embed-ufoathome/{trafficRuntime-BMTtwn7o.js → trafficRuntime-CyYep5Cc.js} +1 -1
  86. package/package.json +1 -1
  87. package/dist-embed-sighting/SightingMessages_en-DKFVZnDu.js +0 -1
  88. package/dist-embed-sighting/SightingMessages_es-DYQlWvm0.js +0 -1
  89. package/dist-embed-sighting/SightingMessages_fr-BygVDDY9.js +0 -1
  90. package/dist-embed-sighting/SightingMessages_it-BI7GnXPz.js +0 -1
  91. package/dist-embed-ufoathome/Sighting-BX_CmDY2.js +0 -1
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ModulesPanelMessages_en-Dir0ADQe.js","./ConsentMessages_en-DBKCeDAn.js","./ModulesPanelMessages_fr-DbKLtD8s.js","./ConsentMessages_fr-FGSpqzMc.js","./ModulesPanelMessages_es-B_ITNG5N.js","./ConsentMessages_es-Dby74lUq.js","./ModulesPanelMessages_it-CE0q7D2c.js","./ConsentMessages_it-BJWfXH6I.js","./ModuleConformance-DYDAaJJQ.js","./rr0-ufoathome.mjs"])))=>i.map(i=>d[i]);
2
- import{M as R,_ as N,H as T,i as m,L as C,a0 as M}from"./rr0-ufoathome.mjs";import{ModuleSession as B}from"./ModuleSession-Dac4fD0X.js";import{M as O}from"./CaseEditorElement-BOp207Tr.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./GeoProjection-DvqDbRIx.js";import"./SaidPosition-OJEYhVKN.js";import"./ParameterForm-XbqxCLRn.js";import"./ColumnResize-DnX89ynB.js";import"./ShareDialogElement-C0oFh0X4.js";import"./Sighting-BX_CmDY2.js";import"./VisualAids-DI-hEL46.js";import"./three.module-CbaHqYFq.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./Obstacles-v9SkfBD7.js";import"./PoherSelfCheck-pcYj_hQ1.js";import"./PoherMatrix-C2fcLqDH.js";import"./TimelineTracks-Daaqw9ly.js";import"./ReentryArchive-CeXHrU7L.js";import"./ReferenceTimeline-2kBldQeG.js";import"./upperAirSources-BU0pD84c.js";import"./Account-C4jhsVtN.js";const S=R.catalog({en:()=>N(()=>import("./ModulesPanelMessages_en-Dir0ADQe.js"),__vite__mapDeps([0,1]),import.meta.url).then(v=>v.modulesPanelMessages_en),fr:()=>N(()=>import("./ModulesPanelMessages_fr-DbKLtD8s.js"),__vite__mapDeps([2,3]),import.meta.url).then(v=>v.modulesPanelMessages_fr),es:()=>N(()=>import("./ModulesPanelMessages_es-B_ITNG5N.js"),__vite__mapDeps([4,5]),import.meta.url).then(v=>v.modulesPanelMessages_es),it:()=>N(()=>import("./ModulesPanelMessages_it-CE0q7D2c.js"),__vite__mapDeps([6,7]),import.meta.url).then(v=>v.modulesPanelMessages_it)}),P="rr0-modules-panel",D=`
2
+ import{M as R,_ as N,H as T,i as m,L as C,a0 as M}from"./rr0-ufoathome.mjs";import{ModuleSession as B}from"./ModuleSession-Dac4fD0X.js";import{M as O}from"./CaseEditorElement-CK82yjEn.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./GeoProjection-DvqDbRIx.js";import"./SaidPosition-OJEYhVKN.js";import"./ParameterForm-XbqxCLRn.js";import"./ColumnResize-DksRZriL.js";import"./ShareDialogElement-DMDY7Hlo.js";import"./Sighting-C1yj2-s5.js";import"./VisualAids-DI-hEL46.js";import"./three.module-CbaHqYFq.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./Obstacles-v9SkfBD7.js";import"./PoherSelfCheck-BjmenygA.js";import"./PoherMatrix-C2fcLqDH.js";import"./TimelineTracks-Daaqw9ly.js";import"./ReentryArchive-CeXHrU7L.js";import"./ReferenceTimeline-2kBldQeG.js";import"./upperAirSources-BU0pD84c.js";import"./Account-C4jhsVtN.js";const S=R.catalog({en:()=>N(()=>import("./ModulesPanelMessages_en-Dir0ADQe.js"),__vite__mapDeps([0,1]),import.meta.url).then(v=>v.modulesPanelMessages_en),fr:()=>N(()=>import("./ModulesPanelMessages_fr-DbKLtD8s.js"),__vite__mapDeps([2,3]),import.meta.url).then(v=>v.modulesPanelMessages_fr),es:()=>N(()=>import("./ModulesPanelMessages_es-B_ITNG5N.js"),__vite__mapDeps([4,5]),import.meta.url).then(v=>v.modulesPanelMessages_es),it:()=>N(()=>import("./ModulesPanelMessages_it-CE0q7D2c.js"),__vite__mapDeps([6,7]),import.meta.url).then(v=>v.modulesPanelMessages_it)}),P="rr0-modules-panel",D=`
3
3
  rr0-modules-panel { display: block; }
4
4
  rr0-modules-panel .mp-add { display: flex; gap: .4em; align-items: center; margin: .4em 0; }
5
5
  rr0-modules-panel .mp-add input { flex: 1 1 16em; min-width: 0; }
@@ -1 +1 @@
1
- import{b0 as b,aT as h}from"./ShareDialogElement-C0oFh0X4.js";class c{static FLAT={heightAt:()=>0};static of(e){const s=e.timeline.sourceIds.map(n=>b.of(e,n)?.nearestM).filter(n=>n!==void 0);return s.length>0?{m:Math.min(...s),basis:"derived",paths:["timeline","observerTrack"]}:c.interpreted(e)}static interpreted(e){const s=(e.interpretation?.bodies??[]).map((t,i)=>({body:t,index:i})).filter(({body:t})=>Array.isArray(t.track)),n=s.filter(({body:t})=>(t.explains?.length??0)>0),u=n.length>0?n:s,d=c.FLAT,l=t=>h.eyeOf(e,t,d);let o;const p=[];for(const{body:t,index:i}of u){const M=new h(t,d,l);for(const{t:f}of t.track){const a=M.at(f),r=l(f);if(!a||!r)continue;const m=Math.hypot(a.eastM-r.eastM,a.northM-r.northM,a.upM-r.upM);(o===void 0||m<o)&&(o=m)}p.push(`interpretation.bodies.${i}`)}return o===void 0?void 0:{m:o,basis:"assumed",paths:p}}}export{c as N};
1
+ import{b0 as b,aT as h}from"./ShareDialogElement-DMDY7Hlo.js";class c{static FLAT={heightAt:()=>0};static of(e){const s=e.timeline.sourceIds.map(n=>b.of(e,n)?.nearestM).filter(n=>n!==void 0);return s.length>0?{m:Math.min(...s),basis:"derived",paths:["timeline","observerTrack"]}:c.interpreted(e)}static interpreted(e){const s=(e.interpretation?.bodies??[]).map((t,i)=>({body:t,index:i})).filter(({body:t})=>Array.isArray(t.track)),n=s.filter(({body:t})=>(t.explains?.length??0)>0),u=n.length>0?n:s,d=c.FLAT,l=t=>h.eyeOf(e,t,d);let o;const p=[];for(const{body:t,index:i}of u){const M=new h(t,d,l);for(const{t:f}of t.track){const a=M.at(f),r=l(f);if(!a||!r)continue;const m=Math.hypot(a.eastM-r.eastM,a.northM-r.northM,a.upM-r.upM);(o===void 0||m<o)&&(o=m)}p.push(`interpretation.bodies.${i}`)}return o===void 0?void 0:{m:o,basis:"assumed",paths:p}}}export{c as N};
@@ -1 +1 @@
1
- import{x as u}from"./ShareDialogElement-C0oFh0X4.js";import"./rr0-ufoathome.mjs";import"./Sighting-BX_CmDY2.js";import"./VisualAids-DI-hEL46.js";import"./three.module-CbaHqYFq.js";import"./SaidPosition-OJEYhVKN.js";import"./GeoProjection-DvqDbRIx.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";class o{about="shape";static STEP_DEG=2;static TURN_DEG=60;static ERRATIC_TURNS=3;static OSCILLATIONS=["vibrate","spiral","roll"];async assess(n){const t=this.trajectory(n),s=this.vanish(n),i=this.oscillation(n),e=this.landing(n),c=this.judged(n,"traces"),r=this.occupants(n),h=e.shown&&r.shown?5:e.shown&&c.shown?4:e.shown||t.value==="erratic"||s.shown||i.shown?3:t.value==="abnormal"?2:t.value==="straight"?1:0,a=[{id:"poher-trajectory",basis:t.basis,paths:t.paths,value:o.TRAJECTORIES.indexOf(t.value)},this.criterion("poher-vanish",s),this.criterion("poher-oscillation",i),{...this.criterion("poher-landing",e),unsupported:e.basis===void 0},this.criterion("poher-traces",c),this.criterion("poher-occupants",r)];return{verdict:String(h),criteria:a}}static TRAJECTORIES=["unknown","still","straight","abnormal","erratic"];criterion(n,t){return{id:n,value:t.shown?1:0,basis:t.basis,paths:t.basis===void 0?[]:t.paths}}trajectory(n){let t="unknown";for(const s of n.timeline.sourceIds){const i=this.seen(n,s).filter(a=>a.aim!==void 0).map(a=>a.aim);if(i.length<2)continue;const e=[o.unit(i[0])];for(const a of i.slice(1)){const l=o.unit(a);o.angleDeg(e[e.length-1],l)>=o.STEP_DEG&&e.push(l)}const c=e.length-1;let r=0;for(let a=1;a<e.length-1;a++){const l=o.cross(e[a-1],e[a]),d=o.cross(e[a],e[a+1]);o.angleDeg(l,d)>=o.TURN_DEG&&r++}const h=c===0?"still":r>=o.ERRATIC_TURNS?"erratic":r>0?"abnormal":"straight";o.TRAJECTORIES.indexOf(h)>o.TRAJECTORIES.indexOf(t)&&(t=h)}return t==="unknown"?{value:t,paths:[]}:{value:t,basis:"derived",paths:["timeline"]}}vanish(n){const t=(n.events??[]).findIndex(s=>s.eventType==="vanish"&&u.isPhenomenon(n,s));return t>=0?{shown:!0,basis:"stated",paths:[`events.${t}`]}:{shown:!1,paths:[]}}oscillation(n){const t=new Set((n.interpretation?.bodies??[]).map(i=>i.id)),s=(n.events??[]).findIndex(i=>o.OSCILLATIONS.includes(i.eventType)&&(u.isPhenomenon(n,i)||t.has(i.who?.split("/")[0]??"")));return s>=0?{shown:!0,basis:"stated",paths:[`events.${s}`]}:{shown:!1,paths:[]}}landing(n){const t=i=>!i.onGround&&((i.altitudeAboveGroundM??0)>0||(i.altitudeM??0)>0),s=(n.interpretation?.bodies??[]).findIndex(i=>Array.isArray(i.track)&&i.track.some(e=>e.onGround)&&i.track.some(t));return s>=0?{shown:!0,basis:"assumed",paths:[`interpretation.bodies.${s}`]}:{shown:!1,paths:[]}}occupants(n){const t=n.decor.findIndex(s=>s.kind==="entity");return t>=0?{shown:!0,basis:"stated",paths:[`decor.${t}`]}:this.judged(n,"beings")}judged(n,t){const s=n.account?.strangeness?.[t];return s===void 0?{shown:!1,paths:[]}:{shown:s,basis:"stated",paths:[`account.strangeness.${t}`]}}instants(n,t){return n.timeline.allKeyframes.map(s=>({t:s.t,shape:s.shapes.find(i=>i.sourceId===t)?.shape})).filter(({shape:s})=>s!==void 0).map(({t:s,shape:i})=>({t:s,aim:i.aim,visible:i.transparency<1})).sort((s,i)=>s.t-i.t)}seen(n,t){return this.instants(n,t).filter(s=>s.visible)}static unit(n){const[t,s]=[n.azimuthDeg*Math.PI/180,n.altitudeDeg*Math.PI/180];return[Math.cos(s)*Math.sin(t),Math.cos(s)*Math.cos(t),Math.sin(s)]}static cross(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}static angleDeg(n,t){const s=Math.hypot(...n)*Math.hypot(...t);if(s===0)return 0;const i=(n[0]*t[0]+n[1]*t[1]+n[2]*t[2])/s;return Math.acos(Math.max(-1,Math.min(1,i)))*180/Math.PI}}export{o as PoherAssessor};
1
+ import{x as u}from"./ShareDialogElement-DMDY7Hlo.js";import"./rr0-ufoathome.mjs";import"./Sighting-C1yj2-s5.js";import"./VisualAids-DI-hEL46.js";import"./three.module-CbaHqYFq.js";import"./SaidPosition-OJEYhVKN.js";import"./GeoProjection-DvqDbRIx.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";class o{about="shape";static STEP_DEG=2;static TURN_DEG=60;static ERRATIC_TURNS=3;static OSCILLATIONS=["vibrate","spiral","roll"];async assess(n){const t=this.trajectory(n),s=this.vanish(n),i=this.oscillation(n),e=this.landing(n),c=this.judged(n,"traces"),r=this.occupants(n),h=e.shown&&r.shown?5:e.shown&&c.shown?4:e.shown||t.value==="erratic"||s.shown||i.shown?3:t.value==="abnormal"?2:t.value==="straight"?1:0,a=[{id:"poher-trajectory",basis:t.basis,paths:t.paths,value:o.TRAJECTORIES.indexOf(t.value)},this.criterion("poher-vanish",s),this.criterion("poher-oscillation",i),{...this.criterion("poher-landing",e),unsupported:e.basis===void 0},this.criterion("poher-traces",c),this.criterion("poher-occupants",r)];return{verdict:String(h),criteria:a}}static TRAJECTORIES=["unknown","still","straight","abnormal","erratic"];criterion(n,t){return{id:n,value:t.shown?1:0,basis:t.basis,paths:t.basis===void 0?[]:t.paths}}trajectory(n){let t="unknown";for(const s of n.timeline.sourceIds){const i=this.seen(n,s).filter(a=>a.aim!==void 0).map(a=>a.aim);if(i.length<2)continue;const e=[o.unit(i[0])];for(const a of i.slice(1)){const l=o.unit(a);o.angleDeg(e[e.length-1],l)>=o.STEP_DEG&&e.push(l)}const c=e.length-1;let r=0;for(let a=1;a<e.length-1;a++){const l=o.cross(e[a-1],e[a]),d=o.cross(e[a],e[a+1]);o.angleDeg(l,d)>=o.TURN_DEG&&r++}const h=c===0?"still":r>=o.ERRATIC_TURNS?"erratic":r>0?"abnormal":"straight";o.TRAJECTORIES.indexOf(h)>o.TRAJECTORIES.indexOf(t)&&(t=h)}return t==="unknown"?{value:t,paths:[]}:{value:t,basis:"derived",paths:["timeline"]}}vanish(n){const t=(n.events??[]).findIndex(s=>s.eventType==="vanish"&&u.isPhenomenon(n,s));return t>=0?{shown:!0,basis:"stated",paths:[`events.${t}`]}:{shown:!1,paths:[]}}oscillation(n){const t=new Set((n.interpretation?.bodies??[]).map(i=>i.id)),s=(n.events??[]).findIndex(i=>o.OSCILLATIONS.includes(i.eventType)&&(u.isPhenomenon(n,i)||t.has(i.who?.split("/")[0]??"")));return s>=0?{shown:!0,basis:"stated",paths:[`events.${s}`]}:{shown:!1,paths:[]}}landing(n){const t=i=>!i.onGround&&((i.altitudeAboveGroundM??0)>0||(i.altitudeM??0)>0),s=(n.interpretation?.bodies??[]).findIndex(i=>Array.isArray(i.track)&&i.track.some(e=>e.onGround)&&i.track.some(t));return s>=0?{shown:!0,basis:"assumed",paths:[`interpretation.bodies.${s}`]}:{shown:!1,paths:[]}}occupants(n){const t=n.decor.findIndex(s=>s.kind==="entity");return t>=0?{shown:!0,basis:"stated",paths:[`decor.${t}`]}:this.judged(n,"beings")}judged(n,t){const s=n.account?.strangeness?.[t];return s===void 0?{shown:!1,paths:[]}:{shown:s,basis:"stated",paths:[`account.strangeness.${t}`]}}instants(n,t){return n.timeline.allKeyframes.map(s=>({t:s.t,shape:s.shapes.find(i=>i.sourceId===t)?.shape})).filter(({shape:s})=>s!==void 0).map(({t:s,shape:i})=>({t:s,aim:i.aim,visible:i.transparency<1})).sort((s,i)=>s.t-i.t)}seen(n,t){return this.instants(n,t).filter(s=>s.visible)}static unit(n){const[t,s]=[n.azimuthDeg*Math.PI/180,n.altitudeDeg*Math.PI/180];return[Math.cos(s)*Math.sin(t),Math.cos(s)*Math.cos(t),Math.sin(s)]}static cross(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}static angleDeg(n,t){const s=Math.hypot(...n)*Math.hypot(...t);if(s===0)return 0;const i=(n[0]*t[0]+n[1]*t[1]+n[2]*t[2])/s;return Math.acos(Math.max(-1,Math.min(1,i)))*180/Math.PI}}export{o as PoherAssessor};
@@ -1 +1 @@
1
- import{s as B,n as T,aT as A,W as k}from"./ShareDialogElement-C0oFh0X4.js";import{b as P}from"./Sighting-BX_CmDY2.js";import{PoherAnswers as O}from"./PoherMatrix-C2fcLqDH.js";import"./rr0-ufoathome.mjs";import"./three.module-CbaHqYFq.js";import"./SaidPosition-OJEYhVKN.js";import"./GeoProjection-DvqDbRIx.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";import"./VisualAids-DI-hEL46.js";class v{static separation(e,d){const t=Math.PI/180,l=Math.sin(e.altitudeDeg*t)*Math.sin(d.altitudeDeg*t)+Math.cos(e.altitudeDeg*t)*Math.cos(d.altitudeDeg*t)*Math.cos((e.azimuthDeg-d.azimuthDeg)*t);return Math.acos(Math.max(-1,Math.min(1,l)))/t}static of(e){if(e.length<2)return{};const d=e.slice(1).map((i,h)=>({deg:v.separation(e[h],i),s:(i.t-e[h].t)/1e3})),t=v.separation(e[0],e[e.length-1]),l=d.reduce((i,h)=>i+h.deg,0),s={sweepDeg:t,straysDeg:Math.max(0,l-t)/2},a=(e[e.length-1].t-e[0].t)/1e3;if(a>0){s.speedDegPerS=l/a;const i=Math.max(...d.filter(h=>h.s>0).map(h=>h.deg/h.s));s.speedVariation=s.speedDegPerS>0?i/s.speedDegPerS:0}return s}}class Q{static of(e,d=0){const t={},l=e.event,s=l.place?.[0];if(s&&l.time?.year!==void 0&&l.time.hour!==void 0){const o=B(l.time,s.lng,l.utcOffsetHours);o&&(t.sunAltitudeDeg=T("Sun",o,{lat:s.lat,lng:s.lng,elevationM:d}).altitudeDeg)}if(l.durationSeconds!==void 0&&(t.durationSeconds=l.durationSeconds),e.weatherTrack.allKeyframes.length>0){const o=P(e,0);t.cloudCover=o.cloudCover,t.lightning=o.storm,t.lowVisibility=o.precipitationType!=="none"&&o.precipitationIntensity>.3}const a=e.timeline,i=a.sourceIds[0];if(i){const o=a.allKeyframes.filter(c=>c.shapes.some(M=>M.sourceId===i)),p=o.map(c=>({t:c.t,shape:a.getShapeAt(c.t,i)})).filter(c=>c.shape?.aim),r=a.getInterpolatedShapeAt(o[0]?.t??0,i);if(r?.aim&&(t.elevationDeg=r.aim.altitudeDeg),r?.angular){t.widthDeg=r.angular.widthDeg;const c=r.angular.heightDeg>0?r.angular.widthDeg/r.angular.heightDeg:1;t.round=r.kind==="oval"&&c>.8&&c<1.25}r?.brightness!==void 0&&(t.brightness=r.brightness),Object.assign(t,v.of(p.map(c=>({t:c.t,...c.shape.aim}))))}const h=new Set(a.sourceIds.map(o=>a.groupMembers(o)?.[0]??o));h.size>0&&(t.count=h.size);const u=[...h].map(o=>a.getInterpolatedShapeAt(0,o)?.aim).filter(o=>o!==void 0);if(u.length>=3){const o=Math.PI/180,p=u.map(g=>({x:(((g.azimuthDeg-u[0].azimuthDeg)%360+540)%360-180)*Math.cos(g.altitudeDeg*o),y:g.altitudeDeg}));let[r,c]=[p[0],p[1]];for(const g of p)for(const y of p)Math.hypot(g.x-y.x,g.y-y.y)>Math.hypot(r.x-c.x,r.y-c.y)&&([r,c]=[g,y]);const M=Math.hypot(r.x-c.x,r.y-c.y);t.aligned=M>0&&p.every(g=>Math.abs((c.x-r.x)*(r.y-g.y)-(r.x-g.x)*(c.y-r.y))/M<=Math.max(.5,M*.1))}const w=new Set([...h].map(o=>a.getInterpolatedShapeAt(0,o)?.color).filter(o=>o!==void 0));return w.size>0&&(t.colors=[...w]),t.observers=e.observerCount,e.instrument.category==="eye"&&(t.nakedEye=!0),e.soundTrack.allKeyframes.some(o=>o.sound.kind!=="none")&&(t.sound=!0),t}}class x{static FLAT={heightAt:()=>0};static facts(e,d,t,l){const{sunAltitudeDeg:s,durationSeconds:a,cloudCover:i,lightning:h,lowVisibility:u,observers:w,nakedEye:o}=d,p={sunAltitudeDeg:s,durationSeconds:a,cloudCover:i,lightning:h,lowVisibility:u,observers:w,nakedEye:o};for(const n of Object.keys(p))p[n]===void 0&&delete p[n];const r=n=>A.eyeOf(e,n,x.FLAT),c=t.filter(n=>(n.explains?.length??0)>0),M=(c.length>0?c:t).map(n=>new A(n,x.FLAT,r)),g=n=>{const f=r(n);return f?M.map(m=>m.at(n)).filter(m=>m!==void 0).map(m=>({state:m,...x.direction(f,m)})):[]},y=[...l].sort((n,f)=>n-f),D=y.map(n=>({t:n,seen:g(n)})).find(n=>n.seen.length>0);if(!D)return p;const z=D.seen[0];p.elevationDeg=z.altitudeDeg,p.widthDeg=z.widthDeg;const S=y.filter(n=>n>=D.t),I=(S.length>=2?x.densified(S):S).flatMap(n=>{const f=g(n).find(m=>m.state.id===z.state.id);return f?[{t:n,azimuthDeg:f.azimuthDeg,altitudeDeg:f.altitudeDeg}]:[]});Object.assign(p,v.of(I)),p.count=new Set(D.seen.map(n=>n.state.ensemble??n.state.id)).size;const b=new Set(D.seen.map(n=>n.state.appearance.color));return b.size>0&&(p.colors=[...b]),p}static rank(e,d,t){const l=new O(k.MODELS[0]).of(d).filter(u=>e.has(u.question)).map(u=>({...u,firm:!0})),s=e.rank(l),a=s.findIndex(u=>t.has(u.phenomenon)),i=s[a],h=i?s.filter(u=>u.excludedBy.length<i.excludedBy.length||u.excludedBy.length===i.excludedBy.length&&u.mean>i.mean+1e-9).length:0;return{...a>=0?{rank:h+1,tied:s.filter(u=>u!==i&&u.excludedBy.length===i.excludedBy.length&&Math.abs(u.mean-i.mean)<=1e-9).length}:{},of:s.length,...s[0]?{first:s[0].phenomenon}:{},excludedBy:a>=0?s[a].excludedBy:[],answers:l}}static direction(e,d){const t=d.eastM-e.eastM,l=d.northM-e.northM,s=d.upM-e.upM,a=Math.hypot(t,l),i=Math.max(1e-6,Math.hypot(a,s)),h=Math.max(d.sizeM.widthM??0,d.sizeM.lengthM??0,d.sizeM.heightM??0);return{azimuthDeg:(Math.atan2(t,l)*180/Math.PI+360)%360,altitudeDeg:Math.atan2(s,a)*180/Math.PI,widthDeg:2*Math.atan2(h/2,i)*180/Math.PI}}static densified(e){const d=e[0],t=e[e.length-1],l=Math.max(1e3,(t-d)/600),s=new Set(e);for(let a=d;a<t;a+=l)s.add(Math.round(a));return[...s].sort((a,i)=>a-i)}}export{Q as PoherAccountFacts,v as PoherMotion,x as PoherSelfCheck};
1
+ import{s as B,n as T,aT as A,W as k}from"./ShareDialogElement-DMDY7Hlo.js";import{b as P}from"./Sighting-C1yj2-s5.js";import{PoherAnswers as O}from"./PoherMatrix-C2fcLqDH.js";import"./rr0-ufoathome.mjs";import"./three.module-CbaHqYFq.js";import"./SaidPosition-OJEYhVKN.js";import"./GeoProjection-DvqDbRIx.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";import"./VisualAids-DI-hEL46.js";class v{static separation(e,d){const t=Math.PI/180,l=Math.sin(e.altitudeDeg*t)*Math.sin(d.altitudeDeg*t)+Math.cos(e.altitudeDeg*t)*Math.cos(d.altitudeDeg*t)*Math.cos((e.azimuthDeg-d.azimuthDeg)*t);return Math.acos(Math.max(-1,Math.min(1,l)))/t}static of(e){if(e.length<2)return{};const d=e.slice(1).map((i,h)=>({deg:v.separation(e[h],i),s:(i.t-e[h].t)/1e3})),t=v.separation(e[0],e[e.length-1]),l=d.reduce((i,h)=>i+h.deg,0),s={sweepDeg:t,straysDeg:Math.max(0,l-t)/2},a=(e[e.length-1].t-e[0].t)/1e3;if(a>0){s.speedDegPerS=l/a;const i=Math.max(...d.filter(h=>h.s>0).map(h=>h.deg/h.s));s.speedVariation=s.speedDegPerS>0?i/s.speedDegPerS:0}return s}}class Q{static of(e,d=0){const t={},l=e.event,s=l.place?.[0];if(s&&l.time?.year!==void 0&&l.time.hour!==void 0){const o=B(l.time,s.lng,l.utcOffsetHours);o&&(t.sunAltitudeDeg=T("Sun",o,{lat:s.lat,lng:s.lng,elevationM:d}).altitudeDeg)}if(l.durationSeconds!==void 0&&(t.durationSeconds=l.durationSeconds),e.weatherTrack.allKeyframes.length>0){const o=P(e,0);t.cloudCover=o.cloudCover,t.lightning=o.storm,t.lowVisibility=o.precipitationType!=="none"&&o.precipitationIntensity>.3}const a=e.timeline,i=a.sourceIds[0];if(i){const o=a.allKeyframes.filter(c=>c.shapes.some(M=>M.sourceId===i)),p=o.map(c=>({t:c.t,shape:a.getShapeAt(c.t,i)})).filter(c=>c.shape?.aim),r=a.getInterpolatedShapeAt(o[0]?.t??0,i);if(r?.aim&&(t.elevationDeg=r.aim.altitudeDeg),r?.angular){t.widthDeg=r.angular.widthDeg;const c=r.angular.heightDeg>0?r.angular.widthDeg/r.angular.heightDeg:1;t.round=r.kind==="oval"&&c>.8&&c<1.25}r?.brightness!==void 0&&(t.brightness=r.brightness),Object.assign(t,v.of(p.map(c=>({t:c.t,...c.shape.aim}))))}const h=new Set(a.sourceIds.map(o=>a.groupMembers(o)?.[0]??o));h.size>0&&(t.count=h.size);const u=[...h].map(o=>a.getInterpolatedShapeAt(0,o)?.aim).filter(o=>o!==void 0);if(u.length>=3){const o=Math.PI/180,p=u.map(g=>({x:(((g.azimuthDeg-u[0].azimuthDeg)%360+540)%360-180)*Math.cos(g.altitudeDeg*o),y:g.altitudeDeg}));let[r,c]=[p[0],p[1]];for(const g of p)for(const y of p)Math.hypot(g.x-y.x,g.y-y.y)>Math.hypot(r.x-c.x,r.y-c.y)&&([r,c]=[g,y]);const M=Math.hypot(r.x-c.x,r.y-c.y);t.aligned=M>0&&p.every(g=>Math.abs((c.x-r.x)*(r.y-g.y)-(r.x-g.x)*(c.y-r.y))/M<=Math.max(.5,M*.1))}const w=new Set([...h].map(o=>a.getInterpolatedShapeAt(0,o)?.color).filter(o=>o!==void 0));return w.size>0&&(t.colors=[...w]),t.observers=e.observerCount,e.instrument.category==="eye"&&(t.nakedEye=!0),e.soundTrack.allKeyframes.some(o=>o.sound.kind!=="none")&&(t.sound=!0),t}}class x{static FLAT={heightAt:()=>0};static facts(e,d,t,l){const{sunAltitudeDeg:s,durationSeconds:a,cloudCover:i,lightning:h,lowVisibility:u,observers:w,nakedEye:o}=d,p={sunAltitudeDeg:s,durationSeconds:a,cloudCover:i,lightning:h,lowVisibility:u,observers:w,nakedEye:o};for(const n of Object.keys(p))p[n]===void 0&&delete p[n];const r=n=>A.eyeOf(e,n,x.FLAT),c=t.filter(n=>(n.explains?.length??0)>0),M=(c.length>0?c:t).map(n=>new A(n,x.FLAT,r)),g=n=>{const f=r(n);return f?M.map(m=>m.at(n)).filter(m=>m!==void 0).map(m=>({state:m,...x.direction(f,m)})):[]},y=[...l].sort((n,f)=>n-f),D=y.map(n=>({t:n,seen:g(n)})).find(n=>n.seen.length>0);if(!D)return p;const z=D.seen[0];p.elevationDeg=z.altitudeDeg,p.widthDeg=z.widthDeg;const S=y.filter(n=>n>=D.t),I=(S.length>=2?x.densified(S):S).flatMap(n=>{const f=g(n).find(m=>m.state.id===z.state.id);return f?[{t:n,azimuthDeg:f.azimuthDeg,altitudeDeg:f.altitudeDeg}]:[]});Object.assign(p,v.of(I)),p.count=new Set(D.seen.map(n=>n.state.ensemble??n.state.id)).size;const b=new Set(D.seen.map(n=>n.state.appearance.color));return b.size>0&&(p.colors=[...b]),p}static rank(e,d,t){const l=new O(k.MODELS[0]).of(d).filter(u=>e.has(u.question)).map(u=>({...u,firm:!0})),s=e.rank(l),a=s.findIndex(u=>t.has(u.phenomenon)),i=s[a],h=i?s.filter(u=>u.excludedBy.length<i.excludedBy.length||u.excludedBy.length===i.excludedBy.length&&u.mean>i.mean+1e-9).length:0;return{...a>=0?{rank:h+1,tied:s.filter(u=>u!==i&&u.excludedBy.length===i.excludedBy.length&&Math.abs(u.mean-i.mean)<=1e-9).length}:{},of:s.length,...s[0]?{first:s[0].phenomenon}:{},excludedBy:a>=0?s[a].excludedBy:[],answers:l}}static direction(e,d){const t=d.eastM-e.eastM,l=d.northM-e.northM,s=d.upM-e.upM,a=Math.hypot(t,l),i=Math.max(1e-6,Math.hypot(a,s)),h=Math.max(d.sizeM.widthM??0,d.sizeM.lengthM??0,d.sizeM.heightM??0);return{azimuthDeg:(Math.atan2(t,l)*180/Math.PI+360)%360,altitudeDeg:Math.atan2(s,a)*180/Math.PI,widthDeg:2*Math.atan2(h/2,i)*180/Math.PI}}static densified(e){const d=e[0],t=e[e.length-1],l=Math.max(1e3,(t-d)/600),s=new Set(e);for(let a=d;a<t;a+=l)s.add(Math.round(a));return[...s].sort((a,i)=>a-i)}}export{Q as PoherAccountFacts,v as PoherMotion,x as PoherSelfCheck};
@@ -1,4 +1,4 @@
1
- import{M as w,_ as I,d as F}from"./rr0-ufoathome.mjs";import{P as S,I as x}from"./SaidPosition-OJEYhVKN.js";import{S as N}from"./SkyEventEditorStyle-CvY_AhbI.js";import{t as b,bn as M,aL as E,aF as C,n as _,s as P,bb as L}from"./ShareDialogElement-C0oFh0X4.js";import{c as G}from"./Sighting-BX_CmDY2.js";import{P as D,a as k,E as H}from"./ParameterForm-XbqxCLRn.js";import{T as K}from"./TimelineTracks-Daaqw9ly.js";import{R as O}from"./ReentryArchive-CeXHrU7L.js";import"./GeoProjection-DvqDbRIx.js";import"./three.module-CbaHqYFq.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";import"./VisualAids-DI-hEL46.js";const z=w.catalog({en:()=>I(()=>import("./ReentryParameterTexts_en-5BOfwCsS.js"),[],import.meta.url).then(v=>v.reentryParameterTexts_en),fr:()=>I(()=>import("./ReentryParameterTexts_fr-BgUJROXF.js"),[],import.meta.url).then(v=>v.reentryParameterTexts_fr),es:()=>I(()=>import("./ReentryParameterTexts_es-ze1-U4jB.js"),[],import.meta.url).then(v=>v.reentryParameterTexts_es),it:()=>I(()=>import("./ReentryParameterTexts_it-MTb9Vuq0.js"),[],import.meta.url).then(v=>v.reentryParameterTexts_it)});class g{static NAME="name";static OBJECT="object";static LIGHT="light";static WHEN="when";static SEEN="seenByTheWitness";static EARTH_KM=6371;static placeSeen(t,e,n,i){const r=Math.PI/180,o=g.EARTH_KM,a=n*r,s=-o*Math.sin(a)+Math.sqrt((o*Math.sin(a))**2+(o+i)**2-o**2),d=Math.atan2(s*Math.cos(a),o+s*Math.sin(a)),c=t.lat*r,l=e*r,h=Math.asin(Math.sin(c)*Math.cos(d)+Math.cos(c)*Math.sin(d)*Math.cos(l)),m=t.lng*r+Math.atan2(Math.sin(l)*Math.sin(d)*Math.cos(c),Math.cos(d)-Math.sin(c)*Math.sin(h));return{lat:h/r,lng:(m/r+540)%360-180}}static trackFromSeen(t,e){const n=t.seen,{fromAzimuthDeg:i,fromAltitudeDeg:r,toAzimuthDeg:o,toAltitudeDeg:a,durationS:s}=n??{};if(i===void 0||r===void 0||o===void 0||a===void 0||!s)return;const d=t.track[0],c=t.track[t.track.length-1],l=d?.t??0,h=d?.altitudeKm??100,m=c?.altitudeKm??h;return[{t:l,...g.placeSeen(e,i,r,h),altitudeKm:h},{t:l+Math.round(s*1e3),...g.placeSeen(e,o,a,m),altitudeKm:m}]}static placeAt(t,e){const n=b.leadAt(t,e);if(n)return{t:e,lat:n.lat,lng:n.lng,altitudeKm:n.heightM/1e3};const i=t.track,[r,o]=e<(i[0]?.t??0)?[i[0],i[1]]:[i[i.length-2],i[i.length-1]];if(!r||!o||o.t===r.t){const s=r??o??{lat:0,lng:0,altitudeKm:80};return{t:e,lat:s.lat,lng:s.lng,altitudeKm:s.altitudeKm}}const a=(e-r.t)/(o.t-r.t);return{t:e,lat:r.lat+(o.lat-r.lat)*a,lng:r.lng+(o.lng-r.lng)*a,altitudeKm:Math.max(0,r.altitudeKm+(o.altitudeKm-r.altitudeKm)*a)}}static curvePointAt(t,e){return{t:e,absoluteMagnitude:Math.round(b.absoluteMagnitudeAt(t,e)*10)/10}}static instantsOf(t){return[...t.track.map(e=>e.t),...t.fragments.flatMap(e=>[...e.fromT===void 0?[]:[e.fromT],...e.untilT===void 0?[]:[e.untilT],...(e.lightCurve??[]).map(n=>n.t)])]}static instant(t,e,n,i={}){return{type:"number",key:t,min:-3600,max:36e3,step:.1,unit:"s",scale:.001,label:e,hint:n,...i}}static mayBeCatalogued(t){return M.of(t.type)?.nature!=="natural"}static SET={kind:"reentry",title:"fireballOrReEntry",parameters:[{type:"said",key:"title",label:g.NAME},{type:"choice",key:"type",label:"type",hint:"whatCameInNaturalOrPut",empty:"notKnown",choices:[],optionsOf:t=>{const e=t.type,n=M.all().map(i=>({value:i.key,label:M.nameOf(i.key)}));return e===void 0||n.some(i=>i.value===e)?n:[...n,{value:e,label:e}]}},{type:"text",key:"object.name",group:g.OBJECT,visibleWhen:g.mayBeCatalogued,label:"catalogueName",hint:"forAReEntryThePiece"},{type:"text",key:"object.cosparId",group:g.OBJECT,visibleWhen:g.mayBeCatalogued,label:"cosparId",placeholder:"t1968013c"},{type:"number",key:"object.norad",min:1,max:999999,step:1,group:g.OBJECT,visibleWhen:g.mayBeCatalogued,label:"noradNumber"},{type:"number",key:"seen.fromAzimuthDeg",min:0,max:360,step:1,unit:"°",group:g.SEEN,label:"appearedAzimuth",hint:"fromTheNorthTowardsTheEast"},{type:"number",key:"seen.fromAltitudeDeg",min:-5,max:90,step:1,unit:"°",group:g.SEEN,label:"appearedHeight",hint:"aboveTheHorizon"},{type:"number",key:"seen.toAzimuthDeg",min:0,max:360,step:1,unit:"°",group:g.SEEN,label:"wentOutAzimuth",hint:"fromTheNorthTowardsTheEast"},{type:"number",key:"seen.toAltitudeDeg",min:-5,max:90,step:1,unit:"°",group:g.SEEN,label:"wentOutHeight",hint:"aboveTheHorizon"},{type:"number",key:"seen.durationS",min:.1,max:3600,step:.1,unit:"s",group:g.SEEN,label:"seenFor",hint:"allSaidThePathIsWorkedOut"}]};static PLACE={kind:"reentry-place",title:"pointOfThePath",parameters:[g.instant("t","time","secondsOfTheRecordingNegativeBefore",{required:!0}),{type:"position",key:"lat",secondKey:"lng",saidKey:"saidPosition",native:"geo",step:1,rangeM:2e6,label:"position"},{type:"number",key:"altitudeKm",min:0,max:300,step:.1,unit:"km",required:!0,label:"altitude",hint:"aboveTheEllipsoidAMeteorBegins"}]};static trackEnd(t,e){const n=t?.track;if(n?.length)return e==="first"?n[0].t:n[n.length-1].t}static FRAGMENT={kind:"reentry-fragment",title:"piece",parameters:[{type:"text",key:"id",label:"id",validate:(t,e,n)=>!n?.fragments.some(i=>i!==e&&i.id===t)},{type:"number",key:"absoluteMagnitude",min:-40,max:10,step:.1,required:!0,group:g.LIGHT,label:"absoluteMagnitude",hint:"itsBrightnessSeenFrom100Km"},{type:"colour",key:"color",group:g.LIGHT,fallback:b.DEFAULT_COLOR,label:"colour"},{type:"number",key:"trainS",min:0,max:600,step:.1,unit:"s",group:g.LIGHT,effective:()=>b.DEFAULT_TRAIN_S,label:"train",hint:"howLongAStretchOfIts"},{type:"number",key:"lagS",min:0,max:600,step:.1,unit:"s",group:g.WHEN,effective:()=>0,label:"behindTheLead",hint:"secondsBehindTheLeadingPointAlong"},g.instant("fromT","seenFrom","whenItBreaksOffOrBegins",{group:g.WHEN,effective:(t,e)=>g.trackEnd(e,"first")}),g.instant("untilT","outAt","whenItHasBurnedUpOr",{group:g.WHEN,effective:(t,e)=>g.trackEnd(e,"last")})]};static CURVE_POINT={kind:"reentry-curve-point",title:"pointOfTheLightCurve",parameters:[g.instant("t","time","secondsOfTheRecording",{required:!0}),{type:"number",key:"absoluteMagnitude",min:-40,max:10,step:.1,required:!0,label:"absoluteMagnitude"}]}}const $=w.catalog({en:()=>I(()=>import("./ReentryEditorMessages_en-BmTZMr-m.js"),[],import.meta.url).then(v=>v.reentryEditorMessages_en),fr:()=>I(()=>import("./ReentryEditorMessages_fr-DHbcY0tN.js"),[],import.meta.url).then(v=>v.reentryEditorMessages_fr),es:()=>I(()=>import("./ReentryEditorMessages_es-edid__Jo.js"),[],import.meta.url).then(v=>v.reentryEditorMessages_es),it:()=>I(()=>import("./ReentryEditorMessages_it-CIzkIU4G.js"),[],import.meta.url).then(v=>v.reentryEditorMessages_it)});class u{static TIME_MARGIN_MIN=6;static HEADING_MARGIN_DEG=45;static ELEVATION_LOW_FACTOR=.3;static ELEVATION_SLACK_DEG=5;static DURATION_FACTOR=3;static ARCHIVED_MAGNITUDE=-3;static WATCHED_KM=600;static WATCHED_COUNT=5;static NIGHT_SUN_DEG=-12;static SHOWER_MARGIN_DEG=20;static RADIANT_BELOW_DEG=-10;static FIRST_ORBIT_MS=Date.UTC(1957,9,4);static shared={fireballs:new E,reentries:new O};static viewOf(t,e,n){const i=t.track;if(i.length<2)return;const r=i[0],o=i[i.length-1],a=t.seen,s=m=>b.seenFrom(n,{lat:m.lat,lng:m.lng,heightM:m.altitudeKm*1e3}),d=a?.fromAzimuthDeg!==void 0&&a.fromAltitudeDeg!==void 0?{azimuthDeg:a.fromAzimuthDeg,altitudeDeg:a.fromAltitudeDeg}:s(r),c=a?.toAzimuthDeg!==void 0&&a.toAltitudeDeg!==void 0?{azimuthDeg:a.toAzimuthDeg,altitudeDeg:a.toAltitudeDeg}:s(o),l=a?.durationS??(o.t-r.t)/1e3,h=Math.min(...t.fragments.flatMap(m=>[m.absoluteMagnitude,...(m.lightCurve??[]).map(f=>f.absoluteMagnitude)]));return{startMs:e.getTime()+r.t,durationS:l,from:{azimuthDeg:d.azimuthDeg,altitudeDeg:d.altitudeDeg},to:{azimuthDeg:c.azimuthDeg,altitudeDeg:c.altitudeDeg},peakAbsoluteMagnitude:h}}static azimuthOff(t,e){const n=Math.abs(((t-e)%360+360)%360);return Math.min(n,360-n)}static elevationOff(t,e){const n=Math.max(0,t*u.ELEVATION_LOW_FACTOR)-u.ELEVATION_SLACK_DEG,i=t+u.ELEVATION_SLACK_DEG;return e<n?n-e:e>i?e-i:0}static matchFireball(t,e,n){const i=e.t<t.startMs?t.startMs-e.t:0,r=e.t>t.startMs?e.t-t.startMs:0;if(Math.max(i,r)>u.TIME_MARGIN_MIN*6e4)return;const o=b.seenFrom(n,{lat:e.from[0],lng:e.from[1],heightM:e.from[2]*1e3}),a=b.seenFrom(n,{lat:e.to[0],lng:e.to[1],heightM:e.to[2]*1e3});if(o.altitudeDeg<0&&a.altitudeDeg<0)return;const s=Math.max(u.azimuthOff(t.from.azimuthDeg,o.azimuthDeg),u.azimuthOff(t.to.azimuthDeg,a.azimuthDeg));if(s>u.HEADING_MARGIN_DEG||Math.max(u.elevationOff(t.from.altitudeDeg,o.altitudeDeg),u.elevationOff(t.to.altitudeDeg,a.altitudeDeg))>0)return;const c=u.DURATION_FACTOR;if(!(e.durationS>0&&(t.durationS<e.durationS/c||t.durationS>e.durationS*c)))return{record:e,offsetMinutes:Math.round((i+r)/6e4),headingOffDeg:Math.round(s),altitudeOffDeg:Math.round(Math.abs(a.altitudeDeg-t.to.altitudeDeg))}}static async check(t,e,n,i=u.shared){if(!e||!n)return[{verdict:"unchecked",source:"none",reason:"noDateOrPlace"}];const r=u.viewOf(t,e,n);if(!r)return[{verdict:"unchecked",source:"none",reason:"noDateOrPlace"}];const o=M.of(t.type)?.nature,a=[];if(o!=="artificial"&&a.push(...await u.checkFireballs(r,n,o==="natural",i)),o!=="artificial"){const s=u.showerOf(r,n);s&&(s.verdict==="compatible"||o==="natural")&&a.push(s)}return o!=="natural"&&a.push(...await u.checkCatalogue(t,r,n,o==="artificial",i)),o===void 0&&!a.some(s=>s.verdict==="known"||s.verdict==="possible"||s.verdict==="compatible")?[...a.filter(s=>s.verdict==="unchecked"),{verdict:"uninformative",source:"none",reason:"typeUnknown"}]:a}static vectorOf(t,e){const n=Math.PI/180,i=e*n,r=t*n;return[Math.cos(i)*Math.sin(r),Math.cos(i)*Math.cos(r),Math.sin(i)]}static angleDeg(t,e){return Math.acos(Math.max(-1,Math.min(1,t[0]*e[0]+t[1]*e[1]+t[2]*e[2])))*180/Math.PI}static showerOf(t,e){const n=u.vectorOf(t.from.azimuthDeg,t.from.altitudeDeg),i=u.vectorOf(t.to.azimuthDeg,t.to.altitudeDeg),r=u.angleDeg(n,i);if(r<1)return;const o=[n[1]*i[2]-n[2]*i[1],n[2]*i[0]-n[0]*i[2],n[0]*i[1]-n[1]*i[0]],a=Math.hypot(o[0],o[1],o[2]),s=new Date(t.startMs),d=C.activeAt(s);let c;for(const{shower:l,zhr:h}of d){const m=C.radiantPosition(l,s,{lat:e.lat,lng:e.lng,elevationM:e.heightM});if(m.altitudeDeg<u.RADIANT_BELOW_DEG)continue;const f=u.vectorOf(m.azimuthDeg,m.altitudeDeg),p=Math.asin(Math.min(1,Math.abs((f[0]*o[0]+f[1]*o[1]+f[2]*o[2])/a)))*180/Math.PI,y=u.angleDeg(f,n),A=u.angleDeg(f,i);y>=A||A<=r||p<=u.SHOWER_MARGIN_DEG&&(!c||p<c.offDeg)&&(c={showerId:l.id,offDeg:Math.round(p),zhr:Math.round(h)})}return c?{verdict:"compatible",source:"showers",...c}:{verdict:"sporadic",source:"showers",active:d.length}}static async checkFireballs(t,e,n,i){const r=u.TIME_MARGIN_MIN*6e4;if(!E.mayCover(t.startMs))return n?[{verdict:"uninformative",source:"gmn",reason:"beforeArchive"}]:[];const o=await i.fireballs.between(t.startMs-r,t.startMs+r+t.durationS*1e3);if(o===void 0)return n?[{verdict:"unchecked",source:"gmn",reason:"unreachable"}]:[];const a=o.map(m=>u.matchFireball(t,m,e)).filter(m=>m!==void 0).sort((m,f)=>m.offsetMinutes-f.offsetMinutes||m.headingOffDeg-f.headingOffDeg);if(a.length>0)return[{verdict:"known",source:"gmn",match:a[0]}];if(!n)return[];if(t.peakAbsoluteMagnitude>u.ARCHIVED_MAGNITUDE)return[{verdict:"uninformative",source:"gmn",reason:"faint"}];if(_("Sun",new Date(t.startMs),{lat:e.lat,lng:e.lng,elevationM:0}).altitudeDeg>u.NIGHT_SUN_DEG)return[{verdict:"uninformative",source:"gmn",reason:"daylight"}];const s=new Date(t.startMs),d=Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),1),c=Date.UTC(s.getUTCFullYear(),s.getUTCMonth()+1,1)-1,h=(await i.fireballs.between(d,c)??[]).filter(m=>O.distanceKm(e.lat,e.lng,m.from[0],m.from[1])<=u.WATCHED_KM).length;return h<u.WATCHED_COUNT?[{verdict:"uninformative",source:"gmn",reason:"unwatched"}]:[{verdict:"expectedAbsent",source:"gmn",absoluteMagnitude:t.peakAbsoluteMagnitude,watchedCount:h}]}static async checkCatalogue(t,e,n,i,r){if(e.startMs<u.FIRST_ORBIT_MS)return i?[{verdict:"impossible",source:"catalogue"}]:[];const o=u.TIME_MARGIN_MIN*6e4,a=await r.reentries.candidates(e.startMs-o,e.startMs+o+e.durationS*1e3,n);if(a===void 0)return i?[{verdict:"unchecked",source:"catalogue",reason:"unreachable"}]:[];const s=t.object,d=s&&a.find(l=>s.cosparId&&l.record.cosparId===s.cosparId||s.norad!==void 0&&l.record.norad===s.norad);if(d)return[{verdict:"known",source:"catalogue",candidate:d,by:"object"}];const c=a.find(l=>l.record.precision==="minute"&&l.seenKm!==void 0&&(l.offsetMinutes??0)<=u.TIME_MARGIN_MIN);return c?[{verdict:"known",source:"catalogue",candidate:c,by:"seen"}]:a.length>0?a.slice(0,3).map(l=>({verdict:"possible",source:"catalogue",candidate:l})):i?[{verdict:"expectedAbsent",source:"catalogue"}]:[]}}class T{constructor(t,e,n){this.container=t,this.host=e,N.attach(t,"reentry-editor-part",T.STYLE),this.language=n,this.ready=this.setLanguage(n)}messages;ready;parameterTexts;languageToken=0;currentId;form;list;timeline;placeForm;placeIndex=0;row="path";fragmentForm;fragmentIndex=0;curveForm;curveIndex=0;language;shown=[];static STYLE='.reentry-editor-part { flex-basis: 100%; min-width: 0; } .reentry-editor-part #reentry-timeline { flex-basis: 100%; min-width: 0; padding: 4px 0; } .reentry-editor-part #reentry-path > .icon-btn, .reentry-editor-part #reentry-curve > .icon-btn { align-self: flex-end; } .reentry-editor-part #reentry-list, .reentry-editor-part #reentry-places, .reentry-editor-part #reentry-fragment-list, .reentry-editor-part #reentry-curve-list { flex-basis: 100%; min-width: 0; } .reentry-editor-part .launch-editor, .reentry-editor-part .launch-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; } .reentry-editor-part .launch-fields { flex-basis: 100%; min-width: 0; } .reentry-editor-part [hidden] { display: none !important; } .reentry-editor-part .reentry-evidence { flex-basis: 100%; } .reentry-editor-part .evidence-known, .reentry-editor-part .evidence-impossible, .reentry-editor-part .evidence-expectedAbsent { font-weight: 600; } .reentry-editor-part select { min-width: 0; width: 100%; } .reentry-editor-part .launch-intro { flex-basis: 100%; margin: 0; } .reentry-editor-part .launch-track { flex-basis: 100%; margin: 0; } .reentry-editor-part .launch-parameters { flex-basis: 100%; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; } .reentry-editor-part .parameter-group { flex: 1 1 14em; min-width: 0; box-sizing: border-box; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-start; align-content: flex-start; } .reentry-editor-part input, .reentry-editor-part select { max-width: 100%; box-sizing: border-box; } .reentry-editor-part input[type="text"] { width: 12em; } .reentry-editor-part input[data-key="title"] { width: 18em; } .reentry-editor-part label { min-width: 0; max-width: 100%; } .reentry-editor-part input.parameter-derived::placeholder { opacity: .65; } .reentry-editor-part .launch-path { flex: 1 1 100%; min-width: 0; box-sizing: border-box; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-start; }';async setLanguage(t){const e=++this.languageToken;this.language=t;const[n,i,,r]=await Promise.all([$.load(t),z.load(t),M.load(t),F(t).catch(()=>{})]);e===this.languageToken&&(this.sceneNames=r,this.messages=n,this.parameterTexts=i,this.render(),this.sync())}sync(){if(!this.messages)return;const t=this.reentries;this.shown=[...t],t.some(n=>n.id===this.currentId)||(this.currentId=t[0]?.id),this.list?.setItems(t.map(n=>({id:n.id,label:this.labelOf(n)})),this.currentId),this.list?.setKinds(M.all().map(n=>({value:n.key,label:M.nameOf(n.key)}))),this.syncAddState();const e=this.current;this.element("reentry-fields").hidden=e===void 0,e&&(this.syncPlace(!0),this.syncFragments(e,!0),this.syncEvidence(),this.form??=new D(this.element("reentry-parameters"),this.language,"reentry.",{said:()=>this.host.said(),writingLanguage:()=>this.host.writingLanguage()}),this.form.show(this.resolved(g.SET),new k(()=>this.current,n=>this.editReentry(i=>{i.object&&(i.object={...i.object}),i.seen&&(i.seen={...i.seen}),n(i),i.object&&Object.values(i.object).every(a=>a===void 0||a==="")&&delete i.object;const r=this.origin(),o=r&&g.trackFromSeen(i,r);o&&(i.track=o)})),()=>this.written()))}refresh(){if(!this.messages)return;this.syncAddState();const t=this.reentries;if(t.length===this.shown.length&&t.every((e,n)=>e.id===this.shown[n].id)){this.syncTimeline();return}this.sync()}setTime(t){this.messages&&this.timeline?.setTime(t)}syncAddState(){const t=this.origin()!==void 0;this.list?.setAddState(t,t?void 0:this.messages.addNowhere)}get current(){return this.reentries.find(t=>t.id===this.currentId)}show(t){this.messages&&(this.currentId=t,this.row="path",this.placeIndex=0,this.fragmentIndex=0,this.curveIndex=0,this.sync())}resolved(t){return S.resolve(t,this.parameterTexts)}render(){if(!this.messages)return;const t=this.messages;this.form=void 0,this.evidenceFor=void 0,this.container.innerHTML=`<div class="launch-editor">
1
+ import{M as w,_ as I,d as F}from"./rr0-ufoathome.mjs";import{P as S,I as x}from"./SaidPosition-OJEYhVKN.js";import{S as N}from"./SkyEventEditorStyle-CvY_AhbI.js";import{t as b,bn as M,aL as E,aF as C,n as _,s as P,bb as L}from"./ShareDialogElement-DMDY7Hlo.js";import{c as G}from"./Sighting-C1yj2-s5.js";import{P as D,a as k,E as H}from"./ParameterForm-XbqxCLRn.js";import{T as K}from"./TimelineTracks-Daaqw9ly.js";import{R as O}from"./ReentryArchive-CeXHrU7L.js";import"./GeoProjection-DvqDbRIx.js";import"./three.module-CbaHqYFq.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";import"./VisualAids-DI-hEL46.js";const z=w.catalog({en:()=>I(()=>import("./ReentryParameterTexts_en-5BOfwCsS.js"),[],import.meta.url).then(v=>v.reentryParameterTexts_en),fr:()=>I(()=>import("./ReentryParameterTexts_fr-BgUJROXF.js"),[],import.meta.url).then(v=>v.reentryParameterTexts_fr),es:()=>I(()=>import("./ReentryParameterTexts_es-ze1-U4jB.js"),[],import.meta.url).then(v=>v.reentryParameterTexts_es),it:()=>I(()=>import("./ReentryParameterTexts_it-MTb9Vuq0.js"),[],import.meta.url).then(v=>v.reentryParameterTexts_it)});class g{static NAME="name";static OBJECT="object";static LIGHT="light";static WHEN="when";static SEEN="seenByTheWitness";static EARTH_KM=6371;static placeSeen(t,e,n,i){const r=Math.PI/180,o=g.EARTH_KM,a=n*r,s=-o*Math.sin(a)+Math.sqrt((o*Math.sin(a))**2+(o+i)**2-o**2),d=Math.atan2(s*Math.cos(a),o+s*Math.sin(a)),c=t.lat*r,l=e*r,h=Math.asin(Math.sin(c)*Math.cos(d)+Math.cos(c)*Math.sin(d)*Math.cos(l)),m=t.lng*r+Math.atan2(Math.sin(l)*Math.sin(d)*Math.cos(c),Math.cos(d)-Math.sin(c)*Math.sin(h));return{lat:h/r,lng:(m/r+540)%360-180}}static trackFromSeen(t,e){const n=t.seen,{fromAzimuthDeg:i,fromAltitudeDeg:r,toAzimuthDeg:o,toAltitudeDeg:a,durationS:s}=n??{};if(i===void 0||r===void 0||o===void 0||a===void 0||!s)return;const d=t.track[0],c=t.track[t.track.length-1],l=d?.t??0,h=d?.altitudeKm??100,m=c?.altitudeKm??h;return[{t:l,...g.placeSeen(e,i,r,h),altitudeKm:h},{t:l+Math.round(s*1e3),...g.placeSeen(e,o,a,m),altitudeKm:m}]}static placeAt(t,e){const n=b.leadAt(t,e);if(n)return{t:e,lat:n.lat,lng:n.lng,altitudeKm:n.heightM/1e3};const i=t.track,[r,o]=e<(i[0]?.t??0)?[i[0],i[1]]:[i[i.length-2],i[i.length-1]];if(!r||!o||o.t===r.t){const s=r??o??{lat:0,lng:0,altitudeKm:80};return{t:e,lat:s.lat,lng:s.lng,altitudeKm:s.altitudeKm}}const a=(e-r.t)/(o.t-r.t);return{t:e,lat:r.lat+(o.lat-r.lat)*a,lng:r.lng+(o.lng-r.lng)*a,altitudeKm:Math.max(0,r.altitudeKm+(o.altitudeKm-r.altitudeKm)*a)}}static curvePointAt(t,e){return{t:e,absoluteMagnitude:Math.round(b.absoluteMagnitudeAt(t,e)*10)/10}}static instantsOf(t){return[...t.track.map(e=>e.t),...t.fragments.flatMap(e=>[...e.fromT===void 0?[]:[e.fromT],...e.untilT===void 0?[]:[e.untilT],...(e.lightCurve??[]).map(n=>n.t)])]}static instant(t,e,n,i={}){return{type:"number",key:t,min:-3600,max:36e3,step:.1,unit:"s",scale:.001,label:e,hint:n,...i}}static mayBeCatalogued(t){return M.of(t.type)?.nature!=="natural"}static SET={kind:"reentry",title:"fireballOrReEntry",parameters:[{type:"said",key:"title",label:g.NAME},{type:"choice",key:"type",label:"type",hint:"whatCameInNaturalOrPut",empty:"notKnown",choices:[],optionsOf:t=>{const e=t.type,n=M.all().map(i=>({value:i.key,label:M.nameOf(i.key)}));return e===void 0||n.some(i=>i.value===e)?n:[...n,{value:e,label:e}]}},{type:"text",key:"object.name",group:g.OBJECT,visibleWhen:g.mayBeCatalogued,label:"catalogueName",hint:"forAReEntryThePiece"},{type:"text",key:"object.cosparId",group:g.OBJECT,visibleWhen:g.mayBeCatalogued,label:"cosparId",placeholder:"t1968013c"},{type:"number",key:"object.norad",min:1,max:999999,step:1,group:g.OBJECT,visibleWhen:g.mayBeCatalogued,label:"noradNumber"},{type:"number",key:"seen.fromAzimuthDeg",min:0,max:360,step:1,unit:"°",group:g.SEEN,label:"appearedAzimuth",hint:"fromTheNorthTowardsTheEast"},{type:"number",key:"seen.fromAltitudeDeg",min:-5,max:90,step:1,unit:"°",group:g.SEEN,label:"appearedHeight",hint:"aboveTheHorizon"},{type:"number",key:"seen.toAzimuthDeg",min:0,max:360,step:1,unit:"°",group:g.SEEN,label:"wentOutAzimuth",hint:"fromTheNorthTowardsTheEast"},{type:"number",key:"seen.toAltitudeDeg",min:-5,max:90,step:1,unit:"°",group:g.SEEN,label:"wentOutHeight",hint:"aboveTheHorizon"},{type:"number",key:"seen.durationS",min:.1,max:3600,step:.1,unit:"s",group:g.SEEN,label:"seenFor",hint:"allSaidThePathIsWorkedOut"}]};static PLACE={kind:"reentry-place",title:"pointOfThePath",parameters:[g.instant("t","time","secondsOfTheRecordingNegativeBefore",{required:!0}),{type:"position",key:"lat",secondKey:"lng",saidKey:"saidPosition",native:"geo",step:1,rangeM:2e6,label:"position"},{type:"number",key:"altitudeKm",min:0,max:300,step:.1,unit:"km",required:!0,label:"altitude",hint:"aboveTheEllipsoidAMeteorBegins"}]};static trackEnd(t,e){const n=t?.track;if(n?.length)return e==="first"?n[0].t:n[n.length-1].t}static FRAGMENT={kind:"reentry-fragment",title:"piece",parameters:[{type:"text",key:"id",label:"id",validate:(t,e,n)=>!n?.fragments.some(i=>i!==e&&i.id===t)},{type:"number",key:"absoluteMagnitude",min:-40,max:10,step:.1,required:!0,group:g.LIGHT,label:"absoluteMagnitude",hint:"itsBrightnessSeenFrom100Km"},{type:"colour",key:"color",group:g.LIGHT,fallback:b.DEFAULT_COLOR,label:"colour"},{type:"number",key:"trainS",min:0,max:600,step:.1,unit:"s",group:g.LIGHT,effective:()=>b.DEFAULT_TRAIN_S,label:"train",hint:"howLongAStretchOfIts"},{type:"number",key:"lagS",min:0,max:600,step:.1,unit:"s",group:g.WHEN,effective:()=>0,label:"behindTheLead",hint:"secondsBehindTheLeadingPointAlong"},g.instant("fromT","seenFrom","whenItBreaksOffOrBegins",{group:g.WHEN,effective:(t,e)=>g.trackEnd(e,"first")}),g.instant("untilT","outAt","whenItHasBurnedUpOr",{group:g.WHEN,effective:(t,e)=>g.trackEnd(e,"last")})]};static CURVE_POINT={kind:"reentry-curve-point",title:"pointOfTheLightCurve",parameters:[g.instant("t","time","secondsOfTheRecording",{required:!0}),{type:"number",key:"absoluteMagnitude",min:-40,max:10,step:.1,required:!0,label:"absoluteMagnitude"}]}}const $=w.catalog({en:()=>I(()=>import("./ReentryEditorMessages_en-BmTZMr-m.js"),[],import.meta.url).then(v=>v.reentryEditorMessages_en),fr:()=>I(()=>import("./ReentryEditorMessages_fr-DHbcY0tN.js"),[],import.meta.url).then(v=>v.reentryEditorMessages_fr),es:()=>I(()=>import("./ReentryEditorMessages_es-edid__Jo.js"),[],import.meta.url).then(v=>v.reentryEditorMessages_es),it:()=>I(()=>import("./ReentryEditorMessages_it-CIzkIU4G.js"),[],import.meta.url).then(v=>v.reentryEditorMessages_it)});class u{static TIME_MARGIN_MIN=6;static HEADING_MARGIN_DEG=45;static ELEVATION_LOW_FACTOR=.3;static ELEVATION_SLACK_DEG=5;static DURATION_FACTOR=3;static ARCHIVED_MAGNITUDE=-3;static WATCHED_KM=600;static WATCHED_COUNT=5;static NIGHT_SUN_DEG=-12;static SHOWER_MARGIN_DEG=20;static RADIANT_BELOW_DEG=-10;static FIRST_ORBIT_MS=Date.UTC(1957,9,4);static shared={fireballs:new E,reentries:new O};static viewOf(t,e,n){const i=t.track;if(i.length<2)return;const r=i[0],o=i[i.length-1],a=t.seen,s=m=>b.seenFrom(n,{lat:m.lat,lng:m.lng,heightM:m.altitudeKm*1e3}),d=a?.fromAzimuthDeg!==void 0&&a.fromAltitudeDeg!==void 0?{azimuthDeg:a.fromAzimuthDeg,altitudeDeg:a.fromAltitudeDeg}:s(r),c=a?.toAzimuthDeg!==void 0&&a.toAltitudeDeg!==void 0?{azimuthDeg:a.toAzimuthDeg,altitudeDeg:a.toAltitudeDeg}:s(o),l=a?.durationS??(o.t-r.t)/1e3,h=Math.min(...t.fragments.flatMap(m=>[m.absoluteMagnitude,...(m.lightCurve??[]).map(f=>f.absoluteMagnitude)]));return{startMs:e.getTime()+r.t,durationS:l,from:{azimuthDeg:d.azimuthDeg,altitudeDeg:d.altitudeDeg},to:{azimuthDeg:c.azimuthDeg,altitudeDeg:c.altitudeDeg},peakAbsoluteMagnitude:h}}static azimuthOff(t,e){const n=Math.abs(((t-e)%360+360)%360);return Math.min(n,360-n)}static elevationOff(t,e){const n=Math.max(0,t*u.ELEVATION_LOW_FACTOR)-u.ELEVATION_SLACK_DEG,i=t+u.ELEVATION_SLACK_DEG;return e<n?n-e:e>i?e-i:0}static matchFireball(t,e,n){const i=e.t<t.startMs?t.startMs-e.t:0,r=e.t>t.startMs?e.t-t.startMs:0;if(Math.max(i,r)>u.TIME_MARGIN_MIN*6e4)return;const o=b.seenFrom(n,{lat:e.from[0],lng:e.from[1],heightM:e.from[2]*1e3}),a=b.seenFrom(n,{lat:e.to[0],lng:e.to[1],heightM:e.to[2]*1e3});if(o.altitudeDeg<0&&a.altitudeDeg<0)return;const s=Math.max(u.azimuthOff(t.from.azimuthDeg,o.azimuthDeg),u.azimuthOff(t.to.azimuthDeg,a.azimuthDeg));if(s>u.HEADING_MARGIN_DEG||Math.max(u.elevationOff(t.from.altitudeDeg,o.altitudeDeg),u.elevationOff(t.to.altitudeDeg,a.altitudeDeg))>0)return;const c=u.DURATION_FACTOR;if(!(e.durationS>0&&(t.durationS<e.durationS/c||t.durationS>e.durationS*c)))return{record:e,offsetMinutes:Math.round((i+r)/6e4),headingOffDeg:Math.round(s),altitudeOffDeg:Math.round(Math.abs(a.altitudeDeg-t.to.altitudeDeg))}}static async check(t,e,n,i=u.shared){if(!e||!n)return[{verdict:"unchecked",source:"none",reason:"noDateOrPlace"}];const r=u.viewOf(t,e,n);if(!r)return[{verdict:"unchecked",source:"none",reason:"noDateOrPlace"}];const o=M.of(t.type)?.nature,a=[];if(o!=="artificial"&&a.push(...await u.checkFireballs(r,n,o==="natural",i)),o!=="artificial"){const s=u.showerOf(r,n);s&&(s.verdict==="compatible"||o==="natural")&&a.push(s)}return o!=="natural"&&a.push(...await u.checkCatalogue(t,r,n,o==="artificial",i)),o===void 0&&!a.some(s=>s.verdict==="known"||s.verdict==="possible"||s.verdict==="compatible")?[...a.filter(s=>s.verdict==="unchecked"),{verdict:"uninformative",source:"none",reason:"typeUnknown"}]:a}static vectorOf(t,e){const n=Math.PI/180,i=e*n,r=t*n;return[Math.cos(i)*Math.sin(r),Math.cos(i)*Math.cos(r),Math.sin(i)]}static angleDeg(t,e){return Math.acos(Math.max(-1,Math.min(1,t[0]*e[0]+t[1]*e[1]+t[2]*e[2])))*180/Math.PI}static showerOf(t,e){const n=u.vectorOf(t.from.azimuthDeg,t.from.altitudeDeg),i=u.vectorOf(t.to.azimuthDeg,t.to.altitudeDeg),r=u.angleDeg(n,i);if(r<1)return;const o=[n[1]*i[2]-n[2]*i[1],n[2]*i[0]-n[0]*i[2],n[0]*i[1]-n[1]*i[0]],a=Math.hypot(o[0],o[1],o[2]),s=new Date(t.startMs),d=C.activeAt(s);let c;for(const{shower:l,zhr:h}of d){const m=C.radiantPosition(l,s,{lat:e.lat,lng:e.lng,elevationM:e.heightM});if(m.altitudeDeg<u.RADIANT_BELOW_DEG)continue;const f=u.vectorOf(m.azimuthDeg,m.altitudeDeg),p=Math.asin(Math.min(1,Math.abs((f[0]*o[0]+f[1]*o[1]+f[2]*o[2])/a)))*180/Math.PI,y=u.angleDeg(f,n),A=u.angleDeg(f,i);y>=A||A<=r||p<=u.SHOWER_MARGIN_DEG&&(!c||p<c.offDeg)&&(c={showerId:l.id,offDeg:Math.round(p),zhr:Math.round(h)})}return c?{verdict:"compatible",source:"showers",...c}:{verdict:"sporadic",source:"showers",active:d.length}}static async checkFireballs(t,e,n,i){const r=u.TIME_MARGIN_MIN*6e4;if(!E.mayCover(t.startMs))return n?[{verdict:"uninformative",source:"gmn",reason:"beforeArchive"}]:[];const o=await i.fireballs.between(t.startMs-r,t.startMs+r+t.durationS*1e3);if(o===void 0)return n?[{verdict:"unchecked",source:"gmn",reason:"unreachable"}]:[];const a=o.map(m=>u.matchFireball(t,m,e)).filter(m=>m!==void 0).sort((m,f)=>m.offsetMinutes-f.offsetMinutes||m.headingOffDeg-f.headingOffDeg);if(a.length>0)return[{verdict:"known",source:"gmn",match:a[0]}];if(!n)return[];if(t.peakAbsoluteMagnitude>u.ARCHIVED_MAGNITUDE)return[{verdict:"uninformative",source:"gmn",reason:"faint"}];if(_("Sun",new Date(t.startMs),{lat:e.lat,lng:e.lng,elevationM:0}).altitudeDeg>u.NIGHT_SUN_DEG)return[{verdict:"uninformative",source:"gmn",reason:"daylight"}];const s=new Date(t.startMs),d=Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),1),c=Date.UTC(s.getUTCFullYear(),s.getUTCMonth()+1,1)-1,h=(await i.fireballs.between(d,c)??[]).filter(m=>O.distanceKm(e.lat,e.lng,m.from[0],m.from[1])<=u.WATCHED_KM).length;return h<u.WATCHED_COUNT?[{verdict:"uninformative",source:"gmn",reason:"unwatched"}]:[{verdict:"expectedAbsent",source:"gmn",absoluteMagnitude:t.peakAbsoluteMagnitude,watchedCount:h}]}static async checkCatalogue(t,e,n,i,r){if(e.startMs<u.FIRST_ORBIT_MS)return i?[{verdict:"impossible",source:"catalogue"}]:[];const o=u.TIME_MARGIN_MIN*6e4,a=await r.reentries.candidates(e.startMs-o,e.startMs+o+e.durationS*1e3,n);if(a===void 0)return i?[{verdict:"unchecked",source:"catalogue",reason:"unreachable"}]:[];const s=t.object,d=s&&a.find(l=>s.cosparId&&l.record.cosparId===s.cosparId||s.norad!==void 0&&l.record.norad===s.norad);if(d)return[{verdict:"known",source:"catalogue",candidate:d,by:"object"}];const c=a.find(l=>l.record.precision==="minute"&&l.seenKm!==void 0&&(l.offsetMinutes??0)<=u.TIME_MARGIN_MIN);return c?[{verdict:"known",source:"catalogue",candidate:c,by:"seen"}]:a.length>0?a.slice(0,3).map(l=>({verdict:"possible",source:"catalogue",candidate:l})):i?[{verdict:"expectedAbsent",source:"catalogue"}]:[]}}class T{constructor(t,e,n){this.container=t,this.host=e,N.attach(t,"reentry-editor-part",T.STYLE),this.language=n,this.ready=this.setLanguage(n)}messages;ready;parameterTexts;languageToken=0;currentId;form;list;timeline;placeForm;placeIndex=0;row="path";fragmentForm;fragmentIndex=0;curveForm;curveIndex=0;language;shown=[];static STYLE='.reentry-editor-part { flex-basis: 100%; min-width: 0; } .reentry-editor-part #reentry-timeline { flex-basis: 100%; min-width: 0; padding: 4px 0; } .reentry-editor-part #reentry-path > .icon-btn, .reentry-editor-part #reentry-curve > .icon-btn { align-self: flex-end; } .reentry-editor-part #reentry-list, .reentry-editor-part #reentry-places, .reentry-editor-part #reentry-fragment-list, .reentry-editor-part #reentry-curve-list { flex-basis: 100%; min-width: 0; } .reentry-editor-part .launch-editor, .reentry-editor-part .launch-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; } .reentry-editor-part .launch-fields { flex-basis: 100%; min-width: 0; } .reentry-editor-part [hidden] { display: none !important; } .reentry-editor-part .reentry-evidence { flex-basis: 100%; } .reentry-editor-part .evidence-known, .reentry-editor-part .evidence-impossible, .reentry-editor-part .evidence-expectedAbsent { font-weight: 600; } .reentry-editor-part select { min-width: 0; width: 100%; } .reentry-editor-part .launch-intro { flex-basis: 100%; margin: 0; } .reentry-editor-part .launch-track { flex-basis: 100%; margin: 0; } .reentry-editor-part .launch-parameters { flex-basis: 100%; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; } .reentry-editor-part .parameter-group { flex: 1 1 14em; min-width: 0; box-sizing: border-box; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-start; align-content: flex-start; } .reentry-editor-part input, .reentry-editor-part select { max-width: 100%; box-sizing: border-box; } .reentry-editor-part input[type="text"] { width: 12em; } .reentry-editor-part input[data-key="title"] { width: 18em; } .reentry-editor-part label { min-width: 0; max-width: 100%; } .reentry-editor-part input.parameter-derived::placeholder { opacity: .65; } .reentry-editor-part .launch-path { flex: 1 1 100%; min-width: 0; box-sizing: border-box; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-start; }';async setLanguage(t){const e=++this.languageToken;this.language=t;const[n,i,,r]=await Promise.all([$.load(t),z.load(t),M.load(t),F(t).catch(()=>{})]);e===this.languageToken&&(this.sceneNames=r,this.messages=n,this.parameterTexts=i,this.render(),this.sync())}sync(){if(!this.messages)return;const t=this.reentries;this.shown=[...t],t.some(n=>n.id===this.currentId)||(this.currentId=t[0]?.id),this.list?.setItems(t.map(n=>({id:n.id,label:this.labelOf(n)})),this.currentId),this.list?.setKinds(M.all().map(n=>({value:n.key,label:M.nameOf(n.key)}))),this.syncAddState();const e=this.current;this.element("reentry-fields").hidden=e===void 0,e&&(this.syncPlace(!0),this.syncFragments(e,!0),this.syncEvidence(),this.form??=new D(this.element("reentry-parameters"),this.language,"reentry.",{said:()=>this.host.said(),writingLanguage:()=>this.host.writingLanguage()}),this.form.show(this.resolved(g.SET),new k(()=>this.current,n=>this.editReentry(i=>{i.object&&(i.object={...i.object}),i.seen&&(i.seen={...i.seen}),n(i),i.object&&Object.values(i.object).every(a=>a===void 0||a==="")&&delete i.object;const r=this.origin(),o=r&&g.trackFromSeen(i,r);o&&(i.track=o)})),()=>this.written()))}refresh(){if(!this.messages)return;this.syncAddState();const t=this.reentries;if(t.length===this.shown.length&&t.every((e,n)=>e.id===this.shown[n].id)){this.syncTimeline();return}this.sync()}setTime(t){this.messages&&this.timeline?.setTime(t)}syncAddState(){const t=this.origin()!==void 0;this.list?.setAddState(t,t?void 0:this.messages.addNowhere)}get current(){return this.reentries.find(t=>t.id===this.currentId)}show(t){this.messages&&(this.currentId=t,this.row="path",this.placeIndex=0,this.fragmentIndex=0,this.curveIndex=0,this.sync())}resolved(t){return S.resolve(t,this.parameterTexts)}render(){if(!this.messages)return;const t=this.messages;this.form=void 0,this.evidenceFor=void 0,this.container.innerHTML=`<div class="launch-editor">
2
2
  <p class="launch-intro">${t.intro}</p>
3
3
  <div id="reentry-list"></div>
4
4
  <div id="reentry-fields" class="launch-fields">
@@ -1 +1 @@
1
- import{bi as S,bj as f,bc as R,bd as w,bk as G,bl as _,bm as F,t as N}from"./ShareDialogElement-C0oFh0X4.js";import{I as y,J as H,w as M,x as I,M as C,V as j,C as k}from"./three.module-CbaHqYFq.js";import"./rr0-ufoathome.mjs";import"./Sighting-BX_CmDY2.js";import"./VisualAids-DI-hEL46.js";import"./SaidPosition-OJEYhVKN.js";import"./GeoProjection-DvqDbRIx.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";class h{static RADIUS=840;static MAX_SEGMENTS=1024;static VERTICES_PER_SEGMENT=12;static MIN_HALF_WIDTH_DEG=.1;static BRIGHT_HALF_WIDTH_DEG=.22;static TRAIN_SHARE=.9;static TRAIN_FALLOFF=1.2;object=new y;tiers;trains;positions;colors;shown=0;drawn=[];constructor(){this.object.name="reentries",this.tiers=S.map(i=>{const o=new H(new M,f.material(i.size,!1));return f.track(o),o.frustumCulled=!1,this.object.add(o),o});const s=h.MAX_SEGMENTS*h.VERTICES_PER_SEGMENT;this.positions=new Float32Array(s*3),this.colors=new Float32Array(s*3);const t=new M;t.setAttribute("position",new I(this.positions,3)),t.setAttribute("color",new I(this.colors,3)),t.setDrawRange(0,0),this.trains=new C(t,R.material()),this.trains.frustumCulled=!1,R.track(this.trains),this.object.add(this.trains)}nearest(s,t){let i,o=t;for(const e of this.drawn){const n=e.direction.dot(s);(n>o||i&&n===o&&e.magnitude<i.magnitude)&&(o=n,i=e)}return i}static directionOf(s){const{x:t,y:i,z:o}=w(s.altitudeDeg,s.azimuthDeg,1);return new j(t,i,o)}get count(){return this.shown}set(s,t,i,o){const e=this.tiers.map(()=>[]);let n=0,m=0;const a=new k;this.drawn=[];for(const r of s){const u=i(r.head);if(u<=0)continue;const c=r.magnitude-2.5*Math.log10(u);if(c>t)continue;m++,this.drawn.push({direction:h.directionOf(r.head),view:r,magnitude:c}),a.set(r.color);const d=G(c,t)*r.fade,{x:A,y:E,z:g}=w(r.head.altitudeDeg,r.head.azimuthDeg,h.RADIUS),[p,b,T]=o(r.head,c),z=r.fade,D=Math.max(a.r,a.g,a.b)||1;e[_(d)].push({x:A,y:E,z:g,r:p*a.r*z/D,g:b*a.g*z/D,b:T*a.b*z/D}),n=this.pushTrain(n,r.train,d,a)}this.shown=m,this.tiers.forEach((r,u)=>{const c=e[u],d=new Float32Array(c.length*3),A=new Float32Array(c.length*3);c.forEach((g,p)=>{d.set([g.x,g.y,g.z],p*3),A.set([g.r,g.g,g.b],p*3)}),r.geometry.dispose();const E=new M;E.setAttribute("position",new I(d,3)),E.setAttribute("color",new I(A,3)),r.geometry=E});const l=this.trains.geometry;l.setDrawRange(0,n),l.getAttribute("position").needsUpdate=!0,l.getAttribute("color").needsUpdate=!0}pushTrain(s,t,i,o){const e=t.length-1;for(let n=0;n<e;n++){if(s+h.VERTICES_PER_SEGMENT>h.MAX_SEGMENTS*h.VERTICES_PER_SEGMENT)return s;const m=1-n/e,a=1-(n+1)/e,l=w(t[n].altitudeDeg,t[n].azimuthDeg,h.RADIUS),r=w(t[n+1].altitudeDeg,t[n+1].azimuthDeg,h.RADIUS),u=d=>h.RADIUS*((h.MIN_HALF_WIDTH_DEG+h.BRIGHT_HALF_WIDTH_DEG*i*d)*Math.PI/180),c=d=>h.TRAIN_SHARE*i*d**h.TRAIN_FALLOFF;s=this.pushRibbon(s,l,r,u(m),u(a),c(m),c(a),o)}return s}pushRibbon(s,t,i,o,e,n,m,a){const l={x:i.x-t.x,y:i.y-t.y,z:i.z-t.z};if(Math.hypot(l.x,l.y,l.z)<1e-9)return s;const r=this.normalise(this.cross(this.normalise(t),this.normalise(l)));for(const[u,c]of[[-1,0],[0,1]]){const d=this.across(t,r,o,u),A=this.across(i,r,e,u),E=this.across(t,r,o,c),g=this.across(i,r,e,c),p=(b,T)=>b===0?T:0;s=this.push(s,d,p(u,n),a),s=this.push(s,A,p(u,m),a),s=this.push(s,E,p(c,n),a),s=this.push(s,A,p(u,m),a),s=this.push(s,g,p(c,m),a),s=this.push(s,E,p(c,n),a)}return s}across(s,t,i,o){return{x:s.x+t.x*i*o,y:s.y+t.y*i*o,z:s.z+t.z*i*o}}push(s,t,i,o){const e=s*3;this.positions[e]=t.x,this.positions[e+1]=t.y,this.positions[e+2]=t.z;const n=F.relativeOfResponse(Math.max(0,Math.min(1,i)));return this.colors[e]=n*o.r,this.colors[e+1]=n*o.g,this.colors[e+2]=n*o.b,s+1}cross(s,t){return{x:s.y*t.z-s.z*t.y,y:s.z*t.x-s.x*t.z,z:s.x*t.y-s.y*t.x}}normalise(s){const t=Math.hypot(s.x,s.y,s.z)||1;return{x:s.x/t,y:s.y/t,z:s.z/t}}dispose(){for(const s of this.tiers)s.geometry.dispose(),s.material.dispose();this.trains.geometry.dispose(),this.trains.material.dispose(),this.object.removeFromParent()}}class K{inSky=!0;hiddenFromEye=!0;pieces=new h;get object(){return this.pieces.object}get drawnCount(){return this.pieces.count}update(s,t,i){const o=s.length===0?[]:N.viewsAt(s,t,i.observer);o.length===0&&this.pieces.count===0||(this.pieces.set(o,i.magnitudeLimit,e=>i.cloudTransmission(e),(e,n)=>i.arrivingIlluminance(e,n,1)),i.lightFrom(o.map(e=>({position:e.head,magnitude:e.magnitude}))),i.glareFrom(o.map(e=>({key:`${e.reentryId}:${e.fragmentId}`,position:e.head,magnitude:e.magnitude,fade:e.fade}))))}pick(s,t,i){const o=this.pieces.nearest(t,i.nearestCos);return o&&{id:o.view.reentryId,detail:o}}dispose(){this.pieces.dispose()}}export{K as ReentrySimulation};
1
+ import{bi as S,bj as f,bc as R,bd as w,bk as G,bl as _,bm as F,t as N}from"./ShareDialogElement-DMDY7Hlo.js";import{I as y,J as H,w as M,x as I,M as C,V as j,C as k}from"./three.module-CbaHqYFq.js";import"./rr0-ufoathome.mjs";import"./Sighting-C1yj2-s5.js";import"./VisualAids-DI-hEL46.js";import"./SaidPosition-OJEYhVKN.js";import"./GeoProjection-DvqDbRIx.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";class h{static RADIUS=840;static MAX_SEGMENTS=1024;static VERTICES_PER_SEGMENT=12;static MIN_HALF_WIDTH_DEG=.1;static BRIGHT_HALF_WIDTH_DEG=.22;static TRAIN_SHARE=.9;static TRAIN_FALLOFF=1.2;object=new y;tiers;trains;positions;colors;shown=0;drawn=[];constructor(){this.object.name="reentries",this.tiers=S.map(i=>{const o=new H(new M,f.material(i.size,!1));return f.track(o),o.frustumCulled=!1,this.object.add(o),o});const s=h.MAX_SEGMENTS*h.VERTICES_PER_SEGMENT;this.positions=new Float32Array(s*3),this.colors=new Float32Array(s*3);const t=new M;t.setAttribute("position",new I(this.positions,3)),t.setAttribute("color",new I(this.colors,3)),t.setDrawRange(0,0),this.trains=new C(t,R.material()),this.trains.frustumCulled=!1,R.track(this.trains),this.object.add(this.trains)}nearest(s,t){let i,o=t;for(const e of this.drawn){const n=e.direction.dot(s);(n>o||i&&n===o&&e.magnitude<i.magnitude)&&(o=n,i=e)}return i}static directionOf(s){const{x:t,y:i,z:o}=w(s.altitudeDeg,s.azimuthDeg,1);return new j(t,i,o)}get count(){return this.shown}set(s,t,i,o){const e=this.tiers.map(()=>[]);let n=0,m=0;const a=new k;this.drawn=[];for(const r of s){const u=i(r.head);if(u<=0)continue;const c=r.magnitude-2.5*Math.log10(u);if(c>t)continue;m++,this.drawn.push({direction:h.directionOf(r.head),view:r,magnitude:c}),a.set(r.color);const d=G(c,t)*r.fade,{x:A,y:E,z:g}=w(r.head.altitudeDeg,r.head.azimuthDeg,h.RADIUS),[p,b,T]=o(r.head,c),z=r.fade,D=Math.max(a.r,a.g,a.b)||1;e[_(d)].push({x:A,y:E,z:g,r:p*a.r*z/D,g:b*a.g*z/D,b:T*a.b*z/D}),n=this.pushTrain(n,r.train,d,a)}this.shown=m,this.tiers.forEach((r,u)=>{const c=e[u],d=new Float32Array(c.length*3),A=new Float32Array(c.length*3);c.forEach((g,p)=>{d.set([g.x,g.y,g.z],p*3),A.set([g.r,g.g,g.b],p*3)}),r.geometry.dispose();const E=new M;E.setAttribute("position",new I(d,3)),E.setAttribute("color",new I(A,3)),r.geometry=E});const l=this.trains.geometry;l.setDrawRange(0,n),l.getAttribute("position").needsUpdate=!0,l.getAttribute("color").needsUpdate=!0}pushTrain(s,t,i,o){const e=t.length-1;for(let n=0;n<e;n++){if(s+h.VERTICES_PER_SEGMENT>h.MAX_SEGMENTS*h.VERTICES_PER_SEGMENT)return s;const m=1-n/e,a=1-(n+1)/e,l=w(t[n].altitudeDeg,t[n].azimuthDeg,h.RADIUS),r=w(t[n+1].altitudeDeg,t[n+1].azimuthDeg,h.RADIUS),u=d=>h.RADIUS*((h.MIN_HALF_WIDTH_DEG+h.BRIGHT_HALF_WIDTH_DEG*i*d)*Math.PI/180),c=d=>h.TRAIN_SHARE*i*d**h.TRAIN_FALLOFF;s=this.pushRibbon(s,l,r,u(m),u(a),c(m),c(a),o)}return s}pushRibbon(s,t,i,o,e,n,m,a){const l={x:i.x-t.x,y:i.y-t.y,z:i.z-t.z};if(Math.hypot(l.x,l.y,l.z)<1e-9)return s;const r=this.normalise(this.cross(this.normalise(t),this.normalise(l)));for(const[u,c]of[[-1,0],[0,1]]){const d=this.across(t,r,o,u),A=this.across(i,r,e,u),E=this.across(t,r,o,c),g=this.across(i,r,e,c),p=(b,T)=>b===0?T:0;s=this.push(s,d,p(u,n),a),s=this.push(s,A,p(u,m),a),s=this.push(s,E,p(c,n),a),s=this.push(s,A,p(u,m),a),s=this.push(s,g,p(c,m),a),s=this.push(s,E,p(c,n),a)}return s}across(s,t,i,o){return{x:s.x+t.x*i*o,y:s.y+t.y*i*o,z:s.z+t.z*i*o}}push(s,t,i,o){const e=s*3;this.positions[e]=t.x,this.positions[e+1]=t.y,this.positions[e+2]=t.z;const n=F.relativeOfResponse(Math.max(0,Math.min(1,i)));return this.colors[e]=n*o.r,this.colors[e+1]=n*o.g,this.colors[e+2]=n*o.b,s+1}cross(s,t){return{x:s.y*t.z-s.z*t.y,y:s.z*t.x-s.x*t.z,z:s.x*t.y-s.y*t.x}}normalise(s){const t=Math.hypot(s.x,s.y,s.z)||1;return{x:s.x/t,y:s.y/t,z:s.z/t}}dispose(){for(const s of this.tiers)s.geometry.dispose(),s.material.dispose();this.trains.geometry.dispose(),this.trains.material.dispose(),this.object.removeFromParent()}}class K{inSky=!0;hiddenFromEye=!0;pieces=new h;get object(){return this.pieces.object}get drawnCount(){return this.pieces.count}update(s,t,i){const o=s.length===0?[]:N.viewsAt(s,t,i.observer);o.length===0&&this.pieces.count===0||(this.pieces.set(o,i.magnitudeLimit,e=>i.cloudTransmission(e),(e,n)=>i.arrivingIlluminance(e,n,1)),i.lightFrom(o.map(e=>({position:e.head,magnitude:e.magnitude}))),i.glareFrom(o.map(e=>({key:`${e.reentryId}:${e.fragmentId}`,position:e.head,magnitude:e.magnitude,fade:e.fade}))))}pick(s,t,i){const o=this.pieces.nearest(t,i.nearestCos);return o&&{id:o.view.reentryId,detail:o}}dispose(){this.pieces.dispose()}}export{K as ReentrySimulation};
@@ -1 +1 @@
1
- import{Q as w,aO as M,z as g,L as c,aP as y,M as k,K as O,B as T,a as b,P as E,ac as I}from"./three.module-CbaHqYFq.js";import{R as d}from"./ReferenceTimeline-2kBldQeG.js";import{g as D}from"./GeoProjection-DvqDbRIx.js";import{P as m,a as f}from"./PictureFetch-C3wgf1ZV.js";import{b4 as x}from"./ShareDialogElement-C0oFh0X4.js";import"./rr0-ufoathome.mjs";import"./Sighting-BX_CmDY2.js";import"./VisualAids-DI-hEL46.js";import"./SaidPosition-OJEYhVKN.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";const v=x.reference,u=800,l=Math.PI/180;class r{constructor(t,i,s=r.fetchImage,e=r.openVideo){this.scene=t,this.onImageLoaded=i,this.loadImage=s,this.loadVideo=e}meshes=new Map;signatures=new Map;images=new Map;loading=new Map;failed=new Map;references=[];views=new Map;shown=!0;observerAt;clock={t:0,playing:!1,timeScale:1};static PRESENT_WITHIN_M=2;static GONE_BEYOND_M=20;static presenceAt(t,i){if(!t.from||!i)return 1;const s=D(i.lat,i.lng,t.from.lat,t.from.lng),a=(Math.hypot(s.x,s.z)-r.PRESENT_WITHIN_M)/(r.GONE_BEYOND_M-r.PRESENT_WITHIN_M),o=Math.min(Math.max(a,0),1);return 1-o*o*(3-2*o)}set(t,i=this.views,s){this.references=t,this.observerAt=s,this.views=i;const e=new Set(t.map(a=>a.id));for(const[a,o]of this.meshes)e.has(a)||(this.dispose(o),this.meshes.delete(a),this.signatures.delete(a));for(const[a,o]of this.images){const n=t.find(p=>p.id===a);if(n&&n.src===o.texture.userData.src&&n.kind==="video"==(o.video!==void 0))continue;r.release(o),this.images.delete(a);const h=this.meshes.get(a);h&&(this.dispose(h),this.meshes.delete(a),this.signatures.delete(a))}for(const a of t){const o=this.images.get(a.id);if(!o){this.load(a);continue}this.build(a,o)}this.follow()}setTime(t){this.clock=t,this.follow()}setShown(t){this.shown=t;for(const i of this.meshes.values())i.visible=t&&this.opacityOf(i.userData.id)>0}setView(t,i){this.views.set(t,i);const s=this.meshes.get(t);s&&this.applyOpacity(s,t)}layer=v;get any(){for(const t of this.meshes.values())if(t.visible)return!0;return!1}place(t){const i=this.held;i&&t.getWorldQuaternion(this.cameraTurn);for(const s of this.meshes.values()){if(!s.visible)continue;s.position.copy(t.position);const e=i?.get(s);e&&s.quaternion.copy(this.cameraTurn).multiply(e),s.updateMatrixWorld()}}hold(t){t.getWorldQuaternion(this.cameraTurn);const i=this.cameraTurn.clone().invert();this.held=new Map([...this.meshes.values()].map(s=>[s,i.clone().multiply(s.quaternion)])),this.registered=new Map([...this.meshes.values()].map(s=>[s,s.quaternion.clone()]))}release(){if(this.held){for(const[t,i]of this.registered??[])t.quaternion.copy(i);this.held=void 0,this.registered=void 0}}registered;held;cameraTurn=new w;get furthestM(){return this.meshes.size>0?u:0}directionOfPixel(t,i,s,e){const a=this.images.get(t.id),o=a?a.width/a.height:1,n=d.registrationAt(t,this.clock.t),h=Math.tan(n.fovDeg/2*l),p=h*o;return e.set((i*2-1)*p,(1-s*2)*h,-1).normalize(),e.applyQuaternion(r.orientation(n))}aspectOf(t){const i=this.images.get(t);return i?i.width/i.height:void 0}failureOf(t){return this.failed.get(t)}follow(){for(const t of this.references){const i=this.meshes.get(t.id),s=this.images.get(t.id)?.video;s&&this.sync(t,s),i&&(t.registrationTrack?.length&&r.point(i,t,d.registrationAt(t,this.clock.t)),t.kind==="video"&&this.applyOpacity(i,t.id))}}sync(t,i){const s=d.mediaSecondsAt(t,this.clock.t,this.clock.timeScale,Number.isFinite(i.duration)?i.duration:void 0);if(s===void 0){i.paused||i.pause();return}const e=d.command(i.currentTime,s,this.clock.playing,d.rateOf(t));i.playbackRate=e.rate,e.seekS!==void 0&&!i.seeking&&(i.currentTime=e.seekS),e.play&&i.paused&&i.play().catch(()=>{}),!e.play&&!i.paused&&i.pause()}load(t){const i=t.src;if(this.loading.has(t.id)||this.failed.has(i))return;const s=t.kind==="video",a=(s?this.loadVideo(i,()=>this.onVideoFrame()):this.loadImage(i)).then(o=>{this.loading.delete(t.id);const n=this.references.find(h=>h.id===t.id);if(!n||n.src!==i||n.kind==="video"!==s){r.release(o);return}o.texture.userData.src=i,this.images.set(t.id,o),this.build(n,o),this.follow(),this.onImageLoaded()},o=>{this.loading.delete(t.id),this.failed.set(i,m.failureOf(o)),this.onImageLoaded()});this.loading.set(t.id,a)}onVideoFrame(){this.follow(),this.onFrame?.()}onFrame;static openVideo(t,i){return new Promise((s,e)=>{const a=document.createElement("video");a.crossOrigin="anonymous",a.muted=!0,a.playsInline=!0,a.preload="auto",a.addEventListener("loadeddata",()=>{const o=new M(a);o.colorSpace=g,o.minFilter=c,o.magFilter=c,o.generateMipmaps=!1,a.addEventListener("seeked",i);const n=()=>{a.paused&&i(),a.src&&a.requestVideoFrameCallback(n)};"requestVideoFrameCallback"in a&&a.requestVideoFrameCallback(n),s({texture:o,width:a.videoWidth,height:a.videoHeight,video:a})},{once:!0}),a.addEventListener("error",()=>{m.whyVideoUnread(t).then(o=>e(new f(t,o)))},{once:!0}),a.src=t})}static release(t){t.texture.dispose();const i=t.video;i&&(i.pause(),i.removeAttribute?.("src"),i.load?.())}static async fetchImage(t){const i=await m.blob(t),s=await createImageBitmap(i,{imageOrientation:"flipY"}).catch(()=>{throw new f(t,{kind:"notPicture"})}),e=new y(s);return e.flipY=!1,e.colorSpace=g,e.minFilter=c,e.magFilter=c,e.generateMipmaps=!1,e.needsUpdate=!0,{texture:e,width:s.width,height:s.height}}build(t,i){const s=r.signatureOf(t,i);let e=this.meshes.get(t.id);if(e&&this.signatures.get(t.id)===s){this.applyOpacity(e,t.id);return}e&&(this.dispose(e),this.meshes.delete(t.id)),e=new k(r.geometryOf(t,i),new O({map:i.texture,transparent:!0,depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1})),t.kind==="panorama"&&(e.material.side=T),e.frustumCulled=!1,e.layers.set(v),e.userData.id=t.id,r.point(e,t,d.registrationAt(t,this.clock.t)),this.scene.add(e),this.meshes.set(t.id,e),this.signatures.set(t.id,s),this.applyOpacity(e,t.id)}static geometryOf(t,i){if(t.kind==="panorama"){const o=new b(u,64,32,Math.PI/2,Math.PI*2),n=o.attributes.uv;for(let h=0;h<n.count;h++)n.setX(h,1-n.getX(h));return n.needsUpdate=!0,o}const s=2*u*Math.tan(t.registration.fovDeg/2*l),e=s*(i.width/Math.max(i.height,1)),a=new E(e,s);return a.translate(0,0,-u),a}static orientation({headingDeg:t,pitchDeg:i,rollDeg:s}){const e=new I;return e.rotation.set(i*l,-t*l,-(s??0)*l,"YXZ"),e.quaternion}static point(t,i,s){if(t.quaternion.copy(r.orientation(s)),i.kind==="panorama")return;const e=Math.tan(s.fovDeg/2*l)/Math.tan(i.registration.fovDeg/2*l);t.scale.set(e,e,1)}inTime(t){if(t.kind!=="video")return!0;const i=this.images.get(t.id)?.video?.duration;return d.mediaSecondsAt(t,this.clock.t,this.clock.timeScale,i!==void 0&&Number.isFinite(i)?i:void 0)!==void 0}opacityOf(t){const i=this.references.find(a=>a.id===t);if(i&&!this.inTime(i))return 0;const s=this.views.get(t),e=i?r.presenceAt(i,this.observerAt):1;return(s?.opacity??i?.opacity??0)*e}applyOpacity(t,i){const s=this.opacityOf(i);t.material.opacity=s,t.visible=this.shown&&s>0}static signatureOf(t,i){const{headingDeg:s,pitchDeg:e,rollDeg:a,fovDeg:o}=t.registration;return[t.kind,t.src,i.width,i.height,s,e,a??0,o].join("|")}dispose(t){this.scene.remove(t),t.geometry.dispose(),t.material.dispose()}disposeAll(){for(const t of this.meshes.values())this.dispose(t);this.meshes.clear(),this.signatures.clear();for(const t of this.images.values())r.release(t);this.images.clear()}}export{v as REFERENCE_LAYER,r as ReferenceSystem};
1
+ import{Q as w,aO as M,z as g,L as c,aP as y,M as k,K as O,B as T,a as b,P as E,ac as I}from"./three.module-CbaHqYFq.js";import{R as d}from"./ReferenceTimeline-2kBldQeG.js";import{g as D}from"./GeoProjection-DvqDbRIx.js";import{P as m,a as f}from"./PictureFetch-C3wgf1ZV.js";import{b4 as x}from"./ShareDialogElement-DMDY7Hlo.js";import"./rr0-ufoathome.mjs";import"./Sighting-C1yj2-s5.js";import"./VisualAids-DI-hEL46.js";import"./SaidPosition-OJEYhVKN.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";const v=x.reference,u=800,l=Math.PI/180;class r{constructor(t,i,s=r.fetchImage,e=r.openVideo){this.scene=t,this.onImageLoaded=i,this.loadImage=s,this.loadVideo=e}meshes=new Map;signatures=new Map;images=new Map;loading=new Map;failed=new Map;references=[];views=new Map;shown=!0;observerAt;clock={t:0,playing:!1,timeScale:1};static PRESENT_WITHIN_M=2;static GONE_BEYOND_M=20;static presenceAt(t,i){if(!t.from||!i)return 1;const s=D(i.lat,i.lng,t.from.lat,t.from.lng),a=(Math.hypot(s.x,s.z)-r.PRESENT_WITHIN_M)/(r.GONE_BEYOND_M-r.PRESENT_WITHIN_M),o=Math.min(Math.max(a,0),1);return 1-o*o*(3-2*o)}set(t,i=this.views,s){this.references=t,this.observerAt=s,this.views=i;const e=new Set(t.map(a=>a.id));for(const[a,o]of this.meshes)e.has(a)||(this.dispose(o),this.meshes.delete(a),this.signatures.delete(a));for(const[a,o]of this.images){const n=t.find(p=>p.id===a);if(n&&n.src===o.texture.userData.src&&n.kind==="video"==(o.video!==void 0))continue;r.release(o),this.images.delete(a);const h=this.meshes.get(a);h&&(this.dispose(h),this.meshes.delete(a),this.signatures.delete(a))}for(const a of t){const o=this.images.get(a.id);if(!o){this.load(a);continue}this.build(a,o)}this.follow()}setTime(t){this.clock=t,this.follow()}setShown(t){this.shown=t;for(const i of this.meshes.values())i.visible=t&&this.opacityOf(i.userData.id)>0}setView(t,i){this.views.set(t,i);const s=this.meshes.get(t);s&&this.applyOpacity(s,t)}layer=v;get any(){for(const t of this.meshes.values())if(t.visible)return!0;return!1}place(t){const i=this.held;i&&t.getWorldQuaternion(this.cameraTurn);for(const s of this.meshes.values()){if(!s.visible)continue;s.position.copy(t.position);const e=i?.get(s);e&&s.quaternion.copy(this.cameraTurn).multiply(e),s.updateMatrixWorld()}}hold(t){t.getWorldQuaternion(this.cameraTurn);const i=this.cameraTurn.clone().invert();this.held=new Map([...this.meshes.values()].map(s=>[s,i.clone().multiply(s.quaternion)])),this.registered=new Map([...this.meshes.values()].map(s=>[s,s.quaternion.clone()]))}release(){if(this.held){for(const[t,i]of this.registered??[])t.quaternion.copy(i);this.held=void 0,this.registered=void 0}}registered;held;cameraTurn=new w;get furthestM(){return this.meshes.size>0?u:0}directionOfPixel(t,i,s,e){const a=this.images.get(t.id),o=a?a.width/a.height:1,n=d.registrationAt(t,this.clock.t),h=Math.tan(n.fovDeg/2*l),p=h*o;return e.set((i*2-1)*p,(1-s*2)*h,-1).normalize(),e.applyQuaternion(r.orientation(n))}aspectOf(t){const i=this.images.get(t);return i?i.width/i.height:void 0}failureOf(t){return this.failed.get(t)}follow(){for(const t of this.references){const i=this.meshes.get(t.id),s=this.images.get(t.id)?.video;s&&this.sync(t,s),i&&(t.registrationTrack?.length&&r.point(i,t,d.registrationAt(t,this.clock.t)),t.kind==="video"&&this.applyOpacity(i,t.id))}}sync(t,i){const s=d.mediaSecondsAt(t,this.clock.t,this.clock.timeScale,Number.isFinite(i.duration)?i.duration:void 0);if(s===void 0){i.paused||i.pause();return}const e=d.command(i.currentTime,s,this.clock.playing,d.rateOf(t));i.playbackRate=e.rate,e.seekS!==void 0&&!i.seeking&&(i.currentTime=e.seekS),e.play&&i.paused&&i.play().catch(()=>{}),!e.play&&!i.paused&&i.pause()}load(t){const i=t.src;if(this.loading.has(t.id)||this.failed.has(i))return;const s=t.kind==="video",a=(s?this.loadVideo(i,()=>this.onVideoFrame()):this.loadImage(i)).then(o=>{this.loading.delete(t.id);const n=this.references.find(h=>h.id===t.id);if(!n||n.src!==i||n.kind==="video"!==s){r.release(o);return}o.texture.userData.src=i,this.images.set(t.id,o),this.build(n,o),this.follow(),this.onImageLoaded()},o=>{this.loading.delete(t.id),this.failed.set(i,m.failureOf(o)),this.onImageLoaded()});this.loading.set(t.id,a)}onVideoFrame(){this.follow(),this.onFrame?.()}onFrame;static openVideo(t,i){return new Promise((s,e)=>{const a=document.createElement("video");a.crossOrigin="anonymous",a.muted=!0,a.playsInline=!0,a.preload="auto",a.addEventListener("loadeddata",()=>{const o=new M(a);o.colorSpace=g,o.minFilter=c,o.magFilter=c,o.generateMipmaps=!1,a.addEventListener("seeked",i);const n=()=>{a.paused&&i(),a.src&&a.requestVideoFrameCallback(n)};"requestVideoFrameCallback"in a&&a.requestVideoFrameCallback(n),s({texture:o,width:a.videoWidth,height:a.videoHeight,video:a})},{once:!0}),a.addEventListener("error",()=>{m.whyVideoUnread(t).then(o=>e(new f(t,o)))},{once:!0}),a.src=t})}static release(t){t.texture.dispose();const i=t.video;i&&(i.pause(),i.removeAttribute?.("src"),i.load?.())}static async fetchImage(t){const i=await m.blob(t),s=await createImageBitmap(i,{imageOrientation:"flipY"}).catch(()=>{throw new f(t,{kind:"notPicture"})}),e=new y(s);return e.flipY=!1,e.colorSpace=g,e.minFilter=c,e.magFilter=c,e.generateMipmaps=!1,e.needsUpdate=!0,{texture:e,width:s.width,height:s.height}}build(t,i){const s=r.signatureOf(t,i);let e=this.meshes.get(t.id);if(e&&this.signatures.get(t.id)===s){this.applyOpacity(e,t.id);return}e&&(this.dispose(e),this.meshes.delete(t.id)),e=new k(r.geometryOf(t,i),new O({map:i.texture,transparent:!0,depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1})),t.kind==="panorama"&&(e.material.side=T),e.frustumCulled=!1,e.layers.set(v),e.userData.id=t.id,r.point(e,t,d.registrationAt(t,this.clock.t)),this.scene.add(e),this.meshes.set(t.id,e),this.signatures.set(t.id,s),this.applyOpacity(e,t.id)}static geometryOf(t,i){if(t.kind==="panorama"){const o=new b(u,64,32,Math.PI/2,Math.PI*2),n=o.attributes.uv;for(let h=0;h<n.count;h++)n.setX(h,1-n.getX(h));return n.needsUpdate=!0,o}const s=2*u*Math.tan(t.registration.fovDeg/2*l),e=s*(i.width/Math.max(i.height,1)),a=new E(e,s);return a.translate(0,0,-u),a}static orientation({headingDeg:t,pitchDeg:i,rollDeg:s}){const e=new I;return e.rotation.set(i*l,-t*l,-(s??0)*l,"YXZ"),e.quaternion}static point(t,i,s){if(t.quaternion.copy(r.orientation(s)),i.kind==="panorama")return;const e=Math.tan(s.fovDeg/2*l)/Math.tan(i.registration.fovDeg/2*l);t.scale.set(e,e,1)}inTime(t){if(t.kind!=="video")return!0;const i=this.images.get(t.id)?.video?.duration;return d.mediaSecondsAt(t,this.clock.t,this.clock.timeScale,i!==void 0&&Number.isFinite(i)?i:void 0)!==void 0}opacityOf(t){const i=this.references.find(a=>a.id===t);if(i&&!this.inTime(i))return 0;const s=this.views.get(t),e=i?r.presenceAt(i,this.observerAt):1;return(s?.opacity??i?.opacity??0)*e}applyOpacity(t,i){const s=this.opacityOf(i);t.material.opacity=s,t.visible=this.shown&&s>0}static signatureOf(t,i){const{headingDeg:s,pitchDeg:e,rollDeg:a,fovDeg:o}=t.registration;return[t.kind,t.src,i.width,i.height,s,e,a??0,o].join("|")}dispose(t){this.scene.remove(t),t.geometry.dispose(),t.material.dispose()}disposeAll(){for(const t of this.meshes.values())this.dispose(t);this.meshes.clear(),this.signatures.clear();for(const t of this.images.values())r.release(t);this.images.clear()}}export{v as REFERENCE_LAYER,r as ReferenceSystem};
@@ -1 +1 @@
1
- import{P as y,q as k,$ as h}from"./rr0-ufoathome.mjs";import{ScenarioSweep as j}from"./ScenarioSweep-jTxLjnaW.js";import"./ShareDialogElement-C0oFh0X4.js";import"./Sighting-BX_CmDY2.js";import"./VisualAids-DI-hEL46.js";import"./three.module-CbaHqYFq.js";import"./SaidPosition-OJEYhVKN.js";import"./GeoProjection-DvqDbRIx.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";import"./CaseEditorElement-BOp207Tr.js";import"./ParameterForm-XbqxCLRn.js";import"./ColumnResize-DnX89ynB.js";import"./PoherSelfCheck-pcYj_hQ1.js";import"./PoherMatrix-C2fcLqDH.js";import"./TimelineTracks-Daaqw9ly.js";import"./ReentryArchive-CeXHrU7L.js";import"./ReferenceTimeline-2kBldQeG.js";import"./upperAirSources-BU0pD84c.js";import"./Account-C4jhsVtN.js";import"./SatellitePasses-Pfro2-0Z.js";class b{static fileName(c,n){const t=c.replace(/\.json$/,""),d=n.placeId.replace(/[^A-Za-z0-9-]+/g,"-"),p=n.local.replace(/[-:]/g,"").replace("T","-");return`${t}-scenario-${d}-${p}.json`}static recording(c,n,t,d,p,i={}){const a=structuredClone(c),r=y.strip(c).recording,l=a.interpretation;if(!l||!r.interpretation)throw new Error(`${n} states no interpretation`);a.id=`${r.id??n.replace(/\.json$/,"")}-scenario-${t.id}`,t.ownPlace||(a.place={value:{...t.placeName?{name:t.placeName}:{},locations:[{lat:t.lat,lng:t.lng}]},basis:"assumed",rationale:`one of the candidate places of the case, played as scenario ${t.id}${i.placeRationale?`: ${i.placeRationale}`:""}`},delete a.snapshots);const e=r.time?r.time.replace(/[~?%]$/,"").slice(0,16):void 0;return t.local!==e&&(a.time={value:`${t.local}:00`,basis:"assumed",rationale:`one of the candidate instants of the case, played as scenario ${t.id}${i.timeRationale?`: ${i.timeRationale}`:""}`}),delete a.image,d&&b.rewind(l,r.interpretation,d,t,p),l.scenario={id:t.id,of:n,...i.verdict?{verdict:i.verdict}:{}},i.title!==void 0&&(l.title=i.title),a}static rewind(c,n,t,d,p){const i={at:e=>h.at(t,e),levels:t.levels.map(e=>e.aboveGroundM)},a=e=>`${e} archived at ${t.hour} UTC at this place (${t.credit}, grid point ${t.lat.toFixed(3)}, ${t.lng.toFixed(3)}): established given scenario ${d.id} only`;for(const e of p){const f=k.itemsOf(n,e.key);if(!e.inWind||f.length===0)continue;const u=c[e.key];f.forEach((m,v)=>{const s=e.inWind(m,i);for(const o of Object.keys(s))JSON.stringify(s[o])!==JSON.stringify(m[o])&&(u[v][o]=o==="wind"?{value:s[o],basis:"established",rationale:a("the wind at the ground")}:s[o])})}const r=h.at(t,10),l=c.bodies;n.bodies.forEach((e,f)=>{if(!e.drifting)return;const u=j.drifted(e,r),m=l[f].track;!m||!u.track||u.track.forEach((v,s)=>{for(const o of["eastM","northM"]){const w=v[o];if(w===void 0)continue;const g=Math.round(w*100)/100,$=m[s][o];m[s][o]=typeof $=="object"&&$!==null&&"value"in $?{...$,value:g,...s===0?{rationale:a(`drifting with the wind at the ground, ${h.rounded(r).speedMS} m/s towards ${h.rounded(r).towardDeg}°,`)}:{}}:g}})})}}export{b as ScenarioReadings};
1
+ import{P as y,q as k,$ as h}from"./rr0-ufoathome.mjs";import{ScenarioSweep as j}from"./ScenarioSweep-DTqJSF5a.js";import"./ShareDialogElement-DMDY7Hlo.js";import"./Sighting-C1yj2-s5.js";import"./VisualAids-DI-hEL46.js";import"./three.module-CbaHqYFq.js";import"./SaidPosition-OJEYhVKN.js";import"./GeoProjection-DvqDbRIx.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";import"./CaseEditorElement-CK82yjEn.js";import"./ParameterForm-XbqxCLRn.js";import"./ColumnResize-DksRZriL.js";import"./PoherSelfCheck-BjmenygA.js";import"./PoherMatrix-C2fcLqDH.js";import"./TimelineTracks-Daaqw9ly.js";import"./ReentryArchive-CeXHrU7L.js";import"./ReferenceTimeline-2kBldQeG.js";import"./upperAirSources-BU0pD84c.js";import"./Account-C4jhsVtN.js";import"./SatellitePasses-Pfro2-0Z.js";class b{static fileName(c,n){const t=c.replace(/\.json$/,""),d=n.placeId.replace(/[^A-Za-z0-9-]+/g,"-"),p=n.local.replace(/[-:]/g,"").replace("T","-");return`${t}-scenario-${d}-${p}.json`}static recording(c,n,t,d,p,i={}){const a=structuredClone(c),r=y.strip(c).recording,l=a.interpretation;if(!l||!r.interpretation)throw new Error(`${n} states no interpretation`);a.id=`${r.id??n.replace(/\.json$/,"")}-scenario-${t.id}`,t.ownPlace||(a.place={value:{...t.placeName?{name:t.placeName}:{},locations:[{lat:t.lat,lng:t.lng}]},basis:"assumed",rationale:`one of the candidate places of the case, played as scenario ${t.id}${i.placeRationale?`: ${i.placeRationale}`:""}`},delete a.snapshots);const e=r.time?r.time.replace(/[~?%]$/,"").slice(0,16):void 0;return t.local!==e&&(a.time={value:`${t.local}:00`,basis:"assumed",rationale:`one of the candidate instants of the case, played as scenario ${t.id}${i.timeRationale?`: ${i.timeRationale}`:""}`}),delete a.image,d&&b.rewind(l,r.interpretation,d,t,p),l.scenario={id:t.id,of:n,...i.verdict?{verdict:i.verdict}:{}},i.title!==void 0&&(l.title=i.title),a}static rewind(c,n,t,d,p){const i={at:e=>h.at(t,e),levels:t.levels.map(e=>e.aboveGroundM)},a=e=>`${e} archived at ${t.hour} UTC at this place (${t.credit}, grid point ${t.lat.toFixed(3)}, ${t.lng.toFixed(3)}): established given scenario ${d.id} only`;for(const e of p){const f=k.itemsOf(n,e.key);if(!e.inWind||f.length===0)continue;const u=c[e.key];f.forEach((m,v)=>{const s=e.inWind(m,i);for(const o of Object.keys(s))JSON.stringify(s[o])!==JSON.stringify(m[o])&&(u[v][o]=o==="wind"?{value:s[o],basis:"established",rationale:a("the wind at the ground")}:s[o])})}const r=h.at(t,10),l=c.bodies;n.bodies.forEach((e,f)=>{if(!e.drifting)return;const u=j.drifted(e,r),m=l[f].track;!m||!u.track||u.track.forEach((v,s)=>{for(const o of["eastM","northM"]){const w=v[o];if(w===void 0)continue;const g=Math.round(w*100)/100,$=m[s][o];m[s][o]=typeof $=="object"&&$!==null&&"value"in $?{...$,value:g,...s===0?{rationale:a(`drifting with the wind at the ground, ${h.rounded(r).speedMS} m/s towards ${h.rounded(r).towardDeg}°,`)}:{}}:g}})})}}export{b as ScenarioReadings};
@@ -1 +1 @@
1
- import{C as P,P as k,q as A,$ as N}from"./rr0-ufoathome.mjs";import{W as R,aS as O,a8 as $,ac as K}from"./ShareDialogElement-C0oFh0X4.js";import{S as y,C as S}from"./CaseEditorElement-BOp207Tr.js";import{SatellitePasses as T}from"./SatellitePasses-Pfro2-0Z.js";import"./Sighting-BX_CmDY2.js";import"./VisualAids-DI-hEL46.js";import"./three.module-CbaHqYFq.js";import"./SaidPosition-OJEYhVKN.js";import"./GeoProjection-DvqDbRIx.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";import"./ParameterForm-XbqxCLRn.js";import"./ColumnResize-DnX89ynB.js";import"./PoherSelfCheck-pcYj_hQ1.js";import"./PoherMatrix-C2fcLqDH.js";import"./TimelineTracks-Daaqw9ly.js";import"./ReentryArchive-CeXHrU7L.js";import"./ReferenceTimeline-2kBldQeG.js";import"./upperAirSources-BU0pD84c.js";import"./Account-C4jhsVtN.js";class f{static MAX_SCENARIOS=200;static KM_PER_DEG=111.32;static merged(t,s){return t?s?{...t,...s}:t:s}static scenarios(t,s){const e=f.places(t,s?.places),a=f.instants(t,s?.time),n=[];for(const r of e)for(const i of a){const d=r.placeId==="own"&&i===f.minute(t.local);n.push({id:`${r.placeId}@${i}`,placeId:r.placeId,...r.placeName?{placeName:r.placeName}:{},lat:r.lat,lng:r.lng,local:i,date:f.utc(i,t.utcOffsetHours),own:d,ownPlace:r.placeId==="own"})}if(n.length>f.MAX_SCENARIOS)throw new Error(`${n.length} scenarios for one account: more than ${f.MAX_SCENARIOS}. Take a coarser step or fewer points.`);return n.sort((r,i)=>Number(i.own)-Number(r.own))}static places(t,s){const e={placeId:"own",...t.placeName?{placeName:t.placeName}:{},lat:t.lat,lng:t.lng},a=s?.own===!1?[]:[e],n=(s?.candidates??[]).filter(r=>!r.for||t.eventId===void 0||r.for.includes(t.eventId)).flatMap(r=>{const i=r.place.locations?.[0];return i?[{placeId:r.id,...r.place.name?{placeName:r.place.name}:{},lat:i.lat,lng:i.lng}]:[]});switch(s?.sweep??"bounds"){case"bounds":return[...a,...n];case"points":{const r=new Set(s?.points??[]);return[...a,...n.filter(i=>r.has(i.placeId))]}case"deltas":return[...a,...(s?.deltasKm??[]).filter(r=>r.eastKm!==0||r.northKm!==0).map(r=>({placeId:`own${r.eastKm>=0?"+":""}${r.eastKm},${r.northKm>=0?"+":""}${r.northKm}km`,...t.placeName?{placeName:t.placeName}:{},lat:t.lat+r.northKm/f.KM_PER_DEG,lng:t.lng+r.eastKm/(f.KM_PER_DEG*Math.cos(t.lat*Math.PI/180))}))];case"step":{const r=s?.stepKm;if(!r||r<=0)throw new Error("A sweep of places by step states its stepKm.");const i=[e,...n],d=Math.min(...i.map(u=>u.lat)),o=Math.max(...i.map(u=>u.lat)),l=Math.min(...i.map(u=>u.lng)),c=Math.max(...i.map(u=>u.lng)),h=f.KM_PER_DEG*Math.cos((d+o)/2*Math.PI/180),m=[];for(let u=0;d+u*r/f.KM_PER_DEG<=o+1e-9;u++)for(let p=0;l+p*r/h<=c+1e-9;p++){const g=d+u*r/f.KM_PER_DEG,v=l+p*r/h;m.push({placeId:`grid${g.toFixed(3)},${v.toFixed(3)}`,lat:g,lng:v})}return[...a,...m]}}}static instants(t,s){const e=f.minute(t.local);if(!s)return[e];const a=f.ms(e),n=f.ms(s.from),r=f.ms(s.to),i=s.each??"day",d=864e5,o=c=>{const h=[];if(i==="day"){const m=a+Math.ceil((n-a)/d)*d;for(let u=m;u<=r;u+=c)h.push(u)}else for(let m=n;m<=r;m+=c)h.push(m);return h};let l;switch(s.sweep??"bounds"){case"bounds":{const c=o(i==="day"?d:6e4);l=c.length>0?[c[0],c[c.length-1]]:[];break}case"points":l=(s.points??[]).map(c=>/T/.test(c)?f.ms(c):f.ms(`${c}T${e.slice(11)}`));break;case"step":l=o((s.stepMinutes??(i==="day"?1440:60))*6e4);break;case"deltas":l=[a,...(s.deltasMinutes??[]).map(c=>a+c*6e4)];break}return[...new Set(l)].sort((c,h)=>c-h).map(c=>new Date(c).toISOString().slice(0,16))}static ms(t){const s=t.replace(/[~?%]$/,"").replace(/(Z|[+-]\d\d:\d\d)$/,""),e=s.length===10?`${s}T00:00`:s,a=Date.parse(`${e}Z`);if(Number.isNaN(a))throw new Error(`Not an instant: ${t}`);return a}static minute(t){return new Date(f.ms(t)).toISOString().slice(0,16)}static utc(t,s){return new Date(f.ms(t)-s*36e5)}}class b{constructor(t){this.sources=t,this.model=t.model??R.MODELS[0]}static PLAUSIBLE=O.MEASURABLE;static DRAWN_STEP_MS=500;static STARS=6;static STAR_MAG=1.5;model;async sweep(t,s={}){const e=(t.events??[]).filter(o=>o.eventType===P.SIGHTING_EVENT&&!o.interpretationOf&&o.url).filter(o=>!s.accounts||o.id!==void 0&&s.accounts.includes(o.id)),a=[],n=await Promise.all(e.map(async o=>{const l=await this.sources.load(o.url),c=s.conditions??f.merged(t.conditions,k.strip(l).recording.conditions),h=f.scenarios(b.conditionsOf(l,o.id),c),m=[o.id,k.strip(l).recording.id].filter(p=>!!p),u=P.interpretationEvents(t,m).filter(p=>p.url&&(!s.readings||s.readings.includes(p.url)));return{event:o,accountJson:l,conditions:c,scenarios:h,readings:u}})),r=n.reduce((o,l)=>o+l.scenarios.length*(l.readings.length+(s.sky===!1?0:1)),0);let i=0;const d=()=>s.progress?.(++i,r);for(const{event:o,accountJson:l,conditions:c,scenarios:h,readings:m}of n){const u={...o.id?{eventId:o.id}:{},url:o.url,title:o.title,scenarios:h,readings:[],sky:[]},p=b.judges(l);for(const g of m){const v=await this.sources.load(g.url),w=k.strip(v).recording.interpretation;if(!w||w.scenario){h.forEach(d);continue}const M=await this.replay(g.url,g.title,w,h,p,d);M.kept=b.kept(M,s.keep??c?.keep??"telling"),u.readings.push(M)}if(s.sky!==!1){const g=await this.sky(l,h,d);u.sky=g.replays,g.note&&(u.skyNote=g.note)}a.push(u)}return{accounts:a,alerts:b.alerts(a)}}static conditionsOf(t,s){const e=k.strip(t).recording,a=e.place?.locations?.[0];if(!e.time||!a)throw new Error(`An account with no time or no place cannot be played elsewhere: ${e.id??s}`);return{...s?{eventId:s}:{},local:e.time,utcOffsetHours:e.utcOffsetHours??Math.round(a.lng/15),lat:a.lat,lng:a.lng,...e.place?.name?{placeName:e.place.name}:{}}}static judges(t){const s=O.forAccount(t),e=$(t),a=k.strip(t).recording.timeline?.keyframes??[],n=Math.max(0,...a.map(d=>d.t)),r=Array.from({length:Math.floor(n/b.DRAWN_STEP_MS)+1},(d,o)=>o*b.DRAWN_STEP_MS),i=K.lawsOf(R.MODELS[0],e.account?.conditions);return{said:s,drawn:new O(e,r,i)}}dependsOn(t){return this.sources.kinds.some(e=>e.inWind&&A.itemsOf(t,e.key).length>0)||t.bodies.some(e=>e.drifting)?["wind"]:[]}inWind(t,s){const e={at:n=>N.at(s,n),levels:s.levels.map(n=>n.aboveGroundM)},a={...t};for(const n of this.sources.kinds){const r=A.itemsOf(t,n.key);!n.inWind||r.length===0||(a[n.key]=r.map(i=>n.inWind(i,e)))}return a.bodies=t.bodies.map(n=>n.drifting?b.drifted(n,N.at(s,10)):n),a}static drifted(t,s){const e=t.track;if(!e||e.length<2)return t;const a=e[0],n=e[e.length-1],r=(n.t-a.t)/1e3;if(r<=0||a.eastM===void 0||n.eastM===void 0||a.northM===void 0||n.northM===void 0)return t;const[i,d]=N.vector(s),o=i-(n.eastM-a.eastM)/r,l=d-(n.northM-a.northM)/r;return{...t,track:e.map(c=>c.eastM===void 0||c.northM===void 0?c:{...c,eastM:c.eastM+o*(c.t-a.t)/1e3,northM:c.northM+l*(c.t-a.t)/1e3})}}async bodiesOf(t){return await A.load(t,this.sources.kinds),A.expand(t,this.sources.kinds).bodies}async replay(t,s,e,a,n,r){const i=this.dependsOn(e),d=m=>{const u=b.summary(n.said.comparisons(m)),p=b.summary(n.drawn.comparisons(m));return{said:u,drawn:p,plausible:b.plausible(u,p)}},o=d(await this.bodiesOf(e)),l=[];for(const m of a){if(r(),i.length===0){l.push({scenario:m,...o});continue}try{const u=await this.sources.wind.profile(m.lat,m.lng,m.date);l.push({scenario:m,...d(await this.bodiesOf(this.inWind(e,u))),groundWind:N.at(u,10)})}catch(u){l.push({scenario:m,...o,plausible:o.plausible,error:u.message})}}const c=l.filter(m=>!m.error),h=b.verdict(o.plausible?"plausible":"excluded",c.map(m=>({scenario:m.scenario,plausible:m.plausible})));return i.length===0&&(h.independent=!0),{url:t,title:s,depends:i,asWritten:o,outcomes:l,verdict:h,kept:[]}}static plausible(t,s){const e=t.compared>0?t:s;return e.compared>0&&e.agreedDirection/e.compared>=b.PLAUSIBLE}static summary(t){const s=t.filter(e=>e.separationDeg!==void 0).map(e=>e.separationDeg).sort((e,a)=>e-a);return{agreed:t.filter(e=>e.agrees).length,compared:t.length,agreedDirection:t.filter(e=>!e.contradicted?.includes("direction")).length,...s.length?{medianDeg:s[Math.floor(s.length/2)],worstDeg:s[s.length-1]}:{}}}static verdict(t,s){const e=s.filter(n=>n.plausible),a=s.length;return a===0?{robustness:t==="plausible"?"robust-plausible":"robust-exclusion",asWritten:t,holds:0,played:0,independent:!0}:e.length===a?{robustness:"robust-plausible",asWritten:t,holds:a,played:a}:e.length===0?{robustness:"robust-exclusion",asWritten:t,holds:0,played:a}:{robustness:"conditional",asWritten:t,onlyIf:b.onlyIf(s),holds:e.length,played:a}}static onlyIf(t){const s=n=>{const r=new Map;for(const d of t)r.set(n(d.scenario),[...r.get(n(d.scenario))??[],d.plausible]);const i=[...r.entries()];return i.every(([,d])=>d.every(o=>o)||d.every(o=>!o))?i.filter(([,d])=>d[0]).map(([d])=>d):void 0},e=s(n=>n.placeId);if(e&&new Set(t.map(n=>n.scenario.placeId)).size>1)return{places:e};const a=s(n=>n.local.slice(0,10));return a&&new Set(t.map(n=>n.scenario.local.slice(0,10))).size>1?{dates:a}:{scenarios:t.filter(n=>n.plausible).map(n=>n.scenario.id)}}static kept(t,s){if(s==="none"||t.verdict.independent)return[];const e=t.outcomes.filter(o=>!o.error);if(s==="all")return e.map(o=>o.scenario);const a=t.verdict.robustness!=="conditional";if(s==="robust"&&!a||s==="conditional"&&a)return[];const n=o=>{const l=o.said.compared>0?o.said:o.drawn;return(l.compared?l.agreedDirection/l.compared:0)-(l.medianDeg??180)/1e4},r=[...e].sort((o,l)=>n(l)-n(o));if(a){const o=t.verdict.robustness==="robust-plausible"?r[r.length-1]:r[0];return o?[o.scenario]:[]}const i=r.find(o=>o.plausible),d=[...r].reverse().find(o=>!o.plausible);return[i,d].filter(o=>!!o).map(o=>o.scenario)}async sky(t,s,e){const a=$(t),n=y.statement(a);if(!n)return s.forEach(e),{replays:[],note:"no-direction"};const{statement:r,t:i}=n,d=new S(this.model,a.account?.conditions,{dateShiftDays:[],mirror:!1}),o=p=>this.sources.names?.(p)??p,l=s.find(p=>p.own)??s[0],c={date:l.date,observer:{lat:l.lat,lng:l.lng,elevationM:0}},h=new Set(y.stars(c,i,r,this.sources.limitAt,b.STARS,b.STAR_MAG).map(({star:p})=>p.name)),m=new Map;for(const p of s){e();const g={date:p.date,observer:{lat:p.lat,lng:p.lng,elevationM:0}},v=[{track:y.body("Moon",o("Moon"),g,i,this.sources.limitAt),kind:"body"},...y.PLANETS.map(M=>({track:y.body(M,o(M),g,i,this.sources.limitAt),kind:"body"})),...y.stars(g,i,{...r,aim:void 0},this.sources.limitAt,1/0,b.STAR_MAG).filter(({star:M})=>h.has(M.name)).map(({star:M,track:D})=>({track:{...D,label:o(M.name)},kind:"star"}))],w=await this.issTrack(g,i);w&&v.push({track:w,kind:"satellite"});for(const{track:M,kind:D}of v){const I=d.fit(r,M);let E=m.get(M.id);E||(E={candidate:M.id,label:M.label,kind:D,outcomes:[],verdict:void 0},m.set(M.id,E)),E.outcomes.push({scenario:p,verdict:I.verdict,cost:I.cost,...I.reason?{reason:I.reason}:{}})}}const u=[...m.values()];for(const p of u){const g=p.outcomes.find(w=>w.scenario.own),v=g?g.verdict==="incompatible"?"excluded":"plausible":p.outcomes.every(w=>w.verdict==="incompatible")?"excluded":"plausible";p.verdict=b.verdict(v,p.outcomes.map(w=>({scenario:w.scenario,plausible:w.verdict!=="incompatible"})))}return{replays:u}}async issTrack(t,s){if(!this.sources.satellites)return;const a=(await this.sources.satellites(t.date).catch(()=>{}))?.find(r=>r.norad===y.ISS_NORAD);if(!a)return;const n=new T([a]);return y.satellite(`satellite-${a.norad}`,this.sources.names?.("ISS")??"ISS",r=>n.positionsAt(r,t.observer,-90).find(i=>i.object.norad===a.norad),t,s,this.sources.limitAt)}static alerts(t){return t.flatMap(s=>s.sky.filter(e=>e.kind!=="star"||e.verdict.robustness!=="robust-exclusion").map(e=>({...s.eventId?{eventId:s.eventId}:{},candidate:e.candidate,label:e.label,robustness:e.verdict.robustness,...e.verdict.onlyIf?{onlyIf:e.verdict.onlyIf}:{}})))}}export{b as ScenarioSweep};
1
+ import{C as P,P as k,q as A,$ as N}from"./rr0-ufoathome.mjs";import{W as R,aS as O,a8 as $,ac as K}from"./ShareDialogElement-DMDY7Hlo.js";import{S as y,C as S}from"./CaseEditorElement-CK82yjEn.js";import{SatellitePasses as T}from"./SatellitePasses-Pfro2-0Z.js";import"./Sighting-C1yj2-s5.js";import"./VisualAids-DI-hEL46.js";import"./three.module-CbaHqYFq.js";import"./SaidPosition-OJEYhVKN.js";import"./GeoProjection-DvqDbRIx.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";import"./ParameterForm-XbqxCLRn.js";import"./ColumnResize-DksRZriL.js";import"./PoherSelfCheck-BjmenygA.js";import"./PoherMatrix-C2fcLqDH.js";import"./TimelineTracks-Daaqw9ly.js";import"./ReentryArchive-CeXHrU7L.js";import"./ReferenceTimeline-2kBldQeG.js";import"./upperAirSources-BU0pD84c.js";import"./Account-C4jhsVtN.js";class f{static MAX_SCENARIOS=200;static KM_PER_DEG=111.32;static merged(t,s){return t?s?{...t,...s}:t:s}static scenarios(t,s){const e=f.places(t,s?.places),a=f.instants(t,s?.time),n=[];for(const r of e)for(const i of a){const d=r.placeId==="own"&&i===f.minute(t.local);n.push({id:`${r.placeId}@${i}`,placeId:r.placeId,...r.placeName?{placeName:r.placeName}:{},lat:r.lat,lng:r.lng,local:i,date:f.utc(i,t.utcOffsetHours),own:d,ownPlace:r.placeId==="own"})}if(n.length>f.MAX_SCENARIOS)throw new Error(`${n.length} scenarios for one account: more than ${f.MAX_SCENARIOS}. Take a coarser step or fewer points.`);return n.sort((r,i)=>Number(i.own)-Number(r.own))}static places(t,s){const e={placeId:"own",...t.placeName?{placeName:t.placeName}:{},lat:t.lat,lng:t.lng},a=s?.own===!1?[]:[e],n=(s?.candidates??[]).filter(r=>!r.for||t.eventId===void 0||r.for.includes(t.eventId)).flatMap(r=>{const i=r.place.locations?.[0];return i?[{placeId:r.id,...r.place.name?{placeName:r.place.name}:{},lat:i.lat,lng:i.lng}]:[]});switch(s?.sweep??"bounds"){case"bounds":return[...a,...n];case"points":{const r=new Set(s?.points??[]);return[...a,...n.filter(i=>r.has(i.placeId))]}case"deltas":return[...a,...(s?.deltasKm??[]).filter(r=>r.eastKm!==0||r.northKm!==0).map(r=>({placeId:`own${r.eastKm>=0?"+":""}${r.eastKm},${r.northKm>=0?"+":""}${r.northKm}km`,...t.placeName?{placeName:t.placeName}:{},lat:t.lat+r.northKm/f.KM_PER_DEG,lng:t.lng+r.eastKm/(f.KM_PER_DEG*Math.cos(t.lat*Math.PI/180))}))];case"step":{const r=s?.stepKm;if(!r||r<=0)throw new Error("A sweep of places by step states its stepKm.");const i=[e,...n],d=Math.min(...i.map(u=>u.lat)),o=Math.max(...i.map(u=>u.lat)),l=Math.min(...i.map(u=>u.lng)),c=Math.max(...i.map(u=>u.lng)),h=f.KM_PER_DEG*Math.cos((d+o)/2*Math.PI/180),m=[];for(let u=0;d+u*r/f.KM_PER_DEG<=o+1e-9;u++)for(let p=0;l+p*r/h<=c+1e-9;p++){const g=d+u*r/f.KM_PER_DEG,v=l+p*r/h;m.push({placeId:`grid${g.toFixed(3)},${v.toFixed(3)}`,lat:g,lng:v})}return[...a,...m]}}}static instants(t,s){const e=f.minute(t.local);if(!s)return[e];const a=f.ms(e),n=f.ms(s.from),r=f.ms(s.to),i=s.each??"day",d=864e5,o=c=>{const h=[];if(i==="day"){const m=a+Math.ceil((n-a)/d)*d;for(let u=m;u<=r;u+=c)h.push(u)}else for(let m=n;m<=r;m+=c)h.push(m);return h};let l;switch(s.sweep??"bounds"){case"bounds":{const c=o(i==="day"?d:6e4);l=c.length>0?[c[0],c[c.length-1]]:[];break}case"points":l=(s.points??[]).map(c=>/T/.test(c)?f.ms(c):f.ms(`${c}T${e.slice(11)}`));break;case"step":l=o((s.stepMinutes??(i==="day"?1440:60))*6e4);break;case"deltas":l=[a,...(s.deltasMinutes??[]).map(c=>a+c*6e4)];break}return[...new Set(l)].sort((c,h)=>c-h).map(c=>new Date(c).toISOString().slice(0,16))}static ms(t){const s=t.replace(/[~?%]$/,"").replace(/(Z|[+-]\d\d:\d\d)$/,""),e=s.length===10?`${s}T00:00`:s,a=Date.parse(`${e}Z`);if(Number.isNaN(a))throw new Error(`Not an instant: ${t}`);return a}static minute(t){return new Date(f.ms(t)).toISOString().slice(0,16)}static utc(t,s){return new Date(f.ms(t)-s*36e5)}}class b{constructor(t){this.sources=t,this.model=t.model??R.MODELS[0]}static PLAUSIBLE=O.MEASURABLE;static DRAWN_STEP_MS=500;static STARS=6;static STAR_MAG=1.5;model;async sweep(t,s={}){const e=(t.events??[]).filter(o=>o.eventType===P.SIGHTING_EVENT&&!o.interpretationOf&&o.url).filter(o=>!s.accounts||o.id!==void 0&&s.accounts.includes(o.id)),a=[],n=await Promise.all(e.map(async o=>{const l=await this.sources.load(o.url),c=s.conditions??f.merged(t.conditions,k.strip(l).recording.conditions),h=f.scenarios(b.conditionsOf(l,o.id),c),m=[o.id,k.strip(l).recording.id].filter(p=>!!p),u=P.interpretationEvents(t,m).filter(p=>p.url&&(!s.readings||s.readings.includes(p.url)));return{event:o,accountJson:l,conditions:c,scenarios:h,readings:u}})),r=n.reduce((o,l)=>o+l.scenarios.length*(l.readings.length+(s.sky===!1?0:1)),0);let i=0;const d=()=>s.progress?.(++i,r);for(const{event:o,accountJson:l,conditions:c,scenarios:h,readings:m}of n){const u={...o.id?{eventId:o.id}:{},url:o.url,title:o.title,scenarios:h,readings:[],sky:[]},p=b.judges(l);for(const g of m){const v=await this.sources.load(g.url),w=k.strip(v).recording.interpretation;if(!w||w.scenario){h.forEach(d);continue}const M=await this.replay(g.url,g.title,w,h,p,d);M.kept=b.kept(M,s.keep??c?.keep??"telling"),u.readings.push(M)}if(s.sky!==!1){const g=await this.sky(l,h,d);u.sky=g.replays,g.note&&(u.skyNote=g.note)}a.push(u)}return{accounts:a,alerts:b.alerts(a)}}static conditionsOf(t,s){const e=k.strip(t).recording,a=e.place?.locations?.[0];if(!e.time||!a)throw new Error(`An account with no time or no place cannot be played elsewhere: ${e.id??s}`);return{...s?{eventId:s}:{},local:e.time,utcOffsetHours:e.utcOffsetHours??Math.round(a.lng/15),lat:a.lat,lng:a.lng,...e.place?.name?{placeName:e.place.name}:{}}}static judges(t){const s=O.forAccount(t),e=$(t),a=k.strip(t).recording.timeline?.keyframes??[],n=Math.max(0,...a.map(d=>d.t)),r=Array.from({length:Math.floor(n/b.DRAWN_STEP_MS)+1},(d,o)=>o*b.DRAWN_STEP_MS),i=K.lawsOf(R.MODELS[0],e.account?.conditions);return{said:s,drawn:new O(e,r,i)}}dependsOn(t){return this.sources.kinds.some(e=>e.inWind&&A.itemsOf(t,e.key).length>0)||t.bodies.some(e=>e.drifting)?["wind"]:[]}inWind(t,s){const e={at:n=>N.at(s,n),levels:s.levels.map(n=>n.aboveGroundM)},a={...t};for(const n of this.sources.kinds){const r=A.itemsOf(t,n.key);!n.inWind||r.length===0||(a[n.key]=r.map(i=>n.inWind(i,e)))}return a.bodies=t.bodies.map(n=>n.drifting?b.drifted(n,N.at(s,10)):n),a}static drifted(t,s){const e=t.track;if(!e||e.length<2)return t;const a=e[0],n=e[e.length-1],r=(n.t-a.t)/1e3;if(r<=0||a.eastM===void 0||n.eastM===void 0||a.northM===void 0||n.northM===void 0)return t;const[i,d]=N.vector(s),o=i-(n.eastM-a.eastM)/r,l=d-(n.northM-a.northM)/r;return{...t,track:e.map(c=>c.eastM===void 0||c.northM===void 0?c:{...c,eastM:c.eastM+o*(c.t-a.t)/1e3,northM:c.northM+l*(c.t-a.t)/1e3})}}async bodiesOf(t){return await A.load(t,this.sources.kinds),A.expand(t,this.sources.kinds).bodies}async replay(t,s,e,a,n,r){const i=this.dependsOn(e),d=m=>{const u=b.summary(n.said.comparisons(m)),p=b.summary(n.drawn.comparisons(m));return{said:u,drawn:p,plausible:b.plausible(u,p)}},o=d(await this.bodiesOf(e)),l=[];for(const m of a){if(r(),i.length===0){l.push({scenario:m,...o});continue}try{const u=await this.sources.wind.profile(m.lat,m.lng,m.date);l.push({scenario:m,...d(await this.bodiesOf(this.inWind(e,u))),groundWind:N.at(u,10)})}catch(u){l.push({scenario:m,...o,plausible:o.plausible,error:u.message})}}const c=l.filter(m=>!m.error),h=b.verdict(o.plausible?"plausible":"excluded",c.map(m=>({scenario:m.scenario,plausible:m.plausible})));return i.length===0&&(h.independent=!0),{url:t,title:s,depends:i,asWritten:o,outcomes:l,verdict:h,kept:[]}}static plausible(t,s){const e=t.compared>0?t:s;return e.compared>0&&e.agreedDirection/e.compared>=b.PLAUSIBLE}static summary(t){const s=t.filter(e=>e.separationDeg!==void 0).map(e=>e.separationDeg).sort((e,a)=>e-a);return{agreed:t.filter(e=>e.agrees).length,compared:t.length,agreedDirection:t.filter(e=>!e.contradicted?.includes("direction")).length,...s.length?{medianDeg:s[Math.floor(s.length/2)],worstDeg:s[s.length-1]}:{}}}static verdict(t,s){const e=s.filter(n=>n.plausible),a=s.length;return a===0?{robustness:t==="plausible"?"robust-plausible":"robust-exclusion",asWritten:t,holds:0,played:0,independent:!0}:e.length===a?{robustness:"robust-plausible",asWritten:t,holds:a,played:a}:e.length===0?{robustness:"robust-exclusion",asWritten:t,holds:0,played:a}:{robustness:"conditional",asWritten:t,onlyIf:b.onlyIf(s),holds:e.length,played:a}}static onlyIf(t){const s=n=>{const r=new Map;for(const d of t)r.set(n(d.scenario),[...r.get(n(d.scenario))??[],d.plausible]);const i=[...r.entries()];return i.every(([,d])=>d.every(o=>o)||d.every(o=>!o))?i.filter(([,d])=>d[0]).map(([d])=>d):void 0},e=s(n=>n.placeId);if(e&&new Set(t.map(n=>n.scenario.placeId)).size>1)return{places:e};const a=s(n=>n.local.slice(0,10));return a&&new Set(t.map(n=>n.scenario.local.slice(0,10))).size>1?{dates:a}:{scenarios:t.filter(n=>n.plausible).map(n=>n.scenario.id)}}static kept(t,s){if(s==="none"||t.verdict.independent)return[];const e=t.outcomes.filter(o=>!o.error);if(s==="all")return e.map(o=>o.scenario);const a=t.verdict.robustness!=="conditional";if(s==="robust"&&!a||s==="conditional"&&a)return[];const n=o=>{const l=o.said.compared>0?o.said:o.drawn;return(l.compared?l.agreedDirection/l.compared:0)-(l.medianDeg??180)/1e4},r=[...e].sort((o,l)=>n(l)-n(o));if(a){const o=t.verdict.robustness==="robust-plausible"?r[r.length-1]:r[0];return o?[o.scenario]:[]}const i=r.find(o=>o.plausible),d=[...r].reverse().find(o=>!o.plausible);return[i,d].filter(o=>!!o).map(o=>o.scenario)}async sky(t,s,e){const a=$(t),n=y.statement(a);if(!n)return s.forEach(e),{replays:[],note:"no-direction"};const{statement:r,t:i}=n,d=new S(this.model,a.account?.conditions,{dateShiftDays:[],mirror:!1}),o=p=>this.sources.names?.(p)??p,l=s.find(p=>p.own)??s[0],c={date:l.date,observer:{lat:l.lat,lng:l.lng,elevationM:0}},h=new Set(y.stars(c,i,r,this.sources.limitAt,b.STARS,b.STAR_MAG).map(({star:p})=>p.name)),m=new Map;for(const p of s){e();const g={date:p.date,observer:{lat:p.lat,lng:p.lng,elevationM:0}},v=[{track:y.body("Moon",o("Moon"),g,i,this.sources.limitAt),kind:"body"},...y.PLANETS.map(M=>({track:y.body(M,o(M),g,i,this.sources.limitAt),kind:"body"})),...y.stars(g,i,{...r,aim:void 0},this.sources.limitAt,1/0,b.STAR_MAG).filter(({star:M})=>h.has(M.name)).map(({star:M,track:D})=>({track:{...D,label:o(M.name)},kind:"star"}))],w=await this.issTrack(g,i);w&&v.push({track:w,kind:"satellite"});for(const{track:M,kind:D}of v){const I=d.fit(r,M);let E=m.get(M.id);E||(E={candidate:M.id,label:M.label,kind:D,outcomes:[],verdict:void 0},m.set(M.id,E)),E.outcomes.push({scenario:p,verdict:I.verdict,cost:I.cost,...I.reason?{reason:I.reason}:{}})}}const u=[...m.values()];for(const p of u){const g=p.outcomes.find(w=>w.scenario.own),v=g?g.verdict==="incompatible"?"excluded":"plausible":p.outcomes.every(w=>w.verdict==="incompatible")?"excluded":"plausible";p.verdict=b.verdict(v,p.outcomes.map(w=>({scenario:w.scenario,plausible:w.verdict!=="incompatible"})))}return{replays:u}}async issTrack(t,s){if(!this.sources.satellites)return;const a=(await this.sources.satellites(t.date).catch(()=>{}))?.find(r=>r.norad===y.ISS_NORAD);if(!a)return;const n=new T([a]);return y.satellite(`satellite-${a.norad}`,this.sources.names?.("ISS")??"ISS",r=>n.positionsAt(r,t.observer,-90).find(i=>i.object.norad===a.norad),t,s,this.sources.limitAt)}static alerts(t){return t.flatMap(s=>s.sky.filter(e=>e.kind!=="star"||e.verdict.robustness!=="robust-exclusion").map(e=>({...s.eventId?{eventId:s.eventId}:{},candidate:e.candidate,label:e.label,robustness:e.verdict.robustness,...e.verdict.onlyIf?{onlyIf:e.verdict.onlyIf}:{}})))}}export{b as ScenarioSweep};
@@ -1,4 +1,4 @@
1
- import{M as c,_ as n}from"./rr0-ufoathome.mjs";import{b as g,P as d}from"./SaidPosition-OJEYhVKN.js";import{bq as r,bb as p}from"./ShareDialogElement-C0oFh0X4.js";import{S as u}from"./SkyEventEditorStyle-CvY_AhbI.js";import{P as f,a as _,E}from"./ParameterForm-XbqxCLRn.js";import"./GeoProjection-DvqDbRIx.js";import"./Sighting-BX_CmDY2.js";import"./VisualAids-DI-hEL46.js";import"./three.module-CbaHqYFq.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";const v=c.catalog({en:()=>n(()=>import("./SearchlightParameterTexts_en-BwanYoMW.js"),[],import.meta.url).then(i=>i.searchlightParameterTexts_en),fr:()=>n(()=>import("./SearchlightParameterTexts_fr-B7eZQIdG.js"),[],import.meta.url).then(i=>i.searchlightParameterTexts_fr),es:()=>n(()=>import("./SearchlightParameterTexts_es-Cz_rg-Xe.js"),[],import.meta.url).then(i=>i.searchlightParameterTexts_es),it:()=>n(()=>import("./SearchlightParameterTexts_it-BjhuOJre.js"),[],import.meta.url).then(i=>i.searchlightParameterTexts_it)}),y=c.catalog({en:()=>n(()=>import("./SearchlightEditorMessages_en-BWTcGHYC.js"),[],import.meta.url).then(i=>i.searchlightEditorMessages_en),fr:()=>n(()=>import("./SearchlightEditorMessages_fr-CpaD2Il2.js"),[],import.meta.url).then(i=>i.searchlightEditorMessages_fr),es:()=>n(()=>import("./SearchlightEditorMessages_es-PS4IIWFS.js"),[],import.meta.url).then(i=>i.searchlightEditorMessages_es),it:()=>n(()=>import("./SearchlightEditorMessages_it-Br2IjowF.js"),[],import.meta.url).then(i=>i.searchlightEditorMessages_it)});class h{static time(t,e,s){return{type:"number",key:t,min:-36e3,max:36e3,step:1,unit:"s",scale:.001,label:e,hint:s,group:"when"}}static of(t){return t}static SET={kind:"searchlight",title:"searchlight",parameters:[{type:"said",key:"title",label:"name",group:"searchlight"},{type:"position",key:"lat",secondKey:"lng",saidKey:"saidPosition",native:"geo",step:1,label:"position",group:"searchlight"},{type:"number",key:"heightM",min:0,max:500,step:.5,unit:"m",label:"height",hint:"heightHint",group:"searchlight",effective:()=>r.DEFAULT_HEIGHT_M},{type:"number",key:"beams",min:1,max:r.MAX_BEAMS,step:1,label:"beams",hint:"beamsHint",group:"lamp",effective:()=>1},{type:"number",key:"intensityCd",min:1e4,max:1e10,step:1e6,unit:"cd",label:"intensity",hint:"intensityHint",group:"lamp",effective:()=>r.DEFAULT_INTENSITY_CD},{type:"number",key:"divergenceDeg",min:.1,max:20,step:.1,unit:"°",label:"divergence",hint:"divergenceHint",group:"lamp",effective:()=>r.DEFAULT_DIVERGENCE_DEG},{type:"number",key:"colourTemperatureK",min:2e3,max:1e4,step:100,unit:"K",label:"temperature",hint:"temperatureHint",group:"lamp",effective:()=>r.DEFAULT_TEMPERATURE_K},{type:"choice",key:"motion",label:"pattern",hint:"patternHint",group:"motion",effective:t=>r.motionOf(h.of(t)),choices:[{value:"fixed",label:"fixed"},{value:"sweep",label:"sweep"},{value:"rotate",label:"rotate"},{value:"cloverleaf",label:"cloverleaf"}]},{type:"number",key:"tiltDeg",min:0,max:85,step:1,unit:"°",label:"tilt",hint:"tiltHint",group:"motion",effective:()=>r.DEFAULT_TILT_DEG},{type:"number",key:"spreadDeg",min:0,max:360,step:1,unit:"°",label:"spread",hint:"spreadHint",group:"motion",effective:()=>r.DEFAULT_SPREAD_DEG,visibleWhen:t=>r.motionOf(h.of(t))==="sweep"},{type:"number",key:"azimuthDeg",min:0,max:360,step:1,unit:"°",label:"azimuth",hint:"azimuthHint",group:"motion",effective:()=>0},{type:"number",key:"periodS",min:.5,max:600,step:.5,unit:"s",label:"period",hint:"periodHint",group:"motion",effective:()=>r.DEFAULT_PERIOD_S,visibleWhen:t=>r.motionOf(h.of(t))!=="fixed"},h.time("fromT","from","fromHint"),h.time("untilT","until","untilHint")]};static publish(){g.publish(h.SET)}}class m{constructor(t,e,s){this.container=t,this.host=e,u.attach(t,"searchlight-editor-part",m.STYLE),this.language=s,g.of("searchlight")||h.publish(),this.ready=this.setLanguage(s)}messages;parameterTexts;ready;languageToken=0;currentId;form;list;language;shown=[];static STYLE=".searchlight-editor-part { flex-basis: 100%; min-width: 0; } .searchlight-editor-part .searchlight-editor, .searchlight-editor-part .searchlight-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; } .searchlight-editor-part #searchlight-list, .searchlight-editor-part .searchlight-fields { flex-basis: 100%; min-width: 0; } .searchlight-editor-part [hidden] { display: none !important; } .searchlight-editor-part .searchlight-intro { flex-basis: 100%; margin: 0; } .searchlight-editor-part .searchlight-parameters { flex-basis: 100%; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; } .searchlight-editor-part .parameter-group { flex: 1 1 14em; min-width: 0; box-sizing: border-box; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-start; align-content: flex-start; } .searchlight-editor-part input, .searchlight-editor-part select { max-width: 100%; box-sizing: border-box; } .searchlight-editor-part label { min-width: 0; max-width: 100%; } .searchlight-editor-part input.parameter-derived::placeholder { opacity: .65; }";async setLanguage(t){const e=++this.languageToken;this.language=t;const[s,l]=await Promise.all([y.load(t),v.load(t)]);e===this.languageToken&&(this.messages=s,this.parameterTexts=l,this.render(),this.sync())}sync(){if(!this.messages)return;const t=this.searchlights;this.shown=[...t],t.some(a=>a.id===this.currentId)||(this.currentId=t[0]?.id),this.list?.setItems(t.map(a=>({id:a.id,label:this.labelOf(a)})),this.currentId);const e=this.placeOfNew()!==void 0;this.list?.setAddState(e,e?void 0:this.messages.addNowhere);const s=this.current;if(this.element("searchlight-fields").hidden=s===void 0,!s)return;const l=d.resolve(g.of("searchlight"),this.parameterTexts);this.form??=new f(this.element("searchlight-parameters"),this.language,"",{said:()=>this.host.said(),writingLanguage:()=>this.host.writingLanguage()}),this.form.show(l,new _(()=>this.current,a=>{const o=this.current;o&&a(o)},void 0,this.host.positionPlace?.()),()=>this.host.changed())}refresh(){if(!this.messages)return;const t=this.searchlights;t.length===this.shown.length&&t.every((e,s)=>e===this.shown[s])||this.sync()}setTime(t){}get current(){return this.searchlights.find(t=>t.id===this.currentId)}render(){const t=this.messages;this.form=void 0,this.container.innerHTML=`<div class="searchlight-editor">
1
+ import{M as c,_ as n}from"./rr0-ufoathome.mjs";import{b as g,P as d}from"./SaidPosition-OJEYhVKN.js";import{bq as r,bb as p}from"./ShareDialogElement-DMDY7Hlo.js";import{S as u}from"./SkyEventEditorStyle-CvY_AhbI.js";import{P as f,a as _,E}from"./ParameterForm-XbqxCLRn.js";import"./GeoProjection-DvqDbRIx.js";import"./Sighting-C1yj2-s5.js";import"./VisualAids-DI-hEL46.js";import"./three.module-CbaHqYFq.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";const v=c.catalog({en:()=>n(()=>import("./SearchlightParameterTexts_en-BwanYoMW.js"),[],import.meta.url).then(i=>i.searchlightParameterTexts_en),fr:()=>n(()=>import("./SearchlightParameterTexts_fr-B7eZQIdG.js"),[],import.meta.url).then(i=>i.searchlightParameterTexts_fr),es:()=>n(()=>import("./SearchlightParameterTexts_es-Cz_rg-Xe.js"),[],import.meta.url).then(i=>i.searchlightParameterTexts_es),it:()=>n(()=>import("./SearchlightParameterTexts_it-BjhuOJre.js"),[],import.meta.url).then(i=>i.searchlightParameterTexts_it)}),y=c.catalog({en:()=>n(()=>import("./SearchlightEditorMessages_en-BWTcGHYC.js"),[],import.meta.url).then(i=>i.searchlightEditorMessages_en),fr:()=>n(()=>import("./SearchlightEditorMessages_fr-CpaD2Il2.js"),[],import.meta.url).then(i=>i.searchlightEditorMessages_fr),es:()=>n(()=>import("./SearchlightEditorMessages_es-PS4IIWFS.js"),[],import.meta.url).then(i=>i.searchlightEditorMessages_es),it:()=>n(()=>import("./SearchlightEditorMessages_it-Br2IjowF.js"),[],import.meta.url).then(i=>i.searchlightEditorMessages_it)});class h{static time(t,e,s){return{type:"number",key:t,min:-36e3,max:36e3,step:1,unit:"s",scale:.001,label:e,hint:s,group:"when"}}static of(t){return t}static SET={kind:"searchlight",title:"searchlight",parameters:[{type:"said",key:"title",label:"name",group:"searchlight"},{type:"position",key:"lat",secondKey:"lng",saidKey:"saidPosition",native:"geo",step:1,label:"position",group:"searchlight"},{type:"number",key:"heightM",min:0,max:500,step:.5,unit:"m",label:"height",hint:"heightHint",group:"searchlight",effective:()=>r.DEFAULT_HEIGHT_M},{type:"number",key:"beams",min:1,max:r.MAX_BEAMS,step:1,label:"beams",hint:"beamsHint",group:"lamp",effective:()=>1},{type:"number",key:"intensityCd",min:1e4,max:1e10,step:1e6,unit:"cd",label:"intensity",hint:"intensityHint",group:"lamp",effective:()=>r.DEFAULT_INTENSITY_CD},{type:"number",key:"divergenceDeg",min:.1,max:20,step:.1,unit:"°",label:"divergence",hint:"divergenceHint",group:"lamp",effective:()=>r.DEFAULT_DIVERGENCE_DEG},{type:"number",key:"colourTemperatureK",min:2e3,max:1e4,step:100,unit:"K",label:"temperature",hint:"temperatureHint",group:"lamp",effective:()=>r.DEFAULT_TEMPERATURE_K},{type:"choice",key:"motion",label:"pattern",hint:"patternHint",group:"motion",effective:t=>r.motionOf(h.of(t)),choices:[{value:"fixed",label:"fixed"},{value:"sweep",label:"sweep"},{value:"rotate",label:"rotate"},{value:"cloverleaf",label:"cloverleaf"}]},{type:"number",key:"tiltDeg",min:0,max:85,step:1,unit:"°",label:"tilt",hint:"tiltHint",group:"motion",effective:()=>r.DEFAULT_TILT_DEG},{type:"number",key:"spreadDeg",min:0,max:360,step:1,unit:"°",label:"spread",hint:"spreadHint",group:"motion",effective:()=>r.DEFAULT_SPREAD_DEG,visibleWhen:t=>r.motionOf(h.of(t))==="sweep"},{type:"number",key:"azimuthDeg",min:0,max:360,step:1,unit:"°",label:"azimuth",hint:"azimuthHint",group:"motion",effective:()=>0},{type:"number",key:"periodS",min:.5,max:600,step:.5,unit:"s",label:"period",hint:"periodHint",group:"motion",effective:()=>r.DEFAULT_PERIOD_S,visibleWhen:t=>r.motionOf(h.of(t))!=="fixed"},h.time("fromT","from","fromHint"),h.time("untilT","until","untilHint")]};static publish(){g.publish(h.SET)}}class m{constructor(t,e,s){this.container=t,this.host=e,u.attach(t,"searchlight-editor-part",m.STYLE),this.language=s,g.of("searchlight")||h.publish(),this.ready=this.setLanguage(s)}messages;parameterTexts;ready;languageToken=0;currentId;form;list;language;shown=[];static STYLE=".searchlight-editor-part { flex-basis: 100%; min-width: 0; } .searchlight-editor-part .searchlight-editor, .searchlight-editor-part .searchlight-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; } .searchlight-editor-part #searchlight-list, .searchlight-editor-part .searchlight-fields { flex-basis: 100%; min-width: 0; } .searchlight-editor-part [hidden] { display: none !important; } .searchlight-editor-part .searchlight-intro { flex-basis: 100%; margin: 0; } .searchlight-editor-part .searchlight-parameters { flex-basis: 100%; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; } .searchlight-editor-part .parameter-group { flex: 1 1 14em; min-width: 0; box-sizing: border-box; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-start; align-content: flex-start; } .searchlight-editor-part input, .searchlight-editor-part select { max-width: 100%; box-sizing: border-box; } .searchlight-editor-part label { min-width: 0; max-width: 100%; } .searchlight-editor-part input.parameter-derived::placeholder { opacity: .65; }";async setLanguage(t){const e=++this.languageToken;this.language=t;const[s,l]=await Promise.all([y.load(t),v.load(t)]);e===this.languageToken&&(this.messages=s,this.parameterTexts=l,this.render(),this.sync())}sync(){if(!this.messages)return;const t=this.searchlights;this.shown=[...t],t.some(a=>a.id===this.currentId)||(this.currentId=t[0]?.id),this.list?.setItems(t.map(a=>({id:a.id,label:this.labelOf(a)})),this.currentId);const e=this.placeOfNew()!==void 0;this.list?.setAddState(e,e?void 0:this.messages.addNowhere);const s=this.current;if(this.element("searchlight-fields").hidden=s===void 0,!s)return;const l=d.resolve(g.of("searchlight"),this.parameterTexts);this.form??=new f(this.element("searchlight-parameters"),this.language,"",{said:()=>this.host.said(),writingLanguage:()=>this.host.writingLanguage()}),this.form.show(l,new _(()=>this.current,a=>{const o=this.current;o&&a(o)},void 0,this.host.positionPlace?.()),()=>this.host.changed())}refresh(){if(!this.messages)return;const t=this.searchlights;t.length===this.shown.length&&t.every((e,s)=>e===this.shown[s])||this.sync()}setTime(t){}get current(){return this.searchlights.find(t=>t.id===this.currentId)}render(){const t=this.messages;this.form=void 0,this.container.innerHTML=`<div class="searchlight-editor">
2
2
  <p class="searchlight-intro">${t.intro}</p>
3
3
  <div id="searchlight-list"></div>
4
4
  <div id="searchlight-fields" class="searchlight-fields">
@@ -1 +1 @@
1
- import{BeamSystem as L}from"./BeamSystem-C8jjTJtB.js";import{L as x}from"./LaserBeam-ChD9aV-N.js";import{bp as N,bq as r,br as U,t as D}from"./ShareDialogElement-C0oFh0X4.js";import"./three.module-CbaHqYFq.js";import"./rr0-ufoathome.mjs";import"./Sighting-BX_CmDY2.js";import"./VisualAids-DI-hEL46.js";import"./SaidPosition-OJEYhVKN.js";import"./GeoProjection-DvqDbRIx.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";class E{static APERTURE_M=.6;static NEAR_STEP_M=10;static FAR_STEP_M=250;static STEP_SHARE=.05;static CLOUD_STEP_M=25;static SPENT=.003;beams=new L;placed;lineOwners=[];constructor(){this.beams.group.name="searchlights"}get object(){return this.beams.group}get drawnCount(){return this.beams.drawnCount}update(a,s,t){const c=[],M=[];this.lineOwners=[];const i=t.clouds;i?i.dim(this.beams.material):N.apply(this.beams.material,[]);const l=t.wind??{eastMS:0,northMS:0};for(const o of r.onAt(a,s)){const A=this.whereOf(o,t.reference),g=t.origin.x+A.eastM*t.eastScale,d=t.origin.z-A.northM,u=t.groundYAt(g,d)+(o.heightM??r.DEFAULT_HEIGHT_M),e=o.intensityCd??r.DEFAULT_INTENSITY_CD,b=o.divergenceDeg??r.DEFAULT_DIVERGENCE_DEG,S=b*Math.PI/180,m=r.fluxLm(e,b),n=U.ofTemperature(o.colourTemperatureK??r.DEFAULT_TEMPERATURE_K),w=L.white(n);r.aimsAt(o,s).forEach((T,_)=>{const p=r.axisOf(T),h={x:p.east,y:p.up,z:-p.north},P={windAlongMS:l.eastMS*p.east+l.northMS*p.north,windAcrossMS:l.eastMS*p.north-l.northMS*p.east},{points:y,throughBelow:I}=this.walk({x:g,y:u,z:d},h,S,m,s,t,P);if(c.push({id:o.id,points:y,spectrum:w}),this.lineOwners.push({id:o.id,beam:_}),i&&h.y>.02&&i.bottomY>u){const v=(i.bottomY-u)/h.y,R=t.air.transmittance(t.siteElevationM+u,t.siteElevationM+i.bottomY,v),C=e*t.relativeScale;M.push({x:g,y:u,z:d,axis:h,fwhmRad:S,rgb:[C*n[0]*R[0],C*n[1]*R[1],C*n[2]*R[2]],throughCloudsBelow:I})}})}this.beams.drawLines(c,t),t.lightClouds?.(M)}walk(a,s,t,c,M,i,l){const o=i.clouds,A=[],g=[],d=[],u=i.siteElevationM+a.y;let e=0,b=0;for(;;){const m=a.x+s.x*e,n=a.y+s.y*e,w=a.z+s.z*e,T=o!==void 0&&n>=o.bottomY&&n<=o.topY,_=Math.exp(-b),p=e>0?i.air.transmittance(u,i.siteElevationM+n,e)[1]:1;if(A.push({x:m,y:n,z:w,altitudeM:i.siteElevationM+n,widthM:E.APERTURE_M+t*e,powerW:c*p*_,haze:x.patchAt(e,M,{...l,patchiness:x.DEFAULT_PATCHINESS})}),g.push(n),d.push(_),e>=r.RANGE_M||n>=r.CEILING_M||_<E.SPENT)break;const h=T?E.CLOUD_STEP_M:Math.min(E.FAR_STEP_M,Math.max(E.NEAR_STEP_M,e*E.STEP_SHARE));if(o&&(T||n<o.bottomY&&n+s.y*h>o.bottomY)){const P=T?h:Math.max(0,(o.bottomY-n)/Math.max(s.y,1e-6));if(!T){e+=Math.max(1,P);continue}b+=o.extinctionAt(m+s.x*h/2,n+s.y*h/2,w+s.z*h/2)*h}e+=h}return{points:A,throughBelow:m=>{const n=g.findIndex(w=>w>=m);return n<0?d[d.length-1]:d[n]}}}whereOf(a,s){(!this.placed||this.placed.lat!==s.lat||this.placed.lng!==s.lng)&&(this.placed={...s,at:new Map});let t=this.placed.at.get(a);if(!t){const c=D.ecef({lat:s.lat,lng:s.lng,heightM:0}),M=D.ecef({lat:a.lat,lng:a.lng,heightM:0}),i=s.lat*Math.PI/180,l=s.lng*Math.PI/180,o=[M[0]-c[0],M[1]-c[1],M[2]-c[2]];t={eastM:-Math.sin(l)*o[0]+Math.cos(l)*o[1],northM:-Math.sin(i)*Math.cos(l)*o[0]-Math.sin(i)*Math.sin(l)*o[1]+Math.cos(i)*o[2]},this.placed.at.set(a,t)}return t}pick(a,s,t){const c=this.beams.pickAt(a,s,t.toleranceRad);if(c)return{id:c.id,distanceM:c.distanceM,detail:{beam:(this.lineOwners[c.line]?.beam??0)+1}}}dispose(){this.beams.dispose()}}export{E as SearchlightSystem};
1
+ import{BeamSystem as L}from"./BeamSystem-BbSsBbZk.js";import{L as x}from"./LaserBeam-CDTsYUwS.js";import{bp as N,bq as r,br as U,t as D}from"./ShareDialogElement-DMDY7Hlo.js";import"./three.module-CbaHqYFq.js";import"./rr0-ufoathome.mjs";import"./Sighting-C1yj2-s5.js";import"./VisualAids-DI-hEL46.js";import"./SaidPosition-OJEYhVKN.js";import"./GeoProjection-DvqDbRIx.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";class E{static APERTURE_M=.6;static NEAR_STEP_M=10;static FAR_STEP_M=250;static STEP_SHARE=.05;static CLOUD_STEP_M=25;static SPENT=.003;beams=new L;placed;lineOwners=[];constructor(){this.beams.group.name="searchlights"}get object(){return this.beams.group}get drawnCount(){return this.beams.drawnCount}update(a,s,t){const c=[],M=[];this.lineOwners=[];const i=t.clouds;i?i.dim(this.beams.material):N.apply(this.beams.material,[]);const l=t.wind??{eastMS:0,northMS:0};for(const o of r.onAt(a,s)){const A=this.whereOf(o,t.reference),g=t.origin.x+A.eastM*t.eastScale,d=t.origin.z-A.northM,u=t.groundYAt(g,d)+(o.heightM??r.DEFAULT_HEIGHT_M),e=o.intensityCd??r.DEFAULT_INTENSITY_CD,b=o.divergenceDeg??r.DEFAULT_DIVERGENCE_DEG,S=b*Math.PI/180,m=r.fluxLm(e,b),n=U.ofTemperature(o.colourTemperatureK??r.DEFAULT_TEMPERATURE_K),w=L.white(n);r.aimsAt(o,s).forEach((T,_)=>{const p=r.axisOf(T),h={x:p.east,y:p.up,z:-p.north},P={windAlongMS:l.eastMS*p.east+l.northMS*p.north,windAcrossMS:l.eastMS*p.north-l.northMS*p.east},{points:y,throughBelow:I}=this.walk({x:g,y:u,z:d},h,S,m,s,t,P);if(c.push({id:o.id,points:y,spectrum:w}),this.lineOwners.push({id:o.id,beam:_}),i&&h.y>.02&&i.bottomY>u){const v=(i.bottomY-u)/h.y,R=t.air.transmittance(t.siteElevationM+u,t.siteElevationM+i.bottomY,v),C=e*t.relativeScale;M.push({x:g,y:u,z:d,axis:h,fwhmRad:S,rgb:[C*n[0]*R[0],C*n[1]*R[1],C*n[2]*R[2]],throughCloudsBelow:I})}})}this.beams.drawLines(c,t),t.lightClouds?.(M)}walk(a,s,t,c,M,i,l){const o=i.clouds,A=[],g=[],d=[],u=i.siteElevationM+a.y;let e=0,b=0;for(;;){const m=a.x+s.x*e,n=a.y+s.y*e,w=a.z+s.z*e,T=o!==void 0&&n>=o.bottomY&&n<=o.topY,_=Math.exp(-b),p=e>0?i.air.transmittance(u,i.siteElevationM+n,e)[1]:1;if(A.push({x:m,y:n,z:w,altitudeM:i.siteElevationM+n,widthM:E.APERTURE_M+t*e,powerW:c*p*_,haze:x.patchAt(e,M,{...l,patchiness:x.DEFAULT_PATCHINESS})}),g.push(n),d.push(_),e>=r.RANGE_M||n>=r.CEILING_M||_<E.SPENT)break;const h=T?E.CLOUD_STEP_M:Math.min(E.FAR_STEP_M,Math.max(E.NEAR_STEP_M,e*E.STEP_SHARE));if(o&&(T||n<o.bottomY&&n+s.y*h>o.bottomY)){const P=T?h:Math.max(0,(o.bottomY-n)/Math.max(s.y,1e-6));if(!T){e+=Math.max(1,P);continue}b+=o.extinctionAt(m+s.x*h/2,n+s.y*h/2,w+s.z*h/2)*h}e+=h}return{points:A,throughBelow:m=>{const n=g.findIndex(w=>w>=m);return n<0?d[d.length-1]:d[n]}}}whereOf(a,s){(!this.placed||this.placed.lat!==s.lat||this.placed.lng!==s.lng)&&(this.placed={...s,at:new Map});let t=this.placed.at.get(a);if(!t){const c=D.ecef({lat:s.lat,lng:s.lng,heightM:0}),M=D.ecef({lat:a.lat,lng:a.lng,heightM:0}),i=s.lat*Math.PI/180,l=s.lng*Math.PI/180,o=[M[0]-c[0],M[1]-c[1],M[2]-c[2]];t={eastM:-Math.sin(l)*o[0]+Math.cos(l)*o[1],northM:-Math.sin(i)*Math.cos(l)*o[0]-Math.sin(i)*Math.sin(l)*o[1]+Math.cos(i)*o[2]},this.placed.at.set(a,t)}return t}pick(a,s,t){const c=this.beams.pickAt(a,s,t.toleranceRad);if(c)return{id:c.id,distanceM:c.distanceM,detail:{beam:(this.lineOwners[c.line]?.beam??0)+1}}}dispose(){this.beams.dispose()}}export{E as SearchlightSystem};