"use strict";
exports.id = 499;
exports.ids = [499];
exports.modules = {

/***/ 6499:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "D0": () => (/* binding */ bqToMango),
/* harmony export */   "KY": () => (/* binding */ logFacets),
/* harmony export */   "LA": () => (/* binding */ jobFacets)
/* harmony export */ });
const jobFacets = {
    name: {
        __default: true,
        mango: (v)=>({
                name: {
                    $eq: v
                }
            })
    }
};
const logFacets = {
    jobId: {
        mango: (v)=>({
                jobId: {
                    $eq: v
                }
            })
    }
};
/** Convert a boolean query expression to mango syntax */ const bqToMango = (q, facets)=>{
    var ref;
    const defaultName = (ref = Object.keys(facets).map((k)=>facets[k].__default ? k : false
    ).filter((t)=>t
    )) === null || ref === void 0 ? void 0 : ref[0];
    const defaultFacet = defaultName ? facets[defaultName] : null;
    const mango = {
        $or: q.map((or)=>{
            return {
                $and: or.map((and)=>{
                    const [f, ...rest] = and.split(":");
                    const facet = facets[f];
                    if (facet) {
                        return facet.mango(rest.join(":"));
                    } else if (defaultFacet) {
                        return defaultFacet.mango([
                            f,
                            ...rest
                        ].join(":"));
                    }
                })
            };
        })
    };
    return mango;
};


/***/ })

};
;