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,qBAAAE,CAAsBkJ,GAGpB,OAFYA,EAAoBpW,QAErB,EACFoW,EAAoB,GAAGL,eAAiB,GAG1CK,EAAoB9S,KAAIiG,GAAKA,EAAEwM,gBAAe1O,KAAKK,KAAKkO,mBACjE,E","sources":["webpack://@iqx-web/libs/../../node_modules/@automapper/core/index.js"],"sourcesContent":["function normalizeNamingConventions(namingConventions) {\n if ('source' in namingConventions && 'destination' in namingConventions) {\n return [namingConventions.source, namingConventions.destination];\n }\n\n return [namingConventions, namingConventions];\n}\n\nconst STRATEGY = Symbol.for('__strategy__');\nconst MAPPINGS = Symbol.for('__mappings__');\nconst METADATA_MAP = Symbol.for('__metadata_map__');\nconst METADATA_OBJECT_MAP = Symbol.for('__metadata_object_map__');\nconst ERROR_HANDLER = Symbol.for('__error_handler__');\nconst NAMING_CONVENTIONS = Symbol.for('__naming_conventions__');\nconst RECURSIVE_DEPTH = Symbol.for('__recursive_depth__');\nconst RECURSIVE_COUNT = Symbol.for('__recursive_count__');\nconst PROFILE_CONFIGURATION_CONTEXT = Symbol.for('__profile_configuration_context__');\nconst CUSTOM_NODE_INSPECT = Symbol.for('nodejs.util.inspect.custom');\nfunction getErrorHandler(mapper) {\n return mapper[ERROR_HANDLER];\n}\nfunction getMappings(mapper) {\n return mapper[MAPPINGS];\n}\nfunction getMetadataMap(mapper) {\n return mapper[METADATA_MAP];\n}\nfunction getMetadataObjectMap(mapper) {\n return mapper[METADATA_OBJECT_MAP];\n}\nfunction getNamingConventions(mapper) {\n const namingConventions = mapper[NAMING_CONVENTIONS];\n if (!namingConventions) return undefined;\n return normalizeNamingConventions(namingConventions);\n}\nfunction getRecursiveDepth(mapper) {\n return mapper[RECURSIVE_DEPTH];\n}\nfunction getRecursiveCount(mapper) {\n return mapper[RECURSIVE_COUNT];\n}\nfunction getStrategy(mapper) {\n return mapper[STRATEGY];\n}\nfunction getProfileConfigurationContext(mapper) {\n return mapper[PROFILE_CONFIGURATION_CONTEXT];\n}\n\n/**\r\n * Depends on implementation of strategy.createMapping\r\n */\nfunction assertUnmappedProperties(destinationObject, destinationMetadata, configuredKeys, sourceIdentifier, destinationIdentifier, errorHandler) {\n var _a, _b;\n\n const unmappedKeys = Object.keys(destinationMetadata).reduce((result, key) => {\n var _a;\n\n const isOnDestination = (key in destinationObject);\n const isAlreadyConfigured = configuredKeys.some(configuredKey => configuredKey === key);\n const isWritable = ((_a = Object.getOwnPropertyDescriptor(destinationMetadata, key)) === null || _a === void 0 ? void 0 : _a.writable) === true;\n\n if (!isAlreadyConfigured && !isOnDestination && isWritable && destinationObject[key] === undefined) {\n result.push(key);\n }\n\n return result;\n }, []);\n\n if (unmappedKeys.length) {\n const parentInfo = `${(_a = sourceIdentifier['name']) !== null && _a !== void 0 ? _a : sourceIdentifier} -> ${(_b = destinationIdentifier['name']) !== null && _b !== void 0 ? _b : destinationIdentifier}`;\n errorHandler.handle(`\nUnmapped properties for ${parentInfo}:\n-------------------\n${unmappedKeys.join(',\\n')}\n`);\n }\n}\n\nfunction get(object, path = []) {\n if (!path.length) {\n return;\n }\n\n let index;\n const length = path.length;\n\n for (index = 0; index < length && object != null; index++) {\n object = object[path[index]];\n }\n\n return index && index == length ? object : undefined;\n}\n\nfunction getMapping(mapper, source, destination, allowNull = false) {\n var _a; // turn string into symbol for identifier\n\n\n const sourceIdentifier = typeof source === 'string' ? Symbol.for(source) : source;\n const destinationIdentifier = typeof destination === 'string' ? Symbol.for(destination) : destination;\n const mapping = (_a = getMappings(mapper).get(sourceIdentifier)) === null || _a === void 0 ? void 0 : _a.get(destinationIdentifier);\n\n if (mapping == null && !allowNull) {\n const errorHandler = getErrorHandler(mapper);\n const errorMessage = `Mapping is not found for ${String(source)} and ${String(destination)}`;\n errorHandler.handle(errorMessage);\n throw new Error(errorMessage);\n }\n\n return mapping;\n}\n\n/**\r\n * Check if value is a Date constructor\r\n *\r\n * @param {Function} value\r\n */\nfunction isDateConstructor(value) {\n return Object.getPrototypeOf(value) === Date || value === Date;\n}\n\nfunction isEmpty(value) {\n if (Array.isArray(value)) {\n return !value.length;\n }\n\n if (typeof value !== 'object' && typeof value !== 'function') {\n return !value;\n }\n\n return !Object.keys(value).length;\n}\n\nfunction isPrimitiveArrayEqual(a, b) {\n if (a.length !== b.length) return false;\n return a.every((itemA, index) => b[index] === itemA);\n}\n\n/**\r\n * Check if value is a String/Number/Boolean/Array constructor\r\n *\r\n * @param {Function} value\r\n */\nfunction isPrimitiveConstructor(value) {\n // constructor/function passed in is undefined/null, we fall back to primitive\n if (value == null) return true;\n const proto = Object.getPrototypeOf(value);\n return proto === String || proto === Number || proto === Boolean || value === String || value === Number || value === Boolean;\n}\n\nfunction set(object, path, value) {\n const {\n decomposedPath,\n base\n } = decomposePath(path);\n\n if (base === undefined) {\n return object;\n } // assign an empty object in order to spread object\n\n\n assignEmpty(object, base); // Determine if there is still layers to traverse\n\n value = decomposedPath.length <= 1 ? value : set(object[base], decomposedPath.slice(1), value);\n return Object.assign(object, {\n [base]: value\n });\n}\nfunction setMutate(object, path, value) {\n const {\n decomposedPath,\n base\n } = decomposePath(path);\n\n if (base === undefined) {\n return;\n } // assign an empty object in order to spread object\n\n\n assignEmpty(object, base); // Determine if there is still layers to traverse\n\n if (decomposedPath.length <= 1) {\n object[base] = value;\n } else {\n setMutate(object[base], decomposedPath.slice(1), value);\n }\n}\n\nfunction decomposePath(path) {\n if (path.length < 1) {\n return {\n base: '',\n decomposedPath: []\n };\n }\n\n const decomposedPath = path;\n const base = path[0];\n return {\n base,\n decomposedPath\n };\n}\n\nfunction assignEmpty(obj, base) {\n if (!obj.hasOwnProperty(base)) {\n obj[base] = {};\n }\n}\n\nfunction mapMember(transformationMapFn, sourceObject, destinationObject, destinationMemberPath, extraArgs, mapper, sourceMemberIdentifier, destinationMemberIdentifier) {\n let value;\n const transformationType = transformationMapFn[0\n /* MapFnClassId.type */\n ];\n const mapFn = transformationMapFn[1\n /* MapFnClassId.fn */\n ];\n const shouldRunImplicitMap = !(isPrimitiveConstructor(sourceMemberIdentifier) || isPrimitiveConstructor(destinationMemberIdentifier) || isDateConstructor(sourceMemberIdentifier) || isDateConstructor(destinationMemberIdentifier));\n\n switch (transformationType) {\n case 1\n /* TransformationType.MapFrom */\n :\n value = mapFn(sourceObject);\n break;\n\n case 3\n /* TransformationType.FromValue */\n :\n value = mapFn();\n break;\n\n case 4\n /* TransformationType.MapWith */\n :\n value = mapFn(sourceObject, mapper);\n break;\n\n case 5\n /* TransformationType.ConvertUsing */\n :\n value = mapFn(sourceObject);\n break;\n\n case 2\n /* TransformationType.Condition */\n :\n case 7\n /* TransformationType.NullSubstitution */\n :\n case 8\n /* TransformationType.UndefinedSubstitution */\n :\n value = mapFn(sourceObject, destinationMemberPath);\n\n if (shouldRunImplicitMap && value != null) {\n value = Array.isArray(value) ? mapper.mapArray(value, sourceMemberIdentifier, destinationMemberIdentifier) : mapper.map(value, sourceMemberIdentifier, destinationMemberIdentifier);\n }\n\n break;\n\n case 9\n /* TransformationType.MapWithArguments */\n :\n value = mapFn(sourceObject, extraArgs || {});\n break;\n\n case 10\n /* TransformationType.MapDefer */\n :\n value = mapMember(mapFn(sourceObject), sourceObject, destinationObject, destinationMemberPath, extraArgs, mapper, sourceMemberIdentifier, destinationMemberIdentifier);\n break;\n }\n\n return value;\n}\n\nfunction setMemberReturnFn(destinationMemberPath, destination) {\n return value => {\n if (destination) {\n destination = set(destination, destinationMemberPath, value);\n }\n };\n}\n\nfunction mapReturn(mapping, sourceObject, options, isMapArray = false) {\n return map({\n mapping,\n sourceObject,\n options,\n setMemberFn: setMemberReturnFn,\n isMapArray\n });\n}\n\nfunction setMemberMutateFn(destinationObj) {\n return destinationMember => value => {\n if (value !== undefined) {\n setMutate(destinationObj, destinationMember, value);\n }\n };\n}\n\nfunction getMemberMutateFn(destinationObj) {\n return memberPath => get(destinationObj, memberPath);\n}\n\nfunction mapMutate(mapping, sourceObject, destinationObj, options, isMapArray = false) {\n map({\n sourceObject,\n mapping,\n setMemberFn: setMemberMutateFn(destinationObj),\n getMemberFn: getMemberMutateFn(destinationObj),\n options,\n isMapArray\n });\n}\nfunction map({\n mapping,\n sourceObject,\n options,\n setMemberFn,\n getMemberFn,\n isMapArray = false\n}) {\n // destructure mapping\n const [[sourceIdentifier, destinationIdentifier], [, destinationWithMetadata], propsToMap, mapper, destinationConstructor,, [mappingBeforeCallback, mappingAfterCallback] = []] = mapping; // deconstruct MapOptions\n\n const {\n beforeMap: mapBeforeCallback,\n afterMap: mapAfterCallback,\n destinationConstructor: mapDestinationConstructor = destinationConstructor,\n extraArgs\n } = options !== null && options !== void 0 ? options : {};\n const errorHandler = getErrorHandler(mapper);\n const metadataMap = getMetadataMap(mapper);\n const destination = mapDestinationConstructor(sourceObject, destinationIdentifier); // initialize an array of keys that have already been configured\n\n const configuredKeys = [];\n\n if (!isMapArray) {\n const beforeMap = mapBeforeCallback !== null && mapBeforeCallback !== void 0 ? mapBeforeCallback : mappingBeforeCallback;\n\n if (beforeMap) {\n beforeMap(sourceObject, destination);\n }\n } // map\n\n\n for (let i = 0, length = propsToMap.length; i < length; i++) {\n // destructure mapping property\n const [destinationMemberPath, [, [transformationMapFn, [transformationPreConditionPredicate, transformationPreConditionDefaultValue = undefined] = []]], [destinationMemberIdentifier, sourceMemberIdentifier] = []] = propsToMap[i];\n let hasSameIdentifier = !isPrimitiveConstructor(destinationMemberIdentifier) && !isDateConstructor(destinationMemberIdentifier) && !isPrimitiveConstructor(sourceMemberIdentifier) && !isDateConstructor(sourceMemberIdentifier) && sourceMemberIdentifier === destinationMemberIdentifier;\n\n if (hasSameIdentifier) {\n // at this point, we have a same identifier that aren't primitive or date\n // we then check if there is a mapping created for this identifier\n hasSameIdentifier = !getMapping(mapper, sourceMemberIdentifier, destinationMemberIdentifier, true);\n } // Setup a shortcut function to set destinationMemberPath on destination with value as argument\n\n\n const setMember = valFn => {\n var _a, _b;\n\n try {\n return setMemberFn(destinationMemberPath, destination)(valFn());\n } catch (originalError) {\n const errorMessage = `\nError at \"${destinationMemberPath}\" on ${((_b = (_a = destinationIdentifier['prototype']) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.name) || destinationIdentifier} (${JSON.stringify(destination)})\n---------------------------------------------------------------------\nOriginal error: ${originalError}`;\n errorHandler.handle(errorMessage);\n throw new Error(errorMessage);\n }\n }; // This destination key is being configured. Push to configuredKeys array\n\n\n configuredKeys.push(destinationMemberPath[0]); // Pre Condition check\n\n if (transformationPreConditionPredicate && !transformationPreConditionPredicate(sourceObject)) {\n setMember(() => transformationPreConditionDefaultValue);\n continue;\n } // Start with all the mapInitialize\n\n\n if (transformationMapFn[0\n /* MapFnClassId.type */\n ] === 6\n /* TransformationType.MapInitialize */\n ) {\n // check if metadata as destinationMemberPath is null\n const destinationMetadata = metadataMap.get(destinationIdentifier);\n const hasNullMetadata = destinationMetadata && destinationMetadata.find(metadata => isPrimitiveArrayEqual(metadata[0\n /* MetadataClassId.propertyKeys */\n ], destinationMemberPath)) === null;\n const mapInitializedValue = transformationMapFn[1\n /* MapFnClassId.fn */\n ](sourceObject);\n const isTypedConverted = transformationMapFn[2\n /* MapFnClassId.isConverted */\n ]; // if null/undefined\n // if isDate, isFile\n // if metadata is null, treat as-is\n // if has same identifier that are not primitives or Date\n // if the initialized value was converted with typeConverter\n\n if (mapInitializedValue == null || mapInitializedValue instanceof Date || Object.prototype.toString.call(mapInitializedValue).slice(8, -1) === 'File' || hasNullMetadata || hasSameIdentifier || isTypedConverted) {\n setMember(() => mapInitializedValue);\n continue;\n } // if isArray\n\n\n if (Array.isArray(mapInitializedValue)) {\n const [first] = mapInitializedValue; // if first item is a primitive\n\n if (typeof first !== 'object' || first instanceof Date || Object.prototype.toString.call(first).slice(8, -1) === 'File') {\n setMember(() => mapInitializedValue.slice());\n continue;\n } // if first is empty\n\n\n if (isEmpty(first)) {\n setMember(() => []);\n continue;\n }\n\n setMember(() => mapInitializedValue.map(each => mapReturn(getMapping(mapper, sourceMemberIdentifier, destinationMemberIdentifier), each, {\n extraArgs\n })));\n continue;\n }\n\n if (typeof mapInitializedValue === 'object') {\n const nestedMapping = getMapping(mapper, sourceMemberIdentifier, destinationMemberIdentifier); // nested mutate\n\n if (getMemberFn) {\n const memberValue = getMemberFn(destinationMemberPath);\n\n if (memberValue !== undefined) {\n map({\n sourceObject: mapInitializedValue,\n mapping: nestedMapping,\n options: {\n extraArgs\n },\n setMemberFn: setMemberMutateFn(memberValue),\n getMemberFn: getMemberMutateFn(memberValue)\n });\n }\n\n continue;\n }\n\n setMember(() => map({\n mapping: nestedMapping,\n sourceObject: mapInitializedValue,\n options: {\n extraArgs\n },\n setMemberFn: setMemberReturnFn\n }));\n continue;\n } // if is primitive\n\n\n setMember(() => mapInitializedValue);\n continue;\n }\n\n setMember(() => mapMember(transformationMapFn, sourceObject, destination, destinationMemberPath, extraArgs === null || extraArgs === void 0 ? void 0 : extraArgs(mapping, destination), mapper, sourceMemberIdentifier, destinationMemberIdentifier));\n }\n\n if (!isMapArray) {\n const afterMap = mapAfterCallback !== null && mapAfterCallback !== void 0 ? mapAfterCallback : mappingAfterCallback;\n\n if (afterMap) {\n afterMap(sourceObject, destination);\n }\n } // Check unmapped properties\n\n\n assertUnmappedProperties(destination, destinationWithMetadata, configuredKeys, sourceIdentifier, destinationIdentifier, errorHandler);\n return destination;\n}\n\nclass AutoMapperLogger {\n static configure(customLogger = {}) {\n if (this.configured) return;\n this.configured = true;\n Object.entries(customLogger).forEach(([logLevel, logImpl]) => {\n if (logImpl !== undefined) {\n this[logLevel] = logImpl;\n }\n });\n }\n\n static log(message) {\n console.log.bind(console, this.AUTOMAPPER_PREFIX, message);\n }\n\n static warn(warning) {\n console.warn.bind(console, this.AUTOMAPPER_PREFIX, warning);\n }\n\n static error(error) {\n console.error.bind(console, this.AUTOMAPPER_PREFIX, error);\n }\n\n static info(info) {\n console.info.bind(console, this.AUTOMAPPER_PREFIX, info);\n }\n\n}\nAutoMapperLogger.AUTOMAPPER_PREFIX = '[AutoMapper]: ';\nAutoMapperLogger.configured = false;\n\n/**\r\n * Creates and returns a Mapper {} as a Proxy. The following methods are available to use with a Mapper:\r\n * ```\r\n * - Mapper#map(Array)(Async), Mapper#mutate(Array)(Async)\r\n * - createMap()\r\n * - addProfile()\r\n * - getMapping()\r\n * - getMappings()\r\n * ```\r\n * @param {CreateMapperOptions} options\r\n */\n\nfunction createMapper({\n strategyInitializer,\n errorHandler,\n namingConventions\n}) {\n let strategy; // this mapper is responsible for all mappings\n\n let mappings; // this mapper is responsible for all metadata\n\n let metadataMap;\n let metadataObjectMap; // this mapper is responsible for recursive depths and counts\n\n let recursiveDepth;\n let recursiveCount; // this mapper is tracking some context about the MappingProfile\n\n let profileConfigurationContext;\n\n function getOptions(sourceIdentifier, destinationIdentifierOrOptions, options) {\n if (destinationIdentifierOrOptions && options) {\n return {\n destinationIdentifier: destinationIdentifierOrOptions,\n mapOptions: options\n };\n }\n\n let destinationIdentifier = sourceIdentifier;\n\n if (destinationIdentifierOrOptions && !options) {\n const typeofDestinationOrOptions = typeof destinationIdentifierOrOptions;\n\n if (typeofDestinationOrOptions === 'string' || typeofDestinationOrOptions === 'function') {\n destinationIdentifier = destinationIdentifierOrOptions;\n } else {\n options = destinationIdentifierOrOptions;\n }\n }\n\n return {\n destinationIdentifier,\n mapOptions: options\n };\n } // return the Proxy\n\n\n return new Proxy({\n [CUSTOM_NODE_INSPECT]() {\n return `\nMapper {} is an empty Object as a Proxy. The following methods are available to use with a Mapper:\n- Mapper#map(Array)(Async), Mapper#mutate(Array)(Async)\n- createMap()\n- addProfile()\n- getMapping()\n- getMappings()\n `;\n }\n\n }, {\n get(target, p, receiver) {\n if (p === STRATEGY) {\n if (!strategy) {\n strategy = strategyInitializer(receiver);\n }\n\n return strategy;\n }\n\n if (p === PROFILE_CONFIGURATION_CONTEXT) {\n if (!profileConfigurationContext) {\n profileConfigurationContext = new Set();\n }\n\n return profileConfigurationContext;\n }\n\n if (p === MAPPINGS) {\n if (!mappings) {\n mappings = new Map();\n }\n\n return mappings;\n }\n\n if (p === METADATA_MAP) {\n if (!metadataMap) {\n metadataMap = new Map();\n }\n\n return metadataMap;\n }\n\n if (p === METADATA_OBJECT_MAP) {\n if (!metadataObjectMap) {\n metadataObjectMap = new Map();\n }\n\n return metadataObjectMap;\n }\n\n if (p === ERROR_HANDLER) {\n if (!errorHandler) {\n errorHandler = {\n handle: AutoMapperLogger.error ? AutoMapperLogger.error.bind(AutoMapperLogger) : // eslint-disable-next-line @typescript-eslint/no-empty-function\n () => {}\n };\n }\n\n return errorHandler;\n }\n\n if (p === NAMING_CONVENTIONS) {\n return namingConventions;\n }\n\n if (p === RECURSIVE_DEPTH) {\n if (!recursiveDepth) {\n recursiveDepth = new Map();\n }\n\n return recursiveDepth;\n }\n\n if (p === RECURSIVE_COUNT) {\n if (!recursiveCount) {\n recursiveCount = new Map();\n }\n\n return recursiveCount;\n }\n\n if (p === 'dispose') {\n return () => {\n mappings === null || mappings === void 0 ? void 0 : mappings.clear(); // TODO: why can metadata not be clear?\n // metadata?.clear();\n\n metadataObjectMap === null || metadataObjectMap === void 0 ? void 0 : metadataObjectMap.clear();\n recursiveDepth === null || recursiveDepth === void 0 ? void 0 : recursiveDepth.clear();\n recursiveCount === null || recursiveCount === void 0 ? void 0 : recursiveCount.clear();\n profileConfigurationContext === null || profileConfigurationContext === void 0 ? void 0 : profileConfigurationContext.clear();\n };\n }\n\n if (p === 'map') {\n return (sourceObject, sourceIdentifier, destinationIdentifierOrOptions, options) => {\n if (sourceObject == null) return sourceObject;\n const {\n destinationIdentifier,\n mapOptions\n } = getOptions(sourceIdentifier, destinationIdentifierOrOptions, options);\n const mapping = getMapping(receiver, sourceIdentifier, destinationIdentifier);\n sourceObject = strategy.preMap(sourceObject, mapping);\n const destination = mapReturn(mapping, sourceObject, mapOptions || {});\n return strategy.postMap(sourceObject, // seal destination so that consumers cannot add properties to it\n // or change the property descriptors. but they can still modify it\n // the ideal behavior is seal but the consumers might need to add/modify the object after map finishes\n destination, mapping);\n };\n }\n\n if (p === 'mapAsync') {\n return (sourceObject, sourceIdentifier, destinationIdentifierOrOptions, options) => {\n const result = receiver['map'](sourceObject, sourceIdentifier, destinationIdentifierOrOptions, options);\n return new Promise(res => {\n setTimeout(res, 0, result);\n });\n };\n }\n\n if (p === 'mapArray') {\n return (sourceArray, sourceIdentifier, destinationIdentifierOrOptions, options) => {\n if (!sourceArray.length) return [];\n const {\n destinationIdentifier,\n mapOptions\n } = getOptions(sourceIdentifier, destinationIdentifierOrOptions, options);\n const mapping = getMapping(receiver, sourceIdentifier, destinationIdentifier);\n const {\n beforeMap,\n afterMap,\n extraArgs\n } = mapOptions || {};\n\n if (beforeMap) {\n beforeMap(sourceArray, []);\n }\n\n const destinationArray = [];\n\n for (let i = 0, length = sourceArray.length; i < length; i++) {\n let sourceObject = sourceArray[i];\n sourceObject = strategy.preMap(sourceObject, mapping);\n const destination = mapReturn(mapping, sourceObject, {\n extraArgs: extraArgs\n }, true);\n destinationArray.push(strategy.postMap(sourceObject, // seal destination so that consumers cannot add properties to it\n // or change the property descriptors. but they can still modify it\n // the ideal behavior is seal but the consumers might need to add/modify the object after map finishes\n destination, mapping));\n }\n\n if (afterMap) {\n afterMap(sourceArray, destinationArray);\n }\n\n return destinationArray;\n };\n }\n\n if (p === 'mapArrayAsync') {\n return (sourceArray, sourceIdentifier, destinationIdentifierOrOptions, options) => {\n const result = receiver['mapArray'](sourceArray, sourceIdentifier, destinationIdentifierOrOptions, options);\n return new Promise(res => {\n setTimeout(res, 0, result);\n });\n };\n }\n\n if (p === 'mutate') {\n return (sourceObject, destinationObject, sourceIdentifier, destinationIdentifierOrOptions, options) => {\n if (sourceObject == null) return;\n const {\n destinationIdentifier,\n mapOptions\n } = getOptions(sourceIdentifier, destinationIdentifierOrOptions, options);\n const mapping = getMapping(receiver, sourceIdentifier, destinationIdentifier);\n sourceObject = strategy.preMap(sourceObject, mapping);\n mapMutate(mapping, sourceObject, destinationObject, mapOptions || {});\n strategy.postMap(sourceObject, destinationObject, mapping);\n };\n }\n\n if (p === 'mutateAsync') {\n return (sourceObject, destinationObject, sourceIdentifier, destinationIdentifierOrOptions, options) => {\n return new Promise(res => {\n receiver['mutate'](sourceObject, destinationObject, sourceIdentifier, destinationIdentifierOrOptions, options);\n setTimeout(res);\n });\n };\n }\n\n if (p === 'mutateArray') {\n return (sourceArray, destinationArray, sourceIdentifier, destinationIdentifierOrOptions, options) => {\n if (!sourceArray.length) return;\n const {\n destinationIdentifier,\n mapOptions\n } = getOptions(sourceIdentifier, destinationIdentifierOrOptions, options);\n const mapping = getMapping(receiver, sourceIdentifier, destinationIdentifier);\n const {\n beforeMap,\n afterMap,\n extraArgs\n } = mapOptions || {};\n\n if (beforeMap) {\n beforeMap(sourceArray, destinationArray);\n }\n\n for (let i = 0, length = sourceArray.length; i < length; i++) {\n let sourceObject = sourceArray[i];\n sourceObject = strategy.preMap(sourceObject, mapping);\n mapMutate(mapping, sourceObject, destinationArray[i] || {}, {\n extraArgs: extraArgs\n }, true);\n strategy.postMap(sourceObject, destinationArray[i], mapping);\n }\n\n if (afterMap) {\n afterMap(sourceArray, destinationArray);\n }\n };\n }\n\n if (p === 'mutateArrayAsync') {\n return (sourceArray, destinationArray, sourceIdentifier, destinationIdentifierOrOptions, options) => {\n return new Promise(res => {\n receiver['mutateArray'](sourceArray, destinationArray, sourceIdentifier, destinationIdentifierOrOptions, options);\n setTimeout(res);\n });\n };\n }\n\n return Reflect.get(target, p, receiver);\n }\n\n });\n}\n\nconst RECURSIVE_DATA = Symbol('__recursive_data__');\nfunction getRecursiveValue(recursiveMap, parent, member) {\n const parentValue = recursiveMap.get(parent);\n return parentValue ? arrayMapGet(parentValue, member) : undefined;\n}\nfunction setRecursiveValue(recursiveMap, parent, member, value) {\n if (!recursiveMap.has(parent)) {\n recursiveMap.set(parent, arrayMapSet(new Map(), member, value));\n return;\n }\n\n const parentValue = recursiveMap.get(parent);\n if (arrayMapHas(parentValue, member)) return;\n arrayMapSet(parentValue, member, value);\n}\n\nfunction arrayMapSet(root, path, value) {\n let map = root;\n\n for (const item of path) {\n let nextMap = map.get(item);\n\n if (!nextMap) {\n // Create next map if none exists\n nextMap = new Map();\n map.set(item, nextMap);\n }\n\n map = nextMap;\n } // Reached end of path. Set the data symbol to the given value\n\n\n map.set(RECURSIVE_DATA, value);\n return root;\n}\n\nfunction arrayMapHas(root, path) {\n let map = root;\n\n for (const item of path) {\n const nextMap = map.get(item);\n\n if (nextMap) {\n map = nextMap;\n } else {\n return false;\n }\n }\n\n return map.has(RECURSIVE_DATA);\n}\n\nfunction arrayMapGet(root, path) {\n let map = root;\n\n for (const item of path) {\n map = map.get(item);\n if (!map) return undefined;\n }\n\n return map.get(RECURSIVE_DATA);\n}\n\nfunction defaultApplyMetadata(strategy) {\n const mapper = strategy.mapper;\n const metadataMap = getMetadataMap(mapper);\n const metadataObjectMap = getMetadataObjectMap(mapper);\n const recursiveCountMap = getRecursiveCount(mapper);\n const recursiveDepthMap = getRecursiveDepth(mapper);\n\n function applyMetadata(model, as, root = true, selfReference = false) {\n var _a; // get the metadata of the model\n\n\n const metadata = metadataMap.get(model); // instantiate a model\n\n const instance = {}; // if metadata is empty, return the instance early\n\n if (isEmpty(metadata) || !metadata) {\n return instance;\n } // walking the metadata\n\n\n for (let i = 0, length = metadata.length; i < length; i++) {\n // destructure the metadata\n const key = metadata[i][0\n /* MetadataClassId.propertyKeys */\n ];\n const metaFn = metadata[i][1\n /* MetadataClassId.metaFn */\n ];\n const isArray = metadata[i][2\n /* MetadataClassId.isArray */\n ];\n /**\r\n * in V8, AutoMapper does not instantiate a new model on applying metadata anymore.\r\n * Hence, isGetterOnly seems to be obsolete.\r\n */\n\n const isGetterOnly = metadata[i][3\n /* MetadataClassId.isGetterOnly */\n ]; // skip getter if is applying metadata to a destination (because we will be setting data\n // on the destination. Getter only cannot be set\n\n if (isGetterOnly && as === 1\n /* MetadataObjectMapClassId.asDestination */\n ) {\n continue;\n } // call the meta fn to get the metaResult of the current key\n\n\n const metaResult = metaFn(); // if the metadata is an Array, then assign an empty array\n\n if (isArray) {\n setMutate(instance, key, []);\n continue;\n } // if is String, Number, Boolean\n // null meta means this has any type or an arbitrary object, treat as primitives\n\n\n if (isPrimitiveConstructor(metaResult) || metaResult === null) {\n setMutate(instance, key, undefined);\n continue;\n } // if is Date, assign a new Date value if valueAtKey is defined, otherwise, undefined\n\n\n if (isDateConstructor(metaResult)) {\n setMutate(instance, key, new Date());\n continue;\n } // get depth and count of the current key on the current model\n // Eg: Foo {bar: Bar}, model here is Foo and key is bar\n\n\n const depth = getRecursiveValue(recursiveDepthMap, model, key);\n const count = getRecursiveValue(recursiveCountMap, model, key) || 0; // if no depth, just instantiate with new keyword without recursive\n\n if (depth === 0) {\n setMutate(instance, key, {});\n continue;\n } // if depth equals count, meaning instantiate has run enough loop.\n // reset the count then assign with new keyword\n\n\n if (depth === count) {\n if (root || !selfReference) {\n setRecursiveValue(recursiveCountMap, model, key, 0);\n }\n\n setMutate(instance, key, {});\n continue;\n } // increment the count and recursively call instantiate\n\n\n setRecursiveValue(recursiveCountMap, model, key, count + 1);\n const childMetadataObjectMap = metadataObjectMap.get(metaResult);\n const childMetadata = (childMetadataObjectMap === null || childMetadataObjectMap === void 0 ? void 0 : childMetadataObjectMap[as]) || applyMetadata(metaResult, as, false, metaResult === model);\n setMutate(instance, key, childMetadata);\n } // after all, resetAllCount on the current model\n\n\n if (root || !selfReference) {\n (_a = recursiveCountMap.get(model)) === null || _a === void 0 ? void 0 : _a.clear();\n }\n\n return instance;\n }\n\n return applyMetadata;\n}\n\nconst defaultStrategyInitializerOptions = {\n applyMetadata: defaultApplyMetadata,\n\n preMap(source) {\n return source;\n },\n\n postMap(_, destination) {\n return destination;\n }\n\n};\n\nfunction isDefined(value, strict = false) {\n return strict ? value !== undefined : value != null;\n}\n\nfunction storeMetadata(mapper, model, metadataList) {\n if (!isDefined(metadataList)) return;\n const metadataMap = getMetadataMap(mapper);\n if (metadataMap.has(model)) return;\n\n for (const [propertyKey, {\n isGetterOnly,\n type,\n depth,\n isArray\n }] of metadataList) {\n metadataMap.set(model, [...(metadataMap.get(model) || []), [[propertyKey], type, isArray, isGetterOnly]]);\n\n if (depth != null) {\n setRecursiveValue(getRecursiveDepth(mapper), model, [propertyKey], depth);\n }\n }\n}\n\nfunction mapInitialize(sourcePath) {\n return [6\n /* TransformationType.MapInitialize */\n , source => get(source, sourcePath)];\n}\n\nfunction getPath(path, [sourceNamingConvention, destinationNamingConvention]) {\n const keyParts = path.map(s => s.split(destinationNamingConvention.splittingExpression).filter(Boolean)).filter(p => p.length > 0);\n return !keyParts.length ? path : keyParts.map(p => sourceNamingConvention.transformPropertyName(p));\n}\nfunction getFlatteningPaths(src, srcPath, namingConventions) {\n const [sourceNamingConvention] = namingConventions;\n const splitSourcePaths = [].concat(...srcPath.map(s => s.split(sourceNamingConvention.splittingExpression).filter(Boolean)));\n const [first, ...paths] = splitSourcePaths.slice(0, splitSourcePaths.length - 1);\n let trueFirstPartOfSource = first;\n let stopIndex = 0;\n let found = hasProperty(src, trueFirstPartOfSource);\n\n if (!found) {\n for (let i = 0, len = paths.length; i < len; i++) {\n trueFirstPartOfSource = sourceNamingConvention.transformPropertyName([trueFirstPartOfSource, paths[i]]);\n\n if (hasProperty(src, trueFirstPartOfSource)) {\n stopIndex = i + 1;\n found = true;\n break;\n }\n }\n }\n\n if (!found) {\n return srcPath;\n }\n\n const restPaths = splitSourcePaths.slice(stopIndex + 1, splitSourcePaths.length + 1);\n const transformedRestPaths = sourceNamingConvention.transformPropertyName(restPaths);\n\n if (restPaths.length > 1 && !hasProperty(src[trueFirstPartOfSource], transformedRestPaths) && hasProperty(src[trueFirstPartOfSource], sourceNamingConvention.transformPropertyName([restPaths[0]]))) {\n // still has more flattening to do: eg: bookAuthorName -> ['Author', 'Name']\n // transformedRestPaths (authorName) does not exist on source\n // first of rest paths (author) does exist on source\n return [trueFirstPartOfSource, ...getFlatteningPaths(src[trueFirstPartOfSource], getPath([transformedRestPaths], namingConventions), namingConventions)];\n }\n\n return [trueFirstPartOfSource, sourceNamingConvention.transformPropertyName(splitSourcePaths.slice(stopIndex + 1, splitSourcePaths.length + 1))];\n}\n\nfunction hasProperty(obj, property) {\n return Object.prototype.hasOwnProperty.call(obj, property);\n}\n\nfunction isSamePath(target, value) {\n if (target.length !== value.length) {\n return false;\n }\n\n for (let i = 0, targetLen = target.length; i < targetLen; i++) {\n if (target[i] !== value[i]) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction uniquePaths(paths) {\n const result = [];\n\n for (let i = 0, pathsLen = paths.length; i < pathsLen; i++) {\n const value = paths[i];\n\n if (!result.some(item => isSamePath(item, value))) {\n result.push(value);\n }\n }\n\n return result;\n}\n\nconst EXCLUDE_KEYS = ['constructor', '__defineGetter__', '__defineSetter__', 'hasOwnProperty', '__lookupGetter__', '__lookupSetter__', 'isPrototypeOf', 'propertyIsEnumerable', 'toString', 'valueOf', '__proto__', 'toLocaleString'];\nfunction getPathRecursive(node, prefix = [], previous = []) {\n const result = previous;\n let hasChildPaths = false;\n const keys = Array.from(new Set([...Object.getOwnPropertyNames(node)].filter(key => !EXCLUDE_KEYS.includes(key))));\n\n for (let i = 0, len = keys.length; i < len; i++) {\n const key = keys[i];\n const path = [...prefix, key];\n const child = node[key];\n\n if (typeof child === 'function') {\n continue;\n }\n\n result.push(path);\n\n if (typeof child === 'object') {\n const queue = Array.isArray(child) ? child : [child];\n\n for (const childNode of queue) {\n const childPaths = getPathRecursive(childNode, path);\n\n if (childPaths) {\n hasChildPaths = true;\n result.push(...childPaths);\n }\n }\n }\n }\n\n if (hasChildPaths) {\n return uniquePaths(result);\n }\n\n return result;\n}\n\nfunction createInitialMapping(mapper, source, destination, configurations = []) {\n const strategy = getStrategy(mapper);\n const applyMetadataFn = strategy.applyMetadata.bind(strategy);\n const destinationConstructor = strategy.destinationConstructor.bind(strategy);\n const metadataObjectMap = getMetadataObjectMap(mapper);\n const sourceMetadataObjectMap = metadataObjectMap.get(source);\n const destinationMetadataObjectMap = metadataObjectMap.get(destination);\n const destinationObject = (destinationMetadataObjectMap === null || destinationMetadataObjectMap === void 0 ? void 0 : destinationMetadataObjectMap[1\n /* MetadataObjectMapClassId.asDestination */\n ]) || applyMetadataFn(destination, 1\n /* MetadataObjectMapClassId.asDestination */\n );\n\n if (destinationMetadataObjectMap) {\n destinationMetadataObjectMap[1\n /* MetadataObjectMapClassId.asDestination */\n ] = destinationObject;\n } else {\n metadataObjectMap.set(destination, [undefined, destinationObject]);\n }\n\n const sourceObject = (sourceMetadataObjectMap === null || sourceMetadataObjectMap === void 0 ? void 0 : sourceMetadataObjectMap[0\n /* MetadataObjectMapClassId.asSource */\n ]) || applyMetadataFn(source, 0\n /* MetadataObjectMapClassId.asSource */\n );\n\n if (sourceMetadataObjectMap) {\n sourceMetadataObjectMap[0\n /* MetadataObjectMapClassId.asSource */\n ] = sourceObject;\n } else {\n metadataObjectMap.set(source, [sourceObject]);\n }\n\n const mapping = [[source, destination], [sourceObject, destinationObject], [], mapper, destinationConstructor]; // try to inherit naming conventions from mapper\n\n mapping[7\n /* MappingClassId.namingConventions */\n ] = getNamingConventions(mapper); // run configuration fn on mapping\n\n for (let i = 0, length = configurations.length; i < length; i++) {\n configurations[i](mapping);\n }\n\n const destinationPaths = getPathRecursive(destinationObject);\n const mappingProperties = mapping[2\n /* MappingClassId.properties */\n ];\n const hasCustomMappingProperties = mappingProperties.length > 0;\n const namingConventions = mapping[7\n /* MappingClassId.namingConventions */\n ];\n const metadataMap = getMetadataMap(mapper);\n const destinationMetadata = metadataMap.get(destination) || [];\n const sourceMetadata = metadataMap.get(source) || [];\n\n for (let i = 0, length = destinationPaths.length; i < length; i++) {\n const destinationPath = destinationPaths[i]; // is a forMember (custom mapping configuration) already exists\n // for this destination path, skip it\n\n if (hasCustomMappingProperties && mappingProperties.some(property => isPrimitiveArrayEqual(property[0\n /* MappingPropertiesClassId.path */\n ], destinationPath))) {\n continue;\n }\n\n const metadataAtDestination = destinationMetadata.find(metadata => isPrimitiveArrayEqual(metadata[0\n /* MetadataClassId.propertyKeys */\n ], destinationPath)); // try getting the sourcePath that is associated with this destinationPath\n\n /**\r\n * with naming conventions: fooBar -> [foo, bar]\r\n * without naming conventions: fooBar -> fooBar\r\n */\n\n let sourcePath = destinationPath;\n\n if (namingConventions) {\n sourcePath = getFlatteningPaths(sourceObject, getPath(destinationPath, namingConventions), namingConventions);\n } // sourcePath is not in sourceObject. No AutoMap available\n\n\n if (!(sourcePath[0] in sourceObject)) {\n continue;\n }\n\n const metadataAtSource = sourceMetadata.find(metadata => isPrimitiveArrayEqual(metadata[0\n /* MetadataClassId.propertyKeys */\n ], sourcePath));\n let nestedMappingPair = undefined;\n if (!metadataAtSource && !metadataAtDestination) continue;\n\n if (metadataAtSource && metadataAtDestination) {\n nestedMappingPair = [metadataAtDestination[1\n /* MetadataClassId.metaFn */\n ](), metadataAtSource[1\n /* MetadataClassId.metaFn */\n ]()];\n }\n\n const transformation = [mapInitialize(sourcePath)];\n\n if (nestedMappingPair) {\n let typeConverter;\n const isSourceArray = metadataAtSource[2\n /* MetadataClassId.isArray */\n ];\n const isDestinationArray = metadataAtDestination[2\n /* MetadataClassId.isArray */\n ];\n const mappingTypeConverters = mapping[5\n /* MappingClassId.typeConverters */\n ];\n\n if (mappingTypeConverters) {\n const [sourceConverters, arraySourceConverters] = mappingTypeConverters.get(nestedMappingPair[1\n /* NestedMappingPairClassId.source */\n ]) || [];\n const [destinationConverter, arrayDestinationConverter] = (isSourceArray ? arraySourceConverters === null || arraySourceConverters === void 0 ? void 0 : arraySourceConverters.get(nestedMappingPair[0\n /* NestedMappingPairClassId.destination */\n ]) : sourceConverters === null || sourceConverters === void 0 ? void 0 : sourceConverters.get(nestedMappingPair[0\n /* NestedMappingPairClassId.destination */\n ])) || [];\n typeConverter = isDestinationArray ? arrayDestinationConverter : destinationConverter;\n }\n\n if (typeConverter) {\n const originalMapInitializeFn = transformation[0\n /* MappingTransformationClassId.memberMapFn */\n ][1\n /* MapFnClassId.fn */\n ];\n\n transformation[0\n /* MappingTransformationClassId.memberMapFn */\n ][1\n /* MapFnClassId.fn */\n ] = srcObj => typeConverter(originalMapInitializeFn(srcObj));\n\n transformation[0\n /* MappingTransformationClassId.memberMapFn */\n ][2\n /* MapFnClassId.isConverted */\n ] = true;\n }\n }\n\n mappingProperties.unshift([destinationPath, [destinationPath, transformation], nestedMappingPair]);\n }\n\n return mapping;\n}\n\nfunction createMap(mapper, source, ...mappingConfigFnsOrIdentifier) {\n var _a; // turn string into symbol for identifier\n\n\n const sourceIdentifier = typeof source === 'string' ? Symbol.for(source) : source;\n let destinationIdentifier = sourceIdentifier;\n const [destination, ...mappingConfigFns] = mappingConfigFnsOrIdentifier || [];\n\n if (destination) {\n if (typeof destination === 'string') {\n destinationIdentifier = Symbol.for(destination);\n } else if (typeof destination === 'function' && destination.prototype !== undefined) {\n destinationIdentifier = destination;\n } else {\n (mappingConfigFns || []).push(destination);\n }\n }\n\n const mappings = getMappings(mapper);\n let mapping = (_a = mappings.get(sourceIdentifier)) === null || _a === void 0 ? void 0 : _a.get(destinationIdentifier);\n\n if (mapping) {\n getErrorHandler(mapper).handle(`Mapping for source ${String(source)} and destination ${String(destination)} already exists`);\n return mapping;\n } // get the strategy from Mapper to retrieve the metadata\n\n\n const strategy = getStrategy(mapper);\n const strategyMetadataMap = strategy.retrieveMetadata(sourceIdentifier, destinationIdentifier);\n strategyMetadataMap.forEach((metadataList, identifier) => {\n storeMetadata(mapper, identifier, metadataList);\n }); // after all the mapping configurations are consolidated,\n // initialize the mapping\n\n mapping = createInitialMapping(mapper, sourceIdentifier, destinationIdentifier, (mappingConfigFns || []).concat(...getProfileConfigurationContext(mapper).values()).filter(configFn => configFn != undefined)); // store the mapping\n\n if (!mappings.has(sourceIdentifier)) {\n mappings.set(sourceIdentifier, new Map([[destinationIdentifier, mapping]]));\n } else {\n mappings.get(sourceIdentifier).set(destinationIdentifier, mapping);\n } // return the mapping\n\n\n return mapping;\n}\n\nfunction addProfile(mapper, profile, ...mappingConfigurations) {\n mappingConfigurations.forEach(mappingConfiguration => {\n getProfileConfigurationContext(mapper).add(mappingConfiguration);\n });\n profile.apply({\n profileName: profile.name\n }, [mapper]);\n getProfileConfigurationContext(mapper).clear();\n}\n\nconst PROXY_TARGET = () => undefined;\n\nconst PROXY_OBJECT = createProxy(PROXY_TARGET);\n/**\r\n * For a given JS function selector, return a list of all members that were selected.\r\n *\r\n * @returns `null` if the given `fnSelector` doesn't match with anything.\r\n */\n\nfunction getMembers(fnSelector) {\n const resultProxy = fnSelector(PROXY_OBJECT);\n\n if (typeof resultProxy !== 'function') {\n return null;\n }\n\n const members = resultProxy();\n\n if (members.length === 0 || members.some(m => typeof m !== 'string')) {\n return null;\n }\n\n return members;\n}\n/**\r\n * Get a dot-separated string of the properties selected by a given `fn` selector\r\n * function.\r\n *\r\n * @example\r\n * ```js\r\n * getMemberPath(s => s.foo.bar) === 'foo.bar'\r\n * getMemberPath(s => s['foo']) === 'foo'\r\n * getMemberPath(s => s.foo['']) === 'foo.'\r\n * // invalid usage\r\n * getMemberPath(s => s) === ''\r\n * ```\r\n */\n\nfunction getMemberPath(fn) {\n const members = getMembers(fn);\n return members ? members : [];\n}\n/**\r\n * @returns {Proxy} A proxy that's wrap on the target object and track of\r\n * the path of accessed nested properties\r\n */\n\nfunction createProxy(target, path = []) {\n const realTraps = {\n get(_, p) {\n const childPath = path.slice();\n childPath.push(p);\n return createProxy(PROXY_TARGET, childPath);\n },\n\n apply() {\n return path;\n }\n\n };\n return new Proxy(target, realTraps);\n}\n\nfunction forMember(selector, ...fns) {\n let [preCondOrMapMemberFn, mapMemberFn] = fns;\n const memberPath = getMemberPath(selector); // reassign mapMemberFn and preCond\n\n if (mapMemberFn == null) {\n mapMemberFn = preCondOrMapMemberFn;\n preCondOrMapMemberFn = undefined;\n }\n\n const mappingProperty = [memberPath, [mapMemberFn, preCondOrMapMemberFn]];\n return mapping => {\n // TODO: consolidate this logic with the one in createInitialMapping\n const [sourceIdentifier, destinationIdentifier] = mapping[0\n /* MappingClassId.identifiers */\n ];\n const mapper = mapping[3\n /* MappingClassId.mapper */\n ];\n const namingConventions = mapping[7\n /* MappingClassId.namingConventions */\n ];\n const [sourceObject] = mapping[1\n /* MappingClassId.identifierMetadata */\n ];\n const metadataMap = getMetadataMap(mapper);\n const destinationMetadata = metadataMap.get(destinationIdentifier) || [];\n const sourceMetadata = metadataMap.get(sourceIdentifier) || [];\n let nestedMappingPair = undefined;\n const metadataAtMember = destinationMetadata.find(metadata => isPrimitiveArrayEqual(metadata[0\n /* MetadataClassId.propertyKeys */\n ], memberPath));\n let sourcePath = memberPath;\n\n if (namingConventions) {\n sourcePath = getFlatteningPaths(sourceObject, getPath(memberPath, namingConventions), namingConventions);\n } // sourcePath is not in sourceObject. No AutoMap available\n\n\n if (!(sourcePath[0] in sourceObject)) {\n mapping[2\n /* MappingClassId.properties */\n ].push([memberPath, mappingProperty, nestedMappingPair]);\n return;\n }\n\n const metadataAtSource = sourceMetadata.find(metadata => isPrimitiveArrayEqual(metadata[0\n /* MetadataClassId.propertyKeys */\n ], sourcePath));\n\n if (metadataAtSource && metadataAtMember) {\n nestedMappingPair = [metadataAtMember[1\n /* MetadataClassId.metaFn */\n ](), metadataAtSource[1\n /* MetadataClassId.metaFn */\n ]()];\n }\n\n mapping[2\n /* MappingClassId.properties */\n ].push([memberPath, mappingProperty, nestedMappingPair]);\n };\n}\n\nfunction forSelf(sourceOrMapping, selector) {\n let selfMapping = Array.isArray(sourceOrMapping) ? sourceOrMapping : undefined;\n return mapping => {\n if (selfMapping == null) {\n const [, destinationIdentifier] = mapping[0\n /* MappingClassId.identifiers */\n ];\n const mapper = mapping[3\n /* MappingClassId.mapper */\n ];\n const strategy = getStrategy(mapper); // turn string into symbol for identifier\n\n const sourceIdentifier = typeof sourceOrMapping === 'string' ? Symbol.for(sourceOrMapping) : sourceOrMapping;\n const strategyMetadataMap = strategy.retrieveMetadata(sourceIdentifier);\n strategyMetadataMap.forEach((metadataList, identifier) => {\n storeMetadata(mapper, identifier, metadataList);\n });\n selfMapping = createInitialMapping(mapper, sourceIdentifier, destinationIdentifier);\n }\n\n const selfMapProperties = selfMapping[2\n /* MappingClassId.properties */\n ];\n\n for (let i = 0, length = selfMapProperties.length; i < length; i++) {\n const mapProperty = selfMapProperties[i];\n\n if (mapping[2\n /* MappingClassId.properties */\n ].some(property => isPrimitiveArrayEqual(property[0\n /* MappingPropertiesClassId.path */\n ], mapProperty[0\n /* MappingPropertiesClassId.path */\n ]))) {\n continue;\n }\n\n const transformation = mapProperty[1\n /* MappingPropertiesClassId.mappingProperty */\n ][1\n /* MappingPropertyClassId.transformation */\n ];\n\n transformation[0\n /* MappingTransformationClassId.memberMapFn */\n ][1\n /* MapFnClassId.fn */\n ] = sourceObj => get(selector(sourceObj), mapProperty[0\n /* MappingPropertiesClassId.path */\n ]);\n\n mapping[2\n /* MappingClassId.properties */\n ].push([mapProperty[0\n /* MappingPropertiesClassId.path */\n ], [mapProperty[0\n /* MappingPropertiesClassId.path */\n ], transformation], mapProperty[2\n /* MappingPropertiesClassId.nestedMappingPair */\n ]]);\n }\n };\n}\n\nfunction toSelector(input) {\n if ('convert' in input) return input.convert.bind(input);\n return input;\n}\n\nfunction typeConverter(source, destination, converterOrValueSelector) {\n return mapping => {\n const isSourceArray = Array.isArray(source);\n const isDestinationArray = Array.isArray(destination);\n const sourceIdentifier = isSourceArray ? source[0] : source;\n const destinationIdentifier = isDestinationArray ? destination[0] : destination;\n const selector = toSelector(converterOrValueSelector);\n const typeConverters = mapping[5\n /* MappingClassId.typeConverters */\n ] || (mapping[5\n /* MappingClassId.typeConverters */\n ] = new Map());\n let sourceConverters;\n const [sourceTypeConverters, arraySourceTypeConverters] = typeConverters.get(sourceIdentifier) || [];\n\n if (sourceTypeConverters || arraySourceTypeConverters) {\n sourceConverters = isSourceArray ? arraySourceTypeConverters : sourceTypeConverters;\n const [destinationConverter, arrayDestinationConverter] = sourceConverters.get(destinationIdentifier) || [];\n sourceConverters.set(destinationIdentifier, isDestinationArray ? [destinationConverter, selector] : [selector, arrayDestinationConverter]);\n return;\n }\n\n sourceConverters = new Map([[destinationIdentifier, isDestinationArray ? [undefined, selector] : [selector, undefined]]]);\n typeConverters.set(sourceIdentifier, isSourceArray ? [new Map(), sourceConverters] : [sourceConverters, new Map()]);\n };\n}\n\nconst constructUsing = destinationConstructor => {\n return mapping => {\n mapping[4\n /* MappingClassId.destinationConstructor */\n ] = destinationConstructor;\n };\n};\n\nfunction beforeMap(cb) {\n return mapping => {\n if (mapping[6\n /* MappingClassId.callbacks */\n ] == null) {\n mapping[6\n /* MappingClassId.callbacks */\n ] = [];\n }\n\n mapping[6\n /* MappingClassId.callbacks */\n ][0\n /* MappingCallbacksClassId.beforeMap */\n ] = cb;\n };\n}\n\nfunction afterMap(cb) {\n return mapping => {\n if (mapping[6\n /* MappingClassId.callbacks */\n ] == null) {\n mapping[6\n /* MappingClassId.callbacks */\n ] = [];\n }\n\n mapping[6\n /* MappingClassId.callbacks */\n ][1\n /* MappingCallbacksClassId.afterMap */\n ] = cb;\n };\n}\n\nfunction extend(sourceOrMapping, destination) {\n return mapping => {\n let mappingToExtend;\n\n if (Array.isArray(sourceOrMapping)) {\n mappingToExtend = sourceOrMapping;\n } else {\n const mapper = mapping[3\n /* MappingClassId.mapper */\n ];\n mappingToExtend = getMapping(mapper, sourceOrMapping, destination);\n }\n\n const propsToExtend = mappingToExtend[2\n /* MappingClassId.properties */\n ];\n\n for (let i = 0, length = propsToExtend.length; i < length; i++) {\n const [propToExtendKey, propToExtendMappingProp, propToExtendNestedMapping] = propsToExtend[i];\n const existProp = mapping[2\n /* MappingClassId.properties */\n ].find(([pKey]) => isSamePath(pKey, propToExtendKey));\n if (existProp) continue;\n mapping[2\n /* MappingClassId.properties */\n ].push([propToExtendKey, propToExtendMappingProp, propToExtendNestedMapping]);\n }\n };\n}\n\nconst namingConventions = namingConventionsInput => {\n return mapping => {\n mapping[7\n /* MappingClassId.namingConventions */\n ] = normalizeNamingConventions(namingConventionsInput);\n };\n};\n\nfunction isResolver(fn) {\n return 'resolve' in fn;\n}\n\nfunction mapFrom(from) {\n if (isResolver(from)) {\n return [1\n /* TransformationType.MapFrom */\n , from.resolve.bind(from)];\n }\n\n return [1\n /* TransformationType.MapFrom */\n , from];\n}\n\nfunction mapWith(withDestination, withSource, withSourceValue) {\n return [4\n /* TransformationType.MapWith */\n , (source, mapper) => {\n const sourceValue = withSourceValue(source);\n\n if (Array.isArray(sourceValue)) {\n return mapper.mapArray(sourceValue, withSource, withDestination);\n }\n\n return mapper.map(sourceValue, withSource, withDestination);\n }];\n}\n\nfunction convertUsing(converter, selector) {\n return [5\n /* TransformationType.ConvertUsing */\n , source => converter.convert(selector(source))];\n}\n\nfunction ignore() {\n return [0\n /* TransformationType.Ignore */\n ];\n}\n\nfunction nullSubstitution(substitution) {\n return [7\n /* TransformationType.NullSubstitution */\n , (source, sourceMemberPath) => {\n const sourceValue = get(source, sourceMemberPath);\n return sourceValue === null ? substitution : sourceValue;\n }];\n}\n\nfunction preCondition(predicate, defaultValue) {\n return [predicate, defaultValue];\n}\n\nfunction condition(predicate, defaultValue) {\n return [2\n /* TransformationType.Condition */\n , (source, sourceMemberPaths) => {\n if (predicate(source)) {\n return get(source, sourceMemberPaths);\n }\n\n return defaultValue;\n }];\n}\n\nfunction fromValue(rawValue) {\n return [3\n /* TransformationType.FromValue */\n , () => rawValue];\n}\n\nfunction mapWithArguments(withArgumentsResolver) {\n if (isResolver(withArgumentsResolver)) {\n return [9\n /* TransformationType.MapWithArguments */\n , withArgumentsResolver.resolve.bind(withArgumentsResolver)];\n }\n\n return [9\n /* TransformationType.MapWithArguments */\n , withArgumentsResolver];\n}\n\nfunction mapDefer(defer) {\n return [10\n /* TransformationType.MapDefer */\n , defer];\n}\n\nfunction undefinedSubstitution(substitution) {\n return [8\n /* TransformationType.UndefinedSubstitution */\n , (source, sourceMemberPath) => {\n const sourceValue = get(source, sourceMemberPath);\n return sourceValue === undefined ? substitution : sourceValue;\n }];\n}\n\n/**\r\n * CamelCaseNamingConvention\r\n *\r\n * @example thisIsCamelCase\r\n */\nclass CamelCaseNamingConvention {\n constructor() {\n this.separatorCharacter = '';\n this.splittingExpression = /(^[a-z]+(?=$|[A-Z]{1}[a-z0-9]+)|[A-Z]?[a-z0-9]+)/;\n }\n\n transformPropertyName(sourceNameParts) {\n let result = '';\n\n for (let i = 0, len = sourceNameParts.length; i < len; i++) {\n if (i === 0) {\n result += sourceNameParts[i].charAt(0).toLowerCase();\n } else {\n result += sourceNameParts[i].charAt(0).toUpperCase();\n }\n\n result += sourceNameParts[i].substring(1);\n }\n\n return result;\n }\n\n}\n\n/**\r\n * PascalCaseNamingConvention\r\n *\r\n * @example ThisIsPascalCase\r\n */\nclass PascalCaseNamingConvention {\n constructor() {\n this.separatorCharacter = '';\n this.splittingExpression = /(^[A-Z]+(?=$|[A-Z]{1}[a-z0-9]+)|[A-Z]?[a-z0-9]+)/;\n }\n\n transformPropertyName(sourceNameParts) {\n let result = '';\n\n for (let i = 0, len = sourceNameParts.length; i < len; i++) {\n result += sourceNameParts[i].charAt(0).toUpperCase() + sourceNameParts[i].substring(1);\n }\n\n return result;\n }\n\n}\n\n/**\r\n * SnakeCaseNamingConvention\r\n *\r\n * @example this_is_snake_case\r\n */\nclass SnakeCaseNamingConvention {\n constructor() {\n this.separatorCharacter = '_';\n this.splittingExpression = /_/;\n }\n\n transformPropertyName(sourcePropNameParts) {\n const len = sourcePropNameParts.length;\n\n if (len <= 1) {\n return sourcePropNameParts[0].toLowerCase() || '';\n }\n\n return sourcePropNameParts.map(p => p.toLowerCase()).join(this.separatorCharacter);\n }\n\n}\n\nexport { AutoMapperLogger, CamelCaseNamingConvention, PascalCaseNamingConvention, SnakeCaseNamingConvention, addProfile, afterMap, beforeMap, condition, constructUsing, convertUsing, createMap, createMapper, defaultStrategyInitializerOptions, extend, forMember, forSelf, fromValue, getRecursiveValue, ignore, isDateConstructor, isEmpty, isPrimitiveConstructor, mapDefer, mapFrom, mapWith, mapWithArguments, namingConventions, nullSubstitution, preCondition, set, setMutate, setRecursiveValue, typeConverter, undefinedSubstitution };\n"],"names":["normalizeNamingConventions","namingConventions","source","destination","STRATEGY","Symbol","for","MAPPINGS","METADATA_MAP","METADATA_OBJECT_MAP","ERROR_HANDLER","NAMING_CONVENTIONS","RECURSIVE_DEPTH","RECURSIVE_COUNT","PROFILE_CONFIGURATION_CONTEXT","CUSTOM_NODE_INSPECT","getErrorHandler","mapper","getMappings","getMetadataMap","getMetadataObjectMap","getRecursiveDepth","getStrategy","getProfileConfigurationContext","get","object","path","length","index","undefined","getMapping","allowNull","_a","sourceIdentifier","destinationIdentifier","mapping","errorHandler","errorMessage","String","handle","Error","isDateConstructor","value","Object","getPrototypeOf","Date","isEmpty","Array","isArray","keys","isPrimitiveArrayEqual","a","b","every","itemA","isPrimitiveConstructor","proto","Number","Boolean","set","decomposedPath","base","decomposePath","assignEmpty","slice","assign","setMutate","obj","hasOwnProperty","mapMember","transformationMapFn","sourceObject","destinationObject","destinationMemberPath","extraArgs","sourceMemberIdentifier","destinationMemberIdentifier","transformationType","mapFn","shouldRunImplicitMap","mapArray","map","setMemberReturnFn","mapReturn","options","isMapArray","setMemberFn","setMemberMutateFn","destinationObj","destinationMember","getMemberMutateFn","memberPath","mapMutate","getMemberFn","destinationWithMetadata","propsToMap","destinationConstructor","mappingBeforeCallback","mappingAfterCallback","beforeMap","mapBeforeCallback","afterMap","mapAfterCallback","mapDestinationConstructor","metadataMap","configuredKeys","i","transformationPreConditionPredicate","transformationPreConditionDefaultValue","hasSameIdentifier","setMember","valFn","_b","originalError","constructor","name","JSON","stringify","push","destinationMetadata","hasNullMetadata","find","metadata","mapInitializedValue","isTypedConverted","prototype","toString","call","first","each","nestedMapping","memberValue","unmappedKeys","reduce","result","key","isOnDestination","isAlreadyConfigured","some","configuredKey","isWritable","getOwnPropertyDescriptor","writable","parentInfo","join","assertUnmappedProperties","AutoMapperLogger","configure","customLogger","this","configured","entries","forEach","logLevel","logImpl","log","message","console","bind","AUTOMAPPER_PREFIX","warn","warning","error","info","createMapper","strategyInitializer","strategy","mappings","metadataObjectMap","recursiveDepth","recursiveCount","profileConfigurationContext","getOptions","destinationIdentifierOrOptions","mapOptions","typeofDestinationOrOptions","Proxy","target","p","receiver","Set","Map","clear","preMap","postMap","Promise","res","setTimeout","sourceArray","destinationArray","Reflect","RECURSIVE_DATA","getRecursiveValue","recursiveMap","parent","member","parentValue","root","item","arrayMapGet","setRecursiveValue","has","arrayMapSet","nextMap","arrayMapHas","defaultStrategyInitializerOptions","applyMetadata","recursiveCountMap","getRecursiveCount","recursiveDepthMap","model","as","selfReference","instance","metaFn","metaResult","depth","count","childMetadataObjectMap","_","storeMetadata","metadataList","strict","isDefined","propertyKey","isGetterOnly","type","mapInitialize","sourcePath","getPath","sourceNamingConvention","destinationNamingConvention","keyParts","s","split","splittingExpression","filter","transformPropertyName","getFlatteningPaths","src","srcPath","splitSourcePaths","concat","paths","trueFirstPartOfSource","stopIndex","found","hasProperty","len","restPaths","transformedRestPaths","property","isSamePath","targetLen","EXCLUDE_KEYS","getPathRecursive","node","prefix","previous","hasChildPaths","from","getOwnPropertyNames","includes","child","queue","childNode","childPaths","pathsLen","uniquePaths","createInitialMapping","configurations","applyMetadataFn","sourceMetadataObjectMap","destinationMetadataObjectMap","getNamingConventions","destinationPaths","mappingProperties","hasCustomMappingProperties","sourceMetadata","destinationPath","metadataAtDestination","metadataAtSource","nestedMappingPair","transformation","typeConverter","isSourceArray","isDestinationArray","mappingTypeConverters","sourceConverters","arraySourceConverters","destinationConverter","arrayDestinationConverter","originalMapInitializeFn","srcObj","unshift","createMap","mappingConfigFnsOrIdentifier","mappingConfigFns","retrieveMetadata","identifier","values","configFn","addProfile","profile","mappingConfigurations","mappingConfiguration","add","apply","profileName","PROXY_TARGET","PROXY_OBJECT","createProxy","childPath","forMember","selector","fns","preCondOrMapMemberFn","mapMemberFn","fnSelector","resultProxy","members","m","getMembers","mappingProperty","metadataAtMember","forSelf","sourceOrMapping","selfMapping","selfMapProperties","mapProperty","sourceObj","converterOrValueSelector","input","convert","typeConverters","sourceTypeConverters","arraySourceTypeConverters","constructUsing","cb","extend","mappingToExtend","propsToExtend","propToExtendKey","propToExtendMappingProp","propToExtendNestedMapping","pKey","namingConventionsInput","isResolver","fn","mapFrom","resolve","mapWith","withDestination","withSource","withSourceValue","sourceValue","convertUsing","converter","ignore","nullSubstitution","substitution","sourceMemberPath","preCondition","predicate","defaultValue","condition","sourceMemberPaths","fromValue","rawValue","mapWithArguments","withArgumentsResolver","mapDefer","defer","undefinedSubstitution","CamelCaseNamingConvention","separatorCharacter","sourceNameParts","charAt","toLowerCase","toUpperCase","substring","PascalCaseNamingConvention","SnakeCaseNamingConvention","sourcePropNameParts"],"sourceRoot":""}