// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright vis.gl contributors
import { parseI3STileContent } from "./lib/parsers/parse-i3s-tile-content.js";
// __VERSION__ is injected by babel-plugin-version-inline
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
const VERSION = typeof "4.4.2" !== 'undefined' ? "4.4.2" : 'latest';
/**
 * Loader for I3S - Indexed 3D Scene Layer
 */
export const I3SContentLoader = {
    dataType: null,
    batchType: null,
    name: 'I3S Content (Indexed Scene Layers)',
    id: 'i3s-content',
    module: 'i3s',
    worker: true,
    version: VERSION,
    mimeTypes: ['application/octet-stream'],
    parse,
    extensions: ['bin'],
    options: {
        'i3s-content': {}
    }
};
async function parse(data, options, context) {
    const { tile, _tileOptions, tileset, _tilesetOptions } = options?.i3s || {};
    const tileOptions = _tileOptions || tile;
    const tilesetOptions = _tilesetOptions || tileset;
    if (!tileOptions || !tilesetOptions) {
        return null;
    }
    return await parseI3STileContent(data, tileOptions, tilesetOptions, options, context);
}
//# sourceMappingURL=i3s-content-loader.js.map