@influence-society-web/yuna-frontend 1.0.1

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.
@@ -0,0 +1,24 @@
1
+ "use strict";(()=>{var _d=Object.create;var wa=Object.defineProperty;var Ed=Object.getOwnPropertyDescriptor;var Md=Object.getOwnPropertyNames;var kd=Object.getPrototypeOf,Sd=Object.prototype.hasOwnProperty;var Td=(n,t,e)=>t in n?wa(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var Cd=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var Id=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Md(t))!Sd.call(n,i)&&i!==e&&wa(n,i,{get:()=>t[i],enumerable:!(r=Ed(t,i))||r.enumerable});return n};var xd=(n,t,e)=>(e=n!=null?_d(kd(n)):{},Id(t||!n||!n.__esModule?wa(e,"default",{value:n,enumerable:!0}):e,n));var j=(n,t,e)=>(Td(n,typeof t!="symbol"?t+"":t,e),e);var Rc=Cd((ja,Ba)=>{(function(n,t){typeof ja=="object"&&typeof Ba<"u"?Ba.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self,n.JSBI=t())})(ja,function(){"use strict";var n=Math.imul,t=Math.clz32;function e(N,F){(F==null||F>N.length)&&(F=N.length);for(var O=0,Q=Array(F);O<F;O++)Q[O]=N[O];return Q}function r(N){if(Array.isArray(N))return N}function i(N){if(N===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N}function o(N,F,O){return F=f(F),z(N,x()?Reflect.construct(F,O||[],f(N).constructor):F.apply(N,O))}function a(N,F){if(!(N instanceof F))throw new TypeError("Cannot call a class as a function")}function s(N,F,O){if(x())return Reflect.construct.apply(null,arguments);var Q=[null];Q.push.apply(Q,F);var g=new(N.bind.apply(N,Q));return O&&W(g,O.prototype),g}function l(N,F){for(var O,Q=0;Q<F.length;Q++)O=F[Q],O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(N,re(O.key),O)}function u(N,F,O){return F&&l(N.prototype,F),O&&l(N,O),Object.defineProperty(N,"prototype",{writable:!1}),N}function m(N,F){var O=typeof Symbol<"u"&&N[Symbol.iterator]||N["@@iterator"];if(!O){if(Array.isArray(N)||(O=Me(N))||F&&N&&typeof N.length=="number"){O&&(N=O);var Q=0,g=function(){};return{s:g,n:function(){return Q>=N.length?{done:!0}:{done:!1,value:N[Q++]}},e:function(v){throw v},f:g}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var A,c=!0,d=!1;return{s:function(){O=O.call(N)},n:function(){var v=O.next();return c=v.done,v},e:function(v){d=!0,A=v},f:function(){try{c||O.return==null||O.return()}finally{if(d)throw A}}}}function f(N){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(F){return F.__proto__||Object.getPrototypeOf(F)},f(N)}function y(N,F){if(typeof F!="function"&&F!==null)throw new TypeError("Super expression must either be null or a function");N.prototype=Object.create(F&&F.prototype,{constructor:{value:N,writable:!0,configurable:!0}}),Object.defineProperty(N,"prototype",{writable:!1}),F&&W(N,F)}function E(N){try{return Function.toString.call(N).indexOf("[native code]")!==-1}catch{return typeof N=="function"}}function x(){try{var N=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(x=function(){return!!N})()}function I(N,F){var O=N==null?null:typeof Symbol<"u"&&N[Symbol.iterator]||N["@@iterator"];if(O!=null){var Q,g,A,c,d=[],v=!0,D=!1;try{if(A=(O=O.call(N)).next,F===0){if(Object(O)!==O)return;v=!1}else for(;!(v=(Q=A.call(O)).done)&&(d.push(Q.value),d.length!==F);v=!0);}catch(b){D=!0,g=b}finally{try{if(!v&&O.return!=null&&(c=O.return(),Object(c)!==c))return}finally{if(D)throw g}}return d}}function L(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function z(N,F){if(F&&(typeof F=="object"||typeof F=="function"))return F;if(F!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return i(N)}function W(N,F){return W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(O,Q){return O.__proto__=Q,O},W(N,F)}function K(N,F){return r(N)||I(N,F)||Me(N,F)||L()}function te(N,F){if(typeof N!="object"||!N)return N;var O=N[Symbol.toPrimitive];if(O!==void 0){var Q=O.call(N,F||"default");if(typeof Q!="object")return Q;throw new TypeError("@@toPrimitive must return a primitive value.")}return(F==="string"?String:Number)(N)}function re(N){var F=te(N,"string");return typeof F=="symbol"?F:F+""}function le(N){"@babel/helpers - typeof";return le=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(F){return typeof F}:function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},le(N)}function Me(N,F){if(N){if(typeof N=="string")return e(N,F);var O={}.toString.call(N).slice(8,-1);return O==="Object"&&N.constructor&&(O=N.constructor.name),O==="Map"||O==="Set"?Array.from(N):O==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(O)?e(N,F):void 0}}function _e(N){var F=typeof Map=="function"?new Map:void 0;return _e=function(O){function Q(){return s(O,arguments,f(this).constructor)}if(O===null||!E(O))return O;if(typeof O!="function")throw new TypeError("Super expression must either be null or a function");if(F!==void 0){if(F.has(O))return F.get(O);F.set(O,Q)}return Q.prototype=Object.create(O.prototype,{constructor:{value:Q,enumerable:!1,writable:!0,configurable:!0}}),W(Q,O)},_e(N)}var ne=function(N){var F=Math.abs,O=Math.max,Q=Math.floor;function g(A,c){var d;if(a(this,g),d=o(this,g,[A]),d.sign=c,Object.setPrototypeOf(d,g.prototype),A>g.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return d}return y(g,N),u(g,[{key:"toDebugString",value:function(){var c,d=["BigInt["],v=m(this);try{for(v.s();!(c=v.n()).done;){var D=c.value;d.push((D&&(D>>>0).toString(16))+", ")}}catch(b){v.e(b)}finally{v.f()}return d.push("]"),d.join("")}},{key:"toString",value:function(){var c=0<arguments.length&&arguments[0]!==void 0?arguments[0]:10;if(2>c||36<c)throw new RangeError("toString() radix argument must be between 2 and 36");return this.length===0?"0":c&c-1?g.__toStringGeneric(this,c,!1):g.__toStringBasePowerOfTwo(this,c)}},{key:"valueOf",value:function(){throw new Error("Convert JSBI instances to native numbers using `toNumber`.")}},{key:"__copy",value:function(){for(var c=new g(this.length,this.sign),d=0;d<this.length;d++)c[d]=this[d];return c}},{key:"__trim",value:function(){for(var c=this.length,d=this[c-1];d===0;)c--,d=this[c-1],this.pop();return c===0&&(this.sign=!1),this}},{key:"__initializeDigits",value:function(){for(var c=0;c<this.length;c++)this[c]=0}},{key:"__clzmsd",value:function(){return g.__clz30(this.__digit(this.length-1))}},{key:"__inplaceMultiplyAdd",value:function(c,d,v){v>this.length&&(v=this.length);for(var D=32767&c,b=c>>>15,_=0,T=d,S=0;S<v;S++){var Y=this.__digit(S),R=32767&Y,V=Y>>>15,J=g.__imul(R,D),U=g.__imul(R,b),B=g.__imul(V,D),ee=g.__imul(V,b),ce=T+J+_;_=ce>>>30,ce&=1073741823,ce+=((32767&U)<<15)+((32767&B)<<15),_+=ce>>>30,T=ee+(U>>>15)+(B>>>15),this.__setDigit(S,1073741823&ce)}if(_!==0||T!==0)throw new Error("implementation bug")}},{key:"__inplaceAdd",value:function(c,d,v){for(var D,b=0,_=0;_<v;_++)D=this.__halfDigit(d+_)+c.__halfDigit(_)+b,b=D>>>15,this.__setHalfDigit(d+_,32767&D);return b}},{key:"__inplaceSub",value:function(c,d,v){var D=v-1>>>1,b=0;if(1&d){d>>=1;for(var _=this.__digit(d),T=32767&_,S=0;S<D;S++){var Y=c.__digit(S),R=(_>>>15)-(32767&Y)-b;b=1&R>>>15,this.__setDigit(d+S,(32767&R)<<15|32767&T),_=this.__digit(d+S+1),T=(32767&_)-(Y>>>15)-b,b=1&T>>>15}var V=c.__digit(S),J=(_>>>15)-(32767&V)-b;b=1&J>>>15,this.__setDigit(d+S,(32767&J)<<15|32767&T);var U=V>>>15;if(d+S+1>=this.length)throw new RangeError("out of bounds");!(1&v)&&(_=this.__digit(d+S+1),T=(32767&_)-U-b,b=1&T>>>15,this.__setDigit(d+c.length,1073709056&_|32767&T))}else{d>>=1;for(var B=0;B<c.length-1;B++){var ee=this.__digit(d+B),ce=c.__digit(B),pe=(32767&ee)-(32767&ce)-b;b=1&pe>>>15;var ve=(ee>>>15)-(ce>>>15)-b;b=1&ve>>>15,this.__setDigit(d+B,(32767&ve)<<15|32767&pe)}var Ce=this.__digit(d+B),He=c.__digit(B),Ze=(32767&Ce)-(32767&He)-b;b=1&Ze>>>15;var Bt=0;!(1&v)&&(Bt=(Ce>>>15)-(He>>>15)-b,b=1&Bt>>>15),this.__setDigit(d+B,(32767&Bt)<<15|32767&Ze)}return b}},{key:"__inplaceRightShift",value:function(c){if(c!==0){for(var d,v=this.__digit(0)>>>c,D=this.length-1,b=0;b<D;b++)d=this.__digit(b+1),this.__setDigit(b,1073741823&d<<30-c|v),v=d>>>c;this.__setDigit(D,v)}}},{key:"__digit",value:function(c){return this[c]}},{key:"__unsignedDigit",value:function(c){return this[c]>>>0}},{key:"__setDigit",value:function(c,d){this[c]=0|d}},{key:"__setDigitGrow",value:function(c,d){this[c]=0|d}},{key:"__halfDigitLength",value:function(){var c=this.length;return 32767>=this.__unsignedDigit(c-1)?2*c-1:2*c}},{key:"__halfDigit",value:function(c){return 32767&this[c>>>1]>>>15*(1&c)}},{key:"__setHalfDigit",value:function(c,d){var v=c>>>1,D=this.__digit(v),b=1&c?32767&D|d<<15:1073709056&D|32767&d;this.__setDigit(v,b)}}],[{key:"BigInt",value:function(c){var d=Number.isFinite;if(typeof c=="number"){if(c===0)return g.__zero();if(g.__isOneDigitInt(c))return 0>c?g.__oneDigit(-c,!0):g.__oneDigit(c,!1);if(!d(c)||Q(c)!==c)throw new RangeError("The number "+c+" cannot be converted to BigInt because it is not an integer");return g.__fromDouble(c)}if(typeof c=="string"){var v=g.__fromString(c);if(v===null)throw new SyntaxError("Cannot convert "+c+" to a BigInt");return v}if(typeof c=="boolean")return c===!0?g.__oneDigit(1,!1):g.__zero();if(le(c)==="object"){if(c.constructor===g)return c;var D=g.__toPrimitive(c);return g.BigInt(D)}throw new TypeError("Cannot convert "+c+" to a BigInt")}},{key:"toNumber",value:function(c){var d=c.length;if(d===0)return 0;if(d===1){var v=c.__unsignedDigit(0);return c.sign?-v:v}var D=c.__digit(d-1),b=g.__clz30(D),_=30*d-b;if(1024<_)return c.sign?-1/0:1/0;var T=_-1,S=D,Y=d-1,R=b+3,V=R===32?0:S<<R;V>>>=12;var J=R-12,U=12<=R?0:S<<20+R,B=20+R;for(0<J&&0<Y&&(Y--,S=c.__digit(Y),V|=S>>>30-J,U=S<<J+2,B=J+2);0<B&&0<Y;)Y--,S=c.__digit(Y),U|=30<=B?S<<B-30:S>>>30-B,B-=30;var ee=g.__decideRounding(c,B,Y,S);if((ee===1||ee===0&&(1&U)==1)&&(U=U+1>>>0,U===0&&(V++,V>>>20!=0&&(V=0,T++,1023<T))))return c.sign?-1/0:1/0;var ce=c.sign?-2147483648:0;return T=T+1023<<20,g.__kBitConversionInts[g.__kBitConversionIntHigh]=ce|T|V,g.__kBitConversionInts[g.__kBitConversionIntLow]=U,g.__kBitConversionDouble[0]}},{key:"unaryMinus",value:function(c){if(c.length===0)return c;var d=c.__copy();return d.sign=!c.sign,d}},{key:"bitwiseNot",value:function(c){return c.sign?g.__absoluteSubOne(c).__trim():g.__absoluteAddOne(c,!0)}},{key:"exponentiate",value:function(c,d){if(d.sign)throw new RangeError("Exponent must be positive");if(d.length===0)return g.__oneDigit(1,!1);if(c.length===0)return c;if(c.length===1&&c.__digit(0)===1)return c.sign&&!(1&d.__digit(0))?g.unaryMinus(c):c;if(1<d.length)throw new RangeError("BigInt too big");var v=d.__unsignedDigit(0);if(v===1)return c;if(v>=g.__kMaxLengthBits)throw new RangeError("BigInt too big");if(c.length===1&&c.__digit(0)===2){var D=1+(0|v/30),b=c.sign&&(1&v)!=0,_=new g(D,b);_.__initializeDigits();var T=1<<v%30;return _.__setDigit(D-1,T),_}var S=null,Y=c;for(1&v&&(S=c),v>>=1;v!==0;v>>=1)Y=g.multiply(Y,Y),1&v&&(S===null?S=Y:S=g.multiply(S,Y));return S}},{key:"multiply",value:function(c,d){if(c.length===0)return c;if(d.length===0)return d;var v=c.length+d.length;30<=c.__clzmsd()+d.__clzmsd()&&v--;var D=new g(v,c.sign!==d.sign);D.__initializeDigits();for(var b=0;b<c.length;b++)g.__multiplyAccumulate(d,c.__digit(b),D,b);return D.__trim()}},{key:"divide",value:function(c,d){if(d.length===0)throw new RangeError("Division by zero");if(0>g.__absoluteCompare(c,d))return g.__zero();var v,D=c.sign!==d.sign,b=d.__unsignedDigit(0);if(d.length===1&&32767>=b){if(b===1)return D===c.sign?c:g.unaryMinus(c);v=g.__absoluteDivSmall(c,b,null)}else v=g.__absoluteDivLarge(c,d,!0,!1);return v.sign=D,v.__trim()}},{key:"remainder",value:function(c,d){if(d.length===0)throw new RangeError("Division by zero");if(0>g.__absoluteCompare(c,d))return c;var v=d.__unsignedDigit(0);if(d.length===1&&32767>=v){if(v===1)return g.__zero();var D=g.__absoluteModSmall(c,v);return D===0?g.__zero():g.__oneDigit(D,c.sign)}var b=g.__absoluteDivLarge(c,d,!1,!0);return b.sign=c.sign,b.__trim()}},{key:"add",value:function(c,d){var v=c.sign;return v===d.sign?g.__absoluteAdd(c,d,v):0<=g.__absoluteCompare(c,d)?g.__absoluteSub(c,d,v):g.__absoluteSub(d,c,!v)}},{key:"subtract",value:function(c,d){var v=c.sign;return v===d.sign?0<=g.__absoluteCompare(c,d)?g.__absoluteSub(c,d,v):g.__absoluteSub(d,c,!v):g.__absoluteAdd(c,d,v)}},{key:"leftShift",value:function(c,d){return d.length===0||c.length===0?c:d.sign?g.__rightShiftByAbsolute(c,d):g.__leftShiftByAbsolute(c,d)}},{key:"signedRightShift",value:function(c,d){return d.length===0||c.length===0?c:d.sign?g.__leftShiftByAbsolute(c,d):g.__rightShiftByAbsolute(c,d)}},{key:"unsignedRightShift",value:function(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}},{key:"lessThan",value:function(c,d){return 0>g.__compareToBigInt(c,d)}},{key:"lessThanOrEqual",value:function(c,d){return 0>=g.__compareToBigInt(c,d)}},{key:"greaterThan",value:function(c,d){return 0<g.__compareToBigInt(c,d)}},{key:"greaterThanOrEqual",value:function(c,d){return 0<=g.__compareToBigInt(c,d)}},{key:"equal",value:function(c,d){if(c.sign!==d.sign||c.length!==d.length)return!1;for(var v=0;v<c.length;v++)if(c.__digit(v)!==d.__digit(v))return!1;return!0}},{key:"notEqual",value:function(c,d){return!g.equal(c,d)}},{key:"bitwiseAnd",value:function(c,d){if(!c.sign&&!d.sign)return g.__absoluteAnd(c,d).__trim();if(c.sign&&d.sign){var v=O(c.length,d.length)+1,D=g.__absoluteSubOne(c,v),b=g.__absoluteSubOne(d);return D=g.__absoluteOr(D,b,D),g.__absoluteAddOne(D,!0,D).__trim()}if(c.sign){var _=[d,c];c=_[0],d=_[1]}return g.__absoluteAndNot(c,g.__absoluteSubOne(d)).__trim()}},{key:"bitwiseXor",value:function(c,d){if(!c.sign&&!d.sign)return g.__absoluteXor(c,d).__trim();if(c.sign&&d.sign){var v=O(c.length,d.length),D=g.__absoluteSubOne(c,v),b=g.__absoluteSubOne(d);return g.__absoluteXor(D,b,D).__trim()}var _=O(c.length,d.length)+1;if(c.sign){var T=[d,c];c=T[0],d=T[1]}var S=g.__absoluteSubOne(d,_);return S=g.__absoluteXor(S,c,S),g.__absoluteAddOne(S,!0,S).__trim()}},{key:"bitwiseOr",value:function(c,d){var v=O(c.length,d.length);if(!c.sign&&!d.sign)return g.__absoluteOr(c,d).__trim();if(c.sign&&d.sign){var D=g.__absoluteSubOne(c,v),b=g.__absoluteSubOne(d);return D=g.__absoluteAnd(D,b,D),g.__absoluteAddOne(D,!0,D).__trim()}if(c.sign){var _=[d,c];c=_[0],d=_[1]}var T=g.__absoluteSubOne(d,v);return T=g.__absoluteAndNot(T,c,T),g.__absoluteAddOne(T,!0,T).__trim()}},{key:"asIntN",value:function(c,d){if(d.length===0)return d;if(c=Q(c),0>c)throw new RangeError("Invalid value: not (convertible to) a safe integer");if(c===0)return g.__zero();if(c>=g.__kMaxLengthBits)return d;var v=0|(c+29)/30;if(d.length<v)return d;var D=d.__unsignedDigit(v-1),b=1<<(c-1)%30;if(d.length===v&&D<b)return d;var _=(D&b)===b;if(!_)return g.__truncateToNBits(c,d);if(!d.sign)return g.__truncateAndSubFromPowerOfTwo(c,d,!0);if(!(D&b-1)){for(var T=v-2;0<=T;T--)if(d.__digit(T)!==0)return g.__truncateAndSubFromPowerOfTwo(c,d,!1);return d.length===v&&D===b?d:g.__truncateToNBits(c,d)}return g.__truncateAndSubFromPowerOfTwo(c,d,!1)}},{key:"asUintN",value:function(c,d){if(d.length===0)return d;if(c=Q(c),0>c)throw new RangeError("Invalid value: not (convertible to) a safe integer");if(c===0)return g.__zero();if(d.sign){if(c>g.__kMaxLengthBits)throw new RangeError("BigInt too big");return g.__truncateAndSubFromPowerOfTwo(c,d,!1)}if(c>=g.__kMaxLengthBits)return d;var v=0|(c+29)/30;if(d.length<v)return d;var D=c%30;if(d.length==v){if(D===0)return d;var b=d.__digit(v-1);if(!(b>>>D))return d}return g.__truncateToNBits(c,d)}},{key:"ADD",value:function(c,d){if(c=g.__toPrimitive(c),d=g.__toPrimitive(d),typeof c=="string")return typeof d!="string"&&(d=d.toString()),c+d;if(typeof d=="string")return c.toString()+d;if(c=g.__toNumeric(c),d=g.__toNumeric(d),g.__isBigInt(c)&&g.__isBigInt(d))return g.add(c,d);if(typeof c=="number"&&typeof d=="number")return c+d;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}},{key:"LT",value:function(c,d){return g.__compare(c,d,0)}},{key:"LE",value:function(c,d){return g.__compare(c,d,1)}},{key:"GT",value:function(c,d){return g.__compare(c,d,2)}},{key:"GE",value:function(c,d){return g.__compare(c,d,3)}},{key:"EQ",value:function(c,d){for(;;){if(g.__isBigInt(c))return g.__isBigInt(d)?g.equal(c,d):g.EQ(d,c);if(typeof c=="number"){if(g.__isBigInt(d))return g.__equalToNumber(d,c);if(le(d)!=="object")return c==d;d=g.__toPrimitive(d)}else if(typeof c=="string"){if(g.__isBigInt(d))return c=g.__fromString(c),c!==null&&g.equal(c,d);if(le(d)!=="object")return c==d;d=g.__toPrimitive(d)}else if(typeof c=="boolean"){if(g.__isBigInt(d))return g.__equalToNumber(d,+c);if(le(d)!=="object")return c==d;d=g.__toPrimitive(d)}else if(le(c)==="symbol"){if(g.__isBigInt(d))return!1;if(le(d)!=="object")return c==d;d=g.__toPrimitive(d)}else if(le(c)==="object"){if(le(d)==="object"&&d.constructor!==g)return c==d;c=g.__toPrimitive(c)}else return c==d}}},{key:"NE",value:function(c,d){return!g.EQ(c,d)}},{key:"DataViewGetBigInt64",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0&&arguments[2];return g.asIntN(64,g.DataViewGetBigUint64(c,d,v))}},{key:"DataViewGetBigUint64",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0&&arguments[2],D=v?[4,0]:[0,4],b=K(D,2),_=b[0],T=b[1],S=c.getUint32(d+_,v),Y=c.getUint32(d+T,v),R=new g(3,!1);return R.__setDigit(0,1073741823&Y),R.__setDigit(1,(268435455&S)<<2|Y>>>30),R.__setDigit(2,S>>>28),R.__trim()}},{key:"DataViewSetBigInt64",value:function(c,d,v){var D=3<arguments.length&&arguments[3]!==void 0&&arguments[3];g.DataViewSetBigUint64(c,d,v,D)}},{key:"DataViewSetBigUint64",value:function(c,d,v){var D=3<arguments.length&&arguments[3]!==void 0&&arguments[3];v=g.asUintN(64,v);var b=0,_=0;if(0<v.length&&(_=v.__digit(0),1<v.length)){var T=v.__digit(1);_|=T<<30,b=T>>>2,2<v.length&&(b|=v.__digit(2)<<28)}var S=D?[4,0]:[0,4],Y=K(S,2),R=Y[0],V=Y[1];c.setUint32(d+R,b,D),c.setUint32(d+V,_,D)}},{key:"__zero",value:function(){return new g(0,!1)}},{key:"__oneDigit",value:function(c,d){var v=new g(1,d);return v.__setDigit(0,c),v}},{key:"__decideRounding",value:function(c,d,v,D){if(0<d)return-1;var b;if(0>d)b=-d-1;else{if(v===0)return-1;v--,D=c.__digit(v),b=29}var _=1<<b;if(!(D&_))return-1;if(_-=1,(D&_)!=0)return 1;for(;0<v;)if(v--,c.__digit(v)!==0)return 1;return 0}},{key:"__fromDouble",value:function(c){var d=0>c;g.__kBitConversionDouble[0]=c;var v,D=2047&g.__kBitConversionInts[g.__kBitConversionIntHigh]>>>20,b=D-1023,_=(0|b/30)+1,T=new g(_,d),S=1048576,Y=1048575&g.__kBitConversionInts[g.__kBitConversionIntHigh]|S,R=g.__kBitConversionInts[g.__kBitConversionIntLow],V=20,J=b%30,U=0;if(J<V){var B=V-J;U=B+32,v=Y>>>B,Y=Y<<32-B|R>>>B,R<<=32-B}else if(J===V)U=32,v=Y,Y=R,R=0;else{var ee=J-V;U=32-ee,v=Y<<ee|R>>>32-ee,Y=R<<ee,R=0}T.__setDigit(_-1,v);for(var ce=_-2;0<=ce;ce--)0<U?(U-=30,v=Y>>>2,Y=Y<<30|R>>>2,R<<=30):v=0,T.__setDigit(ce,v);return T.__trim()}},{key:"__isWhitespace",value:function(c){return 13>=c&&9<=c||(159>=c?c==32:131071>=c?c==160||c==5760:196607>=c?(c&=131071,10>=c||c==40||c==41||c==47||c==95||c==4096):c==65279)}},{key:"__fromString",value:function(c){var d=1<arguments.length&&arguments[1]!==void 0?arguments[1]:0,v=0,D=c.length,b=0;if(b===D)return g.__zero();for(var _=c.charCodeAt(b);g.__isWhitespace(_);){if(++b===D)return g.__zero();_=c.charCodeAt(b)}if(_===43){if(++b===D)return null;_=c.charCodeAt(b),v=1}else if(_===45){if(++b===D)return null;_=c.charCodeAt(b),v=-1}if(d===0){if(d=10,_===48){if(++b===D)return g.__zero();if(_=c.charCodeAt(b),_===88||_===120){if(d=16,++b===D)return null;_=c.charCodeAt(b)}else if(_===79||_===111){if(d=8,++b===D)return null;_=c.charCodeAt(b)}else if(_===66||_===98){if(d=2,++b===D)return null;_=c.charCodeAt(b)}}}else if(d===16&&_===48){if(++b===D)return g.__zero();if(_=c.charCodeAt(b),_===88||_===120){if(++b===D)return null;_=c.charCodeAt(b)}}if(v!==0&&d!==10)return null;for(;_===48;){if(++b===D)return g.__zero();_=c.charCodeAt(b)}var T=D-b,S=g.__kMaxBitsPerChar[d],Y=g.__kBitsPerCharTableMultiplier-1;if(T>1073741824/S)return null;var R=S*T+Y>>>g.__kBitsPerCharTableShift,V=0|(R+29)/30,J=new g(V,!1),U=10>d?d:10,B=10<d?d-10:0;if(d&d-1){J.__initializeDigits();var Ze=!1,Bt=0;do{for(var qn,Cn=0,$r=1;;){if(qn=void 0,_-48>>>0<U)qn=_-48;else if((32|_)-97>>>0<B)qn=(32|_)-87;else{Ze=!0;break}var Qi=$r*d;if(1073741823<Qi)break;if($r=Qi,Cn=Cn*d+qn,Bt++,++b===D){Ze=!0;break}_=c.charCodeAt(b)}Y=30*g.__kBitsPerCharTableMultiplier-1;var eo=0|(S*Bt+Y>>>g.__kBitsPerCharTableShift)/30;J.__inplaceMultiplyAdd($r,Cn,eo)}while(!Ze)}else{S>>=g.__kBitsPerCharTableShift;var ee=[],ce=[],pe=!1;do{for(var ve,Ce=0,He=0;;){if(ve=void 0,_-48>>>0<U)ve=_-48;else if((32|_)-97>>>0<B)ve=(32|_)-87;else{pe=!0;break}if(He+=S,Ce=Ce<<S|ve,++b===D){pe=!0;break}if(_=c.charCodeAt(b),30<He+S)break}ee.push(Ce),ce.push(He)}while(!pe);g.__fillFromParts(J,ee,ce)}if(b!==D){if(!g.__isWhitespace(_))return null;for(b++;b<D;b++)if(_=c.charCodeAt(b),!g.__isWhitespace(_))return null}return J.sign=v===-1,J.__trim()}},{key:"__fillFromParts",value:function(c,d,v){for(var D=0,b=0,_=0,T=d.length-1;0<=T;T--){var S=d[T],Y=v[T];b|=S<<_,_+=Y,_===30?(c.__setDigit(D++,b),_=0,b=0):30<_&&(c.__setDigit(D++,1073741823&b),_-=30,b=S>>>Y-_)}if(b!==0){if(D>=c.length)throw new Error("implementation bug");c.__setDigit(D++,b)}for(;D<c.length;D++)c.__setDigit(D,0)}},{key:"__toStringBasePowerOfTwo",value:function(c,d){var v=c.length,D=d-1;D=(85&D>>>1)+(85&D),D=(51&D>>>2)+(51&D),D=(15&D>>>4)+(15&D);var b=D,_=d-1,T=c.__digit(v-1),S=g.__clz30(T),Y=30*v-S,R=0|(Y+b-1)/b;if(c.sign&&R++,268435456<R)throw new Error("string too long");for(var V=Array(R),J=R-1,U=0,B=0,ee=0;ee<v-1;ee++){var ce=c.__digit(ee),pe=(U|ce<<B)&_;V[J--]=g.__kConversionChars[pe];var ve=b-B;for(U=ce>>>ve,B=30-ve;B>=b;)V[J--]=g.__kConversionChars[U&_],U>>>=b,B-=b}var Ce=(U|T<<B)&_;for(V[J--]=g.__kConversionChars[Ce],U=T>>>b-B;U!==0;)V[J--]=g.__kConversionChars[U&_],U>>>=b;if(c.sign&&(V[J--]="-"),J!==-1)throw new Error("implementation bug");return V.join("")}},{key:"__toStringGeneric",value:function(c,d,v){var D=c.length;if(D===0)return"";if(D===1){var b=c.__unsignedDigit(0).toString(d);return v===!1&&c.sign&&(b="-"+b),b}var _=30*D-g.__clz30(c.__digit(D-1)),T=g.__kMaxBitsPerChar[d],S=T-1,Y=_*g.__kBitsPerCharTableMultiplier;Y+=S-1,Y=0|Y/S;var R,V,J=Y+1>>1,U=g.exponentiate(g.__oneDigit(d,!1),g.__oneDigit(J,!1)),B=U.__unsignedDigit(0);if(U.length===1&&32767>=B){R=new g(c.length,!1),R.__initializeDigits();for(var ee,ce=0,pe=2*c.length-1;0<=pe;pe--)ee=ce<<15|c.__halfDigit(pe),R.__setHalfDigit(pe,0|ee/B),ce=0|ee%B;V=ce.toString(d)}else{var ve=g.__absoluteDivLarge(c,U,!0,!0);R=ve.quotient;var Ce=ve.remainder.__trim();V=g.__toStringGeneric(Ce,d,!0)}R.__trim();for(var He=g.__toStringGeneric(R,d,!0);V.length<J;)V="0"+V;return v===!1&&c.sign&&(He="-"+He),He+V}},{key:"__unequalSign",value:function(c){return c?-1:1}},{key:"__absoluteGreater",value:function(c){return c?-1:1}},{key:"__absoluteLess",value:function(c){return c?1:-1}},{key:"__compareToBigInt",value:function(c,d){var v=c.sign;if(v!==d.sign)return g.__unequalSign(v);var D=g.__absoluteCompare(c,d);return 0<D?g.__absoluteGreater(v):0>D?g.__absoluteLess(v):0}},{key:"__compareToNumber",value:function(c,d){if(g.__isOneDigitInt(d)){var v=c.sign,D=0>d;if(v!==D)return g.__unequalSign(v);if(c.length===0){if(D)throw new Error("implementation bug");return d===0?0:-1}if(1<c.length)return g.__absoluteGreater(v);var b=F(d),_=c.__unsignedDigit(0);return _>b?g.__absoluteGreater(v):_<b?g.__absoluteLess(v):0}return g.__compareToDouble(c,d)}},{key:"__compareToDouble",value:function(c,d){if(d!==d)return d;if(d===1/0)return-1;if(d===-1/0)return 1;var v=c.sign,D=0>d;if(v!==D)return g.__unequalSign(v);if(d===0)throw new Error("implementation bug: should be handled elsewhere");if(c.length===0)return-1;g.__kBitConversionDouble[0]=d;var b=2047&g.__kBitConversionInts[g.__kBitConversionIntHigh]>>>20;if(b==2047)throw new Error("implementation bug: handled elsewhere");var _=b-1023;if(0>_)return g.__absoluteGreater(v);var T=c.length,S=c.__digit(T-1),Y=g.__clz30(S),R=30*T-Y,V=_+1;if(R<V)return g.__absoluteLess(v);if(R>V)return g.__absoluteGreater(v);var J=1048576,U=1048576|1048575&g.__kBitConversionInts[g.__kBitConversionIntHigh],B=g.__kBitConversionInts[g.__kBitConversionIntLow],ee=20,ce=29-Y;if(ce!==(0|(R-1)%30))throw new Error("implementation bug");var pe,ve=0;if(ce<ee){var Ce=ee-ce;ve=Ce+32,pe=U>>>Ce,U=U<<32-Ce|B>>>Ce,B<<=32-Ce}else if(ce===ee)ve=32,pe=U,U=B,B=0;else{var He=ce-ee;ve=32-He,pe=U<<He|B>>>32-He,U=B<<He,B=0}if(S>>>=0,pe>>>=0,S>pe)return g.__absoluteGreater(v);if(S<pe)return g.__absoluteLess(v);for(var Ze=T-2;0<=Ze;Ze--){0<ve?(ve-=30,pe=U>>>2,U=U<<30|B>>>2,B<<=30):pe=0;var Bt=c.__unsignedDigit(Ze);if(Bt>pe)return g.__absoluteGreater(v);if(Bt<pe)return g.__absoluteLess(v)}if(U!==0||B!==0){if(ve===0)throw new Error("implementation bug");return g.__absoluteLess(v)}return 0}},{key:"__equalToNumber",value:function(c,d){return g.__isOneDigitInt(d)?d===0?c.length===0:c.length===1&&c.sign===0>d&&c.__unsignedDigit(0)===F(d):g.__compareToDouble(c,d)===0}},{key:"__comparisonResultToBool",value:function(c,d){return d===0?0>c:d===1?0>=c:d===2?0<c:d===3?0<=c:void 0}},{key:"__compare",value:function(c,d,v){if(c=g.__toPrimitive(c),d=g.__toPrimitive(d),typeof c=="string"&&typeof d=="string")switch(v){case 0:return c<d;case 1:return c<=d;case 2:return c>d;case 3:return c>=d}if(g.__isBigInt(c)&&typeof d=="string")return d=g.__fromString(d),d!==null&&g.__comparisonResultToBool(g.__compareToBigInt(c,d),v);if(typeof c=="string"&&g.__isBigInt(d))return c=g.__fromString(c),c!==null&&g.__comparisonResultToBool(g.__compareToBigInt(c,d),v);if(c=g.__toNumeric(c),d=g.__toNumeric(d),g.__isBigInt(c)){if(g.__isBigInt(d))return g.__comparisonResultToBool(g.__compareToBigInt(c,d),v);if(typeof d!="number")throw new Error("implementation bug");return g.__comparisonResultToBool(g.__compareToNumber(c,d),v)}if(typeof c!="number")throw new Error("implementation bug");if(g.__isBigInt(d))return g.__comparisonResultToBool(g.__compareToNumber(d,c),2^v);if(typeof d!="number")throw new Error("implementation bug");return v===0?c<d:v===1?c<=d:v===2?c>d:v===3?c>=d:void 0}},{key:"__absoluteAdd",value:function(c,d,v){if(c.length<d.length)return g.__absoluteAdd(d,c,v);if(c.length===0)return c;if(d.length===0)return c.sign===v?c:g.unaryMinus(c);var D=c.length;(c.__clzmsd()===0||d.length===c.length&&d.__clzmsd()===0)&&D++;for(var b,_=new g(D,v),T=0,S=0;S<d.length;S++)b=c.__digit(S)+d.__digit(S)+T,T=b>>>30,_.__setDigit(S,1073741823&b);for(;S<c.length;S++){var Y=c.__digit(S)+T;T=Y>>>30,_.__setDigit(S,1073741823&Y)}return S<_.length&&_.__setDigit(S,T),_.__trim()}},{key:"__absoluteSub",value:function(c,d,v){if(c.length===0)return c;if(d.length===0)return c.sign===v?c:g.unaryMinus(c);for(var D,b=new g(c.length,v),_=0,T=0;T<d.length;T++)D=c.__digit(T)-d.__digit(T)-_,_=1&D>>>30,b.__setDigit(T,1073741823&D);for(;T<c.length;T++){var S=c.__digit(T)-_;_=1&S>>>30,b.__setDigit(T,1073741823&S)}return b.__trim()}},{key:"__absoluteAddOne",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,D=c.length;v===null?v=new g(D,d):v.sign=d;for(var b,_=1,T=0;T<D;T++)b=c.__digit(T)+_,_=b>>>30,v.__setDigit(T,1073741823&b);return _!==0&&v.__setDigitGrow(D,1),v}},{key:"__absoluteSubOne",value:function(c,d){var v=c.length;d=d||v;for(var D,b=new g(d,!1),_=1,T=0;T<v;T++)D=c.__digit(T)-_,_=1&D>>>30,b.__setDigit(T,1073741823&D);if(_!==0)throw new Error("implementation bug");for(var S=v;S<d;S++)b.__setDigit(S,0);return b}},{key:"__absoluteAnd",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,D=c.length,b=d.length,_=b;if(D<b){_=D;var T=c,S=D;c=d,D=b,d=T,b=S}var Y=_;v===null?v=new g(Y,!1):Y=v.length;for(var R=0;R<_;R++)v.__setDigit(R,c.__digit(R)&d.__digit(R));for(;R<Y;R++)v.__setDigit(R,0);return v}},{key:"__absoluteAndNot",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,D=c.length,b=d.length,_=b;D<b&&(_=D);var T=D;v===null?v=new g(T,!1):T=v.length;for(var S=0;S<_;S++)v.__setDigit(S,c.__digit(S)&~d.__digit(S));for(;S<D;S++)v.__setDigit(S,c.__digit(S));for(;S<T;S++)v.__setDigit(S,0);return v}},{key:"__absoluteOr",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,D=c.length,b=d.length,_=b;if(D<b){_=D;var T=c,S=D;c=d,D=b,d=T,b=S}var Y=D;v===null?v=new g(Y,!1):Y=v.length;for(var R=0;R<_;R++)v.__setDigit(R,c.__digit(R)|d.__digit(R));for(;R<D;R++)v.__setDigit(R,c.__digit(R));for(;R<Y;R++)v.__setDigit(R,0);return v}},{key:"__absoluteXor",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,D=c.length,b=d.length,_=b;if(D<b){_=D;var T=c,S=D;c=d,D=b,d=T,b=S}var Y=D;v===null?v=new g(Y,!1):Y=v.length;for(var R=0;R<_;R++)v.__setDigit(R,c.__digit(R)^d.__digit(R));for(;R<D;R++)v.__setDigit(R,c.__digit(R));for(;R<Y;R++)v.__setDigit(R,0);return v}},{key:"__absoluteCompare",value:function(c,d){var v=c.length-d.length;if(v!=0)return v;for(var D=c.length-1;0<=D&&c.__digit(D)===d.__digit(D);)D--;return 0>D?0:c.__unsignedDigit(D)>d.__unsignedDigit(D)?1:-1}},{key:"__multiplyAccumulate",value:function(c,d,v,D){if(d!==0){for(var b=32767&d,_=d>>>15,T=0,S=0,Y=0;Y<c.length;Y++,D++){var R=v.__digit(D),V=c.__digit(Y),J=32767&V,U=V>>>15,B=g.__imul(J,b),ee=g.__imul(J,_),ce=g.__imul(U,b),pe=g.__imul(U,_);R+=S+B+T,T=R>>>30,R&=1073741823,R+=((32767&ee)<<15)+((32767&ce)<<15),T+=R>>>30,S=pe+(ee>>>15)+(ce>>>15),v.__setDigit(D,1073741823&R)}for(;T!==0||S!==0;D++){var ve=v.__digit(D);ve+=T+S,S=0,T=ve>>>30,v.__setDigit(D,1073741823&ve)}}}},{key:"__internalMultiplyAdd",value:function(c,d,v,D,b){for(var _=v,T=0,S=0;S<D;S++){var Y=c.__digit(S),R=g.__imul(32767&Y,d),V=g.__imul(Y>>>15,d),J=R+((32767&V)<<15)+T+_;_=J>>>30,T=V>>>15,b.__setDigit(S,1073741823&J)}if(b.length>D)for(b.__setDigit(D++,_+T);D<b.length;)b.__setDigit(D++,0);else if(_+T!==0)throw new Error("implementation bug")}},{key:"__absoluteDivSmall",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;v===null&&(v=new g(c.length,!1));for(var D=0,b=2*c.length-1;0<=b;b-=2){var _=(D<<15|c.__halfDigit(b))>>>0,T=0|_/d;D=0|_%d,_=(D<<15|c.__halfDigit(b-1))>>>0;var S=0|_/d;D=0|_%d,v.__setDigit(b>>>1,T<<15|S)}return v}},{key:"__absoluteModSmall",value:function(c,d){for(var v,D=0,b=2*c.length-1;0<=b;b--)v=(D<<15|c.__halfDigit(b))>>>0,D=0|v%d;return D}},{key:"__absoluteDivLarge",value:function(c,d,v,D){var b=d.__halfDigitLength(),_=d.length,T=c.__halfDigitLength()-b,S=null;v&&(S=new g(T+2>>>1,!1),S.__initializeDigits());var Y=new g(b+2>>>1,!1);Y.__initializeDigits();var R=g.__clz15(d.__halfDigit(b-1));0<R&&(d=g.__specialLeftShift(d,R,0));for(var V=g.__specialLeftShift(c,R,1),J=d.__halfDigit(b-1),U=0,B=T;0<=B;B--){var ee=32767,ce=V.__halfDigit(B+b);if(ce!==J){var pe=(ce<<15|V.__halfDigit(B+b-1))>>>0;ee=0|pe/J;for(var ve=0|pe%J,Ce=d.__halfDigit(b-2),He=V.__halfDigit(B+b-2);g.__imul(ee,Ce)>>>0>(ve<<16|He)>>>0&&(ee--,ve+=J,!(32767<ve)););}g.__internalMultiplyAdd(d,ee,0,_,Y);var Ze=V.__inplaceSub(Y,B,b+1);Ze!==0&&(Ze=V.__inplaceAdd(d,B,b),V.__setHalfDigit(B+b,32767&V.__halfDigit(B+b)+Ze),ee--),v&&(1&B?U=ee<<15:S.__setDigit(B>>>1,U|ee))}if(D)return V.__inplaceRightShift(R),v?{quotient:S,remainder:V}:V;if(v)return S;throw new Error("unreachable")}},{key:"__clz15",value:function(c){return g.__clz30(c)-15}},{key:"__specialLeftShift",value:function(c,d,v){var D=c.length,b=D+v,_=new g(b,!1);if(d===0){for(var T=0;T<D;T++)_.__setDigit(T,c.__digit(T));return 0<v&&_.__setDigit(D,0),_}for(var S,Y=0,R=0;R<D;R++)S=c.__digit(R),_.__setDigit(R,1073741823&S<<d|Y),Y=S>>>30-d;return 0<v&&_.__setDigit(D,Y),_}},{key:"__leftShiftByAbsolute",value:function(c,d){var v=g.__toShiftAmount(d);if(0>v)throw new RangeError("BigInt too big");var D=0|v/30,b=v%30,_=c.length,T=b!==0&&c.__digit(_-1)>>>30-b!=0,S=_+D+(T?1:0),Y=new g(S,c.sign);if(b===0){for(var R=0;R<D;R++)Y.__setDigit(R,0);for(;R<S;R++)Y.__setDigit(R,c.__digit(R-D))}else{for(var V=0,J=0;J<D;J++)Y.__setDigit(J,0);for(var U,B=0;B<_;B++)U=c.__digit(B),Y.__setDigit(B+D,1073741823&U<<b|V),V=U>>>30-b;if(T)Y.__setDigit(_+D,V);else if(V!==0)throw new Error("implementation bug")}return Y.__trim()}},{key:"__rightShiftByAbsolute",value:function(c,d){var v=c.length,D=c.sign,b=g.__toShiftAmount(d);if(0>b)return g.__rightShiftByMaximum(D);var _=0|b/30,T=b%30,S=v-_;if(0>=S)return g.__rightShiftByMaximum(D);var Y=!1;if(D){var R=(1<<T)-1;if(c.__digit(_)&R)Y=!0;else for(var V=0;V<_;V++)if(c.__digit(V)!==0){Y=!0;break}}if(Y&&T===0){var J=c.__digit(v-1),U=~J==0;U&&S++}var B=new g(S,D);if(T===0){B.__setDigit(S-1,0);for(var ee=_;ee<v;ee++)B.__setDigit(ee-_,c.__digit(ee))}else{for(var ce,pe=c.__digit(_)>>>T,ve=v-_-1,Ce=0;Ce<ve;Ce++)ce=c.__digit(Ce+_+1),B.__setDigit(Ce,1073741823&ce<<30-T|pe),pe=ce>>>T;B.__setDigit(ve,pe)}return Y&&(B=g.__absoluteAddOne(B,!0,B)),B.__trim()}},{key:"__rightShiftByMaximum",value:function(c){return c?g.__oneDigit(1,!0):g.__zero()}},{key:"__toShiftAmount",value:function(c){if(1<c.length)return-1;var d=c.__unsignedDigit(0);return d>g.__kMaxLengthBits?-1:d}},{key:"__toPrimitive",value:function(c){var d=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"default";if(le(c)!=="object"||c.constructor===g)return c;if(typeof Symbol<"u"&&le(Symbol.toPrimitive)==="symbol"&&c[Symbol.toPrimitive]){var v=c[Symbol.toPrimitive](d);if(le(v)!=="object")return v;throw new TypeError("Cannot convert object to primitive value")}var D=c.valueOf;if(D){var b=D.call(c);if(le(b)!=="object")return b}var _=c.toString;if(_){var T=_.call(c);if(le(T)!=="object")return T}throw new TypeError("Cannot convert object to primitive value")}},{key:"__toNumeric",value:function(c){return g.__isBigInt(c)?c:+c}},{key:"__isBigInt",value:function(c){return le(c)==="object"&&c!==null&&c.constructor===g}},{key:"__truncateToNBits",value:function(c,d){for(var v=0|(c+29)/30,D=new g(v,d.sign),b=v-1,_=0;_<b;_++)D.__setDigit(_,d.__digit(_));var T=d.__digit(b);if(c%30!=0){var S=32-c%30;T=T<<S>>>S}return D.__setDigit(b,T),D.__trim()}},{key:"__truncateAndSubFromPowerOfTwo",value:function(c,d,v){for(var D=Math.min,b,_=0|(c+29)/30,T=new g(_,v),S=0,Y=_-1,R=0,V=D(Y,d.length);S<V;S++)b=0-d.__digit(S)-R,R=1&b>>>30,T.__setDigit(S,1073741823&b);for(;S<Y;S++)T.__setDigit(S,0|1073741823&-R);var J,U=Y<d.length?d.__digit(Y):0,B=c%30;if(B===0)J=0-U-R,J&=1073741823;else{var ee=32-B;U=U<<ee>>>ee;var ce=1<<32-ee;J=ce-U-R,J&=ce-1}return T.__setDigit(Y,J),T.__trim()}},{key:"__digitPow",value:function(c,d){for(var v=1;0<d;)1&d&&(v*=c),d>>>=1,c*=c;return v}},{key:"__detectBigEndian",value:function(){return g.__kBitConversionDouble[0]=-0,g.__kBitConversionInts[0]!==0}},{key:"__isOneDigitInt",value:function(c){return(1073741823&c)===c}}])}(_e(Array));return ne.__kMaxLength=33554432,ne.__kMaxLengthBits=ne.__kMaxLength<<5,ne.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],ne.__kBitsPerCharTableShift=5,ne.__kBitsPerCharTableMultiplier=1<<ne.__kBitsPerCharTableShift,ne.__kConversionChars=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],ne.__kBitConversionBuffer=new ArrayBuffer(8),ne.__kBitConversionDouble=new Float64Array(ne.__kBitConversionBuffer),ne.__kBitConversionInts=new Int32Array(ne.__kBitConversionBuffer),ne.__kBitConversionIntHigh=ne.__detectBigEndian()?0:1,ne.__kBitConversionIntLow=ne.__detectBigEndian()?1:0,ne.__clz30=t?function(N){return t(N)-2}:function(N){var F=Math.LN2,O=Math.log;return N===0?30:0|29-(0|O(N>>>0)/F)},ne.__imul=n||function(N,F){return 0|N*F},ne})});var Wn=()=>{};function hr(n,t,e,r){return n?(n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)):Wn}var gc=n=>n instanceof HTMLInputElement;var Ur=n=>{let{value:t}=n;if(n.type==="checkbox"&&(t=n.checked.toString()),n.type==="radio"){let e=n.closest("form")?.querySelector(`input[name="${n.name}"]:checked`);t=gc(e)?e.value:""}return t.toString()};var ba=class{constructor(){j(this,"listeners",new Map)}on(t,e){this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(e)}off(t,e){this.listeners.get(t)?.delete(e)}emit(t,e){this.listeners.get(t)?.forEach(r=>r(e))}},ro=new ba;function Qt(n,t){ro.emit(n,t)}function In(n,t){Array.isArray(n)?n.forEach(e=>ro.on(e,t)):ro.on(n,t)}function Da(n){let t=Object.create(null);for(let e of n.split(","))t[e]=1;return e=>e in t}var _a=Object.assign;var Pd=Object.prototype.hasOwnProperty,io=(n,t)=>Pd.call(n,t),Kn=Array.isArray,Vr=n=>yc(n)==="[object Map]";var Rd=n=>typeof n=="string",mr=n=>typeof n=="symbol",qr=n=>n!==null&&typeof n=="object";var Ad=Object.prototype.toString,yc=n=>Ad.call(n),vc=n=>yc(n).slice(8,-1);var oo=n=>Rd(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n;var ao=n=>{let t=Object.create(null);return e=>t[e]||(t[e]=n(e))},Nd=/-(\w)/g,Cm=ao(n=>n.replace(Nd,(t,e)=>e?e.toUpperCase():"")),Ld=/\B([A-Z])/g,Im=ao(n=>n.replace(Ld,"-$1").toLowerCase()),Od=ao(n=>n.charAt(0).toUpperCase()+n.slice(1)),xm=ao(n=>n?`on${Od(n)}`:""),Zn=(n,t)=>!Object.is(n,t);var Yd="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";var Pm=Da(Yd+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var Ea;var Ie;var Ma=new WeakSet,lo=class{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Ea&&Ea.active&&Ea.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Ma.has(this)&&(Ma.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Fd(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,wc(this),_c(this);let t=Ie,e=Wt;Ie=this,Wt=!0;try{return this.fn()}finally{Ec(this),Ie=t,Wt=e,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Fa(t);this.deps=this.depsTail=void 0,wc(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Ma.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ta(this)&&this.run()}get dirty(){return Ta(this)}},Dc=0,Kr,Zr;function Fd(n,t=!1){if(n.flags|=8,t){n.next=Zr,Zr=n;return}n.next=Kr,Kr=n}function Oa(){Dc++}function Ya(){if(--Dc>0)return;if(Zr){let t=Zr;for(Zr=void 0;t;){let e=t.next;t.next=void 0,t.flags&=-9,t=e}}let n;for(;Kr;){let t=Kr;for(Kr=void 0;t;){let e=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){n||(n=r)}t=e}}if(n)throw n}function _c(n){for(let t=n.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ec(n){let t,e=n.depsTail,r=e;for(;r;){let i=r.prevDep;r.version===-1?(r===e&&(e=i),Fa(r),jd(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}n.deps=t,n.depsTail=e}function Ta(n){for(let t=n.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Hd(t.dep.computed)||t.dep.version!==t.version))return!0;return!!n._dirty}function Hd(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===uo)||(n.globalVersion=uo,!n.isSSR&&n.flags&128&&(!n.deps&&!n._dirty||!Ta(n))))return;n.flags|=2;let t=n.dep,e=Ie,r=Wt;Ie=n,Wt=!0;try{_c(n);let i=n.fn(n._value);(t.version===0||Zn(i,n._value))&&(n.flags|=128,n._value=i,t.version++)}catch(i){throw t.version++,i}finally{Ie=e,Wt=r,Ec(n),n.flags&=-3}}function Fa(n,t=!1){let{dep:e,prevSub:r,nextSub:i}=n;if(r&&(r.nextSub=i,n.prevSub=void 0),i&&(i.prevSub=r,n.nextSub=void 0),e.subs===n&&(e.subs=r,!r&&e.computed)){e.computed.flags&=-5;for(let o=e.computed.deps;o;o=o.nextDep)Fa(o,!0)}!t&&!--e.sc&&e.map&&e.map.delete(e.key)}function jd(n){let{prevDep:t,nextDep:e}=n;t&&(t.nextDep=e,n.prevDep=void 0),e&&(e.prevDep=t,n.nextDep=void 0)}function Mc(n,t){n.effect instanceof lo&&(n=n.effect.fn);let e=new lo(n);t&&_a(e,t);try{e.run()}catch(i){throw e.stop(),i}let r=e.run.bind(e);return r.effect=e,r}var Wt=!0,kc=[];function Bd(){kc.push(Wt),Wt=!1}function $d(){let n=kc.pop();Wt=n===void 0?!0:n}function wc(n){let{cleanup:t}=n;if(n.cleanup=void 0,t){let e=Ie;Ie=void 0;try{t()}finally{Ie=e}}}var uo=0,Ca=class{constructor(t,e){this.sub=t,this.dep=e,this.version=e.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},ho=class{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(t){if(!Ie||!Wt||Ie===this.computed)return;let e=this.activeLink;if(e===void 0||e.sub!==Ie)e=this.activeLink=new Ca(Ie,this),Ie.deps?(e.prevDep=Ie.depsTail,Ie.depsTail.nextDep=e,Ie.depsTail=e):Ie.deps=Ie.depsTail=e,Sc(e);else if(e.version===-1&&(e.version=this.version,e.nextDep)){let r=e.nextDep;r.prevDep=e.prevDep,e.prevDep&&(e.prevDep.nextDep=r),e.prevDep=Ie.depsTail,e.nextDep=void 0,Ie.depsTail.nextDep=e,Ie.depsTail=e,Ie.deps===e&&(Ie.deps=r)}return e}trigger(t){this.version++,uo++,this.notify(t)}notify(t){Oa();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{Ya()}}};function Sc(n){if(n.dep.sc++,n.sub.flags&4){let t=n.dep.computed;if(t&&!n.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)Sc(r)}let e=n.dep.subs;e!==n&&(n.prevSub=e,e&&(e.nextSub=n)),n.dep.subs=n}}var Ia=new WeakMap,Gn=Symbol(""),xa=Symbol(""),Gr=Symbol("");function _t(n,t,e){if(Wt&&Ie){let r=Ia.get(n);r||Ia.set(n,r=new Map);let i=r.get(e);i||(r.set(e,i=new ho),i.map=r,i.key=e),i.track()}}function xn(n,t,e,r,i,o){let a=Ia.get(n);if(!a){uo++;return}let s=l=>{l&&l.trigger()};if(Oa(),t==="clear")a.forEach(s);else{let l=Kn(n),u=l&&oo(e);if(l&&e==="length"){let m=Number(r);a.forEach((f,y)=>{(y==="length"||y===Gr||!mr(y)&&y>=m)&&s(f)})}else switch((e!==void 0||a.has(void 0))&&s(a.get(e)),u&&s(a.get(Gr)),t){case"add":l?u&&s(a.get("length")):(s(a.get(Gn)),Vr(n)&&s(a.get(xa)));break;case"delete":l||(s(a.get(Gn)),Vr(n)&&s(a.get(xa)));break;case"set":Vr(n)&&s(a.get(Gn));break}}Ya()}function fr(n){let t=Se(n);return t===n?t:(_t(t,"iterate",Gr),Pn(n)?t:t.map(it))}function Ha(n){return _t(n=Se(n),"iterate",Gr),n}var zd={__proto__:null,[Symbol.iterator](){return ka(this,Symbol.iterator,it)},concat(...n){return fr(this).concat(...n.map(t=>Kn(t)?fr(t):t))},entries(){return ka(this,"entries",n=>(n[1]=it(n[1]),n))},every(n,t){return dn(this,"every",n,t,void 0,arguments)},filter(n,t){return dn(this,"filter",n,t,e=>e.map(it),arguments)},find(n,t){return dn(this,"find",n,t,it,arguments)},findIndex(n,t){return dn(this,"findIndex",n,t,void 0,arguments)},findLast(n,t){return dn(this,"findLast",n,t,it,arguments)},findLastIndex(n,t){return dn(this,"findLastIndex",n,t,void 0,arguments)},forEach(n,t){return dn(this,"forEach",n,t,void 0,arguments)},includes(...n){return Sa(this,"includes",n)},indexOf(...n){return Sa(this,"indexOf",n)},join(n){return fr(this).join(n)},lastIndexOf(...n){return Sa(this,"lastIndexOf",n)},map(n,t){return dn(this,"map",n,t,void 0,arguments)},pop(){return Wr(this,"pop")},push(...n){return Wr(this,"push",n)},reduce(n,...t){return bc(this,"reduce",n,t)},reduceRight(n,...t){return bc(this,"reduceRight",n,t)},shift(){return Wr(this,"shift")},some(n,t){return dn(this,"some",n,t,void 0,arguments)},splice(...n){return Wr(this,"splice",n)},toReversed(){return fr(this).toReversed()},toSorted(n){return fr(this).toSorted(n)},toSpliced(...n){return fr(this).toSpliced(...n)},unshift(...n){return Wr(this,"unshift",n)},values(){return ka(this,"values",it)}};function ka(n,t,e){let r=Ha(n),i=r[t]();return r!==n&&!Pn(n)&&(i._next=i.next,i.next=()=>{let o=i._next();return o.value&&(o.value=e(o.value)),o}),i}var Ud=Array.prototype;function dn(n,t,e,r,i,o){let a=Ha(n),s=a!==n&&!Pn(n),l=a[t];if(l!==Ud[t]){let f=l.apply(n,o);return s?it(f):f}let u=e;a!==n&&(s?u=function(f,y){return e.call(this,it(f),y,n)}:e.length>2&&(u=function(f,y){return e.call(this,f,y,n)}));let m=l.call(a,u,r);return s&&i?i(m):m}function bc(n,t,e,r){let i=Ha(n),o=e;return i!==n&&(Pn(n)?e.length>3&&(o=function(a,s,l){return e.call(this,a,s,l,n)}):o=function(a,s,l){return e.call(this,a,it(s),l,n)}),i[t](o,...r)}function Sa(n,t,e){let r=Se(n);_t(r,"iterate",Gr);let i=r[t](...e);return(i===-1||i===!1)&&rh(e[0])?(e[0]=Se(e[0]),r[t](...e)):i}function Wr(n,t,e=[]){Bd(),Oa();let r=Se(n)[t].apply(n,e);return Ya(),$d(),r}var Vd=Da("__proto__,__v_isRef,__isVue"),Tc=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(mr));function qd(n){mr(n)||(n=String(n));let t=Se(this);return _t(t,"has",n),t.hasOwnProperty(n)}var mo=class{constructor(t=!1,e=!1){this._isReadonly=t,this._isShallow=e}get(t,e,r){if(e==="__v_skip")return t.__v_skip;let i=this._isReadonly,o=this._isShallow;if(e==="__v_isReactive")return!i;if(e==="__v_isReadonly")return i;if(e==="__v_isShallow")return o;if(e==="__v_raw")return r===(i?o?eh:xc:o?Qd:Ic).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;let a=Kn(t);if(!i){let l;if(a&&(l=zd[e]))return l;if(e==="hasOwnProperty")return qd}let s=Reflect.get(t,e,pr(t)?t:r);return(mr(e)?Tc.has(e):Vd(e))||(i||_t(t,"get",e),o)?s:pr(s)?a&&oo(e)?s:s.value:qr(s)?i?fo(s):yr(s):s}},Pa=class extends mo{constructor(t=!1){super(!1,t)}set(t,e,r,i){let o=t[e];if(!this._isShallow){let l=gr(o);if(!Pn(r)&&!gr(r)&&(o=Se(o),r=Se(r)),!Kn(t)&&pr(o)&&!pr(r))return l?!1:(o.value=r,!0)}let a=Kn(t)&&oo(e)?Number(e)<t.length:io(t,e),s=Reflect.set(t,e,r,pr(t)?t:i);return t===Se(i)&&(a?Zn(r,o)&&xn(t,"set",e,r,o):xn(t,"add",e,r)),s}deleteProperty(t,e){let r=io(t,e),i=t[e],o=Reflect.deleteProperty(t,e);return o&&r&&xn(t,"delete",e,void 0,i),o}has(t,e){let r=Reflect.has(t,e);return(!mr(e)||!Tc.has(e))&&_t(t,"has",e),r}ownKeys(t){return _t(t,"iterate",Kn(t)?"length":Gn),Reflect.ownKeys(t)}},Ra=class extends mo{constructor(t=!1){super(!0,t)}set(t,e){return!0}deleteProperty(t,e){return!0}},Wd=new Pa,Kd=new Ra;var Aa=n=>n,so=n=>Reflect.getPrototypeOf(n);function Zd(n,t,e){return function(...r){let i=this.__v_raw,o=Se(i),a=Vr(o),s=n==="entries"||n===Symbol.iterator&&a,l=n==="keys"&&a,u=i[n](...r),m=e?Aa:t?Na:it;return!t&&_t(o,"iterate",l?xa:Gn),{next(){let{value:f,done:y}=u.next();return y?{value:f,done:y}:{value:s?[m(f[0]),m(f[1])]:m(f),done:y}},[Symbol.iterator](){return this}}}}function co(n){return function(...t){return n==="delete"?!1:n==="clear"?void 0:this}}function Gd(n,t){let e={get(i){let o=this.__v_raw,a=Se(o),s=Se(i);n||(Zn(i,s)&&_t(a,"get",i),_t(a,"get",s));let{has:l}=so(a),u=t?Aa:n?Na:it;if(l.call(a,i))return u(o.get(i));if(l.call(a,s))return u(o.get(s));o!==a&&o.get(i)},get size(){let i=this.__v_raw;return!n&&_t(Se(i),"iterate",Gn),Reflect.get(i,"size",i)},has(i){let o=this.__v_raw,a=Se(o),s=Se(i);return n||(Zn(i,s)&&_t(a,"has",i),_t(a,"has",s)),i===s?o.has(i):o.has(i)||o.has(s)},forEach(i,o){let a=this,s=a.__v_raw,l=Se(s),u=t?Aa:n?Na:it;return!n&&_t(l,"iterate",Gn),s.forEach((m,f)=>i.call(o,u(m),u(f),a))}};return _a(e,n?{add:co("add"),set:co("set"),delete:co("delete"),clear:co("clear")}:{add(i){!t&&!Pn(i)&&!gr(i)&&(i=Se(i));let o=Se(this);return so(o).has.call(o,i)||(o.add(i),xn(o,"add",i,i)),this},set(i,o){!t&&!Pn(o)&&!gr(o)&&(o=Se(o));let a=Se(this),{has:s,get:l}=so(a),u=s.call(a,i);u||(i=Se(i),u=s.call(a,i));let m=l.call(a,i);return a.set(i,o),u?Zn(o,m)&&xn(a,"set",i,o,m):xn(a,"add",i,o),this},delete(i){let o=Se(this),{has:a,get:s}=so(o),l=a.call(o,i);l||(i=Se(i),l=a.call(o,i));let u=s?s.call(o,i):void 0,m=o.delete(i);return l&&xn(o,"delete",i,void 0,u),m},clear(){let i=Se(this),o=i.size!==0,a=void 0,s=i.clear();return o&&xn(i,"clear",void 0,void 0,a),s}}),["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=Zd(i,n,t)}),e}function Cc(n,t){let e=Gd(n,t);return(r,i,o)=>i==="__v_isReactive"?!n:i==="__v_isReadonly"?n:i==="__v_raw"?r:Reflect.get(io(e,i)&&i in r?e:r,i,o)}var Jd={get:Cc(!1,!1)};var Xd={get:Cc(!0,!1)};var Ic=new WeakMap,Qd=new WeakMap,xc=new WeakMap,eh=new WeakMap;function th(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function nh(n){return n.__v_skip||!Object.isExtensible(n)?0:th(vc(n))}function yr(n){return gr(n)?n:Pc(n,!1,Wd,Jd,Ic)}function fo(n){return Pc(n,!0,Kd,Xd,xc)}function Pc(n,t,e,r,i){if(!qr(n)||n.__v_raw&&!(t&&n.__v_isReactive))return n;let o=nh(n);if(o===0)return n;let a=i.get(n);if(a)return a;let s=new Proxy(n,o===2?r:e);return i.set(n,s),s}function gr(n){return!!(n&&n.__v_isReadonly)}function Pn(n){return!!(n&&n.__v_isShallow)}function rh(n){return n?!!n.__v_raw:!1}function Se(n){let t=n&&n.__v_raw;return t?Se(t):n}var it=n=>qr(n)?yr(n):n,Na=n=>qr(n)?fo(n):n;function pr(n){return n?n.__v_isRef===!0:!1}function Ge(n){return ih(n,!1)}function ih(n,t){return pr(n)?n:new La(n,t)}var La=class{constructor(t,e){this.dep=new ho,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=e?t:Se(t),this._value=e?t:it(t),this.__v_isShallow=e}get value(){return this.dep.track(),this._value}set value(t){let e=this._rawValue,r=this.__v_isShallow||Pn(t)||gr(t);t=r?t:Se(t),Zn(t,e)&&(this._rawValue=t,this._value=r?t:it(t),this.dep.trigger())}};var k=xd(Rc(),1),Lt=k.default.BigInt(0),fi=k.default.BigInt(1),As=k.default.BigInt(2),oh=k.default.BigInt(10),ah=k.default.BigInt(24),sh=k.default.BigInt(60),ch=k.default.BigInt(1e3),Ri=k.default.BigInt(1e6),ci=k.default.BigInt(1e9),ml=k.default.multiply(k.default.BigInt(3600),ci),lh=k.default.multiply(sh,ci),Yn=k.default.multiply(ml,ah);function mn(n){return typeof n=="bigint"?k.default.BigInt(n.toString(10)):n}function fl(n){return k.default.equal(k.default.remainder(n,As),Lt)}function Jn(n){return k.default.lessThan(n,Lt)?k.default.unaryMinus(n):n}function yo(n,t){return k.default.lessThan(n,t)?-1:k.default.greaterThan(n,t)?1:0}function ei(n,t){return{quotient:k.default.divide(n,t),remainder:k.default.remainder(n,t)}}var Ac,Nc,oe="slot-epochNanoSeconds",ae="slot-iso-date",xe="slot-iso-date-time",Ne="slot-time",H="slot-calendar",pl="slot-date-brand",gl="slot-year-month-brand",yl="slot-month-day-brand",De="slot-time-zone",ct="slot-years",lt="slot-months",Et="slot-weeks",ut="slot-days",dt="slot-hours",ht="slot-minutes",mt="slot-seconds",ft="slot-milliseconds",pt="slot-microseconds",Mt="slot-nanoseconds",vl="date",wl="ym",bl="md",Dl="time",_l="datetime",El="instant",cr="original",Dr="timezone-canonical",Wa="timezone-original",ti="calendar-id",Ml="locale",Ka="options",kl=new WeakMap,Za=Symbol.for("@@Temporal__GetSlots");(Ac=globalThis)[Za]||(Ac[Za]=function(n){return kl.get(n)});var Ao=globalThis[Za],Ga=Symbol.for("@@Temporal__CreateSlots");(Nc=globalThis)[Ga]||(Nc[Ga]=function(n){kl.set(n,Object.create(null))});var Mn=globalThis[Ga];function bt(n,...t){if(!n||typeof n!="object")return!1;let e=Ao(n);return!!e&&t.every(r=>r in e)}function h(n,t){let e=Ao(n)?.[t];if(e===void 0)throw new TypeError(`Missing internal slot ${t}`);return e}function me(n,t,e){let r=Ao(n);if(r===void 0)throw new TypeError("Missing slots for the given container");if(r[t])throw new TypeError(`${t} already has set`);r[t]=e}var Ja={};function kn(n,t){Object.defineProperty(n.prototype,Symbol.toStringTag,{value:t,writable:!1,enumerable:!1,configurable:!0});let e=Object.getOwnPropertyNames(n);for(let i=0;i<e.length;i++){let o=e[i],a=Object.getOwnPropertyDescriptor(n,o);a.configurable&&a.enumerable&&(a.enumerable=!1,Object.defineProperty(n,o,a))}let r=Object.getOwnPropertyNames(n.prototype);for(let i=0;i<r.length;i++){let o=r[i],a=Object.getOwnPropertyDescriptor(n.prototype,o);a.configurable&&a.enumerable&&(a.enumerable=!1,Object.defineProperty(n.prototype,o,a))}Xa(t,n),Xa(`${t}.prototype`,n.prototype)}function Xa(n,t){let e=`%${n}%`;if(Ja[e]!==void 0)throw new Error(`intrinsic ${n} already exists`);Ja[e]=t}function We(n){return Ja[n]}function Er(n,t){let e=n;if(e===0)return{div:e,mod:e};let r=Math.sign(e);e=Math.abs(e);let i=Math.trunc(1+Math.log10(e));if(t>=i)return{div:0*r,mod:r*e};if(t===0)return{div:r*e,mod:0*r};let o=e.toPrecision(i);return{div:r*Number.parseInt(o.slice(0,i-t),10),mod:r*Number.parseInt(o.slice(i-t),10)}}function $a(n,t,e){let r=n,i=e;if(r===0)return i;let o=Math.sign(r)||Math.sign(i);r=Math.abs(r),i=Math.abs(i);let a=r.toPrecision(Math.trunc(1+Math.log10(r)));if(i===0)return o*Number.parseInt(a+"0".repeat(t),10);let s=a+i.toPrecision(Math.trunc(1+Math.log10(i))).padStart(t,"0");return o*Number.parseInt(s,10)}function No(n,t){let e=t==="negative";switch(n){case"ceil":return e?"zero":"infinity";case"floor":return e?"infinity":"zero";case"expand":return"infinity";case"trunc":return"zero";case"halfCeil":return e?"half-zero":"half-infinity";case"halfFloor":return e?"half-infinity":"half-zero";case"halfExpand":return"half-infinity";case"halfTrunc":return"half-zero";case"halfEven":return"half-even"}}function Lo(n,t,e,r,i){return i==="zero"?n:i==="infinity"?t:e<0?n:e>0?t:i==="half-zero"?n:i==="half-infinity"?t:r?n:t}var Ee=class n{constructor(t){this.totalNs=mn(t),this.sec=k.default.toNumber(k.default.divide(this.totalNs,ci)),this.subsec=k.default.toNumber(k.default.remainder(this.totalNs,ci))}static validateNew(t,e){if(k.default.greaterThan(Jn(t),n.MAX))throw new RangeError(`${e} of duration time units cannot exceed ${n.MAX} s`);return new n(t)}static fromEpochNsDiff(t,e){let r=k.default.subtract(mn(t),mn(e));return new n(r)}static fromComponents(t,e,r,i,o,a){let s=k.default.add(k.default.add(k.default.add(k.default.add(k.default.add(k.default.BigInt(a),k.default.multiply(k.default.BigInt(o),ch)),k.default.multiply(k.default.BigInt(i),Ri)),k.default.multiply(k.default.BigInt(r),ci)),k.default.multiply(k.default.BigInt(e),lh)),k.default.multiply(k.default.BigInt(t),ml));return n.validateNew(s,"total")}abs(){return new n(Jn(this.totalNs))}add(t){return n.validateNew(k.default.add(this.totalNs,t.totalNs),"sum")}add24HourDays(t){return n.validateNew(k.default.add(this.totalNs,k.default.multiply(k.default.BigInt(t),Yn)),"sum")}addToEpochNs(t){return k.default.add(mn(t),this.totalNs)}cmp(t){return yo(this.totalNs,t.totalNs)}divmod(t){let{quotient:e,remainder:r}=ei(this.totalNs,k.default.BigInt(t));return{quotient:k.default.toNumber(e),remainder:new n(r)}}fdiv(t){let e=mn(t),r=k.default.BigInt(e),{quotient:i,remainder:o}=ei(this.totalNs,r),a=[],s,l=(k.default.lessThan(this.totalNs,Lt)?-1:1)*Math.sign(k.default.toNumber(e));for(;!k.default.equal(o,Lt)&&a.length<50;)o=k.default.multiply(o,oh),{quotient:s,remainder:o}=ei(o,r),a.push(Math.abs(k.default.toNumber(s)));return l*+(Jn(i).toString()+"."+a.join(""))}isZero(){return k.default.equal(this.totalNs,Lt)}round(t,e){let r=mn(t);if(k.default.equal(r,fi))return this;let{quotient:i,remainder:o}=ei(this.totalNs,r),a=k.default.lessThan(this.totalNs,Lt)?"negative":"positive",s=k.default.multiply(Jn(i),r),l=k.default.add(s,r),u=yo(Jn(k.default.multiply(o,As)),r),m=No(e,a),f=k.default.equal(Jn(this.totalNs),s)?s:Lo(s,l,u,fl(i),m),y=a==="positive"?f:k.default.unaryMinus(f);return n.validateNew(y,"rounding")}sign(){return this.cmp(new n(Lt))}subtract(t){return n.validateNew(k.default.subtract(this.totalNs,t.totalNs),"difference")}};Ee.MAX=k.default.BigInt("9007199254740991999999999"),Ee.ZERO=new Ee(Lt);var Lc=/[A-Za-z._][A-Za-z._0-9+-]*/,Ai=new RegExp(`(?:${/(?:[+-](?:[01][0-9]|2[0-3])(?::?[0-5][0-9])?)/.source}|(?:${Lc.source})(?:\\/(?:${Lc.source}))*)`),Sl=/(?:[+-]\d{6}|\d{4})/,vo=/(?:0[1-9]|1[0-2])/,Qa=/(?:0[1-9]|[12]\d|3[01])/,uh=new RegExp(`(${Sl.source})(?:-(${vo.source})-(${Qa.source})|(${vo.source})(${Qa.source}))`),Tl=/(\d{2})(?::(\d{2})(?::(\d{2})(?:[.,](\d{1,9}))?)?|(\d{2})(?:(\d{2})(?:[.,](\d{1,9}))?)?)?/,Cl=/((?:[+-])(?:[01][0-9]|2[0-3])(?::?(?:[0-5][0-9])(?::?(?:[0-5][0-9])(?:[.,](?:\d{1,9}))?)?)?)/,Il=new RegExp(`([zZ])|${Cl.source}?`),Tr=/\[(!)?([a-z_][a-z0-9_-]*)=([A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)\]/g,dh=new RegExp([`^${uh.source}`,`(?:(?:[tT]|\\s+)${Tl.source}(?:${Il.source})?)?`,`(?:\\[!?(${Ai.source})\\])?`,`((?:${Tr.source})*)$`].join("")),hh=new RegExp([`^[tT]?${Tl.source}`,`(?:${Il.source})?`,`(?:\\[!?${Ai.source}\\])?`,`((?:${Tr.source})*)$`].join("")),mh=new RegExp(`^(${Sl.source})-?(${vo.source})(?:\\[!?${Ai.source}\\])?((?:${Tr.source})*)$`),fh=new RegExp(`^(?:--)?(${vo.source})-?(${Qa.source})(?:\\[!?${Ai.source}\\])?((?:${Tr.source})*)$`),za=/(\d+)(?:[.,](\d{1,9}))?/,ph=new RegExp(`(?:${za.source}H)?(?:${za.source}M)?(?:${za.source}S)?`),gh=new RegExp(`^([+-])?P${/(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/.source}(?:T(?!$)${ph.source})?$`,"i"),Fn=864e5,wo=1e6*Fn,yh=6e10,xl=1e8*Fn,Cr=Gt(xl),pi=k.default.unaryMinus(Cr),vh=k.default.add(k.default.subtract(pi,Yn),fi),wh=k.default.subtract(k.default.add(Cr,Yn),fi),bh=146097*Fn,Oc=-271821,Yc=275760,li=Date.UTC(1847,0,1),Dh=["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"],_h=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 Le(n){return typeof n=="object"&&n!==null||typeof n=="function"}function Oo(n){if(typeof n=="bigint")throw new TypeError("Cannot convert BigInt to number");return Number(n)}function Yo(n){if(typeof n=="symbol")throw new TypeError("Cannot convert a Symbol value to a String");return String(n)}function ue(n){let t=Oo(n);if(t===0)return 0;if(Number.isNaN(t)||t===1/0||t===-1/0)throw new RangeError("invalid number value");let e=Math.trunc(t);return e===0?0:e}function Fc(n,t){let e=ue(n);if(e<=0)throw t!==void 0?new RangeError(`property '${t}' cannot be a a number less than one`):new RangeError("Cannot convert a number less than one to a positive integer");return e}function Kt(n){let t=Oo(n);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(typeof e!="number"||Number.isNaN(e)||e===1/0||e===-1/0)return!1;let r=Math.abs(e);return Math.floor(r)===r}(t))throw new RangeError(`unsupported fractional value ${n}`);return t===0?0:t}function gi(n,t){return String(n).padStart(t,"0")}function Be(n){if(typeof n!="string")throw new TypeError(`expected a string, not ${String(n)}`);return n}function es(n,t){if(Le(n)){let e=n?.toString();if(typeof e=="string"||typeof e=="number")return e;throw new TypeError("Cannot convert object to primitive value")}return n}var ts=["era","eraYear","year","month","monthCode","day","hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],Eh={era:Yo,eraYear:ue,year:ue,month:Fc,monthCode:function(n){let t=Be(es(n));if(t.length<3||t.length>4||t[0]!=="M"||"0123456789".indexOf(t[1])===-1||"0123456789".indexOf(t[2])===-1||t[1]+t[2]==="00"&&t[3]!=="L"||t[3]!=="L"&&t[3]!==void 0)throw new RangeError(`bad month code ${t}; must match M01-M99 or M00L-M99L`);return t},day:Fc,hour:ue,minute:ue,second:ue,millisecond:ue,microsecond:ue,nanosecond:ue,offset:function(n){let t=Be(es(n));return Yr(t),t},timeZone:vt},Mh={hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},Ir=[["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"]],Hc=Object.fromEntries(Ir.map(n=>[n[0],n[1]])),kh=Object.fromEntries(Ir.map(([n,t])=>[t,n])),ui=Ir.map(([,n])=>n),xr={day:wo,hour:36e11,minute:6e10,second:1e9,millisecond:1e6,microsecond:1e3,nanosecond:1},bo=["days","hours","microseconds","milliseconds","minutes","months","nanoseconds","seconds","weeks","years"],Sh=Intl.DateTimeFormat,jc=new Map;function Pl(n){let t=Di(n),e=jc.get(t);return e===void 0&&(e=new Sh("en-us",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),jc.set(t,e)),e}function Ue(n){return bt(n,oe)&&!bt(n,De,H)}function Re(n){return bt(n,ct,lt,ut,dt,ht,mt,ft,pt,Mt)}function Ae(n){return bt(n,pl)}function Oe(n){return bt(n,Ne)}function Te(n){return bt(n,xe)}function Ve(n){return bt(n,gl)}function Nt(n){return bt(n,yl)}function fe(n){return bt(n,oe,De,H)}function C(n,t){if(!t(n))throw new TypeError("invalid receiver: method called with the wrong type of this-object")}function Nr(n){if(bt(n,H)||bt(n,De))throw new TypeError("with() does not support a calendar or timeZone property");if(Oe(n))throw new TypeError("with() does not accept Temporal.PlainTime, use withPlainTime() instead");if(n.calendar!==void 0)throw new TypeError("with() does not support a calendar property");if(n.timeZone!==void 0)throw new TypeError("with() does not support a timeZone property")}function Ni(n,t){return t==="never"||t==="auto"&&n==="iso8601"?"":`[${t==="critical"?"!":""}u-ca=${n}]`}function Fo(n){let t,e,r=!1;for(Tr.lastIndex=0;e=Tr.exec(n);){let{1:i,2:o,3:a}=e;if(o==="u-ca"){if(t===void 0)t=a,r=i==="!";else if(i==="!"||r)throw new RangeError(`Invalid annotations in ${n}: more than one u-ca present with critical flag`)}else if(i==="!")throw new RangeError(`Unrecognized annotation: !${o}=${a}`)}return t}function ln(n){let t=dh.exec(n);if(!t)throw new RangeError(`invalid RFC 9557 string: ${n}`);let e=Fo(t[16]),r=t[1];if(r==="-000000")throw new RangeError(`invalid RFC 9557 string: ${n}`);let i=+r,o=+(t[2]??t[4]??1),a=+(t[3]??t[5]??1),s=t[6]!==void 0,l=+(t[6]??0),u=+(t[7]??t[10]??0),m=+(t[8]??t[11]??0);m===60&&(m=59);let f=(t[9]??t[12]??"")+"000000000",y=+f.slice(0,3),E=+f.slice(3,6),x=+f.slice(6,9),I,L=!1;t[13]?(I=void 0,L=!0):t[14]&&(I=t[14]);let z=t[15];return Hs(i,o,a,l,u,m,y,E,x),{year:i,month:o,day:a,time:s?{hour:l,minute:u,second:m,millisecond:y,microsecond:E,nanosecond:x}:"start-of-day",tzAnnotation:z,offset:I,z:L,calendar:e}}function Rl(n){let t=hh.exec(n),e,r,i,o,a,s,l;if(t){l=Fo(t[10]),e=+(t[1]??0),r=+(t[2]??t[5]??0),i=+(t[3]??t[6]??0),i===60&&(i=59);let u=(t[4]??t[7]??"")+"000000000";if(o=+u.slice(0,3),a=+u.slice(3,6),s=+u.slice(6,9),t[8])throw new RangeError("Z designator not supported for PlainTime")}else{let u,m;if({time:u,z:m,calendar:l}=ln(n),u==="start-of-day")throw new RangeError(`time is missing in string: ${n}`);if(m)throw new RangeError("Z designator not supported for PlainTime");({hour:e,minute:r,second:i,millisecond:o,microsecond:a,nanosecond:s}=u)}if($o(e,r,i,o,a,s),/[tT ][0-9][0-9]/.test(n))return{hour:e,minute:r,second:i,millisecond:o,microsecond:a,nanosecond:s,calendar:l};try{let{month:u,day:m}=Ls(n);nr(1972,u,m)}catch{try{let{year:u,month:m}=Ns(n);nr(u,m,1)}catch{return{hour:e,minute:r,second:i,millisecond:o,microsecond:a,nanosecond:s,calendar:l}}}throw new RangeError(`invalid RFC 9557 time-only string ${n}; may need a T prefix`)}function Ns(n){let t=mh.exec(n),e,r,i,o;if(t){i=Fo(t[3]);let a=t[1];if(a==="-000000")throw new RangeError(`invalid RFC 9557 string: ${n}`);if(e=+a,r=+t[2],o=1,i!==void 0&&i!=="iso8601")throw new RangeError("YYYY-MM format is only valid with iso8601 calendar")}else{let a;if({year:e,month:r,calendar:i,day:o,z:a}=ln(n),a)throw new RangeError("Z designator not supported for PlainYearMonth")}return{year:e,month:r,calendar:i,referenceISODay:o}}function Ls(n){let t=fh.exec(n),e,r,i,o;if(t){if(i=Fo(t[3]),e=+t[1],r=+t[2],i!==void 0&&i!=="iso8601")throw new RangeError("MM-DD format is only valid with iso8601 calendar")}else{let a;if({month:e,day:r,calendar:i,year:o,z:a}=ln(n),a)throw new RangeError("Z designator not supported for PlainMonthDay")}return{month:e,day:r,calendar:i,referenceISOYear:o}}var Al=new RegExp(`^${Ai.source}$`,"i"),Nl=new RegExp(`^${/([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])?)?/.source}$`);function Ll(n){let t=Ch.test(n)?"Seconds not allowed in offset time zone":"Invalid time zone";throw new RangeError(`${t}: ${n}`)}function On(n){return Al.test(n)||Ll(n),Nl.test(n)?{offsetMinutes:Yr(n)/6e10}:{tzName:n}}function di(n,t,e,r){let i=n,o=t,a=e;switch(r){case"reject":nr(i,o,a);break;case"constrain":({year:i,month:o,day:a}=Xl(i,o,a))}return{year:i,month:o,day:a}}function Ho(n,t,e,r,i,o,a){let s=n,l=t,u=e,m=r,f=i,y=o;switch(a){case"reject":$o(s,l,u,m,f,y);break;case"constrain":s=gt(s,0,23),l=gt(l,0,59),u=gt(u,0,59),m=gt(m,0,999),f=gt(f,0,999),y=gt(y,0,999)}return{hour:s,minute:l,second:u,millisecond:m,microsecond:f,nanosecond:y}}function Ol(n){if(!Le(n))throw new TypeError("invalid duration-like");let 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},e=!1;for(let r=0;r<bo.length;r++){let i=bo[r],o=n[i];o!==void 0&&(e=!0,t[i]=Kt(o))}if(!e)throw new TypeError("invalid duration-like");return t}function Xe({years:n,months:t,weeks:e,days:r},i,o,a){return{years:n,months:a??t,weeks:o??e,days:i??r}}function we(n,t){return{isoDate:n,time:t}}function ye(n){return bn(n,"overflow",["constrain","reject"],"constrain")}function hi(n){return bn(n,"disambiguation",["compatible","earlier","later","reject"],"compatible")}function Jt(n,t){return bn(n,"roundingMode",["ceil","floor","expand","trunc","halfCeil","halfFloor","halfExpand","halfTrunc","halfEven"],t)}function go(n,t){return bn(n,"offset",["prefer","use","ignore","reject"],t)}function Li(n){return bn(n,"calendarName",["auto","always","never","critical"],"auto")}function Lr(n){let t=n.roundingIncrement;if(t===void 0)return 1;let e=ue(t);if(e<1||e>1e9)throw new RangeError(`roundingIncrement must be at least 1 and at most 1e9, not ${t}`);return e}function Or(n,t,e){let r=e?t:t-1;if(n>r)throw new RangeError(`roundingIncrement must be at least 1 and less than ${r}, not ${n}`);if(t%n!=0)throw new RangeError(`Rounding increment must divide evenly into ${t}`)}function Oi(n){let t=n.fractionalSecondDigits;if(t===void 0)return"auto";if(typeof t!="number"){if(Yo(t)!=="auto")throw new RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`);return"auto"}let e=Math.floor(t);if(!Number.isFinite(e)||e<0||e>9)throw new RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${t}`);return e}function Yi(n,t){switch(n){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}`)}}var _n=Symbol("~required~");function St(n,t,e,r,i=[]){let o=[];for(let u=0;u<Ir.length;u++){let m=Ir[u],f=m[1],y=m[2];e!=="datetime"&&e!==y||o.push(f)}o=o.concat(i);let a=r;a===_n?a=void 0:a!==void 0&&o.push(a);let s=[];s=s.concat(o);for(let u=0;u<o.length;u++){let m=o[u],f=kh[m];f!==void 0&&s.push(f)}let l=bn(n,t,s,a);if(l===void 0&&r===_n)throw new RangeError(`${t} is required`);return l&&l in Hc?Hc[l]:l}function Ua(n){let t=n.relativeTo;if(t===void 0)return{};let e,r,i,o,a,s="option",l=!1;if(Le(t)){if(fe(t))return{zonedRelativeTo:t};if(Ae(t))return{plainRelativeTo:t};if(Te(t))return{plainRelativeTo:yt(h(t,xe).isoDate,h(t,H))};i=$i(t);let u=Ht(i,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],[]);({isoDate:e,time:r}=Hi(i,u,"constrain")),{offset:a,timeZone:o}=u,a===void 0&&(s="wall")}else{let u,m,f,y,E;if({year:f,month:y,day:E,time:r,calendar:i,tzAnnotation:u,offset:a,z:m}=ln(Be(t)),u)o=vt(u),m?s="exact":a||(s="wall"),l=!0;else if(m)throw new RangeError("Z designator not supported for PlainDate relativeTo; either remove the Z or add a bracketed time zone");i||(i="iso8601"),i=Dt(i),e={year:f,month:y,day:E}}return o===void 0?{plainRelativeTo:yt(e,i)}:{zonedRelativeTo:Je(Do(e,r,s,s==="option"?Yr(a):0,o,"compatible","reject",l),o,i)}}function fn(n){return h(n,ct)!==0?"year":h(n,lt)!==0?"month":h(n,Et)!==0?"week":h(n,ut)!==0?"day":h(n,dt)!==0?"hour":h(n,ht)!==0?"minute":h(n,mt)!==0?"second":h(n,ft)!==0?"millisecond":h(n,pt)!==0?"microsecond":"nanosecond"}function vn(n,t){return ui.indexOf(n)>ui.indexOf(t)?t:n}function tn(n){return n==="year"||n==="month"||n==="week"}function pn(n){return tn(n)||n==="day"?"date":"time"}function Bn(n){return We("%calendarImpl%")(n)}function Fi(n){return We("%calendarImpl%")(h(n,H))}function wt(n,t,e="date"){let r=Object.create(null),i=Bn(n).isoToDate(t,{year:!0,monthCode:!0,day:!0});return r.monthCode=i.monthCode,e!=="month-day"&&e!=="date"||(r.day=i.day),e!=="year-month"&&e!=="date"||(r.year=i.year),r}function Ht(n,t,e,r,i){let o=Bn(n).extraFields(e),a=e.concat(r,o),s=Object.create(null),l=!1;a.sort();for(let u=0;u<a.length;u++){let m=a[u],f=t[m];if(f!==void 0)l=!0,s[m]=(0,Eh[m])(f);else if(i!=="partial"){if(i.includes(m))throw new TypeError(`required property '${m}' missing or undefined`);s[m]=Mh[m]}}if(i==="partial"&&!l)throw new TypeError("no supported properties found");return s}function ns(n,t="complete"){let e=["hour","microsecond","millisecond","minute","nanosecond","second"],r=!1,i=Object.create(null);for(let o=0;o<e.length;o++){let a=e[o],s=n[a];s!==void 0?(i[a]=ue(s),r=!0):t==="complete"&&(i[a]=0)}if(!r)throw new TypeError("invalid time-like");return i}function ni(n,t){if(Le(n)){if(Ae(n))return ye(X(t)),yt(h(n,ae),h(n,H));if(fe(n)){let l=Vt(h(n,De),h(n,oe));return ye(X(t)),yt(l.isoDate,h(n,H))}if(Te(n))return ye(X(t)),yt(h(n,xe).isoDate,h(n,H));let s=$i(n);return yt(Hn(s,Ht(s,n,["year","month","monthCode","day"],[],[]),ye(X(t))),s)}let{year:e,month:r,day:i,calendar:o,z:a}=ln(Be(n));if(a)throw new RangeError("Z designator not supported for PlainDate");return o||(o="iso8601"),o=Dt(o),ye(X(t)),yt({year:e,month:r,day:i},o)}function Hi(n,t,e){return we(Hn(n,t,e),Ho(t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond,e))}function ri(n,t){let e,r,i;if(Le(n)){if(Te(n))return ye(X(t)),$t(h(n,xe),h(n,H));if(fe(n)){let s=Vt(h(n,De),h(n,oe));return ye(X(t)),$t(s,h(n,H))}if(Ae(n))return ye(X(t)),$t(we(h(n,ae),{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),h(n,H));i=$i(n);let o=Ht(i,n,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond"],[]),a=ye(X(t));({isoDate:e,time:r}=Hi(i,o,a))}else{let o,a,s,l;if({year:a,month:s,day:l,time:r,calendar:i,z:o}=ln(Be(n)),o)throw new RangeError("Z designator not supported for PlainDateTime");r==="start-of-day"&&(r={deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),Hs(a,s,l,r.hour,r.minute,r.second,r.millisecond,r.microsecond,r.nanosecond),i||(i="iso8601"),i=Dt(i),ye(X(t)),e={year:a,month:s,day:l}}return $t(we(e,r),i)}function Ut(n){let t=We("%Temporal.Duration%");if(Re(n))return new t(h(n,ct),h(n,lt),h(n,Et),h(n,ut),h(n,dt),h(n,ht),h(n,mt),h(n,ft),h(n,pt),h(n,Mt));if(!Le(n))return function(i){let{years:o,months:a,weeks:s,days:l,hours:u,minutes:m,seconds:f,milliseconds:y,microseconds:E,nanoseconds:x}=function(I){let L=gh.exec(I);if(!L)throw new RangeError(`invalid duration: ${I}`);if(L.every((v,D)=>D<2||v===void 0))throw new RangeError(`invalid duration: ${I}`);let z=L[1]==="-"?-1:1,W=L[2]===void 0?0:ue(L[2])*z,K=L[3]===void 0?0:ue(L[3])*z,te=L[4]===void 0?0:ue(L[4])*z,re=L[5]===void 0?0:ue(L[5])*z,le=L[6]===void 0?0:ue(L[6])*z,Me=L[7],_e=L[8],ne=L[9],N=L[10],F=L[11],O=0,Q=0,g=0;if(Me!==void 0){if(_e??ne??N??F)throw new RangeError("only the smallest unit can be fractional");g=3600*ue((Me+"000000000").slice(0,9))*z}else if(O=_e===void 0?0:ue(_e)*z,ne!==void 0){if(N??F)throw new RangeError("only the smallest unit can be fractional");g=60*ue((ne+"000000000").slice(0,9))*z}else Q=N===void 0?0:ue(N)*z,F!==void 0&&(g=ue((F+"000000000").slice(0,9))*z);let A=g%1e3,c=Math.trunc(g/1e3)%1e3,d=Math.trunc(g/1e6)%1e3;return Q+=Math.trunc(g/1e9)%60,O+=Math.trunc(g/6e10),zo(W,K,te,re,le,O,Q,d,c,A),{years:W,months:K,weeks:te,days:re,hours:le,minutes:O,seconds:Q,milliseconds:d,microseconds:c,nanoseconds:A}}(i);return new(We("%Temporal.Duration%"))(o,a,s,l,u,m,f,y,E,x)}(Be(n));let e={years:0,months:0,weeks:0,days:0,hours:0,minutes:0,seconds:0,milliseconds:0,microseconds:0,nanoseconds:0},r=Ol(n);for(let i=0;i<bo.length;i++){let o=bo[i],a=r[o];a!==void 0&&(e[o]=a)}return new t(e.years,e.months,e.weeks,e.days,e.hours,e.minutes,e.seconds,e.milliseconds,e.microseconds,e.nanoseconds)}function ii(n){let t;if(Le(n)){if(Ue(n)||fe(n))return Zt(h(n,oe));t=es(n)}else t=n;let{year:e,month:r,day:i,time:o,offset:a,z:s}=function(I){let L=ln(I);if(!L.z&&!L.offset)throw new RangeError("Temporal.Instant requires a time zone offset");return L}(Be(t)),{hour:l=0,minute:u=0,second:m=0,millisecond:f=0,microsecond:y=0,nanosecond:E=0}=o==="start-of-day"?{}:o,x=bi(e,r,i,l,u,m,f,y,E-(s?0:Yr(a)));return Sr(x.isoDate),Zt(qe(x))}function Bc(n,t){if(Le(n)){if(Nt(n))return ye(X(t)),Mr(h(n,ae),h(n,H));let s;return bt(n,H)?s=h(n,H):(s=n.calendar,s===void 0&&(s="iso8601"),s=Bi(s)),Mr(_o(s,Ht(s,n,["year","month","monthCode","day"],[],[]),ye(X(t))),s)}let{month:e,day:r,referenceISOYear:i,calendar:o}=Ls(Be(n));if(o===void 0&&(o="iso8601"),o=Dt(o),ye(X(t)),o==="iso8601")return Mr({year:1972,month:e,day:r},o);let a={year:i,month:e,day:r};return lr(a),a=_o(o,wt(o,a,"month-day"),"constrain"),Mr(a,o)}function Nn(n,t){let e;if(Le(n)){if(Oe(n))return ye(X(t)),gn(h(n,Ne));if(Te(n))return ye(X(t)),gn(h(n,xe).time);if(fe(n)){let u=Vt(h(n,De),h(n,oe));return ye(X(t)),gn(u.time)}let{hour:r,minute:i,second:o,millisecond:a,microsecond:s,nanosecond:l}=ns(n);e=Ho(r,i,o,a,s,l,ye(X(t)))}else e=Rl(Be(n)),ye(X(t));return gn(e)}function Yl(n){return n===void 0?{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}:h(Nn(n),Ne)}function oi(n,t){if(Le(n)){if(Ve(n))return ye(X(t)),kr(h(n,ae),h(n,H));let s=$i(n);return kr(yi(s,Ht(s,n,["year","month","monthCode"],[],[]),ye(X(t))),s)}let{year:e,month:r,referenceISODay:i,calendar:o}=Ns(Be(n));o===void 0&&(o="iso8601"),o=Dt(o),ye(X(t));let a={year:e,month:r,day:i};return js(a),a=yi(o,wt(o,a,"year-month"),"constrain"),kr(a,o)}function Do(n,t,e,r,i,o,a,s){if(t==="start-of-day")return Rn(i,n);let l=we(n,t);if(e==="wall"||a==="ignore")return Qe(i,l,o);if(e==="exact"||a==="use"){let f=bi(n.year,n.month,n.day,t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond-r);Sr(f.isoDate);let y=qe(f);return sn(y),y}Sr(n);let u=qe(l),m=vi(i,l);for(let f=0;f<m.length;f++){let y=m[f],E=k.default.toNumber(k.default.subtract(u,y)),x=Ln(E,6e10,"halfExpand");if(E===r||s&&x===r)return y}if(a==="reject"){let f=rs(r),y=wi(l,"iso8601","auto");throw new RangeError(`Offset ${f} is invalid for ${y} in ${i}`)}return ql(m,i,l,o)}function ai(n,t){let e,r,i,o,a,s,l,u=!1,m="option";if(Le(n)){if(fe(n)){let I=X(t);return hi(I),go(I,"reject"),ye(I),Je(h(n,oe),h(n,De),h(n,H))}a=$i(n);let y=Ht(a,n,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],["timeZone"]);({offset:o,timeZone:i}=y),o===void 0&&(m="wall");let E=X(t);s=hi(E),l=go(E,"reject");let x=ye(E);({isoDate:e,time:r}=Hi(a,y,x))}else{let y,E,x,I,L;({year:x,month:I,day:L,time:r,tzAnnotation:y,offset:o,z:E,calendar:a}=function(W){let K=ln(W);if(!K.tzAnnotation)throw new RangeError("Temporal.ZonedDateTime requires a time zone ID in brackets");return K}(Be(n))),i=vt(y),E?m="exact":o||(m="wall"),a||(a="iso8601"),a=Dt(a),u=!0;let z=X(t);s=hi(z),l=go(z,"reject"),ye(z),e={year:x,month:I,day:L}}let f=0;return m==="option"&&(f=Yr(o)),Je(Do(e,r,m,f,i,s,l,u),i,a)}function Fl(n,t,e){lr(t),Mn(n),me(n,ae,t),me(n,H,e),me(n,pl,!0)}function yt(n,t){let e=We("%Temporal.PlainDate%"),r=Object.create(e.prototype);return Fl(r,n,t),r}function Hl(n,t,e){rr(t),Mn(n),me(n,xe,t),me(n,H,e)}function $t(n,t){let e=We("%Temporal.PlainDateTime%"),r=Object.create(e.prototype);return Hl(r,n,t),r}function jl(n,t,e){lr(t),Mn(n),me(n,ae,t),me(n,H,e),me(n,yl,!0)}function Mr(n,t){let e=We("%Temporal.PlainMonthDay%"),r=Object.create(e.prototype);return jl(r,n,t),r}function Bl(n,t){Mn(n),me(n,Ne,t)}function gn(n){let t=We("%Temporal.PlainTime%"),e=Object.create(t.prototype);return Bl(e,n),e}function $l(n,t,e){js(t),Mn(n),me(n,ae,t),me(n,H,e),me(n,gl,!0)}function kr(n,t){let e=We("%Temporal.PlainYearMonth%"),r=Object.create(e.prototype);return $l(r,n,t),r}function zl(n,t){sn(t),Mn(n),me(n,oe,t)}function Zt(n){let t=We("%Temporal.Instant%"),e=Object.create(t.prototype);return zl(e,n),e}function Ul(n,t,e,r){sn(t),Mn(n),me(n,oe,t),me(n,De,e),me(n,H,r)}function Je(n,t,e="iso8601"){let r=We("%Temporal.ZonedDateTime%"),i=Object.create(r.prototype);return Ul(i,n,t,e),i}function $c(n){return ts.filter(t=>n[t]!==void 0)}function tr(n,t,e){let r=$c(e),i=Bn(n).fieldKeysToIgnore(r),o=Object.create(null),a=$c(t);for(let s=0;s<ts.length;s++){let l,u=ts[s];a.includes(u)&&!i.includes(u)&&(l=t[u]),r.includes(u)&&(l=e[u]),l!==void 0&&(o[u]=l)}return o}function Yt(n,t,e,r){let i=Bn(n).dateAdd(t,e,r);return lr(i),i}function ji(n,t,e,r){return Bn(n).dateUntil(t,e,r)}function Bi(n){if(Le(n)&&bt(n,H))return h(n,H);let t=Be(n);try{return Dt(t)}catch{}let e;try{({calendar:e}=ln(t))}catch{try{({calendar:e}=Rl(t))}catch{try{({calendar:e}=Ns(t))}catch{({calendar:e}=Ls(t))}}}return e||(e="iso8601"),Dt(e)}function $i(n){if(bt(n,H))return h(n,H);let{calendar:t}=n;return t===void 0?"iso8601":Bi(t)}function an(n,t){return Dt(n)===Dt(t)}function Hn(n,t,e){let r=Bn(n);r.resolveFields(t,"date");let i=r.dateToISO(t,e);return lr(i),i}function yi(n,t,e){let r=Bn(n);r.resolveFields(t,"year-month"),t.day=1;let i=r.dateToISO(t,e);return js(i),i}function _o(n,t,e){let r=Bn(n);r.resolveFields(t,"month-day");let i=r.monthDayToISOReferenceDate(t,e);return lr(i),i}function vt(n){if(Le(n)&&fe(n))return h(n,De);let t=Be(n);if(t==="UTC")return"UTC";let{tzName:e,offsetMinutes:r}=function(o){let{tzAnnotation:a,offset:s,z:l}=function(u){if(Al.test(u))return{tzAnnotation:u,offset:void 0,z:!1};try{let{tzAnnotation:m,offset:f,z:y}=ln(u);if(y||m||f)return{tzAnnotation:m,offset:f,z:y}}catch{}Ll(u)}(o);return a?On(a):l?On("UTC"):s?On(s):void 0}(t);if(r!==void 0)return Os(r);let i=Eo(e);if(!i)throw new RangeError(`Unrecognized time zone ${e}`);return i.identifier}function Vl(n,t){if(n===t)return!0;let e=On(n).offsetMinutes,r=On(t).offsetMinutes;if(e===void 0&&r===void 0){let i=Eo(t);if(!i)return!1;let o=Eo(n);return!!o&&o.primaryIdentifier===i.primaryIdentifier}return e===r}function yn(n,t){let e=On(n).offsetMinutes;return e!==void 0?6e10*e:is(n,t)}function rs(n){let t=n<0?"-":"+",e=Math.abs(n),r=Math.floor(e/36e11),i=Math.floor(e/6e10)%60,o=Math.floor(e/1e9)%60,a=e%1e9;return`${t}${jo(r,i,o,a,o===0&&a===0?"minute":"auto")}`}function Vt(n,t){let e=yn(n,t),{isoDate:{year:r,month:i,day:o},time:{hour:a,minute:s,second:l,millisecond:u,microsecond:m,nanosecond:f}}=Zl(t);return bi(r,i,o,a,s,l,u,m,f+e)}function Qe(n,t,e){return ql(vi(n,t),n,t,e)}function ql(n,t,e,r){let i=n.length;if(i===1)return n[0];if(i)switch(r){case"compatible":case"earlier":return n[0];case"later":return n[i-1];case"reject":throw new RangeError("multiple instants found")}if(r==="reject")throw new RangeError("multiple instants found");let o=qe(e),a=k.default.subtract(o,Yn);sn(a);let s=yn(t,a),l=k.default.add(o,Yn);sn(l);let u=yn(t,l)-s;switch(r){case"earlier":{let m=Ee.fromComponents(0,0,0,0,0,-u),f=Pr(e.time,m);return vi(t,we(Tt(e.isoDate.year,e.isoDate.month,e.isoDate.day+f.deltaDays),f))[0]}case"compatible":case"later":{let m=Ee.fromComponents(0,0,0,0,0,u),f=Pr(e.time,m),y=vi(t,we(Tt(e.isoDate.year,e.isoDate.month,e.isoDate.day+f.deltaDays),f));return y[y.length-1]}}}function vi(n,t){if(n==="UTC")return Sr(t.isoDate),[qe(t)];let e=On(n).offsetMinutes;if(e!==void 0){let r=bi(t.isoDate.year,t.isoDate.month,t.isoDate.day,t.time.hour,t.time.minute-e,t.time.second,t.time.millisecond,t.time.microsecond,t.time.nanosecond);Sr(r.isoDate);let i=qe(r);return sn(i),[i]}return Sr(t.isoDate),function(r,i){let o=qe(i),a=k.default.subtract(o,Yn);k.default.lessThan(a,pi)&&(a=o);let s=k.default.add(o,Yn);k.default.greaterThan(s,Cr)&&(s=o);let l=is(r,a),u=is(r,s);return(l===u?[l]:[l,u]).map(f=>{let y=k.default.subtract(o,k.default.BigInt(f)),E=function(x,I){let{epochMilliseconds:L,time:{millisecond:z,microsecond:W,nanosecond:K}}=Zl(I),{year:te,month:re,day:le,hour:Me,minute:_e,second:ne}=Gl(x,L);return bi(te,re,le,Me,_e,ne,z,W,K)}(r,y);if(Rr(i,E)===0)return sn(y),y}).filter(f=>f!==void 0)}(n,t)}function Rn(n,t){let e=we(t,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),r=vi(n,e);if(r.length)return r[0];let i=qe(e),o=k.default.subtract(i,Yn);return sn(o),Fs(n,o)}function zi(n){let t;return t=n<0||n>9999?(n<0?"-":"+")+gi(Math.abs(n),6):gi(n,4),t}function Ft(n){return gi(n,2)}function Wl(n,t){let e;if(t==="auto"){if(n===0)return"";e=gi(n,9).replace(/0+$/,"")}else{if(t===0)return"";e=gi(n,9).slice(0,t)}return`.${e}`}function jo(n,t,e,r,i){let o=`${Ft(n)}:${Ft(t)}`;return i==="minute"||(o+=`:${Ft(e)}`,o+=Wl(r,i)),o}function zc(n,t,e){let r=t;r===void 0&&(r="UTC");let i=h(n,oe),o=wi(Vt(r,i),"iso8601",e,"never"),a="Z";return t!==void 0&&(a=Kl(yn(r,i))),`${o}${a}`}function po(n,t){let e=h(n,ct),r=h(n,lt),i=h(n,Et),o=h(n,ut),a=h(n,dt),s=h(n,ht),l=ko(n),u="";e!==0&&(u+=`${Math.abs(e)}Y`),r!==0&&(u+=`${Math.abs(r)}M`),i!==0&&(u+=`${Math.abs(i)}W`),o!==0&&(u+=`${Math.abs(o)}D`);let m="";a!==0&&(m+=`${Math.abs(a)}H`),s!==0&&(m+=`${Math.abs(s)}M`);let f=Ee.fromComponents(0,0,h(n,mt),h(n,ft),h(n,pt),h(n,Mt));f.isZero()&&!["second","millisecond","microsecond","nanosecond"].includes(fn(n))&&t==="auto"||(m+=`${Math.abs(f.sec)}${Wl(Math.abs(f.subsec),t)}S`);let y=`${l<0?"-":""}P${u}`;return m&&(y=`${y}T${m}`),y}function Uc(n,t="auto"){let{year:e,month:r,day:i}=h(n,ae);return`${zi(e)}-${Ft(r)}-${Ft(i)}${Ni(h(n,H),t)}`}function Vc({hour:n,minute:t,second:e,millisecond:r,microsecond:i,nanosecond:o},a){return jo(n,t,e,1e6*r+1e3*i+o,a)}function wi(n,t,e,r="auto"){let{isoDate:{year:i,month:o,day:a},time:{hour:s,minute:l,second:u,millisecond:m,microsecond:f,nanosecond:y}}=n;return`${zi(i)}-${Ft(o)}-${Ft(a)}T${jo(s,l,u,1e6*m+1e3*f+y,e)}${Ni(t,r)}`}function qc(n,t="auto"){let{year:e,month:r,day:i}=h(n,ae),o=`${Ft(r)}-${Ft(i)}`,a=h(n,H);t!=="always"&&t!=="critical"&&a==="iso8601"||(o=`${zi(e)}-${o}`);let s=Ni(a,t);return s&&(o+=s),o}function Wc(n,t="auto"){let{year:e,month:r,day:i}=h(n,ae),o=`${zi(e)}-${Ft(r)}`,a=h(n,H);t!=="always"&&t!=="critical"&&a==="iso8601"||(o+=`-${Ft(i)}`);let s=Ni(a,t);return s&&(o+=s),o}function Kc(n,t,e="auto",r="auto",i="auto",o=void 0){let a=h(n,oe);if(o){let{unit:m,increment:f,roundingMode:y}=o;a=cs(a,f,m,y)}let s=h(n,De),l=yn(s,a),u=wi(Vt(s,a),"iso8601",t,"never");return i!=="never"&&(u+=Kl(l)),r!=="never"&&(u+=`[${r==="critical"?"!":""}${s}]`),u+=Ni(h(n,H),e),u}function Zc(n){return Nl.test(n)}function Yr(n){let t=Ih.exec(n);if(!t)throw new RangeError(`invalid time zone offset: ${n}; must match \xB1HH: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))}var Jr,Th=Object.assign(Object.create(null),{"/":!0,"-":!0,_:!0});function Eo(n){if(Jr===void 0){let o=Intl.supportedValuesOf?.("timeZone");if(o){Jr=new Map;for(let a=0;a<o.length;a++){let s=o[a];Jr.set(Di(s),s)}}else Jr=null}let t=Di(n),e=Jr?.get(t);if(e)return{identifier:e,primaryIdentifier:e};try{e=Pl(n).resolvedOptions().timeZone}catch{return}if(t==="antarctica/south_pole"&&(e="Antarctica/McMurdo"),_h.has(n))throw new RangeError(`${n} is a legacy time zone identifier from ICU. Use ${e} instead`);let r=[...t].map((o,a)=>a===0||Th[t[a-1]]?o.toUpperCase():o).join("").split("/");if(r.length===1)return t==="gb-eire"?{identifier:"GB-Eire",primaryIdentifier:e}:{identifier:t.length<=3||/[-0-9]/.test(t)?t.toUpperCase():r[0],primaryIdentifier:e};if(r[0]==="Etc")return{identifier:`Etc/${["Zulu","Greenwich","Universal"].includes(r[1])?r[1]:r[1].toUpperCase()}`,primaryIdentifier:e};if(r[0]==="Us")return{identifier:`US/${r[1]}`,primaryIdentifier:e};let i=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]=i.get(r[1])??r[1],r.length>2&&(r[2]=i.get(r[2])??r[2]),{identifier:r.join("/"),primaryIdentifier:e}}function Qn(n,t){let{year:e,month:r,day:i,hour:o,minute:a,second:s}=Gl(n,t),l=t%1e3;return l<0&&(l+=1e3),1e6*(Ys({isoDate:{year:e,month:r,day:i},time:{hour:o,minute:a,second:s,millisecond:l}})-t)}function is(n,t){return Qn(n,qt(t,"floor"))}function Os(n){let t=n<0?"-":"+",e=Math.abs(n);return`${t}${jo(Math.floor(e/60),e%60,0,0,"minute")}`}function Kl(n){return Os(Ln(n,yh,"halfExpand")/6e10)}function Ys({isoDate:{year:n,month:t,day:e},time:{hour:r,minute:i,second:o,millisecond:a}}){let s=n%400,l=(n-s)/400,u=new Date;return u.setUTCHours(r,i,o,a),u.setUTCFullYear(s,t-1,e),u.getTime()+bh*l}function qe(n){let t=Ys(n),e=1e3*n.time.microsecond+n.time.nanosecond;return k.default.add(Gt(t),k.default.BigInt(e))}function Zl(n){let t=qt(n,"trunc"),e=k.default.toNumber(k.default.remainder(n,Ri));e<0&&(e+=1e6,t-=1);let r=Math.floor(e/1e3)%1e3,i=e%1e3,o=new Date(t);return{epochMilliseconds:t,isoDate:{year:o.getUTCFullYear(),month:o.getUTCMonth()+1,day:o.getUTCDate()},time:{hour:o.getUTCHours(),minute:o.getUTCMinutes(),second:o.getUTCSeconds(),millisecond:o.getUTCMilliseconds(),microsecond:r,nanosecond:i}}}function Fs(n,t){if(n==="UTC")return null;let e=qt(t,"floor");if(e<li)return Fs(n,Gt(li));let r=Date.now(),i=Math.max(e,r)+366*Fn*3,o=e,a=Qn(n,o),s=o,l=a;for(;a===l&&o<i;){if(s=o+2*Fn*7,s>xl)return null;l=Qn(n,s),a===l&&(o=s)}return a===l?null:Gt(au(u=>Qn(n,u),o,s,a,l))}function os(n,t){if(n==="UTC")return null;let e=qt(t,"ceil"),r=Date.now(),i=r+366*Fn*3;if(e>i){let u=os(n,Gt(i));if(u===null||k.default.lessThan(u,Gt(r)))return u}if(n==="Africa/Casablanca"||n==="Africa/El_Aaiun"){let u=Date.UTC(2088,0,1);if(u<e)return os(n,Gt(u))}let o=e-1;if(o<li)return null;let a=Qn(n,o),s=o,l=a;for(;a===l&&o>li;){if(s=o-2*Fn*7,s<li)return null;l=Qn(n,s),a===l&&(o=s)}return a===l?null:Gt(au(u=>Qn(n,u),s,o,l,a))}function Gl(n,t){return function(e){let r=e.split(/[^\w]+/);if(r.length!==7)throw new RangeError(`expected 7 parts in "${e}`);let i=+r[0],o=+r[1],a=+r[2],s=r[3];if(s[0]==="b"||s[0]==="B")a=1-a;else if(s[0]!=="a"&&s[0]!=="A")throw new RangeError(`Unknown era ${s} in "${e}`);let l=r[4]==="24"?0:+r[4],u=+r[5],m=+r[6];if(!(Number.isFinite(a)&&Number.isFinite(i)&&Number.isFinite(o)&&Number.isFinite(l)&&Number.isFinite(u)&&Number.isFinite(m)))throw new RangeError(`Invalid number in "${e}`);return{year:a,month:i,day:o,hour:l,minute:u,second:m}}(Pl(n).format(t))}function Mo(n){return n!==void 0&&!(n%4!=0||n%100==0&&n%400!=0)}function er(n,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]}[Mo(n)?"leapyear":"standard"][t-1]}function ko(n){let t=[h(n,ct),h(n,lt),h(n,Et),h(n,ut),h(n,dt),h(n,ht),h(n,mt),h(n,ft),h(n,pt),h(n,Mt)];for(let e=0;e<t.length;e++){let r=t[e];if(r!==0)return r<0?-1:1}return 0}function Bo(n){let t=["years","months","weeks","days"];for(let e=0;e<t.length;e++){let r=n[t[e]];if(r!==0)return r<0?-1:1}return 0}function Jl(n){let t=Bo(n.date);return t!==0?t:n.time.sign()}function Xn(n,t){let e=n,r=t;if(!Number.isFinite(e)||!Number.isFinite(r))throw new RangeError("infinity is out of range");return r-=1,e+=Math.floor(r/12),r%=12,r<0&&(r+=12),r+=1,{year:e,month:r}}function Tt(n,t,e){let r=n,i=t,o=e;if(!Number.isFinite(o))throw new RangeError("infinity is out of range");({year:r,month:i}=Xn(r,i));let a=146097;if(Math.abs(o)>a){let u=Math.trunc(o/a);r+=400*u,o-=u*a}let s=0,l=i>2?r:r-1;for(;s=Mo(l)?366:365,o<-s;)r-=1,l-=1,o+=s;for(l+=1;s=Mo(l)?366:365,o>s;)r+=1,l+=1,o-=s;for(;o<1;)({year:r,month:i}=Xn(r,i-1)),o+=er(r,i);for(;o>er(r,i);)o-=er(r,i),{year:r,month:i}=Xn(r,i+1);return{year:r,month:i,day:o}}function bi(n,t,e,r,i,o,a,s,l){let u=An(r,i,o,a,s,l);return we(Tt(n,t,e+u.deltaDays),u)}function An(n,t,e,r,i,o){let a,s=n,l=t,u=e,m=r,f=i,y=o;({div:a,mod:y}=Er(y,3)),f+=a,y<0&&(f-=1,y+=1e3),{div:a,mod:f}=Er(f,3),m+=a,f<0&&(m-=1,f+=1e3),u+=Math.trunc(m/1e3),m%=1e3,m<0&&(u-=1,m+=1e3),l+=Math.trunc(u/60),u%=60,u<0&&(l-=1,u+=60),s+=Math.trunc(l/60),l%=60,l<0&&(s-=1,l+=60);let E=Math.trunc(s/24);return s%=24,s<0&&(E-=1,s+=24),E+=0,s+=0,l+=0,u+=0,m+=0,f+=0,y+=0,{deltaDays:E,hour:s,minute:l,second:u,millisecond:m,microsecond:f,nanosecond:y}}function Gc(n,t){let e=Xe(n,0);if(Bo(e)===0)return n.days;let r=h(t,ae),i=Yt(h(t,H),r,e,"constrain"),o=ir(r.year,r.month-1,r.day),a=ir(i.year,i.month-1,i.day)-o;return n.days+a}function Ct(n){return new(We("%Temporal.Duration%"))(-h(n,ct),-h(n,lt),-h(n,Et),-h(n,ut),-h(n,dt),-h(n,ht),-h(n,mt),-h(n,ft),-h(n,pt),-h(n,Mt))}function gt(n,t,e){return Math.min(e,Math.max(t,n))}function Xl(n,t,e){let r=gt(t,1,12);return{year:n,month:r,day:gt(e,1,er(n,r))}}function $e(n,t,e){if(n<t||n>e)throw new RangeError(`value out of range: ${t} <= ${n} <= ${e}`)}function nr(n,t,e){$e(t,1,12),$e(e,1,er(n,t))}function lr(n){rr(we(n,{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}))}function $o(n,t,e,r,i,o){$e(n,0,23),$e(t,0,59),$e(e,0,59),$e(r,0,999),$e(i,0,999),$e(o,0,999)}function Hs(n,t,e,r,i,o,a,s,l){nr(n,t,e),$o(r,i,o,a,s,l)}function rr(n){let t=qe(n);(k.default.lessThan(t,vh)||k.default.greaterThan(t,wh))&&sn(t)}function as(n){qe(n)}function sn(n){if(k.default.lessThan(n,pi)||k.default.greaterThan(n,Cr))throw new RangeError("date/time value is outside of supported range")}function js({year:n,month:t}){$e(n,Oc,Yc),n===Oc?$e(t,4,12):n===Yc&&$e(t,1,9)}function zo(n,t,e,r,i,o,a,s,l,u){let m=0,f=[n,t,e,r,i,o,a,s,l,u];for(let z=0;z<f.length;z++){let W=f[z];if(W===1/0||W===-1/0)throw new RangeError("infinite values not allowed as duration fields");if(W!==0){let K=W<0?-1:1;if(m!==0&&K!==m)throw new RangeError("mixed-sign values not allowed as duration fields");m=K}}if(Math.abs(n)>=2**32||Math.abs(t)>=2**32||Math.abs(e)>=2**32)throw new RangeError("years, months, and weeks must be < 2\xB3\xB2");let y=Er(s,3),E=Er(l,6),x=Er(u,9),I=Er(1e6*y.mod+1e3*E.mod+x.mod,9).div,L=86400*r+3600*i+60*o+a+y.div+E.div+x.div+I;if(!Number.isSafeInteger(L))throw new RangeError("total of duration time units cannot exceed 9007199254740991.999999999 s")}function _r(n){return{date:{years:h(n,ct),months:h(n,lt),weeks:h(n,Et),days:h(n,ut)},time:Ee.fromComponents(h(n,dt),h(n,ht),h(n,mt),h(n,ft),h(n,pt),h(n,Mt))}}function rn(n){let t=Ee.fromComponents(h(n,dt),h(n,ht),h(n,mt),h(n,ft),h(n,pt),h(n,Mt)).add24HourDays(h(n,ut));return{date:{years:h(n,ct),months:h(n,lt),weeks:h(n,Et),days:0},time:t}}function Ql(n){let t=rn(n),e=Math.trunc(t.time.sec/86400);return zo(t.date.years,t.date.months,t.date.weeks,e,0,0,0,0,0,0),{...t.date,days:e}}function zt(n,t){let e=n.time.sign(),r=n.time.abs().subsec,i=0,o=0,a=n.time.abs().sec,s=0,l=0,u=0;switch(t){case"year":case"month":case"week":case"day":i=Math.trunc(r/1e3),r%=1e3,o=Math.trunc(i/1e3),i%=1e3,a+=Math.trunc(o/1e3),o%=1e3,s=Math.trunc(a/60),a%=60,l=Math.trunc(s/60),s%=60,u=Math.trunc(l/24),l%=24;break;case"hour":i=Math.trunc(r/1e3),r%=1e3,o=Math.trunc(i/1e3),i%=1e3,a+=Math.trunc(o/1e3),o%=1e3,s=Math.trunc(a/60),a%=60,l=Math.trunc(s/60),s%=60;break;case"minute":i=Math.trunc(r/1e3),r%=1e3,o=Math.trunc(i/1e3),i%=1e3,a+=Math.trunc(o/1e3),o%=1e3,s=Math.trunc(a/60),a%=60;break;case"second":i=Math.trunc(r/1e3),r%=1e3,o=Math.trunc(i/1e3),i%=1e3,a+=Math.trunc(o/1e3),o%=1e3;break;case"millisecond":i=Math.trunc(r/1e3),r%=1e3,o=$a(a,3,Math.trunc(i/1e3)),i%=1e3,a=0;break;case"microsecond":i=$a(a,6,Math.trunc(r/1e3)),r%=1e3,a=0;break;case"nanosecond":r=$a(a,9,r),a=0}return new(We("%Temporal.Duration%"))(n.date.years,n.date.months,n.date.weeks,n.date.days+e*u,e*l,e*s,e*a,e*o,e*i,e*r)}function wn(n,t){return Bo(n),t.sign(),{date:n,time:t}}function ir(n,t,e){return Ys({isoDate:{year:n,month:t+1,day:e},time:{hour:0,minute:0,second:0,millisecond:0}})/Fn}function Sr({year:n,month:t,day:e}){if(Math.abs(ir(n,t-1,e))>1e8)throw new RangeError("date/time value is outside the supported range")}function Bs(n,t){let e=t.hour-n.hour,r=t.minute-n.minute,i=t.second-n.second,o=t.millisecond-n.millisecond,a=t.microsecond-n.microsecond,s=t.nanosecond-n.nanosecond;return Ee.fromComponents(e,r,i,o,a,s)}function $s(n,t,e,r,i){let o=Ee.fromEpochNsDiff(t,n);return o=So(o,e,r,i),wn({years:0,months:0,weeks:0,days:0},o)}function eu(n,t,e,r){as(n),as(t);let i=Bs(n.time,t.time),o=i.sign(),a=cn(n.isoDate,t.isoDate),s=t.isoDate;a===o&&(s=Tt(s.year,s.month,s.day+o),i=i.add24HourDays(-o));let l=vn("day",r),u=ji(e,n.isoDate,s,l);return r!==l&&(i=i.add24HourDays(u.days),u.days=0),wn(u,i)}function tu(n,t,e,r,i){let o=k.default.subtract(t,n);if(k.default.equal(o,Lt))return{date:{years:0,months:0,weeks:0,days:0},time:Ee.ZERO};let a=k.default.lessThan(o,Lt)?-1:1,s=Vt(e,n),l=Vt(e,t),u,m=0,f=a===1?2:1,y=Bs(s.time,l.time);for(y.sign()===-a&&m++;m<=f;m++){u=we(Tt(l.isoDate.year,l.isoDate.month,l.isoDate.day-m*a),s.time);let x=Qe(e,u,"compatible");if(y=Ee.fromEpochNsDiff(t,x),y.sign()!==-a)break}let E=vn("day",i);return wn(ji(r,s.isoDate,u.isoDate,E),y)}function nu(n,t,e,r,i,o,a,s,l){let u,m,f,y,E=t;switch(s){case"year":{let O=Ln(E.date.years,a,"trunc");u=O,m=O+a*n,f={years:u,months:0,weeks:0,days:0},y={...f,years:m};break}case"month":{let O=Ln(E.date.months,a,"trunc");u=O,m=O+a*n,f=Xe(E.date,0,0,u),y=Xe(E.date,0,0,m);break}case"week":{let O=Xe(E.date,0,0),Q=Yt(o,r.isoDate,O,"constrain"),g=ji(o,Q,Tt(Q.year,Q.month,Q.day+E.date.days),"week"),A=Ln(E.date.weeks+g.weeks,a,"trunc");u=A,m=A+a*n,f=Xe(E.date,0,u),y=Xe(E.date,0,m);break}case"day":{let O=Ln(E.date.days,a,"trunc");u=O,m=O+a*n,f=Xe(E.date,u),y=Xe(E.date,m);break}}let x=Yt(o,r.isoDate,f,"constrain"),I=Yt(o,r.isoDate,y,"constrain"),L,z,W=we(x,r.time),K=we(I,r.time);i?(L=Qe(i,W,"compatible"),z=Qe(i,K,"compatible")):(L=qe(W),z=qe(K));let te=Ee.fromEpochNsDiff(e,L),re=Ee.fromEpochNsDiff(z,L),le=No(l,n<0?"negative":"positive"),Me=te.add(te).abs().subtract(re.abs()).sign(),_e=Math.abs(u)/a%2==0,ne=te.isZero()?Math.abs(u):te.cmp(re)?Lo(Math.abs(u),Math.abs(m),Me,_e,le):Math.abs(m),N=new Ee(k.default.add(k.default.multiply(re.totalNs,k.default.BigInt(u)),k.default.multiply(te.totalNs,k.default.BigInt(a*n)))).fdiv(re.totalNs),F=ne===Math.abs(m);return E={date:F?y:f,time:Ee.ZERO},{nudgeResult:{duration:E,nudgedEpochNs:F?z:L,didExpandCalendarUnit:F},total:N}}function Uo(n,t,e,r,i,o,a,s,l){let u=n,m=tn(s)||r&&s==="day",f=Jl(u)<0?-1:1,y;return m?{nudgeResult:y}=nu(f,u,t,e,r,i,a,s,l):y=r?function(E,x,I,L,z,W,K,te){let re=x,le=Yt(z,I.isoDate,re.date,"constrain"),Me=we(le,I.time),_e=we(Tt(le.year,le.month,le.day+E),I.time),ne=Qe(L,Me,"compatible"),N=Qe(L,_e,"compatible"),F=Ee.fromEpochNsDiff(N,ne);if(F.sign()!==E)throw new RangeError("time zone returned inconsistent Instants");let O=k.default.BigInt(xr[K]*W),Q=re.time.round(O,te),g=Q.subtract(F),A=g.sign()!==-E,c,d;return A?(c=E,Q=g.round(O,te),d=Q.addToEpochNs(N)):(c=0,d=Q.addToEpochNs(ne)),{duration:wn(Xe(re.date,re.date.days+c),Q),nudgedEpochNs:d,didExpandCalendarUnit:A}}(f,u,e,r,i,a,s,l):function(E,x,I,L,z,W){let K=E,te=K.time.add24HourDays(K.date.days),re=te.round(k.default.BigInt(L*xr[z]),W),le=re.subtract(te),{quotient:Me}=te.divmod(wo),{quotient:_e}=re.divmod(wo),ne=Math.sign(_e-Me)===te.sign(),N=le.addToEpochNs(x),F=0,O=re;return pn(I)==="date"&&(F=_e,O=re.add(Ee.fromComponents(24*-_e,0,0,0,0,0))),{duration:{date:Xe(K.date,F),time:O},nudgedEpochNs:N,didExpandCalendarUnit:ne}}(u,t,o,a,s,l),u=y.duration,y.didExpandCalendarUnit&&s!=="week"&&(u=function(E,x,I,L,z,W,K,te){let re=x;if(te===K)return re;let le=ui.indexOf(K);for(let Me=ui.indexOf(te)-1;Me>=le;Me--){let _e=ui[Me];if(_e==="week"&&K!=="week")continue;let ne;switch(_e){case"year":ne={years:re.date.years+E,months:0,weeks:0,days:0};break;case"month":{let O=re.date.months+E;ne=Xe(re.date,0,0,O);break}case"week":{let O=re.date.weeks+E;ne=Xe(re.date,0,O);break}}let N=we(Yt(W,L.isoDate,ne,"constrain"),L.time),F;if(F=z?Qe(z,N,"compatible"):qe(N),yo(I,F)===-E)break;re={date:ne,time:Ee.ZERO}}return re}(f,u,y.nudgedEpochNs,e,r,i,o,vn(s,"day"))),u}function Jc(n,t,e,r,i,o){return tn(o)||r&&o==="day"?nu(Jl(n)<0?-1:1,n,t,e,r,i,1,o,"trunc").total:mi(n.time.add24HourDays(n.date.days),o)}function ru(n,t,e,r,i,o,a){if(Rr(n,t)==0)return{date:{years:0,months:0,weeks:0,days:0},time:Ee.ZERO};rr(n),rr(t);let s=eu(n,t,e,r);return o==="nanosecond"&&i===1?s:Uo(s,qe(t),n,null,e,r,i,o,a)}function iu(n,t,e,r,i,o,a,s){if(pn(i)==="time")return $s(n,t,o,a,s);let l=tu(n,t,e,r,i);return a==="nanosecond"&&o===1?l:Uo(l,t,Vt(e,n),e,r,i,o,a,s)}function Fr(n,t,e,r,i,o){let a=Ir.reduce((E,x)=>{let I=x[0],L=x[1],z=x[2];return e!=="datetime"&&z!==e||r.includes(L)||E.push(L,I),E},[]),s=St(t,"largestUnit",e,"auto");if(r.includes(s))throw new RangeError(`largestUnit must be one of ${a.join(", ")}, not ${s}`);let l=Lr(t),u=Jt(t,"trunc");n==="since"&&(u=function(E){switch(E){case"ceil":return"floor";case"floor":return"ceil";case"halfCeil":return"halfFloor";case"halfFloor":return"halfCeil";default:return E}}(u));let m=St(t,"smallestUnit",e,i);if(r.includes(m))throw new RangeError(`smallestUnit must be one of ${a.join(", ")}, not ${m}`);let f=vn(o,m);if(s==="auto"&&(s=f),vn(s,m)!==s)throw new RangeError(`largestUnit ${s} cannot be smaller than smallestUnit ${m}`);let y={hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[m];return y!==void 0&&Or(l,y,!1),{largestUnit:s,roundingIncrement:l,roundingMode:u,smallestUnit:m}}function Xc(n,t,e,r){let i=ii(e),o=Fr(n,X(r),"time",[],"nanosecond","second"),a=zt($s(h(t,oe),h(i,oe),o.roundingIncrement,o.smallestUnit,o.roundingMode),o.largestUnit);return n==="since"&&(a=Ct(a)),a}function Qc(n,t,e,r){let i=ni(e),o=h(t,H),a=h(i,H);if(!an(o,a))throw new RangeError(`cannot compute difference between dates of ${o} and ${a} calendars`);let s=Fr(n,X(r),"date",[],"day","day"),l=We("%Temporal.Duration%"),u=h(t,ae),m=h(i,ae);if(cn(u,m)===0)return new l;let f={date:ji(o,u,m,s.largestUnit),time:Ee.ZERO};if(s.smallestUnit!=="day"||s.roundingIncrement!==1){let E=we(u,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});f=Uo(f,qe(we(m,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),E,null,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let y=zt(f,"day");return n==="since"&&(y=Ct(y)),y}function el(n,t,e,r){let i=ri(e),o=h(t,H),a=h(i,H);if(!an(o,a))throw new RangeError(`cannot compute difference between dates of ${o} and ${a} calendars`);let s=Fr(n,X(r),"datetime",[],"nanosecond","day"),l=We("%Temporal.Duration%"),u=h(t,xe),m=h(i,xe);if(Rr(u,m)===0)return new l;let f=zt(ru(u,m,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);return n==="since"&&(f=Ct(f)),f}function tl(n,t,e,r){let i=Nn(e),o=Fr(n,X(r),"time",[],"nanosecond","hour"),a=Bs(h(t,Ne),h(i,Ne));a=So(a,o.roundingIncrement,o.smallestUnit,o.roundingMode);let s=zt(wn({years:0,months:0,weeks:0,days:0},a),o.largestUnit);return n==="since"&&(s=Ct(s)),s}function nl(n,t,e,r){let i=oi(e),o=h(t,H),a=h(i,H);if(!an(o,a))throw new RangeError(`cannot compute difference between months of ${o} and ${a} calendars`);let s=Fr(n,X(r),"date",["week","day"],"month","year"),l=We("%Temporal.Duration%");if(cn(h(t,ae),h(i,ae))==0)return new l;let u=wt(o,h(t,ae),"year-month");u.day=1;let m=Hn(o,u,"constrain"),f=wt(o,h(i,ae),"year-month");f.day=1;let y=Hn(o,f,"constrain"),E={date:Xe(ji(o,m,y,s.largestUnit),0,0),time:Ee.ZERO};if(s.smallestUnit!=="month"||s.roundingIncrement!==1){let I=we(m,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});E=Uo(E,qe(we(y,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),I,null,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let x=zt(E,"day");return n==="since"&&(x=Ct(x)),x}function rl(n,t,e,r){let i=ai(e),o=h(t,H),a=h(i,H);if(!an(o,a))throw new RangeError(`cannot compute difference between dates of ${o} and ${a} calendars`);let s=Fr(n,X(r),"datetime",[],"nanosecond","hour"),l=h(t,oe),u=h(i,oe),m=We("%Temporal.Duration%"),f;if(pn(s.largestUnit)!=="date")f=zt($s(l,u,s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);else{let y=h(t,De);if(!Vl(y,h(i,De)))throw new RangeError("When calculating difference between time zones, largestUnit must be 'hours' or smaller because day lengths can vary between time zones due to DST or time zone offset changes.");if(k.default.equal(l,u))return new m;f=zt(iu(l,u,y,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),"hour")}return n==="since"&&(f=Ct(f)),f}function Pr({hour:n,minute:t,second:e,millisecond:r,microsecond:i,nanosecond:o},a){let s=e,l=o;return s+=a.sec,l+=a.subsec,An(n,t,s,r,i,l)}function ss(n,t){let e=t.addToEpochNs(n);return sn(e),e}function si(n,t,e,r,i="constrain"){if(Bo(r.date)===0)return ss(n,r.time);let o=Vt(t,n);return ss(Qe(t,we(Yt(e,o.isoDate,r.date,i),o.time),"compatible"),r.time)}function il(n,t,e){let r=Ut(e);n==="subtract"&&(r=Ct(r));let i=vn(fn(t),fn(r));if(tn(i))throw new RangeError("For years, months, or weeks arithmetic, use date arithmetic relative to a starting point");let o=rn(t),a=rn(r);return zt(wn({years:0,months:0,weeks:0,days:0},o.time.add(a.time)),i)}function ol(n,t,e){let r=Ut(e);n==="subtract"&&(r=Ct(r));let i=fn(r);if(pn(i)==="date")throw new RangeError(`Duration field ${i} not supported by Temporal.Instant. Try Temporal.ZonedDateTime instead.`);let o=rn(r);return Zt(ss(h(t,oe),o.time))}function al(n,t,e,r){let i=h(t,H),o=Ut(e);n==="subtract"&&(o=Ct(o));let a=Ql(o),s=ye(X(r));return yt(Yt(i,h(t,ae),a,s),i)}function sl(n,t,e,r){let i=Ut(e);n==="subtract"&&(i=Ct(i));let o=ye(X(r)),a=h(t,H),s=rn(i),l=h(t,xe),u=Pr(l.time,s.time),m=Xe(s.date,u.deltaDays);return zo(m.years,m.months,m.weeks,m.days,0,0,0,0,0,0),$t(we(Yt(a,l.isoDate,m,o),u),a)}function cl(n,t,e){let r=Ut(e);n==="subtract"&&(r=Ct(r));let i=rn(r),{hour:o,minute:a,second:s,millisecond:l,microsecond:u,nanosecond:m}=Pr(h(t,Ne),i.time);return gn(Ho(o,a,s,l,u,m,"reject"))}function ll(n,t,e,r){let i=Ut(e);n==="subtract"&&(i=Ct(i));let o=ye(X(r)),a=ko(i),s=h(t,H),l=wt(s,h(t,ae),"year-month");l.day=1;let u=Hn(s,l,"constrain");if(a<0){let f=Yt(s,u,{months:1},"constrain");u=Tt(f.year,f.month,f.day-1)}let m=Ql(i);return lr(u),kr(yi(s,wt(s,Yt(s,u,m,o),"year-month"),o),s)}function ul(n,t,e,r){let i=Ut(e);n==="subtract"&&(i=Ct(i));let o=ye(X(r)),a=h(t,De),s=h(t,H),l=_r(i);return Je(si(h(t,oe),a,s,l,o),a,s)}function Ln(n,t,e){let r=Math.trunc(n/t),i=n%t,o=n<0?"negative":"positive",a=Math.abs(r),s=a+1,l=kt(Math.abs(2*i)-t),u=a%2==0,m=No(e,o),f=i===0?a:Lo(a,s,l,u,m);return t*(o==="positive"?f:-f)}function cs(n,t,e,r){let i=xr[e]*t;return function(o,a,s){let l=mn(o),u=mn(a),m=k.default.divide(l,u),f=k.default.remainder(l,u),y=No(s,"positive"),E,x;k.default.lessThan(l,Lt)?(E=k.default.subtract(m,fi),x=m):(E=m,x=k.default.add(m,fi));let I=yo(Jn(k.default.multiply(f,As)),u)*(k.default.lessThan(l,Lt)?-1:1)+0,L=k.default.equal(f,Lt)?m:Lo(E,x,I,fl(E),y);return k.default.multiply(L,u)}(n,k.default.BigInt(i),r)}function ls(n,t,e,r){as(n);let{year:i,month:o,day:a}=n.isoDate,s=us(n.time,t,e,r);return we(Tt(i,o,a+s.deltaDays),s)}function us({hour:n,minute:t,second:e,millisecond:r,microsecond:i,nanosecond:o},a,s,l){let u;switch(s){case"day":case"hour":u=1e3*(1e3*(1e3*(60*(60*n+t)+e)+r)+i)+o;break;case"minute":u=1e3*(1e3*(1e3*(60*t+e)+r)+i)+o;break;case"second":u=1e3*(1e3*(1e3*e+r)+i)+o;break;case"millisecond":u=1e3*(1e3*r+i)+o;break;case"microsecond":u=1e3*i+o;break;case"nanosecond":u=o}let m=xr[s],f=Ln(u,m*a,l)/m;switch(s){case"day":return{deltaDays:f,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0};case"hour":return An(f,0,0,0,0,0);case"minute":return An(n,f,0,0,0,0);case"second":return An(n,t,f,0,0,0);case"millisecond":return An(n,t,e,f,0,0);case"microsecond":return An(n,t,e,r,f,0);case"nanosecond":return An(n,t,e,r,i,f);default:throw new Error(`Invalid unit ${s}`)}}function So(n,t,e,r){let i=xr[e];return n.round(k.default.BigInt(i*t),r)}function mi(n,t){let e=xr[t];return n.fdiv(k.default.BigInt(e))}function cn(n,t){return n.year!==t.year?kt(n.year-t.year):n.month!==t.month?kt(n.month-t.month):n.day!==t.day?kt(n.day-t.day):0}function ds(n,t){return n.hour!==t.hour?kt(n.hour-t.hour):n.minute!==t.minute?kt(n.minute-t.minute):n.second!==t.second?kt(n.second-t.second):n.millisecond!==t.millisecond?kt(n.millisecond-t.millisecond):n.microsecond!==t.microsecond?kt(n.microsecond-t.microsecond):n.nanosecond!==t.nanosecond?kt(n.nanosecond-t.nanosecond):0}function Rr(n,t){let e=cn(n.isoDate,t.isoDate);return e!==0?e:ds(n.time,t.time)}function ou(n){let t=To(n);return globalThis.BigInt!==void 0?globalThis.BigInt(t.toString(10)):t}function qt(n,t){let e=mn(n),{quotient:r,remainder:i}=ei(e,Ri),o=k.default.toNumber(r);return t==="floor"&&k.default.toNumber(i)<0&&(o-=1),t==="ceil"&&k.default.toNumber(i)>0&&(o+=1),o}function Gt(n){if(!Number.isInteger(n))throw new RangeError("epoch milliseconds must be an integer");return k.default.multiply(k.default.BigInt(n),Ri)}function To(n){let t=n;if(typeof n=="object"){let e=n[Symbol.toPrimitive];e&&typeof e=="function"&&(t=e.call(n,"number"))}if(typeof t=="number")throw new TypeError("cannot convert number to bigint");return typeof t=="bigint"?k.default.BigInt(t.toString(10)):k.default.BigInt(t)}var hs=(()=>{let n=k.default.BigInt(Date.now()%1e6);return()=>{let t=Date.now(),e=k.default.BigInt(t),r=k.default.add(Gt(t),n);return n=k.default.remainder(e,Ri),k.default.greaterThan(r,Cr)?Cr:k.default.lessThan(r,pi)?pi:r}})();function Xr(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}function kt(n){return n<0?-1:n>0?1:n}function X(n){if(n===void 0)return Object.create(null);if(Le(n)&&n!==null)return n;throw new TypeError("Options parameter must be an object, not "+(n===null?"null":typeof n))}function or(n,t){let e=Object.create(null);return e[n]=t,e}function bn(n,t,e,r){let i=n[t];if(i!==void 0){if(i=Yo(i),!e.includes(i))throw new RangeError(`${t} must be one of ${e.join(", ")}, not ${i}`);return i}if(r===_n)throw new RangeError(`${t} option is required`);return r}function Dt(n){let t=Di(n);if(!Dh.includes(Di(t)))throw new RangeError(`invalid calendar identifier ${t}`);switch(t){case"ethiopic-amete-alem":return"ethioaa";case"islamicc":return"islamic-civil"}return t}function Di(n){let t="";for(let e=0;e<n.length;e++){let r=n.charCodeAt(e);t+=r>=65&&r<=90?String.fromCharCode(r+32):String.fromCharCode(r)}return t}function $n(n){throw new TypeError(`Do not use built-in arithmetic operators with Temporal objects. When comparing, use ${n==="PlainMonthDay"?"Temporal.PlainDate.compare(obj1.toPlainDate(year), obj2.toPlainDate(year))":`Temporal.${n}.compare(obj1, obj2)`}, not obj1 > obj2. When coercing to strings, use \`\${obj}\` or String(obj), not '' + obj. When coercing to numbers, use properties or methods of the object, not \`+obj\`. When concatenating with strings, use \`\${str}\${obj}\` or str.concat(obj), not str + obj. In React, coerce to a string before rendering a Temporal object.`)}var Ch=new RegExp(`^${Cl.source}$`),Ih=new RegExp(`^${/([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])(?::?([0-5][0-9])(?:[.,](\d{1,9}))?)?)?/.source}$`);function au(n,t,e,r=n(t),i=n(e)){let o=t,a=e,s=r,l=i;for(;a-o>1;){let u=Math.trunc((o+a)/2),m=n(u);m===s?(o=u,s=m):m===l&&(a=u,l=m)}return a}function su(n){return[...n]}function cu(n,t){if(n!=="gregory"&&n!=="iso8601")return;let e=Ui[n],r=t.year,{dayOfWeek:i,dayOfYear:o,daysInYear:a}=e.isoToDate(t,{dayOfWeek:!0,dayOfYear:!0,daysInYear:!0}),s=e.getFirstDayOfWeek(),l=e.getMinimalDaysInFirstWeek(),u=(i+7-s)%7,m=(i-o+7001-s)%7,f=Math.floor((o-1+m)/7);if(7-m>=l&&++f,f==0)f=function(y,E,x,I){let L=(I-y-x+1)%7;L<0&&(L+=7);let z=Math.floor((x+L-1)/7);return 7-L>=E&&++z,z}(s,l,o+e.isoToDate(e.dateAdd(t,{years:-1},"constrain"),{daysInYear:!0}).daysInYear,i),r--;else if(o>=a-5){let y=(u+a-o)%7;y<0&&(y+=7),6-y>=l&&o+7-u>a&&(f=1,r++)}return{week:f,year:r}}function dl(n,t,e,r,i){if(t!==i.year){if(n*(t-i.year)>0)return!0}else if(e!==i.month){if(n*(e-i.month)>0)return!0}else if(r!==i.day&&n*(r-i.day)>0)return!0;return!1}var Ui={};function ar(n){if(!n.startsWith("M"))throw new RangeError(`Invalid month code: ${n}. Month codes must start with M.`);let t=+n.slice(1);if(Number.isNaN(t))throw new RangeError(`Invalid month code: ${n}`);return t}function on(n,t=!1){return`M${`${n}`.padStart(2,"0")}${t?"L":""}`}function zs(n,t=void 0,e=12){let{month:r,monthCode:i}=n;if(i===void 0){if(r===void 0)throw new TypeError("Either month or monthCode are required");t==="reject"&&$e(r,1,e),t==="constrain"&&(r=gt(r,1,e)),i=on(r)}else{let o=ar(i);if(i!==on(o))throw new RangeError(`Invalid month code: ${i}`);if(r!==void 0&&r!==o)throw new RangeError(`monthCode ${i} and month ${r} must match if both are present`);if(r=o,r<1||r>e)throw new RangeError(`Invalid monthCode: ${i}`)}return{...n,month:r,monthCode:i}}Ui.iso8601={resolveFields(n,t){if((t==="date"||t==="year-month")&&n.year===void 0)throw new TypeError("year is required");if((t==="date"||t==="month-day")&&n.day===void 0)throw new TypeError("day is required");Object.assign(n,zs(n))},dateToISO:(n,t)=>di(n.year,n.month,n.day,t),monthDayToISOReferenceDate(n,t){let{month:e,day:r}=di(n.year??1972,n.month,n.day,t);return{month:e,day:r,year:1972}},extraFields:()=>[],fieldKeysToIgnore(n){let t=new Set;for(let e=0;e<n.length;e++){let r=n[e];t.add(r),r==="month"?t.add("monthCode"):r==="monthCode"&&t.add("month")}return su(t)},dateAdd(n,{years:t=0,months:e=0,weeks:r=0,days:i=0},o){let{year:a,month:s,day:l}=n;return a+=t,s+=e,{year:a,month:s}=Xn(a,s),{year:a,month:s,day:l}=di(a,s,l,o),l+=i+7*r,Tt(a,s,l)},dateUntil(n,t,e){let r=-cn(n,t);if(r===0)return{years:0,months:0,weeks:0,days:0};let i,o=0,a=0;if(e==="year"||e==="month"){let m=t.year-n.year;for(m!==0&&(m-=r);!dl(r,n.year+m,n.month,n.day,t);)o=m,m+=r;let f=r;for(i=Xn(n.year+o,n.month+f);!dl(r,i.year,i.month,n.day,t);)a=f,f+=r,i=Xn(i.year,i.month+r);e==="month"&&(a+=12*o,o=0)}i=Xn(n.year+o,n.month+a);let s=Xl(i.year,i.month,n.day),l=0,u=ir(t.year,t.month-1,t.day)-ir(s.year,s.month-1,s.day);return e==="week"&&(l=Math.trunc(u/7),u%=7),{years:o,months:a,weeks:l,days:u}},isoToDate({year:n,month:t,day:e},r){let i={era:void 0,eraYear:void 0,year:n,month:t,day:e,daysInWeek:7,monthsInYear:12};if(r.monthCode&&(i.monthCode=on(t)),r.dayOfWeek){let o=t+(t<3?10:-2),a=n-(t<3?1:0),s=Math.floor(a/100),l=a-100*s,u=(e+Math.floor(2.6*o-.2)+(l+Math.floor(l/4))+(Math.floor(s/4)-2*s))%7;i.dayOfWeek=u+(u<=0?7:0)}if(r.dayOfYear){let o=e;for(let a=t-1;a>0;a--)o+=er(n,a);i.dayOfYear=o}return r.weekOfYear&&(i.weekOfYear=cu("iso8601",{year:n,month:t,day:e})),r.daysInMonth&&(i.daysInMonth=er(n,t)),(r.daysInYear||r.inLeapYear)&&(i.inLeapYear=Mo(n),i.daysInYear=i.inLeapYear?366:365),i},getFirstDayOfWeek:()=>1,getMinimalDaysInFirstWeek:()=>4};var At=class n{constructor(t){if(this.map=new Map,this.calls=0,this.hits=0,this.misses=0,t!==void 0){let e=0;for(let r of t.map.entries()){if(++e>n.MAX_CACHE_ENTRIES)break;this.map.set(...r)}}}get(t){let e=this.map.get(t);return e&&(this.hits++,this.report()),this.calls++,e}set(t,e){this.map.set(t,e),this.misses++,this.report()}report(){}setObject(t){if(n.objectMap.get(t))throw new RangeError("object already cached");n.objectMap.set(t,this),this.report()}static getCacheForObject(t){let e=n.objectMap.get(t);return e||(e=new n,n.objectMap.set(t,e)),e}};function lu({isoYear:n,isoMonth:t,isoDay:e}){return`${zi(n)}-${Ft(t)}-${Ft(e)}T00:00Z`}function Va(n,t){return{years:n.year-t.year,months:n.month-t.month,days:n.day-t.day}}At.objectMap=new WeakMap,At.MAX_CACHE_ENTRIES=1e3;var En=class{constructor(){this.eras=[],this.hasEra=!1,this.erasBeginMidYear=!1}getFormatter(){return this.formatter===void 0&&(this.formatter=new Intl.DateTimeFormat(`en-US-u-ca-${this.id}`,{day:"numeric",month:"numeric",year:"numeric",era:"short",timeZone:"UTC"})),this.formatter}getCalendarParts(t){let e=this.getFormatter(),r=new Date(t);if(t==="-271821-04-19T00:00Z"){let i=e.resolvedOptions();e=new Intl.DateTimeFormat(i.locale,{...i,timeZone:"Etc/GMT+1"}),r=new Date("-271821-04-20T00:00Z")}try{return e.formatToParts(r)}catch{throw new RangeError(`Invalid ISO date: ${t}`)}}isoToCalendarDate(t,e){let{year:r,month:i,day:o}=t,a=JSON.stringify({func:"isoToCalendarDate",isoYear:r,isoMonth:i,isoDay:o,id:this.id}),s=e.get(a);if(s)return s;let l=lu({isoYear:r,isoMonth:i,isoDay:o}),u=this.getCalendarParts(l),m={};for(let y=0;y<u.length;y++){let{type:E,value:x}=u[y];if(E!=="year"&&E!=="relatedYear"||(this.hasEra?m.eraYear=+x:m.year=+x),E==="month"){let I=/^([0-9]*)(.*?)$/.exec(x);if(!I||I.length!=3||!I[1]&&!I[2])throw new RangeError(`Unexpected month: ${x}`);if(m.month=I[1]?+I[1]:1,m.month<1)throw new RangeError(`Invalid month ${x} from ${l}[u-ca-${this.id}] (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10527)`);if(m.month>13)throw new RangeError(`Invalid month ${x} from ${l}[u-ca-${this.id}] (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10529)`);I[2]&&(m.monthExtra=I[2])}E==="day"&&(m.day=+x),this.hasEra&&E==="era"&&x!=null&&x!==""&&(m.era=x.split(" (")[0].normalize("NFD").replace(/[^-0-9 \p{L}]/gu,"").replace(/ /g,"-").toLowerCase())}if(this.hasEra&&m.eraYear===void 0)throw new RangeError(`Intl.DateTimeFormat.formatToParts lacks relatedYear in ${this.id} calendar. Try Node 14+ or modern browsers.`);if(this.hasEra){let y=this.eras.find(E=>m.era===E.genericName);y&&(m.era=y.code)}if(this.reviseIntlEra){let{era:y,eraYear:E}=this.reviseIntlEra(m,t);m.era=y,m.eraYear=E}this.checkIcuBugs&&this.checkIcuBugs(t);let f=this.adjustCalendarDate(m,e,"constrain",!0);if(f.year===void 0)throw new RangeError(`Missing year converting ${JSON.stringify(t)}`);if(f.month===void 0)throw new RangeError(`Missing month converting ${JSON.stringify(t)}`);if(f.day===void 0)throw new RangeError(`Missing day converting ${JSON.stringify(t)}`);return e.set(a,f),["constrain","reject"].forEach(y=>{let E=JSON.stringify({func:"calendarToIsoDate",year:f.year,month:f.month,day:f.day,overflow:y,id:this.id});e.set(E,t)}),f}validateCalendarDate(t){let{month:e,year:r,day:i,eraYear:o,monthCode:a,monthExtra:s}=t;if(s!==void 0)throw new RangeError("Unexpected `monthExtra` value");if(r===void 0&&o===void 0)throw new TypeError("year or eraYear is required");if(e===void 0&&a===void 0)throw new TypeError("month or monthCode is required");if(i===void 0)throw new RangeError("Missing day");if(a!==void 0){if(typeof a!="string")throw new RangeError("monthCode must be a string, not "+typeof a);if(!/^M([01]?\d)(L?)$/.test(a))throw new RangeError(`Invalid monthCode: ${a}`)}if(this.hasEra&&t.era===void 0!=(t.eraYear===void 0))throw new TypeError("properties era and eraYear must be provided together")}adjustCalendarDate(t,e=void 0,r="constrain",i=!1){if(this.calendarType==="lunisolar")throw new RangeError("Override required for lunisolar calendars");let o=t;this.validateCalendarDate(o);let a=this.monthsInYear(o,e),{month:s,monthCode:l}=o;return{month:s,monthCode:l}=zs(o,r,a),{...o,month:s,monthCode:l}}regulateMonthDayNaive(t,e,r){let i=this.monthsInYear(t,r),{month:o,day:a}=t;return e==="reject"?($e(o,1,i),$e(a,1,this.maximumMonthLength(t))):(o=gt(o,1,i),a=gt(a,1,this.maximumMonthLength({...t,month:o}))),{...t,month:o,day:a}}calendarToIsoDate(t,e="constrain",r){let i=t,o=this.adjustCalendarDate(t,r,e,!1);o=this.regulateMonthDayNaive(o,e,r);let{year:a,month:s,day:l}=o,u=JSON.stringify({func:"calendarToIsoDate",year:a,month:s,day:l,overflow:e,id:this.id}),m,f=r.get(u);if(f||i.year!==void 0&&i.month!==void 0&&i.day!==void 0&&(i.year!==o.year||i.month!==o.month||i.day!==o.day)&&(m=JSON.stringify({func:"calendarToIsoDate",year:i.year,month:i.month,day:i.day,overflow:e,id:this.id}),f=r.get(m),f))return f;let y=this.estimateIsoDate({year:a,month:s,day:l}),E=W=>{let K=this.addDaysIso(y,W);if(o.day>this.minimumMonthLength(o)){let te=this.isoToCalendarDate(K,r);for(;te.month!==s||te.year!==a;){if(e==="reject")throw new RangeError(`day ${l} does not exist in month ${s} of year ${a}`);K=this.addDaysIso(K,-1),te=this.isoToCalendarDate(K,r)}}return K},x=0,I=this.isoToCalendarDate(y,r),L=Va(o,I);if(L.years!==0||L.months!==0||L.days!==0){let W=365*L.years+30*L.months+L.days;y=this.addDaysIso(y,W),I=this.isoToCalendarDate(y,r),L=Va(o,I),L.years===0&&L.months===0?y=E(L.days):x=this.compareCalendarDates(o,I)}let z=8;for(;x;){y=this.addDaysIso(y,x*z);let W=I;I=this.isoToCalendarDate(y,r);let K=x;if(x=this.compareCalendarDates(o,I),x){if(L=Va(o,I),L.years===0&&L.months===0)y=E(L.days),x=0;else if(K&&x!==K)if(z>1)z/=2;else{if(e==="reject")throw new RangeError(`Can't find ISO date from calendar date: ${JSON.stringify({...i})}`);this.compareCalendarDates(I,W)>0&&(y=this.addDaysIso(y,-1)),x=0}}}if(r.set(u,y),m&&r.set(m,y),o.year===void 0||o.month===void 0||o.day===void 0||o.monthCode===void 0||this.hasEra&&(o.era===void 0||o.eraYear===void 0))throw new RangeError("Unexpected missing property");return y}compareCalendarDates(t,e){return t.year!==e.year?kt(t.year-e.year):t.month!==e.month?kt(t.month-e.month):t.day!==e.day?kt(t.day-e.day):0}regulateDate(t,e="constrain",r){let i=this.calendarToIsoDate(t,e,r);return this.isoToCalendarDate(i,r)}addDaysIso(t,e){return Tt(t.year,t.month,t.day+e)}addDaysCalendar(t,e,r){let i=this.calendarToIsoDate(t,"constrain",r),o=this.addDaysIso(i,e);return this.isoToCalendarDate(o,r)}addMonthsCalendar(t,e,r,i){let o=t,{day:a}=o;for(let s=0,l=Math.abs(e);s<l;s++){let{month:u}=o,m=o,f=e<0?-Math.max(a,this.daysInPreviousMonth(o,i)):this.daysInMonth(o,i),y=this.calendarToIsoDate(o,"constrain",i),E=this.addDaysIso(y,f);if(o=this.isoToCalendarDate(E,i),e>0){let x=this.monthsInYear(m,i);for(;o.month-1!=u%x;)E=this.addDaysIso(E,-1),o=this.isoToCalendarDate(E,i)}o.day!==a&&(o=this.regulateDate({...o,day:a},"constrain",i))}if(r==="reject"&&o.day!==a)throw new RangeError(`Day ${a} does not exist in resulting calendar month`);return o}addCalendar(t,{years:e=0,months:r=0,weeks:i=0,days:o=0},a,s){let{year:l,day:u,monthCode:m}=t,f=this.adjustCalendarDate({year:l+e,monthCode:m,day:u},s),y=this.addMonthsCalendar(f,r,a,s),E=o+7*i;return this.addDaysCalendar(y,E,s)}untilCalendar(t,e,r,i){let o=0,a=0,s=0,l=0;switch(r){case"day":o=this.calendarDaysUntil(t,e,i);break;case"week":{let u=this.calendarDaysUntil(t,e,i);o=u%7,a=(u-o)/7;break}case"month":case"year":{let u=this.compareCalendarDates(e,t);if(!u)return{years:0,months:0,weeks:0,days:0};let m=e.year-t.year,f=e.day-t.day;if(r==="year"&&m){let x=0;e.monthCode>t.monthCode&&(x=1),e.monthCode<t.monthCode&&(x=-1),x||(x=Math.sign(f)),l=x*u<0?m-u:m}let y,E=l?this.addCalendar(t,{years:l},"constrain",i):t;do s+=u,y=E,E=this.addMonthsCalendar(y,u,"constrain",i),E.day!==t.day&&(E=this.regulateDate({...E,day:t.day},"constrain",i));while(this.compareCalendarDates(e,E)*u>=0);s-=u,o=this.calendarDaysUntil(y,e,i);break}}return{years:l,months:s,weeks:a,days:o}}daysInMonth(t,e){let{day:r}=t,i=this.maximumMonthLength(t),o=this.minimumMonthLength(t);if(o===i)return o;let a=r<=i-o?i:o,s=this.calendarToIsoDate(t,"constrain",e),l=this.addDaysIso(s,a),u=this.isoToCalendarDate(l,e),m=this.addDaysIso(l,-u.day);return this.isoToCalendarDate(m,e).day}daysInPreviousMonth(t,e){let{day:r,month:i,year:o}=t,a={year:i>1?o:o-1,month:i,day:1},s=i>1?i-1:this.monthsInYear(a,e);a={...a,month:s};let l=this.minimumMonthLength(a),u=this.maximumMonthLength(a);if(l===u)return u;let m=this.calendarToIsoDate(t,"constrain",e),f=this.addDaysIso(m,-r);return this.isoToCalendarDate(f,e).day}startOfCalendarYear(t){return{year:t.year,month:1,monthCode:"M01",day:1}}startOfCalendarMonth(t){return{year:t.year,month:t.month,day:1}}calendarDaysUntil(t,e,r){let i=this.calendarToIsoDate(t,"constrain",r),o=this.calendarToIsoDate(e,"constrain",r);return ir(o.year,o.month-1,o.day)-ir(i.year,i.month-1,i.day)}monthDaySearchStartYear(t,e){return 1972}monthDayFromFields(t,e,r){let i,o,a,s,l,{era:u,eraYear:m,year:f,month:y,monthCode:E,day:x}=t;if(y!==void 0&&f===void 0&&(!this.hasEra||u===void 0||m===void 0))throw new TypeError("when month is present, year (or era and eraYear) are required");(E===void 0||f!==void 0||this.hasEra&&m!==void 0)&&({monthCode:E,day:x}=this.isoToCalendarDate(this.calendarToIsoDate(t,e,r),r));let I={year:this.monthDaySearchStartYear(E,x),month:12,day:31},L=this.isoToCalendarDate(I,r),z=L.monthCode>E||L.monthCode===E&&L.day>=x?L.year:L.year-1;for(let W=0;W<20;W++){let K=this.adjustCalendarDate({day:x,monthCode:E,year:z-W},r),te=this.calendarToIsoDate(K,"constrain",r),re=this.isoToCalendarDate(te,r);if({year:i,month:o,day:a}=te,re.monthCode===E&&re.day===x)return{month:o,day:a,year:i};if(e==="constrain"){let le=this.maxLengthOfMonthCodeInAnyYear(re.monthCode);if(re.monthCode===E&&re.day===le&&x>le)return{month:o,day:a,year:i};(s===void 0||re.monthCode===s.monthCode&&re.day>s.day)&&(s=re,l=te)}}if(e==="constrain"&&l!==void 0)return l;throw new RangeError(`No recent ${this.id} year with monthCode ${E} and day ${x}`)}getFirstDayOfWeek(){}getMinimalDaysInFirstWeek(){}},ms=class extends En{constructor(){super(...arguments),this.id="hebrew",this.calendarType="lunisolar",this.months={Tishri:{leap:1,regular:1,monthCode:"M01",days:30},Heshvan:{leap:2,regular:2,monthCode:"M02",days:{min:29,max:30}},Kislev:{leap:3,regular:3,monthCode:"M03",days:{min:29,max:30}},Tevet:{leap:4,regular:4,monthCode:"M04",days:29},Shevat:{leap:5,regular:5,monthCode:"M05",days:30},Adar:{leap:void 0,regular:6,monthCode:"M06",days:29},"Adar I":{leap:6,regular:void 0,monthCode:"M05L",days:30},"Adar II":{leap:7,regular:void 0,monthCode:"M06",days:29},Nisan:{leap:8,regular:7,monthCode:"M07",days:30},Iyar:{leap:9,regular:8,monthCode:"M08",days:29},Sivan:{leap:10,regular:9,monthCode:"M09",days:30},Tamuz:{leap:11,regular:10,monthCode:"M10",days:29},Av:{leap:12,regular:11,monthCode:"M11",days:30},Elul:{leap:13,regular:12,monthCode:"M12",days:29}}}inLeapYear(t){let{year:e}=t;return(7*e+1)%19<7}monthsInYear(t){return this.inLeapYear(t)?13:12}minimumMonthLength(t){return this.minMaxMonthLength(t,"min")}maximumMonthLength(t){return this.minMaxMonthLength(t,"max")}minMaxMonthLength(t,e){let{month:r,year:i}=t,o=this.getMonthCode(i,r),a=Object.entries(this.months).find(l=>l[1].monthCode===o);if(a===void 0)throw new RangeError(`unmatched Hebrew month: ${r}`);let s=a[1].days;return typeof s=="number"?s:s[e]}maxLengthOfMonthCodeInAnyYear(t){return["M04","M06","M08","M10","M12"].includes(t)?29:30}estimateIsoDate(t){let{year:e}=t;return{year:e-3760,month:1,day:1}}getMonthCode(t,e){return this.inLeapYear({year:t})?e===6?on(5,!0):on(e<6?e:e-1):on(e)}adjustCalendarDate(t,e,r="constrain",i=!1){let{year:o,month:a,monthCode:s,day:l,monthExtra:u}=t;if(o===void 0)throw new TypeError("Missing property: year");if(i){if(u){let m=this.months[u];if(!m)throw new RangeError(`Unrecognized month from formatToParts: ${u}`);a=this.inLeapYear({year:o})?m.leap:m.regular}return s=this.getMonthCode(o,a),{year:o,month:a,day:l,monthCode:s}}if(this.validateCalendarDate(t),a===void 0)if(s.endsWith("L")){if(s!=="M05L")throw new RangeError(`Hebrew leap month must have monthCode M05L, not ${s}`);if(a=6,!this.inLeapYear({year:o})){if(r==="reject")throw new RangeError(`Hebrew monthCode M05L is invalid in year ${o} which is not a leap year`);a=6,s="M06"}}else{a=ar(s),this.inLeapYear({year:o})&&a>=6&&a++;let m=this.monthsInYear({year:o});if(a<1||a>m)throw new RangeError(`Invalid monthCode: ${s}`)}else if(r==="reject"?($e(a,1,this.monthsInYear({year:o})),$e(l,1,this.maximumMonthLength({year:o,month:a}))):(a=gt(a,1,this.monthsInYear({year:o})),l=gt(l,1,this.maximumMonthLength({year:o,month:a}))),s===void 0)s=this.getMonthCode(o,a);else if(this.getMonthCode(o,a)!==s)throw new RangeError(`monthCode ${s} doesn't correspond to month ${a} in Hebrew year ${o}`);return{...t,day:l,month:a,monthCode:s,year:o}}},jn=class extends En{constructor(){super(...arguments),this.calendarType="lunar",this.DAYS_PER_ISLAMIC_YEAR=354+11/30,this.DAYS_PER_ISO_YEAR=365.2425}inLeapYear(t,e){let r={year:t.year,month:1,monthCode:"M01",day:1},i={year:t.year+1,month:1,monthCode:"M01",day:1};return this.calendarDaysUntil(r,i,e)===355}monthsInYear(){return 12}minimumMonthLength(){return 29}maximumMonthLength(){return 30}maxLengthOfMonthCodeInAnyYear(){return 30}estimateIsoDate(t){let{year:e}=this.adjustCalendarDate(t);return{year:Math.floor(e*this.DAYS_PER_ISLAMIC_YEAR/this.DAYS_PER_ISO_YEAR)+622,month:1,day:1}}},fs=class extends jn{constructor(){super(...arguments),this.id="islamic"}},ps=class extends jn{constructor(){super(...arguments),this.id="islamic-umalqura"}},gs=class extends jn{constructor(){super(...arguments),this.id="islamic-tbla"}},ys=class extends jn{constructor(){super(...arguments),this.id="islamic-civil"}},vs=class extends jn{constructor(){super(...arguments),this.id="islamic-rgsa"}},ws=class extends jn{constructor(){super(...arguments),this.id="islamicc"}},bs=class extends En{constructor(){super(...arguments),this.id="persian",this.calendarType="solar"}inLeapYear(t,e){return this.daysInMonth({year:t.year,month:12,day:1},e)===30}monthsInYear(){return 12}minimumMonthLength(t){let{month:e}=t;return e===12?29:e<=6?31:30}maximumMonthLength(t){let{month:e}=t;return e===12?30:e<=6?31:30}maxLengthOfMonthCodeInAnyYear(t){return ar(t)<=6?31:30}estimateIsoDate(t){let{year:e}=this.adjustCalendarDate(t);return{year:e+621,month:1,day:1}}},Ds=class extends En{constructor(){super(...arguments),this.id="indian",this.calendarType="solar",this.months={1:{length:30,month:3,day:22,leap:{length:31,month:3,day:21}},2:{length:31,month:4,day:21},3:{length:31,month:5,day:22},4:{length:31,month:6,day:22},5:{length:31,month:7,day:23},6:{length:31,month:8,day:23},7:{length:30,month:9,day:23},8:{length:30,month:10,day:23},9:{length:30,month:11,day:22},10:{length:30,month:12,day:22},11:{length:30,month:1,nextYear:!0,day:21},12:{length:30,month:2,nextYear:!0,day:20}},this.vulnerableToBceBug=new Date("0000-01-01T00:00Z").toLocaleDateString("en-US-u-ca-indian",{timeZone:"UTC"})!=="10/11/-79 Saka"}inLeapYear(t){return Us(t.year+78)}monthsInYear(){return 12}minimumMonthLength(t){return this.getMonthInfo(t).length}maximumMonthLength(t){return this.getMonthInfo(t).length}maxLengthOfMonthCodeInAnyYear(t){let e=ar(t),r=this.months[e];return r=r.leap??r,r.length}getMonthInfo(t){let{month:e}=t,r=this.months[e];if(r===void 0)throw new RangeError(`Invalid month: ${e}`);return this.inLeapYear(t)&&r.leap&&(r=r.leap),r}estimateIsoDate(t){let e=this.adjustCalendarDate(t),r=this.getMonthInfo(e);return Tt(e.year+78+(r.nextYear?1:0),r.month,r.day+e.day-1)}checkIcuBugs(t){if(this.vulnerableToBceBug&&t.year<1)throw new RangeError(`calendar '${this.id}' is broken for ISO dates before 0001-01-01 (see https://bugs.chromium.org/p/v8/issues/detail?id=10529)`)}};function Us(n){return n%4==0&&(n%100!=0||n%400==0)}var Co=class extends En{constructor(t,e){super(),this.calendarType="solar",this.id=t,this.isoEpoch=e}inLeapYear(t){let{year:e}=this.estimateIsoDate({month:1,day:1,year:t.year});return Us(e)}monthsInYear(){return 12}minimumMonthLength(t){let{month:e}=t;return e===2?this.inLeapYear(t)?29:28:[4,6,9,11].indexOf(e)>=0?30:31}maximumMonthLength(t){return this.minimumMonthLength(t)}maxLengthOfMonthCodeInAnyYear(t){return[31,29,31,30,31,30,31,31,30,31,30,31][ar(t)-1]}estimateIsoDate(t){let e=this.adjustCalendarDate(t);return di(e.year+this.isoEpoch.year,e.month+this.isoEpoch.month,e.day+this.isoEpoch.day,"constrain")}},Io=class extends En{constructor(t,e){super(),this.hasEra=!0,this.calendarType="solar",this.id=t;let{eras:r,anchorEra:i}=function(o){let a,s=o;if(s.length===0)throw new RangeError("Invalid era data: eras are required");if(s.length===1&&s[0].reverseOf)throw new RangeError("Invalid era data: anchor era cannot count years backwards");if(s.length===1&&!s[0].code)throw new RangeError("Invalid era data: at least one named era is required");if(s.filter(u=>u.reverseOf!=null).length>1)throw new RangeError("Invalid era data: only one era can count years backwards");s.forEach(u=>{if(u.isAnchor||!u.anchorEpoch&&!u.reverseOf){if(a)throw new RangeError("Invalid era data: cannot have multiple anchor eras");a=u,u.anchorEpoch={year:u.hasYearZero?0:1}}else if(!u.code)throw new RangeError("If era name is blank, it must be the anchor era")}),s=s.filter(u=>u.code),s.forEach(u=>{let{reverseOf:m}=u;if(m){let f=s.find(y=>y.code===m);if(f===void 0)throw new RangeError(`Invalid era data: unmatched reverseOf era: ${m}`);u.reverseOf=f,u.anchorEpoch=f.anchorEpoch,u.isoEpoch=f.isoEpoch}u.anchorEpoch.month===void 0&&(u.anchorEpoch.month=1),u.anchorEpoch.day===void 0&&(u.anchorEpoch.day=1)}),s.sort((u,m)=>{if(u.reverseOf)return 1;if(m.reverseOf)return-1;if(!u.isoEpoch||!m.isoEpoch)throw new RangeError("Invalid era data: missing ISO epoch");return m.isoEpoch.year-u.isoEpoch.year});let l=s[s.length-1].reverseOf;if(l&&l!==s[s.length-2])throw new RangeError("Invalid era data: invalid reverse-sign era");return s.forEach((u,m)=>{u.genericName="era"+(s.length-1-m)}),{eras:s,anchorEra:a||s[0]}}(e);this.anchorEra=i,this.eras=r}inLeapYear(t){let{year:e}=this.estimateIsoDate({month:1,day:1,year:t.year});return Us(e)}monthsInYear(){return 12}minimumMonthLength(t){let{month:e}=t;return e===2?this.inLeapYear(t)?29:28:[4,6,9,11].indexOf(e)>=0?30:31}maximumMonthLength(t){return this.minimumMonthLength(t)}maxLengthOfMonthCodeInAnyYear(t){return[31,29,31,30,31,30,31,31,30,31,30,31][ar(t)-1]}completeEraYear(t){let e=(s,l,u)=>{let m=t[s];if(m!=null&&m!=l&&!(u||[]).includes(m)){let f=u?.[0];throw new RangeError(`Input ${s} ${m} doesn't match calculated value ${f?`${l} (also called ${f})`:l}`)}},r=s=>{let l,u={...t,year:s},m=this.eras.find((f,y)=>{if(y===this.eras.length-1){if(f.reverseOf){if(s>0)throw new RangeError(`Signed year ${s} is invalid for era ${f.code}`);return l=f.anchorEpoch.year-s,!0}return l=s-f.anchorEpoch.year+(f.hasYearZero?0:1),!0}return this.compareCalendarDates(u,f.anchorEpoch)>=0&&(l=s-f.anchorEpoch.year+(f.hasYearZero?0:1),!0)});if(!m)throw new RangeError(`Year ${s} was not matched by any era`);return{eraYear:l,era:m.code,eraNames:m.names}},{year:i,eraYear:o,era:a}=t;if(i!=null){let s=r(i);({eraYear:o,era:a}=s),e("era",a,s?.eraNames),e("eraYear",o)}else{if(o==null)throw new RangeError("Either year or eraYear and era are required");{if(a===void 0)throw new RangeError("era and eraYear must be provided together");let s=this.eras.find(({code:l,names:u=[]})=>l===a||u.includes(a));if(!s)throw new RangeError(`Era ${a} (ISO year ${o}) was not matched by any era`);i=s.reverseOf?s.anchorEpoch.year-o:o+s.anchorEpoch.year-(s.hasYearZero?0:1),e("year",i),{eraYear:o,era:a}=r(i)}}return{...t,year:i,eraYear:o,era:a}}adjustCalendarDate(t,e,r="constrain"){let i=t,{month:o,monthCode:a}=i;return o===void 0&&(i={...i,month:ar(a)}),this.validateCalendarDate(i),i=this.completeEraYear(i),super.adjustCalendarDate(i,e,r)}estimateIsoDate(t){let e=this.adjustCalendarDate(t),{year:r,month:i,day:o}=e,{anchorEra:a}=this;return di(r+a.isoEpoch.year-(a.hasYearZero?0:1),i,o,"constrain")}},_i=class extends Io{constructor(t,e){super(t,e)}isoToCalendarDate(t){let{year:e,month:r,day:i}=t,o=on(r),a=e-this.anchorEra.isoEpoch.year+1;return this.completeEraYear({year:a,month:r,monthCode:o,day:i})}},nn={inLeapYear(n){let{year:t}=n;return(t+1)%4==0},monthsInYear:()=>13,minimumMonthLength(n){let{month:t}=n;return t===13?this.inLeapYear(n)?6:5:30},maximumMonthLength(n){return this.minimumMonthLength(n)},maxLengthOfMonthCodeInAnyYear:n=>n==="M13"?6:30},_s=class extends Co{constructor(t,e){super(t,e),this.inLeapYear=nn.inLeapYear,this.monthsInYear=nn.monthsInYear,this.minimumMonthLength=nn.minimumMonthLength,this.maximumMonthLength=nn.maximumMonthLength,this.maxLengthOfMonthCodeInAnyYear=nn.maxLengthOfMonthCodeInAnyYear}},xo=class extends Io{constructor(t,e){super(t,e),this.inLeapYear=nn.inLeapYear,this.monthsInYear=nn.monthsInYear,this.minimumMonthLength=nn.minimumMonthLength,this.maximumMonthLength=nn.maximumMonthLength,this.maxLengthOfMonthCodeInAnyYear=nn.maxLengthOfMonthCodeInAnyYear}},Es=class extends _s{constructor(){super("ethioaa",{year:-5492,month:7,day:17})}},Ms=class extends xo{constructor(){super("coptic",[{code:"coptic",isoEpoch:{year:284,month:8,day:29}},{code:"coptic-inverse",reverseOf:"coptic"}])}},ks=class extends xo{constructor(){super("ethiopic",[{code:"ethioaa",names:["ethiopic-amete-alem","mundi"],isoEpoch:{year:-5492,month:7,day:17}},{code:"ethiopic",names:["incar"],isoEpoch:{year:8,month:8,day:27},anchorEpoch:{year:5501}}])}},Ss=class extends _i{constructor(){super("roc",[{code:"roc",names:["minguo"],isoEpoch:{year:1912,month:1,day:1}},{code:"roc-inverse",names:["before-roc"],reverseOf:"roc"}])}},Ts=class extends Co{constructor(){super("buddhist",{year:-543,month:1,day:1})}},Cs=class extends _i{constructor(){super("gregory",[{code:"gregory",names:["ad","ce"],isoEpoch:{year:1,month:1,day:1}},{code:"gregory-inverse",names:["be","bce"],reverseOf:"gregory"}])}reviseIntlEra(t){let{era:e,eraYear:r}=t;return e==="b"&&(e="gregory-inverse"),e==="a"&&(e="gregory"),{era:e,eraYear:r}}getFirstDayOfWeek(){return 1}getMinimalDaysInFirstWeek(){return 1}},Is=class extends _i{constructor(){super("japanese",[{code:"reiwa",isoEpoch:{year:2019,month:5,day:1},anchorEpoch:{year:2019,month:5,day:1}},{code:"heisei",isoEpoch:{year:1989,month:1,day:8},anchorEpoch:{year:1989,month:1,day:8}},{code:"showa",isoEpoch:{year:1926,month:12,day:25},anchorEpoch:{year:1926,month:12,day:25}},{code:"taisho",isoEpoch:{year:1912,month:7,day:30},anchorEpoch:{year:1912,month:7,day:30}},{code:"meiji",isoEpoch:{year:1868,month:9,day:8},anchorEpoch:{year:1868,month:9,day:8}},{code:"japanese",names:["japanese","gregory","ad","ce"],isoEpoch:{year:1,month:1,day:1}},{code:"japanese-inverse",names:["japanese-inverse","gregory-inverse","bc","bce"],reverseOf:"japanese"}]),this.erasBeginMidYear=!0}reviseIntlEra(t,e){let{era:r,eraYear:i}=t,{year:o}=e;return this.eras.find(a=>a.code===r)?{era:r,eraYear:i}:o<1?{era:"japanese-inverse",eraYear:1-o}:{era:"japanese",eraYear:o}}},Po=class extends En{constructor(){super(...arguments),this.calendarType="lunisolar"}inLeapYear(t,e){let r=this.getMonthList(t.year,e);return Object.entries(r).length===13}monthsInYear(t,e){return this.inLeapYear(t,e)?13:12}minimumMonthLength(){return 29}maximumMonthLength(){return 30}maxLengthOfMonthCodeInAnyYear(t){return["M01L","M09L","M10L","M11L","M12L"].includes(t)?29:30}monthDaySearchStartYear(t,e){let r={M01L:[1651,1651],M02L:[1947,1765],M03L:[1966,1955],M04L:[1963,1944],M05L:[1971,1952],M06L:[1960,1941],M07L:[1968,1938],M08L:[1957,1718],M09L:[1832,1832],M10L:[1870,1870],M11L:[1814,1814],M12L:[1890,1890]}[t]??[1972,1972];return e<30?r[0]:r[1]}getMonthList(t,e){if(t===void 0)throw new TypeError("Missing year");let r=JSON.stringify({func:"getMonthList",calendarYear:t,id:this.id}),i=e.get(r);if(i)return i;let o=this.getFormatter(),a=(L,z)=>{let W=lu({isoYear:L,isoMonth:2,isoDay:1}),K=new Date(W);K.setUTCDate(z+1);let te=o.formatToParts(K),re=te.find(ne=>ne.type==="month").value,le=+te.find(ne=>ne.type==="day").value,Me=te.find(ne=>ne.type==="relatedYear"),_e;if(Me===void 0)throw new RangeError(`Intl.DateTimeFormat.formatToParts lacks relatedYear in ${this.id} calendar. Try Node 14+ or modern browsers.`);return _e=+Me.value,{calendarMonthString:re,calendarDay:le,calendarYearToVerify:_e}},s=17,{calendarMonthString:l,calendarDay:u,calendarYearToVerify:m}=a(t,s);l!=="1"&&(s+=29,{calendarMonthString:l,calendarDay:u}=a(t,s)),s-=u-5;let f={},y,E,x=1,I=!1;do({calendarMonthString:l,calendarDay:u,calendarYearToVerify:m}=a(t,s)),y&&(f[E].daysInMonth=y+30-u),m!==t?I=!0:(f[l]={monthIndex:x++},s+=30),y=u,E=l;while(!I);return f[E].daysInMonth=y+30-u,e.set(r,f),f}estimateIsoDate(t){let{year:e,month:r}=t;return{year:e,month:r>=12?12:r+1,day:1}}adjustCalendarDate(t,e,r="constrain",i=!1){let{year:o,month:a,monthExtra:s,day:l,monthCode:u}=t;if(o===void 0)throw new TypeError("Missing property: year");if(i){if(s&&s!=="bis")throw new RangeError(`Unexpected leap month suffix: ${s}`);let m=on(a,s!==void 0),f=`${a}${s||""}`,y=this.getMonthList(o,e)[f];if(y===void 0)throw new RangeError(`Unmatched month ${f} in Chinese year ${o}`);return a=y.monthIndex,{year:o,month:a,day:l,monthCode:m}}if(this.validateCalendarDate(t),a===void 0){let m=this.getMonthList(o,e),f=u.replace(/^M|L$/g,E=>E==="L"?"bis":"");f[0]==="0"&&(f=f.slice(1));let y=m[f];if(a=y&&y.monthIndex,a===void 0&&u.endsWith("L")&&u!="M13L"&&r==="constrain"){let E=+u.replace(/^M0?|L$/g,"");y=m[E],y&&(a=y.monthIndex,u=on(E))}if(a===void 0)throw new RangeError(`Unmatched month ${u} in Chinese year ${o}`)}else if(u===void 0){let m=this.getMonthList(o,e),f=Object.entries(m),y=f.length;r==="reject"?($e(a,1,y),$e(l,1,this.maximumMonthLength())):(a=gt(a,1,y),l=gt(l,1,this.maximumMonthLength()));let E=f.find(x=>x[1].monthIndex===a);if(E===void 0)throw new RangeError(`Invalid month ${a} in Chinese year ${o}`);u=on(+E[0].replace("bis",""),E[0].indexOf("bis")!==-1)}else{let m=this.getMonthList(o,e),f=u.replace(/^M|L$/g,E=>E==="L"?"bis":"");f[0]==="0"&&(f=f.slice(1));let y=m[f];if(!y)throw new RangeError(`Unmatched monthCode ${u} in Chinese year ${o}`);if(a!==y.monthIndex)throw new RangeError(`monthCode ${u} doesn't correspond to month ${a} in Chinese year ${o}`)}return{...t,year:o,month:a,monthCode:u,day:l}}},xs=class extends Po{constructor(){super(...arguments),this.id="chinese"}},Ps=class extends Po{constructor(){super(...arguments),this.id="dangi"}},Rs=class{constructor(t){this.helper=t}extraFields(t){return this.helper.hasEra&&t.includes("year")?["era","eraYear"]:[]}resolveFields(t){if(this.helper.calendarType!=="lunisolar"){let e=new At;zs(t,void 0,this.helper.monthsInYear({year:t.year??1972},e))}}dateToISO(t,e){let r=new At,i=this.helper.calendarToIsoDate(t,e,r);return r.setObject(i),i}monthDayToISOReferenceDate(t,e){let r=new At,i=this.helper.monthDayFromFields(t,e,r);return r.setObject(i),i}fieldKeysToIgnore(t){let e=new Set;for(let r=0;r<t.length;r++){let i=t[r];switch(e.add(i),i){case"era":e.add("eraYear"),e.add("year");break;case"eraYear":e.add("era"),e.add("year");break;case"year":e.add("era"),e.add("eraYear");break;case"month":e.add("monthCode"),this.helper.erasBeginMidYear&&(e.add("era"),e.add("eraYear"));break;case"monthCode":e.add("month"),this.helper.erasBeginMidYear&&(e.add("era"),e.add("eraYear"));break;case"day":this.helper.erasBeginMidYear&&(e.add("era"),e.add("eraYear"))}}return su(e)}dateAdd(t,{years:e,months:r,weeks:i,days:o},a){let s=At.getCacheForObject(t),l=this.helper.isoToCalendarDate(t,s),u=this.helper.addCalendar(l,{years:e,months:r,weeks:i,days:o},a,s),m=this.helper.calendarToIsoDate(u,"constrain",s);return At.getCacheForObject(m)||new At(s).setObject(m),m}dateUntil(t,e,r){let i=At.getCacheForObject(t),o=At.getCacheForObject(e),a=this.helper.isoToCalendarDate(t,i),s=this.helper.isoToCalendarDate(e,o);return this.helper.untilCalendar(a,s,r,i)}isoToDate(t,e){let r=At.getCacheForObject(t),i=this.helper.isoToCalendarDate(t,r);if(e.dayOfWeek&&(i.dayOfWeek=Ui.iso8601.isoToDate(t,{dayOfWeek:!0}).dayOfWeek),e.dayOfYear){let o=this.helper.startOfCalendarYear(i),a=this.helper.calendarDaysUntil(o,i,r);i.dayOfYear=a+1}if(e.weekOfYear&&(i.weekOfYear=cu(this.helper.id,t)),i.daysInWeek=7,e.daysInMonth&&(i.daysInMonth=this.helper.daysInMonth(i,r)),e.daysInYear){let o=this.helper.startOfCalendarYear(i),a=this.helper.addCalendar(o,{years:1},"constrain",r);i.daysInYear=this.helper.calendarDaysUntil(o,a,r)}return e.monthsInYear&&(i.monthsInYear=this.helper.monthsInYear(i,r)),e.inLeapYear&&(i.inLeapYear=this.helper.inLeapYear(i,r)),i}getFirstDayOfWeek(){return this.helper.getFirstDayOfWeek()}getMinimalDaysInFirstWeek(){return this.helper.getMinimalDaysInFirstWeek()}};for(let n of[ms,bs,ks,Es,Ms,xs,Ps,Ss,Ds,Ts,Cs,Is,fs,ps,gs,ys,vs,ws]){let t=new n;Ui[t.id]=new Rs(t)}Xa("calendarImpl",function(n){return Ui[n]});var Ei=Intl.DateTimeFormat;function vr(n,t){let e=h(n,t);return typeof e=="function"&&(e=new Ei(h(n,Ml),e(h(n,Ka))),function(r,i,o){let a=Ao(r);if(a===void 0)throw new TypeError("Missing slots for the given container");if(a[i]===void 0)throw new TypeError(`tried to reset ${i} which was not set`);a[i]=o}(n,t,e)),e}function Qr(n){return bt(n,cr)}var sr=class{constructor(t=void 0,e=void 0){(function(r,i,o){let a=o!==void 0,s;if(a){let f=["localeMatcher","calendar","numberingSystem","hour12","hourCycle","timeZone","weekday","era","year","month","day","dayPeriod","hour","minute","second","fractionalSecondDigits","timeZoneName","formatMatcher","dateStyle","timeStyle"];s=function(E){if(E==null)throw new TypeError(`Expected object not ${E}`);return Object(E)}(o);let y=Object.create(null);for(let E=0;E<f.length;E++){let x=f[E];Object.prototype.hasOwnProperty.call(s,x)&&(y[x]=s[x])}s=y}else s=Object.create(null);let l=new Ei(i,s),u=l.resolvedOptions();if(Mn(r),a){let f=Object.assign(Object.create(null),u);for(let y in f)Object.prototype.hasOwnProperty.call(s,y)||delete f[y];f.hour12=s.hour12,f.hourCycle=s.hourCycle,me(r,Ka,f)}else me(r,Ka,s);me(r,Ml,u.locale),me(r,cr,l),me(r,Dr,u.timeZone),me(r,ti,u.calendar),me(r,vl,Fh),me(r,wl,Oh),me(r,bl,Yh),me(r,Dl,Lh),me(r,_l,Hh),me(r,El,jh);let m=a?s.timeZone:void 0;if(m===void 0)me(r,Wa,u.timeZone);else{let f=Yo(m);if(f.startsWith("\u2212"))throw new RangeError("Unicode minus (U+2212) is not supported in time zone offsets");me(r,Wa,vt(f))}})(this,t,e)}get format(){C(this,Qr);let t=Ph.bind(this);return Object.defineProperties(t,{length:{value:1,enumerable:!1,writable:!1,configurable:!0},name:{value:"",enumerable:!1,writable:!1,configurable:!0}}),t}formatRange(t,e){return C(this,Qr),Ah.call(this,t,e)}formatToParts(t,...e){return C(this,Qr),Rh.call(this,t,...e)}formatRangeToParts(t,e){return C(this,Qr),Nh.call(this,t,e)}resolvedOptions(){return C(this,Qr),xh.call(this)}};"formatToParts"in Ei.prototype||delete sr.prototype.formatToParts,"formatRangeToParts"in Ei.prototype||delete sr.prototype.formatRangeToParts;var Ot=function(n=void 0,t=void 0){return new sr(n,t)};function xh(){let n=h(this,cr).resolvedOptions();return n.timeZone=h(this,Wa),n}function Ph(n,...t){let e,r,i=Ar(n,this);return i.formatter?(e=i.formatter,r=[qt(i.epochNs,"floor")]):(e=h(this,cr),r=[n,...t]),e.format(...r)}function Rh(n,...t){let e,r,i=Ar(n,this);return i.formatter?(e=i.formatter,r=[qt(i.epochNs,"floor")]):(e=h(this,cr),r=[n,...t]),e.formatToParts(...r)}function Ah(n,t){if(n===void 0||t===void 0)throw new TypeError("Intl.DateTimeFormat.formatRange requires two values");let e=Ro(n),r=Ro(t),i,o=[e,r];if(Dn(e)!==Dn(r))throw new TypeError("Intl.DateTimeFormat.formatRange accepts two values of the same type");if(Dn(e)){if(!uu(e,r))throw new TypeError("Intl.DateTimeFormat.formatRange accepts two values of the same type");let{epochNs:a,formatter:s}=Ar(e,this),{epochNs:l,formatter:u}=Ar(r,this);s&&(i=s,o=[qt(a,"floor"),qt(l,"floor")])}return i||(i=h(this,cr)),i.formatRange(...o)}function Nh(n,t){if(n===void 0||t===void 0)throw new TypeError("Intl.DateTimeFormat.formatRange requires two values");let e=Ro(n),r=Ro(t),i,o=[e,r];if(Dn(e)!==Dn(r))throw new TypeError("Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type");if(Dn(e)){if(!uu(e,r))throw new TypeError("Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type");let{epochNs:a,formatter:s}=Ar(e,this),{epochNs:l,formatter:u}=Ar(r,this);s&&(i=s,o=[qt(a,"floor"),qt(l,"floor")])}return i||(i=h(this,cr)),i.formatRangeToParts(...o)}function Vi(n={},t={}){let e=Object.assign({},n),r=["year","month","day","hour","minute","second","weekday","dayPeriod","timeZoneName","dateStyle","timeStyle"];for(let i=0;i<r.length;i++){let o=r[i];e[o]=o in t?t[o]:e[o],e[o]!==!1&&e[o]!==void 0||delete e[o]}return e}function Lh(n){let t=Vi(n,{year:!1,month:!1,day:!1,weekday:!1,timeZoneName:!1,dateStyle:!1});if(t.timeStyle!=="long"&&t.timeStyle!=="full"||(delete t.timeStyle,Object.assign(t,{hour:"numeric",minute:"2-digit",second:"2-digit"})),!qo(t)){if(qi(n))throw new TypeError(`cannot format Temporal.PlainTime with options [${Object.keys(n)}]`);Object.assign(t,{hour:"numeric",minute:"numeric",second:"numeric"})}return t}function Oh(n){let t={short:{year:"2-digit",month:"numeric"},medium:{year:"numeric",month:"short"},long:{year:"numeric",month:"long"},full:{year:"numeric",month:"long"}},e=Vi(n,{day:!1,hour:!1,minute:!1,second:!1,weekday:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if("dateStyle"in e&&e.dateStyle){let r=e.dateStyle;delete e.dateStyle,Object.assign(e,t[r])}if(!("year"in e||"month"in e||"era"in e)){if(qi(n))throw new TypeError(`cannot format PlainYearMonth with options [${Object.keys(n)}]`);Object.assign(e,{year:"numeric",month:"numeric"})}return e}function Yh(n){let t={short:{month:"numeric",day:"numeric"},medium:{month:"short",day:"numeric"},long:{month:"long",day:"numeric"},full:{month:"long",day:"numeric"}},e=Vi(n,{year:!1,hour:!1,minute:!1,second:!1,weekday:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if("dateStyle"in e&&e.dateStyle){let r=e.dateStyle;delete e.dateStyle,Object.assign(e,t[r])}if(!("month"in e)&&!("day"in e)){if(qi(n))throw new TypeError(`cannot format PlainMonthDay with options [${Object.keys(n)}]`);Object.assign(e,{month:"numeric",day:"numeric"})}return e}function Fh(n){let t=Vi(n,{hour:!1,minute:!1,second:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if(!Vo(t)){if(qi(n))throw new TypeError(`cannot format PlainDate with options [${Object.keys(n)}]`);Object.assign(t,{year:"numeric",month:"numeric",day:"numeric"})}return t}function Hh(n){let t=Vi(n,{timeZoneName:!1});if((t.timeStyle==="long"||t.timeStyle==="full")&&(delete t.timeStyle,Object.assign(t,{hour:"numeric",minute:"2-digit",second:"2-digit"}),t.dateStyle)&&(Object.assign(t,{short:{year:"numeric",month:"numeric",day:"numeric"},medium:{year:"numeric",month:"short",day:"numeric"},long:{year:"numeric",month:"long",day:"numeric"},full:{year:"numeric",month:"long",day:"numeric",weekday:"long"}}[t.dateStyle]),delete t.dateStyle),!qo(t)&&!Vo(t)){if(qi(n))throw new TypeError(`cannot format PlainDateTime with options [${Object.keys(n)}]`);Object.assign(t,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})}return t}function jh(n){let t=n;return qo(t)||Vo(t)||(t=Object.assign({},t,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})),t}function Vo(n){return"year"in n||"month"in n||"day"in n||"weekday"in n||"dateStyle"in n||"era"in n}function qo(n){return"hour"in n||"minute"in n||"second"in n||"timeStyle"in n||"dayPeriod"in n||"fractionalSecondDigits"in n}function qi(n){return Vo(n)||qo(n)||"dateStyle"in n||"timeStyle"in n||"timeZoneName"in n}function Dn(n){return Ae(n)||Oe(n)||Te(n)||fe(n)||Ve(n)||Nt(n)||Ue(n)}function Ro(n){return Dn(n)?n:Oo(n)}function uu(n,t){return!(!Dn(n)||!Dn(t)||Oe(n)&&!Oe(t)||Ae(n)&&!Ae(t)||Te(n)&&!Te(t)||fe(n)&&!fe(t)||Ve(n)&&!Ve(t)||Nt(n)&&!Nt(t)||Ue(n)&&!Ue(t))}function Ar(n,t){if(Oe(n)){let e={isoDate:{year:1970,month:1,day:1},time:h(n,Ne)};return{epochNs:Qe(h(t,Dr),e,"compatible"),formatter:vr(t,Dl)}}if(Ve(n)){let e=h(n,H),r=h(t,ti);if(e!==r)throw new RangeError(`cannot format PlainYearMonth with calendar ${e} in locale with calendar ${r}`);let i=we(h(n,ae),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:Qe(h(t,Dr),i,"compatible"),formatter:vr(t,wl)}}if(Nt(n)){let e=h(n,H),r=h(t,ti);if(e!==r)throw new RangeError(`cannot format PlainMonthDay with calendar ${e} in locale with calendar ${r}`);let i=we(h(n,ae),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:Qe(h(t,Dr),i,"compatible"),formatter:vr(t,bl)}}if(Ae(n)){let e=h(n,H),r=h(t,ti);if(e!=="iso8601"&&e!==r)throw new RangeError(`cannot format PlainDate with calendar ${e} in locale with calendar ${r}`);let i=we(h(n,ae),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:Qe(h(t,Dr),i,"compatible"),formatter:vr(t,vl)}}if(Te(n)){let e=h(n,H),r=h(t,ti);if(e!=="iso8601"&&e!==r)throw new RangeError(`cannot format PlainDateTime with calendar ${e} in locale with calendar ${r}`);let i=h(n,xe);return{epochNs:Qe(h(t,Dr),i,"compatible"),formatter:vr(t,_l)}}if(fe(n))throw new TypeError("Temporal.ZonedDateTime not supported in DateTimeFormat methods. Use toLocaleString() instead.");return Ue(n)?{epochNs:h(n,oe),formatter:vr(t,El)}:{}}function du(n){let t=Object.create(null);return t.years=h(n,ct),t.months=h(n,lt),t.weeks=h(n,Et),t.days=h(n,ut),t.hours=h(n,dt),t.minutes=h(n,ht),t.seconds=h(n,mt),t.milliseconds=h(n,ft),t.microseconds=h(n,pt),t.nanoseconds=h(n,Mt),t}sr.prototype.constructor=Ot,Object.defineProperty(Ot,"prototype",{value:sr.prototype,writable:!1,enumerable:!1,configurable:!1}),Ot.supportedLocalesOf=Ei.supportedLocalesOf,kn(Ot,"Intl.DateTimeFormat");var{format:Bh,formatToParts:$h}=Intl.DurationFormat?.prototype??Object.create(null);function Vs(n){Intl.DurationFormat.prototype.resolvedOptions.call(this);let t=du(Ut(n));return Bh.call(this,t)}Intl.DurationFormat?.prototype&&(Intl.DurationFormat.prototype.format=Vs,Intl.DurationFormat.prototype.formatToParts=function(n){Intl.DurationFormat.prototype.resolvedOptions.call(this);let t=du(Ut(n));return $h.call(this,t)});var zm=Object.freeze({__proto__:null,DateTimeFormat:Ot,ModifiedIntlDurationFormatPrototypeFormat:Vs}),Mi=class{constructor(t){if(arguments.length<1)throw new TypeError("missing argument: epochNanoseconds is required");zl(this,To(t))}get epochMilliseconds(){return C(this,Ue),qt(h(this,oe),"floor")}get epochNanoseconds(){return C(this,Ue),ou(k.default.BigInt(h(this,oe)))}add(t){return C(this,Ue),ol("add",this,t)}subtract(t){return C(this,Ue),ol("subtract",this,t)}until(t,e=void 0){return C(this,Ue),Xc("until",this,t,e)}since(t,e=void 0){return C(this,Ue),Xc("since",this,t,e)}round(t){if(C(this,Ue),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?or("smallestUnit",t):X(t),r=Lr(e),i=Jt(e,"halfExpand"),o=St(e,"smallestUnit","time",_n);return Or(r,{hour:24,minute:1440,second:86400,millisecond:864e5,microsecond:864e8,nanosecond:864e11}[o],!0),Zt(cs(h(this,oe),r,o,i))}equals(t){C(this,Ue);let e=ii(t),r=h(this,oe),i=h(e,oe);return k.default.equal(k.default.BigInt(r),k.default.BigInt(i))}toString(t=void 0){C(this,Ue);let e=X(t),r=Oi(e),i=Jt(e,"trunc"),o=St(e,"smallestUnit","time",void 0);if(o==="hour")throw new RangeError('smallestUnit must be a time unit other than "hour"');let a=e.timeZone;a!==void 0&&(a=vt(a));let{precision:s,unit:l,increment:u}=Yi(o,r);return zc(Zt(cs(h(this,oe),u,l,i)),a,s)}toJSON(){return C(this,Ue),zc(this,void 0,"auto")}toLocaleString(t=void 0,e=void 0){return C(this,Ue),new Ot(t,e).format(this)}valueOf(){$n("Instant")}toZonedDateTimeISO(t){C(this,Ue);let e=vt(t);return Je(h(this,oe),e,"iso8601")}static fromEpochMilliseconds(t){return Zt(Gt(Oo(t)))}static fromEpochNanoseconds(t){return Zt(To(t))}static from(t){return ii(t)}static compare(t,e){let r=ii(t),i=ii(e),o=h(r,oe),a=h(i,oe);return k.default.lessThan(o,a)?-1:k.default.greaterThan(o,a)?1:0}};kn(Mi,"Temporal.Instant");var ki=class{constructor(t,e,r,i="iso8601"){let o=ue(t),a=ue(e),s=ue(r),l=Dt(i===void 0?"iso8601":Be(i));nr(o,a,s),Fl(this,{year:o,month:a,day:s},l)}get calendarId(){return C(this,Ae),h(this,H)}get era(){return ot(this,"era")}get eraYear(){return ot(this,"eraYear")}get year(){return ot(this,"year")}get month(){return ot(this,"month")}get monthCode(){return ot(this,"monthCode")}get day(){return ot(this,"day")}get dayOfWeek(){return ot(this,"dayOfWeek")}get dayOfYear(){return ot(this,"dayOfYear")}get weekOfYear(){return ot(this,"weekOfYear")?.week}get yearOfWeek(){return ot(this,"weekOfYear")?.year}get daysInWeek(){return ot(this,"daysInWeek")}get daysInMonth(){return ot(this,"daysInMonth")}get daysInYear(){return ot(this,"daysInYear")}get monthsInYear(){return ot(this,"monthsInYear")}get inLeapYear(){return ot(this,"inLeapYear")}with(t,e=void 0){if(C(this,Ae),!Le(t))throw new TypeError("invalid argument");Nr(t);let r=h(this,H),i=wt(r,h(this,ae));return i=tr(r,i,Ht(r,t,["year","month","monthCode","day"],[],"partial")),yt(Hn(r,i,ye(X(e))),r)}withCalendar(t){C(this,Ae);let e=Bi(t);return yt(h(this,ae),e)}add(t,e=void 0){return C(this,Ae),al("add",this,t,e)}subtract(t,e=void 0){return C(this,Ae),al("subtract",this,t,e)}until(t,e=void 0){return C(this,Ae),Qc("until",this,t,e)}since(t,e=void 0){return C(this,Ae),Qc("since",this,t,e)}equals(t){C(this,Ae);let e=ni(t);return cn(h(this,ae),h(e,ae))===0&&an(h(this,H),h(e,H))}toString(t=void 0){return C(this,Ae),Uc(this,Li(X(t)))}toJSON(){return C(this,Ae),Uc(this)}toLocaleString(t=void 0,e=void 0){return C(this,Ae),new Ot(t,e).format(this)}valueOf(){$n("PlainDate")}toPlainDateTime(t=void 0){C(this,Ae);let e=Yl(t);return $t(we(h(this,ae),e),h(this,H))}toZonedDateTime(t){let e,r;if(C(this,Ae),Le(t)){let a=t.timeZone;a===void 0?e=vt(t):(e=vt(a),r=t.plainTime)}else e=vt(t);let i=h(this,ae),o;return r===void 0?o=Rn(e,i):(r=Nn(r),o=Qe(e,we(i,h(r,Ne)),"compatible")),Je(o,e,h(this,H))}toPlainYearMonth(){C(this,Ae);let t=h(this,H);return kr(yi(t,wt(t,h(this,ae)),"constrain"),t)}toPlainMonthDay(){C(this,Ae);let t=h(this,H);return Mr(_o(t,wt(t,h(this,ae)),"constrain"),t)}static from(t,e=void 0){return ni(t,e)}static compare(t,e){let r=ni(t),i=ni(e);return cn(h(r,ae),h(i,ae))}};function ot(n,t){C(n,Ae);let e=h(n,ae);return Fi(n).isoToDate(e,{[t]:!0})[t]}kn(ki,"Temporal.PlainDate");var Si=class{constructor(t,e,r,i=0,o=0,a=0,s=0,l=0,u=0,m="iso8601"){let f=ue(t),y=ue(e),E=ue(r),x=i===void 0?0:ue(i),I=o===void 0?0:ue(o),L=a===void 0?0:ue(a),z=s===void 0?0:ue(s),W=l===void 0?0:ue(l),K=u===void 0?0:ue(u),te=Dt(m===void 0?"iso8601":Be(m));Hs(f,y,E,x,I,L,z,W,K),Hl(this,{isoDate:{year:f,month:y,day:E},time:{hour:x,minute:I,second:L,millisecond:z,microsecond:W,nanosecond:K}},te)}get calendarId(){return C(this,Te),h(this,H)}get year(){return at(this,"year")}get month(){return at(this,"month")}get monthCode(){return at(this,"monthCode")}get day(){return at(this,"day")}get hour(){return wr(this,"hour")}get minute(){return wr(this,"minute")}get second(){return wr(this,"second")}get millisecond(){return wr(this,"millisecond")}get microsecond(){return wr(this,"microsecond")}get nanosecond(){return wr(this,"nanosecond")}get era(){return at(this,"era")}get eraYear(){return at(this,"eraYear")}get dayOfWeek(){return at(this,"dayOfWeek")}get dayOfYear(){return at(this,"dayOfYear")}get weekOfYear(){return at(this,"weekOfYear")?.week}get yearOfWeek(){return at(this,"weekOfYear")?.year}get daysInWeek(){return at(this,"daysInWeek")}get daysInYear(){return at(this,"daysInYear")}get daysInMonth(){return at(this,"daysInMonth")}get monthsInYear(){return at(this,"monthsInYear")}get inLeapYear(){return at(this,"inLeapYear")}with(t,e=void 0){if(C(this,Te),!Le(t))throw new TypeError("invalid argument");Nr(t);let r=h(this,H),i=h(this,xe),o={...wt(r,i.isoDate),...i.time};return o=tr(r,o,Ht(r,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond"],"partial")),$t(Hi(r,o,ye(X(e))),r)}withPlainTime(t=void 0){C(this,Te);let e=Yl(t);return $t(we(h(this,xe).isoDate,e),h(this,H))}withCalendar(t){C(this,Te);let e=Bi(t);return $t(h(this,xe),e)}add(t,e=void 0){return C(this,Te),sl("add",this,t,e)}subtract(t,e=void 0){return C(this,Te),sl("subtract",this,t,e)}until(t,e=void 0){return C(this,Te),el("until",this,t,e)}since(t,e=void 0){return C(this,Te),el("since",this,t,e)}round(t){if(C(this,Te),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?or("smallestUnit",t):X(t),r=Lr(e),i=Jt(e,"halfExpand"),o=St(e,"smallestUnit","time",_n,["day"]),a={day:1,hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o];Or(r,a,a===1);let s=h(this,xe);return $t(r===1&&o==="nanosecond"?s:ls(s,r,o,i),h(this,H))}equals(t){C(this,Te);let e=ri(t);return Rr(h(this,xe),h(e,xe))===0&&an(h(this,H),h(e,H))}toString(t=void 0){C(this,Te);let e=X(t),r=Li(e),i=Oi(e),o=Jt(e,"trunc"),a=St(e,"smallestUnit","time",void 0);if(a==="hour")throw new RangeError('smallestUnit must be a time unit other than "hour"');let{precision:s,unit:l,increment:u}=Yi(a,i),m=ls(h(this,xe),u,l,o);return rr(m),wi(m,h(this,H),s,r)}toJSON(){return C(this,Te),wi(h(this,xe),h(this,H),"auto")}toLocaleString(t=void 0,e=void 0){return C(this,Te),new Ot(t,e).format(this)}valueOf(){$n("PlainDateTime")}toZonedDateTime(t,e=void 0){C(this,Te);let r=vt(t),i=hi(X(e));return Je(Qe(r,h(this,xe),i),r,h(this,H))}toPlainDate(){return C(this,Te),yt(h(this,xe).isoDate,h(this,H))}toPlainTime(){return C(this,Te),gn(h(this,xe).time)}static from(t,e=void 0){return ri(t,e)}static compare(t,e){let r=ri(t),i=ri(e);return Rr(h(r,xe),h(i,xe))}};function at(n,t){C(n,Te);let e=h(n,xe).isoDate;return Fi(n).isoToDate(e,{[t]:!0})[t]}function wr(n,t){return C(n,Te),h(n,xe).time[t]}kn(Si,"Temporal.PlainDateTime");var Ti=class n{constructor(t=0,e=0,r=0,i=0,o=0,a=0,s=0,l=0,u=0,m=0){let f=t===void 0?0:Kt(t),y=e===void 0?0:Kt(e),E=r===void 0?0:Kt(r),x=i===void 0?0:Kt(i),I=o===void 0?0:Kt(o),L=a===void 0?0:Kt(a),z=s===void 0?0:Kt(s),W=l===void 0?0:Kt(l),K=u===void 0?0:Kt(u),te=m===void 0?0:Kt(m);zo(f,y,E,x,I,L,z,W,K,te),Mn(this),me(this,ct,f),me(this,lt,y),me(this,Et,E),me(this,ut,x),me(this,dt,I),me(this,ht,L),me(this,mt,z),me(this,ft,W),me(this,pt,K),me(this,Mt,te)}get years(){return C(this,Re),h(this,ct)}get months(){return C(this,Re),h(this,lt)}get weeks(){return C(this,Re),h(this,Et)}get days(){return C(this,Re),h(this,ut)}get hours(){return C(this,Re),h(this,dt)}get minutes(){return C(this,Re),h(this,ht)}get seconds(){return C(this,Re),h(this,mt)}get milliseconds(){return C(this,Re),h(this,ft)}get microseconds(){return C(this,Re),h(this,pt)}get nanoseconds(){return C(this,Re),h(this,Mt)}get sign(){return C(this,Re),ko(this)}get blank(){return C(this,Re),ko(this)===0}with(t){C(this,Re);let e=Ol(t),{years:r=h(this,ct),months:i=h(this,lt),weeks:o=h(this,Et),days:a=h(this,ut),hours:s=h(this,dt),minutes:l=h(this,ht),seconds:u=h(this,mt),milliseconds:m=h(this,ft),microseconds:f=h(this,pt),nanoseconds:y=h(this,Mt)}=e;return new n(r,i,o,a,s,l,u,m,f,y)}negated(){return C(this,Re),Ct(this)}abs(){return C(this,Re),new n(Math.abs(h(this,ct)),Math.abs(h(this,lt)),Math.abs(h(this,Et)),Math.abs(h(this,ut)),Math.abs(h(this,dt)),Math.abs(h(this,ht)),Math.abs(h(this,mt)),Math.abs(h(this,ft)),Math.abs(h(this,pt)),Math.abs(h(this,Mt)))}add(t){return C(this,Re),il("add",this,t)}subtract(t){return C(this,Re),il("subtract",this,t)}round(t){if(C(this,Re),t===void 0)throw new TypeError("options parameter is required");let e=fn(this),r=typeof t=="string"?or("smallestUnit",t):X(t),i=St(r,"largestUnit","datetime",void 0,["auto"]),{plainRelativeTo:o,zonedRelativeTo:a}=Ua(r),s=Lr(r),l=Jt(r,"halfExpand"),u=St(r,"smallestUnit","datetime",void 0),m=!0;u||(m=!1,u="nanosecond");let f=vn(e,u),y=!0;if(i||(y=!1,i=f),i==="auto"&&(i=f),!m&&!y)throw new RangeError("at least one of smallestUnit or largestUnit is required");if(vn(i,u)!==i)throw new RangeError(`largestUnit ${i} cannot be smaller than smallestUnit ${u}`);let E={hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[u];if(E!==void 0&&Or(s,E,!1),s>1&&pn(u)==="date"&&i!==u)throw new RangeError("For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit");if(a){let I=_r(this),L=h(a,De),z=h(a,H),W=h(a,oe);return I=iu(W,si(W,L,z,I),L,z,i,s,u,l),pn(i)==="date"&&(i="hour"),zt(I,i)}if(o){let I=rn(this),L=Pr({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},I.time),z=h(o,ae),W=h(o,H),K=Yt(W,z,Xe(I.date,L.deltaDays),"constrain");return I=ru(we(z,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),we(K,L),W,i,s,u,l),zt(I,i)}if(tn(e))throw new RangeError(`a starting point is required for ${e}s balancing`);if(tn(i))throw new RangeError(`a starting point is required for ${i}s balancing`);let x=rn(this);if(u==="day"){let{quotient:I,remainder:L}=x.time.divmod(wo),z=x.date.days+I+mi(L,"day");z=Ln(z,s,l),x=wn({years:0,months:0,weeks:0,days:z},Ee.ZERO)}else x=wn({years:0,months:0,weeks:0,days:0},So(x.time,s,u,l));return zt(x,i)}total(t){if(C(this,Re),t===void 0)throw new TypeError("options argument is required");let e=typeof t=="string"?or("unit",t):X(t),{plainRelativeTo:r,zonedRelativeTo:i}=Ua(e),o=St(e,"unit","datetime",_n);if(i){let s=_r(this),l=h(i,De),u=h(i,H),m=h(i,oe);return function(f,y,E,x,I){return pn(I)==="time"?mi(Ee.fromEpochNsDiff(y,f),I):Jc(tu(f,y,E,x,I),y,Vt(E,f),E,x,I)}(m,si(m,l,u,s),l,u,o)}if(r){let s=rn(this),l=Pr({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},s.time),u=h(r,ae),m=h(r,H),f=Yt(m,u,Xe(s.date,l.deltaDays),"constrain");return function(y,E,x,I){if(Rr(y,E)==0)return 0;rr(y),rr(E);let L=eu(y,E,x,I);return I==="nanosecond"?k.default.toNumber(L.time.totalNs):Jc(L,qe(E),y,null,x,I)}(we(u,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),we(f,l),m,o)}let a=fn(this);if(tn(a))throw new RangeError(`a starting point is required for ${a}s total`);if(tn(o))throw new RangeError(`a starting point is required for ${o}s total`);return mi(rn(this).time,o)}toString(t=void 0){C(this,Re);let e=X(t),r=Oi(e),i=Jt(e,"trunc"),o=St(e,"smallestUnit","time",void 0);if(o==="hour"||o==="minute")throw new RangeError('smallestUnit must be a time unit other than "hours" or "minutes"');let{precision:a,unit:s,increment:l}=Yi(o,r);if(s==="nanosecond"&&l===1)return po(this,a);let u=fn(this),m=_r(this),f=So(m.time,l,s,i);return m=wn(m.date,f),po(zt(m,vn(u,"second")),a)}toJSON(){return C(this,Re),po(this,"auto")}toLocaleString(t=void 0,e=void 0){if(C(this,Re),typeof Intl.DurationFormat=="function"){let r=new Intl.DurationFormat(t,e);return Vs.call(r,this)}return console.warn("Temporal.Duration.prototype.toLocaleString() requires Intl.DurationFormat."),po(this,"auto")}valueOf(){$n("Duration")}static from(t){return Ut(t)}static compare(t,e,r=void 0){let i=Ut(t),o=Ut(e),a=X(r),{plainRelativeTo:s,zonedRelativeTo:l}=Ua(a);if(h(i,ct)===h(o,ct)&&h(i,lt)===h(o,lt)&&h(i,Et)===h(o,Et)&&h(i,ut)===h(o,ut)&&h(i,dt)===h(o,dt)&&h(i,ht)===h(o,ht)&&h(i,mt)===h(o,mt)&&h(i,ft)===h(o,ft)&&h(i,pt)===h(o,pt)&&h(i,Mt)===h(o,Mt))return 0;let u=fn(i),m=fn(o),f=_r(i),y=_r(o);if(l&&(pn(u)==="date"||pn(m)==="date")){let z=h(l,De),W=h(l,H),K=h(l,oe),te=si(K,z,W,f),re=si(K,z,W,y);return kt(k.default.toNumber(k.default.subtract(te,re)))}let E=f.date.days,x=y.date.days;if(tn(u)||tn(m)){if(!s)throw new RangeError("A starting point is required for years, months, or weeks comparison");E=Gc(f.date,s),x=Gc(y.date,s)}let I=f.time.add24HourDays(E),L=y.time.add24HourDays(x);return I.cmp(L)}};kn(Ti,"Temporal.Duration");var Ci=class{constructor(t,e,r="iso8601",i=1972){let o=ue(t),a=ue(e),s=Dt(r===void 0?"iso8601":Be(r)),l=ue(i);nr(l,o,a),jl(this,{year:l,month:o,day:a},s)}get monthCode(){return hl(this,"monthCode")}get day(){return hl(this,"day")}get calendarId(){return C(this,Nt),h(this,H)}with(t,e=void 0){if(C(this,Nt),!Le(t))throw new TypeError("invalid argument");Nr(t);let r=h(this,H),i=wt(r,h(this,ae),"month-day");return i=tr(r,i,Ht(r,t,["year","month","monthCode","day"],[],"partial")),Mr(_o(r,i,ye(X(e))),r)}equals(t){C(this,Nt);let e=Bc(t);return cn(h(this,ae),h(e,ae))===0&&an(h(this,H),h(e,H))}toString(t=void 0){return C(this,Nt),qc(this,Li(X(t)))}toJSON(){return C(this,Nt),qc(this)}toLocaleString(t=void 0,e=void 0){return C(this,Nt),new Ot(t,e).format(this)}valueOf(){$n("PlainMonthDay")}toPlainDate(t){if(C(this,Nt),!Le(t))throw new TypeError("argument should be an object");let e=h(this,H);return yt(Hn(e,tr(e,wt(e,h(this,ae),"month-day"),Ht(e,t,["year"],[],[])),"constrain"),e)}static from(t,e=void 0){return Bc(t,e)}};function hl(n,t){C(n,Nt);let e=h(n,ae);return Fi(n).isoToDate(e,{[t]:!0})[t]}function qa(n){return Vt(n,hs())}kn(Ci,"Temporal.PlainMonthDay");var hu={instant:()=>Zt(hs()),plainDateTimeISO:(n=Xr())=>$t(qa(vt(n)),"iso8601"),plainDateISO:(n=Xr())=>yt(qa(vt(n)).isoDate,"iso8601"),plainTimeISO:(n=Xr())=>gn(qa(vt(n)).time),timeZoneId:()=>Xr(),zonedDateTimeISO:(n=Xr())=>{let t=vt(n);return Je(hs(),t,"iso8601")},[Symbol.toStringTag]:"Temporal.Now"};Object.defineProperty(hu,Symbol.toStringTag,{value:"Temporal.Now",writable:!1,enumerable:!1,configurable:!0});var Ii=class n{constructor(t=0,e=0,r=0,i=0,o=0,a=0){let s=t===void 0?0:ue(t),l=e===void 0?0:ue(e),u=r===void 0?0:ue(r),m=i===void 0?0:ue(i),f=o===void 0?0:ue(o),y=a===void 0?0:ue(a);$o(s,l,u,m,f,y),Bl(this,{hour:s,minute:l,second:u,millisecond:m,microsecond:f,nanosecond:y})}get hour(){return C(this,Oe),h(this,Ne).hour}get minute(){return C(this,Oe),h(this,Ne).minute}get second(){return C(this,Oe),h(this,Ne).second}get millisecond(){return C(this,Oe),h(this,Ne).millisecond}get microsecond(){return C(this,Oe),h(this,Ne).microsecond}get nanosecond(){return C(this,Oe),h(this,Ne).nanosecond}with(t,e=void 0){if(C(this,Oe),!Le(t))throw new TypeError("invalid argument");Nr(t);let r=ns(t,"partial"),i=ns(this),{hour:o,minute:a,second:s,millisecond:l,microsecond:u,nanosecond:m}=Object.assign(i,r),f=ye(X(e));return{hour:o,minute:a,second:s,millisecond:l,microsecond:u,nanosecond:m}=Ho(o,a,s,l,u,m,f),new n(o,a,s,l,u,m)}add(t){return C(this,Oe),cl("add",this,t)}subtract(t){return C(this,Oe),cl("subtract",this,t)}until(t,e=void 0){return C(this,Oe),tl("until",this,t,e)}since(t,e=void 0){return C(this,Oe),tl("since",this,t,e)}round(t){if(C(this,Oe),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?or("smallestUnit",t):X(t),r=Lr(e),i=Jt(e,"halfExpand"),o=St(e,"smallestUnit","time",_n);return Or(r,{hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o],!1),gn(us(h(this,Ne),r,o,i))}equals(t){C(this,Oe);let e=Nn(t);return ds(h(this,Ne),h(e,Ne))===0}toString(t=void 0){C(this,Oe);let e=X(t),r=Oi(e),i=Jt(e,"trunc"),o=St(e,"smallestUnit","time",void 0);if(o==="hour")throw new RangeError('smallestUnit must be a time unit other than "hour"');let{precision:a,unit:s,increment:l}=Yi(o,r);return Vc(us(h(this,Ne),l,s,i),a)}toJSON(){return C(this,Oe),Vc(h(this,Ne),"auto")}toLocaleString(t=void 0,e=void 0){return C(this,Oe),new Ot(t,e).format(this)}valueOf(){$n("PlainTime")}static from(t,e=void 0){return Nn(t,e)}static compare(t,e){let r=Nn(t),i=Nn(e);return ds(h(r,Ne),h(i,Ne))}};kn(Ii,"Temporal.PlainTime");var xi=class{constructor(t,e,r="iso8601",i=1){let o=ue(t),a=ue(e),s=Dt(r===void 0?"iso8601":Be(r)),l=ue(i);nr(o,a,l),$l(this,{year:o,month:a,day:l},s)}get year(){return hn(this,"year")}get month(){return hn(this,"month")}get monthCode(){return hn(this,"monthCode")}get calendarId(){return C(this,Ve),h(this,H)}get era(){return hn(this,"era")}get eraYear(){return hn(this,"eraYear")}get daysInMonth(){return hn(this,"daysInMonth")}get daysInYear(){return hn(this,"daysInYear")}get monthsInYear(){return hn(this,"monthsInYear")}get inLeapYear(){return hn(this,"inLeapYear")}with(t,e=void 0){if(C(this,Ve),!Le(t))throw new TypeError("invalid argument");Nr(t);let r=h(this,H),i=wt(r,h(this,ae),"year-month");return i=tr(r,i,Ht(r,t,["year","month","monthCode"],[],"partial")),kr(yi(r,i,ye(X(e))),r)}add(t,e=void 0){return C(this,Ve),ll("add",this,t,e)}subtract(t,e=void 0){return C(this,Ve),ll("subtract",this,t,e)}until(t,e=void 0){return C(this,Ve),nl("until",this,t,e)}since(t,e=void 0){return C(this,Ve),nl("since",this,t,e)}equals(t){C(this,Ve);let e=oi(t);return cn(h(this,ae),h(e,ae))===0&&an(h(this,H),h(e,H))}toString(t=void 0){return C(this,Ve),Wc(this,Li(X(t)))}toJSON(){return C(this,Ve),Wc(this)}toLocaleString(t=void 0,e=void 0){return C(this,Ve),new Ot(t,e).format(this)}valueOf(){$n("PlainYearMonth")}toPlainDate(t){if(C(this,Ve),!Le(t))throw new TypeError("argument should be an object");let e=h(this,H);return yt(Hn(e,tr(e,wt(e,h(this,ae),"year-month"),Ht(e,t,["day"],[],[])),"constrain"),e)}static from(t,e=void 0){return oi(t,e)}static compare(t,e){let r=oi(t),i=oi(e);return cn(h(r,ae),h(i,ae))}};function hn(n,t){C(n,Ve);let e=h(n,ae);return Fi(n).isoToDate(e,{[t]:!0})[t]}kn(xi,"Temporal.PlainYearMonth");var zh=Ot.prototype.resolvedOptions,Pi=class{constructor(t,e,r="iso8601"){if(arguments.length<1)throw new TypeError("missing argument: epochNanoseconds is required");let i=To(t),o=Be(e),{tzName:a,offsetMinutes:s}=On(o);if(s===void 0){let l=Eo(a);if(!l)throw new RangeError(`unknown time zone ${a}`);o=l.identifier}else o=Os(s);Ul(this,i,o,Dt(r===void 0?"iso8601":Be(r)))}get calendarId(){return C(this,fe),h(this,H)}get timeZoneId(){return C(this,fe),h(this,De)}get year(){return st(this,"year")}get month(){return st(this,"month")}get monthCode(){return st(this,"monthCode")}get day(){return st(this,"day")}get hour(){return br(this,"hour")}get minute(){return br(this,"minute")}get second(){return br(this,"second")}get millisecond(){return br(this,"millisecond")}get microsecond(){return br(this,"microsecond")}get nanosecond(){return br(this,"nanosecond")}get era(){return st(this,"era")}get eraYear(){return st(this,"eraYear")}get epochMilliseconds(){return C(this,fe),qt(h(this,oe),"floor")}get epochNanoseconds(){return C(this,fe),ou(h(this,oe))}get dayOfWeek(){return st(this,"dayOfWeek")}get dayOfYear(){return st(this,"dayOfYear")}get weekOfYear(){return st(this,"weekOfYear")?.week}get yearOfWeek(){return st(this,"weekOfYear")?.year}get hoursInDay(){C(this,fe);let t=h(this,De),e=en(this).isoDate,r=Tt(e.year,e.month,e.day+1),i=Rn(t,e),o=Rn(t,r);return mi(Ee.fromEpochNsDiff(o,i),"hour")}get daysInWeek(){return st(this,"daysInWeek")}get daysInMonth(){return st(this,"daysInMonth")}get daysInYear(){return st(this,"daysInYear")}get monthsInYear(){return st(this,"monthsInYear")}get inLeapYear(){return st(this,"inLeapYear")}get offset(){return C(this,fe),rs(yn(h(this,De),h(this,oe)))}get offsetNanoseconds(){return C(this,fe),yn(h(this,De),h(this,oe))}with(t,e=void 0){if(C(this,fe),!Le(t))throw new TypeError("invalid zoned-date-time-like");Nr(t);let r=h(this,H),i=h(this,De),o=yn(i,h(this,oe)),a=en(this),s={...wt(r,a.isoDate),...a.time,offset:rs(o)};s=tr(r,s,Ht(r,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset"],"partial"));let l=X(e),u=hi(l),m=go(l,"prefer"),f=Hi(r,s,ye(l)),y=Yr(s.offset);return Je(Do(f.isoDate,f.time,"option",y,i,u,m,!1),i,r)}withPlainTime(t=void 0){C(this,fe);let e=h(this,De),r=h(this,H),i=en(this).isoDate,o;return o=t===void 0?Rn(e,i):Qe(e,we(i,h(Nn(t),Ne)),"compatible"),Je(o,e,r)}withTimeZone(t){C(this,fe);let e=vt(t);return Je(h(this,oe),e,h(this,H))}withCalendar(t){C(this,fe);let e=Bi(t);return Je(h(this,oe),h(this,De),e)}add(t,e=void 0){return C(this,fe),ul("add",this,t,e)}subtract(t,e=void 0){return C(this,fe),ul("subtract",this,t,e)}until(t,e=void 0){return C(this,fe),rl("until",this,t,e)}since(t,e=void 0){return C(this,fe),rl("since",this,t,e)}round(t){if(C(this,fe),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?or("smallestUnit",t):X(t),r=Lr(e),i=Jt(e,"halfExpand"),o=St(e,"smallestUnit","time",_n,["day"]),a={day:1,hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o];if(Or(r,a,a===1),o==="nanosecond"&&r===1)return Je(h(this,oe),h(this,De),h(this,H));let s=h(this,De),l=h(this,oe),u=en(this),m;if(o==="day"){let f=u.isoDate,y=Tt(f.year,f.month,f.day+1),E=Rn(s,f),x=Rn(s,y),I=k.default.subtract(x,E);m=Ee.fromEpochNsDiff(l,E).round(I,i).addToEpochNs(E)}else{let f=ls(u,r,o,i),y=yn(s,l);m=Do(f.isoDate,f.time,"option",y,s,"compatible","prefer",!1)}return Je(m,s,h(this,H))}equals(t){C(this,fe);let e=ai(t),r=h(this,oe),i=h(e,oe);return!!k.default.equal(k.default.BigInt(r),k.default.BigInt(i))&&!!Vl(h(this,De),h(e,De))&&an(h(this,H),h(e,H))}toString(t=void 0){C(this,fe);let e=X(t),r=Li(e),i=Oi(e),o=function(y){return bn(y,"offset",["auto","never"],"auto")}(e),a=Jt(e,"trunc"),s=St(e,"smallestUnit","time",void 0);if(s==="hour")throw new RangeError('smallestUnit must be a time unit other than "hour"');let l=function(y){return bn(y,"timeZoneName",["auto","never","critical"],"auto")}(e),{precision:u,unit:m,increment:f}=Yi(s,i);return Kc(this,u,r,l,o,{unit:m,increment:f,roundingMode:a})}toLocaleString(t=void 0,e=void 0){C(this,fe);let r=X(e),i=Object.create(null);if(function(l,u,m,f){if(u==null)return;let y=Reflect.ownKeys(u);for(let E=0;E<y.length;E++){let x=y[E];if(!m.some(I=>Object.is(I,x))&&Object.prototype.propertyIsEnumerable.call(u,x)){let I=u[x];l[x]=I}}}(i,r,["timeZone"]),r.timeZone!==void 0)throw new TypeError("ZonedDateTime toLocaleString does not accept a timeZone option");if(i.year===void 0&&i.month===void 0&&i.day===void 0&&i.era===void 0&&i.weekday===void 0&&i.dateStyle===void 0&&i.hour===void 0&&i.minute===void 0&&i.second===void 0&&i.fractionalSecondDigits===void 0&&i.timeStyle===void 0&&i.dayPeriod===void 0&&i.timeZoneName===void 0&&(i.timeZoneName="short"),i.timeZone=h(this,De),Zc(i.timeZone))throw new RangeError("toLocaleString does not currently support offset time zones");let o=new Ot(t,i),a=zh.call(o).calendar,s=h(this,H);if(s!=="iso8601"&&a!=="iso8601"&&!an(a,s))throw new RangeError(`cannot format ZonedDateTime with calendar ${s} in locale with calendar ${a}`);return o.format(Zt(h(this,oe)))}toJSON(){return C(this,fe),Kc(this,"auto")}valueOf(){$n("ZonedDateTime")}startOfDay(){C(this,fe);let t=h(this,De);return Je(Rn(t,en(this).isoDate),t,h(this,H))}getTimeZoneTransition(t){C(this,fe);let e=h(this,De);if(t===void 0)throw new TypeError("options parameter is required");let r=bn(typeof t=="string"?or("direction",t):X(t),"direction",["next","previous"],_n);if(r===void 0)throw new TypeError("direction option is required");if(Zc(e)||e==="UTC")return null;let i=h(this,oe),o=r==="next"?Fs(e,i):os(e,i);return o===null?null:Je(o,e,h(this,H))}toInstant(){return C(this,fe),Zt(h(this,oe))}toPlainDate(){return C(this,fe),yt(en(this).isoDate,h(this,H))}toPlainTime(){return C(this,fe),gn(en(this).time)}toPlainDateTime(){return C(this,fe),$t(en(this),h(this,H))}static from(t,e=void 0){return ai(t,e)}static compare(t,e){let r=ai(t),i=ai(e),o=h(r,oe),a=h(i,oe);return k.default.lessThan(k.default.BigInt(o),k.default.BigInt(a))?-1:k.default.greaterThan(k.default.BigInt(o),k.default.BigInt(a))?1:0}};function en(n){return Vt(h(n,De),h(n,oe))}function st(n,t){C(n,fe);let e=en(n).isoDate;return Fi(n).isoToDate(e,{[t]:!0})[t]}function br(n,t){return C(n,fe),en(n).time[t]}kn(Pi,"Temporal.ZonedDateTime");var Ye=Object.freeze({__proto__:null,Duration:Ti,Instant:Mi,Now:hu,PlainDate:ki,PlainDateTime:Si,PlainMonthDay:Ci,PlainTime:Ii,PlainYearMonth:xi,ZonedDateTime:Pi}),Um=class{toTemporalInstant(){return Zt(Gt(Date.prototype.valueOf.call(this)))}}.prototype.toTemporalInstant,Uh=[Mi,ki,Si,Ti,Ci,Ii,xi,Pi];for(let n of Uh){let t=Object.getOwnPropertyDescriptor(n,"prototype");(t.configurable||t.enumerable||t.writable)&&(t.configurable=!1,t.enumerable=!1,t.writable=!1,Object.defineProperty(n,"prototype",t))}var Vh="https://yuna-backend.cbocher.workers.dev/mews",qh="https://api.mews.com/api/distributor/v1",Wh="Yuna",Kh="mewscache",Zh=!1,Gh=13,Jh=8,Xh=Ye.Duration.from({minutes:20}).milliseconds,Qh=new Headers({Accept:"application/json, text/plain, */*","Content-Type":"application/json; charset=utf-8"}),Fe={base_url:Vh,bookingEngine_url:qh,bookingEngineClient:Wh,bypassCache:Zh,headers:Qh,cache_key:Kh,ttl:Xh,beCheckInUTC:Gh,beCheckOutUTC:Jh};var mu=(n,t,e)=>`${n}:${t}:${JSON.stringify(e)}`;var Wo=class{constructor(){j(this,"dbName","MewsAPICache");j(this,"version",2);j(this,"db",null);j(this,"initPromise",null);j(this,"performanceMetrics",[]);this.initPromise=this.init()}async init(){return new Promise((t,e)=>{try{let r=indexedDB.open(this.dbName,this.version);r.onerror=()=>{console.error("Failed to initialize IndexedDB:",r.error),e(r.error)},r.onsuccess=()=>{this.db=r.result,t()},r.onupgradeneeded=i=>{let o=i.target.result,{oldVersion:a}=i;if(a>0)try{o.objectStoreNames.contains("api_cache")&&o.deleteObjectStore("api_cache"),o.objectStoreNames.contains("performance_metrics")&&o.deleteObjectStore("performance_metrics")}catch(u){console.warn("Error cleaning up old stores:",u)}let s=o.createObjectStore("api_cache",{keyPath:"cacheKey"});s.createIndex("by-timestamp","timestamp"),s.createIndex("by-enterprise","enterpriseId"),s.createIndex("by-size","size"),o.createObjectStore("performance_metrics",{keyPath:"timestamp"}).createIndex("by-operation","operation")},r.onblocked=()=>{console.warn("IndexedDB upgrade blocked by another tab")}}catch(r){console.error("Failed to initialize IndexedDB:",r),e(r)}})}async ensureDB(){if(!this.db&&(await this.initPromise,!this.db))throw new Error("Failed to initialize IndexedDB");return this.db}calculateDataSize(t){try{return new Blob([JSON.stringify(t)]).size}catch{return 0}}recordPerformanceMetric(t,e,r,i){let o=performance.now()-e,a={operation:t,duration:o,timestamp:Date.now(),cacheHit:r,dataSize:i};this.performanceMetrics.push(a),this.performanceMetrics.length>1e3&&(this.performanceMetrics=this.performanceMetrics.slice(-1e3)),this.storeMetricAsync(a).catch(console.error)}async storeMetricAsync(t){try{let e=await this.ensureDB();return new Promise(r=>{let a=e.transaction("performance_metrics","readwrite").objectStore("performance_metrics").add(t);a.onerror=()=>r(),a.onsuccess=()=>r()})}catch{}}async get(t,e){let r=performance.now();try{let i=await this.ensureDB();return new Promise(o=>{let l=i.transaction("api_cache","readonly").objectStore("api_cache").get(t);l.onerror=()=>{this.recordPerformanceMetric("cache-miss",r,!1),o(null)},l.onsuccess=()=>{let u=l.result;if(!u){this.recordPerformanceMetric("cache-miss",r,!1),o(null);return}let m=e!==void 0?e:Fe.ttl,f=Ye.Instant.fromEpochMilliseconds(u.timestamp);if(Ye.Now.instant().since(f,{smallestUnit:"milliseconds"}).milliseconds>m){this.delete(t).catch(console.error),this.recordPerformanceMetric("cache-expired",r,!1),o(null);return}this.recordPerformanceMetric("cache-hit",r,!0,u.size),o(u.data)}})}catch(i){return console.error("Error getting cached data:",i),this.recordPerformanceMetric("cache-error",r,!1),null}}async set(t,e,r){let i=performance.now();try{let o=await this.ensureDB(),a=this.calculateDataSize(e),s={cacheKey:t,data:e,timestamp:Ye.Now.instant().epochMilliseconds,enterpriseId:r,size:a};return new Promise((l,u)=>{let y=o.transaction("api_cache","readwrite").objectStore("api_cache").put(s);y.onerror=()=>{this.recordPerformanceMetric("cache-write-error",i,!1),u(y.error)},y.onsuccess=()=>{this.recordPerformanceMetric("cache-write",i,!1,a),l()}})}catch(o){if(console.error("Error setting cached data:",o),this.recordPerformanceMetric("cache-write-error",i,!1),o instanceof Error&&o.name==="QuotaExceededError"){await this.cleanupOldEntries();try{let a=await this.ensureDB(),s={cacheKey:t,data:e,timestamp:Ye.Now.instant().epochMilliseconds,enterpriseId:r,size:this.calculateDataSize(e)};return new Promise((l,u)=>{let y=a.transaction("api_cache","readwrite").objectStore("api_cache").put(s);y.onerror=()=>u(y.error),y.onsuccess=()=>l()})}catch(a){console.error("Error setting cached data after cleanup:",a)}}}}async delete(t){try{let i=(await this.ensureDB()).transaction("api_cache","readwrite").objectStore("api_cache");await new Promise((o,a)=>{let s=i.delete(t);s.onsuccess=()=>o(),s.onerror=()=>a(s.error)})}catch(e){console.error("Error deleting cached data:",e)}}async clearExpired(){let t=performance.now(),e=0;try{let r=await this.ensureDB(),i=Ye.Now.instant().epochMilliseconds-Fe.ttl,o=r.transaction("api_cache","readwrite"),a=o.objectStore("api_cache"),s=a.index("by-timestamp"),l=await new Promise((m,f)=>{let y=s.getAll(IDBKeyRange.upperBound(i));y.onsuccess=()=>m(y.result),y.onerror=()=>f(y.error)}),u=50;for(let m=0;m<l.length;m+=u){let f=l.slice(m,m+u);await Promise.all(f.map(y=>new Promise((E,x)=>{let I=a.delete(y.cacheKey);I.onsuccess=()=>E(),I.onerror=()=>x(I.error)}))),e+=f.length,m+u<l.length&&await new Promise(y=>setTimeout(y,0))}await new Promise((m,f)=>{o.oncomplete=()=>m(),o.onerror=()=>f(o.error)}),this.recordPerformanceMetric("cache-cleanup",t,!1)}catch(r){console.error("Error clearing expired cache:",r)}return e}async cleanupOldEntries(t=1e3){try{let r=(await this.ensureDB()).transaction("api_cache","readwrite"),i=r.objectStore("api_cache"),o=i.index("by-timestamp"),a=await new Promise((s,l)=>{let u=o.getAll();u.onsuccess=()=>s(u.result),u.onerror=()=>l(u.error)});if(a.length>t){let s=a.slice(0,a.length-t);await Promise.all(s.map(l=>new Promise((u,m)=>{let f=i.delete(l.cacheKey);f.onsuccess=()=>u(),f.onerror=()=>m(f.error)})))}await new Promise((s,l)=>{r.oncomplete=()=>s(),r.onerror=()=>l(r.error)})}catch(e){console.error("Error cleaning up old entries:",e)}}async clearAll(){try{let r=(await this.ensureDB()).transaction("api_cache","readwrite").objectStore("api_cache");await new Promise((i,o)=>{let a=r.clear();a.onsuccess=()=>i(),a.onerror=()=>o(a.error)})}catch(t){console.error("Error clearing all cache:",t)}}async getCacheStats(){try{let r=(await this.ensureDB()).transaction("api_cache","readonly").objectStore("api_cache"),i=await new Promise((a,s)=>{let l=r.getAll();l.onsuccess=()=>a(l.result),l.onerror=()=>s(l.error)}),o={totalEntries:i.length,totalSize:i.reduce((a,s)=>a+(s.size||0),0),oldestEntry:i.length>0?Math.min(...i.map(a=>a.timestamp)):null,newestEntry:i.length>0?Math.max(...i.map(a=>a.timestamp)):null,entriesByEnterprise:{}};return i.forEach(a=>{let s=a.enterpriseId||"unknown";o.entriesByEnterprise[s]=(o.entriesByEnterprise[s]||0)+1}),o}catch(t){return console.error("Error getting cache stats:",t),{totalEntries:0,totalSize:0,oldestEntry:null,newestEntry:null,entriesByEnterprise:{}}}}getPerformanceMetrics(){return[...this.performanceMetrics]}getAveragePerformance(){let t=this.performanceMetrics,e=t.filter(o=>o.operation==="cache-hit"),r=t.filter(o=>o.operation==="cache-miss"),i=t.filter(o=>o.operation==="cache-write");return{averageCacheHitTime:e.length>0?e.reduce((o,a)=>o+a.duration,0)/e.length:0,averageCacheMissTime:r.length>0?r.reduce((o,a)=>o+a.duration,0)/r.length:0,averageWriteTime:i.length>0?i.reduce((o,a)=>o+a.duration,0)/i.length:0,cacheHitRate:e.length+r.length>0?e.length/(e.length+r.length):0,totalOperations:t.length}}async performMaintenance(){try{setTimeout(async()=>{await this.clearExpired(),(await this.getCacheStats()).totalEntries>2e3&&await this.cleanupOldEntries(1500)},0)}catch(t){console.error("Error during cache maintenance:",t)}}};var et=async(n,t,e=null,r=!1)=>{let i=new Wo,o=mu(n,e||"null",t.body);if(!Fe.bypassCache){let a=await i.get(o);if(a)return a}try{let a=new URL(Fe.base_url);r&&(a.pathname=a.pathname.replace("/mews","/_adapter")),a.pathname+=n,a.searchParams.set("enterprise",e||"null");let s=await fetch(a.toString(),t),l=await s.json();if(s.ok)return i.set(o,l,e||"null").catch(u=>{console.error("Error setting cache:",u)}),l;throw new Error("FETCH_ERROR",{cause:l})}catch(a){throw a instanceof Error?console.error(`${a.name} [${n}]`,a.cause):console.error(a),a}};var fu=(n,t={})=>{let e={method:"POST",headers:Fe.headers,body:JSON.stringify(t)};return et("/services/getAll",e,n)};var Hr=()=>{let{lang:n}=document.documentElement,t={iso639:"fr",bcp47:"fr-FR"};return n.includes("en")&&(t={iso639:"en",bcp47:"en-US"}),t},zn=Hr().bcp47,cf=Hr().iso639;var pu={"en-US":{loading:"Loading...",night:"Night",chooseOption:"Choose an option",apartment:"Apartment",total:"In total",missingEnterpriseId:"Missing enterprise-ID",missingCategoryId:"Missing category-ID",minimumNights:"nights minimum",maximumNights:"nights maximum",booked:"Already Booked",select:"Select",fatalErrorMessage:"Oops! An unexpected error occurred. Please try reloading or contact support.",pleaseWait:"Please wait...","chargingMode:Once":"Once","chargingMode:PerTimeUnit":"Nightly","chargingMode:PerPersonPerTimeUnit":"Nightly per person",adults:"Adults",children:"Children (0-18 years old)",couponValid:"Coupon is valid ;)",couponInvalid:"Coupon is invalid !",couponError:"Error validating coupon!",proceedToPayment:"Proceed to payment",completePayment:"Complete the payment"},"fr-FR":{loading:"Chargement...",night:"Nuit",chooseOption:"Choisir une option",apartment:"Appartement",total:"Au total",missingEnterpriseId:"ID d'entreprise manquant",missingCategoryId:"ID de cat\xE9gorie manquant",minimumNights:"nuits minimum",maximumNights:"nuits maximum",booked:"D\xE9j\xE0 r\xE9serv\xE9",select:"S\xE9lectionner",fatalErrorMessage:"Oups ! Une erreur inattendue s'est produite. Veuillez recharger la page ou contacter le support.",pleaseWait:"S'il vous pla\xEEt, attendez...","chargingMode:Once":"Une fois","chargingMode:PerTimeUnit":"Par nuit","chargingMode:PerPersonPerTimeUnit":"Par personne par nuit",adults:"Adultes",children:"Enfants (0-18 ans)",couponValid:"Le coupon est valide ;)",couponInvalid:"Le coupon est invalide !",couponError:"Erreur lors de la validation du coupon !",proceedToPayment:"Proc\xE9der au paiement",completePayment:"Finalisez le paiement"}},qs=n=>pu[Hr().bcp47][n]||pu["fr-FR"][n],jt=n=>{let t=Hr().bcp47;return t in n?n[t]:(console.warn(`Translation [${t}] not found, falling back to default.`,n),n[t]||n["fr-FR"]||n["en-US"]||"")};function gu(n){return n.Services.map(t=>({id:t.Id,enterpriseId:t.EnterpriseId,isActive:t.IsActive,name:jt(t.Names),startTime:t.StartTime,endTime:t.EndTime,type:t.Type,ordering:t.Ordering}))}var Ws=Ge({});async function yu(n){if(Ws.value[n])return Ws.value[n];let t=await fu(n),e=gu(t);return Ws.value[n]=e,e}var vu=(n,t)=>{let e={method:"POST",headers:Fe.headers,body:JSON.stringify(t)};return et("/ageCategories/getAll",e,n)};function wu(n){if(!n||!n.AgeCategories||!Array.isArray(n.AgeCategories))throw new Error("Invalid age categories response format");return n.AgeCategories.map(t=>({id:t.Id,name:jt(t.Names),shortName:t.ShortNames?jt(t.ShortNames):null,classification:t.Classification,isActive:t.IsActive,maximalAge:t.MaximalAge,minimalAge:t.MinimalAge,serviceId:t.ServiceId}))}var Ks=Ge({});async function bu(n){if(Ks.value[n])return Ks.value[n];let t=await vu(n,{EnterpriseIds:[n]}),e=wu(t);return Ks.value[n]=e,e}var Du=(n,t)=>{let e={method:"POST",headers:Fe.headers,body:JSON.stringify(t)};return et("/products/getAll",e,n)};function _u(n){return{currency:n.Currency,datesUtc:n.DatesUtc.map(t=>t.split("T")[0]),timeUnitStartsUTC:n.TimeUnitStartsUtc,categoryPrices:n.CategoryPrices,relativeAdjustment:n.RelativeAdjustment,absoluteAdjustment:n.AbsoluteAdjustment}}function Eu(n){let t={};for(let e of n)e.pricing?.datesUtc.forEach((r,i)=>{t[r]=t[r]||[],t[r].push({rate:e.rate,categoryPrices:e.pricing?.categoryPrices.map(o=>({categoryId:o.CategoryId,amountPrice:o.AmountPrices[i],price:o.Prices[i]}))||[]})});return t}function Mu(n){if(!n||!n.Rates||!Array.isArray(n.Rates))throw new Error("Invalid rates response format");return n.Rates.filter(t=>t.IsActive&&t.IsEnabled&&t.IsPublic).map(t=>({id:t.Id,serviceId:t.ServiceId,baseRateId:t.BaseRateId,isBaseRate:t.IsBaseRate,isActive:t.IsActive,isEnabled:t.IsEnabled,isPublic:t.IsPublic,isDefault:t.IsDefault,type:t.Type,name:jt(t.Names),shortName:t.ShortName,description:jt(t.Description),hideFromGuest:t.Options.HidePriceFromGuest,group:n.RateGroups.find(e=>e.Id===t.GroupId)||null,pricing:t.Pricing}))}function Wi(n,t){return n.map(t)}function Zs(n){return{id:n.Id,serviceId:n.ServiceId,categoryId:n.CategoryId,isActive:n.IsActive,isDefault:n.IsDefault,name:jt(n.Names),shortName:jt(n.ShortNames),description:jt(n.Descriptions),options:n.Options,promotions:n.Promotions,classifications:n.Classifications,pricing:n.Pricing,imageIds:n.ImageIds||[],ordering:n.Ordering,consumptionMoment:n.ConsumptionMoment,chargingMode:n.ChargingMode}}function ku(n){return{products:Wi(n.Products,Zs),customerProducts:Wi(n.CustomerProducts,Zs)}}var Gs=Ge({});async function Su(n,t){if(Gs.value[t])return Gs.value[t];let e=await Du(n,{ServiceIds:[t]}),r=ku(e);return Gs.value[t]=r,r}var Tu=(n,t={})=>{let e={method:"POST",headers:Fe.headers,body:JSON.stringify(t)};return et("/rates/getAll",e,n)};var Js=Ge({});async function Cu(n,t){if(Js.value[t])return Js.value[t];let e=await Tu(n,{ServiceIds:[t]}),r=Mu(e);return Js.value[t]=r,r}var Iu=(n,t)=>{let e={method:"POST",headers:Fe.headers,body:JSON.stringify(t)};return et("/services/getAvailability",e,n)};function xu(n){if(!n||!n.CategoryAvailabilities||!Array.isArray(n.CategoryAvailabilities)||!n.TimeUnitStartsUtc)throw new Error("Invalid service availabilities response format");return n.CategoryAvailabilities.map(t=>({categoryId:t.CategoryId,timeUnitStartsUTC:n.TimeUnitStartsUtc,availabilities:t.Availabilities||[],adjustments:t.Adjustments||[]}))}var se=class n{static getCurrentDate(){return Ye.Now.plainDateISO()}static fromString(t){return Ye.PlainDate.from(this.safeParsePlainDate(t))}static formatForDisplay(t,e={weekday:"short",month:"short",day:"numeric"}){return t.toLocaleString(zn,e)}static formatForAPI(t){return(typeof t=="string"?Ye.PlainDate.from(t):Ye.PlainDate.from(t)).toZonedDateTime({timeZone:"Europe/Paris",plainTime:Ye.PlainTime.from("00:00")}).toInstant().toString()}static addDays(t,e){return t.add({days:e})}static daysBetween(t,e){return t.until(e).days}static isBefore(t,e){return Ye.PlainDate.compare(t,e)>0}static isAfterOrEqual(t,e){return Ye.PlainDate.compare(t,e)<0}static isSameDate(t,e){return Ye.PlainDate.compare(t,e)===0}static getDateRange(t,e){let r=[],i=t;for(;this.isBefore(i,e);)r.push(i),i=this.addDays(i,1);return r}static fromJSDate(t){return Ye.PlainDate.from({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()})}static toJSDate(t){return new Date(t.year,t.month-1,t.day)}static formatForCalendar(t,e="flatpickr"){if(e==="flatpickr")return t.toString();let r=String(t.day).padStart(2,"0"),i=String(t.month).padStart(2,"0");return`${r}/${i}/${t.year}`}static safeParsePlainDate(t){try{if(t.endsWith("Z")){let e=t.split("T")[0];return Ye.PlainDate.from(e)}return Ye.PlainDate.from(t)}catch(e){return console.error("Error parsing date string:",e),n.getCurrentDate()}}};var bp=localStorage.getItem("dev")==="true";var Dp=3*60*60*1e3;var Ko="calendar-day-price",Pu="DD/MM/YYYY",Ru="Y-m-d",Au=!1,em=365,Xs=se.getCurrentDate(),Nu=se.addDays(Xs,em),Ki=se.getCurrentDate(),Zo=se.addDays(Ki,3),tm=se.getCurrentDate(),_p=se.addDays(tm,30);var Lu=6;var Ou={missingApparthotel:{en:"Missing or invalid apparthotel selected",fr:"Aparthotel manquant ou invalide s\xE9lectionn\xE9"},missingConfig:{en:"Missing or invalid apartment configuration",fr:"Configuration manquante ou invalide de l'appartement"},invalidDateRange:{en:"Check-out date must be after check-in date",fr:"La date de sortie doit \xEAtre apr\xE8s la date d'arriv\xE9e"},maxRoomsExceeded:{en:"Maximum number of rooms exceeded",fr:"Le nombre maximum de chambres a \xE9t\xE9 d\xE9pass\xE9"},maxAdultsExceeded:{en:"Maximum number of adults exceeded",fr:"Le nombre maximum de personnes adultes a \xE9t\xE9 d\xE9pass\xE9"},maxChildrenExceeded:{en:"Maximum number of children exceeded",fr:"Le nombre maximum de personnes enfants a \xE9t\xE9 d\xE9pass\xE9"}};function Qs(n=!0,t=document.body){t.querySelectorAll('[data-fs-element="preloader"]').forEach(r=>{r.classList.toggle("hide",!n)})}function Yu(n=!0,t=document.body,e=qs("fatalErrorMessage")){t.querySelectorAll('[data-fs-element="preloader"]').forEach(i=>{let o=i.querySelector('[data-fs-element="spinner"]'),a=i.querySelector('[data-fs-element="message"]'),s=i.firstChild;o&&o.classList.toggle("hide",n),a&&(n?(s.style.width="90%",a.textContent=e):(s.removeAttribute("style"),a.textContent=qs("pleaseWait"))),i.classList.toggle("hide",!n)})}var ec=class{constructor(){j(this,"state",yr({appartmentsData:[],today:se.getCurrentDate(),lowestPricesByDate:{},isLoadingPrices:!1,isLoadingData:!1}))}setAppartmentsData(t){this.state.appartmentsData=t}setLowestPricesByDate(t){this.state.lowestPricesByDate=t}setLoadingPrices(t){this.state.isLoadingPrices=t}setLoadingData(t){this.state.isLoadingData=t}reset(){this.state.appartmentsData=[],this.state.lowestPricesByDate={},this.state.isLoadingPrices=!1,this.state.isLoadingData=!1}},Ap=new ec;var ur={get:n=>{try{let t=localStorage.getItem(n);return t?JSON.parse(t):null}catch(t){return console.error(`Error reading from localStorage for key ${n}:`,t),null}},set:(n,t)=>{try{localStorage.setItem(n,JSON.stringify(t)),ur.touch()}catch(e){console.error(`Error writing to localStorage for key ${n}:`,e)}},update:(n,t)=>{let e=ur.get(n),r=t(e);ur.set(n,r)},remove:n=>{localStorage.removeItem(n),ur.touch()},clear:()=>{localStorage.clear()},has:n=>localStorage.getItem(n)!==null,touch:()=>{localStorage.setItem("lastUpdater",nm()||"root")}},nm=()=>localStorage.getItem("lastUpdater");var Un=ur.get("form_state"),Fu=Un?{enterpriseId:Un.enterpriseId||"",startDate:Un.startDate||"",endDate:Un.endDate||"",guests:Un.guests||0,coupon:Un.coupon||"",referrer:Un.referrer||window.location.href,rooms:Un.rooms||0}:{enterpriseId:"",startDate:Ki.toString(),endDate:Zo.toString(),guests:0,coupon:"",referrer:window.location.href,rooms:0},Ke=yr(Fu),rm=fo(Fu);Mc(()=>{ur.set("form_state",Ke)});var im="data-fs-element";var Sn=(n,t=document)=>t.querySelector(`[${im}="${n}"]`);var tc=Ge({});async function Hu(n,t,e,r){if(tc.value[t])return tc.value[t];let i=await Iu(n,{ServiceId:t,FirstTimeUnitStartUtc:se.formatForAPI(e),LastTimeUnitStartUtc:se.formatForAPI(r)}),o=xu(i);return tc.value[t]=o,o}var ju=(n,t)=>{let e={method:"POST",headers:Fe.headers,body:JSON.stringify(t)};return et("/restrictions/getAll",e,n)};function Bu(n){if(!n||!n.Restrictions||!Array.isArray(n.Restrictions))throw new Error("Invalid service restrictions response format");return n.Restrictions}var nc=Ge({});async function $u(n,t,e,r){if(nc.value[t])return nc.value[t];let i=await ju(n,{ServiceIds:[t],CollidingUtc:{StartUtc:se.formatForAPI(e),EndUtc:se.formatForAPI(r)},Origin:"User"}),o=Bu(i);return nc.value[t]=o,o}var zu=(n,t)=>{let e={method:"POST",headers:Fe.headers,body:JSON.stringify(t)};return et("/rules/getAll",e,n)};function Uu(n){if(!n||!n.Rules||!Array.isArray(n.Rules))throw new Error("Invalid service rules response format");return n.Rules.map(t=>({id:t.Id,serviceId:t.ServiceId,conditions:t.Conditions,actions:n.RuleActions!=null?n.RuleActions.filter(e=>e.RuleId===t.Id):n.RuleActions}))}var rc=Ge({});async function Vu(n,t){if(rc.value[t])return rc.value[t];let e=await zu(n,{ServiceIds:[t],Extent:{RuleActions:!0}}),r=Uu(e);return rc.value[t]=r,r}var qu=(n,t)=>{let e={method:"POST",headers:Fe.headers,body:JSON.stringify(t)};return et("/rates/getPricing",e,n)};var ic=Ge({});async function Wu(n,t,e,r){if(ic.value[t])return ic.value[t];let i=await qu(n,{RateId:t,FirstTimeUnitStartUtc:se.formatForAPI(e),LastTimeUnitStartUtc:se.formatForAPI(r)}),o=_u(i);return ic.value[t]=o,o}var Go=class{constructor(t,e){j(this,"enterprise");j(this,"rate",null);j(this,"pricing",null);this.enterprise=t,this.rate=e}getRate(){if(!this.rate)throw new Error("Rate is not initialized");return this.rate}async initPricing(t,e){if(!this.rate)throw new Error("Rate is not initialized");return this.pricing=await Wu(this.enterprise.getEnterpriseId(),this.rate.id,t,e),this.pricing}getPricing(){if(!this.pricing)throw new Error("Rate pricing is not initialized");return this.pricing}};var Jo=class{constructor(t,e){j(this,"enterprise");j(this,"service",null);j(this,"products",[]);j(this,"customerProducts",[]);j(this,"restrictions",[]);j(this,"availabilities",[]);j(this,"rules",[]);j(this,"ageCategories",[]);j(this,"rates",[]);this.enterprise=t,this.service=e}getService(){return this.service}async initAvailabilities(t,e){if(!this.service)throw new Error("Service is not initialized");return this.availabilities=await Hu(this.enterprise.getEnterpriseId(),this.service.id,t,e),this.availabilities}getAvailabilities(){if(this.availabilities.length===0)throw new Error("Service availabilities are not initialized");return this.availabilities}async initRestrictions(t,e){if(!this.service)throw new Error("Service is not initialized");return this.restrictions=await $u(this.enterprise.getEnterpriseId(),this.service.id,t,e),this.restrictions}getRestrictions(){if(this.restrictions.length===0)throw new Error("Service restrictions are not initialized");return this.restrictions}async initProducts(){if(!this.service)throw new Error("Service is not initialized");let t=await Su(this.enterprise.getEnterpriseId(),this.service.id);return this.products=t.products,this.customerProducts=t.customerProducts,t}getProducts(){if(this.products.length===0)throw new Error("Service products are not initialized");return this.products}async initRates(){if(!this.service)throw new Error("Service is not initialized");let t=await Cu(this.enterprise.getEnterpriseId(),this.service.id);if(this.rates=t.map(e=>new Go(this.enterprise,e)),this.rates.length===0)throw new Error("No rates found for the service");return this.rates}getRates(){if(this.rates.length===0)throw new Error("Service rates are not initialized");return this.rates?.map(t=>t.getRate())||[]}async initRules(){if(!this.service)throw new Error("Service is not initialized");return this.rules=await Vu(this.enterprise.getEnterpriseId(),this.service.id),this.rules}getRules(){if(this.rules.length===0)throw new Error("Service rules are not initialized");return this.rules}async initAgeCategories(){if(!this.service)throw new Error("Service is not initialized");return this.ageCategories=await bu(this.enterprise.getEnterpriseId()),this.ageCategories}getAgeCategories(){if(this.ageCategories.length===0)throw new Error("Age categories are not initialized");return this.ageCategories}};var Xo=class{constructor(t){j(this,"enterpriseId");j(this,"services",[]);j(this,"reservableService",null);this.enterpriseId=t}async initServices(){this.services=await yu(this.enterpriseId);let t=this.services.find(e=>e.type.toLowerCase()==="reservable");return t&&(this.reservableService=new Jo(this,t)),this.services}getEnterpriseId(){return this.enterpriseId}getServices(){return this.services}getReservableService(){return this.reservableService?.getService()??null}};function Ku(n,t){return{rate:n,pricing:t}}function oc(n){return n.isActive&&n.isEnabled&&n.isPublic&&!n.hideFromGuest}function Zu(n,t){let e=t.filter(o=>om(n,o.Conditions));return!!(e.some(o=>{let{Exceptions:a}=o;return a.MaxAdvance==null&&a.MinAdvance==null&&a.MaxLength==null&&a.MinLength==null&&a.MaxPrice==null&&a.MinPrice==null&&a.MaxReservationCount==null&&a.MinReservationCount==null})||e.some(o=>am(n,o.Exceptions)))}function om(n,t){return(t.ExactRateId===null||n.rate.id===t.ExactRateId)&&(t.BaseRateId===null||n.rate.baseRateId===t.BaseRateId)&&(t.ExactRateId===null||n.rate.baseRateId===t.ExactRateId)&&(t.RateGroupId===null||n.rate.group?.Id===t.RateGroupId)&&t.ResourceCategoryId===null&&t.ResourceCategoryType===null&&n.pricing?.datesUtc.every(e=>{let r=se.fromString(e);return t.Days.includes(r.toLocaleString("en-US",{weekday:"long"}))})&&!0}function Qo(n){if(!n)return null;try{return Ye.Duration.from(n).total({unit:"days"})}catch{return null}}function am(n,t){let e=se.fromString(n.pricing?.datesUtc[0]),r=se.fromString(n.pricing?.datesUtc.at(-1));if(!e||!r)return console.warn("Missing date information, cannot check restrictions"),!0;let i=r.since(e,{largestUnit:"day"}).days,o=se.getCurrentDate(),a=e.since(o,{largestUnit:"day"}).days,s=Qo(t.MinAdvance),l=Qo(t.MaxAdvance),u=Qo(t.MinLength),m=Qo(t.MaxLength);return!!(u&&i<u||m&&i>m||s&&a<s||l&&a>l||!t.MinLength&&!t.MaxLength&&!t.MinAdvance&&!t.MaxAdvance)}var Gu=(n,t)=>{let e=n.find(s=>s.rate.isBaseRate),r=n.filter(s=>!Zu(s,t)&&oc(s.rate)),i=Object.groupBy(r,s=>s.rate.group?.Name||"unknown"),o=Eu(r),a=sm(o);return{baseRate:e,allowedRates:r,groupedRates:i,datedPrices:o,lowestDatedPrices:a}};function sm(n){let t={};for(let[e,r]of Object.entries(n)){let i=1/0,o=r.filter(a=>oc(a.rate));for(let a of o)for(let s of a.categoryPrices)s.price<i&&(i=s.price);i!==1/0&&(t[e]=i)}return t}var Ju=async n=>{let t=await Promise.all(n.map(async r=>{let i=new Xo(r);await i.initServices();let o=i.reservableService;if(!o){console.error("No reservable service found for the enterprise.");return}await o.initRates();let a=[],s=await Promise.all(o.rates.map(async u=>{let m=await u.initPricing(se.formatForAPI(Xs.toString()),se.formatForAPI(Nu.toString()));return Ku(u.getRate(),m)}));return Gu(s,a).lowestDatedPrices})),e={};for(let r of t)if(r)for(let[i,o]of Object.entries(r))(!e[i]||o<e[i])&&(e[i]=o);return e};var ze=class ze extends Date{constructor(e=null,r="YYYY-MM-DD",i="en-US"){super(ze.parseDateTime(e,r,i));j(this,"lang");this.lang=i}static parseDateTime(e,r="YYYY-MM-DD",i="en-US"){if(!e)return new Date(new Date().setHours(0,0,0,0));if(e instanceof ze)return e.toJSDate();if(e instanceof Date)return e;if(/^-?\d{10,}$/.test(String(e)))return new Date(Number(e));if(typeof e=="string"){let o=[],a=null;for(;(a=ze.regex.exec(r))!=null;)a[1]!=="\\"&&o.push(a);if(o.length){let s={year:null,month:null,shortMonth:null,longMonth:null,day:null,hour:0,minute:0,second:0,ampm:null,value:""};o[0].index>0&&(s.value+=".*?");for(let[u,m]of Object.entries(o)){let f=Number(u),{group:y,pattern:E}=ze.formatPatterns(m[0],i);s[y]=f+1,s.value+=E,s.value+=".*?"}let l=new RegExp(`^${s.value}$`);if(l.test(e)){let u=l.exec(e),m=Number(u[s.year]),f=null;s.month?f=Number(u[s.month])-1:s.shortMonth?f=ze.shortMonths(i).indexOf(u[s.shortMonth]):s.longMonth&&(f=ze.longMonths(i).indexOf(u[s.longMonth]));let y=Number(u[s.day])||1,E=Number(u[s.hour]),x=Number.isNaN(E)?0:E,I=Number(u[s.minute]),L=Number.isNaN(I)?0:I,z=Number(u[s.second]),W=Number.isNaN(z)?0:z,K=u[s.ampm];return K&&K==="PM"&&(x+=12,x===24&&(x=0)),new Date(m,f,y,x,L,W,0)}}}return new Date(new Date().setHours(0,0,0,0))}static shortMonths(e){return ze.MONTH_JS.map(r=>new Date(2019,r).toLocaleString(e,{month:"short"}))}static longMonths(e){return ze.MONTH_JS.map(r=>new Date(2019,r).toLocaleString(e,{month:"long"}))}static formatPatterns(e,r){switch(e){case"YY":case"YYYY":return{group:"year",pattern:`(\\d{${e.length}})`};case"M":return{group:"month",pattern:"(\\d{1,2})"};case"MM":return{group:"month",pattern:"(\\d{2})"};case"MMM":return{group:"shortMonth",pattern:`(${ze.shortMonths(r).join("|")})`};case"MMMM":return{group:"longMonth",pattern:`(${ze.longMonths(r).join("|")})`};case"D":return{group:"day",pattern:"(\\d{1,2})"};case"DD":return{group:"day",pattern:"(\\d{2})"};case"h":case"H":return{group:"hour",pattern:"(\\d{1,2})"};case"hh":case"HH":return{group:"hour",pattern:"(\\d{2})"};case"m":return{group:"minute",pattern:"(\\d{1,2})"};case"mm":return{group:"minute",pattern:"(\\d{2})"};case"s":return{group:"second",pattern:"(\\d{1,2})"};case"ss":return{group:"second",pattern:"(\\d{2})"};case"a":case"A":return{group:"ampm",pattern:"(AM|PM|am|pm)"}}}getWeek(e){let r=new Date(this.midnight_ts(this)),i=(this.getDay()+(7-e))%7;r.setDate(r.getDate()-i);let o=r.getTime();return r.setMonth(0,1),r.getDay()!==e&&r.setMonth(0,1+(4-r.getDay()+7)%7),1+Math.ceil((o-r.getTime())/6048e5)}clone(){return new ze(this)}toJSDate(){return new Date(this)}inArray(e,r="[]"){return e.some(i=>i instanceof Array?this.isBetween(i[0],i[1],r):this.isSame(i,"day"))}isBetween(e,r,i="()"){switch(i){default:case"()":return this.midnight_ts(this)>this.midnight_ts(e)&&this.midnight_ts(this)<this.midnight_ts(r);case"[)":return this.midnight_ts(this)>=this.midnight_ts(e)&&this.midnight_ts(this)<this.midnight_ts(r);case"(]":return this.midnight_ts(this)>this.midnight_ts(e)&&this.midnight_ts(this)<=this.midnight_ts(r);case"[]":return this.midnight_ts()>=this.midnight_ts(e)&&this.midnight_ts()<=this.midnight_ts(r)}}isBefore(e,r="days"){switch(r){case"day":case"days":return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()>new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime();case"month":case"months":return new Date(e.getFullYear(),e.getMonth(),1).getTime()>new Date(this.getFullYear(),this.getMonth(),1).getTime();case"year":case"years":return e.getFullYear()>this.getFullYear()}throw new Error("isBefore: Invalid unit!")}isSameOrBefore(e,r="days"){switch(r){case"day":case"days":return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()>=new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime();case"month":case"months":return new Date(e.getFullYear(),e.getMonth(),1).getTime()>=new Date(this.getFullYear(),this.getMonth(),1).getTime()}throw new Error("isSameOrBefore: Invalid unit!")}isAfter(e,r="days"){switch(r){case"day":case"days":return new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime()>new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime();case"month":case"months":return new Date(this.getFullYear(),this.getMonth(),1).getTime()>new Date(e.getFullYear(),e.getMonth(),1).getTime();case"year":case"years":return this.getFullYear()>e.getFullYear()}throw new Error("isAfter: Invalid unit!")}isSameOrAfter(e,r="days"){switch(r){case"day":case"days":return new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime()>=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime();case"month":case"months":return new Date(this.getFullYear(),this.getMonth(),1).getTime()>=new Date(e.getFullYear(),e.getMonth(),1).getTime()}throw new Error("isSameOrAfter: Invalid unit!")}isSame(e,r="days"){switch(r){case"day":case"days":return new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime()===new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime();case"month":case"months":return new Date(this.getFullYear(),this.getMonth(),1).getTime()===new Date(e.getFullYear(),e.getMonth(),1).getTime()}throw new Error("isSame: Invalid unit!")}add(e,r="days"){switch(r){case"day":case"days":this.setDate(this.getDate()+e);break;case"month":case"months":this.setMonth(this.getMonth()+e)}return this}subtract(e,r="days"){switch(r){case"day":case"days":this.setDate(this.getDate()-e);break;case"month":case"months":this.setMonth(this.getMonth()-e)}return this}diff(e,r="days"){switch(r){default:case"day":case"days":return Math.round((this.midnight_ts()-this.midnight_ts(e))/864e5);case"month":case"months":let i=12*(e.getFullYear()-this.getFullYear());return i-=e.getMonth(),i+=this.getMonth(),i}}format(e,r="en-US"){let i="",o=[],a=null;for(;(a=ze.regex.exec(e))!=null;)a[1]!=="\\"&&o.push(a);if(o.length){o[0].index>0&&(i+=e.substring(0,o[0].index));for(let[s,l]of Object.entries(o)){let u=Number(s);i+=this.formatTokens(l[0],r),o[u+1]&&(i+=e.substring(l.index+l[0].length,o[u+1].index)),u===o.length-1&&(i+=e.substring(l.index+l[0].length))}}return i.replace(/\\/g,"")}midnight_ts(e){return e?new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0).getTime():new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0,0).getTime()}formatTokens(e,r){switch(e){case"YY":return String(this.getFullYear()).slice(-2);case"YYYY":return String(this.getFullYear());case"M":return String(this.getMonth()+1);case"MM":return`0${this.getMonth()+1}`.slice(-2);case"MMM":return ze.shortMonths(r)[this.getMonth()];case"MMMM":return ze.longMonths(r)[this.getMonth()];case"D":return String(this.getDate());case"DD":return`0${this.getDate()}`.slice(-2);case"H":return String(this.getHours());case"HH":return`0${this.getHours()}`.slice(-2);case"h":return String(this.getHours()%12||12);case"hh":return`0${this.getHours()%12||12}`.slice(-2);case"m":return String(this.getMinutes());case"mm":return`0${this.getMinutes()}`.slice(-2);case"s":return String(this.getSeconds());case"ss":return`0${this.getSeconds()}`.slice(-2);case"a":return this.getHours()<12||this.getHours()===24?"am":"pm";case"A":return this.getHours()<12||this.getHours()===24?"AM":"PM";default:return""}}};j(ze,"regex",/(\\)?(Y{2,4}|M{1,4}|D{1,2}|H{1,2}|h{1,2}|m{1,2}|s{1,2}|A|a)/g),j(ze,"MONTH_JS",[0,1,2,3,4,5,6,7,8,9,10,11]);var de=ze,ac=class{constructor(t){j(this,"picker");this.picker=t}render(t,e){t||(t=new de),t.setDate(1),t.setHours(0,0,0,0),typeof this[`get${e}View`]=="function"&&this[`get${e}View`](t)}getContainerView(t){this.picker.ui.container.innerHTML="",this.picker.options.header&&this.picker.trigger("render",{date:t.clone(),view:"Header"}),this.picker.trigger("render",{date:t.clone(),view:"Main"}),this.picker.options.autoApply||this.picker.trigger("render",{date:t.clone(),view:"Footer"})}getHeaderView(t){let e=document.createElement("header");this.picker.options.header instanceof HTMLElement&&e.appendChild(this.picker.options.header),typeof this.picker.options.header=="string"&&(e.innerHTML=this.picker.options.header),this.picker.ui.container.appendChild(e),this.picker.trigger("view",{target:e,date:t.clone(),view:"Header"})}getMainView(t){let e=document.createElement("main");this.picker.ui.container.appendChild(e);let r=document.createElement("div");r.className=`calendars grid-${this.picker.options.grid}`;for(let i=0;i<this.picker.options.calendars;i++){let o=document.createElement("div");o.className="calendar",r.appendChild(o);let a=this.getCalendarHeaderView(t.clone());o.appendChild(a),this.picker.trigger("view",{date:t.clone(),view:"CalendarHeader",index:i,target:a});let s=this.getCalendarDayNamesView();o.appendChild(s),this.picker.trigger("view",{date:t.clone(),view:"CalendarDayNames",index:i,target:s});let l=this.getCalendarDaysView(t.clone());o.appendChild(l),this.picker.trigger("view",{date:t.clone(),view:"CalendarDays",index:i,target:l});let u=this.getCalendarFooterView(this.picker.options.lang,t.clone());o.appendChild(u),this.picker.trigger("view",{date:t.clone(),view:"CalendarFooter",index:i,target:u}),this.picker.trigger("view",{date:t.clone(),view:"CalendarItem",index:i,target:o}),t.add(1,"month")}e.appendChild(r),this.picker.trigger("view",{date:t.clone(),view:"Calendars",target:r}),this.picker.trigger("view",{date:t.clone(),view:"Main",target:e})}getFooterView(t){let e=document.createElement("footer"),r=document.createElement("div");r.className="footer-buttons";let i=document.createElement("button");i.className="cancel-button unit",i.innerHTML=this.picker.options.locale.cancel,r.appendChild(i);let o=document.createElement("button");o.className="apply-button unit",o.innerHTML=this.picker.options.locale.apply,o.disabled=!0,r.appendChild(o),e.appendChild(r),this.picker.ui.container.appendChild(e),this.picker.trigger("view",{date:t,target:e,view:"Footer"})}getCalendarHeaderView(t){let e=document.createElement("div");e.className="header";let r=document.createElement("div");r.className="month-name",r.innerHTML=`<span>${t.toLocaleString(this.picker.options.lang,{month:"long"})}</span> ${t.format("YYYY")}`,e.appendChild(r);let i=document.createElement("button");i.className="previous-button unit",i.innerHTML=this.picker.options.locale.previousMonth,e.appendChild(i);let o=document.createElement("button");return o.className="next-button unit",o.innerHTML=this.picker.options.locale.nextMonth,e.appendChild(o),e}getCalendarDayNamesView(){let t=document.createElement("div");t.className="daynames-row";for(let e=1;e<=7;e++){let r=3+this.picker.options.firstDay+e,i=document.createElement("div");i.className="dayname",i.innerHTML=new Date(1970,0,r,12,0,0,0).toLocaleString(this.picker.options.lang,{weekday:"short"}),i.title=new Date(1970,0,r,12,0,0,0).toLocaleString(this.picker.options.lang,{weekday:"long"}),t.appendChild(i),this.picker.trigger("view",{dayIdx:r,view:"CalendarDayName",target:i})}return t}getCalendarDaysView(t){let e=document.createElement("div");e.className="days-grid";let r=this.calcOffsetDays(t,this.picker.options.firstDay),i=32-new Date(t.getFullYear(),t.getMonth(),32).getDate();for(let o=0;o<r;o++){let a=document.createElement("div");a.className="offset",e.appendChild(a)}for(let o=1;o<=i;o++){t.setDate(o);let a=this.getCalendarDayView(t);e.appendChild(a),this.picker.trigger("view",{date:t,view:"CalendarDay",target:a})}return e}getCalendarDayView(t){let e=this.picker.options.date?new de(this.picker.options.date):null,r=new de,i=document.createElement("div");return i.className="day unit",i.innerHTML=t.format("D"),i.dataset.time=String(t.getTime()),t.isSame(r,"day")&&i.classList.add("today"),[0,6].includes(t.getDay())&&i.classList.add("weekend"),this.picker.datePicked.length?this.picker.datePicked[0].isSame(t,"day")&&i.classList.add("selected"):e&&t.isSame(e,"day")&&i.classList.add("selected"),this.picker.trigger("view",{date:t,view:"CalendarDay",target:i}),i}getCalendarFooterView(t,e){let r=document.createElement("div");return r.className="footer",r}calcOffsetDays(t,e){let r=t.getDay()-e;return r<0&&(r+=7),r}},sc=class{constructor(t){j(this,"picker");j(this,"instances",{});this.picker=t}initialize(){let t=[];this.picker.options.plugins.forEach(e=>{typeof e=="function"?t.push(new e):typeof e=="string"&&typeof easepick<"u"&&Object.prototype.hasOwnProperty.call(easepick,e)?t.push(new easepick[e]):console.warn(`easepick: ${e} not found.`)}),t.sort((e,r)=>e.priority>r.priority?-1:e.priority<r.priority||e.dependencies.length>r.dependencies.length?1:e.dependencies.length<r.dependencies.length?-1:0),t.forEach(e=>{e.attach(this.picker),this.instances[e.getName()]=e})}getInstance(t){return this.instances[t]}addInstance(t){if(Object.prototype.hasOwnProperty.call(this.instances,t))console.warn(`easepick: ${t} already added.`);else{if(typeof easepick<"u"&&Object.prototype.hasOwnProperty.call(easepick,t)){let e=new easepick[t];return e.attach(this.picker),this.instances[e.getName()]=e,e}if(this.getPluginFn(t)!=="undefined"){let e=new(this.getPluginFn(t));return e.attach(this.picker),this.instances[e.getName()]=e,e}console.warn(`easepick: ${t} not found.`)}return null}removeInstance(t){return t in this.instances&&this.instances[t].detach(),delete this.instances[t]}reloadInstance(t){return this.removeInstance(t),this.addInstance(t)}getPluginFn(t){return[...this.picker.options.plugins].filter(e=>typeof e=="function"&&new e().getName()===t).shift()}},ea=class{constructor(t){j(this,"Calendar",new ac(this));j(this,"PluginManager",new sc(this));j(this,"calendars",[]);j(this,"datePicked",[]);j(this,"cssLoaded",0);j(this,"binds",{hidePicker:this.hidePicker.bind(this),show:this.show.bind(this)});j(this,"options",{doc:document,css:[],element:null,firstDay:1,grid:1,calendars:1,lang:"en-US",date:null,format:"YYYY-MM-DD",readonly:!0,autoApply:!0,header:!1,inline:!1,scrollToDate:!0,locale:{nextMonth:'<svg width="11" height="16" xmlns="http://www.w3.org/2000/svg"><path d="M2.748 16L0 13.333 5.333 8 0 2.667 2.748 0l7.919 8z" fill-rule="nonzero"/></svg>',previousMonth:'<svg width="11" height="16" xmlns="http://www.w3.org/2000/svg"><path d="M7.919 0l2.748 2.667L5.333 8l5.334 5.333L7.919 16 0 8z" fill-rule="nonzero"/></svg>',cancel:"Cancel",apply:"Apply"},documentClick:this.binds.hidePicker,plugins:[]});j(this,"ui",{container:null,shadowRoot:null,wrapper:null});j(this,"version","1.2.1");let e={...this.options.locale,...t.locale};this.options={...this.options,...t},this.options.locale=e,this.handleOptions(),this.ui.wrapper=document.createElement("span"),this.ui.wrapper.style.display="none",this.ui.wrapper.style.position="absolute",this.ui.wrapper.style.pointerEvents="none",this.ui.wrapper.className="easepick-wrapper",this.ui.wrapper.attachShadow({mode:"open"}),this.ui.shadowRoot=this.ui.wrapper.shadowRoot,this.ui.container=document.createElement("div"),this.ui.container.className="container",this.options.zIndex&&(this.ui.container.style.zIndex=String(this.options.zIndex)),this.options.inline&&(this.ui.wrapper.style.position="relative",this.ui.container.classList.add("inline")),this.ui.shadowRoot.appendChild(this.ui.container),this.options.element.after(this.ui.wrapper),this.handleCSS(),this.options.element.addEventListener("click",this.binds.show),this.on("view",this.onView.bind(this)),this.on("render",this.onRender.bind(this)),this.PluginManager.initialize(),this.parseValues(),typeof this.options.setup=="function"&&this.options.setup(this),this.on("click",this.onClick.bind(this));let r=this.options.scrollToDate?this.getDate():null;this.renderAll(r)}on(t,e,r={}){this.ui.container.addEventListener(t,e,r)}off(t,e,r={}){this.ui.container.removeEventListener(t,e,r)}trigger(t,e={}){return this.ui.container.dispatchEvent(new CustomEvent(t,{detail:e}))}destroy(){this.options.element.removeEventListener("click",this.binds.show),typeof this.options.documentClick=="function"&&document.removeEventListener("click",this.options.documentClick,!0),Object.keys(this.PluginManager.instances).forEach(t=>{this.PluginManager.removeInstance(t)}),this.ui.wrapper.remove()}onRender(t){let{view:e,date:r}=t.detail;this.Calendar.render(r,e)}onView(t){let{view:e,target:r}=t.detail;e==="Footer"&&this.datePicked.length&&(r.querySelector(".apply-button").disabled=!1)}onClickHeaderButton(t){this.isCalendarHeaderButton(t)&&(t.classList.contains("next-button")?this.calendars[0].add(1,"month"):this.calendars[0].subtract(1,"month"),this.renderAll(this.calendars[0]))}onClickCalendarDay(t){if(this.isCalendarDay(t)){let e=new de(t.dataset.time);this.options.autoApply?(this.setDate(e),this.trigger("select",{date:this.getDate()}),this.hide()):(this.datePicked[0]=e,this.trigger("preselect",{date:this.getDate()}),this.renderAll())}}onClickApplyButton(t){if(this.isApplyButton(t)){if(this.datePicked[0]instanceof Date){let e=this.datePicked[0].clone();this.setDate(e)}this.hide(),this.trigger("select",{date:this.getDate()})}}onClickCancelButton(t){this.isCancelButton(t)&&this.hide()}onClick(t){let e=t.target;if(e instanceof HTMLElement){let r=e.closest(".unit");if(!(r instanceof HTMLElement))return;this.onClickHeaderButton(r),this.onClickCalendarDay(r),this.onClickApplyButton(r),this.onClickCancelButton(r)}}isShown(){return this.ui.container.classList.contains("inline")||this.ui.container.classList.contains("show")}show(t){if(this.isShown())return;let e=t&&"target"in t?t.target:this.options.element,{top:r,left:i}=this.adjustPosition(e);this.ui.container.style.top=`${r}px`,this.ui.container.style.left=`${i}px`,this.ui.container.classList.add("show"),this.trigger("show",{target:e})}hide(){this.ui.container.classList.remove("show"),this.datePicked.length=0,this.renderAll(),this.trigger("hide")}setDate(t){let e=new de(t,this.options.format);this.options.date=e.clone(),this.updateValues(),this.calendars.length&&this.renderAll()}getDate(){return this.options.date instanceof de?this.options.date.clone():null}parseValues(){this.options.date?this.setDate(this.options.date):this.options.element instanceof HTMLInputElement&&this.options.element.value.length&&this.setDate(this.options.element.value),this.options.date instanceof Date||(this.options.date=null)}updateValues(){let t=this.getDate(),e=t instanceof Date?t.format(this.options.format,this.options.lang):"",r=this.options.element;r instanceof HTMLInputElement?r.value=e:r instanceof HTMLElement&&(r.innerText=e)}hidePicker(t){let e=t.target,r=null;e.shadowRoot&&(e=t.composedPath()[0],r=e.getRootNode().host),this.isShown()&&r!==this.ui.wrapper&&e!==this.options.element&&this.hide()}renderAll(t){this.trigger("render",{view:"Container",date:(t||this.calendars[0]).clone()})}isCalendarHeaderButton(t){return["previous-button","next-button"].some(e=>t.classList.contains(e))}isCalendarDay(t){return t.classList.contains("day")}isApplyButton(t){return t.classList.contains("apply-button")}isCancelButton(t){return t.classList.contains("cancel-button")}gotoDate(t){let e=new de(t,this.options.format);e.setDate(1),this.calendars[0]=e.clone(),this.renderAll()}clear(){this.options.date=null,this.datePicked.length=0,this.updateValues(),this.renderAll(),this.trigger("clear")}handleOptions(){this.options.element instanceof HTMLElement||(this.options.element=this.options.doc.querySelector(this.options.element)),typeof this.options.documentClick=="function"&&document.addEventListener("click",this.options.documentClick,!0),this.options.element instanceof HTMLInputElement&&(this.options.element.readOnly=this.options.readonly),this.options.date?this.calendars[0]=new de(this.options.date,this.options.format):this.calendars[0]=new de}handleCSS(){if(Array.isArray(this.options.css))this.options.css.forEach(t=>{let e=document.createElement("link");e.href=t,e.rel="stylesheet";let r=()=>{this.cssLoaded++,this.cssLoaded===this.options.css.length&&(this.ui.wrapper.style.display="")};e.addEventListener("load",r),e.addEventListener("error",r),this.ui.shadowRoot.append(e)});else if(typeof this.options.css=="string"){let t=document.createElement("style"),e=document.createTextNode(this.options.css);t.appendChild(e),this.ui.shadowRoot.append(t),this.ui.wrapper.style.display=""}else typeof this.options.css=="function"&&(this.options.css.call(this,this),this.ui.wrapper.style.display="")}adjustPosition(t){let e=t.getBoundingClientRect(),r=this.ui.wrapper.getBoundingClientRect();this.ui.container.classList.add("calc");let i=this.ui.container.getBoundingClientRect();this.ui.container.classList.remove("calc");let o=e.bottom-r.bottom,a=e.left-r.left;return typeof window<"u"&&(window.innerHeight<o+i.height&&o-i.height>=0&&(o=e.top-r.top-i.height),window.innerWidth<a+i.width&&e.right-i.width>=0&&(a=e.right-r.right-i.width)),{left:a,top:o}}},ia=Object.freeze({__proto__:null,Core:ea,create:ea}),Zi=class{constructor(){j(this,"picker");j(this,"options");j(this,"priority",0);j(this,"dependencies",[])}attach(t){let e=this.getName(),r={...this.options};this.options={...this.options,...t.options[e]||{}};for(let o of Object.keys(r))if(r[o]!==null&&typeof r[o]=="object"&&Object.keys(r[o]).length&&e in t.options&&o in t.options[e]){let a={...t.options[e][o]};a!==null&&typeof a=="object"&&Object.keys(a).length&&Object.keys(a).every(s=>Object.keys(r[o]).includes(s))&&(this.options[o]={...r[o],...a})}if(this.picker=t,this.dependenciesNotFound()){let o=this.dependencies.filter(a=>!this.pluginsAsStringArray().includes(a));return void console.warn(`${this.getName()}: required dependencies (${o.join(", ")}).`)}let i=this.camelCaseToKebab(this.getName());this.picker.ui.container.classList.add(i),this.onAttach()}detach(){let t=this.camelCaseToKebab(this.getName());this.picker.ui.container.classList.remove(t),typeof this.onDetach=="function"&&this.onDetach()}dependenciesNotFound(){return this.dependencies.length&&!this.dependencies.every(t=>this.pluginsAsStringArray().includes(t))}pluginsAsStringArray(){return this.picker.options.plugins.map(t=>typeof t=="function"?new t().getName():t)}camelCaseToKebab(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}},ta=class extends Zi{constructor(){super(...arguments);j(this,"priority",1);j(this,"binds",{onView:this.onView.bind(this)});j(this,"options",{minDate:null,maxDate:null,minDays:null,maxDays:null,selectForward:null,selectBackward:null,presets:!0,inseparable:!1,filter:null})}getName(){return"LockPlugin"}onAttach(){if(this.options.minDate&&(this.options.minDate=new de(this.options.minDate,this.picker.options.format,this.picker.options.lang)),this.options.maxDate&&(this.options.maxDate=new de(this.options.maxDate,this.picker.options.format,this.picker.options.lang),this.options.maxDate instanceof de&&this.picker.options.calendars>1&&this.picker.calendars[0].isSame(this.options.maxDate,"month"))){let e=this.picker.calendars[0].clone().subtract(1,"month");this.picker.gotoDate(e)}if((this.options.minDays||this.options.maxDays||this.options.selectForward||this.options.selectBackward)&&!this.picker.options.plugins.includes("RangePlugin")){let e=["minDays","maxDays","selectForward","selectBackward"];console.warn(`${this.getName()}: options ${e.join(", ")} required RangePlugin.`)}this.picker.on("view",this.binds.onView)}onDetach(){this.picker.off("view",this.binds.onView)}onView(e){let{view:r,target:i,date:o}=e.detail;if(r==="CalendarHeader"&&(this.options.minDate instanceof de&&o.isSameOrBefore(this.options.minDate,"month")&&i.classList.add("no-previous-month"),this.options.maxDate instanceof de&&o.isSameOrAfter(this.options.maxDate,"month")&&i.classList.add("no-next-month")),r==="CalendarDay"){let a=this.picker.datePicked.length?this.picker.datePicked[0]:null;if(this.testFilter(o))return void i.classList.add("locked");if(this.options.inseparable){if(this.options.minDays){let s=o.clone().subtract(this.options.minDays-1,"day"),l=o.clone().add(this.options.minDays-1,"day"),u=!1,m=!1;for(;s.isBefore(o,"day");){if(this.testFilter(s)){u=!0;break}s.add(1,"day")}for(;l.isAfter(o,"day");){if(this.testFilter(l)){m=!0;break}l.subtract(1,"day")}u&&m&&i.classList.add("not-available")}this.rangeIsNotAvailable(o,a)&&i.classList.add("not-available")}this.dateIsNotAvailable(o,a)&&i.classList.add("not-available")}if(this.options.presets&&r==="PresetPluginButton"){let a=new de(Number(i.dataset.start)),s=new de(Number(i.dataset.end)),l=s.diff(a,"day"),u=this.options.minDays&&l<this.options.minDays,m=this.options.maxDays&&l>this.options.maxDays;(u||m||this.lockMinDate(a)||this.lockMaxDate(a)||this.lockMinDate(s)||this.lockMaxDate(s)||this.rangeIsNotAvailable(a,s))&&i.setAttribute("disabled","disabled")}}dateIsNotAvailable(e,r){return this.lockMinDate(e)||this.lockMaxDate(e)||this.lockMinDays(e,r)||this.lockMaxDays(e,r)||this.lockSelectForward(e)||this.lockSelectBackward(e)}rangeIsNotAvailable(e,r){if(!e||!r)return!1;let i=(e.isSameOrBefore(r,"day")?e:r).clone(),o=(r.isSameOrAfter(e,"day")?r:e).clone();for(;i.isSameOrBefore(o,"day");){if(this.testFilter(i))return!0;i.add(1,"day")}return!1}lockMinDate(e){return this.options.minDate instanceof de&&e.isBefore(this.options.minDate,"day")}lockMaxDate(e){return this.options.maxDate instanceof de&&e.isAfter(this.options.maxDate,"day")}lockMinDays(e,r){if(this.options.minDays&&r){let i=r.clone().subtract(this.options.minDays-1,"day"),o=r.clone().add(this.options.minDays-1,"day");return e.isBetween(i,o)}return!1}lockMaxDays(e,r){if(this.options.maxDays&&r){let i=r.clone().subtract(this.options.maxDays,"day"),o=r.clone().add(this.options.maxDays,"day");return!e.isBetween(i,o)}return!1}lockSelectForward(e){if(this.picker.datePicked.length===1&&this.options.selectForward){let r=this.picker.datePicked[0].clone();return e.isBefore(r,"day")}return!1}lockSelectBackward(e){if(this.picker.datePicked.length===1&&this.options.selectBackward){let r=this.picker.datePicked[0].clone();return e.isAfter(r,"day")}return!1}testFilter(e){return typeof this.options.filter=="function"&&this.options.filter(e,this.picker.datePicked)}};var na=class extends Zi{constructor(){super(...arguments);j(this,"tooltipElement");j(this,"triggerElement");j(this,"binds",{setStartDate:this.setStartDate.bind(this),setEndDate:this.setEndDate.bind(this),setDateRange:this.setDateRange.bind(this),getStartDate:this.getStartDate.bind(this),getEndDate:this.getEndDate.bind(this),onView:this.onView.bind(this),onShow:this.onShow.bind(this),onMouseEnter:this.onMouseEnter.bind(this),onMouseLeave:this.onMouseLeave.bind(this),onClickCalendarDay:this.onClickCalendarDay.bind(this),onClickApplyButton:this.onClickApplyButton.bind(this),parseValues:this.parseValues.bind(this),updateValues:this.updateValues.bind(this),clear:this.clear.bind(this)});j(this,"options",{elementEnd:null,startDate:null,endDate:null,repick:!1,strict:!0,delimiter:" - ",tooltip:!0,tooltipNumber:e=>e,locale:{zero:"",one:"day",two:"",few:"",many:"",other:"days"},documentClick:this.hidePicker.bind(this)})}getName(){return"RangePlugin"}onAttach(){this.binds._setStartDate=this.picker.setStartDate,this.binds._setEndDate=this.picker.setEndDate,this.binds._setDateRange=this.picker.setDateRange,this.binds._getStartDate=this.picker.getStartDate,this.binds._getEndDate=this.picker.getEndDate,this.binds._parseValues=this.picker.parseValues,this.binds._updateValues=this.picker.updateValues,this.binds._clear=this.picker.clear,this.binds._onClickCalendarDay=this.picker.onClickCalendarDay,this.binds._onClickApplyButton=this.picker.onClickApplyButton,Object.defineProperties(this.picker,{setStartDate:{configurable:!0,value:this.binds.setStartDate},setEndDate:{configurable:!0,value:this.binds.setEndDate},setDateRange:{configurable:!0,value:this.binds.setDateRange},getStartDate:{configurable:!0,value:this.binds.getStartDate},getEndDate:{configurable:!0,value:this.binds.getEndDate},parseValues:{configurable:!0,value:this.binds.parseValues},updateValues:{configurable:!0,value:this.binds.updateValues},clear:{configurable:!0,value:this.binds.clear},onClickCalendarDay:{configurable:!0,value:this.binds.onClickCalendarDay},onClickApplyButton:{configurable:!0,value:this.binds.onClickApplyButton}}),this.options.elementEnd&&(this.options.elementEnd instanceof HTMLElement||(this.options.elementEnd=this.picker.options.doc.querySelector(this.options.elementEnd)),this.options.elementEnd instanceof HTMLInputElement&&(this.options.elementEnd.readOnly=this.picker.options.readonly),typeof this.picker.options.documentClick=="function"&&(document.removeEventListener("click",this.picker.options.documentClick,!0),typeof this.options.documentClick=="function"&&document.addEventListener("click",this.options.documentClick,!0)),this.options.elementEnd.addEventListener("click",this.picker.show.bind(this.picker))),this.options.repick=this.options.repick&&this.options.elementEnd instanceof HTMLElement,this.picker.options.date=null,this.picker.on("view",this.binds.onView),this.picker.on("show",this.binds.onShow),this.picker.on("mouseenter",this.binds.onMouseEnter,!0),this.picker.on("mouseleave",this.binds.onMouseLeave,!0),this.checkIntlPluralLocales()}onDetach(){Object.defineProperties(this.picker,{setStartDate:{configurable:!0,value:this.binds._setStartDate},setEndDate:{configurable:!0,value:this.binds._setEndDate},setDateRange:{configurable:!0,value:this.binds._setDateRange},getStartDate:{configurable:!0,value:this.binds._getStartDate},getEndDate:{configurable:!0,value:this.binds._getEndDate},parseValues:{configurable:!0,value:this.binds._parseValues},updateValues:{configurable:!0,value:this.binds._updateValues},clear:{configurable:!0,value:this.binds._clear},onClickCalendarDay:{configurable:!0,value:this.binds._onClickCalendarDay},onClickApplyButton:{configurable:!0,value:this.binds._onClickApplyButton}}),this.picker.off("view",this.binds.onView),this.picker.off("show",this.binds.onShow),this.picker.off("mouseenter",this.binds.onMouseEnter,!0),this.picker.off("mouseleave",this.binds.onMouseLeave,!0)}parseValues(){if(this.options.startDate||this.options.endDate)this.options.strict?this.options.startDate&&this.options.endDate?this.setDateRange(this.options.startDate,this.options.endDate):(this.options.startDate=null,this.options.endDate=null):(this.options.startDate&&this.setStartDate(this.options.startDate),this.options.endDate&&this.setEndDate(this.options.endDate));else if(this.options.elementEnd)this.options.strict?this.picker.options.element instanceof HTMLInputElement&&this.picker.options.element.value.length&&this.options.elementEnd instanceof HTMLInputElement&&this.options.elementEnd.value.length&&this.setDateRange(this.picker.options.element.value,this.options.elementEnd.value):(this.picker.options.element instanceof HTMLInputElement&&this.picker.options.element.value.length&&this.setStartDate(this.picker.options.element.value),this.options.elementEnd instanceof HTMLInputElement&&this.options.elementEnd.value.length&&this.setEndDate(this.options.elementEnd.value));else if(this.picker.options.element instanceof HTMLInputElement&&this.picker.options.element.value.length){let[e,r]=this.picker.options.element.value.split(this.options.delimiter);this.options.strict?e&&r&&this.setDateRange(e,r):(e&&this.setStartDate(e),r&&this.setEndDate(r))}}updateValues(){let e=this.picker.options.element,r=this.options.elementEnd,i=this.picker.getStartDate(),o=this.picker.getEndDate(),a=i instanceof Date?i.format(this.picker.options.format,this.picker.options.lang):"",s=o instanceof Date?o.format(this.picker.options.format,this.picker.options.lang):"";if(r)e instanceof HTMLInputElement?e.value=a:e instanceof HTMLElement&&(e.innerText=a),r instanceof HTMLInputElement?r.value=s:r instanceof HTMLElement&&(r.innerText=s);else{let l=`${a}${a||s?this.options.delimiter:""}${s}`;e instanceof HTMLInputElement?e.value=l:e instanceof HTMLElement&&(e.innerText=l)}}clear(){this.options.startDate=null,this.options.endDate=null,this.picker.datePicked.length=0,this.updateValues(),this.picker.renderAll(),this.picker.trigger("clear")}onShow(e){let{target:r}=e.detail;this.triggerElement=r,this.picker.options.scrollToDate&&this.getStartDate()instanceof Date&&this.picker.gotoDate(this.getStartDate()),this.initializeRepick()}onView(e){let{view:r,target:i}=e.detail;if(r==="Main"&&(this.tooltipElement=document.createElement("span"),this.tooltipElement.className="range-plugin-tooltip",i.appendChild(this.tooltipElement)),r==="CalendarDay"){let o=new de(i.dataset.time),a=this.picker.datePicked,s=a.length?this.picker.datePicked[0]:this.getStartDate(),l=a.length?this.picker.datePicked[1]:this.getEndDate();s&&s.isSame(o,"day")&&i.classList.add("start"),s&&l&&(l.isSame(o,"day")&&i.classList.add("end"),o.isBetween(s,l)&&i.classList.add("in-range"))}if(r==="Footer"){let o=this.picker.datePicked.length===1&&!this.options.strict||this.picker.datePicked.length===2;i.querySelector(".apply-button").disabled=!o}}hidePicker(e){let r=e.target,i=null;r.shadowRoot&&(r=e.composedPath()[0],i=r.getRootNode().host),this.picker.isShown()&&i!==this.picker.ui.wrapper&&r!==this.picker.options.element&&r!==this.options.elementEnd&&this.picker.hide()}setStartDate(e){let r=new de(e,this.picker.options.format);this.options.startDate=r?r.clone():null,this.updateValues(),this.picker.renderAll()}setEndDate(e){let r=new de(e,this.picker.options.format);this.options.endDate=r?r.clone():null,this.updateValues(),this.picker.renderAll()}setDateRange(e,r){let i=new de(e,this.picker.options.format),o=new de(r,this.picker.options.format);this.options.startDate=i?i.clone():null,this.options.endDate=o?o.clone():null,this.updateValues(),this.picker.renderAll()}getStartDate(){return this.options.startDate instanceof Date?this.options.startDate.clone():null}getEndDate(){return this.options.endDate instanceof Date?this.options.endDate.clone():null}onMouseEnter(e){let r=e.target;if(r instanceof HTMLElement){this.isContainer(r)&&this.initializeRepick();let i=r.closest(".unit");if(!(i instanceof HTMLElement))return;if(this.picker.isCalendarDay(i)){if(this.picker.datePicked.length!==1)return;let o=this.picker.datePicked[0].clone(),a=new de(i.dataset.time),s=!1;if(o.isAfter(a,"day")){let l=o.clone();o=a.clone(),a=l.clone(),s=!0}if([...this.picker.ui.container.querySelectorAll(".day")].forEach(l=>{let u=new de(l.dataset.time),m=this.picker.Calendar.getCalendarDayView(u);u.isBetween(o,a)&&m.classList.add("in-range"),u.isSame(this.picker.datePicked[0],"day")&&(m.classList.add("start"),m.classList.toggle("flipped",s)),l===i&&(m.classList.add("end"),m.classList.toggle("flipped",s)),l.className=m.className}),this.options.tooltip){let l=this.options.tooltipNumber(a.diff(o,"day")+1);if(l>0){let u=new Intl.PluralRules(this.picker.options.lang).select(l),m=`${l} ${this.options.locale[u]}`;this.showTooltip(i,m)}else this.hideTooltip()}}}}onMouseLeave(e){if(this.isContainer(e.target)&&this.options.repick){let r=this.getStartDate(),i=this.getEndDate();r&&i&&(this.picker.datePicked.length=0,this.picker.renderAll())}}onClickCalendarDay(e){if(this.picker.isCalendarDay(e)){this.picker.datePicked.length===2&&(this.picker.datePicked.length=0);let r=new de(e.dataset.time);if(this.picker.datePicked[this.picker.datePicked.length]=r,this.picker.datePicked.length===2&&this.picker.datePicked[0].isAfter(this.picker.datePicked[1])){let i=this.picker.datePicked[1].clone();this.picker.datePicked[1]=this.picker.datePicked[0].clone(),this.picker.datePicked[0]=i.clone()}this.picker.datePicked.length!==1&&this.picker.options.autoApply||this.picker.trigger("preselect",{start:this.picker.datePicked[0]instanceof Date?this.picker.datePicked[0].clone():null,end:this.picker.datePicked[1]instanceof Date?this.picker.datePicked[1].clone():null}),this.picker.datePicked.length===1&&(!this.options.strict&&this.picker.options.autoApply&&(this.picker.options.element===this.triggerElement&&this.setStartDate(this.picker.datePicked[0]),this.options.elementEnd===this.triggerElement&&this.setEndDate(this.picker.datePicked[0]),this.picker.trigger("select",{start:this.picker.getStartDate(),end:this.picker.getEndDate()})),this.picker.renderAll()),this.picker.datePicked.length===2&&(this.picker.options.autoApply?(this.setDateRange(this.picker.datePicked[0],this.picker.datePicked[1]),this.picker.trigger("select",{start:this.picker.getStartDate(),end:this.picker.getEndDate()}),this.picker.hide()):(this.hideTooltip(),this.picker.renderAll()))}}onClickApplyButton(e){this.picker.isApplyButton(e)&&(this.picker.datePicked.length!==1||this.options.strict||(this.picker.options.element===this.triggerElement&&(this.options.endDate=null,this.setStartDate(this.picker.datePicked[0])),this.options.elementEnd===this.triggerElement&&(this.options.startDate=null,this.setEndDate(this.picker.datePicked[0]))),this.picker.datePicked.length===2&&this.setDateRange(this.picker.datePicked[0],this.picker.datePicked[1]),this.picker.trigger("select",{start:this.picker.getStartDate(),end:this.picker.getEndDate()}),this.picker.hide())}showTooltip(e,r){this.tooltipElement.style.visibility="visible",this.tooltipElement.innerHTML=r;let i=this.picker.ui.container.getBoundingClientRect(),o=this.tooltipElement.getBoundingClientRect(),a=e.getBoundingClientRect(),s=a.top,l=a.left;s-=i.top,l-=i.left,s-=o.height,l-=o.width/2,l+=a.width/2,this.tooltipElement.style.top=`${s}px`,this.tooltipElement.style.left=`${l}px`}hideTooltip(){this.tooltipElement.style.visibility="hidden"}checkIntlPluralLocales(){if(!this.options.tooltip)return;let e=[...new Set([new Intl.PluralRules(this.picker.options.lang).select(0),new Intl.PluralRules(this.picker.options.lang).select(1),new Intl.PluralRules(this.picker.options.lang).select(2),new Intl.PluralRules(this.picker.options.lang).select(6),new Intl.PluralRules(this.picker.options.lang).select(18)])],r=Object.keys(this.options.locale);e.every(i=>r.includes(i))||console.warn(`${this.getName()}: provide locales (${e.join(", ")}) for correct tooltip text.`)}initializeRepick(){if(!this.options.repick)return;let e=this.getStartDate(),r=this.getEndDate();r&&this.triggerElement===this.picker.options.element&&(this.picker.datePicked[0]=r),e&&this.triggerElement===this.options.elementEnd&&(this.picker.datePicked[0]=e)}isContainer(e){return e===this.picker.ui.container}};var ra=class extends Zi{constructor(){super(...arguments);j(this,"rangePlugin");j(this,"lockPlugin");j(this,"priority",10);j(this,"binds",{onView:this.onView.bind(this),onColorScheme:this.onColorScheme.bind(this)});j(this,"options",{dropdown:{months:!1,years:!1,minYear:1950,maxYear:null},darkMode:!0,locale:{resetButton:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"/></svg>'}});j(this,"matchMedia")}getName(){return"AmpPlugin"}onAttach(){this.options.darkMode&&window&&"matchMedia"in window&&(this.matchMedia=window.matchMedia("(prefers-color-scheme: dark)"),this.matchMedia.matches&&(this.picker.ui.container.dataset.theme="dark"),this.matchMedia.addEventListener("change",this.binds.onColorScheme)),this.options.weekNumbers&&this.picker.ui.container.classList.add("week-numbers"),this.picker.on("view",this.binds.onView)}onDetach(){this.options.darkMode&&window&&"matchMedia"in window&&this.matchMedia.removeEventListener("change",this.binds.onColorScheme),this.picker.ui.container.removeAttribute("data-theme"),this.picker.ui.container.classList.remove("week-numbers"),this.picker.off("view",this.binds.onView)}onView(e){this.lockPlugin=this.picker.PluginManager.getInstance("LockPlugin"),this.rangePlugin=this.picker.PluginManager.getInstance("RangePlugin"),this.handleDropdown(e),this.handleResetButton(e),this.handleWeekNumbers(e)}onColorScheme(e){let r=e.matches?"dark":"light";this.picker.ui.container.dataset.theme=r}handleDropdown(e){let{view:r,target:i,date:o,index:a}=e.detail;if(r==="CalendarHeader"){let s=i.querySelector(".month-name");if(this.options.dropdown.months){s.childNodes[0].remove();let l=document.createElement("select");l.className="month-name--select month-name--dropdown";for(let u=0;u<12;u+=1){let m=document.createElement("option"),f=new de(new Date(o.getFullYear(),u,2,0,0,0)),y=new de(new Date(o.getFullYear(),u,1,0,0,0));m.value=String(u),m.text=f.toLocaleString(this.picker.options.lang,{month:"long"}),this.lockPlugin&&(m.disabled=this.lockPlugin.options.minDate&&y.isBefore(new de(this.lockPlugin.options.minDate),"month")||this.lockPlugin.options.maxDate&&y.isAfter(new de(this.lockPlugin.options.maxDate),"month")),m.selected=y.getMonth()===o.getMonth(),l.appendChild(m)}l.addEventListener("change",u=>{let m=u.target;this.picker.calendars[0].setDate(1),this.picker.calendars[0].setMonth(Number(m.value)),this.picker.renderAll()}),s.prepend(l)}if(this.options.dropdown.years){s.childNodes[1].remove();let l=document.createElement("select");l.className="month-name--select";let u=this.options.dropdown.minYear,m=this.options.dropdown.maxYear?this.options.dropdown.maxYear:new Date().getFullYear();if(o.getFullYear()>m){let f=document.createElement("option");f.value=String(o.getFullYear()),f.text=String(o.getFullYear()),f.selected=!0,f.disabled=!0,l.appendChild(f)}for(let f=m;f>=u;f-=1){let y=document.createElement("option"),E=new de(new Date(f,0,1,0,0,0));y.value=String(f),y.text=String(f),this.lockPlugin&&(y.disabled=this.lockPlugin.options.minDate&&E.isBefore(new de(this.lockPlugin.options.minDate),"year")||this.lockPlugin.options.maxDate&&E.isAfter(new de(this.lockPlugin.options.maxDate),"year")),y.selected=o.getFullYear()===f,l.appendChild(y)}if(o.getFullYear()<u){let f=document.createElement("option");f.value=String(o.getFullYear()),f.text=String(o.getFullYear()),f.selected=!0,f.disabled=!0,l.appendChild(f)}if(this.options.dropdown.years==="asc"){let f=Array.prototype.slice.call(l.childNodes).reverse();l.innerHTML="",f.forEach(y=>{y.innerHTML=y.value,l.appendChild(y)})}l.addEventListener("change",f=>{let y=f.target;this.picker.calendars[0].setFullYear(Number(y.value)),this.picker.renderAll()}),s.appendChild(l)}}}handleResetButton(e){let{view:r,target:i}=e.detail;if(r==="CalendarHeader"&&this.options.resetButton){let o=document.createElement("button");o.className="reset-button unit",o.innerHTML=this.options.locale.resetButton,o.addEventListener("click",a=>{a.preventDefault();let s=!0;typeof this.options.resetButton=="function"&&(s=this.options.resetButton.call(this)),s&&this.picker.clear()}),i.appendChild(o)}}handleWeekNumbers(e){if(this.options.weekNumbers){let{view:r,target:i}=e.detail;if(r==="CalendarDayNames"){let o=document.createElement("div");o.className="wnum-header",o.innerHTML="Wk",i.prepend(o)}r==="CalendarDays"&&[...i.children].forEach((o,a)=>{if(a===0||a%7==0){let s;if(o.classList.contains("day"))s=new de(o.dataset.time);else{let m=i.querySelector(".day");s=new de(m.dataset.time)}let l=s.getWeek(this.picker.options.firstDay);l===53&&s.getMonth()===0&&(l="53/1");let u=document.createElement("div");u.className="wnum-item",u.innerHTML=String(l),i.insertBefore(u,o)}})}}};var oa=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Vn={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var t=new Date(n.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var e=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-e.getTime())/864e5-3+(e.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1};var aa={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var t=n%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},sa=aa;var tt=function(n,t){return t===void 0&&(t=2),("000"+n).slice(t*-1)},It=function(n){return n===!0?1:0};function cc(n,t){var e;return function(){var r=this,i=arguments;clearTimeout(e),e=setTimeout(function(){return n.apply(r,i)},t)}}var ca=function(n){return n instanceof Array?n:[n]};function nt(n,t,e){if(e===!0)return n.classList.add(t);n.classList.remove(t)}function be(n,t,e){var r=window.document.createElement(n);return t=t||"",e=e||"",r.className=t,e!==void 0&&(r.textContent=e),r}function Gi(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function lc(n,t){if(t(n))return n;if(n.parentNode)return lc(n.parentNode,t)}function Ji(n,t){var e=be("div","numInputWrapper"),r=be("input","numInput "+n),i=be("span","arrowUp"),o=be("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?r.type="number":(r.type="text",r.pattern="\\d*"),t!==void 0)for(var a in t)r.setAttribute(a,t[a]);return e.appendChild(r),e.appendChild(i),e.appendChild(o),e}function xt(n){try{if(typeof n.composedPath=="function"){var t=n.composedPath();return t[0]}return n.target}catch{return n.target}}var uc=function(){},Xi=function(n,t,e){return e.months[t?"shorthand":"longhand"][n]},Xu={D:uc,F:function(n,t,e){n.setMonth(e.months.longhand.indexOf(t))},G:function(n,t){n.setHours((n.getHours()>=12?12:0)+parseFloat(t))},H:function(n,t){n.setHours(parseFloat(t))},J:function(n,t){n.setDate(parseFloat(t))},K:function(n,t,e){n.setHours(n.getHours()%12+12*It(new RegExp(e.amPM[1],"i").test(t)))},M:function(n,t,e){n.setMonth(e.months.shorthand.indexOf(t))},S:function(n,t){n.setSeconds(parseFloat(t))},U:function(n,t){return new Date(parseFloat(t)*1e3)},W:function(n,t,e){var r=parseInt(t),i=new Date(n.getFullYear(),0,2+(r-1)*7,0,0,0,0);return i.setDate(i.getDate()-i.getDay()+e.firstDayOfWeek),i},Y:function(n,t){n.setFullYear(parseFloat(t))},Z:function(n,t){return new Date(t)},d:function(n,t){n.setDate(parseFloat(t))},h:function(n,t){n.setHours((n.getHours()>=12?12:0)+parseFloat(t))},i:function(n,t){n.setMinutes(parseFloat(t))},j:function(n,t){n.setDate(parseFloat(t))},l:uc,m:function(n,t){n.setMonth(parseFloat(t)-1)},n:function(n,t){n.setMonth(parseFloat(t)-1)},s:function(n,t){n.setSeconds(parseFloat(t))},u:function(n,t){return new Date(parseFloat(t))},w:uc,y:function(n,t){n.setFullYear(2e3+parseFloat(t))}},Tn={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},jr={Z:function(n){return n.toISOString()},D:function(n,t,e){return t.weekdays.shorthand[jr.w(n,t,e)]},F:function(n,t,e){return Xi(jr.n(n,t,e)-1,!1,t)},G:function(n,t,e){return tt(jr.h(n,t,e))},H:function(n){return tt(n.getHours())},J:function(n,t){return t.ordinal!==void 0?n.getDate()+t.ordinal(n.getDate()):n.getDate()},K:function(n,t){return t.amPM[It(n.getHours()>11)]},M:function(n,t){return Xi(n.getMonth(),!0,t)},S:function(n){return tt(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,t,e){return e.getWeek(n)},Y:function(n){return tt(n.getFullYear(),4)},d:function(n){return tt(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return tt(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,t){return t.weekdays.longhand[n.getDay()]},m:function(n){return tt(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}};var dc=function(n){var t=n.config,e=t===void 0?Vn:t,r=n.l10n,i=r===void 0?aa:r,o=n.isMobile,a=o===void 0?!1:o;return function(s,l,u){var m=u||i;return e.formatDate!==void 0&&!a?e.formatDate(s,l,m):l.split("").map(function(f,y,E){return jr[f]&&E[y-1]!=="\\"?jr[f](s,m,e):f!=="\\"?f:""}).join("")}},la=function(n){var t=n.config,e=t===void 0?Vn:t,r=n.l10n,i=r===void 0?aa:r;return function(o,a,s,l){if(!(o!==0&&!o)){var u=l||i,m,f=o;if(o instanceof Date)m=new Date(o.getTime());else if(typeof o!="string"&&o.toFixed!==void 0)m=new Date(o);else if(typeof o=="string"){var y=a||(e||Vn).dateFormat,E=String(o).trim();if(E==="today")m=new Date,s=!0;else if(e&&e.parseDate)m=e.parseDate(o,y);else if(/Z$/.test(E)||/GMT$/.test(E))m=new Date(o);else{for(var x=void 0,I=[],L=0,z=0,W="";L<y.length;L++){var K=y[L],te=K==="\\",re=y[L-1]==="\\"||te;if(Tn[K]&&!re){W+=Tn[K];var le=new RegExp(W).exec(o);le&&(x=!0)&&I[K!=="Y"?"push":"unshift"]({fn:Xu[K],val:le[++z]})}else te||(W+=".")}m=!e||!e.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),I.forEach(function(Me){var _e=Me.fn,ne=Me.val;return m=_e(m,ne,u)||m}),m=x?m:void 0}}if(!(m instanceof Date&&!isNaN(m.getTime()))){e.errorHandler(new Error("Invalid date provided: "+f));return}return s===!0&&m.setHours(0,0,0,0),m}}};function Pt(n,t,e){return e===void 0&&(e=!0),e!==!1?new Date(n.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):n.getTime()-t.getTime()}var Qu=function(n,t,e){return n>Math.min(t,e)&&n<Math.max(t,e)},ua=function(n,t,e){return n*3600+t*60+e},ed=function(n){var t=Math.floor(n/3600),e=(n-t*3600)/60;return[t,e,n-t*3600-e*60]},td={DAY:864e5};function da(n){var t=n.defaultHour,e=n.defaultMinute,r=n.defaultSeconds;if(n.minDate!==void 0){var i=n.minDate.getHours(),o=n.minDate.getMinutes(),a=n.minDate.getSeconds();t<i&&(t=i),t===i&&e<o&&(e=o),t===i&&e===o&&r<a&&(r=n.minDate.getSeconds())}if(n.maxDate!==void 0){var s=n.maxDate.getHours(),l=n.maxDate.getMinutes();t=Math.min(t,s),t===s&&(e=Math.min(l,e)),t===s&&e===l&&(r=n.maxDate.getSeconds())}return{hours:t,minutes:e,seconds:r}}typeof Object.assign!="function"&&(Object.assign=function(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];if(!n)throw TypeError("Cannot convert undefined or null to object");for(var r=function(s){s&&Object.keys(s).forEach(function(l){return n[l]=s[l]})},i=0,o=t;i<o.length;i++){var a=o[i];r(a)}return n});var rt=function(){return rt=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},rt.apply(this,arguments)},nd=function(){for(var n=0,t=0,e=arguments.length;t<e;t++)n+=arguments[t].length;for(var r=Array(n),i=0,t=0;t<e;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r},cm=300;function lm(n,t){var e={config:rt(rt({},Vn),je.defaultConfig),l10n:sa};e.parseDate=la({config:e.config,l10n:e.l10n}),e._handlers=[],e.pluginElements=[],e.loadedPlugins=[],e._bind=I,e._setHoursFromDate=y,e._positionCalendar=Cn,e.changeMonth=_,e.changeYear=J,e.clear=T,e.close=S,e.onMouseOver=pe,e._createElement=be,e.createDay=le,e.destroy=Y,e.isEnabled=U,e.jumpToDate=W,e.updateValue=un,e.open=Ce,e.redraw=eo,e.set=id,e.setDate=od,e.toggle=ld;function r(){e.utils={getDaysInMonth:function(p,w){return p===void 0&&(p=e.currentMonth),w===void 0&&(w=e.currentYear),p===1&&(w%4===0&&w%100!==0||w%400===0)?29:e.l10n.daysInMonth[p]}}}function i(){e.element=e.input=n,e.isOpen=!1,Ze(),qn(),sd(),ad(),r(),e.isMobile||re(),z(),(e.selectedDates.length||e.config.noCalendar)&&(e.config.enableTime&&y(e.config.noCalendar?e.latestSelectedDateObj:void 0),un(!1)),s();var p=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!e.isMobile&&p&&Cn(),Pe("onReady")}function o(){var p;return((p=e.calendarContainer)===null||p===void 0?void 0:p.getRootNode()).activeElement||document.activeElement}function a(p){return p.bind(e)}function s(){var p=e.config;p.weekNumbers===!1&&p.showMonths===1||p.noCalendar!==!0&&window.requestAnimationFrame(function(){if(e.calendarContainer!==void 0&&(e.calendarContainer.style.visibility="hidden",e.calendarContainer.style.display="block"),e.daysContainer!==void 0){var w=(e.days.offsetWidth+1)*p.showMonths;e.daysContainer.style.width=w+"px",e.calendarContainer.style.width=w+(e.weekWrapper!==void 0?e.weekWrapper.offsetWidth:0)+"px",e.calendarContainer.style.removeProperty("visibility"),e.calendarContainer.style.removeProperty("display")}})}function l(p){if(e.selectedDates.length===0){var w=e.config.minDate===void 0||Pt(new Date,e.config.minDate)>=0?new Date:new Date(e.config.minDate.getTime()),M=da(e.config);w.setHours(M.hours,M.minutes,M.seconds,w.getMilliseconds()),e.selectedDates=[w],e.latestSelectedDateObj=w}p!==void 0&&p.type!=="blur"&&hd(p);var P=e._input.value;f(),un(),e._input.value!==P&&e._debouncedChange()}function u(p,w){return p%12+12*It(w===e.l10n.amPM[1])}function m(p){switch(p%24){case 0:case 12:return 12;default:return p%12}}function f(){if(!(e.hourElement===void 0||e.minuteElement===void 0)){var p=(parseInt(e.hourElement.value.slice(-2),10)||0)%24,w=(parseInt(e.minuteElement.value,10)||0)%60,M=e.secondElement!==void 0?(parseInt(e.secondElement.value,10)||0)%60:0;e.amPM!==void 0&&(p=u(p,e.amPM.textContent));var P=e.config.minTime!==void 0||e.config.minDate&&e.minDateHasTime&&e.latestSelectedDateObj&&Pt(e.latestSelectedDateObj,e.config.minDate,!0)===0,$=e.config.maxTime!==void 0||e.config.maxDate&&e.maxDateHasTime&&e.latestSelectedDateObj&&Pt(e.latestSelectedDateObj,e.config.maxDate,!0)===0;if(e.config.maxTime!==void 0&&e.config.minTime!==void 0&&e.config.minTime>e.config.maxTime){var q=ua(e.config.minTime.getHours(),e.config.minTime.getMinutes(),e.config.minTime.getSeconds()),he=ua(e.config.maxTime.getHours(),e.config.maxTime.getMinutes(),e.config.maxTime.getSeconds()),G=ua(p,w,M);if(G>he&&G<q){var ge=ed(q);p=ge[0],w=ge[1],M=ge[2]}}else{if($){var Z=e.config.maxTime!==void 0?e.config.maxTime:e.config.maxDate;p=Math.min(p,Z.getHours()),p===Z.getHours()&&(w=Math.min(w,Z.getMinutes())),w===Z.getMinutes()&&(M=Math.min(M,Z.getSeconds()))}if(P){var ie=e.config.minTime!==void 0?e.config.minTime:e.config.minDate;p=Math.max(p,ie.getHours()),p===ie.getHours()&&w<ie.getMinutes()&&(w=ie.getMinutes()),w===ie.getMinutes()&&(M=Math.max(M,ie.getSeconds()))}}E(p,w,M)}}function y(p){var w=p||e.latestSelectedDateObj;w&&w instanceof Date&&E(w.getHours(),w.getMinutes(),w.getSeconds())}function E(p,w,M){e.latestSelectedDateObj!==void 0&&e.latestSelectedDateObj.setHours(p%24,w,M||0,0),!(!e.hourElement||!e.minuteElement||e.isMobile)&&(e.hourElement.value=tt(e.config.time_24hr?p:(12+p)%12+12*It(p%12===0)),e.minuteElement.value=tt(w),e.amPM!==void 0&&(e.amPM.textContent=e.l10n.amPM[It(p>=12)]),e.secondElement!==void 0&&(e.secondElement.value=tt(M)))}function x(p){var w=xt(p),M=parseInt(w.value)+(p.delta||0);(M/1e3>1||p.key==="Enter"&&!/[^\d]/.test(M.toString()))&&J(M)}function I(p,w,M,P){if(w instanceof Array)return w.forEach(function($){return I(p,$,M,P)});if(p instanceof Array)return p.forEach(function($){return I($,w,M,P)});p.addEventListener(w,M,P),e._handlers.push({remove:function(){return p.removeEventListener(w,M,P)}})}function L(){Pe("onChange")}function z(){if(e.config.wrap&&["open","close","toggle","clear"].forEach(function(M){Array.prototype.forEach.call(e.element.querySelectorAll("[data-"+M+"]"),function(P){return I(P,"click",e[M])})}),e.isMobile){cd();return}var p=cc(ve,50);if(e._debouncedChange=cc(L,cm),e.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&I(e.daysContainer,"mouseover",function(M){e.config.mode==="range"&&pe(xt(M))}),I(e._input,"keydown",ce),e.calendarContainer!==void 0&&I(e.calendarContainer,"keydown",ce),!e.config.inline&&!e.config.static&&I(window,"resize",p),window.ontouchstart!==void 0?I(window.document,"touchstart",V):I(window.document,"mousedown",V),I(window.document,"focus",V,{capture:!0}),e.config.clickOpens===!0&&(I(e._input,"focus",e.open),I(e._input,"click",e.open)),e.daysContainer!==void 0&&(I(e.monthNav,"click",dd),I(e.monthNav,["keyup","increment"],x),I(e.daysContainer,"click",hc)),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0){var w=function(M){return xt(M).select()};I(e.timeContainer,["increment"],l),I(e.timeContainer,"blur",l,{capture:!0}),I(e.timeContainer,"click",K),I([e.hourElement,e.minuteElement],["focus","click"],w),e.secondElement!==void 0&&I(e.secondElement,"focus",function(){return e.secondElement&&e.secondElement.select()}),e.amPM!==void 0&&I(e.amPM,"click",function(M){l(M)})}e.config.allowInput&&I(e._input,"blur",ee)}function W(p,w){var M=p!==void 0?e.parseDate(p):e.latestSelectedDateObj||(e.config.minDate&&e.config.minDate>e.now?e.config.minDate:e.config.maxDate&&e.config.maxDate<e.now?e.config.maxDate:e.now),P=e.currentYear,$=e.currentMonth;try{M!==void 0&&(e.currentYear=M.getFullYear(),e.currentMonth=M.getMonth())}catch(q){q.message="Invalid date supplied: "+M,e.config.errorHandler(q)}w&&e.currentYear!==P&&(Pe("onYearChange"),Q()),w&&(e.currentYear!==P||e.currentMonth!==$)&&Pe("onMonthChange"),e.redraw()}function K(p){var w=xt(p);~w.className.indexOf("arrow")&&te(p,w.classList.contains("arrowUp")?1:-1)}function te(p,w,M){var P=p&&xt(p),$=M||P&&P.parentNode&&P.parentNode.firstChild,q=pa("increment");q.delta=w,$&&$.dispatchEvent(q)}function re(){var p=window.document.createDocumentFragment();if(e.calendarContainer=be("div","flatpickr-calendar"),e.calendarContainer.tabIndex=-1,!e.config.noCalendar){if(p.appendChild(c()),e.innerContainer=be("div","flatpickr-innerContainer"),e.config.weekNumbers){var w=b(),M=w.weekWrapper,P=w.weekNumbers;e.innerContainer.appendChild(M),e.weekNumbers=P,e.weekWrapper=M}e.rContainer=be("div","flatpickr-rContainer"),e.rContainer.appendChild(v()),e.daysContainer||(e.daysContainer=be("div","flatpickr-days"),e.daysContainer.tabIndex=-1),O(),e.rContainer.appendChild(e.daysContainer),e.innerContainer.appendChild(e.rContainer),p.appendChild(e.innerContainer)}e.config.enableTime&&p.appendChild(d()),nt(e.calendarContainer,"rangeMode",e.config.mode==="range"),nt(e.calendarContainer,"animate",e.config.animate===!0),nt(e.calendarContainer,"multiMonth",e.config.showMonths>1),e.calendarContainer.appendChild(p);var $=e.config.appendTo!==void 0&&e.config.appendTo.nodeType!==void 0;if((e.config.inline||e.config.static)&&(e.calendarContainer.classList.add(e.config.inline?"inline":"static"),e.config.inline&&(!$&&e.element.parentNode?e.element.parentNode.insertBefore(e.calendarContainer,e._input.nextSibling):e.config.appendTo!==void 0&&e.config.appendTo.appendChild(e.calendarContainer)),e.config.static)){var q=be("div","flatpickr-wrapper");e.element.parentNode&&e.element.parentNode.insertBefore(q,e.element),q.appendChild(e.element),e.altInput&&q.appendChild(e.altInput),q.appendChild(e.calendarContainer)}!e.config.static&&!e.config.inline&&(e.config.appendTo!==void 0?e.config.appendTo:window.document.body).appendChild(e.calendarContainer)}function le(p,w,M,P){var $=U(w,!0),q=be("span",p,w.getDate().toString());return q.dateObj=w,q.$i=P,q.setAttribute("aria-label",e.formatDate(w,e.config.ariaDateFormat)),p.indexOf("hidden")===-1&&Pt(w,e.now)===0&&(e.todayDateElem=q,q.classList.add("today"),q.setAttribute("aria-current","date")),$?(q.tabIndex=-1,ga(w)&&(q.classList.add("selected"),e.selectedDateElem=q,e.config.mode==="range"&&(nt(q,"startRange",e.selectedDates[0]&&Pt(w,e.selectedDates[0],!0)===0),nt(q,"endRange",e.selectedDates[1]&&Pt(w,e.selectedDates[1],!0)===0),p==="nextMonthDay"&&q.classList.add("inRange")))):q.classList.add("flatpickr-disabled"),e.config.mode==="range"&&ud(w)&&!ga(w)&&q.classList.add("inRange"),e.weekNumbers&&e.config.showMonths===1&&p!=="prevMonthDay"&&P%7===6&&e.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+e.config.getWeek(w)+"</span>"),Pe("onDayCreate",q),q}function Me(p){p.focus(),e.config.mode==="range"&&pe(p)}function _e(p){for(var w=p>0?0:e.config.showMonths-1,M=p>0?e.config.showMonths:-1,P=w;P!=M;P+=p)for(var $=e.daysContainer.children[P],q=p>0?0:$.children.length-1,he=p>0?$.children.length:-1,G=q;G!=he;G+=p){var ge=$.children[G];if(ge.className.indexOf("hidden")===-1&&U(ge.dateObj))return ge}}function ne(p,w){for(var M=p.className.indexOf("Month")===-1?p.dateObj.getMonth():e.currentMonth,P=w>0?e.config.showMonths:-1,$=w>0?1:-1,q=M-e.currentMonth;q!=P;q+=$)for(var he=e.daysContainer.children[q],G=M-e.currentMonth===q?p.$i+w:w<0?he.children.length-1:0,ge=he.children.length,Z=G;Z>=0&&Z<ge&&Z!=(w>0?ge:-1);Z+=$){var ie=he.children[Z];if(ie.className.indexOf("hidden")===-1&&U(ie.dateObj)&&Math.abs(p.$i-Z)>=Math.abs(w))return Me(ie)}e.changeMonth($),N(_e($),0)}function N(p,w){var M=o(),P=B(M||document.body),$=p!==void 0?p:P?M:e.selectedDateElem!==void 0&&B(e.selectedDateElem)?e.selectedDateElem:e.todayDateElem!==void 0&&B(e.todayDateElem)?e.todayDateElem:_e(w>0?1:-1);$===void 0?e._input.focus():P?ne($,w):Me($)}function F(p,w){for(var M=(new Date(p,w,1).getDay()-e.l10n.firstDayOfWeek+7)%7,P=e.utils.getDaysInMonth((w-1+12)%12,p),$=e.utils.getDaysInMonth(w,p),q=window.document.createDocumentFragment(),he=e.config.showMonths>1,G=he?"prevMonthDay hidden":"prevMonthDay",ge=he?"nextMonthDay hidden":"nextMonthDay",Z=P+1-M,ie=0;Z<=P;Z++,ie++)q.appendChild(le("flatpickr-day "+G,new Date(p,w-1,Z),Z,ie));for(Z=1;Z<=$;Z++,ie++)q.appendChild(le("flatpickr-day",new Date(p,w,Z),Z,ie));for(var ke=$+1;ke<=42-M&&(e.config.showMonths===1||ie%7!==0);ke++,ie++)q.appendChild(le("flatpickr-day "+ge,new Date(p,w+1,ke%$),ke,ie));var Xt=be("div","dayContainer");return Xt.appendChild(q),Xt}function O(){if(e.daysContainer!==void 0){Gi(e.daysContainer),e.weekNumbers&&Gi(e.weekNumbers);for(var p=document.createDocumentFragment(),w=0;w<e.config.showMonths;w++){var M=new Date(e.currentYear,e.currentMonth,1);M.setMonth(e.currentMonth+w),p.appendChild(F(M.getFullYear(),M.getMonth()))}e.daysContainer.appendChild(p),e.days=e.daysContainer.firstChild,e.config.mode==="range"&&e.selectedDates.length===1&&pe()}}function Q(){if(!(e.config.showMonths>1||e.config.monthSelectorType!=="dropdown")){var p=function(P){return e.config.minDate!==void 0&&e.currentYear===e.config.minDate.getFullYear()&&P<e.config.minDate.getMonth()?!1:!(e.config.maxDate!==void 0&&e.currentYear===e.config.maxDate.getFullYear()&&P>e.config.maxDate.getMonth())};e.monthsDropdownContainer.tabIndex=-1,e.monthsDropdownContainer.innerHTML="";for(var w=0;w<12;w++)if(p(w)){var M=be("option","flatpickr-monthDropdown-month");M.value=new Date(e.currentYear,w).getMonth().toString(),M.textContent=Xi(w,e.config.shorthandCurrentMonth,e.l10n),M.tabIndex=-1,e.currentMonth===w&&(M.selected=!0),e.monthsDropdownContainer.appendChild(M)}}}function g(){var p=be("div","flatpickr-month"),w=window.document.createDocumentFragment(),M;e.config.showMonths>1||e.config.monthSelectorType==="static"?M=be("span","cur-month"):(e.monthsDropdownContainer=be("select","flatpickr-monthDropdown-months"),e.monthsDropdownContainer.setAttribute("aria-label",e.l10n.monthAriaLabel),I(e.monthsDropdownContainer,"change",function(he){var G=xt(he),ge=parseInt(G.value,10);e.changeMonth(ge-e.currentMonth),Pe("onMonthChange")}),Q(),M=e.monthsDropdownContainer);var P=Ji("cur-year",{tabindex:"-1"}),$=P.getElementsByTagName("input")[0];$.setAttribute("aria-label",e.l10n.yearAriaLabel),e.config.minDate&&$.setAttribute("min",e.config.minDate.getFullYear().toString()),e.config.maxDate&&($.setAttribute("max",e.config.maxDate.getFullYear().toString()),$.disabled=!!e.config.minDate&&e.config.minDate.getFullYear()===e.config.maxDate.getFullYear());var q=be("div","flatpickr-current-month");return q.appendChild(M),q.appendChild(P),w.appendChild(q),p.appendChild(w),{container:p,yearElement:$,monthElement:M}}function A(){Gi(e.monthNav),e.monthNav.appendChild(e.prevMonthNav),e.config.showMonths&&(e.yearElements=[],e.monthElements=[]);for(var p=e.config.showMonths;p--;){var w=g();e.yearElements.push(w.yearElement),e.monthElements.push(w.monthElement),e.monthNav.appendChild(w.container)}e.monthNav.appendChild(e.nextMonthNav)}function c(){return e.monthNav=be("div","flatpickr-months"),e.yearElements=[],e.monthElements=[],e.prevMonthNav=be("span","flatpickr-prev-month"),e.prevMonthNav.innerHTML=e.config.prevArrow,e.nextMonthNav=be("span","flatpickr-next-month"),e.nextMonthNav.innerHTML=e.config.nextArrow,A(),Object.defineProperty(e,"_hidePrevMonthArrow",{get:function(){return e.__hidePrevMonthArrow},set:function(p){e.__hidePrevMonthArrow!==p&&(nt(e.prevMonthNav,"flatpickr-disabled",p),e.__hidePrevMonthArrow=p)}}),Object.defineProperty(e,"_hideNextMonthArrow",{get:function(){return e.__hideNextMonthArrow},set:function(p){e.__hideNextMonthArrow!==p&&(nt(e.nextMonthNav,"flatpickr-disabled",p),e.__hideNextMonthArrow=p)}}),e.currentYearElement=e.yearElements[0],no(),e.monthNav}function d(){e.calendarContainer.classList.add("hasTime"),e.config.noCalendar&&e.calendarContainer.classList.add("noCalendar");var p=da(e.config);e.timeContainer=be("div","flatpickr-time"),e.timeContainer.tabIndex=-1;var w=be("span","flatpickr-time-separator",":"),M=Ji("flatpickr-hour",{"aria-label":e.l10n.hourAriaLabel});e.hourElement=M.getElementsByTagName("input")[0];var P=Ji("flatpickr-minute",{"aria-label":e.l10n.minuteAriaLabel});if(e.minuteElement=P.getElementsByTagName("input")[0],e.hourElement.tabIndex=e.minuteElement.tabIndex=-1,e.hourElement.value=tt(e.latestSelectedDateObj?e.latestSelectedDateObj.getHours():e.config.time_24hr?p.hours:m(p.hours)),e.minuteElement.value=tt(e.latestSelectedDateObj?e.latestSelectedDateObj.getMinutes():p.minutes),e.hourElement.setAttribute("step",e.config.hourIncrement.toString()),e.minuteElement.setAttribute("step",e.config.minuteIncrement.toString()),e.hourElement.setAttribute("min",e.config.time_24hr?"0":"1"),e.hourElement.setAttribute("max",e.config.time_24hr?"23":"12"),e.hourElement.setAttribute("maxlength","2"),e.minuteElement.setAttribute("min","0"),e.minuteElement.setAttribute("max","59"),e.minuteElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(M),e.timeContainer.appendChild(w),e.timeContainer.appendChild(P),e.config.time_24hr&&e.timeContainer.classList.add("time24hr"),e.config.enableSeconds){e.timeContainer.classList.add("hasSeconds");var $=Ji("flatpickr-second");e.secondElement=$.getElementsByTagName("input")[0],e.secondElement.value=tt(e.latestSelectedDateObj?e.latestSelectedDateObj.getSeconds():p.seconds),e.secondElement.setAttribute("step",e.minuteElement.getAttribute("step")),e.secondElement.setAttribute("min","0"),e.secondElement.setAttribute("max","59"),e.secondElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(be("span","flatpickr-time-separator",":")),e.timeContainer.appendChild($)}return e.config.time_24hr||(e.amPM=be("span","flatpickr-am-pm",e.l10n.amPM[It((e.latestSelectedDateObj?e.hourElement.value:e.config.defaultHour)>11)]),e.amPM.title=e.l10n.toggleTitle,e.amPM.tabIndex=-1,e.timeContainer.appendChild(e.amPM)),e.timeContainer}function v(){e.weekdayContainer?Gi(e.weekdayContainer):e.weekdayContainer=be("div","flatpickr-weekdays");for(var p=e.config.showMonths;p--;){var w=be("div","flatpickr-weekdaycontainer");e.weekdayContainer.appendChild(w)}return D(),e.weekdayContainer}function D(){if(e.weekdayContainer){var p=e.l10n.firstDayOfWeek,w=nd(e.l10n.weekdays.shorthand);p>0&&p<w.length&&(w=nd(w.splice(p,w.length),w.splice(0,p)));for(var M=e.config.showMonths;M--;)e.weekdayContainer.children[M].innerHTML=`
4
+ <span class='flatpickr-weekday'>
5
+ `+w.join("</span><span class='flatpickr-weekday'>")+`
6
+ </span>
7
+ `}}function b(){e.calendarContainer.classList.add("hasWeeks");var p=be("div","flatpickr-weekwrapper");p.appendChild(be("span","flatpickr-weekday",e.l10n.weekAbbreviation));var w=be("div","flatpickr-weeks");return p.appendChild(w),{weekWrapper:p,weekNumbers:w}}function _(p,w){w===void 0&&(w=!0);var M=w?p:p-e.currentMonth;M<0&&e._hidePrevMonthArrow===!0||M>0&&e._hideNextMonthArrow===!0||(e.currentMonth+=M,(e.currentMonth<0||e.currentMonth>11)&&(e.currentYear+=e.currentMonth>11?1:-1,e.currentMonth=(e.currentMonth+12)%12,Pe("onYearChange"),Q()),O(),Pe("onMonthChange"),no())}function T(p,w){if(p===void 0&&(p=!0),w===void 0&&(w=!0),e.input.value="",e.altInput!==void 0&&(e.altInput.value=""),e.mobileInput!==void 0&&(e.mobileInput.value=""),e.selectedDates=[],e.latestSelectedDateObj=void 0,w===!0&&(e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth()),e.config.enableTime===!0){var M=da(e.config),P=M.hours,$=M.minutes,q=M.seconds;E(P,$,q)}e.redraw(),p&&Pe("onChange")}function S(){e.isOpen=!1,e.isMobile||(e.calendarContainer!==void 0&&e.calendarContainer.classList.remove("open"),e._input!==void 0&&e._input.classList.remove("active")),Pe("onClose")}function Y(){e.config!==void 0&&Pe("onDestroy");for(var p=e._handlers.length;p--;)e._handlers[p].remove();if(e._handlers=[],e.mobileInput)e.mobileInput.parentNode&&e.mobileInput.parentNode.removeChild(e.mobileInput),e.mobileInput=void 0;else if(e.calendarContainer&&e.calendarContainer.parentNode)if(e.config.static&&e.calendarContainer.parentNode){var w=e.calendarContainer.parentNode;if(w.lastChild&&w.removeChild(w.lastChild),w.parentNode){for(;w.firstChild;)w.parentNode.insertBefore(w.firstChild,w);w.parentNode.removeChild(w)}}else e.calendarContainer.parentNode.removeChild(e.calendarContainer);e.altInput&&(e.input.type="text",e.altInput.parentNode&&e.altInput.parentNode.removeChild(e.altInput),delete e.altInput),e.input&&(e.input.type=e.input._type,e.input.classList.remove("flatpickr-input"),e.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(M){try{delete e[M]}catch{}})}function R(p){return e.calendarContainer.contains(p)}function V(p){if(e.isOpen&&!e.config.inline){var w=xt(p),M=R(w),P=w===e.input||w===e.altInput||e.element.contains(w)||p.path&&p.path.indexOf&&(~p.path.indexOf(e.input)||~p.path.indexOf(e.altInput)),$=!P&&!M&&!R(p.relatedTarget),q=!e.config.ignoredFocusElements.some(function(he){return he.contains(w)});$&&q&&(e.config.allowInput&&e.setDate(e._input.value,!1,e.config.altInput?e.config.altFormat:e.config.dateFormat),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0&&e.input.value!==""&&e.input.value!==void 0&&l(),e.close(),e.config&&e.config.mode==="range"&&e.selectedDates.length===1&&e.clear(!1))}}function J(p){if(!(!p||e.config.minDate&&p<e.config.minDate.getFullYear()||e.config.maxDate&&p>e.config.maxDate.getFullYear())){var w=p,M=e.currentYear!==w;e.currentYear=w||e.currentYear,e.config.maxDate&&e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth=Math.min(e.config.maxDate.getMonth(),e.currentMonth):e.config.minDate&&e.currentYear===e.config.minDate.getFullYear()&&(e.currentMonth=Math.max(e.config.minDate.getMonth(),e.currentMonth)),M&&(e.redraw(),Pe("onYearChange"),Q())}}function U(p,w){var M;w===void 0&&(w=!0);var P=e.parseDate(p,void 0,w);if(e.config.minDate&&P&&Pt(P,e.config.minDate,w!==void 0?w:!e.minDateHasTime)<0||e.config.maxDate&&P&&Pt(P,e.config.maxDate,w!==void 0?w:!e.maxDateHasTime)>0)return!1;if(!e.config.enable&&e.config.disable.length===0)return!0;if(P===void 0)return!1;for(var $=!!e.config.enable,q=(M=e.config.enable)!==null&&M!==void 0?M:e.config.disable,he=0,G=void 0;he<q.length;he++){if(G=q[he],typeof G=="function"&&G(P))return $;if(G instanceof Date&&P!==void 0&&G.getTime()===P.getTime())return $;if(typeof G=="string"){var ge=e.parseDate(G,void 0,!0);return ge&&ge.getTime()===P.getTime()?$:!$}else if(typeof G=="object"&&P!==void 0&&G.from&&G.to&&P.getTime()>=G.from.getTime()&&P.getTime()<=G.to.getTime())return $}return!$}function B(p){return e.daysContainer!==void 0?p.className.indexOf("hidden")===-1&&p.className.indexOf("flatpickr-disabled")===-1&&e.daysContainer.contains(p):!1}function ee(p){var w=p.target===e._input,M=e._input.value.trimEnd()!==ya();w&&M&&!(p.relatedTarget&&R(p.relatedTarget))&&e.setDate(e._input.value,!0,p.target===e.altInput?e.config.altFormat:e.config.dateFormat)}function ce(p){var w=xt(p),M=e.config.wrap?n.contains(w):w===e._input,P=e.config.allowInput,$=e.isOpen&&(!P||!M),q=e.config.inline&&M&&!P;if(p.keyCode===13&&M){if(P)return e.setDate(e._input.value,!0,w===e.altInput?e.config.altFormat:e.config.dateFormat),e.close(),w.blur();e.open()}else if(R(w)||$||q){var he=!!e.timeContainer&&e.timeContainer.contains(w);switch(p.keyCode){case 13:he?(p.preventDefault(),l(),fa()):hc(p);break;case 27:p.preventDefault(),fa();break;case 8:case 46:M&&!e.config.allowInput&&(p.preventDefault(),e.clear());break;case 37:case 39:if(!he&&!M){p.preventDefault();var G=o();if(e.daysContainer!==void 0&&(P===!1||G&&B(G))){var ge=p.keyCode===39?1:-1;p.ctrlKey?(p.stopPropagation(),_(ge),N(_e(1),0)):N(void 0,ge)}}else e.hourElement&&e.hourElement.focus();break;case 38:case 40:p.preventDefault();var Z=p.keyCode===40?1:-1;e.daysContainer&&w.$i!==void 0||w===e.input||w===e.altInput?p.ctrlKey?(p.stopPropagation(),J(e.currentYear-Z),N(_e(1),0)):he||N(void 0,Z*7):w===e.currentYearElement?J(e.currentYear-Z):e.config.enableTime&&(!he&&e.hourElement&&e.hourElement.focus(),l(p),e._debouncedChange());break;case 9:if(he){var ie=[e.hourElement,e.minuteElement,e.secondElement,e.amPM].concat(e.pluginElements).filter(function(Rt){return Rt}),ke=ie.indexOf(w);if(ke!==-1){var Xt=ie[ke+(p.shiftKey?-1:1)];p.preventDefault(),(Xt||e._input).focus()}}else!e.config.noCalendar&&e.daysContainer&&e.daysContainer.contains(w)&&p.shiftKey&&(p.preventDefault(),e._input.focus());break;default:break}}if(e.amPM!==void 0&&w===e.amPM)switch(p.key){case e.l10n.amPM[0].charAt(0):case e.l10n.amPM[0].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[0],f(),un();break;case e.l10n.amPM[1].charAt(0):case e.l10n.amPM[1].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[1],f(),un();break}(M||R(w))&&Pe("onKeyDown",p)}function pe(p,w){if(w===void 0&&(w="flatpickr-day"),!(e.selectedDates.length!==1||p&&(!p.classList.contains(w)||p.classList.contains("flatpickr-disabled")))){for(var M=p?p.dateObj.getTime():e.days.firstElementChild.dateObj.getTime(),P=e.parseDate(e.selectedDates[0],void 0,!0).getTime(),$=Math.min(M,e.selectedDates[0].getTime()),q=Math.max(M,e.selectedDates[0].getTime()),he=!1,G=0,ge=0,Z=$;Z<q;Z+=td.DAY)U(new Date(Z),!0)||(he=he||Z>$&&Z<q,Z<P&&(!G||Z>G)?G=Z:Z>P&&(!ge||Z<ge)&&(ge=Z));var ie=Array.from(e.rContainer.querySelectorAll("*:nth-child(-n+"+e.config.showMonths+") > ."+w));ie.forEach(function(ke){var Xt=ke.dateObj,Rt=Xt.getTime(),zr=G>0&&Rt<G||ge>0&&Rt>ge;if(zr){ke.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(dr){ke.classList.remove(dr)});return}else if(he&&!zr)return;["startRange","inRange","endRange","notAllowed"].forEach(function(dr){ke.classList.remove(dr)}),p!==void 0&&(p.classList.add(M<=e.selectedDates[0].getTime()?"startRange":"endRange"),P<M&&Rt===P?ke.classList.add("startRange"):P>M&&Rt===P&&ke.classList.add("endRange"),Rt>=G&&(ge===0||Rt<=ge)&&Qu(Rt,P,M)&&ke.classList.add("inRange"))})}}function ve(){e.isOpen&&!e.config.static&&!e.config.inline&&Cn()}function Ce(p,w){if(w===void 0&&(w=e._positionElement),e.isMobile===!0){if(p){p.preventDefault();var M=xt(p);M&&M.blur()}e.mobileInput!==void 0&&(e.mobileInput.focus(),e.mobileInput.click()),Pe("onOpen");return}else if(e._input.disabled||e.config.inline)return;var P=e.isOpen;e.isOpen=!0,P||(e.calendarContainer.classList.add("open"),e._input.classList.add("active"),Pe("onOpen"),Cn(w)),e.config.enableTime===!0&&e.config.noCalendar===!0&&e.config.allowInput===!1&&(p===void 0||!e.timeContainer.contains(p.relatedTarget))&&setTimeout(function(){return e.hourElement.select()},50)}function He(p){return function(w){var M=e.config["_"+p+"Date"]=e.parseDate(w,e.config.dateFormat),P=e.config["_"+(p==="min"?"max":"min")+"Date"];M!==void 0&&(e[p==="min"?"minDateHasTime":"maxDateHasTime"]=M.getHours()>0||M.getMinutes()>0||M.getSeconds()>0),e.selectedDates&&(e.selectedDates=e.selectedDates.filter(function($){return U($)}),!e.selectedDates.length&&p==="min"&&y(M),un()),e.daysContainer&&(eo(),M!==void 0?e.currentYearElement[p]=M.getFullYear().toString():e.currentYearElement.removeAttribute(p),e.currentYearElement.disabled=!!P&&M!==void 0&&P.getFullYear()===M.getFullYear())}}function Ze(){var p=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],w=rt(rt({},JSON.parse(JSON.stringify(n.dataset||{}))),t),M={};e.config.parseDate=w.parseDate,e.config.formatDate=w.formatDate,Object.defineProperty(e.config,"enable",{get:function(){return e.config._enable},set:function(ie){e.config._enable=fc(ie)}}),Object.defineProperty(e.config,"disable",{get:function(){return e.config._disable},set:function(ie){e.config._disable=fc(ie)}});var P=w.mode==="time";if(!w.dateFormat&&(w.enableTime||P)){var $=je.defaultConfig.dateFormat||Vn.dateFormat;M.dateFormat=w.noCalendar||P?"H:i"+(w.enableSeconds?":S":""):$+" H:i"+(w.enableSeconds?":S":"")}if(w.altInput&&(w.enableTime||P)&&!w.altFormat){var q=je.defaultConfig.altFormat||Vn.altFormat;M.altFormat=w.noCalendar||P?"h:i"+(w.enableSeconds?":S K":" K"):q+(" h:i"+(w.enableSeconds?":S":"")+" K")}Object.defineProperty(e.config,"minDate",{get:function(){return e.config._minDate},set:He("min")}),Object.defineProperty(e.config,"maxDate",{get:function(){return e.config._maxDate},set:He("max")});var he=function(ie){return function(ke){e.config[ie==="min"?"_minTime":"_maxTime"]=e.parseDate(ke,"H:i:S")}};Object.defineProperty(e.config,"minTime",{get:function(){return e.config._minTime},set:he("min")}),Object.defineProperty(e.config,"maxTime",{get:function(){return e.config._maxTime},set:he("max")}),w.mode==="time"&&(e.config.noCalendar=!0,e.config.enableTime=!0),Object.assign(e.config,M,w);for(var G=0;G<p.length;G++)e.config[p[G]]=e.config[p[G]]===!0||e.config[p[G]]==="true";oa.filter(function(ie){return e.config[ie]!==void 0}).forEach(function(ie){e.config[ie]=ca(e.config[ie]||[]).map(a)}),e.isMobile=!e.config.disableMobile&&!e.config.inline&&e.config.mode==="single"&&!e.config.disable.length&&!e.config.enable&&!e.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var G=0;G<e.config.plugins.length;G++){var ge=e.config.plugins[G](e)||{};for(var Z in ge)oa.indexOf(Z)>-1?e.config[Z]=ca(ge[Z]).map(a).concat(e.config[Z]):typeof w[Z]>"u"&&(e.config[Z]=ge[Z])}w.altInputClass||(e.config.altInputClass=Bt().className+" "+e.config.altInputClass),Pe("onParseConfig")}function Bt(){return e.config.wrap?n.querySelector("[data-input]"):n}function qn(){typeof e.config.locale!="object"&&typeof je.l10ns[e.config.locale]>"u"&&e.config.errorHandler(new Error("flatpickr: invalid locale "+e.config.locale)),e.l10n=rt(rt({},je.l10ns.default),typeof e.config.locale=="object"?e.config.locale:e.config.locale!=="default"?je.l10ns[e.config.locale]:void 0),Tn.D="("+e.l10n.weekdays.shorthand.join("|")+")",Tn.l="("+e.l10n.weekdays.longhand.join("|")+")",Tn.M="("+e.l10n.months.shorthand.join("|")+")",Tn.F="("+e.l10n.months.longhand.join("|")+")",Tn.K="("+e.l10n.amPM[0]+"|"+e.l10n.amPM[1]+"|"+e.l10n.amPM[0].toLowerCase()+"|"+e.l10n.amPM[1].toLowerCase()+")";var p=rt(rt({},t),JSON.parse(JSON.stringify(n.dataset||{})));p.time_24hr===void 0&&je.defaultConfig.time_24hr===void 0&&(e.config.time_24hr=e.l10n.time_24hr),e.formatDate=dc(e),e.parseDate=la({config:e.config,l10n:e.l10n})}function Cn(p){if(typeof e.config.position=="function")return void e.config.position(e,p);if(e.calendarContainer!==void 0){Pe("onPreCalendarPosition");var w=p||e._positionElement,M=Array.prototype.reduce.call(e.calendarContainer.children,function(bd,Dd){return bd+Dd.offsetHeight},0),P=e.calendarContainer.offsetWidth,$=e.config.position.split(" "),q=$[0],he=$.length>1?$[1]:null,G=w.getBoundingClientRect(),ge=window.innerHeight-G.bottom,Z=q==="above"||q!=="below"&&ge<M&&G.top>M,ie=window.pageYOffset+G.top+(Z?-M-2:w.offsetHeight+2);if(nt(e.calendarContainer,"arrowTop",!Z),nt(e.calendarContainer,"arrowBottom",Z),!e.config.inline){var ke=window.pageXOffset+G.left,Xt=!1,Rt=!1;he==="center"?(ke-=(P-G.width)/2,Xt=!0):he==="right"&&(ke-=P-G.width,Rt=!0),nt(e.calendarContainer,"arrowLeft",!Xt&&!Rt),nt(e.calendarContainer,"arrowCenter",Xt),nt(e.calendarContainer,"arrowRight",Rt);var zr=window.document.body.offsetWidth-(window.pageXOffset+G.right),dr=ke+P>window.document.body.offsetWidth,md=zr+P>window.document.body.offsetWidth;if(nt(e.calendarContainer,"rightMost",dr),!e.config.static)if(e.calendarContainer.style.top=ie+"px",!dr)e.calendarContainer.style.left=ke+"px",e.calendarContainer.style.right="auto";else if(!md)e.calendarContainer.style.left="auto",e.calendarContainer.style.right=zr+"px";else{var va=$r();if(va===void 0)return;var fd=window.document.body.offsetWidth,pd=Math.max(0,fd/2-P/2),gd=".flatpickr-calendar.centerMost:before",yd=".flatpickr-calendar.centerMost:after",vd=va.cssRules.length,wd="{left:"+G.left+"px;right:auto;}";nt(e.calendarContainer,"rightMost",!1),nt(e.calendarContainer,"centerMost",!0),va.insertRule(gd+","+yd+wd,vd),e.calendarContainer.style.left=pd+"px",e.calendarContainer.style.right="auto"}}}}function $r(){for(var p=null,w=0;w<document.styleSheets.length;w++){var M=document.styleSheets[w];if(M.cssRules){try{M.cssRules}catch{continue}p=M;break}}return p??Qi()}function Qi(){var p=document.createElement("style");return document.head.appendChild(p),p.sheet}function eo(){e.config.noCalendar||e.isMobile||(Q(),no(),O())}function fa(){e._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(e.close,0):e.close()}function hc(p){p.preventDefault(),p.stopPropagation();var w=function(ie){return ie.classList&&ie.classList.contains("flatpickr-day")&&!ie.classList.contains("flatpickr-disabled")&&!ie.classList.contains("notAllowed")},M=lc(xt(p),w);if(M!==void 0){var P=M,$=e.latestSelectedDateObj=new Date(P.dateObj.getTime()),q=($.getMonth()<e.currentMonth||$.getMonth()>e.currentMonth+e.config.showMonths-1)&&e.config.mode!=="range";if(e.selectedDateElem=P,e.config.mode==="single")e.selectedDates=[$];else if(e.config.mode==="multiple"){var he=ga($);he?e.selectedDates.splice(parseInt(he),1):e.selectedDates.push($)}else e.config.mode==="range"&&(e.selectedDates.length===2&&e.clear(!1,!1),e.latestSelectedDateObj=$,e.selectedDates.push($),Pt($,e.selectedDates[0],!0)!==0&&e.selectedDates.sort(function(ie,ke){return ie.getTime()-ke.getTime()}));if(f(),q){var G=e.currentYear!==$.getFullYear();e.currentYear=$.getFullYear(),e.currentMonth=$.getMonth(),G&&(Pe("onYearChange"),Q()),Pe("onMonthChange")}if(no(),O(),un(),!q&&e.config.mode!=="range"&&e.config.showMonths===1?Me(P):e.selectedDateElem!==void 0&&e.hourElement===void 0&&e.selectedDateElem&&e.selectedDateElem.focus(),e.hourElement!==void 0&&e.hourElement!==void 0&&e.hourElement.focus(),e.config.closeOnSelect){var ge=e.config.mode==="single"&&!e.config.enableTime,Z=e.config.mode==="range"&&e.selectedDates.length===2&&!e.config.enableTime;(ge||Z)&&fa()}L()}}var to={locale:[qn,D],showMonths:[A,s,v],minDate:[W],maxDate:[W],positionElement:[pc],clickOpens:[function(){e.config.clickOpens===!0?(I(e._input,"focus",e.open),I(e._input,"click",e.open)):(e._input.removeEventListener("focus",e.open),e._input.removeEventListener("click",e.open))}]};function id(p,w){if(p!==null&&typeof p=="object"){Object.assign(e.config,p);for(var M in p)to[M]!==void 0&&to[M].forEach(function(P){return P()})}else e.config[p]=w,to[p]!==void 0?to[p].forEach(function(P){return P()}):oa.indexOf(p)>-1&&(e.config[p]=ca(w));e.redraw(),un(!0)}function mc(p,w){var M=[];if(p instanceof Array)M=p.map(function(P){return e.parseDate(P,w)});else if(p instanceof Date||typeof p=="number")M=[e.parseDate(p,w)];else if(typeof p=="string")switch(e.config.mode){case"single":case"time":M=[e.parseDate(p,w)];break;case"multiple":M=p.split(e.config.conjunction).map(function(P){return e.parseDate(P,w)});break;case"range":M=p.split(e.l10n.rangeSeparator).map(function(P){return e.parseDate(P,w)});break;default:break}else e.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(p)));e.selectedDates=e.config.allowInvalidPreload?M:M.filter(function(P){return P instanceof Date&&U(P,!1)}),e.config.mode==="range"&&e.selectedDates.sort(function(P,$){return P.getTime()-$.getTime()})}function od(p,w,M){if(w===void 0&&(w=!1),M===void 0&&(M=e.config.dateFormat),p!==0&&!p||p instanceof Array&&p.length===0)return e.clear(w);mc(p,M),e.latestSelectedDateObj=e.selectedDates[e.selectedDates.length-1],e.redraw(),W(void 0,w),y(),e.selectedDates.length===0&&e.clear(!1),un(w),w&&Pe("onChange")}function fc(p){return p.slice().map(function(w){return typeof w=="string"||typeof w=="number"||w instanceof Date?e.parseDate(w,void 0,!0):w&&typeof w=="object"&&w.from&&w.to?{from:e.parseDate(w.from,void 0),to:e.parseDate(w.to,void 0)}:w}).filter(function(w){return w})}function ad(){e.selectedDates=[],e.now=e.parseDate(e.config.now)||new Date;var p=e.config.defaultDate||((e.input.nodeName==="INPUT"||e.input.nodeName==="TEXTAREA")&&e.input.placeholder&&e.input.value===e.input.placeholder?null:e.input.value);p&&mc(p,e.config.dateFormat),e._initialDate=e.selectedDates.length>0?e.selectedDates[0]:e.config.minDate&&e.config.minDate.getTime()>e.now.getTime()?e.config.minDate:e.config.maxDate&&e.config.maxDate.getTime()<e.now.getTime()?e.config.maxDate:e.now,e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth(),e.selectedDates.length>0&&(e.latestSelectedDateObj=e.selectedDates[0]),e.config.minTime!==void 0&&(e.config.minTime=e.parseDate(e.config.minTime,"H:i")),e.config.maxTime!==void 0&&(e.config.maxTime=e.parseDate(e.config.maxTime,"H:i")),e.minDateHasTime=!!e.config.minDate&&(e.config.minDate.getHours()>0||e.config.minDate.getMinutes()>0||e.config.minDate.getSeconds()>0),e.maxDateHasTime=!!e.config.maxDate&&(e.config.maxDate.getHours()>0||e.config.maxDate.getMinutes()>0||e.config.maxDate.getSeconds()>0)}function sd(){if(e.input=Bt(),!e.input){e.config.errorHandler(new Error("Invalid input element specified"));return}e.input._type=e.input.type,e.input.type="text",e.input.classList.add("flatpickr-input"),e._input=e.input,e.config.altInput&&(e.altInput=be(e.input.nodeName,e.config.altInputClass),e._input=e.altInput,e.altInput.placeholder=e.input.placeholder,e.altInput.disabled=e.input.disabled,e.altInput.required=e.input.required,e.altInput.tabIndex=e.input.tabIndex,e.altInput.type="text",e.input.setAttribute("type","hidden"),!e.config.static&&e.input.parentNode&&e.input.parentNode.insertBefore(e.altInput,e.input.nextSibling)),e.config.allowInput||e._input.setAttribute("readonly","readonly"),pc()}function pc(){e._positionElement=e.config.positionElement||e._input}function cd(){var p=e.config.enableTime?e.config.noCalendar?"time":"datetime-local":"date";e.mobileInput=be("input",e.input.className+" flatpickr-mobile"),e.mobileInput.tabIndex=1,e.mobileInput.type=p,e.mobileInput.disabled=e.input.disabled,e.mobileInput.required=e.input.required,e.mobileInput.placeholder=e.input.placeholder,e.mobileFormatStr=p==="datetime-local"?"Y-m-d\\TH:i:S":p==="date"?"Y-m-d":"H:i:S",e.selectedDates.length>0&&(e.mobileInput.defaultValue=e.mobileInput.value=e.formatDate(e.selectedDates[0],e.mobileFormatStr)),e.config.minDate&&(e.mobileInput.min=e.formatDate(e.config.minDate,"Y-m-d")),e.config.maxDate&&(e.mobileInput.max=e.formatDate(e.config.maxDate,"Y-m-d")),e.input.getAttribute("step")&&(e.mobileInput.step=String(e.input.getAttribute("step"))),e.input.type="hidden",e.altInput!==void 0&&(e.altInput.type="hidden");try{e.input.parentNode&&e.input.parentNode.insertBefore(e.mobileInput,e.input.nextSibling)}catch{}I(e.mobileInput,"change",function(w){e.setDate(xt(w).value,!1,e.mobileFormatStr),Pe("onChange"),Pe("onClose")})}function ld(p){if(e.isOpen===!0)return e.close();e.open(p)}function Pe(p,w){if(e.config!==void 0){var M=e.config[p];if(M!==void 0&&M.length>0)for(var P=0;M[P]&&P<M.length;P++)M[P](e.selectedDates,e.input.value,e,w);p==="onChange"&&(e.input.dispatchEvent(pa("change")),e.input.dispatchEvent(pa("input")))}}function pa(p){var w=document.createEvent("Event");return w.initEvent(p,!0,!0),w}function ga(p){for(var w=0;w<e.selectedDates.length;w++){var M=e.selectedDates[w];if(M instanceof Date&&Pt(M,p)===0)return""+w}return!1}function ud(p){return e.config.mode!=="range"||e.selectedDates.length<2?!1:Pt(p,e.selectedDates[0])>=0&&Pt(p,e.selectedDates[1])<=0}function no(){e.config.noCalendar||e.isMobile||!e.monthNav||(e.yearElements.forEach(function(p,w){var M=new Date(e.currentYear,e.currentMonth,1);M.setMonth(e.currentMonth+w),e.config.showMonths>1||e.config.monthSelectorType==="static"?e.monthElements[w].textContent=Xi(M.getMonth(),e.config.shorthandCurrentMonth,e.l10n)+" ":e.monthsDropdownContainer.value=M.getMonth().toString(),p.value=M.getFullYear().toString()}),e._hidePrevMonthArrow=e.config.minDate!==void 0&&(e.currentYear===e.config.minDate.getFullYear()?e.currentMonth<=e.config.minDate.getMonth():e.currentYear<e.config.minDate.getFullYear()),e._hideNextMonthArrow=e.config.maxDate!==void 0&&(e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth+1>e.config.maxDate.getMonth():e.currentYear>e.config.maxDate.getFullYear()))}function ya(p){var w=p||(e.config.altInput?e.config.altFormat:e.config.dateFormat);return e.selectedDates.map(function(M){return e.formatDate(M,w)}).filter(function(M,P,$){return e.config.mode!=="range"||e.config.enableTime||$.indexOf(M)===P}).join(e.config.mode!=="range"?e.config.conjunction:e.l10n.rangeSeparator)}function un(p){p===void 0&&(p=!0),e.mobileInput!==void 0&&e.mobileFormatStr&&(e.mobileInput.value=e.latestSelectedDateObj!==void 0?e.formatDate(e.latestSelectedDateObj,e.mobileFormatStr):""),e.input.value=ya(e.config.dateFormat),e.altInput!==void 0&&(e.altInput.value=ya(e.config.altFormat)),p!==!1&&Pe("onValueUpdate")}function dd(p){var w=xt(p),M=e.prevMonthNav.contains(w),P=e.nextMonthNav.contains(w);M||P?_(M?-1:1):e.yearElements.indexOf(w)>=0?w.select():w.classList.contains("arrowUp")?e.changeYear(e.currentYear+1):w.classList.contains("arrowDown")&&e.changeYear(e.currentYear-1)}function hd(p){p.preventDefault();var w=p.type==="keydown",M=xt(p),P=M;e.amPM!==void 0&&M===e.amPM&&(e.amPM.textContent=e.l10n.amPM[It(e.amPM.textContent===e.l10n.amPM[0])]);var $=parseFloat(P.getAttribute("min")),q=parseFloat(P.getAttribute("max")),he=parseFloat(P.getAttribute("step")),G=parseInt(P.value,10),ge=p.delta||(w?p.which===38?1:-1:0),Z=G+he*ge;if(typeof P.value<"u"&&P.value.length===2){var ie=P===e.hourElement,ke=P===e.minuteElement;Z<$?(Z=q+Z+It(!ie)+(It(ie)&&It(!e.amPM)),ke&&te(void 0,-1,e.hourElement)):Z>q&&(Z=P===e.hourElement?Z-q-It(!e.amPM):$,ke&&te(void 0,1,e.hourElement)),e.amPM&&ie&&(he===1?Z+G===23:Math.abs(Z-G)>he)&&(e.amPM.textContent=e.l10n.amPM[It(e.amPM.textContent===e.l10n.amPM[0])]),P.value=tt(Z)}}return i(),e}function Br(n,t){for(var e=Array.prototype.slice.call(n).filter(function(a){return a instanceof HTMLElement}),r=[],i=0;i<e.length;i++){var o=e[i];try{if(o.getAttribute("data-fp-omit")!==null)continue;o._flatpickr!==void 0&&(o._flatpickr.destroy(),o._flatpickr=void 0),o._flatpickr=lm(o,t||{}),r.push(o._flatpickr)}catch(a){console.error(a)}}return r.length===1?r[0]:r}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(n){return Br(this,n)},HTMLElement.prototype.flatpickr=function(n){return Br([this],n)});var je=function(n,t){return typeof n=="string"?Br(window.document.querySelectorAll(n),t):n instanceof Node?Br([n],t):Br(n,t)};je.defaultConfig={};je.l10ns={en:rt({},sa),default:rt({},sa)};je.localize=function(n){je.l10ns.default=rt(rt({},je.l10ns.default),n)};je.setDefaults=function(n){je.defaultConfig=rt(rt({},je.defaultConfig),n)};je.parseDate=la({});je.formatDate=dc({});je.compareDates=Pt;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(n){return Br(this,n)});Date.prototype.fp_incr=function(n){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof n=="string"?parseInt(n,10):n))};typeof window<"u"&&(window.flatpickr=je);var rd=je;var ha=class{constructor(t,e){this.dateInputEl=t;j(this,"minDate");j(this,"maxDate");j(this,"defaultReservationDays");j(this,"hasPrices",!1);j(this,"prices",{});j(this,"availability",{});j(this,"disabledDates",[]);j(this,"selectedStartDate");j(this,"selectedEndDate");j(this,"config");j(this,"instance");j(this,"destroyInstance");j(this,"currentDate");j(this,"handleResize",()=>{let t=this.isMobileDevice();(t&&this.config.grid!==1||!t&&this.config.grid!==2)&&(this.config.grid=t?1:2,this.config.calendars=t?1:2,this.destroyInstance&&this.destroyInstance(),this.initialize())});this.isMobileDevice()&&(e.grid=1,e.calendars=1),this.dateInputEl=t,this.defaultReservationDays=e.defaultReservationDays??3,this.config={type:e.type,showPrices:e.showPrices??!1,defaultReservationDays:this.defaultReservationDays,grid:e.grid??2,calendars:e.calendars??2,darkMode:e.darkMode??!0,tooltip:e.tooltip??!0,repick:e.repick??!1,minDays:e.minDays??1,defaultStartDate:e.defaultStartDate??se.getCurrentDate(),defaultEndDate:e.defaultEndDate??se.getCurrentDate()},this.currentDate=se.getCurrentDate(),this.selectedStartDate=this.config.defaultStartDate,this.selectedEndDate=this.config.defaultEndDate}isMobileDevice(){return window.innerWidth<=768}initialize(){switch(window.addEventListener("resize",this.handleResize),this.config.type){case"easepick":this.initEasepickCalendar();break;case"flatpickr":this.initFlatpickrCalendar();break;default:throw new Error(`Unsupported calendar type: ${this.config.type}`)}}setMinimumDate(t){this.minDate=t}setMaximumDate(t){this.maxDate=t}setStartDate(t){let e=se.toJSDate(t),r=se.toJSDate(this.selectedEndDate);this.selectedStartDate=t,this.instance instanceof ia.Core?this.instance.setStartDate(new de(t.toString())):this.config.type==="flatpickr"&&this.instance.setDate([e,r],!0)}setEndDate(t){let e=se.toJSDate(this.selectedStartDate),r=se.toJSDate(t);this.selectedEndDate=t,this.instance instanceof ia.Core?this.instance.setEndDate(new de(t.toString())):this.config.type==="flatpickr"&&this.instance.setDate([e,r],!0)}setDateRange(t,e){if(this.config.type==="flatpickr"){this.selectedStartDate=t,this.selectedEndDate=e;let r=se.toJSDate(t),i=se.toJSDate(e);this.instance.setDate([r,i],!0);return}this.setStartDate(t),this.setEndDate(e)}getSelectedDates(){return{startDate:this.selectedStartDate,endDate:this.selectedEndDate}}includePrices(t=!0){this.hasPrices=t}setPrices(t){this.prices=t}setAvailability(t){this.availability=t,this.disabledDates=Object.keys(t).filter(e=>!t[e])}initEasepickCalendar(){let t={element:this.dateInputEl,css:["https://cdn.jsdelivr.net/npm/@easepick/bundle@1.2.1/dist/index.css"],zIndex:10,format:Pu,grid:this.config.grid,calendars:this.config.calendars,header:"",lang:document.documentElement.lang,RangePlugin:{tooltip:this.config.tooltip,repick:this.config.repick,startDate:new de(this.config.defaultStartDate.toString()),endDate:new de(this.config.defaultEndDate.toString()),tooltipNumber:r=>r-1,locale:{one:"nuit",other:"nuits"}},LockPlugin:{minDate:new de(this.minDate.toString()),minDays:this.config.minDays,selectForward:!0},AmpPlugin:{darkMode:this.config.darkMode},plugins:[ra,na,ta],setup:r=>{r.on("view",i=>{let{view:o,date:a,target:s}=i.detail,l=a?a.format("YYYY-MM-DD"):null;if(o==="CalendarDay"&&l&&this.prices[l]){let u=this.prices[l],m=s.querySelector(`.${Ko}`)||document.createElement("span");m.className=Ko,m.textContent=`${u.toLocaleString(zn,{style:"currency",currency:"EUR",maximumFractionDigits:0})}`,m.style.color="#c64509",m.style.fontWeight="bold",m.style.fontSize="10px",s.append(m)}}),r.on("select",i=>{let{start:o,end:a}=i.detail;this.selectedStartDate=se.fromString(o.format("YYYY-MM-DD")),this.selectedEndDate=se.fromString(a.format("YYYY-MM-DD"));let s={startDate:o.format("YYYY-MM-DD").toString(),endDate:a.format("YYYY-MM-DD").toString()};Qt("date:changed",s)})}},e=new ia.create(t);this.instance=e,this.destroyInstance=()=>e.destroy()}initFlatpickrCalendar(){let t=document.createElement("link");t.rel="stylesheet",t.href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.css",document.head.appendChild(t);let e={mode:"range",showMonths:this.config.calendars,minDate:this.minDate.toString(),defaultDate:[this.config.defaultStartDate.toString(),this.config.defaultEndDate.toString()],shorthandCurrentMonth:!0,monthSelectorType:"static",inline:!1,dateFormat:Ru,lang:document.documentElement.lang,zIndex:10,disable:this.disabledDates,onChange:i=>{if(i.length===2){this.selectedStartDate=se.fromJSDate(i[0]),this.selectedEndDate=se.fromJSDate(i[1]);let o={startDate:this.selectedStartDate.toString(),endDate:this.selectedEndDate.toString()};Qt("date:changed",o);let a=Sn("label",this.dateInputEl);if(a){let s=this.formatDate(i[0]),l=this.formatDate(i[1]);a.textContent=`${s} - ${l}`}}else Wn()},onDayCreate:async(i,o,a,s)=>{let l=s.dateObj,u=se.fromJSDate(l),m=se.formatForAPI(u);if(this.prices[m]){let f=this.prices[m],y=document.createElement("span");y.style.marginTop="2px",y.style.color="#c64509",y.style.fontSize="10px",y.style.fontWeight="bold",y.className=Ko,y.textContent=`${f.toLocaleString(zn,{style:"currency",currency:"EUR",maximumFractionDigits:0})}`,s.style.display="flex",s.style.flexDirection="column",s.style.alignItems="center",s.style.justifyContent="center",s.style.lineHeight="1.1",s.appendChild(y)}}},r=rd(this.dateInputEl,e);this.instance=r,this.destroyInstance=()=>r.destroy()}destroy(){window.removeEventListener("resize",this.handleResize),this.destroyInstance&&this.destroyInstance()}formatDate(t){let e=se.fromJSDate(t),r=e.year,i=String(e.month).padStart(2,"0"),o=String(e.day).padStart(2,"0");return zn==="en-US"?`${r}/${i}/${o}`:zn==="fr-FR"||zn==="de-DE"?`${o}/${i}/${r}`:`${r}/${i}/${o}`}};var ma=class{constructor(t,e=Au){this.fsListInstance=t;this.includePrices=e;j(this,"element");j(this,"form");j(this,"apartmentInputEl");j(this,"dateInputEl");j(this,"guestsInputEl");j(this,"couponInputEl");j(this,"submitButtonEl");j(this,"onSubmitCallback");j(this,"calendarInstance");j(this,"cmsAparthotels",[]);j(this,"datedPrices",{});j(this,"populateApartmentsInput",()=>{if(!this.apartmentInputEl||!this.fsListInstance)return;let t=document.createDocumentFragment(),e=this.apartmentInputEl.querySelector("option");e&&t.appendChild(e),this.cmsAparthotels.forEach(r=>{let i=document.createElement("option");i.value=r.id,i.textContent=r.title,t.appendChild(i)}),this.apartmentInputEl.replaceChildren(t),hr(this.apartmentInputEl,"change",async r=>{let i=r.target,o=Ur(i);Qt("apartment:changed",o)})});j(this,"populateCalendarInput",async t=>{if(!this.dateInputEl)return;this.dateInputEl.style.cursor="pointer";let e=new ha(this.dateInputEl,{type:"flatpickr",showPrices:!0,defaultReservationDays:3,grid:2,calendars:2,darkMode:!1,tooltip:!0,repick:!1,minDays:1});if(e.setMinimumDate(Ki),e.setMaximumDate(Zo),e.includePrices(this.includePrices),this.includePrices){let r=await Ju(this.cmsAparthotels.map(i=>i.id).filter(i=>i!==t||t==null));e.setPrices(r)}return e.initialize(),e});j(this,"populateGuestsInput",()=>{if(!this.guestsInputEl)return;let t=document.createDocumentFragment(),e=this.guestsInputEl.querySelector("option");e&&t.appendChild(e);for(let r=1;r<=Lu;r++){let i=document.createElement("option");i.value=r.toString(),i.textContent=r.toString(),t.appendChild(i)}this.guestsInputEl.replaceChildren(t),hr(this.guestsInputEl,"change",async r=>{let i=r.target,o=Ur(i);Qt("guests:changed",o)})});if(In("loading:start",r=>Qs(!0,r)),In("loading:end",r=>Qs(!1,r)),this.element=Sn("booking-component"),!this.element)throw new Error("Booking component not found");this.form=this.element.querySelector("form"),this.apartmentInputEl=Sn("location-input",this.element),this.dateInputEl=Sn("date-input",this.element),this.guestsInputEl=Sn("guests-input",this.element),this.couponInputEl=Sn("coupon-input",this.element),this.submitButtonEl=Sn("submit",this.element),this.onSubmitCallback=Wn,this.cmsAparthotels=this.fsListInstance.items.value.map(r=>({id:r.fields["enterprise-id"].value,title:r.fields.title.value})),In("apartment:changed",async r=>{r.length===0?Ke.enterpriseId=null:Ke.enterpriseId=r,this.calendarInstance&&Ke.enterpriseId&&await this.updateCalendarForSelectedApartment(Ke.enterpriseId)}),In("date:changed",async r=>{Ke.startDate=r.startDate,Ke.endDate=r.endDate}),In("guests:changed",async r=>{Ke.guests=parseInt(r)}),In("coupon:changed",async r=>{Ke.coupon=r}),In(["apartment:changed","date:changed","guests:changed","coupon:changed"],async()=>{this.fsListInstance.triggerHook("filter")})}async init(){Qt("loading:start",this.element),Ke.enterpriseId=null,Ke.startDate=null,Ke.endDate=null,Ke.guests=1,Ke.coupon=null;try{return this.initSubmitButton(),this.apartmentInputEl&&this.populateApartmentsInput(),this.dateInputEl&&(this.calendarInstance=await this.populateCalendarInput(),this.fsListInstance.addHook("filter",async t=>{if(t.length===1){this.calendarInstance?.destroy?.();let e=Ke.enterpriseId||void 0;this.calendarInstance=await this.populateCalendarInput(e)}return t})),this.guestsInputEl&&this.populateGuestsInput(),this.couponInputEl&&hr(this.couponInputEl,"change",async t=>{let e=t.target,r=Ur(e);Qt("coupon:changed",r)}),this}catch(t){throw t instanceof Error?console.error("Error initializing BookingComponent",t.name):console.error("Error initializing BookingComponent",t),t}}updateRedirectUrl(){!this.submitButtonEl||!this.fsListInstance||(this.fsListInstance.renderedItems.size===1?this.submitButtonEl.href=this.fsListInstance.renderedItems.values().next().value?.href||"#":this.submitButtonEl.href="#")}initSubmitButton(){this.submitButtonEl&&(this.fsListInstance.addHook("filter",()=>{this.updateRedirectUrl()}),hr(this.submitButtonEl,"click",()=>{if(this.fsListInstance.renderedItems.size!==1||!Ke.enterpriseId){alert(Ou.missingApparthotel.fr);return}}))}async updateCalendarForSelectedApartment(t){if(this.dateInputEl)try{this.calendarInstance&&(this.calendarInstance.destroy?.(),this.calendarInstance=void 0),this.calendarInstance=await this.populateCalendarInput(t)}catch(e){console.error("Error updating calendar for selected apartment:",e)}}};function dm(n){let t=n.find(r=>r.instance==="apartments");if(!t){console.error("No apartments list instance found");return}new ma(t).init().then(r=>Qt("loading:end",r?.element)).catch(r=>{throw Yu(!0,void 0),console.error("Error initializing booking component:",r),r})}window.FinsweetAttributes=window.FinsweetAttributes||[];window.FinsweetAttributes.push(["list",async n=>{dm(n)}]);})();
8
+ /*! Bundled license information:
9
+
10
+ @vue/shared/dist/shared.esm-bundler.js:
11
+ (**
12
+ * @vue/shared v3.5.14
13
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
14
+ * @license MIT
15
+ **)
16
+ (*! #__NO_SIDE_EFFECTS__ *)
17
+
18
+ @vue/reactivity/dist/reactivity.esm-bundler.js:
19
+ (**
20
+ * @vue/reactivity v3.5.14
21
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
22
+ * @license MIT
23
+ **)
24
+ */