DmitrMakeev commited on
Commit
07abe2b
·
verified ·
1 Parent(s): a135a26

Update js/senler_btn_ud_v1.js

Browse files
Files changed (1) hide show
  1. js/senler_btn_ud_v1.js +1 -1
js/senler_btn_ud_v1.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t={};function n(o){if(t[o])return t[o].exports;var a=t[o]={i:o,l:!1,exports:{}};return e[o].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(o,a,function(t){return e[t]}.bind(null,a));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){const n=window.w_url.replace(/\/+$/,"")+"/add_user_senler_full",o=Number(window.vk_grup),a=window.vk_grup,r=window.s_grup,s=window.red_on,i=window.on_url,c=window.clarity_on,l=window.clarity_id,d=window.clarity_ses,p=window.clarity_tar,u=window.funnel,m=window.clarity_ev,y=window.ups;let w,_,f,h,g,k,P,b,B,v;const E=new URL(window.location.href),I=E.searchParams.get("vk_user_id");E.searchParams.get("vk_app_id"),window.location.href;v=window.location.hash.substring(1);const S=new URLSearchParams(v);h=S.get("gcpc")||"",g=S.get("utm_source")||"",k=S.get("utm_medium")||"",P=S.get("utm_campaign")||"",b=S.get("utm_content")||"",B=S.get("utm_term")||"",w=S.get("name")||"",_=S.get("email")||"",f=S.get("phone")||"";const T=I.toString();E.searchParams.get("vk_app_id");let j;function O(){document.getElementById("loyaltyBlock").style.display="block",document.getElementById("formBlock").style.display="none",c&&(window.clarity?window.clarity("set","loyalty","not"):console.log("Clarity is not initialized"))}function L(){const e=new URLSearchParams;e.append("vk_user_id",j),e.append("vk_group_id",a),e.append("sub_id",r),e.append("name",w),e.append("email",_),e.append("phone",f),e.append("utm_source",g),e.append("utm_medium",k),e.append("utm_campaign",P),e.append("utm_content",b),e.append("utm_term",B),fetch(n,{method:"POST",body:e}).then(e=>{if(!e.ok)throw new Error("Ошибка HTTP: "+e.status);return e.json()}).then(e=>{if(e&&e.add_response&&e.add_response.success){if(document.getElementById("formBlock").style.display="none",document.getElementById("loyaltyBlock").style.display="none",document.getElementById("stopBlock").style.display="block",s){c&&(U(m),R());let e=new URL(i);e.searchParams.append("ups",y),e.searchParams.append("uid",j),e.searchParams.append("name",w),e.searchParams.append("email",_),e.searchParams.append("phone",f),e.searchParams.append("gcpc",h),e.searchParams.append("utm_source",g),e.searchParams.append("utm_medium",k),e.searchParams.append("utm_campaign",P),e.searchParams.append("utm_content",b),e.searchParams.append("utm_term",B),window.open(e.toString(),"_blank")}else c&&(U(m),R());document.getElementById("thankBlock").style.display="block"}else O()}).catch(e=>{console.error("Error:",e.message),O()})}function U(e){window.clarity?window.clarity("event",e):console.log("Clarity is not initialized")}function R(){window.clarity?window.clarity("set","loyalty","yes"):console.log("Clarity is not initialized")}var x,z,C,M,A,D,H;vkBridge.send("VKWebAppInit"),document.getElementById("formBlock").addEventListener("submit",(function(e){e.preventDefault(),vkBridge.send("VKWebAppAllowMessagesFromGroup",{group_id:o,key:"cc964fabb0e1d70924a92e4e8b513dbff7cc10a9"}).then(e=>{e.result?vkBridge.send("VKWebAppGetUserInfo").then(e=>{j=e.id,setTimeout(L,1e3)}).catch(e=>{O()}):O()}).catch(e=>{O()})})),c&&(x=window,z=document,M="script",A=l,x[C="clarity"]=x[C]||function(){(x[C].q=x[C].q||[]).push(arguments)},(D=z.createElement(M)).async=1,D.src="https://www.clarity.ms/tag/"+A,(H=z.getElementsByTagName(M)[0]).parentNode.insertBefore(D,H),function(e,t,n){window.clarity?window.clarity("identify",e,t,n):console.log("Clarity is not initialized")}(T,d,p),function(e,t,n,o,a,r){window.clarity?(window.clarity("set","utm_source",e),window.clarity("set","utm_medium",t),window.clarity("set","utm_campaign",n),window.clarity("set","utm_content",o),window.clarity("set","utm_term",a),window.clarity("set","funnel",r)):console.log("Clarity is not initialized")}(g,k,P,b,B,u)),$(document).ready((function(){$("#linkThank").on("click",(function(e){if(e.preventDefault(),s){let e=new URL($(this).attr("href"));e.searchParams.append("ups",y),e.searchParams.append("name",w),e.searchParams.append("email",_),e.searchParams.append("phone",f),e.searchParams.append("uid",j),e.searchParams.append("gcpc",h),e.searchParams.append("utm_source",g),e.searchParams.append("utm_medium",k),e.searchParams.append("utm_campaign",P),e.searchParams.append("utm_content",b),e.searchParams.append("utm_term",B),window.open(e.toString(),"_blank")}else window.open($(this).attr("href"),"_blank")})),function(){const e=new URLSearchParams;e.append("vk_user_id",I),e.append("vk_group_id",a),e.append("sub_id",r),fetch(lo_mess_url,{method:"POST",body:e}).then(e=>{if(!e.ok)throw new Error("Ошибка HTTP: "+e.status);return e.json()}).then(e=>{e&&"1"===e.status?(document.getElementById("formBlock").style.display="none",document.getElementById("thankBlock").style.display="block",document.getElementById("stopBlock").style.display="block",console.log("Есть подписка")):(document.getElementById("formBlock").style.display="block",console.log("Нет подписки"))}).catch(e=>{console.error("Error:",e)})}(),$("#linkStopBlock").on("click",(function(e){e.preventDefault(),function(){const e=new URLSearchParams;e.append("vk_user_id",I),e.append("vk_group_id",a),e.append("sub_id",r),fetch(stop_mess_url,{method:"POST",body:e}).then(e=>{if(!e.ok)throw new Error("Ошибка HTTP: "+e.status);return e.json()}).then(e=>{console.log("Ответ от сервера:",e),e&&"success"===e.status?(document.getElementById("formBlock").style.display="block",document.getElementById("stopBlock").style.display="none",document.getElementById("thankBlock").style.display="none",console.log("Подписка отменена")):console.log("Ошибка или подписка не отменена")}).catch(e=>{console.error("Error:",e)})}()}))}))}]);
 
