hexo/node_modules/web-streams-polyfill/dist/ponyfill.es5.mjs

9 lines
63 KiB
JavaScript
Raw Normal View History

2023-09-25 15:58:56 +08:00
/**
* @license
* web-streams-polyfill v4.0.0-beta.3
* Copyright 2021 Mattias Buelens, Diwank Singh Tomer and other contributors.
* This code is released under the MIT license.
* SPDX-License-Identifier: MIT
*/
var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol:function(e){return"Symbol(".concat(e,")")};function r(){}function t(e){return"object"==typeof e&&null!==e||"function"==typeof e}var n=r;function o(e,r){try{Object.defineProperty(e,"name",{value:r,configurable:!0})}catch(e){}}var a=Promise,i=Promise.prototype.then,l=Promise.resolve.bind(a),u=Promise.reject.bind(a);function s(e){return new a(e)}function c(e){return l(e)}function d(e){return u(e)}function f(e,r,t){return i.call(e,r,t)}function b(e,r,t){f(f(e,r,t),void 0,n)}function p(e,r){b(e,r)}function h(e,r){b(e,void 0,r)}function _(e,r,t){return f(e,r,t)}function y(e){f(e,void 0,n)}var v=function(e){if("function"==typeof queueMicrotask)v=queueMicrotask;else{var r=c(void 0);v=function(e){return f(r,e)}}return v(e)};function m(e,r,t){if("function"!=typeof e)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,r,t)}function g(e,r,t){try{return c(m(e,r,t))}catch(e){return d(e)}}var w=function(){function e(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}return Object.defineProperty(e.prototype,"length",{get:function(){return this._size},enumerable:!1,configurable:!0}),e.prototype.push=function(e){var r=this._back,t=r;16383===r._elements.length&&(t={_elements:[],_next:void 0}),r._elements.push(e),t!==r&&(this._back=t,r._next=t),++this._size},e.prototype.shift=function(){var e=this._front,r=e,t=this._cursor,n=t+1,o=e._elements,a=o[t];return 16384===n&&(r=e._next,n=0),--this._size,this._cursor=n,e!==r&&(this._front=r),o[t]=void 0,a},e.prototype.forEach=function(e){for(var r=this._cursor,t=this._front,n=t._elements;!(r===n.length&&void 0===t._next||r===n.length&&(r=0,0===(n=(t=t._next)._elements).length));)e(n[r]),++r},e.prototype.peek=function(){var e=this._front,r=this._cursor;return e._elements[r]},e}(),S=e("[[AbortSteps]]"),R=e("[[ErrorSteps]]"),T=e("[[CancelSteps]]"),q=e("[[PullSteps]]"),P=e("[[ReleaseSteps]]");function C(e,r){e._ownerReadableStream=r,r._reader=e,"readable"===r._state?k(e):"closed"===r._state?function(e){k(e),A(e)}(e):j(e,r._storedError)}function E(e,r){return at(e._ownerReadableStream,r)}function O(e){var r=e._ownerReadableStream;"readable"===r._state?B(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(e,r){j(e,r)}(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),r._readableStreamController[P](),r._reader=void 0,e._ownerReadableStream=void 0}function W(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function k(e){e._closedPromise=s((function(r,t){e._closedPromise_resolve=r,e._closedPromise_reject=t}))}function j(e,r){k(e),B(e,r)}function B(e,r){void 0!==e._closedPromise_reject&&(y(e._closedPromise),e._closedPromise_reject(r),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function A(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}var z=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},L=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function F(e,r){if(void 0!==e&&("object"!=typeof(t=e)&&"function"!=typeof t))throw new TypeError("".concat(r," is not an object."));var t}function I(e,r){if("function"!=typeof e)throw new TypeError("".concat(r," is not a function."))}function D(e,r){if(!function(e){return"object"==typeof e&&null!==e||"function"==typeof e}(e))throw new TypeError("".concat(r," is not an object."))}function M(e,r,t){if(void 0===e)throw new TypeError("Parameter ".concat(r," is required in '").concat(t,"'."))}function Q(e,r,t){if(void 0===e)throw new TypeError("".concat(r," is required in '").concat(t,"'."))}function Y(e){return Number(e)}function N(e){return 0===e?0:e}function H(e,r){var t=Number.MAX_SAFE_INTEGER,n=Number(e);if(n=N(n),!z(n))throw new TypeError("".concat(r," is not a finite number"));if((n=function(e){return N(L(e))}(n))<0||n>t)throw