var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
    function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
    var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
    var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
    var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
    var _, done = false;
    for (var i = decorators.length - 1; i >= 0; i--) {
        var context = {};
        for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
        for (var p in contextIn.access) context.access[p] = contextIn.access[p];
        context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
        var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
        if (kind === "accessor") {
            if (result === void 0) continue;
            if (result === null || typeof result !== "object") throw new TypeError("Object expected");
            if (_ = accept(result.get)) descriptor.get = _;
            if (_ = accept(result.set)) descriptor.set = _;
            if (_ = accept(result.init)) initializers.unshift(_);
        }
        else if (_ = accept(result)) {
            if (kind === "field") initializers.unshift(_);
            else descriptor[key] = _;
        }
    }
    if (target) Object.defineProperty(target, contextIn.name, descriptor);
    done = true;
};
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
    var useValue = arguments.length > 2;
    for (var i = 0; i < initializers.length; i++) {
        value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
    }
    return useValue ? value : void 0;
};
import * as plugins from '../../plugins.js';
import { DcRouterDb } from '../classes.dcrouter-db.js';
const getDb = () => DcRouterDb.getInstance().getDb();
let VpnClientDoc = (() => {
    let _classDecorators = [plugins.smartdata.Collection(() => getDb())];
    let _classDescriptor;
    let _classExtraInitializers = [];
    let _classThis;
    let _classSuper = plugins.smartdata.SmartDataDbDoc;
    let _clientId_decorators;
    let _clientId_initializers = [];
    let _clientId_extraInitializers = [];
    let _enabled_decorators;
    let _enabled_initializers = [];
    let _enabled_extraInitializers = [];
    let _targetProfileIds_decorators;
    let _targetProfileIds_initializers = [];
    let _targetProfileIds_extraInitializers = [];
    let _description_decorators;
    let _description_initializers = [];
    let _description_extraInitializers = [];
    let _assignedIp_decorators;
    let _assignedIp_initializers = [];
    let _assignedIp_extraInitializers = [];
    let _noisePublicKey_decorators;
    let _noisePublicKey_initializers = [];
    let _noisePublicKey_extraInitializers = [];
    let _wgPublicKey_decorators;
    let _wgPublicKey_initializers = [];
    let _wgPublicKey_extraInitializers = [];
    let _wgPrivateKey_decorators;
    let _wgPrivateKey_initializers = [];
    let _wgPrivateKey_extraInitializers = [];
    let _createdAt_decorators;
    let _createdAt_initializers = [];
    let _createdAt_extraInitializers = [];
    let _updatedAt_decorators;
    let _updatedAt_initializers = [];
    let _updatedAt_extraInitializers = [];
    let _expiresAt_decorators;
    let _expiresAt_initializers = [];
    let _expiresAt_extraInitializers = [];
    let _destinationAllowList_decorators;
    let _destinationAllowList_initializers = [];
    let _destinationAllowList_extraInitializers = [];
    let _destinationBlockList_decorators;
    let _destinationBlockList_initializers = [];
    let _destinationBlockList_extraInitializers = [];
    let _useHostIp_decorators;
    let _useHostIp_initializers = [];
    let _useHostIp_extraInitializers = [];
    let _useDhcp_decorators;
    let _useDhcp_initializers = [];
    let _useDhcp_extraInitializers = [];
    let _staticIp_decorators;
    let _staticIp_initializers = [];
    let _staticIp_extraInitializers = [];
    let _forceVlan_decorators;
    let _forceVlan_initializers = [];
    let _forceVlan_extraInitializers = [];
    let _vlanId_decorators;
    let _vlanId_initializers = [];
    let _vlanId_extraInitializers = [];
    var VpnClientDoc = class extends _classSuper {
        static { _classThis = this; }
        static {
            const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
            _clientId_decorators = [plugins.smartdata.unI(), plugins.smartdata.svDb()];
            _enabled_decorators = [plugins.smartdata.svDb()];
            _targetProfileIds_decorators = [plugins.smartdata.svDb()];
            _description_decorators = [plugins.smartdata.svDb()];
            _assignedIp_decorators = [plugins.smartdata.svDb()];
            _noisePublicKey_decorators = [plugins.smartdata.svDb()];
            _wgPublicKey_decorators = [plugins.smartdata.svDb()];
            _wgPrivateKey_decorators = [plugins.smartdata.svDb()];
            _createdAt_decorators = [plugins.smartdata.svDb()];
            _updatedAt_decorators = [plugins.smartdata.svDb()];
            _expiresAt_decorators = [plugins.smartdata.svDb()];
            _destinationAllowList_decorators = [plugins.smartdata.svDb()];
            _destinationBlockList_decorators = [plugins.smartdata.svDb()];
            _useHostIp_decorators = [plugins.smartdata.svDb()];
            _useDhcp_decorators = [plugins.smartdata.svDb()];
            _staticIp_decorators = [plugins.smartdata.svDb()];
            _forceVlan_decorators = [plugins.smartdata.svDb()];
            _vlanId_decorators = [plugins.smartdata.svDb()];
            __esDecorate(null, null, _clientId_decorators, { kind: "field", name: "clientId", static: false, private: false, access: { has: obj => "clientId" in obj, get: obj => obj.clientId, set: (obj, value) => { obj.clientId = value; } }, metadata: _metadata }, _clientId_initializers, _clientId_extraInitializers);
            __esDecorate(null, null, _enabled_decorators, { kind: "field", name: "enabled", static: false, private: false, access: { has: obj => "enabled" in obj, get: obj => obj.enabled, set: (obj, value) => { obj.enabled = value; } }, metadata: _metadata }, _enabled_initializers, _enabled_extraInitializers);
            __esDecorate(null, null, _targetProfileIds_decorators, { kind: "field", name: "targetProfileIds", static: false, private: false, access: { has: obj => "targetProfileIds" in obj, get: obj => obj.targetProfileIds, set: (obj, value) => { obj.targetProfileIds = value; } }, metadata: _metadata }, _targetProfileIds_initializers, _targetProfileIds_extraInitializers);
            __esDecorate(null, null, _description_decorators, { kind: "field", name: "description", static: false, private: false, access: { has: obj => "description" in obj, get: obj => obj.description, set: (obj, value) => { obj.description = value; } }, metadata: _metadata }, _description_initializers, _description_extraInitializers);
            __esDecorate(null, null, _assignedIp_decorators, { kind: "field", name: "assignedIp", static: false, private: false, access: { has: obj => "assignedIp" in obj, get: obj => obj.assignedIp, set: (obj, value) => { obj.assignedIp = value; } }, metadata: _metadata }, _assignedIp_initializers, _assignedIp_extraInitializers);
            __esDecorate(null, null, _noisePublicKey_decorators, { kind: "field", name: "noisePublicKey", static: false, private: false, access: { has: obj => "noisePublicKey" in obj, get: obj => obj.noisePublicKey, set: (obj, value) => { obj.noisePublicKey = value; } }, metadata: _metadata }, _noisePublicKey_initializers, _noisePublicKey_extraInitializers);
            __esDecorate(null, null, _wgPublicKey_decorators, { kind: "field", name: "wgPublicKey", static: false, private: false, access: { has: obj => "wgPublicKey" in obj, get: obj => obj.wgPublicKey, set: (obj, value) => { obj.wgPublicKey = value; } }, metadata: _metadata }, _wgPublicKey_initializers, _wgPublicKey_extraInitializers);
            __esDecorate(null, null, _wgPrivateKey_decorators, { kind: "field", name: "wgPrivateKey", static: false, private: false, access: { has: obj => "wgPrivateKey" in obj, get: obj => obj.wgPrivateKey, set: (obj, value) => { obj.wgPrivateKey = value; } }, metadata: _metadata }, _wgPrivateKey_initializers, _wgPrivateKey_extraInitializers);
            __esDecorate(null, null, _createdAt_decorators, { kind: "field", name: "createdAt", static: false, private: false, access: { has: obj => "createdAt" in obj, get: obj => obj.createdAt, set: (obj, value) => { obj.createdAt = value; } }, metadata: _metadata }, _createdAt_initializers, _createdAt_extraInitializers);
            __esDecorate(null, null, _updatedAt_decorators, { kind: "field", name: "updatedAt", static: false, private: false, access: { has: obj => "updatedAt" in obj, get: obj => obj.updatedAt, set: (obj, value) => { obj.updatedAt = value; } }, metadata: _metadata }, _updatedAt_initializers, _updatedAt_extraInitializers);
            __esDecorate(null, null, _expiresAt_decorators, { kind: "field", name: "expiresAt", static: false, private: false, access: { has: obj => "expiresAt" in obj, get: obj => obj.expiresAt, set: (obj, value) => { obj.expiresAt = value; } }, metadata: _metadata }, _expiresAt_initializers, _expiresAt_extraInitializers);
            __esDecorate(null, null, _destinationAllowList_decorators, { kind: "field", name: "destinationAllowList", static: false, private: false, access: { has: obj => "destinationAllowList" in obj, get: obj => obj.destinationAllowList, set: (obj, value) => { obj.destinationAllowList = value; } }, metadata: _metadata }, _destinationAllowList_initializers, _destinationAllowList_extraInitializers);
            __esDecorate(null, null, _destinationBlockList_decorators, { kind: "field", name: "destinationBlockList", static: false, private: false, access: { has: obj => "destinationBlockList" in obj, get: obj => obj.destinationBlockList, set: (obj, value) => { obj.destinationBlockList = value; } }, metadata: _metadata }, _destinationBlockList_initializers, _destinationBlockList_extraInitializers);
            __esDecorate(null, null, _useHostIp_decorators, { kind: "field", name: "useHostIp", static: false, private: false, access: { has: obj => "useHostIp" in obj, get: obj => obj.useHostIp, set: (obj, value) => { obj.useHostIp = value; } }, metadata: _metadata }, _useHostIp_initializers, _useHostIp_extraInitializers);
            __esDecorate(null, null, _useDhcp_decorators, { kind: "field", name: "useDhcp", static: false, private: false, access: { has: obj => "useDhcp" in obj, get: obj => obj.useDhcp, set: (obj, value) => { obj.useDhcp = value; } }, metadata: _metadata }, _useDhcp_initializers, _useDhcp_extraInitializers);
            __esDecorate(null, null, _staticIp_decorators, { kind: "field", name: "staticIp", static: false, private: false, access: { has: obj => "staticIp" in obj, get: obj => obj.staticIp, set: (obj, value) => { obj.staticIp = value; } }, metadata: _metadata }, _staticIp_initializers, _staticIp_extraInitializers);
            __esDecorate(null, null, _forceVlan_decorators, { kind: "field", name: "forceVlan", static: false, private: false, access: { has: obj => "forceVlan" in obj, get: obj => obj.forceVlan, set: (obj, value) => { obj.forceVlan = value; } }, metadata: _metadata }, _forceVlan_initializers, _forceVlan_extraInitializers);
            __esDecorate(null, null, _vlanId_decorators, { kind: "field", name: "vlanId", static: false, private: false, access: { has: obj => "vlanId" in obj, get: obj => obj.vlanId, set: (obj, value) => { obj.vlanId = value; } }, metadata: _metadata }, _vlanId_initializers, _vlanId_extraInitializers);
            __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
            VpnClientDoc = _classThis = _classDescriptor.value;
            if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
            __runInitializers(_classThis, _classExtraInitializers);
        }
        clientId = __runInitializers(this, _clientId_initializers, void 0);
        enabled = (__runInitializers(this, _clientId_extraInitializers), __runInitializers(this, _enabled_initializers, void 0));
        targetProfileIds = (__runInitializers(this, _enabled_extraInitializers), __runInitializers(this, _targetProfileIds_initializers, void 0));
        description = (__runInitializers(this, _targetProfileIds_extraInitializers), __runInitializers(this, _description_initializers, void 0));
        assignedIp = (__runInitializers(this, _description_extraInitializers), __runInitializers(this, _assignedIp_initializers, void 0));
        noisePublicKey = (__runInitializers(this, _assignedIp_extraInitializers), __runInitializers(this, _noisePublicKey_initializers, void 0));
        wgPublicKey = (__runInitializers(this, _noisePublicKey_extraInitializers), __runInitializers(this, _wgPublicKey_initializers, void 0));
        wgPrivateKey = (__runInitializers(this, _wgPublicKey_extraInitializers), __runInitializers(this, _wgPrivateKey_initializers, void 0));
        createdAt = (__runInitializers(this, _wgPrivateKey_extraInitializers), __runInitializers(this, _createdAt_initializers, void 0));
        updatedAt = (__runInitializers(this, _createdAt_extraInitializers), __runInitializers(this, _updatedAt_initializers, void 0));
        expiresAt = (__runInitializers(this, _updatedAt_extraInitializers), __runInitializers(this, _expiresAt_initializers, void 0));
        destinationAllowList = (__runInitializers(this, _expiresAt_extraInitializers), __runInitializers(this, _destinationAllowList_initializers, void 0));
        destinationBlockList = (__runInitializers(this, _destinationAllowList_extraInitializers), __runInitializers(this, _destinationBlockList_initializers, void 0));
        useHostIp = (__runInitializers(this, _destinationBlockList_extraInitializers), __runInitializers(this, _useHostIp_initializers, void 0));
        useDhcp = (__runInitializers(this, _useHostIp_extraInitializers), __runInitializers(this, _useDhcp_initializers, void 0));
        staticIp = (__runInitializers(this, _useDhcp_extraInitializers), __runInitializers(this, _staticIp_initializers, void 0));
        forceVlan = (__runInitializers(this, _staticIp_extraInitializers), __runInitializers(this, _forceVlan_initializers, void 0));
        vlanId = (__runInitializers(this, _forceVlan_extraInitializers), __runInitializers(this, _vlanId_initializers, void 0));
        constructor() {
            super();
            __runInitializers(this, _vlanId_extraInitializers);
        }
        static async findAll() {
            return await VpnClientDoc.getInstances({});
        }
    };
    return VpnClientDoc = _classThis;
})();
export { VpnClientDoc };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xhc3Nlcy52cG4tY2xpZW50LmRvYy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3RzL2RiL2RvY3VtZW50cy9jbGFzc2VzLnZwbi1jbGllbnQuZG9jLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSxPQUFPLEtBQUssT0FBTyxNQUFNLGtCQUFrQixDQUFDO0FBQzVDLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUV2RCxNQUFNLEtBQUssR0FBRyxHQUFHLEVBQUUsQ0FBQyxVQUFVLENBQUMsV0FBVyxFQUFFLENBQUMsS0FBSyxFQUFFLENBQUM7SUFHeEMsWUFBWTs0QkFEeEIsT0FBTyxDQUFDLFNBQVMsQ0FBQyxVQUFVLENBQUMsR0FBRyxFQUFFLENBQUMsS0FBSyxFQUFFLENBQUM7Ozs7c0JBQ1YsT0FBTyxDQUFDLFNBQVMsQ0FBQyxjQUFjOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzRCQUF4QyxTQUFRLFdBQTREOzs7O29DQUMzRixPQUFPLENBQUMsU0FBUyxDQUFDLEdBQUcsRUFBRSxFQUN2QixPQUFPLENBQUMsU0FBUyxDQUFDLElBQUksRUFBRTttQ0FHeEIsT0FBTyxDQUFD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