@influence-society-web/yuna-frontend 1.0.10 → 1.0.11
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.
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var H,c=!0,d=!1;return{s:function(){Y=Y.call(B)},n:function(){var v=Y.next();return c=v.done,v},e:function(v){d=!0,H=v},f:function(){try{c||Y.return==null||Y.return()}finally{if(d)throw H}}}}function p(B){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(z){return z.__proto__||Object.getPrototypeOf(z)},p(B)}function y(B,z){if(typeof z!="function"&&z!==null)throw new TypeError("Super expression must either be null or a function");B.prototype=Object.create(z&&z.prototype,{constructor:{value:B,writable:!0,configurable:!0}}),Object.defineProperty(B,"prototype",{writable:!1}),z&&G(B,z)}function D(B){try{return Function.toString.call(B).indexOf("[native code]")!==-1}catch{return typeof B=="function"}}function T(){try{var B=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(T=function(){return!!B})()}function
|
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $(B,z){if(z&&(typeof z=="object"||typeof z=="function"))return z;if(z!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return i(B)}function G(B,z){return G=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Y,ae){return Y.__proto__=ae,Y},G(B,z)}function W(B,z){return r(B)||S(B,z)||Ce(B,z)||N()}function ne(B,z){if(typeof B!="object"||!B)return B;var Y=B[Symbol.toPrimitive];if(Y!==void 0){var ae=Y.call(B,z||"default");if(typeof ae!="object")return ae;throw new TypeError("@@toPrimitive must return a primitive value.")}return(z==="string"?String:Number)(B)}function le(B){var z=ne(B,"string");return typeof z=="symbol"?z:z+""}function oe(B){"@babel/helpers - typeof";return oe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(z){return typeof z}:function(z){return z&&typeof Symbol=="function"&&z.constructor===Symbol&&z!==Symbol.prototype?"symbol":typeof z},oe(B)}function Ce(B,z){if(B){if(typeof B=="string")return e(B,z);var Y={}.toString.call(B).slice(8,-1);return Y==="Object"&&B.constructor&&(Y=B.constructor.name),Y==="Map"||Y==="Set"?Array.from(B):Y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Y)?e(B,z):void 0}}function Te(B){var z=typeof Map=="function"?new Map:void 0;return Te=function(Y){function ae(){return s(Y,arguments,p(this).constructor)}if(Y===null||!D(Y))return Y;if(typeof Y!="function")throw new TypeError("Super expression must either be null or a function");if(z!==void 0){if(z.has(Y))return z.get(Y);z.set(Y,ae)}return ae.prototype=Object.create(Y.prototype,{constructor:{value:ae,enumerable:!1,writable:!0,configurable:!0}}),G(ae,Y)},Te(B)}var se=function(B){var z=Math.abs,Y=Math.max,ae=Math.floor;function g(H,c){var d;if(a(this,g),d=o(this,g,[H]),d.sign=c,Object.setPrototypeOf(d,g.prototype),H>g.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return d}return y(g,B),u(g,[{key:"toDebugString",value:function(){var c,d=["BigInt["],v=h(this);try{for(v.s();!(c=v.n()).done;){var E=c.value;d.push((E&&(E>>>0).toString(16))+", ")}}catch(w){v.e(w)}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 E=32767&c,w=c>>>15,_=0,I=d,P=0;P<v;P++){var j=this.__digit(P),O=32767&j,X=j>>>15,re=g.__imul(O,E),Z=g.__imul(O,w),V=g.__imul(X,E),ue=g.__imul(X,w),pe=I+re+_;_=pe>>>30,pe&=1073741823,pe+=((32767&Z)<<15)+((32767&V)<<15),_+=pe>>>30,I=ue+(Z>>>15)+(V>>>15),this.__setDigit(P,1073741823&pe)}if(_!==0||I!==0)throw new Error("implementation bug")}},{key:"__inplaceAdd",value:function(c,d,v){for(var E,w=0,_=0;_<v;_++)E=this.__halfDigit(d+_)+c.__halfDigit(_)+w,w=E>>>15,this.__setHalfDigit(d+_,32767&E);return w}},{key:"__inplaceSub",value:function(c,d,v){var E=v-1>>>1,w=0;if(1&d){d>>=1;for(var _=this.__digit(d),I=32767&_,P=0;P<E;P++){var j=c.__digit(P),O=(_>>>15)-(32767&j)-w;w=1&O>>>15,this.__setDigit(d+P,(32767&O)<<15|32767&I),_=this.__digit(d+P+1),I=(32767&_)-(j>>>15)-w,w=1&I>>>15}var X=c.__digit(P),re=(_>>>15)-(32767&X)-w;w=1&re>>>15,this.__setDigit(d+P,(32767&re)<<15|32767&I);var Z=X>>>15;if(d+P+1>=this.length)throw new RangeError("out of bounds");!(1&v)&&(_=this.__digit(d+P+1),I=(32767&_)-Z-w,w=1&I>>>15,this.__setDigit(d+c.length,1073709056&_|32767&I))}else{d>>=1;for(var V=0;V<c.length-1;V++){var ue=this.__digit(d+V),pe=c.__digit(V),we=(32767&ue)-(32767&pe)-w;w=1&we>>>15;var _e=(ue>>>15)-(pe>>>15)-w;w=1&_e>>>15,this.__setDigit(d+V,(32767&_e)<<15|32767&we)}var Oe=this.__digit(d+V),Ve=c.__digit(V),ot=(32767&Oe)-(32767&Ve)-w;w=1&ot>>>15;var Xt=0;!(1&v)&&(Xt=(Oe>>>15)-(Ve>>>15)-w,w=1&Xt>>>15),this.__setDigit(d+V,(32767&Xt)<<15|32767&ot)}return w}},{key:"__inplaceRightShift",value:function(c){if(c!==0){for(var d,v=this.__digit(0)>>>c,E=this.length-1,w=0;w<E;w++)d=this.__digit(w+1),this.__setDigit(w,1073741823&d<<30-c|v),v=d>>>c;this.__setDigit(E,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,E=this.__digit(v),w=1&c?32767&E|d<<15:1073709056&E|32767&d;this.__setDigit(v,w)}}],[{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)||ae(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(oe(c)==="object"){if(c.constructor===g)return c;var E=g.__toPrimitive(c);return g.BigInt(E)}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 E=c.__digit(d-1),w=g.__clz30(E),_=30*d-w;if(1024<_)return c.sign?-1/0:1/0;var I=_-1,P=E,j=d-1,O=w+3,X=O===32?0:P<<O;X>>>=12;var re=O-12,Z=12<=O?0:P<<20+O,V=20+O;for(0<re&&0<j&&(j--,P=c.__digit(j),X|=P>>>30-re,Z=P<<re+2,V=re+2);0<V&&0<j;)j--,P=c.__digit(j),Z|=30<=V?P<<V-30:P>>>30-V,V-=30;var ue=g.__decideRounding(c,V,j,P);if((ue===1||ue===0&&(1&Z)==1)&&(Z=Z+1>>>0,Z===0&&(X++,X>>>20!=0&&(X=0,I++,1023<I))))return c.sign?-1/0:1/0;var pe=c.sign?-2147483648:0;return I=I+1023<<20,g.__kBitConversionInts[g.__kBitConversionIntHigh]=pe|I|X,g.__kBitConversionInts[g.__kBitConversionIntLow]=Z,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 E=1+(0|v/30),w=c.sign&&(1&v)!=0,_=new g(E,w);_.__initializeDigits();var I=1<<v%30;return _.__setDigit(E-1,I),_}var P=null,j=c;for(1&v&&(P=c),v>>=1;v!==0;v>>=1)j=g.multiply(j,j),1&v&&(P===null?P=j:P=g.multiply(P,j));return P}},{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 E=new g(v,c.sign!==d.sign);E.__initializeDigits();for(var w=0;w<c.length;w++)g.__multiplyAccumulate(d,c.__digit(w),E,w);return E.__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,E=c.sign!==d.sign,w=d.__unsignedDigit(0);if(d.length===1&&32767>=w){if(w===1)return E===c.sign?c:g.unaryMinus(c);v=g.__absoluteDivSmall(c,w,null)}else v=g.__absoluteDivLarge(c,d,!0,!1);return v.sign=E,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 E=g.__absoluteModSmall(c,v);return E===0?g.__zero():g.__oneDigit(E,c.sign)}var w=g.__absoluteDivLarge(c,d,!1,!0);return w.sign=c.sign,w.__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=Y(c.length,d.length)+1,E=g.__absoluteSubOne(c,v),w=g.__absoluteSubOne(d);return E=g.__absoluteOr(E,w,E),g.__absoluteAddOne(E,!0,E).__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=Y(c.length,d.length),E=g.__absoluteSubOne(c,v),w=g.__absoluteSubOne(d);return g.__absoluteXor(E,w,E).__trim()}var _=Y(c.length,d.length)+1;if(c.sign){var I=[d,c];c=I[0],d=I[1]}var P=g.__absoluteSubOne(d,_);return P=g.__absoluteXor(P,c,P),g.__absoluteAddOne(P,!0,P).__trim()}},{key:"bitwiseOr",value:function(c,d){var v=Y(c.length,d.length);if(!c.sign&&!d.sign)return g.__absoluteOr(c,d).__trim();if(c.sign&&d.sign){var E=g.__absoluteSubOne(c,v),w=g.__absoluteSubOne(d);return E=g.__absoluteAnd(E,w,E),g.__absoluteAddOne(E,!0,E).__trim()}if(c.sign){var _=[d,c];c=_[0],d=_[1]}var I=g.__absoluteSubOne(d,v);return I=g.__absoluteAndNot(I,c,I),g.__absoluteAddOne(I,!0,I).__trim()}},{key:"asIntN",value:function(c,d){if(d.length===0)return d;if(c=ae(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 E=d.__unsignedDigit(v-1),w=1<<(c-1)%30;if(d.length===v&&E<w)return d;var _=(E&w)===w;if(!_)return g.__truncateToNBits(c,d);if(!d.sign)return g.__truncateAndSubFromPowerOfTwo(c,d,!0);if(!(E&w-1)){for(var I=v-2;0<=I;I--)if(d.__digit(I)!==0)return g.__truncateAndSubFromPowerOfTwo(c,d,!1);return d.length===v&&E===w?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=ae(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 E=c%30;if(d.length==v){if(E===0)return d;var w=d.__digit(v-1);if(!(w>>>E))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(oe(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(oe(d)!=="object")return c==d;d=g.__toPrimitive(d)}else if(typeof c=="boolean"){if(g.__isBigInt(d))return g.__equalToNumber(d,+c);if(oe(d)!=="object")return c==d;d=g.__toPrimitive(d)}else if(oe(c)==="symbol"){if(g.__isBigInt(d))return!1;if(oe(d)!=="object")return c==d;d=g.__toPrimitive(d)}else if(oe(c)==="object"){if(oe(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],E=v?[4,0]:[0,4],w=W(E,2),_=w[0],I=w[1],P=c.getUint32(d+_,v),j=c.getUint32(d+I,v),O=new g(3,!1);return O.__setDigit(0,1073741823&j),O.__setDigit(1,(268435455&P)<<2|j>>>30),O.__setDigit(2,P>>>28),O.__trim()}},{key:"DataViewSetBigInt64",value:function(c,d,v){var E=3<arguments.length&&arguments[3]!==void 0&&arguments[3];g.DataViewSetBigUint64(c,d,v,E)}},{key:"DataViewSetBigUint64",value:function(c,d,v){var E=3<arguments.length&&arguments[3]!==void 0&&arguments[3];v=g.asUintN(64,v);var w=0,_=0;if(0<v.length&&(_=v.__digit(0),1<v.length)){var I=v.__digit(1);_|=I<<30,w=I>>>2,2<v.length&&(w|=v.__digit(2)<<28)}var P=E?[4,0]:[0,4],j=W(P,2),O=j[0],X=j[1];c.setUint32(d+O,w,E),c.setUint32(d+X,_,E)}},{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,E){if(0<d)return-1;var w;if(0>d)w=-d-1;else{if(v===0)return-1;v--,E=c.__digit(v),w=29}var _=1<<w;if(!(E&_))return-1;if(_-=1,(E&_)!=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,E=2047&g.__kBitConversionInts[g.__kBitConversionIntHigh]>>>20,w=E-1023,_=(0|w/30)+1,I=new g(_,d),P=1048576,j=1048575&g.__kBitConversionInts[g.__kBitConversionIntHigh]|P,O=g.__kBitConversionInts[g.__kBitConversionIntLow],X=20,re=w%30,Z=0;if(re<X){var V=X-re;Z=V+32,v=j>>>V,j=j<<32-V|O>>>V,O<<=32-V}else if(re===X)Z=32,v=j,j=O,O=0;else{var ue=re-X;Z=32-ue,v=j<<ue|O>>>32-ue,j=O<<ue,O=0}I.__setDigit(_-1,v);for(var pe=_-2;0<=pe;pe--)0<Z?(Z-=30,v=j>>>2,j=j<<30|O>>>2,O<<=30):v=0,I.__setDigit(pe,v);return I.__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,E=c.length,w=0;if(w===E)return g.__zero();for(var _=c.charCodeAt(w);g.__isWhitespace(_);){if(++w===E)return g.__zero();_=c.charCodeAt(w)}if(_===43){if(++w===E)return null;_=c.charCodeAt(w),v=1}else if(_===45){if(++w===E)return null;_=c.charCodeAt(w),v=-1}if(d===0){if(d=10,_===48){if(++w===E)return g.__zero();if(_=c.charCodeAt(w),_===88||_===120){if(d=16,++w===E)return null;_=c.charCodeAt(w)}else if(_===79||_===111){if(d=8,++w===E)return null;_=c.charCodeAt(w)}else if(_===66||_===98){if(d=2,++w===E)return null;_=c.charCodeAt(w)}}}else if(d===16&&_===48){if(++w===E)return g.__zero();if(_=c.charCodeAt(w),_===88||_===120){if(++w===E)return null;_=c.charCodeAt(w)}}if(v!==0&&d!==10)return null;for(;_===48;){if(++w===E)return g.__zero();_=c.charCodeAt(w)}var I=E-w,P=g.__kMaxBitsPerChar[d],j=g.__kBitsPerCharTableMultiplier-1;if(I>1073741824/P)return null;var O=P*I+j>>>g.__kBitsPerCharTableShift,X=0|(O+29)/30,re=new g(X,!1),Z=10>d?d:10,V=10<d?d-10:0;if(d&d-1){re.__initializeDigits();var ot=!1,Xt=0;do{for(var sr,Yn=0,ii=1;;){if(sr=void 0,_-48>>>0<Z)sr=_-48;else if((32|_)-97>>>0<V)sr=(32|_)-87;else{ot=!0;break}var bo=ii*d;if(1073741823<bo)break;if(ii=bo,Yn=Yn*d+sr,Xt++,++w===E){ot=!0;break}_=c.charCodeAt(w)}j=30*g.__kBitsPerCharTableMultiplier-1;var wo=0|(P*Xt+j>>>g.__kBitsPerCharTableShift)/30;re.__inplaceMultiplyAdd(ii,Yn,wo)}while(!ot)}else{P>>=g.__kBitsPerCharTableShift;var ue=[],pe=[],we=!1;do{for(var _e,Oe=0,Ve=0;;){if(_e=void 0,_-48>>>0<Z)_e=_-48;else if((32|_)-97>>>0<V)_e=(32|_)-87;else{we=!0;break}if(Ve+=P,Oe=Oe<<P|_e,++w===E){we=!0;break}if(_=c.charCodeAt(w),30<Ve+P)break}ue.push(Oe),pe.push(Ve)}while(!we);g.__fillFromParts(re,ue,pe)}if(w!==E){if(!g.__isWhitespace(_))return null;for(w++;w<E;w++)if(_=c.charCodeAt(w),!g.__isWhitespace(_))return null}return re.sign=v===-1,re.__trim()}},{key:"__fillFromParts",value:function(c,d,v){for(var E=0,w=0,_=0,I=d.length-1;0<=I;I--){var P=d[I],j=v[I];w|=P<<_,_+=j,_===30?(c.__setDigit(E++,w),_=0,w=0):30<_&&(c.__setDigit(E++,1073741823&w),_-=30,w=P>>>j-_)}if(w!==0){if(E>=c.length)throw new Error("implementation bug");c.__setDigit(E++,w)}for(;E<c.length;E++)c.__setDigit(E,0)}},{key:"__toStringBasePowerOfTwo",value:function(c,d){var v=c.length,E=d-1;E=(85&E>>>1)+(85&E),E=(51&E>>>2)+(51&E),E=(15&E>>>4)+(15&E);var w=E,_=d-1,I=c.__digit(v-1),P=g.__clz30(I),j=30*v-P,O=0|(j+w-1)/w;if(c.sign&&O++,268435456<O)throw new Error("string too long");for(var X=Array(O),re=O-1,Z=0,V=0,ue=0;ue<v-1;ue++){var pe=c.__digit(ue),we=(Z|pe<<V)&_;X[re--]=g.__kConversionChars[we];var _e=w-V;for(Z=pe>>>_e,V=30-_e;V>=w;)X[re--]=g.__kConversionChars[Z&_],Z>>>=w,V-=w}var Oe=(Z|I<<V)&_;for(X[re--]=g.__kConversionChars[Oe],Z=I>>>w-V;Z!==0;)X[re--]=g.__kConversionChars[Z&_],Z>>>=w;if(c.sign&&(X[re--]="-"),re!==-1)throw new Error("implementation bug");return X.join("")}},{key:"__toStringGeneric",value:function(c,d,v){var E=c.length;if(E===0)return"";if(E===1){var w=c.__unsignedDigit(0).toString(d);return v===!1&&c.sign&&(w="-"+w),w}var _=30*E-g.__clz30(c.__digit(E-1)),I=g.__kMaxBitsPerChar[d],P=I-1,j=_*g.__kBitsPerCharTableMultiplier;j+=P-1,j=0|j/P;var O,X,re=j+1>>1,Z=g.exponentiate(g.__oneDigit(d,!1),g.__oneDigit(re,!1)),V=Z.__unsignedDigit(0);if(Z.length===1&&32767>=V){O=new g(c.length,!1),O.__initializeDigits();for(var ue,pe=0,we=2*c.length-1;0<=we;we--)ue=pe<<15|c.__halfDigit(we),O.__setHalfDigit(we,0|ue/V),pe=0|ue%V;X=pe.toString(d)}else{var _e=g.__absoluteDivLarge(c,Z,!0,!0);O=_e.quotient;var Oe=_e.remainder.__trim();X=g.__toStringGeneric(Oe,d,!0)}O.__trim();for(var Ve=g.__toStringGeneric(O,d,!0);X.length<re;)X="0"+X;return v===!1&&c.sign&&(Ve="-"+Ve),Ve+X}},{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 E=g.__absoluteCompare(c,d);return 0<E?g.__absoluteGreater(v):0>E?g.__absoluteLess(v):0}},{key:"__compareToNumber",value:function(c,d){if(g.__isOneDigitInt(d)){var v=c.sign,E=0>d;if(v!==E)return g.__unequalSign(v);if(c.length===0){if(E)throw new Error("implementation bug");return d===0?0:-1}if(1<c.length)return g.__absoluteGreater(v);var w=z(d),_=c.__unsignedDigit(0);return _>w?g.__absoluteGreater(v):_<w?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,E=0>d;if(v!==E)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 w=2047&g.__kBitConversionInts[g.__kBitConversionIntHigh]>>>20;if(w==2047)throw new Error("implementation bug: handled elsewhere");var _=w-1023;if(0>_)return g.__absoluteGreater(v);var I=c.length,P=c.__digit(I-1),j=g.__clz30(P),O=30*I-j,X=_+1;if(O<X)return g.__absoluteLess(v);if(O>X)return g.__absoluteGreater(v);var re=1048576,Z=1048576|1048575&g.__kBitConversionInts[g.__kBitConversionIntHigh],V=g.__kBitConversionInts[g.__kBitConversionIntLow],ue=20,pe=29-j;if(pe!==(0|(O-1)%30))throw new Error("implementation bug");var we,_e=0;if(pe<ue){var Oe=ue-pe;_e=Oe+32,we=Z>>>Oe,Z=Z<<32-Oe|V>>>Oe,V<<=32-Oe}else if(pe===ue)_e=32,we=Z,Z=V,V=0;else{var Ve=pe-ue;_e=32-Ve,we=Z<<Ve|V>>>32-Ve,Z=V<<Ve,V=0}if(P>>>=0,we>>>=0,P>we)return g.__absoluteGreater(v);if(P<we)return g.__absoluteLess(v);for(var ot=I-2;0<=ot;ot--){0<_e?(_e-=30,we=Z>>>2,Z=Z<<30|V>>>2,V<<=30):we=0;var Xt=c.__unsignedDigit(ot);if(Xt>we)return g.__absoluteGreater(v);if(Xt<we)return g.__absoluteLess(v)}if(Z!==0||V!==0){if(_e===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)===z(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 E=c.length;(c.__clzmsd()===0||d.length===c.length&&d.__clzmsd()===0)&&E++;for(var w,_=new g(E,v),I=0,P=0;P<d.length;P++)w=c.__digit(P)+d.__digit(P)+I,I=w>>>30,_.__setDigit(P,1073741823&w);for(;P<c.length;P++){var j=c.__digit(P)+I;I=j>>>30,_.__setDigit(P,1073741823&j)}return P<_.length&&_.__setDigit(P,I),_.__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 E,w=new g(c.length,v),_=0,I=0;I<d.length;I++)E=c.__digit(I)-d.__digit(I)-_,_=1&E>>>30,w.__setDigit(I,1073741823&E);for(;I<c.length;I++){var P=c.__digit(I)-_;_=1&P>>>30,w.__setDigit(I,1073741823&P)}return w.__trim()}},{key:"__absoluteAddOne",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,E=c.length;v===null?v=new g(E,d):v.sign=d;for(var w,_=1,I=0;I<E;I++)w=c.__digit(I)+_,_=w>>>30,v.__setDigit(I,1073741823&w);return _!==0&&v.__setDigitGrow(E,1),v}},{key:"__absoluteSubOne",value:function(c,d){var v=c.length;d=d||v;for(var E,w=new g(d,!1),_=1,I=0;I<v;I++)E=c.__digit(I)-_,_=1&E>>>30,w.__setDigit(I,1073741823&E);if(_!==0)throw new Error("implementation bug");for(var P=v;P<d;P++)w.__setDigit(P,0);return w}},{key:"__absoluteAnd",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,E=c.length,w=d.length,_=w;if(E<w){_=E;var I=c,P=E;c=d,E=w,d=I,w=P}var j=_;v===null?v=new g(j,!1):j=v.length;for(var O=0;O<_;O++)v.__setDigit(O,c.__digit(O)&d.__digit(O));for(;O<j;O++)v.__setDigit(O,0);return v}},{key:"__absoluteAndNot",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,E=c.length,w=d.length,_=w;E<w&&(_=E);var I=E;v===null?v=new g(I,!1):I=v.length;for(var P=0;P<_;P++)v.__setDigit(P,c.__digit(P)&~d.__digit(P));for(;P<E;P++)v.__setDigit(P,c.__digit(P));for(;P<I;P++)v.__setDigit(P,0);return v}},{key:"__absoluteOr",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,E=c.length,w=d.length,_=w;if(E<w){_=E;var I=c,P=E;c=d,E=w,d=I,w=P}var j=E;v===null?v=new g(j,!1):j=v.length;for(var O=0;O<_;O++)v.__setDigit(O,c.__digit(O)|d.__digit(O));for(;O<E;O++)v.__setDigit(O,c.__digit(O));for(;O<j;O++)v.__setDigit(O,0);return v}},{key:"__absoluteXor",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,E=c.length,w=d.length,_=w;if(E<w){_=E;var I=c,P=E;c=d,E=w,d=I,w=P}var j=E;v===null?v=new g(j,!1):j=v.length;for(var O=0;O<_;O++)v.__setDigit(O,c.__digit(O)^d.__digit(O));for(;O<E;O++)v.__setDigit(O,c.__digit(O));for(;O<j;O++)v.__setDigit(O,0);return v}},{key:"__absoluteCompare",value:function(c,d){var v=c.length-d.length;if(v!=0)return v;for(var E=c.length-1;0<=E&&c.__digit(E)===d.__digit(E);)E--;return 0>E?0:c.__unsignedDigit(E)>d.__unsignedDigit(E)?1:-1}},{key:"__multiplyAccumulate",value:function(c,d,v,E){if(d!==0){for(var w=32767&d,_=d>>>15,I=0,P=0,j=0;j<c.length;j++,E++){var O=v.__digit(E),X=c.__digit(j),re=32767&X,Z=X>>>15,V=g.__imul(re,w),ue=g.__imul(re,_),pe=g.__imul(Z,w),we=g.__imul(Z,_);O+=P+V+I,I=O>>>30,O&=1073741823,O+=((32767&ue)<<15)+((32767&pe)<<15),I+=O>>>30,P=we+(ue>>>15)+(pe>>>15),v.__setDigit(E,1073741823&O)}for(;I!==0||P!==0;E++){var _e=v.__digit(E);_e+=I+P,P=0,I=_e>>>30,v.__setDigit(E,1073741823&_e)}}}},{key:"__internalMultiplyAdd",value:function(c,d,v,E,w){for(var _=v,I=0,P=0;P<E;P++){var j=c.__digit(P),O=g.__imul(32767&j,d),X=g.__imul(j>>>15,d),re=O+((32767&X)<<15)+I+_;_=re>>>30,I=X>>>15,w.__setDigit(P,1073741823&re)}if(w.length>E)for(w.__setDigit(E++,_+I);E<w.length;)w.__setDigit(E++,0);else if(_+I!==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 E=0,w=2*c.length-1;0<=w;w-=2){var _=(E<<15|c.__halfDigit(w))>>>0,I=0|_/d;E=0|_%d,_=(E<<15|c.__halfDigit(w-1))>>>0;var P=0|_/d;E=0|_%d,v.__setDigit(w>>>1,I<<15|P)}return v}},{key:"__absoluteModSmall",value:function(c,d){for(var v,E=0,w=2*c.length-1;0<=w;w--)v=(E<<15|c.__halfDigit(w))>>>0,E=0|v%d;return E}},{key:"__absoluteDivLarge",value:function(c,d,v,E){var w=d.__halfDigitLength(),_=d.length,I=c.__halfDigitLength()-w,P=null;v&&(P=new g(I+2>>>1,!1),P.__initializeDigits());var j=new g(w+2>>>1,!1);j.__initializeDigits();var O=g.__clz15(d.__halfDigit(w-1));0<O&&(d=g.__specialLeftShift(d,O,0));for(var X=g.__specialLeftShift(c,O,1),re=d.__halfDigit(w-1),Z=0,V=I;0<=V;V--){var ue=32767,pe=X.__halfDigit(V+w);if(pe!==re){var we=(pe<<15|X.__halfDigit(V+w-1))>>>0;ue=0|we/re;for(var _e=0|we%re,Oe=d.__halfDigit(w-2),Ve=X.__halfDigit(V+w-2);g.__imul(ue,Oe)>>>0>(_e<<16|Ve)>>>0&&(ue--,_e+=re,!(32767<_e)););}g.__internalMultiplyAdd(d,ue,0,_,j);var ot=X.__inplaceSub(j,V,w+1);ot!==0&&(ot=X.__inplaceAdd(d,V,w),X.__setHalfDigit(V+w,32767&X.__halfDigit(V+w)+ot),ue--),v&&(1&V?Z=ue<<15:P.__setDigit(V>>>1,Z|ue))}if(E)return X.__inplaceRightShift(O),v?{quotient:P,remainder:X}:X;if(v)return P;throw new Error("unreachable")}},{key:"__clz15",value:function(c){return g.__clz30(c)-15}},{key:"__specialLeftShift",value:function(c,d,v){var E=c.length,w=E+v,_=new g(w,!1);if(d===0){for(var I=0;I<E;I++)_.__setDigit(I,c.__digit(I));return 0<v&&_.__setDigit(E,0),_}for(var P,j=0,O=0;O<E;O++)P=c.__digit(O),_.__setDigit(O,1073741823&P<<d|j),j=P>>>30-d;return 0<v&&_.__setDigit(E,j),_}},{key:"__leftShiftByAbsolute",value:function(c,d){var v=g.__toShiftAmount(d);if(0>v)throw new RangeError("BigInt too big");var E=0|v/30,w=v%30,_=c.length,I=w!==0&&c.__digit(_-1)>>>30-w!=0,P=_+E+(I?1:0),j=new g(P,c.sign);if(w===0){for(var O=0;O<E;O++)j.__setDigit(O,0);for(;O<P;O++)j.__setDigit(O,c.__digit(O-E))}else{for(var X=0,re=0;re<E;re++)j.__setDigit(re,0);for(var Z,V=0;V<_;V++)Z=c.__digit(V),j.__setDigit(V+E,1073741823&Z<<w|X),X=Z>>>30-w;if(I)j.__setDigit(_+E,X);else if(X!==0)throw new Error("implementation bug")}return j.__trim()}},{key:"__rightShiftByAbsolute",value:function(c,d){var v=c.length,E=c.sign,w=g.__toShiftAmount(d);if(0>w)return g.__rightShiftByMaximum(E);var _=0|w/30,I=w%30,P=v-_;if(0>=P)return g.__rightShiftByMaximum(E);var j=!1;if(E){var O=(1<<I)-1;if(c.__digit(_)&O)j=!0;else for(var X=0;X<_;X++)if(c.__digit(X)!==0){j=!0;break}}if(j&&I===0){var re=c.__digit(v-1),Z=~re==0;Z&&P++}var V=new g(P,E);if(I===0){V.__setDigit(P-1,0);for(var ue=_;ue<v;ue++)V.__setDigit(ue-_,c.__digit(ue))}else{for(var pe,we=c.__digit(_)>>>I,_e=v-_-1,Oe=0;Oe<_e;Oe++)pe=c.__digit(Oe+_+1),V.__setDigit(Oe,1073741823&pe<<30-I|we),we=pe>>>I;V.__setDigit(_e,we)}return j&&(V=g.__absoluteAddOne(V,!0,V)),V.__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(oe(c)!=="object"||c.constructor===g)return c;if(typeof Symbol<"u"&&oe(Symbol.toPrimitive)==="symbol"&&c[Symbol.toPrimitive]){var v=c[Symbol.toPrimitive](d);if(oe(v)!=="object")return v;throw new TypeError("Cannot convert object to primitive value")}var E=c.valueOf;if(E){var w=E.call(c);if(oe(w)!=="object")return w}var _=c.toString;if(_){var I=_.call(c);if(oe(I)!=="object")return I}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 oe(c)==="object"&&c!==null&&c.constructor===g}},{key:"__truncateToNBits",value:function(c,d){for(var v=0|(c+29)/30,E=new g(v,d.sign),w=v-1,_=0;_<w;_++)E.__setDigit(_,d.__digit(_));var I=d.__digit(w);if(c%30!=0){var P=32-c%30;I=I<<P>>>P}return E.__setDigit(w,I),E.__trim()}},{key:"__truncateAndSubFromPowerOfTwo",value:function(c,d,v){for(var E=Math.min,w,_=0|(c+29)/30,I=new g(_,v),P=0,j=_-1,O=0,X=E(j,d.length);P<X;P++)w=0-d.__digit(P)-O,O=1&w>>>30,I.__setDigit(P,1073741823&w);for(;P<j;P++)I.__setDigit(P,0|1073741823&-O);var re,Z=j<d.length?d.__digit(j):0,V=c%30;if(V===0)re=0-Z-O,re&=1073741823;else{var ue=32-V;Z=Z<<ue>>>ue;var pe=1<<32-ue;re=pe-Z-O,re&=pe-1}return I.__setDigit(j,re),I.__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}}])}(Te(Array));return se.__kMaxLength=33554432,se.__kMaxLengthBits=se.__kMaxLength<<5,se.__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],se.__kBitsPerCharTableShift=5,se.__kBitsPerCharTableMultiplier=1<<se.__kBitsPerCharTableShift,se.__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"],se.__kBitConversionBuffer=new ArrayBuffer(8),se.__kBitConversionDouble=new Float64Array(se.__kBitConversionBuffer),se.__kBitConversionInts=new Int32Array(se.__kBitConversionBuffer),se.__kBitConversionIntHigh=se.__detectBigEndian()?0:1,se.__kBitConversionIntLow=se.__detectBigEndian()?1:0,se.__clz30=t?function(B){return t(B)-2}:function(B){var z=Math.LN2,Y=Math.log;return B===0?30:0|29-(0|Y(B>>>0)/z)},se.__imul=n||function(B,z){return 0|B*z},se})});var qu=Uc((pp,Vu)=>{Vu.exports=km;function km(n,t,e,r){var i,o,a;return function(){if(a=this,o=Array.prototype.slice.call(arguments),i&&(e||r))return;if(!e)return u(),i=setTimeout(l,t),i;i=setTimeout(u,t),n.apply(a,o);function l(){u(),n.apply(a,o)}function u(){clearTimeout(i),i=null}}}});var k=Vc(Wc(),1),Wt=k.default.BigInt(0),_i=k.default.BigInt(1),Hs=k.default.BigInt(2),gh=k.default.BigInt(10),yh=k.default.BigInt(24),vh=k.default.BigInt(60),bh=k.default.BigInt(1e3),$i=k.default.BigInt(1e6),yi=k.default.BigInt(1e9),kl=k.default.multiply(k.default.BigInt(3600),yi),wh=k.default.multiply(vh,yi),Wn=k.default.multiply(kl,yh);function Mn(n){return typeof n=="bigint"?k.default.BigInt(n.toString(10)):n}function Pl(n){return k.default.equal(k.default.remainder(n,Hs),Wt)}function cr(n){return k.default.lessThan(n,Wt)?k.default.unaryMinus(n):n}function So(n,t){return k.default.lessThan(n,t)?-1:k.default.greaterThan(n,t)?1:0}function li(n,t){return{quotient:k.default.divide(n,t),remainder:k.default.remainder(n,t)}}var Gc,Kc,he="slot-epochNanoSeconds",me="slot-iso-date",He="slot-iso-date-time",$e="slot-time",U="slot-calendar",Il="slot-date-brand",Rl="slot-year-month-brand",xl="slot-month-day-brand",ke="slot-time-zone",gt="slot-years",yt="slot-months",At="slot-weeks",vt="slot-days",bt="slot-hours",wt="slot-minutes",Dt="slot-seconds",Et="slot-milliseconds",_t="slot-microseconds",Lt="slot-nanoseconds",Al="date",Ll="ym",Nl="md",Ol="time",Hl="datetime",Bl="instant",br="original",Pr="timezone-canonical",Ja="timezone-original",ui="calendar-id",Fl="locale",Xa="options",Yl=new WeakMap,Qa=Symbol.for("@@Temporal__GetSlots");(Gc=globalThis)[Qa]||(Gc[Qa]=function(n){return Yl.get(n)});var jo=globalThis[Qa],es=Symbol.for("@@Temporal__CreateSlots");(Kc=globalThis)[es]||(Kc[es]=function(n){Yl.set(n,Object.create(null))});var Nn=globalThis[es];function kt(n,...t){if(!n||typeof n!="object")return!1;let e=jo(n);return!!e&&t.every(r=>r in e)}function m(n,t){let e=jo(n)?.[t];if(e===void 0)throw new TypeError(`Missing internal slot ${t}`);return e}function ve(n,t,e){let r=jo(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 ts={};function On(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))}ns(t,n),ns(`${t}.prototype`,n.prototype)}function ns(n,t){let e=`%${n}%`;if(ts[e]!==void 0)throw new Error(`intrinsic ${n} already exists`);ts[e]=t}function rt(n){return ts[n]}function Rr(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 qa(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 zo(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 Uo(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 Pe=class n{constructor(t){this.totalNs=Mn(t),this.sec=k.default.toNumber(k.default.divide(this.totalNs,yi)),this.subsec=k.default.toNumber(k.default.remainder(this.totalNs,yi))}static validateNew(t,e){if(k.default.greaterThan(cr(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),bh)),k.default.multiply(k.default.BigInt(i),$i)),k.default.multiply(k.default.BigInt(r),yi)),k.default.multiply(k.default.BigInt(e),wh)),k.default.multiply(k.default.BigInt(t),kl));return n.validateNew(s,"total")}abs(){return new n(cr(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),Wn)),"sum")}addToEpochNs(t){return k.default.add(Mn(t),this.totalNs)}cmp(t){return So(this.totalNs,t.totalNs)}divmod(t){let{quotient:e,remainder:r}=li(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}=li(this.totalNs,r),a=[],s,l=(k.default.lessThan(this.totalNs,Wt)?-1:1)*Math.sign(k.default.toNumber(e));for(;!k.default.equal(o,Wt)&&a.length<50;)o=k.default.multiply(o,gh),{quotient:s,remainder:o}=li(o,r),a.push(Math.abs(k.default.toNumber(s)));return l*+(cr(i).toString()+"."+a.join(""))}isZero(){return k.default.equal(this.totalNs,Wt)}round(t,e){let r=Mn(t);if(k.default.equal(r,_i))return this;let{quotient:i,remainder:o}=li(this.totalNs,r),a=k.default.lessThan(this.totalNs,Wt)?"negative":"positive",s=k.default.multiply(cr(i),r),l=k.default.add(s,r),u=So(cr(k.default.multiply(o,Hs)),r),h=zo(e,a),p=k.default.equal(cr(this.totalNs),s)?s:Uo(s,l,u,Pl(i),h),y=a==="positive"?p:k.default.unaryMinus(p);return n.validateNew(y,"rounding")}sign(){return this.cmp(new n(Wt))}subtract(t){return n.validateNew(k.default.subtract(this.totalNs,t.totalNs),"difference")}};Pe.MAX=k.default.BigInt("9007199254740991999999999"),Pe.ZERO=new Pe(Wt);var Zc=/[A-Za-z._][A-Za-z._0-9+-]*/,ji=new RegExp(`(?:${/(?:[+-](?:[01][0-9]|2[0-3])(?::?[0-5][0-9])?)/.source}|(?:${Zc.source})(?:\\/(?:${Zc.source}))*)`),$l=/(?:[+-]\d{6}|\d{4})/,Co=/(?:0[1-9]|1[0-2])/,rs=/(?:0[1-9]|[12]\d|3[01])/,Dh=new RegExp(`(${$l.source})(?:-(${Co.source})-(${rs.source})|(${Co.source})(${rs.source}))`),jl=/(\d{2})(?::(\d{2})(?::(\d{2})(?:[.,](\d{1,9}))?)?|(\d{2})(?:(\d{2})(?:[.,](\d{1,9}))?)?)?/,zl=/((?:[+-])(?:[01][0-9]|2[0-3])(?::?(?:[0-5][0-9])(?::?(?:[0-5][0-9])(?:[.,](?:\d{1,9}))?)?)?)/,Ul=new RegExp(`([zZ])|${zl.source}?`),Nr=/\[(!)?([a-z_][a-z0-9_-]*)=([A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)\]/g,Eh=new RegExp([`^${Dh.source}`,`(?:(?:[tT]|\\s+)${jl.source}(?:${Ul.source})?)?`,`(?:\\[!?(${ji.source})\\])?`,`((?:${Nr.source})*)$`].join("")),_h=new RegExp([`^[tT]?${jl.source}`,`(?:${Ul.source})?`,`(?:\\[!?${ji.source}\\])?`,`((?:${Nr.source})*)$`].join("")),Mh=new RegExp(`^(${$l.source})-?(${Co.source})(?:\\[!?${ji.source}\\])?((?:${Nr.source})*)$`),Th=new RegExp(`^(?:--)?(${Co.source})-?(${rs.source})(?:\\[!?${ji.source}\\])?((?:${Nr.source})*)$`),Wa=/(\d+)(?:[.,](\d{1,9}))?/,Sh=new RegExp(`(?:${Wa.source}H)?(?:${Wa.source}M)?(?:${Wa.source}S)?`),Ch=new RegExp(`^([+-])?P${/(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/.source}(?:T(?!$)${Sh.source})?$`,"i"),Gn=864e5,ko=1e6*Gn,kh=6e10,Vl=1e8*Gn,Or=cn(Vl),Mi=k.default.unaryMinus(Or),Ph=k.default.add(k.default.subtract(Mi,Wn),_i),Ih=k.default.subtract(k.default.add(Or,Wn),_i),Rh=146097*Gn,Jc=-271821,Xc=275760,vi=Date.UTC(1847,0,1),xh=["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"],Ah=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 je(n){return typeof n=="object"&&n!==null||typeof n=="function"}function Vo(n){if(typeof n=="bigint")throw new TypeError("Cannot convert BigInt to number");return Number(n)}function qo(n){if(typeof n=="symbol")throw new TypeError("Cannot convert a Symbol value to a String");return String(n)}function fe(n){let t=Vo(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 Qc(n,t){let e=fe(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 an(n){let t=Vo(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 Ti(n,t){return String(n).padStart(t,"0")}function Ge(n){if(typeof n!="string")throw new TypeError(`expected a string, not ${String(n)}`);return n}function is(n,t){if(je(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 os=["era","eraYear","year","month","monthCode","day","hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],Lh={era:qo,eraYear:fe,year:fe,month:Qc,monthCode:function(n){let t=Ge(is(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:Qc,hour:fe,minute:fe,second:fe,millisecond:fe,microsecond:fe,nanosecond:fe,offset:function(n){let t=Ge(is(n));return Vr(t),t},timeZone:St},Nh={hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},Hr=[["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"]],el=Object.fromEntries(Hr.map(n=>[n[0],n[1]])),Oh=Object.fromEntries(Hr.map(([n,t])=>[t,n])),bi=Hr.map(([,n])=>n),Br={day:ko,hour:36e11,minute:6e10,second:1e9,millisecond:1e6,microsecond:1e3,nanosecond:1},Po=["days","hours","microseconds","milliseconds","minutes","months","nanoseconds","seconds","weeks","years"],Hh=Intl.DateTimeFormat,tl=new Map;function ql(n){let t=Ii(n),e=tl.get(t);return e===void 0&&(e=new Hh("en-us",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),tl.set(t,e)),e}function et(n){return kt(n,he)&&!kt(n,ke,U)}function Fe(n){return kt(n,gt,yt,vt,bt,wt,Dt,Et,_t,Lt)}function Ye(n){return kt(n,Il)}function Ue(n){return kt(n,$e)}function xe(n){return kt(n,He)}function tt(n){return kt(n,Rl)}function qt(n){return kt(n,xl)}function be(n){return kt(n,he,ke,U)}function R(n,t){if(!t(n))throw new TypeError("invalid receiver: method called with the wrong type of this-object")}function jr(n){if(kt(n,U)||kt(n,ke))throw new TypeError("with() does not support a calendar or timeZone property");if(Ue(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 zi(n,t){return t==="never"||t==="auto"&&n==="iso8601"?"":`[${t==="critical"?"!":""}u-ca=${n}]`}function Wo(n){let t,e,r=!1;for(Nr.lastIndex=0;e=Nr.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 wn(n){let t=Eh.exec(n);if(!t)throw new RangeError(`invalid RFC 9557 string: ${n}`);let e=Wo(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),h=+(t[8]??t[11]??0);h===60&&(h=59);let p=(t[9]??t[12]??"")+"000000000",y=+p.slice(0,3),D=+p.slice(3,6),T=+p.slice(6,9),S,N=!1;t[13]?(S=void 0,N=!0):t[14]&&(S=t[14]);let $=t[15];return zs(i,o,a,l,u,h,y,D,T),{year:i,month:o,day:a,time:s?{hour:l,minute:u,second:h,millisecond:y,microsecond:D,nanosecond:T}:"start-of-day",tzAnnotation:$,offset:S,z:N,calendar:e}}function Wl(n){let t=_h.exec(n),e,r,i,o,a,s,l;if(t){l=Wo(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,h;if({time:u,z:h,calendar:l}=wn(n),u==="start-of-day")throw new RangeError(`time is missing in string: ${n}`);if(h)throw new RangeError("Z designator not supported for PlainTime");({hour:e,minute:r,second:i,millisecond:o,microsecond:a,nanosecond:s}=u)}if(Jo(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:h}=Fs(n);mr(1972,u,h)}catch{try{let{year:u,month:h}=Bs(n);mr(u,h,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 Bs(n){let t=Mh.exec(n),e,r,i,o;if(t){i=Wo(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}=wn(n),a)throw new RangeError("Z designator not supported for PlainYearMonth")}return{year:e,month:r,calendar:i,referenceISODay:o}}function Fs(n){let t=Th.exec(n),e,r,i,o;if(t){if(i=Wo(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}=wn(n),a)throw new RangeError("Z designator not supported for PlainMonthDay")}return{month:e,day:r,calendar:i,referenceISOYear:o}}var Gl=new RegExp(`^${ji.source}$`,"i"),Kl=new RegExp(`^${/([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])?)?/.source}$`);function Zl(n){let t=Fh.test(n)?"Seconds not allowed in offset time zone":"Invalid time zone";throw new RangeError(`${t}: ${n}`)}function qn(n){return Gl.test(n)||Zl(n),Kl.test(n)?{offsetMinutes:Vr(n)/6e10}:{tzName:n}}function wi(n,t,e,r){let i=n,o=t,a=e;switch(r){case"reject":mr(i,o,a);break;case"constrain":({year:i,month:o,day:a}=mu(i,o,a))}return{year:i,month:o,day:a}}function Go(n,t,e,r,i,o,a){let s=n,l=t,u=e,h=r,p=i,y=o;switch(a){case"reject":Jo(s,l,u,h,p,y);break;case"constrain":s=Mt(s,0,23),l=Mt(l,0,59),u=Mt(u,0,59),h=Mt(h,0,999),p=Mt(p,0,999),y=Mt(y,0,999)}return{hour:s,minute:l,second:u,millisecond:h,microsecond:p,nanosecond:y}}function Jl(n){if(!je(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<Po.length;r++){let i=Po[r],o=n[i];o!==void 0&&(e=!0,t[i]=an(o))}if(!e)throw new TypeError("invalid duration-like");return t}function st({years:n,months:t,weeks:e,days:r},i,o,a){return{years:n,months:a??t,weeks:o??e,days:i??r}}function Me(n,t){return{isoDate:n,time:t}}function Ee(n){return Rn(n,"overflow",["constrain","reject"],"constrain")}function Di(n){return Rn(n,"disambiguation",["compatible","earlier","later","reject"],"compatible")}function ln(n,t){return Rn(n,"roundingMode",["ceil","floor","expand","trunc","halfCeil","halfFloor","halfExpand","halfTrunc","halfEven"],t)}function To(n,t){return Rn(n,"offset",["prefer","use","ignore","reject"],t)}function Ui(n){return Rn(n,"calendarName",["auto","always","never","critical"],"auto")}function zr(n){let t=n.roundingIncrement;if(t===void 0)return 1;let e=fe(t);if(e<1||e>1e9)throw new RangeError(`roundingIncrement must be at least 1 and at most 1e9, not ${t}`);return e}function Ur(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 Vi(n){let t=n.fractionalSecondDigits;if(t===void 0)return"auto";if(typeof t!="number"){if(qo(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 qi(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 An=Symbol("~required~");function Ot(n,t,e,r,i=[]){let o=[];for(let u=0;u<Hr.length;u++){let h=Hr[u],p=h[1],y=h[2];e!=="datetime"&&e!==y||o.push(p)}o=o.concat(i);let a=r;a===An?a=void 0:a!==void 0&&o.push(a);let s=[];s=s.concat(o);for(let u=0;u<o.length;u++){let h=o[u],p=Oh[h];p!==void 0&&s.push(p)}let l=Rn(n,t,s,a);if(l===void 0&&r===An)throw new RangeError(`${t} is required`);return l&&l in el?el[l]:l}function Ga(n){let t=n.relativeTo;if(t===void 0)return{};let e,r,i,o,a,s="option",l=!1;if(je(t)){if(be(t))return{zonedRelativeTo:t};if(Ye(t))return{plainRelativeTo:t};if(xe(t))return{plainRelativeTo:Tt(m(t,He).isoDate,m(t,U))};i=Ji(t);let u=Jt(i,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],[]);({isoDate:e,time:r}=Gi(i,u,"constrain")),{offset:a,timeZone:o}=u,a===void 0&&(s="wall")}else{let u,h,p,y,D;if({year:p,month:y,day:D,time:r,calendar:i,tzAnnotation:u,offset:a,z:h}=wn(Ge(t)),u)o=St(u),h?s="exact":a||(s="wall"),l=!0;else if(h)throw new RangeError("Z designator not supported for PlainDate relativeTo; either remove the Z or add a bracketed time zone");i||(i="iso8601"),i=Pt(i),e={year:p,month:y,day:D}}return o===void 0?{plainRelativeTo:Tt(e,i)}:{zonedRelativeTo:at(Io(e,r,s,s==="option"?Vr(a):0,o,"compatible","reject",l),o,i)}}function Tn(n){return m(n,gt)!==0?"year":m(n,yt)!==0?"month":m(n,At)!==0?"week":m(n,vt)!==0?"day":m(n,bt)!==0?"hour":m(n,wt)!==0?"minute":m(n,Dt)!==0?"second":m(n,Et)!==0?"millisecond":m(n,_t)!==0?"microsecond":"nanosecond"}function Pn(n,t){return bi.indexOf(n)>bi.indexOf(t)?t:n}function mn(n){return n==="year"||n==="month"||n==="week"}function Sn(n){return mn(n)||n==="day"?"date":"time"}function Jn(n){return rt("%calendarImpl%")(n)}function Wi(n){return rt("%calendarImpl%")(m(n,U))}function Ct(n,t,e="date"){let r=Object.create(null),i=Jn(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 Jt(n,t,e,r,i){let o=Jn(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 h=a[u],p=t[h];if(p!==void 0)l=!0,s[h]=(0,Lh[h])(p);else if(i!=="partial"){if(i.includes(h))throw new TypeError(`required property '${h}' missing or undefined`);s[h]=Nh[h]}}if(i==="partial"&&!l)throw new TypeError("no supported properties found");return s}function as(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]=fe(s),r=!0):t==="complete"&&(i[a]=0)}if(!r)throw new TypeError("invalid time-like");return i}function di(n,t){if(je(n)){if(Ye(n))return Ee(ie(t)),Tt(m(n,me),m(n,U));if(be(n)){let l=nn(m(n,ke),m(n,he));return Ee(ie(t)),Tt(l.isoDate,m(n,U))}if(xe(n))return Ee(ie(t)),Tt(m(n,He).isoDate,m(n,U));let s=Ji(n);return Tt(Kn(s,Jt(s,n,["year","month","monthCode","day"],[],[]),Ee(ie(t))),s)}let{year:e,month:r,day:i,calendar:o,z:a}=wn(Ge(n));if(a)throw new RangeError("Z designator not supported for PlainDate");return o||(o="iso8601"),o=Pt(o),Ee(ie(t)),Tt({year:e,month:r,day:i},o)}function Gi(n,t,e){return Me(Kn(n,t,e),Go(t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond,e))}function hi(n,t){let e,r,i;if(je(n)){if(xe(n))return Ee(ie(t)),Qt(m(n,He),m(n,U));if(be(n)){let s=nn(m(n,ke),m(n,he));return Ee(ie(t)),Qt(s,m(n,U))}if(Ye(n))return Ee(ie(t)),Qt(Me(m(n,me),{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),m(n,U));i=Ji(n);let o=Jt(i,n,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond"],[]),a=Ee(ie(t));({isoDate:e,time:r}=Gi(i,o,a))}else{let o,a,s,l;if({year:a,month:s,day:l,time:r,calendar:i,z:o}=wn(Ge(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}),zs(a,s,l,r.hour,r.minute,r.second,r.millisecond,r.microsecond,r.nanosecond),i||(i="iso8601"),i=Pt(i),Ee(ie(t)),e={year:a,month:s,day:l}}return Qt(Me(e,r),i)}function tn(n){let t=rt("%Temporal.Duration%");if(Fe(n))return new t(m(n,gt),m(n,yt),m(n,At),m(n,vt),m(n,bt),m(n,wt),m(n,Dt),m(n,Et),m(n,_t),m(n,Lt));if(!je(n))return function(i){let{years:o,months:a,weeks:s,days:l,hours:u,minutes:h,seconds:p,milliseconds:y,microseconds:D,nanoseconds:T}=function(S){let N=Ch.exec(S);if(!N)throw new RangeError(`invalid duration: ${S}`);if(N.every((v,E)=>E<2||v===void 0))throw new RangeError(`invalid duration: ${S}`);let $=N[1]==="-"?-1:1,G=N[2]===void 0?0:fe(N[2])*$,W=N[3]===void 0?0:fe(N[3])*$,ne=N[4]===void 0?0:fe(N[4])*$,le=N[5]===void 0?0:fe(N[5])*$,oe=N[6]===void 0?0:fe(N[6])*$,Ce=N[7],Te=N[8],se=N[9],B=N[10],z=N[11],Y=0,ae=0,g=0;if(Ce!==void 0){if(Te??se??B??z)throw new RangeError("only the smallest unit can be fractional");g=3600*fe((Ce+"000000000").slice(0,9))*$}else if(Y=Te===void 0?0:fe(Te)*$,se!==void 0){if(B??z)throw new RangeError("only the smallest unit can be fractional");g=60*fe((se+"000000000").slice(0,9))*$}else ae=B===void 0?0:fe(B)*$,z!==void 0&&(g=fe((z+"000000000").slice(0,9))*$);let H=g%1e3,c=Math.trunc(g/1e3)%1e3,d=Math.trunc(g/1e6)%1e3;return ae+=Math.trunc(g/1e9)%60,Y+=Math.trunc(g/6e10),Xo(G,W,ne,le,oe,Y,ae,d,c,H),{years:G,months:W,weeks:ne,days:le,hours:oe,minutes:Y,seconds:ae,milliseconds:d,microseconds:c,nanoseconds:H}}(i);return new(rt("%Temporal.Duration%"))(o,a,s,l,u,h,p,y,D,T)}(Ge(n));let e={years:0,months:0,weeks:0,days:0,hours:0,minutes:0,seconds:0,milliseconds:0,microseconds:0,nanoseconds:0},r=Jl(n);for(let i=0;i<Po.length;i++){let o=Po[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 mi(n){let t;if(je(n)){if(et(n)||be(n))return sn(m(n,he));t=is(n)}else t=n;let{year:e,month:r,day:i,time:o,offset:a,z:s}=function(S){let N=wn(S);if(!N.z&&!N.offset)throw new RangeError("Temporal.Instant requires a time zone offset");return N}(Ge(t)),{hour:l=0,minute:u=0,second:h=0,millisecond:p=0,microsecond:y=0,nanosecond:D=0}=o==="start-of-day"?{}:o,T=Pi(e,r,i,l,u,h,p,y,D-(s?0:Vr(a)));return Lr(T.isoDate),sn(nt(T))}function nl(n,t){if(je(n)){if(qt(n))return Ee(ie(t)),xr(m(n,me),m(n,U));let s;return kt(n,U)?s=m(n,U):(s=n.calendar,s===void 0&&(s="iso8601"),s=Zi(s)),xr(Ro(s,Jt(s,n,["year","month","monthCode","day"],[],[]),Ee(ie(t))),s)}let{month:e,day:r,referenceISOYear:i,calendar:o}=Fs(Ge(n));if(o===void 0&&(o="iso8601"),o=Pt(o),Ee(ie(t)),o==="iso8601")return xr({year:1972,month:e,day:r},o);let a={year:i,month:e,day:r};return wr(a),a=Ro(o,Ct(o,a,"month-day"),"constrain"),xr(a,o)}function Un(n,t){let e;if(je(n)){if(Ue(n))return Ee(ie(t)),Cn(m(n,$e));if(xe(n))return Ee(ie(t)),Cn(m(n,He).time);if(be(n)){let u=nn(m(n,ke),m(n,he));return Ee(ie(t)),Cn(u.time)}let{hour:r,minute:i,second:o,millisecond:a,microsecond:s,nanosecond:l}=as(n);e=Go(r,i,o,a,s,l,Ee(ie(t)))}else e=Wl(Ge(n)),Ee(ie(t));return Cn(e)}function Xl(n){return n===void 0?{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}:m(Un(n),$e)}function pi(n,t){if(je(n)){if(tt(n))return Ee(ie(t)),Ar(m(n,me),m(n,U));let s=Ji(n);return Ar(Si(s,Jt(s,n,["year","month","monthCode"],[],[]),Ee(ie(t))),s)}let{year:e,month:r,referenceISODay:i,calendar:o}=Bs(Ge(n));o===void 0&&(o="iso8601"),o=Pt(o),Ee(ie(t));let a={year:e,month:r,day:i};return Us(a),a=Si(o,Ct(o,a,"year-month"),"constrain"),Ar(a,o)}function Io(n,t,e,r,i,o,a,s){if(t==="start-of-day")return jn(i,n);let l=Me(n,t);if(e==="wall"||a==="ignore")return ct(i,l,o);if(e==="exact"||a==="use"){let p=Pi(n.year,n.month,n.day,t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond-r);Lr(p.isoDate);let y=nt(p);return vn(y),y}Lr(n);let u=nt(l),h=Ci(i,l);for(let p=0;p<h.length;p++){let y=h[p],D=k.default.toNumber(k.default.subtract(u,y)),T=Vn(D,6e10,"halfExpand");if(D===r||s&&T===r)return y}if(a==="reject"){let p=ss(r),y=ki(l,"iso8601","auto");throw new RangeError(`Offset ${p} is invalid for ${y} in ${i}`)}return su(h,i,l,o)}function fi(n,t){let e,r,i,o,a,s,l,u=!1,h="option";if(je(n)){if(be(n)){let S=ie(t);return Di(S),To(S,"reject"),Ee(S),at(m(n,he),m(n,ke),m(n,U))}a=Ji(n);let y=Jt(a,n,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],["timeZone"]);({offset:o,timeZone:i}=y),o===void 0&&(h="wall");let D=ie(t);s=Di(D),l=To(D,"reject");let T=Ee(D);({isoDate:e,time:r}=Gi(a,y,T))}else{let y,D,T,S,N;({year:T,month:S,day:N,time:r,tzAnnotation:y,offset:o,z:D,calendar:a}=function(G){let W=wn(G);if(!W.tzAnnotation)throw new RangeError("Temporal.ZonedDateTime requires a time zone ID in brackets");return W}(Ge(n))),i=St(y),D?h="exact":o||(h="wall"),a||(a="iso8601"),a=Pt(a),u=!0;let $=ie(t);s=Di($),l=To($,"reject"),Ee($),e={year:T,month:S,day:N}}let p=0;return h==="option"&&(p=Vr(o)),at(Io(e,r,h,p,i,s,l,u),i,a)}function Ql(n,t,e){wr(t),Nn(n),ve(n,me,t),ve(n,U,e),ve(n,Il,!0)}function Tt(n,t){let e=rt("%Temporal.PlainDate%"),r=Object.create(e.prototype);return Ql(r,n,t),r}function eu(n,t,e){pr(t),Nn(n),ve(n,He,t),ve(n,U,e)}function Qt(n,t){let e=rt("%Temporal.PlainDateTime%"),r=Object.create(e.prototype);return eu(r,n,t),r}function tu(n,t,e){wr(t),Nn(n),ve(n,me,t),ve(n,U,e),ve(n,xl,!0)}function xr(n,t){let e=rt("%Temporal.PlainMonthDay%"),r=Object.create(e.prototype);return tu(r,n,t),r}function nu(n,t){Nn(n),ve(n,$e,t)}function Cn(n){let t=rt("%Temporal.PlainTime%"),e=Object.create(t.prototype);return nu(e,n),e}function ru(n,t,e){Us(t),Nn(n),ve(n,me,t),ve(n,U,e),ve(n,Rl,!0)}function Ar(n,t){let e=rt("%Temporal.PlainYearMonth%"),r=Object.create(e.prototype);return ru(r,n,t),r}function iu(n,t){vn(t),Nn(n),ve(n,he,t)}function sn(n){let t=rt("%Temporal.Instant%"),e=Object.create(t.prototype);return iu(e,n),e}function ou(n,t,e,r){vn(t),Nn(n),ve(n,he,t),ve(n,ke,e),ve(n,U,r)}function at(n,t,e="iso8601"){let r=rt("%Temporal.ZonedDateTime%"),i=Object.create(r.prototype);return ou(i,n,t,e),i}function rl(n){return os.filter(t=>n[t]!==void 0)}function hr(n,t,e){let r=rl(e),i=Jn(n).fieldKeysToIgnore(r),o=Object.create(null),a=rl(t);for(let s=0;s<os.length;s++){let l,u=os[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 Kt(n,t,e,r){let i=Jn(n).dateAdd(t,e,r);return wr(i),i}function Ki(n,t,e,r){return Jn(n).dateUntil(t,e,r)}function Zi(n){if(je(n)&&kt(n,U))return m(n,U);let t=Ge(n);try{return Pt(t)}catch{}let e;try{({calendar:e}=wn(t))}catch{try{({calendar:e}=Wl(t))}catch{try{({calendar:e}=Bs(t))}catch{({calendar:e}=Fs(t))}}}return e||(e="iso8601"),Pt(e)}function Ji(n){if(kt(n,U))return m(n,U);let{calendar:t}=n;return t===void 0?"iso8601":Zi(t)}function yn(n,t){return Pt(n)===Pt(t)}function Kn(n,t,e){let r=Jn(n);r.resolveFields(t,"date");let i=r.dateToISO(t,e);return wr(i),i}function Si(n,t,e){let r=Jn(n);r.resolveFields(t,"year-month"),t.day=1;let i=r.dateToISO(t,e);return Us(i),i}function Ro(n,t,e){let r=Jn(n);r.resolveFields(t,"month-day");let i=r.monthDayToISOReferenceDate(t,e);return wr(i),i}function St(n){if(je(n)&&be(n))return m(n,ke);let t=Ge(n);if(t==="UTC")return"UTC";let{tzName:e,offsetMinutes:r}=function(o){let{tzAnnotation:a,offset:s,z:l}=function(u){if(Gl.test(u))return{tzAnnotation:u,offset:void 0,z:!1};try{let{tzAnnotation:h,offset:p,z:y}=wn(u);if(y||h||p)return{tzAnnotation:h,offset:p,z:y}}catch{}Zl(u)}(o);return a?qn(a):l?qn("UTC"):s?qn(s):void 0}(t);if(r!==void 0)return Ys(r);let i=xo(e);if(!i)throw new RangeError(`Unrecognized time zone ${e}`);return i.identifier}function au(n,t){if(n===t)return!0;let e=qn(n).offsetMinutes,r=qn(t).offsetMinutes;if(e===void 0&&r===void 0){let i=xo(t);if(!i)return!1;let o=xo(n);return!!o&&o.primaryIdentifier===i.primaryIdentifier}return e===r}function kn(n,t){let e=qn(n).offsetMinutes;return e!==void 0?6e10*e:cs(n,t)}function ss(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}${Ko(r,i,o,a,o===0&&a===0?"minute":"auto")}`}function nn(n,t){let e=kn(n,t),{isoDate:{year:r,month:i,day:o},time:{hour:a,minute:s,second:l,millisecond:u,microsecond:h,nanosecond:p}}=uu(t);return Pi(r,i,o,a,s,l,u,h,p+e)}function ct(n,t,e){return su(Ci(n,t),n,t,e)}function su(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=nt(e),a=k.default.subtract(o,Wn);vn(a);let s=kn(t,a),l=k.default.add(o,Wn);vn(l);let u=kn(t,l)-s;switch(r){case"earlier":{let h=Pe.fromComponents(0,0,0,0,0,-u),p=Fr(e.time,h);return Ci(t,Me(Ht(e.isoDate.year,e.isoDate.month,e.isoDate.day+p.deltaDays),p))[0]}case"compatible":case"later":{let h=Pe.fromComponents(0,0,0,0,0,u),p=Fr(e.time,h),y=Ci(t,Me(Ht(e.isoDate.year,e.isoDate.month,e.isoDate.day+p.deltaDays),p));return y[y.length-1]}}}function Ci(n,t){if(n==="UTC")return Lr(t.isoDate),[nt(t)];let e=qn(n).offsetMinutes;if(e!==void 0){let r=Pi(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);Lr(r.isoDate);let i=nt(r);return vn(i),[i]}return Lr(t.isoDate),function(r,i){let o=nt(i),a=k.default.subtract(o,Wn);k.default.lessThan(a,Mi)&&(a=o);let s=k.default.add(o,Wn);k.default.greaterThan(s,Or)&&(s=o);let l=cs(r,a),u=cs(r,s);return(l===u?[l]:[l,u]).map(p=>{let y=k.default.subtract(o,k.default.BigInt(p)),D=function(T,S){let{epochMilliseconds:N,time:{millisecond:$,microsecond:G,nanosecond:W}}=uu(S),{year:ne,month:le,day:oe,hour:Ce,minute:Te,second:se}=du(T,N);return Pi(ne,le,oe,Ce,Te,se,$,G,W)}(r,y);if(Yr(i,D)===0)return vn(y),y}).filter(p=>p!==void 0)}(n,t)}function jn(n,t){let e=Me(t,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),r=Ci(n,e);if(r.length)return r[0];let i=nt(e),o=k.default.subtract(i,Wn);return vn(o),js(n,o)}function Xi(n){let t;return t=n<0||n>9999?(n<0?"-":"+")+Ti(Math.abs(n),6):Ti(n,4),t}function Zt(n){return Ti(n,2)}function cu(n,t){let e;if(t==="auto"){if(n===0)return"";e=Ti(n,9).replace(/0+$/,"")}else{if(t===0)return"";e=Ti(n,9).slice(0,t)}return`.${e}`}function Ko(n,t,e,r,i){let o=`${Zt(n)}:${Zt(t)}`;return i==="minute"||(o+=`:${Zt(e)}`,o+=cu(r,i)),o}function il(n,t,e){let r=t;r===void 0&&(r="UTC");let i=m(n,he),o=ki(nn(r,i),"iso8601",e,"never"),a="Z";return t!==void 0&&(a=lu(kn(r,i))),`${o}${a}`}function Mo(n,t){let e=m(n,gt),r=m(n,yt),i=m(n,At),o=m(n,vt),a=m(n,bt),s=m(n,wt),l=Lo(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 h="";a!==0&&(h+=`${Math.abs(a)}H`),s!==0&&(h+=`${Math.abs(s)}M`);let p=Pe.fromComponents(0,0,m(n,Dt),m(n,Et),m(n,_t),m(n,Lt));p.isZero()&&!["second","millisecond","microsecond","nanosecond"].includes(Tn(n))&&t==="auto"||(h+=`${Math.abs(p.sec)}${cu(Math.abs(p.subsec),t)}S`);let y=`${l<0?"-":""}P${u}`;return h&&(y=`${y}T${h}`),y}function ol(n,t="auto"){let{year:e,month:r,day:i}=m(n,me);return`${Xi(e)}-${Zt(r)}-${Zt(i)}${zi(m(n,U),t)}`}function al({hour:n,minute:t,second:e,millisecond:r,microsecond:i,nanosecond:o},a){return Ko(n,t,e,1e6*r+1e3*i+o,a)}function ki(n,t,e,r="auto"){let{isoDate:{year:i,month:o,day:a},time:{hour:s,minute:l,second:u,millisecond:h,microsecond:p,nanosecond:y}}=n;return`${Xi(i)}-${Zt(o)}-${Zt(a)}T${Ko(s,l,u,1e6*h+1e3*p+y,e)}${zi(t,r)}`}function sl(n,t="auto"){let{year:e,month:r,day:i}=m(n,me),o=`${Zt(r)}-${Zt(i)}`,a=m(n,U);t!=="always"&&t!=="critical"&&a==="iso8601"||(o=`${Xi(e)}-${o}`);let s=zi(a,t);return s&&(o+=s),o}function cl(n,t="auto"){let{year:e,month:r,day:i}=m(n,me),o=`${Xi(e)}-${Zt(r)}`,a=m(n,U);t!=="always"&&t!=="critical"&&a==="iso8601"||(o+=`-${Zt(i)}`);let s=zi(a,t);return s&&(o+=s),o}function ll(n,t,e="auto",r="auto",i="auto",o=void 0){let a=m(n,he);if(o){let{unit:h,increment:p,roundingMode:y}=o;a=hs(a,p,h,y)}let s=m(n,ke),l=kn(s,a),u=ki(nn(s,a),"iso8601",t,"never");return i!=="never"&&(u+=lu(l)),r!=="never"&&(u+=`[${r==="critical"?"!":""}${s}]`),u+=zi(m(n,U),e),u}function ul(n){return Kl.test(n)}function Vr(n){let t=Yh.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 ai,Bh=Object.assign(Object.create(null),{"/":!0,"-":!0,_:!0});function xo(n){if(ai===void 0){let o=Intl.supportedValuesOf?.("timeZone");if(o){ai=new Map;for(let a=0;a<o.length;a++){let s=o[a];ai.set(Ii(s),s)}}else ai=null}let t=Ii(n),e=ai?.get(t);if(e)return{identifier:e,primaryIdentifier:e};try{e=ql(n).resolvedOptions().timeZone}catch{return}if(t==="antarctica/south_pole"&&(e="Antarctica/McMurdo"),Ah.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||Bh[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 ur(n,t){let{year:e,month:r,day:i,hour:o,minute:a,second:s}=du(n,t),l=t%1e3;return l<0&&(l+=1e3),1e6*($s({isoDate:{year:e,month:r,day:i},time:{hour:o,minute:a,second:s,millisecond:l}})-t)}function cs(n,t){return ur(n,rn(t,"floor"))}function Ys(n){let t=n<0?"-":"+",e=Math.abs(n);return`${t}${Ko(Math.floor(e/60),e%60,0,0,"minute")}`}function lu(n){return Ys(Vn(n,kh,"halfExpand")/6e10)}function $s({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()+Rh*l}function nt(n){let t=$s(n),e=1e3*n.time.microsecond+n.time.nanosecond;return k.default.add(cn(t),k.default.BigInt(e))}function uu(n){let t=rn(n,"trunc"),e=k.default.toNumber(k.default.remainder(n,$i));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 js(n,t){if(n==="UTC")return null;let e=rn(t,"floor");if(e<vi)return js(n,cn(vi));let r=Date.now(),i=Math.max(e,r)+366*Gn*3,o=e,a=ur(n,o),s=o,l=a;for(;a===l&&o<i;){if(s=o+2*Gn*7,s>Vl)return null;l=ur(n,s),a===l&&(o=s)}return a===l?null:cn(Du(u=>ur(n,u),o,s,a,l))}function ls(n,t){if(n==="UTC")return null;let e=rn(t,"ceil"),r=Date.now(),i=r+366*Gn*3;if(e>i){let u=ls(n,cn(i));if(u===null||k.default.lessThan(u,cn(r)))return u}if(n==="Africa/Casablanca"||n==="Africa/El_Aaiun"){let u=Date.UTC(2088,0,1);if(u<e)return ls(n,cn(u))}let o=e-1;if(o<vi)return null;let a=ur(n,o),s=o,l=a;for(;a===l&&o>vi;){if(s=o-2*Gn*7,s<vi)return null;l=ur(n,s),a===l&&(o=s)}return a===l?null:cn(Du(u=>ur(n,u),s,o,l,a))}function du(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],h=+r[6];if(!(Number.isFinite(a)&&Number.isFinite(i)&&Number.isFinite(o)&&Number.isFinite(l)&&Number.isFinite(u)&&Number.isFinite(h)))throw new RangeError(`Invalid number in "${e}`);return{year:a,month:i,day:o,hour:l,minute:u,second:h}}(ql(n).format(t))}function Ao(n){return n!==void 0&&!(n%4!=0||n%100==0&&n%400!=0)}function dr(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]}[Ao(n)?"leapyear":"standard"][t-1]}function Lo(n){let t=[m(n,gt),m(n,yt),m(n,At),m(n,vt),m(n,bt),m(n,wt),m(n,Dt),m(n,Et),m(n,_t),m(n,Lt)];for(let e=0;e<t.length;e++){let r=t[e];if(r!==0)return r<0?-1:1}return 0}function Zo(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 hu(n){let t=Zo(n.date);return t!==0?t:n.time.sign()}function lr(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 Ht(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}=lr(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=Ao(l)?366:365,o<-s;)r-=1,l-=1,o+=s;for(l+=1;s=Ao(l)?366:365,o>s;)r+=1,l+=1,o-=s;for(;o<1;)({year:r,month:i}=lr(r,i-1)),o+=dr(r,i);for(;o>dr(r,i);)o-=dr(r,i),{year:r,month:i}=lr(r,i+1);return{year:r,month:i,day:o}}function Pi(n,t,e,r,i,o,a,s,l){let u=zn(r,i,o,a,s,l);return Me(Ht(n,t,e+u.deltaDays),u)}function zn(n,t,e,r,i,o){let a,s=n,l=t,u=e,h=r,p=i,y=o;({div:a,mod:y}=Rr(y,3)),p+=a,y<0&&(p-=1,y+=1e3),{div:a,mod:p}=Rr(p,3),h+=a,p<0&&(h-=1,p+=1e3),u+=Math.trunc(h/1e3),h%=1e3,h<0&&(u-=1,h+=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 D=Math.trunc(s/24);return s%=24,s<0&&(D-=1,s+=24),D+=0,s+=0,l+=0,u+=0,h+=0,p+=0,y+=0,{deltaDays:D,hour:s,minute:l,second:u,millisecond:h,microsecond:p,nanosecond:y}}function dl(n,t){let e=st(n,0);if(Zo(e)===0)return n.days;let r=m(t,me),i=Kt(m(t,U),r,e,"constrain"),o=fr(r.year,r.month-1,r.day),a=fr(i.year,i.month-1,i.day)-o;return n.days+a}function Bt(n){return new(rt("%Temporal.Duration%"))(-m(n,gt),-m(n,yt),-m(n,At),-m(n,vt),-m(n,bt),-m(n,wt),-m(n,Dt),-m(n,Et),-m(n,_t),-m(n,Lt))}function Mt(n,t,e){return Math.min(e,Math.max(t,n))}function mu(n,t,e){let r=Mt(t,1,12);return{year:n,month:r,day:Mt(e,1,dr(n,r))}}function Ke(n,t,e){if(n<t||n>e)throw new RangeError(`value out of range: ${t} <= ${n} <= ${e}`)}function mr(n,t,e){Ke(t,1,12),Ke(e,1,dr(n,t))}function wr(n){pr(Me(n,{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}))}function Jo(n,t,e,r,i,o){Ke(n,0,23),Ke(t,0,59),Ke(e,0,59),Ke(r,0,999),Ke(i,0,999),Ke(o,0,999)}function zs(n,t,e,r,i,o,a,s,l){mr(n,t,e),Jo(r,i,o,a,s,l)}function pr(n){let t=nt(n);(k.default.lessThan(t,Ph)||k.default.greaterThan(t,Ih))&&vn(t)}function us(n){nt(n)}function vn(n){if(k.default.lessThan(n,Mi)||k.default.greaterThan(n,Or))throw new RangeError("date/time value is outside of supported range")}function Us({year:n,month:t}){Ke(n,Jc,Xc),n===Jc?Ke(t,4,12):n===Xc&&Ke(t,1,9)}function Xo(n,t,e,r,i,o,a,s,l,u){let h=0,p=[n,t,e,r,i,o,a,s,l,u];for(let $=0;$<p.length;$++){let G=p[$];if(G===1/0||G===-1/0)throw new RangeError("infinite values not allowed as duration fields");if(G!==0){let W=G<0?-1:1;if(h!==0&&W!==h)throw new RangeError("mixed-sign values not allowed as duration fields");h=W}}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=Rr(s,3),D=Rr(l,6),T=Rr(u,9),S=Rr(1e6*y.mod+1e3*D.mod+T.mod,9).div,N=86400*r+3600*i+60*o+a+y.div+D.div+T.div+S;if(!Number.isSafeInteger(N))throw new RangeError("total of duration time units cannot exceed 9007199254740991.999999999 s")}function Ir(n){return{date:{years:m(n,gt),months:m(n,yt),weeks:m(n,At),days:m(n,vt)},time:Pe.fromComponents(m(n,bt),m(n,wt),m(n,Dt),m(n,Et),m(n,_t),m(n,Lt))}}function fn(n){let t=Pe.fromComponents(m(n,bt),m(n,wt),m(n,Dt),m(n,Et),m(n,_t),m(n,Lt)).add24HourDays(m(n,vt));return{date:{years:m(n,gt),months:m(n,yt),weeks:m(n,At),days:0},time:t}}function pu(n){let t=fn(n),e=Math.trunc(t.time.sec/86400);return Xo(t.date.years,t.date.months,t.date.weeks,e,0,0,0,0,0,0),{...t.date,days:e}}function en(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=qa(a,3,Math.trunc(i/1e3)),i%=1e3,a=0;break;case"microsecond":i=qa(a,6,Math.trunc(r/1e3)),r%=1e3,a=0;break;case"nanosecond":r=qa(a,9,r),a=0}return new(rt("%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 In(n,t){return Zo(n),t.sign(),{date:n,time:t}}function fr(n,t,e){return $s({isoDate:{year:n,month:t+1,day:e},time:{hour:0,minute:0,second:0,millisecond:0}})/Gn}function Lr({year:n,month:t,day:e}){if(Math.abs(fr(n,t-1,e))>1e8)throw new RangeError("date/time value is outside the supported range")}function Vs(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 Pe.fromComponents(e,r,i,o,a,s)}function qs(n,t,e,r,i){let o=Pe.fromEpochNsDiff(t,n);return o=No(o,e,r,i),In({years:0,months:0,weeks:0,days:0},o)}function fu(n,t,e,r){us(n),us(t);let i=Vs(n.time,t.time),o=i.sign(),a=bn(n.isoDate,t.isoDate),s=t.isoDate;a===o&&(s=Ht(s.year,s.month,s.day+o),i=i.add24HourDays(-o));let l=Pn("day",r),u=Ki(e,n.isoDate,s,l);return r!==l&&(i=i.add24HourDays(u.days),u.days=0),In(u,i)}function gu(n,t,e,r,i){let o=k.default.subtract(t,n);if(k.default.equal(o,Wt))return{date:{years:0,months:0,weeks:0,days:0},time:Pe.ZERO};let a=k.default.lessThan(o,Wt)?-1:1,s=nn(e,n),l=nn(e,t),u,h=0,p=a===1?2:1,y=Vs(s.time,l.time);for(y.sign()===-a&&h++;h<=p;h++){u=Me(Ht(l.isoDate.year,l.isoDate.month,l.isoDate.day-h*a),s.time);let T=ct(e,u,"compatible");if(y=Pe.fromEpochNsDiff(t,T),y.sign()!==-a)break}let D=Pn("day",i);return In(Ki(r,s.isoDate,u.isoDate,D),y)}function yu(n,t,e,r,i,o,a,s,l){let u,h,p,y,D=t;switch(s){case"year":{let Y=Vn(D.date.years,a,"trunc");u=Y,h=Y+a*n,p={years:u,months:0,weeks:0,days:0},y={...p,years:h};break}case"month":{let Y=Vn(D.date.months,a,"trunc");u=Y,h=Y+a*n,p=st(D.date,0,0,u),y=st(D.date,0,0,h);break}case"week":{let Y=st(D.date,0,0),ae=Kt(o,r.isoDate,Y,"constrain"),g=Ki(o,ae,Ht(ae.year,ae.month,ae.day+D.date.days),"week"),H=Vn(D.date.weeks+g.weeks,a,"trunc");u=H,h=H+a*n,p=st(D.date,0,u),y=st(D.date,0,h);break}case"day":{let Y=Vn(D.date.days,a,"trunc");u=Y,h=Y+a*n,p=st(D.date,u),y=st(D.date,h);break}}let T=Kt(o,r.isoDate,p,"constrain"),S=Kt(o,r.isoDate,y,"constrain"),N,$,G=Me(T,r.time),W=Me(S,r.time);i?(N=ct(i,G,"compatible"),$=ct(i,W,"compatible")):(N=nt(G),$=nt(W));let ne=Pe.fromEpochNsDiff(e,N),le=Pe.fromEpochNsDiff($,N),oe=zo(l,n<0?"negative":"positive"),Ce=ne.add(ne).abs().subtract(le.abs()).sign(),Te=Math.abs(u)/a%2==0,se=ne.isZero()?Math.abs(u):ne.cmp(le)?Uo(Math.abs(u),Math.abs(h),Ce,Te,oe):Math.abs(h),B=new Pe(k.default.add(k.default.multiply(le.totalNs,k.default.BigInt(u)),k.default.multiply(ne.totalNs,k.default.BigInt(a*n)))).fdiv(le.totalNs),z=se===Math.abs(h);return D={date:z?y:p,time:Pe.ZERO},{nudgeResult:{duration:D,nudgedEpochNs:z?$:N,didExpandCalendarUnit:z},total:B}}function Qo(n,t,e,r,i,o,a,s,l){let u=n,h=mn(s)||r&&s==="day",p=hu(u)<0?-1:1,y;return h?{nudgeResult:y}=yu(p,u,t,e,r,i,a,s,l):y=r?function(D,T,S,N,$,G,W,ne){let le=T,oe=Kt($,S.isoDate,le.date,"constrain"),Ce=Me(oe,S.time),Te=Me(Ht(oe.year,oe.month,oe.day+D),S.time),se=ct(N,Ce,"compatible"),B=ct(N,Te,"compatible"),z=Pe.fromEpochNsDiff(B,se);if(z.sign()!==D)throw new RangeError("time zone returned inconsistent Instants");let Y=k.default.BigInt(Br[W]*G),ae=le.time.round(Y,ne),g=ae.subtract(z),H=g.sign()!==-D,c,d;return H?(c=D,ae=g.round(Y,ne),d=ae.addToEpochNs(B)):(c=0,d=ae.addToEpochNs(se)),{duration:In(st(le.date,le.date.days+c),ae),nudgedEpochNs:d,didExpandCalendarUnit:H}}(p,u,e,r,i,a,s,l):function(D,T,S,N,$,G){let W=D,ne=W.time.add24HourDays(W.date.days),le=ne.round(k.default.BigInt(N*Br[$]),G),oe=le.subtract(ne),{quotient:Ce}=ne.divmod(ko),{quotient:Te}=le.divmod(ko),se=Math.sign(Te-Ce)===ne.sign(),B=oe.addToEpochNs(T),z=0,Y=le;return Sn(S)==="date"&&(z=Te,Y=le.add(Pe.fromComponents(24*-Te,0,0,0,0,0))),{duration:{date:st(W.date,z),time:Y},nudgedEpochNs:B,didExpandCalendarUnit:se}}(u,t,o,a,s,l),u=y.duration,y.didExpandCalendarUnit&&s!=="week"&&(u=function(D,T,S,N,$,G,W,ne){let le=T;if(ne===W)return le;let oe=bi.indexOf(W);for(let Ce=bi.indexOf(ne)-1;Ce>=oe;Ce--){let Te=bi[Ce];if(Te==="week"&&W!=="week")continue;let se;switch(Te){case"year":se={years:le.date.years+D,months:0,weeks:0,days:0};break;case"month":{let Y=le.date.months+D;se=st(le.date,0,0,Y);break}case"week":{let Y=le.date.weeks+D;se=st(le.date,0,Y);break}}let B=Me(Kt(G,N.isoDate,se,"constrain"),N.time),z;if(z=$?ct($,B,"compatible"):nt(B),So(S,z)===-D)break;le={date:se,time:Pe.ZERO}}return le}(p,u,y.nudgedEpochNs,e,r,i,o,Pn(s,"day"))),u}function hl(n,t,e,r,i,o){return mn(o)||r&&o==="day"?yu(hu(n)<0?-1:1,n,t,e,r,i,1,o,"trunc").total:Ei(n.time.add24HourDays(n.date.days),o)}function vu(n,t,e,r,i,o,a){if(Yr(n,t)==0)return{date:{years:0,months:0,weeks:0,days:0},time:Pe.ZERO};pr(n),pr(t);let s=fu(n,t,e,r);return o==="nanosecond"&&i===1?s:Qo(s,nt(t),n,null,e,r,i,o,a)}function bu(n,t,e,r,i,o,a,s){if(Sn(i)==="time")return qs(n,t,o,a,s);let l=gu(n,t,e,r,i);return a==="nanosecond"&&o===1?l:Qo(l,t,nn(e,n),e,r,i,o,a,s)}function qr(n,t,e,r,i,o){let a=Hr.reduce((D,T)=>{let S=T[0],N=T[1],$=T[2];return e!=="datetime"&&$!==e||r.includes(N)||D.push(N,S),D},[]),s=Ot(t,"largestUnit",e,"auto");if(r.includes(s))throw new RangeError(`largestUnit must be one of ${a.join(", ")}, not ${s}`);let l=zr(t),u=ln(t,"trunc");n==="since"&&(u=function(D){switch(D){case"ceil":return"floor";case"floor":return"ceil";case"halfCeil":return"halfFloor";case"halfFloor":return"halfCeil";default:return D}}(u));let h=Ot(t,"smallestUnit",e,i);if(r.includes(h))throw new RangeError(`smallestUnit must be one of ${a.join(", ")}, not ${h}`);let p=Pn(o,h);if(s==="auto"&&(s=p),Pn(s,h)!==s)throw new RangeError(`largestUnit ${s} cannot be smaller than smallestUnit ${h}`);let y={hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[h];return y!==void 0&&Ur(l,y,!1),{largestUnit:s,roundingIncrement:l,roundingMode:u,smallestUnit:h}}function ml(n,t,e,r){let i=mi(e),o=qr(n,ie(r),"time",[],"nanosecond","second"),a=en(qs(m(t,he),m(i,he),o.roundingIncrement,o.smallestUnit,o.roundingMode),o.largestUnit);return n==="since"&&(a=Bt(a)),a}function pl(n,t,e,r){let i=di(e),o=m(t,U),a=m(i,U);if(!yn(o,a))throw new RangeError(`cannot compute difference between dates of ${o} and ${a} calendars`);let s=qr(n,ie(r),"date",[],"day","day"),l=rt("%Temporal.Duration%"),u=m(t,me),h=m(i,me);if(bn(u,h)===0)return new l;let p={date:Ki(o,u,h,s.largestUnit),time:Pe.ZERO};if(s.smallestUnit!=="day"||s.roundingIncrement!==1){let D=Me(u,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});p=Qo(p,nt(Me(h,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),D,null,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let y=en(p,"day");return n==="since"&&(y=Bt(y)),y}function fl(n,t,e,r){let i=hi(e),o=m(t,U),a=m(i,U);if(!yn(o,a))throw new RangeError(`cannot compute difference between dates of ${o} and ${a} calendars`);let s=qr(n,ie(r),"datetime",[],"nanosecond","day"),l=rt("%Temporal.Duration%"),u=m(t,He),h=m(i,He);if(Yr(u,h)===0)return new l;let p=en(vu(u,h,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);return n==="since"&&(p=Bt(p)),p}function gl(n,t,e,r){let i=Un(e),o=qr(n,ie(r),"time",[],"nanosecond","hour"),a=Vs(m(t,$e),m(i,$e));a=No(a,o.roundingIncrement,o.smallestUnit,o.roundingMode);let s=en(In({years:0,months:0,weeks:0,days:0},a),o.largestUnit);return n==="since"&&(s=Bt(s)),s}function yl(n,t,e,r){let i=pi(e),o=m(t,U),a=m(i,U);if(!yn(o,a))throw new RangeError(`cannot compute difference between months of ${o} and ${a} calendars`);let s=qr(n,ie(r),"date",["week","day"],"month","year"),l=rt("%Temporal.Duration%");if(bn(m(t,me),m(i,me))==0)return new l;let u=Ct(o,m(t,me),"year-month");u.day=1;let h=Kn(o,u,"constrain"),p=Ct(o,m(i,me),"year-month");p.day=1;let y=Kn(o,p,"constrain"),D={date:st(Ki(o,h,y,s.largestUnit),0,0),time:Pe.ZERO};if(s.smallestUnit!=="month"||s.roundingIncrement!==1){let S=Me(h,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});D=Qo(D,nt(Me(y,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),S,null,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let T=en(D,"day");return n==="since"&&(T=Bt(T)),T}function vl(n,t,e,r){let i=fi(e),o=m(t,U),a=m(i,U);if(!yn(o,a))throw new RangeError(`cannot compute difference between dates of ${o} and ${a} calendars`);let s=qr(n,ie(r),"datetime",[],"nanosecond","hour"),l=m(t,he),u=m(i,he),h=rt("%Temporal.Duration%"),p;if(Sn(s.largestUnit)!=="date")p=en(qs(l,u,s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);else{let y=m(t,ke);if(!au(y,m(i,ke)))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 h;p=en(bu(l,u,y,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),"hour")}return n==="since"&&(p=Bt(p)),p}function Fr({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,zn(n,t,s,r,i,l)}function ds(n,t){let e=t.addToEpochNs(n);return vn(e),e}function gi(n,t,e,r,i="constrain"){if(Zo(r.date)===0)return ds(n,r.time);let o=nn(t,n);return ds(ct(t,Me(Kt(e,o.isoDate,r.date,i),o.time),"compatible"),r.time)}function bl(n,t,e){let r=tn(e);n==="subtract"&&(r=Bt(r));let i=Pn(Tn(t),Tn(r));if(mn(i))throw new RangeError("For years, months, or weeks arithmetic, use date arithmetic relative to a starting point");let o=fn(t),a=fn(r);return en(In({years:0,months:0,weeks:0,days:0},o.time.add(a.time)),i)}function wl(n,t,e){let r=tn(e);n==="subtract"&&(r=Bt(r));let i=Tn(r);if(Sn(i)==="date")throw new RangeError(`Duration field ${i} not supported by Temporal.Instant. Try Temporal.ZonedDateTime instead.`);let o=fn(r);return sn(ds(m(t,he),o.time))}function Dl(n,t,e,r){let i=m(t,U),o=tn(e);n==="subtract"&&(o=Bt(o));let a=pu(o),s=Ee(ie(r));return Tt(Kt(i,m(t,me),a,s),i)}function El(n,t,e,r){let i=tn(e);n==="subtract"&&(i=Bt(i));let o=Ee(ie(r)),a=m(t,U),s=fn(i),l=m(t,He),u=Fr(l.time,s.time),h=st(s.date,u.deltaDays);return Xo(h.years,h.months,h.weeks,h.days,0,0,0,0,0,0),Qt(Me(Kt(a,l.isoDate,h,o),u),a)}function _l(n,t,e){let r=tn(e);n==="subtract"&&(r=Bt(r));let i=fn(r),{hour:o,minute:a,second:s,millisecond:l,microsecond:u,nanosecond:h}=Fr(m(t,$e),i.time);return Cn(Go(o,a,s,l,u,h,"reject"))}function Ml(n,t,e,r){let i=tn(e);n==="subtract"&&(i=Bt(i));let o=Ee(ie(r)),a=Lo(i),s=m(t,U),l=Ct(s,m(t,me),"year-month");l.day=1;let u=Kn(s,l,"constrain");if(a<0){let p=Kt(s,u,{months:1},"constrain");u=Ht(p.year,p.month,p.day-1)}let h=pu(i);return wr(u),Ar(Si(s,Ct(s,Kt(s,u,h,o),"year-month"),o),s)}function Tl(n,t,e,r){let i=tn(e);n==="subtract"&&(i=Bt(i));let o=Ee(ie(r)),a=m(t,ke),s=m(t,U),l=Ir(i);return at(gi(m(t,he),a,s,l,o),a,s)}function Vn(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=Nt(Math.abs(2*i)-t),u=a%2==0,h=zo(e,o),p=i===0?a:Uo(a,s,l,u,h);return t*(o==="positive"?p:-p)}function hs(n,t,e,r){let i=Br[e]*t;return function(o,a,s){let l=Mn(o),u=Mn(a),h=k.default.divide(l,u),p=k.default.remainder(l,u),y=zo(s,"positive"),D,T;k.default.lessThan(l,Wt)?(D=k.default.subtract(h,_i),T=h):(D=h,T=k.default.add(h,_i));let S=So(cr(k.default.multiply(p,Hs)),u)*(k.default.lessThan(l,Wt)?-1:1)+0,N=k.default.equal(p,Wt)?h:Uo(D,T,S,Pl(D),y);return k.default.multiply(N,u)}(n,k.default.BigInt(i),r)}function ms(n,t,e,r){us(n);let{year:i,month:o,day:a}=n.isoDate,s=ps(n.time,t,e,r);return Me(Ht(i,o,a+s.deltaDays),s)}function ps({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 h=Br[s],p=Vn(u,h*a,l)/h;switch(s){case"day":return{deltaDays:p,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0};case"hour":return zn(p,0,0,0,0,0);case"minute":return zn(n,p,0,0,0,0);case"second":return zn(n,t,p,0,0,0);case"millisecond":return zn(n,t,e,p,0,0);case"microsecond":return zn(n,t,e,r,p,0);case"nanosecond":return zn(n,t,e,r,i,p);default:throw new Error(`Invalid unit ${s}`)}}function No(n,t,e,r){let i=Br[e];return n.round(k.default.BigInt(i*t),r)}function Ei(n,t){let e=Br[t];return n.fdiv(k.default.BigInt(e))}function bn(n,t){return n.year!==t.year?Nt(n.year-t.year):n.month!==t.month?Nt(n.month-t.month):n.day!==t.day?Nt(n.day-t.day):0}function fs(n,t){return n.hour!==t.hour?Nt(n.hour-t.hour):n.minute!==t.minute?Nt(n.minute-t.minute):n.second!==t.second?Nt(n.second-t.second):n.millisecond!==t.millisecond?Nt(n.millisecond-t.millisecond):n.microsecond!==t.microsecond?Nt(n.microsecond-t.microsecond):n.nanosecond!==t.nanosecond?Nt(n.nanosecond-t.nanosecond):0}function Yr(n,t){let e=bn(n.isoDate,t.isoDate);return e!==0?e:fs(n.time,t.time)}function wu(n){let t=Oo(n);return globalThis.BigInt!==void 0?globalThis.BigInt(t.toString(10)):t}function rn(n,t){let e=Mn(n),{quotient:r,remainder:i}=li(e,$i),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 cn(n){if(!Number.isInteger(n))throw new RangeError("epoch milliseconds must be an integer");return k.default.multiply(k.default.BigInt(n),$i)}function Oo(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 gs=(()=>{let n=k.default.BigInt(Date.now()%1e6);return()=>{let t=Date.now(),e=k.default.BigInt(t),r=k.default.add(cn(t),n);return n=k.default.remainder(e,$i),k.default.greaterThan(r,Or)?Or:k.default.lessThan(r,Mi)?Mi:r}})();function si(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}function Nt(n){return n<0?-1:n>0?1:n}function ie(n){if(n===void 0)return Object.create(null);if(je(n)&&n!==null)return n;throw new TypeError("Options parameter must be an object, not "+(n===null?"null":typeof n))}function gr(n,t){let e=Object.create(null);return e[n]=t,e}function Rn(n,t,e,r){let i=n[t];if(i!==void 0){if(i=qo(i),!e.includes(i))throw new RangeError(`${t} must be one of ${e.join(", ")}, not ${i}`);return i}if(r===An)throw new RangeError(`${t} option is required`);return r}function Pt(n){let t=Ii(n);if(!xh.includes(Ii(t)))throw new RangeError(`invalid calendar identifier ${t}`);switch(t){case"ethiopic-amete-alem":return"ethioaa";case"islamicc":return"islamic-civil"}return t}function Ii(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 Xn(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 Fh=new RegExp(`^${zl.source}$`),Yh=new RegExp(`^${/([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])(?::?([0-5][0-9])(?:[.,](\d{1,9}))?)?)?/.source}$`);function Du(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),h=n(u);h===s?(o=u,s=h):h===l&&(a=u,l=h)}return a}function Eu(n){return[...n]}function _u(n,t){if(n!=="gregory"&&n!=="iso8601")return;let e=Qi[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,h=(i-o+7001-s)%7,p=Math.floor((o-1+h)/7);if(7-h>=l&&++p,p==0)p=function(y,D,T,S){let N=(S-y-T+1)%7;N<0&&(N+=7);let $=Math.floor((T+N-1)/7);return 7-N>=D&&++$,$}(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&&(p=1,r++)}return{week:p,year:r}}function Sl(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 Qi={};function yr(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 gn(n,t=!1){return`M${`${n}`.padStart(2,"0")}${t?"L":""}`}function Ws(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"&&Ke(r,1,e),t==="constrain"&&(r=Mt(r,1,e)),i=gn(r)}else{let o=yr(i);if(i!==gn(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}}Qi.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,Ws(n))},dateToISO:(n,t)=>wi(n.year,n.month,n.day,t),monthDayToISOReferenceDate(n,t){let{month:e,day:r}=wi(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 Eu(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}=lr(a,s),{year:a,month:s,day:l}=wi(a,s,l,o),l+=i+7*r,Ht(a,s,l)},dateUntil(n,t,e){let r=-bn(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 h=t.year-n.year;for(h!==0&&(h-=r);!Sl(r,n.year+h,n.month,n.day,t);)o=h,h+=r;let p=r;for(i=lr(n.year+o,n.month+p);!Sl(r,i.year,i.month,n.day,t);)a=p,p+=r,i=lr(i.year,i.month+r);e==="month"&&(a+=12*o,o=0)}i=lr(n.year+o,n.month+a);let s=mu(i.year,i.month,n.day),l=0,u=fr(t.year,t.month-1,t.day)-fr(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=gn(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+=dr(n,a);i.dayOfYear=o}return r.weekOfYear&&(i.weekOfYear=_u("iso8601",{year:n,month:t,day:e})),r.daysInMonth&&(i.daysInMonth=dr(n,t)),(r.daysInYear||r.inLeapYear)&&(i.inLeapYear=Ao(n),i.daysInYear=i.inLeapYear?366:365),i},getFirstDayOfWeek:()=>1,getMinimalDaysInFirstWeek:()=>4};var Vt=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 Mu({isoYear:n,isoMonth:t,isoDay:e}){return`${Xi(n)}-${Zt(t)}-${Zt(e)}T00:00Z`}function Ka(n,t){return{years:n.year-t.year,months:n.month-t.month,days:n.day-t.day}}Vt.objectMap=new WeakMap,Vt.MAX_CACHE_ENTRIES=1e3;var Ln=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=Mu({isoYear:r,isoMonth:i,isoDay:o}),u=this.getCalendarParts(l),h={};for(let y=0;y<u.length;y++){let{type:D,value:T}=u[y];if(D!=="year"&&D!=="relatedYear"||(this.hasEra?h.eraYear=+T:h.year=+T),D==="month"){let S=/^([0-9]*)(.*?)$/.exec(T);if(!S||S.length!=3||!S[1]&&!S[2])throw new RangeError(`Unexpected month: ${T}`);if(h.month=S[1]?+S[1]:1,h.month<1)throw new RangeError(`Invalid month ${T} from ${l}[u-ca-${this.id}] (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10527)`);if(h.month>13)throw new RangeError(`Invalid month ${T} from ${l}[u-ca-${this.id}] (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10529)`);S[2]&&(h.monthExtra=S[2])}D==="day"&&(h.day=+T),this.hasEra&&D==="era"&&T!=null&&T!==""&&(h.era=T.split(" (")[0].normalize("NFD").replace(/[^-0-9 \p{L}]/gu,"").replace(/ /g,"-").toLowerCase())}if(this.hasEra&&h.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(D=>h.era===D.genericName);y&&(h.era=y.code)}if(this.reviseIntlEra){let{era:y,eraYear:D}=this.reviseIntlEra(h,t);h.era=y,h.eraYear=D}this.checkIcuBugs&&this.checkIcuBugs(t);let p=this.adjustCalendarDate(h,e,"constrain",!0);if(p.year===void 0)throw new RangeError(`Missing year converting ${JSON.stringify(t)}`);if(p.month===void 0)throw new RangeError(`Missing month converting ${JSON.stringify(t)}`);if(p.day===void 0)throw new RangeError(`Missing day converting ${JSON.stringify(t)}`);return e.set(a,p),["constrain","reject"].forEach(y=>{let D=JSON.stringify({func:"calendarToIsoDate",year:p.year,month:p.month,day:p.day,overflow:y,id:this.id});e.set(D,t)}),p}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}=Ws(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"?(Ke(o,1,i),Ke(a,1,this.maximumMonthLength(t))):(o=Mt(o,1,i),a=Mt(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}),h,p=r.get(u);if(p||i.year!==void 0&&i.month!==void 0&&i.day!==void 0&&(i.year!==o.year||i.month!==o.month||i.day!==o.day)&&(h=JSON.stringify({func:"calendarToIsoDate",year:i.year,month:i.month,day:i.day,overflow:e,id:this.id}),p=r.get(h),p))return p;let y=this.estimateIsoDate({year:a,month:s,day:l}),D=G=>{let W=this.addDaysIso(y,G);if(o.day>this.minimumMonthLength(o)){let ne=this.isoToCalendarDate(W,r);for(;ne.month!==s||ne.year!==a;){if(e==="reject")throw new RangeError(`day ${l} does not exist in month ${s} of year ${a}`);W=this.addDaysIso(W,-1),ne=this.isoToCalendarDate(W,r)}}return W},T=0,S=this.isoToCalendarDate(y,r),N=Ka(o,S);if(N.years!==0||N.months!==0||N.days!==0){let G=365*N.years+30*N.months+N.days;y=this.addDaysIso(y,G),S=this.isoToCalendarDate(y,r),N=Ka(o,S),N.years===0&&N.months===0?y=D(N.days):T=this.compareCalendarDates(o,S)}let $=8;for(;T;){y=this.addDaysIso(y,T*$);let G=S;S=this.isoToCalendarDate(y,r);let W=T;if(T=this.compareCalendarDates(o,S),T){if(N=Ka(o,S),N.years===0&&N.months===0)y=D(N.days),T=0;else if(W&&T!==W)if($>1)$/=2;else{if(e==="reject")throw new RangeError(`Can't find ISO date from calendar date: ${JSON.stringify({...i})}`);this.compareCalendarDates(S,G)>0&&(y=this.addDaysIso(y,-1)),T=0}}}if(r.set(u,y),h&&r.set(h,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?Nt(t.year-e.year):t.month!==e.month?Nt(t.month-e.month):t.day!==e.day?Nt(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 Ht(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,h=o,p=e<0?-Math.max(a,this.daysInPreviousMonth(o,i)):this.daysInMonth(o,i),y=this.calendarToIsoDate(o,"constrain",i),D=this.addDaysIso(y,p);if(o=this.isoToCalendarDate(D,i),e>0){let T=this.monthsInYear(h,i);for(;o.month-1!=u%T;)D=this.addDaysIso(D,-1),o=this.isoToCalendarDate(D,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:h}=t,p=this.adjustCalendarDate({year:l+e,monthCode:h,day:u},s),y=this.addMonthsCalendar(p,r,a,s),D=o+7*i;return this.addDaysCalendar(y,D,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 h=e.year-t.year,p=e.day-t.day;if(r==="year"&&h){let T=0;e.monthCode>t.monthCode&&(T=1),e.monthCode<t.monthCode&&(T=-1),T||(T=Math.sign(p)),l=T*u<0?h-u:h}let y,D=l?this.addCalendar(t,{years:l},"constrain",i):t;do s+=u,y=D,D=this.addMonthsCalendar(y,u,"constrain",i),D.day!==t.day&&(D=this.regulateDate({...D,day:t.day},"constrain",i));while(this.compareCalendarDates(e,D)*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),h=this.addDaysIso(l,-u.day);return this.isoToCalendarDate(h,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 h=this.calendarToIsoDate(t,"constrain",e),p=this.addDaysIso(h,-r);return this.isoToCalendarDate(p,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 fr(o.year,o.month-1,o.day)-fr(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:h,year:p,month:y,monthCode:D,day:T}=t;if(y!==void 0&&p===void 0&&(!this.hasEra||u===void 0||h===void 0))throw new TypeError("when month is present, year (or era and eraYear) are required");(D===void 0||p!==void 0||this.hasEra&&h!==void 0)&&({monthCode:D,day:T}=this.isoToCalendarDate(this.calendarToIsoDate(t,e,r),r));let S={year:this.monthDaySearchStartYear(D,T),month:12,day:31},N=this.isoToCalendarDate(S,r),$=N.monthCode>D||N.monthCode===D&&N.day>=T?N.year:N.year-1;for(let G=0;G<20;G++){let W=this.adjustCalendarDate({day:T,monthCode:D,year:$-G},r),ne=this.calendarToIsoDate(W,"constrain",r),le=this.isoToCalendarDate(ne,r);if({year:i,month:o,day:a}=ne,le.monthCode===D&&le.day===T)return{month:o,day:a,year:i};if(e==="constrain"){let oe=this.maxLengthOfMonthCodeInAnyYear(le.monthCode);if(le.monthCode===D&&le.day===oe&&T>oe)return{month:o,day:a,year:i};(s===void 0||le.monthCode===s.monthCode&&le.day>s.day)&&(s=le,l=ne)}}if(e==="constrain"&&l!==void 0)return l;throw new RangeError(`No recent ${this.id} year with monthCode ${D} and day ${T}`)}getFirstDayOfWeek(){}getMinimalDaysInFirstWeek(){}},ys=class extends Ln{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?gn(5,!0):gn(e<6?e:e-1):gn(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 h=this.months[u];if(!h)throw new RangeError(`Unrecognized month from formatToParts: ${u}`);a=this.inLeapYear({year:o})?h.leap:h.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=yr(s),this.inLeapYear({year:o})&&a>=6&&a++;let h=this.monthsInYear({year:o});if(a<1||a>h)throw new RangeError(`Invalid monthCode: ${s}`)}else if(r==="reject"?(Ke(a,1,this.monthsInYear({year:o})),Ke(l,1,this.maximumMonthLength({year:o,month:a}))):(a=Mt(a,1,this.monthsInYear({year:o})),l=Mt(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}}},Zn=class extends Ln{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}}},vs=class extends Zn{constructor(){super(...arguments),this.id="islamic"}},bs=class extends Zn{constructor(){super(...arguments),this.id="islamic-umalqura"}},ws=class extends Zn{constructor(){super(...arguments),this.id="islamic-tbla"}},Ds=class extends Zn{constructor(){super(...arguments),this.id="islamic-civil"}},Es=class extends Zn{constructor(){super(...arguments),this.id="islamic-rgsa"}},_s=class extends Zn{constructor(){super(...arguments),this.id="islamicc"}},Ms=class extends Ln{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 yr(t)<=6?31:30}estimateIsoDate(t){let{year:e}=this.adjustCalendarDate(t);return{year:e+621,month:1,day:1}}},Ts=class extends Ln{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 Gs(t.year+78)}monthsInYear(){return 12}minimumMonthLength(t){return this.getMonthInfo(t).length}maximumMonthLength(t){return this.getMonthInfo(t).length}maxLengthOfMonthCodeInAnyYear(t){let e=yr(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 Ht(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 Gs(n){return n%4==0&&(n%100!=0||n%400==0)}var Ho=class extends Ln{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 Gs(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][yr(t)-1]}estimateIsoDate(t){let e=this.adjustCalendarDate(t);return wi(e.year+this.isoEpoch.year,e.month+this.isoEpoch.month,e.day+this.isoEpoch.day,"constrain")}},Bo=class extends Ln{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:h}=u;if(h){let p=s.find(y=>y.code===h);if(p===void 0)throw new RangeError(`Invalid era data: unmatched reverseOf era: ${h}`);u.reverseOf=p,u.anchorEpoch=p.anchorEpoch,u.isoEpoch=p.isoEpoch}u.anchorEpoch.month===void 0&&(u.anchorEpoch.month=1),u.anchorEpoch.day===void 0&&(u.anchorEpoch.day=1)}),s.sort((u,h)=>{if(u.reverseOf)return 1;if(h.reverseOf)return-1;if(!u.isoEpoch||!h.isoEpoch)throw new RangeError("Invalid era data: missing ISO epoch");return h.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,h)=>{u.genericName="era"+(s.length-1-h)}),{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 Gs(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][yr(t)-1]}completeEraYear(t){let e=(s,l,u)=>{let h=t[s];if(h!=null&&h!=l&&!(u||[]).includes(h)){let p=u?.[0];throw new RangeError(`Input ${s} ${h} doesn't match calculated value ${p?`${l} (also called ${p})`:l}`)}},r=s=>{let l,u={...t,year:s},h=this.eras.find((p,y)=>{if(y===this.eras.length-1){if(p.reverseOf){if(s>0)throw new RangeError(`Signed year ${s} is invalid for era ${p.code}`);return l=p.anchorEpoch.year-s,!0}return l=s-p.anchorEpoch.year+(p.hasYearZero?0:1),!0}return this.compareCalendarDates(u,p.anchorEpoch)>=0&&(l=s-p.anchorEpoch.year+(p.hasYearZero?0:1),!0)});if(!h)throw new RangeError(`Year ${s} was not matched by any era`);return{eraYear:l,era:h.code,eraNames:h.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:yr(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 wi(r+a.isoEpoch.year-(a.hasYearZero?0:1),i,o,"constrain")}},Ri=class extends Bo{constructor(t,e){super(t,e)}isoToCalendarDate(t){let{year:e,month:r,day:i}=t,o=gn(r),a=e-this.anchorEra.isoEpoch.year+1;return this.completeEraYear({year:a,month:r,monthCode:o,day:i})}},pn={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},Ss=class extends Ho{constructor(t,e){super(t,e),this.inLeapYear=pn.inLeapYear,this.monthsInYear=pn.monthsInYear,this.minimumMonthLength=pn.minimumMonthLength,this.maximumMonthLength=pn.maximumMonthLength,this.maxLengthOfMonthCodeInAnyYear=pn.maxLengthOfMonthCodeInAnyYear}},Fo=class extends Bo{constructor(t,e){super(t,e),this.inLeapYear=pn.inLeapYear,this.monthsInYear=pn.monthsInYear,this.minimumMonthLength=pn.minimumMonthLength,this.maximumMonthLength=pn.maximumMonthLength,this.maxLengthOfMonthCodeInAnyYear=pn.maxLengthOfMonthCodeInAnyYear}},Cs=class extends Ss{constructor(){super("ethioaa",{year:-5492,month:7,day:17})}},ks=class extends Fo{constructor(){super("coptic",[{code:"coptic",isoEpoch:{year:284,month:8,day:29}},{code:"coptic-inverse",reverseOf:"coptic"}])}},Ps=class extends Fo{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}}])}},Is=class extends Ri{constructor(){super("roc",[{code:"roc",names:["minguo"],isoEpoch:{year:1912,month:1,day:1}},{code:"roc-inverse",names:["before-roc"],reverseOf:"roc"}])}},Rs=class extends Ho{constructor(){super("buddhist",{year:-543,month:1,day:1})}},xs=class extends Ri{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}},As=class extends Ri{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}}},Yo=class extends Ln{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=(N,$)=>{let G=Mu({isoYear:N,isoMonth:2,isoDay:1}),W=new Date(G);W.setUTCDate($+1);let ne=o.formatToParts(W),le=ne.find(se=>se.type==="month").value,oe=+ne.find(se=>se.type==="day").value,Ce=ne.find(se=>se.type==="relatedYear"),Te;if(Ce===void 0)throw new RangeError(`Intl.DateTimeFormat.formatToParts lacks relatedYear in ${this.id} calendar. Try Node 14+ or modern browsers.`);return Te=+Ce.value,{calendarMonthString:le,calendarDay:oe,calendarYearToVerify:Te}},s=17,{calendarMonthString:l,calendarDay:u,calendarYearToVerify:h}=a(t,s);l!=="1"&&(s+=29,{calendarMonthString:l,calendarDay:u}=a(t,s)),s-=u-5;let p={},y,D,T=1,S=!1;do({calendarMonthString:l,calendarDay:u,calendarYearToVerify:h}=a(t,s)),y&&(p[D].daysInMonth=y+30-u),h!==t?S=!0:(p[l]={monthIndex:T++},s+=30),y=u,D=l;while(!S);return p[D].daysInMonth=y+30-u,e.set(r,p),p}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 h=gn(a,s!==void 0),p=`${a}${s||""}`,y=this.getMonthList(o,e)[p];if(y===void 0)throw new RangeError(`Unmatched month ${p} in Chinese year ${o}`);return a=y.monthIndex,{year:o,month:a,day:l,monthCode:h}}if(this.validateCalendarDate(t),a===void 0){let h=this.getMonthList(o,e),p=u.replace(/^M|L$/g,D=>D==="L"?"bis":"");p[0]==="0"&&(p=p.slice(1));let y=h[p];if(a=y&&y.monthIndex,a===void 0&&u.endsWith("L")&&u!="M13L"&&r==="constrain"){let D=+u.replace(/^M0?|L$/g,"");y=h[D],y&&(a=y.monthIndex,u=gn(D))}if(a===void 0)throw new RangeError(`Unmatched month ${u} in Chinese year ${o}`)}else if(u===void 0){let h=this.getMonthList(o,e),p=Object.entries(h),y=p.length;r==="reject"?(Ke(a,1,y),Ke(l,1,this.maximumMonthLength())):(a=Mt(a,1,y),l=Mt(l,1,this.maximumMonthLength()));let D=p.find(T=>T[1].monthIndex===a);if(D===void 0)throw new RangeError(`Invalid month ${a} in Chinese year ${o}`);u=gn(+D[0].replace("bis",""),D[0].indexOf("bis")!==-1)}else{let h=this.getMonthList(o,e),p=u.replace(/^M|L$/g,D=>D==="L"?"bis":"");p[0]==="0"&&(p=p.slice(1));let y=h[p];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}}},Ls=class extends Yo{constructor(){super(...arguments),this.id="chinese"}},Ns=class extends Yo{constructor(){super(...arguments),this.id="dangi"}},Os=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 Vt;Ws(t,void 0,this.helper.monthsInYear({year:t.year??1972},e))}}dateToISO(t,e){let r=new Vt,i=this.helper.calendarToIsoDate(t,e,r);return r.setObject(i),i}monthDayToISOReferenceDate(t,e){let r=new Vt,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 Eu(e)}dateAdd(t,{years:e,months:r,weeks:i,days:o},a){let s=Vt.getCacheForObject(t),l=this.helper.isoToCalendarDate(t,s),u=this.helper.addCalendar(l,{years:e,months:r,weeks:i,days:o},a,s),h=this.helper.calendarToIsoDate(u,"constrain",s);return Vt.getCacheForObject(h)||new Vt(s).setObject(h),h}dateUntil(t,e,r){let i=Vt.getCacheForObject(t),o=Vt.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=Vt.getCacheForObject(t),i=this.helper.isoToCalendarDate(t,r);if(e.dayOfWeek&&(i.dayOfWeek=Qi.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=_u(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[ys,Ms,Ps,Cs,ks,Ls,Ns,Is,Ts,Rs,xs,As,vs,bs,ws,Ds,Es,_s]){let t=new n;Qi[t.id]=new Os(t)}ns("calendarImpl",function(n){return Qi[n]});var xi=Intl.DateTimeFormat;function Sr(n,t){let e=m(n,t);return typeof e=="function"&&(e=new xi(m(n,Fl),e(m(n,Xa))),function(r,i,o){let a=jo(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 ci(n){return kt(n,br)}var vr=class{constructor(t=void 0,e=void 0){(function(r,i,o){let a=o!==void 0,s;if(a){let p=["localeMatcher","calendar","numberingSystem","hour12","hourCycle","timeZone","weekday","era","year","month","day","dayPeriod","hour","minute","second","fractionalSecondDigits","timeZoneName","formatMatcher","dateStyle","timeStyle"];s=function(D){if(D==null)throw new TypeError(`Expected object not ${D}`);return Object(D)}(o);let y=Object.create(null);for(let D=0;D<p.length;D++){let T=p[D];Object.prototype.hasOwnProperty.call(s,T)&&(y[T]=s[T])}s=y}else s=Object.create(null);let l=new xi(i,s),u=l.resolvedOptions();if(Nn(r),a){let p=Object.assign(Object.create(null),u);for(let y in p)Object.prototype.hasOwnProperty.call(s,y)||delete p[y];p.hour12=s.hour12,p.hourCycle=s.hourCycle,ve(r,Xa,p)}else ve(r,Xa,s);ve(r,Fl,u.locale),ve(r,br,l),ve(r,Pr,u.timeZone),ve(r,ui,u.calendar),ve(r,Al,Kh),ve(r,Ll,Wh),ve(r,Nl,Gh),ve(r,Ol,qh),ve(r,Hl,Zh),ve(r,Bl,Jh);let h=a?s.timeZone:void 0;if(h===void 0)ve(r,Ja,u.timeZone);else{let p=qo(h);if(p.startsWith("\u2212"))throw new RangeError("Unicode minus (U+2212) is not supported in time zone offsets");ve(r,Ja,St(p))}})(this,t,e)}get format(){R(this,ci);let t=jh.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 R(this,ci),Uh.call(this,t,e)}formatToParts(t,...e){return R(this,ci),zh.call(this,t,...e)}formatRangeToParts(t,e){return R(this,ci),Vh.call(this,t,e)}resolvedOptions(){return R(this,ci),$h.call(this)}};"formatToParts"in xi.prototype||delete vr.prototype.formatToParts,"formatRangeToParts"in xi.prototype||delete vr.prototype.formatRangeToParts;var Gt=function(n=void 0,t=void 0){return new vr(n,t)};function $h(){let n=m(this,br).resolvedOptions();return n.timeZone=m(this,Ja),n}function jh(n,...t){let e,r,i=$r(n,this);return i.formatter?(e=i.formatter,r=[rn(i.epochNs,"floor")]):(e=m(this,br),r=[n,...t]),e.format(...r)}function zh(n,...t){let e,r,i=$r(n,this);return i.formatter?(e=i.formatter,r=[rn(i.epochNs,"floor")]):(e=m(this,br),r=[n,...t]),e.formatToParts(...r)}function Uh(n,t){if(n===void 0||t===void 0)throw new TypeError("Intl.DateTimeFormat.formatRange requires two values");let e=$o(n),r=$o(t),i,o=[e,r];if(xn(e)!==xn(r))throw new TypeError("Intl.DateTimeFormat.formatRange accepts two values of the same type");if(xn(e)){if(!Tu(e,r))throw new TypeError("Intl.DateTimeFormat.formatRange accepts two values of the same type");let{epochNs:a,formatter:s}=$r(e,this),{epochNs:l,formatter:u}=$r(r,this);s&&(i=s,o=[rn(a,"floor"),rn(l,"floor")])}return i||(i=m(this,br)),i.formatRange(...o)}function Vh(n,t){if(n===void 0||t===void 0)throw new TypeError("Intl.DateTimeFormat.formatRange requires two values");let e=$o(n),r=$o(t),i,o=[e,r];if(xn(e)!==xn(r))throw new TypeError("Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type");if(xn(e)){if(!Tu(e,r))throw new TypeError("Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type");let{epochNs:a,formatter:s}=$r(e,this),{epochNs:l,formatter:u}=$r(r,this);s&&(i=s,o=[rn(a,"floor"),rn(l,"floor")])}return i||(i=m(this,br)),i.formatRangeToParts(...o)}function eo(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 qh(n){let t=eo(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"})),!ta(t)){if(to(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 Wh(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=eo(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(to(n))throw new TypeError(`cannot format PlainYearMonth with options [${Object.keys(n)}]`);Object.assign(e,{year:"numeric",month:"numeric"})}return e}function Gh(n){let t={short:{month:"numeric",day:"numeric"},medium:{month:"short",day:"numeric"},long:{month:"long",day:"numeric"},full:{month:"long",day:"numeric"}},e=eo(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(to(n))throw new TypeError(`cannot format PlainMonthDay with options [${Object.keys(n)}]`);Object.assign(e,{month:"numeric",day:"numeric"})}return e}function Kh(n){let t=eo(n,{hour:!1,minute:!1,second:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if(!ea(t)){if(to(n))throw new TypeError(`cannot format PlainDate with options [${Object.keys(n)}]`);Object.assign(t,{year:"numeric",month:"numeric",day:"numeric"})}return t}function Zh(n){let t=eo(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),!ta(t)&&!ea(t)){if(to(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 ta(t)||ea(t)||(t=Object.assign({},t,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})),t}function ea(n){return"year"in n||"month"in n||"day"in n||"weekday"in n||"dateStyle"in n||"era"in n}function ta(n){return"hour"in n||"minute"in n||"second"in n||"timeStyle"in n||"dayPeriod"in n||"fractionalSecondDigits"in n}function to(n){return ea(n)||ta(n)||"dateStyle"in n||"timeStyle"in n||"timeZoneName"in n}function xn(n){return Ye(n)||Ue(n)||xe(n)||be(n)||tt(n)||qt(n)||et(n)}function $o(n){return xn(n)?n:Vo(n)}function Tu(n,t){return!(!xn(n)||!xn(t)||Ue(n)&&!Ue(t)||Ye(n)&&!Ye(t)||xe(n)&&!xe(t)||be(n)&&!be(t)||tt(n)&&!tt(t)||qt(n)&&!qt(t)||et(n)&&!et(t))}function $r(n,t){if(Ue(n)){let e={isoDate:{year:1970,month:1,day:1},time:m(n,$e)};return{epochNs:ct(m(t,Pr),e,"compatible"),formatter:Sr(t,Ol)}}if(tt(n)){let e=m(n,U),r=m(t,ui);if(e!==r)throw new RangeError(`cannot format PlainYearMonth with calendar ${e} in locale with calendar ${r}`);let i=Me(m(n,me),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:ct(m(t,Pr),i,"compatible"),formatter:Sr(t,Ll)}}if(qt(n)){let e=m(n,U),r=m(t,ui);if(e!==r)throw new RangeError(`cannot format PlainMonthDay with calendar ${e} in locale with calendar ${r}`);let i=Me(m(n,me),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:ct(m(t,Pr),i,"compatible"),formatter:Sr(t,Nl)}}if(Ye(n)){let e=m(n,U),r=m(t,ui);if(e!=="iso8601"&&e!==r)throw new RangeError(`cannot format PlainDate with calendar ${e} in locale with calendar ${r}`);let i=Me(m(n,me),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:ct(m(t,Pr),i,"compatible"),formatter:Sr(t,Al)}}if(xe(n)){let e=m(n,U),r=m(t,ui);if(e!=="iso8601"&&e!==r)throw new RangeError(`cannot format PlainDateTime with calendar ${e} in locale with calendar ${r}`);let i=m(n,He);return{epochNs:ct(m(t,Pr),i,"compatible"),formatter:Sr(t,Hl)}}if(be(n))throw new TypeError("Temporal.ZonedDateTime not supported in DateTimeFormat methods. Use toLocaleString() instead.");return et(n)?{epochNs:m(n,he),formatter:Sr(t,Bl)}:{}}function Su(n){let t=Object.create(null);return t.years=m(n,gt),t.months=m(n,yt),t.weeks=m(n,At),t.days=m(n,vt),t.hours=m(n,bt),t.minutes=m(n,wt),t.seconds=m(n,Dt),t.milliseconds=m(n,Et),t.microseconds=m(n,_t),t.nanoseconds=m(n,Lt),t}vr.prototype.constructor=Gt,Object.defineProperty(Gt,"prototype",{value:vr.prototype,writable:!1,enumerable:!1,configurable:!1}),Gt.supportedLocalesOf=xi.supportedLocalesOf,On(Gt,"Intl.DateTimeFormat");var{format:Xh,formatToParts:Qh}=Intl.DurationFormat?.prototype??Object.create(null);function Ks(n){Intl.DurationFormat.prototype.resolvedOptions.call(this);let t=Su(tn(n));return Xh.call(this,t)}Intl.DurationFormat?.prototype&&(Intl.DurationFormat.prototype.format=Ks,Intl.DurationFormat.prototype.formatToParts=function(n){Intl.DurationFormat.prototype.resolvedOptions.call(this);let t=Su(tn(n));return Qh.call(this,t)});var Zm=Object.freeze({__proto__:null,DateTimeFormat:Gt,ModifiedIntlDurationFormatPrototypeFormat:Ks}),Ai=class{constructor(t){if(arguments.length<1)throw new TypeError("missing argument: epochNanoseconds is required");iu(this,Oo(t))}get epochMilliseconds(){return R(this,et),rn(m(this,he),"floor")}get epochNanoseconds(){return R(this,et),wu(k.default.BigInt(m(this,he)))}add(t){return R(this,et),wl("add",this,t)}subtract(t){return R(this,et),wl("subtract",this,t)}until(t,e=void 0){return R(this,et),ml("until",this,t,e)}since(t,e=void 0){return R(this,et),ml("since",this,t,e)}round(t){if(R(this,et),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?gr("smallestUnit",t):ie(t),r=zr(e),i=ln(e,"halfExpand"),o=Ot(e,"smallestUnit","time",An);return Ur(r,{hour:24,minute:1440,second:86400,millisecond:864e5,microsecond:864e8,nanosecond:864e11}[o],!0),sn(hs(m(this,he),r,o,i))}equals(t){R(this,et);let e=mi(t),r=m(this,he),i=m(e,he);return k.default.equal(k.default.BigInt(r),k.default.BigInt(i))}toString(t=void 0){R(this,et);let e=ie(t),r=Vi(e),i=ln(e,"trunc"),o=Ot(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=St(a));let{precision:s,unit:l,increment:u}=qi(o,r);return il(sn(hs(m(this,he),u,l,i)),a,s)}toJSON(){return R(this,et),il(this,void 0,"auto")}toLocaleString(t=void 0,e=void 0){return R(this,et),new Gt(t,e).format(this)}valueOf(){Xn("Instant")}toZonedDateTimeISO(t){R(this,et);let e=St(t);return at(m(this,he),e,"iso8601")}static fromEpochMilliseconds(t){return sn(cn(Vo(t)))}static fromEpochNanoseconds(t){return sn(Oo(t))}static from(t){return mi(t)}static compare(t,e){let r=mi(t),i=mi(e),o=m(r,he),a=m(i,he);return k.default.lessThan(o,a)?-1:k.default.greaterThan(o,a)?1:0}};On(Ai,"Temporal.Instant");var Li=class{constructor(t,e,r,i="iso8601"){let o=fe(t),a=fe(e),s=fe(r),l=Pt(i===void 0?"iso8601":Ge(i));mr(o,a,s),Ql(this,{year:o,month:a,day:s},l)}get calendarId(){return R(this,Ye),m(this,U)}get era(){return mt(this,"era")}get eraYear(){return mt(this,"eraYear")}get year(){return mt(this,"year")}get month(){return mt(this,"month")}get monthCode(){return mt(this,"monthCode")}get day(){return mt(this,"day")}get dayOfWeek(){return mt(this,"dayOfWeek")}get dayOfYear(){return mt(this,"dayOfYear")}get weekOfYear(){return mt(this,"weekOfYear")?.week}get yearOfWeek(){return mt(this,"weekOfYear")?.year}get daysInWeek(){return mt(this,"daysInWeek")}get daysInMonth(){return mt(this,"daysInMonth")}get daysInYear(){return mt(this,"daysInYear")}get monthsInYear(){return mt(this,"monthsInYear")}get inLeapYear(){return mt(this,"inLeapYear")}with(t,e=void 0){if(R(this,Ye),!je(t))throw new TypeError("invalid argument");jr(t);let r=m(this,U),i=Ct(r,m(this,me));return i=hr(r,i,Jt(r,t,["year","month","monthCode","day"],[],"partial")),Tt(Kn(r,i,Ee(ie(e))),r)}withCalendar(t){R(this,Ye);let e=Zi(t);return Tt(m(this,me),e)}add(t,e=void 0){return R(this,Ye),Dl("add",this,t,e)}subtract(t,e=void 0){return R(this,Ye),Dl("subtract",this,t,e)}until(t,e=void 0){return R(this,Ye),pl("until",this,t,e)}since(t,e=void 0){return R(this,Ye),pl("since",this,t,e)}equals(t){R(this,Ye);let e=di(t);return bn(m(this,me),m(e,me))===0&&yn(m(this,U),m(e,U))}toString(t=void 0){return R(this,Ye),ol(this,Ui(ie(t)))}toJSON(){return R(this,Ye),ol(this)}toLocaleString(t=void 0,e=void 0){return R(this,Ye),new Gt(t,e).format(this)}valueOf(){Xn("PlainDate")}toPlainDateTime(t=void 0){R(this,Ye);let e=Xl(t);return Qt(Me(m(this,me),e),m(this,U))}toZonedDateTime(t){let e,r;if(R(this,Ye),je(t)){let a=t.timeZone;a===void 0?e=St(t):(e=St(a),r=t.plainTime)}else e=St(t);let i=m(this,me),o;return r===void 0?o=jn(e,i):(r=Un(r),o=ct(e,Me(i,m(r,$e)),"compatible")),at(o,e,m(this,U))}toPlainYearMonth(){R(this,Ye);let t=m(this,U);return Ar(Si(t,Ct(t,m(this,me)),"constrain"),t)}toPlainMonthDay(){R(this,Ye);let t=m(this,U);return xr(Ro(t,Ct(t,m(this,me)),"constrain"),t)}static from(t,e=void 0){return di(t,e)}static compare(t,e){let r=di(t),i=di(e);return bn(m(r,me),m(i,me))}};function mt(n,t){R(n,Ye);let e=m(n,me);return Wi(n).isoToDate(e,{[t]:!0})[t]}On(Li,"Temporal.PlainDate");var Ni=class{constructor(t,e,r,i=0,o=0,a=0,s=0,l=0,u=0,h="iso8601"){let p=fe(t),y=fe(e),D=fe(r),T=i===void 0?0:fe(i),S=o===void 0?0:fe(o),N=a===void 0?0:fe(a),$=s===void 0?0:fe(s),G=l===void 0?0:fe(l),W=u===void 0?0:fe(u),ne=Pt(h===void 0?"iso8601":Ge(h));zs(p,y,D,T,S,N,$,G,W),eu(this,{isoDate:{year:p,month:y,day:D},time:{hour:T,minute:S,second:N,millisecond:$,microsecond:G,nanosecond:W}},ne)}get calendarId(){return R(this,xe),m(this,U)}get year(){return pt(this,"year")}get month(){return pt(this,"month")}get monthCode(){return pt(this,"monthCode")}get day(){return pt(this,"day")}get hour(){return Cr(this,"hour")}get minute(){return Cr(this,"minute")}get second(){return Cr(this,"second")}get millisecond(){return Cr(this,"millisecond")}get microsecond(){return Cr(this,"microsecond")}get nanosecond(){return Cr(this,"nanosecond")}get era(){return pt(this,"era")}get eraYear(){return pt(this,"eraYear")}get dayOfWeek(){return pt(this,"dayOfWeek")}get dayOfYear(){return pt(this,"dayOfYear")}get weekOfYear(){return pt(this,"weekOfYear")?.week}get yearOfWeek(){return pt(this,"weekOfYear")?.year}get daysInWeek(){return pt(this,"daysInWeek")}get daysInYear(){return pt(this,"daysInYear")}get daysInMonth(){return pt(this,"daysInMonth")}get monthsInYear(){return pt(this,"monthsInYear")}get inLeapYear(){return pt(this,"inLeapYear")}with(t,e=void 0){if(R(this,xe),!je(t))throw new TypeError("invalid argument");jr(t);let r=m(this,U),i=m(this,He),o={...Ct(r,i.isoDate),...i.time};return o=hr(r,o,Jt(r,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond"],"partial")),Qt(Gi(r,o,Ee(ie(e))),r)}withPlainTime(t=void 0){R(this,xe);let e=Xl(t);return Qt(Me(m(this,He).isoDate,e),m(this,U))}withCalendar(t){R(this,xe);let e=Zi(t);return Qt(m(this,He),e)}add(t,e=void 0){return R(this,xe),El("add",this,t,e)}subtract(t,e=void 0){return R(this,xe),El("subtract",this,t,e)}until(t,e=void 0){return R(this,xe),fl("until",this,t,e)}since(t,e=void 0){return R(this,xe),fl("since",this,t,e)}round(t){if(R(this,xe),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?gr("smallestUnit",t):ie(t),r=zr(e),i=ln(e,"halfExpand"),o=Ot(e,"smallestUnit","time",An,["day"]),a={day:1,hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o];Ur(r,a,a===1);let s=m(this,He);return Qt(r===1&&o==="nanosecond"?s:ms(s,r,o,i),m(this,U))}equals(t){R(this,xe);let e=hi(t);return Yr(m(this,He),m(e,He))===0&&yn(m(this,U),m(e,U))}toString(t=void 0){R(this,xe);let e=ie(t),r=Ui(e),i=Vi(e),o=ln(e,"trunc"),a=Ot(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}=qi(a,i),h=ms(m(this,He),u,l,o);return pr(h),ki(h,m(this,U),s,r)}toJSON(){return R(this,xe),ki(m(this,He),m(this,U),"auto")}toLocaleString(t=void 0,e=void 0){return R(this,xe),new Gt(t,e).format(this)}valueOf(){Xn("PlainDateTime")}toZonedDateTime(t,e=void 0){R(this,xe);let r=St(t),i=Di(ie(e));return at(ct(r,m(this,He),i),r,m(this,U))}toPlainDate(){return R(this,xe),Tt(m(this,He).isoDate,m(this,U))}toPlainTime(){return R(this,xe),Cn(m(this,He).time)}static from(t,e=void 0){return hi(t,e)}static compare(t,e){let r=hi(t),i=hi(e);return Yr(m(r,He),m(i,He))}};function pt(n,t){R(n,xe);let e=m(n,He).isoDate;return Wi(n).isoToDate(e,{[t]:!0})[t]}function Cr(n,t){return R(n,xe),m(n,He).time[t]}On(Ni,"Temporal.PlainDateTime");var Oi=class n{constructor(t=0,e=0,r=0,i=0,o=0,a=0,s=0,l=0,u=0,h=0){let p=t===void 0?0:an(t),y=e===void 0?0:an(e),D=r===void 0?0:an(r),T=i===void 0?0:an(i),S=o===void 0?0:an(o),N=a===void 0?0:an(a),$=s===void 0?0:an(s),G=l===void 0?0:an(l),W=u===void 0?0:an(u),ne=h===void 0?0:an(h);Xo(p,y,D,T,S,N,$,G,W,ne),Nn(this),ve(this,gt,p),ve(this,yt,y),ve(this,At,D),ve(this,vt,T),ve(this,bt,S),ve(this,wt,N),ve(this,Dt,$),ve(this,Et,G),ve(this,_t,W),ve(this,Lt,ne)}get years(){return R(this,Fe),m(this,gt)}get months(){return R(this,Fe),m(this,yt)}get weeks(){return R(this,Fe),m(this,At)}get days(){return R(this,Fe),m(this,vt)}get hours(){return R(this,Fe),m(this,bt)}get minutes(){return R(this,Fe),m(this,wt)}get seconds(){return R(this,Fe),m(this,Dt)}get milliseconds(){return R(this,Fe),m(this,Et)}get microseconds(){return R(this,Fe),m(this,_t)}get nanoseconds(){return R(this,Fe),m(this,Lt)}get sign(){return R(this,Fe),Lo(this)}get blank(){return R(this,Fe),Lo(this)===0}with(t){R(this,Fe);let e=Jl(t),{years:r=m(this,gt),months:i=m(this,yt),weeks:o=m(this,At),days:a=m(this,vt),hours:s=m(this,bt),minutes:l=m(this,wt),seconds:u=m(this,Dt),milliseconds:h=m(this,Et),microseconds:p=m(this,_t),nanoseconds:y=m(this,Lt)}=e;return new n(r,i,o,a,s,l,u,h,p,y)}negated(){return R(this,Fe),Bt(this)}abs(){return R(this,Fe),new n(Math.abs(m(this,gt)),Math.abs(m(this,yt)),Math.abs(m(this,At)),Math.abs(m(this,vt)),Math.abs(m(this,bt)),Math.abs(m(this,wt)),Math.abs(m(this,Dt)),Math.abs(m(this,Et)),Math.abs(m(this,_t)),Math.abs(m(this,Lt)))}add(t){return R(this,Fe),bl("add",this,t)}subtract(t){return R(this,Fe),bl("subtract",this,t)}round(t){if(R(this,Fe),t===void 0)throw new TypeError("options parameter is required");let e=Tn(this),r=typeof t=="string"?gr("smallestUnit",t):ie(t),i=Ot(r,"largestUnit","datetime",void 0,["auto"]),{plainRelativeTo:o,zonedRelativeTo:a}=Ga(r),s=zr(r),l=ln(r,"halfExpand"),u=Ot(r,"smallestUnit","datetime",void 0),h=!0;u||(h=!1,u="nanosecond");let p=Pn(e,u),y=!0;if(i||(y=!1,i=p),i==="auto"&&(i=p),!h&&!y)throw new RangeError("at least one of smallestUnit or largestUnit is required");if(Pn(i,u)!==i)throw new RangeError(`largestUnit ${i} cannot be smaller than smallestUnit ${u}`);let D={hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[u];if(D!==void 0&&Ur(s,D,!1),s>1&&Sn(u)==="date"&&i!==u)throw new RangeError("For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit");if(a){let S=Ir(this),N=m(a,ke),$=m(a,U),G=m(a,he);return S=bu(G,gi(G,N,$,S),N,$,i,s,u,l),Sn(i)==="date"&&(i="hour"),en(S,i)}if(o){let S=fn(this),N=Fr({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},S.time),$=m(o,me),G=m(o,U),W=Kt(G,$,st(S.date,N.deltaDays),"constrain");return S=vu(Me($,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),Me(W,N),G,i,s,u,l),en(S,i)}if(mn(e))throw new RangeError(`a starting point is required for ${e}s balancing`);if(mn(i))throw new RangeError(`a starting point is required for ${i}s balancing`);let T=fn(this);if(u==="day"){let{quotient:S,remainder:N}=T.time.divmod(ko),$=T.date.days+S+Ei(N,"day");$=Vn($,s,l),T=In({years:0,months:0,weeks:0,days:$},Pe.ZERO)}else T=In({years:0,months:0,weeks:0,days:0},No(T.time,s,u,l));return en(T,i)}total(t){if(R(this,Fe),t===void 0)throw new TypeError("options argument is required");let e=typeof t=="string"?gr("unit",t):ie(t),{plainRelativeTo:r,zonedRelativeTo:i}=Ga(e),o=Ot(e,"unit","datetime",An);if(i){let s=Ir(this),l=m(i,ke),u=m(i,U),h=m(i,he);return function(p,y,D,T,S){return Sn(S)==="time"?Ei(Pe.fromEpochNsDiff(y,p),S):hl(gu(p,y,D,T,S),y,nn(D,p),D,T,S)}(h,gi(h,l,u,s),l,u,o)}if(r){let s=fn(this),l=Fr({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},s.time),u=m(r,me),h=m(r,U),p=Kt(h,u,st(s.date,l.deltaDays),"constrain");return function(y,D,T,S){if(Yr(y,D)==0)return 0;pr(y),pr(D);let N=fu(y,D,T,S);return S==="nanosecond"?k.default.toNumber(N.time.totalNs):hl(N,nt(D),y,null,T,S)}(Me(u,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),Me(p,l),h,o)}let a=Tn(this);if(mn(a))throw new RangeError(`a starting point is required for ${a}s total`);if(mn(o))throw new RangeError(`a starting point is required for ${o}s total`);return Ei(fn(this).time,o)}toString(t=void 0){R(this,Fe);let e=ie(t),r=Vi(e),i=ln(e,"trunc"),o=Ot(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}=qi(o,r);if(s==="nanosecond"&&l===1)return Mo(this,a);let u=Tn(this),h=Ir(this),p=No(h.time,l,s,i);return h=In(h.date,p),Mo(en(h,Pn(u,"second")),a)}toJSON(){return R(this,Fe),Mo(this,"auto")}toLocaleString(t=void 0,e=void 0){if(R(this,Fe),typeof Intl.DurationFormat=="function"){let r=new Intl.DurationFormat(t,e);return Ks.call(r,this)}return console.warn("Temporal.Duration.prototype.toLocaleString() requires Intl.DurationFormat."),Mo(this,"auto")}valueOf(){Xn("Duration")}static from(t){return tn(t)}static compare(t,e,r=void 0){let i=tn(t),o=tn(e),a=ie(r),{plainRelativeTo:s,zonedRelativeTo:l}=Ga(a);if(m(i,gt)===m(o,gt)&&m(i,yt)===m(o,yt)&&m(i,At)===m(o,At)&&m(i,vt)===m(o,vt)&&m(i,bt)===m(o,bt)&&m(i,wt)===m(o,wt)&&m(i,Dt)===m(o,Dt)&&m(i,Et)===m(o,Et)&&m(i,_t)===m(o,_t)&&m(i,Lt)===m(o,Lt))return 0;let u=Tn(i),h=Tn(o),p=Ir(i),y=Ir(o);if(l&&(Sn(u)==="date"||Sn(h)==="date")){let $=m(l,ke),G=m(l,U),W=m(l,he),ne=gi(W,$,G,p),le=gi(W,$,G,y);return Nt(k.default.toNumber(k.default.subtract(ne,le)))}let D=p.date.days,T=y.date.days;if(mn(u)||mn(h)){if(!s)throw new RangeError("A starting point is required for years, months, or weeks comparison");D=dl(p.date,s),T=dl(y.date,s)}let S=p.time.add24HourDays(D),N=y.time.add24HourDays(T);return S.cmp(N)}};On(Oi,"Temporal.Duration");var Hi=class{constructor(t,e,r="iso8601",i=1972){let o=fe(t),a=fe(e),s=Pt(r===void 0?"iso8601":Ge(r)),l=fe(i);mr(l,o,a),tu(this,{year:l,month:o,day:a},s)}get monthCode(){return Cl(this,"monthCode")}get day(){return Cl(this,"day")}get calendarId(){return R(this,qt),m(this,U)}with(t,e=void 0){if(R(this,qt),!je(t))throw new TypeError("invalid argument");jr(t);let r=m(this,U),i=Ct(r,m(this,me),"month-day");return i=hr(r,i,Jt(r,t,["year","month","monthCode","day"],[],"partial")),xr(Ro(r,i,Ee(ie(e))),r)}equals(t){R(this,qt);let e=nl(t);return bn(m(this,me),m(e,me))===0&&yn(m(this,U),m(e,U))}toString(t=void 0){return R(this,qt),sl(this,Ui(ie(t)))}toJSON(){return R(this,qt),sl(this)}toLocaleString(t=void 0,e=void 0){return R(this,qt),new Gt(t,e).format(this)}valueOf(){Xn("PlainMonthDay")}toPlainDate(t){if(R(this,qt),!je(t))throw new TypeError("argument should be an object");let e=m(this,U);return Tt(Kn(e,hr(e,Ct(e,m(this,me),"month-day"),Jt(e,t,["year"],[],[])),"constrain"),e)}static from(t,e=void 0){return nl(t,e)}};function Cl(n,t){R(n,qt);let e=m(n,me);return Wi(n).isoToDate(e,{[t]:!0})[t]}function Za(n){return nn(n,gs())}On(Hi,"Temporal.PlainMonthDay");var Cu={instant:()=>sn(gs()),plainDateTimeISO:(n=si())=>Qt(Za(St(n)),"iso8601"),plainDateISO:(n=si())=>Tt(Za(St(n)).isoDate,"iso8601"),plainTimeISO:(n=si())=>Cn(Za(St(n)).time),timeZoneId:()=>si(),zonedDateTimeISO:(n=si())=>{let t=St(n);return at(gs(),t,"iso8601")},[Symbol.toStringTag]:"Temporal.Now"};Object.defineProperty(Cu,Symbol.toStringTag,{value:"Temporal.Now",writable:!1,enumerable:!1,configurable:!0});var Bi=class n{constructor(t=0,e=0,r=0,i=0,o=0,a=0){let s=t===void 0?0:fe(t),l=e===void 0?0:fe(e),u=r===void 0?0:fe(r),h=i===void 0?0:fe(i),p=o===void 0?0:fe(o),y=a===void 0?0:fe(a);Jo(s,l,u,h,p,y),nu(this,{hour:s,minute:l,second:u,millisecond:h,microsecond:p,nanosecond:y})}get hour(){return R(this,Ue),m(this,$e).hour}get minute(){return R(this,Ue),m(this,$e).minute}get second(){return R(this,Ue),m(this,$e).second}get millisecond(){return R(this,Ue),m(this,$e).millisecond}get microsecond(){return R(this,Ue),m(this,$e).microsecond}get nanosecond(){return R(this,Ue),m(this,$e).nanosecond}with(t,e=void 0){if(R(this,Ue),!je(t))throw new TypeError("invalid argument");jr(t);let r=as(t,"partial"),i=as(this),{hour:o,minute:a,second:s,millisecond:l,microsecond:u,nanosecond:h}=Object.assign(i,r),p=Ee(ie(e));return{hour:o,minute:a,second:s,millisecond:l,microsecond:u,nanosecond:h}=Go(o,a,s,l,u,h,p),new n(o,a,s,l,u,h)}add(t){return R(this,Ue),_l("add",this,t)}subtract(t){return R(this,Ue),_l("subtract",this,t)}until(t,e=void 0){return R(this,Ue),gl("until",this,t,e)}since(t,e=void 0){return R(this,Ue),gl("since",this,t,e)}round(t){if(R(this,Ue),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?gr("smallestUnit",t):ie(t),r=zr(e),i=ln(e,"halfExpand"),o=Ot(e,"smallestUnit","time",An);return Ur(r,{hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o],!1),Cn(ps(m(this,$e),r,o,i))}equals(t){R(this,Ue);let e=Un(t);return fs(m(this,$e),m(e,$e))===0}toString(t=void 0){R(this,Ue);let e=ie(t),r=Vi(e),i=ln(e,"trunc"),o=Ot(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}=qi(o,r);return al(ps(m(this,$e),l,s,i),a)}toJSON(){return R(this,Ue),al(m(this,$e),"auto")}toLocaleString(t=void 0,e=void 0){return R(this,Ue),new Gt(t,e).format(this)}valueOf(){Xn("PlainTime")}static from(t,e=void 0){return Un(t,e)}static compare(t,e){let r=Un(t),i=Un(e);return fs(m(r,$e),m(i,$e))}};On(Bi,"Temporal.PlainTime");var Fi=class{constructor(t,e,r="iso8601",i=1){let o=fe(t),a=fe(e),s=Pt(r===void 0?"iso8601":Ge(r)),l=fe(i);mr(o,a,l),ru(this,{year:o,month:a,day:l},s)}get year(){return _n(this,"year")}get month(){return _n(this,"month")}get monthCode(){return _n(this,"monthCode")}get calendarId(){return R(this,tt),m(this,U)}get era(){return _n(this,"era")}get eraYear(){return _n(this,"eraYear")}get daysInMonth(){return _n(this,"daysInMonth")}get daysInYear(){return _n(this,"daysInYear")}get monthsInYear(){return _n(this,"monthsInYear")}get inLeapYear(){return _n(this,"inLeapYear")}with(t,e=void 0){if(R(this,tt),!je(t))throw new TypeError("invalid argument");jr(t);let r=m(this,U),i=Ct(r,m(this,me),"year-month");return i=hr(r,i,Jt(r,t,["year","month","monthCode"],[],"partial")),Ar(Si(r,i,Ee(ie(e))),r)}add(t,e=void 0){return R(this,tt),Ml("add",this,t,e)}subtract(t,e=void 0){return R(this,tt),Ml("subtract",this,t,e)}until(t,e=void 0){return R(this,tt),yl("until",this,t,e)}since(t,e=void 0){return R(this,tt),yl("since",this,t,e)}equals(t){R(this,tt);let e=pi(t);return bn(m(this,me),m(e,me))===0&&yn(m(this,U),m(e,U))}toString(t=void 0){return R(this,tt),cl(this,Ui(ie(t)))}toJSON(){return R(this,tt),cl(this)}toLocaleString(t=void 0,e=void 0){return R(this,tt),new Gt(t,e).format(this)}valueOf(){Xn("PlainYearMonth")}toPlainDate(t){if(R(this,tt),!je(t))throw new TypeError("argument should be an object");let e=m(this,U);return Tt(Kn(e,hr(e,Ct(e,m(this,me),"year-month"),Jt(e,t,["day"],[],[])),"constrain"),e)}static from(t,e=void 0){return pi(t,e)}static compare(t,e){let r=pi(t),i=pi(e);return bn(m(r,me),m(i,me))}};function _n(n,t){R(n,tt);let e=m(n,me);return Wi(n).isoToDate(e,{[t]:!0})[t]}On(Fi,"Temporal.PlainYearMonth");var em=Gt.prototype.resolvedOptions,Yi=class{constructor(t,e,r="iso8601"){if(arguments.length<1)throw new TypeError("missing argument: epochNanoseconds is required");let i=Oo(t),o=Ge(e),{tzName:a,offsetMinutes:s}=qn(o);if(s===void 0){let l=xo(a);if(!l)throw new RangeError(`unknown time zone ${a}`);o=l.identifier}else o=Ys(s);ou(this,i,o,Pt(r===void 0?"iso8601":Ge(r)))}get calendarId(){return R(this,be),m(this,U)}get timeZoneId(){return R(this,be),m(this,ke)}get year(){return ft(this,"year")}get month(){return ft(this,"month")}get monthCode(){return ft(this,"monthCode")}get day(){return ft(this,"day")}get hour(){return kr(this,"hour")}get minute(){return kr(this,"minute")}get second(){return kr(this,"second")}get millisecond(){return kr(this,"millisecond")}get microsecond(){return kr(this,"microsecond")}get nanosecond(){return kr(this,"nanosecond")}get era(){return ft(this,"era")}get eraYear(){return ft(this,"eraYear")}get epochMilliseconds(){return R(this,be),rn(m(this,he),"floor")}get epochNanoseconds(){return R(this,be),wu(m(this,he))}get dayOfWeek(){return ft(this,"dayOfWeek")}get dayOfYear(){return ft(this,"dayOfYear")}get weekOfYear(){return ft(this,"weekOfYear")?.week}get yearOfWeek(){return ft(this,"weekOfYear")?.year}get hoursInDay(){R(this,be);let t=m(this,ke),e=hn(this).isoDate,r=Ht(e.year,e.month,e.day+1),i=jn(t,e),o=jn(t,r);return Ei(Pe.fromEpochNsDiff(o,i),"hour")}get daysInWeek(){return ft(this,"daysInWeek")}get daysInMonth(){return ft(this,"daysInMonth")}get daysInYear(){return ft(this,"daysInYear")}get monthsInYear(){return ft(this,"monthsInYear")}get inLeapYear(){return ft(this,"inLeapYear")}get offset(){return R(this,be),ss(kn(m(this,ke),m(this,he)))}get offsetNanoseconds(){return R(this,be),kn(m(this,ke),m(this,he))}with(t,e=void 0){if(R(this,be),!je(t))throw new TypeError("invalid zoned-date-time-like");jr(t);let r=m(this,U),i=m(this,ke),o=kn(i,m(this,he)),a=hn(this),s={...Ct(r,a.isoDate),...a.time,offset:ss(o)};s=hr(r,s,Jt(r,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset"],"partial"));let l=ie(e),u=Di(l),h=To(l,"prefer"),p=Gi(r,s,Ee(l)),y=Vr(s.offset);return at(Io(p.isoDate,p.time,"option",y,i,u,h,!1),i,r)}withPlainTime(t=void 0){R(this,be);let e=m(this,ke),r=m(this,U),i=hn(this).isoDate,o;return o=t===void 0?jn(e,i):ct(e,Me(i,m(Un(t),$e)),"compatible"),at(o,e,r)}withTimeZone(t){R(this,be);let e=St(t);return at(m(this,he),e,m(this,U))}withCalendar(t){R(this,be);let e=Zi(t);return at(m(this,he),m(this,ke),e)}add(t,e=void 0){return R(this,be),Tl("add",this,t,e)}subtract(t,e=void 0){return R(this,be),Tl("subtract",this,t,e)}until(t,e=void 0){return R(this,be),vl("until",this,t,e)}since(t,e=void 0){return R(this,be),vl("since",this,t,e)}round(t){if(R(this,be),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?gr("smallestUnit",t):ie(t),r=zr(e),i=ln(e,"halfExpand"),o=Ot(e,"smallestUnit","time",An,["day"]),a={day:1,hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o];if(Ur(r,a,a===1),o==="nanosecond"&&r===1)return at(m(this,he),m(this,ke),m(this,U));let s=m(this,ke),l=m(this,he),u=hn(this),h;if(o==="day"){let p=u.isoDate,y=Ht(p.year,p.month,p.day+1),D=jn(s,p),T=jn(s,y),S=k.default.subtract(T,D);h=Pe.fromEpochNsDiff(l,D).round(S,i).addToEpochNs(D)}else{let p=ms(u,r,o,i),y=kn(s,l);h=Io(p.isoDate,p.time,"option",y,s,"compatible","prefer",!1)}return at(h,s,m(this,U))}equals(t){R(this,be);let e=fi(t),r=m(this,he),i=m(e,he);return!!k.default.equal(k.default.BigInt(r),k.default.BigInt(i))&&!!au(m(this,ke),m(e,ke))&&yn(m(this,U),m(e,U))}toString(t=void 0){R(this,be);let e=ie(t),r=Ui(e),i=Vi(e),o=function(y){return Rn(y,"offset",["auto","never"],"auto")}(e),a=ln(e,"trunc"),s=Ot(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 Rn(y,"timeZoneName",["auto","never","critical"],"auto")}(e),{precision:u,unit:h,increment:p}=qi(s,i);return ll(this,u,r,l,o,{unit:h,increment:p,roundingMode:a})}toLocaleString(t=void 0,e=void 0){R(this,be);let r=ie(e),i=Object.create(null);if(function(l,u,h,p){if(u==null)return;let y=Reflect.ownKeys(u);for(let D=0;D<y.length;D++){let T=y[D];if(!h.some(S=>Object.is(S,T))&&Object.prototype.propertyIsEnumerable.call(u,T)){let S=u[T];l[T]=S}}}(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=m(this,ke),ul(i.timeZone))throw new RangeError("toLocaleString does not currently support offset time zones");let o=new Gt(t,i),a=em.call(o).calendar,s=m(this,U);if(s!=="iso8601"&&a!=="iso8601"&&!yn(a,s))throw new RangeError(`cannot format ZonedDateTime with calendar ${s} in locale with calendar ${a}`);return o.format(sn(m(this,he)))}toJSON(){return R(this,be),ll(this,"auto")}valueOf(){Xn("ZonedDateTime")}startOfDay(){R(this,be);let t=m(this,ke);return at(jn(t,hn(this).isoDate),t,m(this,U))}getTimeZoneTransition(t){R(this,be);let e=m(this,ke);if(t===void 0)throw new TypeError("options parameter is required");let r=Rn(typeof t=="string"?gr("direction",t):ie(t),"direction",["next","previous"],An);if(r===void 0)throw new TypeError("direction option is required");if(ul(e)||e==="UTC")return null;let i=m(this,he),o=r==="next"?js(e,i):ls(e,i);return o===null?null:at(o,e,m(this,U))}toInstant(){return R(this,be),sn(m(this,he))}toPlainDate(){return R(this,be),Tt(hn(this).isoDate,m(this,U))}toPlainTime(){return R(this,be),Cn(hn(this).time)}toPlainDateTime(){return R(this,be),Qt(hn(this),m(this,U))}static from(t,e=void 0){return fi(t,e)}static compare(t,e){let r=fi(t),i=fi(e),o=m(r,he),a=m(i,he);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 hn(n){return nn(m(n,ke),m(n,he))}function ft(n,t){R(n,be);let e=hn(n).isoDate;return Wi(n).isoToDate(e,{[t]:!0})[t]}function kr(n,t){return R(n,be),hn(n).time[t]}On(Yi,"Temporal.ZonedDateTime");var Ae=Object.freeze({__proto__:null,Duration:Oi,Instant:Ai,Now:Cu,PlainDate:Li,PlainDateTime:Ni,PlainMonthDay:Hi,PlainTime:Bi,PlainYearMonth:Fi,ZonedDateTime:Yi}),Jm=class{toTemporalInstant(){return sn(cn(Date.prototype.valueOf.call(this)))}}.prototype.toTemporalInstant,tm=[Ai,Li,Ni,Oi,Hi,Bi,Fi,Yi];for(let n of tm){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))}function Zs(n){let t=Object.create(null);for(let e of n.split(","))t[e]=1;return e=>e in t}var Js=Object.assign;var nm=Object.prototype.hasOwnProperty,na=(n,t)=>nm.call(n,t),Dr=Array.isArray,no=n=>Pu(n)==="[object Map]";var ku=n=>typeof n=="function",rm=n=>typeof n=="string",Wr=n=>typeof n=="symbol",ro=n=>n!==null&&typeof n=="object";var im=Object.prototype.toString,Pu=n=>im.call(n),Iu=n=>Pu(n).slice(8,-1);var ra=n=>rm(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n;var ia=n=>{let t=Object.create(null);return e=>t[e]||(t[e]=n(e))},om=/-(\w)/g,ep=ia(n=>n.replace(om,(t,e)=>e?e.toUpperCase():"")),am=/\B([A-Z])/g,tp=ia(n=>n.replace(am,"-$1").toLowerCase()),sm=ia(n=>n.charAt(0).toUpperCase()+n.slice(1)),np=ia(n=>n?`on${sm(n)}`:""),Er=(n,t)=>!Object.is(n,t);var cm="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";var rp=Zs(cm+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var Xs;var Le;var Qs=new WeakSet,sa=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,Xs&&Xs.active&&Xs.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Qs.has(this)&&(Qs.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Lu(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Ru(this),Nu(this);let t=Le,e=un;Le=this,un=!0;try{return this.fn()}finally{Ou(this),Le=t,un=e,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)pc(t);this.deps=this.depsTail=void 0,Ru(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Qs.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){nc(this)&&this.run()}get dirty(){return nc(this)}},Au=0,oo,ao;function Lu(n,t=!1){if(n.flags|=8,t){n.next=ao,ao=n;return}n.next=oo,oo=n}function hc(){Au++}function mc(){if(--Au>0)return;if(ao){let t=ao;for(ao=void 0;t;){let e=t.next;t.next=void 0,t.flags&=-9,t=e}}let n;for(;oo;){let t=oo;for(oo=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 Nu(n){for(let t=n.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ou(n){let t,e=n.depsTail,r=e;for(;r;){let i=r.prevDep;r.version===-1?(r===e&&(e=i),pc(r),lm(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}n.deps=t,n.depsTail=e}function nc(n){for(let t=n.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Hu(t.dep.computed)||t.dep.version!==t.version))return!0;return!!n._dirty}function Hu(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===so)||(n.globalVersion=so,!n.isSSR&&n.flags&128&&(!n.deps&&!n._dirty||!nc(n))))return;n.flags|=2;let t=n.dep,e=Le,r=un;Le=n,un=!0;try{Nu(n);let i=n.fn(n._value);(t.version===0||Er(i,n._value))&&(n.flags|=128,n._value=i,t.version++)}catch(i){throw t.version++,i}finally{Le=e,un=r,Ou(n),n.flags&=-3}}function pc(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)pc(o,!0)}!t&&!--e.sc&&e.map&&e.map.delete(e.key)}function lm(n){let{prevDep:t,nextDep:e}=n;t&&(t.nextDep=e,n.prevDep=void 0),e&&(e.prevDep=t,n.nextDep=void 0)}function Rt(n,t){n.effect instanceof sa&&(n=n.effect.fn);let e=new sa(n);t&&Js(e,t);try{e.run()}catch(i){throw e.stop(),i}let r=e.run.bind(e);return r.effect=e,r}var un=!0,Bu=[];function um(){Bu.push(un),un=!1}function dm(){let n=Bu.pop();un=n===void 0?!0:n}function Ru(n){let{cleanup:t}=n;if(n.cleanup=void 0,t){let e=Le;Le=void 0;try{t()}finally{Le=e}}}var so=0,rc=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}},co=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(!Le||!un||Le===this.computed)return;let e=this.activeLink;if(e===void 0||e.sub!==Le)e=this.activeLink=new rc(Le,this),Le.deps?(e.prevDep=Le.depsTail,Le.depsTail.nextDep=e,Le.depsTail=e):Le.deps=Le.depsTail=e,Fu(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=Le.depsTail,e.nextDep=void 0,Le.depsTail.nextDep=e,Le.depsTail=e,Le.deps===e&&(Le.deps=r)}return e}trigger(t){this.version++,so++,this.notify(t)}notify(t){hc();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{mc()}}};function Fu(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)Fu(r)}let e=n.dep.subs;e!==n&&(n.prevSub=e,e&&(e.nextSub=n)),n.dep.subs=n}}var ic=new WeakMap,_r=Symbol(""),oc=Symbol(""),lo=Symbol("");function Ft(n,t,e){if(un&&Le){let r=ic.get(n);r||ic.set(n,r=new Map);let i=r.get(e);i||(r.set(e,i=new co),i.map=r,i.key=e),i.track()}}function Qn(n,t,e,r,i,o){let a=ic.get(n);if(!a){so++;return}let s=l=>{l&&l.trigger()};if(hc(),t==="clear")a.forEach(s);else{let l=Dr(n),u=l&&ra(e);if(l&&e==="length"){let h=Number(r);a.forEach((p,y)=>{(y==="length"||y===lo||!Wr(y)&&y>=h)&&s(p)})}else switch((e!==void 0||a.has(void 0))&&s(a.get(e)),u&&s(a.get(lo)),t){case"add":l?u&&s(a.get("length")):(s(a.get(_r)),no(n)&&s(a.get(oc)));break;case"delete":l||(s(a.get(_r)),no(n)&&s(a.get(oc)));break;case"set":no(n)&&s(a.get(_r));break}}mc()}function Gr(n){let t=Re(n);return t===n?t:(Ft(t,"iterate",lo),er(n)?t:t.map(It))}function fc(n){return Ft(n=Re(n),"iterate",lo),n}var hm={__proto__:null,[Symbol.iterator](){return ec(this,Symbol.iterator,It)},concat(...n){return Gr(this).concat(...n.map(t=>Dr(t)?Gr(t):t))},entries(){return ec(this,"entries",n=>(n[1]=It(n[1]),n))},every(n,t){return Hn(this,"every",n,t,void 0,arguments)},filter(n,t){return Hn(this,"filter",n,t,e=>e.map(It),arguments)},find(n,t){return Hn(this,"find",n,t,It,arguments)},findIndex(n,t){return Hn(this,"findIndex",n,t,void 0,arguments)},findLast(n,t){return Hn(this,"findLast",n,t,It,arguments)},findLastIndex(n,t){return Hn(this,"findLastIndex",n,t,void 0,arguments)},forEach(n,t){return Hn(this,"forEach",n,t,void 0,arguments)},includes(...n){return tc(this,"includes",n)},indexOf(...n){return tc(this,"indexOf",n)},join(n){return Gr(this).join(n)},lastIndexOf(...n){return tc(this,"lastIndexOf",n)},map(n,t){return Hn(this,"map",n,t,void 0,arguments)},pop(){return io(this,"pop")},push(...n){return io(this,"push",n)},reduce(n,...t){return xu(this,"reduce",n,t)},reduceRight(n,...t){return xu(this,"reduceRight",n,t)},shift(){return io(this,"shift")},some(n,t){return Hn(this,"some",n,t,void 0,arguments)},splice(...n){return io(this,"splice",n)},toReversed(){return Gr(this).toReversed()},toSorted(n){return Gr(this).toSorted(n)},toSpliced(...n){return Gr(this).toSpliced(...n)},unshift(...n){return io(this,"unshift",n)},values(){return ec(this,"values",It)}};function ec(n,t,e){let r=fc(n),i=r[t]();return r!==n&&!er(n)&&(i._next=i.next,i.next=()=>{let o=i._next();return o.value&&(o.value=e(o.value)),o}),i}var mm=Array.prototype;function Hn(n,t,e,r,i,o){let a=fc(n),s=a!==n&&!er(n),l=a[t];if(l!==mm[t]){let p=l.apply(n,o);return s?It(p):p}let u=e;a!==n&&(s?u=function(p,y){return e.call(this,It(p),y,n)}:e.length>2&&(u=function(p,y){return e.call(this,p,y,n)}));let h=l.call(a,u,r);return s&&i?i(h):h}function xu(n,t,e,r){let i=fc(n),o=e;return i!==n&&(er(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 tc(n,t,e){let r=Re(n);Ft(r,"iterate",lo);let i=r[t](...e);return(i===-1||i===!1)&&Sm(e[0])?(e[0]=Re(e[0]),r[t](...e)):i}function io(n,t,e=[]){um(),hc();let r=Re(n)[t].apply(n,e);return mc(),dm(),r}var pm=Zs("__proto__,__v_isRef,__isVue"),Yu=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(Wr));function fm(n){Wr(n)||(n=String(n));let t=Re(this);return Ft(t,"has",n),t.hasOwnProperty(n)}var ca=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?_m:zu:o?Em:ju).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;let a=Dr(t);if(!i){let l;if(a&&(l=hm[e]))return l;if(e==="hasOwnProperty")return fm}let s=Reflect.get(t,e,Kr(t)?t:r);return(Wr(e)?Yu.has(e):pm(e))||(i||Ft(t,"get",e),o)?s:Kr(s)?a&&ra(e)?s:s.value:ro(s)?i?Jr(s):tr(s):s}},ac=class extends ca{constructor(t=!1){super(!1,t)}set(t,e,r,i){let o=t[e];if(!this._isShallow){let l=Zr(o);if(!er(r)&&!Zr(r)&&(o=Re(o),r=Re(r)),!Dr(t)&&Kr(o)&&!Kr(r))return l?!1:(o.value=r,!0)}let a=Dr(t)&&ra(e)?Number(e)<t.length:na(t,e),s=Reflect.set(t,e,r,Kr(t)?t:i);return t===Re(i)&&(a?Er(r,o)&&Qn(t,"set",e,r,o):Qn(t,"add",e,r)),s}deleteProperty(t,e){let r=na(t,e),i=t[e],o=Reflect.deleteProperty(t,e);return o&&r&&Qn(t,"delete",e,void 0,i),o}has(t,e){let r=Reflect.has(t,e);return(!Wr(e)||!Yu.has(e))&&Ft(t,"has",e),r}ownKeys(t){return Ft(t,"iterate",Dr(t)?"length":_r),Reflect.ownKeys(t)}},sc=class extends ca{constructor(t=!1){super(!0,t)}set(t,e){return!0}deleteProperty(t,e){return!0}},gm=new ac,ym=new sc;var cc=n=>n,oa=n=>Reflect.getPrototypeOf(n);function vm(n,t,e){return function(...r){let i=this.__v_raw,o=Re(i),a=no(o),s=n==="entries"||n===Symbol.iterator&&a,l=n==="keys"&&a,u=i[n](...r),h=e?cc:t?lc:It;return!t&&Ft(o,"iterate",l?oc:_r),{next(){let{value:p,done:y}=u.next();return y?{value:p,done:y}:{value:s?[h(p[0]),h(p[1])]:h(p),done:y}},[Symbol.iterator](){return this}}}}function aa(n){return function(...t){return n==="delete"?!1:n==="clear"?void 0:this}}function bm(n,t){let e={get(i){let o=this.__v_raw,a=Re(o),s=Re(i);n||(Er(i,s)&&Ft(a,"get",i),Ft(a,"get",s));let{has:l}=oa(a),u=t?cc:n?lc: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&&Ft(Re(i),"iterate",_r),Reflect.get(i,"size",i)},has(i){let o=this.__v_raw,a=Re(o),s=Re(i);return n||(Er(i,s)&&Ft(a,"has",i),Ft(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=Re(s),u=t?cc:n?lc:It;return!n&&Ft(l,"iterate",_r),s.forEach((h,p)=>i.call(o,u(h),u(p),a))}};return Js(e,n?{add:aa("add"),set:aa("set"),delete:aa("delete"),clear:aa("clear")}:{add(i){!t&&!er(i)&&!Zr(i)&&(i=Re(i));let o=Re(this);return oa(o).has.call(o,i)||(o.add(i),Qn(o,"add",i,i)),this},set(i,o){!t&&!er(o)&&!Zr(o)&&(o=Re(o));let a=Re(this),{has:s,get:l}=oa(a),u=s.call(a,i);u||(i=Re(i),u=s.call(a,i));let h=l.call(a,i);return a.set(i,o),u?Er(o,h)&&Qn(a,"set",i,o,h):Qn(a,"add",i,o),this},delete(i){let o=Re(this),{has:a,get:s}=oa(o),l=a.call(o,i);l||(i=Re(i),l=a.call(o,i));let u=s?s.call(o,i):void 0,h=o.delete(i);return l&&Qn(o,"delete",i,void 0,u),h},clear(){let i=Re(this),o=i.size!==0,a=void 0,s=i.clear();return o&&Qn(i,"clear",void 0,void 0,a),s}}),["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=vm(i,n,t)}),e}function $u(n,t){let e=bm(n,t);return(r,i,o)=>i==="__v_isReactive"?!n:i==="__v_isReadonly"?n:i==="__v_raw"?r:Reflect.get(na(e,i)&&i in r?e:r,i,o)}var wm={get:$u(!1,!1)};var Dm={get:$u(!0,!1)};var ju=new WeakMap,Em=new WeakMap,zu=new WeakMap,_m=new WeakMap;function Mm(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Tm(n){return n.__v_skip||!Object.isExtensible(n)?0:Mm(Iu(n))}function tr(n){return Zr(n)?n:Uu(n,!1,gm,wm,ju)}function Jr(n){return Uu(n,!0,ym,Dm,zu)}function Uu(n,t,e,r,i){if(!ro(n)||n.__v_raw&&!(t&&n.__v_isReactive))return n;let o=Tm(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 Zr(n){return!!(n&&n.__v_isReadonly)}function er(n){return!!(n&&n.__v_isShallow)}function Sm(n){return n?!!n.__v_raw:!1}function Re(n){let t=n&&n.__v_raw;return t?Re(t):n}var It=n=>ro(n)?tr(n):n,lc=n=>ro(n)?Jr(n):n;function Kr(n){return n?n.__v_isRef===!0:!1}function Ze(n){return Cm(n,!1)}function Cm(n,t){return Kr(n)?n:new uc(n,t)}var uc=class{constructor(t,e){this.dep=new co,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=e?t:Re(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||er(t)||Zr(t);t=r?t:Re(t),Er(t,e)&&(this._rawValue=t,this._value=r?t:It(t),this.dep.trigger())}};var dc=class{constructor(t,e,r){this.fn=t,this.setter=e,this._value=void 0,this.dep=new co(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=so-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!e,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&Le!==this)return Lu(this,!0),!0}get value(){let t=this.dep.track();return Hu(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}};function on(n,t,e=!1){let r,i;return ku(n)?r=n:(r=n.get,i=n.set),new dc(r,i,e)}var Fc=Vc(qu(),1);var gc=class{constructor(){L(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))}},la=new gc;function it(n,t){la.emit(n,t)}function nr(n,t){Array.isArray(n)?n.forEach(e=>la.on(e,t)):la.on(n,t)}var Wu={"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)",guestSingular:"Person",guestPlural:"People",couponValid:"Coupon is valid ;)",couponInvalid:"Coupon is invalid !",couponError:"Error validating coupon!",proceedToPayment:"Proceed to payment",completePayment:"Complete the payment",viewHotelPage:"View Site"},"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)",guestSingular:"Personne",guestPlural:"Personnes",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",viewHotelPage:"Voir le site"}},ze=n=>Wu[Xr().bcp47][n]||Wu["fr-FR"][n],Je=n=>{let t=Xr().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"]||"")};var Xr=()=>{let{lang:n}=document.documentElement,t={iso639:"fr",bcp47:"fr-FR"};return n.includes("en")&&(t={iso639:"en",bcp47:"en-US"}),t},qe=Xr().bcp47,Ep=Xr().iso639;var J=class n{static getCurrentDate(){return Ae.Now.plainDateISO()}static fromString(t){return Ae.PlainDate.from(this.safeParsePlainDate(t))}static formatForDisplay(t,e={weekday:"short",month:"short",day:"numeric"}){return t.toLocaleString(qe,e)}static formatForAPI(t){return(typeof t=="string"?Ae.PlainDate.from(t):Ae.PlainDate.from(t)).toZonedDateTime({timeZone:"Europe/Paris",plainTime:Ae.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 Ae.PlainDate.compare(t,e)>0}static isAfterOrEqual(t,e){return Ae.PlainDate.compare(t,e)<0}static isSameDate(t,e){return Ae.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 Ae.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 Ae.PlainDate.from(e)}return Ae.PlainDate.from(t)}catch(e){return console.error("Error parsing date string:",e),n.getCurrentDate()}}};var Rp=localStorage.getItem("dev")==="true";var xp=3*60*60*1e3;var ua="calendar-day-price",Gu="DD/MM/YYYY",Ku="Y-m-d",Zu=!1,Pm=365,yc=J.getCurrentDate(),Ju=J.addDays(yc,Pm),Qr=J.getCurrentDate(),uo=J.addDays(Qr,3),Im=J.getCurrentDate(),Ap=J.addDays(Im,30);function rr(n=!0,t=document.body){t.querySelectorAll('[data-fs-element="preloader"]').forEach(r=>{r.classList.toggle("hide",!n)})}var da="data-fs-element";var K=(n,t=document)=>t.querySelector(`[${da}="${n}"]`);var Xu=n=>`[${da}="${n.getAttribute(da)}"]`,Qu=n=>n.getAttribute(da);var vc=class{constructor(){L(this,"state",tr({appartmentsData:[],today:J.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}},rf=new vc;var Mr={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)),Mr.touch()}catch(e){console.error(`Error writing to localStorage for key ${n}:`,e)}},update:(n,t)=>{let e=Mr.get(n),r=t(e);Mr.set(n,r)},remove:n=>{localStorage.removeItem(n),Mr.touch()},clear:()=>{localStorage.clear()},has:n=>localStorage.getItem(n)!==null,touch:()=>{localStorage.setItem("lastUpdater",xm()||"root")}},xm=()=>localStorage.getItem("lastUpdater");var ir=Mr.get("form_state"),ed=ir?{enterpriseId:ir.enterpriseId||"",startDate:ir.startDate||"",endDate:ir.endDate||"",guests:ir.guests||0,coupon:ir.coupon||"",referrer:ir.referrer||window.location.href,rooms:ir.rooms||0}:{enterpriseId:"",startDate:null,endDate:null,guests:0,coupon:"",referrer:window.location.href,rooms:0},Yt=tr(ed),Rm=Jr(ed);Rt(()=>{Mr.set("form_state",Yt)});var Am="https://yuna-backend.cbocher.workers.dev/mews",Lm="https://api.mews.com/api/distributor/v1",Nm="Yuna",Om="mewscache",Hm=!1,Bm=13,Fm=8,Ym=Ae.Duration.from({minutes:20}).milliseconds,$m=new Headers({Accept:"application/json, text/plain, */*","Content-Type":"application/json; charset=utf-8"}),ce={base_url:Am,bookingEngine_url:Lm,bookingEngineClient:Nm,bypassCache:Hm,headers:$m,cache_key:Om,ttl:Ym,beCheckInUTC:Bm,beCheckOutUTC:Fm};var ha=(n,t,e)=>`${n}:${t}:${JSON.stringify(e)}`;var ei=class{constructor(){L(this,"dbName","MewsAPICache");L(this,"version",2);L(this,"db",null);L(this,"initPromise",null);L(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 h=e!==void 0?e:ce.ttl,p=Ae.Instant.fromEpochMilliseconds(u.timestamp);if(Ae.Now.instant().since(p,{smallestUnit:"milliseconds"}).milliseconds>h){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:Ae.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:Ae.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=Ae.Now.instant().epochMilliseconds-ce.ttl,o=r.transaction("api_cache","readwrite"),a=o.objectStore("api_cache"),s=a.index("by-timestamp"),l=await new Promise((h,p)=>{let y=s.getAll(IDBKeyRange.upperBound(i));y.onsuccess=()=>h(y.result),y.onerror=()=>p(y.error)}),u=50;for(let h=0;h<l.length;h+=u){let p=l.slice(h,h+u);await Promise.all(p.map(y=>new Promise((D,T)=>{let S=a.delete(y.cacheKey);S.onsuccess=()=>D(),S.onerror=()=>T(S.error)}))),e+=p.length,h+u<l.length&&await new Promise(y=>setTimeout(y,0))}await new Promise((h,p)=>{o.oncomplete=()=>h(),o.onerror=()=>p(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,h)=>{let p=i.delete(l.cacheKey);p.onsuccess=()=>u(),p.onerror=()=>h(p.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 Bn=async(n,t,e=null,r=Ae.Duration.from({minutes:10}).milliseconds)=>{let i=new ei,o=ha(`booking-engine:${n}`,e||"null",t.body);if(!ce.bypassCache){let a=await i.get(o,r);if(a)return a}try{let a=await fetch(n,t);if(!a.ok)throw new Error(`Booking Engine API request failed: ${a.status} ${a.statusText}`);let s=await a.json();return i.set(o,s,e||"null").catch(l=>{console.error("Error setting booking engine cache:",l)}),s}catch(a){throw a instanceof Error?console.error(`BOOKING_ENGINE_FETCH_ERROR [${n}]`,a.message):console.error(a),a}};var td=async n=>{let t=`${ce.bookingEngine_url}/hotels/get`,e={Client:ce.bookingEngineClient,HotelId:n},r={method:"POST",headers:ce.headers,body:JSON.stringify(e)};return Bn(t,r,n)};var ma=(n,t)=>{let e=`${ce.bookingEngine_url}/reservations/getPricing`,r={method:"POST",headers:ce.headers,body:JSON.stringify(t)};return Bn(e,r,n)};var nd=(n,t)=>{let e=`${ce.bookingEngine_url}/services/getAvailability`,r={method:"POST",headers:ce.headers,body:JSON.stringify(t)};return Bn(e,r,n)},rd=(n,t)=>{let e=`${ce.bookingEngine_url}/services/getPricing`,r={method:"POST",headers:ce.headers,body:JSON.stringify(t)};return Bn(e,r,n)};var Xe=async(n,t,e=null,r=!1)=>{let i=new ei,o=ha(n,e||"null",t.body);if(!ce.bypassCache){let a=await i.get(o);if(a)return a}try{let a=new URL(ce.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 id=(n,t={})=>{let e={method:"POST",headers:ce.headers,body:JSON.stringify(t)};return Xe("/services/getAll",e,n)};function od(n){return n.Services.map(t=>({id:t.Id,enterpriseId:t.EnterpriseId,isActive:t.IsActive,name:Je(t.Names),startTime:t.StartTime,endTime:t.EndTime,type:t.Type,ordering:t.Ordering}))}var bc=Ze({});async function ad(n){if(bc.value[n])return bc.value[n];let t=await id(n),e=od(t);return bc.value[n]=e,e}var sd=(n,t)=>{let e={method:"POST",headers:ce.headers,body:JSON.stringify(t)};return Xe("/ageCategories/getAll",e,n)};function cd(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:Je(t.Names),shortName:t.ShortNames?Je(t.ShortNames):null,classification:t.Classification,isActive:t.IsActive,maximalAge:t.MaximalAge,minimalAge:t.MinimalAge,serviceId:t.ServiceId}))}var wc=Ze({});async function ld(n){if(wc.value[n])return wc.value[n];let t=await sd(n,{EnterpriseIds:[n]}),e=cd(t);return wc.value[n]=e,e}var ud=(n,t)=>{let e={method:"POST",headers:ce.headers,body:JSON.stringify(t)};return Xe("/products/getAll",e,n)};function dd(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 hd(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 md(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:Je(t.Names),shortName:t.ShortName,description:Je(t.Description),hideFromGuest:t.Options.HidePriceFromGuest,group:n.RateGroups.find(e=>e.Id===t.GroupId)||null,pricing:t.Pricing}))}function ho(n,t){return n.map(t)}function Dc(n){return{id:n.Id,serviceId:n.ServiceId,categoryId:n.CategoryId,isActive:n.IsActive,isDefault:n.IsDefault,name:Je(n.Names),shortName:Je(n.ShortNames),description:Je(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 pd(n){return{products:ho(n.Products,Dc),customerProducts:ho(n.CustomerProducts,Dc)}}var Ec=Ze({});async function fd(n,t){if(Ec.value[t])return Ec.value[t];let e=await ud(n,{ServiceIds:[t]}),r=pd(e);return Ec.value[t]=r,r}var gd=(n,t={})=>{let e={method:"POST",headers:ce.headers,body:JSON.stringify(t)};return Xe("/rates/getAll",e,n)};var _c=Ze({});async function pa(n,t){if(_c.value[t])return _c.value[t];let e=await gd(n,{ServiceIds:[t]}),r=md(e);return _c.value[t]=r,r}var yd=(n,t)=>{let e={method:"POST",headers:ce.headers,body:JSON.stringify(t)};return Xe("/services/getAvailability",e,n)};function vd(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 Mc=Ze({});async function bd(n,t,e,r){if(Mc.value[t])return Mc.value[t];let i=await yd(n,{ServiceId:t,FirstTimeUnitStartUtc:J.formatForAPI(e),LastTimeUnitStartUtc:J.formatForAPI(r)}),o=vd(i);return Mc.value[t]=o,o}var wd=(n,t)=>{let e={method:"POST",headers:ce.headers,body:JSON.stringify(t)};return Xe("/restrictions/getAll",e,n)};function Dd(n){if(!n||!n.Restrictions||!Array.isArray(n.Restrictions))throw new Error("Invalid service restrictions response format");return n.Restrictions}var Tc=Ze({});async function Ed(n,t,e,r){if(Tc.value[t])return Tc.value[t];let i=await wd(n,{ServiceIds:[t],CollidingUtc:{StartUtc:J.formatForAPI(e),EndUtc:J.formatForAPI(r)},Origin:"User"}),o=Dd(i);return Tc.value[t]=o,o}var _d=(n,t)=>{let e={method:"POST",headers:ce.headers,body:JSON.stringify(t)};return Xe("/rules/getAll",e,n)};function Md(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 Sc=Ze({});async function Td(n,t){if(Sc.value[t])return Sc.value[t];let e=await _d(n,{ServiceIds:[t],Extent:{RuleActions:!0}}),r=Md(e);return Sc.value[t]=r,r}var Sd=(n,t)=>{let e={method:"POST",headers:ce.headers,body:JSON.stringify(t)};return Xe("/rates/getPricing",e,n)};var Cc=Ze({});async function Cd(n,t,e,r){if(Cc.value[t])return Cc.value[t];let i=await Sd(n,{RateId:t,FirstTimeUnitStartUtc:J.formatForAPI(e),LastTimeUnitStartUtc:J.formatForAPI(r)}),o=dd(i);return Cc.value[t]=o,o}var fa=class{constructor(t,e){L(this,"enterprise");L(this,"rate",null);L(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 Cd(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 ga=class{constructor(t,e){L(this,"enterprise");L(this,"service",null);L(this,"products",[]);L(this,"customerProducts",[]);L(this,"restrictions",[]);L(this,"availabilities",[]);L(this,"rules",[]);L(this,"ageCategories",[]);L(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 bd(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 Ed(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 fd(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 pa(this.enterprise.getEnterpriseId(),this.service.id);if(this.rates=t.map(e=>new fa(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 Td(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 ld(this.enterprise.getEnterpriseId()),this.ageCategories}getAgeCategories(){if(this.ageCategories.length===0)throw new Error("Age categories are not initialized");return this.ageCategories}};var ti=class{constructor(t){L(this,"enterpriseId");L(this,"services",[]);L(this,"reservableService",null);this.enterpriseId=t}async initServices(){this.services=await ad(this.enterpriseId);let t=this.services.find(e=>e.type.toLowerCase()==="reservable");return t&&(this.reservableService=new ga(this,t)),this.services}getEnterpriseId(){return this.enterpriseId}getServices(){return this.services}getReservableService(){return this.reservableService?.getService()??null}};var x,Ne,Dn,or,kc=class{constructor(){_o(this,Dn);_o(this,x,tr({loading:!1,error:null,isFetching:!1,cmsApartmentData:{},enterpriseInstance:null,reservableService:null,startDate:null,endDate:null,rooms:[],couponCode:"",hotel:null,availabilities:null,rates:[],servicePricing:null,reservationPricing:null,serviceOnlyPricing:null,ageCategories:[],products:[],selectedRateId:null,be_pricing:null}));_o(this,Ne,{nightsCount:on(()=>!C(this,x).startDate||!C(this,x).endDate?0:C(this,x).startDate.until(C(this,x).endDate).days),selectedProducts:on(()=>C(this,x).products.filter(t=>t.selected)),maxAllowedRooms:on(()=>{if(!C(this,x).availabilities)return 0;let{categoryId:t}=C(this,x).cmsApartmentData,e=C(this,x).availabilities.CategoryAvailabilities.find(i=>i.CategoryId===t);return e?Math.min(...e.Availabilities.slice(0,-1)):0}),rates:on(()=>C(this,x).servicePricing?.Rates?C(this,x).servicePricing.Rates.map(t=>{let e=C(this,x).servicePricing?.RateGroups?.find(o=>o.Id===t.RateGroupId),i=C(this,x).servicePricing?.CategoryPrices.find(o=>o.CategoryId===C(this,x).cmsApartmentData.categoryId)?.OccupancyPrices.find(o=>{let a=C(this,x).rooms.flat(),s=Object.groupBy(a,u=>u.ageCategoryId),l={};return Object.entries(s).map(([u,h])=>{let p=h?.reduce((y,D)=>y+D.value,0);return l[u]=p||0,{ageCategoryId:u,totalPersons:p}}),o.Occupancies.every(u=>{let h=l[u.AgeCategoryId];return h===void 0||u.PersonCount===h})})?.RateGroupPrices?.find(o=>o.MinRateId===t.Id);return{id:t.Id,name:Je(t.Name),description:Je(t.Description),isPrivate:t.IsPrivate,currencyCode:t.CurrencyCode,ordering:t.Ordering,groupId:e?.Id??"",groupOrdering:e?.Ordering||0,price:i?.MinPrice,selected:!1}}).filter(t=>t.price!==void 0&&t.price.TotalAmount?.GrossValue!==void 0&&t.price.TotalAmount?.GrossValue>0):[]),summary:on(()=>{let t=C(this,x).reservationPricing?.OccupancyPrices??[],e=C(this,x).serviceOnlyPricing?.OccupancyPrices??[],r=C(this,x).cmsApartmentData?.name??"",{rooms:i}=C(this,x),o="EUR";if(C(this,x).isFetching||t.length===0||e.length===0)return{currency:o,nightCount:C(this,Ne).nightsCount.value,items:[],totals:{service:0,products:0,taxes:0,grandTotal:0}};let a=new Map;for(let D of e){let T=D.Pricing.find($=>$.RateId===C(this,x).selectedRateId);if(!T)continue;let N=T.Price.TotalAmount[o].Breakdown.Items.filter($=>$.TaxRateCode==="FR-R").reduce(($,G)=>$+G.NetValue,0);a.set(`${D.AdultCount}-${D.ChildCount}`,N)}let s=new Map;for(let D of t){let T=D.Pricing.find(oe=>oe.RateId===C(this,x).selectedRateId);if(!T)continue;let S=`${D.AdultCount}-${D.ChildCount}`,N=T.Price.TotalAmount[o],$=a.get(S)??0,G=C(this,Ne).nightsCount.value||1,W=$/G,ne=N.TaxValues.filter(oe=>oe.TaxRateCode==="FR-R").reduce((oe,Ce)=>oe+Ce.Value,0),le=N.GrossValue-$-ne;s.set(S,{rateId:T.RateId,pricing:{avgPerNight:W,service:$,products:le,taxes:ne,subtotal:N.GrossValue}})}let l=new Map;for(let D of i){let T=0,S=0;for(let $ of D)$.isAdult?T+=$.value:S+=$.value;let N=`${T}-${S}`;l.has(N)?l.get(N).quantity+=1:l.set(N,{adults:T,children:S,quantity:1})}if(!Array.from(l.keys()).every(D=>s.has(D)))return{currency:o,nightCount:C(this,Ne).nightsCount.value,items:[],totals:{service:0,products:0,taxes:0,grandTotal:0}};let p=Array.from(l.values()).map(D=>{let T=`${D.adults}-${D.children}`,S=s.get(T);return S?{key:T,roomName:r,occupancy:{adults:D.adults,children:D.children},quantity:D.quantity,rateId:S.rateId,pricing:S.pricing}:(console.warn(`[BookingState] Pricing not yet available for occupancy ${T}`,{availableOccupancies:Array.from(s.keys()),selectedRateId:C(this,x).selectedRateId,occupancyPricesCount:t.length}),{key:T,roomName:r,occupancy:{adults:D.adults,children:D.children},quantity:D.quantity,rateId:C(this,x).selectedRateId||"",pricing:{avgPerNight:0,service:0,products:0,taxes:0,subtotal:0}})}),y=p.reduce((D,T)=>(D.service+=T.pricing.service*T.quantity,D.products+=T.pricing.products*T.quantity,D.taxes+=T.pricing.taxes*T.quantity,D.grandTotal+=T.pricing.subtotal*T.quantity,D),{service:0,products:0,taxes:0,grandTotal:0});return{currency:o,nightCount:C(this,Ne).nightsCount.value,items:p,totals:y}}),totalStayPrice:on(()=>{let t=C(this,Ne).rates.value.find(e=>e.id===C(this,x).selectedRateId)?.price;return t?t.TotalAmount.GrossValue:0}),adultsCount:on(()=>C(this,x).rooms.reduce((t,e)=>t+e.reduce((r,i)=>r+(i.isAdult?i.value:0),0),0)),childrenCount:on(()=>C(this,x).rooms.reduce((t,e)=>t+e.reduce((r,i)=>r+(i.isAdult?0:i.value),0),0)),isAvailable:on(()=>{if(!C(this,x).availabilities)return!1;let{categoryId:t}=C(this,x).cmsApartmentData,e=C(this,x).availabilities.CategoryAvailabilities.find(r=>r.CategoryId===t);return e?e.Availabilities.slice(0,-1).every(r=>r>0):!1}),productsTotalPrice:on(()=>C(this,Ne).selectedProducts.value.reduce((e,r)=>{let i=0;switch(r.chargingMode){case"Once":i=r.price||0;break;case"PerTimeUnit":i=r.price*C(this,Ne).nightsCount.value||0;break;case"PerPersonPerTimeUnit":i=r.price*C(this,Ne).nightsCount.value*C(this,Ne).adultsCount.value||0;break;default:i=r.price}return e+i},0)),totalPrice:on(()=>C(this,Ne).totalStayPrice.value+C(this,Ne).productsTotalPrice.value)})}get startDate(){return C(this,x).startDate}get endDate(){return C(this,x).endDate}get rooms(){return C(this,x).rooms}get couponCode(){return C(this,x).couponCode}get hotel(){return C(this,x).hotel}get availabilities(){return C(this,x).availabilities}get rates(){return C(this,x).rates}get servicePricing(){return C(this,x).servicePricing}get reservationPricing(){return C(this,x).reservationPricing}get ageCategories(){return C(this,x).ageCategories}get products(){return C(this,x).products}get selectedRateId(){return C(this,x).selectedRateId}get be_pricing(){return C(this,x).be_pricing}get cmsApartmentData(){return C(this,x).cmsApartmentData}get enterpriseInstance(){return C(this,x).enterpriseInstance}get reservableService(){return C(this,x).reservableService}get isFetching(){return C(this,x).isFetching}get nightsCount(){return C(this,Ne).nightsCount.value}get selectedProducts(){return C(this,Ne).selectedProducts.value}get maxAllowedRooms(){return C(this,Ne).maxAllowedRooms.value}get computedRates(){return C(this,Ne).rates.value}get computedSummary(){return C(this,Ne).summary.value}get totalStayPrice(){return C(this,Ne).totalStayPrice.value}get adultsCount(){return C(this,Ne).adultsCount.value}get childrenCount(){return C(this,Ne).childrenCount.value}get isAvailable(){return C(this,Ne).isAvailable.value}get productsTotalPrice(){return C(this,Ne).productsTotalPrice.value}get totalPrice(){return C(this,Ne).totalPrice.value}setCmsApartmentData(t){C(this,x).cmsApartmentData=t,$n(this,Dn,or).call(this)}updateStartDate(t){C(this,x).startDate=t,t&&(Yt.startDate=t.toString()),$n(this,Dn,or).call(this)}updateEndDate(t){C(this,x).endDate=t,t&&(Yt.endDate=t.toString()),$n(this,Dn,or).call(this)}updateRooms(t){C(this,x).rooms=t,$n(this,Dn,or).call(this)}updateCouponCode(t){C(this,x).couponCode=t,$n(this,Dn,or).call(this)}updateSelectedRateId(t){C(this,x).selectedRateId=t,$n(this,Dn,or).call(this)}updateProducts(t){C(this,x).products=t,$n(this,Dn,or).call(this)}async initializeResources(t){C(this,x).loading=!0,C(this,x).error=null;try{C(this,x).enterpriseInstance=new ti(t),await C(this,x).enterpriseInstance.initServices(),C(this,x).reservableService=C(this,x).enterpriseInstance.reservableService,await C(this,x).reservableService?.initAgeCategories(),C(this,x).ageCategories=C(this,x).reservableService?.getAgeCategories()||[]}catch(e){let r=e instanceof Error?e.message:"Unknown error";throw C(this,x).error=r,console.error("[BXT] initializeResources: Error",e),e}finally{C(this,x).loading=!1}}async initializeRooms(t=1,e=1){(Yt.rooms==null||Yt.rooms<1)&&(Yt.rooms=t);let r=[];for(let i=0;i<(Yt.rooms||t);i++){let o=C(this,x).ageCategories.map(a=>{let s=a.classification.toLowerCase()==="adult",l=s?ze("adults"):ze("children"),u=s?i===0&&(Yt.guests||e)||1:0;return{isAdult:s,ageCategoryId:a.id,name:l,value:u}});r.push(o)}C(this,x).rooms=r}async fetchHotel(t){C(this,x).loading=!0,C(this,x).error=null,C(this,x).isFetching=!0;try{let e=await td(t);C(this,x).hotel=e,C(this,x).products=e?.Products.map(r=>({id:r.Id,name:Je(r.Name),description:Je(r.Description),categoryId:r.CategoryId,ordering:r.Ordering,imageIds:[r.ImageId],price:r.Prices.EUR,chargingMode:r.ChargingMode,selected:!1}))||[]}catch(e){let r=e instanceof Error?e.message:"Unknown error";throw C(this,x).error=r,console.error("[BXT] fetchHotel: Error",e),e}finally{C(this,x).loading=!1,C(this,x).isFetching=!1}}async fetchAvailability(t,e){if(!C(this,x).startDate||!C(this,x).endDate){console.warn("[BXT] fetchAvailability: Start date or end date is not set, skipping");return}if(J.isBefore(C(this,x).startDate,C(this,x).endDate)){console.warn("[BXT] fetchAvailability: Invalid date range, skipping");return}C(this,x).loading=!0,C(this,x).isFetching=!0;try{let r=J.formatForAPI(C(this,x).startDate),i=J.formatForAPI(C(this,x).endDate),o=await nd(t,{EnterpriseId:t,CategoryIds:[e],StartUtc:r,EndUtc:i,ServiceId:C(this,x).reservableService?.getService()?.id||"",Client:ce.bookingEngineClient,LanguageCode:"fr-FR"});C(this,x).availabilities=o}catch(r){let i=r instanceof Error?r.message:"Unknown error";throw C(this,x).error=i,console.error("[BXT] fetchAvailability: Error",r),r}finally{C(this,x).loading=!1,C(this,x).isFetching=!1}}async fetchServicePricing(t,e){if(!C(this,x).startDate||!C(this,x).endDate){console.warn("[BXT] fetchServicePricing: Start date or end date is not set, skipping");return}if(J.isBefore(C(this,x).startDate,C(this,x).endDate)){console.warn("[BXT] fetchServicePricing: Invalid date range, skipping");return}C(this,x).loading=!0,C(this,x).isFetching=!0;try{let r=J.formatForAPI(C(this,x).startDate),i=J.formatForAPI(C(this,x).endDate),o=await rd(t,{Client:ce.bookingEngineClient,EnterpriseId:t,StartUtc:r,EndUtc:i,ServiceId:C(this,x).reservableService?.getService()?.id||"",CategoryIds:[e],CurrencyCode:"EUR",voucherCode:C(this,x).couponCode||void 0});C(this,x).servicePricing=o}catch(r){let i=r instanceof Error?r.message:"Unknown error";throw C(this,x).error=i,console.error("[BXT] fetchServicePricing: Error",r),r}finally{C(this,x).loading=!1,C(this,x).isFetching=!1}}async fetchReservationPricing(t,e){if(!C(this,x).startDate||!C(this,x).endDate){console.warn("[BXT] fetchReservationPricing: Start date or end date is not set, skipping");return}if(J.isBefore(C(this,x).startDate,C(this,x).endDate)){console.warn("[BXT] fetchReservationPricing: Invalid date range, skipping");return}if(C(this,x).rooms.length===0){console.error("[BXT] fetchReservationPricing: No rooms set, skipping");return}C(this,x).loading=!0,C(this,x).isFetching=!0;try{let r=J.formatForAPI(C(this,x).startDate),i=J.formatForAPI(C(this,x).endDate),o=C(this,x).rooms.map(h=>({OccupancyData:h.filter(p=>p.value>0).map(p=>({AgeCategoryId:p.ageCategoryId,PersonCount:p.value}))})),a=C(this,Ne).selectedProducts.value.map(h=>h.id),s={Client:ce.bookingEngineClient,HotelId:t,StartUtc:r,EndUtc:i,RoomCategoryId:e,VoucherCode:C(this,x).couponCode||void 0,Occupancies:o},l,u;return a.length===0?(l=await ma(t,{...s,ProductIds:[]}),u=l):[l,u]=await Promise.all([ma(t,{...s,ProductIds:a}),ma(t,{...s,ProductIds:[]})]),C(this,x).reservationPricing=l,C(this,x).serviceOnlyPricing=u,C(this,x).be_pricing=l,l}catch(r){let i=r instanceof Error?r.message:"Unknown error";throw C(this,x).error=i,console.error("[BXT] fetchReservationPricing: Error",r),r}finally{C(this,x).loading=!1,C(this,x).isFetching=!1}}async fetchRates(t){if(!C(this,x).reservableService||!C(this,x).reservableService.getService()){console.warn("[BXT] fetchRates: No reservable service found, skipping");return}C(this,x).loading=!0;try{let e=C(this,x).reservableService.getService()?.id;C(this,x).rates=await pa(t,e)}catch(e){let r=e instanceof Error?e.message:"Unknown error";throw C(this,x).error=r,console.error("[BXT] fetchRates: Error",e),e}finally{C(this,x).loading=!1}}async fetchAllData(t,e){try{await this.initializeResources(t),await this.initializeRooms(),await this.fetchHotel(t),await this.fetchAvailability(t,e),await this.fetchServicePricing(t,e),await this.fetchReservationPricing(t,e),await this.fetchRates(t)}catch(r){throw console.error("[BXT] fetchAllData: Error in batch fetch",r),r}}getReadonlyState(){return Jr({...C(this,x),computed:{nightsCount:this.nightsCount,adultsCount:this.adultsCount,childrenCount:this.childrenCount,maxAllowedRooms:this.maxAllowedRooms,isAvailable:this.isAvailable,rates:this.computedRates,summary:this.computedSummary,totalStayPrice:this.totalStayPrice,productsTotalPrice:this.productsTotalPrice,totalPrice:this.totalPrice}})}getState(){let{enterpriseInstance:t,reservableService:e,...r}=C(this,x);return{...JSON.parse(JSON.stringify(r)),computed:{nightsCount:this.nightsCount,adultsCount:this.adultsCount,childrenCount:this.childrenCount,maxAllowedRooms:this.maxAllowedRooms,isAvailable:this.isAvailable,rates:this.computedRates,summary:this.computedSummary,totalStayPrice:this.totalStayPrice,productsTotalPrice:this.productsTotalPrice,totalPrice:this.totalPrice}}}};x=new WeakMap,Ne=new WeakMap,Dn=new WeakSet,or=function(){C(this,x).isFetching};var F=new kc;var kd=()=>{};function xt(n,t,e,r){return n?(n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)):kd}var ya=n=>n instanceof HTMLInputElement;var Pc=(n,t)=>(Array.isArray(t)||(t=[t]),t.map(r=>n.dispatchEvent(new Event(r,{bubbles:!0}))).every(r=>r));var lt=(n,t=!0)=>n.cloneNode(t);var mo=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=ya(e)?e.value:""}return t.toString()};var Ic=(n,t)=>{n.querySelectorAll(t||"*").forEach(r=>r.remove())};var po=(n,t)=>{let{type:e}=n,r=e==="radio";if(r||e==="checkbox"){if(!ya(n)||typeof t!="boolean"||t===n.checked||r&&t===!1)return;n.checked=t}else{if(n.value===t)return;n.value=t.toString()}Pc(n,["click","input","change"])};function Pd(n,t){return{rate:n,pricing:t}}function Rc(n){return n.isActive&&n.isEnabled&&n.isPublic&&!n.hideFromGuest}function Id(n,t){let e=t.filter(o=>jm(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=>zm(n,o.Exceptions)))}function jm(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=J.fromString(e);return t.Days.includes(r.toLocaleString("en-US",{weekday:"long"}))})&&!0}function va(n){if(!n)return null;try{return Ae.Duration.from(n).total({unit:"days"})}catch{return null}}function zm(n,t){let e=J.fromString(n.pricing?.datesUtc[0]),r=J.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=J.getCurrentDate(),a=e.since(o,{largestUnit:"day"}).days,s=va(t.MinAdvance),l=va(t.MaxAdvance),u=va(t.MinLength),h=va(t.MaxLength);return!!(u&&i<u||h&&i>h||s&&a<s||l&&a>l||!t.MinLength&&!t.MaxLength&&!t.MinAdvance&&!t.MaxAdvance)}var Rd=(n,t)=>{let e=n.find(s=>s.rate.isBaseRate),r=n.filter(s=>!Id(s,t)&&Rc(s.rate)),i=Object.groupBy(r,s=>s.rate.group?.Name||"unknown"),o=hd(r),a=Um(o);return{baseRate:e,allowedRates:r,groupedRates:i,datedPrices:o,lowestDatedPrices:a}};function Um(n){let t={};for(let[e,r]of Object.entries(n)){let i=1/0,o=r.filter(a=>Rc(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 xd=async n=>{let t=await Promise.all(n.map(async r=>{let i=new ti(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 h=await u.initPricing(J.formatForAPI(yc.toString()),J.formatForAPI(Ju.toString()));return Pd(u.getRate(),h)}));return Rd(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 Qe=class Qe extends Date{constructor(e=null,r="YYYY-MM-DD",i="en-US"){super(Qe.parseDateTime(e,r,i));L(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 Qe)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=Qe.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,h]of Object.entries(o)){let p=Number(u),{group:y,pattern:D}=Qe.formatPatterns(h[0],i);s[y]=p+1,s.value+=D,s.value+=".*?"}let l=new RegExp(`^${s.value}$`);if(l.test(e)){let u=l.exec(e),h=Number(u[s.year]),p=null;s.month?p=Number(u[s.month])-1:s.shortMonth?p=Qe.shortMonths(i).indexOf(u[s.shortMonth]):s.longMonth&&(p=Qe.longMonths(i).indexOf(u[s.longMonth]));let y=Number(u[s.day])||1,D=Number(u[s.hour]),T=Number.isNaN(D)?0:D,S=Number(u[s.minute]),N=Number.isNaN(S)?0:S,$=Number(u[s.second]),G=Number.isNaN($)?0:$,W=u[s.ampm];return W&&W==="PM"&&(T+=12,T===24&&(T=0)),new Date(h,p,y,T,N,G,0)}}}return new Date(new Date().setHours(0,0,0,0))}static shortMonths(e){return Qe.MONTH_JS.map(r=>new Date(2019,r).toLocaleString(e,{month:"short"}))}static longMonths(e){return Qe.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:`(${Qe.shortMonths(r).join("|")})`};case"MMMM":return{group:"longMonth",pattern:`(${Qe.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 Qe(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=Qe.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 Qe.shortMonths(r)[this.getMonth()];case"MMMM":return Qe.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""}}};L(Qe,"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),L(Qe,"MONTH_JS",[0,1,2,3,4,5,6,7,8,9,10,11]);var ge=Qe,xc=class{constructor(t){L(this,"picker");this.picker=t}render(t,e){t||(t=new ge),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 ge(this.picker.options.date):null,r=new ge,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}},Ac=class{constructor(t){L(this,"picker");L(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()}},ba=class{constructor(t){L(this,"Calendar",new xc(this));L(this,"PluginManager",new Ac(this));L(this,"calendars",[]);L(this,"datePicked",[]);L(this,"cssLoaded",0);L(this,"binds",{hidePicker:this.hidePicker.bind(this),show:this.show.bind(this)});L(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:[]});L(this,"ui",{container:null,shadowRoot:null,wrapper:null});L(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 ge(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 ge(t,this.options.format);this.options.date=e.clone(),this.updateValues(),this.calendars.length&&this.renderAll()}getDate(){return this.options.date instanceof ge?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 ge(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 ge(this.options.date,this.options.format):this.calendars[0]=new ge}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}}},_a=Object.freeze({__proto__:null,Core:ba,create:ba}),fo=class{constructor(){L(this,"picker");L(this,"options");L(this,"priority",0);L(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()}},wa=class extends fo{constructor(){super(...arguments);L(this,"priority",1);L(this,"binds",{onView:this.onView.bind(this)});L(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 ge(this.options.minDate,this.picker.options.format,this.picker.options.lang)),this.options.maxDate&&(this.options.maxDate=new ge(this.options.maxDate,this.picker.options.format,this.picker.options.lang),this.options.maxDate instanceof ge&&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 ge&&o.isSameOrBefore(this.options.minDate,"month")&&i.classList.add("no-previous-month"),this.options.maxDate instanceof ge&&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,h=!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)){h=!0;break}l.subtract(1,"day")}u&&h&&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 ge(Number(i.dataset.start)),s=new ge(Number(i.dataset.end)),l=s.diff(a,"day"),u=this.options.minDays&&l<this.options.minDays,h=this.options.maxDays&&l>this.options.maxDays;(u||h||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 ge&&e.isBefore(this.options.minDate,"day")}lockMaxDate(e){return this.options.maxDate instanceof ge&&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 Da=class extends fo{constructor(){super(...arguments);L(this,"tooltipElement");L(this,"triggerElement");L(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)});L(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 ge(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 ge(e,this.picker.options.format);this.options.startDate=r?r.clone():null,this.updateValues(),this.picker.renderAll()}setEndDate(e){let r=new ge(e,this.picker.options.format);this.options.endDate=r?r.clone():null,this.updateValues(),this.picker.renderAll()}setDateRange(e,r){let i=new ge(e,this.picker.options.format),o=new ge(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 ge(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 ge(l.dataset.time),h=this.picker.Calendar.getCalendarDayView(u);u.isBetween(o,a)&&h.classList.add("in-range"),u.isSame(this.picker.datePicked[0],"day")&&(h.classList.add("start"),h.classList.toggle("flipped",s)),l===i&&(h.classList.add("end"),h.classList.toggle("flipped",s)),l.className=h.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),h=`${l} ${this.options.locale[u]}`;this.showTooltip(i,h)}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 ge(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 Ea=class extends fo{constructor(){super(...arguments);L(this,"rangePlugin");L(this,"lockPlugin");L(this,"priority",10);L(this,"binds",{onView:this.onView.bind(this),onColorScheme:this.onColorScheme.bind(this)});L(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>'}});L(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 h=document.createElement("option"),p=new ge(new Date(o.getFullYear(),u,2,0,0,0)),y=new ge(new Date(o.getFullYear(),u,1,0,0,0));h.value=String(u),h.text=p.toLocaleString(this.picker.options.lang,{month:"long"}),this.lockPlugin&&(h.disabled=this.lockPlugin.options.minDate&&y.isBefore(new ge(this.lockPlugin.options.minDate),"month")||this.lockPlugin.options.maxDate&&y.isAfter(new ge(this.lockPlugin.options.maxDate),"month")),h.selected=y.getMonth()===o.getMonth(),l.appendChild(h)}l.addEventListener("change",u=>{let h=u.target;this.picker.calendars[0].setDate(1),this.picker.calendars[0].setMonth(Number(h.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,h=this.options.dropdown.maxYear?this.options.dropdown.maxYear:new Date().getFullYear();if(o.getFullYear()>h){let p=document.createElement("option");p.value=String(o.getFullYear()),p.text=String(o.getFullYear()),p.selected=!0,p.disabled=!0,l.appendChild(p)}for(let p=h;p>=u;p-=1){let y=document.createElement("option"),D=new ge(new Date(p,0,1,0,0,0));y.value=String(p),y.text=String(p),this.lockPlugin&&(y.disabled=this.lockPlugin.options.minDate&&D.isBefore(new ge(this.lockPlugin.options.minDate),"year")||this.lockPlugin.options.maxDate&&D.isAfter(new ge(this.lockPlugin.options.maxDate),"year")),y.selected=o.getFullYear()===p,l.appendChild(y)}if(o.getFullYear()<u){let p=document.createElement("option");p.value=String(o.getFullYear()),p.text=String(o.getFullYear()),p.selected=!0,p.disabled=!0,l.appendChild(p)}if(this.options.dropdown.years==="asc"){let p=Array.prototype.slice.call(l.childNodes).reverse();l.innerHTML="",p.forEach(y=>{y.innerHTML=y.value,l.appendChild(y)})}l.addEventListener("change",p=>{let y=p.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 ge(o.dataset.time);else{let h=i.querySelector(".day");s=new ge(h.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 Ma=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],ar={_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 Ta={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=Ta;var ut=function(n,t){return t===void 0&&(t=2),("000"+n).slice(t*-1)},$t=function(n){return n===!0?1:0};function Lc(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 dt(n,t,e){if(e===!0)return n.classList.add(t);n.classList.remove(t)}function Se(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 go(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Nc(n,t){if(t(n))return n;if(n.parentNode)return Nc(n.parentNode,t)}function yo(n,t){var e=Se("div","numInputWrapper"),r=Se("input","numInput "+n),i=Se("span","arrowUp"),o=Se("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 jt(n){try{if(typeof n.composedPath=="function"){var t=n.composedPath();return t[0]}return n.target}catch{return n.target}}var Oc=function(){},vo=function(n,t,e){return e.months[t?"shorthand":"longhand"][n]},Ad={D:Oc,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*$t(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:Oc,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:Oc,y:function(n,t){n.setFullYear(2e3+parseFloat(t))}},Fn={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})"},ni={Z:function(n){return n.toISOString()},D:function(n,t,e){return t.weekdays.shorthand[ni.w(n,t,e)]},F:function(n,t,e){return vo(ni.n(n,t,e)-1,!1,t)},G:function(n,t,e){return ut(ni.h(n,t,e))},H:function(n){return ut(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[$t(n.getHours()>11)]},M:function(n,t){return vo(n.getMonth(),!0,t)},S:function(n){return ut(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,t,e){return e.getWeek(n)},Y:function(n){return ut(n.getFullYear(),4)},d:function(n){return ut(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return ut(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,t){return t.weekdays.longhand[n.getDay()]},m:function(n){return ut(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 Hc=function(n){var t=n.config,e=t===void 0?ar:t,r=n.l10n,i=r===void 0?Ta:r,o=n.isMobile,a=o===void 0?!1:o;return function(s,l,u){var h=u||i;return e.formatDate!==void 0&&!a?e.formatDate(s,l,h):l.split("").map(function(p,y,D){return ni[p]&&D[y-1]!=="\\"?ni[p](s,h,e):p!=="\\"?p:""}).join("")}},ka=function(n){var t=n.config,e=t===void 0?ar:t,r=n.l10n,i=r===void 0?Ta:r;return function(o,a,s,l){if(!(o!==0&&!o)){var u=l||i,h,p=o;if(o instanceof Date)h=new Date(o.getTime());else if(typeof o!="string"&&o.toFixed!==void 0)h=new Date(o);else if(typeof o=="string"){var y=a||(e||ar).dateFormat,D=String(o).trim();if(D==="today")h=new Date,s=!0;else if(e&&e.parseDate)h=e.parseDate(o,y);else if(/Z$/.test(D)||/GMT$/.test(D))h=new Date(o);else{for(var T=void 0,S=[],N=0,$=0,G="";N<y.length;N++){var W=y[N],ne=W==="\\",le=y[N-1]==="\\"||ne;if(Fn[W]&&!le){G+=Fn[W];var oe=new RegExp(G).exec(o);oe&&(T=!0)&&S[W!=="Y"?"push":"unshift"]({fn:Ad[W],val:oe[++$]})}else ne||(G+=".")}h=!e||!e.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),S.forEach(function(Ce){var Te=Ce.fn,se=Ce.val;return h=Te(h,se,u)||h}),h=T?h:void 0}}if(!(h instanceof Date&&!isNaN(h.getTime()))){e.errorHandler(new Error("Invalid date provided: "+p));return}return s===!0&&h.setHours(0,0,0,0),h}}};function zt(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 Ld=function(n,t,e){return n>Math.min(t,e)&&n<Math.max(t,e)},Pa=function(n,t,e){return n*3600+t*60+e},Nd=function(n){var t=Math.floor(n/3600),e=(n-t*3600)/60;return[t,e,n-t*3600-e*60]},Od={DAY:864e5};function Ia(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 ht=function(){return ht=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},ht.apply(this,arguments)},Hd=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},Vm=300;function qm(n,t){var e={config:ht(ht({},ar),We.defaultConfig),l10n:Sa};e.parseDate=ka({config:e.config,l10n:e.l10n}),e._handlers=[],e.pluginElements=[],e.loadedPlugins=[],e._bind=S,e._setHoursFromDate=y,e._positionCalendar=Yn,e.changeMonth=_,e.changeYear=re,e.clear=I,e.close=P,e.onMouseOver=we,e._createElement=Se,e.createDay=oe,e.destroy=j,e.isEnabled=Z,e.jumpToDate=G,e.updateValue=En,e.open=Oe,e.redraw=wo,e.set=Vd,e.setDate=qd,e.toggle=Zd;function r(){e.utils={getDaysInMonth:function(f,b){return f===void 0&&(f=e.currentMonth),b===void 0&&(b=e.currentYear),f===1&&(b%4===0&&b%100!==0||b%400===0)?29:e.l10n.daysInMonth[f]}}}function i(){e.element=e.input=n,e.isOpen=!1,ot(),sr(),Gd(),Wd(),r(),e.isMobile||le(),$(),(e.selectedDates.length||e.config.noCalendar)&&(e.config.enableTime&&y(e.config.noCalendar?e.latestSelectedDateObj:void 0),En(!1)),s();var f=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!e.isMobile&&f&&Yn(),Be("onReady")}function o(){var f;return((f=e.calendarContainer)===null||f===void 0?void 0:f.getRootNode()).activeElement||document.activeElement}function a(f){return f.bind(e)}function s(){var f=e.config;f.weekNumbers===!1&&f.showMonths===1||f.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 b=(e.days.offsetWidth+1)*f.showMonths;e.daysContainer.style.width=b+"px",e.calendarContainer.style.width=b+(e.weekWrapper!==void 0?e.weekWrapper.offsetWidth:0)+"px",e.calendarContainer.style.removeProperty("visibility"),e.calendarContainer.style.removeProperty("display")}})}function l(f){if(e.selectedDates.length===0){var b=e.config.minDate===void 0||zt(new Date,e.config.minDate)>=0?new Date:new Date(e.config.minDate.getTime()),M=Ia(e.config);b.setHours(M.hours,M.minutes,M.seconds,b.getMilliseconds()),e.selectedDates=[b],e.latestSelectedDateObj=b}f!==void 0&&f.type!=="blur"&&Qd(f);var A=e._input.value;p(),En(),e._input.value!==A&&e._debouncedChange()}function u(f,b){return f%12+12*$t(b===e.l10n.amPM[1])}function h(f){switch(f%24){case 0:case 12:return 12;default:return f%12}}function p(){if(!(e.hourElement===void 0||e.minuteElement===void 0)){var f=(parseInt(e.hourElement.value.slice(-2),10)||0)%24,b=(parseInt(e.minuteElement.value,10)||0)%60,M=e.secondElement!==void 0?(parseInt(e.secondElement.value,10)||0)%60:0;e.amPM!==void 0&&(f=u(f,e.amPM.textContent));var A=e.config.minTime!==void 0||e.config.minDate&&e.minDateHasTime&&e.latestSelectedDateObj&&zt(e.latestSelectedDateObj,e.config.minDate,!0)===0,q=e.config.maxTime!==void 0||e.config.maxDate&&e.maxDateHasTime&&e.latestSelectedDateObj&&zt(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=Pa(e.config.minTime.getHours(),e.config.minTime.getMinutes(),e.config.minTime.getSeconds()),ye=Pa(e.config.maxTime.getHours(),e.config.maxTime.getMinutes(),e.config.maxTime.getSeconds()),te=Pa(f,b,M);if(te>ye&&te<Q){var De=Nd(Q);f=De[0],b=De[1],M=De[2]}}else{if(q){var ee=e.config.maxTime!==void 0?e.config.maxTime:e.config.maxDate;f=Math.min(f,ee.getHours()),f===ee.getHours()&&(b=Math.min(b,ee.getMinutes())),b===ee.getMinutes()&&(M=Math.min(M,ee.getSeconds()))}if(A){var de=e.config.minTime!==void 0?e.config.minTime:e.config.minDate;f=Math.max(f,de.getHours()),f===de.getHours()&&b<de.getMinutes()&&(b=de.getMinutes()),b===de.getMinutes()&&(M=Math.max(M,de.getSeconds()))}}D(f,b,M)}}function y(f){var b=f||e.latestSelectedDateObj;b&&b instanceof Date&&D(b.getHours(),b.getMinutes(),b.getSeconds())}function D(f,b,M){e.latestSelectedDateObj!==void 0&&e.latestSelectedDateObj.setHours(f%24,b,M||0,0),!(!e.hourElement||!e.minuteElement||e.isMobile)&&(e.hourElement.value=ut(e.config.time_24hr?f:(12+f)%12+12*$t(f%12===0)),e.minuteElement.value=ut(b),e.amPM!==void 0&&(e.amPM.textContent=e.l10n.amPM[$t(f>=12)]),e.secondElement!==void 0&&(e.secondElement.value=ut(M)))}function T(f){var b=jt(f),M=parseInt(b.value)+(f.delta||0);(M/1e3>1||f.key==="Enter"&&!/[^\d]/.test(M.toString()))&&re(M)}function S(f,b,M,A){if(b instanceof Array)return b.forEach(function(q){return S(f,q,M,A)});if(f instanceof Array)return f.forEach(function(q){return S(q,b,M,A)});f.addEventListener(b,M,A),e._handlers.push({remove:function(){return f.removeEventListener(b,M,A)}})}function N(){Be("onChange")}function $(){if(e.config.wrap&&["open","close","toggle","clear"].forEach(function(M){Array.prototype.forEach.call(e.element.querySelectorAll("[data-"+M+"]"),function(A){return S(A,"click",e[M])})}),e.isMobile){Kd();return}var f=Lc(_e,50);if(e._debouncedChange=Lc(N,Vm),e.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&S(e.daysContainer,"mouseover",function(M){e.config.mode==="range"&&we(jt(M))}),S(e._input,"keydown",pe),e.calendarContainer!==void 0&&S(e.calendarContainer,"keydown",pe),!e.config.inline&&!e.config.static&&S(window,"resize",f),window.ontouchstart!==void 0?S(window.document,"touchstart",X):S(window.document,"mousedown",X),S(window.document,"focus",X,{capture:!0}),e.config.clickOpens===!0&&(S(e._input,"focus",e.open),S(e._input,"click",e.open)),e.daysContainer!==void 0&&(S(e.monthNav,"click",Xd),S(e.monthNav,["keyup","increment"],T),S(e.daysContainer,"click",Yc)),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0){var b=function(M){return jt(M).select()};S(e.timeContainer,["increment"],l),S(e.timeContainer,"blur",l,{capture:!0}),S(e.timeContainer,"click",W),S([e.hourElement,e.minuteElement],["focus","click"],b),e.secondElement!==void 0&&S(e.secondElement,"focus",function(){return e.secondElement&&e.secondElement.select()}),e.amPM!==void 0&&S(e.amPM,"click",function(M){l(M)})}e.config.allowInput&&S(e._input,"blur",ue)}function G(f,b){var M=f!==void 0?e.parseDate(f):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),A=e.currentYear,q=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)}b&&e.currentYear!==A&&(Be("onYearChange"),ae()),b&&(e.currentYear!==A||e.currentMonth!==q)&&Be("onMonthChange"),e.redraw()}function W(f){var b=jt(f);~b.className.indexOf("arrow")&&ne(f,b.classList.contains("arrowUp")?1:-1)}function ne(f,b,M){var A=f&&jt(f),q=M||A&&A.parentNode&&A.parentNode.firstChild,Q=Fa("increment");Q.delta=b,q&&q.dispatchEvent(Q)}function le(){var f=window.document.createDocumentFragment();if(e.calendarContainer=Se("div","flatpickr-calendar"),e.calendarContainer.tabIndex=-1,!e.config.noCalendar){if(f.appendChild(c()),e.innerContainer=Se("div","flatpickr-innerContainer"),e.config.weekNumbers){var b=w(),M=b.weekWrapper,A=b.weekNumbers;e.innerContainer.appendChild(M),e.weekNumbers=A,e.weekWrapper=M}e.rContainer=Se("div","flatpickr-rContainer"),e.rContainer.appendChild(v()),e.daysContainer||(e.daysContainer=Se("div","flatpickr-days"),e.daysContainer.tabIndex=-1),Y(),e.rContainer.appendChild(e.daysContainer),e.innerContainer.appendChild(e.rContainer),f.appendChild(e.innerContainer)}e.config.enableTime&&f.appendChild(d()),dt(e.calendarContainer,"rangeMode",e.config.mode==="range"),dt(e.calendarContainer,"animate",e.config.animate===!0),dt(e.calendarContainer,"multiMonth",e.config.showMonths>1),e.calendarContainer.appendChild(f);var q=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&&(!q&&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=Se("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 oe(f,b,M,A){var q=Z(b,!0),Q=Se("span",f,b.getDate().toString());return Q.dateObj=b,Q.$i=A,Q.setAttribute("aria-label",e.formatDate(b,e.config.ariaDateFormat)),f.indexOf("hidden")===-1&&zt(b,e.now)===0&&(e.todayDateElem=Q,Q.classList.add("today"),Q.setAttribute("aria-current","date")),q?(Q.tabIndex=-1,Ya(b)&&(Q.classList.add("selected"),e.selectedDateElem=Q,e.config.mode==="range"&&(dt(Q,"startRange",e.selectedDates[0]&&zt(b,e.selectedDates[0],!0)===0),dt(Q,"endRange",e.selectedDates[1]&&zt(b,e.selectedDates[1],!0)===0),f==="nextMonthDay"&&Q.classList.add("inRange")))):Q.classList.add("flatpickr-disabled"),e.config.mode==="range"&&Jd(b)&&!Ya(b)&&Q.classList.add("inRange"),e.weekNumbers&&e.config.showMonths===1&&f!=="prevMonthDay"&&A%7===6&&e.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+e.config.getWeek(b)+"</span>"),Be("onDayCreate",Q),Q}function Ce(f){f.focus(),e.config.mode==="range"&&we(f)}function Te(f){for(var b=f>0?0:e.config.showMonths-1,M=f>0?e.config.showMonths:-1,A=b;A!=M;A+=f)for(var q=e.daysContainer.children[A],Q=f>0?0:q.children.length-1,ye=f>0?q.children.length:-1,te=Q;te!=ye;te+=f){var De=q.children[te];if(De.className.indexOf("hidden")===-1&&Z(De.dateObj))return De}}function se(f,b){for(var M=f.className.indexOf("Month")===-1?f.dateObj.getMonth():e.currentMonth,A=b>0?e.config.showMonths:-1,q=b>0?1:-1,Q=M-e.currentMonth;Q!=A;Q+=q)for(var ye=e.daysContainer.children[Q],te=M-e.currentMonth===Q?f.$i+b:b<0?ye.children.length-1:0,De=ye.children.length,ee=te;ee>=0&&ee<De&&ee!=(b>0?De:-1);ee+=q){var de=ye.children[ee];if(de.className.indexOf("hidden")===-1&&Z(de.dateObj)&&Math.abs(f.$i-ee)>=Math.abs(b))return Ce(de)}e.changeMonth(q),B(Te(q),0)}function B(f,b){var M=o(),A=V(M||document.body),q=f!==void 0?f:A?M:e.selectedDateElem!==void 0&&V(e.selectedDateElem)?e.selectedDateElem:e.todayDateElem!==void 0&&V(e.todayDateElem)?e.todayDateElem:Te(b>0?1:-1);q===void 0?e._input.focus():A?se(q,b):Ce(q)}function z(f,b){for(var M=(new Date(f,b,1).getDay()-e.l10n.firstDayOfWeek+7)%7,A=e.utils.getDaysInMonth((b-1+12)%12,f),q=e.utils.getDaysInMonth(b,f),Q=window.document.createDocumentFragment(),ye=e.config.showMonths>1,te=ye?"prevMonthDay hidden":"prevMonthDay",De=ye?"nextMonthDay hidden":"nextMonthDay",ee=A+1-M,de=0;ee<=A;ee++,de++)Q.appendChild(oe("flatpickr-day "+te,new Date(f,b-1,ee),ee,de));for(ee=1;ee<=q;ee++,de++)Q.appendChild(oe("flatpickr-day",new Date(f,b,ee),ee,de));for(var Ie=q+1;Ie<=42-M&&(e.config.showMonths===1||de%7!==0);Ie++,de++)Q.appendChild(oe("flatpickr-day "+De,new Date(f,b+1,Ie%q),Ie,de));var dn=Se("div","dayContainer");return dn.appendChild(Q),dn}function Y(){if(e.daysContainer!==void 0){go(e.daysContainer),e.weekNumbers&&go(e.weekNumbers);for(var f=document.createDocumentFragment(),b=0;b<e.config.showMonths;b++){var M=new Date(e.currentYear,e.currentMonth,1);M.setMonth(e.currentMonth+b),f.appendChild(z(M.getFullYear(),M.getMonth()))}e.daysContainer.appendChild(f),e.days=e.daysContainer.firstChild,e.config.mode==="range"&&e.selectedDates.length===1&&we()}}function ae(){if(!(e.config.showMonths>1||e.config.monthSelectorType!=="dropdown")){var f=function(A){return e.config.minDate!==void 0&&e.currentYear===e.config.minDate.getFullYear()&&A<e.config.minDate.getMonth()?!1:!(e.config.maxDate!==void 0&&e.currentYear===e.config.maxDate.getFullYear()&&A>e.config.maxDate.getMonth())};e.monthsDropdownContainer.tabIndex=-1,e.monthsDropdownContainer.innerHTML="";for(var b=0;b<12;b++)if(f(b)){var M=Se("option","flatpickr-monthDropdown-month");M.value=new Date(e.currentYear,b).getMonth().toString(),M.textContent=vo(b,e.config.shorthandCurrentMonth,e.l10n),M.tabIndex=-1,e.currentMonth===b&&(M.selected=!0),e.monthsDropdownContainer.appendChild(M)}}}function g(){var f=Se("div","flatpickr-month"),b=window.document.createDocumentFragment(),M;e.config.showMonths>1||e.config.monthSelectorType==="static"?M=Se("span","cur-month"):(e.monthsDropdownContainer=Se("select","flatpickr-monthDropdown-months"),e.monthsDropdownContainer.setAttribute("aria-label",e.l10n.monthAriaLabel),S(e.monthsDropdownContainer,"change",function(ye){var te=jt(ye),De=parseInt(te.value,10);e.changeMonth(De-e.currentMonth),Be("onMonthChange")}),ae(),M=e.monthsDropdownContainer);var A=yo("cur-year",{tabindex:"-1"}),q=A.getElementsByTagName("input")[0];q.setAttribute("aria-label",e.l10n.yearAriaLabel),e.config.minDate&&q.setAttribute("min",e.config.minDate.getFullYear().toString()),e.config.maxDate&&(q.setAttribute("max",e.config.maxDate.getFullYear().toString()),q.disabled=!!e.config.minDate&&e.config.minDate.getFullYear()===e.config.maxDate.getFullYear());var Q=Se("div","flatpickr-current-month");return Q.appendChild(M),Q.appendChild(A),b.appendChild(Q),f.appendChild(b),{container:f,yearElement:q,monthElement:M}}function H(){go(e.monthNav),e.monthNav.appendChild(e.prevMonthNav),e.config.showMonths&&(e.yearElements=[],e.monthElements=[]);for(var f=e.config.showMonths;f--;){var b=g();e.yearElements.push(b.yearElement),e.monthElements.push(b.monthElement),e.monthNav.appendChild(b.container)}e.monthNav.appendChild(e.nextMonthNav)}function c(){return e.monthNav=Se("div","flatpickr-months"),e.yearElements=[],e.monthElements=[],e.prevMonthNav=Se("span","flatpickr-prev-month"),e.prevMonthNav.innerHTML=e.config.prevArrow,e.nextMonthNav=Se("span","flatpickr-next-month"),e.nextMonthNav.innerHTML=e.config.nextArrow,H(),Object.defineProperty(e,"_hidePrevMonthArrow",{get:function(){return e.__hidePrevMonthArrow},set:function(f){e.__hidePrevMonthArrow!==f&&(dt(e.prevMonthNav,"flatpickr-disabled",f),e.__hidePrevMonthArrow=f)}}),Object.defineProperty(e,"_hideNextMonthArrow",{get:function(){return e.__hideNextMonthArrow},set:function(f){e.__hideNextMonthArrow!==f&&(dt(e.nextMonthNav,"flatpickr-disabled",f),e.__hideNextMonthArrow=f)}}),e.currentYearElement=e.yearElements[0],Eo(),e.monthNav}function d(){e.calendarContainer.classList.add("hasTime"),e.config.noCalendar&&e.calendarContainer.classList.add("noCalendar");var f=Ia(e.config);e.timeContainer=Se("div","flatpickr-time"),e.timeContainer.tabIndex=-1;var b=Se("span","flatpickr-time-separator",":"),M=yo("flatpickr-hour",{"aria-label":e.l10n.hourAriaLabel});e.hourElement=M.getElementsByTagName("input")[0];var A=yo("flatpickr-minute",{"aria-label":e.l10n.minuteAriaLabel});if(e.minuteElement=A.getElementsByTagName("input")[0],e.hourElement.tabIndex=e.minuteElement.tabIndex=-1,e.hourElement.value=ut(e.latestSelectedDateObj?e.latestSelectedDateObj.getHours():e.config.time_24hr?f.hours:h(f.hours)),e.minuteElement.value=ut(e.latestSelectedDateObj?e.latestSelectedDateObj.getMinutes():f.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(b),e.timeContainer.appendChild(A),e.config.time_24hr&&e.timeContainer.classList.add("time24hr"),e.config.enableSeconds){e.timeContainer.classList.add("hasSeconds");var q=yo("flatpickr-second");e.secondElement=q.getElementsByTagName("input")[0],e.secondElement.value=ut(e.latestSelectedDateObj?e.latestSelectedDateObj.getSeconds():f.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(Se("span","flatpickr-time-separator",":")),e.timeContainer.appendChild(q)}return e.config.time_24hr||(e.amPM=Se("span","flatpickr-am-pm",e.l10n.amPM[$t((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?go(e.weekdayContainer):e.weekdayContainer=Se("div","flatpickr-weekdays");for(var f=e.config.showMonths;f--;){var b=Se("div","flatpickr-weekdaycontainer");e.weekdayContainer.appendChild(b)}return E(),e.weekdayContainer}function E(){if(e.weekdayContainer){var f=e.l10n.firstDayOfWeek,b=Hd(e.l10n.weekdays.shorthand);f>0&&f<b.length&&(b=Hd(b.splice(f,b.length),b.splice(0,f)));for(var M=e.config.showMonths;M--;)e.weekdayContainer.children[M].innerHTML=`
|
|
1
|
+
var uh=Object.create;var Ua=Object.defineProperty;var dh=Object.getOwnPropertyDescriptor;var hh=Object.getOwnPropertyNames;var mh=Object.getPrototypeOf,ph=Object.prototype.hasOwnProperty;var fh=(n,t,e)=>t in n?Ua(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var Vc=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var gh=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of hh(t))!ph.call(n,i)&&i!==e&&Ua(n,i,{get:()=>t[i],enumerable:!(r=dh(t,i))||r.enumerable});return n};var qc=(n,t,e)=>(e=n!=null?uh(mh(n)):{},gh(t||!n||!n.__esModule?Ua(e,"default",{value:n,enumerable:!0}):e,n));var L=(n,t,e)=>(fh(n,typeof t!="symbol"?t+"":t,e),e),Wc=(n,t,e)=>{if(!t.has(n))throw TypeError("Cannot "+e)};var S=(n,t,e)=>(Wc(n,t,"read from private field"),e?e.call(n):t.get(n)),_o=(n,t,e)=>{if(t.has(n))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(n):t.set(n,e)};var $n=(n,t,e)=>(Wc(n,t,"access private method"),e);var Gc=Vc((Va,qa)=>{(function(n,t){typeof Va=="object"&&typeof qa<"u"?qa.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self,n.JSBI=t())})(Va,function(){"use strict";var n=Math.imul,t=Math.clz32;function e(B,z){(z==null||z>B.length)&&(z=B.length);for(var Y=0,ae=Array(z);Y<z;Y++)ae[Y]=B[Y];return ae}function r(B){if(Array.isArray(B))return B}function i(B){if(B===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return B}function o(B,z,Y){return z=p(z),$(B,T()?Reflect.construct(z,Y||[],p(B).constructor):z.apply(B,Y))}function a(B,z){if(!(B instanceof z))throw new TypeError("Cannot call a class as a function")}function s(B,z,Y){if(T())return Reflect.construct.apply(null,arguments);var ae=[null];ae.push.apply(ae,z);var g=new(B.bind.apply(B,ae));return Y&&G(g,Y.prototype),g}function l(B,z){for(var Y,ae=0;ae<z.length;ae++)Y=z[ae],Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(B,le(Y.key),Y)}function u(B,z,Y){return z&&l(B.prototype,z),Y&&l(B,Y),Object.defineProperty(B,"prototype",{writable:!1}),B}function h(B,z){var Y=typeof Symbol<"u"&&B[Symbol.iterator]||B["@@iterator"];if(!Y){if(Array.isArray(B)||(Y=Ce(B))||z&&B&&typeof B.length=="number"){Y&&(B=Y);var ae=0,g=function(){};return{s:g,n:function(){return ae>=B.length?{done:!0}:{done:!1,value:B[ae++]}},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 H,c=!0,d=!1;return{s:function(){Y=Y.call(B)},n:function(){var v=Y.next();return c=v.done,v},e:function(v){d=!0,H=v},f:function(){try{c||Y.return==null||Y.return()}finally{if(d)throw H}}}}function p(B){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(z){return z.__proto__||Object.getPrototypeOf(z)},p(B)}function y(B,z){if(typeof z!="function"&&z!==null)throw new TypeError("Super expression must either be null or a function");B.prototype=Object.create(z&&z.prototype,{constructor:{value:B,writable:!0,configurable:!0}}),Object.defineProperty(B,"prototype",{writable:!1}),z&&G(B,z)}function D(B){try{return Function.toString.call(B).indexOf("[native code]")!==-1}catch{return typeof B=="function"}}function T(){try{var B=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(T=function(){return!!B})()}function C(B,z){var Y=B==null?null:typeof Symbol<"u"&&B[Symbol.iterator]||B["@@iterator"];if(Y!=null){var ae,g,H,c,d=[],v=!0,E=!1;try{if(H=(Y=Y.call(B)).next,z===0){if(Object(Y)!==Y)return;v=!1}else for(;!(v=(ae=H.call(Y)).done)&&(d.push(ae.value),d.length!==z);v=!0);}catch(w){E=!0,g=w}finally{try{if(!v&&Y.return!=null&&(c=Y.return(),Object(c)!==c))return}finally{if(E)throw g}}return d}}function N(){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 $(B,z){if(z&&(typeof z=="object"||typeof z=="function"))return z;if(z!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return i(B)}function G(B,z){return G=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Y,ae){return Y.__proto__=ae,Y},G(B,z)}function W(B,z){return r(B)||C(B,z)||Ce(B,z)||N()}function ne(B,z){if(typeof B!="object"||!B)return B;var Y=B[Symbol.toPrimitive];if(Y!==void 0){var ae=Y.call(B,z||"default");if(typeof ae!="object")return ae;throw new TypeError("@@toPrimitive must return a primitive value.")}return(z==="string"?String:Number)(B)}function le(B){var z=ne(B,"string");return typeof z=="symbol"?z:z+""}function oe(B){"@babel/helpers - typeof";return oe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(z){return typeof z}:function(z){return z&&typeof Symbol=="function"&&z.constructor===Symbol&&z!==Symbol.prototype?"symbol":typeof z},oe(B)}function Ce(B,z){if(B){if(typeof B=="string")return e(B,z);var Y={}.toString.call(B).slice(8,-1);return Y==="Object"&&B.constructor&&(Y=B.constructor.name),Y==="Map"||Y==="Set"?Array.from(B):Y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Y)?e(B,z):void 0}}function Te(B){var z=typeof Map=="function"?new Map:void 0;return Te=function(Y){function ae(){return s(Y,arguments,p(this).constructor)}if(Y===null||!D(Y))return Y;if(typeof Y!="function")throw new TypeError("Super expression must either be null or a function");if(z!==void 0){if(z.has(Y))return z.get(Y);z.set(Y,ae)}return ae.prototype=Object.create(Y.prototype,{constructor:{value:ae,enumerable:!1,writable:!0,configurable:!0}}),G(ae,Y)},Te(B)}var se=function(B){var z=Math.abs,Y=Math.max,ae=Math.floor;function g(H,c){var d;if(a(this,g),d=o(this,g,[H]),d.sign=c,Object.setPrototypeOf(d,g.prototype),H>g.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return d}return y(g,B),u(g,[{key:"toDebugString",value:function(){var c,d=["BigInt["],v=h(this);try{for(v.s();!(c=v.n()).done;){var E=c.value;d.push((E&&(E>>>0).toString(16))+", ")}}catch(w){v.e(w)}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 E=32767&c,w=c>>>15,_=0,R=d,P=0;P<v;P++){var j=this.__digit(P),O=32767&j,X=j>>>15,re=g.__imul(O,E),Z=g.__imul(O,w),V=g.__imul(X,E),ue=g.__imul(X,w),pe=R+re+_;_=pe>>>30,pe&=1073741823,pe+=((32767&Z)<<15)+((32767&V)<<15),_+=pe>>>30,R=ue+(Z>>>15)+(V>>>15),this.__setDigit(P,1073741823&pe)}if(_!==0||R!==0)throw new Error("implementation bug")}},{key:"__inplaceAdd",value:function(c,d,v){for(var E,w=0,_=0;_<v;_++)E=this.__halfDigit(d+_)+c.__halfDigit(_)+w,w=E>>>15,this.__setHalfDigit(d+_,32767&E);return w}},{key:"__inplaceSub",value:function(c,d,v){var E=v-1>>>1,w=0;if(1&d){d>>=1;for(var _=this.__digit(d),R=32767&_,P=0;P<E;P++){var j=c.__digit(P),O=(_>>>15)-(32767&j)-w;w=1&O>>>15,this.__setDigit(d+P,(32767&O)<<15|32767&R),_=this.__digit(d+P+1),R=(32767&_)-(j>>>15)-w,w=1&R>>>15}var X=c.__digit(P),re=(_>>>15)-(32767&X)-w;w=1&re>>>15,this.__setDigit(d+P,(32767&re)<<15|32767&R);var Z=X>>>15;if(d+P+1>=this.length)throw new RangeError("out of bounds");!(1&v)&&(_=this.__digit(d+P+1),R=(32767&_)-Z-w,w=1&R>>>15,this.__setDigit(d+c.length,1073709056&_|32767&R))}else{d>>=1;for(var V=0;V<c.length-1;V++){var ue=this.__digit(d+V),pe=c.__digit(V),we=(32767&ue)-(32767&pe)-w;w=1&we>>>15;var _e=(ue>>>15)-(pe>>>15)-w;w=1&_e>>>15,this.__setDigit(d+V,(32767&_e)<<15|32767&we)}var Oe=this.__digit(d+V),Ve=c.__digit(V),ot=(32767&Oe)-(32767&Ve)-w;w=1&ot>>>15;var Qt=0;!(1&v)&&(Qt=(Oe>>>15)-(Ve>>>15)-w,w=1&Qt>>>15),this.__setDigit(d+V,(32767&Qt)<<15|32767&ot)}return w}},{key:"__inplaceRightShift",value:function(c){if(c!==0){for(var d,v=this.__digit(0)>>>c,E=this.length-1,w=0;w<E;w++)d=this.__digit(w+1),this.__setDigit(w,1073741823&d<<30-c|v),v=d>>>c;this.__setDigit(E,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,E=this.__digit(v),w=1&c?32767&E|d<<15:1073709056&E|32767&d;this.__setDigit(v,w)}}],[{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)||ae(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(oe(c)==="object"){if(c.constructor===g)return c;var E=g.__toPrimitive(c);return g.BigInt(E)}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 E=c.__digit(d-1),w=g.__clz30(E),_=30*d-w;if(1024<_)return c.sign?-1/0:1/0;var R=_-1,P=E,j=d-1,O=w+3,X=O===32?0:P<<O;X>>>=12;var re=O-12,Z=12<=O?0:P<<20+O,V=20+O;for(0<re&&0<j&&(j--,P=c.__digit(j),X|=P>>>30-re,Z=P<<re+2,V=re+2);0<V&&0<j;)j--,P=c.__digit(j),Z|=30<=V?P<<V-30:P>>>30-V,V-=30;var ue=g.__decideRounding(c,V,j,P);if((ue===1||ue===0&&(1&Z)==1)&&(Z=Z+1>>>0,Z===0&&(X++,X>>>20!=0&&(X=0,R++,1023<R))))return c.sign?-1/0:1/0;var pe=c.sign?-2147483648:0;return R=R+1023<<20,g.__kBitConversionInts[g.__kBitConversionIntHigh]=pe|R|X,g.__kBitConversionInts[g.__kBitConversionIntLow]=Z,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 E=1+(0|v/30),w=c.sign&&(1&v)!=0,_=new g(E,w);_.__initializeDigits();var R=1<<v%30;return _.__setDigit(E-1,R),_}var P=null,j=c;for(1&v&&(P=c),v>>=1;v!==0;v>>=1)j=g.multiply(j,j),1&v&&(P===null?P=j:P=g.multiply(P,j));return P}},{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 E=new g(v,c.sign!==d.sign);E.__initializeDigits();for(var w=0;w<c.length;w++)g.__multiplyAccumulate(d,c.__digit(w),E,w);return E.__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,E=c.sign!==d.sign,w=d.__unsignedDigit(0);if(d.length===1&&32767>=w){if(w===1)return E===c.sign?c:g.unaryMinus(c);v=g.__absoluteDivSmall(c,w,null)}else v=g.__absoluteDivLarge(c,d,!0,!1);return v.sign=E,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 E=g.__absoluteModSmall(c,v);return E===0?g.__zero():g.__oneDigit(E,c.sign)}var w=g.__absoluteDivLarge(c,d,!1,!0);return w.sign=c.sign,w.__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=Y(c.length,d.length)+1,E=g.__absoluteSubOne(c,v),w=g.__absoluteSubOne(d);return E=g.__absoluteOr(E,w,E),g.__absoluteAddOne(E,!0,E).__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=Y(c.length,d.length),E=g.__absoluteSubOne(c,v),w=g.__absoluteSubOne(d);return g.__absoluteXor(E,w,E).__trim()}var _=Y(c.length,d.length)+1;if(c.sign){var R=[d,c];c=R[0],d=R[1]}var P=g.__absoluteSubOne(d,_);return P=g.__absoluteXor(P,c,P),g.__absoluteAddOne(P,!0,P).__trim()}},{key:"bitwiseOr",value:function(c,d){var v=Y(c.length,d.length);if(!c.sign&&!d.sign)return g.__absoluteOr(c,d).__trim();if(c.sign&&d.sign){var E=g.__absoluteSubOne(c,v),w=g.__absoluteSubOne(d);return E=g.__absoluteAnd(E,w,E),g.__absoluteAddOne(E,!0,E).__trim()}if(c.sign){var _=[d,c];c=_[0],d=_[1]}var R=g.__absoluteSubOne(d,v);return R=g.__absoluteAndNot(R,c,R),g.__absoluteAddOne(R,!0,R).__trim()}},{key:"asIntN",value:function(c,d){if(d.length===0)return d;if(c=ae(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 E=d.__unsignedDigit(v-1),w=1<<(c-1)%30;if(d.length===v&&E<w)return d;var _=(E&w)===w;if(!_)return g.__truncateToNBits(c,d);if(!d.sign)return g.__truncateAndSubFromPowerOfTwo(c,d,!0);if(!(E&w-1)){for(var R=v-2;0<=R;R--)if(d.__digit(R)!==0)return g.__truncateAndSubFromPowerOfTwo(c,d,!1);return d.length===v&&E===w?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=ae(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 E=c%30;if(d.length==v){if(E===0)return d;var w=d.__digit(v-1);if(!(w>>>E))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(oe(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(oe(d)!=="object")return c==d;d=g.__toPrimitive(d)}else if(typeof c=="boolean"){if(g.__isBigInt(d))return g.__equalToNumber(d,+c);if(oe(d)!=="object")return c==d;d=g.__toPrimitive(d)}else if(oe(c)==="symbol"){if(g.__isBigInt(d))return!1;if(oe(d)!=="object")return c==d;d=g.__toPrimitive(d)}else if(oe(c)==="object"){if(oe(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],E=v?[4,0]:[0,4],w=W(E,2),_=w[0],R=w[1],P=c.getUint32(d+_,v),j=c.getUint32(d+R,v),O=new g(3,!1);return O.__setDigit(0,1073741823&j),O.__setDigit(1,(268435455&P)<<2|j>>>30),O.__setDigit(2,P>>>28),O.__trim()}},{key:"DataViewSetBigInt64",value:function(c,d,v){var E=3<arguments.length&&arguments[3]!==void 0&&arguments[3];g.DataViewSetBigUint64(c,d,v,E)}},{key:"DataViewSetBigUint64",value:function(c,d,v){var E=3<arguments.length&&arguments[3]!==void 0&&arguments[3];v=g.asUintN(64,v);var w=0,_=0;if(0<v.length&&(_=v.__digit(0),1<v.length)){var R=v.__digit(1);_|=R<<30,w=R>>>2,2<v.length&&(w|=v.__digit(2)<<28)}var P=E?[4,0]:[0,4],j=W(P,2),O=j[0],X=j[1];c.setUint32(d+O,w,E),c.setUint32(d+X,_,E)}},{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,E){if(0<d)return-1;var w;if(0>d)w=-d-1;else{if(v===0)return-1;v--,E=c.__digit(v),w=29}var _=1<<w;if(!(E&_))return-1;if(_-=1,(E&_)!=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,E=2047&g.__kBitConversionInts[g.__kBitConversionIntHigh]>>>20,w=E-1023,_=(0|w/30)+1,R=new g(_,d),P=1048576,j=1048575&g.__kBitConversionInts[g.__kBitConversionIntHigh]|P,O=g.__kBitConversionInts[g.__kBitConversionIntLow],X=20,re=w%30,Z=0;if(re<X){var V=X-re;Z=V+32,v=j>>>V,j=j<<32-V|O>>>V,O<<=32-V}else if(re===X)Z=32,v=j,j=O,O=0;else{var ue=re-X;Z=32-ue,v=j<<ue|O>>>32-ue,j=O<<ue,O=0}R.__setDigit(_-1,v);for(var pe=_-2;0<=pe;pe--)0<Z?(Z-=30,v=j>>>2,j=j<<30|O>>>2,O<<=30):v=0,R.__setDigit(pe,v);return R.__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,E=c.length,w=0;if(w===E)return g.__zero();for(var _=c.charCodeAt(w);g.__isWhitespace(_);){if(++w===E)return g.__zero();_=c.charCodeAt(w)}if(_===43){if(++w===E)return null;_=c.charCodeAt(w),v=1}else if(_===45){if(++w===E)return null;_=c.charCodeAt(w),v=-1}if(d===0){if(d=10,_===48){if(++w===E)return g.__zero();if(_=c.charCodeAt(w),_===88||_===120){if(d=16,++w===E)return null;_=c.charCodeAt(w)}else if(_===79||_===111){if(d=8,++w===E)return null;_=c.charCodeAt(w)}else if(_===66||_===98){if(d=2,++w===E)return null;_=c.charCodeAt(w)}}}else if(d===16&&_===48){if(++w===E)return g.__zero();if(_=c.charCodeAt(w),_===88||_===120){if(++w===E)return null;_=c.charCodeAt(w)}}if(v!==0&&d!==10)return null;for(;_===48;){if(++w===E)return g.__zero();_=c.charCodeAt(w)}var R=E-w,P=g.__kMaxBitsPerChar[d],j=g.__kBitsPerCharTableMultiplier-1;if(R>1073741824/P)return null;var O=P*R+j>>>g.__kBitsPerCharTableShift,X=0|(O+29)/30,re=new g(X,!1),Z=10>d?d:10,V=10<d?d-10:0;if(d&d-1){re.__initializeDigits();var ot=!1,Qt=0;do{for(var sr,Yn=0,ii=1;;){if(sr=void 0,_-48>>>0<Z)sr=_-48;else if((32|_)-97>>>0<V)sr=(32|_)-87;else{ot=!0;break}var bo=ii*d;if(1073741823<bo)break;if(ii=bo,Yn=Yn*d+sr,Qt++,++w===E){ot=!0;break}_=c.charCodeAt(w)}j=30*g.__kBitsPerCharTableMultiplier-1;var wo=0|(P*Qt+j>>>g.__kBitsPerCharTableShift)/30;re.__inplaceMultiplyAdd(ii,Yn,wo)}while(!ot)}else{P>>=g.__kBitsPerCharTableShift;var ue=[],pe=[],we=!1;do{for(var _e,Oe=0,Ve=0;;){if(_e=void 0,_-48>>>0<Z)_e=_-48;else if((32|_)-97>>>0<V)_e=(32|_)-87;else{we=!0;break}if(Ve+=P,Oe=Oe<<P|_e,++w===E){we=!0;break}if(_=c.charCodeAt(w),30<Ve+P)break}ue.push(Oe),pe.push(Ve)}while(!we);g.__fillFromParts(re,ue,pe)}if(w!==E){if(!g.__isWhitespace(_))return null;for(w++;w<E;w++)if(_=c.charCodeAt(w),!g.__isWhitespace(_))return null}return re.sign=v===-1,re.__trim()}},{key:"__fillFromParts",value:function(c,d,v){for(var E=0,w=0,_=0,R=d.length-1;0<=R;R--){var P=d[R],j=v[R];w|=P<<_,_+=j,_===30?(c.__setDigit(E++,w),_=0,w=0):30<_&&(c.__setDigit(E++,1073741823&w),_-=30,w=P>>>j-_)}if(w!==0){if(E>=c.length)throw new Error("implementation bug");c.__setDigit(E++,w)}for(;E<c.length;E++)c.__setDigit(E,0)}},{key:"__toStringBasePowerOfTwo",value:function(c,d){var v=c.length,E=d-1;E=(85&E>>>1)+(85&E),E=(51&E>>>2)+(51&E),E=(15&E>>>4)+(15&E);var w=E,_=d-1,R=c.__digit(v-1),P=g.__clz30(R),j=30*v-P,O=0|(j+w-1)/w;if(c.sign&&O++,268435456<O)throw new Error("string too long");for(var X=Array(O),re=O-1,Z=0,V=0,ue=0;ue<v-1;ue++){var pe=c.__digit(ue),we=(Z|pe<<V)&_;X[re--]=g.__kConversionChars[we];var _e=w-V;for(Z=pe>>>_e,V=30-_e;V>=w;)X[re--]=g.__kConversionChars[Z&_],Z>>>=w,V-=w}var Oe=(Z|R<<V)&_;for(X[re--]=g.__kConversionChars[Oe],Z=R>>>w-V;Z!==0;)X[re--]=g.__kConversionChars[Z&_],Z>>>=w;if(c.sign&&(X[re--]="-"),re!==-1)throw new Error("implementation bug");return X.join("")}},{key:"__toStringGeneric",value:function(c,d,v){var E=c.length;if(E===0)return"";if(E===1){var w=c.__unsignedDigit(0).toString(d);return v===!1&&c.sign&&(w="-"+w),w}var _=30*E-g.__clz30(c.__digit(E-1)),R=g.__kMaxBitsPerChar[d],P=R-1,j=_*g.__kBitsPerCharTableMultiplier;j+=P-1,j=0|j/P;var O,X,re=j+1>>1,Z=g.exponentiate(g.__oneDigit(d,!1),g.__oneDigit(re,!1)),V=Z.__unsignedDigit(0);if(Z.length===1&&32767>=V){O=new g(c.length,!1),O.__initializeDigits();for(var ue,pe=0,we=2*c.length-1;0<=we;we--)ue=pe<<15|c.__halfDigit(we),O.__setHalfDigit(we,0|ue/V),pe=0|ue%V;X=pe.toString(d)}else{var _e=g.__absoluteDivLarge(c,Z,!0,!0);O=_e.quotient;var Oe=_e.remainder.__trim();X=g.__toStringGeneric(Oe,d,!0)}O.__trim();for(var Ve=g.__toStringGeneric(O,d,!0);X.length<re;)X="0"+X;return v===!1&&c.sign&&(Ve="-"+Ve),Ve+X}},{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 E=g.__absoluteCompare(c,d);return 0<E?g.__absoluteGreater(v):0>E?g.__absoluteLess(v):0}},{key:"__compareToNumber",value:function(c,d){if(g.__isOneDigitInt(d)){var v=c.sign,E=0>d;if(v!==E)return g.__unequalSign(v);if(c.length===0){if(E)throw new Error("implementation bug");return d===0?0:-1}if(1<c.length)return g.__absoluteGreater(v);var w=z(d),_=c.__unsignedDigit(0);return _>w?g.__absoluteGreater(v):_<w?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,E=0>d;if(v!==E)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 w=2047&g.__kBitConversionInts[g.__kBitConversionIntHigh]>>>20;if(w==2047)throw new Error("implementation bug: handled elsewhere");var _=w-1023;if(0>_)return g.__absoluteGreater(v);var R=c.length,P=c.__digit(R-1),j=g.__clz30(P),O=30*R-j,X=_+1;if(O<X)return g.__absoluteLess(v);if(O>X)return g.__absoluteGreater(v);var re=1048576,Z=1048576|1048575&g.__kBitConversionInts[g.__kBitConversionIntHigh],V=g.__kBitConversionInts[g.__kBitConversionIntLow],ue=20,pe=29-j;if(pe!==(0|(O-1)%30))throw new Error("implementation bug");var we,_e=0;if(pe<ue){var Oe=ue-pe;_e=Oe+32,we=Z>>>Oe,Z=Z<<32-Oe|V>>>Oe,V<<=32-Oe}else if(pe===ue)_e=32,we=Z,Z=V,V=0;else{var Ve=pe-ue;_e=32-Ve,we=Z<<Ve|V>>>32-Ve,Z=V<<Ve,V=0}if(P>>>=0,we>>>=0,P>we)return g.__absoluteGreater(v);if(P<we)return g.__absoluteLess(v);for(var ot=R-2;0<=ot;ot--){0<_e?(_e-=30,we=Z>>>2,Z=Z<<30|V>>>2,V<<=30):we=0;var Qt=c.__unsignedDigit(ot);if(Qt>we)return g.__absoluteGreater(v);if(Qt<we)return g.__absoluteLess(v)}if(Z!==0||V!==0){if(_e===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)===z(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 E=c.length;(c.__clzmsd()===0||d.length===c.length&&d.__clzmsd()===0)&&E++;for(var w,_=new g(E,v),R=0,P=0;P<d.length;P++)w=c.__digit(P)+d.__digit(P)+R,R=w>>>30,_.__setDigit(P,1073741823&w);for(;P<c.length;P++){var j=c.__digit(P)+R;R=j>>>30,_.__setDigit(P,1073741823&j)}return P<_.length&&_.__setDigit(P,R),_.__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 E,w=new g(c.length,v),_=0,R=0;R<d.length;R++)E=c.__digit(R)-d.__digit(R)-_,_=1&E>>>30,w.__setDigit(R,1073741823&E);for(;R<c.length;R++){var P=c.__digit(R)-_;_=1&P>>>30,w.__setDigit(R,1073741823&P)}return w.__trim()}},{key:"__absoluteAddOne",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,E=c.length;v===null?v=new g(E,d):v.sign=d;for(var w,_=1,R=0;R<E;R++)w=c.__digit(R)+_,_=w>>>30,v.__setDigit(R,1073741823&w);return _!==0&&v.__setDigitGrow(E,1),v}},{key:"__absoluteSubOne",value:function(c,d){var v=c.length;d=d||v;for(var E,w=new g(d,!1),_=1,R=0;R<v;R++)E=c.__digit(R)-_,_=1&E>>>30,w.__setDigit(R,1073741823&E);if(_!==0)throw new Error("implementation bug");for(var P=v;P<d;P++)w.__setDigit(P,0);return w}},{key:"__absoluteAnd",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,E=c.length,w=d.length,_=w;if(E<w){_=E;var R=c,P=E;c=d,E=w,d=R,w=P}var j=_;v===null?v=new g(j,!1):j=v.length;for(var O=0;O<_;O++)v.__setDigit(O,c.__digit(O)&d.__digit(O));for(;O<j;O++)v.__setDigit(O,0);return v}},{key:"__absoluteAndNot",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,E=c.length,w=d.length,_=w;E<w&&(_=E);var R=E;v===null?v=new g(R,!1):R=v.length;for(var P=0;P<_;P++)v.__setDigit(P,c.__digit(P)&~d.__digit(P));for(;P<E;P++)v.__setDigit(P,c.__digit(P));for(;P<R;P++)v.__setDigit(P,0);return v}},{key:"__absoluteOr",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,E=c.length,w=d.length,_=w;if(E<w){_=E;var R=c,P=E;c=d,E=w,d=R,w=P}var j=E;v===null?v=new g(j,!1):j=v.length;for(var O=0;O<_;O++)v.__setDigit(O,c.__digit(O)|d.__digit(O));for(;O<E;O++)v.__setDigit(O,c.__digit(O));for(;O<j;O++)v.__setDigit(O,0);return v}},{key:"__absoluteXor",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,E=c.length,w=d.length,_=w;if(E<w){_=E;var R=c,P=E;c=d,E=w,d=R,w=P}var j=E;v===null?v=new g(j,!1):j=v.length;for(var O=0;O<_;O++)v.__setDigit(O,c.__digit(O)^d.__digit(O));for(;O<E;O++)v.__setDigit(O,c.__digit(O));for(;O<j;O++)v.__setDigit(O,0);return v}},{key:"__absoluteCompare",value:function(c,d){var v=c.length-d.length;if(v!=0)return v;for(var E=c.length-1;0<=E&&c.__digit(E)===d.__digit(E);)E--;return 0>E?0:c.__unsignedDigit(E)>d.__unsignedDigit(E)?1:-1}},{key:"__multiplyAccumulate",value:function(c,d,v,E){if(d!==0){for(var w=32767&d,_=d>>>15,R=0,P=0,j=0;j<c.length;j++,E++){var O=v.__digit(E),X=c.__digit(j),re=32767&X,Z=X>>>15,V=g.__imul(re,w),ue=g.__imul(re,_),pe=g.__imul(Z,w),we=g.__imul(Z,_);O+=P+V+R,R=O>>>30,O&=1073741823,O+=((32767&ue)<<15)+((32767&pe)<<15),R+=O>>>30,P=we+(ue>>>15)+(pe>>>15),v.__setDigit(E,1073741823&O)}for(;R!==0||P!==0;E++){var _e=v.__digit(E);_e+=R+P,P=0,R=_e>>>30,v.__setDigit(E,1073741823&_e)}}}},{key:"__internalMultiplyAdd",value:function(c,d,v,E,w){for(var _=v,R=0,P=0;P<E;P++){var j=c.__digit(P),O=g.__imul(32767&j,d),X=g.__imul(j>>>15,d),re=O+((32767&X)<<15)+R+_;_=re>>>30,R=X>>>15,w.__setDigit(P,1073741823&re)}if(w.length>E)for(w.__setDigit(E++,_+R);E<w.length;)w.__setDigit(E++,0);else if(_+R!==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 E=0,w=2*c.length-1;0<=w;w-=2){var _=(E<<15|c.__halfDigit(w))>>>0,R=0|_/d;E=0|_%d,_=(E<<15|c.__halfDigit(w-1))>>>0;var P=0|_/d;E=0|_%d,v.__setDigit(w>>>1,R<<15|P)}return v}},{key:"__absoluteModSmall",value:function(c,d){for(var v,E=0,w=2*c.length-1;0<=w;w--)v=(E<<15|c.__halfDigit(w))>>>0,E=0|v%d;return E}},{key:"__absoluteDivLarge",value:function(c,d,v,E){var w=d.__halfDigitLength(),_=d.length,R=c.__halfDigitLength()-w,P=null;v&&(P=new g(R+2>>>1,!1),P.__initializeDigits());var j=new g(w+2>>>1,!1);j.__initializeDigits();var O=g.__clz15(d.__halfDigit(w-1));0<O&&(d=g.__specialLeftShift(d,O,0));for(var X=g.__specialLeftShift(c,O,1),re=d.__halfDigit(w-1),Z=0,V=R;0<=V;V--){var ue=32767,pe=X.__halfDigit(V+w);if(pe!==re){var we=(pe<<15|X.__halfDigit(V+w-1))>>>0;ue=0|we/re;for(var _e=0|we%re,Oe=d.__halfDigit(w-2),Ve=X.__halfDigit(V+w-2);g.__imul(ue,Oe)>>>0>(_e<<16|Ve)>>>0&&(ue--,_e+=re,!(32767<_e)););}g.__internalMultiplyAdd(d,ue,0,_,j);var ot=X.__inplaceSub(j,V,w+1);ot!==0&&(ot=X.__inplaceAdd(d,V,w),X.__setHalfDigit(V+w,32767&X.__halfDigit(V+w)+ot),ue--),v&&(1&V?Z=ue<<15:P.__setDigit(V>>>1,Z|ue))}if(E)return X.__inplaceRightShift(O),v?{quotient:P,remainder:X}:X;if(v)return P;throw new Error("unreachable")}},{key:"__clz15",value:function(c){return g.__clz30(c)-15}},{key:"__specialLeftShift",value:function(c,d,v){var E=c.length,w=E+v,_=new g(w,!1);if(d===0){for(var R=0;R<E;R++)_.__setDigit(R,c.__digit(R));return 0<v&&_.__setDigit(E,0),_}for(var P,j=0,O=0;O<E;O++)P=c.__digit(O),_.__setDigit(O,1073741823&P<<d|j),j=P>>>30-d;return 0<v&&_.__setDigit(E,j),_}},{key:"__leftShiftByAbsolute",value:function(c,d){var v=g.__toShiftAmount(d);if(0>v)throw new RangeError("BigInt too big");var E=0|v/30,w=v%30,_=c.length,R=w!==0&&c.__digit(_-1)>>>30-w!=0,P=_+E+(R?1:0),j=new g(P,c.sign);if(w===0){for(var O=0;O<E;O++)j.__setDigit(O,0);for(;O<P;O++)j.__setDigit(O,c.__digit(O-E))}else{for(var X=0,re=0;re<E;re++)j.__setDigit(re,0);for(var Z,V=0;V<_;V++)Z=c.__digit(V),j.__setDigit(V+E,1073741823&Z<<w|X),X=Z>>>30-w;if(R)j.__setDigit(_+E,X);else if(X!==0)throw new Error("implementation bug")}return j.__trim()}},{key:"__rightShiftByAbsolute",value:function(c,d){var v=c.length,E=c.sign,w=g.__toShiftAmount(d);if(0>w)return g.__rightShiftByMaximum(E);var _=0|w/30,R=w%30,P=v-_;if(0>=P)return g.__rightShiftByMaximum(E);var j=!1;if(E){var O=(1<<R)-1;if(c.__digit(_)&O)j=!0;else for(var X=0;X<_;X++)if(c.__digit(X)!==0){j=!0;break}}if(j&&R===0){var re=c.__digit(v-1),Z=~re==0;Z&&P++}var V=new g(P,E);if(R===0){V.__setDigit(P-1,0);for(var ue=_;ue<v;ue++)V.__setDigit(ue-_,c.__digit(ue))}else{for(var pe,we=c.__digit(_)>>>R,_e=v-_-1,Oe=0;Oe<_e;Oe++)pe=c.__digit(Oe+_+1),V.__setDigit(Oe,1073741823&pe<<30-R|we),we=pe>>>R;V.__setDigit(_e,we)}return j&&(V=g.__absoluteAddOne(V,!0,V)),V.__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(oe(c)!=="object"||c.constructor===g)return c;if(typeof Symbol<"u"&&oe(Symbol.toPrimitive)==="symbol"&&c[Symbol.toPrimitive]){var v=c[Symbol.toPrimitive](d);if(oe(v)!=="object")return v;throw new TypeError("Cannot convert object to primitive value")}var E=c.valueOf;if(E){var w=E.call(c);if(oe(w)!=="object")return w}var _=c.toString;if(_){var R=_.call(c);if(oe(R)!=="object")return R}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 oe(c)==="object"&&c!==null&&c.constructor===g}},{key:"__truncateToNBits",value:function(c,d){for(var v=0|(c+29)/30,E=new g(v,d.sign),w=v-1,_=0;_<w;_++)E.__setDigit(_,d.__digit(_));var R=d.__digit(w);if(c%30!=0){var P=32-c%30;R=R<<P>>>P}return E.__setDigit(w,R),E.__trim()}},{key:"__truncateAndSubFromPowerOfTwo",value:function(c,d,v){for(var E=Math.min,w,_=0|(c+29)/30,R=new g(_,v),P=0,j=_-1,O=0,X=E(j,d.length);P<X;P++)w=0-d.__digit(P)-O,O=1&w>>>30,R.__setDigit(P,1073741823&w);for(;P<j;P++)R.__setDigit(P,0|1073741823&-O);var re,Z=j<d.length?d.__digit(j):0,V=c%30;if(V===0)re=0-Z-O,re&=1073741823;else{var ue=32-V;Z=Z<<ue>>>ue;var pe=1<<32-ue;re=pe-Z-O,re&=pe-1}return R.__setDigit(j,re),R.__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}}])}(Te(Array));return se.__kMaxLength=33554432,se.__kMaxLengthBits=se.__kMaxLength<<5,se.__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],se.__kBitsPerCharTableShift=5,se.__kBitsPerCharTableMultiplier=1<<se.__kBitsPerCharTableShift,se.__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"],se.__kBitConversionBuffer=new ArrayBuffer(8),se.__kBitConversionDouble=new Float64Array(se.__kBitConversionBuffer),se.__kBitConversionInts=new Int32Array(se.__kBitConversionBuffer),se.__kBitConversionIntHigh=se.__detectBigEndian()?0:1,se.__kBitConversionIntLow=se.__detectBigEndian()?1:0,se.__clz30=t?function(B){return t(B)-2}:function(B){var z=Math.LN2,Y=Math.log;return B===0?30:0|29-(0|Y(B>>>0)/z)},se.__imul=n||function(B,z){return 0|B*z},se})});var Wu=Vc((fp,qu)=>{qu.exports=Pm;function Pm(n,t,e,r){var i,o,a;return function(){if(a=this,o=Array.prototype.slice.call(arguments),i&&(e||r))return;if(!e)return u(),i=setTimeout(l,t),i;i=setTimeout(u,t),n.apply(a,o);function l(){u(),n.apply(a,o)}function u(){clearTimeout(i),i=null}}}});var k=qc(Gc(),1),Wt=k.default.BigInt(0),_i=k.default.BigInt(1),Bs=k.default.BigInt(2),yh=k.default.BigInt(10),vh=k.default.BigInt(24),bh=k.default.BigInt(60),wh=k.default.BigInt(1e3),$i=k.default.BigInt(1e6),yi=k.default.BigInt(1e9),Pl=k.default.multiply(k.default.BigInt(3600),yi),Dh=k.default.multiply(bh,yi),Wn=k.default.multiply(Pl,vh);function Mn(n){return typeof n=="bigint"?k.default.BigInt(n.toString(10)):n}function Rl(n){return k.default.equal(k.default.remainder(n,Bs),Wt)}function cr(n){return k.default.lessThan(n,Wt)?k.default.unaryMinus(n):n}function So(n,t){return k.default.lessThan(n,t)?-1:k.default.greaterThan(n,t)?1:0}function li(n,t){return{quotient:k.default.divide(n,t),remainder:k.default.remainder(n,t)}}var Kc,Zc,he="slot-epochNanoSeconds",me="slot-iso-date",He="slot-iso-date-time",je="slot-time",U="slot-calendar",Il="slot-date-brand",xl="slot-year-month-brand",Al="slot-month-day-brand",ke="slot-time-zone",gt="slot-years",yt="slot-months",At="slot-weeks",vt="slot-days",bt="slot-hours",wt="slot-minutes",Dt="slot-seconds",Et="slot-milliseconds",_t="slot-microseconds",Lt="slot-nanoseconds",Ll="date",Nl="ym",Ol="md",Hl="time",Bl="datetime",Fl="instant",br="original",Pr="timezone-canonical",Xa="timezone-original",ui="calendar-id",Yl="locale",Qa="options",$l=new WeakMap,es=Symbol.for("@@Temporal__GetSlots");(Kc=globalThis)[es]||(Kc[es]=function(n){return $l.get(n)});var jo=globalThis[es],ts=Symbol.for("@@Temporal__CreateSlots");(Zc=globalThis)[ts]||(Zc[ts]=function(n){$l.set(n,Object.create(null))});var Nn=globalThis[ts];function kt(n,...t){if(!n||typeof n!="object")return!1;let e=jo(n);return!!e&&t.every(r=>r in e)}function m(n,t){let e=jo(n)?.[t];if(e===void 0)throw new TypeError(`Missing internal slot ${t}`);return e}function ve(n,t,e){let r=jo(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 ns={};function On(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))}rs(t,n),rs(`${t}.prototype`,n.prototype)}function rs(n,t){let e=`%${n}%`;if(ns[e]!==void 0)throw new Error(`intrinsic ${n} already exists`);ns[e]=t}function rt(n){return ns[n]}function Ir(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 Wa(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 zo(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 Uo(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 Pe=class n{constructor(t){this.totalNs=Mn(t),this.sec=k.default.toNumber(k.default.divide(this.totalNs,yi)),this.subsec=k.default.toNumber(k.default.remainder(this.totalNs,yi))}static validateNew(t,e){if(k.default.greaterThan(cr(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),wh)),k.default.multiply(k.default.BigInt(i),$i)),k.default.multiply(k.default.BigInt(r),yi)),k.default.multiply(k.default.BigInt(e),Dh)),k.default.multiply(k.default.BigInt(t),Pl));return n.validateNew(s,"total")}abs(){return new n(cr(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),Wn)),"sum")}addToEpochNs(t){return k.default.add(Mn(t),this.totalNs)}cmp(t){return So(this.totalNs,t.totalNs)}divmod(t){let{quotient:e,remainder:r}=li(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}=li(this.totalNs,r),a=[],s,l=(k.default.lessThan(this.totalNs,Wt)?-1:1)*Math.sign(k.default.toNumber(e));for(;!k.default.equal(o,Wt)&&a.length<50;)o=k.default.multiply(o,yh),{quotient:s,remainder:o}=li(o,r),a.push(Math.abs(k.default.toNumber(s)));return l*+(cr(i).toString()+"."+a.join(""))}isZero(){return k.default.equal(this.totalNs,Wt)}round(t,e){let r=Mn(t);if(k.default.equal(r,_i))return this;let{quotient:i,remainder:o}=li(this.totalNs,r),a=k.default.lessThan(this.totalNs,Wt)?"negative":"positive",s=k.default.multiply(cr(i),r),l=k.default.add(s,r),u=So(cr(k.default.multiply(o,Bs)),r),h=zo(e,a),p=k.default.equal(cr(this.totalNs),s)?s:Uo(s,l,u,Rl(i),h),y=a==="positive"?p:k.default.unaryMinus(p);return n.validateNew(y,"rounding")}sign(){return this.cmp(new n(Wt))}subtract(t){return n.validateNew(k.default.subtract(this.totalNs,t.totalNs),"difference")}};Pe.MAX=k.default.BigInt("9007199254740991999999999"),Pe.ZERO=new Pe(Wt);var Jc=/[A-Za-z._][A-Za-z._0-9+-]*/,ji=new RegExp(`(?:${/(?:[+-](?:[01][0-9]|2[0-3])(?::?[0-5][0-9])?)/.source}|(?:${Jc.source})(?:\\/(?:${Jc.source}))*)`),jl=/(?:[+-]\d{6}|\d{4})/,Co=/(?:0[1-9]|1[0-2])/,is=/(?:0[1-9]|[12]\d|3[01])/,Eh=new RegExp(`(${jl.source})(?:-(${Co.source})-(${is.source})|(${Co.source})(${is.source}))`),zl=/(\d{2})(?::(\d{2})(?::(\d{2})(?:[.,](\d{1,9}))?)?|(\d{2})(?:(\d{2})(?:[.,](\d{1,9}))?)?)?/,Ul=/((?:[+-])(?:[01][0-9]|2[0-3])(?::?(?:[0-5][0-9])(?::?(?:[0-5][0-9])(?:[.,](?:\d{1,9}))?)?)?)/,Vl=new RegExp(`([zZ])|${Ul.source}?`),Nr=/\[(!)?([a-z_][a-z0-9_-]*)=([A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)\]/g,_h=new RegExp([`^${Eh.source}`,`(?:(?:[tT]|\\s+)${zl.source}(?:${Vl.source})?)?`,`(?:\\[!?(${ji.source})\\])?`,`((?:${Nr.source})*)$`].join("")),Mh=new RegExp([`^[tT]?${zl.source}`,`(?:${Vl.source})?`,`(?:\\[!?${ji.source}\\])?`,`((?:${Nr.source})*)$`].join("")),Th=new RegExp(`^(${jl.source})-?(${Co.source})(?:\\[!?${ji.source}\\])?((?:${Nr.source})*)$`),Sh=new RegExp(`^(?:--)?(${Co.source})-?(${is.source})(?:\\[!?${ji.source}\\])?((?:${Nr.source})*)$`),Ga=/(\d+)(?:[.,](\d{1,9}))?/,Ch=new RegExp(`(?:${Ga.source}H)?(?:${Ga.source}M)?(?:${Ga.source}S)?`),kh=new RegExp(`^([+-])?P${/(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/.source}(?:T(?!$)${Ch.source})?$`,"i"),Gn=864e5,ko=1e6*Gn,Ph=6e10,ql=1e8*Gn,Or=cn(ql),Mi=k.default.unaryMinus(Or),Rh=k.default.add(k.default.subtract(Mi,Wn),_i),Ih=k.default.subtract(k.default.add(Or,Wn),_i),xh=146097*Gn,Xc=-271821,Qc=275760,vi=Date.UTC(1847,0,1),Ah=["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"],Lh=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 ze(n){return typeof n=="object"&&n!==null||typeof n=="function"}function Vo(n){if(typeof n=="bigint")throw new TypeError("Cannot convert BigInt to number");return Number(n)}function qo(n){if(typeof n=="symbol")throw new TypeError("Cannot convert a Symbol value to a String");return String(n)}function fe(n){let t=Vo(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 el(n,t){let e=fe(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 an(n){let t=Vo(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 Ti(n,t){return String(n).padStart(t,"0")}function Ge(n){if(typeof n!="string")throw new TypeError(`expected a string, not ${String(n)}`);return n}function os(n,t){if(ze(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 as=["era","eraYear","year","month","monthCode","day","hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],Nh={era:qo,eraYear:fe,year:fe,month:el,monthCode:function(n){let t=Ge(os(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:el,hour:fe,minute:fe,second:fe,millisecond:fe,microsecond:fe,nanosecond:fe,offset:function(n){let t=Ge(os(n));return Vr(t),t},timeZone:St},Oh={hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},Hr=[["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"]],tl=Object.fromEntries(Hr.map(n=>[n[0],n[1]])),Hh=Object.fromEntries(Hr.map(([n,t])=>[t,n])),bi=Hr.map(([,n])=>n),Br={day:ko,hour:36e11,minute:6e10,second:1e9,millisecond:1e6,microsecond:1e3,nanosecond:1},Po=["days","hours","microseconds","milliseconds","minutes","months","nanoseconds","seconds","weeks","years"],Bh=Intl.DateTimeFormat,nl=new Map;function Wl(n){let t=Ri(n),e=nl.get(t);return e===void 0&&(e=new Bh("en-us",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),nl.set(t,e)),e}function et(n){return kt(n,he)&&!kt(n,ke,U)}function Ye(n){return kt(n,gt,yt,vt,bt,wt,Dt,Et,_t,Lt)}function $e(n){return kt(n,Il)}function Ue(n){return kt(n,je)}function Le(n){return kt(n,He)}function tt(n){return kt(n,xl)}function qt(n){return kt(n,Al)}function be(n){return kt(n,he,ke,U)}function I(n,t){if(!t(n))throw new TypeError("invalid receiver: method called with the wrong type of this-object")}function jr(n){if(kt(n,U)||kt(n,ke))throw new TypeError("with() does not support a calendar or timeZone property");if(Ue(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 zi(n,t){return t==="never"||t==="auto"&&n==="iso8601"?"":`[${t==="critical"?"!":""}u-ca=${n}]`}function Wo(n){let t,e,r=!1;for(Nr.lastIndex=0;e=Nr.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 wn(n){let t=_h.exec(n);if(!t)throw new RangeError(`invalid RFC 9557 string: ${n}`);let e=Wo(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),h=+(t[8]??t[11]??0);h===60&&(h=59);let p=(t[9]??t[12]??"")+"000000000",y=+p.slice(0,3),D=+p.slice(3,6),T=+p.slice(6,9),C,N=!1;t[13]?(C=void 0,N=!0):t[14]&&(C=t[14]);let $=t[15];return Us(i,o,a,l,u,h,y,D,T),{year:i,month:o,day:a,time:s?{hour:l,minute:u,second:h,millisecond:y,microsecond:D,nanosecond:T}:"start-of-day",tzAnnotation:$,offset:C,z:N,calendar:e}}function Gl(n){let t=Mh.exec(n),e,r,i,o,a,s,l;if(t){l=Wo(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,h;if({time:u,z:h,calendar:l}=wn(n),u==="start-of-day")throw new RangeError(`time is missing in string: ${n}`);if(h)throw new RangeError("Z designator not supported for PlainTime");({hour:e,minute:r,second:i,millisecond:o,microsecond:a,nanosecond:s}=u)}if(Jo(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:h}=Ys(n);mr(1972,u,h)}catch{try{let{year:u,month:h}=Fs(n);mr(u,h,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 Fs(n){let t=Th.exec(n),e,r,i,o;if(t){i=Wo(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}=wn(n),a)throw new RangeError("Z designator not supported for PlainYearMonth")}return{year:e,month:r,calendar:i,referenceISODay:o}}function Ys(n){let t=Sh.exec(n),e,r,i,o;if(t){if(i=Wo(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}=wn(n),a)throw new RangeError("Z designator not supported for PlainMonthDay")}return{month:e,day:r,calendar:i,referenceISOYear:o}}var Kl=new RegExp(`^${ji.source}$`,"i"),Zl=new RegExp(`^${/([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])?)?/.source}$`);function Jl(n){let t=Yh.test(n)?"Seconds not allowed in offset time zone":"Invalid time zone";throw new RangeError(`${t}: ${n}`)}function qn(n){return Kl.test(n)||Jl(n),Zl.test(n)?{offsetMinutes:Vr(n)/6e10}:{tzName:n}}function wi(n,t,e,r){let i=n,o=t,a=e;switch(r){case"reject":mr(i,o,a);break;case"constrain":({year:i,month:o,day:a}=pu(i,o,a))}return{year:i,month:o,day:a}}function Go(n,t,e,r,i,o,a){let s=n,l=t,u=e,h=r,p=i,y=o;switch(a){case"reject":Jo(s,l,u,h,p,y);break;case"constrain":s=Mt(s,0,23),l=Mt(l,0,59),u=Mt(u,0,59),h=Mt(h,0,999),p=Mt(p,0,999),y=Mt(y,0,999)}return{hour:s,minute:l,second:u,millisecond:h,microsecond:p,nanosecond:y}}function Xl(n){if(!ze(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<Po.length;r++){let i=Po[r],o=n[i];o!==void 0&&(e=!0,t[i]=an(o))}if(!e)throw new TypeError("invalid duration-like");return t}function st({years:n,months:t,weeks:e,days:r},i,o,a){return{years:n,months:a??t,weeks:o??e,days:i??r}}function Me(n,t){return{isoDate:n,time:t}}function Ee(n){return In(n,"overflow",["constrain","reject"],"constrain")}function Di(n){return In(n,"disambiguation",["compatible","earlier","later","reject"],"compatible")}function ln(n,t){return In(n,"roundingMode",["ceil","floor","expand","trunc","halfCeil","halfFloor","halfExpand","halfTrunc","halfEven"],t)}function To(n,t){return In(n,"offset",["prefer","use","ignore","reject"],t)}function Ui(n){return In(n,"calendarName",["auto","always","never","critical"],"auto")}function zr(n){let t=n.roundingIncrement;if(t===void 0)return 1;let e=fe(t);if(e<1||e>1e9)throw new RangeError(`roundingIncrement must be at least 1 and at most 1e9, not ${t}`);return e}function Ur(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 Vi(n){let t=n.fractionalSecondDigits;if(t===void 0)return"auto";if(typeof t!="number"){if(qo(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 qi(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 An=Symbol("~required~");function Ot(n,t,e,r,i=[]){let o=[];for(let u=0;u<Hr.length;u++){let h=Hr[u],p=h[1],y=h[2];e!=="datetime"&&e!==y||o.push(p)}o=o.concat(i);let a=r;a===An?a=void 0:a!==void 0&&o.push(a);let s=[];s=s.concat(o);for(let u=0;u<o.length;u++){let h=o[u],p=Hh[h];p!==void 0&&s.push(p)}let l=In(n,t,s,a);if(l===void 0&&r===An)throw new RangeError(`${t} is required`);return l&&l in tl?tl[l]:l}function Ka(n){let t=n.relativeTo;if(t===void 0)return{};let e,r,i,o,a,s="option",l=!1;if(ze(t)){if(be(t))return{zonedRelativeTo:t};if($e(t))return{plainRelativeTo:t};if(Le(t))return{plainRelativeTo:Tt(m(t,He).isoDate,m(t,U))};i=Ji(t);let u=Jt(i,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],[]);({isoDate:e,time:r}=Gi(i,u,"constrain")),{offset:a,timeZone:o}=u,a===void 0&&(s="wall")}else{let u,h,p,y,D;if({year:p,month:y,day:D,time:r,calendar:i,tzAnnotation:u,offset:a,z:h}=wn(Ge(t)),u)o=St(u),h?s="exact":a||(s="wall"),l=!0;else if(h)throw new RangeError("Z designator not supported for PlainDate relativeTo; either remove the Z or add a bracketed time zone");i||(i="iso8601"),i=Pt(i),e={year:p,month:y,day:D}}return o===void 0?{plainRelativeTo:Tt(e,i)}:{zonedRelativeTo:at(Ro(e,r,s,s==="option"?Vr(a):0,o,"compatible","reject",l),o,i)}}function Tn(n){return m(n,gt)!==0?"year":m(n,yt)!==0?"month":m(n,At)!==0?"week":m(n,vt)!==0?"day":m(n,bt)!==0?"hour":m(n,wt)!==0?"minute":m(n,Dt)!==0?"second":m(n,Et)!==0?"millisecond":m(n,_t)!==0?"microsecond":"nanosecond"}function Pn(n,t){return bi.indexOf(n)>bi.indexOf(t)?t:n}function mn(n){return n==="year"||n==="month"||n==="week"}function Sn(n){return mn(n)||n==="day"?"date":"time"}function Jn(n){return rt("%calendarImpl%")(n)}function Wi(n){return rt("%calendarImpl%")(m(n,U))}function Ct(n,t,e="date"){let r=Object.create(null),i=Jn(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 Jt(n,t,e,r,i){let o=Jn(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 h=a[u],p=t[h];if(p!==void 0)l=!0,s[h]=(0,Nh[h])(p);else if(i!=="partial"){if(i.includes(h))throw new TypeError(`required property '${h}' missing or undefined`);s[h]=Oh[h]}}if(i==="partial"&&!l)throw new TypeError("no supported properties found");return s}function ss(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]=fe(s),r=!0):t==="complete"&&(i[a]=0)}if(!r)throw new TypeError("invalid time-like");return i}function di(n,t){if(ze(n)){if($e(n))return Ee(ie(t)),Tt(m(n,me),m(n,U));if(be(n)){let l=rn(m(n,ke),m(n,he));return Ee(ie(t)),Tt(l.isoDate,m(n,U))}if(Le(n))return Ee(ie(t)),Tt(m(n,He).isoDate,m(n,U));let s=Ji(n);return Tt(Kn(s,Jt(s,n,["year","month","monthCode","day"],[],[]),Ee(ie(t))),s)}let{year:e,month:r,day:i,calendar:o,z:a}=wn(Ge(n));if(a)throw new RangeError("Z designator not supported for PlainDate");return o||(o="iso8601"),o=Pt(o),Ee(ie(t)),Tt({year:e,month:r,day:i},o)}function Gi(n,t,e){return Me(Kn(n,t,e),Go(t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond,e))}function hi(n,t){let e,r,i;if(ze(n)){if(Le(n))return Ee(ie(t)),en(m(n,He),m(n,U));if(be(n)){let s=rn(m(n,ke),m(n,he));return Ee(ie(t)),en(s,m(n,U))}if($e(n))return Ee(ie(t)),en(Me(m(n,me),{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),m(n,U));i=Ji(n);let o=Jt(i,n,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond"],[]),a=Ee(ie(t));({isoDate:e,time:r}=Gi(i,o,a))}else{let o,a,s,l;if({year:a,month:s,day:l,time:r,calendar:i,z:o}=wn(Ge(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}),Us(a,s,l,r.hour,r.minute,r.second,r.millisecond,r.microsecond,r.nanosecond),i||(i="iso8601"),i=Pt(i),Ee(ie(t)),e={year:a,month:s,day:l}}return en(Me(e,r),i)}function nn(n){let t=rt("%Temporal.Duration%");if(Ye(n))return new t(m(n,gt),m(n,yt),m(n,At),m(n,vt),m(n,bt),m(n,wt),m(n,Dt),m(n,Et),m(n,_t),m(n,Lt));if(!ze(n))return function(i){let{years:o,months:a,weeks:s,days:l,hours:u,minutes:h,seconds:p,milliseconds:y,microseconds:D,nanoseconds:T}=function(C){let N=kh.exec(C);if(!N)throw new RangeError(`invalid duration: ${C}`);if(N.every((v,E)=>E<2||v===void 0))throw new RangeError(`invalid duration: ${C}`);let $=N[1]==="-"?-1:1,G=N[2]===void 0?0:fe(N[2])*$,W=N[3]===void 0?0:fe(N[3])*$,ne=N[4]===void 0?0:fe(N[4])*$,le=N[5]===void 0?0:fe(N[5])*$,oe=N[6]===void 0?0:fe(N[6])*$,Ce=N[7],Te=N[8],se=N[9],B=N[10],z=N[11],Y=0,ae=0,g=0;if(Ce!==void 0){if(Te??se??B??z)throw new RangeError("only the smallest unit can be fractional");g=3600*fe((Ce+"000000000").slice(0,9))*$}else if(Y=Te===void 0?0:fe(Te)*$,se!==void 0){if(B??z)throw new RangeError("only the smallest unit can be fractional");g=60*fe((se+"000000000").slice(0,9))*$}else ae=B===void 0?0:fe(B)*$,z!==void 0&&(g=fe((z+"000000000").slice(0,9))*$);let H=g%1e3,c=Math.trunc(g/1e3)%1e3,d=Math.trunc(g/1e6)%1e3;return ae+=Math.trunc(g/1e9)%60,Y+=Math.trunc(g/6e10),Xo(G,W,ne,le,oe,Y,ae,d,c,H),{years:G,months:W,weeks:ne,days:le,hours:oe,minutes:Y,seconds:ae,milliseconds:d,microseconds:c,nanoseconds:H}}(i);return new(rt("%Temporal.Duration%"))(o,a,s,l,u,h,p,y,D,T)}(Ge(n));let e={years:0,months:0,weeks:0,days:0,hours:0,minutes:0,seconds:0,milliseconds:0,microseconds:0,nanoseconds:0},r=Xl(n);for(let i=0;i<Po.length;i++){let o=Po[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 mi(n){let t;if(ze(n)){if(et(n)||be(n))return sn(m(n,he));t=os(n)}else t=n;let{year:e,month:r,day:i,time:o,offset:a,z:s}=function(C){let N=wn(C);if(!N.z&&!N.offset)throw new RangeError("Temporal.Instant requires a time zone offset");return N}(Ge(t)),{hour:l=0,minute:u=0,second:h=0,millisecond:p=0,microsecond:y=0,nanosecond:D=0}=o==="start-of-day"?{}:o,T=Pi(e,r,i,l,u,h,p,y,D-(s?0:Vr(a)));return Lr(T.isoDate),sn(nt(T))}function rl(n,t){if(ze(n)){if(qt(n))return Ee(ie(t)),xr(m(n,me),m(n,U));let s;return kt(n,U)?s=m(n,U):(s=n.calendar,s===void 0&&(s="iso8601"),s=Zi(s)),xr(Io(s,Jt(s,n,["year","month","monthCode","day"],[],[]),Ee(ie(t))),s)}let{month:e,day:r,referenceISOYear:i,calendar:o}=Ys(Ge(n));if(o===void 0&&(o="iso8601"),o=Pt(o),Ee(ie(t)),o==="iso8601")return xr({year:1972,month:e,day:r},o);let a={year:i,month:e,day:r};return wr(a),a=Io(o,Ct(o,a,"month-day"),"constrain"),xr(a,o)}function Un(n,t){let e;if(ze(n)){if(Ue(n))return Ee(ie(t)),Cn(m(n,je));if(Le(n))return Ee(ie(t)),Cn(m(n,He).time);if(be(n)){let u=rn(m(n,ke),m(n,he));return Ee(ie(t)),Cn(u.time)}let{hour:r,minute:i,second:o,millisecond:a,microsecond:s,nanosecond:l}=ss(n);e=Go(r,i,o,a,s,l,Ee(ie(t)))}else e=Gl(Ge(n)),Ee(ie(t));return Cn(e)}function Ql(n){return n===void 0?{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}:m(Un(n),je)}function pi(n,t){if(ze(n)){if(tt(n))return Ee(ie(t)),Ar(m(n,me),m(n,U));let s=Ji(n);return Ar(Si(s,Jt(s,n,["year","month","monthCode"],[],[]),Ee(ie(t))),s)}let{year:e,month:r,referenceISODay:i,calendar:o}=Fs(Ge(n));o===void 0&&(o="iso8601"),o=Pt(o),Ee(ie(t));let a={year:e,month:r,day:i};return Vs(a),a=Si(o,Ct(o,a,"year-month"),"constrain"),Ar(a,o)}function Ro(n,t,e,r,i,o,a,s){if(t==="start-of-day")return jn(i,n);let l=Me(n,t);if(e==="wall"||a==="ignore")return ct(i,l,o);if(e==="exact"||a==="use"){let p=Pi(n.year,n.month,n.day,t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond-r);Lr(p.isoDate);let y=nt(p);return vn(y),y}Lr(n);let u=nt(l),h=Ci(i,l);for(let p=0;p<h.length;p++){let y=h[p],D=k.default.toNumber(k.default.subtract(u,y)),T=Vn(D,6e10,"halfExpand");if(D===r||s&&T===r)return y}if(a==="reject"){let p=cs(r),y=ki(l,"iso8601","auto");throw new RangeError(`Offset ${p} is invalid for ${y} in ${i}`)}return cu(h,i,l,o)}function fi(n,t){let e,r,i,o,a,s,l,u=!1,h="option";if(ze(n)){if(be(n)){let C=ie(t);return Di(C),To(C,"reject"),Ee(C),at(m(n,he),m(n,ke),m(n,U))}a=Ji(n);let y=Jt(a,n,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],["timeZone"]);({offset:o,timeZone:i}=y),o===void 0&&(h="wall");let D=ie(t);s=Di(D),l=To(D,"reject");let T=Ee(D);({isoDate:e,time:r}=Gi(a,y,T))}else{let y,D,T,C,N;({year:T,month:C,day:N,time:r,tzAnnotation:y,offset:o,z:D,calendar:a}=function(G){let W=wn(G);if(!W.tzAnnotation)throw new RangeError("Temporal.ZonedDateTime requires a time zone ID in brackets");return W}(Ge(n))),i=St(y),D?h="exact":o||(h="wall"),a||(a="iso8601"),a=Pt(a),u=!0;let $=ie(t);s=Di($),l=To($,"reject"),Ee($),e={year:T,month:C,day:N}}let p=0;return h==="option"&&(p=Vr(o)),at(Ro(e,r,h,p,i,s,l,u),i,a)}function eu(n,t,e){wr(t),Nn(n),ve(n,me,t),ve(n,U,e),ve(n,Il,!0)}function Tt(n,t){let e=rt("%Temporal.PlainDate%"),r=Object.create(e.prototype);return eu(r,n,t),r}function tu(n,t,e){pr(t),Nn(n),ve(n,He,t),ve(n,U,e)}function en(n,t){let e=rt("%Temporal.PlainDateTime%"),r=Object.create(e.prototype);return tu(r,n,t),r}function nu(n,t,e){wr(t),Nn(n),ve(n,me,t),ve(n,U,e),ve(n,Al,!0)}function xr(n,t){let e=rt("%Temporal.PlainMonthDay%"),r=Object.create(e.prototype);return nu(r,n,t),r}function ru(n,t){Nn(n),ve(n,je,t)}function Cn(n){let t=rt("%Temporal.PlainTime%"),e=Object.create(t.prototype);return ru(e,n),e}function iu(n,t,e){Vs(t),Nn(n),ve(n,me,t),ve(n,U,e),ve(n,xl,!0)}function Ar(n,t){let e=rt("%Temporal.PlainYearMonth%"),r=Object.create(e.prototype);return iu(r,n,t),r}function ou(n,t){vn(t),Nn(n),ve(n,he,t)}function sn(n){let t=rt("%Temporal.Instant%"),e=Object.create(t.prototype);return ou(e,n),e}function au(n,t,e,r){vn(t),Nn(n),ve(n,he,t),ve(n,ke,e),ve(n,U,r)}function at(n,t,e="iso8601"){let r=rt("%Temporal.ZonedDateTime%"),i=Object.create(r.prototype);return au(i,n,t,e),i}function il(n){return as.filter(t=>n[t]!==void 0)}function hr(n,t,e){let r=il(e),i=Jn(n).fieldKeysToIgnore(r),o=Object.create(null),a=il(t);for(let s=0;s<as.length;s++){let l,u=as[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 Kt(n,t,e,r){let i=Jn(n).dateAdd(t,e,r);return wr(i),i}function Ki(n,t,e,r){return Jn(n).dateUntil(t,e,r)}function Zi(n){if(ze(n)&&kt(n,U))return m(n,U);let t=Ge(n);try{return Pt(t)}catch{}let e;try{({calendar:e}=wn(t))}catch{try{({calendar:e}=Gl(t))}catch{try{({calendar:e}=Fs(t))}catch{({calendar:e}=Ys(t))}}}return e||(e="iso8601"),Pt(e)}function Ji(n){if(kt(n,U))return m(n,U);let{calendar:t}=n;return t===void 0?"iso8601":Zi(t)}function yn(n,t){return Pt(n)===Pt(t)}function Kn(n,t,e){let r=Jn(n);r.resolveFields(t,"date");let i=r.dateToISO(t,e);return wr(i),i}function Si(n,t,e){let r=Jn(n);r.resolveFields(t,"year-month"),t.day=1;let i=r.dateToISO(t,e);return Vs(i),i}function Io(n,t,e){let r=Jn(n);r.resolveFields(t,"month-day");let i=r.monthDayToISOReferenceDate(t,e);return wr(i),i}function St(n){if(ze(n)&&be(n))return m(n,ke);let t=Ge(n);if(t==="UTC")return"UTC";let{tzName:e,offsetMinutes:r}=function(o){let{tzAnnotation:a,offset:s,z:l}=function(u){if(Kl.test(u))return{tzAnnotation:u,offset:void 0,z:!1};try{let{tzAnnotation:h,offset:p,z:y}=wn(u);if(y||h||p)return{tzAnnotation:h,offset:p,z:y}}catch{}Jl(u)}(o);return a?qn(a):l?qn("UTC"):s?qn(s):void 0}(t);if(r!==void 0)return $s(r);let i=xo(e);if(!i)throw new RangeError(`Unrecognized time zone ${e}`);return i.identifier}function su(n,t){if(n===t)return!0;let e=qn(n).offsetMinutes,r=qn(t).offsetMinutes;if(e===void 0&&r===void 0){let i=xo(t);if(!i)return!1;let o=xo(n);return!!o&&o.primaryIdentifier===i.primaryIdentifier}return e===r}function kn(n,t){let e=qn(n).offsetMinutes;return e!==void 0?6e10*e:ls(n,t)}function cs(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}${Ko(r,i,o,a,o===0&&a===0?"minute":"auto")}`}function rn(n,t){let e=kn(n,t),{isoDate:{year:r,month:i,day:o},time:{hour:a,minute:s,second:l,millisecond:u,microsecond:h,nanosecond:p}}=du(t);return Pi(r,i,o,a,s,l,u,h,p+e)}function ct(n,t,e){return cu(Ci(n,t),n,t,e)}function cu(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=nt(e),a=k.default.subtract(o,Wn);vn(a);let s=kn(t,a),l=k.default.add(o,Wn);vn(l);let u=kn(t,l)-s;switch(r){case"earlier":{let h=Pe.fromComponents(0,0,0,0,0,-u),p=Fr(e.time,h);return Ci(t,Me(Ht(e.isoDate.year,e.isoDate.month,e.isoDate.day+p.deltaDays),p))[0]}case"compatible":case"later":{let h=Pe.fromComponents(0,0,0,0,0,u),p=Fr(e.time,h),y=Ci(t,Me(Ht(e.isoDate.year,e.isoDate.month,e.isoDate.day+p.deltaDays),p));return y[y.length-1]}}}function Ci(n,t){if(n==="UTC")return Lr(t.isoDate),[nt(t)];let e=qn(n).offsetMinutes;if(e!==void 0){let r=Pi(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);Lr(r.isoDate);let i=nt(r);return vn(i),[i]}return Lr(t.isoDate),function(r,i){let o=nt(i),a=k.default.subtract(o,Wn);k.default.lessThan(a,Mi)&&(a=o);let s=k.default.add(o,Wn);k.default.greaterThan(s,Or)&&(s=o);let l=ls(r,a),u=ls(r,s);return(l===u?[l]:[l,u]).map(p=>{let y=k.default.subtract(o,k.default.BigInt(p)),D=function(T,C){let{epochMilliseconds:N,time:{millisecond:$,microsecond:G,nanosecond:W}}=du(C),{year:ne,month:le,day:oe,hour:Ce,minute:Te,second:se}=hu(T,N);return Pi(ne,le,oe,Ce,Te,se,$,G,W)}(r,y);if(Yr(i,D)===0)return vn(y),y}).filter(p=>p!==void 0)}(n,t)}function jn(n,t){let e=Me(t,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),r=Ci(n,e);if(r.length)return r[0];let i=nt(e),o=k.default.subtract(i,Wn);return vn(o),zs(n,o)}function Xi(n){let t;return t=n<0||n>9999?(n<0?"-":"+")+Ti(Math.abs(n),6):Ti(n,4),t}function Zt(n){return Ti(n,2)}function lu(n,t){let e;if(t==="auto"){if(n===0)return"";e=Ti(n,9).replace(/0+$/,"")}else{if(t===0)return"";e=Ti(n,9).slice(0,t)}return`.${e}`}function Ko(n,t,e,r,i){let o=`${Zt(n)}:${Zt(t)}`;return i==="minute"||(o+=`:${Zt(e)}`,o+=lu(r,i)),o}function ol(n,t,e){let r=t;r===void 0&&(r="UTC");let i=m(n,he),o=ki(rn(r,i),"iso8601",e,"never"),a="Z";return t!==void 0&&(a=uu(kn(r,i))),`${o}${a}`}function Mo(n,t){let e=m(n,gt),r=m(n,yt),i=m(n,At),o=m(n,vt),a=m(n,bt),s=m(n,wt),l=Lo(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 h="";a!==0&&(h+=`${Math.abs(a)}H`),s!==0&&(h+=`${Math.abs(s)}M`);let p=Pe.fromComponents(0,0,m(n,Dt),m(n,Et),m(n,_t),m(n,Lt));p.isZero()&&!["second","millisecond","microsecond","nanosecond"].includes(Tn(n))&&t==="auto"||(h+=`${Math.abs(p.sec)}${lu(Math.abs(p.subsec),t)}S`);let y=`${l<0?"-":""}P${u}`;return h&&(y=`${y}T${h}`),y}function al(n,t="auto"){let{year:e,month:r,day:i}=m(n,me);return`${Xi(e)}-${Zt(r)}-${Zt(i)}${zi(m(n,U),t)}`}function sl({hour:n,minute:t,second:e,millisecond:r,microsecond:i,nanosecond:o},a){return Ko(n,t,e,1e6*r+1e3*i+o,a)}function ki(n,t,e,r="auto"){let{isoDate:{year:i,month:o,day:a},time:{hour:s,minute:l,second:u,millisecond:h,microsecond:p,nanosecond:y}}=n;return`${Xi(i)}-${Zt(o)}-${Zt(a)}T${Ko(s,l,u,1e6*h+1e3*p+y,e)}${zi(t,r)}`}function cl(n,t="auto"){let{year:e,month:r,day:i}=m(n,me),o=`${Zt(r)}-${Zt(i)}`,a=m(n,U);t!=="always"&&t!=="critical"&&a==="iso8601"||(o=`${Xi(e)}-${o}`);let s=zi(a,t);return s&&(o+=s),o}function ll(n,t="auto"){let{year:e,month:r,day:i}=m(n,me),o=`${Xi(e)}-${Zt(r)}`,a=m(n,U);t!=="always"&&t!=="critical"&&a==="iso8601"||(o+=`-${Zt(i)}`);let s=zi(a,t);return s&&(o+=s),o}function ul(n,t,e="auto",r="auto",i="auto",o=void 0){let a=m(n,he);if(o){let{unit:h,increment:p,roundingMode:y}=o;a=ms(a,p,h,y)}let s=m(n,ke),l=kn(s,a),u=ki(rn(s,a),"iso8601",t,"never");return i!=="never"&&(u+=uu(l)),r!=="never"&&(u+=`[${r==="critical"?"!":""}${s}]`),u+=zi(m(n,U),e),u}function dl(n){return Zl.test(n)}function Vr(n){let t=$h.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 ai,Fh=Object.assign(Object.create(null),{"/":!0,"-":!0,_:!0});function xo(n){if(ai===void 0){let o=Intl.supportedValuesOf?.("timeZone");if(o){ai=new Map;for(let a=0;a<o.length;a++){let s=o[a];ai.set(Ri(s),s)}}else ai=null}let t=Ri(n),e=ai?.get(t);if(e)return{identifier:e,primaryIdentifier:e};try{e=Wl(n).resolvedOptions().timeZone}catch{return}if(t==="antarctica/south_pole"&&(e="Antarctica/McMurdo"),Lh.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||Fh[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 ur(n,t){let{year:e,month:r,day:i,hour:o,minute:a,second:s}=hu(n,t),l=t%1e3;return l<0&&(l+=1e3),1e6*(js({isoDate:{year:e,month:r,day:i},time:{hour:o,minute:a,second:s,millisecond:l}})-t)}function ls(n,t){return ur(n,on(t,"floor"))}function $s(n){let t=n<0?"-":"+",e=Math.abs(n);return`${t}${Ko(Math.floor(e/60),e%60,0,0,"minute")}`}function uu(n){return $s(Vn(n,Ph,"halfExpand")/6e10)}function js({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()+xh*l}function nt(n){let t=js(n),e=1e3*n.time.microsecond+n.time.nanosecond;return k.default.add(cn(t),k.default.BigInt(e))}function du(n){let t=on(n,"trunc"),e=k.default.toNumber(k.default.remainder(n,$i));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 zs(n,t){if(n==="UTC")return null;let e=on(t,"floor");if(e<vi)return zs(n,cn(vi));let r=Date.now(),i=Math.max(e,r)+366*Gn*3,o=e,a=ur(n,o),s=o,l=a;for(;a===l&&o<i;){if(s=o+2*Gn*7,s>ql)return null;l=ur(n,s),a===l&&(o=s)}return a===l?null:cn(Eu(u=>ur(n,u),o,s,a,l))}function us(n,t){if(n==="UTC")return null;let e=on(t,"ceil"),r=Date.now(),i=r+366*Gn*3;if(e>i){let u=us(n,cn(i));if(u===null||k.default.lessThan(u,cn(r)))return u}if(n==="Africa/Casablanca"||n==="Africa/El_Aaiun"){let u=Date.UTC(2088,0,1);if(u<e)return us(n,cn(u))}let o=e-1;if(o<vi)return null;let a=ur(n,o),s=o,l=a;for(;a===l&&o>vi;){if(s=o-2*Gn*7,s<vi)return null;l=ur(n,s),a===l&&(o=s)}return a===l?null:cn(Eu(u=>ur(n,u),s,o,l,a))}function hu(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],h=+r[6];if(!(Number.isFinite(a)&&Number.isFinite(i)&&Number.isFinite(o)&&Number.isFinite(l)&&Number.isFinite(u)&&Number.isFinite(h)))throw new RangeError(`Invalid number in "${e}`);return{year:a,month:i,day:o,hour:l,minute:u,second:h}}(Wl(n).format(t))}function Ao(n){return n!==void 0&&!(n%4!=0||n%100==0&&n%400!=0)}function dr(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]}[Ao(n)?"leapyear":"standard"][t-1]}function Lo(n){let t=[m(n,gt),m(n,yt),m(n,At),m(n,vt),m(n,bt),m(n,wt),m(n,Dt),m(n,Et),m(n,_t),m(n,Lt)];for(let e=0;e<t.length;e++){let r=t[e];if(r!==0)return r<0?-1:1}return 0}function Zo(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 mu(n){let t=Zo(n.date);return t!==0?t:n.time.sign()}function lr(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 Ht(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}=lr(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=Ao(l)?366:365,o<-s;)r-=1,l-=1,o+=s;for(l+=1;s=Ao(l)?366:365,o>s;)r+=1,l+=1,o-=s;for(;o<1;)({year:r,month:i}=lr(r,i-1)),o+=dr(r,i);for(;o>dr(r,i);)o-=dr(r,i),{year:r,month:i}=lr(r,i+1);return{year:r,month:i,day:o}}function Pi(n,t,e,r,i,o,a,s,l){let u=zn(r,i,o,a,s,l);return Me(Ht(n,t,e+u.deltaDays),u)}function zn(n,t,e,r,i,o){let a,s=n,l=t,u=e,h=r,p=i,y=o;({div:a,mod:y}=Ir(y,3)),p+=a,y<0&&(p-=1,y+=1e3),{div:a,mod:p}=Ir(p,3),h+=a,p<0&&(h-=1,p+=1e3),u+=Math.trunc(h/1e3),h%=1e3,h<0&&(u-=1,h+=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 D=Math.trunc(s/24);return s%=24,s<0&&(D-=1,s+=24),D+=0,s+=0,l+=0,u+=0,h+=0,p+=0,y+=0,{deltaDays:D,hour:s,minute:l,second:u,millisecond:h,microsecond:p,nanosecond:y}}function hl(n,t){let e=st(n,0);if(Zo(e)===0)return n.days;let r=m(t,me),i=Kt(m(t,U),r,e,"constrain"),o=fr(r.year,r.month-1,r.day),a=fr(i.year,i.month-1,i.day)-o;return n.days+a}function Bt(n){return new(rt("%Temporal.Duration%"))(-m(n,gt),-m(n,yt),-m(n,At),-m(n,vt),-m(n,bt),-m(n,wt),-m(n,Dt),-m(n,Et),-m(n,_t),-m(n,Lt))}function Mt(n,t,e){return Math.min(e,Math.max(t,n))}function pu(n,t,e){let r=Mt(t,1,12);return{year:n,month:r,day:Mt(e,1,dr(n,r))}}function Ke(n,t,e){if(n<t||n>e)throw new RangeError(`value out of range: ${t} <= ${n} <= ${e}`)}function mr(n,t,e){Ke(t,1,12),Ke(e,1,dr(n,t))}function wr(n){pr(Me(n,{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}))}function Jo(n,t,e,r,i,o){Ke(n,0,23),Ke(t,0,59),Ke(e,0,59),Ke(r,0,999),Ke(i,0,999),Ke(o,0,999)}function Us(n,t,e,r,i,o,a,s,l){mr(n,t,e),Jo(r,i,o,a,s,l)}function pr(n){let t=nt(n);(k.default.lessThan(t,Rh)||k.default.greaterThan(t,Ih))&&vn(t)}function ds(n){nt(n)}function vn(n){if(k.default.lessThan(n,Mi)||k.default.greaterThan(n,Or))throw new RangeError("date/time value is outside of supported range")}function Vs({year:n,month:t}){Ke(n,Xc,Qc),n===Xc?Ke(t,4,12):n===Qc&&Ke(t,1,9)}function Xo(n,t,e,r,i,o,a,s,l,u){let h=0,p=[n,t,e,r,i,o,a,s,l,u];for(let $=0;$<p.length;$++){let G=p[$];if(G===1/0||G===-1/0)throw new RangeError("infinite values not allowed as duration fields");if(G!==0){let W=G<0?-1:1;if(h!==0&&W!==h)throw new RangeError("mixed-sign values not allowed as duration fields");h=W}}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=Ir(s,3),D=Ir(l,6),T=Ir(u,9),C=Ir(1e6*y.mod+1e3*D.mod+T.mod,9).div,N=86400*r+3600*i+60*o+a+y.div+D.div+T.div+C;if(!Number.isSafeInteger(N))throw new RangeError("total of duration time units cannot exceed 9007199254740991.999999999 s")}function Rr(n){return{date:{years:m(n,gt),months:m(n,yt),weeks:m(n,At),days:m(n,vt)},time:Pe.fromComponents(m(n,bt),m(n,wt),m(n,Dt),m(n,Et),m(n,_t),m(n,Lt))}}function fn(n){let t=Pe.fromComponents(m(n,bt),m(n,wt),m(n,Dt),m(n,Et),m(n,_t),m(n,Lt)).add24HourDays(m(n,vt));return{date:{years:m(n,gt),months:m(n,yt),weeks:m(n,At),days:0},time:t}}function fu(n){let t=fn(n),e=Math.trunc(t.time.sec/86400);return Xo(t.date.years,t.date.months,t.date.weeks,e,0,0,0,0,0,0),{...t.date,days:e}}function tn(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=Wa(a,3,Math.trunc(i/1e3)),i%=1e3,a=0;break;case"microsecond":i=Wa(a,6,Math.trunc(r/1e3)),r%=1e3,a=0;break;case"nanosecond":r=Wa(a,9,r),a=0}return new(rt("%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 Rn(n,t){return Zo(n),t.sign(),{date:n,time:t}}function fr(n,t,e){return js({isoDate:{year:n,month:t+1,day:e},time:{hour:0,minute:0,second:0,millisecond:0}})/Gn}function Lr({year:n,month:t,day:e}){if(Math.abs(fr(n,t-1,e))>1e8)throw new RangeError("date/time value is outside the supported range")}function qs(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 Pe.fromComponents(e,r,i,o,a,s)}function Ws(n,t,e,r,i){let o=Pe.fromEpochNsDiff(t,n);return o=No(o,e,r,i),Rn({years:0,months:0,weeks:0,days:0},o)}function gu(n,t,e,r){ds(n),ds(t);let i=qs(n.time,t.time),o=i.sign(),a=bn(n.isoDate,t.isoDate),s=t.isoDate;a===o&&(s=Ht(s.year,s.month,s.day+o),i=i.add24HourDays(-o));let l=Pn("day",r),u=Ki(e,n.isoDate,s,l);return r!==l&&(i=i.add24HourDays(u.days),u.days=0),Rn(u,i)}function yu(n,t,e,r,i){let o=k.default.subtract(t,n);if(k.default.equal(o,Wt))return{date:{years:0,months:0,weeks:0,days:0},time:Pe.ZERO};let a=k.default.lessThan(o,Wt)?-1:1,s=rn(e,n),l=rn(e,t),u,h=0,p=a===1?2:1,y=qs(s.time,l.time);for(y.sign()===-a&&h++;h<=p;h++){u=Me(Ht(l.isoDate.year,l.isoDate.month,l.isoDate.day-h*a),s.time);let T=ct(e,u,"compatible");if(y=Pe.fromEpochNsDiff(t,T),y.sign()!==-a)break}let D=Pn("day",i);return Rn(Ki(r,s.isoDate,u.isoDate,D),y)}function vu(n,t,e,r,i,o,a,s,l){let u,h,p,y,D=t;switch(s){case"year":{let Y=Vn(D.date.years,a,"trunc");u=Y,h=Y+a*n,p={years:u,months:0,weeks:0,days:0},y={...p,years:h};break}case"month":{let Y=Vn(D.date.months,a,"trunc");u=Y,h=Y+a*n,p=st(D.date,0,0,u),y=st(D.date,0,0,h);break}case"week":{let Y=st(D.date,0,0),ae=Kt(o,r.isoDate,Y,"constrain"),g=Ki(o,ae,Ht(ae.year,ae.month,ae.day+D.date.days),"week"),H=Vn(D.date.weeks+g.weeks,a,"trunc");u=H,h=H+a*n,p=st(D.date,0,u),y=st(D.date,0,h);break}case"day":{let Y=Vn(D.date.days,a,"trunc");u=Y,h=Y+a*n,p=st(D.date,u),y=st(D.date,h);break}}let T=Kt(o,r.isoDate,p,"constrain"),C=Kt(o,r.isoDate,y,"constrain"),N,$,G=Me(T,r.time),W=Me(C,r.time);i?(N=ct(i,G,"compatible"),$=ct(i,W,"compatible")):(N=nt(G),$=nt(W));let ne=Pe.fromEpochNsDiff(e,N),le=Pe.fromEpochNsDiff($,N),oe=zo(l,n<0?"negative":"positive"),Ce=ne.add(ne).abs().subtract(le.abs()).sign(),Te=Math.abs(u)/a%2==0,se=ne.isZero()?Math.abs(u):ne.cmp(le)?Uo(Math.abs(u),Math.abs(h),Ce,Te,oe):Math.abs(h),B=new Pe(k.default.add(k.default.multiply(le.totalNs,k.default.BigInt(u)),k.default.multiply(ne.totalNs,k.default.BigInt(a*n)))).fdiv(le.totalNs),z=se===Math.abs(h);return D={date:z?y:p,time:Pe.ZERO},{nudgeResult:{duration:D,nudgedEpochNs:z?$:N,didExpandCalendarUnit:z},total:B}}function Qo(n,t,e,r,i,o,a,s,l){let u=n,h=mn(s)||r&&s==="day",p=mu(u)<0?-1:1,y;return h?{nudgeResult:y}=vu(p,u,t,e,r,i,a,s,l):y=r?function(D,T,C,N,$,G,W,ne){let le=T,oe=Kt($,C.isoDate,le.date,"constrain"),Ce=Me(oe,C.time),Te=Me(Ht(oe.year,oe.month,oe.day+D),C.time),se=ct(N,Ce,"compatible"),B=ct(N,Te,"compatible"),z=Pe.fromEpochNsDiff(B,se);if(z.sign()!==D)throw new RangeError("time zone returned inconsistent Instants");let Y=k.default.BigInt(Br[W]*G),ae=le.time.round(Y,ne),g=ae.subtract(z),H=g.sign()!==-D,c,d;return H?(c=D,ae=g.round(Y,ne),d=ae.addToEpochNs(B)):(c=0,d=ae.addToEpochNs(se)),{duration:Rn(st(le.date,le.date.days+c),ae),nudgedEpochNs:d,didExpandCalendarUnit:H}}(p,u,e,r,i,a,s,l):function(D,T,C,N,$,G){let W=D,ne=W.time.add24HourDays(W.date.days),le=ne.round(k.default.BigInt(N*Br[$]),G),oe=le.subtract(ne),{quotient:Ce}=ne.divmod(ko),{quotient:Te}=le.divmod(ko),se=Math.sign(Te-Ce)===ne.sign(),B=oe.addToEpochNs(T),z=0,Y=le;return Sn(C)==="date"&&(z=Te,Y=le.add(Pe.fromComponents(24*-Te,0,0,0,0,0))),{duration:{date:st(W.date,z),time:Y},nudgedEpochNs:B,didExpandCalendarUnit:se}}(u,t,o,a,s,l),u=y.duration,y.didExpandCalendarUnit&&s!=="week"&&(u=function(D,T,C,N,$,G,W,ne){let le=T;if(ne===W)return le;let oe=bi.indexOf(W);for(let Ce=bi.indexOf(ne)-1;Ce>=oe;Ce--){let Te=bi[Ce];if(Te==="week"&&W!=="week")continue;let se;switch(Te){case"year":se={years:le.date.years+D,months:0,weeks:0,days:0};break;case"month":{let Y=le.date.months+D;se=st(le.date,0,0,Y);break}case"week":{let Y=le.date.weeks+D;se=st(le.date,0,Y);break}}let B=Me(Kt(G,N.isoDate,se,"constrain"),N.time),z;if(z=$?ct($,B,"compatible"):nt(B),So(C,z)===-D)break;le={date:se,time:Pe.ZERO}}return le}(p,u,y.nudgedEpochNs,e,r,i,o,Pn(s,"day"))),u}function ml(n,t,e,r,i,o){return mn(o)||r&&o==="day"?vu(mu(n)<0?-1:1,n,t,e,r,i,1,o,"trunc").total:Ei(n.time.add24HourDays(n.date.days),o)}function bu(n,t,e,r,i,o,a){if(Yr(n,t)==0)return{date:{years:0,months:0,weeks:0,days:0},time:Pe.ZERO};pr(n),pr(t);let s=gu(n,t,e,r);return o==="nanosecond"&&i===1?s:Qo(s,nt(t),n,null,e,r,i,o,a)}function wu(n,t,e,r,i,o,a,s){if(Sn(i)==="time")return Ws(n,t,o,a,s);let l=yu(n,t,e,r,i);return a==="nanosecond"&&o===1?l:Qo(l,t,rn(e,n),e,r,i,o,a,s)}function qr(n,t,e,r,i,o){let a=Hr.reduce((D,T)=>{let C=T[0],N=T[1],$=T[2];return e!=="datetime"&&$!==e||r.includes(N)||D.push(N,C),D},[]),s=Ot(t,"largestUnit",e,"auto");if(r.includes(s))throw new RangeError(`largestUnit must be one of ${a.join(", ")}, not ${s}`);let l=zr(t),u=ln(t,"trunc");n==="since"&&(u=function(D){switch(D){case"ceil":return"floor";case"floor":return"ceil";case"halfCeil":return"halfFloor";case"halfFloor":return"halfCeil";default:return D}}(u));let h=Ot(t,"smallestUnit",e,i);if(r.includes(h))throw new RangeError(`smallestUnit must be one of ${a.join(", ")}, not ${h}`);let p=Pn(o,h);if(s==="auto"&&(s=p),Pn(s,h)!==s)throw new RangeError(`largestUnit ${s} cannot be smaller than smallestUnit ${h}`);let y={hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[h];return y!==void 0&&Ur(l,y,!1),{largestUnit:s,roundingIncrement:l,roundingMode:u,smallestUnit:h}}function pl(n,t,e,r){let i=mi(e),o=qr(n,ie(r),"time",[],"nanosecond","second"),a=tn(Ws(m(t,he),m(i,he),o.roundingIncrement,o.smallestUnit,o.roundingMode),o.largestUnit);return n==="since"&&(a=Bt(a)),a}function fl(n,t,e,r){let i=di(e),o=m(t,U),a=m(i,U);if(!yn(o,a))throw new RangeError(`cannot compute difference between dates of ${o} and ${a} calendars`);let s=qr(n,ie(r),"date",[],"day","day"),l=rt("%Temporal.Duration%"),u=m(t,me),h=m(i,me);if(bn(u,h)===0)return new l;let p={date:Ki(o,u,h,s.largestUnit),time:Pe.ZERO};if(s.smallestUnit!=="day"||s.roundingIncrement!==1){let D=Me(u,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});p=Qo(p,nt(Me(h,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),D,null,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let y=tn(p,"day");return n==="since"&&(y=Bt(y)),y}function gl(n,t,e,r){let i=hi(e),o=m(t,U),a=m(i,U);if(!yn(o,a))throw new RangeError(`cannot compute difference between dates of ${o} and ${a} calendars`);let s=qr(n,ie(r),"datetime",[],"nanosecond","day"),l=rt("%Temporal.Duration%"),u=m(t,He),h=m(i,He);if(Yr(u,h)===0)return new l;let p=tn(bu(u,h,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);return n==="since"&&(p=Bt(p)),p}function yl(n,t,e,r){let i=Un(e),o=qr(n,ie(r),"time",[],"nanosecond","hour"),a=qs(m(t,je),m(i,je));a=No(a,o.roundingIncrement,o.smallestUnit,o.roundingMode);let s=tn(Rn({years:0,months:0,weeks:0,days:0},a),o.largestUnit);return n==="since"&&(s=Bt(s)),s}function vl(n,t,e,r){let i=pi(e),o=m(t,U),a=m(i,U);if(!yn(o,a))throw new RangeError(`cannot compute difference between months of ${o} and ${a} calendars`);let s=qr(n,ie(r),"date",["week","day"],"month","year"),l=rt("%Temporal.Duration%");if(bn(m(t,me),m(i,me))==0)return new l;let u=Ct(o,m(t,me),"year-month");u.day=1;let h=Kn(o,u,"constrain"),p=Ct(o,m(i,me),"year-month");p.day=1;let y=Kn(o,p,"constrain"),D={date:st(Ki(o,h,y,s.largestUnit),0,0),time:Pe.ZERO};if(s.smallestUnit!=="month"||s.roundingIncrement!==1){let C=Me(h,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});D=Qo(D,nt(Me(y,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),C,null,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let T=tn(D,"day");return n==="since"&&(T=Bt(T)),T}function bl(n,t,e,r){let i=fi(e),o=m(t,U),a=m(i,U);if(!yn(o,a))throw new RangeError(`cannot compute difference between dates of ${o} and ${a} calendars`);let s=qr(n,ie(r),"datetime",[],"nanosecond","hour"),l=m(t,he),u=m(i,he),h=rt("%Temporal.Duration%"),p;if(Sn(s.largestUnit)!=="date")p=tn(Ws(l,u,s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);else{let y=m(t,ke);if(!su(y,m(i,ke)))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 h;p=tn(wu(l,u,y,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),"hour")}return n==="since"&&(p=Bt(p)),p}function Fr({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,zn(n,t,s,r,i,l)}function hs(n,t){let e=t.addToEpochNs(n);return vn(e),e}function gi(n,t,e,r,i="constrain"){if(Zo(r.date)===0)return hs(n,r.time);let o=rn(t,n);return hs(ct(t,Me(Kt(e,o.isoDate,r.date,i),o.time),"compatible"),r.time)}function wl(n,t,e){let r=nn(e);n==="subtract"&&(r=Bt(r));let i=Pn(Tn(t),Tn(r));if(mn(i))throw new RangeError("For years, months, or weeks arithmetic, use date arithmetic relative to a starting point");let o=fn(t),a=fn(r);return tn(Rn({years:0,months:0,weeks:0,days:0},o.time.add(a.time)),i)}function Dl(n,t,e){let r=nn(e);n==="subtract"&&(r=Bt(r));let i=Tn(r);if(Sn(i)==="date")throw new RangeError(`Duration field ${i} not supported by Temporal.Instant. Try Temporal.ZonedDateTime instead.`);let o=fn(r);return sn(hs(m(t,he),o.time))}function El(n,t,e,r){let i=m(t,U),o=nn(e);n==="subtract"&&(o=Bt(o));let a=fu(o),s=Ee(ie(r));return Tt(Kt(i,m(t,me),a,s),i)}function _l(n,t,e,r){let i=nn(e);n==="subtract"&&(i=Bt(i));let o=Ee(ie(r)),a=m(t,U),s=fn(i),l=m(t,He),u=Fr(l.time,s.time),h=st(s.date,u.deltaDays);return Xo(h.years,h.months,h.weeks,h.days,0,0,0,0,0,0),en(Me(Kt(a,l.isoDate,h,o),u),a)}function Ml(n,t,e){let r=nn(e);n==="subtract"&&(r=Bt(r));let i=fn(r),{hour:o,minute:a,second:s,millisecond:l,microsecond:u,nanosecond:h}=Fr(m(t,je),i.time);return Cn(Go(o,a,s,l,u,h,"reject"))}function Tl(n,t,e,r){let i=nn(e);n==="subtract"&&(i=Bt(i));let o=Ee(ie(r)),a=Lo(i),s=m(t,U),l=Ct(s,m(t,me),"year-month");l.day=1;let u=Kn(s,l,"constrain");if(a<0){let p=Kt(s,u,{months:1},"constrain");u=Ht(p.year,p.month,p.day-1)}let h=fu(i);return wr(u),Ar(Si(s,Ct(s,Kt(s,u,h,o),"year-month"),o),s)}function Sl(n,t,e,r){let i=nn(e);n==="subtract"&&(i=Bt(i));let o=Ee(ie(r)),a=m(t,ke),s=m(t,U),l=Rr(i);return at(gi(m(t,he),a,s,l,o),a,s)}function Vn(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=Nt(Math.abs(2*i)-t),u=a%2==0,h=zo(e,o),p=i===0?a:Uo(a,s,l,u,h);return t*(o==="positive"?p:-p)}function ms(n,t,e,r){let i=Br[e]*t;return function(o,a,s){let l=Mn(o),u=Mn(a),h=k.default.divide(l,u),p=k.default.remainder(l,u),y=zo(s,"positive"),D,T;k.default.lessThan(l,Wt)?(D=k.default.subtract(h,_i),T=h):(D=h,T=k.default.add(h,_i));let C=So(cr(k.default.multiply(p,Bs)),u)*(k.default.lessThan(l,Wt)?-1:1)+0,N=k.default.equal(p,Wt)?h:Uo(D,T,C,Rl(D),y);return k.default.multiply(N,u)}(n,k.default.BigInt(i),r)}function ps(n,t,e,r){ds(n);let{year:i,month:o,day:a}=n.isoDate,s=fs(n.time,t,e,r);return Me(Ht(i,o,a+s.deltaDays),s)}function fs({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 h=Br[s],p=Vn(u,h*a,l)/h;switch(s){case"day":return{deltaDays:p,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0};case"hour":return zn(p,0,0,0,0,0);case"minute":return zn(n,p,0,0,0,0);case"second":return zn(n,t,p,0,0,0);case"millisecond":return zn(n,t,e,p,0,0);case"microsecond":return zn(n,t,e,r,p,0);case"nanosecond":return zn(n,t,e,r,i,p);default:throw new Error(`Invalid unit ${s}`)}}function No(n,t,e,r){let i=Br[e];return n.round(k.default.BigInt(i*t),r)}function Ei(n,t){let e=Br[t];return n.fdiv(k.default.BigInt(e))}function bn(n,t){return n.year!==t.year?Nt(n.year-t.year):n.month!==t.month?Nt(n.month-t.month):n.day!==t.day?Nt(n.day-t.day):0}function gs(n,t){return n.hour!==t.hour?Nt(n.hour-t.hour):n.minute!==t.minute?Nt(n.minute-t.minute):n.second!==t.second?Nt(n.second-t.second):n.millisecond!==t.millisecond?Nt(n.millisecond-t.millisecond):n.microsecond!==t.microsecond?Nt(n.microsecond-t.microsecond):n.nanosecond!==t.nanosecond?Nt(n.nanosecond-t.nanosecond):0}function Yr(n,t){let e=bn(n.isoDate,t.isoDate);return e!==0?e:gs(n.time,t.time)}function Du(n){let t=Oo(n);return globalThis.BigInt!==void 0?globalThis.BigInt(t.toString(10)):t}function on(n,t){let e=Mn(n),{quotient:r,remainder:i}=li(e,$i),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 cn(n){if(!Number.isInteger(n))throw new RangeError("epoch milliseconds must be an integer");return k.default.multiply(k.default.BigInt(n),$i)}function Oo(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 ys=(()=>{let n=k.default.BigInt(Date.now()%1e6);return()=>{let t=Date.now(),e=k.default.BigInt(t),r=k.default.add(cn(t),n);return n=k.default.remainder(e,$i),k.default.greaterThan(r,Or)?Or:k.default.lessThan(r,Mi)?Mi:r}})();function si(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}function Nt(n){return n<0?-1:n>0?1:n}function ie(n){if(n===void 0)return Object.create(null);if(ze(n)&&n!==null)return n;throw new TypeError("Options parameter must be an object, not "+(n===null?"null":typeof n))}function gr(n,t){let e=Object.create(null);return e[n]=t,e}function In(n,t,e,r){let i=n[t];if(i!==void 0){if(i=qo(i),!e.includes(i))throw new RangeError(`${t} must be one of ${e.join(", ")}, not ${i}`);return i}if(r===An)throw new RangeError(`${t} option is required`);return r}function Pt(n){let t=Ri(n);if(!Ah.includes(Ri(t)))throw new RangeError(`invalid calendar identifier ${t}`);switch(t){case"ethiopic-amete-alem":return"ethioaa";case"islamicc":return"islamic-civil"}return t}function Ri(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 Xn(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 Yh=new RegExp(`^${Ul.source}$`),$h=new RegExp(`^${/([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])(?::?([0-5][0-9])(?:[.,](\d{1,9}))?)?)?/.source}$`);function Eu(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),h=n(u);h===s?(o=u,s=h):h===l&&(a=u,l=h)}return a}function _u(n){return[...n]}function Mu(n,t){if(n!=="gregory"&&n!=="iso8601")return;let e=Qi[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,h=(i-o+7001-s)%7,p=Math.floor((o-1+h)/7);if(7-h>=l&&++p,p==0)p=function(y,D,T,C){let N=(C-y-T+1)%7;N<0&&(N+=7);let $=Math.floor((T+N-1)/7);return 7-N>=D&&++$,$}(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&&(p=1,r++)}return{week:p,year:r}}function Cl(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 Qi={};function yr(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 gn(n,t=!1){return`M${`${n}`.padStart(2,"0")}${t?"L":""}`}function Gs(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"&&Ke(r,1,e),t==="constrain"&&(r=Mt(r,1,e)),i=gn(r)}else{let o=yr(i);if(i!==gn(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}}Qi.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,Gs(n))},dateToISO:(n,t)=>wi(n.year,n.month,n.day,t),monthDayToISOReferenceDate(n,t){let{month:e,day:r}=wi(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 _u(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}=lr(a,s),{year:a,month:s,day:l}=wi(a,s,l,o),l+=i+7*r,Ht(a,s,l)},dateUntil(n,t,e){let r=-bn(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 h=t.year-n.year;for(h!==0&&(h-=r);!Cl(r,n.year+h,n.month,n.day,t);)o=h,h+=r;let p=r;for(i=lr(n.year+o,n.month+p);!Cl(r,i.year,i.month,n.day,t);)a=p,p+=r,i=lr(i.year,i.month+r);e==="month"&&(a+=12*o,o=0)}i=lr(n.year+o,n.month+a);let s=pu(i.year,i.month,n.day),l=0,u=fr(t.year,t.month-1,t.day)-fr(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=gn(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+=dr(n,a);i.dayOfYear=o}return r.weekOfYear&&(i.weekOfYear=Mu("iso8601",{year:n,month:t,day:e})),r.daysInMonth&&(i.daysInMonth=dr(n,t)),(r.daysInYear||r.inLeapYear)&&(i.inLeapYear=Ao(n),i.daysInYear=i.inLeapYear?366:365),i},getFirstDayOfWeek:()=>1,getMinimalDaysInFirstWeek:()=>4};var Vt=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 Tu({isoYear:n,isoMonth:t,isoDay:e}){return`${Xi(n)}-${Zt(t)}-${Zt(e)}T00:00Z`}function Za(n,t){return{years:n.year-t.year,months:n.month-t.month,days:n.day-t.day}}Vt.objectMap=new WeakMap,Vt.MAX_CACHE_ENTRIES=1e3;var Ln=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=Tu({isoYear:r,isoMonth:i,isoDay:o}),u=this.getCalendarParts(l),h={};for(let y=0;y<u.length;y++){let{type:D,value:T}=u[y];if(D!=="year"&&D!=="relatedYear"||(this.hasEra?h.eraYear=+T:h.year=+T),D==="month"){let C=/^([0-9]*)(.*?)$/.exec(T);if(!C||C.length!=3||!C[1]&&!C[2])throw new RangeError(`Unexpected month: ${T}`);if(h.month=C[1]?+C[1]:1,h.month<1)throw new RangeError(`Invalid month ${T} from ${l}[u-ca-${this.id}] (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10527)`);if(h.month>13)throw new RangeError(`Invalid month ${T} from ${l}[u-ca-${this.id}] (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10529)`);C[2]&&(h.monthExtra=C[2])}D==="day"&&(h.day=+T),this.hasEra&&D==="era"&&T!=null&&T!==""&&(h.era=T.split(" (")[0].normalize("NFD").replace(/[^-0-9 \p{L}]/gu,"").replace(/ /g,"-").toLowerCase())}if(this.hasEra&&h.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(D=>h.era===D.genericName);y&&(h.era=y.code)}if(this.reviseIntlEra){let{era:y,eraYear:D}=this.reviseIntlEra(h,t);h.era=y,h.eraYear=D}this.checkIcuBugs&&this.checkIcuBugs(t);let p=this.adjustCalendarDate(h,e,"constrain",!0);if(p.year===void 0)throw new RangeError(`Missing year converting ${JSON.stringify(t)}`);if(p.month===void 0)throw new RangeError(`Missing month converting ${JSON.stringify(t)}`);if(p.day===void 0)throw new RangeError(`Missing day converting ${JSON.stringify(t)}`);return e.set(a,p),["constrain","reject"].forEach(y=>{let D=JSON.stringify({func:"calendarToIsoDate",year:p.year,month:p.month,day:p.day,overflow:y,id:this.id});e.set(D,t)}),p}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}=Gs(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"?(Ke(o,1,i),Ke(a,1,this.maximumMonthLength(t))):(o=Mt(o,1,i),a=Mt(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}),h,p=r.get(u);if(p||i.year!==void 0&&i.month!==void 0&&i.day!==void 0&&(i.year!==o.year||i.month!==o.month||i.day!==o.day)&&(h=JSON.stringify({func:"calendarToIsoDate",year:i.year,month:i.month,day:i.day,overflow:e,id:this.id}),p=r.get(h),p))return p;let y=this.estimateIsoDate({year:a,month:s,day:l}),D=G=>{let W=this.addDaysIso(y,G);if(o.day>this.minimumMonthLength(o)){let ne=this.isoToCalendarDate(W,r);for(;ne.month!==s||ne.year!==a;){if(e==="reject")throw new RangeError(`day ${l} does not exist in month ${s} of year ${a}`);W=this.addDaysIso(W,-1),ne=this.isoToCalendarDate(W,r)}}return W},T=0,C=this.isoToCalendarDate(y,r),N=Za(o,C);if(N.years!==0||N.months!==0||N.days!==0){let G=365*N.years+30*N.months+N.days;y=this.addDaysIso(y,G),C=this.isoToCalendarDate(y,r),N=Za(o,C),N.years===0&&N.months===0?y=D(N.days):T=this.compareCalendarDates(o,C)}let $=8;for(;T;){y=this.addDaysIso(y,T*$);let G=C;C=this.isoToCalendarDate(y,r);let W=T;if(T=this.compareCalendarDates(o,C),T){if(N=Za(o,C),N.years===0&&N.months===0)y=D(N.days),T=0;else if(W&&T!==W)if($>1)$/=2;else{if(e==="reject")throw new RangeError(`Can't find ISO date from calendar date: ${JSON.stringify({...i})}`);this.compareCalendarDates(C,G)>0&&(y=this.addDaysIso(y,-1)),T=0}}}if(r.set(u,y),h&&r.set(h,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?Nt(t.year-e.year):t.month!==e.month?Nt(t.month-e.month):t.day!==e.day?Nt(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 Ht(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,h=o,p=e<0?-Math.max(a,this.daysInPreviousMonth(o,i)):this.daysInMonth(o,i),y=this.calendarToIsoDate(o,"constrain",i),D=this.addDaysIso(y,p);if(o=this.isoToCalendarDate(D,i),e>0){let T=this.monthsInYear(h,i);for(;o.month-1!=u%T;)D=this.addDaysIso(D,-1),o=this.isoToCalendarDate(D,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:h}=t,p=this.adjustCalendarDate({year:l+e,monthCode:h,day:u},s),y=this.addMonthsCalendar(p,r,a,s),D=o+7*i;return this.addDaysCalendar(y,D,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 h=e.year-t.year,p=e.day-t.day;if(r==="year"&&h){let T=0;e.monthCode>t.monthCode&&(T=1),e.monthCode<t.monthCode&&(T=-1),T||(T=Math.sign(p)),l=T*u<0?h-u:h}let y,D=l?this.addCalendar(t,{years:l},"constrain",i):t;do s+=u,y=D,D=this.addMonthsCalendar(y,u,"constrain",i),D.day!==t.day&&(D=this.regulateDate({...D,day:t.day},"constrain",i));while(this.compareCalendarDates(e,D)*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),h=this.addDaysIso(l,-u.day);return this.isoToCalendarDate(h,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 h=this.calendarToIsoDate(t,"constrain",e),p=this.addDaysIso(h,-r);return this.isoToCalendarDate(p,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 fr(o.year,o.month-1,o.day)-fr(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:h,year:p,month:y,monthCode:D,day:T}=t;if(y!==void 0&&p===void 0&&(!this.hasEra||u===void 0||h===void 0))throw new TypeError("when month is present, year (or era and eraYear) are required");(D===void 0||p!==void 0||this.hasEra&&h!==void 0)&&({monthCode:D,day:T}=this.isoToCalendarDate(this.calendarToIsoDate(t,e,r),r));let C={year:this.monthDaySearchStartYear(D,T),month:12,day:31},N=this.isoToCalendarDate(C,r),$=N.monthCode>D||N.monthCode===D&&N.day>=T?N.year:N.year-1;for(let G=0;G<20;G++){let W=this.adjustCalendarDate({day:T,monthCode:D,year:$-G},r),ne=this.calendarToIsoDate(W,"constrain",r),le=this.isoToCalendarDate(ne,r);if({year:i,month:o,day:a}=ne,le.monthCode===D&&le.day===T)return{month:o,day:a,year:i};if(e==="constrain"){let oe=this.maxLengthOfMonthCodeInAnyYear(le.monthCode);if(le.monthCode===D&&le.day===oe&&T>oe)return{month:o,day:a,year:i};(s===void 0||le.monthCode===s.monthCode&&le.day>s.day)&&(s=le,l=ne)}}if(e==="constrain"&&l!==void 0)return l;throw new RangeError(`No recent ${this.id} year with monthCode ${D} and day ${T}`)}getFirstDayOfWeek(){}getMinimalDaysInFirstWeek(){}},vs=class extends Ln{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?gn(5,!0):gn(e<6?e:e-1):gn(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 h=this.months[u];if(!h)throw new RangeError(`Unrecognized month from formatToParts: ${u}`);a=this.inLeapYear({year:o})?h.leap:h.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=yr(s),this.inLeapYear({year:o})&&a>=6&&a++;let h=this.monthsInYear({year:o});if(a<1||a>h)throw new RangeError(`Invalid monthCode: ${s}`)}else if(r==="reject"?(Ke(a,1,this.monthsInYear({year:o})),Ke(l,1,this.maximumMonthLength({year:o,month:a}))):(a=Mt(a,1,this.monthsInYear({year:o})),l=Mt(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}}},Zn=class extends Ln{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}}},bs=class extends Zn{constructor(){super(...arguments),this.id="islamic"}},ws=class extends Zn{constructor(){super(...arguments),this.id="islamic-umalqura"}},Ds=class extends Zn{constructor(){super(...arguments),this.id="islamic-tbla"}},Es=class extends Zn{constructor(){super(...arguments),this.id="islamic-civil"}},_s=class extends Zn{constructor(){super(...arguments),this.id="islamic-rgsa"}},Ms=class extends Zn{constructor(){super(...arguments),this.id="islamicc"}},Ts=class extends Ln{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 yr(t)<=6?31:30}estimateIsoDate(t){let{year:e}=this.adjustCalendarDate(t);return{year:e+621,month:1,day:1}}},Ss=class extends Ln{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 Ks(t.year+78)}monthsInYear(){return 12}minimumMonthLength(t){return this.getMonthInfo(t).length}maximumMonthLength(t){return this.getMonthInfo(t).length}maxLengthOfMonthCodeInAnyYear(t){let e=yr(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 Ht(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 Ks(n){return n%4==0&&(n%100!=0||n%400==0)}var Ho=class extends Ln{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 Ks(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][yr(t)-1]}estimateIsoDate(t){let e=this.adjustCalendarDate(t);return wi(e.year+this.isoEpoch.year,e.month+this.isoEpoch.month,e.day+this.isoEpoch.day,"constrain")}},Bo=class extends Ln{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:h}=u;if(h){let p=s.find(y=>y.code===h);if(p===void 0)throw new RangeError(`Invalid era data: unmatched reverseOf era: ${h}`);u.reverseOf=p,u.anchorEpoch=p.anchorEpoch,u.isoEpoch=p.isoEpoch}u.anchorEpoch.month===void 0&&(u.anchorEpoch.month=1),u.anchorEpoch.day===void 0&&(u.anchorEpoch.day=1)}),s.sort((u,h)=>{if(u.reverseOf)return 1;if(h.reverseOf)return-1;if(!u.isoEpoch||!h.isoEpoch)throw new RangeError("Invalid era data: missing ISO epoch");return h.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,h)=>{u.genericName="era"+(s.length-1-h)}),{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 Ks(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][yr(t)-1]}completeEraYear(t){let e=(s,l,u)=>{let h=t[s];if(h!=null&&h!=l&&!(u||[]).includes(h)){let p=u?.[0];throw new RangeError(`Input ${s} ${h} doesn't match calculated value ${p?`${l} (also called ${p})`:l}`)}},r=s=>{let l,u={...t,year:s},h=this.eras.find((p,y)=>{if(y===this.eras.length-1){if(p.reverseOf){if(s>0)throw new RangeError(`Signed year ${s} is invalid for era ${p.code}`);return l=p.anchorEpoch.year-s,!0}return l=s-p.anchorEpoch.year+(p.hasYearZero?0:1),!0}return this.compareCalendarDates(u,p.anchorEpoch)>=0&&(l=s-p.anchorEpoch.year+(p.hasYearZero?0:1),!0)});if(!h)throw new RangeError(`Year ${s} was not matched by any era`);return{eraYear:l,era:h.code,eraNames:h.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:yr(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 wi(r+a.isoEpoch.year-(a.hasYearZero?0:1),i,o,"constrain")}},Ii=class extends Bo{constructor(t,e){super(t,e)}isoToCalendarDate(t){let{year:e,month:r,day:i}=t,o=gn(r),a=e-this.anchorEra.isoEpoch.year+1;return this.completeEraYear({year:a,month:r,monthCode:o,day:i})}},pn={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},Cs=class extends Ho{constructor(t,e){super(t,e),this.inLeapYear=pn.inLeapYear,this.monthsInYear=pn.monthsInYear,this.minimumMonthLength=pn.minimumMonthLength,this.maximumMonthLength=pn.maximumMonthLength,this.maxLengthOfMonthCodeInAnyYear=pn.maxLengthOfMonthCodeInAnyYear}},Fo=class extends Bo{constructor(t,e){super(t,e),this.inLeapYear=pn.inLeapYear,this.monthsInYear=pn.monthsInYear,this.minimumMonthLength=pn.minimumMonthLength,this.maximumMonthLength=pn.maximumMonthLength,this.maxLengthOfMonthCodeInAnyYear=pn.maxLengthOfMonthCodeInAnyYear}},ks=class extends Cs{constructor(){super("ethioaa",{year:-5492,month:7,day:17})}},Ps=class extends Fo{constructor(){super("coptic",[{code:"coptic",isoEpoch:{year:284,month:8,day:29}},{code:"coptic-inverse",reverseOf:"coptic"}])}},Rs=class extends Fo{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}}])}},Is=class extends Ii{constructor(){super("roc",[{code:"roc",names:["minguo"],isoEpoch:{year:1912,month:1,day:1}},{code:"roc-inverse",names:["before-roc"],reverseOf:"roc"}])}},xs=class extends Ho{constructor(){super("buddhist",{year:-543,month:1,day:1})}},As=class extends Ii{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}},Ls=class extends Ii{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}}},Yo=class extends Ln{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=(N,$)=>{let G=Tu({isoYear:N,isoMonth:2,isoDay:1}),W=new Date(G);W.setUTCDate($+1);let ne=o.formatToParts(W),le=ne.find(se=>se.type==="month").value,oe=+ne.find(se=>se.type==="day").value,Ce=ne.find(se=>se.type==="relatedYear"),Te;if(Ce===void 0)throw new RangeError(`Intl.DateTimeFormat.formatToParts lacks relatedYear in ${this.id} calendar. Try Node 14+ or modern browsers.`);return Te=+Ce.value,{calendarMonthString:le,calendarDay:oe,calendarYearToVerify:Te}},s=17,{calendarMonthString:l,calendarDay:u,calendarYearToVerify:h}=a(t,s);l!=="1"&&(s+=29,{calendarMonthString:l,calendarDay:u}=a(t,s)),s-=u-5;let p={},y,D,T=1,C=!1;do({calendarMonthString:l,calendarDay:u,calendarYearToVerify:h}=a(t,s)),y&&(p[D].daysInMonth=y+30-u),h!==t?C=!0:(p[l]={monthIndex:T++},s+=30),y=u,D=l;while(!C);return p[D].daysInMonth=y+30-u,e.set(r,p),p}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 h=gn(a,s!==void 0),p=`${a}${s||""}`,y=this.getMonthList(o,e)[p];if(y===void 0)throw new RangeError(`Unmatched month ${p} in Chinese year ${o}`);return a=y.monthIndex,{year:o,month:a,day:l,monthCode:h}}if(this.validateCalendarDate(t),a===void 0){let h=this.getMonthList(o,e),p=u.replace(/^M|L$/g,D=>D==="L"?"bis":"");p[0]==="0"&&(p=p.slice(1));let y=h[p];if(a=y&&y.monthIndex,a===void 0&&u.endsWith("L")&&u!="M13L"&&r==="constrain"){let D=+u.replace(/^M0?|L$/g,"");y=h[D],y&&(a=y.monthIndex,u=gn(D))}if(a===void 0)throw new RangeError(`Unmatched month ${u} in Chinese year ${o}`)}else if(u===void 0){let h=this.getMonthList(o,e),p=Object.entries(h),y=p.length;r==="reject"?(Ke(a,1,y),Ke(l,1,this.maximumMonthLength())):(a=Mt(a,1,y),l=Mt(l,1,this.maximumMonthLength()));let D=p.find(T=>T[1].monthIndex===a);if(D===void 0)throw new RangeError(`Invalid month ${a} in Chinese year ${o}`);u=gn(+D[0].replace("bis",""),D[0].indexOf("bis")!==-1)}else{let h=this.getMonthList(o,e),p=u.replace(/^M|L$/g,D=>D==="L"?"bis":"");p[0]==="0"&&(p=p.slice(1));let y=h[p];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}}},Ns=class extends Yo{constructor(){super(...arguments),this.id="chinese"}},Os=class extends Yo{constructor(){super(...arguments),this.id="dangi"}},Hs=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 Vt;Gs(t,void 0,this.helper.monthsInYear({year:t.year??1972},e))}}dateToISO(t,e){let r=new Vt,i=this.helper.calendarToIsoDate(t,e,r);return r.setObject(i),i}monthDayToISOReferenceDate(t,e){let r=new Vt,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 _u(e)}dateAdd(t,{years:e,months:r,weeks:i,days:o},a){let s=Vt.getCacheForObject(t),l=this.helper.isoToCalendarDate(t,s),u=this.helper.addCalendar(l,{years:e,months:r,weeks:i,days:o},a,s),h=this.helper.calendarToIsoDate(u,"constrain",s);return Vt.getCacheForObject(h)||new Vt(s).setObject(h),h}dateUntil(t,e,r){let i=Vt.getCacheForObject(t),o=Vt.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=Vt.getCacheForObject(t),i=this.helper.isoToCalendarDate(t,r);if(e.dayOfWeek&&(i.dayOfWeek=Qi.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=Mu(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[vs,Ts,Rs,ks,Ps,Ns,Os,Is,Ss,xs,As,Ls,bs,ws,Ds,Es,_s,Ms]){let t=new n;Qi[t.id]=new Hs(t)}rs("calendarImpl",function(n){return Qi[n]});var xi=Intl.DateTimeFormat;function Sr(n,t){let e=m(n,t);return typeof e=="function"&&(e=new xi(m(n,Yl),e(m(n,Qa))),function(r,i,o){let a=jo(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 ci(n){return kt(n,br)}var vr=class{constructor(t=void 0,e=void 0){(function(r,i,o){let a=o!==void 0,s;if(a){let p=["localeMatcher","calendar","numberingSystem","hour12","hourCycle","timeZone","weekday","era","year","month","day","dayPeriod","hour","minute","second","fractionalSecondDigits","timeZoneName","formatMatcher","dateStyle","timeStyle"];s=function(D){if(D==null)throw new TypeError(`Expected object not ${D}`);return Object(D)}(o);let y=Object.create(null);for(let D=0;D<p.length;D++){let T=p[D];Object.prototype.hasOwnProperty.call(s,T)&&(y[T]=s[T])}s=y}else s=Object.create(null);let l=new xi(i,s),u=l.resolvedOptions();if(Nn(r),a){let p=Object.assign(Object.create(null),u);for(let y in p)Object.prototype.hasOwnProperty.call(s,y)||delete p[y];p.hour12=s.hour12,p.hourCycle=s.hourCycle,ve(r,Qa,p)}else ve(r,Qa,s);ve(r,Yl,u.locale),ve(r,br,l),ve(r,Pr,u.timeZone),ve(r,ui,u.calendar),ve(r,Ll,Zh),ve(r,Nl,Gh),ve(r,Ol,Kh),ve(r,Hl,Wh),ve(r,Bl,Jh),ve(r,Fl,Xh);let h=a?s.timeZone:void 0;if(h===void 0)ve(r,Xa,u.timeZone);else{let p=qo(h);if(p.startsWith("\u2212"))throw new RangeError("Unicode minus (U+2212) is not supported in time zone offsets");ve(r,Xa,St(p))}})(this,t,e)}get format(){I(this,ci);let t=zh.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 I(this,ci),Vh.call(this,t,e)}formatToParts(t,...e){return I(this,ci),Uh.call(this,t,...e)}formatRangeToParts(t,e){return I(this,ci),qh.call(this,t,e)}resolvedOptions(){return I(this,ci),jh.call(this)}};"formatToParts"in xi.prototype||delete vr.prototype.formatToParts,"formatRangeToParts"in xi.prototype||delete vr.prototype.formatRangeToParts;var Gt=function(n=void 0,t=void 0){return new vr(n,t)};function jh(){let n=m(this,br).resolvedOptions();return n.timeZone=m(this,Xa),n}function zh(n,...t){let e,r,i=$r(n,this);return i.formatter?(e=i.formatter,r=[on(i.epochNs,"floor")]):(e=m(this,br),r=[n,...t]),e.format(...r)}function Uh(n,...t){let e,r,i=$r(n,this);return i.formatter?(e=i.formatter,r=[on(i.epochNs,"floor")]):(e=m(this,br),r=[n,...t]),e.formatToParts(...r)}function Vh(n,t){if(n===void 0||t===void 0)throw new TypeError("Intl.DateTimeFormat.formatRange requires two values");let e=$o(n),r=$o(t),i,o=[e,r];if(xn(e)!==xn(r))throw new TypeError("Intl.DateTimeFormat.formatRange accepts two values of the same type");if(xn(e)){if(!Su(e,r))throw new TypeError("Intl.DateTimeFormat.formatRange accepts two values of the same type");let{epochNs:a,formatter:s}=$r(e,this),{epochNs:l,formatter:u}=$r(r,this);s&&(i=s,o=[on(a,"floor"),on(l,"floor")])}return i||(i=m(this,br)),i.formatRange(...o)}function qh(n,t){if(n===void 0||t===void 0)throw new TypeError("Intl.DateTimeFormat.formatRange requires two values");let e=$o(n),r=$o(t),i,o=[e,r];if(xn(e)!==xn(r))throw new TypeError("Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type");if(xn(e)){if(!Su(e,r))throw new TypeError("Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type");let{epochNs:a,formatter:s}=$r(e,this),{epochNs:l,formatter:u}=$r(r,this);s&&(i=s,o=[on(a,"floor"),on(l,"floor")])}return i||(i=m(this,br)),i.formatRangeToParts(...o)}function eo(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 Wh(n){let t=eo(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"})),!ta(t)){if(to(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 Gh(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=eo(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(to(n))throw new TypeError(`cannot format PlainYearMonth with options [${Object.keys(n)}]`);Object.assign(e,{year:"numeric",month:"numeric"})}return e}function Kh(n){let t={short:{month:"numeric",day:"numeric"},medium:{month:"short",day:"numeric"},long:{month:"long",day:"numeric"},full:{month:"long",day:"numeric"}},e=eo(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(to(n))throw new TypeError(`cannot format PlainMonthDay with options [${Object.keys(n)}]`);Object.assign(e,{month:"numeric",day:"numeric"})}return e}function Zh(n){let t=eo(n,{hour:!1,minute:!1,second:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if(!ea(t)){if(to(n))throw new TypeError(`cannot format PlainDate with options [${Object.keys(n)}]`);Object.assign(t,{year:"numeric",month:"numeric",day:"numeric"})}return t}function Jh(n){let t=eo(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),!ta(t)&&!ea(t)){if(to(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 Xh(n){let t=n;return ta(t)||ea(t)||(t=Object.assign({},t,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})),t}function ea(n){return"year"in n||"month"in n||"day"in n||"weekday"in n||"dateStyle"in n||"era"in n}function ta(n){return"hour"in n||"minute"in n||"second"in n||"timeStyle"in n||"dayPeriod"in n||"fractionalSecondDigits"in n}function to(n){return ea(n)||ta(n)||"dateStyle"in n||"timeStyle"in n||"timeZoneName"in n}function xn(n){return $e(n)||Ue(n)||Le(n)||be(n)||tt(n)||qt(n)||et(n)}function $o(n){return xn(n)?n:Vo(n)}function Su(n,t){return!(!xn(n)||!xn(t)||Ue(n)&&!Ue(t)||$e(n)&&!$e(t)||Le(n)&&!Le(t)||be(n)&&!be(t)||tt(n)&&!tt(t)||qt(n)&&!qt(t)||et(n)&&!et(t))}function $r(n,t){if(Ue(n)){let e={isoDate:{year:1970,month:1,day:1},time:m(n,je)};return{epochNs:ct(m(t,Pr),e,"compatible"),formatter:Sr(t,Hl)}}if(tt(n)){let e=m(n,U),r=m(t,ui);if(e!==r)throw new RangeError(`cannot format PlainYearMonth with calendar ${e} in locale with calendar ${r}`);let i=Me(m(n,me),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:ct(m(t,Pr),i,"compatible"),formatter:Sr(t,Nl)}}if(qt(n)){let e=m(n,U),r=m(t,ui);if(e!==r)throw new RangeError(`cannot format PlainMonthDay with calendar ${e} in locale with calendar ${r}`);let i=Me(m(n,me),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:ct(m(t,Pr),i,"compatible"),formatter:Sr(t,Ol)}}if($e(n)){let e=m(n,U),r=m(t,ui);if(e!=="iso8601"&&e!==r)throw new RangeError(`cannot format PlainDate with calendar ${e} in locale with calendar ${r}`);let i=Me(m(n,me),{deltaDays:0,hour:12,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});return{epochNs:ct(m(t,Pr),i,"compatible"),formatter:Sr(t,Ll)}}if(Le(n)){let e=m(n,U),r=m(t,ui);if(e!=="iso8601"&&e!==r)throw new RangeError(`cannot format PlainDateTime with calendar ${e} in locale with calendar ${r}`);let i=m(n,He);return{epochNs:ct(m(t,Pr),i,"compatible"),formatter:Sr(t,Bl)}}if(be(n))throw new TypeError("Temporal.ZonedDateTime not supported in DateTimeFormat methods. Use toLocaleString() instead.");return et(n)?{epochNs:m(n,he),formatter:Sr(t,Fl)}:{}}function Cu(n){let t=Object.create(null);return t.years=m(n,gt),t.months=m(n,yt),t.weeks=m(n,At),t.days=m(n,vt),t.hours=m(n,bt),t.minutes=m(n,wt),t.seconds=m(n,Dt),t.milliseconds=m(n,Et),t.microseconds=m(n,_t),t.nanoseconds=m(n,Lt),t}vr.prototype.constructor=Gt,Object.defineProperty(Gt,"prototype",{value:vr.prototype,writable:!1,enumerable:!1,configurable:!1}),Gt.supportedLocalesOf=xi.supportedLocalesOf,On(Gt,"Intl.DateTimeFormat");var{format:Qh,formatToParts:em}=Intl.DurationFormat?.prototype??Object.create(null);function Zs(n){Intl.DurationFormat.prototype.resolvedOptions.call(this);let t=Cu(nn(n));return Qh.call(this,t)}Intl.DurationFormat?.prototype&&(Intl.DurationFormat.prototype.format=Zs,Intl.DurationFormat.prototype.formatToParts=function(n){Intl.DurationFormat.prototype.resolvedOptions.call(this);let t=Cu(nn(n));return em.call(this,t)});var Jm=Object.freeze({__proto__:null,DateTimeFormat:Gt,ModifiedIntlDurationFormatPrototypeFormat:Zs}),Ai=class{constructor(t){if(arguments.length<1)throw new TypeError("missing argument: epochNanoseconds is required");ou(this,Oo(t))}get epochMilliseconds(){return I(this,et),on(m(this,he),"floor")}get epochNanoseconds(){return I(this,et),Du(k.default.BigInt(m(this,he)))}add(t){return I(this,et),Dl("add",this,t)}subtract(t){return I(this,et),Dl("subtract",this,t)}until(t,e=void 0){return I(this,et),pl("until",this,t,e)}since(t,e=void 0){return I(this,et),pl("since",this,t,e)}round(t){if(I(this,et),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?gr("smallestUnit",t):ie(t),r=zr(e),i=ln(e,"halfExpand"),o=Ot(e,"smallestUnit","time",An);return Ur(r,{hour:24,minute:1440,second:86400,millisecond:864e5,microsecond:864e8,nanosecond:864e11}[o],!0),sn(ms(m(this,he),r,o,i))}equals(t){I(this,et);let e=mi(t),r=m(this,he),i=m(e,he);return k.default.equal(k.default.BigInt(r),k.default.BigInt(i))}toString(t=void 0){I(this,et);let e=ie(t),r=Vi(e),i=ln(e,"trunc"),o=Ot(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=St(a));let{precision:s,unit:l,increment:u}=qi(o,r);return ol(sn(ms(m(this,he),u,l,i)),a,s)}toJSON(){return I(this,et),ol(this,void 0,"auto")}toLocaleString(t=void 0,e=void 0){return I(this,et),new Gt(t,e).format(this)}valueOf(){Xn("Instant")}toZonedDateTimeISO(t){I(this,et);let e=St(t);return at(m(this,he),e,"iso8601")}static fromEpochMilliseconds(t){return sn(cn(Vo(t)))}static fromEpochNanoseconds(t){return sn(Oo(t))}static from(t){return mi(t)}static compare(t,e){let r=mi(t),i=mi(e),o=m(r,he),a=m(i,he);return k.default.lessThan(o,a)?-1:k.default.greaterThan(o,a)?1:0}};On(Ai,"Temporal.Instant");var Li=class{constructor(t,e,r,i="iso8601"){let o=fe(t),a=fe(e),s=fe(r),l=Pt(i===void 0?"iso8601":Ge(i));mr(o,a,s),eu(this,{year:o,month:a,day:s},l)}get calendarId(){return I(this,$e),m(this,U)}get era(){return mt(this,"era")}get eraYear(){return mt(this,"eraYear")}get year(){return mt(this,"year")}get month(){return mt(this,"month")}get monthCode(){return mt(this,"monthCode")}get day(){return mt(this,"day")}get dayOfWeek(){return mt(this,"dayOfWeek")}get dayOfYear(){return mt(this,"dayOfYear")}get weekOfYear(){return mt(this,"weekOfYear")?.week}get yearOfWeek(){return mt(this,"weekOfYear")?.year}get daysInWeek(){return mt(this,"daysInWeek")}get daysInMonth(){return mt(this,"daysInMonth")}get daysInYear(){return mt(this,"daysInYear")}get monthsInYear(){return mt(this,"monthsInYear")}get inLeapYear(){return mt(this,"inLeapYear")}with(t,e=void 0){if(I(this,$e),!ze(t))throw new TypeError("invalid argument");jr(t);let r=m(this,U),i=Ct(r,m(this,me));return i=hr(r,i,Jt(r,t,["year","month","monthCode","day"],[],"partial")),Tt(Kn(r,i,Ee(ie(e))),r)}withCalendar(t){I(this,$e);let e=Zi(t);return Tt(m(this,me),e)}add(t,e=void 0){return I(this,$e),El("add",this,t,e)}subtract(t,e=void 0){return I(this,$e),El("subtract",this,t,e)}until(t,e=void 0){return I(this,$e),fl("until",this,t,e)}since(t,e=void 0){return I(this,$e),fl("since",this,t,e)}equals(t){I(this,$e);let e=di(t);return bn(m(this,me),m(e,me))===0&&yn(m(this,U),m(e,U))}toString(t=void 0){return I(this,$e),al(this,Ui(ie(t)))}toJSON(){return I(this,$e),al(this)}toLocaleString(t=void 0,e=void 0){return I(this,$e),new Gt(t,e).format(this)}valueOf(){Xn("PlainDate")}toPlainDateTime(t=void 0){I(this,$e);let e=Ql(t);return en(Me(m(this,me),e),m(this,U))}toZonedDateTime(t){let e,r;if(I(this,$e),ze(t)){let a=t.timeZone;a===void 0?e=St(t):(e=St(a),r=t.plainTime)}else e=St(t);let i=m(this,me),o;return r===void 0?o=jn(e,i):(r=Un(r),o=ct(e,Me(i,m(r,je)),"compatible")),at(o,e,m(this,U))}toPlainYearMonth(){I(this,$e);let t=m(this,U);return Ar(Si(t,Ct(t,m(this,me)),"constrain"),t)}toPlainMonthDay(){I(this,$e);let t=m(this,U);return xr(Io(t,Ct(t,m(this,me)),"constrain"),t)}static from(t,e=void 0){return di(t,e)}static compare(t,e){let r=di(t),i=di(e);return bn(m(r,me),m(i,me))}};function mt(n,t){I(n,$e);let e=m(n,me);return Wi(n).isoToDate(e,{[t]:!0})[t]}On(Li,"Temporal.PlainDate");var Ni=class{constructor(t,e,r,i=0,o=0,a=0,s=0,l=0,u=0,h="iso8601"){let p=fe(t),y=fe(e),D=fe(r),T=i===void 0?0:fe(i),C=o===void 0?0:fe(o),N=a===void 0?0:fe(a),$=s===void 0?0:fe(s),G=l===void 0?0:fe(l),W=u===void 0?0:fe(u),ne=Pt(h===void 0?"iso8601":Ge(h));Us(p,y,D,T,C,N,$,G,W),tu(this,{isoDate:{year:p,month:y,day:D},time:{hour:T,minute:C,second:N,millisecond:$,microsecond:G,nanosecond:W}},ne)}get calendarId(){return I(this,Le),m(this,U)}get year(){return pt(this,"year")}get month(){return pt(this,"month")}get monthCode(){return pt(this,"monthCode")}get day(){return pt(this,"day")}get hour(){return Cr(this,"hour")}get minute(){return Cr(this,"minute")}get second(){return Cr(this,"second")}get millisecond(){return Cr(this,"millisecond")}get microsecond(){return Cr(this,"microsecond")}get nanosecond(){return Cr(this,"nanosecond")}get era(){return pt(this,"era")}get eraYear(){return pt(this,"eraYear")}get dayOfWeek(){return pt(this,"dayOfWeek")}get dayOfYear(){return pt(this,"dayOfYear")}get weekOfYear(){return pt(this,"weekOfYear")?.week}get yearOfWeek(){return pt(this,"weekOfYear")?.year}get daysInWeek(){return pt(this,"daysInWeek")}get daysInYear(){return pt(this,"daysInYear")}get daysInMonth(){return pt(this,"daysInMonth")}get monthsInYear(){return pt(this,"monthsInYear")}get inLeapYear(){return pt(this,"inLeapYear")}with(t,e=void 0){if(I(this,Le),!ze(t))throw new TypeError("invalid argument");jr(t);let r=m(this,U),i=m(this,He),o={...Ct(r,i.isoDate),...i.time};return o=hr(r,o,Jt(r,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond"],"partial")),en(Gi(r,o,Ee(ie(e))),r)}withPlainTime(t=void 0){I(this,Le);let e=Ql(t);return en(Me(m(this,He).isoDate,e),m(this,U))}withCalendar(t){I(this,Le);let e=Zi(t);return en(m(this,He),e)}add(t,e=void 0){return I(this,Le),_l("add",this,t,e)}subtract(t,e=void 0){return I(this,Le),_l("subtract",this,t,e)}until(t,e=void 0){return I(this,Le),gl("until",this,t,e)}since(t,e=void 0){return I(this,Le),gl("since",this,t,e)}round(t){if(I(this,Le),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?gr("smallestUnit",t):ie(t),r=zr(e),i=ln(e,"halfExpand"),o=Ot(e,"smallestUnit","time",An,["day"]),a={day:1,hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o];Ur(r,a,a===1);let s=m(this,He);return en(r===1&&o==="nanosecond"?s:ps(s,r,o,i),m(this,U))}equals(t){I(this,Le);let e=hi(t);return Yr(m(this,He),m(e,He))===0&&yn(m(this,U),m(e,U))}toString(t=void 0){I(this,Le);let e=ie(t),r=Ui(e),i=Vi(e),o=ln(e,"trunc"),a=Ot(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}=qi(a,i),h=ps(m(this,He),u,l,o);return pr(h),ki(h,m(this,U),s,r)}toJSON(){return I(this,Le),ki(m(this,He),m(this,U),"auto")}toLocaleString(t=void 0,e=void 0){return I(this,Le),new Gt(t,e).format(this)}valueOf(){Xn("PlainDateTime")}toZonedDateTime(t,e=void 0){I(this,Le);let r=St(t),i=Di(ie(e));return at(ct(r,m(this,He),i),r,m(this,U))}toPlainDate(){return I(this,Le),Tt(m(this,He).isoDate,m(this,U))}toPlainTime(){return I(this,Le),Cn(m(this,He).time)}static from(t,e=void 0){return hi(t,e)}static compare(t,e){let r=hi(t),i=hi(e);return Yr(m(r,He),m(i,He))}};function pt(n,t){I(n,Le);let e=m(n,He).isoDate;return Wi(n).isoToDate(e,{[t]:!0})[t]}function Cr(n,t){return I(n,Le),m(n,He).time[t]}On(Ni,"Temporal.PlainDateTime");var Oi=class n{constructor(t=0,e=0,r=0,i=0,o=0,a=0,s=0,l=0,u=0,h=0){let p=t===void 0?0:an(t),y=e===void 0?0:an(e),D=r===void 0?0:an(r),T=i===void 0?0:an(i),C=o===void 0?0:an(o),N=a===void 0?0:an(a),$=s===void 0?0:an(s),G=l===void 0?0:an(l),W=u===void 0?0:an(u),ne=h===void 0?0:an(h);Xo(p,y,D,T,C,N,$,G,W,ne),Nn(this),ve(this,gt,p),ve(this,yt,y),ve(this,At,D),ve(this,vt,T),ve(this,bt,C),ve(this,wt,N),ve(this,Dt,$),ve(this,Et,G),ve(this,_t,W),ve(this,Lt,ne)}get years(){return I(this,Ye),m(this,gt)}get months(){return I(this,Ye),m(this,yt)}get weeks(){return I(this,Ye),m(this,At)}get days(){return I(this,Ye),m(this,vt)}get hours(){return I(this,Ye),m(this,bt)}get minutes(){return I(this,Ye),m(this,wt)}get seconds(){return I(this,Ye),m(this,Dt)}get milliseconds(){return I(this,Ye),m(this,Et)}get microseconds(){return I(this,Ye),m(this,_t)}get nanoseconds(){return I(this,Ye),m(this,Lt)}get sign(){return I(this,Ye),Lo(this)}get blank(){return I(this,Ye),Lo(this)===0}with(t){I(this,Ye);let e=Xl(t),{years:r=m(this,gt),months:i=m(this,yt),weeks:o=m(this,At),days:a=m(this,vt),hours:s=m(this,bt),minutes:l=m(this,wt),seconds:u=m(this,Dt),milliseconds:h=m(this,Et),microseconds:p=m(this,_t),nanoseconds:y=m(this,Lt)}=e;return new n(r,i,o,a,s,l,u,h,p,y)}negated(){return I(this,Ye),Bt(this)}abs(){return I(this,Ye),new n(Math.abs(m(this,gt)),Math.abs(m(this,yt)),Math.abs(m(this,At)),Math.abs(m(this,vt)),Math.abs(m(this,bt)),Math.abs(m(this,wt)),Math.abs(m(this,Dt)),Math.abs(m(this,Et)),Math.abs(m(this,_t)),Math.abs(m(this,Lt)))}add(t){return I(this,Ye),wl("add",this,t)}subtract(t){return I(this,Ye),wl("subtract",this,t)}round(t){if(I(this,Ye),t===void 0)throw new TypeError("options parameter is required");let e=Tn(this),r=typeof t=="string"?gr("smallestUnit",t):ie(t),i=Ot(r,"largestUnit","datetime",void 0,["auto"]),{plainRelativeTo:o,zonedRelativeTo:a}=Ka(r),s=zr(r),l=ln(r,"halfExpand"),u=Ot(r,"smallestUnit","datetime",void 0),h=!0;u||(h=!1,u="nanosecond");let p=Pn(e,u),y=!0;if(i||(y=!1,i=p),i==="auto"&&(i=p),!h&&!y)throw new RangeError("at least one of smallestUnit or largestUnit is required");if(Pn(i,u)!==i)throw new RangeError(`largestUnit ${i} cannot be smaller than smallestUnit ${u}`);let D={hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[u];if(D!==void 0&&Ur(s,D,!1),s>1&&Sn(u)==="date"&&i!==u)throw new RangeError("For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit");if(a){let C=Rr(this),N=m(a,ke),$=m(a,U),G=m(a,he);return C=wu(G,gi(G,N,$,C),N,$,i,s,u,l),Sn(i)==="date"&&(i="hour"),tn(C,i)}if(o){let C=fn(this),N=Fr({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},C.time),$=m(o,me),G=m(o,U),W=Kt(G,$,st(C.date,N.deltaDays),"constrain");return C=bu(Me($,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),Me(W,N),G,i,s,u,l),tn(C,i)}if(mn(e))throw new RangeError(`a starting point is required for ${e}s balancing`);if(mn(i))throw new RangeError(`a starting point is required for ${i}s balancing`);let T=fn(this);if(u==="day"){let{quotient:C,remainder:N}=T.time.divmod(ko),$=T.date.days+C+Ei(N,"day");$=Vn($,s,l),T=Rn({years:0,months:0,weeks:0,days:$},Pe.ZERO)}else T=Rn({years:0,months:0,weeks:0,days:0},No(T.time,s,u,l));return tn(T,i)}total(t){if(I(this,Ye),t===void 0)throw new TypeError("options argument is required");let e=typeof t=="string"?gr("unit",t):ie(t),{plainRelativeTo:r,zonedRelativeTo:i}=Ka(e),o=Ot(e,"unit","datetime",An);if(i){let s=Rr(this),l=m(i,ke),u=m(i,U),h=m(i,he);return function(p,y,D,T,C){return Sn(C)==="time"?Ei(Pe.fromEpochNsDiff(y,p),C):ml(yu(p,y,D,T,C),y,rn(D,p),D,T,C)}(h,gi(h,l,u,s),l,u,o)}if(r){let s=fn(this),l=Fr({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},s.time),u=m(r,me),h=m(r,U),p=Kt(h,u,st(s.date,l.deltaDays),"constrain");return function(y,D,T,C){if(Yr(y,D)==0)return 0;pr(y),pr(D);let N=gu(y,D,T,C);return C==="nanosecond"?k.default.toNumber(N.time.totalNs):ml(N,nt(D),y,null,T,C)}(Me(u,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),Me(p,l),h,o)}let a=Tn(this);if(mn(a))throw new RangeError(`a starting point is required for ${a}s total`);if(mn(o))throw new RangeError(`a starting point is required for ${o}s total`);return Ei(fn(this).time,o)}toString(t=void 0){I(this,Ye);let e=ie(t),r=Vi(e),i=ln(e,"trunc"),o=Ot(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}=qi(o,r);if(s==="nanosecond"&&l===1)return Mo(this,a);let u=Tn(this),h=Rr(this),p=No(h.time,l,s,i);return h=Rn(h.date,p),Mo(tn(h,Pn(u,"second")),a)}toJSON(){return I(this,Ye),Mo(this,"auto")}toLocaleString(t=void 0,e=void 0){if(I(this,Ye),typeof Intl.DurationFormat=="function"){let r=new Intl.DurationFormat(t,e);return Zs.call(r,this)}return console.warn("Temporal.Duration.prototype.toLocaleString() requires Intl.DurationFormat."),Mo(this,"auto")}valueOf(){Xn("Duration")}static from(t){return nn(t)}static compare(t,e,r=void 0){let i=nn(t),o=nn(e),a=ie(r),{plainRelativeTo:s,zonedRelativeTo:l}=Ka(a);if(m(i,gt)===m(o,gt)&&m(i,yt)===m(o,yt)&&m(i,At)===m(o,At)&&m(i,vt)===m(o,vt)&&m(i,bt)===m(o,bt)&&m(i,wt)===m(o,wt)&&m(i,Dt)===m(o,Dt)&&m(i,Et)===m(o,Et)&&m(i,_t)===m(o,_t)&&m(i,Lt)===m(o,Lt))return 0;let u=Tn(i),h=Tn(o),p=Rr(i),y=Rr(o);if(l&&(Sn(u)==="date"||Sn(h)==="date")){let $=m(l,ke),G=m(l,U),W=m(l,he),ne=gi(W,$,G,p),le=gi(W,$,G,y);return Nt(k.default.toNumber(k.default.subtract(ne,le)))}let D=p.date.days,T=y.date.days;if(mn(u)||mn(h)){if(!s)throw new RangeError("A starting point is required for years, months, or weeks comparison");D=hl(p.date,s),T=hl(y.date,s)}let C=p.time.add24HourDays(D),N=y.time.add24HourDays(T);return C.cmp(N)}};On(Oi,"Temporal.Duration");var Hi=class{constructor(t,e,r="iso8601",i=1972){let o=fe(t),a=fe(e),s=Pt(r===void 0?"iso8601":Ge(r)),l=fe(i);mr(l,o,a),nu(this,{year:l,month:o,day:a},s)}get monthCode(){return kl(this,"monthCode")}get day(){return kl(this,"day")}get calendarId(){return I(this,qt),m(this,U)}with(t,e=void 0){if(I(this,qt),!ze(t))throw new TypeError("invalid argument");jr(t);let r=m(this,U),i=Ct(r,m(this,me),"month-day");return i=hr(r,i,Jt(r,t,["year","month","monthCode","day"],[],"partial")),xr(Io(r,i,Ee(ie(e))),r)}equals(t){I(this,qt);let e=rl(t);return bn(m(this,me),m(e,me))===0&&yn(m(this,U),m(e,U))}toString(t=void 0){return I(this,qt),cl(this,Ui(ie(t)))}toJSON(){return I(this,qt),cl(this)}toLocaleString(t=void 0,e=void 0){return I(this,qt),new Gt(t,e).format(this)}valueOf(){Xn("PlainMonthDay")}toPlainDate(t){if(I(this,qt),!ze(t))throw new TypeError("argument should be an object");let e=m(this,U);return Tt(Kn(e,hr(e,Ct(e,m(this,me),"month-day"),Jt(e,t,["year"],[],[])),"constrain"),e)}static from(t,e=void 0){return rl(t,e)}};function kl(n,t){I(n,qt);let e=m(n,me);return Wi(n).isoToDate(e,{[t]:!0})[t]}function Ja(n){return rn(n,ys())}On(Hi,"Temporal.PlainMonthDay");var ku={instant:()=>sn(ys()),plainDateTimeISO:(n=si())=>en(Ja(St(n)),"iso8601"),plainDateISO:(n=si())=>Tt(Ja(St(n)).isoDate,"iso8601"),plainTimeISO:(n=si())=>Cn(Ja(St(n)).time),timeZoneId:()=>si(),zonedDateTimeISO:(n=si())=>{let t=St(n);return at(ys(),t,"iso8601")},[Symbol.toStringTag]:"Temporal.Now"};Object.defineProperty(ku,Symbol.toStringTag,{value:"Temporal.Now",writable:!1,enumerable:!1,configurable:!0});var Bi=class n{constructor(t=0,e=0,r=0,i=0,o=0,a=0){let s=t===void 0?0:fe(t),l=e===void 0?0:fe(e),u=r===void 0?0:fe(r),h=i===void 0?0:fe(i),p=o===void 0?0:fe(o),y=a===void 0?0:fe(a);Jo(s,l,u,h,p,y),ru(this,{hour:s,minute:l,second:u,millisecond:h,microsecond:p,nanosecond:y})}get hour(){return I(this,Ue),m(this,je).hour}get minute(){return I(this,Ue),m(this,je).minute}get second(){return I(this,Ue),m(this,je).second}get millisecond(){return I(this,Ue),m(this,je).millisecond}get microsecond(){return I(this,Ue),m(this,je).microsecond}get nanosecond(){return I(this,Ue),m(this,je).nanosecond}with(t,e=void 0){if(I(this,Ue),!ze(t))throw new TypeError("invalid argument");jr(t);let r=ss(t,"partial"),i=ss(this),{hour:o,minute:a,second:s,millisecond:l,microsecond:u,nanosecond:h}=Object.assign(i,r),p=Ee(ie(e));return{hour:o,minute:a,second:s,millisecond:l,microsecond:u,nanosecond:h}=Go(o,a,s,l,u,h,p),new n(o,a,s,l,u,h)}add(t){return I(this,Ue),Ml("add",this,t)}subtract(t){return I(this,Ue),Ml("subtract",this,t)}until(t,e=void 0){return I(this,Ue),yl("until",this,t,e)}since(t,e=void 0){return I(this,Ue),yl("since",this,t,e)}round(t){if(I(this,Ue),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?gr("smallestUnit",t):ie(t),r=zr(e),i=ln(e,"halfExpand"),o=Ot(e,"smallestUnit","time",An);return Ur(r,{hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o],!1),Cn(fs(m(this,je),r,o,i))}equals(t){I(this,Ue);let e=Un(t);return gs(m(this,je),m(e,je))===0}toString(t=void 0){I(this,Ue);let e=ie(t),r=Vi(e),i=ln(e,"trunc"),o=Ot(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}=qi(o,r);return sl(fs(m(this,je),l,s,i),a)}toJSON(){return I(this,Ue),sl(m(this,je),"auto")}toLocaleString(t=void 0,e=void 0){return I(this,Ue),new Gt(t,e).format(this)}valueOf(){Xn("PlainTime")}static from(t,e=void 0){return Un(t,e)}static compare(t,e){let r=Un(t),i=Un(e);return gs(m(r,je),m(i,je))}};On(Bi,"Temporal.PlainTime");var Fi=class{constructor(t,e,r="iso8601",i=1){let o=fe(t),a=fe(e),s=Pt(r===void 0?"iso8601":Ge(r)),l=fe(i);mr(o,a,l),iu(this,{year:o,month:a,day:l},s)}get year(){return _n(this,"year")}get month(){return _n(this,"month")}get monthCode(){return _n(this,"monthCode")}get calendarId(){return I(this,tt),m(this,U)}get era(){return _n(this,"era")}get eraYear(){return _n(this,"eraYear")}get daysInMonth(){return _n(this,"daysInMonth")}get daysInYear(){return _n(this,"daysInYear")}get monthsInYear(){return _n(this,"monthsInYear")}get inLeapYear(){return _n(this,"inLeapYear")}with(t,e=void 0){if(I(this,tt),!ze(t))throw new TypeError("invalid argument");jr(t);let r=m(this,U),i=Ct(r,m(this,me),"year-month");return i=hr(r,i,Jt(r,t,["year","month","monthCode"],[],"partial")),Ar(Si(r,i,Ee(ie(e))),r)}add(t,e=void 0){return I(this,tt),Tl("add",this,t,e)}subtract(t,e=void 0){return I(this,tt),Tl("subtract",this,t,e)}until(t,e=void 0){return I(this,tt),vl("until",this,t,e)}since(t,e=void 0){return I(this,tt),vl("since",this,t,e)}equals(t){I(this,tt);let e=pi(t);return bn(m(this,me),m(e,me))===0&&yn(m(this,U),m(e,U))}toString(t=void 0){return I(this,tt),ll(this,Ui(ie(t)))}toJSON(){return I(this,tt),ll(this)}toLocaleString(t=void 0,e=void 0){return I(this,tt),new Gt(t,e).format(this)}valueOf(){Xn("PlainYearMonth")}toPlainDate(t){if(I(this,tt),!ze(t))throw new TypeError("argument should be an object");let e=m(this,U);return Tt(Kn(e,hr(e,Ct(e,m(this,me),"year-month"),Jt(e,t,["day"],[],[])),"constrain"),e)}static from(t,e=void 0){return pi(t,e)}static compare(t,e){let r=pi(t),i=pi(e);return bn(m(r,me),m(i,me))}};function _n(n,t){I(n,tt);let e=m(n,me);return Wi(n).isoToDate(e,{[t]:!0})[t]}On(Fi,"Temporal.PlainYearMonth");var tm=Gt.prototype.resolvedOptions,Yi=class{constructor(t,e,r="iso8601"){if(arguments.length<1)throw new TypeError("missing argument: epochNanoseconds is required");let i=Oo(t),o=Ge(e),{tzName:a,offsetMinutes:s}=qn(o);if(s===void 0){let l=xo(a);if(!l)throw new RangeError(`unknown time zone ${a}`);o=l.identifier}else o=$s(s);au(this,i,o,Pt(r===void 0?"iso8601":Ge(r)))}get calendarId(){return I(this,be),m(this,U)}get timeZoneId(){return I(this,be),m(this,ke)}get year(){return ft(this,"year")}get month(){return ft(this,"month")}get monthCode(){return ft(this,"monthCode")}get day(){return ft(this,"day")}get hour(){return kr(this,"hour")}get minute(){return kr(this,"minute")}get second(){return kr(this,"second")}get millisecond(){return kr(this,"millisecond")}get microsecond(){return kr(this,"microsecond")}get nanosecond(){return kr(this,"nanosecond")}get era(){return ft(this,"era")}get eraYear(){return ft(this,"eraYear")}get epochMilliseconds(){return I(this,be),on(m(this,he),"floor")}get epochNanoseconds(){return I(this,be),Du(m(this,he))}get dayOfWeek(){return ft(this,"dayOfWeek")}get dayOfYear(){return ft(this,"dayOfYear")}get weekOfYear(){return ft(this,"weekOfYear")?.week}get yearOfWeek(){return ft(this,"weekOfYear")?.year}get hoursInDay(){I(this,be);let t=m(this,ke),e=hn(this).isoDate,r=Ht(e.year,e.month,e.day+1),i=jn(t,e),o=jn(t,r);return Ei(Pe.fromEpochNsDiff(o,i),"hour")}get daysInWeek(){return ft(this,"daysInWeek")}get daysInMonth(){return ft(this,"daysInMonth")}get daysInYear(){return ft(this,"daysInYear")}get monthsInYear(){return ft(this,"monthsInYear")}get inLeapYear(){return ft(this,"inLeapYear")}get offset(){return I(this,be),cs(kn(m(this,ke),m(this,he)))}get offsetNanoseconds(){return I(this,be),kn(m(this,ke),m(this,he))}with(t,e=void 0){if(I(this,be),!ze(t))throw new TypeError("invalid zoned-date-time-like");jr(t);let r=m(this,U),i=m(this,ke),o=kn(i,m(this,he)),a=hn(this),s={...Ct(r,a.isoDate),...a.time,offset:cs(o)};s=hr(r,s,Jt(r,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset"],"partial"));let l=ie(e),u=Di(l),h=To(l,"prefer"),p=Gi(r,s,Ee(l)),y=Vr(s.offset);return at(Ro(p.isoDate,p.time,"option",y,i,u,h,!1),i,r)}withPlainTime(t=void 0){I(this,be);let e=m(this,ke),r=m(this,U),i=hn(this).isoDate,o;return o=t===void 0?jn(e,i):ct(e,Me(i,m(Un(t),je)),"compatible"),at(o,e,r)}withTimeZone(t){I(this,be);let e=St(t);return at(m(this,he),e,m(this,U))}withCalendar(t){I(this,be);let e=Zi(t);return at(m(this,he),m(this,ke),e)}add(t,e=void 0){return I(this,be),Sl("add",this,t,e)}subtract(t,e=void 0){return I(this,be),Sl("subtract",this,t,e)}until(t,e=void 0){return I(this,be),bl("until",this,t,e)}since(t,e=void 0){return I(this,be),bl("since",this,t,e)}round(t){if(I(this,be),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?gr("smallestUnit",t):ie(t),r=zr(e),i=ln(e,"halfExpand"),o=Ot(e,"smallestUnit","time",An,["day"]),a={day:1,hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o];if(Ur(r,a,a===1),o==="nanosecond"&&r===1)return at(m(this,he),m(this,ke),m(this,U));let s=m(this,ke),l=m(this,he),u=hn(this),h;if(o==="day"){let p=u.isoDate,y=Ht(p.year,p.month,p.day+1),D=jn(s,p),T=jn(s,y),C=k.default.subtract(T,D);h=Pe.fromEpochNsDiff(l,D).round(C,i).addToEpochNs(D)}else{let p=ps(u,r,o,i),y=kn(s,l);h=Ro(p.isoDate,p.time,"option",y,s,"compatible","prefer",!1)}return at(h,s,m(this,U))}equals(t){I(this,be);let e=fi(t),r=m(this,he),i=m(e,he);return!!k.default.equal(k.default.BigInt(r),k.default.BigInt(i))&&!!su(m(this,ke),m(e,ke))&&yn(m(this,U),m(e,U))}toString(t=void 0){I(this,be);let e=ie(t),r=Ui(e),i=Vi(e),o=function(y){return In(y,"offset",["auto","never"],"auto")}(e),a=ln(e,"trunc"),s=Ot(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 In(y,"timeZoneName",["auto","never","critical"],"auto")}(e),{precision:u,unit:h,increment:p}=qi(s,i);return ul(this,u,r,l,o,{unit:h,increment:p,roundingMode:a})}toLocaleString(t=void 0,e=void 0){I(this,be);let r=ie(e),i=Object.create(null);if(function(l,u,h,p){if(u==null)return;let y=Reflect.ownKeys(u);for(let D=0;D<y.length;D++){let T=y[D];if(!h.some(C=>Object.is(C,T))&&Object.prototype.propertyIsEnumerable.call(u,T)){let C=u[T];l[T]=C}}}(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=m(this,ke),dl(i.timeZone))throw new RangeError("toLocaleString does not currently support offset time zones");let o=new Gt(t,i),a=tm.call(o).calendar,s=m(this,U);if(s!=="iso8601"&&a!=="iso8601"&&!yn(a,s))throw new RangeError(`cannot format ZonedDateTime with calendar ${s} in locale with calendar ${a}`);return o.format(sn(m(this,he)))}toJSON(){return I(this,be),ul(this,"auto")}valueOf(){Xn("ZonedDateTime")}startOfDay(){I(this,be);let t=m(this,ke);return at(jn(t,hn(this).isoDate),t,m(this,U))}getTimeZoneTransition(t){I(this,be);let e=m(this,ke);if(t===void 0)throw new TypeError("options parameter is required");let r=In(typeof t=="string"?gr("direction",t):ie(t),"direction",["next","previous"],An);if(r===void 0)throw new TypeError("direction option is required");if(dl(e)||e==="UTC")return null;let i=m(this,he),o=r==="next"?zs(e,i):us(e,i);return o===null?null:at(o,e,m(this,U))}toInstant(){return I(this,be),sn(m(this,he))}toPlainDate(){return I(this,be),Tt(hn(this).isoDate,m(this,U))}toPlainTime(){return I(this,be),Cn(hn(this).time)}toPlainDateTime(){return I(this,be),en(hn(this),m(this,U))}static from(t,e=void 0){return fi(t,e)}static compare(t,e){let r=fi(t),i=fi(e),o=m(r,he),a=m(i,he);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 hn(n){return rn(m(n,ke),m(n,he))}function ft(n,t){I(n,be);let e=hn(n).isoDate;return Wi(n).isoToDate(e,{[t]:!0})[t]}function kr(n,t){return I(n,be),hn(n).time[t]}On(Yi,"Temporal.ZonedDateTime");var Re=Object.freeze({__proto__:null,Duration:Oi,Instant:Ai,Now:ku,PlainDate:Li,PlainDateTime:Ni,PlainMonthDay:Hi,PlainTime:Bi,PlainYearMonth:Fi,ZonedDateTime:Yi}),Xm=class{toTemporalInstant(){return sn(cn(Date.prototype.valueOf.call(this)))}}.prototype.toTemporalInstant,nm=[Ai,Li,Ni,Oi,Hi,Bi,Fi,Yi];for(let n of nm){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))}function Js(n){let t=Object.create(null);for(let e of n.split(","))t[e]=1;return e=>e in t}var Xs=Object.assign;var rm=Object.prototype.hasOwnProperty,na=(n,t)=>rm.call(n,t),Dr=Array.isArray,no=n=>Ru(n)==="[object Map]";var Pu=n=>typeof n=="function",im=n=>typeof n=="string",Wr=n=>typeof n=="symbol",ro=n=>n!==null&&typeof n=="object";var om=Object.prototype.toString,Ru=n=>om.call(n),Iu=n=>Ru(n).slice(8,-1);var ra=n=>im(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n;var ia=n=>{let t=Object.create(null);return e=>t[e]||(t[e]=n(e))},am=/-(\w)/g,tp=ia(n=>n.replace(am,(t,e)=>e?e.toUpperCase():"")),sm=/\B([A-Z])/g,np=ia(n=>n.replace(sm,"-$1").toLowerCase()),cm=ia(n=>n.charAt(0).toUpperCase()+n.slice(1)),rp=ia(n=>n?`on${cm(n)}`:""),Er=(n,t)=>!Object.is(n,t);var lm="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";var ip=Js(lm+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var Qs;var Ne;var ec=new WeakSet,sa=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,Qs&&Qs.active&&Qs.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ec.has(this)&&(ec.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Nu(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,xu(this),Ou(this);let t=Ne,e=un;Ne=this,un=!0;try{return this.fn()}finally{Hu(this),Ne=t,un=e,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)fc(t);this.deps=this.depsTail=void 0,xu(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ec.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){rc(this)&&this.run()}get dirty(){return rc(this)}},Lu=0,oo,ao;function Nu(n,t=!1){if(n.flags|=8,t){n.next=ao,ao=n;return}n.next=oo,oo=n}function mc(){Lu++}function pc(){if(--Lu>0)return;if(ao){let t=ao;for(ao=void 0;t;){let e=t.next;t.next=void 0,t.flags&=-9,t=e}}let n;for(;oo;){let t=oo;for(oo=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 Ou(n){for(let t=n.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Hu(n){let t,e=n.depsTail,r=e;for(;r;){let i=r.prevDep;r.version===-1?(r===e&&(e=i),fc(r),um(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}n.deps=t,n.depsTail=e}function rc(n){for(let t=n.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Bu(t.dep.computed)||t.dep.version!==t.version))return!0;return!!n._dirty}function Bu(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===so)||(n.globalVersion=so,!n.isSSR&&n.flags&128&&(!n.deps&&!n._dirty||!rc(n))))return;n.flags|=2;let t=n.dep,e=Ne,r=un;Ne=n,un=!0;try{Ou(n);let i=n.fn(n._value);(t.version===0||Er(i,n._value))&&(n.flags|=128,n._value=i,t.version++)}catch(i){throw t.version++,i}finally{Ne=e,un=r,Hu(n),n.flags&=-3}}function fc(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)fc(o,!0)}!t&&!--e.sc&&e.map&&e.map.delete(e.key)}function um(n){let{prevDep:t,nextDep:e}=n;t&&(t.nextDep=e,n.prevDep=void 0),e&&(e.prevDep=t,n.nextDep=void 0)}function It(n,t){n.effect instanceof sa&&(n=n.effect.fn);let e=new sa(n);t&&Xs(e,t);try{e.run()}catch(i){throw e.stop(),i}let r=e.run.bind(e);return r.effect=e,r}var un=!0,Fu=[];function dm(){Fu.push(un),un=!1}function hm(){let n=Fu.pop();un=n===void 0?!0:n}function xu(n){let{cleanup:t}=n;if(n.cleanup=void 0,t){let e=Ne;Ne=void 0;try{t()}finally{Ne=e}}}var so=0,ic=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}},co=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(!Ne||!un||Ne===this.computed)return;let e=this.activeLink;if(e===void 0||e.sub!==Ne)e=this.activeLink=new ic(Ne,this),Ne.deps?(e.prevDep=Ne.depsTail,Ne.depsTail.nextDep=e,Ne.depsTail=e):Ne.deps=Ne.depsTail=e,Yu(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=Ne.depsTail,e.nextDep=void 0,Ne.depsTail.nextDep=e,Ne.depsTail=e,Ne.deps===e&&(Ne.deps=r)}return e}trigger(t){this.version++,so++,this.notify(t)}notify(t){mc();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{pc()}}};function Yu(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)Yu(r)}let e=n.dep.subs;e!==n&&(n.prevSub=e,e&&(e.nextSub=n)),n.dep.subs=n}}var oc=new WeakMap,_r=Symbol(""),ac=Symbol(""),lo=Symbol("");function Ft(n,t,e){if(un&&Ne){let r=oc.get(n);r||oc.set(n,r=new Map);let i=r.get(e);i||(r.set(e,i=new co),i.map=r,i.key=e),i.track()}}function Qn(n,t,e,r,i,o){let a=oc.get(n);if(!a){so++;return}let s=l=>{l&&l.trigger()};if(mc(),t==="clear")a.forEach(s);else{let l=Dr(n),u=l&&ra(e);if(l&&e==="length"){let h=Number(r);a.forEach((p,y)=>{(y==="length"||y===lo||!Wr(y)&&y>=h)&&s(p)})}else switch((e!==void 0||a.has(void 0))&&s(a.get(e)),u&&s(a.get(lo)),t){case"add":l?u&&s(a.get("length")):(s(a.get(_r)),no(n)&&s(a.get(ac)));break;case"delete":l||(s(a.get(_r)),no(n)&&s(a.get(ac)));break;case"set":no(n)&&s(a.get(_r));break}}pc()}function Gr(n){let t=Ae(n);return t===n?t:(Ft(t,"iterate",lo),er(n)?t:t.map(Rt))}function gc(n){return Ft(n=Ae(n),"iterate",lo),n}var mm={__proto__:null,[Symbol.iterator](){return tc(this,Symbol.iterator,Rt)},concat(...n){return Gr(this).concat(...n.map(t=>Dr(t)?Gr(t):t))},entries(){return tc(this,"entries",n=>(n[1]=Rt(n[1]),n))},every(n,t){return Hn(this,"every",n,t,void 0,arguments)},filter(n,t){return Hn(this,"filter",n,t,e=>e.map(Rt),arguments)},find(n,t){return Hn(this,"find",n,t,Rt,arguments)},findIndex(n,t){return Hn(this,"findIndex",n,t,void 0,arguments)},findLast(n,t){return Hn(this,"findLast",n,t,Rt,arguments)},findLastIndex(n,t){return Hn(this,"findLastIndex",n,t,void 0,arguments)},forEach(n,t){return Hn(this,"forEach",n,t,void 0,arguments)},includes(...n){return nc(this,"includes",n)},indexOf(...n){return nc(this,"indexOf",n)},join(n){return Gr(this).join(n)},lastIndexOf(...n){return nc(this,"lastIndexOf",n)},map(n,t){return Hn(this,"map",n,t,void 0,arguments)},pop(){return io(this,"pop")},push(...n){return io(this,"push",n)},reduce(n,...t){return Au(this,"reduce",n,t)},reduceRight(n,...t){return Au(this,"reduceRight",n,t)},shift(){return io(this,"shift")},some(n,t){return Hn(this,"some",n,t,void 0,arguments)},splice(...n){return io(this,"splice",n)},toReversed(){return Gr(this).toReversed()},toSorted(n){return Gr(this).toSorted(n)},toSpliced(...n){return Gr(this).toSpliced(...n)},unshift(...n){return io(this,"unshift",n)},values(){return tc(this,"values",Rt)}};function tc(n,t,e){let r=gc(n),i=r[t]();return r!==n&&!er(n)&&(i._next=i.next,i.next=()=>{let o=i._next();return o.value&&(o.value=e(o.value)),o}),i}var pm=Array.prototype;function Hn(n,t,e,r,i,o){let a=gc(n),s=a!==n&&!er(n),l=a[t];if(l!==pm[t]){let p=l.apply(n,o);return s?Rt(p):p}let u=e;a!==n&&(s?u=function(p,y){return e.call(this,Rt(p),y,n)}:e.length>2&&(u=function(p,y){return e.call(this,p,y,n)}));let h=l.call(a,u,r);return s&&i?i(h):h}function Au(n,t,e,r){let i=gc(n),o=e;return i!==n&&(er(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,Rt(s),l,n)}),i[t](o,...r)}function nc(n,t,e){let r=Ae(n);Ft(r,"iterate",lo);let i=r[t](...e);return(i===-1||i===!1)&&Cm(e[0])?(e[0]=Ae(e[0]),r[t](...e)):i}function io(n,t,e=[]){dm(),mc();let r=Ae(n)[t].apply(n,e);return pc(),hm(),r}var fm=Js("__proto__,__v_isRef,__isVue"),$u=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(Wr));function gm(n){Wr(n)||(n=String(n));let t=Ae(this);return Ft(t,"has",n),t.hasOwnProperty(n)}var ca=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?Mm:Uu:o?_m:zu).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;let a=Dr(t);if(!i){let l;if(a&&(l=mm[e]))return l;if(e==="hasOwnProperty")return gm}let s=Reflect.get(t,e,Kr(t)?t:r);return(Wr(e)?$u.has(e):fm(e))||(i||Ft(t,"get",e),o)?s:Kr(s)?a&&ra(e)?s:s.value:ro(s)?i?Jr(s):tr(s):s}},sc=class extends ca{constructor(t=!1){super(!1,t)}set(t,e,r,i){let o=t[e];if(!this._isShallow){let l=Zr(o);if(!er(r)&&!Zr(r)&&(o=Ae(o),r=Ae(r)),!Dr(t)&&Kr(o)&&!Kr(r))return l?!1:(o.value=r,!0)}let a=Dr(t)&&ra(e)?Number(e)<t.length:na(t,e),s=Reflect.set(t,e,r,Kr(t)?t:i);return t===Ae(i)&&(a?Er(r,o)&&Qn(t,"set",e,r,o):Qn(t,"add",e,r)),s}deleteProperty(t,e){let r=na(t,e),i=t[e],o=Reflect.deleteProperty(t,e);return o&&r&&Qn(t,"delete",e,void 0,i),o}has(t,e){let r=Reflect.has(t,e);return(!Wr(e)||!$u.has(e))&&Ft(t,"has",e),r}ownKeys(t){return Ft(t,"iterate",Dr(t)?"length":_r),Reflect.ownKeys(t)}},cc=class extends ca{constructor(t=!1){super(!0,t)}set(t,e){return!0}deleteProperty(t,e){return!0}},ym=new sc,vm=new cc;var lc=n=>n,oa=n=>Reflect.getPrototypeOf(n);function bm(n,t,e){return function(...r){let i=this.__v_raw,o=Ae(i),a=no(o),s=n==="entries"||n===Symbol.iterator&&a,l=n==="keys"&&a,u=i[n](...r),h=e?lc:t?uc:Rt;return!t&&Ft(o,"iterate",l?ac:_r),{next(){let{value:p,done:y}=u.next();return y?{value:p,done:y}:{value:s?[h(p[0]),h(p[1])]:h(p),done:y}},[Symbol.iterator](){return this}}}}function aa(n){return function(...t){return n==="delete"?!1:n==="clear"?void 0:this}}function wm(n,t){let e={get(i){let o=this.__v_raw,a=Ae(o),s=Ae(i);n||(Er(i,s)&&Ft(a,"get",i),Ft(a,"get",s));let{has:l}=oa(a),u=t?lc:n?uc:Rt;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&&Ft(Ae(i),"iterate",_r),Reflect.get(i,"size",i)},has(i){let o=this.__v_raw,a=Ae(o),s=Ae(i);return n||(Er(i,s)&&Ft(a,"has",i),Ft(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=Ae(s),u=t?lc:n?uc:Rt;return!n&&Ft(l,"iterate",_r),s.forEach((h,p)=>i.call(o,u(h),u(p),a))}};return Xs(e,n?{add:aa("add"),set:aa("set"),delete:aa("delete"),clear:aa("clear")}:{add(i){!t&&!er(i)&&!Zr(i)&&(i=Ae(i));let o=Ae(this);return oa(o).has.call(o,i)||(o.add(i),Qn(o,"add",i,i)),this},set(i,o){!t&&!er(o)&&!Zr(o)&&(o=Ae(o));let a=Ae(this),{has:s,get:l}=oa(a),u=s.call(a,i);u||(i=Ae(i),u=s.call(a,i));let h=l.call(a,i);return a.set(i,o),u?Er(o,h)&&Qn(a,"set",i,o,h):Qn(a,"add",i,o),this},delete(i){let o=Ae(this),{has:a,get:s}=oa(o),l=a.call(o,i);l||(i=Ae(i),l=a.call(o,i));let u=s?s.call(o,i):void 0,h=o.delete(i);return l&&Qn(o,"delete",i,void 0,u),h},clear(){let i=Ae(this),o=i.size!==0,a=void 0,s=i.clear();return o&&Qn(i,"clear",void 0,void 0,a),s}}),["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=bm(i,n,t)}),e}function ju(n,t){let e=wm(n,t);return(r,i,o)=>i==="__v_isReactive"?!n:i==="__v_isReadonly"?n:i==="__v_raw"?r:Reflect.get(na(e,i)&&i in r?e:r,i,o)}var Dm={get:ju(!1,!1)};var Em={get:ju(!0,!1)};var zu=new WeakMap,_m=new WeakMap,Uu=new WeakMap,Mm=new WeakMap;function Tm(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Sm(n){return n.__v_skip||!Object.isExtensible(n)?0:Tm(Iu(n))}function tr(n){return Zr(n)?n:Vu(n,!1,ym,Dm,zu)}function Jr(n){return Vu(n,!0,vm,Em,Uu)}function Vu(n,t,e,r,i){if(!ro(n)||n.__v_raw&&!(t&&n.__v_isReactive))return n;let o=Sm(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 Zr(n){return!!(n&&n.__v_isReadonly)}function er(n){return!!(n&&n.__v_isShallow)}function Cm(n){return n?!!n.__v_raw:!1}function Ae(n){let t=n&&n.__v_raw;return t?Ae(t):n}var Rt=n=>ro(n)?tr(n):n,uc=n=>ro(n)?Jr(n):n;function Kr(n){return n?n.__v_isRef===!0:!1}function Ze(n){return km(n,!1)}function km(n,t){return Kr(n)?n:new dc(n,t)}var dc=class{constructor(t,e){this.dep=new co,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=e?t:Ae(t),this._value=e?t:Rt(t),this.__v_isShallow=e}get value(){return this.dep.track(),this._value}set value(t){let e=this._rawValue,r=this.__v_isShallow||er(t)||Zr(t);t=r?t:Ae(t),Er(t,e)&&(this._rawValue=t,this._value=r?t:Rt(t),this.dep.trigger())}};var hc=class{constructor(t,e,r){this.fn=t,this.setter=e,this._value=void 0,this.dep=new co(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=so-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!e,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&Ne!==this)return Nu(this,!0),!0}get value(){let t=this.dep.track();return Bu(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}};function Xt(n,t,e=!1){let r,i;return Pu(n)?r=n:(r=n.get,i=n.set),new hc(r,i,e)}var Yc=qc(Wu(),1);var yc=class{constructor(){L(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))}},la=new yc;function it(n,t){la.emit(n,t)}function nr(n,t){Array.isArray(n)?n.forEach(e=>la.on(e,t)):la.on(n,t)}var Gu={"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)",guestSingular:"Person",guestPlural:"People",couponValid:"Coupon is valid ;)",couponInvalid:"Coupon is invalid !",couponError:"Error validating coupon!",proceedToPayment:"Proceed to payment",completePayment:"Complete the payment",viewHotelPage:"View Site"},"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)",guestSingular:"Personne",guestPlural:"Personnes",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",viewHotelPage:"Voir le site"}},Be=n=>Gu[Xr().bcp47][n]||Gu["fr-FR"][n],Je=n=>{let t=Xr().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"]||"")};var Xr=()=>{let{lang:n}=document.documentElement,t={iso639:"fr",bcp47:"fr-FR"};return n.includes("en")&&(t={iso639:"en",bcp47:"en-US"}),t},qe=Xr().bcp47,_p=Xr().iso639;var J=class n{static getCurrentDate(){return Re.Now.plainDateISO()}static fromString(t){return Re.PlainDate.from(this.safeParsePlainDate(t))}static formatForDisplay(t,e={weekday:"short",month:"short",day:"numeric"}){return t.toLocaleString(qe,e)}static formatForAPI(t){return(typeof t=="string"?Re.PlainDate.from(t):Re.PlainDate.from(t)).toZonedDateTime({timeZone:"Europe/Paris",plainTime:Re.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 Re.PlainDate.compare(t,e)>0}static isAfterOrEqual(t,e){return Re.PlainDate.compare(t,e)<0}static isSameDate(t,e){return Re.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 Re.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 Re.PlainDate.from(e)}return Re.PlainDate.from(t)}catch(e){return console.error("Error parsing date string:",e),n.getCurrentDate()}}};var xp=localStorage.getItem("dev")==="true";var Ap=3*60*60*1e3;var ua="calendar-day-price",Ku="DD/MM/YYYY",Zu="Y-m-d",Ju=!1,Rm=365,vc=J.getCurrentDate(),Xu=J.addDays(vc,Rm),Qr=J.getCurrentDate(),uo=J.addDays(Qr,3),Im=J.getCurrentDate(),Lp=J.addDays(Im,30);function rr(n=!0,t=document.body){t.querySelectorAll('[data-fs-element="preloader"]').forEach(r=>{r.classList.toggle("hide",!n)})}var da="data-fs-element";var K=(n,t=document)=>t.querySelector(`[${da}="${n}"]`);var Qu=n=>`[${da}="${n.getAttribute(da)}"]`,ed=n=>n.getAttribute(da);var bc=class{constructor(){L(this,"state",tr({appartmentsData:[],today:J.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}},of=new bc;var Mr={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)),Mr.touch()}catch(e){console.error(`Error writing to localStorage for key ${n}:`,e)}},update:(n,t)=>{let e=Mr.get(n),r=t(e);Mr.set(n,r)},remove:n=>{localStorage.removeItem(n),Mr.touch()},clear:()=>{localStorage.clear()},has:n=>localStorage.getItem(n)!==null,touch:()=>{localStorage.setItem("lastUpdater",Am()||"root")}},Am=()=>localStorage.getItem("lastUpdater");var ha=n=>{let t=new Date;return t.setDate(t.getDate()+n),t.toISOString().split("T")[0]},ir=Mr.get("form_state"),td=ir?{enterpriseId:ir.enterpriseId||"",startDate:ir.startDate||ha(45),endDate:ir.endDate||ha(48),guests:ir.guests||2,coupon:ir.coupon||"",referrer:ir.referrer||window.location.href,rooms:ir.rooms||0}:{enterpriseId:"",startDate:ha(45),endDate:ha(48),guests:2,coupon:"",referrer:window.location.href,rooms:0},Yt=tr(td),xm=Jr(td);It(()=>{Mr.set("form_state",Yt)});var Lm="https://yuna-backend.cbocher.workers.dev/mews",Nm="https://api.mews.com/api/distributor/v1",Om="Yuna",Hm="mewscache",Bm=!1,Fm=13,Ym=8,$m=Re.Duration.from({minutes:20}).milliseconds,jm=new Headers({Accept:"application/json, text/plain, */*","Content-Type":"application/json; charset=utf-8"}),ce={base_url:Lm,bookingEngine_url:Nm,bookingEngineClient:Om,bypassCache:Bm,headers:jm,cache_key:Hm,ttl:$m,beCheckInUTC:Fm,beCheckOutUTC:Ym};var ma=(n,t,e)=>`${n}:${t}:${JSON.stringify(e)}`;var ei=class{constructor(){L(this,"dbName","MewsAPICache");L(this,"version",2);L(this,"db",null);L(this,"initPromise",null);L(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 h=e!==void 0?e:ce.ttl,p=Re.Instant.fromEpochMilliseconds(u.timestamp);if(Re.Now.instant().since(p,{smallestUnit:"milliseconds"}).milliseconds>h){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:Re.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:Re.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=Re.Now.instant().epochMilliseconds-ce.ttl,o=r.transaction("api_cache","readwrite"),a=o.objectStore("api_cache"),s=a.index("by-timestamp"),l=await new Promise((h,p)=>{let y=s.getAll(IDBKeyRange.upperBound(i));y.onsuccess=()=>h(y.result),y.onerror=()=>p(y.error)}),u=50;for(let h=0;h<l.length;h+=u){let p=l.slice(h,h+u);await Promise.all(p.map(y=>new Promise((D,T)=>{let C=a.delete(y.cacheKey);C.onsuccess=()=>D(),C.onerror=()=>T(C.error)}))),e+=p.length,h+u<l.length&&await new Promise(y=>setTimeout(y,0))}await new Promise((h,p)=>{o.oncomplete=()=>h(),o.onerror=()=>p(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,h)=>{let p=i.delete(l.cacheKey);p.onsuccess=()=>u(),p.onerror=()=>h(p.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 Bn=async(n,t,e=null,r=Re.Duration.from({minutes:10}).milliseconds)=>{let i=new ei,o=ma(`booking-engine:${n}`,e||"null",t.body);if(!ce.bypassCache){let a=await i.get(o,r);if(a)return a}try{let a=await fetch(n,t);if(!a.ok)throw new Error(`Booking Engine API request failed: ${a.status} ${a.statusText}`);let s=await a.json();return i.set(o,s,e||"null").catch(l=>{console.error("Error setting booking engine cache:",l)}),s}catch(a){throw a instanceof Error?console.error(`BOOKING_ENGINE_FETCH_ERROR [${n}]`,a.message):console.error(a),a}};var nd=async n=>{let t=`${ce.bookingEngine_url}/hotels/get`,e={Client:ce.bookingEngineClient,HotelId:n},r={method:"POST",headers:ce.headers,body:JSON.stringify(e)};return Bn(t,r,n)};var pa=(n,t)=>{let e=`${ce.bookingEngine_url}/reservations/getPricing`,r={method:"POST",headers:ce.headers,body:JSON.stringify(t)};return Bn(e,r,n)};var rd=(n,t)=>{let e=`${ce.bookingEngine_url}/services/getAvailability`,r={method:"POST",headers:ce.headers,body:JSON.stringify(t)};return Bn(e,r,n)},id=(n,t)=>{let e=`${ce.bookingEngine_url}/services/getPricing`,r={method:"POST",headers:ce.headers,body:JSON.stringify(t)};return Bn(e,r,n)};var Xe=async(n,t,e=null,r=!1)=>{let i=new ei,o=ma(n,e||"null",t.body);if(!ce.bypassCache){let a=await i.get(o);if(a)return a}try{let a=new URL(ce.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 od=(n,t={})=>{let e={method:"POST",headers:ce.headers,body:JSON.stringify(t)};return Xe("/services/getAll",e,n)};function ad(n){return n.Services.map(t=>({id:t.Id,enterpriseId:t.EnterpriseId,isActive:t.IsActive,name:Je(t.Names),startTime:t.StartTime,endTime:t.EndTime,type:t.Type,ordering:t.Ordering}))}var wc=Ze({});async function sd(n){if(wc.value[n])return wc.value[n];let t=await od(n),e=ad(t);return wc.value[n]=e,e}var cd=(n,t)=>{let e={method:"POST",headers:ce.headers,body:JSON.stringify(t)};return Xe("/ageCategories/getAll",e,n)};function ld(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:Je(t.Names),shortName:t.ShortNames?Je(t.ShortNames):null,classification:t.Classification,isActive:t.IsActive,maximalAge:t.MaximalAge,minimalAge:t.MinimalAge,serviceId:t.ServiceId}))}var Dc=Ze({});async function ud(n){if(Dc.value[n])return Dc.value[n];let t=await cd(n,{EnterpriseIds:[n]}),e=ld(t);return Dc.value[n]=e,e}var dd=(n,t)=>{let e={method:"POST",headers:ce.headers,body:JSON.stringify(t)};return Xe("/products/getAll",e,n)};function hd(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 md(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 pd(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:Je(t.Names),shortName:t.ShortName,description:Je(t.Description),hideFromGuest:t.Options.HidePriceFromGuest,group:n.RateGroups.find(e=>e.Id===t.GroupId)||null,pricing:t.Pricing}))}function ho(n,t){return n.map(t)}function Ec(n){return{id:n.Id,serviceId:n.ServiceId,categoryId:n.CategoryId,isActive:n.IsActive,isDefault:n.IsDefault,name:Je(n.Names),shortName:Je(n.ShortNames),description:Je(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 fd(n){return{products:ho(n.Products,Ec),customerProducts:ho(n.CustomerProducts,Ec)}}var _c=Ze({});async function gd(n,t){if(_c.value[t])return _c.value[t];let e=await dd(n,{ServiceIds:[t]}),r=fd(e);return _c.value[t]=r,r}var yd=(n,t={})=>{let e={method:"POST",headers:ce.headers,body:JSON.stringify(t)};return Xe("/rates/getAll",e,n)};var Mc=Ze({});async function fa(n,t){if(Mc.value[t])return Mc.value[t];let e=await yd(n,{ServiceIds:[t]}),r=pd(e);return Mc.value[t]=r,r}var vd=(n,t)=>{let e={method:"POST",headers:ce.headers,body:JSON.stringify(t)};return Xe("/services/getAvailability",e,n)};function bd(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 Tc=Ze({});async function wd(n,t,e,r){if(Tc.value[t])return Tc.value[t];let i=await vd(n,{ServiceId:t,FirstTimeUnitStartUtc:J.formatForAPI(e),LastTimeUnitStartUtc:J.formatForAPI(r)}),o=bd(i);return Tc.value[t]=o,o}var Dd=(n,t)=>{let e={method:"POST",headers:ce.headers,body:JSON.stringify(t)};return Xe("/restrictions/getAll",e,n)};function Ed(n){if(!n||!n.Restrictions||!Array.isArray(n.Restrictions))throw new Error("Invalid service restrictions response format");return n.Restrictions}var Sc=Ze({});async function _d(n,t,e,r){if(Sc.value[t])return Sc.value[t];let i=await Dd(n,{ServiceIds:[t],CollidingUtc:{StartUtc:J.formatForAPI(e),EndUtc:J.formatForAPI(r)},Origin:"User"}),o=Ed(i);return Sc.value[t]=o,o}var Md=(n,t)=>{let e={method:"POST",headers:ce.headers,body:JSON.stringify(t)};return Xe("/rules/getAll",e,n)};function Td(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 Cc=Ze({});async function Sd(n,t){if(Cc.value[t])return Cc.value[t];let e=await Md(n,{ServiceIds:[t],Extent:{RuleActions:!0}}),r=Td(e);return Cc.value[t]=r,r}var Cd=(n,t)=>{let e={method:"POST",headers:ce.headers,body:JSON.stringify(t)};return Xe("/rates/getPricing",e,n)};var kc=Ze({});async function kd(n,t,e,r){if(kc.value[t])return kc.value[t];let i=await Cd(n,{RateId:t,FirstTimeUnitStartUtc:J.formatForAPI(e),LastTimeUnitStartUtc:J.formatForAPI(r)}),o=hd(i);return kc.value[t]=o,o}var ga=class{constructor(t,e){L(this,"enterprise");L(this,"rate",null);L(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 kd(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 ya=class{constructor(t,e){L(this,"enterprise");L(this,"service",null);L(this,"products",[]);L(this,"customerProducts",[]);L(this,"restrictions",[]);L(this,"availabilities",[]);L(this,"rules",[]);L(this,"ageCategories",[]);L(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 wd(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 _d(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 gd(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 fa(this.enterprise.getEnterpriseId(),this.service.id);if(this.rates=t.map(e=>new ga(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 Sd(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 ud(this.enterprise.getEnterpriseId()),this.ageCategories}getAgeCategories(){if(this.ageCategories.length===0)throw new Error("Age categories are not initialized");return this.ageCategories}};var ti=class{constructor(t){L(this,"enterpriseId");L(this,"services",[]);L(this,"reservableService",null);this.enterpriseId=t}async initServices(){this.services=await sd(this.enterpriseId);let t=this.services.find(e=>e.type.toLowerCase()==="reservable");return t&&(this.reservableService=new ya(this,t)),this.services}getEnterpriseId(){return this.enterpriseId}getServices(){return this.services}getReservableService(){return this.reservableService?.getService()??null}};var x,Ie,Dn,or,Pc=class{constructor(){_o(this,Dn);_o(this,x,tr({loading:!1,error:null,isFetching:!1,cmsApartmentData:{},enterpriseInstance:null,reservableService:null,startDate:null,endDate:null,rooms:[],couponCode:"",hotel:null,availabilities:null,rates:[],servicePricing:null,reservationPricing:null,serviceOnlyPricing:null,ageCategories:[],products:[],selectedRateId:null,be_pricing:null}));_o(this,Ie,{nightsCount:Xt(()=>!S(this,x).startDate||!S(this,x).endDate?0:S(this,x).startDate.until(S(this,x).endDate).days),selectedProducts:Xt(()=>S(this,x).products.filter(t=>t.selected)),maxAllowedRooms:Xt(()=>{if(!S(this,x).availabilities)return 0;let{categoryId:t}=S(this,x).cmsApartmentData,e=S(this,x).availabilities.CategoryAvailabilities.find(i=>i.CategoryId===t);return e?Math.min(...e.Availabilities.slice(0,-1)):0}),rates:Xt(()=>S(this,x).servicePricing?.Rates?S(this,x).servicePricing.Rates.map(t=>{let e=S(this,x).servicePricing?.RateGroups?.find(o=>o.Id===t.RateGroupId),i=S(this,x).servicePricing?.CategoryPrices.find(o=>o.CategoryId===S(this,x).cmsApartmentData.categoryId)?.OccupancyPrices.find(o=>{let a=S(this,x).rooms.flat(),s=Object.groupBy(a,u=>u.ageCategoryId),l={};return Object.entries(s).map(([u,h])=>{let p=h?.reduce((y,D)=>y+D.value,0);return l[u]=p||0,{ageCategoryId:u,totalPersons:p}}),o.Occupancies.every(u=>{let h=l[u.AgeCategoryId];return h===void 0||u.PersonCount===h})})?.RateGroupPrices?.find(o=>o.MinRateId===t.Id);return{id:t.Id,name:Je(t.Name),description:Je(t.Description),isPrivate:t.IsPrivate,currencyCode:t.CurrencyCode,ordering:t.Ordering,groupId:e?.Id??"",groupOrdering:e?.Ordering||0,price:i?.MinPrice,selected:!1}}).filter(t=>t.price!==void 0&&t.price.TotalAmount?.GrossValue!==void 0&&t.price.TotalAmount?.GrossValue>0):[]),summary:Xt(()=>{let t=S(this,x).reservationPricing?.OccupancyPrices??[],e=S(this,x).serviceOnlyPricing?.OccupancyPrices??[],r=S(this,x).cmsApartmentData?.name??"",{rooms:i}=S(this,x),o="EUR";if(S(this,x).isFetching||t.length===0||e.length===0)return{currency:o,nightCount:S(this,Ie).nightsCount.value,items:[],totals:{service:0,products:0,taxes:0,grandTotal:0}};let a=new Map;for(let D of e){let T=D.Pricing.find($=>$.RateId===S(this,x).selectedRateId);if(!T)continue;let N=T.Price.TotalAmount[o].Breakdown.Items.filter($=>$.TaxRateCode==="FR-R").reduce(($,G)=>$+G.NetValue,0);a.set(`${D.AdultCount}-${D.ChildCount}`,N)}let s=new Map;for(let D of t){let T=D.Pricing.find(oe=>oe.RateId===S(this,x).selectedRateId);if(!T)continue;let C=`${D.AdultCount}-${D.ChildCount}`,N=T.Price.TotalAmount[o],$=a.get(C)??0,G=S(this,Ie).nightsCount.value||1,W=$/G,ne=N.TaxValues.filter(oe=>oe.TaxRateCode==="FR-R").reduce((oe,Ce)=>oe+Ce.Value,0),le=N.GrossValue-$-ne;s.set(C,{rateId:T.RateId,pricing:{avgPerNight:W,service:$,products:le,taxes:ne,subtotal:N.GrossValue}})}let l=new Map;for(let D of i){let T=0,C=0;for(let $ of D)$.isAdult?T+=$.value:C+=$.value;let N=`${T}-${C}`;l.has(N)?l.get(N).quantity+=1:l.set(N,{adults:T,children:C,quantity:1})}if(!Array.from(l.keys()).every(D=>s.has(D)))return{currency:o,nightCount:S(this,Ie).nightsCount.value,items:[],totals:{service:0,products:0,taxes:0,grandTotal:0}};let p=Array.from(l.values()).map(D=>{let T=`${D.adults}-${D.children}`,C=s.get(T);return C?{key:T,roomName:r,occupancy:{adults:D.adults,children:D.children},quantity:D.quantity,rateId:C.rateId,pricing:C.pricing}:(console.warn(`[BookingState] Pricing not yet available for occupancy ${T}`,{availableOccupancies:Array.from(s.keys()),selectedRateId:S(this,x).selectedRateId,occupancyPricesCount:t.length}),{key:T,roomName:r,occupancy:{adults:D.adults,children:D.children},quantity:D.quantity,rateId:S(this,x).selectedRateId||"",pricing:{avgPerNight:0,service:0,products:0,taxes:0,subtotal:0}})}),y=p.reduce((D,T)=>(D.service+=T.pricing.service*T.quantity,D.products+=T.pricing.products*T.quantity,D.taxes+=T.pricing.taxes*T.quantity,D.grandTotal+=T.pricing.subtotal*T.quantity,D),{service:0,products:0,taxes:0,grandTotal:0});return{currency:o,nightCount:S(this,Ie).nightsCount.value,items:p,totals:y}}),totalStayPrice:Xt(()=>{let t=S(this,Ie).rates.value.find(e=>e.id===S(this,x).selectedRateId)?.price;return t?t.TotalAmount.GrossValue:0}),adultsCount:Xt(()=>S(this,x).rooms.reduce((t,e)=>t+e.reduce((r,i)=>r+(i.isAdult?i.value:0),0),0)),childrenCount:Xt(()=>S(this,x).rooms.reduce((t,e)=>t+e.reduce((r,i)=>r+(i.isAdult?0:i.value),0),0)),isAvailable:Xt(()=>{if(!S(this,x).availabilities)return!1;let{categoryId:t}=S(this,x).cmsApartmentData,e=S(this,x).availabilities.CategoryAvailabilities.find(r=>r.CategoryId===t);return e?e.Availabilities.slice(0,-1).every(r=>r>0):!1}),productsTotalPrice:Xt(()=>S(this,Ie).selectedProducts.value.reduce((e,r)=>{let i=0;switch(r.chargingMode){case"Once":i=r.price||0;break;case"PerTimeUnit":i=r.price*S(this,Ie).nightsCount.value||0;break;case"PerPersonPerTimeUnit":i=r.price*S(this,Ie).nightsCount.value*S(this,Ie).adultsCount.value||0;break;default:i=r.price}return e+i},0)),totalPrice:Xt(()=>S(this,Ie).totalStayPrice.value+S(this,Ie).productsTotalPrice.value),restrictionMessage:Xt(()=>{if(!S(this,x).availabilities)return null;let t=S(this,x).availabilities.ApplicableRestrictions??[];if(t.length===0)return null;let e=S(this,Ie).nightsCount.value;if(e===0)return null;let r=i=>{if(!i)return null;try{return Re.Duration.from(i).total({unit:"days"})}catch{return null}};for(let i of t){let{Exceptions:o}=i;if(o.MaxAdvance==null&&o.MinAdvance==null&&o.MaxLength==null&&o.MinLength==null&&o.MaxPrice==null&&o.MinPrice==null&&o.MaxReservationCount==null&&o.MinReservationCount==null)continue;let s=r(o.MinLength);if(s!==null&&e<s)return`${s} ${Be("minimumNights")}`;let l=r(o.MaxLength);if(l!==null&&e>l)return`${l} ${Be("maximumNights")}`}return null})})}get startDate(){return S(this,x).startDate}get endDate(){return S(this,x).endDate}get rooms(){return S(this,x).rooms}get couponCode(){return S(this,x).couponCode}get hotel(){return S(this,x).hotel}get availabilities(){return S(this,x).availabilities}get rates(){return S(this,x).rates}get servicePricing(){return S(this,x).servicePricing}get reservationPricing(){return S(this,x).reservationPricing}get ageCategories(){return S(this,x).ageCategories}get products(){return S(this,x).products}get selectedRateId(){return S(this,x).selectedRateId}get be_pricing(){return S(this,x).be_pricing}get cmsApartmentData(){return S(this,x).cmsApartmentData}get enterpriseInstance(){return S(this,x).enterpriseInstance}get reservableService(){return S(this,x).reservableService}get isFetching(){return S(this,x).isFetching}get nightsCount(){return S(this,Ie).nightsCount.value}get selectedProducts(){return S(this,Ie).selectedProducts.value}get maxAllowedRooms(){return S(this,Ie).maxAllowedRooms.value}get computedRates(){return S(this,Ie).rates.value}get computedSummary(){return S(this,Ie).summary.value}get totalStayPrice(){return S(this,Ie).totalStayPrice.value}get adultsCount(){return S(this,Ie).adultsCount.value}get childrenCount(){return S(this,Ie).childrenCount.value}get isAvailable(){return S(this,Ie).isAvailable.value}get productsTotalPrice(){return S(this,Ie).productsTotalPrice.value}get totalPrice(){return S(this,Ie).totalPrice.value}get restrictionMessage(){return S(this,Ie).restrictionMessage.value}setCmsApartmentData(t){S(this,x).cmsApartmentData=t,$n(this,Dn,or).call(this)}updateStartDate(t){S(this,x).startDate=t,t&&(Yt.startDate=t.toString()),$n(this,Dn,or).call(this)}updateEndDate(t){S(this,x).endDate=t,t&&(Yt.endDate=t.toString()),$n(this,Dn,or).call(this)}updateRooms(t){S(this,x).rooms=t,$n(this,Dn,or).call(this)}updateCouponCode(t){S(this,x).couponCode=t,$n(this,Dn,or).call(this)}updateSelectedRateId(t){S(this,x).selectedRateId=t,$n(this,Dn,or).call(this)}updateProducts(t){S(this,x).products=t,$n(this,Dn,or).call(this)}async initializeResources(t){S(this,x).loading=!0,S(this,x).error=null;try{S(this,x).enterpriseInstance=new ti(t),await S(this,x).enterpriseInstance.initServices(),S(this,x).reservableService=S(this,x).enterpriseInstance.reservableService,await S(this,x).reservableService?.initAgeCategories(),S(this,x).ageCategories=S(this,x).reservableService?.getAgeCategories()||[]}catch(e){let r=e instanceof Error?e.message:"Unknown error";throw S(this,x).error=r,console.error("[BXT] initializeResources: Error",e),e}finally{S(this,x).loading=!1}}async initializeRooms(t=1,e=1){(Yt.rooms==null||Yt.rooms<1)&&(Yt.rooms=t);let r=[];for(let i=0;i<(Yt.rooms||t);i++){let o=S(this,x).ageCategories.map(a=>{let s=a.classification.toLowerCase()==="adult",l=s?Be("adults"):Be("children"),u=s?i===0&&(Yt.guests||e)||1:0;return{isAdult:s,ageCategoryId:a.id,name:l,value:u}});r.push(o)}S(this,x).rooms=r}async fetchHotel(t){S(this,x).loading=!0,S(this,x).error=null,S(this,x).isFetching=!0;try{let e=await nd(t);S(this,x).hotel=e,S(this,x).products=e?.Products.map(r=>({id:r.Id,name:Je(r.Name),description:Je(r.Description),categoryId:r.CategoryId,ordering:r.Ordering,imageIds:[r.ImageId],price:r.Prices.EUR,chargingMode:r.ChargingMode,selected:!1}))||[]}catch(e){let r=e instanceof Error?e.message:"Unknown error";throw S(this,x).error=r,console.error("[BXT] fetchHotel: Error",e),e}finally{S(this,x).loading=!1,S(this,x).isFetching=!1}}async fetchAvailability(t,e){if(!S(this,x).startDate||!S(this,x).endDate){console.warn("[BXT] fetchAvailability: Start date or end date is not set, skipping");return}if(J.isBefore(S(this,x).startDate,S(this,x).endDate)){console.warn("[BXT] fetchAvailability: Invalid date range, skipping");return}S(this,x).loading=!0,S(this,x).isFetching=!0;try{let r=J.formatForAPI(S(this,x).startDate),i=J.formatForAPI(S(this,x).endDate),o=await rd(t,{EnterpriseId:t,CategoryIds:[e],StartUtc:r,EndUtc:i,ServiceId:S(this,x).reservableService?.getService()?.id||"",Client:ce.bookingEngineClient,LanguageCode:"fr-FR"});S(this,x).availabilities=o}catch(r){let i=r instanceof Error?r.message:"Unknown error";throw S(this,x).error=i,console.error("[BXT] fetchAvailability: Error",r),r}finally{S(this,x).loading=!1,S(this,x).isFetching=!1}}async fetchServicePricing(t,e){if(!S(this,x).startDate||!S(this,x).endDate){console.warn("[BXT] fetchServicePricing: Start date or end date is not set, skipping");return}if(J.isBefore(S(this,x).startDate,S(this,x).endDate)){console.warn("[BXT] fetchServicePricing: Invalid date range, skipping");return}S(this,x).loading=!0,S(this,x).isFetching=!0;try{let r=J.formatForAPI(S(this,x).startDate),i=J.formatForAPI(S(this,x).endDate),o=await id(t,{Client:ce.bookingEngineClient,EnterpriseId:t,StartUtc:r,EndUtc:i,ServiceId:S(this,x).reservableService?.getService()?.id||"",CategoryIds:[e],CurrencyCode:"EUR",voucherCode:S(this,x).couponCode||void 0});S(this,x).servicePricing=o}catch(r){let i=r instanceof Error?r.message:"Unknown error";throw S(this,x).error=i,console.error("[BXT] fetchServicePricing: Error",r),r}finally{S(this,x).loading=!1,S(this,x).isFetching=!1}}async fetchReservationPricing(t,e){if(!S(this,x).startDate||!S(this,x).endDate){console.warn("[BXT] fetchReservationPricing: Start date or end date is not set, skipping");return}if(J.isBefore(S(this,x).startDate,S(this,x).endDate)){console.warn("[BXT] fetchReservationPricing: Invalid date range, skipping");return}if(S(this,x).rooms.length===0){console.error("[BXT] fetchReservationPricing: No rooms set, skipping");return}S(this,x).loading=!0,S(this,x).isFetching=!0;try{let r=J.formatForAPI(S(this,x).startDate),i=J.formatForAPI(S(this,x).endDate),o=S(this,x).rooms.map(h=>({OccupancyData:h.filter(p=>p.value>0).map(p=>({AgeCategoryId:p.ageCategoryId,PersonCount:p.value}))})),a=S(this,Ie).selectedProducts.value.map(h=>h.id),s={Client:ce.bookingEngineClient,HotelId:t,StartUtc:r,EndUtc:i,RoomCategoryId:e,VoucherCode:S(this,x).couponCode||void 0,Occupancies:o},l,u;return a.length===0?(l=await pa(t,{...s,ProductIds:[]}),u=l):[l,u]=await Promise.all([pa(t,{...s,ProductIds:a}),pa(t,{...s,ProductIds:[]})]),S(this,x).reservationPricing=l,S(this,x).serviceOnlyPricing=u,S(this,x).be_pricing=l,l}catch(r){let i=r instanceof Error?r.message:"Unknown error";throw S(this,x).error=i,console.error("[BXT] fetchReservationPricing: Error",r),r}finally{S(this,x).loading=!1,S(this,x).isFetching=!1}}async fetchRates(t){if(!S(this,x).reservableService||!S(this,x).reservableService.getService()){console.warn("[BXT] fetchRates: No reservable service found, skipping");return}S(this,x).loading=!0;try{let e=S(this,x).reservableService.getService()?.id;S(this,x).rates=await fa(t,e)}catch(e){let r=e instanceof Error?e.message:"Unknown error";throw S(this,x).error=r,console.error("[BXT] fetchRates: Error",e),e}finally{S(this,x).loading=!1}}async fetchAllData(t,e){try{await this.initializeResources(t),await this.initializeRooms(),await this.fetchHotel(t),await this.fetchAvailability(t,e),await this.fetchServicePricing(t,e),await this.fetchReservationPricing(t,e),await this.fetchRates(t)}catch(r){throw console.error("[BXT] fetchAllData: Error in batch fetch",r),r}}getReadonlyState(){return Jr({...S(this,x),computed:{nightsCount:this.nightsCount,adultsCount:this.adultsCount,childrenCount:this.childrenCount,maxAllowedRooms:this.maxAllowedRooms,isAvailable:this.isAvailable,rates:this.computedRates,summary:this.computedSummary,totalStayPrice:this.totalStayPrice,productsTotalPrice:this.productsTotalPrice,totalPrice:this.totalPrice}})}getState(){let{enterpriseInstance:t,reservableService:e,...r}=S(this,x);return{...JSON.parse(JSON.stringify(r)),computed:{nightsCount:this.nightsCount,adultsCount:this.adultsCount,childrenCount:this.childrenCount,maxAllowedRooms:this.maxAllowedRooms,isAvailable:this.isAvailable,rates:this.computedRates,summary:this.computedSummary,totalStayPrice:this.totalStayPrice,productsTotalPrice:this.productsTotalPrice,totalPrice:this.totalPrice}}}};x=new WeakMap,Ie=new WeakMap,Dn=new WeakSet,or=function(){S(this,x).isFetching};var F=new Pc;var Pd=()=>{};function xt(n,t,e,r){return n?(n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)):Pd}var va=n=>n instanceof HTMLInputElement;var Rc=(n,t)=>(Array.isArray(t)||(t=[t]),t.map(r=>n.dispatchEvent(new Event(r,{bubbles:!0}))).every(r=>r));var lt=(n,t=!0)=>n.cloneNode(t);var mo=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=va(e)?e.value:""}return t.toString()};var Ic=(n,t)=>{n.querySelectorAll(t||"*").forEach(r=>r.remove())};var po=(n,t)=>{let{type:e}=n,r=e==="radio";if(r||e==="checkbox"){if(!va(n)||typeof t!="boolean"||t===n.checked||r&&t===!1)return;n.checked=t}else{if(n.value===t)return;n.value=t.toString()}Rc(n,["click","input","change"])};function Rd(n,t){return{rate:n,pricing:t}}function xc(n){return n.isActive&&n.isEnabled&&n.isPublic&&!n.hideFromGuest}function Id(n,t){let e=t.filter(o=>zm(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=>Um(n,o.Exceptions)))}function zm(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=J.fromString(e);return t.Days.includes(r.toLocaleString("en-US",{weekday:"long"}))})&&!0}function ba(n){if(!n)return null;try{return Re.Duration.from(n).total({unit:"days"})}catch{return null}}function Um(n,t){let e=J.fromString(n.pricing?.datesUtc[0]),r=J.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=J.getCurrentDate(),a=e.since(o,{largestUnit:"day"}).days,s=ba(t.MinAdvance),l=ba(t.MaxAdvance),u=ba(t.MinLength),h=ba(t.MaxLength);return!!(u&&i<u||h&&i>h||s&&a<s||l&&a>l||!t.MinLength&&!t.MaxLength&&!t.MinAdvance&&!t.MaxAdvance)}var xd=(n,t)=>{let e=n.find(s=>s.rate.isBaseRate),r=n.filter(s=>!Id(s,t)&&xc(s.rate)),i=Object.groupBy(r,s=>s.rate.group?.Name||"unknown"),o=md(r),a=Vm(o);return{baseRate:e,allowedRates:r,groupedRates:i,datedPrices:o,lowestDatedPrices:a}};function Vm(n){let t={};for(let[e,r]of Object.entries(n)){let i=1/0,o=r.filter(a=>xc(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 Ad=async n=>{let t=await Promise.all(n.map(async r=>{let i=new ti(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 h=await u.initPricing(J.formatForAPI(vc.toString()),J.formatForAPI(Xu.toString()));return Rd(u.getRate(),h)}));return xd(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 Qe=class Qe extends Date{constructor(e=null,r="YYYY-MM-DD",i="en-US"){super(Qe.parseDateTime(e,r,i));L(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 Qe)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=Qe.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,h]of Object.entries(o)){let p=Number(u),{group:y,pattern:D}=Qe.formatPatterns(h[0],i);s[y]=p+1,s.value+=D,s.value+=".*?"}let l=new RegExp(`^${s.value}$`);if(l.test(e)){let u=l.exec(e),h=Number(u[s.year]),p=null;s.month?p=Number(u[s.month])-1:s.shortMonth?p=Qe.shortMonths(i).indexOf(u[s.shortMonth]):s.longMonth&&(p=Qe.longMonths(i).indexOf(u[s.longMonth]));let y=Number(u[s.day])||1,D=Number(u[s.hour]),T=Number.isNaN(D)?0:D,C=Number(u[s.minute]),N=Number.isNaN(C)?0:C,$=Number(u[s.second]),G=Number.isNaN($)?0:$,W=u[s.ampm];return W&&W==="PM"&&(T+=12,T===24&&(T=0)),new Date(h,p,y,T,N,G,0)}}}return new Date(new Date().setHours(0,0,0,0))}static shortMonths(e){return Qe.MONTH_JS.map(r=>new Date(2019,r).toLocaleString(e,{month:"short"}))}static longMonths(e){return Qe.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:`(${Qe.shortMonths(r).join("|")})`};case"MMMM":return{group:"longMonth",pattern:`(${Qe.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 Qe(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=Qe.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 Qe.shortMonths(r)[this.getMonth()];case"MMMM":return Qe.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""}}};L(Qe,"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),L(Qe,"MONTH_JS",[0,1,2,3,4,5,6,7,8,9,10,11]);var ge=Qe,Ac=class{constructor(t){L(this,"picker");this.picker=t}render(t,e){t||(t=new ge),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 ge(this.picker.options.date):null,r=new ge,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}},Lc=class{constructor(t){L(this,"picker");L(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()}},wa=class{constructor(t){L(this,"Calendar",new Ac(this));L(this,"PluginManager",new Lc(this));L(this,"calendars",[]);L(this,"datePicked",[]);L(this,"cssLoaded",0);L(this,"binds",{hidePicker:this.hidePicker.bind(this),show:this.show.bind(this)});L(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:[]});L(this,"ui",{container:null,shadowRoot:null,wrapper:null});L(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 ge(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 ge(t,this.options.format);this.options.date=e.clone(),this.updateValues(),this.calendars.length&&this.renderAll()}getDate(){return this.options.date instanceof ge?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 ge(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 ge(this.options.date,this.options.format):this.calendars[0]=new ge}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}}},Ma=Object.freeze({__proto__:null,Core:wa,create:wa}),fo=class{constructor(){L(this,"picker");L(this,"options");L(this,"priority",0);L(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()}},Da=class extends fo{constructor(){super(...arguments);L(this,"priority",1);L(this,"binds",{onView:this.onView.bind(this)});L(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 ge(this.options.minDate,this.picker.options.format,this.picker.options.lang)),this.options.maxDate&&(this.options.maxDate=new ge(this.options.maxDate,this.picker.options.format,this.picker.options.lang),this.options.maxDate instanceof ge&&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 ge&&o.isSameOrBefore(this.options.minDate,"month")&&i.classList.add("no-previous-month"),this.options.maxDate instanceof ge&&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,h=!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)){h=!0;break}l.subtract(1,"day")}u&&h&&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 ge(Number(i.dataset.start)),s=new ge(Number(i.dataset.end)),l=s.diff(a,"day"),u=this.options.minDays&&l<this.options.minDays,h=this.options.maxDays&&l>this.options.maxDays;(u||h||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 ge&&e.isBefore(this.options.minDate,"day")}lockMaxDate(e){return this.options.maxDate instanceof ge&&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 Ea=class extends fo{constructor(){super(...arguments);L(this,"tooltipElement");L(this,"triggerElement");L(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)});L(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 ge(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 ge(e,this.picker.options.format);this.options.startDate=r?r.clone():null,this.updateValues(),this.picker.renderAll()}setEndDate(e){let r=new ge(e,this.picker.options.format);this.options.endDate=r?r.clone():null,this.updateValues(),this.picker.renderAll()}setDateRange(e,r){let i=new ge(e,this.picker.options.format),o=new ge(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 ge(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 ge(l.dataset.time),h=this.picker.Calendar.getCalendarDayView(u);u.isBetween(o,a)&&h.classList.add("in-range"),u.isSame(this.picker.datePicked[0],"day")&&(h.classList.add("start"),h.classList.toggle("flipped",s)),l===i&&(h.classList.add("end"),h.classList.toggle("flipped",s)),l.className=h.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),h=`${l} ${this.options.locale[u]}`;this.showTooltip(i,h)}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 ge(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 _a=class extends fo{constructor(){super(...arguments);L(this,"rangePlugin");L(this,"lockPlugin");L(this,"priority",10);L(this,"binds",{onView:this.onView.bind(this),onColorScheme:this.onColorScheme.bind(this)});L(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>'}});L(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 h=document.createElement("option"),p=new ge(new Date(o.getFullYear(),u,2,0,0,0)),y=new ge(new Date(o.getFullYear(),u,1,0,0,0));h.value=String(u),h.text=p.toLocaleString(this.picker.options.lang,{month:"long"}),this.lockPlugin&&(h.disabled=this.lockPlugin.options.minDate&&y.isBefore(new ge(this.lockPlugin.options.minDate),"month")||this.lockPlugin.options.maxDate&&y.isAfter(new ge(this.lockPlugin.options.maxDate),"month")),h.selected=y.getMonth()===o.getMonth(),l.appendChild(h)}l.addEventListener("change",u=>{let h=u.target;this.picker.calendars[0].setDate(1),this.picker.calendars[0].setMonth(Number(h.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,h=this.options.dropdown.maxYear?this.options.dropdown.maxYear:new Date().getFullYear();if(o.getFullYear()>h){let p=document.createElement("option");p.value=String(o.getFullYear()),p.text=String(o.getFullYear()),p.selected=!0,p.disabled=!0,l.appendChild(p)}for(let p=h;p>=u;p-=1){let y=document.createElement("option"),D=new ge(new Date(p,0,1,0,0,0));y.value=String(p),y.text=String(p),this.lockPlugin&&(y.disabled=this.lockPlugin.options.minDate&&D.isBefore(new ge(this.lockPlugin.options.minDate),"year")||this.lockPlugin.options.maxDate&&D.isAfter(new ge(this.lockPlugin.options.maxDate),"year")),y.selected=o.getFullYear()===p,l.appendChild(y)}if(o.getFullYear()<u){let p=document.createElement("option");p.value=String(o.getFullYear()),p.text=String(o.getFullYear()),p.selected=!0,p.disabled=!0,l.appendChild(p)}if(this.options.dropdown.years==="asc"){let p=Array.prototype.slice.call(l.childNodes).reverse();l.innerHTML="",p.forEach(y=>{y.innerHTML=y.value,l.appendChild(y)})}l.addEventListener("change",p=>{let y=p.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 ge(o.dataset.time);else{let h=i.querySelector(".day");s=new ge(h.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 Ta=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],ar={_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 Sa={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},Ca=Sa;var ut=function(n,t){return t===void 0&&(t=2),("000"+n).slice(t*-1)},$t=function(n){return n===!0?1:0};function Nc(n,t){var e;return function(){var r=this,i=arguments;clearTimeout(e),e=setTimeout(function(){return n.apply(r,i)},t)}}var ka=function(n){return n instanceof Array?n:[n]};function dt(n,t,e){if(e===!0)return n.classList.add(t);n.classList.remove(t)}function Se(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 go(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Oc(n,t){if(t(n))return n;if(n.parentNode)return Oc(n.parentNode,t)}function yo(n,t){var e=Se("div","numInputWrapper"),r=Se("input","numInput "+n),i=Se("span","arrowUp"),o=Se("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 jt(n){try{if(typeof n.composedPath=="function"){var t=n.composedPath();return t[0]}return n.target}catch{return n.target}}var Hc=function(){},vo=function(n,t,e){return e.months[t?"shorthand":"longhand"][n]},Ld={D:Hc,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*$t(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:Hc,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:Hc,y:function(n,t){n.setFullYear(2e3+parseFloat(t))}},Fn={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})"},ni={Z:function(n){return n.toISOString()},D:function(n,t,e){return t.weekdays.shorthand[ni.w(n,t,e)]},F:function(n,t,e){return vo(ni.n(n,t,e)-1,!1,t)},G:function(n,t,e){return ut(ni.h(n,t,e))},H:function(n){return ut(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[$t(n.getHours()>11)]},M:function(n,t){return vo(n.getMonth(),!0,t)},S:function(n){return ut(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,t,e){return e.getWeek(n)},Y:function(n){return ut(n.getFullYear(),4)},d:function(n){return ut(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return ut(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,t){return t.weekdays.longhand[n.getDay()]},m:function(n){return ut(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 Bc=function(n){var t=n.config,e=t===void 0?ar:t,r=n.l10n,i=r===void 0?Sa:r,o=n.isMobile,a=o===void 0?!1:o;return function(s,l,u){var h=u||i;return e.formatDate!==void 0&&!a?e.formatDate(s,l,h):l.split("").map(function(p,y,D){return ni[p]&&D[y-1]!=="\\"?ni[p](s,h,e):p!=="\\"?p:""}).join("")}},Pa=function(n){var t=n.config,e=t===void 0?ar:t,r=n.l10n,i=r===void 0?Sa:r;return function(o,a,s,l){if(!(o!==0&&!o)){var u=l||i,h,p=o;if(o instanceof Date)h=new Date(o.getTime());else if(typeof o!="string"&&o.toFixed!==void 0)h=new Date(o);else if(typeof o=="string"){var y=a||(e||ar).dateFormat,D=String(o).trim();if(D==="today")h=new Date,s=!0;else if(e&&e.parseDate)h=e.parseDate(o,y);else if(/Z$/.test(D)||/GMT$/.test(D))h=new Date(o);else{for(var T=void 0,C=[],N=0,$=0,G="";N<y.length;N++){var W=y[N],ne=W==="\\",le=y[N-1]==="\\"||ne;if(Fn[W]&&!le){G+=Fn[W];var oe=new RegExp(G).exec(o);oe&&(T=!0)&&C[W!=="Y"?"push":"unshift"]({fn:Ld[W],val:oe[++$]})}else ne||(G+=".")}h=!e||!e.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),C.forEach(function(Ce){var Te=Ce.fn,se=Ce.val;return h=Te(h,se,u)||h}),h=T?h:void 0}}if(!(h instanceof Date&&!isNaN(h.getTime()))){e.errorHandler(new Error("Invalid date provided: "+p));return}return s===!0&&h.setHours(0,0,0,0),h}}};function zt(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 Nd=function(n,t,e){return n>Math.min(t,e)&&n<Math.max(t,e)},Ra=function(n,t,e){return n*3600+t*60+e},Od=function(n){var t=Math.floor(n/3600),e=(n-t*3600)/60;return[t,e,n-t*3600-e*60]},Hd={DAY:864e5};function Ia(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 ht=function(){return ht=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},ht.apply(this,arguments)},Bd=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},qm=300;function Wm(n,t){var e={config:ht(ht({},ar),We.defaultConfig),l10n:Ca};e.parseDate=Pa({config:e.config,l10n:e.l10n}),e._handlers=[],e.pluginElements=[],e.loadedPlugins=[],e._bind=C,e._setHoursFromDate=y,e._positionCalendar=Yn,e.changeMonth=_,e.changeYear=re,e.clear=R,e.close=P,e.onMouseOver=we,e._createElement=Se,e.createDay=oe,e.destroy=j,e.isEnabled=Z,e.jumpToDate=G,e.updateValue=En,e.open=Oe,e.redraw=wo,e.set=qd,e.setDate=Wd,e.toggle=Jd;function r(){e.utils={getDaysInMonth:function(f,b){return f===void 0&&(f=e.currentMonth),b===void 0&&(b=e.currentYear),f===1&&(b%4===0&&b%100!==0||b%400===0)?29:e.l10n.daysInMonth[f]}}}function i(){e.element=e.input=n,e.isOpen=!1,ot(),sr(),Kd(),Gd(),r(),e.isMobile||le(),$(),(e.selectedDates.length||e.config.noCalendar)&&(e.config.enableTime&&y(e.config.noCalendar?e.latestSelectedDateObj:void 0),En(!1)),s();var f=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!e.isMobile&&f&&Yn(),Fe("onReady")}function o(){var f;return((f=e.calendarContainer)===null||f===void 0?void 0:f.getRootNode()).activeElement||document.activeElement}function a(f){return f.bind(e)}function s(){var f=e.config;f.weekNumbers===!1&&f.showMonths===1||f.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 b=(e.days.offsetWidth+1)*f.showMonths;e.daysContainer.style.width=b+"px",e.calendarContainer.style.width=b+(e.weekWrapper!==void 0?e.weekWrapper.offsetWidth:0)+"px",e.calendarContainer.style.removeProperty("visibility"),e.calendarContainer.style.removeProperty("display")}})}function l(f){if(e.selectedDates.length===0){var b=e.config.minDate===void 0||zt(new Date,e.config.minDate)>=0?new Date:new Date(e.config.minDate.getTime()),M=Ia(e.config);b.setHours(M.hours,M.minutes,M.seconds,b.getMilliseconds()),e.selectedDates=[b],e.latestSelectedDateObj=b}f!==void 0&&f.type!=="blur"&&eh(f);var A=e._input.value;p(),En(),e._input.value!==A&&e._debouncedChange()}function u(f,b){return f%12+12*$t(b===e.l10n.amPM[1])}function h(f){switch(f%24){case 0:case 12:return 12;default:return f%12}}function p(){if(!(e.hourElement===void 0||e.minuteElement===void 0)){var f=(parseInt(e.hourElement.value.slice(-2),10)||0)%24,b=(parseInt(e.minuteElement.value,10)||0)%60,M=e.secondElement!==void 0?(parseInt(e.secondElement.value,10)||0)%60:0;e.amPM!==void 0&&(f=u(f,e.amPM.textContent));var A=e.config.minTime!==void 0||e.config.minDate&&e.minDateHasTime&&e.latestSelectedDateObj&&zt(e.latestSelectedDateObj,e.config.minDate,!0)===0,q=e.config.maxTime!==void 0||e.config.maxDate&&e.maxDateHasTime&&e.latestSelectedDateObj&&zt(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=Ra(e.config.minTime.getHours(),e.config.minTime.getMinutes(),e.config.minTime.getSeconds()),ye=Ra(e.config.maxTime.getHours(),e.config.maxTime.getMinutes(),e.config.maxTime.getSeconds()),te=Ra(f,b,M);if(te>ye&&te<Q){var De=Od(Q);f=De[0],b=De[1],M=De[2]}}else{if(q){var ee=e.config.maxTime!==void 0?e.config.maxTime:e.config.maxDate;f=Math.min(f,ee.getHours()),f===ee.getHours()&&(b=Math.min(b,ee.getMinutes())),b===ee.getMinutes()&&(M=Math.min(M,ee.getSeconds()))}if(A){var de=e.config.minTime!==void 0?e.config.minTime:e.config.minDate;f=Math.max(f,de.getHours()),f===de.getHours()&&b<de.getMinutes()&&(b=de.getMinutes()),b===de.getMinutes()&&(M=Math.max(M,de.getSeconds()))}}D(f,b,M)}}function y(f){var b=f||e.latestSelectedDateObj;b&&b instanceof Date&&D(b.getHours(),b.getMinutes(),b.getSeconds())}function D(f,b,M){e.latestSelectedDateObj!==void 0&&e.latestSelectedDateObj.setHours(f%24,b,M||0,0),!(!e.hourElement||!e.minuteElement||e.isMobile)&&(e.hourElement.value=ut(e.config.time_24hr?f:(12+f)%12+12*$t(f%12===0)),e.minuteElement.value=ut(b),e.amPM!==void 0&&(e.amPM.textContent=e.l10n.amPM[$t(f>=12)]),e.secondElement!==void 0&&(e.secondElement.value=ut(M)))}function T(f){var b=jt(f),M=parseInt(b.value)+(f.delta||0);(M/1e3>1||f.key==="Enter"&&!/[^\d]/.test(M.toString()))&&re(M)}function C(f,b,M,A){if(b instanceof Array)return b.forEach(function(q){return C(f,q,M,A)});if(f instanceof Array)return f.forEach(function(q){return C(q,b,M,A)});f.addEventListener(b,M,A),e._handlers.push({remove:function(){return f.removeEventListener(b,M,A)}})}function N(){Fe("onChange")}function $(){if(e.config.wrap&&["open","close","toggle","clear"].forEach(function(M){Array.prototype.forEach.call(e.element.querySelectorAll("[data-"+M+"]"),function(A){return C(A,"click",e[M])})}),e.isMobile){Zd();return}var f=Nc(_e,50);if(e._debouncedChange=Nc(N,qm),e.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&C(e.daysContainer,"mouseover",function(M){e.config.mode==="range"&&we(jt(M))}),C(e._input,"keydown",pe),e.calendarContainer!==void 0&&C(e.calendarContainer,"keydown",pe),!e.config.inline&&!e.config.static&&C(window,"resize",f),window.ontouchstart!==void 0?C(window.document,"touchstart",X):C(window.document,"mousedown",X),C(window.document,"focus",X,{capture:!0}),e.config.clickOpens===!0&&(C(e._input,"focus",e.open),C(e._input,"click",e.open)),e.daysContainer!==void 0&&(C(e.monthNav,"click",Qd),C(e.monthNav,["keyup","increment"],T),C(e.daysContainer,"click",$c)),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0){var b=function(M){return jt(M).select()};C(e.timeContainer,["increment"],l),C(e.timeContainer,"blur",l,{capture:!0}),C(e.timeContainer,"click",W),C([e.hourElement,e.minuteElement],["focus","click"],b),e.secondElement!==void 0&&C(e.secondElement,"focus",function(){return e.secondElement&&e.secondElement.select()}),e.amPM!==void 0&&C(e.amPM,"click",function(M){l(M)})}e.config.allowInput&&C(e._input,"blur",ue)}function G(f,b){var M=f!==void 0?e.parseDate(f):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),A=e.currentYear,q=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)}b&&e.currentYear!==A&&(Fe("onYearChange"),ae()),b&&(e.currentYear!==A||e.currentMonth!==q)&&Fe("onMonthChange"),e.redraw()}function W(f){var b=jt(f);~b.className.indexOf("arrow")&&ne(f,b.classList.contains("arrowUp")?1:-1)}function ne(f,b,M){var A=f&&jt(f),q=M||A&&A.parentNode&&A.parentNode.firstChild,Q=Ya("increment");Q.delta=b,q&&q.dispatchEvent(Q)}function le(){var f=window.document.createDocumentFragment();if(e.calendarContainer=Se("div","flatpickr-calendar"),e.calendarContainer.tabIndex=-1,!e.config.noCalendar){if(f.appendChild(c()),e.innerContainer=Se("div","flatpickr-innerContainer"),e.config.weekNumbers){var b=w(),M=b.weekWrapper,A=b.weekNumbers;e.innerContainer.appendChild(M),e.weekNumbers=A,e.weekWrapper=M}e.rContainer=Se("div","flatpickr-rContainer"),e.rContainer.appendChild(v()),e.daysContainer||(e.daysContainer=Se("div","flatpickr-days"),e.daysContainer.tabIndex=-1),Y(),e.rContainer.appendChild(e.daysContainer),e.innerContainer.appendChild(e.rContainer),f.appendChild(e.innerContainer)}e.config.enableTime&&f.appendChild(d()),dt(e.calendarContainer,"rangeMode",e.config.mode==="range"),dt(e.calendarContainer,"animate",e.config.animate===!0),dt(e.calendarContainer,"multiMonth",e.config.showMonths>1),e.calendarContainer.appendChild(f);var q=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&&(!q&&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=Se("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 oe(f,b,M,A){var q=Z(b,!0),Q=Se("span",f,b.getDate().toString());return Q.dateObj=b,Q.$i=A,Q.setAttribute("aria-label",e.formatDate(b,e.config.ariaDateFormat)),f.indexOf("hidden")===-1&&zt(b,e.now)===0&&(e.todayDateElem=Q,Q.classList.add("today"),Q.setAttribute("aria-current","date")),q?(Q.tabIndex=-1,$a(b)&&(Q.classList.add("selected"),e.selectedDateElem=Q,e.config.mode==="range"&&(dt(Q,"startRange",e.selectedDates[0]&&zt(b,e.selectedDates[0],!0)===0),dt(Q,"endRange",e.selectedDates[1]&&zt(b,e.selectedDates[1],!0)===0),f==="nextMonthDay"&&Q.classList.add("inRange")))):Q.classList.add("flatpickr-disabled"),e.config.mode==="range"&&Xd(b)&&!$a(b)&&Q.classList.add("inRange"),e.weekNumbers&&e.config.showMonths===1&&f!=="prevMonthDay"&&A%7===6&&e.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+e.config.getWeek(b)+"</span>"),Fe("onDayCreate",Q),Q}function Ce(f){f.focus(),e.config.mode==="range"&&we(f)}function Te(f){for(var b=f>0?0:e.config.showMonths-1,M=f>0?e.config.showMonths:-1,A=b;A!=M;A+=f)for(var q=e.daysContainer.children[A],Q=f>0?0:q.children.length-1,ye=f>0?q.children.length:-1,te=Q;te!=ye;te+=f){var De=q.children[te];if(De.className.indexOf("hidden")===-1&&Z(De.dateObj))return De}}function se(f,b){for(var M=f.className.indexOf("Month")===-1?f.dateObj.getMonth():e.currentMonth,A=b>0?e.config.showMonths:-1,q=b>0?1:-1,Q=M-e.currentMonth;Q!=A;Q+=q)for(var ye=e.daysContainer.children[Q],te=M-e.currentMonth===Q?f.$i+b:b<0?ye.children.length-1:0,De=ye.children.length,ee=te;ee>=0&&ee<De&&ee!=(b>0?De:-1);ee+=q){var de=ye.children[ee];if(de.className.indexOf("hidden")===-1&&Z(de.dateObj)&&Math.abs(f.$i-ee)>=Math.abs(b))return Ce(de)}e.changeMonth(q),B(Te(q),0)}function B(f,b){var M=o(),A=V(M||document.body),q=f!==void 0?f:A?M:e.selectedDateElem!==void 0&&V(e.selectedDateElem)?e.selectedDateElem:e.todayDateElem!==void 0&&V(e.todayDateElem)?e.todayDateElem:Te(b>0?1:-1);q===void 0?e._input.focus():A?se(q,b):Ce(q)}function z(f,b){for(var M=(new Date(f,b,1).getDay()-e.l10n.firstDayOfWeek+7)%7,A=e.utils.getDaysInMonth((b-1+12)%12,f),q=e.utils.getDaysInMonth(b,f),Q=window.document.createDocumentFragment(),ye=e.config.showMonths>1,te=ye?"prevMonthDay hidden":"prevMonthDay",De=ye?"nextMonthDay hidden":"nextMonthDay",ee=A+1-M,de=0;ee<=A;ee++,de++)Q.appendChild(oe("flatpickr-day "+te,new Date(f,b-1,ee),ee,de));for(ee=1;ee<=q;ee++,de++)Q.appendChild(oe("flatpickr-day",new Date(f,b,ee),ee,de));for(var xe=q+1;xe<=42-M&&(e.config.showMonths===1||de%7!==0);xe++,de++)Q.appendChild(oe("flatpickr-day "+De,new Date(f,b+1,xe%q),xe,de));var dn=Se("div","dayContainer");return dn.appendChild(Q),dn}function Y(){if(e.daysContainer!==void 0){go(e.daysContainer),e.weekNumbers&&go(e.weekNumbers);for(var f=document.createDocumentFragment(),b=0;b<e.config.showMonths;b++){var M=new Date(e.currentYear,e.currentMonth,1);M.setMonth(e.currentMonth+b),f.appendChild(z(M.getFullYear(),M.getMonth()))}e.daysContainer.appendChild(f),e.days=e.daysContainer.firstChild,e.config.mode==="range"&&e.selectedDates.length===1&&we()}}function ae(){if(!(e.config.showMonths>1||e.config.monthSelectorType!=="dropdown")){var f=function(A){return e.config.minDate!==void 0&&e.currentYear===e.config.minDate.getFullYear()&&A<e.config.minDate.getMonth()?!1:!(e.config.maxDate!==void 0&&e.currentYear===e.config.maxDate.getFullYear()&&A>e.config.maxDate.getMonth())};e.monthsDropdownContainer.tabIndex=-1,e.monthsDropdownContainer.innerHTML="";for(var b=0;b<12;b++)if(f(b)){var M=Se("option","flatpickr-monthDropdown-month");M.value=new Date(e.currentYear,b).getMonth().toString(),M.textContent=vo(b,e.config.shorthandCurrentMonth,e.l10n),M.tabIndex=-1,e.currentMonth===b&&(M.selected=!0),e.monthsDropdownContainer.appendChild(M)}}}function g(){var f=Se("div","flatpickr-month"),b=window.document.createDocumentFragment(),M;e.config.showMonths>1||e.config.monthSelectorType==="static"?M=Se("span","cur-month"):(e.monthsDropdownContainer=Se("select","flatpickr-monthDropdown-months"),e.monthsDropdownContainer.setAttribute("aria-label",e.l10n.monthAriaLabel),C(e.monthsDropdownContainer,"change",function(ye){var te=jt(ye),De=parseInt(te.value,10);e.changeMonth(De-e.currentMonth),Fe("onMonthChange")}),ae(),M=e.monthsDropdownContainer);var A=yo("cur-year",{tabindex:"-1"}),q=A.getElementsByTagName("input")[0];q.setAttribute("aria-label",e.l10n.yearAriaLabel),e.config.minDate&&q.setAttribute("min",e.config.minDate.getFullYear().toString()),e.config.maxDate&&(q.setAttribute("max",e.config.maxDate.getFullYear().toString()),q.disabled=!!e.config.minDate&&e.config.minDate.getFullYear()===e.config.maxDate.getFullYear());var Q=Se("div","flatpickr-current-month");return Q.appendChild(M),Q.appendChild(A),b.appendChild(Q),f.appendChild(b),{container:f,yearElement:q,monthElement:M}}function H(){go(e.monthNav),e.monthNav.appendChild(e.prevMonthNav),e.config.showMonths&&(e.yearElements=[],e.monthElements=[]);for(var f=e.config.showMonths;f--;){var b=g();e.yearElements.push(b.yearElement),e.monthElements.push(b.monthElement),e.monthNav.appendChild(b.container)}e.monthNav.appendChild(e.nextMonthNav)}function c(){return e.monthNav=Se("div","flatpickr-months"),e.yearElements=[],e.monthElements=[],e.prevMonthNav=Se("span","flatpickr-prev-month"),e.prevMonthNav.innerHTML=e.config.prevArrow,e.nextMonthNav=Se("span","flatpickr-next-month"),e.nextMonthNav.innerHTML=e.config.nextArrow,H(),Object.defineProperty(e,"_hidePrevMonthArrow",{get:function(){return e.__hidePrevMonthArrow},set:function(f){e.__hidePrevMonthArrow!==f&&(dt(e.prevMonthNav,"flatpickr-disabled",f),e.__hidePrevMonthArrow=f)}}),Object.defineProperty(e,"_hideNextMonthArrow",{get:function(){return e.__hideNextMonthArrow},set:function(f){e.__hideNextMonthArrow!==f&&(dt(e.nextMonthNav,"flatpickr-disabled",f),e.__hideNextMonthArrow=f)}}),e.currentYearElement=e.yearElements[0],Eo(),e.monthNav}function d(){e.calendarContainer.classList.add("hasTime"),e.config.noCalendar&&e.calendarContainer.classList.add("noCalendar");var f=Ia(e.config);e.timeContainer=Se("div","flatpickr-time"),e.timeContainer.tabIndex=-1;var b=Se("span","flatpickr-time-separator",":"),M=yo("flatpickr-hour",{"aria-label":e.l10n.hourAriaLabel});e.hourElement=M.getElementsByTagName("input")[0];var A=yo("flatpickr-minute",{"aria-label":e.l10n.minuteAriaLabel});if(e.minuteElement=A.getElementsByTagName("input")[0],e.hourElement.tabIndex=e.minuteElement.tabIndex=-1,e.hourElement.value=ut(e.latestSelectedDateObj?e.latestSelectedDateObj.getHours():e.config.time_24hr?f.hours:h(f.hours)),e.minuteElement.value=ut(e.latestSelectedDateObj?e.latestSelectedDateObj.getMinutes():f.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(b),e.timeContainer.appendChild(A),e.config.time_24hr&&e.timeContainer.classList.add("time24hr"),e.config.enableSeconds){e.timeContainer.classList.add("hasSeconds");var q=yo("flatpickr-second");e.secondElement=q.getElementsByTagName("input")[0],e.secondElement.value=ut(e.latestSelectedDateObj?e.latestSelectedDateObj.getSeconds():f.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(Se("span","flatpickr-time-separator",":")),e.timeContainer.appendChild(q)}return e.config.time_24hr||(e.amPM=Se("span","flatpickr-am-pm",e.l10n.amPM[$t((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?go(e.weekdayContainer):e.weekdayContainer=Se("div","flatpickr-weekdays");for(var f=e.config.showMonths;f--;){var b=Se("div","flatpickr-weekdaycontainer");e.weekdayContainer.appendChild(b)}return E(),e.weekdayContainer}function E(){if(e.weekdayContainer){var f=e.l10n.firstDayOfWeek,b=Bd(e.l10n.weekdays.shorthand);f>0&&f<b.length&&(b=Bd(b.splice(f,b.length),b.splice(0,f)));for(var M=e.config.showMonths;M--;)e.weekdayContainer.children[M].innerHTML=`
|
|
4
4
|
<span class='flatpickr-weekday'>
|
|
5
5
|
`+b.join("</span><span class='flatpickr-weekday'>")+`
|
|
6
6
|
</span>
|
|
7
|
-
`}}function w(){e.calendarContainer.classList.add("hasWeeks");var f=Se("div","flatpickr-weekwrapper");f.appendChild(Se("span","flatpickr-weekday",e.l10n.weekAbbreviation));var b=Se("div","flatpickr-weeks");return f.appendChild(b),{weekWrapper:f,weekNumbers:b}}function _(f,b){b===void 0&&(b=!0);var M=b?f:f-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,Be("onYearChange"),ae()),Y(),Be("onMonthChange"),Eo())}function I(f,b){if(f===void 0&&(f=!0),b===void 0&&(b=!0),e.input.value="",e.altInput!==void 0&&(e.altInput.value=""),e.mobileInput!==void 0&&(e.mobileInput.value=""),e.selectedDates=[],e.latestSelectedDateObj=void 0,b===!0&&(e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth()),e.config.enableTime===!0){var M=Ia(e.config),A=M.hours,q=M.minutes,Q=M.seconds;D(A,q,Q)}e.redraw(),f&&Be("onChange")}function P(){e.isOpen=!1,e.isMobile||(e.calendarContainer!==void 0&&e.calendarContainer.classList.remove("open"),e._input!==void 0&&e._input.classList.remove("active")),Be("onClose")}function j(){e.config!==void 0&&Be("onDestroy");for(var f=e._handlers.length;f--;)e._handlers[f].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 b=e.calendarContainer.parentNode;if(b.lastChild&&b.removeChild(b.lastChild),b.parentNode){for(;b.firstChild;)b.parentNode.insertBefore(b.firstChild,b);b.parentNode.removeChild(b)}}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 O(f){return e.calendarContainer.contains(f)}function X(f){if(e.isOpen&&!e.config.inline){var b=jt(f),M=O(b),A=b===e.input||b===e.altInput||e.element.contains(b)||f.path&&f.path.indexOf&&(~f.path.indexOf(e.input)||~f.path.indexOf(e.altInput)),q=!A&&!M&&!O(f.relatedTarget),Q=!e.config.ignoredFocusElements.some(function(ye){return ye.contains(b)});q&&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 re(f){if(!(!f||e.config.minDate&&f<e.config.minDate.getFullYear()||e.config.maxDate&&f>e.config.maxDate.getFullYear())){var b=f,M=e.currentYear!==b;e.currentYear=b||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(),Be("onYearChange"),ae())}}function Z(f,b){var M;b===void 0&&(b=!0);var A=e.parseDate(f,void 0,b);if(e.config.minDate&&A&&zt(A,e.config.minDate,b!==void 0?b:!e.minDateHasTime)<0||e.config.maxDate&&A&&zt(A,e.config.maxDate,b!==void 0?b:!e.maxDateHasTime)>0)return!1;if(!e.config.enable&&e.config.disable.length===0)return!0;if(A===void 0)return!1;for(var q=!!e.config.enable,Q=(M=e.config.enable)!==null&&M!==void 0?M:e.config.disable,ye=0,te=void 0;ye<Q.length;ye++){if(te=Q[ye],typeof te=="function"&&te(A))return q;if(te instanceof Date&&A!==void 0&&te.getTime()===A.getTime())return q;if(typeof te=="string"){var De=e.parseDate(te,void 0,!0);return De&&De.getTime()===A.getTime()?q:!q}else if(typeof te=="object"&&A!==void 0&&te.from&&te.to&&A.getTime()>=te.from.getTime()&&A.getTime()<=te.to.getTime())return q}return!q}function V(f){return e.daysContainer!==void 0?f.className.indexOf("hidden")===-1&&f.className.indexOf("flatpickr-disabled")===-1&&e.daysContainer.contains(f):!1}function ue(f){var b=f.target===e._input,M=e._input.value.trimEnd()!==$a();b&&M&&!(f.relatedTarget&&O(f.relatedTarget))&&e.setDate(e._input.value,!0,f.target===e.altInput?e.config.altFormat:e.config.dateFormat)}function pe(f){var b=jt(f),M=e.config.wrap?n.contains(b):b===e._input,A=e.config.allowInput,q=e.isOpen&&(!A||!M),Q=e.config.inline&&M&&!A;if(f.keyCode===13&&M){if(A)return e.setDate(e._input.value,!0,b===e.altInput?e.config.altFormat:e.config.dateFormat),e.close(),b.blur();e.open()}else if(O(b)||q||Q){var ye=!!e.timeContainer&&e.timeContainer.contains(b);switch(f.keyCode){case 13:ye?(f.preventDefault(),l(),Ba()):Yc(f);break;case 27:f.preventDefault(),Ba();break;case 8:case 46:M&&!e.config.allowInput&&(f.preventDefault(),e.clear());break;case 37:case 39:if(!ye&&!M){f.preventDefault();var te=o();if(e.daysContainer!==void 0&&(A===!1||te&&V(te))){var De=f.keyCode===39?1:-1;f.ctrlKey?(f.stopPropagation(),_(De),B(Te(1),0)):B(void 0,De)}}else e.hourElement&&e.hourElement.focus();break;case 38:case 40:f.preventDefault();var ee=f.keyCode===40?1:-1;e.daysContainer&&b.$i!==void 0||b===e.input||b===e.altInput?f.ctrlKey?(f.stopPropagation(),re(e.currentYear-ee),B(Te(1),0)):ye||B(void 0,ee*7):b===e.currentYearElement?re(e.currentYear-ee):e.config.enableTime&&(!ye&&e.hourElement&&e.hourElement.focus(),l(f),e._debouncedChange());break;case 9:if(ye){var de=[e.hourElement,e.minuteElement,e.secondElement,e.amPM].concat(e.pluginElements).filter(function(Ut){return Ut}),Ie=de.indexOf(b);if(Ie!==-1){var dn=de[Ie+(f.shiftKey?-1:1)];f.preventDefault(),(dn||e._input).focus()}}else!e.config.noCalendar&&e.daysContainer&&e.daysContainer.contains(b)&&f.shiftKey&&(f.preventDefault(),e._input.focus());break;default:break}}if(e.amPM!==void 0&&b===e.amPM)switch(f.key){case e.l10n.amPM[0].charAt(0):case e.l10n.amPM[0].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[0],p(),En();break;case e.l10n.amPM[1].charAt(0):case e.l10n.amPM[1].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[1],p(),En();break}(M||O(b))&&Be("onKeyDown",f)}function we(f,b){if(b===void 0&&(b="flatpickr-day"),!(e.selectedDates.length!==1||f&&(!f.classList.contains(b)||f.classList.contains("flatpickr-disabled")))){for(var M=f?f.dateObj.getTime():e.days.firstElementChild.dateObj.getTime(),A=e.parseDate(e.selectedDates[0],void 0,!0).getTime(),q=Math.min(M,e.selectedDates[0].getTime()),Q=Math.max(M,e.selectedDates[0].getTime()),ye=!1,te=0,De=0,ee=q;ee<Q;ee+=Od.DAY)Z(new Date(ee),!0)||(ye=ye||ee>q&&ee<Q,ee<A&&(!te||ee>te)?te=ee:ee>A&&(!De||ee<De)&&(De=ee));var de=Array.from(e.rContainer.querySelectorAll("*:nth-child(-n+"+e.config.showMonths+") > ."+b));de.forEach(function(Ie){var dn=Ie.dateObj,Ut=dn.getTime(),oi=te>0&&Ut<te||De>0&&Ut>De;if(oi){Ie.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(Tr){Ie.classList.remove(Tr)});return}else if(ye&&!oi)return;["startRange","inRange","endRange","notAllowed"].forEach(function(Tr){Ie.classList.remove(Tr)}),f!==void 0&&(f.classList.add(M<=e.selectedDates[0].getTime()?"startRange":"endRange"),A<M&&Ut===A?Ie.classList.add("startRange"):A>M&&Ut===A&&Ie.classList.add("endRange"),Ut>=te&&(De===0||Ut<=De)&&Ld(Ut,A,M)&&Ie.classList.add("inRange"))})}}function _e(){e.isOpen&&!e.config.static&&!e.config.inline&&Yn()}function Oe(f,b){if(b===void 0&&(b=e._positionElement),e.isMobile===!0){if(f){f.preventDefault();var M=jt(f);M&&M.blur()}e.mobileInput!==void 0&&(e.mobileInput.focus(),e.mobileInput.click()),Be("onOpen");return}else if(e._input.disabled||e.config.inline)return;var A=e.isOpen;e.isOpen=!0,A||(e.calendarContainer.classList.add("open"),e._input.classList.add("active"),Be("onOpen"),Yn(b)),e.config.enableTime===!0&&e.config.noCalendar===!0&&e.config.allowInput===!1&&(f===void 0||!e.timeContainer.contains(f.relatedTarget))&&setTimeout(function(){return e.hourElement.select()},50)}function Ve(f){return function(b){var M=e.config["_"+f+"Date"]=e.parseDate(b,e.config.dateFormat),A=e.config["_"+(f==="min"?"max":"min")+"Date"];M!==void 0&&(e[f==="min"?"minDateHasTime":"maxDateHasTime"]=M.getHours()>0||M.getMinutes()>0||M.getSeconds()>0),e.selectedDates&&(e.selectedDates=e.selectedDates.filter(function(q){return Z(q)}),!e.selectedDates.length&&f==="min"&&y(M),En()),e.daysContainer&&(wo(),M!==void 0?e.currentYearElement[f]=M.getFullYear().toString():e.currentYearElement.removeAttribute(f),e.currentYearElement.disabled=!!A&&M!==void 0&&A.getFullYear()===M.getFullYear())}}function ot(){var f=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],b=ht(ht({},JSON.parse(JSON.stringify(n.dataset||{}))),t),M={};e.config.parseDate=b.parseDate,e.config.formatDate=b.formatDate,Object.defineProperty(e.config,"enable",{get:function(){return e.config._enable},set:function(de){e.config._enable=jc(de)}}),Object.defineProperty(e.config,"disable",{get:function(){return e.config._disable},set:function(de){e.config._disable=jc(de)}});var A=b.mode==="time";if(!b.dateFormat&&(b.enableTime||A)){var q=We.defaultConfig.dateFormat||ar.dateFormat;M.dateFormat=b.noCalendar||A?"H:i"+(b.enableSeconds?":S":""):q+" H:i"+(b.enableSeconds?":S":"")}if(b.altInput&&(b.enableTime||A)&&!b.altFormat){var Q=We.defaultConfig.altFormat||ar.altFormat;M.altFormat=b.noCalendar||A?"h:i"+(b.enableSeconds?":S K":" K"):Q+(" h:i"+(b.enableSeconds?":S":"")+" K")}Object.defineProperty(e.config,"minDate",{get:function(){return e.config._minDate},set:Ve("min")}),Object.defineProperty(e.config,"maxDate",{get:function(){return e.config._maxDate},set:Ve("max")});var ye=function(de){return function(Ie){e.config[de==="min"?"_minTime":"_maxTime"]=e.parseDate(Ie,"H:i:S")}};Object.defineProperty(e.config,"minTime",{get:function(){return e.config._minTime},set:ye("min")}),Object.defineProperty(e.config,"maxTime",{get:function(){return e.config._maxTime},set:ye("max")}),b.mode==="time"&&(e.config.noCalendar=!0,e.config.enableTime=!0),Object.assign(e.config,M,b);for(var te=0;te<f.length;te++)e.config[f[te]]=e.config[f[te]]===!0||e.config[f[te]]==="true";Ma.filter(function(de){return e.config[de]!==void 0}).forEach(function(de){e.config[de]=Ca(e.config[de]||[]).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 te=0;te<e.config.plugins.length;te++){var De=e.config.plugins[te](e)||{};for(var ee in De)Ma.indexOf(ee)>-1?e.config[ee]=Ca(De[ee]).map(a).concat(e.config[ee]):typeof b[ee]>"u"&&(e.config[ee]=De[ee])}b.altInputClass||(e.config.altInputClass=Xt().className+" "+e.config.altInputClass),Be("onParseConfig")}function Xt(){return e.config.wrap?n.querySelector("[data-input]"):n}function sr(){typeof e.config.locale!="object"&&typeof We.l10ns[e.config.locale]>"u"&&e.config.errorHandler(new Error("flatpickr: invalid locale "+e.config.locale)),e.l10n=ht(ht({},We.l10ns.default),typeof e.config.locale=="object"?e.config.locale:e.config.locale!=="default"?We.l10ns[e.config.locale]:void 0),Fn.D="("+e.l10n.weekdays.shorthand.join("|")+")",Fn.l="("+e.l10n.weekdays.longhand.join("|")+")",Fn.M="("+e.l10n.months.shorthand.join("|")+")",Fn.F="("+e.l10n.months.longhand.join("|")+")",Fn.K="("+e.l10n.amPM[0]+"|"+e.l10n.amPM[1]+"|"+e.l10n.amPM[0].toLowerCase()+"|"+e.l10n.amPM[1].toLowerCase()+")";var f=ht(ht({},t),JSON.parse(JSON.stringify(n.dataset||{})));f.time_24hr===void 0&&We.defaultConfig.time_24hr===void 0&&(e.config.time_24hr=e.l10n.time_24hr),e.formatDate=Hc(e),e.parseDate=ka({config:e.config,l10n:e.l10n})}function Yn(f){if(typeof e.config.position=="function")return void e.config.position(e,f);if(e.calendarContainer!==void 0){Be("onPreCalendarPosition");var b=f||e._positionElement,M=Array.prototype.reduce.call(e.calendarContainer.children,function(sh,ch){return sh+ch.offsetHeight},0),A=e.calendarContainer.offsetWidth,q=e.config.position.split(" "),Q=q[0],ye=q.length>1?q[1]:null,te=b.getBoundingClientRect(),De=window.innerHeight-te.bottom,ee=Q==="above"||Q!=="below"&&De<M&&te.top>M,de=window.pageYOffset+te.top+(ee?-M-2:b.offsetHeight+2);if(dt(e.calendarContainer,"arrowTop",!ee),dt(e.calendarContainer,"arrowBottom",ee),!e.config.inline){var Ie=window.pageXOffset+te.left,dn=!1,Ut=!1;ye==="center"?(Ie-=(A-te.width)/2,dn=!0):ye==="right"&&(Ie-=A-te.width,Ut=!0),dt(e.calendarContainer,"arrowLeft",!dn&&!Ut),dt(e.calendarContainer,"arrowCenter",dn),dt(e.calendarContainer,"arrowRight",Ut);var oi=window.document.body.offsetWidth-(window.pageXOffset+te.right),Tr=Ie+A>window.document.body.offsetWidth,eh=oi+A>window.document.body.offsetWidth;if(dt(e.calendarContainer,"rightMost",Tr),!e.config.static)if(e.calendarContainer.style.top=de+"px",!Tr)e.calendarContainer.style.left=Ie+"px",e.calendarContainer.style.right="auto";else if(!eh)e.calendarContainer.style.left="auto",e.calendarContainer.style.right=oi+"px";else{var ja=ii();if(ja===void 0)return;var th=window.document.body.offsetWidth,nh=Math.max(0,th/2-A/2),rh=".flatpickr-calendar.centerMost:before",ih=".flatpickr-calendar.centerMost:after",oh=ja.cssRules.length,ah="{left:"+te.left+"px;right:auto;}";dt(e.calendarContainer,"rightMost",!1),dt(e.calendarContainer,"centerMost",!0),ja.insertRule(rh+","+ih+ah,oh),e.calendarContainer.style.left=nh+"px",e.calendarContainer.style.right="auto"}}}}function ii(){for(var f=null,b=0;b<document.styleSheets.length;b++){var M=document.styleSheets[b];if(M.cssRules){try{M.cssRules}catch{continue}f=M;break}}return f??bo()}function bo(){var f=document.createElement("style");return document.head.appendChild(f),f.sheet}function wo(){e.config.noCalendar||e.isMobile||(ae(),Eo(),Y())}function Ba(){e._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(e.close,0):e.close()}function Yc(f){f.preventDefault(),f.stopPropagation();var b=function(de){return de.classList&&de.classList.contains("flatpickr-day")&&!de.classList.contains("flatpickr-disabled")&&!de.classList.contains("notAllowed")},M=Nc(jt(f),b);if(M!==void 0){var A=M,q=e.latestSelectedDateObj=new Date(A.dateObj.getTime()),Q=(q.getMonth()<e.currentMonth||q.getMonth()>e.currentMonth+e.config.showMonths-1)&&e.config.mode!=="range";if(e.selectedDateElem=A,e.config.mode==="single")e.selectedDates=[q];else if(e.config.mode==="multiple"){var ye=Ya(q);ye?e.selectedDates.splice(parseInt(ye),1):e.selectedDates.push(q)}else e.config.mode==="range"&&(e.selectedDates.length===2&&e.clear(!1,!1),e.latestSelectedDateObj=q,e.selectedDates.push(q),zt(q,e.selectedDates[0],!0)!==0&&e.selectedDates.sort(function(de,Ie){return de.getTime()-Ie.getTime()}));if(p(),Q){var te=e.currentYear!==q.getFullYear();e.currentYear=q.getFullYear(),e.currentMonth=q.getMonth(),te&&(Be("onYearChange"),ae()),Be("onMonthChange")}if(Eo(),Y(),En(),!Q&&e.config.mode!=="range"&&e.config.showMonths===1?Ce(A):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 De=e.config.mode==="single"&&!e.config.enableTime,ee=e.config.mode==="range"&&e.selectedDates.length===2&&!e.config.enableTime;(De||ee)&&Ba()}N()}}var Do={locale:[sr,E],showMonths:[H,s,v],minDate:[G],maxDate:[G],positionElement:[zc],clickOpens:[function(){e.config.clickOpens===!0?(S(e._input,"focus",e.open),S(e._input,"click",e.open)):(e._input.removeEventListener("focus",e.open),e._input.removeEventListener("click",e.open))}]};function Vd(f,b){if(f!==null&&typeof f=="object"){Object.assign(e.config,f);for(var M in f)Do[M]!==void 0&&Do[M].forEach(function(A){return A()})}else e.config[f]=b,Do[f]!==void 0?Do[f].forEach(function(A){return A()}):Ma.indexOf(f)>-1&&(e.config[f]=Ca(b));e.redraw(),En(!0)}function $c(f,b){var M=[];if(f instanceof Array)M=f.map(function(A){return e.parseDate(A,b)});else if(f instanceof Date||typeof f=="number")M=[e.parseDate(f,b)];else if(typeof f=="string")switch(e.config.mode){case"single":case"time":M=[e.parseDate(f,b)];break;case"multiple":M=f.split(e.config.conjunction).map(function(A){return e.parseDate(A,b)});break;case"range":M=f.split(e.l10n.rangeSeparator).map(function(A){return e.parseDate(A,b)});break;default:break}else e.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(f)));e.selectedDates=e.config.allowInvalidPreload?M:M.filter(function(A){return A instanceof Date&&Z(A,!1)}),e.config.mode==="range"&&e.selectedDates.sort(function(A,q){return A.getTime()-q.getTime()})}function qd(f,b,M){if(b===void 0&&(b=!1),M===void 0&&(M=e.config.dateFormat),f!==0&&!f||f instanceof Array&&f.length===0)return e.clear(b);$c(f,M),e.latestSelectedDateObj=e.selectedDates[e.selectedDates.length-1],e.redraw(),G(void 0,b),y(),e.selectedDates.length===0&&e.clear(!1),En(b),b&&Be("onChange")}function jc(f){return f.slice().map(function(b){return typeof b=="string"||typeof b=="number"||b instanceof Date?e.parseDate(b,void 0,!0):b&&typeof b=="object"&&b.from&&b.to?{from:e.parseDate(b.from,void 0),to:e.parseDate(b.to,void 0)}:b}).filter(function(b){return b})}function Wd(){e.selectedDates=[],e.now=e.parseDate(e.config.now)||new Date;var f=e.config.defaultDate||((e.input.nodeName==="INPUT"||e.input.nodeName==="TEXTAREA")&&e.input.placeholder&&e.input.value===e.input.placeholder?null:e.input.value);f&&$c(f,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 Gd(){if(e.input=Xt(),!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=Se(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"),zc()}function zc(){e._positionElement=e.config.positionElement||e._input}function Kd(){var f=e.config.enableTime?e.config.noCalendar?"time":"datetime-local":"date";e.mobileInput=Se("input",e.input.className+" flatpickr-mobile"),e.mobileInput.tabIndex=1,e.mobileInput.type=f,e.mobileInput.disabled=e.input.disabled,e.mobileInput.required=e.input.required,e.mobileInput.placeholder=e.input.placeholder,e.mobileFormatStr=f==="datetime-local"?"Y-m-d\\TH:i:S":f==="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{}S(e.mobileInput,"change",function(b){e.setDate(jt(b).value,!1,e.mobileFormatStr),Be("onChange"),Be("onClose")})}function Zd(f){if(e.isOpen===!0)return e.close();e.open(f)}function Be(f,b){if(e.config!==void 0){var M=e.config[f];if(M!==void 0&&M.length>0)for(var A=0;M[A]&&A<M.length;A++)M[A](e.selectedDates,e.input.value,e,b);f==="onChange"&&(e.input.dispatchEvent(Fa("change")),e.input.dispatchEvent(Fa("input")))}}function Fa(f){var b=document.createEvent("Event");return b.initEvent(f,!0,!0),b}function Ya(f){for(var b=0;b<e.selectedDates.length;b++){var M=e.selectedDates[b];if(M instanceof Date&&zt(M,f)===0)return""+b}return!1}function Jd(f){return e.config.mode!=="range"||e.selectedDates.length<2?!1:zt(f,e.selectedDates[0])>=0&&zt(f,e.selectedDates[1])<=0}function Eo(){e.config.noCalendar||e.isMobile||!e.monthNav||(e.yearElements.forEach(function(f,b){var M=new Date(e.currentYear,e.currentMonth,1);M.setMonth(e.currentMonth+b),e.config.showMonths>1||e.config.monthSelectorType==="static"?e.monthElements[b].textContent=vo(M.getMonth(),e.config.shorthandCurrentMonth,e.l10n)+" ":e.monthsDropdownContainer.value=M.getMonth().toString(),f.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 $a(f){var b=f||(e.config.altInput?e.config.altFormat:e.config.dateFormat);return e.selectedDates.map(function(M){return e.formatDate(M,b)}).filter(function(M,A,q){return e.config.mode!=="range"||e.config.enableTime||q.indexOf(M)===A}).join(e.config.mode!=="range"?e.config.conjunction:e.l10n.rangeSeparator)}function En(f){f===void 0&&(f=!0),e.mobileInput!==void 0&&e.mobileFormatStr&&(e.mobileInput.value=e.latestSelectedDateObj!==void 0?e.formatDate(e.latestSelectedDateObj,e.mobileFormatStr):""),e.input.value=$a(e.config.dateFormat),e.altInput!==void 0&&(e.altInput.value=$a(e.config.altFormat)),f!==!1&&Be("onValueUpdate")}function Xd(f){var b=jt(f),M=e.prevMonthNav.contains(b),A=e.nextMonthNav.contains(b);M||A?_(M?-1:1):e.yearElements.indexOf(b)>=0?b.select():b.classList.contains("arrowUp")?e.changeYear(e.currentYear+1):b.classList.contains("arrowDown")&&e.changeYear(e.currentYear-1)}function Qd(f){f.preventDefault();var b=f.type==="keydown",M=jt(f),A=M;e.amPM!==void 0&&M===e.amPM&&(e.amPM.textContent=e.l10n.amPM[$t(e.amPM.textContent===e.l10n.amPM[0])]);var q=parseFloat(A.getAttribute("min")),Q=parseFloat(A.getAttribute("max")),ye=parseFloat(A.getAttribute("step")),te=parseInt(A.value,10),De=f.delta||(b?f.which===38?1:-1:0),ee=te+ye*De;if(typeof A.value<"u"&&A.value.length===2){var de=A===e.hourElement,Ie=A===e.minuteElement;ee<q?(ee=Q+ee+$t(!de)+($t(de)&&$t(!e.amPM)),Ie&&ne(void 0,-1,e.hourElement)):ee>Q&&(ee=A===e.hourElement?ee-Q-$t(!e.amPM):q,Ie&&ne(void 0,1,e.hourElement)),e.amPM&&de&&(ye===1?ee+te===23:Math.abs(ee-te)>ye)&&(e.amPM.textContent=e.l10n.amPM[$t(e.amPM.textContent===e.l10n.amPM[0])]),A.value=ut(ee)}}return i(),e}function ri(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=qm(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 ri(this,n)},HTMLElement.prototype.flatpickr=function(n){return ri([this],n)});var We=function(n,t){return typeof n=="string"?ri(window.document.querySelectorAll(n),t):n instanceof Node?ri([n],t):ri(n,t)};We.defaultConfig={};We.l10ns={en:ht({},Sa),default:ht({},Sa)};We.localize=function(n){We.l10ns.default=ht(ht({},We.l10ns.default),n)};We.setDefaults=function(n){We.defaultConfig=ht(ht({},We.defaultConfig),n)};We.parseDate=ka({});We.formatDate=Hc({});We.compareDates=zt;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(n){return ri(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=We);var Bd=We;var Ra=class{constructor(t,e){this.dateInputEl=t;L(this,"minDate");L(this,"maxDate");L(this,"defaultReservationDays");L(this,"hasPrices",!1);L(this,"prices",{});L(this,"availability",{});L(this,"disabledDates",[]);L(this,"selectedStartDate");L(this,"selectedEndDate");L(this,"config");L(this,"instance");L(this,"destroyInstance");L(this,"currentDate");L(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;let r=e.startWithEmptyDates??!1;this.config={...e,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??J.getCurrentDate(),defaultEndDate:e.defaultEndDate??J.getCurrentDate(),startWithEmptyDates:r},this.currentDate=J.getCurrentDate(),this.selectedStartDate=r?null:this.config.defaultStartDate,this.selectedEndDate=r?null: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=J.toJSDate(t),r=this.selectedEndDate?J.toJSDate(this.selectedEndDate):e;this.selectedStartDate=t,this.instance instanceof _a.Core?this.instance.setStartDate(new ge(t.toString())):this.config.type==="flatpickr"&&this.instance.setDate([e,r],!0)}setEndDate(t){let e=this.selectedStartDate?J.toJSDate(this.selectedStartDate):J.toJSDate(t),r=J.toJSDate(t);this.selectedEndDate=t,this.instance instanceof _a.Core?this.instance.setEndDate(new ge(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=J.toJSDate(t),i=J.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={tooltip:this.config.tooltip,repick:this.config.repick,tooltipNumber:i=>i-1,locale:{one:"nuit",other:"nuits"}};this.config.startWithEmptyDates||(t.startDate=new ge(this.config.defaultStartDate.toString()),t.endDate=new ge(this.config.defaultEndDate.toString()));let e={element:this.dateInputEl,css:["https://cdn.jsdelivr.net/npm/@easepick/bundle@1.2.1/dist/index.css"],zIndex:10,format:Gu,grid:this.config.grid,calendars:this.config.calendars,header:"",lang:document.documentElement.lang,RangePlugin:t,LockPlugin:{minDate:new ge(this.minDate.toString()),minDays:this.config.minDays,selectForward:!0},AmpPlugin:{darkMode:this.config.darkMode},plugins:[Ea,Da,wa],setup:i=>{i.on("view",o=>{let{view:a,date:s,target:l}=o.detail,u=s?s.format("YYYY-MM-DD"):null;if(a==="CalendarDay"&&u&&this.prices[u]){let h=this.prices[u],p=l.querySelector(`.${ua}`)||document.createElement("span");p.className=ua,p.textContent=`${h.toLocaleString(qe,{style:"currency",currency:"EUR",maximumFractionDigits:0})}`,p.style.color="#c64509",p.style.fontWeight="bold",p.style.fontSize="10px",l.append(p)}}),i.on("select",o=>{let{start:a,end:s}=o.detail;this.selectedStartDate=J.fromString(a.format("YYYY-MM-DD")),this.selectedEndDate=J.fromString(s.format("YYYY-MM-DD"));let l={startDate:a.format("YYYY-MM-DD").toString(),endDate:s.format("YYYY-MM-DD").toString()};it("date:changed",l)})}},r=new _a.create(e);this.instance=r,this.destroyInstance=()=>r.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(),shorthandCurrentMonth:!0,monthSelectorType:"static",inline:!1,dateFormat:Ku,lang:document.documentElement.lang,zIndex:10,disable:this.disabledDates};this.config.startWithEmptyDates||(e.defaultDate=[this.config.defaultStartDate.toString(),this.config.defaultEndDate.toString()]),Object.assign(e,{onChange:i=>{let o=K("label",this.dateInputEl);if(i.length===2){this.selectedStartDate=J.fromJSDate(i[0]),this.selectedEndDate=J.fromJSDate(i[1]);let a={startDate:this.selectedStartDate.toString(),endDate:this.selectedEndDate.toString()};if(it("date:changed",a),o){let s=this.formatDate(i[0]),l=this.formatDate(i[1]);o.textContent=`${s} - ${l}`}}else this.selectedStartDate=null,this.selectedEndDate=null,it("date:changed",{startDate:"",endDate:""}),o&&(o.textContent="")},onDayCreate:async(i,o,a,s)=>{let l=s.dateObj,u=J.fromJSDate(l),h=J.formatForAPI(u);if(this.prices[h]){let p=this.prices[h],y=document.createElement("span");y.style.marginTop="2px",y.style.color="#c64509",y.style.fontSize="10px",y.style.fontWeight="bold",y.className=ua,y.textContent=`${p.toLocaleString(qe,{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)}}});let r=Bd(this.dateInputEl,e);this.instance=r,this.destroyInstance=()=>r.destroy()}clear(){this.selectedStartDate=null,this.selectedEndDate=null,this.config.type==="flatpickr"&&this.instance.clear?.()}destroy(){window.removeEventListener("resize",this.handleResize),this.destroyInstance&&this.destroyInstance()}formatDate(t){let e=J.fromJSDate(t),r=e.year,i=String(e.month).padStart(2,"0"),o=String(e.day).padStart(2,"0");return qe==="en-US"?`${r}/${i}/${o}`:qe==="fr-FR"||qe==="de-DE"?`${o}/${i}/${r}`:`${r}/${i}/${o}`}};var xa=class{constructor(t){this.parentComponent=t;L(this,"element");L(this,"nightsCountElement");L(this,"startDateElement");L(this,"endDateElement");L(this,"dateElement");L(this,"roomsWrapperElement");L(this,"roomElementTemplate");L(this,"addRoomElement");L(this,"rooms",[]);L(this,"includePrices",Zu);L(this,"populateCalendarInput",async()=>{if(!this.dateElement){console.error("Date element not found");return}let t=new Ra(this.dateElement,{type:"flatpickr",showPrices:!0,defaultReservationDays:3,grid:2,calendars:2,darkMode:!1,tooltip:!0,repick:!1,minDays:1,defaultStartDate:F.startDate||Qr,defaultEndDate:F.endDate||uo});if(t.setMinimumDate(Qr),t.setMaximumDate(uo),t.includePrices(this.includePrices),this.includePrices){let e=await xd([this.parentComponent.apartmentProperties.enterpriseId]);t.setPrices(e)}return t.initialize(),t});nr("date:changed",e=>{F.updateStartDate(J.fromString(e.startDate)),F.updateEndDate(J.fromString(e.endDate))}),this.element=K("details-box"),this.nightsCountElement=K("nights",this.element),this.startDateElement=K("start-date",this.element),this.endDateElement=K("end-date",this.element),this.dateElement=K("date-element",this.element),this.roomsWrapperElement=K("room-box-wrapper",this.element),this.roomElementTemplate=K("room-box",this.element),this.addRoomElement=K("add-room-button",this.element)}init(){console.log("Initialize DetailsSection"),this.updateDOM(),this.populateCalendarInput()}updateDOM(){Rt(()=>{this.startDateElement.textContent=F.startDate?J.formatForDisplay(F.startDate):"?"}),Rt(()=>{this.endDateElement.textContent=F.endDate?J.formatForDisplay(F.endDate):"?"}),Rt(()=>{this.nightsCountElement.textContent=`${F.nightsCount} ${ze("night").toLowerCase()}${F.nightsCount>1?"s":""}`}),Rt(()=>{let t=document.createDocumentFragment();F.rooms.forEach((r,i)=>{let o=lt(this.roomElementTemplate,!0),a=K("room",o);a.textContent=`${ze("apartment")} ${i+1}`;let s=K("categories-wrapper",o),l=K("age-category",s),u=document.createDocumentFragment();r.forEach(h=>{let p=lt(l,!0),y=K("category-name",p);y.textContent=h.name;let D=K("input",p);po(D,h.value.toString()),xt(p,"click",T=>{T.preventDefault();let S=i;switch(Qu(T.target)){case"decrement":if(h.isAdult){if(r.filter($=>$.isAdult).reduce(($,G)=>$+G.value,0)>1&&h.value>0){let $=F.rooms.map((G,W)=>W===S?G.map(ne=>ne.ageCategoryId===h.ageCategoryId?{...ne,value:ne.value-1}:{...ne}):G);F.updateRooms($)}}else if(h.value>0){let N=F.rooms.map(($,G)=>G===S?$.map(W=>W.ageCategoryId===h.ageCategoryId?{...W,value:W.value-1}:{...W}):$);F.updateRooms(N)}break;case"increment":if(this.computations(r).hasCapacity){let N=F.rooms.map(($,G)=>G===S?$.map(W=>W.ageCategoryId===h.ageCategoryId?{...W,value:W.value+1}:{...W}):$);F.updateRooms(N)}break}},{once:!1}),u.appendChild(p)}),s.innerHTML="",s.appendChild(u),t.appendChild(o)}),this.roomsWrapperElement.innerHTML="",this.roomsWrapperElement.appendChild(t);let{maxAllowedRooms:e}={maxAllowedRooms:F.maxAllowedRooms};console.log(`<<debug>> Current rooms: ${F.rooms.length}, Max allowed rooms: ${e}, Available rooms: ${this.parentComponent.apartmentProperties.availableRooms}`),e>0&&F.rooms.length>=e?(console.log(`<<debug>> Hiding add room button: current rooms ${F.rooms.length} >= max allowed ${e}`),this.addRoomElement.classList.add("hide")):e<=0?(console.log(`<<debug>> Max allowed rooms is non-positive (${e}), using available rooms ${this.parentComponent.apartmentProperties.availableRooms} as limit`),F.rooms.length>=this.parentComponent.apartmentProperties.availableRooms&&(console.log(`<<debug>> Hiding add room button: current rooms ${F.rooms.length} >= available rooms ${this.parentComponent.apartmentProperties.availableRooms}`),this.addRoomElement.classList.add("hide"))):(console.log(`<<debug>> Showing add room button: current rooms ${F.rooms.length} < max allowed or available rooms`),this.addRoomElement.classList.remove("hide"))}),xt(this.addRoomElement,"click",t=>{t.preventDefault();let{maxAllowedRooms:e}={maxAllowedRooms:F.maxAllowedRooms};if(F.rooms.length<e){let i=F.ageCategories.map(a=>{let s=a.classification.toLowerCase()==="adult",l=s?ze("adults"):ze("children"),u=s?1:0;return{isAdult:s,ageCategoryId:a.id,name:l,value:u}}),o=[...F.rooms,i];F.updateRooms(o)}})}toggleVisibility(t=!0){this.element.classList.toggle("hide",!t)}computations(t){let e=t.some(a=>a.value>0),r=t.reduce((a,s)=>a+s.value,0),i=r<this.parentComponent.apartmentProperties.capacity,o=t.filter(a=>a.isAdult).reduce((a,s)=>a+s.value,0);return{hasOccupants:e,totalOccupants:r,hasCapacity:i,totalAdults:o}}};var Fd=(n,t)=>{let e={method:"POST",headers:ce.headers,body:JSON.stringify(t)};return Xe("/images/getUrls",e,n)};function Yd(n){return n.ImageUrls.map(t=>({url:t.Url,imageId:t.ImageId}))}var Bc=Ze({}),$d={width:160,height:160};async function jd(n,t){if(t.every(i=>Bc.value[i]))return t.map(i=>Bc.value[i]).flat();let e=await Fd(n,{Images:t.map(i=>({ImageId:i,Width:$d.width,Height:$d.height,ResizeMode:"Cover"}))}),r=Yd(e);return r.forEach(i=>{Bc.value[i.imageId]=i}),r}var Aa=class{constructor(t){this.parentComponent=t;L(this,"element");L(this,"productsWrapperElement");L(this,"productTemplateElement");L(this,"showMoreButtonElement");this.element=K("options-box"),this.productsWrapperElement=K("options-list",this.element),this.productTemplateElement=K("option-wrapper",this.element),this.showMoreButtonElement=K("more-button",this.element)}init(){try{this.updateDOM()}catch(t){console.error("Error initializing OptionsSection:",t)}}refresh(){try{}catch(t){console.error("Error refreshing OptionsSection:",t)}}toggleVisibility(t=!0){this.element.classList.toggle("hide",!t)}updateDOM(){let t=document.createDocumentFragment();[...F.products].sort((r,i)=>{if(r.ordering!==i.ordering)return(r.ordering??0)-(i.ordering??0);let o=r.name,a=i.name;return o<a?-1:o>a?1:(r.ordering===i.ordering,0)}).forEach((r,i)=>{let o=lt(this.productTemplateElement,!0);o.removeAttribute("id");let a=K("name",o);a.textContent=r.name||"";let s=K("price",o);s.textContent=r.price.toLocaleString(qe,{style:"currency",currency:"EUR"});let l=K("label",o);l.textContent=ze(`chargingMode:${r.chargingMode}`),jd(this.parentComponent.apartmentProperties.enterpriseId,r.imageIds).then(h=>{let p=K("image",o);p.src=h[0].url});let u=K("checkbox",o);xt(u,"change",()=>{let h=mo(u),p=F.products.map(y=>y.id===r.id?{...y,selected:h==="true"}:y);F.updateProducts(p)}),o.classList.toggle("hide",i>3),t.appendChild(o)}),Ic(this.productsWrapperElement),this.productsWrapperElement.appendChild(t),xt(this.showMoreButtonElement,"click",()=>{let r=this.showMoreProducts(3);this.showMoreButtonElement.classList.toggle("hide",!r)})}showMoreProducts(t=4){let e=this.productsWrapperElement.querySelectorAll(`${Xu(this.productTemplateElement)}.hide`);return e.forEach((r,i)=>{i<t&&r.classList.toggle("hide",!1)}),e.length>t}};var zd=(n,t)=>{let e=`${ce.bookingEngine_url}/reservationGroups/create`,r={method:"POST",headers:ce.headers,body:JSON.stringify(t)};return fetch(e,r).then(o=>o.json())};var La=class{constructor(t){this.parentComponent=t;L(this,"element");L(this,"modalContent");L(this,"modalBg");L(this,"openModalBtn");L(this,"closeModalBtn");L(this,"fNameInput");L(this,"lNameInput");L(this,"emailInput");L(this,"phoneInput");L(this,"countryInput");L(this,"notesInput");L(this,"submitPaymentBtn");L(this,"customer",null);this.element=K("payment-modal"),this.modalContent=K("modal-content",this.element),this.modalBg=K("modal-bg",this.element),this.openModalBtn=K("open-modal"),this.closeModalBtn=K("close-modal"),this.fNameInput=K("fname-input",this.element),this.lNameInput=K("lname-input",this.element),this.emailInput=K("email-input",this.element),this.phoneInput=K("phone-input",this.element),this.countryInput=K("country-input",this.element),this.notesInput=K("notes-input",this.element),this.submitPaymentBtn=K("submit-payment",this.element)}init(){console.log("Initialize PaymentModal"),this.updateDOM()}updateDOM(){xt(this.openModalBtn,"click",()=>{this.toggleVisibility(!0),this.element.scrollIntoView({behavior:"smooth"})}),this.submitPaymentBtn?xt(this.submitPaymentBtn,"click",t=>{t.preventDefault(),this.handleSubmit()}):console.error("Submit Payment button not found in the DOM.")}toggleVisibility(t=!0){this.element.classList.toggle("hide",!t),t?(this.element.style.display="flex",this.element.style.opacity="1",this.modalContent.style.opacity="1",this.element.querySelectorAll("div").forEach(e=>{e.style.opacity="1"})):(this.element.style.opacity="0",this.element.style.display="none")}validateInputs(){if(!this.fNameInput.value||!this.lNameInput.value||!this.emailInput.value||!this.phoneInput.value||!this.countryInput.value)throw new Error("First name, last name, email, phone, and nationality are required.");if(!this.emailInput.checkValidity())throw new Error("Invalid email format.");if(!this.phoneInput.checkValidity())throw new Error("Invalid phone number format. Only numbers and spaces are allowed.");if(!this.countryInput.value)throw new Error("Country is required.")}async handleSubmit(){if(!F.startDate||!F.endDate)throw new Error("Start date and end date are required to submit the payment form.");try{this.validateInputs()}catch(s){console.error("Validation error:",s),alert(s instanceof Error?s.message:"An unexpected error occurred.");return}let{startDate:t,endDate:e}={startDate:F.startDate,endDate:F.endDate};this.customer={Email:this.emailInput.value,FirstName:this.fNameInput.value,LastName:this.lNameInput.value,Telephone:this.phoneInput.value,NationalityCode:this.countryInput.value,SendMarketingEmails:!1};let r={Client:ce.bookingEngineClient,HotelId:this.parentComponent.apartmentProperties.enterpriseId,Customer:this.customer,Reservations:F.rooms.map(s=>({RoomCategoryId:this.parentComponent.apartmentProperties.categoryId,StartUtc:J.formatForAPI(t.toString()),EndUtc:J.formatForAPI(e.toString()),VoucherCode:F.couponCode||void 0,RateId:F.selectedRateId||"",AdultCount:s.filter(l=>l.isAdult).reduce((l,u)=>l+u.value,0),ChildCount:s.filter(l=>!l.isAdult).reduce((l,u)=>l+u.value,0),ProductIds:F.selectedProducts.map(l=>l.id),Notes:this.notesInput.value||""}))};console.log("Payload for reservation group:",r);let i=JSON.stringify(r,null,2);console.log("JSON Payload:",i);let o=this.submitPaymentBtn.textContent?.trim()??ze("proceedToPayment");this.submitPaymentBtn.textContent=ze("completePayment"),this.submitPaymentBtn.classList.add("is-disabled");let a=await zd(this.parentComponent.apartmentProperties.enterpriseId,r);if(console.log("Reservation Response:",a),"PaymentRequestId"in a&&a.PaymentRequestId){let s=new URL(window.location.href);s.pathname="/reservation-confirmee";let l=`https://app.mews.com/navigator/payment-requests/detail/${a.PaymentRequestId}?returnUrl=${btoa(s.toString())}`;console.log("Payment URL:",l),window.open(l,"_blank")}else if("Id"in a&&a.Id){console.log("Free reservation created successfully:",a);let s=new URL(window.location.href);s.pathname="/reservation-confirmee",s.searchParams.set("reservationId",a.Id),console.log("Confirmation URL:",s.toString()),window.location.href=s.toString()}else{this.submitPaymentBtn.classList.remove("is-disabled"),this.submitPaymentBtn.textContent=o;let s="Message"in a&&a.Message?a.Message:"Reservation could not be created. Please try again later or contact Support.";console.error("Reservation creation failed:",a),alert(s);return}}};var Ud=(n,t)=>{let e=`${ce.bookingEngine_url}/vouchers/validate`,r={method:"POST",headers:ce.headers,body:JSON.stringify(t)};return Bn(e,r,n)};var Na=class{constructor(t){this.parentComponent=t;L(this,"element");L(this,"summaryItemWrapperElement");L(this,"summaryItemElement");L(this,"itemNameTemplateElement");L(this,"itemRowTemplateElement");L(this,"totalPriceElement");L(this,"taxElement");L(this,"submitElement");L(this,"couponInputElement");L(this,"couponApplyElement");L(this,"statusTextElement");nr("loading:start",e=>rr(!0,e)),nr("loading:end",e=>rr(!1,e)),this.element=K("summary-box"),this.summaryItemWrapperElement=K("summary-items-wrapper",this.element),this.summaryItemElement=K("summary-item",this.summaryItemWrapperElement),this.itemNameTemplateElement=K("name",this.summaryItemElement),this.itemRowTemplateElement=K("row",this.summaryItemElement),this.totalPriceElement=K("total",this.element),this.taxElement=K("tax",this.element),this.submitElement=K("submit",this.element),this.couponInputElement=K("coupon-input",this.element),this.couponApplyElement=K("apply-coupon",this.element),this.statusTextElement=K("status-text",this.element)}init(){this.updateDOM(),it("loading:end",this.element)}refresh(){it("loading:end",this.element)}toggleVisibility(t=!0){this.element.classList.toggle("hide",!t),Array.from(this.element.children).forEach(e=>{e instanceof HTMLDivElement&&e.classList.toggle("hide",!t)})}updateDOM(){xt(this.couponInputElement,"input",()=>{F.updateCouponCode(mo(this.couponInputElement))}),xt(this.couponApplyElement,"click",async t=>{t.preventDefault(),it("loading:start",this.element),Ud(this.parentComponent.apartmentProperties.enterpriseId,{Client:ce.bookingEngineClient,HotelId:this.parentComponent.apartmentProperties.enterpriseId,VoucherCode:F.couponCode}).then(async e=>{let{IsValid:r}=e;if(this.statusTextElement.textContent=r?ze("couponValid"):ze("couponInvalid"),this.statusTextElement.style.color=r?"#1bcb00":"#f44900",r)try{it("loading:start",this.element),await this.parentComponent.fetchReservationPricing(),console.log("Reservation pricing updated with voucher code")}catch(i){console.error("Error updating reservation pricing with voucher code:",i),this.statusTextElement.textContent=ze("couponError"),this.statusTextElement.style.color="#f44900"}}).catch(e=>{console.error("Error validating coupon:",e),this.statusTextElement.textContent=ze("couponError"),this.statusTextElement.style.color="#f44900"}).finally(()=>{it("loading:end",this.element),this.statusTextElement.classList.toggle("hide",!1)})}),Rt(()=>{this.couponInputElement.value!==F.couponCode&&po(this.couponInputElement,F.couponCode);let e=F.getReadonlyState().computed.summary;if(F.isFetching){rr(!0,this.element);return}rr(!1,this.element),this.summaryItemWrapperElement.innerHTML="",e.items.forEach(i=>{let o=this.summaryItemElement.cloneNode(!0),a=K("name",o),s=K("row",o),l=document.createDocumentFragment(),u=i.occupancy.adults||0,h=i.occupancy.children||0,p=lt(a,!0);p.textContent=`[${u} ${ze("adults").toLowerCase()}${h>0?`, ${h} ${ze("children").toLowerCase()}`:""}] x ${i.quantity}`,l.appendChild(p);let y=lt(a,!0);y.textContent=`@ ${i.pricing.avgPerNight.toLocaleString(qe,{style:"currency",currency:"EUR"})}/ ${ze("night")}`,l.appendChild(y);let D=lt(s,!0),T=K("label",D),S=K("price",D);if(T.textContent=`service (${F.nightsCount} ${ze("night").toLowerCase()}${F.nightsCount>1?"s":""}):`,S.textContent=i.pricing.service.toLocaleString?.(qe,{style:"currency",currency:"EUR"})??null,l.appendChild(D),F.selectedProducts.length>0){let se=lt(s,!0),B=K("label",se);K("price",se).remove();let Y=F.selectedProducts.map(ae=>ae.name).join(", ");B.textContent=`Products: ${Y}`,l.appendChild(se)}let N=lt(s,!0),$=K("label",N);$.textContent="Products & Extras:";let G=K("price",N);G.textContent=i.pricing.products.toLocaleString(qe,{style:"currency",currency:"EUR"}),l.appendChild(N);let W=lt(s,!0),ne=K("label",W);ne.textContent="Taxes:";let le=K("price",W);le.textContent=i.pricing.taxes.toLocaleString(qe,{style:"currency",currency:"EUR"}),l.appendChild(W);let oe=lt(s,!0),Ce=K("label",oe);Ce.textContent="Subtotal:";let Te=K("price",oe);Te.textContent=i.pricing.subtotal.toLocaleString(qe,{style:"currency",currency:"EUR"}),l.appendChild(oe),o.innerHTML="",o.appendChild(l),this.summaryItemWrapperElement.appendChild(o)});let r=e.totals.taxes||0;this.taxElement.textContent=r>0?r.toLocaleString(qe,{style:"currency",currency:"EUR"}):"--",this.totalPriceElement.textContent=e.totals.grandTotal.toLocaleString(qe,{style:"currency",currency:"EUR"})})}};var Oa=class{constructor(t){this.parentComponent=t;L(this,"element");L(this,"tariffsWrapperElement");L(this,"tariffTemplateElement");this.element=K("offer-box"),this.tariffsWrapperElement=K("offers-list",this.element),this.tariffTemplateElement=K("offer-wrapper",this.element)}init(){this.updateDOM()}refresh(){}toggleVisibility(t=!0){this.element.classList.toggle("hide",!t)}updateDOM(){Rt(()=>{if(F.isFetching){console.log("[TariffsSection] Skipping render during fetch operation");return}if(F.computedRates.length===0){console.log("[TariffsSection] No computed rates available, skipping render");return}console.log("[TariffsSection] Rendering tariffs:",{ratesCount:F.computedRates.length,isFetching:F.isFetching});let t=document.createDocumentFragment();F.computedRates.sort((r,i)=>{let o=r.price?.AverageAmountPerTimeUnit?.GrossValue||0,a=i.price?.AverageAmountPerTimeUnit?.GrossValue||0;return o-a}).forEach(r=>{let i=lt(this.tariffTemplateElement,!0);i.removeAttribute("id");let o=K("name",i);o.textContent=r.name;let a=K("description",i);a.textContent=r.description;let s=K("price",i),l=r.price?.AverageAmountPerTimeUnit?.GrossValue||0;s.textContent=l.toLocaleString(qe,{style:"currency",currency:"EUR"});let u=F.rates.find(T=>T.id===r.id),h=K("label",i),p=K("discount-badge",i),y=K("discount-label",p);if(u)if(h.textContent=u.shortName,u.pricing?.DependentRatePricing){let T=u.pricing?.DependentRatePricing.RelativeAdjustment*100;T===0?p.classList.add("hide"):y.textContent=`${T>0?"+":""}${T}%`}else p.classList.add("hide");else h.classList.add("hide"),p.classList.add("hide");let D=K("radio-input",i);D.value=r.id,r.id===F.selectedRateId&&D.previousElementSibling.classList.add("w--redirected-checked"),xt(D,"change",()=>{D.checked&&F.updateSelectedRateId(r.id)}),t.appendChild(i)}),this.tariffsWrapperElement.innerHTML="",this.tariffsWrapperElement.appendChild(t)})}};var Ha=class{constructor(t){L(this,"apartmentProperties");L(this,"detailsSection");L(this,"optionsSection");L(this,"tariffsSection");L(this,"summarySection");L(this,"paymentModal");nr("loading:start",e=>rr(!0,e)),nr("loading:end",e=>rr(!1,e)),this.apartmentProperties=t,F.setCmsApartmentData(t)}init(){it("loading:start",document.body);let t=Yt.startDate?J.safeParsePlainDate(Yt.startDate):Qr,e=Yt.endDate?J.safeParsePlainDate(Yt.endDate):uo;t&&F.updateStartDate(t),e&&F.updateEndDate(e),this.fetchAPIData().then(()=>{this.parseAPIData().then(()=>{let r=F.rates.find(i=>i.isDefault||i.isBaseRate);console.log("#=> Default Rate:",r),F.updateSelectedRateId(r?.id||F.computedRates.find(i=>i.ordering===0&&i.groupOrdering===0)?.id||F.computedRates[0]?.id||null),this.detailsSection=new xa(this),this.detailsSection.init(),this.optionsSection=new Aa(this),this.optionsSection.toggleVisibility(!0),this.optionsSection.init(),this.tariffsSection=new Oa(this),this.tariffsSection.toggleVisibility(!0),this.tariffsSection.init(),this.summarySection=new Na(this),this.summarySection.toggleVisibility(!0),this.summarySection.init(),this.paymentModal=new La(this),this.paymentModal.toggleVisibility(!1),this.paymentModal.init(),this.initPricingButler(),this.initAvailabilityPricingUpdater(),it("loading:end",document.body)}).catch(r=>{console.error("Error initializing reservation component",r),alert("An error occurred. Please try again later.")})}),console.log("#=> State:",F.getReadonlyState())}initPricingButler(){let t=(0,Fc.default)(async()=>{console.log("[PricingButler] Fetching reservation pricing..."),await F.fetchReservationPricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId)},500);Rt(()=>{let{rooms:e}=F,{startDate:r}=F,{endDate:i}=F,{selectedProducts:o}=F,{selectedRateId:a}=F,{couponCode:s}=F;if(console.log("[PricingButler] Dependencies changed:",{roomsCount:e.length,startDate:r?.toString(),endDate:i?.toString(),selectedProductsCount:o.length,selectedRateId:a,couponCode:s}),e.length===0){console.log("[PricingButler] No rooms set, skipping pricing update.");return}if(!r||!i){console.log("[PricingButler] Start date or end date is not set, skipping pricing update.");return}if(J.isBefore(r,i)){console.log("[PricingButler] Start date is after or equal to end date, skipping pricing update.");return}t()})}initAvailabilityPricingUpdater(){let t=(0,Fc.default)(async()=>{try{await F.fetchAvailability(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),await F.fetchServicePricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),it("loading:end",document.body)}catch(e){console.error("Error updating availability and pricing data:",e)}},500);Rt(()=>{it("loading:start",document.body);let{startDate:e,endDate:r}={startDate:F.startDate,endDate:F.endDate};if(!e||!r){console.warn("Start date or end date is not set, skipping availability and pricing updates.");return}if(J.isBefore(e,r)){console.warn("Start date is after or equal to end date, skipping API requests.");return}t()}),Rt(()=>{it("loading:start",document.body);let{availabilities:e,servicePricing:r,isAvailable:i}={availabilities:F.availabilities,servicePricing:F.servicePricing,isAvailable:F.isAvailable},o=K("banner-box");if(o&&o.classList.toggle("hide",i),this.optionsSection&&this.optionsSection.toggleVisibility(i),this.tariffsSection&&this.tariffsSection.toggleVisibility(i),this.summarySection&&this.summarySection.toggleVisibility(i),r&&!F.selectedRateId&&F.computedRates.length>0){let a=F.rates.find(s=>s.isDefault||s.isBaseRate);F.updateSelectedRateId(a?.id||F.computedRates.find(s=>s.ordering===0&&s.groupOrdering===0)?.id||F.computedRates[0]?.id||null)}e&&r&&this.refreshUIComponents()})}async fetchAPIData(){console.log("#=> Fetching API data for reservation component..."),await F.initializeResources(this.apartmentProperties.enterpriseId),await F.initializeRooms(),await F.fetchHotel(this.apartmentProperties.enterpriseId),await F.fetchAvailability(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),await F.fetchServicePricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),await F.fetchReservationPricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),await F.fetchRates(this.apartmentProperties.enterpriseId)}async parseAPIData(){}refreshUIComponents(){if(F.computedRates.length>0&&!F.selectedRateId){let e=F.rates.find(r=>r.isDefault||r.isBaseRate);F.updateSelectedRateId(e?.id||F.computedRates.find(r=>r.ordering===0&&r.groupOrdering===0)?.id||F.computedRates[0]?.id||null)}let t=K("banner-box");t&&t.classList.toggle("hide",F.isAvailable),this.optionsSection&&(this.optionsSection.toggleVisibility(F.isAvailable),this.optionsSection.refresh()),this.tariffsSection&&(this.tariffsSection.toggleVisibility(F.isAvailable),this.tariffsSection.refresh()),this.summarySection&&(this.summarySection.toggleVisibility(F.isAvailable),this.summarySection.refresh()),it("loading:end",document.body)}async fetchReservationPricing(){try{await F.fetchServicePricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId);let t=await F.fetchReservationPricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId);return this.refreshUIComponents(),t}catch(t){throw console.error("Error fetching reservation pricing:",t),t}}handleDateChange(t,e){return t&&e&&Ae.PlainDate.compare(t,e)>=0?(console.warn("Invalid date range: start date must be before end date"),!1):(t&&F.updateStartDate(t),e&&F.updateEndDate(e),!0)}scrollToTariffsSection(){let t=document.getElementById("tariff-section");t&&setTimeout(()=>{t.scrollIntoView({behavior:"smooth",block:"start"})},300)}};function Gm(){try{let n=window.WebflowCMSData_apartment;console.log("#=> Properties",n),new Ha(n).init()}catch(n){console.error("Error initializing reservation component",n)}}window.Webflow||(window.Webflow=[]);window.Webflow.push(async()=>{Gm()});export{Gm as initApparthotelsBookingTemplate};
|
|
7
|
+
`}}function w(){e.calendarContainer.classList.add("hasWeeks");var f=Se("div","flatpickr-weekwrapper");f.appendChild(Se("span","flatpickr-weekday",e.l10n.weekAbbreviation));var b=Se("div","flatpickr-weeks");return f.appendChild(b),{weekWrapper:f,weekNumbers:b}}function _(f,b){b===void 0&&(b=!0);var M=b?f:f-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,Fe("onYearChange"),ae()),Y(),Fe("onMonthChange"),Eo())}function R(f,b){if(f===void 0&&(f=!0),b===void 0&&(b=!0),e.input.value="",e.altInput!==void 0&&(e.altInput.value=""),e.mobileInput!==void 0&&(e.mobileInput.value=""),e.selectedDates=[],e.latestSelectedDateObj=void 0,b===!0&&(e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth()),e.config.enableTime===!0){var M=Ia(e.config),A=M.hours,q=M.minutes,Q=M.seconds;D(A,q,Q)}e.redraw(),f&&Fe("onChange")}function P(){e.isOpen=!1,e.isMobile||(e.calendarContainer!==void 0&&e.calendarContainer.classList.remove("open"),e._input!==void 0&&e._input.classList.remove("active")),Fe("onClose")}function j(){e.config!==void 0&&Fe("onDestroy");for(var f=e._handlers.length;f--;)e._handlers[f].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 b=e.calendarContainer.parentNode;if(b.lastChild&&b.removeChild(b.lastChild),b.parentNode){for(;b.firstChild;)b.parentNode.insertBefore(b.firstChild,b);b.parentNode.removeChild(b)}}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 O(f){return e.calendarContainer.contains(f)}function X(f){if(e.isOpen&&!e.config.inline){var b=jt(f),M=O(b),A=b===e.input||b===e.altInput||e.element.contains(b)||f.path&&f.path.indexOf&&(~f.path.indexOf(e.input)||~f.path.indexOf(e.altInput)),q=!A&&!M&&!O(f.relatedTarget),Q=!e.config.ignoredFocusElements.some(function(ye){return ye.contains(b)});q&&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 re(f){if(!(!f||e.config.minDate&&f<e.config.minDate.getFullYear()||e.config.maxDate&&f>e.config.maxDate.getFullYear())){var b=f,M=e.currentYear!==b;e.currentYear=b||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(),Fe("onYearChange"),ae())}}function Z(f,b){var M;b===void 0&&(b=!0);var A=e.parseDate(f,void 0,b);if(e.config.minDate&&A&&zt(A,e.config.minDate,b!==void 0?b:!e.minDateHasTime)<0||e.config.maxDate&&A&&zt(A,e.config.maxDate,b!==void 0?b:!e.maxDateHasTime)>0)return!1;if(!e.config.enable&&e.config.disable.length===0)return!0;if(A===void 0)return!1;for(var q=!!e.config.enable,Q=(M=e.config.enable)!==null&&M!==void 0?M:e.config.disable,ye=0,te=void 0;ye<Q.length;ye++){if(te=Q[ye],typeof te=="function"&&te(A))return q;if(te instanceof Date&&A!==void 0&&te.getTime()===A.getTime())return q;if(typeof te=="string"){var De=e.parseDate(te,void 0,!0);return De&&De.getTime()===A.getTime()?q:!q}else if(typeof te=="object"&&A!==void 0&&te.from&&te.to&&A.getTime()>=te.from.getTime()&&A.getTime()<=te.to.getTime())return q}return!q}function V(f){return e.daysContainer!==void 0?f.className.indexOf("hidden")===-1&&f.className.indexOf("flatpickr-disabled")===-1&&e.daysContainer.contains(f):!1}function ue(f){var b=f.target===e._input,M=e._input.value.trimEnd()!==ja();b&&M&&!(f.relatedTarget&&O(f.relatedTarget))&&e.setDate(e._input.value,!0,f.target===e.altInput?e.config.altFormat:e.config.dateFormat)}function pe(f){var b=jt(f),M=e.config.wrap?n.contains(b):b===e._input,A=e.config.allowInput,q=e.isOpen&&(!A||!M),Q=e.config.inline&&M&&!A;if(f.keyCode===13&&M){if(A)return e.setDate(e._input.value,!0,b===e.altInput?e.config.altFormat:e.config.dateFormat),e.close(),b.blur();e.open()}else if(O(b)||q||Q){var ye=!!e.timeContainer&&e.timeContainer.contains(b);switch(f.keyCode){case 13:ye?(f.preventDefault(),l(),Fa()):$c(f);break;case 27:f.preventDefault(),Fa();break;case 8:case 46:M&&!e.config.allowInput&&(f.preventDefault(),e.clear());break;case 37:case 39:if(!ye&&!M){f.preventDefault();var te=o();if(e.daysContainer!==void 0&&(A===!1||te&&V(te))){var De=f.keyCode===39?1:-1;f.ctrlKey?(f.stopPropagation(),_(De),B(Te(1),0)):B(void 0,De)}}else e.hourElement&&e.hourElement.focus();break;case 38:case 40:f.preventDefault();var ee=f.keyCode===40?1:-1;e.daysContainer&&b.$i!==void 0||b===e.input||b===e.altInput?f.ctrlKey?(f.stopPropagation(),re(e.currentYear-ee),B(Te(1),0)):ye||B(void 0,ee*7):b===e.currentYearElement?re(e.currentYear-ee):e.config.enableTime&&(!ye&&e.hourElement&&e.hourElement.focus(),l(f),e._debouncedChange());break;case 9:if(ye){var de=[e.hourElement,e.minuteElement,e.secondElement,e.amPM].concat(e.pluginElements).filter(function(Ut){return Ut}),xe=de.indexOf(b);if(xe!==-1){var dn=de[xe+(f.shiftKey?-1:1)];f.preventDefault(),(dn||e._input).focus()}}else!e.config.noCalendar&&e.daysContainer&&e.daysContainer.contains(b)&&f.shiftKey&&(f.preventDefault(),e._input.focus());break;default:break}}if(e.amPM!==void 0&&b===e.amPM)switch(f.key){case e.l10n.amPM[0].charAt(0):case e.l10n.amPM[0].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[0],p(),En();break;case e.l10n.amPM[1].charAt(0):case e.l10n.amPM[1].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[1],p(),En();break}(M||O(b))&&Fe("onKeyDown",f)}function we(f,b){if(b===void 0&&(b="flatpickr-day"),!(e.selectedDates.length!==1||f&&(!f.classList.contains(b)||f.classList.contains("flatpickr-disabled")))){for(var M=f?f.dateObj.getTime():e.days.firstElementChild.dateObj.getTime(),A=e.parseDate(e.selectedDates[0],void 0,!0).getTime(),q=Math.min(M,e.selectedDates[0].getTime()),Q=Math.max(M,e.selectedDates[0].getTime()),ye=!1,te=0,De=0,ee=q;ee<Q;ee+=Hd.DAY)Z(new Date(ee),!0)||(ye=ye||ee>q&&ee<Q,ee<A&&(!te||ee>te)?te=ee:ee>A&&(!De||ee<De)&&(De=ee));var de=Array.from(e.rContainer.querySelectorAll("*:nth-child(-n+"+e.config.showMonths+") > ."+b));de.forEach(function(xe){var dn=xe.dateObj,Ut=dn.getTime(),oi=te>0&&Ut<te||De>0&&Ut>De;if(oi){xe.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(Tr){xe.classList.remove(Tr)});return}else if(ye&&!oi)return;["startRange","inRange","endRange","notAllowed"].forEach(function(Tr){xe.classList.remove(Tr)}),f!==void 0&&(f.classList.add(M<=e.selectedDates[0].getTime()?"startRange":"endRange"),A<M&&Ut===A?xe.classList.add("startRange"):A>M&&Ut===A&&xe.classList.add("endRange"),Ut>=te&&(De===0||Ut<=De)&&Nd(Ut,A,M)&&xe.classList.add("inRange"))})}}function _e(){e.isOpen&&!e.config.static&&!e.config.inline&&Yn()}function Oe(f,b){if(b===void 0&&(b=e._positionElement),e.isMobile===!0){if(f){f.preventDefault();var M=jt(f);M&&M.blur()}e.mobileInput!==void 0&&(e.mobileInput.focus(),e.mobileInput.click()),Fe("onOpen");return}else if(e._input.disabled||e.config.inline)return;var A=e.isOpen;e.isOpen=!0,A||(e.calendarContainer.classList.add("open"),e._input.classList.add("active"),Fe("onOpen"),Yn(b)),e.config.enableTime===!0&&e.config.noCalendar===!0&&e.config.allowInput===!1&&(f===void 0||!e.timeContainer.contains(f.relatedTarget))&&setTimeout(function(){return e.hourElement.select()},50)}function Ve(f){return function(b){var M=e.config["_"+f+"Date"]=e.parseDate(b,e.config.dateFormat),A=e.config["_"+(f==="min"?"max":"min")+"Date"];M!==void 0&&(e[f==="min"?"minDateHasTime":"maxDateHasTime"]=M.getHours()>0||M.getMinutes()>0||M.getSeconds()>0),e.selectedDates&&(e.selectedDates=e.selectedDates.filter(function(q){return Z(q)}),!e.selectedDates.length&&f==="min"&&y(M),En()),e.daysContainer&&(wo(),M!==void 0?e.currentYearElement[f]=M.getFullYear().toString():e.currentYearElement.removeAttribute(f),e.currentYearElement.disabled=!!A&&M!==void 0&&A.getFullYear()===M.getFullYear())}}function ot(){var f=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],b=ht(ht({},JSON.parse(JSON.stringify(n.dataset||{}))),t),M={};e.config.parseDate=b.parseDate,e.config.formatDate=b.formatDate,Object.defineProperty(e.config,"enable",{get:function(){return e.config._enable},set:function(de){e.config._enable=zc(de)}}),Object.defineProperty(e.config,"disable",{get:function(){return e.config._disable},set:function(de){e.config._disable=zc(de)}});var A=b.mode==="time";if(!b.dateFormat&&(b.enableTime||A)){var q=We.defaultConfig.dateFormat||ar.dateFormat;M.dateFormat=b.noCalendar||A?"H:i"+(b.enableSeconds?":S":""):q+" H:i"+(b.enableSeconds?":S":"")}if(b.altInput&&(b.enableTime||A)&&!b.altFormat){var Q=We.defaultConfig.altFormat||ar.altFormat;M.altFormat=b.noCalendar||A?"h:i"+(b.enableSeconds?":S K":" K"):Q+(" h:i"+(b.enableSeconds?":S":"")+" K")}Object.defineProperty(e.config,"minDate",{get:function(){return e.config._minDate},set:Ve("min")}),Object.defineProperty(e.config,"maxDate",{get:function(){return e.config._maxDate},set:Ve("max")});var ye=function(de){return function(xe){e.config[de==="min"?"_minTime":"_maxTime"]=e.parseDate(xe,"H:i:S")}};Object.defineProperty(e.config,"minTime",{get:function(){return e.config._minTime},set:ye("min")}),Object.defineProperty(e.config,"maxTime",{get:function(){return e.config._maxTime},set:ye("max")}),b.mode==="time"&&(e.config.noCalendar=!0,e.config.enableTime=!0),Object.assign(e.config,M,b);for(var te=0;te<f.length;te++)e.config[f[te]]=e.config[f[te]]===!0||e.config[f[te]]==="true";Ta.filter(function(de){return e.config[de]!==void 0}).forEach(function(de){e.config[de]=ka(e.config[de]||[]).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 te=0;te<e.config.plugins.length;te++){var De=e.config.plugins[te](e)||{};for(var ee in De)Ta.indexOf(ee)>-1?e.config[ee]=ka(De[ee]).map(a).concat(e.config[ee]):typeof b[ee]>"u"&&(e.config[ee]=De[ee])}b.altInputClass||(e.config.altInputClass=Qt().className+" "+e.config.altInputClass),Fe("onParseConfig")}function Qt(){return e.config.wrap?n.querySelector("[data-input]"):n}function sr(){typeof e.config.locale!="object"&&typeof We.l10ns[e.config.locale]>"u"&&e.config.errorHandler(new Error("flatpickr: invalid locale "+e.config.locale)),e.l10n=ht(ht({},We.l10ns.default),typeof e.config.locale=="object"?e.config.locale:e.config.locale!=="default"?We.l10ns[e.config.locale]:void 0),Fn.D="("+e.l10n.weekdays.shorthand.join("|")+")",Fn.l="("+e.l10n.weekdays.longhand.join("|")+")",Fn.M="("+e.l10n.months.shorthand.join("|")+")",Fn.F="("+e.l10n.months.longhand.join("|")+")",Fn.K="("+e.l10n.amPM[0]+"|"+e.l10n.amPM[1]+"|"+e.l10n.amPM[0].toLowerCase()+"|"+e.l10n.amPM[1].toLowerCase()+")";var f=ht(ht({},t),JSON.parse(JSON.stringify(n.dataset||{})));f.time_24hr===void 0&&We.defaultConfig.time_24hr===void 0&&(e.config.time_24hr=e.l10n.time_24hr),e.formatDate=Bc(e),e.parseDate=Pa({config:e.config,l10n:e.l10n})}function Yn(f){if(typeof e.config.position=="function")return void e.config.position(e,f);if(e.calendarContainer!==void 0){Fe("onPreCalendarPosition");var b=f||e._positionElement,M=Array.prototype.reduce.call(e.calendarContainer.children,function(ch,lh){return ch+lh.offsetHeight},0),A=e.calendarContainer.offsetWidth,q=e.config.position.split(" "),Q=q[0],ye=q.length>1?q[1]:null,te=b.getBoundingClientRect(),De=window.innerHeight-te.bottom,ee=Q==="above"||Q!=="below"&&De<M&&te.top>M,de=window.pageYOffset+te.top+(ee?-M-2:b.offsetHeight+2);if(dt(e.calendarContainer,"arrowTop",!ee),dt(e.calendarContainer,"arrowBottom",ee),!e.config.inline){var xe=window.pageXOffset+te.left,dn=!1,Ut=!1;ye==="center"?(xe-=(A-te.width)/2,dn=!0):ye==="right"&&(xe-=A-te.width,Ut=!0),dt(e.calendarContainer,"arrowLeft",!dn&&!Ut),dt(e.calendarContainer,"arrowCenter",dn),dt(e.calendarContainer,"arrowRight",Ut);var oi=window.document.body.offsetWidth-(window.pageXOffset+te.right),Tr=xe+A>window.document.body.offsetWidth,th=oi+A>window.document.body.offsetWidth;if(dt(e.calendarContainer,"rightMost",Tr),!e.config.static)if(e.calendarContainer.style.top=de+"px",!Tr)e.calendarContainer.style.left=xe+"px",e.calendarContainer.style.right="auto";else if(!th)e.calendarContainer.style.left="auto",e.calendarContainer.style.right=oi+"px";else{var za=ii();if(za===void 0)return;var nh=window.document.body.offsetWidth,rh=Math.max(0,nh/2-A/2),ih=".flatpickr-calendar.centerMost:before",oh=".flatpickr-calendar.centerMost:after",ah=za.cssRules.length,sh="{left:"+te.left+"px;right:auto;}";dt(e.calendarContainer,"rightMost",!1),dt(e.calendarContainer,"centerMost",!0),za.insertRule(ih+","+oh+sh,ah),e.calendarContainer.style.left=rh+"px",e.calendarContainer.style.right="auto"}}}}function ii(){for(var f=null,b=0;b<document.styleSheets.length;b++){var M=document.styleSheets[b];if(M.cssRules){try{M.cssRules}catch{continue}f=M;break}}return f??bo()}function bo(){var f=document.createElement("style");return document.head.appendChild(f),f.sheet}function wo(){e.config.noCalendar||e.isMobile||(ae(),Eo(),Y())}function Fa(){e._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(e.close,0):e.close()}function $c(f){f.preventDefault(),f.stopPropagation();var b=function(de){return de.classList&&de.classList.contains("flatpickr-day")&&!de.classList.contains("flatpickr-disabled")&&!de.classList.contains("notAllowed")},M=Oc(jt(f),b);if(M!==void 0){var A=M,q=e.latestSelectedDateObj=new Date(A.dateObj.getTime()),Q=(q.getMonth()<e.currentMonth||q.getMonth()>e.currentMonth+e.config.showMonths-1)&&e.config.mode!=="range";if(e.selectedDateElem=A,e.config.mode==="single")e.selectedDates=[q];else if(e.config.mode==="multiple"){var ye=$a(q);ye?e.selectedDates.splice(parseInt(ye),1):e.selectedDates.push(q)}else e.config.mode==="range"&&(e.selectedDates.length===2&&e.clear(!1,!1),e.latestSelectedDateObj=q,e.selectedDates.push(q),zt(q,e.selectedDates[0],!0)!==0&&e.selectedDates.sort(function(de,xe){return de.getTime()-xe.getTime()}));if(p(),Q){var te=e.currentYear!==q.getFullYear();e.currentYear=q.getFullYear(),e.currentMonth=q.getMonth(),te&&(Fe("onYearChange"),ae()),Fe("onMonthChange")}if(Eo(),Y(),En(),!Q&&e.config.mode!=="range"&&e.config.showMonths===1?Ce(A):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 De=e.config.mode==="single"&&!e.config.enableTime,ee=e.config.mode==="range"&&e.selectedDates.length===2&&!e.config.enableTime;(De||ee)&&Fa()}N()}}var Do={locale:[sr,E],showMonths:[H,s,v],minDate:[G],maxDate:[G],positionElement:[Uc],clickOpens:[function(){e.config.clickOpens===!0?(C(e._input,"focus",e.open),C(e._input,"click",e.open)):(e._input.removeEventListener("focus",e.open),e._input.removeEventListener("click",e.open))}]};function qd(f,b){if(f!==null&&typeof f=="object"){Object.assign(e.config,f);for(var M in f)Do[M]!==void 0&&Do[M].forEach(function(A){return A()})}else e.config[f]=b,Do[f]!==void 0?Do[f].forEach(function(A){return A()}):Ta.indexOf(f)>-1&&(e.config[f]=ka(b));e.redraw(),En(!0)}function jc(f,b){var M=[];if(f instanceof Array)M=f.map(function(A){return e.parseDate(A,b)});else if(f instanceof Date||typeof f=="number")M=[e.parseDate(f,b)];else if(typeof f=="string")switch(e.config.mode){case"single":case"time":M=[e.parseDate(f,b)];break;case"multiple":M=f.split(e.config.conjunction).map(function(A){return e.parseDate(A,b)});break;case"range":M=f.split(e.l10n.rangeSeparator).map(function(A){return e.parseDate(A,b)});break;default:break}else e.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(f)));e.selectedDates=e.config.allowInvalidPreload?M:M.filter(function(A){return A instanceof Date&&Z(A,!1)}),e.config.mode==="range"&&e.selectedDates.sort(function(A,q){return A.getTime()-q.getTime()})}function Wd(f,b,M){if(b===void 0&&(b=!1),M===void 0&&(M=e.config.dateFormat),f!==0&&!f||f instanceof Array&&f.length===0)return e.clear(b);jc(f,M),e.latestSelectedDateObj=e.selectedDates[e.selectedDates.length-1],e.redraw(),G(void 0,b),y(),e.selectedDates.length===0&&e.clear(!1),En(b),b&&Fe("onChange")}function zc(f){return f.slice().map(function(b){return typeof b=="string"||typeof b=="number"||b instanceof Date?e.parseDate(b,void 0,!0):b&&typeof b=="object"&&b.from&&b.to?{from:e.parseDate(b.from,void 0),to:e.parseDate(b.to,void 0)}:b}).filter(function(b){return b})}function Gd(){e.selectedDates=[],e.now=e.parseDate(e.config.now)||new Date;var f=e.config.defaultDate||((e.input.nodeName==="INPUT"||e.input.nodeName==="TEXTAREA")&&e.input.placeholder&&e.input.value===e.input.placeholder?null:e.input.value);f&&jc(f,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 Kd(){if(e.input=Qt(),!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=Se(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"),Uc()}function Uc(){e._positionElement=e.config.positionElement||e._input}function Zd(){var f=e.config.enableTime?e.config.noCalendar?"time":"datetime-local":"date";e.mobileInput=Se("input",e.input.className+" flatpickr-mobile"),e.mobileInput.tabIndex=1,e.mobileInput.type=f,e.mobileInput.disabled=e.input.disabled,e.mobileInput.required=e.input.required,e.mobileInput.placeholder=e.input.placeholder,e.mobileFormatStr=f==="datetime-local"?"Y-m-d\\TH:i:S":f==="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{}C(e.mobileInput,"change",function(b){e.setDate(jt(b).value,!1,e.mobileFormatStr),Fe("onChange"),Fe("onClose")})}function Jd(f){if(e.isOpen===!0)return e.close();e.open(f)}function Fe(f,b){if(e.config!==void 0){var M=e.config[f];if(M!==void 0&&M.length>0)for(var A=0;M[A]&&A<M.length;A++)M[A](e.selectedDates,e.input.value,e,b);f==="onChange"&&(e.input.dispatchEvent(Ya("change")),e.input.dispatchEvent(Ya("input")))}}function Ya(f){var b=document.createEvent("Event");return b.initEvent(f,!0,!0),b}function $a(f){for(var b=0;b<e.selectedDates.length;b++){var M=e.selectedDates[b];if(M instanceof Date&&zt(M,f)===0)return""+b}return!1}function Xd(f){return e.config.mode!=="range"||e.selectedDates.length<2?!1:zt(f,e.selectedDates[0])>=0&&zt(f,e.selectedDates[1])<=0}function Eo(){e.config.noCalendar||e.isMobile||!e.monthNav||(e.yearElements.forEach(function(f,b){var M=new Date(e.currentYear,e.currentMonth,1);M.setMonth(e.currentMonth+b),e.config.showMonths>1||e.config.monthSelectorType==="static"?e.monthElements[b].textContent=vo(M.getMonth(),e.config.shorthandCurrentMonth,e.l10n)+" ":e.monthsDropdownContainer.value=M.getMonth().toString(),f.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 ja(f){var b=f||(e.config.altInput?e.config.altFormat:e.config.dateFormat);return e.selectedDates.map(function(M){return e.formatDate(M,b)}).filter(function(M,A,q){return e.config.mode!=="range"||e.config.enableTime||q.indexOf(M)===A}).join(e.config.mode!=="range"?e.config.conjunction:e.l10n.rangeSeparator)}function En(f){f===void 0&&(f=!0),e.mobileInput!==void 0&&e.mobileFormatStr&&(e.mobileInput.value=e.latestSelectedDateObj!==void 0?e.formatDate(e.latestSelectedDateObj,e.mobileFormatStr):""),e.input.value=ja(e.config.dateFormat),e.altInput!==void 0&&(e.altInput.value=ja(e.config.altFormat)),f!==!1&&Fe("onValueUpdate")}function Qd(f){var b=jt(f),M=e.prevMonthNav.contains(b),A=e.nextMonthNav.contains(b);M||A?_(M?-1:1):e.yearElements.indexOf(b)>=0?b.select():b.classList.contains("arrowUp")?e.changeYear(e.currentYear+1):b.classList.contains("arrowDown")&&e.changeYear(e.currentYear-1)}function eh(f){f.preventDefault();var b=f.type==="keydown",M=jt(f),A=M;e.amPM!==void 0&&M===e.amPM&&(e.amPM.textContent=e.l10n.amPM[$t(e.amPM.textContent===e.l10n.amPM[0])]);var q=parseFloat(A.getAttribute("min")),Q=parseFloat(A.getAttribute("max")),ye=parseFloat(A.getAttribute("step")),te=parseInt(A.value,10),De=f.delta||(b?f.which===38?1:-1:0),ee=te+ye*De;if(typeof A.value<"u"&&A.value.length===2){var de=A===e.hourElement,xe=A===e.minuteElement;ee<q?(ee=Q+ee+$t(!de)+($t(de)&&$t(!e.amPM)),xe&&ne(void 0,-1,e.hourElement)):ee>Q&&(ee=A===e.hourElement?ee-Q-$t(!e.amPM):q,xe&&ne(void 0,1,e.hourElement)),e.amPM&&de&&(ye===1?ee+te===23:Math.abs(ee-te)>ye)&&(e.amPM.textContent=e.l10n.amPM[$t(e.amPM.textContent===e.l10n.amPM[0])]),A.value=ut(ee)}}return i(),e}function ri(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=Wm(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 ri(this,n)},HTMLElement.prototype.flatpickr=function(n){return ri([this],n)});var We=function(n,t){return typeof n=="string"?ri(window.document.querySelectorAll(n),t):n instanceof Node?ri([n],t):ri(n,t)};We.defaultConfig={};We.l10ns={en:ht({},Ca),default:ht({},Ca)};We.localize=function(n){We.l10ns.default=ht(ht({},We.l10ns.default),n)};We.setDefaults=function(n){We.defaultConfig=ht(ht({},We.defaultConfig),n)};We.parseDate=Pa({});We.formatDate=Bc({});We.compareDates=zt;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(n){return ri(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=We);var Fd=We;var xa=class{constructor(t,e){this.dateInputEl=t;L(this,"minDate");L(this,"maxDate");L(this,"defaultReservationDays");L(this,"hasPrices",!1);L(this,"prices",{});L(this,"availability",{});L(this,"disabledDates",[]);L(this,"selectedStartDate");L(this,"selectedEndDate");L(this,"config");L(this,"instance");L(this,"destroyInstance");L(this,"currentDate");L(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;let r=e.startWithEmptyDates??!1;this.config={...e,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??J.getCurrentDate(),defaultEndDate:e.defaultEndDate??J.getCurrentDate(),startWithEmptyDates:r},this.currentDate=J.getCurrentDate(),this.selectedStartDate=r?null:this.config.defaultStartDate,this.selectedEndDate=r?null: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=J.toJSDate(t),r=this.selectedEndDate?J.toJSDate(this.selectedEndDate):e;this.selectedStartDate=t,this.instance instanceof Ma.Core?this.instance.setStartDate(new ge(t.toString())):this.config.type==="flatpickr"&&this.instance.setDate([e,r],!0)}setEndDate(t){let e=this.selectedStartDate?J.toJSDate(this.selectedStartDate):J.toJSDate(t),r=J.toJSDate(t);this.selectedEndDate=t,this.instance instanceof Ma.Core?this.instance.setEndDate(new ge(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=J.toJSDate(t),i=J.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={tooltip:this.config.tooltip,repick:this.config.repick,tooltipNumber:i=>i-1,locale:{one:"nuit",other:"nuits"}};this.config.startWithEmptyDates||(t.startDate=new ge(this.config.defaultStartDate.toString()),t.endDate=new ge(this.config.defaultEndDate.toString()));let e={element:this.dateInputEl,css:["https://cdn.jsdelivr.net/npm/@easepick/bundle@1.2.1/dist/index.css"],zIndex:10,format:Ku,grid:this.config.grid,calendars:this.config.calendars,header:"",lang:document.documentElement.lang,RangePlugin:t,LockPlugin:{minDate:new ge(this.minDate.toString()),minDays:this.config.minDays,selectForward:!0},AmpPlugin:{darkMode:this.config.darkMode},plugins:[_a,Ea,Da],setup:i=>{i.on("view",o=>{let{view:a,date:s,target:l}=o.detail,u=s?s.format("YYYY-MM-DD"):null;if(a==="CalendarDay"&&u&&this.prices[u]){let h=this.prices[u],p=l.querySelector(`.${ua}`)||document.createElement("span");p.className=ua,p.textContent=`${h.toLocaleString(qe,{style:"currency",currency:"EUR",maximumFractionDigits:0})}`,p.style.color="#c64509",p.style.fontWeight="bold",p.style.fontSize="10px",l.append(p)}}),i.on("select",o=>{let{start:a,end:s}=o.detail;this.selectedStartDate=J.fromString(a.format("YYYY-MM-DD")),this.selectedEndDate=J.fromString(s.format("YYYY-MM-DD"));let l={startDate:a.format("YYYY-MM-DD").toString(),endDate:s.format("YYYY-MM-DD").toString()};it("date:changed",l)})}},r=new Ma.create(e);this.instance=r,this.destroyInstance=()=>r.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(),shorthandCurrentMonth:!0,monthSelectorType:"static",inline:!1,dateFormat:Zu,lang:document.documentElement.lang,zIndex:10,disable:this.disabledDates};this.config.startWithEmptyDates||(e.defaultDate=[this.config.defaultStartDate.toString(),this.config.defaultEndDate.toString()]),Object.assign(e,{onChange:i=>{let o=K("label",this.dateInputEl);if(i.length===2){this.selectedStartDate=J.fromJSDate(i[0]),this.selectedEndDate=J.fromJSDate(i[1]);let a={startDate:this.selectedStartDate.toString(),endDate:this.selectedEndDate.toString()};if(it("date:changed",a),o){let s=this.formatDate(i[0]),l=this.formatDate(i[1]);o.textContent=`${s} - ${l}`}}else this.selectedStartDate=null,this.selectedEndDate=null,it("date:changed",{startDate:"",endDate:""}),o&&(o.textContent="")},onDayCreate:async(i,o,a,s)=>{let l=s.dateObj,u=J.fromJSDate(l),h=J.formatForAPI(u);if(this.prices[h]){let p=this.prices[h],y=document.createElement("span");y.style.marginTop="2px",y.style.color="#c64509",y.style.fontSize="10px",y.style.fontWeight="bold",y.className=ua,y.textContent=`${p.toLocaleString(qe,{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)}}});let r=Fd(this.dateInputEl,e);this.instance=r,this.destroyInstance=()=>r.destroy()}clear(){this.selectedStartDate=null,this.selectedEndDate=null,this.config.type==="flatpickr"&&this.instance.clear?.()}destroy(){window.removeEventListener("resize",this.handleResize),this.destroyInstance&&this.destroyInstance()}formatDate(t){let e=J.fromJSDate(t),r=e.year,i=String(e.month).padStart(2,"0"),o=String(e.day).padStart(2,"0");return qe==="en-US"?`${r}/${i}/${o}`:qe==="fr-FR"||qe==="de-DE"?`${o}/${i}/${r}`:`${r}/${i}/${o}`}};var Aa=class{constructor(t){this.parentComponent=t;L(this,"element");L(this,"nightsCountElement");L(this,"startDateElement");L(this,"endDateElement");L(this,"dateElement");L(this,"roomsWrapperElement");L(this,"roomElementTemplate");L(this,"addRoomElement");L(this,"rooms",[]);L(this,"includePrices",Ju);L(this,"populateCalendarInput",async()=>{if(!this.dateElement){console.error("Date element not found");return}let t=new xa(this.dateElement,{type:"flatpickr",showPrices:!0,defaultReservationDays:3,grid:2,calendars:2,darkMode:!1,tooltip:!0,repick:!1,minDays:1,defaultStartDate:F.startDate||Qr,defaultEndDate:F.endDate||uo});if(t.setMinimumDate(Qr),t.setMaximumDate(uo),t.includePrices(this.includePrices),this.includePrices){let e=await Ad([this.parentComponent.apartmentProperties.enterpriseId]);t.setPrices(e)}return t.initialize(),t});nr("date:changed",e=>{F.updateStartDate(J.fromString(e.startDate)),F.updateEndDate(J.fromString(e.endDate))}),this.element=K("details-box"),this.nightsCountElement=K("nights",this.element),this.startDateElement=K("start-date",this.element),this.endDateElement=K("end-date",this.element),this.dateElement=K("date-element",this.element),this.roomsWrapperElement=K("room-box-wrapper",this.element),this.roomElementTemplate=K("room-box",this.element),this.addRoomElement=K("add-room-button",this.element)}init(){console.log("Initialize DetailsSection"),this.updateDOM(),this.populateCalendarInput()}updateDOM(){It(()=>{this.startDateElement.textContent=F.startDate?J.formatForDisplay(F.startDate):"?"}),It(()=>{this.endDateElement.textContent=F.endDate?J.formatForDisplay(F.endDate):"?"}),It(()=>{this.nightsCountElement.textContent=`${F.nightsCount} ${Be("night").toLowerCase()}${F.nightsCount>1?"s":""}`}),It(()=>{let t=document.createDocumentFragment();F.rooms.forEach((r,i)=>{let o=lt(this.roomElementTemplate,!0),a=K("room",o);a.textContent=`${Be("apartment")} ${i+1}`;let s=K("categories-wrapper",o),l=K("age-category",s),u=document.createDocumentFragment();r.forEach(h=>{let p=lt(l,!0),y=K("category-name",p);y.textContent=h.name;let D=K("input",p);po(D,h.value.toString()),xt(p,"click",T=>{T.preventDefault();let C=i;switch(ed(T.target)){case"decrement":if(h.isAdult){if(r.filter($=>$.isAdult).reduce(($,G)=>$+G.value,0)>1&&h.value>0){let $=F.rooms.map((G,W)=>W===C?G.map(ne=>ne.ageCategoryId===h.ageCategoryId?{...ne,value:ne.value-1}:{...ne}):G);F.updateRooms($)}}else if(h.value>0){let N=F.rooms.map(($,G)=>G===C?$.map(W=>W.ageCategoryId===h.ageCategoryId?{...W,value:W.value-1}:{...W}):$);F.updateRooms(N)}break;case"increment":if(this.computations(r).hasCapacity){let N=F.rooms.map(($,G)=>G===C?$.map(W=>W.ageCategoryId===h.ageCategoryId?{...W,value:W.value+1}:{...W}):$);F.updateRooms(N)}break}},{once:!1}),u.appendChild(p)}),s.innerHTML="",s.appendChild(u),t.appendChild(o)}),this.roomsWrapperElement.innerHTML="",this.roomsWrapperElement.appendChild(t);let{maxAllowedRooms:e}={maxAllowedRooms:F.maxAllowedRooms};console.log(`<<debug>> Current rooms: ${F.rooms.length}, Max allowed rooms: ${e}, Available rooms: ${this.parentComponent.apartmentProperties.availableRooms}`),e>0&&F.rooms.length>=e?(console.log(`<<debug>> Hiding add room button: current rooms ${F.rooms.length} >= max allowed ${e}`),this.addRoomElement.classList.add("hide")):e<=0?(console.log(`<<debug>> Max allowed rooms is non-positive (${e}), using available rooms ${this.parentComponent.apartmentProperties.availableRooms} as limit`),F.rooms.length>=this.parentComponent.apartmentProperties.availableRooms&&(console.log(`<<debug>> Hiding add room button: current rooms ${F.rooms.length} >= available rooms ${this.parentComponent.apartmentProperties.availableRooms}`),this.addRoomElement.classList.add("hide"))):(console.log(`<<debug>> Showing add room button: current rooms ${F.rooms.length} < max allowed or available rooms`),this.addRoomElement.classList.remove("hide"))}),xt(this.addRoomElement,"click",t=>{t.preventDefault();let{maxAllowedRooms:e}={maxAllowedRooms:F.maxAllowedRooms};if(F.rooms.length<e){let i=F.ageCategories.map(a=>{let s=a.classification.toLowerCase()==="adult",l=s?Be("adults"):Be("children"),u=s?1:0;return{isAdult:s,ageCategoryId:a.id,name:l,value:u}}),o=[...F.rooms,i];F.updateRooms(o)}})}toggleVisibility(t=!0){this.element.classList.toggle("hide",!t)}computations(t){let e=t.some(a=>a.value>0),r=t.reduce((a,s)=>a+s.value,0),i=r<this.parentComponent.apartmentProperties.capacity,o=t.filter(a=>a.isAdult).reduce((a,s)=>a+s.value,0);return{hasOccupants:e,totalOccupants:r,hasCapacity:i,totalAdults:o}}};var Yd=(n,t)=>{let e={method:"POST",headers:ce.headers,body:JSON.stringify(t)};return Xe("/images/getUrls",e,n)};function $d(n){return n.ImageUrls.map(t=>({url:t.Url,imageId:t.ImageId}))}var Fc=Ze({}),jd={width:160,height:160};async function zd(n,t){if(t.every(i=>Fc.value[i]))return t.map(i=>Fc.value[i]).flat();let e=await Yd(n,{Images:t.map(i=>({ImageId:i,Width:jd.width,Height:jd.height,ResizeMode:"Cover"}))}),r=$d(e);return r.forEach(i=>{Fc.value[i.imageId]=i}),r}var La=class{constructor(t){this.parentComponent=t;L(this,"element");L(this,"productsWrapperElement");L(this,"productTemplateElement");L(this,"showMoreButtonElement");this.element=K("options-box"),this.productsWrapperElement=K("options-list",this.element),this.productTemplateElement=K("option-wrapper",this.element),this.showMoreButtonElement=K("more-button",this.element)}init(){try{this.updateDOM()}catch(t){console.error("Error initializing OptionsSection:",t)}}refresh(){try{}catch(t){console.error("Error refreshing OptionsSection:",t)}}toggleVisibility(t=!0){this.element.classList.toggle("hide",!t)}updateDOM(){let t=document.createDocumentFragment();[...F.products].sort((r,i)=>{if(r.ordering!==i.ordering)return(r.ordering??0)-(i.ordering??0);let o=r.name,a=i.name;return o<a?-1:o>a?1:(r.ordering===i.ordering,0)}).forEach((r,i)=>{let o=lt(this.productTemplateElement,!0);o.removeAttribute("id");let a=K("name",o);a.textContent=r.name||"";let s=K("price",o);s.textContent=r.price.toLocaleString(qe,{style:"currency",currency:"EUR"});let l=K("label",o);l.textContent=Be(`chargingMode:${r.chargingMode}`),zd(this.parentComponent.apartmentProperties.enterpriseId,r.imageIds).then(h=>{let p=K("image",o);p.src=h[0].url});let u=K("checkbox",o);xt(u,"change",()=>{let h=mo(u),p=F.products.map(y=>y.id===r.id?{...y,selected:h==="true"}:y);F.updateProducts(p)}),o.classList.toggle("hide",i>3),t.appendChild(o)}),Ic(this.productsWrapperElement),this.productsWrapperElement.appendChild(t),xt(this.showMoreButtonElement,"click",()=>{let r=this.showMoreProducts(3);this.showMoreButtonElement.classList.toggle("hide",!r)})}showMoreProducts(t=4){let e=this.productsWrapperElement.querySelectorAll(`${Qu(this.productTemplateElement)}.hide`);return e.forEach((r,i)=>{i<t&&r.classList.toggle("hide",!1)}),e.length>t}};var Ud=(n,t)=>{let e=`${ce.bookingEngine_url}/reservationGroups/create`,r={method:"POST",headers:ce.headers,body:JSON.stringify(t)};return fetch(e,r).then(o=>o.json())};var Na=class{constructor(t){this.parentComponent=t;L(this,"element");L(this,"modalContent");L(this,"modalBg");L(this,"openModalBtn");L(this,"closeModalBtn");L(this,"fNameInput");L(this,"lNameInput");L(this,"emailInput");L(this,"phoneInput");L(this,"countryInput");L(this,"notesInput");L(this,"submitPaymentBtn");L(this,"customer",null);this.element=K("payment-modal"),this.modalContent=K("modal-content",this.element),this.modalBg=K("modal-bg",this.element),this.openModalBtn=K("open-modal"),this.closeModalBtn=K("close-modal"),this.fNameInput=K("fname-input",this.element),this.lNameInput=K("lname-input",this.element),this.emailInput=K("email-input",this.element),this.phoneInput=K("phone-input",this.element),this.countryInput=K("country-input",this.element),this.notesInput=K("notes-input",this.element),this.submitPaymentBtn=K("submit-payment",this.element)}init(){console.log("Initialize PaymentModal"),this.updateDOM()}updateDOM(){xt(this.openModalBtn,"click",()=>{this.toggleVisibility(!0),this.element.scrollIntoView({behavior:"smooth"})}),this.submitPaymentBtn?xt(this.submitPaymentBtn,"click",t=>{t.preventDefault(),this.handleSubmit()}):console.error("Submit Payment button not found in the DOM.")}toggleVisibility(t=!0){this.element.classList.toggle("hide",!t),t?(this.element.style.display="flex",this.element.style.opacity="1",this.modalContent.style.opacity="1",this.element.querySelectorAll("div").forEach(e=>{e.style.opacity="1"})):(this.element.style.opacity="0",this.element.style.display="none")}validateInputs(){if(!this.fNameInput.value||!this.lNameInput.value||!this.emailInput.value||!this.phoneInput.value||!this.countryInput.value)throw new Error("First name, last name, email, phone, and nationality are required.");if(!this.emailInput.checkValidity())throw new Error("Invalid email format.");if(!this.phoneInput.checkValidity())throw new Error("Invalid phone number format. Only numbers and spaces are allowed.");if(!this.countryInput.value)throw new Error("Country is required.")}async handleSubmit(){if(!F.startDate||!F.endDate)throw new Error("Start date and end date are required to submit the payment form.");try{this.validateInputs()}catch(s){console.error("Validation error:",s),alert(s instanceof Error?s.message:"An unexpected error occurred.");return}let{startDate:t,endDate:e}={startDate:F.startDate,endDate:F.endDate};this.customer={Email:this.emailInput.value,FirstName:this.fNameInput.value,LastName:this.lNameInput.value,Telephone:this.phoneInput.value,NationalityCode:this.countryInput.value,SendMarketingEmails:!1};let r={Client:ce.bookingEngineClient,HotelId:this.parentComponent.apartmentProperties.enterpriseId,Customer:this.customer,Reservations:F.rooms.map(s=>({RoomCategoryId:this.parentComponent.apartmentProperties.categoryId,StartUtc:J.formatForAPI(t.toString()),EndUtc:J.formatForAPI(e.toString()),VoucherCode:F.couponCode||void 0,RateId:F.selectedRateId||"",AdultCount:s.filter(l=>l.isAdult).reduce((l,u)=>l+u.value,0),ChildCount:s.filter(l=>!l.isAdult).reduce((l,u)=>l+u.value,0),ProductIds:F.selectedProducts.map(l=>l.id),Notes:this.notesInput.value||""}))};console.log("Payload for reservation group:",r);let i=JSON.stringify(r,null,2);console.log("JSON Payload:",i);let o=this.submitPaymentBtn.textContent?.trim()??Be("proceedToPayment");this.submitPaymentBtn.textContent=Be("completePayment"),this.submitPaymentBtn.classList.add("is-disabled");let a=await Ud(this.parentComponent.apartmentProperties.enterpriseId,r);if(console.log("Reservation Response:",a),"PaymentRequestId"in a&&a.PaymentRequestId){let s=new URL(window.location.href);s.pathname="/reservation-confirmee";let l=`https://app.mews.com/navigator/payment-requests/detail/${a.PaymentRequestId}?returnUrl=${btoa(s.toString())}`;console.log("Payment URL:",l),window.open(l,"_blank")}else if("Id"in a&&a.Id){console.log("Free reservation created successfully:",a);let s=new URL(window.location.href);s.pathname="/reservation-confirmee",s.searchParams.set("reservationId",a.Id),console.log("Confirmation URL:",s.toString()),window.location.href=s.toString()}else{this.submitPaymentBtn.classList.remove("is-disabled"),this.submitPaymentBtn.textContent=o;let s="Message"in a&&a.Message?a.Message:"Reservation could not be created. Please try again later or contact Support.";console.error("Reservation creation failed:",a),alert(s);return}}};var Vd=(n,t)=>{let e=`${ce.bookingEngine_url}/vouchers/validate`,r={method:"POST",headers:ce.headers,body:JSON.stringify(t)};return Bn(e,r,n)};var Oa=class{constructor(t){this.parentComponent=t;L(this,"element");L(this,"summaryItemWrapperElement");L(this,"summaryItemElement");L(this,"itemNameTemplateElement");L(this,"itemRowTemplateElement");L(this,"totalPriceElement");L(this,"taxElement");L(this,"submitElement");L(this,"couponInputElement");L(this,"couponApplyElement");L(this,"statusTextElement");nr("loading:start",e=>rr(!0,e)),nr("loading:end",e=>rr(!1,e)),this.element=K("summary-box"),this.summaryItemWrapperElement=K("summary-items-wrapper",this.element),this.summaryItemElement=K("summary-item",this.summaryItemWrapperElement),this.itemNameTemplateElement=K("name",this.summaryItemElement),this.itemRowTemplateElement=K("row",this.summaryItemElement),this.totalPriceElement=K("total",this.element),this.taxElement=K("tax",this.element),this.submitElement=K("submit",this.element),this.couponInputElement=K("coupon-input",this.element),this.couponApplyElement=K("apply-coupon",this.element),this.statusTextElement=K("status-text",this.element)}init(){this.updateDOM(),it("loading:end",this.element)}refresh(){it("loading:end",this.element)}toggleVisibility(t=!0){this.element.classList.toggle("hide",!t),Array.from(this.element.children).forEach(e=>{e instanceof HTMLDivElement&&e.classList.toggle("hide",!t)})}updateDOM(){xt(this.couponInputElement,"input",()=>{F.updateCouponCode(mo(this.couponInputElement))}),xt(this.couponApplyElement,"click",async t=>{t.preventDefault(),it("loading:start",this.element),Vd(this.parentComponent.apartmentProperties.enterpriseId,{Client:ce.bookingEngineClient,HotelId:this.parentComponent.apartmentProperties.enterpriseId,VoucherCode:F.couponCode}).then(async e=>{let{IsValid:r}=e;if(this.statusTextElement.textContent=r?Be("couponValid"):Be("couponInvalid"),this.statusTextElement.style.color=r?"#1bcb00":"#f44900",r)try{it("loading:start",this.element),await this.parentComponent.fetchReservationPricing(),console.log("Reservation pricing updated with voucher code")}catch(i){console.error("Error updating reservation pricing with voucher code:",i),this.statusTextElement.textContent=Be("couponError"),this.statusTextElement.style.color="#f44900"}}).catch(e=>{console.error("Error validating coupon:",e),this.statusTextElement.textContent=Be("couponError"),this.statusTextElement.style.color="#f44900"}).finally(()=>{it("loading:end",this.element),this.statusTextElement.classList.toggle("hide",!1)})}),It(()=>{this.couponInputElement.value!==F.couponCode&&po(this.couponInputElement,F.couponCode);let e=F.getReadonlyState().computed.summary;if(F.isFetching){rr(!0,this.element);return}rr(!1,this.element),this.summaryItemWrapperElement.innerHTML="",e.items.forEach(i=>{let o=this.summaryItemElement.cloneNode(!0),a=K("name",o),s=K("row",o),l=document.createDocumentFragment(),u=i.occupancy.adults||0,h=i.occupancy.children||0,p=lt(a,!0);p.textContent=`[${u} ${Be("adults").toLowerCase()}${h>0?`, ${h} ${Be("children").toLowerCase()}`:""}] x ${i.quantity}`,l.appendChild(p);let y=lt(a,!0);y.textContent=`@ ${i.pricing.avgPerNight.toLocaleString(qe,{style:"currency",currency:"EUR"})}/ ${Be("night")}`,l.appendChild(y);let D=lt(s,!0),T=K("label",D),C=K("price",D);if(T.textContent=`service (${F.nightsCount} ${Be("night").toLowerCase()}${F.nightsCount>1?"s":""}):`,C.textContent=i.pricing.service.toLocaleString?.(qe,{style:"currency",currency:"EUR"})??null,l.appendChild(D),F.selectedProducts.length>0){let se=lt(s,!0),B=K("label",se);K("price",se).remove();let Y=F.selectedProducts.map(ae=>ae.name).join(", ");B.textContent=`Products: ${Y}`,l.appendChild(se)}let N=lt(s,!0),$=K("label",N);$.textContent="Products & Extras:";let G=K("price",N);G.textContent=i.pricing.products.toLocaleString(qe,{style:"currency",currency:"EUR"}),l.appendChild(N);let W=lt(s,!0),ne=K("label",W);ne.textContent="Taxes:";let le=K("price",W);le.textContent=i.pricing.taxes.toLocaleString(qe,{style:"currency",currency:"EUR"}),l.appendChild(W);let oe=lt(s,!0),Ce=K("label",oe);Ce.textContent="Subtotal:";let Te=K("price",oe);Te.textContent=i.pricing.subtotal.toLocaleString(qe,{style:"currency",currency:"EUR"}),l.appendChild(oe),o.innerHTML="",o.appendChild(l),this.summaryItemWrapperElement.appendChild(o)});let r=e.totals.taxes||0;this.taxElement.textContent=r>0?r.toLocaleString(qe,{style:"currency",currency:"EUR"}):"--",this.totalPriceElement.textContent=e.totals.grandTotal.toLocaleString(qe,{style:"currency",currency:"EUR"})})}};var Ha=class{constructor(t){this.parentComponent=t;L(this,"element");L(this,"tariffsWrapperElement");L(this,"tariffTemplateElement");this.element=K("offer-box"),this.tariffsWrapperElement=K("offers-list",this.element),this.tariffTemplateElement=K("offer-wrapper",this.element)}init(){this.updateDOM()}refresh(){}toggleVisibility(t=!0){this.element.classList.toggle("hide",!t)}updateDOM(){It(()=>{if(F.isFetching){console.log("[TariffsSection] Skipping render during fetch operation");return}if(F.computedRates.length===0){console.log("[TariffsSection] No computed rates available, skipping render");return}console.log("[TariffsSection] Rendering tariffs:",{ratesCount:F.computedRates.length,isFetching:F.isFetching});let t=document.createDocumentFragment();F.computedRates.sort((r,i)=>{let o=r.price?.AverageAmountPerTimeUnit?.GrossValue||0,a=i.price?.AverageAmountPerTimeUnit?.GrossValue||0;return o-a}).forEach(r=>{let i=lt(this.tariffTemplateElement,!0);i.removeAttribute("id");let o=K("name",i);o.textContent=r.name;let a=K("description",i);a.textContent=r.description;let s=K("price",i),l=r.price?.AverageAmountPerTimeUnit?.GrossValue||0;s.textContent=l.toLocaleString(qe,{style:"currency",currency:"EUR"});let u=F.rates.find(T=>T.id===r.id),h=K("label",i),p=K("discount-badge",i),y=K("discount-label",p);if(u)if(h.textContent=u.shortName,u.pricing?.DependentRatePricing){let T=u.pricing?.DependentRatePricing.RelativeAdjustment*100;T===0?p.classList.add("hide"):y.textContent=`${T>0?"+":""}${T}%`}else p.classList.add("hide");else h.classList.add("hide"),p.classList.add("hide");let D=K("radio-input",i);D.value=r.id,r.id===F.selectedRateId&&D.previousElementSibling.classList.add("w--redirected-checked"),xt(D,"change",()=>{D.checked&&F.updateSelectedRateId(r.id)}),t.appendChild(i)}),this.tariffsWrapperElement.innerHTML="",this.tariffsWrapperElement.appendChild(t)})}};var Ba=class{constructor(t){L(this,"apartmentProperties");L(this,"detailsSection");L(this,"optionsSection");L(this,"tariffsSection");L(this,"summarySection");L(this,"paymentModal");nr("loading:start",e=>rr(!0,e)),nr("loading:end",e=>rr(!1,e)),this.apartmentProperties=t,F.setCmsApartmentData(t)}init(){it("loading:start",document.body);let t=Yt.startDate?J.safeParsePlainDate(Yt.startDate):Qr,e=Yt.endDate?J.safeParsePlainDate(Yt.endDate):uo;t&&F.updateStartDate(t),e&&F.updateEndDate(e),this.fetchAPIData().then(()=>{this.parseAPIData().then(()=>{let r=F.rates.find(i=>i.isDefault||i.isBaseRate);console.log("#=> Default Rate:",r),F.updateSelectedRateId(r?.id||F.computedRates.find(i=>i.ordering===0&&i.groupOrdering===0)?.id||F.computedRates[0]?.id||null),this.detailsSection=new Aa(this),this.detailsSection.init(),this.optionsSection=new La(this),this.optionsSection.toggleVisibility(!0),this.optionsSection.init(),this.tariffsSection=new Ha(this),this.tariffsSection.toggleVisibility(!0),this.tariffsSection.init(),this.summarySection=new Oa(this),this.summarySection.toggleVisibility(!0),this.summarySection.init(),this.paymentModal=new Na(this),this.paymentModal.toggleVisibility(!1),this.paymentModal.init(),this.initPricingButler(),this.initAvailabilityPricingUpdater(),it("loading:end",document.body)}).catch(r=>{console.error("Error initializing reservation component",r),alert("An error occurred. Please try again later.")})}),console.log("#=> State:",F.getReadonlyState())}initPricingButler(){let t=(0,Yc.default)(async()=>{console.log("[PricingButler] Fetching reservation pricing..."),await F.fetchReservationPricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId)},500);It(()=>{let{rooms:e}=F,{startDate:r}=F,{endDate:i}=F,{selectedProducts:o}=F,{selectedRateId:a}=F,{couponCode:s}=F;if(console.log("[PricingButler] Dependencies changed:",{roomsCount:e.length,startDate:r?.toString(),endDate:i?.toString(),selectedProductsCount:o.length,selectedRateId:a,couponCode:s}),e.length===0){console.log("[PricingButler] No rooms set, skipping pricing update.");return}if(!r||!i){console.log("[PricingButler] Start date or end date is not set, skipping pricing update.");return}if(J.isBefore(r,i)){console.log("[PricingButler] Start date is after or equal to end date, skipping pricing update.");return}t()})}initAvailabilityPricingUpdater(){let t=(0,Yc.default)(async()=>{try{await F.fetchAvailability(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),await F.fetchServicePricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),it("loading:end",document.body)}catch(e){console.error("Error updating availability and pricing data:",e)}},500);It(()=>{it("loading:start",document.body);let{startDate:e,endDate:r}={startDate:F.startDate,endDate:F.endDate};if(!e||!r){console.warn("Start date or end date is not set, skipping availability and pricing updates.");return}if(J.isBefore(e,r)){console.warn("Start date is after or equal to end date, skipping API requests.");return}t()}),It(()=>{it("loading:start",document.body);let{availabilities:e,servicePricing:r,isAvailable:i,restrictionMessage:o}={availabilities:F.availabilities,servicePricing:F.servicePricing,isAvailable:F.isAvailable,restrictionMessage:F.restrictionMessage};if(this.updateAvailabilityBanners(i,o),this.optionsSection&&this.optionsSection.toggleVisibility(i),this.tariffsSection&&this.tariffsSection.toggleVisibility(i),this.summarySection&&this.summarySection.toggleVisibility(i),r&&!F.selectedRateId&&F.computedRates.length>0){let a=F.rates.find(s=>s.isDefault||s.isBaseRate);F.updateSelectedRateId(a?.id||F.computedRates.find(s=>s.ordering===0&&s.groupOrdering===0)?.id||F.computedRates[0]?.id||null)}e&&r&&this.refreshUIComponents()})}async fetchAPIData(){console.log("#=> Fetching API data for reservation component..."),await F.initializeResources(this.apartmentProperties.enterpriseId),await F.initializeRooms(),await F.fetchHotel(this.apartmentProperties.enterpriseId),await F.fetchAvailability(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),await F.fetchServicePricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),await F.fetchReservationPricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),await F.fetchRates(this.apartmentProperties.enterpriseId)}async parseAPIData(){}refreshUIComponents(){if(F.computedRates.length>0&&!F.selectedRateId){let t=F.rates.find(e=>e.isDefault||e.isBaseRate);F.updateSelectedRateId(t?.id||F.computedRates.find(e=>e.ordering===0&&e.groupOrdering===0)?.id||F.computedRates[0]?.id||null)}this.updateAvailabilityBanners(F.isAvailable,F.restrictionMessage),this.optionsSection&&(this.optionsSection.toggleVisibility(F.isAvailable),this.optionsSection.refresh()),this.tariffsSection&&(this.tariffsSection.toggleVisibility(F.isAvailable),this.tariffsSection.refresh()),this.summarySection&&(this.summarySection.toggleVisibility(F.isAvailable),this.summarySection.refresh()),it("loading:end",document.body)}updateAvailabilityBanners(t,e){let r=K("banner-box"),i=K("banner-box-restriction"),o=K("banner-restriction-text");e?(o&&(o.textContent=e),i&&i.classList.remove("hide"),r&&r.classList.add("hide")):t?(r&&r.classList.add("hide"),i&&i.classList.add("hide")):(r&&r.classList.remove("hide"),i&&i.classList.add("hide"))}async fetchReservationPricing(){try{await F.fetchServicePricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId);let t=await F.fetchReservationPricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId);return this.refreshUIComponents(),t}catch(t){throw console.error("Error fetching reservation pricing:",t),t}}handleDateChange(t,e){return t&&e&&Re.PlainDate.compare(t,e)>=0?(console.warn("Invalid date range: start date must be before end date"),!1):(t&&F.updateStartDate(t),e&&F.updateEndDate(e),!0)}scrollToTariffsSection(){let t=document.getElementById("tariff-section");t&&setTimeout(()=>{t.scrollIntoView({behavior:"smooth",block:"start"})},300)}};function Km(){try{let n=window.WebflowCMSData_apartment;console.log("#=> Properties",n),new Ba(n).init()}catch(n){console.error("Error initializing reservation component",n)}}window.Webflow||(window.Webflow=[]);window.Webflow.push(async()=>{Km()});export{Km as initApparthotelsBookingTemplate};
|
|
8
8
|
/*! Bundled license information:
|
|
9
9
|
|
|
10
10
|
@vue/shared/dist/shared.esm-bundler.js:
|