stone-analytics 0.0.94 → 0.0.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -63
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
# Пакет с функцией отправки аналитики stone
|
|
2
|
-
|
|
3
|
-
Npm-пакет для отправки аналитики по api/send-event
|
|
4
|
-
|
|
5
|
-
## Установка
|
|
6
|
-
|
|
7
|
-
```sh
|
|
8
|
-
npm i stone-analytics@latest
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
### Метод отправки аналитики
|
|
12
|
-
|
|
13
|
-
Метод для отправки аналитики sendAnalytics
|
|
14
|
-
|
|
15
|
-
```sh
|
|
16
|
-
import { useEffect } from 'react'
|
|
17
|
-
import { sendAnalytics } from 'stone-analytics'
|
|
18
|
-
|
|
19
|
-
export const AllProviders = () => {
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
sendAnalytics({
|
|
22
|
-
event: 'page_view',
|
|
23
|
-
name: 'Переход на страницу',
|
|
24
|
-
})
|
|
25
|
-
}, [])
|
|
26
|
-
}
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
#### Параметры
|
|
30
|
-
|
|
31
|
-
| Поле | Тип | Описание |
|
|
32
|
-
| -------- | ------------------------ | ----------------------------------------------------- |
|
|
33
|
-
| `event` | `string` | Название события (например, `"click"`, `"page_view"`) |
|
|
34
|
-
| `name` | `string` | Уникальное имя события |
|
|
35
|
-
| `params` | `TAnalyticsVisitParams?` | Дополнительные параметры события (необязательно) |
|
|
36
|
-
|
|
37
|
-
### Инициализация сессии
|
|
38
|
-
|
|
39
|
-
Хук для инициализации id сессии и id клиента
|
|
40
|
-
|
|
41
|
-
```sh
|
|
42
|
-
import { useInitializeMetrics } from 'stone-analytics'
|
|
43
|
-
|
|
44
|
-
export const AppProvider = ({ children }: { children: React.ReactNode }) => {
|
|
45
|
-
useInitializeMetrics()
|
|
46
|
-
|
|
47
|
-
return <>{children}</>
|
|
48
|
-
}
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
| Поле | Описание |
|
|
52
|
-
| ---------- | --------- |
|
|
53
|
-
| session_id | На сессию |
|
|
54
|
-
| client_id | На год |
|
|
55
|
-
|
|
56
|
-
### Локальная разработка
|
|
57
|
-
|
|
58
|
-
Для того , чтобы локально ничего не отправлялось добавить в env.local
|
|
59
|
-
|
|
60
|
-
```sh
|
|
61
|
-
process.env.NEXT_PUBLIC_IS_TEST === 'true'
|
|
62
|
-
```
|
|
63
|
-
|
|
1
|
+
# Пакет с функцией отправки аналитики stone
|
|
2
|
+
|
|
3
|
+
Npm-пакет для отправки аналитики по api/send-event
|
|
4
|
+
|
|
5
|
+
## Установка
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm i stone-analytics@latest
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Метод отправки аналитики
|
|
12
|
+
|
|
13
|
+
Метод для отправки аналитики sendAnalytics
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
import { useEffect } from 'react'
|
|
17
|
+
import { sendAnalytics } from 'stone-analytics'
|
|
18
|
+
|
|
19
|
+
export const AllProviders = () => {
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
sendAnalytics({
|
|
22
|
+
event: 'page_view',
|
|
23
|
+
name: 'Переход на страницу',
|
|
24
|
+
})
|
|
25
|
+
}, [])
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
#### Параметры
|
|
30
|
+
|
|
31
|
+
| Поле | Тип | Описание |
|
|
32
|
+
| -------- | ------------------------ | ----------------------------------------------------- |
|
|
33
|
+
| `event` | `string` | Название события (например, `"click"`, `"page_view"`) |
|
|
34
|
+
| `name` | `string` | Уникальное имя события |
|
|
35
|
+
| `params` | `TAnalyticsVisitParams?` | Дополнительные параметры события (необязательно) |
|
|
36
|
+
|
|
37
|
+
### Инициализация сессии
|
|
38
|
+
|
|
39
|
+
Хук для инициализации id сессии и id клиента
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
import { useInitializeMetrics } from 'stone-analytics'
|
|
43
|
+
|
|
44
|
+
export const AppProvider = ({ children }: { children: React.ReactNode }) => {
|
|
45
|
+
useInitializeMetrics()
|
|
46
|
+
|
|
47
|
+
return <>{children}</>
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
| Поле | Описание |
|
|
52
|
+
| ---------- | --------- |
|
|
53
|
+
| session_id | На сессию |
|
|
54
|
+
| client_id | На год |
|
|
55
|
+
|
|
56
|
+
### Локальная разработка
|
|
57
|
+
|
|
58
|
+
Для того , чтобы локально ничего не отправлялось добавить в env.local
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
process.env.NEXT_PUBLIC_IS_TEST === 'true'
|
|
62
|
+
```
|
|
63
|
+
|
package/dist/index.d.ts
CHANGED
|
@@ -83,6 +83,8 @@ declare const staticPageViewType: {
|
|
|
83
83
|
readonly '/about': "about_company";
|
|
84
84
|
readonly '/catalog/commercial': "lot_catalog";
|
|
85
85
|
readonly '/catalog/residential': "lot_catalog";
|
|
86
|
+
readonly '/catalog/retail': "lot_catalog";
|
|
87
|
+
readonly '/catalog/offices': "lot_catalog";
|
|
86
88
|
};
|
|
87
89
|
declare const sokolnikiPageViewType: {
|
|
88
90
|
'/': string;
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var ue=Object.create;var y=Object.defineProperty;var _e=Object.getOwnPropertyDescriptor;var fe=Object.getOwnPropertyNames;var ye=Object.getPrototypeOf,ve=Object.prototype.hasOwnProperty;var he=(e,t)=>{for(var o in t)y(e,o,{get:t[o],enumerable:!0})},N=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of fe(t))!ve.call(e,i)&&i!==o&&y(e,i,{get:()=>t[i],enumerable:!(n=_e(t,i))||n.enumerable});return e};var O=(e,t,o)=>(o=e!=null?ue(ye(e)):{},N(t||!e||!e.__esModule?y(o,"default",{value:e,enumerable:!0}):o,e)),Se=e=>N(y({},"__esModule",{value:!0}),e);var xe={};he(xe,{StoneDataLayerStore:()=>T,checkTimeStamp:()=>w,getABCookie:()=>Ee,getGoogleAnalyticsClientId:()=>x,getLotName:()=>F,getPageDirection:()=>A,getPageType:()=>B,getProjectName:()=>j,getStoneClientId:()=>C,getStoneHashClientId:()=>I,getStoneSessionId:()=>D,getYandexMetrikaClientId:()=>P,sendAnalytics:()=>g,setClientId:()=>k,setSessionId:()=>E,sokolnikiPageViewType:()=>q,staticPageViewType:()=>V,stoneDataLayerStore:()=>Ce,stoneHodPageViewType:()=>K,useComagicStatus:()=>we,useInitializeMetrics:()=>Te});module.exports=Se(xe);var d=()=>String(Date.now())+String(Math.floor(Math.random()*9e8)+1e8);var U=typeof localStorage<"u",w=e=>{if(!e)return!1;let t=Number(e.slice(0,10)),o=new Date(t*1e3),n=new Date(new Date().toISOString());return n.getFullYear()>o.getFullYear()&&n.getMonth()>=o.getMonth()&&n.getDate()>=o.getDate()},E=()=>{let e=d();U&&localStorage.setItem("st_session_id",e)},k=()=>{let e=d();U&&localStorage.setItem("st_client_id",e)};var M=e=>{var t;if(typeof window<"u"){let o=process.env.NEXT_PUBLIC_IS_TEST==="true",n=window.location.pathname,i=window.location.href,r={event:e.event,st_event_id:(t=e.params)==null?void 0:t.st_event_id,page_path:n,page_url:i};e.params.st_session_id&&(r.st_session_id=e.params.st_session_id),e.params.st_client_id&&(r.st_client_id=e.params.st_client_id),e.params.project&&(r.project=e.params.project),e.params.lot_id&&(r.lot_id=e.params.lot_id),o||(window.dataLayer=window.dataLayer||[],window.dataLayer.push(r))}};var Y=e=>{if(typeof ym<"u"&&typeof window<"u"){let t=process.env.NEXT_PUBLIC_IS_TEST==="true";(typeof process.env.NEXT_PUBLIC_YM_COUNTER>"u"||!process.env.NEXT_PUBLIC_YM_COUNTER)&&console.log("Yandex counter \u043D\u0435 \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D \u0432 \u043A\u043E\u043D\u0444\u0438\u0433\u0435 .env.local"),t||(ym(process.env.NEXT_PUBLIC_YM_COUNTER,"reachGoal",e.target,e.params),console.log("Yandex Metrika "+process.env.NEXT_PUBLIC_YM_COUNTER+" reachGoal: "+e.target,e.params))}else console.log("Yandex Metrika \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u0430")};var z=async e=>{if(typeof window<"u"){let t=process.env.NEXT_PUBLIC_IS_TEST==="true",o="https://stone.ru/api/analytics/send-event",n=window.location.pathname,i=window.location.href,r={event:e.event,name:e.name,payload:{...e.params,page_path:n,page_url:i}};try{t||await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})}catch{console.log("can't sendAnalyticsToAPI")}}else return};var R=O(require("@fingerprintjs/fingerprintjs"));var $=O(require("@fingerprintjs/fingerprintjs")),b=require("cookies-next"),I=async()=>{let e;try{return await $.default.load().then(o=>o.get()).then(o=>{e=o.visitorId}),e}catch(t){console.log("error fingerprintJS"+t)}},D=()=>{let e=localStorage.getItem("st_session_id");if(e&&e!="")return e},C=()=>{let e=localStorage.getItem("st_client_id");if(e&&e!="")return e},x=()=>{let e=String((0,b.getCookie)("_ga"));if(e&&e!="")return e;{let t=localStorage.getItem("_ga");if(t&&t!="")return t}},P=()=>{let e=String((0,b.getCookie)("_ym_uid"));if(e&&e!="")return e;{let t=localStorage.getItem("_ym_uid");if(t&&t!="")return t}};var g=async e=>{var t;if(typeof window<"u"){let o=R.default.load(),n=process.env.NEXT_PUBLIC_IS_TEST==="true";e.params=e.params||{},e.params.st_event_id=d(),e.params.date=(t=new Date().toISOString().slice(0,19))==null?void 0:t.replace("T"," ");try{await o.then(i=>i.get()).then(i=>{e.params&&(e.params.st_client_hash_id=i.visitorId)})}catch(i){console.log("error fingerprintJS"+i)}e.params.ym_client_id=P(),e.params.ga_client_id=x(),e.params.st_client_id=C(),e.params.st_session_id=D(),n||(M({event:e.event,params:e.params}),Y({target:e.event,params:e.params}),z({event:e.event,name:e.name,params:e.params}))}};var L=require("react"),Te=()=>{let e=typeof localStorage<"u",t=!!(e&&localStorage.getItem("st_client_id")),o=!!(e&&localStorage.getItem("st_session_id")),n=w(e?localStorage.getItem("st_client_id"):null);return(!t||n)&&k(),o||(E(),g({event:"session_start",name:"\u041D\u0430\u0447\u0430\u043B\u043E \u0441\u0435\u0441\u0441\u0438\u0438"})),(0,L.useEffect)(()=>{let i=localStorage.getItem("tabCount"),r=i?parseInt(i):0;r<0&&(localStorage.setItem("tabCount",String(0)),r=0),r++,r&&localStorage.setItem("tabCount",String(r));let s=()=>{let l=localStorage.getItem("tabCount");if(l&&typeof window<"u"){let u=String(Number(l)-1),_=window.scrollY,p=document.documentElement.scrollHeight-document.documentElement.clientHeight,f=_/p*100;g({event:"scroll",name:"\u041F\u0435\u0440\u0435\u0445\u043E\u0434 \u0438\u043B\u0438 \u0443\u0445\u043E\u0434 \u0441\u043E \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B",params:{scroll_percent:f.toFixed(0)+"%"}}),u==="0"&&(g({event:"session_end",name:"\u041A\u043E\u043D\u0435\u0446 \u0441\u0435\u0441\u0441\u0438\u0438"}),localStorage.setItem("st_session_id","")),localStorage.setItem("tabCount",u)}};return window.addEventListener("beforeunload",s),()=>{window.removeEventListener("beforeunload",s)}},[]),(0,L.useEffect)(()=>{let i,r=()=>{clearTimeout(i),i=setTimeout(()=>{localStorage.setItem("st_session_id",""),g({event:"timeout_30min",name:"\u041A\u043E\u043D\u0435\u0446 \u0441\u0435\u0441\u0441\u0438\u0438"})},18e5)},s=["mousemove","click","touchstart","scroll","keydown"];return s.forEach(l=>{window.addEventListener(l,r)}),r(),()=>{s.forEach(l=>{window.removeEventListener(l,r)}),clearTimeout(i)}},[]),{}};var v=require("react"),we=()=>{let[e,t]=(0,v.useState)({loadedComagic:!1,errorComagic:!1});return(0,v.useEffect)(()=>{if(window.Comagic){t({loadedComagic:!0,errorComagic:!1});return}let o=setInterval(()=>{window.Comagic&&(t({loadedComagic:!0,errorComagic:!1}),clearInterval(o))},300);return()=>clearInterval(o)},[]),e};var Ee=e=>{if(typeof document>"u")return null;let t=e==null?void 0:e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`(^|;\\s*)${t}=([^;]*)`),n=document.cookie.match(o);return n?decodeURIComponent(n[2]):null};var de=require("mobx");var X={commercial:"offices",residential:"apartments",retail:"retail",investments:"investments"},H={"stone.moscow":"apartments","stone-sokolniki":"apartments","sokolniki-stone":"apartments","stone-rise":"apartments","stone-hod":"offices"},A=(e,t)=>{let o=null;if(t&&(Object.keys(H).forEach(r=>{t.includes(r)&&(o=H[r])}),o))return o;switch(e){case"/commercial/sokolniki-retail":return"retail";case"/commercial/mnevniki-retail":return"retail"}let n=Object.keys(X).filter(r=>e.includes(r))[0],i=X[n];return i||null};var G=/^\/commercial\/[^/]+$/,J=/^\/residential\/[^/]+$/,h=/^\/catalog\/commercial\/([a-z0-9_#-]+)(?:\/[a-z0-9_#-]+)*$/i,S=/^\/catalog\/residential\/([a-z0-9_#-]+)(?:\/[a-z0-9_#-]+)*$/i;var V={"/":"main","/loyalty":"loyalty","/residential":"category_page","/commercial":"category_page","/retail":"category_page","/rent":"rent","/service":"services","/presscenter":"press_center","/purchaseterms":"terms_of_purchase","/purchaseterms/residential":"terms_of_purchase","/contacts":"contacts","/documents":"documents","/documents/docs":"documents","/documents/soglasie-na-rassylki":"documents","/documents/politika-konfidenczialnosti":"documents","/documents/usloviya-loyalty":"documents","/investments":"investments","/about":"about_company","/catalog/commercial":"lot_catalog","/catalog/residential":"lot_catalog"},q={"/":"project_card","/policy":"project_card"},K={"/":"stoneHod_main","/policy":"stoneHod_policy"},W={"stone.moscow":"category_page","stone-sokolniki":"project_card","sokolniki-stone":"project_card","stone-rise":"project_card","stone-hod":"category_page"},B=(e,t="stone",o)=>{let n=null;if(o&&(Object.keys(W).forEach(i=>{o.includes(i)&&(n=W[i])}),n))return n;if(e)switch(t){case"stone":return Object.keys(V).includes(e)?V[e]:G.test(e)||J.test(e)?"project_card":h.test(e)||S.test(e)?"lot_card":null;case"sokolniki":return q[e];case"stone-hod":return K[e];default:return null}return"other"};var ke=/^\/commercial\/([^/]+)$/,be=/^\/residential\/([^/]+)$/,Q={"stone-sokolniki":"sokolniki","sokolniki-stone":"sokolniki","stone-rise":"rise","stone-hod":"hodinka"},j=(e,t)=>{let o=null,n=e.match(ke),i=e.match(be),r=e.match(h),s=e.match(S);return t&&Object.keys(Q).forEach(l=>{t.includes(l)&&(o=Q[l])}),o||(r?r[1]:s?s[1]:n?n[1]:i?i[1]:null)};var Ie=/^\/catalog\/commercial\/(?:[a-z0-9_#-]+\/)*([a-z0-9_#-]+)$/i,De=/^\/catalog\/residential\/(?:[a-z0-9_#-]+\/)*([a-z0-9_#-]+)$/i,F=e=>{let t=e.match(Ie),o=e.match(De);return t?t[1]:o?o[1]:null};var a=e=>({ym_uid:e.ym_uid??null,cm_visitor_id:e.cm_visitor_id??null,cm_session_id:e.cm_session_id??null,fingerprint_id:(e==null?void 0:e.fingerprint_id)??null,visible_virtual_pn:(e==null?void 0:e.visible_virtual_pn)??null,page_type:e.page_type,page_direction:e.page_direction,page_project:e.page_project,page_lot:e.page_lot,ab_test_name:e.ab_test_name,ab_test_group:e.ab_test_group,user_id:e.initializeUserId()??null});var Z=async({store:e})=>{try{let t=a(e),o={event:"pageview"},n={...t};delete n.ym_uid,e.pushLayer({...n,...o})}catch(t){console.log("error",t)}};var ee=async({store:e})=>{try{let t=a(e),o={event:"pageview_force"};e.pushLayer({...t,...o})}catch(t){console.log("error",t)}};var te=require("js-md5"),m=()=>{var t,o;let e=(o=(t=document.getElementById("header_phone"))==null?void 0:t.getAttribute("href"))==null?void 0:o.replace(/\D/g,"");return typeof e=="string"?(0,te.md5)(e):void 0};var oe=e=>{if(typeof window<"u"&&typeof ym<"u"){let t;return ym(e,"getClientID",function(o){t=o}),t??null}};var ne=()=>typeof Comagic<"u"?Comagic&&Comagic.getVisitorId():null,re=()=>typeof Comagic<"u"?Comagic&&Comagic.getSessionId():null;var c=e=>{e.ym_uid=oe(95057596),e.cm_visitor_id=ne(),e.cm_session_id=re()};var ie=async({store:e,lead_id:t,block_name:o,auth:n,submitted_lot:i,submitted_lot_project:r})=>{try{let s=a(e),l={event:"submit",lead_id:String(t),block_name:o,auth:n,submitted_lot:i??null,submitted_lot_project:r??null};s.visible_virtual_pn=m(),c(s),e.pushLayer({...s,...l})}catch(s){console.log("error",s)}};var se=async({store:e,block_name:t,list_of_lots:o})=>{try{let n=a(e),i={event:"lot_feed_show",block_name:t,list_of_lots:o},r={...n};c(n),delete r.ym_uid,delete r.cm_visitor_id,delete r.cm_session_id,n.visible_virtual_pn=m(),e.pushLayer({...n,...i})}catch(n){console.log("error",n)}};var ae=async({store:e,action_element:t,action_element_text:o,block_name:n,clicked_url:i,auth:r,clicked_lot:s,clicked_lot_project:l,clicked_lot_position:u,action_element_status:_})=>{try{let p=a(e),f={event:"click",action_element:t,action_element_text:o,block_name:n,auth:r,clicked_url:i,clicked_lot:s??null,clicked_lot_project:l??null,clicked_lot_position:u??null};_&&(f.action_element_status=_),p.visible_virtual_pn=m(),c(p),e.pushLayer({...p,...f})}catch(p){console.log("error",p)}};var ce=async({store:e,action_element:t,auth:o,action_element_text:n,block_name:i})=>{try{let r=a(e),s={event:"check",action_element:t,auth:o,action_element_text:n,block_name:i};r.visible_virtual_pn=m(),c(r),e.pushLayer({...r,...s})}catch(r){console.log("error",r)}};var le=async({store:e,action_element:t,block_name:o,auth:n,action_element_status:i})=>{try{let r=a(e),s={event:"blur",action_element:t,action_element_status:i,block_name:o,auth:n};r.visible_virtual_pn=m(),c(r),e.pushLayer({...r,...s})}catch(r){console.log("error",r)}};var me=async({store:e})=>{try{let t=a(e),o={event:"fullscreenview"};t.visible_virtual_pn=m(),c(t),e.pushLayer({...t,...o})}catch(t){console.log("error",t)}};var pe=async({store:e,banner_text:t,banner_link:o,auth:n,block_name:i})=>{try{let r=a(e),s={event:"banner_show",banner_text:t,banner_link:o,auth:n,block_name:i};c(r),e.pushLayer({...r,...s})}catch(r){console.log("error",r)}};var ge=async({store:e,banner_text:t,banner_link:o,auth:n,clicked_url:i,block_name:r})=>{try{let s=a(e),l={event:"banner_click",banner_text:t,banner_link:o,auth:n,clicked_url:i,block_name:r};c(s),e.pushLayer({...s,...l})}catch(s){console.log("error",s)}};var T=class{pageParamsIsLoading;pageParamsWasSet;ym_uid;cm_visitor_id;cm_session_id;fingerprint_id;visible_virtual_pn;page_type;page_direction;page_project;page_lot;ab_test_name;ab_test_group;constructor(){this.pageParamsIsLoading=!1,this.pageParamsWasSet=!1,this.page_type=void 0,this.page_direction=void 0,this.page_project=void 0,this.page_lot=void 0,(0,de.makeAutoObservable)(this)}initializeUserId(){return typeof window>"u"?null:localStorage.getItem("user_reg_id")}pushLayer(t){typeof window<"u"&&(window.StoneDataLayer||[]).push(t)}setPageParams({pathname:t,source:o,href:n}){this.pageParamsIsLoading=!0,this.page_direction=A(t,n),this.page_type=B(t,o,n),this.page_project=j(t,n),this.page_lot=F(t),this.ab_test_name="abgroup",this.ab_test_group=process.env.NEXT_PUBLIC_AB_TEST_GROUP,this.pageParamsIsLoading=!1,this.pageParamsWasSet=!0}async setFingerPrint(){this.fingerprint_id=await I()??null}async setEventPageView(t){await Z({store:this,...t})}async setEventPageViewForce(){await ee({store:this})}async setEventSubmit(t){await ie({store:this,...t})}async setEventLotFeedShow(t){await se({store:this,...t})}async setEventClick(t){await ae({store:this,...t})}async setEventCheck(t){await ce({store:this,...t})}async setEventBlur(t){await le({store:this,...t})}async setEventFullScreen(){await me({store:this})}async setEventBannerShow(t){await pe({store:this,...t})}async setEventBannerClick(t){await ge({store:this,...t})}},Ce=new T;0&&(module.exports={StoneDataLayerStore,checkTimeStamp,getABCookie,getGoogleAnalyticsClientId,getLotName,getPageDirection,getPageType,getProjectName,getStoneClientId,getStoneHashClientId,getStoneSessionId,getYandexMetrikaClientId,sendAnalytics,setClientId,setSessionId,sokolnikiPageViewType,staticPageViewType,stoneDataLayerStore,stoneHodPageViewType,useComagicStatus,useInitializeMetrics});
|
|
1
|
+
var vt=Object.create;var y=Object.defineProperty;var ht=Object.getOwnPropertyDescriptor;var St=Object.getOwnPropertyNames;var Tt=Object.getPrototypeOf,wt=Object.prototype.hasOwnProperty;var Et=(t,e)=>{for(var o in e)y(t,o,{get:e[o],enumerable:!0})},$=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of St(e))!wt.call(t,r)&&r!==o&&y(t,r,{get:()=>e[r],enumerable:!(n=ht(e,r))||n.enumerable});return t};var R=(t,e,o)=>(o=t!=null?vt(Tt(t)):{},$(e||!t||!t.__esModule?y(o,"default",{value:t,enumerable:!0}):o,t)),kt=t=>$(y({},"__esModule",{value:!0}),t);var jt={};Et(jt,{StoneDataLayerStore:()=>D,checkTimeStamp:()=>C,getABCookie:()=>Dt,getGoogleAnalyticsClientId:()=>B,getLotName:()=>Y,getPageDirection:()=>O,getPageType:()=>U,getProjectName:()=>z,getStoneClientId:()=>V,getStoneHashClientId:()=>A,getStoneSessionId:()=>j,getYandexMetrikaClientId:()=>F,sendAnalytics:()=>d,setClientId:()=>x,setSessionId:()=>P,sokolnikiPageViewType:()=>tt,staticPageViewType:()=>M,stoneDataLayerStore:()=>At,stoneHodPageViewType:()=>et,useComagicStatus:()=>It,useInitializeMetrics:()=>bt});module.exports=kt(jt);var f=()=>String(Date.now())+String(Math.floor(Math.random()*9e8)+1e8);var X=typeof localStorage<"u",C=t=>{if(!t)return!1;let e=Number(t.slice(0,10)),o=new Date(e*1e3),n=new Date(new Date().toISOString());return n.getFullYear()>o.getFullYear()&&n.getMonth()>=o.getMonth()&&n.getDate()>=o.getDate()},P=()=>{let t=f();X&&localStorage.setItem("st_session_id",t)},x=()=>{let t=f();X&&localStorage.setItem("st_client_id",t)};var H=t=>{var e;if(typeof window<"u"){let o=process.env.NEXT_PUBLIC_IS_TEST==="true",n=window.location.pathname,r=window.location.href,i={event:t.event,st_event_id:(e=t.params)==null?void 0:e.st_event_id,page_path:n,page_url:r};t.params.st_session_id&&(i.st_session_id=t.params.st_session_id),t.params.st_client_id&&(i.st_client_id=t.params.st_client_id),t.params.project&&(i.project=t.params.project),t.params.lot_id&&(i.lot_id=t.params.lot_id),o||(window.dataLayer=window.dataLayer||[],window.dataLayer.push(i))}};var G=t=>{if(typeof ym<"u"&&typeof window<"u"){let e=process.env.NEXT_PUBLIC_IS_TEST==="true";(typeof process.env.NEXT_PUBLIC_YM_COUNTER>"u"||!process.env.NEXT_PUBLIC_YM_COUNTER)&&console.log("Yandex counter \u043D\u0435 \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D \u0432 \u043A\u043E\u043D\u0444\u0438\u0433\u0435 .env.local"),e||(ym(process.env.NEXT_PUBLIC_YM_COUNTER,"reachGoal",t.target,t.params),console.log("Yandex Metrika "+process.env.NEXT_PUBLIC_YM_COUNTER+" reachGoal: "+t.target,t.params))}else console.log("Yandex Metrika \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u0430")};var W=async t=>{if(typeof window<"u"){let e=process.env.NEXT_PUBLIC_IS_TEST==="true",o="https://stone.ru/api/analytics/send-event",n=window.location.pathname,r=window.location.href,i={event:t.event,name:t.name,payload:{...t.params,page_path:n,page_url:r}};try{e||await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})}catch{console.log("can't sendAnalyticsToAPI")}}else return};var q=R(require("@fingerprintjs/fingerprintjs"));var J=R(require("@fingerprintjs/fingerprintjs")),L=require("cookies-next"),A=async()=>{let t;try{return await J.default.load().then(o=>o.get()).then(o=>{t=o.visitorId}),t}catch(e){console.log("error fingerprintJS"+e)}},j=()=>{let t=localStorage.getItem("st_session_id");if(t&&t!="")return t},V=()=>{let t=localStorage.getItem("st_client_id");if(t&&t!="")return t},B=()=>{let t=String((0,L.getCookie)("_ga"));if(t&&t!="")return t;{let e=localStorage.getItem("_ga");if(e&&e!="")return e}},F=()=>{let t=String((0,L.getCookie)("_ym_uid"));if(t&&t!="")return t;{let e=localStorage.getItem("_ym_uid");if(e&&e!="")return e}};var d=async t=>{var e;if(typeof window<"u"){let o=q.default.load(),n=process.env.NEXT_PUBLIC_IS_TEST==="true";t.params=t.params||{},t.params.st_event_id=f(),t.params.date=(e=new Date().toISOString().slice(0,19))==null?void 0:e.replace("T"," ");try{await o.then(r=>r.get()).then(r=>{t.params&&(t.params.st_client_hash_id=r.visitorId)})}catch(r){console.log("error fingerprintJS"+r)}t.params.ym_client_id=F(),t.params.ga_client_id=B(),t.params.st_client_id=V(),t.params.st_session_id=j(),n||(H({event:t.event,params:t.params}),G({target:t.event,params:t.params}),W({event:t.event,name:t.name,params:t.params}))}};var N=require("react"),bt=()=>{let t=typeof localStorage<"u",e=!!(t&&localStorage.getItem("st_client_id")),o=!!(t&&localStorage.getItem("st_session_id")),n=C(t?localStorage.getItem("st_client_id"):null);return(!e||n)&&x(),o||(P(),d({event:"session_start",name:"\u041D\u0430\u0447\u0430\u043B\u043E \u0441\u0435\u0441\u0441\u0438\u0438"})),(0,N.useEffect)(()=>{let r=localStorage.getItem("tabCount"),i=r?parseInt(r):0;i<0&&(localStorage.setItem("tabCount",String(0)),i=0),i++,i&&localStorage.setItem("tabCount",String(i));let s=()=>{let l=localStorage.getItem("tabCount");if(l&&typeof window<"u"){let g=String(Number(l)-1),_=window.scrollY,p=document.documentElement.scrollHeight-document.documentElement.clientHeight,u=_/p*100;d({event:"scroll",name:"\u041F\u0435\u0440\u0435\u0445\u043E\u0434 \u0438\u043B\u0438 \u0443\u0445\u043E\u0434 \u0441\u043E \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B",params:{scroll_percent:u.toFixed(0)+"%"}}),g==="0"&&(d({event:"session_end",name:"\u041A\u043E\u043D\u0435\u0446 \u0441\u0435\u0441\u0441\u0438\u0438"}),localStorage.setItem("st_session_id","")),localStorage.setItem("tabCount",g)}};return window.addEventListener("beforeunload",s),()=>{window.removeEventListener("beforeunload",s)}},[]),(0,N.useEffect)(()=>{let r,i=()=>{clearTimeout(r),r=setTimeout(()=>{localStorage.setItem("st_session_id",""),d({event:"timeout_30min",name:"\u041A\u043E\u043D\u0435\u0446 \u0441\u0435\u0441\u0441\u0438\u0438"})},18e5)},s=["mousemove","click","touchstart","scroll","keydown"];return s.forEach(l=>{window.addEventListener(l,i)}),i(),()=>{s.forEach(l=>{window.removeEventListener(l,i)}),clearTimeout(r)}},[]),{}};var v=require("react"),It=()=>{let[t,e]=(0,v.useState)({loadedComagic:!1,errorComagic:!1});return(0,v.useEffect)(()=>{if(window.Comagic){e({loadedComagic:!0,errorComagic:!1});return}let o=setInterval(()=>{window.Comagic&&(e({loadedComagic:!0,errorComagic:!1}),clearInterval(o))},300);return()=>clearInterval(o)},[]),t};var Dt=t=>{if(typeof document>"u")return null;let e=t==null?void 0:t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`(^|;\\s*)${e}=([^;]*)`),n=document.cookie.match(o);return n?decodeURIComponent(n[2]):null};var yt=require("mobx");var K={commercial:"offices",residential:"apartments",retail:"retail",offices:"offices",investments:"investments"},Q={"stone.moscow":"apartments","stone-sokolniki":"apartments","sokolniki-stone":"apartments","stone-rise":"apartments","stone-hod":"offices"},O=(t,e)=>{let o=null;if(e&&(Object.keys(Q).forEach(i=>{e.includes(i)&&(o=Q[i])}),o))return o;switch(t){case"/commercial/sokolniki-retail":return"retail";case"/commercial/mnevniki-retail":return"retail"}let n=Object.keys(K).filter(i=>t.includes(i))[0],r=K[n];return r||null};var h=/^\/commercial\/[^/]+$/,S=/^\/residential\/[^/]+$/,T=/^\/catalog\/retail\/([^/]+)$/,w=/^\/catalog\/offices\/([^/]+)$/,E=/^\/catalog\/commercial\/([a-z0-9_#-]+)(?:\/[a-z0-9_#-]+)*$/i,k=/^\/catalog\/residential\/([a-z0-9_#-]+)(?:\/[a-z0-9_#-]+)*$/i,b=/^\/catalog\/retail\/([a-z0-9_#-]+)(?:\/[a-z0-9_#-]+)*$/i,I=/^\/catalog\/offices\/([a-z0-9_#-]+)(?:\/[a-z0-9_#-]+)*$/i;var M={"/":"main","/loyalty":"loyalty","/residential":"category_page","/commercial":"category_page","/retail":"category_page","/rent":"rent","/service":"services","/presscenter":"press_center","/purchaseterms":"terms_of_purchase","/purchaseterms/residential":"terms_of_purchase","/contacts":"contacts","/documents":"documents","/documents/docs":"documents","/documents/soglasie-na-rassylki":"documents","/documents/politika-konfidenczialnosti":"documents","/documents/usloviya-loyalty":"documents","/investments":"investments","/about":"about_company","/catalog/commercial":"lot_catalog","/catalog/residential":"lot_catalog","/catalog/retail":"lot_catalog","/catalog/offices":"lot_catalog"},tt={"/":"project_card","/policy":"project_card"},et={"/":"stoneHod_main","/policy":"stoneHod_policy"},Z={"stone.moscow":"category_page","stone-sokolniki":"project_card","sokolniki-stone":"project_card","stone-rise":"project_card","stone-hod":"category_page"},U=(t,e="stone",o)=>{let n=null;if(o&&(Object.keys(Z).forEach(r=>{o.includes(r)&&(n=Z[r])}),n))return n;if(t)switch(e){case"stone":return Object.keys(M).includes(t)?M[t]:h.test(t)||S.test(t)||T.test(t)||w.test(t)?"project_card":E.test(t)||k.test(t)||b.test(t)||I.test(t)?"lot_card":null;case"sokolniki":return tt[t];case"stone-hod":return et[t];default:return null}return"other"};var ot={"stone-sokolniki":"sokolniki","sokolniki-stone":"sokolniki","stone-rise":"rise","stone-hod":"hodinka"},z=(t,e)=>{let o=null,n=t.match(h),r=t.match(S),i=t.match(T),s=t.match(w),l=t.match(E),g=t.match(k),_=t.match(b),p=t.match(I);return e&&Object.keys(ot).forEach(u=>{e.includes(u)&&(o=ot[u])}),o||(l?l[1]:g?g[1]:_?_[1]:p?p[1]:n?n[1]:r?r[1]:i?i[1]:s?s[1]:null)};var Ct=/^\/catalog\/commercial\/(?:[a-z0-9_#-]+\/)*([a-z0-9_#-]+)$/i,Pt=/^\/catalog\/residential\/(?:[a-z0-9_#-]+\/)*([a-z0-9_#-]+)$/i,xt=/^\/catalog\/retail\/(?:[a-z0-9_#-]+\/)*([a-z0-9_#-]+)$/i,Lt=/^\/catalog\/offices\/(?:[a-z0-9_#-]+\/)*([a-z0-9_#-]+)$/i,Y=t=>{let e=t.match(Ct),o=t.match(Pt),n=t.match(xt),r=t.match(Lt);return e?e[1]:o?o[1]:n?n[1]:r?r[1]:null};var a=t=>({ym_uid:t.ym_uid??null,cm_visitor_id:t.cm_visitor_id??null,cm_session_id:t.cm_session_id??null,fingerprint_id:(t==null?void 0:t.fingerprint_id)??null,visible_virtual_pn:(t==null?void 0:t.visible_virtual_pn)??null,page_type:t.page_type,page_direction:t.page_direction,page_project:t.page_project,page_lot:t.page_lot,ab_test_name:t.ab_test_name,ab_test_group:t.ab_test_group,user_id:t.initializeUserId()??null});var nt=async({store:t})=>{try{let e=a(t),o={event:"pageview"},n={...e};delete n.ym_uid,t.pushLayer({...n,...o})}catch(e){console.log("error",e)}};var rt=async({store:t})=>{try{let e=a(t),o={event:"pageview_force"};t.pushLayer({...e,...o})}catch(e){console.log("error",e)}};var it=require("js-md5"),m=()=>{var e,o;let t=(o=(e=document.getElementById("header_phone"))==null?void 0:e.getAttribute("href"))==null?void 0:o.replace(/\D/g,"");return typeof t=="string"?(0,it.md5)(t):void 0};var st=t=>{if(typeof window<"u"&&typeof ym<"u"){let e;return ym(t,"getClientID",function(o){e=o}),e??null}};var at=()=>typeof Comagic<"u"?Comagic&&Comagic.getVisitorId():null,ct=()=>typeof Comagic<"u"?Comagic&&Comagic.getSessionId():null;var c=t=>{t.ym_uid=st(95057596),t.cm_visitor_id=at(),t.cm_session_id=ct()};var lt=async({store:t,lead_id:e,block_name:o,auth:n,submitted_lot:r,submitted_lot_project:i})=>{try{let s=a(t),l={event:"submit",lead_id:String(e),block_name:o,auth:n,submitted_lot:r??null,submitted_lot_project:i??null};s.visible_virtual_pn=m(),c(s),t.pushLayer({...s,...l})}catch(s){console.log("error",s)}};var mt=async({store:t,block_name:e,list_of_lots:o})=>{try{let n=a(t),r={event:"lot_feed_show",block_name:e,list_of_lots:o},i={...n};c(n),delete i.ym_uid,delete i.cm_visitor_id,delete i.cm_session_id,n.visible_virtual_pn=m(),t.pushLayer({...n,...r})}catch(n){console.log("error",n)}};var pt=async({store:t,action_element:e,action_element_text:o,block_name:n,clicked_url:r,auth:i,clicked_lot:s,clicked_lot_project:l,clicked_lot_position:g,action_element_status:_})=>{try{let p=a(t),u={event:"click",action_element:e,action_element_text:o,block_name:n,auth:i,clicked_url:r,clicked_lot:s??null,clicked_lot_project:l??null,clicked_lot_position:g??null};_&&(u.action_element_status=_),p.visible_virtual_pn=m(),c(p),t.pushLayer({...p,...u})}catch(p){console.log("error",p)}};var gt=async({store:t,action_element:e,auth:o,action_element_text:n,block_name:r})=>{try{let i=a(t),s={event:"check",action_element:e,auth:o,action_element_text:n,block_name:r};i.visible_virtual_pn=m(),c(i),t.pushLayer({...i,...s})}catch(i){console.log("error",i)}};var _t=async({store:t,action_element:e,block_name:o,auth:n,action_element_status:r})=>{try{let i=a(t),s={event:"blur",action_element:e,action_element_status:r,block_name:o,auth:n};i.visible_virtual_pn=m(),c(i),t.pushLayer({...i,...s})}catch(i){console.log("error",i)}};var ut=async({store:t})=>{try{let e=a(t),o={event:"fullscreenview"};e.visible_virtual_pn=m(),c(e),t.pushLayer({...e,...o})}catch(e){console.log("error",e)}};var dt=async({store:t,banner_text:e,banner_link:o,auth:n,block_name:r})=>{try{let i=a(t),s={event:"banner_show",banner_text:e,banner_link:o,auth:n,block_name:r};c(i),t.pushLayer({...i,...s})}catch(i){console.log("error",i)}};var ft=async({store:t,banner_text:e,banner_link:o,auth:n,clicked_url:r,block_name:i})=>{try{let s=a(t),l={event:"banner_click",banner_text:e,banner_link:o,auth:n,clicked_url:r,block_name:i};c(s),t.pushLayer({...s,...l})}catch(s){console.log("error",s)}};var D=class{pageParamsIsLoading;pageParamsWasSet;ym_uid;cm_visitor_id;cm_session_id;fingerprint_id;visible_virtual_pn;page_type;page_direction;page_project;page_lot;ab_test_name;ab_test_group;constructor(){this.pageParamsIsLoading=!1,this.pageParamsWasSet=!1,this.page_type=void 0,this.page_direction=void 0,this.page_project=void 0,this.page_lot=void 0,(0,yt.makeAutoObservable)(this)}initializeUserId(){return typeof window>"u"?null:localStorage.getItem("user_reg_id")}pushLayer(e){typeof window<"u"&&(window.StoneDataLayer||[]).push(e)}setPageParams({pathname:e,source:o,href:n}){let r=e.startsWith("/retail/")||e.startsWith("/offices/")?`/catalog${e}`:e;this.pageParamsIsLoading=!0,this.page_direction=O(r,n),this.page_type=U(r,o,n),this.page_project=z(r,n),this.page_lot=Y(r),this.ab_test_name="abgroup",this.ab_test_group=process.env.NEXT_PUBLIC_AB_TEST_GROUP,this.pageParamsIsLoading=!1,this.pageParamsWasSet=!0}async setFingerPrint(){this.fingerprint_id=await A()??null}async setEventPageView(e){await nt({store:this,...e})}async setEventPageViewForce(){await rt({store:this})}async setEventSubmit(e){await lt({store:this,...e})}async setEventLotFeedShow(e){await mt({store:this,...e})}async setEventClick(e){await pt({store:this,...e})}async setEventCheck(e){await gt({store:this,...e})}async setEventBlur(e){await _t({store:this,...e})}async setEventFullScreen(){await ut({store:this})}async setEventBannerShow(e){await dt({store:this,...e})}async setEventBannerClick(e){await ft({store:this,...e})}},At=new D;0&&(module.exports={StoneDataLayerStore,checkTimeStamp,getABCookie,getGoogleAnalyticsClientId,getLotName,getPageDirection,getPageType,getProjectName,getStoneClientId,getStoneHashClientId,getStoneSessionId,getYandexMetrikaClientId,sendAnalytics,setClientId,setSessionId,sokolnikiPageViewType,staticPageViewType,stoneDataLayerStore,stoneHodPageViewType,useComagicStatus,useInitializeMetrics});
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/utils/makeUID.ts","../src/utils/sessionClientId.ts","../src/dataLayerPush/dataLayerPush.ts","../src/ymTarget/ymaTarget.ts","../src/sendAnalyticsToAPI/sendAnalyticsToAPI.ts","../src/sendAnalytics/sendAnalytics.ts","../src/utils/utils.ts","../src/hooks/useInitializeMetrics.ts","../src/utils/useComagicStatus.ts","../src/utils/getABCookie.ts","../src/store/StoneDataLayerStore/StoneDataLayerStore.ts","../src/store/StoneDataLayerStore/utils/pageDirection.ts","../src/store/StoneDataLayerStore/utils/regs.ts","../src/store/StoneDataLayerStore/utils/pageType.ts","../src/store/StoneDataLayerStore/utils/getProjectName.ts","../src/store/StoneDataLayerStore/utils/getLotName.ts","../src/store/StoneDataLayerStore/utils/getDefaultAnalyticsData.ts","../src/store/StoneDataLayerStore/events/eventPageView.ts","../src/store/StoneDataLayerStore/events/eventPageViewForce.ts","../src/utils/getVisibleVirtualPn.ts","../src/store/StoneDataLayerStore/utils/getYmUid.ts","../src/store/StoneDataLayerStore/utils/getComagicId.ts","../src/store/StoneDataLayerStore/utils/setAnalyticId.ts","../src/store/StoneDataLayerStore/events/eventSubmit.ts","../src/store/StoneDataLayerStore/events/eventLotFeedShow.ts","../src/store/StoneDataLayerStore/events/eventClick.ts","../src/store/StoneDataLayerStore/events/eventCheck.ts","../src/store/StoneDataLayerStore/events/eventBlur.ts","../src/store/StoneDataLayerStore/events/eventFullScreenView.ts","../src/store/StoneDataLayerStore/events/eventBannerShow.ts","../src/store/StoneDataLayerStore/events/eventBannerClick.ts"],"sourcesContent":["export * from './utils/sessionClientId'\r\nexport * from './sendAnalytics/sendAnalytics'\r\nexport * from './hooks/useInitializeMetrics'\r\nexport * from './utils/utils'\r\nexport * from './utils/useComagicStatus'\r\nexport * from './utils/getABCookie'\r\n\r\nexport * from './store/StoneDataLayerStore/stoneDataLayer'\r\nexport * from './store/StoneDataLayerStore/StoneDataLayerStore'\r\nexport * from './store/StoneDataLayerStore/utils/pageDirection'\r\nexport * from './store/StoneDataLayerStore/utils/pageType'\r\nexport * from './store/StoneDataLayerStore/utils/getProjectName'\r\nexport * from './store/StoneDataLayerStore/utils/getLotName'\r\n","export const makeTimeBasedUID = (): string => {\r\n\treturn (\r\n\t\tString(Date.now()) + String(Math.floor(Math.random() * (999999999 - 100000000 + 1)) + 100000000)\r\n\t)\r\n}","import {makeTimeBasedUID} from './makeUID'\r\n\r\nconst isLocalStorage = typeof localStorage !== 'undefined'\r\n\r\nconst checkTimeStamp = (clientId: string | null) => {\r\n if (!clientId) return false\r\n\r\n const unixTimestamp = Number(clientId.slice(0, 10))\r\n const ISOSDate = new Date(unixTimestamp * 1000)\r\n const ISOSDateNow = new Date(new Date().toISOString())\r\n\r\n return (\r\n ISOSDateNow.getFullYear() > ISOSDate.getFullYear() &&\r\n ISOSDateNow.getMonth() >= ISOSDate.getMonth() &&\r\n ISOSDateNow.getDate() >= ISOSDate.getDate()\r\n )\r\n}\r\n\r\nconst setSessionId = () => {\r\n const newId = makeTimeBasedUID()\r\n if (isLocalStorage) localStorage.setItem('st_session_id', newId)\r\n}\r\n\r\nconst setClientId = () => {\r\n const newId = makeTimeBasedUID()\r\n if (isLocalStorage) localStorage.setItem('st_client_id', newId)\r\n}\r\n\r\nexport {setClientId, setSessionId, checkTimeStamp}","import { TAnalyticsVisitParams } from '../types/analytics'\r\n\r\nexport type TGADataLayer = {\r\n\tevent: string\r\n\tparams: TAnalyticsVisitParams\r\n}\r\n\r\nexport type DataLayerPush = {\r\n\tevent: string\r\n\tpage_path: string\r\n\tpage_url: string\r\n\tst_event_id?: string\r\n\tst_client_id?: string\r\n\tst_session_id?: string\r\n\tabTestGroup?: string\r\n\tproject?: string\r\n\tlot_id?: string | number\r\n}\r\n\r\ndeclare global {\r\n\tinterface Window {\r\n\t\tdataLayer: DataLayerPush[]\r\n\t}\r\n}\r\n\r\nexport const dataLayerPush = (data: TGADataLayer) => {\r\n\tif (typeof window !== 'undefined') {\r\n\t\tconst isTest = process.env.NEXT_PUBLIC_IS_TEST === 'true'\r\n\t\tconst pathname = window.location.pathname\r\n\t\tconst href = window.location.href\r\n\t\tconst layerEvent: DataLayerPush = {\r\n\t\t\tevent: data.event,\r\n\t\t\tst_event_id: data.params?.st_event_id,\r\n\t\t\tpage_path: pathname,\r\n\t\t\tpage_url: href,\r\n\t\t}\r\n\t\tif (data.params.st_session_id) {\r\n\t\t\tlayerEvent.st_session_id = data.params.st_session_id\r\n\t\t}\r\n\t\tif (data.params.st_client_id) {\r\n\t\t\tlayerEvent.st_client_id = data.params.st_client_id\r\n\t\t}\r\n\t\tif (data.params.project) {\r\n\t\t\tlayerEvent.project = data.params.project\r\n\t\t}\r\n\t\tif (data.params.lot_id) {\r\n\t\t\tlayerEvent.lot_id = data.params.lot_id\r\n\t\t}\r\n\r\n\t\tif (!isTest) {\r\n\t\t\twindow.dataLayer = window.dataLayer || []\r\n\t\t\twindow.dataLayer.push(layerEvent)\r\n\t\t}\r\n\t}\r\n}\r\n\r\n","import { TAnalyticsVisitParams } from '../types/analytics'\r\n\r\nexport type TYMTarget = {\r\n\ttarget: string\r\n\tparams: TAnalyticsVisitParams\r\n}\r\n\r\ndeclare let ym: any\r\n/**\r\n * Отправка события в Яндек метрику\r\n * @param data\r\n */\r\nexport const ymTarget = (data: TYMTarget) => {\r\n\tif (typeof ym !== 'undefined' && typeof window !== 'undefined') {\r\n\t\tconst isTest = process.env.NEXT_PUBLIC_IS_TEST === 'true'\r\n\t\tif (\r\n\t\t\ttypeof process.env.NEXT_PUBLIC_YM_COUNTER == 'undefined' ||\r\n\t\t\t!process.env.NEXT_PUBLIC_YM_COUNTER\r\n\t\t) {\r\n\t\t\tconsole.log('Yandex counter не определен в конфиге .env.local')\r\n\t\t}\r\n\t\tif (!isTest) {\r\n\t\t\tym(process.env.NEXT_PUBLIC_YM_COUNTER, 'reachGoal', data.target, data.params)\r\n\r\n\t\t\tconsole.log(\r\n\t\t\t\t'Yandex Metrika ' + process.env.NEXT_PUBLIC_YM_COUNTER + ' reachGoal: ' + data.target,\r\n\t\t\t\tdata.params\r\n\t\t\t)\r\n\t\t}\r\n\t} else {\r\n\t\tconsole.log('Yandex Metrika не найдена')\r\n\t}\r\n}\r\n\r\n","import { TAnalyticsVisitParams } from '../types/analytics'\r\n\r\nexport type TAnalyticsApiData = {\r\n\tevent: string\r\n\tname: string\r\n\tmouse_X?: string\r\n\tmouse_Y?: string\r\n\tparams: TAnalyticsVisitParams\r\n}\r\n\r\nexport const sendAnalyticsToAPI = async (data: TAnalyticsApiData) => {\r\n\tif (typeof window !== 'undefined') {\r\n\t\tconst isTest = process.env.NEXT_PUBLIC_IS_TEST === 'true'\r\n\t\tconst url = `https://stone.ru/api/analytics/send-event`\r\n\t\tconst pathname = window.location.pathname\r\n\t\tconst href = window.location.href\r\n\r\n\t\tconst formData = {\r\n\t\t\tevent: data.event,\r\n\t\t\tname: data.name,\r\n\t\t\tpayload: { ...data.params, ...{ page_path: pathname, page_url: href } },\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tif (!isTest) {\r\n\t\t\t\tawait fetch(url, {\r\n\t\t\t\t\tmethod: 'POST',\r\n\t\t\t\t\theaders: {\r\n\t\t\t\t\t\t'Content-Type': 'application/json',\r\n\t\t\t\t\t},\r\n\t\t\t\t\tbody: JSON.stringify(formData),\r\n\t\t\t\t})\r\n\t\t\t\t// console.log('sendAnalyticsToAPI:', formData)\r\n\t\t\t}\r\n\t\t} catch (e) {\r\n\t\t\tconsole.log(\"can't sendAnalyticsToAPI\")\r\n\t\t}\r\n\t} else return\r\n}\r\n\r\n","import {TAnalyticsData} from '../types/analytics'\r\nimport {dataLayerPush} from '../dataLayerPush/dataLayerPush'\r\nimport {ymTarget} from '../ymTarget/ymaTarget'\r\nimport {sendAnalyticsToAPI} from '../sendAnalyticsToAPI/sendAnalyticsToAPI'\r\nimport {makeTimeBasedUID} from '../utils/makeUID'\r\nimport FingerprintJS from '@fingerprintjs/fingerprintjs'\r\nimport {\r\n getGoogleAnalyticsClientId,\r\n getStoneClientId,\r\n getStoneSessionId,\r\n getYandexMetrikaClientId\r\n} from \"../utils/utils\";\r\n\r\nexport const sendAnalytics = async (data: TAnalyticsData) => {\r\n if (typeof window !== 'undefined') {\r\n const fpPromise = FingerprintJS.load()\r\n const isTest = process.env.NEXT_PUBLIC_IS_TEST === 'true'\r\n\r\n data.params = data.params || {}\r\n data.params.st_event_id = makeTimeBasedUID()\r\n data.params.date = new Date().toISOString().slice(0, 19)?.replace('T', ' ');\r\n\r\n try {\r\n await fpPromise\r\n .then((fp) => fp.get())\r\n .then((result) => {\r\n if (data.params) {\r\n data.params.st_client_hash_id = result.visitorId\r\n }\r\n })\r\n } catch (e) {\r\n console.log('error fingerprintJS' + e)\r\n }\r\n\r\n data.params.ym_client_id = getYandexMetrikaClientId()\r\n data.params.ga_client_id = getGoogleAnalyticsClientId()\r\n data.params.st_client_id = getStoneClientId()\r\n data.params.st_session_id = getStoneSessionId()\r\n\r\n if (!isTest) {\r\n dataLayerPush({event: data.event, params: data.params})\r\n ymTarget({target: data.event, params: data.params})\r\n sendAnalyticsToAPI({event: data.event, name: data.name, params: data.params})\r\n }\r\n }\r\n}\r\n","import FingerprintJS from '@fingerprintjs/fingerprintjs'\r\nimport {getCookie} from \"cookies-next\";\r\n\r\nexport const getStoneHashClientId = async () => {\r\n let st_client_hash_id\r\n try {\r\n const fpPromise = FingerprintJS.load()\r\n await fpPromise\r\n .then((fp) => fp.get())\r\n .then((result) => {\r\n st_client_hash_id = result.visitorId\r\n })\r\n return st_client_hash_id\r\n } catch (e) {\r\n console.log('error fingerprintJS' + e)\r\n }\r\n return undefined\r\n}\r\nexport const getStoneSessionId = () => {\r\n const st_session_id = localStorage.getItem('st_session_id')\r\n if (st_session_id && st_session_id != '') {\r\n return st_session_id\r\n }\r\n return undefined\r\n}\r\nexport const getStoneClientId = () => {\r\n const st_client_id = localStorage.getItem('st_client_id')\r\n if (st_client_id && st_client_id != '') {\r\n return st_client_id\r\n }\r\n return undefined\r\n}\r\nexport const getGoogleAnalyticsClientId = () => {\r\n const _ga = String(getCookie('_ga'))\r\n if (_ga && _ga != '') {\r\n return _ga\r\n } else {\r\n const _ga_local = localStorage.getItem('_ga')\r\n if (_ga_local && _ga_local != '') {\r\n return _ga_local\r\n }\r\n }\r\n return undefined\r\n}\r\nexport const getYandexMetrikaClientId = () => {\r\n const _ym_uid = String(getCookie('_ym_uid'))\r\n if (_ym_uid && _ym_uid != '') {\r\n return _ym_uid\r\n } else {\r\n const _ym_uid_local = localStorage.getItem('_ym_uid')\r\n if (_ym_uid_local && _ym_uid_local != '') {\r\n return _ym_uid_local\r\n }\r\n }\r\n return undefined\r\n}","import { checkTimeStamp, setClientId, setSessionId } from '../utils/sessionClientId'\r\nimport { sendAnalytics } from '../sendAnalytics/sendAnalytics'\r\nimport { useEffect } from 'react'\r\n\r\nexport const useInitializeMetrics = () => {\r\n\tconst isLocalStorage = typeof localStorage !== 'undefined'\r\n\r\n\tconst isClientId = Boolean(isLocalStorage ? localStorage.getItem('st_client_id') : null)\r\n\tconst isSessionId = Boolean(isLocalStorage ? localStorage.getItem('st_session_id') : null)\r\n\tconst isYearPast = checkTimeStamp(isLocalStorage ? localStorage.getItem('st_client_id') : null)\r\n\r\n\tif (!isClientId || isYearPast) setClientId()\r\n\r\n\tif (!isSessionId) {\r\n\t\tsetSessionId()\r\n\t\tsendAnalytics({\r\n\t\t\tevent: 'session_start',\r\n\t\t\tname: 'Начало сессии',\r\n\t\t})\r\n\t}\r\n\r\n\tuseEffect(() => {\r\n\t\tconst tabCountStorage = localStorage.getItem('tabCount')\r\n\r\n\t\t// При открытии вкладки\r\n\t\tlet tabCount = tabCountStorage ? parseInt(tabCountStorage) : 0\r\n\t\tif (tabCount < 0) {\r\n\t\t\tlocalStorage.setItem('tabCount', String(0))\r\n\t\t\ttabCount = 0\r\n\t\t}\r\n\r\n\t\ttabCount++\r\n\t\tif (tabCount) localStorage.setItem('tabCount', String(tabCount))\r\n\r\n\t\t// Обработчик для закрытия вкладки\r\n\t\tconst handleBeforeUnload = () => {\r\n\t\t\tconst tabCountStorage = localStorage.getItem('tabCount')\r\n\t\t\tif (tabCountStorage && typeof window !== 'undefined') {\r\n\t\t\t\tconst tabCount = String(Number(tabCountStorage) - 1)\r\n\t\t\t\tconst scrollTop = window.scrollY\r\n\t\t\t\tconst scrollHeight =\r\n\t\t\t\t\tdocument.documentElement.scrollHeight - document.documentElement.clientHeight\r\n\t\t\t\tconst scrollPercent = (scrollTop / scrollHeight) * 100\r\n\r\n\t\t\t\tsendAnalytics({\r\n\t\t\t\t\tevent: 'scroll',\r\n\t\t\t\t\tname: 'Переход или уход со страницы',\r\n\t\t\t\t\tparams: { scroll_percent: scrollPercent.toFixed(0) + '%' },\r\n\t\t\t\t})\r\n\r\n\t\t\t\tif (tabCount === '0') {\r\n\t\t\t\t\tsendAnalytics({\r\n\t\t\t\t\t\tevent: 'session_end',\r\n\t\t\t\t\t\tname: 'Конец сессии',\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t\tlocalStorage.setItem('st_session_id', '')\r\n\t\t\t\t}\r\n\t\t\t\tlocalStorage.setItem('tabCount', tabCount)\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\twindow.addEventListener('beforeunload', handleBeforeUnload)\r\n\t\treturn () => {\r\n\t\t\twindow.removeEventListener('beforeunload', handleBeforeUnload)\r\n\t\t}\r\n\t}, [])\r\n\r\n\tuseEffect(() => {\r\n\t\tlet inactivityTimer: NodeJS.Timeout\r\n\r\n\t\tconst resetInactivityTimer = () => {\r\n\t\t\tclearTimeout(inactivityTimer)\r\n\t\t\t// 30 минут\r\n\t\t\tinactivityTimer = setTimeout(() => {\r\n\t\t\t\tlocalStorage.setItem('st_session_id', '')\r\n\r\n\t\t\t\tsendAnalytics({\r\n\t\t\t\t\tevent: 'timeout_30min',\r\n\t\t\t\t\tname: 'Конец сессии',\r\n\t\t\t\t})\r\n\t\t\t}, 30 * 60 * 1000)\r\n\t\t}\r\n\r\n\t\tconst events = ['mousemove', 'click', 'touchstart', 'scroll', 'keydown']\r\n\t\tevents.forEach((event) => {\r\n\t\t\twindow.addEventListener(event, resetInactivityTimer)\r\n\t\t})\r\n\r\n\t\t// Запускаем таймер при монтировании компонента\r\n\t\tresetInactivityTimer()\r\n\t\treturn () => {\r\n\t\t\tevents.forEach((event) => {\r\n\t\t\t\twindow.removeEventListener(event, resetInactivityTimer)\r\n\t\t\t})\r\n\t\t\tclearTimeout(inactivityTimer)\r\n\t\t}\r\n\t}, [])\r\n\r\n\treturn {}\r\n}\r\n","import { useEffect, useState } from 'react'\r\n\r\nexport const useComagicStatus = () => {\r\n const [status, setStatus] = useState({\r\n loadedComagic: false,\r\n errorComagic: false,\r\n })\r\n\r\n useEffect(() => {\r\n if (window.Comagic) {\r\n setStatus({ loadedComagic: true, errorComagic: false })\r\n return\r\n }\r\n\r\n const timer = setInterval(() => {\r\n if (window.Comagic) {\r\n setStatus({ loadedComagic: true, errorComagic: false })\r\n clearInterval(timer)\r\n }\r\n }, 300)\r\n\r\n return () => clearInterval(timer)\r\n }, [])\r\n\r\n return status\r\n}\r\n","/**\r\n * Получает значение cookie по имени\r\n * @param name - Имя cookie\r\n * @returns Значение cookie или null, если не найдено\r\n */\r\nexport const getABCookie = (name: string): string | null => {\r\n // Проверяем доступность document (для SSR/SSG)\r\n if (typeof document === 'undefined') return null;\r\n\r\n // Более читаемый вариант регулярного выражения\r\n const escapedName = name?.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\r\n const regex = new RegExp(`(^|;\\\\s*)${escapedName}=([^;]*)`);\r\n const match = document.cookie.match(regex);\r\n\r\n return match ? decodeURIComponent(match[2]) : null;\r\n};","import { makeAutoObservable } from 'mobx'\r\nimport { getStoneHashClientId } from '../../utils/utils'\r\nimport { getPageDirection } from './utils/pageDirection'\r\nimport { getPageType, TSource } from './utils/pageType'\r\nimport { getProjectName } from './utils/getProjectName'\r\nimport { getLotName } from './utils/getLotName'\r\nimport { setEventPageView, TEventPageView } from './events/eventPageView'\r\nimport { setEventPageViewForce } from './events/eventPageViewForce'\r\nimport { setEventSubmit, TEventSubmit } from './events/eventSubmit'\r\nimport { setEventLotFeedShow, TEventLotFeedShow } from './events/eventLotFeedShow'\r\nimport { setEventClick, TEventClick } from './events/eventClick'\r\nimport { setEventCheck, TEventCheck } from './events/eventCheck'\r\nimport { setEventBlur, TEventBlur } from './events/eventBlur'\r\nimport { setEventFullScreen } from './events/eventFullScreenView'\r\nimport { setEventBannerShow, TEventBannerShow } from './events/eventBannerShow'\r\nimport { setEventBannerClick, TEventBannerClick } from './events/eventBannerClick'\r\n\r\ndeclare global {\r\n\tinterface Window {\r\n\t\tComagic?: any\r\n\t\tStoneDataLayer: any\r\n\t}\r\n}\r\n\r\nexport class StoneDataLayerStore {\r\n\tpageParamsIsLoading: boolean\r\n\tpageParamsWasSet: boolean\r\n\r\n\tym_uid?: string\r\n\tcm_visitor_id?: string\r\n\tcm_session_id?: string\r\n\tfingerprint_id?: string\r\n\tvisible_virtual_pn?: string\r\n\tpage_type?: string\r\n\tpage_direction?: string | null\r\n\tpage_project?: string | null\r\n\tpage_lot?: string | null\r\n\tab_test_name?: string | null\r\n\tab_test_group?: string | null\r\n\r\n\tconstructor() {\r\n\t\tthis.pageParamsIsLoading = false\r\n\t\tthis.pageParamsWasSet = false\r\n\t\tthis.page_type = undefined\r\n\t\tthis.page_direction = undefined\r\n\t\tthis.page_project = undefined\r\n\t\tthis.page_lot = undefined\r\n\r\n\t\tmakeAutoObservable(this)\r\n\t}\r\n\r\n\tinitializeUserId() {\r\n\t\tif (typeof window === 'undefined') return null\r\n\t\treturn localStorage.getItem('user_reg_id')\r\n\t}\r\n\r\n\tpushLayer(tagManagerArgs: any) {\r\n\t\tif (typeof window !== 'undefined') {\r\n\t\t\tconst StoneDataLayer = window.StoneDataLayer || []\r\n\t\t\tStoneDataLayer.push(tagManagerArgs)\r\n\t\t}\r\n\t}\r\n\r\n\tsetPageParams({ pathname, source, href }: { pathname: string; source: TSource; href?: string }) {\r\n\t\tthis.pageParamsIsLoading = true\r\n\t\tthis.page_direction = getPageDirection(pathname, href)\r\n\t\tthis.page_type = getPageType(pathname, source, href)\r\n\t\tthis.page_project = getProjectName(pathname, href)\r\n\t\tthis.page_lot = getLotName(pathname)\r\n\t\tthis.ab_test_name = 'abgroup'\r\n\t\tthis.ab_test_group = process.env.NEXT_PUBLIC_AB_TEST_GROUP\r\n\r\n\t\tthis.pageParamsIsLoading = false\r\n\t\tthis.pageParamsWasSet = true\r\n\t}\r\n\r\n\tasync setFingerPrint() {\r\n\t\tthis.fingerprint_id = (await getStoneHashClientId()) ?? null\r\n\t}\r\n\r\n\tasync setEventPageView(props?: Omit<TEventPageView, 'store'>) {\r\n\t\tawait setEventPageView({ store: this, ...props })\r\n\t}\r\n\r\n\tasync setEventPageViewForce() {\r\n\t\t//тестовая отправка, метод дергал без ожиданий вообще чисто для теста Антона\r\n\t\tawait setEventPageViewForce({ store: this })\r\n\t}\r\n\r\n\tasync setEventSubmit(props: Omit<TEventSubmit, 'store'>) {\r\n\t\tawait setEventSubmit({ store: this, ...props })\r\n\t}\r\n\r\n\tasync setEventLotFeedShow(props: Omit<TEventLotFeedShow, 'store'>) {\r\n\t\tawait setEventLotFeedShow({ store: this, ...props })\r\n\t}\r\n\r\n\tasync setEventClick(props: Omit<TEventClick, 'store'>) {\r\n\t\tawait setEventClick({ store: this, ...props })\r\n\t}\r\n\r\n\tasync setEventCheck(props: Omit<TEventCheck, 'store'>) {\r\n\t\tawait setEventCheck({ store: this, ...props })\r\n\t}\r\n\r\n\tasync setEventBlur(props: Omit<TEventBlur, 'store'>) {\r\n\t\tawait setEventBlur({ store: this, ...props })\r\n\t}\r\n\r\n\tasync setEventFullScreen() {\r\n\t\tawait setEventFullScreen({ store: this })\r\n\t}\r\n\r\n\tasync setEventBannerShow(props: Omit<TEventBannerShow, 'store'>) {\r\n\t\tawait setEventBannerShow({ store: this, ...props })\r\n\t}\r\n\r\n\tasync setEventBannerClick(props: Omit<TEventBannerClick, 'store'>) {\r\n\t\tawait setEventBannerClick({ store: this, ...props })\r\n\t}\r\n}\r\n\r\nexport const stoneDataLayerStore = new StoneDataLayerStore()\r\n","export type TPageDirection = 'apartments' | 'offices' | 'retail' | 'investments' | null\r\n\r\nconst pathDirection = {\r\n commercial: 'offices',\r\n residential: 'apartments',\r\n retail: 'retail',\r\n investments: 'investments',\r\n} as const\r\n\r\nconst specialCondition = {\r\n 'stone.moscow': 'apartments',\r\n 'stone-sokolniki': 'apartments',\r\n 'sokolniki-stone': 'apartments',\r\n 'stone-rise': 'apartments',\r\n 'stone-hod': 'offices'\r\n}\r\n\r\nexport const getPageDirection = (pathname: string, href?: string): TPageDirection => {\r\n let specialResult = null\r\n\r\n if (href) {\r\n Object.keys(specialCondition).forEach((el) => {\r\n if (href.includes(el)) {\r\n specialResult = specialCondition[el]\r\n }\r\n })\r\n if (specialResult) return specialResult\r\n }\r\n\r\n\r\n //хардкод ритейла т.к по сути он офисный проект\r\n switch (pathname) {\r\n case '/commercial/sokolniki-retail':\r\n return 'retail'\r\n case '/commercial/mnevniki-retail':\r\n return 'retail'\r\n }\r\n\r\n const key = Object.keys(pathDirection).filter((el) => pathname.includes(el))[0]\r\n const value = pathDirection[key as keyof typeof pathDirection]\r\n if (value) return value\r\n else return null\r\n}\r\n","//регулярка для проектов по pathname\r\nconst reg_com_project = /^\\/commercial\\/[^/]+$/\r\nconst reg_res_project = /^\\/residential\\/[^/]+$/\r\n\r\n//регулярка для лотов по pathname\r\nconst reg_com_lot = /^\\/catalog\\/commercial\\/([a-z0-9_#-]+)(?:\\/[a-z0-9_#-]+)*$/i;\r\nconst reg_res_lot = /^\\/catalog\\/residential\\/([a-z0-9_#-]+)(?:\\/[a-z0-9_#-]+)*$/i;\r\n\r\nexport { reg_com_lot, reg_res_lot, reg_res_project, reg_com_project }\r\n","import {reg_com_lot, reg_com_project, reg_res_lot, reg_res_project} from \"./regs\";\r\n\r\nexport type TSource = 'stone' | 'sokolniki' | 'stone-hod' | 'stonehod'\r\n\r\nexport const staticPageViewType = {\r\n '/': 'main',\r\n '/loyalty': 'loyalty',\r\n '/residential': 'category_page',\r\n '/commercial': 'category_page',\r\n '/retail': 'category_page',\r\n '/rent': 'rent',\r\n '/service': 'services',\r\n '/presscenter': 'press_center',\r\n '/purchaseterms': 'terms_of_purchase',\r\n '/purchaseterms/residential': 'terms_of_purchase',\r\n '/contacts': 'contacts',\r\n '/documents': 'documents',\r\n '/documents/docs': 'documents',\r\n '/documents/soglasie-na-rassylki': 'documents',\r\n '/documents/politika-konfidenczialnosti': 'documents',\r\n '/documents/usloviya-loyalty': 'documents',\r\n '/investments': 'investments',\r\n '/about': 'about_company',\r\n '/catalog/commercial': 'lot_catalog',\r\n '/catalog/residential': 'lot_catalog',\r\n} as const\r\n\r\nexport const sokolnikiPageViewType = {\r\n '/': 'project_card',\r\n '/policy': 'project_card'\r\n}\r\n\r\nexport const stoneHodPageViewType = {\r\n '/': 'stoneHod_main',\r\n '/policy': 'stoneHod_policy'\r\n}\r\n\r\nconst specialCondition = {\r\n 'stone.moscow': 'category_page',\r\n 'stone-sokolniki': 'project_card',\r\n 'sokolniki-stone': 'project_card',\r\n 'stone-rise': 'project_card',\r\n 'stone-hod': 'category_page'\r\n}\r\n\r\nexport type TPageType = keyof typeof staticPageViewType\r\n\r\nexport const getPageType = (pathname: string, source = 'stone' as TSource, href?: string) => {\r\n let specialResult = null\r\n\r\n if (href) {\r\n Object.keys(specialCondition).forEach((el) => {\r\n if (href.includes(el)) {\r\n specialResult = specialCondition[el]\r\n }\r\n })\r\n if (specialResult) return specialResult\r\n }\r\n\r\n if (pathname) {\r\n switch (source) {\r\n case \"stone\": {\r\n const isOnStaticPage = Object.keys(staticPageViewType).includes(pathname)\r\n //для статических страниц\r\n if (isOnStaticPage) return staticPageViewType[pathname as keyof typeof staticPageViewType]\r\n //для динамической страницы проекта\r\n else if (reg_com_project.test(pathname) || reg_res_project.test(pathname)) {\r\n return 'project_card'\r\n }\r\n //для динамической страницы лота\r\n else if (reg_com_lot.test(pathname) || reg_res_lot.test(pathname)) {\r\n return 'lot_card'\r\n }\r\n return null\r\n }\r\n\r\n case \"sokolniki\" : {\r\n return sokolnikiPageViewType[pathname as keyof typeof sokolnikiPageViewType]\r\n }\r\n\r\n case \"stone-hod\": {\r\n return stoneHodPageViewType[pathname as keyof typeof stoneHodPageViewType]\r\n }\r\n\r\n default:\r\n return null\r\n }\r\n }\r\n\r\n return 'other'\r\n}\r\n","import {reg_com_lot, reg_res_lot} from \"./regs\";\r\n\r\nconst reg_com_project = /^\\/commercial\\/([^/]+)$/\r\nconst reg_res_project = /^\\/residential\\/([^/]+)$/\r\n\r\nconst specialCondition = {\r\n 'stone-sokolniki': 'sokolniki',\r\n 'sokolniki-stone': 'sokolniki',\r\n 'stone-rise': 'rise',\r\n 'stone-hod': 'hodinka'\r\n}\r\n\r\nexport const getProjectName = (pathname: string, href?: string) => {\r\n let specialResult = null\r\n\r\n const comMatch = pathname.match(reg_com_project)\r\n const resMatch = pathname.match(reg_res_project)\r\n\r\n const comLotMatch = pathname.match(reg_com_lot)\r\n const resLotMatch = pathname.match(reg_res_lot)\r\n\r\n if (href) {\r\n Object.keys(specialCondition).forEach((el) => {\r\n if (href.includes(el)) {\r\n specialResult = specialCondition[el]\r\n }\r\n })\r\n }\r\n\r\n if (specialResult) return specialResult\r\n\r\n if (comLotMatch) return comLotMatch[1]\r\n if (resLotMatch) return resLotMatch[1]\r\n if (comMatch) return comMatch[1]\r\n if (resMatch) return resMatch[1]\r\n return null\r\n}\r\n","const reg_com_lot = /^\\/catalog\\/commercial\\/(?:[a-z0-9_#-]+\\/)*([a-z0-9_#-]+)$/i\r\nconst reg_res_lot = /^\\/catalog\\/residential\\/(?:[a-z0-9_#-]+\\/)*([a-z0-9_#-]+)$/i\r\n\r\nexport const getLotName = (pathname: string) => {\r\n const comMatch = pathname.match(reg_com_lot)\r\n const resMatch = pathname.match(reg_res_lot)\r\n\r\n if (comMatch) return comMatch[1]\r\n if (resMatch) return resMatch[1]\r\n return null\r\n}\r\n","import {StoneDataLayerStore} from \"../StoneDataLayerStore\";\r\n\r\nexport const getDefaultAnalyticsData = (store: StoneDataLayerStore) => ({\r\n ym_uid: store.ym_uid ?? null,\r\n cm_visitor_id: store.cm_visitor_id ?? null,\r\n cm_session_id: store.cm_session_id ?? null,\r\n fingerprint_id: store?.fingerprint_id ?? null,\r\n visible_virtual_pn: store?.visible_virtual_pn ?? null,\r\n page_type: store.page_type,\r\n page_direction: store.page_direction,\r\n page_project: store.page_project,\r\n page_lot: store.page_lot,\r\n ab_test_name: store.ab_test_name,\r\n ab_test_group: store.ab_test_group,\r\n user_id: store.initializeUserId() ?? null,\r\n})\r\n","import {StoneDataLayerStore} from \"../StoneDataLayerStore\";\r\nimport {getDefaultAnalyticsData} from \"../utils/getDefaultAnalyticsData\";\r\n\r\nexport type TEventPageView = {\r\n store: StoneDataLayerStore\r\n user_id?: string | null\r\n auth?: boolean\r\n projectName?: string\r\n lotName?: string\r\n}\r\n\r\nexport const setEventPageView = async ({store}: TEventPageView) => {\r\n try {\r\n const defaultData = getDefaultAnalyticsData(store)\r\n\r\n const additionalFields = {\r\n event: 'pageview',\r\n }\r\n\r\n const dataForPush = {...defaultData}\r\n delete dataForPush.ym_uid\r\n\r\n store.pushLayer({...dataForPush, ...additionalFields})\r\n } catch (e) {\r\n console.log('error', e)\r\n }\r\n}\r\n","import {StoneDataLayerStore} from \"../StoneDataLayerStore\";\r\nimport {getDefaultAnalyticsData} from \"../utils/getDefaultAnalyticsData\";\r\n\r\nexport type TEventPageView = {\r\n store: StoneDataLayerStore\r\n projectName?: string\r\n lotName?: string\r\n}\r\n\r\nexport const setEventPageViewForce = async ({ store }: TEventPageView) => {\r\n try {\r\n const defaultData = getDefaultAnalyticsData(store)\r\n\r\n const additionalFields = {\r\n event: 'pageview_force',\r\n }\r\n\r\n store.pushLayer({ ...defaultData, ...additionalFields })\r\n } catch (e) {\r\n console.log('error',e)\r\n }\r\n}\r\n","import {md5} from \"js-md5\";\r\n\r\nexport const getVisibleVirtualPn = () => {\r\n const virtual_pn = document.getElementById('header_phone')?.getAttribute(\"href\")?.replace(/\\D/g, \"\");\r\n return typeof virtual_pn === 'string' ? md5(virtual_pn) : undefined\r\n}","export const getYmUid = (id: number) => {\r\n if (typeof window !== 'undefined' && typeof ym !== 'undefined') {\r\n let ymUid\r\n ym(id, 'getClientID', function (clientID) {\r\n ymUid = clientID\r\n })\r\n return ymUid ?? null\r\n }\r\n}\r\n","declare const Comagic: any\r\n\r\nconst getComagicVisitorId = () => {\r\n if (typeof Comagic !== 'undefined') {\r\n return Comagic && Comagic.getVisitorId()\r\n }\r\n else return null\r\n}\r\n\r\nconst getComagicSessionId = () => {\r\n if (typeof Comagic !== 'undefined') {\r\n return Comagic && Comagic.getSessionId()\r\n }\r\n else return null\r\n}\r\n\r\nexport { getComagicSessionId, getComagicVisitorId }\r\n","import {getYmUid} from \"./getYmUid\";\r\nimport {getComagicSessionId, getComagicVisitorId} from \"./getComagicId\";\r\n\r\nexport const setAnalyticId = (defaultData: any)=> {\r\n defaultData.ym_uid = getYmUid(95057596)\r\n defaultData.cm_visitor_id = getComagicVisitorId()\r\n defaultData.cm_session_id = getComagicSessionId()\r\n}","import { getDefaultAnalyticsData } from '../utils/getDefaultAnalyticsData'\r\nimport { StoneDataLayerStore } from '../StoneDataLayerStore'\r\nimport { getVisibleVirtualPn } from '../../../utils/getVisibleVirtualPn'\r\nimport { setAnalyticId } from '../utils/setAnalyticId'\r\n\r\nexport type TEventSubmit = {\r\n\tstore: StoneDataLayerStore\r\n\tblock_name?: string\r\n\tauth?: boolean\r\n\tlead_id?: string\r\n\tsubmitted_lot?: string\r\n\tsubmitted_lot_project?: string\r\n}\r\n\r\nexport const setEventSubmit = async ({\r\n\tstore,\r\n\tlead_id,\r\n\tblock_name,\r\n\tauth,\r\n\tsubmitted_lot,\r\n\tsubmitted_lot_project,\r\n}: TEventSubmit) => {\r\n\ttry {\r\n\t\tconst defaultData = getDefaultAnalyticsData(store)\r\n\r\n\t\tconst additionalFields = {\r\n\t\t\tevent: 'submit',\r\n\t\t\tlead_id: String(lead_id),\r\n\t\t\tblock_name,\r\n\t\t\tauth,\r\n\t\t\tsubmitted_lot: submitted_lot ?? null,\r\n\t\t\tsubmitted_lot_project: submitted_lot_project ?? null,\r\n\t\t}\r\n\r\n\t\tdefaultData.visible_virtual_pn = getVisibleVirtualPn()\r\n\t\tsetAnalyticId(defaultData)\r\n\r\n\t\tstore.pushLayer({ ...defaultData, ...additionalFields })\r\n\t} catch (e) {\r\n\t\tconsole.log('error', e)\r\n\t}\r\n}\r\n","import {StoneDataLayerStore} from \"../StoneDataLayerStore\";\r\nimport {getDefaultAnalyticsData} from \"../utils/getDefaultAnalyticsData\";\r\nimport {getVisibleVirtualPn} from \"../../../utils/getVisibleVirtualPn\";\r\nimport {setAnalyticId} from \"../utils/setAnalyticId\";\r\n\r\nexport type TEventLotFeedShow = {\r\n store: StoneDataLayerStore\r\n pathname?: string\r\n block_name?: string\r\n list_of_lots: TAnalyticFeedLot[]\r\n}\r\n\r\nexport type TAnalyticFeedLot = {\r\n position: number | null\r\n lot: string | null\r\n lot_project: string | null\r\n}\r\n\r\nexport const setEventLotFeedShow = async ({\r\n store,\r\n block_name,\r\n list_of_lots,\r\n }: TEventLotFeedShow) => {\r\n try {\r\n const defaultData = getDefaultAnalyticsData(store)\r\n\r\n const additionalFields = {\r\n event: 'lot_feed_show',\r\n block_name,\r\n list_of_lots,\r\n }\r\n\r\n const dataForPush = {...defaultData}\r\n setAnalyticId(defaultData)\r\n\r\n delete dataForPush.ym_uid\r\n delete dataForPush.cm_visitor_id\r\n delete dataForPush.cm_session_id\r\n\r\n defaultData.visible_virtual_pn = getVisibleVirtualPn()\r\n\r\n store.pushLayer({...defaultData, ...additionalFields})\r\n } catch (e) {\r\n console.log('error', e)\r\n }\r\n}\r\n","import { StoneDataLayerStore } from '../StoneDataLayerStore'\r\nimport { getDefaultAnalyticsData } from '../utils/getDefaultAnalyticsData'\r\nimport { getVisibleVirtualPn } from '../../../utils/getVisibleVirtualPn'\r\nimport { setAnalyticId } from '../utils/setAnalyticId'\r\n\r\nexport type TEventClick = {\r\n\tstore: StoneDataLayerStore\r\n\tpathname?: string\r\n\tblock_name?: string\r\n\tauth?: boolean\r\n\tclicked_url?: string\r\n\taction_element?: string | null\r\n\taction_element_text?: string | null\r\n\taction_element_status?: 'error' | 'success'\r\n\tclicked_lot?: string\r\n\tclicked_lot_project?: string\r\n\tclicked_lot_position?: string\r\n}\r\n\r\nexport const setEventClick = async ({\r\n\tstore,\r\n\taction_element,\r\n\taction_element_text,\r\n\tblock_name,\r\n\tclicked_url,\r\n\tauth,\r\n\tclicked_lot,\r\n\tclicked_lot_project,\r\n\tclicked_lot_position,\r\n\taction_element_status,\r\n}: TEventClick) => {\r\n\ttry {\r\n\t\tconst defaultData = getDefaultAnalyticsData(store)\r\n\r\n\t\tconst additionalFields: Omit<TEventClick, 'store'> & { event: string } = {\r\n\t\t\tevent: 'click',\r\n\t\t\taction_element,\r\n\t\t\taction_element_text,\r\n\t\t\tblock_name,\r\n\t\t\tauth,\r\n\t\t\tclicked_url,\r\n\t\t\tclicked_lot: clicked_lot ?? null,\r\n\t\t\tclicked_lot_project: clicked_lot_project ?? null,\r\n\t\t\tclicked_lot_position: clicked_lot_position ?? null,\r\n\t\t}\r\n\r\n\t\tif (action_element_status) additionalFields.action_element_status = action_element_status\r\n\r\n\t\tdefaultData.visible_virtual_pn = getVisibleVirtualPn()\r\n\r\n\t\tsetAnalyticId(defaultData)\r\n\r\n\t\tstore.pushLayer({ ...defaultData, ...additionalFields })\r\n\t} catch (e) {\r\n\t\tconsole.log('error', e)\r\n\t}\r\n}\r\n","import { getDefaultAnalyticsData } from '../utils/getDefaultAnalyticsData'\r\nimport { StoneDataLayerStore } from '../StoneDataLayerStore'\r\nimport { getVisibleVirtualPn } from '../../../utils/getVisibleVirtualPn'\r\nimport { setAnalyticId } from '../utils/setAnalyticId'\r\n\r\nexport type TEventCheck = {\r\n\tstore: StoneDataLayerStore\r\n\tpathname?: string\r\n\tblock_name?: string\r\n\tauth?: boolean\r\n\taction_element: string\r\n\taction_element_text: string\r\n}\r\n\r\nexport const setEventCheck = async ({\r\n\tstore,\r\n\taction_element,\r\n\tauth,\r\n\taction_element_text,\r\n\tblock_name,\r\n}: TEventCheck) => {\r\n\ttry {\r\n\t\tconst defaultData = getDefaultAnalyticsData(store)\r\n\r\n\t\tconst additionalFields = {\r\n\t\t\tevent: 'check',\r\n\t\t\taction_element,\r\n\t\t\tauth,\r\n\t\t\taction_element_text,\r\n\t\t\tblock_name,\r\n\t\t}\r\n\r\n\t\tdefaultData.visible_virtual_pn = getVisibleVirtualPn()\r\n\r\n\t\tsetAnalyticId(defaultData)\r\n\r\n\t\tstore.pushLayer({ ...defaultData, ...additionalFields })\r\n\t} catch (e) {\r\n\t\tconsole.log('error', e)\r\n\t}\r\n}\r\n","import { StoneDataLayerStore } from '../StoneDataLayerStore'\r\nimport { getDefaultAnalyticsData } from '../utils/getDefaultAnalyticsData'\r\nimport { getVisibleVirtualPn } from '../../../utils/getVisibleVirtualPn'\r\nimport { setAnalyticId } from '../utils/setAnalyticId'\r\n\r\nexport type TEventBlur = {\r\n\tstore: StoneDataLayerStore\r\n\tpathname?: string\r\n\tauth?: boolean\r\n\tblock_name?: string\r\n\taction_element: string\r\n\taction_element_status: 'error' | 'success'\r\n}\r\n\r\nexport const setEventBlur = async ({\r\n\tstore,\r\n\taction_element,\r\n\tblock_name,\r\n\tauth,\r\n\taction_element_status,\r\n}: TEventBlur) => {\r\n\ttry {\r\n\t\tconst defaultData = getDefaultAnalyticsData(store)\r\n\r\n\t\tconst additionalFields = {\r\n\t\t\tevent: 'blur',\r\n\t\t\taction_element,\r\n\t\t\taction_element_status,\r\n\t\t\tblock_name,\r\n\t\t\tauth,\r\n\t\t}\r\n\r\n\t\tdefaultData.visible_virtual_pn = getVisibleVirtualPn()\r\n\r\n\t\tsetAnalyticId(defaultData)\r\n\r\n\t\tstore.pushLayer({ ...defaultData, ...additionalFields })\r\n\t} catch (e) {\r\n\t\tconsole.log('error', e)\r\n\t}\r\n}\r\n","import { StoneDataLayerStore } from '../StoneDataLayerStore'\r\nimport { getDefaultAnalyticsData } from '../utils/getDefaultAnalyticsData'\r\nimport { getVisibleVirtualPn } from '../../../utils/getVisibleVirtualPn'\r\nimport { setAnalyticId } from '../utils/setAnalyticId'\r\n\r\nexport type TEventPageView = {\r\n\tstore: StoneDataLayerStore\r\n\tprojectName?: string\r\n\tauth?: boolean\r\n\tlotName?: string\r\n}\r\n\r\nexport const setEventFullScreen = async ({ store }: TEventPageView) => {\r\n\ttry {\r\n\t\tconst defaultData = getDefaultAnalyticsData(store)\r\n\r\n\t\tconst additionalFields = {\r\n\t\t\tevent: 'fullscreenview',\r\n\t\t}\r\n\r\n\t\tdefaultData.visible_virtual_pn = getVisibleVirtualPn()\r\n\r\n\t\tsetAnalyticId(defaultData)\r\n\r\n\t\tstore.pushLayer({ ...defaultData, ...additionalFields })\r\n\t} catch (e) {\r\n\t\tconsole.log('error', e)\r\n\t}\r\n}\r\n","import { StoneDataLayerStore } from '../StoneDataLayerStore'\r\nimport { getDefaultAnalyticsData } from '../utils/getDefaultAnalyticsData'\r\nimport { setAnalyticId } from '../utils/setAnalyticId'\r\n\r\nexport type TEventBannerShow = {\r\n\tstore: StoneDataLayerStore\r\n\tpathname?: string\r\n\tblock_name?: string\r\n\tauth?: boolean\r\n\tbanner_text: string\r\n\tbanner_link: string\r\n}\r\n\r\nexport const setEventBannerShow = async ({\r\n\tstore,\r\n\tbanner_text,\r\n\tbanner_link,\r\n\tauth,\r\n\tblock_name,\r\n}: TEventBannerShow) => {\r\n\ttry {\r\n\t\tconst defaultData = getDefaultAnalyticsData(store)\r\n\r\n\t\tconst additionalFields = {\r\n\t\t\tevent: 'banner_show',\r\n\t\t\tbanner_text,\r\n\t\t\tbanner_link,\r\n\t\t\tauth,\r\n\t\t\tblock_name,\r\n\t\t}\r\n\r\n\t\tsetAnalyticId(defaultData)\r\n\r\n\t\tstore.pushLayer({ ...defaultData, ...additionalFields })\r\n\t} catch (e) {\r\n\t\tconsole.log('error', e)\r\n\t}\r\n}\r\n","import { StoneDataLayerStore } from '../StoneDataLayerStore'\r\nimport { getDefaultAnalyticsData } from '../utils/getDefaultAnalyticsData'\r\nimport { setAnalyticId } from '../utils/setAnalyticId'\r\n\r\nexport type TEventBannerClick = {\r\n\tstore: StoneDataLayerStore\r\n\tpathname?: string\r\n\tblock_name?: string\r\n\tauth?: boolean\r\n\tclicked_url?: string\r\n\tbanner_text: string\r\n\tbanner_link: string\r\n}\r\n\r\nexport const setEventBannerClick = async ({\r\n\tstore,\r\n\tbanner_text,\r\n\tbanner_link,\r\n\tauth,\r\n\tclicked_url,\r\n\tblock_name,\r\n}: TEventBannerClick) => {\r\n\ttry {\r\n\t\tconst defaultData = getDefaultAnalyticsData(store)\r\n\r\n\t\tconst additionalFields = {\r\n\t\t\tevent: 'banner_click',\r\n\t\t\tbanner_text,\r\n\t\t\tbanner_link,\r\n\t\t\tauth,\r\n\t\t\tclicked_url,\r\n\t\t\tblock_name,\r\n\t\t}\r\n\r\n\t\tsetAnalyticId(defaultData)\r\n\r\n\t\tstore.pushLayer({ ...defaultData, ...additionalFields })\r\n\t} catch (e) {\r\n\t\tconsole.log('error', e)\r\n\t}\r\n}\r\n"],"mappings":"yjBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,yBAAAE,EAAA,mBAAAC,EAAA,gBAAAC,GAAA,+BAAAC,EAAA,eAAAC,EAAA,qBAAAC,EAAA,gBAAAC,EAAA,mBAAAC,EAAA,qBAAAC,EAAA,yBAAAC,EAAA,sBAAAC,EAAA,6BAAAC,EAAA,kBAAAC,EAAA,gBAAAC,EAAA,iBAAAC,EAAA,0BAAAC,EAAA,uBAAAC,EAAA,wBAAAC,GAAA,yBAAAC,EAAA,qBAAAC,GAAA,yBAAAC,KAAA,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,MAAO,IAAK,CAAC,CAC5C,CAEA,MAAM,eAAeF,EAAoC,CACxD,MAAMG,GAAe,CAAE,MAAO,KAAM,GAAGH,CAAM,CAAC,CAC/C,CAEA,MAAM,oBAAoBA,EAAyC,CAClE,MAAMI,GAAoB,CAAE,MAAO,KAAM,GAAGJ,CAAM,CAAC,CACpD,CAEA,MAAM,cAAcA,EAAmC,CACtD,MAAMK,GAAc,CAAE,MAAO,KAAM,GAAGL,CAAM,CAAC,CAC9C,CAEA,MAAM,cAAcA,EAAmC,CACtD,MAAMM,GAAc,CAAE,MAAO,KAAM,GAAGN,CAAM,CAAC,CAC9C,CAEA,MAAM,aAAaA,EAAkC,CACpD,MAAMO,GAAa,CAAE,MAAO,KAAM,GAAGP,CAAM,CAAC,CAC7C,CAEA,MAAM,oBAAqB,CAC1B,MAAMQ,GAAmB,CAAE,MAAO,IAAK,CAAC,CACzC,CAEA,MAAM,mBAAmBR,EAAwC,CAChE,MAAMS,GAAmB,CAAE,MAAO,KAAM,GAAGT,CAAM,CAAC,CACnD,CAEA,MAAM,oBAAoBA,EAAyC,CAClE,MAAMU,GAAoB,CAAE,MAAO,KAAM,GAAGV,CAAM,CAAC,CACpD,CACD,EAEaW,GAAsB,IAAIrB","names":["index_exports","__export","StoneDataLayerStore","checkTimeStamp","getABCookie","getGoogleAnalyticsClientId","getLotName","getPageDirection","getPageType","getProjectName","getStoneClientId","getStoneHashClientId","getStoneSessionId","getYandexMetrikaClientId","sendAnalytics","setClientId","setSessionId","sokolnikiPageViewType","staticPageViewType","stoneDataLayerStore","stoneHodPageViewType","useComagicStatus","useInitializeMetrics","__toCommonJS","makeTimeBasedUID","isLocalStorage","checkTimeStamp","clientId","unixTimestamp","ISOSDate","ISOSDateNow","setSessionId","newId","makeTimeBasedUID","setClientId","dataLayerPush","data","_a","isTest","pathname","href","layerEvent","ymTarget","data","isTest","sendAnalyticsToAPI","data","isTest","url","pathname","href","formData","import_fingerprintjs","import_fingerprintjs","import_cookies_next","getStoneHashClientId","st_client_hash_id","FingerprintJS","fp","result","e","getStoneSessionId","st_session_id","getStoneClientId","st_client_id","getGoogleAnalyticsClientId","_ga","_ga_local","getYandexMetrikaClientId","_ym_uid","_ym_uid_local","sendAnalytics","data","_a","fpPromise","FingerprintJS","isTest","makeTimeBasedUID","fp","result","e","getYandexMetrikaClientId","getGoogleAnalyticsClientId","getStoneClientId","getStoneSessionId","dataLayerPush","ymTarget","sendAnalyticsToAPI","import_react","useInitializeMetrics","isLocalStorage","isClientId","isSessionId","isYearPast","checkTimeStamp","setClientId","setSessionId","sendAnalytics","tabCountStorage","tabCount","handleBeforeUnload","scrollTop","scrollHeight","scrollPercent","inactivityTimer","resetInactivityTimer","events","event","import_react","useComagicStatus","status","setStatus","timer","getABCookie","name","escapedName","regex","match","import_mobx","pathDirection","specialCondition","getPageDirection","pathname","href","specialResult","el","key","value","reg_com_project","reg_res_project","reg_com_lot","reg_res_lot","staticPageViewType","sokolnikiPageViewType","stoneHodPageViewType","specialCondition","getPageType","pathname","source","href","specialResult","el","reg_com_project","reg_res_project","reg_com_lot","reg_res_lot","reg_com_project","reg_res_project","specialCondition","getProjectName","pathname","href","specialResult","comMatch","resMatch","comLotMatch","reg_com_lot","resLotMatch","reg_res_lot","el","reg_com_lot","reg_res_lot","getLotName","pathname","comMatch","resMatch","getDefaultAnalyticsData","store","setEventPageView","store","defaultData","getDefaultAnalyticsData","additionalFields","dataForPush","e","setEventPageViewForce","store","defaultData","getDefaultAnalyticsData","additionalFields","e","import_js_md5","getVisibleVirtualPn","_a","_b","virtual_pn","getYmUid","id","ymUid","clientID","getComagicVisitorId","getComagicSessionId","setAnalyticId","defaultData","getYmUid","getComagicVisitorId","getComagicSessionId","setEventSubmit","store","lead_id","block_name","auth","submitted_lot","submitted_lot_project","defaultData","getDefaultAnalyticsData","additionalFields","getVisibleVirtualPn","setAnalyticId","e","setEventLotFeedShow","store","block_name","list_of_lots","defaultData","getDefaultAnalyticsData","additionalFields","dataForPush","setAnalyticId","getVisibleVirtualPn","e","setEventClick","store","action_element","action_element_text","block_name","clicked_url","auth","clicked_lot","clicked_lot_project","clicked_lot_position","action_element_status","defaultData","getDefaultAnalyticsData","additionalFields","getVisibleVirtualPn","setAnalyticId","e","setEventCheck","store","action_element","auth","action_element_text","block_name","defaultData","getDefaultAnalyticsData","additionalFields","getVisibleVirtualPn","setAnalyticId","e","setEventBlur","store","action_element","block_name","auth","action_element_status","defaultData","getDefaultAnalyticsData","additionalFields","getVisibleVirtualPn","setAnalyticId","e","setEventFullScreen","store","defaultData","getDefaultAnalyticsData","additionalFields","getVisibleVirtualPn","setAnalyticId","e","setEventBannerShow","store","banner_text","banner_link","auth","block_name","defaultData","getDefaultAnalyticsData","additionalFields","setAnalyticId","e","setEventBannerClick","store","banner_text","banner_link","auth","clicked_url","block_name","defaultData","getDefaultAnalyticsData","additionalFields","setAnalyticId","e","StoneDataLayerStore","tagManagerArgs","pathname","source","href","getPageDirection","getPageType","getProjectName","getLotName","getStoneHashClientId","props","setEventPageView","setEventPageViewForce","setEventSubmit","setEventLotFeedShow","setEventClick","setEventCheck","setEventBlur","setEventFullScreen","setEventBannerShow","setEventBannerClick","stoneDataLayerStore"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/utils/makeUID.ts","../src/utils/sessionClientId.ts","../src/dataLayerPush/dataLayerPush.ts","../src/ymTarget/ymaTarget.ts","../src/sendAnalyticsToAPI/sendAnalyticsToAPI.ts","../src/sendAnalytics/sendAnalytics.ts","../src/utils/utils.ts","../src/hooks/useInitializeMetrics.ts","../src/utils/useComagicStatus.ts","../src/utils/getABCookie.ts","../src/store/StoneDataLayerStore/StoneDataLayerStore.ts","../src/store/StoneDataLayerStore/utils/pageDirection.ts","../src/store/StoneDataLayerStore/utils/regs.ts","../src/store/StoneDataLayerStore/utils/pageType.ts","../src/store/StoneDataLayerStore/utils/getProjectName.ts","../src/store/StoneDataLayerStore/utils/getLotName.ts","../src/store/StoneDataLayerStore/utils/getDefaultAnalyticsData.ts","../src/store/StoneDataLayerStore/events/eventPageView.ts","../src/store/StoneDataLayerStore/events/eventPageViewForce.ts","../src/utils/getVisibleVirtualPn.ts","../src/store/StoneDataLayerStore/utils/getYmUid.ts","../src/store/StoneDataLayerStore/utils/getComagicId.ts","../src/store/StoneDataLayerStore/utils/setAnalyticId.ts","../src/store/StoneDataLayerStore/events/eventSubmit.ts","../src/store/StoneDataLayerStore/events/eventLotFeedShow.ts","../src/store/StoneDataLayerStore/events/eventClick.ts","../src/store/StoneDataLayerStore/events/eventCheck.ts","../src/store/StoneDataLayerStore/events/eventBlur.ts","../src/store/StoneDataLayerStore/events/eventFullScreenView.ts","../src/store/StoneDataLayerStore/events/eventBannerShow.ts","../src/store/StoneDataLayerStore/events/eventBannerClick.ts"],"sourcesContent":["export * from './utils/sessionClientId'\nexport * from './sendAnalytics/sendAnalytics'\nexport * from './hooks/useInitializeMetrics'\nexport * from './utils/utils'\nexport * from './utils/useComagicStatus'\nexport * from './utils/getABCookie'\n\nexport * from './store/StoneDataLayerStore/stoneDataLayer'\nexport * from './store/StoneDataLayerStore/StoneDataLayerStore'\nexport * from './store/StoneDataLayerStore/utils/pageDirection'\nexport * from './store/StoneDataLayerStore/utils/pageType'\nexport * from './store/StoneDataLayerStore/utils/getProjectName'\nexport * from './store/StoneDataLayerStore/utils/getLotName'\n","export const makeTimeBasedUID = (): string => {\n\treturn (\n\t\tString(Date.now()) + String(Math.floor(Math.random() * (999999999 - 100000000 + 1)) + 100000000)\n\t)\n}","import {makeTimeBasedUID} from './makeUID'\n\nconst isLocalStorage = typeof localStorage !== 'undefined'\n\nconst checkTimeStamp = (clientId: string | null) => {\n if (!clientId) return false\n\n const unixTimestamp = Number(clientId.slice(0, 10))\n const ISOSDate = new Date(unixTimestamp * 1000)\n const ISOSDateNow = new Date(new Date().toISOString())\n\n return (\n ISOSDateNow.getFullYear() > ISOSDate.getFullYear() &&\n ISOSDateNow.getMonth() >= ISOSDate.getMonth() &&\n ISOSDateNow.getDate() >= ISOSDate.getDate()\n )\n}\n\nconst setSessionId = () => {\n const newId = makeTimeBasedUID()\n if (isLocalStorage) localStorage.setItem('st_session_id', newId)\n}\n\nconst setClientId = () => {\n const newId = makeTimeBasedUID()\n if (isLocalStorage) localStorage.setItem('st_client_id', newId)\n}\n\nexport {setClientId, setSessionId, checkTimeStamp}","import { TAnalyticsVisitParams } from '../types/analytics'\n\nexport type TGADataLayer = {\n\tevent: string\n\tparams: TAnalyticsVisitParams\n}\n\nexport type DataLayerPush = {\n\tevent: string\n\tpage_path: string\n\tpage_url: string\n\tst_event_id?: string\n\tst_client_id?: string\n\tst_session_id?: string\n\tabTestGroup?: string\n\tproject?: string\n\tlot_id?: string | number\n}\n\ndeclare global {\n\tinterface Window {\n\t\tdataLayer: DataLayerPush[]\n\t}\n}\n\nexport const dataLayerPush = (data: TGADataLayer) => {\n\tif (typeof window !== 'undefined') {\n\t\tconst isTest = process.env.NEXT_PUBLIC_IS_TEST === 'true'\n\t\tconst pathname = window.location.pathname\n\t\tconst href = window.location.href\n\t\tconst layerEvent: DataLayerPush = {\n\t\t\tevent: data.event,\n\t\t\tst_event_id: data.params?.st_event_id,\n\t\t\tpage_path: pathname,\n\t\t\tpage_url: href,\n\t\t}\n\t\tif (data.params.st_session_id) {\n\t\t\tlayerEvent.st_session_id = data.params.st_session_id\n\t\t}\n\t\tif (data.params.st_client_id) {\n\t\t\tlayerEvent.st_client_id = data.params.st_client_id\n\t\t}\n\t\tif (data.params.project) {\n\t\t\tlayerEvent.project = data.params.project\n\t\t}\n\t\tif (data.params.lot_id) {\n\t\t\tlayerEvent.lot_id = data.params.lot_id\n\t\t}\n\n\t\tif (!isTest) {\n\t\t\twindow.dataLayer = window.dataLayer || []\n\t\t\twindow.dataLayer.push(layerEvent)\n\t\t}\n\t}\n}\n\n","import { TAnalyticsVisitParams } from '../types/analytics'\n\nexport type TYMTarget = {\n\ttarget: string\n\tparams: TAnalyticsVisitParams\n}\n\ndeclare let ym: any\n/**\n * Отправка события в Яндек метрику\n * @param data\n */\nexport const ymTarget = (data: TYMTarget) => {\n\tif (typeof ym !== 'undefined' && typeof window !== 'undefined') {\n\t\tconst isTest = process.env.NEXT_PUBLIC_IS_TEST === 'true'\n\t\tif (\n\t\t\ttypeof process.env.NEXT_PUBLIC_YM_COUNTER == 'undefined' ||\n\t\t\t!process.env.NEXT_PUBLIC_YM_COUNTER\n\t\t) {\n\t\t\tconsole.log('Yandex counter не определен в конфиге .env.local')\n\t\t}\n\t\tif (!isTest) {\n\t\t\tym(process.env.NEXT_PUBLIC_YM_COUNTER, 'reachGoal', data.target, data.params)\n\n\t\t\tconsole.log(\n\t\t\t\t'Yandex Metrika ' + process.env.NEXT_PUBLIC_YM_COUNTER + ' reachGoal: ' + data.target,\n\t\t\t\tdata.params\n\t\t\t)\n\t\t}\n\t} else {\n\t\tconsole.log('Yandex Metrika не найдена')\n\t}\n}\n\n","import { TAnalyticsVisitParams } from '../types/analytics'\n\nexport type TAnalyticsApiData = {\n\tevent: string\n\tname: string\n\tmouse_X?: string\n\tmouse_Y?: string\n\tparams: TAnalyticsVisitParams\n}\n\nexport const sendAnalyticsToAPI = async (data: TAnalyticsApiData) => {\n\tif (typeof window !== 'undefined') {\n\t\tconst isTest = process.env.NEXT_PUBLIC_IS_TEST === 'true'\n\t\tconst url = `https://stone.ru/api/analytics/send-event`\n\t\tconst pathname = window.location.pathname\n\t\tconst href = window.location.href\n\n\t\tconst formData = {\n\t\t\tevent: data.event,\n\t\t\tname: data.name,\n\t\t\tpayload: { ...data.params, ...{ page_path: pathname, page_url: href } },\n\t\t}\n\t\ttry {\n\t\t\tif (!isTest) {\n\t\t\t\tawait fetch(url, {\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t},\n\t\t\t\t\tbody: JSON.stringify(formData),\n\t\t\t\t})\n\t\t\t\t// console.log('sendAnalyticsToAPI:', formData)\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.log(\"can't sendAnalyticsToAPI\")\n\t\t}\n\t} else return\n}\n\n","import {TAnalyticsData} from '../types/analytics'\nimport {dataLayerPush} from '../dataLayerPush/dataLayerPush'\nimport {ymTarget} from '../ymTarget/ymaTarget'\nimport {sendAnalyticsToAPI} from '../sendAnalyticsToAPI/sendAnalyticsToAPI'\nimport {makeTimeBasedUID} from '../utils/makeUID'\nimport FingerprintJS from '@fingerprintjs/fingerprintjs'\nimport {\n getGoogleAnalyticsClientId,\n getStoneClientId,\n getStoneSessionId,\n getYandexMetrikaClientId\n} from \"../utils/utils\";\n\nexport const sendAnalytics = async (data: TAnalyticsData) => {\n if (typeof window !== 'undefined') {\n const fpPromise = FingerprintJS.load()\n const isTest = process.env.NEXT_PUBLIC_IS_TEST === 'true'\n\n data.params = data.params || {}\n data.params.st_event_id = makeTimeBasedUID()\n data.params.date = new Date().toISOString().slice(0, 19)?.replace('T', ' ');\n\n try {\n await fpPromise\n .then((fp) => fp.get())\n .then((result) => {\n if (data.params) {\n data.params.st_client_hash_id = result.visitorId\n }\n })\n } catch (e) {\n console.log('error fingerprintJS' + e)\n }\n\n data.params.ym_client_id = getYandexMetrikaClientId()\n data.params.ga_client_id = getGoogleAnalyticsClientId()\n data.params.st_client_id = getStoneClientId()\n data.params.st_session_id = getStoneSessionId()\n\n if (!isTest) {\n dataLayerPush({event: data.event, params: data.params})\n ymTarget({target: data.event, params: data.params})\n sendAnalyticsToAPI({event: data.event, name: data.name, params: data.params})\n }\n }\n}\n","import FingerprintJS from '@fingerprintjs/fingerprintjs'\nimport {getCookie} from \"cookies-next\";\n\nexport const getStoneHashClientId = async () => {\n let st_client_hash_id\n try {\n const fpPromise = FingerprintJS.load()\n await fpPromise\n .then((fp) => fp.get())\n .then((result) => {\n st_client_hash_id = result.visitorId\n })\n return st_client_hash_id\n } catch (e) {\n console.log('error fingerprintJS' + e)\n }\n return undefined\n}\nexport const getStoneSessionId = () => {\n const st_session_id = localStorage.getItem('st_session_id')\n if (st_session_id && st_session_id != '') {\n return st_session_id\n }\n return undefined\n}\nexport const getStoneClientId = () => {\n const st_client_id = localStorage.getItem('st_client_id')\n if (st_client_id && st_client_id != '') {\n return st_client_id\n }\n return undefined\n}\nexport const getGoogleAnalyticsClientId = () => {\n const _ga = String(getCookie('_ga'))\n if (_ga && _ga != '') {\n return _ga\n } else {\n const _ga_local = localStorage.getItem('_ga')\n if (_ga_local && _ga_local != '') {\n return _ga_local\n }\n }\n return undefined\n}\nexport const getYandexMetrikaClientId = () => {\n const _ym_uid = String(getCookie('_ym_uid'))\n if (_ym_uid && _ym_uid != '') {\n return _ym_uid\n } else {\n const _ym_uid_local = localStorage.getItem('_ym_uid')\n if (_ym_uid_local && _ym_uid_local != '') {\n return _ym_uid_local\n }\n }\n return undefined\n}","import { checkTimeStamp, setClientId, setSessionId } from '../utils/sessionClientId'\nimport { sendAnalytics } from '../sendAnalytics/sendAnalytics'\nimport { useEffect } from 'react'\n\nexport const useInitializeMetrics = () => {\n\tconst isLocalStorage = typeof localStorage !== 'undefined'\n\n\tconst isClientId = Boolean(isLocalStorage ? localStorage.getItem('st_client_id') : null)\n\tconst isSessionId = Boolean(isLocalStorage ? localStorage.getItem('st_session_id') : null)\n\tconst isYearPast = checkTimeStamp(isLocalStorage ? localStorage.getItem('st_client_id') : null)\n\n\tif (!isClientId || isYearPast) setClientId()\n\n\tif (!isSessionId) {\n\t\tsetSessionId()\n\t\tsendAnalytics({\n\t\t\tevent: 'session_start',\n\t\t\tname: 'Начало сессии',\n\t\t})\n\t}\n\n\tuseEffect(() => {\n\t\tconst tabCountStorage = localStorage.getItem('tabCount')\n\n\t\t// При открытии вкладки\n\t\tlet tabCount = tabCountStorage ? parseInt(tabCountStorage) : 0\n\t\tif (tabCount < 0) {\n\t\t\tlocalStorage.setItem('tabCount', String(0))\n\t\t\ttabCount = 0\n\t\t}\n\n\t\ttabCount++\n\t\tif (tabCount) localStorage.setItem('tabCount', String(tabCount))\n\n\t\t// Обработчик для закрытия вкладки\n\t\tconst handleBeforeUnload = () => {\n\t\t\tconst tabCountStorage = localStorage.getItem('tabCount')\n\t\t\tif (tabCountStorage && typeof window !== 'undefined') {\n\t\t\t\tconst tabCount = String(Number(tabCountStorage) - 1)\n\t\t\t\tconst scrollTop = window.scrollY\n\t\t\t\tconst scrollHeight =\n\t\t\t\t\tdocument.documentElement.scrollHeight - document.documentElement.clientHeight\n\t\t\t\tconst scrollPercent = (scrollTop / scrollHeight) * 100\n\n\t\t\t\tsendAnalytics({\n\t\t\t\t\tevent: 'scroll',\n\t\t\t\t\tname: 'Переход или уход со страницы',\n\t\t\t\t\tparams: { scroll_percent: scrollPercent.toFixed(0) + '%' },\n\t\t\t\t})\n\n\t\t\t\tif (tabCount === '0') {\n\t\t\t\t\tsendAnalytics({\n\t\t\t\t\t\tevent: 'session_end',\n\t\t\t\t\t\tname: 'Конец сессии',\n\t\t\t\t\t})\n\n\t\t\t\t\tlocalStorage.setItem('st_session_id', '')\n\t\t\t\t}\n\t\t\t\tlocalStorage.setItem('tabCount', tabCount)\n\t\t\t}\n\t\t}\n\n\t\twindow.addEventListener('beforeunload', handleBeforeUnload)\n\t\treturn () => {\n\t\t\twindow.removeEventListener('beforeunload', handleBeforeUnload)\n\t\t}\n\t}, [])\n\n\tuseEffect(() => {\n\t\tlet inactivityTimer: NodeJS.Timeout\n\n\t\tconst resetInactivityTimer = () => {\n\t\t\tclearTimeout(inactivityTimer)\n\t\t\t// 30 минут\n\t\t\tinactivityTimer = setTimeout(() => {\n\t\t\t\tlocalStorage.setItem('st_session_id', '')\n\n\t\t\t\tsendAnalytics({\n\t\t\t\t\tevent: 'timeout_30min',\n\t\t\t\t\tname: 'Конец сессии',\n\t\t\t\t})\n\t\t\t}, 30 * 60 * 1000)\n\t\t}\n\n\t\tconst events = ['mousemove', 'click', 'touchstart', 'scroll', 'keydown']\n\t\tevents.forEach((event) => {\n\t\t\twindow.addEventListener(event, resetInactivityTimer)\n\t\t})\n\n\t\t// Запускаем таймер при монтировании компонента\n\t\tresetInactivityTimer()\n\t\treturn () => {\n\t\t\tevents.forEach((event) => {\n\t\t\t\twindow.removeEventListener(event, resetInactivityTimer)\n\t\t\t})\n\t\t\tclearTimeout(inactivityTimer)\n\t\t}\n\t}, [])\n\n\treturn {}\n}\n","import { useEffect, useState } from 'react'\n\nexport const useComagicStatus = () => {\n const [status, setStatus] = useState({\n loadedComagic: false,\n errorComagic: false,\n })\n\n useEffect(() => {\n if (window.Comagic) {\n setStatus({ loadedComagic: true, errorComagic: false })\n return\n }\n\n const timer = setInterval(() => {\n if (window.Comagic) {\n setStatus({ loadedComagic: true, errorComagic: false })\n clearInterval(timer)\n }\n }, 300)\n\n return () => clearInterval(timer)\n }, [])\n\n return status\n}\n","/**\n * Получает значение cookie по имени\n * @param name - Имя cookie\n * @returns Значение cookie или null, если не найдено\n */\nexport const getABCookie = (name: string): string | null => {\n // Проверяем доступность document (для SSR/SSG)\n if (typeof document === 'undefined') return null;\n\n // Более читаемый вариант регулярного выражения\n const escapedName = name?.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n const regex = new RegExp(`(^|;\\\\s*)${escapedName}=([^;]*)`);\n const match = document.cookie.match(regex);\n\n return match ? decodeURIComponent(match[2]) : null;\n};","import { makeAutoObservable } from 'mobx'\nimport { getStoneHashClientId } from '../../utils/utils'\nimport { getPageDirection } from './utils/pageDirection'\nimport { getPageType, TSource } from './utils/pageType'\nimport { getProjectName } from './utils/getProjectName'\nimport { getLotName } from './utils/getLotName'\nimport { setEventPageView, TEventPageView } from './events/eventPageView'\nimport { setEventPageViewForce } from './events/eventPageViewForce'\nimport { setEventSubmit, TEventSubmit } from './events/eventSubmit'\nimport { setEventLotFeedShow, TEventLotFeedShow } from './events/eventLotFeedShow'\nimport { setEventClick, TEventClick } from './events/eventClick'\nimport { setEventCheck, TEventCheck } from './events/eventCheck'\nimport { setEventBlur, TEventBlur } from './events/eventBlur'\nimport { setEventFullScreen } from './events/eventFullScreenView'\nimport { setEventBannerShow, TEventBannerShow } from './events/eventBannerShow'\nimport { setEventBannerClick, TEventBannerClick } from './events/eventBannerClick'\n\ndeclare global {\n\tinterface Window {\n\t\tComagic?: any\n\t\tStoneDataLayer: any\n\t}\n}\n\nexport class StoneDataLayerStore {\n\tpageParamsIsLoading: boolean\n\tpageParamsWasSet: boolean\n\n\tym_uid?: string\n\tcm_visitor_id?: string\n\tcm_session_id?: string\n\tfingerprint_id?: string\n\tvisible_virtual_pn?: string\n\tpage_type?: string\n\tpage_direction?: string | null\n\tpage_project?: string | null\n\tpage_lot?: string | null\n\tab_test_name?: string | null\n\tab_test_group?: string | null\n\n\tconstructor() {\n\t\tthis.pageParamsIsLoading = false\n\t\tthis.pageParamsWasSet = false\n\t\tthis.page_type = undefined\n\t\tthis.page_direction = undefined\n\t\tthis.page_project = undefined\n\t\tthis.page_lot = undefined\n\n\t\tmakeAutoObservable(this)\n\t}\n\n\tinitializeUserId() {\n\t\tif (typeof window === 'undefined') return null\n\t\treturn localStorage.getItem('user_reg_id')\n\t}\n\n\tpushLayer(tagManagerArgs: any) {\n\t\tif (typeof window !== 'undefined') {\n\t\t\tconst StoneDataLayer = window.StoneDataLayer || []\n\t\t\tStoneDataLayer.push(tagManagerArgs)\n\t\t}\n\t}\n\n\tsetPageParams({ pathname, source, href }: { pathname: string; source: TSource; href?: string }) {\n\t\tconst normalizedPath =\n\t\t\tpathname.startsWith('/retail/') || pathname.startsWith('/offices/')\n\t\t\t\t? `/catalog${pathname}`\n\t\t\t\t: pathname\n\t\tthis.pageParamsIsLoading = true\n\t\tthis.page_direction = getPageDirection(normalizedPath, href)\n\t\tthis.page_type = getPageType(normalizedPath, source, href)\n\t\tthis.page_project = getProjectName(normalizedPath, href)\n\t\tthis.page_lot = getLotName(normalizedPath)\n\t\tthis.ab_test_name = 'abgroup'\n\t\tthis.ab_test_group = process.env.NEXT_PUBLIC_AB_TEST_GROUP\n\n\t\tthis.pageParamsIsLoading = false\n\t\tthis.pageParamsWasSet = true\n\t}\n\n\tasync setFingerPrint() {\n\t\tthis.fingerprint_id = (await getStoneHashClientId()) ?? null\n\t}\n\n\tasync setEventPageView(props?: Omit<TEventPageView, 'store'>) {\n\t\tawait setEventPageView({ store: this, ...props })\n\t}\n\n\tasync setEventPageViewForce() {\n\t\t//тестовая отправка, метод дергал без ожиданий вообще чисто для теста Антона\n\t\tawait setEventPageViewForce({ store: this })\n\t}\n\n\tasync setEventSubmit(props: Omit<TEventSubmit, 'store'>) {\n\t\tawait setEventSubmit({ store: this, ...props })\n\t}\n\n\tasync setEventLotFeedShow(props: Omit<TEventLotFeedShow, 'store'>) {\n\t\tawait setEventLotFeedShow({ store: this, ...props })\n\t}\n\n\tasync setEventClick(props: Omit<TEventClick, 'store'>) {\n\t\tawait setEventClick({ store: this, ...props })\n\t}\n\n\tasync setEventCheck(props: Omit<TEventCheck, 'store'>) {\n\t\tawait setEventCheck({ store: this, ...props })\n\t}\n\n\tasync setEventBlur(props: Omit<TEventBlur, 'store'>) {\n\t\tawait setEventBlur({ store: this, ...props })\n\t}\n\n\tasync setEventFullScreen() {\n\t\tawait setEventFullScreen({ store: this })\n\t}\n\n\tasync setEventBannerShow(props: Omit<TEventBannerShow, 'store'>) {\n\t\tawait setEventBannerShow({ store: this, ...props })\n\t}\n\n\tasync setEventBannerClick(props: Omit<TEventBannerClick, 'store'>) {\n\t\tawait setEventBannerClick({ store: this, ...props })\n\t}\n}\n\nexport const stoneDataLayerStore = new StoneDataLayerStore()\n","export type TPageDirection = 'apartments' | 'offices' | 'retail' | 'investments' | null\n\nconst pathDirection = {\n commercial: 'offices',\n residential: 'apartments',\n retail: 'retail',\n offices: 'offices',\n investments: 'investments',\n} as const\n\nconst specialCondition = {\n 'stone.moscow': 'apartments',\n 'stone-sokolniki': 'apartments',\n 'sokolniki-stone': 'apartments',\n 'stone-rise': 'apartments',\n 'stone-hod': 'offices'\n}\n\nexport const getPageDirection = (pathname: string, href?: string): TPageDirection => {\n let specialResult = null\n\n if (href) {\n Object.keys(specialCondition).forEach((el) => {\n if (href.includes(el)) {\n specialResult = specialCondition[el]\n }\n })\n if (specialResult) return specialResult\n }\n\n\n //хардкод ритейла т.к по сути он офисный проект\n switch (pathname) {\n case '/commercial/sokolniki-retail':\n return 'retail'\n case '/commercial/mnevniki-retail':\n return 'retail'\n }\n\n const key = Object.keys(pathDirection).filter((el) => pathname.includes(el))[0]\n const value = pathDirection[key as keyof typeof pathDirection]\n if (value) return value\n else return null\n}\n","const reg_com_project = /^\\/commercial\\/[^/]+$/\nconst reg_res_project = /^\\/residential\\/[^/]+$/\nconst reg_retail_project = /^\\/catalog\\/retail\\/([^/]+)$/\nconst reg_offices_project = /^\\/catalog\\/offices\\/([^/]+)$/\n\nconst reg_com_lot = /^\\/catalog\\/commercial\\/([a-z0-9_#-]+)(?:\\/[a-z0-9_#-]+)*$/i\nconst reg_res_lot = /^\\/catalog\\/residential\\/([a-z0-9_#-]+)(?:\\/[a-z0-9_#-]+)*$/i\nconst reg_retail_lot = /^\\/catalog\\/retail\\/([a-z0-9_#-]+)(?:\\/[a-z0-9_#-]+)*$/i\nconst reg_offices_lot = /^\\/catalog\\/offices\\/([a-z0-9_#-]+)(?:\\/[a-z0-9_#-]+)*$/i\n\nexport {\n reg_com_lot,\n reg_res_lot,\n reg_retail_lot,\n reg_offices_lot,\n reg_com_project,\n reg_res_project,\n reg_retail_project,\n reg_offices_project,\n}\n","import {\n reg_com_lot,\n reg_com_project,\n reg_res_lot,\n reg_res_project,\n reg_retail_lot,\n reg_retail_project,\n reg_offices_lot,\n reg_offices_project,\n} from './regs'\n\nexport type TSource = 'stone' | 'sokolniki' | 'stone-hod' | 'stonehod'\n\nexport const staticPageViewType = {\n '/': 'main',\n '/loyalty': 'loyalty',\n '/residential': 'category_page',\n '/commercial': 'category_page',\n '/retail': 'category_page',\n '/rent': 'rent',\n '/service': 'services',\n '/presscenter': 'press_center',\n '/purchaseterms': 'terms_of_purchase',\n '/purchaseterms/residential': 'terms_of_purchase',\n '/contacts': 'contacts',\n '/documents': 'documents',\n '/documents/docs': 'documents',\n '/documents/soglasie-na-rassylki': 'documents',\n '/documents/politika-konfidenczialnosti': 'documents',\n '/documents/usloviya-loyalty': 'documents',\n '/investments': 'investments',\n '/about': 'about_company',\n '/catalog/commercial': 'lot_catalog',\n '/catalog/residential': 'lot_catalog',\n '/catalog/retail': 'lot_catalog',\n '/catalog/offices': 'lot_catalog',\n} as const\n\nexport const sokolnikiPageViewType = {\n '/': 'project_card',\n '/policy': 'project_card'\n}\n\nexport const stoneHodPageViewType = {\n '/': 'stoneHod_main',\n '/policy': 'stoneHod_policy'\n}\n\nconst specialCondition = {\n 'stone.moscow': 'category_page',\n 'stone-sokolniki': 'project_card',\n 'sokolniki-stone': 'project_card',\n 'stone-rise': 'project_card',\n 'stone-hod': 'category_page'\n}\n\nexport type TPageType = keyof typeof staticPageViewType\n\nexport const getPageType = (pathname: string, source = 'stone' as TSource, href?: string) => {\n let specialResult = null\n\n if (href) {\n Object.keys(specialCondition).forEach((el) => {\n if (href.includes(el)) {\n specialResult = specialCondition[el]\n }\n })\n if (specialResult) return specialResult\n }\n\n if (pathname) {\n switch (source) {\n case \"stone\": {\n const isOnStaticPage = Object.keys(staticPageViewType).includes(pathname)\n //для статических страниц\n if (isOnStaticPage) return staticPageViewType[pathname as keyof typeof staticPageViewType]\n //для динамической страницы проекта\n else if (\n reg_com_project.test(pathname) ||\n reg_res_project.test(pathname) ||\n reg_retail_project.test(pathname) ||\n reg_offices_project.test(pathname)\n ) {\n return 'project_card'\n }\n else if (\n reg_com_lot.test(pathname) ||\n reg_res_lot.test(pathname) ||\n reg_retail_lot.test(pathname) ||\n reg_offices_lot.test(pathname)\n ) {\n return 'lot_card'\n }\n return null\n }\n\n case \"sokolniki\" : {\n return sokolnikiPageViewType[pathname as keyof typeof sokolnikiPageViewType]\n }\n\n case \"stone-hod\": {\n return stoneHodPageViewType[pathname as keyof typeof stoneHodPageViewType]\n }\n\n default:\n return null\n }\n }\n\n return 'other'\n}\n","import {\n reg_com_lot,\n reg_res_lot,\n reg_retail_lot,\n reg_offices_lot,\n reg_com_project,\n reg_res_project,\n reg_retail_project,\n reg_offices_project,\n} from './regs'\n\nconst specialCondition = {\n 'stone-sokolniki': 'sokolniki',\n 'sokolniki-stone': 'sokolniki',\n 'stone-rise': 'rise',\n 'stone-hod': 'hodinka',\n}\n\nexport const getProjectName = (pathname: string, href?: string) => {\n let specialResult = null\n\n const comMatch = pathname.match(reg_com_project)\n const resMatch = pathname.match(reg_res_project)\n const retailProjectMatch = pathname.match(reg_retail_project)\n const officesProjectMatch = pathname.match(reg_offices_project)\n\n const comLotMatch = pathname.match(reg_com_lot)\n const resLotMatch = pathname.match(reg_res_lot)\n const retailLotMatch = pathname.match(reg_retail_lot)\n const officesLotMatch = pathname.match(reg_offices_lot)\n\n if (href) {\n Object.keys(specialCondition).forEach((el) => {\n if (href.includes(el)) {\n specialResult = specialCondition[el]\n }\n })\n }\n\n if (specialResult) return specialResult\n\n if (comLotMatch) return comLotMatch[1]\n if (resLotMatch) return resLotMatch[1]\n if (retailLotMatch) return retailLotMatch[1]\n if (officesLotMatch) return officesLotMatch[1]\n if (comMatch) return comMatch[1]\n if (resMatch) return resMatch[1]\n if (retailProjectMatch) return retailProjectMatch[1]\n if (officesProjectMatch) return officesProjectMatch[1]\n return null\n}\n","const reg_com_lot_last = /^\\/catalog\\/commercial\\/(?:[a-z0-9_#-]+\\/)*([a-z0-9_#-]+)$/i\nconst reg_res_lot_last = /^\\/catalog\\/residential\\/(?:[a-z0-9_#-]+\\/)*([a-z0-9_#-]+)$/i\nconst reg_retail_lot_last = /^\\/catalog\\/retail\\/(?:[a-z0-9_#-]+\\/)*([a-z0-9_#-]+)$/i\nconst reg_offices_lot_last = /^\\/catalog\\/offices\\/(?:[a-z0-9_#-]+\\/)*([a-z0-9_#-]+)$/i\n\nexport const getLotName = (pathname: string) => {\n const comMatch = pathname.match(reg_com_lot_last)\n const resMatch = pathname.match(reg_res_lot_last)\n const retailMatch = pathname.match(reg_retail_lot_last)\n const officesMatch = pathname.match(reg_offices_lot_last)\n\n if (comMatch) return comMatch[1]\n if (resMatch) return resMatch[1]\n if (retailMatch) return retailMatch[1]\n if (officesMatch) return officesMatch[1]\n return null\n}\n","import {StoneDataLayerStore} from \"../StoneDataLayerStore\";\n\nexport const getDefaultAnalyticsData = (store: StoneDataLayerStore) => ({\n ym_uid: store.ym_uid ?? null,\n cm_visitor_id: store.cm_visitor_id ?? null,\n cm_session_id: store.cm_session_id ?? null,\n fingerprint_id: store?.fingerprint_id ?? null,\n visible_virtual_pn: store?.visible_virtual_pn ?? null,\n page_type: store.page_type,\n page_direction: store.page_direction,\n page_project: store.page_project,\n page_lot: store.page_lot,\n ab_test_name: store.ab_test_name,\n ab_test_group: store.ab_test_group,\n user_id: store.initializeUserId() ?? null,\n})\n","import {StoneDataLayerStore} from \"../StoneDataLayerStore\";\nimport {getDefaultAnalyticsData} from \"../utils/getDefaultAnalyticsData\";\n\nexport type TEventPageView = {\n store: StoneDataLayerStore\n user_id?: string | null\n auth?: boolean\n projectName?: string\n lotName?: string\n}\n\nexport const setEventPageView = async ({store}: TEventPageView) => {\n try {\n const defaultData = getDefaultAnalyticsData(store)\n\n const additionalFields = {\n event: 'pageview',\n }\n\n const dataForPush = {...defaultData}\n delete dataForPush.ym_uid\n\n store.pushLayer({...dataForPush, ...additionalFields})\n } catch (e) {\n console.log('error', e)\n }\n}\n","import {StoneDataLayerStore} from \"../StoneDataLayerStore\";\nimport {getDefaultAnalyticsData} from \"../utils/getDefaultAnalyticsData\";\n\nexport type TEventPageView = {\n store: StoneDataLayerStore\n projectName?: string\n lotName?: string\n}\n\nexport const setEventPageViewForce = async ({ store }: TEventPageView) => {\n try {\n const defaultData = getDefaultAnalyticsData(store)\n\n const additionalFields = {\n event: 'pageview_force',\n }\n\n store.pushLayer({ ...defaultData, ...additionalFields })\n } catch (e) {\n console.log('error',e)\n }\n}\n","import {md5} from \"js-md5\";\n\nexport const getVisibleVirtualPn = () => {\n const virtual_pn = document.getElementById('header_phone')?.getAttribute(\"href\")?.replace(/\\D/g, \"\");\n return typeof virtual_pn === 'string' ? md5(virtual_pn) : undefined\n}","export const getYmUid = (id: number) => {\n if (typeof window !== 'undefined' && typeof ym !== 'undefined') {\n let ymUid\n ym(id, 'getClientID', function (clientID) {\n ymUid = clientID\n })\n return ymUid ?? null\n }\n}\n","declare const Comagic: any\n\nconst getComagicVisitorId = () => {\n if (typeof Comagic !== 'undefined') {\n return Comagic && Comagic.getVisitorId()\n }\n else return null\n}\n\nconst getComagicSessionId = () => {\n if (typeof Comagic !== 'undefined') {\n return Comagic && Comagic.getSessionId()\n }\n else return null\n}\n\nexport { getComagicSessionId, getComagicVisitorId }\n","import {getYmUid} from \"./getYmUid\";\nimport {getComagicSessionId, getComagicVisitorId} from \"./getComagicId\";\n\nexport const setAnalyticId = (defaultData: any)=> {\n defaultData.ym_uid = getYmUid(95057596)\n defaultData.cm_visitor_id = getComagicVisitorId()\n defaultData.cm_session_id = getComagicSessionId()\n}","import { getDefaultAnalyticsData } from '../utils/getDefaultAnalyticsData'\nimport { StoneDataLayerStore } from '../StoneDataLayerStore'\nimport { getVisibleVirtualPn } from '../../../utils/getVisibleVirtualPn'\nimport { setAnalyticId } from '../utils/setAnalyticId'\n\nexport type TEventSubmit = {\n\tstore: StoneDataLayerStore\n\tblock_name?: string\n\tauth?: boolean\n\tlead_id?: string\n\tsubmitted_lot?: string\n\tsubmitted_lot_project?: string\n}\n\nexport const setEventSubmit = async ({\n\tstore,\n\tlead_id,\n\tblock_name,\n\tauth,\n\tsubmitted_lot,\n\tsubmitted_lot_project,\n}: TEventSubmit) => {\n\ttry {\n\t\tconst defaultData = getDefaultAnalyticsData(store)\n\n\t\tconst additionalFields = {\n\t\t\tevent: 'submit',\n\t\t\tlead_id: String(lead_id),\n\t\t\tblock_name,\n\t\t\tauth,\n\t\t\tsubmitted_lot: submitted_lot ?? null,\n\t\t\tsubmitted_lot_project: submitted_lot_project ?? null,\n\t\t}\n\n\t\tdefaultData.visible_virtual_pn = getVisibleVirtualPn()\n\t\tsetAnalyticId(defaultData)\n\n\t\tstore.pushLayer({ ...defaultData, ...additionalFields })\n\t} catch (e) {\n\t\tconsole.log('error', e)\n\t}\n}\n","import {StoneDataLayerStore} from \"../StoneDataLayerStore\";\nimport {getDefaultAnalyticsData} from \"../utils/getDefaultAnalyticsData\";\nimport {getVisibleVirtualPn} from \"../../../utils/getVisibleVirtualPn\";\nimport {setAnalyticId} from \"../utils/setAnalyticId\";\n\nexport type TEventLotFeedShow = {\n store: StoneDataLayerStore\n pathname?: string\n block_name?: string\n list_of_lots: TAnalyticFeedLot[]\n}\n\nexport type TAnalyticFeedLot = {\n position: number | null\n lot: string | null\n lot_project: string | null\n}\n\nexport const setEventLotFeedShow = async ({\n store,\n block_name,\n list_of_lots,\n }: TEventLotFeedShow) => {\n try {\n const defaultData = getDefaultAnalyticsData(store)\n\n const additionalFields = {\n event: 'lot_feed_show',\n block_name,\n list_of_lots,\n }\n\n const dataForPush = {...defaultData}\n setAnalyticId(defaultData)\n\n delete dataForPush.ym_uid\n delete dataForPush.cm_visitor_id\n delete dataForPush.cm_session_id\n\n defaultData.visible_virtual_pn = getVisibleVirtualPn()\n\n store.pushLayer({...defaultData, ...additionalFields})\n } catch (e) {\n console.log('error', e)\n }\n}\n","import { StoneDataLayerStore } from '../StoneDataLayerStore'\nimport { getDefaultAnalyticsData } from '../utils/getDefaultAnalyticsData'\nimport { getVisibleVirtualPn } from '../../../utils/getVisibleVirtualPn'\nimport { setAnalyticId } from '../utils/setAnalyticId'\n\nexport type TEventClick = {\n\tstore: StoneDataLayerStore\n\tpathname?: string\n\tblock_name?: string\n\tauth?: boolean\n\tclicked_url?: string\n\taction_element?: string | null\n\taction_element_text?: string | null\n\taction_element_status?: 'error' | 'success'\n\tclicked_lot?: string\n\tclicked_lot_project?: string\n\tclicked_lot_position?: string\n}\n\nexport const setEventClick = async ({\n\tstore,\n\taction_element,\n\taction_element_text,\n\tblock_name,\n\tclicked_url,\n\tauth,\n\tclicked_lot,\n\tclicked_lot_project,\n\tclicked_lot_position,\n\taction_element_status,\n}: TEventClick) => {\n\ttry {\n\t\tconst defaultData = getDefaultAnalyticsData(store)\n\n\t\tconst additionalFields: Omit<TEventClick, 'store'> & { event: string } = {\n\t\t\tevent: 'click',\n\t\t\taction_element,\n\t\t\taction_element_text,\n\t\t\tblock_name,\n\t\t\tauth,\n\t\t\tclicked_url,\n\t\t\tclicked_lot: clicked_lot ?? null,\n\t\t\tclicked_lot_project: clicked_lot_project ?? null,\n\t\t\tclicked_lot_position: clicked_lot_position ?? null,\n\t\t}\n\n\t\tif (action_element_status) additionalFields.action_element_status = action_element_status\n\n\t\tdefaultData.visible_virtual_pn = getVisibleVirtualPn()\n\n\t\tsetAnalyticId(defaultData)\n\n\t\tstore.pushLayer({ ...defaultData, ...additionalFields })\n\t} catch (e) {\n\t\tconsole.log('error', e)\n\t}\n}\n","import { getDefaultAnalyticsData } from '../utils/getDefaultAnalyticsData'\nimport { StoneDataLayerStore } from '../StoneDataLayerStore'\nimport { getVisibleVirtualPn } from '../../../utils/getVisibleVirtualPn'\nimport { setAnalyticId } from '../utils/setAnalyticId'\n\nexport type TEventCheck = {\n\tstore: StoneDataLayerStore\n\tpathname?: string\n\tblock_name?: string\n\tauth?: boolean\n\taction_element: string\n\taction_element_text: string\n}\n\nexport const setEventCheck = async ({\n\tstore,\n\taction_element,\n\tauth,\n\taction_element_text,\n\tblock_name,\n}: TEventCheck) => {\n\ttry {\n\t\tconst defaultData = getDefaultAnalyticsData(store)\n\n\t\tconst additionalFields = {\n\t\t\tevent: 'check',\n\t\t\taction_element,\n\t\t\tauth,\n\t\t\taction_element_text,\n\t\t\tblock_name,\n\t\t}\n\n\t\tdefaultData.visible_virtual_pn = getVisibleVirtualPn()\n\n\t\tsetAnalyticId(defaultData)\n\n\t\tstore.pushLayer({ ...defaultData, ...additionalFields })\n\t} catch (e) {\n\t\tconsole.log('error', e)\n\t}\n}\n","import { StoneDataLayerStore } from '../StoneDataLayerStore'\nimport { getDefaultAnalyticsData } from '../utils/getDefaultAnalyticsData'\nimport { getVisibleVirtualPn } from '../../../utils/getVisibleVirtualPn'\nimport { setAnalyticId } from '../utils/setAnalyticId'\n\nexport type TEventBlur = {\n\tstore: StoneDataLayerStore\n\tpathname?: string\n\tauth?: boolean\n\tblock_name?: string\n\taction_element: string\n\taction_element_status: 'error' | 'success'\n}\n\nexport const setEventBlur = async ({\n\tstore,\n\taction_element,\n\tblock_name,\n\tauth,\n\taction_element_status,\n}: TEventBlur) => {\n\ttry {\n\t\tconst defaultData = getDefaultAnalyticsData(store)\n\n\t\tconst additionalFields = {\n\t\t\tevent: 'blur',\n\t\t\taction_element,\n\t\t\taction_element_status,\n\t\t\tblock_name,\n\t\t\tauth,\n\t\t}\n\n\t\tdefaultData.visible_virtual_pn = getVisibleVirtualPn()\n\n\t\tsetAnalyticId(defaultData)\n\n\t\tstore.pushLayer({ ...defaultData, ...additionalFields })\n\t} catch (e) {\n\t\tconsole.log('error', e)\n\t}\n}\n","import { StoneDataLayerStore } from '../StoneDataLayerStore'\nimport { getDefaultAnalyticsData } from '../utils/getDefaultAnalyticsData'\nimport { getVisibleVirtualPn } from '../../../utils/getVisibleVirtualPn'\nimport { setAnalyticId } from '../utils/setAnalyticId'\n\nexport type TEventPageView = {\n\tstore: StoneDataLayerStore\n\tprojectName?: string\n\tauth?: boolean\n\tlotName?: string\n}\n\nexport const setEventFullScreen = async ({ store }: TEventPageView) => {\n\ttry {\n\t\tconst defaultData = getDefaultAnalyticsData(store)\n\n\t\tconst additionalFields = {\n\t\t\tevent: 'fullscreenview',\n\t\t}\n\n\t\tdefaultData.visible_virtual_pn = getVisibleVirtualPn()\n\n\t\tsetAnalyticId(defaultData)\n\n\t\tstore.pushLayer({ ...defaultData, ...additionalFields })\n\t} catch (e) {\n\t\tconsole.log('error', e)\n\t}\n}\n","import { StoneDataLayerStore } from '../StoneDataLayerStore'\nimport { getDefaultAnalyticsData } from '../utils/getDefaultAnalyticsData'\nimport { setAnalyticId } from '../utils/setAnalyticId'\n\nexport type TEventBannerShow = {\n\tstore: StoneDataLayerStore\n\tpathname?: string\n\tblock_name?: string\n\tauth?: boolean\n\tbanner_text: string\n\tbanner_link: string\n}\n\nexport const setEventBannerShow = async ({\n\tstore,\n\tbanner_text,\n\tbanner_link,\n\tauth,\n\tblock_name,\n}: TEventBannerShow) => {\n\ttry {\n\t\tconst defaultData = getDefaultAnalyticsData(store)\n\n\t\tconst additionalFields = {\n\t\t\tevent: 'banner_show',\n\t\t\tbanner_text,\n\t\t\tbanner_link,\n\t\t\tauth,\n\t\t\tblock_name,\n\t\t}\n\n\t\tsetAnalyticId(defaultData)\n\n\t\tstore.pushLayer({ ...defaultData, ...additionalFields })\n\t} catch (e) {\n\t\tconsole.log('error', e)\n\t}\n}\n","import { StoneDataLayerStore } from '../StoneDataLayerStore'\nimport { getDefaultAnalyticsData } from '../utils/getDefaultAnalyticsData'\nimport { setAnalyticId } from '../utils/setAnalyticId'\n\nexport type TEventBannerClick = {\n\tstore: StoneDataLayerStore\n\tpathname?: string\n\tblock_name?: string\n\tauth?: boolean\n\tclicked_url?: string\n\tbanner_text: string\n\tbanner_link: string\n}\n\nexport const setEventBannerClick = async ({\n\tstore,\n\tbanner_text,\n\tbanner_link,\n\tauth,\n\tclicked_url,\n\tblock_name,\n}: TEventBannerClick) => {\n\ttry {\n\t\tconst defaultData = getDefaultAnalyticsData(store)\n\n\t\tconst additionalFields = {\n\t\t\tevent: 'banner_click',\n\t\t\tbanner_text,\n\t\t\tbanner_link,\n\t\t\tauth,\n\t\t\tclicked_url,\n\t\t\tblock_name,\n\t\t}\n\n\t\tsetAnalyticId(defaultData)\n\n\t\tstore.pushLayer({ ...defaultData, ...additionalFields })\n\t} catch (e) {\n\t\tconsole.log('error', e)\n\t}\n}\n"],"mappings":"yjBAAA,IAAAA,GAAA,GAAAC,GAA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EA,MAAM,cAAcA,EAAmC,CACtD,MAAMK,GAAc,CAAE,MAAO,KAAM,GAAGL,CAAM,CAAC,CAC9C,CAEA,MAAM,cAAcA,EAAmC,CACtD,MAAMM,GAAc,CAAE,MAAO,KAAM,GAAGN,CAAM,CAAC,CAC9C,CAEA,MAAM,aAAaA,EAAkC,CACpD,MAAMO,GAAa,CAAE,MAAO,KAAM,GAAGP,CAAM,CAAC,CAC7C,CAEA,MAAM,oBAAqB,CAC1B,MAAMQ,GAAmB,CAAE,MAAO,IAAK,CAAC,CACzC,CAEA,MAAM,mBAAmBR,EAAwC,CAChE,MAAMS,GAAmB,CAAE,MAAO,KAAM,GAAGT,CAAM,CAAC,CACnD,CAEA,MAAM,oBAAoBA,EAAyC,CAClE,MAAMU,GAAoB,CAAE,MAAO,KAAM,GAAGV,CAAM,CAAC,CACpD,CACD,EAEaW,GAAsB,IAAItB","names":["index_exports","__export","StoneDataLayerStore","checkTimeStamp","getABCookie","getGoogleAnalyticsClientId","getLotName","getPageDirection","getPageType","getProjectName","getStoneClientId","getStoneHashClientId","getStoneSessionId","getYandexMetrikaClientId","sendAnalytics","setClientId","setSessionId","sokolnikiPageViewType","staticPageViewType","stoneDataLayerStore","stoneHodPageViewType","useComagicStatus","useInitializeMetrics","__toCommonJS","makeTimeBasedUID","isLocalStorage","checkTimeStamp","clientId","unixTimestamp","ISOSDate","ISOSDateNow","setSessionId","newId","makeTimeBasedUID","setClientId","dataLayerPush","data","_a","isTest","pathname","href","layerEvent","ymTarget","data","isTest","sendAnalyticsToAPI","data","isTest","url","pathname","href","formData","import_fingerprintjs","import_fingerprintjs","import_cookies_next","getStoneHashClientId","st_client_hash_id","FingerprintJS","fp","result","getStoneSessionId","st_session_id","getStoneClientId","st_client_id","getGoogleAnalyticsClientId","_ga","_ga_local","getYandexMetrikaClientId","_ym_uid","_ym_uid_local","sendAnalytics","data","_a","fpPromise","FingerprintJS","isTest","makeTimeBasedUID","fp","result","e","getYandexMetrikaClientId","getGoogleAnalyticsClientId","getStoneClientId","getStoneSessionId","dataLayerPush","ymTarget","sendAnalyticsToAPI","import_react","useInitializeMetrics","isLocalStorage","isClientId","isSessionId","isYearPast","checkTimeStamp","setClientId","setSessionId","sendAnalytics","tabCountStorage","tabCount","handleBeforeUnload","scrollTop","scrollHeight","scrollPercent","inactivityTimer","resetInactivityTimer","events","event","import_react","useComagicStatus","status","setStatus","timer","getABCookie","name","escapedName","regex","match","import_mobx","pathDirection","specialCondition","getPageDirection","pathname","href","specialResult","el","key","value","reg_com_project","reg_res_project","reg_retail_project","reg_offices_project","reg_com_lot","reg_res_lot","reg_retail_lot","reg_offices_lot","staticPageViewType","sokolnikiPageViewType","stoneHodPageViewType","specialCondition","getPageType","pathname","source","href","specialResult","el","reg_com_project","reg_res_project","reg_retail_project","reg_offices_project","reg_com_lot","reg_res_lot","reg_retail_lot","reg_offices_lot","specialCondition","getProjectName","pathname","href","specialResult","comMatch","reg_com_project","resMatch","reg_res_project","retailProjectMatch","reg_retail_project","officesProjectMatch","reg_offices_project","comLotMatch","reg_com_lot","resLotMatch","reg_res_lot","retailLotMatch","reg_retail_lot","officesLotMatch","reg_offices_lot","el","reg_com_lot_last","reg_res_lot_last","reg_retail_lot_last","reg_offices_lot_last","getLotName","pathname","comMatch","resMatch","retailMatch","officesMatch","getDefaultAnalyticsData","store","setEventPageView","store","defaultData","getDefaultAnalyticsData","additionalFields","dataForPush","setEventPageViewForce","store","defaultData","getDefaultAnalyticsData","additionalFields","import_js_md5","getVisibleVirtualPn","_a","_b","virtual_pn","getYmUid","id","ymUid","clientID","getComagicVisitorId","getComagicSessionId","setAnalyticId","defaultData","getYmUid","getComagicVisitorId","getComagicSessionId","setEventSubmit","store","lead_id","block_name","auth","submitted_lot","submitted_lot_project","defaultData","getDefaultAnalyticsData","additionalFields","getVisibleVirtualPn","setAnalyticId","e","setEventLotFeedShow","store","block_name","list_of_lots","defaultData","getDefaultAnalyticsData","additionalFields","dataForPush","setAnalyticId","getVisibleVirtualPn","e","setEventClick","store","action_element","action_element_text","block_name","clicked_url","auth","clicked_lot","clicked_lot_project","clicked_lot_position","action_element_status","defaultData","getDefaultAnalyticsData","additionalFields","getVisibleVirtualPn","setAnalyticId","e","setEventCheck","store","action_element","auth","action_element_text","block_name","defaultData","getDefaultAnalyticsData","additionalFields","getVisibleVirtualPn","setAnalyticId","e","setEventBlur","store","action_element","block_name","auth","action_element_status","defaultData","getDefaultAnalyticsData","additionalFields","getVisibleVirtualPn","setAnalyticId","e","setEventFullScreen","store","defaultData","getDefaultAnalyticsData","additionalFields","getVisibleVirtualPn","setAnalyticId","setEventBannerShow","store","banner_text","banner_link","auth","block_name","defaultData","getDefaultAnalyticsData","additionalFields","setAnalyticId","e","setEventBannerClick","store","banner_text","banner_link","auth","clicked_url","block_name","defaultData","getDefaultAnalyticsData","additionalFields","setAnalyticId","e","StoneDataLayerStore","tagManagerArgs","pathname","source","href","normalizedPath","getPageDirection","getPageType","getProjectName","getLotName","getStoneHashClientId","props","setEventPageView","setEventPageViewForce","setEventSubmit","setEventLotFeedShow","setEventClick","setEventCheck","setEventBlur","setEventFullScreen","setEventBannerShow","setEventBannerClick","stoneDataLayerStore"]}
|