/** `URLSearchParams`: query-string parsing and serialization, and the store behind `URL.searchParams`. */ export declare const URL_SEARCH_PARAMS_POLYFILL = "\n // application/x-www-form-urlencoded reads '+' as a space, and leaves an escape it cannot read alone.\n // Decoding one well-formed run at a time is what keeps a stray '%' \u2014 '?discount=50%', a half-encoded cursor \u2014 from throwing URIError and ending the run.\n const decodeFormPart = (value) =>\n value.replace(/\\+/g, ' ').replace(/(?:%[0-9A-Fa-f]{2})+/g, (escaped) => {\n try { return decodeURIComponent(escaped); } catch (error) { return escaped; }\n });\n\n // The same rules in reverse: everything but alphanumerics and * - . _ is percent-encoded, and a space is '+'. encodeURIComponent keeps !'()~ literal, so those are encoded after it runs.\n const encodeFormPart = (value) =>\n encodeURIComponent(String(value))\n .replace(/%20/g, '+')\n .replace(/[!'()~]/g, (char) => '%' + char.charCodeAt(0).toString(16).toUpperCase());\n\n const URLSearchParams = class URLSearchParams {\n constructor(init) {\n this._params = [];\n if (init == null) return;\n if (typeof init === 'string') {\n const str = init.startsWith('?') ? init.slice(1) : init;\n for (const pair of (str ? str.split('&') : [])) {\n if (pair === '') continue;\n const eq = pair.indexOf('=');\n const key = eq >= 0 ? pair.slice(0, eq) : pair;\n const value = eq >= 0 ? pair.slice(eq + 1) : '';\n this._params.push([decodeFormPart(key), decodeFormPart(value)]);\n }\n } else if (typeof init[Symbol.iterator] === 'function') {\n // [['a', '1'], ['b', '2']] and another URLSearchParams both arrive here.\n for (const [key, value] of init) this._params.push([String(key), String(value)]);\n } else if (typeof init === 'object') {\n for (const [key, value] of Object.entries(init)) this._params.push([key, String(value)]);\n }\n }\n get size() { return this._params.length; }\n append(key, value) { this._params.push([String(key), String(value)]); }\n set(key, value) {\n const k = String(key), v = String(value);\n const at = this._params.findIndex(([pk]) => pk === k);\n if (at === -1) { this._params.push([k, v]); return; }\n // Overwrite where the key already sat, so an edit does not reorder the query the server sent.\n this._params[at] = [k, v];\n this._params = this._params.filter(([pk], index) => pk !== k || index === at);\n }\n get(key) { return (this._params.find(([k]) => k === String(key)) ?? [undefined, null])[1]; }\n getAll(key) { return this._params.filter(([k]) => k === String(key)).map(([, v]) => v); }\n has(key) { return this._params.some(([k]) => k === String(key)); }\n delete(key) { this._params = this._params.filter(([k]) => k !== String(key)); }\n forEach(callback, thisArg) {\n for (const [k, v] of [...this._params]) callback.call(thisArg, v, k, this);\n }\n keys() { return this._params.map(([k]) => k).values(); }\n values() { return this._params.map(([, v]) => v).values(); }\n entries() { return this._params.map(([k, v]) => [k, v]).values(); }\n sort() { this._params.sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0)); }\n [Symbol.iterator]() { return this.entries(); }\n toString() {\n return this._params\n .map(([k, v]) => encodeFormPart(k) + '=' + encodeFormPart(v))\n .join('&');\n }\n };\n globalThis.URLSearchParams = URLSearchParams;\n"; //# sourceMappingURL=url-search-params.d.ts.map