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WY,IAAI,CAAET,EAAYQ,GAC7BrB,EAAO,GAAKe,EAAWf,EAC3B,EAAGuB,KAAAA,EAAWA,KAAAA,EAAW,WACfX,CAAAA,MAAAA,EAA6D,KAAK,EAAIA,EAAkBY,MAAM,GAChGZ,MAAAA,GAAsEA,EAAkBK,WAAW,GAEvGJ,EAAY,IAChB,IACA,GAASE,EAAWhB,MAAAA,EAAiB,iBAAOA,EAAqBA,EAAQ,CAACA,EAAQO,EAAUmB,GAAG,GAAMzB,EACzG,EACJ,CACA,SAASI,EAAoBZ,CAAI,EAC7B,MAAM,IAAIF,EAAaE,EAC3B,C","sources":["webpack://@affine/web/../../../node_modules/rxjs/dist/esm5/internal/operators/timeout.js"],"sourcesContent":["import { asyncScheduler } from '../scheduler/async';\nimport { isValidDate } from '../util/isDate';\nimport { operate } from '../util/lift';\nimport { innerFrom } from '../observable/innerFrom';\nimport { createErrorClass } from '../util/createErrorClass';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { executeSchedule } from '../util/executeSchedule';\nexport var TimeoutError = createErrorClass(function (_super) {\n return function TimeoutErrorImpl(info) {\n if (info === void 0) { info = null; }\n _super(this);\n this.message = 'Timeout has occurred';\n this.name = 'TimeoutError';\n this.info = info;\n };\n});\nexport function timeout(config, schedulerArg) {\n var _a = (isValidDate(config) ? { first: config } : typeof config === 'number' ? { each: config } : config), first = _a.first, each = _a.each, _b = _a.with, _with = _b === void 0 ? timeoutErrorFactory : _b, _c = _a.scheduler, scheduler = _c === void 0 ? schedulerArg !== null && schedulerArg !== void 0 ? schedulerArg : asyncScheduler : _c, _d = _a.meta, meta = _d === void 0 ? null : _d;\n if (first == null && each == null) {\n throw new TypeError('No timeout provided.');\n }\n return operate(function (source, subscriber) {\n var originalSourceSubscription;\n var timerSubscription;\n var lastValue = null;\n var seen = 0;\n var startTimer = function (delay) {\n timerSubscription = executeSchedule(subscriber, scheduler, function () {\n try {\n originalSourceSubscription.unsubscribe();\n innerFrom(_with({\n meta: meta,\n lastValue: lastValue,\n seen: seen,\n })).subscribe(subscriber);\n }\n catch (err) {\n subscriber.error(err);\n }\n }, delay);\n };\n originalSourceSubscription = source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n timerSubscription === null || timerSubscription === void 0 ? void 0 : timerSubscription.unsubscribe();\n seen++;\n subscriber.next((lastValue = value));\n each > 0 && startTimer(each);\n }, undefined, undefined, function () {\n if (!(timerSubscription === null || timerSubscription === void 0 ? void 0 : timerSubscription.closed)) {\n timerSubscription === null || timerSubscription === void 0 ? void 0 : timerSubscription.unsubscribe();\n }\n lastValue = null;\n }));\n !seen && startTimer(first != null ? (typeof first === 'number' ? first : +first - scheduler.now()) : each);\n });\n}\nfunction timeoutErrorFactory(info) {\n throw new TimeoutError(info);\n}\n//# sourceMappingURL=timeout.js.map"],"names":["TimeoutError","_super","info","message","name","timeout","config","schedulerArg","_a","first","each","_b","with","_with","timeoutErrorFactory","_c","scheduler","_d","meta","source","subscriber","originalSourceSubscription","timerSubscription","lastValue","seen","startTimer","delay","unsubscribe","subscribe","err","error","value","next","undefined","closed","now"],"sourceRoot":""}