"use strict";
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
Object.defineProperty(exports, "__esModule", { value: true });
exports.ContinuationTokenManagerFactory = void 0;
const ParallelQueryContinuationTokenManager_js_1 = require("./ParallelQueryContinuationTokenManager.js");
const OrderByQueryContinuationTokenManager_js_1 = require("./OrderByQueryContinuationTokenManager.js");
/**
 * Factory for creating appropriate continuation token managers based on query type.
 * @internal
 */
exports.ContinuationTokenManagerFactory = {
    /**
     * Creates the appropriate continuation token manager based on query type.
     * Only call this for queries that support continuation tokens.
     * @param collectionLink - Collection link/RID
     * @param initialContinuationToken - Optional initial continuation token
     * @param isOrderByQuery - Whether this is an ORDER BY query
     * @returns Appropriate continuation token manager instance
     * @internal
     */
    create(collectionLink, initialContinuationToken, isOrderByQuery = false) {
        if (isOrderByQuery) {
            return new OrderByQueryContinuationTokenManager_js_1.OrderByQueryContinuationTokenManager(collectionLink, initialContinuationToken);
        }
        else {
            return new ParallelQueryContinuationTokenManager_js_1.ParallelQueryContinuationTokenManager(collectionLink, initialContinuationToken);
        }
    },
};
//# sourceMappingURL=ContinuationTokenManagerFactory.js.map