13011302// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)1303// @ts-expect-error ST-2949_21304function t_catalog_createCssProperty(propertyName, value) {1305return `${propertyName}: ${value};`;1306}13071308// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)1309// @ts-expect-error ST-2949_21310function t_catalog_addRule(targetArr, prop, val) {1311if (val === undefined || val === null || val === '') return;
targetArr.push(t_catalog_createCssProperty(prop, val));}// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)// @ts-expect-error ST-2949_2function t_catalog_addTextColorRule(targetArr, val) { if (t_catalog_isGradient(val)) { t_catalog_addRule(targetArr, 'background-image', val); t_catalog_addRule(targetArr, '-webkit-text-fill-color', 'transparent'); t_catalog_addRule(targetArr, '-webkit-background-clip', 'text'); t_catalog_addRule(targetArr, 'background-clip', 'text'); } else { t_catalog_addRule(targetArr, 'color', val); }}// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)// @ts-expect-error ST-2949_2function t_catalog_isGradient(stylePropertyValue) { return typeof stylePropertyValue === 'string' && stylePropertyValue.indexOf('gradient') !== -1;}/** * Добавляет анимацию смены фона при наведении * @param {string} css * @returns */function t_catalog_appendMainButtonBgHoverStyle(css) { return ( css + ` \n @media (hover: hover) { .t-catalog__prod-snippet__container .t-catalog__prod-popup__btn:hover { animation-name: t-button-hover-animation; animation-duration: 0s; animation-fill-mode: forwards; animation-delay: 1s; animation-timing-function: linear; } } ` );}/** * Initialize the hover zoom plugin. It is called when the page is loaded * * @param {string} recid **/function t_catalog_hoverZoom_init(recid) { // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) // @ts-expect-error ST-2949_1 if (window.tCatalogIsMobile) return; var rec = document.getElementById('rec' + recid); // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538) // @ts-expect-error ST-2949_3 if (rec.querySelector('[data-hover-zoom]')) { // TODO ST-2949_4: cannot find name / missing jQuery types (TS2304, TS2592) // @ts-expect-error ST-2949_4 t_catalog__loadHoverZoom().then(() => t_hoverZoom_init(recid)); }}/** * Loads products from the store and shown * * @param {string} method - relevants or not * @param {string} recid * @param {CatalogOptions} options * @param {number} slice - the number of the slice to load * @param {object} relevantsOpts * @param {HTMLElement} [relevantsOpts.container] **/function t_catalog_loadProducts(method, recid, options, slice, relevantsOpts) { // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) // @ts-expect-error ST-2949_1 window.tCatalogProductsRequested = true; var showRelevants = method === 'relevants'; var c = Date.now(); var storepartuid = options.storepart; // Флаг одноразовый: сбрасываем сразу, чтобы он не остался выставленным при ошибке запроса var skipFiltersInit = Boolean(options.skipFiltersInit); options.skipFiltersInit = false; // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046) // @ts-expect-error ST-2949_5 var isFirstSlice = !slice || parseInt(slice, 10) === 1;