{"ast":null,"code":"import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport getValue from \"rc-util/es/utils/get\";\nimport setValue from \"rc-util/es/utils/set\";\nimport { toArray } from \"./typeUtil\";\nexport { getValue, setValue };\n\n/**\n * Convert name to internal supported format.\n * This function should keep since we still thinking if need support like `a.b.c` format.\n * 'a' => ['a']\n * 123 => [123]\n * ['a', 123] => ['a', 123]\n */\nexport function getNamePath(path) {\n return toArray(path);\n}\nexport function cloneByNamePathList(store, namePathList) {\n var newStore = {};\n namePathList.forEach(function (namePath) {\n var value = getValue(store, namePath);\n newStore = setValue(newStore, namePath, value);\n });\n return newStore;\n}\n\n/**\n * Check if `namePathList` includes `namePath`.\n * @param namePathList A list of `InternalNamePath[]`\n * @param namePath Compare `InternalNamePath`\n * @param partialMatch True will make `[a, b]` match `[a, b, c]`\n */\nexport function containsNamePath(namePathList, namePath) {\n var partialMatch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n return namePathList && namePathList.some(function (path) {\n return matchNamePath(namePath, path, partialMatch);\n });\n}\n\n/**\n * Check if `namePath` is super set or equal of `subNamePath`.\n * @param namePath A list of `InternalNamePath[]`\n * @param subNamePath Compare `InternalNamePath`\n * @param partialMatch True will make `[a, b]` match `[a, b, c]`\n */\nexport function matchNamePath(namePath, subNamePath) {\n var partialMatch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n if (!namePath || !subNamePath) {\n return false;\n }\n if (!partialMatch && namePath.length !== subNamePath.length) {\n return false;\n }\n return subNamePath.every(function (nameUnit, i) {\n return namePath[i] === nameUnit;\n });\n}\n\n// Like `shallowEqual`, but we not check the data which may cause re-render\n\nexport function isSimilar(source, target) {\n if (source === target) {\n return true;\n }\n if (!source && target || source && !target) {\n return false;\n }\n if (!source || !target || _typeof(source) !== 'object' || _typeof(target) !== 'object') {\n return false;\n }\n var sourceKeys = Object.keys(source);\n var targetKeys = Object.keys(target);\n var keys = new Set([].concat(sourceKeys, targetKeys));\n return _toConsumableArray(keys).every(function (key) {\n var sourceValue = source[key];\n var targetValue = target[key];\n if (typeof sourceValue === 'function' && typeof targetValue === 'function') {\n return true;\n }\n return sourceValue === targetValue;\n });\n}\nexport function defaultGetValueFromEvent(valuePropName) {\n var event = arguments.length <= 1 ? undefined : arguments[1];\n if (event && event.target && _typeof(event.target) === 'object' && valuePropName in event.target) {\n return event.target[valuePropName];\n }\n return event;\n}\n\n/**\n * Moves an array item from one position in an array to another.\n *\n * Note: This is a pure function so a new array will be returned, instead\n * of altering the array argument.\n *\n * @param array Array in which to move an item. (required)\n * @param moveIndex The index of the item to move. (required)\n * @param toIndex The index to move item at moveIndex to. (required)\n */\nexport function move(array, moveIndex, toIndex) {\n var length = array.length;\n if (moveIndex < 0 || moveIndex >= length || toIndex < 0 || toIndex >= length) {\n return array;\n }\n var item = array[moveIndex];\n var diff = moveIndex - toIndex;\n if (diff > 0) {\n // move left\n return [].concat(_toConsumableArray(array.slice(0, toIndex)), [item], _toConsumableArray(array.slice(toIndex, moveIndex)), _toConsumableArray(array.slice(moveIndex + 1, length)));\n }\n if (diff < 0) {\n // move right\n return [].concat(_toConsumableArray(array.slice(0, moveIndex)), _toConsumableArray(array.slice(moveIndex + 1, toIndex + 1)), [item], _toConsumableArray(array.slice(toIndex + 1, length)));\n }\n return array;\n}","map":{"version":3,"names":["_toConsumableArray","_typeof","getValue","setValue","toArray","getNamePath","path","cloneByNamePathList","store","namePathList","newStore","forEach","namePath","value","containsNamePath","partialMatch","arguments","length","undefined","some","matchNamePath","subNamePath","every","nameUnit","i","isSimilar","source","target","sourceKeys","Object","keys","targetKeys","Set","concat","key","sourceValue","targetValue","defaultGetValueFromEvent","valuePropName","event","move","array","moveIndex","toIndex","item","diff","slice"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/rc-field-form/es/utils/valueUtil.js"],"sourcesContent":["import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport getValue from \"rc-util/es/utils/get\";\nimport setValue from \"rc-util/es/utils/set\";\nimport { toArray } from \"./typeUtil\";\nexport { getValue, setValue };\n\n/**\n * Convert name to internal supported format.\n * This function should keep since we still thinking if need support like `a.b.c` format.\n * 'a' => ['a']\n * 123 => [123]\n * ['a', 123] => ['a', 123]\n */\nexport function getNamePath(path) {\n return toArray(path);\n}\nexport function cloneByNamePathList(store, namePathList) {\n var newStore = {};\n namePathList.forEach(function (namePath) {\n var value = getValue(store, namePath);\n newStore = setValue(newStore, namePath, value);\n });\n return newStore;\n}\n\n/**\n * Check if `namePathList` includes `namePath`.\n * @param namePathList A list of `InternalNamePath[]`\n * @param namePath Compare `InternalNamePath`\n * @param partialMatch True will make `[a, b]` match `[a, b, c]`\n */\nexport function containsNamePath(namePathList, namePath) {\n var partialMatch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n return namePathList && namePathList.some(function (path) {\n return matchNamePath(namePath, path, partialMatch);\n });\n}\n\n/**\n * Check if `namePath` is super set or equal of `subNamePath`.\n * @param namePath A list of `InternalNamePath[]`\n * @param subNamePath Compare `InternalNamePath`\n * @param partialMatch True will make `[a, b]` match `[a, b, c]`\n */\nexport function matchNamePath(namePath, subNamePath) {\n var partialMatch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n if (!namePath || !subNamePath) {\n return false;\n }\n if (!partialMatch && namePath.length !== subNamePath.length) {\n return false;\n }\n return subNamePath.every(function (nameUnit, i) {\n return namePath[i] === nameUnit;\n });\n}\n\n// Like `shallowEqual`, but we not check the data which may cause re-render\n\nexport function isSimilar(source, target) {\n if (source === target) {\n return true;\n }\n if (!source && target || source && !target) {\n return false;\n }\n if (!source || !target || _typeof(source) !== 'object' || _typeof(target) !== 'object') {\n return false;\n }\n var sourceKeys = Object.keys(source);\n var targetKeys = Object.keys(target);\n var keys = new Set([].concat(sourceKeys, targetKeys));\n return _toConsumableArray(keys).every(function (key) {\n var sourceValue = source[key];\n var targetValue = target[key];\n if (typeof sourceValue === 'function' && typeof targetValue === 'function') {\n return true;\n }\n return sourceValue === targetValue;\n });\n}\nexport function defaultGetValueFromEvent(valuePropName) {\n var event = arguments.length <= 1 ? undefined : arguments[1];\n if (event && event.target && _typeof(event.target) === 'object' && valuePropName in event.target) {\n return event.target[valuePropName];\n }\n return event;\n}\n\n/**\n * Moves an array item from one position in an array to another.\n *\n * Note: This is a pure function so a new array will be returned, instead\n * of altering the array argument.\n *\n * @param array Array in which to move an item. (required)\n * @param moveIndex The index of the item to move. (required)\n * @param toIndex The index to move item at moveIndex to. (required)\n */\nexport function move(array, moveIndex, toIndex) {\n var length = array.length;\n if (moveIndex < 0 || moveIndex >= length || toIndex < 0 || toIndex >= length) {\n return array;\n }\n var item = array[moveIndex];\n var diff = moveIndex - toIndex;\n if (diff > 0) {\n // move left\n return [].concat(_toConsumableArray(array.slice(0, toIndex)), [item], _toConsumableArray(array.slice(toIndex, moveIndex)), _toConsumableArray(array.slice(moveIndex + 1, length)));\n }\n if (diff < 0) {\n // move right\n return [].concat(_toConsumableArray(array.slice(0, moveIndex)), _toConsumableArray(array.slice(moveIndex + 1, toIndex + 1)), [item], _toConsumableArray(array.slice(toIndex + 1, length)));\n }\n return array;\n}"],"mappings":"AAAA,OAAOA,kBAAkB,MAAM,8CAA8C;AAC7E,OAAOC,OAAO,MAAM,mCAAmC;AACvD,OAAOC,QAAQ,MAAM,sBAAsB;AAC3C,OAAOC,QAAQ,MAAM,sBAAsB;AAC3C,SAASC,OAAO,QAAQ,YAAY;AACpC,SAASF,QAAQ,EAAEC,QAAQ;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,WAAWA,CAACC,IAAI,EAAE;EAChC,OAAOF,OAAO,CAACE,IAAI,CAAC;AACtB;AACA,OAAO,SAASC,mBAAmBA,CAACC,KAAK,EAAEC,YAAY,EAAE;EACvD,IAAIC,QAAQ,GAAG,CAA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