@rr0/ufoathome 0.201.0 → 0.202.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (208) hide show
  1. package/dist-embed-interview/InterviewMessages_en-BrnxG2rl.js +3 -0
  2. package/dist-embed-interview/InterviewMessages_es-Dxfjqrte.js +3 -0
  3. package/dist-embed-interview/InterviewMessages_fr-DIA-1qu8.js +3 -0
  4. package/dist-embed-interview/InterviewMessages_it-CYBEIKX-.js +3 -0
  5. package/dist-embed-interview/rr0-interview.mjs +10 -6
  6. package/dist-embed-scene/{AirshipEditor-BnRmKeVs.js → AirshipEditor-guE_ib3z.js} +1 -1
  7. package/dist-embed-scene/{AirshipFlight-C9DSPGwk.js → AirshipFlight-DzW0313e.js} +1 -1
  8. package/{dist-embed-sighting/AuroraSimulation-C9hvCV0W.js → dist-embed-scene/AuroraSimulation-Dh4kZW1x.js} +7 -2
  9. package/dist-embed-scene/{BalloonEditor-BehJs6H-.js → BalloonEditor-BIsCy_y4.js} +2 -2
  10. package/dist-embed-scene/{BalloonFlight-BYn4diw1.js → BalloonFlight-gunghgAq.js} +1 -1
  11. package/dist-embed-scene/{BirdEditor-dOp1sGsz.js → BirdEditor-CuLv4Ij5.js} +1 -1
  12. package/dist-embed-scene/{BirdFlock-CfJeXvWu.js → BirdFlock-L3dYU2K_.js} +1 -1
  13. package/dist-embed-scene/{DroneEditor-CBoR4fJ_.js → DroneEditor-BQWPhTyf.js} +1 -1
  14. package/dist-embed-scene/{DroneFlight-DSE1OXqh.js → DroneFlight-ERYah68l.js} +1 -1
  15. package/dist-embed-scene/{DroneParameters-D3EOg4oe.js → DroneParameters-CoWQympS.js} +1 -1
  16. package/dist-embed-scene/{LanternEditor-CbcA7K8y.js → LanternEditor-BpCyb79i.js} +1 -1
  17. package/dist-embed-scene/{ModuleSession-XnOI5Mcr.js → ModuleSession-bj7QHWjO.js} +2 -2
  18. package/dist-embed-scene/ModuleThree-DRsA8rtL.js +1 -0
  19. package/dist-embed-scene/SearchlightSystem-Ddws2hQY.js +1 -0
  20. package/dist-embed-scene/{SkyLantern-Dp_B40X0.js → SkyLantern-C3BSxHtq.js} +1 -1
  21. package/dist-embed-scene/rr0-scene.mjs +106 -81
  22. package/{dist-embed-scene/AuroraSimulation-BZpjImM0.js → dist-embed-sighting/AuroraSimulation-C7LAHgWM.js} +7 -2
  23. package/dist-embed-sighting/{CaseReportExport-DVVsc8gA.js → CaseReportExport-BtGCWD7H.js} +1 -1
  24. package/dist-embed-sighting/{InterviewElement-BduwyUn5.js → InterviewElement-B_ULRy5z.js} +9 -5
  25. package/dist-embed-sighting/InterviewMessages_en-BrnxG2rl.js +3 -0
  26. package/dist-embed-sighting/InterviewMessages_es-Dxfjqrte.js +3 -0
  27. package/dist-embed-sighting/InterviewMessages_fr-DIA-1qu8.js +3 -0
  28. package/dist-embed-sighting/InterviewMessages_it-CYBEIKX-.js +3 -0
  29. package/dist-embed-sighting/{ModuleSession-ChJsGuTn.js → ModuleSession-DztK084a.js} +2 -2
  30. package/dist-embed-sighting/{ModuleThree-whEZoXYF.js → ModuleThree-BLNSm2eY.js} +1 -1
  31. package/dist-embed-sighting/SearchlightSystem-PEMBDW1s.js +1 -0
  32. package/dist-embed-sighting/rr0-sighting.mjs +112 -87
  33. package/dist-embed-sighting-editor/{AdsbLolArchiveProvider-CWpyBqG3.js → AdsbLolArchiveProvider-Bz1OjSjY.js} +1 -1
  34. package/dist-embed-sighting-editor/{AirshipEditor-BvnVNcF4.js → AirshipEditor-BlJXyxlr.js} +1 -1
  35. package/dist-embed-sighting-editor/{AirshipFlight-CB1Quf68.js → AirshipFlight-Cx40Y8JT.js} +1 -1
  36. package/dist-embed-sighting-editor/{Aurora-BRXvgyRM.js → Aurora-Ldk66p1A.js} +1 -1
  37. package/dist-embed-sighting-editor/{AuroraEditor-JQ3kRqrq.js → AuroraEditor-CGSomAFk.js} +1 -1
  38. package/dist-embed-sighting-editor/{AuroraSimulation-i64MFW2z.js → AuroraSimulation-vKcv2Hue.js} +7 -2
  39. package/dist-embed-sighting-editor/{BallesterGuaspAssessor-BaKKAdY3.js → BallesterGuaspAssessor-CJyRqwvh.js} +1 -1
  40. package/dist-embed-sighting-editor/{BalloonEditor-C2oHClW7.js → BalloonEditor-CgO4LaWn.js} +1 -1
  41. package/dist-embed-sighting-editor/{BalloonFlight-B9A6MoCj.js → BalloonFlight-hLr_4TFU.js} +1 -1
  42. package/dist-embed-sighting-editor/{BeamEditor-CW7mTQjS.js → BeamEditor-B8qreA3j.js} +1 -1
  43. package/dist-embed-sighting-editor/{BeamSystem-CSfJjLCb.js → BeamSystem-D0hrju5J.js} +1 -1
  44. package/dist-embed-sighting-editor/{BirdEditor-BdxhCoW9.js → BirdEditor-BNzrfSqX.js} +1 -1
  45. package/dist-embed-sighting-editor/{BirdFlock-DCbrukNp.js → BirdFlock-iSovVEZd.js} +1 -1
  46. package/dist-embed-sighting-editor/{BodyEditor-DE8ZQrqe.js → BodyEditor-Bd_pKafG.js} +2 -2
  47. package/dist-embed-sighting-editor/{CaseElement-C46wM-nU.js → CaseElement-D80gHg4r.js} +3 -3
  48. package/dist-embed-sighting-editor/{CaseReportExport-UVrInf6H.js → CaseReportExport-Bv6FWPs2.js} +2 -2
  49. package/dist-embed-sighting-editor/{ContrailSystem-CDSSxouG.js → ContrailSystem-D3tXAg2r.js} +1 -1
  50. package/dist-embed-sighting-editor/{ControlPasses-CsOVa-jq.js → ControlPasses-CaVHMhEY.js} +1 -1
  51. package/dist-embed-sighting-editor/{CoverageAssessor-DWY_gJJX.js → CoverageAssessor-CTfHqAd_.js} +1 -1
  52. package/dist-embed-sighting-editor/{DroneEditor-DgeuaHdb.js → DroneEditor-BFsArPKi.js} +1 -1
  53. package/dist-embed-sighting-editor/{DroneFlight-CFztr-9j.js → DroneFlight-B96pVrY1.js} +1 -1
  54. package/dist-embed-sighting-editor/{DroneParameters-CHmDmRoC.js → DroneParameters-DW-enQUo.js} +1 -1
  55. package/dist-embed-sighting-editor/{Flightradar24Provider-e6_3o9Jf.js → Flightradar24Provider-CBGkjw03.js} +1 -1
  56. package/dist-embed-sighting-editor/GLTFLoader-CrRPu-Pt.js +1 -0
  57. package/dist-embed-sighting-editor/{GenerativeKitMessages-CmqG-T2c.js → GenerativeKitMessages-DmeZ_YZO.js} +1 -1
  58. package/dist-embed-sighting-editor/{GeoExportTexts-Wjc5YKlM.js → GeoExportTexts-Cp95Dg-h.js} +1 -1
  59. package/dist-embed-sighting-editor/{GeoJsonExport-BSPGzTbG.js → GeoJsonExport-CdadOwd2.js} +1 -1
  60. package/dist-embed-sighting-editor/{GeographicFigures-D_TfLkj9.js → GeographicFigures-Bo9rsT_L.js} +1 -1
  61. package/dist-embed-sighting-editor/{HeadlightSystem-DljWmzj5.js → HeadlightSystem-BmPfcHt1.js} +1 -1
  62. package/dist-embed-sighting-editor/{HynekAssessor-BCDwoOI9.js → HynekAssessor-nBidt6QV.js} +1 -1
  63. package/dist-embed-sighting-editor/InterviewEditorElement-CQWfYlGL.js +294 -0
  64. package/dist-embed-sighting-editor/{InterviewElement-DDa53uMq.js → InterviewElement-Ala811KB.js} +6 -2
  65. package/dist-embed-sighting-editor/InterviewMessages_en-BrnxG2rl.js +3 -0
  66. package/dist-embed-sighting-editor/InterviewMessages_es-Dxfjqrte.js +3 -0
  67. package/dist-embed-sighting-editor/InterviewMessages_fr-DIA-1qu8.js +3 -0
  68. package/dist-embed-sighting-editor/InterviewMessages_it-CYBEIKX-.js +3 -0
  69. package/dist-embed-sighting-editor/{KmlExport-B46AfaoJ.js → KmlExport-DIxM5Hpx.js} +1 -1
  70. package/dist-embed-sighting-editor/{LanternEditor-CkbeitJh.js → LanternEditor-CjQVFowY.js} +1 -1
  71. package/dist-embed-sighting-editor/{LaserBeam-Ber-PT8j.js → LaserBeam-BVc8Mvhr.js} +1 -1
  72. package/dist-embed-sighting-editor/{LaunchEditor-BsvHahqK.js → LaunchEditor-Cz8Mzo4a.js} +1 -1
  73. package/dist-embed-sighting-editor/{LaunchPlume-BmPMeGMN.js → LaunchPlume-CvBhTPgN.js} +1 -1
  74. package/dist-embed-sighting-editor/{LaunchSimulation-g-ETWhEH.js → LaunchSimulation-CkZIG-3P.js} +1 -1
  75. package/dist-embed-sighting-editor/{ModelSource-DOUnBBhu.js → ModelSource-B153oeTu.js} +1 -1
  76. package/dist-embed-sighting-editor/{ModelThumbnails-TwG1snwZ.js → ModelThumbnails-BUL_OLFv.js} +1 -1
  77. package/dist-embed-sighting-editor/{ModelViewer-Y_B6eM4z.js → ModelViewer-BzBLcY9s.js} +1 -1
  78. package/dist-embed-sighting-editor/{ModuleConformance-CO1S9pa3.js → ModuleConformance-CpMYkYgb.js} +2 -2
  79. package/dist-embed-sighting-editor/{ModuleSession-VLS0tjAb.js → ModuleSession-b_pmjUfP.js} +3 -3
  80. package/dist-embed-sighting-editor/ModuleThree-B_FZVqsf.js +1 -0
  81. package/dist-embed-sighting-editor/{ModulesPanelElement--YQ0QtcW.js → ModulesPanelElement-D0gn9Z-y.js} +3 -3
  82. package/dist-embed-sighting-editor/{NearestApproach-C_8Uvp6i.js → NearestApproach-Bxo_N7a9.js} +1 -1
  83. package/dist-embed-sighting-editor/PictureRegistration-D8fDZm4v.js +1 -0
  84. package/dist-embed-sighting-editor/{PoherAssessor-DtDcuhWK.js → PoherAssessor-CEVA26zd.js} +1 -1
  85. package/dist-embed-sighting-editor/{QuestionnaireFeed-CvLtuLIH.js → QuestionnaireFeed-B0j8W4JM.js} +1 -1
  86. package/dist-embed-sighting-editor/QuestionnaireForm-lzn9MPr2.js +1 -0
  87. package/dist-embed-sighting-editor/{QuestionnaireImport-BYj5QoJS.js → QuestionnaireImport-BmcxlQBq.js} +1 -1
  88. package/dist-embed-sighting-editor/RailwaySystem-Ceb0_MVz.js +41 -0
  89. package/dist-embed-sighting-editor/{ReentryEditor-CW8H7KaA.js → ReentryEditor-BWCK2g_s.js} +1 -1
  90. package/dist-embed-sighting-editor/{ReentrySimulation-DVl__RjO.js → ReentrySimulation-B09JXMu5.js} +1 -1
  91. package/dist-embed-sighting-editor/ReferenceSystem-B15kw0uH.js +1 -0
  92. package/dist-embed-sighting-editor/{RoadMarkings-DJraHdS6.js → RoadMarkings-Dl6zVQIx.js} +1 -1
  93. package/dist-embed-sighting-editor/ScenarioReadings-DyMshXS4.js +1 -0
  94. package/dist-embed-sighting-editor/{ScenarioSweep-Ddtuo_Af.js → ScenarioSweep-ByqOTfs2.js} +1 -1
  95. package/dist-embed-sighting-editor/{SceneNames_en-p5YNYZhA.js → SceneNames_en-c5zNw0Hi.js} +1 -1
  96. package/dist-embed-sighting-editor/{SceneNames_es-DlMqYLL9.js → SceneNames_es-CDjoBwy_.js} +1 -1
  97. package/dist-embed-sighting-editor/{SceneNames_fr-lFA7hY3x.js → SceneNames_fr-CoZNmFu3.js} +1 -1
  98. package/dist-embed-sighting-editor/{SceneNames_it-CDwvX1Nw.js → SceneNames_it-CVEahBpq.js} +1 -1
  99. package/dist-embed-sighting-editor/{SearchlightEditor-BSI8hB1V.js → SearchlightEditor-BpwPOhJ6.js} +1 -1
  100. package/dist-embed-sighting-editor/SearchlightSystem-D7sdsRYn.js +1 -0
  101. package/dist-embed-sighting-editor/{SightingElement-T0x4j9Zt.js → SightingElement-Bp-t_EAF.js} +3 -3
  102. package/dist-embed-sighting-editor/{SkyLantern-Dl4yl-lc.js → SkyLantern-D6bru_e_.js} +1 -1
  103. package/dist-embed-sighting-editor/{TraceSystem-Dbu_bgfE.js → TraceSystem-Bv4kLpie.js} +2 -2
  104. package/dist-embed-sighting-editor/{UfoMessages_en-BAuHAGgq.js → UfoMessages_en-DdCKc-Ez.js} +1 -1
  105. package/dist-embed-sighting-editor/{VideoButton-C8eRmv7A.js → VideoButton-CzJg9lBG.js} +1 -1
  106. package/dist-embed-sighting-editor/{WaterSystem-DpJCe_2Q.js → WaterSystem-Bbk_RJKg.js} +2 -2
  107. package/dist-embed-sighting-editor/geipan-qt-2025-B_RUiH8B.js +7 -0
  108. package/dist-embed-sighting-editor/{interviewImport-zzDGCbXd.js → interviewImport-D4P6e28u.js} +1 -1
  109. package/dist-embed-sighting-editor/{interviewJson-DngUPqK8.js → interviewJson-BJF9C-Rb.js} +1 -1
  110. package/dist-embed-sighting-editor/interviewSchema-r5bW7skq.js +1 -0
  111. package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +424 -397
  112. package/dist-embed-sighting-editor/{surroundingsSources-lvh4Rw5C.js → surroundingsSources-CqL7lcmF.js} +1 -1
  113. package/dist-embed-sighting-editor/{trafficRuntime-Drx7CE9H.js → trafficRuntime-Bu3my6S4.js} +2 -2
  114. package/dist-embed-ufoathome/{AdsbLolArchiveProvider-CqedGYi5.js → AdsbLolArchiveProvider-v1sSwhN1.js} +1 -1
  115. package/dist-embed-ufoathome/{Aurora-CpZx9hQ3.js → Aurora-Dc4u2vEw.js} +1 -1
  116. package/dist-embed-ufoathome/{AuroraEditor-D2v8sWVE.js → AuroraEditor-CeLzRDPj.js} +1 -1
  117. package/dist-embed-ufoathome/{AuroraSimulation-DdSP66LD.js → AuroraSimulation-BT1CdWX5.js} +7 -2
  118. package/dist-embed-ufoathome/{BallesterGuaspAssessor-C4IktJ1l.js → BallesterGuaspAssessor-CPW-Omah.js} +1 -1
  119. package/dist-embed-ufoathome/{BeamEditor-CuW3LVO-.js → BeamEditor-BS73mBZU.js} +1 -1
  120. package/dist-embed-ufoathome/{BeamSystem-BPEYuCF4.js → BeamSystem-C5EpRhij.js} +1 -1
  121. package/dist-embed-ufoathome/{BodyEditor-COMX-T65.js → BodyEditor-BV8WwzAj.js} +1 -1
  122. package/dist-embed-ufoathome/{CaseEditorElement-C5BHP8jT.js → CaseEditorElement-HR8RFluQ.js} +64 -62
  123. package/dist-embed-ufoathome/{CaseElement-CIZvyRVi.js → CaseElement-vCbCfGOv.js} +3 -3
  124. package/dist-embed-ufoathome/{CaseReportExport-BFbswUIB.js → CaseReportExport-XLbFCkPg.js} +3 -3
  125. package/dist-embed-ufoathome/{ColumnResize-Dh6Xyspd.js → ColumnResize-CEXrq3KB.js} +6 -6
  126. package/dist-embed-ufoathome/{ControlPasses-CnL1GmT-.js → ControlPasses-CKOU_3lG.js} +1 -1
  127. package/dist-embed-ufoathome/{CoverageAssessor-CiqUEJkN.js → CoverageAssessor-BYMf3Qhv.js} +1 -1
  128. package/dist-embed-ufoathome/{Flightradar24Provider-_tNmWf11.js → Flightradar24Provider-_QPbhh5s.js} +1 -1
  129. package/dist-embed-ufoathome/{GLTFLoader-BLk8prLt.js → GLTFLoader-DQeHB-Bk.js} +1 -1
  130. package/dist-embed-ufoathome/{GeoJsonExport-DkPKk-7q.js → GeoJsonExport-Pq_pPvjK.js} +1 -1
  131. package/dist-embed-ufoathome/{GeographicFigures-l-PfHdSR.js → GeographicFigures-KII55iXE.js} +1 -1
  132. package/dist-embed-ufoathome/{HynekAssessor-BhnvqsYz.js → HynekAssessor-wCDhgIB8.js} +1 -1
  133. package/dist-embed-ufoathome/InterviewAttachments-BP6Prvdu.js +1 -0
  134. package/dist-embed-ufoathome/InterviewEditorElement-BSwkegEp.js +294 -0
  135. package/dist-embed-ufoathome/{InterviewElement-CuRmQ0d3.js → InterviewElement-CfkDtybc.js} +6 -2
  136. package/dist-embed-ufoathome/InterviewMessages_en-BrnxG2rl.js +3 -0
  137. package/dist-embed-ufoathome/InterviewMessages_es-Dxfjqrte.js +3 -0
  138. package/dist-embed-ufoathome/InterviewMessages_fr-DIA-1qu8.js +3 -0
  139. package/dist-embed-ufoathome/InterviewMessages_it-CYBEIKX-.js +3 -0
  140. package/dist-embed-ufoathome/{KmlExport-BUl3gOrw.js → KmlExport-BMNwwys8.js} +1 -1
  141. package/dist-embed-ufoathome/{LaserBeam-C7glTvQN.js → LaserBeam-B-tlAzNB.js} +1 -1
  142. package/dist-embed-ufoathome/{LaunchEditor-DvudtAzp.js → LaunchEditor-Cy5D-gwU.js} +1 -1
  143. package/dist-embed-ufoathome/{LaunchPlume-CrDBzsQe.js → LaunchPlume-D-vSb8tJ.js} +1 -1
  144. package/dist-embed-ufoathome/{LaunchSimulation-DyOA4lPb.js → LaunchSimulation-CZ8Oba00.js} +1 -1
  145. package/dist-embed-ufoathome/{ModelSource-CoT4mxTx.js → ModelSource-HSiigkeO.js} +1 -1
  146. package/dist-embed-ufoathome/{ModelThumbnails-t59SZ3Vn.js → ModelThumbnails-DWvRMmj_.js} +1 -1
  147. package/dist-embed-ufoathome/{ModelViewer-DEdruEtl.js → ModelViewer-CM7qTW8F.js} +1 -1
  148. package/dist-embed-ufoathome/{ModulesPanelElement-N-ccpGxl.js → ModulesPanelElement-DsOa2zH0.js} +2 -2
  149. package/dist-embed-ufoathome/{NearestApproach-Do15yfeg.js → NearestApproach-PAsV5RlG.js} +1 -1
  150. package/dist-embed-ufoathome/{PoherAssessor-Cs8-ZBge.js → PoherAssessor-CniYlhUl.js} +1 -1
  151. package/dist-embed-ufoathome/QuestionnaireFeed-CpZqkxlt.js +1 -0
  152. package/dist-embed-ufoathome/QuestionnaireForm-LkllpNx-.js +1 -0
  153. package/dist-embed-ufoathome/{QuestionnaireImport-Cx1dQiha.js → QuestionnaireImport-CNROmkT2.js} +1 -1
  154. package/dist-embed-ufoathome/{ReentryEditor-CJUFkVFO.js → ReentryEditor-Qax1sT82.js} +1 -1
  155. package/dist-embed-ufoathome/{ReentrySimulation-B5QcdOTq.js → ReentrySimulation-CTeCaxZl.js} +1 -1
  156. package/dist-embed-ufoathome/{ReferenceSystem-DyzOUClN.js → ReferenceSystem-CM27OCUo.js} +1 -1
  157. package/dist-embed-ufoathome/ScenarioReadings-Is3HX0n0.js +1 -0
  158. package/dist-embed-ufoathome/ScenarioSweep-BbtX26Fi.js +1 -0
  159. package/dist-embed-ufoathome/{SearchlightEditor-CPDNpfNC.js → SearchlightEditor-PuLz84pp.js} +1 -1
  160. package/dist-embed-ufoathome/SearchlightSystem-B-tHvY1M.js +1 -0
  161. package/dist-embed-ufoathome/{ShareDialogElement-CBeU9ChH.js → ShareDialogElement-EzLob2Tz.js} +105 -80
  162. package/dist-embed-ufoathome/{SightingElement-BveOM4nF.js → SightingElement--qpGoyxL.js} +2 -2
  163. package/dist-embed-ufoathome/{TraceSystem-CoHX04R3.js → TraceSystem-8XQX03MS.js} +1 -1
  164. package/dist-embed-ufoathome/{VideoButton-DNQmWtfv.js → VideoButton-WNtEngz-.js} +1 -1
  165. package/dist-embed-ufoathome/geipan-qt-2025-B_RUiH8B.js +7 -0
  166. package/dist-embed-ufoathome/interviewSchema-r5bW7skq.js +1 -0
  167. package/dist-embed-ufoathome/rr0-ufoathome.mjs +4 -4
  168. package/dist-embed-ufoathome/{surroundingsSources-C823p3dG.js → surroundingsSources-UHKGesPa.js} +1 -1
  169. package/dist-embed-ufoathome/{trafficRuntime-DtXb9B2f.js → trafficRuntime-CgY_7-NH.js} +1 -1
  170. package/package.json +1 -1
  171. package/dist-embed-interview/InterviewMessages_en-BRmuWrAg.js +0 -1
  172. package/dist-embed-interview/InterviewMessages_es-BTotimwY.js +0 -1
  173. package/dist-embed-interview/InterviewMessages_fr-DBCdGB0r.js +0 -1
  174. package/dist-embed-interview/InterviewMessages_it-B5EyMD-k.js +0 -1
  175. package/dist-embed-scene/ModuleThree-BTQgimAj.js +0 -1
  176. package/dist-embed-scene/SearchlightSystem-CX1_nBkz.js +0 -1
  177. package/dist-embed-sighting/InterviewMessages_en-BRmuWrAg.js +0 -1
  178. package/dist-embed-sighting/InterviewMessages_es-BTotimwY.js +0 -1
  179. package/dist-embed-sighting/InterviewMessages_fr-DBCdGB0r.js +0 -1
  180. package/dist-embed-sighting/InterviewMessages_it-B5EyMD-k.js +0 -1
  181. package/dist-embed-sighting/SearchlightSystem-B2-MzG4x.js +0 -1
  182. package/dist-embed-sighting-editor/GLTFLoader-Df-r7_lf.js +0 -1
  183. package/dist-embed-sighting-editor/InterviewEditorElement-KHpgfy3k.js +0 -277
  184. package/dist-embed-sighting-editor/InterviewMessages_en-BRmuWrAg.js +0 -1
  185. package/dist-embed-sighting-editor/InterviewMessages_es-BTotimwY.js +0 -1
  186. package/dist-embed-sighting-editor/InterviewMessages_fr-DBCdGB0r.js +0 -1
  187. package/dist-embed-sighting-editor/InterviewMessages_it-B5EyMD-k.js +0 -1
  188. package/dist-embed-sighting-editor/ModuleThree-DQ2dT7XW.js +0 -1
  189. package/dist-embed-sighting-editor/PictureRegistration-Br0xjLE2.js +0 -1
  190. package/dist-embed-sighting-editor/QuestionnaireForm-DA6LPvBt.js +0 -1
  191. package/dist-embed-sighting-editor/RailwaySystem-eT-ZKfZl.js +0 -41
  192. package/dist-embed-sighting-editor/ReferenceSystem-DxVYO7g9.js +0 -1
  193. package/dist-embed-sighting-editor/ScenarioReadings-BYqlpLo8.js +0 -1
  194. package/dist-embed-sighting-editor/SearchlightSystem-DHfVi2np.js +0 -1
  195. package/dist-embed-sighting-editor/geipan-qt-2025-j-yGY7EN.js +0 -7
  196. package/dist-embed-sighting-editor/interviewSchema-DRWvRSL2.js +0 -1
  197. package/dist-embed-ufoathome/InterviewEditorElement-iw2lnwx8.js +0 -277
  198. package/dist-embed-ufoathome/InterviewMessages_en-BRmuWrAg.js +0 -1
  199. package/dist-embed-ufoathome/InterviewMessages_es-BTotimwY.js +0 -1
  200. package/dist-embed-ufoathome/InterviewMessages_fr-DBCdGB0r.js +0 -1
  201. package/dist-embed-ufoathome/InterviewMessages_it-B5EyMD-k.js +0 -1
  202. package/dist-embed-ufoathome/QuestionnaireFeed-BfvRSPoo.js +0 -1
  203. package/dist-embed-ufoathome/QuestionnaireForm-ByFmq67M.js +0 -1
  204. package/dist-embed-ufoathome/ScenarioReadings-CfZehU_P.js +0 -1
  205. package/dist-embed-ufoathome/ScenarioSweep-CDumnmq2.js +0 -1
  206. package/dist-embed-ufoathome/SearchlightSystem-Ca0rZcXv.js +0 -1
  207. package/dist-embed-ufoathome/geipan-qt-2025-j-yGY7EN.js +0 -7
  208. package/dist-embed-ufoathome/interviewSchema-DRWvRSL2.js +0 -1
