@influence-society-web/yuna-frontend 2.0.0 → 2.0.2

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 mh=Object.create;var Ua=Object.defineProperty;var ph=Object.getOwnPropertyDescriptor;var fh=Object.getOwnPropertyNames;var gh=Object.getPrototypeOf,yh=Object.prototype.hasOwnProperty;var vh=(n,t,e)=>t in n?Ua(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var qc=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var bh=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of fh(t))!yh.call(n,i)&&i!==e&&Ua(n,i,{get:()=>t[i],enumerable:!(r=ph(t,i))||r.enumerable});return n};var Wc=(n,t,e)=>(e=n!=null?mh(gh(n)):{},bh(t||!n||!n.__esModule?Ua(e,"default",{value:n,enumerable:!0}):e,n));var L=(n,t,e)=>(vh(n,typeof t!="symbol"?t+"":t,e),e),Gc=(n,t,e)=>{if(!t.has(n))throw TypeError("Cannot "+e)};var C=(n,t,e)=>(Gc(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)=>(Gc(n,t,"access private method"),e);var Kc=qc((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(F,z){(z==null||z>F.length)&&(z=F.length);for(var Y=0,se=Array(z);Y<z;Y++)se[Y]=F[Y];return se}function r(F){if(Array.isArray(F))return F}function i(F){if(F===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return F}function o(F,z,Y){return z=p(z),$(F,T()?Reflect.construct(z,Y||[],p(F).constructor):z.apply(F,Y))}function a(F,z){if(!(F instanceof z))throw new TypeError("Cannot call a class as a function")}function s(F,z,Y){if(T())return Reflect.construct.apply(null,arguments);var se=[null];se.push.apply(se,z);var g=new(F.bind.apply(F,se));return Y&&W(g,Y.prototype),g}function l(F,z){for(var Y,se=0;se<z.length;se++)Y=z[se],Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(F,oe(Y.key),Y)}function u(F,z,Y){return z&&l(F.prototype,z),Y&&l(F,Y),Object.defineProperty(F,"prototype",{writable:!1}),F}function h(F,z){var Y=typeof Symbol<"u"&&F[Symbol.iterator]||F["@@iterator"];if(!Y){if(Array.isArray(F)||(Y=Ce(F))||z&&F&&typeof F.length=="number"){Y&&(F=Y);var se=0,g=function(){};return{s:g,n:function(){return se>=F.length?{done:!0}:{done:!1,value:F[se++]}},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(F)},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(F){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(z){return z.__proto__||Object.getPrototypeOf(z)},p(F)}function y(F,z){if(typeof z!="function"&&z!==null)throw new TypeError("Super expression must either be null or a function");F.prototype=Object.create(z&&z.prototype,{constructor:{value:F,writable:!0,configurable:!0}}),Object.defineProperty(F,"prototype",{writable:!1}),z&&W(F,z)}function w(F){try{return Function.toString.call(F).indexOf("[native code]")!==-1}catch{return typeof F=="function"}}function T(){try{var F=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(T=function(){return!!F})()}function S(F,z){var Y=F==null?null:typeof Symbol<"u"&&F[Symbol.iterator]||F["@@iterator"];if(Y!=null){var se,g,H,c,d=[],v=!0,E=!1;try{if(H=(Y=Y.call(F)).next,z===0){if(Object(Y)!==Y)return;v=!1}else for(;!(v=(se=H.call(Y)).done)&&(d.push(se.value),d.length!==z);v=!0);}catch(D){E=!0,g=D}finally{try{if(!v&&Y.return!=null&&(c=Y.return(),Object(c)!==c))return}finally{if(E)throw g}}return d}}function x(){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 $(F,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(F)}function W(F,z){return W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Y,se){return Y.__proto__=se,Y},W(F,z)}function K(F,z){return r(F)||S(F,z)||Ce(F,z)||x()}function ee(F,z){if(typeof F!="object"||!F)return F;var Y=F[Symbol.toPrimitive];if(Y!==void 0){var se=Y.call(F,z||"default");if(typeof se!="object")return se;throw new TypeError("@@toPrimitive must return a primitive value.")}return(z==="string"?String:Number)(F)}function oe(F){var z=ee(F,"string");return typeof z=="symbol"?z:z+""}function ae(F){"@babel/helpers - typeof";return ae=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},ae(F)}function Ce(F,z){if(F){if(typeof F=="string")return e(F,z);var Y={}.toString.call(F).slice(8,-1);return Y==="Object"&&F.constructor&&(Y=F.constructor.name),Y==="Map"||Y==="Set"?Array.from(F):Y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Y)?e(F,z):void 0}}function Te(F){var z=typeof Map=="function"?new Map:void 0;return Te=function(Y){function se(){return s(Y,arguments,p(this).constructor)}if(Y===null||!w(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,se)}return se.prototype=Object.create(Y.prototype,{constructor:{value:se,enumerable:!1,writable:!0,configurable:!0}}),W(se,Y)},Te(F)}var ce=function(F){var z=Math.abs,Y=Math.max,se=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,F),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(D){v.e(D)}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,D=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,D),V=g.__imul(X,E),ue=g.__imul(X,D),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,D=0,_=0;_<v;_++)E=this.__halfDigit(d+_)+c.__halfDigit(_)+D,D=E>>>15,this.__setHalfDigit(d+_,32767&E);return D}},{key:"__inplaceSub",value:function(c,d,v){var E=v-1>>>1,D=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)-D;D=1&O>>>15,this.__setDigit(d+P,(32767&O)<<15|32767&I),_=this.__digit(d+P+1),I=(32767&_)-(j>>>15)-D,D=1&I>>>15}var X=c.__digit(P),re=(_>>>15)-(32767&X)-D;D=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-D,D=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)-D;D=1&we>>>15;var _e=(ue>>>15)-(pe>>>15)-D;D=1&_e>>>15,this.__setDigit(d+V,(32767&_e)<<15|32767&we)}var He=this.__digit(d+V),Ve=c.__digit(V),ot=(32767&He)-(32767&Ve)-D;D=1&ot>>>15;var Qt=0;!(1&v)&&(Qt=(He>>>15)-(Ve>>>15)-D,D=1&Qt>>>15),this.__setDigit(d+V,(32767&Qt)<<15|32767&ot)}return D}},{key:"__inplaceRightShift",value:function(c){if(c!==0){for(var d,v=this.__digit(0)>>>c,E=this.length-1,D=0;D<E;D++)d=this.__digit(D+1),this.__setDigit(D,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),D=1&c?32767&E|d<<15:1073709056&E|32767&d;this.__setDigit(v,D)}}],[{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)||se(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(ae(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),D=g.__clz30(E),_=30*d-D;if(1024<_)return c.sign?-1/0:1/0;var I=_-1,P=E,j=d-1,O=D+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),D=c.sign&&(1&v)!=0,_=new g(E,D);_.__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 D=0;D<c.length;D++)g.__multiplyAccumulate(d,c.__digit(D),E,D);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,D=d.__unsignedDigit(0);if(d.length===1&&32767>=D){if(D===1)return E===c.sign?c:g.unaryMinus(c);v=g.__absoluteDivSmall(c,D,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 D=g.__absoluteDivLarge(c,d,!1,!0);return D.sign=c.sign,D.__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),D=g.__absoluteSubOne(d);return E=g.__absoluteOr(E,D,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),D=g.__absoluteSubOne(d);return g.__absoluteXor(E,D,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),D=g.__absoluteSubOne(d);return E=g.__absoluteAnd(E,D,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=se(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),D=1<<(c-1)%30;if(d.length===v&&E<D)return d;var _=(E&D)===D;if(!_)return g.__truncateToNBits(c,d);if(!d.sign)return g.__truncateAndSubFromPowerOfTwo(c,d,!0);if(!(E&D-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===D?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=se(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 D=d.__digit(v-1);if(!(D>>>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(ae(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(ae(d)!=="object")return c==d;d=g.__toPrimitive(d)}else if(typeof c=="boolean"){if(g.__isBigInt(d))return g.__equalToNumber(d,+c);if(ae(d)!=="object")return c==d;d=g.__toPrimitive(d)}else if(ae(c)==="symbol"){if(g.__isBigInt(d))return!1;if(ae(d)!=="object")return c==d;d=g.__toPrimitive(d)}else if(ae(c)==="object"){if(ae(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],D=K(E,2),_=D[0],I=D[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 D=0,_=0;if(0<v.length&&(_=v.__digit(0),1<v.length)){var I=v.__digit(1);_|=I<<30,D=I>>>2,2<v.length&&(D|=v.__digit(2)<<28)}var P=E?[4,0]:[0,4],j=K(P,2),O=j[0],X=j[1];c.setUint32(d+O,D,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 D;if(0>d)D=-d-1;else{if(v===0)return-1;v--,E=c.__digit(v),D=29}var _=1<<D;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,D=E-1023,_=(0|D/30)+1,I=new g(_,d),P=1048576,j=1048575&g.__kBitConversionInts[g.__kBitConversionIntHigh]|P,O=g.__kBitConversionInts[g.__kBitConversionIntLow],X=20,re=D%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,D=0;if(D===E)return g.__zero();for(var _=c.charCodeAt(D);g.__isWhitespace(_);){if(++D===E)return g.__zero();_=c.charCodeAt(D)}if(_===43){if(++D===E)return null;_=c.charCodeAt(D),v=1}else if(_===45){if(++D===E)return null;_=c.charCodeAt(D),v=-1}if(d===0){if(d=10,_===48){if(++D===E)return g.__zero();if(_=c.charCodeAt(D),_===88||_===120){if(d=16,++D===E)return null;_=c.charCodeAt(D)}else if(_===79||_===111){if(d=8,++D===E)return null;_=c.charCodeAt(D)}else if(_===66||_===98){if(d=2,++D===E)return null;_=c.charCodeAt(D)}}}else if(d===16&&_===48){if(++D===E)return g.__zero();if(_=c.charCodeAt(D),_===88||_===120){if(++D===E)return null;_=c.charCodeAt(D)}}if(v!==0&&d!==10)return null;for(;_===48;){if(++D===E)return g.__zero();_=c.charCodeAt(D)}var I=E-D,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,Qt=0;do{for(var sr,Yn=0,oi=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=oi*d;if(1073741823<bo)break;if(oi=bo,Yn=Yn*d+sr,Qt++,++D===E){ot=!0;break}_=c.charCodeAt(D)}j=30*g.__kBitsPerCharTableMultiplier-1;var wo=0|(P*Qt+j>>>g.__kBitsPerCharTableShift)/30;re.__inplaceMultiplyAdd(oi,Yn,wo)}while(!ot)}else{P>>=g.__kBitsPerCharTableShift;var ue=[],pe=[],we=!1;do{for(var _e,He=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,He=He<<P|_e,++D===E){we=!0;break}if(_=c.charCodeAt(D),30<Ve+P)break}ue.push(He),pe.push(Ve)}while(!we);g.__fillFromParts(re,ue,pe)}if(D!==E){if(!g.__isWhitespace(_))return null;for(D++;D<E;D++)if(_=c.charCodeAt(D),!g.__isWhitespace(_))return null}return re.sign=v===-1,re.__trim()}},{key:"__fillFromParts",value:function(c,d,v){for(var E=0,D=0,_=0,I=d.length-1;0<=I;I--){var P=d[I],j=v[I];D|=P<<_,_+=j,_===30?(c.__setDigit(E++,D),_=0,D=0):30<_&&(c.__setDigit(E++,1073741823&D),_-=30,D=P>>>j-_)}if(D!==0){if(E>=c.length)throw new Error("implementation bug");c.__setDigit(E++,D)}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 D=E,_=d-1,I=c.__digit(v-1),P=g.__clz30(I),j=30*v-P,O=0|(j+D-1)/D;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=D-V;for(Z=pe>>>_e,V=30-_e;V>=D;)X[re--]=g.__kConversionChars[Z&_],Z>>>=D,V-=D}var He=(Z|I<<V)&_;for(X[re--]=g.__kConversionChars[He],Z=I>>>D-V;Z!==0;)X[re--]=g.__kConversionChars[Z&_],Z>>>=D;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 D=c.__unsignedDigit(0).toString(d);return v===!1&&c.sign&&(D="-"+D),D}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 He=_e.remainder.__trim();X=g.__toStringGeneric(He,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 D=z(d),_=c.__unsignedDigit(0);return _>D?g.__absoluteGreater(v):_<D?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 D=2047&g.__kBitConversionInts[g.__kBitConversionIntHigh]>>>20;if(D==2047)throw new Error("implementation bug: handled elsewhere");var _=D-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 He=ue-pe;_e=He+32,we=Z>>>He,Z=Z<<32-He|V>>>He,V<<=32-He}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 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 D,_=new g(E,v),I=0,P=0;P<d.length;P++)D=c.__digit(P)+d.__digit(P)+I,I=D>>>30,_.__setDigit(P,1073741823&D);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,D=new g(c.length,v),_=0,I=0;I<d.length;I++)E=c.__digit(I)-d.__digit(I)-_,_=1&E>>>30,D.__setDigit(I,1073741823&E);for(;I<c.length;I++){var P=c.__digit(I)-_;_=1&P>>>30,D.__setDigit(I,1073741823&P)}return D.__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 D,_=1,I=0;I<E;I++)D=c.__digit(I)+_,_=D>>>30,v.__setDigit(I,1073741823&D);return _!==0&&v.__setDigitGrow(E,1),v}},{key:"__absoluteSubOne",value:function(c,d){var v=c.length;d=d||v;for(var E,D=new g(d,!1),_=1,I=0;I<v;I++)E=c.__digit(I)-_,_=1&E>>>30,D.__setDigit(I,1073741823&E);if(_!==0)throw new Error("implementation bug");for(var P=v;P<d;P++)D.__setDigit(P,0);return D}},{key:"__absoluteAnd",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,E=c.length,D=d.length,_=D;if(E<D){_=E;var I=c,P=E;c=d,E=D,d=I,D=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,D=d.length,_=D;E<D&&(_=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,D=d.length,_=D;if(E<D){_=E;var I=c,P=E;c=d,E=D,d=I,D=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,D=d.length,_=D;if(E<D){_=E;var I=c,P=E;c=d,E=D,d=I,D=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 D=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,D),ue=g.__imul(re,_),pe=g.__imul(Z,D),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,D){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,D.__setDigit(P,1073741823&re)}if(D.length>E)for(D.__setDigit(E++,_+I);E<D.length;)D.__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,D=2*c.length-1;0<=D;D-=2){var _=(E<<15|c.__halfDigit(D))>>>0,I=0|_/d;E=0|_%d,_=(E<<15|c.__halfDigit(D-1))>>>0;var P=0|_/d;E=0|_%d,v.__setDigit(D>>>1,I<<15|P)}return v}},{key:"__absoluteModSmall",value:function(c,d){for(var v,E=0,D=2*c.length-1;0<=D;D--)v=(E<<15|c.__halfDigit(D))>>>0,E=0|v%d;return E}},{key:"__absoluteDivLarge",value:function(c,d,v,E){var D=d.__halfDigitLength(),_=d.length,I=c.__halfDigitLength()-D,P=null;v&&(P=new g(I+2>>>1,!1),P.__initializeDigits());var j=new g(D+2>>>1,!1);j.__initializeDigits();var O=g.__clz15(d.__halfDigit(D-1));0<O&&(d=g.__specialLeftShift(d,O,0));for(var X=g.__specialLeftShift(c,O,1),re=d.__halfDigit(D-1),Z=0,V=I;0<=V;V--){var ue=32767,pe=X.__halfDigit(V+D);if(pe!==re){var we=(pe<<15|X.__halfDigit(V+D-1))>>>0;ue=0|we/re;for(var _e=0|we%re,He=d.__halfDigit(D-2),Ve=X.__halfDigit(V+D-2);g.__imul(ue,He)>>>0>(_e<<16|Ve)>>>0&&(ue--,_e+=re,!(32767<_e)););}g.__internalMultiplyAdd(d,ue,0,_,j);var ot=X.__inplaceSub(j,V,D+1);ot!==0&&(ot=X.__inplaceAdd(d,V,D),X.__setHalfDigit(V+D,32767&X.__halfDigit(V+D)+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,D=E+v,_=new g(D,!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,D=v%30,_=c.length,I=D!==0&&c.__digit(_-1)>>>30-D!=0,P=_+E+(I?1:0),j=new g(P,c.sign);if(D===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<<D|X),X=Z>>>30-D;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,D=g.__toShiftAmount(d);if(0>D)return g.__rightShiftByMaximum(E);var _=0|D/30,I=D%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,He=0;He<_e;He++)pe=c.__digit(He+_+1),V.__setDigit(He,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(ae(c)!=="object"||c.constructor===g)return c;if(typeof Symbol<"u"&&ae(Symbol.toPrimitive)==="symbol"&&c[Symbol.toPrimitive]){var v=c[Symbol.toPrimitive](d);if(ae(v)!=="object")return v;throw new TypeError("Cannot convert object to primitive value")}var E=c.valueOf;if(E){var D=E.call(c);if(ae(D)!=="object")return D}var _=c.toString;if(_){var I=_.call(c);if(ae(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 ae(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),D=v-1,_=0;_<D;_++)E.__setDigit(_,d.__digit(_));var I=d.__digit(D);if(c%30!=0){var P=32-c%30;I=I<<P>>>P}return E.__setDigit(D,I),E.__trim()}},{key:"__truncateAndSubFromPowerOfTwo",value:function(c,d,v){for(var E=Math.min,D,_=0|(c+29)/30,I=new g(_,v),P=0,j=_-1,O=0,X=E(j,d.length);P<X;P++)D=0-d.__digit(P)-O,O=1&D>>>30,I.__setDigit(P,1073741823&D);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 ce.__kMaxLength=33554432,ce.__kMaxLengthBits=ce.__kMaxLength<<5,ce.__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],ce.__kBitsPerCharTableShift=5,ce.__kBitsPerCharTableMultiplier=1<<ce.__kBitsPerCharTableShift,ce.__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"],ce.__kBitConversionBuffer=new ArrayBuffer(8),ce.__kBitConversionDouble=new Float64Array(ce.__kBitConversionBuffer),ce.__kBitConversionInts=new Int32Array(ce.__kBitConversionBuffer),ce.__kBitConversionIntHigh=ce.__detectBigEndian()?0:1,ce.__kBitConversionIntLow=ce.__detectBigEndian()?1:0,ce.__clz30=t?function(F){return t(F)-2}:function(F){var z=Math.LN2,Y=Math.log;return F===0?30:0|29-(0|Y(F>>>0)/z)},ce.__imul=n||function(F,z){return 0|F*z},ce})});var Gu=qc((bp,Wu)=>{Wu.exports=xm;function xm(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=Wc(Kc(),1),Wt=k.default.BigInt(0),Mi=k.default.BigInt(1),Bs=k.default.BigInt(2),wh=k.default.BigInt(10),Dh=k.default.BigInt(24),Eh=k.default.BigInt(60),_h=k.default.BigInt(1e3),ji=k.default.BigInt(1e6),vi=k.default.BigInt(1e9),Il=k.default.multiply(k.default.BigInt(3600),vi),Mh=k.default.multiply(Eh,vi),Wn=k.default.multiply(Il,Dh);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 ui(n,t){return{quotient:k.default.divide(n,t),remainder:k.default.remainder(n,t)}}var Zc,Jc,he="slot-epochNanoSeconds",me="slot-iso-date",Be="slot-iso-date-time",je="slot-time",U="slot-calendar",xl="slot-date-brand",Al="slot-year-month-brand",Ll="slot-month-day-brand",ke="slot-time-zone",yt="slot-years",vt="slot-months",At="slot-weeks",bt="slot-days",wt="slot-hours",Dt="slot-minutes",Et="slot-seconds",_t="slot-milliseconds",Mt="slot-microseconds",Lt="slot-nanoseconds",Nl="date",Ol="ym",Hl="md",Bl="time",Fl="datetime",Yl="instant",br="original",Rr="timezone-canonical",Xa="timezone-original",di="calendar-id",$l="locale",Qa="options",jl=new WeakMap,es=Symbol.for("@@Temporal__GetSlots");(Zc=globalThis)[es]||(Zc[es]=function(n){return jl.get(n)});var jo=globalThis[es],ts=Symbol.for("@@Temporal__CreateSlots");(Jc=globalThis)[ts]||(Jc[ts]=function(n){jl.set(n,Object.create(null))});var Nn=globalThis[ts];function Pt(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 it(n){return ns[n]}function Ar(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 Re=class n{constructor(t){this.totalNs=Mn(t),this.sec=k.default.toNumber(k.default.divide(this.totalNs,vi)),this.subsec=k.default.toNumber(k.default.remainder(this.totalNs,vi))}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),_h)),k.default.multiply(k.default.BigInt(i),ji)),k.default.multiply(k.default.BigInt(r),vi)),k.default.multiply(k.default.BigInt(e),Mh)),k.default.multiply(k.default.BigInt(t),Il));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}=ui(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}=ui(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,wh),{quotient:s,remainder:o}=ui(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,Mi))return this;let{quotient:i,remainder:o}=ui(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")}};Re.MAX=k.default.BigInt("9007199254740991999999999"),Re.ZERO=new Re(Wt);var Xc=/[A-Za-z._][A-Za-z._0-9+-]*/,zi=new RegExp(`(?:${/(?:[+-](?:[01][0-9]|2[0-3])(?::?[0-5][0-9])?)/.source}|(?:${Xc.source})(?:\\/(?:${Xc.source}))*)`),zl=/(?:[+-]\d{6}|\d{4})/,Co=/(?:0[1-9]|1[0-2])/,is=/(?:0[1-9]|[12]\d|3[01])/,Th=new RegExp(`(${zl.source})(?:-(${Co.source})-(${is.source})|(${Co.source})(${is.source}))`),Ul=/(\d{2})(?::(\d{2})(?::(\d{2})(?:[.,](\d{1,9}))?)?|(\d{2})(?:(\d{2})(?:[.,](\d{1,9}))?)?)?/,Vl=/((?:[+-])(?:[01][0-9]|2[0-3])(?::?(?:[0-5][0-9])(?::?(?:[0-5][0-9])(?:[.,](?:\d{1,9}))?)?)?)/,ql=new RegExp(`([zZ])|${Vl.source}?`),Hr=/\[(!)?([a-z_][a-z0-9_-]*)=([A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)\]/g,Sh=new RegExp([`^${Th.source}`,`(?:(?:[tT]|\\s+)${Ul.source}(?:${ql.source})?)?`,`(?:\\[!?(${zi.source})\\])?`,`((?:${Hr.source})*)$`].join("")),Ch=new RegExp([`^[tT]?${Ul.source}`,`(?:${ql.source})?`,`(?:\\[!?${zi.source}\\])?`,`((?:${Hr.source})*)$`].join("")),kh=new RegExp(`^(${zl.source})-?(${Co.source})(?:\\[!?${zi.source}\\])?((?:${Hr.source})*)$`),Ph=new RegExp(`^(?:--)?(${Co.source})-?(${is.source})(?:\\[!?${zi.source}\\])?((?:${Hr.source})*)$`),Ga=/(\d+)(?:[.,](\d{1,9}))?/,Ih=new RegExp(`(?:${Ga.source}H)?(?:${Ga.source}M)?(?:${Ga.source}S)?`),Rh=new RegExp(`^([+-])?P${/(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/.source}(?:T(?!$)${Ih.source})?$`,"i"),Gn=864e5,ko=1e6*Gn,xh=6e10,Wl=1e8*Gn,Br=cn(Wl),Ti=k.default.unaryMinus(Br),Ah=k.default.add(k.default.subtract(Ti,Wn),Mi),Lh=k.default.subtract(k.default.add(Br,Wn),Mi),Nh=146097*Gn,Qc=-271821,el=275760,bi=Date.UTC(1847,0,1),Oh=["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"],Hh=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 tl(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 Si(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"],Bh={era:qo,eraYear:fe,year:fe,month:tl,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:tl,hour:fe,minute:fe,second:fe,millisecond:fe,microsecond:fe,nanosecond:fe,offset:function(n){let t=Ge(os(n));return Wr(t),t},timeZone:Ct},Fh={hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},Fr=[["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"]],nl=Object.fromEntries(Fr.map(n=>[n[0],n[1]])),Yh=Object.fromEntries(Fr.map(([n,t])=>[t,n])),wi=Fr.map(([,n])=>n),Yr={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"],$h=Intl.DateTimeFormat,rl=new Map;function Gl(n){let t=Ri(n),e=rl.get(t);return e===void 0&&(e=new $h("en-us",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),rl.set(t,e)),e}function tt(n){return Pt(n,he)&&!Pt(n,ke,U)}function Ye(n){return Pt(n,yt,vt,bt,wt,Dt,Et,_t,Mt,Lt)}function $e(n){return Pt(n,xl)}function Ue(n){return Pt(n,je)}function Ne(n){return Pt(n,Be)}function nt(n){return Pt(n,Al)}function qt(n){return Pt(n,Ll)}function be(n){return Pt(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 Ur(n){if(Pt(n,U)||Pt(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 Ui(n,t){return t==="never"||t==="auto"&&n==="iso8601"?"":`[${t==="critical"?"!":""}u-ca=${n}]`}function Wo(n){let t,e,r=!1;for(Hr.lastIndex=0;e=Hr.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=Sh.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),w=+p.slice(3,6),T=+p.slice(6,9),S,x=!1;t[13]?(S=void 0,x=!0):t[14]&&(S=t[14]);let $=t[15];return Us(i,o,a,l,u,h,y,w,T),{year:i,month:o,day:a,time:s?{hour:l,minute:u,second:h,millisecond:y,microsecond:w,nanosecond:T}:"start-of-day",tzAnnotation:$,offset:S,z:x,calendar:e}}function Kl(n){let t=Ch.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=kh.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=Ph.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 Zl=new RegExp(`^${zi.source}$`,"i"),Jl=new RegExp(`^${/([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])?)?/.source}$`);function Xl(n){let t=zh.test(n)?"Seconds not allowed in offset time zone":"Invalid time zone";throw new RangeError(`${t}: ${n}`)}function qn(n){return Zl.test(n)||Xl(n),Jl.test(n)?{offsetMinutes:Wr(n)/6e10}:{tzName:n}}function Di(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}=fu(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=Tt(s,0,23),l=Tt(l,0,59),u=Tt(u,0,59),h=Tt(h,0,999),p=Tt(p,0,999),y=Tt(y,0,999)}return{hour:s,minute:l,second:u,millisecond:h,microsecond:p,nanosecond:y}}function Ql(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 Rn(n,"overflow",["constrain","reject"],"constrain")}function Ei(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 Vi(n){return Rn(n,"calendarName",["auto","always","never","critical"],"auto")}function Vr(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 qr(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 qi(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 Wi(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<Fr.length;u++){let h=Fr[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=Yh[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 nl?nl[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(Ne(t))return{plainRelativeTo:St(m(t,Be).isoDate,m(t,U))};i=Xi(t);let u=Jt(i,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],[]);({isoDate:e,time:r}=Ki(i,u,"constrain")),{offset:a,timeZone:o}=u,a===void 0&&(s="wall")}else{let u,h,p,y,w;if({year:p,month:y,day:w,time:r,calendar:i,tzAnnotation:u,offset:a,z:h}=wn(Ge(t)),u)o=Ct(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=It(i),e={year:p,month:y,day:w}}return o===void 0?{plainRelativeTo:St(e,i)}:{zonedRelativeTo:at(Io(e,r,s,s==="option"?Wr(a):0,o,"compatible","reject",l),o,i)}}function Tn(n){return m(n,yt)!==0?"year":m(n,vt)!==0?"month":m(n,At)!==0?"week":m(n,bt)!==0?"day":m(n,wt)!==0?"hour":m(n,Dt)!==0?"minute":m(n,Et)!==0?"second":m(n,_t)!==0?"millisecond":m(n,Mt)!==0?"microsecond":"nanosecond"}function Pn(n,t){return wi.indexOf(n)>wi.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 it("%calendarImpl%")(n)}function Gi(n){return it("%calendarImpl%")(m(n,U))}function kt(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,Bh[h])(p);else if(i!=="partial"){if(i.includes(h))throw new TypeError(`required property '${h}' missing or undefined`);s[h]=Fh[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 hi(n,t){if(ze(n)){if($e(n))return Ee(ie(t)),St(m(n,me),m(n,U));if(be(n)){let l=rn(m(n,ke),m(n,he));return Ee(ie(t)),St(l.isoDate,m(n,U))}if(Ne(n))return Ee(ie(t)),St(m(n,Be).isoDate,m(n,U));let s=Xi(n);return St(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=It(o),Ee(ie(t)),St({year:e,month:r,day:i},o)}function Ki(n,t,e){return Me(Kn(n,t,e),Go(t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond,e))}function mi(n,t){let e,r,i;if(ze(n)){if(Ne(n))return Ee(ie(t)),en(m(n,Be),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=Xi(n);let o=Jt(i,n,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond"],[]),a=Ee(ie(t));({isoDate:e,time:r}=Ki(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=It(i),Ee(ie(t)),e={year:a,month:s,day:l}}return en(Me(e,r),i)}function nn(n){let t=it("%Temporal.Duration%");if(Ye(n))return new t(m(n,yt),m(n,vt),m(n,At),m(n,bt),m(n,wt),m(n,Dt),m(n,Et),m(n,_t),m(n,Mt),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:w,nanoseconds:T}=function(S){let x=Rh.exec(S);if(!x)throw new RangeError(`invalid duration: ${S}`);if(x.every((v,E)=>E<2||v===void 0))throw new RangeError(`invalid duration: ${S}`);let $=x[1]==="-"?-1:1,W=x[2]===void 0?0:fe(x[2])*$,K=x[3]===void 0?0:fe(x[3])*$,ee=x[4]===void 0?0:fe(x[4])*$,oe=x[5]===void 0?0:fe(x[5])*$,ae=x[6]===void 0?0:fe(x[6])*$,Ce=x[7],Te=x[8],ce=x[9],F=x[10],z=x[11],Y=0,se=0,g=0;if(Ce!==void 0){if(Te??ce??F??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)*$,ce!==void 0){if(F??z)throw new RangeError("only the smallest unit can be fractional");g=60*fe((ce+"000000000").slice(0,9))*$}else se=F===void 0?0:fe(F)*$,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 se+=Math.trunc(g/1e9)%60,Y+=Math.trunc(g/6e10),Xo(W,K,ee,oe,ae,Y,se,d,c,H),{years:W,months:K,weeks:ee,days:oe,hours:ae,minutes:Y,seconds:se,milliseconds:d,microseconds:c,nanoseconds:H}}(i);return new(it("%Temporal.Duration%"))(o,a,s,l,u,h,p,y,w,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=Ql(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 pi(n){let t;if(ze(n)){if(tt(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(S){let x=wn(S);if(!x.z&&!x.offset)throw new RangeError("Temporal.Instant requires a time zone offset");return x}(Ge(t)),{hour:l=0,minute:u=0,second:h=0,millisecond:p=0,microsecond:y=0,nanosecond:w=0}=o==="start-of-day"?{}:o,T=Ii(e,r,i,l,u,h,p,y,w-(s?0:Wr(a)));return Or(T.isoDate),sn(rt(T))}function il(n,t){if(ze(n)){if(qt(n))return Ee(ie(t)),Lr(m(n,me),m(n,U));let s;return Pt(n,U)?s=m(n,U):(s=n.calendar,s===void 0&&(s="iso8601"),s=Ji(s)),Lr(Ro(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=It(o),Ee(ie(t)),o==="iso8601")return Lr({year:1972,month:e,day:r},o);let a={year:i,month:e,day:r};return wr(a),a=Ro(o,kt(o,a,"month-day"),"constrain"),Lr(a,o)}function Un(n,t){let e;if(ze(n)){if(Ue(n))return Ee(ie(t)),Cn(m(n,je));if(Ne(n))return Ee(ie(t)),Cn(m(n,Be).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=Kl(Ge(n)),Ee(ie(t));return Cn(e)}function eu(n){return n===void 0?{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}:m(Un(n),je)}function fi(n,t){if(ze(n)){if(nt(n))return Ee(ie(t)),Nr(m(n,me),m(n,U));let s=Xi(n);return Nr(Ci(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=It(o),Ee(ie(t));let a={year:e,month:r,day:i};return Vs(a),a=Ci(o,kt(o,a,"year-month"),"constrain"),Nr(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=Ii(n.year,n.month,n.day,t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond-r);Or(p.isoDate);let y=rt(p);return vn(y),y}Or(n);let u=rt(l),h=ki(i,l);for(let p=0;p<h.length;p++){let y=h[p],w=k.default.toNumber(k.default.subtract(u,y)),T=Vn(w,6e10,"halfExpand");if(w===r||s&&T===r)return y}if(a==="reject"){let p=cs(r),y=Pi(l,"iso8601","auto");throw new RangeError(`Offset ${p} is invalid for ${y} in ${i}`)}return lu(h,i,l,o)}function gi(n,t){let e,r,i,o,a,s,l,u=!1,h="option";if(ze(n)){if(be(n)){let S=ie(t);return Ei(S),To(S,"reject"),Ee(S),at(m(n,he),m(n,ke),m(n,U))}a=Xi(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 w=ie(t);s=Ei(w),l=To(w,"reject");let T=Ee(w);({isoDate:e,time:r}=Ki(a,y,T))}else{let y,w,T,S,x;({year:T,month:S,day:x,time:r,tzAnnotation:y,offset:o,z:w,calendar:a}=function(W){let K=wn(W);if(!K.tzAnnotation)throw new RangeError("Temporal.ZonedDateTime requires a time zone ID in brackets");return K}(Ge(n))),i=Ct(y),w?h="exact":o||(h="wall"),a||(a="iso8601"),a=It(a),u=!0;let $=ie(t);s=Ei($),l=To($,"reject"),Ee($),e={year:T,month:S,day:x}}let p=0;return h==="option"&&(p=Wr(o)),at(Io(e,r,h,p,i,s,l,u),i,a)}function tu(n,t,e){wr(t),Nn(n),ve(n,me,t),ve(n,U,e),ve(n,xl,!0)}function St(n,t){let e=it("%Temporal.PlainDate%"),r=Object.create(e.prototype);return tu(r,n,t),r}function nu(n,t,e){pr(t),Nn(n),ve(n,Be,t),ve(n,U,e)}function en(n,t){let e=it("%Temporal.PlainDateTime%"),r=Object.create(e.prototype);return nu(r,n,t),r}function ru(n,t,e){wr(t),Nn(n),ve(n,me,t),ve(n,U,e),ve(n,Ll,!0)}function Lr(n,t){let e=it("%Temporal.PlainMonthDay%"),r=Object.create(e.prototype);return ru(r,n,t),r}function iu(n,t){Nn(n),ve(n,je,t)}function Cn(n){let t=it("%Temporal.PlainTime%"),e=Object.create(t.prototype);return iu(e,n),e}function ou(n,t,e){Vs(t),Nn(n),ve(n,me,t),ve(n,U,e),ve(n,Al,!0)}function Nr(n,t){let e=it("%Temporal.PlainYearMonth%"),r=Object.create(e.prototype);return ou(r,n,t),r}function au(n,t){vn(t),Nn(n),ve(n,he,t)}function sn(n){let t=it("%Temporal.Instant%"),e=Object.create(t.prototype);return au(e,n),e}function su(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=it("%Temporal.ZonedDateTime%"),i=Object.create(r.prototype);return su(i,n,t,e),i}function ol(n){return as.filter(t=>n[t]!==void 0)}function hr(n,t,e){let r=ol(e),i=Jn(n).fieldKeysToIgnore(r),o=Object.create(null),a=ol(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 Zi(n,t,e,r){return Jn(n).dateUntil(t,e,r)}function Ji(n){if(ze(n)&&Pt(n,U))return m(n,U);let t=Ge(n);try{return It(t)}catch{}let e;try{({calendar:e}=wn(t))}catch{try{({calendar:e}=Kl(t))}catch{try{({calendar:e}=Fs(t))}catch{({calendar:e}=Ys(t))}}}return e||(e="iso8601"),It(e)}function Xi(n){if(Pt(n,U))return m(n,U);let{calendar:t}=n;return t===void 0?"iso8601":Ji(t)}function yn(n,t){return It(n)===It(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 Ci(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 Ro(n,t,e){let r=Jn(n);r.resolveFields(t,"month-day");let i=r.monthDayToISOReferenceDate(t,e);return wr(i),i}function Ct(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(Zl.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{}Xl(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 cu(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}}=hu(t);return Ii(r,i,o,a,s,l,u,h,p+e)}function ct(n,t,e){return lu(ki(n,t),n,t,e)}function lu(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=rt(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=Re.fromComponents(0,0,0,0,0,-u),p=$r(e.time,h);return ki(t,Me(Ht(e.isoDate.year,e.isoDate.month,e.isoDate.day+p.deltaDays),p))[0]}case"compatible":case"later":{let h=Re.fromComponents(0,0,0,0,0,u),p=$r(e.time,h),y=ki(t,Me(Ht(e.isoDate.year,e.isoDate.month,e.isoDate.day+p.deltaDays),p));return y[y.length-1]}}}function ki(n,t){if(n==="UTC")return Or(t.isoDate),[rt(t)];let e=qn(n).offsetMinutes;if(e!==void 0){let r=Ii(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);Or(r.isoDate);let i=rt(r);return vn(i),[i]}return Or(t.isoDate),function(r,i){let o=rt(i),a=k.default.subtract(o,Wn);k.default.lessThan(a,Ti)&&(a=o);let s=k.default.add(o,Wn);k.default.greaterThan(s,Br)&&(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)),w=function(T,S){let{epochMilliseconds:x,time:{millisecond:$,microsecond:W,nanosecond:K}}=hu(S),{year:ee,month:oe,day:ae,hour:Ce,minute:Te,second:ce}=mu(T,x);return Ii(ee,oe,ae,Ce,Te,ce,$,W,K)}(r,y);if(jr(i,w)===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=ki(n,e);if(r.length)return r[0];let i=rt(e),o=k.default.subtract(i,Wn);return vn(o),zs(n,o)}function Qi(n){let t;return t=n<0||n>9999?(n<0?"-":"+")+Si(Math.abs(n),6):Si(n,4),t}function Zt(n){return Si(n,2)}function uu(n,t){let e;if(t==="auto"){if(n===0)return"";e=Si(n,9).replace(/0+$/,"")}else{if(t===0)return"";e=Si(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+=uu(r,i)),o}function al(n,t,e){let r=t;r===void 0&&(r="UTC");let i=m(n,he),o=Pi(rn(r,i),"iso8601",e,"never"),a="Z";return t!==void 0&&(a=du(kn(r,i))),`${o}${a}`}function Mo(n,t){let e=m(n,yt),r=m(n,vt),i=m(n,At),o=m(n,bt),a=m(n,wt),s=m(n,Dt),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=Re.fromComponents(0,0,m(n,Et),m(n,_t),m(n,Mt),m(n,Lt));p.isZero()&&!["second","millisecond","microsecond","nanosecond"].includes(Tn(n))&&t==="auto"||(h+=`${Math.abs(p.sec)}${uu(Math.abs(p.subsec),t)}S`);let y=`${l<0?"-":""}P${u}`;return h&&(y=`${y}T${h}`),y}function sl(n,t="auto"){let{year:e,month:r,day:i}=m(n,me);return`${Qi(e)}-${Zt(r)}-${Zt(i)}${Ui(m(n,U),t)}`}function cl({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 Pi(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`${Qi(i)}-${Zt(o)}-${Zt(a)}T${Ko(s,l,u,1e6*h+1e3*p+y,e)}${Ui(t,r)}`}function ll(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=`${Qi(e)}-${o}`);let s=Ui(a,t);return s&&(o+=s),o}function ul(n,t="auto"){let{year:e,month:r,day:i}=m(n,me),o=`${Qi(e)}-${Zt(r)}`,a=m(n,U);t!=="always"&&t!=="critical"&&a==="iso8601"||(o+=`-${Zt(i)}`);let s=Ui(a,t);return s&&(o+=s),o}function dl(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=Pi(rn(s,a),"iso8601",t,"never");return i!=="never"&&(u+=du(l)),r!=="never"&&(u+=`[${r==="critical"?"!":""}${s}]`),u+=Ui(m(n,U),e),u}function hl(n){return Jl.test(n)}function Wr(n){let t=Uh.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 si,jh=Object.assign(Object.create(null),{"/":!0,"-":!0,_:!0});function xo(n){if(si===void 0){let o=Intl.supportedValuesOf?.("timeZone");if(o){si=new Map;for(let a=0;a<o.length;a++){let s=o[a];si.set(Ri(s),s)}}else si=null}let t=Ri(n),e=si?.get(t);if(e)return{identifier:e,primaryIdentifier:e};try{e=Gl(n).resolvedOptions().timeZone}catch{return}if(t==="antarctica/south_pole"&&(e="Antarctica/McMurdo"),Hh.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||jh[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}=mu(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 du(n){return $s(Vn(n,xh,"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()+Nh*l}function rt(n){let t=js(n),e=1e3*n.time.microsecond+n.time.nanosecond;return k.default.add(cn(t),k.default.BigInt(e))}function hu(n){let t=on(n,"trunc"),e=k.default.toNumber(k.default.remainder(n,ji));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<bi)return zs(n,cn(bi));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>Wl)return null;l=ur(n,s),a===l&&(o=s)}return a===l?null:cn(_u(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<bi)return null;let a=ur(n,o),s=o,l=a;for(;a===l&&o>bi;){if(s=o-2*Gn*7,s<bi)return null;l=ur(n,s),a===l&&(o=s)}return a===l?null:cn(_u(u=>ur(n,u),s,o,l,a))}function mu(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}}(Gl(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,yt),m(n,vt),m(n,At),m(n,bt),m(n,wt),m(n,Dt),m(n,Et),m(n,_t),m(n,Mt),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 pu(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 Ii(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}=Ar(y,3)),p+=a,y<0&&(p-=1,y+=1e3),{div:a,mod:p}=Ar(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 w=Math.trunc(s/24);return s%=24,s<0&&(w-=1,s+=24),w+=0,s+=0,l+=0,u+=0,h+=0,p+=0,y+=0,{deltaDays:w,hour:s,minute:l,second:u,millisecond:h,microsecond:p,nanosecond:y}}function ml(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(it("%Temporal.Duration%"))(-m(n,yt),-m(n,vt),-m(n,At),-m(n,bt),-m(n,wt),-m(n,Dt),-m(n,Et),-m(n,_t),-m(n,Mt),-m(n,Lt))}function Tt(n,t,e){return Math.min(e,Math.max(t,n))}function fu(n,t,e){let r=Tt(t,1,12);return{year:n,month:r,day:Tt(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=rt(n);(k.default.lessThan(t,Ah)||k.default.greaterThan(t,Lh))&&vn(t)}function ds(n){rt(n)}function vn(n){if(k.default.lessThan(n,Ti)||k.default.greaterThan(n,Br))throw new RangeError("date/time value is outside of supported range")}function Vs({year:n,month:t}){Ke(n,Qc,el),n===Qc?Ke(t,4,12):n===el&&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 W=p[$];if(W===1/0||W===-1/0)throw new RangeError("infinite values not allowed as duration fields");if(W!==0){let K=W<0?-1:1;if(h!==0&&K!==h)throw new RangeError("mixed-sign values not allowed as duration fields");h=K}}if(Math.abs(n)>=2**32||Math.abs(t)>=2**32||Math.abs(e)>=2**32)throw new RangeError("years, months, and weeks must be < 2\xB3\xB2");let y=Ar(s,3),w=Ar(l,6),T=Ar(u,9),S=Ar(1e6*y.mod+1e3*w.mod+T.mod,9).div,x=86400*r+3600*i+60*o+a+y.div+w.div+T.div+S;if(!Number.isSafeInteger(x))throw new RangeError("total of duration time units cannot exceed 9007199254740991.999999999 s")}function xr(n){return{date:{years:m(n,yt),months:m(n,vt),weeks:m(n,At),days:m(n,bt)},time:Re.fromComponents(m(n,wt),m(n,Dt),m(n,Et),m(n,_t),m(n,Mt),m(n,Lt))}}function fn(n){let t=Re.fromComponents(m(n,wt),m(n,Dt),m(n,Et),m(n,_t),m(n,Mt),m(n,Lt)).add24HourDays(m(n,bt));return{date:{years:m(n,yt),months:m(n,vt),weeks:m(n,At),days:0},time:t}}function gu(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(it("%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 js({isoDate:{year:n,month:t+1,day:e},time:{hour:0,minute:0,second:0,millisecond:0}})/Gn}function Or({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 Re.fromComponents(e,r,i,o,a,s)}function Ws(n,t,e,r,i){let o=Re.fromEpochNsDiff(t,n);return o=No(o,e,r,i),In({years:0,months:0,weeks:0,days:0},o)}function yu(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=Zi(e,n.isoDate,s,l);return r!==l&&(i=i.add24HourDays(u.days),u.days=0),In(u,i)}function vu(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:Re.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=Re.fromEpochNsDiff(t,T),y.sign()!==-a)break}let w=Pn("day",i);return In(Zi(r,s.isoDate,u.isoDate,w),y)}function bu(n,t,e,r,i,o,a,s,l){let u,h,p,y,w=t;switch(s){case"year":{let Y=Vn(w.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(w.date.months,a,"trunc");u=Y,h=Y+a*n,p=st(w.date,0,0,u),y=st(w.date,0,0,h);break}case"week":{let Y=st(w.date,0,0),se=Kt(o,r.isoDate,Y,"constrain"),g=Zi(o,se,Ht(se.year,se.month,se.day+w.date.days),"week"),H=Vn(w.date.weeks+g.weeks,a,"trunc");u=H,h=H+a*n,p=st(w.date,0,u),y=st(w.date,0,h);break}case"day":{let Y=Vn(w.date.days,a,"trunc");u=Y,h=Y+a*n,p=st(w.date,u),y=st(w.date,h);break}}let T=Kt(o,r.isoDate,p,"constrain"),S=Kt(o,r.isoDate,y,"constrain"),x,$,W=Me(T,r.time),K=Me(S,r.time);i?(x=ct(i,W,"compatible"),$=ct(i,K,"compatible")):(x=rt(W),$=rt(K));let ee=Re.fromEpochNsDiff(e,x),oe=Re.fromEpochNsDiff($,x),ae=zo(l,n<0?"negative":"positive"),Ce=ee.add(ee).abs().subtract(oe.abs()).sign(),Te=Math.abs(u)/a%2==0,ce=ee.isZero()?Math.abs(u):ee.cmp(oe)?Uo(Math.abs(u),Math.abs(h),Ce,Te,ae):Math.abs(h),F=new Re(k.default.add(k.default.multiply(oe.totalNs,k.default.BigInt(u)),k.default.multiply(ee.totalNs,k.default.BigInt(a*n)))).fdiv(oe.totalNs),z=ce===Math.abs(h);return w={date:z?y:p,time:Re.ZERO},{nudgeResult:{duration:w,nudgedEpochNs:z?$:x,didExpandCalendarUnit:z},total:F}}function Qo(n,t,e,r,i,o,a,s,l){let u=n,h=mn(s)||r&&s==="day",p=pu(u)<0?-1:1,y;return h?{nudgeResult:y}=bu(p,u,t,e,r,i,a,s,l):y=r?function(w,T,S,x,$,W,K,ee){let oe=T,ae=Kt($,S.isoDate,oe.date,"constrain"),Ce=Me(ae,S.time),Te=Me(Ht(ae.year,ae.month,ae.day+w),S.time),ce=ct(x,Ce,"compatible"),F=ct(x,Te,"compatible"),z=Re.fromEpochNsDiff(F,ce);if(z.sign()!==w)throw new RangeError("time zone returned inconsistent Instants");let Y=k.default.BigInt(Yr[K]*W),se=oe.time.round(Y,ee),g=se.subtract(z),H=g.sign()!==-w,c,d;return H?(c=w,se=g.round(Y,ee),d=se.addToEpochNs(F)):(c=0,d=se.addToEpochNs(ce)),{duration:In(st(oe.date,oe.date.days+c),se),nudgedEpochNs:d,didExpandCalendarUnit:H}}(p,u,e,r,i,a,s,l):function(w,T,S,x,$,W){let K=w,ee=K.time.add24HourDays(K.date.days),oe=ee.round(k.default.BigInt(x*Yr[$]),W),ae=oe.subtract(ee),{quotient:Ce}=ee.divmod(ko),{quotient:Te}=oe.divmod(ko),ce=Math.sign(Te-Ce)===ee.sign(),F=ae.addToEpochNs(T),z=0,Y=oe;return Sn(S)==="date"&&(z=Te,Y=oe.add(Re.fromComponents(24*-Te,0,0,0,0,0))),{duration:{date:st(K.date,z),time:Y},nudgedEpochNs:F,didExpandCalendarUnit:ce}}(u,t,o,a,s,l),u=y.duration,y.didExpandCalendarUnit&&s!=="week"&&(u=function(w,T,S,x,$,W,K,ee){let oe=T;if(ee===K)return oe;let ae=wi.indexOf(K);for(let Ce=wi.indexOf(ee)-1;Ce>=ae;Ce--){let Te=wi[Ce];if(Te==="week"&&K!=="week")continue;let ce;switch(Te){case"year":ce={years:oe.date.years+w,months:0,weeks:0,days:0};break;case"month":{let Y=oe.date.months+w;ce=st(oe.date,0,0,Y);break}case"week":{let Y=oe.date.weeks+w;ce=st(oe.date,0,Y);break}}let F=Me(Kt(W,x.isoDate,ce,"constrain"),x.time),z;if(z=$?ct($,F,"compatible"):rt(F),So(S,z)===-w)break;oe={date:ce,time:Re.ZERO}}return oe}(p,u,y.nudgedEpochNs,e,r,i,o,Pn(s,"day"))),u}function pl(n,t,e,r,i,o){return mn(o)||r&&o==="day"?bu(pu(n)<0?-1:1,n,t,e,r,i,1,o,"trunc").total:_i(n.time.add24HourDays(n.date.days),o)}function wu(n,t,e,r,i,o,a){if(jr(n,t)==0)return{date:{years:0,months:0,weeks:0,days:0},time:Re.ZERO};pr(n),pr(t);let s=yu(n,t,e,r);return o==="nanosecond"&&i===1?s:Qo(s,rt(t),n,null,e,r,i,o,a)}function Du(n,t,e,r,i,o,a,s){if(Sn(i)==="time")return Ws(n,t,o,a,s);let l=vu(n,t,e,r,i);return a==="nanosecond"&&o===1?l:Qo(l,t,rn(e,n),e,r,i,o,a,s)}function Gr(n,t,e,r,i,o){let a=Fr.reduce((w,T)=>{let S=T[0],x=T[1],$=T[2];return e!=="datetime"&&$!==e||r.includes(x)||w.push(x,S),w},[]),s=Ot(t,"largestUnit",e,"auto");if(r.includes(s))throw new RangeError(`largestUnit must be one of ${a.join(", ")}, not ${s}`);let l=Vr(t),u=ln(t,"trunc");n==="since"&&(u=function(w){switch(w){case"ceil":return"floor";case"floor":return"ceil";case"halfCeil":return"halfFloor";case"halfFloor":return"halfCeil";default:return w}}(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&&qr(l,y,!1),{largestUnit:s,roundingIncrement:l,roundingMode:u,smallestUnit:h}}function fl(n,t,e,r){let i=pi(e),o=Gr(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 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=Gr(n,ie(r),"date",[],"day","day"),l=it("%Temporal.Duration%"),u=m(t,me),h=m(i,me);if(bn(u,h)===0)return new l;let p={date:Zi(o,u,h,s.largestUnit),time:Re.ZERO};if(s.smallestUnit!=="day"||s.roundingIncrement!==1){let w=Me(u,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});p=Qo(p,rt(Me(h,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),w,null,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let y=tn(p,"day");return n==="since"&&(y=Bt(y)),y}function yl(n,t,e,r){let i=mi(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=Gr(n,ie(r),"datetime",[],"nanosecond","day"),l=it("%Temporal.Duration%"),u=m(t,Be),h=m(i,Be);if(jr(u,h)===0)return new l;let p=tn(wu(u,h,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);return n==="since"&&(p=Bt(p)),p}function vl(n,t,e,r){let i=Un(e),o=Gr(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(In({years:0,months:0,weeks:0,days:0},a),o.largestUnit);return n==="since"&&(s=Bt(s)),s}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 months of ${o} and ${a} calendars`);let s=Gr(n,ie(r),"date",["week","day"],"month","year"),l=it("%Temporal.Duration%");if(bn(m(t,me),m(i,me))==0)return new l;let u=kt(o,m(t,me),"year-month");u.day=1;let h=Kn(o,u,"constrain"),p=kt(o,m(i,me),"year-month");p.day=1;let y=Kn(o,p,"constrain"),w={date:st(Zi(o,h,y,s.largestUnit),0,0),time:Re.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});w=Qo(w,rt(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=tn(w,"day");return n==="since"&&(T=Bt(T)),T}function wl(n,t,e,r){let i=gi(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=Gr(n,ie(r),"datetime",[],"nanosecond","hour"),l=m(t,he),u=m(i,he),h=it("%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(!cu(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(Du(l,u,y,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),"hour")}return n==="since"&&(p=Bt(p)),p}function $r({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 yi(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 Dl(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(In({years:0,months:0,weeks:0,days:0},o.time.add(a.time)),i)}function El(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 _l(n,t,e,r){let i=m(t,U),o=nn(e);n==="subtract"&&(o=Bt(o));let a=gu(o),s=Ee(ie(r));return St(Kt(i,m(t,me),a,s),i)}function Ml(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,Be),u=$r(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 Tl(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}=$r(m(t,je),i.time);return Cn(Go(o,a,s,l,u,h,"reject"))}function Sl(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=kt(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=gu(i);return wr(u),Nr(Ci(s,kt(s,Kt(s,u,h,o),"year-month"),o),s)}function Cl(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=xr(i);return at(yi(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=Yr[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"),w,T;k.default.lessThan(l,Wt)?(w=k.default.subtract(h,Mi),T=h):(w=h,T=k.default.add(h,Mi));let S=So(cr(k.default.multiply(p,Bs)),u)*(k.default.lessThan(l,Wt)?-1:1)+0,x=k.default.equal(p,Wt)?h:Uo(w,T,S,Rl(w),y);return k.default.multiply(x,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=Yr[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=Yr[e];return n.round(k.default.BigInt(i*t),r)}function _i(n,t){let e=Yr[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 jr(n,t){let e=bn(n.isoDate,t.isoDate);return e!==0?e:gs(n.time,t.time)}function Eu(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}=ui(e,ji),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),ji)}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,ji),k.default.greaterThan(r,Br)?Br:k.default.lessThan(r,Ti)?Ti:r}})();function ci(){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 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 It(n){let t=Ri(n);if(!Oh.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 zh=new RegExp(`^${Vl.source}$`),Uh=new RegExp(`^${/([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])(?::?([0-5][0-9])(?:[.,](\d{1,9}))?)?)?/.source}$`);function _u(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 Mu(n){return[...n]}function Tu(n,t){if(n!=="gregory"&&n!=="iso8601")return;let e=eo[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,w,T,S){let x=(S-y-T+1)%7;x<0&&(x+=7);let $=Math.floor((T+x-1)/7);return 7-x>=w&&++$,$}(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 kl(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 eo={};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=Tt(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}}eo.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)=>Di(n.year,n.month,n.day,t),monthDayToISOReferenceDate(n,t){let{month:e,day:r}=Di(n.year??1972,n.month,n.day,t);return{month:e,day:r,year:1972}},extraFields:()=>[],fieldKeysToIgnore(n){let t=new Set;for(let e=0;e<n.length;e++){let r=n[e];t.add(r),r==="month"?t.add("monthCode"):r==="monthCode"&&t.add("month")}return Mu(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}=Di(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);!kl(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);!kl(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=fu(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=Tu("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 Su({isoYear:n,isoMonth:t,isoDay:e}){return`${Qi(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=Su({isoYear:r,isoMonth:i,isoDay:o}),u=this.getCalendarParts(l),h={};for(let y=0;y<u.length;y++){let{type:w,value:T}=u[y];if(w!=="year"&&w!=="relatedYear"||(this.hasEra?h.eraYear=+T:h.year=+T),w==="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])}w==="day"&&(h.day=+T),this.hasEra&&w==="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(w=>h.era===w.genericName);y&&(h.era=y.code)}if(this.reviseIntlEra){let{era:y,eraYear:w}=this.reviseIntlEra(h,t);h.era=y,h.eraYear=w}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 w=JSON.stringify({func:"calendarToIsoDate",year:p.year,month:p.month,day:p.day,overflow:y,id:this.id});e.set(w,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=Tt(o,1,i),a=Tt(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}),w=W=>{let K=this.addDaysIso(y,W);if(o.day>this.minimumMonthLength(o)){let ee=this.isoToCalendarDate(K,r);for(;ee.month!==s||ee.year!==a;){if(e==="reject")throw new RangeError(`day ${l} does not exist in month ${s} of year ${a}`);K=this.addDaysIso(K,-1),ee=this.isoToCalendarDate(K,r)}}return K},T=0,S=this.isoToCalendarDate(y,r),x=Za(o,S);if(x.years!==0||x.months!==0||x.days!==0){let W=365*x.years+30*x.months+x.days;y=this.addDaysIso(y,W),S=this.isoToCalendarDate(y,r),x=Za(o,S),x.years===0&&x.months===0?y=w(x.days):T=this.compareCalendarDates(o,S)}let $=8;for(;T;){y=this.addDaysIso(y,T*$);let W=S;S=this.isoToCalendarDate(y,r);let K=T;if(T=this.compareCalendarDates(o,S),T){if(x=Za(o,S),x.years===0&&x.months===0)y=w(x.days),T=0;else if(K&&T!==K)if($>1)$/=2;else{if(e==="reject")throw new RangeError(`Can't find ISO date from calendar date: ${JSON.stringify({...i})}`);this.compareCalendarDates(S,W)>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),w=this.addDaysIso(y,p);if(o=this.isoToCalendarDate(w,i),e>0){let T=this.monthsInYear(h,i);for(;o.month-1!=u%T;)w=this.addDaysIso(w,-1),o=this.isoToCalendarDate(w,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),w=o+7*i;return this.addDaysCalendar(y,w,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,w=l?this.addCalendar(t,{years:l},"constrain",i):t;do s+=u,y=w,w=this.addMonthsCalendar(y,u,"constrain",i),w.day!==t.day&&(w=this.regulateDate({...w,day:t.day},"constrain",i));while(this.compareCalendarDates(e,w)*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:w,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");(w===void 0||p!==void 0||this.hasEra&&h!==void 0)&&({monthCode:w,day:T}=this.isoToCalendarDate(this.calendarToIsoDate(t,e,r),r));let S={year:this.monthDaySearchStartYear(w,T),month:12,day:31},x=this.isoToCalendarDate(S,r),$=x.monthCode>w||x.monthCode===w&&x.day>=T?x.year:x.year-1;for(let W=0;W<20;W++){let K=this.adjustCalendarDate({day:T,monthCode:w,year:$-W},r),ee=this.calendarToIsoDate(K,"constrain",r),oe=this.isoToCalendarDate(ee,r);if({year:i,month:o,day:a}=ee,oe.monthCode===w&&oe.day===T)return{month:o,day:a,year:i};if(e==="constrain"){let ae=this.maxLengthOfMonthCodeInAnyYear(oe.monthCode);if(oe.monthCode===w&&oe.day===ae&&T>ae)return{month:o,day:a,year:i};(s===void 0||oe.monthCode===s.monthCode&&oe.day>s.day)&&(s=oe,l=ee)}}if(e==="constrain"&&l!==void 0)return l;throw new RangeError(`No recent ${this.id} year with monthCode ${w} 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=Tt(a,1,this.monthsInYear({year:o})),l=Tt(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 Di(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 Di(r+a.isoEpoch.year-(a.hasYearZero?0:1),i,o,"constrain")}},xi=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"}])}},Is=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}}])}},Rs=class extends xi{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 xi{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 xi{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=(x,$)=>{let W=Su({isoYear:x,isoMonth:2,isoDay:1}),K=new Date(W);K.setUTCDate($+1);let ee=o.formatToParts(K),oe=ee.find(ce=>ce.type==="month").value,ae=+ee.find(ce=>ce.type==="day").value,Ce=ee.find(ce=>ce.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:oe,calendarDay:ae,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,w,T=1,S=!1;do({calendarMonthString:l,calendarDay:u,calendarYearToVerify:h}=a(t,s)),y&&(p[w].daysInMonth=y+30-u),h!==t?S=!0:(p[l]={monthIndex:T++},s+=30),y=u,w=l;while(!S);return p[w].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,w=>w==="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 w=+u.replace(/^M0?|L$/g,"");y=h[w],y&&(a=y.monthIndex,u=gn(w))}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=Tt(a,1,y),l=Tt(l,1,this.maximumMonthLength()));let w=p.find(T=>T[1].monthIndex===a);if(w===void 0)throw new RangeError(`Invalid month ${a} in Chinese year ${o}`);u=gn(+w[0].replace("bis",""),w[0].indexOf("bis")!==-1)}else{let h=this.getMonthList(o,e),p=u.replace(/^M|L$/g,w=>w==="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 Mu(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=eo.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=Tu(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,Is,ks,Ps,Ns,Os,Rs,Ss,xs,As,Ls,bs,ws,Ds,Es,_s,Ms]){let t=new n;eo[t.id]=new Hs(t)}rs("calendarImpl",function(n){return eo[n]});var Ai=Intl.DateTimeFormat;function kr(n,t){let e=m(n,t);return typeof e=="function"&&(e=new Ai(m(n,$l),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 li(n){return Pt(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(w){if(w==null)throw new TypeError(`Expected object not ${w}`);return Object(w)}(o);let y=Object.create(null);for(let w=0;w<p.length;w++){let T=p[w];Object.prototype.hasOwnProperty.call(s,T)&&(y[T]=s[T])}s=y}else s=Object.create(null);let l=new Ai(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,$l,u.locale),ve(r,br,l),ve(r,Rr,u.timeZone),ve(r,di,u.calendar),ve(r,Nl,Qh),ve(r,Ol,Jh),ve(r,Hl,Xh),ve(r,Bl,Zh),ve(r,Fl,em),ve(r,Yl,tm);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,Ct(p))}})(this,t,e)}get format(){R(this,li);let t=qh.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,li),Gh.call(this,t,e)}formatToParts(t,...e){return R(this,li),Wh.call(this,t,...e)}formatRangeToParts(t,e){return R(this,li),Kh.call(this,t,e)}resolvedOptions(){return R(this,li),Vh.call(this)}};"formatToParts"in Ai.prototype||delete vr.prototype.formatToParts,"formatRangeToParts"in Ai.prototype||delete vr.prototype.formatRangeToParts;var Gt=function(n=void 0,t=void 0){return new vr(n,t)};function Vh(){let n=m(this,br).resolvedOptions();return n.timeZone=m(this,Xa),n}function qh(n,...t){let e,r,i=zr(n,this);return i.formatter?(e=i.formatter,r=[on(i.epochNs,"floor")]):(e=m(this,br),r=[n,...t]),e.format(...r)}function Wh(n,...t){let e,r,i=zr(n,this);return i.formatter?(e=i.formatter,r=[on(i.epochNs,"floor")]):(e=m(this,br),r=[n,...t]),e.formatToParts(...r)}function Gh(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(!Cu(e,r))throw new TypeError("Intl.DateTimeFormat.formatRange accepts two values of the same type");let{epochNs:a,formatter:s}=zr(e,this),{epochNs:l,formatter:u}=zr(r,this);s&&(i=s,o=[on(a,"floor"),on(l,"floor")])}return i||(i=m(this,br)),i.formatRange(...o)}function Kh(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(!Cu(e,r))throw new TypeError("Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type");let{epochNs:a,formatter:s}=zr(e,this),{epochNs:l,formatter:u}=zr(r,this);s&&(i=s,o=[on(a,"floor"),on(l,"floor")])}return i||(i=m(this,br)),i.formatRangeToParts(...o)}function to(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 Zh(n){let t=to(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(no(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 Jh(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=to(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(no(n))throw new TypeError(`cannot format PlainYearMonth with options [${Object.keys(n)}]`);Object.assign(e,{year:"numeric",month:"numeric"})}return e}function Xh(n){let t={short:{month:"numeric",day:"numeric"},medium:{month:"short",day:"numeric"},long:{month:"long",day:"numeric"},full:{month:"long",day:"numeric"}},e=to(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(no(n))throw new TypeError(`cannot format PlainMonthDay with options [${Object.keys(n)}]`);Object.assign(e,{month:"numeric",day:"numeric"})}return e}function Qh(n){let t=to(n,{hour:!1,minute:!1,second:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if(!ea(t)){if(no(n))throw new TypeError(`cannot format PlainDate with options [${Object.keys(n)}]`);Object.assign(t,{year:"numeric",month:"numeric",day:"numeric"})}return t}function em(n){let t=to(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(no(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 tm(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 no(n){return ea(n)||ta(n)||"dateStyle"in n||"timeStyle"in n||"timeZoneName"in n}function xn(n){return $e(n)||Ue(n)||Ne(n)||be(n)||nt(n)||qt(n)||tt(n)}function $o(n){return xn(n)?n:Vo(n)}function Cu(n,t){return!(!xn(n)||!xn(t)||Ue(n)&&!Ue(t)||$e(n)&&!$e(t)||Ne(n)&&!Ne(t)||be(n)&&!be(t)||nt(n)&&!nt(t)||qt(n)&&!qt(t)||tt(n)&&!tt(t))}function zr(n,t){if(Ue(n)){let e={isoDate:{year:1970,month:1,day:1},time:m(n,je)};return{epochNs:ct(m(t,Rr),e,"compatible"),formatter:kr(t,Bl)}}if(nt(n)){let e=m(n,U),r=m(t,di);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,Rr),i,"compatible"),formatter:kr(t,Ol)}}if(qt(n)){let e=m(n,U),r=m(t,di);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,Rr),i,"compatible"),formatter:kr(t,Hl)}}if($e(n)){let e=m(n,U),r=m(t,di);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,Rr),i,"compatible"),formatter:kr(t,Nl)}}if(Ne(n)){let e=m(n,U),r=m(t,di);if(e!=="iso8601"&&e!==r)throw new RangeError(`cannot format PlainDateTime with calendar ${e} in locale with calendar ${r}`);let i=m(n,Be);return{epochNs:ct(m(t,Rr),i,"compatible"),formatter:kr(t,Fl)}}if(be(n))throw new TypeError("Temporal.ZonedDateTime not supported in DateTimeFormat methods. Use toLocaleString() instead.");return tt(n)?{epochNs:m(n,he),formatter:kr(t,Yl)}:{}}function ku(n){let t=Object.create(null);return t.years=m(n,yt),t.months=m(n,vt),t.weeks=m(n,At),t.days=m(n,bt),t.hours=m(n,wt),t.minutes=m(n,Dt),t.seconds=m(n,Et),t.milliseconds=m(n,_t),t.microseconds=m(n,Mt),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=Ai.supportedLocalesOf,On(Gt,"Intl.DateTimeFormat");var{format:nm,formatToParts:rm}=Intl.DurationFormat?.prototype??Object.create(null);function Zs(n){Intl.DurationFormat.prototype.resolvedOptions.call(this);let t=ku(nn(n));return nm.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=ku(nn(n));return rm.call(this,t)});var tp=Object.freeze({__proto__:null,DateTimeFormat:Gt,ModifiedIntlDurationFormatPrototypeFormat:Zs}),Li=class{constructor(t){if(arguments.length<1)throw new TypeError("missing argument: epochNanoseconds is required");au(this,Oo(t))}get epochMilliseconds(){return R(this,tt),on(m(this,he),"floor")}get epochNanoseconds(){return R(this,tt),Eu(k.default.BigInt(m(this,he)))}add(t){return R(this,tt),El("add",this,t)}subtract(t){return R(this,tt),El("subtract",this,t)}until(t,e=void 0){return R(this,tt),fl("until",this,t,e)}since(t,e=void 0){return R(this,tt),fl("since",this,t,e)}round(t){if(R(this,tt),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?gr("smallestUnit",t):ie(t),r=Vr(e),i=ln(e,"halfExpand"),o=Ot(e,"smallestUnit","time",An);return qr(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){R(this,tt);let e=pi(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,tt);let e=ie(t),r=qi(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=Ct(a));let{precision:s,unit:l,increment:u}=Wi(o,r);return al(sn(ms(m(this,he),u,l,i)),a,s)}toJSON(){return R(this,tt),al(this,void 0,"auto")}toLocaleString(t=void 0,e=void 0){return R(this,tt),new Gt(t,e).format(this)}valueOf(){Xn("Instant")}toZonedDateTimeISO(t){R(this,tt);let e=Ct(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 pi(t)}static compare(t,e){let r=pi(t),i=pi(e),o=m(r,he),a=m(i,he);return k.default.lessThan(o,a)?-1:k.default.greaterThan(o,a)?1:0}};On(Li,"Temporal.Instant");var Ni=class{constructor(t,e,r,i="iso8601"){let o=fe(t),a=fe(e),s=fe(r),l=It(i===void 0?"iso8601":Ge(i));mr(o,a,s),tu(this,{year:o,month:a,day:s},l)}get calendarId(){return R(this,$e),m(this,U)}get era(){return pt(this,"era")}get eraYear(){return pt(this,"eraYear")}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 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 daysInMonth(){return pt(this,"daysInMonth")}get daysInYear(){return pt(this,"daysInYear")}get monthsInYear(){return pt(this,"monthsInYear")}get inLeapYear(){return pt(this,"inLeapYear")}with(t,e=void 0){if(R(this,$e),!ze(t))throw new TypeError("invalid argument");Ur(t);let r=m(this,U),i=kt(r,m(this,me));return i=hr(r,i,Jt(r,t,["year","month","monthCode","day"],[],"partial")),St(Kn(r,i,Ee(ie(e))),r)}withCalendar(t){R(this,$e);let e=Ji(t);return St(m(this,me),e)}add(t,e=void 0){return R(this,$e),_l("add",this,t,e)}subtract(t,e=void 0){return R(this,$e),_l("subtract",this,t,e)}until(t,e=void 0){return R(this,$e),gl("until",this,t,e)}since(t,e=void 0){return R(this,$e),gl("since",this,t,e)}equals(t){R(this,$e);let e=hi(t);return bn(m(this,me),m(e,me))===0&&yn(m(this,U),m(e,U))}toString(t=void 0){return R(this,$e),sl(this,Vi(ie(t)))}toJSON(){return R(this,$e),sl(this)}toLocaleString(t=void 0,e=void 0){return R(this,$e),new Gt(t,e).format(this)}valueOf(){Xn("PlainDate")}toPlainDateTime(t=void 0){R(this,$e);let e=eu(t);return en(Me(m(this,me),e),m(this,U))}toZonedDateTime(t){let e,r;if(R(this,$e),ze(t)){let a=t.timeZone;a===void 0?e=Ct(t):(e=Ct(a),r=t.plainTime)}else e=Ct(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(){R(this,$e);let t=m(this,U);return Nr(Ci(t,kt(t,m(this,me)),"constrain"),t)}toPlainMonthDay(){R(this,$e);let t=m(this,U);return Lr(Ro(t,kt(t,m(this,me)),"constrain"),t)}static from(t,e=void 0){return hi(t,e)}static compare(t,e){let r=hi(t),i=hi(e);return bn(m(r,me),m(i,me))}};function pt(n,t){R(n,$e);let e=m(n,me);return Gi(n).isoToDate(e,{[t]:!0})[t]}On(Ni,"Temporal.PlainDate");var Oi=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),w=fe(r),T=i===void 0?0:fe(i),S=o===void 0?0:fe(o),x=a===void 0?0:fe(a),$=s===void 0?0:fe(s),W=l===void 0?0:fe(l),K=u===void 0?0:fe(u),ee=It(h===void 0?"iso8601":Ge(h));Us(p,y,w,T,S,x,$,W,K),nu(this,{isoDate:{year:p,month:y,day:w},time:{hour:T,minute:S,second:x,millisecond:$,microsecond:W,nanosecond:K}},ee)}get calendarId(){return R(this,Ne),m(this,U)}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 Pr(this,"hour")}get minute(){return Pr(this,"minute")}get second(){return Pr(this,"second")}get millisecond(){return Pr(this,"millisecond")}get microsecond(){return Pr(this,"microsecond")}get nanosecond(){return Pr(this,"nanosecond")}get era(){return ft(this,"era")}get eraYear(){return ft(this,"eraYear")}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 daysInWeek(){return ft(this,"daysInWeek")}get daysInYear(){return ft(this,"daysInYear")}get daysInMonth(){return ft(this,"daysInMonth")}get monthsInYear(){return ft(this,"monthsInYear")}get inLeapYear(){return ft(this,"inLeapYear")}with(t,e=void 0){if(R(this,Ne),!ze(t))throw new TypeError("invalid argument");Ur(t);let r=m(this,U),i=m(this,Be),o={...kt(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(Ki(r,o,Ee(ie(e))),r)}withPlainTime(t=void 0){R(this,Ne);let e=eu(t);return en(Me(m(this,Be).isoDate,e),m(this,U))}withCalendar(t){R(this,Ne);let e=Ji(t);return en(m(this,Be),e)}add(t,e=void 0){return R(this,Ne),Ml("add",this,t,e)}subtract(t,e=void 0){return R(this,Ne),Ml("subtract",this,t,e)}until(t,e=void 0){return R(this,Ne),yl("until",this,t,e)}since(t,e=void 0){return R(this,Ne),yl("since",this,t,e)}round(t){if(R(this,Ne),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?gr("smallestUnit",t):ie(t),r=Vr(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];qr(r,a,a===1);let s=m(this,Be);return en(r===1&&o==="nanosecond"?s:ps(s,r,o,i),m(this,U))}equals(t){R(this,Ne);let e=mi(t);return jr(m(this,Be),m(e,Be))===0&&yn(m(this,U),m(e,U))}toString(t=void 0){R(this,Ne);let e=ie(t),r=Vi(e),i=qi(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}=Wi(a,i),h=ps(m(this,Be),u,l,o);return pr(h),Pi(h,m(this,U),s,r)}toJSON(){return R(this,Ne),Pi(m(this,Be),m(this,U),"auto")}toLocaleString(t=void 0,e=void 0){return R(this,Ne),new Gt(t,e).format(this)}valueOf(){Xn("PlainDateTime")}toZonedDateTime(t,e=void 0){R(this,Ne);let r=Ct(t),i=Ei(ie(e));return at(ct(r,m(this,Be),i),r,m(this,U))}toPlainDate(){return R(this,Ne),St(m(this,Be).isoDate,m(this,U))}toPlainTime(){return R(this,Ne),Cn(m(this,Be).time)}static from(t,e=void 0){return mi(t,e)}static compare(t,e){let r=mi(t),i=mi(e);return jr(m(r,Be),m(i,Be))}};function ft(n,t){R(n,Ne);let e=m(n,Be).isoDate;return Gi(n).isoToDate(e,{[t]:!0})[t]}function Pr(n,t){return R(n,Ne),m(n,Be).time[t]}On(Oi,"Temporal.PlainDateTime");var Hi=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),w=r===void 0?0:an(r),T=i===void 0?0:an(i),S=o===void 0?0:an(o),x=a===void 0?0:an(a),$=s===void 0?0:an(s),W=l===void 0?0:an(l),K=u===void 0?0:an(u),ee=h===void 0?0:an(h);Xo(p,y,w,T,S,x,$,W,K,ee),Nn(this),ve(this,yt,p),ve(this,vt,y),ve(this,At,w),ve(this,bt,T),ve(this,wt,S),ve(this,Dt,x),ve(this,Et,$),ve(this,_t,W),ve(this,Mt,K),ve(this,Lt,ee)}get years(){return R(this,Ye),m(this,yt)}get months(){return R(this,Ye),m(this,vt)}get weeks(){return R(this,Ye),m(this,At)}get days(){return R(this,Ye),m(this,bt)}get hours(){return R(this,Ye),m(this,wt)}get minutes(){return R(this,Ye),m(this,Dt)}get seconds(){return R(this,Ye),m(this,Et)}get milliseconds(){return R(this,Ye),m(this,_t)}get microseconds(){return R(this,Ye),m(this,Mt)}get nanoseconds(){return R(this,Ye),m(this,Lt)}get sign(){return R(this,Ye),Lo(this)}get blank(){return R(this,Ye),Lo(this)===0}with(t){R(this,Ye);let e=Ql(t),{years:r=m(this,yt),months:i=m(this,vt),weeks:o=m(this,At),days:a=m(this,bt),hours:s=m(this,wt),minutes:l=m(this,Dt),seconds:u=m(this,Et),milliseconds:h=m(this,_t),microseconds:p=m(this,Mt),nanoseconds:y=m(this,Lt)}=e;return new n(r,i,o,a,s,l,u,h,p,y)}negated(){return R(this,Ye),Bt(this)}abs(){return R(this,Ye),new n(Math.abs(m(this,yt)),Math.abs(m(this,vt)),Math.abs(m(this,At)),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,Mt)),Math.abs(m(this,Lt)))}add(t){return R(this,Ye),Dl("add",this,t)}subtract(t){return R(this,Ye),Dl("subtract",this,t)}round(t){if(R(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=Vr(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 w={hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[u];if(w!==void 0&&qr(s,w,!1),s>1&&Sn(u)==="date"&&i!==u)throw new RangeError("For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit");if(a){let S=xr(this),x=m(a,ke),$=m(a,U),W=m(a,he);return S=Du(W,yi(W,x,$,S),x,$,i,s,u,l),Sn(i)==="date"&&(i="hour"),tn(S,i)}if(o){let S=fn(this),x=$r({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},S.time),$=m(o,me),W=m(o,U),K=Kt(W,$,st(S.date,x.deltaDays),"constrain");return S=wu(Me($,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),Me(K,x),W,i,s,u,l),tn(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:x}=T.time.divmod(ko),$=T.date.days+S+_i(x,"day");$=Vn($,s,l),T=In({years:0,months:0,weeks:0,days:$},Re.ZERO)}else T=In({years:0,months:0,weeks:0,days:0},No(T.time,s,u,l));return tn(T,i)}total(t){if(R(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=xr(this),l=m(i,ke),u=m(i,U),h=m(i,he);return function(p,y,w,T,S){return Sn(S)==="time"?_i(Re.fromEpochNsDiff(y,p),S):pl(vu(p,y,w,T,S),y,rn(w,p),w,T,S)}(h,yi(h,l,u,s),l,u,o)}if(r){let s=fn(this),l=$r({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,w,T,S){if(jr(y,w)==0)return 0;pr(y),pr(w);let x=yu(y,w,T,S);return S==="nanosecond"?k.default.toNumber(x.time.totalNs):pl(x,rt(w),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 _i(fn(this).time,o)}toString(t=void 0){R(this,Ye);let e=ie(t),r=qi(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}=Wi(o,r);if(s==="nanosecond"&&l===1)return Mo(this,a);let u=Tn(this),h=xr(this),p=No(h.time,l,s,i);return h=In(h.date,p),Mo(tn(h,Pn(u,"second")),a)}toJSON(){return R(this,Ye),Mo(this,"auto")}toLocaleString(t=void 0,e=void 0){if(R(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,yt)===m(o,yt)&&m(i,vt)===m(o,vt)&&m(i,At)===m(o,At)&&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,Mt)===m(o,Mt)&&m(i,Lt)===m(o,Lt))return 0;let u=Tn(i),h=Tn(o),p=xr(i),y=xr(o);if(l&&(Sn(u)==="date"||Sn(h)==="date")){let $=m(l,ke),W=m(l,U),K=m(l,he),ee=yi(K,$,W,p),oe=yi(K,$,W,y);return Nt(k.default.toNumber(k.default.subtract(ee,oe)))}let w=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");w=ml(p.date,s),T=ml(y.date,s)}let S=p.time.add24HourDays(w),x=y.time.add24HourDays(T);return S.cmp(x)}};On(Hi,"Temporal.Duration");var Bi=class{constructor(t,e,r="iso8601",i=1972){let o=fe(t),a=fe(e),s=It(r===void 0?"iso8601":Ge(r)),l=fe(i);mr(l,o,a),ru(this,{year:l,month:o,day:a},s)}get monthCode(){return Pl(this,"monthCode")}get day(){return Pl(this,"day")}get calendarId(){return R(this,qt),m(this,U)}with(t,e=void 0){if(R(this,qt),!ze(t))throw new TypeError("invalid argument");Ur(t);let r=m(this,U),i=kt(r,m(this,me),"month-day");return i=hr(r,i,Jt(r,t,["year","month","monthCode","day"],[],"partial")),Lr(Ro(r,i,Ee(ie(e))),r)}equals(t){R(this,qt);let e=il(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),ll(this,Vi(ie(t)))}toJSON(){return R(this,qt),ll(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),!ze(t))throw new TypeError("argument should be an object");let e=m(this,U);return St(Kn(e,hr(e,kt(e,m(this,me),"month-day"),Jt(e,t,["year"],[],[])),"constrain"),e)}static from(t,e=void 0){return il(t,e)}};function Pl(n,t){R(n,qt);let e=m(n,me);return Gi(n).isoToDate(e,{[t]:!0})[t]}function Ja(n){return rn(n,ys())}On(Bi,"Temporal.PlainMonthDay");var Pu={instant:()=>sn(ys()),plainDateTimeISO:(n=ci())=>en(Ja(Ct(n)),"iso8601"),plainDateISO:(n=ci())=>St(Ja(Ct(n)).isoDate,"iso8601"),plainTimeISO:(n=ci())=>Cn(Ja(Ct(n)).time),timeZoneId:()=>ci(),zonedDateTimeISO:(n=ci())=>{let t=Ct(n);return at(ys(),t,"iso8601")},[Symbol.toStringTag]:"Temporal.Now"};Object.defineProperty(Pu,Symbol.toStringTag,{value:"Temporal.Now",writable:!1,enumerable:!1,configurable:!0});var Fi=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),iu(this,{hour:s,minute:l,second:u,millisecond:h,microsecond:p,nanosecond:y})}get hour(){return R(this,Ue),m(this,je).hour}get minute(){return R(this,Ue),m(this,je).minute}get second(){return R(this,Ue),m(this,je).second}get millisecond(){return R(this,Ue),m(this,je).millisecond}get microsecond(){return R(this,Ue),m(this,je).microsecond}get nanosecond(){return R(this,Ue),m(this,je).nanosecond}with(t,e=void 0){if(R(this,Ue),!ze(t))throw new TypeError("invalid argument");Ur(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 R(this,Ue),Tl("add",this,t)}subtract(t){return R(this,Ue),Tl("subtract",this,t)}until(t,e=void 0){return R(this,Ue),vl("until",this,t,e)}since(t,e=void 0){return R(this,Ue),vl("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=Vr(e),i=ln(e,"halfExpand"),o=Ot(e,"smallestUnit","time",An);return qr(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){R(this,Ue);let e=Un(t);return gs(m(this,je),m(e,je))===0}toString(t=void 0){R(this,Ue);let e=ie(t),r=qi(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}=Wi(o,r);return cl(fs(m(this,je),l,s,i),a)}toJSON(){return R(this,Ue),cl(m(this,je),"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 gs(m(r,je),m(i,je))}};On(Fi,"Temporal.PlainTime");var Yi=class{constructor(t,e,r="iso8601",i=1){let o=fe(t),a=fe(e),s=It(r===void 0?"iso8601":Ge(r)),l=fe(i);mr(o,a,l),ou(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,nt),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,nt),!ze(t))throw new TypeError("invalid argument");Ur(t);let r=m(this,U),i=kt(r,m(this,me),"year-month");return i=hr(r,i,Jt(r,t,["year","month","monthCode"],[],"partial")),Nr(Ci(r,i,Ee(ie(e))),r)}add(t,e=void 0){return R(this,nt),Sl("add",this,t,e)}subtract(t,e=void 0){return R(this,nt),Sl("subtract",this,t,e)}until(t,e=void 0){return R(this,nt),bl("until",this,t,e)}since(t,e=void 0){return R(this,nt),bl("since",this,t,e)}equals(t){R(this,nt);let e=fi(t);return bn(m(this,me),m(e,me))===0&&yn(m(this,U),m(e,U))}toString(t=void 0){return R(this,nt),ul(this,Vi(ie(t)))}toJSON(){return R(this,nt),ul(this)}toLocaleString(t=void 0,e=void 0){return R(this,nt),new Gt(t,e).format(this)}valueOf(){Xn("PlainYearMonth")}toPlainDate(t){if(R(this,nt),!ze(t))throw new TypeError("argument should be an object");let e=m(this,U);return St(Kn(e,hr(e,kt(e,m(this,me),"year-month"),Jt(e,t,["day"],[],[])),"constrain"),e)}static from(t,e=void 0){return fi(t,e)}static compare(t,e){let r=fi(t),i=fi(e);return bn(m(r,me),m(i,me))}};function _n(n,t){R(n,nt);let e=m(n,me);return Gi(n).isoToDate(e,{[t]:!0})[t]}On(Yi,"Temporal.PlainYearMonth");var im=Gt.prototype.resolvedOptions,$i=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);su(this,i,o,It(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 gt(this,"year")}get month(){return gt(this,"month")}get monthCode(){return gt(this,"monthCode")}get day(){return gt(this,"day")}get hour(){return Ir(this,"hour")}get minute(){return Ir(this,"minute")}get second(){return Ir(this,"second")}get millisecond(){return Ir(this,"millisecond")}get microsecond(){return Ir(this,"microsecond")}get nanosecond(){return Ir(this,"nanosecond")}get era(){return gt(this,"era")}get eraYear(){return gt(this,"eraYear")}get epochMilliseconds(){return R(this,be),on(m(this,he),"floor")}get epochNanoseconds(){return R(this,be),Eu(m(this,he))}get dayOfWeek(){return gt(this,"dayOfWeek")}get dayOfYear(){return gt(this,"dayOfYear")}get weekOfYear(){return gt(this,"weekOfYear")?.week}get yearOfWeek(){return gt(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 _i(Re.fromEpochNsDiff(o,i),"hour")}get daysInWeek(){return gt(this,"daysInWeek")}get daysInMonth(){return gt(this,"daysInMonth")}get daysInYear(){return gt(this,"daysInYear")}get monthsInYear(){return gt(this,"monthsInYear")}get inLeapYear(){return gt(this,"inLeapYear")}get offset(){return R(this,be),cs(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),!ze(t))throw new TypeError("invalid zoned-date-time-like");Ur(t);let r=m(this,U),i=m(this,ke),o=kn(i,m(this,he)),a=hn(this),s={...kt(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=Ei(l),h=To(l,"prefer"),p=Ki(r,s,Ee(l)),y=Wr(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),je)),"compatible"),at(o,e,r)}withTimeZone(t){R(this,be);let e=Ct(t);return at(m(this,he),e,m(this,U))}withCalendar(t){R(this,be);let e=Ji(t);return at(m(this,he),m(this,ke),e)}add(t,e=void 0){return R(this,be),Cl("add",this,t,e)}subtract(t,e=void 0){return R(this,be),Cl("subtract",this,t,e)}until(t,e=void 0){return R(this,be),wl("until",this,t,e)}since(t,e=void 0){return R(this,be),wl("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=Vr(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(qr(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),w=jn(s,p),T=jn(s,y),S=k.default.subtract(T,w);h=Re.fromEpochNsDiff(l,w).round(S,i).addToEpochNs(w)}else{let p=ps(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=gi(t),r=m(this,he),i=m(e,he);return!!k.default.equal(k.default.BigInt(r),k.default.BigInt(i))&&!!cu(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=Vi(e),i=qi(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}=Wi(s,i);return dl(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 w=0;w<y.length;w++){let T=y[w];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),hl(i.timeZone))throw new RangeError("toLocaleString does not currently support offset time zones");let o=new Gt(t,i),a=im.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),dl(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(hl(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 R(this,be),sn(m(this,he))}toPlainDate(){return R(this,be),St(hn(this).isoDate,m(this,U))}toPlainTime(){return R(this,be),Cn(hn(this).time)}toPlainDateTime(){return R(this,be),en(hn(this),m(this,U))}static from(t,e=void 0){return gi(t,e)}static compare(t,e){let r=gi(t),i=gi(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 gt(n,t){R(n,be);let e=hn(n).isoDate;return Gi(n).isoToDate(e,{[t]:!0})[t]}function Ir(n,t){return R(n,be),hn(n).time[t]}On($i,"Temporal.ZonedDateTime");var xe=Object.freeze({__proto__:null,Duration:Hi,Instant:Li,Now:Pu,PlainDate:Ni,PlainDateTime:Oi,PlainMonthDay:Bi,PlainTime:Fi,PlainYearMonth:Yi,ZonedDateTime:$i}),np=class{toTemporalInstant(){return sn(cn(Date.prototype.valueOf.call(this)))}}.prototype.toTemporalInstant,om=[Li,Ni,Oi,Hi,Bi,Fi,Yi,$i];for(let n of om){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 am=Object.prototype.hasOwnProperty,na=(n,t)=>am.call(n,t),Dr=Array.isArray,ro=n=>Ru(n)==="[object Map]";var Iu=n=>typeof n=="function",sm=n=>typeof n=="string",Kr=n=>typeof n=="symbol",io=n=>n!==null&&typeof n=="object";var cm=Object.prototype.toString,Ru=n=>cm.call(n),xu=n=>Ru(n).slice(8,-1);var ra=n=>sm(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))},lm=/-(\w)/g,op=ia(n=>n.replace(lm,(t,e)=>e?e.toUpperCase():"")),um=/\B([A-Z])/g,ap=ia(n=>n.replace(um,"-$1").toLowerCase()),dm=ia(n=>n.charAt(0).toUpperCase()+n.slice(1)),sp=ia(n=>n?`on${dm(n)}`:""),Er=(n,t)=>!Object.is(n,t);var hm="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";var cp=Js(hm+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var Qs;var Oe;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||Ou(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Au(this),Hu(this);let t=Oe,e=un;Oe=this,un=!0;try{return this.fn()}finally{Bu(this),Oe=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,Au(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)}},Nu=0,ao,so;function Ou(n,t=!1){if(n.flags|=8,t){n.next=so,so=n;return}n.next=ao,ao=n}function mc(){Nu++}function pc(){if(--Nu>0)return;if(so){let t=so;for(so=void 0;t;){let e=t.next;t.next=void 0,t.flags&=-9,t=e}}let n;for(;ao;){let t=ao;for(ao=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 Hu(n){for(let t=n.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Bu(n){let t,e=n.depsTail,r=e;for(;r;){let i=r.prevDep;r.version===-1?(r===e&&(e=i),fc(r),mm(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&&(Fu(t.dep.computed)||t.dep.version!==t.version))return!0;return!!n._dirty}function Fu(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===co)||(n.globalVersion=co,!n.isSSR&&n.flags&128&&(!n.deps&&!n._dirty||!rc(n))))return;n.flags|=2;let t=n.dep,e=Oe,r=un;Oe=n,un=!0;try{Hu(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{Oe=e,un=r,Bu(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 mm(n){let{prevDep:t,nextDep:e}=n;t&&(t.nextDep=e,n.prevDep=void 0),e&&(e.prevDep=t,n.nextDep=void 0)}function xt(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,Yu=[];function pm(){Yu.push(un),un=!1}function fm(){let n=Yu.pop();un=n===void 0?!0:n}function Au(n){let{cleanup:t}=n;if(n.cleanup=void 0,t){let e=Oe;Oe=void 0;try{t()}finally{Oe=e}}}var co=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}},lo=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(!Oe||!un||Oe===this.computed)return;let e=this.activeLink;if(e===void 0||e.sub!==Oe)e=this.activeLink=new ic(Oe,this),Oe.deps?(e.prevDep=Oe.depsTail,Oe.depsTail.nextDep=e,Oe.depsTail=e):Oe.deps=Oe.depsTail=e,$u(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=Oe.depsTail,e.nextDep=void 0,Oe.depsTail.nextDep=e,Oe.depsTail=e,Oe.deps===e&&(Oe.deps=r)}return e}trigger(t){this.version++,co++,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 $u(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)$u(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(""),uo=Symbol("");function Ft(n,t,e){if(un&&Oe){let r=oc.get(n);r||oc.set(n,r=new Map);let i=r.get(e);i||(r.set(e,i=new lo),i.map=r,i.key=e),i.track()}}function Qn(n,t,e,r,i,o){let a=oc.get(n);if(!a){co++;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===uo||!Kr(y)&&y>=h)&&s(p)})}else switch((e!==void 0||a.has(void 0))&&s(a.get(e)),u&&s(a.get(uo)),t){case"add":l?u&&s(a.get("length")):(s(a.get(_r)),ro(n)&&s(a.get(ac)));break;case"delete":l||(s(a.get(_r)),ro(n)&&s(a.get(ac)));break;case"set":ro(n)&&s(a.get(_r));break}}pc()}function Zr(n){let t=Le(n);return t===n?t:(Ft(t,"iterate",uo),er(n)?t:t.map(Rt))}function gc(n){return Ft(n=Le(n),"iterate",uo),n}var gm={__proto__:null,[Symbol.iterator](){return tc(this,Symbol.iterator,Rt)},concat(...n){return Zr(this).concat(...n.map(t=>Dr(t)?Zr(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 Zr(this).join(n)},lastIndexOf(...n){return nc(this,"lastIndexOf",n)},map(n,t){return Hn(this,"map",n,t,void 0,arguments)},pop(){return oo(this,"pop")},push(...n){return oo(this,"push",n)},reduce(n,...t){return Lu(this,"reduce",n,t)},reduceRight(n,...t){return Lu(this,"reduceRight",n,t)},shift(){return oo(this,"shift")},some(n,t){return Hn(this,"some",n,t,void 0,arguments)},splice(...n){return oo(this,"splice",n)},toReversed(){return Zr(this).toReversed()},toSorted(n){return Zr(this).toSorted(n)},toSpliced(...n){return Zr(this).toSpliced(...n)},unshift(...n){return oo(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 ym=Array.prototype;function Hn(n,t,e,r,i,o){let a=gc(n),s=a!==n&&!er(n),l=a[t];if(l!==ym[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 Lu(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=Le(n);Ft(r,"iterate",uo);let i=r[t](...e);return(i===-1||i===!1)&&Im(e[0])?(e[0]=Le(e[0]),r[t](...e)):i}function oo(n,t,e=[]){pm(),mc();let r=Le(n)[t].apply(n,e);return pc(),fm(),r}var vm=Js("__proto__,__v_isRef,__isVue"),ju=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(Kr));function bm(n){Kr(n)||(n=String(n));let t=Le(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?Cm:Vu:o?Sm:Uu).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;let a=Dr(t);if(!i){let l;if(a&&(l=gm[e]))return l;if(e==="hasOwnProperty")return bm}let s=Reflect.get(t,e,Jr(t)?t:r);return(Kr(e)?ju.has(e):vm(e))||(i||Ft(t,"get",e),o)?s:Jr(s)?a&&ra(e)?s:s.value:io(s)?i?Qr(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=Xr(o);if(!er(r)&&!Xr(r)&&(o=Le(o),r=Le(r)),!Dr(t)&&Jr(o)&&!Jr(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,Jr(t)?t:i);return t===Le(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(!Kr(e)||!ju.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}},wm=new sc,Dm=new cc;var lc=n=>n,oa=n=>Reflect.getPrototypeOf(n);function Em(n,t,e){return function(...r){let i=this.__v_raw,o=Le(i),a=ro(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 _m(n,t){let e={get(i){let o=this.__v_raw,a=Le(o),s=Le(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(Le(i),"iterate",_r),Reflect.get(i,"size",i)},has(i){let o=this.__v_raw,a=Le(o),s=Le(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=Le(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)&&!Xr(i)&&(i=Le(i));let o=Le(this);return oa(o).has.call(o,i)||(o.add(i),Qn(o,"add",i,i)),this},set(i,o){!t&&!er(o)&&!Xr(o)&&(o=Le(o));let a=Le(this),{has:s,get:l}=oa(a),u=s.call(a,i);u||(i=Le(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=Le(this),{has:a,get:s}=oa(o),l=a.call(o,i);l||(i=Le(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=Le(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]=Em(i,n,t)}),e}function zu(n,t){let e=_m(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 Mm={get:zu(!1,!1)};var Tm={get:zu(!0,!1)};var Uu=new WeakMap,Sm=new WeakMap,Vu=new WeakMap,Cm=new WeakMap;function km(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Pm(n){return n.__v_skip||!Object.isExtensible(n)?0:km(xu(n))}function tr(n){return Xr(n)?n:qu(n,!1,wm,Mm,Uu)}function Qr(n){return qu(n,!0,Dm,Tm,Vu)}function qu(n,t,e,r,i){if(!io(n)||n.__v_raw&&!(t&&n.__v_isReactive))return n;let o=Pm(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 Xr(n){return!!(n&&n.__v_isReadonly)}function er(n){return!!(n&&n.__v_isShallow)}function Im(n){return n?!!n.__v_raw:!1}function Le(n){let t=n&&n.__v_raw;return t?Le(t):n}var Rt=n=>io(n)?tr(n):n,uc=n=>io(n)?Qr(n):n;function Jr(n){return n?n.__v_isRef===!0:!1}function Ze(n){return Rm(n,!1)}function Rm(n,t){return Jr(n)?n:new dc(n,t)}var dc=class{constructor(t,e){this.dep=new lo,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=e?t:Le(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)||Xr(t);t=r?t:Le(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 lo(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=co-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!e,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&Oe!==this)return Ou(this,!0),!0}get value(){let t=this.dep.track();return Fu(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 Iu(n)?r=n:(r=n.get,i=n.set),new hc(r,i,e)}var $c=Wc(Gu(),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 Je(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 Ku={en:{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",pricingProducts:"Products:",pricingProductsAndExtras:"Products & Extras:",pricingTaxes:"Taxes:",pricingSubtotal:"Subtotal:",pricingService:"service"},"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",pricingProducts:"Produits :",pricingProductsAndExtras:"Produits et options :",pricingTaxes:"Taxes :",pricingSubtotal:"Sous-total :",pricingService:"service"},de:{loading:"Laden...",night:"Nacht",chooseOption:"Option ausw\xE4hlen",apartment:"Apartment",total:"Gesamt",missingEnterpriseId:"Unternehmens-ID fehlt",missingCategoryId:"Kategorie-ID fehlt",minimumNights:"Mindestn\xE4chte",maximumNights:"Maximale N\xE4chte",booked:"Bereits gebucht",select:"Ausw\xE4hlen",fatalErrorMessage:"Hoppla! Ein unerwarteter Fehler ist aufgetreten. Bitte laden Sie die Seite neu oder kontaktieren Sie den Support.",pleaseWait:"Bitte warten...","chargingMode:Once":"Einmal","chargingMode:PerTimeUnit":"Pro Nacht","chargingMode:PerPersonPerTimeUnit":"Pro Person und Nacht",adults:"Erwachsene",children:"Kinder (0-18 Jahre)",guestSingular:"Person",guestPlural:"Personen",couponValid:"Gutschein ist g\xFCltig ;)",couponInvalid:"Gutschein ist ung\xFCltig!",couponError:"Fehler bei der Gutscheinpr\xFCfung!",proceedToPayment:"Zur Zahlung fortfahren",completePayment:"Zahlung abschlie\xDFen",viewHotelPage:"Website ansehen",pricingProducts:"Produkte:",pricingProductsAndExtras:"Produkte & Extras:",pricingTaxes:"Steuern:",pricingSubtotal:"Zwischensumme:",pricingService:"Service"},es:{loading:"Cargando...",night:"Noche",chooseOption:"Elige una opci\xF3n",apartment:"Apartamento",total:"Total",missingEnterpriseId:"Falta el ID de empresa",missingCategoryId:"Falta el ID de categor\xEDa",minimumNights:"noches m\xEDnimas",maximumNights:"noches m\xE1ximas",booked:"Ya reservado",select:"Seleccionar",fatalErrorMessage:"\xA1Ups! Ha ocurrido un error inesperado. Por favor, recarga la p\xE1gina o contacta con soporte.",pleaseWait:"Por favor espera...","chargingMode:Once":"Una vez","chargingMode:PerTimeUnit":"Por noche","chargingMode:PerPersonPerTimeUnit":"Por persona y noche",adults:"Adultos",children:"Ni\xF1os (0-18 a\xF1os)",guestSingular:"Persona",guestPlural:"Personas",couponValid:"El cup\xF3n es v\xE1lido ;)",couponInvalid:"\xA1El cup\xF3n no es v\xE1lido!",couponError:"Error al validar el cup\xF3n!",proceedToPayment:"Ir al pago",completePayment:"Completar el pago",viewHotelPage:"Ver el sitio",pricingProducts:"Productos:",pricingProductsAndExtras:"Productos y extras:",pricingTaxes:"Impuestos:",pricingSubtotal:"Subtotal:",pricingService:"servicio"},it:{loading:"Caricamento...",night:"Notte",chooseOption:"Scegli un\u2019opzione",apartment:"Appartamento",total:"Totale",missingEnterpriseId:"ID azienda mancante",missingCategoryId:"ID categoria mancante",minimumNights:"notti minime",maximumNights:"notti massime",booked:"Gi\xE0 prenotato",select:"Seleziona",fatalErrorMessage:"Ops! Si \xE8 verificato un errore imprevisto. Ricarica la pagina o contatta il supporto.",pleaseWait:"Attendere prego...","chargingMode:Once":"Una volta","chargingMode:PerTimeUnit":"Per notte","chargingMode:PerPersonPerTimeUnit":"Per persona a notte",adults:"Adulti",children:"Bambini (0-18 anni)",guestSingular:"Persona",guestPlural:"Persone",couponValid:"Il coupon \xE8 valido ;)",couponInvalid:"Il coupon non \xE8 valido!",couponError:"Errore durante la verifica del coupon!",proceedToPayment:"Procedi al pagamento",completePayment:"Completa il pagamento",viewHotelPage:"Vedi il sito",pricingProducts:"Prodotti:",pricingProductsAndExtras:"Prodotti ed extra:",pricingTaxes:"Tasse:",pricingSubtotal:"Subtotale:",pricingService:"servizio"},pt:{loading:"A carregar...",night:"Noite",chooseOption:"Escolha uma op\xE7\xE3o",apartment:"Apartamento",total:"Total",missingEnterpriseId:"ID da empresa em falta",missingCategoryId:"ID da categoria em falta",minimumNights:"noites m\xEDnimas",maximumNights:"noites m\xE1ximas",booked:"J\xE1 reservado",select:"Selecionar",fatalErrorMessage:"Ops! Ocorreu um erro inesperado. Por favor, recarregue a p\xE1gina ou contacte o suporte.",pleaseWait:"Por favor, aguarde...","chargingMode:Once":"Uma vez","chargingMode:PerTimeUnit":"Por noite","chargingMode:PerPersonPerTimeUnit":"Por pessoa por noite",adults:"Adultos",children:"Crian\xE7as (0-18 anos)",guestSingular:"Pessoa",guestPlural:"Pessoas",couponValid:"O cup\xE3o \xE9 v\xE1lido ;)",couponInvalid:"O cup\xE3o \xE9 inv\xE1lido!",couponError:"Erro ao validar o cup\xE3o!",proceedToPayment:"Prosseguir para pagamento",completePayment:"Concluir pagamento",viewHotelPage:"Ver site",pricingProducts:"Produtos:",pricingProductsAndExtras:"Produtos e extras:",pricingTaxes:"Impostos:",pricingSubtotal:"Subtotal:",pricingService:"servi\xE7o"},zh:{loading:"\u52A0\u8F7D\u4E2D...",night:"\u665A",chooseOption:"\u8BF7\u9009\u62E9\u4E00\u4E2A\u9009\u9879",apartment:"\u516C\u5BD3",total:"\u603B\u8BA1",missingEnterpriseId:"\u7F3A\u5C11\u4F01\u4E1AID",missingCategoryId:"\u7F3A\u5C11\u7C7B\u522BID",minimumNights:"\u6700\u5C11\u5165\u4F4F\u665A\u6570",maximumNights:"\u6700\u591A\u5165\u4F4F\u665A\u6570",booked:"\u5DF2\u9884\u8BA2",select:"\u9009\u62E9",fatalErrorMessage:"\u7CDF\u7CD5\uFF01\u53D1\u751F\u4E86\u610F\u5916\u9519\u8BEF\u3002\u8BF7\u5237\u65B0\u9875\u9762\u6216\u8054\u7CFB\u652F\u6301\u3002",pleaseWait:"\u8BF7\u7A0D\u5019...","chargingMode:Once":"\u4E00\u6B21","chargingMode:PerTimeUnit":"\u6BCF\u665A","chargingMode:PerPersonPerTimeUnit":"\u6BCF\u4EBA\u6BCF\u665A",adults:"\u6210\u4EBA",children:"\u513F\u7AE5\uFF080-18\u5C81\uFF09",guestSingular:"\u4EBA",guestPlural:"\u4EBA",couponValid:"\u4F18\u60E0\u5238\u6709\u6548 ;)",couponInvalid:"\u4F18\u60E0\u5238\u65E0\u6548\uFF01",couponError:"\u9A8C\u8BC1\u4F18\u60E0\u5238\u65F6\u51FA\u9519\uFF01",proceedToPayment:"\u524D\u5F80\u652F\u4ED8",completePayment:"\u5B8C\u6210\u652F\u4ED8",viewHotelPage:"\u67E5\u770B\u7F51\u7AD9",pricingProducts:"\u4EA7\u54C1\uFF1A",pricingProductsAndExtras:"\u4EA7\u54C1\u53CA\u9644\u52A0\u9879\uFF1A",pricingTaxes:"\u7A0E\u8D39\uFF1A",pricingSubtotal:"\u5C0F\u8BA1\uFF1A",pricingService:"\u670D\u52A1"},ar:{loading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644...",night:"\u0644\u064A\u0644\u0629",chooseOption:"\u0627\u062E\u062A\u0631 \u062E\u064A\u0627\u0631\u064B\u0627",apartment:"\u0634\u0642\u0629",total:"\u0627\u0644\u0625\u062C\u0645\u0627\u0644\u064A",missingEnterpriseId:"\u0645\u0639\u0631\u0651\u0641 \u0627\u0644\u0634\u0631\u0643\u0629 \u0645\u0641\u0642\u0648\u062F",missingCategoryId:"\u0645\u0639\u0631\u0651\u0641 \u0627\u0644\u0641\u0626\u0629 \u0645\u0641\u0642\u0648\u062F",minimumNights:"\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u062F\u0646\u0649 \u0644\u0639\u062F\u062F \u0627\u0644\u0644\u064A\u0627\u0644\u064A",maximumNights:"\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0639\u062F\u062F \u0627\u0644\u0644\u064A\u0627\u0644\u064A",booked:"\u0645\u062D\u062C\u0648\u0632 \u0628\u0627\u0644\u0641\u0639\u0644",select:"\u0627\u062E\u062A\u064A\u0627\u0631",fatalErrorMessage:"\u0639\u0630\u0631\u064B\u0627! \u062D\u062F\u062B \u062E\u0637\u0623 \u063A\u064A\u0631 \u0645\u062A\u0648\u0642\u0639. \u064A\u0631\u062C\u0649 \u0625\u0639\u0627\u062F\u0629 \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0635\u0641\u062D\u0629 \u0623\u0648 \u0627\u0644\u0627\u062A\u0635\u0627\u0644 \u0628\u0627\u0644\u062F\u0639\u0645.",pleaseWait:"\u064A\u0631\u062C\u0649 \u0627\u0644\u0627\u0646\u062A\u0638\u0627\u0631...","chargingMode:Once":"\u0645\u0631\u0629 \u0648\u0627\u062D\u062F\u0629","chargingMode:PerTimeUnit":"\u0644\u0643\u0644 \u0644\u064A\u0644\u0629","chargingMode:PerPersonPerTimeUnit":"\u0644\u0643\u0644 \u0634\u062E\u0635 \u0641\u064A \u0627\u0644\u0644\u064A\u0644\u0629",adults:"\u0627\u0644\u0628\u0627\u0644\u063A\u0648\u0646",children:"\u0627\u0644\u0623\u0637\u0641\u0627\u0644 (0-18 \u0633\u0646\u0629)",guestSingular:"\u0634\u062E\u0635",guestPlural:"\u0623\u0634\u062E\u0627\u0635",couponValid:"\u0627\u0644\u0642\u0633\u064A\u0645\u0629 \u0635\u0627\u0644\u062D\u0629 ;)",couponInvalid:"\u0627\u0644\u0642\u0633\u064A\u0645\u0629 \u063A\u064A\u0631 \u0635\u0627\u0644\u062D\u0629!",couponError:"\u062E\u0637\u0623 \u0641\u064A \u0627\u0644\u062A\u062D\u0642\u0642 \u0645\u0646 \u0627\u0644\u0642\u0633\u064A\u0645\u0629!",proceedToPayment:"\u0627\u0644\u0645\u062A\u0627\u0628\u0639\u0629 \u0625\u0644\u0649 \u0627\u0644\u062F\u0641\u0639",completePayment:"\u0625\u062A\u0645\u0627\u0645 \u0627\u0644\u062F\u0641\u0639",viewHotelPage:"\u0639\u0631\u0636 \u0627\u0644\u0645\u0648\u0642\u0639",pricingProducts:"\u0627\u0644\u0645\u0646\u062A\u062C\u0627\u062A:",pricingProductsAndExtras:"\u0627\u0644\u0645\u0646\u062A\u062C\u0627\u062A \u0648\u0627\u0644\u0625\u0636\u0627\u0641\u0627\u062A:",pricingTaxes:"\u0627\u0644\u0636\u0631\u0627\u0626\u0628:",pricingSubtotal:"\u0627\u0644\u0645\u062C\u0645\u0648\u0639 \u0627\u0644\u0641\u0631\u0639\u064A:",pricingService:"\u0627\u0644\u062E\u062F\u0645\u0629"},ru:{loading:"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430...",night:"\u041D\u043E\u0447\u044C",chooseOption:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u0430\u0440\u0438\u0430\u043D\u0442",apartment:"\u0410\u043F\u0430\u0440\u0442\u0430\u043C\u0435\u043D\u0442\u044B",total:"\u0418\u0442\u043E\u0433\u043E",missingEnterpriseId:"\u041E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 ID \u043A\u043E\u043C\u043F\u0430\u043D\u0438\u0438",missingCategoryId:"\u041E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 ID \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u0438",minimumNights:"\u043C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043D\u043E\u0447\u0435\u0439",maximumNights:"\u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043D\u043E\u0447\u0435\u0439",booked:"\u0423\u0436\u0435 \u0437\u0430\u0431\u0440\u043E\u043D\u0438\u0440\u043E\u0432\u0430\u043D\u043E",select:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C",fatalErrorMessage:"\u0423\u043F\u0441! \u041F\u0440\u043E\u0438\u0437\u043E\u0448\u043B\u0430 \u043D\u0435\u043F\u0440\u0435\u0434\u0432\u0438\u0434\u0435\u043D\u043D\u0430\u044F \u043E\u0448\u0438\u0431\u043A\u0430. \u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u043F\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443 \u0438\u043B\u0438 \u0441\u0432\u044F\u0436\u0438\u0442\u0435\u0441\u044C \u0441 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u043A\u043E\u0439.",pleaseWait:"\u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u043F\u043E\u0434\u043E\u0436\u0434\u0438\u0442\u0435...","chargingMode:Once":"\u041E\u0434\u0438\u043D \u0440\u0430\u0437","chargingMode:PerTimeUnit":"\u0417\u0430 \u043D\u043E\u0447\u044C","chargingMode:PerPersonPerTimeUnit":"\u0417\u0430 \u0447\u0435\u043B\u043E\u0432\u0435\u043A\u0430 \u0437\u0430 \u043D\u043E\u0447\u044C",adults:"\u0412\u0437\u0440\u043E\u0441\u043B\u044B\u0435",children:"\u0414\u0435\u0442\u0438 (0-18 \u043B\u0435\u0442)",guestSingular:"\u0427\u0435\u043B\u043E\u0432\u0435\u043A",guestPlural:"\u041B\u044E\u0434\u0438",couponValid:"\u041A\u0443\u043F\u043E\u043D \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043B\u0435\u043D ;)",couponInvalid:"\u041A\u0443\u043F\u043E\u043D \u043D\u0435\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043B\u0435\u043D!",couponError:"\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438 \u043A\u0443\u043F\u043E\u043D\u0430!",proceedToPayment:"\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043A \u043E\u043F\u043B\u0430\u0442\u0435",completePayment:"\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044C \u043E\u043F\u043B\u0430\u0442\u0443",viewHotelPage:"\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043D\u0430 \u0441\u0430\u0439\u0442",pricingProducts:"\u0422\u043E\u0432\u0430\u0440\u044B:",pricingProductsAndExtras:"\u0422\u043E\u0432\u0430\u0440\u044B \u0438 \u0434\u043E\u043F. \u0443\u0441\u043B\u0443\u0433\u0438:",pricingTaxes:"\u041D\u0430\u043B\u043E\u0433\u0438:",pricingSubtotal:"\u041F\u0440\u043E\u043C\u0435\u0436\u0443\u0442\u043E\u0447\u043D\u044B\u0439 \u0438\u0442\u043E\u0433:",pricingService:"\u0443\u0441\u043B\u0443\u0433\u0430"}},vc={en:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"fr-FR":["janv.","f\xE9vr.","mars","avr.","mai","juin","juil.","ao\xFBt","sept.","oct.","nov.","d\xE9c."],de:["Jan.","Feb.","M\xE4rz","Apr.","Mai","Juni","Juli","Aug.","Sept.","Okt.","Nov.","Dez."],es:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sept.","oct.","nov.","dic."],it:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],pt:["jan.","fev.","mar.","abr.","mai.","jun.","jul.","ago.","set.","out.","nov.","dez."],zh:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],ar:["\u064A\u0646\u0627\u064A\u0631","\u0641\u0628\u0631\u0627\u064A\u0631","\u0645\u0627\u0631\u0633","\u0623\u0628\u0631\u064A\u0644","\u0645\u0627\u064A\u0648","\u064A\u0648\u0646\u064A\u0648","\u064A\u0648\u0644\u064A\u0648","\u0623\u063A\u0633\u0637\u0633","\u0633\u0628\u062A\u0645\u0628\u0631","\u0623\u0643\u062A\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062F\u064A\u0633\u0645\u0628\u0631"],ru:["\u044F\u043D\u0432.","\u0444\u0435\u0432\u0440.","\u043C\u0430\u0440\u0442","\u0430\u043F\u0440.","\u043C\u0430\u0439","\u0438\u044E\u043D\u044C","\u0438\u044E\u043B\u044C","\u0430\u0432\u0433.","\u0441\u0435\u043D\u0442.","\u043E\u043A\u0442.","\u043D\u043E\u044F\u0431.","\u0434\u0435\u043A."]},Ju=()=>{let n=Mr().bcp47,t=n.split("-")[0],e=[n,t,"en"];for(let r of e)if(r in vc)return vc[r];return vc.en},Zu=(n,t)=>{for(let e of t){let r=n[e];if(typeof r=="string"&&r.trim()!=="")return r}},Am=n=>{let t=[],e=o=>{o&&!t.includes(o)&&t.push(o)};e(n);let r=n.split("-")[0];return r&&r!==n&&e(r),({en:["en-US","en-GB"],es:["es-ES","es-MX","es-419"],de:["de-DE","de-AT","de-CH"],it:["it-IT","it-CH"],pt:["pt-PT","pt-BR"],zh:["zh-CN","zh-TW","zh-Hans","zh-Hant"],ar:["ar-SA","ar-EG"],ru:["ru-RU"],fr:["fr-FR","fr-CA","fr-BE","fr"]}[r]??[]).forEach(e),e("en-US"),e("en"),e("fr-FR"),e("fr"),t},Pe=n=>Ku[Mr().bcp47][n]||Ku["fr-FR"][n],Xe=n=>{let t=Mr().bcp47,e=t.split("-")[0],r=Zu(n,Am(t));if(r!==void 0)return r;if(e){let a=Object.entries(n).find(([s])=>s===e||s.startsWith(`${e}-`));if(a&&a[1].trim()!=="")return a[1]}let i=Zu(n,["en-US","en","fr-FR","fr"]);if(i!==void 0)return i;let o=Object.values(n).find(a=>typeof a=="string"&&a.trim()!=="");return o!==void 0?o:(console.warn(`Translation [${t}] not found and no fallback strings were available.`,n),"")};var Mr=()=>{let n=document.documentElement.lang.toLowerCase(),t={iso639:"fr",bcp47:"fr-FR"},r=Object.entries({en:{iso639:"en",bcp47:"en"},fr:{iso639:"fr",bcp47:"fr-FR"},de:{iso639:"de",bcp47:"de"},es:{iso639:"es",bcp47:"es"},it:{iso639:"it",bcp47:"it"},pt:{iso639:"pt",bcp47:"pt"},zh:{iso639:"zh",bcp47:"zh"},ar:{iso639:"ar",bcp47:"ar"},ru:{iso639:"ru",bcp47:"ru"}}).find(([i])=>n.startsWith(i))?.[1];return r&&(t=r),t},qe=Mr().bcp47,Cp=Mr().iso639;var J=class n{static getCurrentDate(){return xe.Now.plainDateISO()}static fromString(t){return xe.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"?xe.PlainDate.from(t):xe.PlainDate.from(t)).toZonedDateTime({timeZone:"Europe/Paris",plainTime:xe.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 xe.PlainDate.compare(t,e)>0}static isAfterOrEqual(t,e){return xe.PlainDate.compare(t,e)<0}static isSameDate(t,e){return xe.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 xe.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 xe.PlainDate.from(e)}return xe.PlainDate.from(t)}catch(e){return console.error("Error parsing date string:",e),n.getCurrentDate()}}};var Op=localStorage.getItem("dev")==="true";var Hp=3*60*60*1e3;var ua="calendar-day-price",Xu="DD/MM/YYYY",Qu="Y-m-d",ed=!1,Lm=365,bc=J.getCurrentDate(),td=J.addDays(bc,Lm),Tr=J.getCurrentDate(),ei=J.addDays(Tr,3),Nm=J.getCurrentDate(),Bp=J.addDays(Nm,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 G=(n,t=document)=>t.querySelector(`[${da}="${n}"]`);var nd=n=>`[${da}="${n.getAttribute(da)}"]`,rd=n=>n.getAttribute(da);var wc=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}},lf=new wc;var Sr={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)),Sr.touch()}catch(e){console.error(`Error writing to localStorage for key ${n}:`,e)}},update:(n,t)=>{let e=Sr.get(n),r=t(e);Sr.set(n,r)},remove:n=>{localStorage.removeItem(n),Sr.touch()},clear:()=>{localStorage.clear()},has:n=>localStorage.getItem(n)!==null,touch:()=>{localStorage.setItem("lastUpdater",Hm()||"root")}},Hm=()=>localStorage.getItem("lastUpdater");var ha=n=>{let t=new Date;return t.setDate(t.getDate()+n),t.toISOString().split("T")[0]},ir=Sr.get("form_state"),id=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(id),Om=Qr(id);xt(()=>{Sr.set("form_state",Yt)});var Bm="https://yuna-backend.cbocher.workers.dev/mews",Fm="https://api.mews.com/api/distributor/v1",Ym="Yuna",$m="mewscache",jm=!1,zm=13,Um=8,Vm=xe.Duration.from({minutes:20}).milliseconds,qm=new Headers({Accept:"application/json, text/plain, */*","Content-Type":"application/json; charset=utf-8"}),le={base_url:Bm,bookingEngine_url:Fm,bookingEngineClient:Ym,bypassCache:jm,headers:qm,cache_key:$m,ttl:Vm,beCheckInUTC:zm,beCheckOutUTC:Um};var ma=(n,t,e)=>`${n}:${t}:${JSON.stringify(e)}`;var ti=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:le.ttl,p=xe.Instant.fromEpochMilliseconds(u.timestamp);if(xe.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:xe.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:xe.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=xe.Now.instant().epochMilliseconds-le.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((w,T)=>{let S=a.delete(y.cacheKey);S.onsuccess=()=>w(),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=xe.Duration.from({minutes:10}).milliseconds)=>{let i=new ti,o=ma(`booking-engine:${n}`,e||"null",t.body);if(!le.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 od=async n=>{let t=`${le.bookingEngine_url}/hotels/get`,e={Client:le.bookingEngineClient,HotelId:n},r={method:"POST",headers:le.headers,body:JSON.stringify(e)};return Bn(t,r,n)};var pa=(n,t)=>{let e=`${le.bookingEngine_url}/reservations/getPricing`,r={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Bn(e,r,n)};var ad=(n,t)=>{let e=`${le.bookingEngine_url}/services/getAvailability`,r={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Bn(e,r,n)},sd=(n,t)=>{let e=`${le.bookingEngine_url}/services/getPricing`,r={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Bn(e,r,n)};var Qe=async(n,t,e=null,r=!1)=>{let i=new ti,o=ma(n,e||"null",t.body);if(!le.bypassCache){let a=await i.get(o);if(a)return a}try{let a=new URL(le.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 cd=(n,t={})=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/services/getAll",e,n)};function ld(n){return n.Services.map(t=>({id:t.Id,enterpriseId:t.EnterpriseId,isActive:t.IsActive,name:Xe(t.Names),startTime:t.StartTime,endTime:t.EndTime,type:t.Type,ordering:t.Ordering}))}var Dc=Ze({});async function ud(n){if(Dc.value[n])return Dc.value[n];let t=await cd(n),e=ld(t);return Dc.value[n]=e,e}var dd=(n,t)=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/ageCategories/getAll",e,n)};function hd(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:Xe(t.Names),shortName:t.ShortNames?Xe(t.ShortNames):null,classification:t.Classification,isActive:t.IsActive,maximalAge:t.MaximalAge,minimalAge:t.MinimalAge,serviceId:t.ServiceId}))}var Ec=Ze({});async function md(n){if(Ec.value[n])return Ec.value[n];let t=await dd(n,{EnterpriseIds:[n]}),e=hd(t);return Ec.value[n]=e,e}var pd=(n,t)=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/products/getAll",e,n)};function fd(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 gd(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 yd(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:Xe(t.Names),shortName:t.ShortName,description:Xe(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 _c(n){return{id:n.Id,serviceId:n.ServiceId,categoryId:n.CategoryId,isActive:n.IsActive,isDefault:n.IsDefault,name:Xe(n.Names),shortName:Xe(n.ShortNames),description:Xe(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 vd(n){return{products:ho(n.Products,_c),customerProducts:ho(n.CustomerProducts,_c)}}var Mc=Ze({});async function bd(n,t){if(Mc.value[t])return Mc.value[t];let e=await pd(n,{ServiceIds:[t]}),r=vd(e);return Mc.value[t]=r,r}var wd=(n,t={})=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/rates/getAll",e,n)};var Tc=Ze({});async function fa(n,t){if(Tc.value[t])return Tc.value[t];let e=await wd(n,{ServiceIds:[t]}),r=yd(e);return Tc.value[t]=r,r}var Dd=(n,t)=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/services/getAvailability",e,n)};function Ed(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 Sc=Ze({});async function _d(n,t,e,r){if(Sc.value[t])return Sc.value[t];let i=await Dd(n,{ServiceId:t,FirstTimeUnitStartUtc:J.formatForAPI(e),LastTimeUnitStartUtc:J.formatForAPI(r)}),o=Ed(i);return Sc.value[t]=o,o}var Md=(n,t)=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/restrictions/getAll",e,n)};function Td(n){if(!n||!n.Restrictions||!Array.isArray(n.Restrictions))throw new Error("Invalid service restrictions response format");return n.Restrictions}var Cc=Ze({});async function Sd(n,t,e,r){if(Cc.value[t])return Cc.value[t];let i=await Md(n,{ServiceIds:[t],CollidingUtc:{StartUtc:J.formatForAPI(e),EndUtc:J.formatForAPI(r)},Origin:"User"}),o=Td(i);return Cc.value[t]=o,o}var Cd=(n,t)=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/rules/getAll",e,n)};function kd(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 kc=Ze({});async function Pd(n,t){if(kc.value[t])return kc.value[t];let e=await Cd(n,{ServiceIds:[t],Extent:{RuleActions:!0}}),r=kd(e);return kc.value[t]=r,r}var Id=(n,t)=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/rates/getPricing",e,n)};var Pc=Ze({});async function Rd(n,t,e,r){if(Pc.value[t])return Pc.value[t];let i=await Id(n,{RateId:t,FirstTimeUnitStartUtc:J.formatForAPI(e),LastTimeUnitStartUtc:J.formatForAPI(r)}),o=fd(i);return Pc.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 Rd(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 _d(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 Sd(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 bd(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 Pd(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 md(this.enterprise.getEnterpriseId()),this.ageCategories}getAgeCategories(){if(this.ageCategories.length===0)throw new Error("Age categories are not initialized");return this.ageCategories}};var ni=class{constructor(t){L(this,"enterpriseId");L(this,"services",[]);L(this,"reservableService",null);this.enterpriseId=t}async initServices(){this.services=await ud(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 N,Ie,Dn,or,Ic=class{constructor(){_o(this,Dn);_o(this,N,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(()=>!C(this,N).startDate||!C(this,N).endDate?0:C(this,N).startDate.until(C(this,N).endDate).days),selectedProducts:Xt(()=>C(this,N).products.filter(t=>t.selected)),maxAllowedRooms:Xt(()=>{if(!C(this,N).availabilities)return 0;let{categoryId:t}=C(this,N).cmsApartmentData,e=C(this,N).availabilities.CategoryAvailabilities.find(i=>i.CategoryId===t);return e?Math.min(...e.Availabilities.slice(0,-1)):0}),rates:Xt(()=>C(this,N).servicePricing?.Rates?C(this,N).servicePricing.Rates.map(t=>{let e=C(this,N).servicePricing?.RateGroups?.find(o=>o.Id===t.RateGroupId),i=C(this,N).servicePricing?.CategoryPrices.find(o=>o.CategoryId===C(this,N).cmsApartmentData.categoryId)?.OccupancyPrices.find(o=>{let a=C(this,N).rooms.flat(),s=Object.groupBy(a,u=>u.ageCategoryId),l={};return Object.entries(s).map(([u,h])=>{let p=h?.reduce((y,w)=>y+w.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:Xe(t.Name),description:Xe(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=C(this,N).reservationPricing?.OccupancyPrices??[],e=C(this,N).serviceOnlyPricing?.OccupancyPrices??[],r=C(this,N).cmsApartmentData?.name??"",{rooms:i}=C(this,N),o="EUR";if(C(this,N).isFetching||t.length===0||e.length===0)return{currency:o,nightCount:C(this,Ie).nightsCount.value,items:[],totals:{service:0,products:0,taxes:0,grandTotal:0}};let a=new Map;for(let w of e){let T=w.Pricing.find($=>$.RateId===C(this,N).selectedRateId);if(!T)continue;let x=T.Price.TotalAmount[o].Breakdown.Items.filter($=>$.TaxRateCode==="FR-R").reduce(($,W)=>$+W.NetValue,0);a.set(`${w.AdultCount}-${w.ChildCount}`,x)}let s=new Map;for(let w of t){let T=w.Pricing.find(ae=>ae.RateId===C(this,N).selectedRateId);if(!T)continue;let S=`${w.AdultCount}-${w.ChildCount}`,x=T.Price.TotalAmount[o],$=a.get(S)??0,W=C(this,Ie).nightsCount.value||1,K=$/W,ee=x.TaxValues.filter(ae=>ae.TaxRateCode==="FR-R").reduce((ae,Ce)=>ae+Ce.Value,0),oe=x.GrossValue-$-ee;s.set(S,{rateId:T.RateId,pricing:{avgPerNight:K,service:$,products:oe,taxes:ee,subtotal:x.GrossValue}})}let l=new Map;for(let w of i){let T=0,S=0;for(let $ of w)$.isAdult?T+=$.value:S+=$.value;let x=`${T}-${S}`;l.has(x)?l.get(x).quantity+=1:l.set(x,{adults:T,children:S,quantity:1})}if(!Array.from(l.keys()).every(w=>s.has(w)))return{currency:o,nightCount:C(this,Ie).nightsCount.value,items:[],totals:{service:0,products:0,taxes:0,grandTotal:0}};let p=Array.from(l.values()).map(w=>{let T=`${w.adults}-${w.children}`,S=s.get(T);return S?{key:T,roomName:r,occupancy:{adults:w.adults,children:w.children},quantity:w.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,N).selectedRateId,occupancyPricesCount:t.length}),{key:T,roomName:r,occupancy:{adults:w.adults,children:w.children},quantity:w.quantity,rateId:C(this,N).selectedRateId||"",pricing:{avgPerNight:0,service:0,products:0,taxes:0,subtotal:0}})}),y=p.reduce((w,T)=>(w.service+=T.pricing.service*T.quantity,w.products+=T.pricing.products*T.quantity,w.taxes+=T.pricing.taxes*T.quantity,w.grandTotal+=T.pricing.subtotal*T.quantity,w),{service:0,products:0,taxes:0,grandTotal:0});return{currency:o,nightCount:C(this,Ie).nightsCount.value,items:p,totals:y}}),totalStayPrice:Xt(()=>{let t=C(this,Ie).rates.value.find(e=>e.id===C(this,N).selectedRateId)?.price;return t?t.TotalAmount.GrossValue:0}),adultsCount:Xt(()=>C(this,N).rooms.reduce((t,e)=>t+e.reduce((r,i)=>r+(i.isAdult?i.value:0),0),0)),childrenCount:Xt(()=>C(this,N).rooms.reduce((t,e)=>t+e.reduce((r,i)=>r+(i.isAdult?0:i.value),0),0)),isAvailable:Xt(()=>{if(!C(this,N).availabilities)return!1;let{categoryId:t}=C(this,N).cmsApartmentData,e=C(this,N).availabilities.CategoryAvailabilities.find(r=>r.CategoryId===t);return e?e.Availabilities.slice(0,-1).every(r=>r>0):!1}),productsTotalPrice:Xt(()=>C(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*C(this,Ie).nightsCount.value||0;break;case"PerPersonPerTimeUnit":i=r.price*C(this,Ie).nightsCount.value*C(this,Ie).adultsCount.value||0;break;default:i=r.price}return e+i},0)),totalPrice:Xt(()=>C(this,Ie).totalStayPrice.value+C(this,Ie).productsTotalPrice.value),restrictionMessage:Xt(()=>{if(!C(this,N).availabilities)return null;let t=C(this,N).availabilities.ApplicableRestrictions??[];if(t.length===0)return null;let e=C(this,Ie).nightsCount.value;if(e<1)return`1 ${Pe("minimumNights")}`;let r=i=>{if(!i)return null;try{return xe.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} ${Pe("minimumNights")}`;let l=r(o.MaxLength);if(l!==null&&e>l)return`${l} ${Pe("maximumNights")}`}return null})})}get startDate(){return C(this,N).startDate}get endDate(){return C(this,N).endDate}get rooms(){return C(this,N).rooms}get couponCode(){return C(this,N).couponCode}get hotel(){return C(this,N).hotel}get availabilities(){return C(this,N).availabilities}get rates(){return C(this,N).rates}get servicePricing(){return C(this,N).servicePricing}get reservationPricing(){return C(this,N).reservationPricing}get ageCategories(){return C(this,N).ageCategories}get products(){return C(this,N).products}get selectedRateId(){return C(this,N).selectedRateId}get be_pricing(){return C(this,N).be_pricing}get cmsApartmentData(){return C(this,N).cmsApartmentData}get enterpriseInstance(){return C(this,N).enterpriseInstance}get reservableService(){return C(this,N).reservableService}get isFetching(){return C(this,N).isFetching}get nightsCount(){return C(this,Ie).nightsCount.value}get selectedProducts(){return C(this,Ie).selectedProducts.value}get maxAllowedRooms(){return C(this,Ie).maxAllowedRooms.value}get computedRates(){return C(this,Ie).rates.value}get computedSummary(){return C(this,Ie).summary.value}get totalStayPrice(){return C(this,Ie).totalStayPrice.value}get adultsCount(){return C(this,Ie).adultsCount.value}get childrenCount(){return C(this,Ie).childrenCount.value}get isAvailable(){return C(this,Ie).isAvailable.value}get productsTotalPrice(){return C(this,Ie).productsTotalPrice.value}get totalPrice(){return C(this,Ie).totalPrice.value}get restrictionMessage(){return C(this,Ie).restrictionMessage.value}setCmsApartmentData(t){C(this,N).cmsApartmentData=t,$n(this,Dn,or).call(this)}updateStartDate(t){C(this,N).startDate=t,t&&(Yt.startDate=t.toString()),$n(this,Dn,or).call(this)}updateEndDate(t){C(this,N).endDate=t,t&&(Yt.endDate=t.toString()),$n(this,Dn,or).call(this)}updateRooms(t){C(this,N).rooms=t,$n(this,Dn,or).call(this)}updateCouponCode(t){C(this,N).couponCode=t,$n(this,Dn,or).call(this)}updateSelectedRateId(t){C(this,N).selectedRateId=t,$n(this,Dn,or).call(this)}updateProducts(t){C(this,N).products=t,$n(this,Dn,or).call(this)}async initializeResources(t){C(this,N).loading=!0,C(this,N).error=null;try{C(this,N).enterpriseInstance=new ni(t),await C(this,N).enterpriseInstance.initServices(),C(this,N).reservableService=C(this,N).enterpriseInstance.reservableService,await C(this,N).reservableService?.initAgeCategories(),C(this,N).ageCategories=C(this,N).reservableService?.getAgeCategories()||[]}catch(e){let r=e instanceof Error?e.message:"Unknown error";throw C(this,N).error=r,console.error("[BXT] initializeResources: Error",e),e}finally{C(this,N).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,N).ageCategories.map(a=>{let s=a.classification.toLowerCase()==="adult",l=s?Pe("adults"):Pe("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,N).rooms=r}async fetchHotel(t){C(this,N).loading=!0,C(this,N).error=null,C(this,N).isFetching=!0;try{let e=await od(t);C(this,N).hotel=e,C(this,N).products=e?.Products.map(r=>({id:r.Id,name:Xe(r.Name),description:Xe(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,N).error=r,console.error("[BXT] fetchHotel: Error",e),e}finally{C(this,N).loading=!1,C(this,N).isFetching=!1}}async fetchAvailability(t,e){if(!C(this,N).startDate||!C(this,N).endDate){console.warn("[BXT] fetchAvailability: Start date or end date is not set, skipping");return}if(J.isBefore(C(this,N).startDate,C(this,N).endDate)){console.warn("[BXT] fetchAvailability: Invalid date range, skipping");return}C(this,N).loading=!0,C(this,N).isFetching=!0;try{let r=J.formatForAPI(C(this,N).startDate),i=J.formatForAPI(C(this,N).endDate),o=await ad(t,{EnterpriseId:t,CategoryIds:[e],StartUtc:r,EndUtc:i,ServiceId:C(this,N).reservableService?.getService()?.id||"",Client:le.bookingEngineClient,LanguageCode:"fr-FR"});C(this,N).availabilities=o}catch(r){let i=r instanceof Error?r.message:"Unknown error";throw C(this,N).error=i,console.error("[BXT] fetchAvailability: Error",r),r}finally{C(this,N).loading=!1,C(this,N).isFetching=!1}}async fetchServicePricing(t,e){if(!C(this,N).startDate||!C(this,N).endDate){console.warn("[BXT] fetchServicePricing: Start date or end date is not set, skipping");return}if(C(this,Ie).nightsCount.value<1){console.warn("[BXT] fetchServicePricing: Invalid date range (0 nights), skipping");return}C(this,N).loading=!0,C(this,N).isFetching=!0;try{let r=J.formatForAPI(C(this,N).startDate),i=J.formatForAPI(C(this,N).endDate),o=await sd(t,{Client:le.bookingEngineClient,EnterpriseId:t,StartUtc:r,EndUtc:i,ServiceId:C(this,N).reservableService?.getService()?.id||"",CategoryIds:[e],CurrencyCode:"EUR",voucherCode:C(this,N).couponCode||void 0});C(this,N).servicePricing=o}catch(r){let i=r instanceof Error?r.message:"Unknown error";throw C(this,N).error=i,console.error("[BXT] fetchServicePricing: Error",r),r}finally{C(this,N).loading=!1,C(this,N).isFetching=!1}}async fetchReservationPricing(t,e){if(!C(this,N).startDate||!C(this,N).endDate){console.warn("[BXT] fetchReservationPricing: Start date or end date is not set, skipping");return}if(C(this,Ie).nightsCount.value<1){console.warn("[BXT] fetchReservationPricing: Invalid date range (0 nights), skipping");return}if(C(this,N).rooms.length===0){console.error("[BXT] fetchReservationPricing: No rooms set, skipping");return}C(this,N).loading=!0,C(this,N).isFetching=!0;try{let r=J.formatForAPI(C(this,N).startDate),i=J.formatForAPI(C(this,N).endDate),o=C(this,N).rooms.map(h=>({OccupancyData:h.filter(p=>p.value>0).map(p=>({AgeCategoryId:p.ageCategoryId,PersonCount:p.value}))})),a=C(this,Ie).selectedProducts.value.map(h=>h.id),s={Client:le.bookingEngineClient,HotelId:t,StartUtc:r,EndUtc:i,RoomCategoryId:e,VoucherCode:C(this,N).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:[]})]),C(this,N).reservationPricing=l,C(this,N).serviceOnlyPricing=u,C(this,N).be_pricing=l,l}catch(r){let i=r instanceof Error?r.message:"Unknown error";throw C(this,N).error=i,console.error("[BXT] fetchReservationPricing: Error",r),r}finally{C(this,N).loading=!1,C(this,N).isFetching=!1}}async fetchRates(t){if(!C(this,N).reservableService||!C(this,N).reservableService.getService()){console.warn("[BXT] fetchRates: No reservable service found, skipping");return}C(this,N).loading=!0;try{let e=C(this,N).reservableService.getService()?.id;C(this,N).rates=await fa(t,e)}catch(e){let r=e instanceof Error?e.message:"Unknown error";throw C(this,N).error=r,console.error("[BXT] fetchRates: Error",e),e}finally{C(this,N).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 Qr({...C(this,N),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,N);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}}}};N=new WeakMap,Ie=new WeakMap,Dn=new WeakSet,or=function(){C(this,N).isFetching};var B=new Ic;var xd=()=>{};function lt(n,t,e,r){return n?(n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)):xd}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 ut=(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 xc=(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 Ad(n,t){return{rate:n,pricing:t}}function Ac(n){return n.isActive&&n.isEnabled&&n.isPublic&&!n.hideFromGuest}function Ld(n,t){let e=t.filter(o=>Wm(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=>Gm(n,o.Exceptions)))}function Wm(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 xe.Duration.from(n).total({unit:"days"})}catch{return null}}function Gm(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 Nd=(n,t)=>{let e=n.find(s=>s.rate.isBaseRate),r=n.filter(s=>!Ld(s,t)&&Ac(s.rate)),i=Object.groupBy(r,s=>s.rate.group?.Name||"unknown"),o=gd(r),a=Km(o);return{baseRate:e,allowedRates:r,groupedRates:i,datedPrices:o,lowestDatedPrices:a}};function Km(n){let t={};for(let[e,r]of Object.entries(n)){let i=1/0,o=r.filter(a=>Ac(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 Od=async n=>{let t=await Promise.all(n.map(async r=>{let i=new ni(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(bc.toString()),J.formatForAPI(td.toString()));return Ad(u.getRate(),h)}));return Nd(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 et=class et extends Date{constructor(e=null,r="YYYY-MM-DD",i="en-US"){super(et.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 et)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=et.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:w}=et.formatPatterns(h[0],i);s[y]=p+1,s.value+=w,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=et.shortMonths(i).indexOf(u[s.shortMonth]):s.longMonth&&(p=et.longMonths(i).indexOf(u[s.longMonth]));let y=Number(u[s.day])||1,w=Number(u[s.hour]),T=Number.isNaN(w)?0:w,S=Number(u[s.minute]),x=Number.isNaN(S)?0:S,$=Number(u[s.second]),W=Number.isNaN($)?0:$,K=u[s.ampm];return K&&K==="PM"&&(T+=12,T===24&&(T=0)),new Date(h,p,y,T,x,W,0)}}}return new Date(new Date().setHours(0,0,0,0))}static shortMonths(e){return et.MONTH_JS.map(r=>new Date(2019,r).toLocaleString(e,{month:"short"}))}static longMonths(e){return et.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:`(${et.shortMonths(r).join("|")})`};case"MMMM":return{group:"longMonth",pattern:`(${et.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 et(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=et.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 et.shortMonths(r)[this.getMonth()];case"MMMM":return et.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(et,"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(et,"MONTH_JS",[0,1,2,3,4,5,6,7,8,9,10,11]);var ge=et,Lc=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}},Nc=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 Lc(this));L(this,"PluginManager",new Nc(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"),w=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&&w.isBefore(new ge(this.lockPlugin.options.minDate),"year")||this.lockPlugin.options.maxDate&&w.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 dt=function(n,t){return t===void 0&&(t=2),("000"+n).slice(t*-1)},$t=function(n){return n===!0?1:0};function Oc(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 ht(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 Hc(n,t){if(t(n))return n;if(n.parentNode)return Hc(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 Bc=function(){},vo=function(n,t,e){return e.months[t?"shorthand":"longhand"][n]},Hd={D:Bc,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:Bc,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:Bc,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})"},ri={Z:function(n){return n.toISOString()},D:function(n,t,e){return t.weekdays.shorthand[ri.w(n,t,e)]},F:function(n,t,e){return vo(ri.n(n,t,e)-1,!1,t)},G:function(n,t,e){return dt(ri.h(n,t,e))},H:function(n){return dt(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 dt(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,t,e){return e.getWeek(n)},Y:function(n){return dt(n.getFullYear(),4)},d:function(n){return dt(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return dt(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,t){return t.weekdays.longhand[n.getDay()]},m:function(n){return dt(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 Fc=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,w){return ri[p]&&w[y-1]!=="\\"?ri[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,w=String(o).trim();if(w==="today")h=new Date,s=!0;else if(e&&e.parseDate)h=e.parseDate(o,y);else if(/Z$/.test(w)||/GMT$/.test(w))h=new Date(o);else{for(var T=void 0,S=[],x=0,$=0,W="";x<y.length;x++){var K=y[x],ee=K==="\\",oe=y[x-1]==="\\"||ee;if(Fn[K]&&!oe){W+=Fn[K];var ae=new RegExp(W).exec(o);ae&&(T=!0)&&S[K!=="Y"?"push":"unshift"]({fn:Hd[K],val:ae[++$]})}else ee||(W+=".")}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,ce=Ce.val;return h=Te(h,ce,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 Bd=function(n,t,e){return n>Math.min(t,e)&&n<Math.max(t,e)},Ia=function(n,t,e){return n*3600+t*60+e},Fd=function(n){var t=Math.floor(n/3600),e=(n-t*3600)/60;return[t,e,n-t*3600-e*60]},Yd={DAY:864e5};function Ra(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 mt=function(){return mt=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},mt.apply(this,arguments)},$d=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},Zm=300;function Jm(n,t){var e={config:mt(mt({},ar),We.defaultConfig),l10n:Ca};e.parseDate=Pa({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=ae,e.destroy=j,e.isEnabled=Z,e.jumpToDate=W,e.updateValue=En,e.open=He,e.redraw=wo,e.set=Kd,e.setDate=Zd,e.toggle=eh;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(),Xd(),Jd(),r(),e.isMobile||oe(),$(),(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=Ra(e.config);b.setHours(M.hours,M.minutes,M.seconds,b.getMilliseconds()),e.selectedDates=[b],e.latestSelectedDateObj=b}f!==void 0&&f.type!=="blur"&&rh(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=Ia(e.config.minTime.getHours(),e.config.minTime.getMinutes(),e.config.minTime.getSeconds()),ye=Ia(e.config.maxTime.getHours(),e.config.maxTime.getMinutes(),e.config.maxTime.getSeconds()),ne=Ia(f,b,M);if(ne>ye&&ne<Q){var De=Fd(Q);f=De[0],b=De[1],M=De[2]}}else{if(q){var te=e.config.maxTime!==void 0?e.config.maxTime:e.config.maxDate;f=Math.min(f,te.getHours()),f===te.getHours()&&(b=Math.min(b,te.getMinutes())),b===te.getMinutes()&&(M=Math.min(M,te.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()))}}w(f,b,M)}}function y(f){var b=f||e.latestSelectedDateObj;b&&b instanceof Date&&w(b.getHours(),b.getMinutes(),b.getSeconds())}function w(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=dt(e.config.time_24hr?f:(12+f)%12+12*$t(f%12===0)),e.minuteElement.value=dt(b),e.amPM!==void 0&&(e.amPM.textContent=e.l10n.amPM[$t(f>=12)]),e.secondElement!==void 0&&(e.secondElement.value=dt(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 x(){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 S(A,"click",e[M])})}),e.isMobile){Qd();return}var f=Oc(_e,50);if(e._debouncedChange=Oc(x,Zm),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",nh),S(e.monthNav,["keyup","increment"],T),S(e.daysContainer,"click",jc)),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",K),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 W(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"),se()),b&&(e.currentYear!==A||e.currentMonth!==q)&&Fe("onMonthChange"),e.redraw()}function K(f){var b=jt(f);~b.className.indexOf("arrow")&&ee(f,b.classList.contains("arrowUp")?1:-1)}function ee(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 oe(){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=D(),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()),ht(e.calendarContainer,"rangeMode",e.config.mode==="range"),ht(e.calendarContainer,"animate",e.config.animate===!0),ht(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 ae(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"&&(ht(Q,"startRange",e.selectedDates[0]&&zt(b,e.selectedDates[0],!0)===0),ht(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"&&th(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,ne=Q;ne!=ye;ne+=f){var De=q.children[ne];if(De.className.indexOf("hidden")===-1&&Z(De.dateObj))return De}}function ce(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],ne=M-e.currentMonth===Q?f.$i+b:b<0?ye.children.length-1:0,De=ye.children.length,te=ne;te>=0&&te<De&&te!=(b>0?De:-1);te+=q){var de=ye.children[te];if(de.className.indexOf("hidden")===-1&&Z(de.dateObj)&&Math.abs(f.$i-te)>=Math.abs(b))return Ce(de)}e.changeMonth(q),F(Te(q),0)}function F(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?ce(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,ne=ye?"prevMonthDay hidden":"prevMonthDay",De=ye?"nextMonthDay hidden":"nextMonthDay",te=A+1-M,de=0;te<=A;te++,de++)Q.appendChild(ae("flatpickr-day "+ne,new Date(f,b-1,te),te,de));for(te=1;te<=q;te++,de++)Q.appendChild(ae("flatpickr-day",new Date(f,b,te),te,de));for(var Ae=q+1;Ae<=42-M&&(e.config.showMonths===1||de%7!==0);Ae++,de++)Q.appendChild(ae("flatpickr-day "+De,new Date(f,b+1,Ae%q),Ae,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 se(){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 ne=jt(ye),De=parseInt(ne.value,10);e.changeMonth(De-e.currentMonth),Fe("onMonthChange")}),se(),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&&(ht(e.prevMonthNav,"flatpickr-disabled",f),e.__hidePrevMonthArrow=f)}}),Object.defineProperty(e,"_hideNextMonthArrow",{get:function(){return e.__hideNextMonthArrow},set:function(f){e.__hideNextMonthArrow!==f&&(ht(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=Ra(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=dt(e.latestSelectedDateObj?e.latestSelectedDateObj.getHours():e.config.time_24hr?f.hours:h(f.hours)),e.minuteElement.value=dt(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=dt(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=$d(e.l10n.weekdays.shorthand);f>0&&f<b.length&&(b=$d(b.splice(f,b.length),b.splice(0,f)));for(var M=e.config.showMonths;M--;)e.weekdayContainer.children[M].innerHTML=`
1
+ var ph=Object.create;var Ua=Object.defineProperty;var fh=Object.getOwnPropertyDescriptor;var gh=Object.getOwnPropertyNames;var yh=Object.getPrototypeOf,vh=Object.prototype.hasOwnProperty;var bh=(n,t,e)=>t in n?Ua(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var qc=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var wh=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of gh(t))!vh.call(n,i)&&i!==e&&Ua(n,i,{get:()=>t[i],enumerable:!(r=fh(t,i))||r.enumerable});return n};var Wc=(n,t,e)=>(e=n!=null?ph(yh(n)):{},wh(t||!n||!n.__esModule?Ua(e,"default",{value:n,enumerable:!0}):e,n));var L=(n,t,e)=>(bh(n,typeof t!="symbol"?t+"":t,e),e),Gc=(n,t,e)=>{if(!t.has(n))throw TypeError("Cannot "+e)};var C=(n,t,e)=>(Gc(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 jn=(n,t,e)=>(Gc(n,t,"access private method"),e);var Kc=qc((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(F,z){(z==null||z>F.length)&&(z=F.length);for(var Y=0,se=Array(z);Y<z;Y++)se[Y]=F[Y];return se}function r(F){if(Array.isArray(F))return F}function i(F){if(F===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return F}function o(F,z,Y){return z=p(z),$(F,S()?Reflect.construct(z,Y||[],p(F).constructor):z.apply(F,Y))}function a(F,z){if(!(F instanceof z))throw new TypeError("Cannot call a class as a function")}function s(F,z,Y){if(S())return Reflect.construct.apply(null,arguments);var se=[null];se.push.apply(se,z);var g=new(F.bind.apply(F,se));return Y&&W(g,Y.prototype),g}function l(F,z){for(var Y,se=0;se<z.length;se++)Y=z[se],Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(F,oe(Y.key),Y)}function u(F,z,Y){return z&&l(F.prototype,z),Y&&l(F,Y),Object.defineProperty(F,"prototype",{writable:!1}),F}function h(F,z){var Y=typeof Symbol<"u"&&F[Symbol.iterator]||F["@@iterator"];if(!Y){if(Array.isArray(F)||(Y=Ce(F))||z&&F&&typeof F.length=="number"){Y&&(F=Y);var se=0,g=function(){};return{s:g,n:function(){return se>=F.length?{done:!0}:{done:!1,value:F[se++]}},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(F)},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(F){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(z){return z.__proto__||Object.getPrototypeOf(z)},p(F)}function y(F,z){if(typeof z!="function"&&z!==null)throw new TypeError("Super expression must either be null or a function");F.prototype=Object.create(z&&z.prototype,{constructor:{value:F,writable:!0,configurable:!0}}),Object.defineProperty(F,"prototype",{writable:!1}),z&&W(F,z)}function w(F){try{return Function.toString.call(F).indexOf("[native code]")!==-1}catch{return typeof F=="function"}}function S(){try{var F=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(S=function(){return!!F})()}function T(F,z){var Y=F==null?null:typeof Symbol<"u"&&F[Symbol.iterator]||F["@@iterator"];if(Y!=null){var se,g,H,c,d=[],v=!0,E=!1;try{if(H=(Y=Y.call(F)).next,z===0){if(Object(Y)!==Y)return;v=!1}else for(;!(v=(se=H.call(Y)).done)&&(d.push(se.value),d.length!==z);v=!0);}catch(D){E=!0,g=D}finally{try{if(!v&&Y.return!=null&&(c=Y.return(),Object(c)!==c))return}finally{if(E)throw g}}return d}}function x(){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 $(F,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(F)}function W(F,z){return W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Y,se){return Y.__proto__=se,Y},W(F,z)}function K(F,z){return r(F)||T(F,z)||Ce(F,z)||x()}function ee(F,z){if(typeof F!="object"||!F)return F;var Y=F[Symbol.toPrimitive];if(Y!==void 0){var se=Y.call(F,z||"default");if(typeof se!="object")return se;throw new TypeError("@@toPrimitive must return a primitive value.")}return(z==="string"?String:Number)(F)}function oe(F){var z=ee(F,"string");return typeof z=="symbol"?z:z+""}function ae(F){"@babel/helpers - typeof";return ae=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},ae(F)}function Ce(F,z){if(F){if(typeof F=="string")return e(F,z);var Y={}.toString.call(F).slice(8,-1);return Y==="Object"&&F.constructor&&(Y=F.constructor.name),Y==="Map"||Y==="Set"?Array.from(F):Y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Y)?e(F,z):void 0}}function Se(F){var z=typeof Map=="function"?new Map:void 0;return Se=function(Y){function se(){return s(Y,arguments,p(this).constructor)}if(Y===null||!w(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,se)}return se.prototype=Object.create(Y.prototype,{constructor:{value:se,enumerable:!1,writable:!0,configurable:!0}}),W(se,Y)},Se(F)}var ce=function(F){var z=Math.abs,Y=Math.max,se=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,F),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(D){v.e(D)}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,D=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,D),V=g.__imul(X,E),ue=g.__imul(X,D),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,D=0,_=0;_<v;_++)E=this.__halfDigit(d+_)+c.__halfDigit(_)+D,D=E>>>15,this.__setHalfDigit(d+_,32767&E);return D}},{key:"__inplaceSub",value:function(c,d,v){var E=v-1>>>1,D=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)-D;D=1&O>>>15,this.__setDigit(d+P,(32767&O)<<15|32767&I),_=this.__digit(d+P+1),I=(32767&_)-(j>>>15)-D,D=1&I>>>15}var X=c.__digit(P),re=(_>>>15)-(32767&X)-D;D=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-D,D=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)-D;D=1&we>>>15;var _e=(ue>>>15)-(pe>>>15)-D;D=1&_e>>>15,this.__setDigit(d+V,(32767&_e)<<15|32767&we)}var He=this.__digit(d+V),Ve=c.__digit(V),ot=(32767&He)-(32767&Ve)-D;D=1&ot>>>15;var Qt=0;!(1&v)&&(Qt=(He>>>15)-(Ve>>>15)-D,D=1&Qt>>>15),this.__setDigit(d+V,(32767&Qt)<<15|32767&ot)}return D}},{key:"__inplaceRightShift",value:function(c){if(c!==0){for(var d,v=this.__digit(0)>>>c,E=this.length-1,D=0;D<E;D++)d=this.__digit(D+1),this.__setDigit(D,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),D=1&c?32767&E|d<<15:1073709056&E|32767&d;this.__setDigit(v,D)}}],[{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)||se(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(ae(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),D=g.__clz30(E),_=30*d-D;if(1024<_)return c.sign?-1/0:1/0;var I=_-1,P=E,j=d-1,O=D+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),D=c.sign&&(1&v)!=0,_=new g(E,D);_.__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 D=0;D<c.length;D++)g.__multiplyAccumulate(d,c.__digit(D),E,D);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,D=d.__unsignedDigit(0);if(d.length===1&&32767>=D){if(D===1)return E===c.sign?c:g.unaryMinus(c);v=g.__absoluteDivSmall(c,D,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 D=g.__absoluteDivLarge(c,d,!1,!0);return D.sign=c.sign,D.__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),D=g.__absoluteSubOne(d);return E=g.__absoluteOr(E,D,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),D=g.__absoluteSubOne(d);return g.__absoluteXor(E,D,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),D=g.__absoluteSubOne(d);return E=g.__absoluteAnd(E,D,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=se(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),D=1<<(c-1)%30;if(d.length===v&&E<D)return d;var _=(E&D)===D;if(!_)return g.__truncateToNBits(c,d);if(!d.sign)return g.__truncateAndSubFromPowerOfTwo(c,d,!0);if(!(E&D-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===D?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=se(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 D=d.__digit(v-1);if(!(D>>>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(ae(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(ae(d)!=="object")return c==d;d=g.__toPrimitive(d)}else if(typeof c=="boolean"){if(g.__isBigInt(d))return g.__equalToNumber(d,+c);if(ae(d)!=="object")return c==d;d=g.__toPrimitive(d)}else if(ae(c)==="symbol"){if(g.__isBigInt(d))return!1;if(ae(d)!=="object")return c==d;d=g.__toPrimitive(d)}else if(ae(c)==="object"){if(ae(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],D=K(E,2),_=D[0],I=D[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 D=0,_=0;if(0<v.length&&(_=v.__digit(0),1<v.length)){var I=v.__digit(1);_|=I<<30,D=I>>>2,2<v.length&&(D|=v.__digit(2)<<28)}var P=E?[4,0]:[0,4],j=K(P,2),O=j[0],X=j[1];c.setUint32(d+O,D,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 D;if(0>d)D=-d-1;else{if(v===0)return-1;v--,E=c.__digit(v),D=29}var _=1<<D;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,D=E-1023,_=(0|D/30)+1,I=new g(_,d),P=1048576,j=1048575&g.__kBitConversionInts[g.__kBitConversionIntHigh]|P,O=g.__kBitConversionInts[g.__kBitConversionIntLow],X=20,re=D%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,D=0;if(D===E)return g.__zero();for(var _=c.charCodeAt(D);g.__isWhitespace(_);){if(++D===E)return g.__zero();_=c.charCodeAt(D)}if(_===43){if(++D===E)return null;_=c.charCodeAt(D),v=1}else if(_===45){if(++D===E)return null;_=c.charCodeAt(D),v=-1}if(d===0){if(d=10,_===48){if(++D===E)return g.__zero();if(_=c.charCodeAt(D),_===88||_===120){if(d=16,++D===E)return null;_=c.charCodeAt(D)}else if(_===79||_===111){if(d=8,++D===E)return null;_=c.charCodeAt(D)}else if(_===66||_===98){if(d=2,++D===E)return null;_=c.charCodeAt(D)}}}else if(d===16&&_===48){if(++D===E)return g.__zero();if(_=c.charCodeAt(D),_===88||_===120){if(++D===E)return null;_=c.charCodeAt(D)}}if(v!==0&&d!==10)return null;for(;_===48;){if(++D===E)return g.__zero();_=c.charCodeAt(D)}var I=E-D,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,Qt=0;do{for(var cr,$n=0,oi=1;;){if(cr=void 0,_-48>>>0<Z)cr=_-48;else if((32|_)-97>>>0<V)cr=(32|_)-87;else{ot=!0;break}var bo=oi*d;if(1073741823<bo)break;if(oi=bo,$n=$n*d+cr,Qt++,++D===E){ot=!0;break}_=c.charCodeAt(D)}j=30*g.__kBitsPerCharTableMultiplier-1;var wo=0|(P*Qt+j>>>g.__kBitsPerCharTableShift)/30;re.__inplaceMultiplyAdd(oi,$n,wo)}while(!ot)}else{P>>=g.__kBitsPerCharTableShift;var ue=[],pe=[],we=!1;do{for(var _e,He=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,He=He<<P|_e,++D===E){we=!0;break}if(_=c.charCodeAt(D),30<Ve+P)break}ue.push(He),pe.push(Ve)}while(!we);g.__fillFromParts(re,ue,pe)}if(D!==E){if(!g.__isWhitespace(_))return null;for(D++;D<E;D++)if(_=c.charCodeAt(D),!g.__isWhitespace(_))return null}return re.sign=v===-1,re.__trim()}},{key:"__fillFromParts",value:function(c,d,v){for(var E=0,D=0,_=0,I=d.length-1;0<=I;I--){var P=d[I],j=v[I];D|=P<<_,_+=j,_===30?(c.__setDigit(E++,D),_=0,D=0):30<_&&(c.__setDigit(E++,1073741823&D),_-=30,D=P>>>j-_)}if(D!==0){if(E>=c.length)throw new Error("implementation bug");c.__setDigit(E++,D)}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 D=E,_=d-1,I=c.__digit(v-1),P=g.__clz30(I),j=30*v-P,O=0|(j+D-1)/D;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=D-V;for(Z=pe>>>_e,V=30-_e;V>=D;)X[re--]=g.__kConversionChars[Z&_],Z>>>=D,V-=D}var He=(Z|I<<V)&_;for(X[re--]=g.__kConversionChars[He],Z=I>>>D-V;Z!==0;)X[re--]=g.__kConversionChars[Z&_],Z>>>=D;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 D=c.__unsignedDigit(0).toString(d);return v===!1&&c.sign&&(D="-"+D),D}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 He=_e.remainder.__trim();X=g.__toStringGeneric(He,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 D=z(d),_=c.__unsignedDigit(0);return _>D?g.__absoluteGreater(v):_<D?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 D=2047&g.__kBitConversionInts[g.__kBitConversionIntHigh]>>>20;if(D==2047)throw new Error("implementation bug: handled elsewhere");var _=D-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 He=ue-pe;_e=He+32,we=Z>>>He,Z=Z<<32-He|V>>>He,V<<=32-He}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 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 D,_=new g(E,v),I=0,P=0;P<d.length;P++)D=c.__digit(P)+d.__digit(P)+I,I=D>>>30,_.__setDigit(P,1073741823&D);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,D=new g(c.length,v),_=0,I=0;I<d.length;I++)E=c.__digit(I)-d.__digit(I)-_,_=1&E>>>30,D.__setDigit(I,1073741823&E);for(;I<c.length;I++){var P=c.__digit(I)-_;_=1&P>>>30,D.__setDigit(I,1073741823&P)}return D.__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 D,_=1,I=0;I<E;I++)D=c.__digit(I)+_,_=D>>>30,v.__setDigit(I,1073741823&D);return _!==0&&v.__setDigitGrow(E,1),v}},{key:"__absoluteSubOne",value:function(c,d){var v=c.length;d=d||v;for(var E,D=new g(d,!1),_=1,I=0;I<v;I++)E=c.__digit(I)-_,_=1&E>>>30,D.__setDigit(I,1073741823&E);if(_!==0)throw new Error("implementation bug");for(var P=v;P<d;P++)D.__setDigit(P,0);return D}},{key:"__absoluteAnd",value:function(c,d){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,E=c.length,D=d.length,_=D;if(E<D){_=E;var I=c,P=E;c=d,E=D,d=I,D=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,D=d.length,_=D;E<D&&(_=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,D=d.length,_=D;if(E<D){_=E;var I=c,P=E;c=d,E=D,d=I,D=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,D=d.length,_=D;if(E<D){_=E;var I=c,P=E;c=d,E=D,d=I,D=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 D=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,D),ue=g.__imul(re,_),pe=g.__imul(Z,D),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,D){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,D.__setDigit(P,1073741823&re)}if(D.length>E)for(D.__setDigit(E++,_+I);E<D.length;)D.__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,D=2*c.length-1;0<=D;D-=2){var _=(E<<15|c.__halfDigit(D))>>>0,I=0|_/d;E=0|_%d,_=(E<<15|c.__halfDigit(D-1))>>>0;var P=0|_/d;E=0|_%d,v.__setDigit(D>>>1,I<<15|P)}return v}},{key:"__absoluteModSmall",value:function(c,d){for(var v,E=0,D=2*c.length-1;0<=D;D--)v=(E<<15|c.__halfDigit(D))>>>0,E=0|v%d;return E}},{key:"__absoluteDivLarge",value:function(c,d,v,E){var D=d.__halfDigitLength(),_=d.length,I=c.__halfDigitLength()-D,P=null;v&&(P=new g(I+2>>>1,!1),P.__initializeDigits());var j=new g(D+2>>>1,!1);j.__initializeDigits();var O=g.__clz15(d.__halfDigit(D-1));0<O&&(d=g.__specialLeftShift(d,O,0));for(var X=g.__specialLeftShift(c,O,1),re=d.__halfDigit(D-1),Z=0,V=I;0<=V;V--){var ue=32767,pe=X.__halfDigit(V+D);if(pe!==re){var we=(pe<<15|X.__halfDigit(V+D-1))>>>0;ue=0|we/re;for(var _e=0|we%re,He=d.__halfDigit(D-2),Ve=X.__halfDigit(V+D-2);g.__imul(ue,He)>>>0>(_e<<16|Ve)>>>0&&(ue--,_e+=re,!(32767<_e)););}g.__internalMultiplyAdd(d,ue,0,_,j);var ot=X.__inplaceSub(j,V,D+1);ot!==0&&(ot=X.__inplaceAdd(d,V,D),X.__setHalfDigit(V+D,32767&X.__halfDigit(V+D)+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,D=E+v,_=new g(D,!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,D=v%30,_=c.length,I=D!==0&&c.__digit(_-1)>>>30-D!=0,P=_+E+(I?1:0),j=new g(P,c.sign);if(D===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<<D|X),X=Z>>>30-D;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,D=g.__toShiftAmount(d);if(0>D)return g.__rightShiftByMaximum(E);var _=0|D/30,I=D%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,He=0;He<_e;He++)pe=c.__digit(He+_+1),V.__setDigit(He,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(ae(c)!=="object"||c.constructor===g)return c;if(typeof Symbol<"u"&&ae(Symbol.toPrimitive)==="symbol"&&c[Symbol.toPrimitive]){var v=c[Symbol.toPrimitive](d);if(ae(v)!=="object")return v;throw new TypeError("Cannot convert object to primitive value")}var E=c.valueOf;if(E){var D=E.call(c);if(ae(D)!=="object")return D}var _=c.toString;if(_){var I=_.call(c);if(ae(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 ae(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),D=v-1,_=0;_<D;_++)E.__setDigit(_,d.__digit(_));var I=d.__digit(D);if(c%30!=0){var P=32-c%30;I=I<<P>>>P}return E.__setDigit(D,I),E.__trim()}},{key:"__truncateAndSubFromPowerOfTwo",value:function(c,d,v){for(var E=Math.min,D,_=0|(c+29)/30,I=new g(_,v),P=0,j=_-1,O=0,X=E(j,d.length);P<X;P++)D=0-d.__digit(P)-O,O=1&D>>>30,I.__setDigit(P,1073741823&D);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}}])}(Se(Array));return ce.__kMaxLength=33554432,ce.__kMaxLengthBits=ce.__kMaxLength<<5,ce.__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],ce.__kBitsPerCharTableShift=5,ce.__kBitsPerCharTableMultiplier=1<<ce.__kBitsPerCharTableShift,ce.__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"],ce.__kBitConversionBuffer=new ArrayBuffer(8),ce.__kBitConversionDouble=new Float64Array(ce.__kBitConversionBuffer),ce.__kBitConversionInts=new Int32Array(ce.__kBitConversionBuffer),ce.__kBitConversionIntHigh=ce.__detectBigEndian()?0:1,ce.__kBitConversionIntLow=ce.__detectBigEndian()?1:0,ce.__clz30=t?function(F){return t(F)-2}:function(F){var z=Math.LN2,Y=Math.log;return F===0?30:0|29-(0|Y(F>>>0)/z)},ce.__imul=n||function(F,z){return 0|F*z},ce})});var Gu=qc((Dp,Wu)=>{Wu.exports=Am;function Am(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=Wc(Kc(),1),Wt=k.default.BigInt(0),Mi=k.default.BigInt(1),Bs=k.default.BigInt(2),Dh=k.default.BigInt(10),Eh=k.default.BigInt(24),_h=k.default.BigInt(60),Mh=k.default.BigInt(1e3),ji=k.default.BigInt(1e6),vi=k.default.BigInt(1e9),Il=k.default.multiply(k.default.BigInt(3600),vi),Sh=k.default.multiply(_h,vi),Gn=k.default.multiply(Il,Eh);function Sn(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 lr(n){return k.default.lessThan(n,Wt)?k.default.unaryMinus(n):n}function To(n,t){return k.default.lessThan(n,t)?-1:k.default.greaterThan(n,t)?1:0}function ui(n,t){return{quotient:k.default.divide(n,t),remainder:k.default.remainder(n,t)}}var Zc,Jc,he="slot-epochNanoSeconds",me="slot-iso-date",Be="slot-iso-date-time",je="slot-time",U="slot-calendar",xl="slot-date-brand",Al="slot-year-month-brand",Ll="slot-month-day-brand",ke="slot-time-zone",yt="slot-years",vt="slot-months",At="slot-weeks",bt="slot-days",wt="slot-hours",Dt="slot-minutes",Et="slot-seconds",_t="slot-milliseconds",Mt="slot-microseconds",Lt="slot-nanoseconds",Nl="date",Ol="ym",Hl="md",Bl="time",Fl="datetime",Yl="instant",wr="original",Rr="timezone-canonical",Xa="timezone-original",di="calendar-id",$l="locale",Qa="options",jl=new WeakMap,es=Symbol.for("@@Temporal__GetSlots");(Zc=globalThis)[es]||(Zc[es]=function(n){return jl.get(n)});var jo=globalThis[es],ts=Symbol.for("@@Temporal__CreateSlots");(Jc=globalThis)[ts]||(Jc[ts]=function(n){jl.set(n,Object.create(null))});var On=globalThis[ts];function Pt(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 Hn(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 it(n){return ns[n]}function Ar(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 Re=class n{constructor(t){this.totalNs=Sn(t),this.sec=k.default.toNumber(k.default.divide(this.totalNs,vi)),this.subsec=k.default.toNumber(k.default.remainder(this.totalNs,vi))}static validateNew(t,e){if(k.default.greaterThan(lr(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(Sn(t),Sn(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),Mh)),k.default.multiply(k.default.BigInt(i),ji)),k.default.multiply(k.default.BigInt(r),vi)),k.default.multiply(k.default.BigInt(e),Sh)),k.default.multiply(k.default.BigInt(t),Il));return n.validateNew(s,"total")}abs(){return new n(lr(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),Gn)),"sum")}addToEpochNs(t){return k.default.add(Sn(t),this.totalNs)}cmp(t){return To(this.totalNs,t.totalNs)}divmod(t){let{quotient:e,remainder:r}=ui(this.totalNs,k.default.BigInt(t));return{quotient:k.default.toNumber(e),remainder:new n(r)}}fdiv(t){let e=Sn(t),r=k.default.BigInt(e),{quotient:i,remainder:o}=ui(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,Dh),{quotient:s,remainder:o}=ui(o,r),a.push(Math.abs(k.default.toNumber(s)));return l*+(lr(i).toString()+"."+a.join(""))}isZero(){return k.default.equal(this.totalNs,Wt)}round(t,e){let r=Sn(t);if(k.default.equal(r,Mi))return this;let{quotient:i,remainder:o}=ui(this.totalNs,r),a=k.default.lessThan(this.totalNs,Wt)?"negative":"positive",s=k.default.multiply(lr(i),r),l=k.default.add(s,r),u=To(lr(k.default.multiply(o,Bs)),r),h=zo(e,a),p=k.default.equal(lr(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")}};Re.MAX=k.default.BigInt("9007199254740991999999999"),Re.ZERO=new Re(Wt);var Xc=/[A-Za-z._][A-Za-z._0-9+-]*/,zi=new RegExp(`(?:${/(?:[+-](?:[01][0-9]|2[0-3])(?::?[0-5][0-9])?)/.source}|(?:${Xc.source})(?:\\/(?:${Xc.source}))*)`),zl=/(?:[+-]\d{6}|\d{4})/,Co=/(?:0[1-9]|1[0-2])/,is=/(?:0[1-9]|[12]\d|3[01])/,Th=new RegExp(`(${zl.source})(?:-(${Co.source})-(${is.source})|(${Co.source})(${is.source}))`),Ul=/(\d{2})(?::(\d{2})(?::(\d{2})(?:[.,](\d{1,9}))?)?|(\d{2})(?:(\d{2})(?:[.,](\d{1,9}))?)?)?/,Vl=/((?:[+-])(?:[01][0-9]|2[0-3])(?::?(?:[0-5][0-9])(?::?(?:[0-5][0-9])(?:[.,](?:\d{1,9}))?)?)?)/,ql=new RegExp(`([zZ])|${Vl.source}?`),Hr=/\[(!)?([a-z_][a-z0-9_-]*)=([A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)\]/g,Ch=new RegExp([`^${Th.source}`,`(?:(?:[tT]|\\s+)${Ul.source}(?:${ql.source})?)?`,`(?:\\[!?(${zi.source})\\])?`,`((?:${Hr.source})*)$`].join("")),kh=new RegExp([`^[tT]?${Ul.source}`,`(?:${ql.source})?`,`(?:\\[!?${zi.source}\\])?`,`((?:${Hr.source})*)$`].join("")),Ph=new RegExp(`^(${zl.source})-?(${Co.source})(?:\\[!?${zi.source}\\])?((?:${Hr.source})*)$`),Ih=new RegExp(`^(?:--)?(${Co.source})-?(${is.source})(?:\\[!?${zi.source}\\])?((?:${Hr.source})*)$`),Ga=/(\d+)(?:[.,](\d{1,9}))?/,Rh=new RegExp(`(?:${Ga.source}H)?(?:${Ga.source}M)?(?:${Ga.source}S)?`),xh=new RegExp(`^([+-])?P${/(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/.source}(?:T(?!$)${Rh.source})?$`,"i"),Kn=864e5,ko=1e6*Kn,Ah=6e10,Wl=1e8*Kn,Br=cn(Wl),Si=k.default.unaryMinus(Br),Lh=k.default.add(k.default.subtract(Si,Gn),Mi),Nh=k.default.subtract(k.default.add(Br,Gn),Mi),Oh=146097*Kn,Qc=-271821,el=275760,bi=Date.UTC(1847,0,1),Hh=["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"],Bh=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 tl(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"],Fh={era:qo,eraYear:fe,year:fe,month:tl,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:tl,hour:fe,minute:fe,second:fe,millisecond:fe,microsecond:fe,nanosecond:fe,offset:function(n){let t=Ge(os(n));return Wr(t),t},timeZone:Ct},Yh={hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},Fr=[["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"]],nl=Object.fromEntries(Fr.map(n=>[n[0],n[1]])),$h=Object.fromEntries(Fr.map(([n,t])=>[t,n])),wi=Fr.map(([,n])=>n),Yr={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"],jh=Intl.DateTimeFormat,rl=new Map;function Gl(n){let t=Ri(n),e=rl.get(t);return e===void 0&&(e=new jh("en-us",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),rl.set(t,e)),e}function tt(n){return Pt(n,he)&&!Pt(n,ke,U)}function Ye(n){return Pt(n,yt,vt,bt,wt,Dt,Et,_t,Mt,Lt)}function $e(n){return Pt(n,xl)}function Ue(n){return Pt(n,je)}function Ne(n){return Pt(n,Be)}function nt(n){return Pt(n,Al)}function qt(n){return Pt(n,Ll)}function be(n){return Pt(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 Ur(n){if(Pt(n,U)||Pt(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 Ui(n,t){return t==="never"||t==="auto"&&n==="iso8601"?"":`[${t==="critical"?"!":""}u-ca=${n}]`}function Wo(n){let t,e,r=!1;for(Hr.lastIndex=0;e=Hr.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=Ch.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),w=+p.slice(3,6),S=+p.slice(6,9),T,x=!1;t[13]?(T=void 0,x=!0):t[14]&&(T=t[14]);let $=t[15];return Us(i,o,a,l,u,h,y,w,S),{year:i,month:o,day:a,time:s?{hour:l,minute:u,second:h,millisecond:y,microsecond:w,nanosecond:S}:"start-of-day",tzAnnotation:$,offset:T,z:x,calendar:e}}function Kl(n){let t=kh.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);pr(1972,u,h)}catch{try{let{year:u,month:h}=Fs(n);pr(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=Ph.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=Ih.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 Zl=new RegExp(`^${zi.source}$`,"i"),Jl=new RegExp(`^${/([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])?)?/.source}$`);function Xl(n){let t=Uh.test(n)?"Seconds not allowed in offset time zone":"Invalid time zone";throw new RangeError(`${t}: ${n}`)}function Wn(n){return Zl.test(n)||Xl(n),Jl.test(n)?{offsetMinutes:Wr(n)/6e10}:{tzName:n}}function Di(n,t,e,r){let i=n,o=t,a=e;switch(r){case"reject":pr(i,o,a);break;case"constrain":({year:i,month:o,day:a}=fu(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=St(s,0,23),l=St(l,0,59),u=St(u,0,59),h=St(h,0,999),p=St(p,0,999),y=St(y,0,999)}return{hour:s,minute:l,second:u,millisecond:h,microsecond:p,nanosecond:y}}function Ql(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 xn(n,"overflow",["constrain","reject"],"constrain")}function Ei(n){return xn(n,"disambiguation",["compatible","earlier","later","reject"],"compatible")}function ln(n,t){return xn(n,"roundingMode",["ceil","floor","expand","trunc","halfCeil","halfFloor","halfExpand","halfTrunc","halfEven"],t)}function So(n,t){return xn(n,"offset",["prefer","use","ignore","reject"],t)}function Vi(n){return xn(n,"calendarName",["auto","always","never","critical"],"auto")}function Vr(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 qr(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 qi(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 Wi(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 Ln=Symbol("~required~");function Ot(n,t,e,r,i=[]){let o=[];for(let u=0;u<Fr.length;u++){let h=Fr[u],p=h[1],y=h[2];e!=="datetime"&&e!==y||o.push(p)}o=o.concat(i);let a=r;a===Ln?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=$h[h];p!==void 0&&s.push(p)}let l=xn(n,t,s,a);if(l===void 0&&r===Ln)throw new RangeError(`${t} is required`);return l&&l in nl?nl[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(Ne(t))return{plainRelativeTo:Tt(m(t,Be).isoDate,m(t,U))};i=Xi(t);let u=Jt(i,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset","timeZone"],[]);({isoDate:e,time:r}=Ki(i,u,"constrain")),{offset:a,timeZone:o}=u,a===void 0&&(s="wall")}else{let u,h,p,y,w;if({year:p,month:y,day:w,time:r,calendar:i,tzAnnotation:u,offset:a,z:h}=wn(Ge(t)),u)o=Ct(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=It(i),e={year:p,month:y,day:w}}return o===void 0?{plainRelativeTo:Tt(e,i)}:{zonedRelativeTo:at(Io(e,r,s,s==="option"?Wr(a):0,o,"compatible","reject",l),o,i)}}function Tn(n){return m(n,yt)!==0?"year":m(n,vt)!==0?"month":m(n,At)!==0?"week":m(n,bt)!==0?"day":m(n,wt)!==0?"hour":m(n,Dt)!==0?"minute":m(n,Et)!==0?"second":m(n,_t)!==0?"millisecond":m(n,Mt)!==0?"microsecond":"nanosecond"}function In(n,t){return wi.indexOf(n)>wi.indexOf(t)?t:n}function mn(n){return n==="year"||n==="month"||n==="week"}function Cn(n){return mn(n)||n==="day"?"date":"time"}function Xn(n){return it("%calendarImpl%")(n)}function Gi(n){return it("%calendarImpl%")(m(n,U))}function kt(n,t,e="date"){let r=Object.create(null),i=Xn(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=Xn(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,Fh[h])(p);else if(i!=="partial"){if(i.includes(h))throw new TypeError(`required property '${h}' missing or undefined`);s[h]=Yh[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 hi(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(Ne(n))return Ee(ie(t)),Tt(m(n,Be).isoDate,m(n,U));let s=Xi(n);return Tt(Zn(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=It(o),Ee(ie(t)),Tt({year:e,month:r,day:i},o)}function Ki(n,t,e){return Me(Zn(n,t,e),Go(t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond,e))}function mi(n,t){let e,r,i;if(ze(n)){if(Ne(n))return Ee(ie(t)),en(m(n,Be),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=Xi(n);let o=Jt(i,n,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond"],[]),a=Ee(ie(t));({isoDate:e,time:r}=Ki(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=It(i),Ee(ie(t)),e={year:a,month:s,day:l}}return en(Me(e,r),i)}function nn(n){let t=it("%Temporal.Duration%");if(Ye(n))return new t(m(n,yt),m(n,vt),m(n,At),m(n,bt),m(n,wt),m(n,Dt),m(n,Et),m(n,_t),m(n,Mt),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:w,nanoseconds:S}=function(T){let x=xh.exec(T);if(!x)throw new RangeError(`invalid duration: ${T}`);if(x.every((v,E)=>E<2||v===void 0))throw new RangeError(`invalid duration: ${T}`);let $=x[1]==="-"?-1:1,W=x[2]===void 0?0:fe(x[2])*$,K=x[3]===void 0?0:fe(x[3])*$,ee=x[4]===void 0?0:fe(x[4])*$,oe=x[5]===void 0?0:fe(x[5])*$,ae=x[6]===void 0?0:fe(x[6])*$,Ce=x[7],Se=x[8],ce=x[9],F=x[10],z=x[11],Y=0,se=0,g=0;if(Ce!==void 0){if(Se??ce??F??z)throw new RangeError("only the smallest unit can be fractional");g=3600*fe((Ce+"000000000").slice(0,9))*$}else if(Y=Se===void 0?0:fe(Se)*$,ce!==void 0){if(F??z)throw new RangeError("only the smallest unit can be fractional");g=60*fe((ce+"000000000").slice(0,9))*$}else se=F===void 0?0:fe(F)*$,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 se+=Math.trunc(g/1e9)%60,Y+=Math.trunc(g/6e10),Xo(W,K,ee,oe,ae,Y,se,d,c,H),{years:W,months:K,weeks:ee,days:oe,hours:ae,minutes:Y,seconds:se,milliseconds:d,microseconds:c,nanoseconds:H}}(i);return new(it("%Temporal.Duration%"))(o,a,s,l,u,h,p,y,w,S)}(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=Ql(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 pi(n){let t;if(ze(n)){if(tt(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(T){let x=wn(T);if(!x.z&&!x.offset)throw new RangeError("Temporal.Instant requires a time zone offset");return x}(Ge(t)),{hour:l=0,minute:u=0,second:h=0,millisecond:p=0,microsecond:y=0,nanosecond:w=0}=o==="start-of-day"?{}:o,S=Ii(e,r,i,l,u,h,p,y,w-(s?0:Wr(a)));return Or(S.isoDate),sn(rt(S))}function il(n,t){if(ze(n)){if(qt(n))return Ee(ie(t)),Lr(m(n,me),m(n,U));let s;return Pt(n,U)?s=m(n,U):(s=n.calendar,s===void 0&&(s="iso8601"),s=Ji(s)),Lr(Ro(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=It(o),Ee(ie(t)),o==="iso8601")return Lr({year:1972,month:e,day:r},o);let a={year:i,month:e,day:r};return Dr(a),a=Ro(o,kt(o,a,"month-day"),"constrain"),Lr(a,o)}function Vn(n,t){let e;if(ze(n)){if(Ue(n))return Ee(ie(t)),kn(m(n,je));if(Ne(n))return Ee(ie(t)),kn(m(n,Be).time);if(be(n)){let u=rn(m(n,ke),m(n,he));return Ee(ie(t)),kn(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=Kl(Ge(n)),Ee(ie(t));return kn(e)}function eu(n){return n===void 0?{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}:m(Vn(n),je)}function fi(n,t){if(ze(n)){if(nt(n))return Ee(ie(t)),Nr(m(n,me),m(n,U));let s=Xi(n);return Nr(Ci(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=It(o),Ee(ie(t));let a={year:e,month:r,day:i};return Vs(a),a=Ci(o,kt(o,a,"year-month"),"constrain"),Nr(a,o)}function Io(n,t,e,r,i,o,a,s){if(t==="start-of-day")return zn(i,n);let l=Me(n,t);if(e==="wall"||a==="ignore")return ct(i,l,o);if(e==="exact"||a==="use"){let p=Ii(n.year,n.month,n.day,t.hour,t.minute,t.second,t.millisecond,t.microsecond,t.nanosecond-r);Or(p.isoDate);let y=rt(p);return vn(y),y}Or(n);let u=rt(l),h=ki(i,l);for(let p=0;p<h.length;p++){let y=h[p],w=k.default.toNumber(k.default.subtract(u,y)),S=qn(w,6e10,"halfExpand");if(w===r||s&&S===r)return y}if(a==="reject"){let p=cs(r),y=Pi(l,"iso8601","auto");throw new RangeError(`Offset ${p} is invalid for ${y} in ${i}`)}return lu(h,i,l,o)}function gi(n,t){let e,r,i,o,a,s,l,u=!1,h="option";if(ze(n)){if(be(n)){let T=ie(t);return Ei(T),So(T,"reject"),Ee(T),at(m(n,he),m(n,ke),m(n,U))}a=Xi(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 w=ie(t);s=Ei(w),l=So(w,"reject");let S=Ee(w);({isoDate:e,time:r}=Ki(a,y,S))}else{let y,w,S,T,x;({year:S,month:T,day:x,time:r,tzAnnotation:y,offset:o,z:w,calendar:a}=function(W){let K=wn(W);if(!K.tzAnnotation)throw new RangeError("Temporal.ZonedDateTime requires a time zone ID in brackets");return K}(Ge(n))),i=Ct(y),w?h="exact":o||(h="wall"),a||(a="iso8601"),a=It(a),u=!0;let $=ie(t);s=Ei($),l=So($,"reject"),Ee($),e={year:S,month:T,day:x}}let p=0;return h==="option"&&(p=Wr(o)),at(Io(e,r,h,p,i,s,l,u),i,a)}function tu(n,t,e){Dr(t),On(n),ve(n,me,t),ve(n,U,e),ve(n,xl,!0)}function Tt(n,t){let e=it("%Temporal.PlainDate%"),r=Object.create(e.prototype);return tu(r,n,t),r}function nu(n,t,e){fr(t),On(n),ve(n,Be,t),ve(n,U,e)}function en(n,t){let e=it("%Temporal.PlainDateTime%"),r=Object.create(e.prototype);return nu(r,n,t),r}function ru(n,t,e){Dr(t),On(n),ve(n,me,t),ve(n,U,e),ve(n,Ll,!0)}function Lr(n,t){let e=it("%Temporal.PlainMonthDay%"),r=Object.create(e.prototype);return ru(r,n,t),r}function iu(n,t){On(n),ve(n,je,t)}function kn(n){let t=it("%Temporal.PlainTime%"),e=Object.create(t.prototype);return iu(e,n),e}function ou(n,t,e){Vs(t),On(n),ve(n,me,t),ve(n,U,e),ve(n,Al,!0)}function Nr(n,t){let e=it("%Temporal.PlainYearMonth%"),r=Object.create(e.prototype);return ou(r,n,t),r}function au(n,t){vn(t),On(n),ve(n,he,t)}function sn(n){let t=it("%Temporal.Instant%"),e=Object.create(t.prototype);return au(e,n),e}function su(n,t,e,r){vn(t),On(n),ve(n,he,t),ve(n,ke,e),ve(n,U,r)}function at(n,t,e="iso8601"){let r=it("%Temporal.ZonedDateTime%"),i=Object.create(r.prototype);return su(i,n,t,e),i}function ol(n){return as.filter(t=>n[t]!==void 0)}function mr(n,t,e){let r=ol(e),i=Xn(n).fieldKeysToIgnore(r),o=Object.create(null),a=ol(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=Xn(n).dateAdd(t,e,r);return Dr(i),i}function Zi(n,t,e,r){return Xn(n).dateUntil(t,e,r)}function Ji(n){if(ze(n)&&Pt(n,U))return m(n,U);let t=Ge(n);try{return It(t)}catch{}let e;try{({calendar:e}=wn(t))}catch{try{({calendar:e}=Kl(t))}catch{try{({calendar:e}=Fs(t))}catch{({calendar:e}=Ys(t))}}}return e||(e="iso8601"),It(e)}function Xi(n){if(Pt(n,U))return m(n,U);let{calendar:t}=n;return t===void 0?"iso8601":Ji(t)}function yn(n,t){return It(n)===It(t)}function Zn(n,t,e){let r=Xn(n);r.resolveFields(t,"date");let i=r.dateToISO(t,e);return Dr(i),i}function Ci(n,t,e){let r=Xn(n);r.resolveFields(t,"year-month"),t.day=1;let i=r.dateToISO(t,e);return Vs(i),i}function Ro(n,t,e){let r=Xn(n);r.resolveFields(t,"month-day");let i=r.monthDayToISOReferenceDate(t,e);return Dr(i),i}function Ct(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(Zl.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{}Xl(u)}(o);return a?Wn(a):l?Wn("UTC"):s?Wn(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 cu(n,t){if(n===t)return!0;let e=Wn(n).offsetMinutes,r=Wn(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 Pn(n,t){let e=Wn(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=Pn(n,t),{isoDate:{year:r,month:i,day:o},time:{hour:a,minute:s,second:l,millisecond:u,microsecond:h,nanosecond:p}}=hu(t);return Ii(r,i,o,a,s,l,u,h,p+e)}function ct(n,t,e){return lu(ki(n,t),n,t,e)}function lu(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=rt(e),a=k.default.subtract(o,Gn);vn(a);let s=Pn(t,a),l=k.default.add(o,Gn);vn(l);let u=Pn(t,l)-s;switch(r){case"earlier":{let h=Re.fromComponents(0,0,0,0,0,-u),p=$r(e.time,h);return ki(t,Me(Ht(e.isoDate.year,e.isoDate.month,e.isoDate.day+p.deltaDays),p))[0]}case"compatible":case"later":{let h=Re.fromComponents(0,0,0,0,0,u),p=$r(e.time,h),y=ki(t,Me(Ht(e.isoDate.year,e.isoDate.month,e.isoDate.day+p.deltaDays),p));return y[y.length-1]}}}function ki(n,t){if(n==="UTC")return Or(t.isoDate),[rt(t)];let e=Wn(n).offsetMinutes;if(e!==void 0){let r=Ii(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);Or(r.isoDate);let i=rt(r);return vn(i),[i]}return Or(t.isoDate),function(r,i){let o=rt(i),a=k.default.subtract(o,Gn);k.default.lessThan(a,Si)&&(a=o);let s=k.default.add(o,Gn);k.default.greaterThan(s,Br)&&(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)),w=function(S,T){let{epochMilliseconds:x,time:{millisecond:$,microsecond:W,nanosecond:K}}=hu(T),{year:ee,month:oe,day:ae,hour:Ce,minute:Se,second:ce}=mu(S,x);return Ii(ee,oe,ae,Ce,Se,ce,$,W,K)}(r,y);if(jr(i,w)===0)return vn(y),y}).filter(p=>p!==void 0)}(n,t)}function zn(n,t){let e=Me(t,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),r=ki(n,e);if(r.length)return r[0];let i=rt(e),o=k.default.subtract(i,Gn);return vn(o),zs(n,o)}function Qi(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 uu(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+=uu(r,i)),o}function al(n,t,e){let r=t;r===void 0&&(r="UTC");let i=m(n,he),o=Pi(rn(r,i),"iso8601",e,"never"),a="Z";return t!==void 0&&(a=du(Pn(r,i))),`${o}${a}`}function Mo(n,t){let e=m(n,yt),r=m(n,vt),i=m(n,At),o=m(n,bt),a=m(n,wt),s=m(n,Dt),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=Re.fromComponents(0,0,m(n,Et),m(n,_t),m(n,Mt),m(n,Lt));p.isZero()&&!["second","millisecond","microsecond","nanosecond"].includes(Tn(n))&&t==="auto"||(h+=`${Math.abs(p.sec)}${uu(Math.abs(p.subsec),t)}S`);let y=`${l<0?"-":""}P${u}`;return h&&(y=`${y}T${h}`),y}function sl(n,t="auto"){let{year:e,month:r,day:i}=m(n,me);return`${Qi(e)}-${Zt(r)}-${Zt(i)}${Ui(m(n,U),t)}`}function cl({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 Pi(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`${Qi(i)}-${Zt(o)}-${Zt(a)}T${Ko(s,l,u,1e6*h+1e3*p+y,e)}${Ui(t,r)}`}function ll(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=`${Qi(e)}-${o}`);let s=Ui(a,t);return s&&(o+=s),o}function ul(n,t="auto"){let{year:e,month:r,day:i}=m(n,me),o=`${Qi(e)}-${Zt(r)}`,a=m(n,U);t!=="always"&&t!=="critical"&&a==="iso8601"||(o+=`-${Zt(i)}`);let s=Ui(a,t);return s&&(o+=s),o}function dl(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=Pn(s,a),u=Pi(rn(s,a),"iso8601",t,"never");return i!=="never"&&(u+=du(l)),r!=="never"&&(u+=`[${r==="critical"?"!":""}${s}]`),u+=Ui(m(n,U),e),u}function hl(n){return Jl.test(n)}function Wr(n){let t=Vh.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 si,zh=Object.assign(Object.create(null),{"/":!0,"-":!0,_:!0});function xo(n){if(si===void 0){let o=Intl.supportedValuesOf?.("timeZone");if(o){si=new Map;for(let a=0;a<o.length;a++){let s=o[a];si.set(Ri(s),s)}}else si=null}let t=Ri(n),e=si?.get(t);if(e)return{identifier:e,primaryIdentifier:e};try{e=Gl(n).resolvedOptions().timeZone}catch{return}if(t==="antarctica/south_pole"&&(e="Antarctica/McMurdo"),Bh.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||zh[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 dr(n,t){let{year:e,month:r,day:i,hour:o,minute:a,second:s}=mu(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 dr(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 du(n){return $s(qn(n,Ah,"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()+Oh*l}function rt(n){let t=js(n),e=1e3*n.time.microsecond+n.time.nanosecond;return k.default.add(cn(t),k.default.BigInt(e))}function hu(n){let t=on(n,"trunc"),e=k.default.toNumber(k.default.remainder(n,ji));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<bi)return zs(n,cn(bi));let r=Date.now(),i=Math.max(e,r)+366*Kn*3,o=e,a=dr(n,o),s=o,l=a;for(;a===l&&o<i;){if(s=o+2*Kn*7,s>Wl)return null;l=dr(n,s),a===l&&(o=s)}return a===l?null:cn(_u(u=>dr(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*Kn*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<bi)return null;let a=dr(n,o),s=o,l=a;for(;a===l&&o>bi;){if(s=o-2*Kn*7,s<bi)return null;l=dr(n,s),a===l&&(o=s)}return a===l?null:cn(_u(u=>dr(n,u),s,o,l,a))}function mu(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}}(Gl(n).format(t))}function Ao(n){return n!==void 0&&!(n%4!=0||n%100==0&&n%400!=0)}function hr(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,yt),m(n,vt),m(n,At),m(n,bt),m(n,wt),m(n,Dt),m(n,Et),m(n,_t),m(n,Mt),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 pu(n){let t=Zo(n.date);return t!==0?t:n.time.sign()}function ur(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}=ur(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}=ur(r,i-1)),o+=hr(r,i);for(;o>hr(r,i);)o-=hr(r,i),{year:r,month:i}=ur(r,i+1);return{year:r,month:i,day:o}}function Ii(n,t,e,r,i,o,a,s,l){let u=Un(r,i,o,a,s,l);return Me(Ht(n,t,e+u.deltaDays),u)}function Un(n,t,e,r,i,o){let a,s=n,l=t,u=e,h=r,p=i,y=o;({div:a,mod:y}=Ar(y,3)),p+=a,y<0&&(p-=1,y+=1e3),{div:a,mod:p}=Ar(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 w=Math.trunc(s/24);return s%=24,s<0&&(w-=1,s+=24),w+=0,s+=0,l+=0,u+=0,h+=0,p+=0,y+=0,{deltaDays:w,hour:s,minute:l,second:u,millisecond:h,microsecond:p,nanosecond:y}}function ml(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=gr(r.year,r.month-1,r.day),a=gr(i.year,i.month-1,i.day)-o;return n.days+a}function Bt(n){return new(it("%Temporal.Duration%"))(-m(n,yt),-m(n,vt),-m(n,At),-m(n,bt),-m(n,wt),-m(n,Dt),-m(n,Et),-m(n,_t),-m(n,Mt),-m(n,Lt))}function St(n,t,e){return Math.min(e,Math.max(t,n))}function fu(n,t,e){let r=St(t,1,12);return{year:n,month:r,day:St(e,1,hr(n,r))}}function Ke(n,t,e){if(n<t||n>e)throw new RangeError(`value out of range: ${t} <= ${n} <= ${e}`)}function pr(n,t,e){Ke(t,1,12),Ke(e,1,hr(n,t))}function Dr(n){fr(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){pr(n,t,e),Jo(r,i,o,a,s,l)}function fr(n){let t=rt(n);(k.default.lessThan(t,Lh)||k.default.greaterThan(t,Nh))&&vn(t)}function ds(n){rt(n)}function vn(n){if(k.default.lessThan(n,Si)||k.default.greaterThan(n,Br))throw new RangeError("date/time value is outside of supported range")}function Vs({year:n,month:t}){Ke(n,Qc,el),n===Qc?Ke(t,4,12):n===el&&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 W=p[$];if(W===1/0||W===-1/0)throw new RangeError("infinite values not allowed as duration fields");if(W!==0){let K=W<0?-1:1;if(h!==0&&K!==h)throw new RangeError("mixed-sign values not allowed as duration fields");h=K}}if(Math.abs(n)>=2**32||Math.abs(t)>=2**32||Math.abs(e)>=2**32)throw new RangeError("years, months, and weeks must be < 2\xB3\xB2");let y=Ar(s,3),w=Ar(l,6),S=Ar(u,9),T=Ar(1e6*y.mod+1e3*w.mod+S.mod,9).div,x=86400*r+3600*i+60*o+a+y.div+w.div+S.div+T;if(!Number.isSafeInteger(x))throw new RangeError("total of duration time units cannot exceed 9007199254740991.999999999 s")}function xr(n){return{date:{years:m(n,yt),months:m(n,vt),weeks:m(n,At),days:m(n,bt)},time:Re.fromComponents(m(n,wt),m(n,Dt),m(n,Et),m(n,_t),m(n,Mt),m(n,Lt))}}function fn(n){let t=Re.fromComponents(m(n,wt),m(n,Dt),m(n,Et),m(n,_t),m(n,Mt),m(n,Lt)).add24HourDays(m(n,bt));return{date:{years:m(n,yt),months:m(n,vt),weeks:m(n,At),days:0},time:t}}function gu(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(it("%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 gr(n,t,e){return js({isoDate:{year:n,month:t+1,day:e},time:{hour:0,minute:0,second:0,millisecond:0}})/Kn}function Or({year:n,month:t,day:e}){if(Math.abs(gr(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 Re.fromComponents(e,r,i,o,a,s)}function Ws(n,t,e,r,i){let o=Re.fromEpochNsDiff(t,n);return o=No(o,e,r,i),Rn({years:0,months:0,weeks:0,days:0},o)}function yu(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=In("day",r),u=Zi(e,n.isoDate,s,l);return r!==l&&(i=i.add24HourDays(u.days),u.days=0),Rn(u,i)}function vu(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:Re.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 S=ct(e,u,"compatible");if(y=Re.fromEpochNsDiff(t,S),y.sign()!==-a)break}let w=In("day",i);return Rn(Zi(r,s.isoDate,u.isoDate,w),y)}function bu(n,t,e,r,i,o,a,s,l){let u,h,p,y,w=t;switch(s){case"year":{let Y=qn(w.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=qn(w.date.months,a,"trunc");u=Y,h=Y+a*n,p=st(w.date,0,0,u),y=st(w.date,0,0,h);break}case"week":{let Y=st(w.date,0,0),se=Kt(o,r.isoDate,Y,"constrain"),g=Zi(o,se,Ht(se.year,se.month,se.day+w.date.days),"week"),H=qn(w.date.weeks+g.weeks,a,"trunc");u=H,h=H+a*n,p=st(w.date,0,u),y=st(w.date,0,h);break}case"day":{let Y=qn(w.date.days,a,"trunc");u=Y,h=Y+a*n,p=st(w.date,u),y=st(w.date,h);break}}let S=Kt(o,r.isoDate,p,"constrain"),T=Kt(o,r.isoDate,y,"constrain"),x,$,W=Me(S,r.time),K=Me(T,r.time);i?(x=ct(i,W,"compatible"),$=ct(i,K,"compatible")):(x=rt(W),$=rt(K));let ee=Re.fromEpochNsDiff(e,x),oe=Re.fromEpochNsDiff($,x),ae=zo(l,n<0?"negative":"positive"),Ce=ee.add(ee).abs().subtract(oe.abs()).sign(),Se=Math.abs(u)/a%2==0,ce=ee.isZero()?Math.abs(u):ee.cmp(oe)?Uo(Math.abs(u),Math.abs(h),Ce,Se,ae):Math.abs(h),F=new Re(k.default.add(k.default.multiply(oe.totalNs,k.default.BigInt(u)),k.default.multiply(ee.totalNs,k.default.BigInt(a*n)))).fdiv(oe.totalNs),z=ce===Math.abs(h);return w={date:z?y:p,time:Re.ZERO},{nudgeResult:{duration:w,nudgedEpochNs:z?$:x,didExpandCalendarUnit:z},total:F}}function Qo(n,t,e,r,i,o,a,s,l){let u=n,h=mn(s)||r&&s==="day",p=pu(u)<0?-1:1,y;return h?{nudgeResult:y}=bu(p,u,t,e,r,i,a,s,l):y=r?function(w,S,T,x,$,W,K,ee){let oe=S,ae=Kt($,T.isoDate,oe.date,"constrain"),Ce=Me(ae,T.time),Se=Me(Ht(ae.year,ae.month,ae.day+w),T.time),ce=ct(x,Ce,"compatible"),F=ct(x,Se,"compatible"),z=Re.fromEpochNsDiff(F,ce);if(z.sign()!==w)throw new RangeError("time zone returned inconsistent Instants");let Y=k.default.BigInt(Yr[K]*W),se=oe.time.round(Y,ee),g=se.subtract(z),H=g.sign()!==-w,c,d;return H?(c=w,se=g.round(Y,ee),d=se.addToEpochNs(F)):(c=0,d=se.addToEpochNs(ce)),{duration:Rn(st(oe.date,oe.date.days+c),se),nudgedEpochNs:d,didExpandCalendarUnit:H}}(p,u,e,r,i,a,s,l):function(w,S,T,x,$,W){let K=w,ee=K.time.add24HourDays(K.date.days),oe=ee.round(k.default.BigInt(x*Yr[$]),W),ae=oe.subtract(ee),{quotient:Ce}=ee.divmod(ko),{quotient:Se}=oe.divmod(ko),ce=Math.sign(Se-Ce)===ee.sign(),F=ae.addToEpochNs(S),z=0,Y=oe;return Cn(T)==="date"&&(z=Se,Y=oe.add(Re.fromComponents(24*-Se,0,0,0,0,0))),{duration:{date:st(K.date,z),time:Y},nudgedEpochNs:F,didExpandCalendarUnit:ce}}(u,t,o,a,s,l),u=y.duration,y.didExpandCalendarUnit&&s!=="week"&&(u=function(w,S,T,x,$,W,K,ee){let oe=S;if(ee===K)return oe;let ae=wi.indexOf(K);for(let Ce=wi.indexOf(ee)-1;Ce>=ae;Ce--){let Se=wi[Ce];if(Se==="week"&&K!=="week")continue;let ce;switch(Se){case"year":ce={years:oe.date.years+w,months:0,weeks:0,days:0};break;case"month":{let Y=oe.date.months+w;ce=st(oe.date,0,0,Y);break}case"week":{let Y=oe.date.weeks+w;ce=st(oe.date,0,Y);break}}let F=Me(Kt(W,x.isoDate,ce,"constrain"),x.time),z;if(z=$?ct($,F,"compatible"):rt(F),To(T,z)===-w)break;oe={date:ce,time:Re.ZERO}}return oe}(p,u,y.nudgedEpochNs,e,r,i,o,In(s,"day"))),u}function pl(n,t,e,r,i,o){return mn(o)||r&&o==="day"?bu(pu(n)<0?-1:1,n,t,e,r,i,1,o,"trunc").total:_i(n.time.add24HourDays(n.date.days),o)}function wu(n,t,e,r,i,o,a){if(jr(n,t)==0)return{date:{years:0,months:0,weeks:0,days:0},time:Re.ZERO};fr(n),fr(t);let s=yu(n,t,e,r);return o==="nanosecond"&&i===1?s:Qo(s,rt(t),n,null,e,r,i,o,a)}function Du(n,t,e,r,i,o,a,s){if(Cn(i)==="time")return Ws(n,t,o,a,s);let l=vu(n,t,e,r,i);return a==="nanosecond"&&o===1?l:Qo(l,t,rn(e,n),e,r,i,o,a,s)}function Gr(n,t,e,r,i,o){let a=Fr.reduce((w,S)=>{let T=S[0],x=S[1],$=S[2];return e!=="datetime"&&$!==e||r.includes(x)||w.push(x,T),w},[]),s=Ot(t,"largestUnit",e,"auto");if(r.includes(s))throw new RangeError(`largestUnit must be one of ${a.join(", ")}, not ${s}`);let l=Vr(t),u=ln(t,"trunc");n==="since"&&(u=function(w){switch(w){case"ceil":return"floor";case"floor":return"ceil";case"halfCeil":return"halfFloor";case"halfFloor":return"halfCeil";default:return w}}(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=In(o,h);if(s==="auto"&&(s=p),In(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&&qr(l,y,!1),{largestUnit:s,roundingIncrement:l,roundingMode:u,smallestUnit:h}}function fl(n,t,e,r){let i=pi(e),o=Gr(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 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=Gr(n,ie(r),"date",[],"day","day"),l=it("%Temporal.Duration%"),u=m(t,me),h=m(i,me);if(bn(u,h)===0)return new l;let p={date:Zi(o,u,h,s.largestUnit),time:Re.ZERO};if(s.smallestUnit!=="day"||s.roundingIncrement!==1){let w=Me(u,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});p=Qo(p,rt(Me(h,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),w,null,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let y=tn(p,"day");return n==="since"&&(y=Bt(y)),y}function yl(n,t,e,r){let i=mi(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=Gr(n,ie(r),"datetime",[],"nanosecond","day"),l=it("%Temporal.Duration%"),u=m(t,Be),h=m(i,Be);if(jr(u,h)===0)return new l;let p=tn(wu(u,h,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);return n==="since"&&(p=Bt(p)),p}function vl(n,t,e,r){let i=Vn(e),o=Gr(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 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 months of ${o} and ${a} calendars`);let s=Gr(n,ie(r),"date",["week","day"],"month","year"),l=it("%Temporal.Duration%");if(bn(m(t,me),m(i,me))==0)return new l;let u=kt(o,m(t,me),"year-month");u.day=1;let h=Zn(o,u,"constrain"),p=kt(o,m(i,me),"year-month");p.day=1;let y=Zn(o,p,"constrain"),w={date:st(Zi(o,h,y,s.largestUnit),0,0),time:Re.ZERO};if(s.smallestUnit!=="month"||s.roundingIncrement!==1){let T=Me(h,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0});w=Qo(w,rt(Me(y,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0})),T,null,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode)}let S=tn(w,"day");return n==="since"&&(S=Bt(S)),S}function wl(n,t,e,r){let i=gi(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=Gr(n,ie(r),"datetime",[],"nanosecond","hour"),l=m(t,he),u=m(i,he),h=it("%Temporal.Duration%"),p;if(Cn(s.largestUnit)!=="date")p=tn(Ws(l,u,s.roundingIncrement,s.smallestUnit,s.roundingMode),s.largestUnit);else{let y=m(t,ke);if(!cu(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(Du(l,u,y,o,s.largestUnit,s.roundingIncrement,s.smallestUnit,s.roundingMode),"hour")}return n==="since"&&(p=Bt(p)),p}function $r({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,Un(n,t,s,r,i,l)}function hs(n,t){let e=t.addToEpochNs(n);return vn(e),e}function yi(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 Dl(n,t,e){let r=nn(e);n==="subtract"&&(r=Bt(r));let i=In(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 El(n,t,e){let r=nn(e);n==="subtract"&&(r=Bt(r));let i=Tn(r);if(Cn(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 _l(n,t,e,r){let i=m(t,U),o=nn(e);n==="subtract"&&(o=Bt(o));let a=gu(o),s=Ee(ie(r));return Tt(Kt(i,m(t,me),a,s),i)}function Ml(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,Be),u=$r(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 Sl(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}=$r(m(t,je),i.time);return kn(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=kt(s,m(t,me),"year-month");l.day=1;let u=Zn(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=gu(i);return Dr(u),Nr(Ci(s,kt(s,Kt(s,u,h,o),"year-month"),o),s)}function Cl(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=xr(i);return at(yi(m(t,he),a,s,l,o),a,s)}function qn(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=Yr[e]*t;return function(o,a,s){let l=Sn(o),u=Sn(a),h=k.default.divide(l,u),p=k.default.remainder(l,u),y=zo(s,"positive"),w,S;k.default.lessThan(l,Wt)?(w=k.default.subtract(h,Mi),S=h):(w=h,S=k.default.add(h,Mi));let T=To(lr(k.default.multiply(p,Bs)),u)*(k.default.lessThan(l,Wt)?-1:1)+0,x=k.default.equal(p,Wt)?h:Uo(w,S,T,Rl(w),y);return k.default.multiply(x,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=Yr[s],p=qn(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 Un(p,0,0,0,0,0);case"minute":return Un(n,p,0,0,0,0);case"second":return Un(n,t,p,0,0,0);case"millisecond":return Un(n,t,e,p,0,0);case"microsecond":return Un(n,t,e,r,p,0);case"nanosecond":return Un(n,t,e,r,i,p);default:throw new Error(`Invalid unit ${s}`)}}function No(n,t,e,r){let i=Yr[e];return n.round(k.default.BigInt(i*t),r)}function _i(n,t){let e=Yr[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 jr(n,t){let e=bn(n.isoDate,t.isoDate);return e!==0?e:gs(n.time,t.time)}function Eu(n){let t=Oo(n);return globalThis.BigInt!==void 0?globalThis.BigInt(t.toString(10)):t}function on(n,t){let e=Sn(n),{quotient:r,remainder:i}=ui(e,ji),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),ji)}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,ji),k.default.greaterThan(r,Br)?Br:k.default.lessThan(r,Si)?Si:r}})();function ci(){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 yr(n,t){let e=Object.create(null);return e[n]=t,e}function xn(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===Ln)throw new RangeError(`${t} option is required`);return r}function It(n){let t=Ri(n);if(!Hh.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 Qn(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 Uh=new RegExp(`^${Vl.source}$`),Vh=new RegExp(`^${/([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])(?::?([0-5][0-9])(?:[.,](\d{1,9}))?)?)?/.source}$`);function _u(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 Mu(n){return[...n]}function Su(n,t){if(n!=="gregory"&&n!=="iso8601")return;let e=eo[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,w,S,T){let x=(T-y-S+1)%7;x<0&&(x+=7);let $=Math.floor((S+x-1)/7);return 7-x>=w&&++$,$}(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 kl(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 eo={};function vr(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=St(r,1,e)),i=gn(r)}else{let o=vr(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}}eo.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)=>Di(n.year,n.month,n.day,t),monthDayToISOReferenceDate(n,t){let{month:e,day:r}=Di(n.year??1972,n.month,n.day,t);return{month:e,day:r,year:1972}},extraFields:()=>[],fieldKeysToIgnore(n){let t=new Set;for(let e=0;e<n.length;e++){let r=n[e];t.add(r),r==="month"?t.add("monthCode"):r==="monthCode"&&t.add("month")}return Mu(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}=ur(a,s),{year:a,month:s,day:l}=Di(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);!kl(r,n.year+h,n.month,n.day,t);)o=h,h+=r;let p=r;for(i=ur(n.year+o,n.month+p);!kl(r,i.year,i.month,n.day,t);)a=p,p+=r,i=ur(i.year,i.month+r);e==="month"&&(a+=12*o,o=0)}i=ur(n.year+o,n.month+a);let s=fu(i.year,i.month,n.day),l=0,u=gr(t.year,t.month-1,t.day)-gr(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+=hr(n,a);i.dayOfYear=o}return r.weekOfYear&&(i.weekOfYear=Su("iso8601",{year:n,month:t,day:e})),r.daysInMonth&&(i.daysInMonth=hr(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`${Qi(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 Nn=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:w,value:S}=u[y];if(w!=="year"&&w!=="relatedYear"||(this.hasEra?h.eraYear=+S:h.year=+S),w==="month"){let T=/^([0-9]*)(.*?)$/.exec(S);if(!T||T.length!=3||!T[1]&&!T[2])throw new RangeError(`Unexpected month: ${S}`);if(h.month=T[1]?+T[1]:1,h.month<1)throw new RangeError(`Invalid month ${S} 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 ${S} from ${l}[u-ca-${this.id}] (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10529)`);T[2]&&(h.monthExtra=T[2])}w==="day"&&(h.day=+S),this.hasEra&&w==="era"&&S!=null&&S!==""&&(h.era=S.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(w=>h.era===w.genericName);y&&(h.era=y.code)}if(this.reviseIntlEra){let{era:y,eraYear:w}=this.reviseIntlEra(h,t);h.era=y,h.eraYear=w}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 w=JSON.stringify({func:"calendarToIsoDate",year:p.year,month:p.month,day:p.day,overflow:y,id:this.id});e.set(w,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=St(o,1,i),a=St(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}),w=W=>{let K=this.addDaysIso(y,W);if(o.day>this.minimumMonthLength(o)){let ee=this.isoToCalendarDate(K,r);for(;ee.month!==s||ee.year!==a;){if(e==="reject")throw new RangeError(`day ${l} does not exist in month ${s} of year ${a}`);K=this.addDaysIso(K,-1),ee=this.isoToCalendarDate(K,r)}}return K},S=0,T=this.isoToCalendarDate(y,r),x=Za(o,T);if(x.years!==0||x.months!==0||x.days!==0){let W=365*x.years+30*x.months+x.days;y=this.addDaysIso(y,W),T=this.isoToCalendarDate(y,r),x=Za(o,T),x.years===0&&x.months===0?y=w(x.days):S=this.compareCalendarDates(o,T)}let $=8;for(;S;){y=this.addDaysIso(y,S*$);let W=T;T=this.isoToCalendarDate(y,r);let K=S;if(S=this.compareCalendarDates(o,T),S){if(x=Za(o,T),x.years===0&&x.months===0)y=w(x.days),S=0;else if(K&&S!==K)if($>1)$/=2;else{if(e==="reject")throw new RangeError(`Can't find ISO date from calendar date: ${JSON.stringify({...i})}`);this.compareCalendarDates(T,W)>0&&(y=this.addDaysIso(y,-1)),S=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),w=this.addDaysIso(y,p);if(o=this.isoToCalendarDate(w,i),e>0){let S=this.monthsInYear(h,i);for(;o.month-1!=u%S;)w=this.addDaysIso(w,-1),o=this.isoToCalendarDate(w,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),w=o+7*i;return this.addDaysCalendar(y,w,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 S=0;e.monthCode>t.monthCode&&(S=1),e.monthCode<t.monthCode&&(S=-1),S||(S=Math.sign(p)),l=S*u<0?h-u:h}let y,w=l?this.addCalendar(t,{years:l},"constrain",i):t;do s+=u,y=w,w=this.addMonthsCalendar(y,u,"constrain",i),w.day!==t.day&&(w=this.regulateDate({...w,day:t.day},"constrain",i));while(this.compareCalendarDates(e,w)*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 gr(o.year,o.month-1,o.day)-gr(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:w,day:S}=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");(w===void 0||p!==void 0||this.hasEra&&h!==void 0)&&({monthCode:w,day:S}=this.isoToCalendarDate(this.calendarToIsoDate(t,e,r),r));let T={year:this.monthDaySearchStartYear(w,S),month:12,day:31},x=this.isoToCalendarDate(T,r),$=x.monthCode>w||x.monthCode===w&&x.day>=S?x.year:x.year-1;for(let W=0;W<20;W++){let K=this.adjustCalendarDate({day:S,monthCode:w,year:$-W},r),ee=this.calendarToIsoDate(K,"constrain",r),oe=this.isoToCalendarDate(ee,r);if({year:i,month:o,day:a}=ee,oe.monthCode===w&&oe.day===S)return{month:o,day:a,year:i};if(e==="constrain"){let ae=this.maxLengthOfMonthCodeInAnyYear(oe.monthCode);if(oe.monthCode===w&&oe.day===ae&&S>ae)return{month:o,day:a,year:i};(s===void 0||oe.monthCode===s.monthCode&&oe.day>s.day)&&(s=oe,l=ee)}}if(e==="constrain"&&l!==void 0)return l;throw new RangeError(`No recent ${this.id} year with monthCode ${w} and day ${S}`)}getFirstDayOfWeek(){}getMinimalDaysInFirstWeek(){}},vs=class extends Nn{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=vr(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=St(a,1,this.monthsInYear({year:o})),l=St(l,1,this.maximumMonthLength({year:o,month:a}))),s===void 0)s=this.getMonthCode(o,a);else if(this.getMonthCode(o,a)!==s)throw new RangeError(`monthCode ${s} doesn't correspond to month ${a} in Hebrew year ${o}`);return{...t,day:l,month:a,monthCode:s,year:o}}},Jn=class extends Nn{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 Jn{constructor(){super(...arguments),this.id="islamic"}},ws=class extends Jn{constructor(){super(...arguments),this.id="islamic-umalqura"}},Ds=class extends Jn{constructor(){super(...arguments),this.id="islamic-tbla"}},Es=class extends Jn{constructor(){super(...arguments),this.id="islamic-civil"}},_s=class extends Jn{constructor(){super(...arguments),this.id="islamic-rgsa"}},Ms=class extends Jn{constructor(){super(...arguments),this.id="islamicc"}},Ss=class extends Nn{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 vr(t)<=6?31:30}estimateIsoDate(t){let{year:e}=this.adjustCalendarDate(t);return{year:e+621,month:1,day:1}}},Ts=class extends Nn{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=vr(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 Nn{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][vr(t)-1]}estimateIsoDate(t){let e=this.adjustCalendarDate(t);return Di(e.year+this.isoEpoch.year,e.month+this.isoEpoch.month,e.day+this.isoEpoch.day,"constrain")}},Bo=class extends Nn{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][vr(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:vr(a)}),this.validateCalendarDate(i),i=this.completeEraYear(i),super.adjustCalendarDate(i,e,r)}estimateIsoDate(t){let e=this.adjustCalendarDate(t),{year:r,month:i,day:o}=e,{anchorEra:a}=this;return Di(r+a.isoEpoch.year-(a.hasYearZero?0:1),i,o,"constrain")}},xi=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"}])}},Is=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}}])}},Rs=class extends xi{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 xi{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 xi{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 Nn{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=(x,$)=>{let W=Tu({isoYear:x,isoMonth:2,isoDay:1}),K=new Date(W);K.setUTCDate($+1);let ee=o.formatToParts(K),oe=ee.find(ce=>ce.type==="month").value,ae=+ee.find(ce=>ce.type==="day").value,Ce=ee.find(ce=>ce.type==="relatedYear"),Se;if(Ce===void 0)throw new RangeError(`Intl.DateTimeFormat.formatToParts lacks relatedYear in ${this.id} calendar. Try Node 14+ or modern browsers.`);return Se=+Ce.value,{calendarMonthString:oe,calendarDay:ae,calendarYearToVerify:Se}},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,w,S=1,T=!1;do({calendarMonthString:l,calendarDay:u,calendarYearToVerify:h}=a(t,s)),y&&(p[w].daysInMonth=y+30-u),h!==t?T=!0:(p[l]={monthIndex:S++},s+=30),y=u,w=l;while(!T);return p[w].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,w=>w==="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 w=+u.replace(/^M0?|L$/g,"");y=h[w],y&&(a=y.monthIndex,u=gn(w))}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=St(a,1,y),l=St(l,1,this.maximumMonthLength()));let w=p.find(S=>S[1].monthIndex===a);if(w===void 0)throw new RangeError(`Invalid month ${a} in Chinese year ${o}`);u=gn(+w[0].replace("bis",""),w[0].indexOf("bis")!==-1)}else{let h=this.getMonthList(o,e),p=u.replace(/^M|L$/g,w=>w==="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 Mu(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=eo.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=Su(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,Ss,Is,ks,Ps,Ns,Os,Rs,Ts,xs,As,Ls,bs,ws,Ds,Es,_s,Ms]){let t=new n;eo[t.id]=new Hs(t)}rs("calendarImpl",function(n){return eo[n]});var Ai=Intl.DateTimeFormat;function kr(n,t){let e=m(n,t);return typeof e=="function"&&(e=new Ai(m(n,$l),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 li(n){return Pt(n,wr)}var br=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(w){if(w==null)throw new TypeError(`Expected object not ${w}`);return Object(w)}(o);let y=Object.create(null);for(let w=0;w<p.length;w++){let S=p[w];Object.prototype.hasOwnProperty.call(s,S)&&(y[S]=s[S])}s=y}else s=Object.create(null);let l=new Ai(i,s),u=l.resolvedOptions();if(On(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,$l,u.locale),ve(r,wr,l),ve(r,Rr,u.timeZone),ve(r,di,u.calendar),ve(r,Nl,em),ve(r,Ol,Xh),ve(r,Hl,Qh),ve(r,Bl,Jh),ve(r,Fl,tm),ve(r,Yl,nm);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,Ct(p))}})(this,t,e)}get format(){R(this,li);let t=Wh.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,li),Kh.call(this,t,e)}formatToParts(t,...e){return R(this,li),Gh.call(this,t,...e)}formatRangeToParts(t,e){return R(this,li),Zh.call(this,t,e)}resolvedOptions(){return R(this,li),qh.call(this)}};"formatToParts"in Ai.prototype||delete br.prototype.formatToParts,"formatRangeToParts"in Ai.prototype||delete br.prototype.formatRangeToParts;var Gt=function(n=void 0,t=void 0){return new br(n,t)};function qh(){let n=m(this,wr).resolvedOptions();return n.timeZone=m(this,Xa),n}function Wh(n,...t){let e,r,i=zr(n,this);return i.formatter?(e=i.formatter,r=[on(i.epochNs,"floor")]):(e=m(this,wr),r=[n,...t]),e.format(...r)}function Gh(n,...t){let e,r,i=zr(n,this);return i.formatter?(e=i.formatter,r=[on(i.epochNs,"floor")]):(e=m(this,wr),r=[n,...t]),e.formatToParts(...r)}function Kh(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(An(e)!==An(r))throw new TypeError("Intl.DateTimeFormat.formatRange accepts two values of the same type");if(An(e)){if(!Cu(e,r))throw new TypeError("Intl.DateTimeFormat.formatRange accepts two values of the same type");let{epochNs:a,formatter:s}=zr(e,this),{epochNs:l,formatter:u}=zr(r,this);s&&(i=s,o=[on(a,"floor"),on(l,"floor")])}return i||(i=m(this,wr)),i.formatRange(...o)}function Zh(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(An(e)!==An(r))throw new TypeError("Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type");if(An(e)){if(!Cu(e,r))throw new TypeError("Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type");let{epochNs:a,formatter:s}=zr(e,this),{epochNs:l,formatter:u}=zr(r,this);s&&(i=s,o=[on(a,"floor"),on(l,"floor")])}return i||(i=m(this,wr)),i.formatRangeToParts(...o)}function to(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 Jh(n){let t=to(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(no(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 Xh(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=to(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(no(n))throw new TypeError(`cannot format PlainYearMonth with options [${Object.keys(n)}]`);Object.assign(e,{year:"numeric",month:"numeric"})}return e}function Qh(n){let t={short:{month:"numeric",day:"numeric"},medium:{month:"short",day:"numeric"},long:{month:"long",day:"numeric"},full:{month:"long",day:"numeric"}},e=to(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(no(n))throw new TypeError(`cannot format PlainMonthDay with options [${Object.keys(n)}]`);Object.assign(e,{month:"numeric",day:"numeric"})}return e}function em(n){let t=to(n,{hour:!1,minute:!1,second:!1,dayPeriod:!1,timeZoneName:!1,timeStyle:!1});if(!ea(t)){if(no(n))throw new TypeError(`cannot format PlainDate with options [${Object.keys(n)}]`);Object.assign(t,{year:"numeric",month:"numeric",day:"numeric"})}return t}function tm(n){let t=to(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(no(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 nm(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 no(n){return ea(n)||ta(n)||"dateStyle"in n||"timeStyle"in n||"timeZoneName"in n}function An(n){return $e(n)||Ue(n)||Ne(n)||be(n)||nt(n)||qt(n)||tt(n)}function $o(n){return An(n)?n:Vo(n)}function Cu(n,t){return!(!An(n)||!An(t)||Ue(n)&&!Ue(t)||$e(n)&&!$e(t)||Ne(n)&&!Ne(t)||be(n)&&!be(t)||nt(n)&&!nt(t)||qt(n)&&!qt(t)||tt(n)&&!tt(t))}function zr(n,t){if(Ue(n)){let e={isoDate:{year:1970,month:1,day:1},time:m(n,je)};return{epochNs:ct(m(t,Rr),e,"compatible"),formatter:kr(t,Bl)}}if(nt(n)){let e=m(n,U),r=m(t,di);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,Rr),i,"compatible"),formatter:kr(t,Ol)}}if(qt(n)){let e=m(n,U),r=m(t,di);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,Rr),i,"compatible"),formatter:kr(t,Hl)}}if($e(n)){let e=m(n,U),r=m(t,di);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,Rr),i,"compatible"),formatter:kr(t,Nl)}}if(Ne(n)){let e=m(n,U),r=m(t,di);if(e!=="iso8601"&&e!==r)throw new RangeError(`cannot format PlainDateTime with calendar ${e} in locale with calendar ${r}`);let i=m(n,Be);return{epochNs:ct(m(t,Rr),i,"compatible"),formatter:kr(t,Fl)}}if(be(n))throw new TypeError("Temporal.ZonedDateTime not supported in DateTimeFormat methods. Use toLocaleString() instead.");return tt(n)?{epochNs:m(n,he),formatter:kr(t,Yl)}:{}}function ku(n){let t=Object.create(null);return t.years=m(n,yt),t.months=m(n,vt),t.weeks=m(n,At),t.days=m(n,bt),t.hours=m(n,wt),t.minutes=m(n,Dt),t.seconds=m(n,Et),t.milliseconds=m(n,_t),t.microseconds=m(n,Mt),t.nanoseconds=m(n,Lt),t}br.prototype.constructor=Gt,Object.defineProperty(Gt,"prototype",{value:br.prototype,writable:!1,enumerable:!1,configurable:!1}),Gt.supportedLocalesOf=Ai.supportedLocalesOf,Hn(Gt,"Intl.DateTimeFormat");var{format:rm,formatToParts:im}=Intl.DurationFormat?.prototype??Object.create(null);function Zs(n){Intl.DurationFormat.prototype.resolvedOptions.call(this);let t=ku(nn(n));return rm.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=ku(nn(n));return im.call(this,t)});var rp=Object.freeze({__proto__:null,DateTimeFormat:Gt,ModifiedIntlDurationFormatPrototypeFormat:Zs}),Li=class{constructor(t){if(arguments.length<1)throw new TypeError("missing argument: epochNanoseconds is required");au(this,Oo(t))}get epochMilliseconds(){return R(this,tt),on(m(this,he),"floor")}get epochNanoseconds(){return R(this,tt),Eu(k.default.BigInt(m(this,he)))}add(t){return R(this,tt),El("add",this,t)}subtract(t){return R(this,tt),El("subtract",this,t)}until(t,e=void 0){return R(this,tt),fl("until",this,t,e)}since(t,e=void 0){return R(this,tt),fl("since",this,t,e)}round(t){if(R(this,tt),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?yr("smallestUnit",t):ie(t),r=Vr(e),i=ln(e,"halfExpand"),o=Ot(e,"smallestUnit","time",Ln);return qr(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){R(this,tt);let e=pi(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,tt);let e=ie(t),r=qi(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=Ct(a));let{precision:s,unit:l,increment:u}=Wi(o,r);return al(sn(ms(m(this,he),u,l,i)),a,s)}toJSON(){return R(this,tt),al(this,void 0,"auto")}toLocaleString(t=void 0,e=void 0){return R(this,tt),new Gt(t,e).format(this)}valueOf(){Qn("Instant")}toZonedDateTimeISO(t){R(this,tt);let e=Ct(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 pi(t)}static compare(t,e){let r=pi(t),i=pi(e),o=m(r,he),a=m(i,he);return k.default.lessThan(o,a)?-1:k.default.greaterThan(o,a)?1:0}};Hn(Li,"Temporal.Instant");var Ni=class{constructor(t,e,r,i="iso8601"){let o=fe(t),a=fe(e),s=fe(r),l=It(i===void 0?"iso8601":Ge(i));pr(o,a,s),tu(this,{year:o,month:a,day:s},l)}get calendarId(){return R(this,$e),m(this,U)}get era(){return pt(this,"era")}get eraYear(){return pt(this,"eraYear")}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 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 daysInMonth(){return pt(this,"daysInMonth")}get daysInYear(){return pt(this,"daysInYear")}get monthsInYear(){return pt(this,"monthsInYear")}get inLeapYear(){return pt(this,"inLeapYear")}with(t,e=void 0){if(R(this,$e),!ze(t))throw new TypeError("invalid argument");Ur(t);let r=m(this,U),i=kt(r,m(this,me));return i=mr(r,i,Jt(r,t,["year","month","monthCode","day"],[],"partial")),Tt(Zn(r,i,Ee(ie(e))),r)}withCalendar(t){R(this,$e);let e=Ji(t);return Tt(m(this,me),e)}add(t,e=void 0){return R(this,$e),_l("add",this,t,e)}subtract(t,e=void 0){return R(this,$e),_l("subtract",this,t,e)}until(t,e=void 0){return R(this,$e),gl("until",this,t,e)}since(t,e=void 0){return R(this,$e),gl("since",this,t,e)}equals(t){R(this,$e);let e=hi(t);return bn(m(this,me),m(e,me))===0&&yn(m(this,U),m(e,U))}toString(t=void 0){return R(this,$e),sl(this,Vi(ie(t)))}toJSON(){return R(this,$e),sl(this)}toLocaleString(t=void 0,e=void 0){return R(this,$e),new Gt(t,e).format(this)}valueOf(){Qn("PlainDate")}toPlainDateTime(t=void 0){R(this,$e);let e=eu(t);return en(Me(m(this,me),e),m(this,U))}toZonedDateTime(t){let e,r;if(R(this,$e),ze(t)){let a=t.timeZone;a===void 0?e=Ct(t):(e=Ct(a),r=t.plainTime)}else e=Ct(t);let i=m(this,me),o;return r===void 0?o=zn(e,i):(r=Vn(r),o=ct(e,Me(i,m(r,je)),"compatible")),at(o,e,m(this,U))}toPlainYearMonth(){R(this,$e);let t=m(this,U);return Nr(Ci(t,kt(t,m(this,me)),"constrain"),t)}toPlainMonthDay(){R(this,$e);let t=m(this,U);return Lr(Ro(t,kt(t,m(this,me)),"constrain"),t)}static from(t,e=void 0){return hi(t,e)}static compare(t,e){let r=hi(t),i=hi(e);return bn(m(r,me),m(i,me))}};function pt(n,t){R(n,$e);let e=m(n,me);return Gi(n).isoToDate(e,{[t]:!0})[t]}Hn(Ni,"Temporal.PlainDate");var Oi=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),w=fe(r),S=i===void 0?0:fe(i),T=o===void 0?0:fe(o),x=a===void 0?0:fe(a),$=s===void 0?0:fe(s),W=l===void 0?0:fe(l),K=u===void 0?0:fe(u),ee=It(h===void 0?"iso8601":Ge(h));Us(p,y,w,S,T,x,$,W,K),nu(this,{isoDate:{year:p,month:y,day:w},time:{hour:S,minute:T,second:x,millisecond:$,microsecond:W,nanosecond:K}},ee)}get calendarId(){return R(this,Ne),m(this,U)}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 Pr(this,"hour")}get minute(){return Pr(this,"minute")}get second(){return Pr(this,"second")}get millisecond(){return Pr(this,"millisecond")}get microsecond(){return Pr(this,"microsecond")}get nanosecond(){return Pr(this,"nanosecond")}get era(){return ft(this,"era")}get eraYear(){return ft(this,"eraYear")}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 daysInWeek(){return ft(this,"daysInWeek")}get daysInYear(){return ft(this,"daysInYear")}get daysInMonth(){return ft(this,"daysInMonth")}get monthsInYear(){return ft(this,"monthsInYear")}get inLeapYear(){return ft(this,"inLeapYear")}with(t,e=void 0){if(R(this,Ne),!ze(t))throw new TypeError("invalid argument");Ur(t);let r=m(this,U),i=m(this,Be),o={...kt(r,i.isoDate),...i.time};return o=mr(r,o,Jt(r,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond"],"partial")),en(Ki(r,o,Ee(ie(e))),r)}withPlainTime(t=void 0){R(this,Ne);let e=eu(t);return en(Me(m(this,Be).isoDate,e),m(this,U))}withCalendar(t){R(this,Ne);let e=Ji(t);return en(m(this,Be),e)}add(t,e=void 0){return R(this,Ne),Ml("add",this,t,e)}subtract(t,e=void 0){return R(this,Ne),Ml("subtract",this,t,e)}until(t,e=void 0){return R(this,Ne),yl("until",this,t,e)}since(t,e=void 0){return R(this,Ne),yl("since",this,t,e)}round(t){if(R(this,Ne),t===void 0)throw new TypeError("options parameter is required");let e=typeof t=="string"?yr("smallestUnit",t):ie(t),r=Vr(e),i=ln(e,"halfExpand"),o=Ot(e,"smallestUnit","time",Ln,["day"]),a={day:1,hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o];qr(r,a,a===1);let s=m(this,Be);return en(r===1&&o==="nanosecond"?s:ps(s,r,o,i),m(this,U))}equals(t){R(this,Ne);let e=mi(t);return jr(m(this,Be),m(e,Be))===0&&yn(m(this,U),m(e,U))}toString(t=void 0){R(this,Ne);let e=ie(t),r=Vi(e),i=qi(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}=Wi(a,i),h=ps(m(this,Be),u,l,o);return fr(h),Pi(h,m(this,U),s,r)}toJSON(){return R(this,Ne),Pi(m(this,Be),m(this,U),"auto")}toLocaleString(t=void 0,e=void 0){return R(this,Ne),new Gt(t,e).format(this)}valueOf(){Qn("PlainDateTime")}toZonedDateTime(t,e=void 0){R(this,Ne);let r=Ct(t),i=Ei(ie(e));return at(ct(r,m(this,Be),i),r,m(this,U))}toPlainDate(){return R(this,Ne),Tt(m(this,Be).isoDate,m(this,U))}toPlainTime(){return R(this,Ne),kn(m(this,Be).time)}static from(t,e=void 0){return mi(t,e)}static compare(t,e){let r=mi(t),i=mi(e);return jr(m(r,Be),m(i,Be))}};function ft(n,t){R(n,Ne);let e=m(n,Be).isoDate;return Gi(n).isoToDate(e,{[t]:!0})[t]}function Pr(n,t){return R(n,Ne),m(n,Be).time[t]}Hn(Oi,"Temporal.PlainDateTime");var Hi=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),w=r===void 0?0:an(r),S=i===void 0?0:an(i),T=o===void 0?0:an(o),x=a===void 0?0:an(a),$=s===void 0?0:an(s),W=l===void 0?0:an(l),K=u===void 0?0:an(u),ee=h===void 0?0:an(h);Xo(p,y,w,S,T,x,$,W,K,ee),On(this),ve(this,yt,p),ve(this,vt,y),ve(this,At,w),ve(this,bt,S),ve(this,wt,T),ve(this,Dt,x),ve(this,Et,$),ve(this,_t,W),ve(this,Mt,K),ve(this,Lt,ee)}get years(){return R(this,Ye),m(this,yt)}get months(){return R(this,Ye),m(this,vt)}get weeks(){return R(this,Ye),m(this,At)}get days(){return R(this,Ye),m(this,bt)}get hours(){return R(this,Ye),m(this,wt)}get minutes(){return R(this,Ye),m(this,Dt)}get seconds(){return R(this,Ye),m(this,Et)}get milliseconds(){return R(this,Ye),m(this,_t)}get microseconds(){return R(this,Ye),m(this,Mt)}get nanoseconds(){return R(this,Ye),m(this,Lt)}get sign(){return R(this,Ye),Lo(this)}get blank(){return R(this,Ye),Lo(this)===0}with(t){R(this,Ye);let e=Ql(t),{years:r=m(this,yt),months:i=m(this,vt),weeks:o=m(this,At),days:a=m(this,bt),hours:s=m(this,wt),minutes:l=m(this,Dt),seconds:u=m(this,Et),milliseconds:h=m(this,_t),microseconds:p=m(this,Mt),nanoseconds:y=m(this,Lt)}=e;return new n(r,i,o,a,s,l,u,h,p,y)}negated(){return R(this,Ye),Bt(this)}abs(){return R(this,Ye),new n(Math.abs(m(this,yt)),Math.abs(m(this,vt)),Math.abs(m(this,At)),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,Mt)),Math.abs(m(this,Lt)))}add(t){return R(this,Ye),Dl("add",this,t)}subtract(t){return R(this,Ye),Dl("subtract",this,t)}round(t){if(R(this,Ye),t===void 0)throw new TypeError("options parameter is required");let e=Tn(this),r=typeof t=="string"?yr("smallestUnit",t):ie(t),i=Ot(r,"largestUnit","datetime",void 0,["auto"]),{plainRelativeTo:o,zonedRelativeTo:a}=Ka(r),s=Vr(r),l=ln(r,"halfExpand"),u=Ot(r,"smallestUnit","datetime",void 0),h=!0;u||(h=!1,u="nanosecond");let p=In(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(In(i,u)!==i)throw new RangeError(`largestUnit ${i} cannot be smaller than smallestUnit ${u}`);let w={hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[u];if(w!==void 0&&qr(s,w,!1),s>1&&Cn(u)==="date"&&i!==u)throw new RangeError("For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit");if(a){let T=xr(this),x=m(a,ke),$=m(a,U),W=m(a,he);return T=Du(W,yi(W,x,$,T),x,$,i,s,u,l),Cn(i)==="date"&&(i="hour"),tn(T,i)}if(o){let T=fn(this),x=$r({deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0},T.time),$=m(o,me),W=m(o,U),K=Kt(W,$,st(T.date,x.deltaDays),"constrain");return T=wu(Me($,{deltaDays:0,hour:0,minute:0,second:0,millisecond:0,microsecond:0,nanosecond:0}),Me(K,x),W,i,s,u,l),tn(T,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 S=fn(this);if(u==="day"){let{quotient:T,remainder:x}=S.time.divmod(ko),$=S.date.days+T+_i(x,"day");$=qn($,s,l),S=Rn({years:0,months:0,weeks:0,days:$},Re.ZERO)}else S=Rn({years:0,months:0,weeks:0,days:0},No(S.time,s,u,l));return tn(S,i)}total(t){if(R(this,Ye),t===void 0)throw new TypeError("options argument is required");let e=typeof t=="string"?yr("unit",t):ie(t),{plainRelativeTo:r,zonedRelativeTo:i}=Ka(e),o=Ot(e,"unit","datetime",Ln);if(i){let s=xr(this),l=m(i,ke),u=m(i,U),h=m(i,he);return function(p,y,w,S,T){return Cn(T)==="time"?_i(Re.fromEpochNsDiff(y,p),T):pl(vu(p,y,w,S,T),y,rn(w,p),w,S,T)}(h,yi(h,l,u,s),l,u,o)}if(r){let s=fn(this),l=$r({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,w,S,T){if(jr(y,w)==0)return 0;fr(y),fr(w);let x=yu(y,w,S,T);return T==="nanosecond"?k.default.toNumber(x.time.totalNs):pl(x,rt(w),y,null,S,T)}(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 _i(fn(this).time,o)}toString(t=void 0){R(this,Ye);let e=ie(t),r=qi(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}=Wi(o,r);if(s==="nanosecond"&&l===1)return Mo(this,a);let u=Tn(this),h=xr(this),p=No(h.time,l,s,i);return h=Rn(h.date,p),Mo(tn(h,In(u,"second")),a)}toJSON(){return R(this,Ye),Mo(this,"auto")}toLocaleString(t=void 0,e=void 0){if(R(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(){Qn("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,yt)===m(o,yt)&&m(i,vt)===m(o,vt)&&m(i,At)===m(o,At)&&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,Mt)===m(o,Mt)&&m(i,Lt)===m(o,Lt))return 0;let u=Tn(i),h=Tn(o),p=xr(i),y=xr(o);if(l&&(Cn(u)==="date"||Cn(h)==="date")){let $=m(l,ke),W=m(l,U),K=m(l,he),ee=yi(K,$,W,p),oe=yi(K,$,W,y);return Nt(k.default.toNumber(k.default.subtract(ee,oe)))}let w=p.date.days,S=y.date.days;if(mn(u)||mn(h)){if(!s)throw new RangeError("A starting point is required for years, months, or weeks comparison");w=ml(p.date,s),S=ml(y.date,s)}let T=p.time.add24HourDays(w),x=y.time.add24HourDays(S);return T.cmp(x)}};Hn(Hi,"Temporal.Duration");var Bi=class{constructor(t,e,r="iso8601",i=1972){let o=fe(t),a=fe(e),s=It(r===void 0?"iso8601":Ge(r)),l=fe(i);pr(l,o,a),ru(this,{year:l,month:o,day:a},s)}get monthCode(){return Pl(this,"monthCode")}get day(){return Pl(this,"day")}get calendarId(){return R(this,qt),m(this,U)}with(t,e=void 0){if(R(this,qt),!ze(t))throw new TypeError("invalid argument");Ur(t);let r=m(this,U),i=kt(r,m(this,me),"month-day");return i=mr(r,i,Jt(r,t,["year","month","monthCode","day"],[],"partial")),Lr(Ro(r,i,Ee(ie(e))),r)}equals(t){R(this,qt);let e=il(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),ll(this,Vi(ie(t)))}toJSON(){return R(this,qt),ll(this)}toLocaleString(t=void 0,e=void 0){return R(this,qt),new Gt(t,e).format(this)}valueOf(){Qn("PlainMonthDay")}toPlainDate(t){if(R(this,qt),!ze(t))throw new TypeError("argument should be an object");let e=m(this,U);return Tt(Zn(e,mr(e,kt(e,m(this,me),"month-day"),Jt(e,t,["year"],[],[])),"constrain"),e)}static from(t,e=void 0){return il(t,e)}};function Pl(n,t){R(n,qt);let e=m(n,me);return Gi(n).isoToDate(e,{[t]:!0})[t]}function Ja(n){return rn(n,ys())}Hn(Bi,"Temporal.PlainMonthDay");var Pu={instant:()=>sn(ys()),plainDateTimeISO:(n=ci())=>en(Ja(Ct(n)),"iso8601"),plainDateISO:(n=ci())=>Tt(Ja(Ct(n)).isoDate,"iso8601"),plainTimeISO:(n=ci())=>kn(Ja(Ct(n)).time),timeZoneId:()=>ci(),zonedDateTimeISO:(n=ci())=>{let t=Ct(n);return at(ys(),t,"iso8601")},[Symbol.toStringTag]:"Temporal.Now"};Object.defineProperty(Pu,Symbol.toStringTag,{value:"Temporal.Now",writable:!1,enumerable:!1,configurable:!0});var Fi=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),iu(this,{hour:s,minute:l,second:u,millisecond:h,microsecond:p,nanosecond:y})}get hour(){return R(this,Ue),m(this,je).hour}get minute(){return R(this,Ue),m(this,je).minute}get second(){return R(this,Ue),m(this,je).second}get millisecond(){return R(this,Ue),m(this,je).millisecond}get microsecond(){return R(this,Ue),m(this,je).microsecond}get nanosecond(){return R(this,Ue),m(this,je).nanosecond}with(t,e=void 0){if(R(this,Ue),!ze(t))throw new TypeError("invalid argument");Ur(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 R(this,Ue),Sl("add",this,t)}subtract(t){return R(this,Ue),Sl("subtract",this,t)}until(t,e=void 0){return R(this,Ue),vl("until",this,t,e)}since(t,e=void 0){return R(this,Ue),vl("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"?yr("smallestUnit",t):ie(t),r=Vr(e),i=ln(e,"halfExpand"),o=Ot(e,"smallestUnit","time",Ln);return qr(r,{hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o],!1),kn(fs(m(this,je),r,o,i))}equals(t){R(this,Ue);let e=Vn(t);return gs(m(this,je),m(e,je))===0}toString(t=void 0){R(this,Ue);let e=ie(t),r=qi(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}=Wi(o,r);return cl(fs(m(this,je),l,s,i),a)}toJSON(){return R(this,Ue),cl(m(this,je),"auto")}toLocaleString(t=void 0,e=void 0){return R(this,Ue),new Gt(t,e).format(this)}valueOf(){Qn("PlainTime")}static from(t,e=void 0){return Vn(t,e)}static compare(t,e){let r=Vn(t),i=Vn(e);return gs(m(r,je),m(i,je))}};Hn(Fi,"Temporal.PlainTime");var Yi=class{constructor(t,e,r="iso8601",i=1){let o=fe(t),a=fe(e),s=It(r===void 0?"iso8601":Ge(r)),l=fe(i);pr(o,a,l),ou(this,{year:o,month:a,day:l},s)}get year(){return Mn(this,"year")}get month(){return Mn(this,"month")}get monthCode(){return Mn(this,"monthCode")}get calendarId(){return R(this,nt),m(this,U)}get era(){return Mn(this,"era")}get eraYear(){return Mn(this,"eraYear")}get daysInMonth(){return Mn(this,"daysInMonth")}get daysInYear(){return Mn(this,"daysInYear")}get monthsInYear(){return Mn(this,"monthsInYear")}get inLeapYear(){return Mn(this,"inLeapYear")}with(t,e=void 0){if(R(this,nt),!ze(t))throw new TypeError("invalid argument");Ur(t);let r=m(this,U),i=kt(r,m(this,me),"year-month");return i=mr(r,i,Jt(r,t,["year","month","monthCode"],[],"partial")),Nr(Ci(r,i,Ee(ie(e))),r)}add(t,e=void 0){return R(this,nt),Tl("add",this,t,e)}subtract(t,e=void 0){return R(this,nt),Tl("subtract",this,t,e)}until(t,e=void 0){return R(this,nt),bl("until",this,t,e)}since(t,e=void 0){return R(this,nt),bl("since",this,t,e)}equals(t){R(this,nt);let e=fi(t);return bn(m(this,me),m(e,me))===0&&yn(m(this,U),m(e,U))}toString(t=void 0){return R(this,nt),ul(this,Vi(ie(t)))}toJSON(){return R(this,nt),ul(this)}toLocaleString(t=void 0,e=void 0){return R(this,nt),new Gt(t,e).format(this)}valueOf(){Qn("PlainYearMonth")}toPlainDate(t){if(R(this,nt),!ze(t))throw new TypeError("argument should be an object");let e=m(this,U);return Tt(Zn(e,mr(e,kt(e,m(this,me),"year-month"),Jt(e,t,["day"],[],[])),"constrain"),e)}static from(t,e=void 0){return fi(t,e)}static compare(t,e){let r=fi(t),i=fi(e);return bn(m(r,me),m(i,me))}};function Mn(n,t){R(n,nt);let e=m(n,me);return Gi(n).isoToDate(e,{[t]:!0})[t]}Hn(Yi,"Temporal.PlainYearMonth");var om=Gt.prototype.resolvedOptions,$i=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}=Wn(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);su(this,i,o,It(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 gt(this,"year")}get month(){return gt(this,"month")}get monthCode(){return gt(this,"monthCode")}get day(){return gt(this,"day")}get hour(){return Ir(this,"hour")}get minute(){return Ir(this,"minute")}get second(){return Ir(this,"second")}get millisecond(){return Ir(this,"millisecond")}get microsecond(){return Ir(this,"microsecond")}get nanosecond(){return Ir(this,"nanosecond")}get era(){return gt(this,"era")}get eraYear(){return gt(this,"eraYear")}get epochMilliseconds(){return R(this,be),on(m(this,he),"floor")}get epochNanoseconds(){return R(this,be),Eu(m(this,he))}get dayOfWeek(){return gt(this,"dayOfWeek")}get dayOfYear(){return gt(this,"dayOfYear")}get weekOfYear(){return gt(this,"weekOfYear")?.week}get yearOfWeek(){return gt(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=zn(t,e),o=zn(t,r);return _i(Re.fromEpochNsDiff(o,i),"hour")}get daysInWeek(){return gt(this,"daysInWeek")}get daysInMonth(){return gt(this,"daysInMonth")}get daysInYear(){return gt(this,"daysInYear")}get monthsInYear(){return gt(this,"monthsInYear")}get inLeapYear(){return gt(this,"inLeapYear")}get offset(){return R(this,be),cs(Pn(m(this,ke),m(this,he)))}get offsetNanoseconds(){return R(this,be),Pn(m(this,ke),m(this,he))}with(t,e=void 0){if(R(this,be),!ze(t))throw new TypeError("invalid zoned-date-time-like");Ur(t);let r=m(this,U),i=m(this,ke),o=Pn(i,m(this,he)),a=hn(this),s={...kt(r,a.isoDate),...a.time,offset:cs(o)};s=mr(r,s,Jt(r,t,["year","month","monthCode","day"],["hour","minute","second","millisecond","microsecond","nanosecond","offset"],"partial"));let l=ie(e),u=Ei(l),h=So(l,"prefer"),p=Ki(r,s,Ee(l)),y=Wr(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?zn(e,i):ct(e,Me(i,m(Vn(t),je)),"compatible"),at(o,e,r)}withTimeZone(t){R(this,be);let e=Ct(t);return at(m(this,he),e,m(this,U))}withCalendar(t){R(this,be);let e=Ji(t);return at(m(this,he),m(this,ke),e)}add(t,e=void 0){return R(this,be),Cl("add",this,t,e)}subtract(t,e=void 0){return R(this,be),Cl("subtract",this,t,e)}until(t,e=void 0){return R(this,be),wl("until",this,t,e)}since(t,e=void 0){return R(this,be),wl("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"?yr("smallestUnit",t):ie(t),r=Vr(e),i=ln(e,"halfExpand"),o=Ot(e,"smallestUnit","time",Ln,["day"]),a={day:1,hour:24,minute:60,second:60,millisecond:1e3,microsecond:1e3,nanosecond:1e3}[o];if(qr(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),w=zn(s,p),S=zn(s,y),T=k.default.subtract(S,w);h=Re.fromEpochNsDiff(l,w).round(T,i).addToEpochNs(w)}else{let p=ps(u,r,o,i),y=Pn(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=gi(t),r=m(this,he),i=m(e,he);return!!k.default.equal(k.default.BigInt(r),k.default.BigInt(i))&&!!cu(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=Vi(e),i=qi(e),o=function(y){return xn(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 xn(y,"timeZoneName",["auto","never","critical"],"auto")}(e),{precision:u,unit:h,increment:p}=Wi(s,i);return dl(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 w=0;w<y.length;w++){let S=y[w];if(!h.some(T=>Object.is(T,S))&&Object.prototype.propertyIsEnumerable.call(u,S)){let T=u[S];l[S]=T}}}(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),hl(i.timeZone))throw new RangeError("toLocaleString does not currently support offset time zones");let o=new Gt(t,i),a=om.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),dl(this,"auto")}valueOf(){Qn("ZonedDateTime")}startOfDay(){R(this,be);let t=m(this,ke);return at(zn(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=xn(typeof t=="string"?yr("direction",t):ie(t),"direction",["next","previous"],Ln);if(r===void 0)throw new TypeError("direction option is required");if(hl(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 R(this,be),sn(m(this,he))}toPlainDate(){return R(this,be),Tt(hn(this).isoDate,m(this,U))}toPlainTime(){return R(this,be),kn(hn(this).time)}toPlainDateTime(){return R(this,be),en(hn(this),m(this,U))}static from(t,e=void 0){return gi(t,e)}static compare(t,e){let r=gi(t),i=gi(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 gt(n,t){R(n,be);let e=hn(n).isoDate;return Gi(n).isoToDate(e,{[t]:!0})[t]}function Ir(n,t){return R(n,be),hn(n).time[t]}Hn($i,"Temporal.ZonedDateTime");var xe=Object.freeze({__proto__:null,Duration:Hi,Instant:Li,Now:Pu,PlainDate:Ni,PlainDateTime:Oi,PlainMonthDay:Bi,PlainTime:Fi,PlainYearMonth:Yi,ZonedDateTime:$i}),ip=class{toTemporalInstant(){return sn(cn(Date.prototype.valueOf.call(this)))}}.prototype.toTemporalInstant,am=[Li,Ni,Oi,Hi,Bi,Fi,Yi,$i];for(let n of am){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 sm=Object.prototype.hasOwnProperty,na=(n,t)=>sm.call(n,t),Er=Array.isArray,ro=n=>Ru(n)==="[object Map]";var Iu=n=>typeof n=="function",cm=n=>typeof n=="string",Kr=n=>typeof n=="symbol",io=n=>n!==null&&typeof n=="object";var lm=Object.prototype.toString,Ru=n=>lm.call(n),xu=n=>Ru(n).slice(8,-1);var ra=n=>cm(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))},um=/-(\w)/g,sp=ia(n=>n.replace(um,(t,e)=>e?e.toUpperCase():"")),dm=/\B([A-Z])/g,cp=ia(n=>n.replace(dm,"-$1").toLowerCase()),hm=ia(n=>n.charAt(0).toUpperCase()+n.slice(1)),lp=ia(n=>n?`on${hm(n)}`:""),_r=(n,t)=>!Object.is(n,t);var mm="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";var up=Js(mm+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var Qs;var Oe;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||Ou(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Au(this),Hu(this);let t=Oe,e=un;Oe=this,un=!0;try{return this.fn()}finally{Bu(this),Oe=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,Au(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)}},Nu=0,ao,so;function Ou(n,t=!1){if(n.flags|=8,t){n.next=so,so=n;return}n.next=ao,ao=n}function mc(){Nu++}function pc(){if(--Nu>0)return;if(so){let t=so;for(so=void 0;t;){let e=t.next;t.next=void 0,t.flags&=-9,t=e}}let n;for(;ao;){let t=ao;for(ao=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 Hu(n){for(let t=n.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Bu(n){let t,e=n.depsTail,r=e;for(;r;){let i=r.prevDep;r.version===-1?(r===e&&(e=i),fc(r),pm(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&&(Fu(t.dep.computed)||t.dep.version!==t.version))return!0;return!!n._dirty}function Fu(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===co)||(n.globalVersion=co,!n.isSSR&&n.flags&128&&(!n.deps&&!n._dirty||!rc(n))))return;n.flags|=2;let t=n.dep,e=Oe,r=un;Oe=n,un=!0;try{Hu(n);let i=n.fn(n._value);(t.version===0||_r(i,n._value))&&(n.flags|=128,n._value=i,t.version++)}catch(i){throw t.version++,i}finally{Oe=e,un=r,Bu(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 pm(n){let{prevDep:t,nextDep:e}=n;t&&(t.nextDep=e,n.prevDep=void 0),e&&(e.prevDep=t,n.nextDep=void 0)}function xt(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,Yu=[];function fm(){Yu.push(un),un=!1}function gm(){let n=Yu.pop();un=n===void 0?!0:n}function Au(n){let{cleanup:t}=n;if(n.cleanup=void 0,t){let e=Oe;Oe=void 0;try{t()}finally{Oe=e}}}var co=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}},lo=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(!Oe||!un||Oe===this.computed)return;let e=this.activeLink;if(e===void 0||e.sub!==Oe)e=this.activeLink=new ic(Oe,this),Oe.deps?(e.prevDep=Oe.depsTail,Oe.depsTail.nextDep=e,Oe.depsTail=e):Oe.deps=Oe.depsTail=e,$u(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=Oe.depsTail,e.nextDep=void 0,Oe.depsTail.nextDep=e,Oe.depsTail=e,Oe.deps===e&&(Oe.deps=r)}return e}trigger(t){this.version++,co++,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 $u(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)$u(r)}let e=n.dep.subs;e!==n&&(n.prevSub=e,e&&(e.nextSub=n)),n.dep.subs=n}}var oc=new WeakMap,Mr=Symbol(""),ac=Symbol(""),uo=Symbol("");function Ft(n,t,e){if(un&&Oe){let r=oc.get(n);r||oc.set(n,r=new Map);let i=r.get(e);i||(r.set(e,i=new lo),i.map=r,i.key=e),i.track()}}function er(n,t,e,r,i,o){let a=oc.get(n);if(!a){co++;return}let s=l=>{l&&l.trigger()};if(mc(),t==="clear")a.forEach(s);else{let l=Er(n),u=l&&ra(e);if(l&&e==="length"){let h=Number(r);a.forEach((p,y)=>{(y==="length"||y===uo||!Kr(y)&&y>=h)&&s(p)})}else switch((e!==void 0||a.has(void 0))&&s(a.get(e)),u&&s(a.get(uo)),t){case"add":l?u&&s(a.get("length")):(s(a.get(Mr)),ro(n)&&s(a.get(ac)));break;case"delete":l||(s(a.get(Mr)),ro(n)&&s(a.get(ac)));break;case"set":ro(n)&&s(a.get(Mr));break}}pc()}function Zr(n){let t=Le(n);return t===n?t:(Ft(t,"iterate",uo),tr(n)?t:t.map(Rt))}function gc(n){return Ft(n=Le(n),"iterate",uo),n}var ym={__proto__:null,[Symbol.iterator](){return tc(this,Symbol.iterator,Rt)},concat(...n){return Zr(this).concat(...n.map(t=>Er(t)?Zr(t):t))},entries(){return tc(this,"entries",n=>(n[1]=Rt(n[1]),n))},every(n,t){return Bn(this,"every",n,t,void 0,arguments)},filter(n,t){return Bn(this,"filter",n,t,e=>e.map(Rt),arguments)},find(n,t){return Bn(this,"find",n,t,Rt,arguments)},findIndex(n,t){return Bn(this,"findIndex",n,t,void 0,arguments)},findLast(n,t){return Bn(this,"findLast",n,t,Rt,arguments)},findLastIndex(n,t){return Bn(this,"findLastIndex",n,t,void 0,arguments)},forEach(n,t){return Bn(this,"forEach",n,t,void 0,arguments)},includes(...n){return nc(this,"includes",n)},indexOf(...n){return nc(this,"indexOf",n)},join(n){return Zr(this).join(n)},lastIndexOf(...n){return nc(this,"lastIndexOf",n)},map(n,t){return Bn(this,"map",n,t,void 0,arguments)},pop(){return oo(this,"pop")},push(...n){return oo(this,"push",n)},reduce(n,...t){return Lu(this,"reduce",n,t)},reduceRight(n,...t){return Lu(this,"reduceRight",n,t)},shift(){return oo(this,"shift")},some(n,t){return Bn(this,"some",n,t,void 0,arguments)},splice(...n){return oo(this,"splice",n)},toReversed(){return Zr(this).toReversed()},toSorted(n){return Zr(this).toSorted(n)},toSpliced(...n){return Zr(this).toSpliced(...n)},unshift(...n){return oo(this,"unshift",n)},values(){return tc(this,"values",Rt)}};function tc(n,t,e){let r=gc(n),i=r[t]();return r!==n&&!tr(n)&&(i._next=i.next,i.next=()=>{let o=i._next();return o.value&&(o.value=e(o.value)),o}),i}var vm=Array.prototype;function Bn(n,t,e,r,i,o){let a=gc(n),s=a!==n&&!tr(n),l=a[t];if(l!==vm[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 Lu(n,t,e,r){let i=gc(n),o=e;return i!==n&&(tr(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=Le(n);Ft(r,"iterate",uo);let i=r[t](...e);return(i===-1||i===!1)&&Rm(e[0])?(e[0]=Le(e[0]),r[t](...e)):i}function oo(n,t,e=[]){fm(),mc();let r=Le(n)[t].apply(n,e);return pc(),gm(),r}var bm=Js("__proto__,__v_isRef,__isVue"),ju=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(Kr));function wm(n){Kr(n)||(n=String(n));let t=Le(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?km:Vu:o?Cm:Uu).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;let a=Er(t);if(!i){let l;if(a&&(l=ym[e]))return l;if(e==="hasOwnProperty")return wm}let s=Reflect.get(t,e,Jr(t)?t:r);return(Kr(e)?ju.has(e):bm(e))||(i||Ft(t,"get",e),o)?s:Jr(s)?a&&ra(e)?s:s.value:io(s)?i?Qr(s):nr(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=Xr(o);if(!tr(r)&&!Xr(r)&&(o=Le(o),r=Le(r)),!Er(t)&&Jr(o)&&!Jr(r))return l?!1:(o.value=r,!0)}let a=Er(t)&&ra(e)?Number(e)<t.length:na(t,e),s=Reflect.set(t,e,r,Jr(t)?t:i);return t===Le(i)&&(a?_r(r,o)&&er(t,"set",e,r,o):er(t,"add",e,r)),s}deleteProperty(t,e){let r=na(t,e),i=t[e],o=Reflect.deleteProperty(t,e);return o&&r&&er(t,"delete",e,void 0,i),o}has(t,e){let r=Reflect.has(t,e);return(!Kr(e)||!ju.has(e))&&Ft(t,"has",e),r}ownKeys(t){return Ft(t,"iterate",Er(t)?"length":Mr),Reflect.ownKeys(t)}},cc=class extends ca{constructor(t=!1){super(!0,t)}set(t,e){return!0}deleteProperty(t,e){return!0}},Dm=new sc,Em=new cc;var lc=n=>n,oa=n=>Reflect.getPrototypeOf(n);function _m(n,t,e){return function(...r){let i=this.__v_raw,o=Le(i),a=ro(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:Mr),{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 Mm(n,t){let e={get(i){let o=this.__v_raw,a=Le(o),s=Le(i);n||(_r(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(Le(i),"iterate",Mr),Reflect.get(i,"size",i)},has(i){let o=this.__v_raw,a=Le(o),s=Le(i);return n||(_r(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=Le(s),u=t?lc:n?uc:Rt;return!n&&Ft(l,"iterate",Mr),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&&!tr(i)&&!Xr(i)&&(i=Le(i));let o=Le(this);return oa(o).has.call(o,i)||(o.add(i),er(o,"add",i,i)),this},set(i,o){!t&&!tr(o)&&!Xr(o)&&(o=Le(o));let a=Le(this),{has:s,get:l}=oa(a),u=s.call(a,i);u||(i=Le(i),u=s.call(a,i));let h=l.call(a,i);return a.set(i,o),u?_r(o,h)&&er(a,"set",i,o,h):er(a,"add",i,o),this},delete(i){let o=Le(this),{has:a,get:s}=oa(o),l=a.call(o,i);l||(i=Le(i),l=a.call(o,i));let u=s?s.call(o,i):void 0,h=o.delete(i);return l&&er(o,"delete",i,void 0,u),h},clear(){let i=Le(this),o=i.size!==0,a=void 0,s=i.clear();return o&&er(i,"clear",void 0,void 0,a),s}}),["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=_m(i,n,t)}),e}function zu(n,t){let e=Mm(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 Sm={get:zu(!1,!1)};var Tm={get:zu(!0,!1)};var Uu=new WeakMap,Cm=new WeakMap,Vu=new WeakMap,km=new WeakMap;function Pm(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Im(n){return n.__v_skip||!Object.isExtensible(n)?0:Pm(xu(n))}function nr(n){return Xr(n)?n:qu(n,!1,Dm,Sm,Uu)}function Qr(n){return qu(n,!0,Em,Tm,Vu)}function qu(n,t,e,r,i){if(!io(n)||n.__v_raw&&!(t&&n.__v_isReactive))return n;let o=Im(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 Xr(n){return!!(n&&n.__v_isReadonly)}function tr(n){return!!(n&&n.__v_isShallow)}function Rm(n){return n?!!n.__v_raw:!1}function Le(n){let t=n&&n.__v_raw;return t?Le(t):n}var Rt=n=>io(n)?nr(n):n,uc=n=>io(n)?Qr(n):n;function Jr(n){return n?n.__v_isRef===!0:!1}function Ze(n){return xm(n,!1)}function xm(n,t){return Jr(n)?n:new dc(n,t)}var dc=class{constructor(t,e){this.dep=new lo,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=e?t:Le(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||tr(t)||Xr(t);t=r?t:Le(t),_r(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 lo(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=co-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!e,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&Oe!==this)return Ou(this,!0),!0}get value(){let t=this.dep.track();return Fu(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 Iu(n)?r=n:(r=n.get,i=n.set),new hc(r,i,e)}var $c=Wc(Gu(),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 Je(n,t){la.emit(n,t)}function rr(n,t){Array.isArray(n)?n.forEach(e=>la.on(e,t)):la.on(n,t)}var Ku={en:{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",pricingProducts:"Products:",pricingProductsAndExtras:"Products & Extras:",pricingTaxes:"Taxes:",pricingSubtotal:"Subtotal:",pricingService:"service"},"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",pricingProducts:"Produits :",pricingProductsAndExtras:"Produits et options :",pricingTaxes:"Taxes :",pricingSubtotal:"Sous-total :",pricingService:"service"},de:{loading:"Laden...",night:"Nacht",chooseOption:"Option ausw\xE4hlen",apartment:"Apartment",total:"Gesamt",missingEnterpriseId:"Unternehmens-ID fehlt",missingCategoryId:"Kategorie-ID fehlt",minimumNights:"Mindestn\xE4chte",maximumNights:"Maximale N\xE4chte",booked:"Bereits gebucht",select:"Ausw\xE4hlen",fatalErrorMessage:"Hoppla! Ein unerwarteter Fehler ist aufgetreten. Bitte laden Sie die Seite neu oder kontaktieren Sie den Support.",pleaseWait:"Bitte warten...","chargingMode:Once":"Einmal","chargingMode:PerTimeUnit":"Pro Nacht","chargingMode:PerPersonPerTimeUnit":"Pro Person und Nacht",adults:"Erwachsene",children:"Kinder (0-18 Jahre)",guestSingular:"Person",guestPlural:"Personen",couponValid:"Gutschein ist g\xFCltig ;)",couponInvalid:"Gutschein ist ung\xFCltig!",couponError:"Fehler bei der Gutscheinpr\xFCfung!",proceedToPayment:"Zur Zahlung fortfahren",completePayment:"Zahlung abschlie\xDFen",viewHotelPage:"Website ansehen",pricingProducts:"Produkte:",pricingProductsAndExtras:"Produkte & Extras:",pricingTaxes:"Steuern:",pricingSubtotal:"Zwischensumme:",pricingService:"Service"},es:{loading:"Cargando...",night:"Noche",chooseOption:"Elige una opci\xF3n",apartment:"Apartamento",total:"Total",missingEnterpriseId:"Falta el ID de empresa",missingCategoryId:"Falta el ID de categor\xEDa",minimumNights:"noches m\xEDnimas",maximumNights:"noches m\xE1ximas",booked:"Ya reservado",select:"Seleccionar",fatalErrorMessage:"\xA1Ups! Ha ocurrido un error inesperado. Por favor, recarga la p\xE1gina o contacta con soporte.",pleaseWait:"Por favor espera...","chargingMode:Once":"Una vez","chargingMode:PerTimeUnit":"Por noche","chargingMode:PerPersonPerTimeUnit":"Por persona y noche",adults:"Adultos",children:"Ni\xF1os (0-18 a\xF1os)",guestSingular:"Persona",guestPlural:"Personas",couponValid:"El cup\xF3n es v\xE1lido ;)",couponInvalid:"\xA1El cup\xF3n no es v\xE1lido!",couponError:"Error al validar el cup\xF3n!",proceedToPayment:"Ir al pago",completePayment:"Completar el pago",viewHotelPage:"Ver el sitio",pricingProducts:"Productos:",pricingProductsAndExtras:"Productos y extras:",pricingTaxes:"Impuestos:",pricingSubtotal:"Subtotal:",pricingService:"servicio"},it:{loading:"Caricamento...",night:"Notte",chooseOption:"Scegli un\u2019opzione",apartment:"Appartamento",total:"Totale",missingEnterpriseId:"ID azienda mancante",missingCategoryId:"ID categoria mancante",minimumNights:"notti minime",maximumNights:"notti massime",booked:"Gi\xE0 prenotato",select:"Seleziona",fatalErrorMessage:"Ops! Si \xE8 verificato un errore imprevisto. Ricarica la pagina o contatta il supporto.",pleaseWait:"Attendere prego...","chargingMode:Once":"Una volta","chargingMode:PerTimeUnit":"Per notte","chargingMode:PerPersonPerTimeUnit":"Per persona a notte",adults:"Adulti",children:"Bambini (0-18 anni)",guestSingular:"Persona",guestPlural:"Persone",couponValid:"Il coupon \xE8 valido ;)",couponInvalid:"Il coupon non \xE8 valido!",couponError:"Errore durante la verifica del coupon!",proceedToPayment:"Procedi al pagamento",completePayment:"Completa il pagamento",viewHotelPage:"Vedi il sito",pricingProducts:"Prodotti:",pricingProductsAndExtras:"Prodotti ed extra:",pricingTaxes:"Tasse:",pricingSubtotal:"Subtotale:",pricingService:"servizio"},pt:{loading:"A carregar...",night:"Noite",chooseOption:"Escolha uma op\xE7\xE3o",apartment:"Apartamento",total:"Total",missingEnterpriseId:"ID da empresa em falta",missingCategoryId:"ID da categoria em falta",minimumNights:"noites m\xEDnimas",maximumNights:"noites m\xE1ximas",booked:"J\xE1 reservado",select:"Selecionar",fatalErrorMessage:"Ops! Ocorreu um erro inesperado. Por favor, recarregue a p\xE1gina ou contacte o suporte.",pleaseWait:"Por favor, aguarde...","chargingMode:Once":"Uma vez","chargingMode:PerTimeUnit":"Por noite","chargingMode:PerPersonPerTimeUnit":"Por pessoa por noite",adults:"Adultos",children:"Crian\xE7as (0-18 anos)",guestSingular:"Pessoa",guestPlural:"Pessoas",couponValid:"O cup\xE3o \xE9 v\xE1lido ;)",couponInvalid:"O cup\xE3o \xE9 inv\xE1lido!",couponError:"Erro ao validar o cup\xE3o!",proceedToPayment:"Prosseguir para pagamento",completePayment:"Concluir pagamento",viewHotelPage:"Ver site",pricingProducts:"Produtos:",pricingProductsAndExtras:"Produtos e extras:",pricingTaxes:"Impostos:",pricingSubtotal:"Subtotal:",pricingService:"servi\xE7o"},zh:{loading:"\u52A0\u8F7D\u4E2D...",night:"\u665A",chooseOption:"\u8BF7\u9009\u62E9\u4E00\u4E2A\u9009\u9879",apartment:"\u516C\u5BD3",total:"\u603B\u8BA1",missingEnterpriseId:"\u7F3A\u5C11\u4F01\u4E1AID",missingCategoryId:"\u7F3A\u5C11\u7C7B\u522BID",minimumNights:"\u6700\u5C11\u5165\u4F4F\u665A\u6570",maximumNights:"\u6700\u591A\u5165\u4F4F\u665A\u6570",booked:"\u5DF2\u9884\u8BA2",select:"\u9009\u62E9",fatalErrorMessage:"\u7CDF\u7CD5\uFF01\u53D1\u751F\u4E86\u610F\u5916\u9519\u8BEF\u3002\u8BF7\u5237\u65B0\u9875\u9762\u6216\u8054\u7CFB\u652F\u6301\u3002",pleaseWait:"\u8BF7\u7A0D\u5019...","chargingMode:Once":"\u4E00\u6B21","chargingMode:PerTimeUnit":"\u6BCF\u665A","chargingMode:PerPersonPerTimeUnit":"\u6BCF\u4EBA\u6BCF\u665A",adults:"\u6210\u4EBA",children:"\u513F\u7AE5\uFF080-18\u5C81\uFF09",guestSingular:"\u4EBA",guestPlural:"\u4EBA",couponValid:"\u4F18\u60E0\u5238\u6709\u6548 ;)",couponInvalid:"\u4F18\u60E0\u5238\u65E0\u6548\uFF01",couponError:"\u9A8C\u8BC1\u4F18\u60E0\u5238\u65F6\u51FA\u9519\uFF01",proceedToPayment:"\u524D\u5F80\u652F\u4ED8",completePayment:"\u5B8C\u6210\u652F\u4ED8",viewHotelPage:"\u67E5\u770B\u7F51\u7AD9",pricingProducts:"\u4EA7\u54C1\uFF1A",pricingProductsAndExtras:"\u4EA7\u54C1\u53CA\u9644\u52A0\u9879\uFF1A",pricingTaxes:"\u7A0E\u8D39\uFF1A",pricingSubtotal:"\u5C0F\u8BA1\uFF1A",pricingService:"\u670D\u52A1"},ar:{loading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644...",night:"\u0644\u064A\u0644\u0629",chooseOption:"\u0627\u062E\u062A\u0631 \u062E\u064A\u0627\u0631\u064B\u0627",apartment:"\u0634\u0642\u0629",total:"\u0627\u0644\u0625\u062C\u0645\u0627\u0644\u064A",missingEnterpriseId:"\u0645\u0639\u0631\u0651\u0641 \u0627\u0644\u0634\u0631\u0643\u0629 \u0645\u0641\u0642\u0648\u062F",missingCategoryId:"\u0645\u0639\u0631\u0651\u0641 \u0627\u0644\u0641\u0626\u0629 \u0645\u0641\u0642\u0648\u062F",minimumNights:"\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u062F\u0646\u0649 \u0644\u0639\u062F\u062F \u0627\u0644\u0644\u064A\u0627\u0644\u064A",maximumNights:"\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0639\u062F\u062F \u0627\u0644\u0644\u064A\u0627\u0644\u064A",booked:"\u0645\u062D\u062C\u0648\u0632 \u0628\u0627\u0644\u0641\u0639\u0644",select:"\u0627\u062E\u062A\u064A\u0627\u0631",fatalErrorMessage:"\u0639\u0630\u0631\u064B\u0627! \u062D\u062F\u062B \u062E\u0637\u0623 \u063A\u064A\u0631 \u0645\u062A\u0648\u0642\u0639. \u064A\u0631\u062C\u0649 \u0625\u0639\u0627\u062F\u0629 \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0635\u0641\u062D\u0629 \u0623\u0648 \u0627\u0644\u0627\u062A\u0635\u0627\u0644 \u0628\u0627\u0644\u062F\u0639\u0645.",pleaseWait:"\u064A\u0631\u062C\u0649 \u0627\u0644\u0627\u0646\u062A\u0638\u0627\u0631...","chargingMode:Once":"\u0645\u0631\u0629 \u0648\u0627\u062D\u062F\u0629","chargingMode:PerTimeUnit":"\u0644\u0643\u0644 \u0644\u064A\u0644\u0629","chargingMode:PerPersonPerTimeUnit":"\u0644\u0643\u0644 \u0634\u062E\u0635 \u0641\u064A \u0627\u0644\u0644\u064A\u0644\u0629",adults:"\u0627\u0644\u0628\u0627\u0644\u063A\u0648\u0646",children:"\u0627\u0644\u0623\u0637\u0641\u0627\u0644 (0-18 \u0633\u0646\u0629)",guestSingular:"\u0634\u062E\u0635",guestPlural:"\u0623\u0634\u062E\u0627\u0635",couponValid:"\u0627\u0644\u0642\u0633\u064A\u0645\u0629 \u0635\u0627\u0644\u062D\u0629 ;)",couponInvalid:"\u0627\u0644\u0642\u0633\u064A\u0645\u0629 \u063A\u064A\u0631 \u0635\u0627\u0644\u062D\u0629!",couponError:"\u062E\u0637\u0623 \u0641\u064A \u0627\u0644\u062A\u062D\u0642\u0642 \u0645\u0646 \u0627\u0644\u0642\u0633\u064A\u0645\u0629!",proceedToPayment:"\u0627\u0644\u0645\u062A\u0627\u0628\u0639\u0629 \u0625\u0644\u0649 \u0627\u0644\u062F\u0641\u0639",completePayment:"\u0625\u062A\u0645\u0627\u0645 \u0627\u0644\u062F\u0641\u0639",viewHotelPage:"\u0639\u0631\u0636 \u0627\u0644\u0645\u0648\u0642\u0639",pricingProducts:"\u0627\u0644\u0645\u0646\u062A\u062C\u0627\u062A:",pricingProductsAndExtras:"\u0627\u0644\u0645\u0646\u062A\u062C\u0627\u062A \u0648\u0627\u0644\u0625\u0636\u0627\u0641\u0627\u062A:",pricingTaxes:"\u0627\u0644\u0636\u0631\u0627\u0626\u0628:",pricingSubtotal:"\u0627\u0644\u0645\u062C\u0645\u0648\u0639 \u0627\u0644\u0641\u0631\u0639\u064A:",pricingService:"\u0627\u0644\u062E\u062F\u0645\u0629"},ru:{loading:"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430...",night:"\u041D\u043E\u0447\u044C",chooseOption:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u0430\u0440\u0438\u0430\u043D\u0442",apartment:"\u0410\u043F\u0430\u0440\u0442\u0430\u043C\u0435\u043D\u0442\u044B",total:"\u0418\u0442\u043E\u0433\u043E",missingEnterpriseId:"\u041E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 ID \u043A\u043E\u043C\u043F\u0430\u043D\u0438\u0438",missingCategoryId:"\u041E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 ID \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u0438",minimumNights:"\u043C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043D\u043E\u0447\u0435\u0439",maximumNights:"\u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043D\u043E\u0447\u0435\u0439",booked:"\u0423\u0436\u0435 \u0437\u0430\u0431\u0440\u043E\u043D\u0438\u0440\u043E\u0432\u0430\u043D\u043E",select:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C",fatalErrorMessage:"\u0423\u043F\u0441! \u041F\u0440\u043E\u0438\u0437\u043E\u0448\u043B\u0430 \u043D\u0435\u043F\u0440\u0435\u0434\u0432\u0438\u0434\u0435\u043D\u043D\u0430\u044F \u043E\u0448\u0438\u0431\u043A\u0430. \u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u043F\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443 \u0438\u043B\u0438 \u0441\u0432\u044F\u0436\u0438\u0442\u0435\u0441\u044C \u0441 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u043A\u043E\u0439.",pleaseWait:"\u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u043F\u043E\u0434\u043E\u0436\u0434\u0438\u0442\u0435...","chargingMode:Once":"\u041E\u0434\u0438\u043D \u0440\u0430\u0437","chargingMode:PerTimeUnit":"\u0417\u0430 \u043D\u043E\u0447\u044C","chargingMode:PerPersonPerTimeUnit":"\u0417\u0430 \u0447\u0435\u043B\u043E\u0432\u0435\u043A\u0430 \u0437\u0430 \u043D\u043E\u0447\u044C",adults:"\u0412\u0437\u0440\u043E\u0441\u043B\u044B\u0435",children:"\u0414\u0435\u0442\u0438 (0-18 \u043B\u0435\u0442)",guestSingular:"\u0427\u0435\u043B\u043E\u0432\u0435\u043A",guestPlural:"\u041B\u044E\u0434\u0438",couponValid:"\u041A\u0443\u043F\u043E\u043D \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043B\u0435\u043D ;)",couponInvalid:"\u041A\u0443\u043F\u043E\u043D \u043D\u0435\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043B\u0435\u043D!",couponError:"\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438 \u043A\u0443\u043F\u043E\u043D\u0430!",proceedToPayment:"\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043A \u043E\u043F\u043B\u0430\u0442\u0435",completePayment:"\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044C \u043E\u043F\u043B\u0430\u0442\u0443",viewHotelPage:"\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043D\u0430 \u0441\u0430\u0439\u0442",pricingProducts:"\u0422\u043E\u0432\u0430\u0440\u044B:",pricingProductsAndExtras:"\u0422\u043E\u0432\u0430\u0440\u044B \u0438 \u0434\u043E\u043F. \u0443\u0441\u043B\u0443\u0433\u0438:",pricingTaxes:"\u041D\u0430\u043B\u043E\u0433\u0438:",pricingSubtotal:"\u041F\u0440\u043E\u043C\u0435\u0436\u0443\u0442\u043E\u0447\u043D\u044B\u0439 \u0438\u0442\u043E\u0433:",pricingService:"\u0443\u0441\u043B\u0443\u0433\u0430"}},vc={en:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"fr-FR":["janv.","f\xE9vr.","mars","avr.","mai","juin","juil.","ao\xFBt","sept.","oct.","nov.","d\xE9c."],de:["Jan.","Feb.","M\xE4rz","Apr.","Mai","Juni","Juli","Aug.","Sept.","Okt.","Nov.","Dez."],es:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sept.","oct.","nov.","dic."],it:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],pt:["jan.","fev.","mar.","abr.","mai.","jun.","jul.","ago.","set.","out.","nov.","dez."],zh:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],ar:["\u064A\u0646\u0627\u064A\u0631","\u0641\u0628\u0631\u0627\u064A\u0631","\u0645\u0627\u0631\u0633","\u0623\u0628\u0631\u064A\u0644","\u0645\u0627\u064A\u0648","\u064A\u0648\u0646\u064A\u0648","\u064A\u0648\u0644\u064A\u0648","\u0623\u063A\u0633\u0637\u0633","\u0633\u0628\u062A\u0645\u0628\u0631","\u0623\u0643\u062A\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062F\u064A\u0633\u0645\u0628\u0631"],ru:["\u044F\u043D\u0432.","\u0444\u0435\u0432\u0440.","\u043C\u0430\u0440\u0442","\u0430\u043F\u0440.","\u043C\u0430\u0439","\u0438\u044E\u043D\u044C","\u0438\u044E\u043B\u044C","\u0430\u0432\u0433.","\u0441\u0435\u043D\u0442.","\u043E\u043A\u0442.","\u043D\u043E\u044F\u0431.","\u0434\u0435\u043A."]},Ju=()=>{let n=Dn().bcp47,t=n.split("-")[0],e=[n,t,"en"];for(let r of e)if(r in vc)return vc[r];return vc.en},Zu=(n,t)=>{for(let e of t){let r=n[e];if(typeof r=="string"&&r.trim()!=="")return r}},Lm=n=>{let t=[],e=o=>{o&&!t.includes(o)&&t.push(o)};e(n);let r=n.split("-")[0];return r&&r!==n&&e(r),({en:["en-US","en-GB"],es:["es-ES","es-MX","es-419"],de:["de-DE","de-AT","de-CH"],it:["it-IT","it-CH"],pt:["pt-PT","pt-BR"],zh:["zh-CN","zh-TW","zh-Hans","zh-Hant"],ar:["ar-SA","ar-EG"],ru:["ru-RU"],fr:["fr-FR","fr-CA","fr-BE","fr"]}[r]??[]).forEach(e),e("en-US"),e("en"),e("fr-FR"),e("fr"),t},Pe=n=>Ku[Dn().bcp47][n]||Ku["fr-FR"][n],Xe=n=>{let t=Dn().bcp47,e=t.split("-")[0],r=Zu(n,Lm(t));if(r!==void 0)return r;if(e){let a=Object.entries(n).find(([s])=>s===e||s.startsWith(`${e}-`));if(a&&a[1].trim()!=="")return a[1]}let i=Zu(n,["en-US","en","fr-FR","fr"]);if(i!==void 0)return i;let o=Object.values(n).find(a=>typeof a=="string"&&a.trim()!=="");return o!==void 0?o:(console.warn(`Translation [${t}] not found and no fallback strings were available.`,n),"")};var Nm={en:"en-US",fr:"fr-FR",de:"de-DE",es:"es-ES",it:"it-IT",pt:"pt-PT",zh:"zh-CN",ru:"ru-RU",ar:"en-US"},Xu=n=>Nm[n]||"fr-FR",Dn=()=>{let n=document.documentElement.lang.toLowerCase(),t={iso639:"fr",bcp47:"fr-FR"},r=Object.entries({en:{iso639:"en",bcp47:"en"},fr:{iso639:"fr",bcp47:"fr-FR"},de:{iso639:"de",bcp47:"de"},es:{iso639:"es",bcp47:"es"},it:{iso639:"it",bcp47:"it"},pt:{iso639:"pt",bcp47:"pt"},zh:{iso639:"zh",bcp47:"zh"},ar:{iso639:"ar",bcp47:"ar"},ru:{iso639:"ru",bcp47:"ru"}}).find(([i])=>n.startsWith(i))?.[1];return r&&(t=r),t},qe=Dn().bcp47,Pp=Dn().iso639;var J=class n{static getCurrentDate(){return xe.Now.plainDateISO()}static fromString(t){return xe.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"?xe.PlainDate.from(t):xe.PlainDate.from(t)).toZonedDateTime({timeZone:"Europe/Paris",plainTime:xe.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 xe.PlainDate.compare(t,e)>0}static isAfterOrEqual(t,e){return xe.PlainDate.compare(t,e)<0}static isSameDate(t,e){return xe.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 xe.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 xe.PlainDate.from(e)}return xe.PlainDate.from(t)}catch(e){return console.error("Error parsing date string:",e),n.getCurrentDate()}}};var Bp=localStorage.getItem("dev")==="true";var Fp=3*60*60*1e3;var ua="calendar-day-price",Qu="DD/MM/YYYY",ed="Y-m-d",td=!1,Om=365,bc=J.getCurrentDate(),nd=J.addDays(bc,Om),Sr=J.getCurrentDate(),ei=J.addDays(Sr,3),Hm=J.getCurrentDate(),Yp=J.addDays(Hm,30);function ir(n=!0,t=document.body){t.querySelectorAll('[data-fs-element="preloader"]').forEach(r=>{r.classList.toggle("hide",!n)})}var da="data-fs-element";var G=(n,t=document)=>t.querySelector(`[${da}="${n}"]`);var rd=n=>`[${da}="${n.getAttribute(da)}"]`,id=n=>n.getAttribute(da);var wc=class{constructor(){L(this,"state",nr({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}},df=new wc;var Tr={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)),Tr.touch()}catch(e){console.error(`Error writing to localStorage for key ${n}:`,e)}},update:(n,t)=>{let e=Tr.get(n),r=t(e);Tr.set(n,r)},remove:n=>{localStorage.removeItem(n),Tr.touch()},clear:()=>{localStorage.clear()},has:n=>localStorage.getItem(n)!==null,touch:()=>{localStorage.setItem("lastUpdater",Fm()||"root")}},Fm=()=>localStorage.getItem("lastUpdater");var ha=n=>{let t=new Date;return t.setDate(t.getDate()+n),t.toISOString().split("T")[0]},or=Tr.get("form_state"),od=or?{enterpriseId:or.enterpriseId||"",startDate:or.startDate||ha(45),endDate:or.endDate||ha(48),guests:or.guests||2,coupon:or.coupon||"",referrer:or.referrer||window.location.href,rooms:or.rooms||0}:{enterpriseId:"",startDate:ha(45),endDate:ha(48),guests:2,coupon:"",referrer:window.location.href,rooms:0},Yt=nr(od),Bm=Qr(od);xt(()=>{Tr.set("form_state",Yt)});var Ym="https://yuna-backend.cbocher.workers.dev/mews",$m="https://api.mews.com/api/distributor/v1",jm="Yuna",zm="mewscache",Um=!1,Vm=13,qm=8,Wm=xe.Duration.from({minutes:20}).milliseconds,Gm=new Headers({Accept:"application/json, text/plain, */*","Content-Type":"application/json; charset=utf-8"}),le={base_url:Ym,bookingEngine_url:$m,bookingEngineClient:jm,bypassCache:Um,headers:Gm,cache_key:zm,ttl:Wm,beCheckInUTC:Vm,beCheckOutUTC:qm};var ma=(n,t,e)=>`${n}:${t}:${JSON.stringify(e)}`;var ti=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:le.ttl,p=xe.Instant.fromEpochMilliseconds(u.timestamp);if(xe.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:xe.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:xe.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=xe.Now.instant().epochMilliseconds-le.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((w,S)=>{let T=a.delete(y.cacheKey);T.onsuccess=()=>w(),T.onerror=()=>S(T.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 Fn=async(n,t,e=null,r=xe.Duration.from({minutes:10}).milliseconds)=>{let i=new ti,o=ma(`booking-engine:${n}`,e||"null",t.body);if(!le.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 ad=async n=>{let t=`${le.bookingEngine_url}/hotels/get`,e={Client:le.bookingEngineClient,HotelId:n},r={method:"POST",headers:le.headers,body:JSON.stringify(e)};return Fn(t,r,n)};var pa=(n,t)=>{let e=`${le.bookingEngine_url}/reservations/getPricing`,r={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Fn(e,r,n)};var sd=(n,t)=>{let e=`${le.bookingEngine_url}/services/getAvailability`,r={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Fn(e,r,n)},cd=(n,t)=>{let e=`${le.bookingEngine_url}/services/getPricing`,r={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Fn(e,r,n)};var Qe=async(n,t,e=null,r=!1)=>{let i=new ti,o=ma(n,e||"null",t.body);if(!le.bypassCache){let a=await i.get(o);if(a)return a}try{let a=new URL(le.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 ld=(n,t={})=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/services/getAll",e,n)};function ud(n){return n.Services.map(t=>({id:t.Id,enterpriseId:t.EnterpriseId,isActive:t.IsActive,name:Xe(t.Names),startTime:t.StartTime,endTime:t.EndTime,type:t.Type,ordering:t.Ordering}))}var Dc=Ze({});async function dd(n){if(Dc.value[n])return Dc.value[n];let t=await ld(n),e=ud(t);return Dc.value[n]=e,e}var hd=(n,t)=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/ageCategories/getAll",e,n)};function md(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:Xe(t.Names),shortName:t.ShortNames?Xe(t.ShortNames):null,classification:t.Classification,isActive:t.IsActive,maximalAge:t.MaximalAge,minimalAge:t.MinimalAge,serviceId:t.ServiceId}))}var Ec=Ze({});async function pd(n){if(Ec.value[n])return Ec.value[n];let t=await hd(n,{EnterpriseIds:[n]}),e=md(t);return Ec.value[n]=e,e}var fd=(n,t)=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/products/getAll",e,n)};function gd(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 yd(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 vd(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:Xe(t.Names),shortName:t.ShortName,description:Xe(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 _c(n){return{id:n.Id,serviceId:n.ServiceId,categoryId:n.CategoryId,isActive:n.IsActive,isDefault:n.IsDefault,name:Xe(n.Names),shortName:Xe(n.ShortNames),description:Xe(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 bd(n){return{products:ho(n.Products,_c),customerProducts:ho(n.CustomerProducts,_c)}}var Mc=Ze({});async function wd(n,t){if(Mc.value[t])return Mc.value[t];let e=await fd(n,{ServiceIds:[t]}),r=bd(e);return Mc.value[t]=r,r}var Dd=(n,t={})=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/rates/getAll",e,n)};var Sc=Ze({});async function fa(n,t){if(Sc.value[t])return Sc.value[t];let e=await Dd(n,{ServiceIds:[t]}),r=vd(e);return Sc.value[t]=r,r}var Ed=(n,t)=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/services/getAvailability",e,n)};function _d(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 Md(n,t,e,r){if(Tc.value[t])return Tc.value[t];let i=await Ed(n,{ServiceId:t,FirstTimeUnitStartUtc:J.formatForAPI(e),LastTimeUnitStartUtc:J.formatForAPI(r)}),o=_d(i);return Tc.value[t]=o,o}var Sd=(n,t)=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/restrictions/getAll",e,n)};function Td(n){if(!n||!n.Restrictions||!Array.isArray(n.Restrictions))throw new Error("Invalid service restrictions response format");return n.Restrictions}var Cc=Ze({});async function Cd(n,t,e,r){if(Cc.value[t])return Cc.value[t];let i=await Sd(n,{ServiceIds:[t],CollidingUtc:{StartUtc:J.formatForAPI(e),EndUtc:J.formatForAPI(r)},Origin:"User"}),o=Td(i);return Cc.value[t]=o,o}var kd=(n,t)=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/rules/getAll",e,n)};function Pd(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 kc=Ze({});async function Id(n,t){if(kc.value[t])return kc.value[t];let e=await kd(n,{ServiceIds:[t],Extent:{RuleActions:!0}}),r=Pd(e);return kc.value[t]=r,r}var Rd=(n,t)=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/rates/getPricing",e,n)};var Pc=Ze({});async function xd(n,t,e,r){if(Pc.value[t])return Pc.value[t];let i=await Rd(n,{RateId:t,FirstTimeUnitStartUtc:J.formatForAPI(e),LastTimeUnitStartUtc:J.formatForAPI(r)}),o=gd(i);return Pc.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 xd(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 Md(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 Cd(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 wd(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 Id(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 pd(this.enterprise.getEnterpriseId()),this.ageCategories}getAgeCategories(){if(this.ageCategories.length===0)throw new Error("Age categories are not initialized");return this.ageCategories}};var ni=class{constructor(t){L(this,"enterpriseId");L(this,"services",[]);L(this,"reservableService",null);this.enterpriseId=t}async initServices(){this.services=await dd(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 N,Ie,En,ar,Ic=class{constructor(){_o(this,En);_o(this,N,nr({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(()=>!C(this,N).startDate||!C(this,N).endDate?0:C(this,N).startDate.until(C(this,N).endDate).days),selectedProducts:Xt(()=>C(this,N).products.filter(t=>t.selected)),maxAllowedRooms:Xt(()=>{if(!C(this,N).availabilities)return 0;let{categoryId:t}=C(this,N).cmsApartmentData,e=C(this,N).availabilities.CategoryAvailabilities.find(i=>i.CategoryId===t);return e?Math.min(...e.Availabilities.slice(0,-1)):0}),rates:Xt(()=>C(this,N).servicePricing?.Rates?C(this,N).servicePricing.Rates.map(t=>{let e=C(this,N).servicePricing?.RateGroups?.find(o=>o.Id===t.RateGroupId),i=C(this,N).servicePricing?.CategoryPrices.find(o=>o.CategoryId===C(this,N).cmsApartmentData.categoryId)?.OccupancyPrices.find(o=>{let a=C(this,N).rooms.flat(),s=Object.groupBy(a,u=>u.ageCategoryId),l={};return Object.entries(s).map(([u,h])=>{let p=h?.reduce((y,w)=>y+w.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:Xe(t.Name),description:Xe(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=C(this,N).reservationPricing?.OccupancyPrices??[],e=C(this,N).serviceOnlyPricing?.OccupancyPrices??[],r=C(this,N).cmsApartmentData?.name??"",{rooms:i}=C(this,N),o="EUR";if(C(this,N).isFetching||t.length===0||e.length===0)return{currency:o,nightCount:C(this,Ie).nightsCount.value,items:[],totals:{service:0,products:0,taxes:0,grandTotal:0}};let a=new Map;for(let w of e){let S=w.Pricing.find($=>$.RateId===C(this,N).selectedRateId);if(!S)continue;let x=S.Price.TotalAmount[o].Breakdown.Items.filter($=>$.TaxRateCode==="FR-R").reduce(($,W)=>$+W.NetValue,0);a.set(`${w.AdultCount}-${w.ChildCount}`,x)}let s=new Map;for(let w of t){let S=w.Pricing.find(ae=>ae.RateId===C(this,N).selectedRateId);if(!S)continue;let T=`${w.AdultCount}-${w.ChildCount}`,x=S.Price.TotalAmount[o],$=a.get(T)??0,W=C(this,Ie).nightsCount.value||1,K=$/W,ee=x.TaxValues.filter(ae=>ae.TaxRateCode==="FR-R").reduce((ae,Ce)=>ae+Ce.Value,0),oe=x.GrossValue-$-ee;s.set(T,{rateId:S.RateId,pricing:{avgPerNight:K,service:$,products:oe,taxes:ee,subtotal:x.GrossValue}})}let l=new Map;for(let w of i){let S=0,T=0;for(let $ of w)$.isAdult?S+=$.value:T+=$.value;let x=`${S}-${T}`;l.has(x)?l.get(x).quantity+=1:l.set(x,{adults:S,children:T,quantity:1})}if(!Array.from(l.keys()).every(w=>s.has(w)))return{currency:o,nightCount:C(this,Ie).nightsCount.value,items:[],totals:{service:0,products:0,taxes:0,grandTotal:0}};let p=Array.from(l.values()).map(w=>{let S=`${w.adults}-${w.children}`,T=s.get(S);return T?{key:S,roomName:r,occupancy:{adults:w.adults,children:w.children},quantity:w.quantity,rateId:T.rateId,pricing:T.pricing}:(console.warn(`[BookingState] Pricing not yet available for occupancy ${S}`,{availableOccupancies:Array.from(s.keys()),selectedRateId:C(this,N).selectedRateId,occupancyPricesCount:t.length}),{key:S,roomName:r,occupancy:{adults:w.adults,children:w.children},quantity:w.quantity,rateId:C(this,N).selectedRateId||"",pricing:{avgPerNight:0,service:0,products:0,taxes:0,subtotal:0}})}),y=p.reduce((w,S)=>(w.service+=S.pricing.service*S.quantity,w.products+=S.pricing.products*S.quantity,w.taxes+=S.pricing.taxes*S.quantity,w.grandTotal+=S.pricing.subtotal*S.quantity,w),{service:0,products:0,taxes:0,grandTotal:0});return{currency:o,nightCount:C(this,Ie).nightsCount.value,items:p,totals:y}}),totalStayPrice:Xt(()=>{let t=C(this,Ie).rates.value.find(e=>e.id===C(this,N).selectedRateId)?.price;return t?t.TotalAmount.GrossValue:0}),adultsCount:Xt(()=>C(this,N).rooms.reduce((t,e)=>t+e.reduce((r,i)=>r+(i.isAdult?i.value:0),0),0)),childrenCount:Xt(()=>C(this,N).rooms.reduce((t,e)=>t+e.reduce((r,i)=>r+(i.isAdult?0:i.value),0),0)),isAvailable:Xt(()=>{if(!C(this,N).availabilities)return!1;let{categoryId:t}=C(this,N).cmsApartmentData,e=C(this,N).availabilities.CategoryAvailabilities.find(r=>r.CategoryId===t);return e?e.Availabilities.slice(0,-1).every(r=>r>0):!1}),productsTotalPrice:Xt(()=>C(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*C(this,Ie).nightsCount.value||0;break;case"PerPersonPerTimeUnit":i=r.price*C(this,Ie).nightsCount.value*C(this,Ie).adultsCount.value||0;break;default:i=r.price}return e+i},0)),totalPrice:Xt(()=>C(this,Ie).totalStayPrice.value+C(this,Ie).productsTotalPrice.value),restrictionMessage:Xt(()=>{if(!C(this,N).availabilities)return null;let t=C(this,N).availabilities.ApplicableRestrictions??[];if(t.length===0)return null;let e=C(this,Ie).nightsCount.value;if(e<1)return`1 ${Pe("minimumNights")}`;let r=i=>{if(!i)return null;try{return xe.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} ${Pe("minimumNights")}`;let l=r(o.MaxLength);if(l!==null&&e>l)return`${l} ${Pe("maximumNights")}`}return null})})}get startDate(){return C(this,N).startDate}get endDate(){return C(this,N).endDate}get rooms(){return C(this,N).rooms}get couponCode(){return C(this,N).couponCode}get hotel(){return C(this,N).hotel}get availabilities(){return C(this,N).availabilities}get rates(){return C(this,N).rates}get servicePricing(){return C(this,N).servicePricing}get reservationPricing(){return C(this,N).reservationPricing}get ageCategories(){return C(this,N).ageCategories}get products(){return C(this,N).products}get selectedRateId(){return C(this,N).selectedRateId}get be_pricing(){return C(this,N).be_pricing}get cmsApartmentData(){return C(this,N).cmsApartmentData}get enterpriseInstance(){return C(this,N).enterpriseInstance}get reservableService(){return C(this,N).reservableService}get isFetching(){return C(this,N).isFetching}get nightsCount(){return C(this,Ie).nightsCount.value}get selectedProducts(){return C(this,Ie).selectedProducts.value}get maxAllowedRooms(){return C(this,Ie).maxAllowedRooms.value}get computedRates(){return C(this,Ie).rates.value}get computedSummary(){return C(this,Ie).summary.value}get totalStayPrice(){return C(this,Ie).totalStayPrice.value}get adultsCount(){return C(this,Ie).adultsCount.value}get childrenCount(){return C(this,Ie).childrenCount.value}get isAvailable(){return C(this,Ie).isAvailable.value}get productsTotalPrice(){return C(this,Ie).productsTotalPrice.value}get totalPrice(){return C(this,Ie).totalPrice.value}get restrictionMessage(){return C(this,Ie).restrictionMessage.value}setCmsApartmentData(t){C(this,N).cmsApartmentData=t,jn(this,En,ar).call(this)}updateStartDate(t){C(this,N).startDate=t,t&&(Yt.startDate=t.toString()),jn(this,En,ar).call(this)}updateEndDate(t){C(this,N).endDate=t,t&&(Yt.endDate=t.toString()),jn(this,En,ar).call(this)}updateRooms(t){C(this,N).rooms=t,jn(this,En,ar).call(this)}updateCouponCode(t){C(this,N).couponCode=t,jn(this,En,ar).call(this)}updateSelectedRateId(t){C(this,N).selectedRateId=t,jn(this,En,ar).call(this)}updateProducts(t){C(this,N).products=t,jn(this,En,ar).call(this)}async initializeResources(t){C(this,N).loading=!0,C(this,N).error=null;try{C(this,N).enterpriseInstance=new ni(t),await C(this,N).enterpriseInstance.initServices(),C(this,N).reservableService=C(this,N).enterpriseInstance.reservableService,await C(this,N).reservableService?.initAgeCategories(),C(this,N).ageCategories=C(this,N).reservableService?.getAgeCategories()||[]}catch(e){let r=e instanceof Error?e.message:"Unknown error";throw C(this,N).error=r,console.error("[BXT] initializeResources: Error",e),e}finally{C(this,N).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,N).ageCategories.map(a=>{let s=a.classification.toLowerCase()==="adult",l=s?Pe("adults"):Pe("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,N).rooms=r}async fetchHotel(t){C(this,N).loading=!0,C(this,N).error=null,C(this,N).isFetching=!0;try{let e=await ad(t);C(this,N).hotel=e,C(this,N).products=e?.Products.map(r=>({id:r.Id,name:Xe(r.Name),description:Xe(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,N).error=r,console.error("[BXT] fetchHotel: Error",e),e}finally{C(this,N).loading=!1,C(this,N).isFetching=!1}}async fetchAvailability(t,e){if(!C(this,N).startDate||!C(this,N).endDate){console.warn("[BXT] fetchAvailability: Start date or end date is not set, skipping");return}if(J.isBefore(C(this,N).startDate,C(this,N).endDate)){console.warn("[BXT] fetchAvailability: Invalid date range, skipping");return}C(this,N).loading=!0,C(this,N).isFetching=!0;try{let r=J.formatForAPI(C(this,N).startDate),i=J.formatForAPI(C(this,N).endDate),o=await sd(t,{EnterpriseId:t,CategoryIds:[e],StartUtc:r,EndUtc:i,ServiceId:C(this,N).reservableService?.getService()?.id||"",Client:le.bookingEngineClient,LanguageCode:"fr-FR"});C(this,N).availabilities=o}catch(r){let i=r instanceof Error?r.message:"Unknown error";throw C(this,N).error=i,console.error("[BXT] fetchAvailability: Error",r),r}finally{C(this,N).loading=!1,C(this,N).isFetching=!1}}async fetchServicePricing(t,e){if(!C(this,N).startDate||!C(this,N).endDate){console.warn("[BXT] fetchServicePricing: Start date or end date is not set, skipping");return}if(C(this,Ie).nightsCount.value<1){console.warn("[BXT] fetchServicePricing: Invalid date range (0 nights), skipping");return}C(this,N).loading=!0,C(this,N).isFetching=!0;try{let r=J.formatForAPI(C(this,N).startDate),i=J.formatForAPI(C(this,N).endDate),o=await cd(t,{Client:le.bookingEngineClient,EnterpriseId:t,StartUtc:r,EndUtc:i,ServiceId:C(this,N).reservableService?.getService()?.id||"",CategoryIds:[e],CurrencyCode:"EUR",voucherCode:C(this,N).couponCode||void 0});C(this,N).servicePricing=o}catch(r){let i=r instanceof Error?r.message:"Unknown error";throw C(this,N).error=i,console.error("[BXT] fetchServicePricing: Error",r),r}finally{C(this,N).loading=!1,C(this,N).isFetching=!1}}async fetchReservationPricing(t,e){if(!C(this,N).startDate||!C(this,N).endDate){console.warn("[BXT] fetchReservationPricing: Start date or end date is not set, skipping");return}if(C(this,Ie).nightsCount.value<1){console.warn("[BXT] fetchReservationPricing: Invalid date range (0 nights), skipping");return}if(C(this,N).rooms.length===0){console.error("[BXT] fetchReservationPricing: No rooms set, skipping");return}C(this,N).loading=!0,C(this,N).isFetching=!0;try{let r=J.formatForAPI(C(this,N).startDate),i=J.formatForAPI(C(this,N).endDate),o=C(this,N).rooms.map(h=>({OccupancyData:h.filter(p=>p.value>0).map(p=>({AgeCategoryId:p.ageCategoryId,PersonCount:p.value}))})),a=C(this,Ie).selectedProducts.value.map(h=>h.id),s={Client:le.bookingEngineClient,HotelId:t,StartUtc:r,EndUtc:i,RoomCategoryId:e,VoucherCode:C(this,N).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:[]})]),C(this,N).reservationPricing=l,C(this,N).serviceOnlyPricing=u,C(this,N).be_pricing=l,l}catch(r){let i=r instanceof Error?r.message:"Unknown error";throw C(this,N).error=i,console.error("[BXT] fetchReservationPricing: Error",r),r}finally{C(this,N).loading=!1,C(this,N).isFetching=!1}}async fetchRates(t){if(!C(this,N).reservableService||!C(this,N).reservableService.getService()){console.warn("[BXT] fetchRates: No reservable service found, skipping");return}C(this,N).loading=!0;try{let e=C(this,N).reservableService.getService()?.id;C(this,N).rates=await fa(t,e)}catch(e){let r=e instanceof Error?e.message:"Unknown error";throw C(this,N).error=r,console.error("[BXT] fetchRates: Error",e),e}finally{C(this,N).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 Qr({...C(this,N),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,N);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}}}};N=new WeakMap,Ie=new WeakMap,En=new WeakSet,ar=function(){C(this,N).isFetching};var B=new Ic;var Ad=()=>{};function lt(n,t,e,r){return n?(n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)):Ad}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 ut=(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 xc=(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 Ld(n,t){return{rate:n,pricing:t}}function Ac(n){return n.isActive&&n.isEnabled&&n.isPublic&&!n.hideFromGuest}function Nd(n,t){let e=t.filter(o=>Km(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 Km(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 xe.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=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 Od=(n,t)=>{let e=n.find(s=>s.rate.isBaseRate),r=n.filter(s=>!Nd(s,t)&&Ac(s.rate)),i=Object.groupBy(r,s=>s.rate.group?.Name||"unknown"),o=yd(r),a=Jm(o);return{baseRate:e,allowedRates:r,groupedRates:i,datedPrices:o,lowestDatedPrices:a}};function Jm(n){let t={};for(let[e,r]of Object.entries(n)){let i=1/0,o=r.filter(a=>Ac(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 Hd=async n=>{let t=await Promise.all(n.map(async r=>{let i=new ni(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(bc.toString()),J.formatForAPI(nd.toString()));return Ld(u.getRate(),h)}));return Od(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 et=class et extends Date{constructor(e=null,r="YYYY-MM-DD",i="en-US"){super(et.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 et)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=et.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:w}=et.formatPatterns(h[0],i);s[y]=p+1,s.value+=w,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=et.shortMonths(i).indexOf(u[s.shortMonth]):s.longMonth&&(p=et.longMonths(i).indexOf(u[s.longMonth]));let y=Number(u[s.day])||1,w=Number(u[s.hour]),S=Number.isNaN(w)?0:w,T=Number(u[s.minute]),x=Number.isNaN(T)?0:T,$=Number(u[s.second]),W=Number.isNaN($)?0:$,K=u[s.ampm];return K&&K==="PM"&&(S+=12,S===24&&(S=0)),new Date(h,p,y,S,x,W,0)}}}return new Date(new Date().setHours(0,0,0,0))}static shortMonths(e){return et.MONTH_JS.map(r=>new Date(2019,r).toLocaleString(e,{month:"short"}))}static longMonths(e){return et.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:`(${et.shortMonths(r).join("|")})`};case"MMMM":return{group:"longMonth",pattern:`(${et.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 et(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=et.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 et.shortMonths(r)[this.getMonth()];case"MMMM":return et.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(et,"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(et,"MONTH_JS",[0,1,2,3,4,5,6,7,8,9,10,11]);var ge=et,Lc=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}},Nc=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 Lc(this));L(this,"PluginManager",new Nc(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"),w=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&&w.isBefore(new ge(this.lockPlugin.options.minDate),"year")||this.lockPlugin.options.maxDate&&w.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 Sa=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],sr={_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},Ca=Ta;var dt=function(n,t){return t===void 0&&(t=2),("000"+n).slice(t*-1)},$t=function(n){return n===!0?1:0};function Oc(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 ht(n,t,e){if(e===!0)return n.classList.add(t);n.classList.remove(t)}function Te(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 Hc(n,t){if(t(n))return n;if(n.parentNode)return Hc(n.parentNode,t)}function yo(n,t){var e=Te("div","numInputWrapper"),r=Te("input","numInput "+n),i=Te("span","arrowUp"),o=Te("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 Bc=function(){},vo=function(n,t,e){return e.months[t?"shorthand":"longhand"][n]},Bd={D:Bc,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:Bc,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:Bc,y:function(n,t){n.setFullYear(2e3+parseFloat(t))}},Yn={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})"},ri={Z:function(n){return n.toISOString()},D:function(n,t,e){return t.weekdays.shorthand[ri.w(n,t,e)]},F:function(n,t,e){return vo(ri.n(n,t,e)-1,!1,t)},G:function(n,t,e){return dt(ri.h(n,t,e))},H:function(n){return dt(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 dt(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,t,e){return e.getWeek(n)},Y:function(n){return dt(n.getFullYear(),4)},d:function(n){return dt(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return dt(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,t){return t.weekdays.longhand[n.getDay()]},m:function(n){return dt(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 Fc=function(n){var t=n.config,e=t===void 0?sr: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,w){return ri[p]&&w[y-1]!=="\\"?ri[p](s,h,e):p!=="\\"?p:""}).join("")}},Pa=function(n){var t=n.config,e=t===void 0?sr: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||sr).dateFormat,w=String(o).trim();if(w==="today")h=new Date,s=!0;else if(e&&e.parseDate)h=e.parseDate(o,y);else if(/Z$/.test(w)||/GMT$/.test(w))h=new Date(o);else{for(var S=void 0,T=[],x=0,$=0,W="";x<y.length;x++){var K=y[x],ee=K==="\\",oe=y[x-1]==="\\"||ee;if(Yn[K]&&!oe){W+=Yn[K];var ae=new RegExp(W).exec(o);ae&&(S=!0)&&T[K!=="Y"?"push":"unshift"]({fn:Bd[K],val:ae[++$]})}else ee||(W+=".")}h=!e||!e.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),T.forEach(function(Ce){var Se=Ce.fn,ce=Ce.val;return h=Se(h,ce,u)||h}),h=S?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 Fd=function(n,t,e){return n>Math.min(t,e)&&n<Math.max(t,e)},Ia=function(n,t,e){return n*3600+t*60+e},Yd=function(n){var t=Math.floor(n/3600),e=(n-t*3600)/60;return[t,e,n-t*3600-e*60]},$d={DAY:864e5};function Ra(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 mt=function(){return mt=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},mt.apply(this,arguments)},jd=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},Xm=300;function Qm(n,t){var e={config:mt(mt({},sr),We.defaultConfig),l10n:Ca};e.parseDate=Pa({config:e.config,l10n:e.l10n}),e._handlers=[],e.pluginElements=[],e.loadedPlugins=[],e._bind=T,e._setHoursFromDate=y,e._positionCalendar=$n,e.changeMonth=_,e.changeYear=re,e.clear=I,e.close=P,e.onMouseOver=we,e._createElement=Te,e.createDay=ae,e.destroy=j,e.isEnabled=Z,e.jumpToDate=W,e.updateValue=_n,e.open=He,e.redraw=wo,e.set=Zd,e.setDate=Jd,e.toggle=th;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(),cr(),Qd(),Xd(),r(),e.isMobile||oe(),$(),(e.selectedDates.length||e.config.noCalendar)&&(e.config.enableTime&&y(e.config.noCalendar?e.latestSelectedDateObj:void 0),_n(!1)),s();var f=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!e.isMobile&&f&&$n(),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=Ra(e.config);b.setHours(M.hours,M.minutes,M.seconds,b.getMilliseconds()),e.selectedDates=[b],e.latestSelectedDateObj=b}f!==void 0&&f.type!=="blur"&&ih(f);var A=e._input.value;p(),_n(),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=Ia(e.config.minTime.getHours(),e.config.minTime.getMinutes(),e.config.minTime.getSeconds()),ye=Ia(e.config.maxTime.getHours(),e.config.maxTime.getMinutes(),e.config.maxTime.getSeconds()),ne=Ia(f,b,M);if(ne>ye&&ne<Q){var De=Yd(Q);f=De[0],b=De[1],M=De[2]}}else{if(q){var te=e.config.maxTime!==void 0?e.config.maxTime:e.config.maxDate;f=Math.min(f,te.getHours()),f===te.getHours()&&(b=Math.min(b,te.getMinutes())),b===te.getMinutes()&&(M=Math.min(M,te.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()))}}w(f,b,M)}}function y(f){var b=f||e.latestSelectedDateObj;b&&b instanceof Date&&w(b.getHours(),b.getMinutes(),b.getSeconds())}function w(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=dt(e.config.time_24hr?f:(12+f)%12+12*$t(f%12===0)),e.minuteElement.value=dt(b),e.amPM!==void 0&&(e.amPM.textContent=e.l10n.amPM[$t(f>=12)]),e.secondElement!==void 0&&(e.secondElement.value=dt(M)))}function S(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 T(f,b,M,A){if(b instanceof Array)return b.forEach(function(q){return T(f,q,M,A)});if(f instanceof Array)return f.forEach(function(q){return T(q,b,M,A)});f.addEventListener(b,M,A),e._handlers.push({remove:function(){return f.removeEventListener(b,M,A)}})}function x(){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 T(A,"click",e[M])})}),e.isMobile){eh();return}var f=Oc(_e,50);if(e._debouncedChange=Oc(x,Xm),e.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&T(e.daysContainer,"mouseover",function(M){e.config.mode==="range"&&we(jt(M))}),T(e._input,"keydown",pe),e.calendarContainer!==void 0&&T(e.calendarContainer,"keydown",pe),!e.config.inline&&!e.config.static&&T(window,"resize",f),window.ontouchstart!==void 0?T(window.document,"touchstart",X):T(window.document,"mousedown",X),T(window.document,"focus",X,{capture:!0}),e.config.clickOpens===!0&&(T(e._input,"focus",e.open),T(e._input,"click",e.open)),e.daysContainer!==void 0&&(T(e.monthNav,"click",rh),T(e.monthNav,["keyup","increment"],S),T(e.daysContainer,"click",jc)),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0){var b=function(M){return jt(M).select()};T(e.timeContainer,["increment"],l),T(e.timeContainer,"blur",l,{capture:!0}),T(e.timeContainer,"click",K),T([e.hourElement,e.minuteElement],["focus","click"],b),e.secondElement!==void 0&&T(e.secondElement,"focus",function(){return e.secondElement&&e.secondElement.select()}),e.amPM!==void 0&&T(e.amPM,"click",function(M){l(M)})}e.config.allowInput&&T(e._input,"blur",ue)}function W(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"),se()),b&&(e.currentYear!==A||e.currentMonth!==q)&&Fe("onMonthChange"),e.redraw()}function K(f){var b=jt(f);~b.className.indexOf("arrow")&&ee(f,b.classList.contains("arrowUp")?1:-1)}function ee(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 oe(){var f=window.document.createDocumentFragment();if(e.calendarContainer=Te("div","flatpickr-calendar"),e.calendarContainer.tabIndex=-1,!e.config.noCalendar){if(f.appendChild(c()),e.innerContainer=Te("div","flatpickr-innerContainer"),e.config.weekNumbers){var b=D(),M=b.weekWrapper,A=b.weekNumbers;e.innerContainer.appendChild(M),e.weekNumbers=A,e.weekWrapper=M}e.rContainer=Te("div","flatpickr-rContainer"),e.rContainer.appendChild(v()),e.daysContainer||(e.daysContainer=Te("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()),ht(e.calendarContainer,"rangeMode",e.config.mode==="range"),ht(e.calendarContainer,"animate",e.config.animate===!0),ht(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=Te("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 ae(f,b,M,A){var q=Z(b,!0),Q=Te("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"&&(ht(Q,"startRange",e.selectedDates[0]&&zt(b,e.selectedDates[0],!0)===0),ht(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"&&nh(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 Se(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,ne=Q;ne!=ye;ne+=f){var De=q.children[ne];if(De.className.indexOf("hidden")===-1&&Z(De.dateObj))return De}}function ce(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],ne=M-e.currentMonth===Q?f.$i+b:b<0?ye.children.length-1:0,De=ye.children.length,te=ne;te>=0&&te<De&&te!=(b>0?De:-1);te+=q){var de=ye.children[te];if(de.className.indexOf("hidden")===-1&&Z(de.dateObj)&&Math.abs(f.$i-te)>=Math.abs(b))return Ce(de)}e.changeMonth(q),F(Se(q),0)}function F(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:Se(b>0?1:-1);q===void 0?e._input.focus():A?ce(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,ne=ye?"prevMonthDay hidden":"prevMonthDay",De=ye?"nextMonthDay hidden":"nextMonthDay",te=A+1-M,de=0;te<=A;te++,de++)Q.appendChild(ae("flatpickr-day "+ne,new Date(f,b-1,te),te,de));for(te=1;te<=q;te++,de++)Q.appendChild(ae("flatpickr-day",new Date(f,b,te),te,de));for(var Ae=q+1;Ae<=42-M&&(e.config.showMonths===1||de%7!==0);Ae++,de++)Q.appendChild(ae("flatpickr-day "+De,new Date(f,b+1,Ae%q),Ae,de));var dn=Te("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 se(){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=Te("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=Te("div","flatpickr-month"),b=window.document.createDocumentFragment(),M;e.config.showMonths>1||e.config.monthSelectorType==="static"?M=Te("span","cur-month"):(e.monthsDropdownContainer=Te("select","flatpickr-monthDropdown-months"),e.monthsDropdownContainer.setAttribute("aria-label",e.l10n.monthAriaLabel),T(e.monthsDropdownContainer,"change",function(ye){var ne=jt(ye),De=parseInt(ne.value,10);e.changeMonth(De-e.currentMonth),Fe("onMonthChange")}),se(),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=Te("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=Te("div","flatpickr-months"),e.yearElements=[],e.monthElements=[],e.prevMonthNav=Te("span","flatpickr-prev-month"),e.prevMonthNav.innerHTML=e.config.prevArrow,e.nextMonthNav=Te("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&&(ht(e.prevMonthNav,"flatpickr-disabled",f),e.__hidePrevMonthArrow=f)}}),Object.defineProperty(e,"_hideNextMonthArrow",{get:function(){return e.__hideNextMonthArrow},set:function(f){e.__hideNextMonthArrow!==f&&(ht(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=Ra(e.config);e.timeContainer=Te("div","flatpickr-time"),e.timeContainer.tabIndex=-1;var b=Te("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=dt(e.latestSelectedDateObj?e.latestSelectedDateObj.getHours():e.config.time_24hr?f.hours:h(f.hours)),e.minuteElement.value=dt(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=dt(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(Te("span","flatpickr-time-separator",":")),e.timeContainer.appendChild(q)}return e.config.time_24hr||(e.amPM=Te("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=Te("div","flatpickr-weekdays");for(var f=e.config.showMonths;f--;){var b=Te("div","flatpickr-weekdaycontainer");e.weekdayContainer.appendChild(b)}return E(),e.weekdayContainer}function E(){if(e.weekdayContainer){var f=e.l10n.firstDayOfWeek,b=jd(e.l10n.weekdays.shorthand);f>0&&f<b.length&&(b=jd(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 D(){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"),se()),Y(),Fe("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=Ra(e.config),A=M.hours,q=M.minutes,Q=M.seconds;w(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"),se())}}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,ne=void 0;ye<Q.length;ye++){if(ne=Q[ye],typeof ne=="function"&&ne(A))return q;if(ne instanceof Date&&A!==void 0&&ne.getTime()===A.getTime())return q;if(typeof ne=="string"){var De=e.parseDate(ne,void 0,!0);return De&&De.getTime()===A.getTime()?q:!q}else if(typeof ne=="object"&&A!==void 0&&ne.from&&ne.to&&A.getTime()>=ne.from.getTime()&&A.getTime()<=ne.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()):jc(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 ne=o();if(e.daysContainer!==void 0&&(A===!1||ne&&V(ne))){var De=f.keyCode===39?1:-1;f.ctrlKey?(f.stopPropagation(),_(De),F(Te(1),0)):F(void 0,De)}}else e.hourElement&&e.hourElement.focus();break;case 38:case 40:f.preventDefault();var te=f.keyCode===40?1:-1;e.daysContainer&&b.$i!==void 0||b===e.input||b===e.altInput?f.ctrlKey?(f.stopPropagation(),re(e.currentYear-te),F(Te(1),0)):ye||F(void 0,te*7):b===e.currentYearElement?re(e.currentYear-te):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}),Ae=de.indexOf(b);if(Ae!==-1){var dn=de[Ae+(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,ne=0,De=0,te=q;te<Q;te+=Yd.DAY)Z(new Date(te),!0)||(ye=ye||te>q&&te<Q,te<A&&(!ne||te>ne)?ne=te:te>A&&(!De||te<De)&&(De=te));var de=Array.from(e.rContainer.querySelectorAll("*:nth-child(-n+"+e.config.showMonths+") > ."+b));de.forEach(function(Ae){var dn=Ae.dateObj,Ut=dn.getTime(),ai=ne>0&&Ut<ne||De>0&&Ut>De;if(ai){Ae.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(Cr){Ae.classList.remove(Cr)});return}else if(ye&&!ai)return;["startRange","inRange","endRange","notAllowed"].forEach(function(Cr){Ae.classList.remove(Cr)}),f!==void 0&&(f.classList.add(M<=e.selectedDates[0].getTime()?"startRange":"endRange"),A<M&&Ut===A?Ae.classList.add("startRange"):A>M&&Ut===A&&Ae.classList.add("endRange"),Ut>=ne&&(De===0||Ut<=De)&&Bd(Ut,A,M)&&Ae.classList.add("inRange"))})}}function _e(){e.isOpen&&!e.config.static&&!e.config.inline&&Yn()}function He(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=mt(mt({},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=Uc(de)}}),Object.defineProperty(e.config,"disable",{get:function(){return e.config._disable},set:function(de){e.config._disable=Uc(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(Ae){e.config[de==="min"?"_minTime":"_maxTime"]=e.parseDate(Ae,"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 ne=0;ne<f.length;ne++)e.config[f[ne]]=e.config[f[ne]]===!0||e.config[f[ne]]==="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 ne=0;ne<e.config.plugins.length;ne++){var De=e.config.plugins[ne](e)||{};for(var te in De)Ta.indexOf(te)>-1?e.config[te]=ka(De[te]).map(a).concat(e.config[te]):typeof b[te]>"u"&&(e.config[te]=De[te])}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=mt(mt({},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=mt(mt({},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=Fc(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(dh,hh){return dh+hh.offsetHeight},0),A=e.calendarContainer.offsetWidth,q=e.config.position.split(" "),Q=q[0],ye=q.length>1?q[1]:null,ne=b.getBoundingClientRect(),De=window.innerHeight-ne.bottom,te=Q==="above"||Q!=="below"&&De<M&&ne.top>M,de=window.pageYOffset+ne.top+(te?-M-2:b.offsetHeight+2);if(ht(e.calendarContainer,"arrowTop",!te),ht(e.calendarContainer,"arrowBottom",te),!e.config.inline){var Ae=window.pageXOffset+ne.left,dn=!1,Ut=!1;ye==="center"?(Ae-=(A-ne.width)/2,dn=!0):ye==="right"&&(Ae-=A-ne.width,Ut=!0),ht(e.calendarContainer,"arrowLeft",!dn&&!Ut),ht(e.calendarContainer,"arrowCenter",dn),ht(e.calendarContainer,"arrowRight",Ut);var ai=window.document.body.offsetWidth-(window.pageXOffset+ne.right),Cr=Ae+A>window.document.body.offsetWidth,ih=ai+A>window.document.body.offsetWidth;if(ht(e.calendarContainer,"rightMost",Cr),!e.config.static)if(e.calendarContainer.style.top=de+"px",!Cr)e.calendarContainer.style.left=Ae+"px",e.calendarContainer.style.right="auto";else if(!ih)e.calendarContainer.style.left="auto",e.calendarContainer.style.right=ai+"px";else{var za=oi();if(za===void 0)return;var oh=window.document.body.offsetWidth,ah=Math.max(0,oh/2-A/2),sh=".flatpickr-calendar.centerMost:before",ch=".flatpickr-calendar.centerMost:after",lh=za.cssRules.length,uh="{left:"+ne.left+"px;right:auto;}";ht(e.calendarContainer,"rightMost",!1),ht(e.calendarContainer,"centerMost",!0),za.insertRule(sh+","+ch+uh,lh),e.calendarContainer.style.left=ah+"px",e.calendarContainer.style.right="auto"}}}}function oi(){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||(se(),Eo(),Y())}function Fa(){e._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(e.close,0):e.close()}function jc(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=Hc(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,Ae){return de.getTime()-Ae.getTime()}));if(p(),Q){var ne=e.currentYear!==q.getFullYear();e.currentYear=q.getFullYear(),e.currentMonth=q.getMonth(),ne&&(Fe("onYearChange"),se()),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,te=e.config.mode==="range"&&e.selectedDates.length===2&&!e.config.enableTime;(De||te)&&Fa()}x()}}var Do={locale:[sr,E],showMonths:[H,s,v],minDate:[W],maxDate:[W],positionElement:[Vc],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 Kd(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 zc(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 Zd(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);zc(f,M),e.latestSelectedDateObj=e.selectedDates[e.selectedDates.length-1],e.redraw(),W(void 0,b),y(),e.selectedDates.length===0&&e.clear(!1),En(b),b&&Fe("onChange")}function Uc(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 Jd(){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&&zc(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 Xd(){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"),Vc()}function Vc(){e._positionElement=e.config.positionElement||e._input}function Qd(){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),Fe("onChange"),Fe("onClose")})}function eh(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 th(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 nh(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 rh(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")),ne=parseInt(A.value,10),De=f.delta||(b?f.which===38?1:-1:0),te=ne+ye*De;if(typeof A.value<"u"&&A.value.length===2){var de=A===e.hourElement,Ae=A===e.minuteElement;te<q?(te=Q+te+$t(!de)+($t(de)&&$t(!e.amPM)),Ae&&ee(void 0,-1,e.hourElement)):te>Q&&(te=A===e.hourElement?te-Q-$t(!e.amPM):q,Ae&&ee(void 0,1,e.hourElement)),e.amPM&&de&&(ye===1?te+ne===23:Math.abs(te-ne)>ye)&&(e.amPM.textContent=e.l10n.amPM[$t(e.amPM.textContent===e.l10n.amPM[0])]),A.value=dt(te)}}return i(),e}function ii(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=Jm(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 ii(this,n)},HTMLElement.prototype.flatpickr=function(n){return ii([this],n)});var We=function(n,t){return typeof n=="string"?ii(window.document.querySelectorAll(n),t):n instanceof Node?ii([n],t):ii(n,t)};We.defaultConfig={};We.l10ns={en:mt({},Ca),default:mt({},Ca)};We.localize=function(n){We.l10ns.default=mt(mt({},We.l10ns.default),n)};We.setDefaults=function(n){We.defaultConfig=mt(mt({},We.defaultConfig),n)};We.parseDate=Pa({});We.formatDate=Fc({});We.compareDates=zt;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(n){return ii(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 jd=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:Xu,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()};Je("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=Ju(),r={mode:"range",showMonths:this.config.calendars,minDate:this.minDate.toString(),shorthandCurrentMonth:!0,monthSelectorType:"static",inline:!1,dateFormat:Qu,locale:{months:{shorthand:e,longhand:e}},zIndex:10,disable:this.disabledDates};this.config.startWithEmptyDates||(r.defaultDate=[this.config.defaultStartDate.toString(),this.config.defaultEndDate.toString()]),Object.assign(r,{onChange:o=>{let a=G("label",this.dateInputEl);if(o.length===1){if(this.selectedStartDate=J.fromJSDate(o[0]),this.selectedEndDate=null,Je("date:changed",{startDate:this.selectedStartDate.toString(),endDate:""}),a){let s=this.formatDate(o[0]);a.textContent=s}}else if(o.length===2){this.selectedStartDate=J.fromJSDate(o[0]),this.selectedEndDate=J.fromJSDate(o[1]);let s={startDate:this.selectedStartDate.toString(),endDate:this.selectedEndDate.toString()};if(Je("date:changed",s),a){let l=this.formatDate(o[0]),u=this.formatDate(o[1]);a.textContent=`${l} - ${u}`}}else this.selectedStartDate?a&&(a.textContent=this.formatDate(J.toJSDate(this.selectedStartDate))):(this.selectedEndDate=null,Je("date:changed",{startDate:"",endDate:""}),a&&(a.textContent="Choose your dates"))},onDayCreate:async(o,a,s,l)=>{let u=l.dateObj,h=J.fromJSDate(u),p=J.formatForAPI(h);if(this.prices[p]){let y=this.prices[p],w=document.createElement("span");w.style.marginTop="2px",w.style.color="#c64509",w.style.fontSize="10px",w.style.fontWeight="bold",w.className=ua,w.textContent=`${y.toLocaleString(qe,{style:"currency",currency:"EUR",maximumFractionDigits:0})}`,l.style.display="flex",l.style.flexDirection="column",l.style.alignItems="center",l.style.justifyContent="center",l.style.lineHeight="1.1",l.appendChild(w)}}});let i=jd(this.dateInputEl,r);this.instance=i,this.destroyInstance=()=>i.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"?`${r}/${i}/${o}`:qe==="fr-FR"||qe==="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",ed);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:B.startDate||Tr,defaultEndDate:B.endDate||ei});if(t.setMinimumDate(Tr),t.setMaximumDate(ei),t.includePrices(this.includePrices),this.includePrices){let e=await Od([this.parentComponent.apartmentProperties.enterpriseId]);t.setPrices(e)}return t.initialize(),t});nr("date:changed",e=>{B.updateStartDate(J.fromString(e.startDate)),B.updateEndDate(J.fromString(e.endDate))}),this.element=G("details-box"),this.nightsCountElement=G("nights",this.element),this.startDateElement=G("start-date",this.element),this.endDateElement=G("end-date",this.element),this.dateElement=G("date-element",this.element),this.roomsWrapperElement=G("room-box-wrapper",this.element),this.roomElementTemplate=G("room-box",this.element),this.addRoomElement=G("add-room-button",this.element)}init(){console.log("Initialize DetailsSection"),this.updateDOM(),this.populateCalendarInput()}updateDOM(){xt(()=>{this.startDateElement.textContent=B.startDate?J.formatForDisplay(B.startDate):"?"}),xt(()=>{this.endDateElement.textContent=B.endDate?J.formatForDisplay(B.endDate):"?"}),xt(()=>{this.nightsCountElement.textContent=`${B.nightsCount} ${Pe("night").toLowerCase()}${B.nightsCount>1?"s":""}`}),xt(()=>{let t=document.createDocumentFragment();B.rooms.forEach((r,i)=>{let o=ut(this.roomElementTemplate,!0),a=G("room",o);a.textContent=`${Pe("apartment")} ${i+1}`;let s=G("categories-wrapper",o),l=G("age-category",s),u=document.createDocumentFragment();r.forEach(p=>{let y=ut(l,!0),w=G("category-name",y);w.textContent=p.name;let T=G("input",y);po(T,p.value.toString()),lt(y,"click",S=>{S.preventDefault();let x=i;switch(rd(S.target)){case"decrement":if(p.isAdult){if(r.filter(W=>W.isAdult).reduce((W,K)=>W+K.value,0)>1&&p.value>0){let W=B.rooms.map((K,ee)=>ee===x?K.map(oe=>oe.ageCategoryId===p.ageCategoryId?{...oe,value:oe.value-1}:{...oe}):K);B.updateRooms(W)}}else if(p.value>0){let $=B.rooms.map((W,K)=>K===x?W.map(ee=>ee.ageCategoryId===p.ageCategoryId?{...ee,value:ee.value-1}:{...ee}):W);B.updateRooms($)}break;case"increment":if(this.computations(r).hasCapacity){let $=B.rooms.map((W,K)=>K===x?W.map(ee=>ee.ageCategoryId===p.ageCategoryId?{...ee,value:ee.value+1}:{...ee}):W);B.updateRooms($)}break}},{once:!1}),u.appendChild(y)}),s.innerHTML="",s.appendChild(u);let h=G("remove-room-button",o);h&&(h.classList.toggle("hide",B.rooms.length<=1),lt(h,"click",p=>{p.preventDefault();let y=B.rooms.filter((w,T)=>T!==i);B.updateRooms(y)})),t.appendChild(o)}),this.roomsWrapperElement.innerHTML="",this.roomsWrapperElement.appendChild(t);let{maxAllowedRooms:e}={maxAllowedRooms:B.maxAllowedRooms};console.log(`<<debug>> Current rooms: ${B.rooms.length}, Max allowed rooms: ${e}, Available rooms: ${this.parentComponent.apartmentProperties.availableRooms}`),e>0&&B.rooms.length>=e?(console.log(`<<debug>> Hiding add room button: current rooms ${B.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`),B.rooms.length>=this.parentComponent.apartmentProperties.availableRooms&&(console.log(`<<debug>> Hiding add room button: current rooms ${B.rooms.length} >= available rooms ${this.parentComponent.apartmentProperties.availableRooms}`),this.addRoomElement.classList.add("hide"))):(console.log(`<<debug>> Showing add room button: current rooms ${B.rooms.length} < max allowed or available rooms`),this.addRoomElement.classList.remove("hide"))}),lt(this.addRoomElement,"click",t=>{t.preventDefault();let{maxAllowedRooms:e}={maxAllowedRooms:B.maxAllowedRooms};if(B.rooms.length<e){let i=B.ageCategories.map(a=>{let s=a.classification.toLowerCase()==="adult",l=s?Pe("adults"):Pe("children"),u=s?1:0;return{isAdult:s,ageCategoryId:a.id,name:l,value:u}}),o=[...B.rooms,i];B.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 zd=(n,t)=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/images/getUrls",e,n)};function Ud(n){return n.ImageUrls.map(t=>({url:t.Url,imageId:t.ImageId}))}var Yc=Ze({}),Vd={width:160,height:160};async function qd(n,t){if(t.every(i=>Yc.value[i]))return t.map(i=>Yc.value[i]).flat();let e=await zd(n,{Images:t.map(i=>({ImageId:i,Width:Vd.width,Height:Vd.height,ResizeMode:"Cover"}))}),r=Ud(e);return r.forEach(i=>{Yc.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=G("options-box"),this.productsWrapperElement=G("options-list",this.element),this.productTemplateElement=G("option-wrapper",this.element),this.showMoreButtonElement=G("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();[...B.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=ut(this.productTemplateElement,!0);o.removeAttribute("id");let a=G("name",o);a.textContent=r.name||"";let s=G("price",o);s.textContent=r.price.toLocaleString(qe,{style:"currency",currency:"EUR"});let l=G("label",o);l.textContent=Pe(`chargingMode:${r.chargingMode}`),qd(this.parentComponent.apartmentProperties.enterpriseId,r.imageIds).then(h=>{let p=G("image",o);p.src=h[0].url});let u=G("checkbox",o);lt(u,"change",()=>{let h=mo(u),p=B.products.map(y=>y.id===r.id?{...y,selected:h==="true"}:y);B.updateProducts(p)}),o.classList.toggle("hide",i>3),t.appendChild(o)}),xc(this.productsWrapperElement),this.productsWrapperElement.appendChild(t),lt(this.showMoreButtonElement,"click",()=>{let r=this.showMoreProducts(3);this.showMoreButtonElement.classList.toggle("hide",!r)})}showMoreProducts(t=4){let e=this.productsWrapperElement.querySelectorAll(`${nd(this.productTemplateElement)}.hide`);return e.forEach((r,i)=>{i<t&&r.classList.toggle("hide",!1)}),e.length>t}};var Wd=(n,t)=>{let e=`${le.bookingEngine_url}/reservationGroups/create`,r={method:"POST",headers:le.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=G("payment-modal"),this.modalContent=G("modal-content",this.element),this.modalBg=G("modal-bg",this.element),this.openModalBtn=G("open-modal"),this.closeModalBtn=G("close-modal"),this.fNameInput=G("fname-input",this.element),this.lNameInput=G("lname-input",this.element),this.emailInput=G("email-input",this.element),this.phoneInput=G("phone-input",this.element),this.countryInput=G("country-input",this.element),this.notesInput=G("notes-input",this.element),this.submitPaymentBtn=G("submit-payment",this.element)}init(){console.log("Initialize PaymentModal"),this.updateDOM()}updateDOM(){lt(this.openModalBtn,"click",()=>{this.openModalBtn.hasAttribute("disabled")||(this.toggleVisibility(!0),this.element.scrollIntoView({behavior:"smooth"}))}),this.submitPaymentBtn?lt(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(!B.startDate||!B.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:B.startDate,endDate:B.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:le.bookingEngineClient,HotelId:this.parentComponent.apartmentProperties.enterpriseId,Customer:this.customer,Reservations:B.rooms.map(s=>({RoomCategoryId:this.parentComponent.apartmentProperties.categoryId,StartUtc:J.formatForAPI(t.toString()),EndUtc:J.formatForAPI(e.toString()),VoucherCode:B.couponCode||void 0,RateId:B.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:B.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()??Pe("proceedToPayment");this.submitPaymentBtn.textContent=Pe("completePayment"),this.submitPaymentBtn.classList.add("is-disabled");let a=await Wd(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 Gd=(n,t)=>{let e=`${le.bookingEngine_url}/vouchers/validate`,r={method:"POST",headers:le.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=G("summary-box"),this.summaryItemWrapperElement=G("summary-items-wrapper",this.element),this.summaryItemElement=G("summary-item",this.summaryItemWrapperElement),this.itemNameTemplateElement=G("name",this.summaryItemElement),this.itemRowTemplateElement=G("row",this.summaryItemElement),this.totalPriceElement=G("total",this.element),this.taxElement=G("tax",this.element),this.submitElement=G("submit",this.element),this.couponInputElement=G("coupon-input",this.element),this.couponApplyElement=G("apply-coupon",this.element),this.statusTextElement=G("status-text",this.element)}init(){this.updateDOM(),Je("loading:end",this.element)}refresh(){Je("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(){lt(this.couponInputElement,"input",()=>{B.updateCouponCode(mo(this.couponInputElement))}),lt(this.couponApplyElement,"click",async t=>{t.preventDefault(),Je("loading:start",this.element),Gd(this.parentComponent.apartmentProperties.enterpriseId,{Client:le.bookingEngineClient,HotelId:this.parentComponent.apartmentProperties.enterpriseId,VoucherCode:B.couponCode}).then(async e=>{let{IsValid:r}=e;if(this.statusTextElement.textContent=r?Pe("couponValid"):Pe("couponInvalid"),this.statusTextElement.style.color=r?"#1bcb00":"#f44900",r)try{Je("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=Pe("couponError"),this.statusTextElement.style.color="#f44900"}}).catch(e=>{console.error("Error validating coupon:",e),this.statusTextElement.textContent=Pe("couponError"),this.statusTextElement.style.color="#f44900"}).finally(()=>{Je("loading:end",this.element),this.statusTextElement.classList.toggle("hide",!1)})}),xt(()=>{this.couponInputElement.value!==B.couponCode&&po(this.couponInputElement,B.couponCode);let e=B.getReadonlyState().computed.summary;if(B.isFetching){rr(!0,this.element);return}rr(!1,this.element),this.summaryItemWrapperElement.innerHTML="",e.items.forEach(i=>{let o=this.summaryItemElement.cloneNode(!0),a=G("name",o),s=G("row",o),l=document.createDocumentFragment(),u=i.occupancy.adults||0,h=i.occupancy.children||0,p=ut(a,!0);p.textContent=`[${u} ${Pe("adults").toLowerCase()}${h>0?`, ${h} ${Pe("children").toLowerCase()}`:""}] x ${i.quantity}`,l.appendChild(p);let y=ut(a,!0);y.textContent=`${i.pricing.avgPerNight.toLocaleString(qe,{style:"currency",currency:"EUR"})}/ ${Pe("night")}`,l.appendChild(y);let w=ut(s,!0),T=G("label",w),S=G("price",w);if(T.textContent=`${Pe("pricingService")} (${B.nightsCount} ${Pe("night").toLowerCase()}${B.nightsCount>1?"s":""}):`,S.textContent=i.pricing.service.toLocaleString?.(qe,{style:"currency",currency:"EUR"})??null,l.appendChild(w),B.selectedProducts.length>0){let ce=ut(s,!0),F=G("label",ce);G("price",ce).remove();let Y=B.selectedProducts.map(se=>se.name).join(", ");F.textContent=`${Pe("pricingProducts")} ${Y}`,l.appendChild(ce)}let x=ut(s,!0),$=G("label",x);$.textContent=Pe("pricingProductsAndExtras");let W=G("price",x);W.textContent=i.pricing.products.toLocaleString(qe,{style:"currency",currency:"EUR"}),l.appendChild(x);let K=ut(s,!0),ee=G("label",K);ee.textContent=Pe("pricingTaxes");let oe=G("price",K);oe.textContent=i.pricing.taxes.toLocaleString(qe,{style:"currency",currency:"EUR"}),l.appendChild(K);let ae=ut(s,!0),Ce=G("label",ae);Ce.textContent=Pe("pricingSubtotal");let Te=G("price",ae);Te.textContent=i.pricing.subtotal.toLocaleString(qe,{style:"currency",currency:"EUR"}),l.appendChild(ae),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=G("offer-box"),this.tariffsWrapperElement=G("offers-list",this.element),this.tariffTemplateElement=G("offer-wrapper",this.element)}init(){this.updateDOM()}refresh(){}toggleVisibility(t=!0){this.element.classList.toggle("hide",!t)}updateDOM(){xt(()=>{if(B.isFetching){console.log("[TariffsSection] Skipping render during fetch operation");return}if(B.computedRates.length===0){console.log("[TariffsSection] No computed rates available, skipping render");return}console.log("[TariffsSection] Rendering tariffs:",{ratesCount:B.computedRates.length,isFetching:B.isFetching});let t=document.createDocumentFragment(),e=B.computedRates.sort((a,s)=>{let l=a.price?.AverageAmountPerTimeUnit?.GrossValue||0,u=s.price?.AverageAmountPerTimeUnit?.GrossValue||0;return l-u}),r=B.selectedRateId,i=r!==null&&e.some(a=>a.id===r),o=i?r:e[0]?.id;!i&&o&&queueMicrotask(()=>B.updateSelectedRateId(o)),e.forEach(a=>{let s=ut(this.tariffTemplateElement,!0);s.removeAttribute("id");let l=G("name",s);l.textContent=a.name;let u=G("description",s);u.textContent=a.description;let h=G("price",s),p=a.price?.AverageAmountPerTimeUnit?.GrossValue||0;h.textContent=p.toLocaleString(qe,{style:"currency",currency:"EUR"});let y=B.rates.find($=>$.id===a.id),w=G("label",s),T=G("discount-badge",s),S=G("discount-label",T);if(y)if(w.textContent=y.shortName,y.pricing?.DependentRatePricing){let $=y.pricing?.DependentRatePricing.RelativeAdjustment*100;$===0?T.classList.add("hide"):S.textContent=`${$>0?"+":""}${$}%`}else T.classList.add("hide");else w.classList.add("hide"),T.classList.add("hide");let x=G("radio-input",s);x.value=a.id,a.id===o&&(x.checked=!0,x.previousElementSibling?.classList.add("w--redirected-checked")),lt(x,"change",()=>{x.checked&&B.updateSelectedRateId(a.id)}),t.appendChild(s)}),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,B.setCmsApartmentData(t)}init(){Je("loading:start",document.body);let t=Yt.startDate?J.safeParsePlainDate(Yt.startDate):Tr,e=Yt.endDate?J.safeParsePlainDate(Yt.endDate):ei,r=t&&e?t.until(e).days:0,i=r>=1?t:Tr,o=r>=1?e:ei;i&&B.updateStartDate(i),o&&B.updateEndDate(o),this.fetchAPIData().then(()=>this.parseAPIData()).then(()=>this.initUIComponents()).catch(a=>{console.error("[ReservationComponent] fetchAPIData failed:",a),this.initUIComponents()}),console.log("#=> State:",B.getReadonlyState())}initUIComponents(){let t=B.rates.find(e=>e.isDefault||e.isBaseRate);console.log("#=> Default Rate:",t),B.updateSelectedRateId(t?.id||B.computedRates.find(e=>e.ordering===0&&e.groupOrdering===0)?.id||B.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(),Je("loading:end",document.body)}initPricingButler(){let t=(0,$c.default)(async()=>{console.log("[PricingButler] Fetching reservation pricing..."),await B.fetchReservationPricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId)},500);xt(()=>{let{rooms:e}=B,{startDate:r}=B,{endDate:i}=B,{selectedProducts:o}=B,{selectedRateId:a}=B,{couponCode:s}=B;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,$c.default)(async()=>{try{await B.fetchAvailability(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),await B.fetchServicePricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),Je("loading:end",document.body)}catch(e){console.error("Error updating availability and pricing data:",e)}},500);xt(()=>{Je("loading:start",document.body);let{startDate:e,endDate:r}={startDate:B.startDate,endDate:B.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()}),xt(()=>{Je("loading:start",document.body);let{availabilities:e,servicePricing:r,isAvailable:i,restrictionMessage:o}={availabilities:B.availabilities,servicePricing:B.servicePricing,isAvailable:B.isAvailable,restrictionMessage:B.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&&!B.selectedRateId&&B.computedRates.length>0){let a=B.rates.find(s=>s.isDefault||s.isBaseRate);B.updateSelectedRateId(a?.id||B.computedRates.find(s=>s.ordering===0&&s.groupOrdering===0)?.id||B.computedRates[0]?.id||null)}e&&r&&this.refreshUIComponents()})}async fetchAPIData(){console.log("#=> Fetching API data for reservation component..."),await B.initializeResources(this.apartmentProperties.enterpriseId),await B.initializeRooms(),await B.fetchHotel(this.apartmentProperties.enterpriseId),await B.fetchAvailability(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),await B.fetchServicePricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),await B.fetchReservationPricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),await B.fetchRates(this.apartmentProperties.enterpriseId)}async parseAPIData(){}refreshUIComponents(){if(B.computedRates.length>0&&!B.selectedRateId){let t=B.rates.find(e=>e.isDefault||e.isBaseRate);B.updateSelectedRateId(t?.id||B.computedRates.find(e=>e.ordering===0&&e.groupOrdering===0)?.id||B.computedRates[0]?.id||null)}this.updateAvailabilityBanners(B.isAvailable,B.restrictionMessage),this.optionsSection&&(this.optionsSection.toggleVisibility(B.isAvailable),this.optionsSection.refresh()),this.tariffsSection&&(this.tariffsSection.toggleVisibility(B.isAvailable),this.tariffsSection.refresh()),this.summarySection&&(this.summarySection.toggleVisibility(B.isAvailable),this.summarySection.refresh()),Je("loading:end",document.body)}updateAvailabilityBanners(t,e){let r=G("banner-box"),i=G("banner-box-restriction"),o=G("banner-restriction-text"),a=G("open-modal");a&&(!!e||!t?a.setAttribute("disabled",""):a.removeAttribute("disabled")),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 B.fetchServicePricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId);let t=await B.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&&xe.PlainDate.compare(t,e)>=0?(console.warn("Invalid date range: start date must be before end date"),!1):(t&&B.updateStartDate(t),e&&B.updateEndDate(e),!0)}scrollToTariffsSection(){let t=document.getElementById("tariff-section");t&&setTimeout(()=>{t.scrollIntoView({behavior:"smooth",block:"start"})},300)}};function Qm(){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()=>{Qm()});export{Qm as initApparthotelsBookingTemplate};
7
+ `}}function D(){e.calendarContainer.classList.add("hasWeeks");var f=Te("div","flatpickr-weekwrapper");f.appendChild(Te("span","flatpickr-weekday",e.l10n.weekAbbreviation));var b=Te("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"),se()),Y(),Fe("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=Ra(e.config),A=M.hours,q=M.minutes,Q=M.seconds;w(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"),se())}}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,ne=void 0;ye<Q.length;ye++){if(ne=Q[ye],typeof ne=="function"&&ne(A))return q;if(ne instanceof Date&&A!==void 0&&ne.getTime()===A.getTime())return q;if(typeof ne=="string"){var De=e.parseDate(ne,void 0,!0);return De&&De.getTime()===A.getTime()?q:!q}else if(typeof ne=="object"&&A!==void 0&&ne.from&&ne.to&&A.getTime()>=ne.from.getTime()&&A.getTime()<=ne.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()):jc(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 ne=o();if(e.daysContainer!==void 0&&(A===!1||ne&&V(ne))){var De=f.keyCode===39?1:-1;f.ctrlKey?(f.stopPropagation(),_(De),F(Se(1),0)):F(void 0,De)}}else e.hourElement&&e.hourElement.focus();break;case 38:case 40:f.preventDefault();var te=f.keyCode===40?1:-1;e.daysContainer&&b.$i!==void 0||b===e.input||b===e.altInput?f.ctrlKey?(f.stopPropagation(),re(e.currentYear-te),F(Se(1),0)):ye||F(void 0,te*7):b===e.currentYearElement?re(e.currentYear-te):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}),Ae=de.indexOf(b);if(Ae!==-1){var dn=de[Ae+(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(),_n();break;case e.l10n.amPM[1].charAt(0):case e.l10n.amPM[1].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[1],p(),_n();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,ne=0,De=0,te=q;te<Q;te+=$d.DAY)Z(new Date(te),!0)||(ye=ye||te>q&&te<Q,te<A&&(!ne||te>ne)?ne=te:te>A&&(!De||te<De)&&(De=te));var de=Array.from(e.rContainer.querySelectorAll("*:nth-child(-n+"+e.config.showMonths+") > ."+b));de.forEach(function(Ae){var dn=Ae.dateObj,Ut=dn.getTime(),ai=ne>0&&Ut<ne||De>0&&Ut>De;if(ai){Ae.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(Cr){Ae.classList.remove(Cr)});return}else if(ye&&!ai)return;["startRange","inRange","endRange","notAllowed"].forEach(function(Cr){Ae.classList.remove(Cr)}),f!==void 0&&(f.classList.add(M<=e.selectedDates[0].getTime()?"startRange":"endRange"),A<M&&Ut===A?Ae.classList.add("startRange"):A>M&&Ut===A&&Ae.classList.add("endRange"),Ut>=ne&&(De===0||Ut<=De)&&Fd(Ut,A,M)&&Ae.classList.add("inRange"))})}}function _e(){e.isOpen&&!e.config.static&&!e.config.inline&&$n()}function He(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"),$n(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),_n()),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=mt(mt({},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=Uc(de)}}),Object.defineProperty(e.config,"disable",{get:function(){return e.config._disable},set:function(de){e.config._disable=Uc(de)}});var A=b.mode==="time";if(!b.dateFormat&&(b.enableTime||A)){var q=We.defaultConfig.dateFormat||sr.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||sr.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(Ae){e.config[de==="min"?"_minTime":"_maxTime"]=e.parseDate(Ae,"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 ne=0;ne<f.length;ne++)e.config[f[ne]]=e.config[f[ne]]===!0||e.config[f[ne]]==="true";Sa.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 ne=0;ne<e.config.plugins.length;ne++){var De=e.config.plugins[ne](e)||{};for(var te in De)Sa.indexOf(te)>-1?e.config[te]=ka(De[te]).map(a).concat(e.config[te]):typeof b[te]>"u"&&(e.config[te]=De[te])}b.altInputClass||(e.config.altInputClass=Qt().className+" "+e.config.altInputClass),Fe("onParseConfig")}function Qt(){return e.config.wrap?n.querySelector("[data-input]"):n}function cr(){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=mt(mt({},We.l10ns.default),typeof e.config.locale=="object"?e.config.locale:e.config.locale!=="default"?We.l10ns[e.config.locale]:void 0),Yn.D="("+e.l10n.weekdays.shorthand.join("|")+")",Yn.l="("+e.l10n.weekdays.longhand.join("|")+")",Yn.M="("+e.l10n.months.shorthand.join("|")+")",Yn.F="("+e.l10n.months.longhand.join("|")+")",Yn.K="("+e.l10n.amPM[0]+"|"+e.l10n.amPM[1]+"|"+e.l10n.amPM[0].toLowerCase()+"|"+e.l10n.amPM[1].toLowerCase()+")";var f=mt(mt({},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=Fc(e),e.parseDate=Pa({config:e.config,l10n:e.l10n})}function $n(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(hh,mh){return hh+mh.offsetHeight},0),A=e.calendarContainer.offsetWidth,q=e.config.position.split(" "),Q=q[0],ye=q.length>1?q[1]:null,ne=b.getBoundingClientRect(),De=window.innerHeight-ne.bottom,te=Q==="above"||Q!=="below"&&De<M&&ne.top>M,de=window.pageYOffset+ne.top+(te?-M-2:b.offsetHeight+2);if(ht(e.calendarContainer,"arrowTop",!te),ht(e.calendarContainer,"arrowBottom",te),!e.config.inline){var Ae=window.pageXOffset+ne.left,dn=!1,Ut=!1;ye==="center"?(Ae-=(A-ne.width)/2,dn=!0):ye==="right"&&(Ae-=A-ne.width,Ut=!0),ht(e.calendarContainer,"arrowLeft",!dn&&!Ut),ht(e.calendarContainer,"arrowCenter",dn),ht(e.calendarContainer,"arrowRight",Ut);var ai=window.document.body.offsetWidth-(window.pageXOffset+ne.right),Cr=Ae+A>window.document.body.offsetWidth,oh=ai+A>window.document.body.offsetWidth;if(ht(e.calendarContainer,"rightMost",Cr),!e.config.static)if(e.calendarContainer.style.top=de+"px",!Cr)e.calendarContainer.style.left=Ae+"px",e.calendarContainer.style.right="auto";else if(!oh)e.calendarContainer.style.left="auto",e.calendarContainer.style.right=ai+"px";else{var za=oi();if(za===void 0)return;var ah=window.document.body.offsetWidth,sh=Math.max(0,ah/2-A/2),ch=".flatpickr-calendar.centerMost:before",lh=".flatpickr-calendar.centerMost:after",uh=za.cssRules.length,dh="{left:"+ne.left+"px;right:auto;}";ht(e.calendarContainer,"rightMost",!1),ht(e.calendarContainer,"centerMost",!0),za.insertRule(ch+","+lh+dh,uh),e.calendarContainer.style.left=sh+"px",e.calendarContainer.style.right="auto"}}}}function oi(){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||(se(),Eo(),Y())}function Fa(){e._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(e.close,0):e.close()}function jc(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=Hc(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,Ae){return de.getTime()-Ae.getTime()}));if(p(),Q){var ne=e.currentYear!==q.getFullYear();e.currentYear=q.getFullYear(),e.currentMonth=q.getMonth(),ne&&(Fe("onYearChange"),se()),Fe("onMonthChange")}if(Eo(),Y(),_n(),!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,te=e.config.mode==="range"&&e.selectedDates.length===2&&!e.config.enableTime;(De||te)&&Fa()}x()}}var Do={locale:[cr,E],showMonths:[H,s,v],minDate:[W],maxDate:[W],positionElement:[Vc],clickOpens:[function(){e.config.clickOpens===!0?(T(e._input,"focus",e.open),T(e._input,"click",e.open)):(e._input.removeEventListener("focus",e.open),e._input.removeEventListener("click",e.open))}]};function Zd(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()}):Sa.indexOf(f)>-1&&(e.config[f]=ka(b));e.redraw(),_n(!0)}function zc(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 Jd(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);zc(f,M),e.latestSelectedDateObj=e.selectedDates[e.selectedDates.length-1],e.redraw(),W(void 0,b),y(),e.selectedDates.length===0&&e.clear(!1),_n(b),b&&Fe("onChange")}function Uc(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 Xd(){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&&zc(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 Qd(){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=Te(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"),Vc()}function Vc(){e._positionElement=e.config.positionElement||e._input}function eh(){var f=e.config.enableTime?e.config.noCalendar?"time":"datetime-local":"date";e.mobileInput=Te("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{}T(e.mobileInput,"change",function(b){e.setDate(jt(b).value,!1,e.mobileFormatStr),Fe("onChange"),Fe("onClose")})}function th(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 nh(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 _n(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 rh(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 ih(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")),ne=parseInt(A.value,10),De=f.delta||(b?f.which===38?1:-1:0),te=ne+ye*De;if(typeof A.value<"u"&&A.value.length===2){var de=A===e.hourElement,Ae=A===e.minuteElement;te<q?(te=Q+te+$t(!de)+($t(de)&&$t(!e.amPM)),Ae&&ee(void 0,-1,e.hourElement)):te>Q&&(te=A===e.hourElement?te-Q-$t(!e.amPM):q,Ae&&ee(void 0,1,e.hourElement)),e.amPM&&de&&(ye===1?te+ne===23:Math.abs(te-ne)>ye)&&(e.amPM.textContent=e.l10n.amPM[$t(e.amPM.textContent===e.l10n.amPM[0])]),A.value=dt(te)}}return i(),e}function ii(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 ii(this,n)},HTMLElement.prototype.flatpickr=function(n){return ii([this],n)});var We=function(n,t){return typeof n=="string"?ii(window.document.querySelectorAll(n),t):n instanceof Node?ii([n],t):ii(n,t)};We.defaultConfig={};We.l10ns={en:mt({},Ca),default:mt({},Ca)};We.localize=function(n){We.l10ns.default=mt(mt({},We.l10ns.default),n)};We.setDefaults=function(n){We.defaultConfig=mt(mt({},We.defaultConfig),n)};We.parseDate=Pa({});We.formatDate=Fc({});We.compareDates=zt;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(n){return ii(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 zd=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:Qu,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()};Je("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=Ju(),r={mode:"range",showMonths:this.config.calendars,minDate:this.minDate.toString(),shorthandCurrentMonth:!0,monthSelectorType:"static",inline:!1,dateFormat:ed,locale:{months:{shorthand:e,longhand:e}},zIndex:10,disable:this.disabledDates};this.config.startWithEmptyDates||(r.defaultDate=[this.config.defaultStartDate.toString(),this.config.defaultEndDate.toString()]),Object.assign(r,{onChange:o=>{let a=G("label",this.dateInputEl);if(o.length===1){if(this.selectedStartDate=J.fromJSDate(o[0]),this.selectedEndDate=null,Je("date:changed",{startDate:this.selectedStartDate.toString(),endDate:""}),a){let s=this.formatDate(o[0]);a.textContent=s}}else if(o.length===2){this.selectedStartDate=J.fromJSDate(o[0]),this.selectedEndDate=J.fromJSDate(o[1]);let s={startDate:this.selectedStartDate.toString(),endDate:this.selectedEndDate.toString()};if(Je("date:changed",s),a){let l=this.formatDate(o[0]),u=this.formatDate(o[1]);a.textContent=`${l} - ${u}`}}else this.selectedStartDate?a&&(a.textContent=this.formatDate(J.toJSDate(this.selectedStartDate))):(this.selectedEndDate=null,Je("date:changed",{startDate:"",endDate:""}),a&&(a.textContent="Choose your dates"))},onDayCreate:async(o,a,s,l)=>{let u=l.dateObj,h=J.fromJSDate(u),p=J.formatForAPI(h);if(this.prices[p]){let y=this.prices[p],w=document.createElement("span");w.style.marginTop="2px",w.style.color="#c64509",w.style.fontSize="10px",w.style.fontWeight="bold",w.className=ua,w.textContent=`${y.toLocaleString(qe,{style:"currency",currency:"EUR",maximumFractionDigits:0})}`,l.style.display="flex",l.style.flexDirection="column",l.style.alignItems="center",l.style.justifyContent="center",l.style.lineHeight="1.1",l.appendChild(w)}}});let i=zd(this.dateInputEl,r);this.instance=i,this.destroyInstance=()=>i.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"?`${r}/${i}/${o}`:qe==="fr-FR"||qe==="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",td);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:B.startDate||Sr,defaultEndDate:B.endDate||ei});if(t.setMinimumDate(Sr),t.setMaximumDate(ei),t.includePrices(this.includePrices),this.includePrices){let e=await Hd([this.parentComponent.apartmentProperties.enterpriseId]);t.setPrices(e)}return t.initialize(),t});rr("date:changed",e=>{B.updateStartDate(J.fromString(e.startDate)),B.updateEndDate(J.fromString(e.endDate))}),this.element=G("details-box"),this.nightsCountElement=G("nights",this.element),this.startDateElement=G("start-date",this.element),this.endDateElement=G("end-date",this.element),this.dateElement=G("date-element",this.element),this.roomsWrapperElement=G("room-box-wrapper",this.element),this.roomElementTemplate=G("room-box",this.element),this.addRoomElement=G("add-room-button",this.element)}init(){console.log("Initialize DetailsSection"),this.updateDOM(),this.populateCalendarInput()}updateDOM(){xt(()=>{this.startDateElement.textContent=B.startDate?J.formatForDisplay(B.startDate):"?"}),xt(()=>{this.endDateElement.textContent=B.endDate?J.formatForDisplay(B.endDate):"?"}),xt(()=>{this.nightsCountElement.textContent=`${B.nightsCount} ${Pe("night").toLowerCase()}${B.nightsCount>1?"s":""}`}),xt(()=>{let t=document.createDocumentFragment();B.rooms.forEach((r,i)=>{let o=ut(this.roomElementTemplate,!0),a=G("room",o);a.textContent=`${Pe("apartment")} ${i+1}`;let s=G("categories-wrapper",o),l=G("age-category",s),u=document.createDocumentFragment();r.forEach(p=>{let y=ut(l,!0),w=G("category-name",y);w.textContent=p.name;let S=G("input",y);po(S,p.value.toString()),lt(y,"click",T=>{T.preventDefault();let x=i;switch(id(T.target)){case"decrement":if(p.isAdult){if(r.filter(W=>W.isAdult).reduce((W,K)=>W+K.value,0)>1&&p.value>0){let W=B.rooms.map((K,ee)=>ee===x?K.map(oe=>oe.ageCategoryId===p.ageCategoryId?{...oe,value:oe.value-1}:{...oe}):K);B.updateRooms(W)}}else if(p.value>0){let $=B.rooms.map((W,K)=>K===x?W.map(ee=>ee.ageCategoryId===p.ageCategoryId?{...ee,value:ee.value-1}:{...ee}):W);B.updateRooms($)}break;case"increment":if(this.computations(r).hasCapacity){let $=B.rooms.map((W,K)=>K===x?W.map(ee=>ee.ageCategoryId===p.ageCategoryId?{...ee,value:ee.value+1}:{...ee}):W);B.updateRooms($)}break}},{once:!1}),u.appendChild(y)}),s.innerHTML="",s.appendChild(u);let h=G("remove-room-button",o);h&&(h.classList.toggle("hide",B.rooms.length<=1),lt(h,"click",p=>{p.preventDefault();let y=B.rooms.filter((w,S)=>S!==i);B.updateRooms(y)})),t.appendChild(o)}),this.roomsWrapperElement.innerHTML="",this.roomsWrapperElement.appendChild(t);let{maxAllowedRooms:e}={maxAllowedRooms:B.maxAllowedRooms};console.log(`<<debug>> Current rooms: ${B.rooms.length}, Max allowed rooms: ${e}, Available rooms: ${this.parentComponent.apartmentProperties.availableRooms}`),e>0&&B.rooms.length>=e?(console.log(`<<debug>> Hiding add room button: current rooms ${B.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`),B.rooms.length>=this.parentComponent.apartmentProperties.availableRooms&&(console.log(`<<debug>> Hiding add room button: current rooms ${B.rooms.length} >= available rooms ${this.parentComponent.apartmentProperties.availableRooms}`),this.addRoomElement.classList.add("hide"))):(console.log(`<<debug>> Showing add room button: current rooms ${B.rooms.length} < max allowed or available rooms`),this.addRoomElement.classList.remove("hide"))}),lt(this.addRoomElement,"click",t=>{t.preventDefault();let{maxAllowedRooms:e}={maxAllowedRooms:B.maxAllowedRooms};if(B.rooms.length<e){let i=B.ageCategories.map(a=>{let s=a.classification.toLowerCase()==="adult",l=s?Pe("adults"):Pe("children"),u=s?1:0;return{isAdult:s,ageCategoryId:a.id,name:l,value:u}}),o=[...B.rooms,i];B.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 Ud=(n,t)=>{let e={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Qe("/images/getUrls",e,n)};function Vd(n){return n.ImageUrls.map(t=>({url:t.Url,imageId:t.ImageId}))}var Yc=Ze({}),qd={width:160,height:160};async function Wd(n,t){if(t.every(i=>Yc.value[i]))return t.map(i=>Yc.value[i]).flat();let e=await Ud(n,{Images:t.map(i=>({ImageId:i,Width:qd.width,Height:qd.height,ResizeMode:"Cover"}))}),r=Vd(e);return r.forEach(i=>{Yc.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=G("options-box"),this.productsWrapperElement=G("options-list",this.element),this.productTemplateElement=G("option-wrapper",this.element),this.showMoreButtonElement=G("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();[...B.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=ut(this.productTemplateElement,!0);o.removeAttribute("id");let a=G("name",o);a.textContent=r.name||"";let s=G("price",o);s.textContent=r.price.toLocaleString(qe,{style:"currency",currency:"EUR"});let l=G("label",o);l.textContent=Pe(`chargingMode:${r.chargingMode}`),Wd(this.parentComponent.apartmentProperties.enterpriseId,r.imageIds).then(h=>{let p=G("image",o);p.src=h[0].url});let u=G("checkbox",o);lt(u,"change",()=>{let h=mo(u),p=B.products.map(y=>y.id===r.id?{...y,selected:h==="true"}:y);B.updateProducts(p)}),o.classList.toggle("hide",i>3),t.appendChild(o)}),xc(this.productsWrapperElement),this.productsWrapperElement.appendChild(t),lt(this.showMoreButtonElement,"click",()=>{let r=this.showMoreProducts(3);this.showMoreButtonElement.classList.toggle("hide",!r)})}showMoreProducts(t=4){let e=this.productsWrapperElement.querySelectorAll(`${rd(this.productTemplateElement)}.hide`);return e.forEach((r,i)=>{i<t&&r.classList.toggle("hide",!1)}),e.length>t}};var Gd=(n,t)=>{let e=`${le.bookingEngine_url}/reservationGroups/create`,r={method:"POST",headers:le.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=G("payment-modal"),this.modalContent=G("modal-content",this.element),this.modalBg=G("modal-bg",this.element),this.openModalBtn=G("open-modal"),this.closeModalBtn=G("close-modal"),this.fNameInput=G("fname-input",this.element),this.lNameInput=G("lname-input",this.element),this.emailInput=G("email-input",this.element),this.phoneInput=G("phone-input",this.element),this.countryInput=G("country-input",this.element),this.notesInput=G("notes-input",this.element),this.submitPaymentBtn=G("submit-payment",this.element)}init(){console.log("Initialize PaymentModal"),this.updateDOM()}updateDOM(){lt(this.openModalBtn,"click",()=>{this.openModalBtn.hasAttribute("disabled")||(this.toggleVisibility(!0),this.element.scrollIntoView({behavior:"smooth"}))}),this.submitPaymentBtn?lt(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(!B.startDate||!B.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:B.startDate,endDate:B.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:le.bookingEngineClient,HotelId:this.parentComponent.apartmentProperties.enterpriseId,Customer:this.customer,Reservations:B.rooms.map(s=>({RoomCategoryId:this.parentComponent.apartmentProperties.categoryId,StartUtc:J.formatForAPI(t.toString()),EndUtc:J.formatForAPI(e.toString()),VoucherCode:B.couponCode||void 0,RateId:B.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:B.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()??Pe("proceedToPayment");this.submitPaymentBtn.textContent=Pe("completePayment"),this.submitPaymentBtn.classList.add("is-disabled");let a=await Gd(this.parentComponent.apartmentProperties.enterpriseId,r);if(console.log("Reservation Response:",a),"PaymentRequestId"in a&&a.PaymentRequestId){let l=Dn().iso639,u=Xu(l),h=new URL(window.location.href);h.pathname=l==="fr"?"/reservation-confirmee":`/${l}/confirmed-reservation`;let p=`https://app.mews.com/navigator/payment-requests/detail/${a.PaymentRequestId}?ccy=EUR&language=${encodeURIComponent(u)}&returnUrl=${btoa(h.toString())}`;console.log("Payment URL:",p),window.open(p,"_blank")}else if("Id"in a&&a.Id){console.log("Free reservation created successfully:",a);let l=Dn().iso639,u=new URL(window.location.href);u.pathname=l==="fr"?"/reservation-confirmee":`/${l}/confirmed-reservation`,u.searchParams.set("reservationId",a.Id),console.log("Confirmation URL:",u.toString()),window.location.href=u.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 Kd=(n,t)=>{let e=`${le.bookingEngine_url}/vouchers/validate`,r={method:"POST",headers:le.headers,body:JSON.stringify(t)};return Fn(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");rr("loading:start",e=>ir(!0,e)),rr("loading:end",e=>ir(!1,e)),this.element=G("summary-box"),this.summaryItemWrapperElement=G("summary-items-wrapper",this.element),this.summaryItemElement=G("summary-item",this.summaryItemWrapperElement),this.itemNameTemplateElement=G("name",this.summaryItemElement),this.itemRowTemplateElement=G("row",this.summaryItemElement),this.totalPriceElement=G("total",this.element),this.taxElement=G("tax",this.element),this.submitElement=G("submit",this.element),this.couponInputElement=G("coupon-input",this.element),this.couponApplyElement=G("apply-coupon",this.element),this.statusTextElement=G("status-text",this.element)}init(){this.updateDOM(),Je("loading:end",this.element)}refresh(){Je("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(){lt(this.couponInputElement,"input",()=>{B.updateCouponCode(mo(this.couponInputElement))}),lt(this.couponApplyElement,"click",async t=>{t.preventDefault(),Je("loading:start",this.element),Kd(this.parentComponent.apartmentProperties.enterpriseId,{Client:le.bookingEngineClient,HotelId:this.parentComponent.apartmentProperties.enterpriseId,VoucherCode:B.couponCode}).then(async e=>{let{IsValid:r}=e;if(this.statusTextElement.textContent=r?Pe("couponValid"):Pe("couponInvalid"),this.statusTextElement.style.color=r?"#1bcb00":"#f44900",r)try{Je("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=Pe("couponError"),this.statusTextElement.style.color="#f44900"}}).catch(e=>{console.error("Error validating coupon:",e),this.statusTextElement.textContent=Pe("couponError"),this.statusTextElement.style.color="#f44900"}).finally(()=>{Je("loading:end",this.element),this.statusTextElement.classList.toggle("hide",!1)})}),xt(()=>{this.couponInputElement.value!==B.couponCode&&po(this.couponInputElement,B.couponCode);let e=B.getReadonlyState().computed.summary;if(B.isFetching){ir(!0,this.element);return}ir(!1,this.element),this.summaryItemWrapperElement.innerHTML="",e.items.forEach(i=>{let o=this.summaryItemElement.cloneNode(!0),a=G("name",o),s=G("row",o),l=document.createDocumentFragment(),u=i.occupancy.adults||0,h=i.occupancy.children||0,p=ut(a,!0);p.textContent=`[${u} ${Pe("adults").toLowerCase()}${h>0?`, ${h} ${Pe("children").toLowerCase()}`:""}] x ${i.quantity}`,l.appendChild(p);let y=ut(a,!0);y.textContent=`${i.pricing.avgPerNight.toLocaleString(qe,{style:"currency",currency:"EUR"})}/ ${Pe("night")}`,l.appendChild(y);let w=ut(s,!0),S=G("label",w),T=G("price",w);if(S.textContent=`${Pe("pricingService")} (${B.nightsCount} ${Pe("night").toLowerCase()}${B.nightsCount>1?"s":""}):`,T.textContent=i.pricing.service.toLocaleString?.(qe,{style:"currency",currency:"EUR"})??null,l.appendChild(w),B.selectedProducts.length>0){let ce=ut(s,!0),F=G("label",ce);G("price",ce).remove();let Y=B.selectedProducts.map(se=>se.name).join(", ");F.textContent=`${Pe("pricingProducts")} ${Y}`,l.appendChild(ce)}let x=ut(s,!0),$=G("label",x);$.textContent=Pe("pricingProductsAndExtras");let W=G("price",x);W.textContent=i.pricing.products.toLocaleString(qe,{style:"currency",currency:"EUR"}),l.appendChild(x);let K=ut(s,!0),ee=G("label",K);ee.textContent=Pe("pricingTaxes");let oe=G("price",K);oe.textContent=i.pricing.taxes.toLocaleString(qe,{style:"currency",currency:"EUR"}),l.appendChild(K);let ae=ut(s,!0),Ce=G("label",ae);Ce.textContent=Pe("pricingSubtotal");let Se=G("price",ae);Se.textContent=i.pricing.subtotal.toLocaleString(qe,{style:"currency",currency:"EUR"}),l.appendChild(ae),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=G("offer-box"),this.tariffsWrapperElement=G("offers-list",this.element),this.tariffTemplateElement=G("offer-wrapper",this.element)}init(){this.updateDOM()}refresh(){}toggleVisibility(t=!0){this.element.classList.toggle("hide",!t)}updateDOM(){xt(()=>{if(B.isFetching){console.log("[TariffsSection] Skipping render during fetch operation");return}if(B.computedRates.length===0){console.log("[TariffsSection] No computed rates available, skipping render");return}console.log("[TariffsSection] Rendering tariffs:",{ratesCount:B.computedRates.length,isFetching:B.isFetching});let t=document.createDocumentFragment(),e=B.computedRates.sort((a,s)=>{let l=a.price?.AverageAmountPerTimeUnit?.GrossValue||0,u=s.price?.AverageAmountPerTimeUnit?.GrossValue||0;return l-u}),r=B.selectedRateId,i=r!==null&&e.some(a=>a.id===r),o=i?r:e[0]?.id;!i&&o&&queueMicrotask(()=>B.updateSelectedRateId(o)),e.forEach(a=>{let s=ut(this.tariffTemplateElement,!0);s.removeAttribute("id");let l=G("name",s);l.textContent=a.name;let u=G("description",s);u.textContent=a.description;let h=G("price",s),p=a.price?.AverageAmountPerTimeUnit?.GrossValue||0;h.textContent=p.toLocaleString(qe,{style:"currency",currency:"EUR"});let y=B.rates.find($=>$.id===a.id),w=G("label",s),S=G("discount-badge",s),T=G("discount-label",S);if(y)if(w.textContent=y.shortName,y.pricing?.DependentRatePricing){let $=y.pricing?.DependentRatePricing.RelativeAdjustment*100;$===0?S.classList.add("hide"):T.textContent=`${$>0?"+":""}${$}%`}else S.classList.add("hide");else w.classList.add("hide"),S.classList.add("hide");let x=G("radio-input",s);x.value=a.id,a.id===o&&(x.checked=!0,x.previousElementSibling?.classList.add("w--redirected-checked")),lt(x,"change",()=>{x.checked&&B.updateSelectedRateId(a.id)}),t.appendChild(s)}),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");rr("loading:start",e=>ir(!0,e)),rr("loading:end",e=>ir(!1,e)),this.apartmentProperties=t,B.setCmsApartmentData(t)}init(){Je("loading:start",document.body);let t=Yt.startDate?J.safeParsePlainDate(Yt.startDate):Sr,e=Yt.endDate?J.safeParsePlainDate(Yt.endDate):ei,r=t&&e?t.until(e).days:0,i=r>=1?t:Sr,o=r>=1?e:ei;i&&B.updateStartDate(i),o&&B.updateEndDate(o),this.fetchAPIData().then(()=>this.parseAPIData()).then(()=>this.initUIComponents()).catch(a=>{console.error("[ReservationComponent] fetchAPIData failed:",a),this.initUIComponents()}),console.log("#=> State:",B.getReadonlyState())}initUIComponents(){let t=B.rates.find(e=>e.isDefault||e.isBaseRate);console.log("#=> Default Rate:",t),B.updateSelectedRateId(t?.id||B.computedRates.find(e=>e.ordering===0&&e.groupOrdering===0)?.id||B.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(),Je("loading:end",document.body)}initPricingButler(){let t=(0,$c.default)(async()=>{console.log("[PricingButler] Fetching reservation pricing..."),await B.fetchReservationPricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId)},500);xt(()=>{let{rooms:e}=B,{startDate:r}=B,{endDate:i}=B,{selectedProducts:o}=B,{selectedRateId:a}=B,{couponCode:s}=B;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,$c.default)(async()=>{try{await B.fetchAvailability(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),await B.fetchServicePricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),Je("loading:end",document.body)}catch(e){console.error("Error updating availability and pricing data:",e)}},500);xt(()=>{Je("loading:start",document.body);let{startDate:e,endDate:r}={startDate:B.startDate,endDate:B.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()}),xt(()=>{Je("loading:start",document.body);let{availabilities:e,servicePricing:r,isAvailable:i,restrictionMessage:o}={availabilities:B.availabilities,servicePricing:B.servicePricing,isAvailable:B.isAvailable,restrictionMessage:B.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&&!B.selectedRateId&&B.computedRates.length>0){let a=B.rates.find(s=>s.isDefault||s.isBaseRate);B.updateSelectedRateId(a?.id||B.computedRates.find(s=>s.ordering===0&&s.groupOrdering===0)?.id||B.computedRates[0]?.id||null)}e&&r&&this.refreshUIComponents()})}async fetchAPIData(){console.log("#=> Fetching API data for reservation component..."),await B.initializeResources(this.apartmentProperties.enterpriseId),await B.initializeRooms(),await B.fetchHotel(this.apartmentProperties.enterpriseId),await B.fetchAvailability(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),await B.fetchServicePricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),await B.fetchReservationPricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId),await B.fetchRates(this.apartmentProperties.enterpriseId)}async parseAPIData(){}refreshUIComponents(){if(B.computedRates.length>0&&!B.selectedRateId){let t=B.rates.find(e=>e.isDefault||e.isBaseRate);B.updateSelectedRateId(t?.id||B.computedRates.find(e=>e.ordering===0&&e.groupOrdering===0)?.id||B.computedRates[0]?.id||null)}this.updateAvailabilityBanners(B.isAvailable,B.restrictionMessage),this.optionsSection&&(this.optionsSection.toggleVisibility(B.isAvailable),this.optionsSection.refresh()),this.tariffsSection&&(this.tariffsSection.toggleVisibility(B.isAvailable),this.tariffsSection.refresh()),this.summarySection&&(this.summarySection.toggleVisibility(B.isAvailable),this.summarySection.refresh()),Je("loading:end",document.body)}updateAvailabilityBanners(t,e){let r=G("banner-box"),i=G("banner-box-restriction"),o=G("banner-restriction-text"),a=G("open-modal");a&&(!!e||!t?a.setAttribute("disabled",""):a.removeAttribute("disabled")),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 B.fetchServicePricing(this.apartmentProperties.enterpriseId,this.apartmentProperties.categoryId);let t=await B.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&&xe.PlainDate.compare(t,e)>=0?(console.warn("Invalid date range: start date must be before end date"),!1):(t&&B.updateStartDate(t),e&&B.updateEndDate(e),!0)}scrollToTariffsSection(){let t=document.getElementById("tariff-section");t&&setTimeout(()=>{t.scrollIntoView({behavior:"smooth",block:"start"})},300)}};function tp(){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()=>{tp()});export{tp as initApparthotelsBookingTemplate};
8
8
  /*! Bundled license information:
9
9
 
10
10
  @vue/shared/dist/shared.esm-bundler.js: