PageSourceSearch

https://www.mairie-lieu-saint-amand.fr/common_scripts/tarteaucitron/1.8.4/tarteaucitron.js

js mairie-lieu-saint-amand.fr collected 2026-10-02 21:27:55 UTC 92,469 bytes, 1,826 lines download raw bytes

1/*jslint browser: true, evil: true */
2
3// Afin de modifier le fichier, il faut recopier le contenu du fichier dans le répertoire scripts/tarteaucitron de l'espace ftp
4var tarteaucitronForceCDN = '/common_scripts/tarteaucitron/1.8.4/';
5
6var scripts = document.getElementsByTagName('script'),
7    path = scripts[scripts.length - 1].src.split('?')[0],
8    tarteaucitronForceCDN = (tarteaucitronForceCDN === undefined) ? '' : tarteaucitronForceCDN,
9    cdn = (tarteaucitronForceCDN === '') ? path.split('/').slice(0, -1).join('/') + '/' : tarteaucitronForceCDN,
10    alreadyLaunch = (alreadyLaunch === undefined) ? 0 : alreadyLaunch,
11    tarteaucitronForceLanguage = (tarteaucitronForceLanguage === undefined) ? '' : tarteaucitronForceLanguage,
12    tarteaucitronForceExpire = (tarteaucitronForceExpire === undefined) ? '' : tarteaucitronForceExpire,
13    tarteaucitronCustomText = (tarteaucitronCustomText === undefined) ? '' : tarteaucitronCustomText,
14    // tarteaucitronExpireInDay: true for day(s) value - false for hour(s) value
15    tarteaucitronExpireInDay = (tarteaucitronExpireInDay === undefined || typeof tarteaucitronExpireInDay !== "boolean") ? true : tarteaucitronExpireInDay,
16    timeExpire = 31536000000,
17    tarteaucitronProLoadServices,
18    tarteaucitronNoAdBlocker = false;
19
20
21
22var tarteaucitron = {
23    "version": 20201110,
24    "cdn": cdn,
25    "user": {},
26    "lang": {},
27    "services": {},
28    "added": [],
29    "idprocessed": [],
30    "state": [],
31    "launch": [],
32    "parameters": {},
33    "isAjax": false,
34    "reloadThePage": false,
35    "events": {
36        "init": function () {},
37        "load": function () {},
38    },
39    "init": function (params) {
40        "use strict";
41        var origOpen;
42
43        tarteaucitron.parameters = params;
44        if (alreadyLaunch === 0) {
45            alreadyLaunch = 1;
46            if (window.addEventListener) {
47                window.addEventListener("load", function () {
48                    tarteaucitron.initEvents.loadEvent(false);
49                }, false);
50                window.addEventListener("scroll", function () {
51                    tarteaucitron.initEvents.scrollEvent();
52                }, false);
53
54                window.addEventListener("keydown", function (evt) {
55                    tarteaucitron.initEvents.keydownEvent(false, evt);
56                }, false);
57                window.addEventListener("hashchange", function () {
58                    tarteaucitron.initEvents.hashchangeEvent();
59                }, false);
60                window.addEventListener("resize", function () {
61                    tarteaucitron.initEvents.resizeEvent();
62                }, false);
63            } else {
64                window.attachEvent("onload", function () {
65                    tarteaucitron.initEvents.loadEvent(true);
66                });
67                window.attachEvent("onscroll", function () {
68                    tarteaucitron.initEvents.scrollEvent();
69                });
70                window.attachEvent("onkeydown", function (evt) {
71                    tarteaucitron.initEvents.keydownEvent(true, evt);
72
73                });
74                window.attachEvent("onhashchange", function () {
75                    tarteaucitron.initEvents.hashchangeEvent();
76                });
77                window.attachEvent("onresize", function () {
78                    tarteaucitron.initEvents.resizeEvent();
79                });
80            }
81
82            if (typeof XMLHttpRequest !== 'undefined') {
83                origOpen = XMLHttpRequest.prototype.open;
84                XMLHttpRequest.prototype.open = function () {
85
86                    if (window.addEventListener) {
87                        this.addEventListener("load", function () {
88                            if (typeof tarteaucitronProLoadServices === 'function') {
89                                tarteaucitronProLoadServices();
90                            }
91                        }, false);
92                    } else if (typeof this.attachEvent !== 'undefined') {
93                        this.attachEvent("onload", function () {
94                            if (typeof tarteaucitronProLoadServices === 'function') {
95                                tarteaucitronProLoadServices();
96                            }
97                        });
98                    } else {
99                        if (typeof tarteaucitronProLoadServices === 'function') {
100                            setTimeout(tarteaucitronProLoadServices, 1000);
101                        }
102                    }
103
104                    try {
105                        origOpen.apply(this, arguments);
106                    } catch (err) {}
107                };
108            }
109        }
110
111        if(tarteaucitron.events.init) {
112            tarteaucitron.events.init();
113        }
114    },
115    "initEvents": {
116        "loadEvent": function (isOldBrowser) {
117            tarteaucitron.load();
118            tarteaucitron.fallback(['tarteaucitronOpenPanel'], function (elem) {
119                if (isOldBrowser) {
120                    elem.attachEvent("onclick", function (event) {
vendor: 1,110 bytes, lines 121-145
121                        tarteaucitron.userInterface.openPanel();
122                        event.preventDefault();
123                    });
124                } else {
125                    elem.addEventListener("click", function (event) {
126                        tarteaucitron.userInterface.openPanel();
127                        event.preventDefault();
128                    }, false);
129                }
130            }, true);
131        },
132        "keydownEvent": function (isOldBrowser, evt) {
133            if (evt.keyCode === 27) {
134                tarteaucitron.userInterface.closePanel();
135            }
136
137            if (isOldBrowser) {
138                if ( evt.keyCode === 9 && focusableEls.indexOf(evt.target) >= 0) {
139                    if ( evt.shiftKey ) /* shift + tab */ {
140                        if (document.activeElement === firstFocusableEl) {
141                            lastFocusableEl.focus();
142                            evt.preventDefault();
143                        }
144                    } else /* tab */ {
145                        if (document.activeElement === lastFocusableEl) {
146                            firstFocusableEl.focus();
147                            evt.preventDefault();
148                        }
149                    }
150                }
151            }
152        },
153        "hashchangeEvent": function () {
154            if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') {
155                tarteaucitron.userInterface.openPanel();
156            }
157        },
158        "resizeEvent": function () {
159            var tacElem = document.getElementById('tarteaucitron');
160            var tacCookieContainer = document.getElementById('tarteaucitronCookiesListContainer');
161
162            if (tacElem && tacElem.style.display === 'block') {
163                tarteaucitron.userInterface.jsSizing('main');
164            }
165
166            if (tacCookieContainer && tacCookieContainer.style.display === 'block') {
167                tarteaucitron.userInterface.jsSizing('cookie');
168            }
169        },
170        "scrollEvent": function () {
171            var scrollPos = window.pageYOffset || document.documentElement.scrollTop;
172            var heightPosition;
173            var tacPercentage = document.getElementById('tarteaucitronPercentage');
174            var tacAlertBig = document.getElementById('tarteaucitronAlertBig');
175
176            if (tacAlertBig && !tarteaucitron.highPrivacy) {
177                if (tacAlertBig.style.display === 'block') {
178                    heightPosition = tacAlertBig.offsetHeight + 'px';
179
180                    if (scrollPos > (screen.height * 2)) {
181                        tarteaucitron.userInterface.respondAll(true);
182                    } else if (scrollPos > (screen.height / 2)) {
183                        document.getElementById('tarteaucitronDisclaimerAlert').innerHTML = '<strong>' + tarteaucitron.lang.alertBigScroll + '</strong> ' + tarteaucitron.lang.alertBig;
184                    }
185
186                    if (tacPercentage) {
187                        if (tarteaucitron.orientation === 'top') {
188                            tacPercentage.style.top = heightPosition;
189                        } else {
190                            tacPercentage.style.bottom = heightPosition;
191                        }
192                        tacPercentage.style.width = ((100 / (screen.height * 2)) * scrollPos) + '%';
193                    }
194                }
195            }
196        },
197    },
198    "load": function () {
199        "use strict";
200        var cdn = tarteaucitron.cdn,
201            language = tarteaucitron.getLanguage(),
202            pathToLang = cdn + 'lang/tarteaucitron.' + language + '.js?v=' + tarteaucitron.version,
203            pathToServices = cdn + 'tarteaucitron.services.js?v=' + tarteaucitron.version,
204            linkElement = document.createElement('link'),
205            defaults = {
206                "adblocker": false,
207                "hashtag": '#tarteaucitron',
208                "cookieName": 'tarteaucitron',
209                "highPrivacy": true,
210                "orientation": "middle",
211                "bodyPosition": "bottom",
212                "removeCredit": false,
213                "showAlertSmall": false,
214                "showIcon": true,
215                "iconPosition": "BottomRight",
216                "cookieslist": false,
217                "handleBrowserDNTRequest": false,
218                "DenyAllCta": true,
219                "AcceptAllCta" : true,
220                "moreInfoLink": true,
221                "privacyUrl": "",
222                "useExternalCss": false,
223                "useExternalJs": false,
224                "mandatory": true,
225                "closePopup": false
226            },
227            params = tarteaucitron.parameters;
228
229        // Don't show the middle bar if we are on the privacy policy or more page
230        if (((tarteaucitron.parameters.readmoreLink !== undefined && window.location.href == tarteaucitron.parameters.readmoreLink) || window.location.href == tarteaucitron.parameters.privacyUrl) && tarteaucitron.parameters.orientation == "middle") {
231            tarteaucitron.parameters.orientation = "bottom";
232        }
233
234        // Step -1
235        if (typeof tarteaucitronCustomPremium !== 'undefined') {
236            tarteaucitronCustomPremium();
237        }
238
239        // Step 0: get params
240        if (params !== undefined) {
241
242            for (var k in defaults) {
243                if(!tarteaucitron.parameters.hasOwnProperty(k)) {
244                    tarteaucitron.parameters[k] = defaults[k];
245                }
246            }
247        }
248
249        // global
250        tarteaucitron.orientation = tarteaucitron.parameters.orientation;
251        tarteaucitron.hashtag = tarteaucitron.parameters.hashtag;
252        tarteaucitron.highPrivacy = tarteaucitron.parameters.highPrivacy;
253        tarteaucitron.handleBrowserDNTRequest = tarteaucitron.parameters.handleBrowserDNTRequest;
254
255        // Step 1: load css
256        if ( !tarteaucitron.parameters.useExternalCss ) {
257            linkElement.rel = 'stylesheet';
258            linkElement.type = 'text/css';
259            linkElement.href = cdn + 'css/tarteaucitron.css?v=' + tarteaucitron.version;
260            document.getElementsByTagName('head')[0].appendChild(linkElement);
261        }
262        // Step 2: load language and services
263        tarteaucitron.addInternalScript(pathToLang, '', function () {
264
265          if(tarteaucitronCustomText !== ''){
266            tarteaucitron.lang = tarteaucitron.AddOrUpdate(tarteaucitron.lang, tarteaucitronCustomText);
267          }
268            tarteaucitron.addInternalScript(pathToServices, '', function () {
269
270
271                // css for new middle bar
272                if (tarteaucitron.orientation === 'middle') {
273                    var customThemeMiddle = document.createElement('style'),
274                        cssRuleMiddle = 'div#tarteaucitronRoot.tarteaucitronBeforeVisible:before {content: \'\';position: fixed;width: 100%;height: 100%;background: white;top: 0;left: 0;z-index: 999;opacity: 0.5;}div#tarteaucitronAlertBig:before {content: \'' + tarteaucitron.lang.middleBarHead + '\';font-size: 35px;}body #tarteaucitronRoot div#tarteaucitronAlertBig {width: 60%;min-width: 285px;height: auto;margin: auto;left: 50%;top: 50%;transform: translate(-50%, -50%);box-shadow: 0 0 9000px #000;border-radius: 20px;padding: 35px 25px;}span#tarteaucitronDisclaimerAlert {padding: 0 30px;}#tarteaucitronRoot span#tarteaucitronDisclaimerAlert {margin: 10px 0 30px;display: block;text-align: center;font-size: 21px;}@media screen and (max-width: 900px) {div#tarteaucitronAlertBig button {margin: 0 auto 10px!important;display: block!important;}}';
275
276                    customThemeMiddle.type = 'text/css';
277                    if (customThemeMiddle.styleSheet) {
278                        customThemeMiddle.styleSheet.cssText = cssRuleMiddle;
279                    } else {
280                        customThemeMiddle.appendChild(document.createTextNode(cssRuleMiddle));
281                    }
282                    document.getElementsByTagName('head')[0].appendChild(customThemeMiddle);
283                }
284                var body = document.body,
285                    div = document.createElement('div'),
286                    html = '',
287                    index,
288                    orientation = 'Top',
289                    cat = ['ads', 'analytic', 'api', 'comment', 'social', 'support', 'video', 'other'],
290                    i;
291
292                cat = cat.sort(function (a, b) {
293                    if (tarteaucitron.lang[a].title > tarteaucitron.lang[b].title) { return 1; }
294                    if (tarteaucitron.lang[a].title < tarteaucitron.lang[b].title) { return -1; }
295                    return 0;
296                });
297
298                // Step 3: prepare the html
299                html += '<div id="tarteaucitronPremium"></div>';
300                html += '<button type="button" id="tarteaucitronBack" aria-label="' + tarteaucitron.lang.close + '"></button>';
301                html += '<div id="tarteaucitron" role="dialog" aria-labelledby="dialogTitle">';
302                html += '   <button type="button" id="tarteaucitronClosePanel">';
303                html += '       ' + tarteaucitron.lang.close;
304                html += '   </button>';
305                html += '   <div id="tarteaucitronServices">';
306                html += '      <div class="tarteaucitronLine tarteaucitronMainLine" id="tarteaucitronMainLineOffset">';
307                html += '         <span class="tarteaucitronH1" role="heading" aria-level="1" id="dialogTitle">'+ tarteaucitron.lang.title + '</span>';
308                html += '         <div id="tarteaucitronInfo">';
309                html += '         ' + tarteaucitron.lang.disclaimer;
310                if (tarteaucitron.parameters.privacyUrl !== "") {
311                    html += '   <br/><br/>';
312                    html += '   <button type="button" id="tarteaucitronPrivacyUrlDialog">';
313                    html += '       ' + tarteaucitron.lang.privacyUrl;
314                    html += '   </button>';
315                }
316                html += '         </div>';
317                html += '         <div class="tarteaucitronName">';
318                html += '            <span class="tarteaucitronH2" role="heading" aria-level="2">' + tarteaucitron.lang.all + '</span>';
319                html += '         </div>';
320                html += '         <div class="tarteaucitronAsk" id="tarteaucitronScrollbarAdjust">';
321                html += '            <button type="button" id="tarteaucitronAllAllowed" class="tarteaucitronAllow">';
vendor: 9,584 bytes, lines 322-444
322                html += '               <span class="tarteaucitronCheck"></span> ' + tarteaucitron.lang.allowAll;
323                html += '            </button> ';
324                html += '            <button type="button" id="tarteaucitronAllDenied" class="tarteaucitronDeny">';
325                html += '               <span class="tarteaucitronCross"></span> ' + tarteaucitron.lang.denyAll;
326                html += '            </button>';
327                html += '         </div>';
328                html += '      </div>';
329                html += '      <div class="tarteaucitronBorder">';
330                html += '         <div class="clear"></div><ul>';
331
332
333                if (tarteaucitron.parameters.mandatory == true) {
334                   html += '<li id="tarteaucitronServicesTitle_mandatory">';
335                   html += '<div class="tarteaucitronTitle">';
336                   html += '   <button type="button" tabindex="-1">&nbsp; ' + tarteaucitron.lang.mandatoryTitle + '</button>';
337                   html += '</div>';
338                   html += '<ul id="tarteaucitronServices_mandatory">';
339                   html += '<li class="tarteaucitronLine">';
340                   html += '   <div class="tarteaucitronName">';
341                   html += '       <span class="tarteaucitronH3" role="heading" aria-level="3">' + tarteaucitron.lang.mandatoryText + '</span>';
342                   html += '       <span class="tarteaucitronListCookies"></span><br/>';
343                   html += '   </div>';
344                   html += '   <div class="tarteaucitronAsk">';
345                   html += '       <button type="button" class="tarteaucitronAllow" tabindex="-1">';
346                   html += '           <span class="tarteaucitronCheck"></span> ' + tarteaucitron.lang.allow;
347                   html += '       </button> ';
348                   html += '       <button type="button" class="tarteaucitronDeny" style="visibility:hidden" tabindex="-1">';
349                   html += '           <span class="tarteaucitronCross"></span> ' + tarteaucitron.lang.deny;
350                   html += '       </button> ';
351                   html += '   </div>';
352                   html += '</li>';
353                   html += '</ul></li>';
354                }
355
356                for (i = 0; i < cat.length; i += 1) {
357                    html += '         <li id="tarteaucitronServicesTitle_' + cat[i] + '" class="tarteaucitronHidden">';
358                    html += '            <div class="tarteaucitronTitle">';
359                    html += '               <button type="button" class="catToggleBtn" data-cat="tarteaucitronDetails' + cat[i] + '"><span class="tarteaucitronPlus"></span> ' + tarteaucitron.lang[cat[i]].title + '</button>';
360                    html += '            </div>';
361                    html += '            <div id="tarteaucitronDetails' + cat[i] + '" class="tarteaucitronDetails tarteaucitronInfoBox">';
362                    html += '               ' + tarteaucitron.lang[cat[i]].details;
363                    html += '            </div>';
364                    html += '         <ul id="tarteaucitronServices_' + cat[i] + '"></ul></li>';
365                }
366                html += '             <li id="tarteaucitronNoServicesTitle" class="tarteaucitronLine">' + tarteaucitron.lang.noServices + '</li>';
367                html += '         </ul>';
368                html += '         <div class="tarteaucitronHidden spacer-20" id="tarteaucitronScrollbarChild"></div>';
369                if (tarteaucitron.parameters.removeCredit === false) {
370                    html += '     <a class="tarteaucitronSelfLink" href="https://tarteaucitron.io/" rel="nofollow noreferrer noopener" target="_blank" title="tarteaucitron ' + tarteaucitron.lang.newWindow + '"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHcAAAAeCAYAAAAWwoEYAAADl0lEQVRoge1Y0W3bQAx9CjKARlC+9GVUmqDJBHEmiDyB6wkcTxBngtgTxJ0gzgQW4C/9aYOmE6g4lTQo+k6y3Rb94QOERNQd+cjj8XiGwWAwGAwGg8FgMBgMBoPB8F8RNRXe+whEKe7c36ZCAeCRxC9Rig2PUd8kPgAsoxSfQ3YAzAA8D/HwYYCb05kBKKO0teFkmbC1jlKsAnq/Abjn+QBqAIsoRS30ttwG/HNz1wH/XIxWTicLdvtW7xTAGEAMtP685CNsBTe2d/BLydfXAG57SEnMAST0zgYZSUCPk02bCvkJduIzuJzDLfPolbY+tLKmar+/8+IRePy4qdpE03qHuH8fipFb4N2+XdA3AJ/0vaQxt7s9FvkIS2XvtqnwM0rxpOQfbnE5G2LhTCmUO2fHIngOmcv+KG3HafDchB6ntwjYqenR2PqC7sOZ3E7FXHB0vqxoFyUyLh7OEH7LOGouvhhN3eIBeKXv0n5MsufdHqXcwYR5U2EbpV35lSspVPJmQj4TcgRK7jTg5IzmPUhhwM5a2WHUFCx+NgiDucmgh7idikLovHFlL0pxQ9xzX+IIP9Y6FrJsqhjlQpZRAkFVDCjZfcCHt6bqJDmuh5ylCWx0RVnk3oumaknqTH5sqrY0fBWyULaHUIgAgxb46MxV3DbieAhxOxUxjSuljig9lMQ/Bcfoi9BTEv9aLORSndVxYOH525sUDC6u2gWxcNzBNRxPanyh3ktKinOgy3WoxPbtUM0t6RkbQnzBnFPgi9GCOEubY9UffIryz9iKRe8s/FUfEWosJJGxagp85bpUO3VywQ46lOtAWfNxKwa4JXQ+628+bpxYGXXMzp5rXH401VEyXwIdowXFaKWSMFHvMTVmGnc+P3oXV2QOiBCfgex8QtcQCbcQE/H+eoHzrkFo1KM7zVO4jVVj5s6lRiWF7zyXyfRMc97J3tzj87mYqZ7E2YjzUct9GUi4tjHLR8dVkBLjQcuHFleWvQfRNEhFR7uX7pkctOwvZXsft7sAtyldEUIN2UTeLxnEfxKYswzdi88BdbZ8hifUoSMftQvP+muRwN6+Q3DeqqRExP9QmTtcheiHh0Ot1x2i2km1bP9pbufw5zZdyWsOrh7vQae5OZWbsMv30pi7cd/CKj3coPEVaCP4Zhx4eQWhOZ1Y9MTXGyP8/iGjEyfa1T4fO/4Lea9vBoPBYDAYDAaDwWAwGAwGwz8GgF8siXCCbrSRhgAAAABJRU5ErkJggg==" alt="tarteaucitron.io" /></a>';
371                }
372                html += '       </div>';
373                html += '   </div>';
374                html += '</div>';
375
376                if (tarteaucitron.parameters.orientation === 'bottom') {
377                    orientation = 'Bottom';
378                }
379
380                if (tarteaucitron.parameters.highPrivacy && !tarteaucitron.parameters.AcceptAllCta) {
381                    html += '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">';
382                    //html += '<div class="tarteaucitronAlertBigWrapper">';
383                    html += '   <span id="tarteaucitronDisclaimerAlert">';
384                    html += '       ' + tarteaucitron.lang.alertBigPrivacy;
385                    html += '   </span>';
386                    //html += '   <span class="tarteaucitronAlertBigBtnWrapper">';
387                    html += '   <button type="button" id="tarteaucitronPersonalize">';
388                    html += '       ' + tarteaucitron.lang.personalize;
389                    html += '   </button>';
390
391                    if (tarteaucitron.parameters.privacyUrl !== "") {
392                        html += '   <button type="button" id="tarteaucitronPrivacyUrl">';
393                        html += '       ' + tarteaucitron.lang.privacyUrl;
394                        html += '   </button>';
395                    }
396
397                    //html += '   </span>';
398                    //html += '</div>';
399                    html += '</div>';
400                } else {
401                    html += '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">';
402                    //html += '<div class="tarteaucitronAlertBigWrapper">';
403                    html += '   <span id="tarteaucitronDisclaimerAlert">';
404
405                    if (tarteaucitron.parameters.highPrivacy) {
406                        html += '       ' + tarteaucitron.lang.alertBigPrivacy;
407                    } else {
408                        html += '       ' + tarteaucitron.lang.alertBigClick + ' ' + tarteaucitron.lang.alertBig;
409                    }
410
411                    html += '   </span>';
412                    //html += '   <span class="tarteaucitronAlertBigBtnWrapper">';
413                    html += '   <button type="button" class="tarteaucitronCTAButton tarteaucitronAllow" id="tarteaucitronPersonalize2">';
414                    html += '       <span class="tarteaucitronCheck"></span> ' + tarteaucitron.lang.acceptAll;
415                    html += '   </button>';
416
417
418                    if (tarteaucitron.parameters.DenyAllCta) {
419                                    html += '   <button type="button" class="tarteaucitronCTAButton tarteaucitronDeny" id="tarteaucitronAllDenied2">';
420                                    html += '       <span class="tarteaucitronCross"></span> ' + tarteaucitron.lang.denyAll;
421                                    html += '   </button>';
422                                    //html += '   <br/><br/>';
423                    }
424
425                    html += '   <button type="button" id="tarteaucitronCloseAlert">';
426                    html += '       ' + tarteaucitron.lang.personalize;
427                    html += '   </button>';
428
429                    if (tarteaucitron.parameters.privacyUrl !== "") {
430                        html += '   <button type="button" id="tarteaucitronPrivacyUrl">';
431                        html += '       ' + tarteaucitron.lang.privacyUrl;
432                        html += '   </button>';
433                    }
434
435                    //html += '   </span>';
436                    //html += '</div>';
437                    html += '</div>';
438                    html += '<div id="tarteaucitronPercentage"></div>';
439                }
440
441                if (tarteaucitron.parameters.showIcon === true) {
442                    html += '<div id="tarteaucitronIcon" class="tarteaucitronIcon' + tarteaucitron.parameters.iconPosition + '">';
443                    html += '   <button type="button" id="tarteaucitronManager">';
444                    html += '       <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGA0lEQVRoge1a207bWBRdBtJwLYZhKDMVmlSK1LxNkPo+ZH6g8B6p5AuALwC+APoFoVLeoT8whPeRSt+CZKmZVu3AiIsRlEtCktGyjy8xzuXYhvahS0JJHJ/4rLP3XnuffcAPfGdQ7mM6jRLSAF4BxqsbewB2lRS2o35mpEQaJcwCyANIdLi1DGBNSWEzqmdHRqRRwjqAJclhtExOSUEP+/xIiDRKhhUWfL7ShTtBuJnqcw+/z4Ql0xNmMEwSSz4ku
444NIzSgpjSsqYJP/GeE185wYJroedRyiLNEpGLLzzrHSuk+83SgbxvOcyyRaDziWsRVZkSRDinpzPbwVGWIucuohsKynMS47fAQyls/BMSRmKJo3AFhG5wm2N1wF+Zs3zebbFfR0RxrXcJHQlgH+LMW616pR/WiIMEXfW3mtzXyeEGWsjKot8c4TOI98L+iKaR5PS6IUk88RLAO9F8UjrbYoYMOosNavpfmODIiwRXRR/G3ohaWVo1RU/c30jV8ab2mV8qVGzHWBOLyTLZiWs5Rolg/C3ySOi0tXP/k4aEwOwSBKPJs7Rp16ABJTe+p1xVX0It/owqqdDEMRoqd3RFxqDPh20Ig6VEPVC0i5RSCD+6wl6HlW7GksSlUMV11/GrUs5NasFLusDE9ELSVphXemtJwaT/8JyIRvxNNCfBmIiNdR04LII3DSrbe0yjqvyJF/ppptqVlt+MCLCEh/oOkPPP6N38Mb5cnQBGFsEqmXg5j3QMwoMzwGnr4HYbybBq13gZAOom/FO63zdf2qQArCsZrUN2TlJy69eSDKYV+6Q4MpP75ivHzPA53ngaBW4eGuSOt0A/lsGPmXMz0+3TFJcTfFbPfFbfnwlhON+iQhlWmA82CQ4ocQ7c6KcfL3DHuls0yT6Sx4YnLXJDCQOIRRv5yGIJBgP8Sdisj2qubpc5UGJmo+W49ifVmzL8HcpGhQPvZCUKiCliIhEN0tr2OCqHuSA8gwQ/92MkU7gxEmeVqGrTTgpxPXbUrtGWYus0I9thRIraagRQUIDf7Qn4yZhKRiFQIyhfMfUr3yblokVWSJ6k8xSnc7eNN/RjowfCYiFoDUFer1S3gW6JiJ8Nt30EMbEhU+vzSIztuRYjRLsR8IHLjlf7HZ+MrWWEXxNmbvapt4jGSqZRYSkGUetSNTPzHsui5YMQ2ajJUNks6mw4wT54Ok2ShnzzIPCUGshzawCRKy5FqvrTZe0RWzQGvw79m67XZjKmxJrLsICjtZa55gxXy+6F4sYsEtxTqhXdRTLC8ulSDaWoCLsolfN+8YUhOsJV709H7Cudr0LlVEtzqBcN+shEyThdR941OnAbF8pirKJqXyupTRTtQSReiVmXW1j7oBErB0d9xM2WEd5J9ZKYtuR4WKwwBSoORbpGrJ5ZI9lt71irJmGX1px0JYE26uNErawr2zfIcP4OHEKXm66PA3wjpCNEfpJunI4muifPjKvsFCkGjExTq63yxMJsZNMYF/J4HmDC5A3Yq36jy0ClePHVhwuu/b1HSFlEfHD5ZtD1bEK44Qu1mWys6tbWmZyPWckzlPTGiRw/XHCuk+q4Rek+mVrVL/UppwrdDEGNV2kpyuhccgc5Oxm9vWnn+19vJrVpLor0kTUrGacMplb1CfOFyTD4o9uNrHqr2Z+ZMSp1c2XcVSORnh9Q81q3k599ETgkNnjg0nGzi10K7rX+bZpHbrblPcY5A4Zxk2xcjzCvTpd9027Aa0QtouyyrKFRR6D/04DwkFGvHPXM3Qda/Jb4nPgI7hQLVM1q5HIBt2MzQNa57Z1DiiLAGa5Mi+O4Sz3Mpp6laPHO6InII3ITnX1QtI+EOX+m9ZxleOZ/j9PiuKoLi3aqXPuEoSye/Vhkm+LalbLtHhMS0R6zu7aZ3vP2jOjL7QVv4McxhcDnZIelAQibGIbULOapf3PuE1Vs9qeaOTdkVKr00gCQiw4NlBzDvf1Lxx+uP5r3Dgv5KQZRzWn+GRwz8jmDS8itUg7iB6vLuJCF5Uty4A9mVKkFR6MiJDachST/oHvHgD+B4SoUIitpF05AAAAAElFTkSuQmCC" alt="Cookies">';
445                    html += '   </button>';
446                    html += '</div>';
447                }
448
449                if (tarteaucitron.parameters.showAlertSmall === true) {
450                    html += '<div id="tarteaucitronAlertSmall" class="tarteaucitronAlertSmall' + orientation + '">';
451                    html += '   <button type="button" id="tarteaucitronManager">';
452                    html += '       ' + tarteaucitron.lang.alertSmall;
453                    html += '       <span id="tarteaucitronDot">';
454                    html += '           <span id="tarteaucitronDotGreen"></span>';
455                    html += '           <span id="tarteaucitronDotYellow"></span>';
456                    html += '           <span id="tarteaucitronDotRed"></span>';
457                    html += '       </span>';
458                    if (tarteaucitron.parameters.cookieslist === true) {
459                        html += '   </button><!-- @whitespace';
460                        html += '   --><button type="button" id="tarteaucitronCookiesNumber">0</button>';
461                        html += '   <div id="tarteaucitronCookiesListContainer">';
462                        html += '       <button type="button" id="tarteaucitronClosePanelCookie">';
463                        html += '           ' + tarteaucitron.lang.close;
464                        html += '       </button>';
465                        html += '       <div class="tarteaucitronCookiesListMain" id="tarteaucitronCookiesTitle">';
466                        html += '            <span class="tarteaucitronH2" role="heading" aria-level="2" id="tarteaucitronCookiesNumberBis">0 cookie</span>';
467                        html += '       </div>';
468                        html += '       <div id="tarteaucitronCookiesList"></div>';
469                        html += '    </div>';
470                    } else {
471                        html += '   </div>';
472                    }
473                    html += '</div>';
474                }
475
476                tarteaucitron.addInternalScript(tarteaucitron.cdn + 'advertising.js?v=' + tarteaucitron.version, '', function () {
477                    if (tarteaucitronNoAdBlocker === true || tarteaucitron.parameters.adblocker === false) {
478
479                        // create a wrapper container at the same level than tarteaucitron so we can add an aria-hidden when tarteaucitron is opened
480                        /*var wrapper = document.createElement('div');
481                        wrapper.id = "contentWrapper";
482
483                        while (document.body.firstChild)
484                        {
485                            wrapper.appendChild(document.body.firstChild);
486                        }
487
488                        // Append the wrapper to the body
489                        document.body.appendChild(wrapper);*/
490
491                        div.id = 'tarteaucitronRoot';
492                        if (tarteaucitron.parameters.bodyPosition === 'top') {
493                            // Prepend tarteaucitron: #tarteaucitronRoot first-child of the body for better accessibility
494                            var bodyFirstChild = body.firstChild;
495                            body.insertBefore(div, bodyFirstChild);
496                        }
497                        else {
498                            // Append tarteaucitron: #tarteaucitronRoot last-child of the body
499                            body.appendChild(div, body);
500                        }
501                        div.innerHTML = html;
502
503                        //ie compatibility
504                        var tacRootAvailableEvent;
505                        if(typeof(Event) === 'function') {
506                            tacRootAvailableEvent = new Event("tac.root_available");
507                        }else{
508                            tacRootAvailableEvent = document.createEvent('Event');
509                            tacRootAvailableEvent.initEvent("tac.root_available", true, true);
510                        }
511                        //end ie compatibility
512
513                        window.dispatchEvent(tacRootAvailableEvent);
514
515                        if (tarteaucitron.job !== undefined) {
516                            tarteaucitron.job = tarteaucitron.cleanArray(tarteaucitron.job);
517                            for (index = 0; index < tarteaucitron.job.length; index += 1) {
518                                tarteaucitron.addService(tarteaucitron.job[index]);
519                            }
520                        } else {
521                            tarteaucitron.job = []
522                        }
523
524                        tarteaucitron.isAjax = true;
525
526                        tarteaucitron.job.push = function (id) {
527
528                            // ie <9 hack
529                            if (typeof tarteaucitron.job.indexOf === 'undefined') {
530                                tarteaucitron.job.indexOf = function (obj, start) {
531                                    var i,
532                                        j = this.length;
533                                    for (i = (start || 0); i < j; i += 1) {
534                                        if (this[i] === obj) { return i; }
535                                    }
536                                    return -1;
537                                };
538                            }
539
540                            if (tarteaucitron.job.indexOf(id) === -1) {
541                                Array.prototype.push.call(this, id);
542                            }
543                            tarteaucitron.launch[id] = false;
544                            tarteaucitron.addService(id);
545                        };
546
547                        if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') {
548                            tarteaucitron.userInterface.openPanel();
549                        }
550
551                        tarteaucitron.cookie.number();
552                        setInterval(tarteaucitron.cookie.number, 60000);
553                    }
554                }, tarteaucitron.parameters.adblocker);
555
556                if (tarteaucitron.parameters.adblocker === true) {
557                    setTimeout(function () {
558                        if (tarteaucitronNoAdBlocker === false) {
559                            html = '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + ' display-block" role="alert" aria-live="polite">';
560                            html += '   <p id="tarteaucitronDisclaimerAlert">';
561                            html += '       ' + tarteaucitron.lang.adblock + '<br/>';
562                            html += '       <strong>' + tarteaucitron.lang.adblock_call + '</strong>';
563                            html += '   </p>';
564                            html += '   <button type="button" class="tarteaucitronCTAButton" id="tarteaucitronCTAButton">';
565                            html += '       ' + tarteaucitron.lang.reload;
566                            html += '   </button>';
567                            html += '</div>';
568                            html += '<div id="tarteaucitronPremium"></div>';
569
570                            div.id = 'tarteaucitronRoot';
571                            if (tarteaucitron.parameters.bodyPosition === 'top') {
572                                // Prepend tarteaucitron: #tarteaucitronRoot first-child of the body for better accessibility
573                                var bodyFirstChild = body.firstChild;
574                                body.insertBefore(div, bodyFirstChild);
575                            }
576                            else {
577                                // Append tarteaucitron: #tarteaucitronRoot last-child of the body
578                                body.appendChild(div, body);
579                            }
580                            div.innerHTML = html;
581                        }
582                    }, 1500);
583                }
584                if(tarteaucitron.parameters.closePopup === true){
585                    let element = document.getElementById('tarteaucitronAlertBig');
586                    let span = document.createElement('span')
587                    span.textContent = 'X';
588                    span.style.cssText = 'position:absolute; color: #FFFF; font-size:2rem; cursor: pointer; top: 10px; right: 26px';
589                    span.setAttribute('id', "clossCross")
590                    element.insertBefore(span, element.firstElementChild)
591                    document.getElementById("clossCross").onclick = () =>{
592                        tarteaucitron.userInterface.closeAlert();
593                    }
594                }
595
596
597
598                // add a little timeout to be sure everything is accessible
599                setTimeout(function () {
600                    
601                    // Setup events
602                    tarteaucitron.addClickEventToId("tarteaucitronPersonalize", function () {
603                        tarteaucitron.userInterface.openPanel();
604                    });
605                    tarteaucitron.addClickEventToId("tarteaucitronPersonalize2", function () {
606                        tarteaucitron.userInterface.respondAll(true);
607                    });
608                    tarteaucitron.addClickEventToId("tarteaucitronManager", function () {
609                        tarteaucitron.userInterface.openPanel();
610                    });
611                    tarteaucitron.addClickEventToId("tarteaucitronBack", function () {
612                        tarteaucitron.userInterface.closePanel();
613                    });
614                    tarteaucitron.addClickEventToId("tarteaucitronClosePanel", function () {
615                        tarteaucitron.userInterface.closePanel();
616                    });
617                    tarteaucitron.addClickEventToId("tarteaucitronClosePanelCookie", function () {
618                        tarteaucitron.userInterface.closePanel();
619                    });
620                    tarteaucitron.addClickEventToId("tarteaucitronPrivacyUrl", function () {
621                        document.location = tarteaucitron.parameters.privacyUrl;
622                    });
623                    tarteaucitron.addClickEventToId("tarteaucitronPrivacyUrlDialog", function () {
624                        document.location = tarteaucitron.parameters.privacyUrl;
625                    });
626                    tarteaucitron.addClickEventToId("tarteaucitronCookiesNumber", function () {
627                        tarteaucitron.userInterface.toggleCookiesList();
628                    });
629                    tarteaucitron.addClickEventToId("tarteaucitronAllAllowed", function () {
630                        tarteaucitron.userInterface.respondAll(true);
631                    });
632                    tarteaucitron.addClickEventToId("tarteaucitronAllDenied", function () {
633                        tarteaucitron.userInterface.respondAll(false);
634                    });
635                    tarteaucitron.addClickEventToId("tarteaucitronAllDenied2", function () {
636                        tarteaucitron.userInterface.respondAll(false);
637                        if (tarteaucitron.reloadThePage === true) {
638                            window.location.reload();
639                        }
640                    });
641                    tarteaucitron.addClickEventToId("tarteaucitronCloseAlert", function () {
642                        tarteaucitron.userInterface.openPanel();
643                    });
644                    tarteaucitron.addClickEventToId("tarteaucitronCTAButton", function () {
645                        location.reload();
646                    });
647                    var toggleBtns = document.getElementsByClassName("catToggleBtn"), i;
648                    for (i = 0; i < toggleBtns.length; i++) {
649                        toggleBtns[i].dataset.index = i;
650                        tarteaucitron.addClickEventToElement(toggleBtns[i], function () {
651                            tarteaucitron.userInterface.toggle('tarteaucitronDetails' + cat[this.dataset.index], 'tarteaucitronInfoBox');
652                            return false;
653                        });
654                    }
655
656                    var allowBtns = document.getElementsByClassName("tarteaucitronAllow");
657                    for (i = 0; i < allowBtns.length; i++) {
658                        tarteaucitron.addClickEventToElement(allowBtns[i], function () {
659                            tarteaucitron.userInterface.respond(this, true);
660                        });
661                    }
662                    var denyBtns = document.getElementsByClassName("tarteaucitronDeny");
663                    for (i = 0; i < denyBtns.length; i++) {
664                        tarteaucitron.addClickEventToElement(denyBtns[i], function () {
665                            tarteaucitron.userInterface.respond(this, false);
666                        });
667                    }
668                }, 500);
669                
670            });
671        });
672
673        if(tarteaucitron.events.load) {
674            tarteaucitron.events.load();
675        }
676    },
677    "addService": function (serviceId) {
678        "use strict";
679        var html = '',
680            s = tarteaucitron.services,
681            service = s[serviceId],
682            cookie = tarteaucitron.cookie.read(),
683            hostname = document.location.hostname,
684            hostRef = document.referrer.split('/')[2],
685            isNavigating = (hostRef === hostname && window.location.href !== tarteaucitron.parameters.privacyUrl),
686            isAutostart = (!service.needConsent),
687            isWaiting = (cookie.indexOf(service.key + '=wait') >= 0),
688            isDenied = (cookie.indexOf(service.key + '=false') >= 0),
689            isAllowed = ((cookie.indexOf(service.key + '=true') >= 0) || (!service.needConsent && cookie.indexOf(service.key + '=false') < 0)),
690            isResponded = (cookie.indexOf(service.key + '=false') >= 0 || cookie.indexOf(service.key + '=true') >= 0),
691            isDNTRequested = (navigator.doNotTrack === "1" || navigator.doNotTrack === "yes" || navigator.msDoNotTrack === "1" || window.doNotTrack === "1");
692
693        if (tarteaucitron.added[service.key] !== true) {
694            tarteaucitron.added[service.key] = true;
695
696            html += '<li id="' + service.key + 'Line" class="tarteaucitronLine">';
697            html += '   <div class="tarteaucitronName">';
698            html += '       <span class="tarteaucitronH3" role="heading" aria-level="3">' + service.name + '</span>';
699            html += '       <span id="tacCL' + service.key + '" class="tarteaucitronListCookies"></span><br/>';
700
701            if (tarteaucitron.parameters.moreInfoLink == true) {
702
703                var link = 'https://tarteaucitron.io/service/' + service.key + '/';
704                if (service.readmoreLink !== undefined && service.readmoreLink !== '') {
705                    link = service.readmoreLink;
706                }
707                if (tarteaucitron.parameters.readmoreLink !== undefined && tarteaucitron.parameters.readmoreLink !== '') {
708                    link = tarteaucitron.parameters.readmoreLink;
709                }
710                html += '       <a href="' + link + '" target="_blank" rel="noreferrer noopener nofollow" title="'+ tarteaucitron.lang.cookieDetail + ' ' + service.name + ' ' + tarteaucitron.lang.ourSite + ' ' + tarteaucitron.lang.newWindow +'">';
711                html += '           ' + tarteaucitron.lang.more;
712                html += '       </a>';
713                html += '        - ';
714                html += '       <a href="' + service.uri + '" target="_blank" rel="noreferrer noopener" title="' + service.name + ' ' + tarteaucitron.lang.newWindow + '">';
715                html += '           ' + tarteaucitron.lang.source;
716                html += '       </a>';
717            }
718
719            html += '   </div>';
720            html += '   <div class="tarteaucitronAsk">';
721            html += '       <button type="button" id="' + service.key + 'Allowed" class="tarteaucitronAllow">';
722            html += '           <span class="tarteaucitronCheck"></span> ' + tarteaucitron.lang.allow;
723            html += '       </button> ';
724            html += '       <button type="button" id="' + service.key + 'Denied" class="tarteaucitronDeny">';
725            html += '           <span class="tarteaucitronCross"></span> ' + tarteaucitron.lang.deny;
726            html += '       </button>';
727            html += '   </div>';
728            html += '</li>';
729
730            tarteaucitron.userInterface.css('tarteaucitronServicesTitle_' + service.type, 'display', 'block');
731
732            if (document.getElementById('tarteaucitronServices_' + service.type) !== null) {
733                document.getElementById('tarteaucitronServices_' + service.type).innerHTML += html;
734            }
735
736            tarteaucitron.userInterface.css('tarteaucitronNoServicesTitle', 'display', 'none');
737
738            tarteaucitron.userInterface.order(service.type);
739
740            tarteaucitron.addClickEventToId(service.key + 'Allowed', function () {
741                tarteaucitron.userInterface.respond(this, true);
742            });
743
744            tarteaucitron.addClickEventToId(service.key + 'Denied', function () {
745                tarteaucitron.userInterface.respond(this, false);
746            });
747        }
748
749        tarteaucitron.pro('!' + service.key + '=' + isAllowed);
750
751        // allow by default for non EU
752        if (isResponded === false && tarteaucitron.user.bypass === true) {
753            isAllowed = true;
754            tarteaucitron.cookie.create(service.key, true);
755        }
756
757        if ((!isResponded && (isAutostart || (isNavigating && isWaiting)) && !tarteaucitron.highPrivacy) || isAllowed) {
758            if (!isAllowed || (!service.needConsent && cookie.indexOf(service.key + '=false') < 0)) {
759                tarteaucitron.cookie.create(service.key, true);
760            }
761            if (tarteaucitron.launch[service.key] !== true) {
762                tarteaucitron.launch[service.key] = true;
763                if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + service.key + "_") < 0) { service.js(); }
764                tarteaucitron.sendEvent(service.key + '_loaded');
765            }
766            tarteaucitron.state[service.key] = true;
767            tarteaucitron.userInterface.color(service.key, true);
768        } else if (isDenied) {
769            if (typeof service.fallback === 'function') {
770                if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + service.key + "_") < 0) { service.fallback(); }
771            }
772            tarteaucitron.state[service.key] = false;
773            tarteaucitron.userInterface.color(service.key, false);
774        } else if (!isResponded && isDNTRequested && tarteaucitron.handleBrowserDNTRequest) {
775            tarteaucitron.cookie.create(service.key, 'false');
776            if (typeof service.fallback === 'function') {
777                if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + service.key + "_") < 0) { service.fallback(); }
778            }
779            tarteaucitron.state[service.key] = false;
780            tarteaucitron.userInterface.color(service.key, false);
781        } else if (!isResponded) {
782            tarteaucitron.cookie.create(service.key, 'wait');
783            if (typeof service.fallback === 'function') {
784                if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + service.key + "_") < 0) { service.fallback(); }
785            }
786            tarteaucitron.userInterface.color(service.key, 'wait');
787            tarteaucitron.userInterface.openAlert();
788        }
789
790        tarteaucitron.cookie.checkCount(service.key);
791        tarteaucitron.sendEvent(service.key + '_added')
792    },
793    "sendEvent" : function(event_key) {
794        if(event_key !== undefined) {
795            //ie compatibility
796            var send_event_item;
797            if(typeof(Event) === 'function') {
798                send_event_item = new Event(event_key);
799            }else{
800                send_event_item = document.createEvent('Event');
801                send_event_item.initEvent(event_key, true, true);
802            }
803            //end ie compatibility
804
805            document.dispatchEvent(send_event_item);
806        }
807    },
808    "cleanArray": function cleanArray(arr) {
809        "use strict";
810        var i,
811            len = arr.length,
812            out = [],
813            obj = {},
814            s = tarteaucitron.services;
815
816        for (i = 0; i < len; i += 1) {
817            if (!obj[arr[i]]) {
818                obj[arr[i]] = {};
819                if (tarteaucitron.services[arr[i]] !== undefined) {
820                    out.push(arr[i]);
821                }
822            }
823        }
824
825        out = out.sort(function (a, b) {
826            if (s[a].type + s[a].key > s[b].type + s[b].key) { return 1; }
827            if (s[a].type + s[a].key < s[b].type + s[b].key) { return -1; }
828            return 0;
829        });
830
831        return out;
832    },
833    "userInterface": {
834        "css": function (id, property, value) {
835            "use strict";
836            if (document.getElementById(id) !== null) {
837
838                if (property == "display" && value == "none" && (id == "tarteaucitron" || id == "tarteaucitronBack" || id == "tarteaucitronAlertBig")) {
839                    document.getElementById(id).style["opacity"] = "0";
840
841                    setTimeout(function() {document.getElementById(id).style[property] = value;}, 200);
842                } else {
843
844                    document.getElementById(id).style[property] = value;
845                    
846                    if (property == "display" && value == "block" && (id == "tarteaucitron" || id == "tarteaucitronAlertBig")) {
847                        document.getElementById(id).style["opacity"] = "0";
848                        setTimeout(function() {document.getElementById(id).style["opacity"] = "1";}, 1);
849                    }
850                    
851                    if (property == "display" && value == "block" && id == "tarteaucitronBack") {
852                        document.getElementById(id).style["opacity"] = "0";
853                        setTimeout(function() {document.getElementById(id).style["opacity"] = "0.7";}, 1);
854                    }
855                }
856            }
857        },
858        "addClass": function (id, className) {
859            "use strict";
860            if (document.getElementById(id) !== null) {
861                document.getElementById(id).classList.add(className);
862            }
863        },
864        "removeClass": function (id, className) {
865            "use strict";
866            if (document.getElementById(id) !== null) {
867                document.getElementById(id).classList.remove(className);
868            }
869        },
870        "respondAll": function (status) {
871            "use strict";
872            var s = tarteaucitron.services,
873                service,
874                key,
875                index = 0;
876
877            for (index = 0; index < tarteaucitron.job.length; index += 1) {
878                service = s[tarteaucitron.job[index]];
879                key = service.key;
880                if (tarteaucitron.state[key] !== status) {
881                    if (status === false && tarteaucitron.launch[key] === true) {
882                        tarteaucitron.reloadThePage = true;
883                    }
884                    if (tarteaucitron.launch[key] !== true && status === true) {
885
886                        tarteaucitron.pro('!' + key + '=engage');
887
888                        tarteaucitron.launch[key] = true;
889                        if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + key + "_") < 0) { tarteaucitron.services[key].js(); }
890                        tarteaucitron.sendEvent(key + '_loaded');
891                    }
892                    tarteaucitron.state[key] = status;
893                    tarteaucitron.cookie.create(key, status);
894                    tarteaucitron.userInterface.color(key, status);
895                }
896            }
897        },
898        "respond": function (el, status) {
899            "use strict";
900            if (el.id === '') {
901                return;
902            }
903            var key = el.id.replace(new RegExp("(Eng[0-9]+|Allow|Deni)ed", "g"), '');
904
905            if (key.substring(0, 13) === 'tarteaucitron' || key === '') {return;}
906
907            // return if same state
908            if (tarteaucitron.state[key] === status) {
909                return;
910            }
911
912            if (status === false && tarteaucitron.launch[key] === true) {
913                tarteaucitron.reloadThePage = true;
914            }
915
916            // if not already launched... launch the service
917            if (status === true) {
918                if (tarteaucitron.launch[key] !== true) {
919
920                    tarteaucitron.pro('!' + key + '=engage');
921
922                    tarteaucitron.launch[key] = true;
923                    tarteaucitron.sendEvent(key + '_loaded');
924                    if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + key + "_") < 0) { tarteaucitron.services[key].js(); }
925                }
926            }
927            tarteaucitron.state[key] = status;
928            tarteaucitron.cookie.create(key, status);
929            tarteaucitron.userInterface.color(key, status);
930        },
931        "color": function (key, status) {
932            "use strict";
933            var c = 'tarteaucitron',
934                nbDenied = 0,
935                nbPending = 0,
936                nbAllowed = 0,
937                sum = tarteaucitron.job.length,
938                index;
939
940            if (status === true) {
941                document.getElementById(key + 'Line').classList.add('tarteaucitronIsAllowed');
942                document.getElementById(key + 'Line').classList.remove('tarteaucitronIsDenied');
943            } else if (status === false) {
944                document.getElementById(key + 'Line').classList.remove('tarteaucitronIsAllowed');
945                document.getElementById(key + 'Line').classList.add('tarteaucitronIsDenied');
946            }
947
948            // check if all services are allowed
949            for (index = 0; index < sum; index += 1) {
950                if (tarteaucitron.state[tarteaucitron.job[index]] === false) {
951                    nbDenied += 1;
952                } else if (tarteaucitron.state[tarteaucitron.job[index]] === undefined) {
953                    nbPending += 1;
954                } else if (tarteaucitron.state[tarteaucitron.job[index]] === true) {
955                    nbAllowed += 1;
956                }
957            }
958
959            tarteaucitron.userInterface.css(c + 'DotGreen', 'width', ((100 / sum) * nbAllowed) + '%');
960            tarteaucitron.userInterface.css(c + 'DotYellow', 'width', ((100 / sum) * nbPending) + '%');
961            tarteaucitron.userInterface.css(c + 'DotRed', 'width', ((100 / sum) * nbDenied) + '%');
962
963            if (nbDenied === 0 && nbPending === 0) {
964                tarteaucitron.userInterface.removeClass(c + 'AllDenied', c + 'IsSelected');
965                tarteaucitron.userInterface.addClass(c + 'AllAllowed', c + 'IsSelected');
966
967                tarteaucitron.userInterface.addClass(c + 'MainLineOffset', c + 'IsAllowed');
968                tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsDenied');
969            } else if (nbAllowed === 0 && nbPending === 0) {
970                tarteaucitron.userInterface.removeClass(c + 'AllAllowed', c + 'IsSelected');
971                tarteaucitron.userInterface.addClass(c + 'AllDenied', c + 'IsSelected');
972
973                tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsAllowed');
974                tarteaucitron.userInterface.addClass(c + 'MainLineOffset', c + 'IsDenied');
975            } else {
976                tarteaucitron.userInterface.removeClass(c + 'AllAllowed', c + 'IsSelected');
977                tarteaucitron.userInterface.removeClass(c + 'AllDenied', c + 'IsSelected');
978
979                tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsAllowed');
980                tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsDenied');
981            }
982
983            // close the alert if all service have been reviewed
984            if (nbPending === 0) {
985                tarteaucitron.userInterface.closeAlert();
986            }
987
988            if (tarteaucitron.services[key].cookies.length > 0 && status === false) {
989                tarteaucitron.cookie.purge(tarteaucitron.services[key].cookies);
990            }
991
992            if (status === true) {
993                if (document.getElementById('tacCL' + key) !== null) {
994                    document.getElementById('tacCL' + key).innerHTML = '...';
995                }
996                setTimeout(function () {
997                    tarteaucitron.cookie.checkCount(key);
998                }, 2500);
999            } else {
1000                tarteaucitron.cookie.checkCount(key);
1001            }
1002        },
1003        "openPanel": function () {
1004            "use strict";
1005
1006            tarteaucitron.userInterface.css('tarteaucitron', 'display', 'block');
1007            tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block');
1008            tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none');
1009
1010            document.getElementById('tarteaucitronClosePanel').focus();
1011            document.getElementsByTagName('body')[0].classList.add('modal-open');
1012            tarteaucitron.userInterface.focusTrap();
1013            tarteaucitron.userInterface.jsSizing('main');
1014
1015            //ie compatibility
1016            var tacOpenPanelEvent;
1017            if(typeof(Event) === 'function') {
1018                tacOpenPanelEvent = new Event("tac.open_panel");
1019            }else{
1020                tacOpenPanelEvent = document.createEvent('Event');
1021                tacOpenPanelEvent.initEvent("tac.open_panel", true, true);
1022            }
1023            //end ie compatibility
1024
1025            window.dispatchEvent(tacOpenPanelEvent);
1026        },
1027        "closePanel": function () {
1028            "use strict";
1029
1030            if (document.location.hash === tarteaucitron.hashtag) {
1031                if (window.history) {
1032                    window.history.replaceState('', document.title, window.location.pathname + window.location.search);
1033                } else {
1034                    document.location.hash = '';
1035                }
1036            }
1037            tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none');
1038            tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none');
1039
1040            tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) {
1041                elem.style.display = 'none';
1042            }, true);
1043
1044            if (tarteaucitron.reloadThePage === true) {
1045                window.location.reload();
1046            } else {
1047                tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none');
1048            }
1049            if (document.getElementById('tarteaucitronCloseAlert') !== null) {
1050                document.getElementById('tarteaucitronCloseAlert').focus();
1051            }
1052            document.getElementsByTagName('body')[0].classList.remove('modal-open');
1053
1054            //ie compatibility
1055            var tacClosePanelEvent;
1056            if(typeof(Event) === 'function') {
1057                tacClosePanelEvent = new Event("tac.close_panel");
1058            }else{
1059                tacClosePanelEvent = document.createEvent('Event');
1060                tacClosePanelEvent.initEvent("tac.close_panel", true, true);
1061            }
1062            //end ie compatibility
1063
1064            window.dispatchEvent(tacClosePanelEvent);
1065        },
1066        "focusTrap": function() {
1067            "use strict";
1068
1069            var focusableEls,
1070                firstFocusableEl,
1071                lastFocusableEl,
1072                filtered;
1073
1074            focusableEls = document.getElementById('tarteaucitron').querySelectorAll('a[href], button');
1075            filtered = [];
1076
1077            // get only visible items
vendor: 5,899 bytes, lines 1078-1214
1078            for (var i = 0, max = focusableEls.length; i < max; i++) {
1079                if (focusableEls[i].offsetHeight > 0) {
1080                   filtered.push(focusableEls[i]);
1081                }
1082            }
1083
1084            firstFocusableEl = filtered[0];
1085            lastFocusableEl = filtered[filtered.length - 1];
1086
1087            //loop focus inside tarteaucitron
1088            document.getElementById('tarteaucitron').addEventListener("keydown", function (evt) {
1089
1090                if ( evt.key === 'Tab' || evt.keyCode === 9 ) {
1091
1092                    if ( evt.shiftKey ) /* shift + tab */ {
1093                        if (document.activeElement === firstFocusableEl) {
1094                            lastFocusableEl.focus();
1095                            evt.preventDefault();
1096                        }
1097                    } else /* tab */ {
1098                        if (document.activeElement === lastFocusableEl) {
1099                            firstFocusableEl.focus();
1100                            evt.preventDefault();
1101                        }
1102                    }
1103                }
1104            })
1105        },
1106        "openAlert": function () {
1107            "use strict";
1108            var c = 'tarteaucitron';
1109            tarteaucitron.userInterface.css(c + 'Percentage', 'display', 'block');
1110            tarteaucitron.userInterface.css(c + 'AlertSmall', 'display', 'none');
1111            tarteaucitron.userInterface.css(c + 'Icon', 'display', 'none');
1112            tarteaucitron.userInterface.css(c + 'AlertBig',   'display', 'block');
1113            tarteaucitron.userInterface.addClass(c + 'Root',   'tarteaucitronBeforeVisible');
1114
1115            //ie compatibility
1116            var tacOpenAlertEvent;
1117            if(typeof(Event) === 'function') {
1118                tacOpenAlertEvent = new Event("tac.open_alert");
1119            }else{
1120                tacOpenAlertEvent = document.createEvent('Event');
1121                tacOpenAlertEvent.initEvent("tac.open_alert", true, true);
1122            }
1123            //end ie compatibility
1124
1125            window.dispatchEvent(tacOpenAlertEvent);
1126        },
1127        "closeAlert": function () {
1128            "use strict";
1129            var c = 'tarteaucitron';
1130            tarteaucitron.userInterface.css(c + 'Percentage', 'display', 'none');
1131            tarteaucitron.userInterface.css(c + 'AlertSmall', 'display', 'block');
1132            tarteaucitron.userInterface.css(c + 'Icon', 'display', 'block');
1133            tarteaucitron.userInterface.css(c + 'AlertBig',   'display', 'none');
1134            tarteaucitron.userInterface.removeClass(c + 'Root',   'tarteaucitronBeforeVisible');
1135            tarteaucitron.userInterface.jsSizing('box');
1136
1137            //ie compatibility
1138            var tacCloseAlertEvent;
1139            if(typeof(Event) === 'function') {
1140                tacCloseAlertEvent = new Event("tac.close_alert");
1141            }else{
1142                tacCloseAlertEvent = document.createEvent('Event');
1143                tacCloseAlertEvent.initEvent("tac.close_alert", true, true);
1144            }
1145            //end ie compatibility
1146
1147            window.dispatchEvent(tacCloseAlertEvent);
1148        },
1149        "toggleCookiesList": function () {
1150            "use strict";
1151            var div = document.getElementById('tarteaucitronCookiesListContainer');
1152
1153            if (div === null) {
1154                return;
1155            }
1156
1157            if (div.style.display !== 'block') {
1158                tarteaucitron.cookie.number();
1159                div.style.display = 'block';
1160                tarteaucitron.userInterface.jsSizing('cookie');
1161                tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none');
1162                tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block');
1163                tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) {
1164                    elem.style.display = 'none';
1165                }, true);
1166            } else {
1167                div.style.display = 'none';
1168                tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none');
1169                tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none');
1170            }
1171        },
1172        "toggle": function (id, closeClass) {
1173            "use strict";
1174            var div = document.getElementById(id);
1175
1176            if (div === null) {
1177                return;
1178            }
1179
1180            if (closeClass !== undefined) {
1181                tarteaucitron.fallback([closeClass], function (elem) {
1182                    if (elem.id !== id) {
1183                        elem.style.display = 'none';
1184                    }
1185                }, true);
1186            }
1187
1188            if (div.style.display !== 'block') {
1189                div.style.display = 'block';
1190            } else {
1191                div.style.display = 'none';
1192            }
1193        },
1194        "order": function (id) {
1195            "use strict";
1196            var main = document.getElementById('tarteaucitronServices_' + id),
1197                allDivs,
1198                store = [],
1199                i;
1200
1201            if (main === null) {
1202                return;
1203            }
1204
1205            allDivs = main.childNodes;
1206
1207            if (typeof Array.prototype.map === 'function' && typeof Enumerable === 'undefined') {
1208                Array.prototype.map.call(main.children, Object).sort(function (a, b) {
1209                //var mainChildren = Array.from(main.children);
1210                //mainChildren.sort(function (a, b) {
1211                    if (tarteaucitron.services[a.id.replace(/Line/g, '')].name > tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return 1; }
1212                    if (tarteaucitron.services[a.id.replace(/Line/g, '')].name < tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return -1; }
1213                    return 0;
1214                }
1214).forEach(function (element) {
1215                    main.appendChild(element);
1216                });
1217            }
1218        },
1219        "jsSizing": function (type) {
1220            "use strict";
1221            var scrollbarMarginRight = 10,
1222                scrollbarWidthParent,
1223                scrollbarWidthChild,
1224                servicesHeight,
1225                e = window,
1226                a = 'inner',
1227                windowInnerHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight,
1228                mainTop,
1229                mainHeight,
1230                closeButtonHeight,
1231                headerHeight,
1232                cookiesListHeight,
1233                cookiesCloseHeight,
1234                cookiesTitleHeight,
1235                paddingBox,
1236                alertSmallHeight,
1237                cookiesNumberHeight;
1238
1239            if (type === 'box') {
1240                if (document.getElementById('tarteaucitronAlertSmall') !== null && document.getElementById('tarteaucitronCookiesNumber') !== null) {
1241
1242                    // reset
1243                    tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', '0px 10px');
1244
1245                    // calculate
1246                    alertSmallHeight = document.getElementById('tarteaucitronAlertSmall').offsetHeight;
1247                    cookiesNumberHeight = document.getElementById('tarteaucitronCookiesNumber').offsetHeight;
1248                    paddingBox = (alertSmallHeight - cookiesNumberHeight) / 2;
1249
1250                    // apply
1251                    tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', paddingBox + 'px 10px');
1252                }
1253            } else if (type === 'main') {
1254
1255                // get the real window width for media query
1256                if (window.innerWidth === undefined) {
1257                    a = 'client';
1258                    e = document.documentElement || document.body;
1259                }
1260
1261                // height of the services list container
1262                if (document.getElementById('tarteaucitron') !== null && document.getElementById('tarteaucitronClosePanel') !== null && document.getElementById('tarteaucitronMainLineOffset') !== null) {
1263
1264                    // reset
1265                    tarteaucitron.userInterface.css('tarteaucitronServices', 'height', 'auto');
1266
1267                    // calculate
1268                    mainHeight = document.getElementById('tarteaucitron').offsetHeight;
1269                    closeButtonHeight = document.getElementById('tarteaucitronClosePanel').offsetHeight;
1270
1271                    // apply
1272                    servicesHeight = (mainHeight - closeButtonHeight + 2);
1273                    tarteaucitron.userInterface.css('tarteaucitronServices', 'height', servicesHeight + 'px');
1274                    tarteaucitron.userInterface.css('tarteaucitronServices', 'overflow-x', 'auto');
1275                }
1276
1277                // align the main allow/deny button depending on scrollbar width
1278                if (document.getElementById('tarteaucitronServices') !== null && document.getElementById('tarteaucitronScrollbarChild') !== null) {
1279
1280                    // media query
1281                    if (e[a + 'Width'] <= 479) {
1282                        //tarteaucitron.userInterface.css('tarteaucitronScrollbarAdjust', 'marginLeft', '11px');
1283                    } else if (e[a + 'Width'] <= 767) {
1284                        scrollbarMarginRight = 12;
1285                    }
1286
1287                    scrollbarWidthParent = document.getElementById('tarteaucitronServices').offsetWidth;
1288                    scrollbarWidthChild = document.getElementById('tarteaucitronScrollbarChild').offsetWidth;
1289                    //tarteaucitron.userInterface.css('tarteaucitronScrollbarAdjust', 'marginRight', ((scrollbarWidthParent - scrollbarWidthChild) + scrollbarMarginRight) + 'px');
1290                }
1291
1292                // center the main panel
1293                if (document.getElementById('tarteaucitron') !== null) {
1294
1295                    // media query
1296                    if (e[a + 'Width'] <= 767) {
1297                        mainTop = 0;
1298                    } else {
1299                        mainTop = ((windowInnerHeight - document.getElementById('tarteaucitron').offsetHeight) / 2) - 21;
1300                    }
1301
1302                    if (document.getElementById('tarteaucitronMainLineOffset') !== null) {
1303                        if (document.getElementById('tarteaucitron').offsetHeight < (windowInnerHeight / 2)) {
1304                            mainTop -= document.getElementById('tarteaucitronMainLineOffset').offsetHeight;
1305                        }
1306                    }
1307
1308                    // correct
1309                    if (mainTop < 0) {
1310                        mainTop = 0;
1311                    }
1312
1313                    // apply
1314                    tarteaucitron.userInterface.css('tarteaucitron', 'top', mainTop + 'px');
1315                }
1316
1317
1318            } else if (type === 'cookie') {
1319
1320                // put cookies list at bottom
1321                if (document.getElementById('tarteaucitronAlertSmall') !== null) {
1322                    tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'bottom', (document.getElementById('tarteaucitronAlertSmall').offsetHeight) + 'px');
1323                }
1324
1325                // height of cookies list
1326                if (document.getElementById('tarteaucitronCookiesListContainer') !== null) {
1327
1328                    // reset
1329                    tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', 'auto');
1330
1331                    // calculate
1332                    cookiesListHeight = document.getElementById('tarteaucitronCookiesListContainer').offsetHeight;
1333                    cookiesCloseHeight = document.getElementById('tarteaucitronClosePanelCookie').offsetHeight;
1334                    cookiesTitleHeight = document.getElementById('tarteaucitronCookiesTitle').offsetHeight;
1335
1336                    // apply
1337                    tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', (cookie
vendor: 14,324 bytes, lines 1337-1658
1337sListHeight - cookiesCloseHeight - cookiesTitleHeight - 2) + 'px');
1338                }
1339            }
1340        }
1341    },
1342    "cookie": {
1343        "owner": {},
1344        "create": function (key, status) {
1345            "use strict";
1346
1347            if (tarteaucitronForceExpire !== '') {
1348                // The number of day(s)/hour(s) can't be higher than 1 year
1349                if ((tarteaucitronExpireInDay && tarteaucitronForceExpire < 365) || (!tarteaucitronExpireInDay && tarteaucitronForceExpire < 8760)) {
1350                    if (tarteaucitronExpireInDay) {
1351                        // Multiplication to tranform the number of days to milliseconds
1352                        timeExpire = tarteaucitronForceExpire * 86400000;
1353                    } else {
1354                        // Multiplication to tranform the number of hours to milliseconds
1355                        timeExpire = tarteaucitronForceExpire * 3600000;
1356                    }
1357                }
1358            }
1359
1360            var d = new Date(),
1361                time = d.getTime(),
1362                expireTime = time + timeExpire, // 365 days
1363                regex = new RegExp("!" + key + "=(wait|true|false)", "g"),
1364                cookie = tarteaucitron.cookie.read().replace(regex, ""),
1365                value = tarteaucitron.parameters.cookieName + '=' + cookie + '!' + key + '=' + status,
1366                domain = (tarteaucitron.parameters.cookieDomain !== undefined && tarteaucitron.parameters.cookieDomain !== '') ? '; domain=' + tarteaucitron.parameters.cookieDomain : '',
1367                secure = location.protocol === 'https:' ? '; Secure' : '';
1368
1369            d.setTime(expireTime);
1370            document.cookie = value + '; expires=' + d.toGMTString() + '; path=/' + domain + secure + '; samesite=lax';
1371        },
1372        "read": function () {
1373            "use strict";
1374            var nameEQ = tarteaucitron.parameters.cookieName + "=",
1375                ca = document.cookie.split(';'),
1376                i,
1377                c;
1378
1379            for (i = 0; i < ca.length; i += 1) {
1380                c = ca[i];
1381                while (c.charAt(0) === ' ') {
1382                    c = c.substring(1, c.length);
1383                }
1384                if (c.indexOf(nameEQ) === 0) {
1385                    return c.substring(nameEQ.length, c.length);
1386                }
1387            }
1388            return '';
1389        },
1390        "purge": function (arr) {
1391            "use strict";
1392            var i;
1393
1394            for (i = 0; i < arr.length; i += 1) {
1395                document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/;';
1396                document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname + ';';
1397                document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname.split('.').slice(-2).join('.') + ';';
1398            }
1399        },
1400        "checkCount": function (key) {
1401            "use strict";
1402            var arr = tarteaucitron.services[key].cookies,
1403                nb = arr.length,
1404                nbCurrent = 0,
1405                html = '',
1406                i,
1407                status = document.cookie.indexOf(key + '=true');
1408
1409            if (status >= 0 && nb === 0) {
1410                html += tarteaucitron.lang.useNoCookie;
1411            } else if (status >= 0) {
1412                for (i = 0; i < nb; i += 1) {
1413                    if (document.cookie.indexOf(arr[i] + '=') !== -1) {
1414                        nbCurrent += 1;
1415                        if (tarteaucitron.cookie.owner[arr[i]] === undefined) {
1416                            tarteaucitron.cookie.owner[arr[i]] = [];
1417                        }
1418                        if (tarteaucitron.cookie.crossIndexOf(tarteaucitron.cookie.owner[arr[i]], tarteaucitron.services[key].name) === false) {
1419                            tarteaucitron.cookie.owner[arr[i]].push(tarteaucitron.services[key].name);
1420                        }
1421                    }
1422                }
1423
1424                if (nbCurrent > 0) {
1425                    html += tarteaucitron.lang.useCookieCurrent + ' ' + nbCurrent + ' cookie';
1426                    if (nbCurrent > 1) {
1427                        html += 's';
1428                    }
1429                    html += '.';
1430                } else {
1431                    html += tarteaucitron.lang.useNoCookie;
1432                }
1433            } else if (nb === 0) {
1434                html = tarteaucitron.lang.noCookie;
1435            } else {
1436                html += tarteaucitron.lang.useCookie + ' ' + nb + ' cookie';
1437                if (nb > 1) {
1438                    html += 's';
1439                }
1440                html += '.';
1441            }
1442
1443            if (document.getElementById('tacCL' + key) !== null) {
1444                document.getElementById('tacCL' + key).innerHTML = html;
1445            }
1446        },
1447        "crossIndexOf": function (arr, match) {
1448            "use strict";
1449            var i;
1450            for (i = 0; i < arr.length; i += 1) {
1451                if (arr[i] === match) {
1452                    return true;
1453                }
1454            }
1455            return false;
1456        },
1457        "number": function () {
1458            "use strict";
1459            var cookies = document.cookie.split(';'),
1460                nb = (document.cookie !== '') ? cookies.length : 0,
1461                html = '',
1462                i,
1463                name,
1464                namea,
1465                nameb,
1466                c,
1467                d,
1468                s = (nb > 1) ? 's' : '',
1469                savedname,
1470                regex = /^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i,
1471                regexedDomain = (tarteaucitron.cdn.match(regex) !== null) ? tarteaucitron.cdn.match(regex)[1] : tarteaucitron.cdn,
1472                host = (tarteaucitron.domain !== undefined) ? tarteaucitron.domain : regexedDomain;
1473
1474            cookies = cookies.sort(function (a, b) {
1475                namea = a.split('=', 1).toString().replace(/ /g, '');
1476                nameb = b.split('=', 1).toString().replace(/ /g, '');
1477                c = (tarteaucitron.cookie.owner[namea] !== undefined) ? tarteaucitron.cookie.owner[namea] : '0';
1478                d = (tarteaucitron.cookie.owner[nameb] !== undefined) ? tarteaucitron.cookie.owner[nameb] : '0';
1479                if (c + a > d + b) { return 1; }
1480                if (c + a < d + b) { return -1; }
1481                return 0;
1482            });
1483
1484            if (document.cookie !== '') {
1485                for (i = 0; i < nb; i += 1) {
1486                    name = cookies[i].split('=', 1).toString().replace(/ /g, '');
1487                    if (tarteaucitron.cookie.owner[name] !== undefined && tarteaucitron.cookie.owner[name].join(' // ') !== savedname) {
1488                        savedname = tarteaucitron.cookie.owner[name].join(' // ');
1489                        html += '<div class="tarteaucitronHidden">';
1490                        html += '     <span class="tarteaucitronTitle tarteaucitronH3" role="heading" aria-level="3">';
1491                        html += '        ' + tarteaucitron.cookie.owner[name].join(' // ');
1492                        html += '    </span>';
1493                        html += '</div><ul class="cookie-list">';
1494                    } else if (tarteaucitron.cookie.owner[name] === undefined && host !== savedname) {
1495                        savedname = host;
1496                        html += '<div class="tarteaucitronHidden">';
1497                        html += '     <span class="tarteaucitronTitle tarteaucitronH3" role="heading" aria-level="3">';
1498                        html += '        ' + host;
1499                        html += '    </span>';
1500                        html += '</div><ul class="cookie-list">';
1501                    }
1502                    html += '<li class="tarteaucitronCookiesListMain">';
1503                    html += '    <div class="tarteaucitronCookiesListLeft"><button type="button" class="purgeBtn" data-cookie="' + tarteaucitron.fixSelfXSS(cookies[i].split('=', 1)) + '"><strong>&times;</strong></button> <strong>' + tarteaucitron.fixSelfXSS(name) + '</strong>';
1504                    html += '    </div>';
1505                    html += '    <div class="tarteaucitronCookiesListRight">' + tarteaucitron.fixSelfXSS(cookies[i].split('=').slice(1).join('=')) + '</div>';
1506                    html += '</li>';
1507                }
1508                html += '</ul>';
1509            } else {
1510                html += '<div class="tarteaucitronCookiesListMain">';
1511                html += '    <div class="tarteaucitronCookiesListLeft"><strong>-</strong></div>';
1512                html += '    <div class="tarteaucitronCookiesListRight"></div>';
1513                html += '</div>';
1514            }
1515
1516            html += '<div class="tarteaucitronHidden spacer-20"></div>';
1517
1518            if (document.getElementById('tarteaucitronCookiesList') !== null) {
1519                document.getElementById('tarteaucitronCookiesList').innerHTML = html;
1520            }
1521
1522            if (document.getElementById('tarteaucitronCookiesNumber') !== null) {
1523                document.getElementById('tarteaucitronCookiesNumber').innerHTML = nb;
1524            }
1525
1526            if (document.getElementById('tarteaucitronCookiesNumberBis') !== null) {
1527                document.getElementById('tarteaucitronCookiesNumberBis').innerHTML = nb + ' cookie' + s;
1528            }
1529
1530            var purgeBtns = document.getElementsByClassName("purgeBtn");
1531            for (i = 0; i < purgeBtns.length; i++) {
1532                tarteaucitron.addClickEventToElement(purgeBtns[i], function () {
1533                    tarteaucitron.cookie.purge([this.dataset.cookie]);
1534                    tarteaucitron.cookie.number();
1535                    tarteaucitron.userInterface.jsSizing('cookie');
1536                    return false;
1537                });
1538            }
1539
1540            for (i = 0; i < tarteaucitron.job.length; i += 1) {
1541                tarteaucitron.cookie.checkCount(tarteaucitron.job[i]);
1542            }
1543        }
1544    },
1545    "fixSelfXSS": function(html) {
1546        fixed = html.toString().replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
1547        return fixed;
1548    },
1549    "getLanguage": function () {
1550        "use strict";
1551
1552        var availableLanguages = 'bg,ca,cn,cs,da,de,el,en,es,fi,fr,hu,it,ja,lv,nl,no,oc,pl,pt,ro,ru,se,sk,sv,tr,vi,zh',
1553            defaultLanguage = 'en';
1554
1555        if (tarteaucitronForceLanguage !== '') {
1556            if (availableLanguages.indexOf(tarteaucitronForceLanguage) !== -1) {
1557                return tarteaucitronForceLanguage;
1558            }
1559        }
1560
1561        if (!navigator) { return 'en'; }
1562
1563        var lang = navigator.language || navigator.browserLanguage ||
1564                navigator.systemLanguage || navigator.userLang || null,
1565            userLanguage = lang ? lang.substr(0, 2) : null;
1566
1567        if (availableLanguages.indexOf(userLanguage) === -1) {
1568            return defaultLanguage;
1569        }
1570        return userLanguage;
1571    },
1572    "getLocale": function () {
1573        "use strict";
1574        if (!navigator) { return 'en_US'; }
1575
1576        var lang = navigator.language || navigator.browserLanguage ||
1577                navigator.systemLanguage || navigator.userLang || null,
1578            userLanguage = lang ? lang.substr(0, 2) : null;
1579
1580        if (userLanguage === 'fr') {
1581            return 'fr_FR';
1582        } else if (userLanguage === 'en') {
1583            return 'en_US';
1584        } else if (userLanguage === 'de') {
1585            return 'de_DE';
1586        } else if (userLanguage === 'es') {
1587            return 'es_ES';
1588        } else if (userLanguage === 'it') {
1589            return 'it_IT';
1590        } else if (userLanguage === 'pt') {
1591            return 'pt_PT';
1592        } else if (userLanguage === 'nl') {
1593            return 'nl_NL';
1594        } else if (userLanguage === 'el') {
1595            return 'el_EL';
1596        } else {
1597            return 'en_US';
1598        }
1599    },
1600    "addScript": function (url, id, callback, execute, attrName, attrVal, internal) {
1601        "use strict";
1602        var script,
1603            done = false;
1604
1605        if (execute === false) {
1606            if (typeof callback === 'function') {
1607                callback();
1608            }
1609        } else {
1610            script = document.createElement('script');
1611            script.type = 'text/javascript';
1612            script.id = (id !== undefined) ? id : '';
1613            script.async = true;
1614            script.src = url;
1615
1616            if (attrName !== undefined && attrVal !== undefined) {
1617                script.setAttribute(attrName, attrVal);
1618            }
1619
1620            if (typeof callback === 'function') {
1621                if ( !tarteaucitron.parameters.useExternalJs || !internal ) {
1622                    script.onreadystatechange = script.onload = function () {
1623                        var state = script.readyState;
1624                        if (!done && (!state || /loaded|complete/.test(state))) {
1625                            done = true;
1626                            callback();
1627                        }
1628                    };
1629                } else {
1630                    callback();
1631                }
1632            }
1633
1634            if ( !tarteaucitron.parameters.useExternalJs || !internal ) {
1635                document.getElementsByTagName('head')[0].appendChild(script);
1636            }
1637        }
1638    },
1639    "addInternalScript": function (url, id, callback, execute, attrName, attrVal) {
1640        tarteaucitron.addScript(url, id, callback, execute, attrName, attrVal, true);
1641    },
1642    "makeAsync": {
1643        "antiGhost": 0,
1644        "buffer": '',
1645        "init": function (url, id) {
1646            "use strict";
1647            var savedWrite = document.write,
1648                savedWriteln = document.writeln;
1649
1650            document.write = function (content) {
1651                tarteaucitron.makeAsync.buffer += content;
1652            };
1653            document.writeln = function (content) {
1654                tarteaucitron.makeAsync.buffer += content.concat("\n");
1655            };
1656
1657            setTimeout(function () {
1658                document.write = savedWrite;
1659                document.writeln = savedWriteln;
1660            }, 20000);
1661
1662            tarteaucitron.makeAsync.getAndParse(url, id);
1663        },
1664        "getAndParse": function (url, id) {
1665            "use strict";
1666            if (tarteaucitron.makeAsync.antiGhost > 9) {
1667                tarteaucitron.makeAsync.antiGhost = 0;
1668                return;
1669            }
1670            tarteaucitron.makeAsync.antiGhost += 1;
1671            tarteaucitron.addInternalScript(url, '', function () {
1672                if (document.getElementById(id) !== null) {
1673                    document.getElementById(id).innerHTML += "<span class='display-none'>&nbsp;</span>" + tarteaucitron.makeAsync.buffer;
1674                    tarteaucitron.makeAsync.buffer = '';
1675                    tarteaucitron.makeAsync.execJS(id);
1676                }
1677            });
1678        },
1679        "execJS": function (id) {
1680            /* not strict because third party scripts may have errors */
1681            var i,
1682                scripts,
1683                childId,
1684                type;
1685
1686            if (document.getElementById(id) === null) {
1687                return;
1688            }
1689
1690            scripts = document.getElementById(id).getElementsByTagName('script');
1691            for (i = 0; i < scripts.length; i += 1) {
1692                type = (scripts[i].getAttribute('type') !== null) ? scripts[i].getAttribute('type') : '';
1693                if (type === '') {
1694                    type = (scripts[i].getAttribute('language') !== null) ? scripts[i].getAttribute('language') : '';
1695                }
1696                if (scripts[i].getAttribute('src') !== null && scripts[i].getAttribute('src') !== '') {
1697                    childId = id + Math.floor(Math.random() * 99999999999);
1698                    document.getElementById(id).innerHTML += '<div id="' + childId + '"></div>';
1699                    tarteaucitron.makeAsync.getAndParse(scripts[i].getAttribute('src'), childId);
1700                } else if (type.indexOf('javascript') !== -1 || type === '') {
1701                    eval(scripts[i].innerHTML);
1702                }
1703            }
1704        }
1705    },
1706    "fallback": function (matchClass, content, noInner) {
1707        "use strict";
1708        var elems = document.getElementsByTagName('*'),
1709            i,
1710            index = 0;
1711
1712        for (i in elems) {
1713            if (elems[i] !== undefined) {
1714                for (index = 0; index < matchClass.length; index += 1) {
1715                    if ((' ' + elems[i].className + ' ')
1716                            .indexOf(' ' + matchClass[index] + ' ') > -1) {
1717                        if (typeof content === 'function') {
1718                            if (noInner === true) {
1719                                content(elems[i]);
1720                            } else {
1721                                elems[i].innerHTML = content(elems[i]);
1722                            }
1723                        } else {
1724                            elems[i].innerHTML = content;
1725                        }
1726                    }
1727                }
1728            }
1729        }
1730    },
1731    "engage": function (id) {
1732        "use strict";
1733        var html = '',
1734            r = Math.floor(Math.random() * 100000),
1735            engage = tarteaucitron.services[id].name + ' ' + tarteaucitron.lang.fallback;
1736
1737        if (tarteaucitron.lang['engage-' + id] !== undefined) {
1738            engage = tarteaucitron.lang['engage-' + id];
1739        }
1740
1741        html += '<div class="tac_activate tac_activate_' + id + '">';
1742        html += '   <div class="tac_float">';
1743        html += '      ' + engage;
1744        html += '      <button type="button" class="tarteaucitronAllow" id="Eng' + r + 'ed' + id + '">';
1745        html += '          <span class="tarteaucitronCheck"></span> ' + tarteaucitron.lang.allow;
1746        html += '       </button>';
1747        html += '   </div>';
1748        html += '</div>';
1749
1750        return html;
1751    },
1752    "extend": function (a, b) {
1753        "use strict";
1754        var prop;
1755        for (prop in b) {
1756            if (b.hasOwnProperty(prop)) {
1757                a[prop] = b[prop];
1758            }
1759        }
1760    },
1761    "proTemp": '',
1762    "proTimer": function () {
1763        "use strict";
1764        setTimeout(tarteaucitron.proPing, 500);
1765    },
1766    "pro": function (list) {
1767        "use strict";
1768        tarteaucitron.proTemp += list;
1769        clearTimeout(tarteaucitron.proTimer);
1770        tarteaucitron.proTimer = setTimeout(tarteaucitron.proPing, 500);
1771    },
1772    "proPing": function () {
1773        "use strict";
1774        if (tarteaucitron.uuid !== '' && tarteaucitron.uuid !== undefined && tarteaucitron.proTemp !== '') {
1775            var div = document.getElementById('tarteaucitronPremium'),
1776                timestamp = new Date().getTime(),
1777                url = 'https://tarteaucitron.io/log/?';
1778
1779            if (div === null) {
1780                return;
1781            }
1782
1783            url += 'account=' + tarteaucitron.uuid + '&';
1784            url += 'domain=' + tarteaucitron.domain + '&';
1785            url += 'status=' + encodeURIComponent(tarteaucitron.proTemp) + '&';
1786            url += '_time=' + timestamp;
1787
1788            div.innerHTML = '<img src="' + url + '" class="display-none" alt="" />';
1789
1790            tarteaucitron.proTemp = '';
1791        }
1792
1793        tarteaucitron.cookie.number();
1794    },
1795    "AddOrUpdate" : function(source, custom){
1796        /**
1797         Utility function to Add or update the fields of obj1 with the ones in obj2
1798         */
1799        for(key in custom){
1800            if(custom[key] instanceof Object){
1801                source[key] = tarteaucitron.AddOrUpdate(source[key], custom[key]);
1802            }else{
1803                source[key] = custom[key];
1804            }
1805        }
1806        return source;
1807    },
1808    "getElemWidth": function(elem) {
1809        return elem.getAttribute('width') || elem.clientWidth;
1810    },
1811    "getElemHeight": function(elem) {
1812        return elem.getAttribute('height') || elem.clientHeight;
1813    },
1814    "addClickEventToId": function (elemId, func) {
1815        tarteaucitron.addClickEventToElement(document.getElementById(elemId), func);
1816    },
1817    "addClickEventToElement": function (e, func) {
1818        if (e) {
1819            if (e.addEventListener) {
1820                e.addEventListener("click", func);
1821            } else {
1822                e.attachEvent("onclick", func);
1823            }
1824        }
1825    }
1826};

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.