9701/**9702* Fade in an element9703*9704* @param {HTMLElement} el - the element to fade9705* @param {number|string} [animationDuration] - the duration of the animation in milliseconds, default is 200ms9706* @returns {boolean|*} false9707**/9708function t_catalog__fadeIn(el, animationDuration) {9709if (9710(getComputedStyle(el).opacity === '1' || getComputedStyle(el).opacity === '') &&9711getComputedStyle(el).display !== 'none'9712
) return false; var opacity = 0; var duration = animationDuration; if (!duration) { duration = 200; } duration = parseInt(String(duration)); var speed = duration > 0 ? duration / 10 : 40; // 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 el.style.opacity = opacity; el.style.display = 'block'; var timer = setInterval(function () { // 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 el.style.opacity = opacity; opacity += 0.1; if (opacity >= 1.0) { clearInterval(timer); } }, speed); return true;}/** * Converts object to a string that can be used as a query * * @param {object} obj - the object to serialize * @param {string} prefix - The prefix to use for the key * @returns {string} - string as a query **/function t_catalog__serializeData(obj, prefix) { var str = []; for (var property in obj) { if (Object.prototype.hasOwnProperty.call(obj, property)) { var key = prefix ? prefix + '[' + property + ']' : property; // 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_2 var value = obj[property]; var stringifyValue = JSON.stringify(value); if (stringifyValue !== '{}' && value !== null) { str.push( value !== null && typeof value === 'object' ? t_catalog__serializeData(value, key) : encodeURIComponent(key) + '=' + encodeURIComponent(value) ); } } } return str.join('&');}/** * If the error is a timeout, the endpoint is changed to store2.tildacdn.com * * @param {object} error - The error object. * @param {Function} callback - A function that will be called when the request is complete. **/function t_catalog_changeEndpoint(error, callback) { if ( error && // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) // @ts-expect-error ST-2949_1 (error.status >= 500 || // @ts-expect-error ST-2949_1 error.status == 408 || // @ts-expect-error ST-2949_1 error.status == 410 || // @ts-expect-error ST-2949_1 error.status == 429 || // @ts-expect-error ST-2949_1 error.type === 'timeout') && // @ts-expect-error ST-2949_1 window.t_catalog_endpoint.indexOf('store.tilda') !== -1 ) { const rootzoneapi = t_catalog__getRootZone(); // @ts-expect-error ST-2949_1 window.t_catalog_endpoint = 'store2.tildaapi.' + rootzoneapi; if (typeof callback === 'function') { callback(); } } else { var text; // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) // @ts-expect-error ST-2949_1 if (error && error.responseText > '') {