"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.d = (exports1, definition)=>{
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
})();
(()=>{
    __webpack_require__.r = (exports1)=>{
        if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    buildInsightLayout: ()=>buildInsightLayout,
    makeDesktopQuery: ()=>makeDesktopQuery
});
const atomic_layout_section_utils_cjs_namespaceObject = require("../../common/atomic-layout-section/atomic-layout-section-utils.cjs");
const tabsSelector = 'atomic-insight-tabs';
const refineModalSelector = 'atomic-insight-refine-modal';
const searchBoxSelector = 'atomic-insight-search-box';
const toggleSelectors = [
    'atomic-insight-refine-toggle',
    'atomic-insight-edit-toggle',
    'atomic-insight-history-toggle'
];
const smartSnippetSelectors = [
    'atomic-insight-smart-snippet-suggestions',
    'atomic-insight-smart-snippet'
];
const generatedAnswerSelector = 'atomic-insight-generated-answer';
function makeDesktopQuery(mobileBreakpoint) {
    return `only screen and (min-width: ${mobileBreakpoint})`;
}
function buildInsightLayout(element, _mobileBreakpoint) {
    const id = element.id;
    const layoutSelector = `atomic-insight-layout#${id}`;
    const widget = element.widget || false;
    const hasTabs = Boolean((0, atomic_layout_section_utils_cjs_namespaceObject.findSection)(element, 'search')?.querySelector(tabsSelector));
    const interfaceStyle = widget ? `
  ${layoutSelector} {
    display: grid;
    grid-template-rows: auto auto 8fr 1fr;
    max-height: 100%;
    box-sizing: border-box;
  }
  ${layoutSelector} ${refineModalSelector} {
    grid-row-start: 5;
  }` : '';
    const search = `${(0, atomic_layout_section_utils_cjs_namespaceObject.sectionSelector)('search')} {
      width: 100%;
      display: flex;
      flex-wrap: wrap;
      grid-gap: 0.5rem;
      background: var(--atomic-neutral-light);
      padding-top: 1.5rem;
      padding-left: 1.5rem;
      padding-right: 1.5rem;
      box-sizing: border-box;
      min-width: 0;
      ${!hasTabs ? 'padding-bottom: 1.5rem;' : ''}
    }

    ${(0, atomic_layout_section_utils_cjs_namespaceObject.sectionSelector)('search')} ${searchBoxSelector} {
      flex-grow: 1;
      height: 2.6rem;
    }

    ${toggleSelectors.map((toggleSelector)=>`${(0, atomic_layout_section_utils_cjs_namespaceObject.sectionSelector)('search')} ${toggleSelector} {
      flex-shrink: 0;
    }`)}

    ${(0, atomic_layout_section_utils_cjs_namespaceObject.sectionSelector)('search')} ${tabsSelector} {
      width: 100%;
    }
    `;
    const facets = `${(0, atomic_layout_section_utils_cjs_namespaceObject.sectionSelector)('facets')} {
      display: none;
    }
    `;
    const results = `
    ${(0, atomic_layout_section_utils_cjs_namespaceObject.sectionSelector)('results')} {
      overflow: auto;
    }

    ${(0, atomic_layout_section_utils_cjs_namespaceObject.sectionSelector)('results')} ${smartSnippetSelectors.join(',')} {
      padding: 1.5rem 1.5rem 0px;
    }

    ${(0, atomic_layout_section_utils_cjs_namespaceObject.sectionSelector)('results')} ${generatedAnswerSelector} {
      margin-left: 1.5rem;
      margin-right: 1.5rem;
    }
    `;
    return [
        interfaceStyle,
        search,
        facets,
        results
    ].filter((declaration)=>'' !== declaration).join('\n\n');
}
exports.buildInsightLayout = __webpack_exports__.buildInsightLayout;
exports.makeDesktopQuery = __webpack_exports__.makeDesktopQuery;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "buildInsightLayout",
    "makeDesktopQuery"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
