@rr0/ufoathome 0.195.0 → 0.196.0

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 (127) hide show
  1. package/dist-embed-scene/rr0-scene.mjs +4 -4
  2. package/dist-embed-sighting/CaseMessages_en-G5J5w1_d.js +1 -0
  3. package/dist-embed-sighting/CaseMessages_es-D7Rp1_1K.js +1 -0
  4. package/dist-embed-sighting/CaseMessages_fr-B8eZ1NIJ.js +1 -0
  5. package/dist-embed-sighting/CaseMessages_it-Cu02nVVo.js +1 -0
  6. package/dist-embed-sighting/{CaseReportExport-BeKawC8S.js → CaseReportExport-CdRgJb5M.js} +1 -1
  7. package/dist-embed-sighting/rr0-sighting.mjs +343 -324
  8. package/dist-embed-sighting-editor/{AdsbLolArchiveProvider--KjPxNqw.js → AdsbLolArchiveProvider-BqEnqRP0.js} +1 -1
  9. package/dist-embed-sighting-editor/{BallesterGuaspAssessor-BTmq0r-G.js → BallesterGuaspAssessor-BL_yzudf.js} +1 -1
  10. package/dist-embed-sighting-editor/{BeamEditor-CI8-9VOc.js → BeamEditor-DA29mfqm.js} +1 -1
  11. package/dist-embed-sighting-editor/{BeamSystem-odg570aR.js → BeamSystem-DYohqXlF.js} +1 -1
  12. package/dist-embed-sighting-editor/{BirdEditor-DV3ndYff.js → BirdEditor-CAoRqqRV.js} +1 -1
  13. package/dist-embed-sighting-editor/{BirdFlock-O7K_g8y7.js → BirdFlock-TI63ZAKZ.js} +1 -1
  14. package/dist-embed-sighting-editor/{CaseEditorMessages_en-CoFukfwf.js → CaseEditorMessages_en-BPdxQsTX.js} +1 -1
  15. package/dist-embed-sighting-editor/{CaseEditorMessages_es-DZptbzB7.js → CaseEditorMessages_es-B48BAICC.js} +1 -1
  16. package/dist-embed-sighting-editor/{CaseEditorMessages_fr-DXl2GNmR.js → CaseEditorMessages_fr-DTWi9mIY.js} +1 -1
  17. package/dist-embed-sighting-editor/{CaseEditorMessages_it-ss10VmRM.js → CaseEditorMessages_it-CMLxgu8y.js} +1 -1
  18. package/dist-embed-sighting-editor/CaseElement-AXaERD8m.js +112 -0
  19. package/dist-embed-sighting-editor/CaseMessages_en-G5J5w1_d.js +1 -0
  20. package/dist-embed-sighting-editor/CaseMessages_es-D7Rp1_1K.js +1 -0
  21. package/dist-embed-sighting-editor/CaseMessages_fr-B8eZ1NIJ.js +1 -0
  22. package/dist-embed-sighting-editor/CaseMessages_it-Cu02nVVo.js +1 -0
  23. package/dist-embed-sighting-editor/{CaseReportExport-DisXbZ3b.js → CaseReportExport-CDZp6xGk.js} +2 -2
  24. package/dist-embed-sighting-editor/{ContrailSystem-BddkU7fj.js → ContrailSystem-B0cQbaHc.js} +1 -1
  25. package/dist-embed-sighting-editor/{ControlPasses-CNlCUT1L.js → ControlPasses-BvS8haeS.js} +1 -1
  26. package/dist-embed-sighting-editor/{CoverageAssessor-DjY8iKp5.js → CoverageAssessor-DD1kSvun.js} +1 -1
  27. package/dist-embed-sighting-editor/{DroneEditor-DRsM2ash.js → DroneEditor-BRB2-dAw.js} +1 -1
  28. package/dist-embed-sighting-editor/{DroneFlight-Fr4Vgso3.js → DroneFlight-BpnBgJ9K.js} +1 -1
  29. package/dist-embed-sighting-editor/{Flightradar24Provider-BxeduRam.js → Flightradar24Provider-D5OdIL0L.js} +1 -1
  30. package/dist-embed-sighting-editor/{GLTFLoader-C6nlGTTi.js → GLTFLoader-DuqJVU4y.js} +1 -1
  31. package/dist-embed-sighting-editor/{HeadlightSystem-DI5wHYZu.js → HeadlightSystem-BejdfHqe.js} +1 -1
  32. package/dist-embed-sighting-editor/{HynekAssessor-DlXalbph.js → HynekAssessor-CwzpS7YP.js} +1 -1
  33. package/dist-embed-sighting-editor/{LanternEditor-M887ltwe.js → LanternEditor-BnXAwLuQ.js} +1 -1
  34. package/dist-embed-sighting-editor/{LaserBeam-Drpkr84G.js → LaserBeam-tqM2fwHf.js} +1 -1
  35. package/dist-embed-sighting-editor/{LaunchEditor-BjAk4XZR.js → LaunchEditor-vwecAGwH.js} +1 -1
  36. package/dist-embed-sighting-editor/{LaunchPlume-CrzPcqw7.js → LaunchPlume-DWyU0YyJ.js} +1 -1
  37. package/dist-embed-sighting-editor/{LaunchSimulation-C1ZWpKZT.js → LaunchSimulation-C_OJQoKC.js} +1 -1
  38. package/dist-embed-sighting-editor/{ModelSource-Bko_3OJt.js → ModelSource-D1Wt6VYS.js} +1 -1
  39. package/dist-embed-sighting-editor/{ModelThumbnails-DSshyLu2.js → ModelThumbnails-C_8KCF7H.js} +1 -1
  40. package/dist-embed-sighting-editor/{ModelViewer-_yhAYvNy.js → ModelViewer-Cy-6IZBY.js} +1 -1
  41. package/dist-embed-sighting-editor/{ModuleConformance-B6iFVb8X.js → ModuleConformance-DYi4XZdB.js} +2 -2
  42. package/dist-embed-sighting-editor/{ModuleSession-jKFl1FMo.js → ModuleSession-BDbaoiCf.js} +2 -2
  43. package/dist-embed-sighting-editor/ModuleThree-DRf9SEr_.js +1 -0
  44. package/dist-embed-sighting-editor/{ModulesPanelElement-VPRCdjmv.js → ModulesPanelElement-hDjGLhRa.js} +3 -3
  45. package/dist-embed-sighting-editor/{NearestApproach-O8k2n_qL.js → NearestApproach-D6tQo7dk.js} +1 -1
  46. package/dist-embed-sighting-editor/{PoherAssessor-sTJEnlmb.js → PoherAssessor-BTYpHucH.js} +1 -1
  47. package/dist-embed-sighting-editor/{RailwaySystem-BZqNSSFA.js → RailwaySystem-D_8D64Bu.js} +1 -1
  48. package/dist-embed-sighting-editor/{ReentryEditor-DfDGpL5C.js → ReentryEditor-D7HxkvKP.js} +2 -2
  49. package/dist-embed-sighting-editor/{ReentrySimulation-BuUK0niI.js → ReentrySimulation-Bom073AV.js} +1 -1
  50. package/dist-embed-sighting-editor/{ReferenceSystem-DvcQp167.js → ReferenceSystem-D_eueNAb.js} +1 -1
  51. package/dist-embed-sighting-editor/{SightingElement-Bdkf99VT.js → SightingElement-DukKlaH1.js} +4 -4
  52. package/dist-embed-sighting-editor/{SkyLantern-B7UlFgmB.js → SkyLantern-BDpxvmY3.js} +1 -1
  53. package/dist-embed-sighting-editor/{TraceSystem-vZF4B5EC.js → TraceSystem-B1mmypS3.js} +2 -2
  54. package/dist-embed-sighting-editor/{WaterSystem-DSWmZbiL.js → WaterSystem-mZ-f2CcD.js} +2 -2
  55. package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +370 -359
  56. package/dist-embed-sighting-editor/{trafficRuntime-C5BXL-G6.js → trafficRuntime-CvK_m6bC.js} +1 -1
  57. package/dist-embed-ufoathome/{AdsbLolArchiveProvider-veDw9Mxo.js → AdsbLolArchiveProvider-BAZqWk1I.js} +1 -1
  58. package/dist-embed-ufoathome/{BallesterGuaspAssessor-BVygSN0R.js → BallesterGuaspAssessor-D5DnaJGn.js} +1 -1
  59. package/dist-embed-ufoathome/{BeamEditor-eDeeNBE9.js → BeamEditor-DmuKTRqU.js} +1 -1
  60. package/dist-embed-ufoathome/{BeamSystem-B5u4ithz.js → BeamSystem-KHzcEosy.js} +1 -1
  61. package/dist-embed-ufoathome/{BodyEditor-23Dua2K5.js → BodyEditor-Blkm_Xmd.js} +1 -1
  62. package/dist-embed-ufoathome/{CaseEditorElement-DYMt7oB4.js → CaseEditorElement-BTZu9wey.js} +33 -29
  63. package/dist-embed-ufoathome/{CaseEditorMessages_en-CoFukfwf.js → CaseEditorMessages_en-BPdxQsTX.js} +1 -1
  64. package/dist-embed-ufoathome/{CaseEditorMessages_es-DZptbzB7.js → CaseEditorMessages_es-B48BAICC.js} +1 -1
  65. package/dist-embed-ufoathome/{CaseEditorMessages_fr-DXl2GNmR.js → CaseEditorMessages_fr-DTWi9mIY.js} +1 -1
  66. package/dist-embed-ufoathome/{CaseEditorMessages_it-ss10VmRM.js → CaseEditorMessages_it-CMLxgu8y.js} +1 -1
  67. package/dist-embed-ufoathome/CaseElement-Cr3vTWdf.js +112 -0
  68. package/dist-embed-ufoathome/CaseMessages_en-G5J5w1_d.js +1 -0
  69. package/dist-embed-ufoathome/CaseMessages_es-D7Rp1_1K.js +1 -0
  70. package/dist-embed-ufoathome/CaseMessages_fr-B8eZ1NIJ.js +1 -0
  71. package/dist-embed-ufoathome/CaseMessages_it-Cu02nVVo.js +1 -0
  72. package/dist-embed-ufoathome/{CaseReportExport-Cgs2Y0v3.js → CaseReportExport-CyuSf3U_.js} +3 -3
  73. package/dist-embed-ufoathome/{CaseTimeline-BwCuVg5N.js → ColumnResize-DifCqMt1.js} +14 -7
  74. package/dist-embed-ufoathome/{ContrailSystem-CtQPQFyc.js → ContrailSystem-DqZ8PoEd.js} +1 -1
  75. package/dist-embed-ufoathome/{ControlPasses-B_uf1Wmh.js → ControlPasses-BtU_MVQU.js} +1 -1
  76. package/dist-embed-ufoathome/{CoverageAssessor-JQCFe16i.js → CoverageAssessor-DkVligEj.js} +1 -1
  77. package/dist-embed-ufoathome/{Flightradar24Provider-BR8_7wmx.js → Flightradar24Provider-GYjtvwah.js} +1 -1
  78. package/dist-embed-ufoathome/{GLTFLoader-DrBMau2Y.js → GLTFLoader-DzEwUqtj.js} +1 -1
  79. package/dist-embed-ufoathome/{GeoJsonExport-wUgEVyel.js → GeoJsonExport-B1i0YjqN.js} +1 -1
  80. package/dist-embed-ufoathome/{GeographicFigures-CpbFopao.js → GeographicFigures-D5ZCRN0K.js} +1 -1
  81. package/dist-embed-ufoathome/{HeadlightSystem-YXD1Zdpn.js → HeadlightSystem-x2xYh-cs.js} +1 -1
  82. package/dist-embed-ufoathome/{HynekAssessor-BV2nWUx8.js → HynekAssessor-DOUPfuRV.js} +1 -1
  83. package/dist-embed-ufoathome/{InterviewEditorElement-DiT6FZnj.js → InterviewEditorElement-Dt-KQiv0.js} +1 -1
  84. package/dist-embed-ufoathome/{InterviewElement-DFcCnZtF.js → InterviewElement-BPsBLXlf.js} +1 -1
  85. package/dist-embed-ufoathome/{KmlExport-wWr2S8H-.js → KmlExport-JEXMAssj.js} +1 -1
  86. package/dist-embed-ufoathome/{LaserBeam-CejB0H9v.js → LaserBeam-Cy9lfcCE.js} +1 -1
  87. package/dist-embed-ufoathome/{LaunchEditor-ConcMLIe.js → LaunchEditor-zWZhMyLf.js} +1 -1
  88. package/dist-embed-ufoathome/{LaunchPlume-BQEYjeSf.js → LaunchPlume-CcUQvACB.js} +1 -1
  89. package/dist-embed-ufoathome/{LaunchSimulation-BIiU6D8P.js → LaunchSimulation-DRH0rTE7.js} +1 -1
  90. package/dist-embed-ufoathome/{ModelSource-B93j0IA6.js → ModelSource-Dljnl-RW.js} +1 -1
  91. package/dist-embed-ufoathome/{ModelThumbnails-3U8M50_n.js → ModelThumbnails-DeaPuKSb.js} +1 -1
  92. package/dist-embed-ufoathome/{ModelViewer-Cnxj0Oi9.js → ModelViewer-B-ZLBTmq.js} +1 -1
  93. package/dist-embed-ufoathome/{ModuleConformance-BlrRirPF.js → ModuleConformance-Bd8yK7Ic.js} +2 -2
  94. package/dist-embed-ufoathome/{ModuleSession-Cdilmebx.js → ModuleSession-DXdpVejH.js} +3 -3
  95. package/dist-embed-ufoathome/{ModuleThree-Dpv5uvYp.js → ModuleThree-BL59t48W.js} +1 -1
  96. package/dist-embed-ufoathome/{ModulesPanelElement-CwgqBVUI.js → ModulesPanelElement-6KUAMJcl.js} +3 -3
  97. package/dist-embed-ufoathome/{NearestApproach-CQ2w9ctm.js → NearestApproach-wbFbwOAh.js} +1 -1
  98. package/dist-embed-ufoathome/{PictureRegistration-DOSDjiOf.js → PictureRegistration-CfSYGbeh.js} +1 -1
  99. package/dist-embed-ufoathome/{PoherAssessor-C8g5YvJi.js → PoherAssessor-CVIeQpd7.js} +1 -1
  100. package/dist-embed-ufoathome/{RailwaySystem-D8B965iv.js → RailwaySystem-DTXetaSg.js} +1 -1
  101. package/dist-embed-ufoathome/{ReentryEditor-CEbb0oLd.js → ReentryEditor-7Fxkxq-Q.js} +1 -1
  102. package/dist-embed-ufoathome/{ReentrySimulation-D_JX7wWS.js → ReentrySimulation-T3H0mJI3.js} +1 -1
  103. package/dist-embed-ufoathome/{ReferenceSystem-xm8mzWiT.js → ReferenceSystem-CJaq2UzO.js} +1 -1
  104. package/dist-embed-ufoathome/{ShareDialogElement-BBMLOqSW.js → ShareDialogElement-ClhewPap.js} +11 -11
  105. package/dist-embed-ufoathome/{SightingElement-e9ZcWa58.js → SightingElement-BtHQ5LDE.js} +4 -4
  106. package/dist-embed-ufoathome/{TraceSystem-BL6qfrHF.js → TraceSystem-B42kzZXG.js} +1 -1
  107. package/dist-embed-ufoathome/{VideoButton-DA48Qz2E.js → VideoButton-DhanY6AD.js} +1 -1
  108. package/dist-embed-ufoathome/{WaterSystem-BLy0L9qC.js → WaterSystem-DyJivqCq.js} +1 -1
  109. package/dist-embed-ufoathome/rr0-ufoathome.mjs +3 -3
  110. package/dist-embed-ufoathome/{surroundingsSources-Dlyt6moH.js → surroundingsSources-DEMGw8rm.js} +1 -1
  111. package/dist-embed-ufoathome/{trafficRuntime-B_bwWY8d.js → trafficRuntime-BJFdLEcT.js} +1 -1
  112. package/package.json +1 -1
  113. package/dist-embed-sighting/CaseMessages_en-BbbbikHH.js +0 -1
  114. package/dist-embed-sighting/CaseMessages_es-AHBxl8Ka.js +0 -1
  115. package/dist-embed-sighting/CaseMessages_fr-CD33PQCH.js +0 -1
  116. package/dist-embed-sighting/CaseMessages_it-DyMACGSU.js +0 -1
  117. package/dist-embed-sighting-editor/CaseElement-CVi_yfyW.js +0 -100
  118. package/dist-embed-sighting-editor/CaseMessages_en-BbbbikHH.js +0 -1
  119. package/dist-embed-sighting-editor/CaseMessages_es-AHBxl8Ka.js +0 -1
  120. package/dist-embed-sighting-editor/CaseMessages_fr-CD33PQCH.js +0 -1
  121. package/dist-embed-sighting-editor/CaseMessages_it-DyMACGSU.js +0 -1
  122. package/dist-embed-sighting-editor/ModuleThree-Fvr5G-Yh.js +0 -1
  123. package/dist-embed-ufoathome/CaseElement-C6KVIESP.js +0 -100
  124. package/dist-embed-ufoathome/CaseMessages_en-BbbbikHH.js +0 -1
  125. package/dist-embed-ufoathome/CaseMessages_es-AHBxl8Ka.js +0 -1
  126. package/dist-embed-ufoathome/CaseMessages_fr-CD33PQCH.js +0 -1
  127. package/dist-embed-ufoathome/CaseMessages_it-DyMACGSU.js +0 -1
