@rr0/ufoathome 0.134.0 → 0.135.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-embed-interview/rr0-interview.mjs +6 -6
- package/dist-embed-scene/rr0-scene.mjs +266 -266
- package/dist-embed-scene/sightingSchema-DqeNTmuQ.js +1 -0
- package/dist-embed-sighting/{SightingMessages_es-CxoccMw6.js → SightingMessages_es-Cck_4IWk.js} +1 -1
- package/dist-embed-sighting/{SightingMessages_fr-CdqAz1Hz.js → SightingMessages_fr-C3wmZbM0.js} +1 -1
- package/dist-embed-sighting/{SightingMessages_it-CkQVXDPv.js → SightingMessages_it-DCQUpWk8.js} +1 -1
- package/dist-embed-sighting/rr0-sighting.mjs +286 -279
- package/dist-embed-sighting/sightingSchema-DqeNTmuQ.js +1 -0
- package/dist-embed-sighting-editor/{AdsbLolArchiveProvider-DU2U8NdB.js → AdsbLolArchiveProvider-De-_PiBH.js} +1 -1
- package/dist-embed-sighting-editor/BeamSystem-YGYbbAkU.js +1 -0
- package/dist-embed-sighting-editor/{CaseEditorMessages_es-BrH54rIz.js → CaseEditorMessages_es-DUelIN8x.js} +1 -1
- package/dist-embed-sighting-editor/{CaseEditorMessages_fr-DF-qjRtx.js → CaseEditorMessages_fr-BppxXK1E.js} +1 -1
- package/dist-embed-sighting-editor/{CaseEditorMessages_it-Cb_U9B3i.js → CaseEditorMessages_it-BIYStAk9.js} +1 -1
- package/dist-embed-sighting-editor/ContrailSystem-CyYvtUTV.js +1 -0
- package/dist-embed-sighting-editor/{CoverageAssessor-DXVjXoUX.js → CoverageAssessor-DbLjQSsv.js} +1 -1
- package/dist-embed-sighting-editor/GLTFLoader-Clgrcwp4.js +1 -0
- package/dist-embed-sighting-editor/HeadlightSystem-wFRogS2e.js +34 -0
- package/dist-embed-sighting-editor/{HynekAssessor-Bc2SulU3.js → HynekAssessor-C6Lge7G-.js} +1 -1
- package/dist-embed-sighting-editor/{InterviewEditorElement-bUyn6irj.js → InterviewEditorElement-DzxGD2_i.js} +6 -6
- package/dist-embed-sighting-editor/ModelSource-D9Q4lorr.js +1 -0
- package/dist-embed-sighting-editor/{ModelThumbnails-CYHW7hxV.js → ModelThumbnails-DO6uXzoW.js} +1 -1
- package/dist-embed-sighting-editor/{ModelViewer-BzHV3bjz.js → ModelViewer-Ct9JM_Rx.js} +1 -1
- package/dist-embed-sighting-editor/RailwaySystem-CNhqPQHR.js +41 -0
- package/dist-embed-sighting-editor/{RoadMarkings-BWoz2Cuq.js → RoadMarkings-xnEtzMn8.js} +1 -1
- package/dist-embed-sighting-editor/{SightingEditorMessages_es-pgii85sY.js → SightingEditorMessages_es-BFzjoSef.js} +1 -1
- package/dist-embed-sighting-editor/{SightingEditorMessages_fr-BysKDyGf.js → SightingEditorMessages_fr-90Ojknvv.js} +1 -1
- package/dist-embed-sighting-editor/{SightingEditorMessages_it-DOnHDjjj.js → SightingEditorMessages_it-BtQIjKie.js} +2 -2
- package/dist-embed-sighting-editor/{SightingFileEditor-LAzFduCJ.js → SightingFileEditor-B6vMDoEQ.js} +1 -1
- package/dist-embed-sighting-editor/{TraceSystem-Dgxizn7s.js → TraceSystem-CArVw3Pm.js} +2 -2
- package/dist-embed-sighting-editor/WaterSystem-B-MThsCt.js +1 -0
- package/dist-embed-sighting-editor/caseSchema-DixCNMzt.js +1 -0
- package/dist-embed-sighting-editor/interviewJson-DXD8FSBX.js +8 -0
- package/dist-embed-sighting-editor/interviewSchema-D82l9P1r.js +1 -0
- package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +311 -311
- package/dist-embed-sighting-editor/sightingSchema-DqeNTmuQ.js +1 -0
- package/dist-embed-sighting-editor/{trafficRuntime-STzu7-Xp.js → trafficRuntime-DiOPs8Lf.js} +1 -1
- package/package.json +1 -1
- package/dist-embed-scene/sightingSchema-DfbuP60Y.js +0 -1
- package/dist-embed-sighting/sightingSchema-DfbuP60Y.js +0 -1
- package/dist-embed-sighting-editor/BeamSystem-BnI9L86u.js +0 -1
- package/dist-embed-sighting-editor/ContrailSystem-DugiVtAv.js +0 -1
- package/dist-embed-sighting-editor/GLTFLoader-DLQh4lKb.js +0 -1
- package/dist-embed-sighting-editor/HeadlightSystem-BEWiubrn.js +0 -34
- package/dist-embed-sighting-editor/ModelSource-CnDfgMtY.js +0 -1
- package/dist-embed-sighting-editor/RailwaySystem-CzPTp4PW.js +0 -41
- package/dist-embed-sighting-editor/WaterSystem-Bv5uZSRK.js +0 -1
- package/dist-embed-sighting-editor/caseSchema-ByeWR3Rx.js +0 -1
- package/dist-embed-sighting-editor/interviewJson-CfwBPiuG.js +0 -8
- package/dist-embed-sighting-editor/interviewSchema-7rMvPyAl.js +0 -1
- package/dist-embed-sighting-editor/sightingSchema-DfbuP60Y.js +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
class b{constructor(e){this.preferences=e}read(e){if(e===void 0||typeof e=="string")return e===""?void 0:e;for(const r of this.preferences){const s=e[r]??e[b.base(r)];if(s)return s}const t=new Set(this.preferences.map(r=>b.base(r)));for(const[r,s]of Object.entries(e))if(s&&t.has(b.base(r)))return s;return Object.values(e).find(r=>r)??void 0}write(e,t,r){const s=t?.trim()?t.trim():void 0;if(e===void 0||typeof e=="string")return s;const
|
|
2
|
-
`).replace(/<\/?[a-z][^>]*>/gi,"").replace(/&#x([0-9a-f]+);/gi,(t,r)=>String.fromCodePoint(parseInt(r,16))).replace(/&#(\d+);/g,(t,r)=>String.fromCodePoint(Number(r))).replace(/&(\w+);/g,(t,r)=>u.ENTITIES[r.toLowerCase()]??t):e}static sightingsOf(e){return[e.interviewOf].flat().filter(t=>typeof t=="string")}static passagesAbout(e,t){const r=u.sightingsOf(e),s=[];return e.segments.forEach((
|
|
1
|
+
class b{constructor(e){this.preferences=e}read(e){if(e===void 0||typeof e=="string")return e===""?void 0:e;for(const r of this.preferences){const s=e[r]??e[b.base(r)];if(s)return s}const t=new Set(this.preferences.map(r=>b.base(r)));for(const[r,s]of Object.entries(e))if(s&&t.has(b.base(r)))return s;return Object.values(e).find(r=>r)??void 0}write(e,t,r){const s=t?.trim()?t.trim():void 0;if(e===void 0||typeof e=="string")return s;const i={...e},c=Object.keys(i).find(n=>n===r)??Object.keys(i).find(n=>b.base(n)===b.base(r))??r;return s===void 0?delete i[c]:i[c]=s,Object.keys(i).length===0?void 0:i}static base(e){return e.toLowerCase().split("-")[0]}}class O{static NAMES=["weather","place","lightPollution","decor"];static KEYS={weather:["weatherTrack","weatherSource"],place:["place"],lightPollution:["lightPollution"],decor:["decor"]};static annexName(e,t){return`${e}.${t.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`)}.json`}static fromFile(e,t){return e?.[t]!==void 0&&e[t].live!==!0}}class k extends Error{constructor(e,t,r){super(`${e}: ${t}${r===void 0?"":` (HTTP ${r})`}`),this.kind=e,this.url=t,this.status=r,this.name="SightingFetchError"}}class R{static async recording(e){const t=await R.json(e);for(const r of O.NAMES){const s=t?.frozen?.[r];if(!(!s?.src||s.live))try{const i=await R.json(new URL(s.src,new URL(e,location.href)).href);for(const c of O.KEYS[r])i[c]!==void 0&&(t[c]=i[c])}catch{}}return t}static async json(e){const t=new URL(e,location.href);if(location.protocol==="https:"&&t.protocol==="http:")throw new k("mixed-content",e);let r;try{r=await fetch(e)}catch{throw await this.diagnose(e,t)}if(!r.ok)throw new k("status",e,r.status);try{return await r.json()}catch{throw new k("malformed",e)}}static async diagnose(e,t){if(t.origin===location.origin)return new k("unreachable",e);try{return await fetch(e,{mode:"no-cors"}),new k("cors",e)}catch{return new k("unreachable",e)}}}function z(d,e){for(const t of d){const r=t.toLowerCase().split("-")[0];if(e.includes(r))return r}return"en"}class x{static preferencesFor(e){const t=navigator.languages??[],r=this.declaredFor(e);return r?[r,...t]:t}static declaredFor(e){for(let t=e;t;){const r=t.closest("[lang]")?.getAttribute("lang")?.trim();if(r)return r;const s=t.getRootNode();t=s instanceof ShadowRoot?s.host:void 0}}}const U="modulepreload",j=function(d,e){return new URL(d,e).href},C={},L=function(e,t,r){let s=Promise.resolve();if(t&&t.length>0){let c=function(p){return Promise.all(p.map(o=>Promise.resolve(o).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};const n=document.getElementsByTagName("link"),h=document.querySelector("meta[property=csp-nonce]"),w=h?.nonce||h?.getAttribute("nonce");s=c(t.map(p=>{if(p=j(p,r),p in C)return;C[p]=!0;const o=p.endsWith(".css"),f=o?'[rel="stylesheet"]':"";if(!!r)for(let g=n.length-1;g>=0;g--){const E=n[g];if(E.href===p&&(!o||E.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${p}"]${f}`))return;const l=document.createElement("link");if(l.rel=o?"stylesheet":U,o||(l.as="script"),l.crossOrigin="",l.href=p,w&&l.setAttribute("nonce",w),document.head.appendChild(l),o)return new Promise((g,E)=>{l.addEventListener("load",g),l.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${p}`)))})}))}function i(c){const n=new Event("vite:preloadError",{cancelable:!0});if(n.payload=c,window.dispatchEvent(n),!n.defaultPrevented)throw c}return s.then(c=>{for(const n of c||[])n.status==="rejected"&&i(n.reason);return e().catch(i)})},H=["en","fr","es","it"],V={en:()=>L(()=>Promise.resolve().then(()=>P),void 0,import.meta.url).then(d=>d.interviewMessages_en),fr:()=>L(()=>import("./InterviewMessages_fr-Dhtz904e.js"),[],import.meta.url).then(d=>d.interviewMessages_fr),es:()=>L(()=>import("./InterviewMessages_es-BJHVnSkP.js"),[],import.meta.url).then(d=>d.interviewMessages_es),it:()=>L(()=>import("./InterviewMessages_it-D0Dff5zn.js"),[],import.meta.url).then(d=>d.interviewMessages_it)};function F(d){return V[d]()}const y={title:"Title",time:"When",by:"Interviewer",medium:"Medium",witness:"Witness",witnessNone:"—",summary:"Description",transcript:"Transcript",transcriptHint:"Address of the anonymised transcript file (optional)",summaryTab:"Summary",fileTab:"File",importFile:"Load a file (JSON, text, WebVTT, SRT)",inputFileFromFile:"from your disk",inputFileFromUrl:"from an address",inputFileModeHint:"Click to give it the other way: a file of yours, or an address",inputFileLoad:"Load",saveButton:"Save",loading:"Loading the transcript…",invalid:"This text is not valid JSON yet: the interview keeps the last transcript it understood.",notATranscript:"That file is not an interview transcript (it has no segments).",loadFailed:"That transcript could not be read.",editorLabel:"Interview transcript as JSON",byHint:"RR0 people ids, separated by commas",exchangesTab:"Exchanges",exchangesEmpty:"Nothing was said yet.",redacted:"Passage removed",proofreadAll:"Proofread by everyone.",proofreadPending:"Not proofread yet by: {names}",play:"Play",pause:"Pause",recordings:"Recordings ({n})",recordingsTitle:"Recordings",recordingKind:"Type",recordingAudio:"Audio",recordingVideo:"Video",recordingFile:"File",recordingOffset:"Offset (s)",recordingRemove:"Remove",recordingAdd:"Add a recording",close:"Close",noRecording:"No recording: add the audio or video file of the interview to listen to it.",redactSelection:"Take out the selection",redactedWords:"passage taken out · {n} word(s)",redactAll:"Take all out",restoreAll:"Restore all",editTurn:"Edit",deleteTurn:"Delete this turn",saveTurn:"Save",cancelTurn:"Cancel",turnEditHint:"⟦ … ⟧ marks a passage taken out",selectionOnePassage:"The selection has to stay within one passage not taken out.",selectionNone:"Select words of a passage to take them out.",reviewedBy:"{name} has proofread",linkMoment:"Link to a moment…",momentLabel:"Moment {k} · {text}",unlinkMoment:"Remove this link",noMoments:"The observation has no named moment yet.",redactReason:"taken out at proofreading",roles:{interviewer:"Interviewer",interviewee:"Interviewee",witness:"Witness"}},P=Object.freeze(Object.defineProperty({__proto__:null,interviewMessages_en:y},Symbol.toStringTag,{value:"Module"})),B="interviewseek";class D extends Error{constructor(e,t,r){super(typeof t=="number"&&Number.isInteger(t)&&t>r?`This ${e} file is in version ${t} of its format; this UFO@home reads up to version ${r}. Read it with a newer UFO@home.`:`This ${e} file states ${JSON.stringify(t)} as its format version, which is not a version.`),this.format=e,this.found=t,this.supported=r,this.name="FormatVersionError"}said(e){return e.replace("{found}",typeof this.found=="number"?String(this.found):JSON.stringify(this.found)).replace("{supported}",String(this.supported))}}class T{static CURRENT={sighting:1,case:1,interview:1};static SCHEMA_BASE="https://ufoathome.org/schema";static schemaUrl(e,t=T.CURRENT[e]){return`${T.SCHEMA_BASE}/${t}/${e}.schema.json`}static of(e){if(typeof e!="object"||e===null)return 1;const t=e.version;return t===void 0?1:typeof t=="object"&&t!==null&&"value"in t?t.value:t}static check(e,t){const r=T.of(e),s=T.CURRENT[t];if(typeof r!="number"||!Number.isInteger(r)||r<1||r>s)throw new D(t,r,s);return e}}class u{static read(e){return T.check(e,"interview")}static isProofread(e){const t=Object.keys(e.speakers);return t.length>0&&t.every(r=>{const s=e.proofreading?.[r]?.status;return s==="approved"||s==="covered"})}static said(e){return e.parts?e.parts.map(t=>"redacted"in t?"…":u.plain(t.text)).join(" "):e.redacted?void 0:u.plain(e.text??"")}static ENTITIES={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "};static plain(e){return/[<&]/.test(e)?e.replace(/<br\s*\/?>/gi,`
|
|
2
|
+
`).replace(/<\/?[a-z][^>]*>/gi,"").replace(/&#x([0-9a-f]+);/gi,(t,r)=>String.fromCodePoint(parseInt(r,16))).replace(/&#(\d+);/g,(t,r)=>String.fromCodePoint(Number(r))).replace(/&(\w+);/g,(t,r)=>u.ENTITIES[r.toLowerCase()]??t):e}static sightingsOf(e){return[e.interviewOf].flat().filter(t=>typeof t=="string")}static passagesAbout(e,t){const r=u.sightingsOf(e),s=[];return e.segments.forEach((i,c)=>{for(const n of i.refs??[]){if(n.sighting===void 0?!r.includes(t):n.sighting!==t)continue;const h=u.said(i);s.push({index:c,speaker:i.speaker,at:n.at,...h!==void 0?{text:h}:{},...n.range?{range:n.range}:{}})}}),s.sort((i,c)=>i.at-c.at||i.index-c.index)}static clock(e,t=!1){const r=Math.round(e*10),s=Math.floor(r/10),i=h=>String(h).padStart(2,"0"),c=Math.floor(s/3600),n=`${c>0||t?i(Math.floor(s/60)%60):Math.floor(s/60)}:${i(s%60)}`;return`${c>0?`${c}:`:""}${n}${t||r%10!==0?`.${r%10}`:""}`}static speakerName(e,t){const r=e.speakers[t];if(!r)return t;const s=typeof r.title=="string"?r.title:r.title?Object.values(r.title)[0]:void 0;return s||r.by&&u.agentName(r.by)||r.role}static agentName(e){if("people"in e){const[t,...r]=e.people.replace(/([a-z])([A-Z])/g,"$1 $2").split(" ");return[...r,t].join(" ")}return"org"in e?e.org:e.title??""}static stamp(e){const t=Math.round(e*1e3),r=(s,i=2)=>String(s).padStart(i,"0");return`${r(Math.floor(t/36e5))}:${r(Math.floor(t/6e4)%60)}:${r(Math.floor(t/1e3)%60)}.${r(t%1e3,3)}`}static toVtt(e){const t=i=>i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),r=e.segments.filter(i=>i.start!==void 0);return`WEBVTT
|
|
3
3
|
|
|
4
|
-
${r.map((
|
|
5
|
-
<v ${t(u.speakerName(e,
|
|
4
|
+
${r.map((i,c)=>{const n=r[c+1],h=i.end??n?.start??i.start+5,w=n&&n.start<h?Math.max(i.start,n.start):h;return`${u.stamp(i.start)} --> ${u.stamp(w)}
|
|
5
|
+
<v ${t(u.speakerName(e,i.speaker))}>${t(u.said(i)??"[…]")}`}).join(`
|
|
6
6
|
|
|
7
7
|
`)}
|
|
8
|
-
`}}class a{static svg(e){return`<svg viewBox="0 0 24 24" width="1.5em" height="1.5em" aria-hidden="true" focusable="false"><path d="${e}" fill="currentColor"/></svg>`}static outline(e){return`<svg viewBox="0 0 24 24" width="1.5em" height="1.5em" aria-hidden="true" focusable="false"><path d="${e}" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round" stroke-linecap="round"/></svg>`}static solid(e){return`<svg viewBox="0 0 24 24" width="1.5em" height="1.5em" aria-hidden="true" focusable="false"><path d="${e}" fill="currentColor" fill-rule="evenodd"/></svg>`}static BOOKMARK="M6 3.5h12a.5.5 0 0 1 .5.5v16.5L12 16.8l-6.5 3.7V4a.5.5 0 0 1 .5-.5z";static PICTURE="M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z";static PICTURE_HILLS="M4.5 17.5l4.5-6 3 4 2.5-3 5 5z";static PIN="M12 21.5s-6.5-5.7-6.5-10.8a6.5 6.5 0 0 1 13 0c0 5.1-6.5 10.8-6.5 10.8z";static PIN_HOLE="M12 8.4a2.4 2.4 0 1 0 0 4.8 2.4 2.4 0 0 0 0-4.8z";static MILESTONES_OFF=a.outline(a.BOOKMARK);static MILESTONES_ON=a.solid(a.BOOKMARK);static PICTURES_OFF=a.outline(`${a.PICTURE}${a.PICTURE_HILLS}`);static PICTURES_ON=a.solid(`${a.PICTURE}${a.PICTURE_HILLS}`);static TRACE_LINE="M3 19.5l2.2-2.2 1.4 1.4L4.4 20.9zM8 14.5l2.2-2.2 1.4 1.4-2.2 2.2zM13 9.5l2.2-2.2 1.4 1.4-2.2 2.2z";static TRACE_MARK="M18.5 2.5l3.5 3.5-3.5 3.5-3.5-3.5z";static TRACES_OFF=a.outline(`${a.TRACE_LINE}${a.TRACE_MARK}`);static TRACES_ON=a.solid(`${a.TRACE_LINE}${a.TRACE_MARK}`);static MAP_OFF=a.outline(`${a.PIN}${a.PIN_HOLE}`);static MAP_ON=a.solid(`${a.PIN}${a.PIN_HOLE}`);static SHARE=a.outline("M14 4l7 7-7 7v-4.2C8.6 13.8 5.4 15.6 3.5 19c.6-5.6 3.4-9.6 10.5-10.8V4z");static FOLDED=a.svg("M15.4 7.4 14 6l-6 6 6 6 1.4-1.4L10.8 12z");static UNFOLDED=a.svg("M8.6 16.6 10 18l6-6-6-6-1.4 1.4 4.6 4.6z");static PLAY=a.svg("M7.4 5v14l11-7z");static PAUSE=a.svg("M6 5h4v14H6zM14 5h4v14h-4z");static VOLUME=a.svg("M2 9.5v5h3.5l4.5 4.5V5L5.5 9.5H2zm12.5 2.5A4 4 0 0 0 12.5 8.5v7A4 4 0 0 0 14.5 12zM12.5 4.2v2.1a6.5 6.5 0 0 1 0 11.4v2.1a8.6 8.6 0 0 0 0-15.6z");static MUTED=a.svg("M2 9.5v5h3.5l4.5 4.5V5L5.5 9.5H2zM15 9.8l1.4-1.4 2.6 2.6 2.6-2.6 1.4 1.4-2.6 2.6 2.6 2.6-1.4 1.4-2.6-2.6-2.6 2.6-1.4-1.4 2.6-2.6z");static ENTER_FULLSCREEN=a.svg("M5 5h5v2H7v3H5V5zm9 0h5v5h-2V7h-3V5zM5 14h2v3h3v2H5v-5zm12 0h2v5h-5v-2h3v-3z");static EXIT_FULLSCREEN=a.svg("M8 5h2v5H5V8h3V5zm6 0h2v3h3v2h-5V5zM5 14h5v5H8v-3H5v-2zm9 0h5v2h-3v3h-2v-5z")}const
|
|
8
|
+
`}}class a{static svg(e){return`<svg viewBox="0 0 24 24" width="1.5em" height="1.5em" aria-hidden="true" focusable="false"><path d="${e}" fill="currentColor"/></svg>`}static outline(e){return`<svg viewBox="0 0 24 24" width="1.5em" height="1.5em" aria-hidden="true" focusable="false"><path d="${e}" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round" stroke-linecap="round"/></svg>`}static solid(e){return`<svg viewBox="0 0 24 24" width="1.5em" height="1.5em" aria-hidden="true" focusable="false"><path d="${e}" fill="currentColor" fill-rule="evenodd"/></svg>`}static BOOKMARK="M6 3.5h12a.5.5 0 0 1 .5.5v16.5L12 16.8l-6.5 3.7V4a.5.5 0 0 1 .5-.5z";static PICTURE="M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z";static PICTURE_HILLS="M4.5 17.5l4.5-6 3 4 2.5-3 5 5z";static PIN="M12 21.5s-6.5-5.7-6.5-10.8a6.5 6.5 0 0 1 13 0c0 5.1-6.5 10.8-6.5 10.8z";static PIN_HOLE="M12 8.4a2.4 2.4 0 1 0 0 4.8 2.4 2.4 0 0 0 0-4.8z";static MILESTONES_OFF=a.outline(a.BOOKMARK);static MILESTONES_ON=a.solid(a.BOOKMARK);static PICTURES_OFF=a.outline(`${a.PICTURE}${a.PICTURE_HILLS}`);static PICTURES_ON=a.solid(`${a.PICTURE}${a.PICTURE_HILLS}`);static TRACE_LINE="M3 19.5l2.2-2.2 1.4 1.4L4.4 20.9zM8 14.5l2.2-2.2 1.4 1.4-2.2 2.2zM13 9.5l2.2-2.2 1.4 1.4-2.2 2.2z";static TRACE_MARK="M18.5 2.5l3.5 3.5-3.5 3.5-3.5-3.5z";static TRACES_OFF=a.outline(`${a.TRACE_LINE}${a.TRACE_MARK}`);static TRACES_ON=a.solid(`${a.TRACE_LINE}${a.TRACE_MARK}`);static MAP_OFF=a.outline(`${a.PIN}${a.PIN_HOLE}`);static MAP_ON=a.solid(`${a.PIN}${a.PIN_HOLE}`);static SHARE=a.outline("M14 4l7 7-7 7v-4.2C8.6 13.8 5.4 15.6 3.5 19c.6-5.6 3.4-9.6 10.5-10.8V4z");static FOLDED=a.svg("M15.4 7.4 14 6l-6 6 6 6 1.4-1.4L10.8 12z");static UNFOLDED=a.svg("M8.6 16.6 10 18l6-6-6-6-1.4 1.4 4.6 4.6z");static PLAY=a.svg("M7.4 5v14l11-7z");static PAUSE=a.svg("M6 5h4v14H6zM14 5h4v14h-4z");static VOLUME=a.svg("M2 9.5v5h3.5l4.5 4.5V5L5.5 9.5H2zm12.5 2.5A4 4 0 0 0 12.5 8.5v7A4 4 0 0 0 14.5 12zM12.5 4.2v2.1a6.5 6.5 0 0 1 0 11.4v2.1a8.6 8.6 0 0 0 0-15.6z");static MUTED=a.svg("M2 9.5v5h3.5l4.5 4.5V5L5.5 9.5H2zM15 9.8l1.4-1.4 2.6 2.6 2.6-2.6 1.4 1.4-2.6 2.6 2.6 2.6-1.4 1.4-2.6-2.6-2.6 2.6-1.4-1.4 2.6-2.6z");static ENTER_FULLSCREEN=a.svg("M5 5h5v2H7v3H5V5zm9 0h5v5h-2V7h-3V5zM5 14h2v3h3v2H5v-5zm12 0h2v5h-5v-2h3v-3z");static EXIT_FULLSCREEN=a.svg("M8 5h2v5H5V8h3V5zm6 0h2v3h3v2h-5V5zM5 14h5v5H8v-3H5v-2zm9 0h5v2h-3v3h-2v-5z")}const $="rr0-interview",K=`
|
|
9
9
|
rr0-interview { display: block; --rr0-interview-line: color-mix(in srgb, currentColor 35%, transparent); }
|
|
10
10
|
rr0-interview [hidden] { display: none !important; }
|
|
11
11
|
rr0-interview .rr0-interview-status { font-size: .85em; opacity: .85; margin: 0 0 .5em; }
|
|
@@ -32,4 +32,4 @@ rr0-interview .turn .refs { display: flex; flex-wrap: wrap; gap: .25em; }
|
|
|
32
32
|
rr0-interview .turn .ref { font: inherit; font-size: .8em; cursor: pointer; border: 1px solid var(--rr0-interview-line); border-radius: 999px; background: transparent; color: inherit;
|
|
33
33
|
padding: 0 .35em; font-variant-numeric: tabular-nums; white-space: nowrap; display: inline-flex; align-items: center; gap: .15em; }
|
|
34
34
|
rr0-interview .turn .ref svg { width: 1.1em; height: 1.1em; }
|
|
35
|
-
`;class
|
|
35
|
+
`;class S extends HTMLElement{messages=y;said=new b(["en"]);localeToken=0;loadToken=0;json;loading;base;status=document.createElement("p");turns=document.createElement("div");blocks=new Map;constructor(){super(),this.status.className="rr0-interview-status",this.status.setAttribute("role","status"),this.turns.className="rr0-interview-turns"}static get observedAttributes(){return["src"]}attributeChangedCallback(e,t,r){e==="src"&&r!==t&&this.isConnected&&this.load()}connectedCallback(){S.styleRoot(this.getRootNode()),this.contains(this.turns)||this.replaceChildren(this.status,this.turns),this.loadLocale(),this.hasAttribute("src")&&this.json===void 0&&this.loading!==this.getAttribute("src")&&this.load()}get interview(){return this.json}set interview(e){this.loadToken++,this.json=e,this.draw()}set documentUrl(e){this.base=e}static styleRoot(e){const t=e instanceof ShadowRoot?e:document.head;if(t.querySelector("style[data-rr0-interview]"))return;const r=document.createElement("style");r.dataset.rr0Interview="",r.textContent=K,t.append(r)}async load(){const e=this.getAttribute("src"),t=++this.loadToken;if(this.loading=e??void 0,!e)return;const r=new URL(e,location.href).href;let s;try{s=u.read(await R.json(r))}catch{s=void 0}t===this.loadToken&&(this.base=r,this.json=s,this.draw())}async loadLocale(){const e=++this.localeToken,t=x.preferencesFor(this),r=z(t,H),s=r==="en"?y:await F(r);e===this.localeToken&&(this.said=new b(t),this.messages=s,this.draw())}speakerName(e,t){const r=u.speakerName(e,t),s=e.speakers?.[t]?.role;return r===s&&s in this.messages.roles?this.messages.roles[s]:r}seek(e,t){const r=this.json,s=t?u.said(t):void 0,i={sighting:e.sighting??u.sightingsOf(r)[0],at:e.at,...s?{quote:s}:{}};this.dispatchEvent(new CustomEvent(B,{bubbles:!0,composed:!0,detail:i}));const c=this.getAttribute("player");if(!c)return;const h=this.getRootNode().getElementById?.(c);typeof h?.seekTo=="function"&&(h.scrollIntoView?.({block:"center",behavior:"smooth"}),h.seekTo(i.at,i.sighting))}gap(e,t){const r=document.createElement(t),s=document.createElement("span");s.className="bar";const i=`${this.messages.redacted} : ${this.said.read(e)??""}`;return s.dataset.tip=i,s.tabIndex=0,s.setAttribute("role","img"),s.setAttribute("aria-label",i),r.append(s),r}saidNodes(e){if(!/[<&]/.test(e))return[document.createTextNode(e)];const t=document.createElement("template");t.innerHTML=e;for(const r of t.content.querySelectorAll("*")){if(["SCRIPT","STYLE","IFRAME","OBJECT","EMBED"].includes(r.tagName)){r.remove();continue}for(const s of[...r.attributes])if(/^on/i.test(s.name)||/^\s*javascript:/i.test(s.value))r.removeAttribute(s.name);else if(["href","src"].includes(s.name))try{s.value=new URL(s.value,this.base??location.href).href}catch{}}return[...t.content.childNodes]}draw(){const e=this.messages,t=this.json;this.blocks.clear();const r=Array.isArray(t?.segments)?t.segments:[];if(!t||r.length===0){this.status.hidden=!0;const o=document.createElement("p");o.textContent=e.exchangesEmpty,this.turns.replaceChildren(o);return}const s=t.speakers??{},i=Object.keys(s);if(t.proofreading){const o=i.filter(f=>!["approved","covered"].includes(t.proofreading?.[f]?.status??""));this.status.textContent=o.length===0?e.proofreadAll:e.proofreadPending.replace("{names}",o.map(f=>this.speakerName(t,f)).join(", ")),this.status.hidden=!1}else this.status.hidden=!0;const c=[];let n,h=!1,w,p;r.forEach((o,f)=>{const M=o.redacted?JSON.stringify(o.redacted.reason):void 0;if(M!==void 0&&w?.reason===M){this.blocks.set(f,w.block),o.speaker!==p&&(p=void 0);return}const l=document.createElement("div");l.className="turn",l.dataset.segment=String(f);const g=document.createElement("div");g.className="who";const E=document.createElement("span");if(E.textContent=o.redacted?"":this.speakerName(t,o.speaker),o.start!==void 0&&(l.dataset.time=u.clock(o.start,!0)),p!==o.speaker&&(n=document.createElement("div"),n.className="intervention",n.style.setProperty("--speaker-hue",String((Math.max(0,i.indexOf(o.speaker))*67+210)%360)),c.push(n),h=!1),o.redacted||(h&&l.classList.add("goes-on"),h=!0),n.append(l),p=o.speaker,g.append(E),o.redacted){l.classList.add("is-redacted");const v=this.gap(o.redacted.reason,"p");v.className="redacted",w={block:l,reason:M},l.append(g,v)}else{const v=document.createElement("p");if(v.className="said",o.parts){let N="";for(const m of o.parts){const A="redacted"in m?"▮":u.plain(m.text);/[\p{L}\p{N}.,;:!?)»”…▮]$/u.test(N)&&/^[\p{L}\p{N}(«“▮]/u.test(A)&&v.append(" "),"redacted"in m?v.append(this.gap(m.redacted.reason,"span")):v.append(...this.saidNodes(m.text)),N=A}}else v.append(...this.saidNodes(o.text??""));w=void 0,l.append(g,v)}if(o.refs?.length){const v=document.createElement("div");v.className="refs";for(const N of o.refs){const m=document.createElement("button");m.type="button",m.className="ref",m.innerHTML=a.PLAY,m.append(u.clock(N.at,!0)),m.addEventListener("click",()=>this.seek(N,o)),v.append(m)}l.append(v)}this.blocks.set(f,l)}),this.turns.replaceChildren(...c)}revealSegment(e){const t=this.blocks.get(e);t&&(t.scrollIntoView?.({block:"center"}),t.classList.add("flash"),window.setTimeout(()=>t.classList.remove("flash"),1600))}}function I(){customElements.get($)||customElements.define($,S)}I();
|