{"ast":null,"code":"import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nvar _excluded = [\"label\", \"children\", \"key\", \"type\"];\nimport * as React from 'react';\nimport Divider from \"../Divider\";\nimport MenuItem from \"../MenuItem\";\nimport MenuItemGroup from \"../MenuItemGroup\";\nimport SubMenu from \"../SubMenu\";\nimport { parseChildren } from \"./commonUtil\";\nfunction convertItemsToNodes(list, components) {\n var MergedMenuItem = components.item,\n MergedMenuItemGroup = components.group,\n MergedSubMenu = components.submenu,\n MergedDivider = components.divider;\n return (list || []).map(function (opt, index) {\n if (opt && _typeof(opt) === 'object') {\n var _ref = opt,\n label = _ref.label,\n children = _ref.children,\n key = _ref.key,\n type = _ref.type,\n restProps = _objectWithoutProperties(_ref, _excluded);\n var mergedKey = key !== null && key !== void 0 ? key : \"tmp-\".concat(index);\n\n // MenuItemGroup & SubMenuItem\n if (children || type === 'group') {\n if (type === 'group') {\n // Group\n return /*#__PURE__*/React.createElement(MergedMenuItemGroup, _extends({\n key: mergedKey\n }, restProps, {\n title: label\n }), convertItemsToNodes(children, components));\n }\n\n // Sub Menu\n return /*#__PURE__*/React.createElement(MergedSubMenu, _extends({\n key: mergedKey\n }, restProps, {\n title: label\n }), convertItemsToNodes(children, components));\n }\n\n // MenuItem & Divider\n if (type === 'divider') {\n return /*#__PURE__*/React.createElement(MergedDivider, _extends({\n key: mergedKey\n }, restProps));\n }\n return /*#__PURE__*/React.createElement(MergedMenuItem, _extends({\n key: mergedKey\n }, restProps), label);\n }\n return null;\n }).filter(function (opt) {\n return opt;\n });\n}\nexport function parseItems(children, items, keyPath, components) {\n var childNodes = children;\n var mergedComponents = _objectSpread({\n divider: Divider,\n item: MenuItem,\n group: MenuItemGroup,\n submenu: SubMenu\n }, components);\n if (items) {\n childNodes = convertItemsToNodes(items, mergedComponents);\n }\n return parseChildren(childNodes, keyPath);\n}","map":{"version":3,"names":["_objectSpread","_extends","_objectWithoutProperties","_typeof","_excluded","React","Divider","MenuItem","MenuItemGroup","SubMenu","parseChildren","convertItemsToNodes","list","components","MergedMenuItem","item","MergedMenuItemGroup","group","MergedSubMenu","submenu","MergedDivider","divider","map","opt","index","_ref","label","children","key","type","restProps","mergedKey","concat","createElement","title","filter","parseItems","items","keyPath","childNodes","mergedComponents"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/rc-menu/es/utils/nodeUtil.js"],"sourcesContent":["import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nvar _excluded = [\"label\", \"children\", \"key\", \"type\"];\nimport * as React from 'react';\nimport Divider from \"../Divider\";\nimport MenuItem from \"../MenuItem\";\nimport MenuItemGroup from \"../MenuItemGroup\";\nimport SubMenu from \"../SubMenu\";\nimport { parseChildren } from \"./commonUtil\";\nfunction convertItemsToNodes(list, components) {\n var MergedMenuItem = components.item,\n MergedMenuItemGroup = components.group,\n MergedSubMenu = components.submenu,\n MergedDivider = components.divider;\n return (list || []).map(function (opt, index) {\n if (opt && _typeof(opt) === 'object') {\n var _ref = opt,\n label = _ref.label,\n children = _ref.children,\n key = _ref.key,\n type = _ref.type,\n restProps = _objectWithoutProperties(_ref, _excluded);\n var mergedKey = key !== null && key !== void 0 ? key : \"tmp-\".concat(index);\n\n // MenuItemGroup & SubMenuItem\n if (children || type === 'group') {\n if (type === 'group') {\n // Group\n return /*#__PURE__*/React.createElement(MergedMenuItemGroup, _extends({\n key: mergedKey\n }, restProps, {\n title: label\n }), convertItemsToNodes(children, components));\n }\n\n // Sub Menu\n return /*#__PURE__*/React.createElement(MergedSubMenu, _extends({\n key: mergedKey\n }, restProps, {\n title: label\n }), convertItemsToNodes(children, components));\n }\n\n // MenuItem & Divider\n if (type === 'divider') {\n return /*#__PURE__*/React.createElement(MergedDivider, _extends({\n key: mergedKey\n }, restProps));\n }\n return /*#__PURE__*/React.createElement(MergedMenuItem, _extends({\n key: mergedKey\n }, restProps), label);\n }\n return null;\n }).filter(function (opt) {\n return opt;\n });\n}\nexport function parseItems(children, items, keyPath, components) {\n var childNodes = children;\n var mergedComponents = _objectSpread({\n divider: Divider,\n item: MenuItem,\n group: MenuItemGroup,\n submenu: SubMenu\n }, components);\n if (items) {\n childNodes = convertItemsToNodes(items, mergedComponents);\n }\n return parseChildren(childNodes, keyPath);\n}"],"mappings":"AAAA,OAAOA,aAAa,MAAM,0CAA0C;AACpE,OAAOC,QAAQ,MAAM,oCAAoC;AACzD,OAAOC,wBAAwB,MAAM,oDAAoD;AACzF,OAAOC,OAAO,MAAM,mCAAmC;AACvD,IAAIC,SAAS,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,CAAC;AACpD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,OAAO,MAAM,YAAY;AAChC,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,OAAOC,OAAO,MAAM,YAAY;AAChC,SAASC,aAAa,QAAQ,cAAc;AAC5C,SAASC,mBAAmBA,CAACC,IAAI,EAAEC,UAAU,EAAE;EAC7C,IAAIC,cAAc,GAAGD,UAAU,CAACE,IAAI;IAClCC,mBAAmB,GAAGH,UAAU,CAACI,KAAK;IACtCC,aAAa,GAAGL,UAAU,CAACM,OAAO;IAClCC,aAAa,GAAGP,UAAU,CAACQ,OAAO;EACpC,OAAO,CAACT,IAAI,IAAI,EAAE,EAAEU,GAAG,CAAC,UAAUC,GAAG,EAAEC,KAAK,EAAE;IAC5C,IAAID,GAAG,IAAIpB,OAAO,CAACoB,GAAG,CAAC,KAAK,QAAQ,EAAE;MACpC,IAAIE,IAAI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