'use strict';

var _commonjsHelpers = require('../../_virtual/_commonjsHelpers.js');
var parser = require('./lib/parser.js');
var domBufferstream = require('./lib/dom-bufferstream.js');
var bufferstream = require('./lib/bufferstream.js');

var Parser = parser.parser;

function getGlobal() {
	return (0, eval)('this');
}

var exifParser = {
	create: function(buffer, global) {
		global = global || getGlobal();
		if(buffer instanceof global.ArrayBuffer) {
			var DOMBufferStream = domBufferstream.__require();
			return new Parser(new DOMBufferStream(buffer, 0, buffer.byteLength, true, global));
		} else {
			var NodeBufferStream = bufferstream.__require();
			return new Parser(new NodeBufferStream(buffer, 0, buffer.length, true));
		}
	}
};

var EXIFParser = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(exifParser);

module.exports = EXIFParser;
