const require_rolldown_runtime = require('../../../../../../../../../_virtual/rolldown_runtime.js');
const require_Observable$1 = require('../Observable.js');
const require_OperatorSubscriber$1 = require('../operators/OperatorSubscriber.js');
const require_args$1 = require('../util/args.js');
const require_innerFrom$1 = require('./innerFrom.js');
const require_mapOneOrManyArgs$1 = require('../util/mapOneOrManyArgs.js');
const require_argsArgArrayOrObject$1 = require('../util/argsArgArrayOrObject.js');
const require_createObject$1 = require('../util/createObject.js');

//#region ../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/forkJoin.js
var require_forkJoin = /* @__PURE__ */ require_rolldown_runtime.__commonJS({ "../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/forkJoin.js": ((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var Observable_1 = require_Observable$1.require_Observable();
	var argsArgArrayOrObject_1 = require_argsArgArrayOrObject$1.require_argsArgArrayOrObject();
	var innerFrom_1 = require_innerFrom$1.require_innerFrom();
	var args_1 = require_args$1.require_args();
	var OperatorSubscriber_1 = require_OperatorSubscriber$1.require_OperatorSubscriber();
	var mapOneOrManyArgs_1 = require_mapOneOrManyArgs$1.require_mapOneOrManyArgs();
	var createObject_1 = require_createObject$1.require_createObject();
	function forkJoin() {
		var args = [];
		for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
		var resultSelector = args_1.popResultSelector(args);
		var _a = argsArgArrayOrObject_1.argsArgArrayOrObject(args), sources = _a.args, keys = _a.keys;
		var result = new Observable_1.Observable(function(subscriber) {
			var length = sources.length;
			if (!length) {
				subscriber.complete();
				return;
			}
			var values = new Array(length);
			var remainingCompletions = length;
			var remainingEmissions = length;
			var _loop_1 = function(sourceIndex$1) {
				var hasValue = false;
				innerFrom_1.innerFrom(sources[sourceIndex$1]).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
					if (!hasValue) {
						hasValue = true;
						remainingEmissions--;
					}
					values[sourceIndex$1] = value;
				}, function() {
					return remainingCompletions--;
				}, void 0, function() {
					if (!remainingCompletions || !hasValue) {
						if (!remainingEmissions) subscriber.next(keys ? createObject_1.createObject(keys, values) : values);
						subscriber.complete();
					}
				}));
			};
			for (var sourceIndex = 0; sourceIndex < length; sourceIndex++) _loop_1(sourceIndex);
		});
		return resultSelector ? result.pipe(mapOneOrManyArgs_1.mapOneOrManyArgs(resultSelector)) : result;
	}
	exports.forkJoin = forkJoin;
}) });

//#endregion
Object.defineProperty(exports, 'default', {
  enumerable: true,
  get: function () {
    return require_forkJoin();
  }
});