"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.components = exports.componentList = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _meta = _interopRequireDefault(require("./alert/meta"));
var _meta2 = _interopRequireDefault(require("./avatar/meta"));
var _meta3 = _interopRequireDefault(require("./badge/meta"));
var _meta4 = _interopRequireDefault(require("./balloon-inner/meta"));
var _meta5 = _interopRequireDefault(require("./balloon/meta"));
var _meta6 = _interopRequireDefault(require("./box/meta"));
var _meta7 = _interopRequireDefault(require("./breadcrumb-item/meta"));
var _meta8 = _interopRequireDefault(require("./breadcrumb/meta"));
var _meta9 = _interopRequireDefault(require("./button-group/meta"));
var _meta10 = _interopRequireDefault(require("./button/meta"));
var _meta11 = _interopRequireDefault(require("./calendar/meta"));
var _meta12 = _interopRequireDefault(require("./card-actions/meta"));
var _meta13 = _interopRequireDefault(require("./card-bullet-header/meta"));
var _meta14 = _interopRequireDefault(require("./card-collaspe-content/meta"));
var _meta15 = _interopRequireDefault(require("./card-content/meta"));
var _meta16 = _interopRequireDefault(require("./card-divider/meta"));
var _meta17 = _interopRequireDefault(require("./card-header/meta"));
var _meta18 = _interopRequireDefault(require("./card-media/meta"));
var _meta19 = _interopRequireDefault(require("./card/meta"));
var _meta20 = _interopRequireDefault(require("./cascader-select/meta"));
var _meta21 = _interopRequireDefault(require("./cascader/meta"));
var _meta22 = _interopRequireDefault(require("./checkbox-group/meta"));
var _meta23 = _interopRequireDefault(require("./checkbox-item/meta"));
var _meta24 = _interopRequireDefault(require("./checkbox/meta"));
var _meta25 = _interopRequireDefault(require("./collapse-panel/meta"));
var _meta26 = _interopRequireDefault(require("./collapse/meta"));
var _meta27 = _interopRequireDefault(require("./date-picker/meta"));
var _meta28 = _interopRequireDefault(require("./dialog/meta"));
var _meta29 = _interopRequireDefault(require("./div/meta"));
var _meta30 = _interopRequireDefault(require("./divider/meta"));
var _meta31 = _interopRequireDefault(require("./drawer-inner/meta"));
var _meta32 = _interopRequireDefault(require("./drawer/meta"));
var _meta33 = _interopRequireDefault(require("./dropdown/meta"));
var _meta34 = _interopRequireDefault(require("./error-boundary/meta"));
var _meta35 = _interopRequireDefault(require("./field/meta"));
var _meta36 = _interopRequireDefault(require("./form-error/meta"));
var _meta37 = _interopRequireDefault(require("./form-item/meta"));
var _meta38 = _interopRequireDefault(require("./form-reset/meta"));
var _meta39 = _interopRequireDefault(require("./form-submit/meta"));
var _meta40 = _interopRequireDefault(require("./form/meta"));
var _meta41 = _interopRequireDefault(require("./group/meta"));
var _meta42 = _interopRequireDefault(require("./icon/meta"));
var _meta43 = _interopRequireDefault(require("./img/meta"));
var _meta44 = _interopRequireDefault(require("./inner/meta"));
var _meta45 = _interopRequireDefault(require("./input-group/meta"));
var _meta46 = _interopRequireDefault(require("./input-password/meta"));
var _meta47 = _interopRequireDefault(require("./input-text-area/meta"));
var _meta48 = _interopRequireDefault(require("./input/meta"));
var _meta49 = _interopRequireDefault(require("./link/meta"));
var _meta50 = _interopRequireDefault(require("./list-item/meta"));
var _meta51 = _interopRequireDefault(require("./list/meta"));
var _meta52 = _interopRequireDefault(require("./loading/meta"));
var _meta53 = _interopRequireDefault(require("./menu-button/meta"));
var _meta54 = _interopRequireDefault(require("./menu-divider/meta"));
var _meta55 = _interopRequireDefault(require("./menu-group/meta"));
var _meta56 = _interopRequireDefault(require("./menu-item/meta"));
var _meta57 = _interopRequireDefault(require("./menu-popup-item/meta"));
var _meta58 = _interopRequireDefault(require("./menu/meta"));
var _meta59 = _interopRequireDefault(require("./month-picker/meta"));
var _meta60 = _interopRequireDefault(require("./nav-item/meta"));
var _meta61 = _interopRequireDefault(require("./nav/meta"));
var _meta62 = _interopRequireDefault(require("./next-table/meta"));
var _meta63 = _interopRequireDefault(require("./next-text/meta"));
var _meta64 = _interopRequireDefault(require("./note-wrapper/meta"));
var _meta65 = _interopRequireDefault(require("./number-picker/meta"));
var _meta66 = _interopRequireDefault(require("./page/meta"));
var _meta67 = _interopRequireDefault(require("./pagination/meta"));
var _meta68 = _interopRequireDefault(require("./paragraph/meta"));
var _meta69 = _interopRequireDefault(require("./popup-item/meta"));
var _meta70 = _interopRequireDefault(require("./progress/meta"));
var _meta71 = _interopRequireDefault(require("./radio-group/meta"));
var _meta72 = _interopRequireDefault(require("./radio-item/meta"));
var _meta73 = _interopRequireDefault(require("./radio/meta"));
var _meta74 = _interopRequireDefault(require("./range-calendar/meta"));
var _meta75 = _interopRequireDefault(require("./range-picker/meta"));
var _meta76 = _interopRequireDefault(require("./range/meta"));
var _meta77 = _interopRequireDefault(require("./rating/meta"));
var _meta78 = _interopRequireDefault(require("./responsive-grid-cell/meta"));
var _meta79 = _interopRequireDefault(require("./responsive-grid/meta"));
var _meta80 = _interopRequireDefault(require("./rich-text/meta"));
var _meta81 = _interopRequireDefault(require("./search/meta"));
var _meta82 = _interopRequireDefault(require("./select-option/meta"));
var _meta83 = _interopRequireDefault(require("./select/meta"));
var _meta84 = _interopRequireDefault(require("./slider/meta"));
var _meta85 = _interopRequireDefault(require("./slot/meta"));
var _meta86 = _interopRequireDefault(require("./split-button/meta"));
var _meta87 = _interopRequireDefault(require("./step-item/meta"));
var _meta88 = _interopRequireDefault(require("./step/meta"));
var _meta89 = _interopRequireDefault(require("./sub-menu/meta"));
var _meta90 = _interopRequireDefault(require("./sub-nav/meta"));
var _meta91 = _interopRequireDefault(require("./switch/meta"));
var _meta92 = _interopRequireDefault(require("./tab-item/meta"));
var _meta93 = _interopRequireDefault(require("./tab-tab-pane/meta"));
var _meta94 = _interopRequireDefault(require("./tab/meta"));
var _meta95 = _interopRequireDefault(require("./table-column/meta"));
var _meta96 = _interopRequireDefault(require("./table/meta"));
var _meta97 = _interopRequireDefault(require("./tag-closeable/meta"));
var _meta98 = _interopRequireDefault(require("./tag-selectable/meta"));
var _meta99 = _interopRequireDefault(require("./tag/meta"));
var _meta100 = _interopRequireDefault(require("./time-picker/meta"));
var _meta101 = _interopRequireDefault(require("./timeline-item/meta"));
var _meta102 = _interopRequireDefault(require("./timeline/meta"));
var _meta103 = _interopRequireDefault(require("./toast/meta"));
var _meta104 = _interopRequireDefault(require("./tooltip/meta"));
var _meta105 = _interopRequireDefault(require("./transfer/meta"));
var _meta106 = _interopRequireDefault(require("./tree-node/meta"));
var _meta107 = _interopRequireDefault(require("./tree-select/meta"));
var _meta108 = _interopRequireDefault(require("./tree/meta"));
var _meta109 = _interopRequireDefault(require("./typography-text/meta"));
var _meta110 = _interopRequireDefault(require("./typography/meta"));
var _meta111 = _interopRequireDefault(require("./upload-dragger/meta"));
var _meta112 = _interopRequireDefault(require("./upload-list/meta"));
var _meta113 = _interopRequireDefault(require("./upload-selecter/meta"));
var _meta114 = _interopRequireDefault(require("./upload/meta"));
var _meta115 = _interopRequireDefault(require("./video/meta"));
var _meta116 = _interopRequireDefault(require("./week-picker/meta"));
var _meta117 = _interopRequireDefault(require("./year-picker/meta"));
var componentCategorySort = {};
["通用", "导航", "信息输入", "信息展示", "信息反馈", "常用"].reverse().forEach(function (item, index) {
  componentCategorySort[item] = ++index;
});
function generateComponentList(components) {
  var componentList = [{
    title: '常用',
    icon: '',
    children: []
  }, {
    title: '容器',
    icon: '',
    children: []
  }, {
    title: '导航',
    icon: '',
    children: []
  }, {
    title: '内容',
    icon: '',
    children: []
  }, {
    title: 'Feedback 反馈',
    icon: '',
    children: []
  }];
  var groupMap = {
    原子组件: true
  };
  var compGroup = {};
  components.forEach(function (comp) {
    var category = comp.category || '其他';
    if (comp.group && !compGroup[comp.componentName]) {
      compGroup[comp.componentName] = comp.group;
    }
    if (comp.group && !groupMap[comp.group]) {
      groupMap[comp.group] = true;
    }
    var target = componentList.find(function (item) {
      return item.title === category;
    });
    if (!target) {
      target = {
        title: category,
        icon: '',
        children: []
      };
      componentList.push(target);
    }
    if (comp.snippets && comp.snippets.length) {
      target.children.push({
        componentName: comp.componentName,
        title: comp.title || comp.componentName,
        sort: {
          category: target.title,
          group: compGroup[comp.componentName] || '原子组件',
          priority: componentCategorySort[target.title] || 0
        },
        icon: '',
        "package": comp.npm.pkg,
        snippets: comp.snippets || []
      });
    }
  });
  return componentList;
}
function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
  if (packageName === void 0) {
    packageName = '@alilc/lowcode-materials';
  }
  if (version === void 0) {
    version = '1.2.0-beta.9';
  }
  if (basicLibraryVersion === void 0) {
    basicLibraryVersion = {
      "@alifd/next": "1.25.23",
      "@alifd/meet": "2.6.3",
      "antd": "4.17.3"
    };
  }
  if (!meta || !version) {
    return meta;
  }
  var npm = meta.npm;
  if (!npm) {
    return meta;
  }
  if (typeof basicLibraryVersion === 'object' && basicLibraryVersion[npm["package"]]) {
    meta.npm = (0, _extends2["default"])({}, npm, {
      version: basicLibraryVersion[npm["package"]]
    });
  } else if (npm["package"] === packageName) {
    meta.npm = (0, _extends2["default"])({}, npm, {
      version: version
    });
  }
  return meta;
}
var componentMetas = [_meta["default"], _meta2["default"], _meta3["default"], _meta4["default"], _meta5["default"], _meta6["default"], _meta7["default"], _meta8["default"], _meta9["default"], _meta10["default"], _meta11["default"], _meta12["default"], _meta13["default"], _meta14["default"], _meta15["default"], _meta16["default"], _meta17["default"], _meta18["default"], _meta19["default"], _meta20["default"], _meta21["default"], _meta22["default"], _meta23["default"], _meta24["default"], _meta25["default"], _meta26["default"], _meta27["default"], _meta28["default"], _meta29["default"], _meta30["default"], _meta31["default"], _meta32["default"], _meta33["default"], _meta34["default"], _meta35["default"], _meta36["default"], _meta37["default"], _meta38["default"], _meta39["default"], _meta40["default"], _meta41["default"], _meta42["default"], _meta43["default"], _meta44["default"], _meta45["default"], _meta46["default"], _meta47["default"], _meta48["default"], _meta49["default"], _meta50["default"], _meta51["default"], _meta52["default"], _meta53["default"], _meta54["default"], _meta55["default"], _meta56["default"], _meta57["default"], _meta58["default"], _meta59["default"], _meta60["default"], _meta61["default"], _meta62["default"], _meta63["default"], _meta64["default"], _meta65["default"], _meta66["default"], _meta67["default"], _meta68["default"], _meta69["default"], _meta70["default"], _meta71["default"], _meta72["default"], _meta73["default"], _meta74["default"], _meta75["default"], _meta76["default"], _meta77["default"], _meta78["default"], _meta79["default"], _meta80["default"], _meta81["default"], _meta82["default"], _meta83["default"], _meta84["default"], _meta85["default"], _meta86["default"], _meta87["default"], _meta88["default"], _meta89["default"], _meta90["default"], _meta91["default"], _meta92["default"], _meta93["default"], _meta94["default"], _meta95["default"], _meta96["default"], _meta97["default"], _meta98["default"], _meta99["default"], _meta100["default"], _meta101["default"], _meta102["default"], _meta103["default"], _meta104["default"], _meta105["default"], _meta106["default"], _meta107["default"], _meta108["default"], _meta109["default"], _meta110["default"], _meta111["default"], _meta112["default"], _meta113["default"], _meta114["default"], _meta115["default"], _meta116["default"], _meta117["default"]];
var components = [];
exports.components = components;
var npmInfo = {};
componentMetas.forEach(function (meta) {
  if (Array.isArray(meta)) {
    components.push.apply(components, meta.map(function (item) {
      if (!item.npm) {
        var componentName = item.componentName;
        var names = componentName.split('.');
        var exportName = names[0],
          subName = names[1];
        item.npm = {
          exportName: exportName,
          main: '',
          destructuring: true,
          subName: names.length > 1 ? componentName.slice(componentName.indexOf('.') + 1) : subName
        };
      }
      item.npm = (0, _extends2["default"])({}, npmInfo, item.npm || {});
      return fillRealVersion(item);
    }));
  } else if (meta.components) {
    components.push.apply(components, meta.components.map(function (item) {
      if (!item.npm) {
        var componentName = item.componentName;
        var names = componentName.split('.');
        var exportName = names[0],
          subName = names[1];
        item.npm = {
          exportName: exportName,
          main: '',
          destructuring: true,
          subName: names.length > 1 ? componentName.slice(componentName.indexOf('.') + 1) : subName
        };
      }
      item.npm = (0, _extends2["default"])({}, npmInfo, item.npm || {});
      return fillRealVersion(item);
    }));
  } else {
    if (!meta.npm) {
      var componentName = meta.componentName;
      var names = componentName.split('.');
      var exportName = names[0],
        subName = names[1];
      meta.npm = {
        exportName: exportName,
        main: '',
        destructuring: true,
        subName: names.length > 1 ? componentName.slice(componentName.indexOf('.') + 1) : subName
      };
    }
    meta.npm = (0, _extends2["default"])({}, npmInfo, meta.npm || {});
    components.push(fillRealVersion(meta));
  }
});
var componentList = generateComponentList(components);
exports.componentList = componentList;
var execCompile = !!true;
if (!execCompile) {
  window.AlilcLowcodeMaterialsMeta = {
    components: components,
    componentList: componentList
  };
}