1
+ !function(e){var t={};function n(o){if(t[o])return t[o].exports;var a=t[o]={i:o,l:!1,exports:{}};return e[o].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(o,a,function(t){return e[t]}.bind(null,a));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){const n=window.w_url.replace(/\/+$/,"")+"/add_user_senler_full",o=window.w_url.replace(/\/+$/,"")+"/get_Lo_Mess_senler",a=window.w_url.replace(/\/+$/,"")+"/del_user_senler",r=Number(window.vk_grup),s=window.vk_grup,i=window.s_grup,c=window.red_on,l=window.on_url,d=window.clarity_on,p=window.clarity_id,u=window.clarity_ses,m=window.clarity_tar,y=window.funnel,w=window.clarity_ev,_=window.ups;let f,g,h,k,P,b,B,v,E,I;const S=new URL(window.location.href),T=S.searchParams.get("vk_user_id");S.searchParams.get("vk_app_id"),window.location.href;I=window.location.hash.substring(1);const j=new URLSearchParams(I);k=j.get("gcpc")||"",P=j.get("utm_source")||"",b=j.get("utm_medium")||"",B=j.get("utm_campaign")||"",v=j.get("utm_content")||"",E=j.get("utm_term")||"",f=j.get("name")||"",g=j.get("email")||"",h=j.get("phone")||"";const O=T.toString();S.searchParams.get("vk_app_id");let L;function U(){document.getElementById("loyaltyBlock").style.display="block",document.getElementById("formBlock").style.display="none",d&&(window.clarity?window.clarity("set","loyalty","not"):console.log("Clarity is not initialized"))}function R(){const e=new URLSearchParams;e.append("vk_user_id",L),e.append("vk_group_id",s),e.append("sub_id",i),e.append("name",f),e.append("email",g),e.append("phone",h),e.append("utm_source",P),e.append("utm_medium",b),e.append("utm_campaign",B),e.append("utm_content",v),e.append("utm_term",E),fetch(n,{method:"POST",body:e}).then(e=>{if(!e.ok)throw new Error("Ошибка HTTP: "+e.status);return e.json()}).then(e=>{if(e&&e.add_response&&e.add_response.success){if(document.getElementById("formBlock").style.display="none",document.getElementById("loyaltyBlock").style.display="none",document.getElementById("stopBlock").style.display="block",c){d&&(M(w),x());let e=new URL(l);e.searchParams.append("ups",_),e.searchParams.append("uid",L),e.searchParams.append("name",f),e.searchParams.append("email",g),e.searchParams.append("phone",h),e.searchParams.append("gcpc",k),e.searchParams.append("utm_source",P),e.searchParams.append("utm_medium",b),e.searchParams.append("utm_campaign",B),e.searchParams.append("utm_content",v),e.searchParams.append("utm_term",E),window.open(e.toString(),"_blank")}else d&&(M(w),x());document.getElementById("thankBlock").style.display="block"}else U()}).catch(e=>{console.error("Error:",e.message),U()})}function M(e){window.clarity?window.clarity("event",e):console.log("Clarity is not initialized")}function x(){window.clarity?window.clarity("set","loyalty","yes"):console.log("Clarity is not initialized")}var z,C,A,D,H,K,N;vkBridge.send("VKWebAppInit"),document.getElementById("formBlock").addEventListener("submit",(function(e){e.preventDefault(),vkBridge.send("VKWebAppAllowMessagesFromGroup",{group_id:r,key:"cc964fabb0e1d70924a92e4e8b513dbff7cc10a9"}).then(e=>{e.result?vkBridge.send("VKWebAppGetUserInfo").then(e=>{L=e.id,setTimeout(R,1e3)}).catch(e=>{U()}):U()}).catch(e=>{U()})})),d&&(z=window,C=document,D="script",H=p,z[A="clarity"]=z[A]||function(){(z[A].q=z[A].q||[]).push(arguments)},(K=C.createElement(D)).async=1,K.src="https://www.clarity.ms/tag/"+H,(N=C.getElementsByTagName(D)[0]).parentNode.insertBefore(K,N),function(e,t,n){window.clarity?window.clarity("identify",e,t,n):console.log("Clarity is not initialized")}(O,u,m),function(e,t,n,o,a,r){window.clarity?(window.clarity("set","utm_source",e),window.clarity("set","utm_medium",t),window.clarity("set","utm_campaign",n),window.clarity("set","utm_content",o),window.clarity("set","utm_term",a),window.clarity("set","funnel",r)):console.log("Clarity is not initialized")}(P,b,B,v,E,y)),$(document).ready((function(){$("#linkThank").on("click",(function(e){if(e.preventDefault(),c){let e=new URL($(this).attr("href"));e.searchParams.append("ups",_),e.searchParams.append("name",f),e.searchParams.append("email",g),e.searchParams.append("phone",h),e.searchParams.append("uid",L),e.searchParams.append("gcpc",k),e.searchParams.append("utm_source",P),e.searchParams.append("utm_medium",b),e.searchParams.append("utm_campaign",B),e.searchParams.append("utm_content",v),e.searchParams.append("utm_term",E),window.open(e.toString(),"_blank")}else window.open($(this).attr("href"),"_blank")})),function(){const e=new URLSearchParams;e.append("vk_user_id",T),e.append("vk_group_id",s),e.append("sub_id",i),fetch(o,{method:"POST",body:e}).then(e=>{if(!e.ok)throw new Error("Ошибка HTTP: "+e.status);return e.json()}).then(e=>{e&&"1"===e.status?(document.getElementById("formBlock").style.display="none",document.getElementById("thankBlock").style.display="block",document.getElementById("stopBlock").style.display="block",console.log("Есть подписка")):(document.getElementById("formBlock").style.display="block",console.log("Нет подписки"))}).catch(e=>{console.error("Error:",e)})}(),$("#linkStopBlock").on("click",(function(e){e.preventDefault(),function(){const e=new URLSearchParams;e.append("vk_user_id",T),e.append("vk_group_id",s),e.append("sub_id",i),fetch(a,{method:"POST",body:e}).then(e=>{if(!e.ok)throw new Error("Ошибка HTTP: "+e.status);return e.json()}).then(e=>{console.log("Ответ от сервера:",e),e&&"success"===e.status?(document.getElementById("formBlock").style.display="block",document.getElementById("stopBlock").style.display="none",document.getElementById("thankBlock").style.display="none",console.log("Подписка отменена")):console.log("Ошибка или подписка не отменена")}).catch(e=>{console.error("Error:",e)})}()}))}))}]);