\r\n );\r\n});\r\n\r\nexport default DropDown;\r\n","import SVGIcon from \"src/components/SVGIcon\";\r\n\r\nconst PaperAirplane = ({ title = \"Paper Airplane\", ...props }) => {\r\n return (\r\n \r\n {title}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default PaperAirplane;\r\n","import SVGIcon from \"src/components/SVGIcon\";\r\n\r\nconst NoData = ({ title = \"No Data\", ...props }) => {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default NoData;\r\n","import SVGIcon from \"src/components/SVGIcon\";\r\n\r\nconst Planet = ({ title = \"Planet\", ...props }) => {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default Planet;\r\n","import SVGIcon from \"src/components/SVGIcon\";\r\n\r\nconst SadCloud = ({ title = \"Sad Cloud\", ...props }) => {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default SadCloud;\r\n","import React, { Fragment } from \"react\";\r\nimport PaperAirplane from \"src/icons/PaperAirplane\";\r\nimport NoData from \"src/icons/NoData\";\r\nimport Planet from \"src/icons/Planet\";\r\nimport SadCloud from \"src/icons/SadCloud\";\r\nimport Satellite from \"src/icons/Satellite\";\r\n\r\n/**\r\n * Loader used on components doing async requests. It can show a animated loading icon, dim the background\r\n * and switch over to an error state if the component fails to load its resource.\r\n */\r\n\r\ninterface LoadingI {\r\n active?: boolean;\r\n addContainer?: boolean;\r\n background?: boolean;\r\n dimmer?: boolean;\r\n error?: any;\r\n lightMode?: boolean;\r\n loadingText?: string;\r\n paddingX?: number;\r\n paddingY?: number;\r\n}\r\n\r\nconst Loading = ({\r\n active,\r\n addContainer,\r\n background,\r\n dimmer,\r\n error,\r\n lightMode,\r\n loadingText,\r\n paddingX,\r\n paddingY,\r\n}: LoadingI) => {\r\n // If the loader is not actively loading or in an error state, it should not render anything\r\n if (!active && !error) return null;\r\n const renderContent = () => {\r\n if (!error) {\r\n // Default loader\r\n return (\r\n \r\n \r\n {loadingText &&
{loadingText}
}\r\n \r\n );\r\n }\r\n // If an error has a code, let's use that code for our checking\r\n if (error.code) error = error.code;\r\n switch (error) {\r\n case 403:\r\n return (\r\n \r\n You do not have the permission required to use this tool. Please\r\n contact{\" \"}\r\n na.online@travelctm.com{\" \"}\r\n for more information.\r\n \r\n );\r\n case 404:\r\n case 204:\r\n case \"noContent\":\r\n return (\r\n \r\n \r\n
NO DATA TO SHOW
\r\n \r\n There is no data available right now.\r\n \r\n \r\n );\r\n case \"pdfError\":\r\n return (\r\n \r\n This invoice is currently unavailable. Please reach out to{\" \"}\r\n na.online@travelctm.com\r\n .\r\n \r\n );\r\n case \"noCityPairs\":\r\n return (\r\n \r\n \r\n \r\n No search results were returned for these city pairs.\r\n \r\n \r\n );\r\n case \"noFlights\":\r\n return (\r\n \r\n \r\n \r\n It looks like there are no active{\" \"}\r\n \r\n \r\n travelers for the next week.\r\n \r\n \r\n );\r\n case \"noTravellers\":\r\n return (\r\n \r\n \r\n \r\n No active travelers within the selected dates.\r\n \r\n \r\n );\r\n case 500:\r\n case 503:\r\n case 504:\r\n case \"serverError\":\r\n return (\r\n \r\n \r\n
\r\n OH SNAP, SOMETHING WENT WRONG\r\n
\r\n \r\n Looks like we were not able to connect to the server.\r\n \r\n \r\n Please try again in a few minutes.\r\n \r\n \r\n );\r\n default:\r\n return (\r\n \r\n \r\n
WHOOPS
\r\n \r\n We can't load anything right now.\r\n \r\n \r\n Please try again in a few minutes.\r\n \r\n \r\n );\r\n }\r\n };\r\n\r\n // Set dynamic/prop based styles if we are using the dimmer\r\n const style: any = {};\r\n if (dimmer) {\r\n style.backgroundColor = lightMode\r\n ? \"rgba(255,255,255, 0.6)\"\r\n : \"rgba(0,0,0,0.6)\";\r\n if (paddingX) {\r\n style.left = `${paddingX}px`;\r\n style.right = `${paddingX}px`;\r\n }\r\n if (paddingY) {\r\n style.top = `${paddingY}px`;\r\n style.bottom = `${paddingY}px`;\r\n }\r\n if (!error && active) style.zIndex = \"999999\";\r\n }\r\n if (background) style.zIndex = \"0\";\r\n\r\n return (\r\n
\r\n
\r\n
{renderContent()}
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default Loading;\r\n","interface SVGIconI {\r\n children: React.ReactNode;\r\n className?: string;\r\n title: string;\r\n viewBox: string;\r\n width?: string;\r\n height?: string;\r\n style?: React.CSSProperties;\r\n}\r\n\r\nfunction SVGIcon(props: SVGIconI) {\r\n return (\r\n \r\n );\r\n}\r\n\r\nexport default SVGIcon;\r\n","import WeakMap from './_WeakMap.js';\n\n/** Used to store function metadata. */\nvar metaMap = WeakMap && new WeakMap;\n\nexport default metaMap;\n","import identity from './identity.js';\nimport metaMap from './_metaMap.js';\n\n/**\n * The base implementation of `setData` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\nvar baseSetData = !metaMap ? identity : function(func, data) {\n metaMap.set(func, data);\n return func;\n};\n\nexport default baseSetData;\n","import isObject from './isObject.js';\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nexport default baseCreate;\n","import baseCreate from './_baseCreate.js';\nimport isObject from './isObject.js';\n\n/**\n * Creates a function that produces an instance of `Ctor` regardless of\n * whether it was invoked as part of a `new` expression or by `call` or `apply`.\n *\n * @private\n * @param {Function} Ctor The constructor to wrap.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createCtor(Ctor) {\n return function() {\n // Use a `switch` statement to work with class constructors. See\n // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist\n // for more details.\n var args = arguments;\n switch (args.length) {\n case 0: return new Ctor;\n case 1: return new Ctor(args[0]);\n case 2: return new Ctor(args[0], args[1]);\n case 3: return new Ctor(args[0], args[1], args[2]);\n case 4: return new Ctor(args[0], args[1], args[2], args[3]);\n case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);\n case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);\n case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);\n }\n var thisBinding = baseCreate(Ctor.prototype),\n result = Ctor.apply(thisBinding, args);\n\n // Mimic the constructor's `return` behavior.\n // See https://es5.github.io/#x13.2.2 for more details.\n return isObject(result) ? result : thisBinding;\n };\n}\n\nexport default createCtor;\n","import createCtor from './_createCtor.js';\nimport root from './_root.js';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1;\n\n/**\n * Creates a function that wraps `func` to invoke it with the optional `this`\n * binding of `thisArg`.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createBind(func, bitmask, thisArg) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return fn.apply(isBind ? thisArg : this, arguments);\n }\n return wrapper;\n}\n\nexport default createBind;\n","/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates an array that is the composition of partially applied arguments,\n * placeholders, and provided arguments into a single array of arguments.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to prepend to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\nfunction composeArgs(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersLength = holders.length,\n leftIndex = -1,\n leftLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(leftLength + rangeLength),\n isUncurried = !isCurried;\n\n while (++leftIndex < leftLength) {\n result[leftIndex] = partials[leftIndex];\n }\n while (++argsIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[holders[argsIndex]] = args[argsIndex];\n }\n }\n while (rangeLength--) {\n result[leftIndex++] = args[argsIndex++];\n }\n return result;\n}\n\nexport default composeArgs;\n","/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * This function is like `composeArgs` except that the arguments composition\n * is tailored for `_.partialRight`.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to append to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\nfunction composeArgsRight(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersIndex = -1,\n holdersLength = holders.length,\n rightIndex = -1,\n rightLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(rangeLength + rightLength),\n isUncurried = !isCurried;\n\n while (++argsIndex < rangeLength) {\n result[argsIndex] = args[argsIndex];\n }\n var offset = argsIndex;\n while (++rightIndex < rightLength) {\n result[offset + rightIndex] = partials[rightIndex];\n }\n while (++holdersIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[offset + holders[holdersIndex]] = args[argsIndex++];\n }\n }\n return result;\n}\n\nexport default composeArgsRight;\n","/**\n * Gets the number of `placeholder` occurrences in `array`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} placeholder The placeholder to search for.\n * @returns {number} Returns the placeholder count.\n */\nfunction countHolders(array, placeholder) {\n var length = array.length,\n result = 0;\n\n while (length--) {\n if (array[length] === placeholder) {\n ++result;\n }\n }\n return result;\n}\n\nexport default countHolders;\n","/**\n * The function whose prototype chain sequence wrappers inherit from.\n *\n * @private\n */\nfunction baseLodash() {\n // No operation performed.\n}\n\nexport default baseLodash;\n","import baseCreate from './_baseCreate.js';\nimport baseLodash from './_baseLodash.js';\n\n/** Used as references for the maximum length and index of an array. */\nvar MAX_ARRAY_LENGTH = 4294967295;\n\n/**\n * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.\n *\n * @private\n * @constructor\n * @param {*} value The value to wrap.\n */\nfunction LazyWrapper(value) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__dir__ = 1;\n this.__filtered__ = false;\n this.__iteratees__ = [];\n this.__takeCount__ = MAX_ARRAY_LENGTH;\n this.__views__ = [];\n}\n\n// Ensure `LazyWrapper` is an instance of `baseLodash`.\nLazyWrapper.prototype = baseCreate(baseLodash.prototype);\nLazyWrapper.prototype.constructor = LazyWrapper;\n\nexport default LazyWrapper;\n","import metaMap from './_metaMap.js';\nimport noop from './noop.js';\n\n/**\n * Gets metadata for `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {*} Returns the metadata for `func`.\n */\nvar getData = !metaMap ? noop : function(func) {\n return metaMap.get(func);\n};\n\nexport default getData;\n","/** Used to lookup unminified function names. */\nvar realNames = {};\n\nexport default realNames;\n","import realNames from './_realNames.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the name of `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {string} Returns the function name.\n */\nfunction getFuncName(func) {\n var result = (func.name + ''),\n array = realNames[result],\n length = hasOwnProperty.call(realNames, result) ? array.length : 0;\n\n while (length--) {\n var data = array[length],\n otherFunc = data.func;\n if (otherFunc == null || otherFunc == func) {\n return data.name;\n }\n }\n return result;\n}\n\nexport default getFuncName;\n","import baseCreate from './_baseCreate.js';\nimport baseLodash from './_baseLodash.js';\n\n/**\n * The base constructor for creating `lodash` wrapper objects.\n *\n * @private\n * @param {*} value The value to wrap.\n * @param {boolean} [chainAll] Enable explicit method chain sequences.\n */\nfunction LodashWrapper(value, chainAll) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__chain__ = !!chainAll;\n this.__index__ = 0;\n this.__values__ = undefined;\n}\n\nLodashWrapper.prototype = baseCreate(baseLodash.prototype);\nLodashWrapper.prototype.constructor = LodashWrapper;\n\nexport default LodashWrapper;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nexport default copyArray;\n","import LazyWrapper from './_LazyWrapper.js';\nimport LodashWrapper from './_LodashWrapper.js';\nimport copyArray from './_copyArray.js';\n\n/**\n * Creates a clone of `wrapper`.\n *\n * @private\n * @param {Object} wrapper The wrapper to clone.\n * @returns {Object} Returns the cloned wrapper.\n */\nfunction wrapperClone(wrapper) {\n if (wrapper instanceof LazyWrapper) {\n return wrapper.clone();\n }\n var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);\n result.__actions__ = copyArray(wrapper.__actions__);\n result.__index__ = wrapper.__index__;\n result.__values__ = wrapper.__values__;\n return result;\n}\n\nexport default wrapperClone;\n","import LazyWrapper from './_LazyWrapper.js';\nimport LodashWrapper from './_LodashWrapper.js';\nimport baseLodash from './_baseLodash.js';\nimport isArray from './isArray.js';\nimport isObjectLike from './isObjectLike.js';\nimport wrapperClone from './_wrapperClone.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chain sequences. Methods that operate on and return arrays, collections,\n * and functions can be chained together. Methods that retrieve a single value\n * or may return a primitive value will automatically end the chain sequence\n * and return the unwrapped value. Otherwise, the value must be unwrapped\n * with `_#value`.\n *\n * Explicit chain sequences, which must be unwrapped with `_#value`, may be\n * enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion.\n * Shortcut fusion is an optimization to merge iteratee calls; this avoids\n * the creation of intermediate arrays and can greatly reduce the number of\n * iteratee executions. Sections of a chain sequence qualify for shortcut\n * fusion if the section is applied to an array and iteratees accept only\n * one argument. The heuristic for whether a section qualifies for shortcut\n * fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,\n * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,\n * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,\n * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,\n * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,\n * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,\n * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,\n * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,\n * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,\n * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,\n * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,\n * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,\n * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,\n * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,\n * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,\n * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,\n * `zipObject`, `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,\n * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,\n * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,\n * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,\n * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,\n * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,\n * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,\n * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,\n * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,\n * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,\n * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,\n * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,\n * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,\n * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,\n * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,\n * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,\n * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,\n * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,\n * `upperFirst`, `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\nfunction lodash(value) {\n if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {\n if (value instanceof LodashWrapper) {\n return value;\n }\n if (hasOwnProperty.call(value, '__wrapped__')) {\n return wrapperClone(value);\n }\n }\n return new LodashWrapper(value);\n}\n\n// Ensure wrappers are instances of `baseLodash`.\nlodash.prototype = baseLodash.prototype;\nlodash.prototype.constructor = lodash;\n\nexport default lodash;\n","import LazyWrapper from './_LazyWrapper.js';\nimport getData from './_getData.js';\nimport getFuncName from './_getFuncName.js';\nimport lodash from './wrapperLodash.js';\n\n/**\n * Checks if `func` has a lazy counterpart.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` has a lazy counterpart,\n * else `false`.\n */\nfunction isLaziable(func) {\n var funcName = getFuncName(func),\n other = lodash[funcName];\n\n if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {\n return false;\n }\n if (func === other) {\n return true;\n }\n var data = getData(other);\n return !!data && func === data[0];\n}\n\nexport default isLaziable;\n","import baseSetData from './_baseSetData.js';\nimport shortOut from './_shortOut.js';\n\n/**\n * Sets metadata for `func`.\n *\n * **Note:** If this function becomes hot, i.e. is invoked a lot in a short\n * period of time, it will trip its breaker and transition to an identity\n * function to avoid garbage collection pauses in V8. See\n * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)\n * for more details.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\nvar setData = shortOut(baseSetData);\n\nexport default setData;\n","/** Used to match wrap detail comments. */\nvar reWrapDetails = /\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,\n reSplitDetails = /,? & /;\n\n/**\n * Extracts wrapper details from the `source` body comment.\n *\n * @private\n * @param {string} source The source to inspect.\n * @returns {Array} Returns the wrapper details.\n */\nfunction getWrapDetails(source) {\n var match = source.match(reWrapDetails);\n return match ? match[1].split(reSplitDetails) : [];\n}\n\nexport default getWrapDetails;\n","/** Used to match wrap detail comments. */\nvar reWrapComment = /\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/;\n\n/**\n * Inserts wrapper `details` in a comment at the top of the `source` body.\n *\n * @private\n * @param {string} source The source to modify.\n * @returns {Array} details The details to insert.\n * @returns {string} Returns the modified source.\n */\nfunction insertWrapDetails(source, details) {\n var length = details.length;\n if (!length) {\n return source;\n }\n var lastIndex = length - 1;\n details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];\n details = details.join(length > 2 ? ', ' : ' ');\n return source.replace(reWrapComment, '{\\n/* [wrapped with ' + details + '] */\\n');\n}\n\nexport default insertWrapDetails;\n","import arrayEach from './_arrayEach.js';\nimport arrayIncludes from './_arrayIncludes.js';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256,\n WRAP_FLIP_FLAG = 512;\n\n/** Used to associate wrap methods with their bit flags. */\nvar wrapFlags = [\n ['ary', WRAP_ARY_FLAG],\n ['bind', WRAP_BIND_FLAG],\n ['bindKey', WRAP_BIND_KEY_FLAG],\n ['curry', WRAP_CURRY_FLAG],\n ['curryRight', WRAP_CURRY_RIGHT_FLAG],\n ['flip', WRAP_FLIP_FLAG],\n ['partial', WRAP_PARTIAL_FLAG],\n ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],\n ['rearg', WRAP_REARG_FLAG]\n];\n\n/**\n * Updates wrapper `details` based on `bitmask` flags.\n *\n * @private\n * @returns {Array} details The details to modify.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Array} Returns `details`.\n */\nfunction updateWrapDetails(details, bitmask) {\n arrayEach(wrapFlags, function(pair) {\n var value = '_.' + pair[0];\n if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {\n details.push(value);\n }\n });\n return details.sort();\n}\n\nexport default updateWrapDetails;\n","import getWrapDetails from './_getWrapDetails.js';\nimport insertWrapDetails from './_insertWrapDetails.js';\nimport setToString from './_setToString.js';\nimport updateWrapDetails from './_updateWrapDetails.js';\n\n/**\n * Sets the `toString` method of `wrapper` to mimic the source of `reference`\n * with wrapper details in a comment at the top of the source body.\n *\n * @private\n * @param {Function} wrapper The function to modify.\n * @param {Function} reference The reference function.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Function} Returns `wrapper`.\n */\nfunction setWrapToString(wrapper, reference, bitmask) {\n var source = (reference + '');\n return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));\n}\n\nexport default setWrapToString;\n","import isLaziable from './_isLaziable.js';\nimport setData from './_setData.js';\nimport setWrapToString from './_setWrapToString.js';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64;\n\n/**\n * Creates a function that wraps `func` to continue currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {Function} wrapFunc The function to create the `func` wrapper.\n * @param {*} placeholder The placeholder value.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {\n var isCurry = bitmask & WRAP_CURRY_FLAG,\n newHolders = isCurry ? holders : undefined,\n newHoldersRight = isCurry ? undefined : holders,\n newPartials = isCurry ? partials : undefined,\n newPartialsRight = isCurry ? undefined : partials;\n\n bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);\n bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);\n\n if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {\n bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);\n }\n var newData = [\n func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,\n newHoldersRight, argPos, ary, arity\n ];\n\n var result = wrapFunc.apply(undefined, newData);\n if (isLaziable(func)) {\n setData(result, newData);\n }\n result.placeholder = placeholder;\n return setWrapToString(result, func, bitmask);\n}\n\nexport default createRecurry;\n","/**\n * Gets the argument placeholder value for `func`.\n *\n * @private\n * @param {Function} func The function to inspect.\n * @returns {*} Returns the placeholder value.\n */\nfunction getHolder(func) {\n var object = func;\n return object.placeholder;\n}\n\nexport default getHolder;\n","import copyArray from './_copyArray.js';\nimport isIndex from './_isIndex.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * Reorder `array` according to the specified indexes where the element at\n * the first index is assigned as the first element, the element at\n * the second index is assigned as the second element, and so on.\n *\n * @private\n * @param {Array} array The array to reorder.\n * @param {Array} indexes The arranged array indexes.\n * @returns {Array} Returns `array`.\n */\nfunction reorder(array, indexes) {\n var arrLength = array.length,\n length = nativeMin(indexes.length, arrLength),\n oldArray = copyArray(array);\n\n while (length--) {\n var index = indexes[length];\n array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;\n }\n return array;\n}\n\nexport default reorder;\n","/** Used as the internal argument placeholder. */\nvar PLACEHOLDER = '__lodash_placeholder__';\n\n/**\n * Replaces all `placeholder` elements in `array` with an internal placeholder\n * and returns an array of their indexes.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {*} placeholder The placeholder to replace.\n * @returns {Array} Returns the new array of placeholder indexes.\n */\nfunction replaceHolders(array, placeholder) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value === placeholder || value === PLACEHOLDER) {\n array[index] = PLACEHOLDER;\n result[resIndex++] = index;\n }\n }\n return result;\n}\n\nexport default replaceHolders;\n","import composeArgs from './_composeArgs.js';\nimport composeArgsRight from './_composeArgsRight.js';\nimport countHolders from './_countHolders.js';\nimport createCtor from './_createCtor.js';\nimport createRecurry from './_createRecurry.js';\nimport getHolder from './_getHolder.js';\nimport reorder from './_reorder.js';\nimport replaceHolders from './_replaceHolders.js';\nimport root from './_root.js';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_ARY_FLAG = 128,\n WRAP_FLIP_FLAG = 512;\n\n/**\n * Creates a function that wraps `func` to invoke it with optional `this`\n * binding of `thisArg`, partial application, and currying.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [partialsRight] The arguments to append to those provided\n * to the new function.\n * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {\n var isAry = bitmask & WRAP_ARY_FLAG,\n isBind = bitmask & WRAP_BIND_FLAG,\n isBindKey = bitmask & WRAP_BIND_KEY_FLAG,\n isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),\n isFlip = bitmask & WRAP_FLIP_FLAG,\n Ctor = isBindKey ? undefined : createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length;\n\n while (index--) {\n args[index] = arguments[index];\n }\n if (isCurried) {\n var placeholder = getHolder(wrapper),\n holdersCount = countHolders(args, placeholder);\n }\n if (partials) {\n args = composeArgs(args, partials, holders, isCurried);\n }\n if (partialsRight) {\n args = composeArgsRight(args, partialsRight, holdersRight, isCurried);\n }\n length -= holdersCount;\n if (isCurried && length < arity) {\n var newHolders = replaceHolders(args, placeholder);\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, thisArg,\n args, newHolders, argPos, ary, arity - length\n );\n }\n var thisBinding = isBind ? thisArg : this,\n fn = isBindKey ? thisBinding[func] : func;\n\n length = args.length;\n if (argPos) {\n args = reorder(args, argPos);\n } else if (isFlip && length > 1) {\n args.reverse();\n }\n if (isAry && ary < length) {\n args.length = ary;\n }\n if (this && this !== root && this instanceof wrapper) {\n fn = Ctor || createCtor(fn);\n }\n return fn.apply(thisBinding, args);\n }\n return wrapper;\n}\n\nexport default createHybrid;\n","import apply from './_apply.js';\nimport createCtor from './_createCtor.js';\nimport createHybrid from './_createHybrid.js';\nimport createRecurry from './_createRecurry.js';\nimport getHolder from './_getHolder.js';\nimport replaceHolders from './_replaceHolders.js';\nimport root from './_root.js';\n\n/**\n * Creates a function that wraps `func` to enable currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {number} arity The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createCurry(func, bitmask, arity) {\n var Ctor = createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length,\n placeholder = getHolder(wrapper);\n\n while (index--) {\n args[index] = arguments[index];\n }\n var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)\n ? []\n : replaceHolders(args, placeholder);\n\n length -= holders.length;\n if (length < arity) {\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, undefined,\n args, holders, undefined, undefined, arity - length);\n }\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return apply(fn, this, args);\n }\n return wrapper;\n}\n\nexport default createCurry;\n","import apply from './_apply.js';\nimport createCtor from './_createCtor.js';\nimport root from './_root.js';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1;\n\n/**\n * Creates a function that wraps `func` to invoke it with the `this` binding\n * of `thisArg` and `partials` prepended to the arguments it receives.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} partials The arguments to prepend to those provided to\n * the new function.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createPartial(func, bitmask, thisArg, partials) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var argsIndex = -1,\n argsLength = arguments.length,\n leftIndex = -1,\n leftLength = partials.length,\n args = Array(leftLength + argsLength),\n fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n\n while (++leftIndex < leftLength) {\n args[leftIndex] = partials[leftIndex];\n }\n while (argsLength--) {\n args[leftIndex++] = arguments[++argsIndex];\n }\n return apply(fn, isBind ? thisArg : this, args);\n }\n return wrapper;\n}\n\nexport default createPartial;\n","import composeArgs from './_composeArgs.js';\nimport composeArgsRight from './_composeArgsRight.js';\nimport replaceHolders from './_replaceHolders.js';\n\n/** Used as the internal argument placeholder. */\nvar PLACEHOLDER = '__lodash_placeholder__';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * Merges the function metadata of `source` into `data`.\n *\n * Merging metadata reduces the number of wrappers used to invoke a function.\n * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`\n * may be applied regardless of execution order. Methods like `_.ary` and\n * `_.rearg` modify function arguments, making the order in which they are\n * executed important, preventing the merging of metadata. However, we make\n * an exception for a safe combined case where curried functions have `_.ary`\n * and or `_.rearg` applied.\n *\n * @private\n * @param {Array} data The destination metadata.\n * @param {Array} source The source metadata.\n * @returns {Array} Returns `data`.\n */\nfunction mergeData(data, source) {\n var bitmask = data[1],\n srcBitmask = source[1],\n newBitmask = bitmask | srcBitmask,\n isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);\n\n var isCombo =\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||\n ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));\n\n // Exit early if metadata can't be merged.\n if (!(isCommon || isCombo)) {\n return data;\n }\n // Use source `thisArg` if available.\n if (srcBitmask & WRAP_BIND_FLAG) {\n data[2] = source[2];\n // Set when currying a bound function.\n newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;\n }\n // Compose partial arguments.\n var value = source[3];\n if (value) {\n var partials = data[3];\n data[3] = partials ? composeArgs(partials, value, source[4]) : value;\n data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];\n }\n // Compose partial right arguments.\n value = source[5];\n if (value) {\n partials = data[5];\n data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;\n data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];\n }\n // Use source `argPos` if available.\n value = source[7];\n if (value) {\n data[7] = value;\n }\n // Use source `ary` if it's smaller.\n if (srcBitmask & WRAP_ARY_FLAG) {\n data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);\n }\n // Use source `arity` if one is not provided.\n if (data[9] == null) {\n data[9] = source[9];\n }\n // Use source `func` and merge bitmasks.\n data[0] = source[0];\n data[1] = newBitmask;\n\n return data;\n}\n\nexport default mergeData;\n","import baseSetData from './_baseSetData.js';\nimport createBind from './_createBind.js';\nimport createCurry from './_createCurry.js';\nimport createHybrid from './_createHybrid.js';\nimport createPartial from './_createPartial.js';\nimport getData from './_getData.js';\nimport mergeData from './_mergeData.js';\nimport setData from './_setData.js';\nimport setWrapToString from './_setWrapToString.js';\nimport toInteger from './toInteger.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates a function that either curries or invokes `func` with optional\n * `this` binding and partially applied arguments.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags.\n * 1 - `_.bind`\n * 2 - `_.bindKey`\n * 4 - `_.curry` or `_.curryRight` of a bound function\n * 8 - `_.curry`\n * 16 - `_.curryRight`\n * 32 - `_.partial`\n * 64 - `_.partialRight`\n * 128 - `_.rearg`\n * 256 - `_.ary`\n * 512 - `_.flip`\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to be partially applied.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {\n var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;\n if (!isBindKey && typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var length = partials ? partials.length : 0;\n if (!length) {\n bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);\n partials = holders = undefined;\n }\n ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);\n arity = arity === undefined ? arity : toInteger(arity);\n length -= holders ? holders.length : 0;\n\n if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {\n var partialsRight = partials,\n holdersRight = holders;\n\n partials = holders = undefined;\n }\n var data = isBindKey ? undefined : getData(func);\n\n var newData = [\n func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,\n argPos, ary, arity\n ];\n\n if (data) {\n mergeData(newData, data);\n }\n func = newData[0];\n bitmask = newData[1];\n thisArg = newData[2];\n partials = newData[3];\n holders = newData[4];\n arity = newData[9] = newData[9] === undefined\n ? (isBindKey ? 0 : func.length)\n : nativeMax(newData[9] - length, 0);\n\n if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {\n bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);\n }\n if (!bitmask || bitmask == WRAP_BIND_FLAG) {\n var result = createBind(func, bitmask, thisArg);\n } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {\n result = createCurry(func, bitmask, arity);\n } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {\n result = createPartial(func, bitmask, thisArg, partials);\n } else {\n result = createHybrid.apply(undefined, newData);\n }\n var setter = data ? baseSetData : setData;\n return setWrapToString(setter(result, newData), func, bitmask);\n}\n\nexport default createWrap;\n","import baseRest from './_baseRest.js';\nimport createWrap from './_createWrap.js';\nimport getHolder from './_getHolder.js';\nimport replaceHolders from './_replaceHolders.js';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_PARTIAL_RIGHT_FLAG = 64;\n\n/**\n * This method is like `_.partial` except that partially applied arguments\n * are appended to the arguments it receives.\n *\n * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var greetFred = _.partialRight(greet, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n *\n * // Partially applied with placeholders.\n * var sayHelloTo = _.partialRight(greet, 'hello', _);\n * sayHelloTo('fred');\n * // => 'hello fred'\n */\nvar partialRight = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partialRight));\n return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);\n});\n\n// Assign default placeholders.\npartialRight.placeholder = {};\n\nexport default partialRight;\n","import PropTypes from 'prop-types';\nimport React from 'react';\n\nfunction SearchCategoryLayout(props) {\n var categoryContent = props.categoryContent,\n resultsContent = props.resultsContent;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"div\", {\n className: \"name\"\n }, categoryContent), /*#__PURE__*/React.createElement(\"div\", {\n className: \"results\"\n }, resultsContent));\n}\n\nSearchCategoryLayout.handledProps = [\"categoryContent\", \"resultsContent\"];\nSearchCategoryLayout.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** The rendered category content */\n categoryContent: PropTypes.element.isRequired,\n\n /** The rendered results content */\n resultsContent: PropTypes.element.isRequired\n} : {};\nexport default SearchCategoryLayout;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport cx from 'clsx';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps, useKeyOnly } from '../../lib';\nimport SearchCategoryLayout from './SearchCategoryLayout';\n\nfunction SearchCategory(props) {\n var active = props.active,\n children = props.children,\n className = props.className,\n content = props.content,\n layoutRenderer = props.layoutRenderer,\n renderer = props.renderer;\n var classes = cx(useKeyOnly(active, 'active'), 'category', className);\n var rest = getUnhandledProps(SearchCategory, props);\n var ElementType = getElementType(SearchCategory, props);\n var categoryContent = renderer(props);\n var resultsContent = childrenUtils.isNil(children) ? content : children;\n return /*#__PURE__*/React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), layoutRenderer({\n categoryContent: categoryContent,\n resultsContent: resultsContent\n }));\n}\n\nSearchCategory.handledProps = [\"active\", \"as\", \"children\", \"className\", \"content\", \"layoutRenderer\", \"name\", \"renderer\", \"results\"];\nSearchCategory.defaultProps = {\n layoutRenderer: SearchCategoryLayout,\n renderer: function renderer(_ref) {\n var name = _ref.name;\n return name;\n }\n};\nSearchCategory.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: PropTypes.elementType,\n\n /** The item currently selected by keyboard shortcut. */\n active: PropTypes.bool,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** Display name. */\n name: PropTypes.string,\n\n /**\n * Renders the category layout contents.\n *\n * @param {object} props - The SearchCategoryLayout props object.\n * @returns {*} - Renderable category layout contents.\n */\n layoutRenderer: PropTypes.func,\n\n /**\n * Renders the category contents.\n *\n * @param {object} props - The SearchCategory props object.\n * @returns {*} - Renderable category contents.\n */\n renderer: PropTypes.func,\n\n /** Array of Search.Result props. */\n results: PropTypes.array\n} : {};\nexport default SearchCategory;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport cx from 'clsx';\nimport PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport { createHTMLImage, customPropTypes, getElementType, getUnhandledProps, useKeyOnly } from '../../lib'; // Note: You technically only need the 'content' wrapper when there's an\n// image. However, optionally wrapping it makes this function a lot more\n// complicated and harder to read. Since always wrapping it doesn't affect\n// the style in any way let's just do that.\n//\n// Note: To avoid requiring a wrapping div, we return an array here so to\n// prevent rendering issues each node needs a unique key.\n\nvar defaultRenderer = function defaultRenderer(_ref) {\n var image = _ref.image,\n price = _ref.price,\n title = _ref.title,\n description = _ref.description;\n return [image && /*#__PURE__*/React.createElement(\"div\", {\n key: \"image\",\n className: \"image\"\n }, createHTMLImage(image, {\n autoGenerateKey: false\n })), /*#__PURE__*/React.createElement(\"div\", {\n key: \"content\",\n className: \"content\"\n }, price && /*#__PURE__*/React.createElement(\"div\", {\n className: \"price\"\n }, price), title && /*#__PURE__*/React.createElement(\"div\", {\n className: \"title\"\n }, title), description && /*#__PURE__*/React.createElement(\"div\", {\n className: \"description\"\n }, description))];\n};\n\ndefaultRenderer.handledProps = [];\n\nvar SearchResult = /*#__PURE__*/function (_Component) {\n _inheritsLoose(SearchResult, _Component);\n\n function SearchResult() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _Component.call.apply(_Component, [this].concat(args)) || this;\n\n _this.handleClick = function (e) {\n var onClick = _this.props.onClick;\n if (onClick) onClick(e, _this.props);\n };\n\n return _this;\n }\n\n var _proto = SearchResult.prototype;\n\n _proto.render = function render() {\n var _this$props = this.props,\n active = _this$props.active,\n className = _this$props.className,\n renderer = _this$props.renderer;\n var classes = cx(useKeyOnly(active, 'active'), 'result', className);\n var rest = getUnhandledProps(SearchResult, this.props);\n var ElementType = getElementType(SearchResult, this.props); // Note: You technically only need the 'content' wrapper when there's an\n // image. However, optionally wrapping it makes this function a lot more\n // complicated and harder to read. Since always wrapping it doesn't affect\n // the style in any way let's just do that.\n\n return /*#__PURE__*/React.createElement(ElementType, _extends({}, rest, {\n className: classes,\n onClick: this.handleClick\n }), renderer(this.props));\n };\n\n return SearchResult;\n}(Component);\n\nSearchResult.handledProps = [\"active\", \"as\", \"className\", \"content\", \"description\", \"id\", \"image\", \"onClick\", \"price\", \"renderer\", \"title\"];\nexport { SearchResult as default };\nSearchResult.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: PropTypes.elementType,\n\n /** The item currently selected by keyboard shortcut. */\n active: PropTypes.bool,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** Additional text with less emphasis. */\n description: PropTypes.string,\n\n /** A unique identifier. */\n id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n\n /** Add an image to the item. */\n image: PropTypes.string,\n\n /**\n * Called on click.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onClick: PropTypes.func,\n\n /** Customized text for price. */\n price: PropTypes.string,\n\n /**\n * Renders the result contents.\n *\n * @param {object} props - The SearchResult props object.\n * @returns {*} - Renderable result contents.\n */\n renderer: PropTypes.func,\n\n /** Display title. */\n title: PropTypes.string.isRequired\n} : {};\nSearchResult.defaultProps = {\n renderer: defaultRenderer\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport cx from 'clsx';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n\nfunction SearchResults(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = cx('results transition', className);\n var rest = getUnhandledProps(SearchResults, props);\n var ElementType = getElementType(SearchResults, props);\n return /*#__PURE__*/React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nSearchResults.handledProps = [\"as\", \"children\", \"className\", \"content\"];\nSearchResults.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: PropTypes.elementType,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand\n} : {};\nexport default SearchResults;","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _without from \"lodash-es/without\";\nimport _isEmpty from \"lodash-es/isEmpty\";\nimport _partialRight from \"lodash-es/partialRight\";\nimport _inRange from \"lodash-es/inRange\";\nimport _map from \"lodash-es/map\";\nimport _get from \"lodash-es/get\";\nimport _reduce from \"lodash-es/reduce\";\nimport _invoke from \"lodash-es/invoke\";\nimport _isPlainObject from \"lodash-es/isPlainObject\";\nimport _isUndefined from \"lodash-es/isUndefined\";\nimport cx from 'clsx';\nimport keyboardKey from 'keyboard-key';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport shallowEqual from 'shallowequal';\nimport { ModernAutoControlledComponent as Component, customPropTypes, eventStack, getElementType, getUnhandledProps, htmlInputAttrs, isBrowser, objectDiff, partitionHTMLProps, SUI, useKeyOnly, useValueAndKey } from '../../lib';\nimport Input from '../../elements/Input';\nimport SearchCategory from './SearchCategory';\nimport SearchResult from './SearchResult';\nimport SearchResults from './SearchResults';\n\nvar overrideSearchInputProps = function overrideSearchInputProps(predefinedProps) {\n var input = predefinedProps.input;\n\n if (_isUndefined(input)) {\n return _extends({}, predefinedProps, {\n input: {\n className: 'prompt'\n }\n });\n }\n\n if (_isPlainObject(input)) {\n return _extends({}, predefinedProps, {\n input: _extends({}, input, {\n className: cx(input.className, 'prompt')\n })\n });\n }\n\n return predefinedProps;\n};\n/**\n * A search module allows a user to query for results from a selection of data\n */\n\n\nvar Search = /*#__PURE__*/function (_Component) {\n _inheritsLoose(Search, _Component);\n\n function Search() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _Component.call.apply(_Component, [this].concat(args)) || this;\n\n _this.handleResultSelect = function (e, result) {\n _invoke(_this.props, 'onResultSelect', e, _extends({}, _this.props, {\n result: result\n }));\n };\n\n _this.handleSelectionChange = function (e) {\n var result = _this.getSelectedResult();\n\n _invoke(_this.props, 'onSelectionChange', e, _extends({}, _this.props, {\n result: result\n }));\n };\n\n _this.closeOnEscape = function (e) {\n if (keyboardKey.getCode(e) !== keyboardKey.Escape) return;\n e.preventDefault();\n\n _this.close();\n };\n\n _this.moveSelectionOnKeyDown = function (e) {\n switch (keyboardKey.getCode(e)) {\n case keyboardKey.ArrowDown:\n e.preventDefault();\n\n _this.moveSelectionBy(e, 1);\n\n break;\n\n case keyboardKey.ArrowUp:\n e.preventDefault();\n\n _this.moveSelectionBy(e, -1);\n\n break;\n\n default:\n break;\n }\n };\n\n _this.selectItemOnEnter = function (e) {\n if (keyboardKey.getCode(e) !== keyboardKey.Enter) return;\n\n var result = _this.getSelectedResult(); // prevent selecting null if there was no selected item value\n\n\n if (!result) return;\n e.preventDefault(); // notify the onResultSelect prop that the user is trying to change value\n\n _this.setValue(result.title);\n\n _this.handleResultSelect(e, result);\n\n _this.close();\n };\n\n _this.closeOnDocumentClick = function (e) {\n _this.close();\n };\n\n _this.handleMouseDown = function (e) {\n _this.isMouseDown = true;\n\n _invoke(_this.props, 'onMouseDown', e, _this.props);\n\n eventStack.sub('mouseup', _this.handleDocumentMouseUp);\n };\n\n _this.handleDocumentMouseUp = function () {\n _this.isMouseDown = false;\n eventStack.unsub('mouseup', _this.handleDocumentMouseUp);\n };\n\n _this.handleInputClick = function (e) {\n // prevent closeOnDocumentClick()\n e.nativeEvent.stopImmediatePropagation();\n\n _this.tryOpen();\n };\n\n _this.handleItemClick = function (e, _ref) {\n var id = _ref.id;\n\n var result = _this.getSelectedResult(id); // prevent closeOnDocumentClick()\n\n\n e.nativeEvent.stopImmediatePropagation(); // notify the onResultSelect prop that the user is trying to change value\n\n _this.setValue(result.title);\n\n _this.handleResultSelect(e, result);\n\n _this.close();\n };\n\n _this.handleItemMouseDown = function (e) {\n // Heads up! We should prevent default to prevent blur events.\n // https://github.com/Semantic-Org/Semantic-UI-React/issues/3298\n e.preventDefault();\n };\n\n _this.handleFocus = function (e) {\n _invoke(_this.props, 'onFocus', e, _this.props);\n\n _this.setState({\n focus: true\n });\n };\n\n _this.handleBlur = function (e) {\n _invoke(_this.props, 'onBlur', e, _this.props);\n\n _this.setState({\n focus: false\n });\n };\n\n _this.handleSearchChange = function (e) {\n // prevent propagating to this.props.onChange()\n e.stopPropagation();\n var minCharacters = _this.props.minCharacters;\n var open = _this.state.open;\n var newQuery = e.target.value;\n\n _invoke(_this.props, 'onSearchChange', e, _extends({}, _this.props, {\n value: newQuery\n })); // open search dropdown on search query\n\n\n if (newQuery.length < minCharacters) {\n _this.close();\n } else if (!open) {\n _this.tryOpen(newQuery);\n }\n\n _this.setValue(newQuery);\n };\n\n _this.getFlattenedResults = function () {\n var _this$props = _this.props,\n category = _this$props.category,\n results = _this$props.results;\n return !category ? results : _reduce(results, function (memo, categoryData) {\n return memo.concat(categoryData.results);\n }, []);\n };\n\n _this.getSelectedResult = function (index) {\n if (index === void 0) {\n index = _this.state.selectedIndex;\n }\n\n var results = _this.getFlattenedResults();\n\n return _get(results, index);\n };\n\n _this.setValue = function (value) {\n var selectFirstResult = _this.props.selectFirstResult;\n\n _this.setState({\n value: value,\n selectedIndex: selectFirstResult ? 0 : -1\n });\n };\n\n _this.moveSelectionBy = function (e, offset) {\n var selectedIndex = _this.state.selectedIndex;\n\n var results = _this.getFlattenedResults();\n\n var lastIndex = results.length - 1; // next is after last, wrap to beginning\n // next is before first, wrap to end\n\n var nextIndex = selectedIndex + offset;\n if (nextIndex > lastIndex) nextIndex = 0;else if (nextIndex < 0) nextIndex = lastIndex;\n\n _this.setState({\n selectedIndex: nextIndex\n });\n\n _this.scrollSelectedItemIntoView();\n\n _this.handleSelectionChange(e);\n };\n\n _this.scrollSelectedItemIntoView = function () {\n // Do not access document when server side rendering\n if (!isBrowser()) return;\n var menu = document.querySelector('.ui.search.active.visible .results.visible');\n if (!menu) return;\n var item = menu.querySelector('.result.active');\n if (!item) return;\n var isOutOfUpperView = item.offsetTop < menu.scrollTop;\n var isOutOfLowerView = item.offsetTop + item.clientHeight > menu.scrollTop + menu.clientHeight;\n\n if (isOutOfUpperView) {\n menu.scrollTop = item.offsetTop;\n } else if (isOutOfLowerView) {\n menu.scrollTop = item.offsetTop + item.clientHeight - menu.clientHeight;\n }\n };\n\n _this.tryOpen = function (currentValue) {\n if (currentValue === void 0) {\n currentValue = _this.state.value;\n }\n\n var minCharacters = _this.props.minCharacters;\n if (currentValue.length < minCharacters) return;\n\n _this.open();\n };\n\n _this.open = function () {\n _this.setState({\n open: true\n });\n };\n\n _this.close = function () {\n _this.setState({\n open: false\n });\n };\n\n _this.renderSearchInput = function (rest) {\n var _this$props2 = _this.props,\n icon = _this$props2.icon,\n input = _this$props2.input,\n placeholder = _this$props2.placeholder;\n var value = _this.state.value;\n return Input.create(input, {\n autoGenerateKey: false,\n defaultProps: _extends({}, rest, {\n autoComplete: 'off',\n icon: icon,\n onChange: _this.handleSearchChange,\n onClick: _this.handleInputClick,\n tabIndex: '0',\n value: value,\n placeholder: placeholder\n }),\n // Nested shorthand props need special treatment to survive the shallow merge\n overrideProps: overrideSearchInputProps\n });\n };\n\n _this.renderNoResults = function () {\n var _this$props3 = _this.props,\n noResultsDescription = _this$props3.noResultsDescription,\n noResultsMessage = _this$props3.noResultsMessage;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"message empty\"\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"header\"\n }, noResultsMessage), noResultsDescription && /*#__PURE__*/React.createElement(\"div\", {\n className: \"description\"\n }, noResultsDescription));\n };\n\n _this.renderResult = function (_ref2, index, _array, offset) {\n var childKey = _ref2.childKey,\n result = _objectWithoutPropertiesLoose(_ref2, [\"childKey\"]);\n\n if (offset === void 0) {\n offset = 0;\n }\n\n var resultRenderer = _this.props.resultRenderer;\n var selectedIndex = _this.state.selectedIndex;\n var offsetIndex = index + offset;\n return /*#__PURE__*/React.createElement(SearchResult, _extends({\n key: childKey != null ? childKey : result.id || result.title,\n active: selectedIndex === offsetIndex,\n onClick: _this.handleItemClick,\n onMouseDown: _this.handleItemMouseDown,\n renderer: resultRenderer\n }, result, {\n id: offsetIndex // Used to lookup the result on item click\n\n }));\n };\n\n _this.renderResults = function () {\n var results = _this.props.results;\n return _map(results, _this.renderResult);\n };\n\n _this.renderCategories = function () {\n var _this$props4 = _this.props,\n categoryLayoutRenderer = _this$props4.categoryLayoutRenderer,\n categoryRenderer = _this$props4.categoryRenderer,\n categories = _this$props4.results;\n var selectedIndex = _this.state.selectedIndex;\n var count = 0;\n return _map(categories, function (_ref3) {\n var childKey = _ref3.childKey,\n category = _objectWithoutPropertiesLoose(_ref3, [\"childKey\"]);\n\n var categoryProps = _extends({\n key: childKey != null ? childKey : category.name,\n active: _inRange(selectedIndex, count, count + category.results.length),\n layoutRenderer: categoryLayoutRenderer,\n renderer: categoryRenderer\n }, category);\n\n var renderFn = _partialRight(_this.renderResult, count);\n\n count += category.results.length;\n return /*#__PURE__*/React.createElement(SearchCategory, categoryProps, category.results.map(renderFn));\n });\n };\n\n _this.renderMenuContent = function () {\n var _this$props5 = _this.props,\n category = _this$props5.category,\n showNoResults = _this$props5.showNoResults,\n results = _this$props5.results;\n\n if (_isEmpty(results)) {\n return showNoResults ? _this.renderNoResults() : null;\n }\n\n return category ? _this.renderCategories() : _this.renderResults();\n };\n\n _this.renderResultsMenu = function () {\n var open = _this.state.open;\n var resultsClasses = open ? 'visible' : '';\n\n var menuContent = _this.renderMenuContent();\n\n if (!menuContent) return;\n return /*#__PURE__*/React.createElement(SearchResults, {\n className: resultsClasses\n }, menuContent);\n };\n\n return _this;\n }\n\n Search.getAutoControlledStateFromProps = function getAutoControlledStateFromProps(props, state) {\n // We need to store a `prevValue` to compare as in `getDerivedStateFromProps` we don't have\n // prevState\n if (typeof state.prevValue !== 'undefined' && shallowEqual(state.prevValue, state.value)) {\n return {\n prevValue: state.value\n };\n }\n\n var selectedIndex = props.selectFirstResult ? 0 : -1;\n return {\n prevValue: state.value,\n selectedIndex: selectedIndex\n };\n };\n\n var _proto = Search.prototype;\n\n _proto.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState) {\n return !shallowEqual(nextProps, this.props) || !shallowEqual(nextState, this.state);\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {\n // eslint-disable-line complexity\n // focused / blurred\n if (!prevState.focus && this.state.focus) {\n if (!this.isMouseDown) {\n this.tryOpen();\n }\n\n if (this.state.open) {\n eventStack.sub('keydown', [this.moveSelectionOnKeyDown, this.selectItemOnEnter]);\n }\n } else if (prevState.focus && !this.state.focus) {\n if (!this.isMouseDown) {\n this.close();\n }\n\n eventStack.unsub('keydown', [this.moveSelectionOnKeyDown, this.selectItemOnEnter]);\n } // opened / closed\n\n\n if (!prevState.open && this.state.open) {\n this.open();\n eventStack.sub('click', this.closeOnDocumentClick);\n eventStack.sub('keydown', [this.closeOnEscape, this.moveSelectionOnKeyDown, this.selectItemOnEnter]);\n } else if (prevState.open && !this.state.open) {\n this.close();\n eventStack.unsub('click', this.closeOnDocumentClick);\n eventStack.unsub('keydown', [this.closeOnEscape, this.moveSelectionOnKeyDown, this.selectItemOnEnter]);\n }\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n eventStack.unsub('click', this.closeOnDocumentClick);\n eventStack.unsub('keydown', [this.closeOnEscape, this.moveSelectionOnKeyDown, this.selectItemOnEnter]);\n } // ----------------------------------------\n // Document Event Handlers\n // ----------------------------------------\n ;\n\n _proto.render = function render() {\n var _this$state = this.state,\n searchClasses = _this$state.searchClasses,\n focus = _this$state.focus,\n open = _this$state.open;\n var _this$props6 = this.props,\n aligned = _this$props6.aligned,\n category = _this$props6.category,\n className = _this$props6.className,\n fluid = _this$props6.fluid,\n loading = _this$props6.loading,\n size = _this$props6.size; // Classes\n\n var classes = cx('ui', open && 'active visible', size, searchClasses, useKeyOnly(category, 'category'), useKeyOnly(focus, 'focus'), useKeyOnly(fluid, 'fluid'), useKeyOnly(loading, 'loading'), useValueAndKey(aligned, 'aligned'), 'search', className);\n var unhandled = getUnhandledProps(Search, this.props);\n var ElementType = getElementType(Search, this.props);\n\n var _partitionHTMLProps = partitionHTMLProps(unhandled, {\n htmlProps: htmlInputAttrs\n }),\n htmlInputProps = _partitionHTMLProps[0],\n rest = _partitionHTMLProps[1];\n\n return /*#__PURE__*/React.createElement(ElementType, _extends({}, rest, {\n className: classes,\n onBlur: this.handleBlur,\n onFocus: this.handleFocus,\n onMouseDown: this.handleMouseDown\n }), this.renderSearchInput(htmlInputProps), this.renderResultsMenu());\n };\n\n return Search;\n}(Component);\n\nSearch.handledProps = [\"aligned\", \"as\", \"category\", \"categoryLayoutRenderer\", \"categoryRenderer\", \"className\", \"defaultOpen\", \"defaultValue\", \"fluid\", \"icon\", \"input\", \"loading\", \"minCharacters\", \"noResultsDescription\", \"noResultsMessage\", \"onBlur\", \"onFocus\", \"onMouseDown\", \"onResultSelect\", \"onSearchChange\", \"onSelectionChange\", \"open\", \"placeholder\", \"resultRenderer\", \"results\", \"selectFirstResult\", \"showNoResults\", \"size\", \"value\"];\nexport { Search as default };\nSearch.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: PropTypes.elementType,\n // ------------------------------------\n // Behavior\n // ------------------------------------\n\n /** Initial value of open. */\n defaultOpen: PropTypes.bool,\n\n /** Initial value. */\n defaultValue: PropTypes.string,\n\n /** Shorthand for Icon. */\n icon: PropTypes.oneOfType([PropTypes.node, PropTypes.object]),\n\n /** Minimum characters to query for results */\n minCharacters: PropTypes.number,\n\n /** Additional text for \"No Results\" message with less emphasis. */\n noResultsDescription: PropTypes.node,\n\n /** Message to display when there are no results. */\n noResultsMessage: PropTypes.node,\n\n /** Controls whether or not the results menu is displayed. */\n open: PropTypes.bool,\n\n /**\n * One of:\n * - array of Search.Result props e.g. `{ title: '', description: '' }` or\n * - object of categories e.g. `{ name: '', results: [{ title: '', description: '' }]`\n */\n results: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.shape(SearchResult.propTypes)), PropTypes.shape(SearchCategory.propTypes)]),\n\n /** Whether the search should automatically select the first result after searching. */\n selectFirstResult: PropTypes.bool,\n\n /** Whether a \"no results\" message should be shown if no results are found. */\n showNoResults: PropTypes.bool,\n\n /** Current value of the search input. Creates a controlled component. */\n value: PropTypes.string,\n // ------------------------------------\n // Rendering\n // ------------------------------------\n\n /**\n * Renders the SearchCategory layout.\n *\n * @param {object} categoryContent - The Renderable SearchCategory contents.\n * @param {object} resultsContent - The Renderable SearchResult contents.\n * @returns {*} - Renderable SearchCategory layout.\n */\n categoryLayoutRenderer: PropTypes.func,\n\n /**\n * Renders the SearchCategory contents.\n *\n * @param {object} props - The SearchCategory props object.\n * @returns {*} - Renderable SearchCategory contents.\n */\n categoryRenderer: PropTypes.func,\n\n /**\n * Renders the SearchResult contents.\n *\n * @param {object} props - The SearchResult props object.\n * @returns {*} - Renderable SearchResult contents.\n */\n resultRenderer: PropTypes.func,\n // ------------------------------------\n // Callbacks\n // ------------------------------------\n\n /**\n * Called on blur.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onBlur: PropTypes.func,\n\n /**\n * Called on focus.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onFocus: PropTypes.func,\n\n /**\n * Called on mousedown.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onMouseDown: PropTypes.func,\n\n /**\n * Called when a result is selected.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onResultSelect: PropTypes.func,\n\n /**\n * Called on search input change.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props, includes current value of search input.\n */\n onSearchChange: PropTypes.func,\n\n /**\n * Called when the active selection index is changed.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onSelectionChange: PropTypes.func,\n // ------------------------------------\n // Style\n // ------------------------------------\n\n /** A search can have its results aligned to its left or right container edge. */\n aligned: PropTypes.string,\n\n /** A search can display results from remote content ordered by categories. */\n category: PropTypes.bool,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** A search can have its results take up the width of its container. */\n fluid: PropTypes.bool,\n\n /** Shorthand for input element. */\n input: customPropTypes.itemShorthand,\n\n /** A search can show a loading indicator. */\n loading: PropTypes.bool,\n\n /** A search can have different sizes. */\n size: PropTypes.oneOf(_without(SUI.SIZES, 'medium')),\n\n /** A search can show placeholder text when empty. */\n placeholder: PropTypes.string\n} : {};\nSearch.defaultProps = {\n icon: 'search',\n input: 'text',\n minCharacters: 1,\n noResultsMessage: 'No results found.',\n showNoResults: true\n};\nSearch.autoControlledProps = ['open', 'value'];\nSearch.Category = SearchCategory;\nSearch.Result = SearchResult;\nSearch.Results = SearchResults;","import { useEffect, useCallback } from \"react\";\r\nimport \"./SearchInput.less\";\r\nimport { Search } from \"semantic-ui-react\";\r\n\r\nimport { DebouncedFunction, debounce } from \"../../common/helpers\";\r\nimport { useSafeSetState } from \"src/common/hooks\";\r\n\r\n/**\r\n * Extended version of the Semantic Search Dropdown with our UI customization added.\r\n * */\r\n\r\ninterface SearchInputI {\r\n className?: string;\r\n defaultValue: string;\r\n dataAut?: string;\r\n fluid?: boolean;\r\n handleSearch: (val: string) => Promise;\r\n mapResults?: (vals: unknown[]) => { title: string; name: string }[];\r\n minCharacters?: number;\r\n placeholder?: string;\r\n renderIcon?: boolean;\r\n renderRightIcon?: boolean;\r\n reset: () => void;\r\n resultRenderer: (item: { title: string; name: string }) => JSX.Element;\r\n setSelection: (item: { title: string; name: string; value?: string }) => void;\r\n icon?: JSX.Element;\r\n}\r\n\r\nconst SearchInput = ({\r\n className,\r\n defaultValue,\r\n dataAut,\r\n fluid,\r\n handleSearch,\r\n mapResults,\r\n minCharacters = 1,\r\n placeholder,\r\n reset,\r\n resultRenderer,\r\n setSelection,\r\n icon,\r\n}: SearchInputI) => {\r\n const initialState = {\r\n searching: false,\r\n loading: false,\r\n options: [],\r\n value: null,\r\n inputValue: defaultValue || \"\",\r\n };\r\n\r\n const [state, safeSetState] = useSafeSetState(initialState);\r\n\r\n useEffect(() => {\r\n if (defaultValue && defaultValue.length) {\r\n safeSetState({ inputValue: defaultValue });\r\n }\r\n }, [defaultValue]);\r\n\r\n // Only send out search requests every 300 milliseconds\r\n\r\n const debouncedSearch: DebouncedFunction = useCallback(\r\n debounce((value) => {\r\n handleSearch(value).then((data) => {\r\n // If data needs to be mapped, it is done via a passed in prop\r\n safeSetState({\r\n loading: false,\r\n options: mapResults ? mapResults(data) : data,\r\n });\r\n });\r\n }, 300),\r\n []\r\n );\r\n\r\n // Clears our component state when the users input is empty\r\n const resetComponent = () => {\r\n safeSetState({ loading: false, options: [], value: null, inputValue: \"\" });\r\n };\r\n\r\n // Event handler for user clicking on an option.\r\n // The set selection prop is used here for parent components to get access to the selection.\r\n const handleResultSelect = (e, { result }) => {\r\n safeSetState({\r\n value: result,\r\n loading: false,\r\n inputValue: result.title,\r\n searching: false,\r\n });\r\n if (setSelection) setSelection(result);\r\n };\r\n\r\n const initiateNewSearch = (value) => {\r\n if (!value || value.length < minCharacters) {\r\n safeSetState({\r\n value: null,\r\n inputValue: value,\r\n searching: false,\r\n loading: false,\r\n });\r\n } else {\r\n safeSetState({\r\n loading: true,\r\n value: null,\r\n inputValue: value,\r\n searching: true,\r\n });\r\n debouncedSearch(value);\r\n }\r\n };\r\n\r\n const handleFocus = (e) => {\r\n e.target.select();\r\n };\r\n\r\n // When a user types in a new search, we need to be able to clear out any previously selected data\r\n const handleSearchChange = (e, { value }) => {\r\n // Reset parents data if reset prop is provided\r\n if (reset) reset();\r\n // If our new value is empty, reset component\r\n if (value.length < 1 || value.indexOf(\" \") === 0) resetComponent();\r\n else initiateNewSearch(value);\r\n };\r\n\r\n const { inputValue, loading, options, searching } = state;\r\n\r\n return (\r\n 0 && searching}\r\n onBlur={() => safeSetState({ loading: false })}\r\n onFocus={handleFocus}\r\n onResultSelect={handleResultSelect}\r\n onSearchChange={handleSearchChange}\r\n placeholder={placeholder || \"\"}\r\n resultRenderer={resultRenderer || undefined}\r\n selectFirstResult={true}\r\n results={options}\r\n value={inputValue}\r\n data-aut={dataAut || undefined}\r\n />\r\n );\r\n};\r\n\r\nexport default SearchInput;\r\n","import { useEffect, useRef, useState } from \"react\";\r\nimport { connect } from \"react-redux\";\r\nimport { Segment, Grid, Icon, List, Divider, Popup } from \"semantic-ui-react\";\r\nimport { Airline } from \"src/components\";\r\nimport { getFlightStatus } from \"src/services/application\";\r\nimport { formatDate, formatTime, toSpinalCase } from \"src/common\";\r\nimport { useFocusRefOnLoad } from \"src/common/hooks\";\r\nimport { FlightStatusEnumI } from \"src/redux/reducers/application\";\r\nimport { Passenger } from \"src/types/Passenger\";\r\nimport PlaneIcon from \"src/icons/PlaneIcon\";\r\nimport EmailIcon from \"src/icons/EmailIcon\";\r\nimport { FlightSegment } from \"src/types/Flight\";\r\n\r\nconst riskToClass = {\r\n 1: \"lowestRisk\",\r\n 2: \"lowRisk\",\r\n 3: \"mediumRisk\",\r\n 4: \"highRisk\",\r\n 5: \"severeRisk\",\r\n};\r\n\r\ntype City = {\r\n airportCode: string;\r\n state: string;\r\n city: string;\r\n country: string;\r\n latitude: number;\r\n longitude: number;\r\n utcTime: string;\r\n localTime: string;\r\n localEstimatedTime: string;\r\n highestRiskLevel?: number;\r\n};\r\n\r\nconst PopupContent = ({\r\n departureCity,\r\n arrivalCity,\r\n passengers,\r\n setOpen,\r\n}: {\r\n departureCity: City;\r\n arrivalCity: City;\r\n passengers: Passenger[];\r\n setOpen: (val: boolean) => void;\r\n}) => {\r\n const emailRef = useFocusRefOnLoad();\r\n const containerRef = useRef(null);\r\n\r\n useEffect(() => {\r\n function listener({ relatedTarget }) {\r\n if (\r\n containerRef.current &&\r\n !containerRef.current.contains(relatedTarget)\r\n ) {\r\n setOpen(false);\r\n }\r\n }\r\n window.addEventListener(\"focusout\", listener, true);\r\n return () => window.removeEventListener(\"focusout\", listener);\r\n }, [setOpen]);\r\n\r\n let emailFound;\r\n\r\n const getEmail = (p) => {\r\n if (p.email) {\r\n const ref = emailFound ? null : emailRef;\r\n emailFound = true;\r\n return (\r\n \r\n \r\n \r\n );\r\n } else return null;\r\n };\r\n return (\r\n
\r\n
\r\n {departureCity.city} To {arrivalCity.city}\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n {carrier} {operatingFlightNumber}\r\n \r\n \r\n \r\n \r\n {departure.airportCode}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {arrival.airportCode}\r\n \r\n \r\n \r\n \r\n {/* This is for the upcoming flights version of the flightcard */}\r\n {renderPopup && (\r\n \r\n \r\n {passengers.length}\r\n \r\n )}\r\n {/* This is for the Traveler Tracker version of the flightcard*/}\r\n {passenger && passenger.email && (\r\n \r\n e.stopPropagation()}\r\n >\r\n \r\n \r\n \r\n )}\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n Departure\r\n \r\n \r\n {formatDate(departure.localTime)}\r\n \r\n \r\n {formatTime(departure.localTime)}\r\n \r\n \r\n \r\n \r\n \r\n \r\n Arrival\r\n \r\n \r\n {formatDate(arrival.localTime)}\r\n \r\n \r\n {formatTime(arrival.localTime)}\r\n \r\n \r\n \r\n \r\n \r\n \r\n Status\r\n \r\n {getStatus(flight)}\r\n {riskRating > 0 ? renderRisk(riskRating) : null}\r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nconst mapStateToProps = (state) => ({\r\n flightStatusEnum: state.application.flightStatusEnum,\r\n});\r\n\r\nexport default connect(mapStateToProps)(FlightCard);\r\n","import { useState } from \"react\";\r\nimport { Icon, SemanticICONS } from \"semantic-ui-react\";\r\n\r\ninterface SmartImageI {\r\n alt: string;\r\n src: string;\r\n imageClassName: string;\r\n secondarySrc?: string;\r\n semanticIconName?: SemanticICONS;\r\n}\r\n\r\nfunction SmartImage({\r\n alt,\r\n src,\r\n imageClassName,\r\n secondarySrc,\r\n semanticIconName,\r\n}: SmartImageI) {\r\n const [inErrorState, setErrorState] = useState(false);\r\n\r\n function handleError() {\r\n setErrorState(true);\r\n }\r\n\r\n if (!inErrorState && src)\r\n return (\r\n \r\n );\r\n if (secondarySrc)\r\n return ;\r\n if (semanticIconName)\r\n return (\r\n \r\n );\r\n else return null;\r\n}\r\n\r\nexport default SmartImage;\r\n","import { useState, useEffect } from \"react\";\r\nimport { Input } from \"semantic-ui-react\";\r\nimport { DebouncedFunction, debounce } from \"src/common/helpers\";\r\n\r\nexport const debouncedSearch: DebouncedFunction = debounce(\r\n (value: string, callback: (val: string) => void) => {\r\n callback(value);\r\n },\r\n 250\r\n);\r\n\r\ninterface ThrottledInputI {\r\n ariaLabel?: string;\r\n query: string;\r\n onChange: (val: string) => void;\r\n placeholder?: string;\r\n dataAut?: string;\r\n className?: string;\r\n}\r\n\r\nconst ThrottledInput = ({\r\n ariaLabel = \"query\",\r\n query,\r\n onChange,\r\n placeholder,\r\n dataAut,\r\n ...props\r\n}: ThrottledInputI) => {\r\n const [queryState, setQuery] = useState(query);\r\n useEffect(() => {\r\n setQuery(query);\r\n }, [query]);\r\n\r\n const handleChange = (e) => {\r\n const query = e.target.value;\r\n // Sanitize input so that the first character can't be a blank space\r\n if (query.charCodeAt(0) !== 32) {\r\n setQuery(query);\r\n debouncedSearch(query, onChange);\r\n }\r\n };\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport default ThrottledInput;\r\n","import React, { Fragment, useCallback, useId, useRef } from \"react\";\r\nimport { useOnMount, useSafeSetState } from \"src/common/hooks\";\r\nimport { Button } from \"semantic-ui-react\";\r\nimport \"./Accordion.less\";\r\nimport ArrowIcon from \"src/icons/ArrowIcon\";\r\n\r\ninterface AccordionI {\r\n centerText?: boolean;\r\n children: React.ReactNode;\r\n disabled?: boolean;\r\n leftIcon?: boolean;\r\n topContent: string;\r\n className?: string;\r\n isOpen?: boolean;\r\n}\r\n\r\nfunction Accordion({\r\n centerText,\r\n children,\r\n disabled,\r\n leftIcon,\r\n topContent,\r\n className,\r\n isOpen,\r\n}: AccordionI) {\r\n const [{ open, height }, safeSetState] = useSafeSetState({\r\n open: isOpen,\r\n height: isOpen ? \"auto\" : \"0\",\r\n });\r\n\r\n const handleToggle = useCallback(\r\n (\r\n e?:\r\n | React.MouseEvent\r\n | React.MouseEvent\r\n ) => {\r\n if (disabled) return;\r\n if (e && e.stopPropagation) e.stopPropagation();\r\n // In order to have support a transition animation, we need hard coded pixel values for height, but we want to have it be auto as well for responsiveness.\r\n // The solution is to dynamically change that property before and after transitions.\r\n const newValue = !open;\r\n // Get the current height of the dom element, even if its set to 0, this is the rendered size of the content\r\n const scrollHeight = `${contentRef.current.scrollHeight}px`;\r\n let timeout;\r\n\r\n if (newValue) {\r\n // If we are opening up the accordion, we want to set the height to the scroll height\r\n safeSetState({ open: newValue, height: scrollHeight });\r\n\r\n // When the animation is done, we switch the style on the dom element\r\n timeout = setTimeout(() => {\r\n contentRef.current.style.height = \"auto\";\r\n }, transitionTime);\r\n } else {\r\n // Clear any timeouts that may be about to happen setting the height to auto\r\n clearInterval(timeout);\r\n // Set the height of the element to the scrollheight, it should be currently set to 'auto'\r\n contentRef.current.style.height = scrollHeight;\r\n // In order to make sure React waits long enough for the dom element to be updated, we wait for an animation frame\r\n window.requestAnimationFrame(() =>\r\n safeSetState({ open: newValue, height: \"0px\" })\r\n );\r\n }\r\n },\r\n [disabled, open, safeSetState]\r\n );\r\n\r\n useOnMount(() => {\r\n if (isOpen !== open) {\r\n handleToggle();\r\n }\r\n });\r\n\r\n const contentRef = useRef(null);\r\n const transitionTime = 300;\r\n const id = useId();\r\n\r\n return (\r\n \r\n
\r\n \r\n {count\r\n ? `${firstIndex + 1} - ${Math.min(lastIndex, count)} of ${count}`\r\n : \"0 - 0 of 0\"}\r\n \r\n \r\n
\r\n );\r\n}\r\n\r\nexport default TablePagination;\r\n","import React, { Component } from \"react\";\r\nimport { connect } from \"react-redux\";\r\nimport Loading from \"src/components/Loading\";\r\nimport { setPageError } from \"src/redux/actions/application\";\r\n\r\n// ErroBoundary uses legacy class based syntax since that required for componentDidCatch\r\nclass ErrorBoundary extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = { hasError: false };\r\n }\r\n\r\n componentDidCatch() {\r\n // If we are error handling for the page view, we set the error in redux so it can be reset on route change\r\n if (this.props.pageView) this.props.setPageError();\r\n // Otherwise we just set the local error state\r\n else this.setState({ hasError: true });\r\n }\r\n\r\n render() {\r\n // Check for local error or page level error\r\n if (this.state.hasError || (this.props.pageView && this.props.pageError)) {\r\n if (this.props.renderNull) return null;\r\n const isBackground = this.props.background ? true : false;\r\n // Our Loading/Error component fills its parent's div. In some cases we need to provide a full size container for it to go in.\r\n if (this.props.addContainer)\r\n return (\r\n
\r\n \r\n
\r\n );\r\n else return ;\r\n }\r\n // No error, render children\r\n return this.props.children;\r\n }\r\n}\r\n\r\nconst mapStateToProps = (state) => {\r\n return {\r\n pageError: state.application.pageError,\r\n };\r\n};\r\n\r\nconst mapDispatchToProps = (dispatch) => ({\r\n setPageError: () => dispatch(setPageError()),\r\n});\r\n\r\nexport default connect(mapStateToProps, mapDispatchToProps)(ErrorBoundary);\r\n","import SVGIcon from \"src/components/SVGIcon\";\r\n\r\nconst AirplaneGlobeIcon = ({ title = \"Airplane Globe\", ...props }) => {\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default AirplaneGlobeIcon;\r\n","import SVGIcon from \"src/components/SVGIcon\";\r\n\r\nconst ArrowIcon = ({ title = \"Arrow\", ...props }) => {\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default ArrowIcon;\r\n","import SVGIcon from \"src/components/SVGIcon\";\r\n\r\nconst CalendarIcon = ({ title = \"Calendar\", ...props }) => {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default CalendarIcon;\r\n","import SVGIcon from \"src/components/SVGIcon\";\r\n\r\nconst ConcurIcon = ({ title = \"Concur\", ...props }) => {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default ConcurIcon;\r\n","import SVGIcon from \"src/components/SVGIcon\";\r\n\r\nconst EmailIcon = ({ title = \"Email\", ...props }) => {\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default EmailIcon;\r\n","import SVGIcon from \"src/components/SVGIcon\";\r\n\r\nconst LightningIcon = ({ title = \"Lightning\", ...props }) => {\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default LightningIcon;\r\n","import SVGIcon from \"src/components/SVGIcon\";\r\n\r\nconst PlaneIcon = ({ title = \"Plane\", ...props }) => {\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default PlaneIcon;\r\n","import SVGIcon from \"src/components/SVGIcon\";\r\n\r\nconst Satellite = ({ title = \"Satellite\", ...props }) => {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default Satellite;\r\n","import React, { Suspense } from \"react\";\r\nimport { usePageInit } from \"src/common/hooks\";\r\nimport { Loading } from \"src/components\";\r\n\r\nconst Dashboard = React.lazy(() => import(\"./Dashboard\"));\r\n\r\nfunction DashboardPage(props) {\r\n usePageInit(\"Smart Portal\");\r\n return (\r\n \r\n }\r\n >\r\n \r\n \r\n );\r\n}\r\n\r\nexport default DashboardPage;\r\n","import React, { Suspense } from \"react\";\r\nimport { usePageInit } from \"src/common/hooks\";\r\nimport { useLightMode } from \"src/common/hooks/lightMode\";\r\nimport { Loading } from \"src/components\";\r\n\r\nconst FareForecaster = React.lazy(() => import(\"./FareForecaster\"));\r\n\r\nfunction FareForecasterPage(props) {\r\n usePageInit(\"Smart Portal - Fare Forecaster\");\r\n const { lightMode } = useLightMode();\r\n return (\r\n \r\n }\r\n >\r\n \r\n \r\n );\r\n}\r\n\r\nexport default FareForecasterPage;\r\n","import React, { Suspense } from \"react\";\r\nimport { usePageInit } from \"src/common/hooks\";\r\nimport { Loading } from \"src/components\";\r\n\r\nconst Approve = React.lazy(() => import(\"./ApprovePage\"));\r\n\r\nfunction ApprovePage(props) {\r\n usePageInit(\"Smart Portal - Approve\");\r\n return (\r\n \r\n }\r\n >\r\n \r\n \r\n );\r\n}\r\n\r\nexport default ApprovePage;\r\n","import React, { Suspense } from \"react\";\r\nimport { usePageInit } from \"src/common/hooks\";\r\nimport { Loading } from \"src/components\";\r\n\r\nconst CTMInvoices = React.lazy(() => import(\"./CTMInvoices\"));\r\n\r\nfunction CTMInvoicesPage(props) {\r\n usePageInit(\"Smart Portal - Invoices\");\r\n return (\r\n \r\n }\r\n >\r\n \r\n \r\n );\r\n}\r\n\r\nexport default CTMInvoicesPage;\r\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport cx from 'clsx';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n/**\n * A message can contain a content.\n */\n\nfunction MessageContent(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = cx('content', className);\n var rest = getUnhandledProps(MessageContent, props);\n var ElementType = getElementType(MessageContent, props);\n return /*#__PURE__*/React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nMessageContent.handledProps = [\"as\", \"children\", \"className\", \"content\"];\nMessageContent.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: PropTypes.elementType,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand\n} : {};\nexport default MessageContent;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport cx from 'clsx';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n/**\n * A message can contain a header.\n */\n\nfunction MessageHeader(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = cx('header', className);\n var rest = getUnhandledProps(MessageHeader, props);\n var ElementType = getElementType(MessageHeader, props);\n return /*#__PURE__*/React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nMessageHeader.handledProps = [\"as\", \"children\", \"className\", \"content\"];\nMessageHeader.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: PropTypes.elementType,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand\n} : {};\nMessageHeader.create = createShorthandFactory(MessageHeader, function (val) {\n return {\n content: val\n };\n});\nexport default MessageHeader;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport cx from 'clsx';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\n/**\n * A message list can contain an item.\n */\n\nfunction MessageItem(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = cx('content', className);\n var rest = getUnhandledProps(MessageItem, props);\n var ElementType = getElementType(MessageItem, props);\n return /*#__PURE__*/React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? content : children);\n}\n\nMessageItem.handledProps = [\"as\", \"children\", \"className\", \"content\"];\nMessageItem.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: PropTypes.elementType,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand\n} : {};\nMessageItem.defaultProps = {\n as: 'li'\n};\nMessageItem.create = createShorthandFactory(MessageItem, function (content) {\n return {\n content: content\n };\n});\nexport default MessageItem;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _map from \"lodash-es/map\";\nimport cx from 'clsx';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { childrenUtils, createShorthandFactory, customPropTypes, getElementType, getUnhandledProps } from '../../lib';\nimport MessageItem from './MessageItem';\n/**\n * A message can contain a list of items.\n */\n\nfunction MessageList(props) {\n var children = props.children,\n className = props.className,\n items = props.items;\n var classes = cx('list', className);\n var rest = getUnhandledProps(MessageList, props);\n var ElementType = getElementType(MessageList, props);\n return /*#__PURE__*/React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), childrenUtils.isNil(children) ? _map(items, MessageItem.create) : children);\n}\n\nMessageList.handledProps = [\"as\", \"children\", \"className\", \"items\"];\nMessageList.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: PropTypes.elementType,\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** Shorthand Message.Items. */\n items: customPropTypes.collectionShorthand\n} : {};\nMessageList.defaultProps = {\n as: 'ul'\n};\nMessageList.create = createShorthandFactory(MessageList, function (val) {\n return {\n items: val\n };\n});\nexport default MessageList;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport _without from \"lodash-es/without\";\nimport _isNil from \"lodash-es/isNil\";\nimport cx from 'clsx';\nimport PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport { childrenUtils, createHTMLParagraph, customPropTypes, getElementType, getUnhandledProps, SUI, useKeyOnly, useKeyOrValueAndKey } from '../../lib';\nimport Icon from '../../elements/Icon';\nimport MessageContent from './MessageContent';\nimport MessageHeader from './MessageHeader';\nimport MessageList from './MessageList';\nimport MessageItem from './MessageItem';\n/**\n * A message displays information that explains nearby content.\n * @see Form\n */\n\nvar Message = /*#__PURE__*/function (_Component) {\n _inheritsLoose(Message, _Component);\n\n function Message() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _Component.call.apply(_Component, [this].concat(args)) || this;\n\n _this.handleDismiss = function (e) {\n var onDismiss = _this.props.onDismiss;\n if (onDismiss) onDismiss(e, _this.props);\n };\n\n return _this;\n }\n\n var _proto = Message.prototype;\n\n _proto.render = function render() {\n var _this$props = this.props,\n attached = _this$props.attached,\n children = _this$props.children,\n className = _this$props.className,\n color = _this$props.color,\n compact = _this$props.compact,\n content = _this$props.content,\n error = _this$props.error,\n floating = _this$props.floating,\n header = _this$props.header,\n hidden = _this$props.hidden,\n icon = _this$props.icon,\n info = _this$props.info,\n list = _this$props.list,\n negative = _this$props.negative,\n onDismiss = _this$props.onDismiss,\n positive = _this$props.positive,\n size = _this$props.size,\n success = _this$props.success,\n visible = _this$props.visible,\n warning = _this$props.warning;\n var classes = cx('ui', color, size, useKeyOnly(compact, 'compact'), useKeyOnly(error, 'error'), useKeyOnly(floating, 'floating'), useKeyOnly(hidden, 'hidden'), useKeyOnly(icon, 'icon'), useKeyOnly(info, 'info'), useKeyOnly(negative, 'negative'), useKeyOnly(positive, 'positive'), useKeyOnly(success, 'success'), useKeyOnly(visible, 'visible'), useKeyOnly(warning, 'warning'), useKeyOrValueAndKey(attached, 'attached'), 'message', className);\n var dismissIcon = onDismiss && /*#__PURE__*/React.createElement(Icon, {\n name: \"close\",\n onClick: this.handleDismiss\n });\n var rest = getUnhandledProps(Message, this.props);\n var ElementType = getElementType(Message, this.props);\n\n if (!childrenUtils.isNil(children)) {\n return /*#__PURE__*/React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), dismissIcon, children);\n }\n\n return /*#__PURE__*/React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), dismissIcon, Icon.create(icon, {\n autoGenerateKey: false\n }), (!_isNil(header) || !_isNil(content) || !_isNil(list)) && /*#__PURE__*/React.createElement(MessageContent, null, MessageHeader.create(header, {\n autoGenerateKey: false\n }), MessageList.create(list, {\n autoGenerateKey: false\n }), createHTMLParagraph(content, {\n autoGenerateKey: false\n })));\n };\n\n return Message;\n}(Component);\n\nMessage.handledProps = [\"as\", \"attached\", \"children\", \"className\", \"color\", \"compact\", \"content\", \"error\", \"floating\", \"header\", \"hidden\", \"icon\", \"info\", \"list\", \"negative\", \"onDismiss\", \"positive\", \"size\", \"success\", \"visible\", \"warning\"];\nexport { Message as default };\nMessage.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /** An element type to render as (string or function). */\n as: PropTypes.elementType,\n\n /** A message can be formatted to attach itself to other content. */\n attached: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['bottom', 'top'])]),\n\n /** Primary content. */\n children: PropTypes.node,\n\n /** Additional classes. */\n className: PropTypes.string,\n\n /** A message can be formatted to be different colors. */\n color: PropTypes.oneOf(SUI.COLORS),\n\n /** A message can only take up the width of its content. */\n compact: PropTypes.bool,\n\n /** Shorthand for primary content. */\n content: customPropTypes.contentShorthand,\n\n /** A message may be formatted to display a negative message. Same as `negative`. */\n error: PropTypes.bool,\n\n /** A message can float above content that it is related to. */\n floating: PropTypes.bool,\n\n /** Shorthand for MessageHeader. */\n header: customPropTypes.itemShorthand,\n\n /** A message can be hidden. */\n hidden: PropTypes.bool,\n\n /** A message can contain an icon. */\n icon: PropTypes.oneOfType([customPropTypes.itemShorthand, PropTypes.bool]),\n\n /** A message may be formatted to display information. */\n info: PropTypes.bool,\n\n /** Array shorthand items for the MessageList. Mutually exclusive with children. */\n list: customPropTypes.collectionShorthand,\n\n /** A message may be formatted to display a negative message. Same as `error`. */\n negative: PropTypes.bool,\n\n /**\n * A message that the user can choose to hide.\n * Called when the user clicks the \"x\" icon. This also adds the \"x\" icon.\n *\n * @param {SyntheticEvent} event - React's original SyntheticEvent.\n * @param {object} data - All props.\n */\n onDismiss: PropTypes.func,\n\n /** A message may be formatted to display a positive message. Same as `success`. */\n positive: PropTypes.bool,\n\n /** A message can have different sizes. */\n size: PropTypes.oneOf(_without(SUI.SIZES, 'medium')),\n\n /** A message may be formatted to display a positive message. Same as `positive`. */\n success: PropTypes.bool,\n\n /** A message can be set to visible to force itself to be shown. */\n visible: PropTypes.bool,\n\n /** A message may be formatted to display warning messages. */\n warning: PropTypes.bool\n} : {};\nMessage.Content = MessageContent;\nMessage.Header = MessageHeader;\nMessage.List = MessageList;\nMessage.Item = MessageItem;","import React from 'react';\r\nimport {Message, Segment} from 'semantic-ui-react';\r\n\r\n\r\nconst NotFound = () => (\r\n \r\n \r\n);\r\n\r\nexport default NotFound;\r\n","import React, { Suspense } from \"react\";\r\nimport { usePageInit } from \"src/common/hooks\";\r\nimport { Loading } from \"src/components\";\r\n\r\nconst DocsandLinks = React.lazy(() => import(\"./DocsandLinks\"));\r\n\r\nfunction DocsandLinksWidget(props) {\r\n usePageInit(\"Smart Portal - Docs and Links\");\r\n return (\r\n \r\n }\r\n >\r\n \r\n \r\n );\r\n}\r\n\r\nexport default DocsandLinksWidget;\r\n","import React from \"react\";\r\nimport { Loading } from \"src/components\";\r\n\r\nfunction LoadingPage() {\r\n const asideMenu = document.getElementsByClassName(\"aside-menu\")[0];\r\n let menuWidth = 77;\r\n if (asideMenu)\r\n menuWidth =\r\n document.getElementsByClassName(\"aside-menu\")[0].offsetWidth || 77;\r\n return (\r\n
\r\n \r\n
\r\n );\r\n}\r\n\r\nexport default LoadingPage;\r\n","import React, { useEffect } from \"react\";\r\nimport { Route, Switch } from \"react-router-dom\";\r\nimport Approve from \"../Approve\";\r\nimport CTMInvoices from \"../CTMInvoices\";\r\nimport NotFound from \"./NotFound\";\r\nimport Dashboard from \"../Dashboard\";\r\nimport DocsAndLinks from \"../DocsAndLinks\";\r\nimport FareForecaster from \"../FareForecaster\";\r\nimport LoadingPage from \"../LoadingPage\";\r\nimport TravelerTracker from \"../TravelerTracker\";\r\nimport { scrollToTop } from \"src/common\";\r\n\r\nexport const TRAVELER_TRACKER_ROUTE = \"travelertracker\";\r\nexport const FARE_FORECASTER_ROUTE = \"fareforecaster\";\r\nexport const DOCS_AND_LINKS_ROUTE = \"docandlinktool\";\r\nexport const CTM_APPROVE_ROUTE = \"ctmapprove\";\r\nexport const CTM_INVOICES_ROUTE = \"ctminvoices\";\r\n\r\nexport const fullPages = {\r\n DOCS_AND_LINKS_ROUTE,\r\n TRAVELER_TRACKER_ROUTE,\r\n FARE_FORECASTER_ROUTE,\r\n CTM_APPROVE_ROUTE,\r\n CTM_INVOICES_ROUTE,\r\n};\r\n\r\nconst Routes = ({ loading, user, location }) => {\r\n let hasTT, hasFF, hasDL, hasApprove, hasCTMInvoices;\r\n if (user && user.state && user.state.features && user.state.features.length) {\r\n user.state.features.forEach((f) => {\r\n if (f.identifier === \"Elysium_Traveler_Tracker_Widget\") hasTT = true;\r\n if (f.identifier === \"Elysium_Fare_Forecaster_Widget\") hasFF = true;\r\n if (f.identifier === \"Elysium_Docs_And_Link\") hasDL = true;\r\n if (f.identifier === \"approve\") hasApprove = true;\r\n if (f.identifier === \"ctminvoices\") hasCTMInvoices = true;\r\n });\r\n }\r\n\r\n useEffect(() => {\r\n scrollToTop();\r\n }, [location.pathname, location.search]);\r\n\r\n return (\r\n \r\n \r\n\r\n {hasTT && (\r\n \r\n )}\r\n {hasFF && (\r\n \r\n )}\r\n {hasDL && (\r\n \r\n )}\r\n {hasApprove && (\r\n \r\n )}\r\n {hasCTMInvoices && (\r\n \r\n )}\r\n {loading ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n );\r\n};\r\n\r\nexport default Routes;\r\n","import React, { Suspense } from \"react\";\r\nimport { usePageInit } from \"src/common/hooks\";\r\nimport { useLightMode } from \"src/common/hooks/lightMode\";\r\nimport { Loading } from \"src/components\";\r\n\r\nconst TravelerTracker = React.lazy(() => import(\"./TravelerTracker\"));\r\n\r\nfunction TravelerTrackerPage(props) {\r\n usePageInit(\"Smart Portal - Traveler Tracker\");\r\n const { lightMode } = useLightMode();\r\n return (\r\n \r\n }\r\n >\r\n \r\n \r\n );\r\n}\r\n\r\nexport default TravelerTrackerPage;\r\n","import React, { Suspense } from \"react\";\r\nimport { usePageInit } from \"src/common/hooks\";\r\nimport { Loading } from \"src/components\";\r\n\r\nconst ApproveTwoFactor = React.lazy(() => import(\"./ApproveTwoFactor\"));\r\n\r\nfunction ApproveTwoFactorPage(props) {\r\n usePageInit(\"Smart Portal - Approve Two Factor\");\r\n return (\r\n \r\n }\r\n >\r\n \r\n \r\n );\r\n}\r\n\r\nexport default ApproveTwoFactorPage;\r\n","import React from \"react\";\r\nimport { useSafeSetState } from \"src/common/hooks\";\r\nimport { Icon, Loader } from \"semantic-ui-react\";\r\nimport { getToken } from \"src/common/apiClient\";\r\nimport { BASE_URL } from \"src/apiConfig\";\r\n\r\nconst initialState = {\r\n isLoaded: false,\r\n};\r\n\r\nfunction AgentChat({ agentChatHref, handleClose }) {\r\n const [{ isLoaded }, safeSetState] = useSafeSetState(initialState);\r\n\r\n const token = encodeURIComponent(getToken().token);\r\n const url = `${BASE_URL}${agentChatHref}?access_token=${token}`;\r\n\r\n function handleOnLoad() {\r\n // We want to delay the iframe opening for a few seconds because the agent chat site is slow to load and has no styling/background etc.\r\n setTimeout(() => safeSetState({ isLoaded: true }), 3000);\r\n }\r\n\r\n return (\r\n