@@ -1,4 +1,4 @@
1
- import{R as G,E as q,H as N,s as W,U as K,a as Z,b as J,c as Q,S as y,C as m,F as U,O as $,P as X}from"./rr0-ufoathome.mjs";import{a as _,O as E,M as S,b as Y,P as ee,R as D,C as te,c as se,d as ie,B as ne,e as P,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-BBMLOqSW.js";import{S as M}from"./SaidPosition-CWiVNaNW.js";import{D as pe,p as j}from"./Sighting-CBpJpdm9.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.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,a as Z,b as J,c as Q,S as y,C as m,F as U,O as $,P as X}from"./rr0-ufoathome.mjs";import{a as _,O as E,M as S,b as Y,P as ee,R as D,C as te,c as se,d as ie,B as ne,e as P,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-ClhewPap.js";import{S as M}from"./SaidPosition-CWiVNaNW.js";import{D as pe,p as j}from"./Sighting-CBpJpdm9.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.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). -->
@@ -688,6 +688,6 @@ ${_.CSS}
688
688
  margin: 0.4em 0 0;
689
689
  padding-left: 1.2em;
690
690
  }
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",v="observer",A="case-named",L="show-info",B="interpretation",x="hide-pickers",C="case",w="account",O="variant-",R=`${T}/edit/`;class b extends HTMLElement{static get observedAttributes(){return["src","show-labels",L,x,B,A,I,H,v,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"),D.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 P(n),this.said=new M(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 M(["en"]);tags=new P({});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&&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===v&&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=U.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:U.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(v)?.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?[[v,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?[`${v}=${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=$.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(w,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(g=>this.agentName(g)).filter(Boolean).join(", ");s(`case-${l}`,f?(this.messages?.interpretationBy??"").replace("{title}",p).replace("{by}",f):p,()=>m.interpretationOf(d,a.url,g=>y.recording(g)))});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:w);this.interpretationSelect.value=c,c===w?(this.sceneElement.interpretation!==o&&(this.sceneElement.interpretation=o),this.shownInterpretation=w):(!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(w,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==="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&&b.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(o?.image,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(b.SCENE_FIELDS.map(n=>s[n]));return i(e)!==i(t)}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;e.image?this.sceneElement.showPoster(e.image,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:b.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?D.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 g=document.createElement("span");g.className="finding-against",g.textContent=`(${s.findingAgainst[d.against??"established"]})`,l.append(g)}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(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=$.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,b.DATE_PATHS));const o=this.formatLocation(this.plain(e));o&&this.appendInfoRow(this.infoObservationList,this.messages?.location??"",o,this.basisOf(e,b.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.195.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(`
693
- `)),o.append(" ",a)}e.appendChild(n),e.appendChild(o)}}const F="rr0-sighting",fe="observerchange",ge="interpretationchange";function Ce(){V(),z.register(),customElements.get(F)||customElements.define(F,b)}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,v 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,b as SightingElement,Ce as registerSighting};
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"),D.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 P(n),this.said=new M(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 M(["en"]);tags=new P({});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=U.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:U.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=$.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==="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(o?.image,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)}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;e.image?this.sceneElement.showPoster(e.image,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?D.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=$.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.196.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(`
693
+ `)),o.append(" ",a)}e.appendChild(n),e.appendChild(o)}}const F="rr0-sighting",fe="observerchange",ge="interpretationchange";function Ce(){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,Ce as registerSighting};
@@ -1,4 +1,4 @@
1
- import{bl as ee,bh as F,bm as G,bn as M,bo as te,bp as j,bq as $,b7 as E,br as ie,bs as O,bt as J,ba as ne,bu as I,bb as se,b9 as B,bv as oe,b5 as ae,bw as re,b2 as le,b4 as ce,bx as de,bg as fe,by as ue,bz as pe,bA as he,bB as me,bC as V}from"./ShareDialogElement-BBMLOqSW.js";import{g as ge}from"./SaidPosition-CWiVNaNW.js";import"./rr0-ufoathome.mjs";import"./Sighting-CBpJpdm9.js";import"./VisualAids-DI-hEL46.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.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 $),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(){}}I.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new ne},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};O.line={uniforms:J.merge([I.common,I.fog,I.line]),vertexShader:`
1
+ import{bl as ee,bh as F,bm as G,bn as M,bo as te,bp as j,bq as $,b7 as E,br as ie,bs as O,bt as J,ba as ne,bu as I,bb as se,b9 as B,bv as oe,b5 as ae,bw as re,b2 as le,b4 as ce,bx as de,bg as fe,by as ue,bz as pe,bA as he,bB as me,bC as V}from"./ShareDialogElement-ClhewPap.js";import{g as ge}from"./SaidPosition-CWiVNaNW.js";import"./rr0-ufoathome.mjs";import"./Sighting-CBpJpdm9.js";import"./VisualAids-DI-hEL46.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.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 $),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(){}}I.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new ne},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};O.line={uniforms:J.merge([I.common,I.fog,I.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-BBMLOqSW.js";import"./rr0-ufoathome.mjs";import"./SaidPosition-CWiVNaNW.js";import"./Sighting-CBpJpdm9.js";import"./VisualAids-DI-hEL46.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.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-ClhewPap.js";import"./rr0-ufoathome.mjs";import"./SaidPosition-CWiVNaNW.js";import"./Sighting-CBpJpdm9.js";import"./VisualAids-DI-hEL46.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.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,4 +1,4 @@
1
- import{b2 as A,b3 as F,b4 as y,b5 as E,b6 as D,b7 as M,b8 as I,b9 as L,ba as z,bb as N,bc as C,bd as U,be as T,bf as P,bg as B,bh as O}from"./ShareDialogElement-BBMLOqSW.js";import{g as V}from"./SaidPosition-CWiVNaNW.js";import"./rr0-ufoathome.mjs";import"./Sighting-CBpJpdm9.js";import"./VisualAids-DI-hEL46.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./Obstacles-v9SkfBD7.js";class r{static LIFT_M=.05;static RENDER_ORDER=1.04;static LEVEL_QUANTILE=.2;static BODY_ALBEDO=[.035,.045,.04];static IOR=1.33;static ROUGHNESS=.08;static MAX_SAMPLES=48;static REFLECTION_SCALE=.5;group=new A;material=new F({color:new y(...r.BODY_ALBEDO),roughness:r.ROUGHNESS,metalness:0,ior:r.IOR,polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-2});levels=new Map;reflectionTarget;reflectionUniforms={uWaterReflection:{value:null},uWaterReflectionMatrix:{value:new E},uWaterReflectionOn:{value:0}};mirrorCamera=new D;eye=new M;ahead=new M;up=new M;plane=new I;clip=new L;q=new L;size=new z;bias=new E().set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);constructor(){this.group.name="water",this.material.onBeforeCompile=t=>{Object.assign(t.uniforms,this.reflectionUniforms),t.vertexShader=t.vertexShader.replace("#include <common>",`#include <common>
1
+ import{b2 as A,b3 as F,b4 as y,b5 as E,b6 as D,b7 as M,b8 as I,b9 as L,ba as z,bb as N,bc as C,bd as U,be as T,bf as P,bg as B,bh as O}from"./ShareDialogElement-ClhewPap.js";import{g as V}from"./SaidPosition-CWiVNaNW.js";import"./rr0-ufoathome.mjs";import"./Sighting-CBpJpdm9.js";import"./VisualAids-DI-hEL46.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./Obstacles-v9SkfBD7.js";class r{static LIFT_M=.05;static RENDER_ORDER=1.04;static LEVEL_QUANTILE=.2;static BODY_ALBEDO=[.035,.045,.04];static IOR=1.33;static ROUGHNESS=.08;static MAX_SAMPLES=48;static REFLECTION_SCALE=.5;group=new A;material=new F({color:new y(...r.BODY_ALBEDO),roughness:r.ROUGHNESS,metalness:0,ior:r.IOR,polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-2});levels=new Map;reflectionTarget;reflectionUniforms={uWaterReflection:{value:null},uWaterReflectionMatrix:{value:new E},uWaterReflectionOn:{value:0}};mirrorCamera=new D;eye=new M;ahead=new M;up=new M;plane=new I;clip=new L;q=new L;size=new z;bias=new E().set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);constructor(){this.group.name="water",this.material.onBeforeCompile=t=>{Object.assign(t.uniforms,this.reflectionUniforms),t.vertexShader=t.vertexShader.replace("#include <common>",`#include <common>
2
2
  varying vec3 vWaterWorld;`).replace("#include <project_vertex>",`#include <project_vertex>
3
3
  vWaterWorld = (modelMatrix * vec4(transformed, 1.0)).xyz;`),t.fragmentShader=t.fragmentShader.replace("#include <common>",`#include <common>
4
4
  varying vec3 vWaterWorld;
@@ -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-BaRDgTw-.js","./SaidPosition-CWiVNaNW.js","./SkyEventEditorStyle-CvY_AhbI.js","./Sighting-CBpJpdm9.js","./VisualAids-DI-hEL46.js","./ParameterForm-DfpJQGku.js","./BirdFlock-ByBkJV35.js","./BirdEditor-6vr7bLHy.js","./TimelineTracks-X_GEZi12.js","./DroneFlight-CGNIh9XS.js","./Decor-Dn-cvniW.js","./DroneEditor-C3SH8yYq.js","./CaseElement-C6KVIESP.js","./CaseTimeline-BwCuVg5N.js","./ShareDialogElement-BBMLOqSW.js","./RecordingIssue-BlWT8Xsu.js","./SightingElement-e9ZcWa58.js","./CaseEditorElement-DYMt7oB4.js","./ReentryArchive-CeXHrU7L.js","./ReferenceTimeline-2kBldQeG.js","./upperAirSources-BGuLpdwu.js","./Account-C4jhsVtN.js","./UfoMessages_en-D5OYWJ3K.js","./SightingEditorMessages_en-CTQYcybj.js","./SightingLabels_en-oIpytoq_.js","./SightingEditorMessages_fr-DjUByAq4.js","./SightingLabels_fr-D69zENbW.js","./SightingEditorMessages_es-D-ASD5a3.js","./SightingLabels_es-DUh1CTXl.js","./SightingEditorMessages_it-Eat0U-4p.js","./SightingLabels_it-COLZ2Qth.js","./SightingMessages_en-CYzanHjT.js","./SightingMessages_fr-BtfWbIP7.js","./SightingMessages_es-hjvESK6f.js","./SightingMessages_it-Bqm4pewZ.js","./SceneNames_en-7OZ7peGc.js","./SceneNames_fr-qzw0QzD0.js","./SceneNames_es-P5-Mavdi.js","./SceneNames_it-Sqf8JFOd.js"])))=>i.map(i=>d[i]);
2
- const W="rr0-read",q="rr0-edit",k="in-place",Y="rr0-mode";class Mt{static ask(t,e,r){const s=new CustomEvent(e,{detail:r,bubbles:!0,composed:!0,cancelable:!0});return t.dispatchEvent(s),s.defaultPrevented}}const J="modulepreload",X=function(i,t){return new URL(i,t).href},D={},a=function(t,e,r){let s=Promise.resolve();if(e&&e.length>0){let n=function(u){return Promise.all(u.map(w=>Promise.resolve(w).then(_=>({status:"fulfilled",value:_}),_=>({status:"rejected",reason:_}))))};const d=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),c=l?.nonce||l?.getAttribute("nonce");s=n(e.map(u=>{if(u=X(u,r),u in D)return;D[u]=!0;const w=u.endsWith(".css"),_=w?'[rel="stylesheet"]':"";if(!!r)for(let L=d.length-1;L>=0;L--){const x=d[L];if(x.href===u&&(!w||x.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${_}`))return;const A=document.createElement("link");if(A.rel=w?"stylesheet":J,w||(A.as="script"),A.crossOrigin="",A.href=u,c&&A.setAttribute("nonce",c),document.head.appendChild(A),w)return new Promise((L,x)=>{A.addEventListener("load",L),A.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${u}`)))})}))}function o(n){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=n,window.dispatchEvent(d),!d.defaultPrevented)throw n}return s.then(n=>{for(const d of n||[])d.status==="rejected"&&o(d.reason);return t().catch(o)})};class v{constructor(t){this.entries=t}static free(t){return t?.basis==="assumed"||t?.basis==="fitted"}static empty(){return new v(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 v(new Map);return{recording:v.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 n=e.at(o),d=o.split("."),l=v.writableHolderOf(r,d,s);if(!l)continue;const c=d[d.length-1],u=l[c];u!==void 0&&(n.of!==void 0&&JSON.stringify(n.of)!==JSON.stringify(u)||(l[c]={value:u,...n.basis==="stated"?{}:{basis:n.basis},...n.rationale===void 0?{}:{rationale:n.rationale},...n.how===void 0?{}:{how:n.how},...n.range===void 0?{}:{range:n.range},...n.source===void 0?{}:{source:n.source}}))}return r}static isWrapper(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&"value"in t}static stripValue(t,e,r){return v.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}),v.stripValue(t.value,e,r)):Array.isArray(t)?t.map((s,o)=>v.stripValue(s,[...e,String(o)],r)):typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t).map(([s,o])=>[s,v.stripValue(o,[...e,s],r)])):t}static writableHolderOf(t,e,r){let s=t;for(const o of e.slice(0,-1)){const n=s[o];if(typeof n!="object"||n===null)return;if(r.has(n)){s=n;continue}const d=Array.isArray(n)?[...n]:{...n};r.add(d),s[o]=d,s=d}return s}}class Z 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 I{static CURRENT={sighting:4,case:1,interview:1};static SCHEMA_BASE="https://ufoathome.org/schema";static schemaUrl(t,e=I.CURRENT[t]){return`${I.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 I.check(t,"sighting")}static check(t,e){const r=I.of(t),s=I.CURRENT[e];if(typeof r!="number"||!Number.isInteger(r)||r!==s)throw new Z(e,r,s);return t}}class p{static built=new WeakMap;static computers=new WeakMap;static loading=new WeakMap;static loaded(t,e){return e.every(r=>p.itemsOf(t,r.key).length===0||p.computers.has(r))}static load(t,e){return Promise.all(e.filter(r=>p.itemsOf(t,r.key).length>0&&!p.computers.has(r)).map(r=>{let s=p.loading.get(r);return s||(s=r.compute().then(o=>{p.computers.set(r,o)}),s.catch(()=>p.loading.delete(r)),p.loading.set(r,s)),s.catch(()=>{})})).then(()=>{})}static of(t){let e=p.built.get(t);return e||(e=t.create(),p.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=>p.itemsOf(t,r.key).length>0)}static expand(t,e,r){return p.expandWithKinds(t,e,r).interpretation}static expandWithKinds(t,e,r){const s=new Map,o=new Map;if(!t||!p.computes(t,e))return{interpretation:t,kindOf:s,phenomenonOf:o};const n=e.flatMap(d=>p.itemsOf(t,d.key).flatMap(l=>{const c=p.computers.get(d);if(!c)return[];const u=c(l,r),w=d.phenomenon?.(l);for(const _ of u)s.set(_.id,d),w&&o.set(_.id,w);return u}));return{interpretation:{...t,bodies:[...t.bodies,...n]},kindOf:s,phenomenonOf:o}}static computedPart(t,e){const r={};for(const s of e){const o=p.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)}}class G 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 Q{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 G(t,this.id,r.sourceId,r.ownerId);this.withdraw(t);const s=t===h.BUILT_IN?this.sources.findIndex(o=>this.owners.get(o.id)!==h.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 h{static BUILT_IN="ufoathome";static changes=new EventTarget;static points=new Map;static modules=new Map;static point(t){let e=h.points.get(t);return e||(e=new Q(t),h.points.set(t,e)),e}static install(t){if(t.id===h.BUILT_IN)throw new Error(`"${h.BUILT_IN}" is the id of the built-in module`);const e=h.contributionsOf(t);for(const[o,n]of e){const d=h.point(o).conflict(t.id,n);if(d)throw new G(t.id,o,d.sourceId,d.ownerId)}const r=new Set(e.map(([o])=>o)),s=h.modules.get(t.id);if(s)for(const[o]of h.contributionsOf(s))r.add(o);for(const o of r)h.point(o).withdraw(t.id);for(const[o,n]of e)h.point(o).provide(t.id,n);h.modules.set(t.id,t);for(const o of r)h.announce(o)}static uninstall(t){const e=h.modules.get(t);if(e){h.modules.delete(t);for(const[r]of h.contributionsOf(e))h.point(r).withdraw(t),h.announce(r)}}static installed(){return[...h.modules.values()]}static contributionsOf(t){return Object.entries(t.contributes).filter(e=>Array.isArray(e[1])&&e[1].length>0)}static announce(t){h.changes.dispatchEvent(new CustomEvent("change",{detail:t}))}}const tt=["en","fr","es","it"];class f{static catalog(t){const e=new Map;return{load(r){const s=f.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 tt.includes(e)?e:"en"}}const et=f.catalog({en:()=>a(()=>import("./FlareKindMessages_en-j3CY_TxX.js"),[],import.meta.url).then(i=>i.flareKindMessages_en),fr:()=>a(()=>import("./FlareKindMessages_fr-B2MezoN2.js"),[],import.meta.url).then(i=>i.flareKindMessages_fr),es:()=>a(()=>import("./FlareKindMessages_es-CZgrFIOO.js"),[],import.meta.url).then(i=>i.flareKindMessages_es),it:()=>a(()=>import("./FlareKindMessages_it-CmZmb3RP.js"),[],import.meta.url).then(i=>i.flareKindMessages_it)}),P={key:"flares",messages:et,phenomenon:()=>"DecoyFlare",compute:()=>a(async()=>{const{DecoyFlare:i}=await import("./DecoyFlare-DUt1_LcW.js");return{DecoyFlare:i}},[],import.meta.url).then(({DecoyFlare:i})=>t=>i.bodiesOf(t))},rt=f.catalog({en:()=>a(()=>import("./LanternKindMessages_en-CQXdJ-k6.js"),[],import.meta.url).then(i=>i.lanternKindMessages_en),fr:()=>a(()=>import("./LanternKindMessages_fr-D7tQa_tQ.js"),[],import.meta.url).then(i=>i.lanternKindMessages_fr),es:()=>a(()=>import("./LanternKindMessages_es-BOO6kPjs.js"),[],import.meta.url).then(i=>i.lanternKindMessages_es),it:()=>a(()=>import("./LanternKindMessages_it-B8J-29Mj.js"),[],import.meta.url).then(i=>i.lanternKindMessages_it)}),V={key:"lanterns",messages:rt,phenomenon:()=>"SkyLantern",compute:()=>a(async()=>{const{SkyLantern:i}=await import("./SkyLantern-DJT_Ibzh.js");return{SkyLantern:i}},__vite__mapDeps([0,1]),import.meta.url).then(({SkyLantern:i})=>(t,e)=>i.bodiesOf(t,e?.obstacles)),editor:()=>a(async()=>{const{LanternEditor:i}=await import("./LanternEditor-BaRDgTw-.js");return{LanternEditor:i}},__vite__mapDeps([2,3,4,0,1,5,6,7]),import.meta.url).then(({LanternEditor:i})=>(t,e,r)=>new i(t,e,r))},it=f.catalog({en:()=>a(()=>import("./BirdKindMessages_en-c_-L7frF.js"),[],import.meta.url).then(i=>i.birdKindMessages_en),fr:()=>a(()=>import("./BirdKindMessages_fr-C1TuqqEj.js"),[],import.meta.url).then(i=>i.birdKindMessages_fr),es:()=>a(()=>import("./BirdKindMessages_es-8Zo2t0o4.js"),[],import.meta.url).then(i=>i.birdKindMessages_es),it:()=>a(()=>import("./BirdKindMessages_it-DQZcrCkf.js"),[],import.meta.url).then(i=>i.birdKindMessages_it)}),$={key:"birds",messages:it,phenomenon:()=>"Birds",compute:()=>a(async()=>{const{BirdFlock:i}=await import("./BirdFlock-ByBkJV35.js").then(t=>t.b);return{BirdFlock:i}},__vite__mapDeps([8,1]),import.meta.url).then(({BirdFlock:i})=>(t,e)=>i.bodiesOf(t,e?.obstacles)),editor:()=>a(async()=>{const{BirdEditor:i}=await import("./BirdEditor-6vr7bLHy.js");return{BirdEditor:i}},__vite__mapDeps([9,3,4,8,1,7,10]),import.meta.url).then(({BirdEditor:i})=>(t,e,r)=>new i(t,e,r))},st=f.catalog({en:()=>a(()=>import("./DroneKindMessages_en-CLygXcsv.js"),[],import.meta.url).then(i=>i.droneKindMessages_en),fr:()=>a(()=>import("./DroneKindMessages_fr-CAX15_pk.js"),[],import.meta.url).then(i=>i.droneKindMessages_fr),es:()=>a(()=>import("./DroneKindMessages_es-B9XFRYnQ.js"),[],import.meta.url).then(i=>i.droneKindMessages_es),it:()=>a(()=>import("./DroneKindMessages_it-CSGsCaJQ.js"),[],import.meta.url).then(i=>i.droneKindMessages_it)}),C={quadcopter:"ConsumerDrone",saucer:"ConsumerDrone","fixed-wing":"MilitaryDrone"},U={key:"drones",messages:st,phenomenon:i=>C[i.airframe]??C.quadcopter,compute:()=>a(async()=>{const{DroneFlight:i}=await import("./DroneFlight-CGNIh9XS.js").then(t=>t.c);return{DroneFlight:i}},__vite__mapDeps([11,12]),import.meta.url).then(({DroneFlight:i})=>t=>i.bodiesOf(t)),editor:()=>a(async()=>{const{DroneEditor:i}=await import("./DroneEditor-C3SH8yYq.js");return{DroneEditor:i}},__vite__mapDeps([13,3,4,11,12,7,10]),import.meta.url).then(({DroneEditor:i})=>(t,e,r)=>new i(t,e,r))},ot=h.point("interpretations").provide(h.BUILT_IN,[{id:P.key,name:"Decoy flares",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>P},{id:V.key,name:"Sky lanterns",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>V},{id:$.key,name:"Birds",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>$},{id:U.key,name:"Drones",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>U}]);class H{static kinds(){return ot.map(t=>p.of(t))}}class b{static SIGHTING_EVENT="sighting";static INTERPRETATION_EVENT="interpretation";static INTERVIEW_EVENT="interview";static check(t){return I.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===b.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(n=>n.eventType===b.SIGHTING_EVENT&&n.id!==void 0&&typeof n.url=="string"&&r!==void 0&&new URL(n.url,e).href===r).map(n=>n.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===b.INTERPRETATION_EVENT?s.sighting!==void 0&&r.includes(s.sighting):s.eventType!==b.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 d of r)d.id!==void 0&&(s.has(d.id)&&o.add(d.id),s.add(d.id));const n=[];for(const d of r){const l=d.eventType===b.SIGHTING_EVENT?d.interpretationOf:d.eventType===b.INTERVIEW_EVENT?d.interviewOf:void 0;if(l!==void 0)for(const c of[l].flat())!s.has(c)&&!e.includes(c)&&n.push({reading:d.url??d.id??"",reference:c})}return{duplicateIds:[...o],unresolved:n}}static async interpretationOf(t,e,r){if(t.bodies)return b.withModelsFrom(v.strip({title:t.title,bodies:t.bodies??[],smoke:t.smoke,findings:t.findings,...p.computedPart(t,H.kinds())}).recording,e);if(!t.url)return{title:t.title,bodies:[]};const s=new URL(t.url,e).href,o=await r(s),n="timeline"in o&&o.interpretation?o.interpretation:o;return b.withModelsFrom(v.strip({title:t.title??n.title,bodies:n.bodies??[],smoke:n.smoke,findings:n.findings,...p.computedPart(n,H.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 g{static files=new Map;static hold(t){for(const[e,r]of t)g.files.set(g.key(e),r)}static releaseCopies(){for(const[t,e]of g.files)e.local||g.files.delete(t)}static clear(){g.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=g.files.get(g.key(t));return e===void 0?void 0:structuredClone(e.json)}static changed(...t){return t.some(e=>e!==void 0&&g.files.get(g.key(e))?.changed===!0)}static local(t){return t!==void 0&&g.files.get(g.key(t))?.local===!0}static key(t){const e=new URL(t,location.href);return e.hash="",e.href}}class y{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(y.surveyed)),r;for(const s of y.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=>!y.surveyed(s)):[];r.length>0?e.decor=r:delete e.decor;return}for(const r of y.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=>!y.surveyed(o)):[];e.decor=[...s,...r.decor];return}for(const s of y.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 F{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&&F.NAMES.every(e=>!t[e])&&y.NAMES.every(e=>!t[e])}}class T 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 O{static async recording(t){const e=g.read(t);if(e!==void 0)return e;const r=await O.json(t);for(const s of y.NAMES){const o=r?.snapshots?.[s];if(!(!o?.src||o.live))try{const n=I.recording(await O.json(new URL(o.src,new URL(t,location.href)).href));y.put(s,r,n)}catch{}}return r}static async json(t){const e=new URL(t,location.href),r=g.read(e.href);if(r!==void 0)return r;if(location.protocol==="https:"&&e.protocol==="http:")throw new T("mixed-content",t);let s;try{s=await fetch(t)}catch{throw await this.diagnose(t,e)}if(!s.ok)throw new T("status",t,s.status);try{return await s.json()}catch{throw new T("malformed",t)}}static async diagnose(t,e){if(e.origin===location.origin)return new T("unreachable",t);try{return await fetch(t,{mode:"no-cors"}),new T("cors",t)}catch{return new T("unreachable",t)}}}class S{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(k)||t.setAttribute(k,""),t.addEventListener(W,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:n,SIGHTING_ELEMENT_NAME:d}]=await Promise.all([a(()=>import("./CaseElement-C6KVIESP.js"),__vite__mapDeps([14,15,16,3,5,6,12,17,1,18]),import.meta.url),a(()=>import("./SightingElement-e9ZcWa58.js"),__vite__mapDeps([18,16,3,5,6,12,17,1]),import.meta.url)]);n(),r();const l=b.isCase(g.read(t)??await O.json(t)),c=document.createElement(l?s:d);c.setAttribute(k,""),l&&e&&c.setAttribute(o,S.fileKey(e)),c.setAttribute("src",t),c.addEventListener(q,u=>{u.preventDefault(),this.edit(u.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(),g.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 a(async()=>{const{register:n,CASE_EDITOR_ELEMENT_NAME:d}=await import("./CaseEditorElement-DYMt7oB4.js").then(l=>l.C);return{register:n,CASE_EDITOR_ELEMENT_NAME:d}},__vite__mapDeps([19,3,7,15,16,5,6,12,17,1,10,20,21,22,23]),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),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(){const t=this.editor;if(!t)return this.edit();this.reading&&await this.edit(),t.askBeforeReplacing(()=>{t.remove(),this.editor=void 0,this.edit()})}dropReader(){this.reader?.remove(),this.reader=void 0}static fileKey(t){return new URL(t,location.href).pathname.split("/").pop().replace(/\.json$/i,"")}}const M="rr0-input-file",z={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"},nt=`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./SkyLantern-DJT_Ibzh.js","./Obstacles-v9SkfBD7.js","./LanternEditor-BaRDgTw-.js","./SaidPosition-CWiVNaNW.js","./SkyEventEditorStyle-CvY_AhbI.js","./Sighting-CBpJpdm9.js","./VisualAids-DI-hEL46.js","./ParameterForm-DfpJQGku.js","./BirdFlock-ByBkJV35.js","./BirdEditor-6vr7bLHy.js","./TimelineTracks-X_GEZi12.js","./DroneFlight-CGNIh9XS.js","./Decor-Dn-cvniW.js","./DroneEditor-C3SH8yYq.js","./CaseElement-Cr3vTWdf.js","./ColumnResize-DifCqMt1.js","./ShareDialogElement-ClhewPap.js","./RecordingIssue-BlWT8Xsu.js","./SightingElement-BtHQ5LDE.js","./CaseEditorElement-BTZu9wey.js","./ReentryArchive-CeXHrU7L.js","./ReferenceTimeline-2kBldQeG.js","./upperAirSources-BGuLpdwu.js","./Account-C4jhsVtN.js","./UfoMessages_en-D5OYWJ3K.js","./SightingEditorMessages_en-CTQYcybj.js","./SightingLabels_en-oIpytoq_.js","./SightingEditorMessages_fr-DjUByAq4.js","./SightingLabels_fr-D69zENbW.js","./SightingEditorMessages_es-D-ASD5a3.js","./SightingLabels_es-DUh1CTXl.js","./SightingEditorMessages_it-Eat0U-4p.js","./SightingLabels_it-COLZ2Qth.js","./SightingMessages_en-CYzanHjT.js","./SightingMessages_fr-BtfWbIP7.js","./SightingMessages_es-hjvESK6f.js","./SightingMessages_it-Bqm4pewZ.js","./SceneNames_en-7OZ7peGc.js","./SceneNames_fr-qzw0QzD0.js","./SceneNames_es-P5-Mavdi.js","./SceneNames_it-Sqf8JFOd.js"])))=>i.map(i=>d[i]);
2
+ const W="rr0-read",q="rr0-edit",k="in-place",Y="rr0-mode";class Mt{static ask(t,e,r){const s=new CustomEvent(e,{detail:r,bubbles:!0,composed:!0,cancelable:!0});return t.dispatchEvent(s),s.defaultPrevented}}const J="modulepreload",X=function(i,t){return new URL(i,t).href},D={},a=function(t,e,r){let s=Promise.resolve();if(e&&e.length>0){let n=function(u){return Promise.all(u.map(w=>Promise.resolve(w).then(_=>({status:"fulfilled",value:_}),_=>({status:"rejected",reason:_}))))};const d=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),c=l?.nonce||l?.getAttribute("nonce");s=n(e.map(u=>{if(u=X(u,r),u in D)return;D[u]=!0;const w=u.endsWith(".css"),_=w?'[rel="stylesheet"]':"";if(!!r)for(let L=d.length-1;L>=0;L--){const x=d[L];if(x.href===u&&(!w||x.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${_}`))return;const A=document.createElement("link");if(A.rel=w?"stylesheet":J,w||(A.as="script"),A.crossOrigin="",A.href=u,c&&A.setAttribute("nonce",c),document.head.appendChild(A),w)return new Promise((L,x)=>{A.addEventListener("load",L),A.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${u}`)))})}))}function o(n){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=n,window.dispatchEvent(d),!d.defaultPrevented)throw n}return s.then(n=>{for(const d of n||[])d.status==="rejected"&&o(d.reason);return t().catch(o)})};class v{constructor(t){this.entries=t}static free(t){return t?.basis==="assumed"||t?.basis==="fitted"}static empty(){return new v(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 v(new Map);return{recording:v.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 n=e.at(o),d=o.split("."),l=v.writableHolderOf(r,d,s);if(!l)continue;const c=d[d.length-1],u=l[c];u!==void 0&&(n.of!==void 0&&JSON.stringify(n.of)!==JSON.stringify(u)||(l[c]={value:u,...n.basis==="stated"?{}:{basis:n.basis},...n.rationale===void 0?{}:{rationale:n.rationale},...n.how===void 0?{}:{how:n.how},...n.range===void 0?{}:{range:n.range},...n.source===void 0?{}:{source:n.source}}))}return r}static isWrapper(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&"value"in t}static stripValue(t,e,r){return v.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}),v.stripValue(t.value,e,r)):Array.isArray(t)?t.map((s,o)=>v.stripValue(s,[...e,String(o)],r)):typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t).map(([s,o])=>[s,v.stripValue(o,[...e,s],r)])):t}static writableHolderOf(t,e,r){let s=t;for(const o of e.slice(0,-1)){const n=s[o];if(typeof n!="object"||n===null)return;if(r.has(n)){s=n;continue}const d=Array.isArray(n)?[...n]:{...n};r.add(d),s[o]=d,s=d}return s}}class Z 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 I{static CURRENT={sighting:4,case:1,interview:1};static SCHEMA_BASE="https://ufoathome.org/schema";static schemaUrl(t,e=I.CURRENT[t]){return`${I.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 I.check(t,"sighting")}static check(t,e){const r=I.of(t),s=I.CURRENT[e];if(typeof r!="number"||!Number.isInteger(r)||r!==s)throw new Z(e,r,s);return t}}class p{static built=new WeakMap;static computers=new WeakMap;static loading=new WeakMap;static loaded(t,e){return e.every(r=>p.itemsOf(t,r.key).length===0||p.computers.has(r))}static load(t,e){return Promise.all(e.filter(r=>p.itemsOf(t,r.key).length>0&&!p.computers.has(r)).map(r=>{let s=p.loading.get(r);return s||(s=r.compute().then(o=>{p.computers.set(r,o)}),s.catch(()=>p.loading.delete(r)),p.loading.set(r,s)),s.catch(()=>{})})).then(()=>{})}static of(t){let e=p.built.get(t);return e||(e=t.create(),p.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=>p.itemsOf(t,r.key).length>0)}static expand(t,e,r){return p.expandWithKinds(t,e,r).interpretation}static expandWithKinds(t,e,r){const s=new Map,o=new Map;if(!t||!p.computes(t,e))return{interpretation:t,kindOf:s,phenomenonOf:o};const n=e.flatMap(d=>p.itemsOf(t,d.key).flatMap(l=>{const c=p.computers.get(d);if(!c)return[];const u=c(l,r),w=d.phenomenon?.(l);for(const _ of u)s.set(_.id,d),w&&o.set(_.id,w);return u}));return{interpretation:{...t,bodies:[...t.bodies,...n]},kindOf:s,phenomenonOf:o}}static computedPart(t,e){const r={};for(const s of e){const o=p.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)}}class G 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 Q{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 G(t,this.id,r.sourceId,r.ownerId);this.withdraw(t);const s=t===h.BUILT_IN?this.sources.findIndex(o=>this.owners.get(o.id)!==h.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 h{static BUILT_IN="ufoathome";static changes=new EventTarget;static points=new Map;static modules=new Map;static point(t){let e=h.points.get(t);return e||(e=new Q(t),h.points.set(t,e)),e}static install(t){if(t.id===h.BUILT_IN)throw new Error(`"${h.BUILT_IN}" is the id of the built-in module`);const e=h.contributionsOf(t);for(const[o,n]of e){const d=h.point(o).conflict(t.id,n);if(d)throw new G(t.id,o,d.sourceId,d.ownerId)}const r=new Set(e.map(([o])=>o)),s=h.modules.get(t.id);if(s)for(const[o]of h.contributionsOf(s))r.add(o);for(const o of r)h.point(o).withdraw(t.id);for(const[o,n]of e)h.point(o).provide(t.id,n);h.modules.set(t.id,t);for(const o of r)h.announce(o)}static uninstall(t){const e=h.modules.get(t);if(e){h.modules.delete(t);for(const[r]of h.contributionsOf(e))h.point(r).withdraw(t),h.announce(r)}}static installed(){return[...h.modules.values()]}static contributionsOf(t){return Object.entries(t.contributes).filter(e=>Array.isArray(e[1])&&e[1].length>0)}static announce(t){h.changes.dispatchEvent(new CustomEvent("change",{detail:t}))}}const tt=["en","fr","es","it"];class f{static catalog(t){const e=new Map;return{load(r){const s=f.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 tt.includes(e)?e:"en"}}const et=f.catalog({en:()=>a(()=>import("./FlareKindMessages_en-j3CY_TxX.js"),[],import.meta.url).then(i=>i.flareKindMessages_en),fr:()=>a(()=>import("./FlareKindMessages_fr-B2MezoN2.js"),[],import.meta.url).then(i=>i.flareKindMessages_fr),es:()=>a(()=>import("./FlareKindMessages_es-CZgrFIOO.js"),[],import.meta.url).then(i=>i.flareKindMessages_es),it:()=>a(()=>import("./FlareKindMessages_it-CmZmb3RP.js"),[],import.meta.url).then(i=>i.flareKindMessages_it)}),P={key:"flares",messages:et,phenomenon:()=>"DecoyFlare",compute:()=>a(async()=>{const{DecoyFlare:i}=await import("./DecoyFlare-DUt1_LcW.js");return{DecoyFlare:i}},[],import.meta.url).then(({DecoyFlare:i})=>t=>i.bodiesOf(t))},rt=f.catalog({en:()=>a(()=>import("./LanternKindMessages_en-CQXdJ-k6.js"),[],import.meta.url).then(i=>i.lanternKindMessages_en),fr:()=>a(()=>import("./LanternKindMessages_fr-D7tQa_tQ.js"),[],import.meta.url).then(i=>i.lanternKindMessages_fr),es:()=>a(()=>import("./LanternKindMessages_es-BOO6kPjs.js"),[],import.meta.url).then(i=>i.lanternKindMessages_es),it:()=>a(()=>import("./LanternKindMessages_it-B8J-29Mj.js"),[],import.meta.url).then(i=>i.lanternKindMessages_it)}),V={key:"lanterns",messages:rt,phenomenon:()=>"SkyLantern",compute:()=>a(async()=>{const{SkyLantern:i}=await import("./SkyLantern-DJT_Ibzh.js");return{SkyLantern:i}},__vite__mapDeps([0,1]),import.meta.url).then(({SkyLantern:i})=>(t,e)=>i.bodiesOf(t,e?.obstacles)),editor:()=>a(async()=>{const{LanternEditor:i}=await import("./LanternEditor-BaRDgTw-.js");return{LanternEditor:i}},__vite__mapDeps([2,3,4,0,1,5,6,7]),import.meta.url).then(({LanternEditor:i})=>(t,e,r)=>new i(t,e,r))},it=f.catalog({en:()=>a(()=>import("./BirdKindMessages_en-c_-L7frF.js"),[],import.meta.url).then(i=>i.birdKindMessages_en),fr:()=>a(()=>import("./BirdKindMessages_fr-C1TuqqEj.js"),[],import.meta.url).then(i=>i.birdKindMessages_fr),es:()=>a(()=>import("./BirdKindMessages_es-8Zo2t0o4.js"),[],import.meta.url).then(i=>i.birdKindMessages_es),it:()=>a(()=>import("./BirdKindMessages_it-DQZcrCkf.js"),[],import.meta.url).then(i=>i.birdKindMessages_it)}),$={key:"birds",messages:it,phenomenon:()=>"Birds",compute:()=>a(async()=>{const{BirdFlock:i}=await import("./BirdFlock-ByBkJV35.js").then(t=>t.b);return{BirdFlock:i}},__vite__mapDeps([8,1]),import.meta.url).then(({BirdFlock:i})=>(t,e)=>i.bodiesOf(t,e?.obstacles)),editor:()=>a(async()=>{const{BirdEditor:i}=await import("./BirdEditor-6vr7bLHy.js");return{BirdEditor:i}},__vite__mapDeps([9,3,4,8,1,7,10]),import.meta.url).then(({BirdEditor:i})=>(t,e,r)=>new i(t,e,r))},st=f.catalog({en:()=>a(()=>import("./DroneKindMessages_en-CLygXcsv.js"),[],import.meta.url).then(i=>i.droneKindMessages_en),fr:()=>a(()=>import("./DroneKindMessages_fr-CAX15_pk.js"),[],import.meta.url).then(i=>i.droneKindMessages_fr),es:()=>a(()=>import("./DroneKindMessages_es-B9XFRYnQ.js"),[],import.meta.url).then(i=>i.droneKindMessages_es),it:()=>a(()=>import("./DroneKindMessages_it-CSGsCaJQ.js"),[],import.meta.url).then(i=>i.droneKindMessages_it)}),C={quadcopter:"ConsumerDrone",saucer:"ConsumerDrone","fixed-wing":"MilitaryDrone"},U={key:"drones",messages:st,phenomenon:i=>C[i.airframe]??C.quadcopter,compute:()=>a(async()=>{const{DroneFlight:i}=await import("./DroneFlight-CGNIh9XS.js").then(t=>t.c);return{DroneFlight:i}},__vite__mapDeps([11,12]),import.meta.url).then(({DroneFlight:i})=>t=>i.bodiesOf(t)),editor:()=>a(async()=>{const{DroneEditor:i}=await import("./DroneEditor-C3SH8yYq.js");return{DroneEditor:i}},__vite__mapDeps([13,3,4,11,12,7,10]),import.meta.url).then(({DroneEditor:i})=>(t,e,r)=>new i(t,e,r))},ot=h.point("interpretations").provide(h.BUILT_IN,[{id:P.key,name:"Decoy flares",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>P},{id:V.key,name:"Sky lanterns",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>V},{id:$.key,name:"Birds",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>$},{id:U.key,name:"Drones",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>U}]);class H{static kinds(){return ot.map(t=>p.of(t))}}class b{static SIGHTING_EVENT="sighting";static INTERPRETATION_EVENT="interpretation";static INTERVIEW_EVENT="interview";static check(t){return I.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===b.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(n=>n.eventType===b.SIGHTING_EVENT&&n.id!==void 0&&typeof n.url=="string"&&r!==void 0&&new URL(n.url,e).href===r).map(n=>n.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===b.INTERPRETATION_EVENT?s.sighting!==void 0&&r.includes(s.sighting):s.eventType!==b.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 d of r)d.id!==void 0&&(s.has(d.id)&&o.add(d.id),s.add(d.id));const n=[];for(const d of r){const l=d.eventType===b.SIGHTING_EVENT?d.interpretationOf:d.eventType===b.INTERVIEW_EVENT?d.interviewOf:void 0;if(l!==void 0)for(const c of[l].flat())!s.has(c)&&!e.includes(c)&&n.push({reading:d.url??d.id??"",reference:c})}return{duplicateIds:[...o],unresolved:n}}static async interpretationOf(t,e,r){if(t.bodies)return b.withModelsFrom(v.strip({title:t.title,bodies:t.bodies??[],smoke:t.smoke,findings:t.findings,...p.computedPart(t,H.kinds())}).recording,e);if(!t.url)return{title:t.title,bodies:[]};const s=new URL(t.url,e).href,o=await r(s),n="timeline"in o&&o.interpretation?o.interpretation:o;return b.withModelsFrom(v.strip({title:t.title??n.title,bodies:n.bodies??[],smoke:n.smoke,findings:n.findings,...p.computedPart(n,H.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 g{static files=new Map;static hold(t){for(const[e,r]of t)g.files.set(g.key(e),r)}static releaseCopies(){for(const[t,e]of g.files)e.local||g.files.delete(t)}static clear(){g.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=g.files.get(g.key(t));return e===void 0?void 0:structuredClone(e.json)}static changed(...t){return t.some(e=>e!==void 0&&g.files.get(g.key(e))?.changed===!0)}static local(t){return t!==void 0&&g.files.get(g.key(t))?.local===!0}static key(t){const e=new URL(t,location.href);return e.hash="",e.href}}class y{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(y.surveyed)),r;for(const s of y.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=>!y.surveyed(s)):[];r.length>0?e.decor=r:delete e.decor;return}for(const r of y.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=>!y.surveyed(o)):[];e.decor=[...s,...r.decor];return}for(const s of y.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 F{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&&F.NAMES.every(e=>!t[e])&&y.NAMES.every(e=>!t[e])}}class T 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 O{static async recording(t){const e=g.read(t);if(e!==void 0)return e;const r=await O.json(t);for(const s of y.NAMES){const o=r?.snapshots?.[s];if(!(!o?.src||o.live))try{const n=I.recording(await O.json(new URL(o.src,new URL(t,location.href)).href));y.put(s,r,n)}catch{}}return r}static async json(t){const e=new URL(t,location.href),r=g.read(e.href);if(r!==void 0)return r;if(location.protocol==="https:"&&e.protocol==="http:")throw new T("mixed-content",t);let s;try{s=await fetch(t)}catch{throw await this.diagnose(t,e)}if(!s.ok)throw new T("status",t,s.status);try{return await s.json()}catch{throw new T("malformed",t)}}static async diagnose(t,e){if(e.origin===location.origin)return new T("unreachable",t);try{return await fetch(t,{mode:"no-cors"}),new T("cors",t)}catch{return new T("unreachable",t)}}}class S{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(k)||t.setAttribute(k,""),t.addEventListener(W,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:n,SIGHTING_ELEMENT_NAME:d}]=await Promise.all([a(()=>import("./CaseElement-Cr3vTWdf.js"),__vite__mapDeps([14,15,16,3,5,6,12,17,1,18]),import.meta.url),a(()=>import("./SightingElement-BtHQ5LDE.js"),__vite__mapDeps([18,16,3,5,6,12,17,1]),import.meta.url)]);n(),r();const l=b.isCase(g.read(t)??await O.json(t)),c=document.createElement(l?s:d);c.setAttribute(k,""),l&&e&&c.setAttribute(o,S.fileKey(e)),c.setAttribute("src",t),c.addEventListener(q,u=>{u.preventDefault(),this.edit(u.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(),g.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 a(async()=>{const{register:n,CASE_EDITOR_ELEMENT_NAME:d}=await import("./CaseEditorElement-BTZu9wey.js").then(l=>l.C);return{register:n,CASE_EDITOR_ELEMENT_NAME:d}},__vite__mapDeps([19,3,7,15,16,5,6,12,17,1,10,20,21,22,23]),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),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(){const t=this.editor;if(!t)return this.edit();this.reading&&await this.edit(),t.askBeforeReplacing(()=>{t.remove(),this.editor=void 0,this.edit()})}dropReader(){this.reader?.remove(),this.reader=void 0}static fileKey(t){return new URL(t,location.href).pathname.split("/").pop().replace(/\.json$/i,"")}}const M="rr0-input-file",z={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"},nt=`
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; }
@@ -114,7 +114,7 @@ ${t} :is(select:not([multiple]):not([size]), .rr0-select) {
114
114
  :is(${s(E.INFO,t)}) { color: color-mix(in srgb, CanvasText 62%, transparent); }
115
115
  :is(${s(E.WARNING,e)}) { color: color-mix(in srgb, #e48a00 72%, CanvasText); }
116
116
  :is(${s(E.ERROR,r)}) { color: color-mix(in srgb, #e5322d 72%, CanvasText); }
117
- `}static show(t,e,r="info"){t.textContent=e??"",t.hidden=!e,t.classList.toggle(E.INFO,r==="info"),t.classList.toggle(E.WARNING,r==="warning"),t.classList.toggle(E.ERROR,r==="error")}}function at(i,t){for(const e of i){const r=e.toLowerCase().split("-")[0];if(t.includes(r))return r}return"en"}class dt{static preferencesFor(t){const e=navigator.languages??[],r=this.declaredFor(t);return r?[r,...e]:e}static declaredFor(t){for(let e=t;e;){const r=e.closest("[lang]")?.getAttribute("lang")?.trim();if(r)return r;const s=e.getRootNode();e=s instanceof ShadowRoot?s.host:void 0}}}const ct=["en","fr","es","it"],lt={en:()=>a(()=>import("./UfoMessages_en-D5OYWJ3K.js"),__vite__mapDeps([24,17]),import.meta.url).then(i=>i.ufoMessages_en),fr:()=>a(()=>import("./UfoMessages_fr-CGkQBn5r.js"),[],import.meta.url).then(i=>i.ufoMessages_fr),es:()=>a(()=>import("./UfoMessages_es-CO-v8Jl6.js"),[],import.meta.url).then(i=>i.ufoMessages_es),it:()=>a(()=>import("./UfoMessages_it-BScqxIaH.js"),[],import.meta.url).then(i=>i.ufoMessages_it)},Nt=f.catalog(lt),ut={en:()=>a(()=>import("./SightingEditorMessages_en-CTQYcybj.js"),__vite__mapDeps([25,26]),import.meta.url).then(i=>i.sightingEditorMessages_en),fr:()=>a(()=>import("./SightingEditorMessages_fr-DjUByAq4.js"),__vite__mapDeps([27,28]),import.meta.url).then(i=>i.sightingEditorMessages_fr),es:()=>a(()=>import("./SightingEditorMessages_es-D-ASD5a3.js"),__vite__mapDeps([29,30]),import.meta.url).then(i=>i.sightingEditorMessages_es),it:()=>a(()=>import("./SightingEditorMessages_it-Eat0U-4p.js"),__vite__mapDeps([31,32]),import.meta.url).then(i=>i.sightingEditorMessages_it)},ht=f.catalog(ut);function Dt(i){return ht.load(i)}const pt={en:()=>a(()=>import("./SightingMessages_en-CYzanHjT.js"),__vite__mapDeps([33,26]),import.meta.url).then(i=>i.sightingMessages_en),fr:()=>a(()=>import("./SightingMessages_fr-BtfWbIP7.js"),__vite__mapDeps([34,28]),import.meta.url).then(i=>i.sightingMessages_fr),es:()=>a(()=>import("./SightingMessages_es-hjvESK6f.js"),__vite__mapDeps([35,30]),import.meta.url).then(i=>i.sightingMessages_es),it:()=>a(()=>import("./SightingMessages_it-Bqm4pewZ.js"),__vite__mapDeps([36,32]),import.meta.url).then(i=>i.sightingMessages_it)},Pt=f.catalog(pt),mt={en:()=>a(()=>import("./CaseMessages_en-BbbbikHH.js"),[],import.meta.url).then(i=>i.caseMessages_en),fr:()=>a(()=>import("./CaseMessages_fr-CD33PQCH.js"),[],import.meta.url).then(i=>i.caseMessages_fr),es:()=>a(()=>import("./CaseMessages_es-AHBxl8Ka.js"),[],import.meta.url).then(i=>i.caseMessages_es),it:()=>a(()=>import("./CaseMessages_it-DyMACGSU.js"),[],import.meta.url).then(i=>i.caseMessages_it)},ft=f.catalog(mt);function Vt(i){return ft.load(i)}const gt={en:()=>a(()=>import("./UfoAtHomeMessages_en-dlx_C679.js"),[],import.meta.url).then(i=>i.ufoAtHomeMessages_en),fr:()=>a(()=>import("./UfoAtHomeMessages_fr-LR76-eHS.js"),[],import.meta.url).then(i=>i.ufoAtHomeMessages_fr),es:()=>a(()=>import("./UfoAtHomeMessages_es-uLOvtAD0.js"),[],import.meta.url).then(i=>i.ufoAtHomeMessages_es),it:()=>a(()=>import("./UfoAtHomeMessages_it-CQl4uTnG.js"),[],import.meta.url).then(i=>i.ufoAtHomeMessages_it)},_t=f.catalog(gt);function Et(i){return _t.load(i)}const wt={en:()=>a(()=>import("./ShareMessages_en-B43x8LgJ.js"),[],import.meta.url).then(i=>i.shareMessages_en),fr:()=>a(()=>import("./ShareMessages_fr-CzZyVbbX.js"),[],import.meta.url).then(i=>i.shareMessages_fr),es:()=>a(()=>import("./ShareMessages_es-DZCJojSc.js"),[],import.meta.url).then(i=>i.shareMessages_es),it:()=>a(()=>import("./ShareMessages_it-C_Z6eDQK.js"),[],import.meta.url).then(i=>i.shareMessages_it)},$t=f.catalog(wt);function Ct(i){switch(i){case"fr":return a(()=>import("./TagNames_fr-Dnqq6HQ5.js"),[],import.meta.url).then(t=>t.tagNames_fr);case"es":return a(()=>import("./TagNames_es-BfnMpc3D.js"),[],import.meta.url).then(t=>t.tagNames_es);case"it":return a(()=>import("./TagNames_it-n6E4EGYO.js"),[],import.meta.url).then(t=>t.tagNames_it);default:return Promise.resolve({})}}const vt={en:()=>a(()=>import("./BodyEditorMessages_en-CckxSS1L.js"),[],import.meta.url).then(i=>i.bodyEditorMessages_en),fr:()=>a(()=>import("./BodyEditorMessages_fr-638ypdqf.js"),[],import.meta.url).then(i=>i.bodyEditorMessages_fr),es:()=>a(()=>import("./BodyEditorMessages_es-B8GlFFBo.js"),[],import.meta.url).then(i=>i.bodyEditorMessages_es),it:()=>a(()=>import("./BodyEditorMessages_it-SKpMkHFI.js"),[],import.meta.url).then(i=>i.bodyEditorMessages_it)},bt={en:()=>a(()=>import("./CaseEditorMessages_en-CoFukfwf.js"),[],import.meta.url).then(i=>i.caseEditorMessages_en),fr:()=>a(()=>import("./CaseEditorMessages_fr-DXl2GNmR.js"),[],import.meta.url).then(i=>i.caseEditorMessages_fr),es:()=>a(()=>import("./CaseEditorMessages_es-DZptbzB7.js"),[],import.meta.url).then(i=>i.caseEditorMessages_es),it:()=>a(()=>import("./CaseEditorMessages_it-ss10VmRM.js"),[],import.meta.url).then(i=>i.caseEditorMessages_it)},yt={en:()=>a(()=>import("./ReadingSensitivityMessages_en-ChQHFyxb.js"),[],import.meta.url).then(i=>i.readingSensitivityMessages_en),fr:()=>a(()=>import("./ReadingSensitivityMessages_fr-Dl4a8udu.js"),[],import.meta.url).then(i=>i.readingSensitivityMessages_fr),es:()=>a(()=>import("./ReadingSensitivityMessages_es-BbFqHsvR.js"),[],import.meta.url).then(i=>i.readingSensitivityMessages_es),it:()=>a(()=>import("./ReadingSensitivityMessages_it-CwiJfUo_.js"),[],import.meta.url).then(i=>i.readingSensitivityMessages_it)},Ut=f.catalog(yt),At={en:()=>a(()=>import("./CaseExportMessages_en-jHlu58Y7.js"),[],import.meta.url).then(i=>i.caseExportMessages_en),fr:()=>a(()=>import("./CaseExportMessages_fr-sDfEgjWg.js"),[],import.meta.url).then(i=>i.caseExportMessages_fr),es:()=>a(()=>import("./CaseExportMessages_es-dCQQFgjq.js"),[],import.meta.url).then(i=>i.caseExportMessages_es),it:()=>a(()=>import("./CaseExportMessages_it-BJaglZtP.js"),[],import.meta.url).then(i=>i.caseExportMessages_it)},Ht=f.catalog(At),It={en:()=>a(()=>import("./InterviewMessages_en-ru7GkZlQ.js"),[],import.meta.url).then(i=>i.interviewMessages_en),fr:()=>a(()=>import("./InterviewMessages_fr-DAYgf8Ms.js"),[],import.meta.url).then(i=>i.interviewMessages_fr),es:()=>a(()=>import("./InterviewMessages_es-DkJurNrG.js"),[],import.meta.url).then(i=>i.interviewMessages_es),it:()=>a(()=>import("./InterviewMessages_it-6lenkmSg.js"),[],import.meta.url).then(i=>i.interviewMessages_it)},Bt=f.catalog(It),Gt=f.catalog(bt),Ft=f.catalog(vt),Tt=f.catalog({en:()=>a(()=>import("./SceneNames_en-7OZ7peGc.js"),__vite__mapDeps([37,6]),import.meta.url).then(i=>i.sceneNames_en),fr:()=>a(()=>import("./SceneNames_fr-qzw0QzD0.js"),__vite__mapDeps([38,6]),import.meta.url).then(i=>i.sceneNames_fr),es:()=>a(()=>import("./SceneNames_es-P5-Mavdi.js"),__vite__mapDeps([39,6]),import.meta.url).then(i=>i.sceneNames_es),it:()=>a(()=>import("./SceneNames_it-Sqf8JFOd.js"),__vite__mapDeps([40,6]),import.meta.url).then(i=>i.sceneNames_it)});function zt(i){return Tt.load(i)}const jt=f.catalog({en:()=>a(()=>import("./CloudEditorMessages_en-SmcRKW1O.js"),[],import.meta.url).then(i=>i.cloudEditorMessages_en),fr:()=>a(()=>import("./CloudEditorMessages_fr-SvL-CR04.js"),[],import.meta.url).then(i=>i.cloudEditorMessages_fr),es:()=>a(()=>import("./CloudEditorMessages_es-DFCuS9Qg.js"),[],import.meta.url).then(i=>i.cloudEditorMessages_es),it:()=>a(()=>import("./CloudEditorMessages_it-BvfiHWV9.js"),[],import.meta.url).then(i=>i.cloudEditorMessages_it)}),B="rr0-ufoathome",Lt='<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round"><path d="M8 3v10M3 8h10"/></svg>',xt='<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M2 4.5h4l1.5 1.5H14v6.5H2z"/></svg>',Ot=`
117
+ `}static show(t,e,r="info"){t.textContent=e??"",t.hidden=!e,t.classList.toggle(E.INFO,r==="info"),t.classList.toggle(E.WARNING,r==="warning"),t.classList.toggle(E.ERROR,r==="error")}}function at(i,t){for(const e of i){const r=e.toLowerCase().split("-")[0];if(t.includes(r))return r}return"en"}class dt{static preferencesFor(t){const e=navigator.languages??[],r=this.declaredFor(t);return r?[r,...e]:e}static declaredFor(t){for(let e=t;e;){const r=e.closest("[lang]")?.getAttribute("lang")?.trim();if(r)return r;const s=e.getRootNode();e=s instanceof ShadowRoot?s.host:void 0}}}const ct=["en","fr","es","it"],lt={en:()=>a(()=>import("./UfoMessages_en-D5OYWJ3K.js"),__vite__mapDeps([24,17]),import.meta.url).then(i=>i.ufoMessages_en),fr:()=>a(()=>import("./UfoMessages_fr-CGkQBn5r.js"),[],import.meta.url).then(i=>i.ufoMessages_fr),es:()=>a(()=>import("./UfoMessages_es-CO-v8Jl6.js"),[],import.meta.url).then(i=>i.ufoMessages_es),it:()=>a(()=>import("./UfoMessages_it-BScqxIaH.js"),[],import.meta.url).then(i=>i.ufoMessages_it)},Nt=f.catalog(lt),ut={en:()=>a(()=>import("./SightingEditorMessages_en-CTQYcybj.js"),__vite__mapDeps([25,26]),import.meta.url).then(i=>i.sightingEditorMessages_en),fr:()=>a(()=>import("./SightingEditorMessages_fr-DjUByAq4.js"),__vite__mapDeps([27,28]),import.meta.url).then(i=>i.sightingEditorMessages_fr),es:()=>a(()=>import("./SightingEditorMessages_es-D-ASD5a3.js"),__vite__mapDeps([29,30]),import.meta.url).then(i=>i.sightingEditorMessages_es),it:()=>a(()=>import("./SightingEditorMessages_it-Eat0U-4p.js"),__vite__mapDeps([31,32]),import.meta.url).then(i=>i.sightingEditorMessages_it)},ht=f.catalog(ut);function Dt(i){return ht.load(i)}const pt={en:()=>a(()=>import("./SightingMessages_en-CYzanHjT.js"),__vite__mapDeps([33,26]),import.meta.url).then(i=>i.sightingMessages_en),fr:()=>a(()=>import("./SightingMessages_fr-BtfWbIP7.js"),__vite__mapDeps([34,28]),import.meta.url).then(i=>i.sightingMessages_fr),es:()=>a(()=>import("./SightingMessages_es-hjvESK6f.js"),__vite__mapDeps([35,30]),import.meta.url).then(i=>i.sightingMessages_es),it:()=>a(()=>import("./SightingMessages_it-Bqm4pewZ.js"),__vite__mapDeps([36,32]),import.meta.url).then(i=>i.sightingMessages_it)},Pt=f.catalog(pt),mt={en:()=>a(()=>import("./CaseMessages_en-G5J5w1_d.js"),[],import.meta.url).then(i=>i.caseMessages_en),fr:()=>a(()=>import("./CaseMessages_fr-B8eZ1NIJ.js"),[],import.meta.url).then(i=>i.caseMessages_fr),es:()=>a(()=>import("./CaseMessages_es-D7Rp1_1K.js"),[],import.meta.url).then(i=>i.caseMessages_es),it:()=>a(()=>import("./CaseMessages_it-Cu02nVVo.js"),[],import.meta.url).then(i=>i.caseMessages_it)},ft=f.catalog(mt);function Vt(i){return ft.load(i)}const gt={en:()=>a(()=>import("./UfoAtHomeMessages_en-dlx_C679.js"),[],import.meta.url).then(i=>i.ufoAtHomeMessages_en),fr:()=>a(()=>import("./UfoAtHomeMessages_fr-LR76-eHS.js"),[],import.meta.url).then(i=>i.ufoAtHomeMessages_fr),es:()=>a(()=>import("./UfoAtHomeMessages_es-uLOvtAD0.js"),[],import.meta.url).then(i=>i.ufoAtHomeMessages_es),it:()=>a(()=>import("./UfoAtHomeMessages_it-CQl4uTnG.js"),[],import.meta.url).then(i=>i.ufoAtHomeMessages_it)},_t=f.catalog(gt);function Et(i){return _t.load(i)}const wt={en:()=>a(()=>import("./ShareMessages_en-B43x8LgJ.js"),[],import.meta.url).then(i=>i.shareMessages_en),fr:()=>a(()=>import("./ShareMessages_fr-CzZyVbbX.js"),[],import.meta.url).then(i=>i.shareMessages_fr),es:()=>a(()=>import("./ShareMessages_es-DZCJojSc.js"),[],import.meta.url).then(i=>i.shareMessages_es),it:()=>a(()=>import("./ShareMessages_it-C_Z6eDQK.js"),[],import.meta.url).then(i=>i.shareMessages_it)},$t=f.catalog(wt);function Ct(i){switch(i){case"fr":return a(()=>import("./TagNames_fr-Dnqq6HQ5.js"),[],import.meta.url).then(t=>t.tagNames_fr);case"es":return a(()=>import("./TagNames_es-BfnMpc3D.js"),[],import.meta.url).then(t=>t.tagNames_es);case"it":return a(()=>import("./TagNames_it-n6E4EGYO.js"),[],import.meta.url).then(t=>t.tagNames_it);default:return Promise.resolve({})}}const vt={en:()=>a(()=>import("./BodyEditorMessages_en-CckxSS1L.js"),[],import.meta.url).then(i=>i.bodyEditorMessages_en),fr:()=>a(()=>import("./BodyEditorMessages_fr-638ypdqf.js"),[],import.meta.url).then(i=>i.bodyEditorMessages_fr),es:()=>a(()=>import("./BodyEditorMessages_es-B8GlFFBo.js"),[],import.meta.url).then(i=>i.bodyEditorMessages_es),it:()=>a(()=>import("./BodyEditorMessages_it-SKpMkHFI.js"),[],import.meta.url).then(i=>i.bodyEditorMessages_it)},bt={en:()=>a(()=>import("./CaseEditorMessages_en-BPdxQsTX.js"),[],import.meta.url).then(i=>i.caseEditorMessages_en),fr:()=>a(()=>import("./CaseEditorMessages_fr-DTWi9mIY.js"),[],import.meta.url).then(i=>i.caseEditorMessages_fr),es:()=>a(()=>import("./CaseEditorMessages_es-B48BAICC.js"),[],import.meta.url).then(i=>i.caseEditorMessages_es),it:()=>a(()=>import("./CaseEditorMessages_it-CMLxgu8y.js"),[],import.meta.url).then(i=>i.caseEditorMessages_it)},yt={en:()=>a(()=>import("./ReadingSensitivityMessages_en-ChQHFyxb.js"),[],import.meta.url).then(i=>i.readingSensitivityMessages_en),fr:()=>a(()=>import("./ReadingSensitivityMessages_fr-Dl4a8udu.js"),[],import.meta.url).then(i=>i.readingSensitivityMessages_fr),es:()=>a(()=>import("./ReadingSensitivityMessages_es-BbFqHsvR.js"),[],import.meta.url).then(i=>i.readingSensitivityMessages_es),it:()=>a(()=>import("./ReadingSensitivityMessages_it-CwiJfUo_.js"),[],import.meta.url).then(i=>i.readingSensitivityMessages_it)},Ut=f.catalog(yt),At={en:()=>a(()=>import("./CaseExportMessages_en-jHlu58Y7.js"),[],import.meta.url).then(i=>i.caseExportMessages_en),fr:()=>a(()=>import("./CaseExportMessages_fr-sDfEgjWg.js"),[],import.meta.url).then(i=>i.caseExportMessages_fr),es:()=>a(()=>import("./CaseExportMessages_es-dCQQFgjq.js"),[],import.meta.url).then(i=>i.caseExportMessages_es),it:()=>a(()=>import("./CaseExportMessages_it-BJaglZtP.js"),[],import.meta.url).then(i=>i.caseExportMessages_it)},Ht=f.catalog(At),It={en:()=>a(()=>import("./InterviewMessages_en-ru7GkZlQ.js"),[],import.meta.url).then(i=>i.interviewMessages_en),fr:()=>a(()=>import("./InterviewMessages_fr-DAYgf8Ms.js"),[],import.meta.url).then(i=>i.interviewMessages_fr),es:()=>a(()=>import("./InterviewMessages_es-DkJurNrG.js"),[],import.meta.url).then(i=>i.interviewMessages_es),it:()=>a(()=>import("./InterviewMessages_it-6lenkmSg.js"),[],import.meta.url).then(i=>i.interviewMessages_it)},Bt=f.catalog(It),Gt=f.catalog(bt),Ft=f.catalog(vt),Tt=f.catalog({en:()=>a(()=>import("./SceneNames_en-7OZ7peGc.js"),__vite__mapDeps([37,6]),import.meta.url).then(i=>i.sceneNames_en),fr:()=>a(()=>import("./SceneNames_fr-qzw0QzD0.js"),__vite__mapDeps([38,6]),import.meta.url).then(i=>i.sceneNames_fr),es:()=>a(()=>import("./SceneNames_es-P5-Mavdi.js"),__vite__mapDeps([39,6]),import.meta.url).then(i=>i.sceneNames_es),it:()=>a(()=>import("./SceneNames_it-Sqf8JFOd.js"),__vite__mapDeps([40,6]),import.meta.url).then(i=>i.sceneNames_it)});function zt(i){return Tt.load(i)}const jt=f.catalog({en:()=>a(()=>import("./CloudEditorMessages_en-SmcRKW1O.js"),[],import.meta.url).then(i=>i.cloudEditorMessages_en),fr:()=>a(()=>import("./CloudEditorMessages_fr-SvL-CR04.js"),[],import.meta.url).then(i=>i.cloudEditorMessages_fr),es:()=>a(()=>import("./CloudEditorMessages_es-DFCuS9Qg.js"),[],import.meta.url).then(i=>i.cloudEditorMessages_es),it:()=>a(()=>import("./CloudEditorMessages_it-BvfiHWV9.js"),[],import.meta.url).then(i=>i.cloudEditorMessages_it)}),B="rr0-ufoathome",Lt='<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round"><path d="M8 3v10M3 8h10"/></svg>',xt='<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M2 4.5h4l1.5 1.5H14v6.5H2z"/></svg>',Ot=`
118
118
  <style>
119
119
  :host { display: block; ${R.TOKENS} }
120
120
  :host([hidden]) { display: none; }