/**
 * @fileoverview added by tsickle
 * Generated from: shared/storage/storage.service.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import * as tslib_1 from "tslib";
import { user as userService } from "@seniorsistemas/senior-platform-data";
var StorageService = /** @class */ (function () {
    function StorageService() {
        this.GET_USER_ID = userService.getUserData().then((/**
         * @param {?} user
         * @return {?}
         */
        function (user) { return user.id; }));
    }
    /**
     * @param {?} key
     * @param {?} value
     * @return {?}
     */
    StorageService.prototype.store = /**
     * @param {?} key
     * @param {?} value
     * @return {?}
     */
    function (key, value) {
        return tslib_1.__awaiter(this, void 0, void 0, function () {
            var _a, _b;
            return tslib_1.__generator(this, function (_c) {
                switch (_c.label) {
                    case 0:
                        _b = (_a = localStorage).setItem;
                        return [4 /*yield*/, this.GET_USER_ID];
                    case 1:
                        _b.apply(_a, [(_c.sent()) + "_" + key, JSON.stringify(value)]);
                        return [2 /*return*/];
                }
            });
        });
    };
    /**
     * @param {?} key
     * @return {?}
     */
    StorageService.prototype.get = /**
     * @param {?} key
     * @return {?}
     */
    function (key) {
        return tslib_1.__awaiter(this, void 0, void 0, function () {
            var _a, _b, _c, _d;
            return tslib_1.__generator(this, function (_e) {
                switch (_e.label) {
                    case 0:
                        _b = (_a = JSON).parse;
                        _d = (_c = localStorage).getItem;
                        return [4 /*yield*/, this.GET_USER_ID];
                    case 1: return [2 /*return*/, _b.apply(_a, [_d.apply(_c, [(_e.sent()) + "_" + key])]) || {}];
                }
            });
        });
    };
    return StorageService;
}());
export { StorageService };
if (false) {
    /**
     * @type {?}
     * @private
     */
    StorageService.prototype.GET_USER_ID;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvcmFnZS5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQHNlbmlvci1nZXN0YW8tcGVzc29hcy9oY20tY2xvY2tpbmctZXZlbnQtZm91bmRhdGlvbi1zY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