PageSourceSearch

https://www.alldata.com/themes/custom/alldata/src/js/extlink.min.js?tlhfqw

js alldata.com collected 2026-10-02 04:57:42 UTC 13,804 bytes, 334 lines download raw bytes

1((l, a) => {
2  (l.extlink = l.extlink || {}),
3    (l.extlink.attach = (t, e) => {
4      if (typeof e.data > 'u' || !e.data.hasOwnProperty('extlink')) return;
5      let d = 'append';
6      e.data.extlink.extIconPlacement &&
7        e.data.extlink.extIconPlacement !== '0' &&
8        (d = e.data.extlink.extIconPlacement);
9      const f = /^(([^:]+?\.)*)([^.:]+)((\.[a-z0-9]{1,253})*)(:[0-9]{1,5})?$/,
10        c = window.location.host.replace(f, '$2$3$6'),
11        r = window.location.host.replace(c, '');
12      let x;
13      e.data.extlink.extSubdomains
14        ? (x = '([^/]*\\.)?')
15        : r === 'www.' || r === ''
16        ? (x = '(www\\.)?')
17        : (x = r.replace('.', '\\.'));
18      let o = !1;
19      if (e.data.extlink.allowedDomains) {
20        o = [];
21        for (let i = 0; i < e.data.extlink.allowedDomains.length; i++)
22          o.push(
23            new RegExp(
24              `^https?:\\/\\/${e.data.extlink.allowedDomains[i].replace(
25                /(\r\n|\n|\r)/gm,
26                ''
27              )}.*$`,
28              'i'
29            )
30          );
31      }
32      const m = new RegExp(`^https?://([^@]*@)?${x}${c}`, 'i');
33      let A = !1;
34      e.data.extlink.extInclude &&
35        (A = new RegExp(e.data.extlink.extInclude.replace(/\\/, '\\'), 'i'));
36      let b = !1;
37      e.data.extlink.extExclude &&
38        (b = new RegExp(e.data.extlink.extExclude.replace(/\\/, '\\'), 'i'));
39      let $ = !1;
40      e.data.extlink.extExcludeNoreferrer &&
41        ($ = new RegExp(
42          e.data.extlink.extExcludeNoreferrer.replace(/\\/, '\\'),
43          'i'
44        ));
45      let h = !1;
46      e.data.extlink.extCssExclude && (h = e.data.extlink.extCssExclude);
47      let w = !1;
48      e.data.extlink.extCssInclude && (w = e.data.extlink.extCssInclude);
49      let L = !1;
50      e.data.extlink.extCssExplicit && (L = e.data.extlink.extCssExplicit);
51      const k = [],
52        E = [],
53        T = [];
54      t.querySelectorAll(
55        'a:not([data-extlink]), area:not([data-extlink])'
56      ).forEach((i) => {
57        try {
58          let n = '';
59          typeof i.href == 'string'
60            ? (n = i.href.toLowerCase())
61            : typeof i.href == 'object' && (n = i.href.baseVal);
62          const s = w && (i.matches(w) || i.closest(w));
63          if (
64            n.indexOf('http') === 0 &&
65            ((!m.test(n) && !(b && b.test(n))) || (A && A.test(n)) || s) &&
66            !(h && i.matches(h)) &&
67            !(h && i.closest(h)) &&
68            !(L && !i.closest(L))
69          ) {
70            let C = !1;
71            if (!s && o) {
72              for (let v = 0; v < o.length; v++)
73                if (o[v].test(n)) {
74                  C = !0;
75                  break;
76                }
77            }
78            C || k.push(i);
79          } else
80            i.tagName !== 'AREA' &&
81              !(h && i.closest(h)) &&
82              !(L && !i.closest(L)) &&
83              (n.indexOf('mailto:') === 0
84                ? E.push(i)
85                : n.indexOf('tel:') === 0 && T.push(i));
86        } catch {
87          return !1;
88        }
89      });
90      const y =
91          e.data.extlink.extClass !== '0' && e.data.extlink.extClass !== '',
92        _ = e.data.extlink.extAdditionalLinkClasses !== '';
93      l.extlink.applyClassAndSpan(k, 'ext', y ? d : null),
94        _ &&
95          l.extlink.applyClassAndSpan(
96            k,
97            e.data.extlink.extAdditionalLinkClasses,
98            null
99          );
100      const M =
101          e.data.extlink.mailtoClass !== '0' &&
102          e.data.extlink.mailtoClass !== '',
103        H = e.data.extlink.extAdditionalMailtoClasses !== '';
104      M && l.extlink.applyClassAndSpan(E, e.data.extlink.mailtoClass, d),
105        H &&
106          l.extlink.applyClassAndSpan(
107            E,
108            e.data.extlink.extAdditionalMailtoClasses,
109            null
110          );
111      const I =
112          e.data.extlink.telClass !== '0' && e.data.extlink.telClass !== '',
113        N =
114          e.data.extlink.extAdditionalTelClasses !== '0' &&
115          e.data.extlink.extAdditionalTelClasses !== '';
116      I && l.extlink.applyClassAndSpan(T, e.data.extlink.telClass, d),
117        N &&
118          l.extlink.applyClassAndSpan(
119            E,
120            e.data.extlink.extAdditionalTelClasses,
121            null
122          ),
123        e.data.extlink.extTarget &&
124          (k.forEach((i, n) => {
125            (e.data.extlink.extTargetNoOverride && i.matches('a[target]')) ||
126              k[n].setAttribute('target', '_blank');
127          }),
128          k.forEach((i, n) => {
129            const s = i.getAttribute('rel');
130            if (s === null || typeof s > 'u') {
131              k[n].setAttribute('rel', 'noopener');
132              return;
133            }
134            s.indexOf('noopener') > -1
135              ? s.indexOf('noopener') === -1 &&
136                k[n].setAttribute('rel', `${s} noopener`)
137              : k[n].setAttribute('rel', `${s} noopener`);
138          })),
139        e.data.extlink.extNofollow &&
140          k.forEach((i, n) => {
141            const s = i.getAttribute('rel');
142            if (s === null || typeof s > 'u') {
143              k[n].setAttribute('rel', 'nofollow');
144              return;
145            }
146            let C = 'nofollow';
147            e.data.extlink.extFollowNoOverride && (C = 'follow'),
148              s.indexOf(C) === -1 && k[n].setAttribute('rel', `${s} nofollow`);
149          }),
150        e.data.extlink.extTitleNoOverride === !1 &&
151          k.forEach((i, n) => {
152            const s = i.getAttribute('title');
153            let C = '';
154            if (
155              (e.data.extlink.extTargetAppendNewWindowDisplay &&
156                (C = e.data.extlink.extTargetAppendNewWindowLabel),
157              s !== null)
158            ) {
159              if (l.extlink.hasNewWindowText(s)) return;
160              C = l.extlink.combineLabels(s, C);
161            }
162            C && k[n].setAttribute('title', C);
163          }),
164        e.data.extlink.extNoreferrer &&
165          k.forEach((i, n) => {
166            if (
167              e.data.extlink.extExcludeNoreferrer &&
168              $.test(i.getAttribute('href'))
169            )
170              return;
171            const s = i.getAttribute('rel');
172            if (s === null || typeof s > 'u') {
173              k[n].setAttribute('rel', 'noreferrer');
174              return;
175            }
176            k[n].setAttribute('rel', `${s} noreferrer`);
177          }),
178        (l.extlink = l.extlink || {}),
179        (l.extlink.popupClickHandler =
180          l.extlink.popupClickHandler ||
181          (() => {
182            if (e.data.extlink.extAlert)
183              return confirm(e.data.extlink.extAlertText);
184          }));
185      const O = this;
186      (l.extlink.handleClick = function (i) {
187        const n = l.extlink.popupClickHandler.call(O, i);
188        typeof n < 'u' && !n && i.preventDefault();
189      }),
190        k.forEach((i, n) => {
191          k[n].removeEventListener('click', l.extlink.handleClick),
192            k[n].addEventListener('click', l.extlink.handleClick);
193        });
194    }),
195    (l.extlink.hasNewWindowText = function (t) {
196      return t.toLowerCase().indexOf(l.t('new window')) !== -1;
197    }),
198    (l.extlink.combineLabels = function (t, e) {
199      if (((t = t || ''), (e = e || ''), !t.trim())) return e;
200      if (!e.trim()) return t;
201      const d = t.trim().replace('(', '').replace(')', ''),
202        f = e.trim().replace('(', '').replace(')', '');
203      return t === d
204        ? e === f
205          ? `${t}, ${e}`
206          : `${t} ${e}`
207        : e === f
208        ? `${e} ${t}`
209        : `(${d}, ${f})`;
210    }),
211    (l.extlink.applyClassAndSpan = (t, e, d) => {
212      let f;
213      a.data.extlink.extImgClass
214        ? (f = t)
215        : (f = t.filter((c) => c.querySelector('img, svg') === null));
216      for (let c = 0; c < f.length; c++)
217        if (
218          (e !== '0' && f[c].classList.add(e),
219          e === a.data.extlink.mailtoClass &&
220          a.data.extlink.extAdditionalMailtoClasses
221            ? f[c].classList.add(a.data.extlink.extAdditionalMailtoClasses)
222            : e === a.data.extlink.telClass &&
223              a.data.extlink.extAdditionalTelClasses
224            ? f[c].classList.add(a.data.extlink.extAdditionalTelClasses)
225            : a.data.extlink.extAdditionalLinkClasses &&
226              f[c].classList.add(a.data.extlink.extAdditionalLinkClasses),
227          f[c].setAttribute('data-extlink', ''),
228          d)
229        ) {
230          let r = f[c];
231          if (a.data.extlink.extPreventOrphan && d === 'append') {
232            let o = r.lastChild,
233              m = null,
234              A = r;
235            for (; o; )
236              if (o.lastChild) (A = o), (o = o.lastChild);
237              else if (
238                o.nodeName === '#text' &&
239                A.lastElementChild &&
240                o.textContent.trim().length === 0
241              )
242                (m = o), (A = A.lastElementChild), (o = A.lastChild);
243              else break;
244            if (o && o.nodeName === '#text' && o.textContent.length > 0) {
245              const b = o.textContent,
246                $ = new RegExp(/\S+\s*$/, 'g'),
247                h = b.match($);
248              if (h !== null) {
249                const w = document.createElement('span');
250                w.classList.add('extlink-nobreak'),
251                  (w.textContent = h[0]),
252                  m && ((m.textContent = ''), w.append(m.textContent)),
253                  (o.textContent = b.substring(0, b.length - h[0].length)),
254                  o.parentNode.append(w),
255                  (r = w);
256              }
257            }
258          }
259          let x;
260          a.data.extlink.extUseFontAwesome
261            ? ((x = document.createElement('span')),
262              x.setAttribute('class', `fa-${e} extlink`),
263              e === a.data.extlink.mailtoClass
264                ? (a.data.extlink.mailtoLabel &&
265                    (r.ariaLabel = a.data.extlink.mailtoLabel),
266                  (x.innerHTML = l.theme('extlink_fa_mailto', a, d)))
267                : e === a.data.extlink.extClass
268                ? (a.data.extlink.extLabel &&
269                    (r.ariaLabel = a.data.extlink.extLabel),
270                  (x.innerHTML = l.theme('extlink_fa_extlink', a, d)))
271                : e === a.data.extlink.telClass &&
272                  (a.data.extlink.telLabel &&
273                    (r.ariaLabel = a.data.extlink.telLabel),
274                  (x.innerHTML = l.theme('extlink_fa_tel', a, d))))
275            : ((x = document.createElementNS(
276                'http://www.w3.org/2000/svg',
277                'svg'
278              )),
279              x.setAttribute('focusable', 'false'),
280              x.setAttribute('width', '1em'),
281              x.setAttribute('height', '1em'),
282              x.classList.add(e),
283              x.setAttribute('data-extlink-placement', d),
284              e === a.data.extlink.mailtoClass
285                ? (x = l.theme('extlink_mailto', x, a))
286                : e === a.data.extlink.extClass
287                ? (x = l.theme('extlink_extlink', x, a))
288                : e === a.data.extlink.telClass &&
289                  (x = l.theme('extlink_tel', x, a))),
290            x.setAttribute('role', 'img'),
291            x.setAttribute('aria-hidden', a.data.extlink.extHideIcons),
292            r[d](x);
293        }
294    }),
295    (l.theme.extlink_fa_mailto = function (t, e) {
296      return `<span class="${t.data.extlink.extFaMailtoClasses}" data-extlink-placement="${e}"></span>`;
297    }),
298    (l.theme.extlink_fa_extlink = function (t, e) {
299      return `<span class="${t.data.extlink.extFaLinkClasses}" data-extlink-placement="${e}"></span>`;
300    }),
301    (l.theme.extlink_fa_tel = function (t, e) {
302      return `<span class="${t.data.extlink.extFaTelClasses}" data-extlink-placement="${e}"></span>`;
303    }),
304    (l.theme.extlink_mailto = function (t, e) {
305      return (
306        t.setAttribute('aria-label', e.data.extlink.mailtoLabel),
307        t.setAttribute('viewBox', '0 10 70 20'),
308        (t.innerHTML = `<title>${e.data.extlink.mailtoLabel}</title><path d="M56 14H8c-1.1 0-2 0.9-2 2v32c0 1.1 0.9 2 2 2h48c1.1 0 2-0.9 2-2V16C58 14.9 57.1 14 56 14zM50.5 18L32 33.4 13.5 18H50.5zM10 46V20.3l20.7 17.3C31.1 37.8 31.5 38 32 38s0.9-0.2 1.3-0.5L54 20.3V46H10z"/>`),
309        t
310      );
311    }),
312    (l.theme.extlink_extlink = function (t, e) {
313      return (
314        t.setAttribute('aria-label', e.data.extlink.extLabel),
315        t.setAttribute('viewBox', '0 0 80 40'),
316        (t.innerHTML = `<title>${e.data.extlink.extLabel}</title><path d="M48 26c-1.1 0-2 0.9-2 2v26H10V18h26c1.1 0 2-0.9 2-2s-0.9-2-2-2H8c-1.1 0-2 0.9-2 2v40c0 1.1 0.9 2 2 2h40c1.1 0 2-0.9 2-2V28C50 26.9 49.1 26 48 26z"/><path d="M56 6H44c-1.1 0-2 0.9-2 2s0.9 2 2 2h7.2L30.6 30.6c-0.8 0.8-0.8 2 0 2.8C31 33.8 31.5 34 32 34s1-0.2 1.4-0.6L54 12.8V20c0 1.1 0.9 2 2 2s2-0.9 2-2V8C58 6.9 57.1 6 56 6z"/>`),
317        t
318      );
319    }),
320    (l.theme.extlink_tel = function (t, e) {
321      return (
322        t.setAttribute('aria-label', e.data.extlink.telLabel),
323        t.setAttribute('viewBox', '0 0 181.352 181.352'),
324        (t.innerHTML = `<title>${e.data.extlink.telLabel}</title><path xmlns="http://www.w3.org/2000/svg" d="M169.393,167.37l-14.919,9.848c-9.604,6.614-50.531,14.049-106.211-53.404C-5.415,58.873,9.934,22.86,17.134,14.555L29.523,1.678c2.921-2.491,7.328-2.198,9.839,0.811l32.583,38.543l0.02,0.02c2.384,2.824,2.306,7.22-0.83,9.868v0.029l-14.44,10.415c-5.716,5.667-0.733,14.587,5.11,23.204l27.786,32.808c12.926,12.477,20.009,18.241,26.194,14.118l12.008-13.395c2.941-2.472,7.328-2.169,9.839,0.821l32.603,38.543v0.02C172.607,160.316,172.519,164.703,169.393,167.37z"/>`),
325        t
326      );
327    }),
328    (l.behaviors.extlink = l.behaviors.extlink || {}),
329    (l.behaviors.extlink.attach = (t, e) => {
330      typeof extlinkAttach == 'function'
331        ? extlinkAttach(t)
332        : l.extlink.attach(t, e);
333    });
334})(Drupal, drupalSettings);

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.