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AAcD,EAAW9H,KAAI,SAAUgI,GACvC,OAAO1B,EAAc0B,EAAWV,EAAeU,GAAYvB,GAAU,MAqBzE,MAAO,CAjBa,WAAc,WAG9B,IADA,IAAIwB,EAAgB,GACX3J,EAAI,EAAGA,EAAIwJ,EAAWpK,SAAUY,EACrC2J,EAAcH,EAAWxJ,IAAMyJ,EAAYzJ,GAE/C,OAAO2J,IACRF,GAEY,eAAkB,SAAUG,EAAS7B,GAEhD,IAAI8B,EJlEL,SAA2Bb,EAAgBjE,GAG9C,IAFA,IAAI0B,EAAe,GAEVqD,EAAK,EAAGC,EADArJ,OAAOC,KAAKoE,GACe+E,EAAKC,EAAa3K,OAAQ0K,IAAM,CACxE,IAAIJ,EAAYK,EAAaD,GACzBlB,EAAe7D,EAAM2E,GACL,MAAhBd,EAICI,EAAeU,GAShBjD,EAAaiD,GAAaV,EAAeU,GAAWhH,OAAOqC,EAAM2E,IAHjEjD,EAAaiD,GAAapI,OAAOsH,GATjCnC,EAAaiD,QAAa7F,EAelC,OAAO4C,EI4CkBuD,CAAkBhB,EAAgBY,GAEvD,EAAeC,EAAgBvB,EAAWC,QAAQ7B,UAAY8B,EAAYD,QAC1ED,EAAWC,QAASR,KACrB,CAACiB","sources":["webpack://mitutoyo-portal/./node_modules/decode-uri-component/index.js","webpack://mitutoyo-portal/./node_modules/object-assign/index.js","webpack://mitutoyo-portal/./node_modules/query-string/index.js","webpack://mitutoyo-portal/./node_modules/strict-uri-encode/index.js","webpack://mitutoyo-portal/./node_modules/serialize-query-params/esm/params.js","webpack://mitutoyo-portal/./node_modules/serialize-query-params/esm/serialize.js","webpack://mitutoyo-portal/./node_modules/serialize-query-params/esm/updateLocation.js","webpack://mitutoyo-portal/./node_modules/serialize-query-params/esm/encodeQueryParams.js","webpack://mitutoyo-portal/./node_modules/use-query-params/esm/QueryParamProvider.js","webpack://mitutoyo-portal/./node_modules/use-query-params/esm/updateUrlQuery.js","webpack://mitutoyo-portal/./node_modules/use-query-params/esm/useQueryParam.js","webpack://mitutoyo-portal/./node_modules/use-query-params/esm/useQueryParams.js"],"sourcesContent":["'use strict';\nvar token = '%[a-f0-9]{2}';\nvar singleMatcher = new RegExp(token, 'gi');\nvar multiMatcher = new RegExp('(' + token + ')+', 'gi');\n\nfunction decodeComponents(components, split) {\n\ttry {\n\t\t// Try to decode the entire string first\n\t\treturn decodeURIComponent(components.join(''));\n\t} catch (err) {\n\t\t// Do nothing\n\t}\n\n\tif (components.length === 1) {\n\t\treturn components;\n\t}\n\n\tsplit = split || 1;\n\n\t// Split the array in 2 parts\n\tvar left = components.slice(0, split);\n\tvar right = components.slice(split);\n\n\treturn Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right));\n}\n\nfunction decode(input) {\n\ttry {\n\t\treturn decodeURIComponent(input);\n\t} catch (err) {\n\t\tvar tokens = input.match(singleMatcher);\n\n\t\tfor (var i = 1; i < tokens.length; i++) {\n\t\t\tinput = decodeComponents(tokens, i).join('');\n\n\t\t\ttokens = input.match(singleMatcher);\n\t\t}\n\n\t\treturn input;\n\t}\n}\n\nfunction customDecodeURIComponent(input) {\n\t// Keep track of all the replacements and prefill the map with the `BOM`\n\tvar replaceMap = {\n\t\t'%FE%FF': '\\uFFFD\\uFFFD',\n\t\t'%FF%FE': '\\uFFFD\\uFFFD'\n\t};\n\n\tvar match = multiMatcher.exec(input);\n\twhile (match) {\n\t\ttry {\n\t\t\t// Decode as big chunks as possible\n\t\t\treplaceMap[match[0]] = decodeURIComponent(match[0]);\n\t\t} catch (err) {\n\t\t\tvar result = decode(match[0]);\n\n\t\t\tif (result !== match[0]) {\n\t\t\t\treplaceMap[match[0]] = result;\n\t\t\t}\n\t\t}\n\n\t\tmatch = multiMatcher.exec(input);\n\t}\n\n\t// Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else\n\treplaceMap['%C2'] = '\\uFFFD';\n\n\tvar entries = Object.keys(replaceMap);\n\n\tfor (var i = 0; i < entries.length; i++) {\n\t\t// Replace all decoded components\n\t\tvar key = entries[i];\n\t\tinput = input.replace(new RegExp(key, 'g'), replaceMap[key]);\n\t}\n\n\treturn input;\n}\n\nmodule.exports = function (encodedURI) {\n\tif (typeof encodedURI !== 'string') {\n\t\tthrow new TypeError('Expected `encodedURI` to be of type `string`, got `' + typeof encodedURI + '`');\n\t}\n\n\ttry {\n\t\tencodedURI = encodedURI.replace(/\\+/g, ' ');\n\n\t\t// Try the built in decoder first\n\t\treturn decodeURIComponent(encodedURI);\n\t} catch (err) {\n\t\t// Fallback to a more advanced decoder\n\t\treturn customDecodeURIComponent(encodedURI);\n\t}\n};\n","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","'use strict';\nvar strictUriEncode = require('strict-uri-encode');\nvar objectAssign = require('object-assign');\nvar decodeComponent = require('decode-uri-component');\n\nfunction encoderForArrayFormat(opts) {\n\tswitch (opts.arrayFormat) {\n\t\tcase 'index':\n\t\t\treturn function (key, value, index) {\n\t\t\t\treturn value === null ? [\n\t\t\t\t\tencode(key, opts),\n\t\t\t\t\t'[',\n\t\t\t\t\tindex,\n\t\t\t\t\t']'\n\t\t\t\t].join('') : [\n\t\t\t\t\tencode(key, opts),\n\t\t\t\t\t'[',\n\t\t\t\t\tencode(index, opts),\n\t\t\t\t\t']=',\n\t\t\t\t\tencode(value, opts)\n\t\t\t\t].join('');\n\t\t\t};\n\n\t\tcase 'bracket':\n\t\t\treturn function (key, value) {\n\t\t\t\treturn value === null ? encode(key, opts) : [\n\t\t\t\t\tencode(key, opts),\n\t\t\t\t\t'[]=',\n\t\t\t\t\tencode(value, opts)\n\t\t\t\t].join('');\n\t\t\t};\n\n\t\tdefault:\n\t\t\treturn function (key, value) {\n\t\t\t\treturn value === null ? encode(key, opts) : [\n\t\t\t\t\tencode(key, opts),\n\t\t\t\t\t'=',\n\t\t\t\t\tencode(value, opts)\n\t\t\t\t].join('');\n\t\t\t};\n\t}\n}\n\nfunction parserForArrayFormat(opts) {\n\tvar result;\n\n\tswitch (opts.arrayFormat) {\n\t\tcase 'index':\n\t\t\treturn function (key, value, accumulator) {\n\t\t\t\tresult = /\\[(\\d*)\\]$/.exec(key);\n\n\t\t\t\tkey = key.replace(/\\[\\d*\\]$/, '');\n\n\t\t\t\tif (!result) {\n\t\t\t\t\taccumulator[key] = value;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (accumulator[key] === undefined) {\n\t\t\t\t\taccumulator[key] = {};\n\t\t\t\t}\n\n\t\t\t\taccumulator[key][result[1]] = value;\n\t\t\t};\n\n\t\tcase 'bracket':\n\t\t\treturn function (key, value, accumulator) {\n\t\t\t\tresult = /(\\[\\])$/.exec(key);\n\t\t\t\tkey = key.replace(/\\[\\]$/, '');\n\n\t\t\t\tif (!result) {\n\t\t\t\t\taccumulator[key] = value;\n\t\t\t\t\treturn;\n\t\t\t\t} else if (accumulator[key] === undefined) {\n\t\t\t\t\taccumulator[key] = [value];\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\taccumulator[key] = [].concat(accumulator[key], value);\n\t\t\t};\n\n\t\tdefault:\n\t\t\treturn function (key, value, accumulator) {\n\t\t\t\tif (accumulator[key] === undefined) {\n\t\t\t\t\taccumulator[key] = value;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\taccumulator[key] = [].concat(accumulator[key], value);\n\t\t\t};\n\t}\n}\n\nfunction encode(value, opts) {\n\tif (opts.encode) {\n\t\treturn opts.strict ? strictUriEncode(value) : encodeURIComponent(value);\n\t}\n\n\treturn value;\n}\n\nfunction keysSorter(input) {\n\tif (Array.isArray(input)) {\n\t\treturn input.sort();\n\t} else if (typeof input === 'object') {\n\t\treturn keysSorter(Object.keys(input)).sort(function (a, b) {\n\t\t\treturn Number(a) - Number(b);\n\t\t}).map(function (key) {\n\t\t\treturn input[key];\n\t\t});\n\t}\n\n\treturn input;\n}\n\nfunction extract(str) {\n\tvar queryStart = str.indexOf('?');\n\tif (queryStart === -1) {\n\t\treturn '';\n\t}\n\treturn str.slice(queryStart + 1);\n}\n\nfunction parse(str, opts) {\n\topts = objectAssign({arrayFormat: 'none'}, opts);\n\n\tvar formatter = parserForArrayFormat(opts);\n\n\t// Create an object with no prototype\n\t// https://github.com/sindresorhus/query-string/issues/47\n\tvar ret = Object.create(null);\n\n\tif (typeof str !== 'string') {\n\t\treturn ret;\n\t}\n\n\tstr = str.trim().replace(/^[?#&]/, '');\n\n\tif (!str) {\n\t\treturn ret;\n\t}\n\n\tstr.split('&').forEach(function (param) {\n\t\tvar parts = param.replace(/\\+/g, ' ').split('=');\n\t\t// Firefox (pre 40) decodes `%3D` to `=`\n\t\t// https://github.com/sindresorhus/query-string/pull/37\n\t\tvar key = parts.shift();\n\t\tvar val = parts.length > 0 ? parts.join('=') : undefined;\n\n\t\t// missing `=` should be `null`:\n\t\t// http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters\n\t\tval = val === undefined ? null : decodeComponent(val);\n\n\t\tformatter(decodeComponent(key), val, ret);\n\t});\n\n\treturn Object.keys(ret).sort().reduce(function (result, key) {\n\t\tvar val = ret[key];\n\t\tif (Boolean(val) && typeof val === 'object' && !Array.isArray(val)) {\n\t\t\t// Sort object keys, not values\n\t\t\tresult[key] = keysSorter(val);\n\t\t} else {\n\t\t\tresult[key] = val;\n\t\t}\n\n\t\treturn result;\n\t}, Object.create(null));\n}\n\nexports.extract = extract;\nexports.parse = parse;\n\nexports.stringify = function (obj, opts) {\n\tvar defaults = {\n\t\tencode: true,\n\t\tstrict: true,\n\t\tarrayFormat: 'none'\n\t};\n\n\topts = objectAssign(defaults, opts);\n\n\tif (opts.sort === false) {\n\t\topts.sort = function () {};\n\t}\n\n\tvar formatter = encoderForArrayFormat(opts);\n\n\treturn obj ? Object.keys(obj).sort(opts.sort).map(function (key) {\n\t\tvar val = obj[key];\n\n\t\tif (val === undefined) {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (val === null) {\n\t\t\treturn encode(key, opts);\n\t\t}\n\n\t\tif (Array.isArray(val)) {\n\t\t\tvar result = [];\n\n\t\t\tval.slice().forEach(function (val2) {\n\t\t\t\tif (val2 === undefined) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tresult.push(formatter(key, val2, result.length));\n\t\t\t});\n\n\t\t\treturn result.join('&');\n\t\t}\n\n\t\treturn encode(key, opts) + '=' + encode(val, opts);\n\t}).filter(function (x) {\n\t\treturn x.length > 0;\n\t}).join('&') : '';\n};\n\nexports.parseUrl = function (str, opts) {\n\treturn {\n\t\turl: str.split('?')[0] || '',\n\t\tquery: parse(extract(str), opts)\n\t};\n};\n","'use strict';\nmodule.exports = function (str) {\n\treturn encodeURIComponent(str).replace(/[!'()*]/g, function (c) {\n\t\treturn '%' + c.charCodeAt(0).toString(16).toUpperCase();\n\t});\n};\n","import * as Serialize from './serialize';\n/**\n * String values\n */\nexport var StringParam = {\n encode: Serialize.encodeString,\n decode: Serialize.decodeString,\n};\n/**\n * Numbers (integers or floats)\n */\nexport var NumberParam = {\n encode: Serialize.encodeNumber,\n decode: Serialize.decodeNumber,\n};\n/**\n * For flat objects where values are strings\n */\nexport var ObjectParam = {\n encode: Serialize.encodeObject,\n decode: Serialize.decodeObject,\n};\n/**\n * For flat arrays of strings, filters out undefined values during decode\n */\nexport var ArrayParam = {\n encode: Serialize.encodeArray,\n decode: Serialize.decodeArray,\n};\n/**\n * For flat arrays of strings, filters out undefined values during decode\n */\nexport var NumericArrayParam = {\n encode: Serialize.encodeNumericArray,\n decode: Serialize.decodeNumericArray,\n};\n/**\n * For any type of data, encoded via JSON.stringify\n */\nexport var JsonParam = {\n encode: Serialize.encodeJson,\n decode: Serialize.decodeJson,\n};\n/**\n * For simple dates (YYYY-MM-DD)\n */\nexport var DateParam = {\n encode: Serialize.encodeDate,\n decode: Serialize.decodeDate,\n};\n/**\n * For dates in simplified extended ISO format (YYYY-MM-DDTHH:mm:ss.sssZ or ±YYYYYY-MM-DDTHH:mm:ss.sssZ)\n */\nexport var DateTimeParam = {\n encode: Serialize.encodeDateTime,\n decode: Serialize.decodeDateTime,\n};\n/**\n * For boolean values: 1 = true, 0 = false\n */\nexport var BooleanParam = {\n encode: Serialize.encodeBoolean,\n decode: Serialize.decodeBoolean,\n};\n/**\n * For flat objects where the values are numbers\n */\nexport var NumericObjectParam = {\n encode: Serialize.encodeNumericObject,\n decode: Serialize.decodeNumericObject,\n};\n/**\n * For flat arrays of strings, filters out undefined values during decode\n */\nexport var DelimitedArrayParam = {\n encode: Serialize.encodeDelimitedArray,\n decode: Serialize.decodeDelimitedArray,\n};\n/**\n * For flat arrays where the values are numbers, filters out undefined values during decode\n */\nexport var DelimitedNumericArrayParam = {\n encode: Serialize.encodeDelimitedNumericArray,\n decode: Serialize.decodeDelimitedNumericArray,\n};\n","/**\n * Encodes a date as a string in YYYY-MM-DD format.\n *\n * @param {Date} date\n * @return {String} the encoded date\n */\nexport function encodeDate(date) {\n if (date == null) {\n return undefined;\n }\n var year = date.getFullYear();\n var month = date.getMonth() + 1;\n var day = date.getDate();\n return year + \"-\" + (month < 10 ? \"0\" + month : month) + \"-\" + (day < 10 ? \"0\" + day : day);\n}\n/**\n * Converts a date in the format 'YYYY-mm-dd...' into a proper date, because\n * new Date() does not do that correctly. The date can be as complete or incomplete\n * as necessary (aka, '2015', '2015-10', '2015-10-01').\n * It will not work for dates that have times included in them.\n *\n * If an array is provided, only the first entry is used.\n *\n * @param {String} input String date form like '2015-10-01'\n * @return {Date} parsed date\n */\nexport function decodeDate(input) {\n if (input == null || !input.length) {\n return undefined;\n }\n var dateString = input instanceof Array ? input[0] : input;\n if (dateString == null || !dateString.length) {\n return undefined;\n }\n var parts = dateString.split('-');\n // may only be a year so won't even have a month\n if (parts[1] != null) {\n parts[1] -= 1; // Note: months are 0-based\n }\n else {\n // just a year, set the month and day to the first\n parts[1] = 0;\n parts[2] = 1;\n }\n var decoded = new (Date.bind.apply(Date, [void 0].concat(parts)))();\n if (isNaN(decoded.getTime())) {\n return undefined;\n }\n return decoded;\n}\n/**\n * Encodes a date as a string in ISO 8601 (\"2019-05-28T10:58:40Z\") format.\n *\n * @param {Date} date\n * @return {String} the encoded date\n */\nexport function encodeDateTime(date) {\n if (date == null) {\n return undefined;\n }\n return date.toISOString();\n}\n/**\n * Converts a date in the https://en.wikipedia.org/wiki/ISO_8601 format.\n * For allowed inputs see specs:\n * - https://tools.ietf.org/html/rfc2822#page-14\n * - http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.15\n *\n * If an array is provided, only the first entry is used.\n *\n * @param {String} input String date form like '1995-12-17T03:24:00'\n * @return {Date} parsed date\n */\nexport function decodeDateTime(input) {\n if (input == null || !input.length) {\n return undefined;\n }\n var dateString = input instanceof Array ? input[0] : input;\n if (dateString == null || !dateString.length) {\n return undefined;\n }\n var decoded = new Date(dateString);\n if (isNaN(decoded.getTime())) {\n return undefined;\n }\n return decoded;\n}\n/**\n * Encodes a boolean as a string. true -> \"1\", false -> \"0\".\n *\n * @param {Boolean} bool\n * @return {String} the encoded boolean\n */\nexport function encodeBoolean(bool) {\n if (bool === undefined) {\n return undefined;\n }\n return bool ? '1' : '0';\n}\n/**\n * Decodes a boolean from a string. \"1\" -> true, \"0\" -> false.\n * Everything else maps to undefined.\n *\n * If an array is provided, only the first entry is used.\n *\n * @param {String} input the encoded boolean string\n * @return {Boolean} the boolean value\n */\nexport function decodeBoolean(input) {\n if (input == null) {\n return undefined;\n }\n var boolStr = input instanceof Array ? input[0] : input;\n if (boolStr === '1') {\n return true;\n }\n else if (boolStr === '0') {\n return false;\n }\n return undefined;\n}\n/**\n * Encodes a number as a string.\n *\n * @param {Number} num\n * @return {String} the encoded number\n */\nexport function encodeNumber(num) {\n if (num == null) {\n return undefined;\n }\n return String(num);\n}\n/**\n * Decodes a number from a string. If the number is invalid,\n * it returns undefined.\n *\n * If an array is provided, only the first entry is used.\n *\n * @param {String} input the encoded number string\n * @return {Number} the number value\n */\nexport function decodeNumber(input) {\n if (input == null) {\n return undefined;\n }\n var numStr = input instanceof Array ? input[0] : input;\n if (numStr == null || numStr === '') {\n return undefined;\n }\n var result = +numStr;\n if (isNaN(result)) {\n return undefined;\n }\n return result;\n}\n/**\n * Encodes a string while safely handling null and undefined values.\n *\n * @param {String} str a string to encode\n * @return {String} the encoded string\n */\nexport function encodeString(str) {\n if (str == null) {\n return undefined;\n }\n return String(str);\n}\n/**\n * Decodes a string while safely handling null and undefined values.\n *\n * If an array is provided, only the first entry is used.\n *\n * @param {String} input the encoded string\n * @return {String} the string value\n */\nexport function decodeString(input) {\n if (input == null) {\n return undefined;\n }\n var str = input instanceof Array ? input[0] : input;\n if (str == null) {\n return undefined;\n }\n return String(str);\n}\n/**\n * Encodes anything as a JSON string.\n *\n * @param {Any} any The thing to be encoded\n * @return {String} The JSON string representation of any\n */\nexport function encodeJson(any) {\n if (any == null) {\n return undefined;\n }\n return JSON.stringify(any);\n}\n/**\n * Decodes a JSON string into javascript\n *\n * If an array is provided, only the first entry is used.\n *\n * @param {String} input The JSON string representation\n * @return {Any} The javascript representation\n */\nexport function decodeJson(input) {\n if (input == null) {\n return undefined;\n }\n var jsonStr = input instanceof Array ? input[0] : input;\n if (!jsonStr) {\n return undefined;\n }\n var result;\n try {\n result = JSON.parse(jsonStr);\n }\n catch (e) {\n /* ignore errors, returning undefined */\n }\n return result;\n}\n/**\n * Encodes an array as a JSON string.\n *\n * @param {Array} array The array to be encoded\n * @return {String[]} The array of strings to be put in the URL\n * as repeated query parameters\n */\nexport function encodeArray(array) {\n if (!array) {\n return undefined;\n }\n return array;\n}\n/**\n * Decodes an array or singular value and returns it as an array\n * or undefined if falsy. Filters out undefined values.\n *\n * @param {String | Array} input The input value\n * @return {Array} The javascript representation\n */\nexport function decodeArray(input) {\n if (!input) {\n return undefined;\n }\n if (!(input instanceof Array)) {\n return [input];\n }\n return input\n .map(function (item) { return (item === '' ? undefined : item); })\n .filter(function (item) { return item !== undefined; });\n}\n/**\n * Encodes a numeric array as a JSON string.\n *\n * @param {Array} array The array to be encoded\n * @return {String[]} The array of strings to be put in the URL\n * as repeated query parameters\n */\nexport function encodeNumericArray(array) {\n if (!array) {\n return undefined;\n }\n return array.map(function (d) { return \"\" + d; });\n}\n/**\n * Decodes an array or singular value and returns it as an array\n * or undefined if falsy. Filters out undefined and NaN values.\n *\n * @param {String | Array} input The input value\n * @return {Array} The javascript representation\n */\nexport function decodeNumericArray(input) {\n var arr = decodeArray(input);\n if (!arr) {\n return undefined;\n }\n return arr\n .map(function (item) { return +item; })\n .filter(function (item) { return item !== undefined && !isNaN(item); });\n}\n/**\n * Encodes an array as a delimited string. For example,\n * ['a', 'b'] -> 'a_b' with entrySeparator='_'\n *\n * @param array The array to be encoded\n * @param entrySeparator The string used to delimit entries\n * @return The array as a string with elements joined by the\n * entry separator\n */\nexport function encodeDelimitedArray(array, entrySeparator) {\n if (entrySeparator === void 0) { entrySeparator = '_'; }\n if (!array) {\n return undefined;\n }\n return array.join(entrySeparator);\n}\n/**\n * Decodes a delimited string into javascript array. For example,\n * 'a_b' -> ['a', 'b'] with entrySeparator='_'\n *\n * If an array is provided as input, only the first entry is used.\n *\n * @param {String} input The JSON string representation\n * @param entrySeparator The array as a string with elements joined by the\n * entry separator\n * @return {Array} The javascript representation\n */\nexport function decodeDelimitedArray(input, entrySeparator) {\n if (entrySeparator === void 0) { entrySeparator = '_'; }\n if (input == null) {\n return undefined;\n }\n var arrayStr = input instanceof Array ? input[0] : input;\n if (!arrayStr) {\n return undefined;\n }\n return arrayStr\n .split(entrySeparator)\n .map(function (item) { return (item === '' ? undefined : item); })\n .filter(function (item) { return item !== undefined; });\n}\n/**\n * Encodes a numeric array as a delimited string. (alias of encodeDelimitedArray)\n * For example, [1, 2] -> '1_2' with entrySeparator='_'\n *\n * @param {Array} array The array to be encoded\n * @return {String} The JSON string representation of array\n */\nexport var encodeDelimitedNumericArray = encodeDelimitedArray;\n/**\n * Decodes a delimited string into javascript array where all entries are numbers\n * For example, '1_2' -> [1, 2] with entrySeparator='_'\n *\n * If an array is provided as input, only the first entry is used.\n *\n * @param {String} jsonStr The JSON string representation\n * @return {Array} The javascript representation\n */\nexport function decodeDelimitedNumericArray(arrayStr, entrySeparator) {\n if (entrySeparator === void 0) { entrySeparator = '_'; }\n var decoded = decodeDelimitedArray(arrayStr, entrySeparator);\n if (!decoded) {\n return undefined;\n }\n return decoded\n .map(function (d) { return (d == null ? undefined : +d); })\n .filter(function (d) { return d !== undefined && !isNaN(d); });\n}\n/**\n * Encode simple objects as readable strings. Works only for simple,\n * flat objects where values are numbers, strings.\n *\n * For example { foo: bar, boo: baz } -> \"foo-bar_boo-baz\"\n *\n * @param {Object} object The object to encode\n * @param {String} keyValSeparator=\"-\" The separator between keys and values\n * @param {String} entrySeparator=\"_\" The separator between entries\n * @return {String} The encoded object\n */\nexport function encodeObject(obj, keyValSeparator, entrySeparator) {\n if (keyValSeparator === void 0) { keyValSeparator = '-'; }\n if (entrySeparator === void 0) { entrySeparator = '_'; }\n if (!obj || !Object.keys(obj).length) {\n return undefined;\n }\n return Object.keys(obj)\n .map(function (key) { return \"\" + key + keyValSeparator + obj[key]; })\n .join(entrySeparator);\n}\n/**\n * Decodes a simple object to javascript. Currently works only for simple,\n * flat objects where values are strings.\n *\n * For example \"foo-bar_boo-baz\" -> { foo: bar, boo: baz }\n *\n * If an array is provided as input, only the first entry is used.\n *\n * @param {String} input The object string to decode\n * @param {String} keyValSeparator=\"-\" The separator between keys and values\n * @param {String} entrySeparator=\"_\" The separator between entries\n * @return {Object} The javascript object\n */\nexport function decodeObject(input, keyValSeparator, entrySeparator) {\n if (keyValSeparator === void 0) { keyValSeparator = '-'; }\n if (entrySeparator === void 0) { entrySeparator = '_'; }\n if (input == null) {\n return undefined;\n }\n var objStr = input instanceof Array ? input[0] : input;\n if (!objStr || !objStr.length) {\n return undefined;\n }\n var obj = {};\n var keyValSeparatorRegExp = new RegExp(keyValSeparator + \"(.*)\");\n objStr.split(entrySeparator).forEach(function (entryStr) {\n var _a = entryStr.split(keyValSeparatorRegExp), key = _a[0], value = _a[1];\n obj[key] = value;\n });\n return obj;\n}\n/**\n * Encode simple objects as readable strings. Alias of encodeObject.\n *\n * For example { foo: 123, boo: 521 } -> \"foo-123_boo-521\"\n *\n * @param {Object} object The object to encode\n * @param {String} keyValSeparator=\"-\" The separator between keys and values\n * @param {String} entrySeparator=\"_\" The separator between entries\n * @return {String} The encoded object\n */\nexport var encodeNumericObject = encodeObject;\n/**\n * Decodes a simple object to javascript where all values are numbers.\n * Currently works only for simple, flat objects.\n *\n * For example \"foo-123_boo-521\" -> { foo: 123, boo: 521 }\n *\n * If an array is provided as input, only the first entry is used.\n *\n * @param {String} input The object string to decode\n * @param {String} keyValSeparator=\"-\" The separator between keys and values\n * @param {String} entrySeparator=\"_\" The separator between entries\n * @return {Object} The javascript object\n */\nexport function decodeNumericObject(input, keyValSeparator, entrySeparator) {\n if (keyValSeparator === void 0) { keyValSeparator = '-'; }\n if (entrySeparator === void 0) { entrySeparator = '_'; }\n var decoded = decodeObject(input, keyValSeparator, entrySeparator);\n //console.log(\"input:\", input);\n //console.log(\"decoded:\", decoded);\n if (!decoded) {\n return undefined;\n }\n //console.log(\"x\");\n // convert to numbers\n Object.keys(decoded).forEach(function (key) {\n if (decoded[key] !== undefined) {\n decoded[key] = decodeNumber(decoded[key]);\n }\n });\n return decoded;\n}\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport { stringify, parse as parseQueryString } from 'query-string';\n/**\n * remove query params that are nully or an empty strings.\n * note: these values are assumed to be already encoded as strings.\n */\nfunction filterNully(query) {\n var filteredQuery = Object.keys(query).reduce(function (queryAccumulator, queryParam) {\n // get encoded value for this param\n var encodedValue = query[queryParam];\n // if it isn't null or empty string, add it to the accumulated obj\n if (encodedValue != null && encodedValue !== '') {\n queryAccumulator[queryParam] = encodedValue;\n }\n return queryAccumulator;\n }, {});\n return filteredQuery;\n}\n/**\n * Update a location, wiping out parameters not included in encodedQuery\n */\nexport function updateLocation(encodedQuery, location) {\n var encodedSearchString = stringify(filterNully(encodedQuery));\n var newLocation = __assign({}, location, { key: \"\" + Date.now(), search: encodedSearchString.length ? \"?\" + encodedSearchString : '', query: encodedQuery });\n return newLocation;\n}\n/**\n * Update a location while retaining existing parameters\n */\nexport function updateInLocation(encodedQueryReplacements, location) {\n // if a query is there, use it, otherwise parse the search string\n var currQuery = location.query || parseQueryString(location.search);\n var newQuery = __assign({}, currQuery, encodedQueryReplacements);\n return updateLocation(filterNully(newQuery), location);\n}\n","/**\n * Convert the values in query to strings via the encode functions configured\n * in paramConfigMap\n *\n * @param paramConfigMap Map from query name to { encode, decode } config\n * @param query Query updates mapping param name to decoded value\n */\nexport function encodeQueryParams(paramConfigMap, query) {\n var encodedQuery = {};\n var paramNames = Object.keys(query);\n for (var _i = 0, paramNames_1 = paramNames; _i < paramNames_1.length; _i++) {\n var paramName = paramNames_1[_i];\n var decodedValue = query[paramName];\n if (decodedValue == null) {\n encodedQuery[paramName] = undefined;\n continue;\n }\n if (!paramConfigMap[paramName]) {\n if (process.env.NODE_ENV === 'development') {\n console.warn(\"Encoding parameter \" + paramName + \" as string since it was not configured.\");\n }\n // NOTE: we could just not encode it, but it is probably convenient to have\n // it be included by default as a string type.\n encodedQuery[paramName] = String(decodedValue);\n }\n else {\n encodedQuery[paramName] = paramConfigMap[paramName].encode(query[paramName]);\n }\n }\n return encodedQuery;\n}\nexport default encodeQueryParams;\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport * as React from 'react';\n/**\n * Adapts standard DOM window history to work with our\n * { replace, push } interface.\n *\n * @param history Standard history provided by DOM\n */\nfunction adaptWindowHistory(history) {\n return {\n replace: function (location) {\n history.replaceState(location.state, '', location.protocol + \"//\" + location.host + location.pathname + location.search);\n },\n push: function (location) {\n history.pushState(location.state, '', location.protocol + \"//\" + location.host + location.pathname + location.search);\n },\n };\n}\n/**\n * Adapts @reach/router history to work with our\n * { replace, push } interface.\n *\n * @param history globalHistory from @reach/router\n */\nfunction adaptReachHistory(history) {\n return {\n replace: function (location) {\n history.navigate(location.protocol + \"//\" + location.host + location.pathname + location.search, { replace: true });\n },\n push: function (location) {\n history.navigate(location.protocol + \"//\" + location.host + location.pathname + location.search, { replace: false });\n },\n };\n}\n/**\n * Helper to produce the context value falling back to\n * window history and location if not provided.\n */\nfunction getContextValue(contextValue) {\n if (contextValue === void 0) { contextValue = {}; }\n var value = __assign({}, contextValue);\n var hasWindow = typeof window !== 'undefined';\n if (hasWindow) {\n if (!value.history) {\n value.history = adaptWindowHistory(window.history);\n }\n if (!value.location) {\n value.location = window.location;\n }\n }\n return value;\n}\nexport var QueryParamContext = React.createContext(getContextValue());\n/**\n * Context provider for query params to have access to the\n * active routing system, enabling updates to the URL.\n */\nexport function QueryParamProvider(_a) {\n var children = _a.children, ReactRouterRoute = _a.ReactRouterRoute, reachHistory = _a.reachHistory, history = _a.history, location = _a.location;\n // if we have React Router, use it to get the context value\n if (ReactRouterRoute) {\n return (React.createElement(ReactRouterRoute, null, function (routeProps) {\n return (React.createElement(QueryParamContext.Provider, { value: getContextValue(routeProps) }, children));\n }));\n }\n // if we are using reach router, use its history\n if (reachHistory) {\n return (React.createElement(QueryParamContext.Provider, { value: getContextValue({\n history: adaptReachHistory(reachHistory),\n location: location,\n }) }, children));\n }\n // neither reach nor react-router, so allow manual overrides\n return (React.createElement(QueryParamContext.Provider, { value: getContextValue({ history: history, location: location }) }, children));\n}\nexport default QueryParamProvider;\n","import { updateLocation, updateInLocation, } from 'serialize-query-params';\n/**\n * Updates the URL to match the specified query changes.\n * If replaceIn or pushIn are used as the updateType, then parameters\n * not specified in queryReplacements are retained. If replace or push\n * are used, only the values in queryReplacements will be available.\n */\nexport function updateUrlQuery(queryReplacements, location, history, updateType) {\n if (updateType === void 0) { updateType = 'replaceIn'; }\n switch (updateType) {\n case 'replaceIn':\n history.replace(updateInLocation(queryReplacements, location));\n break;\n case 'pushIn':\n history.push(updateInLocation(queryReplacements, location));\n break;\n case 'replace':\n history.replace(updateLocation(queryReplacements, location));\n break;\n case 'push':\n history.push(updateLocation(queryReplacements, location));\n break;\n default:\n }\n}\nexport default updateUrlQuery;\n","import * as React from 'react';\nimport { parse as parseQueryString, parseUrl as parseQueryURL, stringify, StringParam, } from 'serialize-query-params';\nimport { QueryParamContext } from './QueryParamProvider';\nimport { updateUrlQuery } from './updateUrlQuery';\n/**\n * Given a query param name and query parameter configuration ({ encode, decode })\n * return the decoded value and a setter for updating it.\n *\n * The setter takes two arguments (newValue, updateType) where updateType\n * is one of 'replace' | 'replaceIn' | 'push' | 'pushIn', defaulting to\n * 'replaceIn'.\n *\n * You may optionally pass in a rawQuery object, otherwise the query is derived\n * from the location available in the QueryParamContext.\n *\n * D = decoded type\n * D2 = return value from decode (typically same as D)\n */\nexport var useQueryParam = function (name, paramConfig, rawQuery) {\n var _a;\n if (paramConfig === void 0) { paramConfig = StringParam; }\n var _b = React.useContext(QueryParamContext), history = _b.history, location = _b.location;\n // ref with current version history object (see #46)\n var refHistory = React.useRef(history);\n React.useEffect(function () {\n refHistory.current = history;\n }, [history]);\n // ref with current version location object (see #46)\n var refLocation = React.useRef(location);\n React.useEffect(function () {\n refLocation.current = location;\n }, [location]);\n // read in the raw query\n if (!rawQuery) {\n var locationIsObject_1 = typeof location === 'object';\n var windowIsDefined_1 = typeof window !== 'undefined';\n rawQuery = React.useMemo(function () {\n var pathname = {};\n // handle checking SSR (#13)\n if (locationIsObject_1) {\n // in browser\n if (windowIsDefined_1) {\n pathname = parseQueryString(location.search);\n }\n else {\n // not in browser\n var url = location.pathname;\n if (location.search) {\n url += location.search;\n }\n pathname = parseQueryURL(url).query;\n }\n }\n return pathname || {};\n }, [location.search, location.pathname, locationIsObject_1, windowIsDefined_1]);\n }\n // read in the encoded string value\n var encodedValue = rawQuery[name];\n // note that we use the stringified encoded value since the encoded\n // value may be an array that is recreated if a different query param\n // changes. It is sufficient to use this instead of encodedValue in\n // the useMemo dependency array since it will change any time the actual\n // meaningful value of encodedValue changes.\n var arraySafeEncodedValue = encodedValue instanceof Array\n ? stringify((_a = {}, _a[name] = encodedValue, _a))\n : encodedValue;\n // decode if the encoded value has changed, otherwise\n // re-use memoized value\n var decodedValue = React.useMemo(function () {\n if (encodedValue == null) {\n return undefined;\n }\n return paramConfig.decode(encodedValue);\n }, [arraySafeEncodedValue, paramConfig]); // eslint-disable-line react-hooks/exhaustive-deps\n // create the setter, memoizing via useCallback\n var setValue = React.useCallback(function (newValue, updateType) {\n var _a;\n var newEncodedValue = paramConfig.encode(newValue);\n updateUrlQuery((_a = {}, _a[name] = newEncodedValue, _a), refHistory.current.location || refLocation.current, // see #46 for why we use a ref here\n refHistory.current, updateType);\n }, [paramConfig, name]);\n return [decodedValue, setValue];\n};\n","import * as React from 'react';\nimport { parse as parseQueryString, encodeQueryParams, } from 'serialize-query-params';\nimport { useQueryParam } from './useQueryParam';\nimport updateUrlQuery from './updateUrlQuery';\nimport { QueryParamContext } from './QueryParamProvider';\n// from https://usehooks.com/usePrevious/\nfunction usePrevious(value) {\n var ref = React.useRef(value);\n React.useEffect(function () {\n ref.current = value;\n }, [value]);\n return ref.current;\n}\n// from https://github.com/lodash/lodash/issues/2340#issuecomment-360325395\nfunction isShallowEqual(objA, objB) {\n for (var key in objA)\n if (!(key in objB) || objA[key] !== objB[key])\n return false;\n for (var key in objB)\n if (!(key in objA) || objA[key] !== objB[key])\n return false;\n return true;\n}\n/**\n * Given a query parameter configuration (mapping query param name to { encode, decode }),\n * return an object with the decoded values and a setter for updating them.\n */\nexport var useQueryParams = function (paramConfigMap) {\n var _a = React.useContext(QueryParamContext), history = _a.history, location = _a.location;\n var locationIsObject = typeof location === 'object';\n // memoize paramConfigMap to make the API nicer for consumers.\n // otherwise we'd have to useQueryParams(useMemo(() => { foo: NumberParam }, []))\n var prevParamConfigMap = usePrevious(paramConfigMap);\n var hasNewParamConfig = isShallowEqual(prevParamConfigMap, paramConfigMap);\n // prettier-ignore\n var memoParamConfigMap = React.useMemo(function () { return paramConfigMap; }, [\n hasNewParamConfig,\n ]);\n paramConfigMap = memoParamConfigMap;\n // ref with current version history object (see #46)\n var refHistory = React.useRef(history);\n React.useEffect(function () {\n refHistory.current = history;\n }, [history]);\n // ref with current version location object (see #46)\n var refLocation = React.useRef(location);\n React.useEffect(function () {\n refLocation.current = location;\n }, [location]);\n var search = locationIsObject ? location.search : '';\n // read in the raw query\n var rawQuery = React.useMemo(function () { return parseQueryString(search) || {}; }, [\n search,\n ]);\n // parse each parameter via useQueryParam\n // we reuse the logic to not recreate objects\n var paramNames = Object.keys(paramConfigMap);\n var paramValues = paramNames.map(function (paramName) {\n return useQueryParam(paramName, paramConfigMap[paramName], rawQuery)[0];\n });\n // we use a memo here to prevent recreating the containing decodedValues object\n // which would break === comparisons even if no values changed.\n var decodedValues = React.useMemo(function () {\n // iterate over the decoded values and build an object\n var decodedValues = {};\n for (var i = 0; i < paramNames.length; ++i) {\n decodedValues[paramNames[i]] = paramValues[i];\n }\n return decodedValues;\n }, paramValues); // eslint-disable-line react-hooks/exhaustive-deps\n // create a setter for updating multiple query params at once\n var setQuery = React.useCallback(function (changes, updateType) {\n // encode as strings for the URL\n var encodedChanges = encodeQueryParams(paramConfigMap, changes);\n // update the URL\n updateUrlQuery(encodedChanges, refHistory.current.location || refLocation.current, // see #46\n refHistory.current, updateType);\n }, [paramConfigMap]);\n // no longer Partial\n return [decodedValues, setQuery];\n};\nexport default useQueryParams;\n"],"names":["token","singleMatcher","RegExp","multiMatcher","decodeComponents","components","split","decodeURIComponent","join","err","length","left","slice","right","Array","prototype","concat","call","decode","input","tokens","match","i","module","exports","encodedURI","TypeError","replace","replaceMap","exec","result","entries","Object","keys","key","customDecodeURIComponent","getOwnPropertySymbols","hasOwnProperty","propIsEnumerable","propertyIsEnumerable","toObject","val","assign","test1","String","getOwnPropertyNames","test2","fromCharCode","map","n","test3","forEach","letter","shouldUseNative","target","source","from","symbols","to","s","arguments","strictUriEncode","objectAssign","decodeComponent","encode","value","opts","strict","encodeURIComponent","keysSorter","isArray","sort","a","b","Number","extract","str","queryStart","indexOf","parse","formatter","arrayFormat","accumulator","undefined","parserForArrayFormat","ret","create","trim","param","parts","shift","reduce","Boolean","obj","index","encoderForArrayFormat","val2","push","filter","x","url","query","c","charCodeAt","toString","toUpperCase","StringParam","NumberParam","num","numStr","isNaN","ArrayParam","array","item","BooleanParam","bool","boolStr","__assign","t","p","apply","this","filterNully","queryAccumulator","queryParam","encodedValue","updateLocation","encodedQuery","location","encodedSearchString","Date","now","search","updateInLocation","encodedQueryReplacements","currQuery","QueryParamContext","contextValue","history","window","replaceState","state","protocol","host","pathname","pushState","getContextValue","updateUrlQuery","queryReplacements","updateType","useQueryParam","name","paramConfig","rawQuery","_a","_b","refHistory","current","refLocation","locationIsObject_1","windowIsDefined_1","arraySafeEncodedValue","decodedValue","setValue","newValue","newEncodedValue","paramConfigMap","ref","locationIsObject","hasNewParamConfig","objA","objB","isShallowEqual","memoParamConfigMap","paramNames","paramValues","paramName","decodedValues","changes","encodedChanges","_i","paramNames_1","encodeQueryParams"],"sourceRoot":""}