"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
var _ = __importStar(require("lodash"));
var queryString = __importStar(require("query-string"));
var event_service_1 = require("./event.service");
var HttpEventService = (function () {
    function HttpEventService() {
        var _this = this;
        this.hashObservable = new event_service_1.Event();
        this.queryObservable = new event_service_1.Event();
        this.query = new event_service_1.Event();
        this.firstPage = true;
        this.lastUrl = null;
        this.hashObservable.set(window.location.hash);
        this.queryObservable.set(queryString.parseUrl(window.location.href).query);
        setInterval(function () {
            if (_this.hashObservable.snapshot !== window.location.hash) {
                _this.firstPage = false;
                _this.hashObservable.set(window.location.hash);
            }
            if (!_.isEqual(_this.queryObservable.snapshot, queryString.parseUrl(window.location.href).query)) {
                _this.queryObservable.set(queryString.parseUrl(window.location.href).query);
            }
        }, 100);
    }
    Object.defineProperty(HttpEventService.prototype, "hash", {
        get: function () {
            return this.hashObservable.observable;
        },
        enumerable: false,
        configurable: true
    });
    HttpEventService.prototype.getLastUrl = function () {
        return this.lastUrl;
    };
    Object.defineProperty(HttpEventService.prototype, "queryParams", {
        get: function () {
            return this.queryObservable.observable;
        },
        enumerable: false,
        configurable: true
    });
    return HttpEventService;
}());
exports.default = new HttpEventService();
//# sourceMappingURL=http-event.service.web.js.map