import { I as Identifier, S as Settlement$1, C as Connection } from './index.js';

class Settlement {
    constructor(connection) {
        this.connection = connection;
    }
    async list(date, days) {
        return await this.connection.get("settlement" +
            (date && days ? `?date=${date}&days=${days}` : date ? `?date=${date}` : days ? `?days=${days}` : ""));
    }
    async report(settlements, language) {
        return this.connection.post(`settlement/report?language=${language}`, settlements);
    }
    async load(id) {
        return Identifier.is(id)
            ? await this.connection.get("settlement/" + id)
            : (await Promise.all(id.map(i => this.connection.get("settlement/" + i)))).filter(Settlement$1.is);
    }
    static open(url, token) {
        const connection = Connection.open(url, token);
        return connection && new Settlement(connection);
    }
}

export { Settlement };
