@rr0/ufoathome 0.153.0 → 0.154.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-embed-interview/rr0-interview.mjs +6 -6
- package/dist-embed-scene/rr0-scene.mjs +368 -368
- package/dist-embed-scene/sightingSchema-Ci5NDVHA.js +1 -0
- package/dist-embed-sighting/CoverageAssessor-EpQ3ZPrF.js +1 -0
- package/dist-embed-sighting/SightingMessages_es-dFoOi4Xe.js +1 -0
- package/dist-embed-sighting/SightingMessages_fr-DK90WaSj.js +1 -0
- package/dist-embed-sighting/SightingMessages_it-BC3oCPqe.js +1 -0
- package/dist-embed-sighting/rr0-sighting.mjs +357 -357
- package/dist-embed-sighting/sightingSchema-Ci5NDVHA.js +1 -0
- package/dist-embed-sighting-editor/CoverageAssessor-DZRYnxBB.js +1 -0
- package/dist-embed-sighting-editor/{InterviewEditorElement-BITkrqo0.js → InterviewEditorElement-Iy0c3CtZ.js} +2 -2
- package/dist-embed-sighting-editor/{SightingEditorMessages_es-DIDBzOjk.js → SightingEditorMessages_es-C2IkMFXq.js} +1 -1
- package/dist-embed-sighting-editor/{SightingEditorMessages_fr-C6USsLcX.js → SightingEditorMessages_fr-BWHIYY4n.js} +1 -1
- package/dist-embed-sighting-editor/{SightingEditorMessages_it-BzURo_jT.js → SightingEditorMessages_it-C39GmHM9.js} +1 -1
- package/dist-embed-sighting-editor/{SightingFileEditor-DVj9HYS9.js → SightingFileEditor-BB_CTitC.js} +1 -1
- package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +419 -430
- package/dist-embed-sighting-editor/sightingSchema-Ci5NDVHA.js +1 -0
- package/package.json +3 -3
- package/dist-embed-scene/sightingSchema-Bc1JhWrZ.js +0 -1
- package/dist-embed-sighting/CoverageAssessor-Dd6oOWlq.js +0 -1
- package/dist-embed-sighting/SightingMessages_es-CM9UNBab.js +0 -1
- package/dist-embed-sighting/SightingMessages_fr-G2VuAfwH.js +0 -1
- package/dist-embed-sighting/SightingMessages_it-B66vxPfo.js +0 -1
- package/dist-embed-sighting/sightingSchema-Bc1JhWrZ.js +0 -1
- package/dist-embed-sighting-editor/CoverageAssessor-B8gBscye.js +0 -1
- package/dist-embed-sighting-editor/sightingSchema-Bc1JhWrZ.js +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
class b{constructor(e){this.preferences=e}read(e){if(e===void 0||typeof e=="string")return e===""?void 0:e;for(const r of this.preferences){const s=e[r]??e[b.base(r)];if(s)return s}const t=new Set(this.preferences.map(r=>b.base(r)));for(const[r,s]of Object.entries(e))if(s&&t.has(b.base(r)))return s;return Object.values(e).find(r=>r)??void 0}write(e,t,r){const s=t?.trim()?t.trim():void 0;if(e===void 0||typeof e=="string")return s;const i={...e},c=Object.keys(i).find(n=>n===r)??Object.keys(i).find(n=>b.base(n)===b.base(r))??r;return s===void 0?delete i[c]:i[c]=s,Object.keys(i).length===0?void 0:i}static base(e){return e.toLowerCase().split("-")[0]}}class O{static NAMES=["weather","place","lightPollution","decor"];static KEYS={weather:["weatherTrack","weatherSource"],place:["place"],lightPollution:["lightPollution"],decor:["decor"]};static annexName(e,t){return`${e}.${t.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`)}.json`}static fromFile(e,t){return e?.[t]!==void 0&&e[t].live!==!0}}class k extends Error{constructor(e,t,r){super(`${e}: ${t}${r===void 0?"":` (HTTP ${r})`}`),this.kind=e,this.url=t,this.status=r,this.name="SightingFetchError"}}class R{static async recording(e){const t=await R.json(e);for(const r of O.NAMES){const s=t?.frozen?.[r];if(!(!s?.src||s.live))try{const i=await R.json(new URL(s.src,new URL(e,location.href)).href);for(const c of O.KEYS[r])i[c]!==void 0&&(t[c]=i[c])}catch{}}return t}static async json(e){const t=new URL(e,location.href);if(location.protocol==="https:"&&t.protocol==="http:")throw new k("mixed-content",e);let r;try{r=await fetch(e)}catch{throw await this.diagnose(e,t)}if(!r.ok)throw new k("status",e,r.status);try{return await r.json()}catch{throw new k("malformed",e)}}static async diagnose(e,t){if(t.origin===location.origin)return new k("unreachable",e);try{return await fetch(e,{mode:"no-cors"}),new k("cors",e)}catch{return new k("unreachable",e)}}}function z(d,e){for(const t of d){const r=t.toLowerCase().split("-")[0];if(e.includes(r))return r}return"en"}class x{static preferencesFor(e){const t=navigator.languages??[],r=this.declaredFor(e);return r?[r,...t]:t}static declaredFor(e){for(let t=e;t;){const r=t.closest("[lang]")?.getAttribute("lang")?.trim();if(r)return r;const s=t.getRootNode();t=s instanceof ShadowRoot?s.host:void 0}}}const U="modulepreload",j=function(d,e){return new URL(d,e).href},C={},L=function(e,t,r){let s=Promise.resolve();if(t&&t.length>0){let c=function(p){return Promise.all(p.map(o=>Promise.resolve(o).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};const n=document.getElementsByTagName("link"),h=document.querySelector("meta[property=csp-nonce]"),w=h?.nonce||h?.getAttribute("nonce");s=c(t.map(p=>{if(p=j(p,r),p in C)return;C[p]=!0;const o=p.endsWith(".css"),f=o?'[rel="stylesheet"]':"";if(!!r)for(let g=n.length-1;g>=0;g--){const E=n[g];if(E.href===p&&(!o||E.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${p}"]${f}`))return;const l=document.createElement("link");if(l.rel=o?"stylesheet":U,o||(l.as="script"),l.crossOrigin="",l.href=p,w&&l.setAttribute("nonce",w),document.head.appendChild(l),o)return new Promise((g,E)=>{l.addEventListener("load",g),l.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${p}`)))})}))}function i(c){const n=new Event("vite:preloadError",{cancelable:!0});if(n.payload=c,window.dispatchEvent(n),!n.defaultPrevented)throw c}return s.then(c=>{for(const n of c||[])n.status==="rejected"&&i(n.reason);return e().catch(i)})},H=["en","fr","es","it"],V={en:()=>L(()=>Promise.resolve().then(()=>P),void 0,import.meta.url).then(d=>d.interviewMessages_en),fr:()=>L(()=>import("./InterviewMessages_fr-Dhtz904e.js"),[],import.meta.url).then(d=>d.interviewMessages_fr),es:()=>L(()=>import("./InterviewMessages_es-BJHVnSkP.js"),[],import.meta.url).then(d=>d.interviewMessages_es),it:()=>L(()=>import("./InterviewMessages_it-D0Dff5zn.js"),[],import.meta.url).then(d=>d.interviewMessages_it)};function F(d){return V[d]()}const y={title:"Title",time:"When",by:"Interviewer",medium:"Medium",witness:"Witness",witnessNone:"—",summary:"Description",transcript:"Transcript",transcriptHint:"Address of the anonymised transcript file (optional)",summaryTab:"Summary",fileTab:"File",importFile:"Load a file (JSON, text, WebVTT, SRT)",inputFileFromFile:"from your disk",inputFileFromUrl:"from an address",inputFileModeHint:"Click to give it the other way: a file of yours, or an address",inputFileLoad:"Load",saveButton:"Save",loading:"Loading the transcript…",invalid:"This text is not valid JSON yet: the interview keeps the last transcript it understood.",notATranscript:"That file is not an interview transcript (it has no segments).",loadFailed:"That transcript could not be read.",editorLabel:"Interview transcript as JSON",byHint:"RR0 people ids, separated by commas",exchangesTab:"Exchanges",exchangesEmpty:"Nothing was said yet.",redacted:"Passage removed",proofreadAll:"Proofread by everyone.",proofreadPending:"Not proofread yet by: {names}",play:"Play",pause:"Pause",recordings:"Recordings ({n})",recordingsTitle:"Recordings",recordingKind:"Type",recordingAudio:"Audio",recordingVideo:"Video",recordingFile:"File",recordingOffset:"Offset (s)",recordingRemove:"Remove",recordingAdd:"Add a recording",close:"Close",noRecording:"No recording: add the audio or video file of the interview to listen to it.",redactSelection:"Take out the selection",redactedWords:"passage taken out · {n} word(s)",redactAll:"Take all out",restoreAll:"Restore all",editTurn:"Edit",deleteTurn:"Delete this turn",saveTurn:"Save",cancelTurn:"Cancel",turnEditHint:"⟦ … ⟧ marks a passage taken out",selectionOnePassage:"The selection has to stay within one passage not taken out.",selectionNone:"Select words of a passage to take them out.",reviewedBy:"{name} has proofread",linkMoment:"Link to a moment…",momentLabel:"Moment {k} · {text}",unlinkMoment:"Remove this link",noMoments:"The observation has no named moment yet.",redactReason:"taken out at proofreading",roles:{interviewer:"Interviewer",interviewee:"Interviewee",witness:"Witness"}},P=Object.freeze(Object.defineProperty({__proto__:null,interviewMessages_en:y},Symbol.toStringTag,{value:"Module"})),B="interviewseek";class D extends Error{constructor(e,t,r){super(typeof t=="number"&&Number.isInteger(t)&&t>r?`This ${e} file is in version ${t} of its format; this UFO@home reads up to version ${r}. Read it with a newer UFO@home.`:`This ${e} file states ${JSON.stringify(t)} as its format version, which is not a version.`),this.format=e,this.found=t,this.supported=r,this.name="FormatVersionError"}said(e){return e.replace("{found}",typeof this.found=="number"?String(this.found):JSON.stringify(this.found)).replace("{supported}",String(this.supported))}}class T{static CURRENT={sighting:1,case:1,interview:1};static SCHEMA_BASE="https://ufoathome.org/schema";static schemaUrl(e,t=T.CURRENT[e]){return`${T.SCHEMA_BASE}/${t}/${e}.schema.json`}static of(e){if(typeof e!="object"||e===null)return 1;const t=e.version;return t===void 0?1:typeof t=="object"&&t!==null&&"value"in t?t.value:t}static check(e,t){const r=T.of(e),s=T.CURRENT[t];if(typeof r!="number"||!Number.isInteger(r)||r<1||r>s)throw new D(t,r,s);return e}}class u{static read(e){return T.check(e,"interview")}static isProofread(e){const t=Object.keys(e.speakers);return t.length>0&&t.every(r=>{const s=e.proofreading?.[r]?.status;return s==="approved"||s==="covered"})}static said(e){return e.parts?e.parts.map(t=>"redacted"in t?"…":u.plain(t.text)).join(" "):e.redacted?void 0:u.plain(e.text??"")}static ENTITIES={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "};static plain(e){return/[<&]/.test(e)?e.replace(/<br\s*\/?>/gi,`
|
|
2
|
-
`).replace(/<\/?[a-z][^>]*>/gi,"").replace(/&#x([0-9a-f]+);/gi,(
|
|
1
|
+
class V 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 V(`${this.name} value must be a number, but was ${t}`);if(t<this.min||t>this.max)throw new V(`${this.name} value must be >= ${this.min} and <= ${this.max}, but was ${t}`);return super.validate(t)}}class E{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 On extends Me{}class Rn extends On{millisecond=new E("millisecond",0,999,void 0);second=new E("second",0,59,this.millisecond);minute=new E("minute",0,59,this.second);hour=new E("hour",0,23,this.minute);day=new E("day",1,31,this.hour);month=new E("month",1,12,this.day);year=new E("year",0,9999,this.month)}const h=new Rn;class Fn extends kn{constructor(t=1,e=12){super("month",t,e)}}class ft extends E{static Month28=new ft(28);static Month29=new ft(29);static ThirtyDays=new ft(30);static ThirtyOneDays=new ft(31);constructor(t,e=new Fn(1,t)){super("month",1,t,h.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 V("Unsupported month",t,e)}}}class H{static instance=new H;render(t){return t.value.toString()}}class C{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=H.instance){return t.render(this)}toSpec(){return{value:this.value}}toJSON(){return this.toSpec()}}class d{static#t=new Map;static register(t,e){d.#t.set(t,e)}static get(t){const e=d.#t.get(t);if(!e)throw new V(`No default parser registered for ${t.name}: import "@rr0/time/defaults" or pass a parser to fromString()`);return e()}}class Mt extends C{constructor(t=new Date().getFullYear(),e=h.year){super(t,e)}static fromString(t,e=d.get(Mt)){return new Mt(e.parse(t))}}class W extends H{static default=new W("0",2);constructor(t,e){super(),this.char=t,this.size=e}render(t){return super.render(t).padStart(this.size,this.char)}}class bt extends C{constructor(t=new Date().getMonth()+1,e=h.month){super(t,e)}static fromString(t,e=d.get(bt)){return new bt(e.parse(t))}toString(t=W.default){return super.toString(t)}}class Et extends C{constructor(t=new Date().getDate(),e=h.day){super(t,e)}static fromString(t,e=d.get(Et)){const n=e.parse(t);return new Et(n)}toString(t=W.default){return super.toString(t)}}class Nt extends C{constructor(t=new Date().getHours(),e=h.hour){super(t,e)}static fromString(t,e=d.get(Nt)){return new Nt(e.parse(t))}toString(t=W.default){return super.toString(t)}}class Gt extends C{constructor(t=new Date().getMinutes(),e=h.minute){super(t,e)}static fromString(t,e=d.get(Gt)){return new Gt(e.parse(t))}toString(t=W.default){return super.toString(t)}}class Tt extends C{constructor(t=new Date().getSeconds(),e=h.second){super(t,e)}static fromString(t,e=d.get(Tt)){return new Tt(e.parse(t),h.second)}toString(t=W.default){return super.toString(t)}}class ut extends C{static renderer=new W("0",3);constructor(t,e=h.millisecond){super(t,e)}static parseFraction(t){return parseInt(t.padEnd(3,"0").substring(0,3),10)}toString(t=ut.renderer){return super.toString(t)}}class zn{render(t){return t.toString()}}class Bn extends zn{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 at{value;name="timeshift";renderer;constructor(t=0){this.value=t}static fromString(t,e=d.get(at),n=void 0){const r=e.parse(t,n);return new at(r)}toString(t=new Bn){return t.render(this)}toSpec(){return{value:this.value}}toJSON(){return this.toSpec()}}class I{static timeshift(t,e){return t+(I.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=I.rule(e);if(!a)return!1;const u=I.rank(n,r,i);return u>=I.rank(a.start.month,a.start.day,2)&&u<I.rank(a.end.month,a.end.day,2)}static rule(t){if(t<1967)return;const e={month:10,day:I.sunday(t,10,-1)};return t>=2007?{start:{month:3,day:I.sunday(t,3,2)},end:{month:11,day:I.sunday(t,11,1)}}:t>=1987?{start:{month:4,day:I.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:I.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,I.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 Yn={name:"PST",timeshift:"-08",title:"Pacific Standard Time (US)"},Hn={name:"PDT",timeshift:"-07",title:"Pacific Daylight Time (US)"},qn={name:"MDT",timeshift:"-06",title:"Mountain Standard Time (US)"},Xn={name:"MST",timeshift:"-07",title:"Mountain Daylight Time (US)"},Wn={name:"PT",timeshift:s=>I.timeshift(-480,s),title:"Pacific Time (US)"},Jn={name:"MT",timeshift:s=>I.timeshift(-420,s),title:"Mountain Time (US)"},Dn={name:"CT",timeshift:s=>I.timeshift(-360,s),title:"Central Time (US)"},Zn={name:"ET",timeshift:s=>I.timeshift(-300,s),title:"Eastern Time (US)"},Kn={name:"CWT",timeshift:"-05",title:"Central War Time (US)"},Qn={name:"CDT",timeshift:"-05",title:"Central Daylight Time"},Pn={name:"EST",timeshift:"-05",title:"Eastern Standard Time (US)"},Ln={name:"EDT",timeshift:"-04",title:"Eastern Time (US)"},_n={name:"AST",timeshift:"-04",title:"Atlantic Standard Time (US)"},tr={name:"ADT",timeshift:"-03",title:"Atlantic Daylight Time (US)"},er={name:"UTC",timeshift:"Z",title:"Coordinated Universal Time"},nr={name:"Z",timeshift:"Z",title:"UTC"},rr={name:"GMT",timeshift:"Z",title:"Greenwich Mean Time"},sr={name:"BST",timeshift:"+01",title:"British Summer Time"},or={name:"CEST",timeshift:"+02",title:"Central European Summer Time"},ir={name:"CET",timeshift:"+01",title:"Central European Time"},ar={name:"MSK",timeshift:"+03",title:"Moscow Time (RU)"},ur={name:"IST",timeshift:"+05:30",title:"Indian Standard Time"},cr={name:"BJT",timeshift:"+08",title:"Beijing Time"},mr={name:"CST",timeshift:"-06",title:"Central Standard Time"},dr={name:"JST",timeshift:"+09",title:"Japan Standard Time"},pr={name:"AEST",timeshift:"+10",title:"Australian Eastern Standard Time"},lr={name:"NZST",timeshift:"+12",title:"New Zealand Standard Time"},hr={name:"LST",timeshift:"?",title:"Local Sideral Time"},Fe=[tr,pr,_n,cr,sr,mr,Qn,ir,or,Dn,Kn,Ln,Pn,Zn,rr,ur,dr,hr,qn,ar,Xn,Jn,lr,Hn,Yn,Wn,er,nr];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 ct extends V{constructor(t="method is abstract"){super(t)}}class be{units;constructor(t){this.units=t}newYear(t){throw new ct}newMonth(t){throw new ct}newDay(t){throw new ct}newHour(t){throw new ct}newMinute(t){throw new ct}newSecond(t){throw new ct}}class fr extends Me{millisecond=new E("milliseconds",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,void 0);second=new E("seconds",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.millisecond);minute=new E("minutes",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.second);hour=new E("hours",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.minutes);day=new E("days",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.hour);month=new E("months",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.day);year=new E("years",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const Pt=new fr;class oe{static instance=new oe;render(t){const e=Y.toSpec(t);let n="P";const r=e.years;r&&(n+=r.toString()+"Y");const i=e.months;i&&(n+=i.toString(H.instance)+"MM");const a=e.days;a&&(n+=a.toString(H.instance)+"D");const u=e.hours;u&&(n+=u.toString(H.instance)+"H");const p=e.minutes;p&&(n+=p.toString(H.instance)+"M");const c=e.seconds;return c&&(n+=c.toString(H.instance)+"S"),n}}class Y extends C{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*h.year.duration:0)+(t.months?t.months*h.month.duration:0)+(t.days?t.days*h.day.duration:0)+(t.hours?t.hours*h.hour.duration:0)+(t.minutes?t.minutes*h.minute.duration:0)+(t.seconds?t.seconds*h.second.duration:0)},new E("millisecond",0,Number.MAX_SAFE_INTEGER,void 0))}static toSpec(t,e=wr){let n=typeof t=="number"?t:t.value;const r=n>0?1:-1;n=Math.abs(n);const i={},a=n/h.year.duration,u=Math.floor(a);u>0&&(i.years=e.newYear(r*u),n-=u*h.year.duration);const p=n/h.month.duration,c=Math.floor(p);c>0&&(i.months=e.newMonth(r*c),n-=c*h.month.duration);const f=n/h.day.duration,m=Math.floor(f);m>0&&(i.days=e.newDay(r*m),n-=m*h.day.duration);const x=n/h.hour.duration,g=Math.floor(x);g>0&&(i.hours=e.newHour(r*g),n-=g*h.hour.duration);const M=n/h.minute.duration,w=Math.floor(M);w>0&&(i.minutes=e.newMinute(r*w),n-=w*h.minute.duration);const $=n/h.second.duration,T=Math.floor(r*$);return T>0&&(i.seconds=e.newSecond(T)),i}static fromString(t,e=d.get(Y)){return new Y(e.parse(t))}static between(t,e){const n=e.getTime(),r=t.getTime();return new Y(n-r)}toSpec(){return Y.toSpec(this)}toString(t=oe.instance){return t.render(this)}}class $n extends be{constructor(t){super(t)}newYear(t){return new Mt(t,this.units.year)}newMonth(t){return new bt(t,this.units.month)}newDay(t){return new Et(t,this.units.day)}newHour(t){return new Nt(t,this.units.hour)}newMinute(t){return new Gt(t,this.units.minute)}newSecond(t){return new Tt(t,this.units.second)}newMillisecond(t){return new ut(t,this.units.millisecond)}newTimeshift(t){return new at(typeof t=="number"?t:t.value)}}const gr=new $n(h),wr=new $n(Pt);class F{#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:F.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 C?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 C?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 C?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 C?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 C?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 C?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 C)?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 at)?this.factory.newTimeshift(t):t}get factory(){return gr}static fromString(t,e=d.get(F)){const{year:n,month:r,day:i,hour:a,minute:u,second:p,millisecond:c,timeshift:f}=e.parse(t);return new F({year:n,month:r,day:i,hour:a,minute:u,second:p,millisecond:c,timeshift:f})}static timeshiftOf(t){return-t.getTimezoneOffset()||0}static fromDate(t){return new F({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:F.timeshiftOf(t)})}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),n=t.substring(0,e)+t.substring(e+4);return F.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 Y(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 F(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 Ee{static instance=new Ee;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=F.fromString(t)),t&&!(t instanceof F)&&!(t instanceof Y))throw new V("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=F.fromString(t)),t&&!(t instanceof F)&&!(t instanceof Y))throw new V("Interval end is not a level 0 date or duration: "+t);this._end=t}static fromString(t,e=d.get(Ft)){const{start:n,end:r}=e.parse(t);return new Ft(n,r)}toString(t=Ee.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 H{static instance=new Lt(W.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 X extends C{#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 E("year",-9999,9999,this.month);yearExtended=new E("year",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const te=new In;class et extends X{constructor(t,e=te.year){super(t,e)}static fromString(t,e=te.year,n=d.get(et)){const r=n.parse(t),i=r.value.start;if(t.startsWith("Y")&&(e=te.yearExtended),i!==void 0){const a=new et(Object.assign({...r},{value:Math.max(i,e.min)})),u=new et(Object.assign({...r},{value:Math.min(r.value.end,e.max)}));return{start:a,end:u}}else return new et(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 nt extends X{constructor(t,e=new E(h.month.name,1,24,h.day,new Cn)){super(t,e)}static fromString(t,e=d.get(nt)){const n=e.parse(t),r=n.value.start;if(r!==void 0){let i=h.month;const a=new nt(Object.assign({...n},{value:Math.max(r,i.min)})),u=new nt(Object.assign({...n},{value:Math.min(n.value.end,i.max)}));return{start:a,end:u}}else return new nt(n)}toString(t){return super.toString(t).padStart(2,"0")}}class rt extends X{constructor(t,e=h.day){super(t,e)}static fromString(t,e=d.get(rt)){const n=e.parse(t),r=n.value.start;if(r!==void 0){let i=h.day;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 X{constructor(t,e=h.hour){super(t,e)}static fromString(t,e=d.get(st)){const n=e.parse(t),r=n.value.start;if(r!==void 0){let i=h.hour;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)}}class ot extends X{constructor(t,e=h.minute){super(t,e)}static fromString(t,e=d.get(ot)){const n=e.parse(t),r=n.value.start;if(r!==void 0){const i=h.minute,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)}toString(t=Lt.instance){return super.toString(t)}}class it extends X{constructor(t,e=h.second){super(t,e)}static fromString(t,e=d.get(it)){const n=e.parse(t),r=n.value.start;if(r!==void 0){const i=h.second,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)}}class pt extends at{static fromString(t,e=d.get(pt),n=void 0){return new pt(e.parse(t,n))}}class jn extends be{constructor(t){super(t)}newYear(t){return new et(t,this.units.year)}newMonth(t){return new nt(t,this.units.month)}newDay(t){return new rt(t,this.units.day)}newHour(t){return new st(t,this.units.hour)}newMinute(t){return new ot(t,this.units.minute)}newSecond(t){return new it(t,this.units.second)}newMillisecond(t){return new ut(t,this.units.millisecond)}newTimeshift(t){return new pt(typeof t=="number"?t:t.value)}}const Sr=new jn(te),yr=new jn(Pt);class j extends F{constructor(t){super(t)}get factory(){return Sr}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 j({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:F.timeshiftOf(t)})}static fromString(t,e=d.get(j)){const n=e.parse(t);return new j(n)}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),n=t.substring(0,e)+t.substring(e+4);return j.fromString(n)}clone(){return new j(this.toSpec())}}const k=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 A extends X{constructor(t){super(typeof t=="number"||t.hasOwnProperty("value")?t:{value:A.getValue(t,k.year)+A.getValue(t,k.month)+A.getValue(t,k.day)+A.getValue(t,k.hour)+A.getValue(t,k.minute)+A.getValue(t,k.second),uncertain:A.getBoolean(t,k.uncertain),approximate:A.getBoolean(t,"approximate")},Pt.millisecond)}static getBoolean(t,e){return t[e]||t[k.year+"s"]?.[e]||t[k.month+"s"]?.[e]||t[k.day+"s"]?.[e]||t[k.hour+"s"]?.[e]||t[k.minute+"s"]?.[e]||t[k.second+"s"]?.[e]||!1}static getValue(t,e){let n=0,r=t[e+"s"];if(r instanceof X?r=r.value:typeof t=="number"&&(r=t),r){const i=h[e];n=r*i.duration}return n}static toSpec(t,e=yr){return{...Y.toSpec(t,e),uncertain:t.uncertain||!1,approximate:t.approximate||!1}}static fromString(t,e=d.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)}toString(t=ie.instance){return super.toString(t)}toSpec(){return A.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=j.fromString(t)),t&&!(t instanceof j)&&!(t instanceof A))throw new V("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=j.fromString(t)),t&&!(t instanceof j)&&!(t instanceof A))throw new V("Interval end is not a level 1 date or duration: "+t);this._end=t}static fromString(t,e=d.get($t)){const{start:n,end:r}=e.parse(t);return new $t(n,r)}}class At extends X{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 E("year",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const ye=new xr;class J extends At{constructor(t,e=ye.year){super(t,e)}static fromString(t,e=ye.year,n=d.get(J)){const r=n.parse(t),i=r.value.start;if(i!==void 0){const a=new J(Object.assign({...r},{value:Math.max(i,e.min)})),u=new J(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 J(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 D extends At{constructor(t,e=new E(h.month.name,1,41,h.day,new Mr)){super(t,e)}static fromString(t,e=d.get(D)){const n=e.parse(t),r=n.value.start;if(r!==void 0){const i=h.month,a=new D(Object.assign({...n},{value:Math.max(r,i.min)})),u=new D(Object.assign({...n},{value:Math.min(n.value.end,i.max)}));return{start:a,end:u}}else return new D(n)}toString(t){return super.toString(t).padStart(2,"0")}}class Z extends At{constructor(t,e=h.day){super(t,e)}static fromString(t,e=d.get(Z)){const n=e.parse(t),r=n.value.start;if(r!==void 0){const i=h.day,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 At{constructor(t,e=h.hour){super(t,e)}static fromString(t,e=d.get(K)){const n=e.parse(t),r=n.value.start;if(r!==void 0){const i=h.hour,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)}}class Q extends At{constructor(t,e=h.minute){super(t,e)}static fromString(t,e=d.get(Q)){const n=e.parse(t),r=n.value.start;if(r!==void 0){const i=h.minute,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 At{constructor(t,e=h.second){super(t,e)}static fromString(t,e=h.second,n=d.get(P)){const r=n.parse(t),i=r.value.start;if(i!==void 0){const a=new P(Object.assign({...r},{value:Math.max(i,e.min)})),u=new P(Object.assign({...r},{value:Math.min(r.value.end,e.max)}));return{start:a,end:u}}else return new P(r,e)}}class Un extends pt{}class br extends Lt{qualifier(){return""}}class tt extends se{static instance=new tt;static valueRenderer=new br(W.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=tt.names.slice(tt.names.indexOf(e)+1).map(u=>t[u]).filter(Boolean),i=tt.qualifier(n.uncertainComponent,n.approximateComponent),a=tt.qualifier(n.uncertainGroup&&!n.uncertainComponent&&!r.some(u=>u.uncertain),n.approximateGroup&&!n.approximateComponent&&!r.some(u=>u.approximate));return i+n.toString(tt.valueRenderer)+a}}class Vn extends be{constructor(t){super(t)}newYear(t){return new J(t,this.units.year)}newMonth(t){return new D(t,this.units.month)}newDay(t){return new Z(t,this.units.day)}newHour(t){return new K(t,this.units.hour)}newMinute(t){return new Q(t,this.units.minute)}newSecond(t){return new P(t,this.units.second)}newMillisecond(t){return new ut(t,this.units.millisecond)}newTimeshift(t){return new Un(typeof t=="number"?t:t.value)}}const Er=new Vn(ye),Nr=new Vn(Pt);class U extends j{constructor(t){super(t)}toString(t=tt.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 Er}static fromDate(t){return new U({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:F.timeshiftOf(t)})}static fromString(t,e=d.get(U)){const n=e.parse(t);return new U(n)}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),n=t.substring(0,e)+t.substring(e+4);return U.fromString(n)}clone(){return new U(this.toSpec())}}class L{regExp;constructor(t,e){this.name=t,this.regExp=new RegExp(`^(?:${e})$`)}regexGroups(t){const e=this.regExp.exec(t);if(!e)throw new V(`Invalid ${this.name} "${t}"`);return e.groups}parseGroups(t){throw new ct(`${this.constructor.name} is abstract`)}parse(t){const e=this.regexGroups(t);return this.parseGroups(e)}}class gt extends ie{static instance=new gt;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=gt.qualifier(t.uncertainDuration,t.approximateDuration);if(!t.hasQualifiedComponent)return e+super.render(t);let n=e+"P";for(const[r,i]of gt.designators){const a=t.components[r];a&&(n+=gt.qualifier(a.uncertainComponent,a.approximateComponent)+a.value+i)}return n}}class v extends A{#t;constructor(t){if(super(typeof t=="number"?t:{value:v.valueFromSpec(t),uncertain:t.uncertain===!0,approximate:t.approximate===!0},Pt.millisecond),typeof t!="number"){const e={};for(const n of v.componentNames)t[n]instanceof X&&(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 v.getValue(t,k.year)+v.getValue(t,k.month)+v.getValue(t,k.day)+v.getValue(t,k.hour)+v.getValue(t,k.minute)+v.getValue(t,k.second)}static toSpec(t,e=Nr){const n=A.toSpec(t,e);if(t instanceof v&&t.hasQualifiedComponent)for(const r of v.componentNames)delete n[r],t.components[r]&&(n[r]=t.components[r]);return n}static fromString(t,e=d.get(v)){const n=e.parse(t);return new v(n)}static between(t,e){const n=e.getTime(),r=t.getTime();return new v(n-r)}toSpec(){return v.toSpec(this)}toString(t=gt.instance){return super.toString(t)}}class It extends $t{get start(){return this._start}set start(t){if(typeof t=="string"&&(super.start=U.fromString(t)),t&&!(t instanceof U)&&!(t instanceof v))throw new V("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=U.fromString(t)),t&&!(t instanceof U)&&!(t instanceof v))throw new V("Interval end is not a level 2 date or duration: "+t);this._end=t}static fromString(t,e=d.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=d.get(ee)){const{exclusive:n,values:r}=e.parse(t);return new ee(r,n)}}class _ extends L{constructor(t,e){super(t,e)}static read(t){return{value:t?parseInt(t,10):void 0}}parseGroups(t){return _.read(t[this.name])}parse(t){if(t.startsWith("-"))throw new V(`${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 _{static format(t=""){return o.numberGroup(o.groupName(t,$e),"{4}",void 0)}constructor(){super($e,Ct.format())}}const Ie="monthValue";class jt extends _{static format(t=""){return o.numberGroup(o.groupName(t,Ie),"{1,2}",void 0)}constructor(){super(Ie,jt.format())}}const Ce="dayValue";class yt extends _{static format(t=""){return o.numberGroup(o.groupName(t,Ce),"{1,2}",void 0)}constructor(){super(Ce,yt.format())}}const je="hourValue";class xt extends _{static format(t=""){return o.numberGroup(o.groupName(t,je),"{1,2}",void 0)}constructor(){super(je,xt.format())}}const Ue="minuteValue";class Ut extends _{static format(t=""){return o.numberGroup(o.groupName(t,Ue),"{1,2}",void 0)}constructor(){super(Ue,Ut.format())}}const Ve="secondValue";class Vt extends _{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 vt extends L{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,vt.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 V(`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 mt extends L{static format(t=""){return o.group(o.groupName(t,Ye),Ct.format(t))+o.optionalNonCapturingGroup("-",o.group(o.groupName(t,He),jt.format(t)),o.optionalNonCapturingGroup("-",o.group(o.groupName(t,qe),yt.format(t)),o.optionalNonCapturingGroup("[T ]",o.group(o.groupName(t,Xe),xt.format(t)),":?",o.group(o.groupName(t,We),Ut.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),vt.format(t)))))}constructor(){super("date",mt.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],f=e[Ze],m=n?new Mt(Ct.read(n)):void 0,x=r?jt.read(r):void 0;return{year:m,month:x?new bt(x,ft.create(x.value,m?.value)):void 0,day:i?new Et(yt.read(i)):void 0,hour:a?new Nt(xt.read(a)):void 0,minute:u?new Gt(Ut.read(u)):void 0,second:p?new Tt(Vt.read(p)):void 0,millisecond:c?ut.parseFraction(c):void 0,timeshift:f?at.fromString(f,new vt,{year:m?.value,month:x?.value,day:i?yt.read(i).value:void 0,hour:a?xt.read(a).value:void 0}):void 0}}}const Ke="years",ue="months",Gr="days",Qe="hours",Pe="minutes",Le="seconds";class Ne extends L{static format(t=""){return"P"+o.optionalNonCapturingGroup(o.numberGroup(o.groupName(t,Ke),"+",void 0,"\\d"),"Y")+o.optionalNonCapturingGroup(o.numberGroup(o.groupName(t,ue),"+",void 0,"\\d"),"MM")+o.optionalNonCapturingGroup(o.numberGroup(o.groupName(t,Gr),"+",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",Ne.format())}parseGroups(t){return{years:t[Ke],months:t[ue],days:t[ue],hours:t[Qe],minutes:t[Pe],seconds:t[Le]}}}const ce="start",me="end";class Ge extends L{static format=o.group(ce,mt.format(ce))+"/"+o.group(me,mt.format(me));constructor(){super("interval",Ge.format)}parse(t){const e=this.regexGroups(t),n=e[ce],r=e[me];return{start:n?F.fromString(n,new mt):void 0,end:r?F.fromString(r,new mt):void 0}}}d.register(F,()=>new mt);d.register(Et,()=>new yt);d.register(Y,()=>new Ne);d.register(Nt,()=>new xt);d.register(Ft,()=>new Ge);d.register(Gt,()=>new Ut);d.register(bt,()=>new jt);d.register(Tt,()=>new Vt);d.register(at,()=>new vt);d.register(Mt,()=>new Ct);class N extends _{static uncertainGroup="uncertain";static approximateGroup="approx";static uncertainAndApproximateGroup=N.uncertainGroup+N.approximateGroup;constructor(t,e){super(t,e)}static qualifierFormat(t,e){return o.optionalGroup(t,`\\${e}`)}static formatSuffix(t){return this.qualifierFormat(o.groupName(N.uncertainGroup,t),"?")+this.qualifierFormat(o.groupName(N.approximateGroup,t),"~")+this.qualifierFormat(o.groupName(N.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 x=0;x<e.length-i;x++)c*=10;const f=n*r*c,m=f+c-1;r={start:f,end:m}}else r*=n;const a=t[o.groupName(N.uncertainAndApproximateGroup,this.name)],u=t[o.groupName(N.approximateGroup,this.name)]||a,p=t[o.groupName(N.uncertainGroup,this.name)]||a;return{value:r,approximate:u?!!u:!1,uncertain:p?!!p:!1}}}const _e="yearValue";class Ot extends N{constructor(){super(_e,Ot.format())}static format(t=""){return"Y?"+N.numberFormat(o.groupName(t,_e),"+","[-]?")}parse(t){const e=this.regexGroups(t);return this.parseGroups(e)}}const tn="monthValue";class zt extends N{static format(t=""){return N.numberFormat(o.groupName(t,tn),"{1,2}",void 0)}constructor(){super(tn,zt.format())}}const en="dayValue";class Bt extends N{static format(t=""){return N.numberFormat(o.groupName(t,en),"{1,2}",void 0)}constructor(){super(en,Bt.format())}}const nn="hourValue";class Yt extends N{static format(t=""){return N.numberFormat(o.groupName(t,nn),"{1,2}",void 0)}constructor(){super(nn,Yt.format())}}const rn="minuteValue";class Ht extends N{static format(t=""){return N.numberFormat(o.groupName(t,rn),"{1,2}",void 0)}constructor(){super(rn,Ht.format())}}const sn="secondValue";class qt extends N{static format(t=""){return N.numberFormat(o.groupName(t,sn),"{1,2}",void 0)}constructor(){super(sn,qt.format())}}class Xt extends vt{}class G extends L{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=G.format()){super("date",t)}static format(t=""){return o.group(o.groupName(t,G.yearGroup),Ot.format(t))+o.optionalNonCapturingGroup("-",o.group(o.groupName(t,G.monthGroup),zt.format(t)),o.optionalNonCapturingGroup("-",o.group(o.groupName(t,G.dayGroup),Bt.format(t)),o.optionalNonCapturingGroup("[T ]",o.group(o.groupName(t,G.hourGroup),Yt.format(t)),":",o.group(o.groupName(t,G.minuteGroup),Ht.format(t)),o.optionalNonCapturingGroup(":",o.group(o.groupName(t,G.secondGroup),qt.format(t)),o.optionalNonCapturingGroup("[.,]",o.group(o.groupName(t,G.millisecondGroup),"\\d+"))),o.optionalGroup(o.groupName(t,G.timeshiftGroup),Xt.format(t)))))}parseGroups(t){const e=t[G.millisecondGroup],n=e?ut.parseFraction(e):void 0,r=t[G.secondGroup],i=r?it.fromString(r,new qt):void 0,a=t[G.minuteGroup];let u;a&&(u=ot.fromString(a,new Ht),u.uncertain=u.uncertain||i?.uncertain||!1,u.approximate=u.approximate||i?.approximate||!1);const p=t[G.hourGroup];let c;p&&(c=st.fromString(p,new Yt),c.uncertain=c.uncertain||u?.uncertain||!1,c.approximate=c.approximate||u?.approximate||!1);const f=t[G.dayGroup];let m;f&&(m=rt.fromString(f,new Bt),m.uncertain=m.uncertain||c?.uncertain||!1,m.approximate=m.approximate||c?.approximate||!1);const x=t[G.monthGroup];let g;x&&(g=nt.fromString(x,new zt),g.uncertain=g.uncertain||m?.uncertain||!1,g.approximate=g.approximate||m?.approximate||!1);const M=t[G.yearGroup];let w;M&&(w=et.fromString(M,void 0,new Ot),w.uncertain=w.uncertain||g?.uncertain||!1,w.approximate=w.approximate||g?.approximate||!1);const $=t[G.timeshiftGroup],T=$?pt.fromString($,new Xt,{year:w?.value,month:g?.value,day:m?.value,hour:c?.value}):void 0;return{year:w,month:g,day:m,hour:c,minute:u,second:i,millisecond:n,timeshift:T}}}const on="years",an="months",un="days",cn="hours",mn="minutes",dn="seconds";class dt extends N{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",dt.format())}parseGroups(t){return{years:t[on],months:t[an],days:t[un],hours:t[cn],minutes:t[mn],seconds:t[dn],uncertain:!!t[N.uncertainGroup],approximate:!!t[N.approximateGroup]}}}const Tr="dates",de="start",pe="end",pn="durations",le="durationMin",he="durationMax";class Te extends L{static format=o.group(Tr,o.optionalGroup(de,o.group("openStart","\\.\\.")+"|"+G.format(de))+"/"+o.optionalGroup(pe,o.group("openEnd","\\.\\.")+"|"+G.format(pe)))+"|"+o.group(pn,o.group(le,dt.format(le))+"/"+o.group(he,dt.format(he)));constructor(t="interval",e=Te.format){super(t,e)}parseGroups(t){let e,n;if(t[pn]){const i=t[le];e=A.fromString(i,new dt);const a=t[he];n=A.fromString(a,new dt)}else{const i=t[de];switch(i){case void 0:e=null;break;case"..":e=void 0;break;default:e=j.fromString(i,new G)}const a=t[pe];switch(a){case void 0:n=null;break;case"..":n=void 0;break;default:n=j.fromString(a,new G)}}return{start:e,end:n}}}d.register(j,()=>new G);d.register(rt,()=>new Bt);d.register(A,()=>new dt);d.register(st,()=>new Yt);d.register($t,()=>new Te);d.register(ot,()=>new Ht);d.register(nt,()=>new zt);d.register(it,()=>new qt);d.register(pt,()=>new Xt);d.register(et,()=>new Ot);class y extends N{static uncertainGroup="uncertain1";static approximateGroup="approx1";static uncertainAndApproximateGroup=y.uncertainGroup+y.approximateGroup;constructor(t,e){super(t,e)}static numberFormat(t,e,n){return this.qualifierFormat(o.groupName(y.uncertainGroup,t),"?")+this.qualifierFormat(o.groupName(y.approximateGroup,t),"~")+this.qualifierFormat(o.groupName(y.uncertainAndApproximateGroup,t),"%")+N.numberFormat(t,e,n)}parseGroups(t){const e=super.parseGroups(t),n=t[o.groupName(y.uncertainAndApproximateGroup,this.name)];return(t[o.groupName(y.uncertainGroup,this.name)]||n)&&(e.uncertainComponent=!0),(t[o.groupName(y.approximateGroup,this.name)]||n)&&(e.approximateComponent=!0),e}}const Rt="yearValue",ln="exp",hn="signif";class Wt extends y{constructor(){super(Rt,Wt.format())}static format(t=""){return"Y?"+o.nonCapturingGroup(o.group(o.groupName(t,ln),"[-]?\\d+E\\d+")+"|"+y.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 f=0;f<u.length;f++)c+=f<a?u.charAt(f):"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 y{static format(t=""){return y.numberFormat(o.groupName(t,fn),"{1,2}",void 0)}constructor(){super(fn,Jt.format())}}const gn="dayValue";class Dt extends y{static format(t=""){return y.numberFormat(o.groupName(t,gn),"{1,2}",void 0)}constructor(){super(gn,Dt.format())}}const wn="hourValue";class Zt extends y{static format(t=""){return y.numberFormat(o.groupName(t,wn),"{1,2}",void 0)}constructor(){super(wn,Zt.format())}}const Sn="secondValue";class Kt extends y{static format(t=""){return y.numberFormat(o.groupName(t,Sn),"{1,2}",void 0)}constructor(){super(Sn,Kt.format())}}const yn="minuteValue";class Qt extends y{static format(t=""){return y.numberFormat(o.groupName(t,yn),"{1,2}",void 0)}constructor(){super(yn,Qt.format())}}class vr extends Xt{}class b extends L{static yearGroup=G.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",b.format())}static format(t=""){return o.group(o.groupName(t,b.yearGroup),Wt.format(t))+o.optionalNonCapturingGroup("-",o.group(o.groupName(t,b.monthGroup),Jt.format(t)),o.optionalNonCapturingGroup("-",o.group(o.groupName(t,b.dayGroup),Dt.format(t)),o.optionalNonCapturingGroup("[T ]",o.group(o.groupName(t,b.hourGroup),Zt.format(t)),":",o.group(o.groupName(t,b.minuteGroup),Qt.format(t)),o.optionalNonCapturingGroup(":",o.group(o.groupName(t,b.secondGroup),Kt.format(t)),o.optionalNonCapturingGroup("[.,]",o.group(o.groupName(t,b.millisecondGroup),"\\d+"))),o.optionalGroup(o.groupName(t,b.timeshiftGroup),vr.format(t)))))}parseGroups(t){const e=t[b.millisecondGroup],n=e?ut.parseFraction(e):void 0,r=t[b.secondGroup];let i;r&&(i=P.fromString(r,void 0,new Kt),i.uncertain=i?.uncertain||!1,i.approximate=i?.approximate||!1);const a=t[b.minuteGroup];let u;a&&(u=Q.fromString(a,new Qt),u.uncertain=u.uncertain||i?.uncertain||!1,u.approximate=u.approximate||i?.approximate||!1);const p=t[b.hourGroup];let c;p&&(c=K.fromString(p,new Zt),c.uncertain=c.uncertain||u?.uncertain||!1,c.approximate=c.approximate||u?.approximate||!1);const f=t[b.dayGroup];let m;f&&(m=Z.fromString(f,new Dt),m.uncertain=m.uncertain||c?.uncertain||!1,m.approximate=m.approximate||c?.approximate||!1);const x=t[b.monthGroup];let g;x&&(g=D.fromString(x,new Jt),g.uncertain=g.uncertain||m?.uncertain||!1,g.approximate=g.approximate||m?.approximate||!1);const M=t[b.yearGroup];let w;M&&(w=J.fromString(M,void 0,new Wt),w.uncertain=w.uncertain||g?.uncertain||!1,w.approximate=w.approximate||g?.approximate||!1);const $=t[b.timeshiftGroup],T=$?Un.fromString($,new Xt,{year:w?.value,month:g?.value,day:m?.value,hour:c?.value}):void 0;return{year:w,month:g,day:m,hour:c,minute:u,second:i,millisecond:n,timeshift:T}}}const xn="durationValue";class ve extends y{static format(t=""){return"^"+y.numberFormat(o.groupName(t,xn),"+",void 0)}constructor(){super(xn,ve.format())}}class Ar extends Me{millisecond=new E("millisecond",0,Number.MAX_SAFE_INTEGER,void 0);second=new E("second",0,Number.MAX_SAFE_INTEGER,this.millisecond);minute=new E("minute",0,Number.MAX_SAFE_INTEGER,this.second);hour=new E("hour",0,Number.MAX_SAFE_INTEGER,this.minute);day=new E("day",1,Number.MAX_SAFE_INTEGER,this.hour);month=new E("month",1,Number.MAX_SAFE_INTEGER,this.day);year=new E("year",0,Number.MAX_SAFE_INTEGER,this.month)}const lt=new Ar;class l extends y{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 ve;static componentFormat(t,e,n,r,i=""){const a=o.group(o.groupName(t,l.quantityGroup(e)),y.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",l.format())}static format(t=""){const e=o.groupName(t,l.durationGroup);return this.qualifierFormat(o.groupName(y.uncertainGroup,e),"?")+this.qualifierFormat(o.groupName(y.approximateGroup,e),"~")+this.qualifierFormat(o.groupName(y.uncertainAndApproximateGroup,e),"%")+"P"+o.optional(l.componentFormat(t,l.yearsGroup,b.yearGroup,"Y"))+o.optionalNonCapturingGroup(l.componentFormat(t,l.monthsGroup,b.monthGroup,"MM")+"|"+l.componentFormat(t,l.isoMonthsGroup,"isoMonth","M",l.isoMonthsLookahead))+o.optional(l.componentFormat(t,l.daysGroup,b.dayGroup,"D"))+"T?"+o.optional(l.componentFormat(t,l.hoursGroup,b.hourGroup,"H"))+o.optional(l.componentFormat(t,l.minutesGroup,b.minuteGroup,"M"))+o.optional(l.componentFormat(t,l.secondsGroup,b.secondGroup,"S"))+o.optionalGroup(o.groupName(t,l.suffixGroup),"[?~%]")}static parseComponent(t,e,n){const r=l.componentParser.parse(t);return new e(r,n)}parseGroups(t){const e=t[l.quantityGroup(l.secondsGroup)];let n;e&&(n=l.parseComponent(e,P,lt.second),n.uncertain=!!t[o.groupName(y.uncertainGroup,l.secondsGroup)]||!1,n.approximate=!!t[o.groupName(y.approximateGroup,l.secondsGroup)]||!1);const r=t[l.quantityGroup(l.minutesGroup)];let i;r&&(i=l.parseComponent(r,Q,lt.minute),i.uncertain=i.uncertain||n?.uncertain||!1,i.approximate=i.approximate||n?.approximate||!1);const a=t[l.quantityGroup(l.hoursGroup)];let u;a&&(u=l.parseComponent(a,K,lt.hour),u.uncertain=u.uncertain||i?.uncertain||!1,u.approximate=u.approximate||i?.approximate||!1);const p=t[l.quantityGroup(l.daysGroup)];let c;p&&(c=l.parseComponent(p,Z,lt.day),c.uncertain=c.uncertain||u?.uncertain||!1,c.approximate=c.approximate||u?.approximate||!1);const f=t[l.quantityGroup(l.monthsGroup)]||t[l.quantityGroup(l.isoMonthsGroup)];let m;f&&(m=l.parseComponent(f,D,lt.month),m.uncertain=m.uncertain||c?.uncertain||!1,m.approximate=m.approximate||c?.approximate||!1);const x=t[l.quantityGroup(l.yearsGroup)];let g;x&&(g=l.parseComponent(x,J,lt.year),g.uncertain=g.uncertain||m?.uncertain||!1,g.approximate=g.approximate||m?.approximate||!1);const M=t[l.suffixGroup],w=!!t[o.groupName(y.uncertainAndApproximateGroup,l.durationGroup)]||M==="%",$=w||!!t[o.groupName(y.uncertainGroup,l.durationGroup)]||M==="?",T=w||!!t[o.groupName(y.approximateGroup,l.durationGroup)]||M==="~";return{years:g,months:m,days:c,hours:u,minutes:i,seconds:n,uncertain:$,approximate:T}}}const kr="dates",fe="start",ge="end",Mn="durations",we="durationMin",Se="durationMax";class ae extends L{static format=o.group(kr,o.optionalGroup(fe,o.group("openStart","\\.\\.")+"|"+b.format(fe))+"/"+o.optionalGroup(ge,o.group("openEnd","\\.\\.")+"|"+b.format(ge)))+"|"+o.group(Mn,o.group(we,l.format(we))+"/"+o.group(Se,l.format(Se)));constructor(t="interval",e=ae.format){super(t,e)}parseGroups(t){let e,n;if(t[Mn]){const i=t[we];e=v.fromString(i,new l);const a=t[Se];n=v.fromString(a,new l)}else{const i=t[fe];switch(i){case void 0:e=null;break;case"..":e=void 0;break;default:e=U.fromString(i,new b)}const a=t[ge];switch(a){case void 0:n=null;break;case"..":n=void 0;break;default:n=U.fromString(a,new b)}}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=U.fromString(a,new b),i.push(u)}return{values:i,exclusive:e}}}d.register(U,()=>new b);d.register(Z,()=>new Dt);d.register(v,()=>new l);d.register(K,()=>new Zt);d.register(It,()=>new ae);d.register(Q,()=>new Qt);d.register(D,()=>new Jt);d.register(P,()=>new Kt);d.register(ee,()=>new Rr);d.register(J,()=>new Wt);class q{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[q.base(i)];if(a)return a}const r=new Set(this.preferences.map(i=>q.base(i)));for(const[i,a]of Object.entries(t))if(a&&r.has(q.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=>q.base(c)===q.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]}}q.any=new q([]);var bn;(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"})(bn||(bn={}));var En;(function(s){s.neutral="neutral",s.male="male",s.female="female"})(En||(En={}));const Fr="modulepreload",$r=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(f){return Promise.all(f.map(m=>Promise.resolve(m).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};const u=document.getElementsByTagName("link"),p=document.querySelector("meta[property=csp-nonce]"),c=p?.nonce||p?.getAttribute("nonce");r=a(e.map(f=>{if(f=$r(f,n),f in Nn)return;Nn[f]=!0;const m=f.endsWith(".css"),x=m?'[rel="stylesheet"]':"";if(!!n)for(let w=u.length-1;w>=0;w--){const $=u[w];if($.href===f&&(!m||$.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${x}`))return;const M=document.createElement("link");if(M.rel=m?"stylesheet":Fr,m||(M.as="script"),M.crossOrigin="",M.href=f,c&&M.setAttribute("nonce",c),document.head.appendChild(M),m)return new Promise((w,$)=>{M.addEventListener("load",w),M.addEventListener("error",()=>$(new Error(`Unable to preload CSS for ${f}`)))})}))}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 Ir extends Error{constructor(t,e){super(t),this.cause=e}}class Ae extends Ir{constructor(t=Ae.defaultMessage,e){super(t,e)}}Ae.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 Tn;(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"})(Tn||(Tn={}));class vn{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 wt{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 wt.BODIES.map(t=>({id:t.id,category:"dslr",name:t.name,projection:"rectilinear",frame:{widthMm:t.widthMm,heightMm:t.heightMm,focalLengthMm:wt.DEFAULT_FOCAL_MM,focalRangeMm:wt.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(wt.BODIES.map(t=>[t.id,t.name]))}}class z{static DEFAULT_EYEPIECE_MM=26;static DEFAULT_APPARENT_FIELD_DEG=52;static FIELD_STOP_MM=2*z.DEFAULT_EYEPIECE_MM*Math.tan(z.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=z.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=z.FIELD_STOP_MM,n=z.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*z.RANGE.min,maxMm:r.focalLengthMm*z.RANGE.max}},visualAid:{apertureMm:r.apertureMm,eyepieceFocalMm:z.DEFAULT_EYEPIECE_MM},...r.fromYear!==void 0?{years:{from:r.fromYear}}:{}}));return[...t,...n]}static names(){return Object.fromEntries(z.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),...wt.instruments(),...z.instruments()];const Cr=["spring","summer","autumn","winter"],jr=21;function Ur(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+Cr.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 B{static toCurrent(t){const e=t.version,n=typeof e=="object"&&e!==null&&"value"in e?e.value:e;return n!==void 0&&n!==1?t:B.fromVersion1(t)}static fromVersion1(t){const e={...t,version:2};for(const n of["time","endTime"])t[n]!==void 0&&(e[n]=B.edtf(t[n]));if(Array.isArray(t.place)){const n=B.place(t.place);n===void 0?delete e.place:e.place=n}return e}static edtf(t){if(B.isWrapped(t)){const c=B.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=>B.isWrapped(c)),r=Object.fromEntries(Object.entries(e).map(([c,f])=>[c,B.isWrapped(f)?f.value:f])),i=Ur(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=>B.isWrapped(c)?c.value:c),n=e.find(c=>c.name)?.name,r={...n?{name:n}:{},locations:e.map(({lat:c,lng:f})=>({lat:c,lng:f}))},i=t.find(c=>B.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 ht 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 vn.NAMES){const r=e?.frozen?.[n];if(!(!r?.src||r.live))try{const i=B.toCurrent(await ne.json(new URL(r.src,new URL(t,location.href)).href));for(const a of vn.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 ht("mixed-content",t);let n;try{n=await fetch(t)}catch{throw await this.diagnose(t,e)}if(!n.ok)throw new ht("status",t,n.status);try{return await n.json()}catch{throw new ht("malformed",t)}}static async diagnose(t,e){if(e.origin===location.origin)return new ht("unreachable",t);try{return await fetch(t,{mode:"no-cors"}),new ht("cors",t)}catch{return new ht("unreachable",t)}}}function Vr(s,t){for(const e of s){const n=e.toLowerCase().split("-")[0];if(t.includes(n))return n}return"en"}class Or{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 zr=["en","fr","es","it"],Br={en:()=>_t(()=>Promise.resolve().then(()=>Hr),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 Yr(s){return Br[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"}},Hr=Object.freeze(Object.defineProperty({__proto__:null,interviewMessages_en:xe},Symbol.toStringTag,{value:"Module"})),qr="interviewseek";class Xr 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 St{static CURRENT={sighting:2,case:1,interview:1};static SCHEMA_BASE="https://ufoathome.org/schema";static schemaUrl(t,e=St.CURRENT[t]){return`${St.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=St.of(t),r=St.CURRENT[e];if(typeof n!="number"||!Number.isInteger(n)||n<1||n>r)throw new Xr(e,n,r);return t}}class R{static read(t){return St.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?"…":R.plain(e.text)).join(" "):t.redacted?void 0:R.plain(t.text??"")}static ENTITIES={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "};static plain(t){return/[<&]/.test(t)?t.replace(/<br\s*\/?>/gi,`
|
|
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)=>R.ENTITIES[n.toLowerCase()]??e):t}static sightingsOf(t){return[t.interviewOf].flat().filter(e=>typeof e=="string")}static passagesAbout(t,e){const n=R.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=R.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&&R.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
|
-
${
|
|
5
|
-
<v ${
|
|
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`${R.stamp(i.start)} --> ${R.stamp(c)}
|
|
5
|
+
<v ${e(R.speakerName(t,i.speaker))}>${e(R.said(i)??"[…]")}`}).join(`
|
|
6
6
|
|
|
7
7
|
`)}
|
|
8
|
-
`}}class
|
|
8
|
+
`}}class S{static svg(t){return`<svg viewBox="0 0 24 24" width="1.5em" height="1.5em" aria-hidden="true" focusable="false"><path d="${t}" fill="currentColor"/></svg>`}static outline(t){return`<svg viewBox="0 0 24 24" width="1.5em" height="1.5em" aria-hidden="true" focusable="false"><path d="${t}" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round" stroke-linecap="round"/></svg>`}static solid(t){return`<svg viewBox="0 0 24 24" width="1.5em" height="1.5em" aria-hidden="true" focusable="false"><path d="${t}" fill="currentColor" fill-rule="evenodd"/></svg>`}static BOOKMARK="M6 3.5h12a.5.5 0 0 1 .5.5v16.5L12 16.8l-6.5 3.7V4a.5.5 0 0 1 .5-.5z";static PICTURE="M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z";static PICTURE_HILLS="M4.5 17.5l4.5-6 3 4 2.5-3 5 5z";static PIN="M12 21.5s-6.5-5.7-6.5-10.8a6.5 6.5 0 0 1 13 0c0 5.1-6.5 10.8-6.5 10.8z";static PIN_HOLE="M12 8.4a2.4 2.4 0 1 0 0 4.8 2.4 2.4 0 0 0 0-4.8z";static MILESTONES_OFF=S.outline(S.BOOKMARK);static MILESTONES_ON=S.solid(S.BOOKMARK);static PICTURES_OFF=S.outline(`${S.PICTURE}${S.PICTURE_HILLS}`);static PICTURES_ON=S.solid(`${S.PICTURE}${S.PICTURE_HILLS}`);static TRACE_LINE="M3 19.5l2.2-2.2 1.4 1.4L4.4 20.9zM8 14.5l2.2-2.2 1.4 1.4-2.2 2.2zM13 9.5l2.2-2.2 1.4 1.4-2.2 2.2z";static TRACE_MARK="M18.5 2.5l3.5 3.5-3.5 3.5-3.5-3.5z";static TRACES_OFF=S.outline(`${S.TRACE_LINE}${S.TRACE_MARK}`);static TRACES_ON=S.solid(`${S.TRACE_LINE}${S.TRACE_MARK}`);static MAP_OFF=S.outline(`${S.PIN}${S.PIN_HOLE}`);static MAP_ON=S.solid(`${S.PIN}${S.PIN_HOLE}`);static SHARE=S.outline("M14 4l7 7-7 7v-4.2C8.6 13.8 5.4 15.6 3.5 19c.6-5.6 3.4-9.6 10.5-10.8V4z");static FOLDED=S.svg("M15.4 7.4 14 6l-6 6 6 6 1.4-1.4L10.8 12z");static UNFOLDED=S.svg("M8.6 16.6 10 18l6-6-6-6-1.4 1.4 4.6 4.6z");static PLAY=S.svg("M7.4 5v14l11-7z");static PAUSE=S.svg("M6 5h4v14H6zM14 5h4v14h-4z");static VOLUME=S.svg("M2 9.5v5h3.5l4.5 4.5V5L5.5 9.5H2zm12.5 2.5A4 4 0 0 0 12.5 8.5v7A4 4 0 0 0 14.5 12zM12.5 4.2v2.1a6.5 6.5 0 0 1 0 11.4v2.1a8.6 8.6 0 0 0 0-15.6z");static MUTED=S.svg("M2 9.5v5h3.5l4.5 4.5V5L5.5 9.5H2zM15 9.8l1.4-1.4 2.6 2.6 2.6-2.6 1.4 1.4-2.6 2.6 2.6 2.6-1.4 1.4-2.6-2.6-2.6 2.6-1.4-1.4 2.6-2.6z");static ENTER_FULLSCREEN=S.svg("M5 5h5v2H7v3H5V5zm9 0h5v5h-2V7h-3V5zM5 14h2v3h3v2H5v-5zm12 0h2v5h-5v-2h3v-3z");static EXIT_FULLSCREEN=S.svg("M8 5h2v5H5V8h3V5zm6 0h2v3h3v2h-5V5zM5 14h5v5H8v-3H5v-2zm9 0h5v2h-3v3h-2v-5z")}const An="rr0-interview",Wr=`
|
|
9
9
|
rr0-interview { display: block; --rr0-interview-line: color-mix(in srgb, currentColor 35%, transparent); }
|
|
10
10
|
rr0-interview [hidden] { display: none !important; }
|
|
11
11
|
rr0-interview .rr0-interview-status { font-size: .85em; opacity: .85; margin: 0 0 .5em; }
|
|
@@ -32,4 +32,4 @@ rr0-interview .turn .refs { display: flex; flex-wrap: wrap; gap: .25em; }
|
|
|
32
32
|
rr0-interview .turn .ref { font: inherit; font-size: .8em; cursor: pointer; border: 1px solid var(--rr0-interview-line); border-radius: 999px; background: transparent; color: inherit;
|
|
33
33
|
padding: 0 .35em; font-variant-numeric: tabular-nums; white-space: nowrap; display: inline-flex; align-items: center; gap: .15em; }
|
|
34
34
|
rr0-interview .turn .ref svg { width: 1.1em; height: 1.1em; }
|
|
35
|
-
`;class
|
|
35
|
+
`;class ke extends HTMLElement{messages=xe;said=new q(["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(){ke.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=Wr,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=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=Or.preferencesFor(this),n=Vr(e,zr),r=n==="en"?xe:await Yr(n);t===this.localeToken&&(this.said=new q(e),this.messages=r,this.draw())}speakerName(t,e){const n=R.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?R.said(e):void 0,i={sighting:t.sighting??R.sightingsOf(n)[0],at:t.at,...r?{quote:r}:{}};this.dispatchEvent(new CustomEvent(qr,{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(x=>!["approved","covered"].includes(e.proofreading?.[x]?.status??""));this.status.textContent=m.length===0?t.proofreadAll:t.proofreadPending.replace("{names}",m.map(x=>this.speakerName(e,x)).join(", ")),this.status.hidden=!1}else this.status.hidden=!0;const a=[];let u,p=!1,c,f;n.forEach((m,x)=>{const g=m.redacted?JSON.stringify(m.redacted.reason):void 0;if(g!==void 0&&c?.reason===g){this.blocks.set(x,c.block),m.speaker!==f&&(f=void 0);return}const M=document.createElement("div");M.className="turn",M.dataset.segment=String(x);const w=document.createElement("div");w.className="who";const $=document.createElement("span");if($.textContent=m.redacted?"":this.speakerName(e,m.speaker),m.start!==void 0&&(M.dataset.time=R.clock(m.start,!0)),f!==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&&M.classList.add("goes-on"),p=!0),u.append(M),f=m.speaker,w.append($),m.redacted){M.classList.add("is-redacted");const T=this.gap(m.redacted.reason,"p");T.className="redacted",c={block:M,reason:g},M.append(w,T)}else{const T=document.createElement("p");if(T.className="said",m.parts){let kt="";for(const O of m.parts){const Re="redacted"in O?"▮":R.plain(O.text);/[\p{L}\p{N}.,;:!?)»”…▮]$/u.test(kt)&&/^[\p{L}\p{N}(«“▮]/u.test(Re)&&T.append(" "),"redacted"in O?T.append(this.gap(O.redacted.reason,"span")):T.append(...this.saidNodes(O.text)),kt=Re}}else T.append(...this.saidNodes(m.text??""));c=void 0,M.append(w,T)}if(m.refs?.length){const T=document.createElement("div");T.className="refs";for(const kt of m.refs){const O=document.createElement("button");O.type="button",O.className="ref",O.innerHTML=S.PLAY,O.append(R.clock(kt.at,!0)),O.addEventListener("click",()=>this.seek(kt,m)),T.append(O)}M.append(T)}this.blocks.set(x,M)}),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 Jr(){customElements.get(An)||customElements.define(An,ke)}Jr();
|