Liferay.Loader.define("dynamic-data-mapping-form-field-type@5.0.83/util/strings.es", ['module', 'exports', 'require'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.sub = sub;
    exports.subWords = subWords;
    exports.capitalize = void 0;

    /**
     * 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 capitalize = function capitalize(text) {
      return text.charAt(0).toUpperCase() + text.slice(1);
    };

    exports.capitalize = capitalize;
    var SPLIT_REGEX = /({\d+})/g;
    var SPLIT_WORDS_REGEX = /({\w+})/g;

    function sub(langKey, args) {
      var keyArray = langKey.split(SPLIT_REGEX).filter(function (val) {
        return val.length !== 0;
      });

      for (var i = 0; i < args.length; i++) {
        var arg = args[i];
        var indexKey = "{".concat(i, "}");
        var argIndex = keyArray.indexOf(indexKey);

        while (argIndex >= 0) {
          keyArray.splice(argIndex, 1, arg);
          argIndex = keyArray.indexOf(indexKey);
        }
      }

      return keyArray.join('');
    }

    function subWords(langKey, args) {
      var keyArray = langKey.split(SPLIT_WORDS_REGEX).filter(function (val) {
        return val.length !== 0;
      });
      Object.keys(args).forEach(function (arg) {
        var indexKey = "{".concat(arg, "}");
        var argIndex = keyArray.indexOf(indexKey);

        while (argIndex >= 0) {
          keyArray.splice(argIndex, 1, args[arg]);
          argIndex = keyArray.indexOf(indexKey);
        }
      });
      return keyArray.join('');
    }
    //# sourceMappingURL=strings.es.js.map
  }
});
//# sourceMappingURL=strings.es.js.map