import{SEARCH_GROUP_FACET_FIELD as t}from"../../../constants/common.js";import{DEFAULT_AI_SEARCH_ENABLED as o}from"../../constants/plugins/search.js";import{isPrimitive as n}from"../../../utils/guards/is-primitive.js";import{isDevelopMode as s}from"../../utils/envs/is-develop-mode.js";import{EntitlementsProvider as f}from"../../entitlements/entitlements-provider.js";function A(e){if(s())return process.env.SEARCH_DEV_DEBUG==="true";if(!f.instance().canAccessFeature("aiSearchLimit"))return!1;const r=e.aiAssistant;return typeof r?.hide=="boolean"?!r?.hide:o}function S(e){let i;return e&&Object.keys(e).forEach(r=>{r===t&&(i=e[r])}),i}function h(e){return Object.entries(e||{}).map(([i,r])=>`  - ${i}: ${n(r)?r:JSON.stringify(r)}`).join(`
`)}export{h as formatDocumentMetadata,S as getSearchDocumentGroup,A as isAiSearchEnabled};
