import { registerLoaders } from '@loaders.gl/core';
import { ImageLoader } from '@loaders.gl/images';
import log from '../utils/log';
import { register } from '../debug';
import jsonLoader from '../utils/json-loader';

function checkVersion() {
  const version = typeof "9.0.0-beta.1" !== 'undefined' ? "9.0.0-beta.1" : globalThis.DECK_VERSION || 'untranspiled source';
  const existingVersion = globalThis.deck && globalThis.deck.VERSION;

  if (existingVersion && existingVersion !== version) {
    throw new Error(`deck.gl - multiple versions detected: ${existingVersion} vs ${version}`);
  }

  if (!existingVersion) {
    log.log(1, `deck.gl ${version}`)();
    globalThis.deck = { ...globalThis.deck,
      VERSION: version,
      version,
      log,
      _registerLoggers: register
    };
    registerLoaders([jsonLoader, [ImageLoader, {
      imagebitmap: {
        premultiplyAlpha: 'none'
      }
    }]]);
  }

  return version;
}

export const VERSION = checkVersion();
//# sourceMappingURL=init.js.map