Liferay.Loader.define("layout-content-page-editor-web@2.0.166/page_editor/app/utils/getResponsiveColumnSize", ['module', 'exports', 'require', '../config/constants/viewportSizes'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.getResponsiveColumnSize = getResponsiveColumnSize;

    var _viewportSizes = require("../config/constants/viewportSizes");

    /**
     * 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
     */
    var ORDERED_VIEWPORT_SIZES = [_viewportSizes.VIEWPORT_SIZES.desktop, _viewportSizes.VIEWPORT_SIZES.tablet, _viewportSizes.VIEWPORT_SIZES.landscapeMobile, _viewportSizes.VIEWPORT_SIZES.portraitMobile];

    function getResponsiveColumnSize(config, viewportSize) {

      var newViewportSize = function getViewportSize(config, viewportSize) {
        var viewportSizePosition = ORDERED_VIEWPORT_SIZES.indexOf(viewportSize);

        if (viewportSize === _viewportSizes.VIEWPORT_SIZES.desktop || viewportSizePosition === -1) {
          return _viewportSizes.VIEWPORT_SIZES.desktop;
        }

        return config[viewportSize] && config[viewportSize].size ? viewportSize : getViewportSize(config, ORDERED_VIEWPORT_SIZES[viewportSizePosition - 1]);
      }(config, viewportSize);
      return config[newViewportSize] ? config[newViewportSize].size : config.size;
    }
    //# sourceMappingURL=getResponsiveColumnSize.js.map
  }
});
//# sourceMappingURL=getResponsiveColumnSize.js.map