@@ -1,41 +0,0 @@
1
- import{a$ as F,b4 as P,bB as H,u as K,bk as w,bl as N,b2 as U,c3 as k}from"./rr0-sighting-editor.mjs";class D{static HOLLOW_M=1;static COVERED_M=3;static WINDOW_M=30;static SAMPLE_M=4;static MAX_GRADE={rail:.025,highSpeed:.035,subway:.04,light_rail:.06,tram:.08,funicular:1/0};static heights(t,s,e){const n=t.map(a=>a.level===0),o=t.map((a,i)=>n[i]?D.targets(a,s,e):[]),c=t.map((a,i)=>n[i]?D.samples(a,o[i]):[]),r=new Map;t.forEach((a,i)=>{if(n[i])for(const h of D.ends(a)){const u=D.key(h),p=r.get(u);p?p.push(i):r.set(u,[i])}});const M=a=>{const i=r.get(D.key(a));if(i)return D.median(i.flatMap(h=>c[h]),a)};return t.map((a,i)=>{if(n[i]){const h=[...new Set([i,...D.ends(a).flatMap(d=>r.get(D.key(d))??[])])].flatMap(d=>c[d]),u=a.centre.map((d,O)=>D.median(h,d)??o[i][O]),[p,A]=D.ends(a);return u[0]=M(p)??u[0],u[u.length-1]=M(A)??u[u.length-1],D.graded(u,a.along,a.highSpeed?D.MAX_GRADE.highSpeed:D.MAX_GRADE[a.kind])}return D.carried(a,s,e,M)})}static targets(t,s,e){return t.centre.map(n=>{const o=s(n.x,n.z);if(e===void 0||n.altitudeM===void 0)return o;const c=n.altitudeM+e;return c-o>D.HOLLOW_M||o-c>D.COVERED_M?c:o})}static samples(t,s){const e=[];let n=0;return t.centre.forEach((o,c)=>{t.along[c]+1e-6<n&&c<t.centre.length-1||(e.push({x:o.x,z:o.z,y:s[c]}),n=t.along[c]+D.SAMPLE_M)}),e}static median(t,s){const e=[];for(const o of t)Math.hypot(o.x-s.x,o.z-s.z)<=D.WINDOW_M&&e.push(o.y);if(e.length===0)return;e.sort((o,c)=>o-c);const n=e.length>>1;return e.length%2===1?e[n]:(e[n-1]+e[n])/2}static graded(t,s,e){if(!Number.isFinite(e)||t.length<3)return t;const n=[...t],o=n.length-1,c=s[o];if(Math.abs(n[o]-n[0])>e*c)return s.map(r=>n[0]+(n[o]-n[0])*r/c);for(let r=1;r<o;r++){const M=e*(s[r]-s[r-1]);n[r]=Math.min(n[r-1]+M,Math.max(n[r-1]-M,n[r]))}for(let r=o-1;r>0;r--){const M=e*(s[r+1]-s[r]);n[r]=Math.min(n[r+1]+M,Math.max(n[r+1]-M,n[r]))}return n}static carried(t,s,e,n){const[o,c]=D.ends(t),r=t.along[t.along.length-1],M=n(o),a=n(c);if(e!==void 0&&t.centre.every(u=>u.altitudeM!==void 0)){const u=t.centre.map(d=>d.altitudeM+e),p=M!==void 0?M-u[0]:0,A=a!==void 0?a-u[u.length-1]:0;return u.map((d,O)=>d+p+(A-p)*t.along[O]/r)}const i=M??s(o.x,o.z),h=a??s(c.x,c.z);return t.along.map(u=>i+(h-i)*u/r)}static ends(t){return[t.centre[0],t.centre[t.centre.length-1]]}static key(t){return`${Math.round(t.x*2)},${Math.round(t.z*2)}`}}class B{positions=[];indices=[];along=[];get vertexCount(){return this.positions.length/3}strip(t,s,e){const n=this.vertexCount;for(let o=0;o<t.length;o++)this.positions.push(t[o].x,t[o].y,t[o].z,s[o].x,s[o].y,s[o].z),e&&this.along.push(e[o],e[o]);for(let o=0;o<t.length-1;o++){const c=n+o*2;this.indices.push(c,c+2,c+1,c+1,c+2,c+3)}}beam(t,s,e,n=!0){const o=s.x-t.x,c=s.y-t.y,r=s.z-t.z,M=Math.hypot(o,c,r);if(M<1e-6)return;const a={x:o/M,y:c/M,z:r/M},i=Math.abs(a.y)>.9?{x:1,y:0,z:0}:{x:0,y:1,z:0},h=a.y*i.z-a.z*i.y,u=a.z*i.x-a.x*i.z,p=a.x*i.y-a.y*i.x,A=Math.hypot(h,u,p),d={x:h/A*e/2,y:u/A*e/2,z:p/A*e/2},O={x:a.y*d.z-a.z*d.y,y:a.z*d.x-a.x*d.z,z:a.x*d.y-a.y*d.x},g=(f,x,E)=>({x:f.x+d.x*x+O.x*E,y:f.y+d.y*x+O.y*E,z:f.z+d.z*x+O.z*E}),_=[[1,1],[-1,1],[-1,-1],[1,-1]];for(let f=0;f<4;f++){const[x,E]=_[f],[z,v]=_[(f+1)%4];this.quad(g(t,x,E),g(t,z,v),g(s,z,v),g(s,x,E))}n&&(this.quad(...[..._].reverse().map(([f,x])=>g(t,f,x))),this.quad(..._.map(([f,x])=>g(s,f,x))))}quad(t,s,e,n){const o=this.vertexCount;this.positions.push(t.x,t.y,t.z,s.x,s.y,s.z,e.x,e.y,e.z,n.x,n.y,n.z),this.indices.push(o,o+1,o+2,o,o+2,o+3)}}class l{static STEP_M=6;static BALLAST_HEIGHT_M=.5;static BALLAST_SLOPE=1.5;static BALLAST_SHOULDER_M=.45;static DECK_DEPTH_M=.8;static BANK_SLOPE=1.5;static SLEEPER_LENGTH_M=2.4;static SLEEPER_WIDTH_M=.29;static SLEEPER_SPACING_M=.6;static RAIL_HEAD_M=.072;static RAIL_HEIGHT_M=.18;static TRAM_RAIL_HEIGHT_M=.03;static LIFT_M=.06;static CATENARY={rail:{contactM:5.5,systemM:1.4,spanM:54,staggerM:.2},highSpeed:{contactM:5.08,systemM:1.4,spanM:63,staggerM:.2},service:{contactM:5.5,systemM:1.2,spanM:45,staggerM:.2},tram:{contactM:6,systemM:0,spanM:30,staggerM:.2}};static MESSENGER_SAG_M=.55;static MAST_SIDE_M=.26;static MAST_OFFSET_M=3.1;static MAST_ABOVE_M=.6;static CONTACT_DIAMETER_M=.012;static MESSENGER_DIAMETER_M=.011;static ARM_SIDE_M=.06;static TRACK_SPACING_M={rail:3.7,highSpeed:4.5,tram:3.1,subway:3.4,light_rail:3.4,funicular:3.2};static BALLAST_ALBEDO=[.17,.16,.15];static BANK_ALBEDO=[.085,.09,.05];static DECK_ALBEDO=[.26,.255,.24];static CONCRETE_ALBEDO=[.36,.35,.33];static WOOD_ALBEDO=[.07,.055,.045];static RUST_ALBEDO=[.085,.068,.058];static STEEL_ALBEDO=[.3,.31,.32];static COPPER_ALBEDO=[.09,.085,.07];static LINE_REACH_M=20;group=new F;stepM=l.STEP_M;drawn=0;laid=[];ballastMaterial=l.pebbled(l.lambert(l.BALLAST_ALBEDO,!0));earthMaterial=l.lambert(l.BANK_ALBEDO,!0);deckMaterial=l.lambert(l.DECK_ALBEDO,!1);concreteSleepers=l.sleeperMaterial(l.CONCRETE_ALBEDO);woodSleepers=l.sleeperMaterial(l.WOOD_ALBEDO);rustMaterial=l.lambert(l.RUST_ALBEDO,!0);headMaterial=new P({color:new H(.62,.62,.62),metalness:1,roughness:.28,polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-2});steelMaterial=l.lambert(l.STEEL_ALBEDO,!1);wireMaterial=l.lambert(l.COPPER_ALBEDO,!1);constructor(){this.group.name="railways"}get count(){return this.drawn}setGroundSpacing(t){this.stepM=Number.isFinite(t)&&t>0?Math.min(l.STEP_M,Math.max(1.5,t/2)):l.STEP_M}set(t,s,e,n,o=1/0){this.clear();const r=t.map(p=>({line:p,path:p.points.map(A=>({...K(A.lat,A.lng,s,e),altitudeM:A.altitudeM}))})).filter(({line:p,path:A})=>p.level>=0&&l.within(A,o)),M=l.altitudeOffset(r,n),a=r.flatMap(({line:p,path:A})=>{const d=this.layoutOf(p,A);return d?[{line:p,layout:d}]:[]}),i=D.heights(a.map(({layout:p})=>p),n,M),h={ballast:new B,earth:new B,deck:new B,concrete:new B,wood:new B,rust:new B,head:new B,steel:new B,wire:new B};a.forEach(({line:p,layout:A},d)=>{this.lay(p,{...A,y:i[d]},n,h),this.laid.push({line:p,centre:A.centre}),this.drawn++});const u=[[h.ballast,this.ballastMaterial,"ballast",!1],[h.earth,this.earthMaterial,"embankments",!1],[h.deck,this.deckMaterial,"decks",!0],[h.concrete,this.concreteSleepers,"sleepers",!1],[h.wood,this.woodSleepers,"sleepers wood",!1],[h.rust,this.rustMaterial,"rails",!1],[h.head,this.headMaterial,"rail heads",!1],[h.steel,this.steelMaterial,"catenary masts",!0],[h.wire,this.wireMaterial,"catenary wires",!1]];for(const[p,A,d,O]of u){const g=l.meshOf(p,A);g&&(g.name=`railways ${d}`,g.castShadow=O,g.receiveShadow=!0,this.group.add(g))}}clear(){for(const t of[...this.group.children])this.group.remove(t),t.geometry?.dispose();this.drawn=0,this.laid=[]}lineAt(t,s){let e;for(const{line:n,centre:o}of this.laid)for(let c=0;c<o.length-1;c++){const r=o[c],M=o[c+1],a=M.x-r.x,i=M.z-r.z,h=a*a+i*i,u=h===0?0:Math.max(0,Math.min(1,((t-r.x)*a+(s-r.z)*i)/h)),p=Math.hypot(t-(r.x+a*u),s-(r.z+i*u));p<=l.LINE_REACH_M&&(!e||p<e.distance)&&(e={line:n,distance:p})}return e?.line}mayMeet(t,s,e,n){const o=Math.hypot(s.x,s.z);if(o<1e-6)return this.lineAt(t.x,t.z)!==void 0;const c=s.x/o,r=s.z/o,M=l.LINE_REACH_M;for(const{centre:a}of this.laid)for(let i=0;i<a.length-1;i++){const h=a[i],u=a[i+1];for(const p of[0,.5,1]){const A=h.x+(u.x-h.x)*p,d=h.z+(u.z-h.z)*p,O=(A-t.x)*c+(d-t.z)*r;if(O<0)continue;const g=Math.abs((A-t.x)*r-(d-t.z)*c),_=Math.hypot(u.x-h.x,u.z-h.z)/2;if(g>M+_)continue;if(t.y+s.y*(O/o)<=e(A,d)+n)return!0}}return!1}contactHeightM(t){if(!(t.electrification!=="overhead"||t.kind==="subway"||t.kind==="funicular"))return l.catenaryOf(t).contactM}static catenaryOf(t){return t.kind==="tram"?l.CATENARY.tram:t.highSpeed?l.CATENARY.highSpeed:t.service?l.CATENARY.service:l.CATENARY.rail}dispose(){this.clear();for(const t of[this.ballastMaterial,this.earthMaterial,this.deckMaterial,this.concreteSleepers,this.woodSleepers,this.rustMaterial,this.headMaterial,this.steelMaterial,this.wireMaterial])t.dispose()}static within(t,s){if(!Number.isFinite(s))return!0;const e=s*1.1+100;return t.some((n,o)=>Math.hypot(n.x,n.z)<=e||o>0&&Math.hypot((n.x+t[o-1].x)/2,(n.z+t[o-1].z)/2)<=e)}static altitudeOffset(t,s){const e=[];for(const{line:n,path:o}of t)if(n.level===0)for(const c of o)c.altitudeM!==void 0&&e.push(s(c.x,c.z)-c.altitudeM);if(!(e.length<5))return e.sort((n,o)=>n-o),e[Math.floor(e.length/2)]}layoutOf(t,s){const e=[];for(let c=0;c<s.length-1;c++){const r=s[c],M=s[c+1],a=Math.max(1,Math.ceil(Math.hypot(M.x-r.x,M.z-r.z)/this.stepM));for(let i=0;i<a;i++){const h=i/a,u=r.altitudeM!==void 0&&M.altitudeM!==void 0?r.altitudeM+(M.altitudeM-r.altitudeM)*h:void 0;e.push({x:r.x+(M.x-r.x)*h,z:r.z+(M.z-r.z)*h,altitudeM:u})}}if(e.push(s[s.length-1]),e.length<2)return;const n=[0];for(let c=1;c<e.length;c++)n.push(n[c-1]+Math.hypot(e[c].x-e[c-1].x,e[c].z-e[c-1].z));if(n[n.length-1]<.5)return;const o=e.map((c,r)=>{const M=e[Math.max(0,r-1)],a=e[Math.min(e.length-1,r+1)],i=a.x-M.x,h=a.z-M.z,u=Math.hypot(i,h);return u<1e-6?{x:1,z:0}:{x:i/u,z:h/u}});return{kind:t.kind,...t.highSpeed?{highSpeed:!0}:{},level:t.level,centre:e,along:n,dir:o}}lay(t,s,e,n){const o=t.highSpeed?l.TRACK_SPACING_M.highSpeed:l.TRACK_SPACING_M[t.kind],c=Math.min(8,Math.max(1,t.tracks)),r=Array.from({length:c},(g,_)=>(_-(c-1)/2)*o),M=t.kind==="tram",a=M?0:l.BALLAST_HEIGHT_M,i=l.LIFT_M,h=(g,_,f)=>({x:s.centre[g].x-s.dir[g].z*_,y:s.y[g]+f,z:s.centre[g].z+s.dir[g].x*_}),u=s.centre.map((g,_)=>_);if(!M){const g=l.SLEEPER_LENGTH_M/2+l.BALLAST_SHOULDER_M+(r[r.length-1]??0),_=u.map(x=>h(x,g,a+i)),f=u.map(x=>h(x,-g,a+i));if(n.ballast.strip(_,f),t.level===0){const x=g+a*l.BALLAST_SLOPE;for(const E of[1,-1]){const z=[],v=[];let m=!1;for(const L of u){const C=h(L,E*x,i),S=e(C.x,C.z)+i,T=C.y-S;T<0&&(C.y=Math.min(S,s.y[L]+a-.05+i)),z.push(C);const I=h(L,E*(x+Math.max(0,T)*l.BANK_SLOPE),i);I.y=Math.min(e(I.x,I.z)+i,C.y),C.y-I.y>.02&&(m=!0),v.push(I)}const b=E>0?_:f;E>0?n.ballast.strip(z,b):n.ballast.strip(b,z),m&&(E>0?n.earth.strip(v,z):n.earth.strip(z,v))}}else{const x=-l.DECK_DEPTH_M,E=g+.15,z=u.map(L=>h(L,E,a+i+.1)),v=u.map(L=>h(L,-E,a+i+.1)),m=u.map(L=>h(L,E,x)),b=u.map(L=>h(L,-E,x));n.deck.strip(m,z),n.deck.strip(v,b),n.deck.strip(b,m),n.deck.strip(z,u.map(L=>h(L,g,a+i+.1))),n.deck.strip(u.map(L=>h(L,-g,a+i+.1)),v)}}const p=t.service?n.wood:n.concrete,A=t.gaugeMm/2e3+l.RAIL_HEAD_M/2,d=M?l.TRAM_RAIL_HEIGHT_M:l.RAIL_HEIGHT_M,O=a+i;for(const g of r){if(!M){const _=l.SLEEPER_LENGTH_M/2;p.strip(u.map(f=>h(f,g+_,O+.004)),u.map(f=>h(f,g-_,O+.004)),s.along)}for(const _ of[1,-1]){const f=g+_*A,x=l.RAIL_HEAD_M/2,E=u.map(v=>h(v,f+x,O+d)),z=u.map(v=>h(v,f-x,O+d));n.head.strip(E,z),n.rust.strip(u.map(v=>h(v,f+x,O)),E),n.rust.strip(z,u.map(v=>h(v,f-x,O)))}}t.electrification==="overhead"&&t.kind!=="subway"&&t.kind!=="funicular"&&this.catenary(t,s,r,O+d,h,e,n)}catenary(t,s,e,n,o,c,r){const M=l.catenaryOf(t),a=s.along[s.along.length-1],i=Math.max(1,Math.round(a/M.spanM)),h=a/i,u=Array.from({length:i},(E,z)=>(z+.5)*h),p=n+M.contactM,A=p+M.systemM,d=(M.systemM>0?A:p)+l.MAST_ABOVE_M,O=e[e.length-1],g=e.length>2,_=e.length===1?[1]:[1,-1],f=(E,z,v)=>{let m=0,b=s.along.length-2;for(;m<b;){const T=m+b+1>>1;s.along[T]<=E?m=T:b=T-1}const L=Math.min(1,Math.max(0,(E-s.along[m])/Math.max(1e-6,s.along[m+1]-s.along[m]))),C=o(m,z,v),S=o(m+1,z,v);return{x:C.x+(S.x-C.x)*L,y:C.y+(S.y-C.y)*L,z:C.z+(S.z-C.z)*L}};for(const E of u){const z=f(E,0,p);if(!(t.level===0&&c(z.x,z.z)>z.y)){for(const v of _){const m=v*(O+l.MAST_OFFSET_M),b=f(E,m,0);t.level===0&&(b.y=Math.min(b.y,c(b.x,b.z)));const L=f(E,m,d);if(r.steel.beam(b,L,l.MAST_SIDE_M),g)continue;const S=(_.length===1?e[0]:v*O)-v*.6,T=M.systemM>0?A:p+.3;r.steel.beam(f(E,m,T),f(E,S,T),l.ARM_SIDE_M),r.steel.beam(f(E,m,p-.4),f(E,S,T),l.ARM_SIDE_M)}if(g){const v=O+l.MAST_OFFSET_M;r.steel.beam(f(E,v,d-.2),f(E,-v,d-.2),l.MAST_SIDE_M*.8)}}}const x=[0,...u,a];for(const[E,z]of e.entries()){const v=m=>m===0||m===x.length-1?0:((m+E)%2===0?1:-1)*M.staggerM;for(let m=0;m<x.length-1;m++){const b=x[m],L=x[m+1];if(L-b<.1||(r.wire.beam(f(b,z+v(m),p),f(L,z+v(m+1),p),l.CONTACT_DIAMETER_M,!1),M.systemM<=0))continue;const C=4,S=T=>{const I=m===0?.5+T/2:m===x.length-2?T/2:T;return A-l.MESSENGER_SAG_M*4*I*(1-I)};for(let T=0;T<C;T++){const I=T/C,G=(T+1)/C;r.wire.beam(f(b+(L-b)*I,z,S(I)),f(b+(L-b)*G,z,S(G)),l.MESSENGER_DIAMETER_M,!1)}}}}static meshOf(t,s){if(t.indices.length===0)return;const e=new w;return e.setAttribute("position",new N(new Float32Array(t.positions),3)),t.along.length>0&&e.setAttribute("aAlong",new N(new Float32Array(t.along),1)),e.setIndex(new N(new Uint32Array(t.indices),1)),e.computeVertexNormals(),new U(e,s)}static lambert(t,s){return new k({color:new H(...t),...s?{polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-2}:{}})}static pebbled(t){return t.onBeforeCompile=s=>{s.vertexShader=s.vertexShader.replace("#include <common>",`#include <common>
2
- varying vec3 vBallast;`).replace("#include <begin_vertex>",`#include <begin_vertex>
3
- vBallast = position;`),s.fragmentShader=s.fragmentShader.replace("#include <common>",`#include <common>
4
- varying vec3 vBallast;
5
- float ballastHash(vec2 p) {
6
- p = fract(p * vec2(127.1, 311.7));
7
- p += dot(p, p + 34.5);
8
- return fract(p.x * p.y);
9
- }
10
- float ballastNoise(vec2 p) {
11
- vec2 i = floor(p);
12
- vec2 f = fract(p);
13
- f = f * f * (3.0 - 2.0 * f);
14
- return mix(mix(ballastHash(i), ballastHash(i + vec2(1.0, 0.0)), f.x), mix(ballastHash(i + vec2(0.0, 1.0)), ballastHash(i + vec2(1.0, 1.0)), f.x), f.y);
15
- }`).replace("#include <map_fragment>",`#include <map_fragment>
16
- {
17
- float eye = length(vViewPosition);
18
- vec2 at = vBallast.xz + vec2(0.0, vBallast.y);
19
- float stones = (ballastHash(floor(at * 22.0)) - 0.5) * 0.9 * (1.0 - smoothstep(4.0, 18.0, eye))
20
- + (ballastNoise(at * 6.0) - 0.5) * 0.5 * (1.0 - smoothstep(15.0, 60.0, eye))
21
- + (ballastNoise(at * 0.7) - 0.5) * 0.35 * (1.0 - smoothstep(80.0, 300.0, eye));
22
- diffuseColor.rgb *= 1.0 + stones;
23
- }`)},t.customProgramCacheKey=()=>"rr0-railway-ballast",t}static sleeperMaterial(t){const s=new k({color:new H(1,1,1),polygonOffset:!0,polygonOffsetFactor:-3,polygonOffsetUnits:-3}),e=new H(...t),n=new H(...l.BALLAST_ALBEDO);return s.onBeforeCompile=o=>{o.uniforms.uSleeper={value:e},o.uniforms.uCrib={value:n},o.uniforms.uSpacing={value:l.SLEEPER_SPACING_M},o.uniforms.uDuty={value:l.SLEEPER_WIDTH_M/l.SLEEPER_SPACING_M},o.vertexShader=o.vertexShader.replace("#include <common>",`#include <common>
24
- attribute float aAlong;
25
- varying float vAlong;`).replace("#include <begin_vertex>",`#include <begin_vertex>
26
- vAlong = aAlong;`),o.fragmentShader=o.fragmentShader.replace("#include <common>",`#include <common>
27
- varying float vAlong;
28
- uniform vec3 uSleeper;
29
- uniform vec3 uCrib;
30
- uniform float uSpacing;
31
- uniform float uDuty;
32
- // How much of [0, x] periods is sleeper: the integral of a pulse of width uDuty at the start of each period.
33
- float sleeperIntegral(float x) {
34
- return floor(x) * uDuty + min(fract(x), uDuty);
35
- }`).replace("#include <map_fragment>",`#include <map_fragment>
36
- {
37
- float u = vAlong / uSpacing;
38
- float w = max(fwidth(u), 1e-4);
39
- float cover = (sleeperIntegral(u + 0.5 * w) - sleeperIntegral(u - 0.5 * w)) / w;
40
- diffuseColor.rgb *= mix(uCrib, uSleeper, clamp(cover, 0.0, 1.0));
41
- }`)},s.customProgramCacheKey=()=>"rr0-railway-sleepers",s}}export{l as RailwaySystem};
@@ -1 +0,0 @@
1
- import{u as w,cp as M,Z as y,cq as d,cr as k,cs as g,c0 as l,ct as b,b2 as O,bm as T,bL as E,bN as I,cu as D,X as x}from"./rr0-sighting-editor.mjs";import{P as m,a as f}from"./PictureFetch-C3wgf1ZV.js";const v=M.reference,u=800,c=Math.PI/180;class r{constructor(t,i,s=r.fetchImage,e=r.openVideo){this.scene=t,this.onImageLoaded=i,this.loadImage=s,this.loadVideo=e}meshes=new Map;signatures=new Map;images=new Map;loading=new Map;failed=new Map;references=[];views=new Map;shown=!0;observerAt;clock={t:0,playing:!1,timeScale:1};static PRESENT_WITHIN_M=2;static GONE_BEYOND_M=20;static presenceAt(t,i){if(!t.from||!i)return 1;const s=w(i.lat,i.lng,t.from.lat,t.from.lng),a=(Math.hypot(s.x,s.z)-r.PRESENT_WITHIN_M)/(r.GONE_BEYOND_M-r.PRESENT_WITHIN_M),o=Math.min(Math.max(a,0),1);return 1-o*o*(3-2*o)}set(t,i=this.views,s){this.references=t,this.observerAt=s,this.views=i;const e=new Set(t.map(a=>a.id));for(const[a,o]of this.meshes)e.has(a)||(this.dispose(o),this.meshes.delete(a),this.signatures.delete(a));for(const[a,o]of this.images){const n=t.find(p=>p.id===a);if(n&&n.src===o.texture.userData.src&&n.kind==="video"==(o.video!==void 0))continue;r.release(o),this.images.delete(a);const h=this.meshes.get(a);h&&(this.dispose(h),this.meshes.delete(a),this.signatures.delete(a))}for(const a of t){const o=this.images.get(a.id);if(!o){this.load(a);continue}this.build(a,o)}this.follow()}setTime(t){this.clock=t,this.follow()}setShown(t){this.shown=t;for(const i of this.meshes.values())i.visible=t&&this.opacityOf(i.userData.id)>0}setView(t,i){this.views.set(t,i);const s=this.meshes.get(t);s&&this.applyOpacity(s,t)}layer=v;get any(){for(const t of this.meshes.values())if(t.visible)return!0;return!1}place(t){const i=this.held;i&&t.getWorldQuaternion(this.cameraTurn);for(const s of this.meshes.values()){if(!s.visible)continue;s.position.copy(t.position);const e=i?.get(s);e&&s.quaternion.copy(this.cameraTurn).multiply(e),s.updateMatrixWorld()}}hold(t){t.getWorldQuaternion(this.cameraTurn);const i=this.cameraTurn.clone().invert();this.held=new Map([...this.meshes.values()].map(s=>[s,i.clone().multiply(s.quaternion)])),this.registered=new Map([...this.meshes.values()].map(s=>[s,s.quaternion.clone()]))}release(){if(this.held){for(const[t,i]of this.registered??[])t.quaternion.copy(i);this.held=void 0,this.registered=void 0}}registered;held;cameraTurn=new y;get furthestM(){return this.meshes.size>0?u:0}directionOfPixel(t,i,s,e){const a=this.images.get(t.id),o=a?a.width/a.height:1,n=d.registrationAt(t,this.clock.t),h=Math.tan(n.fovDeg/2*c),p=h*o;return e.set((i*2-1)*p,(1-s*2)*h,-1).normalize(),e.applyQuaternion(r.orientation(n))}aspectOf(t){const i=this.images.get(t);return i?i.width/i.height:void 0}failureOf(t){return this.failed.get(t)}follow(){for(const t of this.references){const i=this.meshes.get(t.id),s=this.images.get(t.id)?.video;s&&this.sync(t,s),i&&(t.registrationTrack?.length&&r.point(i,t,d.registrationAt(t,this.clock.t)),t.kind==="video"&&this.applyOpacity(i,t.id))}}sync(t,i){const s=d.mediaSecondsAt(t,this.clock.t,this.clock.timeScale,Number.isFinite(i.duration)?i.duration:void 0);if(s===void 0){i.paused||i.pause();return}const e=d.command(i.currentTime,s,this.clock.playing,d.rateOf(t));i.playbackRate=e.rate,e.seekS!==void 0&&!i.seeking&&(i.currentTime=e.seekS),e.play&&i.paused&&i.play().catch(()=>{}),!e.play&&!i.paused&&i.pause()}load(t){const i=t.src;if(this.loading.has(t.id)||this.failed.has(i))return;const s=t.kind==="video",a=(s?this.loadVideo(i,()=>this.onVideoFrame()):this.loadImage(i)).then(o=>{this.loading.delete(t.id);const n=this.references.find(h=>h.id===t.id);if(!n||n.src!==i||n.kind==="video"!==s){r.release(o);return}o.texture.userData.src=i,this.images.set(t.id,o),this.build(n,o),this.follow(),this.onImageLoaded()},o=>{this.loading.delete(t.id),this.failed.set(i,m.failureOf(o)),this.onImageLoaded()});this.loading.set(t.id,a)}onVideoFrame(){this.follow(),this.onFrame?.()}onFrame;static openVideo(t,i){return new Promise((s,e)=>{const a=document.createElement("video");a.crossOrigin="anonymous",a.muted=!0,a.playsInline=!0,a.preload="auto",a.addEventListener("loadeddata",()=>{const o=new k(a);o.colorSpace=g,o.minFilter=l,o.magFilter=l,o.generateMipmaps=!1,a.addEventListener("seeked",i);const n=()=>{a.paused&&i(),a.src&&a.requestVideoFrameCallback(n)};"requestVideoFrameCallback"in a&&a.requestVideoFrameCallback(n),s({texture:o,width:a.videoWidth,height:a.videoHeight,video:a})},{once:!0}),a.addEventListener("error",()=>{m.whyVideoUnread(t).then(o=>e(new f(t,o)))},{once:!0}),a.src=t})}static release(t){t.texture.dispose();const i=t.video;i&&(i.pause(),i.removeAttribute?.("src"),i.load?.())}static async fetchImage(t){const i=await m.blob(t),s=await createImageBitmap(i,{imageOrientation:"flipY"}).catch(()=>{throw new f(t,{kind:"notPicture"})}),e=new b(s);return e.flipY=!1,e.colorSpace=g,e.minFilter=l,e.magFilter=l,e.generateMipmaps=!1,e.needsUpdate=!0,{texture:e,width:s.width,height:s.height}}build(t,i){const s=r.signatureOf(t,i);let e=this.meshes.get(t.id);if(e&&this.signatures.get(t.id)===s){this.applyOpacity(e,t.id);return}e&&(this.dispose(e),this.meshes.delete(t.id)),e=new O(r.geometryOf(t,i),new T({map:i.texture,transparent:!0,depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1})),t.kind==="panorama"&&(e.material.side=E),e.frustumCulled=!1,e.layers.set(v),e.userData.id=t.id,r.point(e,t,d.registrationAt(t,this.clock.t)),this.scene.add(e),this.meshes.set(t.id,e),this.signatures.set(t.id,s),this.applyOpacity(e,t.id)}static geometryOf(t,i){if(t.kind==="panorama"){const o=new I(u,64,32,Math.PI/2,Math.PI*2),n=o.attributes.uv;for(let h=0;h<n.count;h++)n.setX(h,1-n.getX(h));return n.needsUpdate=!0,o}const s=2*u*Math.tan(t.registration.fovDeg/2*c),e=s*(i.width/Math.max(i.height,1)),a=new D(e,s);return a.translate(0,0,-u),a}static orientation({headingDeg:t,pitchDeg:i,rollDeg:s}){const e=new x;return e.rotation.set(i*c,-t*c,-(s??0)*c,"YXZ"),e.quaternion}static point(t,i,s){if(t.quaternion.copy(r.orientation(s)),i.kind==="panorama")return;const e=Math.tan(s.fovDeg/2*c)/Math.tan(i.registration.fovDeg/2*c);t.scale.set(e,e,1)}inTime(t){if(t.kind!=="video")return!0;const i=this.images.get(t.id)?.video?.duration;return d.mediaSecondsAt(t,this.clock.t,this.clock.timeScale,i!==void 0&&Number.isFinite(i)?i:void 0)!==void 0}opacityOf(t){const i=this.references.find(a=>a.id===t);if(i&&!this.inTime(i))return 0;const s=this.views.get(t),e=i?r.presenceAt(i,this.observerAt):1;return(s?.opacity??i?.opacity??0)*e}applyOpacity(t,i){const s=this.opacityOf(i);t.material.opacity=s,t.visible=this.shown&&s>0}static signatureOf(t,i){const{headingDeg:s,pitchDeg:e,rollDeg:a,fovDeg:o}=t.registration;return[t.kind,t.src,i.width,i.height,s,e,a??0,o].join("|")}dispose(t){this.scene.remove(t),t.geometry.dispose(),t.material.dispose()}disposeAll(){for(const t of this.meshes.values())this.dispose(t);this.meshes.clear(),this.signatures.clear();for(const t of this.images.values())r.release(t);this.images.clear()}}export{v as REFERENCE_LAYER,r as ReferenceSystem};
@@ -1 +0,0 @@
1
- import{P as y,k,m as p}from"./rr0-sighting-editor.mjs";import{ScenarioSweep as j}from"./ScenarioSweep-Ddtuo_Af.js";import"./SatellitePasses-Pfro2-0Z.js";class b{static fileName(c,o){const e=c.replace(/\.json$/,""),d=o.placeId.replace(/[^A-Za-z0-9-]+/g,"-"),u=o.local.replace(/[-:]/g,"").replace("T","-");return`${e}-scenario-${d}-${u}.json`}static recording(c,o,e,d,u,a={}){const n=structuredClone(c),r=y.strip(c).recording,l=n.interpretation;if(!l||!r.interpretation)throw new Error(`${o} states no interpretation`);n.id=`${r.id??o.replace(/\.json$/,"")}-scenario-${e.id}`,e.ownPlace||(n.place={value:{...e.placeName?{name:e.placeName}:{},locations:[{lat:e.lat,lng:e.lng}]},basis:"assumed",rationale:`one of the candidate places of the case, played as scenario ${e.id}${a.placeRationale?`: ${a.placeRationale}`:""}`},delete n.snapshots);const t=r.time?r.time.replace(/[~?%]$/,"").slice(0,16):void 0;return e.local!==t&&(n.time={value:`${e.local}:00`,basis:"assumed",rationale:`one of the candidate instants of the case, played as scenario ${e.id}${a.timeRationale?`: ${a.timeRationale}`:""}`}),delete n.image,d&&b.rewind(l,r.interpretation,d,e,u),l.scenario={id:e.id,of:o,...a.verdict?{verdict:a.verdict}:{}},a.title!==void 0&&(l.title=a.title),n}static rewind(c,o,e,d,u){const a={at:t=>p.at(e,t),levels:e.levels.map(t=>t.aboveGroundM)},n=t=>`${t} archived at ${e.hour} UTC at this place (${e.credit}, grid point ${e.lat.toFixed(3)}, ${e.lng.toFixed(3)}): established given scenario ${d.id} only`;for(const t of u){const m=k.itemsOf(o,t.key);if(!t.inWind||m.length===0)continue;const $=c[t.key];m.forEach((f,v)=>{const s=t.inWind(f,a);for(const i of Object.keys(s))JSON.stringify(s[i])!==JSON.stringify(f[i])&&($[v][i]=i==="wind"?{value:s[i],basis:"established",rationale:n("the wind at the ground")}:s[i])})}const r=p.at(e,10),l=c.bodies;o.bodies.forEach((t,m)=>{if(!t.drifting)return;const $=j.drifted(t,r),f=l[m].track;!f||!$.track||$.track.forEach((v,s)=>{for(const i of["eastM","northM"]){const w=v[i];if(w===void 0)continue;const g=Math.round(w*100)/100,h=f[s][i];f[s][i]=typeof h=="object"&&h!==null&&"value"in h?{...h,value:g,...s===0?{rationale:n(`drifting with the wind at the ground, ${p.rounded(r).speedMS} m/s towards ${p.rounded(r).towardDeg}°,`)}:{}}:g}})})}}export{b as ScenarioReadings};
@@ -1 +0,0 @@
1
- import{BeamSystem as L}from"./BeamSystem-CSfJjLCb.js";import{L as x}from"./LaserBeam-Ber-PT8j.js";import{bP as v,bQ as M,bR as N,bS as O,aP as D}from"./rr0-sighting-editor.mjs";class E{static APERTURE_M=.6;static NEAR_STEP_M=10;static FAR_STEP_M=250;static STEP_SHARE=.05;static CLOUD_STEP_M=25;static SPENT=.003;beams=new L;placed;lineOwners=[];constructor(){this.beams.group.name="searchlights"}get object(){return this.beams.group}get drawnCount(){return this.beams.drawnCount}update(a,o,t){const c=[],d=[];this.lineOwners=[];const i=t.clouds;i?i.dim(this.beams.material):v.apply(this.beams.material,[]);const l=t.wind??{eastMS:0,northMS:0};for(const s of M.onAt(a,o)){const b=this.whereOf(s,t.reference),g=t.origin.x+b.eastM*t.eastScale,u=t.origin.z-b.northM,p=t.groundYAt(g,u)+(s.heightM??M.DEFAULT_HEIGHT_M),e=s.intensityCd??M.DEFAULT_INTENSITY_CD,m=s.divergenceDeg??M.DEFAULT_DIVERGENCE_DEG,S=m*Math.PI/180,w=M.fluxLm(e,m),n=N.ofTemperature(s.colourTemperatureK??M.DEFAULT_TEMPERATURE_K),A=L.white(n);M.aimsAt(s,o).forEach((T,_)=>{const r=M.axisOf(T),h={x:r.east,y:r.up,z:-r.north},P={windAlongMS:l.eastMS*r.east+l.northMS*r.north,windAcrossMS:l.eastMS*r.north-l.northMS*r.east},{points:y,throughBelow:I}=this.walk({x:g,y:p,z:u},h,S,w,o,t,P);if(c.push({id:s.id,points:y,spectrum:A}),this.lineOwners.push({id:s.id,beam:_}),i&&h.y>.02&&i.bottomY>p){const Y=(i.bottomY-p)/h.y,R=t.air.transmittance(t.siteElevationM+p,t.siteElevationM+i.bottomY,Y),C=e*t.relativeScale;d.push({x:g,y:p,z:u,axis:h,fwhmRad:S,rgb:[C*n[0]*R[0],C*n[1]*R[1],C*n[2]*R[2]],throughCloudsBelow:I})}})}this.beams.drawLines(c,t),t.lightClouds?.(d)}walk(a,o,t,c,d,i,l){const s=i.clouds,b=[],g=[],u=[],p=i.siteElevationM+a.y;let e=0,m=0;for(;;){const w=a.x+o.x*e,n=a.y+o.y*e,A=a.z+o.z*e,T=s!==void 0&&n>=s.bottomY&&n<=s.topY,_=Math.exp(-m),r=e>0?i.air.transmittance(p,i.siteElevationM+n,e)[1]:1;if(b.push({x:w,y:n,z:A,altitudeM:i.siteElevationM+n,widthM:E.APERTURE_M+t*e,powerW:c*r*_,haze:x.patchAt(e,d,{...l,patchiness:x.DEFAULT_PATCHINESS})}),g.push(n),u.push(_),e>=M.RANGE_M||n>=M.CEILING_M||_<E.SPENT)break;const h=T?E.CLOUD_STEP_M:Math.min(E.FAR_STEP_M,Math.max(E.NEAR_STEP_M,e*E.STEP_SHARE));if(s&&(T||n<s.bottomY&&n+o.y*h>s.bottomY)){const P=T?h:Math.max(0,(s.bottomY-n)/Math.max(o.y,1e-6));if(!T){e+=Math.max(1,P);continue}m+=s.extinctionAt(w+o.x*h/2,n+o.y*h/2,A+o.z*h/2)*h*O.BEAM_OPACITY}e+=h}return{points:b,throughBelow:w=>{const n=g.findIndex(A=>A>=w);return n<0?u[u.length-1]:u[n]}}}whereOf(a,o){(!this.placed||this.placed.lat!==o.lat||this.placed.lng!==o.lng)&&(this.placed={...o,at:new Map});let t=this.placed.at.get(a);if(!t){const c=D.ecef({lat:o.lat,lng:o.lng,heightM:0}),d=D.ecef({lat:a.lat,lng:a.lng,heightM:0}),i=o.lat*Math.PI/180,l=o.lng*Math.PI/180,s=[d[0]-c[0],d[1]-c[1],d[2]-c[2]];t={eastM:-Math.sin(l)*s[0]+Math.cos(l)*s[1],northM:-Math.sin(i)*Math.cos(l)*s[0]-Math.sin(i)*Math.sin(l)*s[1]+Math.cos(i)*s[2]},this.placed.at.set(a,t)}return t}pick(a,o,t){const c=this.beams.pickAt(a,o,t.toleranceRad);if(c)return{id:c.id,distanceM:c.distanceM,detail:{beam:(this.lineOwners[c.line]?.beam??0)+1}}}dispose(){this.beams.dispose()}}export{E as SearchlightSystem};
@@ -1,7 +0,0 @@
1
- const e="geipan-qt-2025",n="DTN/DA/GP 2025.0001275",a="fr",t={fr:"Questionnaire technique GEIPAN",en:"GEIPAN technical questionnaire"},i={fr:`Vous avez été témoin direct, sur le territoire français, d’un phénomène aérospatial qui vous a intrigué, et vous souhaitez confier cette observation au GEIPAN pour analyse.
2
-
3
- Votre témoignage est capital et unique. Il va consister à faire un récit de votre observation, à répondre à des questions précises, à réaliser des dessins et croquis ou joindre des photographies ou des vidéos pour affiner davantage votre description.
4
-
5
- Il est impératif que vous respectiez les consignes mentionnées à chaque étape afin que nous puissions réunir le plus grand nombre d’informations possible au sujet du phénomène observé.
6
-
7
- Le questionnaire doit être rempli par le témoin direct de l’observation (un questionnaire par témoin le cas échéant). Le questionnaire ne doit concerner qu’une seule observation à la fois.`},o={publisher:"CNES / GEIPAN",title:"Questionnaire technique GEIPAN",url:"https://www.cnes-geipan.fr/sites/default/files/2025-10/GEIPAN_Questionnaire%20Technique.pdf",date:"2025-10"},s={fr:"Les questions du questionnaire technique public du GEIPAN, numérotées comme lui, sans la page d'état civil ni la concession de droits : celles-ci vont au GEIPAN, pas dans un dossier.",en:"The questions of GEIPAN's public technical questionnaire, numbered as it numbers them, without its page of personal details nor its grant of rights: those go to GEIPAN, not into a case."},r=[{fr:"État civil et coordonnées"},{fr:"Informations complémentaires"},{fr:"Reconstitution en images de votre observation"},{fr:"Dessin/croquis/photo"},{fr:"Concession des droits d’auteur pour les œuvres"}],u=[{title:{fr:"Votre observation"},intro:{fr:"Restituez le maximum d'informations : ce sont souvent les détails qui permettent de résoudre les enquêtes. Si vous n'êtes plus très sûr d'un détail, dites-le, mais n'omettez rien."},fields:[{id:"recit",question:{fr:"Votre récit libre de l'observation"},kind:"long",feeds:"narrative"}]},{title:{fr:"Conditions d'observation du phénomène"},fields:[{id:"A1",question:{fr:"Adresse précise du lieu d'observation (commune, département, rue, …)"},kind:"text",feeds:"place",confidential:{reason:{fr:"Adresse précise",en:"Precise address",es:"Dirección precisa",it:"Indirizzo preciso"}}},{id:"A3",question:{fr:"Si l'observation a eu lieu pendant un déplacement : nom du bateau, de la route ou référence du vol"},kind:"text",required:!1},{id:"B1",question:{fr:"Quelles étaient vos occupations juste avant votre observation ?"},kind:"long"},{id:"B2",question:{fr:"Où vous trouviez-vous exactement ? (Extérieur ou intérieur d'un bâtiment ? quel étage ? si vous regardiez à travers une vitre ? si vous étiez dans un véhicule ? le cas échéant à quelle vitesse rouliez-vous ?)"},kind:"long"},{id:"B3",question:{fr:"Description de la scène d'observation (ville, campagne, sur route, en mer, dans les airs, présence de bâtiments, d'antennes, de fils électriques...)"},kind:"long"},{id:"B4",question:{fr:"Date de l'observation"},kind:"date",feeds:"date"},{id:"B5",question:{fr:"Heure précise de début (en heure locale HH:MM:ss)"},kind:"time",feeds:"startTime"},{id:"B6",question:{fr:"Durée de l'observation ou heure de fin (en heures, minutes, secondes)"},kind:"text",feeds:"duration"},{id:"B7",question:{fr:"D'autres témoins ont-ils vu le même phénomène que vous ? Si oui, combien ?"},kind:"text",hint:{fr:"Le cas échéant, merci de leur demander de nous contacter."}},{id:"B8",question:{fr:"Le cas échéant relation entre ces témoins et vous-même (enfant, conjoint, parent, ami, famille…)"},kind:"text",required:!1},{id:"B9",question:{fr:"L'observation s'est faite de façon"},kind:"choice",choices:[{value:"Continue",label:{fr:"Continue"}},{value:"Discontinue",label:{fr:"Discontinue"}}]},{id:"B10",question:{fr:"Si l'observation s'est faite de façon discontinue, précisez pourquoi elle s'est interrompue et a repris"},kind:"long",required:!1},{id:"B11",question:{fr:"Qu'est-ce qui a provoqué la fin de l'observation ?"},kind:"long"},{id:"B12",question:{fr:"Avez-vous vu le phénomène directement de vos yeux ?"},kind:"choice",choices:[{value:"Oui",label:{fr:"Oui"}},{value:"Non",label:{fr:"Non"}}]},{id:"B13",question:{fr:"Le phénomène a-t-il été observé également au travers d'un instrument (lunettes de vue ou de soleil, jumelles, caméra, appareil photo, smartphone, télescope...) ? Si oui merci de préciser le modèle"},kind:"long"},{id:"B14",question:{fr:"Conditions météorologiques (ciel dégagé, nuages, vent, orage, brume, brouillard, neige, pluie, changement des conditions durant l'observation)"},kind:"long"},{id:"B15",question:{fr:"Conditions astronomiques (position de la Lune, du Soleil, présence ou non d'étoiles ou de planètes etc...)"},kind:"long"},{id:"B16",question:{fr:"Equipements allumés ou actifs pendant l'observation (phares, radio, TV, lumières...)"},kind:"long"},{id:"B17",question:{fr:"Bruits dans l'environnement lors de l'observation (TV ou radio allumées, passage de véhicules, moteur d'avion, tonnerre...)"},kind:"long"}]},{title:{fr:"Description du phénomène"},intro:{fr:"Dans vos descriptions, vous pouvez aussi faire des comparaisons avec des objets connus."},fields:[{id:"C1",question:{fr:"Nombre de phénomènes (unique, multiples ou unique puis se divise... )"},kind:"text"},{id:"C2",question:{fr:"Forme"},kind:"text"},{id:"C3",question:{fr:"Couleur"},kind:"text",feeds:"color"},{id:"C4",question:{fr:"Luminosité du phénomène (sombre, faible, forte, aveuglante, ainsi que pulsante, clignotante, constante) ou en comparaison avec des astres connus (comme Vénus, la Lune), l'éclairage d'un lampadaire, des lumières de voiture, de maison, etc..."},kind:"long"},{id:"C5",question:{fr:"Présence d'une trainée ou d'un halo ? Si oui, de quelle couleur ?"},kind:"text"},{id:"C6",question:{fr:"Taille apparente : exprimez les dimensions du phénomène en millimètres/centimètres comptés sur une règle graduée portée à bout de bras. En l'absence de règle, sachez que la largeur du pouce est d'environ 2.54 cm, ce qui permet d'estimer la taille en distance angulaire (en degré °, selon schéma)."},kind:"text",images:[{src:"angular-size.png",alt:{fr:"Un observateur bras tendu, le pouce entre deux étoiles distantes d'environ 2°",en:"An observer at arm's length, the thumb between two stars about 2° apart"},caption:{fr:"Les deux étoiles ont, pour cet observateur, une distance angulaire d'environ 2°.",en:"For this observer, the two stars are about 2° apart."}}]},{id:"C7",question:{fr:"Bruit provenant du phénomène (sifflement, bourdonnement, détonation, comparaison avec un bruit connu ...)"},kind:"text"},{id:"C8",question:{fr:"Distance entre vous et le phénomène observé, estimée grossièrement, précisez également s'il est passé devant ou derrière un élément du paysage, une construction, un nuage…"},kind:"long"}]},{title:{fr:"Début d'observation (position initiale du PAN dans le ciel)"},fields:[{id:"C9",question:{fr:"Indiquer un point cardinal (Nord, Sud …), ou un azimut en degrés par rapport au Nord, ou un repère visuel ou géographique local (bâtiment, village)"},kind:"text",feeds:"startAzimuth",images:[{src:"azimuth.png",alt:{fr:"Rose des vents : Nord azimut 0°, Nord-Est 45°, Est 90°, Sud-Est 135°, Sud 180°, Sud-Ouest 225°, Ouest 270°, Nord-Ouest 315°",en:"Compass rose: North azimuth 0°, North-East 45°, East 90°, South-East 135°, South 180°, South-West 225°, West 270°, North-West 315°"}}]},{id:"C10",question:{fr:"Indiquer une hauteur en degrés par rapport à l'horizon, ou par rapport à un élément du paysage (ex: 2 fois plus haut que le clocher de l'église)"},kind:"text",feeds:"startElevation",images:[{src:"elevation.png",alt:{fr:"Hauteur au-dessus de l'horizon : 0° à l'horizon, 45°, 90° au zénith",en:"Height above the horizon: 0° at the horizon, 45°, 90° at the zenith"}}]}]},{title:{fr:"Fin d'observation (position finale du PAN dans le ciel)"},fields:[{id:"C11",question:{fr:"Indiquer un point cardinal (Nord, Sud …), ou un azimut en degrés par rapport au Nord, ou un repère visuel ou géographique local (bâtiment, village)."},kind:"text",feeds:"endAzimuth",images:[{src:"azimuth.png",alt:{fr:"Rose des vents : Nord azimut 0°, Nord-Est 45°, Est 90°, Sud-Est 135°, Sud 180°, Sud-Ouest 225°, Ouest 270°, Nord-Ouest 315°",en:"Compass rose: North azimuth 0°, North-East 45°, East 90°, South-East 135°, South 180°, South-West 225°, West 270°, North-West 315°"}}]},{id:"C12",question:{fr:"Indiquer une hauteur en degrés par rapport à l'horizon, ou par rapport à un élément du paysage (ex : 2 fois plus haut que le clocher de l'église)."},kind:"text",feeds:"endElevation",images:[{src:"elevation.png",alt:{fr:"Hauteur au-dessus de l'horizon : 0° à l'horizon, 45°, 90° au zénith",en:"Height above the horizon: 0° at the horizon, 45°, 90° at the zenith"}}]},{id:"C13",question:{fr:"Trajectoire du phénomène (ligne droite, montante, descendante, avec ou sans changement de direction, courbe, etc.)"},kind:"long"},{id:"C14",question:{fr:"Portion du ciel parcourue par le PAN durant l'observation (ex : un quart du ciel ou de 30° à 40° par rapport à l'horizon, etc.)"},kind:"text",images:[{src:"protractor.png",alt:{fr:"Rapporteur posé sur l'horizon, gradué de 0° à 180°",en:"A protractor on the horizon, marked from 0° to 180°"}}]},{id:"C15",question:{fr:"Effet(s) sur l'environnement (trace(s) au sol, effet(s) sur les êtres vivants (animaux) ou le matériel)"},kind:"long"}]},{title:{fr:"Et maintenant ?"},fields:[{id:"E1",question:{fr:"Décrivez les émotions que vous avez ressenties pendant et après l'observation"},kind:"long"},{id:"E1'",question:{fr:"Quelle est votre perception du niveau d'étrangeté de votre observation de 1 à 5 (1 peu étrange, 5 très étrange)"},kind:"scale",choices:[{value:"1",label:{fr:"1"}},{value:"2",label:{fr:"2"}},{value:"3",label:{fr:"3"}},{value:"4",label:{fr:"4"}},{value:"5",label:{fr:"5"}}]},{id:"E2",question:{fr:"Qu'avez-vous fait après votre observation ? En avez-vous parlé ? Comment vos interlocuteurs ont réagi ? Avez-vous fait des recherches pour comprendre ce que vous avez vu ?"},kind:"long"},{id:"E3",question:{fr:"Quelle interprétation donnez-vous à ce que vous avez observé ? Avez-vous pensé à un phénomène connu ? Quels sont les éléments qui permettent de justifier votre interprétation ? Si vous ne savez pas, avez-vous renoncé à comprendre ? Si oui, quand et pourquoi ?"},kind:"long"},{id:"E4",question:{fr:"Avant votre observation, quel intérêt portiez-vous aux phénomènes aérospatiaux étranges ?"},kind:"long"},{id:"E5",question:{fr:"Cette observation a-t-elle changé votre avis sur les PAN ?"},kind:"long"},{id:"E6",question:{fr:"Pensez-vous que la science permettra de donner une explication à votre observation ?"},kind:"long"},{id:"E7",question:{fr:"Pensez-vous que l'expérience que vous avez vécue a modifié quelque chose dans votre vie ? Qu'il peut y avoir un avant et un après ? Expliquez ce que vous ressentez"},kind:"long"}]}],d={id:e,version:n,language:"fr",title:t,intro:i,source:o,note:s,stops:r,sections:u};export{d as default,e as id,i as intro,a as language,s as note,u as sections,o as source,r as stops,t as title,n as version};
@@ -1 +0,0 @@
1
- const e={type:"string",doc:"The schema this file was written against, for an editor to check it with: https://ufoathome.org/schema/1/interview.schema.json."},t={type:"number",doc:"The version of the format this file is written in (see FormatVersion): 1, the only one so far."},i={type:"string"},s={type:"string"},n={type:"string",doc:"What the interview is called, in the languages it has.",loose:!0},o={type:"string",doc:"When it was held, as RR0 writes a time."},a={type:"enum",doc:"What it was held through: face to face (`in-person`), by `phone`, in a `video` call, by `chat`, by `email`, by `letter`, a `questionnaire` the witness filled in, or `other`.",values:["questionnaire","letter","other","video","in-person","phone","chat","email"]},r={type:"object",doc:"The questionnaire it was filled in on, when it was held through one: the id of its template (see QuestionnaireTemplate) and its version.",fields:{id:{type:"string"},version:{type:"string"},recipient:{type:"object",doc:"Who its confidential answers are sealed for (see QuestionnaireSeal): none, and a confidential answer is kept in no file at all.",fields:{id:{type:"string",doc:"What a sealed answer names it by (see InterviewSeal.for)."},name:{type:"string",loose:!0},publicKey:{type:"object",doc:"Its public key, RSA-OAEP with SHA-256, as a JSON Web Key."}}}}},d={type:"array",doc:"Who held it."},c={type:"string",doc:"The `id`, or the ids, of the sighting events of the case it was held with.",loose:!0},h={type:"string",doc:"What it established, in the languages it has.",loose:!0},p={type:"object"},l={type:"object",fields:{method:{type:"enum",values:["automatic","manual"]},engine:{type:"string"},note:{type:"string"}}},y={type:"object",doc:"Who approved the transcript, by speaker id."},f={type:"object",doc:"What was taken out to anonymise it, and what stands in its place.",fields:{replaced:{type:"array"},marker:{type:"string"}}},g={type:"array",doc:"The recordings of the interview, if any are kept (see InterviewRecording).",fields:{kind:{type:"enum",values:["video","audio"]},src:{type:"string",doc:"Its address, relative to the transcript's file."},offset:{type:"number",doc:"Seconds of the recording before the transcript's time 0."}}},u={type:"array",fields:{speaker:{type:"string"},start:{type:"number"},end:{type:"number"},text:{type:"string"},redacted:{type:"object",fields:{reason:{type:"string",doc:"Why, in the languages it has: what kind of passage (private life, identifying detail, small talk, recognition error).",loose:!0},words:{type:"number",doc:'How many words were taken out: what a reader can be told of a passage whose text is gone ("passage taken out · 10 words").'},sealed:{type:"object",doc:"The passage itself, sealed for the one who may read it (a confidential answer to a questionnaire, see QuestionnaireSeal): taken out for everybody else, kept for them.",fields:{for:{type:"string",doc:"The id of the recipient it is sealed for (see SealRecipient)."},alg:{type:"enum",values:["RSA-OAEP-256+A256GCM"]},key:{type:"string",doc:"The AES key, encrypted with the recipient's public key, in base64."},iv:{type:"string",doc:"The AES-GCM nonce, in base64."},data:{type:"string",doc:"The answer, UTF-8 encrypted with the AES key, in base64."}}}}},parts:{type:"array"},refs:{type:"array",doc:"The moments of the observation this passage tells of.",fields:{sighting:{type:"string",doc:"The `id` of the sighting event of the case; the interview's own `interviewOf` when omitted."},at:{type:"number",doc:"Seconds since the beginning of the observation."},range:{type:"array",doc:"The part of the segment's text it is about, as `[from, to)` character offsets."}}},field:{type:"string",doc:'In a questionnaire the witness filled in, the field this turn asks or answers: its number or its name as the questionnaire gives it ("12", "duration").'}}},m={$schema:e,version:t,id:i,language:s,title:n,time:o,medium:a,questionnaire:r,by:d,interviewOf:c,summary:h,speakers:p,transcription:l,proofreading:y,anonymization:f,recordings:g,segments:u};export{e as $schema,f as anonymization,d as by,m as default,i as id,c as interviewOf,s as language,a as medium,y as proofreading,r as questionnaire,g as recordings,u as segments,p as speakers,h as summary,o as time,n as title,l as transcription,t as version};
@@ -1,277 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BrowserWhisperProvider-Dn44ZE45.js","./TranscriptionAudio-C_xvRUv2.js","./TranscriptionError-D_TCbYbt.js","./OpenAiTranscriptionProvider-DDW446tK.js","./AssemblyAiTranscriptionProvider-o2kkPD5o.js","./QuestionnaireForm-ByFmq67M.js","./CaseEditorElement-C5BHP8jT.js","./rr0-ufoathome.mjs","./SaidPosition-OJEYhVKN.js","./GeoProjection-DvqDbRIx.js","./ParameterForm-XbqxCLRn.js","./ColumnResize-Dh6Xyspd.js","./ShareDialogElement-CBeU9ChH.js","./Sighting-B7bsiTIQ.js","./VisualAids-DI-hEL46.js","./three.module-CbaHqYFq.js","./Decor-Dn-cvniW.js","./RecordingIssue-BlWT8Xsu.js","./xyzImageryRaster-Dhxs0B26.js","./Obstacles-v9SkfBD7.js","./TimelineTracks-Daaqw9ly.js","./ReentryArchive-CeXHrU7L.js","./ReferenceTimeline-2kBldQeG.js","./upperAirSources-BU0pD84c.js","./Account-C4jhsVtN.js","./interviewJson-D-i14LTf.js","./interviewImport-ym5iXO4Z.js","./SightingFileEditor-DS1DRU2p.js","./index-C8cdeM8E.js","./sightingSchema-9MogCcUd.js","./QuestionnaireImport-Cx1dQiha.js"])))=>i.map(i=>d[i]);
2
- import{g as P,_ as b,r as V,S as M,h as C,H as z,s as Q,U as J,T as j,i as y,a as I,V as G}from"./rr0-ufoathome.mjs";import{an as A,H as R,X as O}from"./ShareDialogElement-CBeU9ChH.js";import{InterviewMedia as N}from"./InterviewMedia-CGVsMdje.js";import{c as S,Q as K}from"./ColumnResize-Dh6Xyspd.js";import{I as Se}from"./ColumnResize-Dh6Xyspd.js";import{register as Y}from"./InterviewElement-CuRmQ0d3.js";import{InterviewFile as w}from"./interviewJson-D-i14LTf.js";import{I as x}from"./SaidPosition-OJEYhVKN.js";import{W as B,A as F}from"./ParameterForm-XbqxCLRn.js";import{I as X}from"./CaseEditorElement-C5BHP8jT.js";import"./Sighting-B7bsiTIQ.js";import"./VisualAids-DI-hEL46.js";import"./three.module-CbaHqYFq.js";import"./Decor-Dn-cvniW.js";import"./GeoProjection-DvqDbRIx.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";import"./TimelineTracks-Daaqw9ly.js";import"./ReentryArchive-CeXHrU7L.js";import"./ReferenceTimeline-2kBldQeG.js";import"./upperAirSources-BU0pD84c.js";import"./Account-C4jhsVtN.js";class f{static partsOf(e){return e.parts?e.parts:e.redacted?[]:[{text:e.text??""}]}static shownRanges(e){const t=[];let r="",i=0;return e.forEach((s,n)=>{const a="redacted"in s?"▮":w.plain(s.text);/[\p{L}\p{N}.,;:!?)»”…▮]$/u.test(r)&&/^[\p{L}\p{N}(«“▮]/u.test(a)&&(i+=1);const d="redacted"in s?0:a.length;t.push({part:n,from:i,to:i+d}),i+=d,r=a}),t}static words(e){return e.trim()===""?0:e.trim().split(/\s+/u).length}static redact(e,t,r,i){const s=[...f.partsOf(e)],n=f.shownRanges(s).find(v=>!("redacted"in s[v.part])&&t>=v.from&&r<=v.to);if(!n)return;const a=w.plain(s[n.part].text),d=/[\p{L}\p{N}'’-]/u;let h=t-n.from,o=r-n.from;for(;h>0&&d.test(a[h-1])&&d.test(a[h]);)h--;for(;o<a.length&&d.test(a[o])&&d.test(a[o-1]);)o++;const c=a.slice(h,o);if(c.trim()==="")return;const l=a.slice(0,h).trimEnd(),p=a.slice(o).trimStart(),g=[...l!==""?[{text:l}]:[],{redacted:{reason:i,words:f.words(c)}},...p!==""?[{text:p}]:[]],m=s.slice(0,n.part).filter(v=>"redacted"in v).length;return s.splice(n.part,1,...g),f.setParts(e,s),{text:c.trim(),nth:m}}static redactWhole(e,t){const r=JSON.stringify({text:e.text,parts:e.parts}),i=f.partsOf(e).reduce((s,n)=>s+("redacted"in n?n.redacted.words??0:f.words(w.plain(n.text))),0);if(delete e.text,delete e.parts,e.redacted={reason:t,...i>0?{words:i}:{}},e.refs)for(const s of e.refs)delete s.range;return r}static restoreWhole(e,t){const{text:r,parts:i}=JSON.parse(t);delete e.redacted,i?e.parts=i:e.text=r??""}static restorePart(e,t,r){const i=[...f.partsOf(e)];let s=-1;const n=i.findIndex(a=>"redacted"in a&&++s===t);n!==-1&&(i.splice(n,1,{text:r}),f.setParts(e,i))}static raw(e,t=()=>{}){let r=-1,i="",s="";for(const n of f.partsOf(e)){const a="redacted"in n?`⟦${t(++r)??"…"}⟧`:n.text;i!==""&&!/\s$/u.test(s)&&!/^\s/u.test(a)&&(i+=" "),i+=a,s=a}return i}static fromRaw(e,t,r){const i=f.partsOf(e).filter(d=>"redacted"in d),s=[],n=new Map;let a=-1;return t.split(/⟦([^⟧]*)⟧/u).forEach((d,h)=>{if(h%2===0){d.trim()!==""&&s.push({text:d.trim()});return}a++;const o=d.trim();o===""||o==="…"||o==="..."?s.push({redacted:i[a]?.redacted??{reason:r}}):(s.push({redacted:{reason:r,words:f.words(o)}}),n.set(a,o))}),delete e.redacted,f.setParts(e,s),n}static setParts(e,t){const r=[];for(const i of t){const s=r[r.length-1],n=!("redacted"in i)&&/^[,.;:!?)»”…]/u.test(i.text)?"":" ";s&&!("redacted"in s)&&!("redacted"in i)?r[r.length-1]={text:`${s.text}${n}${i.text}`.replace(/\s+/gu," ").trim()}:r.push(i)}if(r.some(i=>"redacted"in i)){if(e.parts=r,delete e.text,e.refs)for(const i of e.refs)delete i.range}else e.text=r.map(i=>i.text).join(" "),delete e.parts}}class H{constructor(e,t,r){this.host=t,this.messages=r,e.classList.add("player"),e.innerHTML=`<div class="player-video" hidden></div>
3
- <div class="player-bar">
4
- <button type="button" class="icon-btn player-play" disabled>${x.PLAY}</button>
5
- <span class="player-time">0:00</span>
6
- <div class="speaker-track" role="slider" tabindex="0" aria-valuemin="0"></div>
7
- <span class="player-time player-end">0:00</span>
8
- <button type="button" class="pill-btn player-recordings"></button>
9
- </div>
10
- <p class="player-empty"></p>
11
- <dialog class="recordings-window"><h3></h3><div class="recording-rows"></div><button type="button" class="pill-btn recording-add">${x.PLUS}<span></span></button></dialog>`,this.play=e.querySelector(".player-play"),this.time=e.querySelector(".player-time"),this.end=e.querySelector(".player-end"),this.track=e.querySelector(".speaker-track"),this.video=e.querySelector(".player-video"),this.empty=e.querySelector(".player-empty"),this.open=e.querySelector(".player-recordings"),this.window=e.querySelector(".recordings-window"),this.play.addEventListener("click",()=>{this.media&&(this.media.paused?this.media.play().catch(()=>{}):this.media.pause())}),this.track.addEventListener("pointerdown",i=>{const s=this.track.getBoundingClientRect();s.width>0&&this.seek((i.clientX-s.left)/s.width*this.duration)}),this.track.addEventListener("keydown",i=>{(i.key==="ArrowRight"||i.key==="ArrowLeft")&&this.seek(this.now+(i.key==="ArrowRight"?5:-5))}),this.open.addEventListener("click",()=>this.showWindow()),e.querySelector(".recording-add").addEventListener("click",()=>this.edit(i=>i.push({kind:"audio",src:""}))),B.dialog(this.window,r.close,()=>this.window.close())}static CSS=`
12
- .player { margin: 0 0 4px; border-radius: 12px; }
13
- .player-video { aspect-ratio: 16 / 9; margin-bottom: 8px; border-radius: 10px; overflow: hidden; background: #0b1020; }
14
- .player-video video { width: 100%; height: 100%; display: block; }
15
- .player-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--ground-sunken); }
16
- .player-time { font: 500 13px/1 var(--mono); color: var(--ink-dim); font-variant-numeric: tabular-nums; }
17
- .speaker-track { position: relative; flex: 1 1 auto; height: 28px; border-radius: 6px; cursor: pointer; overflow: hidden;
18
- background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 4px); }
19
- .speaker-track .seg { position: absolute; top: 4px; bottom: 4px; border-radius: 2px; }
20
- .speaker-track .seg[data-role="witness"] { background: #c9a14a; }
21
- .speaker-track .seg[data-role="interviewer"] { background: #5b8fc4; }
22
- .speaker-track .seg[data-role="other"] { background: var(--ink-faint); }
23
- .speaker-track .seg.redacted { background: repeating-linear-gradient(135deg, var(--ink-faint) 0 3px, transparent 3px 6px); }
24
- .speaker-track .head { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #f5c451; }
25
- .player-empty { margin: 6px 2px 0; font-size: 13px; color: var(--ink-faint); }
26
- .recordings-window { max-width: min(36em, 94vw); padding: 18px 20px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--ground-raised); color: var(--ink); }
27
- .recordings-window::backdrop { background: rgba(7, 10, 18, .5); }
28
- .recordings-window h3 { margin: 0 0 12px; font: 600 19px/1.3 var(--serif); }
29
- .recording-row { display: grid; grid-template-columns: 8em minmax(0, 1fr) 7em auto; gap: 8px; align-items: end; margin-bottom: 10px; }
30
- .recording-row label { display: flex; flex-direction: column; gap: 4px; font: 600 12px/1.3 var(--sans); color: var(--ink-dim); }
31
- .recording-row input, .recording-row select { box-sizing: border-box; width: 100%; font-weight: 400; }
32
- .recording-file { display: flex; gap: 6px; }
33
- .recording-row .with-unit { display: flex; align-items: center; gap: 4px; font-weight: 400; color: var(--ink); }
34
- .recording-status { grid-column: 1 / -1; margin: -4px 0 0; font-size: 12px; color: var(--ink-faint); }
35
- .recording-status.error { color: var(--error); }
36
- `;json;base;media;mediaFor="";picked=new Map;messages;play;time;end;track;video;empty;open;window;setMessages(e){this.messages=e,this.render()}show(e,t){this.json=e,this.base=t,this.render()}get now(){return this.media?Math.max(0,this.media.currentTime-(this.recordings[0]?.offset??0)):this.position}seek(e){this.position=Math.min(this.duration,Math.max(0,e)),this.media&&(this.media.currentTime=this.position+(this.recordings[0]?.offset??0)),this.placeHead(),this.host.timeChanged(this.position)}position=0;get recordings(){return Array.isArray(this.json?.recordings)?this.json.recordings:[]}get duration(){const e=this.media&&Number.isFinite(this.media.duration)?this.media.duration-(this.recordings[0]?.offset??0):0,t=Math.max(0,...(this.json?.segments??[]).map(r=>r.end??r.start??0));return Math.max(1,e,t)}render(){const e=this.messages,t=this.recordings;this.open.innerHTML='<svg class="icon" 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="M6 12V3.5l7-1.5V10.5"/><circle cx="4.5" cy="12" r="1.5"/><circle cx="11.5" cy="10.5" r="1.5"/></svg>',this.open.append(e.recordings.replace("{n}",String(t.length))),this.empty.textContent=t.length===0?e.noRecording:"",this.empty.hidden=t.length>0,this.play.title=e.play,this.play.setAttribute("aria-label",e.play),this.track.setAttribute("aria-label",e.recordingsTitle),this.ensureMedia(),this.drawTrack(),this.window.open&&this.drawRows()}ensureMedia(){const e=this.recordings[0],t=e?`${e.kind}|${e.src}`:"";if(t===this.mediaFor||(this.mediaFor=t,this.media?.pause(),this.media=void 0,this.video.replaceChildren(),this.video.hidden=!0,this.play.disabled=!0,!e||e.src===""))return;const r=document.createElement(e.kind==="video"?"video":"audio");r.preload="metadata",r.src=this.urlOf(e.src),r.addEventListener("loadedmetadata",()=>this.drawTrack()),r.addEventListener("timeupdate",()=>{this.placeHead(),this.host.timeChanged(this.now)});const i=()=>{const s=!r.paused;this.play.innerHTML=s?x.PAUSE:x.PLAY;const n=s?this.messages.pause:this.messages.play;this.play.title=n,this.play.setAttribute("aria-label",n)};r.addEventListener("play",i),r.addEventListener("pause",i),e.kind==="video"&&(this.video.append(r),this.video.hidden=!1),this.media=r,this.play.disabled=!1}recordingUrl(){const e=this.recordings[0];return e&&e.src!==""?this.urlOf(e.src):void 0}urlOf(e){const t=this.picked.get(e);if(t)return t;try{return new URL(e,this.base??location.href).href}catch{return e}}drawTrack(){const e=this.json,t=this.duration,r=(e?.segments??[]).filter(s=>s.start!==void 0);this.track.replaceChildren(...r.map(s=>{const n=document.createElement("span"),a=e?.speakers?.[s.speaker]?.role;n.className=s.redacted?"seg redacted":"seg",n.dataset.role=a==="witness"||a==="interviewer"?a:"other";const d=s.start??0,h=s.end??d+1;return n.style.left=`${d/t*100}%`,n.style.width=`${Math.max(.3,(h-d)/t*100)}%`,n}));const i=document.createElement("span");i.className="head",this.track.append(i),this.track.setAttribute("aria-valuemax",String(Math.round(t))),this.end.textContent=w.clock(t),this.placeHead()}placeHead(){const e=this.now,t=this.track.querySelector(".head");t&&(t.style.left=`${Math.min(e,this.duration)/this.duration*100}%`),this.time.textContent=w.clock(Math.floor(e)),this.track.setAttribute("aria-valuenow",String(Math.round(e)))}showWindow(){this.drawRows(),typeof this.window.showModal=="function"?this.window.showModal():this.window.setAttribute("open","")}drawRows(){const e=this.messages;this.window.querySelector("h3").textContent=e.recordingsTitle,this.window.querySelector(".recording-add span").textContent=e.recordingAdd,B.dialog(this.window,e.close,()=>this.window.close()),this.window.querySelector(".recording-rows").replaceChildren(...this.recordings.map((i,s)=>{const n=document.createElement("div");n.className="recording-row";const a=document.createElement("select");a.append(new Option(e.recordingAudio,"audio"),new Option(e.recordingVideo,"video")),a.value=i.kind,a.addEventListener("change",()=>this.edit(m=>{m[s].kind=a.value}));const d=document.createElement("input");d.type="text",d.value=i.src,d.placeholder="interview.mp3",d.addEventListener("change",()=>this.edit(m=>{m[s].src=d.value.trim()})),s===this.recordings.length-1&&d.addEventListener("input",()=>this.allowAdding(d.value.trim()!==""));const h=document.createElement("input");h.type="file",h.accept="audio/*,video/*",h.hidden=!0,h.addEventListener("change",()=>{const m=h.files?.[0];m&&(this.picked.set(m.name,URL.createObjectURL(m)),this.edit(v=>{v[s].src=m.name,m.type.startsWith("video/")&&(v[s].kind="video")}))});const o=document.createElement("button");o.type="button",o.className="icon-btn",o.title=e.recordingFile,o.setAttribute("aria-label",e.recordingFile),o.innerHTML='<svg class="icon" 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.5 4.5h4l1.5 1.5h5.5v6.5h-11z"/></svg>',o.addEventListener("click",()=>h.click());const c=document.createElement("span");c.className="recording-file",c.append(d,o,h);const l=document.createElement("input");l.type="number",l.step="0.1",l.value=i.offset!==void 0?String(i.offset):"",l.placeholder="0",l.addEventListener("change",()=>this.edit(m=>{const v=Number(l.value);l.value.trim()===""||!Number.isFinite(v)||v===0?delete m[s].offset:m[s].offset=v}));const p=document.createElement("button");p.type="button",p.className="icon-btn",p.innerHTML=x.TRASH,p.title=e.recordingRemove,p.setAttribute("aria-label",e.recordingRemove),p.addEventListener("click",()=>this.edit(m=>{m.splice(s,1)}));const g=document.createElement("p");return g.className="recording-status",this.check(i,g),n.append(this.labelled(e.recordingKind,a),this.labelled(e.recordingFile,c),this.labelled(e.recordingOffset,l,"s"),p,g),n}));const r=this.recordings[this.recordings.length-1];this.allowAdding(r===void 0||r.src!=="")}allowAdding(e){const t=this.window.querySelector(".recording-add");t.disabled=!e,t.title=e?"":this.messages.recordingAddFirst}labelled(e,t,r){const i=document.createElement("label"),s=document.createElement("span");if(s.textContent=e,r){const n=document.createElement("span");n.className="with-unit",n.append(t,r),i.append(s,n)}else i.append(s,t);return i}check(e,t){if(e.src==="")return;const r=document.createElement(e.kind==="video"?"video":"audio");r.preload="metadata",r.addEventListener("loadedmetadata",()=>{t.textContent=w.clock(Math.round(r.duration)),t.classList.remove("error")}),r.addEventListener("error",()=>{t.textContent=this.messages.loadFailed,t.classList.add("error")}),r.src=this.urlOf(e.src)}edit(e){const t=structuredClone(this.recordings);e(t),this.host.recordingsChanged(t)}}class L{constructor(e,t,r,i){this.sendsAudio=e,this.engine=t,this.load=r,this.downloadBytes=i}loaded;transcribe(e){return this.loaded??=this.load().catch(t=>{throw this.loaded=void 0,t}),this.loaded.then(t=>t.transcribe(e))}}const $="groq",_="openai",U="assemblyai",T=P.point("transcription").provide(P.BUILT_IN,[{id:"whisper-browser",name:"Whisper",credit:"OpenAI Whisper large-v3-turbo (MIT), run by Transformers.js (Apache 2.0)",creditUrl:"https://huggingface.co/onnx-community/whisper-large-v3-turbo",create:()=>new L(!1,"whisper-large-v3-turbo (Transformers.js, in the browser)",async()=>new(await b(async()=>{const{BrowserWhisperProvider:E}=await import("./BrowserWhisperProvider-Dn44ZE45.js");return{BrowserWhisperProvider:E}},__vite__mapDeps([0,1,2]),import.meta.url)).BrowserWhisperProvider,76e7)},{id:$,name:"Groq",credit:"Groq, Whisper large-v3-turbo, on your own key",creditUrl:"https://groq.com/terms-of-use",keyUrl:"https://console.groq.com/keys",create:()=>new L(!0,"whisper-large-v3-turbo (Groq)",async()=>new(await b(async()=>{const{OpenAiTranscriptionProvider:E}=await import("./OpenAiTranscriptionProvider-DDW446tK.js");return{OpenAiTranscriptionProvider:E}},__vite__mapDeps([3,1,2]),import.meta.url)).OpenAiTranscriptionProvider({base:"https://api.groq.com/openai/v1",model:"whisper-large-v3-turbo",key:()=>A.of($)}))},{id:_,name:"OpenAI",credit:"OpenAI, Whisper, on your own key",creditUrl:"https://openai.com/policies/row-terms-of-use/",keyUrl:"https://platform.openai.com/api-keys",create:()=>new L(!0,"whisper-1 (OpenAI)",async()=>new(await b(async()=>{const{OpenAiTranscriptionProvider:E}=await import("./OpenAiTranscriptionProvider-DDW446tK.js");return{OpenAiTranscriptionProvider:E}},__vite__mapDeps([3,1,2]),import.meta.url)).OpenAiTranscriptionProvider({base:"https://api.openai.com/v1",model:"whisper-1",key:()=>A.of(_)}))},{id:U,name:"AssemblyAI",credit:"AssemblyAI, voices told apart, on your own key",creditUrl:"https://www.assemblyai.com/legal/terms-of-service",keyUrl:"https://www.assemblyai.com/app/api-keys",create:()=>new L(!0,"AssemblyAI (speaker labels)",async()=>new(await b(async()=>{const{AssemblyAiTranscriptionProvider:E}=await import("./AssemblyAiTranscriptionProvider-o2kkPD5o.js");return{AssemblyAiTranscriptionProvider:E}},__vite__mapDeps([4,1,2]),import.meta.url)).AssemblyAiTranscriptionProvider({base:"https://api.assemblyai.com",key:()=>A.of(U)}))}]),q="rr0-interview-editor",Z=`
37
- <style>
38
- :host { display: block; }
39
- /* The colours of the transcript's text editor (see SightingFileEditor): a key, a string, a number or a word, and a mistake. Dark mode redefines them. */
40
- :host { --file-key: #1a5fb4; --file-string: #26662f; --file-literal: #a5321f; --rr0-alert: #c33; }
41
- @media (prefers-color-scheme: dark) { :host { --file-key: #8cb8ff; --file-string: #8fd39a; --file-literal: #ffa08a; } }
42
- [hidden] { display: none !important; }
43
- /* Two groups as the recording's editor has its own (see sightingEditorTemplate): the open tab raised and joined to its panel. */
44
- .group-tabs { --tab-line: color-mix(in srgb, CanvasText 35%, transparent); --tab-surface: color-mix(in srgb, CanvasText 5%, Canvas);
45
- --tab-recessed: color-mix(in srgb, CanvasText 11%, Canvas); --tab-accent: #4a9eff;
46
- display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0; margin: 0; padding: 0; border-bottom: 1px solid var(--tab-line); }
47
- .group-tab { -webkit-user-select: none; user-select: none; font: inherit; font-weight: 600; cursor: pointer; color: color-mix(in srgb, CanvasText 70%, transparent); background: var(--tab-recessed);
48
- border: 1px solid var(--tab-line); border-radius: 8px 8px 0 0; padding: .4em .6em; margin: 0 0 -1px -1px; position: relative; }
49
- .group-tab:hover { color: CanvasText; background: color-mix(in srgb, CanvasText 16%, Canvas); }
50
- .group-tab[aria-expanded="true"] { color: CanvasText; background: var(--tab-surface); border-bottom-color: var(--tab-surface); box-shadow: inset 0 2px 0 var(--tab-accent); z-index: 1; }
51
- .group-tab:focus-visible { outline: 2px solid #4af; outline-offset: -2px; }
52
- .group-panel { border: 1px solid var(--tab-line, color-mix(in srgb, CanvasText 35%, transparent)); border-top: 0; border-radius: 0 0 4px 4px;
53
- background: color-mix(in srgb, CanvasText 5%, Canvas); padding: .5em .75em; margin: 0 0 .5em; }
54
- .row { display: flex; align-items: center; gap: .5em; flex-wrap: wrap; margin-bottom: .5em; }
55
- .group-panel > .row:last-child { margin-bottom: 0; }
56
- label { display: flex; align-items: center; gap: .4em; }
57
- label.wide { flex: 1 1 100%; align-items: flex-start; }
58
- label.wide textarea { flex: 1 1 auto; min-width: 0; min-height: 9em; }
59
- label.fill { flex: 1 1 100%; }
60
- label.fill input { flex: 1 1 auto; }
61
- input[type="text"] { min-width: 0; }
62
- #by { width: 16em; }
63
- input[type="url"] { width: 18em; max-width: 100%; }
64
- ${X.CSS}
65
- select { min-width: 0; max-width: 100%; text-overflow: ellipsis; }
66
- fieldset.witnesses { display: flex; flex-wrap: wrap; align-items: center; gap: .25em .75em; border: 0; margin: 0; padding: 0; min-width: 0; }
67
- fieldset.witnesses legend { float: left; padding: 0; margin-right: .4em; }
68
- #exchanges { --rr0-interview-max-height: 32em; --rr0-interview-overflow: auto; }
69
- .file-note { margin: .3em 0; }
70
- ${y.rules([".file-note"])}
71
- .file-editor { min-height: 18em; margin-top: .5em; }
72
- /* ---- The design handoff's look (design_handoff_editeurs_ufoathome, §2 and §5) ---- */
73
- :host {
74
- ${C.TOKENS}
75
- --rr0-field-radius: 8px;
76
- --rr0-input-font-size: 15px;
77
- container-type: inline-size;
78
- font: 400 15px/1.5 var(--sans);
79
- color: var(--ink);
80
- }
81
- ${C.HEAD}
82
- ${C.fields(".interview-app")}
83
- .recordings-window :is(button, input, select) { font: inherit; }
84
- .recordings-window .pill-btn { min-height: 36px; }
85
- /* Its parts, underlined, as the case's are. */
86
- #tabs { display: flex; gap: 6px; padding: 0; border-bottom: 1px solid var(--line); }
87
- #tabs .group-tab {
88
- display: inline-flex; align-items: center; gap: 8px; min-height: 0; margin: 0 0 -1px; padding: 12px 10px;
89
- border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; box-shadow: none; color: var(--ink-dim); font: 600 15px/1.2 var(--sans);
90
- }
91
- /* A pictogram before each name, as the case's and the observation's tabs have. */
92
- #tabs .group-tab > svg { flex: none; width: 16px; height: 16px; }
93
- #tabs .group-tab:hover { background: none; color: var(--ink); }
94
- #tabs .group-tab[aria-expanded="true"] { color: var(--ink); border-bottom-color: var(--glow-solid); background: none; box-shadow: none; }
95
- .interview-app > .group-panel { margin: 0; padding: 18px 0 0; border: 0; border-radius: 0; background: none; color: var(--ink); }
96
- /* Fields: the label above, the value under it, on a grid that fills the width; the title and what was established the whole width. */
97
- #group-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 16px; }
98
- #group-summary > .row { display: contents; }
99
- #group-summary label, #group-transcript label { display: flex; flex-direction: column; align-items: stretch; gap: 6px; font: 600 13px/1.3 var(--sans); color: var(--ink-dim); }
100
- #group-summary :is(label.fill, label.wide) { grid-column: 1 / -1; }
101
- #group-summary :is(input, select, textarea), #group-transcript input[type="text"] { box-sizing: border-box; width: 100%; font-weight: 400; }
102
- #group-summary input[type="text"], #group-transcript input[type="text"] { height: 38px; }
103
- #group-summary textarea { min-height: 9em; }
104
- fieldset.witnesses { flex-direction: column; align-items: flex-start; gap: 6px; font: 600 13px/1.3 var(--sans); color: var(--ink-dim); }
105
- /* A witness's name stays on one line beside its box: shrunk to its words, the label broke "Q. B." in two. */
106
- #group-summary fieldset.witnesses label { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; color: var(--ink); white-space: nowrap; }
107
- /* The exchanges, one card an intervention, the speaker's colour down its side: a list that scrolls past 520 px (440 on a phone). */
108
- #exchanges { --rr0-interview-max-height: 520px; --rr0-interview-line: var(--line-strong); }
109
- #exchanges .rr0-interview-turns { padding-right: 4px; }
110
- #exchanges .intervention { margin: 0 0 10px; padding: 6px 4px; border: 1px solid var(--line-strong); border-left: 3px solid var(--speaker); border-radius: 10px; background: var(--ground); }
111
- #exchanges .intervention:hover { background: var(--ground-sunken); }
112
- #exchanges .turn .who { display: inline-block; margin-bottom: 4px; padding: 1px 9px; border-radius: 999px; background: color-mix(in srgb, var(--speaker) 18%, transparent); color: var(--ink); font: 700 12px/1.5 var(--sans); }
113
- #exchanges .turn .said { font-size: 15px; line-height: 1.55; color: var(--ink); }
114
- #exchanges .turn .ref { border-color: var(--glow-dim); background: var(--warn-bg); color: var(--ink); font: 600 12px/1.6 var(--sans); padding: 1px 9px; }
115
- #exchanges .turn.flash { background: var(--warn-bg); }
116
- #exchanges .rr0-interview-status { padding: 8px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--ink-dim); font-size: 13px; }
117
- #group-transcript > .row { margin-bottom: 12px; }
118
- @container (max-width: 640px) { #exchanges { --rr0-interview-max-height: 440px; } }
119
- ${H.CSS}
120
- ${R.CSS}
121
- ${B.CSS}
122
- ${F.CSS}
123
- ${x.CSS}
124
- /* Who has proofread it, said once above the exchanges, with a box each to say they have (see renderReview); the reader's own line goes. */
125
- #exchanges .rr0-interview-status { display: none; }
126
- .review { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 10px; padding: 10px 14px;
127
- border-radius: 10px; background: var(--warn-bg); font-size: 13px; color: var(--ink-dim); }
128
- .review[data-done] { background: var(--neutral-bg); }
129
- .review-boxes { display: flex; flex-wrap: wrap; gap: 14px; }
130
- .review-boxes label { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
131
- /* Where the words selected, or the passage taken out pressed, are: why it is taken out, and what to do with it. Fixed, as it is placed
132
- against what it is about (see openRedactPop); in the top layer where popovers are known. */
133
- .redact-pop { position: fixed; inset: auto; margin: 0; text-align: start; width: min(24em, calc(100vw - 32px)); box-sizing: border-box; padding: 10px 12px;
134
- border: 1px solid var(--line-strong); border-radius: 10px; background: var(--ground-raised); color: var(--ink); box-shadow: 0 6px 24px rgba(0, 0, 0, .18); }
135
- .redact-pop[hidden] { display: none; }
136
- /* The words the popover is about, still marked once typing the reason has taken the selection away. */
137
- ::highlight(rr0-redact-pending) { background-color: var(--warn-bg, #fde9b0); color: inherit; text-decoration: underline 2px var(--glow-dim, #c90); }
138
- .redact-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 8px; }
139
- .redact-actions button[hidden] { display: none; }
140
- .transcribe { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
141
- .transcribe-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
142
- .transcribe-row label { display: inline-flex; align-items: center; gap: 6px; font: 600 13px/1.3 var(--sans); color: var(--ink-dim); }
143
- .transcribe-row input[type="password"] { width: 14em; }
144
- .transcribe .source-credit { font-size: 12px; color: var(--ink-faint); }
145
- .transcribe-note { margin: .4em 0 0; }
146
- .transcribe progress { width: 100%; margin-top: 6px; }
147
- .redact-reason { display: flex; flex-direction: column; align-items: stretch; gap: 4px; text-align: start; font: 600 12px/1.3 var(--sans); color: var(--ink-dim); }
148
- .redact-reason input { box-sizing: border-box; width: 100%; font-weight: 400; }
149
- .redact-note { margin: 6px 0 0; font-size: 13px; color: var(--ink-faint); }
150
- .redact-note:empty { display: none; }
151
- .redact-note.error { color: var(--error); }
152
- /* Each turn: its time, which plays from there; what is taken out as a label that says how much, and puts it back while it is known. */
153
- #exchanges .turn { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); column-gap: 14px; padding: 8px 10px; }
154
- #exchanges .turn > .turn-time { grid-row: 1; grid-column: 1; }
155
- #exchanges .turn > .who { grid-column: 1; align-self: start; }
156
- #exchanges .turn > :not(.who, .turn-time) { grid-column: 2; }
157
- #exchanges .turn > .said, #exchanges .turn > .redacted { grid-row: 1 / span 2; }
158
- #exchanges .turn.goes-on > .who, #exchanges .turn.is-redacted > .who { display: block; visibility: hidden; }
159
- /* The time is on the turn itself here: the reader's tooltip of it would say it twice. */
160
- #exchanges .turn[data-time]::after { content: none !important; display: none !important; }
161
- .turn-time { justify-self: start; min-height: 0; padding: 0; border: 0; background: none; color: var(--sky); font: 600 13px/1.4 var(--mono); cursor: pointer; }
162
- .turn-time:hover:not(:disabled) { background: none; text-decoration: underline; }
163
- #exchanges .bar.redacted-label { width: auto; height: auto; padding: 0 8px; border: 1px dashed var(--line-strong); border-radius: 999px; background: none; color: var(--ink-faint);
164
- font: 600 12px/1.6 var(--sans); vertical-align: baseline; cursor: default; }
165
- #exchanges .bar.redacted-label { cursor: pointer; }
166
- #exchanges .bar.redacted-label:hover { border-color: var(--glow-dim); color: var(--ink); }
167
- .turn-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 12px; margin-top: 6px; }
168
- .turn-tools button { min-height: 0; padding: 2px 4px; border: 0; background: none; color: var(--ink-faint); font: 600 13px/1.4 var(--sans); }
169
- .turn-tools button:hover:not(:disabled) { background: none; color: var(--ink); }
170
- .turn-tools .icon-btn { min-width: 0; }
171
- #exchanges .turn.current { background: var(--warn-bg); border-radius: 8px; }
172
- #exchanges .intervention:has(.turn.current) { border-color: var(--glow-dim); }
173
- #exchanges .turn .refs { align-items: center; }
174
- #exchanges .turn .ref { display: inline-block; max-width: calc(100% - 2em); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
175
- #exchanges .turn .ref .moment-letter { display: inline-grid; place-items: center; width: 1.4em; height: 1.4em; margin-right: 4px; border-radius: 50%; background: var(--glow-solid); color: var(--glow-on-solid); font: 700 11px/1 var(--sans); }
176
- #exchanges .turn .ref-unlink { min-height: 0; padding: 0 4px; border: 0; background: none; color: var(--ink-faint); font: 600 13px/1 var(--sans); }
177
- /* The questionnaire as a form: its sections one under the other, a question above its answer, the answer the width of the form. */
178
- .form-fields { display: grid; gap: 18px; }
179
- .form-intro, .form-source, .form-section-intro, .form-hint { margin: 0; color: var(--ink-dim); font: 400 14px/1.45 var(--sans); }
180
- .form-section { display: grid; gap: 14px; margin: 0; padding: 12px 14px 14px; border: 1px solid var(--line); border-radius: 8px; }
181
- .form-section > legend { padding: 0 6px; font: 600 15px/1.3 var(--sans); color: var(--ink); }
182
- .form-field { display: grid; gap: 6px; }
183
- .form-field > label { font: 600 14px/1.35 var(--sans); color: var(--ink); }
184
- .form-field .required { color: var(--ink-faint); }
185
- .form-field textarea { box-sizing: border-box; width: 100%; min-height: 4.5em; resize: vertical; }
186
- .form-field input:not([type="radio"]) { box-sizing: border-box; width: 100%; max-width: 32rem; }
187
- .form-choices { display: flex; flex-wrap: wrap; gap: 6px 16px; font: 400 14px/1.3 var(--sans); }
188
- .form-choices label { display: inline-flex; align-items: center; gap: 4px; }
189
- /* How a date or a time is said reads as part of its question, as in the case's date: a link, not a button. */
190
- .form-when-mode { min-height: 0; padding: 0; border: 0; background: none; color: inherit; font: 400 13px/1.3 var(--sans); text-decoration: underline;
191
- text-underline-offset: .15em; cursor: pointer; }
192
- .form-when-mode:disabled { text-decoration: none; cursor: default; }
193
- /* The questionnaire's pictures are drawn on white: on a dark page they keep the paper they were drawn for. */
194
- .form-figure { margin: 0; justify-self: start; max-width: min(100%, 16rem); }
195
- .form-figure img { display: block; max-width: 100%; height: auto; padding: 6px; border-radius: 6px; background: #fff; }
196
- #exchanges .sealed-open { grid-column: 2 / -1; display: grid; gap: 4px; justify-items: start; margin-top: 4px; }
197
- #exchanges .sealed-open .opened { margin: 0; padding: 4px 8px; border-left: 3px solid var(--glow-dim); background: var(--neutral-bg); }
198
- #exchanges .sealed-open .opened-note { margin: 0; color: var(--ink-faint); font: 400 12px/1.35 var(--sans); }
199
- #exchanges .sealed-open .opened-note:empty { display: none; }
200
- .form-confidential { margin: 0; padding-left: 22px; color: var(--ink-dim); font: 400 13px/1.4 var(--sans);
201
- background: no-repeat left 2px / 15px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23888' stroke-width='1.6'%3E%3Crect x='3' y='7' width='10' height='7' rx='1.5'/%3E%3Cpath d='M5.5 7V5a2.5 2.5 0 0 1 5 0v2'/%3E%3C/svg%3E"); }
202
- .form-confidential.nowhere { color: var(--warn, #b26b00); }
203
- .form-figure figcaption { margin-top: 4px; color: var(--ink-dim); font: 400 12px/1.35 var(--sans); }
204
- .form-feed { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; color: var(--ink-dim); font: 400 13px/1.4 var(--sans); }
205
- .turn-edit { display: flex; flex-direction: column; gap: 6px; }
206
- .turn-edit textarea { box-sizing: border-box; width: 100%; min-height: 6em; }
207
- .turn-edit .hint { font-size: 12px; color: var(--ink-faint); }
208
- .turn-edit .buttons { display: flex; gap: 8px; }
209
- </style>
210
- <div class="interview-app">
211
- <!-- The player: what plays the interview's recordings, with who speaks along it (see InterviewPlayer). -->
212
- <div id="player"></div>
213
- <div id="tabs" class="group-tabs">
214
- <button class="group-tab" type="button" aria-controls="group-summary" aria-expanded="true">${x.SUMMARY}<span id="label-summary-group"></span></button>
215
- <button id="form-tab" class="group-tab" type="button" aria-controls="group-form" aria-expanded="false" hidden>${x.SUMMARY}<span id="label-form-group"></span></button>
216
- <button class="group-tab" type="button" aria-controls="group-exchanges" aria-expanded="false">${x.INTERVIEW}<span id="label-exchanges-group"></span></button>
217
- <button class="group-tab" type="button" aria-controls="group-transcript" aria-expanded="false">${x.FILES}<span id="label-file-group"></span></button>
218
- </div>
219
- <section class="group-panel" id="group-summary" aria-labelledby="label-summary-group">
220
- <div class="row">
221
- <label class="fill"><span id="label-title"></span> <input id="title" type="text"/></label>
222
- </div>
223
- <div class="row">
224
- <fieldset id="witness" class="witnesses"><legend id="label-witness"></legend></fieldset>
225
- <label><span id="label-medium"></span> <select id="medium"></select></label>
226
- <label><span id="label-time"></span> <input id="time" type="text" size="16" placeholder="2026-10-13 21:27"/></label>
227
- <label><span id="label-by"></span> <input id="by" type="text" autocomplete="off" spellcheck="false"/></label>
228
- </div>
229
- <div class="row">
230
- <label class="wide"><span id="label-summary"></span> <textarea id="summary"></textarea></label>
231
- </div>
232
- </section>
233
- <section class="group-panel" id="group-form" aria-labelledby="label-form-group" hidden>
234
- <p id="form-note" class="file-note" role="status" hidden></p>
235
- <div id="form-fields" class="form-fields"></div>
236
- <div class="form-feed"><button id="form-feed" type="button" class="pill-btn primary"></button> <span id="form-feed-hint"></span></div>
237
- <p id="form-fed" class="file-note" role="status" hidden></p>
238
- </section>
239
- <section class="group-panel" id="group-exchanges" aria-labelledby="label-exchanges-group" hidden>
240
- <!-- Transcribing the recording (see TranscriptionProvider): what with, what it sends or downloads, how far it has got. -->
241
- <div id="transcribe" class="transcribe">
242
- <div class="transcribe-row">
243
- <span><button id="transcribe-start" type="button" class="pill-btn primary"></button> <span id="transcribe-hint"></span></span>
244
- <label><span id="label-transcribe-with"></span> <select id="transcribe-source"></select></label>
245
- <a id="transcribe-credit" class="source-credit" target="_blank" rel="noopener noreferrer"></a>
246
- <label id="transcribe-key-row" hidden><span id="label-transcribe-key"></span> <input id="transcribe-key" type="password" autocomplete="off" spellcheck="false"/> <a id="transcribe-key-get" class="source-credit" target="_blank" rel="noopener noreferrer"></a></label>
247
- <button id="transcribe-stop" type="button" class="pill-btn" hidden></button>
248
- </div>
249
- <p id="transcribe-note" class="transcribe-note" role="status"></p>
250
- <progress id="transcribe-progress" hidden></progress>
251
- </div>
252
- <div id="review" class="review" hidden></div>
253
- <div id="redact-pop" class="redact-pop" role="dialog" hidden>
254
- <label class="redact-reason"><span id="label-redact-reason"></span><input id="redact-reason" type="text" list="redact-reasons" autocomplete="off"/></label>
255
- <datalist id="redact-reasons"></datalist>
256
- <p id="redact-note" class="redact-note" role="status"></p>
257
- <div class="redact-actions">
258
- <button id="redact-restore" type="button" class="pill-btn"></button>
259
- <button id="redact-take" type="button" class="pill-btn primary"></button>
260
- </div>
261
- </div>
262
- <rr0-interview id="exchanges"></rr0-interview>
263
- </section>
264
- <section class="group-panel" id="group-transcript" aria-labelledby="label-file-group" hidden>
265
- <div class="row">
266
- <label class="fill"><span id="label-url"></span> <input id="url" type="text" autocomplete="off" spellcheck="false" placeholder="interview-….json"/></label>
267
- </div>
268
- <div class="row toolbar">
269
- <span class="input-file-row"><span id="label-import-file"></span> <rr0-input-file id="import" name="import" accept="application/json,.json,.txt,.md,.vtt,.srt,.csv,.tsv,text/*" placeholder="https://…/interview.json"></rr0-input-file></span>
270
- <button id="save" type="button"></button>
271
- </div>
272
- <p id="file-note" class="file-note" hidden role="status"></p>
273
- <div id="file-editor" class="file-editor"></div>
274
- </section>
275
- </div>
276
- `;class u extends HTMLElement{shadow=this.attachShadow({mode:"open"});get importInput(){return this.shadow.getElementById("import")}messages;said=new M(["en"]);language="en";localeToken=0;current;options=[];group="summary";base;text;fileEditor;fileEditorLoading;shownFor;ready=Promise.resolve();player;drawn;takenOut=new Map;redactTarget;exchangesShown=Promise.resolve();lastReason;static transcriptionSourceId=T[0].id;transcribing;constructor(){super(),this.shadow.innerHTML=Z,customElements.upgrade(this.shadow),this.importInput.build();for(const r of["title","time","by","url","summary","witness","medium"])this.shadow.getElementById(r).addEventListener(r==="witness"||r==="medium"?"change":"input",()=>this.write(r));for(const r of this.shadow.querySelectorAll("#tabs .group-tab"))r.addEventListener("click",()=>this.openGroup(u.GROUPS[r.getAttribute("aria-controls")]??"summary"));this.shadow.getElementById("url").addEventListener("change",()=>{this.shownFor=void 0,this.text===void 0&&this.group==="file"&&this.showTranscript()}),this.importInput.addEventListener("filepick",r=>{const i=r.detail;i.file?this.importFromFile(i.file):this.importFromUrl(i.url)}),this.shadow.getElementById("save").addEventListener("click",()=>this.save()),this.shadow.getElementById("form-feed").addEventListener("click",()=>this.feedObservation()),this.shadow.getElementById("transcribe-start").addEventListener("click",()=>void this.transcribe()),this.shadow.getElementById("transcribe-stop").addEventListener("click",()=>this.transcribing?.abort()),this.shadow.getElementById("transcribe-source").addEventListener("change",r=>{u.transcriptionSourceId=r.target.value,this.transcribeOutcome=void 0,this.renderTranscribe()}),this.shadow.getElementById("transcribe-key").addEventListener("input",r=>{A.set(u.transcriptionSourceId,r.target.value),this.renderTranscribeStart()});const e=this.shadow.getElementById("exchanges");e.addEventListener("pointerup",()=>setTimeout(()=>this.selectionMade(),0)),e.addEventListener("keyup",r=>{r.shiftKey&&this.selectionMade()}),e.addEventListener("click",r=>{const i=r.target.closest(".bar.redacted-label");i&&this.openBar(i)}),e.addEventListener("keydown",r=>{const i=r.target.closest(".bar.redacted-label");i&&(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),this.openBar(i))}),this.shadow.getElementById("redact-take").addEventListener("click",()=>void this.redactSelection()),this.shadow.getElementById("redact-restore").addEventListener("click",()=>{const r=this.redactTarget;this.closeRedactPop(),r?.kind==="bar"&&r.restorable&&this.restore(r.restorable)});const t=this.field("redact-reason");t.addEventListener("change",()=>{this.redactTarget?.kind==="bar"&&this.changeReason()}),t.addEventListener("keydown",r=>{r.key==="Escape"&&this.closeRedactPop(),r.key==="Enter"&&(r.preventDefault(),this.redactTarget?.kind==="selection"?this.redactSelection():this.changeReason().then(()=>this.closeRedactPop()))})}static GROUPS={"group-summary":"summary","group-form":"form","group-exchanges":"exchanges","group-transcript":"file"};static get observedAttributes(){return["readonly"]}attributeChangedCallback(){this.applyReadonly()}connectedCallback(){this.ready=this.loadLocale(),document.addEventListener("pointerdown",this.pressedElsewhere,!0)}pressedElsewhere=e=>{const t=this.shadow.getElementById("redact-pop");t&&!t.hidden&&!e.composedPath().includes(t)&&this.closeRedactPop()};disconnectedCallback(){document.removeEventListener("pointerdown",this.pressedElsewhere,!0),queueMicrotask(()=>{this.isConnected||this.releaseFileEditor()})}releaseFileEditor(){this.fileEditor&&(this.text=this.fileEditor.text,this.fileEditor.destroy(),this.fileEditor=void 0,this.fileEditorLoading=void 0,this.shownFor=void 0)}get event(){return this.current}set event(e){const t=e!==this.current;t&&(this.shownFor=void 0),this.current=e,this.render(),t&&this.heldThroughQuestionnaire?this.openGroup("form"):this.group==="form"&&(this.formShown=this.showForm()),this.takenOut.clear(),this.group==="file"&&this.showTranscript(),queueMicrotask(()=>{this.current===e&&this.showExchanges()})}set witnesses(e){this.options=e,this.render()}set documentUrl(e){this.base=e}get transcriptText(){return this.text}set transcriptText(e){this.text=e,this.shownFor=void 0}field(e){return this.shadow.getElementById(e)}async loadLocale(){const e=++this.localeToken,t=z.preferencesFor(this),r=Q(t,J),i=await j.load(r);e===this.localeToken&&(this.language=r,this.said=new M(t),this.messages=i,this.player||(this.player=new H(this.shadow.getElementById("player"),{timeChanged:s=>this.markCurrentTurn(s),recordingsChanged:s=>void this.editTranscript(n=>{s.length===0?delete n.recordings:n.recordings=s})},i),this.render()),this.render())}applyReadonly(){const e=this.hasAttribute("readonly");for(const t of["title","time","by","url","summary"])this.field(t).readOnly=e;for(const t of this.shadow.querySelectorAll("#witness input"))t.disabled=e;this.field("medium").disabled=e,this.importInput.disabled=e,this.renderTranscribe()}static byText(e){return(e??[]).map(t=>"people"in t?t.people:"org"in t?t.org:t.title??"").filter(t=>t!=="").join(", ")}render(){const e=this.messages;if(!e)return;const t=(l,p)=>{this.shadow.getElementById(l).textContent=p};t("label-summary-group",e.summaryTab),t("label-file-group",e.fileTab),t("label-exchanges-group",e.exchangesTab),t("label-form-group",e.questionnaireTab),t("form-feed",e.feed),R.say(this.shadow.getElementById("form-feed-hint"),"",e.feedHint);const r=this.shadow.getElementById("form-tab");r.hidden=!this.heldThroughQuestionnaire,!this.heldThroughQuestionnaire&&this.group==="form"&&this.openGroup("summary"),t("label-title",e.title),t("label-witness",e.witness),t("label-medium",e.medium),t("label-time",e.time),t("label-by",e.by),t("label-summary",e.summary),t("label-url",e.transcript),R.say(this.shadow.getElementById("label-import-file"),e.importFile,e.importFileHint),t("redact-take",e.redactSelection),t("redact-restore",e.redactRestore),t("label-redact-reason",e.redactReasonLabel);const i=this.field("redact-reason");i.placeholder=e.redactReason,i.title=e.redactReasonHint,t("transcribe-start",e.transcribe),this.shadow.getElementById("transcribe-hint").replaceChildren(R.of(e.transcribeHint)),t("label-transcribe-with",e.transcribeWith),t("label-transcribe-key",e.transcribeKey),t("transcribe-key-get",e.transcribeKeyGet),t("transcribe-stop",e.transcribeStop),this.field("transcribe-key").title=e.transcribeKeyHint,this.renderTranscribe(),this.player?.setMessages(e),this.importInput.messages=e,t("save",e.saveButton),this.field("url").title=e.transcriptHint,this.field("by").title=e.byHint;const s=this.current,n=this.shadow.activeElement,a=(l,p)=>{this.field(l)!==n&&(this.field(l).value=p)};a("title",this.said.read(s?.title)??""),a("time",s?.time??""),a("by",u.byText(s?.by)),a("url",s?.url??""),a("summary",this.said.read(s?.summary)??"");const d=[s?.interviewOf].flat().filter(l=>typeof l=="string"),h=this.shadow.getElementById("witness"),o=[...this.options,...d.filter(l=>!this.options.some(p=>p.id===l)).map(l=>({id:l,label:l}))];h.replaceChildren(h.querySelector("legend"),...o.map(l=>{const p=document.createElement("label"),g=document.createElement("input");return g.type="checkbox",g.value=l.id,g.checked=d.includes(l.id),p.append(g,l.label),p}));const c=this.shadow.getElementById("medium");if(c.replaceChildren(...N.ALL.map(l=>new Option(N.label(l,this.language),l))),s?.medium!==void 0&&!N.ALL.includes(s.medium)&&c.append(new Option(String(s.medium),String(s.medium))),s?.medium===void 0){const l=new Option(e.witnessNone,"");l.disabled=!0,l.hidden=!0,c.prepend(l)}c.value=s?.medium??"",this.applyReadonly()}write(e){const t=this.current;if(!t)return;const r=e==="witness"?"":this.field(e).value;switch(e){case"title":{const i=this.said.write(t.title,r,this.language);i===void 0?delete t.title:t.title=i;break}case"summary":{const i=this.said.write(t.summary,r,this.language);i===void 0?delete t.summary:t.summary=i;break}case"time":r.trim()===""?delete t.time:t.time=r.trim();break;case"url":r.trim()===""?delete t.url:t.url=r.trim();break;case"by":{const i=r.split(",").map(s=>s.trim()).filter(s=>s!=="");i.length===0?delete t.by:t.by=i.map(s=>({people:s}));break}case"witness":{const i=[...this.shadow.querySelectorAll("#witness input:checked")].map(s=>s.value);if(i.length===0){this.render();return}t.interviewOf=i.length===1?i[0]:i;break}case"medium":r===""?delete t.medium:t.medium=r;break}this.dispatchEvent(new CustomEvent(S,{bubbles:!0,composed:!0,detail:{field:e,event:t}})),e==="medium"&&this.render(),e!=="url"&&this.syncFileFromEvent()}openGroup(e){this.group=e;const t={summary:"group-summary",form:"group-form",exchanges:"group-exchanges",file:"group-transcript"};for(const r of this.shadow.querySelectorAll("#tabs .group-tab"))r.setAttribute("aria-expanded",String(r.getAttribute("aria-controls")===t[e]));for(const[r,i]of Object.entries(t))this.shadow.getElementById(i).hidden=r!==e;e==="file"&&this.showTranscript(),e==="exchanges"&&this.showExchanges(),e==="form"&&(this.formShown=this.showForm())}form;formToken=0;formShown=Promise.resolve();get heldThroughQuestionnaire(){return this.current?.medium==="questionnaire"}async showForm(){const e=this.current;if(!e||!this.heldThroughQuestionnaire)return;const t=++this.formToken,[{QuestionnaireForm:r},{QuestionnaireTemplates:i},s]=await Promise.all([b(()=>import("./QuestionnaireForm-ByFmq67M.js"),__vite__mapDeps([5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]),import.meta.url),b(()=>import("./CaseEditorElement-C5BHP8jT.js").then(c=>c.a),__vite__mapDeps([6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]),import.meta.url),this.transcriptJson(e)]);await this.ready;const n=s?.questionnaire?.id??i.DEFAULT,a=await i.load(n);if(t!==this.formToken||this.current!==e)return;const d=this.messages,h=this.shadow.getElementById("form-note");y.show(h,a?void 0:d.unknownQuestionnaire.replace("{id}",n),"warning"),this.form??=new r(this.shadow.getElementById("form-fields"),(c,l,p)=>void this.answerField(c,l,p)),this.form.show(a??{id:n,title:n,sections:[]},s,d.questionnaire,this.language,this.hasAttribute("readonly"),c=>this.confidentialAnswers.get(this.confidentialKey(e,c)));const o=this.shadow.getElementById("form-feed");o.disabled=this.hasAttribute("readonly")}async answerField(e,t,r){const{QuestionnaireTemplates:i}=await b(async()=>{const{QuestionnaireTemplates:o}=await import("./CaseEditorElement-C5BHP8jT.js").then(c=>c.a);return{QuestionnaireTemplates:o}},__vite__mapDeps([6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]),import.meta.url),s=this.current;if(!s)return;const n=await this.transcriptJson(s),a=await i.load(n?.questionnaire?.id??i.DEFAULT),d=a?i.field(a,e)?.confidential:void 0;let h;if(d){const o=this.confidentialKey(s,e),c=t.trim();if(c==="")this.confidentialAnswers.delete(o);else{this.confidentialAnswers.set(o,c);const l=n?.questionnaire?.recipient,{QuestionnaireSeal:p}=await b(async()=>{const{QuestionnaireSeal:g}=await import("./QuestionnaireSeal-DpZYUhnf.js");return{QuestionnaireSeal:g}},[],import.meta.url);h={reason:d.reason,...l?{sealed:await p.seal(c,l)}:{}}}}await this.editTranscript(o=>{if(a&&!o.segments.some(c=>c.field!==void 0)){const c=i.interview(a);o.segments=c.segments,o.questionnaire=c.questionnaire,c.language&&!o.language&&(o.language=c.language);for(const[l,p]of Object.entries(c.speakers))o.speakers[l]??=p}o.medium="questionnaire",i.answer(o,e,t,r,h)})}static openers=new Map;static openerFor(e){for(const t of P.point("sealed").sources){let r=u.openers.get(t);if(r||u.openers.set(t,r=t.create()),r.recipient===e)return{source:t,opener:r}}}offerOpening(e,t,r){const i=u.openerFor(r.for),s=this.current;if(!i||!s)return;const n=this.messages,a=t.field!==void 0?this.confidentialKey(s,t.field):void 0,d=document.createElement("div");d.className="sealed-open";const h=c=>{const l=document.createElement("p");l.className="opened",l.textContent=c;const p=document.createElement("p");p.className="opened-note",p.textContent=n.sealOpened.replace("{name}",i.source.name),d.replaceChildren(l,p)},o=a!==void 0?this.confidentialAnswers.get(a):void 0;if(o!==void 0)h(o);else{const c=document.createElement("button");c.type="button",c.className="pill-btn",c.textContent=n.sealOpen.replace("{name}",i.source.name),c.addEventListener("click",()=>{i.opener.open(r).then(p=>{p!==void 0&&(a!==void 0&&this.confidentialAnswers.set(a,p),h(p))},()=>y.show(l,n.sealFailed,"error"))});const l=document.createElement("p");l.className="opened-note",d.replaceChildren(c,l)}e.append(d)}confidentialAnswers=new Map;confidentialKey(e,t){return`${e.id??e.url??""}\0${t}`}feedObservation(){const e=this.current;e&&this.transcriptJson(e).then(t=>{const r=this.shadow.getElementById("form-fed"),i=s=>y.show(r,s>0?this.messages.fed.replace("{n}",String(s)):this.messages.fedNothing,s>0?"info":"warning");if(!t){i(0);return}this.dispatchEvent(new CustomEvent(K,{bubbles:!0,composed:!0,detail:{event:e,json:t,report:i}}))})}exchangesToken=0;async transcriptJson(e){try{const t=this.fileEditor?.text??this.text;if(t!==void 0)return w.read(JSON.parse(t));const r=this.transcriptUrl(e);if(r!==void 0)return w.read(await I.json(r))}catch{}}async showExchanges(){const e=this.current;if(!e)return;const t=++this.exchangesToken,r=await this.transcriptJson(e);await this.ready,!(t!==this.exchangesToken||this.current!==e)&&this.drawExchanges(r)}drawExchanges(e){const t=this.shadow.getElementById("exchanges");t.documentUrl=this.current?this.transcriptUrl(this.current):void 0,t.interview=e,this.drawn=e,this.player?.show(e,this.current?this.transcriptUrl(this.current):void 0),this.renderReview(e),this.renderRedactReasons(e),this.decorateExchanges(e),this.renderTranscribe()}async editTranscript(e){const t=this.current;if(!t||this.hasAttribute("readonly"))return;const r=await this.transcriptJson(t)??JSON.parse(this.template(t));Array.isArray(r.segments)||(r.segments=[]),e(r);const i=u.pretty(u.withEventFields(r,t));this.fileEditor?.replaceText(i,!1),this.onEdited(i),await this.exchangesShown}get redactReason(){return this.reasonOf(this.lastReason)}reasonOf(e){e=e?.trim()||this.messages.redactReason;const t=this.givenReasons(this.drawn).find(r=>this.said.read(r)===e);return t!==void 0?typeof t=="string"?t:{...t}:this.said.write(void 0,e,this.language)??e}givenReasons(e){const t=new Map;for(const r of e?.segments??[])for(const i of[r.redacted,...(r.parts??[]).map(s=>"redacted"in s?s.redacted:void 0)]){if(!i)continue;const s=JSON.stringify(i.reason),n=t.get(s);n?n.n++:t.set(s,{reason:i.reason,n:1})}return[...t.values()].sort((r,i)=>i.n-r.n).map(r=>r.reason)}renderRedactReasons(e){const t=this.messages;if(!t)return;const r=this.givenReasons(e).map(n=>this.said.read(n)??"").filter(n=>n!==""),i=t.redactReasons.filter(n=>!r.some(a=>a.toLowerCase().startsWith(n.toLowerCase()))),s=[...new Set([...r,...i])];this.shadow.getElementById("redact-reasons").replaceChildren(...s.map(n=>new Option(n,n)))}speakerLabel(e,t){const r=w.speakerName(e,t),i=e.speakers?.[t]?.role;return i===w.UNATTRIBUTED&&e.speakers[t].title?this.messages.voiceNamed.replace("{name}",r):r===i&&i in this.messages.roles?this.messages.roles[i]:r}renderReview(e){const t=this.shadow.getElementById("review"),r=Object.entries(e?.speakers??{}).filter(([,d])=>d.role!==w.UNATTRIBUTED).map(([d])=>d);if(t.hidden=!e||r.length===0,!e||r.length===0)return;const i=d=>["approved","covered"].includes(e.proofreading?.[d]?.status??""),s=r.filter(d=>!i(d)),n=document.createElement("span");n.textContent=s.length===0?this.messages.proofreadAll:this.messages.proofreadPending.replace("{names}",s.map(d=>this.speakerLabel(e,d)).join(", ")),t.toggleAttribute("data-done",s.length===0);const a=document.createElement("span");a.className="review-boxes";for(const d of r){const h=document.createElement("label"),o=document.createElement("input");o.type="checkbox",o.checked=i(d),o.disabled=this.hasAttribute("readonly"),o.addEventListener("change",()=>void this.editTranscript(c=>{c.proofreading??={},o.checked?c.proofreading[d]={status:"approved",date:new Date().toISOString().slice(0,10)}:c.proofreading[d]={status:"pending"}})),h.append(o,this.messages.reviewedBy.replace("{name}",this.speakerLabel(e,d))),a.append(h)}t.replaceChildren(n,a)}momentsOf(e,t){const r=e.speakers?.[t]?.of??w.sightingsOf(e)[0];return this.options.find(i=>i.id===r)?.moments??this.options.flatMap(i=>i.moments??[])}decorateExchanges(e){if(!e)return;const t=this.messages,r=this.hasAttribute("readonly");for(const i of this.shadow.querySelectorAll("#exchanges .turn[data-segment]")){const s=Number(i.dataset.segment),n=e.segments[s];if(!n)continue;if(n.start!==void 0){const o=document.createElement("button");o.type="button",o.className="turn-time",o.textContent=w.clock(n.start),o.addEventListener("click",()=>this.player?.seek(n.start)),i.prepend(o)}const a=n.redacted?[n.redacted]:f.partsOf(n).flatMap(o=>"redacted"in o?[o.redacted]:[]);i.querySelectorAll(".bar").forEach((o,c)=>{const l=a[c]?.words;o.textContent=l!==void 0?t.redactedWords.replace("{n}",String(l)):t.redacted,o.classList.add("redacted-label");const p=n.redacted?`${s}:all`:`${s}:${c}`;this.takenOut.has(p)&&(o.dataset.restorable=p)});const d=n.redacted?.sealed;d&&this.offerOpening(i,n,d);const h=this.momentsOf(e,n.speaker);i.querySelectorAll(".ref").forEach((o,c)=>{const l=n.refs?.[c];if(!l)return;const p=h.find(m=>Math.abs(m.at-l.at)<.05);if(p){const m=document.createElement("span");m.className="moment-letter",m.textContent=p.label.slice(0,2),o.replaceChildren(m,t.momentLabel.replace("{k}",p.label).replace("{text}",p.note??w.clock(l.at)))}if(r)return;const g=document.createElement("button");g.type="button",g.className="ref-unlink",g.textContent="×",g.title=t.unlinkMoment,g.setAttribute("aria-label",t.unlinkMoment),g.addEventListener("click",()=>void this.editTranscript(m=>{m.segments[s].refs?.splice(c,1),m.segments[s].refs?.length===0&&delete m.segments[s].refs})),o.after(g)}),r||i.append(this.turnTools(e,s,n,h))}}turnTools(e,t,r,i){const s=this.messages,n=document.createElement("div");n.className="turn-tools";const a=(o,c)=>{const l=document.createElement("button");return l.type="button",l.textContent=o,l.addEventListener("click",c),l};if(e.speakers?.[r.speaker]?.role==="witness"&&!r.redacted){const o=a(s.linkMoment,()=>{});n.append(o),new F(o,`moment-menu-${t}`,l=>void this.editTranscript(p=>{const g=p.segments[t].refs??[];g.some(m=>Math.abs(m.at-Number(l))<.05)||g.push({at:Number(l)}),p.segments[t].refs=g}),l=>`moment-${t}-${l}`).setKinds(i.length>0?i.map(l=>({value:String(l.at),label:s.momentLabel.replace("{k}",l.label).replace("{text}",l.note??w.clock(l.at))})):[{value:"",label:s.noMoments,disabledReason:s.noMoments}])}if(r.redacted||n.append(a(s.editTurn,()=>this.editTurn(t))),!r.redacted&&!this.hasAttribute("readonly")){const o=a(s.whoSpeaks,()=>{});n.append(o),new F(o,`speaker-menu-${t}`,l=>void b(async()=>{const{InterviewImport:p}=await import("./interviewImport-ym5iXO4Z.js");return{InterviewImport:p}},__vite__mapDeps([26,25,7]),import.meta.url).then(({InterviewImport:p})=>this.editTranscript(g=>{p.attribute(g,t,l)})),l=>`speaker-${t}-${l}`).setKinds(Object.keys(e.speakers??{}).map(l=>({value:l,label:this.speakerLabel(e,l),...l===r.speaker?{disabledReason:this.speakerLabel(e,l)}:{}})))}const d=this.takenOut.has(`${t}:all`)||[...this.takenOut.keys()].some(o=>o.startsWith(`${t}:`));if(r.redacted||r.parts&&d){const o=a(s.restoreAll,()=>void this.restoreAll(t));o.disabled=!d,n.append(o)}else n.append(a(s.redactAll,()=>void this.editTranscript(o=>{this.forget(t),this.takenOut.set(`${t}:all`,f.redactWhole(o.segments[t],this.redactReason))}).then(()=>{const o=this.shadow.querySelector(`#exchanges .turn[data-segment="${t}"] .bar.redacted-label`);o&&this.openBar(o)})));const h=a("",()=>void this.editTranscript(o=>{o.segments.splice(t,1),this.shiftTakenOut(t)}));return h.className="icon-btn",h.innerHTML=x.TRASH,h.title=s.deleteTurn,h.setAttribute("aria-label",s.deleteTurn),n.append(h),n}selectionMade(){const e=this.messages;if(!e||this.hasAttribute("readonly"))return;const t=this.shadow.getSelection?.()??document.getSelection(),r=t&&t.rangeCount>0?t.getRangeAt(0):void 0,i=this.shadow.getElementById("exchanges");if(!r||r.collapsed||!i.contains(r.startContainer)||!i.contains(r.endContainer))return;const s=l=>l instanceof Element?l:l.parentElement,n=s(r.startContainer)?.closest(".said");if(!n&&!s(r.endContainer)?.closest(".said"))return;const a=n&&s(r.endContainer)?.closest(".said")===n&&!s(r.startContainer)?.closest(".bar")&&!s(r.endContainer)?.closest(".bar"),d=r.getBoundingClientRect();if(!a){this.openRedactPop({kind:"selection",index:-1,from:0,to:0},d,e.selectionOnePassage);return}const h=Number(n.closest(".turn").dataset.segment),o=u.offsetIn(n,r.startContainer,r.startOffset),c=u.offsetIn(n,r.endContainer,r.endOffset);this.openRedactPop({kind:"selection",index:h,from:Math.min(o,c),to:Math.max(o,c)},d),u.markPending(r)}static PENDING="rr0-redact-pending";static markPending(e){const t=globalThis.CSS?.highlights,r=globalThis.Highlight;!t||!r||(e?t.set(u.PENDING,new r(e.cloneRange())):t.delete(u.PENDING))}openBar(e){if(this.hasAttribute("readonly"))return;const t=e.closest(".turn");if(!t)return;const r=Number(t.dataset.segment),i=[...t.querySelectorAll(".bar")].indexOf(e),s=this.drawn?.segments[r];if(!s)return;const n=s.redacted?"all":i,a=`${r}:${n}`;this.openRedactPop({kind:"bar",index:r,nth:n,restorable:this.takenOut.has(a)?a:void 0},e.getBoundingClientRect())}openRedactPop(e,t,r){const i=this.shadow.getElementById("redact-pop"),s=this.field("redact-reason");u.markPending(),this.redactTarget=e;const n=this.shadow.getElementById("redact-take"),a=this.shadow.getElementById("redact-restore");n.hidden=e.kind!=="selection",n.disabled=!!r,a.hidden=e.kind!=="bar"||!e.restorable,s.disabled=!!r,s.value=e.kind==="bar"?this.said.read(this.redactionAt(this.drawn,e.index,e.nth)?.reason)??"":this.lastReason??"";const d=this.shadow.getElementById("redact-note");d.textContent=r??"",d.classList.toggle("error",!!r),i.hidden=!1,typeof i.showPopover=="function"&&i.isConnected&&(i.setAttribute("popover","manual"),i.matches(":popover-open")||i.showPopover());const h=i.offsetWidth||320,o=i.offsetHeight||120,c=t.bottom+6+o<=window.innerHeight;i.style.top=`${Math.max(8,c?t.bottom+6:t.top-6-o)}px`,i.style.left=`${Math.max(8,Math.min(t.left,window.innerWidth-h-8))}px`,r||s.focus({preventScroll:!0})}closeRedactPop(){const e=this.shadow.getElementById("redact-pop");this.redactTarget=void 0,u.markPending(),typeof e.hidePopover=="function"&&e.matches?.(":popover-open")&&e.hidePopover(),e.hidden=!0}redactionAt(e,t,r){const i=e?.segments[t];if(i)return r==="all"?i.redacted:f.partsOf(i).flatMap(s=>"redacted"in s?[s.redacted]:[])[r]}async changeReason(){const e=this.redactTarget;if(e?.kind!=="bar")return;const t=this.reasonOf(this.field("redact-reason").value),r=this.redactionAt(this.drawn,e.index,e.nth);!r||JSON.stringify(r.reason)===JSON.stringify(t)||await this.editTranscript(i=>{if(e.nth!=="all"){const n=this.redactionAt(i,e.index,e.nth);n&&(n.reason=t);return}const s=JSON.stringify(i.segments[e.index].redacted?.reason);for(let n=e.index;n<i.segments.length;n++){const a=i.segments[n].redacted;if(!a||n>e.index&&JSON.stringify(a.reason)!==s)break;a.reason=t}})}async redactSelection(){const e=this.messages,t=this.redactTarget;if(t?.kind!=="selection"||t.index<0)return;this.lastReason=this.field("redact-reason").value.trim()||void 0;const r=this.redactReason;let i=!1;if(await this.editTranscript(s=>{const n=f.redact(s.segments[t.index],t.from,t.to,r);n&&(i=!0,this.shiftParts(t.index,n.nth),this.takenOut.set(`${t.index}:${n.nth}`,n.text))}),!i){const s=this.shadow.getElementById("redact-note");s.textContent=e.selectionOnePassage,s.classList.add("error");return}this.closeRedactPop(),(this.shadow.getSelection?.()??document.getSelection())?.removeAllRanges()}static offsetIn(e,t,r){let i=0;const s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:n=>n.parentElement?.closest(".bar")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});for(let n=s.nextNode();n;n=s.nextNode()){if(n===t)return i+r;if(t.contains(n)&&t!==n){const d=[...t.childNodes].slice(0,r);return i+d.reduce((h,o)=>h+(o instanceof Element&&o.closest(".bar")?0:(o.textContent??"").length),0)}i+=(n.textContent??"").length}return i}async restore(e){const t=this.takenOut.get(e);if(t===void 0)return;const[r,i]=e.split(":"),s=Number(r);await this.editTranscript(n=>{i==="all"?f.restoreWhole(n.segments[s],t):(f.restorePart(n.segments[s],Number(i),t),this.shiftParts(s,Number(i),-1)),this.takenOut.delete(e)})}async restoreAll(e){if(this.takenOut.has(`${e}:all`)){await this.restore(`${e}:all`);return}const t=[...this.takenOut.keys()].filter(r=>r.startsWith(`${e}:`)).map(r=>Number(r.split(":")[1])).sort((r,i)=>i-r);for(const r of t)await this.restore(`${e}:${r}`)}editTurn(e){const r=this.drawn?.segments[e],i=this.shadow.querySelector(`#exchanges .turn[data-segment="${e}"] .said`);if(!r||!i)return;const s=this.messages,n=document.createElement("div");n.className="turn-edit";const a=document.createElement("textarea");a.value=f.raw(r,l=>this.takenOut.get(`${e}:${l}`));const d=document.createElement("span");d.className="hint",d.textContent=s.turnEditHint;const h=document.createElement("div");h.className="buttons";const o=document.createElement("button");o.type="button",o.className="pill-btn primary",o.textContent=s.saveTurn,o.addEventListener("click",()=>void this.editTranscript(l=>{const p=f.fromRaw(l.segments[e],a.value,this.redactReason);this.forget(e);for(const[g,m]of p)this.takenOut.set(`${e}:${g}`,m)}));const c=document.createElement("button");c.type="button",c.className="pill-btn",c.textContent=s.cancelTurn,c.addEventListener("click",()=>this.drawExchanges(this.drawn)),h.append(o,c),n.append(a,d,h),i.replaceWith(n),a.focus()}forget(e){for(const t of[...this.takenOut.keys()])t.startsWith(`${e}:`)&&this.takenOut.delete(t)}shiftParts(e,t,r=1){const i=[...this.takenOut].filter(([s])=>s.startsWith(`${e}:`)&&s!==`${e}:all`&&Number(s.split(":")[1])>=t+(r<0?1:0));for(const[s]of i)this.takenOut.delete(s);for(const[s,n]of i)this.takenOut.set(`${e}:${Number(s.split(":")[1])+r}`,n)}shiftTakenOut(e){const t=[...this.takenOut];this.takenOut.clear();for(const[r,i]of t){const[s,n]=r.split(":"),a=Number(s);a<e?this.takenOut.set(r,i):a>e&&this.takenOut.set(`${a-1}:${n}`,i)}}markCurrentTurn(e){const t=this.drawn?.segments??[];let r=-1;t.forEach((n,a)=>{n.start!==void 0&&n.start<=e&&(r=a)});for(const n of this.shadow.querySelectorAll("#exchanges .turn.current"))n.classList.remove("current");const i=this.shadow.querySelector(`#exchanges .turn[data-segment="${r}"]`);if(!i)return;i.classList.add("current");const s=i.closest(".rr0-interview-turns");s&&(i.offsetTop<s.scrollTop||i.offsetTop>s.scrollTop+s.clientHeight-i.offsetHeight)&&s.scrollTo({top:i.offsetTop-s.clientHeight/3,behavior:"smooth"})}async revealSegment(e){this.openGroup("exchanges"),await this.showExchanges(),this.shadow.getElementById("exchanges").revealSegment(e)}transcribeOutcome;renderTranscribe(){this.shadow.getElementById("transcribe").hidden=this.hasAttribute("readonly")||!this.transcribing&&!this.player?.recordingUrl();const e=this.messages;if(!e)return;const t=this.shadow.getElementById("transcribe-source");[...t.options].map(o=>o.value).join()!==T.map(o=>o.id).join()&&t.replaceChildren(...T.map(o=>{const c=new Option(o.name,o.id);return c.title=o.credit,c}));const r=O(T,u.transcriptionSourceId);t.value=r.id;const i=this.shadow.getElementById("transcribe-credit");i.href=r.creditUrl,i.textContent=r.credit,this.shadow.getElementById("transcribe-key-row").hidden=!r.keyUrl,this.shadow.getElementById("transcribe-key-get").href=r.keyUrl??"";const s=this.field("transcribe-key");if(s!==this.shadow.activeElement&&(s.value=A.of(r.id)??""),this.transcribing)return;const n=this.player?.recordingUrl();this.renderTranscribeStart();const a=this.shadow.getElementById("transcribe-note");if(this.transcribeOutcome){y.show(a,this.transcribeOutcome.text,this.transcribeOutcome.kind);return}if(!n){y.show(a,e.transcribeNoRecording);return}const d=r.create(),h=[d.sendsAudio?e.transcribeSends.replace("{name}",r.name):e.transcribeLocal.replace("{mb}",String(Math.round((d.downloadBytes??0)/1e6)))];(this.drawn?.segments?.length??0)>0&&h.push(e.transcribeReplaces),y.show(a,h.join(" "),d.sendsAudio?"warning":"info")}renderTranscribeStart(){if(this.transcribing||!this.messages)return;const e=O(T,u.transcriptionSourceId),t=this.shadow.getElementById("transcribe-start");t.disabled=!!e.keyUrl&&!A.of(e.id),t.title=t.disabled?this.messages.transcribeErrors.noKey:""}showTranscribing(e){this.shadow.getElementById("transcribe-start").disabled=e,this.shadow.getElementById("transcribe-stop").hidden=!e,this.shadow.getElementById("transcribe-source").disabled=e,this.field("transcribe-key").disabled=e,this.shadow.getElementById("transcribe-progress").hidden=!e}showProgress(e){const t=this.messages,r=this.shadow.getElementById("transcribe-note"),i=this.shadow.getElementById("transcribe-progress"),s=n=>String(Math.round(n/1e6));if(e==="reading")i.removeAttribute("value"),y.show(r,t.transcribeReading);else if(e.stage==="loading")e.total?(i.max=e.total,i.value=e.loaded,y.show(r,t.transcribeLoading.replace("{loaded}",s(e.loaded)).replace("{total}",s(e.total)))):(i.removeAttribute("value"),y.show(r,t.transcribeLoadingSoFar.replace("{loaded}",s(e.loaded))));else if(e.stage==="sending"||e.stage==="waiting"){i.removeAttribute("value");const n=O(T,u.transcriptionSourceId).name;y.show(r,(e.stage==="sending"?t.transcribeSending:t.transcribeWaiting).replace("{name}",n))}else i.max=e.total,i.value=e.done,y.show(r,t.transcribeProgress.replace("{done}",w.clock(Math.round(e.done))).replace("{total}",w.clock(Math.round(e.total))))}async transcribe(){const e=this.messages,t=this.current,r=this.player?.recordingUrl();if(!e||!t||this.transcribing||this.hasAttribute("readonly"))return;if(!r){this.player?.showWindow();return}const i=O(T,u.transcriptionSourceId),s=i.create(),n=this.transcribing=new AbortController;this.transcribeOutcome=void 0,this.showTranscribing(!0),this.showProgress("reading");try{const[{TranscriptionAudio:a},{TranscriptionError:d},{InterviewImport:h}]=await Promise.all([b(()=>import("./TranscriptionAudio-C_xvRUv2.js"),[],import.meta.url),b(()=>import("./TranscriptionError-D_TCbYbt.js"),[],import.meta.url),b(()=>import("./interviewImport-ym5iXO4Z.js"),__vite__mapDeps([26,25,7]),import.meta.url)]),o=await fetch(r,{signal:n.signal});if(!o.ok)throw new d("failed",`HTTP ${o.status}`);if(Number(o.headers.get("content-length")??0)>a.MAX_BYTES)throw new d("tooLarge");const c=await o.arrayBuffer();if(c.byteLength>a.MAX_BYTES)throw new d("tooLarge");const l=await a.decode(c).catch(()=>{throw new d("failed",e.loadFailed)}),p=this.drawn?.language??this.language,g=await s.transcribe({samples:l,language:p,signal:n.signal,progress:k=>this.showProgress(k)}),m=[t.interviewOf].flat().filter(k=>typeof k=="string"),v=h.transcribed(g,{by:(t.by??[]).flatMap(k=>"people"in k?[k.people]:[]),witnesses:this.options.filter(k=>m.length===0||m.includes(k.id)).map(({id:k,label:W})=>({id:k,label:W}))});if(!v)throw new d("failed",e.exchangesEmpty);if(n.signal.aborted||this.current!==t)throw new DOMException("Aborted","AbortError");const{anonymization:ee,...D}=await this.transcriptJson(t)??{};await this.take({...D,...v,language:p,transcription:{method:"automatic",engine:s.engine,note:`Transcribed in UFO@home by ${s.engine}: whose each voice is was not known, to be attributed, then proofread.`}}),this.transcribeOutcome={text:e.transcribeDone.replace("{engine}",i.name),kind:"info"}}catch(a){const d=a;n.signal.aborted||d?.name==="AbortError"?this.transcribeOutcome={text:e.transcribeStopped,kind:"info"}:d?.name==="TranscriptionError"&&d.code?this.transcribeOutcome={text:e.transcribeErrors[d.code].replace("{detail}",d.detail??""),kind:"error"}:this.transcribeOutcome={text:e.transcribeErrors.failed.replace("{detail}",String(d?.message??a)),kind:"error"}}finally{this.transcribing=void 0,this.showTranscribing(!1),this.renderTranscribe()}}note(e,t="info"){y.show(this.shadow.getElementById("file-note"),e,t)}transcriptUrl(e){return e.url?new URL(e.url,this.base??location.href).href:void 0}static pretty(e){return JSON.stringify(e,null,2)+`
277
- `}static SHARED=["title","time","medium","by","interviewOf","summary"];static ORDER=["version","id","language","title","time","medium","by","interviewOf","summary","speakers","transcription","proofreading","anonymization","recordings","segments"];static ordered(e){const t={};for(const r of u.ORDER)r in e&&(t[r]=e[r]);for(const r of Object.keys(e))r in t||(t[r]=e[r]);return t}static witnessesOf(e){return[e].flat().filter(t=>typeof t=="string")}static withEventFields(e,t){const r={...e};for(const s of u.SHARED)t[s]===void 0?delete r[s]:r[s]=structuredClone(t[s]);const i=r.speakers;if(typeof i=="object"&&i!==null){const s={...i},n=(a,d,h)=>{h.forEach((o,c)=>{const l=c===0?a:`${a}${c+1}`;s[l]?s[l]={...s[l],[d]:o}:c>0&&(s[l]={role:a,[d]:o})})};n("interviewer","by",t.by??[]),n("witness","of",u.witnessesOf(t.interviewOf)),r.speakers=s}return u.ordered(r)}applyFileToEvent(e,t){const r=this.current;if(!r)return!1;const i=JSON.stringify(u.SHARED.map(a=>r[a])),s=a=>typeof a=="string"||typeof a=="object"&&a!==null&&!Array.isArray(a),n={title:s,summary:s,time:a=>typeof a=="string",medium:a=>typeof a=="string",by:a=>Array.isArray(a),interviewOf:a=>typeof a=="string"||Array.isArray(a)};for(const a of u.SHARED){const d=e[a];d!==void 0&&n[a](d)?r[a]=structuredClone(d):t&&delete r[a]}return JSON.stringify(u.SHARED.map(a=>r[a]))!==i}syncFileFromEvent(){const e=this.current,t=this.fileEditor?.text??this.text;if(!e||t===void 0)return;let r;try{r=JSON.parse(t)}catch{return}if(typeof r!="object"||r===null||Array.isArray(r))return;const i=u.pretty(u.withEventFields(r,e));i!==t&&(this.text=i,this.fileEditor?.replaceText(i,!1),this.dispatchEvent(new CustomEvent(S,{bubbles:!0,composed:!0,detail:{field:"transcript",event:e,text:i}})))}template(e){return u.pretty(u.withEventFields({version:1,language:this.language,speakers:{interviewer:{role:"interviewer"},witness:{role:"witness"}},segments:[]},e))}loadFileEditor(e){return this.fileEditorLoading??=(async()=>{try{const[{SightingFileEditor:t},{default:r},i]=await Promise.all([b(()=>import("./SightingFileEditor-DS1DRU2p.js"),__vite__mapDeps([27,28,29]),import.meta.url),b(()=>import("./interviewSchema-DRWvRSL2.js"),[],import.meta.url),G(this.language)]);return this.fileEditor=new t(this.shadow.getElementById("file-editor"),e,s=>this.onEdited(s),this.messages.editorLabel,{baseline:e,phrases:i.fileSearchPhrases,schema:r}),this.fileEditor}catch(t){throw this.fileEditorLoading=void 0,t}})(),this.fileEditorLoading}async showTranscript(){const e=this.current;if(!e||this.shownFor===e)return;this.note(this.messages.loading);let t=this.text;if(t===void 0){const r=this.transcriptUrl(e);if(r!==void 0)try{const i=await I.json(r);this.current===e&&typeof i=="object"&&i!==null&&!Array.isArray(i)?(this.applyFileToEvent(i,!1)&&this.fileChangedEvent(),t=u.pretty(u.withEventFields(i,e))):t=u.pretty(i)}catch{this.note(this.messages.loadFailed,"error")}t??=this.template(e)}if(this.current===e)try{const r=await this.loadFileEditor(t);if(this.current!==e)return;r.replaceText(t,!1),this.shownFor=e,this.text!==void 0||this.transcriptUrl(e)===void 0?this.note(void 0):this.shadow.getElementById("file-note").textContent===this.messages.loading&&this.note(void 0)}catch{this.note(this.messages.loadFailed,"error")}}onEdited(e){this.text=e;let t,r=!0;try{t=JSON.parse(e)}catch{r=!1}this.note(r?void 0:this.messages.invalid,"error");const i=this.current;if(r&&i&&typeof t=="object"&&t!==null&&!Array.isArray(t)&&this.applyFileToEvent(t,!0)&&this.fileChangedEvent(),i&&!i.url&&e.trim()!==""){const s=i.id??"1";i.url=`${s.startsWith("interview")?s:`interview-${s}`}.json`,this.field("url").value=i.url,this.dispatchEvent(new CustomEvent(S,{bubbles:!0,composed:!0,detail:{field:"url",event:i}}))}this.dispatchEvent(new CustomEvent(S,{bubbles:!0,composed:!0,detail:{field:"transcript",event:i,text:e}})),this.exchangesShown=this.showExchanges()}fileChangedEvent(){this.render(),this.dispatchEvent(new CustomEvent(S,{bubbles:!0,composed:!0,detail:{field:"file",event:this.current}}))}async take(e){if(typeof e!="object"||e===null||!Array.isArray(e.segments)){this.note(this.messages.notATranscript,"error");return}const t=this.current;t&&this.applyFileToEvent(e,!1)&&this.fileChangedEvent();const r=u.pretty(t?u.withEventFields(e,t):e);await this.loadFileEditor(r).then(i=>i.replaceText(r,!1),()=>{}),this.shownFor=this.current,this.note(void 0),this.onEdited(r)}async importFromFile(e){try{const t=await e.text();let r;try{r=JSON.parse(t)}catch{r=void 0}const i=this.importHints();if(this.isQuestionnaire(r)){await this.takeQuestionnaire(r??t,e.name);return}if(typeof r!="object"||r===null){const{InterviewImport:s}=await b(async()=>{const{InterviewImport:a}=await import("./interviewImport-ym5iXO4Z.js");return{InterviewImport:a}},__vite__mapDeps([26,25,7]),import.meta.url),n=s.parse(t,i);r=n&&{...n,transcription:{note:`Imported from ${e.name}: who speaks and when are as the file gave them, to be checked.`}}}r===void 0?this.note(this.messages.notATranscript,"error"):await this.take(r)}catch{this.note(this.messages.loadFailed,"error")}}importHints(){const e=this.current,t=[e?.interviewOf].flat().filter(r=>typeof r=="string");return{by:(e?.by??[]).map(r=>u.byText([r])).filter(r=>r!==""),witnesses:this.options.filter(r=>t.length===0||t.includes(r.id))}}isQuestionnaire(e){const t=typeof e=="object"&&e!==null&&Array.isArray(e.segments);return this.current?.medium==="questionnaire"&&!t}async takeQuestionnaire(e,t){const[{QuestionnaireImport:r},{QuestionnaireTemplates:i}]=await Promise.all([b(()=>import("./QuestionnaireImport-Cx1dQiha.js"),__vite__mapDeps([30,25,7,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]),import.meta.url),b(()=>import("./CaseEditorElement-C5BHP8jT.js").then(d=>d.a),__vite__mapDeps([6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]),import.meta.url)]),s=this.current?await this.transcriptJson(this.current):void 0,n=await i.load(s?.questionnaire?.id??i.DEFAULT),a=r.parse(e,this.importHints(),n);if(!a){this.note(this.messages.notAQuestionnaire,"error");return}await this.take({...a,transcription:{method:"manual",note:`Imported from ${t}: one question and its answer per field, as the witness filled it in.`}})}async importFromUrl(e){try{const t=new URL(e,this.base??location.href).href,r=await I.json(t);this.isQuestionnaire(r)?await this.takeQuestionnaire(r,t.split("/").pop()??t):await this.take(r)}catch{this.note(this.messages.loadFailed,"error")}}save(){const e=this.fileEditor?.text??this.text;if(e===void 0)return;const t=(this.current?.url??"").split("/").pop()||`${this.current?.id??"interview"}.json`,r=URL.createObjectURL(new Blob([e],{type:"application/json"})),i=document.createElement("a");i.href=r,i.download=t,i.click(),URL.revokeObjectURL(r)}}function Ee(){Y(),V(),customElements.get(q)||customElements.define(q,u)}export{S as INTERVIEW_CHANGE_EVENT,q as INTERVIEW_EDITOR_ELEMENT_NAME,Se as INTERVIEW_SEEK_EVENT,u as InterviewEditorElement,Ee as register};