UNPKG

puddysql

Version:

🍮 Powerful SQL toolkit for Node.js, built with flexibility and structure in mind. Easily manage SQLite3/PostgreSQL, advanced queries, smart tag systems, and full JSON-friendly filters.

2 lines 210 kB
/*! For license information please see PuddySqlTags.min.js.LICENSE.txt */
(()=>{var t={121:()=>{},251:(t,e)=>{e.read=function(t,e,r,n,o){var i,s,a=8*o-n-1,u=(1<<a)-1,l=u>>1,c=-7,f=r?o-1:0,p=r?-1:1,h=t[e+f];for(f+=p,i=h&(1<<-c)-1,h>>=-c,c+=a;c>0;i=256*i+t[e+f],f+=p,c-=8);for(s=i&(1<<-c)-1,i>>=-c,c+=n;c>0;s=256*s+t[e+f],f+=p,c-=8);if(0===i)i=1-l;else{if(i===u)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),i-=l}return(h?-1:1)*s*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var s,a,u,l=8*i-o-1,c=(1<<l)-1,f=c>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,g=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+f>=1?p/u:p*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=c?(a=0,s=c):s+f>=1?(a=(e*u-1)*Math.pow(2,o),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,o),s=0));o>=8;t[r+h]=255&a,h+=g,a/=256,o-=8);for(s=s<<o|a,l+=o;l>0;t[r+h]=255&s,h+=g,s/=256,l-=8);t[r+h-g]|=128*d}},287:(t,e,r)=>{"use strict";var n=r(526),o=r(251),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.hp=u,e.IS=50;var s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return f(t)}return l(t,e,r)}function l(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|d(t,e),n=a(r),o=n.write(t,e);return o!==r&&(n=n.slice(0,o)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(F(t,Uint8Array)){var e=new Uint8Array(t);return h(e.buffer,e.byteOffset,e.byteLength)}return p(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(F(t,ArrayBuffer)||t&&F(t.buffer,ArrayBuffer))return h(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(F(t,SharedArrayBuffer)||t&&F(t.buffer,SharedArrayBuffer)))return h(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return u.from(n,e,r);var o=function(t){if(u.isBuffer(t)){var e=0|g(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||$(t.length)?a(0):p(t):"Buffer"===t.type&&Array.isArray(t.data)?p(t.data):void 0}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function f(t){return c(t),a(t<0?0:0|g(t))}function p(t){for(var e=t.length<0?0:0|g(t.length),r=a(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function h(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,u.prototype),n}function g(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function d(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||F(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var o=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return P(t).length;default:if(o)return n?-1:H(t).length;e=(""+e).toLowerCase(),o=!0}}function m(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,r);case"utf8":case"utf-8":return S(this,e,r);case"ascii":return C(this,e,r);case"latin1":case"binary":return N(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function w(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),$(r=+r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,o){var i,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function l(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){var c=-1;for(i=r;i<a;i++)if(l(t,i)===l(e,-1===c?0:i-c)){if(-1===c&&(c=i),i-c+1===u)return c*s}else-1!==c&&(i-=i-c),c=-1}else for(r+u>a&&(r=a-u),i=r;i>=0;i--){for(var f=!0,p=0;p<u;p++)if(l(t,i+p)!==l(e,p)){f=!1;break}if(f)return i}return-1}function v(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;n>i/2&&(n=i/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if($(a))return s;t[r+s]=a}return s}function E(t,e,r,n){return j(H(e,t.length-r),t,r,n)}function _(t,e,r,n){return j(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function T(t,e,r,n){return j(P(e),t,r,n)}function A(t,e,r,n){return j(function(t,e){for(var r,n,o,i=[],s=0;s<t.length&&!((e-=2)<0);++s)n=(r=t.charCodeAt(s))>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function x(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function S(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,s,a,u,l=t[o],c=null,f=l>239?4:l>223?3:l>191?2:1;if(o+f<=r)switch(f){case 1:l<128&&(c=l);break;case 2:128==(192&(i=t[o+1]))&&(u=(31&l)<<6|63&i)>127&&(c=u);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&(u=(15&l)<<12|(63&i)<<6|63&s)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:i=t[o+1],s=t[o+2],a=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(u=(15&l)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),o+=f}return function(t){var e=t.length;if(e<=L)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=L));return r}(n)}u.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(t,e,r){return l(t,e,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(t,e,r){return function(t,e,r){return c(t),t<=0?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},u.allocUnsafe=function(t){return f(t)},u.allocUnsafeSlow=function(t){return f(t)},u.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==u.prototype},u.compare=function(t,e){if(F(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),F(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=u.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var i=t[r];if(F(i,Uint8Array))o+i.length>n.length?u.from(i).copy(n,o):Uint8Array.prototype.set.call(n,i,o);else{if(!u.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o)}o+=i.length}return n},u.byteLength=d,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)y(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},u.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?S(this,0,t):m.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",r=e.IS;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},i&&(u.prototype[i]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,o){if(F(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(i,s),l=this.slice(n,o),c=t.slice(e,r),f=0;f<a;++f)if(l[f]!==c[f]){i=l[f],s=c[f];break}return i<s?-1:s<i?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return w(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return w(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return _(this,t,e,r);case"base64":return T(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var L=4096;function C(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function N(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function I(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=U[t[i]];return o}function k(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length-1;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function R(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,r,n,o,i){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function B(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,n,i){return e=+e,r>>>=0,i||B(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function M(t,e,r,n,i){return e=+e,r>>>=0,i||B(t,0,r,8),o.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||R(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||R(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||R(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||R(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||R(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||R(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||R(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||R(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},u.prototype.readInt8=function(t,e){return t>>>=0,e||R(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||R(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||R(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return t>>>=0,e||R(t,4,this.length),o.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||R(t,4,this.length),o.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||R(t,8,this.length),o.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||R(t,8,this.length),o.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||O(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||O(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);O(this,t,e,r,o-1,-o)}var i=0,s=1,a=0;for(this[e]=255&t;++i<r&&(s*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/s|0)-a&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);O(this,t,e,r,o-1,-o)}var i=r-1,s=1,a=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/s|0)-a&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return M(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return M(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),o},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var o=t.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(t=o)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var s=u.isBuffer(t)?t:u.from(t,n),a=s.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=s[i%a]}return this};var W=/[^+/0-9A-Za-z-_]/g;function H(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function P(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function j(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function F(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function $(t){return t!=t}var U=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,o=0;o<16;++o)e[n+o]=t[r]+t[o];return e}()},494:()=>{},526:(t,e)=>{"use strict";e.byteLength=function(t){var e=a(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,i=a(t),s=i[0],u=i[1],l=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,u)),c=0,f=u>0?s-4:s;for(r=0;r<f;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],l[c++]=e>>16&255,l[c++]=e>>8&255,l[c++]=255&e;return 2===u&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,l[c++]=255&e),1===u&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,l[c++]=e>>8&255,l[c++]=255&e),l},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],s=16383,a=0,l=n-o;a<l;a+=s)i.push(u(t,a,a+s>l?l:a+s));return 1===o?(e=t[n-1],i.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],i.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=i[s],n[i.charCodeAt(s)]=s;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,n){for(var o,i,s=[],a=e;a<n;a+=3)o=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},543:function(t,e,r){var n;t=r.nmd(t),function(){var o,i="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",u=32,l=128,c=1/0,f=9007199254740991,p=NaN,h=4294967295,g=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",u],["partialRight",64],["rearg",256]],d="[object Arguments]",m="[object Array]",y="[object Boolean]",w="[object Date]",b="[object Error]",v="[object Function]",E="[object GeneratorFunction]",_="[object Map]",T="[object Number]",A="[object Object]",x="[object Promise]",S="[object RegExp]",L="[object Set]",C="[object String]",N="[object Symbol]",I="[object WeakMap]",k="[object ArrayBuffer]",R="[object DataView]",O="[object Float32Array]",B="[object Float64Array]",D="[object Int8Array]",M="[object Int16Array]",W="[object Int32Array]",H="[object Uint8Array]",P="[object Uint8ClampedArray]",j="[object Uint16Array]",F="[object Uint32Array]",$=/\b__p \+= '';/g,U=/\b(__p \+=) '' \+/g,z=/(__e\(.*?\)|\b__t\)) \+\n'';/g,J=/&(?:amp|lt|gt|quot|#39);/g,V=/[&<>"']/g,X=RegExp(J.source),K=RegExp(V.source),q=/<%-([\s\S]+?)%>/g,G=/<%([\s\S]+?)%>/g,Y=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,rt=RegExp(et.source),nt=/^\s+/,ot=/\s/,it=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,st=/\{\n\/\* \[wrapped with (.+)\] \*/,at=/,? & /,ut=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lt=/[()=,{}\[\]\/\s]/,ct=/\\(\\)?/g,ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pt=/\w*$/,ht=/^[-+]0x[0-9a-f]+$/i,gt=/^0b[01]+$/i,dt=/^\[object .+?Constructor\]$/,mt=/^0o[0-7]+$/i,yt=/^(?:0|[1-9]\d*)$/,wt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bt=/($^)/,vt=/['\n\r\u2028\u2029\\]/g,Et="\\ud800-\\udfff",_t="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Tt="\\u2700-\\u27bf",At="a-z\\xdf-\\xf6\\xf8-\\xff",xt="A-Z\\xc0-\\xd6\\xd8-\\xde",St="\\ufe0e\\ufe0f",Lt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ct="["+Et+"]",Nt="["+Lt+"]",It="["+_t+"]",kt="\\d+",Rt="["+Tt+"]",Ot="["+At+"]",Bt="[^"+Et+Lt+kt+Tt+At+xt+"]",Dt="\\ud83c[\\udffb-\\udfff]",Mt="[^"+Et+"]",Wt="(?:\\ud83c[\\udde6-\\uddff]){2}",Ht="[\\ud800-\\udbff][\\udc00-\\udfff]",Pt="["+xt+"]",jt="\\u200d",Ft="(?:"+Ot+"|"+Bt+")",$t="(?:"+Pt+"|"+Bt+")",Ut="(?:['’](?:d|ll|m|re|s|t|ve))?",zt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Jt="(?:"+It+"|"+Dt+")?",Vt="["+St+"]?",Xt=Vt+Jt+"(?:"+jt+"(?:"+[Mt,Wt,Ht].join("|")+")"+Vt+Jt+")*",Kt="(?:"+[Rt,Wt,Ht].join("|")+")"+Xt,qt="(?:"+[Mt+It+"?",It,Wt,Ht,Ct].join("|")+")",Gt=RegExp("['’]","g"),Yt=RegExp(It,"g"),Qt=RegExp(Dt+"(?="+Dt+")|"+qt+Xt,"g"),Zt=RegExp([Pt+"?"+Ot+"+"+Ut+"(?="+[Nt,Pt,"$"].join("|")+")",$t+"+"+zt+"(?="+[Nt,Pt+Ft,"$"].join("|")+")",Pt+"?"+Ft+"+"+Ut,Pt+"+"+zt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",kt,Kt].join("|"),"g"),te=RegExp("["+jt+Et+_t+St+"]"),ee=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,re=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ne=-1,oe={};oe[O]=oe[B]=oe[D]=oe[M]=oe[W]=oe[H]=oe[P]=oe[j]=oe[F]=!0,oe[d]=oe[m]=oe[k]=oe[y]=oe[R]=oe[w]=oe[b]=oe[v]=oe[_]=oe[T]=oe[A]=oe[S]=oe[L]=oe[C]=oe[I]=!1;var ie={};ie[d]=ie[m]=ie[k]=ie[R]=ie[y]=ie[w]=ie[O]=ie[B]=ie[D]=ie[M]=ie[W]=ie[_]=ie[T]=ie[A]=ie[S]=ie[L]=ie[C]=ie[N]=ie[H]=ie[P]=ie[j]=ie[F]=!0,ie[b]=ie[v]=ie[I]=!1;var se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ae=parseFloat,ue=parseInt,le="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,ce="object"==typeof self&&self&&self.Object===Object&&self,fe=le||ce||Function("return this")(),pe=e&&!e.nodeType&&e,he=pe&&t&&!t.nodeType&&t,ge=he&&he.exports===pe,de=ge&&le.process,me=function(){try{return he&&he.require&&he.require("util").types||de&&de.binding&&de.binding("util")}catch(t){}}(),ye=me&&me.isArrayBuffer,we=me&&me.isDate,be=me&&me.isMap,ve=me&&me.isRegExp,Ee=me&&me.isSet,_e=me&&me.isTypedArray;function Te(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Ae(t,e,r,n){for(var o=-1,i=null==t?0:t.length;++o<i;){var s=t[o];e(n,s,r(s),t)}return n}function xe(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t}function Se(t,e){for(var r=null==t?0:t.length;r--&&!1!==e(t[r],r,t););return t}function Le(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}function Ce(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var s=t[r];e(s,r,t)&&(i[o++]=s)}return i}function Ne(t,e){return!(null==t||!t.length)&&Pe(t,e,0)>-1}function Ie(t,e,r){for(var n=-1,o=null==t?0:t.length;++n<o;)if(r(e,t[n]))return!0;return!1}function ke(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}function Re(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}function Oe(t,e,r,n){var o=-1,i=null==t?0:t.length;for(n&&i&&(r=t[++o]);++o<i;)r=e(r,t[o],o,t);return r}function Be(t,e,r,n){var o=null==t?0:t.length;for(n&&o&&(r=t[--o]);o--;)r=e(r,t[o],o,t);return r}function De(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}var Me=Ue("length");function We(t,e,r){var n;return r(t,(function(t,r,o){if(e(t,r,o))return n=r,!1})),n}function He(t,e,r,n){for(var o=t.length,i=r+(n?1:-1);n?i--:++i<o;)if(e(t[i],i,t))return i;return-1}function Pe(t,e,r){return e==e?function(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}(t,e,r):He(t,Fe,r)}function je(t,e,r,n){for(var o=r-1,i=t.length;++o<i;)if(n(t[o],e))return o;return-1}function Fe(t){return t!=t}function $e(t,e){var r=null==t?0:t.length;return r?Ve(t,e)/r:p}function Ue(t){return function(e){return null==e?o:e[t]}}function ze(t){return function(e){return null==t?o:t[e]}}function Je(t,e,r,n,o){return o(t,(function(t,o,i){r=n?(n=!1,t):e(r,t,o,i)})),r}function Ve(t,e){for(var r,n=-1,i=t.length;++n<i;){var s=e(t[n]);s!==o&&(r=r===o?s:r+s)}return r}function Xe(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function Ke(t){return t?t.slice(0,fr(t)+1).replace(nt,""):t}function qe(t){return function(e){return t(e)}}function Ge(t,e){return ke(e,(function(e){return t[e]}))}function Ye(t,e){return t.has(e)}function Qe(t,e){for(var r=-1,n=t.length;++r<n&&Pe(e,t[r],0)>-1;);return r}function Ze(t,e){for(var r=t.length;r--&&Pe(e,t[r],0)>-1;);return r}var tr=ze({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),er=ze({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function rr(t){return"\\"+se[t]}function nr(t){return te.test(t)}function or(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function ir(t,e){return function(r){return t(e(r))}}function sr(t,e){for(var r=-1,n=t.length,o=0,i=[];++r<n;){var s=t[r];s!==e&&s!==a||(t[r]=a,i[o++]=r)}return i}function ar(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}function ur(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=[t,t]})),r}function lr(t){return nr(t)?function(t){for(var e=Qt.lastIndex=0;Qt.test(t);)++e;return e}(t):Me(t)}function cr(t){return nr(t)?function(t){return t.match(Qt)||[]}(t):function(t){return t.split("")}(t)}function fr(t){for(var e=t.length;e--&&ot.test(t.charAt(e)););return e}var pr=ze({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),hr=function t(e){var r,n=(e=null==e?fe:hr.defaults(fe.Object(),e,hr.pick(fe,re))).Array,ot=e.Date,Et=e.Error,_t=e.Function,Tt=e.Math,At=e.Object,xt=e.RegExp,St=e.String,Lt=e.TypeError,Ct=n.prototype,Nt=_t.prototype,It=At.prototype,kt=e["__core-js_shared__"],Rt=Nt.toString,Ot=It.hasOwnProperty,Bt=0,Dt=(r=/[^.]+$/.exec(kt&&kt.keys&&kt.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",Mt=It.toString,Wt=Rt.call(At),Ht=fe._,Pt=xt("^"+Rt.call(Ot).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),jt=ge?e.Buffer:o,Ft=e.Symbol,$t=e.Uint8Array,Ut=jt?jt.allocUnsafe:o,zt=ir(At.getPrototypeOf,At),Jt=At.create,Vt=It.propertyIsEnumerable,Xt=Ct.splice,Kt=Ft?Ft.isConcatSpreadable:o,qt=Ft?Ft.iterator:o,Qt=Ft?Ft.toStringTag:o,te=function(){try{var t=li(At,"defineProperty");return t({},"",{}),t}catch(t){}}(),se=e.clearTimeout!==fe.clearTimeout&&e.clearTimeout,le=ot&&ot.now!==fe.Date.now&&ot.now,ce=e.setTimeout!==fe.setTimeout&&e.setTimeout,pe=Tt.ceil,he=Tt.floor,de=At.getOwnPropertySymbols,me=jt?jt.isBuffer:o,Me=e.isFinite,ze=Ct.join,gr=ir(At.keys,At),dr=Tt.max,mr=Tt.min,yr=ot.now,wr=e.parseInt,br=Tt.random,vr=Ct.reverse,Er=li(e,"DataView"),_r=li(e,"Map"),Tr=li(e,"Promise"),Ar=li(e,"Set"),xr=li(e,"WeakMap"),Sr=li(At,"create"),Lr=xr&&new xr,Cr={},Nr=Wi(Er),Ir=Wi(_r),kr=Wi(Tr),Rr=Wi(Ar),Or=Wi(xr),Br=Ft?Ft.prototype:o,Dr=Br?Br.valueOf:o,Mr=Br?Br.toString:o;function Wr(t){if(ta(t)&&!Us(t)&&!(t instanceof Fr)){if(t instanceof jr)return t;if(Ot.call(t,"__wrapped__"))return Hi(t)}return new jr(t)}var Hr=function(){function t(){}return function(e){if(!Zs(e))return{};if(Jt)return Jt(e);t.prototype=e;var r=new t;return t.prototype=o,r}}();function Pr(){}function jr(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=o}function Fr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}function $r(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Ur(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function zr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Jr(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new zr;++e<r;)this.add(t[e])}function Vr(t){var e=this.__data__=new Ur(t);this.size=e.size}function Xr(t,e){var r=Us(t),n=!r&&$s(t),o=!r&&!n&&Xs(t),i=!r&&!n&&!o&&ua(t),s=r||n||o||i,a=s?Xe(t.length,St):[],u=a.length;for(var l in t)!e&&!Ot.call(t,l)||s&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||mi(l,u))||a.push(l);return a}function Kr(t){var e=t.length;return e?t[Jn(0,e-1)]:o}function qr(t,e){return Ri(Lo(t),on(e,0,t.length))}function Gr(t){return Ri(Lo(t))}function Yr(t,e,r){(r!==o&&!Ps(t[e],r)||r===o&&!(e in t))&&rn(t,e,r)}function Qr(t,e,r){var n=t[e];Ot.call(t,e)&&Ps(n,r)&&(r!==o||e in t)||rn(t,e,r)}function Zr(t,e){for(var r=t.length;r--;)if(Ps(t[r][0],e))return r;return-1}function tn(t,e,r,n){return cn(t,(function(t,o,i){e(n,t,r(t),i)})),n}function en(t,e){return t&&Co(e,Ia(e),t)}function rn(t,e,r){"__proto__"==e&&te?te(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function nn(t,e){for(var r=-1,i=e.length,s=n(i),a=null==t;++r<i;)s[r]=a?o:xa(t,e[r]);return s}function on(t,e,r){return t==t&&(r!==o&&(t=t<=r?t:r),e!==o&&(t=t>=e?t:e)),t}function sn(t,e,r,n,i,s){var a,u=1&e,l=2&e,c=4&e;if(r&&(a=i?r(t,n,i,s):r(t)),a!==o)return a;if(!Zs(t))return t;var f=Us(t);if(f){if(a=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&Ot.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!u)return Lo(t,a)}else{var p=pi(t),h=p==v||p==E;if(Xs(t))return Eo(t,u);if(p==A||p==d||h&&!i){if(a=l||h?{}:gi(t),!u)return l?function(t,e){return Co(t,fi(t),e)}(t,function(t,e){return t&&Co(e,ka(e),t)}(a,t)):function(t,e){return Co(t,ci(t),e)}(t,en(a,t))}else{if(!ie[p])return i?t:{};a=function(t,e,r){var n,o=t.constructor;switch(e){case k:return _o(t);case y:case w:return new o(+t);case R:return function(t,e){var r=e?_o(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case O:case B:case D:case M:case W:case H:case P:case j:case F:return To(t,r);case _:return new o;case T:case C:return new o(t);case S:return function(t){var e=new t.constructor(t.source,pt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case L:return new o;case N:return n=t,Dr?At(Dr.call(n)):{}}}(t,p,u)}}s||(s=new Vr);var g=s.get(t);if(g)return g;s.set(t,a),ia(t)?t.forEach((function(n){a.add(sn(n,e,r,n,t,s))})):ea(t)&&t.forEach((function(n,o){a.set(o,sn(n,e,r,o,t,s))}));var m=f?o:(c?l?ri:ei:l?ka:Ia)(t);return xe(m||t,(function(n,o){m&&(n=t[o=n]),Qr(a,o,sn(n,e,r,o,t,s))})),a}function an(t,e,r){var n=r.length;if(null==t)return!n;for(t=At(t);n--;){var i=r[n],s=e[i],a=t[i];if(a===o&&!(i in t)||!s(a))return!1}return!0}function un(t,e,r){if("function"!=typeof t)throw new Lt(i);return Ci((function(){t.apply(o,r)}),e)}function ln(t,e,r,n){var o=-1,i=Ne,s=!0,a=t.length,u=[],l=e.length;if(!a)return u;r&&(e=ke(e,qe(r))),n?(i=Ie,s=!1):e.length>=200&&(i=Ye,s=!1,e=new Jr(e));t:for(;++o<a;){var c=t[o],f=null==r?c:r(c);if(c=n||0!==c?c:0,s&&f==f){for(var p=l;p--;)if(e[p]===f)continue t;u.push(c)}else i(e,f,n)||u.push(c)}return u}Wr.templateSettings={escape:q,evaluate:G,interpolate:Y,variable:"",imports:{_:Wr}},Wr.prototype=Pr.prototype,Wr.prototype.constructor=Wr,jr.prototype=Hr(Pr.prototype),jr.prototype.constructor=jr,Fr.prototype=Hr(Pr.prototype),Fr.prototype.constructor=Fr,$r.prototype.clear=function(){this.__data__=Sr?Sr(null):{},this.size=0},$r.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},$r.prototype.get=function(t){var e=this.__data__;if(Sr){var r=e[t];return r===s?o:r}return Ot.call(e,t)?e[t]:o},$r.prototype.has=function(t){var e=this.__data__;return Sr?e[t]!==o:Ot.call(e,t)},$r.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Sr&&e===o?s:e,this},Ur.prototype.clear=function(){this.__data__=[],this.size=0},Ur.prototype.delete=function(t){var e=this.__data__,r=Zr(e,t);return!(r<0||(r==e.length-1?e.pop():Xt.call(e,r,1),--this.size,0))},Ur.prototype.get=function(t){var e=this.__data__,r=Zr(e,t);return r<0?o:e[r][1]},Ur.prototype.has=function(t){return Zr(this.__data__,t)>-1},Ur.prototype.set=function(t,e){var r=this.__data__,n=Zr(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},zr.prototype.clear=function(){this.size=0,this.__data__={hash:new $r,map:new(_r||Ur),string:new $r}},zr.prototype.delete=function(t){var e=ai(this,t).delete(t);return this.size-=e?1:0,e},zr.prototype.get=function(t){return ai(this,t).get(t)},zr.prototype.has=function(t){return ai(this,t).has(t)},zr.prototype.set=function(t,e){var r=ai(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},Jr.prototype.add=Jr.prototype.push=function(t){return this.__data__.set(t,s),this},Jr.prototype.has=function(t){return this.__data__.has(t)},Vr.prototype.clear=function(){this.__data__=new Ur,this.size=0},Vr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Vr.prototype.get=function(t){return this.__data__.get(t)},Vr.prototype.has=function(t){return this.__data__.has(t)},Vr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Ur){var n=r.__data__;if(!_r||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new zr(n)}return r.set(t,e),this.size=r.size,this};var cn=ko(wn),fn=ko(bn,!0);function pn(t,e){var r=!0;return cn(t,(function(t,n,o){return r=!!e(t,n,o)})),r}function hn(t,e,r){for(var n=-1,i=t.length;++n<i;){var s=t[n],a=e(s);if(null!=a&&(u===o?a==a&&!aa(a):r(a,u)))var u=a,l=s}return l}function gn(t,e){var r=[];return cn(t,(function(t,n,o){e(t,n,o)&&r.push(t)})),r}function dn(t,e,r,n,o){var i=-1,s=t.length;for(r||(r=di),o||(o=[]);++i<s;){var a=t[i];e>0&&r(a)?e>1?dn(a,e-1,r,n,o):Re(o,a):n||(o[o.length]=a)}return o}var mn=Ro(),yn=Ro(!0);function wn(t,e){return t&&mn(t,e,Ia)}function bn(t,e){return t&&yn(t,e,Ia)}function vn(t,e){return Ce(e,(function(e){return Gs(t[e])}))}function En(t,e){for(var r=0,n=(e=yo(e,t)).length;null!=t&&r<n;)t=t[Mi(e[r++])];return r&&r==n?t:o}function _n(t,e,r){var n=e(t);return Us(t)?n:Re(n,r(t))}function Tn(t){return null==t?t===o?"[object Undefined]":"[object Null]":Qt&&Qt in At(t)?function(t){var e=Ot.call(t,Qt),r=t[Qt];try{t[Qt]=o;var n=!0}catch(t){}var i=Mt.call(t);return n&&(e?t[Qt]=r:delete t[Qt]),i}(t):function(t){return Mt.call(t)}(t)}function An(t,e){return t>e}function xn(t,e){return null!=t&&Ot.call(t,e)}function Sn(t,e){return null!=t&&e in At(t)}function Ln(t,e,r){for(var i=r?Ie:Ne,s=t[0].length,a=t.length,u=a,l=n(a),c=1/0,f=[];u--;){var p=t[u];u&&e&&(p=ke(p,qe(e))),c=mr(p.length,c),l[u]=!r&&(e||s>=120&&p.length>=120)?new Jr(u&&p):o}p=t[0];var h=-1,g=l[0];t:for(;++h<s&&f.length<c;){var d=p[h],m=e?e(d):d;if(d=r||0!==d?d:0,!(g?Ye(g,m):i(f,m,r))){for(u=a;--u;){var y=l[u];if(!(y?Ye(y,m):i(t[u],m,r)))continue t}g&&g.push(m),f.push(d)}}return f}function Cn(t,e,r){var n=null==(t=xi(t,e=yo(e,t)))?t:t[Mi(qi(e))];return null==n?o:Te(n,t,r)}function Nn(t){return ta(t)&&Tn(t)==d}function In(t,e,r,n,i){return t===e||(null==t||null==e||!ta(t)&&!ta(e)?t!=t&&e!=e:function(t,e,r,n,i,s){var a=Us(t),u=Us(e),l=a?m:pi(t),c=u?m:pi(e),f=(l=l==d?A:l)==A,p=(c=c==d?A:c)==A,h=l==c;if(h&&Xs(t)){if(!Xs(e))return!1;a=!0,f=!1}if(h&&!f)return s||(s=new Vr),a||ua(t)?Zo(t,e,r,n,i,s):function(t,e,r,n,o,i,s){switch(r){case R:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case k:return!(t.byteLength!=e.byteLength||!i(new $t(t),new $t(e)));case y:case w:case T:return Ps(+t,+e);case b:return t.name==e.name&&t.message==e.message;case S:case C:return t==e+"";case _:var a=or;case L:var u=1&n;if(a||(a=ar),t.size!=e.size&&!u)return!1;var l=s.get(t);if(l)return l==e;n|=2,s.set(t,e);var c=Zo(a(t),a(e),n,o,i,s);return s.delete(t),c;case N:if(Dr)return Dr.call(t)==Dr.call(e)}return!1}(t,e,l,r,n,i,s);if(!(1&r)){var g=f&&Ot.call(t,"__wrapped__"),v=p&&Ot.call(e,"__wrapped__");if(g||v){var E=g?t.value():t,x=v?e.value():e;return s||(s=new Vr),i(E,x,r,n,s)}}return!!h&&(s||(s=new Vr),function(t,e,r,n,i,s){var a=1&r,u=ei(t),l=u.length;if(l!=ei(e).length&&!a)return!1;for(var c=l;c--;){var f=u[c];if(!(a?f in e:Ot.call(e,f)))return!1}var p=s.get(t),h=s.get(e);if(p&&h)return p==e&&h==t;var g=!0;s.set(t,e),s.set(e,t);for(var d=a;++c<l;){var m=t[f=u[c]],y=e[f];if(n)var w=a?n(y,m,f,e,t,s):n(m,y,f,t,e,s);if(!(w===o?m===y||i(m,y,r,n,s):w)){g=!1;break}d||(d="constructor"==f)}if(g&&!d){var b=t.constructor,v=e.constructor;b==v||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof v&&v instanceof v||(g=!1)}return s.delete(t),s.delete(e),g}(t,e,r,n,i,s))}(t,e,r,n,In,i))}function kn(t,e,r,n){var i=r.length,s=i,a=!n;if(null==t)return!s;for(t=At(t);i--;){var u=r[i];if(a&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++i<s;){var l=(u=r[i])[0],c=t[l],f=u[1];if(a&&u[2]){if(c===o&&!(l in t))return!1}else{var p=new Vr;if(n)var h=n(c,f,l,t,e,p);if(!(h===o?In(f,c,3,n,p):h))return!1}}return!0}function Rn(t){return!(!Zs(t)||(e=t,Dt&&Dt in e))&&(Gs(t)?Pt:dt).test(Wi(t));var e}function On(t){return"function"==typeof t?t:null==t?ru:"object"==typeof t?Us(t)?Hn(t[0],t[1]):Wn(t):fu(t)}function Bn(t){if(!Ei(t))return gr(t);var e=[];for(var r in At(t))Ot.call(t,r)&&"constructor"!=r&&e.push(r);return e}function Dn(t,e){return t<e}function Mn(t,e){var r=-1,o=Js(t)?n(t.length):[];return cn(t,(function(t,n,i){o[++r]=e(t,n,i)})),o}function Wn(t){var e=ui(t);return 1==e.length&&e[0][2]?Ti(e[0][0],e[0][1]):function(r){return r===t||kn(r,t,e)}}function Hn(t,e){return wi(t)&&_i(e)?Ti(Mi(t),e):function(r){var n=xa(r,t);return n===o&&n===e?Sa(r,t):In(e,n,3)}}function Pn(t,e,r,n,i){t!==e&&mn(e,(function(s,a){if(i||(i=new Vr),Zs(s))!function(t,e,r,n,i,s,a){var u=Si(t,r),l=Si(e,r),c=a.get(l);if(c)Yr(t,r,c);else{var f=s?s(u,l,r+"",t,e,a):o,p=f===o;if(p){var h=Us(l),g=!h&&Xs(l),d=!h&&!g&&ua(l);f=l,h||g||d?Us(u)?f=u:Vs(u)?f=Lo(u):g?(p=!1,f=Eo(l,!0)):d?(p=!1,f=To(l,!0)):f=[]:na(l)||$s(l)?(f=u,$s(u)?f=ma(u):Zs(u)&&!Gs(u)||(f=gi(l))):p=!1}p&&(a.set(l,f),i(f,l,n,s,a),a.delete(l)),Yr(t,r,f)}}(t,e,a,r,Pn,n,i);else{var u=n?n(Si(t,a),s,a+"",t,e,i):o;u===o&&(u=s),Yr(t,a,u)}}),ka)}function jn(t,e){var r=t.length;if(r)return mi(e+=e<0?r:0,r)?t[e]:o}function Fn(t,e,r){e=e.length?ke(e,(function(t){return Us(t)?function(e){return En(e,1===t.length?t[0]:t)}:t})):[ru];var n=-1;e=ke(e,qe(si()));var o=Mn(t,(function(t,r,o){var i=ke(e,(function(e){return e(t)}));return{criteria:i,index:++n,value:t}}));return function(t){var e=t.length;for(t.sort((function(t,e){return function(t,e,r){for(var n=-1,o=t.criteria,i=e.criteria,s=o.length,a=r.length;++n<s;){var u=Ao(o[n],i[n]);if(u)return n>=a?u:u*("desc"==r[n]?-1:1)}return t.index-e.index}(t,e,r)}));e--;)t[e]=t[e].value;return t}(o)}function $n(t,e,r){for(var n=-1,o=e.length,i={};++n<o;){var s=e[n],a=En(t,s);r(a,s)&&Gn(i,yo(s,t),a)}return i}function Un(t,e,r,n){var o=n?je:Pe,i=-1,s=e.length,a=t;for(t===e&&(e=Lo(e)),r&&(a=ke(t,qe(r)));++i<s;)for(var u=0,l=e[i],c=r?r(l):l;(u=o(a,c,u,n))>-1;)a!==t&&Xt.call(a,u,1),Xt.call(t,u,1);return t}function zn(t,e){for(var r=t?e.length:0,n=r-1;r--;){var o=e[r];if(r==n||o!==i){var i=o;mi(o)?Xt.call(t,o,1):uo(t,o)}}return t}function Jn(t,e){return t+he(br()*(e-t+1))}function Vn(t,e){var r="";if(!t||e<1||e>f)return r;do{e%2&&(r+=t),(e=he(e/2))&&(t+=t)}while(e);return r}function Xn(t,e){return Ni(Ai(t,e,ru),t+"")}function Kn(t){return Kr(Pa(t))}function qn(t,e){var r=Pa(t);return Ri(r,on(e,0,r.length))}function Gn(t,e,r,n){if(!Zs(t))return t;for(var i=-1,s=(e=yo(e,t)).length,a=s-1,u=t;null!=u&&++i<s;){var l=Mi(e[i]),c=r;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(i!=a){var f=u[l];(c=n?n(f,l,u):o)===o&&(c=Zs(f)?f:mi(e[i+1])?[]:{})}Qr(u,l,c),u=u[l]}return t}var Yn=Lr?function(t,e){return Lr.set(t,e),t}:ru,Qn=te?function(t,e){return te(t,"toString",{configurable:!0,enumerable:!1,value:Za(e),writable:!0})}:ru;function Zn(t){return Ri(Pa(t))}function to(t,e,r){var o=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var s=n(i);++o<i;)s[o]=t[o+e];return s}function eo(t,e){var r;return cn(t,(function(t,n,o){return!(r=e(t,n,o))})),!!r}function ro(t,e,r){var n=0,o=null==t?n:t.length;if("number"==typeof e&&e==e&&o<=2147483647){for(;n<o;){var i=n+o>>>1,s=t[i];null!==s&&!aa(s)&&(r?s<=e:s<e)?n=i+1:o=i}return o}return no(t,e,ru,r)}function no(t,e,r,n){var i=0,s=null==t?0:t.length;if(0===s)return 0;for(var a=(e=r(e))!=e,u=null===e,l=aa(e),c=e===o;i<s;){var f=he((i+s)/2),p=r(t[f]),h=p!==o,g=null===p,d=p==p,m=aa(p);if(a)var y=n||d;else y=c?d&&(n||h):u?d&&h&&(n||!g):l?d&&h&&!g&&(n||!m):!g&&!m&&(n?p<=e:p<e);y?i=f+1:s=f}return mr(s,4294967294)}function oo(t,e){for(var r=-1,n=t.length,o=0,i=[];++r<n;){var s=t[r],a=e?e(s):s;if(!r||!Ps(a,u)){var u=a;i[o++]=0===s?0:s}}return i}function io(t){return"number"==typeof t?t:aa(t)?p:+t}function so(t){if("string"==typeof t)return t;if(Us(t))return ke(t,so)+"";if(aa(t))return Mr?Mr.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ao(t,e,r){var n=-1,o=Ne,i=t.length,s=!0,a=[],u=a;if(r)s=!1,o=Ie;else if(i>=200){var l=e?null:Xo(t);if(l)return ar(l);s=!1,o=Ye,u=new Jr}else u=e?[]:a;t:for(;++n<i;){var c=t[n],f=e?e(c):c;if(c=r||0!==c?c:0,s&&f==f){for(var p=u.length;p--;)if(u[p]===f)continue t;e&&u.push(f),a.push(c)}else o(u,f,r)||(u!==a&&u.push(f),a.push(c))}return a}function uo(t,e){return null==(t=xi(t,e=yo(e,t)))||delete t[Mi(qi(e))]}function lo(t,e,r,n){return Gn(t,e,r(En(t,e)),n)}function co(t,e,r,n){for(var o=t.length,i=n?o:-1;(n?i--:++i<o)&&e(t[i],i,t););return r?to(t,n?0:i,n?i+1:o):to(t,n?i+1:0,n?o:i)}function fo(t,e){var r=t;return r instanceof Fr&&(r=r.value()),Oe(e,(function(t,e){return e.func.apply(e.thisArg,Re([t],e.args))}),r)}function po(t,e,r){var o=t.length;if(o<2)return o?ao(t[0]):[];for(var i=-1,s=n(o);++i<o;)for(var a=t[i],u=-1;++u<o;)u!=i&&(s[i]=ln(s[i]||a,t[u],e,r));return ao(dn(s,1),e,r)}function ho(t,e,r){for(var n=-1,i=t.length,s=e.length,a={};++n<i;){var u=n<s?e[n]:o;r(a,t[n],u)}return a}function go(t){return Vs(t)?t:[]}function mo(t){return"function"==typeof t?t:ru}function yo(t,e){return Us(t)?t:wi(t,e)?[t]:Di(ya(t))}var wo=Xn;function bo(t,e,r){var n=t.length;return r=r===o?n:r,!e&&r>=n?t:to(t,e,r)}var vo=se||function(t){return fe.clearTimeout(t)};function Eo(t,e){if(e)return t.slice();var r=t.length,n=Ut?Ut(r):new t.constructor(r);return t.copy(n),n}function _o(t){var e=new t.constructor(t.byteLength);return new $t(e).set(new $t(t)),e}function To(t,e){var r=e?_o(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Ao(t,e){if(t!==e){var r=t!==o,n=null===t,i=t==t,s=aa(t),a=e!==o,u=null===e,l=e==e,c=aa(e);if(!u&&!c&&!s&&t>e||s&&a&&l&&!u&&!c||n&&a&&l||!r&&l||!i)return 1;if(!n&&!s&&!c&&t<e||c&&r&&i&&!n&&!s||u&&r&&i||!a&&i||!l)return-1}return 0}function xo(t,e,r,o){for(var i=-1,s=t.length,a=r.length,u=-1,l=e.length,c=dr(s-a,0),f=n(l+c),p=!o;++u<l;)f[u]=e[u];for(;++i<a;)(p||i<s)&&(f[r[i]]=t[i]);for(;c--;)f[u++]=t[i++];return f}function So(t,e,r,o){for(var i=-1,s=t.length,a=-1,u=r.length,l=-1,c=e.length,f=dr(s-u,0),p=n(f+c),h=!o;++i<f;)p[i]=t[i];for(var g=i;++l<c;)p[g+l]=e[l];for(;++a<u;)(h||i<s)&&(p[g+r[a]]=t[i++]);return p}function Lo(t,e){var r=-1,o=t.length;for(e||(e=n(o));++r<o;)e[r]=t[r];return e}function Co(t,e,r,n){var i=!r;r||(r={});for(var s=-1,a=e.length;++s<a;){var u=e[s],l=n?n(r[u],t[u],u,r,t):o;l===o&&(l=t[u]),i?rn(r,u,l):Qr(r,u,l)}return r}function No(t,e){return function(r,n){var o=Us(r)?Ae:tn,i=e?e():{};return o(r,t,si(n,2),i)}}function Io(t){return Xn((function(e,r){var n=-1,i=r.length,s=i>1?r[i-1]:o,a=i>2?r[2]:o;for(s=t.length>3&&"function"==typeof s?(i--,s):o,a&&yi(r[0],r[1],a)&&(s=i<3?o:s,i=1),e=At(e);++n<i;){var u=r[n];u&&t(e,u,n,s)}return e}))}function ko(t,e){return function(r,n){if(null==r)return r;if(!Js(r))return t(r,n);for(var o=r.length,i=e?o:-1,s=At(r);(e?i--:++i<o)&&!1!==n(s[i],i,s););return r}}function Ro(t){return function(e,r,n){for(var o=-1,i=At(e),s=n(e),a=s.length;a--;){var u=s[t?a:++o];if(!1===r(i[u],u,i))break}return e}}function Oo(t){return function(e){var r=nr(e=ya(e))?cr(e):o,n=r?r[0]:e.charAt(0),i=r?bo(r,1).join(""):e.slice(1);return n[t]()+i}}function Bo(t){return function(e){return Oe(Ga($a(e).replace(Gt,"")),t,"")}}function Do(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var r=Hr(t.prototype),n=t.apply(r,e);return Zs(n)?n:r}}function Mo(t){return function(e,r,n){var i=At(e);if(!Js(e)){var s=si(r,3);e=Ia(e),r=function(t){return s(i[t],t,i)}}var a=t(e,r,n);return a>-1?i[s?e[a]:a]:o}}function Wo(t){return ti((function(e){var r=e.length,n=r,s=jr.prototype.thru;for(t&&e.reverse();n--;){var a=e[n];if("function"!=typeof a)throw new Lt(i);if(s&&!u&&"wrapper"==oi(a))var u=new jr([],!0)}for(n=u?n:r;++n<r;){var l=oi(a=e[n]),c="wrapper"==l?ni(a):o;u=c&&bi(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?u[oi(c[0])].apply(u,c[3]):1==a.length&&bi(a)?u[l]():u.thru(a)}return function(){var t=arguments,n=t[0];if(u&&1==t.length&&Us(n))return u.plant(n).value();for(var o=0,i=r?e[o].apply(this,t):n;++o<r;)i=e[o].call(this,i);return i}}))}function Ho(t,e,r,i,s,a,u,c,f,p){var h=e&l,g=1&e,d=2&e,m=24&e,y=512&e,w=d?o:Do(t);return function l(){for(var b=arguments.length,v=n(b),E=b;E--;)v[E]=arguments[E];if(m)var _=ii(l),T=function(t,e){for(var r=t.length,n=0;r--;)t[r]===e&&++n;return n}(v,_);if(i&&(v=xo(v,i,s,m)),a&&(v=So(v,a,u,m)),b-=T,m&&b<p){var A=sr(v,_);return Jo(t,e,Ho,l.placeholder,r,v,A,c,f,p-b)}var x=g?r:this,S=d?x[t]:t;return b=v.length,c?v=function(t,e){for(var r=t.length,n=mr(e.length,r),i=Lo(t);n--;){var s=e[n];t[n]=mi(s,r)?i[s]:o}return t}(v,c):y&&b>1&&v.reverse(),h&&f<b&&(v.length=f),this&&this!==fe&&this instanceof l&&(S=w||Do(S)),S.apply(x,v)}}function Po(t,e){return function(r,n){return function(t,e,r,n){return wn(t,(function(t,o,i){e(n,r(t),o,i)})),n}(r,t,e(n),{})}}function jo(t,e){return function(r,n){var i;if(r===o&&n===o)return e;if(r!==o&&(i=r),n!==o){if(i===o)return n;"string"==typeof r||"string"==typeof n?(r=so(r),n=so(n)):(r=io(r),n=io(n)),i=t(r,n)}return i}}function Fo(t){return ti((function(e){return e=ke(e,qe(si())),Xn((function(r){var n=this;return t(e,(function(t){return Te(t,n,r)}))}))}))}function $o(t,e){var r=(e=e===o?" ":so(e)).length;if(r<2)return r?Vn(e,t):e;var n=Vn(e,pe(t/lr(e)));return nr(e)?bo(cr(n),0,t).join(""):n.slice(0,t)}function Uo(t){return function(e,r,i){return i&&"number"!=typeof i&&yi(e,r,i)&&(r=i=o),e=pa(e),r===o?(r=e,e=0):r=pa(r),function(t,e,r,o){for(var i=-1,s=dr(pe((e-t)/(r||1)),0),a=n(s);s--;)a[o?s:++i]=t,t+=r;return a}(e,r,i=i===o?e<r?1:-1:pa(i),t)}}function zo(t){return function(e,r){return"string"==typeof e&&"string"==typeof r||(e=da(e),r=da(r)),t(e,r)}}function Jo(t,e,r,n,i,s,a,l,c,f){var p=8&e;e|=p?u:64,4&(e&=~(p?64:u))||(e&=-4);var h=[t,e,i,p?s:o,p?a:o,p?o:s,p?o:a,l,c,f],g=r.apply(o,h);return bi(t)&&Li(g,h),g.placeholder=n,Ii(g,t,e)}function Vo(t){var e=Tt[t];return function(t,r){if(t=da(t),(r=null==r?0:mr(ha(r),292))&&Me(t)){var n=(ya(t)+"e").split("e");return+((n=(ya(e(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return e(t)}}var Xo=Ar&&1/ar(new Ar([,-0]))[1]==c?function(t){return new Ar(t)}:au;function Ko(t){return function(e){var r=pi(e);return r==_?or(e):r==L?ur(e):function(t,e){return ke(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function qo(t,e,r,s,c,f,p,h){var g=2&e;if(!g&&"function"!=typeof t)throw new Lt(i);var d=s?s.length:0;if(d||(e&=-97,s=c=o),p=p===o?p:dr(ha(p),0),h=h===o?h:ha(h),d-=c?c.length:0,64&e){var m=s,y=c;s=c=o}var w=g?o:ni(t),b=[t,e,r,s,c,m,y,f,p,h];if(w&&function(t,e){var r=t[1],n=e[1],o=r|n,i=o<131,s=n==l&&8==r||n==l&&256==r&&t[7].length<=e[8]||384==n&&e[7].length<=e[8]&&8==r;if(!i&&!s)return t;1&n&&(t[2]=e[2],o|=1&r?0:4);var u=e[3];if(u){var c=t[3];t[3]=c?xo(c,u,e[4]):u,t[4]=c?sr(t[3],a):e[4]}(u=e[5])&&(c=t[5],t[5]=c?So(c,u,e[6]):u,t[6]=c?sr(t[5],a):e[6]),(u=e[7])&&(t[7]=u),n&l&&(t[8]=null==t[8]?e[8]:mr(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=o}(b,w),t=b[0],e=b[1],r=b[2],s=b[3],c=b[4],!(h=b[9]=b[9]===o?g?0:t.length:dr(b[9]-d,0))&&24&e&&(e&=-25),e&&1!=e)v=8==e||16==e?function(t,e,r){var i=Do(t);return function s(){for(var a=arguments.length,u=n(a),l=a,c=ii(s);l--;)u[l]=arguments[l];var f=a<3&&u[0]!==c&&u[a-1]!==c?[]:sr(u,c);return(a-=f.length)<r?Jo(t,e,Ho,s.placeholder,o,u,f,o,o,r-a):Te(this&&this!==fe&&this instanceof s?i:t,this,u)}}(t,e,h):e!=u&&33!=e||c.length?Ho.apply(o,b):function(t,e,r,o){var i=1&e,s=Do(t);return function e(){for(var a=-1,u=arguments.length,l=-1,c=o.length,f=n(c+u),p=this&&this!==fe&&this instanceof e?s:t;++l<c;)f[l]=o[l];for(;u--;)f[l++]=arguments[++a];return Te(p,i?r:this,f)}}(t,e,r,s);else var v=function(t,e,r){var n=1&e,o=Do(t);return function e(){return(this&&this!==fe&&this instanceof e?o:t).apply(n?r:this,arguments)}}(t,e,r);return Ii((w?Yn:Li)(v,b),t,e)}function Go(t,e,r,n){return t===o||Ps(t,It[r])&&!Ot.call(n,r)?e:t}function Yo(t,e,r,n,i,s){return Zs(t)&&Zs(e)&&(s.set(e,t),Pn(t,e,o,Yo,s),s.delete(e)),t}function Qo(t){return na(t)?o:t}function Zo(t,e,r,n,i,s){var a=1&r,u=t.length,l=e.length;if(u!=l&&!(a&&l>u))return!1;var c=s.get(t),f=s.get(e);if(c&&f)return c==e&&f==t;var p=-1,h=!0,g=2&r?new Jr:o;for(s.set(t,e),s.set(e,t);++p<u;){var d=t[p],m=e[p];if(n)var y=a?n(m,d,p,e,t,s):n(d,m,p,t,e,s);if(y!==o){if(y)continue;h=!1;break}if(g){if(!De(e,(function(t,e){if(!Ye(g,e)&&(d===t||i(d,t,r,n,s)))return g.push(e)}))){h=!1;break}}else if(d!==m&&!i(d,m,r,n,s)){h=!1;break}}return s.delete(t),s.delete(e),h}function ti(t){return Ni(Ai(t,o,zi),t+"")}function ei(t){return _n(t,Ia,ci)}function ri(t){return _n(t,ka,fi)}var ni=Lr?function(t){return Lr.get(t)}:au;function oi(t){for(var e=t.name+"",r=Cr[e],n=Ot.call(Cr,e)?r.length:0;n--;){var o=r[n],i=o.func;if(null==i||i==t)return o.name}return e}function ii(t){return(Ot.call(Wr,"placeholder")?Wr:t).placeholder}function si(){var t=Wr.iteratee||nu;return t=t===nu?On:t,arguments.length?t(arguments[0],arguments[1]):t}function ai(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function ui(t){for(var e=Ia(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,_i(o)]}return e}function li(t,e){var r=function(t,e){return null==t?o:t[e]}(t,e);return Rn(r)?r:o}var ci=de?function(t){return null==t?[]:(t=At(t),Ce(de(t),(function(e){return Vt.call(t,e)})))}:gu,fi=de?function(t){for(var e=[];t;)Re(e,ci(t)),t=zt(t);return e}:gu,pi=Tn;function hi(t,e,r){for(var n=-1,o=(e=yo(e,t)).length,i=!1;++n<o;){var s=Mi(e[n]);if(!(i=null!=t&&r(t,s)))break;t=t[s]}return i||++n!=o?i:!!(o=null==t?0:t.length)&&Qs(o)&&mi(s,o)&&(Us(t)||$s(t))}function gi(t){return"function"!=typeof t.constructor||Ei(t)?{}:Hr(zt(t))}function di(t){return Us(t)||$s(t)||!!(Kt&&t&&t[Kt])}function mi(t,e){var r=typeof t;return!!(e=null==e?f:e)&&("number"==r||"symbol"!=r&&yt.test(t))&&t>-1&&t%1==0&&t<e}function yi(t,e,r){if(!Zs(r))return!1;var n=typeof e;return!!("number"==n?Js(r)&&mi(e,r.length):"string"==n&&e in r)&&Ps(r[e],t)}function wi(t,e){if(Us(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!aa(t))||Z.test(t)||!Q.test(t)||null!=e&&t in At(e)}function bi(t){var e=oi(t),r=Wr[e];if("function"!=typeof r||!(e in Fr.prototype))return!1;if(t===r)return!0;var n=ni(r);return!!n&&t===n[0]}(Er&&pi(new Er(new ArrayBuffer(1)))!=R||_r&&pi(new _r)!=_||Tr&&pi(Tr.resolve())!=x||Ar&&pi(new Ar)!=L||xr&&pi(new xr)!=I)&&(pi=function(t){var e=Tn(t),r=e==A?t.constructor:o,n=r?Wi(r):"";if(n)switch(n){case Nr:return R;case Ir:return _;case kr:return x;case Rr:return L;case Or:return I}return e});var vi=kt?Gs:du;function Ei(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||It)}function _i(t){return t==t&&!Zs(t)}function Ti(t,e){return function(r){return null!=r&&r[t]===e&&(e!==o||t in At(r))}}function Ai(t,e,r){return e=dr(e===o?t.length-1:e,0),function(){for(var o=arguments,i=-1,s=dr(o.length-e,0),a=n(s);++i<s;)a[i]=o[e+i];i=-1;for(var u=n(e+1);++i<e;)u[i]=o[i];return u[e]=r(a),Te(t,this,u)}}function xi(t,e){return e.length<2?t:En(t,to(e,0,-1))}function Si(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Li=ki(Yn),Ci=ce||function(t,e){return fe.setTimeout(t,e)},Ni=ki(Qn);function Ii(t,e,r){var n=e+"";return Ni(t,function(t,e){var r=e.length;if(!r)return t;var n=r-1;return e[n]=(r>1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(it,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return xe(g,(function(r){var n="_."+r[0];e&r[1]&&!Ne(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(st);return e?e[1].split(at):[]}(n),r)))}function ki(t){var e=0,r=0;return function(){var n=yr(),i=16-(n-r);if(r=n,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(o,arguments)}}function Ri(t,e){var r=-1,n=t.length,i=n-1;for(e=e===o?n:e;++r<e;){var s=Jn(r,i),a=t[s];t[s]=t[r],t[r]=a}return t.length=e,t}var Oi,Bi,Di=(Oi=Os((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(tt,(function(t,r,n,o){e.push(n?o.replace(ct,"$1"):r||t)})),e}),(function(t){return 500===Bi.size&&Bi.clear(),t})),Bi=Oi.cache,Oi);function Mi(t){if("string"==typeof t||aa(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Wi(t){if(null!=t){try{return Rt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Hi(t){if(t instanceof Fr)return t.clone();var e=new jr(t.__wrapped__,t.__chain__);return e.__actions__=Lo(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Pi=Xn((function(t,e){return Vs(t)?ln(t,dn(e,1,Vs,!0)):[]})),ji=Xn((function(t,e){var r=qi(e);return Vs(r)&&(r=o),Vs(t)?ln(t,dn(e,1,Vs,!0),si(r,2)):[]})),Fi=Xn((function(t,e){var r=qi(e);return Vs(r)&&(r=o),Vs(t)?ln(t,dn(e,1,Vs,!0),o,r):[]}));function $i(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var o=null==r?0:ha(r);return o<0&&(o=dr(n+o,0)),He(t,si(e,3),o)}function Ui(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=n-1;return r!==o&&(i=ha(r),i=r<0?dr(n+i,0):mr(i,n-1)),He(t,si(e,3),i,!0)}function zi(t){return null!=t&&t.length?dn(t,1):[]}function Ji(t){return t&&t.length?t[0]:o}var Vi=Xn((function(t){var e=ke(t,go);return e.length&&e[0]===t[0]?Ln(e):[]})),Xi=Xn((function(t){var e=qi(t),r=ke(t,go);return e===qi(r)?e=o:r.pop(),r.length&&r[0]===t[0]?Ln(r,si(e,2)):[]})),Ki=Xn((function(t){var e=qi(t),r=ke(t,go);return(e="function"==typeof e?e:o)&&r.pop(),r.length&&r[0]===t[0]?Ln(r,o,e):[]}));function qi(t){var e=null==t?0:t.length;return e?t[e-1]:o}var Gi=Xn(Yi);function Yi(t,e){return t&&t.length&&e&&e.length?Un(t,e):t}var Qi=ti((function(t,e){var r=null==t?0:t.length,n=nn(t,e);return zn(t,ke(e,(function(t){return mi(t,r)?+t:t})).sort(Ao)),n}));function Zi(t){return null==t?t:vr.call(t)}var ts=Xn((function(t){return ao(dn(t,1,Vs,!0))})),es=Xn((function(t){var e=qi(t);return Vs(e)&&(e=o),ao(dn(t,1,Vs,!0),si(e,2))})),rs=Xn((function(t){var e=qi(t);return e="function"==typeof e?e:o,ao(dn(t,1,Vs,!0),o,e)}));function ns(t){if(!t||!t.length)return[];var e=0;return t=Ce(t,(function(t){if(Vs(t))return e=dr(t.length,e),!0})),Xe(e,(function(e){return ke(t,Ue(e))}))}function os(t,e){if(!t||!t.length)return[];var r=ns(t);return null==e?r:ke(r,(function(t){return Te(e,o,t)}))}var is=Xn((function(t,e){return Vs(t)?ln(t,e):[]})),ss=Xn((function(t){return po(Ce(t,Vs))})),as=Xn((function(t){var e=qi(t);return Vs(e)&&(e=o),po(Ce(t,Vs),si(e,2))})),us=Xn((function(t){var e=qi(t);return e="function"==typeof e?e:o,po(Ce(t,Vs),o,e)})),ls=Xn(ns),cs=Xn((function(t){var e=t.length,r=e>1?t[e-1]:o;return r="function"==typeof r?(t.pop(),r):o,os(t,r)}));function fs(t){var e=Wr(t);return e.__chain__=!0,e}function ps(t,e){return e(t)}var hs=ti((function(t){var e=t.length,r=e?t[0]:0,n=this.__wrapped__,i=function(e){return nn(e,t)};return!(e>1||this.__actions__.length)&&n instanceof Fr&&mi(r)?((n=n.slice(r,+r+(e?1:0))).__actions__.push({func:ps,args:[i],thisArg:o}),new jr(n,this.__chain__).thru((function(t){return e&&!t.length&&t.push(o),t}))):this.thru(i)})),gs=No((function(t,e,r){Ot.call(t,r)?++t[r]:rn(t,r,1)})),ds=Mo($i),ms=Mo(Ui);function ys(t,e){return(Us(t)?xe:cn)(t,si(e,3))}function ws(t,e){return(Us(t)?Se:fn)(t,si(e,3))}var bs=No((function(t,e,r){Ot.call(t,r)?t[r].push(e):rn(t,r,[e])})),vs=Xn((function(t,e,r){var o=-1,i="function"==typeof e,s=Js(t)?n(t.length):[];return cn(t,(function(t){s[++o]=i?Te(e,t,r):Cn(t,e,r)})),s})),Es=No((function(t,e,r){rn(t,r,e)}));function _s(t,e){return(Us(t)?ke:Mn)(t,si(e,3))}var Ts=No((function(t,e,r){t[r?0:1].push(e)}),(function(){return[[],[]]})),As=Xn((function(t,e){if(null==t)return[];var r=e.length;return r>1&&yi(t,e[0],e[1])?e=[]:r>2&&yi(e[0],e[1],e[2])&&(e=[e[0]]),Fn(t,dn(e,1),[])})),xs=le||function(){return fe.Date.now()};function Ss(t,e,r){return e=r?o:e,e=t&&null==e?t.length:e,qo(t,l,o,o,o,o,e)}function Ls(t,e){var r;if("function"!=typeof e)throw new Lt(i);return t=ha(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=o),r}}var Cs=Xn((function(t,e,r){var n=1;if(r.length){var o=sr(r,ii(Cs));n|=u}return qo(t,n,e,r,o)})),Ns=Xn((function(t,e,r){var n=3;if(r.length){var o=sr(r,ii(Ns));n|=u}return qo(e,n,t,r,o)}));function Is(t,e,r){var n,s,a,u,l,c,f=0,p=!1,h=!1,g=!0;if("function"!=typeof t)throw new Lt(i);function d(e){var r=n,i=s;return n=s=o,f=e,u=t.apply(i,r)}function m(t){var r=t-c;return c===o||r>=e||r<0||h&&t-f>=a}function y(){var t=xs();if(m(t))return w(t);l=Ci(y,function(t){var r=e-(t-c);return h?mr(r,a-(t-f)):r}(t))}function w(t){return l=o,g&&n?d(t):(n=s=o,u)}function b(){var t=xs(),r=m(t);if(n=arguments,s=this,c=t,r){if(l===o)return function(t){return f=t,l=Ci(y,e),p?d(t):u}(c);if(h)return vo(l),l=Ci(y,e),d(c)}return l===o&&(l=Ci(y,e)),u}return e=da(e)||0,Zs(r)&&(p=!!r.leading,a=(h="maxWait"in r)?dr(da(r.maxWait)||0,e):a,g="trailing"in r?!!r.trailing:g),b.cancel=function(){l!==o&&vo(l),f=0,n=c=s=l=o},b.flush=function(){return l===o?u:w(xs())},b}var ks=Xn((function(t,e){return un(t,1,e)})),Rs=Xn((function(t,e,r){return un(t,da(e)||0,r)}));function Os(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Lt(i);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var s=t.apply(this,n);return r.cache=i.set(o,s)||i,s};return r.cache=new(Os.Cache||zr),r}function Bs(t){if("function"!=typeof t)throw new Lt(i);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Os.Cache=zr;var Ds=wo((function(t,e){var r=(e=1==e.length&&Us(e[0])?ke(e[0],qe(si())):ke(dn(e,1),qe(si()))).length;return Xn((function(n){for(var o=-1,i=mr(n.length,r);++o<i;)n[o]=e[o].call(this,n[o]);return Te(t,this,n)}))})),Ms=Xn((function(t,e){var r=sr(e,ii(Ms));return qo(t,u,o,e,r)})),Ws=Xn((function(t,e){var r=sr(e,ii(Ws));return qo(t,64,o,e,r)})),Hs=ti((function(t,e){return qo(t,256,o,o,o,e)}));function Ps(t,e){return t===e||t!=t&&e!=e}var js=zo(An),Fs=zo((function(t,e){return t>=e})),$s=Nn(function(){return arguments}())?Nn:function(t){return ta(t)&&Ot.call(t,"callee")&&!Vt.call(t,"callee")},Us=n.isArray,zs=ye?qe(ye):function(t){return ta(t)&&Tn(t)==k};function Js(t){return null!=t&&Qs(t.length)&&!Gs(t)}function Vs(t){return ta(t)&&Js(t)}var Xs=me||du,Ks=we?qe(we):function(t){return ta(t)&&Tn(t)==w};function qs(t){if(!ta(t))return!1;var e=Tn(t);return e==b||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!na(t)}function Gs(t){if(!Zs(t))return!1;var e=Tn(t);return e==v||e==E||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ys(t){return"number"==typeof t&&t==ha(t)}function Qs(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=f}function Zs(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ta(t){return null!=t&&"object"==typeof t}var ea=be?qe(be):function(t){return ta(t)&&pi(t)==_};function ra(t){return"number"==typeof t||ta(t)&&Tn(t)==T}function na(t){if(!ta(t)||Tn(t)!=A)return!1;var e=zt(t);if(null===e)return!0;var r=Ot.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&Rt.call(r)==Wt}var oa=ve?qe(ve):function(t){return ta(t)&&Tn(t)==S},ia=Ee?qe(Ee):function(t){return ta(t)&&pi(t)==L};function sa(t){return"string"==typeof t||!Us(t)&&ta(t)&&Tn(t)==C}function aa(t){return"symbol"==typeof t||ta(t)&&Tn(t)==N}var ua=_e?qe(_e):function(t){return ta(t)&&Qs(t.length)&&!!oe[Tn(t)]},la=zo(Dn),ca=zo((function(t,e){return t<=e}));function fa(t){if(!t)return[];if(Js(t))return sa(t)?cr(t):Lo(t);if(qt&&t[qt])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[qt]());var e=pi(t);return(e==_?or:e==L?ar:Pa)(t)}function pa(t){return t?(t=da(t))===c||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ha(t){var e=pa(t),r=e%1;return e==e?r?e-r:e:0}function ga(t){return t?on(ha(t),0,h):0}function da(t){if("number"==typeof t)return t;if(aa(t))return p;if(Zs(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Zs(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ke(t);var r=gt.test(t);return r||mt.test(t)?ue(t.slice(2),r?2:8):ht.test(t)?p:+t}function ma(t){return Co(t,ka(t))}function ya(t){return null==t?"":so(t)}var wa=Io((function(t,e){if(Ei(e)||Js(e))Co(e,Ia(e),t);else for(var r in e)Ot.call(e,r)&&Qr(t,r,e[r])})),ba=Io((function(t,e){Co(e,ka(e),t)})),va=Io((function(t,e,r,n){Co(e,ka(e),t,n)})),Ea=Io((function(t,e,r,n){Co(e,Ia(e),t,n)})),_a=ti(nn),Ta=Xn((function(t,e){t=At(t);var r=-1,n=e.length,i=n>2?e[2]:o;for(i&&yi(e[0],e[1],i)&&(n=1);++r<n;)for(var s=e[r],a=ka(s),u=-1,l=a.length;++u<l;){var c=a[u],f=t[c];(f===o||Ps(f,It[c])&&!Ot.call(t,c))&&(t[c]=s[c])}return t})),Aa=Xn((function(t){return t.push(o,Yo),Te(Oa,o,t)}));function xa(t,e,r){var n=null==t?o:En(t,e);return n===o?r:n}function Sa(t,e){return null!=t&&hi(t,e,Sn)}var La=Po((function(t,e,r){null!=e&&"function"!=typeof e.toString&&(e=Mt.call(e)),t[e]=r}),Za(ru)),Ca=Po((function(t,e,r){null!=e&&"function"!=typeof e.toString&&(e=Mt.call(e)),Ot.call(t,e)?t[e].push(r):t[e]=[r]}),si),Na=Xn(Cn);function Ia(t){return Js(t)?Xr(t):Bn(t)}function ka(t){return Js(t)?Xr(t,!0):function(t){if(!Zs(t))return function(t){var e=[];if(null!=t)for(var r in At(t))e.push(r);return e}(t);var e=Ei(t),r=[];for(var n in t)("constructor"!=n||!e&&Ot.call(t,n))&&r.push(n);return r}(t)}var Ra=Io((function(t,e,r){Pn(t,e,r)})),Oa=Io((function(t,e,r,n){Pn(t,e,r,n)})),Ba=ti((function(t,e){var r={};if(null==t)return r;var n=!1;e=ke(e,(function(e){return e=yo(e,t),n||(n=e.length>1),e})),Co(t,ri(t),r),n&&(r=sn(r,7,Qo));for(var o=e.length;o--;)uo(r,e[o]);return r})),Da=ti((function(t,e){return null==t?{}:function(t,e){return $n(t,e,(function(e,r){return Sa(t,r)}))}(t,e)}));function Ma(t,e){if(null==t)return{};var r=ke(ri(t),(function(t){return[t]}));return e=si(e),$n(t,r,(function(t,r){return e(t,r[0])}))}var Wa=Ko(Ia),Ha=Ko(ka);function Pa(t){return null==t?[]:Ge(t,Ia(t))}var ja=Bo((function(t,e,r){return e=e.toLowerCase(),t+(r?Fa(e):e)}));function Fa(t){return qa(ya(t).toLowerCase())}function $a(t){return(t=ya(t))&&t.replace(wt,tr).replace(Yt,"")}var Ua=Bo((function(t,e,r){return t+(r?"-":"")+e.toLowerCase()})),za=Bo((function(t,e,r){return t+(r?" ":"")+e.toLowerCase()})),Ja=Oo("toLowerCase"),Va=Bo((function(t,e,r){return t+(r?"_":"")+e.toLowerCase()})),Xa=Bo((function(t,e,r){return t+(r?" ":"")+qa(e)})),Ka=Bo((function(t,e,r){return t+(r?" ":"")+e.toUpperCase()})),qa=Oo("toUpperCase");function Ga(t,e,r){return t=ya(t),(e=r?o:e)===o?function(t){return ee.test(t)}(t)?function(t){return t.match(Zt)||[]}(t):function(t){return t.match(ut)||[]}(t):t.match(e)||[]}var Ya=Xn((function(t,e){try{return Te(t,o,e)}catch(t){return qs(t)?t:new Et(t)}})),Qa=ti((function(t,e){return xe(e,(function(e){e=Mi(e),rn(t,e,Cs(t[e],t))})),t}));function Za(t){return function(){return t}}var tu=Wo(),eu=Wo(!0);function ru(t){return t}function nu(t){return On("function"==typeof t?t:sn(t,1))}var ou=Xn((function(t,e){return function(r){return Cn(r,t,e)}})),iu=Xn((function(t,e){return function(r){return Cn(t,r,e)}}));function su(t,e,r){var n=Ia(e),o=vn(e,n);null!=r||Zs(e)&&(o.length||!n.length)||(r=e,e=t,t=this,o=vn(e,Ia(e)));var i=!(Zs(r)&&"chain"in r&&!r.chain),s=Gs(t);return xe(o,(function(r){var n=e[r];t[r]=n,s&&(t.prototype[r]=function(){var e=this.__chain__;if(i||e){var r=t(this.__wrapped__);return(r.__actions__=Lo(this.__actions__)).push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,Re([this.value()],arguments))})})),t}function au(){}var uu=Fo(ke),lu=Fo(Le),cu=Fo(De);function fu(t){return wi(t)?Ue(Mi(t)):function(t){return function(e){return En(e,t)}}(t)}var pu=Uo(),hu=Uo(!0);function gu(){return[]}function du(){return!1}var mu,yu=jo((function(t,e){return t+e}),0),wu=Vo("ceil"),bu=jo((function(t,e){return t/e}),1),vu=Vo("floor"),Eu=jo((function(t,e){return t*e}),1),_u=Vo("round"),Tu=jo((function(t,e){return t-e}),0);return Wr.after=function(t,e){if("function"!=typeof e)throw new Lt(i);return t=ha(t),function(){if(--t<1)return e.apply(this,arguments)}},Wr.ary=Ss,Wr.assign=wa,Wr.assignIn=ba,Wr.assignInWith=va,Wr.assignWith=Ea,Wr.at=_a,Wr.before=Ls,Wr.bind=Cs,Wr.bindAll=Qa,Wr.bindKey=Ns,Wr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Us(t)?t:[t]},Wr.chain=fs,Wr.chunk=function(t,e,r){e=(r?yi(t,e,r):e===o)?1:dr(ha(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var s=0,a=0,u=n(pe(i/e));s<i;)u[a++]=to(t,s,s+=e);return u},Wr.compact=function(t){for(var e=-1,r=null==t?0:t.length,n=0,o=[];++e<r;){var i=t[e];i&&(o[n++]=i)}return o},Wr.concat=function(){var t=arguments.length;if(!t)return[];for(var e=n(t-1),r=arguments[0],o=t;o--;)e[o-1]=arguments[o];return Re(Us(r)?Lo(r):[r],dn(e,1))},Wr.cond=function(t){var e=null==t?0:t.length,r=si();return t=e?ke(t,(function(t){if("function"!=typeof t[1])throw new Lt(i);return[r(t[0]),t[1]]})):[],Xn((function(r){for(var n=-1;++n<e;){var o=t[n];if(Te(o[0],this,r))return Te(o[1],this,r)}}))},Wr.conforms=function(t){return function(t){var e=Ia(t);return function(r){return an(r,t,e)}}(sn(t,1))},Wr.constant=Za,Wr.countBy=gs,Wr.create=function(t,e){var r=Hr(t);return null==e?r:en(r,e)},Wr.curry=function t(e,r,n){var i=qo(e,8,o,o,o,o,o,r=n?o:r);return i.placeholder=t.placeholder,i},Wr.curryRight=function t(e,r,n){var i=qo(e,16,o,o,o,o,o,r=n?o:r);return i.placeholder=t.placeholder,i},Wr.debounce=Is,Wr.defaults=Ta,Wr.defaultsDeep=Aa,Wr.defer=ks,Wr.delay=Rs,Wr.difference=Pi,Wr.differenceBy=ji,Wr.differenceWith=Fi,Wr.drop=function(t,e,r){var n=null==t?0:t.length;return n?to(t,(e=r||e===o?1:ha(e))<0?0:e,n):[]},Wr.dropRight=function(t,e,r){var n=null==t?0:t.length;return n?to(t,0,(e=n-(e=r||e===o?1:ha(e)))<0?0:e):[]},Wr.dropRightWhile=function(t,e){return t&&t.length?co(t,si(e,3),!0,!0):[]},Wr.dropWhile=function(t,e){return t&&t.length?co(t,si(e,3),!0):[]},Wr.fill=function(t,e,r,n){var i=null==t?0:t.length;return i?(r&&"number"!=typeof r&&yi(t,e,r)&&(r=0,n=i),function(t,e,r,n){var i=t.length;for((r=ha(r))<0&&(r=-r>i?0:i+r),(n=n===o||n>i?i:ha(n))<0&&(n+=i),n=r>n?0:ga(n);r<n;)t[r++]=e;return t}(t,e,r,n)):[]},Wr.filter=function(t,e){return(Us(t)?Ce:gn)(t,si(e,3))},Wr.flatMap=function(t,e){return dn(_s(t,e),1)},Wr.flatMapDeep=function(t,e){return dn(_s(t,e),c)},Wr.flatMapDepth=function(t,e,r){return r=r===o?1:ha(r),dn(_s(t,e),r)},Wr.flatten=zi,Wr.flattenDeep=function(t){return null!=t&&t.length?dn(t,c):[]},Wr.flattenDepth=function(t,e){return null!=t&&t.length?dn(t,e=e===o?1:ha(e)):[]},Wr.flip=function(t){return qo(t,512)},Wr.flow=tu,Wr.flowRight=eu,Wr.fromPairs=function(t){for(var e=-1,r=null==t?0:t.length,n={};++e<r;){var o=t[e];n[o[0]]=o[1]}return n},Wr.functions=function(t){return null==t?[]:vn(t,Ia(t))},Wr.functionsIn=function(t){return null==t?[]:vn(t,ka(t))},Wr.groupBy=bs,Wr.initial=function(t){return null!=t&&t.length?to(t,0,-1):[]},Wr.intersection=Vi,Wr.intersectionBy=Xi,Wr.intersectionWith=Ki,Wr.invert=La,Wr.invertBy=Ca,Wr.invokeMap=vs,Wr.iteratee=nu,Wr.keyBy=Es,Wr.keys=Ia,Wr.keysIn=ka,Wr.map=_s,Wr.mapKeys=function(t,e){var r={};return e=si(e,3),wn(t,(function(t,n,o){rn(r,e(t,n,o),t)})),r},Wr.mapValues=function(t,e){var r={};return e=si(e,3),wn(t,(function(t,n,o){rn(r,n,e(t,n,o))})),r},Wr.matches=function(t){return Wn(sn(t,1))},Wr.matchesProperty=function(t,e){return Hn(t,sn(e,1))},Wr.memoize=Os,Wr.merge=Ra,Wr.mergeWith=Oa,Wr.method=ou,Wr.methodOf=iu,Wr.mixin=su,Wr.negate=Bs,Wr.nthArg=function(t){return t=ha(t),Xn((function(e){return jn(e,t)}))},Wr.omit=Ba,Wr.omitBy=function(t,e){return Ma(t,Bs(si(e)))},Wr.once=function(t){return Ls(2,t)},Wr.orderBy=function(t,e,r,n){return null==t?[]:(Us(e)||(e=null==e?[]:[e]),Us(r=n?o:r)||(r=null==r?[]:[r]),Fn(t,e,r))},Wr.over=uu,Wr.overArgs=Ds,Wr.overEvery=lu,Wr.overSome=cu,Wr.partial=Ms,Wr.partialRight=Ws,Wr.partition=Ts,Wr.pick=Da,Wr.pickBy=Ma,Wr.property=fu,Wr.propertyOf=function(t){return function(e){return null==t?o:En(t,e)}},Wr.pull=Gi,Wr.pullAll=Yi,Wr.pullAllBy=function(t,e,r){return t&&t.length&&e&&e.length?Un(t,e,si(r,2)):t},Wr.pullAllWith=function(t,e,r){return t&&t.length&&e&&e.length?Un(t,e,o,r):t},Wr.pullAt=Qi,Wr.range=pu,Wr.rangeRight=hu,Wr.rearg=Hs,Wr.reject=function(t,e){return(Us(t)?Ce:gn)(t,Bs(si(e,3)))},Wr.remove=function(t,e){var r=[];if(!t||!t.length)return r;var n=-1,o=[],i=t.length;for(e=si(e,3);++n<i;){var s=t[n];e(s,n,t)&&(r.push(s),o.push(n))}return zn(t,o),r},Wr.rest=function(t,e){if("function"!=typeof t)throw new Lt(i);return Xn(t,e=e===o?e:ha(e))},Wr.reverse=Zi,Wr.sampleSize=function(t,e,r){return e=(r?yi(t,e,r):e===o)?1:ha(e),(Us(t)?qr:qn)(t,e)},Wr.set=function(t,e,r){return null==t?t:Gn(t,e,r)},Wr.setWith=function(t,e,r,n){return n="function"==typeof n?n:o,null==t?t:Gn(t,e,r,n)},Wr.shuffle=function(t){return(Us(t)?Gr:Zn)(t)},Wr.slice=function(t,e,r){var n=null==t?0:t.length;return n?(r&&"number"!=typeof r&&yi(t,e,r)?(e=0,r=n):(e=null==e?0:ha(e),r=r===o?n:ha(r)),to(t,e,r)):[]},Wr.sortBy=As,Wr.sortedUniq=function(t){return t&&t.length?oo(t):[]},Wr.sortedUniqBy=function(t,e){return t&&t.length?oo(t,si(e,2)):[]},Wr.split=function(t,e,r){return r&&"number"!=typeof r&&yi(t,e,r)&&(e=r=o),(r=r===o?h:r>>>0)?(t=ya(t))&&("string"==typeof e||null!=e&&!oa(e))&&!(e=so(e))&&nr(t)?bo(cr(t),0,r):t.split(e,r):[]},Wr.spread=function(t,e){if("function"!=typeof t)throw new Lt(i);return e=null==e?0:dr(ha(e),0),Xn((function(r){var n=r[e],o=bo(r,0,e);return n&&Re(o,n),Te(t,this,o)}))},Wr.tail=function(t){var e=null==t?0:t.length;return e?to(t,1,e):[]},Wr.take=function(t,e,r){return t&&t.length?to(t,0,(e=r||e===o?1:ha(e))<0?0:e):[]},Wr.takeRight=function(t,e,r){var n=null==t?0:t.length;return n?to(t,(e=n-(e=r||e===o?1:ha(e)))<0?0:e,n):[]},Wr.takeRightWhile=function(t,e){return t&&t.length?co(t,si(e,3),!1,!0):[]},Wr.takeWhile=function(t,e){return t&&t.length?co(t,si(e,3)):[]},Wr.tap=function(t,e){return e(t),t},Wr.throttle=function(t,e,r){var n=!0,o=!0;if("function"!=typeof t)throw new Lt(i);return Zs(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),Is(t,e,{leading:n,maxWait:e,trailing:o})},Wr.thru=ps,Wr.toArray=fa,Wr.toPairs=Wa,Wr.toPairsIn=Ha,Wr.toPath=function(t){return Us(t)?ke(t,Mi):aa(t)?[t]:Lo(Di(ya(t)))},Wr.toPlainObject=ma,Wr.transform=function(t,e,r){var n=Us(t),o=n||Xs(t)||ua(t);if(e=si(e,4),null==r){var i=t&&t.constructor;r=o?n?new i:[]:Zs(t)&&Gs(i)?Hr(zt(t)):{}}return(o?xe:wn)(t,(function(t,n,o){return e(r,t,n,o)})),r},Wr.unary=function(t){return Ss(t,1)},Wr.union=ts,Wr.unionBy=es,Wr.unionWith=rs,Wr.uniq=function(t){return t&&t.length?ao(t):[]},Wr.uniqBy=function(t,e){return t&&t.length?ao(t,si(e,2)):[]},Wr.uniqWith=function(t,e){return e="function"==typeof e?e:o,t&&t.length?ao(t,o,e):[]},Wr.unset=function(t,e){return null==t||uo(t,e)},Wr.unzip=ns,Wr.unzipWith=os,Wr.update=function(t,e,r){return null==t?t:lo(t,e,mo(r))},Wr.updateWith=function(t,e,r,n){return n="function"==typeof n?n:o,null==t?t:lo(t,e,mo(r),n)},Wr.values=Pa,Wr.valuesIn=function(t){return null==t?[]:Ge(t,ka(t))},Wr.without=is,Wr.words=Ga,Wr.wrap=function(t,e){return Ms(mo(e),t)},Wr.xor=ss,Wr.xorBy=as,Wr.xorWith=us,Wr.zip=ls,Wr.zipObject=function(t,e){return ho(t||[],e||[],Qr)},Wr.zipObjectDeep=function(t,e){return ho(t||[],e||[],Gn)},Wr.zipWith=cs,Wr.entries=Wa,Wr.entriesIn=Ha,Wr.extend=ba,Wr.extendWith=va,su(Wr,Wr),Wr.add=yu,Wr.attempt=Ya,Wr.camelCase=ja,Wr.capitalize=Fa,Wr.ceil=wu,Wr.clamp=function(t,e,r){return r===o&&(r=e,e=o),r!==o&&(r=(r=da(r))==r?r:0),e!==o&&(e=(e=da(e))==e?e:0),on(da(t),e,r)},Wr.clone=function(t){return sn(t,4)},Wr.cloneDeep=function(t){return sn(t,5)},Wr.cloneDeepWith=function(t,e){return sn(t,5,e="function"==typeof e?e:o)},Wr.cloneWith=function(t,e){return sn(t,4,e="function"==typeof e?e:o)},Wr.conformsTo=function(t,e){return null==e||an(t,e,Ia(e))},Wr.deburr=$a,Wr.defaultTo=function(t,e){return null==t||t!=t?e:t},Wr.divide=bu,Wr.endsWith=function(t,e,r){t=ya(t),e=so(e);var n=t.length,i=r=r===o?n:on(ha(r),0,n);return(r-=e.length)>=0&&t.slice(r,i)==e},Wr.eq=Ps,Wr.escape=function(t){return(t=ya(t))&&K.test(t)?t.replace(V,er):t},Wr.escapeRegExp=function(t){return(t=ya(t))&&rt.test(t)?t.replace(et,"\\$&"):t},Wr.every=function(t,e,r){var n=Us(t)?Le:pn;return r&&yi(t,e,r)&&(e=o),n(t,si(e,3))},Wr.find=ds,Wr.findIndex=$i,Wr.findKey=function(t,e){return We(t,si(e,3),wn)},Wr.findLast=ms,Wr.findLastIndex=Ui,Wr.findLastKey=function(t,e){return We(t,si(e,3),bn)},Wr.floor=vu,Wr.forEach=ys,Wr.forEachRight=ws,Wr.forIn=function(t,e){return null==t?t:mn(t,si(e,3),ka)},Wr.forInRight=function(t,e){return null==t?t:yn(t,si(e,3),ka)},Wr.forOwn=function(t,e){return t&&wn(t,si(e,3))},Wr.forOwnRight=function(t,e){return t&&bn(t,si(e,3))},Wr.get=xa,Wr.gt=js,Wr.gte=Fs,Wr.has=function(t,e){return null!=t&&hi(t,e,xn)},Wr.hasIn=Sa,Wr.head=Ji,Wr.identity=ru,Wr.includes=function(t,e,r,n){t=Js(t)?t:Pa(t),r=r&&!n?ha(r):0;var o=t.length;return r<0&&(r=dr(o+r,0)),sa(t)?r<=o&&t.indexOf(e,r)>-1:!!o&&Pe(t,e,r)>-1},Wr.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var o=null==r?0:ha(r);return o<0&&(o=dr(n+o,0)),Pe(t,e,o)},Wr.inRange=function(t,e,r){return e=pa(e),r===o?(r=e,e=0):r=pa(r),function(t,e,r){return t>=mr(e,r)&&t<dr(e,r)}(t=da(t),e,r)},Wr.invoke=Na,Wr.isArguments=$s,Wr.isArray=Us,Wr.isArrayBuffer=zs,Wr.isArrayLike=Js,Wr.isArrayLikeObject=Vs,Wr.isBoolean=function(t){return!0===t||!1===t||ta(t)&&Tn(t)==y},Wr.isBuffer=Xs,Wr.isDate=Ks,Wr.isElement=function(t){return ta(t)&&1===t.nodeType&&!na(t)},Wr.isEmpty=function(t){if(null==t)return!0;if(Js(t)&&(Us(t)||"string"==typeof t||"function"==typeof t.splice||Xs(t)||ua(t)||$s(t)))return!t.length;var e=pi(t);if(e==_||e==L)return!t.size;if(Ei(t))return!Bn(t).length;for(var r in t)if(Ot.call(t,r))return!1;return!0},Wr.isEqual=function(t,e){return In(t,e)},Wr.isEqualWith=function(t,e,r){var n=(r="function"==typeof r?r:o)?r(t,e):o;return n===o?In(t,e,o,r):!!n},Wr.isError=qs,Wr.isFinite=function(t){return"number"==typeof t&&Me(t)},Wr.isFunction=Gs,Wr.isInteger=Ys,Wr.isLength=Qs,Wr.isMap=ea,Wr.isMatch=function(t,e){return t===e||kn(t,e,ui(e))},Wr.isMatchWith=function(t,e,r){return r="function"==typeof r?r:o,kn(t,e,ui(e),r)},Wr.isNaN=function(t){return ra(t)&&t!=+t},Wr.isNative=function(t){if(vi(t))throw new Et("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Rn(t)},Wr.isNil=function(t){return null==t},Wr.isNull=function(t){return null===t},Wr.isNumber=ra,Wr.isObject=Zs,Wr.isObjectLike=ta,Wr.isPlainObject=na,Wr.isRegExp=oa,Wr.isSafeInteger=function(t){return Ys(t)&&t>=-9007199254740991&&t<=f},Wr.isSet=ia,Wr.isString=sa,Wr.isSymbol=aa,Wr.isTypedArray=ua,Wr.isUndefined=function(t){return t===o},Wr.isWeakMap=function(t){return ta(t)&&pi(t)==I},Wr.isWeakSet=function(t){return ta(t)&&"[object WeakSet]"==Tn(t)},Wr.join=function(t,e){return null==t?"":ze.call(t,e)},Wr.kebabCase=Ua,Wr.last=qi,Wr.lastIndexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=n;return r!==o&&(i=(i=ha(r))<0?dr(n+i,0):mr(i,n-1)),e==e?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(t,e,i):He(t,Fe,i,!0)},Wr.lowerCase=za,Wr.lowerFirst=Ja,Wr.lt=la,Wr.lte=ca,Wr.max=function(t){return t&&t.length?hn(t,ru,An):o},Wr.maxBy=function(t,e){return t&&t.length?hn(t,si(e,2),An):o},Wr.mean=function(t){return $e(t,ru)},Wr.meanBy=function(t,e){return $e(t,si(e,2))},Wr.min=function(t){return t&&t.length?hn(t,ru,Dn):o},Wr.minBy=function(t,e){return t&&t.length?hn(t,si(e,2),Dn):o},Wr.stubArray=gu,Wr.stubFalse=du,Wr.stubObject=function(){return{}},Wr.stubString=function(){return""},Wr.stubTrue=function(){return!0},Wr.multiply=Eu,Wr.nth=function(t,e){return t&&t.length?jn(t,ha(e)):o},Wr.noConflict=function(){return fe._===this&&(fe._=Ht),this},Wr.noop=au,Wr.now=xs,Wr.pad=function(t,e,r){t=ya(t);var n=(e=ha(e))?lr(t):0;if(!e||n>=e)return t;var o=(e-n)/2;return $o(he(o),r)+t+$o(pe(o),r)},Wr.padEnd=function(t,e,r){t=ya(t);var n=(e=ha(e))?lr(t):0;return e&&n<e?t+$o(e-n,r):t},Wr.padStart=function(t,e,r){t=ya(t);var n=(e=ha(e))?lr(t):0;return e&&n<e?$o(e-n,r)+t:t},Wr.parseInt=function(t,e,r){return r||null==e?e=0:e&&(e=+e),wr(ya(t).replace(nt,""),e||0)},Wr.random=function(t,e,r){if(r&&"boolean"!=typeof r&&yi(t,e,r)&&(e=r=o),r===o&&("boolean"==typeof e?(r=e,e=o):"boolean"==typeof t&&(r=t,t=o)),t===o&&e===o?(t=0,e=1):(t=pa(t),e===o?(e=t,t=0):e=pa(e)),t>e){var n=t;t=e,e=n}if(r||t%1||e%1){var i=br();return mr(t+i*(e-t+ae("1e-"+((i+"").length-1))),e)}return Jn(t,e)},Wr.reduce=function(t,e,r){var n=Us(t)?Oe:Je,o=arguments.length<3;return n(t,si(e,4),r,o,cn)},Wr.reduceRight=function(t,e,r){var n=Us(t)?Be:Je,o=arguments.length<3;return n(t,si(e,4),r,o,fn)},Wr.repeat=function(t,e,r){return e=(r?yi(t,e,r):e===o)?1:ha(e),Vn(ya(t),e)},Wr.replace=function(){var t=arguments,e=ya(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Wr.result=function(t,e,r){var n=-1,i=(e=yo(e,t)).length;for(i||(i=1,t=o);++n<i;){var s=null==t?o:t[Mi(e[n])];s===o&&(n=i,s=r),t=Gs(s)?s.call(t):s}return t},Wr.round=_u,Wr.runInContext=t,Wr.sample=function(t){return(Us(t)?Kr:Kn)(t)},Wr.size=function(t){if(null==t)return 0;if(Js(t))return sa(t)?lr(t):t.length;var e=pi(t);return e==_||e==L?t.size:Bn(t).length},Wr.snakeCase=Va,Wr.some=function(t,e,r){var n=Us(t)?De:eo;return r&&yi(t,e,r)&&(e=o),n(t,si(e,3))},Wr.sortedIndex=function(t,e){return ro(t,e)},Wr.sortedIndexBy=function(t,e,r){return no(t,e,si(r,2))},Wr.sortedIndexOf=function(t,e){var r=null==t?0:t.length;if(r){var n=ro(t,e);if(n<r&&Ps(t[n],e))return n}return-1},Wr.sortedLastIndex=function(t,e){return ro(t,e,!0)},Wr.sortedLastIndexBy=function(t,e,r){return no(t,e,si(r,2),!0)},Wr.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var r=ro(t,e,!0)-1;if(Ps(t[r],e))return r}return-1},Wr.startCase=Xa,Wr.startsWith=function(t,e,r){return t=ya(t),r=null==r?0:on(ha(r),0,t.length),e=so(e),t.slice(r,r+e.length)==e},Wr.subtract=Tu,Wr.sum=function(t){return t&&t.length?Ve(t,ru):0},Wr.sumBy=function(t,e){return t&&t.length?Ve(t,si(e,2)):0},Wr.template=function(t,e,r){var n=Wr.templateSettings;r&&yi(t,e,r)&&(e=o),t=ya(t),e=va({},e,n,Go);var i,s,a=va({},e.imports,n.imports,Go),u=Ia(a),l=Ge(a,u),c=0,f=e.interpolate||bt,p="__p += '",h=xt((e.escape||bt).source+"|"+f.source+"|"+(f===Y?ft:bt).source+"|"+(e.evaluate||bt).source+"|$","g"),g="//# sourceURL="+(Ot.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ne+"]")+"\n";t.replace(h,(function(e,r,n,o,a,u){return n||(n=o),p+=t.slice(c,u).replace(vt,rr),r&&(i=!0,p+="' +\n__e("+r+") +\n'"),a&&(s=!0,p+="';\n"+a+";\n__p += '"),n&&(p+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),c=u+e.length,e})),p+="';\n";var d=Ot.call(e,"variable")&&e.variable;if(d){if(lt.test(d))throw new Et("Invalid `variable` option passed into `_.template`")}else p="with (obj) {\n"+p+"\n}\n";p=(s?p.replace($,""):p).replace(U,"$1").replace(z,"$1;"),p="function("+(d||"obj")+") {\n"+(d?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var m=Ya((function(){return _t(u,g+"return "+p).apply(o,l)}));if(m.source=p,qs(m))throw m;return m},Wr.times=function(t,e){if((t=ha(t))<1||t>f)return[];var r=h,n=mr(t,h);e=si(e),t-=h;for(var o=Xe(n,e);++r<t;)e(r);return o},Wr.toFinite=pa,Wr.toInteger=ha,Wr.toLength=ga,Wr.toLower=function(t){return ya(t).toLowerCase()},Wr.toNumber=da,Wr.toSafeInteger=function(t){return t?on(ha(t),-9007199254740991,f):0===t?t:0},Wr.toString=ya,Wr.toUpper=function(t){return ya(t).toUpperCase()},Wr.trim=function(t,e,r){if((t=ya(t))&&(r||e===o))return Ke(t);if(!t||!(e=so(e)))return t;var n=cr(t),i=cr(e);return bo(n,Qe(n,i),Ze(n,i)+1).join("")},Wr.trimEnd=function(t,e,r){if((t=ya(t))&&(r||e===o))return t.slice(0,fr(t)+1);if(!t||!(e=so(e)))return t;var n=cr(t);return bo(n,0,Ze(n,cr(e))+1).join("")},Wr.trimStart=function(t,e,r){if((t=ya(t))&&(r||e===o))return t.replace(nt,"");if(!t||!(e=so(e)))return t;var n=cr(t);return bo(n,Qe(n,cr(e))).join("")},Wr.truncate=function(t,e){var r=30,n="...";if(Zs(e)){var i="separator"in e?e.separator:i;r="length"in e?ha(e.length):r,n="omission"in e?so(e.omission):n}var s=(t=ya(t)).length;if(nr(t)){var a=cr(t);s=a.length}if(r>=s)return t;var u=r-lr(n);if(u<1)return n;var l=a?bo(a,0,u).join(""):t.slice(0,u);if(i===o)return l+n;if(a&&(u+=l.length-u),oa(i)){if(t.slice(u).search(i)){var c,f=l;for(i.global||(i=xt(i.source,ya(pt.exec(i))+"g")),i.lastIndex=0;c=i.exec(f);)var p=c.index;l=l.slice(0,p===o?u:p)}}else if(t.indexOf(so(i),u)!=u){var h=l.lastIndexOf(i);h>-1&&(l=l.slice(0,h))}return l+n},Wr.unescape=function(t){return(t=ya(t))&&X.test(t)?t.replace(J,pr):t},Wr.uniqueId=function(t){var e=++Bt;return ya(t)+e},Wr.upperCase=Ka,Wr.upperFirst=qa,Wr.each=ys,Wr.eachRight=ws,Wr.first=Ji,su(Wr,(mu={},wn(Wr,(function(t,e){Ot.call(Wr.prototype,e)||(mu[e]=t)})),mu),{chain:!1}),Wr.VERSION="4.17.21",xe(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Wr[t].placeholder=Wr})),xe(["drop","take"],(function(t,e){Fr.prototype[t]=function(r){r=r===o?1:dr(ha(r),0);var n=this.__filtered__&&!e?new Fr(this):this.clone();return n.__filtered__?n.__takeCount__=mr(r,n.__takeCount__):n.__views__.push({size:mr(r,h),type:t+(n.__dir__<0?"Right":"")}),n},Fr.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),xe(["filter","map","takeWhile"],(function(t,e){var r=e+1,n=1==r||3==r;Fr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:si(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}})),xe(["head","last"],(function(t,e){var r="take"+(e?"Right":"");Fr.prototype[t]=function(){return this[r](1).value()[0]}})),xe(["initial","tail"],(function(t,e){var r="drop"+(e?"":"Right");Fr.prototype[t]=function(){return this.__filtered__?new Fr(this):this[r](1)}})),Fr.prototype.compact=function(){return this.filter(ru)},Fr.prototype.find=function(t){return this.filter(t).head()},Fr.prototype.findLast=function(t){return this.reverse().find(t)},Fr.prototype.invokeMap=Xn((function(t,e){return"function"==typeof t?new Fr(this):this.map((function(r){return Cn(r,t,e)}))})),Fr.prototype.reject=function(t){return this.filter(Bs(si(t)))},Fr.prototype.slice=function(t,e){t=ha(t);var r=this;return r.__filtered__&&(t>0||e<0)?new Fr(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==o&&(r=(e=ha(e))<0?r.dropRight(-e):r.take(e-t)),r)},Fr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Fr.prototype.toArray=function(){return this.take(h)},wn(Fr.prototype,(function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),n=/^(?:head|last)$/.test(e),i=Wr[n?"take"+("last"==e?"Right":""):e],s=n||/^find/.test(e);i&&(Wr.prototype[e]=function(){var e=this.__wrapped__,a=n?[1]:arguments,u=e instanceof Fr,l=a[0],c=u||Us(e),f=function(t){var e=i.apply(Wr,Re([t],a));return n&&p?e[0]:e};c&&r&&"function"==typeof l&&1!=l.length&&(u=c=!1);var p=this.__chain__,h=!!this.__actions__.length,g=s&&!p,d=u&&!h;if(!s&&c){e=d?e:new Fr(this);var m=t.apply(e,a);return m.__actions__.push({func:ps,args:[f],thisArg:o}),new jr(m,p)}return g&&d?t.apply(this,a):(m=this.thru(f),g?n?m.value()[0]:m.value():m)})})),xe(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Ct[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);Wr.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var o=this.value();return e.apply(Us(o)?o:[],t)}return this[r]((function(r){return e.apply(Us(r)?r:[],t)}))}})),wn(Fr.prototype,(function(t,e){var r=Wr[e];if(r){var n=r.name+"";Ot.call(Cr,n)||(Cr[n]=[]),Cr[n].push({name:e,func:r})}})),Cr[Ho(o,2).name]=[{name:"wrapper",func:o}],Fr.prototype.clone=function(){var t=new Fr(this.__wrapped__);return t.__actions__=Lo(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Lo(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Lo(this.__views__),t},Fr.prototype.reverse=function(){if(this.__filtered__){var t=new Fr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Fr.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=Us(t),n=e<0,o=r?t.length:0,i=function(t,e,r){for(var n=-1,o=r.length;++n<o;){var i=r[n],s=i.size;switch(i.type){case"drop":t+=s;break;case"dropRight":e-=s;break;case"take":e=mr(e,t+s);break;case"takeRight":t=dr(t,e-s)}}return{start:t,end:e}}(0,o,this.__views__),s=i.start,a=i.end,u=a-s,l=n?a:s-1,c=this.__iteratees__,f=c.length,p=0,h=mr(u,this.__takeCount__);if(!r||!n&&o==u&&h==u)return fo(t,this.__actions__);var g=[];t:for(;u--&&p<h;){for(var d=-1,m=t[l+=e];++d<f;){var y=c[d],w=y.iteratee,b=y.type,v=w(m);if(2==b)m=v;else if(!v){if(1==b)continue t;break t}}g[p++]=m}return g},Wr.prototype.at=hs,Wr.prototype.chain=function(){return fs(this)},Wr.prototype.commit=function(){return new jr(this.value(),this.__chain__)},Wr.prototype.next=function(){this.__values__===o&&(this.__values__=fa(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?o:this.__values__[this.__index__++]}},Wr.prototype.plant=function(t){for(var e,r=this;r instanceof Pr;){var n=Hi(r);n.__index__=0,n.__values__=o,e?i.__wrapped__=n:e=n;var i=n;r=r.__wrapped__}return i.__wrapped__=t,e},Wr.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Fr){var e=t;return this.__actions__.length&&(e=new Fr(this)),(e=e.reverse()).__actions__.push({func:ps,args:[Zi],thisArg:o}),new jr(e,this.__chain__)}return this.thru(Zi)},Wr.prototype.toJSON=Wr.prototype.valueOf=Wr.prototype.value=function(){return fo(this.__wrapped__,this.__actions__)},Wr.prototype.first=Wr.prototype.head,qt&&(Wr.prototype[qt]=function(){return this}),Wr}();fe._=hr,(n=function(){return hr}.call(e,r,e,t))===o||(t.exports=n)}.call(this)},586:()=>{},606:t=>{var e,r,n=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(t){if(e===setTimeout)return setTimeout(t,0);if((e===o||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:o}catch(t){e=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(t){r=i}}();var a,u=[],l=!1,c=-1;function f(){l&&a&&(l=!1,a.length?u=a.concat(u):c=-1,u.length&&p())}function p(){if(!l){var t=s(f);l=!0;for(var e=u.length;e;){for(a=u,u=[];++c<e;)a&&a[c].run();c=-1,e=u.length}a=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{return r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function g(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new h(t,e)),1!==u.length||l||s(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=g,n.addListener=g,n.once=g,n.off=g,n.removeListener=g,n.removeAllListeners=g,n.emit=g,n.prependListener=g,n.prependOnceListener=g,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},699:()=>{},975:(t,e,r)=>{"use strict";var n=r(606);function o(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function i(t,e){for(var r,n="",o=0,i=-1,s=0,a=0;a<=t.length;++a){if(a<t.length)r=t.charCodeAt(a);else{if(47===r)break;r=47}if(47===r){if(i===a-1||1===s);else if(i!==a-1&&2===s){if(n.length<2||2!==o||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var u=n.lastIndexOf("/");if(u!==n.length-1){-1===u?(n="",o=0):o=(n=n.slice(0,u)).length-1-n.lastIndexOf("/"),i=a,s=0;continue}}else if(2===n.length||1===n.length){n="",o=0,i=a,s=0;continue}e&&(n.length>0?n+="/..":n="..",o=2)}else n.length>0?n+="/"+t.slice(i+1,a):n=t.slice(i+1,a),o=a-i-1;i=a,s=0}else 46===r&&-1!==s?++s:s=-1}return n}var s={resolve:function(){for(var t,e="",r=!1,s=arguments.length-1;s>=-1&&!r;s--){var a;s>=0?a=arguments[s]:(void 0===t&&(t=n.cwd()),a=t),o(a),0!==a.length&&(e=a+"/"+e,r=47===a.charCodeAt(0))}return e=i(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(t){if(o(t),0===t.length)return".";var e=47===t.charCodeAt(0),r=47===t.charCodeAt(t.length-1);return 0!==(t=i(t,!e)).length||e||(t="."),t.length>0&&r&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return o(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var r=arguments[e];o(r),r.length>0&&(void 0===t?t=r:t+="/"+r)}return void 0===t?".":s.normalize(t)},relative:function(t,e){if(o(t),o(e),t===e)return"";if((t=s.resolve(t))===(e=s.resolve(e)))return"";for(var r=1;r<t.length&&47===t.charCodeAt(r);++r);for(var n=t.length,i=n-r,a=1;a<e.length&&47===e.charCodeAt(a);++a);for(var u=e.length-a,l=i<u?i:u,c=-1,f=0;f<=l;++f){if(f===l){if(u>l){if(47===e.charCodeAt(a+f))return e.slice(a+f+1);if(0===f)return e.slice(a+f)}else i>l&&(47===t.charCodeAt(r+f)?c=f:0===f&&(c=0));break}var p=t.charCodeAt(r+f);if(p!==e.charCodeAt(a+f))break;47===p&&(c=f)}var h="";for(f=r+c+1;f<=n;++f)f!==n&&47!==t.charCodeAt(f)||(0===h.length?h+="..":h+="/..");return h.length>0?h+e.slice(a+c):(a+=c,47===e.charCodeAt(a)&&++a,e.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(o(t),0===t.length)return".";for(var e=t.charCodeAt(0),r=47===e,n=-1,i=!0,s=t.length-1;s>=1;--s)if(47===(e=t.charCodeAt(s))){if(!i){n=s;break}}else i=!1;return-1===n?r?"/":".":r&&1===n?"//":t.slice(0,n)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');o(t);var r,n=0,i=-1,s=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var a=e.length-1,u=-1;for(r=t.length-1;r>=0;--r){var l=t.charCodeAt(r);if(47===l){if(!s){n=r+1;break}}else-1===u&&(s=!1,u=r+1),a>=0&&(l===e.charCodeAt(a)?-1==--a&&(i=r):(a=-1,i=u))}return n===i?i=u:-1===i&&(i=t.length),t.slice(n,i)}for(r=t.length-1;r>=0;--r)if(47===t.charCodeAt(r)){if(!s){n=r+1;break}}else-1===i&&(s=!1,i=r+1);return-1===i?"":t.slice(n,i)},extname:function(t){o(t);for(var e=-1,r=0,n=-1,i=!0,s=0,a=t.length-1;a>=0;--a){var u=t.charCodeAt(a);if(47!==u)-1===n&&(i=!1,n=a+1),46===u?-1===e?e=a:1!==s&&(s=1):-1!==e&&(s=-1);else if(!i){r=a+1;break}}return-1===e||-1===n||0===s||1===s&&e===n-1&&e===r+1?"":t.slice(e,n)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var r=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+n:r+"/"+n:n}(0,t)},parse:function(t){o(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var r,n=t.charCodeAt(0),i=47===n;i?(e.root="/",r=1):r=0;for(var s=-1,a=0,u=-1,l=!0,c=t.length-1,f=0;c>=r;--c)if(47!==(n=t.charCodeAt(c)))-1===u&&(l=!1,u=c+1),46===n?-1===s?s=c:1!==f&&(f=1):-1!==s&&(f=-1);else if(!l){a=c+1;break}return-1===s||-1===u||0===f||1===f&&s===u-1&&s===a+1?-1!==u&&(e.base=e.name=0===a&&i?t.slice(1,u):t.slice(a,u)):(0===a&&i?(e.name=t.slice(1,s),e.base=t.slice(1,u)):(e.name=t.slice(a,s),e.base=t.slice(a,u)),e.ext=t.slice(s,u)),a>0?e.dir=t.slice(0,a-1):i&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s,t.exports=s}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={id:n,loaded:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var n={};(()=>{"use strict";r.d(n,{PuddySqlTags:()=>V});var t={};r.r(t),r.d(t,{areElsCollBottom:()=>c,areElsCollLeft:()=>f,areElsCollPerfBottom:()=>g,areElsCollPerfLeft:()=>d,areElsCollPerfRight:()=>m,areElsCollPerfTop:()=>h,areElsCollRight:()=>p,areElsCollTop:()=>l,areElsColliding:()=>y,areElsPerfColliding:()=>w,getElsCollDetails:()=>S,getElsCollDirDepth:()=>x,getElsCollOverlap:()=>E,getElsCollOverlapPos:()=>_,getElsColliding:()=>b,getElsPerfColliding:()=>v,getElsRelativeCenterOffset:()=>A,getRectCenter:()=>T});var e=r(543),o=r(287);function i(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&"[object Object]"===Object.prototype.toString.call(t)}const s="undefined"!=typeof window&&void 0!==window.document,a={items:{},order:[]};function u(t,e){const r=[],n=Array.isArray(t)?t:Object.entries(t);for(const[t,o]of n)if(!a.items.hasOwnProperty(t)){a.items[t]=o;let n="number"==typeof e?e:-1;if(-1===n){const t=a.order.indexOf("object");n=t>-1?t:a.order.length}n=Math.min(Math.max(0,n),a.order.length),a.order.splice(n,0,t),r.push(t)}return r}u([["undefined",t=>void 0===t],["null",t=>null===t],["boolean",t=>"boolean"==typeof t],["number",t=>"number"==typeof t&&!Number.isNaN(t)],["bigint",t=>"bigint"==typeof t],["string",t=>"string"==typeof t],["symbol",t=>"symbol"==typeof t],["function",t=>"function"==typeof t],["array",t=>Array.isArray(t)]]),s||u([["buffer",t=>void 0!==o.hp&&o.hp.isBuffer(t)]]),s&&u([["file",t=>"undefined"!=typeof File&&t instanceof File]]),u([["date",t=>t instanceof Date],["regexp",t=>t instanceof RegExp],["map",t=>t instanceof Map],["set",t=>t instanceof Set],["weakmap",t=>t instanceof WeakMap],["weakset",t=>t instanceof WeakSet],["promise",t=>t instanceof Promise]]),s&&u([["htmlelement",t=>"undefined"!=typeof HTMLElement&&t instanceof HTMLElement]]),u([["object",t=>i(t)]]),r(121),r(975),r(494);const l=(t,e)=>t.bottom<e.top,c=(t,e)=>t.top>e.bottom,f=(t,e)=>t.right<e.left,p=(t,e)=>t.left>e.right,h=(t,e)=>t.bottom<=e.top,g=(t,e)=>t.top>=e.bottom,d=(t,e)=>t.right<=e.left,m=(t,e)=>t.left>=e.right,y=(t,e)=>!(f(t,e)||p(t,e)||l(t,e)||c(t,e)),w=(t,e)=>!(d(t,e)||m(t,e)||h(t,e)||g(t,e)),b=(t,e)=>f(t,e)?"left":p(t,e)?"right":l(t,e)?"top":c(t,e)?"bottom":null,v=(t,e)=>d(t,e)?"left":m(t,e)?"right":h(t,e)?"top":g(t,e)?"bottom":null,E=(t,e)=>({overlapLeft:e.right-t.left,overlapRight:t.right-e.left,overlapTop:e.bottom-t.top,overlapBottom:t.bottom-e.top}),_=({overlapLeft:t=-1,overlapRight:e=-1,overlapTop:r=-1,overlapBottom:n=-1}={})=>({dirX:t<e?"right":"left",dirY:r<n?"bottom":"top"}),T=t=>({x:t.left+t.width/2,y:t.top+t.height/2});function A(t,e){const r=t.left+t.width/2,n=t.top+t.height/2;return{x:e.left+e.width/2-r,y:e.top+e.height/2-n}}function x(t,e){if(!w(t,e))return{inDir:null,dirX:null,dirY:null,depthX:0,depthY:0};const{overlapLeft:r,overlapRight:n,overlapTop:o,overlapBottom:i}=E(t,e),{dirX:s,dirY:a}=_({overlapLeft:r,overlapRight:n,overlapTop:o,overlapBottom:i}),u=Math.min(r,n),l=Math.min(o,i);let c;return c=u<l?s:a,{inDir:c,dirX:s,dirY:a,depthX:u,depthY:l}}function S(t,e){const r=w(t,e),n={in:null,x:null,y:null},o={y:null,x:null},i={top:0,bottom:0,left:0,right:0},{overlapLeft:s,overlapRight:a,overlapTop:u,overlapBottom:l}=E(e,t);i.top=u,i.bottom=l,i.left=s,i.right=a;const c=Object.entries(i).filter((([,t])=>t>0)).sort(((t,e)=>t[1]-e[1])),{dirX:f,dirY:p}=_({overlapLeft:a,overlapRight:s,overlapTop:l,overlapBottom:u});return n.y=p,n.x=f,i.bottom<0?o.y="bottom":i.top<0&&(o.y="top"),i.left<0?o.x="left":i.right<0&&(o.x="right"),n.in=r?i.top===i.bottom&&i.bottom===i.left&&i.left===i.right?"center":c.length?c[0][0]:"top":null,{dirs:n,depth:i,isNeg:o}}const L=class{#t;get el(){return this.#t}set el(t){if(this.#t)throw new Error("The observed element has already been set and cannot be reassigned.");if(void 0!==t&&!(t instanceof Element))throw new TypeError("The observed element must be a valid DOM Element.");this.#t=t}#e={};get settings(){return this.#e}set settings(t){if("object"!=typeof t||null===t)throw new TypeError("settings must be a non-null object.");this.#e=t}#r=null;get observer(){return this.#r}#n=[];get detectors(){return this.#n.map((t=>[t[0],t[1]]))}set detectors(t){if(!Array.isArray(t))throw new TypeError("detectors must be an array.");const e=[];for(const[r,n]of t){if("string"!=typeof r)throw new TypeError("Detector name must be a string.");if("function"!=typeof n)throw new TypeError(`Detector handler for "${r}" must be a function.`);e.push([r,n])}this.#n=e}get isActive(){return!!this.#r}get size(){return this.#n.length}constructor({el:t,initDetectors:e=[],initCfg:r={}}={}){this.el=t,e.length&&(this.detectors=e),r&&(this.settings=r)}clear(){this.#n=[]}start(){if(!this.#t)throw new Error("Cannot start observation: no target element has been set.");this.#r||(this.#r=new MutationObserver((t=>{t.forEach(((t,e,r)=>this.#n.forEach((n=>n[1](t,e,r)))))})),this.#r.observe(this.#t,this.#e))}stop(){this.#r&&(this.#r.disconnect(),this.#r=null)}add(t,e){this.#o(t,e),this.#n.push([t,e])}insertAtStart(t,e){this.#o(t,e),this.#n.unshift([t,e])}insertAt(t,e,r,n="after"){if(this.#o(e,r),"number"!=typeof t||t<0||t>=this.#n.length)throw new RangeError("Invalid index for insertDetectorAt.");const o="before"===n?t:t+1;this.#n.splice(o,0,[e,r])}removeAt(t){if("number"!=typeof t||t<0||t>=this.#n.length)throw new RangeError("Invalid index for removeDetectorAt.");this.#n.splice(t,1)}removeAround(t,e=0,r=0){if("number"!=typeof t||t<0||t>=this.#n.length)throw new RangeError("Invalid index for removeDetectorsAround.");const n=Math.max(0,t-e),o=e+1+r;this.#n.splice(n,o)}isIndexUsed(t){return t>=0&&t<this.#n.length}hasHandler(t){if("function"!=typeof t)throw new TypeError("Handler must be a function.");return this.#n.some((([e,r])=>r===t))}#o(t,e){if("string"!=typeof t||!t.trim())throw new TypeError("Detector name must be a non-empty string.");if("function"!=typeof e)throw new TypeError(`Detector handler for "${t}" must be a function.`)}destroy(){this.stop(),this.clear()}},{areElsColliding:C,areElsPerfColliding:N,areElsCollTop:I,areElsCollBottom:k,areElsCollLeft:R,areElsCollRight:O}=t,B=new WeakMap,D=new WeakMap,M=new WeakMap,W=new WeakMap,H={top:new WeakMap,bottom:new WeakMap,left:new WeakMap,right:new WeakMap};class P{static Utils={...t};static#i=!1;static get elemDebug(){return P.#i}static set elemDebug(t){if("boolean"!=typeof t)throw new TypeError("Expected a boolean value for elemDebug");P.#i=t}static _debugElemError(t,e){if(!P.#i)return;const r="[TinyHtml Debug] Element validation error";if(console.groupCollapsed(`${r}${e?" — details below":""}`),console.error(r),"undefined"!=typeof Error&&"function"==typeof Error.captureStackTrace){const t=new Error(r);Error.captureStackTrace(t,P._debugElemError),console.error(t.stack)}else console.trace(r);if(Array.isArray(t)){const e=t.map(((t,e)=>({index:e,typeOf:null===t?"null":typeof t,constructor:t?.constructor?.name??(null===t?"null":"primitive"),summary:"undefined"!=typeof Element&&t instanceof Element?`${t.tagName?.toLowerCase?.()??"element"}#${t.id||""}.${String(t.className||"").trim().replace(/\s+/g,".")}`:t&&"object"==typeof t&&"nodeType"in t?`nodeType:${t.nodeType}`:"",value:t})));console.table(e)}else console.warn('[TinyHtml Debug] "elems" is not an array:',t);arguments.length>1&&(console.error("[TinyHtml Debug] Problematic element:",e),e&&"object"==typeof e&&console.dir(e)),console.groupEnd()}static parseStyle(t){const e={};return t.split(";").forEach((t=>{const[r,n]=t.split(":").map((t=>t&&t.trim()));r&&n&&(e[r]=n)})),e}static#s=!0;static get autoStartElemObserver(){return P.#s}static set autoStartElemObserver(t){if("boolean"!=typeof t)throw new TypeError("autoStartElemObserver must be a boolean.");P.#s=t}static#a=new L({el:"undefined"!=typeof window&&void 0!==window.document?window.document.documentElement:void 0,initDetectors:[["tinyStyleEvent",t=>{if("attributes"!==t.type||"style"!==t.attributeName||!(t.target instanceof HTMLElement))return;const e=t.oldValue||"",r=t.target.getAttribute("style")||"",n=function(t,e){const r={added:{},removed:{},modified:{}};for(const n in t)n in e?t[n]!==e[n]&&(r.modified[n]={old:t[n],new:e[n]}):r.removed[n]=t[n];for(const n in e)n in t||(r.added[n]=e[n]);return r}(P.parseStyle(e),P.parseStyle(r));(Object.keys(n.added).length||Object.keys(n.removed).length||Object.keys(n.modified).length)&&t.target.dispatchEvent(new CustomEvent("tinyhtml.stylechanged",{detail:n}))}],["tinyClassEvent",t=>{if("attributes"!==t.type||"class"!==t.attributeName||!(t.target instanceof HTMLElement))return;const e=t.oldValue||"",r=t.target.className||"",n=function(t,e){const r=t.filter((t=>!e.includes(t)));return{added:e.filter((e=>!t.includes(e))),removed:r}}(e.split(/\s+/).filter(Boolean),r.split(/\s+/).filter(Boolean));(n.added.length||n.removed.length)&&t.target.dispatchEvent(new CustomEvent("tinyhtml.classchanged",{detail:n}))}]],initCfg:{attributeOldValue:!0,attributes:!0,subtree:!0,attributeFilter:["style","class"]}});static get tinyObserver(){return P.#a}static async fetchHtmlFile(t,e={method:"GET"}){const r=await fetch(t,e),n=r.headers.get("Content-Type")||"";if(!r.ok)throw new Error(`Failed to fetch: ${r.status} ${r.statusText}`);if(!n.includes("text/html"))throw new Error(`Invalid content type: ${n} (expected text/html)`);const o=await r.text();return P.htmlToJson(o)}static async fetchHtmlNodes(t,e){const r=await P.fetchHtmlFile(t,e);return P.jsonToNodes(r)}static async fetchHtmlTinyElems(t,e){const r=await P.fetchHtmlNodes(t,e);return P.toTinyElm(r)}static templateToJson(t){return P.htmlToJson([...t.content.childNodes].map((t=>t instanceof Element?t.getHTML():t instanceof Text?t.textContent:"")).join(""))}static templateToNodes(t){const e=[];return[...t.content.cloneNode(!0).childNodes].map((t=>{if(!(t instanceof Element||t instanceof Text||t instanceof Comment))throw new Error(`Expected only Element nodes in <template>, but found: ${t.constructor.name}`);t instanceof Comment||e.push(t)})),e}static templateToTinyElems(t){return P.toTinyElm(P.templateToNodes(t))}static htmlToJson(t){const e=document.createElement("div");e.innerHTML=t.trim();const r=[],n=t=>{if(t instanceof Comment)return null;if(t instanceof Text){const e=t.textContent?.trim();return e||null}if(!(t instanceof Element))return null;const e=t.tagName.toLowerCase(),r={};for(const e of t.attributes)r[P.getPropName(e.name)]=e.value;const o=Array.from(t.childNodes).map(n).filter(Boolean);return o.length>0?[e,r,...o]:[e,r]};for(const t of e.childNodes){const e=n(t);e&&r.push(e)}return e.innerHTML="",r}static jsonToNodes(t){const e=t=>{if("string"==typeof t)return document.createTextNode(t);if(!Array.isArray(t))return document.createTextNode("");const[r,n,...o]=t,i=document.createElement(r);for(const[t,e]of Object.entries(n))i.setAttribute(P.getAttrName(t),e);for(const t of o){const r=e(t);r instanceof Comment||i.appendChild(r)}return i};return t.map(e).filter((t=>!(t instanceof Comment)))}static jsonToTinyElems(t){return P.toTinyElm(P.jsonToNodes(t))}static createFrom(t,e){if("string"!=typeof t)throw new TypeError('The "tagName" must be a string.');if(void 0!==e&&"object"!=typeof e)throw new TypeError('The "attrs" must be a object.');const r=P.createElement(t);if("object"==typeof e)for(const t in e)r.setAttr(t,e[t]);return r}static createElement(t,e){if("string"!=typeof t)throw new TypeError("[TinyHtml] createElement(): The tagName must be a string.");if(void 0!==e&&"object"!=typeof e)throw new TypeError("[TinyHtml] createElement(): The ops must be a object.");return new P(document.createElement(t,e))}static createTextNode(t){if("string"!=typeof t)throw new TypeError("[TinyHtml] createTextNode(): The value must be a string.");return new P(document.createTextNode(t))}static createElementFromHTML(t){const e=document.createElement("template");if(!(t=t.trim()).startsWith("<"))return P.createTextNode(t);if(e.innerHTML=t,!(e.content.firstChild instanceof Element))throw new Error("The HTML string must contain a valid HTML element.");return new P(e.content.firstChild)}static createFromHTML(t){const e=document.createElement("template");t=t.trim(),e.innerHTML=t;const r=Array.from(e.content.childNodes);if(!r.every((t=>t instanceof Element||t instanceof Text)))throw new Error("The HTML string must contain a valid HTML element.");return new P(r)}static createFromHtml(t){return P.createFromHTML(t)}static query(t,e=document){const r=e.querySelector(t);return r?new P(r):null}querySelector(t){return P.query(t,P._preElem(this,"query"))}static queryAll(t,e=document){return new P(e.querySelectorAll(t))}querySelectorAll(t){return P.queryAll(t,P._preElem(this,"queryAll"))}static getById(t){const e=document.getElementById(t);return e?new P(e):null}static getByClassName(t,e=document){return new P(e.getElementsByClassName(t))}getElementsByClassName(t){return P.getByClassName(t,P._preElem(this,"getByClassName"))}static getByName(t){return new P(document.getElementsByName(t))}static getByTagNameNS(t,e="http://www.w3.org/1999/xhtml",r=document){return new P(r.getElementsByTagNameNS(e,t))}getElementsByTagNameNS(t,e="http://www.w3.org/1999/xhtml"){return P.getByTagNameNS(t,e,P._preElem(this,"getByTagNameNS"))}get elements(){return[...this.#t]}forEach(t){const e=this.elements.map(((t,e)=>this.extract(e)));for(const r in e)t(e[r],Number(r),e);return this}get(t){if("number"!=typeof t)throw new TypeError("The index must be a number.");if(!this.#t[t])throw new Error(`No element found at index ${t}.`);return this.#t[t]}extract(t){if("number"!=typeof t)throw new TypeError("The index must be a number.");if(!this.#t[t])throw new Error(`Cannot extract: no element exists at index ${t}.`);return new P(this.#t[t])}exists(t){if("number"!=typeof t)throw new TypeError("The index must be a number.");return!!this.#t[t]}getAll(){return[...this.#t]}_getElement(t,e){if(!(this.#t[e]instanceof Element||this.#t[e]instanceof Window||this.#t[e]instanceof Document||this.#t[e]instanceof Text))throw P._debugElemError([...this.#t],this.#t[e]),new Error(`[TinyHtml] Invalid Element in ${t}().`);return this.#t[e]}_getElements(t){if(!this.#t.every((t=>t instanceof Element||t instanceof Window||t instanceof Document||t instanceof Text)))throw P._debugElemError([...this.#t]),new Error(`[TinyHtml] Invalid Element in ${t}().`);return[...this.#t]}static _preElemsTemplate(t,e,r,n){const o=t=>{const o=[];return t.map((i=>(i instanceof P?i._getElements(e):[i]).map((i=>{let s=!1;for(const t of r)if(i instanceof t){s=!0;break}if(!s)throw P._debugElemError([...t],i),new Error(`[TinyHtml] Invalid element of the list "${n.join(",")}" in ${e}().`);return o.push(i),i})))),o};return Array.isArray(t)?o(t):o([t])}_preElemsTemplate(t,e,r){return P._preElemsTemplate(this,t,e,r)}static _preElemTemplate(t,e,r,n,o=!1){const i=t=>{const i=t[0],s=i instanceof P?i._getElements(e):[i];if(s.length>1)throw P._debugElemError([...t]),new Error(`[TinyHtml] Invalid element amount in ${e}() (Received ${s.length}/1).`);let a=!1;for(const t of r)if(s[0]instanceof t){a=!0;break}if(!o||null!==s[0]&&void 0!==s[0]||(s[0]=null,a=!0),!a)throw P._debugElemError([...t],s[0]),new Error(`[TinyHtml] Invalid element of the list "${n.join(",")}" in ${e}().`);return s[0]};if(!Array.isArray(t))return i([t]);if(t.length>1)throw P._debugElemError([...t]),new Error(`[TinyHtml] Invalid element amount in ${e}() (Received ${t.length}/1).`);return i(t)}_preElemTemplate(t,e,r,n=!1){return P._preElemTemplate(this,t,e,r,n)}static _preElems(t,e){return P._preElemsTemplate(t,e,[Element],["Element"])}_preElems(t){return P._preElems(this,t)}static _preElem(t,e){return P._preElemTemplate(t,e,[Element],["Element"])}_preElem(t){return P._preElem(this,t)}static _preNodeElems(t,e){return P._preElemsTemplate(t,e,[Node],["Node"])}_preNodeElems(t){return P._preNodeElems(this,t)}static _preNodeElem(t,e){return P._preElemTemplate(t,e,[Node],["Node"])}_preNodeElem(t){return P._preNodeElem(this,t)}static _preNodeElemWithNull(t,e){return P._preElemTemplate(t,e,[Node],["Node"],!0)}_preNodeElemWithNull(t){return P._preNodeElemWithNull(this,t)}static _preHtmlElems(t,e){return P._preElemsTemplate(t,e,[HTMLElement],["HTMLElement"])}_preHtmlElems(t){return P._preHtmlElems(this,t)}static _preHtmlElem(t,e){return P._preElemTemplate(t,e,[HTMLElement],["HTMLElement"])}_preHtmlElem(t){return P._preHtmlElem(this,t)}static _preInputElems(t,e){return P._preElemsTemplate(t,e,[HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement,HTMLOptionElement],["HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement"])}_preInputElems(t){return P._preInputElems(this,t)}static _preInputElem(t,e){return P._preElemTemplate(t,e,[HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement,HTMLOptionElement],["HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement"])}_preInputElem(t){return P._preInputElem(this,t)}static _preEventTargetElems(t,e){return P._preElemsTemplate(t,e,[EventTarget],["EventTarget"])}_preEventTargetElems(t){return P._preEventTargetElems(this,t)}static _preEventTargetElem(t,e){return P._preElemTemplate(t,e,[EventTarget],["EventTarget"])}_preEventTargetElem(t){return P._preEventTargetElem(this,t)}static _preElemsAndWindow(t,e){return P._preElemsTemplate(t,e,[Element,Window],["Element","Window"])}_preElemsAndWindow(t){return P._preElemsAndWindow(this,t)}static _preElemAndWindow(t,e){return P._preElemTemplate(t,e,[Element,Window],["Element","Window"])}_preElemAndWindow(t){return P._preElemAndWindow(this,t)}static _preElemsAndWinAndDoc(t,e){return P._preElemsTemplate(t,e,[Element,Window,Document],["Element","Window","Document"]).map((t=>t instanceof Document?t.documentElement:t))}_preElemsAndWinAndDoc(t){return P._preElemsAndWinAndDoc(this,t)}static _preElemAndWinAndDoc(t,e){const r=P._preElemTemplate(t,e,[Element,Window,Document],["Element","Window","Document"]);return r instanceof Document?r.documentElement:r}_preElemAndWinAndDoc(t){return P._preElemAndWinAndDoc(this,t)}static _preElemsWithDoc(t,e){return P._preElemsTemplate(t,e,[Element,Document],["Element","Document"])}_preElemsWithDoc(t){return P._preElemsWithDoc(this,t)}static _preElemWithDoc(t,e){return P._preElemTemplate(t,e,[Element,Document],["Element","Document"])}_preElemWithDoc(t){return P._preElemWithDoc(this,t)}static toTinyElm(t){const e=t=>t.map((t=>t instanceof P?t:new P(t)));return Array.isArray(t)?e(t):e([t])}static fromTinyElm(t){const e=t=>{const e=[];return t.map((t=>(t instanceof P?t._getElements("fromTinyElm"):[t]).map((t=>e.push(t))))),e};return Array.isArray(t)?e(t):e([t])}static winnow(t,e,r,n=!1){if("boolean"!=typeof n)throw new TypeError('The "not" must be a boolean.');if("function"==typeof e)return P._preElems(t,r).filter(((t,r)=>!!e.call(t,r,t)!==n));if(e instanceof Element)return P._preElems(t,r).filter((t=>t===e!==n));if(Array.isArray(e)||"string"!=typeof e&&null!=e.length)return P._preElems(t,r).filter((t=>e.includes(t)!==n));let o=e;return n&&(o=`:not(${o})`),P._preElems(t,r).filter((t=>1===t.nodeType&&t.matches(o)))}static filter(t,e,r=!1){return r&&(e=`:not(${e})`),P._preElems(t,"filter").filter((t=>1===t.nodeType&&t.matches(e)))}static filterOnly(t,e){return P.winnow(t,e,"filterOnly",!1)}static not(t,e){return P.winnow(t,e,"not",!0)}not(t){return P.not(this,t)}static find(t,e){const r=[];for(const n of P._preElems(t,"find"))r.push(...n.querySelectorAll(e));return[...new Set(r)]}find(t){return P.find(this,t)}static is(t,e){return P.winnow(t,e,"is",!1).length>0}is(t){return P.is(this,t)}static has(t,e){const r="string"==typeof e?[...document.querySelectorAll(e)]:P._preElems(e,"has");return P._preElems(t,"has").filter((t=>r.some((e=>t&&t.contains(e)))))}has(t){return P.has(this,t)}static closest(t,e,r){const n=[];for(const o of P._preElems(t,"closest")){let t=o;for(;t&&t!==r;){if(1===t.nodeType&&("string"==typeof e?t.matches(e):t===e)){n.push(t);break}t=t.parentElement}}return[...new Set(n)]}closest(t,e){return P.closest(this,t,e)}static isSameDom(t,e){return P._preNodeElem(t,"isSameDom")===P._preNodeElem(e,"isSameDom")}isSameDom(t){return P.isSameDom(this,t)}#u={};get _data(){return{...this.#u}}set _data(t){if("object"!=typeof t||null===t||Array.isArray(t))throw new Error("value must be a non-null object.");this.#u=t}static _dataSelector={public:(t,e)=>{const r=P._preElem(e,t);let n=D.get(r);return n||(n={},D.set(r,n)),n},private:(t,e)=>{if(!(e instanceof P))throw new Error(`Element must be a TinyHtml instance to execute ${t}().`);return e.#u}};static data(t,e,r=!1){const n=P._dataSelector[r?"private":"public"]("data",t);if(null==e)return{...n};if("string"!=typeof e)throw new TypeError("The key must be a string.");return n.hasOwnProperty(e)?n[e]:void 0}data(t,e){return P.data(this,t,e)}static setData(t,e,r,n=!1){const o=P._dataSelector[n?"private":"public"]("setData",t);if("string"!=typeof e)throw new TypeError("The key must be a string.");return void 0!==r?o[e]=r:P.removeData(t,e),t}setData(t,e,r=!1){return P.setData(this,t,e,r)}static hasData(t,e,r=!1){if("string"!=typeof e)throw new TypeError("The key must be a string.");const n=P._dataSelector[r?"private":"public"]("hasData",t);return Object.prototype.hasOwnProperty.call(n,e)}hasData(t,e=!1){return P.hasData(this,t,e)}static removeData(t,e,r=!1){if("string"!=typeof e)throw new TypeError("The key must be a string.");return delete P._dataSelector[r?"private":"public"]("removeData",t)[e]}removeData(t,e=!1){return P.removeData(this,t,e)}static _getSibling(t,e,r){let n=P._preNodeElemWithNull(t,r);for(;n&&(n=n[e])&&1!==n.nodeType;);return n instanceof Node?n:null}static _getSiblings(t,e){let r=t;const n=[];for(;r;r=r.nextSibling)1===r.nodeType&&r!==e&&n.push(r);return n}static domDir(t,e,r,n="domDir"){if("string"!=typeof e)throw new TypeError('The "direction" must be a string.');let o=P._preNodeElemWithNull(t,n);const i=[];for(;o&&(o=o[e]);)if(1===o.nodeType){if(r&&("string"==typeof r?o.matches(r):o===r))break;i.push(o)}return i}static parent(t){let e=P._preNodeElemWithNull(t,"parent");const r=e?e.parentNode:null;return r&&11!==r.nodeType?r:null}parent(){return P.parent(this)}static parents(t,e){return P.domDir(t,"parentNode",e,"parents")}parents(t){return P.parents(this,t)}static next(t){return P._getSibling(t,"nextSibling","next")}next(){return P.next(this)}static prev(t){return P._getSibling(t,"previousSibling","prev")}prev(){return P.prev(this)}static nextAll(t){return P.domDir(t,"nextSibling",void 0,"nextAll")}nextAll(){return P.nextAll(this)}static prevAll(t){return P.domDir(t,"previousSibling",void 0,"prevAll")}prevAll(){return P.prevAll(this)}static nextUntil(t,e){return P.domDir(t,"nextSibling",e,"nextUtil")}nextUntil(t){return P.nextUntil(this,t)}static prevUntil(t,e){return P.domDir(t,"previousSibling",e,"prevUtil")}prevUntil(t){return P.prevUntil(this,t)}static siblings(t){const e=P._preNodeElemWithNull(t,"siblings");return P._getSiblings(e&&e.parentNode?e.parentNode.firstChild:null,e)}siblings(){return P.siblings(this)}static children(t){const e=P._preNodeElemWithNull(t,"children");return P._getSiblings(e?e.firstChild:null)}children(){return P.children(this)}static contents(t){const e=P._preNodeElemWithNull(t,"contents");return e instanceof HTMLIFrameElement&&null!=e.contentDocument&&Object.getPrototypeOf(e.contentDocument)?[e.contentDocument]:e instanceof HTMLTemplateElement?Array.from((e.content||e).childNodes):e?Array.from(e.childNodes):[]}contents(){return P.contents(this)}static clone(t,e=!0){if("boolean"!=typeof e)throw new TypeError('The "deep" must be a boolean.');return P._preNodeElems(t,"clone").map((t=>t.cloneNode(e)))}clone(t){return P.clone(this,t)[0]}static _appendChecker(t,...e){const r=[];for(const n of e)if(null!=n&&!1!==n)if("string"!=typeof n&&"number"!=typeof n)if(n instanceof Node||n instanceof P)r.push(...P._preNodeElems(n,t));else if(Array.isArray(n))r.push(...P._appendChecker(t,...n));else for(const e in n){const o=n[e];r.push(...P._appendChecker(t,o))}else r.push(n);return r}static append(t,...e){return P._preElem(t,"append").append(...P._appendChecker("append",...e)),t}append(...t){return P.append(this,...t)}static prepend(t,...e){return P._preElem(t,"prepend").prepend(...P._appendChecker("prepend",...e)),t}prepend(...t){return P.prepend(this,...t)}static before(t,...e){return P._preElem(t,"before").before(...P._appendChecker("before",...e)),t}before(...t){return P.before(this,...t)}static after(t,...e){return P._preElem(t,"after").after(...P._appendChecker("after",...e)),t}after(...t){return P.after(this,...t)}static replaceWith(t,...e){return P._preElem(t,"replaceWith").replaceWith(...P._appendChecker("replaceWith",...e)),t}replaceWith(...t){return P.replaceWith(this,...t)}static appendTo(t,e){const r=P._preNodeElems(t,"appendTo"),n=P._preNodeElems(e,"appendTo");return n.forEach(((t,e)=>{r.forEach((r=>t.appendChild(e===n.length-1?r:r.cloneNode(!0))))})),t}appendTo(t){return P.appendTo(this,t)}static prependTo(t,e){const r=P._preElems(t,"prependTo"),n=P._preElems(e,"prependTo");return n.forEach(((t,e)=>{r.slice().reverse().forEach((r=>t.prepend(e===n.length-1?r:r.cloneNode(!0))))})),t}prependTo(t){return P.prependTo(this,t)}static insertBefore(t,e,r=null){const n=P._preNodeElem(t,"insertBefore"),o=P._preNodeElem(e,"insertBefore"),i=P._preNodeElemWithNull(r,"insertBefore");if(!o.parentNode)throw new Error("The target element has no parent node to insert before.");return o.parentNode.insertBefore(n,i||o),t}insertBefore(t,e){return P.insertBefore(this,t,e)}static insertAfter(t,e,r=null){const n=P._preNodeElem(t,"insertAfter"),o=P._preNodeElem(e,"insertBefore"),i=P._preNodeElemWithNull(r,"insertBefore");if(!o.parentNode)throw new Error("The target element has no parent node to insert after.");return o.parentNode.insertBefore(n,i||o.nextSibling),t}insertAfter(t,e){return P.insertAfter(this,t,e)}static replaceAll(t,e){const r=P._preNodeElems(t,"replaceAll"),n=P._preNodeElems(e,"replaceAll");return n.forEach(((t,e)=>{const o=t.parentNode;r.forEach((r=>{o&&o.replaceChild(e===n.length-1?r:r.cloneNode(!0),t)}))})),t}replaceAll(t){return P.replaceAll(this,t)}#t;get size(){return this.#t.length}static _elCheck(t){for(const e of t)if(!(e instanceof Element||e instanceof Window||e instanceof Document||e instanceof Text))throw new Error("[TinyHtml] Invalid Target in constructor.")}add(t){return new P([...this.#t,...P._selector(t)])}static _selector(t){if(t instanceof P)throw new Error("[TinyHtml] You are trying to put a TinyHtml inside another TinyHtml in constructor.");const e=t=>Array.from(new Set(t)),r="string"!=typeof t?t:document.querySelectorAll(t);if(Array.isArray(r))return P._elCheck(r),e(r);if(r instanceof NodeList||r instanceof HTMLCollection){const t=[...r];return P._elCheck(t),e(t)}{const t=[r];return P._elCheck(t),e(t)}}constructor(t){this.#t=P._selector(t),this.#l=P.#c}static isWindow(t){return null!=t&&t===t.window}static css(t){const e=P._preElem(t,"css");return window.getComputedStyle(e)}css(){return P.css(this)}static cssString(t,e){const r=P._preElem(t,"cssString");if("string"!=typeof e)throw new TypeError("The prop must be a string.");const n=window.getComputedStyle(r)[e];return"string"==typeof n?n:"number"==typeof n?n.toString():null}cssString(t){return P.cssString(this,t)}static cssList(t,e){const r=P._preElem(t,"cssList");if(!Array.isArray(e))throw new TypeError("The prop must be an array of strings.");const n=window.getComputedStyle(r),o={};for(const t of e)void 0!==t&&(o[t]=n.getPropertyValue(t));return o}cssList(t){return P.cssList(this,t)}static cssFloat(t,e){const r=P._preElem(t,"cssFloat");if("string"!=typeof e)throw new TypeError("The prop must be a string.");const n=window.getComputedStyle(r)[e];return parseFloat(n)||0}cssFloat(t){return P.cssFloat(this,t)}static cssFloats(t,e){const r=P._preElem(t,"cssFloats");if(!Array.isArray(e))throw new TypeError("The prop must be an array of strings.");const n=window.getComputedStyle(r),o={};for(const t of e)o[t]=parseFloat(n[t])||0;return o}cssFloats(t){return P.cssFloats(this,t)}static#f={alignContent:"align-content",alignItems:"align-items",alignSelf:"align-self",animationDelay:"animation-delay",animationDirection:"animation-direction",animationDuration:"animation-duration",animationFillMode:"animation-fill-mode",animationIterationCount:"animation-iteration-count",animationName:"animation-name",animationPlayState:"animation-play-state",animationTimingFunction:"animation-timing-function",backfaceVisibility:"backface-visibility",backgroundAttachment:"background-attachment",backgroundBlendMode:"background-blend-mode",backgroundClip:"background-clip",backgroundColor:"background-color",backgroundImage:"background-image",backgroundOrigin:"background-origin",backgroundPosition:"background-position",backgroundRepeat:"background-repeat",backgroundSize:"background-size",borderBottom:"border-bottom",borderBottomColor:"border-bottom-color",borderBottomLeftRadius:"border-bottom-left-radius",borderBottomRightRadius:"border-bottom-right-radius",borderBottomStyle:"border-bottom-style",borderBottomWidth:"border-bottom-width",borderCollapse:"border-collapse",borderColor:"border-color",borderImage:"border-image",borderImageOutset:"border-image-outset",borderImageRepeat:"border-image-repeat",borderImageSlice:"border-image-slice",borderImageSource:"border-image-source",borderImageWidth:"border-image-width",borderLeft:"border-left",borderLeftColor:"border-left-color",borderLeftStyle:"border-left-style",borderLeftWidth:"border-left-width",borderRadius:"border-radius",borderRight:"border-right",borderRightColor:"border-right-color",borderRightStyle:"border-right-style",borderRightWidth:"border-right-width",borderSpacing:"border-spacing",borderStyle:"border-style",borderTop:"border-top",borderTopColor:"border-top-color",borderTopLeftRadius:"border-top-left-radius",borderTopRightRadius:"border-top-right-radius",borderTopStyle:"border-top-style",borderTopWidth:"border-top-width",borderWidth:"border-width",boxDecorationBreak:"box-decoration-break",boxShadow:"box-shadow",boxSizing:"box-sizing",breakAfter:"break-after",breakBefore:"break-before",breakInside:"break-inside",captionSide:"caption-side",caretColor:"caret-color",clipPath:"clip-path",columnCount:"column-count",columnFill:"column-fill",columnGap:"column-gap",columnRule:"column-rule",columnRuleColor:"column-rule-color",columnRuleStyle:"column-rule-style",columnRuleWidth:"column-rule-width",columnSpan:"column-span",columnWidth:"column-width",counterIncrement:"counter-increment",counterReset:"counter-reset",emptyCells:"empty-cells",flexBasis:"flex-basis",flexDirection:"flex-direction",flexFlow:"flex-flow",flexGrow:"flex-grow",flexShrink:"flex-shrink",flexWrap:"flex-wrap",fontFamily:"font-family",fontFeatureSettings:"font-feature-settings",fontKerning:"font-kerning",fontLanguageOverride:"font-language-override",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontSynthesis:"font-synthesis",fontVariant:"font-variant",fontVariantAlternates:"font-variant-alternates",fontVariantCaps:"font-variant-caps",fontVariantEastAsian:"font-variant-east-asian",fontVariantLigatures:"font-variant-ligatures",fontVariantNumeric:"font-variant-numeric",fontVariantPosition:"font-variant-position",fontWeight:"font-weight",gridArea:"grid-area",gridAutoColumns:"grid-auto-columns",gridAutoFlow:"grid-auto-flow",gridAutoRows:"grid-auto-rows",gridColumn:"grid-column",gridColumnEnd:"grid-column-end",gridColumnGap:"grid-column-gap",gridColumnStart:"grid-column-start",gridGap:"grid-gap",gridRow:"grid-row",gridRowEnd:"grid-row-end",gridRowGap:"grid-row-gap",gridRowStart:"grid-row-start",gridTemplate:"grid-template",gridTemplateAreas:"grid-template-areas",gridTemplateColumns:"grid-template-columns",gridTemplateRows:"grid-template-rows",imageRendering:"image-rendering",justifyContent:"justify-content",letterSpacing:"letter-spacing",lineBreak:"line-break",lineHeight:"line-height",listStyle:"list-style",listStyleImage:"list-style-image",listStylePosition:"list-style-position",listStyleType:"list-style-type",marginBottom:"margin-bottom",marginLeft:"margin-left",marginRight:"margin-right",marginTop:"margin-top",maskClip:"mask-clip",maskComposite:"mask-composite",maskImage:"mask-image",maskMode:"mask-mode",maskOrigin:"mask-origin",maskPosition:"mask-position",maskRepeat:"mask-repeat",maskSize:"mask-size",maskType:"mask-type",maxHeight:"max-height",maxWidth:"max-width",minHeight:"min-height",minWidth:"min-width",mixBlendMode:"mix-blend-mode",objectFit:"object-fit",objectPosition:"object-position",offsetAnchor:"offset-anchor",offsetDistance:"offset-distance",offsetPath:"offset-path",offsetRotate:"offset-rotate",outlineColor:"outline-color",outlineOffset:"outline-offset",outlineStyle:"outline-style",outlineWidth:"outline-width",overflowAnchor:"overflow-anchor",overflowWrap:"overflow-wrap",overflowX:"overflow-x",overflowY:"overflow-y",paddingBottom:"padding-bottom",paddingLeft:"padding-left",paddingRight:"padding-right",paddingTop:"padding-top",pageBreakAfter:"page-break-after",pageBreakBefore:"page-break-before",pageBreakInside:"page-break-inside",perspectiveOrigin:"perspective-origin",placeContent:"place-content",placeItems:"place-items",placeSelf:"place-self",pointerEvents:"pointer-events",rowGap:"row-gap",scrollBehavior:"scroll-behavior",scrollMargin:"scroll-margin",scrollMarginBlock:"scroll-margin-block",scrollMarginBlockEnd:"scroll-margin-block-end",scrollMarginBlockStart:"scroll-margin-block-start",scrollMarginBottom:"scroll-margin-bottom",scrollMarginInline:"scroll-margin-inline",scrollMarginInlineEnd:"scroll-margin-inline-end",scrollMarginInlineStart:"scroll-margin-inline-start",scrollMarginLeft:"scroll-margin-left",scrollMarginRight:"scroll-margin-right",scrollMarginTop:"scroll-margin-top",scrollPadding:"scroll-padding",scrollPaddingBlock:"scroll-padding-block",scrollPaddingBlockEnd:"scroll-padding-block-end",scrollPaddingBlockStart:"scroll-padding-block-start",scrollPaddingBottom:"scroll-padding-bottom",scrollPaddingInline:"scroll-padding-inline",scrollPaddingInlineEnd:"scroll-padding-inline-end",scrollPaddingInlineStart:"scroll-padding-inline-start",scrollPaddingLeft:"scroll-padding-left",scrollPaddingRight:"scroll-padding-right",scrollPaddingTop:"scroll-padding-top",scrollSnapAlign:"scroll-snap-align",scrollSnapStop:"scroll-snap-stop",scrollSnapType:"scroll-snap-type",shapeImageThreshold:"shape-image-threshold",shapeMargin:"shape-margin",shapeOutside:"shape-outside",tabSize:"tab-size",tableLayout:"table-layout",textAlign:"text-align",textAlignLast:"text-align-last",textCombineUpright:"text-combine-upright",textDecoration:"text-decoration",textDecorationColor:"text-decoration-color",textDecorationLine:"text-decoration-line",textDecorationStyle:"text-decoration-style",textIndent:"text-indent",textJustify:"text-justify",textOrientation:"text-orientation",textOverflow:"text-overflow",textShadow:"text-shadow",textTransform:"text-transform",transformBox:"transform-box",transformOrigin:"transform-origin",transformStyle:"transform-style",transitionDelay:"transition-delay",transitionDuration:"transition-duration",transitionProperty:"transition-property",transitionTimingFunction:"transition-timing-function",unicodeBidi:"unicode-bidi",userSelect:"user-select",verticalAlign:"vertical-align",whiteSpace:"white-space",willChange:"will-change",wordBreak:"word-break",wordSpacing:"word-spacing",wordWrap:"word-wrap",writingMode:"writing-mode",zIndex:"z-index",WebkitTransform:"-webkit-transform",WebkitTransition:"-webkit-transition",WebkitBoxShadow:"-webkit-box-shadow",MozBoxShadow:"-moz-box-shadow",MozTransform:"-moz-transform",MozTransition:"-moz-transition",msTransform:"-ms-transform",msTransition:"-ms-transition"};static cssPropAliases=new Proxy(P.#f,{set:(t,e,r)=>(t[e]=r,P.cssPropRevAliases[r]=e,!0)});static cssPropRevAliases=Object.fromEntries(Object.entries(P.#f).map((([t,e])=>[e,t])));static toStyleKc(t){return"string"==typeof P.cssPropAliases[t]?P.cssPropAliases[t]:t}static toStyleCc(t){return"string"==typeof P.cssPropRevAliases[t]?P.cssPropRevAliases[t]:t}static setStyle(t,e,r=null){return P._preHtmlElems(t,"setStyle").forEach((t=>{if("object"==typeof e)for(const[r,n]of Object.entries(e))t.style.setProperty(P.toStyleKc(r),"string"==typeof n?n:"number"==typeof n?`${n}px`:String(n));else t.style.setProperty(P.toStyleKc(e),r)})),t}setStyle(t,e){return P.setStyle(this,t,e)}static getStyle(t,e){return P._preHtmlElem(t,"getStyle").style.getPropertyValue(P.toStyleKc(e))}getStyle(t){return P.getStyle(this,t)}static style(t,{camelCase:e=!1,rawAttr:r=!1}={}){if("boolean"!=typeof e)throw new TypeError('"camelCase" must be a boolean. Received: '+typeof e);if("boolean"!=typeof r)throw new TypeError('"rawAttr" must be a boolean. Received: '+typeof r);const n=P._preHtmlElem(t,"style"),o={};if(r){const t=(n.getAttribute("style")||"").split(";");for(const r of t){const[t,n]=r.split(":");if(!t||!n)continue;const i=t.trim(),s=n.trim();o[e?P.toStyleCc(i):i]=s}}else{const t=n.style;for(let r=0;r<t.length;r++){const n=t[r],i=t.getPropertyValue(n);o[e?P.toStyleCc(n):n]=i}}return o}style(t){return P.style(this,t)}static removeStyle(t,e){return P._preHtmlElems(t,"removeStyle").forEach((t=>{if(Array.isArray(e))for(const r of e)t.style.removeProperty(P.toStyleKc(r));else t.style.removeProperty(P.toStyleKc(e))})),t}removeStyle(t){return P.removeStyle(this,t)}static toggleStyle(t,e,r,n){return P._preHtmlElems(t,"toggleStyle").forEach((t=>{const o=P.getStyle(t,e).trim()===P.toStyleKc(r)?n:r;P.setStyle(t,e,o)})),t}toggleStyle(t,e,r){return P.toggleStyle(this,t,e,r)}static clearStyle(t){return P._preElems(t,"clearStyle").forEach((t=>t.removeAttribute("style"))),t}clearStyle(){return P.clearStyle(this)}static focus(t){return P._preHtmlElem(t,"focus").focus(),t}focus(){return P.focus(this)}static blur(t){return P._preHtmlElem(t,"blur").blur(),t}blur(){return P.blur(this)}static select(t){const e=P._preHtmlElem(t,"select");if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement))throw new Error("Element must be an <input> or <textarea> to use select().");return e.select(),t}select(){return P.select(this)}static boolCheck(t){return void 0!==t&&("true"===t||"1"===t||!0===t||"on"===t||"number"==typeof t&&t>0)}static setWinScrollTop(t){if("number"!=typeof t)throw new TypeError("The value must be a number.");P.setScrollTop(window,t)}static setWinScrollLeft(t){if("number"!=typeof t)throw new TypeError("The value must be a number.");P.setScrollLeft(window,t)}static winScrollTop(){return window.scrollY||document.documentElement.scrollTop}static winScrollLeft(){return window.scrollX||document.documentElement.scrollLeft}static winInnerHeight(){return window.innerHeight||document.documentElement.clientHeight}static winInnerWidth(){return window.innerWidth||document.documentElement.clientWidth}static isPageTop(){return 0===window.scrollY}static isPageBottom(){return window.innerHeight+window.scrollY>=document.body.offsetHeight}static getDimension(t,e,r="content"){const n=P._preElemAndWinAndDoc(t,"getDimension");if("string"!=typeof e)throw new TypeError("The type must be a string.");if("string"!=typeof r)throw new TypeError("The extra must be a string.");const o="width"===e?"Width":"Height";if(P.isWindow(n))return"margin"===r?n["inner"+o]:n.document.documentElement["client"+o];const i=n;if(9===i.nodeType){const t=i.documentElement;return Math.max(i.body["scroll"+o],t["scroll"+o],i.body["offset"+o],t["offset"+o],t["client"+o])}let s=i.getBoundingClientRect()[e];function a(t){return"width"===e?P.cssFloat(i,t+"Left")+P.cssFloat(i,t+"Right"):P.cssFloat(i,t+"Top")+P.cssFloat(i,t+"Bottom")}switch(r){case"content":s-=a("padding"),s-=a("border");break;case"padding":s-=a("border");break;case"border":break;case"margin":s+=a("margin")}return s}getDimension(t,e){return P.getDimension(this,t,e)}static setHeight(t,e){const r=P._preHtmlElem(t,"setHeight");if("number"!=typeof e&&"string"!=typeof e)throw new TypeError("The value must be a string or number.");return r.style.height="number"==typeof e?`${e}px`:e,t}setHeight(t){return P.setHeight(this,t)}set height(t){P.setHeight(this,t)}static setWidth(t,e){const r=P._preHtmlElem(t,"setWidth");if("number"!=typeof e&&"string"!=typeof e)throw new TypeError("The value must be a string or number.");return r.style.width="number"==typeof e?`${e}px`:e,t}setWidth(t){return P.setWidth(this,t)}set width(t){P.setWidth(this,t)}static height(t){const e=P._preElemAndWinAndDoc(t,"height");return P.getDimension(e,"height","content")}get height(){return P.height(this)}static width(t){const e=P._preElemAndWinAndDoc(t,"width");return P.getDimension(e,"width","content")}get width(){return P.width(this)}static innerHeight(t){const e=P._preElemAndWinAndDoc(t,"innerHeight");return P.getDimension(e,"height","padding")}innerHeight(){return P.innerHeight(this)}static innerWidth(t){const e=P._preElemAndWinAndDoc(t,"innerWidth");return P.getDimension(e,"width","padding")}innerWidth(){return P.innerWidth(this)}static outerHeight(t,e=!1){if("boolean"!=typeof e)throw new TypeError('The "includeMargin" must be a boolean.');const r=P._preElemAndWinAndDoc(t,"outerHeight");return P.getDimension(r,"height",e?"margin":"border")}outerHeight(t){return P.outerHeight(this,t)}static outerWidth(t,e=!1){if("boolean"!=typeof e)throw new TypeError('The "includeMargin" must be a boolean.');const r=P._preElemAndWinAndDoc(t,"outerWidth");return P.getDimension(r,"width",e?"margin":"border")}outerWidth(t){return P.outerWidth(this,t)}#l="";get mainDisplay(){return this.#l}set mainDisplay(t){if("string"!=typeof t)throw new TypeError("mainDisplay must be a string.");this.#l=t}static#c="block";static get defaultDisplay(){return P.#c}static set defaultDisplay(t){if("string"!=typeof t)throw new TypeError("defaultDisplay must be a string.");P.#c=t}static getAnimateData(t,e){let r=M.get(t);return r||(r={},M.set(t,r)),r[e]}static setAnimateData(t,e,r){if(!(t instanceof HTMLElement))throw new TypeError("setAnimateData: el must be an HTMLElement.");if("string"!=typeof e)throw new TypeError("setAnimateData: where must be a string.");if("string"!=typeof r&&"number"!=typeof r)throw new TypeError("setAnimateData: value must be a string or number.");let n=M.get(t);n||(n={},M.set(t,n)),n[e]=r}static#p=!0;static get cancelOldStyleFx(){return P.#p}static set cancelOldStyleFx(t){if("boolean"!=typeof t)throw new TypeError("Expected a boolean value.");P.#p=t}static#h={slow:{duration:600,easing:"ease"},fast:{duration:200,easing:"ease-out"},_default:{duration:400,easing:"linear"}};static get styleFxSpeeds(){const t={};for(const e in P.#h){const r=P.#h[e];t[e]="object"==typeof r?{...r}:r}return t}static set styleFxSpeeds(t){if("object"!=typeof t||null===t||Array.isArray(t))throw new TypeError("styleFxSpeeds must be an object.");for(const[e,r]of Object.entries(t))if("number"!=typeof r&&"object"!=typeof r)throw new TypeError(`styleFxSpeeds["${e}"] must be a number or KeyframeAnimationOptions.`);P.#h={};for(const[e,r]of Object.entries(t))P.setStyleFxSpeed(e,r)}static getStyleFxSpeed(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');const e=P.#h[t];return"object"==typeof e?{...e}:e}static setStyleFxSpeed(t,e){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');if("number"!=typeof e&&"object"!=typeof e)throw new TypeError("styleFxSpeed must be a number or KeyframeAnimationOptions");P.#h[t]="object"==typeof e?{...e}:e}static deleteStyleFxSpeed(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return delete P.#h[t]}static hasStyleFxSpeed(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return Object.prototype.hasOwnProperty.call(P.#h,t)}static#g=["Top","Right","Bottom","Left"];static#d={slideDown:P.genStyleFx("show"),slideUp:P.genStyleFx("hide"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}};static get styleEffects(){return JSON.parse(JSON.stringify(P.#d))}static set styleEffects(t){if("object"!=typeof t||null===t||Array.isArray(t))throw new TypeError("styleEffects must be an object");for(const e in t)for(const[r,n]of Object.entries(t[e]))if(!("string"==typeof n||Array.isArray(n)&&n.every((t=>"string"==typeof t||"number"==typeof t))))throw new TypeError(`Invalid styleEffect["${r}"]`);P.#d={};for(const e in t)P.setStyleEffect(e,t[e])}static getStyleEffect(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');const e=P.#d[t];return e?JSON.parse(JSON.stringify(e)):void 0}static setStyleEffect(t,e){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');if("object"!=typeof e||null===e||Array.isArray(e))throw new TypeError("styleEffect must be an object");const r={};for(const[t,n]of Object.entries(e))if("string"==typeof n)r[t]=n;else{if(!Array.isArray(n)||!n.every((t=>"string"==typeof t||"number"==typeof t)))throw new TypeError(`Invalid styleEffect["${t}"]`);r[t]=[...n]}P.#d[t]=r}static deleteStyleEffect(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return delete P.#d[t]}static hasStyleEffect(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return Object.prototype.hasOwnProperty.call(P.#d,t)}static#m={slideDown:"slideUp",slideUp:"slideDown",fadeIn:"fadeOut",fadeOut:"fadeIn",fadeTo:"fadeIn"};static get styleEffectInverse(){return{...P.#m}}static set styleEffectInverse(t){if("object"!=typeof t||null===t)throw new TypeError("styleEffectInverse must be an object.");for(const[e,r]of Object.entries(t))if("string"!=typeof r)throw new TypeError(`styleEffectInverse["${e}"] must be a string.`);P.#m={};for(const[e,r]of Object.entries(t))P.setStyleEffectInverse(e,r)}static getStyleEffectInverse(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return P.#m[t]||null}static setStyleEffectInverse(t,e){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');if("string"!=typeof e)throw new TypeError(`styleEffectInverse["${t}"] must be a string.`);P.#m[t]=e}static deleteStyleEffectInverse(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return delete P.#m[t]}static hasStyleEffectInverse(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return Object.prototype.hasOwnProperty.call(P.#m,t)}static#y={slideDown:t=>t.height[0]===t.height[1]&&(!t.width||t.width[0]===t.width[1]),slideUp:t=>t.height[0]===t.height[1]&&(!t.width||t.width[0]===t.width[1]),fadeIn:t=>Number(t.opacity[0])===Number(t.opacity[1]),fadeOut:t=>Number(t.opacity[0])===Number(t.opacity[1])};static get styleEffectsRd(){return{...P.#y}}static set styleEffectsRd(t){if("object"!=typeof t||null===t)throw new TypeError("styleEffectsRd must be an object.");for(const[e,r]of Object.entries(t))if("function"!=typeof r)throw new TypeError(`styleEffectsRd["${e}"] must be a function.`);P.#y={};for(const[e,r]of Object.entries(t))P.setStyleEffectRd(e,r)}static getStyleEffectRd(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return P.#y[t]||null}static setStyleEffectRd(t,e){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');if("function"!=typeof e)throw new TypeError(`styleEffectsRd["${t}"] must be a function.`);P.#y[t]=e}static deleteStyleEffectRd(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return delete P.#y[t]}static hasStyleEffectRd(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return Object.prototype.hasOwnProperty.call(P.#y,t)}static#w={show:(t,e,r,n)=>{if("height"===r||"width"===r){const o=P.getAnimateData(t,`orig${r}`)||t.scrollHeight+"px";P.setAnimateData(t,`orig${r}`,o);const i=n[r];e[r]=[i,o]}else if(r.startsWith("margin")||r.startsWith("padding")){const o=P.getAnimateData(t,r)||n[r];P.setAnimateData(t,r,o),e[r]=["0px",o]}else if("opacity"===r){const t=n.opacity;e[r]=[t,1]}else{const o=P.getAnimateData(t,r)||n[r];P.setAnimateData(t,r,o),e[r]=[o,n[r]||1]}},hide:(t,e,r,n)=>{if("height"===r||"width"===r){const o=P.getAnimateData(t,`orig${r}`)||n[r];P.setAnimateData(t,`orig${r}`,o);const i=n[r];e[r]=[i,0]}else if(r.startsWith("margin")||r.startsWith("padding")){const o=P.getAnimateData(t,r)||n[r];P.setAnimateData(t,r,o),e[r]=[n[r],"0px"]}else if("opacity"===r){const t=n.opacity;e[r]=[t,0]}else{const o=P.getAnimateData(t,r)||n[r];P.setAnimateData(t,r,o),e[r]=[o,0]}}};static get styleEffectsProps(){return{...P.#w}}static set styleEffectsProps(t){if("object"!=typeof t||null===t||Array.isArray(t))throw new TypeError("styleEffectsProps must be an object");for(const[e,r]of Object.entries(t))if("function"!=typeof r)throw new TypeError(`styleEffectsProps["${e}"] must be a function`);P.#w={};for(const[e,r]of Object.entries(t))P.setStyleEffectProp(e,r)}static getStyleEffectProp(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return P.#w[t]||null}static setStyleEffectProp(t,e){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');if("function"!=typeof e)throw new TypeError(`styleEffectsProps["${t}"] must be a function`);P.#w[t]=e}static deleteStyleEffectProp(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return delete P.#w[t]}static hasStyleEffectProp(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return Object.prototype.hasOwnProperty.call(P.#w,t)}static genStyleFx(t,e=!1){if("string"!=typeof t)throw new TypeError("genStyleFx: type must be a string.");if("boolean"!=typeof e)throw new TypeError("genStyleFx: includeWidth must be a boolean.");let r,n=0;const o={height:t},i=e?1:0;for(;n<4;n+=2-i)r=P.#g[n],o["margin"+r]=t,o["padding"+r]=t;return e&&(o.opacity=t,o.width=t),o}static applyStyleFx(t,e,r,n){if("string"!=typeof e)throw new TypeError("applyStyleFx: id must be a string.");if("object"!=typeof r||null===r)throw new TypeError("applyStyleFx: props must be a non-null object.");if(void 0!==n&&"number"!=typeof n&&"string"!=typeof n&&("object"!=typeof n||null===n))throw new TypeError("applyStyleFx: ops must be a number, string, KeyframeAnimationOptions, or undefined.");const o=new Map;return P._preHtmlElems(t,"applyStyleFx").forEach((i=>{const s={};for(const[t,e]of Object.entries(r))if("string"==typeof e&&this.#w[e]){const r=getComputedStyle(i);this.#w[e](i,s,t,r)}else{if("object"!=typeof e)throw new TypeError(`applyStyleFx: invalid action for prop "${t}". Must be string or array.`);s[t]=e}if("function"==typeof P.#y[e]&&P.#y[e](s))return void o.set(i,null);const a=[],u=s[Object.keys(s)[0]].length;for(let t=0;t<u;t++){const e={};for(const r in s)e[r]=s[r][t];a.push(e)}o.set(i,P.animate(t,a,n,e)[0])})),o}applyStyleFx(t,e,r){return P.applyStyleFx(this,t,e,r)}static getCurrentAnimationId(t){if(!(t instanceof HTMLElement))throw new TypeError("Expected an HTMLElement.");return W.get(t)?.id??void 0}static animate(t,e,r=P.#h._default,n=null,o=P.#p){const i="string"==typeof r?P.#h[r]??void 0:"number"!=typeof r?{...r}:r;"object"==typeof i&&void 0===i.fill&&(i.fill="forwards");const s=[];return P._preHtmlElems(t,"animate").forEach((t=>{if(o){const e=W.get(t);e&&e.animation.cancel()}const r=t.animate(e,i);s.push(r),W.set(t,{animation:r,id:n??""}),r.addEventListener("finish",(()=>{W.get(t)?.animation===r&&W.delete(t)}))})),s}animate(t,e,r,n){return P.animate(this,t,e,r,n)}static stop(t){const e=[];return P._preHtmlElems(t,"stop").forEach((t=>{const r=W.get(t);r?(r.animation.cancel(),W.delete(t),e.push(!0)):e.push(!1)})),e}stop(){return P.stop(this)}static slideDown(t,e){return P.applyStyleFx(t,"slideDown",this.#d.slideDown,e??{duration:500,easing:"ease-out"})}slideDown(t){return P.slideDown(this,t)}static slideUp(t,e){return P.applyStyleFx(t,"slideUp",this.#d.slideUp,e??{duration:500,easing:"ease-out"})}slideUp(t){return P.slideUp(this,t)}static slideToggle(t,e){const r=P._preHtmlElem(t,"slideToggle"),n=getComputedStyle(r),o=P.getCurrentAnimationId(r),i="none"===n.display||0===r.offsetHeight;return("string"==typeof o?"slideUp"===o:i)?P.slideDown(t,e):P.slideUp(t,e)}slideToggle(t){return P.slideToggle(this,t)}static fadeIn(t,e){return P.applyStyleFx(t,"fadeIn",this.#d.fadeIn,e)}fadeIn(t){return P.fadeIn(this,t)}static fadeOut(t,e){return P.applyStyleFx(t,"fadeOut",this.#d.fadeOut,e)}fadeOut(t){return P.fadeOut(this,t)}static fadeToggle(t,e){const r=P._preHtmlElem(t,"fadeToggle"),n=getComputedStyle(r),o=P.getCurrentAnimationId(r),i="0"===n.opacity||null===r.offsetParent;return("string"==typeof o?"fadeOut"===o:i)?P.fadeIn(t,e):P.fadeOut(t,e)}fadeToggle(t){return P.fadeToggle(this,t)}static fadeTo(t,e,r,n=P.#c){if("number"!=typeof e||isNaN(e)||e<0||e>1)throw new TypeError("fadeTo: opacity must be a number between 0 and 1.");if(void 0!==r&&"number"!=typeof r&&"string"!=typeof r&&("object"!=typeof r||null===r))throw new TypeError("fadeTo: ops must be a number, string, KeyframeAnimationOptions, or undefined.");const o=new Map;return P._preHtmlElems(t,"fadeTo").forEach((i=>{const s=getComputedStyle(i);if(!(t instanceof Element&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length))){const t=P.getAnimateData(i,"origdisplay");i.style.display="string"==typeof t?t:n}const a=[s.opacity,e].map((t=>({opacity:t})));o.set(i,P.animate(i,a,r,"fadeTo")[0])})),o}fadeTo(t,e,r=this.#l){return P.fadeTo(this,t,e,r)}static offset(t){const e=P._preElem(t,"offset").getBoundingClientRect(),r=window.scrollY||document.documentElement.scrollTop,n=window.scrollX||document.documentElement.scrollLeft;return{top:e.top+r,left:e.left+n}}offset(){return P.offset(this)}static position(t){const e=P._preHtmlElem(t,"position");let r,n,o={top:0,left:0};if("fixed"===window.getComputedStyle(e).position)n=e.getBoundingClientRect();else{n=P.offset(e),r=e.offsetParent||document.documentElement;const{position:t}=window.getComputedStyle(r);for(;r instanceof HTMLElement&&(r===document.body||r===document.documentElement)&&"static"===t;)r=r.parentNode;if(r instanceof HTMLElement&&r!==e&&1===r.nodeType){const{borderTopWidth:t,borderLeftWidth:e}=P.cssFloats(r,["borderTopWidth","borderLeftWidth"]);o=P.offset(r),o.top+=t,o.left+=e}}return{top:n.top-o.top-P.cssFloat(e,"marginTop"),left:n.left-o.left-P.cssFloat(e,"marginLeft")}}position(){return P.position(this)}static offsetParent(t){let e=P._preHtmlElem(t,"offsetParent").offsetParent;for(;e instanceof HTMLElement&&"static"===window.getComputedStyle(e).position;)e=e.offsetParent;return e instanceof HTMLElement?e:document.documentElement}offsetParent(){return P.offsetParent(this)}static scrollTop(t){const e=P._preElemAndWindow(t,"scrollTop");return P.isWindow(e)?e.pageYOffset:9===e.nodeType?e.defaultView.pageYOffset:e.scrollTop}scrollTop(){return P.scrollTop(this)}static scrollLeft(t){const e=P._preElemAndWindow(t,"scrollLeft");return P.isWindow(e)?e.pageXOffset:9===e.nodeType?e.defaultView.pageXOffset:e.scrollLeft}scrollLeft(){return P.scrollLeft(this)}static easings={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>t*(2-t),easeInOutQuad:t=>t<.5?2*t*t:(4-2*t)*t-1,easeInCubic:t=>t*t*t,easeOutCubic:t=>--t*t*t+1,easeInOutCubic:t=>t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1};static scrollToXY(t,{targetX:e,targetY:r,duration:n,easing:o,onAnimation:i}={}){if(void 0!==e&&"number"!=typeof e)throw new TypeError("`targetX` must be a number if provided.");if(void 0!==r&&"number"!=typeof r)throw new TypeError("`targetY` must be a number if provided.");if(void 0!==n&&"number"!=typeof n)throw new TypeError("`duration` must be a number if provided.");if(void 0!==o&&"string"!=typeof o)throw new TypeError("`easing` must be a string if provided.");if(void 0!==o&&"function"!=typeof P.easings[o])throw new TypeError(`Unknown easing function: "${o}".`);if(void 0!==i&&"function"!=typeof i)throw new TypeError("`onAnimation` must be a function if provided.");const s=(t,e,r,n)=>{if(t instanceof Window)window.scrollTo(e,r);else if(9===t.nodeType)t.defaultView.scrollTo(e,r);else{const n=t instanceof Window?window.scrollX:t.scrollLeft,o=t instanceof Window?window.scrollY:t.scrollTop;n!==e&&(t.scrollLeft=e),o!==r&&(t.scrollTop=r)}"function"==typeof i&&i({x:e,y:r,isComplete:n>=1,time:n})};return P._preElemsAndWindow(t,"scrollToXY").forEach((t=>{const i=t instanceof Window?window.scrollX:t.scrollLeft,a=t instanceof Window?window.scrollY:t.scrollTop,u=e??i,l=r??a,c=u-i,f=l-a,p="string"==typeof o&&P.easings[o]||null;if("number"!=typeof n||"function"!=typeof p)return s(t,u,l,1);const h=performance.now(),g=n??0;requestAnimationFrame((function e(r){if("function"!=typeof p)return;const n=Math.min(1,(r-h)/g),o=p(n);s(t,i+c*o,a+f*o,n),n<1&&requestAnimationFrame(e)}))})),t}scrollToXY({targetX:t,targetY:e,duration:r,easing:n,onAnimation:o}={}){return P.scrollToXY(this,{targetX:t,targetY:e,duration:r,easing:n,onAnimation:o})}static setScrollTop(t,e){if("number"!=typeof e)throw new TypeError("ScrollTop value must be a number.");return P.scrollToXY(t,{targetY:e})}setScrollTop(t){return P.setScrollTop(this,t)}static setScrollLeft(t,e){if("number"!=typeof e)throw new TypeError("ScrollLeft value must be a number.");return P.scrollToXY(t,{targetX:e})}setScrollLeft(t){return P.setScrollLeft(this,t)}static borderWidth(t){const e=P._preElem(t,"borderWidth"),{borderLeftWidth:r,borderRightWidth:n,borderTopWidth:o,borderBottomWidth:i}=P.cssFloats(e,["borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"]);return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}}borderWidth(){return P.borderWidth(this)}static border(t){const e=P._preElem(t,"border"),{borderLeft:r,borderRight:n,borderTop:o,borderBottom:i}=P.cssFloats(e,["borderLeft","borderRight","borderTop","borderBottom"]);return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}}border(){return P.border(this)}static margin(t){const e=P._preElem(t,"margin"),{marginLeft:r,marginRight:n,marginTop:o,marginBottom:i}=P.cssFloats(e,["marginLeft","marginRight","marginTop","marginBottom"]);return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}}margin(){return P.margin(this)}static padding(t){const e=P._preElem(t,"padding"),{paddingLeft:r,paddingRight:n,paddingTop:o,paddingBottom:i}=P.cssFloats(e,["paddingLeft","paddingRight","paddingTop","paddingBottom"]);return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}}padding(){return P.padding(this)}static#b=!1;static get classCanWhitespace(){return this.#b}static set classCanWhitespace(t){if("boolean"!=typeof t)throw new TypeError("classCanWhitespace must be a boolean");this.#b=t}static addClass(t,...e){const r=[];for(const t of e)if(P.#b){const e=t.split(" ");for(const t of e)r.push(t)}else r.push(t);return P._preElems(t,"addClass").forEach((t=>t.classList.add(...r))),t}addClass(...t){return P.addClass(this,...t)}static removeClass(t,...e){const r=[];for(const t of e)if(P.#b){const e=t.split(" ");for(const t of e)r.push(t)}else r.push(t);return P._preElems(t,"removeClass").forEach((t=>t.classList.remove(...r))),t}removeClass(...t){return P.removeClass(this,...t)}static replaceClass(t,e,r){if("string"!=typeof e)throw new TypeError('The "token" parameter must be a string.');if("string"!=typeof r)throw new TypeError('The "newToken" parameter must be a string.');const n=[];return P._preElems(t,"replaceClass").forEach((t=>n.push(t.classList.replace(e,r)))),n}replaceClass(t,e){return P.replaceClass(this,t,e)[0]}static classItem(t,e){const r=P._preElem(t,"classItem");if("number"!=typeof e)throw new TypeError('The "index" parameter must be a number.');return r.classList.item(e)}classItem(t){return P.classItem(this,t)}static toggleClass(t,e,r){if("string"!=typeof e)throw new TypeError('The "token" parameter must be a string.');if(void 0!==r&&"boolean"!=typeof r)throw new TypeError('The "force" parameter must be a boolean.');const n=[];return P._preElems(t,"toggleClass").forEach((t=>n.push(t.classList.toggle(e,r)))),n}toggleClass(t,e){return P.toggleClass(this,t,e)[0]}static hasClass(t,e){const r=P._preElem(t,"hasClass");if("string"!=typeof e)throw new TypeError('The "token" parameter must be a string.');return r.classList.contains(e)}hasClass(t){return P.hasClass(this,t)}static classLength(t){return P._preElem(t,"classLength").classList.length}classLength(){return P.classLength(this)}static classList(t){return P._preElem(t,"classList").classList.values().toArray()}classList(){return P.classList(this)}static tagName(t){return P._preElem(t,"tagName").tagName}tagName(){return P.tagName(this)}static id(t){return P._preElem(t,"id").id}get id(){return P.id(this)}set id(t){P.setAttr(this,"id",t)}static toBigInt(t){const e=P._preElem(t,"toBigInt"),r=e.textContent?.trim();let n=null;try{n=BigInt(r??"")}catch{n=null}return n}toBigInt(){return P.toBigInt(this)}static setBigInt(t,e){if("bigint"!=typeof e)throw new Error("Value is not a valid BigInt.");const r=e.toString();return P._preElems(t,"setBigInt").forEach((t=>t.textContent=r)),t}setBigInt(t){return P.setBigInt(this,t)}static toDate(t){const e=P._preElem(t,"toDate"),r=e.textContent?.trim();if(!r)return null;const n=new Date(r);return Number.isNaN(n.getTime())?null:n}toDate(){return P.toDate(this)}static setDate(t,e){if(!(e instanceof Date)||Number.isNaN(e.getTime()))throw new Error("Value is not a valid Date.");const r=e.toISOString();return P._preElems(t,"setDate").forEach((t=>t.textContent=r)),t}setDate(t){return P.setDate(this,t)}static toJson(t){const e=P._preElem(t,"toJson"),r=e.textContent?.trim();if(!r)return null;try{return JSON.parse(r)}catch{return null}}toJson(){return P.toJson(this)}static setJson(t,e,r,n){const o=JSON.stringify(e,r,n);return P._preElems(t,"setJson").forEach((t=>t.textContent=o)),t}setJson(t,e,r){return P.setJson(this,t,e,r)}static toNumber(t){const e=P._preElem(t,"toNumber");return"string"==typeof e.textContent?parseFloat(e.textContent.trim()):null}toNumber(){return P.toNumber(this)}static setNumber(t,e){if("number"!=typeof e)throw new Error("Value is not a valid number.");const r=e.toString();return P._preElems(t,"setNumber").forEach((t=>t.textContent=r)),t}setNumber(t){return P.setNumber(this,t)}static toBoolean(t){const e=P._preElem(t,"toBoolean"),r=e.textContent?.trim();return null==r||"true"!==r&&"false"!==r?null:/^true$/i.test(r)}toBoolean(){return P.toBoolean(this)}static setBoolean(t,e){if("boolean"!=typeof e)throw new Error("Value is not a valid boolean.");const r=e.toString();return P._preElems(t,"setBoolean").forEach((t=>t.textContent=r)),t}setBoolean(t){return P.setBoolean(this,t)}static toString(t){const e=P._preElem(t,"toString");return"string"==typeof e.textContent?e.textContent:null}toString(){return P.toString(this)}static setString(t,e){if("string"!=typeof e)throw new Error("Value is not a valid string.");return P._preElems(t,"setString").forEach((t=>t.textContent=e)),t}setString(t){return P.setString(this,t)}static text(t){return P._preElem(t,"text").textContent}text(){return P.text(this)}static setText(t,e){const r=null!=e?String(e):"";return P._preElems(t,"setText").forEach((t=>t.textContent=r)),t}setText(t){return P.setText(this,t)}static empty(t){return P._preElems(t,"empty").forEach((t=>t.textContent="")),t}empty(){return P.empty(this)}static html(t,e){return P._preElem(t,"html").getHTML(e)}html(t){return P.html(this,t)}static setHtml(t,e){if("string"!=typeof e)throw new Error("Value is not a valid string.");return P._preElems(t,"setHtml").forEach((t=>t.innerHTML=e)),t}setHtml(t){return P.setHtml(this,t)}static _valHooks={option:{get:t=>{const e=t.getAttribute("value");return null!=e?e:t.textContent}},select:{get:t=>{const e=t.options,r=t.selectedIndex,n="select-one"===t.type,o=n?r+1:e.length,i=[];let s=r<0?o:n?r:0;for(;s<o;s++){const t=e[s],o=t.parentNode;if((t.selected||s===r)&&!t.disabled&&(!o||!o.disabled||"OPTGROUP"!==o.tagName)){const e=P._valHooks.option.get(t);if(n)return e;i.push(e)}}return i},set:(t,e)=>{const r=t.options,n=Array.isArray(e)?e.map(String):[String(e)];let o=!1;for(let t=0;t<r.length;t++){const e=r[t],i=P._valHooks.option.get(e);"string"==typeof i&&(e.selected=n.includes(i))&&(o=!0)}return o||(t.selectedIndex=-1),n}},radio:{get:t=>t.checked?"on":"off",set(t,e){if("boolean"==typeof e){const r=t.closest("label");return e&&r&&r.querySelectorAll('input[type="radio"]').forEach((e=>{e instanceof HTMLInputElement&&e!==t&&(e.checked=!1)})),t.checked=e,e}}},checkbox:{get:t=>t.checked?"on":"off",set(t,e){if("boolean"==typeof e)return t.checked=e,e}}};static setVal(t,e){return P._preInputElems(t,"setVal").forEach((t=>{if(1!==t.nodeType)return;let r="function"==typeof e?e(t,P.val(t)):e;null==r?r="":"number"==typeof r?r=String(r):Array.isArray(r)&&(r=(t=>{const e=[];for(let n=0;n<t.length;n++)e.push(null==(r=t[n])?"":String(r));var r;return e})(r));const n=P._valHooks[t.type]||P._valHooks[t.nodeName.toLowerCase()];if(!n||"function"!=typeof n.set||void 0===n.set(t,r,"value")){if("string"!=typeof r&&"boolean"!=typeof r)throw new Error(`Invalid setValue "${typeof r}" value.`);"string"==typeof r&&(t.value=r)}})),t}setVal(t){return P.setVal(this,t)}static _valTypes={string:t=>t.value,date:t=>t.valueAsDate,number:t=>t.valueAsNumber};static _getValByType(t,e,r){if("string"!=typeof e)throw new TypeError('The "type" must be a string.');if("string"!=typeof r)throw new TypeError('The "where" must be a string.');if(!(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement))throw new Error(`Provided element is not an HTMLInputElement in ${r}().`);if("function"!=typeof P._valTypes[e])throw new Error(`No handler found for type "${e}" in ${r}().`);return P._valTypes[e](t)}static _val(t,e,r){const n=P._preInputElem(t,e),o=P._valHooks[n.type]||P._valHooks[n.nodeName.toLowerCase()];if(o&&"function"==typeof o.get){const t=o.get(n,"value",r);if(void 0!==t)return"string"==typeof t?t.replace(/\r/g,""):t}return P._getValByType(n,r,e)}_val(t,e){return P._val(this,t,e)}static val(t){return P._val(t,"val","string")}val(){return P.val(this)}static valTxt(t){const e=P._val(t,"valTxt","string");if("string"!=typeof e&&null!==e)throw new Error("Value is not a valid string.");return null==e?"":"string"==typeof e?e.replace(/\r/g,""):e}valTxt(){return P.valTxt(this)}static _valArr(t,e,r){const n=P._val(t,e,r);if(!Array.isArray(n))throw new Error(`Value expected an array but got ${typeof n}.`);return n}_valArr(t,e){return P._valArr(this,t,e)}static valArr(t){return P._valArr(t,"valArr","string")}valArr(){return P.valArr(this)}static valNb(t){if(!(P._preInputElem(t,"valNb")instanceof HTMLInputElement))throw new Error("Element must be an input element.");const e=P._val(t,"valNb","number");if(Number.isNaN(e))throw new Error("Value is not a valid number.");return e}valNb(){return P.valNb(this)}static valDate(t){if(!(P._preInputElem(t,"valDate")instanceof HTMLInputElement))throw new Error("Element must be an input element.");const e=P._val(t,"valDate","date");if(!(e instanceof Date))throw new Error("Value is not a valid date.");return e}valDate(){return P.valDate(this)}static valBool(t){const e=P._preInputElem(t,"valBool");if(!(e instanceof HTMLInputElement))throw new Error("Element must be an input element.");return"on"===P.val(e)}valBool(){return P.valBool(this)}static listenForPaste(t,{onFilePaste:e,onTextPaste:r}={}){if(void 0!==e&&"function"!=typeof e)throw new TypeError("onFilePaste must be a function.");if(void 0!==r&&"function"!=typeof r)throw new TypeError("onTextPaste must be a function.");const n=t=>{if(!(t instanceof ClipboardEvent))return;const n=t.clipboardData?.items||[];for(const t of n)if("file"===t.kind){if("function"==typeof e){const r=t.getAsFile();r&&e(t,r)}}else"string"===t.kind&&"function"==typeof r&&t.getAsString((e=>r(t,e)))};return P._preElemsWithDoc(t,"listenForPaste").forEach((t=>P.on(t,"paste",n))),n}listenForPaste({onFilePaste:t,onTextPaste:e}={}){return P.listenForPaste(this,{onFilePaste:t,onTextPaste:e})}static hasEventListener(t,e){const r=P._preEventTargetElem(t,"hasEventListener");if(!B.has(r))return!1;const n=B.get(r);return!!(n&&Array.isArray(n[e])&&n[e].length>0)}hasEventListener(t){return P.hasEventListener(this,t)}static hasExactEventListener(t,e,r){const n=P._preEventTargetElem(t,"hasExactEventListener");if("function"!=typeof r)throw new TypeError('The "handler" must be a function.');if(!B.has(n))return!1;const o=B.get(n);return!(!o||!Array.isArray(o[e]))&&o[e].some((t=>t.handler===r))}hasExactEventListener(t,e){return P.hasExactEventListener(this,t,e)}static hover(t,e,r,n){return P.on(t,"mouseenter",e,n),P.on(t,"mouseleave",r||e,n),t}hover(t,e,r){return P.hover(this,t,e,r)}static on(t,e,r,n){if(!("string"==typeof e||Array.isArray(e)&&e.every((t=>"string"==typeof t))))throw new TypeError("The events must be a string or array of strings.");for(const o of Array.isArray(e)?Array.from(new Set(e)):[e]){if("string"!=typeof o)throw new TypeError("The event name must be a string.");P._preEventTargetElems(t,"on").forEach((t=>{t.addEventListener(o,r,n),B.has(t)||B.set(t,{});const e=B.get(t);e&&(Array.isArray(e[o])||(e[o]=[]),e[o].push({handler:r,options:n}))}))}return t}on(t,e,r){return P.on(this,t,e,r)}static once(t,e,r,n={}){if(!("string"==typeof e||Array.isArray(e)&&e.every((t=>"string"==typeof t))))throw new TypeError("The events must be a string or array of strings.");for(const o of Array.isArray(e)?Array.from(new Set(e)):[e]){if("string"!=typeof o)throw new TypeError("The event name must be a string.");P._preEventTargetElems(t,"once").forEach((t=>{const e=n=>{P.off(t,o,e),"function"==typeof r&&r(n)};P.on(t,o,e,"boolean"==typeof n?n:{...n,once:!0})}))}return t}once(t,e,r={}){return P.once(this,t,e,r)}static off(t,e,r,n){if(!("string"==typeof e||Array.isArray(e)&&e.every((t=>"string"==typeof t))))throw new TypeError("The events must be a string or array of strings.");for(const o of Array.isArray(e)?Array.from(new Set(e)):[e]){if("string"!=typeof o)throw new TypeError("The event name must be a string.");P._preEventTargetElems(t,"off").forEach((t=>{t.removeEventListener(o,r,n);const e=B.get(t);e&&e[o]&&(e[o]=e[o].filter((t=>t.handler!==r)),0===e[o].length&&delete e[o])}))}return t}off(t,e,r){return P.off(this,t,e,r)}static offAll(t,e){if(!("string"==typeof e||Array.isArray(e)&&e.every((t=>"string"==typeof t))))throw new TypeError("The events must be a string or array of strings.");for(const r of Array.isArray(e)?Array.from(new Set(e)):[e]){if("string"!=typeof r)throw new TypeError("The event name must be a string.");P._preEventTargetElems(t,"offAll").forEach((t=>{const e=B.get(t);if(e&&e[r]){for(const n of e[r])t.removeEventListener(r,n.handler,n.options);delete e[r]}}))}return t}offAll(t){return P.offAll(this,t)}static offAllTypes(t,e=null){if(null!==e&&"function"!=typeof e)throw new TypeError('The "filterFn" must be a function.');return P._preEventTargetElems(t,"offAllTypes").forEach((t=>{const r=B.get(t);if(r){for(const n in r)for(const o of r[n])("function"!=typeof e||e(o.handler,n))&&t.removeEventListener(n,o.handler,o.options);B.delete(t)}})),t}offAllTypes(t=null){return P.offAllTypes(this,t)}static trigger(t,e,r={}){if(!("string"==typeof e||Array.isArray(e)&&e.every((t=>"string"==typeof t))))throw new TypeError("The events must be a string or array of strings.");for(const n of Array.isArray(e)?Array.from(new Set(e)):[e]){if("string"!=typeof n)throw new TypeError("The event name must be a string.");P._preEventTargetElems(t,"trigger").forEach((t=>{const e=r instanceof Event||r instanceof CustomEvent?r:new CustomEvent(n,{bubbles:!0,cancelable:!0,detail:r});t.dispatchEvent(e)}))}return t}trigger(t,e={}){return P.trigger(this,t,e)}static#v={for:"htmlFor",class:"className"};static propFix=new Proxy(P.#v,{set:(t,e,r)=>(t[e]=r,P.attrFix[r]=e,!0)});static attrFix=Object.fromEntries(Object.entries(P.#v).map((([t,e])=>[e,t])));static getPropName(t){return"string"==typeof P.propFix[t]?P.propFix[t]:t}static getAttrName(t){return"string"==typeof P.attrFix[t]?P.attrFix[t]:t}static attrBigInt(t,e){const r=P._preElem(t,"attrBigInt").getAttribute(P.getAttrName(e));if(null==r)return null;try{return BigInt(r)}catch{return null}}attrBigInt(t){return P.attrBigInt(this,t)}static setAttrBigInt(t,e,r){if("bigint"!=typeof r)throw new Error("Value is not a valid BigInt.");return P.setAttr(t,e,r.toString())}setAttrBigInt(t,e){return P.setAttrBigInt(this,t,e)}static attrDate(t,e){const r=P._preElem(t,"attrDate").getAttribute(P.getAttrName(e));if(!r)return null;const n=new Date(r);return Number.isNaN(n.getTime())?null:n}attrDate(t){return P.attrDate(this,t)}static setAttrDate(t,e,r){if(!(r instanceof Date)||Number.isNaN(r.getTime()))throw new Error("Value is not a valid Date.");return P.setAttr(t,e,r.toISOString())}setAttrDate(t,e){return P.setAttrDate(this,t,e)}static attrJson(t,e){const r=P._preElem(t,"attrJson").getAttribute(P.getAttrName(e));if(!r)return null;try{return JSON.parse(r)}catch{return null}}attrJson(t){return P.attrJson(this,t)}static setAttrJson(t,e,r,n,o){const i=JSON.stringify(r,n,o);return P.setAttr(t,e,i)}setAttrJson(t,e,r,n){return P.setAttrJson(this,t,e,r,n)}static attrNumber(t,e){const r=P._preElem(t,"attrNumber").getAttribute(P.getAttrName(e));return null!=r?parseFloat(r):null}attrNumber(t){return P.attrNumber(this,t)}static setAttrNumber(t,e,r){if("number"!=typeof r)throw new Error("Value is not a valid number.");return P.setAttr(t,e,r.toString())}setAttrNumber(t,e){return P.setAttrNumber(this,t,e)}static attrBoolean(t,e){const r=P._preElem(t,"attrBoolean").getAttribute(P.getAttrName(e));return null===r||"true"!==r&&"false"!==r?null:/^true$/i.test(r)}attrBoolean(t){return P.attrBoolean(this,t)}static setAttrBoolean(t,e,r){if("boolean"!=typeof r)throw new Error("Value is not a valid boolean.");return P.setAttr(t,e,r.toString())}setAttrBoolean(t,e){return P.setAttrBoolean(this,t,e)}static attrString(t,e){const r=P._preElem(t,"attrString").getAttribute(P.getAttrName(e));return"string"==typeof r?r:null}attrString(t){return P.attrString(this,t)}static setAttrString(t,e,r){if("string"!=typeof r)throw new Error("Value is not a valid string.");return P.setAttr(t,e,r)}setAttrString(t,e){return P.setAttrString(this,t,e)}static attr(t,e){if("string"!=typeof e)throw new TypeError('The "name" must be a string.');return P._preElem(t,"attr").getAttribute(P.getAttrName(e))}attr(t){return P.attr(this,t)}static setAttr(t,e,r=null){const n=P._preElems(t,"setAttr");if("object"==typeof e&&null!==e)return Object.entries(e).forEach((([t,e])=>n.forEach((r=>{null===e?r.removeAttribute(P.getAttrName(t)):r.setAttribute(P.getAttrName(t),String(e))})))),t;if("string"!=typeof e)throw new TypeError('The "name" must be a string.');return n.forEach((t=>{null===r?t.removeAttribute(P.getAttrName(e)):t.setAttribute(P.getAttrName(e),String(r))})),t}setAttr(t,e){return P.setAttr(this,t,e)}static removeAttr(t,e){if("string"!=typeof e)throw new TypeError('The "name" must be a string.');return P._preElems(t,"removeAttr").forEach((t=>t.removeAttribute(P.getAttrName(e)))),t}removeAttr(t){return P.removeAttr(this,t)}static hasAttr(t,e){if("string"!=typeof e)throw new TypeError('The "name" must be a string.');return P._preElem(t,"hasAttr").hasAttribute(P.getAttrName(e))}hasAttr(t){return P.hasAttr(this,t)}static hasProp(t,e){if("string"!=typeof e)throw new TypeError('The "name" must be a string.');return!!P._preElem(t,"hasProp")[P.getPropName(e)]}hasProp(t){return P.hasProp(this,t)}static addProp(t,...e){return P._preElems(t,"addProp").forEach((t=>{e.forEach((e=>{if("string"!=typeof e)throw new TypeError('Each "name" must be a string.');t[P.getPropName(e)]=!0}))})),t}addProp(...t){return P.addProp(this,...t)}static removeProp(t,...e){return P._preElems(t,"removeProp").forEach((t=>{e.forEach((e=>{if("string"!=typeof e)throw new TypeError('Each "name" must be a string.');t[P.getPropName(e)]=!1}))})),t}removeProp(...t){return P.removeProp(this,...t)}static toggleProp(t,e,r){const n=P._preElems(t,"toggleProp");if(void 0!==r&&"boolean"!=typeof r)throw new TypeError('The "force" must be a boolean.');return(Array.isArray(e)?e:[e]).forEach((t=>{if("string"!=typeof t)throw new TypeError("Each property name must be a string.");n.forEach((e=>{(void 0===r?!e[P.getPropName(t)]:r)?P.addProp(e,t):P.removeProp(e,t)}))})),t}toggleProp(t,e){return P.toggleProp(this,t,e)}static prop(t,e){if("string"!=typeof e)throw new TypeError('Invalid arguments passed to prop(). Expected string for "name".');return P._preElem(t,"prop")[e]}prop(t){return P.prop(this,t)}static setProp(t,e,r){if("string"!=typeof e||""===e.trim())throw new Error("Property name must be a non-empty string.");return P._preElems(t,"setProp").forEach((t=>{t[e]=r})),t}setProp(t,e){return P.setProp(this,t,e)}static remove(t){return P._preElems(t,"remove").forEach((t=>t.remove())),t}remove(){return P.remove(this)}static index(t,e=null){const r=P._preElem(t,"index");if(!r)return-1;if(!e)return Array.prototype.indexOf.call(r.parentNode?.children||[],r);if(e){const t="string"==typeof e?document.querySelectorAll(e):P._preElems(e,"index");return Array.prototype.indexOf.call(t,r)}return-1}index(t){return P.index(this,t)}static _getCustomRect(t,e){const r={height:0,width:0,x:0,y:0,bottom:0,left:0,right:0,top:0,toJSON:function(){throw new Error("Function not implemented.")}};for(const e in t)"number"==typeof t[e]&&(r[e]=t[e]);if("object"!=typeof e||null===e||Array.isArray(e))throw new Error("extraRect must be a non-null object.");const{height:n=0,width:o=0,top:i=0,bottom:s=0,left:a=0,right:u=0}=e;if("number"!=typeof n)throw new Error("extraRect.height must be a number.");if("number"!=typeof o)throw new Error("extraRect.width must be a number.");if("number"!=typeof i)throw new Error("extraRect.top must be a number.");if("number"!=typeof s)throw new Error("extraRect.bottom must be a number.");if("number"!=typeof a)throw new Error("extraRect.left must be a number.");if("number"!=typeof u)throw new Error("extraRect.right must be a number.");return r.height+=n,r.width+=o,r.top+=i,r.bottom+=s,r.left+=a,r.right+=u,r}static isCollWith(t,e,r={}){const n=P._getCustomRect(P._preElem(t,"isCollWith").getBoundingClientRect(),r),o=P._preElem(e,"isCollWith").getBoundingClientRect();return C(n,o)}isCollWith(t,e){return P.isCollWith(this,t,e)}static isCollPerfWith(t,e,r={}){const n=P._getCustomRect(P._preElem(t,"isCollPerfWith").getBoundingClientRect(),r),o=P._preElem(e,"isCollPerfWith").getBoundingClientRect();return N(n,o)}isCollPerfWith(t,e){return P.isCollPerfWith(this,t,e)}static _isCollWithLock(t,e,r,n,o){const i=H[o];if(t)return i.has(n)||i.set(n,!0),!0;if(i.has(n)){let t=!1;switch(o){case"top":t=I(e,r);break;case"bottom":t=k(e,r);break;case"left":t=R(e,r);break;case"right":t=O(e,r)}return t&&i.delete(n),i.has(n)}return!1}static isCollWithLock(t,e,r,n={}){const o=P._preElem(t,"isCollWithLock"),i=P._preElem(e,"isCollWithLock"),s=P._getCustomRect(o.getBoundingClientRect(),n),a=i.getBoundingClientRect(),u=C(s,a);return P._isCollWithLock(u,s,a,o,r)}isCollWithLock(t,e,r){return P.isCollWithLock(this,t,e,r)}static isCollPerfWithLock(t,e,r,n={}){const o=P._preElem(t,"isCollPerfWithLock"),i=P._preElem(e,"isCollPerfWithLock"),s=P._getCustomRect(o.getBoundingClientRect(),n),a=i.getBoundingClientRect(),u=N(s,a);return P._isCollWithLock(u,s,a,o,r)}isCollPerfWithLock(t,e,r){return P.isCollPerfWithLock(this,t,e,r)}static resetCollLock(t){const e=P._preElem(t,"resetCollLock");let r=!1;for(const t of["top","bottom","left","right"])H[t].has(e)&&(H[t].delete(e),r=!0);return r}resetCollLock(){return P.resetCollLock(this)}static resetCollLockDir(t,e){const r=P._preElem(t,"resetCollLockDir"),n=H[e];return!!n.has(r)&&(n.delete(r),!0)}resetCollLockDir(t){return P.resetCollLockDir(this,t)}static isInViewport(t){const e=P._preElem(t,"isInViewport");if(!e.checkVisibility({contentVisibilityAuto:!1,opacityProperty:!1,visibilityProperty:!1}))return!1;const r=P.offset(e).top,n=r+P.outerHeight(e),o=P.scrollTop(window),i=o+P.height(window);return n>o&&r<i}isInViewport(){return P.isInViewport(this)}static isScrolledIntoView(t){const e=P._preElem(t,"isScrolledIntoView");if(!e.checkVisibility({contentVisibilityAuto:!1,opacityProperty:!1,visibilityProperty:!1}))return!1;const r=P.scrollTop(window),n=r+P.height(window),o=P.offset(e).top;return o+P.height(e)<=n&&o>=r}isScrolledIntoView(){return P.isScrolledIntoView(this)}static isInContainer(t,e){const r=P._preElem(t,"isInContainer"),n=P._preElem(e,"isInContainer");if(!r.checkVisibility({contentVisibilityAuto:!1,opacityProperty:!1,visibilityProperty:!1}))return!1;const o=r.getBoundingClientRect(),i=n.getBoundingClientRect(),s=o.bottom>i.top&&o.top<i.bottom,a=o.right>i.left&&o.left<i.right;return s&&a}isInContainer(t){return P.isInContainer(this,t)}static isFullyInContainer(t,e){const r=P._preElem(t,"isScrolledIntoView"),n=P._preElem(e,"isInContainer");if(!r.checkVisibility({contentVisibilityAuto:!1,opacityProperty:!1,visibilityProperty:!1}))return!1;const o=r.getBoundingClientRect(),i=n.getBoundingClientRect();return o.top>=i.top&&o.bottom<=i.bottom&&o.left>=i.left&&o.right<=i.right}isFullyInContainer(t){return P.isFullyInContainer(this,t)}static hasScroll(t){const e=P._preElem(t,"hasScroll");return{v:e.scrollHeight>e.clientHeight,h:e.scrollWidth>e.clientWidth}}hasScroll(){return P.hasScroll(this)}}const j=class{#E=new Map;#_=10;#T=!1;#A(t,e){if("string"==typeof t)return[t];if(Array.isArray(t)&&t.every((t=>"string"==typeof t)))return t;throw new TypeError(`${e}(event): event must be a string or string[]`)}setThrowOnMaxListeners(t){if("boolean"!=typeof t)throw new TypeError("setThrowOnMaxListeners(value): value must be a boolean");this.#T=t}getThrowOnMaxListeners(){return this.#T}#x(t,e,{once:r=!1}={}){let n=this.#E.get(t);Array.isArray(n)||(n=[],this.#E.set(t,n)),n.unshift({handler:e,config:{once:r}});const o=this.#_;if(o>0&&n.length>o){const e=`Possible memory leak detected. ${n.length} "${t}" listeners added. Use setMaxListeners() to increase limit.`;if(this.#T)throw new Error(e);console.warn(e)}}prependListener(t,e){const r=this.#A(t,"prependListener");if("function"!=typeof e)throw new TypeError("prependListener(event, handler): handler must be a function");for(const t of r)this.#x(t,e)}prependListenerOnce(t,e){const r=this.#A(t,"prependListenerOnce");if("function"!=typeof e)throw new TypeError("prependListenerOnce(event, handler): handler must be a function");const n=[];for(const t of r){const r=(...n)=>{this.off(t,r),e(...n)};this.#x(t,r,{once:!0}),n.push(r)}return n}#S(t,e,{once:r=!1}={}){const n=this.#A(t,"on");for(const t of n){let n=this.#E.get(t);Array.isArray(n)||(n=[],this.#E.set(t,n)),n.push({handler:e,config:{once:r}});const o=this.#_;if(o>0&&n.length>o){const e=`Possible memory leak detected. ${n.length} "${t}" listeners added. Use setMaxListeners() to increase limit.`;if(this.#T)throw new Error(e);console.warn(e)}}}on(t,e){if("function"!=typeof e)throw new TypeError("on(event, handler): handler must be a function");return this.#S(t,e)}once(t,e){const r=this.#A(t,"once");if("function"!=typeof e)throw new TypeError("once(event, handler): handler must be a function");const n=[];for(const t of r){const r=(...n)=>{this.off(t,r),e(...n)};this.#S(t,r,{once:!0}),n.push(r)}return n}appendListener(t,e){return this.on(t,e)}appendListenerOnce(t,e){return this.once(t,e)}off(t,e){const r=this.#A(t,"off");if("function"!=typeof e)throw new TypeError("off(event, handler): handler must be a function");for(const t of r){const r=this.#E.get(t);if(!Array.isArray(r))continue;const n=r.findIndex((t=>t.handler===e));-1!==n&&r.splice(n,1),0===r.length&&this.#E.delete(t)}}offAll(t){const e=this.#A(t,"offAll");for(const t of e)this.#E.delete(t)}offAllTypes(){this.#E.clear()}listenerCount(t){if("string"!=typeof t)throw new TypeError("listenerCount(event): event name must be a string");const e=this.#E.get(t);return Array.isArray(e)?e.length:0}listeners(t){if("string"!=typeof t)throw new TypeError("listeners(event): event name must be a string");const e=this.#E.get(t);return Array.isArray(e)?[...e].filter((t=>!t.config.once)).map((t=>t.handler)):[]}onceListeners(t){if("string"!=typeof t)throw new TypeError("onceListeners(event): event name must be a string");const e=this.#E.get(t);return Array.isArray(e)?[...e].filter((t=>t.config.once)).map((t=>t.handler)):[]}allListeners(t){if("string"!=typeof t)throw new TypeError("allListeners(event): event name must be a string");const e=this.#E.get(t);return Array.isArray(e)?[...e].map((t=>t.handler)):[]}eventNames(){return[...this.#E.keys()]}emit(t,...e){const r=this.#A(t,"emit"),n=[];for(const t of r){const r=this.#E.get(t);Array.isArray(r)&&0!==r.length?(r.forEach((t=>t.handler(...e))),n.push(!0)):n.push(!1)}return n}setMaxListeners(t){if(!Number.isInteger(t)||t<0)throw new TypeError("setMaxListeners(n): n must be a non-negative integer");this.#_=t}getMaxListeners(){return this.#_}},F=new Map,$=new Map,U=new Set(["string","boolean","object","array",String,Boolean,Number,Object,Array,BigInt,Symbol]);class z{#L=new j;setThrowOnMaxListeners(t){return this.#L.setThrowOnMaxListeners(t)}getThrowOnMaxListeners(){return this.#L.getThrowOnMaxListeners()}prependListener(t,e){return this.#L.prependListener(t,e)}prependListenerOnce(t,e){return this.#L.prependListenerOnce(t,e)}appendListener(t,e){return this.#L.appendListener(t,e)}appendListenerOnce(t,e){return this.#L.appendListenerOnce(t,e)}on(t,e){return this.#L.on(t,e)}once(t,e){return this.#L.once(t,e)}off(t,e){return this.#L.off(t,e)}offAll(t){return this.#L.offAll(t)}offAllTypes(){return this.#L.offAllTypes()}listenerCount(t){return this.#L.listenerCount(t)}listeners(t){return this.#L.listeners(t)}onceListeners(t){return this.#L.onceListeners(t)}allListeners(t){return this.#L.allListeners(t)}eventNames(){return this.#L.eventNames()}emit(t,...e){return this.#L.emit(t,...e)}setMaxListeners(t){return this.#L.setMaxListeners(t)}getMaxListeners(){return this.#L.getMaxListeners()}static hasJsonType(t){return F.has(t)&&$.has(t)||U.has(t)}static registerJsonType(t,e,r,n=!1){if(U.has(t))throw new Error(`Cannot register type "${t}" because it is frozen.`);F.set(t,e),$.set(t,r),n&&U.add(t)}static deleteJsonType(t){if(U.has(t))throw new Error(`Cannot remove type "${t}" because it is frozen.`);let e=!1;return F.delete(t)&&(e=!0),$.delete(t)&&(e=!0),e}static encodeSpecialJson(t){if(void 0===t)return{__undefined__:!0};if(null===t)return{__null__:!0};for(const[e,r]of F.entries())if("string"!=typeof e&&t instanceof e||typeof t===e)return r(t,z.encodeSpecialJson);if(Array.isArray(t))return t.map(z.encodeSpecialJson);if(i(t)){const e={};for(const r in t)e[r]=z.encodeSpecialJson(t[r]);return e}return t}static decodeSpecialJson(t){const e=i(t);if(e){if(t.__undefined__)return;if(t.__null__)return null}if(Array.isArray(t))return t.map(z.decodeSpecialJson);if(e){for(const[e,r]of $.entries())if(r.check&&r.check(t))return r.decode(t,z.decodeSpecialJson);const e={};for(const r in t)e[r]=z.decodeSpecialJson(t[r]);return e}return t}#C=window.localStorage;#N=null;#I=0;#k=t=>this.emit("storage",t);constructor(t){if(void 0!==t&&"string"!=typeof t)throw new TypeError("TinyLocalStorage: dbName must be a string if provided.");"string"==typeof t&&(this.#N=`LSDB::${t}`),window.addEventListener("storage",this.#k)}#R(t){if("string"==typeof t&&t.startsWith("LSDB::"))throw new Error(`TinyLocalStorage: Key "${t}" may conflict with reserved dbKeys.`)}updateStorageVersion(t,e){if("string"!=typeof this.#N)throw new Error("TinyLocalStorage: Database key is not initialized. Set a valid dbName in the constructor.");if("number"!=typeof t||Number.isNaN(t)||t<1)throw new TypeError("TinyLocalStorage: version must be a positive number.");if("function"!=typeof e)throw new TypeError("TinyLocalStorage: onUpgrade must be a function.");const r=parseInt(localStorage.getItem(this.#N),10)||0;if("number"!=typeof r||Number.isNaN(r)||r<0)throw new TypeError("TinyLocalStorage: saved version in localStorage is not a valid number.");if(t<r)throw new Error(`TinyLocalStorage: Cannot downgrade database version from ${r} to ${t}.`);t>r&&(e(r,t),localStorage.setItem(this.#N,String(t)),this.#I=t)}getDbKey(){return this.#N}getVersion(){return this.#I}setLocalStorage(t){if(!(t instanceof Storage))throw new TypeError("Argument must be a valid instance of Storage.");this.#C=t}localStorageExists(){return this.#C instanceof Storage}#O(t,e){if("string"!=typeof t||!t.length)throw new TypeError("Key must be a non-empty string.");return z.encodeSpecialJson(e)}setJson(t,e){if(this.#R(t),!(i(e)||Array.isArray(e)||e instanceof Map||e instanceof Set))throw new TypeError("The storage value is not a valid JSON-compatible structure.");const r=this.#O(t,e);return this.emit("setJson",t,e),this.#C.setItem(t,JSON.stringify(r))}#B(t,e){if("string"!=typeof t||!t.length)throw new TypeError("Key must be a non-empty string.");const r=this.#C.getItem(t),n={obj:()=>({}),array:()=>[],map:()=>new Map,set:()=>new Set},o="function"==typeof n[e]?n[e]():null;let i;try{i=JSON.parse(r)}catch{return o}return{decoded:z.decodeSpecialJson(i),fallback:o}}getJson(t,e){const{decoded:r,fallback:n}=this.#B(t,e);return r instanceof Map||r instanceof Set||Array.isArray(r)||i(r)?r:n}setDate(t,e){if(this.#R(t),!(e instanceof Date))throw new TypeError("Value must be a Date.");const r=this.#O(t,e);return this.emit("setDate",t,e),this.#C.setItem(t,JSON.stringify(r))}getDate(t){const e=this.#B(t).decoded;return e instanceof Date?e:null}setRegExp(t,e){if(this.#R(t),!(e instanceof RegExp))throw new TypeError("Value must be a RegExp.");const r=this.#O(t,e);return this.emit("setRegExp",t,e),this.#C.setItem(t,JSON.stringify(r))}getRegExp(t){const e=this.#B(t).decoded;return e instanceof RegExp?e:null}setBigInt(t,e){if(this.#R(t),"bigint"!=typeof e)throw new TypeError("Value must be a BigInt.");const r=this.#O(t,e);return this.emit("setBigInt",t,e),this.#C.setItem(t,JSON.stringify(r))}getBigInt(t){const e=this.#B(t).decoded;return"bigint"==typeof e?e:null}setSymbol(t,e){if(this.#R(t),"symbol"!=typeof e)throw new TypeError("Value must be a Symbol.");const r=this.#O(t,e);return this.emit("setSymbol",t,e),this.#C.setItem(t,JSON.stringify(r))}getSymbol(t){const e=this.#B(t).decoded;return"symbol"==typeof e?e:null}getValue(t){return this.#B(t).decoded??null}setItem(t,e){if(this.#R(t),"string"!=typeof t||!t.length)throw new TypeError("Key must be a non-empty string.");return this.emit("setItem",t,e),this.#C.setItem(t,e)}getItem(t){if("string"!=typeof t||!t.length)throw new TypeError("Key must be a non-empty string.");return this.#C.getItem(t)}setString(t,e){if(this.#R(t),"string"!=typeof t||!t.length)throw new TypeError("Key must be a non-empty string.");if("string"!=typeof e)throw new TypeError("Value must be a string.");return this.emit("setString",t,e),this.#C.setItem(t,JSON.stringify({__string__:!0,value:e}))}getString(t){if("string"!=typeof t||!t.length)throw new TypeError("Key must be a non-empty string.");let e=this.#C.getItem(t);try{if(e=JSON.parse(e),!i(e)||!e.__string__||"string"!=typeof e.value)return null;e=e.value}catch{e=null}return"string"==typeof e?e:null}setNumber(t,e){if(this.#R(t),"string"!=typeof t||!t.length)throw new TypeError("Key must be a non-empty string.");if("number"!=typeof e)throw new TypeError("Value must be a number.");return this.emit("setNumber",t,e),this.#C.setItem(t,String(e))}getNumber(t){if("string"!=typeof t||!t.length)throw new TypeError("Key must be a non-empty string.");let e=this.#C.getItem(t);return"number"==typeof e||"string"==typeof e&&e.length>0&&(e=parseFloat(e),!Number.isNaN(e))?e:null}setBool(t,e){if(this.#R(t),"string"!=typeof t||!t.length)throw new TypeError("Key must be a non-empty string.");if("boolean"!=typeof e)throw new TypeError("Value must be a boolean.");return this.emit("setBool",t,e),this.#C.setItem(t,String(e))}getBool(t){if("string"!=typeof t||!t.length)throw new TypeError("Key must be a non-empty string.");const e=this.#C.getItem(t);if("boolean"==typeof e)return e;if("string"==typeof e){if("true"===e)return!0;if("false"===e)return!1}return null}removeItem(t){if("string"!=typeof t||!t.length)throw new TypeError("Key must be a non-empty string.");return this.emit("removeItem",t),this.#C.removeItem(t)}clearLocalStorage(){return this.#C.clear()}destroy(){window.removeEventListener("storage",this.#k),this.#L.offAllTypes()}}z.registerJsonType(Map,((t,e)=>({__map__:!0,data:Array.from(t.entries()).map((([t,r])=>[t,e(r)]))})),{check:t=>t.__map__,decode:(t,e)=>new Map(t.data.map((([t,r])=>[t,e(r)])))},!0),z.registerJsonType(Set,((t,e)=>({__set__:!0,data:Array.from(t).map(e)})),{check:t=>t.__set__,decode:(t,e)=>new Set(t.data.map(e))},!0),z.registerJsonType(Date,(t=>({__date__:!0,value:t.toISOString()})),{check:t=>t.__date__,decode:t=>new Date(t.value)},!0),z.registerJsonType(RegExp,(t=>({__regexp__:!0,source:t.source,flags:t.flags})),{check:t=>t.__regexp__,decode:t=>new RegExp(t.source,t.flags)},!0),z.registerJsonType("number",(t=>({__number__:!0,value:t.toString()})),{check:t=>t.__number__,decode:t=>Number(t.value)},!0),z.registerJsonType("bigint",(t=>({__bigint__:!0,value:t.toString()})),{check:t=>t.__bigint__,decode:t=>BigInt(t.value)},!0),z.registerJsonType("symbol",(t=>({__symbol__:!0,key:Symbol.keyFor(t)??t.description??null})),{check:t=>t.__symbol__,decode:t=>{const e=t.key;return null!=e?Symbol.for(e):Symbol()}},!0),new WeakMap,new WeakMap,new Map,r(699),r(586);class J{static#D=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;static#M=/^#([A-Fa-f0-9]{8})$/;static#W="(0|1|0?\\.\\d+)";static#H="(0|[1-9]\\d?|1\\d{2}|2[0-4]\\d|25[0-5])";static#P="(0|[1-9]\\d?|[1-2]\\d{2}|3[0-5]\\d|360)";static#j="(0|[1-9]?\\d|100)";static#F=new RegExp(`^rgb\\(\\s*${J.#H}\\s*,\\s*${J.#H}\\s*,\\s*${J.#H}\\s*\\)$`);static#$=new RegExp(`^rgba\\(\\s*${J.#H}\\s*,\\s*${J.#H}\\s*,\\s*${J.#H}\\s*,\\s*${J.#W}\\s*\\)$`);static#U=new RegExp(`^hsl\\(\\s*${J.#P}\\s*,\\s*${J.#j}%\\s*,\\s*${J.#j}%\\s*\\)$`);static#z=new RegExp(`^hsla\\(\\s*${J.#P}\\s*,\\s*${J.#j}%\\s*,\\s*${J.#j}%\\s*,\\s*${J.#W}\\s*\\)$`);static#J=new RegExp(`^hwb\\(\\s*${J.#P}(deg|grad|rad|turn)?\\s*${J.#j}%\\s*${J.#j}%\\s*\\)$`);static#V="(-?\\d+)";static#X=new RegExp(`^lab\\(\\s*${J.#j}%?\\s*${J.#V}%?\\s*${J.#V}%?\\s*\\)$`);static#K=new RegExp(`^lch\\(\\s*${J.#j}%?\\s*${J.#j}%?\\s*${J.#P}(deg|grad|rad|turn)?\\s*\\)$`);static#q=new Set(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]);static#G=new Set(["transparent","currentColor"]);static getNames(){return Array.from(J.#q)}static addName(t){const e=J.#q.size;return J.#q.add(t.toLowerCase()),J.#q.size>e}static removeName(t){return J.#q.delete(t.toLowerCase())}static hasName(t){return J.#q.has(t.toLowerCase())}static getSpecialNames(){return Array.from(J.#G)}static addSpecialName(t){const e=J.#G.size;return J.#G.add(t),J.#G.size>e}static removeSpecialName(t){return J.#G.delete(t)}static hasSpecialName(t){return J.#G.has(t)}#Y;get code(){return this.#Y}#Q;get type(){return this.#Q}constructor(t){this.#Y=t,this.#Q=J.isColor(this.#Y)}static isHex(t){if("string"!=typeof t)throw new TypeError("isHex: input must be a string.");return J.#D.test(t.trim())}isHex(){return J.isHex(this.#Y)}static isHexa(t){if("string"!=typeof t)throw new TypeError("isHexa: input must be a string.");return J.#M.test(t.trim())}isHexa(){return J.isHexa(this.#Y)}static isRgb(t){if("string"!=typeof t)throw new TypeError("isRgb: input must be a string.");return J.#F.test(t.trim())}isRgb(){return J.isRgb(this.#Y)}static isRgba(t){if("string"!=typeof t)throw new TypeError("isRgba: input must be a string.");return J.#$.test(t.trim())}isRgba(){return J.isRgba(this.#Y)}static isHsl(t){if("string"!=typeof t)throw new TypeError("isHsl: input must be a string.");return J.#U.test(t.trim())}isHsl(){return J.isHsl(this.#Y)}static isHsla(t){if("string"!=typeof t)throw new TypeError("isHsla: input must be a string.");return J.#z.test(t.trim())}isHsla(){return J.isHsla(this.#Y)}static isHwb(t){if("string"!=typeof t)throw new TypeError("isHwb: input must be a string.");return J.#J.test(t.trim())}isHwb(){return J.isHwb(this.#Y)}static isLab(t){if("string"!=typeof t)throw new TypeError("isLab: input must be a string.");return J.#X.test(t.trim())}isLab(){return J.isLab(this.#Y)}static isLch(t){if("string"!=typeof t)throw new TypeError("isLch: input must be a string.");return J.#K.test(t.trim())}isLch(){return J.isLch(this.#Y)}static isName(t){if("string"!=typeof t)throw new TypeError("isName: input must be a string.");return J.#q.has(t.trim().toLowerCase())}isName(){return J.isName(this.#Y)}static isSpecialName(t){if("string"!=typeof t)throw new TypeError("isSpecialName: input must be a string.");return J.#G.has(t.trim())}isSpecialName(){return J.isSpecialName(this.#Y)}static isColor(t){if("string"!=typeof t)throw new TypeError("isColor: input must be a string.");return J.isHex(t)?"hex":J.isHexa(t)?"hexa":J.isRgb(t)?"rgb":J.isRgba(t)?"rgba":J.isHsl(t)?"hsl":J.isHsla(t)?"hsla":J.isHwb(t)?"hwb":J.isLab(t)?"lab":J.isLch(t)?"lch":J.isName(t)?"name":J.isSpecialName(t)?"specialName":null}parse(){switch(this.#Q){case"hex":return J.parseHex(this.code);case"hexa":return J.parseHexa(this.code);case"rgb":return J.parseRgb(this.code);case"rgba":return J.parseRgba(this.code);case"hsl":return J.parseHsl(this.code);case"hsla":return J.parseHsla(this.code);case"hwb":return J.parseHwb(this.code);case"lab":return J.parseLab(this.code);case"lch":return J.parseLch(this.code);case"name":case"specialName":return this.#Y.trim().toLowerCase();default:return null}}static parseHex(t){if("string"!=typeof t)throw new TypeError("parseHex: input must be a string.");const e=new RegExp(J.#D,"gm").exec(t.trim());return e?e[1]:null}parseHex(){return J.parseHex(this.#Y)}static parseHexa(t){if("string"!=typeof t)throw new TypeError("parseHexa: input must be a string.");const e=new RegExp(J.#M,"gm").exec(t.trim());return e?e[1]:null}parseHexa(){return J.parseHexa(this.#Y)}static parseRgb(t){if("string"!=typeof t)throw new TypeError("parseRgb: input must be a string.");const e=new RegExp(J.#F,"gm").exec(t.trim());return e?[parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3])]:null}parseRgb(){return J.parseRgb(this.#Y)}static parseRgba(t){if("string"!=typeof t)throw new TypeError("parseRgba: input must be a string.");const e=new RegExp(J.#$,"gm").exec(t.trim());return e?[parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3]),parseFloat(e[4])]:null}parseRgba(){return J.parseRgba(this.#Y)}static parseHsl(t){if("string"!=typeof t)throw new TypeError("parseHsl: input must be a string.");const e=new RegExp(J.#U,"gm").exec(t.trim());return e?[parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3])]:null}parseHsl(){return J.parseHsl(this.#Y)}static parseHsla(t){if("string"!=typeof t)throw new TypeError("parseHsla: input must be a string.");const e=new RegExp(J.#z,"gm").exec(t.trim());return e?[parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3]),parseFloat(e[4])]:null}parseHsla(){return J.parseHsla(this.#Y)}static parseHwb(t){if("string"!=typeof t)throw new TypeError("parseHwb: input must be a string.");const e=new RegExp(J.#J,"gm").exec(t.trim());return e?[parseFloat(e[1]),e[2]??null,parseFloat(e[3]),parseFloat(e[4])]:null}parseHwb(){return J.parseHwb(this.#Y)}static parseLab(t){if("string"!=typeof t)throw new TypeError("parseLab: input must be a string.");const e=new RegExp(J.#X,"gm").exec(t.trim());return e?[parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3])]:null}parseLab(){return J.parseLab(this.#Y)}static parseLch(t){if("string"!=typeof t)throw new TypeError("parseLch: input must be a string.");const e=new RegExp(J.#K,"gm").exec(t.trim());return e?[parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3]),e[4]??null]:null}parseLch(){return J.parseLch(this.#Y)}}const V=class{#Z="json_each";#tt=[];#et="";#rt="*";#nt="?";#ot=!1;#it=!0;#st=-1;#at=null;constructor(t="tags"){this.setColumnName(t)}#ut={"^":{list:"boosts",valueKey:"boost"},"~":{list:"fuzzies",valueKey:"fuzzy"}};addTagInput(t,e,r){if("string"!=typeof e||"string"!=typeof r)throw new TypeError("Both list and valueKey must be strings");if("include"===e)throw new Error('Cannot add a tag with the list name "include"');if("column"===e)throw new Error('Cannot add a tag with the list name "column"');this.#ut[t]={list:e,valueKey:r}}hasTagInput(t){if("string"!=typeof t)throw new TypeError("key must be a string");return!!this.#ut.hasOwnProperty(t)}removeTagInput(t){throw this.hasTagInput(t)&&delete this.#ut[t],new Error(`Tag input key '${t}' does not exist.`)}getTagInput(t){if("string"!=typeof t)throw new TypeError("Tag input key must be a string");if(!this.#ut[t])throw new Error(`Tag input '${t}' is missing.`);return{...this.#ut[t]}}getAllTagInput(){return Object.entries(this.#ut).map((([t,e])=>({...e})))}setCanRepeat(t){if("boolean"!=typeof t)throw new TypeError("value must be a boolean");this.#ot=!t}setWildcard(t,e){if("wildcardA"!==t&&"wildcardB"!==t)throw new Error("where must be 'wildcardA' or 'wildcardB'");if("string"!=typeof e)throw new TypeError("value must be a string");"wildcardA"===t&&(this.#rt=e),"wildcardB"===t&&(this.#nt=e)}addSpecialQuery(t){if(!i(t)||"string"!=typeof t.title)throw new TypeError('config must be an object with a string "title"');this.#tt.push(t)}hasSpecialQuery(t){if("string"!=typeof t)throw new TypeError("title must be a string");return!!this.#tt.findIndex((e=>e.title===t))}removeSpecialQuery(t){if("string"!=typeof t)throw new TypeError("title must be a string");const e=this.#tt.findIndex((e=>e.title===t));if(!(e>-1))throw new Error(`Special query with title '${t}' does not exist.`);this.#tt.splice(e,1)}getSpecialQuery(t){if("string"!=typeof t)throw new TypeError("title must be a string");const e=this.#tt.find((e=>e.title===t));if(!e)throw new Error(`No special query found with title '${t}'`);return e.parser||null}getAllSpecialQuery(){return this.#tt.map((t=>t.title))}setColumnName(t){if("string"!=typeof t)throw new TypeError("value must be a string");this.#et=t}getColumnName(){return this.#et}setParseLimit(t){if("number"!=typeof t)throw new TypeError("value must be a number");this.#st=t}getParseLimit(){return this.#st}setUseJsonEach(t){if("boolean"!=typeof t)throw new TypeError("value must be a boolean");this.#it=t}setTableName(t){if("string"!=typeof t)throw new TypeError("value must be a string");this.#at=t}setJsonEach(t){if(null!==t&&"string"!=typeof t)throw new TypeError("value must be a string");this.#Z=t}#lt=!1;setIsPgMode(t){if("boolean"!=typeof t)throw new TypeError("setIsPgMode() expects a boolean, but received: "+typeof t);this.#lt=t}getIsPgMode(){return this.#lt}parseWhere(t={},e={index:1,values:[]}){if(!i(e))throw new TypeError("Expected pCache to be a valid object, but got "+typeof e);if(!i(t))throw new TypeError("Expected group to be a valid object, but got "+typeof t);if("number"!=typeof e.index)throw new TypeError("Invalid or missing pCache.index; expected number but got "+typeof e.index);if(!Array.isArray(e.values))throw new TypeError("Invalid or missing pCache.values; expected array but got "+typeof e.values);const r=[],n=t.column||this.getColumnName(),o=t.tableName||this.#at,s="boolean"==typeof t.allowWildcards&&t.allowWildcards;if(!Array.isArray(t.include))throw new TypeError("Expected 'include' to be an array of tags or tag groups, but got "+typeof t.include);const a=t.include,u=(t,e,r=!1)=>{if(this.#lt)return`${t?"NOT (":""}${e} = ANY(${n})${t?")":""}`;{let i;if(this.#it)i=`${this.#Z}(${n}) WHERE value ${r?"LIKE":"="} ${e}`;else{if("string"!=typeof o||""===o.trim())throw new Error("Missing or invalid 'tagsTable'. Expected a non-empty string when using SQLite mode without json_each.");i=`${n} WHERE ${o}.${n} ${r?"LIKE":"="} ${e}`}return`${t?"NOT ":""}EXISTS (SELECT 1 FROM ${i})`}},l=t=>{if("string"!=typeof t)throw new TypeError("Each tag must be a string, but received: "+typeof t);const r=t.startsWith("!"),n=r?t.slice(1):t;if("number"!=typeof e.index)throw new Error("Invalid pCache index");const o="$"+e.index++,i=s&&(n.includes(this.#rt)||n.includes(this.#nt)),a=i?n.replace(/([%_])/g,"\\$1").replaceAll(this.#rt,"%").replaceAll(this.#nt,"_"):n;if(!Array.isArray(e.values))throw new Error("Invalid pCache values");return e.values.push(a),{param:o,usesWildcard:i,not:r}};for(const t of a)if(Array.isArray(t)){const e=t.map((t=>{const{param:e,usesWildcard:r,not:n}=l(t);return u(n,e,r)}));e.length&&r.push(`(${e.join(" OR ")})`)}else{const{param:e,usesWildcard:n,not:o}=l(t);r.push(u(o,e,n))}return r.length?`(${r.join(" AND ")})`:"1"}parseWhereFlat(t={},e={index:1,values:[]}){if(!i(e))throw new TypeError("Expected pCache to be a valid object, but got "+typeof e);if(!i(t))throw new TypeError("Expected group to be a valid object, but got "+typeof t);if("number"!=typeof e.index)throw new TypeError("Invalid or missing pCache.index; expected number");if(!Array.isArray(e.values))throw new TypeError("Invalid or missing pCache.values; expected array");const r=[],n=t.column||"tag",o="boolean"==typeof t.allowWildcards&&t.allowWildcards,s=Array.isArray(t.include)?t.include:[],a=t=>{if("string"!=typeof t)throw new TypeError("Each tag must be a string, but received: "+typeof t);const r=t.startsWith("!"),n=r?t.slice(1):t;if("number"!=typeof e.index)throw new Error("Invalid pCache index");const i="$"+e.index++,s=o&&(n.includes(this.#rt)||n.includes(this.#nt)),a=s?n.replace(/([%_])/g,"\\$1").replaceAll(this.#rt,"%").replaceAll(this.#nt,"_"):n;if(!Array.isArray(e.values))throw new Error("Invalid pCache values");return e.values.push(a),{param:i,usesWildcard:s,not:r}},u=t=>{const{param:e,usesWildcard:r,not:o}=t;return`${n} ${o?"!=":r?"LIKE":"="} ${e}`};for(const t of s)if(Array.isArray(t)){const e=t.map((t=>u(a(t))));e.length&&r.push(`(${e.join(" OR ")})`)}else r.push(u(a(t)));return r.length?`(${r.join(" AND ")})`:"1"}#ct(t){const e=[],r={},n={};for(const t in this.#ut){const{list:e}=this.#ut[t];r[e]=[],n[e]=new Set}const o=new Set;for(let i=t.length-1;i>=0;i--){const s=t[i],a=Array.isArray(s)?s:[s],u=[];for(const t of a){let i=!1;for(const e in this.#ut)if(t.includes(e)){const{list:a,valueKey:l}=this.#ut[e],[c,f]=t.split(e);let p=parseFloat(f.replace(/\!/g,"-"));Number.isNaN(p)&&(p=1),n[a].has(c.trim())||(r[a].push({term:c.trim(),[l]:p}),n[a].add(c.trim())),this.#ot&&!Array.isArray(s)&&o.has(c.trim())||(u.push(c.trim()),Array.isArray(s)||o.add(c.trim())),i=!0;break}if(!i)if(t.includes(":")){const[r,...n]=t.split(":"),o=n.join(":"),i=this.#tt.find((t=>t.title===r));if(i&&void 0!==o){let t=o;"function"==typeof i.parser&&(t=i.parser(o)),e.push({key:r,value:t})}else u.push(t)}else this.#ot&&!Array.isArray(s)&&o.has(t)||(u.push(t),Array.isArray(s)||o.add(t))}0===u.length?t.splice(i,1):t[i]=Array.isArray(s)?u:u[0]}return{specials:e,...r}}parseString(t,r=!1,n={}){if("string"!=typeof t)throw new TypeError("Expected input to be a string, but received "+typeof t);const o=e.defaults(n,{emptyInput:!0,parseLimit:!0,openParens:!0,quoteChar:!0});if(t=t.replace(/\s+/g," ").trim(),r&&o.emptyInput&&!t.length)throw new Error("Input string is empty after trimming");const i=[];let s=[],a="",u=!1,l="";const c=new Set;let f=!1,p=0,h=0;const g=()=>{const t=a.trim();if(t){if(this.#st<0||h<this.#st)this.#ot&&!f&&c.has(t)||(s.push(t),f||c.add(t),h++);else if(r&&o.parseLimit)throw new Error(`Exceeded tag parse limit of ${this.#st}`);a=""}},d=()=>{1===s.length?i.push(s[0]):s.length>1&&i.push([...s]),s=[]};for(let e=0;e<t.length;e++){const n=t[e],i=t.slice(e,e+4).toUpperCase(),c=t.slice(e,e+3).toUpperCase();if(u)n===l?(u=!1,l=""):a+=n;else if('"'!==n&&"'"!==n)if("("!==n)if(")"!==n)" AND"!==i?"OR "!==c?a+=n:(g(),e+=2):(g(),d(),e+=3);else{if(r&&o.openParens&&p<=0)throw new SyntaxError(`Unexpected closing parenthesis at position ${e}`);p--,g(),d(),f=!1}else p++,g(),s=[],f=!0;else u=!0,l=n}if(r){if(o.quoteChar&&u)throw new SyntaxError(`Unclosed quote starting with ${l}`);if(o.openParens&&p>0)throw new SyntaxError(`Unclosed parenthesis — ${p} more ')' expected`)}g(),d();const m=this.#ct(i);return{column:this.getColumnName(),include:i,...m}}safeParseString(t,e=!1,r={}){return this.parseString(t.split(",").map((t=>t.trim())).join(" AND ").replace(/(?:^|[\s(,])-(?=\w)/g,(t=>t.replace("-","!"))).replace(/\s*\bNOT\b\s*/g,"!").replace(/\&\&/g,"AND").replace(/\|\|/g,"OR"),e,r)}}})(),window.PuddySqlTags=n.PuddySqlTags})();