@rr0/ufoathome 0.202.0 → 0.202.1

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 (98) hide show
  1. package/dist-embed-scene/{AirshipEditor-BnRmKeVs.js → AirshipEditor-guE_ib3z.js} +1 -1
  2. package/dist-embed-scene/{AirshipFlight-C9DSPGwk.js → AirshipFlight-DzW0313e.js} +1 -1
  3. package/dist-embed-scene/{BalloonEditor-BehJs6H-.js → BalloonEditor-BIsCy_y4.js} +2 -2
  4. package/dist-embed-scene/{BalloonFlight-BYn4diw1.js → BalloonFlight-gunghgAq.js} +1 -1
  5. package/dist-embed-scene/{BirdEditor-dOp1sGsz.js → BirdEditor-CuLv4Ij5.js} +1 -1
  6. package/dist-embed-scene/{BirdFlock-CfJeXvWu.js → BirdFlock-L3dYU2K_.js} +1 -1
  7. package/dist-embed-scene/{DroneEditor-CBoR4fJ_.js → DroneEditor-BQWPhTyf.js} +1 -1
  8. package/dist-embed-scene/{DroneFlight-DSE1OXqh.js → DroneFlight-ERYah68l.js} +1 -1
  9. package/dist-embed-scene/{DroneParameters-D3EOg4oe.js → DroneParameters-CoWQympS.js} +1 -1
  10. package/dist-embed-scene/{LanternEditor-CbcA7K8y.js → LanternEditor-BpCyb79i.js} +1 -1
  11. package/dist-embed-scene/{ModuleSession-XnOI5Mcr.js → ModuleSession-bj7QHWjO.js} +2 -2
  12. package/dist-embed-scene/ModuleThree-DRsA8rtL.js +1 -0
  13. package/dist-embed-scene/SearchlightSystem-Ddws2hQY.js +1 -0
  14. package/dist-embed-scene/{SkyLantern-Dp_B40X0.js → SkyLantern-C3BSxHtq.js} +1 -1
  15. package/dist-embed-scene/rr0-scene.mjs +85 -64
  16. package/dist-embed-sighting/{CaseReportExport-CkWf0HNx.js → CaseReportExport-BtGCWD7H.js} +1 -1
  17. package/dist-embed-sighting/{ModuleSession-ChJsGuTn.js → ModuleSession-DztK084a.js} +2 -2
  18. package/dist-embed-sighting/{ModuleThree-whEZoXYF.js → ModuleThree-BLNSm2eY.js} +1 -1
  19. package/dist-embed-sighting/SearchlightSystem-PEMBDW1s.js +1 -0
  20. package/dist-embed-sighting/rr0-sighting.mjs +90 -69
  21. package/dist-embed-sighting-editor/{BallesterGuaspAssessor-Bylahnc2.js → BallesterGuaspAssessor-CJyRqwvh.js} +1 -1
  22. package/dist-embed-sighting-editor/{CaseElement-DPlro-7S.js → CaseElement-D80gHg4r.js} +1 -1
  23. package/dist-embed-sighting-editor/{CaseReportExport-C1g5C8hi.js → CaseReportExport-Bv6FWPs2.js} +1 -1
  24. package/dist-embed-sighting-editor/{ControlPasses-BMEmppip.js → ControlPasses-CaVHMhEY.js} +1 -1
  25. package/dist-embed-sighting-editor/{CoverageAssessor-uzQnTEH8.js → CoverageAssessor-CTfHqAd_.js} +1 -1
  26. package/dist-embed-sighting-editor/{GLTFLoader-2Zbfb3kh.js → GLTFLoader-CrRPu-Pt.js} +1 -1
  27. package/dist-embed-sighting-editor/{HeadlightSystem-CBmEcC9f.js → HeadlightSystem-BmPfcHt1.js} +1 -1
  28. package/dist-embed-sighting-editor/{HynekAssessor-uub2VxTi.js → HynekAssessor-nBidt6QV.js} +1 -1
  29. package/dist-embed-sighting-editor/{InterviewEditorElement-_1fa2bG7.js → InterviewEditorElement-CQWfYlGL.js} +2 -2
  30. package/dist-embed-sighting-editor/{ModuleConformance-Cr6fM28A.js → ModuleConformance-CpMYkYgb.js} +2 -2
  31. package/dist-embed-sighting-editor/{ModuleSession-WA6lqfV6.js → ModuleSession-b_pmjUfP.js} +2 -2
  32. package/dist-embed-sighting-editor/ModuleThree-B_FZVqsf.js +1 -0
  33. package/dist-embed-sighting-editor/{ModulesPanelElement-BsRg3mzl.js → ModulesPanelElement-D0gn9Z-y.js} +3 -3
  34. package/dist-embed-sighting-editor/{NearestApproach-Bnx9Ld5_.js → NearestApproach-Bxo_N7a9.js} +1 -1
  35. package/dist-embed-sighting-editor/{PoherAssessor-CNj_Nyci.js → PoherAssessor-CEVA26zd.js} +1 -1
  36. package/dist-embed-sighting-editor/{RailwaySystem-6bwbv8UB.js → RailwaySystem-Ceb0_MVz.js} +1 -1
  37. package/dist-embed-sighting-editor/{ReferenceSystem-8QgwbbAG.js → ReferenceSystem-B15kw0uH.js} +1 -1
  38. package/dist-embed-sighting-editor/SearchlightSystem-D7sdsRYn.js +1 -0
  39. package/dist-embed-sighting-editor/{SightingElement-BQdiez39.js → SightingElement-Bp-t_EAF.js} +1 -1
  40. package/dist-embed-sighting-editor/{TraceSystem-DZMUxSn-.js → TraceSystem-Bv4kLpie.js} +2 -2
  41. package/dist-embed-sighting-editor/{WaterSystem-CB5jE7qB.js → WaterSystem-Bbk_RJKg.js} +1 -1
  42. package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +193 -172
  43. package/dist-embed-ufoathome/{AdsbLolArchiveProvider-KbJPyJ97.js → AdsbLolArchiveProvider-v1sSwhN1.js} +1 -1
  44. package/dist-embed-ufoathome/{Aurora-C_mCH4JM.js → Aurora-Dc4u2vEw.js} +1 -1
  45. package/dist-embed-ufoathome/{AuroraEditor-Dzvgh6e0.js → AuroraEditor-CeLzRDPj.js} +1 -1
  46. package/dist-embed-ufoathome/{AuroraSimulation-BRUnHmlp.js → AuroraSimulation-BT1CdWX5.js} +1 -1
  47. package/dist-embed-ufoathome/{BallesterGuaspAssessor-DurdUgbG.js → BallesterGuaspAssessor-CPW-Omah.js} +1 -1
  48. package/dist-embed-ufoathome/{BeamEditor-Ccvx7l7x.js → BeamEditor-BS73mBZU.js} +1 -1
  49. package/dist-embed-ufoathome/{BeamSystem-CPM8m17q.js → BeamSystem-C5EpRhij.js} +1 -1
  50. package/dist-embed-ufoathome/{BodyEditor-BG--NjnZ.js → BodyEditor-BV8WwzAj.js} +1 -1
  51. package/dist-embed-ufoathome/{CaseEditorElement-0J_TCeiq.js → CaseEditorElement-HR8RFluQ.js} +6 -6
  52. package/dist-embed-ufoathome/{CaseElement-CRXPyMMR.js → CaseElement-vCbCfGOv.js} +3 -3
  53. package/dist-embed-ufoathome/{CaseReportExport-DKrBXPgZ.js → CaseReportExport-XLbFCkPg.js} +3 -3
  54. package/dist-embed-ufoathome/{ColumnResize-DV-byvDt.js → ColumnResize-CEXrq3KB.js} +3 -3
  55. package/dist-embed-ufoathome/{ControlPasses-CKvTCqTI.js → ControlPasses-CKOU_3lG.js} +1 -1
  56. package/dist-embed-ufoathome/{CoverageAssessor-MeOMUjkZ.js → CoverageAssessor-BYMf3Qhv.js} +1 -1
  57. package/dist-embed-ufoathome/{Flightradar24Provider-DxTfswSh.js → Flightradar24Provider-_QPbhh5s.js} +1 -1
  58. package/dist-embed-ufoathome/{GLTFLoader-pi-JKaNa.js → GLTFLoader-DQeHB-Bk.js} +1 -1
  59. package/dist-embed-ufoathome/{GeoJsonExport-iyhoKOUU.js → GeoJsonExport-Pq_pPvjK.js} +1 -1
  60. package/dist-embed-ufoathome/{GeographicFigures-DBmuFlvH.js → GeographicFigures-KII55iXE.js} +1 -1
  61. package/dist-embed-ufoathome/{HynekAssessor-Bda6csgM.js → HynekAssessor-wCDhgIB8.js} +1 -1
  62. package/dist-embed-ufoathome/{InterviewEditorElement-BA060rqJ.js → InterviewEditorElement-BSwkegEp.js} +4 -4
  63. package/dist-embed-ufoathome/{InterviewElement-DvqsCA3I.js → InterviewElement-CfkDtybc.js} +1 -1
  64. package/dist-embed-ufoathome/{KmlExport-DEPgRRWe.js → KmlExport-BMNwwys8.js} +1 -1
  65. package/dist-embed-ufoathome/{LaserBeam--dquPX_h.js → LaserBeam-B-tlAzNB.js} +1 -1
  66. package/dist-embed-ufoathome/{LaunchEditor-D3P0GkLr.js → LaunchEditor-Cy5D-gwU.js} +1 -1
  67. package/dist-embed-ufoathome/{LaunchPlume-w4l4TR4A.js → LaunchPlume-D-vSb8tJ.js} +1 -1
  68. package/dist-embed-ufoathome/{LaunchSimulation-BpZd-Nov.js → LaunchSimulation-CZ8Oba00.js} +1 -1
  69. package/dist-embed-ufoathome/{ModelSource-Csnm3RH_.js → ModelSource-HSiigkeO.js} +1 -1
  70. package/dist-embed-ufoathome/{ModelThumbnails-Cnt2GxTb.js → ModelThumbnails-DWvRMmj_.js} +1 -1
  71. package/dist-embed-ufoathome/{ModelViewer-DOfAkPgK.js → ModelViewer-CM7qTW8F.js} +1 -1
  72. package/dist-embed-ufoathome/{ModulesPanelElement-DH1oroWm.js → ModulesPanelElement-DsOa2zH0.js} +1 -1
  73. package/dist-embed-ufoathome/{NearestApproach-DJ98M81-.js → NearestApproach-PAsV5RlG.js} +1 -1
  74. package/dist-embed-ufoathome/{PoherAssessor-4zSdFnFp.js → PoherAssessor-CniYlhUl.js} +1 -1
  75. package/dist-embed-ufoathome/{QuestionnaireFeed-W69udpmT.js → QuestionnaireFeed-CpZqkxlt.js} +1 -1
  76. package/dist-embed-ufoathome/{QuestionnaireForm-U78nFPn5.js → QuestionnaireForm-LkllpNx-.js} +1 -1
  77. package/dist-embed-ufoathome/{QuestionnaireImport-Q5uHxQwU.js → QuestionnaireImport-CNROmkT2.js} +1 -1
  78. package/dist-embed-ufoathome/{ReentryEditor-DEi9nT0z.js → ReentryEditor-Qax1sT82.js} +1 -1
  79. package/dist-embed-ufoathome/{ReentrySimulation-CSO1vgro.js → ReentrySimulation-CTeCaxZl.js} +1 -1
  80. package/dist-embed-ufoathome/{ReferenceSystem--tiMGm4e.js → ReferenceSystem-CM27OCUo.js} +1 -1
  81. package/dist-embed-ufoathome/{ScenarioReadings-Dzdgopl3.js → ScenarioReadings-Is3HX0n0.js} +1 -1
  82. package/dist-embed-ufoathome/{ScenarioSweep-CMcleprC.js → ScenarioSweep-BbtX26Fi.js} +1 -1
  83. package/dist-embed-ufoathome/{SearchlightEditor--1uL8bTa.js → SearchlightEditor-PuLz84pp.js} +1 -1
  84. package/dist-embed-ufoathome/SearchlightSystem-B-tHvY1M.js +1 -0
  85. package/dist-embed-ufoathome/{ShareDialogElement-Dlfy9NCE.js → ShareDialogElement-EzLob2Tz.js} +92 -71
  86. package/dist-embed-ufoathome/{SightingElement-BJSNmFM6.js → SightingElement--qpGoyxL.js} +2 -2
  87. package/dist-embed-ufoathome/{TraceSystem-Cq2TgP-u.js → TraceSystem-8XQX03MS.js} +1 -1
  88. package/dist-embed-ufoathome/{VideoButton-MRJlVNm_.js → VideoButton-WNtEngz-.js} +1 -1
  89. package/dist-embed-ufoathome/rr0-ufoathome.mjs +2 -2
  90. package/dist-embed-ufoathome/{surroundingsSources--qffL_nJ.js → surroundingsSources-UHKGesPa.js} +1 -1
  91. package/dist-embed-ufoathome/{trafficRuntime-CTCGr90P.js → trafficRuntime-CgY_7-NH.js} +1 -1
  92. package/package.json +1 -1
  93. package/dist-embed-scene/ModuleThree-BTQgimAj.js +0 -1
  94. package/dist-embed-scene/SearchlightSystem-CX1_nBkz.js +0 -1
  95. package/dist-embed-sighting/SearchlightSystem-B2-MzG4x.js +0 -1
  96. package/dist-embed-sighting-editor/ModuleThree-CB_EjTOI.js +0 -1
  97. package/dist-embed-sighting-editor/SearchlightSystem-CEG52QDx.js +0 -1
  98. package/dist-embed-ufoathome/SearchlightSystem-7bntVtp_.js +0 -1
@@ -1,4 +1,4 @@
1
- import{R as G,E as q,H as N,s as W,U as K,b as Z,c as J,d as Q,S as U,a as y,C as m,F as $,O as D,P as X}from"./rr0-ufoathome.mjs";import{a as _,O as E,M as S,b as Y,P as ee,R as P,C as te,c as se,d as ie,B as ne,e as M,f as oe,g as ae,h as re,i as he,s as le,j as de,r as V,S as z,A as ce}from"./ShareDialogElement-Dlfy9NCE.js";import{D as pe,p as j}from"./Sighting-B7bsiTIQ.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"./VisualAids-DI-hEL46.js";const ue=`
1
+ import{R as G,E as q,H as N,s as W,U as K,b as Z,c as J,d as Q,S as U,a as y,C as m,F as $,O as D,P as X}from"./rr0-ufoathome.mjs";import{a as _,O as E,M as S,b as Y,P as ee,R as P,C as te,c as se,d as ie,B as ne,e as M,f as oe,g as ae,h as re,i as he,s as le,j as de,r as V,S as z,A as ce}from"./ShareDialogElement-EzLob2Tz.js";import{D as pe,p as j}from"./Sighting-B7bsiTIQ.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"./VisualAids-DI-hEL46.js";const ue=`
2
2
  <div class="toolbar" id="toolbar" hidden>
3
3
  <!-- The case this account belongs to, when it was read from one: an observation of a case is shown in its frame, not as a lone
4
4
  recording (the info panel also lists it, but behind a button nobody opens to find out where they are). -->
@@ -689,5 +689,5 @@ ${_.CSS}
689
689
  padding-left: 1.2em;
690
690
  }
