"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__, {
    ProductTemplateProvider: ()=>ProductTemplateProvider
});
const commerce_namespaceObject = require("@coveo/headless/commerce");
const template_provider_cjs_namespaceObject = require("../../common/template-provider/template-provider.cjs");
require("../atomic-product-template/atomic-product-template.cjs");
class ProductTemplateProvider extends template_provider_cjs_namespaceObject.TemplateProvider {
    makeDefaultTemplate() {
        const content = document.createDocumentFragment();
        const markup = `
      <atomic-product-section-name>
        <atomic-product-link class="font-bold"></atomic-product-link>
      </atomic-product-section-name>
      <atomic-product-section-visual>
        <atomic-product-image field="ec_thumbnails"></atomic-product-image>
      </atomic-product-section-visual>
    `;
        const template = document.createElement('template');
        template.innerHTML = markup.trim();
        content.appendChild(template.content);
        const linkContent = document.createDocumentFragment();
        const linkMarkup = `
      <atomic-product-link>
      ${this.gridCellLinkTarget ? `<a slot="attributes" target="${this.gridCellLinkTarget}"></a>` : ''}
      </atomic-product-link>
    `;
        const linkTemplate = document.createElement('template');
        linkTemplate.innerHTML = linkMarkup.trim();
        linkContent.appendChild(linkTemplate.content);
        return {
            content,
            linkContent,
            conditions: []
        };
    }
    constructor(props, gridCellLinkTarget){
        super(props, ()=>(0, commerce_namespaceObject.buildProductTemplatesManager)()), this.gridCellLinkTarget = gridCellLinkTarget;
    }
}
exports.ProductTemplateProvider = __webpack_exports__.ProductTemplateProvider;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "ProductTemplateProvider"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
