ibp-tms 1.0.72 → 1.0.73

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ibp-tms",
3
- "version": "1.0.72",
3
+ "version": "1.0.73",
4
4
  "description": "Style & JS optimized",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/tmsverify.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var o=e();for(var n in o)("object"==typeof exports?exports:t)[n]=o[n]}}(self,(()=>((()=>{let t=null,e=null,o=[];function n(){var t=document.body.getAttribute("r-id"),e=new FormData;e.append("id",i());try{fetch("/traffic/"+t,{method:"POST",body:e}).then((t=>{try{t.json().then((t=>{document.body.dispatchEvent(new CustomEvent("ag.tsm.valid",{detail:t}))}))}catch(t){}window.location.reload()})).catch((t=>{window.location.reload()}))}catch(t){window.location.reload()}}function d(){document.body.getAttribute("r-id");var t=new FormData;t.append("id",i());try{fetch("/traffic/report",{method:"POST",body:t}).then((t=>{try{t.json().then((t=>{window.location.reload()}))}catch(t){}})).catch((t=>{}))}catch(t){}}function a(){return null!=window.localStorage.getItem("TSM")?JSON.parse(window.localStorage.getItem("TSM")):null}function c(t){null==t||null==t?window.localStorage.removeItem("TSM"):window.localStorage.setItem("TSM",JSON.stringify(t))}function r(){try{if(null!=a()){var t=a();delete t.id,delete t.token,c(t||null)}}catch(t){}}function i(){var t=o.filter(((t,e)=>e<16)).reduce(((t,e,o)=>t+"|"+Math.round(e.dx+e.dy+e.dt+e.velocity)),"");return btoa(t)}function l(n,d){const a=Date.now();if(e&&t){const c=n-e.x,r=d-e.y,i=a-t,l=Math.sqrt(c*c+r*r)/i;o.push({dx:c,dy:r,dt:i,velocity:l})}e={x:n,y:d},t=a}window.onfocus=function(){null!=a()&&window.location.reload()};var u=a();null!=u&&u.id&&u.token&&"UN"!=u.token&&"NA"!=u.token&&function(t){var e=document.body.getAttribute("r-id"),o=a(),n=new FormData;if(n.append("id",i()),n.append("oldId",o.id),n.append("token",o.token),function(){var t=a();return t&&null!=t||(t={}),t.verifyUpdateCount?t.verifyUpdateCount++:t.verifyUpdateCount=1,c(t),t.verifyUpdateCount>2}())return c(null),void d();r();try{fetch("/traffic/"+e,{method:"POST",body:n}).then((e=>{try{e.json().then((t=>{document.body.dispatchEvent(new CustomEvent("ag.tsm.valid",{detail:t})),window.location.reload()})).catch((()=>{t(!0)}))}catch(e){t(!0)}})).catch((e=>{t(!0)}))}catch(e){t(!0)}}((()=>{})),function(t){t&&r(),document.addEventListener("mousemove",(t=>l(t.clientX,t.clientY))),document.addEventListener("touchstart",(t=>{const e=t.touches[0];l(e.clientX,e.clientY)})),document.addEventListener("touchend",(t=>{const e=t.touches[0];l(e.clientX,e.clientY)})),document.addEventListener("touchmove",(t=>{const e=t.touches[0];l(e.clientX,e.clientY)}));var e=0;("ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0)&&(e=0);var d=0,a=setInterval((()=>{if(d++,function(t){if(o.length<(t||20))return!1;let e=o.some(((t,e,o)=>e>0&&Math.abs(t.velocity-o[e-1].velocity)>.05)),n=o.some(((t,e,o)=>e>1&&(Math.abs(t.dx-o[e-1].dx)>.1||Math.abs(t.dy-o[e-1].dy)>.1))),d=o.some((t=>t.dt>50&&t.dt<500));return e&&n&&d}()&&window.location.href.indexOf(".html")<0&&(clearInterval(a),n()),d>e){clearInterval(a),document.body.classList.remove("auto");var t=document.querySelector("p"),c=t.getBoundingClientRect(),r=getComputedStyle(t),i=parseInt(r.paddingTop.replace(/[^0-9\.]/gi,"")),l=c.left+i,u=l+3.6*i,s=c.top+i,m=s+3.6*i;t.onclick=t=>{l<t.x&&t.x<u&&s<t.y&&t.y<m&&(document.body.classList.add("verified"),n())},t.ontouchend=t=>{var e=t.touches[0].pageX,o=t.touches[0].pageY;l-16<e&&e<u+16&&s-16<o&&o<m+16&&(document.body.classList.add("verified"),n())}}}),0==e?10:1e3)}(),document.addEventListener("DOMContentLoaded",(t=>{try{document.querySelector(".bot-issue label").addEventListener("click",(t=>{null!=a()&&c(null),t.target.remove(),d()}))}catch(t){}try{var e=window.getComputedStyle(document.body,":after").getPropertyValue("content");"string"==typeof e&&""!=e&&(document.body.classList+=" "+e.replace(/"/gi,""))}catch(t){}})),setTimeout((()=>{var t,e=document.createElement("header");e.className="mdl-layout__header item-h",e.style.opacity="0",document.body.prepend(e),t=window.getComputedStyle(e).getPropertyValue("background-color"),e.remove();var o=document.createElement("style");o.innerHTML=`\n .header {\n background: ${t};\n }\n body .bot-human p,body .bot-message p,body .bot-message h1,body h2.error,body.inverse footer h3 {\n color: inherit!important;\n }`,document.head.appendChild(o)}),10)})(),{})));