691
691
  `;class u{static PLAIN=/^\d+(?:[.,]\d+)?$/;static COLONS=/^(?:(\d+):)?(\d{1,2}):(\d{1,2}(?:[.,]\d+)?)$/;static UNITS=/^(?:(\d+(?:[.,]\d+)?)h)?(?:(\d+(?:[.,]\d+)?)m)?(?:(\d+(?:[.,]\d+)?)s)?$/i;static CLOCK=/^(?:(\d{4})-(\d{2})-(\d{2})[T ])?T?(\d{1,2}):(\d{2})(?::(\d{2}(?:[.,]\d+)?))?$/;static num(e){return e===void 0?0:Number(e.replace(",","."))}static delta(e){const t=(e??"").trim();if(t==="")return;if(u.PLAIN.test(t))return u.num(t);const i=u.COLONS.exec(t);if(i){const[,n,o,a]=i;return Number(o)>=60||u.num(a)>=60?void 0:u.num(n)*3600+Number(o)*60+u.num(a)}const s=u.UNITS.exec(t);return s&&(s[1]!==void 0||s[2]!==void 0||s[3]!==void 0)?u.num(s[1])*3600+u.num(s[2])*60+u.num(s[3]):/^P/i.test(t)?pe.seconds(t.toUpperCase()):void 0}static isClock(e){return u.clock(e)!==void 0}static clock(e){const t=u.CLOCK.exec((e??"").trim());if(!t)return;const[,i,s,n,o,a,r]=t,h={hour:Number(o),minute:Number(a),second:u.num(r)};if(!(h.hour>=24||h.minute>=60||h.second>=60)){if(i!==void 0){const c={year:Number(i),month:Number(s),day:Number(n)};if(c.month<1||c.month>12||c.day<1||c.day>31)return;h.date=c}return h}}static elapsedSince(e,t){if(!e||e.hour===void 0||e.minute===void 0)return;const i=e.hour*3600+e.minute*60+(e.second??0),s=t.hour*3600+t.minute*60+t.second;if(t.date){if(e.year===void 0||e.month===void 0||e.day===void 0)return;const o=Date.UTC(t.date.year,t.date.month-1,t.date.day)/1e3+s,a=Date.UTC(e.year,e.month-1,e.day)/1e3+i;return Math.max(0,o-a)}let n=s-i;return n<=-43200&&(n+=86400),Math.max(0,n)}}V();z.register();const T=ce.home(),k="compare-account",I="start-time",H="start-clock",w="observer",A="case-named",L="show-info",B="interpretation",x="hide-pickers",C="case",g="account",O="variant-",R=`${T}/edit/`;class v extends HTMLElement{static get observedAttributes(){return["src","show-labels",L,x,B,A,I,H,w,E,S,k]}shadow;sceneElement;toolbarElement;accountElement;accountPrefix;caseOfElement;observerText;observerSelect;infoButton;infoPanel;infoAppLink;editLink;readingFindingsElement;readingSensible=!1;readingCheck;bestCases;readingScene=!1;readingEntry;static VERDICT_COLOURS={incompatible:"#e04848",unsettled:"#e08a2c",compatible:"#2e9d5b"};infoObservationHeading;infoObservationList;infoCreditsToggle;infoCreditsList;infoCloseButton;shareButton;shareMessages;shareDialog;shareStartOn;shareStart;shareScopeRow;shareScopeLabel;shareScope;shareOpensRow;shareOpensLabel;shareOpens;shareStartLabel;shareOptions;labelsToggle;paramSummary;summaryBuilder;summarySignature="";assessmentEntries=[];assessmentToken=0;supportsPopover=typeof HTMLElement.prototype.showPopover=="function";entries=[];caseSource;interpretationChoice;interpretationLabel;interpretationSelect;confrontationElement;confrontationHeading;confrontationList;compareButton;variantChips;variantMoved;interpretationLoaders=new Map;interpretationToken=0;shownInterpretation;offeredFor;currentSrc;infoOpen=!1;creditsOpen=!1;labelsShown=!1;language="en";messages;ready=Promise.resolve();constructor(){super(),this.shadow=this.attachShadow({mode:"open"});const e=document.createElement("template");e.innerHTML=`<style>${me}</style>${ue}`,this.shadow.appendChild(e.content.cloneNode(!0)),customElements.upgrade(this.shadow),this.sceneElement=document.createElement(Y),this.forwardPlayerAttributes(),this.sceneElement.ufoElement.creditShownExternally=!0,this.sceneElement.ownCredits=!1,this.shadow.getElementById("ufo-slot").replaceWith(this.sceneElement),this.toolbarElement=this.shadow.getElementById("toolbar"),this.accountElement=this.shadow.getElementById("account"),this.accountPrefix=this.shadow.getElementById("account-prefix"),this.caseOfElement=this.shadow.getElementById("case-of"),this.observerText=this.shadow.getElementById("observer-text"),this.observerSelect=this.shadow.getElementById("observer"),this.infoButton=this.shadow.getElementById("info-button"),this.infoPanel=this.shadow.getElementById("info-panel"),this.infoAppLink=this.shadow.getElementById("info-app-link"),this.editLink=this.shadow.getElementById("edit-link"),this.infoObservationHeading=this.shadow.getElementById("info-observation-heading"),this.infoObservationList=this.shadow.getElementById("info-observation-list"),this.infoCreditsToggle=this.shadow.getElementById("info-credits-toggle"),this.infoCreditsList=this.shadow.getElementById("info-credits-list"),this.infoCloseButton=this.shadow.getElementById("info-close"),this.labelsToggle=this.shadow.getElementById("labels-button"),this.paramSummary=this.shadow.getElementById("param-summary"),this.labelsToggle.addEventListener("click",()=>{this.showLabels=!this.showLabels}),this.shareButton=document.createElement("button"),this.shareButton.type="button",this.shareButton.id="share-button",this.shareButton.setAttribute("aria-haspopup","dialog"),this.shareButton.innerHTML=ee.SHARE,this.sceneElement.ufoElement.addControl(this.shareButton),this.shareDialog=this.shadow.getElementById("share-dialog"),this.shareDialog.subject=this.shareSubject,this.shareStartOn=this.shadow.getElementById("share-start-on"),this.shareStart=this.shadow.getElementById("share-start"),this.shareStartLabel=this.shadow.getElementById("share-start-label"),this.shareScopeRow=this.shadow.getElementById("share-scope-row"),this.shareScopeLabel=this.shadow.getElementById("share-scope-label"),this.shareScope=this.shadow.getElementById("share-scope"),this.shareOpensRow=this.shadow.getElementById("share-opens-row"),this.shareOpensLabel=this.shadow.getElementById("share-opens-label"),this.shareOpens=this.shadow.getElementById("share-opens");const t=s=>({input:this.shadow.getElementById(`share-opt-${s}`),label:this.shadow.getElementById(`share-opt-${s}-label`)});this.shareOptions={labels:t("labels"),map:t("map"),milestones:t("milestones"),compare:t("compare")},this.interpretationChoice=this.shadow.getElementById("interpretation-choice"),this.interpretationLabel=this.shadow.getElementById("interpretation-label"),this.interpretationSelect=this.shadow.getElementById("interpretation"),this.confrontationElement=this.shadow.getElementById("confrontation"),this.confrontationHeading=this.shadow.getElementById("confrontation-heading"),this.confrontationList=this.shadow.getElementById("confrontation-list"),P.register(),this.readingFindingsElement=this.shadow.getElementById("reading-findings");const i=this.shadow.getElementById("reading-chip");i.addEventListener("click",()=>{const s=i.getAttribute("aria-expanded")!=="true";i.setAttribute("aria-expanded",String(s)),this.shadow.getElementById("reading-findings-list").hidden=!s}),this.compareButton=this.shadow.getElementById("compare-account"),this.variantChips=this.shadow.getElementById("variant-chips"),this.variantMoved=this.shadow.getElementById("variant-moved"),this.compareButton.addEventListener("click",()=>this.setComparing(!this.sceneElement.compareAccount)),this.observerSelect.addEventListener("change",()=>this.selectObserver(this.observerSelect.value)),this.interpretationSelect.addEventListener("change",()=>void this.chooseInterpretation(this.interpretationSelect.value)),this.sceneElement.addEventListener(te,s=>this.showConfrontation(s.detail)),this.sceneElement.ufoElement.addEventListener("timeupdate",()=>this.refreshParamSummary()),this.supportsPopover?(this.infoPanel.setAttribute("popover","auto"),this.infoPanel.removeAttribute("hidden"),this.infoButton.setAttribute("popovertarget","info-panel"),this.infoPanel.addEventListener("beforetoggle",s=>{s.newState==="open"&&(this.populateInfoPanel(),this.bringInfoButtonIntoView())}),this.infoPanel.addEventListener("toggle",s=>this.syncInfoOpen(s.newState==="open"))):this.infoButton.addEventListener("click",()=>this.toggleInfoPanel()),this.infoCloseButton.addEventListener("click",()=>this.toggleInfoPanel()),this.infoCreditsToggle.addEventListener("click",()=>this.toggleCredits()),this.shareButton.addEventListener("click",()=>this.openShare()),this.editLink.addEventListener("click",s=>{const n=this.editDetail();n&&G.ask(this,q,n)&&s.preventDefault()});for(const s of[this.shareStartOn,this.shareStart,...Object.values(this.shareOptions).map(n=>n.input)])s.addEventListener("input",()=>this.refreshShareLinks());for(const s of[this.shareScope,this.shareOpens])s.addEventListener("change",()=>this.refreshShareLinks());this.isConnected&&(this.ready=this.loadLocaleMessages())}get scene(){return this.sceneElement}async loadLocaleMessages(){const e=++this.localeToken,t=N.preferencesFor(this);this.preferences=t;const i=W(t,K),[s,n,o,a]=await Promise.all([Z.load(i),J(i),Q(i),se.load(i)]);if(e!==this.localeToken)return;const r=i!==this.language||this.messages===void 0;this.language=i,this.messages=s,this.readingCheck=new ie(a),this.bestCases=new ne(a),this.tags=new M(n),this.said=new U(t),this.summaryBuilder=new oe(this.messages,new ae(o),this.said,this.tags,{messages:this.messages,locale:i}),this.accountPrefix.textContent=this.messages?.accountBy??"",this.interpretationLabel.textContent=this.messages?.interpretation??"",this.confrontationHeading.textContent=this.messages?.confrontation??"";const h=this.entries.find(c=>c.src===this.currentSrc);h&&this.offerInterpretations(h),this.updateCompareButton(),this.infoButton.title=this.messages?.about??"",this.infoButton.setAttribute("aria-label",this.messages?.about??""),this.editLink.title=this.messages?.editThisObservation??"",this.editLink.setAttribute("aria-label",this.messages?.editThisObservation??""),this.infoCloseButton.setAttribute("aria-label",this.messages?.close??""),this.infoObservationHeading.textContent=this.messages?.observation??"",this.infoCreditsToggle.textContent=this.messages?.credits??"",this.syncLabelsToggle(),this.refreshParamSummary(),r&&this.currentSrc&&this.runAssessments(),this.shareButton.title=this.messages?.share??"",this.shareButton.setAttribute("aria-label",this.messages?.share??""),this.shareStartLabel.textContent=this.messages?.shareStartAt??"",this.shareScopeLabel.textContent=this.messages?.shareScope??"",this.shareOpensLabel.textContent=this.messages?.shareOpensOn??"",this.shareOptions.labels.label.textContent=this.messages?.shareOptionLabels??"",this.shareOptions.map.label.textContent=this.messages?.shareOptionMap??"",this.shareOptions.milestones.label.textContent=this.messages?.shareOptionMilestones??"",this.shareOptions.compare.label.textContent=this.messages?.shareOptionCompare??"",this.shareStart.setAttribute("aria-label",this.messages?.shareStartAt??""),this.shareDialog.useLanguage(i).then(c=>{c&&(this.shareMessages=c)}),this.infoOpen&&this.populateInfoPanel(),this.updateAccountLine()}preferences=[];localeToken=0;said=new U(["en"]);tags=new M({});connectedCallback(){N.preferencesFor(this).join()!==this.preferences.join()&&(this.ready=this.loadLocaleMessages()),this.applyAskedInfo();const e=this.getAttribute("src");e&&this.loadFromSrc(e)}applyAskedInfo(){this.isConnected&&this.hasAttribute(L)!==this.infoOpen&&this.toggleInfoPanel()}disconnectedCallback(){document.removeEventListener("click",this.handleOutsideClick)}attributeChangedCallback(e,t,i){if(e==="src"&&i&&i!==t&&this.isConnected&&this.loadFromSrc(i),e===B){const s=this.entries.find(n=>n.src===this.currentSrc);s&&i===null&&t!==null&&this.interpretationSelect.value!==g?(this.interpretationSelect.value=g,this.chooseInterpretation(g)):s&&this.offerInterpretations(s)}if(e===x){const s=this.entries.find(n=>n.src===this.currentSrc);this.setEntries(this.entries,this.caseSource),s&&this.offerInterpretations(s)}if(e===L&&this.applyAskedInfo(),e==="show-labels"&&this.applyLabels(this.hasAttribute("show-labels")),(e===E||e===S)&&this.forwardPlayerAttributes(),e===w&&this.entries.length>1){const s=this.entryAsked(this.entries);s&&s.src!==this.currentSrc&&this.selectObserver(s.src)}e===k&&this.setComparing(this.hasAttribute(k))}forwardPlayerAttributes(){for(const e of[E,S]){const t=this.getAttribute(e);t===null?this.sceneElement.removeAttribute(e):this.sceneElement.setAttribute(e,t)}}get loaded(){return this.loading??Promise.resolve()}loading;loadFromSrc(e){const t=this.readFromSrc(e);return this.loading=t.catch(()=>{}),t}async readFromSrc(e){this.startPending=!0;const t=y.recording(e);this.sceneElement.holdForNewScene(t);const i=await t;if(Array.isArray(i))throw new Error(`${e} is a bare list of recordings, which is no longer read: list them as the sighting events of a case.json`);if(m.isCase(i)){m.check(i);const s=m.sightingUrls(i,new URL(e,location.href).href);if(s.length===0)throw new Error(`${e} is a case with no sighting event: no recording to show`);await this.loadObserverUrls(s,{json:i,url:new URL(e,location.href).href})}else this.setEntries([{src:e,sighting:i}],void 0)}get sightingData(){return this.entries.find(e=>e.src===this.currentSrc)?.sighting}set sightingData(e){const t=$.recording(e);this.startPending=!0,this.currentSrc="",this.setEntries([{src:"",sighting:t}],void 0)}seekTo(e,t){const i=this.caseSource,s=t===void 0?void 0:this.entries.find(n=>{const o=this.plain(n).id;return(i?m.accountIds(i.json,i.url,n.src,o):[o]).includes(t)});s&&s.src!==this.currentSrc&&this.selectObserver(s.src),this.sceneElement.ufoElement.currentTime=Math.max(0,e)*1e3}set citedMoments(e){this.sceneElement.ufoElement.citedMoments=e}get playedSeconds(){return this.sceneElement.ufoElement.currentTime/1e3}get observerUrls(){return this.entries.map(e=>e.src)}set observerUrls(e){this.loadObserverUrls(e)}async loadObserverUrls(e,t){const i=await Promise.all(e.map(async s=>({src:s,sighting:await y.recording(s)})));this.setEntries(i,t)}reportCaseProblems(e,t){const{duplicateIds:i,unresolved:s}=m.problems(e,t.map(n=>this.plain(n).id).filter(n=>n!==void 0));for(const n of i)console.warn(`The case ${e.id??""} gives the id "${n}" to more than one event: a reference to it is ambiguous.`);for(const{reading:n,reference:o}of s)console.warn(`The reading ${n} of the case ${e.id??""} is "interpretationOf" "${o}", which no event of the case has as its id, nor any recording it lists.`)}setEntries(e,t){this.entries=e.map(o=>({...o,sighting:$.recording(o.sighting)})),this.caseSource=t,t&&this.reportCaseProblems(t.json,e),this.toolbarElement.hidden=e.length===0;const i=e.length>1&&!this.hasAttribute(x);this.observerSelect.hidden=!i,this.observerText.hidden=i,this.observerSelect.innerHTML="";const s=e.map((o,a)=>this.observerDisplayName(this.plain(o).observer)??this.caseTitleOf(o)??(this.messages?.unnamedObserver??"").replace("{n}",String(a+1)));for(const[o,a]of e.entries()){const r=document.createElement("option");r.value=a.src;const h=s.filter(c=>c===s[o]).length>1;r.textContent=(h?this.caseTitleOf(a):void 0)??s[o],this.observerSelect.appendChild(r)}const n=e.find(o=>o.src===this.currentSrc)??this.entryAsked(e)??e[0];n?this.selectObserver(n.src):this.updateAccountLine()}entryAsked(e){const t=this.getAttribute(w)?.trim();if(!t)return;const i=e.find(o=>this.plain(o).observer?.id===t);if(i)return i;const s=this.caseSource;if(s){const o=e.find(a=>m.accountIds(s.json,s.url,a.src,this.plain(a).id).includes(t));if(o)return o}const n=e.find(o=>o.src.split("/").pop()===t.split("/").pop());return n||(/^\d+$/.test(t)?e[Number(t)-1]:void 0)}observerKeyOf(e){return this.plain(e).observer?.id??String(this.entries.indexOf(e)+1)}sharedEntry(){const e=this.shareScope.value;if(!(!this.caseSource||e===C))return this.entries.find(t=>t.src===e)}get sharesCase(){return this.caseSource!==void 0&&!this.shareScopeRow.hidden&&this.shareScope.value===C}editorUrl(){if(!this.currentSrc)return R;const e=new URL(this.currentSrc,location.href),t=this.caseSource;return t?`${R}?file=${encodeURIComponent(t.url)}&track=${encodeURIComponent(this.shownTrackUrl()??e.href)}`:`${R}?file=${encodeURIComponent(e.href)}`}editDetail(){if(!this.currentSrc)return;const e=new URL(this.currentSrc,location.href).href,t=this.caseSource;return t?{src:t.url,track:this.shownTrackUrl()??e}:{src:e}}get editorHref(){return this.editorUrl()}get shownRecordingUrl(){return this.currentSrc?new URL(this.currentSrc,location.href).href:void 0}get shownReadingUrl(){return this.shownTrackUrl()}shownTrackUrl(){return this.readingUrlOf(this.interpretationSelect.value)}shareSubject={module:"rr0-sighting",link:()=>this.playUrl(),element:()=>this.replayElement()};replayElement(){const e=this.sharedAddress(),i=[...e.observer?[[w,e.observer]]:[],...this.replayAttributes()].map(([s,n])=>n===""?` ${s}`:` ${s}="${n}"`).join("");return`<rr0-sighting src="${e.src}"${i}></rr0-sighting>`}playUrl(){const e=this.sharedAddress(),t=[...e.observer?[`${w}=${encodeURIComponent(e.observer)}`]:[],...this.replayQuery()].join("&");return e.src?`${T}/play/?file=${encodeURIComponent(e.src)}${t&&"&"+t}`:`${T}/play/${t&&"?"+t}`}sharedAddress(){const e=t=>t?new URL(t,location.href).href:"";if(this.sharesCase){const t=this.entries.find(i=>i.src===this.shareOpens.value)??this.entries.find(i=>i.src===this.currentSrc);return{src:e(this.caseSource.url),observer:t?this.observerKeyOf(t):void 0}}return{src:e(this.sharedEntry()?.src??this.currentSrc??"")}}replayAttributes(){const e=this.shareOptions,t=[];return this.shareStartSeconds!==void 0&&t.push([I,String(this.shareStartSeconds)]),e.labels.input.checked&&t.push(["show-labels",""]),e.map.input.checked&&t.push([E,""]),e.milestones.input.checked||t.push([S,""]),e.compare.input.checked&&t.push([k,""]),t}replayQuery(){const e=this.shareOptions,t=[];return this.shareStartSeconds!==void 0&&t.push(`d=${this.shareStartSeconds}`),e.labels.input.checked||t.push("labels=0"),e.map.input.checked&&t.push("map=1"),e.milestones.input.checked||t.push("moments=0"),e.compare.input.checked&&t.push("compare=1"),t}get shareStartSeconds(){const e=Math.floor(Number(this.shareStart.value));return this.shareStartOn.checked&&Number.isFinite(e)&&e>=0?e:void 0}refreshShareLinks(){this.shareOpensRow.hidden=!this.sharesCase,this.shareDialog.refresh()}openShare(){const e=this.sceneElement.ufoElement;this.shareStart.max=String(Math.floor(e.seekableDuration/1e3)),this.shareStart.value=String(Math.floor(e.currentTime/1e3)),this.shareStartOn.checked=!1,this.shareOptions.labels.input.checked=this.labelsShown,this.shareOptions.map.input.checked=e.observerMapOpen,this.shareOptions.milestones.input.checked=e.milestonesVisible,this.shareOptions.compare.input.checked=this.sceneElement.compareAccount,this.offerShareScope(),this.shareOpensRow.hidden=!this.sharesCase;const t=[this.caseSource?.url,this.currentSrc,this.shownTrackUrl(),...this.entries.map(i=>i.src)];this.shareDialog.note=D.changed(...t)?this.shareMessages?.unsaved:void 0,this.shareDialog.open()}offerShareScope(){const e=this.caseSource!==void 0&&this.entries.length>1&&!this.hasAttribute(A);if(this.shareScopeRow.hidden=!e,this.shareScope.innerHTML="",this.shareOpens.innerHTML="",!e)return;const t=(i,s,n)=>{const o=document.createElement("option");o.value=s,o.textContent=n,i.appendChild(o)};t(this.shareScope,C,this.messages?.shareScopeCase??"");for(const i of this.entries){const s=this.observerDisplayName(this.plain(i).observer)??this.caseTitleOf(i)??(this.messages?.unnamedObserver??"").replace("{n}",String(this.entries.indexOf(i)+1));t(this.shareScope,i.src,s),t(this.shareOpens,i.src,s)}this.shareScope.value=C,this.shareOpens.value=this.currentSrc??this.entries[0].src}offerInterpretations(e){const t=this.offeredFor===e.sighting,i=this.interpretationSelect.value;this.offeredFor=e.sighting,this.interpretationToken++,this.interpretationLoaders=new Map,this.interpretationSelect.innerHTML="";const s=(d,l,p)=>{const f=document.createElement("option");f.value=d,f.textContent=l,this.interpretationSelect.appendChild(f),this.interpretationLoaders.set(d,p)},n=e===this.entries.find(d=>d.src===this.currentSrc),o=n?this.sceneElement.ufoElement.sighting.interpretation:void 0;s(g,this.messages?.account??"",()=>Promise.resolve(o));const a=this.caseSource;a&&m.interpretationEvents(a.json,m.accountIds(a.json,a.url,e.src,this.plain(e).id)).forEach((d,l)=>{const p=this.said.read(d.title)??`#${l+1}`,f=(d.by??[]).map(b=>this.agentName(b)).filter(Boolean).join(", ");s(`case-${l}`,f?(this.messages?.interpretationBy??"").replace("{title}",p).replace("{by}",f):p,()=>m.interpretationOf(d,a.url,b=>y.recording(b)))});const r=n?this.keptVariants(e):[];for(const{index:d,kept:l}of r)s(`${O}${d}`,`${this.variantLabel(l)} (${this.messages?.verdicts[l.variant.verdict]??""})`,()=>Promise.resolve(l.bodies.length>0?l:void 0));const h=t&&[...this.interpretationSelect.options].some(d=>d.value===i),c=this.askedInterpretation()??(h?i:g);this.interpretationSelect.value=c,c===g?(this.sceneElement.interpretation!==o&&(this.sceneElement.interpretation=o),this.shownInterpretation=g):(!this.sceneElement.interpretation||this.shownInterpretation!==c)&&this.chooseInterpretation(c),this.interpretationChoice.hidden=this.interpretationSelect.options.length<2||this.hasAttribute(x),this.showConfrontation(this.sceneElement.confrontation),this.updateCompareButton(),this.showVariants(r)}keptVariants(e){const t={consolidated:0,contested:1,incompatible:2};return(e.sighting.variants??[]).map((i,s)=>({index:s,kept:i})).filter(({kept:i})=>i.variant).sort((i,s)=>t[i.kept.variant.verdict]-t[s.kept.variant.verdict]||i.kept.variant.cost-s.kept.variant.cost)}variantLabel(e){return(this.messages?.variant??"").replace("{name}",e.variant.label??e.variant.candidate)}showVariants(e){if(!this.messages)return;if(this.variantChips.innerHTML="",this.variantChips.hidden=e.length===0,e.length===0){this.showVariantMoved();return}const t=(i,s,n)=>{const o=document.createElement("button");o.type="button",o.dataset.value=i,n&&(o.dataset.verdict=n,o.title=this.messages.verdicts[n],o.append(Object.assign(document.createElement("span"),{className:"dot"}))),o.append(s),o.addEventListener("click",()=>{this.interpretationSelect.value!==i&&(this.interpretationSelect.value=i,this.chooseInterpretation(i))}),this.variantChips.append(o)};t(g,this.messages?.account??"");for(const{index:i,kept:s}of e)t(`${O}${i}`,s.variant.label??s.variant.candidate,s.variant.verdict);this.showVariantMoved()}showVariantMoved(){if(!this.messages)return;const e=this.interpretationSelect.value;for(const n of this.variantChips.querySelectorAll("button"))n.setAttribute("aria-pressed",String(n.dataset.value===e));this.variantMoved.innerHTML="";const t=e.startsWith(O)?Number(e.slice(O.length)):-1,i=this.sceneElement.ufoElement.sighting.variants?.[t]?.variant;if(this.variantMoved.hidden=!i||i.moved.length+(i.readings?.length??0)===0,!i)return;const s=new Intl.NumberFormat(this.language,{maximumFractionDigits:1});for(const n of i.moved){const[o,a]=n.field==="date"?["0 d",`${n.variant>0?"+":""}${s.format(n.variant)} d`]:n.field==="time"?["0 min",`${n.variant>0?"+":""}${s.format(n.variant)} min`]:n.field==="duration"?[`${s.format(n.stated)} s`,`${s.format(n.variant)} s`]:[`${s.format(n.stated)}°`,`${s.format(n.variant)}°`],r=document.createElement("span");r.append(`${this.messages.variantFields[n.field]}${this.colon}`,Object.assign(document.createElement("s"),{textContent:o})," → ",Object.assign(document.createElement("b"),{textContent:a})),this.variantMoved.append(r)}for(const n of i.readings??[]){const o=this.messages.variantReadings[n.reading];o&&this.variantMoved.append(Object.assign(document.createElement("span"),{className:"reading",textContent:o}))}}setComparing(e){this.sceneElement.compareAccount=e,this.updateCompareButton(),this.showConfrontation(this.sceneElement.confrontation)}updateCompareButton(){const e=this.sceneElement.compareAccount;this.compareButton.hidden=!this.sceneElement.interpretation,this.compareButton.setAttribute("aria-pressed",String(e));const t=e?this.messages?.hideComparison??"":this.messages?.showComparison??"";this.compareButton.title=t,this.compareButton.setAttribute("aria-label",t)}get colon(){return this.language==="fr"?" : ":": "}askedInterpretation(){const e=this.getAttribute(B)?.trim(),t=this.caseSource;if(!e||!t)return;const i=this.entries.find(o=>o.src===this.currentSrc);if(!i)return;const n=m.interpretationEvents(t.json,m.accountIds(t.json,t.url,i.src,this.plain(i).id)).findIndex(o=>o.id===e||typeof o.url=="string"&&new URL(o.url,t.url).href===new URL(e,location.href).href);return n>=0?`case-${n}`:void 0}async chooseInterpretation(e){const t=++this.interpretationToken,i=this.interpretationLoaders.get(e),s=i?await i().catch(l=>{console.warn(`<rr0-sighting>: could not read interpretation "${e}":`,l)}):void 0,n=this.readingUrlOf(e),o=n?await y.recording(n).catch(()=>{}):void 0;if(t!==this.interpretationToken)return;const a=this.entries.find(l=>l.src===this.currentSrc),r=a&&o&&"timeline"in o?this.bestCases?.bestSceneOf(a.sighting,o):void 0,h=r??o,c=r?.interpretation&&s?{...s,bodies:[...s.bodies.map(l=>{const p=r.interpretation.bodies.find(f=>f.id===l.id);return p?{...l,track:p.track}:l}),...r.interpretation.bodies.filter(l=>!s.bodies.some(p=>p.id===l.id))]}:s,d=a&&h&&"timeline"in h&&v.changesTheScene(a.sighting,h)?{...h,timeline:h.timeline.keyframes?.length?h.timeline:a.sighting.timeline}:void 0;if(d&&n)this.showScene(d,n);else if(this.readingScene&&a)this.showScene(a.sighting,a.src,!0);else if(a){const l=!this.sceneElement.ufoElement.playRequested;n?this.sceneElement.showPoster(this.ownCover(o?.image,n),n,l):a.sighting.image?this.sceneElement.showPoster(a.sighting.image,a.src?new URL(a.src,location.href).href:void 0,l):this.sceneElement.showPoster(this.caseSource?.json.image,this.caseSource?.url,l)}this.readingScene=d!==void 0,this.sceneElement.interpretation=c,this.shownInterpretation=e,this.showReadingFindings(a,h),this.editLink.href=this.editorUrl(),this.dispatchEvent(new CustomEvent(ge,{detail:{track:this.shownTrackUrl()}})),this.updateCompareButton(),this.showConfrontation(this.sceneElement.confrontation),this.showVariantMoved()}readingUrlOf(e){const t=this.caseSource,i=this.entries.find(o=>o.src===this.currentSrc),s=/^case-(\d+)$/.exec(e);if(!t||!i||!s)return;const n=m.interpretationEvents(t.json,m.accountIds(t.json,t.url,i.src,this.plain(i).id))[Number(s[1])];return n?.url?new URL(n.url,t.url).href:void 0}static SCENE_FIELDS=["time","utcOffsetHours","place","observerTrack","weatherTrack","decor","instrument","lens","film","exposureSeconds","iso","references","lighting","lightPollution","vehicle"];static changesTheScene(e,t){const i=s=>JSON.stringify(v.SCENE_FIELDS.map(n=>s[n]));return i(e)!==i(t)}ownCover(e,t){const i=this.entries.find(a=>a.src===this.currentSrc),s=i?.sighting.image;if(!e||!s)return e;const n=(a,r)=>{try{return new URL(a,r??location.href).href}catch{return a}},o=i.src?new URL(i.src,location.href).href:void 0;return n(e,t)===n(s,o)?void 0:e}showScene(e,t,i=!1){const s=this.sceneElement.ufoElement.currentTime;this.sceneElement.documentUrl=t?new URL(t,location.href).href:void 0;const n=!this.sceneElement.ufoElement.playRequested,o=t?new URL(t,location.href).href:void 0,a=i?e.image:this.ownCover(e.image,o);a?this.sceneElement.showPoster(a,o,n):i?this.sceneElement.showPoster(this.caseSource?.json.image,this.caseSource?.url,n):this.sceneElement.showPoster(void 0,void 0,n),this.sceneElement.sightingData=e,this.sceneElement.ufoElement.currentTime=s}showReadingFindings(e,t){const i=this.readingFindingsElement,s=this.messages,n=t?.interpretation?.findings??[],o=e&&t&&this.readingCheck?this.readingCheck.findingsOf(e.sighting,t):[],a=[...n,...o],r=re.of(a);this.readingEntry=s&&r?{group:"summary",field:"reading",label:s.readingLabel,unit:"",fromSource:!1,value:(a.length===1?s.readingChipOne:s.readingChip).replace("{verdict}",s.readingVerdict[r]).replace("{n}",String(a.length)),color:v.VERDICT_COLOURS[r],full:a.map(d=>`${{holds:"✓",fails:"✗",untested:"?"}[d.outcome]} ${this.said.read(d.text)??""}`+(d.outcome==="fails"?` (${s.findingAgainst[d.against??"established"]})`:"")).join(`
