mphttpx 2.6.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/fetchP.js +7 -13
- package/dist/cjs/index.js +5 -17
- package/dist/esm/fetchP.js +7 -6
- package/dist/esm/index.js +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/mphttpx.cjs.js +228 -1454
- package/dist/mphttpx.cjs.min.js +1 -1
- package/dist/mphttpx.esm.js +227 -1450
- package/dist/mphttpx.esm.min.js +1 -1
- package/dist/mphttpx.umd.js +5516 -0
- package/dist/mphttpx.umd.min.js +1 -0
- package/package.json +7 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).MPHTTPX={})}(this,function(e){"use strict";function t(e,t,n){return t=i(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],i(e).constructor):t.apply(e,n))}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function o(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}function c(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}var l={iterator:function(){return"function"==typeof Symbol&&Symbol.iterator||"Symbol(Symbol.iterator)"}(),toStringTag:function(){return"function"==typeof Symbol&&Symbol.toStringTag||"Symbol(Symbol.toStringTag)"}()},h=function(e,r){function i(e,r){var o;return n(this,i),o=t(this,i,[e]),void 0!==r&&(o.name=""+r),o}return a(i,e),o(i,[{key:r,get:function(){return"DOMException"}},{key:"__MPHTTPX__",get:function(){return{chain:["DOMException"]}}}])}(function(){return Error}(),l.toStringTag);function d(){return function(){try{return new DOMException,!0}catch(e){return!1}}()?DOMException:h}var y=d();function p(e){try{return e.__MPHTTPX__.chain[0]}catch(t){return Object.prototype.toString.call(e).slice(8,-1)}}function v(e,t,n){Object.defineProperty(e,t,{value:n})}function g(e){try{return String(e)}catch(e){return"[object Unknown]"}}function b(e,t){return Object.prototype.toString.call(t)==="[object ".concat(e,"]")}function m(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o="__MPHTTPX__";return!!t&&"object"===f(t)&&o in t&&!!t[o]&&"object"===f(t[o])&&"chain"in t[o]&&Array.isArray(t[o].chain)&&(n=t[o].chain.indexOf(e),r?0===n:n>-1)}var _=function(){return"function"==typeof Symbol&&!!Symbol.iterator}();function T(e){return Array.isArray(e)||!!e&&"object"===f(e)&&_&&Symbol.iterator in e&&"function"==typeof e[Symbol.iterator]}function k(e){var t,n,r,o=0,i=(t={next:function(){return o<e.length?{value:e[o++],done:!1}:{value:void 0,done:!0}}},r=function(){return i},(n=c(n=l.iterator))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t);return i}function E(e,t,n,r){if(e<t)throw new TypeError("Failed to ".concat(r?"execute '"+r+"' on":"construct"," '").concat(n,"': ").concat(t," argument").concat(t>1?"s":""," required, but only ").concat(e," present."))}var w=function(e){return o(function e(){n(this,e)},[{key:"encoding",get:function(){return"utf-8"}},{key:"encode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return S("string"==typeof e?e:""+e).encoded}},{key:"encodeInto",value:function(e,t){if(E(arguments.length,2,"TextEncoder","encodeInto"),!Uint8Array.prototype.isPrototypeOf(t)&&!b("Uint8Array",t))throw new TypeError("Failed to execute 'encodeInto' on 'TextEncoder': parameter 2 is not of type 'Uint8Array'.");var n=S("string"==typeof e?e:""+e,t);return{read:n.read,written:n.written}}},{key:"toString",value:function(){return"[object TextEncoder]"}},{key:e,get:function(){return"TextEncoder"}},{key:"__MPHTTPX__",get:function(){return{chain:["TextEncoder"]}}}])}(l.toStringTag);function S(e,t){for(var n=void 0!==t,r=0,o=0,i=e.length,a=0,u=Math.max(32,i+(i>>1)+7),s=n?t:new Uint8Array(u>>3<<3),c=0,f=0,l=0;r<i;){if(f=1,(c=e.charCodeAt(r))>=55296&&c<=56319)if(r+1<i){var h=e.charCodeAt(r+1);56320==(64512&h)?(f=2,r+=2,c=((1023&c)<<10)+(1023&h)+65536):(r+=1,c=65533)}else r+=1,c=65533;else c>=56320&&c<=57343?(r+=1,c=65533):r+=1;if(!n&&a+4>s.length){u+=8,u=(u*=1+r/e.length*2)>>3<<3;var d=new Uint8Array(u);d.set(s),s=d}if(4294967168&c?4294965248&c?4294901760&c?4292870144&c?(c=65533,l=3):l=4:l=3:l=2:l=1,n&&a+l>s.length)break;switch(l){case 1:s[a++]=c;break;case 2:s[a++]=c>>6&31|192,s[a++]=63&c|128;break;case 3:s[a++]=c>>12&15|224,s[a++]=c>>6&63|128,s[a++]=63&c|128;break;case 4:s[a++]=c>>18&7|240,s[a++]=c>>12&63|128,s[a++]=c>>6&63|128,s[a++]=63&c|128}o+=f}return{encoded:n?t:s.slice(0,a),read:o,written:a}}var R=function(){return"undefined"!=typeof TextEncoder&&TextEncoder||w}(),P=["utf-8","utf8","unicode-1-1-utf-8"],q=function(e){return o(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"utf-8",r=arguments.length>1?arguments[1]:void 0;if(n(this,e),-1===P.indexOf(("string"==typeof t?t:""+t).toLowerCase()))throw new RangeError("Failed to construct 'TextDecoder': encoding ('".concat(t,"') not implemented."));v(this,"__TextDecoder__",new A(r))},[{key:"encoding",get:function(){return"utf-8"}},{key:"fatal",get:function(){return x(this).fatal}},{key:"ignoreBOM",get:function(){return x(this).ignoreBOM}},{key:"decode",value:function(e,t){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.stream,r=void 0!==n&&n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{fatal:!1,ignoreBOM:!1,partial:[]};if(void 0===e){if(o.partial.length>0&&o.fatal)throw o.partial=[],new TypeError("Incomplete UTF-8 sequence.");return""}var i=H(e)?new Uint8Array(e):C(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):function(){throw new TypeError("Input could not be converted to any of: ArrayBufferView, ArrayBuffer.")}();if(o.partial.length>0){var a=new Uint8Array(o.partial.length+i.length);a.set(o.partial,0),a.set(i,o.partial.length),i=a,o.partial=[]}!o.ignoreBOM&&i.length>=3&&239===i[0]&&187===i[1]&&191===i[2]&&(i=i.subarray(3));var u=i.length,s=[];if(r&&i.length>0){for(var c=i.length;c>0&&c>i.length-4;){var f=i[c-1];if(128!=(192&f)){(f>239?4:f>223?3:f>191?2:1)>i.length-(c-1)&&(u=c-1);break}--c}o.partial=Array.from(i.slice(u)),i=i.slice(0,u)}var l=0,h=0,d=0,y=0,p=0,v=0,g=0,b=0;for(;b<u;){if(l=0,b+(d=(y=i[b])>239?4:y>223?3:y>191?2:1)<=u)switch(d){case 1:y<128&&(l=y);break;case 2:128==(192&(p=i[b+1]))&&(h=(31&y)<<6|63&p)>127&&(l=h);break;case 3:p=i[b+1],v=i[b+2],128==(192&p)&&128==(192&v)&&(h=(15&y)<<12|(63&p)<<6|63&v)>2047&&(h<55296||h>57343)&&(l=h);break;case 4:p=i[b+1],v=i[b+2],g=i[b+3],128==(192&p)&&128==(192&v)&&128==(192&g)&&(h=(15&y)<<18|(63&p)<<12|(63&v)<<6|63&g)>65535&&h<1114112&&(l=h)}if(0===l&&(1===d&&0!==y||d>1)){if(o.fatal)throw o.partial=[],new TypeError("Decoding failed.");for(var m=1;b+m<u&&128==(192&i[b+m]);)m+=1;s.push(65533),b+=m}else l>65535&&(l-=65536,s.push(l>>>10&1023|55296),l=56320|1023&l),s.push(l),b+=d}return s.length>16384?function(e){for(var t=[],n=0,r=e.length;n<r;n+=4096)t.push(String.fromCharCode.apply(String,e.slice(n,n+4096)));return t.join("")}(s):function(e){for(var t="",n=0,r=e.length;n<r;n+=4096)t+=String.fromCharCode.apply(String,e.slice(n,n+4096));return t}(s)}(e,t,x(this))}},{key:"toString",value:function(){return"[object TextDecoder]"}},{key:e,get:function(){return"TextDecoder"}},{key:"__MPHTTPX__",get:function(){return{chain:["TextDecoder"]}}}])}(l.toStringTag),A=o(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.fatal,o=void 0!==r&&r,i=t.ignoreBOM,a=void 0!==i&&i;n(this,e),this.partial=[],this.fatal=!!o,this.ignoreBOM=!!a});function x(e){return e.__TextDecoder__}function H(e){return!!e&&"object"===f(e)&&ArrayBuffer.prototype.isPrototypeOf(e)||function(e){return!!e&&"object"===f(e)&&"byteLength"in e&&"number"==typeof e.byteLength&&(b("ArrayBuffer",e)||"[object ArrayBuffer]"===g(e))}(e)}function C(e){return ArrayBuffer.isView?ArrayBuffer.isView(e):function(e){return!!e&&"object"===f(e)&&(["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"].indexOf(Object.prototype.toString.call(e))>-1||"undefined"!=typeof DataView&&DataView.prototype.isPrototypeOf(e))}(e)}var L=function(){return"undefined"!=typeof TextDecoder&&TextDecoder||q}(),M=function(e){return o(function e(t,r){n(this,e),E(arguments.length,1,"Event"),v(this,"__Event__",new j);var o=O(this);o.type=""+t,o.bubbles=!!(null==r?void 0:r.bubbles),o.cancelable=!!(null==r?void 0:r.cancelable),o.composed=!!(null==r?void 0:r.composed),Object.defineProperty(this,"isTrusted",{enumerable:!0,get:function(){return"YES"===o.isTrusted}})},[{key:"NONE",get:function(){return 0}},{key:"CAPTURING_PHASE",get:function(){return 1}},{key:"AT_TARGET",get:function(){return 2}},{key:"BUBBLING_PHASE",get:function(){return 3}},{key:"bubbles",get:function(){return O(this).bubbles}},{key:"cancelBubble",get:function(){return O(this).cancelBubble},set:function(e){e&&(O(this).cancelBubble=!0)}},{key:"cancelable",get:function(){return O(this).cancelable}},{key:"composed",get:function(){return O(this).composed}},{key:"currentTarget",get:function(){return O(this).currentTarget}},{key:"defaultPrevented",get:function(){return O(this).defaultPrevented}},{key:"eventPhase",get:function(){return O(this).eventPhase}},{key:"returnValue",get:function(){return O(this).returnValue},set:function(e){e||this.preventDefault()}},{key:"srcElement",get:function(){return O(this).target}},{key:"target",get:function(){return O(this).target}},{key:"timeStamp",get:function(){return O(this).timeStamp}},{key:"type",get:function(){return O(this).type}},{key:"composedPath",value:function(){var e=this.target?[this.target]:[];return this.currentTarget&&this.currentTarget!==this.target&&e.push(this.currentTarget),e}},{key:"initEvent",value:function(e,t,n){E(arguments.length,1,p(this),"initEvent");var r=O(this);r.eventDispatched||(r.type=""+e,r.bubbles=!!t,r.cancelable=!!n)}},{key:"preventDefault",value:function(){var e=O(this);if(e.passive)return console.warn("Ignoring 'preventDefault()' call on event of type '".concat(this.type,"' from a listener registered as 'passive'."));this.cancelable&&(e.defaultPrevented=!0,e.returnValue=!1)}},{key:"stopImmediatePropagation",value:function(){O(this).immediatePropagationStopped=!0,this.cancelBubble=!0}},{key:"stopPropagation",value:function(){this.cancelBubble=!0}},{key:"toString",value:function(){return"[object Event]"}},{key:e,get:function(){return"Event"}},{key:"__MPHTTPX__",get:function(){return{chain:["Event"]}}}],[{key:"NONE",get:function(){return 0}},{key:"CAPTURING_PHASE",get:function(){return 1}},{key:"AT_TARGET",get:function(){return 2}},{key:"BUBBLING_PHASE",get:function(){return 3}}])}(l.toStringTag),j=o(function e(){n(this,e),this.bubbles=!1,this.cancelBubble=!1,this.cancelable=!1,this.composed=!1,this.currentTarget=null,this.defaultPrevented=!1,this.eventPhase=0,this.returnValue=!0,this.target=null,this.timeStamp=(new Date).getTime()-F,this.type="",this.passive=!1,this.eventDispatched=!1,this.immediatePropagationStopped=!1,Object.defineProperty(this,"isTrusted",D())});function O(e){return e.__Event__}var F=function(){return(new Date).getTime()}();function B(e){return"name"in e?e.name:"unknown"}function D(){var e=B(D),t=e.length,n="NO";return{configurable:!1,enumerable:!0,get:function(){return n},set:function(r){e===r.slice(0,t)&&(n=r.slice(t+1))}}}function U(e,t){(O(e)||{}).isTrusted="".concat(B(D),":").concat(t?"YES":"NO")}var N=function(){return"undefined"!=typeof Event&&Event||M}(),X=function(e){return o(function e(){n(this,e),v(this,"__EventTarget__",new I)},[{key:"addEventListener",value:function(e,t,n){if(E(arguments.length,2,p(this),"addEventListener"),"function"!=typeof t&&"object"!==f(t)&&void 0!==t)throw new TypeError("Failed to execute 'addEventListener' on '".concat(p(this),"': parameter 2 is not of type 'Object'."));var r=z(this)||{executors:[]},o=new G(e,t),i=o.options.capture="boolean"==typeof n?n:!!(null==n?void 0:n.capture);if(!r.executors.some(function(e){return e.equals(o)})){if(r.executors.push(o),n&&"object"===f(n)){o.options.once=!!n.once,o.options.passive=!!n.passive;var a=n.signal;a&&Y(a)&&!a.aborted&&(o.options.signal=a,function(e,t,n){var r=function(){z(e).executors=z(e).executors.filter(function(e){return!e.equals(t)}),n.removeEventListener("abort",r)};n.addEventListener("abort",r)}(this,o,a))}if(i){var u=function(e){return e.options.capture?0:1};r.executors=r.executors.sort(function(e,t){return u(e)-u(t)})}}}},{key:"dispatchEvent",value:function(e){if(E(arguments.length,1,p(this),"dispatchEvent"),m("Event",e))U(e,!1);else{if(n=function(e){return"[object "===e.slice(0,8)&&"Event]"===e.slice(-6)},!(t=e)||"object"!==f(t)||!("type"in t)||"string"!=typeof t.type||!n(Object.prototype.toString.call(t))&&!n(g(t)))throw new TypeError("Failed to execute 'dispatchEvent' on '".concat(p(this),"': parameter 1 is not of type 'Event'."));console.warn("WARNING: undefined behavior when executing 'dispatchEvent' on '".concat(p(this),"': parameter 1 is not of type 'Event(P)'."))}var t,n;return W(this,e)}},{key:"removeEventListener",value:function(e,t,n){if(E(arguments.length,2,p(this),"removeEventListener"),"function"!=typeof t&&"object"!==f(t)&&void 0!==t)throw new TypeError("Failed to execute 'removeEventListener' on '".concat(p(this),"': parameter 2 is not of type 'Object'."));var r=z(this)||{executors:[]},o=new G(e,t);o.options.capture="boolean"==typeof n?n:!!(null==n?void 0:n.capture),r.executors.some(function(e){return e.equals(o)})&&(r.executors=r.executors.filter(function(e){return!e.equals(o)}))}},{key:"toString",value:function(){return"[object EventTarget]"}},{key:e,get:function(){return"EventTarget"}},{key:"__MPHTTPX__",get:function(){return{chain:["EventTarget"]}}}])}(l.toStringTag),I=o(function e(){n(this,e),this.executors=[]});function z(e){return e.__EventTarget__}var G=function(){return o(function e(t,r){var o;n(this,e),this.options={},this.type=""+t,this.callback="function"==typeof(o=r)?o:function(e){return!!e&&"object"===f(e)&&"handleEvent"in e&&"function"==typeof e.handleEvent}(o)?o.handleEvent:o},[{key:"equals",value:function(e){return this.type===e.type&&this.callback===e.callback&&this.options.capture===e.options.capture}}])}();function W(e,t){var n=z(e)||{},r=t.__Event__||{};r.target=e,r.currentTarget=e,r.eventPhase=2,r.eventDispatched=!0;var o=[];Array.isArray(n.executors)||(n.executors=[]);for(var i=0;i<n.executors.length&&!r.immediatePropagationStopped;++i){var a=n.executors[i];if(a.type===t.type){a.options.once&&o.push(i),r.passive=!!a.options.passive;try{var u=a.callback;"function"==typeof u&&u.call(e,t)}catch(e){console.error(e)}r.passive=!1}}return o.length>0&&(n.executors=n.executors.reduce(function(e,t,n){return-1===o.indexOf(n)&&e.push(t),e},[])),r.currentTarget=null,r.eventPhase=0,r.eventDispatched=!1,!(t.cancelable&&t.defaultPrevented)}function V(e,t){return function(n){var r="on"+n,o=e[r],i=t[r];"function"==typeof o?X.prototype.addEventListener.call(e,n,i):X.prototype.removeEventListener.call(e,n,i)}}function J(e,t,n){"function"==typeof t&&t.call(e,n)}function Y(e){return m("EventTarget",e)||function(e){return!!e&&"object"===f(e)&&"addEventListener"in e&&"function"==typeof e.addEventListener&&"removeEventListener"in e&&"function"==typeof e.removeEventListener}(e)}var Q=function(){return"undefined"!=typeof EventTarget&&EventTarget||X}(),$=function(e,r){function i(e,r){var o,a;return n(this,i),E(arguments.length,1,"CustomEvent"),v(o=t(this,i,[e,r]),"__CustomEvent__",new K),Z(o).detail=null!==(a=null==r?void 0:r.detail)&&void 0!==a?a:null,o}return a(i,e),o(i,[{key:"detail",get:function(){return Z(this).detail}},{key:"initCustomEvent",value:function(e,t,n,r){E(arguments.length,1,"CustomEvent","initCustomEvent"),this.__Event__.eventDispatched||(this.initEvent(e,t,n),Z(this).detail=null!=r?r:null)}},{key:"toString",value:function(){return"[object CustomEvent]"}},{key:r,get:function(){return"CustomEvent"}},{key:"__MPHTTPX__",get:function(){return{chain:["CustomEvent","Event"]}}}])}(M,l.toStringTag),K=o(function e(){n(this,e)});function Z(e){return e.__CustomEvent__}var ee=function(){return"undefined"!=typeof CustomEvent&&CustomEvent||$}(),te=function(e,r){function i(){var e;if(n(this,i),(e=t(this,i)).constructor===i)throw new TypeError("Failed to construct 'AbortSignal': Illegal constructor");return v(e,"__AbortSignal__",new ne(e)),e}return a(i,e),o(i,[{key:"aborted",get:function(){return re(this).aborted}},{key:"reason",get:function(){return re(this).reason}},{key:"throwIfAborted",value:function(){if(this.aborted)throw this.reason}},{key:"onabort",get:function(){return re(this).onabort},set:function(e){re(this).onabort=e,re(this).attach("abort")}},{key:"toString",value:function(){return"[object AbortSignal]"}},{key:r,get:function(){return"AbortSignal"}},{key:"__MPHTTPX__",get:function(){return{chain:["AbortSignal","EventTarget"]}}}],[{key:"abort",value:function(e){var t=oe();return ie(t,!1,e),t}},{key:"any",value:function(e){if(E(arguments.length,1,"AbortSignal","any"),!T(e))throw new TypeError("Failed to execute 'any' on 'AbortSignal': The provided value cannot be converted to a sequence.");var t=Array.isArray(e)?e:Array.from(e);t.forEach(function(e){if(!Y(e))throw new TypeError("Failed to execute 'any' on 'AbortSignal': Failed to convert value to 'AbortSignal'.")});var n=oe(),r=function(){for(var e=0;e<t.length;++e){var n=t[e];if(n.aborted)return n}}();return r?ie(n,!1,r.reason):function(e,t){function n(){for(var r=0;r<t.length;++r){t[r].removeEventListener("abort",n)}ie(e,!0,this.reason)}for(var r=0;r<t.length;++r){t[r].addEventListener("abort",n)}}(n,t),n}},{key:"timeout",value:function(e){if(E(arguments.length,1,"AbortSignal","timeout"),!(e>=0))throw new TypeError("Failed to execute 'timeout' on 'AbortSignal': Value is outside the 'unsigned long long' value range.");var t=oe();return setTimeout(function(){ie(t,!0,new y("signal timed out","TimeoutError"))},e),t}}])}(X,l.toStringTag),ne=o(function e(t){var r;n(this,e),this.aborted=!1,this.reason=void 0,this.onabort=null,this.attach=V(t,(r=t,{onabort:function(e){J(r,r.onabort,e)}}))});function re(e){return e.__AbortSignal__}function oe(){var e=Object.create(te.prototype);return v(e,"__EventTarget__",{executors:[]}),v(e,"__AbortSignal__",new ne(e)),e}function ie(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0;if(!e.aborted){var r=re(e)||{};if(r.aborted=!0,r.reason=void 0!==n?n:new y("signal is aborted without reason","AbortError"),t){var o=new M("abort");o.__Event__.target=e,U(o,!0),W(e,o)}}}var ae=function(){return"undefined"!=typeof AbortSignal&&AbortSignal||te}(),ue=function(e){return o(function e(){n(this,e),v(this,"__AbortController__",new se)},[{key:"signal",get:function(){return(e=this,e.__AbortController__).signal;var e}},{key:"abort",value:function(e){ie(this.signal,!0,e)}},{key:"toString",value:function(){return"[object AbortController]"}},{key:e,get:function(){return"AbortController"}},{key:"__MPHTTPX__",get:function(){return{chain:["AbortController"]}}}])}(l.toStringTag),se=o(function e(){n(this,e),this.signal=oe()});var ce=function(){return"undefined"!=typeof AbortController&&AbortController||ue}(),fe=function(){return R.prototype.encode.bind(new R)}(),le=function(){return L.prototype.decode.bind(new L)}(),he={ReadableStream:function(){return"undefined"!=typeof ReadableStream&&ReadableStream||void 0}()};var de=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1?arguments[1]:void 0;if(n(this,t),!T(e))throw new TypeError("Failed to construct 'Blob/File': The provided value cannot be converted to a sequence.");for(var o=Array.isArray(e)?e:Array.from(e),i=[],a=0,u=0;u<o.length;++u){var s=o[u];if(me(s))a+=s.size,i.push(s.arrayBuffer().then(function(e){return new Uint8Array(e)}));else{var c=H(s)||C(s)?ve(s):fe(s);a+=c.length,i.push(Promise.resolve(c))}}v(this,"__Blob__",new ye(Promise.all(i).then(function(e){return function(e){var t=e.reduce(function(e,t){return e+t.byteLength},0),n=new Uint8Array(t);return e.reduce(function(e,t){return n.set(t,e),e+t.byteLength},0),n}(e)}))),pe(this).size=a,pe(this).type=ge(null==r?void 0:r.type)}return o(t,[{key:"size",get:function(){return pe(this).size}},{key:"type",get:function(){return pe(this).type}},{key:"arrayBuffer",value:function(){return pe(this).promise.then(function(e){return be(e.buffer).buffer})}},{key:"bytes",value:function(){return pe(this).promise.then(function(e){return be(e.buffer)})}},{key:"slice",value:function(e,n,r){var o=null!=e?e:0,i=null!=n?n:this.size,a=Object.create(t.prototype);return v(a,"__Blob__",new ye(pe(this).promise.then(function(e){return be(e.slice(o,i))}))),pe(a).size=function(e,t,n){var r=function(t){var n=Number(t);return isNaN(n)&&(n=0),n=n>=0?Math.min(n,e):Math.max(0,n+e)};return Math.max(0,r(n)-r(t))}(this.size,o,i),pe(a).type=ge(r),a}},{key:"stream",value:function(){var e=he.ReadableStream||function(){throw new ReferenceError("ReadableStream is not defined")}(),t=0;try{return new e({type:"bytes",autoAllocateChunkSize:524288,pull:function(e){var n,r=null===(n=e.byobRequest)||void 0===n?void 0:n.view;return this.slice(t,(null==r?void 0:r.byteLength)?t+r.byteLength:void 0).arrayBuffer().then(function(n){var o,i=new Uint8Array(n),a=i.byteLength;t+=a,r.set(i),null===(o=e.byobRequest)||void 0===o||o.respond(a),t>=this.size&&e.close()}.bind(this))}.bind(this)})}catch(n){return new e({pull:function(e){return this.slice(t,t+524288).arrayBuffer().then(function(n){t+=n.byteLength;var r=new Uint8Array(n);e.enqueue(r),t==this.size&&e.close()}.bind(this))}.bind(this)})}}},{key:"text",value:function(){return pe(this).promise.then(function(e){return le(e)})}},{key:"toString",value:function(){return"[object Blob]"}},{key:e,get:function(){return"Blob"}},{key:"__MPHTTPX__",get:function(){return{chain:["Blob"]}}}])}(l.toStringTag),ye=o(function e(t){n(this,e),this.size=0,this.type="",this.promise=t});function pe(e){return e.__Blob__}function ve(e){return H(e)?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function ge(e){var t=""+(void 0!==e?e:"");return/[^\u0020-\u007E]/.test(t)?"":t.toLowerCase()}function be(e){var t=ve(e),n=new Uint8Array(new ArrayBuffer(t.byteLength));return n.set(t),n}function me(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return m("Blob",e,t)||function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=["[object Blob]"];t||n.push("[object File]");return!!e&&"object"===f(e)&&"size"in e&&"number"==typeof e.size&&"arrayBuffer"in e&&"function"==typeof e.arrayBuffer&&(n.indexOf(Object.prototype.toString.call(e))>-1||n.indexOf(g(e))>-1)}(e,t)}function _e(){return function(){try{return 2===new Blob(["ä"]).size}catch(e){return!1}}()?Blob:de}var Te=_e();function ke(e){var r=function(e,r){function i(e,r,o){var a;return n(this,i),E(arguments.length,2,"File"),v(a=t(this,i,[e,o]),"__File__",new Ee),we(a).lastModified=+((null==o?void 0:o.lastModified)?new Date(o.lastModified):new Date)||0,we(a).name=""+r,a}return a(i,e),o(i,[{key:"lastModified",get:function(){return we(this).lastModified}},{key:"name",get:function(){return we(this).name}},{key:"webkitRelativePath",get:function(){return""}},{key:"toString",value:function(){return"[object File]"}},{key:r,get:function(){return"File"}}])}(e,l.toStringTag);return e===de&&Object.defineProperty(r.prototype,"__MPHTTPX__",{configurable:!0,get:function(){return{chain:["File","Blob"]}}}),r}var Ee=o(function e(){n(this,e),this.lastModified=0,this.name=""});function we(e){return e.__File__}var Se=ke(de);function Re(){return function(){try{return new File([],""),!0}catch(e){return!1}}()?File:Te===de?Se:ke(Te)}var Pe=Re(),qe=["loaded","total"],Ae=function(e,r){function i(e,r){var o,a,u;n(this,i),v(o=t(this,i,[e,r]),"__ProgressEvent__",new xe);var s=He(o);s.lengthComputable=!!(null==r?void 0:r.lengthComputable),s.loaded=Number(null!==(a=null==r?void 0:r.loaded)&&void 0!==a?a:0),s.total=Number(null!==(u=null==r?void 0:r.total)&&void 0!==u?u:0);for(var c=0;c<qe.length;++c){var f=qe[c];if(isNaN(o[f]))throw new TypeError("Failed to construct 'ProgressEvent': Failed to read the '".concat(f,"' property from 'ProgressEventInit': The provided double value is non-finite."))}return o}return a(i,e),o(i,[{key:"lengthComputable",get:function(){return He(this).lengthComputable}},{key:"loaded",get:function(){return He(this).loaded}},{key:"total",get:function(){return He(this).total}},{key:"toString",value:function(){return"[object ProgressEvent]"}},{key:r,get:function(){return"ProgressEvent"}},{key:"__MPHTTPX__",get:function(){return{chain:["ProgressEvent","Event"]}}}])}(M,l.toStringTag),xe=o(function e(){n(this,e),this.lengthComputable=!1,this.loaded=0,this.total=0});function He(e){return e.__ProgressEvent__}function Ce(e,t){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=new Ae(t,{lengthComputable:n>0,loaded:arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,total:n});r.__Event__.target=e,U(r,!0),W(e,r)}var Le=function(e,r){function i(){var e;return n(this,i),v(e=t(this,i),"__FileReader__",new Me(e)),e}return a(i,e),o(i,[{key:"EMPTY",get:function(){return 0}},{key:"LOADING",get:function(){return 1}},{key:"DONE",get:function(){return 2}},{key:"error",get:function(){return je(this).error}},{key:"readyState",get:function(){return je(this).readyState}},{key:"result",get:function(){return je(this).result}},{key:"abort",value:function(){var e,t;2===je(this).pos&&((t=je(e=this)).pos=5,t.error=new y("An ongoing operation was aborted, typically with a call to abort().","AbortError"),t.result=null,t.readyState=2,Ce(e,"abort"),Be(e))}},{key:"readAsArrayBuffer",value:function(e){Oe(this,"readAsArrayBuffer",arguments.length,e),Fe(this,e.size,function(){return e.arrayBuffer()})}},{key:"readAsBinaryString",value:function(e){Oe(this,"readAsBinaryString",arguments.length,e),Fe(this,e.size,function(){return e.arrayBuffer().then(function(e){for(var t=[],n=new Uint8Array(e),r=0;r<n.length;++r)t.push(String.fromCharCode(n[r]));return t.join("")})})}},{key:"readAsDataURL",value:function(e){Oe(this,"readAsDataURL",arguments.length,e),Fe(this,e.size,function(){return e.arrayBuffer().then(function(t){return"data:"+(e.type||"application/octet-stream")+";base64,"+De(new Uint8Array(t))})})}},{key:"readAsText",value:function(e,t){if(Oe(this,"readAsText",arguments.length,e),"function"==typeof TextDecoder){var n=new TextDecoder(t);Fe(this,e.size,function(){return e.arrayBuffer().then(function(e){return n.decode(e)})})}else{if(void 0!==t){var r=""+t;-1===["utf-8","utf8","unicode-1-1-utf-8"].indexOf(r.toLowerCase())&&console.warn("Ignoring the execution of 'readAsText' on 'FileReader': encoding ('".concat(r,"') not implemented."))}Fe(this,e.size,function(){return e.text()})}}},{key:"onabort",get:function(){return je(this).onabort},set:function(e){je(this).onabort=e,je(this).attach("abort")}},{key:"onerror",get:function(){return je(this).onerror},set:function(e){je(this).onerror=e,je(this).attach("error")}},{key:"onload",get:function(){return je(this).onload},set:function(e){je(this).onload=e,je(this).attach("load")}},{key:"onloadend",get:function(){return je(this).onloadend},set:function(e){je(this).onloadend=e,je(this).attach("loadend")}},{key:"onloadstart",get:function(){return je(this).onloadstart},set:function(e){je(this).onloadstart=e,je(this).attach("loadstart")}},{key:"onprogress",get:function(){return je(this).onprogress},set:function(e){je(this).onprogress=e,je(this).attach("progress")}},{key:"toString",value:function(){return"[object FileReader]"}},{key:r,get:function(){return"FileReader"}},{key:"__MPHTTPX__",get:function(){return{chain:["FileReader","EventTarget"]}}}],[{key:"EMPTY",get:function(){return 0}},{key:"LOADING",get:function(){return 1}},{key:"DONE",get:function(){return 2}}])}(X,l.toStringTag),Me=o(function e(t){var r;n(this,e),this.pos=0,this.readyState=0,this.result=null,this.error=null,this.onabort=null,this.onerror=null,this.onload=null,this.onloadend=null,this.onloadstart=null,this.onprogress=null,this.attach=V(t,(r=t,{onabort:function(e){J(r,r.onabort,e)},onerror:function(e){J(r,r.onerror,e)},onload:function(e){J(r,r.onload,e)},onloadend:function(e){J(r,r.onloadend,e)},onloadstart:function(e){J(r,r.onloadstart,e)},onprogress:function(e){J(r,r.onprogress,e)}}))});function je(e){return e.__FileReader__}function Oe(e,t,n,r){if(E(n,1,"FileReader",t),!me(r))throw new TypeError("Failed to execute '"+t+"' on 'FileReader': parameter 1 is not of type 'Blob'.");if(1===e.readyState)throw new y("Failed to execute '".concat(t,"' on 'FileReader': The object is already busy reading Blobs."),"InvalidStateError")}function Fe(e,t,n){!function(e,t,n){var r=je(e);r.pos=1,r.error=null,r.result=null;var o=function(){return Ce(e,"loadstart",0,t),n()};(function(e,t,n){var r=je(e);r.pos=2,r.readyState=1,Promise.resolve().then(function(){if(2===r.pos)return n().then(function(n){return function(e,t,n){var r=je(e);if(2!==r.pos)return;r.pos=3,r.result=n,r.readyState=2,function(e,t){je(e).pos=4,Ce(e,"load",t,t),Be(e,t)}(e,t)}(e,t,n)}).catch(function(t){return function(e,t){var n=je(e);if(2!==n.pos)return;n.pos=6,n.error=t,n.result=null,n.readyState=2,Ce(e,"error"),Be(e)}(e,t)})})})(e,t,o)}(e,t,n)}function Be(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;je(e).pos=7,Ce(e,"loadend",t,t)}function De(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=[],r=0;r<e.length;r+=3){var o=e[r],i=r+1<e.length,a=i?e[r+1]:0,u=r+2<e.length,s=u?e[r+2]:0,c=o>>2,f=(3&o)<<4|a>>4,l=(15&a)<<2|s>>6,h=63&s;u||(h=64,i||(l=64)),n.push(t[c],t[f],t[l],t[h])}return n.join("")}var Ue=function(){return"undefined"!=typeof FileReader&&FileReader||Le}(),Ne=function(e,t){return o(function e(t){if(n(this,e),v(this,"__URLSearchParams__",new Xe),void 0!==t)if(Je(t))t.forEach(function(e,t){this.append(t,e)}.bind(this),this);else if(t&&"object"===f(t))if(T(t))for(var r=Array.isArray(t)?t:Array.from(t),o=0;o<r.length;++o){var i=r[o];if(!T(i))throw new TypeError("Failed to construct 'URLSearchParams': The provided value cannot be converted to a sequence.");var a=Array.isArray(i)?i:Array.from(i);if(2!==a.length)throw new TypeError("Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements");this.append(a[0],a[1])}else Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])}.bind(this),this);else{var u=""+t;0===u.indexOf("?")&&(u=u.slice(1));for(var s=u.split("&"),c=0;c<s.length;++c){var l=s[c],h=l.indexOf("=");h>-1?this.append(Ve(l.slice(0,h)),Ve(l.slice(h+1))):l&&this.append(Ve(l),"")}}},[{key:"size",get:function(){return Ie(this).array.length}},{key:"append",value:function(e,t){ze(arguments.length,2,"append"),Ie(this).array.push([""+e,Ge(t)])}},{key:"delete",value:function(e,t){ze(arguments.length,1,"delete");for(var n=""+e,r=-1,o=Ie(this).array,i=[],a=0;a<o.length;++a){var u=o[a];u[0]!==n?i.push(u):(1!==arguments.length&&u[1]!==Ge(t)&&i.push(u),r=a)}r>-1&&(Ie(this).array=i)}},{key:"get",value:function(e){ze(arguments.length,1,"get");for(var t=""+e,n=Ie(this).array,r=0;r<n.length;++r){var o=n[r];if(o[0]===t)return o[1]}return null}},{key:"getAll",value:function(e){ze(arguments.length,1,"getAll");for(var t=""+e,n=Ie(this).array,r=[],o=0;o<n.length;++o){var i=n[o];i[0]===t&&r.push(i[1])}return r}},{key:"has",value:function(e,t){ze(arguments.length,1,"has");for(var n=""+e,r=Ie(this).array,o=0;o<r.length;++o){var i=r[o];if(i[0]===n){if(1===arguments.length)return!0;if(i[1]===Ge(t))return!0}}return!1}},{key:"set",value:function(e,t){ze(arguments.length,2,"set");for(var n=""+e,r=Ge(t),o=-1,i=Ie(this).array,a=[],u=0;u<i.length;++u){var s=i[u];s[0]!==n?a.push(s):-1===o&&(o=u,a.push([n,r]))}-1===o&&a.push([n,r]),Ie(this).array=a}},{key:"sort",value:function(){Ie(this).array.sort(function(e,t){return e[0]<t[0]?-1:e[0]>t[0]?1:0})}},{key:"forEach",value:function(e,t){if(ze(arguments.length,1,"forEach"),"function"!=typeof e)throw new TypeError("Failed to execute 'forEach' on 'URLSearchParams': parameter 1 is not of type 'Function'.");for(var n=Ie(this).array,r=0;r<n.length;++r){var o=n[r];e.call(t,o[1],o[0],this)}}},{key:"entries",value:function(){return k(Ie(this).array.map(function(e){return[e[0],e[1]]}))}},{key:"keys",value:function(){return k(Ie(this).array.map(function(e){return e[0]}))}},{key:"values",value:function(){return k(Ie(this).array.map(function(e){return e[1]}))}},{key:e,value:function(){return this.entries()}},{key:"toString",value:function(){for(var e=Ie(this).array,t=[],n=0;n<e.length;++n){var r=e[n];t.push(We(r[0])+"="+We(r[1]))}return t.join("&")}},{key:t,get:function(){return"URLSearchParams"}},{key:"__MPHTTPX__",get:function(){return{chain:["URLSearchParams"]}}}])}(l.iterator,l.toStringTag),Xe=o(function e(){n(this,e),this.array=[]});function Ie(e){return e.__URLSearchParams__}function ze(e,t,n){E(e,t,"URLSearchParams",n)}function Ge(e){return"string"==typeof e?e:null!=e&&"function"==typeof e.toString?e.toString():JSON.stringify(e)}function We(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'\(\)~]|%20|%00/g,function(e){return t[e]})}function Ve(e){return e.replace(/[ +]/g,"%20").replace(/(%[a-f0-9]{2})+/gi,function(e){return decodeURIComponent(e)})}function Je(e){return m("URLSearchParams",e)||function(e){return b("URLSearchParams",e)||!!e&&"object"===f(e)&&"size"in e&&"number"==typeof e.size&&"forEach"in e&&"function"==typeof e.forEach&&"function"==typeof URLSearchParams&&e instanceof URLSearchParams}(e)}var Ye=function(){return"undefined"!=typeof URLSearchParams&&URLSearchParams||Ne}(),Qe=function(e,t){return o(function e(t,r){if(n(this,e),v(this,"__FormData__",new $e),void 0!==t)try{for(var o=t.elements,i=0;i<o.length;++i){var a=o[i];if(!a.name||a.disabled||"submit"===a.type||"button"===a.type||nt(a,"form fieldset[disabled] *"))return;if("file"===a.type)for(var u=a.files&&a.files.length?a.files:[new Pe([],"",{type:"application/octet-stream"})],s=0;s<u.length;++s)this.append(a.name,u[s]);else if("select-multiple"===a.type||"select-one"===a.type)for(var c=0;c<a.options.length;++c){var f=a.options[c];!f.disabled&&f.selected&&this.append(a.name,f.value)}else if("checkbox"===a.type||"radio"===a.type)a.checked&&this.append(a.name,a.value);else{var l="textarea"===a.type?it(a.value):a.value;this.append(a.name,l)}}}catch(e){throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}null!=r&&console.warn("Ignoring the 'submitter' of 'FormData' constructor: parameter 2 not implemented.")},[{key:"append",value:function(e,t,n){Ze(arguments.length,2,"append"),Ke(this).array.push(et(e,t,n))}},{key:"delete",value:function(e){Ze(arguments.length,1,"delete");for(var t=""+e,n=-1,r=Ke(this).array,o=[],i=0;i<r.length;++i){var a=r[i];a[0]!==t?o.push(a):n=i}n>-1&&(Ke(this).array=o)}},{key:"get",value:function(e){Ze(arguments.length,1,"get");for(var t=""+e,n=Ke(this).array,r=0;r<n.length;++r){var o=n[r];if(o[0]===t)return o[1]}return null}},{key:"getAll",value:function(e){Ze(arguments.length,1,"getAll");for(var t=""+e,n=Ke(this).array,r=[],o=0;o<n.length;++o){var i=n[o];i[0]===t&&r.push(i[1])}return r}},{key:"has",value:function(e){Ze(arguments.length,1,"has");for(var t=""+e,n=Ke(this).array,r=0;r<n.length;++r){if(n[r][0]===t)return!0}return!1}},{key:"set",value:function(e,t,n){Ze(arguments.length,2,"set");for(var r=""+e,o=et(e,t,n),i=-1,a=Ke(this).array,u=[],s=0;s<a.length;++s){var c=a[s];c[0]!==r?u.push(c):-1===i&&(i=s,u.push(o))}-1===i&&u.push(o),Ke(this).array=u}},{key:"forEach",value:function(e,t){if(Ze(arguments.length,1,"forEach"),"function"!=typeof e)throw new TypeError("Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'.");for(var n=Ke(this).array,r=0;r<n.length;++r){var o=n[r];e.call(t,o[1],o[0],t)}}},{key:"entries",value:function(){return k(Ke(this).array.map(function(e){return[e[0],e[1]]}))}},{key:"keys",value:function(){return k(Ke(this).array.map(function(e){return e[0]}))}},{key:"values",value:function(){return k(Ke(this).array.map(function(e){return e[1]}))}},{key:e,value:function(){return this.entries()}},{key:"toString",value:function(){return"[object FormData]"}},{key:t,get:function(){return"FormData"}},{key:"__MPHTTPX__",get:function(){return{chain:["FormData"]}}}])}(l.iterator,l.toStringTag),$e=o(function e(){n(this,e),this.array=[]});function Ke(e){return e.__FormData__}function Ze(e,t,n){return E(e,t,"FormData",n)}function et(e,t,n){if(me(t)){if(n=void 0!==n?""+n:"string"==typeof t.name?t.name:"blob",t.name!==n||me(t,!0))t=new(m("Blob",t)?Se:Pe)([t],n);return[""+e,t]}return[""+e,""+t]}function nt(e,t){var n="undefined"!=typeof Element&&Element&&Element.prototype;return n&&!n.matches&&(n.matches=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector||function(e){for(var t=(this.ownerDocument||this.document).querySelectorAll(e),n=t.length;--n>=0&&t.item(n)!==this;);return n>-1}),!!n&&n.matches.call(e,t)}function rt(e){return m("FormData",e)||function(e){var t="[object FormData]";return!!e&&"object"===f(e)&&"forEach"in e&&"function"==typeof e.forEach&&(Object.prototype.toString.call(e)===t||g(e)===t)}(e)}function ot(e,t){var n=t||"----formdata-mphttpx-"+Math.random(),r="--".concat(n,'\r\nContent-Disposition: form-data; name="'),o=[],i=!0;return e.forEach(function(e,t){"string"==typeof e?o.push(r+at(it(t))+'"\r\n\r\n'.concat(it(e),"\r\n")):(i&&m("Blob",e)&&(i=!1),o.push(r+at(it(t))+'"; filename="'.concat(at(e.name),'"\r\nContent-Type: ').concat(e.type||"application/octet-stream","\r\n\r\n"),e,"\r\n"))}),o.push("--".concat(n,"--")),new(i?Te:de)(o,{type:"multipart/form-data; boundary="+n})}function it(e){return e.replace(/\r?\n|\r/g,"\r\n")}function at(e){return e.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22")}function ut(e){if(e&&/multipart\/form-data/i.test(e)){var t=e.match(/boundary\s*=\s*([^;]+)/i);if(t&&t[1])return t[1].trim().replace(/^["']|["']$/g,"")}}var st=function(){return"undefined"!=typeof FormData&&FormData||Qe}(),ct=function(){return o(function e(t,r){if(n(this,e),this._type="",r&&(this.type=r),"string"==typeof t)this.promise=Promise.resolve(t),this.type="text/plain;charset=UTF-8",this.calcLength=function(){return fe(t).length};else if(Je(t)){var o=t.toString();this.promise=Promise.resolve(o),this.type="application/x-www-form-urlencoded;charset=UTF-8",this.calcLength=function(){return fe(o).length}}else if(H(t))this.promise=Promise.resolve(t.slice(0)),this.length=t.byteLength;else if(C(t)){var i=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);this.promise=Promise.resolve(i),this.length=i.byteLength}else if(me(t))this.promise=t.arrayBuffer(),this.type=t.type,this.length=t.size;else if(rt(t)){var a=ot(t,r?ut(r):void 0);this.promise=a.arrayBuffer(),this.type=a.type,this.length=a.size}else if(null==t)this.promise=Promise.resolve(""),this.length=0;else{var u=""+t;this.promise=Promise.resolve(u),this.type="text/plain;charset=UTF-8",this.calcLength=function(){return fe(u).length}}},[{key:"type",get:function(){return this._type},set:function(e){this._type||(this._type=e)}},{key:"size",get:function(){var e;return"number"!=typeof this.length&&this.calcLength&&(this.length=this.calcLength()),null!==(e=this.length)&&void 0!==e?e:0}},{key:"text",value:function(){return this.promise.then(function(e){return"string"==typeof e?e:le(e)})}},{key:"arrayBuffer",value:function(){return this.promise.then(function(e){return H(e)?e:fe(e).buffer})}}])}(),lt=function(e){return o(function e(){if(n(this,e),this.constructor===e)throw new TypeError("Failed to construct 'Body': Illegal constructor");v(this,"__Body__",new ht)},[{key:"bodyUsed",get:function(){return dt(this).bodyUsed}},{key:"body",get:function(){throw new TypeError("Failed to access 'body' on '".concat(p(this),"': property not implemented."))}},{key:"arrayBuffer",value:function(){var e="arrayBuffer";return vt(this,e)||pt(this,e)}},{key:"blob",value:function(){var e="blob";return vt(this,e)||pt(this,e)}},{key:"bytes",value:function(){var e="bytes";return vt(this,e)||pt(this,e)}},{key:"formData",value:function(){var e="formData";return vt(this,e)||pt(this,e)}},{key:"json",value:function(){var e="json";return vt(this,e)||pt(this,e)}},{key:"text",value:function(){var e="text";return vt(this,e)||pt(this,e)}},{key:"toString",value:function(){return"[object Body]"}},{key:e,get:function(){return"Body"}},{key:"__MPHTTPX__",get:function(){return{chain:["Body"]}}}])}(l.toStringTag),ht=o(function e(){n(this,e),this.bodyUsed=!1});function dt(e){return e.__Body__}function yt(e,t){var n,r,o=e;if(r="[object ReadableStream]",(n=t)&&"object"===f(n)&&"getReader"in n&&"function"==typeof n.getReader&&(Object.prototype.toString.call(n)===r||g(n)===r))throw new TypeError("Failed to construct '".concat(p(o),"': ReadableStream not implemented."));null!=t&&(dt(o).payload=new ct(t))}function pt(e,t){var n=dt(e).payload||new ct;return"json"===t?n.text().then(function(e){return JSON.parse(e)}):"text"===t?n.text():"arrayBuffer"===t?n.arrayBuffer():"bytes"===t?n.arrayBuffer().then(function(e){return new Uint8Array(e)}):"blob"===t?n.promise.then(function(e){return new Te([e])}):"formData"===t?n.text().then(function(e){return function(e,t){var n=function(){throw new TypeError("Could not parse content as FormData.")};"string"==typeof e&&""!==e.trim()||n();var r=e.indexOf("\r\n");-1===r&&n();var o=e.substring(2,r).trim();o||n(),void 0!==t&&t!==o&&n();var i=e.split("--".concat(o)).filter(function(e){var t=e.trim();return""!==t&&"--"!==t});0===i.length&&n();var a=[],u=!1;i.forEach(function(e){var t=e.indexOf("\r\n\r\n");-1===t&&n();var r=e.substring(0,t).trim(),o=r.match(/name="([^"]*)"/);(!o||o.length<2)&&n();var i=o[1],s=r.match(/filename="([^"]*)"/),c=e.substring(t+4);if(s){var f=s[1]||"",l=r.match(/Content-Type: ([^\r\n]+)/),h=l?(l[1]||"").trim():"text/plain",d=c.replace(/\r\n/g,"");u=!0,a.push([i,new Pe([d],f,{type:h})])}else a.push([i,c.replace(/^[\r\n]+|[\r\n]+$/g,"")])});var s=new(!u||function(){try{var e=new st;return e.append("file",new Pe([],"")),"string"!=typeof e.get("file")}catch(e){return!1}}()?st:Qe);return a.forEach(function(e){s.append(e[0],e[1])}),s}(e,ut(n.type))}):n.promise}function vt(e,t){if(dt(e).payload){if(e.bodyUsed)return Promise.reject(new TypeError("Failed to execute '".concat(t,"' on '").concat(p(e),"': body stream already read")));dt(e).bodyUsed=!0}}var gt=function(e,t){return o(function e(t){if(n(this,e),v(this,"__Headers__",new bt),void 0!==t)if(Et(t))t.forEach(function(e,t){_t(this,t,e,"")}.bind(this),this);else if(T(t))for(var r=Array.isArray(t)?t:Array.from(t),o=0;o<r.length;++o){var i=r[o];if(!T(i))throw new TypeError("Failed to construct 'Headers': The provided value cannot be converted to a sequence.");var a=Array.isArray(i)?i:Array.from(i);if(2!==a.length)throw new TypeError("Failed to construct 'Headers': Invalid value");_t(this,a[0],a[1])}else{if(!t||"object"!==f(t))throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(record<ByteString, ByteString> or sequence<sequence<ByteString>>)'.");Object.getOwnPropertyNames(t).forEach(function(e){_t(this,e,t[e])}.bind(this),this)}},[{key:"append",value:function(e,t){kt(arguments.length,2,"append"),_t(this,e,t,"append")}},{key:"delete",value:function(e){kt(arguments.length,1,"delete"),delete mt(this).dict[wt(e,Tt("delete"))]}},{key:"get",value:function(e){var t;return kt(arguments.length,1,"get"),null!==(t=mt(this).dict[wt(e,Tt("get"))])&&void 0!==t?t:null}},{key:"getSetCookie",value:function(){var e=this.get("Set-Cookie");return e?e.split(", "):[]}},{key:"has",value:function(e){return kt(arguments.length,1,"has"),mt(this).dict.hasOwnProperty(wt(e,Tt("has")))}},{key:"set",value:function(e,t){kt(arguments.length,2,"set"),mt(this).dict[wt(e,Tt("set"))]=St(t)}},{key:"forEach",value:function(e,t){if(kt(arguments.length,1,"forEach"),"function"!=typeof e)throw new TypeError("Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'.");for(var n=mt(this).dict,r=Object.getOwnPropertyNames(n),o=0;o<r.length;++o){var i=r[o];e.call(t,n[i],i,this)}}},{key:"entries",value:function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),k(e)}},{key:"keys",value:function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),k(e.map(function(e){return e[0]}))}},{key:"values",value:function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),k(e.map(function(e){return e[1]}))}},{key:e,value:function(){return this.entries()}},{key:"toString",value:function(){return"[object Headers]"}},{key:t,get:function(){return"Headers"}},{key:"__MPHTTPX__",get:function(){return{chain:["Headers"]}}}])}(l.iterator,l.toStringTag),bt=o(function e(){n(this,e),this.dict={}});function mt(e){return e.__Headers__}function _t(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"constructor",o=wt(t,r?Tt(r):void 0),i=St(n),a=mt(e).dict,u=a[o];a[o]=void 0!==u?"".concat(u,", ").concat(i):i}function Tt(e){return function(){throw new TypeError("Failed to ".concat(e&&"constructor"!==e?"execute '"+e+"' on":"construct"," 'Headers': Invalid name"))}}function kt(e,t,n){E(e,t,"Headers",n)}function Et(e){return m("Headers",e)||function(e){var t="[object Headers]";return!!e&&"object"===f(e)&&"forEach"in e&&"function"==typeof e.forEach&&(Object.prototype.toString.call(e)===t||g(e)===t)}(e)}function wt(e,t){return"string"!=typeof e&&(e=""+e),t&&(/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)&&t(),e.toLowerCase()}function St(e){return"string"==typeof e?e:""+e}function Rt(e){var t=new qt;return e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(e){return 0===e.indexOf("\n")?e.substring(1,e.length):e}).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();try{t.append(r,o)}catch(e){console.warn("SyntaxError: Response.headers: '".concat(r,"' is not a valid HTTP header field name."))}}}),t}function Pt(e){if(m("Headers",e)&&qt!==gt){var t=new qt;return e.forEach(function(e,n){t.append(n,e)}),t}return new qt(e)}var qt=function(){return"undefined"!=typeof Headers&&Headers||gt}(),At=function(e,r){function i(e,r){var o;n(this,i),E(arguments.length,1,"Request"),v(o=t(this,i),"__Request__",new xt);var a=Ht(o),u=null!=r?r:{};if("object"!==f(u))throw new TypeError("Failed to construct 'Request': The provided value is not of type 'RequestInit'.");var s,c=u.body,l=!1;if(m("Request",s=e)||function(e){var t="[object Request]";return!!e&&"object"===f(e)&&"arrayBuffer"in e&&"function"==typeof e.arrayBuffer&&(Object.prototype.toString.call(e)===t||g(e)===t)}(s)){if(e.bodyUsed)throw new TypeError("Failed to construct 'Request': Cannot construct a Request with a Request object that has already been used.");a.cache=e.cache,a.credentials=e.credentials,void 0===u.headers&&(Ht(o).headers=Pt(e.headers)),a.method=e.method,a.mode=e.mode,a.signal=e.signal,a.url=e.url,c||(o.__Body__.payload=Ct(e),l=!0)}else a.url=""+e;if(u.cache&&(a.cache=u.cache),u.credentials&&(a.credentials=u.credentials),void 0!==u.headers&&(Ht(o).headers=Pt(u.headers)),u.method&&(a.method=Mt(u.method)),u.mode&&(a.mode=u.mode),null!==u.signal&&void 0!==u.signal){if(!Y(u.signal))throw new TypeError("Failed to construct 'Request': Failed to read the 'signal' property from 'RequestInit': Failed to convert value to 'AbortSignal'.");a.signal=u.signal}if(("GET"===o.method||"HEAD"===o.method)&&null!=c)throw new TypeError("Failed to construct 'Request': Request with GET/HEAD method cannot have body.");yt(o,l?null:c);var h=o.__Body__.payload;return!o.headers.has("Content-Type")&&h&&h.type&&o.headers.set("Content-Type",h.type),"GET"!==o.method&&"HEAD"!==o.method||"no-cache"!==o.cache&&"no-store"!==o.cache||function(e){var t=/([?&])_=[^&]*/;if(t.test(e.url))Ht(e).url=e.url.replace(t,"$1_="+(new Date).getTime());else{var n=/\?/;Ht(e).url+=(n.test(e.url)?"&":"?")+"_="+(new Date).getTime()}}(o),o}return a(i,e),o(i,[{key:"cache",get:function(){return Ht(this).cache}},{key:"credentials",get:function(){return Ht(this).credentials}},{key:"destination",get:function(){return""}},{key:"headers",get:function(){return Ht(this).headers||(Ht(this).headers=new qt),Ht(this).headers}},{key:"integrity",get:function(){return""}},{key:"keepalive",get:function(){return!1}},{key:"method",get:function(){return Ht(this).method}},{key:"mode",get:function(){return Ht(this).mode}},{key:"redirect",get:function(){return"follow"}},{key:"referrer",get:function(){return Ht(this).referrer}},{key:"referrerPolicy",get:function(){return""}},{key:"signal",get:function(){return Ht(this).signal||(Ht(this).signal=(new ce).signal),Ht(this).signal}},{key:"url",get:function(){return Ht(this).url}},{key:"clone",value:function(){if(this.bodyUsed)throw new TypeError("Failed to execute 'clone' on 'Request': Request body is already used");var e=new i(this);return this.__Body__.bodyUsed=!1,e}},{key:"toString",value:function(){return"[object Request]"}},{key:r,get:function(){return"Request"}},{key:"__MPHTTPX__",get:function(){return{chain:["Request","Body"]}}}])}(lt,l.toStringTag),xt=o(function e(){n(this,e),this.cache="default",this.credentials="same-origin",this.method="GET",this.mode="cors",this.referrer="about:client",this.url=""});function Ht(e){return e.__Request__}function Ct(e){var t=Object.create(ct.prototype);t.type=e.headers.get("Content-Type")||"";try{t.promise=e.arrayBuffer()}catch(n){try{t.promise=e.text()}catch(n){if("multipart/form-data"===t.type.slice(0,19).toLowerCase())try{t.promise=e.formData().then(function(e){return new ct(e,t.type).promise})}catch(e){}}}if(!t.promise)throw new TypeError("Failed to construct 'Request': Failed to read request body data, underlying data is in an invalid format.");return t}var Lt=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function Mt(e){var t=e.toUpperCase();return Lt.indexOf(t)>-1?t:e}var jt=function(){return"undefined"!=typeof Request&&Request||At}(),Ot=function(e,r){function i(e,r){var o;n(this,i),v(o=t(this,i),"__Response__",new Ft);var a=Bt(o),u=null!=r?r:{};if("object"!==f(u))throw new TypeError("Failed to construct 'Response': The provided value is not of type 'ResponseInit'.");void 0!==u.headers&&(Bt(o).headers=Pt(u.headers));var s=void 0===u.status?200:u.status;if(s<200||s>599)throw new RangeError("Failed to construct 'Response': The status provided (".concat(+s,") is outside the range [200, 599]."));a.status=s,a.statusText=void 0===u.statusText?"":""+u.statusText,yt(o,e);var c=o.__Body__.payload;return!o.headers.has("Content-Type")&&c&&c.type&&o.headers.set("Content-Type",c.type),o}return a(i,e),o(i,[{key:"headers",get:function(){return Bt(this).headers||(Bt(this).headers=new qt),Bt(this).headers}},{key:"ok",get:function(){return this.status>=200&&this.status<300}},{key:"redirected",get:function(){return!1}},{key:"status",get:function(){return Bt(this).status}},{key:"statusText",get:function(){return Bt(this).statusText}},{key:"type",get:function(){return Bt(this).type}},{key:"url",get:function(){return Bt(this).url}},{key:"clone",value:function(){if(this.bodyUsed)throw new TypeError("Failed to execute 'clone' on 'Response': Response body is already used");var e=new i(null,{headers:Pt(this.headers),status:this.status,statusText:this.statusText});return Bt(e).url=this.url,e.__Body__.payload=this.__Body__.payload,e}},{key:"toString",value:function(){return"[object Response]"}},{key:r,get:function(){return"Response"}},{key:"__MPHTTPX__",get:function(){return{chain:["Response","Body"]}}}],[{key:"json",value:function(e,t){E(arguments.length,1,"Response","json");var n=new i("string"==typeof e?e:JSON.stringify(e),t);return n.headers.set("Content-Type","application/json"),n}},{key:"error",value:function(){var e=new i(null,{status:200,statusText:""});return Bt(e).status=0,Bt(e).type="error",e}},{key:"redirect",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:302;if(E(arguments.length,1,"Response","redirect"),-1===[301,302,303,307,308].indexOf(t))throw new RangeError("Failed to execute 'redirect' on 'Response': Invalid status code");return new i(null,{status:t,headers:{location:""+e}})}}])}(lt,l.toStringTag),Ft=o(function e(){n(this,e),this.status=200,this.statusText="",this.type="default",this.url=""});function Bt(e){return e.__Response__}var Dt=function(){return"undefined"!=typeof Response&&Response||Ot}(),Ut={XMLHttpRequest:function(){return"undefined"!=typeof XMLHttpRequest&&XMLHttpRequest||void 0}()};function Nt(e){Ut.XMLHttpRequest=e}var Xt={value:!1};function It(e,t){if(this instanceof It)throw new TypeError("fetch is not a constructor");return E(arguments.length,1,"globalThis","fetch"),new Promise(function(n,r){var o=new At(e,t),i=o.__Request__.signal;if(i&&i.aborted)return r(i.reason);var a,u,s=new(Ut.XMLHttpRequest||function(){throw new ReferenceError("XMLHttpRequest is not defined")}()),c=!1,l=o.__Body__.payload;if(s.onload=function(){var e={headers:Rt(s.getAllResponseHeaders()||""),status:s.status,statusText:s.statusText};0===o.url.indexOf("file://")&&(s.status<200||s.status>599)&&(e.status=200),setTimeout(function(){(a=new Ot("response"in s?s.response:s.responseText,e)).__Response__.url="responseURL"in s?s.responseURL:e.headers.get("X-Request-URL")||"";var t=a.__Body__.payload,o=a.headers.get("Content-Type")||"";t&&o&&(t.type=o),c?r(zt()):n(a)},0)},s.onabort=function(){setTimeout(function(){r(zt())},0)},s.onerror=function(){setTimeout(function(){r(new TypeError("Failed to fetch"))},0)},s.ontimeout=function(){setTimeout(function(){r(new y("The request timed out.","TimeoutError"))},0)},s.open(o.method,""===(u=o.url)&&Gt&&(null===location||void 0===location?void 0:location.href)?location.href:u,!0),"include"===o.credentials?s.withCredentials=!0:"omit"===o.credentials&&(s.withCredentials=!1),"responseType"in s&&(s.responseType="arraybuffer"),t&&"object"===f(t)&&t.headers&&"object"===f(t.headers)&&!Et(t.headers)){var h=t.headers,d=[];Object.getOwnPropertyNames(h).forEach(function(e){d.push(wt(e)),s.setRequestHeader(e,St(h[e]))}),o.headers.forEach(function(e,t){-1===d.indexOf(t)&&s.setRequestHeader(t,e)})}else o.headers.forEach(function(e,t){s.setRequestHeader(t,e)});if(i){var p=function(){a&&!a.bodyUsed&&((a.__Body__.payload=new ct).promise=Promise.reject(zt()));c=!0,s.abort(),v()},v=function(){i.removeEventListener("abort",p)};i.addEventListener("abort",p),s.onreadystatechange=function(){4===s.readyState&&v()}}l?l.promise.then(function(e){c?r(zt()):s.send(""!==e?Wt(e):void 0)}).catch(function(e){r(new TypeError("Failed to fetch")),console.error(e)}):s.send()})}function zt(){return new y("The user aborted a request.","AbortError")}var Gt=function(){return"undefined"!=typeof location&&!!location}();function Wt(e){return Xt.value&&"string"!=typeof e?le(e):e}var Vt=function(){return"undefined"!=typeof fetch&&fetch||It}(),Jt={value:!1};function Yt(e){var t=e||"undefined"!=typeof fetch&&fetch;if(!t||t===It)return It;if("__MPHTTPX__Polyfill__"in t)return t;function n(e,t){if(e.headers){if((l=e.headers)&&"object"===f(l)&&"has"in l&&"function"==typeof l.has&&"set"in l&&"function"==typeof l.set)e.headers.has("Content-Type")||e.headers.set("Content-Type",t);else if(T(e.headers)){for(var n=!1,r=Array.isArray(e.headers)?e.headers:Array.from(e.headers),o=0;o<r.length;++o){var i=r[o];if(T(i)){var a=Array.isArray(i)?i:Array.from(i);if(a.length>=2&&"content-type"===String(a[0]).toLowerCase()){n=!0;break}}}n||(r.push(["Content-Type",t]),e.headers=r)}else if("object"===f(e.headers)){for(var u=!1,s=Object.getOwnPropertyNames(e.headers),c=0;c<s.length;++c){if("content-type"===s[c].toLowerCase()){u=!0;break}}u||(e.headers["Content-Type"]=t)}}else e.headers={"Content-Type":t};var l}function r(e){return!!e&&"object"===f(e)&&"signal"in e&&Y(e.signal)&&e.signal}function o(e,o){if(m("Request",e)){var i=e,a=null!=o?o:{};"object"!==f(a)&&(a={}),a.method||(a.method=i.method),a.headers||(a.headers=i.headers),a.mode||(a.mode=i.mode),a.cache||(a.cache=i.cache),a.credentials||(a.credentials=i.credentials),!a.signal&&i.__Request__.signal&&(a.signal=i.signal),a.body||(a.body=Ct(i)),e=i.url,o=a}if(o&&o.headers&&m("Headers",o.headers))if("undefined"!=typeof Headers&&Headers&&!("__MPHTTPX__"in Headers.prototype)){var u=new Headers;o.headers.forEach(function(e,t){u.append(t,e)}),o.headers=u}else{var s={};o.headers.forEach(function(e,t){s[t]=e}),o.headers=s}return new Promise(function(i,a){o&&o.body&&(Jt.value?rt(o.body):m("FormData",o.body))&&(o.body=ot(o.body));var u=o&&o.body&&((Jt.value?me(o.body):m("Blob",o.body))&&new ct(o.body)||ct.prototype.isPrototypeOf(o.body)&&o.body);if(u){u.type&&n(o,u.type);var s=r(o)||r(e),c=null,f=!1,l=!0;if(s){var h=function(){l&&(f=!0),c()};c=function(){s.removeEventListener("abort",h)},s.addEventListener("abort",h)}u.promise.then(function(n){o.body=""!==n?Wt(n):null,f?a(new y("The user aborted a request.","AbortError")):i(t.call(this,e,o)),l=!1}.bind(this)).catch(function(e){a(new TypeError("Failed to fetch")),l=!1,console.error(e)}).then(function(){c&&c()})}else o&&o.body&&(Jt.value?Je(o.body):m("URLSearchParams",o.body))&&(n(o,"application/x-www-form-urlencoded;charset=UTF-8"),o.body=o.body.toString()),i(t.call(this,e,o))}.bind(this))}return o.__MPHTTPX__Polyfill__=!0,o}function Qt(e){var t=e||"undefined"!=typeof XMLHttpRequest&&XMLHttpRequest;if(t&&!("__MPHTTPX__Polyfill__"in t)&&!("__MPHTTPX__"in t.prototype)){var r=t.prototype.abort,i=t.prototype.open,a=t.prototype.send,u=t.prototype.setRequestHeader;t.prototype.abort=function(){c(this).processing&&(c(this).aborted=!0),r.call(this),c(this).hasContentType=!1},t.prototype.open=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;c(this).processing&&(c(this).aborted=!0),i.call(this,e,t,n,r,o),c(this).hasContentType=!1},t.prototype.send=function(e){if((Jt.value?rt(e):m("FormData",e))&&(e=ot(e),c(this).hasContentType||this.setRequestHeader("Content-Type",e.type)),Jt.value?me(e):m("Blob",e)){var t=new ct(e);t.type&&!c(this).hasContentType&&this.setRequestHeader("Content-Type",t.type);var n=this.withCredentials;c(this).processing=!0,t.promise.then(function(e){c(this).aborted||(n!==this.withCredentials&&(this.withCredentials=n,console.warn("Illegal to set the 'withCredentials' property on 'XMLHttpRequest': The value may only be set if the object's state is UNSENT or OPENED.")),a.call(this,""!==e?Wt(e):void 0)),c(this).aborted=!1,c(this).processing=!1}.bind(this)).catch(function(e){c(this).aborted=!1,c(this).processing=!1,console.error(e)}.bind(this))}else(Jt.value?Je(e):m("URLSearchParams",e))&&(c(this).hasContentType||this.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8"),e=e.toString()),a.call(this,e)},t.prototype.setRequestHeader=function(e,t){if(c(this).processing)throw new y("Failed to execute 'setRequestHeader' on 'XMLHttpRequest': The object's state must be OPENED.","InvalidStateError");u.call(this,e,t),"content-type"===String(e).toLowerCase()&&(c(this).hasContentType=!0)},t.__MPHTTPX__Polyfill__=!0;var s=o(function e(){n(this,e),this.aborted=!1,this.processing=!1,this.hasContentType=!1})}function c(e){var t="__XMLHttpRequest_Polyfill__";return t in e||v(e,t,new s),e[t]}}function $t(e){var t=e||"undefined"!=typeof WebSocket&&WebSocket;if(t&&!("__MPHTTPX__Polyfill__"in t)&&!("__MPHTTPX__"in t.prototype)){var n=t.prototype.send;t.prototype.send=function(e){if(Jt.value?me(e):m("Blob",e)){if(0===this.readyState)throw new y("Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.","InvalidStateError");if(2===this.readyState||3===this.readyState)return console.error("WebSocket is already in CLOSING or CLOSED state.");e.arrayBuffer().then(function(e){1===this.readyState&&n.call(this,e)}.bind(this))}else n.call(this,e)},t.__MPHTTPX__Polyfill__=!0}}var Kt={value:null};function Zt(e){return!!e&&"object"===f(e)&&"function"==typeof(null==e?void 0:e.request)}function en(){if(null!==Kt.value)return Kt.value;var e="undefined";return Kt.value=("undefined"==typeof wx?"undefined":f(wx))!==e&&Zt(wx)&&{mp:wx,name:"WeChat"}||("undefined"==typeof my?"undefined":f(my))!==e&&Zt(my)&&{mp:my,name:"Alipay"}||("undefined"==typeof qq?"undefined":f(qq))!==e&&Zt(qq)&&{mp:qq,name:"QQ"}||("undefined"==typeof jd?"undefined":f(jd))!==e&&Zt(jd)&&{mp:jd,name:"JD"}||("undefined"==typeof swan?"undefined":f(swan))!==e&&Zt(swan)&&{mp:swan,name:"Baidu"}||("undefined"==typeof tt?"undefined":f(tt))!==e&&Zt(tt)&&{mp:tt,name:"ByteDance"}||("undefined"==typeof ks?"undefined":f(ks))!==e&&Zt(ks)&&{mp:ks,name:"Kwai"}||("undefined"==typeof qh?"undefined":f(qh))!==e&&Zt(qh)&&{mp:qh,name:"Qihu"}||("undefined"==typeof xhs?"undefined":f(xhs))!==e&&Zt(xhs)&&{mp:xhs,name:"RedNote"}||("undefined"==typeof dd?"undefined":f(dd))!==e&&(Zt(dd)||"function"==typeof(null===dd||void 0===dd?void 0:dd.httpRequest))&&{mp:dd,name:"DingTalk"}||("undefined"==typeof bl?"undefined":f(bl))!==e&&Zt(bl)&&{mp:bl,name:"BiliBili"}||("undefined"==typeof ft?"undefined":f(ft))!==e&&Zt(ft)&&{mp:ft,name:"FinClip"}||("undefined"==typeof has?"undefined":f(has))!==e&&Zt(has)&&{mp:has,name:"HarmonyASCF"}||("undefined"==typeof uni?"undefined":f(uni))!==e&&Zt(uni)&&{mp:uni,name:"UniApp"}||("undefined"==typeof Taro?"undefined":f(Taro))!==e&&Zt(Taro)&&{mp:Taro,name:"Taro"}||void 0,Kt.value}var tn=en();function nn(){return function(e){var t=e&&(e.mp.request||e.mp.httpRequest);return"function"==typeof t?t.bind(e.mp):t}(tn)||function(e){var t="NOT_SUPPORTED_ERR",n={errMsg:t,errno:9,exception:{retryCount:0,reasons:[{errMsg:t,errno:9}]},useHttpDNS:!1};throw Promise.resolve(n).then(function(t){try{e.fail&&e.fail(t)}catch(e){console.error(e)}e.complete&&e.complete(t)}),new ReferenceError("request is not defined")}}var rn={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Content Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"},on=function(e,r){function i(){var e;if(n(this,i),(e=t(this,i)).constructor===i)throw new TypeError("Failed to construct 'XMLHttpRequestEventTarget': Illegal constructor");return v(e,"__XMLHttpRequestEventTarget__",new an(e)),e}return a(i,e),o(i,[{key:"onabort",get:function(){return un(this).onabort},set:function(e){un(this).onabort=e,un(this).attach("abort")}},{key:"onerror",get:function(){return un(this).onerror},set:function(e){un(this).onerror=e,un(this).attach("error")}},{key:"onload",get:function(){return un(this).onload},set:function(e){un(this).onload=e,un(this).attach("load")}},{key:"onloadend",get:function(){return un(this).onloadend},set:function(e){un(this).onloadend=e,un(this).attach("loadend")}},{key:"onloadstart",get:function(){return un(this).onloadstart},set:function(e){un(this).onloadstart=e,un(this).attach("loadstart")}},{key:"onprogress",get:function(){return un(this).onprogress},set:function(e){un(this).onprogress=e,un(this).attach("progress")}},{key:"ontimeout",get:function(){return un(this).ontimeout},set:function(e){un(this).ontimeout=e,un(this).attach("timeout")}},{key:"toString",value:function(){return"[object XMLHttpRequestEventTarget]"}},{key:r,get:function(){return"XMLHttpRequestEventTarget"}},{key:"__MPHTTPX__",get:function(){return{chain:["XMLHttpRequestEventTarget","EventTarget"]}}}])}(X,l.toStringTag),an=o(function e(t){var r;n(this,e),this.onabort=null,this.onerror=null,this.onload=null,this.onloadend=null,this.onloadstart=null,this.onprogress=null,this.ontimeout=null,this.attach=V(t,(r=t,{onabort:function(e){J(r,r.onabort,e)},onerror:function(e){J(r,r.onerror,e)},onload:function(e){J(r,r.onload,e)},onloadend:function(e){J(r,r.onloadend,e)},onloadstart:function(e){J(r,r.onloadstart,e)},onprogress:function(e){J(r,r.onprogress,e)},ontimeout:function(e){J(r,r.ontimeout,e)}}))});function un(e){return e.__XMLHttpRequestEventTarget__}var sn=function(e,r){function i(){var e;if(n(this,i),(e=t(this,i)).constructor===i)throw new TypeError("Failed to construct 'XMLHttpRequestUpload': Illegal constructor");return e}return a(i,e),o(i,[{key:"toString",value:function(){return"[object XMLHttpRequestUpload]"}},{key:r,get:function(){return"XMLHttpRequestUpload"}},{key:"__MPHTTPX__",get:function(){return{chain:["XMLHttpRequestUpload","XMLHttpRequestEventTarget","EventTarget"]}}}])}(on,l.toStringTag);var cn={request:nn()};var fn={get:null,set:null};var ln=function(e,r){function i(){var e;return n(this,i),v(e=t(this,i),"__XMLHttpRequest__",new hn(e)),e}return a(i,e),o(i,[{key:"UNSENT",get:function(){return 0}},{key:"OPENED",get:function(){return 1}},{key:"HEADERS_RECEIVED",get:function(){return 2}},{key:"LOADING",get:function(){return 3}},{key:"DONE",get:function(){return 4}},{key:"readyState",get:function(){return dn(this).readyState}},{key:"response",get:function(){return dn(this).response}},{key:"responseText",get:function(){return dn(this).responseText}},{key:"responseType",get:function(){return dn(this).responseType},set:function(e){if(dn(this).pos>9)throw new y("Failed to set the 'responseType' property on 'XMLHttpRequest': The response type cannot be set if the object's state is LOADING or DONE.","InvalidStateError");pn.indexOf(e)>-1&&(dn(this).responseType=e)}},{key:"responseURL",get:function(){return dn(this).responseURL}},{key:"responseXML",get:function(){return null}},{key:"status",get:function(){return dn(this).status}},{key:"statusText",get:function(){return dn(this).pos<9?"":dn(this).statusText||rn[this.status]||"unknown"}},{key:"timeout",get:function(){return dn(this).timeout},set:function(e){dn(this).timeout=e>=0?e:0}},{key:"upload",get:function(){var e;return dn(this).upload||(dn(this).upload=(v(e=Object.create(sn.prototype),"__EventTarget__",{executors:[]}),v(e,"__XMLHttpRequestEventTarget__",new an(e)),e)),dn(this).upload}},{key:"withCredentials",get:function(){return dn(this).withCredentials},set:function(e){if(!(dn(this).pos<2))throw new TypeError("Failed to set the 'withCredentials' property on 'XMLHttpRequest': The value may only be set if the object's state is UNSENT or OPENED.");dn(this).withCredentials=!!e}},{key:"abort",value:function(){var e=dn(this),t=e.requestTask;switch(e.pos){case 1:e.requestHeaders=new qt;break;case 2:case 3:!function(e){dn(e).pos=5,Tn(e,4),dn(e).upload&&Ce(e.upload,"abort");wn(e,"abort")}(this),En(this);break;case 4:case 8:case 9:case 10:Sn(this);case 11:En(this)}gn(e),kn(t)}},{key:"getAllResponseHeaders",value:function(){var e=dn(this).responseHeaders;if(!e)return"";var t=[];return e.forEach(function(e,n){t.push("".concat(n,": ").concat(e,"\r\n"))}),t.join("")}},{key:"getResponseHeader",value:function(e){return E(arguments.length,1,"XMLHttpRequest","getResponseHeader"),dn(this).responseHeaders?dn(this).responseHeaders.get(e):null}},{key:"open",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;E(arguments.length,2,"XMLHttpRequest","open"),n||console.warn("Synchronous XMLHttpRequest is not supported because of its detrimental effects to the end user's experience.");var i,a=Mt(e),u=""+t,s=""+(null!=r?r:""),c=""+(null!=o?o:""),f=dn(this);if(gn(f),f.method=a,f.requestURL=u,f.requestHeaders=new qt,s.length>0||c.length>0){var l="Basic ".concat(De(fe(s+":"+c)));this.setRequestHeader("Authorization",l)}dn(i=this).pos=1,dn(i).requestId+=1,Tn(i,1)}},{key:"overrideMimeType",value:function(e){E(arguments.length,1,"XMLHttpRequest","overrideMimeType"),1===dn(this).pos&&console.error("TypeError: Failed to execute 'overrideMimeType' on 'XMLHttpRequest': mimeType ('".concat(e,"') not implemented."))}},{key:"send",value:function(e){var t=dn(this),n=t.requestId;if(1!==t.pos)throw new y("Failed to execute 'send' on 'XMLHttpRequest': The object's state must be OPENED.","InvalidStateError");var r={url:t.requestURL,method:t.method,header:yn(t.requestHeaders),dataType:"json"===this.responseType?"json":vn(this.responseType),responseType:vn(this.responseType),withCredentials:this.withCredentials,success:mn.bind(this,n),fail:_n.bind(this,n)};if(fn.get&&!t.requestHeaders.has("cookie")){var o=fn.get(r.url,this.withCredentials);o&&(r.enableCookie=!0,r.header.Cookie=o)}var i="GET"!==t.method&&"HEAD"!==t.method&&null!=e&&new ct(e);i&&i.type&&!t.requestHeaders.has("Content-Type")&&(r.header["Content-Type"]=i.type);var a=function(e){n===t.requestId&&(2!==t.pos&&8!==t.pos||(r.headers=r.header,r.data=e?Wt(e):void 0,t.requestTask=cn.request(r)))}.bind(this);!function(e){if(!e.timeout)return;var t=dn(e),n=function(){switch(t.pos){case 2:case 3:!function(e){dn(e).pos=7,Tn(e,4),dn(e).upload&&Ce(e.upload,"timeout");wn(e,"timeout")}(e);break;case 8:Pn(e)}};t.timeoutId=setTimeout(function(){var e=t.requestTask;n(),kn(e)},e.timeout)}(this);var u=function(e,t){return dn(e).pos=2,Ce(e,"loadstart"),t&&function(e,t){var n=dn(e),r=n.requestId;if(2!==n.pos)return;n.pos=3,n.upload&&Ce(e.upload,"loadstart",0,t.size);return t.promise.then(function(o){if(r===n.requestId)return function(e,t,n){var r=dn(e);if(3!==r.pos)return;r.pos=4,r.upload&&t.size>0&&Ce(e.upload,"load",t.size,t.size);return wn(e,"load",{payload:t,data:n})}(e,t,o)}).catch(function(t){r===n.requestId&&(!function(e){var t=dn(e);if(3!==t.pos)return;t.pos=6,Tn(e,4),t.upload&&Ce(e.upload,"error");wn(e,"error")}(e),console.error(t))})}(e,t)}(this,i||void 0);u?u.then(function(e){void 0!==e&&a(e)}):a()}},{key:"setRequestHeader",value:function(e,t){if(E(arguments.length,2,"XMLHttpRequest","setRequestHeader"),1!==dn(this).pos)throw new y("Failed to execute 'setRequestHeader' on 'XMLHttpRequest': The object's state must be OPENED.","InvalidStateError");var n=""+e,r=""+t;try{dn(this).requestHeaders.append(n,r)}catch(e){throw new SyntaxError("Failed to execute 'setRequestHeader' on 'XMLHttpRequest': '".concat(n,"' is not a valid HTTP header field name."))}}},{key:"onreadystatechange",get:function(){return dn(this).onreadystatechange},set:function(e){dn(this).onreadystatechange=e,dn(this).attach("readystatechange")}},{key:"toString",value:function(){return"[object XMLHttpRequest]"}},{key:r,get:function(){return"XMLHttpRequest"}},{key:"__MPHTTPX__",get:function(){return{chain:["XMLHttpRequest","XMLHttpRequestEventTarget","EventTarget"]}}}],[{key:"UNSENT",get:function(){return 0}},{key:"OPENED",get:function(){return 1}},{key:"HEADERS_RECEIVED",get:function(){return 2}},{key:"LOADING",get:function(){return 3}},{key:"DONE",get:function(){return 4}}])}(on,l.toStringTag),hn=o(function e(t){var r;n(this,e),this.pos=0,this.readyState=0,this.response="",this.responseText="",this.responseType="",this.responseURL="",this.status=0,this.statusText="",this.timeout=0,this.withCredentials=!1,this.method="GET",this.requestURL="",this.requestHeaders=null,this.responseHeaders=null,this.timeoutId=0,this.requestId=0,this.requestTask=null,this.onreadystatechange=null,this.attach=V(t,(r=t,{onreadystatechange:function(e){J(r,r.onreadystatechange,e)}}))});function dn(e){return e.__XMLHttpRequest__}function yn(e){var t={};return e.forEach(function(e,n){t[n]=e}),t}var pn=["","arraybuffer","blob","document","json","text"];function vn(e){return"blob"===e||"arraybuffer"===e?"arraybuffer":"text"}function gn(e){e.requestTask=null,bn(e),e.response="",e.responseText="",e.responseURL="",e.status=0,e.statusText="",e.requestHeaders=null,e.responseHeaders=null}function bn(e){e.timeoutId&&(clearTimeout(e.timeoutId),e.timeoutId=0)}function mn(e,t){e===dn(this).requestId&&function(e,t){var n=dn(e);if(2!==n.pos&&8!==n.pos)return;if(n.pos=9,n.responseURL=n.requestURL,n.status="statusCode"in t?t.statusCode:"status"in t?t.status:200,n.responseHeaders=new qt("header"in t?t.header:"headers"in t?t.headers:{}),fn.set){var r="cookies"in t&&Array.isArray(t.cookies)?t.cookies:n.responseHeaders.get("Set-Cookie")||"";r.length>0&&fn.set(e.responseURL,e.withCredentials,r)}Tn(e,2),function(e,t){if(9!==dn(e).pos)return;dn(e).pos=10,Tn(e,3),function(e,t){var n=dn(e);if(10!==n.pos)return;n.pos=11;var r=function(){var r;n.response=function(e,t){var n="string"==typeof t||H(t)?t:JSON.stringify(t);switch(e){case"":case"text":return"string"==typeof n?n:le(n);case"arraybuffer":return H(n)?n:fe(n).buffer;case"json":return"string"==typeof t?JSON.parse(t):H(t)?JSON.parse(le(t)):t;case"blob":return new Te([n]);default:return n}}(e.responseType,null!==(r=t.data)&&void 0!==r?r:""),e.responseType&&"text"!==e.responseType||(n.responseText=e.response),Tn(e,4),function(e){var t=dn(e);if(11!==t.pos)return;t.pos=12;var n=t.responseHeaders.get("Content-Length"),r=n&&parseInt(n)||0;Ce(e,"load",r,r),qn(e,r)}(e)};try{r()}catch(t){Rn(e),console.error(t)}}(e,t)}(e,t)}(this,t)}function _n(e,t){if("header"in t&&"statusCode"in t||"headers"in t&&"status"in t)return mn.call(this,e,{statusCode:"statusCode"in t?t.statusCode:t.status||0,header:"header"in t?t.header:t.headers||{},data:"data"in t&&t.data||""});e===dn(this).requestId&&Rn(this,t)}function Tn(e,t){if(e.readyState!==t){dn(e).readyState=t;var n=new M("readystatechange");n.__Event__.target=e,U(n,!0),W(e,n)}}function kn(e){e&&"object"===f(e)&&"abort"in e&&"function"==typeof e.abort&&e.abort()}function En(e){dn(e).pos=0,dn(e).readyState=0}function wn(e,t,n){var r=dn(e);if(("load"===t&&4===r.pos||"load"!==t)&&(r.pos=8),r.upload){var o=n?n.payload.size:0;Ce(e.upload,"loadend",o,o)}switch(t){case"load":return n&&n.data;case"abort":Sn(e);break;case"error":Rn(e);break;case"timeout":Pn(e)}}function Sn(e){dn(e).pos=13,Tn(e,4),Ce(e,"abort"),qn(e)}function Rn(e,t){var n=dn(e);switch(n.pos){case 2:case 8:case 11:break;default:return}n.pos=14,t&&(n.status=0,n.statusText="errMsg"in t?t.errMsg:"errorMessage"in t?t.errorMessage:""),Tn(e,4),Ce(e,"error"),qn(e)}function Pn(e){dn(e).pos=15,Tn(e,4),Ce(e,"timeout"),qn(e)}function qn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=dn(e);n.pos=16,n.requestTask=null,bn(n),Ce(e,"loadend",t,t)}var An=function(){return"undefined"!=typeof XMLHttpRequest&&XMLHttpRequest||ln}(),xn=function(){return Nt(An),[Vt,It]}(),Hn=function(){return xn[0]}(),Cn=function(){return xn[1]}(),Ln=function(e,r){function i(e,r){var o;n(this,i),v(o=t(this,i,[e,r]),"__CloseEvent__",new Mn);var a=jn(o),u=Number(null==r?void 0:r.code);return a.code=isNaN(u)?0:u,void 0!==(null==r?void 0:r.reason)&&(a.reason=""+r.reason),a.wasClean=!!(null==r?void 0:r.wasClean),o}return a(i,e),o(i,[{key:"code",get:function(){return jn(this).code}},{key:"reason",get:function(){return jn(this).reason}},{key:"wasClean",get:function(){return jn(this).wasClean}},{key:"toString",value:function(){return"[object CloseEvent]"}},{key:r,get:function(){return"CloseEvent"}},{key:"__MPHTTPX__",get:function(){return{chain:["CloseEvent","Event"]}}}])}(M,l.toStringTag),Mn=o(function e(){n(this,e),this.code=0,this.reason="",this.wasClean=!1});function jn(e){return e.__CloseEvent__}var On=function(e,r){function i(e,r){var o,a;n(this,i),v(o=t(this,i,[e,r]),"__MessageEvent__",new Fn);var u=Bn(o);return u.data=null!==(a=null==r?void 0:r.data)&&void 0!==a?a:null,void 0!==(null==r?void 0:r.origin)&&(u.origin=""+r.origin),void 0!==(null==r?void 0:r.lastEventId)&&(u.lastEventId=""+r.lastEventId),void 0!==(null==r?void 0:r.source)&&(u.source=r.source),void 0!==(null==r?void 0:r.ports)&&(u.ports=r.ports),o}return a(i,e),o(i,[{key:"data",get:function(){return Bn(this).data}},{key:"lastEventId",get:function(){return Bn(this).lastEventId}},{key:"origin",get:function(){return Bn(this).origin}},{key:"ports",get:function(){return Bn(this).ports}},{key:"source",get:function(){return Bn(this).source}},{key:"initMessageEvent",value:function(e,t,n,r,o,i,a,u){if(E(arguments.length,1,"MessageEvent","initMessageEvent"),!this.__Event__.eventDispatched){this.initEvent(e,t,n);var s=Bn(this);s.data=null!=r?r:null,void 0!==o&&(s.origin=""+o),void 0!==i&&(s.lastEventId=""+i),void 0!==a&&(s.source=a),void 0!==u&&(s.ports=Array.from(u))}}},{key:"toString",value:function(){return"[object MessageEvent]"}},{key:r,get:function(){return"MessageEvent"}},{key:"__MPHTTPX__",get:function(){return{chain:["MessageEvent","Event"]}}}])}(M,l.toStringTag),Fn=o(function e(){n(this,e),this.data=null,this.lastEventId="",this.origin="",this.ports=[],this.source=null});function Bn(e){return e.__MessageEvent__}var Dn=en();function Un(){return function(e){var t=e&&e.mp.connectSocket;return"function"==typeof t?t.bind(e.mp):t}(Dn)||function(e){return{send:function(e){},close:function(e){},onOpen:function(e){},onMessage:function(e){},onError:function(e){"function"==typeof e&&(e({errMsg:"NOT_SUPPORTED_ERR",errno:9}),setTimeout(function(){throw new ReferenceError("connectSocket is not defined")},0))},onClose:function(e){"function"==typeof e&&setTimeout(function(){e({code:3009,reason:"NOT_SUPPORTED_ERR"})},0)}}}}var Nn={connectSocket:Un()};var Xn=function(e,r){function i(e,r){var o;n(this,i),E(arguments.length,1,"WebSocket"),o=t(this,i);var a=""+e,u={url:a,multiple:!0,fail:function(e){console.error(e)}};void 0!==r&&(u.protocols=T(r)?Array.isArray(r)?r:Array.from(r):[""+r]);var s,c,l=Nn.connectSocket(u);if(v(o,"__WebSocket__",new In(o,l)),zn(o).url=a,!l||"object"!==f(l))throw new Error("connectSocket can't establish a connection to the server at ".concat(a,"."));return(c=zn(s=o)).socketTask.onOpen(function(e){if("header"in e&&e.header&&"object"===f(e.header)){var t=new qt(e.header);c.protocol=t.get("Sec-WebSocket-Protocol")||""}c.readyState=1,Gn(s,"open")}),function(e){var t=zn(e);t.socketTask.onClose(function(n){t.readyState=3;var r=new Ln("close",{wasClean:!t.error,code:n.code,reason:n.reason});U(r,!0),W(e,r)})}(o),function(e){var t=zn(e);t.socketTask.onError(function(n){t.error=n,t.readyState=3,Gn(e,"error"),console.error(n)})}(o),function(e){zn(e).socketTask.onMessage(function(t){var n,r=t.data;if(r&&"object"===f(r)&&"data"in r){if(n=r.data,"isBuffer"in r&&r.isBuffer&&"string"==typeof n)try{n=Dn.mp.base64ToArrayBuffer(n)}catch(e){}}else n=r;H(n)&&"blob"===e.binaryType&&(n=new Te([n]));var o=new On("message",{data:n,origin:e.url});U(o,!0),W(e,o)})}(o),o}return a(i,e),o(i,[{key:"CONNECTING",get:function(){return 0}},{key:"OPEN",get:function(){return 1}},{key:"CLOSING",get:function(){return 2}},{key:"CLOSED",get:function(){return 3}},{key:"binaryType",get:function(){return zn(this).binaryType},set:function(e){"blob"!==e&&"arraybuffer"!==e||(zn(this).binaryType=e)}},{key:"bufferedAmount",get:function(){return zn(this).bufferedAmount}},{key:"extensions",get:function(){return""}},{key:"protocol",get:function(){return zn(this).protocol}},{key:"readyState",get:function(){return zn(this).readyState}},{key:"url",get:function(){return zn(this).url}},{key:"close",value:function(e,t){var n=zn(this);2!==this.readyState&&3!==this.readyState&&(n.readyState=2,n.socketTask.close({code:e,reason:t,fail:function(e){console.error(e)},complete:function(){n.readyState=3}}))}},{key:"send",value:function(e){if(E(arguments.length,1,"WebSocket","send"),0===this.readyState)throw new y("Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.","InvalidStateError");if(2===this.readyState||3===this.readyState)return console.error("WebSocket is already in CLOSING or CLOSED state.");var t=function(e){1===this.readyState&&zn(this).socketTask.send({data:e,fail:function(e){console.error(e)}})}.bind(this);if("string"!=typeof e&&!H(e)&&!me(e)&&!C(e))return t(e);var n=function(e){return"string"==typeof e?Promise.resolve(e):H(e)?Promise.resolve(e.slice(0)):C(e)?Promise.resolve(e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)):me(e)?e.arrayBuffer():Promise.resolve(""+e)}(e);n.then(function(e){t(e)})}},{key:"onclose",get:function(){return zn(this).onclose},set:function(e){zn(this).onclose=e,zn(this).attach("close")}},{key:"onerror",get:function(){return zn(this).onerror},set:function(e){zn(this).onerror=e,zn(this).attach("error")}},{key:"onmessage",get:function(){return zn(this).onmessage},set:function(e){zn(this).onmessage=e,zn(this).attach("message")}},{key:"onopen",get:function(){return zn(this).onopen},set:function(e){zn(this).onopen=e,zn(this).attach("open")}},{key:"toString",value:function(){return"[object WebSocket]"}},{key:r,get:function(){return"WebSocket"}},{key:"__MPHTTPX__",get:function(){return{chain:["WebSocket","EventTarget"]}}}],[{key:"CONNECTING",get:function(){return 0}},{key:"OPEN",get:function(){return 1}},{key:"CLOSING",get:function(){return 2}},{key:"CLOSED",get:function(){return 3}}])}(X,l.toStringTag),In=o(function e(t,r){var o;n(this,e),this.binaryType="blob",this.bufferedAmount=0,this.protocol="",this.readyState=0,this.url="",this.error=null,this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this.socketTask=r,this.attach=V(t,(o=t,{onclose:function(e){J(o,o.onclose,e)},onerror:function(e){J(o,o.onerror,e)},onmessage:function(e){J(o,o.onmessage,e)},onopen:function(e){J(o,o.onopen,e)}}))});function zn(e){return e.__WebSocket__}function Gn(e,t){var n=new M(t);n.__Event__.target=e,U(n,!0),W(e,n)}var Wn=function(){return"undefined"!=typeof WebSocket&&WebSocket||Xn}(),Vn="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||{};if(!Vn.mp){var Jn=en();Jn&&(Vn.mp=Jn.mp)}Vn.fetch?Vn.Blob&&Vn.FormData||(Vn.fetch=Yt()):(Vn.fetch=Cn,Vn.Headers||(Vn.Headers=gt),Vn.Request||(Vn.Request=At),Vn.Response||(Vn.Response=Ot)),"undefined"!=typeof XMLHttpRequest&&XMLHttpRequest&&(Vn.Blob&&Vn.FormData||Qt()),"undefined"!=typeof WebSocket&&WebSocket&&(Vn.Blob||$t()),Vn.TextEncoder||(Vn.TextEncoder=w),Vn.TextDecoder||(Vn.TextDecoder=q),Vn.EventTarget||(Vn.EventTarget=X,Vn.Event||(Vn.Event=M),Vn.CustomEvent||(Vn.CustomEvent=$)),Vn.AbortController||(Vn.AbortController=ue),Vn.AbortSignal||(Vn.AbortSignal=te),Vn.FileReader||(Vn.FileReader=Le,Vn.Blob||(Vn.Blob=de),Vn.File||(Vn.File=Se)),Vn.URLSearchParams||(Vn.URLSearchParams=Ne),Vn.FormData||(Vn.FormData=Qe),Vn.XMLHttpRequest||(Vn.XMLHttpRequest=ln),Vn.WebSocket||(Vn.WebSocket=Xn),e.AbortController=ce,e.AbortControllerP=ue,e.AbortSignal=ae,e.AbortSignalP=te,e.Blob=Te,e.BlobP=de,e.CustomEvent=ee,e.CustomEventP=$,e.Event=N,e.EventP=M,e.EventTarget=Q,e.EventTargetP=X,e.File=Pe,e.FileP=Se,e.FileReader=Ue,e.FileReaderP=Le,e.FormData=st,e.FormDataP=Qe,e.Headers=qt,e.HeadersP=gt,e.Request=jt,e.RequestP=At,e.Response=Dt,e.ResponseP=Ot,e.TextDecoder=L,e.TextDecoderP=q,e.TextEncoder=R,e.TextEncoderP=w,e.URLSearchParams=Ye,e.URLSearchParamsP=Ne,e.WebSocket=Wn,e.WebSocketP=Xn,e.XMLHttpRequest=An,e.XMLHttpRequestP=ln,e.fetch=Hn,e.fetchP=Cn,e.fixFetch=Yt,e.fixWebSocket=$t,e.fixXMLHttpRequest=Qt,e.getPlatform=en,e.setConnectSocketFunc=function(e,t){Nn.connectSocket="function"==typeof e&&void 0!==t?e.bind(t):e},e.setFullOverride=function(e){Jt.value=!!e},e.setReadableStreamClass=function(e){he.ReadableStream=e},e.setRequestFunc=function(e,t){cn.request="function"==typeof e&&void 0!==t?e.bind(t):e},e.setTextMode=function(e){Xt.value=!!e},e.setXMLHttpRequestClass=Nt,e.useCookie=function(e){fn.get=function(t,n){return e.get(t,n)},fn.set=function(t,n,r){return e.set(t,n,r)}}});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mphttpx",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Xingzeng Bao",
|
|
6
6
|
"homepage": "https://github.com/baoxingzeng/mphttpx",
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "dist/mphttpx.cjs.js",
|
|
10
10
|
"module": "dist/mphttpx.esm.js",
|
|
11
|
+
"unpkg": "dist/mphttpx.umd.js",
|
|
12
|
+
"jsdelivr": "dist/mphttpx.umd.js",
|
|
11
13
|
"types": "dist/index.d.ts",
|
|
12
14
|
"files": [
|
|
13
15
|
"README.md",
|
|
@@ -44,16 +46,15 @@
|
|
|
44
46
|
"WebSocket"
|
|
45
47
|
],
|
|
46
48
|
"dependencies": {
|
|
47
|
-
"fetch-xhr-shim": "
|
|
48
|
-
"miniprogram-platform": "
|
|
49
|
-
"miniprogram-websocket": "
|
|
50
|
-
"miniprogram-xmlhttprequest-shim": "
|
|
49
|
+
"fetch-xhr-shim": "^1.2.0",
|
|
50
|
+
"miniprogram-platform": "^1.2.0",
|
|
51
|
+
"miniprogram-websocket": "^1.2.0",
|
|
52
|
+
"miniprogram-xmlhttprequest-shim": "^1.2.0"
|
|
51
53
|
},
|
|
52
54
|
"devDependencies": {
|
|
53
55
|
"@babel/core": "^7.29.7",
|
|
54
56
|
"@babel/preset-env": "^7.29.7",
|
|
55
57
|
"@rollup/plugin-babel": "^7.1.0",
|
|
56
|
-
"@rollup/plugin-commonjs": "^29.0.3",
|
|
57
58
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
58
59
|
"@rollup/plugin-terser": "^0.4.4",
|
|
59
60
|
"@rollup/plugin-typescript": "^12.3.0",
|