import{e,f as t,K as i,g as r}from"./p-9ef574c2.js";import"./p-896c8e86.js";import"./p-c2e91ee8.js";function o(i,r){return{klevuModifierId:"sendMerchandisingViewEvent",ssrOnResultFE:true,onResult:(o,n)=>{var s,d,c,a;if(!n.params){return o}const{id:u,abtest:l}=n.params;if(n.klevuFunctionId!=="categoryMerchandising"||!u){return o}const v=(s=n.queries)===null||s===void 0?void 0:s.find((e=>{var t,i;return Boolean((i=(t=e.settings)===null||t===void 0?void 0:t.query)===null||i===void 0?void 0:i.categoryPath)}));const g=(a=(c=(d=v===null||v===void 0?void 0:v.settings)===null||d===void 0?void 0:d.query)===null||c===void 0?void 0:c.categoryPath)!==null&&a!==void 0?a:"unknown";const f=o.queriesById(u);if(!f){return o}e.categoryMerchandisingView({categoryTitle:i,klevuCategory:g,products:f.records,pageStartsFrom:f.meta.offset,abTestId:l===null||l===void 0?void 0:l.abTestId,abTestVariantId:l===null||l===void 0?void 0:l.abTestVariantId,activeFilters:t(f),override:r});return o}}}const n={id:"categoryMerchandising",searchTerm:"*",typeOfRecords:[r.Product],limit:24};function s(e,t,...r){const o=Object.assign(Object.assign({},n),t);const s={id:o.id,typeOfRequest:i.CategoryNavigation,settings:Object.assign({query:{categoryPath:e,term:o.searchTerm}},o)};return{klevuFunctionId:"categoryMerchandising",queries:[s],modifiers:r,params:Object.assign(Object.assign({},o),{category:e})}}export{s as c,o as s};
//# sourceMappingURL=p-d4fb485c.js.map