@rr0/ufoathome 0.160.0 → 0.162.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/InterviewMessages_es-B0Ut-uel.js +1 -0
- package/dist-embed-interview/InterviewMessages_fr-mhX8Zuyu.js +1 -0
- package/dist-embed-interview/InterviewMessages_it-DaxIoAIG.js +1 -0
- package/dist-embed-interview/rr0-interview.mjs +2 -2
- package/dist-embed-scene/rr0-scene.mjs +311 -311
- package/dist-embed-scene/sightingSchema-CnDwuCov.js +1 -0
- package/dist-embed-sighting/{AdsbLolArchiveProvider-SLZYD2p1.js → AdsbLolArchiveProvider-CX1R8zJF.js} +1 -1
- package/dist-embed-sighting/BallesterGuaspAssessor-CCjRjJck.js +1 -0
- package/dist-embed-sighting/BeamSystem-B0H346X_.js +1 -0
- package/dist-embed-sighting/{ContrailSystem-D_EBfThB.js → ContrailSystem-BeK11Jxe.js} +1 -1
- package/dist-embed-sighting/GLTFLoader-B_T3zy3i.js +1 -0
- package/dist-embed-sighting/HeadlightSystem-DjtbpwEp.js +34 -0
- package/dist-embed-sighting/HynekAssessor-B8Iw0Cbz.js +1 -0
- package/dist-embed-sighting/NearestApproach-B5s-b6tU.js +1 -0
- package/dist-embed-sighting/PoherAssessor-CwQN9pB1.js +1 -0
- package/dist-embed-sighting/{RailwaySystem-geTpPVGC.js → RailwaySystem-9blFcIdg.js} +1 -1
- package/dist-embed-sighting/ReferenceSystem-DFM_jZ-Q.js +1 -0
- package/dist-embed-sighting/SightingMessages_es-Dsr6169b.js +1 -0
- package/dist-embed-sighting/SightingMessages_fr-DQNbBD0c.js +1 -0
- package/dist-embed-sighting/{SightingMessages_it-BC3oCPqe.js → SightingMessages_it-WE-_Cuu4.js} +1 -1
- package/dist-embed-sighting/{TraceSystem-DpokUmzt.js → TraceSystem-CLYZFxAf.js} +2 -2
- package/dist-embed-sighting/WaterSystem-BulddAwi.js +1 -0
- package/dist-embed-sighting/rr0-sighting.mjs +319 -319
- package/dist-embed-sighting/sightingSchema-CnDwuCov.js +1 -0
- package/dist-embed-sighting-editor/{AdsbLolArchiveProvider-RNAaE2P_.js → AdsbLolArchiveProvider-DS9ev-HU.js} +1 -1
- package/dist-embed-sighting-editor/BallesterGuaspAssessor-gX_y6kL8.js +1 -0
- package/dist-embed-sighting-editor/BeamEditor-BzrEOJOy.js +13 -0
- package/dist-embed-sighting-editor/{BeamSystem-CrrOjNqD.js → BeamSystem-BBonCZQ1.js} +1 -1
- package/dist-embed-sighting-editor/{BodyEditor-D4tNRA0l.js → BodyEditor-D5VXWcru.js} +1 -1
- package/dist-embed-sighting-editor/{ContrailSystem-CXR_fe3m.js → ContrailSystem-BXARgrR4.js} +1 -1
- package/dist-embed-sighting-editor/{CoverageAssessor-Bp4nb-71.js → CoverageAssessor-mvpHgNx3.js} +1 -1
- package/dist-embed-sighting-editor/{GLTFLoader-DHQ7X9p5.js → GLTFLoader-BVRuOnnK.js} +1 -1
- package/dist-embed-sighting-editor/{HeadlightSystem-CPbn_3dw.js → HeadlightSystem-9ywZKJNB.js} +1 -1
- package/dist-embed-sighting-editor/HynekAssessor-B9lO770Q.js +1 -0
- package/dist-embed-sighting-editor/{InterviewEditorElement-BlCNgtdl.js → InterviewEditorElement-Cpu0vwrk.js} +8 -7
- package/dist-embed-sighting-editor/InterviewMessages_en-CC5D0e6J.js +1 -0
- package/dist-embed-sighting-editor/InterviewMessages_es-B0Ut-uel.js +1 -0
- package/dist-embed-sighting-editor/InterviewMessages_fr-mhX8Zuyu.js +1 -0
- package/dist-embed-sighting-editor/InterviewMessages_it-DaxIoAIG.js +1 -0
- package/dist-embed-sighting-editor/{LanternEditor-Bq27r-0W.js → LanternEditor-C60IT7Cv.js} +1 -1
- package/dist-embed-sighting-editor/{LaserBeam-D6hhHu5-.js → LaserBeam-DZ6ILkZ8.js} +1 -1
- package/dist-embed-sighting-editor/{LaunchEditor-D-1-8brV.js → LaunchEditor-DcYWYLQN.js} +1 -1
- package/dist-embed-sighting-editor/{ModelSource-n0nZrWMU.js → ModelSource-D0ZuOymh.js} +1 -1
- package/dist-embed-sighting-editor/{ModelThumbnails-Bj4DwXU0.js → ModelThumbnails-BA3zFrn5.js} +1 -1
- package/dist-embed-sighting-editor/{ModelViewer-YecYa7OI.js → ModelViewer-BDorZEms.js} +1 -1
- package/dist-embed-sighting-editor/NearestApproach-DCFh8vV6.js +1 -0
- package/dist-embed-sighting-editor/{PictureRegistration-ZngZKmqH.js → PictureRegistration-cp0utyhJ.js} +1 -1
- package/dist-embed-sighting-editor/PoherAssessor-CzLQhAxP.js +1 -0
- package/dist-embed-sighting-editor/{RailwaySystem-7MMun4zU.js → RailwaySystem-BfDjza60.js} +1 -1
- package/dist-embed-sighting-editor/{ReferenceSystem-BeFpOHFl.js → ReferenceSystem-DHPnvAXN.js} +1 -1
- package/dist-embed-sighting-editor/{RoadMarkings-GCEFUqp7.js → RoadMarkings-HF9xJtTp.js} +1 -1
- package/dist-embed-sighting-editor/{SceneNames_es-JoEPQIHg.js → SceneNames_es-CtE-QSrH.js} +1 -1
- package/dist-embed-sighting-editor/{SceneNames_fr-OQd5OVTs.js → SceneNames_fr-hz4p4u7a.js} +1 -1
- package/dist-embed-sighting-editor/{SceneNames_it-BSrzohzy.js → SceneNames_it-CRn1NGKM.js} +1 -1
- package/dist-embed-sighting-editor/SightingEditorMessages_es-DGdkm-Yt.js +12 -0
- package/dist-embed-sighting-editor/SightingEditorMessages_fr-thlWKHJq.js +12 -0
- package/dist-embed-sighting-editor/SightingEditorMessages_it-dkt2lxRe.js +12 -0
- package/dist-embed-sighting-editor/{SightingFileEditor-qzouGB2d.js → SightingFileEditor-BekK-f3R.js} +1 -1
- package/dist-embed-sighting-editor/{TraceSystem-lNFPtyqy.js → TraceSystem-C1HaC0DX.js} +2 -2
- package/dist-embed-sighting-editor/{WaterSystem-KGutPogf.js → WaterSystem-BDkfNF8C.js} +1 -1
- package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +463 -443
- package/dist-embed-sighting-editor/sightingSchema-CnDwuCov.js +1 -0
- package/dist-embed-sighting-editor/{surroundingsSources-BxnTzgWR.js → surroundingsSources-Bq5A0HA5.js} +1 -1
- package/dist-embed-sighting-editor/trafficRuntime-DVOOnJGD.js +2 -0
- package/package.json +1 -1
- package/dist-embed-interview/InterviewMessages_es-BJHVnSkP.js +0 -1
- package/dist-embed-interview/InterviewMessages_fr-Dhtz904e.js +0 -1
- package/dist-embed-interview/InterviewMessages_it-D0Dff5zn.js +0 -1
- package/dist-embed-scene/sightingSchema-hOpjDzr2.js +0 -1
- package/dist-embed-sighting/BeamSystem-Ddt2lTBT.js +0 -1
- package/dist-embed-sighting/GLTFLoader-BGUT3v5v.js +0 -1
- package/dist-embed-sighting/HeadlightSystem-Cz4cc2lG.js +0 -34
- package/dist-embed-sighting/HynekAssessor-DPsLpEGQ.js +0 -1
- package/dist-embed-sighting/ReferenceSystem-DKmWxtY-.js +0 -1
- package/dist-embed-sighting/SightingMessages_es-dFoOi4Xe.js +0 -1
- package/dist-embed-sighting/SightingMessages_fr-DK90WaSj.js +0 -1
- package/dist-embed-sighting/WaterSystem-BLt9Dsxc.js +0 -1
- package/dist-embed-sighting/sightingSchema-hOpjDzr2.js +0 -1
- package/dist-embed-sighting-editor/BeamEditor-BHpoDP6v.js +0 -13
- package/dist-embed-sighting-editor/HynekAssessor-BopK5jfz.js +0 -1
- package/dist-embed-sighting-editor/InterviewMessages_en-CRvWVmlL.js +0 -1
- package/dist-embed-sighting-editor/InterviewMessages_es-BJHVnSkP.js +0 -1
- package/dist-embed-sighting-editor/InterviewMessages_fr-Dhtz904e.js +0 -1
- package/dist-embed-sighting-editor/InterviewMessages_it-D0Dff5zn.js +0 -1
- package/dist-embed-sighting-editor/SightingEditorMessages_es-DAQlGVHF.js +0 -12
- package/dist-embed-sighting-editor/SightingEditorMessages_fr-DrfuyO6f.js +0 -12
- package/dist-embed-sighting-editor/SightingEditorMessages_it-D3oR-6GZ.js +0 -12
- package/dist-embed-sighting-editor/sightingSchema-hOpjDzr2.js +0 -1
- package/dist-embed-sighting-editor/trafficRuntime-ZmzuyzhR.js +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={title:"Título",time:"Fecha",by:"Entrevistador",medium:"Medio",witness:"Testigo",witnessNone:"—",summary:"Descripción",transcript:"Transcripción",transcriptHint:"Dirección del archivo de transcripción anonimizada (opcional)",summaryTab:"Resumen",fileTab:"Archivo",importFile:"Cargar un archivo",importFileHint:"JSON, texto, WebVTT, SRT",inputFileFromFile:"desde su disco",inputFileFromUrl:"desde una dirección",inputFileModeHint:"Pulsar para darlo de la otra forma: un archivo suyo o una dirección",inputFileLoad:"Cargar",saveButton:"Guardar",loading:"Cargando la transcripción…",invalid:"Este texto aún no es JSON válido: la entrevista conserva la última transcripción que entendió.",notATranscript:"Ese archivo no es una transcripción de entrevista (no tiene turnos de palabra).",loadFailed:"No se pudo leer esa transcripción.",editorLabel:"Transcripción de la entrevista en JSON",byHint:"Identificadores de personas de RR0, separados por comas",exchangesTab:"Intercambios",exchangesEmpty:"Todavía no se ha dicho nada.",redacted:"Pasaje eliminado",proofreadAll:"Revisado por todos.",proofreadPending:"Aún no revisado por: {names}",play:"Reproducir",pause:"Pausa",recordings:"Grabaciones ({n})",recordingsTitle:"Grabaciones",recordingKind:"Tipo",recordingAudio:"Audio",recordingVideo:"Vídeo",recordingFile:"Archivo",recordingOffset:"Desfase",recordingRemove:"Quitar",recordingAdd:"Añadir una grabación",close:"Cerrar",noRecording:"Sin grabación: añada el archivo de audio o vídeo de la entrevista para poder escucharla.",redactSelection:"Retirar la selección",redactedWords:"pasaje retirado · {n} palabra(s)",redactAll:"Retirar todo",restoreAll:"Restablecer todo",editTurn:"Modificar",deleteTurn:"Eliminar este turno de palabra",saveTurn:"Guardar",cancelTurn:"Cancelar",turnEditHint:"⟦ … ⟧ marca un pasaje retirado",selectionOnePassage:"La selección debe caber en un solo pasaje no retirado.",selectionNone:"Seleccione palabras de un pasaje para retirarlas.",reviewedBy:"{name} ha revisado",linkMoment:"Vincular a un momento…",momentLabel:"Momento {k} · {text}",unlinkMoment:"Quitar este vínculo",noMoments:"La observación aún no tiene momentos con nombre.",redactReason:"retirado en la revisión",roles:{interviewer:"Entrevistador",interviewee:"Entrevistado",witness:"Testigo"}};export{e as interviewMessages_es};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={title:"Titre",time:"Date",by:"Enquêteur",medium:"Moyen",witness:"Témoin",witnessNone:"—",summary:"Description",transcript:"Transcription",transcriptHint:"Adresse du fichier de transcription anonymisée (facultative)",summaryTab:"Résumé",fileTab:"Fichier",importFile:"Charger un fichier",importFileHint:"JSON, texte, WebVTT, SRT",inputFileFromFile:"depuis votre disque",inputFileFromUrl:"depuis une adresse",inputFileModeHint:"Cliquer pour le donner autrement : un fichier à vous, ou une adresse",inputFileLoad:"Charger",saveButton:"Sauver",loading:"Chargement de la transcription…",invalid:"Ce texte n'est pas encore du JSON valide : l'interview garde la dernière transcription qu'elle a comprise.",notATranscript:"Ce fichier n'est pas une transcription d'interview (il n'a pas de tours de parole).",loadFailed:"Cette transcription n'a pas pu être lue.",editorLabel:"Transcription de l'interview en JSON",byHint:"Identifiants de personnes RR0, séparés par des virgules",exchangesTab:"Échanges",exchangesEmpty:"Rien n'a encore été dit.",redacted:"Passage retiré",proofreadAll:"Relu par tous les participants.",proofreadPending:"Pas encore relu par : {names}",play:"Lecture",pause:"Pause",recordings:"Enregistrements ({n})",recordingsTitle:"Enregistrements",recordingKind:"Type",recordingAudio:"Audio",recordingVideo:"Vidéo",recordingFile:"Fichier",recordingOffset:"Décalage",recordingRemove:"Retirer",recordingAdd:"Ajouter un enregistrement",close:"Fermer",noRecording:"Aucun enregistrement : ajoutez le fichier audio ou vidéo de l'entretien pour pouvoir l'écouter.",redactSelection:"Retirer la sélection",redactedWords:"passage retiré · {n} mot(s)",redactAll:"Retirer tout",restoreAll:"Rétablir tout",editTurn:"Modifier",deleteTurn:"Supprimer ce tour de parole",saveTurn:"Enregistrer",cancelTurn:"Annuler",turnEditHint:"⟦ … ⟧ marque un passage retiré",selectionOnePassage:"La sélection doit tenir dans un seul passage non retiré.",selectionNone:"Sélectionnez des mots d'un passage pour les retirer.",reviewedBy:"{name} a relu",linkMoment:"Relier à un moment…",momentLabel:"Moment {k} · {text}",unlinkMoment:"Retirer ce lien",noMoments:"L'observation n'a pas encore de moment nommé.",redactReason:"retiré à la relecture",roles:{interviewer:"Intervieweur",interviewee:"Interviewé",witness:"Témoin"}};export{e as interviewMessages_fr};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const i={title:"Titolo",time:"Data",by:"Intervistatore",medium:"Mezzo",witness:"Testimone",witnessNone:"—",summary:"Descrizione",transcript:"Trascrizione",transcriptHint:"Indirizzo del file di trascrizione anonimizzata (facoltativo)",summaryTab:"Riepilogo",fileTab:"File",importFile:"Carica un file",importFileHint:"JSON, testo, WebVTT, SRT",inputFileFromFile:"dal proprio disco",inputFileFromUrl:"da un indirizzo",inputFileModeHint:"Fare clic per darlo nell'altro modo: un proprio file o un indirizzo",inputFileLoad:"Carica",saveButton:"Salva",loading:"Caricamento della trascrizione…",invalid:"Questo testo non è ancora JSON valido: l'intervista conserva l'ultima trascrizione che ha capito.",notATranscript:"Quel file non è una trascrizione di intervista (non ha turni di parola).",loadFailed:"Impossibile leggere quella trascrizione.",editorLabel:"Trascrizione dell'intervista in JSON",byHint:"Identificatori di persone RR0, separati da virgole",exchangesTab:"Scambi",exchangesEmpty:"Non è stato ancora detto nulla.",redacted:"Passaggio rimosso",proofreadAll:"Rivisto da tutti.",proofreadPending:"Non ancora rivisto da: {names}",play:"Riproduci",pause:"Pausa",recordings:"Registrazioni ({n})",recordingsTitle:"Registrazioni",recordingKind:"Tipo",recordingAudio:"Audio",recordingVideo:"Video",recordingFile:"File",recordingOffset:"Scarto",recordingRemove:"Rimuovi",recordingAdd:"Aggiungi una registrazione",close:"Chiudi",noRecording:"Nessuna registrazione: aggiungi il file audio o video dell'intervista per poterla ascoltare.",redactSelection:"Rimuovi la selezione",redactedWords:"passaggio rimosso · {n} parola/e",redactAll:"Rimuovi tutto",restoreAll:"Ripristina tutto",editTurn:"Modifica",deleteTurn:"Elimina questo turno",saveTurn:"Salva",cancelTurn:"Annulla",turnEditHint:"⟦ … ⟧ indica un passaggio rimosso",selectionOnePassage:"La selezione deve restare in un solo passaggio non rimosso.",selectionNone:"Seleziona parole di un passaggio per rimuoverle.",reviewedBy:"{name} ha riletto",linkMoment:"Collega a un momento…",momentLabel:"Momento {k} · {text}",unlinkMoment:"Rimuovi questo collegamento",noMoments:"L'osservazione non ha ancora momenti con nome.",redactReason:"rimosso in rilettura",roles:{interviewer:"Intervistatore",interviewee:"Intervistato",witness:"Testimone"}};export{i as interviewMessages_it};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class B extends Error{}class re{constructor(t){this.name=t}validate(t){return!0}}class kn extends re{min;max;constructor(t,e,n){super(t),this.min=e,this.max=n}validate(t){if(typeof t!="number")throw new B(`${this.name} value must be a number, but was ${t}`);if(t<this.min||t>this.max)throw new B(`${this.name} value must be >= ${this.min} and <= ${this.max}, but was ${t}`);return super.validate(t)}}class N{name;min;max;duration;subUnit;validator;constructor(t,e,n,r,i=new kn(t,e,n)){this.name=t,this.min=e,this.max=n,this.subUnit=r,this.duration=r?(r.max-r.min+1)*r.duration:1,this.validator=i}validate(t){return this.validator.validate(t)}[Symbol.iterator](){let t=this.min;return{next:()=>{const e={done:t>this.max,value:t};return t++,e}}}}class Me{millisecond;second;minute;hour;day;month;year}class zn extends Me{}class Rn extends zn{millisecond=new N("millisecond",0,999,void 0);second=new N("second",0,59,this.millisecond);minute=new N("minute",0,59,this.second);hour=new N("hour",0,23,this.minute);day=new N("day",1,31,this.hour);month=new N("month",1,12,this.day);year=new N("year",0,9999,this.month)}const f=new Rn;class Fn extends kn{constructor(t=1,e=12){super("month",t,e)}}class gt extends N{static Month28=new gt(28);static Month29=new gt(29);static ThirtyDays=new gt(30);static ThirtyOneDays=new gt(31);constructor(t,e=new Fn(1,t)){super("month",1,t,f.day,e)}static create(t,e){switch(t){case 1:case 3:case 5:case 7:case 8:case 10:case 12:return this.ThirtyOneDays;case 2:return e%4===0?this.Month29:this.Month28;case 4:case 6:case 9:case 11:return this.ThirtyDays;default:throw new B("Unsupported month",t,e)}}}class q{static instance=new q;render(t){return t.value.toString()}}class V{unit;#t;constructor(t,e){this.unit=e,this.value=typeof t=="number"?t:t.value}get value(){return this.#t}set value(t){this.unit.validate(t),this.#t=t}get duration(){return this.value*this.unit.duration}#e(t){if(this.constructor.name!==t.constructor.name)throw new re(`${this.unit.name} "${this.toString()}" cannot be compared with ${t.unit?.name} "${t.toString()}"`)}compare(t){return this.#e(t),this.value-t.value}isEqual(t){return this.compare(t)===0}isBefore(t){return this.compare(t)<0}isAfter(t){return this.compare(t)>0}previous(t=this.unit){const e=this.value-1;return new this.constructor(e,t)}next(t=this.unit){const e=this.value+1;return new this.constructor(e,t)}toString(t=q.instance){return t.render(this)}toSpec(){return{value:this.value}}toJSON(){return this.toSpec()}}class l{static#t=new Map;static register(t,e){l.#t.set(t,e)}static get(t){const e=l.#t.get(t);if(!e)throw new B(`No default parser registered for ${t.name}: import "@rr0/time/defaults" or pass a parser to fromString()`);return e()}}class Mt extends V{constructor(t=new Date().getFullYear(),e=f.year){super(t,e)}static fromString(t,e=l.get(Mt)){return new Mt(e.parse(t))}}class J extends q{static default=new J("0",2);constructor(t,e){super(),this.char=t,this.size=e}render(t){return super.render(t).padStart(this.size,this.char)}}class Et extends V{constructor(t=new Date().getMonth()+1,e=f.month){super(t,e)}static fromString(t,e=l.get(Et)){return new Et(e.parse(t))}toString(t=J.default){return super.toString(t)}}class Nt extends V{constructor(t=new Date().getDate(),e=f.day){super(t,e)}static fromString(t,e=l.get(Nt)){const n=e.parse(t);return new Nt(n)}toString(t=J.default){return super.toString(t)}}class Gt extends V{constructor(t=new Date().getHours(),e=f.hour){super(t,e)}static fromString(t,e=l.get(Gt)){return new Gt(e.parse(t))}toString(t=J.default){return super.toString(t)}}class vt extends V{constructor(t=new Date().getMinutes(),e=f.minute){super(t,e)}static fromString(t,e=l.get(vt)){return new vt(e.parse(t))}toString(t=J.default){return super.toString(t)}}class Tt extends V{constructor(t=new Date().getSeconds(),e=f.second){super(t,e)}static fromString(t,e=l.get(Tt)){return new Tt(e.parse(t),f.second)}toString(t=J.default){return super.toString(t)}}class ct extends V{static renderer=new J("0",3);constructor(t,e=f.millisecond){super(t,e)}static parseFraction(t){return parseInt(t.padEnd(3,"0").substring(0,3),10)}toString(t=ct.renderer){return super.toString(t)}}class Bn{render(t){return t.toString()}}class Yn extends Bn{render(t){const e=t.value,n=Math.abs(e),r=Math.floor(n/60),i=n%60;if(r===0&&i===0)return"Z";{const a=e<0?"-":"+",u=r.toString().padStart(2,"0"),p=i>0?":"+i.toString().padEnd(2,"0"):"";return a+u+p}}}class ut{value;name="timeshift";renderer;constructor(t=0){this.value=t}static fromString(t,e=l.get(ut),n=void 0){const r=e.parse(t,n);return new ut(r)}toString(t=new Yn){return t.render(this)}toSpec(){return{value:this.value}}toJSON(){return this.toSpec()}}class j{static timeshift(t,e){return t+(j.isDaylight(e)?60:0)}static isDaylight(t){const{year:e,month:n,day:r}=t,i=t.hour??12;if(![e,n,r].every(Number.isInteger))throw new RangeError("Daylight saving time depends on the year, month and day");const a=j.rule(e);if(!a)return!1;const u=j.rank(n,r,i);return u>=j.rank(a.start.month,a.start.day,2)&&u<j.rank(a.end.month,a.end.day,2)}static rule(t){if(t<1967)return;const e={month:10,day:j.sunday(t,10,-1)};return t>=2007?{start:{month:3,day:j.sunday(t,3,2)},end:{month:11,day:j.sunday(t,11,1)}}:t>=1987?{start:{month:4,day:j.sunday(t,4,1)},end:e}:t===1975?{start:{month:2,day:23},end:e}:t===1974?{start:{month:1,day:6},end:e}:{start:{month:4,day:j.sunday(t,4,-1)},end:e}}static sunday(t,e,n){const r=new Date(Date.UTC(2e3,e-1,1));r.setUTCFullYear(t);const i=1+(7-r.getUTCDay())%7;if(n>0)return i+7*(n-1);const a=[31,j.isLeap(t)?29:28,31,30,31,30,31,31,30,31,30,31][e-1];let u=i;for(;u+7<=a;)u+=7;return u}static isLeap(t){return t%4===0&&(t%100!==0||t%400===0)}static rank(t,e,n){return(t*100+e)*100+n}}const Hn={name:"PST",timeshift:"-08",title:"Pacific Standard Time (US)"},qn={name:"PDT",timeshift:"-07",title:"Pacific Daylight Time (US)"},Xn={name:"MDT",timeshift:"-06",title:"Mountain Standard Time (US)"},Wn={name:"MST",timeshift:"-07",title:"Mountain Daylight Time (US)"},Jn={name:"PT",timeshift:s=>j.timeshift(-480,s),title:"Pacific Time (US)"},Dn={name:"MT",timeshift:s=>j.timeshift(-420,s),title:"Mountain Time (US)"},Zn={name:"CT",timeshift:s=>j.timeshift(-360,s),title:"Central Time (US)"},Kn={name:"ET",timeshift:s=>j.timeshift(-300,s),title:"Eastern Time (US)"},Qn={name:"CWT",timeshift:"-05",title:"Central War Time (US)"},Pn={name:"CDT",timeshift:"-05",title:"Central Daylight Time"},Ln={name:"EST",timeshift:"-05",title:"Eastern Standard Time (US)"},_n={name:"EDT",timeshift:"-04",title:"Eastern Time (US)"},tr={name:"AST",timeshift:"-04",title:"Atlantic Standard Time (US)"},er={name:"ADT",timeshift:"-03",title:"Atlantic Daylight Time (US)"},nr={name:"UTC",timeshift:"Z",title:"Coordinated Universal Time"},rr={name:"Z",timeshift:"Z",title:"UTC"},sr={name:"GMT",timeshift:"Z",title:"Greenwich Mean Time"},or={name:"BST",timeshift:"+01",title:"British Summer Time"},ir={name:"CEST",timeshift:"+02",title:"Central European Summer Time"},ar={name:"CET",timeshift:"+01",title:"Central European Time"},ur={name:"MSK",timeshift:"+03",title:"Moscow Time (RU)"},cr={name:"IST",timeshift:"+05:30",title:"Indian Standard Time"},mr={name:"BJT",timeshift:"+08",title:"Beijing Time"},dr={name:"CST",timeshift:"-06",title:"Central Standard Time"},pr={name:"JST",timeshift:"+09",title:"Japan Standard Time"},lr={name:"AEST",timeshift:"+10",title:"Australian Eastern Standard Time"},hr={name:"NZST",timeshift:"+12",title:"New Zealand Standard Time"},fr={name:"LST",timeshift:"?",title:"Local Sideral Time"},Fe=[er,lr,tr,mr,or,dr,Pn,ar,ir,Zn,Qn,_n,Ln,Kn,sr,cr,pr,fr,Xn,ur,Wn,Dn,hr,qn,Hn,Jn,nr,rr];class se{static instance=new se;renderComponent(t,e){return t[e].toString()}renderSecond(t){return this.renderComponent(t,"second")+(t.millisecond?"."+t.millisecond.toString():"")}render(t){const e=[];t.year&&e.push(this.renderComponent(t,"year")),t.month&&e.push(this.renderComponent(t,"month")),t.day&&e.push(this.renderComponent(t,"day"));const n=[];t.hour&&n.push(this.renderComponent(t,"hour")),t.minute&&n.push(this.renderComponent(t,"minute")),t.second&&n.push(this.renderSecond(t));const r=e.join("-"),i=t.timeshift?t.timeshift.toString():"",a=n.join(":")+i;return r+(a.length>0?"T"+a:"")}}class mt extends B{constructor(t="method is abstract"){super(t)}}class Ee{units;constructor(t){this.units=t}newYear(t){throw new mt}newMonth(t){throw new mt}newDay(t){throw new mt}newHour(t){throw new mt}newMinute(t){throw new mt}newSecond(t){throw new mt}}class gr extends Me{millisecond=new N("milliseconds",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,void 0);second=new N("seconds",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.millisecond);minute=new N("minutes",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.second);hour=new N("hours",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.minutes);day=new N("days",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.hour);month=new N("months",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.day);year=new N("years",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const Pt=new gr;class oe{static instance=new oe;render(t){const e=H.toSpec(t);let n="P";const r=e.years;r&&(n+=r.toString()+"Y");const i=e.months;i&&(n+=i.toString(q.instance)+"MM");const a=e.days;a&&(n+=a.toString(q.instance)+"D");const u=e.hours;u&&(n+=u.toString(q.instance)+"H");const p=e.minutes;p&&(n+=p.toString(q.instance)+"M");const c=e.seconds;return c&&(n+=c.toString(q.instance)+"S"),n}}class H extends V{constructor(t={years:new Date().getFullYear(),months:new Date().getMonth(),days:new Date().getDate(),hours:new Date().getHours(),minutes:new Date().getMinutes(),seconds:new Date().getSeconds(),milliseconds:new Date().getMilliseconds()}){super({value:typeof t=="number"?t:+(t.years?t.years*f.year.duration:0)+(t.months?t.months*f.month.duration:0)+(t.days?t.days*f.day.duration:0)+(t.hours?t.hours*f.hour.duration:0)+(t.minutes?t.minutes*f.minute.duration:0)+(t.seconds?t.seconds*f.second.duration:0)},new N("millisecond",0,Number.MAX_SAFE_INTEGER,void 0))}static toSpec(t,e=Sr){let n=typeof t=="number"?t:t.value;const r=n>0?1:-1;n=Math.abs(n);const i={},a=n/f.year.duration,u=Math.floor(a);u>0&&(i.years=e.newYear(r*u),n-=u*f.year.duration);const p=n/f.month.duration,c=Math.floor(p);c>0&&(i.months=e.newMonth(r*c),n-=c*f.month.duration);const d=n/f.day.duration,m=Math.floor(d);m>0&&(i.days=e.newDay(r*m),n-=m*f.day.duration);const w=n/f.hour.duration,y=Math.floor(w);y>0&&(i.hours=e.newHour(r*y),n-=y*f.hour.duration);const b=n/f.minute.duration,S=Math.floor(b);S>0&&(i.minutes=e.newMinute(r*S),n-=S*f.minute.duration);const T=n/f.second.duration,g=Math.floor(r*T);return g>0&&(i.seconds=e.newSecond(g)),i}static fromString(t,e=l.get(H)){return new H(e.parse(t))}static between(t,e){const n=e.getTime(),r=t.getTime();return new H(n-r)}toSpec(){return H.toSpec(this)}toString(t=oe.instance){return t.render(this)}}class $n extends Ee{constructor(t){super(t)}newYear(t){return new Mt(t,this.units.year)}newMonth(t){return new Et(t,this.units.month)}newDay(t){return new Nt(t,this.units.day)}newHour(t){return new Gt(t,this.units.hour)}newMinute(t){return new vt(t,this.units.minute)}newSecond(t){return new Tt(t,this.units.second)}newMillisecond(t){return new ct(t,this.units.millisecond)}newTimeshift(t){return new ut(typeof t=="number"?t:t.value)}}const wr=new $n(f),Sr=new $n(Pt);class I{#t;#e;#n;#r;#s;#o;#i;#a;constructor(t={year:new Date().getFullYear(),month:new Date().getMonth()+1,day:new Date().getDate(),hour:new Date().getHours(),minute:new Date().getMinutes(),second:new Date().getSeconds(),timeshift:I.timeshiftOf(new Date)}){this.year=t.year,this.month=t.month,this.day=t.day,this.hour=t.hour,this.minute=t.minute,this.second=t.second,this.millisecond=t.millisecond,this.timeshift=t.timeshift}get year(){return this.#t}set year(t){const e=typeof t=="number";this.#t&&e?this.#t.value=t:this.#t=e?this.factory.newYear(t):!t||t.start||t instanceof V?t:this.factory.newYear(t)}get month(){return this.#e}set month(t){const e=typeof t=="number";this.#e&&e?this.#e.value=t:this.#e=e?this.factory.newMonth(t):!t||t.start||t instanceof V?t:this.factory.newMonth(t)}get day(){return this.#n}set day(t){const e=typeof t=="number";this.#n&&e?this.#n.value=t:this.#n=e?this.factory.newDay(t):!t||t.start||t instanceof V?t:this.factory.newDay(t)}get hour(){return this.#r}set hour(t){const e=typeof t=="number";this.#r&&e?this.#r.value=t:this.#r=e?this.factory.newHour(t):!t||t.start||t instanceof V?t:this.factory.newHour(t)}get minute(){return this.#s}set minute(t){const e=typeof t=="number";this.#s&&e?this.#s.value=t:this.#s=e?this.factory.newMinute(t):!t||t.start||t instanceof V?t:this.factory.newMinute(t)}get second(){return this.#o}set second(t){const e=typeof t=="number";this.#o&&e?this.#o.value=t:this.#o=e?this.factory.newSecond(t):!t||t.start||t instanceof V?t:this.factory.newSecond(t)}get millisecond(){return this.#i}set millisecond(t){const e=typeof t=="number";this.#i&&e?this.#i.value=t:this.#i=e||t&&!(t instanceof V)?this.factory.newMillisecond(t):t}get timeshift(){return this.#a}set timeshift(t){const e=typeof t=="number";this.#a&&e?this.#a.value=t:this.#a=e||t&&!(t instanceof ut)?this.factory.newTimeshift(t):t}get factory(){return wr}static fromString(t,e=l.get(I)){const{year:n,month:r,day:i,hour:a,minute:u,second:p,millisecond:c,timeshift:d}=e.parse(t);return new I({year:n,month:r,day:i,hour:a,minute:u,second:p,millisecond:c,timeshift:d})}static timeshiftOf(t){return-t.getTimezoneOffset()||0}static fromDate(t){return new I({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:I.timeshiftOf(t)})}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),n=t.substring(0,e)+t.substring(e+4);return I.fromString(n)}#u(t){if(this.constructor.name!==t.constructor.name)throw new re(`Date "${this.toString()}" cannot be compared with "${t.toString()}"`)}compare(t){return this.#u(t),this.getTime()-t.getTime()}delta(t){const e=this.compare(t);return new H(e)}getTime(){return(this.year?.duration||0)+(this.month?.duration||0)+(this.day?.duration||0)+(this.hour?.duration||0)+(this.minute?.duration||0)+(this.second?.duration||0)+(this.millisecond?.duration||0)}isEqual(t){return this.compare(t)===0}isBefore(t){return this.compare(t)<0}isAfter(t){return this.compare(t)>0}clone(){return new I(this.toSpec())}previous(){let t=this.clone();try{t.second=this.second.previous()}catch{try{t.minute=this.minute.previous()}catch{try{t.hour=this.hour.previous()}catch{try{t.day=this.day.previous()}catch{try{t.month=this.month.previous()}catch{t.year=this.year.previous()}}}}}return t}next(){let t=this.clone();try{t.second=this.second.next()}catch{try{t.minute=this.minute.next()}catch{try{t.hour=this.hour.next()}catch{try{t.day=this.day.next()}catch{try{t.month=this.month.next()}catch{t.year=this.year.next()}}}}}return t}toString(t=se.instance){return t.render(this)}toSpec(){const t={},e=this.year?.toSpec();e&&(t.year=e);const n=this.month?.toSpec();n&&(t.month=n);const r=this.day?.toSpec();r&&(t.day=r);const i=this.hour?.toSpec();i&&(t.hour=i);const a=this.minute?.toSpec();a&&(t.minute=a);const u=this.second?.toSpec();u&&(t.second=u);const p=this.millisecond?.toSpec();p&&(t.millisecond=p);const c=this.timeshift?.toSpec();return c&&(t.timeshift=c),t}toJSON(){return this.toSpec()}}class Ne{static instance=new Ne;render(t){return(t.start?t.start.toString():"")+"/"+(t.end?t.end.toString():"")}}class Ft{constructor(t,e){this.start=t,this.end=e}_start;get start(){return this._start}set start(t){if(typeof t=="string"&&(t=I.fromString(t)),t&&!(t instanceof I)&&!(t instanceof H))throw new B("Interval start is not a level 0 date or duration: "+t);this._start=t}_end;get end(){return this._end}set end(t){if(typeof t=="string"&&(t=I.fromString(t)),t&&!(t instanceof I)&&!(t instanceof H))throw new B("Interval end is not a level 0 date or duration: "+t);this._end=t}static fromString(t,e=l.get(Ft)){const{start:n,end:r}=e.parse(t);return new Ft(n,r)}toString(t=Ne.instance){return t.render(this)}[Symbol.iterator](){let t=this.start;return{next:()=>{const e={done:t>this.end,value:t};return t++,e}}}}class Lt extends q{static instance=new Lt(J.default);constructor(t){super(),this.valueRenderer=t}render(t){return(this.valueRenderer?this.valueRenderer.render(t):super.render(t))+this.qualifier(t)}qualifier(t){return t.uncertain?t.approximate?"%":"?":t.approximate?"~":""}}class W extends V{#t;#e;constructor(t,e){super(t,e),this.#t=t.uncertain||!1,this.#e=t.approximate||!1}get uncertain(){return this.#t}set uncertain(t){return this.#t=t}get approximate(){return this.#e}set approximate(t){return this.#e=t}isCertainAndPrecise(){return!this.approximate&&!this.uncertain}isEqual(t){return this.isCertainAndPrecise()&&super.isEqual(t)}isBefore(t){return this.isCertainAndPrecise()&&super.isBefore(t)}isAfter(t){return this.isCertainAndPrecise()&&super.isAfter(t)}toString(t=Lt.instance){return super.toString(t)}toSpec(){return{...super.toSpec(),uncertain:this.uncertain,approximate:this.approximate}}toJSON(){return this.toSpec()}}class In extends Rn{year=new N("year",-9999,9999,this.month);yearExtended=new N("year",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const te=new In;class nt extends W{constructor(t,e=te.year){super(t,e)}static fromString(t,e=te.year,n=l.get(nt)){const r=n.parse(t),i=r.value.start;if(t.startsWith("Y")&&(e=te.yearExtended),i!==void 0){const a=new nt(Object.assign({...r},{value:Math.max(i,e.min)})),u=new nt(Object.assign({...r},{value:Math.min(r.value.end,e.max)}));return{start:a,end:u}}else return new nt(r,e)}}class Cn extends re{monthValidator=new Fn;validate(t){switch(t){case 21:case 22:case 23:case 24:return!0;default:return this.monthValidator.validate(t)}}}class rt extends W{constructor(t,e=new N(f.month.name,1,24,f.day,new Cn)){super(t,e)}static fromString(t,e=l.get(rt)){const n=e.parse(t),r=n.value.start;if(r!==void 0){let i=f.month;const a=new rt(Object.assign({...n},{value:Math.max(r,i.min)})),u=new rt(Object.assign({...n},{value:Math.min(n.value.end,i.max)}));return{start:a,end:u}}else return new rt(n)}toString(t){return super.toString(t).padStart(2,"0")}}class st extends W{constructor(t,e=f.day){super(t,e)}static fromString(t,e=l.get(st)){const n=e.parse(t),r=n.value.start;if(r!==void 0){let i=f.day;const a=new st(Object.assign({...n},{value:Math.max(r,i.min)})),u=new st(Object.assign({...n},{value:Math.min(n.value.end,i.max)}));return{start:a,end:u}}else return new st(n)}toString(t){return super.toString(t).padStart(2,"0")}}class ot extends W{constructor(t,e=f.hour){super(t,e)}static fromString(t,e=l.get(ot)){const n=e.parse(t),r=n.value.start;if(r!==void 0){let i=f.hour;const a=new ot(Object.assign({...n},{value:Math.max(r,i.min)})),u=new ot(Object.assign({...n},{value:Math.min(n.value.end,i.max)}));return{start:a,end:u}}else return new ot(n)}}class it extends W{constructor(t,e=f.minute){super(t,e)}static fromString(t,e=l.get(it)){const n=e.parse(t),r=n.value.start;if(r!==void 0){const i=f.minute,a=new it(Object.assign({...n},{value:Math.max(r,i.min)})),u=new it(Object.assign({...n},{value:Math.min(n.value.end,i.max)}));return{start:a,end:u}}else return new it(n)}toString(t=Lt.instance){return super.toString(t)}}class at extends W{constructor(t,e=f.second){super(t,e)}static fromString(t,e=l.get(at)){const n=e.parse(t),r=n.value.start;if(r!==void 0){const i=f.second,a=new at(Object.assign({...n},{value:Math.max(r,i.min)})),u=new at(Object.assign({...n},{value:Math.min(n.value.end,i.max)}));return{start:a,end:u}}else return new at(n)}}class lt extends ut{static fromString(t,e=l.get(lt),n=void 0){return new lt(e.parse(t,n))}}class Un extends Ee{constructor(t){super(t)}newYear(t){return new nt(t,this.units.year)}newMonth(t){return new rt(t,this.units.month)}newDay(t){return new st(t,this.units.day)}newHour(t){return new ot(t,this.units.hour)}newMinute(t){return new it(t,this.units.minute)}newSecond(t){return new at(t,this.units.second)}newMillisecond(t){return new ct(t,this.units.millisecond)}newTimeshift(t){return new lt(typeof t=="number"?t:t.value)}}const yr=new Un(te),br=new Un(Pt);class O extends I{constructor(t){super(t)}get factory(){return yr}get uncertain(){return this.year?.uncertain===!0||this.month?.uncertain===!0||this.day?.uncertain===!0||this.hour?.uncertain===!0||this.minute?.uncertain===!0||this.second?.uncertain===!0}get approximate(){return this.year?.approximate===!0||this.month?.approximate===!0||this.day?.approximate===!0||this.hour?.approximate===!0||this.minute?.approximate===!0||this.second?.approximate===!0}static fromDate(t){return new O({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:I.timeshiftOf(t)})}static fromString(t,e=l.get(O)){const n=e.parse(t);return new O(n)}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),n=t.substring(0,e)+t.substring(e+4);return O.fromString(n)}clone(){return new O(this.toSpec())}}const R=Object.freeze({year:"year",month:"month",day:"day",hour:"hour",minute:"minute",second:"second",timeshift:"timeshift",uncertain:"uncertain",approximate:"approx"});class ie extends oe{static instance=new ie;render(t){return super.render(t)}}class k extends W{constructor(t){super(typeof t=="number"||t.hasOwnProperty("value")?t:{value:k.getValue(t,R.year)+k.getValue(t,R.month)+k.getValue(t,R.day)+k.getValue(t,R.hour)+k.getValue(t,R.minute)+k.getValue(t,R.second),uncertain:k.getBoolean(t,R.uncertain),approximate:k.getBoolean(t,"approximate")},Pt.millisecond)}static getBoolean(t,e){return t[e]||t[R.year+"s"]?.[e]||t[R.month+"s"]?.[e]||t[R.day+"s"]?.[e]||t[R.hour+"s"]?.[e]||t[R.minute+"s"]?.[e]||t[R.second+"s"]?.[e]||!1}static getValue(t,e){let n=0,r=t[e+"s"];if(r instanceof W?r=r.value:typeof t=="number"&&(r=t),r){const i=f[e];n=r*i.duration}return n}static toSpec(t,e=br){return{...H.toSpec(t,e),uncertain:t.uncertain||!1,approximate:t.approximate||!1}}static fromString(t,e=l.get(k)){const n=e.parse(t);return new k(n)}static between(t,e){const n=e.getTime(),r=t.getTime();return new k(n-r)}toString(t=ie.instance){return super.toString(t)}toSpec(){return k.toSpec(this)}}class $t extends Ft{constructor(t,e){super(t,e)}get start(){return this._start}set start(t){if(typeof t=="string"&&(super.start=O.fromString(t)),t&&!(t instanceof O)&&!(t instanceof k))throw new B("Interval start is not a level 1 date or duration: "+t);this._start=t}get end(){return this._end}set end(t){if(typeof t=="string"&&(t=O.fromString(t)),t&&!(t instanceof O)&&!(t instanceof k))throw new B("Interval end is not a level 1 date or duration: "+t);this._end=t}static fromString(t,e=l.get($t)){const{start:n,end:r}=e.parse(t);return new $t(n,r)}}class kt extends W{uncertainComponent;approximateComponent;constructor(t,e){super(t,e),this.uncertainComponent=t.uncertainComponent||!1,this.approximateComponent=t.approximateComponent||!1}get uncertain(){return super.uncertain||this.uncertainComponent}set uncertain(t){return super.uncertain=t}get approximate(){return super.approximate||this.approximateComponent}set approximate(t){return super.approximate=t}get uncertainGroup(){return super.uncertain}get approximateGroup(){return super.approximate}toSpec(){return{...super.toSpec(),uncertain:this.uncertainGroup,approximate:this.approximateGroup,uncertainComponent:this.uncertainComponent,approximateComponent:this.approximateComponent}}toJSON(){return this.toSpec()}}class xr extends In{year=new N("year",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const be=new xr;class D extends kt{constructor(t,e=be.year){super(t,e)}static fromString(t,e=be.year,n=l.get(D)){const r=n.parse(t),i=r.value.start;if(i!==void 0){const a=new D(Object.assign({...r},{value:Math.max(i,e.min)})),u=new D(Object.assign({...r},{value:Math.min(r.value.end,e.max)})),p={start:a,end:u},c=r.value.estimate;return c&&(p.estimate=c),p}else return new D(r)}}class Mr extends Cn{validate(t){switch(t){case 25:case 26:case 27:case 28:case 29:case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:return!0;default:return super.validate(t)}}}class Z extends kt{constructor(t,e=new N(f.month.name,1,41,f.day,new Mr)){super(t,e)}static fromString(t,e=l.get(Z)){const n=e.parse(t),r=n.value.start;if(r!==void 0){const i=f.month,a=new Z(Object.assign({...n},{value:Math.max(r,i.min)})),u=new Z(Object.assign({...n},{value:Math.min(n.value.end,i.max)}));return{start:a,end:u}}else return new Z(n)}toString(t){return super.toString(t).padStart(2,"0")}}class K extends kt{constructor(t,e=f.day){super(t,e)}static fromString(t,e=l.get(K)){const n=e.parse(t),r=n.value.start;if(r!==void 0){const i=f.day,a=new K(Object.assign({...n},{value:Math.max(r,i.min)})),u=new K(Object.assign({...n},{value:Math.min(n.value.end,i.max)}));return{start:a,end:u}}else return new K(n)}toString(t){return super.toString(t).padStart(2,"0")}}class Q extends kt{constructor(t,e=f.hour){super(t,e)}static fromString(t,e=l.get(Q)){const n=e.parse(t),r=n.value.start;if(r!==void 0){const i=f.hour,a=new Q(Object.assign({...n},{value:Math.max(r,i.min)})),u=new Q(Object.assign({...n},{value:Math.min(n.value.end,i.max)}));return{start:a,end:u}}else return new Q(n)}}class P extends kt{constructor(t,e=f.minute){super(t,e)}static fromString(t,e=l.get(P)){const n=e.parse(t),r=n.value.start;if(r!==void 0){const i=f.minute,a=new P(Object.assign({...n},{value:Math.max(r,i.min)})),u=new P(Object.assign({...n},{value:Math.min(n.value.end,i.max)}));return{start:a,end:u}}else return new P(n)}}class L extends kt{constructor(t,e=f.second){super(t,e)}static fromString(t,e=f.second,n=l.get(L)){const r=n.parse(t),i=r.value.start;if(i!==void 0){const a=new L(Object.assign({...r},{value:Math.max(i,e.min)})),u=new L(Object.assign({...r},{value:Math.min(r.value.end,e.max)}));return{start:a,end:u}}else return new L(r,e)}}class jn extends lt{}class Er extends Lt{qualifier(){return""}}class et extends se{static instance=new et;static valueRenderer=new Er(J.default);static names=["year","month","day","hour","minute","second"];static qualifier(t,e){return t?e?"%":"?":e?"~":""}renderComponent(t,e){const n=t[e],r=et.names.slice(et.names.indexOf(e)+1).map(u=>t[u]).filter(Boolean),i=et.qualifier(n.uncertainComponent,n.approximateComponent),a=et.qualifier(n.uncertainGroup&&!n.uncertainComponent&&!r.some(u=>u.uncertain),n.approximateGroup&&!n.approximateComponent&&!r.some(u=>u.approximate));return i+n.toString(et.valueRenderer)+a}}class Vn extends Ee{constructor(t){super(t)}newYear(t){return new D(t,this.units.year)}newMonth(t){return new Z(t,this.units.month)}newDay(t){return new K(t,this.units.day)}newHour(t){return new Q(t,this.units.hour)}newMinute(t){return new P(t,this.units.minute)}newSecond(t){return new L(t,this.units.second)}newMillisecond(t){return new ct(t,this.units.millisecond)}newTimeshift(t){return new jn(typeof t=="number"?t:t.value)}}const Nr=new Vn(be),Gr=new Vn(Pt);class z extends O{constructor(t){super(t)}toString(t=et.instance){return super.toString(t)}get year(){return super.year}set year(t){super.year=t}get month(){return super.month}set month(t){super.month=t}get factory(){return Nr}static fromDate(t){return new z({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:I.timeshiftOf(t)})}static fromString(t,e=l.get(z)){const n=e.parse(t);return new z(n)}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),n=t.substring(0,e)+t.substring(e+4);return z.fromString(n)}clone(){return new z(this.toSpec())}}class _{regExp;constructor(t,e){this.name=t,this.regExp=new RegExp(`^(?:${e})$`)}regexGroups(t){const e=this.regExp.exec(t);if(!e)throw new B(`Invalid ${this.name} "${t}"`);return e.groups}parseGroups(t){throw new mt(`${this.constructor.name} is abstract`)}parse(t){const e=this.regexGroups(t);return this.parseGroups(e)}}class wt extends ie{static instance=new wt;static designators=[["years","Y"],["months","MM"],["days","D"],["hours","H"],["minutes","M"],["seconds","S"]];static qualifier(t,e){return t?e?"%":"?":e?"~":""}render(t){const e=wt.qualifier(t.uncertainDuration,t.approximateDuration);if(!t.hasQualifiedComponent)return e+super.render(t);let n=e+"P";for(const[r,i]of wt.designators){const a=t.components[r];a&&(n+=wt.qualifier(a.uncertainComponent,a.approximateComponent)+a.value+i)}return n}}class A extends k{#t;constructor(t){if(super(typeof t=="number"?t:{value:A.valueFromSpec(t),uncertain:t.uncertain===!0,approximate:t.approximate===!0},Pt.millisecond),typeof t!="number"){const e={};for(const n of A.componentNames)t[n]instanceof W&&(e[n]=t[n]);Object.keys(e).length>0&&(this.#t=e)}}static componentNames=["years","months","days","hours","minutes","seconds"];get components(){return this.#t}#e(t){return this.#t?Object.values(this.#t).some(e=>e[t]):!1}get uncertainDuration(){return super.uncertain}get approximateDuration(){return super.approximate}get uncertain(){return super.uncertain||this.#e("uncertain")}set uncertain(t){super.uncertain=t}get approximate(){return super.approximate||this.#e("approximate")}set approximate(t){super.approximate=t}get hasQualifiedComponent(){return this.#t?Object.values(this.#t).some(t=>t.uncertainComponent||t.approximateComponent):!1}static valueFromSpec(t){return A.getValue(t,R.year)+A.getValue(t,R.month)+A.getValue(t,R.day)+A.getValue(t,R.hour)+A.getValue(t,R.minute)+A.getValue(t,R.second)}static toSpec(t,e=Gr){const n=k.toSpec(t,e);if(t instanceof A&&t.hasQualifiedComponent)for(const r of A.componentNames)delete n[r],t.components[r]&&(n[r]=t.components[r]);return n}static fromString(t,e=l.get(A)){const n=e.parse(t);return new A(n)}static between(t,e){const n=e.getTime(),r=t.getTime();return new A(n-r)}toSpec(){return A.toSpec(this)}toString(t=wt.instance){return super.toString(t)}}class It extends $t{get start(){return this._start}set start(t){if(typeof t=="string"&&(super.start=z.fromString(t)),t&&!(t instanceof z)&&!(t instanceof A))throw new B("Interval start is not a level 2 date or duration: "+t);this._start=t}get end(){return this._end}set end(t){if(typeof t=="string"&&(t=z.fromString(t)),t&&!(t instanceof z)&&!(t instanceof A))throw new B("Interval end is not a level 2 date or duration: "+t);this._end=t}static fromString(t,e=l.get(It)){const{start:n,end:r}=e.parse(t);return new It(n,r)}}class ee extends Set{constructor(t,e){super(t),this.exclusive=e}has(t){const e=t.toString().replace("..","/");for(const n of this)if(n.toString()===e)return!0;return!1}static fromString(t,e=l.get(ee)){const{exclusive:n,values:r}=e.parse(t);return new ee(r,n)}}class tt extends _{constructor(t,e){super(t,e)}static read(t){return{value:t?parseInt(t,10):void 0}}parseGroups(t){return tt.read(t[this.name])}parse(t){if(t.startsWith("-"))throw new B(`${this.name} cannot be negative`);return super.parse(t)}}class o{static groupName(...t){return t.reduce((e,n)=>e?e+n.charAt(0).toUpperCase()+n.substring(1):n,"")}static group(t,...e){return`(?<${t}>${e.join("")})`}static optional(t){return t+"?"}static nonCapturingGroup(...t){return`(?:${t.join("")})`}static optionalGroup(t,...e){return o.optional(o.group(t,...e))}static optionalNonCapturingGroup(...t){return o.optional(o.nonCapturingGroup(...t))}static numberGroup(t,e,n,r="\\d"){return o.group(t,`${n||""}[${r}]${e}`)}}const $e="yearValue";class Ct extends tt{static format(t=""){return o.numberGroup(o.groupName(t,$e),"{4}",void 0)}constructor(){super($e,Ct.format())}}const Ie="monthValue";class Ut extends tt{static format(t=""){return o.numberGroup(o.groupName(t,Ie),"{1,2}",void 0)}constructor(){super(Ie,Ut.format())}}const Ce="dayValue";class bt extends tt{static format(t=""){return o.numberGroup(o.groupName(t,Ce),"{1,2}",void 0)}constructor(){super(Ce,bt.format())}}const Ue="hourValue";class xt extends tt{static format(t=""){return o.numberGroup(o.groupName(t,Ue),"{1,2}",void 0)}constructor(){super(Ue,xt.format())}}const je="minuteValue";class jt extends tt{static format(t=""){return o.numberGroup(o.groupName(t,je),"{1,2}",void 0)}constructor(){super(je,jt.format())}}const Ve="secondValue";class Vt extends tt{static format(t=""){return o.numberGroup(o.groupName(t,Ve),"{1,2}",void 0)}constructor(){super(Ve,Vt.format())}}const Oe="timeshiftValue",ze="shiftHour",Be="shiftMinute";class At extends _{static format(t=""){return Fe.map(e=>e.name).join("|")+"|"+o.nonCapturingGroup(o.group(t+ze,o.numberGroup(o.groupName(t,Oe),"{2}","[+-]")),o.optionalNonCapturingGroup(":?",o.numberGroup(o.groupName(t,Be),"{2}",void 0)))}constructor(){super(Oe,At.format())}parse(t,e){let n=0;const r=Fe.find(i=>i.name===t);if(r){if(typeof r.timeshift=="function")try{return r.timeshift(e??{})}catch(i){throw new B(`The time zone ${t} depends on the date: ${i.message}`)}t=r.timeshift}if(t!=="Z"){const i=this.regexGroups(t),a=i[ze];a&&(n+=parseInt(a,10)*60);const u=i[Be];u&&(n+=parseInt(u,10))}return n}}const Ye="year",He="month",qe="day",Xe="hour",We="minute",Je="second",De="millisecond",Ze="timeshift";class dt extends _{static format(t=""){return o.group(o.groupName(t,Ye),Ct.format(t))+o.optionalNonCapturingGroup("-",o.group(o.groupName(t,He),Ut.format(t)),o.optionalNonCapturingGroup("-",o.group(o.groupName(t,qe),bt.format(t)),o.optionalNonCapturingGroup("[T ]",o.group(o.groupName(t,Xe),xt.format(t)),":?",o.group(o.groupName(t,We),jt.format(t)),o.optionalNonCapturingGroup(":",o.group(o.groupName(t,Je),Vt.format(t)),o.optionalNonCapturingGroup("[.,]",o.group(o.groupName(t,De),"\\d+"))),"\\s*",o.optionalGroup(o.groupName(t,Ze),At.format(t)))))}constructor(){super("date",dt.format())}parse(t){const e=this.regexGroups(t),n=e[Ye],r=e[He],i=e[qe],a=e[Xe],u=e[We],p=e[Je],c=e[De],d=e[Ze],m=n?new Mt(Ct.read(n)):void 0,w=r?Ut.read(r):void 0;return{year:m,month:w?new Et(w,gt.create(w.value,m?.value)):void 0,day:i?new Nt(bt.read(i)):void 0,hour:a?new Gt(xt.read(a)):void 0,minute:u?new vt(jt.read(u)):void 0,second:p?new Tt(Vt.read(p)):void 0,millisecond:c?ct.parseFraction(c):void 0,timeshift:d?ut.fromString(d,new At,{year:m?.value,month:w?.value,day:i?bt.read(i).value:void 0,hour:a?xt.read(a).value:void 0}):void 0}}}const Ke="years",ce="months",vr="days",Qe="hours",Pe="minutes",Le="seconds";class Ge extends _{static format(t=""){return"P"+o.optionalNonCapturingGroup(o.numberGroup(o.groupName(t,Ke),"+",void 0,"\\d"),"Y")+o.optionalNonCapturingGroup(o.numberGroup(o.groupName(t,ce),"+",void 0,"\\d"),"MM")+o.optionalNonCapturingGroup(o.numberGroup(o.groupName(t,vr),"+",void 0,"\\d"),"D")+o.optionalNonCapturingGroup(o.numberGroup(o.groupName(t,Qe),"+",void 0,"\\d"),"H")+o.optionalNonCapturingGroup(o.numberGroup(o.groupName(t,Pe),"+",void 0,"\\d"),"M")+o.optionalNonCapturingGroup(o.numberGroup(o.groupName(t,Le),"+",void 0,"\\d"),"S")}constructor(){super("duration",Ge.format())}parseGroups(t){return{years:t[Ke],months:t[ce],days:t[ce],hours:t[Qe],minutes:t[Pe],seconds:t[Le]}}}const me="start",de="end";class ve extends _{static format=o.group(me,dt.format(me))+"/"+o.group(de,dt.format(de));constructor(){super("interval",ve.format)}parse(t){const e=this.regexGroups(t),n=e[me],r=e[de];return{start:n?I.fromString(n,new dt):void 0,end:r?I.fromString(r,new dt):void 0}}}l.register(I,()=>new dt);l.register(Nt,()=>new bt);l.register(H,()=>new Ge);l.register(Gt,()=>new xt);l.register(Ft,()=>new ve);l.register(vt,()=>new jt);l.register(Et,()=>new Ut);l.register(Tt,()=>new Vt);l.register(ut,()=>new At);l.register(Mt,()=>new Ct);class G extends tt{static uncertainGroup="uncertain";static approximateGroup="approx";static uncertainAndApproximateGroup=G.uncertainGroup+G.approximateGroup;constructor(t,e){super(t,e)}static qualifierFormat(t,e){return o.optionalGroup(t,`\\${e}`)}static formatSuffix(t){return this.qualifierFormat(o.groupName(G.uncertainGroup,t),"?")+this.qualifierFormat(o.groupName(G.approximateGroup,t),"~")+this.qualifierFormat(o.groupName(G.uncertainAndApproximateGroup,t),"%")}static numberFormat(t,e,n){return o.numberGroup(t,e,n,"\\dX")+this.formatSuffix(t)}getValueAndSign(t){let e=t[this.name],n;return e.charAt(0)==="-"?(n=-1,e=e.substring(1)):n=1,{valueStr:e,sign:n}}parseGroups(t){const{valueStr:e,sign:n}=this.getValueAndSign(t);let r=0,i;for(i=0;i<e.length;i++){const c=e[i];if(c==="X")break;r=r*10+parseInt(c,10)}if(i<e.length){let c=1;for(let w=0;w<e.length-i;w++)c*=10;const d=n*r*c,m=d+c-1;r={start:d,end:m}}else r*=n;const a=t[o.groupName(G.uncertainAndApproximateGroup,this.name)],u=t[o.groupName(G.approximateGroup,this.name)]||a,p=t[o.groupName(G.uncertainGroup,this.name)]||a;return{value:r,approximate:u?!!u:!1,uncertain:p?!!p:!1}}}const _e="yearValue";class Ot extends G{constructor(){super(_e,Ot.format())}static format(t=""){return"Y?"+G.numberFormat(o.groupName(t,_e),"+","[-]?")}parse(t){const e=this.regexGroups(t);return this.parseGroups(e)}}const tn="monthValue";class zt extends G{static format(t=""){return G.numberFormat(o.groupName(t,tn),"{1,2}",void 0)}constructor(){super(tn,zt.format())}}const en="dayValue";class Bt extends G{static format(t=""){return G.numberFormat(o.groupName(t,en),"{1,2}",void 0)}constructor(){super(en,Bt.format())}}const nn="hourValue";class Yt extends G{static format(t=""){return G.numberFormat(o.groupName(t,nn),"{1,2}",void 0)}constructor(){super(nn,Yt.format())}}const rn="minuteValue";class Ht extends G{static format(t=""){return G.numberFormat(o.groupName(t,rn),"{1,2}",void 0)}constructor(){super(rn,Ht.format())}}const sn="secondValue";class qt extends G{static format(t=""){return G.numberFormat(o.groupName(t,sn),"{1,2}",void 0)}constructor(){super(sn,qt.format())}}class Xt extends At{}class v extends _{static yearGroup="year";static monthGroup="month";static dayGroup="day";static hourGroup="hour";static minuteGroup="minute";static secondGroup="second";static millisecondGroup="millisecond";static timeshiftGroup="timeshift";constructor(t=v.format()){super("date",t)}static format(t=""){return o.group(o.groupName(t,v.yearGroup),Ot.format(t))+o.optionalNonCapturingGroup("-",o.group(o.groupName(t,v.monthGroup),zt.format(t)),o.optionalNonCapturingGroup("-",o.group(o.groupName(t,v.dayGroup),Bt.format(t)),o.optionalNonCapturingGroup("[T ]",o.group(o.groupName(t,v.hourGroup),Yt.format(t)),":",o.group(o.groupName(t,v.minuteGroup),Ht.format(t)),o.optionalNonCapturingGroup(":",o.group(o.groupName(t,v.secondGroup),qt.format(t)),o.optionalNonCapturingGroup("[.,]",o.group(o.groupName(t,v.millisecondGroup),"\\d+"))),o.optionalGroup(o.groupName(t,v.timeshiftGroup),Xt.format(t)))))}parseGroups(t){const e=t[v.millisecondGroup],n=e?ct.parseFraction(e):void 0,r=t[v.secondGroup],i=r?at.fromString(r,new qt):void 0,a=t[v.minuteGroup];let u;a&&(u=it.fromString(a,new Ht),u.uncertain=u.uncertain||i?.uncertain||!1,u.approximate=u.approximate||i?.approximate||!1);const p=t[v.hourGroup];let c;p&&(c=ot.fromString(p,new Yt),c.uncertain=c.uncertain||u?.uncertain||!1,c.approximate=c.approximate||u?.approximate||!1);const d=t[v.dayGroup];let m;d&&(m=st.fromString(d,new Bt),m.uncertain=m.uncertain||c?.uncertain||!1,m.approximate=m.approximate||c?.approximate||!1);const w=t[v.monthGroup];let y;w&&(y=rt.fromString(w,new zt),y.uncertain=y.uncertain||m?.uncertain||!1,y.approximate=y.approximate||m?.approximate||!1);const b=t[v.yearGroup];let S;b&&(S=nt.fromString(b,void 0,new Ot),S.uncertain=S.uncertain||y?.uncertain||!1,S.approximate=S.approximate||y?.approximate||!1);const T=t[v.timeshiftGroup],g=T?lt.fromString(T,new Xt,{year:S?.value,month:y?.value,day:m?.value,hour:c?.value}):void 0;return{year:S,month:y,day:m,hour:c,minute:u,second:i,millisecond:n,timeshift:g}}}const on="years",an="months",un="days",cn="hours",mn="minutes",dn="seconds";class pt extends G{static format(t=""){return"P"+o.optionalNonCapturingGroup(o.numberGroup(o.groupName(t,on),"+",void 0,"\\d"),"Y")+o.optionalNonCapturingGroup(o.numberGroup(o.groupName(t,an),"+",void 0,"\\d"),"MM")+o.optionalNonCapturingGroup(o.numberGroup(o.groupName(t,un),"+",void 0,"\\d"),"D")+o.optionalNonCapturingGroup(o.numberGroup(o.groupName(t,cn),"+",void 0,"\\d"),"H")+o.optionalNonCapturingGroup(o.numberGroup(o.groupName(t,mn),"+",void 0,"\\d"),"M")+o.optionalNonCapturingGroup(o.numberGroup(o.groupName(t,dn),"+",void 0,"\\d"),"S")+this.formatSuffix(t)}constructor(){super("duration",pt.format())}parseGroups(t){return{years:t[on],months:t[an],days:t[un],hours:t[cn],minutes:t[mn],seconds:t[dn],uncertain:!!t[G.uncertainGroup],approximate:!!t[G.approximateGroup]}}}const Tr="dates",pe="start",le="end",pn="durations",he="durationMin",fe="durationMax";class Te extends _{static format=o.group(Tr,o.optionalGroup(pe,o.group("openStart","\\.\\.")+"|"+v.format(pe))+"/"+o.optionalGroup(le,o.group("openEnd","\\.\\.")+"|"+v.format(le)))+"|"+o.group(pn,o.group(he,pt.format(he))+"/"+o.group(fe,pt.format(fe)));constructor(t="interval",e=Te.format){super(t,e)}parseGroups(t){let e,n;if(t[pn]){const i=t[he];e=k.fromString(i,new pt);const a=t[fe];n=k.fromString(a,new pt)}else{const i=t[pe];switch(i){case void 0:e=null;break;case"..":e=void 0;break;default:e=O.fromString(i,new v)}const a=t[le];switch(a){case void 0:n=null;break;case"..":n=void 0;break;default:n=O.fromString(a,new v)}}return{start:e,end:n}}}l.register(O,()=>new v);l.register(st,()=>new Bt);l.register(k,()=>new pt);l.register(ot,()=>new Yt);l.register($t,()=>new Te);l.register(it,()=>new Ht);l.register(rt,()=>new zt);l.register(at,()=>new qt);l.register(lt,()=>new Xt);l.register(nt,()=>new Ot);class M extends G{static uncertainGroup="uncertain1";static approximateGroup="approx1";static uncertainAndApproximateGroup=M.uncertainGroup+M.approximateGroup;constructor(t,e){super(t,e)}static numberFormat(t,e,n){return this.qualifierFormat(o.groupName(M.uncertainGroup,t),"?")+this.qualifierFormat(o.groupName(M.approximateGroup,t),"~")+this.qualifierFormat(o.groupName(M.uncertainAndApproximateGroup,t),"%")+G.numberFormat(t,e,n)}parseGroups(t){const e=super.parseGroups(t),n=t[o.groupName(M.uncertainAndApproximateGroup,this.name)];return(t[o.groupName(M.uncertainGroup,this.name)]||n)&&(e.uncertainComponent=!0),(t[o.groupName(M.approximateGroup,this.name)]||n)&&(e.approximateComponent=!0),e}}const Rt="yearValue",ln="exp",hn="signif";class Wt extends M{constructor(){super(Rt,Wt.format())}static format(t=""){return"Y?"+o.nonCapturingGroup(o.group(o.groupName(t,ln),"[-]?\\d+E\\d+")+"|"+M.numberFormat(o.groupName(t,Rt),"+","[-]?")+o.optionalGroup(o.groupName(t,hn),"S\\d+"))}parseGroups(t){const e=t[ln];if(e){const a=e.indexOf("E"),u=parseInt(e.substring(a+1),10),c=parseInt(e.substring(0,a),10)*Math.pow(10,u);t[Rt]=c.toString()}const n=t[hn],r=t[Rt];if(n){const a=parseInt(n.substring(1),10),{valueStr:u,sign:p}=this.getValueAndSign(t);let c="";for(let d=0;d<u.length;d++)c+=d<a?u.charAt(d):"X";t[Rt]=(p<0?"-":"")+c}const i=super.parseGroups(t);return n&&(i.value.estimate=parseInt(r,10)),i}parse(t){const e=this.regexGroups(t);return this.parseGroups(e)}}const fn="monthValue";class Jt extends M{static format(t=""){return M.numberFormat(o.groupName(t,fn),"{1,2}",void 0)}constructor(){super(fn,Jt.format())}}const gn="dayValue";class Dt extends M{static format(t=""){return M.numberFormat(o.groupName(t,gn),"{1,2}",void 0)}constructor(){super(gn,Dt.format())}}const wn="hourValue";class Zt extends M{static format(t=""){return M.numberFormat(o.groupName(t,wn),"{1,2}",void 0)}constructor(){super(wn,Zt.format())}}const Sn="secondValue";class Kt extends M{static format(t=""){return M.numberFormat(o.groupName(t,Sn),"{1,2}",void 0)}constructor(){super(Sn,Kt.format())}}const yn="minuteValue";class Qt extends M{static format(t=""){return M.numberFormat(o.groupName(t,yn),"{1,2}",void 0)}constructor(){super(yn,Qt.format())}}class Ar extends Xt{}class E extends _{static yearGroup=v.yearGroup;static monthGroup="month";static dayGroup="day";static hourGroup="hour";static minuteGroup="minute";static secondGroup="second";static millisecondGroup="millisecond";static timeshiftGroup="timeshift";constructor(){super("date",E.format())}static format(t=""){return o.group(o.groupName(t,E.yearGroup),Wt.format(t))+o.optionalNonCapturingGroup("-",o.group(o.groupName(t,E.monthGroup),Jt.format(t)),o.optionalNonCapturingGroup("-",o.group(o.groupName(t,E.dayGroup),Dt.format(t)),o.optionalNonCapturingGroup("[T ]",o.group(o.groupName(t,E.hourGroup),Zt.format(t)),":",o.group(o.groupName(t,E.minuteGroup),Qt.format(t)),o.optionalNonCapturingGroup(":",o.group(o.groupName(t,E.secondGroup),Kt.format(t)),o.optionalNonCapturingGroup("[.,]",o.group(o.groupName(t,E.millisecondGroup),"\\d+"))),o.optionalGroup(o.groupName(t,E.timeshiftGroup),Ar.format(t)))))}parseGroups(t){const e=t[E.millisecondGroup],n=e?ct.parseFraction(e):void 0,r=t[E.secondGroup];let i;r&&(i=L.fromString(r,void 0,new Kt),i.uncertain=i?.uncertain||!1,i.approximate=i?.approximate||!1);const a=t[E.minuteGroup];let u;a&&(u=P.fromString(a,new Qt),u.uncertain=u.uncertain||i?.uncertain||!1,u.approximate=u.approximate||i?.approximate||!1);const p=t[E.hourGroup];let c;p&&(c=Q.fromString(p,new Zt),c.uncertain=c.uncertain||u?.uncertain||!1,c.approximate=c.approximate||u?.approximate||!1);const d=t[E.dayGroup];let m;d&&(m=K.fromString(d,new Dt),m.uncertain=m.uncertain||c?.uncertain||!1,m.approximate=m.approximate||c?.approximate||!1);const w=t[E.monthGroup];let y;w&&(y=Z.fromString(w,new Jt),y.uncertain=y.uncertain||m?.uncertain||!1,y.approximate=y.approximate||m?.approximate||!1);const b=t[E.yearGroup];let S;b&&(S=D.fromString(b,void 0,new Wt),S.uncertain=S.uncertain||y?.uncertain||!1,S.approximate=S.approximate||y?.approximate||!1);const T=t[E.timeshiftGroup],g=T?jn.fromString(T,new Xt,{year:S?.value,month:y?.value,day:m?.value,hour:c?.value}):void 0;return{year:S,month:y,day:m,hour:c,minute:u,second:i,millisecond:n,timeshift:g}}}const bn="durationValue";class Ae extends M{static format(t=""){return"^"+M.numberFormat(o.groupName(t,bn),"+",void 0)}constructor(){super(bn,Ae.format())}}class kr extends Me{millisecond=new N("millisecond",0,Number.MAX_SAFE_INTEGER,void 0);second=new N("second",0,Number.MAX_SAFE_INTEGER,this.millisecond);minute=new N("minute",0,Number.MAX_SAFE_INTEGER,this.second);hour=new N("hour",0,Number.MAX_SAFE_INTEGER,this.minute);day=new N("day",1,Number.MAX_SAFE_INTEGER,this.hour);month=new N("month",1,Number.MAX_SAFE_INTEGER,this.day);year=new N("year",0,Number.MAX_SAFE_INTEGER,this.month)}const ht=new kr;class h extends M{static yearsGroup="years";static monthsGroup="months";static isoMonthsGroup="isoMonths";static daysGroup="days";static hoursGroup="hours";static minutesGroup="minutes";static secondsGroup="seconds";static durationGroup="duration";static suffixGroup="durationSuffix";static componentParser=new Ae;static componentFormat(t,e,n,r,i=""){const a=o.group(o.groupName(t,h.quantityGroup(e)),M.numberFormat(o.groupName(t,n),"+",void 0,"\\d"));return o.group(o.groupName(t,e),a,r,i)}static quantityGroup(t){return t+"Quantity"}static isoMonthsLookahead="(?=[?~%]?\\d+D|T)";constructor(){super("duration",h.format())}static format(t=""){const e=o.groupName(t,h.durationGroup);return this.qualifierFormat(o.groupName(M.uncertainGroup,e),"?")+this.qualifierFormat(o.groupName(M.approximateGroup,e),"~")+this.qualifierFormat(o.groupName(M.uncertainAndApproximateGroup,e),"%")+"P"+o.optional(h.componentFormat(t,h.yearsGroup,E.yearGroup,"Y"))+o.optionalNonCapturingGroup(h.componentFormat(t,h.monthsGroup,E.monthGroup,"MM")+"|"+h.componentFormat(t,h.isoMonthsGroup,"isoMonth","M",h.isoMonthsLookahead))+o.optional(h.componentFormat(t,h.daysGroup,E.dayGroup,"D"))+"T?"+o.optional(h.componentFormat(t,h.hoursGroup,E.hourGroup,"H"))+o.optional(h.componentFormat(t,h.minutesGroup,E.minuteGroup,"M"))+o.optional(h.componentFormat(t,h.secondsGroup,E.secondGroup,"S"))+o.optionalGroup(o.groupName(t,h.suffixGroup),"[?~%]")}static parseComponent(t,e,n){const r=h.componentParser.parse(t);return new e(r,n)}parseGroups(t){const e=t[h.quantityGroup(h.secondsGroup)];let n;e&&(n=h.parseComponent(e,L,ht.second),n.uncertain=!!t[o.groupName(M.uncertainGroup,h.secondsGroup)]||!1,n.approximate=!!t[o.groupName(M.approximateGroup,h.secondsGroup)]||!1);const r=t[h.quantityGroup(h.minutesGroup)];let i;r&&(i=h.parseComponent(r,P,ht.minute),i.uncertain=i.uncertain||n?.uncertain||!1,i.approximate=i.approximate||n?.approximate||!1);const a=t[h.quantityGroup(h.hoursGroup)];let u;a&&(u=h.parseComponent(a,Q,ht.hour),u.uncertain=u.uncertain||i?.uncertain||!1,u.approximate=u.approximate||i?.approximate||!1);const p=t[h.quantityGroup(h.daysGroup)];let c;p&&(c=h.parseComponent(p,K,ht.day),c.uncertain=c.uncertain||u?.uncertain||!1,c.approximate=c.approximate||u?.approximate||!1);const d=t[h.quantityGroup(h.monthsGroup)]||t[h.quantityGroup(h.isoMonthsGroup)];let m;d&&(m=h.parseComponent(d,Z,ht.month),m.uncertain=m.uncertain||c?.uncertain||!1,m.approximate=m.approximate||c?.approximate||!1);const w=t[h.quantityGroup(h.yearsGroup)];let y;w&&(y=h.parseComponent(w,D,ht.year),y.uncertain=y.uncertain||m?.uncertain||!1,y.approximate=y.approximate||m?.approximate||!1);const b=t[h.suffixGroup],S=!!t[o.groupName(M.uncertainAndApproximateGroup,h.durationGroup)]||b==="%",T=S||!!t[o.groupName(M.uncertainGroup,h.durationGroup)]||b==="?",g=S||!!t[o.groupName(M.approximateGroup,h.durationGroup)]||b==="~";return{years:y,months:m,days:c,hours:u,minutes:i,seconds:n,uncertain:T,approximate:g}}}const Rr="dates",ge="start",we="end",xn="durations",Se="durationMin",ye="durationMax";class ae extends _{static format=o.group(Rr,o.optionalGroup(ge,o.group("openStart","\\.\\.")+"|"+E.format(ge))+"/"+o.optionalGroup(we,o.group("openEnd","\\.\\.")+"|"+E.format(we)))+"|"+o.group(xn,o.group(Se,h.format(Se))+"/"+o.group(ye,h.format(ye)));constructor(t="interval",e=ae.format){super(t,e)}parseGroups(t){let e,n;if(t[xn]){const i=t[Se];e=A.fromString(i,new h);const a=t[ye];n=A.fromString(a,new h)}else{const i=t[ge];switch(i){case void 0:e=null;break;case"..":e=void 0;break;default:e=z.fromString(i,new E)}const a=t[we];switch(a){case void 0:n=null;break;case"..":n=void 0;break;default:n=z.fromString(a,new E)}}return{start:e,end:n}}}class Fr{parse(t){t=t.trim();const e=t.startsWith("["),r=t.substring(1,t.length-1).split(","),i=[];for(const a of r){let u;a.includes("..")?u=It.fromString(a.replace("..","/"),new ae):u=z.fromString(a,new E),i.push(u)}return{values:i,exclusive:e}}}l.register(z,()=>new E);l.register(K,()=>new Dt);l.register(A,()=>new h);l.register(Q,()=>new Zt);l.register(It,()=>new ae);l.register(P,()=>new Qt);l.register(Z,()=>new Jt);l.register(L,()=>new Kt);l.register(ee,()=>new Fr);l.register(D,()=>new Wt);class X{constructor(t){this.preferences=t}read(t){var e,n;if(t===void 0)return;if(typeof t=="string")return t===""?void 0:t;for(const i of this.preferences){const a=(e=t[i])!==null&&e!==void 0?e:t[X.base(i)];if(a)return a}const r=new Set(this.preferences.map(i=>X.base(i)));for(const[i,a]of Object.entries(t))if(a&&r.has(X.base(i)))return a;return(n=Object.values(t).find(i=>i))!==null&&n!==void 0?n:void 0}write(t,e,n){var r,i;const a=e?.trim()?e.trim():void 0;if(t===void 0||typeof t=="string")return a;const u={...t},p=(i=(r=Object.keys(u).find(c=>c===n))!==null&&r!==void 0?r:Object.keys(u).find(c=>X.base(c)===X.base(n)))!==null&&i!==void 0?i:n;return a===void 0?delete u[p]:u[p]=a,Object.keys(u).length===0?void 0:u}static base(t){return t.toLowerCase().split("-")[0]}}X.any=new X([]);var Mn;(function(s){s.abductee="abductee",s.actor="actor",s.artist="artist",s.anthropologist="anthropologist",s.archeologist="archeologist",s.astronaut="astronaut",s.astronomer="astronomer",s.astrologist="astrologist",s.astrophysicist="astrophysicist",s.banker="banker",s.barman="barman",s.biologist="biologist",s.biochemist="biochemist",s.biophysicist="biophysicist",s.bishop="bishop",s.businessman="businessman",s.botanist="botanist",s.cameraman="cameraman",s.chemist="chemist",s.contactee="contactee",s.cryptozoologist="cryptozoologist",s.dentist="dentist",s.director="director",s.diplomat="diplomat",s.diver="diver",s.electronics="electronics",s.engineer="engineer",s.ethnologist="ethnologist",s.exobiologist="exobiologist",s.farmer="farmer",s.firefighter="firefighter",s.flightAttendant="flightAttendant",s.geologist="geologist",s.geophysicist="geophysicist",s.geographer="geographer",s.historian="historian",s.houseWife="houseWife",s.hypnotherapist="hypnotherapist",s.illusionist="illusionist",s.journalist="journalist",s.judge="judge",s.lawyer="lawyer",s.leader="leader",s.librarian="librarian",s.logger="logger",s.mathematician="mathematician",s.mechanic="mechanic",s.meteorologist="meteorologist",s.military="military",s.musician="musician",s.neurologist="neurologist",s.neuroscientist="neuroscientist",s.neuropsychiatrist="neuropsychiatrist",s.nurse="nurse",s.oceanographer="oceanographer",s.painter="painter",s.parapsychologist="parapsychologist",s.philosopher="philosopher",s.photographer="photographer",s.physician="physician",s.physicist="physicist",s.pilot="pilot",s.politician="politician",s.policeman="policeman",s.priest="priest",s.producer="producer",s.prospector="prospector",s.psychologist="psychologist",s.psychiatrist="psychiatrist",s.radioastronomer="radioastronomer",s.radioamateur="radioamateur",s.salesman="salesman",s.sailor="sailor",s.sociologist="sociologist",s.softwareEngineer="softwareEngineer",s.stuntman="stuntman",s.taxiDriver="taxiDriver",s.teacher="teacher",s.telegrapher="telegrapher",s.truckDriver="truckDriver",s.ufologist="ufologist",s.ufoWitness="ufoWitness",s.ufoWitness2="ufoWitness2",s.worker="worker",s.writer="writer"})(Mn||(Mn={}));var En;(function(s){s.neutral="neutral",s.male="male",s.female="female"})(En||(En={}));const $r="modulepreload",Ir=function(s,t){return new URL(s,t).href},Nn={},_t=function(t,e,n){let r=Promise.resolve();if(e&&e.length>0){let a=function(d){return Promise.all(d.map(m=>Promise.resolve(m).then(w=>({status:"fulfilled",value:w}),w=>({status:"rejected",reason:w}))))};const u=document.getElementsByTagName("link"),p=document.querySelector("meta[property=csp-nonce]"),c=p?.nonce||p?.getAttribute("nonce");r=a(e.map(d=>{if(d=Ir(d,n),d in Nn)return;Nn[d]=!0;const m=d.endsWith(".css"),w=m?'[rel="stylesheet"]':"";if(!!n)for(let S=u.length-1;S>=0;S--){const T=u[S];if(T.href===d&&(!m||T.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${d}"]${w}`))return;const b=document.createElement("link");if(b.rel=m?"stylesheet":$r,m||(b.as="script"),b.crossOrigin="",b.href=d,c&&b.setAttribute("nonce",c),document.head.appendChild(b),m)return new Promise((S,T)=>{b.addEventListener("load",S),b.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${d}`)))})}))}function i(a){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=a,window.dispatchEvent(u),!u.defaultPrevented)throw a}return r.then(a=>{for(const u of a||[])u.status==="rejected"&&i(u.reason);return t().catch(i)})};class Cr extends Error{constructor(t,e){super(t),this.cause=e}}class ke extends Cr{constructor(t=ke.defaultMessage,e){super(t,e)}}ke.defaultMessage="Assertion failed";var Gn;(function(s){s.country="country",s.region="region",s.department="department",s.city="city",s.company="company"})(Gn||(Gn={}));var vn;(function(s){s.at="at",s.au="au",s.ar="ar",s.be="be",s.br="br",s.ca="ca",s.ch="ch",s.cn="cn",s.cl="cl",s.co="co",s.cy="cy",s.de="de",s.dk="dk",s.do="do",s.dz="dz",s.gr="gr",s.ec="ec",s.eg="eg",s.es="es",s.fi="fi",s.fr="fr",s.ga="ga",s.ge="ge",s.hu="hu",s.in="in",s.ie="ie",s.ir="ir",s.il="il",s.it="it",s.jp="jp",s.kr="kr",s.ma="ma",s.mx="mx",s.my="my",s.mz="mz",s.nl="nl",s.no="no",s.nz="nz",s.pa="pa",s.pe="pe",s.ph="ph",s.pl="pl",s.pt="pt",s.ro="ro",s.ru="ru",s.sc="sc",s.tr="tr",s.ua="ua",s.uk="uk",s.us="us",s.sa="sa",s.se="se",s.su="su",s.tn="tn",s.tw="tw",s.ve="ve",s.za="za"})(vn||(vn={}));class Tn{static NAMES=["weather","place","lightPollution","decor"];static KEYS={weather:["weatherTrack","weatherSource"],place:["place"],lightPollution:["lightPollution"],decor:["decor"]};static annexName(t,e){return`${t}.${e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}.json`}static fromFile(t,e){return t?.[e]!==void 0&&t[e].live!==!0}}class St{static DEFAULT_FOCAL_MM=50;static FOCAL_RANGE_MM={minMm:14,maxMm:135};static BODIES=[{id:"eos-450d",name:"Canon EOS 450D (APS-C)",widthMm:22.2,heightMm:14.8,pixelUm:5.2,year:2008},{id:"eos-60da",name:"Canon EOS 60Da (APS-C)",widthMm:22.3,heightMm:14.9,pixelUm:4.3,year:2012},{id:"eos-70d",name:"Canon EOS 70D (APS-C)",widthMm:22.5,heightMm:15,pixelUm:4.1,year:2013},{id:"eos-80d",name:"Canon EOS 80D (APS-C)",widthMm:22.3,heightMm:14.9,pixelUm:3.7,year:2016},{id:"eos-7d",name:"Canon EOS 7D (APS-C)",widthMm:22.3,heightMm:14.9,pixelUm:4.1,year:2009},{id:"eos-7d-ii",name:"Canon EOS 7D Mark II (APS-C)",widthMm:22.4,heightMm:15,pixelUm:4.1,year:2014},{id:"eos-5d",name:"Canon EOS 5D (full frame)",widthMm:35.8,heightMm:23.9,pixelUm:8.2,year:2005},{id:"eos-5d-ii",name:"Canon EOS 5D Mark II (full frame)",widthMm:36,heightMm:24,pixelUm:6.4,year:2008},{id:"eos-5d-iii",name:"Canon EOS 5D Mark III (full frame)",widthMm:36,heightMm:24,pixelUm:6.25,year:2012},{id:"eos-5d-iv",name:"Canon EOS 5D Mark IV (full frame)",widthMm:36,heightMm:24,pixelUm:5.36,year:2016},{id:"eos-6d",name:"Canon EOS 6D (full frame)",widthMm:35.8,heightMm:23.9,pixelUm:6.55,year:2012},{id:"eos-6d-ii",name:"Canon EOS 6D Mark II (full frame)",widthMm:36,heightMm:24,pixelUm:5.77,year:2017},{id:"nikon-d3",name:"Nikon D3 / D700 (full frame)",widthMm:36,heightMm:23.9,pixelUm:8.44,year:2007},{id:"nikon-d7000",name:"Nikon D7000 (DX)",widthMm:23.6,heightMm:15.6,pixelUm:4.78,year:2010},{id:"nikon-d7100",name:"Nikon D7100 / D7200 (DX)",widthMm:23.5,heightMm:15.6,pixelUm:3.9,year:2013},{id:"nikon-d500",name:"Nikon D500 / D7500 (DX)",widthMm:23.5,heightMm:15.7,pixelUm:4.2,year:2016}];static instruments(){return St.BODIES.map(t=>({id:t.id,category:"dslr",name:t.name,projection:"rectilinear",frame:{widthMm:t.widthMm,heightMm:t.heightMm,focalLengthMm:St.DEFAULT_FOCAL_MM,focalRangeMm:St.FOCAL_RANGE_MM},fNumber:8,fNumberRange:{min:1.4,max:22},exposureSeconds:1/250,exposureRangeSeconds:{min:1/8e3,max:3600},years:{from:t.year},apertureBlades:7,detailUm:t.pixelUm,medium:{kind:"sensor",iso:100}}))}static names(){return Object.fromEntries(St.BODIES.map(t=>[t.id,t.name]))}}class Y{static DEFAULT_EYEPIECE_MM=26;static DEFAULT_APPARENT_FIELD_DEG=52;static FIELD_STOP_MM=2*Y.DEFAULT_EYEPIECE_MM*Math.tan(Y.DEFAULT_APPARENT_FIELD_DEG*Math.PI/360);static RANGE={min:26/40*.63,max:26/6*3};static BINOCULARS=[{id:"binoculars-zeiss-6x30",name:"Carl Zeiss 6x30",magnification:6,apertureMm:30,trueFieldDeg:5,fromYear:1960},{id:"binoculars-zeiss-dialyt-10x40",name:"Carl Zeiss Dialyt 10x40 B T*",magnification:10,apertureMm:40,trueFieldDeg:6.3,fromYear:1975},{id:"binoculars-jenoptem-10x50",name:"Jenoptem 10x50 W",magnification:10,apertureMm:50,trueFieldDeg:7.3,fromYear:1960},{id:"binoculars-swarovski-7x50-habicht",name:"Swarovski 7x50 SL Habicht",magnification:7,apertureMm:50,trueFieldDeg:6.6,fromYear:1960},{id:"binoculars-swarovski-7x50-slc",name:"Swarovski 7x50 SLC",magnification:7,apertureMm:50,trueFieldDeg:7.1,fromYear:1990},{id:"binoculars-nikon-10x42-edg",name:"Nikon 10x42 EDG",magnification:10,apertureMm:42,trueFieldDeg:6.5,fromYear:2011},{id:"binoculars-canon-15x50-is",name:"Canon 15x50 IS All Weather",magnification:15,apertureMm:50,trueFieldDeg:4.5,fromYear:2008},{id:"binoculars-celestron-15x70",name:"Celestron 15x70 SkyMaster",magnification:15,apertureMm:70,trueFieldDeg:4.4,fromYear:1990},{id:"binoculars-miyauchi-25x141",name:"Miyauchi BR-141 Galaxy 45 25x141",magnification:25,apertureMm:141,trueFieldDeg:2.6,fromYear:2e3}];static TELESCOPES=[{id:"telescope-generic-60-700",name:"Telescope 60/700",apertureMm:60,focalLengthMm:700},{id:"telescope-generic-60-1000",name:"Telescope 60/1000",apertureMm:60,focalLengthMm:1e3},{id:"telescope-celestron-onyx-80edf",name:"Celestron Onyx 80EDF",apertureMm:80,focalLengthMm:500,fromYear:2010},{id:"telescope-celestron-c5",name:"Celestron C5 f/10",apertureMm:125,focalLengthMm:1250,fromYear:1970},{id:"telescope-celestron-c8",name:"Celestron C8 f/10",apertureMm:203,focalLengthMm:2032,fromYear:1970},{id:"telescope-celestron-c11",name:"Celestron C11 f/10",apertureMm:280,focalLengthMm:2800,fromYear:1970},{id:"telescope-celestron-c14",name:"Celestron C14 f/11",apertureMm:355.6,focalLengthMm:3910,fromYear:1970},{id:"telescope-meade-etx-80",name:"Meade ETX 80 f/5",apertureMm:80,focalLengthMm:400,fromYear:1996},{id:"telescope-meade-etx-90",name:"Meade ETX 90 f/13.8",apertureMm:90,focalLengthMm:1242,fromYear:1996},{id:"telescope-meade-etx-125",name:"Meade ETX 125 f/15",apertureMm:127,focalLengthMm:1900,fromYear:1996},{id:"telescope-meade-lx200-8",name:"Meade LX200 8 in f/10",apertureMm:200,focalLengthMm:2e3,fromYear:1992},{id:"telescope-meade-lx200-10",name:"Meade LX200 10 in f/10",apertureMm:250,focalLengthMm:2500,fromYear:1992},{id:"telescope-meade-lx200-12",name:"Meade LX200 12 in f/10",apertureMm:305,focalLengthMm:3048,fromYear:1992},{id:"telescope-meade-lx200-14",name:"Meade LX200 14 in f/10",apertureMm:355,focalLengthMm:3556,fromYear:1992},{id:"telescope-meade-lx200-16",name:"Meade LX200 16 in f/10",apertureMm:406,focalLengthMm:4064,fromYear:1992}];static instruments(){const t=Y.BINOCULARS.map(r=>({id:r.id,category:"binoculars",name:r.name,projection:"rectilinear",visualAid:{apertureMm:r.apertureMm,magnification:r.magnification,trueFieldDeg:r.trueFieldDeg},...r.fromYear!==void 0?{years:{from:r.fromYear}}:{}})),e=Y.FIELD_STOP_MM,n=Y.TELESCOPES.map(r=>({id:r.id,category:"telescope",name:r.name,projection:"rectilinear",frame:{widthMm:e*16/9,heightMm:e,focalLengthMm:r.focalLengthMm,focalRangeMm:{minMm:r.focalLengthMm*Y.RANGE.min,maxMm:r.focalLengthMm*Y.RANGE.max}},visualAid:{apertureMm:r.apertureMm,eyepieceFocalMm:Y.DEFAULT_EYEPIECE_MM},...r.fromYear!==void 0?{years:{from:r.fromYear}}:{}}));return[...t,...n]}static names(){return Object.fromEntries(Y.instruments().map(t=>[t.id,t.name]))}}[(1/250,1/1e3),1/50,1/90,(1/250,1/1e3),(1/250,1/1e3),(1/120,1/8e3),(1/120,1/8e3),(1/30,1/1e4,1/30),(1/50,1/1e5,1/50),...St.instruments(),...Y.instruments()];const Ur=["spring","summer","autumn","winter"],jr=21;function Vr(s){if(s.raw!==void 0)return s.raw;if(s.year===void 0){if(s.hour===void 0)return"";let e=`${String(s.hour).padStart(2,"0")}:${String(s.minute??0).padStart(2,"0")}`;return s.second!==void 0&&(e+=`:${String(s.second).padStart(2,"0")}`),e}let t=String(s.year).padStart(4,"0");return s.season!==void 0?`${t}-${jr+Ur.indexOf(s.season)}`:(s.month===void 0||(t+=`-${String(s.month).padStart(2,"0")}`,s.day===void 0)||(t+=`-${String(s.day).padStart(2,"0")}`,s.hour===void 0)||(t+=`T${String(s.hour).padStart(2,"0")}:${String(s.minute??0).padStart(2,"0")}`,s.second!==void 0&&(t+=`:${String(s.second).padStart(2,"0")}`)),t)}class U{static toCurrent(t){const e=t.version,n=typeof e=="object"&&e!==null&&"value"in e?e.value:e;if(n!==void 0&&n!==1&&n!==2)return t;const r=n===2?t:U.fromVersion1(t);return U.fromVersion2(r)}static observerIdOf(t){return t.observer?.id??"observer"}static fromVersion2(t){const e={...t,version:3},n={...t.timeline??{keyframes:[]}},r=new Set,i=n.keyframes??[];for(const d of i)for(const m of d.shapes??[])r.add(m.sourceId);const a=[],u=d=>{let m=d;for(let w=a.length+1;m===void 0||r.has(m);w++)m=`group-${w}`;return r.add(m),m},p=Array.isArray(n.groups)?n.groups:[];for(const d of p)Array.isArray(d)?a.push({id:u(),members:[...d]}):typeof d=="object"&&d!==null&&a.push(d);const c=Array.isArray(t.events)?t.events.map(d=>({...d})):void 0;if(c){const d=U.observerIdOf(t),m=c.filter(g=>g.who==="phenomenon"),w=new Set(r);for(const g of m){const F=U.unwrapped(g.params?.parts);if(g.eventType==="appearance"&&Array.isArray(F))for(const C of F)C.sourceId&&w.add(C.sourceId)}for(const g of w)r.add(g);const y=g=>a.find(F=>F.members.includes(g)),b=g=>{const F=y(g);return F?b(F.id):g},S=[...new Set([...w].map(b))],T=S.length===1?S[0]:S.length>1?u("phenomenon"):"phenomenon";S.length>1&&a.push({id:T,members:S});for(const g of c)if(g.who===void 0||g.who==="observer")g.who=d;else if(g.who==="phenomenon"){g.who=T;const F=g.params;if(g.eventType!=="blink"||!F||!Array.isArray(F.parts))continue;const C=F.parts,{parts:ue,...On}=F;g.params=On,g.who=U.groupFor(C,a,u)??T}e.events=c}return(a.length>0||p.length>0)&&(e.timeline={...n,groups:a}),e}static groupFor(t,e,n){if(t.length===1)return t[0];const r=c=>{const d=e.find(m=>m.id===c);return d?d.members.flatMap(r):[c]},i=e.find(c=>{const d=r(c.id);return d.length===t.length&&t.every(m=>d.includes(m))});if(i)return i.id;const a=new Set(t.map(c=>e.find(d=>d.members.includes(c))));if(a.size!==1)return;const[u]=a,p=n();if(u){const c=u.members.findIndex(d=>t.includes(d));u.members=u.members.filter(d=>!t.includes(d)),u.members.splice(c,0,p)}return e.push({id:p,members:[...t]}),p}static unwrapped(t){return U.isWrapped(t)?t.value:t}static fromVersion1(t){const e={...t,version:2};for(const n of["time","endTime"])t[n]!==void 0&&(e[n]=U.edtf(t[n]));if(Array.isArray(t.place)){const n=U.place(t.place);n===void 0?delete e.place:e.place=n}return e}static edtf(t){if(U.isWrapped(t)){const c=U.edtf(t.value);return c===void 0?void 0:{...t,value:c}}if(typeof t=="string")return t;const e=t,n=Object.values(e).find(c=>U.isWrapped(c)),r=Object.fromEntries(Object.entries(e).map(([c,d])=>[c,U.isWrapped(d)?d.value:d])),i=Vr(r);if(i==="")return;if(!n)return i;const{basis:a,rationale:u,how:p}=n;return{value:i,...a===void 0?{}:{basis:a},...u===void 0?{}:{rationale:u},...p===void 0?{}:{how:p}}}static place(t){if(t.length===0)return;const e=t.map(c=>U.isWrapped(c)?c.value:c),n=e.find(c=>c.name)?.name,r={...n?{name:n}:{},locations:e.map(({lat:c,lng:d})=>({lat:c,lng:d}))},i=t.find(c=>U.isWrapped(c));if(!i)return r;const{basis:a,rationale:u,how:p}=i;return{value:r,...a===void 0?{}:{basis:a},...u===void 0?{}:{rationale:u},...p===void 0?{}:{how:p}}}static isWrapped(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&"value"in t}}class ft extends Error{constructor(t,e,n){super(`${t}: ${e}${n===void 0?"":` (HTTP ${n})`}`),this.kind=t,this.url=e,this.status=n,this.name="SightingFetchError"}}class ne{static async recording(t){const e=await ne.json(t);for(const n of Tn.NAMES){const r=e?.frozen?.[n];if(!(!r?.src||r.live))try{const i=U.toCurrent(await ne.json(new URL(r.src,new URL(t,location.href)).href));for(const a of Tn.KEYS[n])i[a]!==void 0&&(e[a]=i[a])}catch{}}return e}static async json(t){const e=new URL(t,location.href);if(location.protocol==="https:"&&e.protocol==="http:")throw new ft("mixed-content",t);let n;try{n=await fetch(t)}catch{throw await this.diagnose(t,e)}if(!n.ok)throw new ft("status",t,n.status);try{return await n.json()}catch{throw new ft("malformed",t)}}static async diagnose(t,e){if(e.origin===location.origin)return new ft("unreachable",t);try{return await fetch(t,{mode:"no-cors"}),new ft("cors",t)}catch{return new ft("unreachable",t)}}}function Or(s,t){for(const e of s){const n=e.toLowerCase().split("-")[0];if(t.includes(n))return n}return"en"}class zr{static preferencesFor(t){const e=navigator.languages??[],n=this.declaredFor(t);return n?[n,...e]:e}static declaredFor(t){for(let e=t;e;){const n=e.closest("[lang]")?.getAttribute("lang")?.trim();if(n)return n;const r=e.getRootNode();e=r instanceof ShadowRoot?r.host:void 0}}}const Br=["en","fr","es","it"],Yr={en:()=>_t(()=>Promise.resolve().then(()=>qr),void 0,import.meta.url).then(s=>s.interviewMessages_en),fr:()=>_t(()=>import("./InterviewMessages_fr-Dhtz904e.js"),[],import.meta.url).then(s=>s.interviewMessages_fr),es:()=>_t(()=>import("./InterviewMessages_es-BJHVnSkP.js"),[],import.meta.url).then(s=>s.interviewMessages_es),it:()=>_t(()=>import("./InterviewMessages_it-D0Dff5zn.js"),[],import.meta.url).then(s=>s.interviewMessages_it)};function Hr(s){return Yr[s]()}const xe={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"}},qr=Object.freeze(Object.defineProperty({__proto__:null,interviewMessages_en:xe},Symbol.toStringTag,{value:"Module"})),Xr="interviewseek";class Wr extends Error{constructor(t,e,n){super(typeof e=="number"&&Number.isInteger(e)&&e>n?`This ${t} file is in version ${e} of its format; this UFO@home reads up to version ${n}. Read it with a newer UFO@home.`:`This ${t} file states ${JSON.stringify(e)} as its format version, which is not a version.`),this.format=t,this.found=e,this.supported=n,this.name="FormatVersionError"}said(t){return t.replace("{found}",typeof this.found=="number"?String(this.found):JSON.stringify(this.found)).replace("{supported}",String(this.supported))}}class yt{static CURRENT={sighting:3,case:1,interview:1};static SCHEMA_BASE="https://ufoathome.org/schema";static schemaUrl(t,e=yt.CURRENT[t]){return`${yt.SCHEMA_BASE}/${e}/${t}.schema.json`}static of(t){if(typeof t!="object"||t===null)return 1;const e=t.version;return e===void 0?1:typeof e=="object"&&e!==null&&"value"in e?e.value:e}static check(t,e){const n=yt.of(t),r=yt.CURRENT[e];if(typeof n!="number"||!Number.isInteger(n)||n<1||n>r)throw new Wr(e,n,r);return t}}class ${static read(t){return yt.check(t,"interview")}static isProofread(t){const e=Object.keys(t.speakers);return e.length>0&&e.every(n=>{const r=t.proofreading?.[n]?.status;return r==="approved"||r==="covered"})}static said(t){return t.parts?t.parts.map(e=>"redacted"in e?"…":$.plain(e.text)).join(" "):t.redacted?void 0:$.plain(t.text??"")}static ENTITIES={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "};static plain(t){return/[<&]/.test(t)?t.replace(/<br\s*\/?>/gi,`
|
|
1
|
+
class B extends Error{}class re{constructor(t){this.name=t}validate(t){return!0}}class kn extends re{min;max;constructor(t,e,n){super(t),this.min=e,this.max=n}validate(t){if(typeof t!="number")throw new B(`${this.name} value must be a number, but was ${t}`);if(t<this.min||t>this.max)throw new B(`${this.name} value must be >= ${this.min} and <= ${this.max}, but was ${t}`);return super.validate(t)}}class N{name;min;max;duration;subUnit;validator;constructor(t,e,n,r,i=new kn(t,e,n)){this.name=t,this.min=e,this.max=n,this.subUnit=r,this.duration=r?(r.max-r.min+1)*r.duration:1,this.validator=i}validate(t){return this.validator.validate(t)}[Symbol.iterator](){let t=this.min;return{next:()=>{const e={done:t>this.max,value:t};return t++,e}}}}class Me{millisecond;second;minute;hour;day;month;year}class zn extends Me{}class Fn extends zn{millisecond=new N("millisecond",0,999,void 0);second=new N("second",0,59,this.millisecond);minute=new N("minute",0,59,this.second);hour=new N("hour",0,23,this.minute);day=new N("day",1,31,this.hour);month=new N("month",1,12,this.day);year=new N("year",0,9999,this.month)}const f=new Fn;class Rn extends kn{constructor(t=1,e=12){super("month",t,e)}}class gt extends N{static Month28=new gt(28);static Month29=new gt(29);static ThirtyDays=new gt(30);static ThirtyOneDays=new gt(31);constructor(t,e=new Rn(1,t)){super("month",1,t,f.day,e)}static create(t,e){switch(t){case 1:case 3:case 5:case 7:case 8:case 10:case 12:return this.ThirtyOneDays;case 2:return e%4===0?this.Month29:this.Month28;case 4:case 6:case 9:case 11:return this.ThirtyDays;default:throw new B("Unsupported month",t,e)}}}class q{static instance=new q;render(t){return t.value.toString()}}class V{unit;#t;constructor(t,e){this.unit=e,this.value=typeof t=="number"?t:t.value}get value(){return this.#t}set value(t){this.unit.validate(t),this.#t=t}get duration(){return this.value*this.unit.duration}#e(t){if(this.constructor.name!==t.constructor.name)throw new re(`${this.unit.name} "${this.toString()}" cannot be compared with ${t.unit?.name} "${t.toString()}"`)}compare(t){return this.#e(t),this.value-t.value}isEqual(t){return this.compare(t)===0}isBefore(t){return this.compare(t)<0}isAfter(t){return this.compare(t)>0}previous(t=this.unit){const e=this.value-1;return new this.constructor(e,t)}next(t=this.unit){const e=this.value+1;return new this.constructor(e,t)}toString(t=q.instance){return t.render(this)}toSpec(){return{value:this.value}}toJSON(){return this.toSpec()}}class l{static#t=new Map;static register(t,e){l.#t.set(t,e)}static get(t){const e=l.#t.get(t);if(!e)throw new B(`No default parser registered for ${t.name}: import "@rr0/time/defaults" or pass a parser to fromString()`);return e()}}class Mt extends V{constructor(t=new Date().getFullYear(),e=f.year){super(t,e)}static fromString(t,e=l.get(Mt)){return new Mt(e.parse(t))}}class J extends q{static default=new J("0",2);constructor(t,e){super(),this.char=t,this.size=e}render(t){return super.render(t).padStart(this.size,this.char)}}class Et extends V{constructor(t=new Date().getMonth()+1,e=f.month){super(t,e)}static fromString(t,e=l.get(Et)){return new Et(e.parse(t))}toString(t=J.default){return super.toString(t)}}class Nt extends V{constructor(t=new Date().getDate(),e=f.day){super(t,e)}static fromString(t,e=l.get(Nt)){const n=e.parse(t);return new Nt(n)}toString(t=J.default){return super.toString(t)}}class Gt extends V{constructor(t=new Date().getHours(),e=f.hour){super(t,e)}static fromString(t,e=l.get(Gt)){return new Gt(e.parse(t))}toString(t=J.default){return super.toString(t)}}class vt extends V{constructor(t=new Date().getMinutes(),e=f.minute){super(t,e)}static fromString(t,e=l.get(vt)){return new vt(e.parse(t))}toString(t=J.default){return super.toString(t)}}class Tt extends V{constructor(t=new Date().getSeconds(),e=f.second){super(t,e)}static fromString(t,e=l.get(Tt)){return new Tt(e.parse(t),f.second)}toString(t=J.default){return super.toString(t)}}class ct extends V{static renderer=new J("0",3);constructor(t,e=f.millisecond){super(t,e)}static parseFraction(t){return parseInt(t.padEnd(3,"0").substring(0,3),10)}toString(t=ct.renderer){return super.toString(t)}}class Bn{render(t){return t.toString()}}class Yn extends Bn{render(t){const e=t.value,n=Math.abs(e),r=Math.floor(n/60),i=n%60;if(r===0&&i===0)return"Z";{const a=e<0?"-":"+",u=r.toString().padStart(2,"0"),p=i>0?":"+i.toString().padEnd(2,"0"):"";return a+u+p}}}class ut{value;name="timeshift";renderer;constructor(t=0){this.value=t}static fromString(t,e=l.get(ut),n=void 0){const r=e.parse(t,n);return new ut(r)}toString(t=new Yn){return t.render(this)}toSpec(){return{value:this.value}}toJSON(){return this.toSpec()}}class j{static timeshift(t,e){return t+(j.isDaylight(e)?60:0)}static isDaylight(t){const{year:e,month:n,day:r}=t,i=t.hour??12;if(![e,n,r].every(Number.isInteger))throw new RangeError("Daylight saving time depends on the year, month and day");const a=j.rule(e);if(!a)return!1;const u=j.rank(n,r,i);return u>=j.rank(a.start.month,a.start.day,2)&&u<j.rank(a.end.month,a.end.day,2)}static rule(t){if(t<1967)return;const e={month:10,day:j.sunday(t,10,-1)};return t>=2007?{start:{month:3,day:j.sunday(t,3,2)},end:{month:11,day:j.sunday(t,11,1)}}:t>=1987?{start:{month:4,day:j.sunday(t,4,1)},end:e}:t===1975?{start:{month:2,day:23},end:e}:t===1974?{start:{month:1,day:6},end:e}:{start:{month:4,day:j.sunday(t,4,-1)},end:e}}static sunday(t,e,n){const r=new Date(Date.UTC(2e3,e-1,1));r.setUTCFullYear(t);const i=1+(7-r.getUTCDay())%7;if(n>0)return i+7*(n-1);const a=[31,j.isLeap(t)?29:28,31,30,31,30,31,31,30,31,30,31][e-1];let u=i;for(;u+7<=a;)u+=7;return u}static isLeap(t){return t%4===0&&(t%100!==0||t%400===0)}static rank(t,e,n){return(t*100+e)*100+n}}const Hn={name:"PST",timeshift:"-08",title:"Pacific Standard Time (US)"},qn={name:"PDT",timeshift:"-07",title:"Pacific Daylight Time (US)"},Xn={name:"MDT",timeshift:"-06",title:"Mountain Standard Time (US)"},Wn={name:"MST",timeshift:"-07",title:"Mountain Daylight Time (US)"},Jn={name:"PT",timeshift:s=>j.timeshift(-480,s),title:"Pacific Time (US)"},Dn={name:"MT",timeshift:s=>j.timeshift(-420,s),title:"Mountain Time (US)"},Zn={name:"CT",timeshift:s=>j.timeshift(-360,s),title:"Central Time (US)"},Kn={name:"ET",timeshift:s=>j.timeshift(-300,s),title:"Eastern Time (US)"},Qn={name:"CWT",timeshift:"-05",title:"Central War Time (US)"},Pn={name:"CDT",timeshift:"-05",title:"Central Daylight Time"},Ln={name:"EST",timeshift:"-05",title:"Eastern Standard Time (US)"},_n={name:"EDT",timeshift:"-04",title:"Eastern Time (US)"},tr={name:"AST",timeshift:"-04",title:"Atlantic Standard Time (US)"},er={name:"ADT",timeshift:"-03",title:"Atlantic Daylight Time (US)"},nr={name:"UTC",timeshift:"Z",title:"Coordinated Universal Time"},rr={name:"Z",timeshift:"Z",title:"UTC"},sr={name:"GMT",timeshift:"Z",title:"Greenwich Mean Time"},or={name:"BST",timeshift:"+01",title:"British Summer Time"},ir={name:"CEST",timeshift:"+02",title:"Central European Summer Time"},ar={name:"CET",timeshift:"+01",title:"Central European Time"},ur={name:"MSK",timeshift:"+03",title:"Moscow Time (RU)"},cr={name:"IST",timeshift:"+05:30",title:"Indian Standard Time"},mr={name:"BJT",timeshift:"+08",title:"Beijing Time"},dr={name:"CST",timeshift:"-06",title:"Central Standard Time"},pr={name:"JST",timeshift:"+09",title:"Japan Standard Time"},lr={name:"AEST",timeshift:"+10",title:"Australian Eastern Standard Time"},hr={name:"NZST",timeshift:"+12",title:"New Zealand Standard Time"},fr={name:"LST",timeshift:"?",title:"Local Sideral Time"},Re=[er,lr,tr,mr,or,dr,Pn,ar,ir,Zn,Qn,_n,Ln,Kn,sr,cr,pr,fr,Xn,ur,Wn,Dn,hr,qn,Hn,Jn,nr,rr];class se{static instance=new se;renderComponent(t,e){return t[e].toString()}renderSecond(t){return this.renderComponent(t,"second")+(t.millisecond?"."+t.millisecond.toString():"")}render(t){const e=[];t.year&&e.push(this.renderComponent(t,"year")),t.month&&e.push(this.renderComponent(t,"month")),t.day&&e.push(this.renderComponent(t,"day"));const n=[];t.hour&&n.push(this.renderComponent(t,"hour")),t.minute&&n.push(this.renderComponent(t,"minute")),t.second&&n.push(this.renderSecond(t));const r=e.join("-"),i=t.timeshift?t.timeshift.toString():"",a=n.join(":")+i;return r+(a.length>0?"T"+a:"")}}class mt extends B{constructor(t="method is abstract"){super(t)}}class Ee{units;constructor(t){this.units=t}newYear(t){throw new mt}newMonth(t){throw new mt}newDay(t){throw new mt}newHour(t){throw new mt}newMinute(t){throw new mt}newSecond(t){throw new mt}}class gr extends Me{millisecond=new N("milliseconds",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,void 0);second=new N("seconds",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.millisecond);minute=new N("minutes",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.second);hour=new N("hours",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.minutes);day=new N("days",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.hour);month=new N("months",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.day);year=new N("years",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const Pt=new gr;class oe{static instance=new oe;render(t){const e=H.toSpec(t);let n="P";const r=e.years;r&&(n+=r.toString()+"Y");const i=e.months;i&&(n+=i.toString(q.instance)+"MM");const a=e.days;a&&(n+=a.toString(q.instance)+"D");const u=e.hours;u&&(n+=u.toString(q.instance)+"H");const p=e.minutes;p&&(n+=p.toString(q.instance)+"M");const c=e.seconds;return c&&(n+=c.toString(q.instance)+"S"),n}}class H extends V{constructor(t={years:new Date().getFullYear(),months:new Date().getMonth(),days:new Date().getDate(),hours:new Date().getHours(),minutes:new Date().getMinutes(),seconds:new Date().getSeconds(),milliseconds:new Date().getMilliseconds()}){super({value:typeof t=="number"?t:+(t.years?t.years*f.year.duration:0)+(t.months?t.months*f.month.duration:0)+(t.days?t.days*f.day.duration:0)+(t.hours?t.hours*f.hour.duration:0)+(t.minutes?t.minutes*f.minute.duration:0)+(t.seconds?t.seconds*f.second.duration:0)},new N("millisecond",0,Number.MAX_SAFE_INTEGER,void 0))}static toSpec(t,e=Sr){let n=typeof t=="number"?t:t.value;const r=n>0?1:-1;n=Math.abs(n);const i={},a=n/f.year.duration,u=Math.floor(a);u>0&&(i.years=e.newYear(r*u),n-=u*f.year.duration);const p=n/f.month.duration,c=Math.floor(p);c>0&&(i.months=e.newMonth(r*c),n-=c*f.month.duration);const d=n/f.day.duration,m=Math.floor(d);m>0&&(i.days=e.newDay(r*m),n-=m*f.day.duration);const w=n/f.hour.duration,y=Math.floor(w);y>0&&(i.hours=e.newHour(r*y),n-=y*f.hour.duration);const b=n/f.minute.duration,S=Math.floor(b);S>0&&(i.minutes=e.newMinute(r*S),n-=S*f.minute.duration);const T=n/f.second.duration,g=Math.floor(r*T);return g>0&&(i.seconds=e.newSecond(g)),i}static fromString(t,e=l.get(H)){return new H(e.parse(t))}static between(t,e){const n=e.getTime(),r=t.getTime();return new H(n-r)}toSpec(){return H.toSpec(this)}toString(t=oe.instance){return t.render(this)}}class $n extends Ee{constructor(t){super(t)}newYear(t){return new Mt(t,this.units.year)}newMonth(t){return new Et(t,this.units.month)}newDay(t){return new Nt(t,this.units.day)}newHour(t){return new Gt(t,this.units.hour)}newMinute(t){return new vt(t,this.units.minute)}newSecond(t){return new Tt(t,this.units.second)}newMillisecond(t){return new ct(t,this.units.millisecond)}newTimeshift(t){return new ut(typeof t=="number"?t:t.value)}}const wr=new $n(f),Sr=new $n(Pt);class I{#t;#e;#n;#r;#s;#o;#i;#a;constructor(t={year:new Date().getFullYear(),month:new Date().getMonth()+1,day:new Date().getDate(),hour:new Date().getHours(),minute:new Date().getMinutes(),second:new Date().getSeconds(),timeshift:I.timeshiftOf(new Date)}){this.year=t.year,this.month=t.month,this.day=t.day,this.hour=t.hour,this.minute=t.minute,this.second=t.second,this.millisecond=t.millisecond,this.timeshift=t.timeshift}get year(){return this.#t}set year(t){const e=typeof t=="number";this.#t&&e?this.#t.value=t:this.#t=e?this.factory.newYear(t):!t||t.start||t instanceof V?t:this.factory.newYear(t)}get month(){return this.#e}set month(t){const e=typeof t=="number";this.#e&&e?this.#e.value=t:this.#e=e?this.factory.newMonth(t):!t||t.start||t instanceof V?t:this.factory.newMonth(t)}get day(){return this.#n}set day(t){const e=typeof t=="number";this.#n&&e?this.#n.value=t:this.#n=e?this.factory.newDay(t):!t||t.start||t instanceof V?t:this.factory.newDay(t)}get hour(){return this.#r}set hour(t){const e=typeof t=="number";this.#r&&e?this.#r.value=t:this.#r=e?this.factory.newHour(t):!t||t.start||t instanceof V?t:this.factory.newHour(t)}get minute(){return this.#s}set minute(t){const e=typeof t=="number";this.#s&&e?this.#s.value=t:this.#s=e?this.factory.newMinute(t):!t||t.start||t instanceof V?t:this.factory.newMinute(t)}get second(){return this.#o}set second(t){const e=typeof t=="number";this.#o&&e?this.#o.value=t:this.#o=e?this.factory.newSecond(t):!t||t.start||t instanceof V?t:this.factory.newSecond(t)}get millisecond(){return this.#i}set millisecond(t){const e=typeof t=="number";this.#i&&e?this.#i.value=t:this.#i=e||t&&!(t instanceof V)?this.factory.newMillisecond(t):t}get timeshift(){return this.#a}set timeshift(t){const e=typeof t=="number";this.#a&&e?this.#a.value=t:this.#a=e||t&&!(t instanceof ut)?this.factory.newTimeshift(t):t}get factory(){return wr}static fromString(t,e=l.get(I)){const{year:n,month:r,day:i,hour:a,minute:u,second:p,millisecond:c,timeshift:d}=e.parse(t);return new I({year:n,month:r,day:i,hour:a,minute:u,second:p,millisecond:c,timeshift:d})}static timeshiftOf(t){return-t.getTimezoneOffset()||0}static fromDate(t){return new I({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:I.timeshiftOf(t)})}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),n=t.substring(0,e)+t.substring(e+4);return I.fromString(n)}#u(t){if(this.constructor.name!==t.constructor.name)throw new re(`Date "${this.toString()}" cannot be compared with "${t.toString()}"`)}compare(t){return this.#u(t),this.getTime()-t.getTime()}delta(t){const e=this.compare(t);return new H(e)}getTime(){return(this.year?.duration||0)+(this.month?.duration||0)+(this.day?.duration||0)+(this.hour?.duration||0)+(this.minute?.duration||0)+(this.second?.duration||0)+(this.millisecond?.duration||0)}isEqual(t){return this.compare(t)===0}isBefore(t){return this.compare(t)<0}isAfter(t){return this.compare(t)>0}clone(){return new I(this.toSpec())}previous(){let t=this.clone();try{t.second=this.second.previous()}catch{try{t.minute=this.minute.previous()}catch{try{t.hour=this.hour.previous()}catch{try{t.day=this.day.previous()}catch{try{t.month=this.month.previous()}catch{t.year=this.year.previous()}}}}}return t}next(){let t=this.clone();try{t.second=this.second.next()}catch{try{t.minute=this.minute.next()}catch{try{t.hour=this.hour.next()}catch{try{t.day=this.day.next()}catch{try{t.month=this.month.next()}catch{t.year=this.year.next()}}}}}return t}toString(t=se.instance){return t.render(this)}toSpec(){const t={},e=this.year?.toSpec();e&&(t.year=e);const n=this.month?.toSpec();n&&(t.month=n);const r=this.day?.toSpec();r&&(t.day=r);const i=this.hour?.toSpec();i&&(t.hour=i);const a=this.minute?.toSpec();a&&(t.minute=a);const u=this.second?.toSpec();u&&(t.second=u);const p=this.millisecond?.toSpec();p&&(t.millisecond=p);const c=this.timeshift?.toSpec();return c&&(t.timeshift=c),t}toJSON(){return this.toSpec()}}class Ne{static instance=new Ne;render(t){return(t.start?t.start.toString():"")+"/"+(t.end?t.end.toString():"")}}class Rt{constructor(t,e){this.start=t,this.end=e}_start;get start(){return this._start}set start(t){if(typeof t=="string"&&(t=I.fromString(t)),t&&!(t instanceof I)&&!(t instanceof H))throw new B("Interval start is not a level 0 date or duration: "+t);this._start=t}_end;get end(){return this._end}set end(t){if(typeof t=="string"&&(t=I.fromString(t)),t&&!(t instanceof I)&&!(t instanceof H))throw new B("Interval end is not a level 0 date or duration: "+t);this._end=t}static fromString(t,e=l.get(Rt)){const{start:n,end:r}=e.parse(t);return new Rt(n,r)}toString(t=Ne.instance){return t.render(this)}[Symbol.iterator](){let t=this.start;return{next:()=>{const e={done:t>this.end,value:t};return t++,e}}}}class Lt extends q{static instance=new Lt(J.default);constructor(t){super(),this.valueRenderer=t}render(t){return(this.valueRenderer?this.valueRenderer.render(t):super.render(t))+this.qualifier(t)}qualifier(t){return t.uncertain?t.approximate?"%":"?":t.approximate?"~":""}}class W extends V{#t;#e;constructor(t,e){super(t,e),this.#t=t.uncertain||!1,this.#e=t.approximate||!1}get uncertain(){return this.#t}set uncertain(t){return this.#t=t}get approximate(){return this.#e}set approximate(t){return this.#e=t}isCertainAndPrecise(){return!this.approximate&&!this.uncertain}isEqual(t){return this.isCertainAndPrecise()&&super.isEqual(t)}isBefore(t){return this.isCertainAndPrecise()&&super.isBefore(t)}isAfter(t){return this.isCertainAndPrecise()&&super.isAfter(t)}toString(t=Lt.instance){return super.toString(t)}toSpec(){return{...super.toSpec(),uncertain:this.uncertain,approximate:this.approximate}}toJSON(){return this.toSpec()}}class In extends Fn{year=new N("year",-9999,9999,this.month);yearExtended=new N("year",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const te=new In;class nt extends W{constructor(t,e=te.year){super(t,e)}static fromString(t,e=te.year,n=l.get(nt)){const r=n.parse(t),i=r.value.start;if(t.startsWith("Y")&&(e=te.yearExtended),i!==void 0){const a=new nt(Object.assign({...r},{value:Math.max(i,e.min)})),u=new nt(Object.assign({...r},{value:Math.min(r.value.end,e.max)}));return{start:a,end:u}}else return new nt(r,e)}}class Cn extends re{monthValidator=new Rn;validate(t){switch(t){case 21:case 22:case 23:case 24:return!0;default:return this.monthValidator.validate(t)}}}class rt extends W{constructor(t,e=new N(f.month.name,1,24,f.day,new Cn)){super(t,e)}static fromString(t,e=l.get(rt)){const n=e.parse(t),r=n.value.start;if(r!==void 0){let i=f.month;const a=new rt(Object.assign({...n},{value:Math.max(r,i.min)})),u=new rt(Object.assign({...n},{value:Math.min(n.value.end,i.max)}));return{start:a,end:u}}else return new rt(n)}toString(t){return super.toString(t).padStart(2,"0")}}class st extends W{constructor(t,e=f.day){super(t,e)}static fromString(t,e=l.get(st)){const n=e.parse(t),r=n.value.start;if(r!==void 0){let i=f.day;const a=new st(Object.assign({...n},{value:Math.max(r,i.min)})),u=new st(Object.assign({...n},{value:Math.min(n.value.end,i.max)}));return{start:a,end:u}}else return new st(n)}toString(t){return super.toString(t).padStart(2,"0")}}class ot extends W{constructor(t,e=f.hour){super(t,e)}static fromString(t,e=l.get(ot)){const n=e.parse(t),r=n.value.start;if(r!==void 0){let i=f.hour;const a=new ot(Object.assign({...n},{value:Math.max(r,i.min)})),u=new ot(Object.assign({...n},{value:Math.min(n.value.end,i.max)}));return{start:a,end:u}}else return new ot(n)}}class it extends W{constructor(t,e=f.minute){super(t,e)}static fromString(t,e=l.get(it)){const n=e.parse(t),r=n.value.start;if(r!==void 0){const i=f.minute,a=new it(Object.assign({...n},{value:Math.max(r,i.min)})),u=new it(Object.assign({...n},{value:Math.min(n.value.end,i.max)}));return{start:a,end:u}}else return new it(n)}toString(t=Lt.instance){return super.toString(t)}}class at extends W{constructor(t,e=f.second){super(t,e)}static fromString(t,e=l.get(at)){const n=e.parse(t),r=n.value.start;if(r!==void 0){const i=f.second,a=new at(Object.assign({...n},{value:Math.max(r,i.min)})),u=new at(Object.assign({...n},{value:Math.min(n.value.end,i.max)}));return{start:a,end:u}}else return new at(n)}}class lt extends ut{static fromString(t,e=l.get(lt),n=void 0){return new lt(e.parse(t,n))}}class Un extends Ee{constructor(t){super(t)}newYear(t){return new nt(t,this.units.year)}newMonth(t){return new rt(t,this.units.month)}newDay(t){return new st(t,this.units.day)}newHour(t){return new ot(t,this.units.hour)}newMinute(t){return new it(t,this.units.minute)}newSecond(t){return new at(t,this.units.second)}newMillisecond(t){return new ct(t,this.units.millisecond)}newTimeshift(t){return new lt(typeof t=="number"?t:t.value)}}const yr=new Un(te),br=new Un(Pt);class O extends I{constructor(t){super(t)}get factory(){return yr}get uncertain(){return this.year?.uncertain===!0||this.month?.uncertain===!0||this.day?.uncertain===!0||this.hour?.uncertain===!0||this.minute?.uncertain===!0||this.second?.uncertain===!0}get approximate(){return this.year?.approximate===!0||this.month?.approximate===!0||this.day?.approximate===!0||this.hour?.approximate===!0||this.minute?.approximate===!0||this.second?.approximate===!0}static fromDate(t){return new O({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:I.timeshiftOf(t)})}static fromString(t,e=l.get(O)){const n=e.parse(t);return new O(n)}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),n=t.substring(0,e)+t.substring(e+4);return O.fromString(n)}clone(){return new O(this.toSpec())}}const F=Object.freeze({year:"year",month:"month",day:"day",hour:"hour",minute:"minute",second:"second",timeshift:"timeshift",uncertain:"uncertain",approximate:"approx"});class ie extends oe{static instance=new ie;render(t){return super.render(t)}}class k extends W{constructor(t){super(typeof t=="number"||t.hasOwnProperty("value")?t:{value:k.getValue(t,F.year)+k.getValue(t,F.month)+k.getValue(t,F.day)+k.getValue(t,F.hour)+k.getValue(t,F.minute)+k.getValue(t,F.second),uncertain:k.getBoolean(t,F.uncertain),approximate:k.getBoolean(t,"approximate")},Pt.millisecond)}static getBoolean(t,e){return t[e]||t[F.year+"s"]?.[e]||t[F.month+"s"]?.[e]||t[F.day+"s"]?.[e]||t[F.hour+"s"]?.[e]||t[F.minute+"s"]?.[e]||t[F.second+"s"]?.[e]||!1}static getValue(t,e){let n=0,r=t[e+"s"];if(r instanceof W?r=r.value:typeof t=="number"&&(r=t),r){const i=f[e];n=r*i.duration}return n}static toSpec(t,e=br){return{...H.toSpec(t,e),uncertain:t.uncertain||!1,approximate:t.approximate||!1}}static fromString(t,e=l.get(k)){const n=e.parse(t);return new k(n)}static between(t,e){const n=e.getTime(),r=t.getTime();return new k(n-r)}toString(t=ie.instance){return super.toString(t)}toSpec(){return k.toSpec(this)}}class $t extends Rt{constructor(t,e){super(t,e)}get start(){return this._start}set start(t){if(typeof t=="string"&&(super.start=O.fromString(t)),t&&!(t instanceof O)&&!(t instanceof k))throw new B("Interval start is not a level 1 date or duration: "+t);this._start=t}get end(){return this._end}set end(t){if(typeof t=="string"&&(t=O.fromString(t)),t&&!(t instanceof O)&&!(t instanceof k))throw new B("Interval end is not a level 1 date or duration: "+t);this._end=t}static fromString(t,e=l.get($t)){const{start:n,end:r}=e.parse(t);return new $t(n,r)}}class kt extends W{uncertainComponent;approximateComponent;constructor(t,e){super(t,e),this.uncertainComponent=t.uncertainComponent||!1,this.approximateComponent=t.approximateComponent||!1}get uncertain(){return super.uncertain||this.uncertainComponent}set uncertain(t){return super.uncertain=t}get approximate(){return super.approximate||this.approximateComponent}set approximate(t){return super.approximate=t}get uncertainGroup(){return super.uncertain}get approximateGroup(){return super.approximate}toSpec(){return{...super.toSpec(),uncertain:this.uncertainGroup,approximate:this.approximateGroup,uncertainComponent:this.uncertainComponent,approximateComponent:this.approximateComponent}}toJSON(){return this.toSpec()}}class xr extends In{year=new N("year",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const be=new xr;class D extends kt{constructor(t,e=be.year){super(t,e)}static fromString(t,e=be.year,n=l.get(D)){const r=n.parse(t),i=r.value.start;if(i!==void 0){const a=new D(Object.assign({...r},{value:Math.max(i,e.min)})),u=new D(Object.assign({...r},{value:Math.min(r.value.end,e.max)})),p={start:a,end:u},c=r.value.estimate;return c&&(p.estimate=c),p}else return new D(r)}}class Mr extends Cn{validate(t){switch(t){case 25:case 26:case 27:case 28:case 29:case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:return!0;default:return super.validate(t)}}}class Z extends kt{constructor(t,e=new N(f.month.name,1,41,f.day,new Mr)){super(t,e)}static fromString(t,e=l.get(Z)){const n=e.parse(t),r=n.value.start;if(r!==void 0){const i=f.month,a=new Z(Object.assign({...n},{value:Math.max(r,i.min)})),u=new Z(Object.assign({...n},{value:Math.min(n.value.end,i.max)}));return{start:a,end:u}}else return new Z(n)}toString(t){return super.toString(t).padStart(2,"0")}}class K extends kt{constructor(t,e=f.day){super(t,e)}static fromString(t,e=l.get(K)){const n=e.parse(t),r=n.value.start;if(r!==void 0){const i=f.day,a=new K(Object.assign({...n},{value:Math.max(r,i.min)})),u=new K(Object.assign({...n},{value:Math.min(n.value.end,i.max)}));return{start:a,end:u}}else return new K(n)}toString(t){return super.toString(t).padStart(2,"0")}}class Q extends kt{constructor(t,e=f.hour){super(t,e)}static fromString(t,e=l.get(Q)){const n=e.parse(t),r=n.value.start;if(r!==void 0){const i=f.hour,a=new Q(Object.assign({...n},{value:Math.max(r,i.min)})),u=new Q(Object.assign({...n},{value:Math.min(n.value.end,i.max)}));return{start:a,end:u}}else return new Q(n)}}class P extends kt{constructor(t,e=f.minute){super(t,e)}static fromString(t,e=l.get(P)){const n=e.parse(t),r=n.value.start;if(r!==void 0){const i=f.minute,a=new P(Object.assign({...n},{value:Math.max(r,i.min)})),u=new P(Object.assign({...n},{value:Math.min(n.value.end,i.max)}));return{start:a,end:u}}else return new P(n)}}class L extends kt{constructor(t,e=f.second){super(t,e)}static fromString(t,e=f.second,n=l.get(L)){const r=n.parse(t),i=r.value.start;if(i!==void 0){const a=new L(Object.assign({...r},{value:Math.max(i,e.min)})),u=new L(Object.assign({...r},{value:Math.min(r.value.end,e.max)}));return{start:a,end:u}}else return new L(r,e)}}class jn extends lt{}class Er extends Lt{qualifier(){return""}}class et extends se{static instance=new et;static valueRenderer=new Er(J.default);static names=["year","month","day","hour","minute","second"];static qualifier(t,e){return t?e?"%":"?":e?"~":""}renderComponent(t,e){const n=t[e],r=et.names.slice(et.names.indexOf(e)+1).map(u=>t[u]).filter(Boolean),i=et.qualifier(n.uncertainComponent,n.approximateComponent),a=et.qualifier(n.uncertainGroup&&!n.uncertainComponent&&!r.some(u=>u.uncertain),n.approximateGroup&&!n.approximateComponent&&!r.some(u=>u.approximate));return i+n.toString(et.valueRenderer)+a}}class Vn extends Ee{constructor(t){super(t)}newYear(t){return new D(t,this.units.year)}newMonth(t){return new Z(t,this.units.month)}newDay(t){return new K(t,this.units.day)}newHour(t){return new Q(t,this.units.hour)}newMinute(t){return new P(t,this.units.minute)}newSecond(t){return new L(t,this.units.second)}newMillisecond(t){return new ct(t,this.units.millisecond)}newTimeshift(t){return new jn(typeof t=="number"?t:t.value)}}const Nr=new Vn(be),Gr=new Vn(Pt);class z extends O{constructor(t){super(t)}toString(t=et.instance){return super.toString(t)}get year(){return super.year}set year(t){super.year=t}get month(){return super.month}set month(t){super.month=t}get factory(){return Nr}static fromDate(t){return new z({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:I.timeshiftOf(t)})}static fromString(t,e=l.get(z)){const n=e.parse(t);return new z(n)}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),n=t.substring(0,e)+t.substring(e+4);return z.fromString(n)}clone(){return new z(this.toSpec())}}class _{regExp;constructor(t,e){this.name=t,this.regExp=new RegExp(`^(?:${e})$`)}regexGroups(t){const e=this.regExp.exec(t);if(!e)throw new B(`Invalid ${this.name} "${t}"`);return e.groups}parseGroups(t){throw new mt(`${this.constructor.name} is abstract`)}parse(t){const e=this.regexGroups(t);return this.parseGroups(e)}}class wt extends ie{static instance=new wt;static designators=[["years","Y"],["months","MM"],["days","D"],["hours","H"],["minutes","M"],["seconds","S"]];static qualifier(t,e){return t?e?"%":"?":e?"~":""}render(t){const e=wt.qualifier(t.uncertainDuration,t.approximateDuration);if(!t.hasQualifiedComponent)return e+super.render(t);let n=e+"P";for(const[r,i]of wt.designators){const a=t.components[r];a&&(n+=wt.qualifier(a.uncertainComponent,a.approximateComponent)+a.value+i)}return n}}class A extends k{#t;constructor(t){if(super(typeof t=="number"?t:{value:A.valueFromSpec(t),uncertain:t.uncertain===!0,approximate:t.approximate===!0},Pt.millisecond),typeof t!="number"){const e={};for(const n of A.componentNames)t[n]instanceof W&&(e[n]=t[n]);Object.keys(e).length>0&&(this.#t=e)}}static componentNames=["years","months","days","hours","minutes","seconds"];get components(){return this.#t}#e(t){return this.#t?Object.values(this.#t).some(e=>e[t]):!1}get uncertainDuration(){return super.uncertain}get approximateDuration(){return super.approximate}get uncertain(){return super.uncertain||this.#e("uncertain")}set uncertain(t){super.uncertain=t}get approximate(){return super.approximate||this.#e("approximate")}set approximate(t){super.approximate=t}get hasQualifiedComponent(){return this.#t?Object.values(this.#t).some(t=>t.uncertainComponent||t.approximateComponent):!1}static valueFromSpec(t){return A.getValue(t,F.year)+A.getValue(t,F.month)+A.getValue(t,F.day)+A.getValue(t,F.hour)+A.getValue(t,F.minute)+A.getValue(t,F.second)}static toSpec(t,e=Gr){const n=k.toSpec(t,e);if(t instanceof A&&t.hasQualifiedComponent)for(const r of A.componentNames)delete n[r],t.components[r]&&(n[r]=t.components[r]);return n}static fromString(t,e=l.get(A)){const n=e.parse(t);return new A(n)}static between(t,e){const n=e.getTime(),r=t.getTime();return new A(n-r)}toSpec(){return A.toSpec(this)}toString(t=wt.instance){return super.toString(t)}}class It extends $t{get start(){return this._start}set start(t){if(typeof t=="string"&&(super.start=z.fromString(t)),t&&!(t instanceof z)&&!(t instanceof A))throw new B("Interval start is not a level 2 date or duration: "+t);this._start=t}get end(){return this._end}set end(t){if(typeof t=="string"&&(t=z.fromString(t)),t&&!(t instanceof z)&&!(t instanceof A))throw new B("Interval end is not a level 2 date or duration: "+t);this._end=t}static fromString(t,e=l.get(It)){const{start:n,end:r}=e.parse(t);return new It(n,r)}}class ee extends Set{constructor(t,e){super(t),this.exclusive=e}has(t){const e=t.toString().replace("..","/");for(const n of this)if(n.toString()===e)return!0;return!1}static fromString(t,e=l.get(ee)){const{exclusive:n,values:r}=e.parse(t);return new ee(r,n)}}class tt extends _{constructor(t,e){super(t,e)}static read(t){return{value:t?parseInt(t,10):void 0}}parseGroups(t){return tt.read(t[this.name])}parse(t){if(t.startsWith("-"))throw new B(`${this.name} cannot be negative`);return super.parse(t)}}class o{static groupName(...t){return t.reduce((e,n)=>e?e+n.charAt(0).toUpperCase()+n.substring(1):n,"")}static group(t,...e){return`(?<${t}>${e.join("")})`}static optional(t){return t+"?"}static nonCapturingGroup(...t){return`(?:${t.join("")})`}static optionalGroup(t,...e){return o.optional(o.group(t,...e))}static optionalNonCapturingGroup(...t){return o.optional(o.nonCapturingGroup(...t))}static numberGroup(t,e,n,r="\\d"){return o.group(t,`${n||""}[${r}]${e}`)}}const $e="yearValue";class Ct extends tt{static format(t=""){return o.numberGroup(o.groupName(t,$e),"{4}",void 0)}constructor(){super($e,Ct.format())}}const Ie="monthValue";class Ut extends tt{static format(t=""){return o.numberGroup(o.groupName(t,Ie),"{1,2}",void 0)}constructor(){super(Ie,Ut.format())}}const Ce="dayValue";class bt extends tt{static format(t=""){return o.numberGroup(o.groupName(t,Ce),"{1,2}",void 0)}constructor(){super(Ce,bt.format())}}const Ue="hourValue";class xt extends tt{static format(t=""){return o.numberGroup(o.groupName(t,Ue),"{1,2}",void 0)}constructor(){super(Ue,xt.format())}}const je="minuteValue";class jt extends tt{static format(t=""){return o.numberGroup(o.groupName(t,je),"{1,2}",void 0)}constructor(){super(je,jt.format())}}const Ve="secondValue";class Vt extends tt{static format(t=""){return o.numberGroup(o.groupName(t,Ve),"{1,2}",void 0)}constructor(){super(Ve,Vt.format())}}const Oe="timeshiftValue",ze="shiftHour",Be="shiftMinute";class At extends _{static format(t=""){return Re.map(e=>e.name).join("|")+"|"+o.nonCapturingGroup(o.group(t+ze,o.numberGroup(o.groupName(t,Oe),"{2}","[+-]")),o.optionalNonCapturingGroup(":?",o.numberGroup(o.groupName(t,Be),"{2}",void 0)))}constructor(){super(Oe,At.format())}parse(t,e){let n=0;const r=Re.find(i=>i.name===t);if(r){if(typeof r.timeshift=="function")try{return r.timeshift(e??{})}catch(i){throw new B(`The time zone ${t} depends on the date: ${i.message}`)}t=r.timeshift}if(t!=="Z"){const i=this.regexGroups(t),a=i[ze];a&&(n+=parseInt(a,10)*60);const u=i[Be];u&&(n+=parseInt(u,10))}return n}}const Ye="year",He="month",qe="day",Xe="hour",We="minute",Je="second",De="millisecond",Ze="timeshift";class dt extends _{static format(t=""){return o.group(o.groupName(t,Ye),Ct.format(t))+o.optionalNonCapturingGroup("-",o.group(o.groupName(t,He),Ut.format(t)),o.optionalNonCapturingGroup("-",o.group(o.groupName(t,qe),bt.format(t)),o.optionalNonCapturingGroup("[T ]",o.group(o.groupName(t,Xe),xt.format(t)),":?",o.group(o.groupName(t,We),jt.format(t)),o.optionalNonCapturingGroup(":",o.group(o.groupName(t,Je),Vt.format(t)),o.optionalNonCapturingGroup("[.,]",o.group(o.groupName(t,De),"\\d+"))),"\\s*",o.optionalGroup(o.groupName(t,Ze),At.format(t)))))}constructor(){super("date",dt.format())}parse(t){const e=this.regexGroups(t),n=e[Ye],r=e[He],i=e[qe],a=e[Xe],u=e[We],p=e[Je],c=e[De],d=e[Ze],m=n?new Mt(Ct.read(n)):void 0,w=r?Ut.read(r):void 0;return{year:m,month:w?new Et(w,gt.create(w.value,m?.value)):void 0,day:i?new Nt(bt.read(i)):void 0,hour:a?new Gt(xt.read(a)):void 0,minute:u?new vt(jt.read(u)):void 0,second:p?new Tt(Vt.read(p)):void 0,millisecond:c?ct.parseFraction(c):void 0,timeshift:d?ut.fromString(d,new At,{year:m?.value,month:w?.value,day:i?bt.read(i).value:void 0,hour:a?xt.read(a).value:void 0}):void 0}}}const Ke="years",ce="months",vr="days",Qe="hours",Pe="minutes",Le="seconds";class Ge extends _{static format(t=""){return"P"+o.optionalNonCapturingGroup(o.numberGroup(o.groupName(t,Ke),"+",void 0,"\\d"),"Y")+o.optionalNonCapturingGroup(o.numberGroup(o.groupName(t,ce),"+",void 0,"\\d"),"MM")+o.optionalNonCapturingGroup(o.numberGroup(o.groupName(t,vr),"+",void 0,"\\d"),"D")+o.optionalNonCapturingGroup(o.numberGroup(o.groupName(t,Qe),"+",void 0,"\\d"),"H")+o.optionalNonCapturingGroup(o.numberGroup(o.groupName(t,Pe),"+",void 0,"\\d"),"M")+o.optionalNonCapturingGroup(o.numberGroup(o.groupName(t,Le),"+",void 0,"\\d"),"S")}constructor(){super("duration",Ge.format())}parseGroups(t){return{years:t[Ke],months:t[ce],days:t[ce],hours:t[Qe],minutes:t[Pe],seconds:t[Le]}}}const me="start",de="end";class ve extends _{static format=o.group(me,dt.format(me))+"/"+o.group(de,dt.format(de));constructor(){super("interval",ve.format)}parse(t){const e=this.regexGroups(t),n=e[me],r=e[de];return{start:n?I.fromString(n,new dt):void 0,end:r?I.fromString(r,new dt):void 0}}}l.register(I,()=>new dt);l.register(Nt,()=>new bt);l.register(H,()=>new Ge);l.register(Gt,()=>new xt);l.register(Rt,()=>new ve);l.register(vt,()=>new jt);l.register(Et,()=>new Ut);l.register(Tt,()=>new Vt);l.register(ut,()=>new At);l.register(Mt,()=>new Ct);class G extends tt{static uncertainGroup="uncertain";static approximateGroup="approx";static uncertainAndApproximateGroup=G.uncertainGroup+G.approximateGroup;constructor(t,e){super(t,e)}static qualifierFormat(t,e){return o.optionalGroup(t,`\\${e}`)}static formatSuffix(t){return this.qualifierFormat(o.groupName(G.uncertainGroup,t),"?")+this.qualifierFormat(o.groupName(G.approximateGroup,t),"~")+this.qualifierFormat(o.groupName(G.uncertainAndApproximateGroup,t),"%")}static numberFormat(t,e,n){return o.numberGroup(t,e,n,"\\dX")+this.formatSuffix(t)}getValueAndSign(t){let e=t[this.name],n;return e.charAt(0)==="-"?(n=-1,e=e.substring(1)):n=1,{valueStr:e,sign:n}}parseGroups(t){const{valueStr:e,sign:n}=this.getValueAndSign(t);let r=0,i;for(i=0;i<e.length;i++){const c=e[i];if(c==="X")break;r=r*10+parseInt(c,10)}if(i<e.length){let c=1;for(let w=0;w<e.length-i;w++)c*=10;const d=n*r*c,m=d+c-1;r={start:d,end:m}}else r*=n;const a=t[o.groupName(G.uncertainAndApproximateGroup,this.name)],u=t[o.groupName(G.approximateGroup,this.name)]||a,p=t[o.groupName(G.uncertainGroup,this.name)]||a;return{value:r,approximate:u?!!u:!1,uncertain:p?!!p:!1}}}const _e="yearValue";class Ot extends G{constructor(){super(_e,Ot.format())}static format(t=""){return"Y?"+G.numberFormat(o.groupName(t,_e),"+","[-]?")}parse(t){const e=this.regexGroups(t);return this.parseGroups(e)}}const tn="monthValue";class zt extends G{static format(t=""){return G.numberFormat(o.groupName(t,tn),"{1,2}",void 0)}constructor(){super(tn,zt.format())}}const en="dayValue";class Bt extends G{static format(t=""){return G.numberFormat(o.groupName(t,en),"{1,2}",void 0)}constructor(){super(en,Bt.format())}}const nn="hourValue";class Yt extends G{static format(t=""){return G.numberFormat(o.groupName(t,nn),"{1,2}",void 0)}constructor(){super(nn,Yt.format())}}const rn="minuteValue";class Ht extends G{static format(t=""){return G.numberFormat(o.groupName(t,rn),"{1,2}",void 0)}constructor(){super(rn,Ht.format())}}const sn="secondValue";class qt extends G{static format(t=""){return G.numberFormat(o.groupName(t,sn),"{1,2}",void 0)}constructor(){super(sn,qt.format())}}class Xt extends At{}class v extends _{static yearGroup="year";static monthGroup="month";static dayGroup="day";static hourGroup="hour";static minuteGroup="minute";static secondGroup="second";static millisecondGroup="millisecond";static timeshiftGroup="timeshift";constructor(t=v.format()){super("date",t)}static format(t=""){return o.group(o.groupName(t,v.yearGroup),Ot.format(t))+o.optionalNonCapturingGroup("-",o.group(o.groupName(t,v.monthGroup),zt.format(t)),o.optionalNonCapturingGroup("-",o.group(o.groupName(t,v.dayGroup),Bt.format(t)),o.optionalNonCapturingGroup("[T ]",o.group(o.groupName(t,v.hourGroup),Yt.format(t)),":",o.group(o.groupName(t,v.minuteGroup),Ht.format(t)),o.optionalNonCapturingGroup(":",o.group(o.groupName(t,v.secondGroup),qt.format(t)),o.optionalNonCapturingGroup("[.,]",o.group(o.groupName(t,v.millisecondGroup),"\\d+"))),o.optionalGroup(o.groupName(t,v.timeshiftGroup),Xt.format(t)))))}parseGroups(t){const e=t[v.millisecondGroup],n=e?ct.parseFraction(e):void 0,r=t[v.secondGroup],i=r?at.fromString(r,new qt):void 0,a=t[v.minuteGroup];let u;a&&(u=it.fromString(a,new Ht),u.uncertain=u.uncertain||i?.uncertain||!1,u.approximate=u.approximate||i?.approximate||!1);const p=t[v.hourGroup];let c;p&&(c=ot.fromString(p,new Yt),c.uncertain=c.uncertain||u?.uncertain||!1,c.approximate=c.approximate||u?.approximate||!1);const d=t[v.dayGroup];let m;d&&(m=st.fromString(d,new Bt),m.uncertain=m.uncertain||c?.uncertain||!1,m.approximate=m.approximate||c?.approximate||!1);const w=t[v.monthGroup];let y;w&&(y=rt.fromString(w,new zt),y.uncertain=y.uncertain||m?.uncertain||!1,y.approximate=y.approximate||m?.approximate||!1);const b=t[v.yearGroup];let S;b&&(S=nt.fromString(b,void 0,new Ot),S.uncertain=S.uncertain||y?.uncertain||!1,S.approximate=S.approximate||y?.approximate||!1);const T=t[v.timeshiftGroup],g=T?lt.fromString(T,new Xt,{year:S?.value,month:y?.value,day:m?.value,hour:c?.value}):void 0;return{year:S,month:y,day:m,hour:c,minute:u,second:i,millisecond:n,timeshift:g}}}const on="years",an="months",un="days",cn="hours",mn="minutes",dn="seconds";class pt extends G{static format(t=""){return"P"+o.optionalNonCapturingGroup(o.numberGroup(o.groupName(t,on),"+",void 0,"\\d"),"Y")+o.optionalNonCapturingGroup(o.numberGroup(o.groupName(t,an),"+",void 0,"\\d"),"MM")+o.optionalNonCapturingGroup(o.numberGroup(o.groupName(t,un),"+",void 0,"\\d"),"D")+o.optionalNonCapturingGroup(o.numberGroup(o.groupName(t,cn),"+",void 0,"\\d"),"H")+o.optionalNonCapturingGroup(o.numberGroup(o.groupName(t,mn),"+",void 0,"\\d"),"M")+o.optionalNonCapturingGroup(o.numberGroup(o.groupName(t,dn),"+",void 0,"\\d"),"S")+this.formatSuffix(t)}constructor(){super("duration",pt.format())}parseGroups(t){return{years:t[on],months:t[an],days:t[un],hours:t[cn],minutes:t[mn],seconds:t[dn],uncertain:!!t[G.uncertainGroup],approximate:!!t[G.approximateGroup]}}}const Tr="dates",pe="start",le="end",pn="durations",he="durationMin",fe="durationMax";class Te extends _{static format=o.group(Tr,o.optionalGroup(pe,o.group("openStart","\\.\\.")+"|"+v.format(pe))+"/"+o.optionalGroup(le,o.group("openEnd","\\.\\.")+"|"+v.format(le)))+"|"+o.group(pn,o.group(he,pt.format(he))+"/"+o.group(fe,pt.format(fe)));constructor(t="interval",e=Te.format){super(t,e)}parseGroups(t){let e,n;if(t[pn]){const i=t[he];e=k.fromString(i,new pt);const a=t[fe];n=k.fromString(a,new pt)}else{const i=t[pe];switch(i){case void 0:e=null;break;case"..":e=void 0;break;default:e=O.fromString(i,new v)}const a=t[le];switch(a){case void 0:n=null;break;case"..":n=void 0;break;default:n=O.fromString(a,new v)}}return{start:e,end:n}}}l.register(O,()=>new v);l.register(st,()=>new Bt);l.register(k,()=>new pt);l.register(ot,()=>new Yt);l.register($t,()=>new Te);l.register(it,()=>new Ht);l.register(rt,()=>new zt);l.register(at,()=>new qt);l.register(lt,()=>new Xt);l.register(nt,()=>new Ot);class M extends G{static uncertainGroup="uncertain1";static approximateGroup="approx1";static uncertainAndApproximateGroup=M.uncertainGroup+M.approximateGroup;constructor(t,e){super(t,e)}static numberFormat(t,e,n){return this.qualifierFormat(o.groupName(M.uncertainGroup,t),"?")+this.qualifierFormat(o.groupName(M.approximateGroup,t),"~")+this.qualifierFormat(o.groupName(M.uncertainAndApproximateGroup,t),"%")+G.numberFormat(t,e,n)}parseGroups(t){const e=super.parseGroups(t),n=t[o.groupName(M.uncertainAndApproximateGroup,this.name)];return(t[o.groupName(M.uncertainGroup,this.name)]||n)&&(e.uncertainComponent=!0),(t[o.groupName(M.approximateGroup,this.name)]||n)&&(e.approximateComponent=!0),e}}const Ft="yearValue",ln="exp",hn="signif";class Wt extends M{constructor(){super(Ft,Wt.format())}static format(t=""){return"Y?"+o.nonCapturingGroup(o.group(o.groupName(t,ln),"[-]?\\d+E\\d+")+"|"+M.numberFormat(o.groupName(t,Ft),"+","[-]?")+o.optionalGroup(o.groupName(t,hn),"S\\d+"))}parseGroups(t){const e=t[ln];if(e){const a=e.indexOf("E"),u=parseInt(e.substring(a+1),10),c=parseInt(e.substring(0,a),10)*Math.pow(10,u);t[Ft]=c.toString()}const n=t[hn],r=t[Ft];if(n){const a=parseInt(n.substring(1),10),{valueStr:u,sign:p}=this.getValueAndSign(t);let c="";for(let d=0;d<u.length;d++)c+=d<a?u.charAt(d):"X";t[Ft]=(p<0?"-":"")+c}const i=super.parseGroups(t);return n&&(i.value.estimate=parseInt(r,10)),i}parse(t){const e=this.regexGroups(t);return this.parseGroups(e)}}const fn="monthValue";class Jt extends M{static format(t=""){return M.numberFormat(o.groupName(t,fn),"{1,2}",void 0)}constructor(){super(fn,Jt.format())}}const gn="dayValue";class Dt extends M{static format(t=""){return M.numberFormat(o.groupName(t,gn),"{1,2}",void 0)}constructor(){super(gn,Dt.format())}}const wn="hourValue";class Zt extends M{static format(t=""){return M.numberFormat(o.groupName(t,wn),"{1,2}",void 0)}constructor(){super(wn,Zt.format())}}const Sn="secondValue";class Kt extends M{static format(t=""){return M.numberFormat(o.groupName(t,Sn),"{1,2}",void 0)}constructor(){super(Sn,Kt.format())}}const yn="minuteValue";class Qt extends M{static format(t=""){return M.numberFormat(o.groupName(t,yn),"{1,2}",void 0)}constructor(){super(yn,Qt.format())}}class Ar extends Xt{}class E extends _{static yearGroup=v.yearGroup;static monthGroup="month";static dayGroup="day";static hourGroup="hour";static minuteGroup="minute";static secondGroup="second";static millisecondGroup="millisecond";static timeshiftGroup="timeshift";constructor(){super("date",E.format())}static format(t=""){return o.group(o.groupName(t,E.yearGroup),Wt.format(t))+o.optionalNonCapturingGroup("-",o.group(o.groupName(t,E.monthGroup),Jt.format(t)),o.optionalNonCapturingGroup("-",o.group(o.groupName(t,E.dayGroup),Dt.format(t)),o.optionalNonCapturingGroup("[T ]",o.group(o.groupName(t,E.hourGroup),Zt.format(t)),":",o.group(o.groupName(t,E.minuteGroup),Qt.format(t)),o.optionalNonCapturingGroup(":",o.group(o.groupName(t,E.secondGroup),Kt.format(t)),o.optionalNonCapturingGroup("[.,]",o.group(o.groupName(t,E.millisecondGroup),"\\d+"))),o.optionalGroup(o.groupName(t,E.timeshiftGroup),Ar.format(t)))))}parseGroups(t){const e=t[E.millisecondGroup],n=e?ct.parseFraction(e):void 0,r=t[E.secondGroup];let i;r&&(i=L.fromString(r,void 0,new Kt),i.uncertain=i?.uncertain||!1,i.approximate=i?.approximate||!1);const a=t[E.minuteGroup];let u;a&&(u=P.fromString(a,new Qt),u.uncertain=u.uncertain||i?.uncertain||!1,u.approximate=u.approximate||i?.approximate||!1);const p=t[E.hourGroup];let c;p&&(c=Q.fromString(p,new Zt),c.uncertain=c.uncertain||u?.uncertain||!1,c.approximate=c.approximate||u?.approximate||!1);const d=t[E.dayGroup];let m;d&&(m=K.fromString(d,new Dt),m.uncertain=m.uncertain||c?.uncertain||!1,m.approximate=m.approximate||c?.approximate||!1);const w=t[E.monthGroup];let y;w&&(y=Z.fromString(w,new Jt),y.uncertain=y.uncertain||m?.uncertain||!1,y.approximate=y.approximate||m?.approximate||!1);const b=t[E.yearGroup];let S;b&&(S=D.fromString(b,void 0,new Wt),S.uncertain=S.uncertain||y?.uncertain||!1,S.approximate=S.approximate||y?.approximate||!1);const T=t[E.timeshiftGroup],g=T?jn.fromString(T,new Xt,{year:S?.value,month:y?.value,day:m?.value,hour:c?.value}):void 0;return{year:S,month:y,day:m,hour:c,minute:u,second:i,millisecond:n,timeshift:g}}}const bn="durationValue";class Ae extends M{static format(t=""){return"^"+M.numberFormat(o.groupName(t,bn),"+",void 0)}constructor(){super(bn,Ae.format())}}class kr extends Me{millisecond=new N("millisecond",0,Number.MAX_SAFE_INTEGER,void 0);second=new N("second",0,Number.MAX_SAFE_INTEGER,this.millisecond);minute=new N("minute",0,Number.MAX_SAFE_INTEGER,this.second);hour=new N("hour",0,Number.MAX_SAFE_INTEGER,this.minute);day=new N("day",1,Number.MAX_SAFE_INTEGER,this.hour);month=new N("month",1,Number.MAX_SAFE_INTEGER,this.day);year=new N("year",0,Number.MAX_SAFE_INTEGER,this.month)}const ht=new kr;class h extends M{static yearsGroup="years";static monthsGroup="months";static isoMonthsGroup="isoMonths";static daysGroup="days";static hoursGroup="hours";static minutesGroup="minutes";static secondsGroup="seconds";static durationGroup="duration";static suffixGroup="durationSuffix";static componentParser=new Ae;static componentFormat(t,e,n,r,i=""){const a=o.group(o.groupName(t,h.quantityGroup(e)),M.numberFormat(o.groupName(t,n),"+",void 0,"\\d"));return o.group(o.groupName(t,e),a,r,i)}static quantityGroup(t){return t+"Quantity"}static isoMonthsLookahead="(?=[?~%]?\\d+D|T)";constructor(){super("duration",h.format())}static format(t=""){const e=o.groupName(t,h.durationGroup);return this.qualifierFormat(o.groupName(M.uncertainGroup,e),"?")+this.qualifierFormat(o.groupName(M.approximateGroup,e),"~")+this.qualifierFormat(o.groupName(M.uncertainAndApproximateGroup,e),"%")+"P"+o.optional(h.componentFormat(t,h.yearsGroup,E.yearGroup,"Y"))+o.optionalNonCapturingGroup(h.componentFormat(t,h.monthsGroup,E.monthGroup,"MM")+"|"+h.componentFormat(t,h.isoMonthsGroup,"isoMonth","M",h.isoMonthsLookahead))+o.optional(h.componentFormat(t,h.daysGroup,E.dayGroup,"D"))+"T?"+o.optional(h.componentFormat(t,h.hoursGroup,E.hourGroup,"H"))+o.optional(h.componentFormat(t,h.minutesGroup,E.minuteGroup,"M"))+o.optional(h.componentFormat(t,h.secondsGroup,E.secondGroup,"S"))+o.optionalGroup(o.groupName(t,h.suffixGroup),"[?~%]")}static parseComponent(t,e,n){const r=h.componentParser.parse(t);return new e(r,n)}parseGroups(t){const e=t[h.quantityGroup(h.secondsGroup)];let n;e&&(n=h.parseComponent(e,L,ht.second),n.uncertain=!!t[o.groupName(M.uncertainGroup,h.secondsGroup)]||!1,n.approximate=!!t[o.groupName(M.approximateGroup,h.secondsGroup)]||!1);const r=t[h.quantityGroup(h.minutesGroup)];let i;r&&(i=h.parseComponent(r,P,ht.minute),i.uncertain=i.uncertain||n?.uncertain||!1,i.approximate=i.approximate||n?.approximate||!1);const a=t[h.quantityGroup(h.hoursGroup)];let u;a&&(u=h.parseComponent(a,Q,ht.hour),u.uncertain=u.uncertain||i?.uncertain||!1,u.approximate=u.approximate||i?.approximate||!1);const p=t[h.quantityGroup(h.daysGroup)];let c;p&&(c=h.parseComponent(p,K,ht.day),c.uncertain=c.uncertain||u?.uncertain||!1,c.approximate=c.approximate||u?.approximate||!1);const d=t[h.quantityGroup(h.monthsGroup)]||t[h.quantityGroup(h.isoMonthsGroup)];let m;d&&(m=h.parseComponent(d,Z,ht.month),m.uncertain=m.uncertain||c?.uncertain||!1,m.approximate=m.approximate||c?.approximate||!1);const w=t[h.quantityGroup(h.yearsGroup)];let y;w&&(y=h.parseComponent(w,D,ht.year),y.uncertain=y.uncertain||m?.uncertain||!1,y.approximate=y.approximate||m?.approximate||!1);const b=t[h.suffixGroup],S=!!t[o.groupName(M.uncertainAndApproximateGroup,h.durationGroup)]||b==="%",T=S||!!t[o.groupName(M.uncertainGroup,h.durationGroup)]||b==="?",g=S||!!t[o.groupName(M.approximateGroup,h.durationGroup)]||b==="~";return{years:y,months:m,days:c,hours:u,minutes:i,seconds:n,uncertain:T,approximate:g}}}const Fr="dates",ge="start",we="end",xn="durations",Se="durationMin",ye="durationMax";class ae extends _{static format=o.group(Fr,o.optionalGroup(ge,o.group("openStart","\\.\\.")+"|"+E.format(ge))+"/"+o.optionalGroup(we,o.group("openEnd","\\.\\.")+"|"+E.format(we)))+"|"+o.group(xn,o.group(Se,h.format(Se))+"/"+o.group(ye,h.format(ye)));constructor(t="interval",e=ae.format){super(t,e)}parseGroups(t){let e,n;if(t[xn]){const i=t[Se];e=A.fromString(i,new h);const a=t[ye];n=A.fromString(a,new h)}else{const i=t[ge];switch(i){case void 0:e=null;break;case"..":e=void 0;break;default:e=z.fromString(i,new E)}const a=t[we];switch(a){case void 0:n=null;break;case"..":n=void 0;break;default:n=z.fromString(a,new E)}}return{start:e,end:n}}}class Rr{parse(t){t=t.trim();const e=t.startsWith("["),r=t.substring(1,t.length-1).split(","),i=[];for(const a of r){let u;a.includes("..")?u=It.fromString(a.replace("..","/"),new ae):u=z.fromString(a,new E),i.push(u)}return{values:i,exclusive:e}}}l.register(z,()=>new E);l.register(K,()=>new Dt);l.register(A,()=>new h);l.register(Q,()=>new Zt);l.register(It,()=>new ae);l.register(P,()=>new Qt);l.register(Z,()=>new Jt);l.register(L,()=>new Kt);l.register(ee,()=>new Rr);l.register(D,()=>new Wt);class X{constructor(t){this.preferences=t}read(t){var e,n;if(t===void 0)return;if(typeof t=="string")return t===""?void 0:t;for(const i of this.preferences){const a=(e=t[i])!==null&&e!==void 0?e:t[X.base(i)];if(a)return a}const r=new Set(this.preferences.map(i=>X.base(i)));for(const[i,a]of Object.entries(t))if(a&&r.has(X.base(i)))return a;return(n=Object.values(t).find(i=>i))!==null&&n!==void 0?n:void 0}write(t,e,n){var r,i;const a=e?.trim()?e.trim():void 0;if(t===void 0||typeof t=="string")return a;const u={...t},p=(i=(r=Object.keys(u).find(c=>c===n))!==null&&r!==void 0?r:Object.keys(u).find(c=>X.base(c)===X.base(n)))!==null&&i!==void 0?i:n;return a===void 0?delete u[p]:u[p]=a,Object.keys(u).length===0?void 0:u}static base(t){return t.toLowerCase().split("-")[0]}}X.any=new X([]);var Mn;(function(s){s.abductee="abductee",s.actor="actor",s.artist="artist",s.anthropologist="anthropologist",s.archeologist="archeologist",s.astronaut="astronaut",s.astronomer="astronomer",s.astrologist="astrologist",s.astrophysicist="astrophysicist",s.banker="banker",s.barman="barman",s.biologist="biologist",s.biochemist="biochemist",s.biophysicist="biophysicist",s.bishop="bishop",s.businessman="businessman",s.botanist="botanist",s.cameraman="cameraman",s.chemist="chemist",s.contactee="contactee",s.cryptozoologist="cryptozoologist",s.dentist="dentist",s.director="director",s.diplomat="diplomat",s.diver="diver",s.electronics="electronics",s.engineer="engineer",s.ethnologist="ethnologist",s.exobiologist="exobiologist",s.farmer="farmer",s.firefighter="firefighter",s.flightAttendant="flightAttendant",s.geologist="geologist",s.geophysicist="geophysicist",s.geographer="geographer",s.historian="historian",s.houseWife="houseWife",s.hypnotherapist="hypnotherapist",s.illusionist="illusionist",s.journalist="journalist",s.judge="judge",s.lawyer="lawyer",s.leader="leader",s.librarian="librarian",s.logger="logger",s.mathematician="mathematician",s.mechanic="mechanic",s.meteorologist="meteorologist",s.military="military",s.musician="musician",s.neurologist="neurologist",s.neuroscientist="neuroscientist",s.neuropsychiatrist="neuropsychiatrist",s.nurse="nurse",s.oceanographer="oceanographer",s.painter="painter",s.parapsychologist="parapsychologist",s.philosopher="philosopher",s.photographer="photographer",s.physician="physician",s.physicist="physicist",s.pilot="pilot",s.politician="politician",s.policeman="policeman",s.priest="priest",s.producer="producer",s.prospector="prospector",s.psychologist="psychologist",s.psychiatrist="psychiatrist",s.radioastronomer="radioastronomer",s.radioamateur="radioamateur",s.salesman="salesman",s.sailor="sailor",s.sociologist="sociologist",s.softwareEngineer="softwareEngineer",s.stuntman="stuntman",s.taxiDriver="taxiDriver",s.teacher="teacher",s.telegrapher="telegrapher",s.truckDriver="truckDriver",s.ufologist="ufologist",s.ufoWitness="ufoWitness",s.ufoWitness2="ufoWitness2",s.worker="worker",s.writer="writer"})(Mn||(Mn={}));var En;(function(s){s.neutral="neutral",s.male="male",s.female="female"})(En||(En={}));const $r="modulepreload",Ir=function(s,t){return new URL(s,t).href},Nn={},_t=function(t,e,n){let r=Promise.resolve();if(e&&e.length>0){let a=function(d){return Promise.all(d.map(m=>Promise.resolve(m).then(w=>({status:"fulfilled",value:w}),w=>({status:"rejected",reason:w}))))};const u=document.getElementsByTagName("link"),p=document.querySelector("meta[property=csp-nonce]"),c=p?.nonce||p?.getAttribute("nonce");r=a(e.map(d=>{if(d=Ir(d,n),d in Nn)return;Nn[d]=!0;const m=d.endsWith(".css"),w=m?'[rel="stylesheet"]':"";if(!!n)for(let S=u.length-1;S>=0;S--){const T=u[S];if(T.href===d&&(!m||T.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${d}"]${w}`))return;const b=document.createElement("link");if(b.rel=m?"stylesheet":$r,m||(b.as="script"),b.crossOrigin="",b.href=d,c&&b.setAttribute("nonce",c),document.head.appendChild(b),m)return new Promise((S,T)=>{b.addEventListener("load",S),b.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${d}`)))})}))}function i(a){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=a,window.dispatchEvent(u),!u.defaultPrevented)throw a}return r.then(a=>{for(const u of a||[])u.status==="rejected"&&i(u.reason);return t().catch(i)})};class Cr extends Error{constructor(t,e){super(t),this.cause=e}}class ke extends Cr{constructor(t=ke.defaultMessage,e){super(t,e)}}ke.defaultMessage="Assertion failed";var Gn;(function(s){s.country="country",s.region="region",s.department="department",s.city="city",s.company="company"})(Gn||(Gn={}));var vn;(function(s){s.at="at",s.au="au",s.ar="ar",s.be="be",s.br="br",s.ca="ca",s.ch="ch",s.cn="cn",s.cl="cl",s.co="co",s.cy="cy",s.de="de",s.dk="dk",s.do="do",s.dz="dz",s.gr="gr",s.ec="ec",s.eg="eg",s.es="es",s.fi="fi",s.fr="fr",s.ga="ga",s.ge="ge",s.hu="hu",s.in="in",s.ie="ie",s.ir="ir",s.il="il",s.it="it",s.jp="jp",s.kr="kr",s.ma="ma",s.mx="mx",s.my="my",s.mz="mz",s.nl="nl",s.no="no",s.nz="nz",s.pa="pa",s.pe="pe",s.ph="ph",s.pl="pl",s.pt="pt",s.ro="ro",s.ru="ru",s.sc="sc",s.tr="tr",s.ua="ua",s.uk="uk",s.us="us",s.sa="sa",s.se="se",s.su="su",s.tn="tn",s.tw="tw",s.ve="ve",s.za="za"})(vn||(vn={}));class Tn{static NAMES=["weather","place","lightPollution","decor"];static KEYS={weather:["weatherTrack","weatherSource"],place:["place"],lightPollution:["lightPollution"],decor:["decor"]};static annexName(t,e){return`${t}.${e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}.json`}static fromFile(t,e){return t?.[e]!==void 0&&t[e].live!==!0}}class St{static DEFAULT_FOCAL_MM=50;static FOCAL_RANGE_MM={minMm:14,maxMm:135};static BODIES=[{id:"eos-450d",name:"Canon EOS 450D (APS-C)",widthMm:22.2,heightMm:14.8,pixelUm:5.2,year:2008},{id:"eos-60da",name:"Canon EOS 60Da (APS-C)",widthMm:22.3,heightMm:14.9,pixelUm:4.3,year:2012},{id:"eos-70d",name:"Canon EOS 70D (APS-C)",widthMm:22.5,heightMm:15,pixelUm:4.1,year:2013},{id:"eos-80d",name:"Canon EOS 80D (APS-C)",widthMm:22.3,heightMm:14.9,pixelUm:3.7,year:2016},{id:"eos-7d",name:"Canon EOS 7D (APS-C)",widthMm:22.3,heightMm:14.9,pixelUm:4.1,year:2009},{id:"eos-7d-ii",name:"Canon EOS 7D Mark II (APS-C)",widthMm:22.4,heightMm:15,pixelUm:4.1,year:2014},{id:"eos-5d",name:"Canon EOS 5D (full frame)",widthMm:35.8,heightMm:23.9,pixelUm:8.2,year:2005},{id:"eos-5d-ii",name:"Canon EOS 5D Mark II (full frame)",widthMm:36,heightMm:24,pixelUm:6.4,year:2008},{id:"eos-5d-iii",name:"Canon EOS 5D Mark III (full frame)",widthMm:36,heightMm:24,pixelUm:6.25,year:2012},{id:"eos-5d-iv",name:"Canon EOS 5D Mark IV (full frame)",widthMm:36,heightMm:24,pixelUm:5.36,year:2016},{id:"eos-6d",name:"Canon EOS 6D (full frame)",widthMm:35.8,heightMm:23.9,pixelUm:6.55,year:2012},{id:"eos-6d-ii",name:"Canon EOS 6D Mark II (full frame)",widthMm:36,heightMm:24,pixelUm:5.77,year:2017},{id:"nikon-d3",name:"Nikon D3 / D700 (full frame)",widthMm:36,heightMm:23.9,pixelUm:8.44,year:2007},{id:"nikon-d7000",name:"Nikon D7000 (DX)",widthMm:23.6,heightMm:15.6,pixelUm:4.78,year:2010},{id:"nikon-d7100",name:"Nikon D7100 / D7200 (DX)",widthMm:23.5,heightMm:15.6,pixelUm:3.9,year:2013},{id:"nikon-d500",name:"Nikon D500 / D7500 (DX)",widthMm:23.5,heightMm:15.7,pixelUm:4.2,year:2016}];static instruments(){return St.BODIES.map(t=>({id:t.id,category:"dslr",name:t.name,projection:"rectilinear",frame:{widthMm:t.widthMm,heightMm:t.heightMm,focalLengthMm:St.DEFAULT_FOCAL_MM,focalRangeMm:St.FOCAL_RANGE_MM},fNumber:8,fNumberRange:{min:1.4,max:22},exposureSeconds:1/250,exposureRangeSeconds:{min:1/8e3,max:3600},years:{from:t.year},apertureBlades:7,detailUm:t.pixelUm,medium:{kind:"sensor",iso:100}}))}static names(){return Object.fromEntries(St.BODIES.map(t=>[t.id,t.name]))}}class Y{static DEFAULT_EYEPIECE_MM=26;static DEFAULT_APPARENT_FIELD_DEG=52;static FIELD_STOP_MM=2*Y.DEFAULT_EYEPIECE_MM*Math.tan(Y.DEFAULT_APPARENT_FIELD_DEG*Math.PI/360);static RANGE={min:26/40*.63,max:26/6*3};static BINOCULARS=[{id:"binoculars-zeiss-6x30",name:"Carl Zeiss 6x30",magnification:6,apertureMm:30,trueFieldDeg:5,fromYear:1960},{id:"binoculars-zeiss-dialyt-10x40",name:"Carl Zeiss Dialyt 10x40 B T*",magnification:10,apertureMm:40,trueFieldDeg:6.3,fromYear:1975},{id:"binoculars-jenoptem-10x50",name:"Jenoptem 10x50 W",magnification:10,apertureMm:50,trueFieldDeg:7.3,fromYear:1960},{id:"binoculars-swarovski-7x50-habicht",name:"Swarovski 7x50 SL Habicht",magnification:7,apertureMm:50,trueFieldDeg:6.6,fromYear:1960},{id:"binoculars-swarovski-7x50-slc",name:"Swarovski 7x50 SLC",magnification:7,apertureMm:50,trueFieldDeg:7.1,fromYear:1990},{id:"binoculars-nikon-10x42-edg",name:"Nikon 10x42 EDG",magnification:10,apertureMm:42,trueFieldDeg:6.5,fromYear:2011},{id:"binoculars-canon-15x50-is",name:"Canon 15x50 IS All Weather",magnification:15,apertureMm:50,trueFieldDeg:4.5,fromYear:2008},{id:"binoculars-celestron-15x70",name:"Celestron 15x70 SkyMaster",magnification:15,apertureMm:70,trueFieldDeg:4.4,fromYear:1990},{id:"binoculars-miyauchi-25x141",name:"Miyauchi BR-141 Galaxy 45 25x141",magnification:25,apertureMm:141,trueFieldDeg:2.6,fromYear:2e3}];static TELESCOPES=[{id:"telescope-generic-60-700",name:"Telescope 60/700",apertureMm:60,focalLengthMm:700},{id:"telescope-generic-60-1000",name:"Telescope 60/1000",apertureMm:60,focalLengthMm:1e3},{id:"telescope-celestron-onyx-80edf",name:"Celestron Onyx 80EDF",apertureMm:80,focalLengthMm:500,fromYear:2010},{id:"telescope-celestron-c5",name:"Celestron C5 f/10",apertureMm:125,focalLengthMm:1250,fromYear:1970},{id:"telescope-celestron-c8",name:"Celestron C8 f/10",apertureMm:203,focalLengthMm:2032,fromYear:1970},{id:"telescope-celestron-c11",name:"Celestron C11 f/10",apertureMm:280,focalLengthMm:2800,fromYear:1970},{id:"telescope-celestron-c14",name:"Celestron C14 f/11",apertureMm:355.6,focalLengthMm:3910,fromYear:1970},{id:"telescope-meade-etx-80",name:"Meade ETX 80 f/5",apertureMm:80,focalLengthMm:400,fromYear:1996},{id:"telescope-meade-etx-90",name:"Meade ETX 90 f/13.8",apertureMm:90,focalLengthMm:1242,fromYear:1996},{id:"telescope-meade-etx-125",name:"Meade ETX 125 f/15",apertureMm:127,focalLengthMm:1900,fromYear:1996},{id:"telescope-meade-lx200-8",name:"Meade LX200 8 in f/10",apertureMm:200,focalLengthMm:2e3,fromYear:1992},{id:"telescope-meade-lx200-10",name:"Meade LX200 10 in f/10",apertureMm:250,focalLengthMm:2500,fromYear:1992},{id:"telescope-meade-lx200-12",name:"Meade LX200 12 in f/10",apertureMm:305,focalLengthMm:3048,fromYear:1992},{id:"telescope-meade-lx200-14",name:"Meade LX200 14 in f/10",apertureMm:355,focalLengthMm:3556,fromYear:1992},{id:"telescope-meade-lx200-16",name:"Meade LX200 16 in f/10",apertureMm:406,focalLengthMm:4064,fromYear:1992}];static instruments(){const t=Y.BINOCULARS.map(r=>({id:r.id,category:"binoculars",name:r.name,projection:"rectilinear",visualAid:{apertureMm:r.apertureMm,magnification:r.magnification,trueFieldDeg:r.trueFieldDeg},...r.fromYear!==void 0?{years:{from:r.fromYear}}:{}})),e=Y.FIELD_STOP_MM,n=Y.TELESCOPES.map(r=>({id:r.id,category:"telescope",name:r.name,projection:"rectilinear",frame:{widthMm:e*16/9,heightMm:e,focalLengthMm:r.focalLengthMm,focalRangeMm:{minMm:r.focalLengthMm*Y.RANGE.min,maxMm:r.focalLengthMm*Y.RANGE.max}},visualAid:{apertureMm:r.apertureMm,eyepieceFocalMm:Y.DEFAULT_EYEPIECE_MM},...r.fromYear!==void 0?{years:{from:r.fromYear}}:{}}));return[...t,...n]}static names(){return Object.fromEntries(Y.instruments().map(t=>[t.id,t.name]))}}[(1/250,1/1e3),1/50,1/90,(1/250,1/1e3),(1/250,1/1e3),(1/120,1/8e3),(1/120,1/8e3),(1/30,1/1e4,1/30),(1/50,1/1e5,1/50),...St.instruments(),...Y.instruments()];const Ur=["spring","summer","autumn","winter"],jr=21;function Vr(s){if(s.raw!==void 0)return s.raw;if(s.year===void 0){if(s.hour===void 0)return"";let e=`${String(s.hour).padStart(2,"0")}:${String(s.minute??0).padStart(2,"0")}`;return s.second!==void 0&&(e+=`:${String(s.second).padStart(2,"0")}`),e}let t=String(s.year).padStart(4,"0");return s.season!==void 0?`${t}-${jr+Ur.indexOf(s.season)}`:(s.month===void 0||(t+=`-${String(s.month).padStart(2,"0")}`,s.day===void 0)||(t+=`-${String(s.day).padStart(2,"0")}`,s.hour===void 0)||(t+=`T${String(s.hour).padStart(2,"0")}:${String(s.minute??0).padStart(2,"0")}`,s.second!==void 0&&(t+=`:${String(s.second).padStart(2,"0")}`)),t)}class U{static toCurrent(t){const e=t.version,n=typeof e=="object"&&e!==null&&"value"in e?e.value:e;if(n!==void 0&&n!==1&&n!==2)return t;const r=n===2?t:U.fromVersion1(t);return U.fromVersion2(r)}static observerIdOf(t){return t.observer?.id??"observer"}static fromVersion2(t){const e={...t,version:3},n={...t.timeline??{keyframes:[]}},r=new Set,i=n.keyframes??[];for(const d of i)for(const m of d.shapes??[])r.add(m.sourceId);const a=[],u=d=>{let m=d;for(let w=a.length+1;m===void 0||r.has(m);w++)m=`group-${w}`;return r.add(m),m},p=Array.isArray(n.groups)?n.groups:[];for(const d of p)Array.isArray(d)?a.push({id:u(),members:[...d]}):typeof d=="object"&&d!==null&&a.push(d);const c=Array.isArray(t.events)?t.events.map(d=>({...d})):void 0;if(c){const d=U.observerIdOf(t),m=c.filter(g=>g.who==="phenomenon"),w=new Set(r);for(const g of m){const R=U.unwrapped(g.params?.parts);if(g.eventType==="appearance"&&Array.isArray(R))for(const C of R)C.sourceId&&w.add(C.sourceId)}for(const g of w)r.add(g);const y=g=>a.find(R=>R.members.includes(g)),b=g=>{const R=y(g);return R?b(R.id):g},S=[...new Set([...w].map(b))],T=S.length===1?S[0]:S.length>1?u("phenomenon"):"phenomenon";S.length>1&&a.push({id:T,members:S});for(const g of c)if(g.who===void 0||g.who==="observer")g.who=d;else if(g.who==="phenomenon"){g.who=T;const R=g.params;if(g.eventType!=="blink"||!R||!Array.isArray(R.parts))continue;const C=R.parts,{parts:ue,...On}=R;g.params=On,g.who=U.groupFor(C,a,u)??T}e.events=c}return(a.length>0||p.length>0)&&(e.timeline={...n,groups:a}),e}static groupFor(t,e,n){if(t.length===1)return t[0];const r=c=>{const d=e.find(m=>m.id===c);return d?d.members.flatMap(r):[c]},i=e.find(c=>{const d=r(c.id);return d.length===t.length&&t.every(m=>d.includes(m))});if(i)return i.id;const a=new Set(t.map(c=>e.find(d=>d.members.includes(c))));if(a.size!==1)return;const[u]=a,p=n();if(u){const c=u.members.findIndex(d=>t.includes(d));u.members=u.members.filter(d=>!t.includes(d)),u.members.splice(c,0,p)}return e.push({id:p,members:[...t]}),p}static unwrapped(t){return U.isWrapped(t)?t.value:t}static fromVersion1(t){const e={...t,version:2};for(const n of["time","endTime"])t[n]!==void 0&&(e[n]=U.edtf(t[n]));if(Array.isArray(t.place)){const n=U.place(t.place);n===void 0?delete e.place:e.place=n}return e}static edtf(t){if(U.isWrapped(t)){const c=U.edtf(t.value);return c===void 0?void 0:{...t,value:c}}if(typeof t=="string")return t;const e=t,n=Object.values(e).find(c=>U.isWrapped(c)),r=Object.fromEntries(Object.entries(e).map(([c,d])=>[c,U.isWrapped(d)?d.value:d])),i=Vr(r);if(i==="")return;if(!n)return i;const{basis:a,rationale:u,how:p}=n;return{value:i,...a===void 0?{}:{basis:a},...u===void 0?{}:{rationale:u},...p===void 0?{}:{how:p}}}static place(t){if(t.length===0)return;const e=t.map(c=>U.isWrapped(c)?c.value:c),n=e.find(c=>c.name)?.name,r={...n?{name:n}:{},locations:e.map(({lat:c,lng:d})=>({lat:c,lng:d}))},i=t.find(c=>U.isWrapped(c));if(!i)return r;const{basis:a,rationale:u,how:p}=i;return{value:r,...a===void 0?{}:{basis:a},...u===void 0?{}:{rationale:u},...p===void 0?{}:{how:p}}}static isWrapped(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&"value"in t}}class ft extends Error{constructor(t,e,n){super(`${t}: ${e}${n===void 0?"":` (HTTP ${n})`}`),this.kind=t,this.url=e,this.status=n,this.name="SightingFetchError"}}class ne{static async recording(t){const e=await ne.json(t);for(const n of Tn.NAMES){const r=e?.frozen?.[n];if(!(!r?.src||r.live))try{const i=U.toCurrent(await ne.json(new URL(r.src,new URL(t,location.href)).href));for(const a of Tn.KEYS[n])i[a]!==void 0&&(e[a]=i[a])}catch{}}return e}static async json(t){const e=new URL(t,location.href);if(location.protocol==="https:"&&e.protocol==="http:")throw new ft("mixed-content",t);let n;try{n=await fetch(t)}catch{throw await this.diagnose(t,e)}if(!n.ok)throw new ft("status",t,n.status);try{return await n.json()}catch{throw new ft("malformed",t)}}static async diagnose(t,e){if(e.origin===location.origin)return new ft("unreachable",t);try{return await fetch(t,{mode:"no-cors"}),new ft("cors",t)}catch{return new ft("unreachable",t)}}}function Or(s,t){for(const e of s){const n=e.toLowerCase().split("-")[0];if(t.includes(n))return n}return"en"}class zr{static preferencesFor(t){const e=navigator.languages??[],n=this.declaredFor(t);return n?[n,...e]:e}static declaredFor(t){for(let e=t;e;){const n=e.closest("[lang]")?.getAttribute("lang")?.trim();if(n)return n;const r=e.getRootNode();e=r instanceof ShadowRoot?r.host:void 0}}}const Br=["en","fr","es","it"],Yr={en:()=>_t(()=>Promise.resolve().then(()=>qr),void 0,import.meta.url).then(s=>s.interviewMessages_en),fr:()=>_t(()=>import("./InterviewMessages_fr-mhX8Zuyu.js"),[],import.meta.url).then(s=>s.interviewMessages_fr),es:()=>_t(()=>import("./InterviewMessages_es-B0Ut-uel.js"),[],import.meta.url).then(s=>s.interviewMessages_es),it:()=>_t(()=>import("./InterviewMessages_it-DaxIoAIG.js"),[],import.meta.url).then(s=>s.interviewMessages_it)};function Hr(s){return Yr[s]()}const xe={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",importFileHint:"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",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"}},qr=Object.freeze(Object.defineProperty({__proto__:null,interviewMessages_en:xe},Symbol.toStringTag,{value:"Module"})),Xr="interviewseek";class Wr extends Error{constructor(t,e,n){super(typeof e=="number"&&Number.isInteger(e)&&e>n?`This ${t} file is in version ${e} of its format; this UFO@home reads up to version ${n}. Read it with a newer UFO@home.`:`This ${t} file states ${JSON.stringify(e)} as its format version, which is not a version.`),this.format=t,this.found=e,this.supported=n,this.name="FormatVersionError"}said(t){return t.replace("{found}",typeof this.found=="number"?String(this.found):JSON.stringify(this.found)).replace("{supported}",String(this.supported))}}class yt{static CURRENT={sighting:3,case:1,interview:1};static SCHEMA_BASE="https://ufoathome.org/schema";static schemaUrl(t,e=yt.CURRENT[t]){return`${yt.SCHEMA_BASE}/${e}/${t}.schema.json`}static of(t){if(typeof t!="object"||t===null)return 1;const e=t.version;return e===void 0?1:typeof e=="object"&&e!==null&&"value"in e?e.value:e}static check(t,e){const n=yt.of(t),r=yt.CURRENT[e];if(typeof n!="number"||!Number.isInteger(n)||n<1||n>r)throw new Wr(e,n,r);return t}}class ${static read(t){return yt.check(t,"interview")}static isProofread(t){const e=Object.keys(t.speakers);return e.length>0&&e.every(n=>{const r=t.proofreading?.[n]?.status;return r==="approved"||r==="covered"})}static said(t){return t.parts?t.parts.map(e=>"redacted"in e?"…":$.plain(e.text)).join(" "):t.redacted?void 0:$.plain(t.text??"")}static ENTITIES={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "};static plain(t){return/[<&]/.test(t)?t.replace(/<br\s*\/?>/gi,`
|
|
2
2
|
`).replace(/<\/?[a-z][^>]*>/gi,"").replace(/&#x([0-9a-f]+);/gi,(e,n)=>String.fromCodePoint(parseInt(n,16))).replace(/&#(\d+);/g,(e,n)=>String.fromCodePoint(Number(n))).replace(/&(\w+);/g,(e,n)=>$.ENTITIES[n.toLowerCase()]??e):t}static sightingsOf(t){return[t.interviewOf].flat().filter(e=>typeof e=="string")}static passagesAbout(t,e){const n=$.sightingsOf(t),r=[];return t.segments.forEach((i,a)=>{for(const u of i.refs??[]){if(u.sighting===void 0?!n.includes(e):u.sighting!==e)continue;const p=$.said(i);r.push({index:a,speaker:i.speaker,at:u.at,...p!==void 0?{text:p}:{},...u.range?{range:u.range}:{}})}}),r.sort((i,a)=>i.at-a.at||i.index-a.index)}static clock(t,e=!1){const n=Math.round(t*10),r=Math.floor(n/10),i=p=>String(p).padStart(2,"0"),a=Math.floor(r/3600),u=`${a>0||e?i(Math.floor(r/60)%60):Math.floor(r/60)}:${i(r%60)}`;return`${a>0?`${a}:`:""}${u}${e||n%10!==0?`.${n%10}`:""}`}static speakerName(t,e){const n=t.speakers[e];if(!n)return e;const r=typeof n.title=="string"?n.title:n.title?Object.values(n.title)[0]:void 0;return r||n.by&&$.agentName(n.by)||n.role}static agentName(t){if("people"in t){const[e,...n]=t.people.replace(/([a-z])([A-Z])/g,"$1 $2").split(" ");return[...n,e].join(" ")}return"org"in t?t.org:t.title??""}static stamp(t){const e=Math.round(t*1e3),n=(r,i=2)=>String(r).padStart(i,"0");return`${n(Math.floor(e/36e5))}:${n(Math.floor(e/6e4)%60)}:${n(Math.floor(e/1e3)%60)}.${n(e%1e3,3)}`}static toVtt(t){const e=i=>i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),n=t.segments.filter(i=>i.start!==void 0);return`WEBVTT
|
|
3
3
|
|
|
4
4
|
${n.map((i,a)=>{const u=n[a+1],p=i.end??u?.start??i.start+5,c=u&&u.start<p?Math.max(i.start,u.start):p;return`${$.stamp(i.start)} --> ${$.stamp(c)}
|
|
@@ -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 Fe extends HTMLElement{messages=xe;said=new X(["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(t,e,n){t==="src"&&n!==e&&this.isConnected&&this.load()}connectedCallback(){Fe.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(t){this.loadToken++,this.json=t,this.draw()}set documentUrl(t){this.base=t}static styleRoot(t){const e=t instanceof ShadowRoot?t:document.head;if(e.querySelector("style[data-rr0-interview]"))return;const n=document.createElement("style");n.dataset.rr0Interview="",n.textContent=Jr,e.append(n)}async load(){const t=this.getAttribute("src"),e=++this.loadToken;if(this.loading=t??void 0,!t)return;const n=new URL(t,location.href).href;let r;try{r=$.read(await ne.json(n))}catch{r=void 0}e===this.loadToken&&(this.base=n,this.json=r,this.draw())}async loadLocale(){const t=++this.localeToken,e=zr.preferencesFor(this),n=Or(e,Br),r=n==="en"?xe:await Hr(n);t===this.localeToken&&(this.said=new X(e),this.messages=r,this.draw())}speakerName(t,e){const n=$.speakerName(t,e),r=t.speakers?.[e]?.role;return n===r&&r in this.messages.roles?this.messages.roles[r]:n}seek(t,e){const n=this.json,r=e?$.said(e):void 0,i={sighting:t.sighting??$.sightingsOf(n)[0],at:t.at,...r?{quote:r}:{}};this.dispatchEvent(new CustomEvent(Xr,{bubbles:!0,composed:!0,detail:i}));const a=this.getAttribute("player");if(!a)return;const p=this.getRootNode().getElementById?.(a);typeof p?.seekTo=="function"&&(p.scrollIntoView?.({block:"center",behavior:"smooth"}),p.seekTo(i.at,i.sighting))}gap(t,e){const n=document.createElement(e),r=document.createElement("span");r.className="bar";const i=`${this.messages.redacted} : ${this.said.read(t)??""}`;return r.dataset.tip=i,r.tabIndex=0,r.setAttribute("role","img"),r.setAttribute("aria-label",i),n.append(r),n}saidNodes(t){if(!/[<&]/.test(t))return[document.createTextNode(t)];const e=document.createElement("template");e.innerHTML=t;for(const n of e.content.querySelectorAll("*")){if(["SCRIPT","STYLE","IFRAME","OBJECT","EMBED"].includes(n.tagName)){n.remove();continue}for(const r of[...n.attributes])if(/^on/i.test(r.name)||/^\s*javascript:/i.test(r.value))n.removeAttribute(r.name);else if(["href","src"].includes(r.name))try{r.value=new URL(r.value,this.base??location.href).href}catch{}}return[...e.content.childNodes]}draw(){const t=this.messages,e=this.json;this.blocks.clear();const n=Array.isArray(e?.segments)?e.segments:[];if(!e||n.length===0){this.status.hidden=!0;const m=document.createElement("p");m.textContent=t.exchangesEmpty,this.turns.replaceChildren(m);return}const r=e.speakers??{},i=Object.keys(r);if(e.proofreading){const m=i.filter(w=>!["approved","covered"].includes(e.proofreading?.[w]?.status??""));this.status.textContent=m.length===0?t.proofreadAll:t.proofreadPending.replace("{names}",m.map(w=>this.speakerName(e,w)).join(", ")),this.status.hidden=!1}else this.status.hidden=!0;const a=[];let u,p=!1,c,d;n.forEach((m,w)=>{const y=m.redacted?JSON.stringify(m.redacted.reason):void 0;if(y!==void 0&&c?.reason===y){this.blocks.set(w,c.block),m.speaker!==d&&(d=void 0);return}const b=document.createElement("div");b.className="turn",b.dataset.segment=String(w);const S=document.createElement("div");S.className="who";const T=document.createElement("span");if(T.textContent=m.redacted?"":this.speakerName(e,m.speaker),m.start!==void 0&&(b.dataset.time=$.clock(m.start,!0)),d!==m.speaker&&(u=document.createElement("div"),u.className="intervention",u.style.setProperty("--speaker-hue",String((Math.max(0,i.indexOf(m.speaker))*67+210)%360)),a.push(u),p=!1),m.redacted||(p&&b.classList.add("goes-on"),p=!0),u.append(b),d=m.speaker,S.append(T),m.redacted){b.classList.add("is-redacted");const g=this.gap(m.redacted.reason,"p");g.className="redacted",c={block:b,reason:y},b.append(S,g)}else{const g=document.createElement("p");if(g.className="said",m.parts){let R="";for(const C of m.parts){const ue="redacted"in C?"▮":$.plain(C.text);/[\p{L}\p{N}.,;:!?)»”…▮]$/u.test(R)&&/^[\p{L}\p{N}(«“▮]/u.test(ue)&&g.append(" "),"redacted"in C?g.append(this.gap(C.redacted.reason,"span")):g.append(...this.saidNodes(C.text)),R=ue}}else g.append(...this.saidNodes(m.text??""));c=void 0,b.append(S,g)}if(m.refs?.length){const g=document.createElement("div");g.className="refs";for(const R of m.refs){const C=document.createElement("button");C.type="button",C.className="ref",C.innerHTML=x.PLAY,C.append($.clock(R.at,!0)),C.addEventListener("click",()=>this.seek(R,m)),g.append(C)}b.append(g)}this.blocks.set(w,b)}),this.turns.replaceChildren(...a)}revealSegment(t){const e=this.blocks.get(t);e&&(e.scrollIntoView?.({block:"center"}),e.classList.add("flash"),window.setTimeout(()=>e.classList.remove("flash"),1600))}}function Dr(){customElements.get(An)||customElements.define(An,Fe)}Dr();
|