"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.IterableBackoff = void 0;
class IterableBackoff {
    /**
     * Backoff that returns a number from an iterable.
     */
    constructor(durations) {
        this.durations = durations;
    }
    /**
     * @inheritdoc
     */
    next(_context) {
        return instance(this.durations, 0);
    }
}
exports.IterableBackoff = IterableBackoff;
const instance = (durations, index) => ({
    duration: durations[index],
    next() {
        return index === durations.length - 1 ? this : instance(durations, index + 1);
    },
});//# sourceMappingURL=https://main.vscode-cdn.net/sourcemaps/e7fb5e96c0730b9deb70b33781f98e2f35975036/node_modules/cockatiel/dist/backoff/IterableBackoff.js.map