PageSourceSearch

https://www.seher.no/_chunks/page/global/default-449bfb4e84e92788c1e2.js

js seher.no collected 2026-10-01 11:28:28 UTC 2,809 bytes, 82 lines download raw bytes

1/******/ (function() { // webpackBootstrap
2/******/ 	"use strict";
3
4;// ./coreview/utils/fetchUserSegments.ts
5/**
6 * Fetch user segments from mediaconnect client mode API through minside.aller.no
7 */
8
9const getCookieValue = (name, cookiesArr) => {
10  const cookie = cookiesArr.find(row => row.trim().startsWith(name + '='));
11  return cookie ? cookie.split('=')[1] : undefined;
12};
13const fetchUserSegments = async () => {
14  const cookies = document.cookie;
15  const cookiesArr = cookies.split('; ');
16  const blaizeCookieValue = getCookieValue('blaize_jwt', cookiesArr);
17  if (!blaizeCookieValue) {
18    console.log('[SEGMENTS] Blaize cookie not found');
19    return;
20  }
21  const segmentsAgeCookieValue = getCookieValue('cyclops_seg_fresh', cookiesArr);
22  if (segmentsAgeCookieValue === 'true') {
23    console.log('[SEGMENTS] Segments age cookie is still valid, skipping fetch.');
24    return;
25  }
26  try {
27    const response = await fetch('/mcapi/client/user/metadata');
28    if (!response.ok) {
29      throw new Error(`Fetch failed with status: ${response.status}`);
30    }
31    const data = await response.json();
32    const segments = data === null || data === void 0 ? void 0 : data.segments;
33    if (!segments || typeof segments !== 'object' || Array.isArray(segments)) {
34      throw new Error(`Invalid segments data received: ${JSON.stringify(segments)}`);
35    }
36    if (!window.btoa) {
37      throw new Error('Base64 encoding is not supported in this environment.');
38    }
39    const segmentsEncoded = window.btoa(JSON.stringify(segments));
40    document.cookie = `cyclops_seg=${segmentsEncoded}; max-age=31536000; path=/`;
41    document.cookie = `cyclops_seg_fresh=true; max-age=86400; path=/`;
42  } catch (error) {
43    console.error('[SEGMENTS] User segments fetching ', error);
44  }
45};
46;// ./coreview/utils/clientSideScripts/maze.ts
47function mazeSnippet(m, a, z, e) {
48  var _a$getElementsByTagNa;
49  let t;
50  try {
51    t = m.sessionStorage.getItem('maze-us');
52  } catch {
53    /* empty */
54  }
55  if (!t) {
56    t = new Date().getTime().toString();
57    try {
58      m.sessionStorage.setItem('maze-us', t);
59    } catch {
60      /* empty */
61    }
62  }
63  const s = a.createElement('script');
64  s.src = `${z}?apiKey=${e}`;
65  s.async = true;
66  (_a$getElementsByTagNa = a.getElementsByTagName('head')[0]) === null || _a$getElementsByTagNa === void 0 || _a$getElementsByTagNa.appendChild(s);
67  m.mazeUniversalSnippetApiKey = e;
68}
69function initMaze() {
70  const aller = window.Aller;
71  const alias = aller && aller.hydrated ? aller.hydrated.alias : undefined;
72  if (alias === 'dagbladet' || alias === 'sol') {
73    mazeSnippet(window, document, 'https://snippet.maze.co/maze-universal-loader.js', '27aaa7cd-9c84-486f-be75-498a3cd1c73b');
74  }
75}
76;// ./coreview/view/page/global/default.ts
77
78
79fetchUserSegments();
80initMaze();
81/******/ })()
82;

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.