'use strict';var regexpExecAbstract=require('./regexp-exec-abstract-f1889c3e.js'),normalizeComponent=require('./normalize-component-ebe0c011.js'),wellKnownSymbol=require('./well-known-symbol-d17f132e.js');// @@match logic
regexpExecAbstract.f('match', 1, function (MATCH, nativeMatch, maybeCallNative) {
  return [
    // `String.prototype.match` method
    // https://tc39.es/ecma262/#sec-string.prototype.match
    function match(regexp) {
      var O = wellKnownSymbol.r(this);
      var matcher = regexp == undefined ? undefined : regexp[MATCH];
      return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
    },
    // `RegExp.prototype[@@match]` method
    // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
    function (regexp) {
      var res = maybeCallNative(nativeMatch, regexp, this);
      if (res.done) return res.value;

      var rx = normalizeComponent.a(regexp);
      var S = String(this);

      if (!rx.global) return regexpExecAbstract.r(rx, S);

      var fullUnicode = rx.unicode;
      rx.lastIndex = 0;
      var A = [];
      var n = 0;
      var result;
      while ((result = regexpExecAbstract.r(rx, S)) !== null) {
        var matchStr = String(result[0]);
        A[n] = matchStr;
        if (matchStr === '') rx.lastIndex = regexpExecAbstract.a(S, wellKnownSymbol.a(rx.lastIndex), fullUnicode);
        n++;
      }
      return n === 0 ? null : A;
    }
  ];
});