@js-temporal/polyfill
Version:
Polyfill for Temporal (https://github.com/tc39/proposal-temporal), an ECMA TC39 Stage 3 proposal
1 lines • 129 kB
JavaScript
"use strict";var e=require("jsbi");const t=e.BigInt(0),n=e.BigInt(1),r=e.BigInt(2),o=e.BigInt(10),i=e.BigInt(24),a=e.BigInt(60),s=e.BigInt(1e3),c=e.BigInt(1e6),d=e.BigInt(1e9),h=e.multiply(e.BigInt(3600),d),u=e.multiply(a,d),l=e.multiply(h,i);function m(t){return"bigint"==typeof t?e.BigInt(t.toString(10)):t}function f(n){return e.equal(e.remainder(n,r),t)}function y(n){return e.lessThan(n,t)?e.unaryMinus(n):n}function p(t,n){return e.lessThan(t,n)?-1:e.greaterThan(t,n)?1:0}function g(t,n){return{quotient:e.divide(t,n),remainder:e.remainder(t,n)}}var w,v;const b="slot-epochNanoSeconds",D="slot-iso-date",T="slot-iso-date-time",M="slot-time",E="slot-calendar",I="slot-date-brand",C="slot-year-month-brand",O="slot-month-day-brand",$="slot-time-zone",Y="slot-years",R="slot-months",S="slot-weeks",j="slot-days",k="slot-hours",N="slot-minutes",x="slot-seconds",L="slot-milliseconds",P="slot-microseconds",U="slot-nanoseconds",B="date",Z="ym",F="md",H="time",z="datetime",A="instant",q="original",W="timezone-canonical",_="timezone-original",J="calendar-id",G="locale",K="options",V=new WeakMap,X=Symbol.for("@@Temporal__GetSlots");(w=globalThis)[X]||(w[X]=function(e){return V.get(e)});const Q=globalThis[X],ee=Symbol.for("@@Temporal__CreateSlots");(v=globalThis)[ee]||(v[ee]=function(e){V.set(e,Object.create(null))});const te=globalThis[ee];function ne(e,...t){if(!e||"object"!=typeof e)return!1;const n=Q(e);return!!n&&t.every((e=>e in n))}function re(e,t){const n=Q(e)?.[t];if(void 0===n)throw new TypeError(`Missing internal slot ${t}`);return n}function oe(e,t,n){const r=Q(e);if(void 0===r)throw new TypeError("Missing slots for the given container");if(r[t])throw new TypeError(`${t} already has set`);r[t]=n}const ie={};function ae(e,t){Object.defineProperty(e.prototype,Symbol.toStringTag,{value:t,writable:!1,enumerable:!1,configurable:!0});const n=Object.getOwnPropertyNames(e);for(let t=0;t<n.length;t++){const r=n[t],o=Object.getOwnPropertyDescriptor(e,r);o.configurable&&o.enumerable&&(o.enumerable=!1,Object.defineProperty(e,r,o))}const r=Object.getOwnPropertyNames(e.prototype);for(let t=0;t<r.length;t++){const n=r[t],o=Object.getOwnPropertyDescriptor(e.prototype,n);o.configurable&&o.enumerable&&(o.enumerable=!1,Object.defineProperty(e.prototype,n,o))}se(t,e),se(`${t}.prototype`,e.prototype)}function se(e,t){const n=`%${e}%`;if(void 0!==ie[n])throw new Error(`intrinsic ${e} already exists`);ie[n]=t}function ce(e){return ie[e]}function de(e,t){let n=e;if(0===n)return{div:n,mod:n};const r=Math.sign(n);n=Math.abs(n);const o=Math.trunc(1+Math.log10(n));if(t>=o)return{div:0*r,mod:r*n};if(0===t)return{div:r*n,mod:0*r};const i=n.toPrecision(o);return{div:r*Number.parseInt(i.slice(0,o-t),10),mod:r*Number.parseInt(i.slice(o-t),10)}}function he(e,t,n){let r=e,o=n;if(0===r)return o;const i=Math.sign(r)||Math.sign(o);r=Math.abs(r),o=Math.abs(o);const a=r.toPrecision(Math.trunc(1+Math.log10(r)));if(0===o)return i*Number.parseInt(a+"0".repeat(t),10);const s=a+o.toPrecision(Math.trunc(1+Math.log10(o))).padStart(t,"0");return i*Number.parseInt(s,10)}function ue(e,t){const n="negative"===t;switch(e){case"ceil":return n?"zero":"infinity";case"floor":return n?"infinity":"zero";case"expand":return"infinity";case"trunc":return"zero";case"halfCeil":return n?"half-zero":"half-infinity";case"halfFloor":return n?"half-infinity":"half-zero";case"halfExpand":return"half-infinity";case"halfTrunc":return"half-zero";case"halfEven":return"half-even"}}function le(e,t,n,r,o){return"zero"===o?e:"infinity"===o?t:n<0?e:n>0?t:"half-zero"===o?e:"half-infinity"===o?t:r?e:t}class TimeDuration{constructor(t){this.totalNs=m(t),this.sec=e.toNumber(e.divide(this.totalNs,d)),this.subsec=e.toNumber(e.remainder(this.totalNs,d))}static validateNew(t,n){if(e.greaterThan(y(t),TimeDuration.MAX))throw new RangeError(`${n} of duration time units cannot exceed ${TimeDuration.MAX} s`);return new TimeDuration(t)}static fromEpochNsDiff(t,n){const r=e.subtract(m(t),m(n));return new TimeDuration(r)}static fromComponents(t,n,r,o,i,a){const l=e.add(e.add(e.add(e.add(e.add(e.BigInt(a),e.multiply(e.BigInt(i),s)),e.multiply(e.BigInt(o),c)),e.multiply(e.BigInt(r),d)),e.multiply(e.BigInt(n),u)),e.multiply(e.BigInt(t),h));return TimeDuration.validateNew(l,"total")}abs(){return new TimeDuration(y(this.totalNs))}add(t){return TimeDuration.validateNew(e.add(this.totalNs,t.totalNs),"sum")}add24HourDays(t){return TimeDuration.validateNew(e.add(this.totalNs,e.multiply(e.BigInt(t),l)),"sum")}addToEpochNs(t){return e.add(m(t),this.totalNs)}cmp(e){return p(this.totalNs,e.totalNs)}divmod(t){const{quotient:n,remainder:r}=g(this.totalNs,e.BigInt(t));return{quotient:e.toNumber(n),remainder:new TimeDuration(r)}}fdiv(n){const r=m(n),i=e.BigInt(r);let{quotient:a,remainder:s}=g(this.totalNs,i);const c=[];let d;const h=(e.lessThan(this.totalNs,t)?-1:1)*Math.sign(e.toNumber(r));for(;!e.equal(s,t)&&c.length<50;)s=e.multiply(s,o),({quotient:d,remainder:s}=g(s,i)),c.push(Math.abs(e.toNumber(d)));return h*Number(y(a).toString()+"."+c.join(""))}isZero(){return e.equal(this.totalNs,t)}round(o,i){const a=m(o);if(e.equal(a,n))return this;const{quotient:s,remainder:c}=g(this.totalNs,a),d=e.lessThan(this.totalNs,t)?"negative":"positive",h=e.multiply(y(s),a),u=e.add(h,a),l=p(y(e.multiply(c,r)),a),w=ue(i,d),v=e.equal(y(this.totalNs),h)?h:le(h,u,l,f(s),w),b="positive"===d?v:e.unaryMinus(v);return TimeDuration.validateNew(b,"rounding")}sign(){return this.cmp(new TimeDuration(t))}subtract(t){return TimeDuration.validateNew(e.subtract(this.totalNs,t.totalNs),"difference")}}TimeDuration.MAX=e.BigInt("9007199254740991999999999"),TimeDuration.ZERO=new TimeDuration(t);const me=/[A-Za-z._][A-Za-z._0-9+-]*/,fe=new RegExp(`(?:${/(?:[+-](?:[01][0-9]|2[0-3])(?::?[0-5][0-9])?)/.source}|(?:${me.source})(?:\\/(?:${me.source}))*)`),ye=/(?:[+-]\d{6}|\d{4})/,pe=/(?:0[1-9]|1[0-2])/,ge=/(?:0[1-9]|[12]\d|3[01])/,we=new RegExp(`(${ye.source})(?:-(${pe.source})-(${ge.source})|(${pe.source})(${ge.source}))`),ve=/(\d{2})(?::(\d{2})(?::(\d{2})(?:[.,](\d{1,9}))?)?|(\d{2})(?:(\d{2})(?:[.,](\d{1,9}))?)?)?/,be=/((?:[+-])(?:[01][0-9]|2[0-3])(?::?(?:[0-5][0-9])(?::?(?:[0-5][0-9])(?:[.,](?:\d{1,9}))?)?)?)/,De=new RegExp(`([zZ])|${be.source}?`),Te=/\[(!)?([a-z_][a-z0-9_-]*)=([A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)\]/g,Me=new RegExp([`^${we.source}`,`(?:(?:[tT]|\\s+)${ve.source}(?:${De.source})?)?`,`(?:\\[!?(${fe.source})\\])?`,`((?:${Te.source})*)$`].join("")),Ee=new RegExp([`^[tT]?${ve.source}`,`(?:${De.source})?`,`(?:\\[!?${fe.source}\\])?`,`((?:${Te.source})*)$`].join("")),Ie=new RegExp(`^(${ye.source})-?(${pe.source})(?:\\[!?${fe.source}\\])?((?:${Te.source})*)$`),Ce=new RegExp(`^(?:--)?(${pe.source})-?(${ge.source})(?:\\[!?${fe.source}\\])?((?:${Te.source})*)$`),Oe=/(\d+)(?:[.,](\d{1,9}))?/,$e=new RegExp(`(?:${Oe.source}H)?(?:${Oe.source}M)?(?:${Oe.source}S)?`),Ye=new RegExp(`^([+-])?P${/(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/.source}(?:T(?!$)${$e.source})?$`,"i"),Re=864e5,Se=1e6*Re,je=6e10,ke=1e8*Re,Ne=xo(ke),xe=e.unaryMinus(Ne),Le=e.add(e.subtract(xe,l),n),Pe=e.subtract(e.add(Ne,l),n),Ue=146097*Re,Be=-271821,Ze=275760,Fe=Date.UTC(1847,0,1),He=["iso8601","hebrew","islamic","islamic-umalqura","islamic-tbla","islamic-civil","islamic-rgsa","islamicc","persian","ethiopic","ethioaa","ethiopic-amete-alem","coptic","chinese","dangi","roc","indian","buddhist","japanese","gregory"],ze=new Set(["ACT","AET","AGT","ART","AST","BET","BST","CAT","CNT","CST","CTT","EAT","ECT","IET","IST","JST","MIT","NET","NST","PLT","PNT","PRT","PST","SST","VST"]);function Ae(e){return"object"==typeof e&&null!==e||"function"==typeof e}function qe(e){if("bigint"==typeof e)throw new TypeError("Cannot convert BigInt to number");return Number(e)}function We(e){if("symbol"==typeof e)throw new TypeError("Cannot convert a Symbol value to a String");return String(e)}function _e(e){const t=qe(e);if(0===t)return 0;if(Number.isNaN(t)||t===1/0||t===-1/0)throw new RangeError("invalid number value");const n=Math.trunc(t);return 0===n?0:n}function Je(e,t){const n=_e(e);if(n<=0){if(void 0!==t)throw new RangeError(`property '${t}' cannot be a a number less than one`);throw new RangeError("Cannot convert a number less than one to a positive integer")}return n}function Ge(e){const t=qe(e);if(Number.isNaN(t))throw new RangeError("not a number");if(t===1/0||t===-1/0)throw new RangeError("infinity is out of range");if(!function(e){if("number"!=typeof e||Number.isNaN(e)||e===1/0||e===-1/0)return!1;const t=Math.abs(e);return Math.floor(t)===t}(t))throw new RangeError(`unsupported fractional value ${e}`);return 0===t?0:t}function Ke(e,t){return String(e).padStart(t,"0")}function Ve(e){if("string"!=typeof e)throw new TypeError(`expected a string, not ${String(e)}`);return e}function Xe(e,t){if(Ae(e)){const t=e?.toString();if("string"==typeof t||"number"==typeof t)return t;throw new TypeError("Cannot convert object to primitive value")}return e}const Qe=["era","eraYear","year","month","monthCode","day","hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],et={era:We,eraYear:_e,year:_e,month:Je,monthCode:function(e){const t=Ve(Xe(e));if(t.length<3||t.length>4||"M"!==t[0]||-1==="0123456789".indexOf(t[1])||-1==="0123456789".indexOf(t[2])||t[1]+t[2]==="00"&&"L"!==t[3]||"L"!==t[3]&&void 0!==t[3])throw new RangeError(`bad month code ${t}; must match M01-M99 or M00L-M99L`);return t},day:Je,hour:_e,minute:_e,second:_e,millisecond:_e,microsecond:_e,nanosecond:_e,offset:function(e){const t=Ve(Xe(e));return sr(t),t},timeZone:Bn},tt={hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},nt=[["years","year","date"],["months","month","date"],["weeks","week","date"],["days","day","date"],["hours","hour","time"],["minutes","minute","time"],["seconds","second","time"],["milliseconds","millisecond","time"],["microseconds","microsecond","time"],["nanoseconds","nanosecond","time"]],rt=Object.fromEntries(nt.map((e=>[e[0],e[1]]))),ot=Object.fromEntries(nt.map((([e,t])=>[t,e]))),it=nt.map((([,e])=>e)),at={day:Se,hour:36e11,minute:6e10,second:1e9,millisecond:1e6,microsecond:1e3,nanosecond:1},st=["days","hours","microseconds","milliseconds","minutes","months","nanoseconds","seconds","weeks","years"],ct=Intl.DateTimeFormat,dt=new Map;function ht(e){const t=Ao(e);let n=dt.get(t);return void 0===n&&(n=new ct("en-us",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),dt.set(t,n)),n}function ut(e){return ne(e,b)&&!ne(e,$,E)}function lt(e){return ne(e,Y,R,j,k,N,x,L,P,U)}function mt(e){return ne(e,I)}function ft(e){return ne(e,M)}function yt(e){return ne(e,T)}function pt(e){return ne(e,C)}function gt(e){return ne(e,O)}function wt(e){return ne(e,b,$,E)}function vt(e,t){if(!t(e))throw new TypeError("invalid receiver: method called with the wrong type of this-object")}function bt(e){if(ne(e,E)||ne(e,$))throw new TypeError("with() does not support a calendar or timeZone property");if(ft(e))throw new TypeError("with() does not accept Temporal.PlainTime, use withPlainTime() instead");if(void 0!==e.calendar)throw new TypeError("with() does not support a calendar property");if(void 0!==e.timeZone)throw new TypeError("with() does not support a timeZone property")}function Dt(e,t){return"never"===t||"auto"===t&&"iso8601"===e?"":`[${"critical"===t?"!":""}u-ca=${e}]`}function Tt(e){let t,n,r=!1;for(Te.lastIndex=0;n=Te.exec(e);){const{1:o,2:i,3:a}=n;if("u-ca"===i){if(void 0===t)t=a,r="!"===o;else if("!"===o||r)throw new RangeError(`Invalid annotations in ${e}: more than one u-ca present with critical flag`)}else if("!"===o)throw new RangeError(`Unrecognized annotation: !${i}=${a}`)}return t}function Mt(e){const t=Me.exec(e);if(!t)throw new RangeError(`invalid RFC 9557 string: ${e}`);const n=Tt(t[16]);let r=t[1];if("-000000"===r)throw new RangeError(`invalid RFC 9557 string: ${e}`);const o=+r,i=+(t[2]??t[4]??1),a=+(t[3]??t[5]??1),s=void 0!==t[6],c=+(t[6]??0),d=+(t[7]??t[10]??0);let h=+(t[8]??t[11]??0);60===h&&(h=59);const u=(t[9]??t[12]??"")+"000000000",l=+u.slice(0,3),m=+u.slice(3,6),f=+u.slice(6,9);let y,p=!1;t[13]?(y=void 0,p=!0):t[14]&&(y=t[14]);const g=t[15];return Ur(o,i,a,c,d,h,l,m,f),{year:o,month:i,day:a,time:s?{hour:c,minute:d,second:h,millisecond:l,microsecond:m,nanosecond:f}:"start-of-day",tzAnnotation:g,offset:y,z:p,calendar:n}}function Et(e){const t=Ee.exec(e);let n,r,o,i,a,s,c;if(t){c=Tt(t[10]),n=+(t[1]??0),r=+(t[2]??t[5]??0),o=+(t[3]??t[6]??0),60===o&&(o=59);const e=(t[4]??t[7]??"")+"000000000";if(i=+e.slice(0,3),a=+e.slice(3,6),s=+e.slice(6,9),t[8])throw new RangeError("Z designator not supported for PlainTime")}else{let t,d;if(({time:t,z:d,calendar:c}=Mt(e)),"start-of-day"===t)throw new RangeError(`time is missing in string: ${e}`);if(d)throw new RangeError("Z designator not supported for PlainTime");({hour:n,minute:r,second:o,millisecond:i,microsecond:a,nanosecond:s}=t)}if(Pr(n,r,o,i,a,s),/[tT ][0-9][0-9]/.test(e))return{hour:n,minute:r,second:o,millisecond:i,microsecond:a,nanosecond:s,calendar:c};try{const{month:t,day:n}=Ct(e);xr(1972,t,n)}catch{try{const{year:t,month:n}=It(e);xr(t,n,1)}catch{return{hour:n,minute:r,second:o,millisecond:i,microsecond:a,nanosecond:s,calendar:c}}}throw new RangeError(`invalid RFC 9557 time-only string ${e}; may need a T prefix`)}function It(e){const t=Ie.exec(e);let n,r,o,i;if(t){o=Tt(t[3]);let a=t[1];if("-000000"===a)throw new RangeError(`invalid RFC 9557 string: ${e}`);if(n=+a,r=+t[2],i=1,void 0!==o&&"iso8601"!==o)throw new RangeError("YYYY-MM format is only valid with iso8601 calendar")}else{let t;if(({year:n,month:r,calendar:o,day:i,z:t}=Mt(e)),t)throw new RangeError("Z designator not supported for PlainYearMonth")}return{year:n,month:r,calendar:o,referenceISODay:i}}function Ct(e){const t=Ce.exec(e);let n,r,o,i;if(t){if(o=Tt(t[3]),n=+t[1],r=+t[2],void 0!==o&&"iso8601"!==o)throw new RangeError("MM-DD format is only valid with iso8601 calendar")}else{let t;if(({month:n,day:r,calendar:o,year:i,z:t}=Mt(e)),t)throw new RangeError("Z designator not supported for PlainMonthDay")}return{month:n,day:r,calendar:o,referenceISOYear:i}}const Ot=new RegExp(`^${fe.source}$`,"i"),$t=new RegExp(`^${/([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])?)?/.source}$`);function Yt(e){const t=Wo.test(e)?"Seconds not allowed in offset time zone":"Invalid time zone";throw new RangeError(`${t}: ${e}`)}function Rt(e){return Ot.test(e)||Yt(e),$t.test(e)?{offsetMinutes:sr(e)/6e10}:{tzName:e}}function St(e,t,n,r){let o=e,i=t,a=n;switch(r){case"reject":xr(o,i,a);break;case"constrain":({year:o,month:i,day:a}=kr(o,i,a))}return{year:o,month:i,day:a}}function jt(e,t,n,r,o,i,a){let s=e,c=t,d=n,h=r,u=o,l=i;switch(a){case"reject":Pr(s,c,d,h,u,l);break;case"constrain":s=jr(s,0,23),c=jr(c,0,59),d=jr(d,0,59),h=jr(h,0,999),u=jr(u,0,999),l=jr(l,0,999)}return{hour:s,minute:c,second:d,millisecond:h,microsecond:u,nanosecond:l}}function kt(e){if(!Ae(e))throw new TypeError("invalid duration-like");const t={years:void 0,months:void 0,weeks:void 0,days:void 0,hours:void 0,minutes:void 0,seconds:void 0,milliseconds:void 0,microseconds:void 0,nanoseconds:void 0};let n=!1;for(let r=0;r<st.length;r++){const o=st[r],i=e[o];void 0!==i&&(n=!0,t[o]=Ge(i))}if(!n)throw new TypeError("invalid duration-like");return t}function Nt({years:e,months:t,weeks:n,days:r},o,i,a){return{years:e,months:a??t,weeks:i??n,days:o??r}}function xt(e,t){return{isoDate:e,time:t}}function Lt(e){return Ho(e,"overflow",["constrain","reject"],"constrain")}function Pt(e){return Ho(e,"disambiguation",["compatible","earlier","later","reject"],"compatible")}function Ut(e,t){return Ho(e,"roundingMode",["ceil","floor","expand","trunc","halfCeil","halfFloor","halfExpand","halfTrunc","halfEven"],t)}function Bt(e,t){return Ho(e,"offset",["prefer","use","ignore","reject"],t)}function Zt(e){return Ho(e,"calendarName",["auto","always","never","critical"],"auto")}function Ft(e){let t=e.roundingIncrement;if(void 0===t)return 1;const n=_e(t);if(n<1||n>1e9)throw new RangeError(`roundingIncrement must be at least 1 and at most 1e9, not ${t}`);return n}function Ht(e,t,n){const r=n?t:t-1;if(e>r)throw new RangeError(`roundingIncrement must be at least 1 and less than ${r}, not ${e}`);if(t%e!=0)throw new RangeError(`Rounding increment must divide evenly into ${t}`)}function zt(e){const t=e.fractionalSecondDigits;if(void 0===t)return"auto";if("number"!=typeof t){if("auto"!==We(t))throw new RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`);return"auto"}const n=Math.floor(t);if(!Number.isFinite(n)||n<0||n>9)throw new RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`);return n}function At(e,t){switch(e){case"minute":return{precision:"minute",unit:"minute",increment:1};case"second":return{precision:0,unit:"second",increment:1};case"millisecond":return{precision:3,unit:"millisecond",increment:1};case"microsecond":return{precision:6,unit:"microsecond",increment:1};case"nanosecond":return{precision:9,unit:"nanosecond",increment:1}}switch(t){case"auto":return{precision:t,unit:"nanosecond",increment:1};case 0:return{precision:t,unit:"second",increment:1};case 1:case 2:case 3:return{precision:t,unit:"millisecond",increment:10**(3-t)};case 4:case 5:case 6:return{precision:t,unit:"microsecond",increment:10**(6-t)};case 7:case 8:case 9:return{precision:t,unit:"nanosecond",increment:10**(9-t)};default:throw new RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`)}}const qt=Symbol("~required~");function Wt(e,t,n,r,o=[]){let i=[];for(let e=0;e<nt.length;e++){const t=nt[e],r=t[1],o=t[2];"datetime"!==n&&n!==o||i.push(r)}i=i.concat(o);let a=r;a===qt?a=void 0:void 0!==a&&i.push(a);let s=[];s=s.concat(i);for(let e=0;e<i.length;e++){const t=i[e],n=ot[t];void 0!==n&&s.push(n)}let c=Ho(e,t,s,a);if(void 0===c&&r===qt)throw new RangeError(`${t} is required`);return c&&c in rt?rt[c]:c}function _t(e){const t=e.relativeTo;if(void 0===t)return{};let n,r,o,i,a,s="option",c=!1;if(Ae(t)){if(wt(t))return{zonedRelativeTo:t};if(mt(t))return{plainRelativeTo:t};if(yt(t))return{plainRelativeTo:pn(re(t,T).isoDate,re(t,E))};o=Nn(t);const e=tn(o,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],[]);({isoDate:n,time:r}=on(o,e,"constrain")),({offset:a,timeZone:i}=e),void 0===a&&(s="wall")}else{let e,d,h,u,l;if(({year:h,month:u,day:l,time:r,calendar:o,tzAnnotation:e,offset:a,z:d}=Mt(Ve(t))),e)i=Bn(e),d?s="exact":a||(s="wall"),c=!0;else if(d)throw new RangeError("Z designator not supported for PlainDate relativeTo; either remove the Z or add a bracketed time zone");o||(o="iso8601"),o=zo(o),n={year:h,month:u,day:l}}return void 0===i?{plainRelativeTo:pn(n,o)}:{zonedRelativeTo:$n(mn(n,r,s,"option"===s?sr(a):0,i,"compatible","reject",c),i,o)}}function Jt(e){return 0!==re(e,Y)?"year":0!==re(e,R)?"month":0!==re(e,S)?"week":0!==re(e,j)?"day":0!==re(e,k)?"hour":0!==re(e,N)?"minute":0!==re(e,x)?"second":0!==re(e,L)?"millisecond":0!==re(e,P)?"microsecond":"nanosecond"}function Gt(e,t){return it.indexOf(e)>it.indexOf(t)?t:e}function Kt(e){return"year"===e||"month"===e||"week"===e}function Vt(e){return Kt(e)||"day"===e?"date":"time"}function Xt(e){return ce("%calendarImpl%")(e)}function Qt(e){return ce("%calendarImpl%")(re(e,E))}function en(e,t,n="date"){const r=Object.create(null),o=Xt(e).isoToDate(t,{year:!0,monthCode:!0,day:!0});return r.monthCode=o.monthCode,"month-day"!==n&&"date"!==n||(r.day=o.day),"year-month"!==n&&"date"!==n||(r.year=o.year),r}function tn(e,t,n,r,o){const i=Xt(e).extraFields(n),a=n.concat(r,i),s=Object.create(null);let c=!1;a.sort();for(let e=0;e<a.length;e++){const n=a[e],r=t[n];if(void 0!==r)c=!0,s[n]=(0,et[n])(r);else if("partial"!==o){if(o.includes(n))throw new TypeError(`required property '${n}' missing or undefined`);s[n]=tt[n]}}if("partial"===o&&!c)throw new TypeError("no supported properties found");return s}function nn(e,t="complete"){const n=["hour","microsecond","millisecond","minute","nanosecond","second"];let r=!1;const o=Object.create(null);for(let i=0;i<n.length;i++){const a=n[i],s=e[a];void 0!==s?(o[a]=_e(s),r=!0):"complete"===t&&(o[a]=0)}if(!r)throw new TypeError("invalid time-like");return o}function rn(e,t){if(Ae(e)){if(mt(e))return Lt(Zo(t)),pn(re(e,D),re(e,E));if(wt(e)){const n=zn(re(e,$),re(e,b));return Lt(Zo(t)),pn(n.isoDate,re(e,E))}if(yt(e))return Lt(Zo(t)),pn(re(e,T).isoDate,re(e,E));const n=Nn(e);return pn(Ln(n,tn(n,e,["year","month","monthCode","day"],[],[]),Lt(Zo(t))),n)}let{year:n,month:r,day:o,calendar:i,z:a}=Mt(Ve(e));if(a)throw new RangeError("Z designator not supported for PlainDate");return i||(i="iso8601"),i=zo(i),Lt(Zo(t)),pn({year:n,month:r,day:o},i)}function on(e,t,n){return xt(Ln(e,t,n),jt(t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond,n))}function an(e,t){let n,r,o;if(Ae(e)){if(yt(e))return Lt(Zo(t)),wn(re(e,T),re(e,E));if(wt(e)){const n=zn(re(e,$),re(e,b));return Lt(Zo(t)),wn(n,re(e,E))}if(mt(e))return Lt(Zo(t)),wn(xt(re(e,D),{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),re(e,E));o=Nn(e);const i=tn(o,e,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond"],[]),a=Lt(Zo(t));({isoDate:n,time:r}=on(o,i,a))}else{let i,a,s,c;if(({year:a,month:s,day:c,time:r,calendar:o,z:i}=Mt(Ve(e))),i)throw new RangeError("Z designator not supported for PlainDateTime");"start-of-day"===r&&(r={deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),Ur(a,s,c,r.hour,r.minute,r.second,r.millisecond,r.microsecond,r.nanosecond),o||(o="iso8601"),o=zo(o),Lt(Zo(t)),n={year:a,month:s,day:c}}return wn(xt(n,r),o)}function sn(e){const t=ce("%Temporal.Duration%");if(lt(e))return new t(re(e,Y),re(e,R),re(e,S),re(e,j),re(e,k),re(e,N),re(e,x),re(e,L),re(e,P),re(e,U));if(!Ae(e))return function(e){const{years:t,months:n,weeks:r,days:o,hours:i,minutes:a,seconds:s,milliseconds:c,microseconds:d,nanoseconds:h}=function(e){const t=Ye.exec(e);if(!t)throw new RangeError(`invalid duration: ${e}`);if(t.every(((e,t)=>t<2||void 0===e)))throw new RangeError(`invalid duration: ${e}`);const n="-"===t[1]?-1:1,r=void 0===t[2]?0:_e(t[2])*n,o=void 0===t[3]?0:_e(t[3])*n,i=void 0===t[4]?0:_e(t[4])*n,a=void 0===t[5]?0:_e(t[5])*n,s=void 0===t[6]?0:_e(t[6])*n,c=t[7],d=t[8],h=t[9],u=t[10],l=t[11];let m=0,f=0,y=0;if(void 0!==c){if(d??h??u??l)throw new RangeError("only the smallest unit can be fractional");y=3600*_e((c+"000000000").slice(0,9))*n}else if(m=void 0===d?0:_e(d)*n,void 0!==h){if(u??l)throw new RangeError("only the smallest unit can be fractional");y=60*_e((h+"000000000").slice(0,9))*n}else f=void 0===u?0:_e(u)*n,void 0!==l&&(y=_e((l+"000000000").slice(0,9))*n);const p=y%1e3,g=Math.trunc(y/1e3)%1e3,w=Math.trunc(y/1e6)%1e3;return f+=Math.trunc(y/1e9)%60,m+=Math.trunc(y/6e10),zr(r,o,i,a,s,m,f,w,g,p),{years:r,months:o,weeks:i,days:a,hours:s,minutes:m,seconds:f,milliseconds:w,microseconds:g,nanoseconds:p}}(e);return new(ce("%Temporal.Duration%"))(t,n,r,o,i,a,s,c,d,h)}(Ve(e));const n={years:0,months:0,weeks:0,days:0,hours:0,minutes:0,seconds:0,milliseconds:0,microseconds:0,nanoseconds:0};let r=kt(e);for(let e=0;e<st.length;e++){const t=st[e],o=r[t];void 0!==o&&(n[t]=o)}return new t(n.years,n.months,n.weeks,n.days,n.hours,n.minutes,n.seconds,n.milliseconds,n.microseconds,n.nanoseconds)}function cn(e){let t;if(Ae(e)){if(ut(e)||wt(e))return Cn(re(e,b));t=Xe(e)}else t=e;const{year:n,month:r,day:o,time:i,offset:a,z:s}=function(e){const t=Mt(e);if(!t.z&&!t.offset)throw new RangeError("Temporal.Instant requires a time zone offset");return t}(Ve(t)),{hour:c=0,minute:d=0,second:h=0,millisecond:u=0,microsecond:l=0,nanosecond:m=0}="start-of-day"===i?{}:i,f=$r(n,r,o,c,d,h,u,l,m-(s?0:sr(a)));return Kr(f.isoDate),Cn(pr(f))}function dn(e,t){if(Ae(e)){if(gt(e))return Lt(Zo(t)),bn(re(e,D),re(e,E));let n;return ne(e,E)?n=re(e,E):(n=e.calendar,void 0===n&&(n="iso8601"),n=kn(n)),bn(Un(n,tn(n,e,["year","month","monthCode","day"],[],[]),Lt(Zo(t))),n)}let{month:n,day:r,referenceISOYear:o,calendar:i}=Ct(Ve(e));if(void 0===i&&(i="iso8601"),i=zo(i),Lt(Zo(t)),"iso8601"===i)return bn({year:1972,month:n,day:r},i);let a={year:o,month:n,day:r};return Lr(a),a=Un(i,en(i,a,"month-day"),"constrain"),bn(a,i)}function hn(e,t){let n;if(Ae(e)){if(ft(e))return Lt(Zo(t)),Tn(re(e,M));if(yt(e))return Lt(Zo(t)),Tn(re(e,T).time);if(wt(e)){const n=zn(re(e,$),re(e,b));return Lt(Zo(t)),Tn(n.time)}const{hour:r,minute:o,second:i,millisecond:a,microsecond:s,nanosecond:c}=nn(e);n=jt(r,o,i,a,s,c,Lt(Zo(t)))}else n=Et(Ve(e)),Lt(Zo(t));return Tn(n)}function un(e){return void 0===e?{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}:re(hn(e),M)}function ln(e,t){if(Ae(e)){if(pt(e))return Lt(Zo(t)),En(re(e,D),re(e,E));const n=Nn(e);return En(Pn(n,tn(n,e,["year","month","monthCode"],[],[]),Lt(Zo(t))),n)}let{year:n,month:r,referenceISODay:o,calendar:i}=It(Ve(e));void 0===i&&(i="iso8601"),i=zo(i),Lt(Zo(t));let a={year:n,month:r,day:o};return Hr(a),a=Pn(i,en(i,a,"year-month"),"constrain"),En(a,i)}function mn(t,n,r,o,i,a,s,c){if("start-of-day"===n)return _n(i,t);const d=xt(t,n);if("wall"===r||"ignore"===s)return An(i,d,a);if("exact"===r||"use"===s){const e=$r(t.year,t.month,t.day,n.hour,n.minute,n.second,n.millisecond,n.microsecond,n.nanosecond-o);Kr(e.isoDate);const r=pr(e);return Fr(r),r}Kr(t);const h=pr(d),u=Wn(i,d);for(let t=0;t<u.length;t++){const n=u[t],r=e.toNumber(e.subtract(h,n)),i=Eo(r,6e10,"halfExpand");if(r===o||c&&i===o)return n}if("reject"===s){const e=Hn(o),t=nr(d,"iso8601","auto");throw new RangeError(`Offset ${e} is invalid for ${t} in ${i}`)}return qn(u,i,d,a)}function fn(e,t){let n,r,o,i,a,s,c,d=!1,h="option";if(Ae(e)){if(wt(e)){const n=Zo(t);return Pt(n),Bt(n,"reject"),Lt(n),$n(re(e,b),re(e,$),re(e,E))}a=Nn(e);const d=tn(a,e,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],["timeZone"]);({offset:i,timeZone:o}=d),void 0===i&&(h="wall");const u=Zo(t);s=Pt(u),c=Bt(u,"reject");const l=Lt(u);({isoDate:n,time:r}=on(a,d,l))}else{let u,l,m,f,y;({year:m,month:f,day:y,time:r,tzAnnotation:u,offset:i,z:l,calendar:a}=function(e){const t=Mt(e);if(!t.tzAnnotation)throw new RangeError("Temporal.ZonedDateTime requires a time zone ID in brackets");return t}(Ve(e))),o=Bn(u),l?h="exact":i||(h="wall"),a||(a="iso8601"),a=zo(a),d=!0;const p=Zo(t);s=Pt(p),c=Bt(p,"reject"),Lt(p),n={year:m,month:f,day:y}}let u=0;return"option"===h&&(u=sr(i)),$n(mn(n,r,h,u,o,s,c,d),o,a)}function yn(e,t,n){Lr(t),te(e),oe(e,D,t),oe(e,E,n),oe(e,I,!0)}function pn(e,t){const n=ce("%Temporal.PlainDate%"),r=Object.create(n.prototype);return yn(r,e,t),r}function gn(e,t,n){Br(t),te(e),oe(e,T,t),oe(e,E,n)}function wn(e,t){const n=ce("%Temporal.PlainDateTime%"),r=Object.create(n.prototype);return gn(r,e,t),r}function vn(e,t,n){Lr(t),te(e),oe(e,D,t),oe(e,E,n),oe(e,O,!0)}function bn(e,t){const n=ce("%Temporal.PlainMonthDay%"),r=Object.create(n.prototype);return vn(r,e,t),r}function Dn(e,t){te(e),oe(e,M,t)}function Tn(e){const t=ce("%Temporal.PlainTime%"),n=Object.create(t.prototype);return Dn(n,e),n}function Mn(e,t,n){Hr(t),te(e),oe(e,D,t),oe(e,E,n),oe(e,C,!0)}function En(e,t){const n=ce("%Temporal.PlainYearMonth%"),r=Object.create(n.prototype);return Mn(r,e,t),r}function In(e,t){Fr(t),te(e),oe(e,b,t)}function Cn(e){const t=ce("%Temporal.Instant%"),n=Object.create(t.prototype);return In(n,e),n}function On(e,t,n,r){Fr(t),te(e),oe(e,b,t),oe(e,$,n),oe(e,E,r)}function $n(e,t,n="iso8601"){const r=ce("%Temporal.ZonedDateTime%"),o=Object.create(r.prototype);return On(o,e,t,n),o}function Yn(e){return Qe.filter((t=>void 0!==e[t]))}function Rn(e,t,n){const r=Yn(n),o=Xt(e).fieldKeysToIgnore(r),i=Object.create(null),a=Yn(t);for(let e=0;e<Qe.length;e++){let s;const c=Qe[e];a.includes(c)&&!o.includes(c)&&(s=t[c]),r.includes(c)&&(s=n[c]),void 0!==s&&(i[c]=s)}return i}function Sn(e,t,n,r){const o=Xt(e).dateAdd(t,n,r);return Lr(o),o}function jn(e,t,n,r){return Xt(e).dateUntil(t,n,r)}function kn(e){if(Ae(e)&&ne(e,E))return re(e,E);const t=Ve(e);try{return zo(t)}catch{}let n;try{({calendar:n}=Mt(t))}catch{try{({calendar:n}=Et(t))}catch{try{({calendar:n}=It(t))}catch{({calendar:n}=Ct(t))}}}return n||(n="iso8601"),zo(n)}function Nn(e){if(ne(e,E))return re(e,E);const{calendar:t}=e;return void 0===t?"iso8601":kn(t)}function xn(e,t){return zo(e)===zo(t)}function Ln(e,t,n){const r=Xt(e);r.resolveFields(t,"date");const o=r.dateToISO(t,n);return Lr(o),o}function Pn(e,t,n){const r=Xt(e);r.resolveFields(t,"year-month"),t.day=1;const o=r.dateToISO(t,n);return Hr(o),o}function Un(e,t,n){const r=Xt(e);r.resolveFields(t,"month-day");const o=r.monthDayToISOReferenceDate(t,n);return Lr(o),o}function Bn(e){if(Ae(e)&&wt(e))return re(e,$);const t=Ve(e);if("UTC"===t)return"UTC";const{tzName:n,offsetMinutes:r}=function(e){const{tzAnnotation:t,offset:n,z:r}=function(e){if(Ot.test(e))return{tzAnnotation:e,offset:void 0,z:!1};try{const{tzAnnotation:t,offset:n,z:r}=Mt(e);if(r||t||n)return{tzAnnotation:t,offset:n,z:r}}catch{}Yt(e)}(e);return t?Rt(t):r?Rt("UTC"):n?Rt(n):void 0}(t);if(void 0!==r)return mr(r);const o=hr(n);if(!o)throw new RangeError(`Unrecognized time zone ${n}`);return o.identifier}function Zn(e,t){if(e===t)return!0;const n=Rt(e).offsetMinutes,r=Rt(t).offsetMinutes;if(void 0===n&&void 0===r){const n=hr(t);if(!n)return!1;const r=hr(e);return!!r&&r.primaryIdentifier===n.primaryIdentifier}return n===r}function Fn(e,t){const n=Rt(e).offsetMinutes;return void 0!==n?6e10*n:lr(e,t)}function Hn(e){const t=e<0?"-":"+",n=Math.abs(e),r=Math.floor(n/36e11),o=Math.floor(n/6e10)%60,i=Math.floor(n/1e9)%60,a=n%1e9;return`${t}${Vn(r,o,i,a,0===i&&0===a?"minute":"auto")}`}function zn(e,t){const n=Fn(e,t);let{isoDate:{year:r,month:o,day:i},time:{hour:a,minute:s,second:c,millisecond:d,microsecond:h,nanosecond:u}}=gr(t);return $r(r,o,i,a,s,c,d,h,u+n)}function An(e,t,n){return qn(Wn(e,t),e,t,n)}function qn(t,n,r,o){const i=t.length;if(1===i)return t[0];if(i)switch(o){case"compatible":case"earlier":return t[0];case"later":return t[i-1];case"reject":throw new RangeError("multiple instants found")}if("reject"===o)throw new RangeError("multiple instants found");const a=pr(r),s=e.subtract(a,l);Fr(s);const c=Fn(n,s),d=e.add(a,l);Fr(d);const h=Fn(n,d)-c;switch(o){case"earlier":{const e=TimeDuration.fromComponents(0,0,0,0,0,-h),t=fo(r.time,e);return Wn(n,xt(Or(r.isoDate.year,r.isoDate.month,r.isoDate.day+t.deltaDays),t))[0]}case"compatible":case"later":{const e=TimeDuration.fromComponents(0,0,0,0,0,h),t=fo(r.time,e),o=Wn(n,xt(Or(r.isoDate.year,r.isoDate.month,r.isoDate.day+t.deltaDays),t));return o[o.length-1]}}}function Wn(t,n){if("UTC"===t)return Kr(n.isoDate),[pr(n)];const r=Rt(t).offsetMinutes;if(void 0!==r){const e=$r(n.isoDate.year,n.isoDate.month,n.isoDate.day,n.time.hour,n.time.minute-r,n.time.second,n.time.millisecond,n.time.microsecond,n.time.nanosecond);Kr(e.isoDate);const t=pr(e);return Fr(t),[t]}return Kr(n.isoDate),function(t,n){let r=pr(n),o=e.subtract(r,l);e.lessThan(o,xe)&&(o=r);let i=e.add(r,l);e.greaterThan(i,Ne)&&(i=r);const a=lr(t,o),s=lr(t,i),c=(a===s?[a]:[a,s]).map((o=>{const i=e.subtract(r,e.BigInt(o)),a=function(e,t){const{epochMilliseconds:n,time:{millisecond:r,microsecond:o,nanosecond:i}}=gr(t),{year:a,month:s,day:c,hour:d,minute:h,second:u}=br(e,n);return $r(a,s,c,d,h,u,r,o,i)}(t,i);if(0===jo(n,a))return Fr(i),i}));return c.filter((e=>void 0!==e))}(t,n)}function _n(t,n){const r=xt(n,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),o=Wn(t,r);if(o.length)return o[0];const i=pr(r),a=e.subtract(i,l);return Fr(a),wr(t,a)}function Jn(e){let t;return t=e<0||e>9999?(e<0?"-":"+")+Ke(Math.abs(e),6):Ke(e,4),t}function Gn(e){return Ke(e,2)}function Kn(e,t){let n;if("auto"===t){if(0===e)return"";n=Ke(e,9).replace(/0+$/,"")}else{if(0===t)return"";n=Ke(e,9).slice(0,t)}return`.${n}`}function Vn(e,t,n,r,o){let i=`${Gn(e)}:${Gn(t)}`;return"minute"===o||(i+=`:${Gn(n)}`,i+=Kn(r,o)),i}function Xn(e,t,n){let r=t;void 0===r&&(r="UTC");const o=re(e,b),i=nr(zn(r,o),"iso8601",n,"never");let a="Z";return void 0!==t&&(a=fr(Fn(r,o))),`${i}${a}`}function Qn(e,t){const n=re(e,Y),r=re(e,R),o=re(e,S),i=re(e,j),a=re(e,k),s=re(e,N),c=Mr(e);let d="";0!==n&&(d+=`${Math.abs(n)}Y`),0!==r&&(d+=`${Math.abs(r)}M`),0!==o&&(d+=`${Math.abs(o)}W`),0!==i&&(d+=`${Math.abs(i)}D`);let h="";0!==a&&(h+=`${Math.abs(a)}H`),0!==s&&(h+=`${Math.abs(s)}M`);const u=TimeDuration.fromComponents(0,0,re(e,x),re(e,L),re(e,P),re(e,U));u.isZero()&&!["second","millisecond","microsecond","nanosecond"].includes(Jt(e))&&"auto"===t||(h+=`${Math.abs(u.sec)}${Kn(Math.abs(u.subsec),t)}S`);let l=`${c<0?"-":""}P${d}`;return h&&(l=`${l}T${h}`),l}function er(e,t="auto"){const{year:n,month:r,day:o}=re(e,D);return`${Jn(n)}-${Gn(r)}-${Gn(o)}${Dt(re(e,E),t)}`}function tr({hour:e,minute:t,second:n,millisecond:r,microsecond:o,nanosecond:i},a){return Vn(e,t,n,1e6*r+1e3*o+i,a)}function nr(e,t,n,r="auto"){const{isoDate:{year:o,month:i,day:a},time:{hour:s,minute:c,second:d,millisecond:h,microsecond:u,nanosecond:l}}=e;return`${Jn(o)}-${Gn(i)}-${Gn(a)}T${Vn(s,c,d,1e6*h+1e3*u+l,n)}${Dt(t,r)}`}function rr(e,t="auto"){const{year:n,month:r,day:o}=re(e,D);let i=`${Gn(r)}-${Gn(o)}`;const a=re(e,E);"always"!==t&&"critical"!==t&&"iso8601"===a||(i=`${Jn(n)}-${i}`);const s=Dt(a,t);return s&&(i+=s),i}function or(e,t="auto"){const{year:n,month:r,day:o}=re(e,D);let i=`${Jn(n)}-${Gn(r)}`;const a=re(e,E);"always"!==t&&"critical"!==t&&"iso8601"===a||(i+=`-${Gn(o)}`);const s=Dt(a,t);return s&&(i+=s),i}function ir(e,t,n="auto",r="auto",o="auto",i=void 0){let a=re(e,b);if(i){const{unit:e,increment:t,roundingMode:n}=i;a=Io(a,t,e,n)}const s=re(e,$),c=Fn(s,a);let d=nr(zn(s,a),"iso8601",t,"never");return"never"!==o&&(d+=fr(c)),"never"!==r&&(d+=`[${"critical"===r?"!":""}${s}]`),d+=Dt(re(e,E),n),d}function ar(e){return $t.test(e)}function sr(e){const t=_o.exec(e);if(!t)throw new RangeError(`invalid time zone offset: ${e}; must match ±HH:MM[:SS.SSSSSSSSS]`);return("-"===t[1]?-1:1)*(1e9*(60*(60*+t[2]+ +(t[3]||0))+ +(t[4]||0))+ +((t[5]||0)+"000000000").slice(0,9))}let cr;const dr=Object.assign(Object.create(null),{"/":!0,"-":!0,_:!0});function hr(e){if(void 0===cr){const e=Intl.supportedValuesOf?.("timeZone");if(e){cr=new Map;for(let t=0;t<e.length;t++){const n=e[t];cr.set(Ao(n),n)}}else cr=null}const t=Ao(e);let n=cr?.get(t);if(n)return{identifier:n,primaryIdentifier:n};try{n=ht(e).resolvedOptions().timeZone}catch{return}if("antarctica/south_pole"===t&&(n="Antarctica/McMurdo"),ze.has(e))throw new RangeError(`${e} is a legacy time zone identifier from ICU. Use ${n} instead`);const r=[...t].map(((e,n)=>0===n||dr[t[n-1]]?e.toUpperCase():e)).join("").split("/");if(1===r.length)return"gb-eire"===t?{identifier:"GB-Eire",primaryIdentifier:n}:{identifier:t.length<=3||/[-0-9]/.test(t)?t.toUpperCase():r[0],primaryIdentifier:n};if("Etc"===r[0])return{identifier:`Etc/${["Zulu","Greenwich","Universal"].includes(r[1])?r[1]:r[1].toUpperCase()}`,primaryIdentifier:n};if("Us"===r[0])return{identifier:`US/${r[1]}`,primaryIdentifier:n};const o=new Map([["Act","ACT"],["Lhi","LHI"],["Nsw","NSW"],["Dar_Es_Salaam","Dar_es_Salaam"],["Port_Of_Spain","Port_of_Spain"],["Port-Au-Prince","Port-au-Prince"],["Isle_Of_Man","Isle_of_Man"],["Comodrivadavia","ComodRivadavia"],["Knox_In","Knox_IN"],["Dumontdurville","DumontDUrville"],["Mcmurdo","McMurdo"],["Denoronha","DeNoronha"],["Easterisland","EasterIsland"],["Bajanorte","BajaNorte"],["Bajasur","BajaSur"]]);return r[1]=o.get(r[1])??r[1],r.length>2&&(r[2]=o.get(r[2])??r[2]),{identifier:r.join("/"),primaryIdentifier:n}}function ur(e,t){const{year:n,month:r,day:o,hour:i,minute:a,second:s}=br(e,t);let c=t%1e3;return c<0&&(c+=1e3),1e6*(yr({isoDate:{year:n,month:r,day:o},time:{hour:i,minute:a,second:s,millisecond:c}})-t)}function lr(e,t){return ur(e,No(t,"floor"))}function mr(e){const t=e<0?"-":"+",n=Math.abs(e);return`${t}${Vn(Math.floor(n/60),n%60,0,0,"minute")}`}function fr(e){return mr(Eo(e,je,"halfExpand")/6e10)}function yr({isoDate:{year:e,month:t,day:n},time:{hour:r,minute:o,second:i,millisecond:a}}){const s=e%400,c=(e-s)/400,d=new Date;return d.setUTCHours(r,o,i,a),d.setUTCFullYear(s,t-1,n),d.getTime()+Ue*c}function pr(t){const n=yr(t),r=1e3*t.time.microsecond+t.time.nanosecond;return e.add(xo(n),e.BigInt(r))}function gr(t){let n=No(t,"trunc"),r=e.toNumber(e.remainder(t,c));r<0&&(r+=1e6,n-=1);const o=Math.floor(r/1e3)%1e3,i=r%1e3,a=new Date(n);return{epochMilliseconds:n,isoDate:{year:a.getUTCFullYear(),month:a.getUTCMonth()+1,day:a.getUTCDate()},time:{hour:a.getUTCHours(),minute:a.getUTCMinutes(),second:a.getUTCSeconds(),millisecond:a.getUTCMilliseconds(),microsecond:o,nanosecond:i}}}function wr(e,t){if("UTC"===e)return null;const n=No(t,"floor");if(n<Fe)return wr(e,xo(Fe));const r=Date.now(),o=Math.max(n,r)+366*Re*3;let i=n,a=ur(e,i),s=i,c=a;for(;a===c&&i<o;){if(s=i+2*Re*7,s>ke)return null;c=ur(e,s),a===c&&(i=s)}return a===c?null:xo(Jo((t=>ur(e,t)),i,s,a,c))}function vr(t,n){if("UTC"===t)return null;const r=No(n,"ceil"),o=Date.now(),i=o+366*Re*3;if(r>i){const n=vr(t,xo(i));if(null===n||e.lessThan(n,xo(o)))return n}if("Africa/Casablanca"===t||"Africa/El_Aaiun"===t){const e=Date.UTC(2088,0,1);if(e<r)return vr(t,xo(e))}let a=r-1;if(a<Fe)return null;let s=ur(t,a),c=a,d=s;for(;s===d&&a>Fe;){if(c=a-2*Re*7,c<Fe)return null;d=ur(t,c),s===d&&(a=c)}return s===d?null:xo(Jo((e=>ur(t,e)),c,a,d,s))}function br(e,t){return function(e){const t=e.split(/[^\w]+/);if(7!==t.length)throw new RangeError(`expected 7 parts in "${e}`);const n=+t[0],r=+t[1];let o=+t[2];const i=t[3];if("b"===i[0]||"B"===i[0])o=1-o;else if("a"!==i[0]&&"A"!==i[0])throw new RangeError(`Unknown era ${i} in "${e}`);const a="24"===t[4]?0:+t[4],s=+t[5],c=+t[6];if(!(Number.isFinite(o)&&Number.isFinite(n)&&Number.isFinite(r)&&Number.isFinite(a)&&Number.isFinite(s)&&Number.isFinite(c)))throw new RangeError(`Invalid number in "${e}`);return{year:o,month:n,day:r,hour:a,minute:s,second:c}}(ht(e).format(t))}function Dr(e){return void 0!==e&&!(e%4!=0||e%100==0&&e%400!=0)}function Tr(e,t){return{standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]}[Dr(e)?"leapyear":"standard"][t-1]}function Mr(e){const t=[re(e,Y),re(e,R),re(e,S),re(e,j),re(e,k),re(e,N),re(e,x),re(e,L),re(e,P),re(e,U)];for(let e=0;e<t.length;e++){const n=t[e];if(0!==n)return n<0?-1:1}return 0}function Er(e){const t=["years","months","weeks","days"];for(let n=0;n<t.length;n++){const r=e[t[n]];if(0!==r)return r<0?-1:1}return 0}function Ir(e){const t=Er(e.date);return 0!==t?t:e.time.sign()}function Cr(e,t){let n=e,r=t;if(!Number.isFinite(n)||!Number.isFinite(r))throw new RangeError("infinity is out of range");return r-=1,n+=Math.floor(r/12),r%=12,r<0&&(r+=12),r+=1,{year:n,month:r}}function Or(e,t,n){let r=e,o=t,i=n;if(!Number.isFinite(i))throw new RangeError("infinity is out of range");({year:r,month:o}=Cr(r,o));const a=146097;if(Math.abs(i)>a){const e=Math.trunc(i/a);r+=400*e,i-=e*a}let s=0,c=o>2?r:r-1;for(;s=Dr(c)?366:365,i<-s;)r-=1,c-=1,i+=s;for(c+=1;s=Dr(c)?366:365,i>s;)r+=1,c+=1,i-=s;for(;i<1;)({year:r,month:o}=Cr(r,o-1)),i+=Tr(r,o);for(;i>Tr(r,o);)i-=Tr(r,o),({year:r,month:o}=Cr(r,o+1));return{year:r,month:o,day:i}}function $r(e,t,n,r,o,i,a,s,c){const d=Yr(r,o,i,a,s,c);return xt(Or(e,t,n+d.deltaDays),d)}function Yr(e,t,n,r,o,i){let a,s=e,c=t,d=n,h=r,u=o,l=i;({div:a,mod:l}=de(l,3)),u+=a,l<0&&(u-=1,l+=1e3),({div:a,mod:u}=de(u,3)),h+=a,u<0&&(h-=1,u+=1e3),d+=Math.trunc(h/1e3),h%=1e3,h<0&&(d-=1,h+=1e3),c+=Math.trunc(d/60),d%=60,d<0&&(c-=1,d+=60),s+=Math.trunc(c/60),c%=60,c<0&&(s-=1,c+=60);let m=Math.trunc(s/24);return s%=24,s<0&&(m-=1,s+=24),m+=0,s+=0,c+=0,d+=0,h+=0,u+=0,l+=0,{deltaDays:m,hour:s,minute:c,second:d,millisecond:h,microsecond:u,nanosecond:l}}function Rr(e,t){const n=Nt(e,0);if(0===Er(n))return e.days;const r=re(t,D),o=Sn(re(t,E),r,n,"constrain"),i=Gr(r.year,r.month-1,r.day),a=Gr(o.year,o.month-1,o.day)-i;return e.days+a}function Sr(e){return new(ce("%Temporal.Duration%"))(-re(e,Y),-re(e,R),-re(e,S),-re(e,j),-re(e,k),-re(e,N),-re(e,x),-re(e,L),-re(e,P),-re(e,U))}function jr(e,t,n){return Math.min(n,Math.max(t,e))}function kr(e,t,n){const r=jr(t,1,12);return{year:e,month:r,day:jr(n,1,Tr(e,r))}}function Nr(e,t,n){if(e<t||e>n)throw new RangeError(`value out of range: ${t} <= ${e} <= ${n}`)}function xr(e,t,n){Nr(t,1,12),Nr(n,1,Tr(e,t))}function Lr(e){Br(xt(e,{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}))}function Pr(e,t,n,r,o,i){Nr(e,0,23),Nr(t,0,59),Nr(n,0,59),Nr(r,0,999),Nr(o,0,999),Nr(i,0,999)}function Ur(e,t,n,r,o,i,a,s,c){xr(e,t,n),Pr(r,o,i,a,s,c)}function Br(t){const n=pr(t);(e.lessThan(n,Le)||e.greaterThan(n,Pe))&&Fr(n)}function Zr(e){pr(e)}function Fr(t){if(e.lessThan(t,xe)||e.greaterThan(t,Ne))throw new RangeError("date/time value is outside of supported range")}function Hr({year:e,month:t}){Nr(e,Be,Ze),e===Be?Nr(t,4,12):e===Ze&&Nr(t,1,9)}function zr(e,t,n,r,o,i,a,s,c,d){let h=0;const u=[e,t,n,r,o,i,a,s,c,d];for(let e=0;e<u.length;e++){const t=u[e];if(t===1/0||t===-1/0)throw new RangeError("infinite values not allowed as duration fields");if(0!==t){const e=t<0?-1:1;if(0!==h&&e!==h)throw new RangeError("mixed-sign values not allowed as duration fields");h=e}}if(Math.abs(e)>=2**32||Math.abs(t)>=2**32||Math.abs(n)>=2**32)throw new RangeError("years, months, and weeks must be < 2³²");const l=de(s,3),m=de(c,6),f=de(d,9),y=de(1e6*l.mod+1e3*m.mod+f.mod,9).div,p=86400*r+3600*o+60*i+a+l.div+m.div+f.div+y;if(!Number.isSafeInteger(p))throw new RangeError("total of duration time units cannot exceed 9007199254740991.999999999 s")}function Ar(e){return{date:{years:re(e,Y),months:re(e,R),weeks:re(e,S),days:re(e,j)},time:TimeDuration.fromComponents(re(e,k),re(e,N),re(e,x),re(e,L),re(e,P),re(e,U))}}function qr(e){const t=TimeDuration.fromComponents(re(e,k),re(e,N),re(e,x),re(e,L),re(e,P),re(e,U)).add24HourDays(re(e,j));return{date:{years:re(e,Y),months:re(e,R),weeks:re(e,S),days:0},time:t}}function Wr(e){const t=qr(e),n=Math.trunc(t.time.sec/86400);return zr(t.date.years,t.date.months,t.date.weeks,n,0,0,0,0,0,0),{...t.date,days:n}}function _r(e,t){const n=e.time.sign();let r=e.time.abs().subsec,o=0,i=0,a=e.time.abs().sec,s=0,c=0,d=0;switch(t){case"year":case"month":case"week":case"day":o=Math.trunc(r/1e3),r%=1e3,i=Math.trunc(o/1e3),o%=1e3,a+=Math.trunc(i/1e3),i%=1e3,s=Math.trunc(a/60),a%=60,c=Math.trunc(s/60),s%=60,d=Math.trunc(c/24),c%=24;break;case"hour":o=Math.trunc(r/1e3),r%=1e3,i=Math.trunc(o/1e3),o%=1e3,a+=Math.trunc(i/1e3),i%=1e3,s=Math.trunc(a/60),a%=60,c=Math.trunc(s/60),s%=60;break;case"minute":o=Math.trunc(r/1e3),r%=1e3,i=Math.trunc(o/1e3),o%=1e3,a+=Math.trunc(i/1e3),i%=1e3,s=Math.trunc(a/60),a%=60;break;case"second":o=Math.trunc(r/1e3),r%=1e3,i=Math.trunc(o/1e3),o%=1e3,a+=Math.trunc(i/1e3),i%=1e3;break;case"millisecond":o=Math.trunc(r/1e3),r%=1e3,i=he(a,3,Math.trunc(o/1e3)),o%=1e3,a=0;break;case"microsecond":o=he(a,6,Math.trunc(r/1e3)),r%=1e3,a=0;break;case"nanosecond":r=he(a,9,r),a=0}return new(ce("%Temporal.Duration%"))(e.date.years,e.date.months,e.date.weeks,e.date.days+n*d,n*c,n*s,n*a,n*i,n*o,n*r)}function Jr(e,t){return Er(e),t.sign(),{date:e,time:t}}function Gr(e,t,n){return yr({isoDate:{year:e,month:t+1,day:n},time:{hour:0,minute:0,second:0,millisecond:0}})/Re}function Kr({year:e,month:t,day:n}){if(Math.abs(Gr(e,t-1,n))>1e8)throw new RangeError("date/time value is outside the supported range")}function Vr(e,t){const n=t.hour-e.hour,r=t.minute-e.minute,o=t.second-e.second,i=t.millisecond-e.millisecond,a=t.microsecond-e.microsecond,s=t.nanosecond-e.nanosecond;return TimeDuration.fromComponents(n,r,o,i,a,s)}function Xr(e,t,n,r,o){let i=TimeDuration.fromEpochNsDiff(t,e);return i=$o(i,n,r,o),Jr({years:0,months:0,weeks:0,days:0},i)}function Qr(e,t,n,r){Zr(e),Zr(t);let o=Vr(e.time,t.time);const i=o.sign(),a=Ro(e.isoDate,t.isoDate);let s=t.isoDate;a===i&&(s=Or(s.year,s.month,s.day+i),o=o.add24HourDays(-i));const c=Gt("day",r),d=jn(n,e.isoDate,s,c);return r!==c&&(o=o.add24HourDays(d.days),d.days=0),Jr(d,o)}function eo(n,r,o,i,a){const s=e.subtract(r,n);if(e.equal(s,t))return{date:{years:0,months:0,weeks:0,days:0},time:TimeDuration.ZERO};const c=e.lessThan(s,t)?-1:1,d=zn(o,n),h=zn(o,r);let u,l=0,m=1===c?2:1,f=Vr(d.time,h.time);for(f.sign()===-c&&l++;l<=m;l++){u=xt(Or(h.isoDate.year,h.isoDate.month,h.isoDate.day-l*c),d.time);const e=An(o,u,"compatible");if(f=TimeDuration.fromEpochNsDiff(r,e),f.sign()!==-c)break}const y=Gt("day",a);return Jr(jn(i,d.isoDate,u.isoDate,y),f)}function to(t,n,r,o,i,a,s,c,d){let h,u,l,m,f=n;switch(c){case"year":{const e=Eo(f.date.years,s,"trunc");h=e,u=e+s*t,l={years:h,months:0,weeks:0,days:0},m={...l,years:u};break}case"month":{const e=Eo(f.date.months,s,"trunc");h=e,u=e+s*t,l=Nt(f.date,0,0,h),m=Nt(f.date,0,0,u);break}case"week":{const e=Nt(f.date,0,0),n=Sn(a,o.isoDate,e,"constrain"),r=jn(a,n,Or(n.year,n.month,n.day+f.date.days),"week"),i=Eo(f.date.weeks+r.weeks,s,"trunc");h=i,u=i+s*t,l=Nt(f.date,0,h),m=Nt(f.date,0,u);break}case"day":{const e=Eo(f.date.days,s,"trunc");h=e,u=e+s*t,l=Nt(f.date,h),m=Nt(f.date,u);break}}const y=Sn(a,o.isoDate,l,"constrain"),p=Sn(a,o.isoDate,m,"constrain");let g,w;const v=xt(y,o.time),b=xt(p,o.time);i?(g=An(i,v,"compatible"),w=An(i,b,"compatible")):(g=pr(v),w=pr(b));const D=TimeDuration.fromEpochNsDiff(r,g),T=TimeDuration.fromEpochNsDiff(w,g),M=ue(d,t<0?"negative":"positive"),E=D.add(D).abs().subtract(T.abs()).sign(),I=Math.abs(h)/s%2==0,C=D.isZero()?Math.abs(h):D.cmp(T)?le(Math.abs(h),Math.abs(u),E,I,M):Math.abs(u),O=new TimeDuration(e.add(e.multiply(T.totalNs,e.BigInt(h)),e.multiply(D.totalNs,e.BigInt(s*t)))).fdiv(T.totalNs),$=C===Math.abs(u);return f={date:$?m:l,time:TimeDuration.ZERO},{nudgeResult:{duration:f,nudgedEpochNs:$?w:g,didExpandCalendarUnit:$},total:O}}function no(t,n,r,o,i,a,s,c,d){let h=t;const u=Kt(c)||o&&"day"===c,l=Ir(h)<0?-1:1;let m;return u?({nudgeResult:m}=to(l,h,n,r,o,i,s,c,d)):m=o?function(t,n,r,o,i,a,s,c){let d=n;const h=Sn(i,r.isoDate,d.date,"constrain"),u=xt(h,r.time),l=xt(Or(h.year,h.month,h.day+t),r.time),m=An(o,u,"compatible"),f=An(o,l,"compatible"),y=TimeDuration.fromEpochNsDiff(f,m);if(y.sign()!==t)throw new RangeError("time zone returned inconsistent Instants");const p=e.BigInt(at[s]*a);let g=d.time.round(p,c);const w=g.subtract(y),v=w.sign()!==-t;let b,D;return v?(b=t,g=w.round(p,c),D=g.addToEpochNs(f)):(b=0,D=g.addToEpochNs(m)),{duration:Jr(Nt(d.date,d.date.days+b),g),nudgedEpochNs:D,didExpandCalendarUnit:v}}(l,h,r,o,i,s,c,d):function(t,n,r,o,i,a){let s=t;const c=s.time.add24HourDays(s.date.days),d=c.round(e.BigInt(o*at[i]),a),h=d.subtract(c),{quotient:u}=c.divmod(Se),{quotient:l}=d.divmod(Se),m=Math.sign(l-u)===c.sign(),f=h.addToEpochNs(n);let y=0,p=d;return"date"===Vt(r)&&(y=l,p=d.add(TimeDuration.fromComponents(24*-l,0,0,0,0,0))),{duration:{date:Nt(s.date,y),time:p},nudgedEpochNs:f,didExpandCalendarUnit:m}}(h,n,a,s,c,d),h=m.duration,m.didExpandCalendarUnit&&"week"!==c&&(h=function(e,t,n,r,o,i,a,s){let c=t;if(s===a)return c;const d=it.indexOf(a);for(let t=it.indexOf(s)-1;t>=d;t--){const s=it[t];if("week"===s&&"week"!==a)continue;let d;switch(s){case"year":d={years:c.date.years+e,months:0,weeks:0,days:0};break;case"month":{const t=c.date.months+e;d=Nt(c.date,0,0,t);break}case"week":{const t=c.date.weeks+e;d=Nt(c.date,0,t);break}}const h=xt(Sn(i,r.isoDate,d,"constrain"),r.time);let u;if(u=o?An(o,h,"compatible"):pr(h),p(n,u)===-e)break;c={date:d,time:TimeDuration.ZERO}}return c}(l,h,m.nudgedEpochNs,r,o,i,a,Gt(c,"day"))),h}function ro(e,t,n,r,o,i){return Kt(i)||r&&"day"===i?to(Ir(e)<0?-1:1,e,t,n,r,o,1,i,"trunc").total:Yo(e.time.add24HourDays(e.date.days),i)}function oo(e,t,n,r,o,i,a){if(0==jo(e,t))return{date:{years:0,months:0,weeks:0,days:0},time:TimeDuration.ZERO};Br(e),Br(t);const s=Qr(e,t,n,r);return"nanosecond"===i&&1===o?s:no(s,pr(t),e,null,n,r,o,i,a)}function io(e,t,n,r,o,i,a,s){if("time"===Vt(o))return Xr(e,t,i,a,s);const c=eo(e,t,n,r,o);return"nanosecond"===a&&1===i?c:no(c,t,zn(n,e),n,r,o,i,a,s)}function ao(e,t,n,r,o,i){const a=nt.reduce(((e,t)=>{const o=t[0],i=t[1],a=t[2];return"datetime"!==n&&a!==n||r.includes(i)||e.push(i,o),e}),[]);let s=Wt(t,"largestUnit",n,"auto");if(r.includes(s))throw new RangeError(`largestUnit must be one of ${a.join(", ")}, not ${s}`);const c=Ft(t);let d=Ut(t,"trunc");"since"===e&&(d=function(e){switch(e){case"ceil":return"floor";case"floor":return"ceil";case"halfCeil":return"halfFloor";case"halfFloor":return"halfCeil";default:return e}}(d));const h=Wt(t,"smallestUnit",n,o);if(r.includes(h))throw new RangeError(`smallestUnit must be one of ${a.join(", ")}, not ${h}`);const u=Gt(i,h);if("auto"===s&&(s=u),Gt(s,h)!==s)throw new RangeError(`largestUnit ${s} cannot be smaller than smallestUnit ${h}`);const l={hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[h];return void 0!==l&&Ht(c,l,!1),{largestUnit:s,roundingIncrement:c,roundingMode:d,smallestUnit:h}}function so(e,t,n,r){const o=cn(n),i=ao(e,Zo(r),"time",[],"nanosecond","second");let a=_r(Xr(re(t,b),re(o,b),i.roundingIncrement,i.smallestUnit,i.roundingMode),i.largestUnit);return"since"===e&&(a=Sr(a)),a}function co(e,t,n,r){const o=rn(n),i=re(t,E),a=re(o,E);if(!xn(i,a))throw new RangeError(`cannot compute difference between dates of ${i} and ${a} calendars`);const s=ao(e,Zo(r),"date",[],"day","day"),c=ce("%Temporal.Duration%"),d=re(t,D),h=re(o,D);if(0===Ro(d,h))return new c;let u={date:jn(i,d,h,s.largestUnit),time:TimeDuration.ZERO};if("day"!==s.smallestUnit||1!==s.roundingIncrement){const e=xt(d,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});u=no(u,pr(xt(h,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),e,null,i,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let l=_r(u,"day");return"since"===e&&(l=Sr(l)),l}function ho(e,t,n,r){const o=an(n),i=re(t,E),a=re(o,E);if(!xn(i,a))throw new RangeError(`cannot compute