!function(){function e(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function r(r){for(var n=1;nnull==e,f=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)),p=Symbol("encodeFragmentIdentifier");function y(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function d(e,r){return r.encode?r.strict?f(e):encodeURIComponent(e):e}function m(e,r){return r.decode?a(e):e}function g(e){return Array.isArray(e)?e.sort():"object"==typeof e?g(Object.keys(e)).sort(((e,r)=>Number(e)-Number(r))).map((r=>e[r])):e}function b(e){const r=e.indexOf("#");return-1!==r&&(e=e.slice(0,r)),e}function j(e,r){return r.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!r.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function O(e){const r=(e=b(e)).indexOf("?");return-1===r?"":e.slice(r+1)}function v(e,t){y((t=r({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const n=function(e){let r;switch(e.arrayFormat){case"index":return(e,t,n)=>{r=/\[(\d*)]$/.exec(e),e=e.replace(/\[\d*]$/,""),r?(void 0===n[e]&&(n[e]={}),n[e][r[1]]=t):n[e]=t};case"bracket":return(e,t,n)=>{r=/(\[])$/.exec(e),e=e.replace(/\[]$/,""),r?void 0!==n[e]?n[e]=[...n[e],t]:n[e]=[t]:n[e]=t};case"colon-list-separator":return(e,t,n)=>{r=/(:list)$/.exec(e),e=e.replace(/:list$/,""),r?void 0!==n[e]?n[e]=[...n[e],t]:n[e]=[t]:n[e]=t};case"comma":case"separator":return(r,t,n)=>{const o="string"==typeof t&&t.includes(e.arrayFormatSeparator),i="string"==typeof t&&!o&&m(t,e).includes(e.arrayFormatSeparator);t=i?m(t,e):t;const c=o||i?t.split(e.arrayFormatSeparator).map((r=>m(r,e))):null===t?t:m(t,e);n[r]=c};case"bracket-separator":return(r,t,n)=>{const o=/(\[])$/.test(r);if(r=r.replace(/\[]$/,""),!o)return void(n[r]=t?m(t,e):t);const i=null===t?[]:t.split(e.arrayFormatSeparator).map((r=>m(r,e)));void 0!==n[r]?n[r]=[...n[r],...i]:n[r]=i};default:return(e,r,t)=>{void 0!==t[e]?t[e]=[...[t[e]].flat(),r]:t[e]=r}}}(t),o=Object.create(null);if("string"!=typeof e)return o;if(!(e=e.trim().replace(/^[?#&]/,"")))return o;for(const r of e.split("&")){if(""===r)continue;const e=t.decode?r.replace(/\+/g," "):r;let[i,c]=s(e,"=");void 0===i&&(i=e),c=void 0===c?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?c:m(c,t),n(m(i,t),c,o)}for(const[r,i]of Object.entries(o))if("object"==typeof i&&null!==i)for(const[e,n]of Object.entries(i))i[e]=j(n,t);else o[r]=j(i,t);return!1===t.sort?o:(!0===t.sort?Object.keys(o).sort():Object.keys(o).sort(t.sort)).reduce(((e,r)=>{const t=o[r];return Boolean(t)&&"object"==typeof t&&!Array.isArray(t)?e[r]=g(t):e[r]=t,e}),Object.create(null))}function h(e,t){if(!e)return"";y((t=r({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const n=r=>t.skipNull&&l(e[r])||t.skipEmptyString&&""===e[r],o=function(e){switch(e.arrayFormat){case"index":return r=>(t,n)=>{const o=t.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?t:null===n?[...t,[d(r,e),"[",o,"]"].join("")]:[...t,[d(r,e),"[",d(o,e),"]=",d(n,e)].join("")]};case"bracket":return r=>(t,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?t:null===n?[...t,[d(r,e),"[]"].join("")]:[...t,[d(r,e),"[]=",d(n,e)].join("")];case"colon-list-separator":return r=>(t,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?t:null===n?[...t,[d(r,e),":list="].join("")]:[...t,[d(r,e),":list=",d(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{const r="bracket-separator"===e.arrayFormat?"[]=":"=";return t=>(n,o)=>void 0===o||e.skipNull&&null===o||e.skipEmptyString&&""===o?n:(o=null===o?"":o,0===n.length?[[d(t,e),r,d(o,e)].join("")]:[[n,d(o,e)].join(e.arrayFormatSeparator)])}default:return r=>(t,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?t:null===n?[...t,d(r,e)]:[...t,[d(r,e),"=",d(n,e)].join("")]}}(t),i={};for(const[r,a]of Object.entries(e))n(r)||(i[r]=a);const c=Object.keys(i);return!1!==t.sort&&c.sort(t.sort),c.map((r=>{const n=e[r];return void 0===n?"":null===n?d(r,t):Array.isArray(n)?0===n.length&&"bracket-separator"===t.arrayFormat?d(r,t)+"[]":n.reduce(o(r),[]).join("&"):d(r,t)+"="+d(n,t)})).filter((e=>e.length>0)).join("&")}function w(e,t){var n,o,i;t=r({decode:!0},t);let[c,a]=s(e,"#");return void 0===c&&(c=e),r({url:null!==(n=null===(o=c)||void 0===o||null===(i=o.split("?"))||void 0===i?void 0:i[0])&&void 0!==n?n:"",query:v(O(e),t)},t&&t.parseFragmentIdentifier&&a?{fragmentIdentifier:m(a,t)}:{})}function k(e,t){t=r({encode:!0,strict:!0,[p]:!0},t);const n=b(e.url).split("?")[0]||"";let o=h(r(r({},v(O(e.url),{sort:!1})),e.query),t);o&&(o=`?${o}`);let i=function(e){let r="";const t=e.indexOf("#");return-1!==t&&(r=e.slice(t)),r}(e.url);if(e.fragmentIdentifier){const r=new URL(n);r.hash=e.fragmentIdentifier,i=t[p]?r.hash:`#${e.fragmentIdentifier}`}return`${n}${o}${i}`}function F(e,t,n){n=r({parseFragmentIdentifier:!0,[p]:!1},n);const{url:o,query:i,fragmentIdentifier:c}=w(e,n);return k({url:o,query:u(i,t),fragmentIdentifier:c},n)}const S=Object.freeze(Object.defineProperty({__proto__:null,exclude:function(e,r,t){return F(e,Array.isArray(r)?e=>!r.includes(e):(e,t)=>!r(e,t),t)},extract:O,parse:v,parseUrl:w,pick:F,stringify:h,stringifyUrl:k},Symbol.toStringTag,{value:"Module"}));e("q",S)}}}))}();