polyfill-library 4.0.0 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polyfill-library",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "description": "A polyfill combinator",
5
5
  "main": "lib/index.js",
6
6
  "contributors": [
@@ -96,7 +96,6 @@
96
96
  "eslint": "^7.0.0",
97
97
  "eslint-plugin-uncalled-iife": "^1.0.0",
98
98
  "eslint-plugin-unicorn": "^27.0.0",
99
- "event-source-polyfill": "^1.0.25",
100
99
  "execa": "^5.0.0",
101
100
  "express": "^4.17.1",
102
101
  "fastestsmallesttextencoderdecoder": "1.0.22",
@@ -1 +1 @@
1
- {"aliases":["default-3.4","default-3.5","default-3.6","default"],"dependencies":["_mutation"],"spec":"http://dom.spec.whatwg.org/#dom-childnode-remove","docs":"https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/remove","browsers":{"android":"*","bb":"*","chrome":"* - 28","edge":"<14","edge_mob":"<14","firefox":"<45","ios_chr":"*","ios_saf":"<9","ie":"*","ie_mob":"10 - *","opera":"* - 15","op_mini":"*","safari":"<9.1","firefox_mob":"3.6 - *"},"detectSource":"\"Element\"in self&&\"remove\"in Element.prototype\n","baseDir":"Element/prototype/remove","hasTests":true,"isTestable":true,"isPublic":true,"size":180}
1
+ {"aliases":["default-3.4","default-3.5","default-3.6","default"],"dependencies":["_mutation"],"spec":"http://dom.spec.whatwg.org/#dom-childnode-remove","docs":"https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/remove","browsers":{"android":"*","bb":"*","chrome":"* - 28","edge":"<14","edge_mob":"<14","firefox":"<45","ios_chr":"*","ios_saf":"<9","ie":"*","ie_mob":"10 - *","opera":"* - 15","op_mini":"*","safari":"<9.1","firefox_mob":"3.6 - *"},"detectSource":"\"Element\"in self&&\"remove\"in Element.prototype\n","baseDir":"Element/prototype/remove","hasTests":true,"isTestable":true,"isPublic":true,"size":364}
@@ -1 +1 @@
1
- Document.prototype.remove=Element.prototype.remove=function e(){this.parentNode&&this.parentNode.removeChild(this)},"Text"in self&&(Text.prototype.remove=Element.prototype.remove);
1
+ Document.prototype.remove=Element.prototype.remove=function e(){this.parentNode&&this.parentNode.removeChild(this)},"Text"in self&&(Text.prototype.remove=Element.prototype.remove),function(){var e=HTMLSelectElement.prototype.remove;HTMLSelectElement.prototype.remove=function t(o){return 0===arguments.length?Element.prototype.remove.call(this):e.call(this,o)}}();
@@ -11,3 +11,14 @@ Document.prototype.remove = Element.prototype.remove = function remove() {
11
11
  if ("Text" in self) {
12
12
  Text.prototype.remove = Element.prototype.remove;
13
13
  }
14
+
15
+ (function () {
16
+ var originalRemove = HTMLSelectElement.prototype.remove;
17
+
18
+ HTMLSelectElement.prototype.remove = function remove(index) {
19
+ if (arguments.length === 0) {
20
+ return Element.prototype.remove.call(this);
21
+ }
22
+ return originalRemove.call(this, index);
23
+ };
24
+ })();
@@ -1 +1 @@
1
- {"aliases":[],"dependencies":[],"spec":"https://html.spec.whatwg.org/multipage/comms.html#the-eventsource-interface","docs":"https://developer.mozilla.org/en-US/docs/Web/API/EventSource","license":"MIT","repo":"https://github.com/Yaffle/EventSource","browsers":{"firefox":"<36","chrome":"<26","edge":"<79","edge_mob":"*","safari":"<7","opera":"<12","ie":"*","ie_mob":"*","android":"<4.4"},"install":{"module":"event-source-polyfill","paths":["./src/eventsource.js"]},"detectSource":"\"EventSource\"in self&&\"function\"==typeof self.EventSource\n","baseDir":"EventSource","hasTests":false,"isTestable":true,"isPublic":true,"size":12085}
1
+ {"aliases":[],"dependencies":[],"spec":"https://html.spec.whatwg.org/multipage/comms.html#the-eventsource-interface","docs":"https://developer.mozilla.org/en-US/docs/Web/API/EventSource","license":"MIT","repo":"https://github.com/Yaffle/EventSource","browsers":{"firefox":"<36","chrome":"<26","edge":"<79","edge_mob":"*","safari":"<7","opera":"<12","ie":"*","ie_mob":"*","android":"<4.4"},"detectSource":"\"EventSource\"in self&&\"function\"==typeof self.EventSource\n","baseDir":"EventSource","hasTests":false,"isTestable":true,"isPublic":true,"size":12027}
@@ -1 +1 @@
1
- !function(e){"use strict";function t(){this.bitsNeeded=0,this.codePoint=0}function n(e){this.withCredentials=!1,this.readyState=0,this.status=0,this.statusText="",this.responseText="",this.onprogress=H,this.onload=H,this.onerror=H,this.onreadystatechange=H,this._contentType="",this._xhr=e,this._sendTimeout=0,this._abort=H}function o(e){return e.replace(/[A-Z]/g,function(e){return String.fromCharCode(e.charCodeAt(0)+32)})}function r(e){for(var t=Object.create(null),n=e.split("\r\n"),r=0;r<n.length;r+=1){var i=n[r],a=i.split(": "),s=a.shift(),d=a.join(": ");t[o(s)]=d}this._map=t}function i(){}function a(e){this._headers=e}function s(){}function d(){this._listeners=Object.create(null)}function c(e){g(function(){throw e},0)}function u(e){this.type=e,this.target=void 0}function h(e,t){u.call(this,e),this.data=t.data,this.lastEventId=t.lastEventId}function l(e,t){u.call(this,e),this.status=t.status,this.statusText=t.statusText,this.headers=t.headers}function f(e,t){u.call(this,e),this.error=t.error}function p(e,t){d.call(this),t=t||{},this.onopen=void 0,this.onmessage=void 0,this.onerror=void 0,this.url=void 0,this.readyState=void 0,this.withCredentials=void 0,this.headers=void 0,this._close=void 0,y(this,e,t)}function v(){return void 0!=b&&"withCredentials"in b.prototype||void 0==E?new b:new E}function y(e,t,o){t=String(t);var r=Boolean(o.withCredentials),a=o.lastEventIdQueryParameterName||"lastEventId",d=U(1e3),c=B(o.heartbeatTimeout,45e3),u="",p=d,y=!1,b=0,E=o.headers||{},m=o.Transport,C=z&&void 0==m?void 0:new n(void 0!=m?new m:v()),T=null!=m&&"string"!=typeof m?new m:void 0==C?new s:new i,_=void 0,S=0,x=N,A="",R="",O="",D="",H=M,K=0,Q=0,Z=function(t,n,o,r){if(x===j)if(200===t&&void 0!=o&&V.test(o)){x=I,y=Date.now(),p=d,e.readyState=I;var i=new l("open",{status:t,statusText:n,headers:r});e.dispatchEvent(i),k(e,e.onopen,i)}else{var a="";200!==t?(n&&(n=n.replace(/\s+/g," ")),a="EventSource's response has a status "+t+" "+n+" that is not 200. Aborting the connection."):a="EventSource's response has a Content-Type specifying an unsupported type: "+(void 0==o?"-":o.replace(/\s+/g," "))+". Aborting the connection.",J();var i=new l("error",{status:t,statusText:n,headers:r});e.dispatchEvent(i),k(e,e.onerror,i),console.error(a)}},$=function(t){if(x===I){for(var n=-1,o=0;o<t.length;o+=1){var r=t.charCodeAt(o);r!=="\n".charCodeAt(0)&&r!=="\r".charCodeAt(0)||(n=o)}var i=(-1!==n?D:"")+t.slice(0,n+1);D=(-1===n?D:"")+t.slice(n+1),""!==t&&(y=Date.now(),b+=t.length);for(var a=0;a<i.length;a+=1){var r=i.charCodeAt(a);if(H===L&&r==="\n".charCodeAt(0))H=M;else if(H===L&&(H=M),r==="\r".charCodeAt(0)||r==="\n".charCodeAt(0)){if(H!==M){H===q&&(Q=a+1);var s=i.slice(K,Q-1),l=i.slice(Q+(Q<a&&i.charCodeAt(Q)===" ".charCodeAt(0)?1:0),a);"data"===s?(A+="\n",A+=l):"id"===s?R=l:"event"===s?O=l:"retry"===s?(d=B(l,d),p=d):"heartbeatTimeout"===s&&(c=B(l,c),0!==S&&(w(S),S=g(function(){W()},c)))}if(H===M){if(""!==A){u=R,""===O&&(O="message");var f=new h(O,{data:A.slice(1),lastEventId:R});if(e.dispatchEvent(f),"open"===O?k(e,e.onopen,f):"message"===O?k(e,e.onmessage,f):"error"===O&&k(e,e.onerror,f),x===P)return}A="",O=""}H=r==="\r".charCodeAt(0)?L:M}else H===M&&(K=a,H=q),H===q?r===":".charCodeAt(0)&&(Q=a+1,H=X):H===X&&(H=G)}}},F=function(t){if(x===I||x===j){x=N,0!==S&&(w(S),S=0),S=g(function(){W()},p),p=U(Math.min(16*d,2*p)),e.readyState=j;var n=new f("error",{error:t});e.dispatchEvent(n),k(e,e.onerror,n),void 0!=t&&console.error(t)}},J=function(){x=P,void 0!=_&&(_.abort(),_=void 0),0!==S&&(w(S),S=0),e.readyState=P},W=function(){if(S=0,x===N){y=!1,b=0,S=g(function(){W()},c),x=j,A="",O="",R=u,D="",K=0,Q=0,H=M;var n=t;if("data:"!==t.slice(0,5)&&"blob:"!==t.slice(0,5)&&""!==u){var o=t.indexOf("?");n=-1===o?t:t.slice(0,o+1)+t.slice(o+1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g,function(e,t){return t===a?"":e}),n+=(-1===t.indexOf("?")?"?":"&")+a+"="+encodeURIComponent(u)}var r=e.withCredentials,i={};i.Accept="text/event-stream";var s=e.headers;if(void 0!=s)for(var d in s)Object.prototype.hasOwnProperty.call(s,d)&&(i[d]=s[d]);try{_=T.open(C,Z,$,F,n,r,i)}catch(e){throw J(),e}}else if(y||void 0==_){var h=Math.max((y||Date.now())+c-Date.now(),1);y=!1,S=g(function(){W()},h)}else F(new Error("No activity within "+c+" milliseconds. "+(x===j?"No response received.":b+" chars received.")+" Reconnecting.")),void 0!=_&&(_.abort(),_=void 0)};e.url=t,e.readyState=j,e.withCredentials=r,e.headers=E,e._close=J,W()}var g=e.setTimeout,w=e.clearTimeout,b=e.XMLHttpRequest,E=e.XDomainRequest,m=e.ActiveXObject,C=e.EventSource,T=e.document,_=e.Promise,S=e.fetch,x=e.Response,A=e.TextDecoder,R=e.TextEncoder,O=e.AbortController;if("undefined"==typeof window||void 0===T||"readyState"in T||null!=T.body||(T.readyState="loading",window.addEventListener("load",function(e){T.readyState="complete"},!1)),null==b&&null!=m&&(b=function(){return new m("Microsoft.XMLHTTP")}),void 0==Object.create&&(Object.create=function(e){function t(){}return t.prototype=e,new t}),Date.now||(Date.now=function e(){return(new Date).getTime()}),void 0==O){var D=S;S=function(e,t){var n=t.signal;return D(e,{headers:t.headers,credentials:t.credentials,cache:t.cache}).then(function(e){var t=e.body.getReader();return n._reader=t,n._aborted&&n._reader.cancel(),{status:e.status,statusText:e.statusText,headers:e.headers,body:{getReader:function(){return t}}}})},O=function(){this.signal={_reader:null,_aborted:!1},this.abort=function(){null!=this.signal._reader&&this.signal._reader.cancel(),this.signal._aborted=!0}}}t.prototype.decode=function(e){function t(e,t,n){if(1===n)return e>=128>>t&&e<<t<=2047;if(2===n)return e>=2048>>t&&e<<t<=55295||e>=57344>>t&&e<<t<=65535;if(3===n)return e>=65536>>t&&e<<t<=1114111;throw new Error}function n(e,t){if(6===e)return t>>6>15?3:t>31?2:1;if(12===e)return t>15?3:2;if(18===e)return 3;throw new Error}for(var o="",r=this.bitsNeeded,i=this.codePoint,a=0;a<e.length;a+=1){var s=e[a];0!==r&&(s<128||s>191||!t(i<<6|63&s,r-6,n(r,i)))&&(r=0,i=65533,o+=String.fromCharCode(i)),0===r?(s>=0&&s<=127?(r=0,i=s):s>=192&&s<=223?(r=6,i=31&s):s>=224&&s<=239?(r=12,i=15&s):s>=240&&s<=247?(r=18,i=7&s):(r=0,i=65533),0===r||t(i,r,n(r,i))||(r=0,i=65533)):(r-=6,i=i<<6|63&s),0===r&&(i<=65535?o+=String.fromCharCode(i):(o+=String.fromCharCode(55296+(i-65535-1>>10)),o+=String.fromCharCode(56320+(i-65535-1&1023))))}return this.bitsNeeded=r,this.codePoint=i,o};void 0!=A&&void 0!=R&&function(){try{return"test"===(new A).decode((new R).encode("test"),{stream:!0})}catch(e){console.debug("TextDecoder does not support streaming option. Using polyfill instead: "+e)}return!1}()||(A=t);var H=function(){};n.prototype.open=function(e,t){this._abort(!0);var n=this,o=this._xhr,r=1,i=0;this._abort=function(e){0!==n._sendTimeout&&(w(n._sendTimeout),n._sendTimeout=0),1!==r&&2!==r&&3!==r||(r=4,o.onload=H,o.onerror=H,o.onabort=H,o.onprogress=H,o.onreadystatechange=H,o.abort(),0!==i&&(w(i),i=0),e||(n.readyState=4,n.onabort(null),n.onreadystatechange())),r=0};var a=function(){if(1===r){var e=0,t="",i=void 0;if("contentType"in o)e=200,t="OK",i=o.contentType;else try{e=o.status,t=o.statusText,i=o.getResponseHeader("Content-Type")}catch(n){e=0,t="",i=void 0}0!==e&&(r=2,n.readyState=2,n.status=e,n.statusText=t,n._contentType=i,n.onreadystatechange())}},s=function(){if(a(),2===r||3===r){r=3;var e="";try{e=o.responseText}catch(e){}n.readyState=3,n.responseText=e,n.onprogress()}},d=function(e,t){if(null!=t&&null!=t.preventDefault||(t={preventDefault:H}),s(),1===r||2===r||3===r){if(r=4,0!==i&&(w(i),i=0),n.readyState=4,"load"===e)n.onload(t);else if("error"===e)n.onerror(t);else{if("abort"!==e)throw new TypeError;n.onabort(t)}n.onreadystatechange()}},c=function(e){void 0!=o&&(4===o.readyState?"onload"in o&&"onerror"in o&&"onabort"in o||d(""===o.responseText?"error":"load",e):3===o.readyState?"onprogress"in o||s():2===o.readyState&&a())},u=function(){i=g(function(){u()},500),3===o.readyState&&s()};"onload"in o&&(o.onload=function(e){d("load",e)}),"onerror"in o&&(o.onerror=function(e){d("error",e)}),"onabort"in o&&(o.onabort=function(e){d("abort",e)}),"onprogress"in o&&(o.onprogress=s),"onreadystatechange"in o&&(o.onreadystatechange=function(e){c(e)}),!("contentType"in o)&&"ontimeout"in b.prototype||(t+=(-1===t.indexOf("?")?"?":"&")+"padding=true"),o.open(e,t,!0),"readyState"in o&&(i=g(function(){u()},0))},n.prototype.abort=function(){this._abort(!1)},n.prototype.getResponseHeader=function(e){return this._contentType},n.prototype.setRequestHeader=function(e,t){var n=this._xhr;"setRequestHeader"in n&&n.setRequestHeader(e,t)},n.prototype.getAllResponseHeaders=function(){return void 0!=this._xhr.getAllResponseHeaders?this._xhr.getAllResponseHeaders()||"":""},n.prototype.send=function(){if(!("ontimeout"in b.prototype&&("sendAsBinary"in b.prototype||"mozAnon"in b.prototype)||void 0==T||void 0==T.readyState||"complete"===T.readyState)){var e=this;return void(e._sendTimeout=g(function(){e._sendTimeout=0,e.send()},4))}var t=this._xhr;"withCredentials"in t&&(t.withCredentials=this.withCredentials);try{t.send(void 0)}catch(e){throw e}},r.prototype.get=function(e){return this._map[o(e)]},null!=b&&null==b.HEADERS_RECEIVED&&(b.HEADERS_RECEIVED=2),i.prototype.open=function(e,t,n,o,i,a,s){e.open("GET",i);var d=0;e.onprogress=function(){var t=e.responseText,o=t.slice(d);d+=o.length,n(o)},e.onerror=function(e){e.preventDefault(),o(new Error("NetworkError"))},e.onload=function(){o(null)},e.onabort=function(){o(null)},e.onreadystatechange=function(){if(e.readyState===b.HEADERS_RECEIVED){var n=e.status,o=e.statusText,i=e.getResponseHeader("Content-Type"),a=e.getAllResponseHeaders();t(n,o,i,new r(a))}},e.withCredentials=a;for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&e.setRequestHeader(c,s[c]);return e.send(),e},a.prototype.get=function(e){return this._headers.get(e)},s.prototype.open=function(e,t,n,o,r,i,s){var d=null,c=new O,u=c.signal,h=new A;return S(r,{headers:s,credentials:i?"include":"same-origin",signal:u,cache:"no-store"}).then(function(e){return d=e.body.getReader(),t(e.status,e.statusText,e.headers.get("Content-Type"),new a(e.headers)),new _(function(e,t){var o=function(){d.read().then(function(t){if(t.done)e(void 0);else{var r=h.decode(t.value,{stream:!0});n(r),o()}}).catch(function(e){t(e)})};o()})}).catch(function(e){return"AbortError"===e.name?void 0:e}).then(function(e){o(e)}),{abort:function(){null!=d&&d.cancel(),c.abort()}}},d.prototype.dispatchEvent=function(e){e.target=this;var t=this._listeners[e.type];if(void 0!=t)for(var n=t.length,o=0;o<n;o+=1){var r=t[o];try{"function"==typeof r.handleEvent?r.handleEvent(e):r.call(this,e)}catch(e){c(e)}}},d.prototype.addEventListener=function(e,t){e=String(e);var n=this._listeners,o=n[e];void 0==o&&(o=[],n[e]=o);for(var r=!1,i=0;i<o.length;i+=1)o[i]===t&&(r=!0);r||o.push(t)},d.prototype.removeEventListener=function(e,t){e=String(e);var n=this._listeners,o=n[e];if(void 0!=o){for(var r=[],i=0;i<o.length;i+=1)o[i]!==t&&r.push(o[i]);0===r.length?delete n[e]:n[e]=r}},h.prototype=Object.create(u.prototype),l.prototype=Object.create(u.prototype),f.prototype=Object.create(u.prototype);var N=-1,j=0,I=1,P=2,L=-1,M=0,q=1,X=2,G=3,V=/^text\/event\-stream(;.*)?$/i,B=function(e,t){var n=null==e?t:parseInt(e,10);return n!==n&&(n=t),U(n)},U=function(e){return Math.min(Math.max(e,1e3),18e6)},k=function(e,t,n){try{"function"==typeof t&&t.call(e,n)}catch(e){c(e)}},z=void 0!=S&&void 0!=x&&"body"in x.prototype;p.prototype=Object.create(d.prototype),p.prototype.CONNECTING=j,p.prototype.OPEN=I,p.prototype.CLOSED=P,p.prototype.close=function(){this._close()},p.CONNECTING=j,p.OPEN=I,p.CLOSED=P,p.prototype.withCredentials=void 0;var K=C;void 0==b||void 0!=C&&"withCredentials"in C.prototype||(K=p),function(t){if("object"==typeof module&&"object"==typeof module.exports){var n=t(exports);void 0!==n&&(module.exports=n)}else"function"==typeof define&&define.amd?define(["exports"],t):t(e)}(function(e){e.EventSourcePolyfill=p,e.NativeEventSource=C,e.EventSource=K})}("undefined"==typeof globalThis?"undefined"!=typeof window?window:"undefined"!=typeof self?self:this:globalThis);
1
+ (function(e){"EventSource"in self&&"function"==typeof self.EventSource||function(t){"use strict";function n(){this.bitsNeeded=0,this.codePoint=0}function r(e){this.withCredentials=!1,this.readyState=0,this.status=0,this.statusText="",this.responseText="",this.onprogress=H,this.onload=H,this.onerror=H,this.onreadystatechange=H,this._contentType="",this._xhr=e,this._sendTimeout=0,this._abort=H}function o(e){return e.replace(/[A-Z]/g,function(e){return String.fromCharCode(e.charCodeAt(0)+32)})}function a(e){for(var t=Object.create(null),n=e.split("\r\n"),r=0;r<n.length;r+=1){var a=n[r],i=a.split(": "),s=i.shift(),c=i.join(": ");t[o(s)]=c}this._map=t}function i(){}function s(e){this._headers=e}function c(){}function u(){this._listeners=Object.create(null)}function d(e){w(function(){throw e},0)}function l(t){this.type=t,this.target=e}function h(e,t){l.call(this,e),this.data=t.data,this.lastEventId=t.lastEventId}function f(e,t){l.call(this,e),this.status=t.status,this.statusText=t.statusText,this.headers=t.headers}function p(e,t){l.call(this,e),this.error=t.error}function y(t,n){u.call(this),n=n||{},this.onopen=e,this.onmessage=e,this.onerror=e,this.url=e,this.readyState=e,this.withCredentials=e,this.headers=e,this._close=e,g(this,t,n)}function v(){return E!=e&&"withCredentials"in E.prototype||m==e?new E:new m}function g(t,n,o){n=String(n);var a=Boolean(o.withCredentials),s=o.lastEventIdQueryParameterName||"lastEventId",u=k(1e3),d=U(o.heartbeatTimeout,45e3),l="",y=u,g=!1,E=0,m=o.headers||{},C=o.Transport,T=K&&C==e?e:new r(C!=e?new C:v()),S=null!=C&&"string"!=typeof C?new C:T==e?new c:new i,_=e,x=0,A=N,R="",O="",D="",j="",H=q,Q=0,Z=0,$=function(n,r,o,a){if(A===I)if(200===n&&o!=e&&B.test(o)){A=P,g=Date.now(),y=u,t.readyState=P;var i=new f("open",{status:n,statusText:r,headers:a});t.dispatchEvent(i),z(t,t.onopen,i)}else{var s="";200!==n?(r&&(r=r.replace(/\s+/g," ")),s="EventSource's response has a status "+n+" "+r+" that is not 200. Aborting the connection."):s="EventSource's response has a Content-Type specifying an unsupported type: "+(o==e?"-":o.replace(/\s+/g," "))+". Aborting the connection.",W();var i=new f("error",{status:n,statusText:r,headers:a});t.dispatchEvent(i),z(t,t.onerror,i),console.error(s)}},F=function(e){if(A===P){for(var n=-1,r=0;r<e.length;r+=1){var o=e.charCodeAt(r);o!=="\n".charCodeAt(0)&&o!=="\r".charCodeAt(0)||(n=r)}var a=(-1!==n?j:"")+e.slice(0,n+1);j=(-1===n?j:"")+e.slice(n+1),""!==e&&(g=Date.now(),E+=e.length);for(var i=0;i<a.length;i+=1){var o=a.charCodeAt(i);if(H===M&&o==="\n".charCodeAt(0))H=q;else if(H===M&&(H=q),o==="\r".charCodeAt(0)||o==="\n".charCodeAt(0)){if(H!==q){H===X&&(Z=i+1);var s=a.slice(Q,Z-1),c=a.slice(Z+(Z<i&&a.charCodeAt(Z)===" ".charCodeAt(0)?1:0),i);"data"===s?(R+="\n",R+=c):"id"===s?O=c:"event"===s?D=c:"retry"===s?(u=U(c,u),y=u):"heartbeatTimeout"===s&&(d=U(c,d),0!==x&&(b(x),x=w(function(){Y()},d)))}if(H===q){if(""!==R){l=O,""===D&&(D="message");var f=new h(D,{data:R.slice(1),lastEventId:O});if(t.dispatchEvent(f),"open"===D?z(t,t.onopen,f):"message"===D?z(t,t.onmessage,f):"error"===D&&z(t,t.onerror,f),A===L)return}R="",D=""}H=o==="\r".charCodeAt(0)?M:q}else H===q&&(Q=i,H=X),H===X?o===":".charCodeAt(0)&&(Z=i+1,H=G):H===G&&(H=V)}}},J=function(n){if(A===P||A===I){A=N,0!==x&&(b(x),x=0),x=w(function(){Y()},y),y=k(Math.min(16*u,2*y)),t.readyState=I;var r=new p("error",{error:n});t.dispatchEvent(r),z(t,t.onerror,r),n!=e&&console.error(n)}},W=function(){A=L,_!=e&&(_.abort(),_=e),0!==x&&(b(x),x=0),t.readyState=L},Y=function(){if(x=0,A===N){g=!1,E=0,x=w(function(){Y()},d),A=I,R="",D="",O=l,j="",Q=0,Z=0,H=q;var r=n;if("data:"!==n.slice(0,5)&&"blob:"!==n.slice(0,5)&&""!==l){var o=n.indexOf("?");r=-1===o?n:n.slice(0,o+1)+n.slice(o+1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g,function(e,t){return t===s?"":e}),r+=(-1===n.indexOf("?")?"?":"&")+s+"="+encodeURIComponent(l)}var a=t.withCredentials,i={};i.Accept="text/event-stream";var c=t.headers;if(c!=e)for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(i[u]=c[u]);try{_=S.open(T,$,F,J,r,a,i)}catch(e){throw W(),e}}else if(g||_==e){var h=Math.max((g||Date.now())+d-Date.now(),1);g=!1,x=w(function(){Y()},h)}else J(new Error("No activity within "+d+" milliseconds. "+(A===I?"No response received.":E+" chars received.")+" Reconnecting.")),_!=e&&(_.abort(),_=e)};t.url=n,t.readyState=I,t.withCredentials=a,t.headers=m,t._close=W,Y()}var w=t.setTimeout,b=t.clearTimeout,E=t.XMLHttpRequest,m=t.XDomainRequest,C=t.ActiveXObject,T=t.EventSource,S=t.document,_=t.Promise,x=t.fetch,A=t.Response,R=t.TextDecoder,O=t.TextEncoder,D=t.AbortController;if("undefined"==typeof window||void 0===S||"readyState"in S||null!=S.body||(S.readyState="loading",window.addEventListener("load",function(e){S.readyState="complete"},!1)),null==E&&null!=C&&(E=function(){return new C("Microsoft.XMLHTTP")}),Object.create==e&&(Object.create=function(e){function t(){}return t.prototype=e,new t}),Date.now||(Date.now=function e(){return(new Date).getTime()}),D==e){var j=x;x=function(e,t){var n=t.signal;return j(e,{headers:t.headers,credentials:t.credentials,cache:t.cache}).then(function(e){var t=e.body.getReader();return n._reader=t,n._aborted&&n._reader.cancel(),{status:e.status,statusText:e.statusText,headers:e.headers,body:{getReader:function(){return t}}}})},D=function(){this.signal={_reader:null,_aborted:!1},this.abort=function(){null!=this.signal._reader&&this.signal._reader.cancel(),this.signal._aborted=!0}}}n.prototype.decode=function(e){function t(e,t,n){if(1===n)return e>=128>>t&&e<<t<=2047;if(2===n)return e>=2048>>t&&e<<t<=55295||e>=57344>>t&&e<<t<=65535;if(3===n)return e>=65536>>t&&e<<t<=1114111;throw new Error}function n(e,t){if(6===e)return t>>6>15?3:t>31?2:1;if(12===e)return t>15?3:2;if(18===e)return 3;throw new Error}for(var r="",o=this.bitsNeeded,a=this.codePoint,i=0;i<e.length;i+=1){var s=e[i];0!==o&&(s<128||s>191||!t(a<<6|63&s,o-6,n(o,a)))&&(o=0,a=65533,r+=String.fromCharCode(a)),0===o?(s>=0&&s<=127?(o=0,a=s):s>=192&&s<=223?(o=6,a=31&s):s>=224&&s<=239?(o=12,a=15&s):s>=240&&s<=247?(o=18,a=7&s):(o=0,a=65533),0===o||t(a,o,n(o,a))||(o=0,a=65533)):(o-=6,a=a<<6|63&s),0===o&&(a<=65535?r+=String.fromCharCode(a):(r+=String.fromCharCode(55296+(a-65535-1>>10)),r+=String.fromCharCode(56320+(a-65535-1&1023))))}return this.bitsNeeded=o,this.codePoint=a,r};R!=e&&O!=e&&function(){try{return"test"===(new R).decode((new O).encode("test"),{stream:!0})}catch(e){console.debug("TextDecoder does not support streaming option. Using polyfill instead: "+e)}return!1}()||(R=n);var H=function(){};r.prototype.open=function(t,n){this._abort(!0);var r=this,o=this._xhr,a=1,i=0;this._abort=function(e){0!==r._sendTimeout&&(b(r._sendTimeout),r._sendTimeout=0),1!==a&&2!==a&&3!==a||(a=4,o.onload=H,o.onerror=H,o.onabort=H,o.onprogress=H,o.onreadystatechange=H,o.abort(),0!==i&&(b(i),i=0),e||(r.readyState=4,r.onabort(null),r.onreadystatechange())),a=0};var s=function(){if(1===a){var t=0,n="",i=e;if("contentType"in o)t=200,n="OK",i=o.contentType;else try{t=o.status,n=o.statusText,i=o.getResponseHeader("Content-Type")}catch(r){t=0,n="",i=e}0!==t&&(a=2,r.readyState=2,r.status=t,r.statusText=n,r._contentType=i,r.onreadystatechange())}},c=function(){if(s(),2===a||3===a){a=3;var e="";try{e=o.responseText}catch(e){}r.readyState=3,r.responseText=e,r.onprogress()}},u=function(e,t){if(null!=t&&null!=t.preventDefault||(t={preventDefault:H}),c(),1===a||2===a||3===a){if(a=4,0!==i&&(b(i),i=0),r.readyState=4,"load"===e)r.onload(t);else if("error"===e)r.onerror(t);else{if("abort"!==e)throw new TypeError;r.onabort(t)}r.onreadystatechange()}},d=function(t){o!=e&&(4===o.readyState?"onload"in o&&"onerror"in o&&"onabort"in o||u(""===o.responseText?"error":"load",t):3===o.readyState?"onprogress"in o||c():2===o.readyState&&s())},l=function(){i=w(function(){l()},500),3===o.readyState&&c()};"onload"in o&&(o.onload=function(e){u("load",e)}),"onerror"in o&&(o.onerror=function(e){u("error",e)}),"onabort"in o&&(o.onabort=function(e){u("abort",e)}),"onprogress"in o&&(o.onprogress=c),"onreadystatechange"in o&&(o.onreadystatechange=function(e){d(e)}),!("contentType"in o)&&"ontimeout"in E.prototype||(n+=(-1===n.indexOf("?")?"?":"&")+"padding=true"),o.open(t,n,!0),"readyState"in o&&(i=w(function(){l()},0))},r.prototype.abort=function(){this._abort(!1)},r.prototype.getResponseHeader=function(e){return this._contentType},r.prototype.setRequestHeader=function(e,t){var n=this._xhr;"setRequestHeader"in n&&n.setRequestHeader(e,t)},r.prototype.getAllResponseHeaders=function(){return this._xhr.getAllResponseHeaders!=e?this._xhr.getAllResponseHeaders()||"":""},r.prototype.send=function(){if(!("ontimeout"in E.prototype&&("sendAsBinary"in E.prototype||"mozAnon"in E.prototype)||S==e||S.readyState==e||"complete"===S.readyState)){var t=this;return void(t._sendTimeout=w(function(){t._sendTimeout=0,t.send()},4))}var n=this._xhr;"withCredentials"in n&&(n.withCredentials=this.withCredentials);try{n.send(e)}catch(e){throw e}},a.prototype.get=function(e){return this._map[o(e)]},null!=E&&null==E.HEADERS_RECEIVED&&(E.HEADERS_RECEIVED=2),i.prototype.open=function(e,t,n,r,o,i,s){e.open("GET",o);var c=0;e.onprogress=function(){var t=e.responseText,r=t.slice(c);c+=r.length,n(r)},e.onerror=function(e){e.preventDefault(),r(new Error("NetworkError"))},e.onload=function(){r(null)},e.onabort=function(){r(null)},e.onreadystatechange=function(){if(e.readyState===E.HEADERS_RECEIVED){var n=e.status,r=e.statusText,o=e.getResponseHeader("Content-Type"),i=e.getAllResponseHeaders();t(n,r,o,new a(i))}},e.withCredentials=i;for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&e.setRequestHeader(u,s[u]);return e.send(),e},s.prototype.get=function(e){return this._headers.get(e)},c.prototype.open=function(t,n,r,o,a,i,c){var u=null,d=new D,l=d.signal,h=new R;return x(a,{headers:c,credentials:i?"include":"same-origin",signal:l,cache:"no-store"}).then(function(t){return u=t.body.getReader(),n(t.status,t.statusText,t.headers.get("Content-Type"),new s(t.headers)),new _(function(t,n){var o=function(){u.read().then(function(n){if(n.done)t(e);else{var a=h.decode(n.value,{stream:!0});r(a),o()}}).catch(function(e){n(e)})};o()})}).catch(function(t){return"AbortError"===t.name?e:t}).then(function(e){o(e)}),{abort:function(){null!=u&&u.cancel(),d.abort()}}},u.prototype.dispatchEvent=function(t){t.target=this;var n=this._listeners[t.type];if(n!=e)for(var r=n.length,o=0;o<r;o+=1){var a=n[o];try{"function"==typeof a.handleEvent?a.handleEvent(t):a.call(this,t)}catch(e){d(e)}}},u.prototype.addEventListener=function(t,n){t=String(t);var r=this._listeners,o=r[t];o==e&&(o=[],r[t]=o);for(var a=!1,i=0;i<o.length;i+=1)o[i]===n&&(a=!0);a||o.push(n)},u.prototype.removeEventListener=function(t,n){t=String(t);var r=this._listeners,o=r[t];if(o!=e){for(var a=[],i=0;i<o.length;i+=1)o[i]!==n&&a.push(o[i]);0===a.length?delete r[t]:r[t]=a}},h.prototype=Object.create(l.prototype),f.prototype=Object.create(l.prototype),p.prototype=Object.create(l.prototype);var N=-1,I=0,P=1,L=2,M=-1,q=0,X=1,G=2,V=3,B=/^text\/event\-stream(;.*)?$/i,U=function(e,t){var n=null==e?t:parseInt(e,10);return n!==n&&(n=t),k(n)},k=function(e){return Math.min(Math.max(e,1e3),18e6)},z=function(e,t,n){try{"function"==typeof t&&t.call(e,n)}catch(e){d(e)}},K=x!=e&&A!=e&&"body"in A.prototype;y.prototype=Object.create(u.prototype),y.prototype.CONNECTING=I,y.prototype.OPEN=P,y.prototype.CLOSED=L,y.prototype.close=function(){this._close()},y.CONNECTING=I,y.OPEN=P,y.CLOSED=L,y.prototype.withCredentials=e;var Q=T;E==e||T!=e&&"withCredentials"in T.prototype||(Q=y),function(n){if("object"==typeof module&&"object"==typeof module.exports){var r=n(exports);r!==e&&(module.exports=r)}else"function"==typeof define&&define.amd?define(["exports"],n):n(t)}(function(e){e.EventSourcePolyfill=y,e.NativeEventSource=T,e.EventSource=Q})}("undefined"==typeof globalThis?"undefined"!=typeof window?window:"undefined"!=typeof self?self:this:globalThis)}).call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{});