Liferay.Loader.define("layout-admin-web@4.0.131/js/CustomizationSettingsActionDropdownPropsTransformer", ['module', 'exports', 'require'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.default = propsTransformer;

    function ownKeys(object, enumerableOnly) {
      var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {
          return Object.getOwnPropertyDescriptor(object, sym).enumerable;
        });keys.push.apply(keys, symbols);
      }return keys;
    }

    function _objectSpread(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {
          ownKeys(Object(source), true).forEach(function (key) {
            _defineProperty(target, key, source[key]);
          });
        } else if (Object.getOwnPropertyDescriptors) {
          Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
        } else {
          ownKeys(Object(source)).forEach(function (key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
          });
        }
      }return target;
    }

    function _defineProperty(obj, key, value) {
      if (key in obj) {
        Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
      } else {
        obj[key] = value;
      }return obj;
    }

    function _objectWithoutProperties(source, excluded) {
      if (source == null) return {};var target = _objectWithoutPropertiesLoose(source, excluded);var key, i;if (Object.getOwnPropertySymbols) {
        var sourceSymbolKeys = Object.getOwnPropertySymbols(source);for (i = 0; i < sourceSymbolKeys.length; i++) {
          key = sourceSymbolKeys[i];if (excluded.indexOf(key) >= 0) continue;if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;target[key] = source[key];
        }
      }return target;
    }

    function _objectWithoutPropertiesLoose(source, excluded) {
      if (source == null) return {};var target = {};var sourceKeys = Object.keys(source);var key, i;for (i = 0; i < sourceKeys.length; i++) {
        key = sourceKeys[i];if (excluded.indexOf(key) >= 0) continue;target[key] = source[key];
      }return target;
    }

    /**
     * SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
     * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
     */

    /**
     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
     *
     * This library is free software; you can redistribute it and/or modify it under
     * the terms of the GNU Lesser General Public License as published by the Free
     * Software Foundation; either version 2.1 of the License, or (at your option)
     * any later version.
     *
     * This library is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
     * details.
     */
    var ACTIONS = {
      resetCustomizationView: function resetCustomizationView(itemData) {
        if (confirm(Liferay.Language.get('are-you-sure-you-want-to-reset-your-customizations-to-default'))) {
          submitForm(document.hrefFm, itemData.resetCustomizationViewURL);
        }
      },
      toggleCustomizedViewMessage: function toggleCustomizedViewMessage(itemData) {
        submitForm(document.hrefFm, itemData.toggleCustomizedViewMessageURL);
      }
    };

    function propsTransformer(_ref) {
      var actions = _ref.actions,
          items = _ref.items,
          props = _objectWithoutProperties(_ref, ["actions", "items"]);

      var updateItem = function updateItem(item) {
        var newItem = _objectSpread(_objectSpread({}, item), {}, {
          onClick: function onClick(event) {
            var _item$data;

            var action = (_item$data = item.data) === null || _item$data === void 0 ? void 0 : _item$data.action;

            if (action) {
              var _ACTIONS$action;

              event.preventDefault();
              (_ACTIONS$action = ACTIONS[action]) === null || _ACTIONS$action === void 0 ? void 0 : _ACTIONS$action.call(ACTIONS, item.data);
            }
          }
        });

        if (Array.isArray(item.items)) {
          newItem.items = item.items.map(updateItem);
        }

        return newItem;
      };

      return _objectSpread(_objectSpread({}, props), {}, {
        actions: actions === null || actions === void 0 ? void 0 : actions.map(updateItem),
        items: items === null || items === void 0 ? void 0 : items.map(updateItem)
      });
    }
    //# sourceMappingURL=CustomizationSettingsActionDropdownPropsTransformer.js.map
  }
});
//# sourceMappingURL=CustomizationSettingsActionDropdownPropsTransformer.js.map