const require_rolldown_runtime = require('../../../../../../../../../_virtual/rolldown_runtime.js');
const require_isFunction$1 = require('../util/isFunction.js');
const require_Observable$1 = require('../Observable.js');
const require_mapOneOrManyArgs$1 = require('../util/mapOneOrManyArgs.js');

//#region ../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/fromEventPattern.js
var require_fromEventPattern = /* @__PURE__ */ require_rolldown_runtime.__commonJS({ "../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/observable/fromEventPattern.js": ((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var Observable_1 = require_Observable$1.require_Observable();
	var isFunction_1 = require_isFunction$1.require_isFunction();
	var mapOneOrManyArgs_1 = require_mapOneOrManyArgs$1.require_mapOneOrManyArgs();
	function fromEventPattern(addHandler, removeHandler, resultSelector) {
		if (resultSelector) return fromEventPattern(addHandler, removeHandler).pipe(mapOneOrManyArgs_1.mapOneOrManyArgs(resultSelector));
		return new Observable_1.Observable(function(subscriber) {
			var handler = function() {
				var e = [];
				for (var _i = 0; _i < arguments.length; _i++) e[_i] = arguments[_i];
				return subscriber.next(e.length === 1 ? e[0] : e);
			};
			var retValue = addHandler(handler);
			return isFunction_1.isFunction(removeHandler) ? function() {
				return removeHandler(handler, retValue);
			} : void 0;
		});
	}
	exports.fromEventPattern = fromEventPattern;
}) });

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