"use strict";

exports.__esModule = true;
exports.VideoMade = exports.TupleOriginType = exports.PageLoadingMode = exports.PageDisplayEnum = exports.DefaultInputType = exports.DataSourceType = exports.BackgroundSize = void 0;
exports.getAlterRelationList = getAlterRelationList;
exports.getConditionRenderList = getConditionRenderList;
exports.getCustomStateTypeRelationList = getCustomStateTypeRelationList;
exports.getDefaultTypeRelationList = getDefaultTypeRelationList;
exports.getDictionaryList = getDictionaryList;
exports.getFormDefaultList = getFormDefaultList;
exports.getLogicReturnOption = getLogicReturnOption;
exports.getLogicSelectList = getLogicSelectList;
exports.getLoopDataRelationList = getLoopDataRelationList;
exports.getRelationList = getRelationList;
exports.getRelationOptionListByKeys = getRelationOptionListByKeys;
exports.getTupleTypeRelationList = getTupleTypeRelationList;
exports.refreshType = void 0;
var _type = require("./logicRenderService/type");
var _index = require("../../src/locale/index");
/**
 * 后期这里需要重新规划处理
 *
 * 当前页面:应该包含state的全部数据，所以自定义属性也属于其中
 * 固定值:固定值需要处理，字符串，数组，对象，布尔等数据
 * 地址栏:地址栏
 * 数据源：包含了接口，合约等数据
 * 当前用户地址：当前用户地址，后期会扩展到当前钱包信息
 * 循环数据：主要是loop数据源循环
 */
var DataSourceType = exports.DataSourceType = /*#__PURE__*/function (DataSourceType) {
  DataSourceType[DataSourceType["currentPageType"] = 1] = "currentPageType";
  DataSourceType[DataSourceType["defaultType"] = 2] = "defaultType";
  DataSourceType[DataSourceType["locationType"] = 3] = "locationType";
  DataSourceType[DataSourceType["requestType"] = 4] = "requestType";
  DataSourceType[DataSourceType["computeType"] = 5] = "computeType";
  DataSourceType[DataSourceType["dataSourceType"] = 6] = "dataSourceType";
  DataSourceType[DataSourceType["pactFunctionType"] = 7] = "pactFunctionType";
  DataSourceType[DataSourceType["currentWalletConnectType"] = 8] = "currentWalletConnectType";
  DataSourceType[DataSourceType["customStateType"] = 9] = "customStateType";
  DataSourceType[DataSourceType["loopDataType"] = 10] = "loopDataType";
  DataSourceType[DataSourceType["tupleType"] = 11] = "tupleType";
  DataSourceType[DataSourceType["materielType"] = 12] = "materielType";
  DataSourceType[DataSourceType["modalDialogType"] = 13] = "modalDialogType";
  DataSourceType[DataSourceType["dictionaryType"] = 14] = "dictionaryType";
  DataSourceType[DataSourceType["engineRuleType"] = 15] = "engineRuleType";
  DataSourceType[DataSourceType["loopDataSelectedType"] = 16] = "loopDataSelectedType";
  DataSourceType[DataSourceType["loopCustomDataType"] = 17] = "loopCustomDataType";
  DataSourceType[DataSourceType["storageDataType"] = 18] = "storageDataType";
  DataSourceType[DataSourceType["renderPropsDataType"] = 19] = "renderPropsDataType";
  return DataSourceType;
}({});
function getRelationList() {
  return [{
    label: (0, _index.t)("setter.currentPageType"),
    value: DataSourceType.currentPageType
  }, {
    label: (0, _index.t)("setter.defaultType"),
    value: DataSourceType.defaultType
  }, {
    label: (0, _index.t)("setter.urlType"),
    value: DataSourceType.locationType
  }, {
    label: (0, _index.t)("setter.dataSourceType"),
    value: DataSourceType.dataSourceType
  }, {
    label: (0, _index.t)("setter.currentWalletConnectType"),
    value: DataSourceType.currentWalletConnectType
  }, {
    label: (0, _index.t)("setter.customStateType"),
    value: DataSourceType.customStateType
  }, {
    label: (0, _index.t)("setter.loopDataType"),
    value: DataSourceType.loopDataType
  }, {
    label: (0, _index.t)("setter.loopDataSelectedType"),
    value: DataSourceType.loopDataSelectedType
  }, {
    label: (0, _index.t)("setter.modalDialogType"),
    value: DataSourceType.modalDialogType
  }, {
    label: (0, _index.t)("setter.engineRuleType"),
    value: DataSourceType.engineRuleType
  }, {
    label: (0, _index.t)("setter.saveTypeLocal"),
    value: DataSourceType.storageDataType
  }, {
    label: (0, _index.t)("setter.renderPropsDataType"),
    value: DataSourceType.renderPropsDataType
  }];
}
function getTupleTypeRelationList() {
  return [{
    label: (0, _index.t)("setter.tupleType"),
    value: DataSourceType.tupleType
  }];
}
function getCustomStateTypeRelationList() {
  return getRelationOptionListByKeys([DataSourceType.customStateType]);
}
function getAlterRelationList() {
  return getRelationOptionListByKeys([DataSourceType.currentPageType, DataSourceType.customStateType]);
}
function getLoopDataRelationList() {
  var data = getRelationOptionListByKeys([DataSourceType.dataSourceType, DataSourceType.loopDataType]);
  data = data.concat([{
    label: (0, _index.t)("setter.loopCustomDataType"),
    value: DataSourceType.loopCustomDataType
  }]);
  return data;
}
function getDefaultTypeRelationList() {
  return getRelationOptionListByKeys([DataSourceType.defaultType]);
}
function getRelationOptionListByKeys(keys) {
  var base = getRelationList();
  return base.filter(function (item) {
    return keys.includes(item.value);
  });
}

