UNPKG

typeson-registry

Version:
3 lines 54.9 kB
!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).createObjectURL={})}(this,(function(e){"use strict";function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function getAugmentedNamespace(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var r=function a(){var e=!1;try{e=this instanceof a}catch{}return e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var t={},r={};function _OverloadYield(e,t){this.v=e,this.k=t}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,_toPropertyKey(n.key),n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _createForOfIteratorHelper(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t){r&&(e=r);var n=0,F=function(){};return{s:F,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,u=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return u=e.done,e},e:function(e){l=!0,s=e},f:function(){try{u||null==r.return||r.return()}finally{if(l)throw s}}}}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _regenerator(){ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",s=r.toStringTag||"@@toStringTag";function i(r,n,s,l){var c=n&&n.prototype instanceof Generator?n:Generator,h=Object.create(c.prototype);return _regeneratorDefine(h,"_invoke",function(r,n,s){var l,c,h,y=0,m=s||[],v=!1,b={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return l=t,c=0,h=e,b.n=r,u}};function d(r,n){for(c=r,h=n,t=0;!v&&y&&!s&&t<m.length;t++){var s,l=m[t],g=b.p,S=l[2];r>3?(s=S===n)&&(h=l[(c=l[4])?5:(c=3,3)],l[4]=l[5]=e):l[0]<=g&&((s=r<2&&g<l[1])?(c=0,b.v=n,b.n=l[1]):g<S&&(s=r<3||l[0]>n||n>S)&&(l[4]=r,l[5]=n,b.n=S,c=0))}if(s||r>1)return u;throw v=!0,n}return function(s,m,g){if(y>1)throw TypeError("Generator is already running");for(v&&1===m&&d(m,g),c=m,h=g;(t=c<2?e:h)||!v;){l||(c?c<3?(c>1&&(b.n=-1),d(c,h)):b.n=h:b.v=h);try{if(y=2,l){if(c||(s="next"),t=l[s]){if(!(t=t.call(l,h)))throw TypeError("iterator result is not an object");if(!t.done)return t;h=t.value,c<2&&(c=0)}else 1===c&&(t=l.return)&&t.call(l),c<2&&(h=TypeError("The iterator does not provide a '"+s+"' method"),c=1);l=e}else if((t=(v=b.n<0)?h:r.call(n,b))!==u)break}catch(t){l=e,c=1,h=t}finally{y=1}}return{value:t,done:v}}}(r,s,l),!0),h}var u={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(_regeneratorDefine(t={},n,(function(){return this})),t),c=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(l);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine(e,s,"GeneratorFunction")),e.prototype=Object.create(c),e}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine(c,"constructor",GeneratorFunctionPrototype),_regeneratorDefine(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine(GeneratorFunctionPrototype,s,"GeneratorFunction"),_regeneratorDefine(c),_regeneratorDefine(c,s,"Generator"),_regeneratorDefine(c,n,(function(){return this})),_regeneratorDefine(c,"toString",(function(){return"[object Generator]"})),(_regenerator=function(){return{w:i,m:f}})()}function _regeneratorDefine(e,t,r,n){var s=Object.defineProperty;try{s({},"",{})}catch(e){s=0}_regeneratorDefine=function(e,t,r,n){function o(t,r){_regeneratorDefine(e,t,(function(e){return this._invoke(t,r,e)}))}t?s?s(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(o("next",0),o("throw",1),o("return",2))},_regeneratorDefine(e,t,r,n)}function _slicedToArray(e,t){return function _arrayWithHoles(e){if(Array.isArray(e))return e}(e)||function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,s,u,l,c=[],h=!0,y=!1;try{if(u=(r=r.call(e)).next,0===t);else for(;!(h=(n=u.call(r)).done)&&(c.push(n.value),c.length!==t);h=!0);}catch(e){y=!0,s=e}finally{try{if(!h&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(y)throw s}}return c}}(e,t)||_unsupportedIterableToArray(e,t)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _toConsumableArray(e){return function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}(e)||function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||_unsupportedIterableToArray(e)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _toPropertyKey(e){var t=function _toPrimitive(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function _typeof(e){return _typeof="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},_typeof(e)}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _wrapAsyncGenerator(e){return function(){return new AsyncGenerator(e.apply(this,arguments))}}function AsyncGenerator(e){var t,r;function resume(t,r){try{var n=e[t](r),s=n.value,u=s instanceof _OverloadYield;Promise.resolve(u?s.v:s).then((function(r){if(u){var l="return"===t?"return":"next";if(!s.k||r.done)return resume(l,r);r=e[l](r).value}settle(n.done?"return":"normal",r)}),(function(e){resume("throw",e)}))}catch(e){settle("throw",e)}}function settle(e,n){switch(e){case"return":t.resolve({value:n,done:!0});break;case"throw":t.reject(n);break;default:t.resolve({value:n,done:!1})}(t=t.next)?resume(t.key,t.arg):r=null}this._invoke=function(e,n){return new Promise((function(s,u){var l={key:e,arg:n,resolve:s,reject:u,next:null};r?r=r.next=l:(t=r=l,resume(e,n))}))},"function"!=typeof e.return&&(this.return=void 0)}AsyncGenerator.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},AsyncGenerator.prototype.next=function(e){return this._invoke("next",e)},AsyncGenerator.prototype.throw=function(e){return this._invoke("throw",e)},AsyncGenerator.prototype.return=function(e){return this._invoke("return",e)};var n=require("webidl-conversions"),s=require("./utils.js"),u=s.implSymbol,l=s.ctorRegistrySymbol;function makeWrapper$1(e,t){var r;return void 0!==t&&(r=t.prototype),s.isObject(r)||(r=e[l].URL.prototype),Object.create(r)}e.is=function(e){return s.isObject(e)&&s.hasOwn(e,u)&&e[u]instanceof h.implementation},e.isImpl=function(e){return s.isObject(e)&&e instanceof h.implementation},e.convert=function(t,r){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).context,u=void 0===n?"The provided value":n;if(e.is(r))return s.implForWrapper(r);throw new t.TypeError("".concat(u," is not of type 'URL'."))},e.create=function(t,r,n){var s=makeWrapper$1(t);return e.setup(s,t,r,n)},e.createImpl=function(t,r,n){var u=e.create(t,r,n);return s.implForWrapper(u)},e._internalSetup=function(e,t){},e.setup=function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return l.wrapper=t,e._internalSetup(t,r),Object.defineProperty(t,u,{value:new h.implementation(r,n,l),configurable:!0}),t[u][s.wrapperSymbol]=t,h.init&&h.init(t[u]),t},e.new=function(t,r){var n=makeWrapper$1(t,r);return e._internalSetup(n,t),Object.defineProperty(n,u,{value:Object.create(h.implementation.prototype),configurable:!0}),n[u][s.wrapperSymbol]=n,h.init&&h.init(n[u]),n[u]};var c=new Set(["Window","Worker"]);e.install=function(t,r){if(r.some((function(e){return c.has(e)}))){var l=s.initCtorRegistry(t),y=function(){return _createClass((function URL(r){if(_classCallCheck(this,URL),arguments.length<1)throw new t.TypeError("Failed to construct 'URL': 1 argument required, but only ".concat(arguments.length," present."));var s=[],u=arguments[0];u=n.USVString(u,{context:"Failed to construct 'URL': parameter 1",globals:t}),s.push(u);var l=arguments[1];return void 0!==l&&(l=n.USVString(l,{context:"Failed to construct 'URL': parameter 2",globals:t})),s.push(l),e.setup(Object.create((this instanceof URL?this.constructor:void 0).prototype),t,s)}),[{key:"toJSON",value:function toJSON(){var r=null!=this?this:t;if(!e.is(r))throw new t.TypeError("'toJSON' called on an object that is not a valid instance of URL.");return r[u].toJSON()}},{key:"href",get:function get(){var r=null!=this?this:t;if(!e.is(r))throw new t.TypeError("'get href' called on an object that is not a valid instance of URL.");return r[u].href},set:function set(r){var s=null!=this?this:t;if(!e.is(s))throw new t.TypeError("'set href' called on an object that is not a valid instance of URL.");r=n.USVString(r,{context:"Failed to set the 'href' property on 'URL': The provided value",globals:t}),s[u].href=r}},{key:"toString",value:function toString(){if(!e.is(this))throw new t.TypeError("'toString' called on an object that is not a valid instance of URL.");return this[u].href}},{key:"origin",get:function get(){var r=null!=this?this:t;if(!e.is(r))throw new t.TypeError("'get origin' called on an object that is not a valid instance of URL.");return r[u].origin}},{key:"protocol",get:function get(){var r=null!=this?this:t;if(!e.is(r))throw new t.TypeError("'get protocol' called on an object that is not a valid instance of URL.");return r[u].protocol},set:function set(r){var s=null!=this?this:t;if(!e.is(s))throw new t.TypeError("'set protocol' called on an object that is not a valid instance of URL.");r=n.USVString(r,{context:"Failed to set the 'protocol' property on 'URL': The provided value",globals:t}),s[u].protocol=r}},{key:"username",get:function get(){var r=null!=this?this:t;if(!e.is(r))throw new t.TypeError("'get username' called on an object that is not a valid instance of URL.");return r[u].username},set:function set(r){var s=null!=this?this:t;if(!e.is(s))throw new t.TypeError("'set username' called on an object that is not a valid instance of URL.");r=n.USVString(r,{context:"Failed to set the 'username' property on 'URL': The provided value",globals:t}),s[u].username=r}},{key:"password",get:function get(){var r=null!=this?this:t;if(!e.is(r))throw new t.TypeError("'get password' called on an object that is not a valid instance of URL.");return r[u].password},set:function set(r){var s=null!=this?this:t;if(!e.is(s))throw new t.TypeError("'set password' called on an object that is not a valid instance of URL.");r=n.USVString(r,{context:"Failed to set the 'password' property on 'URL': The provided value",globals:t}),s[u].password=r}},{key:"host",get:function get(){var r=null!=this?this:t;if(!e.is(r))throw new t.TypeError("'get host' called on an object that is not a valid instance of URL.");return r[u].host},set:function set(r){var s=null!=this?this:t;if(!e.is(s))throw new t.TypeError("'set host' called on an object that is not a valid instance of URL.");r=n.USVString(r,{context:"Failed to set the 'host' property on 'URL': The provided value",globals:t}),s[u].host=r}},{key:"hostname",get:function get(){var r=null!=this?this:t;if(!e.is(r))throw new t.TypeError("'get hostname' called on an object that is not a valid instance of URL.");return r[u].hostname},set:function set(r){var s=null!=this?this:t;if(!e.is(s))throw new t.TypeError("'set hostname' called on an object that is not a valid instance of URL.");r=n.USVString(r,{context:"Failed to set the 'hostname' property on 'URL': The provided value",globals:t}),s[u].hostname=r}},{key:"port",get:function get(){var r=null!=this?this:t;if(!e.is(r))throw new t.TypeError("'get port' called on an object that is not a valid instance of URL.");return r[u].port},set:function set(r){var s=null!=this?this:t;if(!e.is(s))throw new t.TypeError("'set port' called on an object that is not a valid instance of URL.");r=n.USVString(r,{context:"Failed to set the 'port' property on 'URL': The provided value",globals:t}),s[u].port=r}},{key:"pathname",get:function get(){var r=null!=this?this:t;if(!e.is(r))throw new t.TypeError("'get pathname' called on an object that is not a valid instance of URL.");return r[u].pathname},set:function set(r){var s=null!=this?this:t;if(!e.is(s))throw new t.TypeError("'set pathname' called on an object that is not a valid instance of URL.");r=n.USVString(r,{context:"Failed to set the 'pathname' property on 'URL': The provided value",globals:t}),s[u].pathname=r}},{key:"search",get:function get(){var r=null!=this?this:t;if(!e.is(r))throw new t.TypeError("'get search' called on an object that is not a valid instance of URL.");return r[u].search},set:function set(r){var s=null!=this?this:t;if(!e.is(s))throw new t.TypeError("'set search' called on an object that is not a valid instance of URL.");r=n.USVString(r,{context:"Failed to set the 'search' property on 'URL': The provided value",globals:t}),s[u].search=r}},{key:"searchParams",get:function get(){var r=null!=this?this:t;if(!e.is(r))throw new t.TypeError("'get searchParams' called on an object that is not a valid instance of URL.");return s.getSameObject(this,"searchParams",(function(){return s.tryWrapperForImpl(r[u].searchParams)}))}},{key:"hash",get:function get(){var r=null!=this?this:t;if(!e.is(r))throw new t.TypeError("'get hash' called on an object that is not a valid instance of URL.");return r[u].hash},set:function set(r){var s=null!=this?this:t;if(!e.is(s))throw new t.TypeError("'set hash' called on an object that is not a valid instance of URL.");r=n.USVString(r,{context:"Failed to set the 'hash' property on 'URL': The provided value",globals:t}),s[u].hash=r}}],[{key:"parse",value:function parse(e){var r;if(arguments.length<1)throw new t.TypeError("Failed to execute 'parse' on 'URL': 1 argument required, but only ".concat(arguments.length," present."));var u=[],l=arguments[0];l=n.USVString(l,{context:"Failed to execute 'parse' on 'URL': parameter 1",globals:t}),u.push(l);var c=arguments[1];return void 0!==c&&(c=n.USVString(c,{context:"Failed to execute 'parse' on 'URL': parameter 2",globals:t})),u.push(c),s.tryWrapperForImpl((r=h.implementation).parse.apply(r,[t].concat(u)))}},{key:"canParse",value:function canParse(e){var r;if(arguments.length<1)throw new t.TypeError("Failed to execute 'canParse' on 'URL': 1 argument required, but only ".concat(arguments.length," present."));var s=[],u=arguments[0];u=n.USVString(u,{context:"Failed to execute 'canParse' on 'URL': parameter 1",globals:t}),s.push(u);var l=arguments[1];return void 0!==l&&(l=n.USVString(l,{context:"Failed to execute 'canParse' on 'URL': parameter 2",globals:t})),s.push(l),(r=h.implementation).canParse.apply(r,s)}}])}();Object.defineProperties(y.prototype,_defineProperty({toJSON:{enumerable:!0},href:{enumerable:!0},toString:{enumerable:!0},origin:{enumerable:!0},protocol:{enumerable:!0},username:{enumerable:!0},password:{enumerable:!0},host:{enumerable:!0},hostname:{enumerable:!0},port:{enumerable:!0},pathname:{enumerable:!0},search:{enumerable:!0},searchParams:{enumerable:!0},hash:{enumerable:!0}},Symbol.toStringTag,{value:"URL",configurable:!0})),Object.defineProperties(y,{parse:{enumerable:!0},canParse:{enumerable:!0}}),l.URL=y,Object.defineProperty(t,"URL",{configurable:!0,writable:!0,value:y}),r.includes("Window")&&Object.defineProperty(t,"webkitURL",{configurable:!0,writable:!0,value:y})}};var h=require("./URL-impl.js"),y=getAugmentedNamespace(Object.freeze({__proto__:null})),m=require("webidl-conversions"),v=require("./utils.js"),b=require("./Function.js"),g=v.newObjectInRealm,S=v.implSymbol,w=v.ctorRegistrySymbol,P="URLSearchParams";function makeWrapper(e,t){var r;return void 0!==t&&(r=t.prototype),v.isObject(r)||(r=e[w].URLSearchParams.prototype),Object.create(r)}e.is=function(e){return v.isObject(e)&&v.hasOwn(e,S)&&e[S]instanceof L.implementation},e.isImpl=function(e){return v.isObject(e)&&e instanceof L.implementation},e.convert=function(t,r){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).context,s=void 0===n?"The provided value":n;if(e.is(r))return v.implForWrapper(r);throw new t.TypeError("".concat(s," is not of type 'URLSearchParams'."))},e.createDefaultIterator=function(e,t,r){var n=e[w]["URLSearchParams Iterator"],s=Object.create(n);return Object.defineProperty(s,v.iterInternalSymbol,{value:{target:t,kind:r,index:0},configurable:!0}),s},e.create=function(t,r,n){var s=makeWrapper(t);return e.setup(s,t,r,n)},e.createImpl=function(t,r,n){var s=e.create(t,r,n);return v.implForWrapper(s)},e._internalSetup=function(e,t){},e.setup=function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return s.wrapper=t,e._internalSetup(t,r),Object.defineProperty(t,S,{value:new L.implementation(r,n,s),configurable:!0}),t[S][v.wrapperSymbol]=t,L.init&&L.init(t[S]),t},e.new=function(t,r){var n=makeWrapper(t,r);return e._internalSetup(n,t),Object.defineProperty(n,S,{value:Object.create(L.implementation.prototype),configurable:!0}),n[S][v.wrapperSymbol]=n,L.init&&L.init(n[S]),n[S]};var U=new Set(["Window","Worker"]);e.install=function(t,r){if(r.some((function(e){return U.has(e)}))){var n=v.initCtorRegistry(t),s=function(){return _createClass((function URLSearchParams(){_classCallCheck(this,URLSearchParams);var r=[],n=arguments[0];if(void 0!==n)if(v.isObject(n))if(void 0!==n[Symbol.iterator]){if(!v.isObject(n))throw new t.TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence is not an iterable object.");var s,u=[],l=_createForOfIteratorHelper(n);try{for(l.s();!(s=l.n()).done;){var c=s.value;if(!v.isObject(c))throw new t.TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element is not an iterable object.");var h,y=[],b=_createForOfIteratorHelper(c);try{for(b.s();!(h=b.n()).done;){var g=h.value;g=m.USVString(g,{context:"Failed to construct 'URLSearchParams': parameter 1 sequence's element's element",globals:t}),y.push(g)}}catch(e){b.e(e)}finally{b.f()}c=y,u.push(c)}}catch(e){l.e(e)}finally{l.f()}n=u}else{if(!v.isObject(n))throw new t.TypeError("Failed to construct 'URLSearchParams': parameter 1 record is not an object.");var S,w=Object.create(null),P=_createForOfIteratorHelper(Reflect.ownKeys(n));try{for(P.s();!(S=P.n()).done;){var U=S.value,R=Object.getOwnPropertyDescriptor(n,U);if(R&&R.enumerable){var L=U;L=m.USVString(L,{context:"Failed to construct 'URLSearchParams': parameter 1 record's key",globals:t});var O=n[U];O=m.USVString(O,{context:"Failed to construct 'URLSearchParams': parameter 1 record's value",globals:t}),w[L]=O}}}catch(e){P.e(e)}finally{P.f()}n=w}else n=m.USVString(n,{context:"Failed to construct 'URLSearchParams': parameter 1",globals:t});else n="";return r.push(n),e.setup(Object.create((this instanceof URLSearchParams?this.constructor:void 0).prototype),t,r)}),[{key:"append",value:function append(r,n){var s,u=null!=this?this:t;if(!e.is(u))throw new t.TypeError("'append' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<2)throw new t.TypeError("Failed to execute 'append' on 'URLSearchParams': 2 arguments required, but only ".concat(arguments.length," present."));var l=[],c=arguments[0];c=m.USVString(c,{context:"Failed to execute 'append' on 'URLSearchParams': parameter 1",globals:t}),l.push(c);var h=arguments[1];return h=m.USVString(h,{context:"Failed to execute 'append' on 'URLSearchParams': parameter 2",globals:t}),l.push(h),v.tryWrapperForImpl((s=u[S]).append.apply(s,l))}},{key:"delete",value:function _delete(r){var n,s=null!=this?this:t;if(!e.is(s))throw new t.TypeError("'delete' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new t.TypeError("Failed to execute 'delete' on 'URLSearchParams': 1 argument required, but only ".concat(arguments.length," present."));var u=[],l=arguments[0];l=m.USVString(l,{context:"Failed to execute 'delete' on 'URLSearchParams': parameter 1",globals:t}),u.push(l);var c=arguments[1];return void 0!==c&&(c=m.USVString(c,{context:"Failed to execute 'delete' on 'URLSearchParams': parameter 2",globals:t})),u.push(c),v.tryWrapperForImpl((n=s[S]).delete.apply(n,u))}},{key:"get",value:function get(r){var n,s=null!=this?this:t;if(!e.is(s))throw new t.TypeError("'get' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new t.TypeError("Failed to execute 'get' on 'URLSearchParams': 1 argument required, but only ".concat(arguments.length," present."));var u=[],l=arguments[0];return l=m.USVString(l,{context:"Failed to execute 'get' on 'URLSearchParams': parameter 1",globals:t}),u.push(l),(n=s[S]).get.apply(n,u)}},{key:"getAll",value:function getAll(r){var n,s=null!=this?this:t;if(!e.is(s))throw new t.TypeError("'getAll' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new t.TypeError("Failed to execute 'getAll' on 'URLSearchParams': 1 argument required, but only ".concat(arguments.length," present."));var u=[],l=arguments[0];return l=m.USVString(l,{context:"Failed to execute 'getAll' on 'URLSearchParams': parameter 1",globals:t}),u.push(l),v.tryWrapperForImpl((n=s[S]).getAll.apply(n,u))}},{key:"has",value:function has(r){var n,s=null!=this?this:t;if(!e.is(s))throw new t.TypeError("'has' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new t.TypeError("Failed to execute 'has' on 'URLSearchParams': 1 argument required, but only ".concat(arguments.length," present."));var u=[],l=arguments[0];l=m.USVString(l,{context:"Failed to execute 'has' on 'URLSearchParams': parameter 1",globals:t}),u.push(l);var c=arguments[1];return void 0!==c&&(c=m.USVString(c,{context:"Failed to execute 'has' on 'URLSearchParams': parameter 2",globals:t})),u.push(c),(n=s[S]).has.apply(n,u)}},{key:"set",value:function set(r,n){var s,u=null!=this?this:t;if(!e.is(u))throw new t.TypeError("'set' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<2)throw new t.TypeError("Failed to execute 'set' on 'URLSearchParams': 2 arguments required, but only ".concat(arguments.length," present."));var l=[],c=arguments[0];c=m.USVString(c,{context:"Failed to execute 'set' on 'URLSearchParams': parameter 1",globals:t}),l.push(c);var h=arguments[1];return h=m.USVString(h,{context:"Failed to execute 'set' on 'URLSearchParams': parameter 2",globals:t}),l.push(h),v.tryWrapperForImpl((s=u[S]).set.apply(s,l))}},{key:"sort",value:function sort(){var r=null!=this?this:t;if(!e.is(r))throw new t.TypeError("'sort' called on an object that is not a valid instance of URLSearchParams.");return v.tryWrapperForImpl(r[S].sort())}},{key:"toString",value:function toString(){var r=null!=this?this:t;if(!e.is(r))throw new t.TypeError("'toString' called on an object that is not a valid instance of URLSearchParams.");return r[S].toString()}},{key:"keys",value:function keys(){if(!e.is(this))throw new t.TypeError("'keys' called on an object that is not a valid instance of URLSearchParams.");return e.createDefaultIterator(t,this,"key")}},{key:"values",value:function values(){if(!e.is(this))throw new t.TypeError("'values' called on an object that is not a valid instance of URLSearchParams.");return e.createDefaultIterator(t,this,"value")}},{key:"entries",value:function entries(){if(!e.is(this))throw new t.TypeError("'entries' called on an object that is not a valid instance of URLSearchParams.");return e.createDefaultIterator(t,this,"key+value")}},{key:"forEach",value:function forEach(r){if(!e.is(this))throw new t.TypeError("'forEach' called on an object that is not a valid instance of URLSearchParams.");if(arguments.length<1)throw new t.TypeError("Failed to execute 'forEach' on 'iterable': 1 argument required, but only 0 present.");r=b.convert(t,r,{context:"Failed to execute 'forEach' on 'iterable': The callback provided as parameter 1"});for(var n=arguments[1],s=Array.from(this[S]),u=0;u<s.length;){var l=_slicedToArray(s[u].map(v.tryWrapperForImpl),2),c=l[0],h=l[1];r.call(n,h,c,this),s=Array.from(this[S]),u++}}},{key:"size",get:function get(){var r=null!=this?this:t;if(!e.is(r))throw new t.TypeError("'get size' called on an object that is not a valid instance of URLSearchParams.");return r[S].size}}])}();Object.defineProperties(s.prototype,_defineProperty(_defineProperty({append:{enumerable:!0},delete:{enumerable:!0},get:{enumerable:!0},getAll:{enumerable:!0},has:{enumerable:!0},set:{enumerable:!0},sort:{enumerable:!0},toString:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0},forEach:{enumerable:!0},size:{enumerable:!0}},Symbol.toStringTag,{value:"URLSearchParams",configurable:!0}),Symbol.iterator,{value:s.prototype.entries,configurable:!0,writable:!0})),n[P]=s,n["URLSearchParams Iterator"]=Object.create(n["%IteratorPrototype%"],_defineProperty({},Symbol.toStringTag,{configurable:!0,value:"URLSearchParams Iterator"})),v.define(n["URLSearchParams Iterator"],{next:function next(){var e=this&&this[v.iterInternalSymbol];if(!e)throw new t.TypeError("next() called on a value that is not a URLSearchParams iterator object");var r=e.target,n=e.kind,s=e.index,u=Array.from(r[S]);if(s>=u.length)return g(t,{value:void 0,done:!0});var l=u[s];return e.index=s+1,g(t,v.iteratorResult(l.map(v.tryWrapperForImpl),n))}}),Object.defineProperty(t,P,{configurable:!0,writable:!0,value:s})}};var R,L=require("./URLSearchParams-impl.js"),O=getAugmentedNamespace(Object.freeze({__proto__:null}));var x=require("tr46"),E=require("./infra"),j=require("./encoding").utf8DecodeWithoutBOM,I=require("./percent-encoding"),A=I.percentDecodeString,T=I.utf8PercentEncodeCodePoint,_=I.utf8PercentEncodeString,$=I.isC0ControlPercentEncode,D=I.isFragmentPercentEncode,C=I.isQueryPercentEncode,k=I.isSpecialQueryPercentEncode,q=I.isPathPercentEncode,N=I.isUserinfoPercentEncode;function p$1(e){return e.codePointAt(0)}var W={ftp:21,file:null,http:80,https:443,ws:80,wss:443},H=Symbol("failure");function countSymbols(e){return _toConsumableArray(e).length}function at(e,t){var r=e[t];return isNaN(r)?void 0:String.fromCodePoint(r)}function isSingleDot(e){return"."===e||"%2e"===e.toLowerCase()}function isWindowsDriveLetterString(e){return 2===e.length&&E.isASCIIAlpha(e.codePointAt(0))&&(":"===e[1]||"|"===e[1])}function containsForbiddenHostCodePoint(e){return-1!==e.search(/\0|\t|\n|\r| |#|\/|:|<|>|\?|@|\[|\\|\]|\^|\|/)}function isSpecialScheme(e){return void 0!==W[e]}function isSpecial(e){return isSpecialScheme(e.scheme)}function isNotSpecial(e){return!isSpecialScheme(e.scheme)}function defaultPort(e){return W[e]}function parseIPv4Number(e){if(""===e)return H;var t=10;if(e.length>=2&&"0"===e.charAt(0)&&"x"===e.charAt(1).toLowerCase()?(e=e.substring(2),t=16):e.length>=2&&"0"===e.charAt(0)&&(e=e.substring(1),t=8),""===e)return 0;var r=/(?:[\0-\/8-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/;return 10===t&&(r=/(?:[\0-\/:-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/),16===t&&(r=/(?:[\0-\/:-@G-`g-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/),r.test(e)?H:parseInt(e,t)}function parseHost(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("["===e[0])return"]"!==e[e.length-1]?H:function parseIPv6(e){var t=[0,0,0,0,0,0,0,0],r=0,n=null,s=0;if((e=Array.from(e,(function(e){return e.codePointAt(0)})))[s]===p$1(":")){if(e[s+1]!==p$1(":"))return H;s+=2,n=++r}for(;s<e.length;){if(8===r)return H;if(e[s]!==p$1(":")){for(var u=0,l=0;l<4&&E.isASCIIHex(e[s]);)u=16*u+parseInt(at(e,s),16),++s,++l;if(e[s]===p$1(".")){if(0===l)return H;if(s-=l,r>6)return H;for(var c=0;void 0!==e[s];){var h=null;if(c>0){if(!(e[s]===p$1(".")&&c<4))return H;++s}if(!E.isASCIIDigit(e[s]))return H;for(;E.isASCIIDigit(e[s]);){var y=parseInt(at(e,s));if(null===h)h=y;else{if(0===h)return H;h=10*h+y}if(h>255)return H;++s}t[r]=256*t[r]+h,2!=++c&&4!==c||++r}if(4!==c)return H;break}if(e[s]===p$1(":")){if(void 0===e[++s])return H}else if(void 0!==e[s])return H;t[r]=u,++r}else{if(null!==n)return H;++s,n=++r}}if(null!==n){var m=r-n;for(r=7;0!==r&&m>0;){var v=t[n+m-1];t[n+m-1]=t[r],t[r]=v,--r,--m}}else if(null===n&&8!==r)return H;return t}(e.substring(1,e.length-1));if(t)return function parseOpaqueHost(e){if(containsForbiddenHostCodePoint(e))return H;return _(e,$)}(e);var r=function domainToASCII(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=x.toASCII(e,{checkHyphens:t,checkBidi:!0,checkJoiners:!0,useSTD3ASCIIRules:t,transitionalProcessing:!1,verifyDNSLength:t,ignoreInvalidPunycode:!1});if(null===r)return H;if(!t){if(""===r)return H;if(function containsForbiddenDomainCodePoint(e){return containsForbiddenHostCodePoint(e)||-1!==e.search(/[\0-\x1F]|%|\x7F/)}(r))return H}return r}(j(A(e)));return r===H?H:function endsInANumber(e){var t=e.split(".");if(""===t[t.length-1]){if(1===t.length)return!1;t.pop()}var r=t[t.length-1];if(parseIPv4Number(r)!==H)return!0;if(/^[0-9]+$/.test(r))return!0;return!1}(r)?function parseIPv4(e){var t=e.split(".");if(""===t[t.length-1]&&t.length>1&&t.pop(),t.length>4)return H;var r,n=[],s=_createForOfIteratorHelper(t);try{for(s.s();!(r=s.n()).done;){var u=parseIPv4Number(r.value);if(u===H)return H;n.push(u)}}catch(e){s.e(e)}finally{s.f()}for(var l=0;l<n.length-1;++l)if(n[l]>255)return H;if(n[n.length-1]>=Math.pow(256,5-n.length))return H;for(var c=n.pop(),h=0,y=0,m=n;y<m.length;y++)c+=m[y]*Math.pow(256,3-h),++h;return c}(r):r}function serializeHost(e){return"number"==typeof e?function serializeIPv4(e){for(var t="",r=e,n=1;n<=4;++n)t=String(r%256)+t,4!==n&&(t=".".concat(t)),r=Math.floor(r/256);return t}(e):e instanceof Array?"[".concat(function serializeIPv6(e){for(var t="",r=function findTheIPv6AddressCompressedPieceIndex(e){for(var t=null,r=1,n=null,s=0,u=0;u<e.length;++u)0!==e[u]?(s>r&&(t=n,r=s),n=null,s=0):(null===n&&(n=u),++s);return s>r?n:t}(e),n=!1,s=0;s<=7;++s)n&&0===e[s]||(n&&(n=!1),r!==s?(t+=e[s].toString(16),7!==s&&(t+=":")):(t+=0===s?"::":":",n=!0));return t}(e),"]"):e}function shortenPath(e){var t=e.path;0!==t.length&&("file"===e.scheme&&1===t.length&&function isNormalizedWindowsDriveLetter(e){return/^[A-Za-z]:$/.test(e)}(t[0])||t.pop())}function includesCredentials(e){return""!==e.username||""!==e.password}function hasAnOpaquePath(e){return"string"==typeof e.path}function URLStateMachine(e,t,r,n,s){if(this.pointer=0,this.input=e,this.base=t||null,this.encodingOverride=r||"utf-8",this.stateOverride=s,this.url=n,this.failure=!1,this.parseError=!1,!this.url){this.url={scheme:"",username:"",password:"",host:null,port:null,path:[],query:null,fragment:null};var u=function trimControlChars(e){for(var t=0,r=e.length;t<r&&!(e.charCodeAt(t)>32);++t);for(;r>t&&!(e.charCodeAt(r-1)>32);--r);return e.substring(t,r)}(this.input);u!==this.input&&(this.parseError=!0),this.input=u}var l=function trimTabAndNewline(e){return e.replace(/\t|\n|\r/g,"")}(this.input);for(l!==this.input&&(this.parseError=!0),this.input=l,this.state=s||"scheme start",this.buffer="",this.atFlag=!1,this.arrFlag=!1,this.passwordTokenSeenFlag=!1,this.input=Array.from(this.input,(function(e){return e.codePointAt(0)}));this.pointer<=this.input.length;++this.pointer){var c=this.input[this.pointer],h=isNaN(c)?void 0:String.fromCodePoint(c),y=this["parse ".concat(this.state)](c,h);if(!y)break;if(y===H){this.failure=!0;break}}}URLStateMachine.prototype["parse scheme start"]=function parseSchemeStart(e,t){if(E.isASCIIAlpha(e))this.buffer+=t.toLowerCase(),this.state="scheme";else{if(this.stateOverride)return this.parseError=!0,H;this.state="no scheme",--this.pointer}return!0},URLStateMachine.prototype["parse scheme"]=function parseScheme(e,t){if(E.isASCIIAlphanumeric(e)||e===p$1("+")||e===p$1("-")||e===p$1("."))this.buffer+=t.toLowerCase();else if(e===p$1(":")){if(this.stateOverride){if(isSpecial(this.url)&&!isSpecialScheme(this.buffer))return!1;if(!isSpecial(this.url)&&isSpecialScheme(this.buffer))return!1;if((includesCredentials(this.url)||null!==this.url.port)&&"file"===this.buffer)return!1;if("file"===this.url.scheme&&""===this.url.host)return!1}if(this.url.scheme=this.buffer,this.stateOverride)return this.url.port===defaultPort(this.url.scheme)&&(this.url.port=null),!1;this.buffer="","file"===this.url.scheme?(this.input[this.pointer+1]===p$1("/")&&this.input[this.pointer+2]===p$1("/")||(this.parseError=!0),this.state="file"):isSpecial(this.url)&&null!==this.base&&this.base.scheme===this.url.scheme?this.state="special relative or authority":isSpecial(this.url)?this.state="special authority slashes":this.input[this.pointer+1]===p$1("/")?(this.state="path or authority",++this.pointer):(this.url.path="",this.state="opaque path")}else{if(this.stateOverride)return this.parseError=!0,H;this.buffer="",this.state="no scheme",this.pointer=-1}return!0},URLStateMachine.prototype["parse no scheme"]=function parseNoScheme(e){return null===this.base||hasAnOpaquePath(this.base)&&e!==p$1("#")?H:(hasAnOpaquePath(this.base)&&e===p$1("#")?(this.url.scheme=this.base.scheme,this.url.path=this.base.path,this.url.query=this.base.query,this.url.fragment="",this.state="fragment"):"file"===this.base.scheme?(this.state="file",--this.pointer):(this.state="relative",--this.pointer),!0)},URLStateMachine.prototype["parse special relative or authority"]=function parseSpecialRelativeOrAuthority(e){return e===p$1("/")&&this.input[this.pointer+1]===p$1("/")?(this.state="special authority ignore slashes",++this.pointer):(this.parseError=!0,this.state="relative",--this.pointer),!0},URLStateMachine.prototype["parse path or authority"]=function parsePathOrAuthority(e){return e===p$1("/")?this.state="authority":(this.state="path",--this.pointer),!0},URLStateMachine.prototype["parse relative"]=function parseRelative(e){return this.url.scheme=this.base.scheme,e===p$1("/")?this.state="relative slash":isSpecial(this.url)&&e===p$1("\\")?(this.parseError=!0,this.state="relative slash"):(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.url.path=this.base.path.slice(),this.url.query=this.base.query,e===p$1("?")?(this.url.query="",this.state="query"):e===p$1("#")?(this.url.fragment="",this.state="fragment"):isNaN(e)||(this.url.query=null,this.url.path.pop(),this.state="path",--this.pointer)),!0},URLStateMachine.prototype["parse relative slash"]=function parseRelativeSlash(e){return!isSpecial(this.url)||e!==p$1("/")&&e!==p$1("\\")?e===p$1("/")?this.state="authority":(this.url.username=this.base.username,this.url.password=this.base.password,this.url.host=this.base.host,this.url.port=this.base.port,this.state="path",--this.pointer):(e===p$1("\\")&&(this.parseError=!0),this.state="special authority ignore slashes"),!0},URLStateMachine.prototype["parse special authority slashes"]=function parseSpecialAuthoritySlashes(e){return e===p$1("/")&&this.input[this.pointer+1]===p$1("/")?(this.state="special authority ignore slashes",++this.pointer):(this.parseError=!0,this.state="special authority ignore slashes",--this.pointer),!0},URLStateMachine.prototype["parse special authority ignore slashes"]=function parseSpecialAuthorityIgnoreSlashes(e){return e!==p$1("/")&&e!==p$1("\\")?(this.state="authority",--this.pointer):this.parseError=!0,!0},URLStateMachine.prototype["parse authority"]=function parseAuthority(e,t){if(e===p$1("@")){this.parseError=!0,this.atFlag&&(this.buffer="%40".concat(this.buffer)),this.atFlag=!0;for(var r=countSymbols(this.buffer),n=0;n<r;++n){var s=this.buffer.codePointAt(n);if(s!==p$1(":")||this.passwordTokenSeenFlag){var u=T(s,N);this.passwordTokenSeenFlag?this.url.password+=u:this.url.username+=u}else this.passwordTokenSeenFlag=!0}this.buffer=""}else if(isNaN(e)||e===p$1("/")||e===p$1("?")||e===p$1("#")||isSpecial(this.url)&&e===p$1("\\")){if(this.atFlag&&""===this.buffer)return this.parseError=!0,H;this.pointer-=countSymbols(this.buffer)+1,this.buffer="",this.state="host"}else this.buffer+=t;return!0},URLStateMachine.prototype["parse hostname"]=URLStateMachine.prototype["parse host"]=function parseHostName(e,t){if(this.stateOverride&&"file"===this.url.scheme)--this.pointer,this.state="file host";else if(e!==p$1(":")||this.arrFlag)if(isNaN(e)||e===p$1("/")||e===p$1("?")||e===p$1("#")||isSpecial(this.url)&&e===p$1("\\")){if(--this.pointer,isSpecial(this.url)&&""===this.buffer)return this.parseError=!0,H;if(this.stateOverride&&""===this.buffer&&(includesCredentials(this.url)||null!==this.url.port))return this.parseError=!0,!1;var r=parseHost(this.buffer,isNotSpecial(this.url));if(r===H)return H;if(this.url.host=r,this.buffer="",this.state="path start",this.stateOverride)return!1}else e===p$1("[")?this.arrFlag=!0:e===p$1("]")&&(this.arrFlag=!1),this.buffer+=t;else{if(""===this.buffer)return this.parseError=!0,H;if("hostname"===this.stateOverride)return!1;var n=parseHost(this.buffer,isNotSpecial(this.url));if(n===H)return H;this.url.host=n,this.buffer="",this.state="port"}return!0},URLStateMachine.prototype["parse port"]=function parsePort(e,t){if(E.isASCIIDigit(e))this.buffer+=t;else{if(!(isNaN(e)||e===p$1("/")||e===p$1("?")||e===p$1("#")||isSpecial(this.url)&&e===p$1("\\")||this.stateOverride))return this.parseError=!0,H;if(""!==this.buffer){var r=parseInt(this.buffer);if(r>Math.pow(2,16)-1)return this.parseError=!0,H;this.url.port=r===defaultPort(this.url.scheme)?null:r,this.buffer=""}if(this.stateOverride)return!1;this.state="path start",--this.pointer}return!0};var M=new Set([p$1("/"),p$1("\\"),p$1("?"),p$1("#")]);function startsWithWindowsDriveLetter(e,t){var r=e.length-t;return r>=2&&function isWindowsDriveLetterCodePoints(e,t){return E.isASCIIAlpha(e)&&(t===p$1(":")||t===p$1("|"))}(e[t],e[t+1])&&(2===r||M.has(e[t+2]))}function serializePath(e){if(hasAnOpaquePath(e))return e.path;var t,r="",n=_createForOfIteratorHelper(e.path);try{for(n.s();!(t=n.n()).done;){var s=t.value;r+="/".concat(s)}}catch(e){n.e(e)}finally{n.f()}return r}URLStateMachine.prototype["parse file"]=function parseFile(e){return this.url.scheme="file",this.url.host="",e===p$1("/")||e===p$1("\\")?(e===p$1("\\")&&(this.parseError=!0),this.state="file slash"):null!==this.base&&"file"===this.base.scheme?(this.url.host=this.base.host,this.url.path=this.base.path.slice(),this.url.query=this.base.query,e===p$1("?")?(this.url.query="",this.state="query"):e===p$1("#")?(this.url.fragment="",this.state="fragment"):isNaN(e)||(this.url.query=null,startsWithWindowsDriveLetter(this.input,this.pointer)?(this.parseError=!0,this.url.path=[]):shortenPath(this.url),this.state="path",--this.pointer)):(this.state="path",--this.pointer),!0},URLStateMachine.prototype["parse file slash"]=function parseFileSlash(e){return e===p$1("/")||e===p$1("\\")?(e===p$1("\\")&&(this.parseError=!0),this.state="file host"):(null!==this.base&&"file"===this.base.scheme&&(!startsWithWindowsDriveLetter(this.input,this.pointer)&&function isNormalizedWindowsDriveLetterString(e){return 2===e.length&&E.isASCIIAlpha(e.codePointAt(0))&&":"===e[1]}(this.base.path[0])&&this.url.path.push(this.base.path[0]),this.url.host=this.base.host),this.state="path",--this.pointer),!0},URLStateMachine.prototype["parse file host"]=function parseFileHost(e,t){if(isNaN(e)||e===p$1("/")||e===p$1("\\")||e===p$1("?")||e===p$1("#"))if(--this.pointer,!this.stateOverride&&isWindowsDriveLetterString(this.buffer))this.parseError=!0,this.state="path";else if(""===this.buffer){if(this.url.host="",this.stateOverride)return!1;this.state="path start"}else{var r=parseHost(this.buffer,isNotSpecial(this.url));if(r===H)return H;if("localhost"===r&&(r=""),this.url.host=r,this.stateOverride)return!1;this.buffer="",this.state="path start"}else this.buffer+=t;return!0},URLStateMachine.prototype["parse path start"]=function parsePathStart(e){return isSpecial(this.url)?(e===p$1("\\")&&(this.parseError=!0),this.state="path",e!==p$1("/")&&e!==p$1("\\")&&--this.pointer):this.stateOverride||e!==p$1("?")?this.stateOverride||e!==p$1("#")?void 0!==e?(this.state="path",e!==p$1("/")&&--this.pointer):this.stateOverride&&null===this.url.host&&this.url.path.push(""):(this.url.fragment="",this.state="fragment"):(this.url.query="",this.state="query"),!0},URLStateMachine.prototype["parse path"]=function parsePath(e){return isNaN(e)||e===p$1("/")||isSpecial(this.url)&&e===p$1("\\")||!this.stateOverride&&(e===p$1("?")||e===p$1("#"))?(isSpecial(this.url)&&e===p$1("\\")&&(this.parseError=!0),!function isDoubleDot(e){return".."===(e=e.toLowerCase())||"%2e."===e||".%2e"===e||"%2e%2e"===e}(this.buffer)?!isSingleDot(this.buffer)||e===p$1("/")||isSpecial(this.url)&&e===p$1("\\")?isSingleDot(this.buffer)||("file"===this.url.scheme&&0===this.url.path.length&&isWindowsDriveLetterString(this.buffer)&&(this.buffer="".concat(this.buffer[0],":")),this.url.path.push(this.buffer)):this.url.path.push(""):(shortenPath(this.url),e===p$1("/")||isSpecial(this.url)&&e===p$1("\\")||this.url.path.push("")),this.buffer="",e===p$1("?")&&(this.url.query="",this.state="query"),e===p$1("#")&&(this.url.fragment="",this.state="fragment")):(e!==p$1("%")||E.isASCIIHex(this.input[this.pointer+1])&&E.isASCIIHex(this.input[this.pointer+2])||(this.parseError=!0),this.buffer+=T(e,q)),!0},URLStateMachine.prototype["parse opaque path"]=function parseOpaquePath(e){if(e===p$1("?"))this.url.query="",this.state="query";else if(e===p$1("#"))this.url.fragment="",this.state="fragment";else if(e===p$1(" ")){var t=this.input[this.pointer+1];t===p$1("?")||t===p$1("#")?this.url.path+="%20":this.url.path+=" "}else isNaN(e)||e===p$1("%")||(this.parseError=!0),e!==p$1("%")||E.isASCIIHex(this.input[this.pointer+1])&&E.isASCIIHex(this.input[this.pointer+2])||(this.parseError=!0),isNaN(e)||(this.url.path+=T(e,$));return!0},URLStateMachine.prototype["parse query"]=function parseQuery(e,t){if(isSpecial(this.url)&&"ws"!==this.url.scheme&&"wss"!==this.url.scheme||(this.encodingOverride="utf-8"),!this.stateOverride&&e===p$1("#")||isNaN(e)){var r=isSpecial(this.url)?k:C;this.url.query+=_(this.buffer,r),this.buffer="",e===p$1("#")&&(this.url.fragment="",this.state="fragment")}else isNaN(e)||(e!==p$1("%")||E.isASCIIHex(this.input[this.pointer+1])&&E.isASCIIHex(this.input[this.pointer+2])||(this.parseError=!0),this.buffer+=t);return!0},URLStateMachine.prototype["parse fragment"]=function parseFragment(e){return isNaN(e)||(e!==p$1("%")||E.isASCIIHex(this.input[this.pointer+1])&&E.isASCIIHex(this.input[this.pointer+2])||(this.parseError=!0),this.url.fragment+=T(e,D)),!0},module.exports.serializeURL=function serializeURL(e,t){var r="".concat(e.scheme,":");return null!==e.host&&(r+="//",""===e.username&&""===e.password||(r+=e.username,""!==e.password&&(r+=":".concat(e.password)),r+="@"),r+=serializeHost(e.host),null!==e.port&&(r+=":".concat(e.port))),null===e.host&&!hasAnOpaquePath(e)&&e.path.length>1&&""===e.path[0]&&(r+="/."),r+=serializePath(e),null!==e.query&&(r+="?".concat(e.query)),t||null===e.fragment||(r+="#".concat(e.fragment)),r},module.exports.serializePath=serializePath,module.exports.serializeURLOrigin=function(e){switch(e.scheme){case"blob":var t=module.exports.parseURL(serializePath(e));return null===t||"http"!==t.scheme&&"https"!==t.scheme?"null":module.exports.serializeURLOrigin(t);case"ftp":case"http":case"https":case"ws":case"wss":return function serializeOrigin(e){var t="".concat(e.scheme,"://");return t+=serializeHost(e.host),null!==e.port&&(t+=":".concat(e.port)),t}({scheme:e.scheme,host:e.host,port:e.port});default:return"null"}},module.exports.basicURLParse=function(e,t){void 0===t&&(t={});var r=new URLStateMachine(e,t.baseURL,t.encodingOverride,t.url,t.stateOverride);return r.failure?null:r.url},module.exports.setTheUsername=function(e,t){e.username=_(t,N)},module.exports.setThePassword=function(e,t){e.password=_(t,N)},module.exports.serializeHost=serializeHost,module.exports.cannotHaveAUsernamePasswordPort=function cannotHaveAUsernamePasswordPort(e){return null===e.host||""===e.host||"file"===e.scheme},module.exports.hasAnOpaquePath=hasAnOpaquePath,module.exports.serializeInteger=function(e){return String(e)},module.exports.parseURL=function(e,t){return void 0===t&&(t={}),module.exports.basicURLParse(e,{baseURL:t.baseURL,encodingOverride:t.encodingOverride})};var z=getAugmentedNamespace(Object.freeze({__proto__:null})),G=require("./infra").isASCIIHex,V=require("./encoding").utf8Encode;function p(e){return e.codePointAt(0)}function percentDecodeBytes(e){for(var t=new Uint8Array(e.byteLength),r=0,n=0;n<e.byteLength;++n){var s=e[n];if(37!==s)t[r++]=s;else if(37!==s||G(e[n+1])&&G(e[n+2])){var u=parseInt(String.fromCodePoint(e[n+1],e[n+2]),16);t[r++]=u,n+=2}else t[r++]=s}return t.slice(0,r)}function isC0ControlPercentEncode(e){return e<=31||e>126}var B=new Set([p(" "),p('"'),p("<"),p(">"),p("`")]);var Q=new Set([p(" "),p('"'),p("#"),p("<"),p(">")]);function isQueryPercentEncode(e){return isC0ControlPercentEncode(e)||Q.has(e)}var J=new Set([p("?"),p("`"),p("{"),p("}"),p("^")]);function isPathPercentEncode(e){return isQueryPercentEncode(e)||J.has(e)}var K=new Set([p("/"),p(":"),p(";"),p("="),p("@"),p("["),p("\\"),p("]"),p("|")]);function isUserinfoPercentEncode(e){return isPathPercentEncode(e)||K.has(e)}var X=new Set([p("$"),p("%"),p("&"),p("+"),p(",")]);var Y=new Set([p("!"),p("'"),p("("),p(")"),p("~")]);function utf8PercentEncodeCodePointInternal(e,t){var r,n,s="",u=_createForOfIteratorHelper(V(e));try{for(u.s();!(r=u.n()).done;){var l=r.value;t(l)?s+=(n=void 0,1===(n=l.toString(16).toUpperCase()).length&&(n="0".concat(n)),"%".concat(n)):s+=String.fromCharCode(l)}}catch(e){u.e(e)}finally{u.f()}return s}module.exports={isC0ControlPercentEncode:isC0ControlPercentEncode,isFragmentPercentEncode:function isFragmentPercentEncode(e){return isC0ControlPercentEncode(e)||B.has(e)},isQueryPercentEncode:isQueryPercentEncode,isSpecialQueryPercentEncode:function isSpecialQueryPercentEncode(e){return isQueryPercentEncode(e)||e===p("'")},isPathPercentEncode:isPathPercentEncode,isUserinfoPercentEncode:isUserinfoPercentEncode,isURLEncodedPercentEncode:function isURLEncodedPercentEncode(e){return function isComponentPercentEncode(e){return isUserinfoPercentEncode(e)||X.has(e)}(e)||Y.has(e)},percentDecodeString:function percentDecodeString(e){return percentDecodeBytes(V(e))},percentDecodeBytes:percentDecodeBytes,utf8PercentEncodeString:function utf8PercentEncodeString(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s="",u=_createForOfIteratorHelper(e);try{for(u.s();!(r=u.n()).done;){var l=r.value;s+=n&&" "===l?"+":utf8PercentEncodeCodePointInternal(l,t)}}catch(e){u.e(e)}finally{u.f()}return s},utf8PercentEncodeCodePoint:function utf8PercentEncodeCodePoint(e,t){return utf8PercentEncodeCodePointInternal(String.fromCodePoint(e),t)}};var Z,ee=getAugmentedNamespace(Object.freeze({__proto__:null}));var te=function requireWhatwgUrl(){if(Z)return t;Z=1;var e=function requireWebidl2jsWrapper(){if(R)return r;R=1;var e=y,t=O;return r.URL=e,r.URLSearchParams=t,r}(),n=e.URL,s=e.URLSearchParams,u=z,l=ee,c={Array:Array,Object:Object,Promise:Promise,String:String,TypeError:TypeError};return n.install(c,["Window"]),s.install(c,["Window"]),t.URL=c.URL,t.URLSearchParams=c.URLSearchParams,t.parseURL=u.parseURL,t.basicURLParse=u.basicURLParse,t.serializeURL=u.serializeURL,t.serializePath=u.serializePath,t.serializeHost=u.serializeHost,t.serializeInteger=u.serializeInteger,t.serializeURLOrigin=u.serializeURLOrigin,t.setTheUsername=u.setTheUsername,t.setThePassword=u.setThePassword,t.cannotHaveAUsernamePasswordPort=u.cannotHaveAUsernamePasswordPort,t.hasAnOpaquePath=u.hasAnOpaquePath,t.percentDecodeString=l.percentDecodeString