import{g as e}from"./call-bind.218c9af5.js";import{s as r}from"./side-channel.c8f9a0ad.js";var t=String.prototype.replace,o=/%20/g,n="RFC3986",i={default:n,formatters:{RFC1738:function(e){return t.call(e,o,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:n},a=i,l=Object.prototype.hasOwnProperty,c=Array.isArray,s=function(){for(var e=[],r=0;r<256;++r)e.push("%"+((r<16?"0":"")+r.toString(16)).toUpperCase());return e}(),f=function(e,r){for(var t=r&&r.plainObjects?Object.create(null):{},o=0;o1;){var r=e.pop(),t=r.obj[r.prop];if(c(t)){for(var o=[],n=0;n=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||n===a.RFC1738&&(40===f||41===f)?l+=i.charAt(c):f<128?l+=s[f]:f<2048?l+=s[192|f>>6]+s[128|63&f]:f<55296||f>=57344?l+=s[224|f>>12]+s[128|f>>6&63]+s[128|63&f]:(c+=1,f=65536+((1023&f)<<10|1023&i.charCodeAt(c)),l+=s[240|f>>18]+s[128|f>>12&63]+s[128|f>>6&63]+s[128|63&f])}return l},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,r){if(c(e)){for(var t=[],o=0;o0?N.join(",")||null:void 0}];else if(b(c))k=c;else{var C=Object.keys(N);k=s?C.sort(s):C}for(var R=n&&b(N)&&1===N.length?t+"[]":t,L=0;L-1?e.split(","):e},C=function(e,r,t,o){if(e){var n=t.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,a=t.depth>0&&/(\[[^[\]]*])/.exec(n),l=a?n.slice(0,a.index):n,c=[];if(l){if(!t.plainObjects&&D.call(Object.prototype,l)&&!t.allowPrototypes)return;c.push(l)}for(var s=0;t.depth>0&&null!==(a=i.exec(n))&&s=0;--i){var a,l=e[i];if("[]"===l&&t.parseArrays)a=[].concat(n);else{a=t.plainObjects?Object.create(null):{};var c="["===l.charAt(0)&&"]"===l.charAt(l.length-1)?l.slice(1,-1):l,s=parseInt(c,10);t.parseArrays||""!==c?!isNaN(s)&&l!==c&&String(s)===c&&s>=0&&t.parseArrays&&s<=t.arrayLimit?(a=[])[s]=n:"__proto__"!==c&&(a[c]=n):a={0:n}}n=a}return n}(c,r,t,o)}};const R=e({formats:i,parse:function(e,r){var t=function(e){if(!e)return E;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=void 0===e.charset?E.charset:e.charset;return{allowDots:void 0===e.allowDots?E.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:E.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:E.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:E.arrayLimit,charset:r,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:E.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:E.comma,decoder:"function"==typeof e.decoder?e.decoder:E.decoder,delimiter:"string"==typeof e.delimiter||x.isRegExp(e.delimiter)?e.delimiter:E.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:E.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:E.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:E.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:E.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:E.strictNullHandling}}(r);if(""===e||null==e)return t.plainObjects?Object.create(null):{};for(var o="string"==typeof e?function(e,r){var t,o={__proto__:null},n=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,i=r.parameterLimit===1/0?void 0:r.parameterLimit,a=n.split(r.delimiter,i),l=-1,c=r.charset;if(r.charsetSentinel)for(t=0;t-1&&(f=P(f)?[f]:f),D.call(o,s)?o[s]=x.combine(o[s],f):o[s]=f}return o}(e,t):e,n=t.plainObjects?Object.create(null):{},i=Object.keys(o),a=0;a0?g+d:""}});export{R as q};