let e=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;var t=class t extends Date{#e=!1;#t=!1;#n=null;constructor(t){let n=!0,r=!0,i=`Z`;if(typeof t==`string`){let a=t.match(e);a?(a[1]||(n=!1,t=`0000-01-01T${t}`),r=!!a[2],r&&t[10]===` `&&(t=t.replace(` `,`T`)),a[2]&&+a[2]>23?t=``:(i=a[3]||null,t=t.toUpperCase(),!i&&r&&(t+=`Z`))):t=``}super(t),isNaN(this.getTime())||(this.#e=n,this.#t=r,this.#n=i)}isDateTime(){return this.#e&&this.#t}isLocal(){return!this.#e||!this.#t||!this.#n}isDate(){return this.#e&&!this.#t}isTime(){return this.#t&&!this.#e}isValid(){return this.#e||this.#t}toISOString(){let e=super.toISOString();if(this.isDate())return e.slice(0,10);if(this.isTime())return e.slice(11,23);if(this.#n===null)return e.slice(0,-1);if(this.#n===`Z`)return e;let t=this.#n.slice(1,3)*60+ +this.#n.slice(4,6);return t=this.#n[0]===`-`?t:-t,new Date(this.getTime()-t*6e4).toISOString().slice(0,-1)+this.#n}static wrapAsOffsetDateTime(e,n=`Z`){let r=new t(e);return r.#n=n,r}static wrapAsLocalDateTime(e){let n=new t(e);return n.#n=null,n}static wrapAsLocalDate(e){let n=new t(e);return n.#t=!1,n.#n=null,n}static wrapAsLocalTime(e){let n=new t(e);return n.#e=!1,n.#n=null,n}};function n(e,t){let n=e.slice(0,t).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function r(e,t,n){let r=e.split(/\r\n|\n|\r/g),i=``,a=(Math.log10(t+1)|0)+1;for(let e=t-1;e<=t+1;e++){let o=r[e-1];o&&(i+=e.toString().padEnd(a,` `),i+=`: `,i+=o,i+=` `,e===t&&(i+=` `.repeat(a+n+2),i+=`^ `))}return i}var i=class extends Error{line;column;codeblock;constructor(e,t){let[i,a]=n(t.toml,t.ptr),o=r(t.toml,i,a);super(`Invalid TOML document: ${e}\n\n${o}`,t),this.line=i,this.column=a,this.codeblock=o}};function a(e,t=0){let n=e.indexOf(` `,t);return e.charCodeAt(n-1)===13&&n--,n}function o(e){for(;e.p=48&&n<=57?n-48:n>=65&&n<=70?n-65+10:n>=97&&n<=102?n-97+10:-1;if(r<0)throw new i(`invalid non-hex character in unicode escape`,{toml:e.s,ptr:e.p+1});t=t<<4|r}if(t<0||t>1114111||t>=55296&&t<=57343)throw new i(`invalid unicode escape`,{toml:e.s,ptr:e.p});s+=String.fromCodePoint(t),c=e.p+1,l=0}else if(n===32||n===9)l=2;else{if(n===98)s+=`\b`;else if(n===116)s+=` `;else if(n===110)s+=` `;else if(n===102)s+=`\f`;else if(n===114)s+=`\r`;else if(n===101)s+=`\x1B`;else if(n===34)s+=`"`;else if(n===92)s+=`\\`;else throw new i(`unrecognized escape sequence`,{toml:e.s,ptr:e.p});c=e.p+1,l=0}}else if(n!==32&&n!==9){if(l===2)throw new i(`invalid escape: only line-ending whitespace may be escaped`,{toml:e.s,ptr:c});l=+(!a&&n===92),c=e.p}throw new i(`unfinished string`,{toml:e.s,ptr:t})}function p(e,t,n){let r=e.s.slice(t,n),i=r.indexOf(`#`);return i>0&&(o({s:r,p:i,d:0}),r=r.slice(0,i)),r.trimEnd()}function m(e,n,r){let a=e.p,o={toml:e.s,ptr:a};c(e,44,r);let s=p(e,a,e.p);if(!s)throw new i(`incomplete declaration: value expected`,o);if(s===`-inf`)return-1/0;if(s===`inf`||s===`+inf`)return 1/0;if(s===`nan`||s===`+nan`||s===`-nan`)return NaN;if(s===`-0`)return n?0n:0;let f=l.test(s);if(f||u.test(s)){if(d.test(s))throw new i(`leading zeroes are not allowed`,o);s=s.replace(/_/g,``);let e=+s;if(isNaN(e))throw new i(`invalid number`,o);if(f){if((f=!Number.isSafeInteger(e))&&!n)throw new i(`integer value cannot be represented losslessly`,o);(f||n===!0)&&(e=BigInt(s))}return e}let m=new t(s);if(!m.isValid())throw new i(`invalid value`,o);return m}function h(e,t,n){let r=e.p,a=e.s.charCodeAt(r);if(a===91||a===123){if(!e.d--)throw new i(`document contains excessively nested structures. aborting.`,{toml:e.s,ptr:r});let t=a===91?y(e,n):v(e,n);return e.d++,t}if(a===34||a===39)return f(e);if(a===116){if(e.s.charCodeAt(++e.p)!==114||e.s.charCodeAt(++e.p)!==117||e.s.charCodeAt(++e.p)!==101)throw new i(`invalid value`,{toml:e.s,ptr:r});return e.p++,!0}if(a===102){if(e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==108||e.s.charCodeAt(++e.p)!==115||e.s.charCodeAt(++e.p)!==101)throw new i(`invalid value`,{toml:e.s,ptr:r});return e.p++,!1}return m(e,n,t)}let g=/^[a-zA-Z0-9-_]+[ \t]*$/;function _(e,t=`=`){let n=e.p,r=n-1,o=[],c=e.s.indexOf(t,n);if(c<0)throw new i(`incomplete key-value: cannot find end of key`,{toml:e.s,ptr:n});do{let s=e.s.charCodeAt(e.p=++r);if(s!==32&&s!==9){if(s===34||s===39){if(s===e.s.charCodeAt(e.p+1)&&s===e.s.charCodeAt(e.p+2))throw new i(`multiline strings are not allowed in keys`,{toml:e.s,ptr:e.p});let l=f(e);r=e.s.indexOf(`.`,e.p);let u=e.s.slice(e.p,r<0||r>c?c:r),d=a(u);if(d>-1)throw new i(`newlines are not allowed in keys`,{toml:e.s,ptr:d});if(u.trimStart())throw new i(`found extra tokens after the string part`,{toml:e.s,ptr:e.p});if(cc?c:r);if(!g.test(t))throw new i(`only letter, numbers, dashes and underscores are allowed in keys`,{toml:e.s,ptr:e.p});o.push(t.trimEnd())}}}while(r+1&&r