(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@iotize/tap')) :
    typeof define === 'function' && define.amd ? define('@iotize/tap/ext/config', ['exports', '@iotize/tap'], factory) :
    (global = global || self, factory((global.iotize = global.iotize || {}, global.iotize.tap = global.iotize.tap || {}, global.iotize.tap.ext = global.iotize.tap.ext || {}, global.iotize.tap.ext.config = {}), global.iotize.tap));
}(this, (function (exports, tap) { 'use strict';

    var __read = (this && this.__read) || function (o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i = m.call(o), r, ar = [], e;
        try {
            while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
        }
        catch (error) { e = { error: error }; }
        finally {
            try {
                if (r && !r.done && (m = i["return"])) m.call(i);
            }
            finally { if (e) throw e.error; }
        }
        return ar;
    };
    var __spread = (this && this.__spread) || function () {
        for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
        return ar;
    };
    var TapConfigProvider = /** @class */ (function () {
        function TapConfigProvider() {
            this.config = {
                version: '1.0.0'
            };
        }
        Object.defineProperty(TapConfigProvider.prototype, "bundles", {
            get: function () {
                var _a;
                return ((_a = this.config.data) === null || _a === void 0 ? void 0 : _a.bundles) || [];
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(TapConfigProvider.prototype, "variables", {
            get: function () {
                return this.bundles.reduce(function (p, bundle) {
                    p.push.apply(p, __spread((bundle.variables || [])));
                    return p;
                }, []);
            },
            enumerable: true,
            configurable: true
        });
        return TapConfigProvider;
    }());

    var ɵ0 = function (context) {
        return new TapConfigProvider();
    };
    var _TAP_EXTENSION_CONFIG_ = tap.defineTapPropertyExtension('config', ɵ0);

    exports._TAP_EXTENSION_CONFIG_ = _TAP_EXTENSION_CONFIG_;

    Object.defineProperty(exports, '__esModule', { value: true });

})));
//# sourceMappingURL=iotize-tap-ext-config.umd.js.map
