PageSourceSearch

https://ktool.io/js/script.js

js ktool.io collected 2026-09-24 10:11:04 UTC 15,376 bytes, 1 lines download raw bytes

1!function(){"use strict";const t=document.currentScript,e="data-",n=t.getAttribute.bind(t),o="https://datafa.st/api/events";function a(t){if(!t)return!1;const e=t.toLowerCase();return!!["localhost","127.0.0.1","::1"].includes(e)||(!!/^127(\.[0-9]+){0,3}$/.test(e)||(!!/^(\[)?::1?\]?$/.test(e)||!(!e.endsWith(".local")&&!e.endsWith(".localhost"))))}function r(){try{if(!0===window.navigator.webdriver||window.callPhantom||window._phantom||window.__nightmare)return!0;if(!window.navigator||!window.location||!window.document||"object"!=typeof window.navigator||"object"!=typeof window.location||"object"!=typeof window.document)return!0;const t=window.navigator;if(!t.userAgent||""===t.userAgent||"undefined"===t.userAgent||t.userAgent.length<5)return!0;const e=t.userAgent.toLowerCase();if(e.includes("headlesschrome")||e.includes("phantomjs")||e.includes("selenium")||e.includes("webdriver")||e.includes("puppeteer")||e.includes("playwright"))return!0;const n=["__webdriver_evaluate","__selenium_evaluate","__webdriver_script_function","__webdriver_unwrapped","__fxdriver_evaluate","__driver_evaluate","_Selenium_IDE_Recorder","_selenium","calledSelenium","$cdc_asdjflasutopfhvcZLmcfl_"];for(const t of n)if(void 0!==window[t])return!0;if(document.documentElement&&(document.documentElement.getAttribute("webdriver")||document.documentElement.getAttribute("selenium")||document.documentElement.getAttribute("driver")))return!0;if(e.includes("python")||e.includes("curl")||e.includes("wget")||e.includes("java/")||e.includes("go-http")||e.includes("node.js")||e.includes("axios")||e.includes("postman"))return!0}catch(t){return!1}return!1}function i(t,e,n){let o="";if(n){const t=new Date;t.setTime(t.getTime()+24*n*60*60*1e3),o="; expires="+t.toUTCString()}let r=t+"="+(e||"")+o+"; path=/";if(!a(window.location.hostname)&&"file:"!==window.location.protocol){const t=window.location.hostname;r+=t===S||t.endsWith("."+S)?"; domain=."+S.replace(/^\./,""):"; domain=."+t.replace(/^\./,"")}document.cookie=r}function s(t){const e=t+"=",n=document.cookie.split(";");for(let t=0;t<n.length;t++){let o=n[t];for(;" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(e))return o.substring(e.length,o.length)}return null}function c(t){if(!t||"string"!=typeof t)return!1;const e=Date.parse(t);return!Number.isNaN(e)&&e>0}function l(t){const e=parseInt(t,10);return!Number.isFinite(e)||e<1?null:Math.min(e,1e6)}function d(){let t=function(){try{return new URL(window.location.href).searchParams.get("_df_vid")||null}catch{return null}}();return t?(i("datafast_visitor_id",t,365),t):(t=s("datafast_visitor_id"),t||(t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){const e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})),i("datafast_visitor_id",t,365),u()),t)}function u(){let t=function(){try{return new URL(window.location.href).searchParams.get("_df_vfs")||null}catch{return null}}();return c(t)?(i("datafast_visitor_first_seen_at",t,365),t):(t=s("datafast_visitor_first_seen_at"),c(t)||(t=(new Date).toISOString(),i("datafast_visitor_first_seen_at",t,365)),t)}function f(){const t=l(function(){try{return new URL(window.location.href).searchParams.get("_df_vsn")||null}catch{return null}}());if(t)return i("datafast_visitor_session_count",t,365),t;const e=l(s("datafast_visitor_session_count"));return e||(i("datafast_visitor_session_count",1,365),1)}function m(){let t=function(){try{return new URL(window.location.href).searchParams.get("_df_sid")||null}catch{return null}}();return t?(i("datafast_session_id",t,1/48),t):(t=s("datafast_session_id"),t?i("datafast_session_id",t,1/48):(t="sxxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){const e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})),i("datafast_session_id",t,1/48),function(){const t=l(s("datafast_visitor_session_count")),e=t?t+1:1;i("datafast_visitor_session_count",e,365)}()),t)}let w=[];window.datafast&&window.datafast.q&&Array.isArray(window.datafast.q)&&(w=window.datafast.q.map((t=>Array.from(t))));let g=!0,h="";g&&r()&&(g=!1,h="Tracking disabled - bot detected");const _="true"===n(e+"allow-file-protocol"),p="true"===n(e+"allow-localhost");g&&(a(window.location.hostname)&&!p||"file:"===window.location.protocol&&!_)&&(g=!1,h="file:"===window.location.protocol?"Tracking disabled on file protocol (use data-allow-file-protocol='true' to enable)":"Tracking disabled on localhost (use data-allow-localhost='true' to enable)");const v="true"===n(e+"debug"),y="true"===n(e+"disable-console"),b="true"===n(e+"disable-payments");g&&window!==window.parent&&!v&&(g=!1,h="Tracking disabled inside an iframe");const x=n(e+"website-id"),S=n(e+"domain"),P=n(e+"allowed-hostnames"),L=P?P.split(",").map((t=>
1t.trim())).filter(Boolean):[];function I(t,e,...n){if(y)return;const o="DataFast:";switch(t){case"info":default:console.log(o,e,...n);break;case"warn":console.warn(o,e,...n);break;case"error":console.error(o,e,...n)}}!g||x&&S||(g=!1,h="Missing website ID or domain");const k=n(e+"api-url");let E;if(k)try{new URL(k),E=k}catch(t){try{E=new URL(k,window.location.origin).href}catch(t){I("error",`Could not construct valid URL from data-api-url "${k}". Falling back to ${o}`),E=o}}else{const e=!t.src.includes("datafa.st");E=e?new URL("/api/events",window.location.origin).href:o}function A(){const t=window.location.href;if(!t)return void I("warn","Unable to collect href. This may indicate incorrect script implementation or browser issues.");const e=new URL(t),n={},o=e.searchParams.get("fbclid"),a=e.searchParams.get("gclid"),r=e.searchParams.get("gclsrc"),i=e.searchParams.get("wbraid"),s=e.searchParams.get("gbraid"),c=e.searchParams.get("li_fat_id"),l=e.searchParams.get("msclkid"),w=e.searchParams.get("ttclid"),g=e.searchParams.get("twclid");a&&(n.gclid=a),r&&(n.gclsrc=r),i&&(n.wbraid=i),s&&(n.gbraid=s),c&&(n.li_fat_id=c),o&&(n.fbclid=o),l&&(n.msclkid=l),w&&(n.ttclid=w),g&&(n.twclid=g);const h={websiteId:x,domain:S,href:t,referrer:document.referrer||null,viewport:{width:window.innerWidth,height:window.innerHeight},visitorId:d(),sessionId:m(),visitorFirstSeenAt:u(),visitorSessionNumber:f(),adClickIds:Object.keys(n).length>0?n:void 0,language:navigator.language||"",timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||"",screenWidth:screen.width||0,screenHeight:screen.height||0};return function(){try{const t=new URL(window.location.href);(t.searchParams.has("_df_vid")||t.searchParams.has("_df_sid")||t.searchParams.has("_df_vfs")||t.searchParams.has("_df_vsn"))&&(t.searchParams.delete("_df_vid"),t.searchParams.delete("_df_sid"),t.searchParams.delete("_df_vfs"),t.searchParams.delete("_df_vsn"),window.history.replaceState({},"",t.toString()))}catch{}}(),h}function T(t,e){return"true"===localStorage.getItem("datafast_ignore")?(I("info","Event ignored - tracking disabled via localStorage flag"),void(e&&e({status:200}))):r()?(I("info","Event ignored - bot detected"),void(e&&e({status:200}))):void function(t,e){const n=new XMLHttpRequest;n.open("POST",E,!0),n.setRequestHeader("Content-Type","application/json"),n.onreadystatechange=function(){if(n.readyState===XMLHttpRequest.DONE){if(200===n.status){I("info",`${t.type||"Event"} tracked successfully`);i("datafast_session_id",m(),1/48)}else I("error",`Failed to track ${t.type||"event"} - HTTP ${n.status}`);e&&e({status:n.status})}},n.send(JSON.stringify(t))}(t,e)}let N=0,R="";function M(t){if(!g)return I("info",`Pageview ignored - ${h}`),void(t&&t({status:200}));const e=Date.now(),n=window.location.href;if(n===R&&e-N<6e4)return I("info","Pageview ignored - throttled (same URL within 1 minute)"),void(t&&t({status:200}));N=e,R=n,function(t,e){try{sessionStorage.setItem("datafast_pageview_state",JSON.stringify({time:t,url:e}))}catch(t){}}(e,n);const o=A();o.type="pageview",T(o,t)}function U(t,e,n){if(!g)return I("info",`Payment event ignored - ${h}`),void(n&&n({status:200}));const o=A();o.type="payment","stripe"===t?o.extraData={stripe_session_id:e}:"lemonsqueezy"===t?o.extraData={lemonsqueezy_order_id:e}:"polar"===t&&(o.extraData={polar_checkout_id:e}),T(o,n)}function $(t,e,n){if(!g)return I("info",`Custom event '${t}' ignored - ${h}`),void(n&&n({status:200}));const o=A();o.type=t,o.extraData=e,T(o,n)}function D(t,e){if(g)if(t)if("payment"!==t||e?.email)if("identify"!==t||e?.user_id)if("payment"===t)$(t,{email:e.email});else if("identify"===t)!function(t,e,n){if(!g)return I("info",`Identify event ignored - ${h}`),void(n&&n({status:200}));const o=A();o.type="identify",o.extraData={user_id:t,name:e.name||"",image:e.image||"",...e},T(o,n)}(e.user_id,e);else{const n=O(e||{});if(null===n)return void I("error","Custom event rejected due to validation errors");$("custom",{eventName:t,...n})}else I("warn",`Missing user_id for ${t} event`);else I("warn",`Missing email for ${t} event`);else I("warn","Missing event_name for custom event");else I("info",`Event '${t}' ignored - ${h}`)}function O(t){if(!t||"object"!=typeof t||Array.isArray(t))return I("warn","customData must be a non-null object"),{};const e={};let n=0;function o(t){if(null==t)return"";let e=String(t);return e.length>255&&(e=e.substring(0,255)),e=e.replace(/[<>'"&]/g,"").replace(/javascript:/gi,"").replace(/on\w+=/gi,"").replace(/data:/gi,"").replace(/vbscript:/gi,"").trim(),e}for(const[r,i]of Object.entries(t)){if("eventName"===r){e[r]=o(i);continue}if(n>=10)return I("error","Maximum 10 custom parameters allowed"),null;if("string"!=typeof(a=r)||0===a.length||a.length>32||!/^[a-z0-9_-]+$/.test(a.toLowerCase()))return I("error",`Invalid property name "${r}". Use only lowercase letters, numbers, underscores, and hyphens. Max 32 characters.`),null;const t=r.toLowerCase(),s=o(i);e[t]=s,n++}var a;return e}if(window.datafast=D,window.datafast.q&&delete window.datafast.q,function(){for(;w.length>0;){const t=w.shift();if(Array.isArray(t)&&t.length>0)try{D.apply(null,t)}catch(e){I("error","Error processing queued call:",e,t)}}}(),!g)return void I("warn",h);function q(t){if(!t)return null;const e=t.replace(/^www\./,"").split(".");return e.length>=2?e.slice(-2).join("."):t}function j(t){if(t&&t.href)try{const n=new URL(t.href);if("http:"!==n.protocol&&"https:"!==n.protocol)return;const o=n.hostname,a=window.location.hostname;if(o===a)return;if(e=a,q(o)===q(e))return;!function(t){if(!t)return!1;if(t===S)return!0;for(const e of L)if(t===e)return!0;return!1}(o)?$("external_link",{url:t.href,text:t.textContent.trim()}):t.href=function(t){try{const e=new URL(t),n=d(),o=m(),a=u(),r=f();return e.searchParams.set("_df_vid",n),e.searchParams.set("_df_sid",o),e.searchParams.set("_df_vfs",a),e.searchParams.set("_df_vsn",r),e.toString()}catch{return t}}(t.href)}catch{}var e}function C(t){const e=t.getAttribute("data-fast-goal");if(e&&e.trim()){const n={eventName:e.trim()};for(const e of t.attributes)if(e.name.startsWith("data-fast-goal-")&&"data-fast-goal"!==e.name){const t=e.name.substring(15);
1if(t){n[t.replace(/-/g,"_")]=e.value}}const o=O(n);null!==o&&$("custom",o)}}!function(){try{const t=sessionStorage.getItem("datafast_pageview_state");if(t){const{time:e,url:n}=JSON.parse(t);N=e||0,R=n||""}}catch(t){N=0,R=""}}(),document.addEventListener("click",(function(t){const e=t.target.closest("[data-fast-goal]");e&&C(e);j(t.target.closest("a"))})),document.addEventListener("keydown",(function(t){if("Enter"===t.key||" "===t.key){const e=t.target.closest("[data-fast-goal]");e&&C(e);j(t.target.closest("a"))}}));const H=new WeakSet,W=new Map,F=new WeakMap;function z(t,e,n){const o=t.getAttribute("data-fast-scroll");if(!o||!o.trim())return;let a=F.get(t);if(a||(a={fired:!1,pendingTimeout:null},F.set(t,a)),!n)return null!==a.pendingTimeout&&(clearTimeout(a.pendingTimeout),a.pendingTimeout=null),void(a.fired=!1);if(a.fired||null!==a.pendingTimeout)return;const r=t.getAttribute("data-fast-scroll-delay");let i=0;if(null!==r){const t=parseInt(r,10);!isNaN(t)&&t>=0&&(i=t)}const s=()=>{a.pendingTimeout=null;const e=t.getBoundingClientRect();if(!(e.bottom>0&&e.top<window.innerHeight))return;a.fired=!0;const n=function(){const t=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight),e=window.innerHeight,n=window.pageYOffset||document.documentElement.scrollTop,o=t-e;return o<=0?100:Math.min(100,Math.round(n/o*100))}(),r=t.getAttribute("data-fast-scroll-threshold");let s=.5;if(null!==r){const t=parseFloat(r);!isNaN(t)&&t>=0&&t<=1&&(s=t)}const c={eventName:o.trim(),scroll_percentage:n.toString(),threshold:s.toString(),delay:i.toString()};for(const e of t.attributes)if(e.name.startsWith("data-fast-scroll-")&&"data-fast-scroll"!==e.name&&"data-fast-scroll-threshold"!==e.name&&"data-fast-scroll-delay"!==e.name){const t=e.name.substring(17);if(t){c[t.replace(/-/g,"_")]=e.value}}const l=O(c);null!==l&&$("custom",l)};i>0?a.pendingTimeout=setTimeout(s,i):s()}function J(t){window.IntersectionObserver&&t.forEach((function(t){if(H.has(t))return;const e=t.getAttribute("data-fast-scroll-threshold");let n=.5;if(null!==e){const t=parseFloat(e);!isNaN(t)&&t>=0&&t<=1?n=t:I("warn",`Invalid threshold value "${e}" for element. Using default 0.5.`)}const o=function(t){if(W.has(t))return W.get(t);const e=new IntersectionObserver((function(t){t.forEach((function(t){z(t.target,0,t.isIntersecting)}))}),{root:null,rootMargin:"0px",threshold:[0,t]});return W.set(t,e),e}(n);o.observe(t),H.add(t)}))}function B(){if(!window.IntersectionObserver)return void I("warn","Intersection Observer not supported, scroll tracking disabled");if(J(document.querySelectorAll("[data-fast-scroll]")),window.MutationObserver){new MutationObserver((function(t){let e=!1;if(t.forEach((function(t){("childList"===t.type&&t.addedNodes.length>0||"attributes"===t.type&&"data-fast-scroll"===t.attributeName)&&(e=!0)})),e){J(document.querySelectorAll("[data-fast-scroll]"))}})).observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-fast-scroll"]})}}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",B):B();let X=null;function Z(){M(),b||(function(){try{const t=new URL(window.location.href).searchParams.get("session_id");t&&t.startsWith("cs_")&&!sessionStorage.getItem("datafast_stripe_payment_sent_"+t)&&(U("stripe",t),sessionStorage.setItem("datafast_stripe_payment_sent_"+t,"1"))}catch(t){I("error","Error auto detecting Stripe session ID:",t)}}(),function(){try{const t=new URL(window.location.href).searchParams.get("checkout_id");t&&!sessionStorage.getItem("datafast_polar_payment_sent_"+t)&&(U("polar",t),sessionStorage.setItem("datafast_polar_payment_sent_"+t,"1"))}catch(t){I("error","Error auto detecting Polar checkout ID:",t)}}(),function(){try{const t=new URL(window.location.href).searchParams.get("order_id");t&&!sessionStorage.getItem("datafast_lemonsqueezy_payment_sent_"+t)&&(U("lemonsqueezy",t),sessionStorage.setItem("datafast_lemonsqueezy_payment_sent_"+t,"1"))}catch(t){I("error","Error auto detecting Lemonsqueezy order ID:",t)}}())}function Y(){X&&clearTimeout(X),X=setTimeout(Z,100)}Z();let G=window.location.pathname;const K=window.history.pushState;window.history.pushState=function(){K.apply(this,arguments),G!==window.location.pathname&&(G=window.location.pathname,Y())},window.addEventListener("popstate",(function(){G!==window.location.pathname&&(G=window.location.pathname,Y())}))}();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.