692
- `)}:void 0,this.summarySignature="\0",this.refreshParamSummary();const h=i.querySelector("#reading-sensitivity");if(this.readingSensible=e&&t?P.resultOf(e.sighting,t)!==void 0:!1,h.show(e?.sighting,t),this.showReadingBox(),!s||!r){i.querySelector("#reading-findings-list").hidden=!0,delete i.dataset.verdict;return}i.dataset.verdict=r,i.querySelector("#reading-verdict").textContent=(a.length===1?s.readingChipOne:s.readingChip).replace("{verdict}",s.readingVerdict[r]).replace("{n}",String(a.length));const c=i.querySelector("#reading-findings-list");i.querySelector("#reading-chip").setAttribute("aria-expanded","false"),c.hidden=!0,c.replaceChildren(...a.map(d=>{const l=document.createElement("li");l.dataset.outcome=d.outcome;const p=document.createElement("span");p.className="finding-mark",p.textContent={holds:"✓",fails:"✗",untested:"?"}[d.outcome],p.title=s.findingOutcome[d.outcome],p.setAttribute("aria-label",s.findingOutcome[d.outcome]);const f=document.createElement("span");if(f.textContent=this.said.read(d.text)??"",l.append(p,f),d.outcome==="fails"){const b=document.createElement("span");b.className="finding-against",b.textContent=`(${s.findingAgainst[d.against??"established"]})`,l.append(b)}return l}))}agentName(e){if("people"in e){const[t,...i]=e.people.replace(/([a-z])([A-Z])/g,"$1 $2").split(" ");return[...i,t].join(" ")}return"org"in e?e.org.replace(/([a-z])([A-Z])/g,"$1 $2"):this.observerDisplayName(e)??""}showConfrontation(e){this.confrontationList.innerHTML="",this.confrontationElement.hidden=!this.sceneElement.interpretation||!this.sceneElement.compareAccount;const t=new Intl.NumberFormat(this.language,{maximumFractionDigits:1,minimumFractionDigits:1}),i=new Intl.NumberFormat(this.language,{maximumFractionDigits:2,minimumFractionDigits:2});for(const s of e){const n=document.createElement("li");n.append(`${this.said.read(s.title)??s.sourceId}${this.colon}`);const o=[];s.separationDeg!==void 0&&o.push([(this.messages?.confrontationDirection??"").replace("{deg}",t.format(s.separationDeg)),s.disagreements.includes("direction")]),s.widthRatio!==void 0&&o.push([(this.messages?.confrontationWidth??"").replace("{ratio}",i.format(s.widthRatio)),s.disagreements.includes("width")]),s.heightRatio!==void 0&&o.push([(this.messages?.confrontationHeight??"").replace("{ratio}",i.format(s.heightRatio)),s.disagreements.includes("height")]),o.forEach(([a,r],h)=>{h>0&&n.append(" · ");const c=document.createElement("span");c.textContent=a,r&&(c.className="disagrees"),n.append(c)}),this.confrontationList.appendChild(n)}}startPending=!1;startSeconds(e){const t=u.clock(this.getAttribute(H)),i=this.plain(e).time;return(t?u.elapsedSince(i===void 0?void 0:j(i),t):void 0)??u.delta(this.getAttribute(I))}selectObserver(e){const t=this.entries.find(s=>s.src===e);if(!t)return;this.currentSrc=e,this.observerSelect.value=e,this.sceneElement.documentUrl=t.src?new URL(t.src,location.href).href:void 0;const i=!this.sceneElement.ufoElement.playRequested;if(this.askedInterpretation()||(t.sighting.image?this.sceneElement.showPoster(t.sighting.image,t.src?new URL(t.src,location.href).href:void 0,i):this.sceneElement.showPoster(this.caseSource?.json.image,this.caseSource?.url,i)),this.sceneElement.holdForNewScene(),this.sceneElement.sightingData=t.sighting,this.readingScene=!1,this.startPending){this.startPending=!1;const s=this.startSeconds(t);s!==void 0&&(this.sceneElement.ufoElement.currentTime=Math.max(0,s)*1e3)}this.offerInterpretations(t),this.updateAccountLine(),this.refreshParamSummary(),this.runAssessments(),this.infoOpen&&this.populateInfoPanel(),this.dispatchEvent(new CustomEvent(fe,{detail:{src:e}}))}async runAssessments(){if(!this.messages)return;const e=++this.assessmentToken,t=await new he(this.messages).read(this.sceneElement.ufoElement.sighting);e===this.assessmentToken&&(this.assessmentEntries=t.entries,this.refreshParamSummary())}updateAccountLine(){const e=this.entries.find(a=>a.src===this.currentSrc),t=e?this.observerDisplayName(this.plain(e).observer):void 0,i=t!==void 0||this.entries.length>1;this.accountElement.hidden=!i,this.observerText.textContent=t??"";const n=!this.hasAttribute(A)&&this.caseSource&&(this.said.read(this.caseSource.json.title)??this.caseSource.json.id);this.caseOfElement.hidden=!n,this.caseOfElement.textContent=n?`${this.messages?.case??""} ${n}`:"";const o=t!==void 0?`${this.messages?.accountBy??""} ${t}`.trim():void 0;this.sceneElement.filmName=[n||void 0,o].filter(Boolean).join(" - ")||void 0,this.editLink.hidden=!this.currentSrc,this.editLink.href=this.editorUrl(),this.shareButton.hidden=D.local(this.caseSource?.url??this.currentSrc),this.editLink.title=this.messages?.editThisObservation??"",this.editLink.setAttribute("aria-label",this.messages?.editThisObservation??"")}caseTitleOf(e){const t=this.caseSource;if(!t)return;const i=t.json.events?.find(s=>s.url!==void 0&&!s.interpretationOf&&new URL(s.url,t.url).href===new URL(e.src,location.href).href);return i?this.said.read(i.title):void 0}observerDisplayName(e){if(!e)return;const t=[...e.firstNames??[],e.lastName].filter(Boolean).join(" ");return this.said.read(e.title)||t||e.id}plainRecordings=new WeakMap;plain(e){return this.stripped(e).recording}stripped(e){let t=this.plainRecordings.get(e.sighting);return t||(t=X.strip(e.sighting),this.plainRecordings.set(e.sighting,t)),t}basisOf(e,t){const i=this.stripped(e).provenance,s={established:-2,measured:-1,stated:0,derived:1,assumed:2,fitted:3},n=i.paths().filter(r=>t.some(h=>r===h||r.startsWith(`${h}.`))).map(r=>i.at(r)),o=n.reduce((r,h)=>s[h.basis]>s[r]?h.basis:r,"stated"),a=n.filter(r=>r.basis===o&&r.rationale).map(r=>this.said.read(r.rationale)??"").filter(r=>r!=="");return{basis:o,rationales:a}}formatDate(e){const t=e.place?.locations?.[0],i=le((e.time?j(e.time):void 0)??{},t?.lng??0,e.utcOffsetHours);if(!i)return;const s=i.getTime()+this.utcOffsetHoursOf(e,t?.lng??0)*36e5;if(Number.isFinite(s))return new Intl.DateTimeFormat(this.language,{dateStyle:"long",timeStyle:"short",timeZone:"UTC"}).format(new Date(s))}utcOffsetHoursOf(e,t){return e.utcOffsetHours??Math.round(t/15)}formatLocation(e){const t=e.place?.locations?.[0];if(t)return`${t.lat.toFixed(4)}, ${t.lng.toFixed(4)}`}toggleInfoPanel(){const e=!this.infoOpen;if(this.supportsPopover){const t=this.infoPanel.matches(":popover-open");e&&!t?this.infoPanel.showPopover():!e&&t&&this.infoPanel.hidePopover();return}e&&this.bringInfoButtonIntoView(),this.syncInfoOpen(e),this.infoPanel.hidden=!e,e?document.addEventListener("click",this.handleOutsideClick):document.removeEventListener("click",this.handleOutsideClick)}bringInfoButtonIntoView(){const e=this.infoButton.getBoundingClientRect(),t=window.innerHeight||document.documentElement.clientHeight;e.top>=0&&e.bottom<=t||this.infoButton.scrollIntoView({block:"center"})}syncInfoOpen(e){e!==this.infoOpen&&(this.infoOpen=e,this.infoButton.setAttribute("aria-expanded",String(e)),e?this.supportsPopover||this.populateInfoPanel():(this.creditsOpen=!1,this.infoCreditsList.hidden=!0,this.infoCreditsToggle.setAttribute("aria-expanded","false")))}handleOutsideClick=e=>{const t=e.composedPath();!t.includes(this.infoPanel)&&!t.includes(this.infoButton)&&this.toggleInfoPanel()};toggleCredits(){this.creditsOpen=!this.creditsOpen,this.infoCreditsList.hidden=!this.creditsOpen,this.infoCreditsToggle.setAttribute("aria-expanded",String(this.creditsOpen)),this.creditsOpen&&this.revealInPanel(this.infoCreditsList)}revealInPanel(e){e.scrollIntoView?.({block:"nearest"})}get showLabels(){return this.labelsShown}set showLabels(e){this.toggleAttribute("show-labels",e)}applyLabels(e){this.labelsShown=e,this.syncLabelsToggle(),this.refreshParamSummary(),this.populateInfoPanel()}syncLabelsToggle(){const e=this.labelsShown?this.messages?.hideLabels??"":this.messages?.showLabels??"";this.labelsToggle.title=e,this.labelsToggle.setAttribute("aria-label",e),this.labelsToggle.setAttribute("aria-pressed",String(this.labelsShown))}showReadingBox(){const e=this.readingFindingsElement,t=this.readingEntry!==void 0&&!this.labelsShown;e.hidden=!t&&!this.readingSensible,e.querySelector("#reading-chip").hidden=!t,t||(e.querySelector("#reading-findings-list").hidden=!0)}refreshParamSummary(){if(this.paramSummary.hidden=!this.labelsShown,this.showReadingBox(),!this.labelsShown){this.paramSummary.replaceChildren(),this.summarySignature="";return}const e=this.sceneElement.ufoElement.sighting,t=this.summaryBuilder?.entriesFor(e,this.sceneElement.ufoElement.currentTime,{roadGradeDeg:this.sceneElement.roadGradeDeg})??[],i=t.map(h=>h.group).lastIndexOf("summary"),s=this.readingEntry?[this.readingEntry]:[],n=[...t.slice(0,i+1),...s,...t.slice(i+1),...this.assessmentEntries],o=n.map(h=>`${h.field}=${h.label}=${h.value}${h.unit}${h.full??""}${h.fromSource?"*":""}`).join("|");if(o===this.summarySignature)return;this.summarySignature=o;const a=[];let r;for(const h of n){r&&r.group!==h.group&&(r=void 0);const c=h.group==="summary"?this.messages?.summaryGroup??"":h.group==="observer"?this.messages?.observerGroup??"":this.messages&&h.group in this.messages.summaryGroups?this.messages.summaryGroups[h.group]:h.group==="assessment"?this.messages?.assessmentGroup??"":void 0;if(c!==void 0&&!r){const l=document.createElement("span");l.className="param-nest";const p=document.createElement("span");p.className="param-nest-label",p.textContent=c,l.append(p),r={group:h.group,element:l},a.push(l)}const d=this.paramItem(h);r?r.element.append(d):a.push(d)}this.paramSummary.replaceChildren(...a),this.syncDescription(n)}openDescription;openDescriptionTitle;syncDescription(e){this.openDescription!==void 0&&!e.some(t=>t.full===this.openDescription)&&(this.openDescription=void 0),_.sync(this.paramSummary,this.openDescription,this.openDescriptionTitle??this.messages?.summaryDescription??"",this.messages?.closeDescription??"",()=>{this.openDescription=void 0,this.syncDescription(e)})}paramItem(e){const t=document.createElement("span");if(t.className=e.fromSource?"param-label from-source":"param-label",e.detail&&(t.title=e.detail),e.full!==void 0){t.classList.add("describable"),t.tabIndex=0,t.setAttribute("role","button");const n=()=>{this.openDescription=e.full,this.openDescriptionTitle=e.label,this.syncDescription([e])};t.addEventListener("click",n),t.addEventListener("keydown",o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),n())})}const i=document.createElement("span");if(i.className="param-label-label",i.textContent=`${e.label} `,t.append(i),e.color!==void 0){const n=document.createElement("span");n.className="param-label-swatch",n.style.background=e.color,t.append(n)}const s=document.createElement("span");return s.className="param-label-value",s.textContent=e.unit===""?e.value:`${e.value} ${e.unit}`,t.append(s),t}populateInfoPanel(){const e=this.entries.find(t=>t.src===this.currentSrc);if(this.infoObservationList.innerHTML="",e){const t=this.caseSource&&(this.caseSource.json.title??this.caseSource.json.id);if(t&&this.appendInfoRow(this.infoObservationList,this.messages?.case??"",t),!this.labelsShown){const n=this.formatDate(this.plain(e));n&&this.appendInfoRow(this.infoObservationList,this.messages?.date??"",n,this.basisOf(e,v.DATE_PATHS));const o=this.formatLocation(this.plain(e));o&&this.appendInfoRow(this.infoObservationList,this.messages?.location??"",o,this.basisOf(e,v.PLACE_PATHS))}const i=this.said.read(this.plain(e).description);i&&!this.labelsShown&&this.appendInfoRow(this.infoObservationList,this.messages?.description??"",i);for(const n of this.plain(e).sources??[])this.appendInfoSource(this.infoObservationList,this.messages?.source??"",n);const s=this.plain(e).tags;!this.labelsShown&&s&&s.length>0&&this.appendInfoRow(this.infoObservationList,this.messages?.tags??"",s.map(n=>this.tags.name(n)).join(", "))}this.infoAppLink.href=T,this.infoAppLink.textContent="UFO@home v0.202.0",de.fill(this.infoCreditsList,this.sceneElement)}appendInfoSource(e,t,i){const s=document.createElement("dt");s.textContent=t;const n=document.createElement("dd"),o=this.said.read(i.title)??i.url??"";if(i.url&&/^https?:\/\//i.test(i.url)){const r=document.createElement("a");r.href=i.url,r.target="_blank",r.rel="noopener noreferrer",r.textContent=o,n.appendChild(r)}else n.append(o);const a=[i.authors?.join(", "),i.publication?.publisher,i.publication?.time,i.index].filter(Boolean);a.length>0&&n.append(`, ${a.join(", ")}`),e.append(s,n)}static DATE_PATHS=["time","utcOffsetHours","timeZone"];static PLACE_PATHS=["place"];appendInfoRow(e,t,i,s){if(!this.messages)return;const n=document.createElement("dt");n.textContent=t;const o=document.createElement("dd");if(o.textContent=i,s){const a=document.createElement("span");a.className=`basis basis-${s.basis}`,a.textContent=this.messages.basis[s.basis],s.rationales.length>0&&(a.title=s.rationales.join(`
692
+ `)}:void 0,this.summarySignature="\0",this.refreshParamSummary();const h=i.querySelector("#reading-sensitivity");if(this.readingSensible=e&&t?P.resultOf(e.sighting,t)!==void 0:!1,h.show(e?.sighting,t),this.showReadingBox(),!s||!r){i.querySelector("#reading-findings-list").hidden=!0,delete i.dataset.verdict;return}i.dataset.verdict=r,i.querySelector("#reading-verdict").textContent=(a.length===1?s.readingChipOne:s.readingChip).replace("{verdict}",s.readingVerdict[r]).replace("{n}",String(a.length));const c=i.querySelector("#reading-findings-list");i.querySelector("#reading-chip").setAttribute("aria-expanded","false"),c.hidden=!0,c.replaceChildren(...a.map(d=>{const l=document.createElement("li");l.dataset.outcome=d.outcome;const p=document.createElement("span");p.className="finding-mark",p.textContent={holds:"✓",fails:"✗",untested:"?"}[d.outcome],p.title=s.findingOutcome[d.outcome],p.setAttribute("aria-label",s.findingOutcome[d.outcome]);const f=document.createElement("span");if(f.textContent=this.said.read(d.text)??"",l.append(p,f),d.outcome==="fails"){const b=document.createElement("span");b.className="finding-against",b.textContent=`(${s.findingAgainst[d.against??"established"]})`,l.append(b)}return l}))}agentName(e){if("people"in e){const[t,...i]=e.people.replace(/([a-z])([A-Z])/g,"$1 $2").split(" ");return[...i,t].join(" ")}return"org"in e?e.org.replace(/([a-z])([A-Z])/g,"$1 $2"):this.observerDisplayName(e)??""}showConfrontation(e){this.confrontationList.innerHTML="",this.confrontationElement.hidden=!this.sceneElement.interpretation||!this.sceneElement.compareAccount;const t=new Intl.NumberFormat(this.language,{maximumFractionDigits:1,minimumFractionDigits:1}),i=new Intl.NumberFormat(this.language,{maximumFractionDigits:2,minimumFractionDigits:2});for(const s of e){const n=document.createElement("li");n.append(`${this.said.read(s.title)??s.sourceId}${this.colon}`);const o=[];s.separationDeg!==void 0&&o.push([(this.messages?.confrontationDirection??"").replace("{deg}",t.format(s.separationDeg)),s.disagreements.includes("direction")]),s.widthRatio!==void 0&&o.push([(this.messages?.confrontationWidth??"").replace("{ratio}",i.format(s.widthRatio)),s.disagreements.includes("width")]),s.heightRatio!==void 0&&o.push([(this.messages?.confrontationHeight??"").replace("{ratio}",i.format(s.heightRatio)),s.disagreements.includes("height")]),o.forEach(([a,r],h)=>{h>0&&n.append(" · ");const c=document.createElement("span");c.textContent=a,r&&(c.className="disagrees"),n.append(c)}),this.confrontationList.appendChild(n)}}startPending=!1;startSeconds(e){const t=u.clock(this.getAttribute(H)),i=this.plain(e).time;return(t?u.elapsedSince(i===void 0?void 0:j(i),t):void 0)??u.delta(this.getAttribute(I))}selectObserver(e){const t=this.entries.find(s=>s.src===e);if(!t)return;this.currentSrc=e,this.observerSelect.value=e,this.sceneElement.documentUrl=t.src?new URL(t.src,location.href).href:void 0;const i=!this.sceneElement.ufoElement.playRequested;if(this.askedInterpretation()||(t.sighting.image?this.sceneElement.showPoster(t.sighting.image,t.src?new URL(t.src,location.href).href:void 0,i):this.sceneElement.showPoster(this.caseSource?.json.image,this.caseSource?.url,i)),this.sceneElement.holdForNewScene(),this.sceneElement.sightingData=t.sighting,this.readingScene=!1,this.startPending){this.startPending=!1;const s=this.startSeconds(t);s!==void 0&&(this.sceneElement.ufoElement.currentTime=Math.max(0,s)*1e3)}this.offerInterpretations(t),this.updateAccountLine(),this.refreshParamSummary(),this.runAssessments(),this.infoOpen&&this.populateInfoPanel(),this.dispatchEvent(new CustomEvent(fe,{detail:{src:e}}))}async runAssessments(){if(!this.messages)return;const e=++this.assessmentToken,t=await new he(this.messages).read(this.sceneElement.ufoElement.sighting);e===this.assessmentToken&&(this.assessmentEntries=t.entries,this.refreshParamSummary())}updateAccountLine(){const e=this.entries.find(a=>a.src===this.currentSrc),t=e?this.observerDisplayName(this.plain(e).observer):void 0,i=t!==void 0||this.entries.length>1;this.accountElement.hidden=!i,this.observerText.textContent=t??"";const n=!this.hasAttribute(A)&&this.caseSource&&(this.said.read(this.caseSource.json.title)??this.caseSource.json.id);this.caseOfElement.hidden=!n,this.caseOfElement.textContent=n?`${this.messages?.case??""} ${n}`:"";const o=t!==void 0?`${this.messages?.accountBy??""} ${t}`.trim():void 0;this.sceneElement.filmName=[n||void 0,o].filter(Boolean).join(" - ")||void 0,this.editLink.hidden=!this.currentSrc,this.editLink.href=this.editorUrl(),this.shareButton.hidden=D.local(this.caseSource?.url??this.currentSrc),this.editLink.title=this.messages?.editThisObservation??"",this.editLink.setAttribute("aria-label",this.messages?.editThisObservation??"")}caseTitleOf(e){const t=this.caseSource;if(!t)return;const i=t.json.events?.find(s=>s.url!==void 0&&!s.interpretationOf&&new URL(s.url,t.url).href===new URL(e.src,location.href).href);return i?this.said.read(i.title):void 0}observerDisplayName(e){if(!e)return;const t=[...e.firstNames??[],e.lastName].filter(Boolean).join(" ");return this.said.read(e.title)||t||e.id}plainRecordings=new WeakMap;plain(e){return this.stripped(e).recording}stripped(e){let t=this.plainRecordings.get(e.sighting);return t||(t=X.strip(e.sighting),this.plainRecordings.set(e.sighting,t)),t}basisOf(e,t){const i=this.stripped(e).provenance,s={established:-2,measured:-1,stated:0,derived:1,assumed:2,fitted:3},n=i.paths().filter(r=>t.some(h=>r===h||r.startsWith(`${h}.`))).map(r=>i.at(r)),o=n.reduce((r,h)=>s[h.basis]>s[r]?h.basis:r,"stated"),a=n.filter(r=>r.basis===o&&r.rationale).map(r=>this.said.read(r.rationale)??"").filter(r=>r!=="");return{basis:o,rationales:a}}formatDate(e){const t=e.place?.locations?.[0],i=le((e.time?j(e.time):void 0)??{},t?.lng??0,e.utcOffsetHours);if(!i)return;const s=i.getTime()+this.utcOffsetHoursOf(e,t?.lng??0)*36e5;if(Number.isFinite(s))return new Intl.DateTimeFormat(this.language,{dateStyle:"long",timeStyle:"short",timeZone:"UTC"}).format(new Date(s))}utcOffsetHoursOf(e,t){return e.utcOffsetHours??Math.round(t/15)}formatLocation(e){const t=e.place?.locations?.[0];if(t)return`${t.lat.toFixed(4)}, ${t.lng.toFixed(4)}`}toggleInfoPanel(){const e=!this.infoOpen;if(this.supportsPopover){const t=this.infoPanel.matches(":popover-open");e&&!t?this.infoPanel.showPopover():!e&&t&&this.infoPanel.hidePopover();return}e&&this.bringInfoButtonIntoView(),this.syncInfoOpen(e),this.infoPanel.hidden=!e,e?document.addEventListener("click",this.handleOutsideClick):document.removeEventListener("click",this.handleOutsideClick)}bringInfoButtonIntoView(){const e=this.infoButton.getBoundingClientRect(),t=window.innerHeight||document.documentElement.clientHeight;e.top>=0&&e.bottom<=t||this.infoButton.scrollIntoView({block:"center"})}syncInfoOpen(e){e!==this.infoOpen&&(this.infoOpen=e,this.infoButton.setAttribute("aria-expanded",String(e)),e?this.supportsPopover||this.populateInfoPanel():(this.creditsOpen=!1,this.infoCreditsList.hidden=!0,this.infoCreditsToggle.setAttribute("aria-expanded","false")))}handleOutsideClick=e=>{const t=e.composedPath();!t.includes(this.infoPanel)&&!t.includes(this.infoButton)&&this.toggleInfoPanel()};toggleCredits(){this.creditsOpen=!this.creditsOpen,this.infoCreditsList.hidden=!this.creditsOpen,this.infoCreditsToggle.setAttribute("aria-expanded",String(this.creditsOpen)),this.creditsOpen&&this.revealInPanel(this.infoCreditsList)}revealInPanel(e){e.scrollIntoView?.({block:"nearest"})}get showLabels(){return this.labelsShown}set showLabels(e){this.toggleAttribute("show-labels",e)}applyLabels(e){this.labelsShown=e,this.syncLabelsToggle(),this.refreshParamSummary(),this.populateInfoPanel()}syncLabelsToggle(){const e=this.labelsShown?this.messages?.hideLabels??"":this.messages?.showLabels??"";this.labelsToggle.title=e,this.labelsToggle.setAttribute("aria-label",e),this.labelsToggle.setAttribute("aria-pressed",String(this.labelsShown))}showReadingBox(){const e=this.readingFindingsElement,t=this.readingEntry!==void 0&&!this.labelsShown;e.hidden=!t&&!this.readingSensible,e.querySelector("#reading-chip").hidden=!t,t||(e.querySelector("#reading-findings-list").hidden=!0)}refreshParamSummary(){if(this.paramSummary.hidden=!this.labelsShown,this.showReadingBox(),!this.labelsShown){this.paramSummary.replaceChildren(),this.summarySignature="";return}const e=this.sceneElement.ufoElement.sighting,t=this.summaryBuilder?.entriesFor(e,this.sceneElement.ufoElement.currentTime,{roadGradeDeg:this.sceneElement.roadGradeDeg})??[],i=t.map(h=>h.group).lastIndexOf("summary"),s=this.readingEntry?[this.readingEntry]:[],n=[...t.slice(0,i+1),...s,...t.slice(i+1),...this.assessmentEntries],o=n.map(h=>`${h.field}=${h.label}=${h.value}${h.unit}${h.full??""}${h.fromSource?"*":""}`).join("|");if(o===this.summarySignature)return;this.summarySignature=o;const a=[];let r;for(const h of n){r&&r.group!==h.group&&(r=void 0);const c=h.group==="summary"?this.messages?.summaryGroup??"":h.group==="observer"?this.messages?.observerGroup??"":this.messages&&h.group in this.messages.summaryGroups?this.messages.summaryGroups[h.group]:h.group==="assessment"?this.messages?.assessmentGroup??"":void 0;if(c!==void 0&&!r){const l=document.createElement("span");l.className="param-nest";const p=document.createElement("span");p.className="param-nest-label",p.textContent=c,l.append(p),r={group:h.group,element:l},a.push(l)}const d=this.paramItem(h);r?r.element.append(d):a.push(d)}this.paramSummary.replaceChildren(...a),this.syncDescription(n)}openDescription;openDescriptionTitle;syncDescription(e){this.openDescription!==void 0&&!e.some(t=>t.full===this.openDescription)&&(this.openDescription=void 0),_.sync(this.paramSummary,this.openDescription,this.openDescriptionTitle??this.messages?.summaryDescription??"",this.messages?.closeDescription??"",()=>{this.openDescription=void 0,this.syncDescription(e)})}paramItem(e){const t=document.createElement("span");if(t.className=e.fromSource?"param-label from-source":"param-label",e.detail&&(t.title=e.detail),e.full!==void 0){t.classList.add("describable"),t.tabIndex=0,t.setAttribute("role","button");const n=()=>{this.openDescription=e.full,this.openDescriptionTitle=e.label,this.syncDescription([e])};t.addEventListener("click",n),t.addEventListener("keydown",o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),n())})}const i=document.createElement("span");if(i.className="param-label-label",i.textContent=`${e.label} `,t.append(i),e.color!==void 0){const n=document.createElement("span");n.className="param-label-swatch",n.style.background=e.color,t.append(n)}const s=document.createElement("span");return s.className="param-label-value",s.textContent=e.unit===""?e.value:`${e.value} ${e.unit}`,t.append(s),t}populateInfoPanel(){const e=this.entries.find(t=>t.src===this.currentSrc);if(this.infoObservationList.innerHTML="",e){const t=this.caseSource&&(this.caseSource.json.title??this.caseSource.json.id);if(t&&this.appendInfoRow(this.infoObservationList,this.messages?.case??"",t),!this.labelsShown){const n=this.formatDate(this.plain(e));n&&this.appendInfoRow(this.infoObservationList,this.messages?.date??"",n,this.basisOf(e,v.DATE_PATHS));const o=this.formatLocation(this.plain(e));o&&this.appendInfoRow(this.infoObservationList,this.messages?.location??"",o,this.basisOf(e,v.PLACE_PATHS))}const i=this.said.read(this.plain(e).description);i&&!this.labelsShown&&this.appendInfoRow(this.infoObservationList,this.messages?.description??"",i);for(const n of this.plain(e).sources??[])this.appendInfoSource(this.infoObservationList,this.messages?.source??"",n);const s=this.plain(e).tags;!this.labelsShown&&s&&s.length>0&&this.appendInfoRow(this.infoObservationList,this.messages?.tags??"",s.map(n=>this.tags.name(n)).join(", "))}this.infoAppLink.href=T,this.infoAppLink.textContent="UFO@home v0.202.1",de.fill(this.infoCreditsList,this.sceneElement)}appendInfoSource(e,t,i){const s=document.createElement("dt");s.textContent=t;const n=document.createElement("dd"),o=this.said.read(i.title)??i.url??"";if(i.url&&/^https?:\/\//i.test(i.url)){const r=document.createElement("a");r.href=i.url,r.target="_blank",r.rel="noopener noreferrer",r.textContent=o,n.appendChild(r)}else n.append(o);const a=[i.authors?.join(", "),i.publication?.publisher,i.publication?.time,i.index].filter(Boolean);a.length>0&&n.append(`, ${a.join(", ")}`),e.append(s,n)}static DATE_PATHS=["time","utcOffsetHours","timeZone"];static PLACE_PATHS=["place"];appendInfoRow(e,t,i,s){if(!this.messages)return;const n=document.createElement("dt");n.textContent=t;const o=document.createElement("dd");if(o.textContent=i,s){const a=document.createElement("span");a.className=`basis basis-${s.basis}`,a.textContent=this.messages.basis[s.basis],s.rationales.length>0&&(a.title=s.rationales.join(`
693
693
  `)),o.append(" ",a)}e.appendChild(n),e.appendChild(o)}}const F="rr0-sighting",fe="observerchange",ge="interpretationchange";function Ie(){V(),z.register(),customElements.get(F)||customElements.define(F,v)}export{A as CASE_NAMED_ATTRIBUTE,k as COMPARE_ACCOUNT_ATTRIBUTE,x as HIDE_PICKERS_ATTRIBUTE,B as INTERPRETATION_ATTRIBUTE,ge as INTERPRETATION_CHANGE_EVENT,w as OBSERVER_ATTRIBUTE,fe as OBSERVER_CHANGE_EVENT,L as SHOW_INFO_ATTRIBUTE,F as SIGHTING_ELEMENT_NAME,H as START_CLOCK_ATTRIBUTE,I as START_TIME_ATTRIBUTE,v as SightingElement,Ie as registerSighting};
@@ -1,4 +1,4 @@
1
- import{aF as ee,a0 as F,aG as G,aH as M,aI as te,a8 as j,av as Z,V as E,S as ie,aJ as I,aK as $,j as ne,aL as O,M as se,p as B,aq as oe,a2 as ae,aM as re,I as le,C as ce,w as de,q as fe,J as ue,ai as pe,y as he,ah as V}from"./three.module-CbaHqYFq.js";import{b0 as me}from"./ShareDialogElement-Dlfy9NCE.js";import{g as ge}from"./GeoProjection-DvqDbRIx.js";import"./rr0-ufoathome.mjs";import"./Sighting-B7bsiTIQ.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 k=new j,P=new E;class Q extends ee{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],n=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],i=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(i),this.setAttribute("position",new F(e,3)),this.setAttribute("uv",new F(n,2))}applyMatrix4(e){const n=this.attributes.instanceStart,i=this.attributes.instanceEnd;return n!==void 0&&(n.applyMatrix4(e),i.applyMatrix4(e),n.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));const i=new G(n,6,1);return this.setAttribute("instanceStart",new M(i,3,0)),this.setAttribute("instanceEnd",new M(i,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));const i=new G(n,6,1);return this.setAttribute("instanceColorStart",new M(i,3,0)),this.setAttribute("instanceColorEnd",new M(i,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new te(e.geometry)),this}fromLineSegments(e){const n=e.geometry;return this.setPositions(n.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new j);const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;e!==void 0&&n!==void 0&&(this.boundingBox.setFromBufferAttribute(e),k.setFromBufferAttribute(n),this.boundingBox.union(k))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Z),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;if(e!==void 0&&n!==void 0){const i=this.boundingSphere.center;this.boundingBox.getCenter(i);let t=0;for(let o=0,l=e.count;o<l;o++)P.fromBufferAttribute(e,o),t=Math.max(t,i.distanceToSquared(P)),P.fromBufferAttribute(n,o),t=Math.max(t,i.distanceToSquared(P));this.boundingSphere.radius=Math.sqrt(t),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}}O.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new ne},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};I.line={uniforms:$.merge([O.common,O.fog,O.line]),vertexShader:`
1
+ import{aF as ee,a0 as F,aG as G,aH as M,aI as te,a8 as j,av as Z,V as E,S as ie,aJ as I,aK as $,j as ne,aL as O,M as se,p as B,aq as oe,a2 as ae,aM as re,I as le,C as ce,w as de,q as fe,J as ue,ai as pe,y as he,ah as V}from"./three.module-CbaHqYFq.js";import{b0 as me}from"./ShareDialogElement-EzLob2Tz.js";import{g as ge}from"./GeoProjection-DvqDbRIx.js";import"./rr0-ufoathome.mjs";import"./Sighting-B7bsiTIQ.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 k=new j,P=new E;class Q extends ee{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],n=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],i=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(i),this.setAttribute("position",new F(e,3)),this.setAttribute("uv",new F(n,2))}applyMatrix4(e){const n=this.attributes.instanceStart,i=this.attributes.instanceEnd;return n!==void 0&&(n.applyMatrix4(e),i.applyMatrix4(e),n.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));const i=new G(n,6,1);return this.setAttribute("instanceStart",new M(i,3,0)),this.setAttribute("instanceEnd",new M(i,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));const i=new G(n,6,1);return this.setAttribute("instanceColorStart",new M(i,3,0)),this.setAttribute("instanceColorEnd",new M(i,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new te(e.geometry)),this}fromLineSegments(e){const n=e.geometry;return this.setPositions(n.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new j);const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;e!==void 0&&n!==void 0&&(this.boundingBox.setFromBufferAttribute(e),k.setFromBufferAttribute(n),this.boundingBox.union(k))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Z),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;if(e!==void 0&&n!==void 0){const i=this.boundingSphere.center;this.boundingBox.getCenter(i);let t=0;for(let o=0,l=e.count;o<l;o++)P.fromBufferAttribute(e,o),t=Math.max(t,i.distanceToSquared(P)),P.fromBufferAttribute(n,o),t=Math.max(t,i.distanceToSquared(P));this.boundingSphere.radius=Math.sqrt(t),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}}O.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new ne},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};I.line={uniforms:$.merge([O.common,O.fog,O.line]),vertexShader:`
2
2
  #include <common>
