/**
 * This file is part of the NocoBase (R) project.
 * Copyright (c) 2020-2024 NocoBase Co., Ltd.
 * Authors: NocoBase Team.
 *
 * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
 * For more information, please refer to: https://www.nocobase.com/agreement.
 */

var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var catalog_specs_exports = {};
__export(catalog_specs_exports, {
  APPROVAL_ACTION_CATALOG_SPECS: () => APPROVAL_ACTION_CATALOG_SPECS,
  APPROVAL_ACTION_OWNER_PLUGIN_BY_USE: () => APPROVAL_ACTION_OWNER_PLUGIN_BY_USE,
  APPROVAL_ACTION_PUBLIC_KEYS: () => APPROVAL_ACTION_PUBLIC_KEYS,
  APPROVAL_BLOCK_CATALOG_SPECS: () => APPROVAL_BLOCK_CATALOG_SPECS,
  APPROVAL_BLOCK_OWNER_PLUGIN_BY_USE: () => APPROVAL_BLOCK_OWNER_PLUGIN_BY_USE,
  APPROVAL_BLOCK_PUBLIC_KEYS: () => APPROVAL_BLOCK_PUBLIC_KEYS,
  APPROVAL_FLOW_SURFACE_OWNER_PLUGIN: () => APPROVAL_FLOW_SURFACE_OWNER_PLUGIN
});
module.exports = __toCommonJS(catalog_specs_exports);
const APPROVAL_FLOW_SURFACE_OWNER_PLUGIN = "@nocobase/plugin-workflow-approval";
const APPROVAL_BLOCK_CATALOG_SPECS = [
  {
    key: "approvalInitiator",
    label: "Approval initiator",
    use: "ApplyFormModel",
    requiredInitParams: ["dataSourceKey", "collectionName"],
    allowedContainerUses: ["TriggerBlockGridModel"],
    createSupported: true
  },
  {
    key: "approvalApprover",
    label: "Approval approver",
    use: "ProcessFormModel",
    requiredInitParams: ["dataSourceKey", "collectionName"],
    allowedContainerUses: ["ApprovalBlockGridModel"],
    createSupported: true
  },
  {
    key: "approvalInformation",
    label: "Approval information",
    use: "ApprovalDetailsModel",
    requiredInitParams: ["dataSourceKey", "collectionName"],
    allowedContainerUses: ["ApprovalBlockGridModel"],
    createSupported: true
  }
];
const APPROVAL_ACTION_CATALOG_SPECS = [
  {
    publicKey: "approvalSubmit",
    label: "Submit",
    scope: "form",
    scene: "form",
    use: "ApplyFormSubmitModel",
    allowedContainerUses: ["ApplyFormModel"],
    createSupported: true
  },
  {
    publicKey: "approvalSaveDraft",
    label: "Save draft",
    scope: "form",
    scene: "form",
    use: "ApplyFormSaveDraftModel",
    allowedContainerUses: ["ApplyFormModel"],
    createSupported: true
  },
  {
    publicKey: "approvalWithdraw",
    label: "Withdraw",
    scope: "form",
    scene: "form",
    use: "ApplyFormWithdrawModel",
    allowedContainerUses: ["ApplyFormModel"],
    createSupported: true
  },
  {
    publicKey: "approvalApprove",
    label: "Approve",
    scope: "form",
    scene: "form",
    use: "ProcessFormApproveModel",
    allowedContainerUses: ["ProcessFormModel"],
    createSupported: true
  },
  {
    publicKey: "approvalReject",
    label: "Reject",
    scope: "form",
    scene: "form",
    use: "ProcessFormRejectModel",
    allowedContainerUses: ["ProcessFormModel"],
    createSupported: true
  },
  {
    publicKey: "approvalReturn",
    label: "Return",
    scope: "form",
    scene: "form",
    use: "ProcessFormReturnModel",
    allowedContainerUses: ["ProcessFormModel"],
    createSupported: true
  },
  {
    publicKey: "approvalDelegate",
    label: "Delegate",
    scope: "form",
    scene: "form",
    use: "ProcessFormDelegateModel",
    allowedContainerUses: ["ProcessFormModel"],
    createSupported: true
  },
  {
    publicKey: "approvalAddAssignee",
    label: "Add assignee",
    scope: "form",
    scene: "form",
    use: "ProcessFormAddAssigneeModel",
    allowedContainerUses: ["ProcessFormModel"],
    createSupported: true
  }
];
const APPROVAL_BLOCK_PUBLIC_KEYS = APPROVAL_BLOCK_CATALOG_SPECS.map((item) => item.key);
const APPROVAL_ACTION_PUBLIC_KEYS = APPROVAL_ACTION_CATALOG_SPECS.map((item) => item.publicKey);
const APPROVAL_BLOCK_OWNER_PLUGIN_BY_USE = new Map(
  APPROVAL_BLOCK_CATALOG_SPECS.map((item) => [item.use, APPROVAL_FLOW_SURFACE_OWNER_PLUGIN])
);
const APPROVAL_ACTION_OWNER_PLUGIN_BY_USE = new Map(
  APPROVAL_ACTION_CATALOG_SPECS.map((item) => [item.use, APPROVAL_FLOW_SURFACE_OWNER_PLUGIN])
);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  APPROVAL_ACTION_CATALOG_SPECS,
  APPROVAL_ACTION_OWNER_PLUGIN_BY_USE,
  APPROVAL_ACTION_PUBLIC_KEYS,
  APPROVAL_BLOCK_CATALOG_SPECS,
  APPROVAL_BLOCK_OWNER_PLUGIN_BY_USE,
  APPROVAL_BLOCK_PUBLIC_KEYS,
  APPROVAL_FLOW_SURFACE_OWNER_PLUGIN
});
