import { a as Connection } from './Item-f4cbd6f4.js';

async function open(subset, connection, url) {
    let result;
    switch (subset) {
        case "authorization":
            result = new (await import('./Authorization-422ef77e.js')).Authorization(connection);
            break;
        case "verification":
            result = new (await import('./Verification-6875d5fd.js')).Verification(connection);
            break;
        case "settlement":
            result = new (await import('./Settlement-0a6dfd69.js')).Settlement(connection);
            break;
        case "merchant":
            result = new (await import('./Merchant-cee69257.js')).Merchant(connection);
            break;
        case "card":
            result = new (await import('./Card-91e9d033.js')).Card(connection);
            break;
        case "contact":
            result = new (await import('./Contact-57f6ed73.js')).Contact(connection);
            break;
        case "customer":
            result = new (await import('./Customer-4111111d.js')).Customer(connection);
            break;
        case "order":
            result = new (await import('./Order-eb27c503.js')).Order(connection);
            break;
        case "log":
            result = new (await import('./Log-8f0ed1a6.js')).Log(connection);
            break;
        case "me":
            result = new (await import('./Me-5ff07213.js')).Me(connection);
            break;
    }
    return result;
}

var Client;
(function (Client) {
    let Subset;
    (function (Subset) {
        Subset.acquirer = ["authorization", "merchant", "verification", "settlement"];
        Subset.card = ["card"];
        Subset.log = ["log"];
        Subset.psp = ["order", "customer", "me", "contact"];
        Subset.values = [...Subset.acquirer, ...Subset.card, ...Subset.log, ...Subset.psp];
        function is(value) {
            return typeof value == "string" && Subset.values.includes(value);
        }
        Subset.is = is;
        Subset.open = open;
    })(Subset = Client.Subset || (Client.Subset = {}));
    async function open$1(url, key, ...subset) {
        const connection = Connection.open(url, key);
        return Object.fromEntries(await Promise.all(subset.map(async (m) => [m, await Subset.open(m, connection, url)])));
    }
    Client.open = open$1;
})(Client || (Client = {}));

export { Client as C };
