Liferay.Loader.define("commerce-frontend-js@3.0.43/components/dataset_display/utilities/filters", ['module', 'exports', 'require'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.isValuesArrayChanged = isValuesArrayChanged;

    /**
     * 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
     */
    function isValuesArrayChanged() {
      var prevValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
      var newValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];

      if (prevValue.length !== newValue.length) {
        return true;
      }

      var prevValues = prevValue.map(function (el) {
        return el.value || el;
      }).sort();
      var newValues = newValue.map(function (el) {
        return el.value || el;
      }).sort();
      var changed = false;
      prevValues.forEach(function (element, i) {
        if (element !== newValues[i]) {
          changed = true;
        }
      });
      return changed;
    }
    //# sourceMappingURL=filters.js.map
  }
});
//# sourceMappingURL=filters.js.map