"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HandlerParser = void 0;
var tslib_1 = require("tslib");
var HandlerParser = /** @class */ (function () {
    function HandlerParser() {
    }
    HandlerParser.prototype.onStart = function (context) {
        this.handler = {};
    };
    HandlerParser.prototype.parseModule = function (pageId, mod) {
        var _a;
        if (mod.name === '____index____')
            return;
        var _b = (0, tslib_1.__read)((_a = mod.path) === null || _a === void 0 ? void 0 : _a.split('/'), 3), folder = _b[2];
        if (folder) {
            this.handler[pageId] = this.handler[pageId] || {};
            this.handler[pageId][folder] = mod.exports.default;
        }
        else
            this.handler[pageId] = mod.exports.default;
    };
    HandlerParser.prototype.onEnd = function (context) {
        context.handler = this.handler;
    };
    return HandlerParser;
}());
exports.HandlerParser = HandlerParser;
//# sourceMappingURL=handlerParser.js.map