1
+ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var o=e();for(var n in o)("object"==typeof exports?exports:t)[n]=o[n]}}(self,(()=>((()=>{let t=null,e=null,o=[];function n(){var t=document.body.getAttribute("r-id"),e=new FormData;e.append("id",t);try{fetch("/traffic/"+t,{method:"POST",body:e}).then((t=>{try{t.json().then((t=>{document.body.dispatchEvent(new CustomEvent("ag.tsm.valid",{detail:t}))}))}catch(t){}window.location.reload()})).catch((t=>{window.location.reload()}))}catch(t){window.location.reload()}}function d(){document.body.getAttribute("r-id");var t=new FormData;t.append("id",i());try{fetch("/traffic/report",{method:"POST",body:t}).then((t=>{try{t.json().then((t=>{window.location.reload()}))}catch(t){}})).catch((t=>{}))}catch(t){}}function a(){return null!=window.localStorage.getItem("TSM")?JSON.parse(window.localStorage.getItem("TSM")):null}function c(t){null==t||null==t?window.localStorage.removeItem("TSM"):window.localStorage.setItem("TSM",JSON.stringify(t))}function r(){try{if(null!=a()){var t=a();delete t.id,delete t.token,c(t||null)}}catch(t){}}function i(){var t=o.filter(((t,e)=>e<16)).reduce(((t,e,o)=>t+"|"+Math.round(e.dx+e.dy+e.dt+e.velocity)),"");return btoa(t)}function l(n,d){const a=Date.now();if(e&&t){const c=n-e.x,r=d-e.y,i=a-t,l=Math.sqrt(c*c+r*r)/i;o.push({dx:c,dy:r,dt:i,velocity:l})}e={x:n,y:d},t=a}window.onfocus=function(){null!=a()&&window.location.reload()};var u=a();null!=u&&u.id&&u.token&&"UN"!=u.token&&"NA"!=u.token&&function(t){var e=document.body.getAttribute("r-id"),o=a(),n=new FormData;if(n.append("id",i()),n.append("oldId",o.id),n.append("token",o.token),function(){var t=a();return t&&null!=t||(t={}),t.verifyUpdateCount?t.verifyUpdateCount++:t.verifyUpdateCount=1,c(t),t.verifyUpdateCount>2}())return c(null),void d();r();try{fetch("/traffic/"+e,{method:"POST",body:n}).then((e=>{try{e.json().then((t=>{document.body.dispatchEvent(new CustomEvent("ag.tsm.valid",{detail:t})),window.location.reload()})).catch((()=>{t(!0)}))}catch(e){t(!0)}})).catch((e=>{t(!0)}))}catch(e){t(!0)}}((()=>{})),function(t){t&&r(),document.addEventListener("mousemove",(t=>l(t.clientX,t.clientY))),document.addEventListener("touchstart",(t=>{const e=t.touches[0];l(e.clientX,e.clientY)})),document.addEventListener("touchend",(t=>{const e=t.touches[0];l(e.clientX,e.clientY)})),document.addEventListener("touchmove",(t=>{const e=t.touches[0];l(e.clientX,e.clientY)}));var e=0;("ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0)&&(e=0);var d=0,a=setInterval((()=>{if(d++,function(t){if(o.length<(t||20))return!1;let e=o.some(((t,e,o)=>e>0&&Math.abs(t.velocity-o[e-1].velocity)>.05)),n=o.some(((t,e,o)=>e>1&&(Math.abs(t.dx-o[e-1].dx)>.1||Math.abs(t.dy-o[e-1].dy)>.1))),d=o.some((t=>t.dt>50&&t.dt<500));return e&&n&&d}()&&window.location.href.indexOf(".html")<0&&(clearInterval(a),n()),d>e){clearInterval(a),document.body.classList.remove("auto");var t=document.querySelector("p"),c=t.getBoundingClientRect(),r=getComputedStyle(t),i=parseInt(r.paddingTop.replace(/[^0-9\.]/gi,"")),l=c.left+i,u=l+3.6*i,s=c.top+i,m=s+3.6*i;t.onclick=t=>{l<t.x&&t.x<u&&s<t.y&&t.y<m&&(document.body.classList.add("verified"),n())},t.ontouchend=t=>{var e=t.touches[0].pageX,o=t.touches[0].pageY;l-16<e&&e<u+16&&s-16<o&&o<m+16&&(document.body.classList.add("verified"),n())}}}),0==e?10:1e3)}(),document.addEventListener("DOMContentLoaded",(t=>{try{document.querySelector(".bot-issue label").addEventListener("click",(t=>{null!=a()&&c(null),t.target.remove(),d()}))}catch(t){}try{var e=window.getComputedStyle(document.body,":after").getPropertyValue("content");"string"==typeof e&&""!=e&&(document.body.classList+=" "+e.replace(/"/gi,""))}catch(t){}})),setTimeout((()=>{var t,e=document.createElement("header");e.className="mdl-layout__header item-h",e.style.opacity="0",document.body.prepend(e),t=window.getComputedStyle(e).getPropertyValue("background-color"),e.remove();var o=document.createElement("style");o.innerHTML=`\n .header {\n background: ${t};\n }\n body .bot-human p,body .bot-message p,body .bot-message h1,body h2.error,body.inverse footer h3 {\n color: inherit!important;\n }`,document.head.appendChild(o)}),10)})(),{})));
package/tmsverify.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tmsverify.js","mappings":"CAAA,SAA2CA,EAAMC,GAChD,GAAsB,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,SACb,GAAqB,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,OACP,CACJ,IAAIK,EAAIL,IACR,IAAI,IAAIM,KAAKD,GAAuB,iBAAZJ,QAAuBA,QAAUF,GAAMO,GAAKD,EAAEC,EACvE,CACA,CATD,CASGC,MAAM,KCTT,MACI,IAAIC,EAAW,KACXC,EAAU,KACVC,EAAY,GAEhB,SAASC,IACL,IAAIC,EAAMC,SAASC,KAAKC,aAAa,QACjCC,EAAO,IAAIC,SACfD,EAAKE,OAAO,KAAMC,KAClB,IAC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GAAG,KAIdoG,YAAW,KACP,IAAIC,EACAC,EAAgBtH,SAASuH,cAAc,UAC3CD,EAAcE,UAAY,4BAC1BF,EAAcG,MAAMC,QAAU,IAC9B1H,SAASC,KAAK0H,QAAQL,GACtBD,EAAcpG,OAAO8E,iBAAiBuB,GAAeH,iBAAiB,oBACtEG,EAAc7B,SACd,IAAImC,EAAc5H,SAASuH,cAAc,SACzCK,EAAYC,UAAY,gDAENR,6KAKlBrH,SAAS8H,KAAKC,YAAYH,EAAY,GACxC,GAEL,EA7PD,G","sources":["webpack:///webpack/universalModuleDefinition","webpack:///./src/tmsverify.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse {\n\t\tvar a = factory();\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(self, () => {\nreturn ","(() => {\r\n let lastTime = null;\r\n let lastPos = null;\r\n let movements = [];\r\n\r\n function verify() {\r\n var rid = document.body.getAttribute('r-id');\r\n var data = new FormData();\r\n data.append(\"id\", getSignature());\r\n try {\r\n fetch('/traffic/' + rid, {\r\n method: 'POST',\r\n body: data\r\n }).then(response => {\r\n try {\r\n response.json().then((responseData) => { \r\n document.body.dispatchEvent(new CustomEvent('ag.tsm.valid', { detail: responseData }));\r\n });\r\n } catch (e) {}\r\n window.location.reload();\r\n }).catch(e => { window.location.reload(); })\r\n } catch (error) {\r\n window.location.reload();\r\n }\r\n }\r\n\r\n function report() {\r\n var rid = document.body.getAttribute('r-id');\r\n var data = new FormData();\r\n data.append(\"id\", getSignature());\r\n try {\r\n fetch('/traffic/report', {\r\n method: 'POST',\r\n body: data\r\n }).then(response => {\r\n try {\r\n response.json().then((responseData) => { \r\n window.location.reload();\r\n });\r\n } catch (e) {} \r\n }).catch(e => { })\r\n } catch (error) {\r\n \r\n }\r\n }\r\n\r\n function getCurrentValue() {\r\n if (window.localStorage.getItem('TSM') != null) return JSON.parse(window.localStorage.getItem('TSM'));\r\n return null;\r\n }\r\n\r\n function setCurrentValue(tsmValue){\r\n if(tsmValue==undefined || tsmValue==null)\r\n window.localStorage.removeItem('TSM');\r\n else\r\n window.localStorage.setItem('TSM', JSON.stringify(tsmValue));\r\n }\r\n\r\n function resetTSMValidation() {\r\n try{\r\n if (getCurrentValue() != null) {\r\n var valueToReset = getCurrentValue();\r\n delete valueToReset.id;\r\n delete valueToReset.token;\r\n if (valueToReset)\r\n setCurrentValue(valueToReset);\r\n else\r\n setCurrentValue(null);\r\n }\r\n }catch(e){}\r\n }\r\n\r\n \r\n\r\n function verifyUpdate(engageValidation) {\r\n var rid = document.body.getAttribute('r-id');\r\n var currentValue = getCurrentValue();\r\n var data = new FormData();\r\n data.append(\"id\", getSignature());\r\n data.append(\"oldId\", currentValue.id);\r\n data.append(\"token\", currentValue.token);\r\n if(!incrementVerifyUpdateCount()){\r\n resetTSMValidation();\r\n }\r\n else{\r\n setCurrentValue(null);\r\n report();\r\n return; \r\n }\r\n try {\r\n fetch('/traffic/' + rid, {\r\n method: 'POST',\r\n body: data\r\n }).then(response => {\r\n try {\r\n response.json().then((responseData) => { \r\n document.body.dispatchEvent(new CustomEvent('ag.tsm.valid', { detail: responseData }));\r\n window.location.reload();\r\n }).catch(()=>{\r\n engageValidation(true);\r\n });\r\n } catch (e) { engageValidation(true); } \r\n }).catch(e => { engageValidation(true); })\r\n } catch (error) {\r\n engageValidation(true);\r\n }\r\n }\r\n\r\n function getSignature() {\r\n\r\n var singnatureSamples = movements.filter((x, i) => { return i < 16 });\r\n var signatureValue = singnatureSamples.reduce((x, y, i) => {\r\n return x + '|' + Math.round(y.dx + y.dy + y.dt + y.velocity);\r\n }, '');\r\n return btoa(signatureValue);\r\n }\r\n\r\n function incrementVerifyUpdateCount(){\r\n var currentValue = getCurrentValue();\r\n if(!currentValue||currentValue==null)\r\n currentValue={};\r\n if(currentValue.verifyUpdateCount) currentValue.verifyUpdateCount++;\r\n else currentValue.verifyUpdateCount=1;\r\n setCurrentValue(currentValue); \r\n if(currentValue.verifyUpdateCount>2)return true;\r\n return false; \r\n }\r\n\r\n function recordMovement(x, y) {\r\n const now = Date.now();\r\n if (lastPos && lastTime) {\r\n const dx = x - lastPos.x;\r\n const dy = y - lastPos.y;\r\n const dt = now - lastTime;\r\n const distance = Math.sqrt(dx * dx + dy * dy);\r\n const velocity = distance / dt;\r\n movements.push({ dx, dy, dt, velocity });\r\n }\r\n lastPos = { x, y };\r\n lastTime = now;\r\n }\r\n\r\n function listen(isReset) {\r\n\r\n if(isReset)\r\n resetTSMValidation();\r\n document.addEventListener(\"mousemove\", e => recordMovement(e.clientX, e.clientY));\r\n\r\n document.addEventListener(\"touchstart\", e => {\r\n const t = e.touches[0];\r\n recordMovement(t.clientX, t.clientY);\r\n });\r\n\r\n document.addEventListener(\"touchend\", e => {\r\n const t = e.touches[0];\r\n recordMovement(t.clientX, t.clientY);\r\n });\r\n\r\n document.addEventListener(\"touchmove\", e => {\r\n const t = e.touches[0];\r\n recordMovement(t.clientX, t.clientY);\r\n }); \r\n\r\n function isHuman(limit) {\r\n if (movements.length < (limit ? limit : 20)) return false;\r\n let varying = movements.some((m, i, arr) => i > 0 && (Math.abs(m.velocity - arr[i - 1].velocity) > 0.05));\r\n let nonLinear = movements.some((m, i, arr) => i > 1 && (Math.abs(m.dx - arr[i - 1].dx) > 0.1 || Math.abs(m.dy - arr[i - 1].dy) > 0.1));\r\n let irregular = movements.some(m => m.dt > 50 && m.dt < 500);\r\n return varying && nonLinear && irregular;\r\n }\r\n var checkMaxCount = 0;\r\n var haveTouch = 'ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;\r\n if (haveTouch) checkMaxCount = 0;\r\n var checkCount = 0;\r\n var valuation = setInterval(() => {\r\n checkCount++;\r\n if (isHuman() && window.location.href.indexOf('.html') < 0) {\r\n clearInterval(valuation);\r\n verify();\r\n }\r\n if (checkCount > checkMaxCount) {\r\n clearInterval(valuation);\r\n document.body.classList.remove('auto');\r\n var actionButton = document.querySelector('p');\r\n var actionButtonBounds = actionButton.getBoundingClientRect();\r\n var actionButtonComputedStyle = getComputedStyle(actionButton);\r\n var actionButtonOffset = parseInt(actionButtonComputedStyle.paddingTop.replace(/[^0-9\\.]/gi, ''));\r\n var actionLeft = actionButtonBounds.left + actionButtonOffset;\r\n var actionRight = actionLeft + actionButtonOffset * 3.6;\r\n var actionTop = actionButtonBounds.top + actionButtonOffset;\r\n var actionBottom = actionTop + actionButtonOffset * 3.6;\r\n actionButton.onclick = (e) => {\r\n if (actionLeft < e.x && e.x < actionRight && actionTop < e.y && e.y < actionBottom) {\r\n document.body.classList.add('verified');\r\n verify();\r\n }\r\n };\r\n actionButton.ontouchend = (e) => {\r\n var x = e.touches[0].pageX;\r\n var y = e.touches[0].pageY;\r\n var offsetValue = 16; // touch offset\r\n if (actionLeft - offsetValue < x && x < actionRight + offsetValue && actionTop - offsetValue < y && y < actionBottom + offsetValue) {\r\n document.body.classList.add('verified');\r\n verify();\r\n }\r\n };\r\n }\r\n }, checkMaxCount==0?10:1000);\r\n }\r\n window.onfocus = function () {\r\n if (getCurrentValue() != null) window.location.reload();\r\n }; \r\n var currentValueInit = getCurrentValue();\r\n if (currentValueInit != null && currentValueInit.id && currentValueInit.token && currentValueInit.token!='UN' && currentValueInit.token!='NA') {\r\n verifyUpdate(()=>{});\r\n }\r\n\r\n listen();\r\n document.addEventListener('DOMContentLoaded', (event) => {\r\n try {\r\n document.querySelector('.bot-issue label').addEventListener('click', (e) => { \r\n if (getCurrentValue() != null) setCurrentValue(null);\r\n e.target.remove();\r\n report(); \r\n });\r\n } catch (e) {}\r\n try{\r\n var bodyClass = window.getComputedStyle(document.body, ':after').getPropertyValue('content');\r\n if (typeof (bodyClass) == 'string' && bodyClass != '')\r\n document.body.classList += ' ' + bodyClass.replace(/\"/gi, ''); \r\n }catch(e){}\r\n });\r\n \r\n\r\n setTimeout(() => {\r\n var headerColor = '#fff';\r\n var headerElement = document.createElement('header');\r\n headerElement.className = 'mdl-layout__header item-h';\r\n headerElement.style.opacity = '0';\r\n document.body.prepend(headerElement);\r\n headerColor = window.getComputedStyle(headerElement).getPropertyValue('background-color');\r\n headerElement.remove();\r\n var customStyle = document.createElement('style');\r\n customStyle.innerHTML = `\r\n .header {\r\n background: ${headerColor};\r\n }\r\n body .bot-human p,body .bot-message p,body .bot-message h1,body h2.error,body.inverse footer h3 {\r\n color: inherit!important;\r\n }`;\r\n document.head.appendChild(customStyle);\r\n },10);\r\n\r\n})();"],"names":["root","factory","exports","module","define","amd","a","i","self","lastTime","lastPos","movements","verify","rid","document","body","getAttribute","data","FormData","append","getSignature","fetch","method","then","response","json","responseData","dispatchEvent","CustomEvent","detail","e","window","location","reload","catch","error","report","getCurrentValue","localStorage","getItem","JSON","parse","setCurrentValue","tsmValue","undefined","removeItem","setItem","stringify","resetTSMValidation","valueToReset","id","token","signatureValue","filter","x","reduce","y","Math","round","dx","dy","dt","velocity","btoa","recordMovement","now","Date","sqrt","push","onfocus","currentValueInit","engageValidation","currentValue","verifyUpdateCount","incrementVerifyUpdateCount","verifyUpdate","isReset","addEventListener","clientX","clientY","t","touches","checkMaxCount","navigator","maxTouchPoints","msMaxTouchPoints","checkCount","valuation","setInterval","limit","length","varying","some","m","arr","abs","nonLinear","irregular","isHuman","href","indexOf","clearInterval","classList","remove","actionButton","querySelector","actionButtonBounds","getBoundingClientRect","actionButtonComputedStyle","getComputedStyle","actionButtonOffset","parseInt","paddingTop","replace","actionLeft","left","actionRight","actionTop","top","actionBottom","onclick","add","ontouchend","pageX","pageY","listen","event","target","bodyClass","getPropertyValue","setTimeout","headerColor","headerElement","createElement","className","style","opacity","prepend","customStyle","innerHTML","head","appendChild"],"sourceRoot":""}
1
+ {"version":3,"file":"tmsverify.js","mappings":"CAAA,SAA2CA,EAAMC,GAChD,GAAsB,iBAAZC,SAA0C,iBAAXC,OACxCA,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/G,SAAS+D,iBAAiB,oBAAqBiD,IAC3C,IACIhH,SAAS2F,cAAc,oBAAoB5B,iBAAiB,SAAUhD,IACzC,MAArBQ,KAA2BK,EAAgB,MAC/Cb,EAAEkG,OAAOxB,SACTpE,GAAQ,GAEhB,CAAE,MAAON,GAAI,CACb,IACI,IAAImG,EAAYlG,OAAO+E,iBAAiB/F,SAASC,KAAM,UAAUkH,iBAAiB,WACxD,iBAAf,GAAwC,IAAbD,IAClClH,SAASC,KAAKuF,WAAa,IAAM0B,EAAUf,QAAQ,MAAO,IAClE,CAAC,MAAMpF,GAAG,KAIdqG,YAAW,KACP,IAAIC,EACAC,EAAgBtH,SAASuH,cAAc,UAC3CD,EAAcE,UAAY,4BAC1BF,EAAcG,MAAMC,QAAU,IAC9B1H,SAASC,KAAK0H,QAAQL,GACtBD,EAAcrG,OAAO+E,iBAAiBuB,GAAeH,iBAAiB,oBACtEG,EAAc7B,SACd,IAAImC,EAAc5H,SAASuH,cAAc,SACzCK,EAAYC,UAAY,gDAENR,6KAKlBrH,SAAS8H,KAAKC,YAAYH,EAAY,GACxC,GAEL,EA9PD,G","sources":["webpack:///webpack/universalModuleDefinition","webpack:///./src/tmsverify.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse {\n\t\tvar a = factory();\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(self, () => {\nreturn ","(() => {\r\n let lastTime = null;\r\n let lastPos = null;\r\n let movements = [];\r\n\r\n function verify() {\r\n var rid = document.body.getAttribute('r-id');\r\n var data = new FormData();\r\n //data.append(\"id\", getSignature());\r\n data.append(\"id\", rid);\r\n try {\r\n fetch('/traffic/' + rid, {\r\n method: 'POST',\r\n body: data\r\n }).then(response => {\r\n try {\r\n response.json().then((responseData) => { \r\n document.body.dispatchEvent(new CustomEvent('ag.tsm.valid', { detail: responseData }));\r\n });\r\n } catch (e) {}\r\n window.location.reload();\r\n }).catch(e => { window.location.reload(); })\r\n } catch (error) {\r\n window.location.reload();\r\n }\r\n }\r\n\r\n function report() {\r\n var rid = document.body.getAttribute('r-id');\r\n var data = new FormData();\r\n data.append(\"id\", getSignature());\r\n try {\r\n fetch('/traffic/report', {\r\n method: 'POST',\r\n body: data\r\n }).then(response => {\r\n try {\r\n response.json().then((responseData) => { \r\n window.location.reload();\r\n });\r\n } catch (e) {} \r\n }).catch(e => { })\r\n } catch (error) {\r\n \r\n }\r\n }\r\n\r\n function getCurrentValue() {\r\n if (window.localStorage.getItem('TSM') != null) return JSON.parse(window.localStorage.getItem('TSM'));\r\n return null;\r\n }\r\n\r\n function setCurrentValue(tsmValue){\r\n if(tsmValue==undefined || tsmValue==null)\r\n window.localStorage.removeItem('TSM');\r\n else\r\n window.localStorage.setItem('TSM', JSON.stringify(tsmValue));\r\n }\r\n\r\n function resetTSMValidation() {\r\n try{\r\n if (getCurrentValue() != null) {\r\n var valueToReset = getCurrentValue();\r\n delete valueToReset.id;\r\n delete valueToReset.token;\r\n if (valueToReset)\r\n setCurrentValue(valueToReset);\r\n else\r\n setCurrentValue(null);\r\n }\r\n }catch(e){}\r\n }\r\n\r\n \r\n\r\n function verifyUpdate(engageValidation) {\r\n var rid = document.body.getAttribute('r-id');\r\n var currentValue = getCurrentValue();\r\n var data = new FormData();\r\n data.append(\"id\", getSignature());\r\n data.append(\"oldId\", currentValue.id);\r\n data.append(\"token\", currentValue.token);\r\n if(!incrementVerifyUpdateCount()){\r\n resetTSMValidation();\r\n }\r\n else{\r\n setCurrentValue(null);\r\n report();\r\n return; \r\n }\r\n try {\r\n fetch('/traffic/' + rid, {\r\n method: 'POST',\r\n body: data\r\n }).then(response => {\r\n try {\r\n response.json().then((responseData) => { \r\n document.body.dispatchEvent(new CustomEvent('ag.tsm.valid', { detail: responseData }));\r\n window.location.reload();\r\n }).catch(()=>{\r\n engageValidation(true);\r\n });\r\n } catch (e) { engageValidation(true); } \r\n }).catch(e => { engageValidation(true); })\r\n } catch (error) {\r\n engageValidation(true);\r\n }\r\n }\r\n\r\n function getSignature() {\r\n\r\n var singnatureSamples = movements.filter((x, i) => { return i < 16 });\r\n var signatureValue = singnatureSamples.reduce((x, y, i) => {\r\n return x + '|' + Math.round(y.dx + y.dy + y.dt + y.velocity);\r\n }, '');\r\n return btoa(signatureValue);\r\n }\r\n\r\n function incrementVerifyUpdateCount(){\r\n var currentValue = getCurrentValue();\r\n if(!currentValue||currentValue==null)\r\n currentValue={};\r\n if(currentValue.verifyUpdateCount) currentValue.verifyUpdateCount++;\r\n else currentValue.verifyUpdateCount=1;\r\n setCurrentValue(currentValue); \r\n if(currentValue.verifyUpdateCount>2)return true;\r\n return false; \r\n }\r\n\r\n function recordMovement(x, y) {\r\n const now = Date.now();\r\n if (lastPos && lastTime) {\r\n const dx = x - lastPos.x;\r\n const dy = y - lastPos.y;\r\n const dt = now - lastTime;\r\n const distance = Math.sqrt(dx * dx + dy * dy);\r\n const velocity = distance / dt;\r\n movements.push({ dx, dy, dt, velocity });\r\n }\r\n lastPos = { x, y };\r\n lastTime = now;\r\n }\r\n\r\n function listen(isReset) {\r\n\r\n if(isReset)\r\n resetTSMValidation();\r\n document.addEventListener(\"mousemove\", e => recordMovement(e.clientX, e.clientY));\r\n\r\n document.addEventListener(\"touchstart\", e => {\r\n const t = e.touches[0];\r\n recordMovement(t.clientX, t.clientY);\r\n });\r\n\r\n document.addEventListener(\"touchend\", e => {\r\n const t = e.touches[0];\r\n recordMovement(t.clientX, t.clientY);\r\n });\r\n\r\n document.addEventListener(\"touchmove\", e => {\r\n const t = e.touches[0];\r\n recordMovement(t.clientX, t.clientY);\r\n }); \r\n\r\n function isHuman(limit) {\r\n if (movements.length < (limit ? limit : 20)) return false;\r\n let varying = movements.some((m, i, arr) => i > 0 && (Math.abs(m.velocity - arr[i - 1].velocity) > 0.05));\r\n let nonLinear = movements.some((m, i, arr) => i > 1 && (Math.abs(m.dx - arr[i - 1].dx) > 0.1 || Math.abs(m.dy - arr[i - 1].dy) > 0.1));\r\n let irregular = movements.some(m => m.dt > 50 && m.dt < 500);\r\n return varying && nonLinear && irregular;\r\n }\r\n var checkMaxCount = 0;\r\n var haveTouch = 'ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;\r\n if (haveTouch) checkMaxCount = 0;\r\n var checkCount = 0;\r\n var valuation = setInterval(() => {\r\n checkCount++;\r\n if (isHuman() && window.location.href.indexOf('.html') < 0) {\r\n clearInterval(valuation);\r\n verify();\r\n }\r\n if (checkCount > checkMaxCount) {\r\n clearInterval(valuation);\r\n document.body.classList.remove('auto');\r\n var actionButton = document.querySelector('p');\r\n var actionButtonBounds = actionButton.getBoundingClientRect();\r\n var actionButtonComputedStyle = getComputedStyle(actionButton);\r\n var actionButtonOffset = parseInt(actionButtonComputedStyle.paddingTop.replace(/[^0-9\\.]/gi, ''));\r\n var actionLeft = actionButtonBounds.left + actionButtonOffset;\r\n var actionRight = actionLeft + actionButtonOffset * 3.6;\r\n var actionTop = actionButtonBounds.top + actionButtonOffset;\r\n var actionBottom = actionTop + actionButtonOffset * 3.6;\r\n actionButton.onclick = (e) => {\r\n if (actionLeft < e.x && e.x < actionRight && actionTop < e.y && e.y < actionBottom) {\r\n document.body.classList.add('verified');\r\n verify();\r\n }\r\n };\r\n actionButton.ontouchend = (e) => {\r\n var x = e.touches[0].pageX;\r\n var y = e.touches[0].pageY;\r\n var offsetValue = 16; // touch offset\r\n if (actionLeft - offsetValue < x && x < actionRight + offsetValue && actionTop - offsetValue < y && y < actionBottom + offsetValue) {\r\n document.body.classList.add('verified');\r\n verify();\r\n }\r\n };\r\n }\r\n }, checkMaxCount==0?10:1000);\r\n }\r\n window.onfocus = function () {\r\n if (getCurrentValue() != null) window.location.reload();\r\n }; \r\n var currentValueInit = getCurrentValue();\r\n if (currentValueInit != null && currentValueInit.id && currentValueInit.token && currentValueInit.token!='UN' && currentValueInit.token!='NA') {\r\n verifyUpdate(()=>{});\r\n }\r\n\r\n listen();\r\n document.addEventListener('DOMContentLoaded', (event) => {\r\n try {\r\n document.querySelector('.bot-issue label').addEventListener('click', (e) => { \r\n if (getCurrentValue() != null) setCurrentValue(null);\r\n e.target.remove();\r\n report(); \r\n });\r\n } catch (e) {}\r\n try{\r\n var bodyClass = window.getComputedStyle(document.body, ':after').getPropertyValue('content');\r\n if (typeof (bodyClass) == 'string' && bodyClass != '')\r\n document.body.classList += ' ' + bodyClass.replace(/\"/gi, ''); \r\n }catch(e){}\r\n });\r\n \r\n\r\n setTimeout(() => {\r\n var headerColor = '#fff';\r\n var headerElement = document.createElement('header');\r\n headerElement.className = 'mdl-layout__header item-h';\r\n headerElement.style.opacity = '0';\r\n document.body.prepend(headerElement);\r\n headerColor = window.getComputedStyle(headerElement).getPropertyValue('background-color');\r\n headerElement.remove();\r\n var customStyle = document.createElement('style');\r\n customStyle.innerHTML = `\r\n .header {\r\n background: ${headerColor};\r\n }\r\n body .bot-human p,body .bot-message p,body .bot-message h1,body h2.error,body.inverse footer h3 {\r\n color: inherit!important;\r\n }`;\r\n document.head.appendChild(customStyle);\r\n },10);\r\n\r\n})();"],"names":["root","factory","exports","module","define","amd","a","i","self","lastTime","lastPos","movements","verify","rid","document","body","getAttribute","data","FormData","append","fetch","method","then","response","json","responseData","dispatchEvent","CustomEvent","detail","e","window","location","reload","catch","error","report","getSignature","getCurrentValue","localStorage","getItem","JSON","parse","setCurrentValue","tsmValue","undefined","removeItem","setItem","stringify","resetTSMValidation","valueToReset","id","token","signatureValue","filter","x","reduce","y","Math","round","dx","dy","dt","velocity","btoa","recordMovement","now","Date","sqrt","push","onfocus","currentValueInit","engageValidation","currentValue","verifyUpdateCount","incrementVerifyUpdateCount","verifyUpdate","isReset","addEventListener","clientX","clientY","t","touches","checkMaxCount","navigator","maxTouchPoints","msMaxTouchPoints","checkCount","valuation","setInterval","limit","length","varying","some","m","arr","abs","nonLinear","irregular","isHuman","href","indexOf","clearInterval","classList","remove","actionButton","querySelector","actionButtonBounds","getBoundingClientRect","actionButtonComputedStyle","getComputedStyle","actionButtonOffset","parseInt","paddingTop","replace","actionLeft","left","actionRight","actionTop","top","actionBottom","onclick","add","ontouchend","pageX","pageY","listen","event","target","bodyClass","getPropertyValue","setTimeout","headerColor","headerElement","createElement","className","style","opacity","prepend","customStyle","innerHTML","head","appendChild"],"sourceRoot":""}