{"ast":null,"code":"import _toConsumableArray from \"C:/Users/lucas.hsilva/Desktop/Nome_do_projeto/thf2/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\";\nimport { Observable } from '../Observable';\nimport { innerFrom } from './innerFrom';\nimport { argsOrArgArray } from '../util/argsOrArgArray';\nimport { EMPTY } from './empty';\nimport { createOperatorSubscriber } from '../operators/OperatorSubscriber';\nimport { popResultSelector } from '../util/args';\nexport function zip() {\n  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n    args[_key] = arguments[_key];\n  }\n  var resultSelector = popResultSelector(args);\n  var sources = argsOrArgArray(args);\n  return sources.length ? new Observable(function (subscriber) {\n    var buffers = sources.map(function () {\n      return [];\n    });\n    var completed = sources.map(function () {\n      return false;\n    });\n    subscriber.add(function () {\n      buffers = completed = null;\n    });\n    var _loop = function _loop(sourceIndex) {\n      innerFrom(sources[sourceIndex]).subscribe(createOperatorSubscriber(subscriber, function (value) {\n        buffers[sourceIndex].push(value);\n        if (buffers.every(function (buffer) {\n          return buffer.length;\n        })) {\n          var result = buffers.map(function (buffer) {\n            return buffer.shift();\n          });\n          subscriber.next(resultSelector ? resultSelector.apply(void 0, _toConsumableArray(result)) : result);\n          if (buffers.some(function (buffer, i) {\n            return !buffer.length && completed[i];\n          })) {\n            subscriber.complete();\n          }\n        }\n      }, function () {\n        completed[sourceIndex] = true;\n        !buffers[sourceIndex].length && subscriber.complete();\n      }));\n    };\n    for (var sourceIndex = 0; !subscriber.closed && sourceIndex < sources.length; sourceIndex++) {\n      _loop(sourceIndex);\n    }\n    return function () {\n      buffers = completed = null;\n    };\n  }) : EMPTY;\n}\n//# sourceMappingURL=zip.js.map","map":null,"metadata":{},"sourceType":"module","externalDependencies":[]}