PageSourceSearch

https://www.viemaville.fr/tarteaucitron/tarteaucitron.js

js viemaville.fr collected 2026-10-04 03:32:04 UTC 138,591 bytes, 2,668 lines download raw bytes

vendor: 1,519 bytes, lines 1-25
1/*jslint browser: true, evil: true */
2/* min ready */
3
4var tarteaucitronScriptsDiscover = document.getElementsByTagName('script'),
5    tarteaucitronCurrentScript = document.currentScript instanceof HTMLScriptElement
6        ? document.currentScript
7        : tarteaucitronScriptsDiscover[tarteaucitronScriptsDiscover.length - 1],
8    tarteaucitronPath = tarteaucitronCurrentScript.src.split('?')[0],
9    tarteaucitronForceCDN = (tarteaucitronForceCDN === undefined) ? '' : tarteaucitronForceCDN,
10    tarteaucitronUseMin = (tarteaucitronUseMin === undefined) ? '' : tarteaucitronUseMin,
11    cdn = (tarteaucitronForceCDN === '') ? tarteaucitronPath.split('/').slice(0, -1).join('/') + '/' : tarteaucitronForceCDN,
12    alreadyLaunch = (alreadyLaunch === undefined) ? 0 : alreadyLaunch,
13    tarteaucitronForceLanguage = (tarteaucitronForceLanguage === undefined) ? '' : tarteaucitronForceLanguage,
14    tarteaucitronForceExpire = (tarteaucitronForceExpire === undefined) ? '' : tarteaucitronForceExpire,
15    tarteaucitronCustomText = (tarteaucitronCustomText === undefined) ? '' : tarteaucitronCustomText,
16    // tarteaucitronExpireInDay: true for day(s) value - false for hour(s) value
17    tarteaucitronExpireInDay = (tarteaucitronExpireInDay === undefined || typeof tarteaucitronExpireInDay !== "boolean") ? true : tarteaucitronExpireInDay,
18    timeExpire = 31536000000,
19    tarteaucitronProLoadServices,
20    tarteaucitronNoAdBlocker = false,
21    tarteaucitronIsLoaded = false;
22
23
24var tarteaucitron = {
25    "version": "1.34
vendor: 9,469 bytes, lines 25-252
25.0",
26    "cdn": cdn,
27    "user": {},
28    "lang": {},
29    "services": {},
30    "added": [],
31    "idprocessed": [],
32    "state": {},
33    "launch": [],
34    "parameters": {},
35    "isAjax": false,
36    "reloadThePage": false,
37    "events": {
38        "init": function () {},
39        "load": function () {},
40    },
41    "init": function (params) {
42        "use strict";
43        var origOpen;
44
45        tarteaucitron.parameters = params;
46        if (alreadyLaunch === 0) {
47            alreadyLaunch = 1;
48            if (window.addEventListener) {
49                if( document.readyState === "complete" ) {
50                    tarteaucitron.initEvents.loadEvent(false);
51                } else {
52                    window.addEventListener("load", function () {
53                        tarteaucitron.initEvents.loadEvent(false);
54                    }, false);
55                }
56                window.addEventListener("scroll", function () {
57                    tarteaucitron.initEvents.scrollEvent();
58                }, false);
59
60                window.addEventListener("keydown", function (evt) {
61                    tarteaucitron.initEvents.keydownEvent(false, evt);
62                }, false);
63                window.addEventListener("hashchange", function () {
64                    tarteaucitron.initEvents.hashchangeEvent();
65                }, false);
66                window.addEventListener("resize", function () {
67                    tarteaucitron.initEvents.resizeEvent();
68                }, false);
69            } else {
70                if( document.readyState === "complete" ) {
71                    tarteaucitron.initEvents.loadEvent(true);
72                } else {
73                    window.attachEvent("onload", function () {
74                        tarteaucitron.initEvents.loadEvent(true);
75                    });
76                }
77                window.attachEvent("onscroll", function () {
78                    tarteaucitron.initEvents.scrollEvent();
79                });
80                window.attachEvent("onkeydown", function (evt) {
81                    tarteaucitron.initEvents.keydownEvent(true, evt);
82
83                });
84                window.attachEvent("onhashchange", function () {
85                    tarteaucitron.initEvents.hashchangeEvent();
86                });
87                window.attachEvent("onresize", function () {
88                    tarteaucitron.initEvents.resizeEvent();
89                });
90            }
91
92            if (typeof XMLHttpRequest !== 'undefined') {
93                origOpen = XMLHttpRequest.prototype.open;
94                XMLHttpRequest.prototype.open = function () {
95
96                    if (window.addEventListener) {
97                        this.addEventListener("load", function () {
98                            if (typeof tarteaucitronProLoadServices === 'function') {
99                                tarteaucitronProLoadServices();
100                            }
101                        }, false);
102                    } else if (typeof this.attachEvent !== 'undefined') {
103                        this.attachEvent("onload", function () {
104                            if (typeof tarteaucitronProLoadServices === 'function') {
105                                tarteaucitronProLoadServices();
106                            }
107                        });
108                    } else {
109                        if (typeof tarteaucitronProLoadServices === 'function') {
110                            setTimeout(tarteaucitronProLoadServices, 1000);
111                        }
112                    }
113
114                    try {
115                        origOpen.apply(this, arguments);
116                    } catch (err) {}
117                };
118            }
119        }
120
121        if(tarteaucitron.events.init) {
122            tarteaucitron.events.init();
123        }
124    },
125    "initEvents": {
126        "loadEvent": function (isOldBrowser) {
127            tarteaucitron.load();
128            tarteaucitron.fallback(['tarteaucitronOpenPanel'], function (elem) {
129                if (isOldBrowser) {
130                    elem.attachEvent("onclick", function (event) {
131                        tarteaucitron.userInterface.openPanel();
132                        event.preventDefault();
133                    });
134                } else {
135                    elem.addEventListener("click", function (event) {
136                        tarteaucitron.userInterface.openPanel();
137                        event.preventDefault();
138                    }, false);
139                }
140            }, true);
141        },
142        "keydownEvent": function (isOldBrowser, evt) {
143            if (evt.keyCode === 27) {
144                tarteaucitron.userInterface.closePanel();
145            }
146
147            if (isOldBrowser) {
148                if ( evt.keyCode === 9 && focusableEls.indexOf(evt.target) >= 0) {
149                    if ( evt.shiftKey ) /* shift + tab */ {
150                        if (document.activeElement === firstFocusableEl) {
151                            lastFocusableEl.focus();
152                            evt.preventDefault();
153                        }
154                    } else /* tab */ {
155                        if (document.activeElement === lastFocusableEl) {
156                            firstFocusableEl.focus();
157                            evt.preventDefault();
158                        }
159                    }
160                }
161            }
162        },
163        "hashchangeEvent": function () {
164            if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') {
165                tarteaucitron.userInterface.openPanel();
166            }
167        },
168        "resizeEvent": function () {
169            var tacElem = document.getElementById('tarteaucitron');
170            var tacCookieContainer = document.getElementById('tarteaucitronCookiesListContainer');
171
172            if (tacElem && tacElem.style.display === 'block') {
173                tarteaucitron.userInterface.jsSizing('main');
174            }
175
176            if (tacCookieContainer && tacCookieContainer.style.display === 'block') {
177                tarteaucitron.userInterface.jsSizing('cookie');
178            }
179        },
180        "scrollEvent": function () {
181            var scrollPos = window.pageYOffset || document.documentElement.scrollTop;
182            var heightPosition;
183            var tacPercentage = document.getElementById('tarteaucitronPercentage');
184            var tacAlertBig = document.getElementById('tarteaucitronAlertBig');
185
186            if (tacAlertBig && !tarteaucitron.highPrivacy) {
187                if (tacAlertBig.style.display === 'block') {
188                    heightPosition = tacAlertBig.offsetHeight + 'px';
189
190                    if (scrollPos > (screen.height * 2)) {
191                        tarteaucitron.userInterface.respondAll(true);
192                    } else if (scrollPos > (screen.height / 2)) {
193                        document.getElementById('tarteaucitronDisclaimerAlert').innerHTML = '<strong>' + tarteaucitron.lang.alertBigScroll + '</strong> ' + tarteaucitron.lang.alertBig;
194                    }
195
196                    if (tacPercentage) {
197                        if (tarteaucitron.orientation === 'top') {
198                            tacPercentage.style.top = heightPosition;
199                        } else {
200                            tacPercentage.style.bottom = heightPosition;
201                        }
202                        tacPercentage.style.width = ((100 / (screen.height * 2)) * scrollPos) + '%';
203                    }
204                }
205            }
206        },
207    },
208    "load": function () {
209        "use strict";
210
211        if (tarteaucitronIsLoaded === true) {
212            return;
213        }
214
215        var cdn = tarteaucitron.cdn,
216            language = tarteaucitron.getLanguage(),
217            useMinifiedJS = ((new URL(cdn,tarteaucitronPath).host == 'cdn.jsdelivr.net') || (tarteaucitronPath.indexOf('.min.') >= 0) || (tarteaucitronUseMin !== '')),
218            pathToLang = cdn + 'lang/tarteaucitron.' + language + (useMinifiedJS ? '.min' : '') + '.js?v=' + tarteaucitron.version,
219            pathToServices = cdn + 'tarteaucitron.services' + (useMinifiedJS ? '.min' : '') + '.js?v=' + tarteaucitron.version,
220            linkElement = document.createElement('link'),
221            defaults = {
222                "adblocker": false,
223                "hashtag": '#tarteaucitron',
224                "cookieName": 'tarteaucitron',
225                "highPrivacy": true,
226                "orientation": "middle",
227                "bodyPosition": "bottom",
228                "removeCredit": false,
229                "showAlertSmall": false,
230                "showTitleBanner": false,
231                "showDetailsOnClick": true,
232                "showIcon": true,
233                "iconPosition": "BottomRight",
234                "cookieslist": false,
235                "cookieslistEmbed": false,
236                "handleBrowserDNTRequest": false,
237                "DenyAllCta": true,
238                "AcceptAllCta" : true,
239                "moreInfoLink": true,
240                "privacyUrl": "",
241                "useExternalCss": false,
242                "useExternalJs": false,
243                "mandatory": true,
244                "mandatoryCta": true,
245                "closePopup": false,
246                "groupServices": false,
247                "serviceDefaultState": 'wait',
248                "googleConsentMode": true,
249                "pianoConsentMode": true,
250                "pianoConsentModeEssential": false,
251                "bingConsentMode": true,
252                "
vendor: 21,358 bytes, lines 252-670
252softConsentMode": false,
253                "dataLayer": false,
254                "serverSide": false,
255                "partnersList": false,
256                "alwaysNeedConsent": false
257            },
258            params = tarteaucitron.parameters;
259
260        // flag the tac load
261        tarteaucitronIsLoaded = true;
262
263        // Don't show the middle bar if we are on the privacy policy or more page
264        if (((tarteaucitron.parameters.readmoreLink !== undefined && window.location.href == tarteaucitron.parameters.readmoreLink) || window.location.href == tarteaucitron.parameters.privacyUrl) && tarteaucitron.parameters.orientation == "middle") {
265            tarteaucitron.parameters.orientation = "bottom";
266        }
267
268        // Step -1
269        if (typeof tarteaucitronCustomPremium !== 'undefined') {
270            tarteaucitronCustomPremium();
271        }
272
273        // Step 0: get params
274        if (params !== undefined) {
275
276            for (var k in defaults) {
277                if(!tarteaucitron.parameters.hasOwnProperty(k)) {
278                    tarteaucitron.parameters[k] = defaults[k];
279                }
280            }
281        }
282
283        // global
284        tarteaucitron.orientation = tarteaucitron.parameters.orientation;
285        tarteaucitron.hashtag = tarteaucitron.parameters.hashtag;
286        tarteaucitron.highPrivacy = tarteaucitron.parameters.highPrivacy;
287        tarteaucitron.handleBrowserDNTRequest = tarteaucitron.parameters.handleBrowserDNTRequest;
288        tarteaucitron.customCloserId = tarteaucitron.parameters.customCloserId;
289
290        // update dataLayer when consent is updated
291        if (tarteaucitron.parameters.dataLayer === true) {
292            window.addEventListener('tac.root_available', function() {
293                setTimeout(function() {
294                    window.dataLayer = window.dataLayer || [];
295                    tarteaucitron.job.filter(job => tarteaucitron.state[job] === true).length > 0 &&
296                    window.dataLayer.push({
297                        event: 'tac_consent_update',
298                        tacAuthorizedVendors: tarteaucitron.job.filter(job => tarteaucitron.state[job] === true)
299                    });
300                }, 200);
301            });
302            document.addEventListener('tac.consent_updated', function () {
303                window.dataLayer = window.dataLayer || [];
304                tarteaucitron.job.filter(job => tarteaucitron.state[job] === true).length > 0 &&
305                window.dataLayer.push({
306                    event: 'tac_consent_update',
307                    tacAuthorizedVendors: tarteaucitron.job.filter(job => tarteaucitron.state[job] === true)
308                });
309            });
310        }
311
312        // piano consent mode
313        if (tarteaucitron.parameters.pianoConsentMode === true) {
314            window.pdl = window.pdl || {};
315            window.pdl.requireConsent = "v2";
316
317            if(tarteaucitron.parameters.pianoConsentModeEssential === true) {
318                window.pdl.consent = {
319                    products: ["PA"],
320                    defaultPreset: {
321                        PA: "essential",
322                    },
323                };
324            } else {
325                window.pdl.consent = {
326                    products: ["PA"],
327                    defaultPreset: {
328                        PA: "opt-out",
329                    },
330                };
331            }
332
333            document.addEventListener("pianoanalytics_consentModeOk",function () {
334                window.pdl.consent = {
335                    products: ["PA"],
336                    defaultPreset: {
337                        PA: "opt-in",
338                    },
339                };
340
341                if (window.pa && window.pa.consent && typeof window.pa.consent.setMode === "function") {
342                    window.pa.consent.setMode("opt-in");
343                }
344            }, { once: true });
345            document.addEventListener("pianoanalytics_consentModeKo",function () {
346                window.pdl.consent = {
347                    products: ["PA"],
348                    defaultPreset: {
349                        PA: "opt-out",
350                    },
351                };
352
353                if (window.pa && window.pa.consent && typeof window.pa.consent.setMode === "function") {
354                    window.pa.consent.setMode("opt-out");
355                }
356            }, { once: true });
357
358            if (tarteaucitron.parameters.softConsentMode === false) {
359                window.addEventListener('tac.root_available', function () {
360                    if (typeof tarteaucitron_block !== 'undefined') {
361                        tarteaucitron_block.unblock(/piano-analytics\.js/);
362                    }
363                });
364            }
365        }
366        
367        // bing consent mode
368        if (tarteaucitron.parameters.bingConsentMode === true) {
369            window.uetq = window.uetq || [];
370            window.uetq.push('consent', 'default', {'ad_storage': 'denied'});
371
372            window.clarity = window.clarity || function () {
373                (window.clarity.q = window.clarity.q || []).push(arguments);
374            };
375
376            document.addEventListener('clarity_consentModeOk', function () {
377                window.clarity('consentv2', {
378                    ad_Storage: "granted",
379                    analytics_Storage: "granted"
380                });
381            }, { once: true });
382            document.addEventListener('clarity_consentModeKo', function () {
383                window.clarity('consent', false);
384            }, { once: true });
385            document.addEventListener('bingads_consentModeOk', function () {
386                window.uetq.push('consent', 'update', {'ad_storage': 'granted'});
387            }, { once: true });
388            document.addEventListener('bingads_consentModeKo', function () {
389                window.uetq.push('consent', 'update', {'ad_storage': 'denied'});
390            }, { once: true });
391
392            if (tarteaucitron.parameters.softConsentMode === false) {
393                window.addEventListener('tac.root_available', function () {
394                    if (typeof tarteaucitron_block !== 'undefined') {
395                        tarteaucitron_block.unblock(/clarity\.ms/);
396                        tarteaucitron_block.unblock(/bat\.bing\.com/);
397                    }
398                });
399            }
400        }
401
402        // google consent mode
403        if (tarteaucitron.parameters.googleConsentMode === true) {
404
405            // set the dataLayer and a function to update
406            window.dataLayer = window.dataLayer || [];
407            window.tac_gtag = function tac_gtag() {
408                dataLayer.push(arguments);
409            };
410
411            // default consent to denied
412            window.tac_gtag('consent', 'default', {
413                ad_storage: 'denied',
414                analytics_storage: 'denied',
415                ad_user_data: 'denied',
416                ad_personalization: 'denied',
417                wait_for_update: 800
418            });
419
420            // if google ads, add a service for personalized ads
421            document.addEventListener('googleads_added', function() {
422
423                // skip if already added
424                if (tarteaucitron.added["gcmads"] === true) {
425                    return;
426                }
427
428                // simple service to control gcm with event
429                tarteaucitron.services.gcmads = {
430                    "key": "gcmads",
431                    "type": "ads",
432                    "name": "Google Ads (personalized ads)",
433                    "uri": "https://support.google.com/analytics/answer/9976101",
434                    "needConsent": true,
435                    "cookies": [],
436                    "js": function() {},
437                    "fallback": function() {}
438                };
439                tarteaucitron.job.push('gcmads');
440
441                // fix the event handler on the buttons
442                var i,
443                    allowBtns = document.getElementsByClassName("tarteaucitronAllow"),
444                    denyBtns = document.getElementsByClassName("tarteaucitronDeny");
445                for (i = 0; i < allowBtns.length; i++) {
446                    tarteaucitron.addClickEventToElement(allowBtns[i], function() {
447                        tarteaucitron.userInterface.respond(this, true);
448                    });
449                }
450                for (i = 0; i < denyBtns.length; i++) {
451                    tarteaucitron.addClickEventToElement(denyBtns[i], function() {
452                        tarteaucitron.userInterface.respond(this, false);
453                    });
454                }
455            });
456
457            // when personalized ads are accepted, accept googleads
458            document.addEventListener('gcmads_allowed', function() {
459                tarteaucitron.setConsent('googleads', true);
460            });
461
462            // personalized ads loaded/allowed, set gcm to granted
463            document.addEventListener('gcmads_consentModeOk', function() {
464                window.tac_gtag('consent', 'update', {
465                    ad_user_data: 'granted',
466                    ad_personalization: 'granted'
467                });
468            }, { once: true });
469
470            // personalized ads disallowed, set gcm to denied
471            document.addEventListener('gcmads_consentModeKo', function() {
472                window.tac_gtag('consent', 'update', {
473                    ad_user_data: 'denied',
474                    ad_personalization: 'denied'
475                });
476            }, { once: true });
477
478            // google ads loaded/allowed, set gcm to granted
479            document.addEventListener('googleads_consentModeOk', function() {
480                window.tac_gtag('consent', 'update', {
481                    ad_storage: 'granted'
482                });
483            }, { once: true });
484
485            // google ads disallowed, disable personalized ads and update gcm
486            document.addEventListener('googleads_consentModeKo', function() {
487                tarteaucitron.setConsent('gcmads', false);
488                window.tac_gtag('consent', 'update', {
489                    ad_storage: 'denied'
490                });
491            }, { once: true });
492
493            // ga4 loaded/allowed, set gcm to granted
494            document.addEventListener('gtag_consentModeOk', function() {
495                window.tac_gtag('consent', 'update', {
496                    analytics_storage: 'granted'
497                });
498            }, { once: true });
499
500            // ga4 disallowed, update gcm
501            document.addEventListener('gtag_consentModeKo', function() {
502                window.tac_gtag('consent', 'update', {
503                    analytics_storage: 'denied'
504                });
505            }, { once: true });
506
507            // multiple ga4 loaded/allowed, set gcm to granted
508            document.addEventListener('multiplegtag_consentModeOk', function() {
509                window.tac_gtag('consent', 'update', {
510                    analytics_storage: 'granted'
511                });
512            }, { once: true });
513
514            // multiple ga4 disallowed, update gcm
515            document.addEventListener('multiplegtag_consentModeKo', function() {
516                window.tac_gtag('consent', 'update', {
517                    analytics_storage: 'denied'
518                });
519            }, { once: true });
520
521            // allow gtag/googleads by default if consent mode is on
522            if (tarteaucitron.parameters.softConsentMode === false) {
523                window.addEventListener('tac.root_available', function () {
524                    if (typeof tarteaucitron_block !== 'undefined') {
525                        tarteaucitron_block.unblock(/www\.googletagmanager\.com\/gtag\/js/);
526                        tarteaucitron_block.unblock(/www\.googleadservices\.com\/pagead\/conversion/);
527                        tarteaucitron_block.unblock(/AW-/);
528                        tarteaucitron_block.unblock(/google-analytics\.com\/analytics\.js/);
529                        tarteaucitron_block.unblock(/google-analytics\.com\/ga\.js/);
530                    }
531                });
532            }
533        }
534
535        // Step 1: load css
536        if ( !tarteaucitron.parameters.useExternalCss ) {
537            linkElement.rel = 'stylesheet';
538            linkElement.type = 'text/css';
539            linkElement.href = cdn + 'css/tarteaucitron' + (useMinifiedJS ? '.min' : '') + '.css?v=' + tarteaucitron.version;
540            document.getElementsByTagName('head')[0].appendChild(linkElement);
541        }
542        // Step 2: load language and services
543        tarteaucitron.addInternalScript(pathToLang, '', function () {
544
545            if(tarteaucitronCustomText !== ''){
546                tarteaucitron.lang = tarteaucitron.AddOrUpdate(tarteaucitron.lang, tarteaucitronCustomText);
547            }
548
549            document.documentElement.style.setProperty(
550                "--tacTitleBanner",
551                JSON.stringify(tarteaucitron.lang.middleBarHead)
552            );
553
554            tarteaucitron.addInternalScript(pathToServices, '', function () {
555
556                // disable the expand option if services grouped by category
557                if (tarteaucitron.parameters.groupServices == true) {
558                    tarteaucitron.parameters.showDetailsOnClick = true;
559                }
560                
561                var body = document.body,
562                    div = document.createElement('div'),
563                    html = '',
564                    index,
565                    orientation = 'Top',
566                    modalAttrs = '',
567                    cat = ['ads', 'analytic', 'api', 'comment', 'social', 'support', 'video', 'other', 'google'],
568                    i;
569
570                cat = cat.sort(function (a, b) {
571                    if (tarteaucitron.lang[a].title > tarteaucitron.lang[b].title) { return 1; }
572                    if (tarteaucitron.lang[a].title < tarteaucitron.lang[b].title) { return -1; }
573                    return 0;
574                });
575
576                if(!/^<\s*(p|ul)(\s|>)/i.test(tarteaucitron.lang.disclaimer)) {
577                    tarteaucitron.lang.disclaimer = '<p>'+tarteaucitron.lang.disclaimer+'</p>'
578                }
579
580                // Step 3: prepare the html
581                html += '<div role="heading" aria-level="2" id="tac_title" class="tac_visually-hidden">' + tarteaucitron.lang.title + '</div>';
582                html += '<div id="tarteaucitronPremium"></div>';
583                if (tarteaucitron.reloadThePage) {
584                    html += '<button type="button" id="tarteaucitronBack" aria-label="' + tarteaucitron.lang.close + ' (' + tarteaucitron.lang.reload + ')" title="' + tarteaucitron.lang.close + ' (' + tarteaucitron.lang.reload + ')"></button>';
585                } else {
586                    html += '<button type="button" id="tarteaucitronBack" aria-label="' + tarteaucitron.lang.close + '" title="' + tarteaucitron.lang.close + '"></button>';
587                }
588                html += '<div id="tarteaucitron" role="dialog" aria-modal="true" aria-labelledby="dialogTitle" tabindex="-1">';
589                if (tarteaucitron.reloadThePage) {
590                    html += '   <button type="button" id="tarteaucitronClosePanel" aria-describedby="dialogTitle" aria-label="' + tarteaucitron.lang.close + ' (' + tarteaucitron.lang.reload + ')" title="' + tarteaucitron.lang.close + ' (' + tarteaucitron.lang.reload + ')">';
591                } else {
592                    html += '   <button type="button" id="tarteaucitronClosePanel" aria-describedby="dialogTitle" >';
593                }
594                html += '       ' + tarteaucitron.lang.close;
595                html += '   </button>';
596                html += '   <div id="tarteaucitronServices">';
597                html += '      <div class="tarteaucitronLine tarteaucitronMainLine" id="tarteaucitronMainLineOffset">';
598                html += '         <span class="tarteaucitronH1" role="heading" aria-level="2" id="dialogTitle">'+ tarteaucitron.lang.title + '</span>';
599                html += '         <div id="tarteaucitronInfo">';
600                html += '         ' + tarteaucitron.lang.disclaimer;
601                if (tarteaucitron.parameters.privacyUrl !== "") {
602                    html += '   <br aria-hidden="true" /><br aria-hidden="true" />';
603                    html += '   <button type="button" id="tarteaucitronPrivacyUrlDialog" role="link">';
604                    html += '       ' + tarteaucitron.lang.privacyUrl;
605                    html += '   </button>';
606                }
607                html += '         </div>';
608                html += '         <div class="tarteaucitronName">';
609                html += '            <span class="tarteaucitronH2" role="heading" aria-level="3">' + tarteaucitron.lang.all + '</span>';
610                html += '         </div>';
611                html += '         <div class="tarteaucitronAsk" id="tarteaucitronScrollbarAdjust">';
612                html += '            <button aria-label="' + tarteaucitron.lang.icon + ' : ' + tarteaucitron.lang.allowAll + '" type="button" id="tarteaucitronAllAllowed" class="tarteaucitronAllow">';
613                html += '               <span class="tarteaucitronCheck" aria-hidden="true"></span> ' + tarteaucitron.lang.allowAll;
614                html += '            </button> ';
615                html += '            <button aria-label="' + tarteaucitron.lang.icon + ' : ' + tarteaucitron.lang.denyAll + '" type="button" id="tarteaucitronAllDenied" class="tarteaucitronDeny">';
616                html += '               <span class="tarteaucitronCross" aria-hidden="true"></span> ' + tarteaucitron.lang.denyAll;
617                html += '            </button>';
618                html += '         </div>';
619                html += '      </div>';
620                html += '      <div class="tarteaucitronBorder">';
621                html += '         <div class="clear"></div><ul>';
622
623
624                if (tarteaucitron.parameters.mandatory == true) {
625                   html += '<li id="tarteaucitronServicesTitle_mandatory">';
626                   html += '<div class="tarteaucitronTitle">';
627                    if(tarteaucitron.parameters.showDetailsOnClick){
628                        html += '   <button type="button" tabindex="-1"><span class="tarteaucitronPlus" aria-hidden="true"></span> ' + tarteaucitron.lang.mandatoryTitle + '</button>';
629                    }else{
630                        html += '   <span class="asCatToggleBtn">' + tarteaucitron.lang.mandatoryTitle + '</span>';
631                    }
632                   html += '</div>';
633                   html += '<ul id="tarteaucitronServices_mandatory">';
634                   html += '<li class="tarteaucitronLine">';
635                   html += '   <div class="tarteaucitronName">';
636                   html += '       <span class="tarteaucitronH3" role="heading" aria-level="4">' + tarteaucitron.lang.mandatoryText + '</span>';
637                   html += '       <span class="tarteaucitronListCookies" aria-hidden="true"></span><br/>';
638                   html += '   </div>';
639                   if (tarteaucitron.parameters.mandatoryCta == true) {
640                       html += '   <div class="tarteaucitronAsk">';
641                       html += '       <button type="button" class="tarteaucitronAllow" tabindex="-1" disabled>';
642                       html += '           <span class="tarteaucitronCheck" aria-hidden="true"></span> ' + tarteaucitron.lang.allow;
643                       html += '       </button> ';
644                       html += '       <button type="button" class="tarteaucitronDeny" tabindex="-1">';
645                       html += '           <span class="tarteaucitronCross" aria-hidden="true"></span> ' + tarteaucitron.lang.deny;
646                       html += '       </button> ';
647                       html += '   </div>';
648                   }
649                   html += '</li>';
650                   html += '</ul></li>';
651                }
652
653                if (tarteaucitron.parameters.cookieslist === false && tarteaucitron.parameters.cookieslistEmbed === true) {
654                    setTimeout(function() {
655                        tarteaucitron.addClickEventToId("tarteaucitron-toggle-group-cookies", function () {
656                            tarteaucitron.userInterface.toggle('tarteaucitronServices_cookies');
657                            if (document.getElementById('tarteaucitronServices_cookies').style.display == 'block') {
658                                tarteaucitron.userInterface.addClass('tarteaucitronServicesTitle_cookies', 'tarteaucitronIsExpanded');
659                                document.getElementById('tarteaucitron-toggle-group-cookies').setAttribute('aria-expanded', 'true');
660                            } else {
661                                tarteaucitron.userInterface.removeClass('tarteaucitronServicesTitle_cookies', 'tarteaucitronIsExpanded');
662                                document.getElementById('tarteaucitron-toggle-group-cookies').setAttribute('aria-expanded', 'false');
663                            }
664                        });
665                    }, 800);
666
667                    html += '         <li id="tarteaucitronServicesnoTitle_cookies" class="tarteaucitronHidden" style="display:block">';
668                    html += '            <ul>' +
669                        '<li class="tarteaucitronLine" style="background:transparent">' +
670                        '   <div class="tarteaucitronName">' +
671                        '       <span class="tarteaucitronH3" role="heading" aria-level="3" id="tarteaucitronCookiesNumberBis">0 cookie</span>' +
672                        '      <button type="button" aria-expanded="false" class="tarteaucitron-toggle-group" id="tarteaucitron-toggle-group-cookies">' + tarteaucitron.lang.cookieDetail
vendor: 29,717 bytes, lines 672-1055
672 + '</button>' +
673                        '    </div>' +
674                        '</li>' +
675                        '</ul>';
676                    html += '         <ul id="tarteaucitronServices_cookies" style="display:none"><div id="tarteaucitronCookiesList"></div></ul></li>';
677                }
678
679                for (i = 0; i < cat.length; i += 1) {
680                    html += '         <li id="tarteaucitronServicesTitle_' + cat[i] + '" class="tarteaucitronHidden">';
681                    html += '            <div class="tarteaucitronTitle" role="heading" aria-level="3">';
682                    if(tarteaucitron.parameters.showDetailsOnClick)
683                    {
684                        html += '               <button type="button" class="catToggleBtn" aria-expanded="false" data-cat="tarteaucitronDetails' + cat[i] + '"><span class="tarteaucitronPlus" aria-hidden="true"></span> ' + tarteaucitron.lang[cat[i]].title + '</button>';
685                    }else{
686                        html += '               <span class="asCatToggleBtn" data-cat="tarteaucitronInlineDetails' + cat[i] + '">' + tarteaucitron.lang[cat[i]].title + '</span>';
687                    }
688                    html += '            </div>';
689                    html += '            <div id="tarteaucitronDetails' + cat[i] + '" class="tarteaucitronDetails '+ (tarteaucitron.parameters.showDetailsOnClick ? 'tarteaucitronInfoBox' : 'tarteaucitronDetailsInline')+'" role="paragraph">';
690                    html += '               ' + tarteaucitron.lang[cat[i]].details;
691                    html += '            </div>';
692                    html += '         <ul id="tarteaucitronServices_' + cat[i] + '"></ul></li>';
693                }
694                html += '             <li id="tarteaucitronNoServicesTitle" class="tarteaucitronLine">' + tarteaucitron.lang.noServices + '</li>';
695                html += '         </ul>';
696                html += '         <div class="tarteaucitronHidden tarteaucitron-spacer-20" id="tarteaucitronScrollbarChild"></div>';
697                if (tarteaucitron.parameters.removeCredit === false) {
698                    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>';
699                }
700                html += '       </div>';
701                html += '   </div>';
702                html += '</div>';
703
704                if (tarteaucitron.parameters.orientation === 'bottom') {
705                    orientation = 'Bottom';
706                }
707
708                if (tarteaucitron.parameters.orientation === 'middle' || tarteaucitron.parameters.orientation === 'popup') {
709                    modalAttrs = ' role="dialog" aria-modal="true" aria-labelledby="tac_title"';
710                }
711
712                if (tarteaucitron.parameters.highPrivacy && !tarteaucitron.parameters.AcceptAllCta) {
713                    html += '<div tabindex="-1" id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '"' + modalAttrs + '>';
714                    //html += '<div class="tarteaucitronAlertBigWrapper">';
715                    html += '   <span id="tarteaucitronDisclaimerAlert" role="paragraph">';
716                    html += '       ' + tarteaucitron.lang.alertBigPrivacy;
717                    html += '   </span>';
718                    //html += '   <span class="tarteaucitronAlertBigBtnWrapper">';
719                    html += '   <button type="button" id="tarteaucitronPersonalize" aria-label="' + tarteaucitron.lang.personalize + ' ' + tarteaucitron.lang.modalWindow + '" title="' + tarteaucitron.lang.personalize + ' ' + tarteaucitron.lang.modalWindow + '">';
720                    html += '       ' + tarteaucitron.lang.personalize;
721                    html += '   </button>';
722
723                    if (tarteaucitron.parameters.privacyUrl !== "") {
724                        html += '   <button role="link" type="button" id="tarteaucitronPrivacyUrl">';
725                        html += '       ' + tarteaucitron.lang.privacyUrl;
726                        html += '   </button>';
727                    }
728
729                    //html += '   </span>';
730                    //html += '</div>';
731                    html += '</div>';
732                } else {
733                    html += '<div tabindex="-1" id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '"' + modalAttrs + '>';
734                    //html += '<div class="tarteaucitronAlertBigWrapper">';
735                    html += '   <span id="tarteaucitronDisclaimerAlert" role="paragraph">';
736
737                    if (tarteaucitron.parameters.highPrivacy) {
738                        html += '       ' + tarteaucitron.lang.alertBigPrivacy;
739                    } else {
740                        html += '       ' + tarteaucitron.lang.alertBigClick + ' ' + tarteaucitron.lang.alertBig;
741                    }
742
743                    html += '   </span>';
744                    //html += '   <span class="tarteaucitronAlertBigBtnWrapper">';
745                    html += '   <button aria-label="' + tarteaucitron.lang.icon + ' : ' + tarteaucitron.lang.acceptAll + '" type="button" class="tarteaucitronCTAButton tarteaucitronAllow" id="tarteaucitronPersonalize2" aria-describedby="tarteaucitronDisclaimerAlert" >';
746                    html += '       <span class="tarteaucitronCheck" aria-hidden="true"></span> ' + tarteaucitron.lang.acceptAll;
747                    html += '   </button>';
748
749
750                    if (tarteaucitron.parameters.DenyAllCta) {
751                        if (tarteaucitron.reloadThePage) {
752                                    html += '   <button type="button" class="tarteaucitronCTAButton tarteaucitronDeny" id="tarteaucitronAllDenied2" aria-describedby="tarteaucitronDisclaimerAlert" aria-label="' + tarteaucitron.lang.icon + ' : ' + tarteaucitron.lang.denyAll + ' (' + tarteaucitron.lang.reload + ')" title="' + tarteaucitron.lang.denyAll + ' (' + tarteaucitron.lang.reload + ')">';
753                        } else {
754                                    html += '   <button type="button" class="tarteaucitronCTAButton tarteaucitronDeny" id="tarteaucitronAllDenied2" aria-describedby="tarteaucitronDisclaimerAlert" aria-label="' + tarteaucitron.lang.icon + ' : ' + tarteaucitron.lang.denyAll + '">';
755                        }
756                                    html += '       <span class="tarteaucitronCross" aria-hidden="true"></span> ' + tarteaucitron.lang.denyAll;
757                                    html += '   </button>';
758                                    //html += '   <br/><br/>';
759                    }
760
761                    html += '   <button type="button" id="tarteaucitronCloseAlert"  aria-describedby="tarteaucitronDisclaimerAlert" aria-label="' + tarteaucitron.lang.personalize + ' ' + tarteaucitron.lang.modalWindow + '" title="' + tarteaucitron.lang.personalize + ' ' + tarteaucitron.lang.modalWindow + '">';
762                    html += '       ' + tarteaucitron.lang.personalize;
763                    html += '   </button>';
764
765                    if (tarteaucitron.parameters.privacyUrl !== "") {
766                        html += '   <button type="button" id="tarteaucitronPrivacyUrl" role="link">';
767                        html += '       ' + tarteaucitron.lang.privacyUrl;
768                        html += '   </button>';
769                    }
770
771                    //html += '   </span>';
772                    //html += '</div>';
773                    html += '</div>';
774                    html += '<div id="tarteaucitronPercentage"></div>';
775                }
776
777                if (tarteaucitron.parameters.showIcon === true) {
778                    html += '<div id="tarteaucitronIcon" class="tarteaucitronIcon' + tarteaucitron.parameters.iconPosition + '">';
779                    html += '   <button type="button" id="tarteaucitronManager" aria-label="' + tarteaucitron.lang.icon + ' ' + tarteaucitron.lang.modalWindow + '" title="' + tarteaucitron.lang.icon + ' ' + tarteaucitron.lang.modalWindow + '">';
780                    html += '       <img src="' + (tarteaucitron.parameters.iconSrc ? tarteaucitron.parameters.iconSrc : 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGA0lEQVRoge1a207bWBRdBtJwLYZhKDMVmlSK1LxNkPo+ZH6g8B6p5AuALwC+APoFoVLeoT8whPeRSt+CZKmZVu3AiIsRlEtCktGyjy8xzuXYhvahS0JJHJ/4rLP3XnuffcAPfGdQ7mM6jRLSAF4BxqsbewB2lRS2o35mpEQaJcwCyANIdLi1DGBNSWEzqmdHRqRRwjqAJclhtExOSUEP+/xIiDRKhhUWfL7ShTtBuJnqcw+/z4Ql0xNmMEwSSz4kuNIzSgpjSsqYJP/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="' + tarteaucitron.lang.icon + ' ' + tarteaucitron.lang.modalWindow + '" title="' + tarteaucitron.lang.icon + ' ' + tarteaucitron.lang.modalWindow + '">';
781                    html += '   </button>';
782                    html += '</div>';
783                }
784
785                if (tarteaucitron.parameters.showAlertSmall === true) {
786                    html += '<div id="tarteaucitronAlertSmall" class="tarteaucitronAlertSmall' + orientation + '">';
787                    html += '   <button type="button" id="tarteaucitronManager" aria-label="' + tarteaucitron.lang.alertSmall + ' ' + tarteaucitron.lang.modalWindow + '" title="' + tarteaucitron.lang.alertSmall + ' ' + tarteaucitron.lang.modalWindow + '">';
788                    html += '       ' + tarteaucitron.lang.alertSmall;
789                    html += '       <span id="tarteaucitronDot">';
790                    html += '           <span id="tarteaucitronDotGreen"></span>';
791                    html += '           <span id="tarteaucitronDotYellow"></span>';
792                    html += '           <span id="tarteaucitronDotRed"></span>';
793                    html += '       </span>';
794                    if (tarteaucitron.parameters.cookieslist === true) {
795                        html += '   </button><!-- @whitespace';
796                        html += '   --><button type="button" id="tarteaucitronCookiesNumber" aria-expanded="false" aria-controls="tarteaucitronCookiesListContainer">0</button>';
797                        html += '   <div id="tarteaucitronCookiesListContainer">';
798                        if (tarteaucitron.reloadThePage) {
799                            html += '       <button type="button" id="tarteaucitronClosePanelCookie" aria-label="' + tarteaucitron.lang.close + ' (' + tarteaucitron.lang.reload + ')" title="' + tarteaucitron.lang.close + ' (' + tarteaucitron.lang.reload + ')">';
800                        } else {
801                            html += '       <button type="button" id="tarteaucitronClosePanelCookie">';
802                        }
803                        html += '           ' + tarteaucitron.lang.close;
804                        html += '       </button>';
805                        html += '       <div class="tarteaucitronCookiesListMain" id="tarteaucitronCookiesTitle">';
806                        html += '            <span class="tarteaucitronH2" role="heading" aria-level="3" id="tarteaucitronCookiesNumberBis">0 cookie</span>';
807                        html += '       </div>';
808                        html += '       <div id="tarteaucitronCookiesList"></div>';
809                        html += '    </div>';
810                    } else {
811                        html += '   </div>';
812                    }
813                    html += '</div>';
814                }
815
816                tarteaucitron.addInternalScript(tarteaucitron.cdn + 'advertising' + (useMinifiedJS ? '.min' : '') + '.js', '', function () {
817                    if (tarteaucitronNoAdBlocker === true || tarteaucitron.parameters.adblocker === false) {
818
819                        // create a wrapper container at the same level than tarteaucitron so we can add an aria-hidden when tarteaucitron is opened
820                        /*var wrapper = document.createElement('div');
821                        wrapper.id = "tarteaucitronContentWrapper";
822
823                        while (document.body.firstChild)
824                        {
825                            wrapper.appendChild(document.body.firstChild);
826                        }
827
828                        // Append the wrapper to the body
829                        document.body.appendChild(wrapper);*/
830
831                        div.id = 'tarteaucitronRoot';
832                        if (tarteaucitron.parameters.bodyPosition === 'top') {
833                            // Prepend tarteaucitron: #tarteaucitronRoot first-child of the body for better accessibility
834                            var bodyFirstChild = body.firstChild;
835                            body.insertBefore(div, bodyFirstChild);
836                        }
837                        else {
838                            // Append tarteaucitron: #tarteaucitronRoot last-child of the body
839                            body.appendChild(div, body);
840                        }
841
842                        tarteaucitron.userInterface.addClass("tarteaucitronRoot", "tarteaucitronSize-" + tarteaucitron.parameters.orientation);
843
844                        // optionally show the title banner (middleBarHead) on the top/bottom bars too
845                        if (tarteaucitron.parameters.showTitleBanner === true) {
846                            tarteaucitron.userInterface.addClass("tarteaucitronRoot", "tarteaucitronTitleBanner");
847                        }
848
849                        div.setAttribute('data-nosnippet', 'true');
850                        div.setAttribute('lang', language);
851                        div.setAttribute('role', 'region');
852                        div.setAttribute('aria-labelledby', 'tac_title');
853
854                        div.innerHTML = html;
855
856                        //ie compatibility
857                        var tacRootAvailableEvent;
858                        if(typeof(Event) === 'function') {
859                            tacRootAvailableEvent = new Event("tac.root_available");
860                        }else if (typeof(document.createEvent) === 'function'){
861                            tacRootAvailableEvent = document.createEvent('Event');
862                            tacRootAvailableEvent.initEvent("tac.root_available", true, true);
863                        }
864                        //end ie compatibility
865
866                        if (typeof(window.dispatchEvent) === 'function') {window.dispatchEvent(tacRootAvailableEvent);}
867
868                        if (tarteaucitron.job !== undefined) {
869                            tarteaucitron.job = tarteaucitron.cleanArray(tarteaucitron.job);
870                            for (index = 0; index < tarteaucitron.job.length; index += 1) {
871                                tarteaucitron.addService(tarteaucitron.job[index]);
872                            }
873                        } else {
874                            tarteaucitron.job = [];
875                        }
876
877                        if (tarteaucitron.job.length === 0) {
878                            tarteaucitron.userInterface.closeAlert();
879                        }
880
881                        tarteaucitron.isAjax = true;
882
883                        tarteaucitron.job.push = function (id) {
884
885                            // ie <9 hack
886                            if (typeof tarteaucitron.job.indexOf === 'undefined') {
887                                tarteaucitron.job.indexOf = function (obj, start) {
888                                    var i,
889                                        j = this.length;
890                                    for (i = (start || 0); i < j; i += 1) {
891                                        if (this[i] === obj) { return i; }
892                                    }
893                                    return -1;
894                                };
895                            }
896
897                            if (tarteaucitron.job.indexOf(id) === -1) {
898                                Array.prototype.push.call(this, id);
899                                tarteaucitron.launch[id] = false;
900                                tarteaucitron.addService(id);
901                            }
902                        };
903
904                        if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') {
905                            tarteaucitron.userInterface.openPanel();
906                        }
907
908                        tarteaucitron.cookie.number();
909                        setInterval(tarteaucitron.cookie.number, 60000);
910                    }
911                }, tarteaucitron.parameters.adblocker);
912
913                if (tarteaucitron.parameters.adblocker === true) {
914                    setTimeout(function () {
915                        if (tarteaucitronNoAdBlocker === false) {
916                            html = '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + ' tarteaucitron-display-block" role="alert" aria-live="polite">';
917                            html += '   <p id="tarteaucitronDisclaimerAlert">';
918                            html += '       ' + tarteaucitron.lang.adblock + '<br/>';
919                            html += '       <strong>' + tarteaucitron.lang.adblock_call + '</strong>';
920                            html += '   </p>';
921                            html += '   <button type="button" class="tarteaucitronCTAButton" id="tarteaucitronCTAButton">';
922                            html += '       ' + tarteaucitron.lang.reload;
923                            html += '   </button>';
924                            html += '</div>';
925                            html += '<div role="heading" aria-level="2" id="tac_title" class="tac_visually-hidden">' + tarteaucitron.lang.title + '</div>';
926                            html += '<div id="tarteaucitronPremium"></div>';
927
928                            div.id = 'tarteaucitronRoot';
929                            if (tarteaucitron.parameters.bodyPosition === 'top') {
930                                // Prepend tarteaucitron: #tarteaucitronRoot first-child of the body for better accessibility
931                                var bodyFirstChild = body.firstChild;
932                                body.insertBefore(div, bodyFirstChild);
933                            }
934                            else {
935                                // Append tarteaucitron: #tarteaucitronRoot last-child of the body
936                                body.appendChild(div, body);
937                            }
938
939                            div.setAttribute('data-nosnippet', 'true');
940                            div.setAttribute('lang', language);
941                            div.setAttribute('role', 'region');
942                            div.setAttribute('aria-labelledby', 'tac_title');
943
944                            div.innerHTML = html;
945                        }
946                    }, 1500);
947                }
948                if(tarteaucitron.parameters.closePopup === true){
949                    setTimeout(function() {
950                        var closeElement = document.getElementById('tarteaucitronAlertBig'),
951                            closeButton = document.createElement('button');
952                        if (closeElement) {
953                            closeButton.innerHTML = '<span aria-hidden="true">X</span><span class="tac_visually-hidden">' + tarteaucitron.lang.closeBanner + '</span>';
954                            closeButton.setAttribute('id', 'tarteaucitronCloseCross');
955                            closeElement.insertAdjacentElement('beforeend', closeButton);
956                        }
957                    }, 100);
958                }
959
960                if(tarteaucitron.parameters.groupServices === true) {
961                    var tac_group_style = document.createElement('style');
962                    tac_group_style.innerHTML = '.tarteaucitronTitle{display:none}';
963                    document.head.appendChild(tac_group_style);
964                    var cats = document.querySelectorAll('[id^="tarteaucitronServicesTitle_"]')
965                    Array.prototype.forEach.call(cats, function(item) {
966                        var cat = item.getAttribute('id').replace(/^(tarteaucitronServicesTitle_)/, "");
967                        if (cat !== "mandatory") {
968                            var html = '';
969                            html += '<li  class="tarteaucitronLine">';
970                            html += '   <div class="tarteaucitronName">';
971                            html += '       <span class="tarteaucitronH3" role="heading" aria-level="3">'+tarteaucitron.lang[cat].title+'</span>';
972                            html += '       <span>'+tarteaucitron.lang[cat].details+'</span>';
973                            html += '   <button type="button" aria-expanded="false" class="tarteaucitron-toggle-group" id="tarteaucitron-toggle-group-'+cat+'">'+tarteaucitron.lang.alertSmall+' <span id="tarteaucitronCounter-'+cat+'"></span></button>';
974                            html += '   </div>';
975                            html += '   <div class="tarteaucitronAsk" id="tarteaucitron-group-'+cat+'">';
976                            html += '       <button type="button" aria-label="' + tarteaucitron.lang.allow + ' ' + tarteaucitron.lang[cat].title + '" class="tarteaucitronAllow" id="tarteaucitron-accept-group-'+cat+'">';
977                            html += '           <span class="tarteaucitronCheck" aria-hidden="true"></span> ' + tarteaucitron.lang.allow;
978                            html += '       </button> ';
979                            html += '       <button type="button" aria-label="' + tarteaucitron.lang.deny + ' ' + tarteaucitron.lang[cat].title + '" class="tarteaucitronDeny" id="tarteaucitron-reject-group-'+cat+'">';
980                            html += '           <span class="tarteaucitronCross" aria-hidden="true"></span> ' + tarteaucitron.lang.deny;
981                            html += '       </button>';
982                            html += '   </div>';
983                            html += '</li>';
984                            var ul = document.createElement('ul');
985                            ul.innerHTML = html;
986                            item.insertBefore(ul, item.querySelector('#tarteaucitronServices_'+cat+''));
987                            document.querySelector('#tarteaucitronServices_' + cat).style.display = 'none';
988                            tarteaucitron.addClickEventToId("tarteaucitron-toggle-group-" + cat, function () {
989                                tarteaucitron.userInterface.toggle('tarteaucitronServices_' + cat);
990                               if (document.getElementById('tarteaucitronServices_' + cat).style.display == 'block') {
991                                    tarteaucitron.userInterface.addClass('tarteaucitronServicesTitle_' + cat, 'tarteaucitronIsExpanded');
992                                    document.getElementById('tarteaucitron-toggle-group-'+cat).setAttribute('aria-expanded', 'true');
993                                } else {
994                                    tarteaucitron.userInterface.removeClass('tarteaucitronServicesTitle_' + cat, 'tarteaucitronIsExpanded');
995                                    document.getElementById('tarteaucitron-toggle-group-'+cat).setAttribute('aria-expanded', 'false');
996                                }
997                                //tarteaucitron.initEvents.resizeEvent();
998                            });
999                            tarteaucitron.addClickEventToId("tarteaucitron-accept-group-" + cat, function () {
1000                                tarteaucitron.userInterface.respondAll(true, cat);
1001                            });
1002                            tarteaucitron.addClickEventToId("tarteaucitron-reject-group-" + cat, function () {
1003                                tarteaucitron.userInterface.respondAll(false, cat);
1004                            });
1005                        }
1006                    });
1007                }
1008
1009                // add info about the services on the main banner
1010                if (tarteaucitron.parameters.partnersList === true && (tarteaucitron.parameters.orientation === "middle" || tarteaucitron.parameters.orientation === "popup")) {
1011                    setTimeout(function() {
1012                        var tacPartnersInfoParent = document.getElementById('tarteaucitronDisclaimerAlert');
1013                        if (tacPartnersInfoParent !== null) {
1014                            tacPartnersInfoParent.insertAdjacentHTML('beforeend', '<div class="tarteaucitronPartnersList"><b>' + tarteaucitron.lang.ourpartners + ' <span id="tarteaucitronCounter-all"></span></b> <ul id="tarteaucitronCounter-list"></ul></div>');
1015                        }
1016                    }, 100);
1017                }
1018
1019                // add a save button
1020                setTimeout(function() {
1021                    var tacSaveButtonParent = document.getElementById('tarteaucitronServices');
1022                    if (tacSaveButtonParent !== null) {
1023                        tacSaveButtonParent.insertAdjacentHTML('beforeend', '<div id="tarteaucitronSave"><button class="tarteaucitronAllow" id="tarteaucitronSaveButton">' + tarteaucitron.lang.save + '</button></div>');
1024                    }
1025                }, 100);
1026
1027                tarteaucitron.userInterface.color("", true);
1028
1029                // add a little timeout to be sure everything is accessible
1030                setTimeout(function () {
1031
1032                    // Setup events
1033                    tarteaucitron.addClickEventToId("tarteaucitronCloseCross", function () {
1034                        tarteaucitron.userInterface.closeAlert();
1035                    });
1036                    tarteaucitron.addClickEventToId("tarteaucitronPersonalize", function () {
1037                        tarteaucitron.userInterface.openPanel();
1038                    });
1039                    tarteaucitron.addClickEventToId("tarteaucitronPersonalize2", function () {
1040                        tarteaucitron.userInterface.respondAll(true);
1041                    });
1042                    tarteaucitron.addClickEventToId("tarteaucitronManager", function () {
1043                        tarteaucitron.userInterface.openPanel();
1044                    });
1045                    tarteaucitron.addClickEventToId("tarteaucitronBack", function () {
1046                        tarteaucitron.userInterface.closePanel();
1047                    });
1048                    tarteaucitron.addClickEventToId("tarteaucitronClosePanel", function () {
1049                        tarteaucitron.userInterface.closePanel();
1050                    });
1051                    tarteaucitron.addClickEventToId("tarteaucitronClosePanelCookie", function () {
1052                        tarteaucitron.userInterface.closePanel();
1053                    });
1054                    tarteaucitron.addClickEventToId("tarteaucitronPrivacyUrl", function () {
1055                        document.location = tarteaucitron.
1055parameters.privacyUrl;
1056                    });
1057                    tarteaucitron.addClickEventToId("tarteaucitronPrivacyUrlDialog", function () {
1058                        document.location = tarteaucitron.parameters.privacyUrl
vendor: 8,180 bytes, lines 1058-1201
1058;
1059                    });
1060                    tarteaucitron.addClickEventToId("tarteaucitronCookiesNumber", function () {
1061                        tarteaucitron.userInterface.toggleCookiesList();
1062                    });
1063                    tarteaucitron.addClickEventToId("tarteaucitronAllAllowed", function () {
1064                        tarteaucitron.userInterface.respondAll(true);
1065                    });
1066                    tarteaucitron.addClickEventToId("tarteaucitronAllDenied", function () {
1067                        tarteaucitron.userInterface.respondAll(false);
1068                    });
1069                    tarteaucitron.addClickEventToId("tarteaucitronAllDenied2", function () {
1070                        tarteaucitron.userInterface.respondAll(false, '', true);
1071                        if (tarteaucitron.reloadThePage === true) {
1072                            window.location.reload();
1073                        }
1074                    });
1075                    tarteaucitron.addClickEventToId("tarteaucitronCloseAlert", function () {
1076                        tarteaucitron.userInterface.openPanel();
1077                    });
1078                    tarteaucitron.addClickEventToId("tarteaucitronCTAButton", function () {
1079                        location.reload();
1080                    });
1081                    tarteaucitron.addClickEventToId("tarteaucitronSaveButton", function () {
1082                        var timeoutSaveButton = 0;
1083                        tarteaucitron.job.forEach(function(id) {
1084                            if (tarteaucitron.state[id] !== true && tarteaucitron.state[id] !== false) {
1085                                timeoutSaveButton = 500;
1086                                tarteaucitron.setConsent(id, false);
1087                            }
1088                        });
1089                        setTimeout(tarteaucitron.userInterface.closePanel, timeoutSaveButton);
1090                    });
1091                    var toggleBtns = document.getElementsByClassName("catToggleBtn"), i;
1092                    for (i = 0; i < toggleBtns.length; i++) {
1093                        toggleBtns[i].dataset.index = i;
1094                        tarteaucitron.addClickEventToElement(toggleBtns[i], function () {
1095                            if(!tarteaucitron.parameters.showDetailsOnClick) return false;
1096                            tarteaucitron.userInterface.toggle('tarteaucitronDetails' + cat[this.dataset.index], 'tarteaucitronInfoBox');
1097                            if (document.getElementById('tarteaucitronDetails' + cat[this.dataset.index]).style.display === 'block') {
1098                                this.setAttribute('aria-expanded', 'true');
1099                            } else {
1100                                this.setAttribute('aria-expanded', 'false');
1101                            }
1102                            return false;
1103                        });
1104                    }
1105
1106                    // accessibility: on click on "Allow" in the site (not in TAC module), move focus to the loaded service's parent 
1107                    var allowBtnsInSite = document.querySelectorAll(".tac_activate .tarteaucitronAllow");
1108                    for (i = 0; i < allowBtnsInSite.length; i++) {
1109                        tarteaucitron.addClickEventToElement(allowBtnsInSite[i], function () {
1110                            if(this.closest('.tac_activate') !== null && this.closest('.tac_activate').parentNode !== null) {
1111                                this.closest('.tac_activate').parentNode.setAttribute("tabindex", "-1");
1112                                this.closest('.tac_activate').parentNode.focus();
1113                            }
1114                        });
1115                    }
1116
1117                    var allowBtns = document.getElementsByClassName("tarteaucitronAllow");
1118                    for (i = 0; i < allowBtns.length; i++) {
1119                        tarteaucitron.addClickEventToElement(allowBtns[i], function () {
1120                            tarteaucitron.userInterface.respond(this, true);
1121                        });
1122                    }
1123                    var denyBtns = document.getElementsByClassName("tarteaucitronDeny");
1124                    for (i = 0; i < denyBtns.length; i++) {
1125                        tarteaucitron.addClickEventToElement(denyBtns[i], function () {
1126                            tarteaucitron.userInterface.respond(this, false);
1127                        });
1128                    }
1129                    if(tarteaucitron.events.load) {
1130                        tarteaucitron.events.load();
1131                    }
1132
1133                }, 500);
1134
1135            });
1136        });
1137    },
1138    "addService": function (serviceId) {
1139        "use strict";
1140        var html = '',
1141            s = tarteaucitron.services,
1142            service = s[serviceId];
1143
1144        if (typeof service === "undefined") {
1145
1146            var serviceToRemoveIndex = tarteaucitron.job.indexOf(serviceId);
1147            if (serviceToRemoveIndex !== -1) {
1148                tarteaucitron.job.splice(serviceToRemoveIndex, 1);
1149            }
1150            return;
1151        }
1152
1153        if (tarteaucitron.parameters.alwaysNeedConsent === true) {
1154            service.needConsent = true;
1155        }
1156
1157        var cookie = tarteaucitron.cookie.read(),
1158            hostname = document.location.hostname,
1159            hostRef = document.referrer.split('/')[2],
1160            isNavigating = (hostRef === hostname && window.location.href !== tarteaucitron.parameters.privacyUrl),
1161            isAutostart = (!service.needConsent),
1162            isWaiting = (cookie.indexOf(service.key + '=wait') >= 0),
1163            isDenied = (cookie.indexOf(service.key + '=false') >= 0),
1164            isAllowed = ((cookie.indexOf(service.key + '=true') >= 0) || (!service.needConsent && cookie.indexOf(service.key + '=false') < 0)),
1165            isResponded = (cookie.indexOf(service.key + '=false') >= 0 || cookie.indexOf(service.key + '=true') >= 0),
1166            isDNTRequested = (navigator.doNotTrack === "1" || navigator.doNotTrack === "yes" || navigator.msDoNotTrack === "1" || window.doNotTrack === "1"),
1167            currentStatus = (isAllowed) ? tarteaucitron.lang.allowed : tarteaucitron.lang.disallowed,
1168            state = (undefined !== service.defaultState) ? service.defaultState :
1169                    (undefined !== tarteaucitron.parameters.serviceDefaultState ? tarteaucitron.parameters.serviceDefaultState : 'wait'),
1170            serviceDesc = tarteaucitron.lang['desc-' + service.key] || '';
1171
1172
1173        if (tarteaucitron.added[service.key] !== true) {
1174            tarteaucitron.added[service.key] = true;
1175
1176            html += '<li id="' + service.key + 'Line" class="tarteaucitronLine">';
1177            html += '   <div class="tarteaucitronName">';
1178            html += '       <span class="tarteaucitronH3" role="heading" aria-level="4">' + service.name + '</span>';
1179            if (serviceDesc !== '') {
1180                html += '       <span class="tarteaucitronServiceDescription">' + serviceDesc + '</span>';
1181            }
1182            html += '       <div class="tarteaucitronStatusInfo">';
1183            html += '          <span class="tacCurrentStatus" id="tacCurrentStatus' + service.key + '">'+currentStatus+'</span>';
1184            html += '          <span class="tarteaucitronReadmoreSeparator"> - </span>';
1185            html += '          <span id="tacCL' + service.key + '" class="tarteaucitronListCookies"></span>';
1186            html += '       </div>';
1187            if (tarteaucitron.parameters.moreInfoLink == true) {
1188
1189                var link;
1190                if (tarteaucitron.getLanguage() === 'fr') {
1191                    link = 'https://tarteaucitron.io/service/' + service.key + '/';
1192                } else {
1193                    link = 'https://tarteaucitron.io/en/service-details/' + service.key + '/';
1194                }
1195                if (service.readmoreLink !== undefined && service.readmoreLink !== '') {
1196                    link = service.readmoreLink;
1197                }
1198                if (tarteaucitron.parameters.readmoreLink !== undefined && tarteaucitron.parameters.readmoreLink !== '') {
1199                    link = tarteaucitron.parameters.readmoreLink;
1200                }
1201                html += '       <a href="' + 
vendor: 13,887 bytes, lines 1201-1479
1201link + '" target="_blank" rel="noreferrer noopener nofollow" title="' + tarteaucitron.lang.more + ' : '+ tarteaucitron.lang.cookieDetail + ' ' + service.name + ' ' + tarteaucitron.lang.ourSite + ' ' + tarteaucitron.lang.newWindow +'" class="tarteaucitronReadmoreInfo">' + tarteaucitron.lang.more + '</a>';
1202                html += '       <span class="tarteaucitronReadmoreSeparator"> - </span>';
1203                html += '       <a href="' + service.uri + '" target="_blank" rel="noreferrer noopener" title="' + tarteaucitron.lang.source + ' ' + service.name + ' ' + tarteaucitron.lang.newWindow + '" class="tarteaucitronReadmoreOfficial">' + tarteaucitron.lang.source + '</a>';
1204            }
1205
1206            html += '   </div>';
1207            html += '   <div class="tarteaucitronAsk">';
1208            html += '       <button type="button" aria-label="' + tarteaucitron.lang.allow + ' ' + service.name + '" id="' + service.key + 'Allowed" class="tarteaucitronAllow">';
1209            html += '           <span class="tarteaucitronCheck" aria-hidden="true"></span> ' + tarteaucitron.lang.allow;
1210            html += '       </button> ';
1211            html += '       <button type="button" aria-label="' + tarteaucitron.lang.deny + ' ' + service.name + '" id="' + service.key + 'Denied" class="tarteaucitronDeny">';
1212            html += '           <span class="tarteaucitronCross" aria-hidden="true"></span> ' + tarteaucitron.lang.deny;
1213            html += '       </button>';
1214            html += '   </div>';
1215            html += '</li>';
1216
1217            tarteaucitron.userInterface.css('tarteaucitronServicesTitle_' + service.type, 'display', 'block');
1218
1219            if (document.getElementById('tarteaucitronServices_' + service.type) !== null) {
1220                document.getElementById('tarteaucitronServices_' + service.type).innerHTML += html;
1221            }
1222
1223            tarteaucitron.userInterface.css('tarteaucitronNoServicesTitle', 'display', 'none');
1224
1225            tarteaucitron.userInterface.order(service.type);
1226
1227            tarteaucitron.addClickEventToId(service.key + 'Allowed', function () {
1228                tarteaucitron.userInterface.respond(this, true);
1229            });
1230
1231            tarteaucitron.addClickEventToId(service.key + 'Denied', function () {
1232                tarteaucitron.userInterface.respond(this, false);
1233            });
1234        }
1235
1236        tarteaucitron.pro('!' + service.key + '=' + isAllowed);
1237
1238        // allow by default for non EU
1239        if (isResponded === false && tarteaucitron.user.bypass === true) {
1240            isAllowed = true;
1241            tarteaucitron.cookie.create(service.key, true);
1242        }
1243
1244        if ((!isResponded && (isAutostart || (isNavigating && isWaiting)) && !tarteaucitron.highPrivacy) || isAllowed) {
1245            if (!isAllowed || (!service.needConsent && cookie.indexOf(service.key + '=false') < 0)) {
1246                tarteaucitron.cookie.create(service.key, true);
1247            }
1248            if (tarteaucitron.launch[service.key] !== true) {
1249                tarteaucitron.launch[service.key] = true;
1250                tarteaucitron.sendEvent(service.key + '_consentModeOk');
1251                if ((typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + service.key + "_") < 0) && tarteaucitron.parameters.serverSide !== true) { service.js(); }
1252                tarteaucitron.sendEvent(service.key + '_loaded');
1253            }
1254            tarteaucitron.state[service.key] = true;
1255            tarteaucitron.userInterface.color(service.key, true);
1256        } else if (isDenied) {
1257            if (typeof service.fallback === 'function') {
1258                if ((typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + service.key + "_") < 0) && tarteaucitron.parameters.serverSide !== true) { service.fallback(); }
1259            }
1260            tarteaucitron.state[service.key] = false;
1261            tarteaucitron.userInterface.color(service.key, false);
1262        } else if (!isResponded && isDNTRequested && tarteaucitron.handleBrowserDNTRequest) {
1263            tarteaucitron.cookie.create(service.key, 'false');
1264            if (typeof service.fallback === 'function') {
1265                if ((typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + service.key + "_") < 0) && tarteaucitron.parameters.serverSide !== true) { service.fallback(); }
1266            }
1267            tarteaucitron.state[service.key] = false;
1268            tarteaucitron.userInterface.color(service.key, false);
1269        } else if (!isResponded) {
1270            tarteaucitron.cookie.create(service.key, state);
1271
1272            if (true === state) {
1273                tarteaucitron.sendEvent(service.key + '_consentModeOk');
1274            }
1275
1276            if ((typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + service.key + "_") < 0) && tarteaucitron.parameters.serverSide !== true) {
1277                if(true === state && typeof service.js === 'function') {
1278                    service.js();
1279                } else if (typeof service.fallback === 'function') {
1280                    service.fallback();
1281                }
1282            }
1283
1284            if (true === state) {
1285                tarteaucitron.sendEvent(service.key + '_loaded');
1286            }
1287
1288            if (true === state || false === state) {
1289                tarteaucitron.state[service.key] = state;
1290            }
1291            tarteaucitron.userInterface.color(service.key, state);
1292
1293            if( 'wait' === state ) {
1294                tarteaucitron.userInterface.openAlert();
1295            }
1296        }
1297
1298        tarteaucitron.cookie.checkCount(service.key);
1299        tarteaucitron.sendEvent(service.key + '_added');
1300    },
1301    "sendEvent" : function(event_key) {
1302        if(event_key !== undefined) {
1303            //ie compatibility
1304            var send_event_item;
1305            if(typeof(Event) === 'function') {
1306                send_event_item = new Event(event_key);
1307            }else if (typeof(document.createEvent) === 'function'){
1308                send_event_item = document.createEvent('Event');
1309                send_event_item.initEvent(event_key, true, true);
1310            }
1311            //end ie compatibility
1312
1313            document.dispatchEvent(send_event_item);
1314        }
1315    },
1316    "cleanArray": function cleanArray(arr) {
1317        "use strict";
1318        var i,
1319            len = arr.length,
1320            out = [],
1321            obj = {},
1322            s = tarteaucitron.services;
1323
1324        for (i = 0; i < len; i += 1) {
1325            if (!obj[arr[i]]) {
1326                obj[arr[i]] = {};
1327                if (tarteaucitron.services[arr[i]] !== undefined) {
1328                    out.push(arr[i]);
1329                }
1330            }
1331        }
1332
1333        out = out.sort(function (a, b) {
1334            if (s[a].type + s[a].key > s[b].type + s[b].key) { return 1; }
1335            if (s[a].type + s[a].key < s[b].type + s[b].key) { return -1; }
1336            return 0;
1337        });
1338
1339        return out;
1340    },
1341    "setConsent": function (id, status) {
1342        if (status === true) {
1343            tarteaucitron.userInterface.respond(document.getElementById(id + 'Allowed'), true);
1344        } else if (status === false) {
1345            tarteaucitron.userInterface.respond(document.getElementById(id + 'Denied'), false);
1346        }
1347    },
1348    "userInterface": {
1349        "css": function (id, property, value) {
1350            "use strict";
1351            if (document.getElementById(id) !== null) {
1352
1353                if (property == "display" && value == "none" && (id == "tarteaucitron" || id == "tarteaucitronBack" || id == "tarteaucitronAlertBig")) {
1354                    document.getElementById(id).style["opacity"] = "0";
1355
1356                    /*setTimeout(function() {*/document.getElementById(id).style[property] = value;/*}, 200);*/
1357                } else {
1358
1359                    document.getElementById(id).style[property] = value;
1360
1361                    if (property == "display" && value == "block" && (id == "tarteaucitron" || id == "tarteaucitronAlertBig")) {
1362                        document.getElementById(id).style["opacity"] = "1";
1363                    }
1364
1365                    if (property == "display" && value == "block" && id == "tarteaucitronBack") {
1366                        document.getElementById(id).style["opacity"] = "0.7";
1367                    }
1368
1369                    if (property == "display" && value == "block" && id == "tarteaucitronAlertBig" && (tarteaucitron.parameters.orientation == "middle"|| tarteaucitron.parameters.orientation == "popup")) {
1370                        tarteaucitron.userInterface.focusTrap('tarteaucitronAlertBig');
1371                    }
1372                }
1373            }
1374        },
1375        "addClass": function (id, className) {
1376            "use strict";
1377            if (document.getElementById(id) !== null && document.getElementById(id).classList !== undefined) {
1378                document.getElementById(id).classList.add(className);
1379            }
1380        },
1381        "removeClass": function (id, className) {
1382            "use strict";
1383            if (document.getElementById(id) !== null && document.getElementById(id).classList !== undefined) {
1384                document.getElementById(id).classList.remove(className);
1385            }
1386        },
1387        "respondAll": function (status, type, allowSafeAnalytics) {
1388            "use strict";
1389            var s = tarteaucitron.services,
1390                service,
1391                key,
1392                index = 0;
1393
1394            for (index = 0; index < tarteaucitron.job.length; index += 1) {
1395
1396                if (typeof type !== 'undefined' && type !== '' && s[tarteaucitron.job[index]].type !== type) {
1397                    continue;
1398                }
1399
1400                if (allowSafeAnalytics && typeof s[tarteaucitron.job[index]].safeanalytic !== "undefined" && s[tarteaucitron.job[index]].safeanalytic === true) {
1401                    continue;
1402                }
1403
1404                service = s[tarteaucitron.job[index]];
1405                key = service.key;
1406                if (tarteaucitron.state[key] !== status) {
1407
1408                    if (status == true) {
1409                        tarteaucitron.sendEvent(key + '_consentModeOk');
1410                    } else {
1411                        tarteaucitron.sendEvent(key + '_consentModeKo');
1412                    }
1413
1414                    if (status === false && tarteaucitron.launch[key] === true) {
1415                        tarteaucitron.reloadThePage = true;
1416                        if (tarteaucitron.checkIfExist('tarteaucitronClosePanel')) {
1417                            var ariaCloseValue = document.getElementById('tarteaucitronClosePanel').textContent.trim() + ' (' + tarteaucitron.lang.reload + ')';
1418                            document.getElementById('tarteaucitronClosePanel').setAttribute("aria-label", ariaCloseValue);
1419                            document.getElementById('tarteaucitronClosePanel').setAttribute("title", ariaCloseValue);
1420                        }
1421                    }
1422                    if (tarteaucitron.launch[key] !== true && status === true) {
1423                        tarteaucitron.pro('!' + key + '=engage');
1424
1425                        tarteaucitron.launch[key] = true;
1426                        if ((typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + key + "_") < 0) && tarteaucitron.parameters.serverSide !== true) { tarteaucitron.services[key].js(); }
1427                        tarteaucitron.sendEvent(key + '_loaded');
1428                    }
1429                    var itemStatusElem = document.getElementById('tacCurrentStatus'+key);
1430                    tarteaucitron.state[key] = status;
1431                    tarteaucitron.cookie.create(key, status);
1432                    tarteaucitron.userInterface.color(key, status);
1433                    if (status == true) {
1434                        itemStatusElem.innerHTML = tarteaucitron.lang.allowed;
1435                        tarteaucitron.sendEvent(key + '_allowed');
1436                    } else {
1437                        itemStatusElem.innerHTML = tarteaucitron.lang.disallowed;
1438                        tarteaucitron.sendEvent(key + '_disallowed');
1439                    }
1440                }
1441            }
1442        },
1443        "respond": function (el, status) {
1444            "use strict";
1445            if (el.id === '') {
1446                return;
1447            }
1448            var key = el.id.replace(new RegExp("(Eng[0-9]+|Allow|Deni)ed", "g"), '');
1449
1450            if (key.substring(0, 13) === 'tarteaucitron' || key === '') {return;}
1451
1452            // return if same state
1453            if (tarteaucitron.state[key] === status) {
1454                return;
1455            }
1456
1457            if (status == true) {
1458                tarteaucitron.sendEvent(key + '_consentModeOk');
1459            } else {
1460                tarteaucitron.sendEvent(key + '_consentModeKo');
1461            }
1462
1463            if (status === false && tarteaucitron.launch[key] === true) {
1464                tarteaucitron.reloadThePage = true;
1465                if (tarteaucitron.checkIfExist('tarteaucitronClosePanel')) {
1466                    var ariaCloseValue = document.getElementById('tarteaucitronClosePanel').textContent.trim() + ' (' + tarteaucitron.lang.reload + ')';
1467                    document.getElementById('tarteaucitronClosePanel').setAttribute("aria-label", ariaCloseValue);
1468                    document.getElementById('tarteaucitronClosePanel').setAttribute("title", ariaCloseValue);
1469                }
1470            }
1471
1472            // if not already launched... launch the service
1473            if (status === true) {
1474                if (tarteaucitron.launch[key] !== true) {
1475                    tarteaucitron.pro('!' + key + '=engage');
1476
1477                    tarteaucitron.launch[key] = true;
1478                    tarteaucitron.sendEvent(key + '_consentModeOk');
1479                    if ((typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + key + "_") < 0) && tarteaucitron.parameters.serverSide !== true
vendor: 53,446 bytes, lines 1479-2658
1479) { tarteaucitron.services[key].js(); }
1480                    tarteaucitron.sendEvent(key + '_loaded');
1481                }
1482            }
1483            var itemStatusElem = document.getElementById('tacCurrentStatus'+key);
1484            tarteaucitron.state[key] = status;
1485            tarteaucitron.cookie.create(key, status);
1486            tarteaucitron.userInterface.color(key, status);
1487            if (status == true) {
1488                itemStatusElem.innerHTML = tarteaucitron.lang.allowed;
1489                tarteaucitron.sendEvent(key + '_allowed');
1490            } else {
1491                itemStatusElem.innerHTML = tarteaucitron.lang.disallowed;
1492                tarteaucitron.sendEvent(key + '_disallowed');
1493            }
1494        },
1495        "color": function (key, status) {
1496            "use strict";
1497            var c = 'tarteaucitron',
1498                nbDenied = 0,
1499                nbPending = 0,
1500                nbAllowed = 0,
1501                sum = tarteaucitron.job.length,
1502                index,
1503                s = tarteaucitron.services;
1504
1505            if (key !== "") {
1506
1507                tarteaucitron.cookie.checkCount(key);
1508
1509            if (status === true) {
1510                tarteaucitron.userInterface.addClass(key + 'Line', 'tarteaucitronIsAllowed');
1511                tarteaucitron.userInterface.removeClass(key + 'Line', 'tarteaucitronIsDenied');
1512                document.getElementById(key + 'Allowed').setAttribute('aria-pressed', 'true');
1513                document.getElementById(key + 'Denied').setAttribute('aria-pressed', 'false');
1514            } else if (status === false) {
1515                tarteaucitron.userInterface.removeClass(key + 'Line', 'tarteaucitronIsAllowed');
1516                tarteaucitron.userInterface.addClass(key + 'Line', 'tarteaucitronIsDenied');
1517                document.getElementById(key + 'Allowed').setAttribute('aria-pressed', 'false');
1518                document.getElementById(key + 'Denied').setAttribute('aria-pressed', 'true');
1519            } else {
1520                document.getElementById(key + 'Allowed').setAttribute('aria-pressed', 'false');
1521                document.getElementById(key + 'Denied').setAttribute('aria-pressed', 'false');
1522            }
1523
1524            // check if all services are allowed
1525            var sumToRemove = 0;
1526            for (index = 0; index < sum; index += 1) {
1527
1528                if (typeof s[tarteaucitron.job[index]].safeanalytic !== "undefined" && s[tarteaucitron.job[index]].safeanalytic === true) {
1529                    sumToRemove += 1;
1530                    continue;
1531                }
1532
1533                if (tarteaucitron.state[tarteaucitron.job[index]] === false) {
1534                    nbDenied += 1;
1535                } else if (tarteaucitron.state[tarteaucitron.job[index]] === undefined) {
1536                    nbPending += 1;
1537                } else if (tarteaucitron.state[tarteaucitron.job[index]] === true) {
1538                    nbAllowed += 1;
1539                }
1540            }
1541            sum -= sumToRemove;
1542
1543            const percentages = {
1544                DotGreen: (100 / sum) * nbAllowed,
1545                DotYellow: (100 / sum) * nbPending,
1546                DotRed: (100 / sum) * nbDenied
1547            };
1548
1549            for (const [colorKey, value] of Object.entries(percentages)) {
1550                tarteaucitron.userInterface.css(c + colorKey, 'width', value + '%');
1551            }
1552
1553            if (tarteaucitron.parameters.showAlertSmall === true) {
1554                const percentAllowed = percentages.DotGreen;
1555                const label = tarteaucitron.lang.alertSmall + " - " + percentAllowed + "% " + tarteaucitron.lang.allowed + " " + tarteaucitron.lang.modalWindow;
1556                const managerEl = document.getElementById(c + 'Manager');
1557                managerEl.setAttribute('aria-label', label);
1558                managerEl.setAttribute('title', label);
1559            }
1560
1561            if (nbDenied === 0 && nbPending === 0) {
1562                tarteaucitron.userInterface.removeClass(c + 'AllDenied', c + 'IsSelected');
1563                tarteaucitron.userInterface.addClass(c + 'AllAllowed', c + 'IsSelected');
1564
1565                tarteaucitron.userInterface.addClass(c + 'MainLineOffset', c + 'IsAllowed');
1566                tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsDenied');
1567
1568                document.getElementById(c + 'AllDenied').setAttribute('aria-pressed', 'false');
1569                document.getElementById(c + 'AllAllowed').setAttribute('aria-pressed', 'true');
1570
1571            } else if (nbAllowed === 0 && nbPending === 0) {
1572                tarteaucitron.userInterface.removeClass(c + 'AllAllowed', c + 'IsSelected');
1573                tarteaucitron.userInterface.addClass(c + 'AllDenied', c + 'IsSelected');
1574
1575                tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsAllowed');
1576                tarteaucitron.userInterface.addClass(c + 'MainLineOffset', c + 'IsDenied');
1577
1578                document.getElementById(c + 'AllDenied').setAttribute('aria-pressed', 'true');
1579                document.getElementById(c + 'AllAllowed').setAttribute('aria-pressed', 'false');
1580
1581            } else {
1582                tarteaucitron.userInterface.removeClass(c + 'AllAllowed', c + 'IsSelected');
1583                tarteaucitron.userInterface.removeClass(c + 'AllDenied', c + 'IsSelected');
1584
1585                tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsAllowed');
1586                tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsDenied');
1587
1588                document.getElementById(c + 'AllDenied').setAttribute('aria-pressed', 'false');
1589                document.getElementById(c + 'AllAllowed').setAttribute('aria-pressed', 'false');
1590            }
1591
1592            // close the alert if all service have been reviewed
1593            if (nbPending === 0) {
1594                tarteaucitron.userInterface.closeAlert();
1595            }
1596
1597            if (tarteaucitron.services[key].cookies.length > 0 && status === false) {
1598                tarteaucitron.cookie.purge(tarteaucitron.services[key].cookies);
1599            }
1600
1601            if (status === true) {
1602                if (document.getElementById('tacCL' + key) !== null) {
1603                    document.getElementById('tacCL' + key).innerHTML = '...';
1604                }
1605                setTimeout(function () {
1606                    tarteaucitron.cookie.checkCount(key);
1607                }, 2500);
1608            } else {
1609                tarteaucitron.cookie.checkCount(key);
1610            }
1611
1612            }
1613
1614	        // groups
1615            var cats = document.querySelectorAll('[id^="tarteaucitronServicesTitle_"]')
1616            Array.prototype.forEach.call(cats, function(item) {
1617                var cat = item.getAttribute('id').replace(/^(tarteaucitronServicesTitle_)/, ""),
1618                    total = document.getElementById("tarteaucitronServices_"+cat).childElementCount;
1619                var doc = document.getElementById("tarteaucitronServices_"+cat),
1620                    groupdenied = 0,
1621                    groupallowed = 0;
1622                for (var ii = 0; ii < doc.children.length; ii++) {
1623                    if (doc.children[ii].className == "tarteaucitronLine tarteaucitronIsDenied") {
1624                        groupdenied++;
1625                    }
1626                    if (doc.children[ii].className == "tarteaucitronLine tarteaucitronIsAllowed") {
1627                        groupallowed++;
1628                    }
1629                }
1630                if (total === groupallowed) {
1631                    tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsDenied');
1632                    tarteaucitron.userInterface.addClass('tarteaucitron-group-'+cat, 'tarteaucitronIsAllowed');
1633
1634                    if (document.getElementById('tarteaucitron-reject-group-'+cat)) {
1635                        document.getElementById('tarteaucitron-reject-group-'+cat).setAttribute('aria-pressed', 'false');
1636                        document.getElementById('tarteaucitron-accept-group-'+cat).setAttribute('aria-pressed', 'true');
1637                    }
1638                }
1639                if (total === groupdenied) {
1640                    tarteaucitron.userInterface.addClass('tarteaucitron-group-'+cat, 'tarteaucitronIsDenied');
1641                    tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsAllowed');
1642
1643                    if (document.getElementById('tarteaucitron-reject-group-'+cat)) {
1644                        document.getElementById('tarteaucitron-reject-group-'+cat).setAttribute('aria-pressed', 'true');
1645                        document.getElementById('tarteaucitron-accept-group-'+cat).setAttribute('aria-pressed', 'false');
1646                    }
1647                }
1648                if (total !== groupdenied && total !== groupallowed) {
1649                    tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsDenied');
1650                    tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsAllowed');
1651
1652                    if (document.getElementById('tarteaucitron-reject-group-'+cat)) {
1653                        document.getElementById('tarteaucitron-reject-group-'+cat).setAttribute('aria-pressed', 'false');
1654                        document.getElementById('tarteaucitron-accept-group-'+cat).setAttribute('aria-pressed', 'false');
1655                    }
1656                }
1657                groupdenied = 0;
1658                groupallowed = 0;
1659
1660                if (document.getElementById('tarteaucitronCounter-'+cat)) {
1661                    document.getElementById('tarteaucitronCounter-'+cat).innerHTML = '('+document.getElementById("tarteaucitronServices_"+cat).childElementCount+')';
1662                }
1663            });
1664
1665            setTimeout(function() {
1666                if (document.getElementById('tarteaucitronCounter-all')) {
1667                    document.getElementById('tarteaucitronCounter-all').innerHTML = '('+tarteaucitron.job.length+')';
1668                }
1669                if (document.getElementById('tarteaucitronCounter-list')) {
1670
1671                    var liPartners = "";
1672                    var tarteaucitronPartnersCat = [];
1673                    var titles = [];
1674
1675                    tarteaucitron.job.forEach(function (id) {
1676                        if (tarteaucitronPartnersCat[tarteaucitron.services[id].type] === undefined) {
1677                            tarteaucitronPartnersCat[tarteaucitron.services[id].type] = true;
1678                            titles.push(tarteaucitron.lang[tarteaucitron.services[id].type].title);
1679                        }
1680                    });
1681                    titles.sort();
1682                    titles.forEach(function (title) {
1683                        liPartners += "<li>" + title + "</li>";
1684                    });
1685
1686                    document.getElementById('tarteaucitronCounter-list').innerHTML = liPartners;
1687                }
1688            }, 120);
1689        },
1690        "openPanel": function () {
1691            "use strict";
1692
1693            tarteaucitron.userInterface.css('tarteaucitron', 'display', 'block');
1694            tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block');
1695            tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none');
1696
1697            document.getElementById('tarteaucitronClosePanel').focus();
1698            if (document.getElementsByTagName('html')[0].classList !== undefined) {
1699                document.getElementsByTagName('html')[0].classList.add('tarteaucitron-modal-open-noscroll');
1700            }
1701            if (document.getElementsByTagName('body')[0].classList !== undefined) {
1702                document.getElementsByTagName('body')[0].classList.add('tarteaucitron-modal-open');
1703            }
1704            tarteaucitron.userInterface.focusTrap('tarteaucitron');
1705            tarteaucitron.userInterface.jsSizing('main');
1706
1707            //ie compatibility
1708            var tacOpenPanelEvent;
1709            if(typeof(Event) === 'function') {
1710                tacOpenPanelEvent = new Event("tac.open_panel");
1711            }else if (typeof(document.createEvent) === 'function'){
1712                tacOpenPanelEvent = document.createEvent('Event');
1713                tacOpenPanelEvent.initEvent("tac.open_panel", true, true);
1714            }
1715            //end ie compatibility
1716
1717            if (typeof(window.dispatchEvent) === 'function') {window.dispatchEvent(tacOpenPanelEvent);}
1718        },
1719        "closePanel": function () {
1720            "use strict";
1721
1722            if (document.location.hash === tarteaucitron.hashtag) {
1723                if (window.history) {
1724                    window.history.replaceState('', document.title, window.location.pathname + window.location.search);
1725                } else {
1726                    document.location.hash = '';
1727                }
1728            }
1729            if (tarteaucitron.checkIfExist('tarteaucitron')) {
1730                // accessibility: manage focus on close panel
1731                if (tarteaucitron.checkIfExist('tarteaucitronCloseAlert')) {
1732                    document.getElementById('tarteaucitronCloseAlert').focus();
1733                } else if (tarteaucitron.checkIfExist('tarteaucitronManager')) {
1734                    document.getElementById('tarteaucitronManager').focus();
1735                } else if (tarteaucitron.customCloserId && tarteaucitron.checkIfExist(tarteaucitron.customCloserId)) {
1736                    document.getElementById(tarteaucitron.customCloserId).focus();
1737                }
1738                tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none');
1739            }
1740
1741            if (tarteaucitron.checkIfExist('tarteaucitronCookiesListContainer') && tarteaucitron.checkIfExist('tarteaucitronCookiesNumber')) {
1742                // accessibility: manage focus on close cookies list
1743                document.getElementById('tarteaucitronCookiesNumber').focus();
1744                document.getElementById('tarteaucitronCookiesNumber').setAttribute("aria-expanded", "false");
1745                tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none');
1746            }
1747
1748            tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) {
1749                elem.style.display = 'none';
1750            }, true);
1751
1752            if (tarteaucitron.reloadThePage === true) {
1753                window.location.reload();
1754            } else {
1755                tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none');
1756            }
1757
1758            if (!(tarteaucitron.parameters.orientation === 'middle' && document.getElementById('tarteaucitronAlertBig').style.display === 'block')) {
1759                if (document.getElementsByTagName('html')[0].classList !== undefined) {
1760                    document.getElementsByTagName('html')[0].classList.remove('tarteaucitron-modal-open-noscroll');
1761                }
1762            }
1763            if (document.getElementsByTagName('body')[0].classList !== undefined) {
1764                document.getElementsByTagName('body')[0].classList.remove('tarteaucitron-modal-open');
1765            }
1766
1767            //ie compatibility
1768            var tacClosePanelEvent;
1769            if(typeof(Event) === 'function') {
1770                tacClosePanelEvent = new Event("tac.close_panel");
1771            }else if (typeof(document.createEvent) === 'function'){
1772                tacClosePanelEvent = document.createEvent('Event');
1773                tacClosePanelEvent.initEvent("tac.close_panel", true, true);
1774            }
1775            //end ie compatibility
1776
1777            if (typeof(window.dispatchEvent) === 'function') {window.dispatchEvent(tacClosePanelEvent);}
1778        },
1779        "focusTrap": function(parentElement) {
1780            "use strict";
1781
1782            var focusableEls,
1783                firstFocusableEl,
1784                lastFocusableEl,
1785                filtered;
1786
1787            focusableEls = document.getElementById(parentElement).querySelectorAll('a[href], button');
1788            filtered = [];
1789
1790            // get only visible items
1791            for (var i = 0, max = focusableEls.length; i < max; i++) {
1792                if (focusableEls[i].offsetHeight > 0) {
1793                   filtered.push(focusableEls[i]);
1794                }
1795            }
1796
1797            firstFocusableEl = filtered[0];
1798            lastFocusableEl = filtered[filtered.length - 1];
1799
1800            //loop focus inside tarteaucitron
1801            document.getElementById(parentElement).addEventListener("keydown", function (evt) {
1802
1803                if ( evt.key === 'Tab' || evt.keyCode === 9 ) {
1804
1805                    if ( evt.shiftKey ) /* shift + tab */ {
1806                        if (document.activeElement === firstFocusableEl) {
1807                            lastFocusableEl.focus();
1808                            evt.preventDefault();
1809                        }
1810                    } else /* tab */ {
1811                        if (document.activeElement === lastFocusableEl) {
1812                            firstFocusableEl.focus();
1813                            evt.preventDefault();
1814                        }
1815                    }
1816                }
1817            })
1818        },
1819        "openAlert": function () {
1820            "use strict";
1821            var c = 'tarteaucitron';
1822            tarteaucitron.userInterface.css(c + 'Percentage', 'display', 'block');
1823            tarteaucitron.userInterface.css(c + 'AlertSmall', 'display', 'none');
1824            tarteaucitron.userInterface.css(c + 'Icon', 'display', 'none');
1825            tarteaucitron.userInterface.css(c + 'AlertBig',   'display', 'block');
1826            tarteaucitron.userInterface.addClass(c + 'Root',   'tarteaucitronBeforeVisible');
1827            tarteaucitron.userInterface.css('tac_title', 'display', 'block');
1828
1829            //ie compatibility
1830            var tacOpenAlertEvent;
1831            if(typeof(Event) === 'function') {
1832                tacOpenAlertEvent = new Event("tac.open_alert");
1833            }else if (typeof(document.createEvent) === 'function'){
1834                tacOpenAlertEvent = document.createEvent('Event');
1835                tacOpenAlertEvent.initEvent("tac.open_alert", true, true);
1836            }
1837            //end ie compatibility
1838
1839            if (document.getElementById('tarteaucitronAlertBig') !== null && tarteaucitron.parameters.orientation === 'middle') {
1840                document.getElementById('tarteaucitronAlertBig').focus();
1841                if (document.getElementsByTagName('html')[0].classList !== undefined) {
1842                    document.getElementsByTagName('html')[0].classList.add('tarteaucitron-modal-open-noscroll');
1843                }
1844            }
1845
1846            if (typeof(window.dispatchEvent) === 'function') {window.dispatchEvent(tacOpenAlertEvent);}
1847        },
1848        "closeAlert": function () {
1849            "use strict";
1850            var c = 'tarteaucitron';
1851            tarteaucitron.userInterface.css(c + 'Percentage', 'display', 'none');
1852            tarteaucitron.userInterface.css(c + 'AlertSmall', 'display', 'block');
1853            tarteaucitron.userInterface.css(c + 'Icon', 'display', 'block');
1854            tarteaucitron.userInterface.css(c + 'AlertBig',   'display', 'none');
1855            tarteaucitron.userInterface.removeClass(c + 'Root',   'tarteaucitronBeforeVisible');
1856            tarteaucitron.userInterface.jsSizing('box');
1857
1858            //ie compatibility
1859            var tacCloseAlertEvent;
1860            if(typeof(Event) === 'function') {
1861                tacCloseAlertEvent = new Event("tac.close_alert");
1862            }else if (typeof(document.createEvent) === 'function'){
1863                tacCloseAlertEvent = document.createEvent('Event');
1864                tacCloseAlertEvent.initEvent("tac.close_alert", true, true);
1865            }
1866            //end ie compatibility
1867
1868            if (tarteaucitron.parameters.showAlertSmall === false && tarteaucitron.parameters.showIcon === false) {
1869                tarteaucitron.userInterface.css('tac_title', 'display', 'none');
1870            }
1871
1872            if (document.getElementsByTagName('html')[0].classList !== undefined) {
1873                document.getElementsByTagName('html')[0].classList.remove('tarteaucitron-modal-open-noscroll');
1874            }
1875
1876            if (typeof(window.dispatchEvent) === 'function') {window.dispatchEvent(tacCloseAlertEvent);}
1877        },
1878        "toggleCookiesList": function () {
1879            "use strict";
1880            var div = document.getElementById('tarteaucitronCookiesListContainer'),
1881                togglediv = document.getElementById('tarteaucitronCookiesNumber');
1882
1883            if (div === null) {
1884                return;
1885            }
1886
1887            if (div.style.display !== 'block') {
1888                tarteaucitron.cookie.number();
1889                div.style.display = 'block';
1890                togglediv.setAttribute("aria-expanded", "true");
1891                tarteaucitron.userInterface.jsSizing('cookie');
1892                tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none');
1893                tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block');
1894                tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) {
1895                    elem.style.display = 'none';
1896                }, true);
1897            } else {
1898                div.style.display = 'none';
1899                togglediv.setAttribute("aria-expanded", "false");
1900                tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none');
1901                tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none');
1902            }
1903        },
1904        "toggle": function (id, closeClass) {
1905            "use strict";
1906            var div = document.getElementById(id);
1907
1908            if (div === null) {
1909                return;
1910            }
1911
1912            if (closeClass !== undefined) {
1913                tarteaucitron.fallback([closeClass], function (elem) {
1914                    if (elem.id !== id) {
1915                        elem.style.display = 'none';
1916                    }
1917                }, true);
1918            }
1919
1920            if (div.style.display !== 'block') {
1921                div.style.display = 'block';
1922            } else {
1923                div.style.display = 'none';
1924            }
1925        },
1926        "order": function (id) {
1927            "use strict";
1928            var main = document.getElementById('tarteaucitronServices_' + id),
1929                allDivs,
1930                store = [],
1931                i;
1932
1933            if (main === null) {
1934                return;
1935            }
1936
1937            allDivs = main.childNodes;
1938
1939            if (typeof Array.prototype.map === 'function' && typeof Enumerable === 'undefined') {
1940                Array.prototype.map.call(main.children, Object).sort(function (a, b) {
1941                //var mainChildren = Array.from(main.children);
1942                //mainChildren.sort(function (a, b) {
1943                    if (tarteaucitron.services[a.id.replace(/Line/g, '')].name > tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return 1; }
1944                    if (tarteaucitron.services[a.id.replace(/Line/g, '')].name < tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return -1; }
1945                    return 0;
1946                }).forEach(function (element) {
1947                    main.appendChild(element);
1948                });
1949            }
1950        },
1951        "taclayoutPending": false,
1952        "jsSizing": function (type) {
1953            "use strict";
1954
1955            if (tarteaucitron.taclayoutPending) return;
1956            tarteaucitron.taclayoutPending = true;
1957
1958            if (type === 'box') {
1959                var elCookiesNumber = document.getElementById('tarteaucitronCookiesNumber');
1960                if (elCookiesNumber) tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', '0px 10px');
1961            } else if (type === 'main') {
1962                var elServices = document.getElementById('tarteaucitronServices');
1963                if (elServices) tarteaucitron.userInterface.css('tarteaucitronServices', 'height', 'auto');
1964            } else if (type === 'cookie') {
1965                var elCookiesList = document.getElementById('tarteaucitronCookiesList');
1966                if (elCookiesList) tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', 'auto');
1967            }
1968
1969            window.requestAnimationFrame(function() {
1970                tarteaucitron.taclayoutPending = false;
1971
1972                var winH = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
1973                var winW = window.innerWidth || document.documentElement.clientWidth;
1974
1975                if (type === 'box') {
1976                    var elAlertSmall = document.getElementById('tarteaucitronAlertSmall');
1977                    var elCookiesNumber = document.getElementById('tarteaucitronCookiesNumber');
1978                    if (elAlertSmall && elCookiesNumber) {
1979                        var paddingBox = (elAlertSmall.offsetHeight - elCookiesNumber.offsetHeight) / 2;
1980                        tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', paddingBox + 'px 10px');
1981                    }
1982                }
1983
1984                else if (type === 'main') {
1985                    var elMain = document.getElementById('tarteaucitron');
1986                    var elClose = document.getElementById('tarteaucitronClosePanel');
1987                    var elServices = document.getElementById('tarteaucitronServices');
1988
1989                    if (elMain && elClose && elServices) {
1990                        var hMain = elMain.offsetHeight;
1991                        var hClose = elClose.offsetHeight;
1992
1993                        tarteaucitron.userInterface.css('tarteaucitronServices', 'height', (hMain - hClose + 4) + 'px');
1994                        tarteaucitron.userInterface.css('tarteaucitronServices', 'overflow-x', 'auto');
1995
1996                        var mTop = (winW <= 767) ? 0 : ((winH - hMain) / 2) - 21;
1997                        var elOffset = document.getElementById('tarteaucitronMainLineOffset');
1998                        if (hMain < (winH / 2) && elOffset) {
1999                            mTop -= elOffset.offsetHeight;
2000                        }
2001                        tarteaucitron.userInterface.css('tarteaucitron', 'top', Math.max(0, mTop) + 'px');
2002                    }
2003                }
2004
2005                else if (type === 'cookie') {
2006                    var elAlertSmall = document.getElementById('tarteaucitronAlertSmall');
2007                    var elCont = document.getElementById('tarteaucitronCookiesListContainer');
2008                    if (elAlertSmall && elCont) {
2009                        tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'bottom', elAlertSmall.offsetHeight + 'px');
2010
2011                        var elCloseC = document.getElementById('tarteaucitronClosePanelCookie');
2012                        var elTitleC = document.getElementById('tarteaucitronCookiesTitle');
2013                        var elListC = document.getElementById('tarteaucitronCookiesList');
2014                        if (elCloseC && elTitleC && elListC) {
2015                            var hList = elCont.offsetHeight - elCloseC.offsetHeight - elTitleC.offsetHeight - 2;
2016                            tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', hList + 'px');
2017                        }
2018                    }
2019                }
2020            });
2021        }
2022    },
2023    "cookie": {
2024        "owner": {},
2025        "create": function (key, status) {
2026            "use strict";
2027
2028            if (tarteaucitronForceExpire !== '') {
2029                // The number of day(s)/hour(s) can't be higher than 1 year
2030                if ((tarteaucitronExpireInDay && tarteaucitronForceExpire < 365) || (!tarteaucitronExpireInDay && tarteaucitronForceExpire < 8760)) {
2031                    if (tarteaucitronExpireInDay) {
2032                        // Multiplication to tranform the number of days to milliseconds
2033                        timeExpire = tarteaucitronForceExpire * 86400000;
2034                    } else {
2035                        // Multiplication to tranform the number of hours to milliseconds
2036                        timeExpire = tarteaucitronForceExpire * 3600000;
2037                    }
2038                }
2039            }
2040
2041            var d = new Date(),
2042                time = d.getTime(),
2043                expireTime = time + timeExpire, // 365 days
2044                regex = new RegExp("!" + key + "=(wait|true|false)", "g"),
2045                cookie = tarteaucitron.cookie.read().replace(regex, ""),
2046                value = tarteaucitron.parameters.cookieName + '=' + cookie + '!' + key + '=' + status,
2047                domain = (tarteaucitron.parameters.cookieDomain !== undefined && tarteaucitron.parameters.cookieDomain !== '') ? '; domain=' + tarteaucitron.parameters.cookieDomain : '',
2048                secure = location.protocol === 'https:' ? '; Secure' : '';
2049
2050            d.setTime(expireTime);
2051            document.cookie = value + '; expires=' + d.toGMTString() + '; path=/' + domain + secure + '; samesite=lax';
2052
2053            tarteaucitron.sendEvent('tac.consent_updated');
2054        },
2055        "read": function () {
2056            "use strict";
2057            var nameEQ = tarteaucitron.parameters.cookieName + "=",
2058                ca = document.cookie.split(';'),
2059                i,
2060                c;
2061
2062            for (i = 0; i < ca.length; i += 1) {
2063                c = ca[i];
2064                while (c.charAt(0) === ' ') {
2065                    c = c.substring(1, c.length);
2066                }
2067                if (c.indexOf(nameEQ) === 0) {
2068                    return c.substring(nameEQ.length, c.length);
2069                }
2070            }
2071            return '';
2072        },
2073        "purge": function (arr) {
2074            "use strict";
2075
2076            var i,
2077                j,
2078                k,
2079                service,
2080                allowed,
2081                rgxpCookie;
2082
2083            for (i = 0; i < arr.length; i += 1) {
2084
2085                allowed = false;
2086
2087                if (tarteaucitron.parameters.cookieslist !== true && tarteaucitron.parameters.cookieslistEmbed !== true) {
2088
2089                    for (j = 0; j < tarteaucitron.job.length; j += 1) {
2090
2091                        service = tarteaucitron.services[tarteaucitron.job[j]];
2092
2093                        if (service !== undefined && service.cookies !== undefined) {
2094
2095                            for (k = 0; k < service.cookies.length; k += 1) {
2096
2097                                if (service.cookies[k] === arr[i]) {
2098                                    allowed = true;
2099                                    break;
2100                                }
2101                            }
2102                        }
2103
2104                        if (allowed) {
2105                            break;
2106                        }
2107                    }
2108
2109                    if (!allowed) {
2110                        continue;
2111                    }
2112                }
2113
2114                rgxpCookie = new RegExp("^(.*;)?\\s*" + arr[i] + "\\s*=\\s*[^;]+(.*)?$");
2115
2116                if (document.cookie.match(rgxpCookie)) {
2117                    document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/;';
2118                    document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname + ';';
2119                    document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname.split('.').slice(-2).join('.') + ';';
2120                }
2121            }
2122        },
2123        "checkCount": function (key) {
2124            "use strict";
2125            var arr = tarteaucitron.services[key].cookies,
2126                nb = arr.length,
2127                nbCurrent = 0,
2128                html = '',
2129                i,
2130                status = document.cookie.indexOf(key + '=true'),
2131                cookieLabel = "cookie";
2132
2133            if (tarteaucitron.getLanguage() === "de") {
2134                cookieLabel = "Cookie";
2135            }
2136
2137            if (status >= 0 && nb === 0) {
2138                html += tarteaucitron.lang.useNoCookie;
2139            } else if (nb > 0) {
2140                for (i = 0; i < nb; i += 1) {
2141                    if (document.cookie.indexOf(arr[i] + '=') !== -1) {
2142                        nbCurrent += 1;
2143                        if (tarteaucitron.cookie.owner[arr[i]] === undefined) {
2144                            tarteaucitron.cookie.owner[arr[i]] = [];
2145                        }
2146                        if (tarteaucitron.cookie.crossIndexOf(tarteaucitron.cookie.owner[arr[i]], tarteaucitron.services[key].name) === false) {
2147                            tarteaucitron.cookie.owner[arr[i]].push(tarteaucitron.services[key].name);
2148                        }
2149                    }
2150                }
2151
2152                if (nbCurrent > 0) {
2153                    html += tarteaucitron.lang.useCookieCurrent + ' ' + nbCurrent + ' ' + cookieLabel;
2154                    if (nbCurrent > 1) {
2155                        html += 's';
2156                    }
2157                    html += '.';
2158                } else {
2159                    html += tarteaucitron.lang.useNoCookie;
2160                }
2161            } else if (nb === 0) {
2162                html = tarteaucitron.lang.noCookie;
2163            } else {
2164                html += tarteaucitron.lang.useCookie + ' ' + nb + ' ' + cookieLabel;
2165                if (nb > 1) {
2166                    html += 's';
2167                }
2168                html += '.';
2169            }
2170
2171            if (document.getElementById('tacCL' + key) !== null) {
2172                document.getElementById('tacCL' + key).innerHTML = html;
2173            }
2174        },
2175        "crossIndexOf": function (arr, match) {
2176            "use strict";
2177            var i;
2178            for (i = 0; i < arr.length; i += 1) {
2179                if (arr[i] === match) {
2180                    return true;
2181                }
2182            }
2183            return false;
2184        },
2185        "number": function () {
2186            "use strict";
2187            var cookies = document.cookie.split(';'),
2188                nb = (document.cookie !== '') ? cookies.length : 0,
2189                html = '',
2190                i,
2191                name,
2192                namea,
2193                nameb,
2194                c,
2195                d,
2196                s = (nb > 1) ? 's' : '',
2197                savedname,
2198                regex = /^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i,
2199                regexedDomain = (tarteaucitron.cdn.match(regex) !== null) ? tarteaucitron.cdn.match(regex)[1] : tarteaucitron.cdn,
2200                host = (tarteaucitron.domain !== undefined) ? tarteaucitron.domain : regexedDomain;
2201
2202            cookies = cookies.sort(function (a, b) {
2203                namea = a.split('=', 1).toString().replace(/ /g, '');
2204                nameb = b.split('=', 1).toString().replace(/ /g, '');
2205                c = (tarteaucitron.cookie.owner[namea] !== undefined) ? tarteaucitron.cookie.owner[namea] : '0';
2206                d = (tarteaucitron.cookie.owner[nameb] !== undefined) ? tarteaucitron.cookie.owner[nameb] : '0';
2207                if (c + a > d + b) { return 1; }
2208                if (c + a < d + b) { return -1; }
2209                return 0;
2210            });
2211
2212            if (document.cookie !== '') {
2213                for (i = 0; i < nb; i += 1) {
2214                    name = cookies[i].split('=', 1).toString().replace(/ /g, '');
2215                    if (tarteaucitron.cookie.owner[name] !== undefined && tarteaucitron.cookie.owner[name].join(' // ') !== savedname) {
2216                        savedname = tarteaucitron.cookie.owner[name].join(' // ');
2217                        html += '<div class="tarteaucitronHidden">';
2218                        html += '     <span class="tarteaucitronH3" role="heading" aria-level="4">';
2219                        html += '        ' + tarteaucitron.cookie.owner[name].join(' // ');
2220                        html += '    </span>';
2221                        html += '</div><ul class="cookie-list">';
2222                    } else if (tarteaucitron.cookie.owner[name] === undefined && host !== savedname) {
2223                        savedname = host;
2224                        html += '<div class="tarteaucitronHidden">';
2225                        html += '     <span class="tarteaucitronH3" role="heading" aria-level="4">';
2226                        html += '        ' + host;
2227                        html += '    </span>';
2228                        html += '</div><ul class="cookie-list">';
2229                    }
2230                    html += '<li class="tarteaucitronCookiesListMain">';
2231                    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>';
2232                    html += '    </div>';
2233                    html += '    <div class="tarteaucitronCookiesListRight">' + tarteaucitron.cookie.beautify(cookies[i].split('=').slice(1).join('=')) + '</div>';
2234                    html += '</li>';
2235                }
2236                html += '</ul>';
2237            } else {
2238                html += '<div class="tarteaucitronCookiesListMain">';
2239                html += '    <div class="tarteaucitronCookiesListLeft"><strong>-</strong></div>';
2240                html += '    <div class="tarteaucitronCookiesListRight"></div>';
2241                html += '</div>';
2242            }
2243
2244            html += '<div class="tarteaucitronHidden tarteaucitron-spacer-20"></div>';
2245
2246            if (document.getElementById('tarteaucitronCookiesList') !== null) {
2247                document.getElementById('tarteaucitronCookiesList').innerHTML = html;
2248            }
2249
2250            if (document.getElementById('tarteaucitronCookiesNumber') !== null) {
2251                document.getElementById('tarteaucitronCookiesNumber').innerHTML = nb;
2252                document.getElementById('tarteaucitronCookiesNumber').setAttribute("aria-label", nb + ' cookie' + s + " - " + tarteaucitron.lang.toggleInfoBox);
2253                document.getElementById('tarteaucitronCookiesNumber').setAttribute("title", nb + ' cookie' + s + " - " + tarteaucitron.lang.toggleInfoBox);
2254            }
2255
2256            if (document.getElementById('tarteaucitronCookiesNumberBis') !== null) {
2257                document.getElementById('tarteaucitronCookiesNumberBis').innerHTML = nb + ' cookie' + s;
2258            }
2259
2260            var purgeBtns = document.getElementsByClassName("purgeBtn");
2261            for (i = 0; i < purgeBtns.length; i++) {
2262                tarteaucitron.addClickEventToElement(purgeBtns[i], function () {
2263                    tarteaucitron.cookie.purge([this.dataset.cookie]);
2264                    tarteaucitron.cookie.number();
2265                    tarteaucitron.userInterface.jsSizing('cookie');
2266                    return false;
2267                });
2268            }
2269
2270            for (i = 0; i < tarteaucitron.job.length; i += 1) {
2271                tarteaucitron.cookie.checkCount(tarteaucitron.job[i]);
2272            }
2273        },
2274        "beautify": function(v) {
2275            let beautiful = v;
2276            try {
2277                beautiful = decodeURIComponent(decodeURI(v));
2278            } catch {}
2279            return tarteaucitron.fixSelfXSS(beautiful);
2280        }
2281    },
2282    "fixSelfXSS": function(html) {
2283        return html.toString().replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
2284    },
2285    "getLanguage": function () {
2286        "use strict";
2287
2288        var availableLanguages = 'ar,bg,ca,cn,cs,da,de,et,el,en,es,fi,fr,hr,hu,it,ja,ko,lb,lt,lv,nl,no,oc,pl,pt,ro,ru,se,sk,sq,sv,tr,uk,vi,zh',
2289            defaultLanguage = 'en';
2290
2291        if (tarteaucitronForceLanguage !== '') {
2292            if (availableLanguages.indexOf(tarteaucitronForceLanguage) !== -1) {
2293                return tarteaucitronForceLanguage;
2294            }
2295        }
2296
2297        // get the html lang
2298        if (document.documentElement.getAttribute("lang") !== undefined && document.documentElement.getAttribute("lang") !== null && document.documentElement.getAttribute("lang") !== "") {
2299            if (availableLanguages.indexOf(document.documentElement.getAttribute("lang").substr(0, 2)) !== -1) {
2300                return document.documentElement.getAttribute("lang").substr(0, 2);
2301            }
2302        }
2303
2304        if (!navigator) { return defaultLanguage; }
2305
2306        var lang = navigator.language || navigator.browserLanguage ||
2307                navigator.systemLanguage || navigator.userLang || null,
2308            userLanguage = lang ? lang.substr(0, 2) : null;
2309
2310        if (availableLanguages.indexOf(userLanguage) !== -1) {
2311            return userLanguage;
2312        }
2313
2314        return defaultLanguage;
2315    },
2316    "getLocale": function () {
2317        "use strict";
2318        if (!navigator) { return 'en_US'; }
2319
2320        var lang = navigator.language || navigator.browserLanguage ||
2321                navigator.systemLanguage || navigator.userLang || null,
2322            userLanguage = lang ? lang.substr(0, 2) : null;
2323
2324        if (userLanguage === 'fr') {
2325            return 'fr_FR';
2326        } else if (userLanguage === 'en') {
2327            return 'en_US';
2328        } else if (userLanguage === 'de') {
2329            return 'de_DE';
2330        } else if (userLanguage === 'es') {
2331            return 'es_ES';
2332        } else if (userLanguage === 'it') {
2333            return 'it_IT';
2334        } else if (userLanguage === 'pt') {
2335            return 'pt_PT';
2336        } else if (userLanguage === 'nl') {
2337            return 'nl_NL';
2338        } else if (userLanguage === 'el') {
2339            return 'el_EL';
2340        } else {
2341            return 'en_US';
2342        }
2343    },
2344    "addScript": function (url, id, callback, execute, attrName, attrVal, internal) {
2345        "use strict";
2346        var script,
2347            done = false;
2348
2349        if (execute === false) {
2350            if (typeof callback === 'function') {
2351                callback();
2352            }
2353        } else {
2354            script = document.createElement('script');
2355            if (id !== undefined && id !== "") {
2356                script.id = id;
2357            }
2358            script.async = true;
2359            script.src = url;
2360
2361            if (attrName !== undefined && attrVal !== undefined) {
2362                script.setAttribute(attrName, attrVal);
2363            }
2364
2365            if (typeof callback === 'function') {
2366                if ( !tarteaucitron.parameters.useExternalJs || !internal ) {
2367                    script.onreadystatechange = script.onload = function () {
2368                        var state = script.readyState;
2369                        if (!done && (!state || /loaded|complete/.test(state))) {
2370                            done = true;
2371                            callback();
2372                        }
2373                    };
2374                } else {
2375                    callback();
2376                }
2377            }
2378
2379            if ( !tarteaucitron.parameters.useExternalJs || !internal ) {
2380                document.getElementsByTagName('head')[0].appendChild(script);
2381            }
2382        }
2383    },
2384    "addInternalScript": function (url, id, callback, execute, attrName, attrVal) {
2385        tarteaucitron.addScript(url, id, callback, execute, attrName, attrVal, true);
2386    },
2387    "checkIfExist": function (elemId) {
2388        "use strict";
2389        return document.getElementById(elemId) !== null && document.getElementById(elemId).offsetWidth !== 0 && document.getElementById(elemId).offsetHeight !== 0;
2390    },
2391    "makeAsync": {
2392        "antiGhost": 0,
2393        "buffer": '',
2394        "init": function (url, id) {
2395            "use strict";
2396            var savedWrite = document.write,
2397                savedWriteln = document.writeln;
2398
2399            document.write = function (content) {
2400                tarteaucitron.makeAsync.buffer += content;
2401            };
2402            document.writeln = function (content) {
2403                tarteaucitron.makeAsync.buffer += content.concat("\n");
2404            };
2405
2406            setTimeout(function () {
2407                document.write = savedWrite;
2408                document.writeln = savedWriteln;
2409            }, 20000);
2410
2411            tarteaucitron.makeAsync.getAndParse(url, id);
2412        },
2413        "getAndParse": function (url, id) {
2414            "use strict";
2415            if (tarteaucitron.makeAsync.antiGhost > 9) {
2416                tarteaucitron.makeAsync.antiGhost = 0;
2417                return;
2418            }
2419            tarteaucitron.makeAsync.antiGhost += 1;
2420            tarteaucitron.addInternalScript(url, '', function () {
2421                if (document.getElementById(id) !== null) {
2422                    document.getElementById(id).innerHTML += "<span class='tarteaucitron-display-none'>&nbsp;</span>" + tarteaucitron.makeAsync.buffer;
2423                    tarteaucitron.makeAsync.buffer = '';
2424                    tarteaucitron.makeAsync.execJS(id);
2425                }
2426            });
2427        },
2428        "execJS": function (id) {
2429            /* not strict because third party scripts may have errors */
2430            var i,
2431                scripts,
2432                childId,
2433                type;
2434
2435            if (document.getElementById(id) === null) {
2436                return;
2437            }
2438
2439            scripts = document.getElementById(id).getElementsByTagName('script');
2440            for (i = 0; i < scripts.length; i += 1) {
2441                type = (scripts[i].getAttribute('type') !== null) ? scripts[i].getAttribute('type') : '';
2442                if (type === '') {
2443                    type = (scripts[i].getAttribute('language') !== null) ? scripts[i].getAttribute('language') : '';
2444                }
2445                if (scripts[i].getAttribute('src') !== null && scripts[i].getAttribute('src') !== '') {
2446                    childId = id + Math.floor(Math.random() * 99999999999);
2447                    document.getElementById(id).innerHTML += '<div id="' + childId + '"></div>';
2448                    tarteaucitron.makeAsync.getAndParse(scripts[i].getAttribute('src'), childId);
2449                } else if (type.indexOf('javascript') !== -1 || type === '') {
2450                    eval(scripts[i].innerHTML);
2451                }
2452            }
2453        }
2454    },
2455    "fallback": function (matchClass, content, noInner) {
2456        "use strict";
2457        var selector = matchClass.map(function(cls) {
2458            return '.' + cls;
2459        }).join(', ');
2460
2461        var elems = document.querySelectorAll(selector);
2462
2463        for (var i = 0; i < elems.length; i++) {
2464            var elem = elems[i];
2465
2466            var width = tarteaucitron.getElemAttr(elem, 'width'),
2467                height = tarteaucitron.getElemAttr(elem, 'height');
2468
2469            if (width !== "") {
2470                elem.style.width = tarteaucitron.getStyleSize(width);
2471            }
2472            if (height !== "") {
2473                elem.style.height = tarteaucitron.getStyleSize(height);
2474            }
2475
2476            if (typeof content === 'function') {
2477                if (noInner === true) {
2478                    content(elem);
2479                } else {
2480                    elem.innerHTML = content(elem);
2481                }
2482            } else {
2483                elem.innerHTML = content;
2484            }
2485        }
2486    },
2487    "engage": function (id) {
2488        "use strict";
2489        var html = '',
2490            r = Math.floor(Math.random() * 100000),
2491            engage = tarteaucitron.services[id].name + ' ' + tarteaucitron.lang.fallback;
2492
2493        if (tarteaucitron.lang['engage-' + id] !== undefined) {
2494            engage = tarteaucitron.lang['engage-' + id];
2495        }
2496
2497        html += '<div class="tac_activate tac_activate_' + id + '">';
2498        html += '   <div class="tac_float">';
2499        html += '      <span role="paragraph">' + engage + '</span>';
2500        html += '      <button aria-label="' + tarteaucitron.lang.allow + ' ' + tarteaucitron.services[id].name + '" type="button" class="tarteaucitronAllow" id="Eng' + r + 'ed' + id + '">';
2501        html += '          <span class="tarteaucitronCheck" aria-hidden="true"></span> ' + tarteaucitron.lang.allow;
2502        html += '       </button>';
2503        html += '   </div>';
2504        html += '</div>';
2505
2506        return html;
2507    },
2508    "extend": function (a, b) {
2509        "use strict";
2510        var prop;
2511        for (prop in b) {
2512            if (b.hasOwnProperty(prop)) {
2513                a[prop] = b[prop];
2514            }
2515        }
2516    },
2517    "proTemp": '',
2518    "proTimer": function () {
2519        "use strict";
2520        setTimeout(tarteaucitron.proPing, (Math.floor(Math.random() * (1200 - 500 + 1)) + 500));
2521    },
2522    "pro": function (list) {
2523        "use strict";
2524        tarteaucitron.proTemp += list;
2525        clearTimeout(tarteaucitron.proTimer);
2526        tarteaucitron.proTimer = setTimeout(tarteaucitron.proPing, (Math.floor(Math.random() * (1200 - 500 + 1)) + 500));
2527    },
2528    "proPing": function () {
2529        "use strict";
2530        if (tarteaucitron.uuid !== '' && tarteaucitron.uuid !== undefined && tarteaucitron.proTemp !== '' && tarteaucitronStatsEnabled) {
2531            var div = document.getElementById('tarteaucitronPremium'),
2532                timestamp = new Date().getTime(),
2533                url = 'https://logs.tarteaucitron.io/collect';
2534
2535            if (div === null) {
2536                return;
2537            }
2538
2539            var beaconSent = false;
2540            if (navigator.sendBeacon) {
2541                var data = {
2542                    'uuid': tarteaucitron.uuid,
2543                    'domain': tarteaucitron.domain,
2544                    'status': tarteaucitron.proTemp
2545                };
2546                var params = new URLSearchParams(data);
2547                beaconSent = navigator.sendBeacon(url, params);
2548            }
2549
2550            if (!beaconSent) {
2551                url += '?uuid=' + tarteaucitron.uuid + '&';
2552                url += 'domain=' + tarteaucitron.domain + '&';
2553                url += 'status=' + encodeURIComponent(tarteaucitron.proTemp) + '&';
2554                url += '_time=' + timestamp;
2555
2556                div.innerHTML = '<img src="' + url + '" class="tarteaucitron-display-none" alt="" />';
2557            }
2558
2559            tarteaucitron.proTemp = '';
2560        }
2561
2562        tarteaucitron.cookie.number();
2563    },
2564    "AddOrUpdate" : function(source, custom){
2565        /**
2566         Utility function to Add or update the fields of obj1 with the ones in obj2
2567         */
2568        for(var key in custom){
2569            if (key === "__proto__" || key === "constructor") continue;
2570            if(custom.hasOwnProperty(key)){
2571                if(custom[key] instanceof Object){
2572                    source[key] = tarteaucitron.AddOrUpdate(source[key], custom[key]);
2573                }else{
2574                    source[key] = custom[key];
2575                }
2576            }
2577        }
2578        return source;
2579    },
2580    "getElemWidth": function(elem) {
2581        return tarteaucitron.getElemAttr(elem, 'width') || elem.clientWidth;
2582    },
2583    "getElemHeight": function(elem) {
2584        return tarteaucitron.getElemAttr(elem, 'height') || elem.clientHeight;
2585    },
2586    "getElemAttr": function (elem, attr) {
2587
2588        var attribute = elem.getAttribute('data-' + attr) || elem.getAttribute(attr) || elem.getAttribute(attr.startsWith('data-') ? attr.slice(5) : attr);
2589
2590        // security: only allow real url on the url attr
2591        if ((attr === 'url' || attr === 'data-url' || attr === 'data-src') && !/^https?:\/\/[^\s]+$/.test(elem.getAttribute(attr))) {
2592            return "";
2593        }
2594
2595        // security: disallow data-srcdoc attr to avoid xss
2596        if (attr === 'srcdoc' || attr === 'data-srcdoc') {
2597            attribute = elem.getAttribute('srcdoc');
2598        }
2599
2600        if (typeof attribute === 'string') {
2601            return tarteaucitron.fixSelfXSS(attribute);
2602        }
2603
2604        return "";
2605    },
2606    "getStyleSize": function (value) {
2607        if (value == null) {
2608            return 'auto';
2609        }
2610
2611        value = String(value).trim();
2612
2613        var units = ['px', '%', 'em', 'rem', 'vh', 'vw', 'vmin', 'vmax', 'ch', 'ex', 'pt', 'pc', 'cm', 'mm', 'in', 'q'];
2614        var pattern = new RegExp('^\\d+(\\.\\d+)?(' + units.join('|') + ')$');
2615
2616        if (pattern.test(value)) {
2617            return value;
2618        }
2619
2620        if (/^\d+(\.\d+)?$/.test(value)) {
2621            return value + 'px';
2622        }
2623
2624        return 'auto';
2625    },
2626    "addClickEventToId": function (elemId, func) {
2627        tarteaucitron.addClickEventToElement(document.getElementById(elemId), func);
2628    },
2629    "addClickEventToElement": function (e, func) {
2630        if (e) {
2631            if (e.addEventListener) {
2632                e.addEventListener("click", func);
2633            } else {
2634                e.attachEvent("onclick", func);
2635            }
2636        }
2637    },
2638    "triggerJobsAfterAjaxCall": function() {
2639        tarteaucitron.job.forEach(function(e) { tarteaucitron.job.push(e) });
2640        var i;
2641        var allowBtns = document.getElementsByClassName("tarteaucitronAllow");
2642        for (i = 0; i < allowBtns.length; i++) {
2643            tarteaucitron.addClickEventToElement(allowBtns[i], function () {
2644                tarteaucitron.userInterface.respond(this, true);
2645            });
2646        }
2647        var denyBtns = document.getElementsByClassName("tarteaucitronDeny");
2648        for (i = 0; i < denyBtns.length; i++) {
2649            tarteaucitron.addClickEventToElement(denyBtns[i], function () {
2650                tarteaucitron.userInterface.respond(this, false);
2651            });
2652        }
2653    },
2654    "dynamicJobPush": function(id) {
2655        if (tarteaucitron.added[id] !== true) {
2656            tarteaucitron.job.push(id);
2657        } else {
2658            if ((typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + id + "_") < 0) && 
2658tarteaucitron.parameters.serverSide !== true) {
2659                if(tarteaucitron.state[id] === true && typeof tarteaucitron.services[id].js === 'function') {
2660                    tarteaucitron.services[id].js();
2661                } else if (typeof tarteaucitron.services[id].fallback === 'function') {
2662                    tarteaucitron.services[id].fallback();
2663                }
2664            }
2665        }
2666        tarteaucitron.triggerJobsAfterAjaxCall();
2667    }
2668};

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.