Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/rest/market-expired/src/ |
Upload File : |
import { AnalyticsOptions, sendData } from 'ui.analytics'; import PopupType from './type/popup-type'; import PopupCategory from './type/popup-category'; export type AnalyticContext = { withDiscount: boolean, popupType: PopupType, popupCategory: PopupCategory, } export class Analytic { constructor(context: AnalyticContext) { this.context = context; } sendShow(): void { this.#send({ tool: 'infohelper', category: 'market', event: 'show_popup', }); } sendClickButton(button: string): void { this.#send({ tool: 'infohelper', category: 'market', event: 'click_button', c_element: button, }); } sendDemoActivated(): void { this.#send({ tool: 'intranet', category: 'demo', event: 'market_demo_activated', }); } #send(options: AnalyticsOptions): void { sendData({ ...options, type: this.#getType(), p1: this.#getP1(), }); } #getType(): string { let type = this.context.popupType === PopupType.WARNING ? 'pre_disconnection_alert' : 'post_disconnection_notice'; if (this.context.popupCategory === PopupCategory.TRIAL) { type = `${type}_demo`; } return type; } #getP1(): string { return `discount_${this.context.withDiscount ? 'Y' : 'N'}`; } }