/** Copyright (C) 2020-2025 Kedron Holdings LLC, All Rights Reserved. This file is part of Reactor.
 *  For info and license terms please see https://reactor.toggledbits.com/
 *  ------------------------------------------------------------------------------
*/
const a4_0x4edc9 = a4_0x5565;
function a4_0x5565(_0x117820, _0x1ae824) {
    const _0x2b12b6 = a4_0x2b12();
    return a4_0x5565 = function (_0x5565a8, _0x4c6293) {
        _0x5565a8 = _0x5565a8 - 0x1c9;
        let _0x1ad94f = _0x2b12b6[_0x5565a8];
        return _0x1ad94f;
    }, a4_0x5565(_0x117820, _0x1ae824);
}
function a4_0x2b12() {
    const _0x27d1ff = [
        '574fGIAxE',
        'load',
        'Container.getDataObject\x20expects\x20Data\x20as\x20first\x20argument',
        'undefined',
        'set',
        '67404zSXPMx',
        'values',
        'Container#',
        '_id',
        '_createDataObject',
        '71432yxBTqs',
        'delete',
        'closeAll',
        'toString',
        'saveDataObject',
        'Invalid\x20strategy\x20argument',
        '_removeDataObject',
        './Data.js',
        'getID',
        '12OSPZpM',
        'getInstance',
        '9973952hJpgvQ',
        'now',
        'removeDataObject',
        'exports',
        'hasDataObject',
        'enumDataObjects',
        'Data\x20object\x20',
        '\x20in\x20container\x20',
        'value',
        '_getDataObject',
        'has',
        '9863300fiTLcJ',
        'sync',
        '5653863trzxLV',
        '_strategy',
        './Observable.js',
        './Logger.js',
        '6105095xcMNmQ',
        'exception',
        './Exception',
        'extract',
        'close',
        './Strategy.js',
        '3913866kiiEDe',
        '_saveDataObject',
        '4avTixw',
        'getDefaultLogger'
    ];
    a4_0x2b12 = function () {
        return _0x27d1ff;
    };
    return a4_0x2b12();
}
(function (_0x2ed5d5, _0x1d0903) {
    const _0x14eb49 = a4_0x5565, _0x6f9635 = _0x2ed5d5();
    while (!![]) {
        try {
            const _0x493b6f = parseInt(_0x14eb49(0x1ce)) / 0x1 * (-parseInt(_0x14eb49(0x1d7)) / 0x2) + -parseInt(_0x14eb49(0x1f0)) / 0x3 + -parseInt(_0x14eb49(0x1f2)) / 0x4 * (parseInt(_0x14eb49(0x1ea)) / 0x5) + parseInt(_0x14eb49(0x1c9)) / 0x6 * (parseInt(_0x14eb49(0x1f4)) / 0x7) + parseInt(_0x14eb49(0x1d9)) / 0x8 + parseInt(_0x14eb49(0x1e6)) / 0x9 + parseInt(_0x14eb49(0x1e4)) / 0xa;
            if (_0x493b6f === _0x1d0903)
                break;
            else
                _0x6f9635['push'](_0x6f9635['shift']());
        } catch (_0x2eb9c5) {
            _0x6f9635['push'](_0x6f9635['shift']());
        }
    }
}(a4_0x2b12, 0xca34c));
const version = 0x6235, Logger = require(a4_0x4edc9(0x1e9)), Strategy = require(a4_0x4edc9(0x1ef)), Data = require(a4_0x4edc9(0x1d5)), Observable = require(a4_0x4edc9(0x1e8)), {mixin} = require('./util.js'), {DataNotFoundException} = require(a4_0x4edc9(0x1ec));
var containers = new Map();
class Container {
    constructor(_0x7150c0, _0x12e0f0) {
        const _0x1819b7 = a4_0x4edc9;
        if (!(_0x12e0f0 instanceof Strategy))
            throw new TypeError(_0x1819b7(0x1d3));
        this[_0x1819b7(0x1e7)] = _0x12e0f0, this[_0x1819b7(0x1cc)] = String(_0x7150c0), containers[_0x1819b7(0x1f8)](_0x7150c0, this);
    }
    static [a4_0x4edc9(0x1d8)](_0x39af10, _0x1d534e) {
        const _0x2c0c73 = a4_0x4edc9;
        if (containers[_0x2c0c73(0x1e3)](_0x39af10))
            return containers['get'](_0x39af10);
        return _0x1d534e ? new Container(_0x39af10, _0x1d534e) : undefined;
    }
    static [a4_0x4edc9(0x1d0)]() {
        const _0xc20b3e = a4_0x4edc9;
        for (let _0x15f5cb of containers[_0xc20b3e(0x1ca)]()) {
            Logger[_0xc20b3e(0x1f3)]()['info']('Closing\x20container\x20%1', _0x15f5cb);
            try {
                _0x15f5cb[_0xc20b3e(0x1ee)]();
            } catch (_0x1892df) {
                Logger['getDefaultLogger']()[_0xc20b3e(0x1eb)](_0x1892df);
            }
        }
    }
    [a4_0x4edc9(0x1d6)]() {
        const _0x2b3f6e = a4_0x4edc9;
        return this[_0x2b3f6e(0x1cc)];
    }
    [a4_0x4edc9(0x1d1)]() {
        const _0x2eab4f = a4_0x4edc9;
        return _0x2eab4f(0x1cb) + this[_0x2eab4f(0x1cc)];
    }
    [a4_0x4edc9(0x1dd)](_0x2a7194) {
        const _0x1ddd00 = a4_0x4edc9;
        return this[_0x1ddd00(0x1e7)][_0x1ddd00(0x1dd)](_0x2a7194);
    }
    [a4_0x4edc9(0x1de)]() {
        const _0x5d61bc = a4_0x4edc9;
        return this[_0x5d61bc(0x1e7)]['enumDataObjects']();
    }
    [a4_0x4edc9(0x1e5)]() {
        this['_strategy']['sync']();
    }
    [a4_0x4edc9(0x1ee)]() {
        const _0xe601aa = a4_0x4edc9;
        this[_0xe601aa(0x1e7)][_0xe601aa(0x1ee)](), this[_0xe601aa(0x1e7)] = null, containers[_0xe601aa(0x1cf)](this[_0xe601aa(0x1cc)]);
    }
    [a4_0x4edc9(0x1e2)](_0x5831ed, _0x59881f, _0x5c6934) {
        const _0x59bff6 = a4_0x4edc9;
        if (!(_0x5831ed instanceof Data)) {
            const _0x4fb498 = new TypeError(_0x59bff6(0x1f6));
            Logger['getDefaultLogger']()[_0x59bff6(0x1eb)](_0x4fb498);
            throw _0x4fb498;
        }
        const _0x5261f6 = this['_strategy']['getDataObject'](_0x5831ed['getID']());
        if (_0x59bff6(0x1f7) !== typeof _0x5261f6)
            return _0x5831ed[_0x59bff6(0x1f5)](_0x5261f6);
        else {
            if (_0x59bff6(0x1f7) !== typeof _0x59881f)
                return _0x5831ed[_0x59bff6(0x1f5)]({
                    'value': _0x59881f,
                    'tss': Date[_0x59bff6(0x1da)](),
                    'tsc': 0x0
                });
            else
                throw new DataNotFoundException(this[_0x59bff6(0x1d6)](), _0x5831ed[_0x59bff6(0x1d6)]());
        }
    }
    [a4_0x4edc9(0x1f1)](_0x50ba21, _0x199e7c) {
        const _0x5d106e = a4_0x4edc9;
        return this[_0x5d106e(0x1e7)][_0x5d106e(0x1d2)](_0x50ba21['getID'](), _0x50ba21[_0x5d106e(0x1ed)](), _0x199e7c);
    }
    [a4_0x4edc9(0x1cd)](_0x147b83, _0x55f8fd) {
        const _0x2f109a = a4_0x4edc9;
        if (this[_0x2f109a(0x1dd)](_0x147b83))
            throw new ReferenceError(_0x2f109a(0x1df) + _0x147b83 + _0x2f109a(0x1e0) + this[_0x2f109a(0x1cc)] + '\x20already\x20exists');
        let _0x5f31e8 = Data[_0x2f109a(0x1d8)](this, _0x147b83, _0x55f8fd);
        return _0x5f31e8[_0x2f109a(0x1e1)] = _0x2f109a(0x1f7) === typeof _0x55f8fd ? null : _0x55f8fd, this[_0x2f109a(0x1e7)][_0x2f109a(0x1d2)](_0x147b83, _0x5f31e8[_0x2f109a(0x1ed)]()), _0x5f31e8;
    }
    [a4_0x4edc9(0x1d4)](_0x3b85a1) {
        const _0x59d403 = a4_0x4edc9;
        this[_0x59d403(0x1e7)][_0x59d403(0x1db)](_0x3b85a1);
    }
}
mixin(Container, Observable), module[a4_0x4edc9(0x1dc)] = Container;