/**
 * 字典选项
 * @returns
 */
function getDictionaryList() {
  return [{
    label: (0, _index.t)("setter.dictionaryType"),
    value: DataSourceType.dictionaryType
  }];
}
function getConditionRenderList() {
  return getRelationList();
}
function getLogicSelectList() {
  return [{
    label: "if",
    value: _type.SelectLogicType.IF
  }, {
    label: "else_if",
    value: _type.SelectLogicType.ELSEIF
  }, {
    label: "else",
    value: _type.SelectLogicType.ElSE
  }];
}
function getLogicReturnOption() {
  return [{
    label: "返回值",
    value: _type.ReturnType.RETURN_CONFIG
  }, {
    label: "子逻辑",
    value: _type.ReturnType.RETURN_LOGIC
  }];
}
function getFormDefaultList() {
  return [{
    label: (0, _index.t)("setter.defaultType"),
    value: DataSourceType.defaultType
  }, {
    label: (0, _index.t)("setter.urlType"),
    value: DataSourceType.locationType
  }, {
    label: "接口返回",
    value: DataSourceType.requestType
  }, {
    label: "计算结果",
    value: DataSourceType.computeType
  }];
}
var refreshType = exports.refreshType = /*#__PURE__*/function (refreshType) {
  refreshType["refreshPage"] = "window_location_reload";
  refreshType["refreshBaseInfo"] = "refresh_base_info";
  return refreshType;
}({});
/**
 * 固定值的输入类型
 */
var DefaultInputType = exports.DefaultInputType = /*#__PURE__*/function (DefaultInputType) {
  DefaultInputType["input"] = "input";
  DefaultInputType["select"] = "select";
  DefaultInputType["boolean"] = "boolean";
  return DefaultInputType;
}({});
var PageDisplayEnum = exports.PageDisplayEnum = /*#__PURE__*/function (PageDisplayEnum) {
  PageDisplayEnum["ByRatio"] = "byRatio";
  PageDisplayEnum["Normal"] = "normal";
  return PageDisplayEnum;
}({});
var PageLoadingMode = exports.PageLoadingMode = /*#__PURE__*/function (PageLoadingMode) {
  PageLoadingMode["LevelByLevel"] = "LevelByLevel";
  PageLoadingMode["All"] = "All";
  PageLoadingMode["Level1"] = "Level1";
  return PageLoadingMode;
}({});
var BackgroundSize = exports.BackgroundSize = /*#__PURE__*/function (BackgroundSize) {
  BackgroundSize["Contain"] = "Contain";
  BackgroundSize["Cover"] = "cover";
  return BackgroundSize;
}({});
var VideoMade = exports.VideoMade = /*#__PURE__*/function (VideoMade) {
  VideoMade["Video"] = "video";
  VideoMade["VideoFrames"] = "videoframes";
  return VideoMade;
}({});
var TupleOriginType = exports.TupleOriginType = /*#__PURE__*/function (TupleOriginType) {
  TupleOriginType["default"] = "default";
  TupleOriginType["customData"] = "customData";
  return TupleOriginType;
}({});