3
3
  #include <color_pars_vertex>
4
4
  #include <fog_pars_vertex>
@@ -1 +1 @@
1
- import{P as d}from"./ShareDialogElement-Dlfy9NCE.js";import"./rr0-ufoathome.mjs";import"./Sighting-B7bsiTIQ.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 c{constructor(e,t){this.filmer=e,this.element=t??document.createElement("button"),this.element.type="button",this.element.id="video-button",this.element.setAttribute("aria-haspopup","true"),this.element.addEventListener("click",n=>{n.stopPropagation(),this.filming?this.filming.abort():this.toggleOptions()}),this.panel=document.createElement("div"),this.panel.className="video-options",this.panel.hidden=!0;for(const n of["click","pointerdown","pointerup","dblclick"])this.panel.addEventListener(n,o=>o.stopPropagation());this.panel.addEventListener("keydown",n=>{n.key==="Escape"&&(this.closeOptions(),this.element.focus())});const s=document.createElement("label");s.className="video-size",this.sizeLabel=document.createElement("span"),this.sizeSelect=document.createElement("select"),s.append(this.sizeLabel,this.sizeSelect),this.panel.append(s);const i=()=>{const n=document.createElement("div");n.className="video-bound";const o=document.createElement("label"),l=document.createElement("span"),r=document.createElement("input");r.type="text",r.inputMode="numeric",r.size=7,r.addEventListener("input",()=>this.checkBounds()),o.append(l,r);const h=document.createElement("button");return h.type="button",h.className="video-here",h.addEventListener("click",()=>{r.value=c.formatSeconds(this.filmer.positionS()),this.checkBounds()}),n.append(o,h),this.panel.append(n),{label:l,input:r,here:h}};this.bounds={from:i(),to:i()};const a=()=>{const n=document.createElement("label"),o=document.createElement("input");o.type="checkbox";const l=document.createElement("span");return n.append(o,l),this.panel.append(n),{input:o,label:l}};this.checks={caption:a(),time:a(),map:a()},this.startButton=document.createElement("button"),this.startButton.type="button",this.startButton.className="video-start",this.startButton.addEventListener("click",()=>void this.film(this.options(),!1)),this.panel.append(this.startButton),this.kitButton=document.createElement("button"),this.kitButton.type="button",this.kitButton.className="video-kit",this.kitButton.hidden=!this.filmer.generativeKit,this.kitButton.addEventListener("click",()=>void this.film(this.options(),!0)),this.panel.append(this.kitButton),this.restoreOptions(),this.update()}static HEIGHTS=[720,1080,2160];static STORAGE_KEY="rr0-video-options";element;panel;sizeLabel;sizeSelect;checks;bounds;startButton;kitButton;texts;filming;share=0;failure;set messages(e){this.texts=e,this.update()}open(){this.panel.hidden&&this.openOptions()}toggleOptions(){this.panel.hidden?this.openOptions():this.closeOptions()}openOptions(){this.fillSizes(),this.fillBounds(),this.panel.hidden=!1,this.element.setAttribute("aria-expanded","true"),this.startButton.focus(),document.addEventListener("pointerdown",this.closeOnOutside,!0)}closeOptions(){this.panel.hidden=!0,this.element.setAttribute("aria-expanded","false"),document.removeEventListener("pointerdown",this.closeOnOutside,!0)}closeOnOutside=e=>{const t=e.composedPath();!t.includes(this.panel)&&!t.includes(this.element)&&this.closeOptions()};fillSizes(){const e=this.filmer.pictureSize(),t=e.height>0?e.width/e.height:16/9,s=this.sizeSelect.value,i=`${e.width} × ${e.height}`,a=[{value:"",text:(this.texts?.videoSizeScreen??"").replace("{size}",i)}];for(const o of c.HEIGHTS)a.push({value:String(o),text:`${Math.round(o*t/2)*2} × ${o}`});this.sizeSelect.replaceChildren(...a.map(({value:o,text:l})=>{const r=document.createElement("option");return r.value=o,r.textContent=l,r})),this.sizeSelect.value=a.some(o=>o.value===s)?s:"";const n=this.checks.map;n.input.disabled=!this.filmer.hasMap(),n.label.parentElement.classList.toggle("disabled",n.input.disabled)}fillBounds(){this.bounds.from.input.placeholder=c.formatSeconds(0),this.bounds.to.input.placeholder=c.formatSeconds(this.filmer.durationS()),this.checkBounds()}boundsS(){const e=this.filmer.durationS(),t=s=>{const i=c.secondsOf(s);return i===void 0||i>=0&&i<=e+.001?i:NaN};return{fromS:t(this.bounds.from.input.value),toS:t(this.bounds.to.input.value)}}checkBounds(){const{fromS:e,toS:t}=this.boundsS(),s=(e??0)>=(t??this.filmer.durationS()),i=Number.isNaN(e)||s&&e!==void 0,a=Number.isNaN(t)||s&&t!==void 0;this.bounds.from.input.setAttribute("aria-invalid",String(i)),this.bounds.to.input.setAttribute("aria-invalid",String(a)),this.startButton.disabled=i||a||s,this.kitButton.disabled=this.startButton.disabled}static formatSeconds(e){const t=Math.max(0,Math.round(e)),s=Math.floor(t/3600),i=Math.floor(t/60)%60,a=String(t%60).padStart(2,"0");return s>0?`${s}:${String(i).padStart(2,"0")}:${a}`:`${i}:${a}`}static secondsOf(e){const t=e.trim().replace(",",".");if(t!=="")return/^\d+(\.\d+)?$|^\d+(:\d{1,2}){1,2}(\.\d+)?$/.test(t)?t.split(":").reduce((s,i)=>s*60+Number(i),0):NaN}options(){const e=Number(this.sizeSelect.value),{fromS:t,toS:s}=this.boundsS();return{...e>0?{height:e}:{},...t!==void 0&&!Number.isNaN(t)?{fromS:t}:{},...s!==void 0&&!Number.isNaN(s)?{toS:s}:{},caption:this.checks.caption.input.checked,time:this.checks.time.input.checked,map:this.checks.map.input.checked&&!this.checks.map.input.disabled}}restoreOptions(){let e={};try{e=JSON.parse(localStorage.getItem(c.STORAGE_KEY)??"{}")}catch{}this.checks.caption.input.checked=e.caption??!0,this.checks.time.input.checked=e.time??!0,this.checks.map.input.checked=e.map??!1,this.sizeSelect.replaceChildren(new Option("",e.height?String(e.height):"")),this.sizeSelect.value=e.height?String(e.height):""}keepOptions(e){try{const{fromS:t,toS:s,...i}=e;localStorage.setItem(c.STORAGE_KEY,JSON.stringify(i))}catch{}}async film(e,t){this.closeOptions(),this.keepOptions(e);const s=new AbortController;this.filming=s,this.share=0,this.failure=void 0,this.update();try{const i=a=>{this.share=a,this.update()};t&&this.filmer.generativeKit?this.save(await this.filmer.generativeKit(e,i,s.signal),this.filmer.kitFileName?.()??"kit.zip"):this.save(await this.filmer.film(e,i,s.signal),this.filmer.fileName())}catch(i){s.signal.aborted||(this.failure=i instanceof Error?i.message:String(i),console.error(i))}finally{this.filming=void 0,this.update()}}save(e,t){const s=URL.createObjectURL(e),i=document.createElement("a");i.href=s,i.download=t,i.click(),setTimeout(()=>URL.revokeObjectURL(s),6e4)}update(){const e=Math.floor(this.share*100);this.filming?(this.element.textContent=`${e} %`,this.element.classList.add("filming")):(this.element.innerHTML=d.VIDEO,this.element.classList.remove("filming"));const t=this.texts,s=t?this.filming?t.recordingVideo.replace("{percent}",String(e)):this.failure?`${t.recordVideo}. ${t.videoFailed.replace("{reason}",this.failure)}`:t.recordVideo:"";this.element.title=s,this.element.setAttribute("aria-label",s),this.sizeLabel.textContent=t?.videoSize??"",this.checks.caption.label.textContent=t?.videoCaption??"",this.checks.time.label.textContent=t?.videoTime??"",this.checks.map.label.textContent=t?.videoMap??"",this.startButton.textContent=t?.videoStart??"",this.kitButton.textContent=t?.videoKit??"",this.kitButton.title=t?.videoKitHint??"",this.bounds.from.label.textContent=t?.videoFrom??"",this.bounds.to.label.textContent=t?.videoTo??"";for(const{here:i}of Object.values(this.bounds))i.textContent=t?.videoHere??"",i.title=t?.videoHereHint??"";this.panel.hidden||this.fillSizes()}}export{c as VideoButton};
1
+ import{P as d}from"./ShareDialogElement-EzLob2Tz.js";import"./rr0-ufoathome.mjs";import"./Sighting-B7bsiTIQ.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 c{constructor(e,t){this.filmer=e,this.element=t??document.createElement("button"),this.element.type="button",this.element.id="video-button",this.element.setAttribute("aria-haspopup","true"),this.element.addEventListener("click",n=>{n.stopPropagation(),this.filming?this.filming.abort():this.toggleOptions()}),this.panel=document.createElement("div"),this.panel.className="video-options",this.panel.hidden=!0;for(const n of["click","pointerdown","pointerup","dblclick"])this.panel.addEventListener(n,o=>o.stopPropagation());this.panel.addEventListener("keydown",n=>{n.key==="Escape"&&(this.closeOptions(),this.element.focus())});const s=document.createElement("label");s.className="video-size",this.sizeLabel=document.createElement("span"),this.sizeSelect=document.createElement("select"),s.append(this.sizeLabel,this.sizeSelect),this.panel.append(s);const i=()=>{const n=document.createElement("div");n.className="video-bound";const o=document.createElement("label"),l=document.createElement("span"),r=document.createElement("input");r.type="text",r.inputMode="numeric",r.size=7,r.addEventListener("input",()=>this.checkBounds()),o.append(l,r);const h=document.createElement("button");return h.type="button",h.className="video-here",h.addEventListener("click",()=>{r.value=c.formatSeconds(this.filmer.positionS()),this.checkBounds()}),n.append(o,h),this.panel.append(n),{label:l,input:r,here:h}};this.bounds={from:i(),to:i()};const a=()=>{const n=document.createElement("label"),o=document.createElement("input");o.type="checkbox";const l=document.createElement("span");return n.append(o,l),this.panel.append(n),{input:o,label:l}};this.checks={caption:a(),time:a(),map:a()},this.startButton=document.createElement("button"),this.startButton.type="button",this.startButton.className="video-start",this.startButton.addEventListener("click",()=>void this.film(this.options(),!1)),this.panel.append(this.startButton),this.kitButton=document.createElement("button"),this.kitButton.type="button",this.kitButton.className="video-kit",this.kitButton.hidden=!this.filmer.generativeKit,this.kitButton.addEventListener("click",()=>void this.film(this.options(),!0)),this.panel.append(this.kitButton),this.restoreOptions(),this.update()}static HEIGHTS=[720,1080,2160];static STORAGE_KEY="rr0-video-options";element;panel;sizeLabel;sizeSelect;checks;bounds;startButton;kitButton;texts;filming;share=0;failure;set messages(e){this.texts=e,this.update()}open(){this.panel.hidden&&this.openOptions()}toggleOptions(){this.panel.hidden?this.openOptions():this.closeOptions()}openOptions(){this.fillSizes(),this.fillBounds(),this.panel.hidden=!1,this.element.setAttribute("aria-expanded","true"),this.startButton.focus(),document.addEventListener("pointerdown",this.closeOnOutside,!0)}closeOptions(){this.panel.hidden=!0,this.element.setAttribute("aria-expanded","false"),document.removeEventListener("pointerdown",this.closeOnOutside,!0)}closeOnOutside=e=>{const t=e.composedPath();!t.includes(this.panel)&&!t.includes(this.element)&&this.closeOptions()};fillSizes(){const e=this.filmer.pictureSize(),t=e.height>0?e.width/e.height:16/9,s=this.sizeSelect.value,i=`${e.width} × ${e.height}`,a=[{value:"",text:(this.texts?.videoSizeScreen??"").replace("{size}",i)}];for(const o of c.HEIGHTS)a.push({value:String(o),text:`${Math.round(o*t/2)*2} × ${o}`});this.sizeSelect.replaceChildren(...a.map(({value:o,text:l})=>{const r=document.createElement("option");return r.value=o,r.textContent=l,r})),this.sizeSelect.value=a.some(o=>o.value===s)?s:"";const n=this.checks.map;n.input.disabled=!this.filmer.hasMap(),n.label.parentElement.classList.toggle("disabled",n.input.disabled)}fillBounds(){this.bounds.from.input.placeholder=c.formatSeconds(0),this.bounds.to.input.placeholder=c.formatSeconds(this.filmer.durationS()),this.checkBounds()}boundsS(){const e=this.filmer.durationS(),t=s=>{const i=c.secondsOf(s);return i===void 0||i>=0&&i<=e+.001?i:NaN};return{fromS:t(this.bounds.from.input.value),toS:t(this.bounds.to.input.value)}}checkBounds(){const{fromS:e,toS:t}=this.boundsS(),s=(e??0)>=(t??this.filmer.durationS()),i=Number.isNaN(e)||s&&e!==void 0,a=Number.isNaN(t)||s&&t!==void 0;this.bounds.from.input.setAttribute("aria-invalid",String(i)),this.bounds.to.input.setAttribute("aria-invalid",String(a)),this.startButton.disabled=i||a||s,this.kitButton.disabled=this.startButton.disabled}static formatSeconds(e){const t=Math.max(0,Math.round(e)),s=Math.floor(t/3600),i=Math.floor(t/60)%60,a=String(t%60).padStart(2,"0");return s>0?`${s}:${String(i).padStart(2,"0")}:${a}`:`${i}:${a}`}static secondsOf(e){const t=e.trim().replace(",",".");if(t!=="")return/^\d+(\.\d+)?$|^\d+(:\d{1,2}){1,2}(\.\d+)?$/.test(t)?t.split(":").reduce((s,i)=>s*60+Number(i),0):NaN}options(){const e=Number(this.sizeSelect.value),{fromS:t,toS:s}=this.boundsS();return{...e>0?{height:e}:{},...t!==void 0&&!Number.isNaN(t)?{fromS:t}:{},...s!==void 0&&!Number.isNaN(s)?{toS:s}:{},caption:this.checks.caption.input.checked,time:this.checks.time.input.checked,map:this.checks.map.input.checked&&!this.checks.map.input.disabled}}restoreOptions(){let e={};try{e=JSON.parse(localStorage.getItem(c.STORAGE_KEY)??"{}")}catch{}this.checks.caption.input.checked=e.caption??!0,this.checks.time.input.checked=e.time??!0,this.checks.map.input.checked=e.map??!1,this.sizeSelect.replaceChildren(new Option("",e.height?String(e.height):"")),this.sizeSelect.value=e.height?String(e.height):""}keepOptions(e){try{const{fromS:t,toS:s,...i}=e;localStorage.setItem(c.STORAGE_KEY,JSON.stringify(i))}catch{}}async film(e,t){this.closeOptions(),this.keepOptions(e);const s=new AbortController;this.filming=s,this.share=0,this.failure=void 0,this.update();try{const i=a=>{this.share=a,this.update()};t&&this.filmer.generativeKit?this.save(await this.filmer.generativeKit(e,i,s.signal),this.filmer.kitFileName?.()??"kit.zip"):this.save(await this.filmer.film(e,i,s.signal),this.filmer.fileName())}catch(i){s.signal.aborted||(this.failure=i instanceof Error?i.message:String(i),console.error(i))}finally{this.filming=void 0,this.update()}}save(e,t){const s=URL.createObjectURL(e),i=document.createElement("a");i.href=s,i.download=t,i.click(),setTimeout(()=>URL.revokeObjectURL(s),6e4)}update(){const e=Math.floor(this.share*100);this.filming?(this.element.textContent=`${e} %`,this.element.classList.add("filming")):(this.element.innerHTML=d.VIDEO,this.element.classList.remove("filming"));const t=this.texts,s=t?this.filming?t.recordingVideo.replace("{percent}",String(e)):this.failure?`${t.recordVideo}. ${t.videoFailed.replace("{reason}",this.failure)}`:t.recordVideo:"";this.element.title=s,this.element.setAttribute("aria-label",s),this.sizeLabel.textContent=t?.videoSize??"",this.checks.caption.label.textContent=t?.videoCaption??"",this.checks.time.label.textContent=t?.videoTime??"",this.checks.map.label.textContent=t?.videoMap??"",this.startButton.textContent=t?.videoStart??"",this.kitButton.textContent=t?.videoKit??"",this.kitButton.title=t?.videoKitHint??"",this.bounds.from.label.textContent=t?.videoFrom??"",this.bounds.to.label.textContent=t?.videoTo??"";for(const{here:i}of Object.values(this.bounds))i.textContent=t?.videoHere??"",i.title=t?.videoHereHint??"";this.panel.hidden||this.fillSizes()}}export{c as VideoButton};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./SkyLantern-DJT_Ibzh.js","./Obstacles-v9SkfBD7.js","./LanternEditor-BapUZdog.js","./SaidPosition-OJEYhVKN.js","./GeoProjection-DvqDbRIx.js","./SkyEventEditorStyle-CvY_AhbI.js","./Sighting-B7bsiTIQ.js","./VisualAids-DI-hEL46.js","./ParameterForm-XbqxCLRn.js","./BirdFlock-ByBkJV35.js","./BirdEditor-Dk3huwHa.js","./TimelineTracks-Daaqw9ly.js","./DroneFlight-CGNIh9XS.js","./Decor-Dn-cvniW.js","./DroneEditor-D60uhSHO.js","./DroneParameters-CfTAaLCT.js","./BalloonEditor-dCIjTsIz.js","./BalloonFlight-CztT6ddg.js","./AirshipFlight-Dzpw8HRM.js","./AirshipEditor-CBSrQM3J.js","./CaseElement-CRXPyMMR.js","./ColumnResize-DV-byvDt.js","./ShareDialogElement-Dlfy9NCE.js","./three.module-CbaHqYFq.js","./RecordingIssue-BlWT8Xsu.js","./xyzImageryRaster-Dhxs0B26.js","./SightingElement-BJSNmFM6.js","./CaseEditorElement-0J_TCeiq.js","./InterviewAttachments-BP6Prvdu.js","./ReentryArchive-CeXHrU7L.js","./ReferenceTimeline-2kBldQeG.js","./upperAirSources-BU0pD84c.js","./Account-C4jhsVtN.js","./UfoMessages_en-D5OYWJ3K.js","./SightingEditorMessages_en-k7_ua2OM.js","./SightingLabels_en-oIpytoq_.js","./SightingEditorMessages_fr-B_K5hsuV.js","./SightingLabels_fr-D69zENbW.js","./SightingEditorMessages_es-Drqbbr5_.js","./SightingLabels_es-DUh1CTXl.js","./SightingEditorMessages_it-QCLg1d7x.js","./SightingLabels_it-COLZ2Qth.js","./SightingMessages_en-CzICxNU3.js","./SightingMessages_fr-nopOVDa1.js","./SightingMessages_es-CiVFZlgA.js","./SightingMessages_it-Cu0nnPts.js","./SceneNames_en-7OZ7peGc.js","./SceneNames_fr-qzw0QzD0.js","./SceneNames_es-P5-Mavdi.js","./SceneNames_it-Sqf8JFOd.js","./ModuleSession-BKDWGSEo.js"])))=>i.map(i=>d[i]);
2
- const dn="modulepreload",ln=function(n,t){return new URL(n,t).href},je={},d=function(t,e,r){let s=Promise.resolve();if(e&&e.length>0){let i=function(m){return Promise.all(m.map(p=>Promise.resolve(p).then(w=>({status:"fulfilled",value:w}),w=>({status:"rejected",reason:w}))))};const a=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),c=l?.nonce||l?.getAttribute("nonce");s=i(e.map(m=>{if(m=ln(m,r),m in je)return;je[m]=!0;const p=m.endsWith(".css"),w=p?'[rel="stylesheet"]':"";if(!!r)for(let S=a.length-1;S>=0;S--){const D=a[S];if(D.href===m&&(!p||D.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${m}"]${w}`))return;const _=document.createElement("link");if(_.rel=p?"stylesheet":dn,p||(_.as="script"),_.crossOrigin="",_.href=m,c&&_.setAttribute("nonce",c),document.head.appendChild(_),p)return new Promise((S,D)=>{_.addEventListener("load",S),_.addEventListener("error",()=>D(new Error(`Unable to preload CSS for ${m}`)))})}))}function o(i){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return s.then(i=>{for(const a of i||[])a.status==="rejected"&&o(a.reason);return t().catch(o)})},mn="rr0-read",hn="rr0-edit",ge="in-place",pn="rr0-mode";class Hs{static ask(t,e,r){const s=new CustomEvent(e,{detail:r,bubbles:!0,composed:!0,cancelable:!0});return t.dispatchEvent(s),s.defaultPrevented}}class j{constructor(t){this.entries=t}static free(t){return t?.basis==="assumed"||t?.basis==="fitted"}static empty(){return new j(new Map)}get size(){return this.entries.size}at(t){return this.entries.get(t)}paths(){return[...this.entries.keys()]}sourced(){return[...this.entries].filter(([,t])=>t.source!==void 0).map(([t,e])=>({path:t,basis:e.basis,source:e.source}))}interviewsCited(){const t=[];for(const{source:e}of this.sourced()){const r=e.said?.interview;r!==void 0&&!t.includes(r)&&t.push(r)}return t}pathsFromInterview(t){return this.sourced().filter(({source:e})=>e.said!==void 0&&e.said.interview===t).map(({path:e})=>e)}set(t,e){e.basis==="stated"&&e.rationale===void 0&&e.how===void 0&&e.range===void 0&&e.source===void 0?this.entries.delete(t):this.entries.set(t,e)}clear(t){for(const e of this.entries.keys())(e===t||e.startsWith(`${t}.`))&&this.entries.delete(e)}static strip(t){const e=new j(new Map);return{recording:j.stripValue(t,[],e),provenance:e}}static restore(t,e){if(e.size===0)return t;const r={...t},s=new Set([r]);for(const o of e.paths()){const i=e.at(o),a=o.split("."),l=j.writableHolderOf(r,a,s);if(!l)continue;const c=a[a.length-1],m=l[c];m!==void 0&&(i.of!==void 0&&JSON.stringify(i.of)!==JSON.stringify(m)||(l[c]={value:m,...i.basis==="stated"?{}:{basis:i.basis},...i.rationale===void 0?{}:{rationale:i.rationale},...i.how===void 0?{}:{how:i.how},...i.range===void 0?{}:{range:i.range},...i.source===void 0?{}:{source:i.source}}))}return r}static isWrapper(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&"value"in t}static stripValue(t,e,r){return j.isWrapper(t)?(r.set(e.join("."),{basis:t.basis??"stated",...t.rationale===void 0?{}:{rationale:t.rationale},...t.how===void 0?{}:{how:t.how},...t.range===void 0?{}:{range:t.range},...t.source===void 0?{}:{source:t.source},of:t.value}),j.stripValue(t.value,e,r)):Array.isArray(t)?t.map((s,o)=>j.stripValue(s,[...e,String(o)],r)):typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t).map(([s,o])=>[s,j.stripValue(o,[...e,s],r)])):t}static writableHolderOf(t,e,r){let s=t;for(const o of e.slice(0,-1)){const i=s[o];if(typeof i!="object"||i===null)return;if(r.has(i)){s=i;continue}const a=Array.isArray(i)?[...i]:{...i};r.add(a),s[o]=a,s=a}return s}}class fn extends Error{constructor(t,e,r){super(typeof e=="number"&&Number.isInteger(e)&&e>=1?`This ${t} file is in version ${e} of its format; this UFO@home reads version ${r}. Read it with the UFO@home that reads its version.`:`This ${t} file states ${JSON.stringify(e)} as its format version, which is not a version.`),this.format=t,this.found=e,this.supported=r,this.name="FormatVersionError"}said(t){return t.replace("{found}",typeof this.found=="number"?String(this.found):JSON.stringify(this.found)).replace("{supported}",String(this.supported))}}class ct{static CURRENT={sighting:4,case:1,interview:1};static SCHEMA_BASE="https://ufoathome.org/schema";static schemaUrl(t,e=ct.CURRENT[t]){return`${ct.SCHEMA_BASE}/${e}/${t}.schema.json`}static of(t){if(typeof t!="object"||t===null)return 1;const e=t.version;return e===void 0?1:typeof e=="object"&&e!==null&&"value"in e?e.value:e}static recording(t){return ct.check(t,"sighting")}static check(t,e){const r=ct.of(t),s=ct.CURRENT[e];if(typeof r!="number"||!Number.isInteger(r)||r!==s)throw new fn(e,r,s);return t}}class N{static built=new WeakMap;static computers=new WeakMap;static loading=new WeakMap;static loaded(t,e){return e.every(r=>N.itemsOf(t,r.key).length===0||N.computers.has(r))}static load(t,e){return Promise.all(e.filter(r=>N.itemsOf(t,r.key).length>0&&!N.computers.has(r)).map(r=>{let s=N.loading.get(r);return s||(s=r.compute().then(o=>{N.computers.set(r,o)}),s.catch(()=>N.loading.delete(r)),N.loading.set(r,s)),s.catch(()=>{})})).then(()=>{})}static of(t){let e=N.built.get(t);return e||(e=t.create(),N.built.set(t,e)),e}static itemsOf(t,e){const r=t?.[e];return Array.isArray(r)?r:[]}static computes(t,e){return e.some(r=>N.itemsOf(t,r.key).length>0)}static expand(t,e,r){return N.expandWithKinds(t,e,r).interpretation}static expandWithKinds(t,e,r){const s=new Map,o=new Map;if(!t||!N.computes(t,e))return{interpretation:t,kindOf:s,phenomenonOf:o};const i=e.flatMap(a=>N.itemsOf(t,a.key).flatMap(l=>{const c=N.computers.get(a);if(!c)return[];const m=c(l,r),p=a.phenomenon?.(l);for(const w of m)s.set(w.id,a),p&&o.set(w.id,p);return m}));return{interpretation:{...t,bodies:[...t.bodies,...i]},kindOf:s,phenomenonOf:o}}static computedPart(t,e){const r={};for(const s of e){const o=N.itemsOf(t,s.key);o.length>0&&(r[s.key]=[...o])}return r}static saysNothing(t,e){return t.bodies.length===0&&t.title===void 0&&t.smoke===void 0&&e.every(r=>t[r.key]===void 0)}}const Ls=Object.freeze(Object.defineProperty({__proto__:null,InterpretationKinds:N},Symbol.toStringTag,{value:"Module"}));class Wr extends Error{constructor(t,e,r,s){super(`Module "${t}" gives "${r}" at ${e}, which module "${s}" already gives`),this.moduleId=t,this.point=e,this.sourceId=r,this.ownerId=s,this.name="ModuleConflictError"}}class gn{constructor(t){this.id=t}sources=[];owners=new Map;ownerOf(t){return this.owners.get(t)}conflict(t,e){for(const r of e){const s=this.owners.get(r.id);if(s!==void 0&&s!==t)return{sourceId:r.id,ownerId:s}}}provide(t,e){const r=this.conflict(t,e);if(r)throw new Wr(t,this.id,r.sourceId,r.ownerId);this.withdraw(t);const s=t===v.BUILT_IN?this.sources.findIndex(o=>this.owners.get(o.id)!==v.BUILT_IN):-1;s<0?this.sources.push(...e):this.sources.splice(s,0,...e);for(const o of e)this.owners.set(o.id,t);return this.sources}withdraw(t){for(let e=this.sources.length-1;e>=0;e--){const r=this.sources[e].id;this.owners.get(r)===t&&(this.sources.splice(e,1),this.owners.delete(r))}}}class v{static BUILT_IN="ufoathome";static changes=new EventTarget;static points=new Map;static modules=new Map;static point(t){let e=v.points.get(t);return e||(e=new gn(t),v.points.set(t,e)),e}static install(t){if(t.id===v.BUILT_IN)throw new Error(`"${v.BUILT_IN}" is the id of the built-in module`);const e=v.contributionsOf(t);for(const[o,i]of e){const a=v.point(o).conflict(t.id,i);if(a)throw new Wr(t.id,o,a.sourceId,a.ownerId)}const r=new Set(e.map(([o])=>o)),s=v.modules.get(t.id);if(s)for(const[o]of v.contributionsOf(s))r.add(o);for(const o of r)v.point(o).withdraw(t.id);for(const[o,i]of e)v.point(o).provide(t.id,i);v.modules.set(t.id,t);for(const o of r)v.announce(o)}static uninstall(t){const e=v.modules.get(t);if(e){v.modules.delete(t);for(const[r]of v.contributionsOf(e))v.point(r).withdraw(t),v.announce(r)}}static installed(){return[...v.modules.values()]}static contributionsOf(t){return Object.entries(t.contributes).filter(e=>Array.isArray(e[1])&&e[1].length>0)}static announce(t){v.changes.dispatchEvent(new CustomEvent("change",{detail:t}))}}const wn=["en","fr","es","it"];class T{static catalog(t){const e=new Map;return{load(r){const s=T.languageOf(r);let o=e.get(s);return o||(o=t[s](),e.set(s,o),o.catch(()=>e.delete(s))),o}}}static none(){return new Proxy({},{get:()=>""})}static blank(){const t=new Proxy(()=>t,{get:(e,r)=>r===Symbol.toPrimitive?()=>"":r===Symbol.iterator?function*(){}:r==="toString"||r==="valueOf"?()=>"":r==="then"?void 0:t,apply:()=>t,has:()=>!1,ownKeys:()=>[],getOwnPropertyDescriptor:()=>{}});return t}static languageOf(t){const e=t.toLowerCase().split("-")[0];return wn.includes(e)?e:"en"}}const bn=T.catalog({en:()=>d(()=>import("./FlareKindMessages_en-j3CY_TxX.js"),[],import.meta.url).then(n=>n.flareKindMessages_en),fr:()=>d(()=>import("./FlareKindMessages_fr-B2MezoN2.js"),[],import.meta.url).then(n=>n.flareKindMessages_fr),es:()=>d(()=>import("./FlareKindMessages_es-CZgrFIOO.js"),[],import.meta.url).then(n=>n.flareKindMessages_es),it:()=>d(()=>import("./FlareKindMessages_it-CmZmb3RP.js"),[],import.meta.url).then(n=>n.flareKindMessages_it)});class J{constructor(t={}){this.options=t,this.fetchImpl=t.fetchImpl??fetch.bind(globalThis),this.wait=t.wait??(e=>new Promise(r=>setTimeout(r,e)))}static URL="https://historical-forecast-api.open-meteo.com/v1/forecast";static CREDIT="Open-Meteo historical forecast";static LEVELS=[850,700,600,500,400,300];static RETRIES=6;static RETRY_MS=2e3;days=new Map;fetchImpl;wait;async profile(t,e,r){const o=new Date(Math.floor(r.getTime()/36e5)*36e5),i=(r.getTime()-o.getTime())/36e5,a=await this.hourly(t,e,o);if(i<1e-6)return a;const l=await this.hourly(t,e,new Date(o.getTime()+36e5));return a.levels.length!==l.levels.length?i<.5?a:l:{...a,hour:r.toISOString().slice(0,16),levels:a.levels.map((c,m)=>{const[p,w]=K.vector(c.wind),[b,_]=K.vector(l.levels[m].wind);return{aboveGroundM:c.aboveGroundM+i*(l.levels[m].aboveGroundM-c.aboveGroundM),wind:K.fromVector(p+i*(b-p),w+i*(_-w))}})}}async hourly(t,e,r){const s=r.toISOString().slice(0,13)+":00",o=s.slice(0,10),i=`${t.toFixed(4)},${e.toFixed(4)},${o}`;let a=this.days.get(i);return a||(a=this.day(t,e,o,i),a.catch(()=>this.days.delete(i)),this.days.set(i,a)),J.profileOf(await a,s)}static profileOf(t,e){const r=t.hourly,s=r.time.indexOf(e);if(s<0)throw new Error(`No wind for ${e} in the archive's answer`);const o=c=>(c+180)%360,i=[],a=r.wind_speed_10m?.[s],l=r.wind_direction_10m?.[s];typeof a=="number"&&typeof l=="number"&&i.push({aboveGroundM:10,wind:{towardDeg:o(l),speedMS:a}});for(const c of J.LEVELS){const m=r[`geopotential_height_${c}hPa`]?.[s],p=r[`wind_speed_${c}hPa`]?.[s],w=r[`wind_direction_${c}hPa`]?.[s];if(typeof m!="number"||typeof p!="number"||typeof w!="number")continue;const b=m-t.elevation;b<=(i[i.length-1]?.aboveGroundM??0)||i.push({aboveGroundM:b,wind:{towardDeg:o(w),speedMS:p}})}if(i.length===0)throw new Error(`No wind for ${e} in the archive's answer`);return{lat:t.latitude,lng:t.longitude,elevationM:t.elevation,hour:e,levels:i,credit:J.CREDIT}}async day(t,e,r,s){const o=await this.options.cache?.get(s);if(o)return JSON.parse(o);const i=["wind_speed_10m","wind_direction_10m",...J.LEVELS.flatMap(c=>[`wind_speed_${c}hPa`,`wind_direction_${c}hPa`,`geopotential_height_${c}hPa`])],a=new URLSearchParams({latitude:String(t),longitude:String(e),start_date:r,end_date:r,hourly:i.join(","),wind_speed_unit:"ms",timezone:"GMT"}),l=`${this.options.url??J.URL}?${a}`;for(let c=0;;c++){const m=await this.fetchImpl(l);if(m.ok){const p=await m.text();return await this.options.cache?.set(s,p),JSON.parse(p)}if((m.status===429||m.status>=500)&&c<J.RETRIES){await this.wait(J.RETRY_MS*2**c);continue}throw new Error(`The wind archive answered ${m.status} for ${s}`)}}}class K{static at(t,e){const r=t.levels;if(e<=r[0].aboveGroundM)return{...r[0].wind};for(let s=1;s<r.length;s++){const o=r[s-1],i=r[s];if(e<=i.aboveGroundM){const a=(e-o.aboveGroundM)/(i.aboveGroundM-o.aboveGroundM),[l,c]=K.vector(o.wind),[m,p]=K.vector(i.wind);return K.fromVector(l+a*(m-l),c+a*(p-c))}}return{...r[r.length-1].wind}}static vector(t){const e=t.towardDeg*Math.PI/180;return[t.speedMS*Math.sin(e),t.speedMS*Math.cos(e)]}static fromVector(t,e){return{towardDeg:(Math.atan2(t,e)*180/Math.PI+360)%360,speedMS:Math.hypot(t,e)}}static rounded(t){return{towardDeg:Math.round(t.towardDeg)%360,speedMS:Math.round(t.speedMS*100)/100}}}const Ks=Object.freeze(Object.defineProperty({__proto__:null,OpenMeteoWindProfiles:J,Winds:K},Symbol.toStringTag,{value:"Module"})),En=K.rounded,He={key:"flares",messages:bn,phenomenon:()=>"DecoyFlare",inWind:(n,t)=>({...n,wind:En(t.at(n.aircraft.altitudeM))}),compute:()=>d(async()=>{const{DecoyFlare:n}=await import("./DecoyFlare-DUt1_LcW.js");return{DecoyFlare:n}},[],import.meta.url).then(({DecoyFlare:n})=>t=>n.bodiesOf(t))},yn=T.catalog({en:()=>d(()=>import("./LanternKindMessages_en-CQXdJ-k6.js"),[],import.meta.url).then(n=>n.lanternKindMessages_en),fr:()=>d(()=>import("./LanternKindMessages_fr-D7tQa_tQ.js"),[],import.meta.url).then(n=>n.lanternKindMessages_fr),es:()=>d(()=>import("./LanternKindMessages_es-BOO6kPjs.js"),[],import.meta.url).then(n=>n.lanternKindMessages_es),it:()=>d(()=>import("./LanternKindMessages_it-B8J-29Mj.js"),[],import.meta.url).then(n=>n.lanternKindMessages_it)}),Le=K.rounded,Ke={key:"lanterns",messages:yn,phenomenon:()=>"SkyLantern",inWind:(n,t)=>{const e=n.site.altitudeM??0,r=n.windAloft?.atM??1e3;return{...n,wind:Le(t.at(10)),windAloft:{...Le(t.at(e+r)),atM:r}}},compute:()=>d(async()=>{const{SkyLantern:n}=await import("./SkyLantern-DJT_Ibzh.js");return{SkyLantern:n}},__vite__mapDeps([0,1]),import.meta.url).then(({SkyLantern:n})=>(t,e)=>n.bodiesOf(t,e?.obstacles)),editor:()=>d(async()=>{const{LanternEditor:n}=await import("./LanternEditor-BapUZdog.js");return{LanternEditor:n}},__vite__mapDeps([2,3,4,5,0,1,6,7,8]),import.meta.url).then(({LanternEditor:n})=>(t,e,r)=>new n(t,e,r))},Sn=T.catalog({en:()=>d(()=>import("./BirdKindMessages_en-c_-L7frF.js"),[],import.meta.url).then(n=>n.birdKindMessages_en),fr:()=>d(()=>import("./BirdKindMessages_fr-C1TuqqEj.js"),[],import.meta.url).then(n=>n.birdKindMessages_fr),es:()=>d(()=>import("./BirdKindMessages_es-8Zo2t0o4.js"),[],import.meta.url).then(n=>n.birdKindMessages_es),it:()=>d(()=>import("./BirdKindMessages_it-DQZcrCkf.js"),[],import.meta.url).then(n=>n.birdKindMessages_it)}),ze={key:"birds",messages:Sn,phenomenon:()=>"Birds",compute:()=>d(async()=>{const{BirdFlock:n}=await import("./BirdFlock-ByBkJV35.js").then(t=>t.b);return{BirdFlock:n}},__vite__mapDeps([9,1]),import.meta.url).then(({BirdFlock:n})=>(t,e)=>n.bodiesOf(t,e?.obstacles)),editor:()=>d(async()=>{const{BirdEditor:n}=await import("./BirdEditor-Dk3huwHa.js");return{BirdEditor:n}},__vite__mapDeps([10,3,4,5,9,1,8,11]),import.meta.url).then(({BirdEditor:n})=>(t,e,r)=>new n(t,e,r))},xn=T.catalog({en:()=>d(()=>import("./DroneKindMessages_en-CLygXcsv.js"),[],import.meta.url).then(n=>n.droneKindMessages_en),fr:()=>d(()=>import("./DroneKindMessages_fr-CAX15_pk.js"),[],import.meta.url).then(n=>n.droneKindMessages_fr),es:()=>d(()=>import("./DroneKindMessages_es-B9XFRYnQ.js"),[],import.meta.url).then(n=>n.droneKindMessages_es),it:()=>d(()=>import("./DroneKindMessages_it-CSGsCaJQ.js"),[],import.meta.url).then(n=>n.droneKindMessages_it)}),qe={quadcopter:"ConsumerDrone",saucer:"ConsumerDrone","fixed-wing":"MilitaryDrone"},We={key:"drones",messages:xn,phenomenon:n=>qe[n.airframe]??qe.quadcopter,compute:()=>d(async()=>{const{DroneFlight:n}=await import("./DroneFlight-CGNIh9XS.js").then(t=>t.c);return{DroneFlight:n}},__vite__mapDeps([12,13]),import.meta.url).then(({DroneFlight:n})=>t=>n.bodiesOf(t)),editor:()=>d(async()=>{const{DroneEditor:n}=await import("./DroneEditor-D60uhSHO.js");return{DroneEditor:n}},__vite__mapDeps([14,3,4,5,15,12,13,8,11]),import.meta.url).then(({DroneEditor:n})=>(t,e,r)=>new n(t,e,r))},Mn=T.catalog({en:()=>d(()=>import("./BalloonKindMessages_en-C6tZ-5gT.js"),[],import.meta.url).then(n=>n.balloonKindMessages_en),fr:()=>d(()=>import("./BalloonKindMessages_fr-C3QJIuDJ.js"),[],import.meta.url).then(n=>n.balloonKindMessages_fr),es:()=>d(()=>import("./BalloonKindMessages_es-BfoEjhe1.js"),[],import.meta.url).then(n=>n.balloonKindMessages_es),it:()=>d(()=>import("./BalloonKindMessages_it-CkO7mqHp.js"),[],import.meta.url).then(n=>n.balloonKindMessages_it)}),zs=["round","star","heart","figure"];class ae{static HELIUM_KG_MOL=.0040026;static ALL=[{id:"hot-air",modelId:"ufoathome-balloon-hot-air",envelope:"open",launchVolumeM3:2550,maxVolumeM3:2550,massKg:540,dragCoefficient:.5,aspect:1.461,widthM:16.5,color:"#c8202f",stripeColor:"#f5c400",albedo:.4,burner:{heatingKS:1.2,coolingS:400,blastS:6,maxExcessK:100,flameCdM2:2e4,envelopeCdM2:40,color:"#ffb347"},phenomenon:"WeatherBalloonsOrMongolfieres",durationS:3600},{id:"party",modelId:"ufoathome-balloon-latex",envelope:"elastic",launchVolumeM3:.0115,maxVolumeM3:.0335,massKg:.0045,dragCoefficient:.47,aspect:1.13,color:"#d8263a",albedo:.35,phenomenon:"WeatherBalloonsOrMongolfieres",durationS:3600},{id:"led",modelId:"ufoathome-balloon-led",envelope:"elastic",launchVolumeM3:.0141,maxVolumeM3:.041,massKg:.0075,dragCoefficient:.47,aspect:1.115,color:"#ffffff",albedo:.5,glow:{candela:.5,color:"#ffffff"},phenomenon:"LedBalloon",durationS:3600},{id:"foil",modelId:"ufoathome-balloon-foil",envelope:"vented",launchVolumeM3:.014,maxVolumeM3:.014,massKg:.01,dragCoefficient:.6,aspect:1.034,widthM:.45,depthRatio:.267,color:"#c9cdd2",albedo:.85,finish:"mirror",spins:!0,shapes:{round:{modelId:"ufoathome-balloon-foil",aspect:1.034,widthM:.45,depthRatio:.267,launchVolumeM3:.014,maxVolumeM3:.014,massKg:.01,color:"#c9cdd2"},star:{modelId:"ufoathome-balloon-foil-star",aspect:1.029,widthM:.5,depthRatio:.183,launchVolumeM3:.012,maxVolumeM3:.012,massKg:.009,color:"#e0b83a"},heart:{modelId:"ufoathome-balloon-foil-heart",aspect:.903,widthM:.5,depthRatio:.2,launchVolumeM3:.014,maxVolumeM3:.014,massKg:.01,color:"#d81e3c"},figure:{modelId:"ufoathome-balloon-foil-figure",aspect:1.112,widthM:.8,depthRatio:.127,launchVolumeM3:.05,maxVolumeM3:.05,massKg:.03,color:"#f0a3c8"}},phenomenon:"FoilBalloon",durationS:3600},{id:"pilot",modelId:"ufoathome-balloon-latex",envelope:"elastic",launchVolumeM3:.144,maxVolumeM3:.57,massKg:.045,dragCoefficient:.4,aspect:1.13,color:"#f0e6cf",albedo:.55,lamp:{candela:1,color:"#fff1c4"},phenomenon:"WeatherBalloonsOrMongolfieres",durationS:5400},{id:"weather",modelId:"ufoathome-balloon-latex",envelope:"elastic",launchVolumeM3:1.75,maxVolumeM3:118.9,massKg:.85,dragCoefficient:.3,aspect:1.13,color:"#f2ece0",albedo:.55,phenomenon:"WeatherBalloonsOrMongolfieres",durationS:7200},{id:"stratospheric",modelId:"ufoathome-balloon-stratospheric",envelope:"vented",launchVolumeM3:219,maxVolumeM3:14e3,massKg:210,dragCoefficient:.4,aspect:.91,color:"#e9eef2",albedo:.8,ballastKg:20,phenomenon:"StratosphericBalloons",durationS:10800},{id:"stratospheric-large",modelId:"ufoathome-balloon-stratospheric",envelope:"vented",launchVolumeM3:730,maxVolumeM3:15e4,massKg:700,dragCoefficient:.4,aspect:.91,color:"#e9eef2",albedo:.8,ballastKg:140,phenomenon:"StratosphericBalloons",durationS:14400},{id:"superpressure",modelId:"ufoathome-balloon-latex",envelope:"superpressure",launchVolumeM3:45,maxVolumeM3:523,massKg:44,dragCoefficient:.4,aspect:1.13,color:"#eef1f4",albedo:.8,phenomenon:"StratosphericBalloons",durationS:10800},{id:"infrared",modelId:"ufoathome-balloon-stratospheric",envelope:"open",launchVolumeM3:2075,maxVolumeM3:45e3,massKg:150,dragCoefficient:.4,aspect:.91,color:"#9aa0a8",albedo:.4,insideExcessK:20,phenomenon:"StratosphericBalloons",durationS:10800},{id:"prank-candles",modelId:"ufoathome-balloon-prank",envelope:"open",launchVolumeM3:.25,maxVolumeM3:.25,massKg:.02,dragCoefficient:.6,aspect:1.515,widthM:.6,color:"#f4f4f4",albedo:.6,insideExcessK:60,spins:!0,sways:!0,flames:{count:4,candela:.5,color:"#ffb347",burnS:720,coolingS:15},phenomenon:"SkyLantern",durationS:1200},{id:"prank-flares",modelId:"ufoathome-balloon-prank",envelope:"open",launchVolumeM3:2,maxVolumeM3:2,massKg:.3,dragCoefficient:.6,aspect:1.515,widthM:1.2,color:"#2b2d30",albedo:.1,insideExcessK:80,spins:!0,sways:!0,flames:{count:1,candela:150,color:"#ff3a20",burnS:900,coolingS:30},phenomenon:"SkyLantern",durationS:1500},{id:"anti-hail",modelId:"ufoathome-balloon-latex",envelope:"elastic",launchVolumeM3:.65,maxVolumeM3:8,massKg:.4,dragCoefficient:.35,aspect:1.13,color:"#f2ece0",albedo:.55,torch:{aboveM:600,candela:300,color:"#ff9a3c",burnS:90,fallMS:4},phenomenon:"ParachuteFlare",durationS:1200},{id:"solar",modelId:"ufoathome-balloon-latex",envelope:"open",launchVolumeM3:14,maxVolumeM3:14,massKg:.4,dragCoefficient:.47,aspect:1.13,color:"#151515",albedo:.05,insideExcessK:10,phenomenon:"WeatherBalloonsOrMongolfieres",durationS:3600},{id:"captive",modelId:"ufoathome-balloon-latex",envelope:"sealed",tethered:!0,launchVolumeM3:14,maxVolumeM3:14,massKg:8,dragCoefficient:.47,aspect:1.13,color:"#f4f4f4",albedo:.7,phenomenon:"WeatherBalloonsOrMongolfieres",durationS:3600}];static byId(t){return ae.ALL.find(e=>e.id===t)}}const Ye=K.rounded,Xe={key:"balloons",messages:Mn,phenomenon:n=>{const t=typeof n.balloon=="string"?n.balloon:n.balloon?.id;return(ae.byId(t)??ae.ALL[0]).phenomenon},inWind:(n,t)=>{const e=n.site.altitudeM??0;return{...n,wind:Ye(t.at(10)),windsAloft:t.levels.filter(r=>r>e+10).map(r=>({...Ye(t.at(r)),atM:Math.round(r-e)}))}},compute:()=>d(async()=>{const{BalloonFlight:n}=await import("./BalloonFlight-CztT6ddg.js");return{BalloonFlight:n}},[],import.meta.url).then(({BalloonFlight:n})=>t=>n.bodiesOf(t)),editor:()=>d(async()=>{const{BalloonEditor:n}=await import("./BalloonEditor-dCIjTsIz.js");return{BalloonEditor:n}},__vite__mapDeps([16,3,4,5,15,12,13,17,6,7,8]),import.meta.url).then(({BalloonEditor:n})=>(t,e,r)=>new n(t,e,r))},vn=T.catalog({en:()=>d(()=>import("./AirshipKindMessages_en-DzGapVTV.js"),[],import.meta.url).then(n=>n.airshipKindMessages_en),fr:()=>d(()=>import("./AirshipKindMessages_fr-BTXNsW5W.js"),[],import.meta.url).then(n=>n.airshipKindMessages_fr),es:()=>d(()=>import("./AirshipKindMessages_es-TE93uMSC.js"),[],import.meta.url).then(n=>n.airshipKindMessages_es),it:()=>d(()=>import("./AirshipKindMessages_it-Cwa3MnJ-.js"),[],import.meta.url).then(n=>n.airshipKindMessages_it)}),oe=(n,t,e,r=5)=>({"nav-left":{color:"#ff2a1a",candela:r,leds:[{at:n,radiusM:.06}]},"nav-right":{color:"#2aff5a",candela:r,leds:[{at:t,radiusM:.06}]},tail:{color:"#ffffff",candela:r,leds:[{at:e,radiusM:.06}]}});class ue{static ALL=[{id:"blimp",modelId:"ufoathome-airship-blimp",sizeM:{widthM:14.72,lengthM:59.46,heightM:17.59},cruiseMS:15,maxSpeedMS:22,color:"#c9ccd1",finColor:"#1d3f8a",albedo:.6,sign:{color:"#fff4d8",luminanceCdM2:150,lit:!0},lights:{...oe([-1.22,-8.6,-9],[1.22,-8.6,-9],[0,0,29.7]),strobe:{color:"#ffffff",candela:400,hz:1,flashS:.06,leds:[{at:[0,-10.15,-9],radiusM:.08}]}},sound:"light-piston",phenomenon:"Airship"},{id:"zeppelin-nt",modelId:"ufoathome-airship-zeppelin-nt",sizeM:{widthM:18.2,lengthM:75.11,heightM:19.55},cruiseMS:19,maxSpeedMS:35,color:"#eef0f2",finColor:"#eef0f2",albedo:.75,sign:{color:"#fff4d8",luminanceCdM2:150,lit:!1},lights:{...oe([-1.32,-8.4,-14],[1.32,-8.4,-14],[0,0,37.5]),strobe:{color:"#ffffff",candela:400,hz:1,flashS:.06,leds:[{at:[0,-9.65,-14],radiusM:.08}]}},sound:"light-piston",phenomenon:"Airship"},{id:"lightship",modelId:"ufoathome-airship-lightship",sizeM:{widthM:10.16,lengthM:39.66,heightM:11.98},cruiseMS:13,maxSpeedMS:20,color:"#f4f4f2",finColor:"#f4f4f2",albedo:.7,glowCdM2:20,lights:oe([-.82,-5.9,-6],[.82,-5.9,-6],[0,0,19.8]),sound:"light-piston",phenomenon:"Airship"},{id:"aerostat",modelId:"ufoathome-airship-aerostat",sizeM:{widthM:25.14,lengthM:63.6,heightM:27.05},cruiseMS:0,maxSpeedMS:0,tethered:!0,color:"#f2f2f0",finColor:"#f2f2f0",albedo:.7,lights:{nose:{color:"#ff2a1a",candela:2e3,hz:.5,flashS:.6,leds:[{at:[0,-4.2,-30],radiusM:.12}]},stern:{color:"#ff2a1a",candela:2e3,hz:.5,flashS:.6,leds:[{at:[0,-6.3,22],radiusM:.12}]}},phenomenon:"Airship"},{id:"rigid",modelId:"ufoathome-airship-rigid",sizeM:{widthM:33.38,lengthM:236.66,heightM:35.79},cruiseMS:32,maxSpeedMS:36,color:"#b9bcbf",finColor:"#b9bcbf",albedo:.55,lights:oe([-3.02,-16.5,-80],[3.02,-16.5,-80],[0,0,118.3],10),sound:"piston-heavy",phenomenon:"Airship"}];static byId(t){return ue.ALL.find(e=>e.id===t)}}const Je={key:"airships",messages:vn,phenomenon:n=>{const t=typeof n.airship=="string"?n.airship:n.airship?.id;return(ue.byId(t)??ue.ALL[0]).phenomenon},compute:()=>d(async()=>{const{AirshipFlight:n}=await import("./AirshipFlight-Dzpw8HRM.js");return{AirshipFlight:n}},__vite__mapDeps([18,12,13]),import.meta.url).then(({AirshipFlight:n})=>t=>n.bodiesOf(t)),editor:()=>d(async()=>{const{AirshipEditor:n}=await import("./AirshipEditor-CBSrQM3J.js");return{AirshipEditor:n}},__vite__mapDeps([19,3,4,5,15,12,13,18,8,11]),import.meta.url).then(({AirshipEditor:n})=>(t,e,r)=>new n(t,e,r))},Yr=v.point("interpretations").provide(v.BUILT_IN,[{id:He.key,name:"Decoy flares",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>He},{id:Ke.key,name:"Sky lanterns",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>Ke},{id:ze.key,name:"Birds",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>ze},{id:We.key,name:"Drones",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>We},{id:Xe.key,name:"Balloons",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>Xe},{id:Je.key,name:"Airships",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>Je}]);class Ge{static kinds(){return Yr.map(t=>N.of(t))}}const qs=Object.freeze(Object.defineProperty({__proto__:null,INTERPRETATION_SOURCES:Yr,InterpretationRegistry:Ge},Symbol.toStringTag,{value:"Module"}));class H{static SIGHTING_EVENT="sighting";static INTERPRETATION_EVENT="interpretation";static INTERVIEW_EVENT="interview";static check(t){return ct.check(t,"case")}static isCase(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&Array.isArray(t.events)&&!("timeline"in t)}static sightingUrls(t,e){return(t.events??[]).filter(r=>r.eventType===H.SIGHTING_EVENT&&!r.interpretationOf&&typeof r.url=="string"&&r.url!=="").map(r=>new URL(r.url,e).href)}static accountIds(t,e,r,s){const o=(t.events??[]).filter(i=>i.eventType===H.SIGHTING_EVENT&&i.id!==void 0&&typeof i.url=="string"&&r!==void 0&&new URL(i.url,e).href===r).map(i=>i.id);return s!==void 0&&o.push(s),o}static interpretationEvents(t,e){const r=[e].flat().filter(s=>!!s);return r.length===0?[]:(t.events??[]).filter(s=>s.eventType===H.INTERPRETATION_EVENT?s.sighting!==void 0&&r.includes(s.sighting):s.eventType!==H.SIGHTING_EVENT||s.interpretationOf===void 0?!1:[s.interpretationOf].flat().some(o=>r.includes(o))).map(s=>s)}static problems(t,e){const r=t.events??[],s=new Set,o=new Set;for(const a of r)a.id!==void 0&&(s.has(a.id)&&o.add(a.id),s.add(a.id));const i=[];for(const a of r){const l=a.eventType===H.SIGHTING_EVENT?a.interpretationOf:a.eventType===H.INTERVIEW_EVENT?a.interviewOf:void 0;if(l!==void 0)for(const c of[l].flat())!s.has(c)&&!e.includes(c)&&i.push({reading:a.url??a.id??"",reference:c})}return{duplicateIds:[...o],unresolved:i}}static async interpretationOf(t,e,r){if(t.bodies)return H.withModelsFrom(j.strip({title:t.title,bodies:t.bodies??[],smoke:t.smoke,findings:t.findings,...N.computedPart(t,Ge.kinds())}).recording,e);if(!t.url)return{title:t.title,bodies:[]};const s=new URL(t.url,e).href,o=await r(s),i="timeline"in o&&o.interpretation?o.interpretation:o;return H.withModelsFrom(j.strip({title:t.title??i.title,bodies:i.bodies??[],smoke:i.smoke,findings:i.findings,...N.computedPart(i,Ge.kinds())}).recording,s)}static withModelsFrom(t,e){return{...t,bodies:t.bodies.map(r=>r.model?.url?{...r,model:{...r.model,url:new URL(r.model.url,e).href}}:r)}}}class k{static files=new Map;static hold(t){for(const[e,r]of t)k.files.set(k.key(e),r)}static releaseCopies(){for(const[t,e]of k.files)e.local||k.files.delete(t)}static clear(){k.files.clear()}static localBase(){return new URL(`local/${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}/`,location.href).href}static read(t){const e=k.files.get(k.key(t));return e===void 0?void 0:structuredClone(e.json)}static changed(...t){return t.some(e=>e!==void 0&&k.files.get(k.key(e))?.changed===!0)}static local(t){return t!==void 0&&k.files.get(k.key(t))?.local===!0}static key(t){const e=new URL(t,location.href);return e.hash="",e.href}}class q{static NAMES=["weather","place","lightPollution","decor"];static KEYS={weather:["weatherTrack","weatherSource"],place:["place"],lightPollution:["lightPollution"],decor:["decor"]};static annexName(t,e){return`${t}.${e.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`)}.json`}static taken(t,e){const r={};if(t==="decor")return Array.isArray(e.decor)&&(r.decor=e.decor.filter(q.surveyed)),r;for(const s of q.KEYS[t])e[s]!==void 0&&(r[s]=e[s]);return r}static strip(t,e){if(t==="decor"){const r=Array.isArray(e.decor)?e.decor.filter(s=>!q.surveyed(s)):[];r.length>0?e.decor=r:delete e.decor;return}for(const r of q.KEYS[t])delete e[r]}static put(t,e,r){if(t==="decor"){if(!Array.isArray(r.decor))return;const s=Array.isArray(e.decor)?e.decor.filter(o=>!q.surveyed(o)):[];e.decor=[...s,...r.decor];return}for(const s of q.KEYS[t])r[s]!==void 0&&(e[s]=r[s])}static surveyed(t){return typeof t=="object"&&t!==null&&typeof t.origin=="string"}static fromFile(t,e){return t?.[e]!==void 0&&t[e].live!==!0}}class Xr{static NAMES=["relief","imagery","roads","water","railways","upperAir","map"];static TERRAIN=["relief","imagery","roads","water","railways"];static held(t,e){if(!t||t.live)return;const r=t[e];return r&&!r.live&&!r.refresh&&r.src!==void 0?r:void 0}static isLive(t,e){return t?.live===!0||t?.[e]?.live===!0}static annexName(t,e){const r=e==="relief"||e==="imagery"||e==="map"?"zip":"json",s=e.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`);return`${t}.${s}.${r}`}static isEmpty(t){return!t||!t.live&&Xr.NAMES.every(e=>!t[e])&&q.NAMES.every(e=>!t[e])}}class xt extends Error{constructor(t,e,r){super(`${t}: ${e}${r===void 0?"":` (HTTP ${r})`}`),this.kind=t,this.url=e,this.status=r,this.name="SightingFetchError"}}class ce{static async recording(t){const e=k.read(t);if(e!==void 0)return e;const r=await ce.json(t);for(const s of q.NAMES){const o=r?.snapshots?.[s];if(!(!o?.src||o.live))try{const i=ct.recording(await ce.json(new URL(o.src,new URL(t,location.href)).href));q.put(s,r,i)}catch{}}return r}static async json(t){const e=new URL(t,location.href),r=k.read(e.href);if(r!==void 0)return r;if(location.protocol==="https:"&&e.protocol==="http:")throw new xt("mixed-content",t);let s;try{s=await fetch(t)}catch{throw await this.diagnose(t,e)}if(!s.ok)throw new xt("status",t,s.status);try{return await s.json()}catch{throw new xt("malformed",t)}}static async diagnose(t,e){if(e.origin===location.origin)return new xt("unreachable",t);try{return await fetch(t,{mode:"no-cors"}),new xt("cors",t)}catch{return new xt("unreachable",t)}}}class Ve{constructor(t,e,r=()=>{}){this.place=t,this.changed=r,e&&this.adopt(e)}reader;editor;handed;get reading(){return this.reader!==void 0}get editorLoaded(){return this.editor!==void 0}adopt(t){this.editor=t,t.switcher=this,t.hasAttribute(ge)||t.setAttribute(ge,""),t.addEventListener(mn,e=>{e.preventDefault();const r=e.detail;this.handed=r.src,this.read(r)})}async read({src:t,track:e}){const[{register:r,CASE_ELEMENT_NAME:s,OPEN_EVENTS_ATTRIBUTE:o},{registerSighting:i,SIGHTING_ELEMENT_NAME:a}]=await Promise.all([d(()=>import("./CaseElement-CRXPyMMR.js"),__vite__mapDeps([20,21,22,6,7,23,3,4,13,24,25,1,26]),import.meta.url),d(()=>import("./SightingElement-BJSNmFM6.js"),__vite__mapDeps([26,22,6,7,23,3,4,13,24,25,1]),import.meta.url)]);i(),r();const l=H.isCase(k.read(t)??await ce.json(t)),c=document.createElement(l?s:a);c.setAttribute(ge,""),c.setAttribute("show-labels",""),l&&e&&c.setAttribute(o,Ve.fileKey(e)),c.setAttribute("src",t),c.addEventListener(hn,m=>{m.preventDefault(),this.edit(m.detail)}),this.reader?.remove(),this.place(c),this.editor&&(this.editor.hidden=!0),this.reader=c,this.changed({mode:"read",src:t,...e?{track:e}:{}})}async edit(t){const e=this.editor;if(e){if(this.dropReader(),k.releaseCopies(),e.hidden=!1,this.changed({mode:"edit"}),t?.src!==void 0&&t.src!==this.handed){this.load(e,t.src,t.track);return}t?.track&&await e.openTrack(t.track);return}const{register:r,CASE_EDITOR_ELEMENT_NAME:s}=await d(async()=>{const{register:i,CASE_EDITOR_ELEMENT_NAME:a}=await import("./CaseEditorElement-0J_TCeiq.js").then(l=>l.b);return{register:i,CASE_EDITOR_ELEMENT_NAME:a}},__vite__mapDeps([27,3,4,8,21,22,6,7,23,13,24,25,1,28,11,29,30,31,32]),import.meta.url);r();const o=document.createElement(s);this.adopt(o),t?.track&&o.setAttribute("track",t.track),t?.src?o.setAttribute("src",t.src):t?.start&&(o.caseStart=t.start),this.dropReader(),this.place(o),this.changed({mode:"edit"})}async open(t){const e=this.editor;if(this.reading||!e)return this.read({src:t});this.load(e,t)}load(t,e,r){this.handed=void 0,r?t.setAttribute("track",r):t.removeAttribute("track"),t.setAttribute("src",e)}async startNew(t){const e=this.editor;if(!e)return this.edit(t?{start:t}:void 0);this.reading&&await this.edit(),e.askBeforeReplacing(()=>{e.remove(),this.editor=void 0,this.edit(t?{start:t}:void 0)})}dropReader(){this.reader?.remove(),this.reader=void 0}static fileKey(t){return new URL(t,location.href).pathname.split("/").pop().replace(/\.json$/i,"")}}const Ie="rr0-input-file",Jr={inputFileFromFile:"from your disk",inputFileFromUrl:"from an address",inputFileModeHint:"Click to give it the other way: a file of yours, or an address",inputFileLoad:"Load"},An=`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./SkyLantern-DJT_Ibzh.js","./Obstacles-v9SkfBD7.js","./LanternEditor-BapUZdog.js","./SaidPosition-OJEYhVKN.js","./GeoProjection-DvqDbRIx.js","./SkyEventEditorStyle-CvY_AhbI.js","./Sighting-B7bsiTIQ.js","./VisualAids-DI-hEL46.js","./ParameterForm-XbqxCLRn.js","./BirdFlock-ByBkJV35.js","./BirdEditor-Dk3huwHa.js","./TimelineTracks-Daaqw9ly.js","./DroneFlight-CGNIh9XS.js","./Decor-Dn-cvniW.js","./DroneEditor-D60uhSHO.js","./DroneParameters-CfTAaLCT.js","./BalloonEditor-dCIjTsIz.js","./BalloonFlight-CztT6ddg.js","./AirshipFlight-Dzpw8HRM.js","./AirshipEditor-CBSrQM3J.js","./CaseElement-vCbCfGOv.js","./ColumnResize-CEXrq3KB.js","./ShareDialogElement-EzLob2Tz.js","./three.module-CbaHqYFq.js","./RecordingIssue-BlWT8Xsu.js","./xyzImageryRaster-Dhxs0B26.js","./SightingElement--qpGoyxL.js","./CaseEditorElement-HR8RFluQ.js","./InterviewAttachments-BP6Prvdu.js","./ReentryArchive-CeXHrU7L.js","./ReferenceTimeline-2kBldQeG.js","./upperAirSources-BU0pD84c.js","./Account-C4jhsVtN.js","./UfoMessages_en-D5OYWJ3K.js","./SightingEditorMessages_en-k7_ua2OM.js","./SightingLabels_en-oIpytoq_.js","./SightingEditorMessages_fr-B_K5hsuV.js","./SightingLabels_fr-D69zENbW.js","./SightingEditorMessages_es-Drqbbr5_.js","./SightingLabels_es-DUh1CTXl.js","./SightingEditorMessages_it-QCLg1d7x.js","./SightingLabels_it-COLZ2Qth.js","./SightingMessages_en-CzICxNU3.js","./SightingMessages_fr-nopOVDa1.js","./SightingMessages_es-CiVFZlgA.js","./SightingMessages_it-Cu0nnPts.js","./SceneNames_en-7OZ7peGc.js","./SceneNames_fr-qzw0QzD0.js","./SceneNames_es-P5-Mavdi.js","./SceneNames_it-Sqf8JFOd.js","./ModuleSession-BKDWGSEo.js"])))=>i.map(i=>d[i]);
2
+ const dn="modulepreload",ln=function(n,t){return new URL(n,t).href},je={},d=function(t,e,r){let s=Promise.resolve();if(e&&e.length>0){let i=function(m){return Promise.all(m.map(p=>Promise.resolve(p).then(w=>({status:"fulfilled",value:w}),w=>({status:"rejected",reason:w}))))};const a=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),c=l?.nonce||l?.getAttribute("nonce");s=i(e.map(m=>{if(m=ln(m,r),m in je)return;je[m]=!0;const p=m.endsWith(".css"),w=p?'[rel="stylesheet"]':"";if(!!r)for(let S=a.length-1;S>=0;S--){const D=a[S];if(D.href===m&&(!p||D.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${m}"]${w}`))return;const _=document.createElement("link");if(_.rel=p?"stylesheet":dn,p||(_.as="script"),_.crossOrigin="",_.href=m,c&&_.setAttribute("nonce",c),document.head.appendChild(_),p)return new Promise((S,D)=>{_.addEventListener("load",S),_.addEventListener("error",()=>D(new Error(`Unable to preload CSS for ${m}`)))})}))}function o(i){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return s.then(i=>{for(const a of i||[])a.status==="rejected"&&o(a.reason);return t().catch(o)})},mn="rr0-read",hn="rr0-edit",ge="in-place",pn="rr0-mode";class Hs{static ask(t,e,r){const s=new CustomEvent(e,{detail:r,bubbles:!0,composed:!0,cancelable:!0});return t.dispatchEvent(s),s.defaultPrevented}}class j{constructor(t){this.entries=t}static free(t){return t?.basis==="assumed"||t?.basis==="fitted"}static empty(){return new j(new Map)}get size(){return this.entries.size}at(t){return this.entries.get(t)}paths(){return[...this.entries.keys()]}sourced(){return[...this.entries].filter(([,t])=>t.source!==void 0).map(([t,e])=>({path:t,basis:e.basis,source:e.source}))}interviewsCited(){const t=[];for(const{source:e}of this.sourced()){const r=e.said?.interview;r!==void 0&&!t.includes(r)&&t.push(r)}return t}pathsFromInterview(t){return this.sourced().filter(({source:e})=>e.said!==void 0&&e.said.interview===t).map(({path:e})=>e)}set(t,e){e.basis==="stated"&&e.rationale===void 0&&e.how===void 0&&e.range===void 0&&e.source===void 0?this.entries.delete(t):this.entries.set(t,e)}clear(t){for(const e of this.entries.keys())(e===t||e.startsWith(`${t}.`))&&this.entries.delete(e)}static strip(t){const e=new j(new Map);return{recording:j.stripValue(t,[],e),provenance:e}}static restore(t,e){if(e.size===0)return t;const r={...t},s=new Set([r]);for(const o of e.paths()){const i=e.at(o),a=o.split("."),l=j.writableHolderOf(r,a,s);if(!l)continue;const c=a[a.length-1],m=l[c];m!==void 0&&(i.of!==void 0&&JSON.stringify(i.of)!==JSON.stringify(m)||(l[c]={value:m,...i.basis==="stated"?{}:{basis:i.basis},...i.rationale===void 0?{}:{rationale:i.rationale},...i.how===void 0?{}:{how:i.how},...i.range===void 0?{}:{range:i.range},...i.source===void 0?{}:{source:i.source}}))}return r}static isWrapper(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&"value"in t}static stripValue(t,e,r){return j.isWrapper(t)?(r.set(e.join("."),{basis:t.basis??"stated",...t.rationale===void 0?{}:{rationale:t.rationale},...t.how===void 0?{}:{how:t.how},...t.range===void 0?{}:{range:t.range},...t.source===void 0?{}:{source:t.source},of:t.value}),j.stripValue(t.value,e,r)):Array.isArray(t)?t.map((s,o)=>j.stripValue(s,[...e,String(o)],r)):typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t).map(([s,o])=>[s,j.stripValue(o,[...e,s],r)])):t}static writableHolderOf(t,e,r){let s=t;for(const o of e.slice(0,-1)){const i=s[o];if(typeof i!="object"||i===null)return;if(r.has(i)){s=i;continue}const a=Array.isArray(i)?[...i]:{...i};r.add(a),s[o]=a,s=a}return s}}class fn extends Error{constructor(t,e,r){super(typeof e=="number"&&Number.isInteger(e)&&e>=1?`This ${t} file is in version ${e} of its format; this UFO@home reads version ${r}. Read it with the UFO@home that reads its version.`:`This ${t} file states ${JSON.stringify(e)} as its format version, which is not a version.`),this.format=t,this.found=e,this.supported=r,this.name="FormatVersionError"}said(t){return t.replace("{found}",typeof this.found=="number"?String(this.found):JSON.stringify(this.found)).replace("{supported}",String(this.supported))}}class ct{static CURRENT={sighting:4,case:1,interview:1};static SCHEMA_BASE="https://ufoathome.org/schema";static schemaUrl(t,e=ct.CURRENT[t]){return`${ct.SCHEMA_BASE}/${e}/${t}.schema.json`}static of(t){if(typeof t!="object"||t===null)return 1;const e=t.version;return e===void 0?1:typeof e=="object"&&e!==null&&"value"in e?e.value:e}static recording(t){return ct.check(t,"sighting")}static check(t,e){const r=ct.of(t),s=ct.CURRENT[e];if(typeof r!="number"||!Number.isInteger(r)||r!==s)throw new fn(e,r,s);return t}}class N{static built=new WeakMap;static computers=new WeakMap;static loading=new WeakMap;static loaded(t,e){return e.every(r=>N.itemsOf(t,r.key).length===0||N.computers.has(r))}static load(t,e){return Promise.all(e.filter(r=>N.itemsOf(t,r.key).length>0&&!N.computers.has(r)).map(r=>{let s=N.loading.get(r);return s||(s=r.compute().then(o=>{N.computers.set(r,o)}),s.catch(()=>N.loading.delete(r)),N.loading.set(r,s)),s.catch(()=>{})})).then(()=>{})}static of(t){let e=N.built.get(t);return e||(e=t.create(),N.built.set(t,e)),e}static itemsOf(t,e){const r=t?.[e];return Array.isArray(r)?r:[]}static computes(t,e){return e.some(r=>N.itemsOf(t,r.key).length>0)}static expand(t,e,r){return N.expandWithKinds(t,e,r).interpretation}static expandWithKinds(t,e,r){const s=new Map,o=new Map;if(!t||!N.computes(t,e))return{interpretation:t,kindOf:s,phenomenonOf:o};const i=e.flatMap(a=>N.itemsOf(t,a.key).flatMap(l=>{const c=N.computers.get(a);if(!c)return[];const m=c(l,r),p=a.phenomenon?.(l);for(const w of m)s.set(w.id,a),p&&o.set(w.id,p);return m}));return{interpretation:{...t,bodies:[...t.bodies,...i]},kindOf:s,phenomenonOf:o}}static computedPart(t,e){const r={};for(const s of e){const o=N.itemsOf(t,s.key);o.length>0&&(r[s.key]=[...o])}return r}static saysNothing(t,e){return t.bodies.length===0&&t.title===void 0&&t.smoke===void 0&&e.every(r=>t[r.key]===void 0)}}const Ls=Object.freeze(Object.defineProperty({__proto__:null,InterpretationKinds:N},Symbol.toStringTag,{value:"Module"}));class Wr extends Error{constructor(t,e,r,s){super(`Module "${t}" gives "${r}" at ${e}, which module "${s}" already gives`),this.moduleId=t,this.point=e,this.sourceId=r,this.ownerId=s,this.name="ModuleConflictError"}}class gn{constructor(t){this.id=t}sources=[];owners=new Map;ownerOf(t){return this.owners.get(t)}conflict(t,e){for(const r of e){const s=this.owners.get(r.id);if(s!==void 0&&s!==t)return{sourceId:r.id,ownerId:s}}}provide(t,e){const r=this.conflict(t,e);if(r)throw new Wr(t,this.id,r.sourceId,r.ownerId);this.withdraw(t);const s=t===v.BUILT_IN?this.sources.findIndex(o=>this.owners.get(o.id)!==v.BUILT_IN):-1;s<0?this.sources.push(...e):this.sources.splice(s,0,...e);for(const o of e)this.owners.set(o.id,t);return this.sources}withdraw(t){for(let e=this.sources.length-1;e>=0;e--){const r=this.sources[e].id;this.owners.get(r)===t&&(this.sources.splice(e,1),this.owners.delete(r))}}}class v{static BUILT_IN="ufoathome";static changes=new EventTarget;static points=new Map;static modules=new Map;static point(t){let e=v.points.get(t);return e||(e=new gn(t),v.points.set(t,e)),e}static install(t){if(t.id===v.BUILT_IN)throw new Error(`"${v.BUILT_IN}" is the id of the built-in module`);const e=v.contributionsOf(t);for(const[o,i]of e){const a=v.point(o).conflict(t.id,i);if(a)throw new Wr(t.id,o,a.sourceId,a.ownerId)}const r=new Set(e.map(([o])=>o)),s=v.modules.get(t.id);if(s)for(const[o]of v.contributionsOf(s))r.add(o);for(const o of r)v.point(o).withdraw(t.id);for(const[o,i]of e)v.point(o).provide(t.id,i);v.modules.set(t.id,t);for(const o of r)v.announce(o)}static uninstall(t){const e=v.modules.get(t);if(e){v.modules.delete(t);for(const[r]of v.contributionsOf(e))v.point(r).withdraw(t),v.announce(r)}}static installed(){return[...v.modules.values()]}static contributionsOf(t){return Object.entries(t.contributes).filter(e=>Array.isArray(e[1])&&e[1].length>0)}static announce(t){v.changes.dispatchEvent(new CustomEvent("change",{detail:t}))}}const wn=["en","fr","es","it"];class T{static catalog(t){const e=new Map;return{load(r){const s=T.languageOf(r);let o=e.get(s);return o||(o=t[s](),e.set(s,o),o.catch(()=>e.delete(s))),o}}}static none(){return new Proxy({},{get:()=>""})}static blank(){const t=new Proxy(()=>t,{get:(e,r)=>r===Symbol.toPrimitive?()=>"":r===Symbol.iterator?function*(){}:r==="toString"||r==="valueOf"?()=>"":r==="then"?void 0:t,apply:()=>t,has:()=>!1,ownKeys:()=>[],getOwnPropertyDescriptor:()=>{}});return t}static languageOf(t){const e=t.toLowerCase().split("-")[0];return wn.includes(e)?e:"en"}}const bn=T.catalog({en:()=>d(()=>import("./FlareKindMessages_en-j3CY_TxX.js"),[],import.meta.url).then(n=>n.flareKindMessages_en),fr:()=>d(()=>import("./FlareKindMessages_fr-B2MezoN2.js"),[],import.meta.url).then(n=>n.flareKindMessages_fr),es:()=>d(()=>import("./FlareKindMessages_es-CZgrFIOO.js"),[],import.meta.url).then(n=>n.flareKindMessages_es),it:()=>d(()=>import("./FlareKindMessages_it-CmZmb3RP.js"),[],import.meta.url).then(n=>n.flareKindMessages_it)});class J{constructor(t={}){this.options=t,this.fetchImpl=t.fetchImpl??fetch.bind(globalThis),this.wait=t.wait??(e=>new Promise(r=>setTimeout(r,e)))}static URL="https://historical-forecast-api.open-meteo.com/v1/forecast";static CREDIT="Open-Meteo historical forecast";static LEVELS=[850,700,600,500,400,300];static RETRIES=6;static RETRY_MS=2e3;days=new Map;fetchImpl;wait;async profile(t,e,r){const o=new Date(Math.floor(r.getTime()/36e5)*36e5),i=(r.getTime()-o.getTime())/36e5,a=await this.hourly(t,e,o);if(i<1e-6)return a;const l=await this.hourly(t,e,new Date(o.getTime()+36e5));return a.levels.length!==l.levels.length?i<.5?a:l:{...a,hour:r.toISOString().slice(0,16),levels:a.levels.map((c,m)=>{const[p,w]=K.vector(c.wind),[b,_]=K.vector(l.levels[m].wind);return{aboveGroundM:c.aboveGroundM+i*(l.levels[m].aboveGroundM-c.aboveGroundM),wind:K.fromVector(p+i*(b-p),w+i*(_-w))}})}}async hourly(t,e,r){const s=r.toISOString().slice(0,13)+":00",o=s.slice(0,10),i=`${t.toFixed(4)},${e.toFixed(4)},${o}`;let a=this.days.get(i);return a||(a=this.day(t,e,o,i),a.catch(()=>this.days.delete(i)),this.days.set(i,a)),J.profileOf(await a,s)}static profileOf(t,e){const r=t.hourly,s=r.time.indexOf(e);if(s<0)throw new Error(`No wind for ${e} in the archive's answer`);const o=c=>(c+180)%360,i=[],a=r.wind_speed_10m?.[s],l=r.wind_direction_10m?.[s];typeof a=="number"&&typeof l=="number"&&i.push({aboveGroundM:10,wind:{towardDeg:o(l),speedMS:a}});for(const c of J.LEVELS){const m=r[`geopotential_height_${c}hPa`]?.[s],p=r[`wind_speed_${c}hPa`]?.[s],w=r[`wind_direction_${c}hPa`]?.[s];if(typeof m!="number"||typeof p!="number"||typeof w!="number")continue;const b=m-t.elevation;b<=(i[i.length-1]?.aboveGroundM??0)||i.push({aboveGroundM:b,wind:{towardDeg:o(w),speedMS:p}})}if(i.length===0)throw new Error(`No wind for ${e} in the archive's answer`);return{lat:t.latitude,lng:t.longitude,elevationM:t.elevation,hour:e,levels:i,credit:J.CREDIT}}async day(t,e,r,s){const o=await this.options.cache?.get(s);if(o)return JSON.parse(o);const i=["wind_speed_10m","wind_direction_10m",...J.LEVELS.flatMap(c=>[`wind_speed_${c}hPa`,`wind_direction_${c}hPa`,`geopotential_height_${c}hPa`])],a=new URLSearchParams({latitude:String(t),longitude:String(e),start_date:r,end_date:r,hourly:i.join(","),wind_speed_unit:"ms",timezone:"GMT"}),l=`${this.options.url??J.URL}?${a}`;for(let c=0;;c++){const m=await this.fetchImpl(l);if(m.ok){const p=await m.text();return await this.options.cache?.set(s,p),JSON.parse(p)}if((m.status===429||m.status>=500)&&c<J.RETRIES){await this.wait(J.RETRY_MS*2**c);continue}throw new Error(`The wind archive answered ${m.status} for ${s}`)}}}class K{static at(t,e){const r=t.levels;if(e<=r[0].aboveGroundM)return{...r[0].wind};for(let s=1;s<r.length;s++){const o=r[s-1],i=r[s];if(e<=i.aboveGroundM){const a=(e-o.aboveGroundM)/(i.aboveGroundM-o.aboveGroundM),[l,c]=K.vector(o.wind),[m,p]=K.vector(i.wind);return K.fromVector(l+a*(m-l),c+a*(p-c))}}return{...r[r.length-1].wind}}static vector(t){const e=t.towardDeg*Math.PI/180;return[t.speedMS*Math.sin(e),t.speedMS*Math.cos(e)]}static fromVector(t,e){return{towardDeg:(Math.atan2(t,e)*180/Math.PI+360)%360,speedMS:Math.hypot(t,e)}}static rounded(t){return{towardDeg:Math.round(t.towardDeg)%360,speedMS:Math.round(t.speedMS*100)/100}}}const Ks=Object.freeze(Object.defineProperty({__proto__:null,OpenMeteoWindProfiles:J,Winds:K},Symbol.toStringTag,{value:"Module"})),En=K.rounded,He={key:"flares",messages:bn,phenomenon:()=>"DecoyFlare",inWind:(n,t)=>({...n,wind:En(t.at(n.aircraft.altitudeM))}),compute:()=>d(async()=>{const{DecoyFlare:n}=await import("./DecoyFlare-DUt1_LcW.js");return{DecoyFlare:n}},[],import.meta.url).then(({DecoyFlare:n})=>t=>n.bodiesOf(t))},yn=T.catalog({en:()=>d(()=>import("./LanternKindMessages_en-CQXdJ-k6.js"),[],import.meta.url).then(n=>n.lanternKindMessages_en),fr:()=>d(()=>import("./LanternKindMessages_fr-D7tQa_tQ.js"),[],import.meta.url).then(n=>n.lanternKindMessages_fr),es:()=>d(()=>import("./LanternKindMessages_es-BOO6kPjs.js"),[],import.meta.url).then(n=>n.lanternKindMessages_es),it:()=>d(()=>import("./LanternKindMessages_it-B8J-29Mj.js"),[],import.meta.url).then(n=>n.lanternKindMessages_it)}),Le=K.rounded,Ke={key:"lanterns",messages:yn,phenomenon:()=>"SkyLantern",inWind:(n,t)=>{const e=n.site.altitudeM??0,r=n.windAloft?.atM??1e3;return{...n,wind:Le(t.at(10)),windAloft:{...Le(t.at(e+r)),atM:r}}},compute:()=>d(async()=>{const{SkyLantern:n}=await import("./SkyLantern-DJT_Ibzh.js");return{SkyLantern:n}},__vite__mapDeps([0,1]),import.meta.url).then(({SkyLantern:n})=>(t,e)=>n.bodiesOf(t,e?.obstacles)),editor:()=>d(async()=>{const{LanternEditor:n}=await import("./LanternEditor-BapUZdog.js");return{LanternEditor:n}},__vite__mapDeps([2,3,4,5,0,1,6,7,8]),import.meta.url).then(({LanternEditor:n})=>(t,e,r)=>new n(t,e,r))},Sn=T.catalog({en:()=>d(()=>import("./BirdKindMessages_en-c_-L7frF.js"),[],import.meta.url).then(n=>n.birdKindMessages_en),fr:()=>d(()=>import("./BirdKindMessages_fr-C1TuqqEj.js"),[],import.meta.url).then(n=>n.birdKindMessages_fr),es:()=>d(()=>import("./BirdKindMessages_es-8Zo2t0o4.js"),[],import.meta.url).then(n=>n.birdKindMessages_es),it:()=>d(()=>import("./BirdKindMessages_it-DQZcrCkf.js"),[],import.meta.url).then(n=>n.birdKindMessages_it)}),ze={key:"birds",messages:Sn,phenomenon:()=>"Birds",compute:()=>d(async()=>{const{BirdFlock:n}=await import("./BirdFlock-ByBkJV35.js").then(t=>t.b);return{BirdFlock:n}},__vite__mapDeps([9,1]),import.meta.url).then(({BirdFlock:n})=>(t,e)=>n.bodiesOf(t,e?.obstacles)),editor:()=>d(async()=>{const{BirdEditor:n}=await import("./BirdEditor-Dk3huwHa.js");return{BirdEditor:n}},__vite__mapDeps([10,3,4,5,9,1,8,11]),import.meta.url).then(({BirdEditor:n})=>(t,e,r)=>new n(t,e,r))},xn=T.catalog({en:()=>d(()=>import("./DroneKindMessages_en-CLygXcsv.js"),[],import.meta.url).then(n=>n.droneKindMessages_en),fr:()=>d(()=>import("./DroneKindMessages_fr-CAX15_pk.js"),[],import.meta.url).then(n=>n.droneKindMessages_fr),es:()=>d(()=>import("./DroneKindMessages_es-B9XFRYnQ.js"),[],import.meta.url).then(n=>n.droneKindMessages_es),it:()=>d(()=>import("./DroneKindMessages_it-CSGsCaJQ.js"),[],import.meta.url).then(n=>n.droneKindMessages_it)}),qe={quadcopter:"ConsumerDrone",saucer:"ConsumerDrone","fixed-wing":"MilitaryDrone"},We={key:"drones",messages:xn,phenomenon:n=>qe[n.airframe]??qe.quadcopter,compute:()=>d(async()=>{const{DroneFlight:n}=await import("./DroneFlight-CGNIh9XS.js").then(t=>t.c);return{DroneFlight:n}},__vite__mapDeps([12,13]),import.meta.url).then(({DroneFlight:n})=>t=>n.bodiesOf(t)),editor:()=>d(async()=>{const{DroneEditor:n}=await import("./DroneEditor-D60uhSHO.js");return{DroneEditor:n}},__vite__mapDeps([14,3,4,5,15,12,13,8,11]),import.meta.url).then(({DroneEditor:n})=>(t,e,r)=>new n(t,e,r))},Mn=T.catalog({en:()=>d(()=>import("./BalloonKindMessages_en-C6tZ-5gT.js"),[],import.meta.url).then(n=>n.balloonKindMessages_en),fr:()=>d(()=>import("./BalloonKindMessages_fr-C3QJIuDJ.js"),[],import.meta.url).then(n=>n.balloonKindMessages_fr),es:()=>d(()=>import("./BalloonKindMessages_es-BfoEjhe1.js"),[],import.meta.url).then(n=>n.balloonKindMessages_es),it:()=>d(()=>import("./BalloonKindMessages_it-CkO7mqHp.js"),[],import.meta.url).then(n=>n.balloonKindMessages_it)}),zs=["round","star","heart","figure"];class ae{static HELIUM_KG_MOL=.0040026;static ALL=[{id:"hot-air",modelId:"ufoathome-balloon-hot-air",envelope:"open",launchVolumeM3:2550,maxVolumeM3:2550,massKg:540,dragCoefficient:.5,aspect:1.461,widthM:16.5,color:"#c8202f",stripeColor:"#f5c400",albedo:.4,burner:{heatingKS:1.2,coolingS:400,blastS:6,maxExcessK:100,flameCdM2:2e4,envelopeCdM2:40,color:"#ffb347"},phenomenon:"WeatherBalloonsOrMongolfieres",durationS:3600},{id:"party",modelId:"ufoathome-balloon-latex",envelope:"elastic",launchVolumeM3:.0115,maxVolumeM3:.0335,massKg:.0045,dragCoefficient:.47,aspect:1.13,color:"#d8263a",albedo:.35,phenomenon:"WeatherBalloonsOrMongolfieres",durationS:3600},{id:"led",modelId:"ufoathome-balloon-led",envelope:"elastic",launchVolumeM3:.0141,maxVolumeM3:.041,massKg:.0075,dragCoefficient:.47,aspect:1.115,color:"#ffffff",albedo:.5,glow:{candela:.5,color:"#ffffff"},phenomenon:"LedBalloon",durationS:3600},{id:"foil",modelId:"ufoathome-balloon-foil",envelope:"vented",launchVolumeM3:.014,maxVolumeM3:.014,massKg:.01,dragCoefficient:.6,aspect:1.034,widthM:.45,depthRatio:.267,color:"#c9cdd2",albedo:.85,finish:"mirror",spins:!0,shapes:{round:{modelId:"ufoathome-balloon-foil",aspect:1.034,widthM:.45,depthRatio:.267,launchVolumeM3:.014,maxVolumeM3:.014,massKg:.01,color:"#c9cdd2"},star:{modelId:"ufoathome-balloon-foil-star",aspect:1.029,widthM:.5,depthRatio:.183,launchVolumeM3:.012,maxVolumeM3:.012,massKg:.009,color:"#e0b83a"},heart:{modelId:"ufoathome-balloon-foil-heart",aspect:.903,widthM:.5,depthRatio:.2,launchVolumeM3:.014,maxVolumeM3:.014,massKg:.01,color:"#d81e3c"},figure:{modelId:"ufoathome-balloon-foil-figure",aspect:1.112,widthM:.8,depthRatio:.127,launchVolumeM3:.05,maxVolumeM3:.05,massKg:.03,color:"#f0a3c8"}},phenomenon:"FoilBalloon",durationS:3600},{id:"pilot",modelId:"ufoathome-balloon-latex",envelope:"elastic",launchVolumeM3:.144,maxVolumeM3:.57,massKg:.045,dragCoefficient:.4,aspect:1.13,color:"#f0e6cf",albedo:.55,lamp:{candela:1,color:"#fff1c4"},phenomenon:"WeatherBalloonsOrMongolfieres",durationS:5400},{id:"weather",modelId:"ufoathome-balloon-latex",envelope:"elastic",launchVolumeM3:1.75,maxVolumeM3:118.9,massKg:.85,dragCoefficient:.3,aspect:1.13,color:"#f2ece0",albedo:.55,phenomenon:"WeatherBalloonsOrMongolfieres",durationS:7200},{id:"stratospheric",modelId:"ufoathome-balloon-stratospheric",envelope:"vented",launchVolumeM3:219,maxVolumeM3:14e3,massKg:210,dragCoefficient:.4,aspect:.91,color:"#e9eef2",albedo:.8,ballastKg:20,phenomenon:"StratosphericBalloons",durationS:10800},{id:"stratospheric-large",modelId:"ufoathome-balloon-stratospheric",envelope:"vented",launchVolumeM3:730,maxVolumeM3:15e4,massKg:700,dragCoefficient:.4,aspect:.91,color:"#e9eef2",albedo:.8,ballastKg:140,phenomenon:"StratosphericBalloons",durationS:14400},{id:"superpressure",modelId:"ufoathome-balloon-latex",envelope:"superpressure",launchVolumeM3:45,maxVolumeM3:523,massKg:44,dragCoefficient:.4,aspect:1.13,color:"#eef1f4",albedo:.8,phenomenon:"StratosphericBalloons",durationS:10800},{id:"infrared",modelId:"ufoathome-balloon-stratospheric",envelope:"open",launchVolumeM3:2075,maxVolumeM3:45e3,massKg:150,dragCoefficient:.4,aspect:.91,color:"#9aa0a8",albedo:.4,insideExcessK:20,phenomenon:"StratosphericBalloons",durationS:10800},{id:"prank-candles",modelId:"ufoathome-balloon-prank",envelope:"open",launchVolumeM3:.25,maxVolumeM3:.25,massKg:.02,dragCoefficient:.6,aspect:1.515,widthM:.6,color:"#f4f4f4",albedo:.6,insideExcessK:60,spins:!0,sways:!0,flames:{count:4,candela:.5,color:"#ffb347",burnS:720,coolingS:15},phenomenon:"SkyLantern",durationS:1200},{id:"prank-flares",modelId:"ufoathome-balloon-prank",envelope:"open",launchVolumeM3:2,maxVolumeM3:2,massKg:.3,dragCoefficient:.6,aspect:1.515,widthM:1.2,color:"#2b2d30",albedo:.1,insideExcessK:80,spins:!0,sways:!0,flames:{count:1,candela:150,color:"#ff3a20",burnS:900,coolingS:30},phenomenon:"SkyLantern",durationS:1500},{id:"anti-hail",modelId:"ufoathome-balloon-latex",envelope:"elastic",launchVolumeM3:.65,maxVolumeM3:8,massKg:.4,dragCoefficient:.35,aspect:1.13,color:"#f2ece0",albedo:.55,torch:{aboveM:600,candela:300,color:"#ff9a3c",burnS:90,fallMS:4},phenomenon:"ParachuteFlare",durationS:1200},{id:"solar",modelId:"ufoathome-balloon-latex",envelope:"open",launchVolumeM3:14,maxVolumeM3:14,massKg:.4,dragCoefficient:.47,aspect:1.13,color:"#151515",albedo:.05,insideExcessK:10,phenomenon:"WeatherBalloonsOrMongolfieres",durationS:3600},{id:"captive",modelId:"ufoathome-balloon-latex",envelope:"sealed",tethered:!0,launchVolumeM3:14,maxVolumeM3:14,massKg:8,dragCoefficient:.47,aspect:1.13,color:"#f4f4f4",albedo:.7,phenomenon:"WeatherBalloonsOrMongolfieres",durationS:3600}];static byId(t){return ae.ALL.find(e=>e.id===t)}}const Ye=K.rounded,Xe={key:"balloons",messages:Mn,phenomenon:n=>{const t=typeof n.balloon=="string"?n.balloon:n.balloon?.id;return(ae.byId(t)??ae.ALL[0]).phenomenon},inWind:(n,t)=>{const e=n.site.altitudeM??0;return{...n,wind:Ye(t.at(10)),windsAloft:t.levels.filter(r=>r>e+10).map(r=>({...Ye(t.at(r)),atM:Math.round(r-e)}))}},compute:()=>d(async()=>{const{BalloonFlight:n}=await import("./BalloonFlight-CztT6ddg.js");return{BalloonFlight:n}},[],import.meta.url).then(({BalloonFlight:n})=>t=>n.bodiesOf(t)),editor:()=>d(async()=>{const{BalloonEditor:n}=await import("./BalloonEditor-dCIjTsIz.js");return{BalloonEditor:n}},__vite__mapDeps([16,3,4,5,15,12,13,17,6,7,8]),import.meta.url).then(({BalloonEditor:n})=>(t,e,r)=>new n(t,e,r))},vn=T.catalog({en:()=>d(()=>import("./AirshipKindMessages_en-DzGapVTV.js"),[],import.meta.url).then(n=>n.airshipKindMessages_en),fr:()=>d(()=>import("./AirshipKindMessages_fr-BTXNsW5W.js"),[],import.meta.url).then(n=>n.airshipKindMessages_fr),es:()=>d(()=>import("./AirshipKindMessages_es-TE93uMSC.js"),[],import.meta.url).then(n=>n.airshipKindMessages_es),it:()=>d(()=>import("./AirshipKindMessages_it-Cwa3MnJ-.js"),[],import.meta.url).then(n=>n.airshipKindMessages_it)}),oe=(n,t,e,r=5)=>({"nav-left":{color:"#ff2a1a",candela:r,leds:[{at:n,radiusM:.06}]},"nav-right":{color:"#2aff5a",candela:r,leds:[{at:t,radiusM:.06}]},tail:{color:"#ffffff",candela:r,leds:[{at:e,radiusM:.06}]}});class ue{static ALL=[{id:"blimp",modelId:"ufoathome-airship-blimp",sizeM:{widthM:14.72,lengthM:59.46,heightM:17.59},cruiseMS:15,maxSpeedMS:22,color:"#c9ccd1",finColor:"#1d3f8a",albedo:.6,sign:{color:"#fff4d8",luminanceCdM2:150,lit:!0},lights:{...oe([-1.22,-8.6,-9],[1.22,-8.6,-9],[0,0,29.7]),strobe:{color:"#ffffff",candela:400,hz:1,flashS:.06,leds:[{at:[0,-10.15,-9],radiusM:.08}]}},sound:"light-piston",phenomenon:"Airship"},{id:"zeppelin-nt",modelId:"ufoathome-airship-zeppelin-nt",sizeM:{widthM:18.2,lengthM:75.11,heightM:19.55},cruiseMS:19,maxSpeedMS:35,color:"#eef0f2",finColor:"#eef0f2",albedo:.75,sign:{color:"#fff4d8",luminanceCdM2:150,lit:!1},lights:{...oe([-1.32,-8.4,-14],[1.32,-8.4,-14],[0,0,37.5]),strobe:{color:"#ffffff",candela:400,hz:1,flashS:.06,leds:[{at:[0,-9.65,-14],radiusM:.08}]}},sound:"light-piston",phenomenon:"Airship"},{id:"lightship",modelId:"ufoathome-airship-lightship",sizeM:{widthM:10.16,lengthM:39.66,heightM:11.98},cruiseMS:13,maxSpeedMS:20,color:"#f4f4f2",finColor:"#f4f4f2",albedo:.7,glowCdM2:20,lights:oe([-.82,-5.9,-6],[.82,-5.9,-6],[0,0,19.8]),sound:"light-piston",phenomenon:"Airship"},{id:"aerostat",modelId:"ufoathome-airship-aerostat",sizeM:{widthM:25.14,lengthM:63.6,heightM:27.05},cruiseMS:0,maxSpeedMS:0,tethered:!0,color:"#f2f2f0",finColor:"#f2f2f0",albedo:.7,lights:{nose:{color:"#ff2a1a",candela:2e3,hz:.5,flashS:.6,leds:[{at:[0,-4.2,-30],radiusM:.12}]},stern:{color:"#ff2a1a",candela:2e3,hz:.5,flashS:.6,leds:[{at:[0,-6.3,22],radiusM:.12}]}},phenomenon:"Airship"},{id:"rigid",modelId:"ufoathome-airship-rigid",sizeM:{widthM:33.38,lengthM:236.66,heightM:35.79},cruiseMS:32,maxSpeedMS:36,color:"#b9bcbf",finColor:"#b9bcbf",albedo:.55,lights:oe([-3.02,-16.5,-80],[3.02,-16.5,-80],[0,0,118.3],10),sound:"piston-heavy",phenomenon:"Airship"}];static byId(t){return ue.ALL.find(e=>e.id===t)}}const Je={key:"airships",messages:vn,phenomenon:n=>{const t=typeof n.airship=="string"?n.airship:n.airship?.id;return(ue.byId(t)??ue.ALL[0]).phenomenon},compute:()=>d(async()=>{const{AirshipFlight:n}=await import("./AirshipFlight-Dzpw8HRM.js");return{AirshipFlight:n}},__vite__mapDeps([18,12,13]),import.meta.url).then(({AirshipFlight:n})=>t=>n.bodiesOf(t)),editor:()=>d(async()=>{const{AirshipEditor:n}=await import("./AirshipEditor-CBSrQM3J.js");return{AirshipEditor:n}},__vite__mapDeps([19,3,4,5,15,12,13,18,8,11]),import.meta.url).then(({AirshipEditor:n})=>(t,e,r)=>new n(t,e,r))},Yr=v.point("interpretations").provide(v.BUILT_IN,[{id:He.key,name:"Decoy flares",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>He},{id:Ke.key,name:"Sky lanterns",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>Ke},{id:ze.key,name:"Birds",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>ze},{id:We.key,name:"Drones",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>We},{id:Xe.key,name:"Balloons",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>Xe},{id:Je.key,name:"Airships",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>Je}]);class Ge{static kinds(){return Yr.map(t=>N.of(t))}}const qs=Object.freeze(Object.defineProperty({__proto__:null,INTERPRETATION_SOURCES:Yr,InterpretationRegistry:Ge},Symbol.toStringTag,{value:"Module"}));class H{static SIGHTING_EVENT="sighting";static INTERPRETATION_EVENT="interpretation";static INTERVIEW_EVENT="interview";static check(t){return ct.check(t,"case")}static isCase(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&Array.isArray(t.events)&&!("timeline"in t)}static sightingUrls(t,e){return(t.events??[]).filter(r=>r.eventType===H.SIGHTING_EVENT&&!r.interpretationOf&&typeof r.url=="string"&&r.url!=="").map(r=>new URL(r.url,e).href)}static accountIds(t,e,r,s){const o=(t.events??[]).filter(i=>i.eventType===H.SIGHTING_EVENT&&i.id!==void 0&&typeof i.url=="string"&&r!==void 0&&new URL(i.url,e).href===r).map(i=>i.id);return s!==void 0&&o.push(s),o}static interpretationEvents(t,e){const r=[e].flat().filter(s=>!!s);return r.length===0?[]:(t.events??[]).filter(s=>s.eventType===H.INTERPRETATION_EVENT?s.sighting!==void 0&&r.includes(s.sighting):s.eventType!==H.SIGHTING_EVENT||s.interpretationOf===void 0?!1:[s.interpretationOf].flat().some(o=>r.includes(o))).map(s=>s)}static problems(t,e){const r=t.events??[],s=new Set,o=new Set;for(const a of r)a.id!==void 0&&(s.has(a.id)&&o.add(a.id),s.add(a.id));const i=[];for(const a of r){const l=a.eventType===H.SIGHTING_EVENT?a.interpretationOf:a.eventType===H.INTERVIEW_EVENT?a.interviewOf:void 0;if(l!==void 0)for(const c of[l].flat())!s.has(c)&&!e.includes(c)&&i.push({reading:a.url??a.id??"",reference:c})}return{duplicateIds:[...o],unresolved:i}}static async interpretationOf(t,e,r){if(t.bodies)return H.withModelsFrom(j.strip({title:t.title,bodies:t.bodies??[],smoke:t.smoke,findings:t.findings,...N.computedPart(t,Ge.kinds())}).recording,e);if(!t.url)return{title:t.title,bodies:[]};const s=new URL(t.url,e).href,o=await r(s),i="timeline"in o&&o.interpretation?o.interpretation:o;return H.withModelsFrom(j.strip({title:t.title??i.title,bodies:i.bodies??[],smoke:i.smoke,findings:i.findings,...N.computedPart(i,Ge.kinds())}).recording,s)}static withModelsFrom(t,e){return{...t,bodies:t.bodies.map(r=>r.model?.url?{...r,model:{...r.model,url:new URL(r.model.url,e).href}}:r)}}}class k{static files=new Map;static hold(t){for(const[e,r]of t)k.files.set(k.key(e),r)}static releaseCopies(){for(const[t,e]of k.files)e.local||k.files.delete(t)}static clear(){k.files.clear()}static localBase(){return new URL(`local/${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}/`,location.href).href}static read(t){const e=k.files.get(k.key(t));return e===void 0?void 0:structuredClone(e.json)}static changed(...t){return t.some(e=>e!==void 0&&k.files.get(k.key(e))?.changed===!0)}static local(t){return t!==void 0&&k.files.get(k.key(t))?.local===!0}static key(t){const e=new URL(t,location.href);return e.hash="",e.href}}class q{static NAMES=["weather","place","lightPollution","decor"];static KEYS={weather:["weatherTrack","weatherSource"],place:["place"],lightPollution:["lightPollution"],decor:["decor"]};static annexName(t,e){return`${t}.${e.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`)}.json`}static taken(t,e){const r={};if(t==="decor")return Array.isArray(e.decor)&&(r.decor=e.decor.filter(q.surveyed)),r;for(const s of q.KEYS[t])e[s]!==void 0&&(r[s]=e[s]);return r}static strip(t,e){if(t==="decor"){const r=Array.isArray(e.decor)?e.decor.filter(s=>!q.surveyed(s)):[];r.length>0?e.decor=r:delete e.decor;return}for(const r of q.KEYS[t])delete e[r]}static put(t,e,r){if(t==="decor"){if(!Array.isArray(r.decor))return;const s=Array.isArray(e.decor)?e.decor.filter(o=>!q.surveyed(o)):[];e.decor=[...s,...r.decor];return}for(const s of q.KEYS[t])r[s]!==void 0&&(e[s]=r[s])}static surveyed(t){return typeof t=="object"&&t!==null&&typeof t.origin=="string"}static fromFile(t,e){return t?.[e]!==void 0&&t[e].live!==!0}}class Xr{static NAMES=["relief","imagery","roads","water","railways","upperAir","map"];static TERRAIN=["relief","imagery","roads","water","railways"];static held(t,e){if(!t||t.live)return;const r=t[e];return r&&!r.live&&!r.refresh&&r.src!==void 0?r:void 0}static isLive(t,e){return t?.live===!0||t?.[e]?.live===!0}static annexName(t,e){const r=e==="relief"||e==="imagery"||e==="map"?"zip":"json",s=e.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`);return`${t}.${s}.${r}`}static isEmpty(t){return!t||!t.live&&Xr.NAMES.every(e=>!t[e])&&q.NAMES.every(e=>!t[e])}}class xt extends Error{constructor(t,e,r){super(`${t}: ${e}${r===void 0?"":` (HTTP ${r})`}`),this.kind=t,this.url=e,this.status=r,this.name="SightingFetchError"}}class ce{static async recording(t){const e=k.read(t);if(e!==void 0)return e;const r=await ce.json(t);for(const s of q.NAMES){const o=r?.snapshots?.[s];if(!(!o?.src||o.live))try{const i=ct.recording(await ce.json(new URL(o.src,new URL(t,location.href)).href));q.put(s,r,i)}catch{}}return r}static async json(t){const e=new URL(t,location.href),r=k.read(e.href);if(r!==void 0)return r;if(location.protocol==="https:"&&e.protocol==="http:")throw new xt("mixed-content",t);let s;try{s=await fetch(t)}catch{throw await this.diagnose(t,e)}if(!s.ok)throw new xt("status",t,s.status);try{return await s.json()}catch{throw new xt("malformed",t)}}static async diagnose(t,e){if(e.origin===location.origin)return new xt("unreachable",t);try{return await fetch(t,{mode:"no-cors"}),new xt("cors",t)}catch{return new xt("unreachable",t)}}}class Ve{constructor(t,e,r=()=>{}){this.place=t,this.changed=r,e&&this.adopt(e)}reader;editor;handed;get reading(){return this.reader!==void 0}get editorLoaded(){return this.editor!==void 0}adopt(t){this.editor=t,t.switcher=this,t.hasAttribute(ge)||t.setAttribute(ge,""),t.addEventListener(mn,e=>{e.preventDefault();const r=e.detail;this.handed=r.src,this.read(r)})}async read({src:t,track:e}){const[{register:r,CASE_ELEMENT_NAME:s,OPEN_EVENTS_ATTRIBUTE:o},{registerSighting:i,SIGHTING_ELEMENT_NAME:a}]=await Promise.all([d(()=>import("./CaseElement-vCbCfGOv.js"),__vite__mapDeps([20,21,22,6,7,23,3,4,13,24,25,1,26]),import.meta.url),d(()=>import("./SightingElement--qpGoyxL.js"),__vite__mapDeps([26,22,6,7,23,3,4,13,24,25,1]),import.meta.url)]);i(),r();const l=H.isCase(k.read(t)??await ce.json(t)),c=document.createElement(l?s:a);c.setAttribute(ge,""),c.setAttribute("show-labels",""),l&&e&&c.setAttribute(o,Ve.fileKey(e)),c.setAttribute("src",t),c.addEventListener(hn,m=>{m.preventDefault(),this.edit(m.detail)}),this.reader?.remove(),this.place(c),this.editor&&(this.editor.hidden=!0),this.reader=c,this.changed({mode:"read",src:t,...e?{track:e}:{}})}async edit(t){const e=this.editor;if(e){if(this.dropReader(),k.releaseCopies(),e.hidden=!1,this.changed({mode:"edit"}),t?.src!==void 0&&t.src!==this.handed){this.load(e,t.src,t.track);return}t?.track&&await e.openTrack(t.track);return}const{register:r,CASE_EDITOR_ELEMENT_NAME:s}=await d(async()=>{const{register:i,CASE_EDITOR_ELEMENT_NAME:a}=await import("./CaseEditorElement-HR8RFluQ.js").then(l=>l.b);return{register:i,CASE_EDITOR_ELEMENT_NAME:a}},__vite__mapDeps([27,3,4,8,21,22,6,7,23,13,24,25,1,28,11,29,30,31,32]),import.meta.url);r();const o=document.createElement(s);this.adopt(o),t?.track&&o.setAttribute("track",t.track),t?.src?o.setAttribute("src",t.src):t?.start&&(o.caseStart=t.start),this.dropReader(),this.place(o),this.changed({mode:"edit"})}async open(t){const e=this.editor;if(this.reading||!e)return this.read({src:t});this.load(e,t)}load(t,e,r){this.handed=void 0,r?t.setAttribute("track",r):t.removeAttribute("track"),t.setAttribute("src",e)}async startNew(t){const e=this.editor;if(!e)return this.edit(t?{start:t}:void 0);this.reading&&await this.edit(),e.askBeforeReplacing(()=>{e.remove(),this.editor=void 0,this.edit(t?{start:t}:void 0)})}dropReader(){this.reader?.remove(),this.reader=void 0}static fileKey(t){return new URL(t,location.href).pathname.split("/").pop().replace(/\.json$/i,"")}}const Ie="rr0-input-file",Jr={inputFileFromFile:"from your disk",inputFileFromUrl:"from an address",inputFileModeHint:"Click to give it the other way: a file of yours, or an address",inputFileLoad:"Load"},An=`
3
3
  rr0-input-file { display: inline-flex; align-items: center; gap: .3em; }
4
4
  /* As the date's own switch (see DateInputElement): it reads as part of the label, before the field. */
5
5
  rr0-input-file .input-file-mode { order: -1; font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-decoration: underline; text-underline-offset: .15em; }