PageSourceSearch

https://docs.commercetools.com/_vercel/insights/script.js

js commercetools.com collected 2026-09-24 08:29:09 UTC 4,469 bytes, 1 lines download raw bytes

1"use strict";(()=>{var t=(t,e)=>()=>(t&&(e=t(t=0)),e),e=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);function n(t){let e=location.href;if(t){let n=new URL(e);if(n.pathname!==t)return n.pathname=t,n.search="",n.href}return e}function r(){return!!(navigator.webdriver||navigator.userAgent.includes("Headless"))}var a=t(()=>{});function i(t,e,n){let r=l(),a=p(t),i=r[t],o=r[a],u=i===e?{...o,...n}:n;if(i===e&&f(o,u))return!1;let{[a]:d,...c}=r;return s({...c,[t]:e,...Object.keys(u).length&&{[a]:u}}),!0}function o(){s({})}function u(){let{userId:t,groupId:e,traits:n,groupTraits:r}=l(),a={...n};for(let[i,o]of Object.entries(null!=r?r:{}))a[`group_${i}`]=o;return{...t&&{userId:t},...e&&{groupId:e},...Object.keys(a).length&&{props:a}}}function l(){if(v)return g;try{let t=localStorage.getItem(h);g=t?d(JSON.parse(t)):{}}catch(e){}return g}function s(t){g=t;try{t.userId||t.groupId?localStorage.setItem(h,JSON.stringify(t)):localStorage.removeItem(h),v=!1}catch(e){v=!0}}function d(t){return{..."string"==typeof t.userId&&{userId:t.userId,...c(t.traits)&&{traits:t.traits}},..."string"==typeof t.groupId&&{groupId:t.groupId,...c(t.groupTraits)&&{groupTraits:t.groupTraits}}}}function c(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function p(t){return"userId"===t?"traits":"groupTraits"}function f(t={},e={}){let n=Object.keys(t);return n.length===Object.keys(e).length&&n.every(n=>n in e&&t[n]===e[n])}var h,g,v,y=t(()=>{h="__va_attribution",g={},v=!1});e(()=>{a(),y(),function(){var t;let e="0.1.3",a=t=>t,l=document,s=l.currentScript;if(r())return;let d=null!=(t=null==s?void 0:s.dataset)?t:{},c=_(d,"view"),p=_(d,"event"),f=_(d,"session"),h=_(d,"identify"),g=_(d,"group"),v=null,y=null,w=!0;function _(t,e){return t[`${e}Endpoint`]||("endpoint"in t?`${t.endpoint}/${e}`:`${null!=s&&s.src.includes("/va/")?"/va":"/_vercel/insights"}/${e}`)}async function I(t){if(t&&!Array.isArray(t))return{p:t};let e=l.querySelectorAll("[data-flag-values]");if(!s||!e.length)return;let n=new URL(s.src),r=n.pathname.split("/"),a=r.pop();return a&&r.push("flags",a),n.pathname=r.join("/"),import(n.href).then(n=>n.gather(e,t))}async function m(t,e){try{await fetch(t,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(n){}}async function k({type:t,data:r,options:i}){var o;let s=n(y),f=l.referrer,h=a({type:t,url:s,payload:r});if(!1===h||null===h)return;h&&(s=h.url,r=null!=(o=h.payload)?o:r);let g=f.includes(location.host),w={o:s,sv:e,sdkn:d.sdkn,sdkv:d.sdkv,ts:Date.now(),...v&&{dp:v},...null!=i&&i.withReferrer&&!g?{r:f}:{},...u(),..."event"===t&&r&&{en:r.name,ed:r.data},f:await I(null==i?void 0:i.flags).catch(()=>{}),...(null==i?void 0:i.__cdp)!==void 0&&{__cdp:i.__cdp}};return m("pageview"===t?c:p,w)}async function b(t={}){return k({type:"pageview",options:{withReferrer:t.withReferrer,__cdp:t.__cdp}})}async function S(t,e,n){return k({type:"event",data:{name:t,data:e},options:{withReferrer:!0,flags:null==n?void 0:n.flags,__cdp:null==n?void 0:n.__cdp}})}async function R(t,r,o,l,s){var c,p;let f={type:"event",url:n(y),payload:{name:t,data:{...l,[r]:o}}},w=a(f);if(!1===w||null===w)return;let _=w||f,{[r]:I,...k}=null!=(p=null==(c=_.payload)?void 0:c.data)?p:{};if("string"!=typeof I||!I||!i(r,I,k))return;let b={...{o:_.url,sv:e,sdkn:d.sdkn,sdkv:d.sdkv,ts:Date.now(),...v&&{dp:v}},...u(),en:t,...Object.keys(k).length&&{ed:k},...void 0!==s&&{__cdp:s}};return m("identify"===t?h:g,b)}async function O(){await fetch(f,{method:"GET",keepalive:!0}).catch(()=>{})}function j(t){return t.pathname===new URL(A).pathname}function T(t){let e=t?"string"==typeof t?new URL(t,location.origin):new URL(t.href):null;!e||j(e)||e.hash&&j(e)||b()}let A=n(),L=()=>{var t;window.va=function(t,e){"beforeSend"===t?a=e:"event"===t?e&&S(e.name,e.data,{...e.options,__cdp:e.__cdp}):"pageview"===t?e&&(e.route&&(v=e.route),e.path&&(y=e.path),b({withReferrer:w,__cdp:e.__cdp}),w=!1):"identify"===t?null!=e&&e.userId&&R("identify","userId",e.userId,e.traits,e.__cdp):"group"===t?null!=e&&e.groupId&&R("group","groupId",e.groupId,e.traits,e.__cdp):"reset"!==t||o(),"enableCookie"===t&&O()},null==(t=window.vaq)||t.forEach(([t,e])=>{window.va(t,e)})};(()=>{if(window.vai||(window.vai=!0,L(),d.disableAutoTrack))return;b({withReferrer:!0});let t=history.pushState.bind(history);history.pushState=function(...e){t(...e);try{T(e[2]),A=n()}catch(r){}},window.addEventListener("popstate",function(){T(n()),A=n()})})()}()})()})();

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.