PageSourceSearch

https://www.promptfoo.dev/js/scripts.js

js promptfoo.dev collected 2026-09-24 17:58:13 UTC 4,363 bytes, 132 lines download raw bytes

1// Define gtag stub if not already defined (prevents errors in development)
2window.dataLayer = window.dataLayer || [];
3window.gtag =
4  window.gtag ||
5  function () {
6    window.dataLayer.push(arguments);
7  };
8
9// Configure GA (gtag.js is loaded by consent.js before this script)
10gtag('js', new Date());
11gtag('config', 'G-3TS8QLZQ93', { anonymize_ip: true });
12gtag('config', 'G-3YM29CN26E', { anonymize_ip: true });
13gtag('config', 'AW-17347444171', { anonymize_ip: true });
14
15// Track SPA route changes (replaces Docusaurus gtag plugin)
16(function () {
17  var prev = location.pathname + location.search;
18  function onNav() {
19    var current = location.pathname + location.search;
20    if (current !== prev) {
21      prev = current;
22      gtag('event', 'page_view', {
23        page_path: current,
24        page_location: location.href,
25      });
26    }
27  }
28  // Patch pushState/replaceState to detect Docusaurus client-side navigation
29  var origPush = history.pushState;
30  var origReplace = history.replaceState;
31  history.pushState = function () {
32    origPush.apply(this, arguments);
33    onNav();
34  };
35  history.replaceState = function () {
36    origReplace.apply(this, arguments);
37    onNav();
38  };
39  window.addEventListener('popstate', onNav);
40})();
41
42!(function (e, r) {
43  try {
44    if (e.vector) return void console.log('Vector snippet included more than once.');
45    var t = {};
46    t.q = t.q || [];
47    for (
48      var o = ['load', 'identify', 'on'],
49        n = function (e) {
50          return function () {
51            var r = Array.prototype.slice.call(arguments);
52            t.q.push([e, r]);
53          };
54        },
55        c = 0;
56      c < o.length;
57      c++
58    ) {
59      var a = o[c];
60      t[a] = n(a);
61    }
62    if (((e.vector = t), !t.loaded)) {
63      var i = r.createElement('script');
64      (i.type = 'text/javascript'), (i.async = !0), (i.src = 'https://cdn.vector.co/pixel.js');
65      var l = r.getElementsByTagName('script')[0];
66      l.parentNode.insertBefore(i, l), (t.loaded = !0);
67    }
68  } catch (e) {
69    console.error('Error loading Vector:', e);
70  }
71})(window, document);
72vector.load('18d08a7d-45cf-4805-b8b1-978305be5dd4');
73
74!(function (t, e) {
75  var o, n, p, r;
76  e.__SV ||
77    ((window.posthog = e),
78    (e._i = []),
79    (e.init = function (i, s, a) {
80      function g(t, e) {
81        var o = e.split('.');
82        2 == o.length && ((t = t[o[0]]), (e = o[1])),
83          (t[e] = function () {
84            t.push([e].concat(Array.prototype.slice.call(arguments, 0)));
85          });
86      }
87      ((p = t.createElement('script')).type = 'text/javascript'),
88        (p.async = !0),
89        (p.src =
90          s.api_host.replace('.i.posthog.com', '-assets.i.posthog.com') + '/static/array.js'),
91        (r = t.getElementsByTagName('script')[0]).parentNode.insertBefore(p, r);
92      var u = e;
93      for (
94        void 0 === a ? (a = 'posthog') : (u = e[a] = []),
95          u.people = u.people || [],
96          u.toString = function (t) {
97            var e = 'posthog';
98            return 'posthog' !== a && (e += '.' + a), t || (e += ' (stub)'), e;
99          },
100          u.people.toString = function () {
101            return u.toString(1) + '.people (stub)';
102          },
103          o =
104            'capture identify alias people.set people.set_once set_config register register_once unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset isFeatureEnabled onFeatureFlags getFeatureFlag getFeatureFlagPayload reloadFeatureFlags group updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures getActiveMatchingSurveys getSurveys getNextSurveyStep onSessionId setPersonProperties'.split(
105              ' ',
106            ),
107          n = 0;
108        n < o.length;
109        n++
110      )
111        g(u, o[n]);
112      e._i.push([i, s, a]);
113    }),
114    (e.__SV = 1));
115})(document, window.posthog || []);
116posthog.init('phc_gOS5ctlYqd64vmJtYVpAU0W5iew7OopcETkyYNpkyYP', {
117  api_host: 'https://us.i.posthog.com',
118  person_profiles: 'identified_only', // or 'always' to create profiles for anonymous users as well
119});
120
121/* Reo */
122!(function () {
123  var e, t, n;
124  (e = '59f3ca4439de16d'),
125    (t = function () {
126      Reo.init({ clientID: '59f3ca4439de16d' });
127    }),
128    ((n = document.createElement('script')).src = 'https://static.reo.dev/' + e + '/reo.js'),
129    (n.defer = !0),
130    (n.onload = t),
131    document.head.appendChild(n);
132})();

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.