UNPKG

neos-js

Version:

A NEOS-Server client for Node.js and Browsers

1 lines 52.4 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).NEOS=e()}(this,(function(){"use strict";var t="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e=[],r=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,i=!1;function o(){i=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=t.length;n<o;++n)e[n]=t[n],r[t.charCodeAt(n)]=n;r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63}function s(t,r,n){for(var i,o,s=[],a=r;a<n;a+=3)i=(t[a]<<16)+(t[a+1]<<8)+t[a+2],s.push(e[(o=i)>>18&63]+e[o>>12&63]+e[o>>6&63]+e[63&o]);return s.join("")}function a(t){var r;i||o();for(var n=t.length,a=n%3,u="",l=[],f=16383,c=0,h=n-a;c<h;c+=f)l.push(s(t,c,c+f>h?h:c+f));return 1===a?(r=t[n-1],u+=e[r>>2],u+=e[r<<4&63],u+="=="):2===a&&(r=(t[n-2]<<8)+t[n-1],u+=e[r>>10],u+=e[r>>4&63],u+=e[r<<2&63],u+="="),l.push(u),l.join("")}function u(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,l=u>>1,f=-7,c=r?i-1:0,h=r?-1:1,p=t[e+c];for(c+=h,o=p&(1<<-f)-1,p>>=-f,f+=a;f>0;o=256*o+t[e+c],c+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+t[e+c],c+=h,f-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=l}return(p?-1:1)*s*Math.pow(2,o-n)}function l(t,e,r,n,i,o){var s,a,u,l=8*o-i-1,f=(1<<l)-1,c=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-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=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+c>=1?h/u:h*Math.pow(2,1-c))*u>=2&&(s++,u/=2),s+c>=f?(a=0,s=f):s+c>=1?(a=(e*u-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=g,a/=256,i-=8);for(s=s<<i|a,l+=i;l>0;t[r+p]=255&s,p+=g,s/=256,l-=8);t[r+p-g]|=128*d}var f={}.toString,c=Array.isArray||function(t){return"[object Array]"==f.call(t)};function h(){return g.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function p(t,e){if(h()<e)throw new RangeError("Invalid typed array length");return g.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=g.prototype:(null===t&&(t=new g(e)),t.length=e),t}function g(t,e,r){if(!(g.TYPED_ARRAY_SUPPORT||this instanceof g))return new g(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return b(this,t)}return d(this,t,e,r)}function d(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);g.TYPED_ARRAY_SUPPORT?(t=e).__proto__=g.prototype:t=m(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!g.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|A(e,r),i=(t=p(t,n)).write(e,r);i!==n&&(t=t.slice(0,i));return t}(t,e,r):function(t,e){if(w(e)){var r=0|v(e.length);return 0===(t=p(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?p(t,0):m(t,e);if("Buffer"===e.type&&c(e.data))return m(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function y(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function b(t,e){if(y(e),t=p(t,e<0?0:0|v(e)),!g.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function m(t,e){var r=e.length<0?0:0|v(e.length);t=p(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function v(t){if(t>=h())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+h().toString(16)+" bytes");return 0|t}function w(t){return!(null==t||!t._isBuffer)}function A(t,e){if(w(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Z(t).length;default:if(n)return q(t).length;e=(""+e).toLowerCase(),n=!0}}function E(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 M(this,e,r);case"utf8":case"utf-8":return D(this,e,r);case"ascii":return F(this,e,r);case"latin1":case"binary":return B(this,e,r);case"base64":return _(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function N(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function O(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=g.from(e,n)),w(e))return 0===e.length?-1:T(t,e,r,n,i);if("number"==typeof e)return e&=255,g.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):T(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function T(t,e,r,n,i){var o,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(i){var f=-1;for(o=r;o<a;o++)if(l(t,o)===l(e,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===u)return f*s}else-1!==f&&(o-=o-f),f=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var c=!0,h=0;h<u;h++)if(l(t,o+h)!==l(e,h)){c=!1;break}if(c)return o}return-1}function x(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[r+s]=a}return s}function P(t,e,r,n){return G(q(e,t.length-r),t,r,n)}function C(t,e,r,n){return G(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function S(t,e,r,n){return C(t,e,r,n)}function j(t,e,r,n){return G(Z(e),t,r,n)}function R(t,e,r,n){return G(function(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)n=(r=t.charCodeAt(s))>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function _(t,e,r){return 0===e&&r===t.length?a(t):a(t.slice(e,r))}function D(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,a,u,l=t[i],f=null,c=l>239?4:l>223?3:l>191?2:1;if(i+c<=r)switch(c){case 1:l<128&&(f=l);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&l)<<6|63&o)>127&&(f=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&l)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(f=u)}null===f?(f=65533,c=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=c}return function(t){var e=t.length;if(e<=I)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=I));return r}(n)}g.TYPED_ARRAY_SUPPORT=void 0===t.TYPED_ARRAY_SUPPORT||t.TYPED_ARRAY_SUPPORT,g.poolSize=8192,g._augment=function(t){return t.__proto__=g.prototype,t},g.from=function(t,e,r){return d(null,t,e,r)},g.TYPED_ARRAY_SUPPORT&&(g.prototype.__proto__=Uint8Array.prototype,g.__proto__=Uint8Array),g.alloc=function(t,e,r){return function(t,e,r,n){return y(e),e<=0?p(t,e):void 0!==r?"string"==typeof n?p(t,e).fill(r,n):p(t,e).fill(r):p(t,e)}(null,t,e,r)},g.allocUnsafe=function(t){return b(null,t)},g.allocUnsafeSlow=function(t){return b(null,t)},g.isBuffer=function(t){return null!=t&&(!!t._isBuffer||Q(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&Q(t.slice(0,0))}(t))},g.compare=function(t,e){if(!w(t)||!w(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},g.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}},g.concat=function(t,e){if(!c(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return g.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=g.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(!w(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},g.byteLength=A,g.prototype._isBuffer=!0,g.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)N(this,e,e+1);return this},g.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)N(this,e,e+3),N(this,e+1,e+2);return this},g.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)N(this,e,e+7),N(this,e+1,e+6),N(this,e+2,e+5),N(this,e+3,e+4);return this},g.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?D(this,0,t):E.apply(this,arguments)},g.prototype.equals=function(t){if(!w(t))throw new TypeError("Argument must be a Buffer");return this===t||0===g.compare(this,t)},g.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),"<Buffer "+t+">"},g.prototype.compare=function(t,e,r,n,i){if(!w(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),u=this.slice(n,i),l=t.slice(e,r),f=0;f<a;++f)if(u[f]!==l[f]){o=u[f],s=l[f];break}return o<s?-1:s<o?1:0},g.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},g.prototype.indexOf=function(t,e,r){return O(this,t,e,r,!0)},g.prototype.lastIndexOf=function(t,e,r){return O(this,t,e,r,!1)},g.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 i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return x(this,t,e,r);case"utf8":case"utf-8":return P(this,t,e,r);case"ascii":return C(this,t,e,r);case"latin1":case"binary":return S(this,t,e,r);case"base64":return j(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},g.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function F(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function B(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function M(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=H(t[o]);return i}function U(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function k(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 Y(t,e,r,n,i,o){if(!w(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function V(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function L(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function J(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function z(t,e,r,n,i){return i||J(t,0,r,4),l(t,e,r,n,23,4),r+4}function $(t,e,r,n,i){return i||J(t,0,r,8),l(t,e,r,n,52,8),r+8}g.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),g.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=g.prototype;else{var i=e-t;r=new g(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+t]}return r},g.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||k(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},g.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||k(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},g.prototype.readUInt8=function(t,e){return e||k(t,1,this.length),this[t]},g.prototype.readUInt16LE=function(t,e){return e||k(t,2,this.length),this[t]|this[t+1]<<8},g.prototype.readUInt16BE=function(t,e){return e||k(t,2,this.length),this[t]<<8|this[t+1]},g.prototype.readUInt32LE=function(t,e){return e||k(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},g.prototype.readUInt32BE=function(t,e){return e||k(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},g.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||k(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},g.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||k(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},g.prototype.readInt8=function(t,e){return e||k(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},g.prototype.readInt16LE=function(t,e){e||k(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},g.prototype.readInt16BE=function(t,e){e||k(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},g.prototype.readInt32LE=function(t,e){return e||k(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},g.prototype.readInt32BE=function(t,e){return e||k(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},g.prototype.readFloatLE=function(t,e){return e||k(t,4,this.length),u(this,t,!0,23,4)},g.prototype.readFloatBE=function(t,e){return e||k(t,4,this.length),u(this,t,!1,23,4)},g.prototype.readDoubleLE=function(t,e){return e||k(t,8,this.length),u(this,t,!0,52,8)},g.prototype.readDoubleBE=function(t,e){return e||k(t,8,this.length),u(this,t,!1,52,8)},g.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||Y(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},g.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||Y(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},g.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,1,255,0),g.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},g.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,2,65535,0),g.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):V(this,t,e,!0),e+2},g.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,2,65535,0),g.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):V(this,t,e,!1),e+2},g.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,4,4294967295,0),g.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):L(this,t,e,!0),e+4},g.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,4,4294967295,0),g.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):L(this,t,e,!1),e+4},g.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);Y(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},g.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);Y(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},g.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,1,127,-128),g.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},g.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,2,32767,-32768),g.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):V(this,t,e,!0),e+2},g.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,2,32767,-32768),g.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):V(this,t,e,!1),e+2},g.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,4,2147483647,-2147483648),g.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):L(this,t,e,!0),e+4},g.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),g.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):L(this,t,e,!1),e+4},g.prototype.writeFloatLE=function(t,e,r){return z(this,t,e,!0,r)},g.prototype.writeFloatBE=function(t,e,r){return z(this,t,e,!1,r)},g.prototype.writeDoubleLE=function(t,e,r){return $(this,t,e,!0,r)},g.prototype.writeDoubleBE=function(t,e,r){return $(this,t,e,!1,r)},g.prototype.copy=function(t,e,r,n){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("sourceStart out of bounds");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 i,o=n-r;if(this===t&&r<e&&e<n)for(i=o-1;i>=0;--i)t[i+e]=this[i+r];else if(o<1e3||!g.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},g.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),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!g.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var s=w(t)?t:q(new g(t,n).toString()),a=s.length;for(o=0;o<r-e;++o)this[o+e]=s[o%a]}return this};var X=/[^+\/0-9A-Za-z-_]/g;function H(t){return t<16?"0"+t.toString(16):t.toString(16)}function q(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.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;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Z(t){return function(t){var e,s,a,u,l,f;i||o();var c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");l="="===t[c-2]?2:"="===t[c-1]?1:0,f=new n(3*c/4-l),a=l>0?c-4:c;var h=0;for(e=0,s=0;e<a;e+=4,s+=3)u=r[t.charCodeAt(e)]<<18|r[t.charCodeAt(e+1)]<<12|r[t.charCodeAt(e+2)]<<6|r[t.charCodeAt(e+3)],f[h++]=u>>16&255,f[h++]=u>>8&255,f[h++]=255&u;return 2===l?(u=r[t.charCodeAt(e)]<<2|r[t.charCodeAt(e+1)]>>4,f[h++]=255&u):1===l&&(u=r[t.charCodeAt(e)]<<10|r[t.charCodeAt(e+1)]<<4|r[t.charCodeAt(e+2)]>>2,f[h++]=u>>8&255,f[h++]=255&u),f}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(X,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function G(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Q(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}var W="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function K(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}var tt=function(t){return t instanceof g},et=K((function(t){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}})),rt=K((function(t){try{var e=nt;if("function"!=typeof e.inherits)throw"";t.exports=e.inherits}catch(e){t.exports=et}})),nt=K((function(t,e){var r=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},n=/%[sdj%]/g;e.format=function(t){if(!y(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(s(arguments[r]));return e.join(" ")}r=1;for(var i=arguments,o=i.length,a=String(t).replace(n,(function(t){if("%%"===t)return"%";if(r>=o)return t;switch(t){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(t){return"[Circular]"}default:return t}})),u=i[r];r<o;u=i[++r])g(u)||!v(u)?a+=" "+u:a+=" "+s(u);return a},e.deprecate=function(t,r){if(b(W.process))return function(){return e.deprecate(t,r).apply(this,arguments)};if(!0===process.noDeprecation)return t;var n=!1;return function(){if(!n){if(process.throwDeprecation)throw new Error(r);process.traceDeprecation?console.trace(r):console.error(r),n=!0}return t.apply(this,arguments)}};var i,o={};function s(t,r){var n={seen:[],stylize:u};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&e._extend(n,r),b(n.showHidden)&&(n.showHidden=!1),b(n.depth)&&(n.depth=2),b(n.colors)&&(n.colors=!1),b(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=a),l(n,t,n.depth)}function a(t,e){var r=s.styles[e];return r?"["+s.colors[r][0]+"m"+t+"["+s.colors[r][1]+"m":t}function u(t,e){return t}function l(t,r,n){if(t.customInspect&&r&&E(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return y(i)||(i=l(t,i,n)),i}var o=function(t,e){if(b(e))return t.stylize("undefined","undefined");if(y(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(d(e))return t.stylize(""+e,"number");if(p(e))return t.stylize(""+e,"boolean");if(g(e))return t.stylize("null","null")}(t,r);if(o)return o;var s=Object.keys(r),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),A(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return f(r);if(0===s.length){if(E(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(m(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(w(r))return t.stylize(Date.prototype.toString.call(r),"date");if(A(r))return f(r)}var v,N="",O=!1,T=["{","}"];(h(r)&&(O=!0,T=["[","]"]),E(r))&&(N=" [Function"+(r.name?": "+r.name:"")+"]");return m(r)&&(N=" "+RegExp.prototype.toString.call(r)),w(r)&&(N=" "+Date.prototype.toUTCString.call(r)),A(r)&&(N=" "+f(r)),0!==s.length||O&&0!=r.length?n<0?m(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),v=O?function(t,e,r,n,i){for(var o=[],s=0,a=e.length;s<a;++s)P(e,String(s))?o.push(c(t,e,r,n,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(c(t,e,r,n,i,!0))})),o}(t,r,n,a,s):s.map((function(e){return c(t,r,n,a,e,O)})),t.seen.pop(),function(t,e,r){if(t.reduce((function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(v,N,T)):T[0]+N+T[1]}function f(t){return"["+Error.prototype.toString.call(t)+"]"}function c(t,e,r,n,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),P(n,i)||(s="["+i+"]"),a||(t.seen.indexOf(u.value)<0?(a=g(r)?l(t,u.value,null):l(t,u.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),b(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function h(t){return Array.isArray(t)}function p(t){return"boolean"==typeof t}function g(t){return null===t}function d(t){return"number"==typeof t}function y(t){return"string"==typeof t}function b(t){return void 0===t}function m(t){return v(t)&&"[object RegExp]"===N(t)}function v(t){return"object"==typeof t&&null!==t}function w(t){return v(t)&&"[object Date]"===N(t)}function A(t){return v(t)&&("[object Error]"===N(t)||t instanceof Error)}function E(t){return"function"==typeof t}function N(t){return Object.prototype.toString.call(t)}function O(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(b(i)&&(i=process.env.NODE_DEBUG||""),t=t.toUpperCase(),!o[t])if(new RegExp("\\b"+t+"\\b","i").test(i)){var r=process.pid;o[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else o[t]=function(){};return o[t]},e.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=h,e.isBoolean=p,e.isNull=g,e.isNullOrUndefined=function(t){return null==t},e.isNumber=d,e.isString=y,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=b,e.isRegExp=m,e.isObject=v,e.isDate=w,e.isError=A,e.isFunction=E,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=tt;var T=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function x(){var t=new Date,e=[O(t.getHours()),O(t.getMinutes()),O(t.getSeconds())].join(":");return[t.getDate(),T[t.getMonth()],e].join(" ")}function P(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",x(),e.format.apply(e,arguments))},e.inherits=rt,e._extend=function(t,e){if(!e||!v(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var C="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function S(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(C&&t[C]){var e;if("function"!=typeof(e=t[C]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,C,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(t,n){t?r(t):e(n)}));try{t.apply(this,i)}catch(t){r(t)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),C&&Object.defineProperty(e,C,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,r(t))},e.promisify.custom=C,e.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function e(){for(var e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);var n=e.pop();if("function"!=typeof n)throw new TypeError("The last argument must be of type Function");var i=this,o=function(){return n.apply(i,arguments)};t.apply(this,e).then((function(t){process.nextTick(o,null,t)}),(function(t){process.nextTick(S,t,o)}))}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,r(t)),e}})),it={attributes_key:!1,header:!1},ot=function t(e,r){r?Object.keys(it).forEach((function(t){void 0===r[t]&&(r[t]=it[t])})):r=it;var n=r.header?'<?xml version="1.0" encoding="UTF-8"?>':"";if(r.header=!1,e instanceof Array)e.forEach((function(e){n+=t(e,r)}));else{if("object"!=typeof e)return e.toString().match(/^<\!\[CDATA\[.*\]\]>$/)?e.toString():e.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");Object.keys(e).forEach((function(i){if(i!==r.attributes_key){var o=e[i],s="";null==o&&(o=""),r.attributes_key&&e[r.attributes_key]&&Object.keys(e[r.attributes_key]).forEach((function(t){s+=nt.format(' %s="%s"',t,e[r.attributes_key][t])}));var a=t(o,r);n+=a?nt.format("<%s%s>%s</%s>",i,s,t(o,r),i):nt.format("<%s%s/>",i,s)}}))}return n},st=K((function(t,e){const r=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n="["+r+"][:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",i=new RegExp("^"+n+"$");e.isExist=function(t){return void 0!==t},e.isEmptyObject=function(t){return 0===Object.keys(t).length},e.merge=function(t,e,r){if(e){const n=Object.keys(e),i=n.length;for(let o=0;o<i;o++)t[n[o]]="strict"===r?[e[n[o]]]:e[n[o]]}},e.getValue=function(t){return e.isExist(t)?t:""},e.buildOptions=function(t,e,r){var n={};if(!t)return e;for(let i=0;i<r.length;i++)void 0!==t[r[i]]?n[r[i]]=t[r[i]]:n[r[i]]=e[r[i]];return n},e.isName=function(t){const e=i.exec(t);return!(null==e)},e.getAllMatches=function(t,e){const r=[];let n=e.exec(t);for(;n;){const i=[],o=n.length;for(let t=0;t<o;t++)i.push(n[t]);r.push(i),n=e.exec(t)}return r},e.nameRegexp=n}));const at=function(t,e){const r={};if(!(t.child&&!st.isEmptyObject(t.child)||t.attrsMap&&!st.isEmptyObject(t.attrsMap)))return st.isExist(t.val)?t.val:"";st.isExist(t.val)&&("string"!=typeof t.val||""!==t.val&&t.val!==e.cdataPositionChar)&&("strict"===e.arrayMode?r[e.textNodeName]=[t.val]:r[e.textNodeName]=t.val),st.merge(r,t.attrsMap,e.arrayMode);const n=Object.keys(t.child);for(let s=0;s<n.length;s++){var i=n[s];if(t.child[i]&&t.child[i].length>1)for(var o in r[i]=[],t.child[i])r[i].push(at(t.child[i][o],e));else if(!0===e.arrayMode){const n=at(t.child[i][0],e);r[i]="object"==typeof n?[n]:n}else"strict"===e.arrayMode?r[i]=[at(t.child[i][0],e)]:r[i]=at(t.child[i][0],e)}return r};var ut={convertToJson:at},lt=function(t,e,r){this.tagname=t,this.parent=e,this.child={},this.attrsMap={},this.val=r,this.addChild=function(t){Array.isArray(this.child[t.tagname])?this.child[t.tagname].push(t):this.child[t.tagname]=[t]}};const ft=st.buildOptions;"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,st.nameRegexp);!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const ct={attributeNamePrefix:"@_",attrNodeName:!1,textNodeName:"#text",ignoreAttributes:!0,ignoreNameSpace:!1,allowBooleanAttributes:!1,parseNodeValue:!0,parseAttributeValue:!1,arrayMode:!1,trimValues:!0,cdataTagName:!1,cdataPositionChar:"\\c",tagValueProcessor:function(t,e){return t},attrValueProcessor:function(t,e){return t},stopNodes:[]};var ht=ct;const pt=["attributeNamePrefix","attrNodeName","textNodeName","ignoreAttributes","ignoreNameSpace","allowBooleanAttributes","parseNodeValue","parseAttributeValue","arrayMode","trimValues","cdataTagName","cdataPositionChar","tagValueProcessor","attrValueProcessor","parseTrueNumberOnly","stopNodes"];var gt=pt;function dt(t,e,r){return e&&(r.trimValues&&(e=e.trim()),e=bt(e=r.tagValueProcessor(e,t),r.parseNodeValue,r.parseTrueNumberOnly)),e}function yt(t,e){if(e.ignoreNameSpace){const e=t.split(":"),r="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=r+e[1])}return t}function bt(t,e,r){if(e&&"string"==typeof t){let e;return""===t.trim()||isNaN(t)?e="true"===t||"false"!==t&&t:(-1!==t.indexOf("0x")?e=Number.parseInt(t,16):-1!==t.indexOf(".")?(e=Number.parseFloat(t),t=t.replace(/\.?0+$/,"")):e=Number.parseInt(t,10),r&&(e=String(e)===t?e:t)),e}return st.isExist(t)?t:""}const mt=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])(.*?)\\3)?","g");function vt(t,e){if(!e.ignoreAttributes&&"string"==typeof t){t=t.replace(/\r?\n/g," ");const r=st.getAllMatches(t,mt),n=r.length,i={};for(let t=0;t<n;t++){const n=yt(r[t][1],e);n.length&&(void 0!==r[t][4]?(e.trimValues&&(r[t][4]=r[t][4].trim()),r[t][4]=e.attrValueProcessor(r[t][4],n),i[e.attributeNamePrefix+n]=bt(r[t][4],e.parseAttributeValue,e.parseTrueNumberOnly)):e.allowBooleanAttributes&&(i[e.attributeNamePrefix+n]=!0))}if(!Object.keys(i).length)return;if(e.attrNodeName){const t={};return t[e.attrNodeName]=i,t}return i}}function wt(t,e){let r,n="";for(let i=e;i<t.length;i++){let e=t[i];if(r)e===r&&(r="");else if('"'===e||"'"===e)r=e;else{if(">"===e)return{data:n,index:i};"\t"===e&&(e=" ")}n+=e}}function At(t,e,r,n){const i=t.indexOf(e,r);if(-1===i)throw new Error(n);return i+e.length-1}var Et={defaultOptions:ht,props:gt,getTraversalObj:function(t,e){t=t.replace(/(\r\n)|\n/," "),e=ft(e,ct,pt);const r=new lt("!xml");let n=r,i="";for(let r=0;r<t.length;r++){if("<"===t[r])if("/"===t[r+1]){const o=At(t,">",r,"Closing Tag is not closed.");let s=t.substring(r+2,o).trim();if(e.ignoreNameSpace){const t=s.indexOf(":");-1!==t&&(s=s.substr(t+1))}n&&(n.val?n.val=st.getValue(n.val)+""+dt(s,i,e):n.val=dt(s,i,e)),e.stopNodes.length&&e.stopNodes.includes(n.tagname)&&(n.child=[],null==n.attrsMap&&(n.attrsMap={}),n.val=t.substr(n.startIndex+1,r-n.startIndex-1)),n=n.parent,i="",r=o}else if("?"===t[r+1])r=At(t,"?>",r,"Pi Tag is not closed.");else if("!--"===t.substr(r+1,3))r=At(t,"--\x3e",r,"Comment is not closed.");else if("!D"===t.substr(r+1,2)){const e=At(t,">",r,"DOCTYPE is not closed.");r=t.substring(r,e).indexOf("[")>=0?t.indexOf("]>",r)+1:e}else if("!["===t.substr(r+1,2)){const o=At(t,"]]>",r,"CDATA is not closed.")-2,s=t.substring(r+9,o);if(i&&(n.val=st.getValue(n.val)+""+dt(n.tagname,i,e),i=""),e.cdataTagName){const t=new lt(e.cdataTagName,n,s);n.addChild(t),n.val=st.getValue(n.val)+e.cdataPositionChar,s&&(t.val=s)}else n.val=(n.val||"")+(s||"");r=o+2}else{const o=wt(t,r+1);let s=o.data;const a=o.index,u=s.indexOf(" ");let l=s;if(-1!==u&&(l=s.substr(0,u).trimRight(),s=s.substr(u+1)),e.ignoreNameSpace){const t=l.indexOf(":");-1!==t&&(l=l.substr(t+1))}if(n&&i&&"!xml"!==n.tagname&&(n.val=st.getValue(n.val)+""+dt(n.tagname,i,e)),s.length>0&&s.lastIndexOf("/")===s.length-1){"/"===l[l.length-1]?(l=l.substr(0,l.length-1),s=l):s=s.substr(0,s.length-1);const t=new lt(l,n,"");l!==s&&(t.attrsMap=vt(s,e)),n.addChild(t)}else{const t=new lt(l,n);e.stopNodes.length&&e.stopNodes.includes(t.tagname)&&(t.startIndex=a),l!==s&&(t.attrsMap=vt(s,e)),n.addChild(t),n=t}i="",r=a}else i+=t[r]}return r}};const Nt={allowBooleanAttributes:!1},Ot=["allowBooleanAttributes"];function Tt(t,e){for(var r=e;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{var n=t.substr(r,e-r);if(e>5&&"xml"===n)return Rt("InvalidXml","XML declaration allowed only at the start of the document.",Dt(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function xt(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let r=1;for(e+=8;e<t.length;e++)if("<"===t[e])r++;else if(">"===t[e]&&(r--,0===r))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}function Pt(t,e){let r="",n="",i=!1;for(;e<t.length;e++){if('"'===t[e]||"'"===t[e])if(""===n)n=t[e];else{if(n!==t[e])continue;n=""}else if(">"===t[e]&&""===n){i=!0;break}r+=t[e]}return""===n&&{value:r,index:e,tagClosed:i}}const Ct=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function St(t,e){const r=st.getAllMatches(t,Ct),n={};for(let i=0;i<r.length;i++){if(0===r[i][1].length)return Rt("InvalidAttr","Attribute '"+r[i][2]+"' has no space in starting.",It(t,r[i][0]));if(void 0===r[i][3]&&!e.allowBooleanAttributes)return Rt("InvalidAttr","boolean attribute '"+r[i][2]+"' is not allowed.",It(t,r[i][0]));const o=r[i][2];if(!_t(o))return Rt("InvalidAttr","Attribute '"+o+"' is an invalid name.",It(t,r[i][0]));if(n.hasOwnProperty(o))return Rt("InvalidAttr","Attribute '"+o+"' is repeated.",It(t,r[i][0]));n[o]=1}return!0}function jt(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){let r=/\d/;for("x"===t[e]&&(e++,r=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(r))break}return-1}(t,++e);let r=0;for(;e<t.length;e++,r++)if(!(t[e].match(/\w/)&&r<20)){if(";"===t[e])break;return-1}return e}function Rt(t,e,r){return{err:{code:t,msg:e,line:r}}}function _t(t){return st.isName(t)}function Dt(t,e){return t.substring(0,e).split(/\r?\n/).length}function It(t,e){return t.indexOf(e)+e.length}var Ft=function(t,e){e=st.buildOptions(e,Nt,Ot);const r=[];let n=!1,i=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let s=0;s<t.length;s++){if("<"!==t[s]){if(" "===t[s]||"\t"===t[s]||"\n"===t[s]||"\r"===t[s])continue;return Rt("InvalidChar","char '"+t[s]+"' is not expected.",Dt(t,s))}if(s++,"?"===t[s]){if(s=Tt(t,++s),s.err)return s}else{if("!"===t[s]){s=xt(t,s);continue}{let a=!1;"/"===t[s]&&(a=!0,s++);let u="";for(;s<t.length&&">"!==t[s]&&" "!==t[s]&&"\t"!==t[s]&&"\n"!==t[s]&&"\r"!==t[s];s++)u+=t[s];if(u=u.trim(),"/"===u[u.length-1]&&(u=u.substring(0,u.length-1),s--),o=u,!st.isName(o)){let e;return e=0===u.trim().length?"There is an unnecessary space between tag name and backward slash '</ ..'.":"Tag '"+u+"' is an invalid name.",Rt("InvalidTag",e,Dt(t,s))}const l=Pt(t,s);if(!1===l)return Rt("InvalidAttr","Attributes for '"+u+"' have open quote.",Dt(t,s));let f=l.value;if(s=l.index,"/"===f[f.length-1]){f=f.substring(0,f.length-1);const r=St(f,e);if(!0!==r)return Rt(r.err.code,r.err.msg,Dt(t,s-f.length+r.err.line));n=!0}else if(a){if(!l.tagClosed)return Rt("InvalidTag","Closing tag '"+u+"' doesn't have proper closing.",Dt(t,s));if(f.trim().length>0)return Rt("InvalidTag","Closing tag '"+u+"' can't have attributes or invalid starting.",Dt(t,s));{const e=r.pop();if(u!==e)return Rt("InvalidTag","Closing tag '"+e+"' is expected inplace of '"+u+"'.",Dt(t,s));0==r.length&&(i=!0)}}else{const o=St(f,e);if(!0!==o)return Rt(o.err.code,o.err.msg,Dt(t,s-f.length+o.err.line));if(!0===i)return Rt("InvalidXml","Multiple possible root nodes found.",Dt(t,s));r.push(u),n=!0}for(s++;s<t.length;s++){if("<"===t[s]){if("!"===t[s+1]){s++,s=xt(t,s);continue}break}if("&"===t[s]){const e=jt(t,s);if(-1==e)return Rt("InvalidChar","char '&' is not expected.",Dt(t,s));s=e}}"<"===t[s]&&s--}}}var o;return n?!(r.length>0)||Rt("InvalidXml","Invalid '"+JSON.stringify(r,null,4).replace(/\r?\n/g,"")+"' found.",1):Rt("InvalidXml","Start tag expected.",1)};const Bt=function(t){return String.fromCharCode(t)},Mt={nilChar:Bt(176),missingChar:Bt(201),nilPremitive:Bt(175),missingPremitive:Bt(200),emptyChar:Bt(178),emptyValue:Bt(177),boundryChar:Bt(179),objStart:Bt(198),arrStart:Bt(204),arrayEnd:Bt(185)},Ut=[Mt.nilChar,Mt.nilPremitive,Mt.missingChar,Mt.missingPremitive,Mt.boundryChar,Mt.emptyChar,Mt.emptyValue,Mt.arrayEnd,Mt.objStart,Mt.arrStart],kt=function(t,e,r){if("string"==typeof e)return t&&t[0]&&void 0!==t[0].val?Yt(t[0].val):Yt(t);{const i=void 0===(n=t)?Mt.missingChar:null===n?Mt.nilChar:!(n.child&&0===Object.keys(n.child).length&&(!n.attrsMap||0===Object.keys(n.attrsMap).length))||Mt.emptyChar;if(!0===i){let n="";if(Array.isArray(e)){n+=Mt.arrStart;const i=e[0],o=t.length;if("string"==typeof i)for(let e=0;e<o;e++){const r=Yt(t[e].val);n=Vt(n,r)}else for(let e=0;e<o;e++){const o=kt(t[e],i,r);n=Vt(n,o)}n+=Mt.arrayEnd}else{n+=Mt.objStart;const i=Object.keys(e);Array.isArray(t)&&(t=t[0]);for(let o in i){const s=i[o];let a;a=!r.ignoreAttributes&&t.attrsMap&&t.attrsMap[s]?kt(t.attrsMap[s],e[s],r):s===r.textNodeName?kt(t.val,e[s],r):kt(t.child[s],e[s],r),n=Vt(n,a)}}return n}return i}var n},Yt=function(t){switch(t){case void 0:return Mt.missingPremitive;case null:return Mt.nilPremitive;case"":return Mt.emptyValue;default:return t}},Vt=function(t,e){return Lt(e[0])||Lt(t[t.length-1])||(t+=Mt.boundryChar),t+e},Lt=function(t){return-1!==Ut.indexOf(t)};const Jt=st.buildOptions;var zt={convert2nimn:function(t,e,r){return r=Jt(r,Et.defaultOptions,Et.props),kt(t,e,r)}};const $t=st.buildOptions,Xt=function(t,e,r){let n="{";const i=Object.keys(t.child);for(let r=0;r<i.length;r++){var o=i[r];if(t.child[o]&&t.child[o].length>1){for(var s in n+='"'+o+'" : [ ',t.child[o])n+=Xt(t.child[o][s],e)+" , ";n=n.substr(0,n.length-1)+" ] "}else n+='"'+o+'" : '+Xt(t.child[o][0],e)+" ,"}return st.merge(n,t.attrsMap),st.isEmptyObject(n)?st.isExist(t.val)?t.val:"":(st.isExist(t.val)&&("string"!=typeof t.val||""!==t.val&&t.val!==e.cdataPositionChar)&&(n+='"'+e.textNodeName+'" : '+(!0!==(a=t.val)&&!1!==a&&isNaN(a)?'"'+a+'"':a)),","===n[n.length-1]&&(n=n.substr(0,n.length-2)),n+"}");var a};var Ht={convertToJsonString:function(t,e){return(e=$t(e,Et.defaultOptions,Et.props)).indentBy=e.indentBy||"",Xt(t,e)}};const qt=st.buildOptions,Zt={attributeNamePrefix:"@_",attrNodeName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataTagName:!1,cdataPositionChar:"\\c",format:!1,indentBy:" ",supressEmptyNode:!1,tagValueProcessor:function(t){return t},attrValueProcessor:function(t){return t}},Gt=["attributeNamePrefix","attrNodeName","textNodeName","ignoreAttributes","cdataTagName","cdataPositionChar","format","indentBy","supressEmptyNode","tagValueProcessor","attrValueProcessor"];function Qt(t){this.options=qt(t,Zt,Gt),this.options.ignoreAttributes||this.options.attrNodeName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=oe),this.options.cdataTagName?this.isCDATA=se:this.isCDATA=function(){return!1},this.replaceCDATAstr=Wt,this.replaceCDATAarr=Kt,this.options.format?(this.indentate=ie,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine=""),this.options.supressEmptyNode?(this.buildTextNode=ne,this.buildObjNode=ee):(this.buildTextNode=re,this.buildObjNode=te),this.buildTextValNode=re,this.buildObjectNode=te}function Wt(t,e){return t=this.options.tagValueProcessor(""+t),""===this.options.cdataPositionChar||""===t?t+"<![CDATA["+e+"]]"+this.tagEndChar:t.replace(this.options.cdataPositionChar,"<![CDATA["+e+"]]"+this.tagEndChar)}function Kt(t,e){if(t=this.options.tagValueProcessor(""+t),""===this.options.cdataPositionChar||""===t)return t+"<![CDATA["+e.join("]]><![CDATA[")+"]]"+this.tagEndChar;for(let r in e)t=t.replace(this.options.cdataPositionChar,"<![CDATA["+e[r]+"]]>");return t+this.newLine}function te(t,e,r,n){return r&&!t.includes("<")?this.indentate(n)+"<"+e+r+">"+t+"</"+e+this.tagEndChar:this.indentate(n)+"<"+e+r+this.tagEndChar+t+this.indentate(n)+"</"+e+this.tagEndChar}function ee(t,e,r,n){return""!==t?this.buildObjectNode(t,e,r,n):this.indentate(n)+"<"+e+r+"/"+this.tagEndChar}function re(t,e,r,n){return this.indentate(n)+"<"+e+r+">"+this.options.tagValueProcessor(t)+"</"+e+this.tagEndChar}function ne(t,e,r,n){return""!==t?this.buildTextValNode(t,e,r,n):this.indentate(n)+"<"+e+r+"/"+this.tagEndChar}function ie(t){return this.options.indentBy.repeat(t)}function oe(t){return!!t.startsWith(this.options.attributeNamePrefix)&&t.substr(this.attrPrefixLen)}function se(t){return t===this.options.cdataTagName}Qt.prototype.parse=function(t){return this.j2x(t,0).val},Qt.prototype.j2x=function(t,e){let r="",n="";const i=Object.keys(t),o=i.length;for(let s=0;s<o;s++){const o=i[s];if(void 0===t[o]);else if(null===t[o])n+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if(t[o]instanceof Date)n+=this.buildTextNode(t[o],o,"",e);else if("object"!=typeof t[o]){const i=this.isAttribute(o);i?r+=" "+i+'="'+this.options.attrValueProcessor(""+t[o])+'"':this.isCDATA(o)?t[this.options.textNodeName]?n+=this.replaceCDATAstr(t[this.options.textNodeName],t[o]):n+=this.replaceCDATAstr("",t[o]):o===this.options.textNodeName?t[this.options.cdataTagName]||(n+=this.options.tagValueProcessor(""+t[o])):n+=this.buildTextNode(t[o],o,"",e)}else if(Array.isArray(t[o]))if(this.isCDATA(o))n+=this.indentate(e),t[this.options.textNodeName]?n+=this.replaceCDATAarr(t[this.options.textNodeName],t[o]):n+=this.replaceCDATAarr("",t[o]);else{const r=t[o].length;for(let i=0;i<r;i++){const r=t[o][i];if(void 0===r);else if(null===r)n+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if("object"==typeof r){const t=this.j2x(r,e+1);n+=this.buildObjNode(t.val,o,t.attrStr,e)}else n+=this.buildTextNode(r,o,"",e)}}else if(this.options.attrNodeName&&o===this.options.attrNodeName){const e=Object.keys(t[o]),n=e.length;for(let i=0;i<n;i++)r+=" "+e[i]+'="'+this.options.attrValueProcessor(""+t[o][e[i]])+'"'}else{const r=this.j2x(t[o],e+1);n+=this.buildObjNode(r.val,o,r.attrStr,e)}}return{attrStr:r,val:n}};var ae=Qt,ue=K((function(t,e){const r=Et,n=st.buildOptions;e.parse=function(t,e,i){if(i){!0===i&&(i={});const e=Ft(t,i);if(!0!==e)throw Error(e.err.msg)}e=n(e,r.defaultOptions,r.props);const o=Et.getTraversalObj(t,e);return ut.convertToJson(o,e)},e.convertTonimn=zt.convert2nimn,e.getTraversalObj=Et.getTraversalObj,e.convertToJson=ut.convertToJson,e.convertToJsonString=Ht.convertToJsonString,e.validate=Ft,e.j2xParser=ae,e.parseToNimn=function(t,r,n){return e.convertTonimn(e.getTraversalObj(t,n),r,n)}})),le=function(t){return null!=t&&("object"==typeof t||"function"==typeof t)};function fe(t,e){for(var r in e)ce(e,r)&&(t[r]=e[r])}function ce(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var he,pe={},ge={default:{"&quot;":'"',"&#34;":'"',"&apos;":"'","&#39;":"'","&amp;":"&","&#38;":"&","&gt;":">","&#62;":">","&lt;":"<","&#60;":"<"},extras:{"&cent;":"¢","&#162;":"¢","&copy;":"©","&#169;":"©","&euro;":"€","&#8364;":"€","&pound;":"£","&#163;":"£","&reg;":"®","&#174;":"®","&yen;":"¥","&#165;":"¥"}};function de(t,e){if(!function(t){return t&&"string"==typeof t}(t))return"";var r=ge[e||"default"],n=function(t,e){if(pe[t])return pe[t];var r=Object.keys(e).join("|"),n=new RegExp("(?=("+r+"))\\1","g");return pe[t]=n,n}(e,r);return t.replace(n,(function(t){return r[t]}))}Object.defineProperty(ge,"all",{get:function(){return he||(he=function(t){le(t)||(t={});for(var e=arguments.length,r=1;r<e;r++){var n=arguments[r];le(n)&&fe(t,n)}return t}({},ge.default,ge.extras))}}),de.chars=ge.default,de.extras=ge.extras,Object.defineProperty(de,"all",{get:function(){return ge.all}});var ye=de,be={xmlrpc(t,e){let r;if(e){var n=e instanceof Array?e.map((function(t){return"string"==typeof t?{param:{value:t}}:{param:{int:t}}})):{param:{value:{struct:Object.keys(e).map((function(t){return{member:{name:t,value:e[t]}}}))}}};r=ot({methodCall:{methodName:t,params:n}})}else r=ot({methodCall:{methodName:t}});return'<?xml version="1.0"?>'+r},async call(t,e){const r=this.xmlrpc(t,e),n={cache:"no-cache",method:"POST",headers:{"content-type":"application/xml","content-length":r.length},body:r},i=await fetch("https://neos-server.org:3333",n),o=await i.text(),s=this.getJSON(o);if(s)return"submitJob"===t||"authenticatedSubmitJob"===t?{jobNumber:s[0],password:s[1]}:s;throw new Error("No JSON data found, original XML from NEOS: "+o)},getJSON(t){const e=ue.parse(t);return this.getValue(e)},getValue(t){const e=this.flattenObject(t),r=Object.keys(e).map(t=