const require_rolldown_runtime = require('../../../../../../../../../_virtual/rolldown_runtime.js');
const require_async$1 = require('../scheduler/async.js');
const require_isDate$1 = require('../util/isDate.js');
const require_timeout$1 = require('./timeout.js');

//#region ../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/timeoutWith.js
var require_timeoutWith = /* @__PURE__ */ require_rolldown_runtime.__commonJS({ "../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/timeoutWith.js": ((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var async_1 = require_async$1.require_async();
	var isDate_1 = require_isDate$1.require_isDate();
	var timeout_1 = require_timeout$1.require_timeout();
	function timeoutWith(due, withObservable, scheduler) {
		var first;
		var each;
		var _with;
		scheduler = scheduler !== null && scheduler !== void 0 ? scheduler : async_1.async;
		if (isDate_1.isValidDate(due)) first = due;
		else if (typeof due === "number") each = due;
		if (withObservable) _with = function() {
			return withObservable;
		};
		else throw new TypeError("No observable provided to switch to");
		if (first == null && each == null) throw new TypeError("No timeout provided.");
		return timeout_1.timeout({
			first,
			each,
			scheduler,
			with: _with
		});
	}
	exports.timeoutWith = timeoutWith;
}) });

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