PageSourceSearch

https://www.wikio.com/mon-salaire/main.js

js wikio.com collected 2026-10-02 06:05:42 UTC 331,612 bytes, 7,064 lines download raw bytes

1document.addEventListener("DOMContentLoaded", function() {
2    function getRandomSalary(min, max) {
3        return Math.floor(Math.random() * (max - min + 1)) + min;
4    }
5
6    const salaire1Value = getRandomSalary(5, 10000);
7    const salaire2Value = getRandomSalary(5, 10000);
8
9    const salaire1 = document.getElementById("salaire1");
10    const salaire2 = document.getElementById("salaire2");
11
12    salaire1.textContent = `${salaire1Value} euros brut en net`;
13    salaire1.href = `https://www.wikio.com/mon-salaire/?salaire=${salaire1Value}`;
14
15    salaire2.textContent = `${salaire2Value} euros brut en net`;
16    salaire2.href = `https://www.wikio.com/mon-salaire/?salaire=${salaire2Value}`;
17});
18
19var position = $(".sticky-footer").css("position");
20var footer = $(".sticky-footer");
21var datetimeStart = Date.now();
22jQuery.fn.extend({
23    autoHeight: function () {
24        function autoHeight_(element) {
25            return jQuery(element).css({ height: "auto", "overflow-y": "hidden" }).height(element.scrollHeight);
26        }
27        return this.each(function () {
28            autoHeight_(this).on("input", function () {
29                autoHeight_(this);
30            });
31        });
32    },
33});
34$.fn.isInViewport = function () {
35    if ($(this).length) {
36        var elementTop = $(this).offset().top;
37        var elementBottom = elementTop + $(this).outerHeight();
38        var viewportTop = $(window).scrollTop();
39        var viewportBottom = viewportTop + $(window).height();
40        return elementBottom > viewportTop && elementTop < viewportBottom;
41    }
42};
43(function (root, name, factory) {
44    if (typeof define === "function" && define.amd) {
45        define([], factory);
46    } else if (typeof module !== "undefined" && typeof exports === "object") {
47        module.exports = factory();
48    } else {
49        root[name] = factory();
50    }
51})(this, "withinviewport", function () {
52    var canUseWindowDimensions = window.innerHeight !== undefined;
53    var withinviewport = function withinviewport(elem, options) {
54        var result = !1;
55        var metadata = {};
56        var config = {};
57        var settings;
58        var isWithin;
59        var elemBoundingRect;
60        var sideNamesPattern;
61        var sides;
62        var side;
63        var i;
64        if (typeof jQuery !== "undefined" && elem instanceof jQuery) {
65            elem = elem.get(0);
66        }
67        if (typeof elem !== "object" || elem.nodeType !== 1) {
68            throw new Error("First argument must be an element");
69        }
70        if (elem.getAttribute("data-withinviewport-settings") && window.JSON) {
71            metadata = JSON.parse(elem.getAttribute("data-withinviewport-settings"));
72        }
73        if (typeof options === "string") {
74            settings = { sides: options };
75        } else {
76            settings = options || {};
77        }
78        config.container = settings.container || metadata.container || withinviewport.defaults.container || window;
79        config.sides = settings.sides || metadata.sides || withinviewport.defaults.sides || "all";
80        config.top = settings.top || metadata.top || withinviewport.defaults.top || 0;
81        config.right = settings.right || metadata.right || withinviewport.defaults.right || 0;
82        config.bottom = settings.bottom || metadata.bottom || withinviewport.defaults.bottom || 0;
83        config.left = settings.left || metadata.left || withinviewport.defaults.left || 0;
84        if (config.container === document.body || !config.container.nodeType === 1) {
85            config.container = window;
86        }
87        isWithin = {
88            top: function _isWithin_top() {
89                return elemBoundingRect.top >= config.top;
90            },
91            right: function _isWithin_right() {
92                var containerWidth;
93                if (canUseWindowDimensions || config.container !== window) {
94                    containerWidth = config.container.innerWidth;
95                } else {
96                    containerWidth = document.documentElement.clientWidth;
97                }
98                return elemBoundingRect.right <= containerWidth - config.right;
99            },
100            bottom: function _isWithin_bottom() {
101                var containerHeight;
102                if (canUseWindowDimensions || config.container !== window) {
103                    containerHeight = config.container.innerHeight;
104                } else {
105                    containerHeight = document.documentElement.clientHeight;
106                }
107                return elemBoundingRect.bottom <= containerHeight - config.bottom;
108            },
109            left: function _isWithin_left() {
110                return elemBoundingRect.left >= config.left;
111            },
112            all: function _isWithin_all() {
113                return isWithin.top() && isWithin.bottom() && isWithin.left() && isWithin.right();
114            },
115        };
116        elemBoundingRect = elem.getBoundingClientRect();
117        sideNamesPattern = /^top$|^right$|^bottom$|^left$|^all$/;
118        sides = config.sides.split(" ");
119        i = sides.length;
120        while (i--) {
121            side = sides[i].toLowerCase();
122            if (sideNamesPattern.test(side)) {
123                if (isWithin[side]()) {
124                    result = !0;
125                } else {
126                    result = !1;
127                    break;
128                }
129            }
130        }
131        return result;
132    };
133    withinviewport.prototype.defaults = { container: document.body, sides: "all", top: 0, right: 0, bottom: 0, left: 0 };
134    withinviewport.defaults = withinviewport.prototype.defaults;
135    withinviewport.prototype.top = function _withinviewport_top(element) {
136        return withinviewport(element, "top");
137    };
138    withinviewport.prototype.right = function _withinviewport_right(element) {
139        return withinviewport(element, "right");
140    };
141    withinviewport.prototype.bottom = function _withinviewport_bottom(element) {
142        return withinviewport(element, "bottom");
143    };
144    withinviewport.prototype.left = function _withinviewport_left(element) {
145        return withinviewport(element, "left");
146    };
147    return withinviewport;
148});
149(function ($) {
150    $.fn.withinviewport = function (settings) {
151        var opts;
152        var elems;
153        if (typeof settings === "string") {
154            settings = { sides: settings };
155        }
156        opts = $.extend({}, settings, { sides: "all" });
157        elems = [];
158        this.each(function () {
159            if (withinviewport(this, opts)) {
160                elems.push(this);
161            }
162        });
163        return $(elems);
164    };
165    $.extend($.expr[":"], {
166        "within-viewport": function (element) {
167            return withinviewport(element, "all");
168        },
169    });
170    $.fn.withinviewporttop = function (settings) {
171        var opts;
172        var elems;
173        if (typeof settings === "string") {
174            settings = { sides: settings };
175        }
176        opts = $.extend({}, settings, { sides: "top" });
177        elems = [];
178        this.each(function () {
179            if (withinviewport(this, opts)) {
180                elems.push(this);
181            }
182        });
183        return $(elems);
184    };
185    $.fn.withinviewportright = function (settings) {
186        var opts;
187        var elems;
188        if (typeof settings === "string") {
189            settings = { sides: settings };
190        }
191        opts = $.extend({}, settings, { sides: "right" });
192        elems = [];
193        this.each(function () {
194            if (withinviewport(this, opts)) {
195                elems.push(this);
196            }
197        });
198        return $(elems);
199    };
200    $.fn.withinviewportbottom = function (settings) {
201        var opts;
202        var elems;
203        if (typeof settings === "string") {
204            settings = { sides: settings };
205        }
206        opts = $.extend({}, settings, { sides: "bottom" });
207        elems = [];
208        this.each(function () {
209            if (withinviewport(this, opts)) {
210                elems.push(this);
211            }
212        });
213        return $(elems);
214    };
215    $.fn.withinviewportleft = function (settings) {
216        var opts;
217        var elems;
218        if (typeof settings === "string") {
219            settings = { sides: settings };
220        }
221        opts = $.extend({}, settings, { sides: "left" });
222        elems = [];
223        this.each(function () {
224            if (withinviewport(this, opts)) {
225                elems.push(this);
226            }
227        });
228        return $(elems);
229    };
230    $.extend($.expr[":"], {
231        "within-viewport-top": function (element) {
232            return withinviewport(element, "top");
233        },
234        "within-viewport-right": function (element) {
235            return withinviewport(element, "right");
236        },
237        "within-viewport-bottom": function (element) {
238            return withinviewport(element, "bottom");
239        },
240        "within-viewport-left": function (element) {
241            return withinviewport(element, "left");
242        },
243    });
244    $.fn.withinViewportTop = function (settings) {
245        try {
246            console.warn("DEPRECATED: use lowercase `withinviewporttop()` instead");
247        } catch (e) {}
248        return $.fn.withinviewporttop(settings);
249    };
250    $.fn.withinViewportRight = function (settings) {
251        try {
252            console.warn("DEPRECATED: use lowercase `withinviewportright()` instead");
253        } catch (e) {}
254        return $.fn.withinviewportright(settings);
255    };
256    $.fn.withinViewportBottom = function (settings) {
257        try {
258            console.warn("DEPRECATED: use lowercase `withinviewportbottom()` instead");
259        } catch (e) {}
260        return $.fn.withinviewportbottom(settings);
261    };
262    $.fn.withinViewportLeft = function (settings) {
263        try {
264            console.warn("DEPRECATED: use lowercase `withinviewportleft()` instead");
265        } catch (e) {}
266        return $.fn.withinviewportleft(settings);
267    };
268})(jQuery);
269$(".btn-group a").unbind("click");
270$(".btn-group a").on("click", function () {
271    var sel = $(this).data("title");
272    var tog = $(this).data("toggle");
273    $("label[for=" + tog + "]").css("color", "");
274    $("#error-" + tog).text("");
275    $("#error-" + tog).removeClass("invalid");
276    $(this).removeClass("invalid");
277    $("#" + tog).prop("value", sel);
278    $('label[for="' + tog + '"]').css("color", "");
279    $('label[for="' + tog + '"]').removeClass("invalid");
280    $('a[data-toggle="' + tog + '"]')
281        .not('[data-title="' + sel + '"]')
282        .removeClass("active")
283        .addClass("notActive");
284    $('a[data-toggle="' + tog + '"][data-title="' + sel + '"]')
285        .removeClass("notActive")
286        .addClass("active");
287});
288function UIisTimeToDo() {
289    var millis = Date.now() - datetimeStart;
290    var seconds = Math.floor(millis / 1000);
291    if (millis > 500) {
292        datetimeStart = Date.now();
293        return !0;
294    } else {
295        return !1;
296    }
297}
298function updateMainBottom() {}
299function ifFooterVisible() {
300    updateMainBottom();
301    if ($("footer").isInViewport()) {
302        footer.addClass("hidden");
303    } else {
304        footer.removeClass("hidden");
305    }
306    if ($("footer, .stop-sticky").isInViewport()) {
307        if (footer.css("position") == "fixed") {
308            if (UIisTimeToDo()) {
309                log("catch relative");
310                footer.css("position", "relative");
311                footer.removeClass("bottom-sticked");
312            }
313        }
314    } else {
315        if (footer.css("position") == "relative") {
316            if (UIisTimeToDo()) {
317                if (footer.isInViewport()) {
318                }
319                log("catch fixed");
320                footer.css("position", "fixed");
321                footer.addClass("bottom-sticked");
322            }
323        }
324    }
325}
326function setupLoadingButtons() {
327    $(".btn-loading").unbind("click");
328    $(".btn-loading").on("click", function () {
329        var $this = $(this);
330        setupLoadingButton($this);
331    });
332}
333function setupLoadingDelayedButtons() {
334    $(".btn-loading-delayed").unbind("click");
335    $(".btn-loading-delayed").on("click", function () {
336        var $this = $(this);
337        setupLoadingButton($this);
338    });
339}
340function setupLoadingButton(object) {
341    var $this = object;
342    var loadingTextValue = $this.attr("data-loading-text");
343    if (loadingTextValue == undefined) {
344        loadingTextValue = "chargement...";
345    }
346    var loadingText = '<i class="fas fa-circle-notch fa-spin"></i> ' + loadingTextValue + "";
347    if ($this.html() !== loadingText) {
348        $this.data("original-text", $this.html());
349        $this.attr("data-original-text", $this.html());
350        $this.html(loadingText);
351        $this.addClass("btn-is-loading disabled");
352    }
353}
354$(document).ready(function () {
355    updateMainBottom();
356});
357function formRenderingManager() {}
358function resizeManagementPosition() {}
359function getVisible(id) {
360    var $el = $(id),
361        scrollTop = $(this).scrollTop(),
362        scrollBot = scrollTop + $(this).height(),
363        elTop = $el.offset().top,
364        elBottom = elTop + $el.outerHeight(),
365        visibleTop = elTop < scrollTop ? scrollTop : elTop,
366        visibleBottom = elBottom > scrollBot ? scrollBot : elBottom;
367    return visibleBottom - visibleTop;
368}
369function validateNumber(event) {
370    var key = window.event ? event.keyCode : event.which;
371    if (event.keyCode === 8 || event.keyCode === 46 || event.keyCode === 44) {
372        return !0;
373    } else if (key < 48 || key > 57) {
374        return !1;
375    } else {
376        return !0;
377    }
378}
379function updateDynamicLabel(object) {
380    var $this = object;
381    $this.siblings("label").html($this.siblings("label").data("title") + " : " + $this.val() + "%");
382}
383var last_input_changed_name = null;
384var last_input_changed_val = null;
385var original_input_changed_val = null;
386var original_input_yearly_brut = null;
387var taxes_pourcent_set_by_user = !1;
388var hours_per_week = 35;
389var nb_hours_monthly = (hours_per_week * 52) / 12;
390var nb_days_worked_by_month = 21.67;
391var smic = 1217.91;
392var calculator_mode = "normal";
393var current_smic_monthly_brut = "";
394var preset_value = null;
395var preset_origin = null;
396var preset_type = null;
397var preset_status = null;
398var preset_working_hours = null;
399var preset_month_worked = null;
400var coef_smic = 20.81;
401var overtime_field = null;
402var overtime_weekly_value = 0;
403var company_cost = 0;
404var overtimed_monthly_brut = 0;
405function setPresetValue(origin, value, type, status, working_hours, month_worked) {
406    preset_value = value;
407    preset_origin = origin;
408    preset_type = type;
409    preset_status = status;
410    preset_working_hours = working_hours;
411    preset_month_worked = month_worked;
412}
413function setSmicMonthlyBrut(value) {
414    current_smic_monthly_brut = value;
415}
416function setSmicMonthlyNet(value) {
417    smic = value;
418}
419function setCoefSmic(value) {
420    coef_smic = value;
421}
422function updateHoursByWeek(value) {
423    hours_per_week = value;
424    nb_hours_monthly = (value * 52) / 12;
425}
426function getHoursPerDay(hours_per_week) {
427    return hours_per_week / 5;
428}
429function setDefaultSettings() {
430    $('input.form-control[name!="taux-statut"]').val("");
431    $("#row_monthly_net_growth").addClass("hidden");
432    $("#row_yearly_net_growth").addClass("hidden");
433    $('input[type!="email"], :input[type!="email"]').attr("autocomplete", "off");
434    $("#work-time").val("100");
435    $("#wage-growth").val("0");
436    $("#taxes-simulator").val("0");
437    $('a[data-toggle="type-statut"]').removeClass("active");
438    $('a[data-toggle="hours-week"]').removeClass("active");
439    $('a[data-toggle="nb_months"]').removeClass("active");
440    var $type_statut = $('a[data-toggle="type-statut"]').first();
441    $("#taux-statut").val($type_statut.data("value"));
442    var $settings = $('a[data-toggle="settings"]').first();
443    $("#settings").val($settings.data("value"));
444    var $hours_per_week = $('a[data-toggle="hours-week"]').first();
445    var $nb_months = $('a[data-toggle="nb_months"]').first();
446    $("#nb_months").val($nb_months.data("title"));
447    $("#type-statut").val($type_statut.data("title"));
448    $("#hours-week").val($hours_per_week.data("value"));
449    updateHoursByWeek($hours_per_week.data("value"));
450    $("#hours-week-customized").val($hours_per_week.data("value"));
451    $type_statut.removeClass("notActive").addClass("active");
452    $hours_per_week.removeClass("notActive").addClass("active");
453    $nb_months.removeClass("notActive").addClass("active");
454    $(".box-taxes").text("-" + $type_statut.data("value") + " %");
455    manageCustomizedPourcent();
456    manageOverTime();
457    manageCompanyCost();
458}
459function initForm() {
460    setDefaultSettings();
461    $("input.numeric, #taux-statut").keypress(validateNumber);
462    $('input[type="range"]').on("change input", function () {
463        updateDynamicLabel($(this));
464        if ($(this).attr("name") == "work-time" && last_input_changed_name != null) {
465            if (original_input_changed_val == null) {
466                setDataFromCookie();
467            }
468            var val = original_input_changed_val.replace(",", ".").replace(" ", "");
469            var pourcent = $("#work-time").val();
470            last_input_changed_val = val * (pourcent / 100);
471            if (pourcent < 100) {
472                if ($("#note-about-pourcent-wage").hasClass("hidden")) {
473                    $("#note-about-pourcent-wage").removeClass("hidden");
474                }
475                $("#math-from-type").text(getInputNameDataFrom());
476                $("#math-from-value").text(original_input_changed_val);
477            } else {
478                $("#note-about-pourcent-wage").addClass("hidden");
479            }
480        }
481        if ($(this).attr("name") == "taxes-simulator") {
482            taxes_pourcent_set_by_user = !0;
483            countTaxes();
484        }
485        if ($(this).attr("name") == "wage-growth") {
486        }
487        execForm();
488    });
489    $('input[type!="range"], .btn-group a').on("change keyup click", function (event) {
490        if ($(this).data("toggle") != undefined && $(this).data("toggle") == "type-statut" && $(this).data("title") != "customized") {
491            if ($(this).data("value") != "customized") {
492                $("#taux-statut").val($(this).data("value"));
493                $(".box-taxes").text("-" + $(this).data("value") + " %");
494            }
495            manageCustomizedPourcent();
496            manageOverTime();
497            manageCompanyCost();
498        } else if ($(this).data("toggle") == "type-statut") {
499            manageCustomizedPourcent();
500            manageOverTime();
501            manageCompanyCost();
502        } else if ($(this).data("toggle") == "overtimed") {
503            manageOverTime();
504            manageCompanyCost();
505        } else if ($(this).data("toggle") == "settings") {
506            if ($(this).data("value") == "smic") {
507                setDefaultSettings();
508                resetForm();
509                var taux_statut_smic = coef_smic;
510                $("#taux-statut").val(taux_statut_smic);
511                $(".box-taxes").text("-" + taux_statut_smic + " %");
512                last_input_changed_name = "monthly_brut";
513                last_input_changed_val = current_smic_monthly_brut;
514                original_input_changed_val = current_smic_monthly_brut;
515            } else {
516                last_input_changed_name = null;
517                last_input_changed_val = null;
518                setDefaultSettings();
519                resetForm();
520            }
521        }
522        manageCustomizedHoursPerWeek();
523        if ($(this).data("toggle") != undefined && $(this).data("toggle") == "hours-week" && $(this).data("title") != "customized") {
524            if ($(this).data("value") != "customized") {
525                updateHoursByWeek($(this).data("value"));
526                overtimeCalcul();
527            }
528        }
529        if ($(this).attr("id") == "hours-week-customized") {
530            updateHoursByWeek($(this).val());
531        }
532        if ($(this).attr("id") == "taux-statut") {
533            $(".box-taxes").text("-" + $(this).val() + " %");
534        }
535        if ($(this).hasClass("numeric") && !$(this).hasClass("overtime_value")) {
536            if (event.type == "keyup" || event.keyCode == 8 || event.keyCode == 46) {
537                setInputValue($(this).attr("id"), $(this).val());
538                taxes_pourcent_set_by_user = !1;
539                last_input_changed_name = $(this).attr("id");
540                last_input_changed_val = $(this).val();
541                var last_char = last_input_changed_val[last_input_changed_val.length - 1];
542                last_input_changed_val = last_input_changed_val.replace(",", ".");
543                last_input_changed_val = last_input_changed_val.replace(" ", "");
544                last_input_changed_val = reverseFormatNumber(last_input_changed_val, "fr");
545                createCookie("input_val", last_input_changed_val, 1);
546                createCookie("input_name", last_input_changed_name, 1);
547                if ($("#work-time").val() == "100") {
548                    original_input_changed_val = last_input_changed_val;
549                    createCookie("original_val", last_input_changed_val, 1);
550                    createCookie("work_time", $("#work-time").val(), 1);
551                }
552                if (last_input_changed_val == "") {
553                    last_input_changed_name = null;
554                    last_input_changed_val = null;
555                    resetForm();
556                }
557                wrapperCountNbCalcul();
558            }
559        } else if ($(this).hasClass("overtime_value")) {
560            overtimeManagement($(this));
561        }
562        execForm();
563    });
564    if ($("#type-statut").val() != "customized") {
565    }
566    $("#customized-pourcent").addClass("hidden");
567    if (preset_value != null && preset_origin != null) {
568        $('a[data-toggle="type-statut"]').removeClass("active");
569        last_input_changed_name = preset_origin + "_" + preset_type;
570        last_input_changed_val = preset_value;
571        var value_taxes = 22;
572        if (preset_status == "cadre") {
573            value_taxes = 25;
574            $('a[data-toggle="type-statut"][data-title="cadre"]').addClass("active");
575        } else {
576            $('a[data-toggle="type-statut"][data-title="non-cadre"]').addClass("active");
577        }
578        $("#taux-statut").val(value_taxes);
579        $(".box-taxes").text("-" + value_taxes + " %");
580        if (preset_working_hours == "") {
581            preset_working_hours = 35;
582        }
583        if (preset_working_hours != null) {
584            $('a[data-toggle="hours-week"]').removeClass("active");
585            $("#hours-week").val(preset_working_hours);
586            updateHoursByWeek(preset_working_hours);
587            $("#hours-week-customized").val(preset_working_hours);
588            var $input_working_hours = $('a[data-toggle="hours-week"][data-title="' + preset_working_hours + '"]');
589            if ($input_working_hours.length) {
590            } else {
591                $input_working_hours = $('a[data-toggle="hours-week"][data-title="customized"]');
592                $("#hours-week").val("customized");
593                manageCustomizedHoursPerWeek();
594            }
595            $input_working_hours.addClass("active");
596        }
597        if (preset_month_worked != null && preset_month_worked != "") {
598            $('a[data-toggle="nb_months"]').removeClass("active");
599            var $input_month_worked = $('a[data-toggle="nb_months"][data-title="' + preset_month_worked + '"]');
600            $input_month_worked.addClass("active");
601            $("#nb_months").val(preset_month_worked);
602        }
603        execForm();
604    }
605}
606function overtimeCalcul() {
607    var nb_hours_per_week = $("#hours-week").val();
608    var total = Number(nb_hours_per_week) + Number(overtime_weekly_value);
609    if (overtime_weekly_value != "") {
610        $("#overtime_weekly_total").val(total);
611    } else {
612        $("#overtime_weekly_total").val(nb_hours_per_week);
613    }
614    var hourly_overtimed = roundNumber(hourly_brut * 1.25, 2);
615    $("#overtime_hour_overtimed").val(hourly_overtimed);
616    var total_overtime = $("#overtime_monthly").val();
617    var total_price_hours_overtimed = total_overtime * hourly_overtimed;
618    $("#overtime_hour_overtimed_total").val(roundNumber(total_price_hours_overtimed, 2));
619    overtimed_monthly_brut = total_price_hours_overtimed + monthly_brut;
620    $("#overtimed_monthly_brut").val(roundNumber(overtimed_monthly_brut, 2));
621    var taux = $("#taux-statut").val();
622    var overtimed_monthly_net = overtimed_monthly_brut * (1 - taux / 100);
623    $("#overtimed_monthly_net").val(roundNumber(overtimed_monthly_net, 2));
624    var gain_monthly_brut = overtimed_monthly_brut - monthly_brut;
625    var gain_monthly_net = overtimed_monthly_net - monthly_net;
626    $("#overtimed_monthly_net_gained").val(roundNumber(gain_monthly_net, 2));
627    $("#overtimed_monthly_brut_gained").val(roundNumber(gain_monthly_brut, 2));
628}
629function overtimeManagement(object) {
630    var nb_month = $("#nb_months").val();
631    overtime_field = object.attr("id");
632    if (overtime_field == "overtime_weekly") {
633        $("#overtime_monthly").val(object.val() * 4);
634        overtime_weekly_value = object.val();
635    } else if (overtime_field == "overtime_monthly") {
636        $("#overtime_weekly").val(object.val() / 4);
637        overtime_weekly_value = object.val() / 4;
638    }
639    overtimeCalcul();
640}
641function loadAds() {
642    var html_ads =
643        '  <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><!-- Horizontal --><ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-2897745550069340" data-ad-slot="8420705521" data-ad-format="auto" data-full-width-responsive="true"></ins><script>(adsbygoogle = window.adsbygoogle || []).push({});</script>';
644    if ($(window).width() < 768) {
645        setTimeout(function () {
646            $(".ads").html(html_ads);
647        }, 2000);
648    } else {
649        $(".ads").html(html_ads);
650    }
651}
652function setInputValue(id, value) {}
653function manageCustomizedPourcent() {
654    if ($("#type-statut").val() == "customized") {
655        $("#customized-pourcent").removeClass("hidden");
656    } else {
657        $("#customized-pourcent").addClass("hidden");
658    }
659}
660function manageCompanyCost() {
661    if ($("#type-statut").val() == "non-cadre" || $("#type-statut").val() == "cadre") {
662        $("#company-cost").removeClass("hidden");
663    } else {
664        $("#company-cost").addClass("hidden");
665    }
666}
667function manageOverTime() {
668    if ($("#type-statut").val() == "non-cadre") {
669        $("#overtime").removeClass("hidden");
670    } else {
671        $("#overtime").addClass("hidden");
672    }
673    if ($("#overtimed").val() == "oui") {
674        $("#form-overtimed").removeClass("hidden");
675    } else {
676        $("#form-overtimed").addClass("hidden");
677    }
678}
679function manageCustomizedHoursPerWeek() {
680    if ($("#hours-week").val() == "customized") {
681        $("#customized-hours-per-week").removeClass("hidden");
682    } else {
683        $("#customized-hours-per-week").addClass("hidden");
684    }
685}
686function openCalculatorReviewPopup(type_opener) {
687    HideLoaders(!0);
688    var vars = "action=load-send-review-form&request_type=" + type_opener;
689    $.get(url_var["API_HOST"] + "?" + vars, function (data) {
690        var response = jQuery.parseJSON(data);
691        workOnResponse(response);
692    });
693}
694function closeCalculatorReviewPopup() {
695    var modal = $("#sendCalculatorReview");
696    HideLoaders(!0);
697    modal.modal("hide");
698}
699function reviewAlreadySent() {
700    HideLoaders(!0);
701    var modal = $("#calculatorReviewAlreadyDone");
702    modal.modal({ show: !0, backdrop: !0 });
703}
704function openReviewForm() {
705    var modal = $("#sendCalculatorReview");
706    $("#form-send-review").removeClass("hidden");
707    $("#form-send-review-done").addClass("hidden");
708    modal.modal({ show: !0, backdrop: !0 });
709}
710function askForReview() {
711    HideLoaders(!0);
712    var modal = $("#askCalculatorReview");
713    modal.modal({ show: !0, backdrop: !0 });
714}
715function askForBadFeedback() {
716    closeAskForReview();
717    HideLoaders(!0);
718    var modal = $("#askCalculatorToSendBadFeedback");
719    modal.modal({ show: !0, backdrop: !0 });
720}
721function sendBadFeedbackForm() {
722    closeAskForBadFeedback();
723    HideLoaders(!0);
724    var modal = $("#sendCalculatorBadFeedback");
725    modal.modal({ show: !0, backdrop: !0 });
726}
727function nextAfterReviewSubmited() {
728    $("#form-send-review").addClass("hidden");
729    $("#form-send-review-done").removeClass("hidden");
730    appCountSetDoNotAskAnymore();
731}
732function nextAfterBadFeedbackSubmited() {
733    $("#form-send-bad-feedback").addClass("hidden");
734    $("#form-send-bad-feedback-done").removeClass("hidden");
735    appCountSetDoNotAskAnymore();
736}
737function yesSendReviewClicked() {
738    closeAskForReview();
739    openCalculatorReviewPopup("auto");
740}
741function askMeLaterClicked() {
742    closeAskForReview();
743    closeAskForBadFeedback();
744}
745function closeAskForReview() {
746    var modal = $("#askCalculatorReview");
747    modal.modal("hide");
748}
749function closeAskForBadFeedback() {
750    var modal = $("#askCalculatorToSendBadFeedback");
751    modal.modal("hide");
752}
753function loadChart(result_string_pourcent, result_2019, result_2020, result_2021) {
754    var arrayPourcent = result_string_pourcent.split(",");
755    var array2019 = result_2019.split(",");
756    var array2020 = result_2020.split(",");
757    var array2021 = result_2021.split(",");
758    var options = {
759        axisX: { offset: 30, position: "end", labelOffset: { x: -20, y: 0 }, showLabel: !0, showGrid: !0, labelInterpolationFnc: Chartist.noop, type: undefined },
760        axisY: { offset: 40, position: "start", labelOffset: { x: 0, y: 0 }, showLabel: !0, showGrid: !0, labelInterpolationFnc: Chartist.noop, type: undefined, scaleMinSpace: 20, onlyInteger: !1 },
761        width: undefined,
762        height: "300px",
763        showLine: !0,
764        showPoint: !0,
765        showArea: !1,
766        areaBase: 0,
767        lineSmooth: !0,
768        low: undefined,
769        high: undefined,
770        chartPadding: { top: 15, right: 15, bottom: 5, left: 10 },
771        fullWidth: !0,
772        reverseData: !1,
773        classNames: {
774            chart: "ct-chart-line",
775            label: "ct-label",
776            labelGroup: "ct-labels",
777            series: "ct-series",
778            line: "ct-line",
779            point: "ct-point",
780            area: "ct-area",
781            grid: "ct-grid",
782            gridGroup: "ct-grids",
783            vertical: "ct-vertical",
784            horizontal: "ct-horizontal",
785            start: "ct-start",
786            end: "ct-end",
787        },
788    };
789    new Chartist.Line(
790        ".ct-chart",
791        { labels: arrayPourcent, series: [array2019, array2020, array2021] },
792        { height: "400px", fullWidth: !0, chartPadding: { right: 40 }, plugins: [Chartist.plugins.legend({ legendNames: ["Année 2019", "Année 2020", "Année 2021"] })] }
793    );
794}
795function loadChart1(result_string_pourcent, result_2019, result_2020, result_2021) {
796    var arrayPourcent = result_string_pourcent.split(",");
797    var array2019 = result_2019.split(",");
798    var array2020 = result_2020.split(",");
799    var array2021 = result_2021.split(",");
800    var ctxL = document.getElementById("lineChart").getContext("2d");
801    var myLineChart = new Chart(ctxL, {
802        type: "line",
803        data: {
804            labels: arrayPourcent,
805            datasets: [
806                { label: "Année 2019", data: array2019, backgroundColor: ["rgba(105, 0, 132, .2)"], borderColor: ["rgba(200, 99, 132, .7)"], borderWidth: 2 },
807                { label: "Année 2020", data: array2020, backgroundColor: ["rgba(0, 137, 132, .2)"], borderColor: ["rgba(0, 10, 130, .7)"], borderWidth: 2 },
808                { label: "Année 2021", data: array2021, backgroundColor: ["rgba(0, 117, 132, .2)"], borderColor: ["rgba(0, 40, 130, .7)"], borderWidth: 2 },
809            ],
810        },
811        options: { responsive: !0 },
812    });
813}
814window.addEventListener("load", function (e) {
815    if ($(window).scrollTop() <= 50) {
816        $(".wow").removeClass("animated");
817        $(".wow").removeAttr("style");
818        new WOW().init();
819    }
820});
821window.addEventListener("scroll", function (e) {
822    if ($(window).scrollTop() <= 50) {
823        $(".wow").removeClass("animated");
824        $(".wow").removeAttr("style");
825    }
826});
827$(window).on("resize scroll", function () {
828    ifFooterVisible();
829});
830function distanceBetweenElems(elem1, elem2) {
831    var e1Rect = elem1.getBoundingClientRect();
832    var e2Rect = elem2.getBoundingClientRect();
833    var dx = e1Rect.left + (e1Rect.right - e1Rect.left) / 2 - (e2Rect.left + (e2Rect.right - e2Rect.left) / 2);
834    var dy = e1Rect.top + (e1Rect.bottom - e1Rect.top) / 2 - (e2Rect.top + (e2Rect.bottom - e2Rect.top) / 2);
835    var dist = Math.sqrt(dx * dx + dy * dy);
836    return dist;
837}
838!(function (a, b) {
839    "function" == typeof define && define.amd
840        ? define("Chartist", [], function () {
841              return (a.Chartist = b());
842          })
843        : "object" == typeof module && module.exports
844        ? (module.exports = b())
845        : (a.Chartist = b());
846})(this, function () {
847    var a = { version: "0.11.4" };
848    return (
849        (function (a, b) {
850            "use strict";
851            var c = a.window,
852                d = a.document;
853            (b.namespaces = { svg: "http://www.w3.org/2000/svg", xmlns: "http://www.w3.org/2000/xmlns/", xhtml: "http://www.w3.org/1999/xhtml", xlink: "http://www.w3.org/1999/xlink", ct: "http://gionkunz.github.com/chartist-js/ct" }),
854                (b.noop = function (a) {
855                    return a;
856                }),
857                (b.alphaNumerate = function (a) {
858                    return String.fromCharCode(97 + (a % 26));
859                }),
860                (b.extend = function (a) {
861                    var c, d, e;
862                    for (a = a || {}, c = 1; c < arguments.length; c++) {
863                        d = arguments[c];
864                        for (var f in d) (e = d[f]), "object" != typeof e || null === e || e instanceof Array ? (a[f] = e) : (a[f] = b.extend(a[f], e));
865                    }
866                    return a;
867                }),
868                (b.replaceAll = function (a, b, c) {
869                    return a.replace(new RegExp(b, "g"), c);
870                }),
871                (b.ensureUnit = function (a, b) {
872                    return "number" == typeof a && (a += b), a;
873                }),
874                (b.quantity = function (a) {
875                    if ("string" == typeof a) {
876                        var b = /^(\d+)\s*(.*)$/g.exec(a);
877                        return { value: +b[1], unit: b[2] || void 0 };
878                    }
879                    return { value: a };
880                }),
881                (b.querySelector = function (a) {
882                    return a instanceof Node ? a : d.querySelector(a);
883                }),
884                (b.times = function (a) {
885                    return Array.apply(null, new Array(a));
886                }),
887                (b.sum = function (a, b) {
888                    return a + (b ? b : 0);
889                }),
890                (b.mapMultiply = function (a) {
891                    return function (b) {
892                        return b * a;
893                    };
894                }),
895                (b.mapAdd = function (a) {
896                    return function (b) {
897                        return b + a;
898                    };
899                }),
900                (b.serialMap = function (a, c) {
901                    var d = [],
902                        e = Math.max.apply(
903                            null,
904                            a.map(function (a) {
905                                return a.length;
906                            })
907                        );
908                    return (
909                        b.times(e).forEach(function (b, e) {
910                            var f = a.map(function (a) {
911                                return a[e];
912                            });
913                            d[e] = c.apply(null, f);
914                        }),
915                        d
916                    );
917                }),
918                (b.roundWithPrecision = function (a, c) {
919                    var d = Math.pow(10, c || b.precision);
920                    return Math.round(a * d) / d;
921                }),
922                (b.precision = 8),
923                (b.escapingMap = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#039;" }),
924                (b.serialize = function (a) {
925                    return null === a || void 0 === a
926                        ? a
927                        : ("number" == typeof a ? (a = "" + a) : "object" == typeof a && (a = JSON.stringify({ data: a })),
928                          Object.keys(b.escapingMap).reduce(function (a, c) {
929                              return b.replaceAll(a, c, b.escapingMap[c]);
930                          }, a));
931                }),
932                (b.deserialize = function (a) {
933                    if ("string" != typeof a) return a;
934                    a = Object.keys(b.escapingMap).reduce(function (a, c) {
935                        return b.replaceAll(a, b.escapingMap[c], c);
936                    }, a);
937                    try {
938                        (a = JSON.parse(a)), (a = void 0 !== a.data ? a.data : a);
939                    } catch (c) {}
940                    return a;
941                }),
942                (b.createSvg = function (a, c, d, e) {
943                    var f;
944                    return (
945                        (c = c || "100%"),
946                        (d = d || "100%"),
947                        Array.prototype.slice
948                            .call(a.querySelectorAll("svg"))
949                            .filter(function (a) {
950                                return a.getAttributeNS(b.namespaces.xmlns, "ct");
951                            })
952                            .forEach(function (b) {
953                                a.removeChild(b);
954                            }),
955                        (f = new b.Svg("svg").attr({ width: c, height: d }).addClass(e)),
956                        (f._node.style.width = c),
957                        (f._node.style.height = d),
958                        a.appendChild(f._node),
959                        f
960                    );
961                }),
962                (b.normalizeData = function (a, c, d) {
963                    var e,
964                        f = { raw: a, normalized: {} };
965                    return (
966                        (f.normalized.series = b.getDataArray({ series: a.series || [] }, c, d)),
967                        (e = f.normalized.series.every(function (a) {
968                            return a instanceof Array;
969                        })
970                            ? Math.max.apply(
971                                  null,
972                                  f.normalized.series.map(function (a) {
973                                      return a.length;
974                                  })
975                              )
976                            : f.normalized.series.length),
977                        (f.normalized.labels = (a.labels || []).slice()),
978                        Array.prototype.push.apply(
979                            f.normalized.labels,
980                            b.times(Math.max(0, e - f.normalized.labels.length)).map(function () {
981                                return "";
982                            })
983                        ),
984                        c && b.reverseData(f.normalized),
985                        f
986                    );
987                }),
988                (b.safeHasProperty = function (a, b) {
989                    return null !== a && "object" == typeof a && a.hasOwnProperty(b);
990                }),
991                (b.isDataHoleValue = function (a) {
992                    return null === a || void 0 === a || ("number" == typeof a && isNaN(a));
993                }),
994                (b.reverseData = function (a) {
995                    a.labels.reverse(), a.series.reverse();
996                    for (var b = 0; b < a.series.length; b++) "object" == typeof a.series[b] && void 0 !== a.series[b].data ? a.series[b].data.reverse() : a.series[b] instanceof Array && a.series[b].reverse();
997                }),
998                (b.getDataArray = function (a, c, d) {
999                    function e(a) {
1000                        if (b.safeHasProperty(a, "value")) return e(a.value);
1001                        if (b.safeHasProperty(a, "data")) return e(a.data);
1002                        if (a instanceof Array) return a.map(e);
1003                        if (!b.isDataHoleValue(a)) {
1004                            if (d) {
1005                                var c = {};
1006                                return (
1007                                    "string" == typeof d ? (c[d] = b.getNumberOrUndefined(a)) : (c.y = b.getNumberOrUndefined(a)),
1008                                    (c.x = a.hasOwnProperty("x") ? b.getNumberOrUndefined(a.x) : c.x),
1009                                    (c.y = a.hasOwnProperty("y") ? b.getNumberOrUndefined(a.y) : c.y),
1010                                    c
1011                                );
1012                            }
1013                            return b.getNumberOrUndefined(a);
1014                        }
1015                    }
1016                    return a.series.map(e);
1017                }),
1018                (b.normalizePadding = function (a, b) {
1019                    return (
1020                        (b = b || 0),
1021                        "number" == typeof a
1022                            ? { top: a, right: a, bottom: a, left: a }
1023                            : { top: "number" == typeof a.top ? a.top : b, right: "number" == typeof a.right ? a.right : b, bottom: "number" == typeof a.bottom ? a.bottom : b, left: "number" == typeof a.left ? a.left : b }
1024                    );
1025                }),
1026                (b.getMetaData = function (a, b) {
1027                    var c = a.data ? a.data[b] : a[b];
1028                    return c ? c.meta : void 0;
1029                }),
1030                (b.orderOfMagnitude = function (a) {
1031                    return Math.floor(Math.log(Math.abs(a)) / Math.LN10);
1032                }),
1033                (b.projectLength = function (a, b, c) {
1034                    return (b / c.range) * a;
1035                }),
1036                (b.getAvailableHeight = function (a, c) {
1037                    return Math.max((b.quantity(c.height).value || a.height()) - (c.chartPadding.top + c.chartPadding.bottom) - c.axisX.offset, 0);
1038                }),
1039                (b.getHighLow = function (a, c, d) {
1040                    function e(a) {
1041                        if (void 0 !== a)
1042                            if (a instanceof Array) for (var b = 0; b < a.length; b++) e(a[b]);
1043                            else {
1044                                var c = d ? +a[d] : +a;
1045                                g && c > f.high && (f.high = c), h && c < f.low && (f.low = c);
1046                            }
1047                    }
1048                    c = b.extend({}, c, d ? c["axis" + d.toUpperCase()] : {});
1049                    var f = { high: void 0 === c.high ? -Number.MAX_VALUE : +c.high, low: void 0 === c.low ? Number.MAX_VALUE : +c.low },
1050                        g = void 0 === c.high,
1051                        h = void 0 === c.low;
1052                    return (
1053                        (g || h) && e(a),
1054                        (c.referenceValue || 0 === c.referenceValue) && ((f.high = Math.max(c.referenceValue, f.high)), (f.low = Math.min(c.referenceValue, f.low))),
1055                        f.high <= f.low && (0 === f.low ? (f.high = 1) : f.low < 0 ? (f.high = 0) : f.high > 0 ? (f.low = 0) : ((f.high = 1), (f.low = 0))),
1056                        f
1057                    );
1058                }),
1059                (b.isNumeric = function (a) {
1060                    return null !== a && isFinite(a);
1061                }),
1062                (b.isFalseyButZero = function (a) {
1063                    return !a && 0 !== a;
1064                }),
1065                (b.getNumberOrUndefined = function (a) {
1066                    return b.isNumeric(a) ? +a : void 0;
1067                }),
1068                (b.isMultiValue = function (a) {
1069                    return "object" == typeof a && ("x" in a || "y" in a);
1070                }),
1071                (b.getMultiValue = function (a, c) {
1072                    return b.isMultiValue(a) ? b.getNumberOrUndefined(a[c || "y"]) : b.getNumberOrUndefined(a);
1073                }),
1074                (b.rho = function (a) {
1075                    function b(a, c) {
1076                        return a % c === 0 ? c : b(c, a % c);
1077                    }
1078                    function c(a) {
1079                        return a * a + 1;
1080                    }
1081                    if (1 === a) return a;
1082                    var d,
1083                        e = 2,
1084                        f = 2;
1085                    if (a % 2 === 0) return 2;
1086                    do (e = c(e) % a), (f = c(c(f)) % a), (d = b(Math.abs(e - f), a));
1087                    while (1 === d);
1088                    return d;
1089                }),
1090                (b.getBounds = function (a, c, d, e) {
1091                    function f(a, b) {
1092                        return a === (a += b) && (a *= 1 + (b > 0 ? o : -o)), a;
1093                    }
1094                    var g,
1095                        h,
1096                        i,
1097                        j = 0,
1098                        k = { high: c.high, low: c.low };
1099                    (k.valueRange = k.high - k.low),
1100                        (k.oom = b.orderOfMagnitude(k.valueRange)),
1101                        (k.step = Math.pow(10, k.oom)),
1102                        (k.min = Math.floor(k.low / k.step) * k.step),
1103                        (k.max = Math.ceil(k.high / k.step) * k.step),
1104                        (k.range = k.max - k.min),
1105                        (k.numberOfSteps = Math.round(k.range / k.step));
1106                    var l = b.projectLength(a, k.step, k),
1107                        m = l < d,
1108                        n = e ? b.rho(k.range) : 0;
1109                    if (e && b.projectLength(a, 1, k) >= d) k.step = 1;
1110                    else if (e && n < k.step && b.projectLength(a, n, k) >= d) k.step = n;
1111                    else
1112                        while (!0) {
1113                            if (m && b.projectLength(a, k.step, k) <= d) k.step *= 2;
1114                            else {
1115                                if (m || !(b.projectLength(a, k.step / 2, k) >= d)) break;
1116                                if (((k.step /= 2), e && k.step % 1 !== 0)) {
1117                                    k.step *= 2;
1118                                    break;
1119                                }
1120                            }
1121                            if (j++ > 1e3) throw new Error("Exceeded maximum number of iterations while optimizing scale step!");
1122                        }
1123                    var o = 2.221e-16;
1124                    for (k.step = Math.max(k.step, o), h = k.min, i = k.max; h + k.step <= k.low; ) h = f(h, k.step);
1125                    for (; i - k.step >= k.high; ) i = f(i, -k.step);
1126                    (k.min = h), (k.max = i), (k.range = k.max - k.min);
1127                    var p = [];
1128                    for (g = k.min; g <= k.max; g = f(g, k.step)) {
1129                        var q = b.roundWithPrecision(g);
1130                        q !== p[p.length - 1] && p.push(q);
1131                    }
1132                    return (k.values = p), k;
1133                }),
1134                (b.polarToCartesian = function (a, b, c, d) {
1135                    var e = ((d - 90) * Math.PI) / 180;
1136                    return { x: a + c * Math.cos(e), y: b + c * Math.sin(e) };
1137                }),
1138                (b.createChartRect = function (a, c, d) {
1139                    var e = !(!c.axisX && !c.axisY),
1140                        f = e ? c.axisY.offset : 0,
1141                        g = e ? c.axisX.offset : 0,
1142                        h = a.width() || b.quantity(c.width).value || 0,
1143                        i = a.height() || b.quantity(c.height).value || 0,
1144                        j = b.normalizePadding(c.chartPadding, d);
1145                    (h = Math.max(h, f + j.left + j.right)), (i = Math.max(i, g + j.top + j.bottom));
1146                    var k = {
1147                        padding: j,
1148                        width: function () {
1149                            return this.x2 - this.x1;
1150                        },
1151                        height: function () {
1152                            return this.y1 - this.y2;
1153                        },
1154                    };
1155                    return (
1156                        e
1157                            ? ("start" === c.axisX.position ? ((k.y2 = j.top + g), (k.y1 = Math.max(i - j.bottom, k.y2 + 1))) : ((k.y2 = j.top), (k.y1 = Math.max(i - j.bottom - g, k.y2 + 1))),
1158                              "start" === c.axisY.position ? ((k.x1 = j.left + f), (k.x2 = Math.max(h - j.right, k.x1 + 1))) : ((k.x1 = j.left), (k.x2 = Math.max(h - j.right - f, k.x1 + 1))))
1159                            : ((k.x1 = j.left), (k.x2 = Math.max(h - j.right, k.x1 + 1)), (k.y2 = j.top), (k.y1 = Math.max(i - j.bottom, k.y2 + 1))),
1160                        k
1161                    );
1162                }),
1163                (b.createGrid = function (a, c, d, e, f, g, h, i) {
1164                    var j = {};
1165                    (j[d.units.pos + "1"] = a), (j[d.units.pos + "2"] = a), (j[d.counterUnits.pos + "1"] = e), (j[d.counterUnits.pos + "2"] = e + f);
1166                    var k = g.elem("line", j, h.join(" "));
1167                    i.emit("draw", b.extend({ type: "grid", axis: d, index: c, group: g, element: k }, j));
1168                }),
1169                (b.createGridBackground = function (a, b, c, d) {
1170                    var e = a.elem("rect", { x: b.x1, y: b.y2, width: b.width(), height: b.height() }, c, !0);
1171                    d.emit("draw", { type: "gridBackground", group: a, element: e });
1172                }),
1173                (b.createLabel = function (a, c, e, f, g, h, i, j, k, l, m) {
1174                    var n,
1175                        o = {};
1176                    if (((o[g.units.pos] = a + i[g.units.pos]), (o[g.counterUnits.pos] = i[g.counterUnits.pos]), (o[g.units.len] = c), (o[g.counterUnits.len] = Math.max(0, h - 10)), l)) {
1177                        var p = d.createElement("span");
1178                        (p.className = k.join(" ")),
1179                            p.setAttribute("xmlns", b.namespaces.xhtml),
1180                            (p.innerText = f[e]),
1181                            (p.style[g.units.len] = Math.round(o[g.units.len]) + "px"),
1182                            (p.style[g.counterUnits.len] = Math.round(o[g.counterUnits.len]) + "px"),
1183                            (n = j.foreignObject(p, b.extend({ style: "overflow: visible;" }, o)));
1184                    } else n = j.elem("text", o, k.join(" ")).text(f[e]);
1185                    m.emit("draw", b.extend({ type: "label", axis: g, index: e, group: j, element: n, text: f[e] }, o));
1186                }),
1187                (b.getSeriesOption = function (a, b, c) {
1188                    if (a.name && b.series && b.series[a.name]) {
1189                        var d = b.series[a.name];
1190                        return d.hasOwnProperty(c) ? d[c] : b[c];
1191                    }
1192                    return b[c];
1193                }),
1194                (b.optionsProvider = function (a, d, e) {
1195                    function f(a) {
1196                        var f = h;
1197                        if (((h = b.extend({}, j)), d))
1198                            for (i = 0; i < d.length; i++) {
1199                                var g = c.matchMedia(d[i][0]);
1200                                g.matches && (h = b.extend(h, d[i][1]));
1201                            }
1202                        e && a && e.emit("optionsChanged", { previousOptions: f, currentOptions: h });
1203                    }
1204                    function g() {
1205                        k.forEach(function (a) {
1206                            a.removeListener(f);
1207                        });
1208                    }
1209                    var h,
1210                        i,
1211                        j = b.extend({}, a),
1212                        k = [];
1213                    if (!c.matchMedia) throw "window.matchMedia not found! Make sure you're using a polyfill.";
1214                    if (d)
1215                        for (i = 0; i < d.length; i++) {
1216                            var l = c.matchMedia(d[i][0]);
1217                            l.addListener(f), k.push(l);
1218                        }
1219                    return (
1220                        f(),
1221                        {
1222                            removeMediaQueryListeners: g,
1223                            getCurrentOptions: function () {
1224                                return b.extend({}, h);
1225                            },
1226                        }
1227                    );
1228                }),
1229                (b.splitIntoSegments = function (a, c, d) {
1230                    var e = { increasingX: !1, fillHoles: !1 };
1231                    d = b.extend({}, e, d);
1232                    for (var f = [], g = !0, h = 0; h < a.length; h += 2)
1233                        void 0 === b.getMultiValue(c[h / 2].value)
1234                            ? d.fillHoles || (g = !0)
1235                            : (d.increasingX && h >= 2 && a[h] <= a[h - 2] && (g = !0),
1236                              g && (f.push({ pathCoordinates: [], valueData: [] }), (g = !1)),
1237                              f[f.length - 1].pathCoordinates.push(a[h], a[h + 1]),
1238                              f[f.length - 1].valueData.push(c[h / 2]));
1239                    return f;
1240                });
1241        })(this || global, a),
1242        (function (a, b) {
1243            "use strict";
1244            (b.Interpolation = {}),
1245                (b.Interpolation.none = function (a) {
1246                    var c = { fillHoles: !1 };
1247                    return (
1248                        (a = b.extend({}, c, a)),
1249                        function (c, d) {
1250                            for (var e = new b.Svg.Path(), f = !0, g = 0; g < c.length; g += 2) {
1251                                var h = c[g],
1252                                    i = c[g + 1],
1253                                    j = d[g / 2];
1254                                void 0 !== b.getMultiValue(j.value) ? (f ? e.move(h, i, !1, j) : e.line(h, i, !1, j), (f = !1)) : a.fillHoles || (f = !0);
1255                            }
1256                            return e;
1257                        }
1258                    );
1259                }),
1260                (b.Interpolation.simple = function (a) {
1261                    var c = { divisor: 2, fillHoles: !1 };
1262                    a = b.extend({}, c, a);
1263                    var d = 1 / Math.max(1, a.divisor);
1264                    return function (c, e) {
1265                        for (var f, g, h, i = new b.Svg.Path(), j = 0; j < c.length; j += 2) {
1266                            var k = c[j],
1267                                l = c[j + 1],
1268                                m = (k - f) * d,
1269                                n = e[j / 2];
1270                            void 0 !== n.value ? (void 0 === h ? i.move(k, l, !1, n) : i.curve(f + m, g, k - m, l, k, l, !1, n), (f = k), (g = l), (h = n
1270)) : a.fillHoles || (f = k = h = void 0);
1271                        }
1272                        return i;
1273                    };
1274                }),
1275                (b.Interpolation.cardinal = function (a) {
1276                    var c = { tension: 1, fillHoles: !1 };
1277                    a = b.extend({}, c, a);
1278                    var d = Math.min(1, Math.max(0, a.tension)),
1279                        e = 1 - d;
1280                    return function f(c, g) {
1281                        var h = b.splitIntoSegments(c, g, { fillHoles: a.fillHoles });
1282                        if (h.length) {
1283                            if (h.length > 1) {
1284                                var i = [];
1285                                return (
1286                                    h.forEach(function (a) {
1287                                        i.push(f(a.pathCoordinates, a.valueData));
1288                                    }),
1289                                    b.Svg.Path.join(i)
1290                                );
1291                            }
1292                            if (((c = h[0].pathCoordinates), (g = h[0].valueData), c.length <= 4)) return b.Interpolation.none()(c, g);
1293                            for (var j, k = new b.Svg.Path().move(c[0], c[1], !1, g[0]), l = 0, m = c.length; m - 2 * !j > l; l += 2) {
1294                                var n = [
1295                                    { x: +c[l - 2], y: +c[l - 1] },
1296                                    { x: +c[l], y: +c[l + 1] },
1297                                    { x: +c[l + 2], y: +c[l + 3] },
1298                                    { x: +c[l + 4], y: +c[l + 5] },
1299                                ];
1300                                j
1301                                    ? l
1302                                        ? m - 4 === l
1303                                            ? (n[3] = { x: +c[0], y: +c[1] })
1304                                            : m - 2 === l && ((n[2] = { x: +c[0], y: +c[1] }), (n[3] = { x: +c[2], y: +c[3] }))
1305                                        : (n[0] = { x: +c[m - 2], y: +c[m - 1] })
1306                                    : m - 4 === l
1307                                    ? (n[3] = n[2])
1308                                    : l || (n[0] = { x: +c[l], y: +c[l + 1] }),
1309                                    k.curve(
1310                                        (d * (-n[0].x + 6 * n[1].x + n[2].x)) / 6 + e * n[2].x,
1311                                        (d * (-n[0].y + 6 * n[1].y + n[2].y)) / 6 + e * n[2].y,
1312                                        (d * (n[1].x + 6 * n[2].x - n[3].x)) / 6 + e * n[2].x,
1313                                        (d * (n[1].y + 6 * n[2].y - n[3].y)) / 6 + e * n[2].y,
1314                                        n[2].x,
1315                                        n[2].y,
1316                                        !1,
1317                                        g[(l + 2) / 2]
1318                                    );
1319                            }
1320                            return k;
1321                        }
1322                        return b.Interpolation.none()([]);
1323                    };
1324                }),
1325                (b.Interpolation.monotoneCubic = function (a) {
1326                    var c = { fillHoles: !1 };
1327                    return (
1328                        (a = b.extend({}, c, a)),
1329                        function d(c, e) {
1330                            var f = b.splitIntoSegments(c, e, { fillHoles: a.fillHoles, increasingX: !0 });
1331                            if (f.length) {
1332                                if (f.length > 1) {
1333                                    var g = [];
1334                                    return (
1335                                        f.forEach(function (a) {
1336                                            g.push(d(a.pathCoordinates, a.valueData));
1337                                        }),
1338                                        b.Svg.Path.join(g)
1339                                    );
1340                                }
1341                                if (((c = f[0].pathCoordinates), (e = f[0].valueData), c.length <= 4)) return b.Interpolation.none()(c, e);
1342                                var h,
1343                                    i,
1344                                    j = [],
1345                                    k = [],
1346                                    l = c.length / 2,
1347                                    m = [],
1348                                    n = [],
1349                                    o = [],
1350                                    p = [];
1351                                for (h = 0; h < l; h++) (j[h] = c[2 * h]), (k[h] = c[2 * h + 1]);
1352                                for (h = 0; h < l - 1; h++) (o[h] = k[h + 1] - k[h]), (p[h] = j[h + 1] - j[h]), (n[h] = o[h] / p[h]);
1353                                for (m[0] = n[0], m[l - 1] = n[l - 2], h = 1; h < l - 1; h++)
1354                                    0 === n[h] || 0 === n[h - 1] || n[h - 1] > 0 != n[h] > 0
1355                                        ? (m[h] = 0)
1356                                        : ((m[h] = (3 * (p[h - 1] + p[h])) / ((2 * p[h] + p[h - 1]) / n[h - 1] + (p[h] + 2 * p[h - 1]) / n[h])), isFinite(m[h]) || (m[h] = 0));
1357                                for (i = new b.Svg.Path().move(j[0], k[0], !1, e[0]), h = 0; h < l - 1; h++)
1358                                    i.curve(j[h] + p[h] / 3, k[h] + (m[h] * p[h]) / 3, j[h + 1] - p[h] / 3, k[h + 1] - (m[h + 1] * p[h]) / 3, j[h + 1], k[h + 1], !1, e[h + 1]);
1359                                return i;
1360                            }
1361                            return b.Interpolation.none()([]);
1362                        }
1363                    );
1364                }),
1365                (b.Interpolation.step = function (a) {
1366                    var c = { postpone: !0, fillHoles: !1 };
1367                    return (
1368                        (a = b.extend({}, c, a)),
1369                        function (c, d) {
1370                            for (var e, f, g, h = new b.Svg.Path(), i = 0; i < c.length; i += 2) {
1371                                var j = c[i],
1372                                    k = c[i + 1],
1373                                    l = d[i / 2];
1374                                void 0 !== l.value ? (void 0 === g ? h.move(j, k, !1, l) : (a.postpone ? h.line(j, f, !1, g) : h.line(e, k, !1, l), h.line(j, k, !1, l)), (e = j), (f = k), (g = l)) : a.fillHoles || (e = f = g = void 0);
1375                            }
1376                            return h;
1377                        }
1378                    );
1379                });
1380        })(this || global, a),
1381        (function (a, b) {
1382            "use strict";
1383            b.EventEmitter = function () {
1384                function a(a, b) {
1385                    (d[a] = d[a] || []), d[a].push(b);
1386                }
1387                function b(a, b) {
1388                    d[a] && (b ? (d[a].splice(d[a].indexOf(b), 1), 0 === d[a].length && delete d[a]) : delete d[a]);
1389                }
1390                function c(a, b) {
1391                    d[a] &&
1392                        d[a].forEach(function (a) {
1393                            a(b);
1394                        }),
1395                        d["*"] &&
1396                            d["*"].forEach(function (c) {
1397                                c(a, b);
1398                            });
1399                }
1400                var d = [];
1401                return { addEventHandler: a, removeEventHandler: b, emit: c };
1402            };
1403        })(this || global, a),
1404        (function (a, b) {
1405            "use strict";
1406            function c(a) {
1407                var b = [];
1408                if (a.length) for (var c = 0; c < a.length; c++) b.push(a[c]);
1409                return b;
1410            }
1411            function d(a, c) {
1412                var d = c || this.prototype || b.Class,
1413                    e = Object.create(d);
1414                b.Class.cloneDefinitions(e, a);
1415                var f = function () {
1416                    var a,
1417                        c = e.constructor || function () {};
1418                    return (a = this === b ? Object.create(e) : this), c.apply(a, Array.prototype.slice.call(arguments, 0)), a;
1419                };
1420                return (f.prototype = e), (f["super"] = d), (f.extend = this.extend), f;
1421            }
1422            function e() {
1423                var a = c(arguments),
1424                    b = a[0];
1425                return (
1426                    a.splice(1, a.length - 1).forEach(function (a) {
1427                        Object.getOwnPropertyNames(a).forEach(function (c) {
1428                            delete b[c], Object.defineProperty(b, c, Object.getOwnPropertyDescriptor(a, c));
1429                        });
1430                    }),
1431                    b
1432                );
1433            }
1434            b.Class = { extend: d, cloneDefinitions: e };
1435        })(this || global, a),
1436        (function (a, b) {
1437            "use strict";
1438            function c(a, c, d) {
1439                return (
1440                    a && ((this.data = a || {}), (this.data.labels = this.data.labels || []), (this.data.series = this.data.series || []), this.eventEmitter.emit("data", { type: "update", data: this.data })),
1441                    c &&
1442                        ((this.options = b.extend({}, d ? this.options : this.defaultOptions, c)),
1443                        this.initializeTimeoutId || (this.optionsProvider.removeMediaQueryListeners(), (this.optionsProvider = b.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter)))),
1444                    this.initializeTimeoutId || this.createChart(this.optionsProvider.getCurrentOptions()),
1445                    this
1446                );
1447            }
1448            function d() {
1449                return this.initializeTimeoutId ? i.clearTimeout(this.initializeTimeoutId) : (i.removeEventListener("resize", this.resizeListener), this.optionsProvider.removeMediaQueryListeners()), this;
1450            }
1451            function e(a, b) {
1452                return this.eventEmitter.addEventHandler(a, b), this;
1453            }
1454            function f(a, b) {
1455                return this.eventEmitter.removeEventHandler(a, b), this;
1456            }
1457            function g() {
1458                i.addEventListener("resize", this.resizeListener),
1459                    (this.optionsProvider = b.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter)),
1460                    this.eventEmitter.addEventHandler(
1461                        "optionsChanged",
1462                        function () {
1463                            this.update();
1464                        }.bind(this)
1465                    ),
1466                    this.options.plugins &&
1467                        this.options.plugins.forEach(
1468                            function (a) {
1469                                a instanceof Array ? a[0](this, a[1]) : a(this);
1470                            }.bind(this)
1471                        ),
1472                    this.eventEmitter.emit("data", { type: "initial", data: this.data }),
1473                    this.createChart(this.optionsProvider.getCurrentOptions()),
1474                    (this.initializeTimeoutId = void 0);
1475            }
1476            function h(a, c, d, e, f) {
1477                (this.container = b.querySelector(a)),
1478                    (this.data = c || {}),
1479                    (this.data.labels = this.data.labels || []),
1480                    (this.data.series = this.data.series || []),
1481                    (this.defaultOptions = d),
1482                    (this.options = e),
1483                    (this.responsiveOptions = f),
1484                    (this.eventEmitter = b.EventEmitter()),
1485                    (this.supportsForeignObject = b.Svg.isSupported("Extensibility")),
1486                    (this.supportsAnimations = b.Svg.isSupported("AnimationEventsAttribute")),
1487                    (this.resizeListener = function () {
1488                        this.update();
1489                    }.bind(this)),
1490                    this.container && (this.container.__chartist__ && this.container.__chartist__.detach(), (this.container.__chartist__ = this)),
1491                    (this.initializeTimeoutId = setTimeout(g.bind(this), 0));
1492            }
1493            var i = a.window;
1494            b.Base = b.Class.extend({
1495                constructor: h,
1496                optionsProvider: void 0,
1497                container: void 0,
1498                svg: void 0,
1499                eventEmitter: void 0,
1500                createChart: function () {
1501                    throw new Error("Base chart type can't be instantiated!");
1502                },
1503                update: c,
1504                detach: d,
1505                on: e,
1506                off: f,
1507                version: b.version,
1508                supportsForeignObject: !1,
1509            });
1510        })(this || global, a),
1511        (function (a, b) {
1512            "use strict";
1513            function c(a, c, d, e, f) {
1514                a instanceof Element ? (this._node = a) : ((this._node = y.createElementNS(b.namespaces.svg, a)), "svg" === a && this.attr({ "xmlns:ct": b.namespaces.ct })),
1515                    c && this.attr(c),
1516                    d && this.addClass(d),
1517                    e && (f && e._node.firstChild ? e._node.insertBefore(this._node, e._node.firstChild) : e._node.appendChild(this._node));
1518            }
1519            function d(a, c) {
1520                return "string" == typeof a
1521                    ? c
1522                        ? this._node.getAttributeNS(c, a)
1523                        : this._node.getAttribute(a)
1524                    : (Object.keys(a).forEach(
1525                          function (c) {
1526                              if (void 0 !== a[c])
1527                                  if (c.indexOf(":") !== -1) {
1528                                      var d = c.split(":");
1529                                      this._node.setAttributeNS(b.namespaces[d[0]], c, a[c]);
1530                                  } else this._node.setAttribute(c, a[c]);
1531                          }.bind(this)
1532                      ),
1533                      this);
1534            }
1535            function e(a, c, d, e) {
1536                return new b.Svg(a, c, d, this, e);
1537            }
1538            function f() {
1539                return this._node.parentNode instanceof SVGElement ? new b.Svg(this._node.parentNode) : null;
1540            }
1541            function g() {
1542                for (var a = this._node; "svg" !== a.nodeName; ) a = a.parentNode;
1543                return new b.Svg(a);
1544            }
1545            function h(a) {
1546                var c = this._node.querySelector(a);
1547                return c ? new b.Svg(c) : null;
1548            }
1549            function i(a) {
1550                var c = this._node.querySelectorAll(a);
1551                return c.length ? new b.Svg.List(c) : null;
1552            }
1553            function j() {
1554                return this._node;
1555            }
1556            function k(a, c, d, e) {
1557                if ("string" == typeof a) {
1558                    var f = y.createElement("div");
1559                    (f.innerHTML = a), (a = f.firstChild);
1560                }
1561                a.setAttribute("xmlns", b.namespaces.xmlns);
1562                var g = this.elem("foreignObject", c, d, e);
1563                return g._node.appendChild(a), g;
1564            }
1565            function l(a) {
1566                return this._node.appendChild(y.createTextNode(a)), this;
1567            }
1568            function m() {
1569                for (; this._node.firstChild; ) this._node.removeChild(this._node.firstChild);
1570                return this;
1571            }
1572            function n() {
1573                return this._node.parentNode.removeChild(this._node), this.parent();
1574            }
1575            function o(a) {
1576                return this._node.parentNode.replaceChild(a._node, this._node), a;
1577            }
1578            function p(a, b) {
1579                return b && this._node.firstChild ? this._node.insertBefore(a._node, this._node.firstChild) : this._node.appendChild(a._node), this;
1580            }
1581            function q() {
1582                return this._node.getAttribute("class") ? this._node.getAttribute("class").trim().split(/\s+/) : [];
1583            }
1584            function r(a) {
1585                return (
1586                    this._node.setAttribute(
1587                        "class",
1588                        this.classes(this._node)
1589                            .concat(a.trim().split(/\s+/))
1590                            .filter(function (a, b, c) {
1591                                return c.indexOf(a) === b;
1592                            })
1593                            .join(" ")
1594                    ),
1595                    this
1596                );
1597            }
1598            function s(a) {
1599                var b = a.trim().split(/\s+/);
1600                return (
1601                    this._node.setAttribute(
1602                        "class",
1603                        this.classes(this._node)
1604                            .filter(function (a) {
1605                                return b.indexOf(a) === -1;
1606                            })
1607                            .join(" ")
1608                    ),
1609                    this
1610                );
1611            }
1612            function t() {
1613                return this._node.setAttribute("class", ""), this;
1614            }
1615            function u() {
1616                return this._node.getBoundingClientRect().height;
1617            }
1618            function v() {
1619                return this._node.getBoundingClientRect().width;
1620            }
1621            function w(a, c, d) {
1622                return (
1623                    void 0 === c && (c = !0),
1624                    Object.keys(a).forEach(
1625                        function (e) {
1626                            function f(a, c) {
1627                                var f,
1628                                    g,
1629                                    h,
1630                                    i = {};
1631                                a.easing && ((h = a.easing instanceof Array ? a.easing : b.Svg.Easing[a.easing]), delete a.easing),
1632                                    (a.begin = b.ensureUnit(a.begin, "ms")),
1633                                    (a.dur = b.ensureUnit(a.dur, "ms")),
1634                                    h && ((a.calcMode = "spline"), (a.keySplines = h.join(" ")), (a.keyTimes = "0;1")),
1635                                    c && ((a.fill = "freeze"), (i[e] = a.from), this.attr(i), (g = b.quantity(a.begin || 0).value), (a.begin = "indefinite")),
1636                                    (f = this.elem("animate", b.extend({ attributeName: e }, a))),
1637                                    c &&
1638                                        setTimeout(
1639                                            function () {
1640                                                try {
1641                                                    f._node.beginElement();
1642                                                } catch (b) {
1643                                                    (i[e] = a.to), this.attr(i), f.remove();
1644                                                }
1645                                            }.bind(this),
1646                                            g
1647                                        ),
1648                                    d &&
1649                                        f._node.addEventListener(
1650                                            "beginEvent",
1651                                            function () {
1652                                                d.emit("animationBegin", { element: this, animate: f._node, params: a });
1653                                            }.bind(this)
1654                                        ),
1655                                    f._node.addEventListener(
1656                                        "endEvent",
1657                                        function () {
1658                                            d && d.emit("animationEnd", { element: this, animate: f._node, params: a }), c && ((i[e] = a.to), this.attr(i), f.remove());
1659                                        }.bind(this)
1660                                    );
1661                            }
1662                            a[e] instanceof Array
1663                                ? a[e].forEach(
1664                                      function (a) {
1665                                          f.bind(this)(a, !1);
1666                                      }.bind(this)
1667                                  )
1668                                : f.bind(this)(a[e], c);
1669                        }.bind(this)
1670                    ),
1671                    this
1672                );
1673            }
1674            function x(a) {
1675                var c = this;
1676                this.svgElements = [];
1677                for (var d = 0; d < a.length; d++) this.svgElements.push(new b.Svg(a[d]));
1678                Object.keys(b.Svg.prototype)
1679                    .filter(function (a) {
1680                        return ["constructor", "parent", "querySelector", "querySelectorAll", "replace", "append", "classes", "height", "width"].indexOf(a) === -1;
1681                    })
1682                    .forEach(function (a) {
1683                        c[a] = function () {
1684                            var d = Array.prototype.slice.call(arguments, 0);
1685                            return (
1686                                c.svgElements.forEach(function (c) {
1687                                    b.Svg.prototype[a].apply(c, d);
1688                                }),
1689                                c
1690                            );
1691                        };
1692                    });
1693            }
1694            var y = a.document;
1695            (b.Svg = b.Class.extend({
1696                constructor: c,
1697                attr: d,
1698                elem: e,
1699                parent: f,
1700                root: g,
1701                querySelector: h,
1702                querySelectorAll: i,
1703                getNode: j,
1704                foreignObject: k,
1705                text: l,
1706                empty: m,
1707                remove: n,
1708                replace: o,
1709                append: p,
1710                classes: q,
1711                addClass: r,
1712                removeClass: s,
1713                removeAllClasses: t,
1714                height: u,
1715                width: v,
1716                animate: w,
1717            })),
1718                (b.Svg.isSupported = function (a) {
1719                    return y.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#" + a, "1.1");
1720                });
1721            var z = {
1722                easeInSine: [0.47, 0, 0.745, 0.715],
1723                easeOutSine: [0.39, 0.575, 0.565, 1],
1724                easeInOutSine: [0.445, 0.05, 0.55, 0.95],
1725                easeInQuad: [0.55, 0.085, 0.68, 0.53],
1726                easeOutQuad: [0.25, 0.46, 0.45, 0.94],
1727                easeInOutQuad: [0.455, 0.03, 0.515, 0.955],
1728                easeInCubic: [0.55, 0.055, 0.675, 0.19],
1729                easeOutCubic: [0.215, 0.61, 0.355, 1],
1730                easeInOutCubic: [0.645, 0.045, 0.355, 1],
1731                easeInQuart: [0.895, 0.03, 0.685, 0.22],
1732                easeOutQuart: [0.165, 0.84, 0.44, 1],
1733                easeInOutQuart: [0.77, 0, 0.175, 1],
1734                easeInQuint: [0.755, 0.05, 0.855, 0.06],
1735                easeOutQuint: [0.23, 1, 0.32, 1],
1736                easeInOutQuint: [0.86, 0, 0.07, 1],
1737                easeInExpo: [0.95, 0.05, 0.795, 0.035],
1738                easeOutExpo: [0.19, 1, 0.22, 1],
1739                easeInOutExpo: [1, 0, 0, 1],
1740                easeInCirc: [0.6, 0.04, 0.98, 0.335],
1741                easeOutCirc: [0.075, 0.82, 0.165, 1],
1742                easeInOutCirc: [0.785, 0.135, 0.15, 0.86],
1743                easeInBack: [0.6, -0.28, 0.735, 0.045],
1744                easeOutBack: [0.175, 0.885, 0.32, 1.275],
1745                easeInOutBack: [0.68, -0.55, 0.265, 1.55],
1746            };
1747            (b.Svg.Easing = z), (b.Svg.List = b.Class.extend({ constructor: x }));
1748        })(this || global, a),
1749        (function (a, b) {
1750            "use strict";
1751            function c(a, c, d, e, f, g) {
1752                var h = b.extend({ command: f ? a.toLowerCase() : a.toUpperCase() }, c, g ? { data: g } : {});
1753                d.splice(e, 0, h);
1754            }
1755            function d(a, b) {
1756                a.forEach(function (c, d) {
1757                    t[c.command.toLowerCase()].forEach(function (e, f) {
1758                        b(c, e, d, f, a);
1759                    });
1760                });
1761            }
1762            function e(a, c) {
1763                (this.pathElements = []), (this.pos = 0), (this.close = a), (this.options = b.extend({}, u, c));
1764            }
1765            function f(a) {
1766                return void 0 !== a ? ((this.pos = Math.max(0, Math.min(this.pathElements.length, a))), this) : this.pos;
1767            }
1768            function g(a) {
1769                return this.pathElements.splice(this.pos, a), this;
1770            }
1771            function h(a, b, d, e) {
1772                return c("M", { x: +a, y: +b }, this.pathElements, this.pos++, d, e), this;
1773            }
1774            function i(a, b, d, e) {
1775                return c("L", { x: +a, y: +b }, this.pathElements, this.pos++, d, e), this;
1776            }
1777            function j(a, b, d, e, f, g, h, i) {
1778                return c("C", { x1: +a, y1: +b, x2: +d, y2: +e, x: +f, y: +g }, this.pathElements, this.pos++, h, i), this;
1779            }
1780            function k(a, b, d, e, f, g, h, i, j) {
1781                return c("A", { rx: +a, ry: +b, xAr: +d, lAf: +e, sf: +f, x: +g, y: +h }, this.pathElements, this.pos++, i, j), this;
1782            }
1783            function l(a) {
1784                var c = a
1785                    .replace(/([A-Za-z])([0-9])/g, "$1 $2")
1786                    .replace(/([0-9])([A-Za-z])/g, "$1 $2")
1787                    .split(/[\s,]+/)
1788                    .reduce(function (a, b) {
1789                        return b.match(/[A-Za-z]/) && a.push([]), a[a.length - 1].push(b), a;
1790                    }, []);
1791                "Z" === c[c.length - 1][0].toUpperCase() && c.pop();
1792                var d = c.map(function (a) {
1793                        var c = a.shift(),
1794                            d = t[c.toLowerCase()];
1795                        return b.extend(
1796                            { command: c },
1797                            d.reduce(function (b, c, d) {
1798                                return (b[c] = +a[d]), b;
1799                            }, {})
1800                        );
1801                    }),
1802                    e = [this.pos, 0];
1803                return Array.prototype.push.apply(e, d), Array.prototype.splice.apply(this.pathElements, e), (this.pos += d.length), this;
1804            }
1805            function m() {
1806                var a = Math.pow(10, this.options.accuracy);
1807                return (
1808                    this.pathElements.reduce(
1809                        function (b, c) {
1810                            var d = t[c.command.toLowerCase()].map(
1811                                function (b) {
1812                                    return this.options.accuracy ? Math.round(c[b] * a) / a : c[b];
1813                                }.bind(this)
1814                            );
1815                            return b + c.command + d.join(",");
1816                        }.bind(this),
1817                        ""
1818                    ) + (this.close ? "Z" : "")
1819                );
1820            }
1821            function n(a, b) {
1822                return (
1823                    d(this.pathElements, function (c, d) {
1824                        c[d] *= "x" === d[0] ? a : b;
1825                    }),
1826                    this
1827                );
1828            }
1829            function o(a, b) {
1830                return (
1831                    d(this.pathElements, function (c, d) {
1832                        c[d] += "x" === d[0] ? a : b;
1833                    }),
1834                    this
1835                );
1836            }
1837            function p(a) {
1838                return (
1839                    d(this.pathElements, function (b, c, d, e, f) {
1840                        var g = a(b, c, d, e, f);
1841                        (g || 0 === g) && (b[c] = g);
1842                    }),
1843                    this
1844                );
1845            }
1846            function q(a) {
1847                var c = new b.Svg.Path(a || this.close);
1848                return (
1849                    (c.pos = this.pos),
1850                    (c.pathElements = this.pathElements.slice().map(function (a) {
1851                        return b.extend({}, a);
1852                    })),
1853                    (c.options = b.extend({}, this.options)),
1854                    c
1855                );
1856            }
1857            function r(a) {
1858                var c = [new b.Svg.Path()];
1859                return (
1860                    this.pathElements.forEach(function (d) {
1861                        d.command === a.toUpperCase() && 0 !== c[c.length - 1].pathElements.length && c.push(new b.Svg.Path()), c[c.length - 1].pathElements.push(d);
1862                    }),
1863                    c
1864                );
1865            }
1866            function s(a, c, d) {
1867                for (var e = new b.Svg.Path(c, d), f = 0; f < a.length; f++) for (var g = a[f], h = 0; h < g.pathElements.length; h++) e.pathElements.push(g.pathElements[h]);
1868                return e;
1869            }
1870            var t = { m: ["x", "y"], l: ["x", "y"], c: ["x1", "y1", "x2", "y2", "x", "y"], a: ["rx", "ry", "xAr", "lAf", "sf", "x", "y"] },
1871                u = { accuracy: 3 };
1872            (b.Svg.Path = b.Class.extend({ constructor: e, position: f, remove: g, move: h, line: i, curve: j, arc: k, scale: n, translate: o, transform: p, parse: l, stringify: m, clone: q, splitByCommand: r })),
1873                (b.Svg.Path.elementDescriptions = t),
1874                (b.Svg.Path.join = s);
1875        })(this || global, a),
1876        (function (a, b) {
1877            "use strict";
1878            function c(a, b, c, d) {
1879                (this.units = a), (this.counterUnits = a === e.x ? e.y : e.x), (this.chartRect = b), (this.axisLength = b[a.rectEnd] - b[a.rectStart]), (this.gridOffset = b[a.rectOff
1879set]), (this.ticks = c), (this.options = d);
1880            }
1881            function d(a, c, d, e, f) {
1882                var g = e["axis" + this.units.pos.toUpperCase()],
1883                    h = this.ticks.map(this.projectValue.bind(this)),
1884                    i = this.ticks.map(g.labelInterpolationFnc);
1885                h.forEach(
1886                    function (j, k) {
1887                        var l,
1888                            m = { x: 0, y: 0 };
1889                        (l = h[k + 1] ? h[k + 1] - j : Math.max(this.axisLength - j, 30)),
1890                            (b.isFalseyButZero(i[k]) && "" !== i[k]) ||
1891                                ("x" === this.units.pos
1892                                    ? ((j = this.chartRect.x1 + j),
1893                                      (m.x = e.axisX.labelOffset.x),
1894                                      "start" === e.axisX.position ? (m.y = this.chartRect.padding.top + e.axisX.labelOffset.y + (d ? 5 : 20)) : (m.y = this.chartRect.y1 + e.axisX.labelOffset.y + (d ? 5 : 20)))
1895                                    : ((j = this.chartRect.y1 - j),
1896                                      (m.y = e.axisY.labelOffset.y - (d ? l : 0)),
1897                                      "start" === e.axisY.position ? (m.x = d ? this.chartRect.padding.left + e.axisY.labelOffset.x : this.chartRect.x1 - 10) : (m.x = this.chartRect.x2 + e.axisY.labelOffset.x + 10)),
1898                                g.showGrid && b.createGrid(j, k, this, this.gridOffset, this.chartRect[this.counterUnits.len](), a, [e.classNames.grid, e.classNames[this.units.dir]], f),
1899                                g.showLabel && b.createLabel(j, l, k, i, this, g.offset, m, c, [e.classNames.label, e.classNames[this.units.dir], "start" === g.position ? e.classNames[g.position] : e.classNames.end], d, f));
1900                    }.bind(this)
1901                );
1902            }
1903            var e =
1904                (a.window,
1905                a.document,
1906                { x: { pos: "x", len: "width", dir: "horizontal", rectStart: "x1", rectEnd: "x2", rectOffset: "y2" }, y: { pos: "y", len: "height", dir: "vertical", rectStart: "y2", rectEnd: "y1", rectOffset: "x1" } });
1907            (b.Axis = b.Class.extend({
1908                constructor: c,
1909                createGridAndLabels: d,
1910                projectValue: function (a, b, c) {
1911                    throw new Error("Base axis can't be instantiated!");
1912                },
1913            })),
1914                (b.Axis.units = e);
1915        })(this || global, a),
1916        (function (a, b) {
1917            "use strict";
1918            function c(a, c, d, e) {
1919                var f = e.highLow || b.getHighLow(c, e, a.pos);
1920                (this.bounds = b.getBounds(d[a.rectEnd] - d[a.rectStart], f, e.scaleMinSpace || 20, e.onlyInteger)),
1921                    (this.range = { min: this.bounds.min, max: this.bounds.max }),
1922                    b.AutoScaleAxis["super"].constructor.call(this, a, d, this.bounds.values, e);
1923            }
1924            function d(a) {
1925                return (this.axisLength * (+b.getMultiValue(a, this.units.pos) - this.bounds.min)) / this.bounds.range;
1926            }
1927            a.window, a.document;
1928            b.AutoScaleAxis = b.Axis.extend({ constructor: c, projectValue: d });
1929        })(this || global, a),
1930        (function (a, b) {
1931            "use strict";
1932            function c(a, c, d, e) {
1933                var f = e.highLow || b.getHighLow(c, e, a.pos);
1934                (this.divisor = e.divisor || 1),
1935                    (this.ticks =
1936                        e.ticks ||
1937                        b.times(this.divisor).map(
1938                            function (a, b) {
1939                                return f.low + ((f.high - f.low) / this.divisor) * b;
1940                            }.bind(this)
1941                        )),
1942                    this.ticks.sort(function (a, b) {
1943                        return a - b;
1944                    }),
1945                    (this.range = { min: f.low, max: f.high }),
1946                    b.FixedScaleAxis["super"].constructor.call(this, a, d, this.ticks, e),
1947                    (this.stepLength = this.axisLength / this.divisor);
1948            }
1949            function d(a) {
1950                return (this.axisLength * (+b.getMultiValue(a, this.units.pos) - this.range.min)) / (this.range.max - this.range.min);
1951            }
1952            a.window, a.document;
1953            b.FixedScaleAxis = b.Axis.extend({ constructor: c, projectValue: d });
1954        })(this || global, a),
1955        (function (a, b) {
1956            "use strict";
1957            function c(a, c, d, e) {
1958                b.StepAxis["super"].constructor.call(this, a, d, e.ticks, e);
1959                var f = Math.max(1, e.ticks.length - (e.stretch ? 1 : 0));
1960                this.stepLength = this.axisLength / f;
1961            }
1962            function d(a, b) {
1963                return this.stepLength * b;
1964            }
1965            a.window, a.document;
1966            b.StepAxis = b.Axis.extend({ constructor: c, projectValue: d });
1967        })(this || global, a),
1968        (function (a, b) {
1969            "use strict";
1970            function c(a) {
1971                var c = b.normalizeData(this.data, a.reverseData, !0);
1972                this.svg = b.createSvg(this.container, a.width, a.height, a.classNames.chart);
1973                var d,
1974                    f,
1975                    g = this.svg.elem("g").addClass(a.classNames.gridGroup),
1976                    h = this.svg.elem("g"),
1977                    i = this.svg.elem("g").addClass(a.classNames.labelGroup),
1978                    j = b.createChartRect(this.svg, a, e.padding);
1979                (d =
1980                    void 0 === a.axisX.type
1981                        ? new b.StepAxis(b.Axis.units.x, c.normalized.series, j, b.extend({}, a.axisX, { ticks: c.normalized.labels, stretch: a.fullWidth }))
1982                        : a.axisX.type.call(b, b.Axis.units.x, c.normalized.series, j, a.axisX)),
1983                    (f =
1984                        void 0 === a.axisY.type
1985                            ? new b.AutoScaleAxis(b.Axis.units.y, c.normalized.series, j, b.extend({}, a.axisY, { high: b.isNumeric(a.high) ? a.high : a.axisY.high, low: b.isNumeric(a.low) ? a.low : a.axisY.low }))
1986                            : a.axisY.type.call(b, b.Axis.units.y, c.normalized.series, j, a.axisY)),
1987                    d.createGridAndLabels(g, i, this.supportsForeignObject, a, this.eventEmitter),
1988                    f.createGridAndLabels(g, i, this.supportsForeignObject, a, this.eventEmitter),
1989                    a.showGridBackground && b.createGridBackground(g, j, a.classNames.gridBackground, this.eventEmitter),
1990                    c.raw.series.forEach(
1991                        function (e, g) {
1992                            var i = h.elem("g");
1993                            i.attr({ "ct:series-name": e.name, "ct:meta": b.serialize(e.meta) }), i.addClass([a.classNames.series, e.className || a.classNames.series + "-" + b.alphaNumerate(g)].join(" "));
1994                            var k = [],
1995                                l = [];
1996                            c.normalized.series[g].forEach(
1997                                function (a, h) {
1998                                    var i = { x: j.x1 + d.projectValue(a, h, c.normalized.series[g]), y: j.y1 - f.projectValue(a, h, c.normalized.series[g]) };
1999                                    k.push(i.x, i.y), l.push({ value: a, valueIndex: h, meta: b.getMetaData(e, h) });
2000                                }.bind(this)
2001                            );
2002                            var m = {
2003                                    lineSmooth: b.getSeriesOption(e, a, "lineSmooth"),
2004                                    showPoint: b.getSeriesOption(e, a, "showPoint"),
2005                                    showLine: b.getSeriesOption(e, a, "showLine"),
2006                                    showArea: b.getSeriesOption(e, a, "showArea"),
2007                                    areaBase: b.getSeriesOption(e, a, "areaBase"),
2008                                },
2009                                n = "function" == typeof m.lineSmooth ? m.lineSmooth : m.lineSmooth ? b.Interpolation.monotoneCubic() : b.Interpolation.none(),
2010                                o = n(k, l);
2011                            if (
2012                                (m.showPoint &&
2013                                    o.pathElements.forEach(
2014                                        function (c) {
2015                                            var h = i
2016                                                .elem("line", { x1: c.x, y1: c.y, x2: c.x + 0.01, y2: c.y }, a.classNames.point)
2017                                                .attr({ "ct:value": [c.data.value.x, c.data.value.y].filter(b.isNumeric).join(","), "ct:meta": b.serialize(c.data.meta) });
2018                                            this.eventEmitter.emit("draw", {
2019                                                type: "point",
2020                                                value: c.data.value,
2021                                                index: c.data.valueIndex,
2022                                                meta: c.data.meta,
2023                                                series: e,
2024                                                seriesIndex: g,
2025                                                axisX: d,
2026                                                axisY: f,
2027                                                group: i,
2028                                                element: h,
2029                                                x: c.x,
2030                                                y: c.y,
2031                                            });
2032                                        }.bind(this)
2033                                    ),
2034                                m.showLine)
2035                            ) {
2036                                var p = i.elem("path", { d: o.stringify() }, a.classNames.line, !0);
2037                                this.eventEmitter.emit("draw", {
2038                                    type: "line",
2039                                    values: c.normalized.series[g],
2040                                    path: o.clone(),
2041                                    chartRect: j,
2042                                    index: g,
2043                                    series: e,
2044                                    seriesIndex: g,
2045                                    seriesMeta: e.meta,
2046                                    axisX: d,
2047                                    axisY: f,
2048                                    group: i,
2049                                    element: p,
2050                                });
2051                            }
2052                            if (m.showArea && f.range) {
2053                                var q = Math.max(Math.min(m.areaBase, f.range.max), f.range.min),
2054                                    r = j.y1 - f.projectValue(q);
2055                                o.splitByCommand("M")
2056                                    .filter(function (a) {
2057                                        return a.pathElements.length > 1;
2058                                    })
2059                                    .map(function (a) {
2060                                        var b = a.pathElements[0],
2061                                            c = a.pathElements[a.pathElements.length - 1];
2062                                        return a
2063                                            .clone(!0)
2064                                            .position(0)
2065                                            .remove(1)
2066                                            .move(b.x, r)
2067                                            .line(b.x, b.y)
2068                                            .position(a.pathElements.length + 1)
2069                                            .line(c.x, r);
2070                                    })
2071                                    .forEach(
2072                                        function (b) {
2073                                            var h = i.elem("path", { d: b.stringify() }, a.classNames.area, !0);
2074                                            this.eventEmitter.emit("draw", { type: "area", values: c.normalized.series[g], path: b.clone(), series: e, seriesIndex: g, axisX: d, axisY: f, chartRect: j, index: g, group: i, element: h });
2075                                        }.bind(this)
2076                                    );
2077                            }
2078                        }.bind(this)
2079                    ),
2080                    this.eventEmitter.emit("created", { bounds: f.bounds, chartRect: j, axisX: d, axisY: f, svg: this.svg, options: a });
2081            }
2082            function d(a, c, d, f) {
2083                b.Line["super"].constructor.call(this, a, c, e, b.extend({}, e, d), f);
2084            }
2085            var e =
2086                (a.window,
2087                a.document,
2088                {
2089                    axisX: { offset: 30, position: "end", labelOffset: { x: 0, y: 0 }, showLabel: !0, showGrid: !0, labelInterpolationFnc: b.noop, type: void 0 },
2090                    axisY: { offset: 40, position: "start", labelOffset: { x: 0, y: 0 }, showLabel: !0, showGrid: !0, labelInterpolationFnc: b.noop, type: void 0, scaleMinSpace: 20, onlyInteger: !1 },
2091                    width: void 0,
2092                    height: void 0,
2093                    showLine: !0,
2094                    showPoint: !0,
2095                    showArea: !1,
2096                    areaBase: 0,
2097                    lineSmooth: !0,
2098                    showGridBackground: !1,
2099                    low: void 0,
2100                    high: void 0,
2101                    chartPadding: { top: 15, right: 15, bottom: 5, left: 10 },
2102                    fullWidth: !1,
2103                    reverseData: !1,
2104                    classNames: {
2105                        chart: "ct-chart-line",
2106                        label: "ct-label",
2107                        labelGroup: "ct-labels",
2108                        series: "ct-series",
2109                        line: "ct-line",
2110                        point: "ct-point",
2111                        area: "ct-area",
2112                        grid: "ct-grid",
2113                        gridGroup: "ct-grids",
2114                        gridBackground: "ct-grid-background",
2115                        vertical: "ct-vertical",
2116                        horizontal: "ct-horizontal",
2117                        start: "ct-start",
2118                        end: "ct-end",
2119                    },
2120                });
2121            b.Line = b.Base.extend({ constructor: d, createChart: c });
2122        })(this || global, a),
2123        (function (a, b) {
2124            "use strict";
2125            function c(a) {
2126                var c, d;
2127                a.distributeSeries
2128                    ? ((c = b.normalizeData(this.data, a.reverseData, a.horizontalBars ? "x" : "y")),
2129                      (c.normalized.series = c.normalized.series.map(function (a) {
2130                          return [a];
2131                      })))
2132                    : (c = b.normalizeData(this.data, a.reverseData, a.horizontalBars ? "x" : "y")),
2133                    (this.svg = b.createSvg(this.container, a.width, a.height, a.classNames.chart + (a.horizontalBars ? " " + a.classNames.horizontalBars : "")));
2134                var f = this.svg.elem("g").addClass(a.classNames.gridGroup),
2135                    g = this.svg.elem("g"),
2136                    h = this.svg.elem("g").addClass(a.classNames.labelGroup);
2137                if (a.stackBars && 0 !== c.normalized.series.length) {
2138                    var i = b.serialMap(c.normalized.series, function () {
2139                        return Array.prototype.slice
2140                            .call(arguments)
2141                            .map(function (a) {
2142                                return a;
2143                            })
2144                            .reduce(
2145                                function (a, b) {
2146                                    return { x: a.x + (b && b.x) || 0, y: a.y + (b && b.y) || 0 };
2147                                },
2148                                { x: 0, y: 0 }
2149                            );
2150                    });
2151                    d = b.getHighLow([i], a, a.horizontalBars ? "x" : "y");
2152                } else d = b.getHighLow(c.normalized.series, a, a.horizontalBars ? "x" : "y");
2153                (d.high = +a.high || (0 === a.high ? 0 : d.high)), (d.low = +a.low || (0 === a.low ? 0 : d.low));
2154                var j,
2155                    k,
2156                    l,
2157                    m,
2158                    n,
2159                    o = b.createChartRect(this.svg, a, e.padding);
2160                (k = a.distributeSeries && a.stackBars ? c.normalized.labels.slice(0, 1) : c.normalized.labels),
2161                    a.horizontalBars
2162                        ? ((j = m =
2163                              void 0 === a.axisX.type
2164                                  ? new b.AutoScaleAxis(b.Axis.units.x, c.normalized.series, o, b.extend({}, a.axisX, { highLow: d, referenceValue: 0 }))
2165                                  : a.axisX.type.call(b, b.Axis.units.x, c.normalized.series, o, b.extend({}, a.axisX, { highLow: d, referenceValue: 0 }))),
2166                          (l = n = void 0 === a.axisY.type ? new b.StepAxis(b.Axis.units.y, c.normalized.series, o, { ticks: k }) : a.axisY.type.call(b, b.Axis.units.y, c.normalized.series, o, a.axisY)))
2167                        : ((l = m = void 0 === a.axisX.type ? new b.StepAxis(b.Axis.units.x, c.normalized.series, o, { ticks: k }) : a.axisX.type.call(b, b.Axis.units.x, c.normalized.series, o, a.axisX)),
2168                          (j = n =
2169                              void 0 === a.axisY.type
2170                                  ? new b.AutoScaleAxis(b.Axis.units.y, c.normalized.series, o, b.extend({}, a.axisY, { highLow: d, referenceValue: 0 }))
2171                                  : a.axisY.type.call(b, b.Axis.units.y, c.normalized.series, o, b.extend({}, a.axisY, { highLow: d, referenceValue: 0 }))));
2172                var p = a.horizontalBars ? o.x1 + j.projectValue(0) : o.y1 - j.projectValue(0),
2173                    q = [];
2174                l.createGridAndLabels(f, h, this.supportsForeignObject, a, this.eventEmitter),
2175                    j.createGridAndLabels(f, h, this.supportsForeignObject, a, this.eventEmitter),
2176                    a.showGridBackground && b.createGridBackground(f, o, a.classNames.gridBackground, this.eventEmitter),
2177                    c.raw.series.forEach(
2178                        function (d, e) {
2179                            var f,
2180                                h,
2181                                i = e - (c.raw.series.length - 1) / 2;
2182                            (f = a.distributeSeries && !a.stackBars ? l.axisLength / c.normalized.series.length / 2 : a.distributeSeries && a.stackBars ? l.axisLength / 2 : l.axisLength / c.normalized.series[e].length / 2),
2183                                (h = g.elem("g")),
2184                                h.attr({ "ct:series-name": d.name, "ct:meta": b.serialize(d.meta) }),
2185                                h.addClass([a.classNames.series, d.className || a.classNames.series + "-" + b.alphaNumerate(e)].join(" ")),
2186                                c.normalized.series[e].forEach(
2187                                    function (g, k) {
2188                                        var r, s, t, u;
2189                                        if (
2190                                            ((u = a.distributeSeries && !a.stackBars ? e : a.distributeSeries && a.stackBars ? 0 : k),
2191                                            (r = a.horizontalBars
2192                                                ? { x: o.x1 + j.projectValue(g && g.x ? g.x : 0, k, c.normalized.series[e]), y: o.y1 - l.projectValue(g && g.y ? g.y : 0, u, c.normalized.series[e]) }
2193                                                : { x: o.x1 + l.projectValue(g && g.x ? g.x : 0, u, c.normalized.series[e]), y: o.y1 - j.projectValue(g && g.y ? g.y : 0, k, c.normalized.series[e]) }),
2194                                            l instanceof b.StepAxis &&
2195                                                (l.options.stretch || (r[l.units.pos] += f * (a.horizontalBars ? -1 : 1)), (r[l.units.pos] += a.stackBars || a.distributeSeries ? 0 : i * a.seriesBarDistance * (a.horizontalBars ? -1 : 1))),
2196                                            (t = q[k] || p),
2197                                            (q[k] = t - (p - r[l.counterUnits.pos])),
2198                                            void 0 !== g)
2199                                        ) {
2200                                            var v = {};
2201                                            (v[l.units.pos + "1"] = r[l.units.pos]),
2202                                                (v[l.units.pos + "2"] = r[l.units.pos]),
2203                                                !a.stackBars || ("accumulate" !== a.stackMode && a.stackMode)
2204                                                    ? ((v[l.counterUnits.pos + "1"] = p), (v[l.counterUnits.pos + "2"] = r[l.counterUnits.pos]))
2205                                                    : ((v[l.counterUnits.pos + "1"] = t), (v[l.counterUnits.pos + "2"] = q[k])),
2206                                                (v.x1 = Math.min(Math.max(v.x1, o.x1), o.x2)),
2207                                                (v.x2 = Math.min(Math.max(v.x2, o.x1), o.x2)),
2208                                                (v.y1 = Math.min(Math.max(v.y1, o.y2), o.y1)),
2209                                                (v.y2 = Math.min(Math.max(v.y2, o.y2), o.y1));
2210                                            var w = b.getMetaData(d, k);
2211                                            (s = h.elem("line", v, a.classNames.bar).attr({ "ct:value": [g.x, g.y].filter(b.isNumeric).join(","), "ct:meta": b.serialize(w) })),
2212                                                this.eventEmitter.emit("draw", b.extend({ type: "bar", value: g, index: k, meta: w, series: d, seriesIndex: e, axisX: m, axisY: n, chartRect: o, group: h, element: s }, v));
2213                                        }
2214                                    }.bind(this)
2215                                );
2216                        }.bind(this)
2217                    ),
2218                    this.eventEmitter.emit("created", { bounds: j.bounds, chartRect: o, axisX: m, axisY: n, svg: this.svg, options: a });
2219            }
2220            function d(a, c, d, f) {
2221                b.Bar["super"].constructor.call(this, a, c, e, b.extend({}, e, d), f);
2222            }
2223            var e =
2224                (a.window,
2225                a.document,
2226                {
2227                    axisX: { offset: 30, position: "end", labelOffset: { x: 0, y: 0 }, showLabel: !0, showGrid: !0, labelInterpolationFnc: b.noop, scaleMinSpace: 30, onlyInteger: !1 },
2228                    axisY: { offset: 40, position: "start", labelOffset: { x: 0, y: 0 }, showLabel: !0, showGrid: !0, labelInterpolationFnc: b.noop, scaleMinSpace: 20, onlyInteger: !1 },
2229                    width: void 0,
2230                    height: void 0,
2231                    high: void 0,
2232                    low: void 0,
2233                    referenceValue: 0,
2234                    chartPadding: { top: 15, right: 15, bottom: 5, left: 10 },
2235                    seriesBarDistance: 15,
2236                    stackBars: !1,
2237                    stackMode: "accumulate",
2238                    horizontalBars: !1,
2239                    distributeSeries: !1,
2240                    reverseData: !1,
2241                    showGridBackground: !1,
2242                    classNames: {
2243                        chart: "ct-chart-bar",
2244                        horizontalBars: "ct-horizontal-bars",
2245                        label: "ct-label",
2246                        labelGroup: "ct-labels",
2247                        series: "ct-series",
2248                        bar: "ct-bar",
2249                        grid: "ct-grid",
2250                        gridGroup: "ct-grids",
2251                        gridBackground: "ct-grid-background",
2252                        vertical: "ct-vertical",
2253                        horizontal: "ct-horizontal",
2254                        start: "ct-start",
2255                        end: "ct-end",
2256                    },
2257                });
2258            b.Bar = b.Base.extend({ constructor: d, createChart: c });
2259        })(this || global, a),
2260        (function (a, b) {
2261            "use strict";
2262            function c(a, b, c) {
2263                var d = b.x > a.x;
2264                return (d && "explode" === c) || (!d && "implode" === c) ? "start" : (d && "implode" === c) || (!d && "explode" === c) ? "end" : "middle";
2265            }
2266            function d(a) {
2267                var d,
2268                    e,
2269                    g,
2270                    h,
2271                    i,
2272                    j = b.normalizeData(this.data),
2273                    k = [],
2274                    l = a.startAngle;
2275                (this.svg = b.createSvg(this.container, a.width, a.height, a.donut ? a.classNames.chartDonut : a.classNames.chartPie)),
2276                    (e = b.createChartRect(this.svg, a, f.padding)),
2277                    (g = Math.min(e.width() / 2, e.height() / 2)),
2278                    (i =
2279                        a.total ||
2280                        j.normalized.series.reduce(function (a, b) {
2281                            return a + b;
2282                        }, 0));
2283                var m = b.quantity(a.donutWidth);
2284                "%" === m.unit && (m.value *= g / 100),
2285                    (g -= a.donut && !a.donutSolid ? m.value / 2 : 0),
2286                    (h = "outside" === a.labelPosition || (a.donut && !a.donutSolid) ? g : "center" === a.labelPosition ? 0 : a.donutSolid ? g - m.value / 2 : g / 2),
2287                    (h += a.labelOffset);
2288                var n = { x: e.x1 + e.width() / 2, y: e.y2 + e.height() / 2 },
2289                    o =
2290                        1 ===
2291                        j.raw.series.filter(function (a) {
2292                            return a.hasOwnProperty("value") ? 0 !== a.value : 0 !== a;
2293                        }).length;
2294                j.raw.series.forEach(
2295                    function (a, b) {
2296                        k[b] = this.svg.elem("g", null, null);
2297                    }.bind(this)
2298                ),
2299                    a.showLabel && (d = this.svg.elem("g", null, null)),
2300                    j.raw.series.forEach(
2301                        function (e, f) {
2302                            if (0 !== j.normalized.series[f] || !a.ignoreEmptyValues) {
2303                                k[f].attr({ "ct:series-name": e.name }), k[f].addClass([a.classNames.series, e.className || a.classNames.series + "-" + b.alphaNumerate(f)].join(" "));
2304                                var p = i > 0 ? l + (j.normalized.series[f] / i) * 360 : 0,
2305                                    q = Math.max(0, l - (0 === f || o ? 0 : 0.2));
2306                                p - q >= 359.99 && (p = q + 359.99);
2307                                var r,
2308                                    s,
2309                                    t,
2310                                    u = b.polarToCartesian(n.x, n.y, g, q),
2311                                    v = b.polarToCartesian(n.x, n.y, g, p),
2312                                    w = new b.Svg.Path(!a.donut || a.donutSolid).move(v.x, v.y).arc(g, g, 0, p - l > 180, 0, u.x, u.y);
2313                                a.donut
2314                                    ? a.donutSolid &&
2315                                      ((t = g - m.value), (r = b.polarToCartesian(n.x, n.y, t, l - (0 === f || o ? 0 : 0.2))), (s = b.polarToCartesian(n.x, n.y, t, p)), w.line(r.x, r.y), w.arc(t, t, 0, p - l > 180, 1, s.x, s.y))
2316                                    : w.line(n.x, n.y);
2317                                var x = a.classNames.slicePie;
2318                                a.donut && ((x = a.classNames.sliceDonut), a.donutSolid && (x = a.classNames.sliceDonutSolid));
2319                                var y = k[f].elem("path", { d: w.stringify() }, x);
2320                                if (
2321                                    (y.attr({ "ct:value": j.normalized.series[f], "ct:meta": b.serialize(e.meta) }),
2322                                    a.donut && !a.donutSolid && (y._node.style.strokeWidth = m.value + "px"),
2323                                    this.eventEmitter.emit("draw", {
2324                                        type: "slice",
2325                                        value: j.normalized.series[f],
2326                                        totalDataSum: i,
2327                                        index: f,
2328                                        meta: e.meta,
2329                                        series: e,
2330                                        group: k[f],
2331                                        element: y,
2332                                        path: w.clone(),
2333                                        center: n,
2334                                        radius: g,
2335                                        startAngle: l,
2336                                        endAngle: p,
2337                                    }),
2338                                    a.showLabel)
2339                                ) {
2340                                    var z;
2341                                    z = 1 === j.raw.series.length ? { x: n.x, y: n.y } : b.polarToCartesian(n.x, n.y, h, l + (p - l) / 2);
2342                                    var A;
2343                                    A = j.normalized.labels && !b.isFalseyButZero(j.normalized.labels[f]) ? j.normalized.labels[f] : j.normalized.series[f];
2344                                    var B = a.labelInterpolationFnc(A, f);
2345                                    if (B || 0 === B) {
2346                                        var C = d.elem("text", { dx: z.x, dy: z.y, "text-anchor": c(n, z, a.labelDirection) }, a.classNames.label).text("" + B);
2347                                        this.eventEmitter.emit("draw", { type: "label", index: f, group: d, element: C, text: "" + B, x: z.x, y: z.y });
2348                                    }
2349                                }
2350                                l = p;
2351                            }
2352                        }.bind(this)
2353                    ),
2354                    this.eventEmitter.emit("created", { chartRect: e, svg: this.svg, options: a });
2355            }
2356            function e(a, c, d, e) {
2357                b.Pie["super"].constructor.call(this, a, c, f, b.extend({}, f, d), e);
2358            }
2359            var f =
2360                (a.window,
2361                a.document,
2362                {
2363                    width: void 0,
2364                    height: void 0,
2365                    chartPadding: 5,
2366                    classNames: { chartPie: "ct-chart-pie", chartDonut: "ct-chart-donut", series: "ct-series", slicePie: "ct-slice-pie", sliceDonut: "ct-slice-donut", sliceDonutSolid: "ct-slice-donut-solid", label: "ct-label" },
2367                    startAngle: 0,
2368                    total: void 0,
2369                    donut: !1,
2370                    donutSolid: !1,
2371                    donutWidth: 60,
2372                    showLabel: !0,
2373                    labelOffset: 0,
2374                    labelPosition: "inside",
2375                    labelInterpolationFnc: b.noop,
2376                    labelDirection: "neutral",
2377                    reverseData: !1,
2378                    ignoreEmptyValues: !1,
2379                });
2380            b.Pie = b.Base.extend({ constructor: e, createChart: d, determineAnchorPosition: c });
2381        })(this || global, a),
2382        a
2383    );
2384});
2385(function (root, factory) {
2386    if (typeof define === "function" && define.amd) {
2387        define(["chartist"], function (chartist) {
2388            return (root.returnExportsGlobal = factory(chartist));
2389        });
2390    } else if (typeof exports === "object") {
2391        module.exports = factory(require("chartist"));
2392    } else {
2393        root["Chartist.plugins.legend"] = factory(root.Chartist);
2394    }
2395})(this, function (Chartist) {
2396    "use strict";
2397    var defaultOptions = { className: "", classNames: !1, removeAll: !1, legendNames: !1, clickable: !0, onClick: null, position: "top" };
2398    Chartist.plugins = Chartist.plugins || {};
2399    Chartist.plugins.legend = function (options) {
2400        if (options && options.position) {
2401            if (!(options.position === "top" || options.position === "bottom" || options.position instanceof HTMLElement)) {
2402                throw Error("The position you entered is not a valid position");
2403            }
2404            if (options.position instanceof HTMLElement) {
2405                var cachedDOMPosition = options.position;
2406                delete options.position;
2407            }
2408        }
2409        options = Chartist.extend({}, defaultOptions, options);
2410        if (cachedDOMPosition) {
2411            options.position = cachedDOMPosition;
2412        }
2413        return function legend(chart) {
2414            function removeLegendElement() {
2415                var legendElement = chart.container.querySelector(".ct-legend");
2416                if (legendElement) {
2417                    legendElement.parentNode.removeChild(legendElement);
2418                }
2419            }
2420            function setSeriesClassNames() {
2421                chart.data.series = chart.data.series.map(function (series, seriesIndex) {
2422                    if (typeof series !== "object") {
2423                        series = { value: series };
2424                    }
2425                    series.className = series.className || chart.options.classNames.series + "-" + Chartist.alphaNumerate(seriesIndex);
2426                    return series;
2427                });
2428            }
2429            function createLegendElement() {
2430                var legendElement = document.createElement("ul");
2431                legendElement.className = "ct-legend";
2432                if (chart instanceof Chartist.Pie) {
2433                    legendElement.classList.add("ct-legend-inside");
2434                }
2435                if (typeof options.className === "string" && options.className.length > 0) {
2436                    legendElement.classList.add(options.className);
2437                }
2438                if (chart.options.width) {
2439                    legendElement.style.cssText = "width: " + chart.options.width + "px;margin: 0 auto;";
2440                }
2441                return legendElement;
2442            }
2443            function getLegendNames(useLabels) {
2444                return options.legendNames || (useLabels ? chart.data.labels : chart.data.series);
2445            }
2446            function initSeriesMetadata(useLabels) {
2447                var seriesMetadata = new Array(chart.data.series.length);
2448                for (var i = 0; i < chart.data.series.length; i++) {
2449                    seriesMetadata[i] = { data: chart.data.series[i], label: useLabels ? chart.data.labels[i] : null, legend: -1 };
2450                }
2451                return seriesMetadata;
2452            }
2453            function createNameElement(i, legendText, classNamesViable) {
2454                var li = document.createElement("li");
2455                li.classList.add("ct-series-" + i);
2456                if (classNamesViable) {
2457                    li.classList.add(options.classNames[i]);
2458                }
2459                li.setAttribute("data-legend", i);
2460                li.textContent = legendText;
2461                return li;
2462            }
2463            function appendLegendToDOM(legendElement) {
2464                if (!(options.position instanceof HTMLElement)) {
2465                    switch (options.position) {
2466                        case "top":
2467                            chart.container.insertBefore(legendElement, chart.container.childNodes[0]);
2468                            break;
2469                        case "bottom":
2470                            chart.container.insertBefore(legendElement, null);
2471                            break;
2472                    }
2473                } else {
2474                    options.position.insertBefore(legendElement, null);
2475                }
2476            }
2477            function addClickHandler(legendElement, legends, seriesMetadata, useLabels) {
2478                legendElement.addEventListener("click", function (e) {
2479                    var li = e.target;
2480                    if (li.parentNode !== legendElement || !li.hasAttribute("data-legend")) return;
2481                    e.preventDefault();
2482                    var legendIndex = parseInt(li.getAttribute("data-legend"));
2483                    var legend = legends[legendIndex];
2484                    if (!legend.active) {
2485                        legend.active = !0;
2486                        li.classList.remove("inactive");
2487                    } else {
2488                        legend.active = !1;
2489                        li.classList.add("inactive");
2490                        var activeCount = legends.filter(function (legend) {
2491                            return legend.active;
2492                        }).length;
2493                        if (!options.removeAll && activeCount == 0) {
2494                            for (var i = 0; i < legends.length; i++) {
2495                                legends[i].active = !0;
2496                                legendElement.childNodes[i].classList.remove("inactive");
2497                            }
2498                        }
2499                    }
2500                    var newSeries = [];
2501                    var newLabels = [];
2502                    for (var i = 0; i < seriesMetadata.length; i++) {
2503                        if (seriesMetadata[i].legend != -1 && legends[seriesMetadata[i].legend].active) {
2504                            newSeries.push(seriesMetadata[i].data);
2505                            newLabels.push(seriesMetadata[i].label);
2506                        }
2507                    }
2508                    chart.data.series = newSeries;
2509                    if (useLabels) {
2510                        chart.data.labels = newLabels;
2511                    }
2512                    chart.update();
2513                    if (options.onClick) {
2514                        options.onClick(chart, e);
2515                    }
2516                });
2517            }
2518            removeLegendElement();
2519            var legendElement = createLegendElement();
2520            var useLabels = chart instanceof Chartist.Pie && chart.data.labels && chart.data.labels.length;
2521            var legendNames = getLegendNames(useLabels);
2522            var seriesMetadata = initSeriesMetadata(useLabels);
2523            var legends = [];
2524            var classNamesViable = Array.isArray(options.classNames) && options.classNames.length === legendNames.length;
2525            legendNames.forEach(function (legend, i) {
2526                var legendText = legend.name || legend;
2527                var legendSeries = legend.series || [i];
2528                var li = createNameElement(i, legendText, classNamesViable);
2529                legendElement.appendChild(li);
2530                legendSeries.forEach(function (seriesIndex) {
2531                    seriesMetadata[seriesIndex].legend = i;
2532                });
2533                legends.push({ text: legendText, series: legendSeries, active: !0 });
2534            });
2535            chart.on("created", function (data) {
2536                appendLegendToDOM(legendElement);
2537            });
2538            if (options.clickable) {
2539                setSeriesClassNames();
2540                addClickHandler(legendElement, legends, seriesMetadata, useLabels);
2541            }
2542        };
2543    };
2544    return Chartist.plugins.legend;
2545});
2546(function (undefined) {}.call(("object" === typeof window && window) || ("object" === typeof self && self) || ("object" === typeof global && global) || {}));
2547!(function (e, t) {
2548    "object" == typeof exports && "undefined" != typeof module ? (module.exports = t()) : "function" == typeof define && define.amd ? define("RangeTouch", t) : (e.RangeTouch = t());
2549})(this, function () {
2550    "use strict";
2551    function e(e, t) {
2552        for (var n = 0; n < t.length; n++) {
2553            var r = t[n];
2554            (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
2555        }
2556    }
2557    var t = { addCSS: !0, thumbWidth: 15, watch: !0 };
2558    var n = function (e) {
2559            return null != e ? e.constructor : null;
2560        },
2561        r = function (e, t) {
2562            return !!(e && t && e instanceof t);
2563        },
2564        u = function (e) {
2565            return null == e;
2566        },
2567        i = function (e) {
2568            return n(e) === Object;
2569        },
2570        o = function (e) {
2571            return n(e) === String;
2572        },
2573        a = function (e) {
2574            return Array.isArray(e);
2575        },
2576        c = function (e) {
2577            return r(e, NodeList);
2578        },
2579        l = {
2580            nullOrUndefined: u,
2581            object: i,
2582            number: function (e) {
2583                return n(e) === Number && !Number.isNaN(e);
2584            },
2585            string: o,
2586            boolean: function (e) {
2587                return n(e) === Boolean;
2588            },
2589            function: function (e) {
2590                return n(e) === Function;
2591            },
2592            array: a,
2593            nodeList: c,
2594            element: function (e) {
2595                return r(e, Element);
2596            },
2597            event: function (e) {
2598                return r(e, Event);
2599            },
2600            empty: function (e) {
2601                return u(e) || ((o(e) || a(e) || c(e)) && !e.length) || (i(e) && !Object.keys(e).length);
2602            },
2603        };
2604    function s(e, t) {
2605        if (1 > t) {
2606            var n = (function (e) {
2607                var t = "".concat(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);
2608                return t ? Math.max(0, (t[1] ? t[1].length : 0) - (t[2] ? +t[2] : 0)) : 0;
2609            })(t);
2610            return parseFloat(e.toFixed(n));
2611        }
2612        return Math.round(e / t) * t;
2613    }
2614    return (function () {
2615        function n(e, r) {
2616            (function (e, t) {
2617                if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
2618            })(this, n),
2619                l.element(e) ? (this.element = e) : l.string(e) && (this.element = document.querySelector(e)),
2620                l.element(this.element) && l.empty(this.element.rangeTouch) && ((this.config = Object.assign({}, t, r)), this.init());
2621        }
2622        return (
2623            (r = n),
2624            (i = [
2625                {
2626                    key: "setup",
2627                    value: function (e) {
2628                        var r = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {},
2629                            u = null;
2630                        if (
2631                            (l.empty(e) || l.string(e)
2632                                ? (u = Array.from(document.querySelectorAll(l.string(e) ? e : 'input[type="range"]')))
2633                                : l.element(e)
2634                                ? (u = [e])
2635                                : l.nodeList(e)
2636                                ? (u = Array.from(e))
2637                                : l.array(e) && (u = e.filter(l.element)),
2638                            l.empty(u))
2639                        )
2640                            return null;
2641                        var i = Object.assign({}, t, r);
2642                        l.string(e) &&
2643                            i.watch &&
2644                            new MutationObserver(function (t) {
2645                                Array.from(t).forEach(function (t) {
2646                                    Array.from(t.addedNodes).forEac
2646h(function (t) {
2647                                        l.element(t) &&
2648                                            (function (e, t) {
2649                                                return function () {
2650                                                    return Array.from(document.querySelectorAll(t)).includes(this);
2651                                                }.call(e, t);
2652                                            })(t, e) &&
2653                                            new n(t, i);
2654                                    });
2655                                });
2656                            }).observe(document.body, { childList: !0, subtree: !0 });
2657                        return u.map(function (e) {
2658                            return new n(e, r);
2659                        });
2660                    },
2661                },
2662                {
2663                    key: "enabled",
2664                    get: function () {
2665                        return "ontouchstart" in document.documentElement;
2666                    },
2667                },
2668            ]),
2669            (u = [
2670                {
2671                    key: "init",
2672                    value: function () {
2673                        n.enabled &&
2674                            (this.config.addCSS && ((this.element.style.userSelect = "none"), (this.element.style.webKitUserSelect = "none"), (this.element.style.touchAction = "manipulation")),
2675                            this.listeners(!0),
2676                            (this.element.rangeTouch = this));
2677                    },
2678                },
2679                {
2680                    key: "destroy",
2681                    value: function () {
2682                        n.enabled && (this.listeners(!1), (this.element.rangeTouch = null));
2683                    },
2684                },
2685                {
2686                    key: "listeners",
2687                    value: function (e) {
2688                        var t = this,
2689                            n = e ? "addEventListener" : "removeEventListener";
2690                        ["touchstart", "touchmove", "touchend"].forEach(function (e) {
2691                            t.element[n](
2692                                e,
2693                                function (e) {
2694                                    return t.set(e);
2695                                },
2696                                !1
2697                            );
2698                        });
2699                    },
2700                },
2701                {
2702                    key: "get",
2703                    value: function (e) {
2704                        if (!n.enabled || !l.event(e)) return null;
2705                        var t,
2706                            r = e.target,
2707                            u = e.changedTouches[0],
2708                            i = parseFloat(r.getAttribute("min")) || 0,
2709                            o = parseFloat(r.getAttribute("max")) || 100,
2710                            a = parseFloat(r.getAttribute("step")) || 1,
2711                            c = r.getBoundingClientRect(),
2712                            f = ((100 / c.width) * (this.config.thumbWidth / 2)) / 100;
2713                        return 0 > (t = (100 / c.width) * (u.clientX - c.left)) ? (t = 0) : 100 < t && (t = 100), 50 > t ? (t -= (100 - 2 * t) * f) : 50 < t && (t += 2 * (t - 50) * f), i + s((t / 100) * (o - i), a);
2714                    },
2715                },
2716                {
2717                    key: "set",
2718                    value: function (e) {
2719                        n.enabled &&
2720                            l.event(e) &&
2721                            !e.target.disabled &&
2722                            (e.preventDefault(),
2723                            (e.target.value = this.get(e)),
2724                            (function (e, t) {
2725                                if (e && t) {
2726                                    var n = new Event(t);
2727                                    e.dispatchEvent(n);
2728                                }
2729                            })(e.target, "touchend" === e.type ? "change" : "input"));
2730                    },
2731                },
2732            ]) && e(r.prototype, u),
2733            i && e(r, i),
2734            n
2735        );
2736        var r, u, i;
2737    })();
2738});
2739(function () {
2740    !(function (a, b) {
2741        return "function" == typeof define && define.amd
2742            ? define(function () {
2743                  return b();
2744              })
2745            : "object" == typeof exports
2746            ? (module.exports = b())
2747            : (a.ifvisible = b());
2748    })(this, function () {
2749        var a, b, c, d, e, f, g, h, i, j, k, l, m, n;
2750        return (
2751            (i = {}),
2752            (c = document),
2753            (k = !1),
2754            (l = "active"),
2755            (g = 6e4),
2756            (f = !1),
2757            (b = (function () {
2758                var a, b, c, d, e, f, g;
2759                return (
2760                    (a = function () {
2761                        return ((65536 * (1 + Math.random())) | 0).toString(16).substring(1);
2762                    }),
2763                    (e = function () {
2764                        return a() + a() + "-" + a() + "-" + a() + "-" + a() + "-" + a() + a() + a();
2765                    }),
2766                    (f = {}),
2767                    (c = "__ceGUID"),
2768                    (b = function (a, b, d) {
2769                        return (a[c] = void 0), a[c] || (a[c] = "ifvisible.object.event.i
2769dentifier"), f[a[c]] || (f[a[c]] = {}), f[a[c]][b] || (f[a[c]][b] = []), f[a[c]][b].push(d);
2770                    }),
2771                    (d = function (a, b, d) {
2772                        var e, g, h, i, j;
2773                        if (a[c] && f[a[c]] && f[a[c]][b]) {
2774                            for (i = f[a[c]][b], j = [], g = 0, h = i.length; g < h; g++) (e = i[g]), j.push(e(d || {}));
2775                            return j;
2776                        }
2777                    }),
2778                    (g = function (a, b, d) {
2779                        var e, g, h, i, j;
2780                        if (d) {
2781                            if (a[c] && f[a[c]] && f[a[c]][b]) for (j = f[a[c]][b], g = h = 0, i = j.length; h < i; g = ++h) if (((e = j[g]), e === d)) return f[a[c]][b].splice(g, 1), e;
2782                        } else if (a[c] && f[a[c]] && f[a[c]][b]) return delete f[a[c]][b];
2783                    }),
2784                    { add: b, remove: g, fire: d }
2785                );
2786            })()),
2787            (a = (function () {
2788                var a;
2789                return (
2790                    (a = !1),
2791                    function (b, c, d) {
2792                        return (
2793                            a ||
2794                                (a = b.addEventListener
2795                                    ? function (a, b, c) {
2796                                          return a.addEventListener(b, c, !1);
2797                                      }
2798                                    : b.attachEvent
2799                                    ? function (a, b, c) {
2800                                          return a.attachEvent("on" + b, c, !1);
2801                                      }
2802                                    : function (a, b, c) {
2803                                          return (a["on" + b] = c);
2804                                      }),
2805                            a(b, c, d)
2806                        );
2807                    }
2808                );
2809            })()),
2810            (d = function (a, b) {
2811                var d;
2812                return c.createEventObject ? a.fireEvent("on" + b, d) : ((d = c.createEvent("HTMLEvents")), d.initEvent(b, !0, !0), !a.dispatchEvent(d));
2813            }),
2814            (h = (function () {
2815                var a, b, d, e, f;
2816                for (
2817                    e = void 0,
2818                        f = 3,
2819                        d = c.createElement("div"),
2820                        a = d.getElementsByTagName("i"),
2821                        b = function () {
2822                            return (d.innerHTML = "<!--[if gt IE " + ++f + "]><i></i><![endif]-->"), a[0];
2823                        };
2824                    b();
2825
2826                );
2827                return f > 4 ? f : e;
2828            })()),
2829            (e = !1),
2830            (n = void 0),
2831            "undefined" != typeof c.hidden
2832                ? ((e = "hidden"), (n = "visibilitychange"))
2833                : "undefined" != typeof c.mozHidden
2834                ? ((e = "mozHidden"), (n = "mozvisibilitychange"))
2835                : "undefined" != typeof c.msHidden
2836                ? ((e = "msHidden"), (n = "msvisibilitychange"))
2837                : "undefined" != typeof c.webkitHidden && ((e = "webkitHidden"), (n = "webkitvisibilitychange")),
2838            (m = function () {
2839                var b, d;
2840                return (
2841                    (b = []),
2842                    (d = function () {
2843                        return (
2844                            b.map(clearTimeout),
2845                            "active" !== l && i.wakeup(),
2846                            (f = +new Date()),
2847                            b.push(
2848                                setTimeout(function () {
2849                                    if ("active" === l) return i.idle();
2850                                }, g)
2851                            )
2852                        );
2853                    }),
2854                    d(),
2855                    a(c, "mousemove", d),
2856                    a(c, "keyup", d),
2857                    a(c, "touchstart", d),
2858                    a(window, "scroll", d),
2859                    i.focus(d),
2860                    i.wakeup(d)
2861                );
2862            }),
2863            (j = function () {
2864                var b;
2865                return (
2866                    !!k ||
2867                    (e === !1
2868                        ? ((b = "blur"),
2869                          h < 9 && (b = "focusout"),
2870                          a(window, b, function () {
2871                              return i.blur();
2872                          }),
2873                          a(window, "focus", function () {
2874                              return i.focus();
2875                          }))
2876                        : a(
2877                              c,
2878                              n,
2879                              function () {
2880                                  return c[e] ? i.blur() : i.focus();
2881                              },
2882                              !1
2883                          ),
2884                    (k = !0),
2885                    m())
2886                );
2887            }),
2888            (i = {
2889                setIdleDuration: function (a) {
2890                    return (g = 1e3 * a);
2891                },
2892                getIdleDuration: function () {
2893                    return g;
2894                },
2895                getIdleInfo: function () {
2896                    var a, b;
2897                    return (
2898                        (a = +new Date()),
2899                        (b = {}),
2900                        "idle" === l
2901                            ? ((b.isIdle = !0), (b.idleFor = a - f), (b.timeLeft = 0), (b.timeLeftPer = 100))
2902                            : ((b.isIdle = !1), (b.idleFor = a - f), (b.timeLeft = f + g - a), (b.timeLeftPer = (100 - (100 * b.timeLeft) / g).toFixed(2))),
2903                        b
2904                    );
2905                },
2906                focus: function (a) {
2907                    return "function" == typeof a ? this.on("focus", a) : ((l = "active"), b.fire(this, "focus"), b.fire(this, "wakeup"), b.fire(this, "statusChanged", { status: l })), this;
2908                },
2909                blur: function (a) {
2910                    return "function" == typeof a ? this.on("blur", a) : ((l = "hidden"), b.fire(this, "blur"), b.fire(this, "idle"), b.fire(this, "statusChanged", { status: l })), this;
2911                },
2912                idle: function (a) {
2913                    return "function" == typeof a ? this.on("idle", a) : ((l = "idle"), b.fire(this, "idle"), b.fire(this, "statusChanged", { status: l })), this;
2914                },
2915                wakeup: function (a) {
2916                    return "function" == typeof a ? this.on("wakeup", a) : ((l = "active"), b.fire(this, "wakeup"), b.fire(this, "statusChanged", { status: l })), this;
2917                },
2918                on: function (a, c) {
2919                    return j(), b.add(this, a, c), this;
2920                },
2921                off: function (a, c) {
2922                    return j(), b.remove(this, a, c), this;
2923                },
2924                onEvery: function (a, b) {
2925                    var c, d;
2926                    return (
2927                        j(),
2928                        (c = !1),
2929                        b &&
2930                            (d = setInterval(function () {
2931                                if ("active" === l && c === !1) return b();
2932                            }, 1e3 * a)),
2933                        {
2934                            stop: function () {
2935                                return clearInterval(d);
2936                            },
2937                            pause: function () {
2938                                return (c = !0);
2939                            },
2940                            resume: function () {
2941                                return (c = !1);
2942                            },
2943                            code: d,
2944                            callback: b,
2945                        }
2946                    );
2947                },
2948                now: function (a) {
2949                    return j(), l === (a || "active");
2950                },
2951            })
2952        );
2953    });
2954}.call(this));
2955!(function (n, e) {
2956    "function" == typeof define && define.amd ? define(["jquery"], e) : "object" == typeof exports ? (module.exports = e(require("jquery"))) : (n.Breakpoint = e(n.jQuery));
2957})(this, function (e) {
2958    var r,
2959        t,
2960        o = e(window),
2961        i = { xs: { min: 0, max: 575 }, sm: { min: 576, max: 767 }, md: { min: 768, max: 991 }, lg: { min: 992, max: 1199 }, xl: { min: 1200, max: 1 / 0 } },
2962        a = function () {
2963            var n = t,
2964                e = o[0].innerWidth;
2965            for (var i in r) e >= r[i].min && e <= r[i].max && (t = i) !== n && o.trigger("change:breakpoint", [t, n || "xs"]);
2966        },
2967        u = function () {
2968            o.off("resize.bootstrap.breakpoints"), (t = void 0);
2969        };
2970    return {
2971        init: function (n) {
2972            (r = e.extend(!0, i, n)), u(), o.on("resize.bootstrap.breakpoints", a), a();
2973        },
2974        destroy: u,
2975        is: function (n) {
2976            return (
2977                (function (n) {
2978                    if (!r[n]) throw new Error("Invalid breakpoint");
2979                })(n),
2980                t === n
2981            );
2982        },
2983        current: function () {
2984            return t;
2985        },
2986        getBreakpoints: function () {
2987            return r;
2988        },
2989    };
2990});
2991var url_var = {};
2992var noError = !0;
2993var domain_cookie = "." + getDomainName();
2994var animationElementName = ".card";
2995var animationElementWidth = $(animationElementName).width();
2996var animationElementHeight = $(animationElementName).height();
2997function getUrlVars() {
2998    var url = window.location.href;
2999    url_var["HTTP_HOST"] = document.location.origin;
3000    url = url.replace(url_var["HTTP_HOST"]);
3001    explode_url = url_var["HTTP_HOST"].split("/");
3002    explode_url2 = url.split("/");
3003    apiURL();
3004    url_var["PAGE"] = "";
3005    for (var i = 1; i < explode_url2.length; i++) {
3006        url_var["PAGE"] = url_var["PAGE"] + explode_url2[i] + "/";
3007    }
3008    if (url_var["PAGE"].substring(url_var["PAGE"].length - 2) == "//") {
3009        url_var["PAGE"] = url_var["PAGE"].substring(0, url_var["PAGE"].length - 1);
3010    }
3011}
3012function getDomainName(hostName) {
3013    hostName = hostName || window.location.hostname;
3014    return hostName.substring(hostName.lastIndexOf(".", hostName.lastIndexOf(".") - 1) + 1);
3015}
3016function removeHttp(url) {
3017    url = url.replace("http://", "");
3018    url = url.replace("https://", "");
3019    return url;
3020}
3021function isProdServer() {
3022    if (url_var["HTTP_HOST"].indexOf(".fr") >= 0) {
3023        return !0;
3024    } else {
3025        return !1;
3026    }
3027}
3028function isQAServer() {
3029    if (url_var["HTTP_HOST"].indexOf("qa.") >= 0) {
3030        return !0;
3031    } else {
3032        return !1;
3033    }
3034}
3035function isDEVServer() {
3036    if (url_var["HTTP_HOST"].indexOf(".local") >= 0) {
3037        return !0;
3038    } else {
3039        return !1;
3040    }
3041}
3042function isBo() {
3043    if (window.location.href.indexOf("back-office") !== -1) {
3044        return !0;
3045    } else {
3046        return !1;
3047    }
3048}
3049function apiURL() {
3050    if (isProdServer() && isQAServer() == !1) {
3051        url_var["API_HOST"] = "https://calcul-salaire-brut-en-net.fr/api";
3052        url_var["PICS_HOST"] = "https://calcul-salaire-brut-en-net.fr";
3053    } else if (isQAServer()) {
3054    } else {
3055        url_var["API_HOST"] = "https://salaire-brut-net.local:8890/api";
3056        url_var["PICS_HOST"] = "https://salaire-brut-net.local:8890";
3057    }
3058    url_var["API_HOST"] = url_var["HTTP_HOST"] + "/api";
3059    if (isBo()) {
3060        url_var["API_HOST"] = url_var["HTTP_HOST"] + "/bo-api";
3061    }
3062}
3063function getPHPSessId() {
3064    var phpSessionId = document.cookie.match(/PHPSESSID=[A-Za-z0-9]+\;/i);
3065    if (phpSessionId == null) return "";
3066    if (typeof phpSessionId == "undefined") return "";
3067    if (phpSessionId.length <= 0) return "";
3068    phpSessionId = phpSessionId[0];
3069    var end = phpSessionId.lastIndexOf(";");
3070    if (end == -1) end = phpSessionId.length;
3071    return phpSessionId.substring(10, end);
3072}
3073$.ajaxSetup({
3074    crossDomain: !0,
3075    cache: !1,
3076    data: { PHPSESSID: getPHPSessId() },
3077    xhrFields: { withCredentials: !0 },
3078    beforeSend: function (jqXHR, settings) {
3079        settings.data = settings.data + "&PHPSESSID=" + getPHPSessId();
3080    },
3081    error: function (jqXHR, textStatus, errorThrown) {
3082        if (jqXHR.status !== 200) {
3083            addAppError("API doesnt respond correctly : " + jqXHR);
3084            console.log(jqXHR.statusText);
3085            if (jqXHR.statusText == "Session Expired") {
3086                $("#modal-session-expired").modal("show");
3087            } else {
3088                if (jqXHR.status !== 0 && jqXHR.statusText !== "error") {
3089                    openAppErrorModal();
3090                    HideLoaders(!0);
3091                }
3092            }
3093        }
3094    },
3095    complete: function (jqXHR, textStatus, errorThrown) {},
3096});
3097getUrlVars();
3098function createCookie(nom, valeur, jours) {
3099    var expire = "";
3100    if (jours) {
3101        var date = new Date();
3102        date.setTime(date.getTime() + jours * 24 * 60 * 60 * 1000);
3103        expire = "; expires=" + date.toGMTString();
3104    } else {
3105        expire = "";
3106    }
3107    document.cookie = nom + "=" + valeur + expire + "; path=/;SameSite=Lax";
3108}
3109function readCookie(nom) {
3110    var nom2 = nom + "=";
3111    var arrCookies = document.cookie.split(";");
3112    for (var i = 0; i < arrCookies.length; i++) {
3113        var a = arrCookies[i];
3114        while (a.charAt(0) == " ") {
3115            a = a.substring(1, a.length);
3116        }
3117        if (a.indexOf(nom2) == 0) {
3118            return a.substring(nom2.length, a.length);
3119        }
3120    }
3121    return null;
3122}
3123function cleanForm(form) {
3124    var formFields = $(form + " input,textarea");
3125    $(formFields).each(function (i) {
3126        var currentValue = $(this).val();
3127        $(this).val(currentValue.replace(/<.*?>/g, ""));
3128        log($(this).val());
3129    });
3130    log(formFields);
3131}
3132function isValidEmail(email) {
3133    var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
3134    return re.test(String(email).toLowerCase());
3135}
3136function getHtmlApi(idLoader, content, vars = null, append = !1) {
3137    clearErrorMessages();
3138    try {
3139        $.get(url_var["API_HOST"] + "/html/" + content + "?" + vars, function (data) {
3140            if (append == !1) {
3141                $(idLoader).html(data);
3142            } else {
3143                $(idLoader).append(data);
3144            }
3145        });
3146        return !0;
3147    } catch (err) {}
3148}
3149function sleep(ms) {
3150    return new Promise((resolve) => setTimeout(resolve, ms));
3151}
3152var $listener_ads = null;
3153var $listener_ads_document = null;
3154var $listener_ads_left_panel = null;
3155var settings_coming_in_view = { container: document.body, sides: "all", top: 0, right: 0, bottom: -550, left: 0 };
3156function adsPutPlaceHolder(obj) {
3157    $(".load-ads-v3").attr("style", "min-height: unset");
3158}
3159function loadAdsHTML(ads_to_load = !1) {
3160    var ads_to_load = typeof ads_to_load !== "undefined" ? ads_to_load : !1;
3161    var nb_ads = $(".load-ads-v3").not(".loaded").length;
3162    if (ads_to_load != null) {
3163        $(".load-ads-v3")
3164            .not(".loaded")
3165            .withinviewport(settings_coming_in_view)
3166            .each(function () {
3167                var ad = $(this);
3168                try {
3169                    var type = ad.attr("data-type");
3170                    $.get(url_var["API_HOST"] + "/api-html/ads/?type=" + type, function (data) {
3171                        ad.html(data);
3172                        ad.addClass("loaded");
3173                        ad.removeClass("loading");
3174                        loadAdsHTML();
3175                        return !0;
3176                    });
3177                } catch (err) {
3178                    ad.removeClass("loading");
3179                }
3180                return;
3181            });
3182    } else {
3183    }
3184    var is_job_view = $("#job-right-panel").length;
3185    var is_job_left_view = $("#job-left-panel").length;
3186    var target = document;
3187    if (is_job_view > 0) {
3188        target = "#job-right-panel";
3189    }
3190    if (is_job_left_view > 0) {
3191        if ($listener_ads_left_panel == null) {
3192            $listener_ads_left_panel = $("#job-left-panel").bind("scroll", function (event) {
3193                launchLazyAdsLoad();
3194            });
3195        }
3196        if ($listener_ads_document == null) {
3197            $listener_ads_document = $("body").bind("scroll", function (event) {
3198                launchLazyAdsLoad();
3199            });
3200        }
3201    }
3202    if (nb_ads > 0) {
3203        if ($listener_ads == null) {
3204            $listener_ads = $(target).bind("scroll", function (event) {
3205                launchLazyAdsLoad();
3206            });
3207        }
3208    }
3209}
3210function launchLazyAdsLoad() {
3211    $(".load-ads-v3")
3212        .not(".loaded")
3213        .withinviewport(settings_coming_in_view)
3214        .each(function () {
3215            if (!$(this).hasClass("loaded") && !$(this).hasClass("loading")) {
3216                $(this).addClass("loading");
3217                loadAdsHTML($(this));
3218            }
3219        });
3220}
3221var capcha = !1;
3222function sendForm(form) {
3223    clearErrorMessages();
3224    var input;
3225    cleanForm(form);
3226    var form_content = $(form).serializeArray();
3227    if (capcha != !1) {
3228        form_content.push({ name: "capcha", value: capcha });
3229    }
3230    $.post(url_var["HTTP_HOST"] + "/api", $.param(form_content), function (data) {
3231        try {
3232            var response = jQuery.parseJSON(data);
3233            workOnResponse(response);
3234            log(response);
3235        } catch (e) {
3236            addAppError("Error : " + e);
3237            addAppError("");
3238            addAppError("Response : " + data);
3239            openAppErrorModal();
3240        }
3241        capcha = !1;
3242    });
3243}
3244function sendAction(action) {
3245    var dataToSend = {};
3246    clearErrorMessages();
3247    dataToSend.action = action;
3248    $.post(url_var["HTTP_HOST"] + "/api", dataToSend, function (data) {
3249        try {
3250            var response = jQuery.parseJSON(data);
3251            workOnResponse(response);
3252        } catch (e) {
3253            addAppError("Error : " + e);
3254            addAppError("");
3255            addAppError("Response : " + data);
3256            openAppErrorModal();
3257        }
3258    });
3259}
3260function sendActionWithVar(action, value) {
3261    var dataToSend = {};
3262    clearErrorMessages();
3263    dataToSend.action = action;
3264    dataToSend.value = value;
3265    $.post(url_var["HTTP_HOST"] + "/api", dataToSend, function (data) {
3266        try {
3267            var response = jQuery.parseJSON(data);
3268            workOnResponse(response);
3269        } catch (e) {
3270            addAppError("Error : " + e);
3271            addAppError("");
3272            addAppError("Response : " + data);
3273            openAppErrorModal();
3274        }
3275    });
3276}
3277function sendActionToDestinationWithVar(action, destination, value) {
3278    var dataToSend = {};
3279    clearErrorMessages();
3280    dataToSend.action = action;
3281    dataToSend.destination = destination;
3282    dataToSend.value = value;
3283    $.post(url_var["API_HOST"] + "/", dataToSend, function (data) {
3284        try {
3285            var response = jQuery.parseJSON(data);
3286            workOnResponse(response);
3287        } catch (e) {
3288            addAppError("Error : " + e);
3289            addAppError("");
3290            addAppError("Response : " + data);
3291            openAppErrorModal();
3292        }
3293    });
3294}
3295function workOnResponse(response) {
3296    var JSONObjectErrorDb = response.SQL_ERRORS;
3297    if (JSONObjectErrorDb != null && JSONObjectErrorDb.length > 0) {
3298        noError = !1;
3299        for (var key in JSONObjectErrorDb) {
3300            if (JSONObjectErrorDb.hasOwnProperty(key)) {
3301                addAppError(JSONObjectErrorDb[key]);
3302            }
3303        }
3304        openAppErrorModal();
3305    }
3306    var JSONObjectDebug = response.DEBUG_MESSAGES;
3307    if (JSONObjectDebug != null && JSONObjectDebug.length > 0) {
3308        for (var key in JSONObjectDebug) {
3309            if (JSONObjectDebug.hasOwnProperty(key)) {
3310                addAppDebug(JSONObjectDebug[key]);
3311            }
3312        }
3313        openAppDebugModal();
3314    }
3315    var JSONObjectJsActions = response.JS_ACTIONS;
3316    if (JSONObjectJsActions != null && JSONObjectJsActions.length > 0) {
3317        for (var key in JSONObjectJsActions) {
3318            if (JSONObjectJsActions.hasOwnProperty(key)) {
3319                eval(JSONObjectJsActions[key]);
3320            }
3321        }
3322    }
3323    if (noError) {
3324        var JSONObject = response.INPUT_ERROR_MESSAGES;
3325        for (var key in JSONObject) {
3326            if (JSONObject.hasOwnProperty(key)) {
3327                createInputErrorMessageMD(key, JSONObject[key]);
3328            }
3329        }
3330        var JSONObject = response.ERROR_MESSAGES;
3331        if (JSONObject != null && JSONObject.length > 0) {
3332            for (var key in JSONObject) {
3333                if (JSONObject.hasOwnProperty(key)) {
3334                    addErrorMessage(JSONObject[key]);
3335                }
3336            }
3337            openErrorMessageModal();
3338        }
3339    }
3340    HideLoaders();
3341}
3342function addInputErrorField(elementID) {
3343    $("#input-" + elementID).addClass("invalid");
3344    $("#input-" + elementID).focus(function () {
3345        $("#input-" + elementID).removeClass("invalid");
3346        HideLoaders();
3347    });
3348}
3349function addCheckboxError(object) {
3350    $("label[for=" + $(object).attr("id") + "]").css("color", "red");
3351    $(this).change(function () {
3352        if ($(object).is(":checked")) {
3353            $("label[for=" + $(object).attr("id") + "]").css("color", "");
3354        }
3355    });
3356}
3357function createInputErrorMessage(elementID, errorMessage) {
3358    var errorMessage = $("#input-" + elementID)
3359        .closest(".input-group")
3360        .after('<span  class="red-text input-error-message ' + elementID + '" id="error-message-' + elementID + '" style="">' + errorMessage + "</div>");
3361    addInputErrorField(elementID);
3362    $("#input-" + elementID).focus(function () {
3363        $("#error-message-" + elementID).remove();
3364        HideLoaders(!0);
3365    });
3366}
3367function createInputErrorMessageMD(elementID, errorMessage, prefix) {
3368    prefix = prefix || "input-";
3369    formOK = !1;
3370    var message = errorMessage;
3371    if (!$("#" + prefix + elementID).hasClass("invalid")) {
3372        createInputErrorMessage(elementID, errorMessage);
3373        if ($("#error-message-" + elementID).length == 0) {
3374            var errorMessage = $("#" + prefix + elementID)
3375                .closest(".md-input")
3376                .append('<div  class="red-text mt-0 input-error-message ' + elementID + '" id="error-' + elementID + '" style="">' + message + "</div>");
3377            addInputErrorFieldMD(elementID);
3378            $("#" + prefix + elementID).focus(function () {
3379                $("#error-" + elementID).remove();
3380                $(this).removeClass("invalid");
3381                HideLoaders(!0);
3382            });
3383        }
3384        if ($("#error-" + elementID).length == 0 && $("#error-message-" + elementID).length == 0) {
3385            var errorMessage = $("#" + prefix + elementID).append('<div  class="row col-12 mt-2 red-text mt-0 input-error-message ' + elementID + '" id="error-' + elementID + '" style="">' + message + "</div>");
3386            addInputErrorFieldMD(elementID);
3387            $("#" + prefix + elementID + " input").change(function () {
3388                $("#error-" + elementID).remove();
3389                $(this).removeClass("invalid");
3390                HideLoaders(!0);
3391            });
3392        }
3393    }
3394}
3395function addInputErrorFieldMD(elementID, prefix) {
3396    prefix = prefix || "input-";
3397    $("#" + prefix + elementID).addClass("invalid");
3398    $("#" + prefix + elementID).focus(function () {
3399        $("#" + prefix + elementID).removeClass("invalid");
3400        HideLoaders(!0);
3401    });
3402}
3403function clearErrorMessages() {
3404    noError = !0;
3405    $("span").remove(".input-error-message");
3406    HideLoaders();
3407}
3408function isInputEmpty(id) {
3409    if ($("#" + id).val().length == 0) {
3410        return !0;
3411    } else {
3412        return !1;
3413    }
3414}
3415function addInputErrorAlternate(id, errorMessage) {
3416    formOK = !1;
3417    if ($("#input-" + id).attr("type") != undefined && $("#input-" + id).attr("type") != "checkbox") {
3418        if ($("#input-" + id).val().length || $("#input-" + id).val().length == 0) {
3419            if ($("label[for=input-" + id + "]") != undefined && $("label[for=input-" + id + "]").length) {
3420                $("label[for=input-" + id + "]").css("color", "red");
3421                $("label[for=input-" + id + "]").addClass("invalid");
3422            }
3423            $("#input-" + id).focus(function () {
3424                $("label[for=input-" + id + "]").css("color", "");
3425                $("#error-" + id).text("");
3426                $(this).removeClass("invalid");
3427                $("label[for=input-" + id + "]").removeClass("invalid");
3428                HideLoaders();
3429            });
3430        }
3431    } else {
3432        if ($("#" + id).attr("type") == "hidden") {
3433            $("#error-" + id).text(errorMessage);
3434            $("#error-" + id).addClass("invalid");
3435            $("#" + id).change(function () {
3436                $("label[for=" + id + "]").css("color", "");
3437                $("label[for=" + id + "]").removeClass("invalid");
3438                $("#error-" + id).text("");
3439                $("#error-" + id).removeClass("invalid");
3440                $(this).removeClass("invalid");
3441                HideLoaders();
3442            });
3443        } else {
3444        }
3445    }
3446}
3447function addSelectErrorAlternate(id, errorMessage, id_label) {
3448    id_label = id_label || null;
3449    formOK = !1;
3450    var id = id;
3451    if (id_label != null) {
3452        id = id_label;
3453    }
3454    $("label[for=select-" + id + "]").css("color", "red");
3455    $("#error-" + id).text(errorMessage);
3456    var id_handle = id;
3457    $("#select-" + id_handle).change(function () {
3458        $("label[for=select-" + id_handle + "]").css("color", "");
3459        $("#error-" + id_handle).text("");
3460        HideLoaders();
3461    });
3462}
3463function redirectUser(page) {
3464    var host = url_var["HTTP_HOST"];
3465    var lastChar = host.substr(host.length - 1);
3466    var pageToGo = page;
3467    var firstCarPage = pageToGo.charAt(0);
3468    if (firstCarPage.indexOf("/") === -1 && lastChar.indexOf("/") === -1) {
3469        page = "/" + page;
3470    }
3471    if (page.indexOf("http") !== -1) {
3472        var url = page;
3473    } else {
3474        var url = url_var["HTTP_HOST"] + page;
3475    }
3476    if (url.charAt(0) == "/") {
3477        url = url.substring(1);
3478    }
3479    window.location.href = url;
3480}
3481function goToURL(url) {
3482    window.location.href = url;
3483}
3484function HideLoaders(force_all) {
3485    if (force_all === undefined && force_all != !0) {
3486        if (!$("#loading-overlay").hasClass("loading-forced")) {
3487            $("#loading-overlay").remove();
3488        }
3489    } else if (force_all == !0) {
3490        $("#loading-overlay").remove();
3491    }
3492    var buttons = null;
3493    if (force_all === undefined && force_all != !0) {
3494        buttons = $(".btn-is-loading:not(.btn-loading-forced)");
3495    } else {
3496        buttons = $(".btn-is-loading");
3497    }
3498    if (buttons.length > 0) {
3499        buttons.html(buttons.attr("data-original-text"));
3500        buttons.removeClass("disabled");
3501        buttons.removeClass("waves-effect waves-light");
3502        buttons.removeClass("btn-is-loading");
3503    }
3504}
3505var textError = "";
3506var textErrorMessage = "";
3507var textDebug = "";
3508function addAppError(text) {
3509    textError = textError + text + "<br>";
3510}
3511function openAppErrorModal() {
3512    HideLoaders(!0);
3513    setupLoadingDelayedButtons();
3514    var modal = $("#applicationErrorModal");
3515    modal.find(".modal-body").html(textError);
3516    modal.modal("show");
3517    textError = "";
3518}
3519function showAppErrorModal(text) {
3520    addAppError(text);
3521    openAppErrorModal();
3522}
3523function addAppDebug(text) {
3524    textDebug = textDebug + text + "<br>";
3525}
3526function addErrorMessage(text) {
3527    textErrorMessage = textErrorMessage + text + "<br>";
3528}
3529function openAppDebugModal() {
3530    var modal = $("#applicationDebugModal");
3531    modal.find(".modal-body").html(textDebug);
3532    modal.modal("show");
3533    textDebug = "";
3534}
3535function openErrorMessageModal() {
3536    HideLoaders(!0);
3537    var modal = $("#modal-error-message");
3538    modal.find(".modal-body").html(textErrorMessage);
3539    modal.modal("show");
3540    textErrorMessage = "";
3541}
3542function openBlackListedModal() {
3543    HideLoaders(!0);
3544    var modal = $("#popupBlackListed");
3545    modal.modal("show");
3546}
3547function openAlertMessageModal(title, message) {
3548    var modal = $("#modal-alert-message");
3549    modal.find(".title").html(title);
3550    modal.find(".modal-body").html(message);
3551    modal.modal("show");
3552    HideLoaders(!0);
3553}
3554function showErrorMessageModal(text) {
3555    addErrorMessage(text);
3556    openErrorMessageModal();
3557}
3558function bookmark(title, url) {
3559    if (!url) {
3560        url = window.location;
3561    }
3562    if (!title) {
3563        title = document.title;
3564    }
3565    var browser = navigator.userAgent.toLowerCase();
3566    if (window.sidebar && window.sidebar.addPanel !== "undefined") {
3567        window.sidebar.addPanel(title, url, "");
3568    } else if (window.external) {
3569        if (browser.indexOf("chrome") == -1) {
3570            window.external.AddFavorite(url, title);
3571        } else {
3572            alert("Please Press CTRL+D (or Command+D for macs) to bookmark this page");
3573        }
3574    } else if (window.opera && window.print) {
3575        return !0;
3576    } else if (browser.indexOf("konqueror") != -1) {
3577        alert("Please press CTRL+B to bookmark this page.");
3578    } else if (browser.indexOf("webkit") != -1) {
3579        alert("Please press CTRL+B (or Command+D for macs) to bookmark this page.");
3580    } else {
3581        alert("Your browser cannot add bookmarks using this link. Please add this link manually.");
3582    }
3583}
3584function isTimeToDo() {
3585    var millis = Date.now() - datetimeStart;
3586    var seconds = Math.floor(millis / 1000);
3587    if (millis > 500) {
3588        datetimeStart = Date.now();
3589        return !0;
3590    } else {
3591        return !1;
3592    }
3593}
3594function log(txt) {
3595    if (isProdServer() != !0) {
3596        console.log(txt);
3597    }
3598}
3599function sleep(time) {
3600    var promise = new Promise(function (resolve) {
3601        setTimeout(function () {
3602            resolve("result");
3603        }, time);
3604    });
3605    promise.then(
3606        function (result) {},
3607        function (error) {}
3608    );
3609}
3610function removeComa() {
3611    var new_val = $(this).val();
3612    $(this).val(new_val.replace(",", ".").replace(" ", ""));
3613}
3614function countWageGrowth() {
3615    var nb_month = $("#nb_months").val();
3616    if ($("#wage-growth").val() > 0) {
3617        var coef = 1 + $("#wage-growth").val() / 100;
3618        var initial_yearly_brut = yearly_brut;
3619        var initial_yearly_net = yearly_net;
3620        var initial_monthly_brut = monthly_brut;
3621        var initial_monthly_net = monthly_net;
3622        var new_monthly_net = initial_monthly_net * coef;
3623        var new_pourcentage_taxes = getTaxesPourcentage(new_monthly_net);
3624        $(".taxes-pourcentage-after-growth").removeClass("hidden");
3625        $(".taxes-pourcentage-after-growth").text("-" + new_pourcentage_taxes + " %");
3626        var new_monthly_brut = initial_monthly_brut * coef;
3627        var new_yearly_net = initial_yearly_net * coef;
3628        var new_yearly_brut = initial_yearly_brut * coef;
3629        var new_montly_after_taxes = new_monthly_net * (1 - new_pourcentage_taxes / 100);
3630        var new_yearly_after_taxes = new_montly_after_taxes * nb_month;
3631        new_monthly_net = roundNumber(new_monthly_net, 2);
3632        var txt_new_monthly_net = new Intl.NumberFormat(number_format).format(new_monthly_net);
3633        new_monthly_brut = roundNumber(new_monthly_brut, 2);
3634        var txt_new_monthly_brut = new Intl.NumberFormat(number_format).format(new_monthly_brut);
3635        $("#monthly_net_after_growth").val(txt_new_monthly_net);
3636        $("#monthly_brut_after_growth").val(txt_new_monthly_brut);
3637        new_yearly_net = roundNumber(new_yearly_net, 2);
3638        var txt_new_yearly_net = new Intl.NumberFormat(number_format).format(new_yearly_net);
3639        new_yearly_brut = roundNumber(new_yearly_brut, 2);
3640        var txt_new_yearly_brut = new Intl.NumberFormat(number_format).format(new_yearly_brut);
3641        $("#yearly_brut_after_growth").val(txt_new_yearly_brut, 0);
3642        $("#yearly_net_after_growth").val(txt_new_yearly_net, 0);
3643        new_montly_after_taxes = roundNumber(new_montly_after_taxes, 2);
3644        var txt_new_montly_after_taxes = new Intl.NumberFormat(number_format).format(new_montly_after_taxes);
3645        new_yearly_after_taxes = roundNumber(new_yearly_after_taxes, 2);
3646        var txt_new_yearly_after_taxes = new Intl.NumberFormat(number_format).format(new_yearly_after_taxes);
3647        $("#monthly_net_after_growth_and_taxes").val(txt_new_montly_after_taxes, 0);
3648        $("#yearly_net_after_growth_and_taxes").val(txt_new_yearly_after_taxes, 0);
3649        var monthly_net_growth = new_montly_after_taxes - monthly_after_taxes;
3650        monthly_net_growth = roundNumber(monthly_net_growth, 2);
3651        var txt_monthly_net_growth = new Intl.NumberFormat(number_format).format(monthly_net_growth);
3652        log("Initial montlhy after taxes: " + monthly_after_taxes + " -> after growth: " + new_montly_after_taxes);
3653        $("#monthly_net_growth").val(txt_monthly_net_growth, 0);
3654        $("#row_monthly_net_growth").removeClass("hidden");
3655        var yearly_net_growth = new_yearly_after_taxes - yearly_after_taxes;
3656        var txt_yearly_net_growth = new Intl.NumberFormat(number_format).format(yearly_net_growth);
3657        $("#row_yearly_net_growth").removeClass("hidden");
3658        $("#yearly_net_growth").val(txt_yearly_net_growth);
3659    } else {
3660        $(".taxes-pourcentage-after-growth").addClass("hidden");
3661        $("#monthly_net_after_growth").val("");
3662        $("#monthly_brut_after_growth").val("");
3663        $("#yearly_brut_after_growth").val("");
3664        $("#yearly_net_after_growth").val("");
3665        $("#monthly_net_after_growth_and_taxes").val("");
3666        $("#yearly_net_after_growth_and_taxes").val("");
3667        $("#yearly_net_growth").val("");
3668        $("#monthly_net_growth").val("");
3669        $("#row_yearly_net_growth").addClass("hidden");
3670        $("#row_monthly_net_growth").addClass("hidden");
3671    }
3672}
3673function setTaxesPourcentage() {
3674    taxes_pourcent_set_by_user = !1;
3675    var pourcentage_taxes = null;
3676    if (calculator_mode == "normal") {
3677        pourcentage_taxes = getTaxesPourcentage(monthly_net);
3678    } else if (calculator_mode == "chomage_partiel") {
3679        pourcentage_taxes = getTaxesPourcentage(monthly_net_chomage);
3680    }
3681    if (taxes_pourcent_set_by_user == !1) {
3682        $("#taxes-simulator").val(pourcentage_taxes);
3683        updateDynamicLabel($("#taxes-simulator"));
3684    }
3685    log("monthly_net -> " + monthly_net + "pourcentage_taxes " + pourcentage_taxes);
3686}
3687function getHourlyBrut(monthly_brut) {
3688    hourly_brut = monthly_brut / nb_hours_monthly;
3689    log("hourly brut : " + hourly_brut);
3690    log("monthly brut : " + monthly_brut);
3691    log("nb_hours_monthly " + nb_hours_monthly);
3692    return hourly_brut;
3693}
3694function setDataFromCookie() {
3695    last_input_changed_name = readCookie("input_name");
3696    last_input_changed_val = readCookie("input_val");
3697    original_input_changed_val = readCookie("original_val");
3698    $("#work_time").val(readCookie("work_time"));
3699}
3700var yearly_brut = $("#yearly_brut").val();
3701var yearly_net = $("#yearly_net").val();
3702var monthly_brut = $("#monthly_brut").val();
3703var monthly_net = $("#monthly_net").val();
3704var monthly_net_chomage = "";
3705var daily_brut = $("#daily_brut").val();
3706var daily_net = $("#daily_net").val();
3707var hourly_brut = $("#hourly_brut").val();
3708var hourly_net = $("#hourly_net").val();
3709var coef = 1;
3710var number_format = "fr-FR";
3711var monthly_after_taxes = "";
3712var yearly_after_taxes = "";
3713var uuid_simulation = "";
3714var form_data_saved = "";
3715function resetForm() {
3716    $("input.numeric").val("");
3717    $("#monthly_after_taxes").val("");
3718    $("#yearly_after_taxes").val("");
3719    $("#monthly_brut_after_growth").val("");
3720    $("#yearly_brut_after_growth").val("");
3721    $("#monthly_net_after_growth").val("");
3722    $("#yearly_net_after_growth").val("");
3723    $("#monthly_net_after_growth_and_taxes").val("");
3724    $("#yearly_net_after_growth_and_taxes").val("");
3725    $("#row_monthly_net_growth").addClass("hidden");
3726    $("#row_yearly_net_growth").addClass("hidden");
3727    $("#yearly_net_growth").val("");
3728    $("#monthly_net_growth").val("");
3729}
3730function reverseFormatNumber(val, locale) {
3731    var group = new Intl.NumberFormat(locale).format(1111).replace(/1/g, "");
3732    var decimal = new Intl.NumberFormat(locale).format(1.1).replace(/1/g, "");
3733    var reversedVal = val.replace(new RegExp("\\" + group, "g"), "");
3734    reversedVal = reversedVal.replace(new RegExp("\\" + decimal, "g"), ".");
3735    return Number.isNaN(reversedVal) ? 0 : reversedVal;
3736}
3737function execForm() {
3738    if (last_input_changed_name == null || last_input_changed_val == "" || last_input_changed_val == null) {
3739        return;
3740    }
3741    var taux = $("#taux-statut").val();
3742    var nb_month = $("#nb_months").val();
3743    log("work with last input val before update: " + last_input_changed_val);
3744    last_input_changed_val = String(last_input_changed_val).replace(",", ".").replace(" ", "").replace(" ", "").replace(" ", "").replace("..", ".");
3745    last_input_changed_val = reverseFormatNumber(last_input_changed_val, "fr");
3746    log("work with last input val : " + last_input_changed_val);
3747    var first_char = last_input_changed_val[0];
3748    if (first_char == "," || first_char == ".") {
3749        $("#" + last_input_changed_name).val("");
3750        return;
3751    }
3752    var last_char = last_input_changed_val[last_input_changed_val.length - 1];
3753    if (last_char == "," || last_char == ".") {
3754        var txt_last_input_changed_val = new Intl.NumberFormat(number_format).format(last_input_changed_val);
3755        $("#" + last_input_changed_name).val(txt_last_input_changed_val + ",");
3756        return;
3757    }
3758    manageCustomizedPourcent();
3759    var hasFocus = $("#" + last_input_changed_name).is(":focus");
3760    if (last_input_changed_val != null && hasFocus === !1) {
3761        $("#" + last_input_changed_name).val(last_input_changed_val);
3762    }
3763    if (last_input_changed_name.includes("yearly")) {
3764        if (last_input_changed_name.includes("brut")) {
3765            coef = 1 - taux / 100;
3766            yearly_brut = last_input_changed_val;
3767            yearly_net = yearly_brut * coef;
3768            monthly_brut = yearly_brut / nb_month;
3769            monthly_net = monthly_brut * (1 - taux / 100);
3770            hourly_brut = getHourlyBrut(monthly_brut);
3771        } else {
3772            coef = 1 - taux / 100;
3773            yearly_net = last_input_changed_val;
3774            yearly_brut = yearly_net / (1 - taux / 100);
3775            monthly_brut = yearly_brut / nb_month;
3776            monthly_net = monthly_brut * (1 - taux / 100);
3777            daily_net = monthly_net / nb_days_worked_by_month;
3778            daily_brut = monthly_brut / nb_days_worked_by_month;
3779            hourly_brut = getHourlyBrut(monthly_brut);
3780        }
3781        hourly_net = hourly_brut * (1 - taux / 100);
3782        daily_net = monthly_net / nb_days_worked_by_month;
3783        daily_brut = monthly_brut / nb_days_worked_by_month;
3784        log("yearly net : " + yearly_net);
3785        log("coef : " + coef);
3786        log("yearly brut : " + yearly_brut);
3787        log("daily brut : " + daily_brut);
3788        log("daily net : " + daily_net);
3789    } else if (last_input_changed_name.includes("monthly")) {
3790        if (last_input_changed_name.includes("brut")) {
3791            coef = 1 - taux / 100;
3792            monthly_brut = last_input_changed_val;
3793            yearly_brut = monthly_brut * nb_month;
3794            hourly_brut = getHourlyBrut(monthly_brut);
3795            yearly_net = yearly_brut * coef;
3796            monthly_net = monthly_brut * (1 - taux / 100);
3797            log("Net Month: " + monthly_net + " Brut Month: " + monthly_brut + " Coef: " + coef);
3798        } else {
3799            coef = 1 - taux / 100;
3800            monthly_net = last_input_changed_val;
3801            yearly_net = monthly_net * nb_month;
3802            monthly_brut = monthly_net / coef;
3803            yearly_brut = monthly_brut * nb_month;
3804            hourly_brut = monthly_brut / nb_hours_monthly;
3805        }
3806        hourly_net = hourly_brut * (1 - taux / 100);
3807        daily_net = monthly_net / nb_days_worked_by_month;
3808        daily_brut = monthly_brut / nb_days_worked_by_month;
3809    } else if (last_input_changed_name.includes("daily")) {
3810        coef = 1 - taux / 100;
3811        if (last_input_changed_name.includes("brut")) {
3812            daily_brut = last_input_changed_val;
3813            monthly_brut = daily_brut * nb_days_worked_by_month;
3814            yearly_brut = monthly_brut * nb_month;
3815            monthly_net = monthly_brut * (1 - taux / 100);
3816            yearly_net = monthly_net * nb_month;
3817            daily_net = monthly_net / nb_days_worked_by_month;
3818            hourly_brut = monthly_brut / nb_hours_monthly;
3819            hourly_net = hourly_brut * (1 - taux / 100);
3820        } else {
3821            daily_net = last_input_changed_val;
3822            monthly_net = daily_net * nb_days_worked_by_month;
3823            yearly_net = monthly_net * nb_month;
3824            monthly_brut = monthly_net / coef;
3825            yearly_brut = monthly_brut * nb_month;
3826            hourly_brut = monthly_brut / nb_hours_monthly;
3827            daily_brut = monthly_brut / nb_days_worked_by_month;
3828            hourly_net = hourly_brut * (1 - taux / 100);
3829        }
3830    } else if (last_input_changed_name.includes("hourly")) {
3831        if (last_input_changed_name.includes("brut")) {
3832            coef = 1 - taux / 100;
3833            hourly_brut = last_input_changed_val;
3834            monthly_brut = hourly_brut * nb_hours_monthly;
3835            yearly_brut = monthly_brut * nb_month;
3836            yearly_net = yearly_brut * coef;
3837            hourly_net = hourly_brut * coef;
3838        } else {
3839            coef = 1 - taux / 100;
3840            hourly_net = last_input_changed_val;
3841            hourly_brut = hourly_net / coef;
3842            monthly_brut = hourly_brut * nb_hours_monthly;
3843            yearly_brut = monthly_brut * nb_month;
3844            yearly_net = yearly_brut * coef;
3845        }
3846        monthly_net = monthly_brut * (1 - taux / 100);
3847        daily_net = monthly_net / nb_days_worked_by_month;
3848        daily_brut = monthly_brut / nb_days_worked_by_month;
3849    }
3850    var sliding_work_time = $("#work-time").is(":focus");
3851    yearly_brut = roundNumber(yearly_brut, 2);
3852    var txt_yearly_brut = new Intl.NumberFormat(number_format).format(yearly_brut);
3853    if (last_input_changed_name != "yearly_brut" || sliding_work_time) {
3854        $("#yearly_brut").val(txt_yearly_brut);
3855    }
3856    yearly_net = roundNumber(yearly_net, 2);
3857    var txt_yearly_net = new Intl.NumberFormat(number_format).format(yearly_net);
3858    if (last_input_changed_name != "yearly_net" || sliding_work_time) {
3859        $("#yearly_net").val(txt_yearly_net);
3860    }
3861    monthly_brut = roundNumber(monthly_brut, 2);
3862    var txt_monthly_brut = new Intl.NumberFormat(number_format).format(monthly_brut);
3863    if (last_input_changed_name != "monthly_brut" || sliding_work_time) {
3864        $("#monthly_brut").val(txt_monthly_brut);
3865    }
3866    monthly_net = roundNumber(monthly_net, 2);
3867    var txt_monthly_net = new Intl.NumberFormat(number_format).format(monthly_net);
3868    if (last_input_changed_name != "monthly_net" || sliding_work_time) {
3869        $("#monthly_net").val(txt_monthly_net);
3870    }
3871    daily_brut = roundNumber(daily_brut, 2);
3872    var txt_daily_brut = new Intl.NumberFormat(number_format).format(daily_brut);
3873    if (last_input_changed_name != "daily_brut" || sliding_work_time) {
3874        $("#daily_brut").val(txt_daily_brut);
3875    }
3876    daily_net = roundNumber(daily_net, 2);
3877    var txt_daily_net = new Intl.NumberFormat(number_format).format(daily_net);
3878    if (last_input_changed_name != "daily_net" || sliding_work_time) {
3879        $("#daily_net").val(txt_daily_net);
3880    }
3881    hourly_brut = roundNumber(hourly_brut, 2);
3882    var txt_hourly_brut = new Intl.NumberFormat(number_format).format(hourly_brut);
3883    if (last_input_changed_name != "hourly_brut" || sliding_work_time) {
3884        $("#hourly_brut").val(txt_hourly_brut);
3885    }
3886    hourly_net = roundNumber(hourly_net, 2);
3887    var txt_hourly_net = new Intl.NumberFormat(number_format).format(hourly_net);
3888    if (last_input_changed_name != "hourly_net" || sliding_work_time) {
3889        $("#hourly_net").val(txt_hourly_net);
3890    } else {
3891    }
3892    if (calculator_mode == "chomage_partiel") {
3893        if (hours_per_week > 35) {
3894            var temp = (getHoursPerDay(35) * nb_days_worked_by_month) / (getHoursPerDay(hours_per_week) * nb_days_worked_by_month);
3895            temp = temp * monthly_brut;
3896            monthly_net_chomage = temp * 0.7;
3897        } else {
3898            monthly_net_chomage = monthly_brut * 0.7;
3899        }
3900        monthly_net_chomage = monthly_net_chomage - monthly_net_chomage * 0.067;
3901        var pourcentWorkTime = $("#work-time").val();
3902        var smicWorkTime = smic * (pourcentWorkTime / 100);
3903        var max_smic = smicWorkTime * 4.5;
3904        if (monthly_net_chomage < smicWorkTime) {
3905            monthly_net_chomage = smicWorkTime;
3906        } else if (monthly_net_chomage >= max_smic) {
3907            monthly_net_chomage = max_smic;
3908        }
3909        monthly_net_chomage = roundNumber(monthly_net_chomage, 2);
3910        var txt_monthly_net_chomage = new Intl.NumberFormat(number_format).format(monthly_net_chomage);
3911        txt_monthly_net_chomage = txt_monthly_net_chomage + " €";
3912        $("#monthly_net_chomage_partiel").text(txt_monthly_net_chomage);
3913    }
3914    if (taxes_pourcent_set_by_user == !1) {
3915        setTaxesPourcentage();
3916    }
3917    countTaxes();
3918    countWageGrowth();
3919    if (calculator_mode == "normal") {
3920        wrapperSaveSimulation();
3921    }
3922    overtimeCalcul();
3923    var coef_company_cost = 1.45;
3924    var company_cost_yearly = 0;
3925    var company_cost_monthly = 0;
3926    if ($("#overtimed").val() == "oui" && $("#type-statut").val() == "non-cadre") {
3927        company_cost_yearly = overtimed_monthly_brut * nb_month * coef_company_cost;
3928        company_cost_monthly = overtimed_monthly_brut * coef_company_cost;
3929    } else {
3930        company_cost_yearly = yearly_brut * coef_company_cost;
3931        company_cost_monthly = (yearly_brut / nb_month) * coef_company_cost;
3932    }
3933    $("#company_cost_yearly").val(roundNumber(company_cost_yearly, 2));
3934    $("#company_cost_monthly").val(roundNumber(company_cost_monthly, 2));
3935}
3936function appCountSetDoNotAskAnymore() {
3937    createCookie("APP_NB_COUNT_DONOTASK_ANYMORE", 1, 90);
3938}
3939function getDoNotAskAnymore() {
3940    if (readCookie("APP_NB_COUNT_DONOTASK_ANYMORE") == "1") {
3941        return !0;
3942    } else {
3943        return !1;
3944    }
3945}
3946function countNbCalcul() {
3947    if (last_input_changed_val != null) {
3948        var countValue = readCookie("APP_NB_COUNT");
3949        if (countValue == null || countValue == "NaN") {
3950            countValue = 1;
3951        } else {
3952            countValue = parseInt(countValue) + 1;
3953        }
3954        log("got nb calcul -> " + countValue);
3955        createCookie("APP_NB_COUNT", countValue, 90);
3956        if (getDoNotAskAnymore() == !1) {
3957            if (countValue == 3 || countValue == 25 || countValue == 50) {
3958                askForReview();
3959            } else if (countValue % 100 == 0) {
3960                askForReview();
3961            }
3962        }
3963    }
3964}
3965var refcountNbCalcul;
3966var refSaveSimulation;
3967var timeFunctionCountNbCalcul = function () {
3968    refcountNbCalcul = null;
3969    countNbCalcul();
3970};
3971function arraysMatch(a, b) {
3972    var arr1 = Object.values(a);
3973    var arr2 = Object.values(b);
3974    if (arr1.length !== arr2.length) {
3975        return !1;
3976    }
3977    for (var i = 0; i < arr1.length; i++) {
3978        var temp1 = Object.values(arr1[i]);
3979        var temp2 = Object.values(arr2[i]);
3980        if (temp1[1] == null) {
3981            return !0;
3982        }
3983        if (temp1[1].toString().replace(" ", "").replace(" ", "").replace(",", ".") !== temp2[1].toString().replace(" ", "").replace(" ", "").replace(",", ".")) {
3984            log(temp1[1] + " ->" + temp2[1]);
3985            return !1;
3986        }
3987    }
3988    return !0;
3989}
3990var timeFunctionSaveSimulation = function () {
3991    refSaveSimulation = null;
3992    var data = getSimulationData();
3993    if (!arraysMatch(data, form_data_saved)) {
3994        saveSimulation();
3995        log("saved");
3996    }
3997};
3998var wrapperCountNbCalcul = function () {
3999    window.clearTimeout(refcountNbCalcul);
4000    refcountNbCalcul = window.setTimeout(function () {
4001        timeFunctionCountNbCalcul();
4002    }, 2000);
4003};
4004var wrapperSaveSimulation = function () {
4005    window.clearTimeout(refSaveSimulation);
4006    refSaveSimulation = window.setTimeout(function () {
4007        timeFunctionSaveSimulation();
4008    }, 2000);
4009};
4010function sendSimulation() {
4011    if ($("#yearly_brut").val() == "") {
4012        openAlertMessageModal("Erreur", "Veuillez remplir le formulaire afin de pouvoir envoyer la simulation par email.");
4013        event.preventDefault();
4014        return;
4015    }
4016    var modal = $("#sendSimulation");
4017    $("#form-send-pdf").removeClass("hidden");
4018    $("#form-send-pdf-done").addClass("hidden");
4019    HideLoaders(!0);
4020    modal.modal({ show: !0, backdrop: !0 });
4021    event.preventDefault();
4022}
4023function sendAverageWage() {
4024    if ($("#yearly_brut").val() == "") {
4025        openAlertMessageModal("Erreur", "Veuillez remplir le formulaire afin de pouvoir enregistrer le sondage");
4026        event.preventDefault();
4027        return;
4028    }
4029    if ($("#yearly_brut").val() == "") {
4030        HideLoaders(!0);
4031        openAlertMessageModal("Erreur de téléchargement", "Veuillez remplir le formulaire afin de pouvoir effectuer le téléchargement.");
4032        event.preventDefault();
4033        return;
4034    }
4035    var data = getSimulationData();
4036    var dataToSend = {};
4037    clearErrorMessages();
4038    dataToSend.action = "save-wage-average";
4039    dataToSend.value = data;
4040    $.when($.post(url_var["API_HOST"], dataToSend)).done(function (data) {
4041        var response = jQuery.parseJSON(data);
4042        workOnResponse(response);
4043        uuid_simulation = response.RESPONSE.uuid;
4044        log("UUID :" + uuid_simulation);
4045        log("saved");
4046        HideLoaders(!0);
4047    });
4048    event.preventDefault();
4049}
4050function wageAverageSaved() {
4051    $("#thanks_for_sending_your_wage").removeClass("hidden");
4052    $("#wage-calculator").addClass("hidden");
4053    getHtmlApi("#average-results", "wage_average.results", "0");
4054    var dataToSend = {};
4055    dataToSend.action = "wage_average.global_average";
4056    $.when($.get(url_var["API_HOST"], dataToSend)).done(function (data) {
4057        var response = jQuery.parseJSON(data);
4058        workOnResponse(response);
4059        HideLoaders(!0);
4060    });
4061}
4062function sendSimulationDone() {
4063    $("#form-send-pdf").addClass("hidden");
4064    $("#form-send-pdf-done").removeClass("hidden");
4065    HideLoaders(!0);
4066}
4067function showCommunicationPreferences() {
4068    var modal = $("#communication-preferences");
4069    HideLoaders(!0);
4070    modal.modal({ show: !0, backdrop: !0 });
4071    event.preventDefault();
4072}
4073function closeCommunicationPreference() {
4074    $("#communication-preferences").modal("hide");
4075}
4076var currentReview = 0;
4077var intervalReviews = null;
4078function loadExperienceReviews() {
4079    getHtmlApi("#reviews-loader", "reviews.experience", "0");
4080    currentReview = 0;
4081    switchReview();
4082    clearInterval(intervalReviews);
4083    intervalReviews = setInterval(switchReview, 10000);
4084}
4085function nextReview() {
4086    var reviewContainer = $("#current-review");
4087    reviewContainer.animate({ opacity: 0 }, 1000, function () {
4088        setCurrentReview();
4089    });
4090}
4091function setCurrentReview() {
4092    var reviewContainer = $("#current-review");
4093    if ($(".row-review").length == currentReview) {
4094        currentReview = 0;
4095    }
4096    currentReview = currentReview + 1;
4097    reviewContainer.css("opacity", 0);
4098    var reviewToshow = $("#review-" + currentReview).html();
4099    reviewContainer.html(reviewToshow);
4100    reviewContainer.animate({ opacity: 1 }, 3000, function () {});
4101}
4102function refreshReviewsPerformance(note1_nb, note1_pourcent) {
4103    updateReview(1, note1_nb, note1_pourcent);
4104}
4105function updateReview(id, nb, pourcent) {
4106    $("#reviews-" + id + "-note").attr("title", "Note " + id + " - " + nb + " vote(s)");
4107    $("#reviews-" + id + "-note .progress-bar").css("width", pourcent + "%");
4108    $("#reviews-" + id + "-note .progress-bar").text(pourcent + "%");
4109}
4110function updateUsersNoteAverage(new_value) {
4111    $("#note-average-users").text("Moyenne " + new_value);
4112}
4113var currentNote = 5;
4114ratingContainer = "#review-rating";
4115ratingContainerPopup = "#review-rating-popup";
4116function initUserReviewForm() {
4117    $("textarea").autoHeight();
4118    $(ratingContainer + " .fa-star," + ratingContainerPopup + " .fa-star").each(function (i) {
4119        $(this).css("cursor", "pointer");
4120    });
4121    $(ratingContainer + "," + ratingContainerPopup + "").on("click", ".fa-star", function () {
4122        currentNote = $(this).attr("data-note");
4123        updateNote();
4124        openCalculatorReviewPopup("manual");
4125    });
4126    $(function () {
4127        var win = $(window);
4128        win.on("change:breakpoint", function (e, current, previous) {
4129            var currentBreakpoints = Breakpoint.getBreakpoints()[current];
4130            if (Breakpoint.is("xs") || Breakpoint.is("sm")) {
4131                $("#apps-icons-bottom").removeClass("hidden");
4132                $("#apps-icons-top").addClass("hidden");
4133                $("#separator-div").addClass("hidden");
4134            } else {
4135                $("#apps-icons-bottom").addClass("hidden");
4136                $("#apps-icons-top").removeClass("hidden");
4137            }
4138        })
4139            .on("resize", function () {})
4140            .trigger("resize");
4141        Breakpoint.init();
4142    });
4143}
4144function updateNote() {
4145    $("#note-value").val(currentNote);
4146    $(ratingContainer + " .fa-star," + ratingContainerPopup + " .fa-star").each(function (i) {
4147        if ($(this).attr("data-note") <= currentNote) {
4148            $(this).addClass("checked");
4149            $(this).removeClass("far");
4150            $(this).addClass("fas");
4151        } else {
4152            $(this).removeClass("checked");
4153            $(this).addClass("far");
4154            $(this).removeClass("fas");
4155        }
4156    });
4157}
4158function sendSimulationToEmail() {
4159    var email = $("#input-email-to-send-simulation").val();
4160    if (isValidEmail(email) != !0) {
4161        createInputErrorMessageMD("email-to-send-simulation", "Veuillez renseigner une adresse E-mail valide.", "input-");
4162        sleep(300);
4163        HideLoaders(!0);
4164    } else {
4165        var data = getSimulationData();
4166        var dataToSend = {};
4167        clearErrorMessages();
4168        if (!arraysMatch(data, form_data_saved) || uuid_simulation == "") {
4169            log("save and generate-pdf and send");
4170            dataToSend.action = "send-simulation-to-email";
4171            dataToSend.value = data;
4172        } else {
4173            log("UUID to send: " + uuid_simulation);
4174            dataToSend.action = "send-simulation-from-uuid-to-email";
4175            dataToSend.value = uuid_simulation;
4176        }
4177        dataToSend.email = email;
4178        $.when($.post(url_var["API_HOST"], dataToSend)).done(function (data) {
4179            var response = jQuery.parseJSON(data);
4180            workOnResponse(response);
4181            uuid_simulation = response.RESPONSE.uuid;
4182        });
4183        event.preventDefault();
4184    }
4185}
4186$("#input-review-user-name").focus(function () {
4187    $("#error-review-user-name").addClass("hidden");
4188    HideLoaders(!0);
4189});
4190var reviewsPageToLoad = 2;
4191function loadReviews() {
4192    var dataToSend = {};
4193    dataToSend.action = "load-reviews-html";
4194    dataToSend.page = reviewsPageToLoad;
4195    $.when($.get(url_var["API_HOST"], dataToSend)).done(function (data) {
4196        var response = jQuery.parseJSON(data);
4197        var reviewsHTML = response.RESPONSE.html_reviews;
4198        $("#reviews-container").append(reviewsHTML);
4199        workOnResponse(response);
4200        reviewsPageToLoad++;
4201        HideLoaders(!0);
4202    });
4203}
4204function sendReview(object) {
4205    var error = !1;
4206    $("#error-review-user-name").addClass("hidden");
4207    var user_name = $("#input-review-user-name").val();
4208    var note = $("#note-value").val();
4209    if (user_name == "") {
4210        error = !0;
4211        $("#error-review-user-name").removeClass("hidden");
4212    }
4213    if (note == "" || note == 0) {
4214        error = !0;
4215        $("#error-review-note").removeClass("hidden");
4216        $("#review-rating-popup .fa-star").unbind("click");
4217        $("#review-rating-popup .fa-star").on("click", function () {
4218            $("#error-review-note").addClass("hidden");
4219        });
4220    }
4221    if (error === !1) {
4222        var dataToSend = {};
4223        dataToSend.action = "send-review";
4224        dataToSend.user_name = user_name;
4225        dataToSend.note = $("#note-value").val();
4226        dataToSend.message = $("#input-comments").val();
4227        $.when($.post(url_var["API_HOST"], dataToSend)).done(function (data) {
4228            var response = jQuery.parseJSON(data);
4229            workOnResponse(response);
4230        });
4231        event.preventDefault();
4232    } else {
4233        HideLoaders(!0);
4234    }
4235}
4236function updateCommunicationPreferences(object) {
4237    var error = !1;
4238    var dataToSend = $("#form-update-communication-preferences").seri
4238alize();
4239    log(dataToSend);
4240    if (error === !1) {
4241        $.when($.post(url_var["API_HOST"], dataToSend)).done(function (data) {
4242            var response = jQuery.parseJSON(data);
4243            workOnResponse(response);
4244        });
4245        event.preventDefault();
4246    } else {
4247        HideLoaders(!0);
4248    }
4249}
4250function sendReviewBadFeedback(object) {
4251    $("#error-bad-feedback-email").addClass("hidden");
4252    $("#error-bad-review-comments").addClass("hidden");
4253    var email = $("#input-bad-feedback-email").val();
4254    var comments = $("#input-bad-feedback-comments").val();
4255    var inError = !1;
4256    if (email == "") {
4257        $("#error-bad-feedback-email").removeClass("hidden");
4258        HideLoaders(!0);
4259        inError = !0;
4260    }
4261    if (comments == "") {
4262        $("#error-bad-review-comments").removeClass("hidden");
4263        HideLoaders(!0);
4264        inError = !0;
4265    }
4266    if (inError === !1) {
4267        var dataToSend = {};
4268        dataToSend.action = "send-feedback";
4269        dataToSend.email = email;
4270        dataToSend.value = comments;
4271        $.when($.post(url_var["API_HOST"], dataToSend)).done(function (data) {
4272            var response = jQuery.parseJSON(data);
4273            workOnResponse(response);
4274        });
4275        event.preventDefault();
4276    }
4277}
4278function getInputNameDataFrom() {
4279    var name = $("#" + last_input_changed_name)
4280        .prev()
4281        .text();
4282    if (name.includes("%")) {
4283        return $("#" + last_input_changed_name)
4284            .prev()
4285            .prev()
4286            .text();
4287    } else {
4288        return $("#" + last_input_changed_name)
4289            .prev()
4290            .text();
4291    }
4292}
4293function getSimulationData() {
4294    var data = $("#wage-calculator").serializeArray();
4295    var temp = {};
4296    temp.name = "txt_result_from_name";
4297    temp.value = getInputNameDataFrom();
4298    data.push(temp);
4299    var temp = {};
4300    temp.name = "txt_result_from_value";
4301    temp.value = original_input_changed_val;
4302    data.push(temp);
4303    var new_pourcentage_taxes = getTaxesPourcentage(data.monthly_net);
4304    var temp = {};
4305    temp.name = "growth_new_pourcentage_taxes";
4306    temp.value = new_pourcentage_taxes;
4307    data.push(temp);
4308    var temp = {};
4309    temp.name = "source";
4310    temp.value = "www";
4311    data.push(temp);
4312    return data;
4313}
4314function downloadSimulation() {
4315    if ($("#yearly_brut").val() == "") {
4316        HideLoaders(!0);
4317        openAlertMessageModal("Erreur de téléchargement", "Veuillez remplir le formulaire afin de pouvoir effectuer le téléchargement.");
4318        event.preventDefault();
4319        return;
4320    }
4321    var data = getSimulationData();
4322    if (!arraysMatch(data, form_data_saved) || uuid_simulation == "") {
4323        var dataToSend = {};
4324        clearErrorMessages();
4325        dataToSend.action = "generate-pdf";
4326        dataToSend.value = data;
4327        $.when($.post(url_var["API_HOST"], dataToSend)).done(function (data) {
4328            var response = jQuery.parseJSON(data);
4329            workOnResponse(response);
4330            uuid_simulation = response.RESPONSE.uuid;
4331            log("UUID :" + uuid_simulation);
4332            log("saved");
4333            HideLoaders(!0);
4334        });
4335    } else {
4336        log("UUID :" + uuid_simulation);
4337        HideLoaders(!0);
4338        redirectUser("pdf/download?uuid=" + uuid_simulation);
4339        setTimeout("HideLoaders(true)", 1000);
4340    }
4341    event.preventDefault();
4342}
4343function saveSimulation() {
4344    uuid_simulation = "";
4345    var last_char = last_input_changed_val[last_input_changed_val.length - 1];
4346    if (last_char == "," || last_char == ".") {
4347        return;
4348    }
4349    if ($("#yearly_brut").val() != "") {
4350        var data = getSimulationData();
4351        form_data_saved = data;
4352        log(data);
4353        var dataToSend = {};
4354        clearErrorMessages();
4355        dataToSend.action = "save-simulation";
4356        dataToSend.value = data;
4357        $.when($.post(url_var["API_HOST"], dataToSend)).done(function (data) {
4358            var response = jQuery.parseJSON(data);
4359            workOnResponse(response);
4360            uuid_simulation = response.RESPONSE.uuid;
4361            log("UUID :" + uuid_simulation);
4362        });
4363    }
4364}
4365function countTaxes() {
4366    var pourcentage = $("#taxes-simulator").val();
4367    var coef = 1 - pourcentage / 100;
4368    if (calculator_mode == "normal") {
4369        monthly_after_taxes = monthly_net * coef;
4370        log("monthly after taxes : " + monthly_after_taxes);
4371        var nb_month = $("#nb_months").val();
4372        yearly_after_taxes = yearly_net * coef;
4373        var monthly_payed_taxes = monthly_net - monthly_after_taxes;
4374        var yearly_payed_taxes = yearly_net - yearly_after_taxes;
4375        monthly_after_taxes = roundNumber(monthly_after_taxes, 2);
4376        monthly_payed_taxes = roundNumber(monthly_payed_taxes, 2);
4377        yearly_payed_taxes = roundNumber(yearly_payed_taxes, 2);
4378        var txt_monthly_after_taxes = new Intl.NumberFormat(number_format).format(monthly_after_taxes);
4379        var txt_monthly_payed_taxes = new Intl.NumberFormat(number_format).format(monthly_payed_taxes);
4380        yearly_after_taxes = roundNumber(yearly_after_taxes, 2);
4381        var txt_yearly_after_taxes = new Intl.NumberFormat(number_format).format(yearly_after_taxes);
4382        var txt_yearly_payed_taxes = new Intl.NumberFormat(number_format).format(yearly_payed_taxes);
4383        $("#monthly_after_taxes").val(txt_monthly_after_taxes);
4384        $("#yearly_after_taxes").val(txt_yearly_after_taxes, 0);
4385        $("#yearly_payed_taxes").val(txt_yearly_payed_taxes);
4386        $("#monthly_payed_taxes").val(txt_monthly_payed_taxes, 0);
4387    } else {
4388        monthly_after_taxes = monthly_net_chomage * coef;
4389        log("monthly after taxes : " + monthly_after_taxes);
4390        var nb_month = $("#nb_months").val();
4391        yearly_after_taxes = yearly_net * coef;
4392        monthly_after_taxes = roundNumber(monthly_after_taxes, 2);
4393        var txt_monthly_after_taxes = new Intl.NumberFormat(number_format).format(monthly_after_taxes);
4394        txt_monthly_after_taxes = txt_monthly_after_taxes + " €";
4395        $("#monthly_after_taxes").text(txt_monthly_after_taxes);
4396    }
4397}
4398function roundNumber(num, scale) {
4399    if (!("" + num).includes("e")) {
4400        return +(Math.round(num + "e+" + scale) + "e-" + scale);
4401    } else {
4402        var arr = ("" + num).split("e");
4403        var sig = "";
4404        if (+arr[1] + scale > 0) {
4405            sig = "+";
4406        }
4407        return +(Math.round(+arr[0] + "e" + sig + (+arr[1] + scale)) + "e-" + scale);
4408    }
4409}
4410function openCurrentUrlSharing(url) {
4411    if (url != undefined && url != "") {
4412        $("#modal-current-url textarea").text(url);
4413    }
4414    $("#modal-current-url").modal("show");
4415}
4416function linkedInSharingCurrentPage(url) {
4417    if (url != undefined && url != "") {
4418        var url = url;
4419    } else {
4420        var url = window.location.href;
4421    }
4422    var url_linkedin = "https://www.linkedin.com/shareArticle?mini=true&url=" + url + "&title=" + $(document).find("title").text() + "&summary=" + $(document).find("title").text() + "&source=" + url;
4423    url_linkedin = encodeURI(url_linkedin);
4424    console.log(url_linkedin);
4425    window.open(url_linkedin, "Linkedin", "width=800,height=600");
4426}
4427function facebookSharingCurrentPage(url) {
4428    if (url != undefined && url != "") {
4429        var url = url;
4430    } else {
4431        var url = window.location.href;
4432    }
4433    url = "https://www.facebook.com/sharer/sharer.php?u=" + url;
4434    window.open(url, "Facebook", "width=800,height=600");
4435}
4436/*!
4437 * JavaScript Cookie v2.2.0
4438 * https://github.com/js-cookie/js-cookie
4439 *
4440 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
4441 * Released under the MIT license
4442 */
4443(function (factory) {
4444    var registeredInModuleLoader;
4445    if (typeof define === "function" && define.amd) {
4446        define(factory);
4447        registeredInModuleLoader = !0;
4448    }
4449    if (typeof exports === "object") {
4450        module.exports = factory();
4451        registeredInModuleLoader = !0;
4452    }
4453    if (!registeredInModuleLoader) {
4454        var OldCookies = window.Cookies;
4455        var api = (window.Cookies = factory());
4456        api.noConflict = function () {
4457            window.Cookies = OldCookies;
4458            return api;
4459        };
4460    }
4461})(function () {
4462    function extend() {
4463        var i = 0;
4464        var result = {};
4465        for (; i < arguments.length; i++) {
4466            var attributes = arguments[i];
4467            for (var key in attributes) {
4468                result[key] = attributes[key];
4469            }
4470        }
4471        return result;
4472    }
4473    function decode(s) {
4474        return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
4475    }
4476    function init(converter) {
4477        function api() {}
4478        function set(key, value, attributes) {
4479            if (typeof document === "undefined") {
4480                return;
4481            }
4482            attributes = extend({ path: "/" }, api.defaults, attributes);
4483            if (typeof attributes.expires === "number") {
4484                attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e5);
4485            }
4486            attributes.expires = attributes.expires ? attributes.expires.toUTCString() : "";
4487            try {
4488                var result = JSON.stringify(value);
4489                if (/^[\{\[]/.test(result)) {
4490                    value = result;
4491                }
4492            } catch (e) {}
4493            value = converter.write ? converter.write(value, key) : encodeURIComponent(String(value)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
4494            key = encodeURIComponent(String(key))
4495                .replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)
4496                .replace(/[\(\)]/g, escape);
4497            var stringifiedAttributes = "";
4498            for (var attributeName in attributes) {
4499                if (!attributes[attributeName]) {
4500                    continue;
4501                }
4502                stringifiedAttributes += "; " + attributeName;
4503                if (attributes[attributeName] === !0) {
4504                    continue;
4505                }
4506                stringifiedAttributes += "=" + attributes[attributeName].split(";")[0];
4507            }
4508            return (document.cookie = key + "=" + value + stringifiedAttributes);
4509        }
4510        function get(key, json) {
4511            if (typeof document === "undefined") {
4512                return;
4513            }
4514            var jar = {};
4515            var cookies = document.cookie ? document.cookie.split("; ") : [];
4516            var i = 0;
4517            for (; i < cookies.length; i++) {
4518                var parts = cookies[i].split("=");
4519                var cookie = parts.slice(1).join("=");
4520                if (!json && cookie.charAt(0) === '"') {
4521                    cookie = cookie.slice(1, -1);
4522                }
4523                try {
4524                    var name = decode(parts[0]);
4525                    cookie = (converter.read || converter)(cookie, name) || decode(cookie);
4526                    if (json) {
4527                        try {
4528                            cookie = JSON.parse(cookie);
4529                        } catch (e) {}
4530                    }
4531                    jar[name] = cookie;
4532                    if (key === name) {
4533                        break;
4534                    }
4535                } catch (e) {}
4536            }
4537            return key ? jar[key] : jar;
4538        }
4539        api.set = set;
4540        api.get = function (key) {
4541            return get(key, !1);
4542        };
4543        api.getJSON = function (key) {
4544            return get(key, !0);
4545        };
4546        api.push = function (key) {
4547            alert(get(key, !0));
4548        };
4549        api.remove = function (key, attributes) {
4550            set(key, "", extend(attributes, { expires: -1 }));
4551        };
4552        api.defaults = {};
4553        api.withConverter = init;
4554        return api;
4555    }
4556    return init(function () {});
4557});
4558/*! selectize.js - v0.12.6 | https://github.com/selectize/selectize.js | Apache License (v2) */
4559!(function (a, b) {
4560    "function" == typeof define && define.amd ? define("sifter", b) : "object" == typeof exports ? (module.exports = b()) : (a.Sifter = b());
4561})(this, function () {
4562    var a = function (a, b) {
4563        (this.items = a), (this.settings = b || { diacritics: !0 });
4564    };
4565    (a.prototype.tokenize = function (a) {
4566        if (!(a = e(String(a || "").toLowerCase())) || !a.length) return [];
4567        var b,
4568            c,
4569            d,
4570            g,
4571            i = [],
4572            j = a.split(/ +/);
4573        for (b = 0, c = j.length; b < c; b++) {
4574            if (((d = f(j[b])), this.settings.diacritics)) for (g in h) h.hasOwnProperty(g) && (d = d.replace(new RegExp(g, "g"), h[g]));
4575            i.push({ string: j[b], regex: new RegExp(d, "i") });
4576        }
4577        return i;
4578    }),
4579        (a.prototype.iterator = function (a, b) {
4580            var c;
4581            (c = g(a)
4582                ? Array.prototype.forEach ||
4583                  function (a) {
4584                      for (var b = 0, c = this.length; b < c; b++) a(this[b], b, this);
4585                  }
4586                : function (a) {
4587                      for (var b in this) this.hasOwnProperty(b) && a(this[b], b, this);
4588                  }),
4589                c.apply(a, [b]);
4590        }),
4591        (a.prototype.getScoreFunction = function (a, b) {
4592            var c, e, f, g, h;
4593            (c = this), (a = c.prepareSearch(a, b)), (f = a.tokens), (e = a.options.fields), (g = f.length), (h = a.options.nesting);
4594            var i = function (a, b) {
4595                    var c, d;
4596                    return a ? ((a = String(a || "")), -1 === (d = a.search(b.regex)) ? 0 : ((c = b.string.length / a.length), 0 === d && (c += 0.5), c)) : 0;
4597                },
4598                j = (function () {
4599                    var a = e.length;
4600                    return a
4601                        ? 1 === a
4602                            ? function (a, b) {
4603                                  return i(d(b, e[0], h), a);
4604                              }
4605                            : function (b, c) {
4606                                  for (var f = 0, g = 0; f < a; f++) g += i(d(c, e[f], h), b);
4607                                  return g / a;
4608                              }
4609                        : function () {
4610                              return 0;
4611                          };
4612                })();
4613            return g
4614                ? 1 === g
4615                    ? function (a) {
4616                          return j(f[0], a);
4617                      }
4618                    : "and" === a.options.conjunction
4619                    ? function (a) {
4620                          for (var b, c = 0, d = 0; c < g; c++) {
4621                              if ((b = j(f[c], a)) <= 0) return 0;
4622                              d += b;
4623                          }
4624                          return d / g;
4625                      }
4626                    : function (a) {
4627                          for (var b = 0, c = 0; b < g; b++) c += j(f[b], a);
4628                          return c / g;
4629                      }
4630                : function () {
4631                      return 0;
4632                  };
4633        }),
4634        (a.prototype.getSortFunction = function (a, c) {
4635            var e, f, g, h, i, j, k, l, m, n, o;
4636            if (
4637                ((g = this),
4638                (a = g.prepareSearch(a, c)),
4639                (o = (!a.query && c.sort_empty) || c.sort),
4640                (m = function (a, b) {
4641                    return "$score" === a ? b.score : d(g.items[b.id], a, c.nesting);
4642                }),
4643                (i = []),
4644                o)
4645            )
4646                for (e = 0, f = o.length; e < f; e++) (a.query || "$score" !== o[e].field) && i.push(o[e]);
4647            if (a.query) {
4648                for (n = !0, e = 0, f = i.length; e < f; e++)
4649                    if ("$score" === i[e].field) {
4650                        n = !1;
4651                        break;
4652                    }
4653                n && i.unshift({ field: "$score", direction: "desc" });
4654            } else
4655                for (e = 0, f = i.length; e < f; e++)
4656                    if ("$score" === i[e].field) {
4657                        i.splice(e, 1);
4658                        break;
4659                    }
4660            for (l = [], e = 0, f = i.length; e < f; e++) l.push("desc" === i[e].direction ? -1 : 1);
4661            return (
4662                (j = i.length),
4663                j
4664                    ? 1 === j
4665                        ? ((h = i[0].field),
4666                          (k = l[0]),
4667                          function (a, c) {
4668                              return k * b(m(h, a), m(h, c));
4669                          })
4670                        : function (a, c) {
4671                              var d, e, f;
4672                              for (d = 0; d < j; d++) if (((f = i[d].field), (e = l[d] * b(m(f, a), m(f, c))))) return e;
4673                              return 0;
4674                          }
4675                    : null
4676            );
4677        }),
4678        (a.prototype.prepareSearch = function (a, b) {
4679            if ("object" == typeof a) return a;
4680            b = c({}, b);
4681            var d = b.fields,
4682                e = b.sort,
4683                f = b.sort_empty;
4684            return d && !g(d) && (b.fields = [d]), e && !g(e) && (b.sort = [e]), f && !g(f) && (b.sort_empty = [f]), { options: b, query: String(a || "").toLowerCase(), tokens: this.tokenize(a), total: 0, items: [] };
4685        }),
4686        (a.prototype.search = function (a, b) {
4687            var c,
4688                d,
4689                e,
4690                f,
4691                g = this;
4692            return (
4693                (d = this.prepareSearch(a, b)),
4694                (b = d.options),
4695                (a = d.query),
4696                (f = b.score || g.getScoreFunction(d)),
4697                a.length
4698                    ? g.iterator(g.items, function (a, e) {
4699                          (c = f(a)), (!1 === b.filter || c > 0) && d.items.push({ score: c, id: e });
4700                      })
4701                    : g.iterator(g.items, function (a, b) {
4702                          d.items.push({ score: 1, id: b });
4703                      }),
4704                (e = g.getSortFunction(d, b)),
4705                e && d.items.sort(e),
4706                (d.total = d.items.length),
4707                "number" == typeof b.limit && (d.items = d.items.slice(0, b.limit)),
4708                d
4709            );
4710        });
4711    var b = function (a, b) {
4712            return "number" == typeof a && "number" == typeof b ? (a > b ? 1 : a < b ? -1 : 0) : ((a = i(String(a || ""))), (b = i(String(b || ""))), a > b ? 1 : b > a ? -1 : 0);
4713        },
4714        c = function (a, b) {
4715            var c, d, e, f;
4716            for (c = 1, d = arguments.length; c < d; c++) if ((f = arguments[c])) for (e in f) f.hasOwnProperty(e) && (a[e] = f[e]);
4717            return a;
4718        },
4719        d = function (a, b, c) {
4720            if (a && b) {
4721                if (!c) return a[b];
4722                for (var d = b.split("."); d.length && (a = a[d.shift()]); );
4723                return a;
4724            }
4725        },
4726        e = function (a) {
4727            return (a + "").replace(/^\s+|\s+$|/g, "");
4728        },
4729        f = function (a) {
4730            return (a + "").replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
4731        },
4732        g =
4733            Array.isArray ||
4734            ("undefined" != typeof $ && $.isArray) ||
4735            function (a) {
4736                return "[object Array]" === Object.prototype.toString.call(a);
4737            },
4738        h = {
4739            a: "[aḀḁĂăÂâǍǎȺⱥȦȧẠạÄäÀàÁáĀāÃãÅåąĄÃąĄ]",
4740            b: "[b␢βΒB฿𐌁ᛒ]",
4741            c: "[cĆćĈĉČčĊċC̄c̄ÇçḈḉȻȼƇƈɕᴄCc]",
4742            d: "[dĎďḊḋḐḑḌḍḒḓḎḏĐđD̦d̦ƉɖƊɗƋƌᵭᶁᶑȡᴅDdð]",
4743            e: "[eÉéÈèÊêḘḙĚěĔĕẼẽḚḛẺẻĖėËëĒēȨȩĘęᶒɆɇȄȅẾếỀềỄễỂểḜḝḖḗḔḕȆȇẸẹỆệⱸᴇEeɘǝƏƐε]",
4744            f: "[fƑƒḞḟ]",
4745            g: "[gɢ₲ǤǥĜĝĞğĢģƓɠĠġ]",
4746            h: "[hĤĥĦħḨḩẖẖḤḥḢḣɦʰǶƕ]",
4747            i: "[iÍíÌìĬĭÎîǏǐÏïḮḯĨĩĮįĪīỈỉȈȉȊȋỊịḬḭƗɨɨ̆ᵻᶖİiIıɪIi]",
4748            j: "[jȷĴĵɈɉʝɟʲ]",
4749            k: "[kƘƙꝀꝁḰḱǨǩḲḳḴḵκϰ₭]",
4750            l: "[lŁłĽľĻļĹĺḶḷḸḹḼḽḺḻĿŀȽƚⱠⱡⱢɫɬᶅɭȴʟLl]",
4751            n: "[nŃńǸǹŇňÑñṄṅŅņṆṇṊṋṈṉN̈n̈ƝɲȠƞᵰᶇɳȵɴNnŊŋ]",
4752            o: "[oØøÖöÓóÒòÔôǑǒŐőŎŏȮȯỌọƟɵƠơỎỏŌō
4752ÕõǪǫȌȍՕօ]",
4753            p: "[pṔṕṖṗⱣᵽƤƥᵱ]",
4754            q: "[qꝖꝗʠɊɋꝘꝙq̃]",
4755            r: "[rŔŕɌɍŘřŖŗṘṙȐȑȒȓṚṛⱤɽ]",
4756            s: "[sŚśṠṡṢṣꞨꞩŜŝŠšŞşȘșS̈s̈]",
4757            t: "[tŤťṪṫŢţṬṭƮʈȚțṰṱṮṯƬƭ]",
4758            u: "[uŬŭɄʉỤụÜüÚúÙùÛûǓǔŰűŬŭƯưỦủŪūŨũŲųȔȕ∪]",
4759            v: "[vṼṽṾṿƲʋꝞꝟⱱʋ]",
4760            w: "[wẂẃẀẁŴŵẄẅẆẇẈẉ]",
4761            x: "[xẌẍẊẋχ]",
4762            y: "[yÝýỲỳŶŷŸÿỸỹẎẏỴỵɎɏƳƴ]",
4763            z: "[zŹźẐẑŽžŻżẒẓẔẕƵƶ]",
4764        },
4765        i = (function () {
4766            var a,
4767                b,
4768                c,
4769                d,
4770                e = "",
4771                f = {};
4772            for (c in h) if (h.hasOwnProperty(c)) for (d = h[c].substring(2, h[c].length - 1), e += d, a = 0, b = d.length; a < b; a++) f[d.charAt(a)] = c;
4773            var g = new RegExp("[" + e + "]", "g");
4774            return function (a) {
4775                return a
4776                    .replace(g, function (a) {
4777                        return f[a];
4778                    })
4779                    .toLowerCase();
4780            };
4781        })();
4782    return a;
4783}),
4784    (function (a, b) {
4785        "function" == typeof define && define.amd ? define("microplugin", b) : "object" == typeof exports ? (module.exports = b()) : (a.MicroPlugin = b());
4786    })(this, function () {
4787        var a = {};
4788        a.mixin = function (a) {
4789            (a.plugins = {}),
4790                (a.prototype.initializePlugins = function (a) {
4791                    var c,
4792                        d,
4793                        e,
4794                        f = this,
4795                        g = [];
4796                    if (((f.plugins = { names: [], settings: {}, requested: {}, loaded: {} }), b.isArray(a)))
4797                        for (c = 0, d = a.length; c < d; c++) "string" == typeof a[c] ? g.push(a[c]) : ((f.plugins.settings[a[c].name] = a[c].options), g.push(a[c].name));
4798                    else if (a) for (e in a) a.hasOwnProperty(e) && ((f.plugins.settings[e] = a[e]), g.push(e));
4799                    for (; g.length; ) f.require(g.shift());
4800                }),
4801                (a.prototype.loadPlugin = function (b) {
4802                    var c = this,
4803                        d = c.plugins,
4804                        e = a.plugins[b];
4805                    if (!a.plugins.hasOwnProperty(b)) throw new Error('Unable to find "' + b + '" plugin');
4806                    (d.requested[b] = !0), (d.loaded[b] = e.fn.apply(c, [c.plugins.settings[b] || {}])), d.names.push(b);
4807                }),
4808                (a.prototype.require = function (a) {
4809                    var b = this,
4810                        c = b.plugins;
4811                    if (!b.plugins.loaded.hasOwnProperty(a)) {
4812                        if (c.requested[a]) throw new Error('Plugin has circular dependency ("' + a + '")');
4813                        b.loadPlugin(a);
4814                    }
4815                    return c.loaded[a];
4816                }),
4817                (a.define = function (b, c) {
4818                    a.plugins[b] = { name: b, fn: c };
4819                });
4820        };
4821        var b = {
4822            isArray:
4823                Array.isArray ||
4824                function (a) {
4825                    return "[object Array]" === Object.prototype.toString.call(a);
4826                },
4827        };
4828        return a;
4829    }),
4830    (function (a, b) {
4831        "function" == typeof define && define.amd
4832            ? define("selectize", ["jquery", "sifter", "microplugin"], b)
4833            : "object" == typeof exports
4834            ? (module.exports = b(require("jquery"), require("sifter"), require("microplugin")))
4835            : (a.Selectize = b(a.jQuery, a.Sifter, a.MicroPlugin));
4836    })(this, function (a, b, c) {
4837        "use strict";
4838        var d = function (a, b) {
4839            if ("string" != typeof b || b.length) {
4840                var c = "string" == typeof b ? new RegExp(b, "i") : b,
4841                    d = function (a) {
4842                        var b = 0;
4843                        if (3 === a.nodeType) {
4844                            var e = a.data.search(c);
4845                            if (e >= 0 && a.data.length > 0) {
4846                                var f = a.data.match(c),
4847                                    g = document.createElement("span");
4848                                g.className = "highlight";
4849                                var h = a.splitText(e),
4850                                    i = (h.splitText(f[0].length), h.cloneNode(!0));
4851                                g.appendChild(i), h.parentNode.replaceChild(g, h), (b = 1);
4852                            }
4853                        } else if (1 === a.nodeType && a.childNodes && !/(script|style)/i.test(a.tagName) && ("highlight" !== a.className || "SPAN" !== a.tagName)) for (var j = 0;
4853 j < a.childNodes.length; ++j) j += d(a.childNodes[j]);
4854                        return b;
4855                    };
4856                return a.each(function () {
4857                    d(this);
4858                });
4859            }
4860        };
4861        a.fn.removeHighlight = function () {
4862            return this.find("span.highlight")
4863                .each(function () {
4864                    this.parentNode.firstChild.nodeName;
4865                    var a = this.parentNode;
4866                    a.replaceChild(this.firstChild, this), a.normalize();
4867                })
4868                .end();
4869        };
4870        var e = function () {};
4871        (e.prototype = {
4872            on: function (a, b) {
4873                (this._events = this._events || {}), (this._events[a] = this._events[a] || []), this._events[a].push(b);
4874            },
4875            off: function (a, b) {
4876                var c = arguments.length;
4877                return 0 === c ? delete this._events : 1 === c ? delete this._events[a] : ((this._events = this._events || {}), void (a in this._events != !1 && this._events[a].splice(this._events[a].indexOf(b), 1)));
4878            },
4879            trigger: function (a) {
4880                if (((this._events = this._events || {}), a in this._events != !1)) for (var b = 0; b < this._events[a].length; b++) this._events[a][b].apply(this, Array.prototype.slice.call(arguments, 1));
4881            },
4882        }),
4883            (e.mixin = function (a) {
4884                for (var b = ["on", "off", "trigger"], c = 0; c < b.length; c++) a.prototype[b[c]] = e.prototype[b[c]];
4885            });
4886        var f = /Mac/.test(navigator.userAgent),
4887            g = f ? 91 : 17,
4888            h = f ? 18 : 17,
4889            i = !/android/i.test(window.navigator.userAgent) && !!document.createElement("input").validity,
4890            j = function (a) {
4891                return void 0 !== a;
4892            },
4893            k = function (a) {
4894                return void 0 === a || null === a ? null : "boolean" == typeof a ? (a ? "1" : "0") : a + "";
4895            },
4896            l = function (a) {
4897                return (a + "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
4898            },
4899            m = {};
4900        (m.before = function (a, b, c) {
4901            var d = a[b];
4902            a[b] = function () {
4903                return c.apply(a, arguments), d.apply(a, arguments);
4904            };
4905        }),
4906            (m.after = function (a, b, c) {
4907                var d = a[b];
4908                a[b] = function () {
4909                    var b = d.apply(a, arguments);
4910                    return c.apply(a, arguments), b;
4911                };
4912            });
4913        var n = function (a) {
4914                var b = !1;
4915                return function () {
4916                    b || ((b = !0), a.apply(this, arguments));
4917                };
4918            },
4919            o = function (a, b) {
4920                var c;
4921                return function () {
4922                    var d = this,
4923                        e = arguments;
4924                    window.clearTimeout(c),
4925                        (c = window.setTimeout(function () {
4926                            a.apply(d, e);
4927                        }, b));
4928                };
4929            },
4930            p = function (a, b, c) {
4931                var d,
4932                    e = a.trigger,
4933                    f = {};
4934                (a.trigger = function () {
4935                    var c = arguments[0];
4936                    if (-1 === b.indexOf(c)) return e.apply(a, arguments);
4937                    f[c] = arguments;
4938                }),
4939                    c.apply(a, []),
4940                    (a.trigger = e);
4941                for (d in f) f.hasOwnProperty(d) && e.apply(a, f[d]);
4942            },
4943            q = function (a, b, c, d) {
4944                a.on(b, c, function (b) {
4945                    for (var c = b.target; c && c.parentNode !== a[0]; ) c = c.parentNode;
4946                    return (b.currentTarget = c), d.apply(this, [b]);
4947                });
4948            },
4949            r = function (a) {
4950                var b = {};
4951                if ("selectionStart" in a) (b.start = a.selectionStart), (b.length = a.selectionEnd - b.start);
4952                else if (document.selection) {
4953                    a.focus();
4954                    var c = document.selection.createRange(),
4955                        d = document.selection.createRange().text.length;
4956                    c.moveStart("character", -a.value.length), (b.start = c.text.length - d), (b.length = d);
4957                }
4958                return b;
4959            },
4960            s = function (a, b, c) {
4961                var d,
4962                    e,
4963                    f = {};
4964                if (c) for (d = 0, e = c.length; d < e; d++) f[c[d]] = a.css(c[d]);
4965                else f = a.css();
4966                b.css(f);
4967            },
4968            t = function (b, c) {
4969                return b
4970                    ? (w.$testInput || (w.$testInput = a("<span />").css({ position: "absolute", top: -99999, left: -99999, width: "auto", padding: 0, whiteSpace: "pre" }).appendTo("body")),
4971                      w.$testInput.text(b),
4972                      s(c, w.$testInput, ["letterSpacing", "fontSize", "fontFamily", "fontWeight", "textTransform"]),
4973                      w.$testInput.width())
4974                    : 0;
4975            },
4976            u = function (a) {
4977                var b = null,
4978                    c = function (c, d) {
4979                        var e, f, g, h, i, j, k, l;
4980                        (c = c || window.event || {}),
4981                            (d = d || {}),
4982                            c.metaKey ||
4983                                c.altKey ||
4984                                ((d.force || !1 !== a.data("grow")) &&
4985                                    ((e = a.val()),
4986                                    c.type &&
4987                                        "keydown" === c.type.toLowerCase() &&
4988                                        ((f = c.keyCode),
4989                                        (g = (f >= 48 && f <= 57) || (f >= 65 && f <= 90) || (f >= 96 && f <= 111) || (f >= 186 && f <= 222) || 32 === f),
4990                                        46 === f || 8 === f
4991                                            ? ((l = r(a[0])),
4992                                              l.length
4993                                                  ? (e = e.substring(0, l.start) + e.substring(l.start + l.length))
4994                                                  : 8 === f && l.start
4995                                                  ? (e = e.substring(0, l.start - 1) + e.substring(l.start + 1))
4996                                                  : 46 === f && void 0 !== l.start && (e = e.substring(0, l.start) + e.substring(l.start + 1)))
4997                                            : g && ((j = c.shiftKey), (k = String.fromCharCode(c.keyCode)), (k = j ? k.toUpperCase() : k.toLowerCase()), (e += k))),
4998                                    (h = a.attr("placeholder")),
4999                                    !e && h && (e = h),
5000                                    (i = t(e, a) + 4) !== b && ((b = i), a.width(i), a.triggerHandler("resize"))));
5001                    };
5002                a.on("keydown keyup update blur", c), c();
5003            },
5004            v = function (a) {
5005                var b = document.createElement("div");
5006                return b.appendChild(a.cloneNode(!0)), b.innerHTML;
5007            },
5008            w = function (c, d) {
5009                var e,
5010                    f,
5011                    g,
5012                    h,
5013                    i = this;
5014                (h = c[0]), (h.selectize = i);
5015                var j = window.getComputedStyle && window.getComputedStyle(h, null);
5016                if (
5017                    ((g = j ? j.getPropertyValue("direction") : h.currentStyle && h.currentStyle.direction),
5018                    (g = g || c.parents("[dir]:first").attr("dir") || ""),
5019                    a.extend(i, {
5020                        order: 0,
5021                        settings: d,
5022                        $input: c,
5023                        tabIndex: c.attr("tabindex") || "",
5024                        tagType: "select" === h.tagName.toLowerCase() ? 1 : 2,
5025                        rtl: /rtl/i.test(g),
5026                        eventNS: ".selectize" + ++w.count,
5027                        highlightedValue: null,
5028                        isBlurring: !1,
5029                        isOpen: !1,
5030                        isDisabled: !1,
5031                        isRequired: c.is("[required]"),
5032                        isInvalid: !1,
5033                        isLocked: !1,
5034                        isFocused: !1,
5035                        isInputHidden: !1,
5036                        isSetup: !1,
5037                        isShiftDown: !1,
5038                        isCmdDown: !1,
5039                        isCtrlDown: !1,
5040                        ignoreFocus: !1,
5041                        ignoreBlur: !1,
5042                        ignoreHover: !1,
5043                        hasOptions: !1,
5044                        currentResults: null,
5045                        lastValue: "",
5046                        caretPos: 0,
5047                        loading: 0,
5048                        loadedSearches: {},
5049                        $activeOption: null,
5050                        $activeItems: [],
5051                        optgroups: {},
5052                        options: {},
5053                        userOptions: {},
5054                        items: [],
5055                        renderCache: {},
5056                        onSearchChange: null === d.loadThrottle ? i.onSearchChange : o(i.onSearchChange, d.loadThrottle),
5057                    }),
5058                    (i.sifter = new b(this.options, { diacritics: d.diacritics })),
5059                    i.settings.options)
5060                ) {
5061                    for (e = 0, f = i.settings.options.length; e < f; e++) i.registerOption(i.settings.options[e]);
5062                    delete i.settings.options;
5063                }
5064                if (i.settings.optgroups) {
5065                    for (e = 0, f = i.settings.optgroups.length; e < f; e++) i.registerOptionGroup(i.settings.optgroups[e]);
5066                    delete i.settings.optgroups;
5067                }
5068                (i.settings.mode = i.settings.mode || (1 === i.settings.maxItems ? "single" : "multi")),
5069                    "boolean" != typeof i.settings.hideSelected && (i.settings.hideSelected = "multi" === i.settings.mode),
5070                    i.initializePlugins(i.settings.plugins),
5071                    i.setupCallbacks(),
5072                    i.setupTemplates(),
5073                    i.setup();
5074            };
5075        return (
5076            e.mixin(w),
5077            void 0 !== c
5078                ? c.mixin(w)
5079                : (function (a, b) {
5080                      b || (b = {});
5081                      console.error("Selectize: " + a), b.explanation && (console.group && console.group(), console.error(b.explanation), console.group && console.groupEnd());
5082                  })("Dependency MicroPlugin is missing", { explanation: 'Make sure you either: (1) are using the "standalone" version of Selectize, or (2) require MicroPlugin before you load Selectize.' }),
5083            a.extend(w.prototype, {
5084                setup: function () {
5085                    var b,
5086                        c,
5087                        d,
5088                        e,
5089                        j,
5090                        k,
5091                        l,
5092                        m,
5093                        n,
5094                        o,
5095                        p = this,
5096                        r = p.settings,
5097                        s = p.eventNS,
5098                        t = a(window),
5099                        v = a(document),
5100                        w = p.$input;
5101                    if (
5102                        ((l = p.settings.mode),
5103                        (m = w.attr("class") || ""),
5104                        (b = a("<div>").addClass(r.wrapperClass).addClass(m).addClass(l)),
5105                        (c = a("<div>").addClass(r.inputClass).addClass("items").appendTo(b)),
5106                        (d = a('<input type="text" autocomplete="off" />')
5107                            .appendTo(c)
5108                            .attr("tabindex", w.is(":disabled") ? "-1" : p.tabIndex)),
5109                        (k = a(r.dropdownParent || b)),
5110                        (e = a("<div>").addClass(r.dropdownClass).addClass(l).hide().appendTo(k)),
5111                        (j = a("<div>").addClass(r.dropdownContentClass).appendTo(e)),
5112                        (o = w.attr("id")) && (d.attr("id", o + "-selectized"), a("label[for='" + o + "']").attr("for", o + "-selectized")),
5113                        p.settings.copyClassesToDropdown && e.addClass(m),
5114                        b.css({ width: w[0].style.width }),
5115                        p.plugins.names.length && ((n = "plugin-" + p.plugins.names.join(" plugin-")), b.addClass(n), e.addClass(n)),
5116                        (null === r.maxItems || r.maxItems > 1) && 1 === p.tagType && w.attr("multiple", "multiple"),
5117                        p.settings.placeholder && d.attr("placeholder", r.placeholder),
5118                        !p.settings.splitOn && p.settings.delimiter)
5119                    ) {
5120                        var x = p.settings.delimiter.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
5121                        p.settings.splitOn = new RegExp("\\s*" + x + "+\\s*");
5122                    }
5123                    w.attr("autocorrect") && d.attr("autocorrect", w.attr("autocorrect")),
5124                        w.attr("autocapitalize") && d.attr("autocapitalize", w.attr("autocapitalize")),
5125                        (d[0].type = w[0].type),
5126                        (p.$wrapper = b),
5127                        (p.$control = c),
5128                        (p.$control_input = d),
5129                        (p.$dropdown = e),
5130                        (p.$dropdown_content = j),
5131                        e.on("mouseenter mousedown click", "[data-disabled]>[data-selectable]", function (a) {
5132                            a.stopImmediatePropagation();
5133                        }),
5134                        e.on("mouseenter", "[data-selectable]", function () {
5135                            return p.onOptionHover.apply(p, arguments);
5136                        }),
5137                        e.on("mousedown click", "[data-selectable]", function () {
5138                            return p.onOptionSelect.apply(p, arguments);
5139                        }),
5140                        q(c, "mousedown", "*:not(input)", function () {
5141                            return p.onItemSelect.apply(p, arguments);
5142                        }),
5143                        u(d),
5144                        c.on({
5145                            mousedown: function () {
5146                                return p.onMouseDown.apply(p, arguments);
5147                            },
5148                            click: function () {
5149                                return p.onClick.apply(p, arguments);
5150                            },
5151                        }),
5152                        d.on({
5153                            mousedown: function (a) {
5154                                a.stopPropagation();
5155                            },
5156                            keydown: function () {
5157                                return p.onKeyDown.apply(p, arguments);
5158                            },
5159                            keyup: function () {
5160                                return p.onKeyUp.apply(p, arguments);
5161                            },
5162                            keypress: function () {
5163                                return p.onKeyPress.apply(p, arguments);
5164                            },
5165                            resize: function () {
5166                                p.positionDropdown.apply(p, []);
5167                            },
5168                            blur: function () {
5169                                return p.onBlur.apply(p, arguments);
5170                            },
5171                            focus: function () {
5172                                return (p.ignoreBlur = !1), p.onFocus.apply(p, arguments);
5173                            },
5174                            paste: function () {
5175                                return p.onPaste.apply(p, arguments);
5176                            },
5177                        }),
5178                        v.on("keydown" + s, function (a) {
5179                            (p.isCmdDown = a[f ? "metaKey" : "ctrlKey"]), (p.isCtrlDown = a[f ? "altKey" : "ctrlKey"]), (p.isShiftDown = a.shiftKey);
5180                        }),
5181                        v.on("keyup" + s, function (a) {
5182                            a.keyCode === h && (p.isCtrlDown = !1), 16 === a.keyCode && (p.isShiftDown = !1), a.keyCode === g && (p.isCmdDown = !1);
5183                        }),
5184                        v.on("mousedown" + s, function (a) {
5185                            if (p.isFocused) {
5186                                if (a.target === p.$dropdown[0] || a.target.parentNode === p.$dropdown[0]) return !1;
5187                                p.$control.has(a.target).length || a.target === p.$control[0] || p.blur(a.target);
5188                            }
5189                        }),
5190                        t.on(["scroll" + s, "resize" + s].join(" "), function () {
5191                            p.isOpen && p.positionDropdown.apply(p, arguments);
5192                        }),
5193                        t.on("mousemove" + s, function () {
5194                            p.ignoreHover = !1;
5195                        }),
5196                        (this.revertSettings = { $children: w.children().detach(), tabindex: w.attr("tabindex") }),
5197                        w.attr("tabindex", -1).hide().after(p.$wrapper),
5198                        a.isArray(r.items) && (p.setValue(r.items), delete r.items),
5199                        i &&
5200                            w.on("invalid" + s, function (a) {
5201                                a.preventDefault(), (p.isInvalid = !0), p.refreshState();
5202                            }),
5203                        p.updateOriginalInput(),
5204                        p.refreshItems(),
5205                        p.refreshState(),
5206                        p.updatePlaceholder(),
5207                        (p.isSetup = !0),
5208                        w.is(":disabled") && p.disable(),
5209                        p.on("change", this.onChange),
5210                        w.data("selectize", p),
5211                        w.addClass("selectized"),
5212                        p.trigger("initialize"),
5213                        !0 === r.preload && p.onSearchChange("");
5214                },
5215                setupTemplates: function () {
5216                    var b = this,
5217                        c = b.settings.labelField,
5218                        d = b.settings.optgroupLabelField,
5219                        e = {
5220                            optgroup: function (a) {
5221                                return '<div class="optgroup">' + a.html + "</div>";
5222                            },
5223                            optgroup_header: function (a, b) {
5224                                return '<div class="optgroup-header">' + b(a[d]) + "</div>";
5225                            },
5226                            option: function (a, b) {
5227                                return '<div class="option">' + b(a[c]) + "</div>";
5228                            },
5229                            item: function (a, b) {
5230                                return '<div class="item">' + b(a[c]) + "</div>";
5231                            },
5232                            option_create: function (a, b) {
5233                                return '<div class="create">Add <strong>' + b(a.input) + "</strong>&hellip;</div>";
5234                            },
5235                        };
5236                    b.settings.render = a.extend({}, e, b.settings.render);
5237                },
5238                setupCallbacks: function () {
5239                    var a,
5240                        b,
5241                        c = {
5242                            initialize: "onInitialize",
5243                            change: "onChange",
5244                            item_add: "onItemAdd",
5245                            item_remove: "onItemRemove",
5246                            clear: "onClear",
5247                            option_add: "onOptionAdd",
5248                            option_remove: "onOptionRemove",
5249                            option_clear: "onOptionClear",
5250                            optgroup_add: "onOptionGroupAdd",
5251                            optgroup_remove: "onOptionGroupRemove",
5252                            optgroup_clear: "onOptionGroupClear",
5253                            dropdown_open: "onDropdownOpen",
5254                            dropdown_close: "onDropdownClose",
5255                            type: "onType",
5256                            load: "onLoad",
5257                            focus: "onFocus",
5258                            blur: "onBlur",
5259                        };
5260                    for (a in c) c.hasOwnProperty(a) && (b = this.settings[c[a]]) && this.on(a, b);
5261                },
5262                onClick: function (a) {
5263                    var b = this;
5264                    (b.isFocused && b.isOpen) || (b.focus(), a.preventDefault());
5265                },
5266                onMouseDown: function (b) {
5267                    var c = this,
5268                        d = b.isDefaultPrevented();
5269                    a(b.target);
5270                    if (c.isFocused) {
5271                        if (b.target !== c.$control_input[0]) return "single" === c.settings.mode ? (c.isOpen ? c.close() : c.open()) : d || c.setActiveItem(null), !1;
5272                    } else
5273                        d ||
5274                            window.setTimeout(function () {
5275                                c.focus();
5276                            }, 0);
5277                },
5278                onChange: function () {
5279                    this.$input.trigger("change");
5280                },
5281                onPaste: function (b) {
5282                    var c = this;
5283                    if (c.isFull() || c.isInputHidden || c.isLocked) return void b.preventDefault();
5284                    c.settings.splitOn &&
5285                        setTimeout(function () {
5286                            var b = c.$control_input.val();
5287                            if (b.match(c.settings.splitOn)) for (var d = a.trim(b).split(c.settings.splitOn), e = 0, f = d.length; e < f; e++) c.createItem(d[e]);
5288                        }, 0);
5289                },
5290                onKeyPress: function (a) {
5291                    if (this.isLocked) return a && a.preventDefault();
5292                    var b = String.fromCharCode(a.keyCode || a.which);
5293                    return this.settings.create && "multi" === this.settings.mode && b === this.settings.delimiter ? (this.createItem(), a.preventDefault(), !1) : void 0;
5294                },
5295                onKeyDown: function (a) {
5296                    var b = (a.target, this.$control_input[0], this);
5297                    if (b.isLocked) return void (9 !== a.keyCode && a.preventDefault());
5298                    switch (a.keyCode) {
5299                        case 65:
5300                            if (b.isCmdDown) return void b.selectAll();
5301                            break;
5302                        case 27:
5303                            return void (b.isOpen && (a.preventDefault(), a.stopPropagation(), b.close()));
5304                        case 78:
5305                            if (!a.ctrlKey || a.altKey) break;
5306                        case 40:
5307                            if (!b.isOpen && b.hasOptions) b.open();
5308                            else if (b.$activeOption) {
5309                                b.ignoreHover = !0;
5310                                var c = b.getAdjacentOption(b.$activeOption, 1);
5311                                c.length && b.setActiveOption(c, !0, !0);
5312                            }
5313                            return void a.preventDefault();
5314                        case 80:
5315                            if (!a.ctrlKey || a.altKey) break;
5316                        case 38:
5317                            if (b.$activeOption) {
5318                                b.ignoreHover = !0;
5319                                var d = b.getAdjacentOption(b.$activeOption, -1);
5320                                d.length && b.setActiveOption(d, !0, !0);
5321                            }
5322                            return void a.preventDefault();
5323                        case 13:
5324                            return void (b.isOpen && b.$activeOption && (b.onOptionSelect({ currentTarget: b.$activeOption }), a.preventDefault()));
5325                        case 37:
5326                            return void b.advanceSelection(-1, a);
5327                        case 39:
5328                            return void b.advanceSelection(1, a);
5329                        case 9:
5330                            return (
5331                                b.settings.selectOnTab && b.isOpen && b.$activeOption && (b.onOptionSelect({ currentTarget: b.$activeOption }), b.isFull() || a.preventDefault()),
5332                                void (b.settings.create && b.createItem() && a.preventDefault())
5333                            );
5334                        case 8:
5335                        case 46:
5336                            return void b.deleteSelection(a);
5337                    }
5338                    return (!b.isFull() && !b.isInputHidden) || (f ? a.metaKey : a.ctrlKey) ? void 0 : void a.preventDefault();
5339                },
5340                onKeyUp: function (a) {
5341                    var b = this;
5342                    if (b.isLocked) return a && a.preventDefault();
5343                    var c = b.$control_input.val() || "";
5344                    b.lastValue !== c && ((b.lastValue = c), b.onSearchChange(c), b.refreshOptions(), b.trigger("type", c));
5345                },
5346                onSearchChange: function (a) {
5347                    var b = this,
5348                        c = b.settings.load;
5349                    c &&
5350                        (b.loadedSearches.hasOwnProperty(a) ||
5351                            ((b.loadedSearches[a] = !0),
5352                            b.load(function (d) {
5353                                c.apply(b, [a, d]);
5354                            })));
5355                },
5356                onFocus: function (a) {
5357                    var b = this,
5358                        c = b.isFocused;
5359                    if (b.isDisabled) return b.blur(), a && a.preventDefault(), !1;
5360                    b.ignoreFocus ||
5361                        ((b.isFocused = !0),
5362                        "focus" === b.settings.preload && b.onSearchChange(""),
5363                        c || b.trigger("focus"),
5364                        b.$activeItems.length || (b.showInput(), b.setActiveItem(null), b.refreshOptions(!!b.settings.openOnFocus)),
5365                        b.refreshState());
5366                },
5367                onBlur: function (a, b) {
5368                    var c = this;
5369                    if (c.isFocused && ((c.isFocused = !1), !c.ignoreFocus)) {
5370                        if (!c.ignoreBlur && document.activeElement === c.$dropdown_content[0]) return (c.ignoreBlur = !0), void c.onFocus(a);
5371                        var d = function () {
5372                            c.close(),
5373                                c.setTextboxValue(""),
5374                                c.setActiveItem(null),
5375                                c.setActiveOption(null),
5376                                c.setCaret(c.items.length),
5377                                c.refreshState(),
5378                                b && b.focus && b.focus(),
5379                                (c.isBlurring = !1),
5380                                (c.ignoreFocus = !1),
5381                                c.trigger("blur");
5382                        };
5383                        (c.isBlurring = !0), (c.ignoreFocus = !0), c.settings.create && c.settings.createOnBlur ? c.createItem(null, !1, d) : d();
5384                    }
5385                },
5386                onOptionHover: function (a) {
5387                    this.ignoreHover || this.setActiveOption(a.currentTarget, !1);
5388                },
5389                onOptionSelect: function (b) {
5390                    var c,
5391                        d,
5392                        e = this;
5393                    b.preventDefault && (b.preventDefault(), b.stopPropagation()),
5394                        (d = a(b.currentTarget)),
5395                        d.hasClass("create")
5396                            ? e.createItem(null, function () {
5397                                  e.settings.closeAfterSelect && e.close();
5398                              })
5399                            : void 0 !== (c = d.attr("data-value")) &&
5400                              ((e.lastQuery = null), e.setTextboxValue(""), e.addItem(c), e.settings.closeAfterSelect ? e.close() : !e.settings.hideSelected && b.type && /mouse/.test(b.type) && e.setActiveOption(e.getOption(c)));
5401                },
5402                onItemSelect: function (a) {
5403                    var b = this;
5404                    b.isLocked || ("multi" === b.settings.mode && (a.preventDefault(), b.setActiveItem(a.currentTarget, a)));
5405                },
5406                load: function (a) {
5407                    var b = this,
5408                        c = b.$wrapper.addClass(b.settings.loadingClass);
5409                    b.loading++,
5410                        a.apply(b, [
5411                            function (a) {
5412                                (b.loading = Math.max(b.loading - 1, 0)), a && a.length && (b.addOption(a), b.refreshOptions(b.isFocused && !b.isInputHidden)), b.loading || c.removeClass(b.settings.loadingClass), b.trigger("load", a);
5413                            },
5414                        ]);
5415                },
5416                setTextboxValue: function (a) {
5417                    var b = this.$control_input;
5418                    b.val() !== a && (b.val(a).triggerHandler("update"), (this.lastValue = a));
5419                },
5420                getValue: function () {
5421                    return 1 === this.tagType && this.$input.attr("multiple") ? this.items : this.items.join(this.settings.delimiter);
5422                },
5423                setValue: function (a, b) {
5424                    p(this, b ? [] : ["change"], function () {
5425                        this.clear(b), this.addItems(a, b);
5426                    });
5427                },
5428                setActiveItem: function (b, c) {
5429                    var d,
5430                        e,
5431                        f,
5432                        g,
5433                        h,
5434                        i,
5435                        j,
5436                        k,
5437                        l = this;
5438                    if ("single" !== l.settings.mode) {
5439                        if (((b = a(b)), !b.length)) return a(l.$activeItems).removeClass("active"), (l.$activeItems = []), void (l.isFocused && l.showInput());
5440                        if ("mousedown" === (d = c && c.type.toLowerCase()) && l.isShiftDown && l.$activeItems.length) {
5441                            for (
5442                                k = l.$control.children(".active:last"),
5443                                    g = Array.prototype.indexOf.apply(l.$control[0].childNodes, [k[0]]),
5444                                    h = Array.prototype.indexOf.apply(l.$control[0].childNodes, [b[0]]),
5445                                    g > h && ((j = g), (g = h), (h = j)),
5446                                    e = g;
5447                                e <= h;
5448                                e++
5449                            )
5450                                (i = l.$control[0].childNodes[e]), -1 === l.$activeItems.indexOf(i) && (a(i).addClass("active"), l.$activeItems.push(i));
5451                            c.preventDefault();
5452                        } else
5453                            ("mousedown" === d && l.isCtrlDown) || ("keydown" === d && this.isShiftDown)
5454                                ? b.hasClass("active")
5455                                    ? ((f = l.$activeItems.indexOf(b[0])), l.$activeItems.splice(f, 1), b.removeClass("active"))
5456                                    : l.$activeItems.push(b.addClass("active")[0])
5457                                : (a(l.$activeItems).removeClass("active"), (l.$activeItems = [b.addClass("active")[0]]));
5458                        l.hideInput(), this.isFocused || l.focus();
5459                    }
5460                },
5461                setActiveOption: function (b, c, d) {
5462                    var e,
5463                        f,
5464                        g,
5465                        h,
5466                        i,
5467                        k = this;
5468                    k.$activeOption && k.$activeOption.removeClass("active"),
5469                        (k.$activeOption = null),
5470                        (b = a(b)),
5471                        b.length &&
5472                            ((k.$activeOption = b.addClass("active")),
5473                            (!c && j(c)) ||
5474                                ((e = k.$dropdown_content.height()),
5475                                (f = k.$activeOption.outerHeight(!0)),
5476                                (c = k.$dropdown_content.scrollTop() || 0),
5477                                (g = k.$activeOption.offset().top - k.$dropdown_content.offset().top + c),
5478                                (h = g),
5479                                (i = g - e + f),
5480                                g + f > e + c ? k.$dropdown_content.stop().animate({ scrollTop: i }, d ? k.settings.scrollDuration : 0) : g < c && k.$dropdown_content.stop().animate({ scrollTop: h }, d ? k.settings.scrollDuration : 0)));
5481                },
5482                selectAll: function () {
5483                    var a = this;
5484                    "single" !== a.settings.mode && ((a.$activeItems = Array.prototype.slice.apply(a.$control.children(":not(input)").addClass("active"))), a.$activeItems.length && (a.hideInput(), a.close()), a.focus());
5485                },
5486                hideInput: function () {
5487                    var a = this;
5488                    a.setTextboxValue(""), a.$control_input.css({ opacity: 0, position: "absolute", left: a.rtl ? 1e4 : -1e4 }), (a.isInputHidden = !0);
5489                },
5490                showInput: function () {
5491                    this.$control_input.css({ opacity: 1, position: "relative", left: 0 }), (this.isInputHidden = !1);
5492                },
5493                focus: function () {
5494                    var a = this;
5495                    a.isDisabled ||
5496                        ((a.ignoreFocus = !0),
5497                        a.$control_input[0].focus(),
5498                        window.setTimeout(function () {
5499                            (a.ignoreFocus = !1), a.onFocus();
5500                        }, 0));
5501                },
5502                blur: function (a) {
5503                    this.$control_input[0].blur(), this.onBlur(null, a);
5504                },
5505                getScoreFunction: function (a) {
5506                    return this.sifter.getScoreFunction(a, this.get
5506SearchOptions());
5507                },
5508                getSearchOptions: function () {
5509                    var a = this.settings,
5510                        b = a.sortField;
5511                    return "string" == typeof b && (b = [{ field: b }]), { fields: a.searchField, conjunction: a.searchConjunction, sort: b, nesting: a.nesting };
5512                },
5513                search: function (b) {
5514                    var c,
5515                        d,
5516                        e,
5517                        f = this,
5518                        g = f.settings,
5519                        h = this.getSearchOptions();
5520                    if (g.score && "function" != typeof (e = f.settings.score.apply(this, [b]))) throw new Error('Selectize "score" setting must be a function that returns a function');
5521                    if ((b !== f.lastQuery ? ((f.lastQuery = b), (d = f.sifter.search(b, a.extend(h, { score: e }))), (f.currentResults = d)) : (d = a.extend(!0, {}, f.currentResults)), g.hideSelected))
5522                        for (c = d.items.length - 1; c >= 0; c--) -1 !== f.items.indexOf(k(d.items[c].id)) && d.items.splice(c, 1);
5523                    return d;
5524                },
5525                refreshOptions: function (b) {
5526                    var c, e, f, g, h, i, j, l, m, n, o, p, q, r, s, t;
5527                    void 0 === b && (b = !0);
5528                    var u = this,
5529                        w = a.trim(u.$control_input.val()),
5530                        x = u.search(w),
5531                        y = u.$dropdown_content,
5532                        z = u.$activeOption && k(u.$activeOption.attr("data-value"));
5533                    for (g = x.items.length, "number" == typeof u.settings.maxOptions && (g = Math.min(g, u.settings.maxOptions)), h = {}, i = [], c = 0; c < g; c++)
5534                        for (j = u.options[x.items[c].id], l = u.render("option", j), m = j[u.settings.optgroupField] || "", n = a.isArray(m) ? m : [m], e = 0, f = n && n.length; e < f; e++)
5535                            (m = n[e]), u.optgroups.hasOwnProperty(m) || (m = ""), h.hasOwnProperty(m) || ((h[m] = document.createDocumentFragment()), i.push(m)), h[m].appendChild(l);
5536                    for (
5537                        this.settings.lockOptgroupOrder &&
5538                            i.sort(function (a, b) {
5539                                return (u.optgroups[a].$order || 0) - (u.optgroups[b].$order || 0);
5540                            }),
5541                            o = document.createDocumentFragment(),
5542                            c = 0,
5543                            g = i.length;
5544                        c < g;
5545                        c++
5546                    )
5547                        (m = i[c]),
5548                            u.optgroups.hasOwnProperty(m) && h[m].childNodes.length
5549                                ? ((p = document.createDocumentFragment()),
5550                                  p.appendChild(u.render("optgroup_header", u.optgroups[m])),
5551                                  p.appendChild(h[m]),
5552                                  o.appendChild(u.render("optgroup", a.extend({}, u.optgroups[m], { html: v(p), dom: p }))))
5553                                : o.appendChild(h[m]);
5554                    if ((y.html(o), u.settings.highlight && (y.removeHighlight(), x.query.length && x.tokens.length))) for (c = 0, g = x.tokens.length; c < g; c++) d(y, x.tokens[c].regex);
5555                    if (!u.settings.hideSelected) for (c = 0, g = u.items.length; c < g; c++) u.getOption(u.items[c]).addClass("selected");
5556                    (q = u.canCreate(w)),
5557                        q && (y.prepend(u.render("option_create", { input: w })), (t = a(y[0].childNodes[0]))),
5558                        (u.hasOptions = x.items.length > 0 || q),
5559                        u.hasOptions
5560                            ? (x.items.length > 0
5561                                  ? ((s = z && u.getOption(z)),
5562                                    s && s.length ? (r = s) : "single" === u.settings.mode && u.items.length && (r = u.getOption(u.items[0])),
5563                                    (r && r.length) || (r = t && !u.settings.addPrecedence ? u.getAdjacentOption(t, 1) : y.find("[data-selectable]:first")))
5564                                  : (r = t),
5565                              u.setActiveOption(r),
5566                              b && !u.isOpen && u.open())
5567                            : (u.setActiveOption(null), b && u.isOpen && u.close());
5568                },
5569                addOption: function (b) {
5570                    var c,
5571                        d,
5572                        e,
5573                        f = this;
5574                    if (a.isArray(b)) for (c = 0, d = b.length; c < d; c++) f.addOption(b[c]);
5575                    else (e = f.registerOption(b)) && ((f.userOptions[e] = !0), (f.lastQuery = null), f.trigger("option_add", e, b));
5576                },
5577                registerOption: function (a) {
5578                    var b = k(a[this.settings.valueField]);
5579                    return void 0 !== b && null !== b && !this.options.hasOwnProperty(b) && ((a.$order = a.$order || ++this.order), (this.options[b] = a), b);
5580                },
5581                registerOptionGroup: function (a) {
5582                    var b = k(a[this.settings.optgroupValueField]);
5583                    return !!b && ((a.$order = a.$order || ++this.order), (this.optgroups[b] = a), b);
5584                },
5585                addOptionGroup: function (a, b) {
5586                    (b[this.settings.optgroupValueField] = a), (a = this.registerOptionGroup(b)) && this.trigger("optgroup_add", a, b);
5587                },
5588                removeOptionGroup: function (a) {
5589                    this.optgroups.hasOwnProperty(a) && (delete this.optgroups[a], (this.renderCache = {}), this.trigger("optgroup_remove", a));
5590                },
5591                clearOptionGroups: function () {
5592                    (this.optgroups = {}), (this.renderCache = {}), this.trigger("optgroup_clear");
5593                },
5594                updateOption: function (b, c) {
5595                    var d,
5596                        e,
5597                        f,
5598                        g,
5599                        h,
5600                        i,
5601                        j,
5602                        l = this;
5603                    if (((b = k(b)), (f = k(c[l.settings.valueField])), null !== b && l.o
5603ptions.hasOwnProperty(b))) {
5604                        if ("string" != typeof f) throw new Error("Value must be set in option data");
5605                        (j = l.options[b].$order),
5606                            f !== b && (delete l.options[b], -1 !== (g = l.items.indexOf(b)) && l.items.splice(g, 1, f)),
5607                            (c.$order = c.$order || j),
5608                            (l.options[f] = c),
5609                            (h = l.renderCache.item),
5610                            (i = l.renderCache.option),
5611                            h && (delete h[b], delete h[f]),
5612                            i && (delete i[b], delete i[f]),
5613                            -1 !== l.items.indexOf(f) && ((d = l.getItem(b)), (e = a(l.render("item", c))), d.hasClass("active") && e.addClass("active"), d.replaceWith(e)),
5614                            (l.lastQuery = null),
5615                            l.isOpen && l.refreshOptions(!1);
5616                    }
5617                },
5618                removeOption: function (a, b) {
5619                    var c = this;
5620                    a = k(a);
5621                    var d = c.renderCache.item,
5622                        e = c.renderCache.option;
5623                    d && delete d[a], e && delete e[a], delete c.userOptions[a], delete c.options[a], (c.lastQuery = null), c.trigger("option_remove", a), c.removeItem(a, b);
5624                },
5625                clearOptions: function () {
5626                    var b = this;
5627                    (b.loadedSearches = {}), (b.userOptions = {}), (b.renderCache = {});
5628                    var c = b.options;
5629                    a.each(b.options, function (a, d) {
5630                        -1 == b.items.indexOf(a) && delete c[a];
5631                    }),
5632                        (b.options = b.sifter.items = c),
5633                        (b.lastQuery = null),
5634                        b.trigger("option_clear");
5635                },
5636                getOption: function (a) {
5637                    return this.getElementWithValue(a, this.$dropdown_content.find("[data-selectable]"));
5638                },
5639                getAdjacentOption: function (b, c) {
5640                    var d = this.$dropdown.find("[data-selectable]"),
5641                        e = d.index(b) + c;
5642                    return e >= 0 && e < d.length ? d.eq(e) : a();
5643                },
5644                getElementWithValue: function (b, c) {
5645                    if (void 0 !== (b = k(b)) && null !== b) for (var d = 0, e = c.length; d < e; d++) if (c[d].getAttribute("data-value") === b) return a(c[d]);
5646                    return a();
5647                },
5648                getItem: function (a) {
5649                    return this.getElementWithValue(a, this.$control.children());
5650                },
5651                addItems: function (b, c) {
5652                    this.buffer = document.createDocumentFragment();
5653                    for (var d = this.$control[0].childNodes, e = 0; e < d.length; e++) this.buffer.appendChild(d[e]);
5654                    for (var f = a.isArray(b) ? b : [b], e = 0, g = f.length; e < g; e++) (this.isPending = e < g - 1), this.addItem(f[e], c);
5655                    var h = this.$control[0];
5656                    h.insertBefore(this.buffer, h.firstChild), (this.buffer = null);
5657                },
5658                addItem: function (b, c) {
5659                    p(this, c ? [] : ["change"], function () {
5660                        var d,
5661                            e,
5662                            f,
5663                            g,
5664                            h,
5665                            i = this,
5666                            j = i.settings.mode;
5667                        if (((b = k(b)), -1 !== i.items.indexOf(b))) return void ("single" === j && i.close());
5668                        i.options.hasOwnProperty(b) &&
5669                            ("single" === j && i.clear(c),
5670                            ("multi" === j && i.isFull()) ||
5671                                ((d = a(i.render("item", i.options[b]))),
5672                                (h = i.isFull()),
5673                                i.items.splice(i.caretPos, 0, b),
5674                                i.insertAtCaret(d),
5675                                (!i.isPending || (!h && i.isFull())) && i.refreshState(),
5676                                i.isSetup &&
5677                                    ((f = i.$dropdown_content.find("[data-selectable]")),
5678                                    i.isPending || ((e = i.getOption(b)), (g = i.getAdjacentOption(e, 1).attr("data-value")), i.refreshOptions(i.isFocused && "single" !== j), g && i.setActiveOption(i.getOption(g))),
5679                                    !f.length || i.isFull() ? i.close() : i.isPending || i.positionDropdown(),
5680                                    i.updatePlaceholder(),
5681                                    i.trigger("item_add", b, d),
5682                                    i.isPending || i.updateOriginalInput({ silent: c }))));
5683                    });
5684                },
5685                removeItem: function (b, c) {
5686                    var d,
5687                        e,
5688                        f,
5689                        g = this;
5690                    (d = b instanceof a ? b : g.getItem(b)),
5691                        (b = k(d.attr("data-value"))),
5692                        -1 !== (e = g.items.indexOf(b)) &&
5693                            (d.remove(),
5694                            d.hasClass("active") && ((f = g.$activeItems.indexOf(d[0])), g.$activeItems.splice(f, 1)),
5695                            g.items.splice(e, 1),
5696                            (g.lastQuery = null),
5697                            !g.settings.persist && g.userOptions.hasOwnProperty(b) && g.removeOption(b, c),
5698                            e < g.caretPos && g.setCaret(g.caretPos - 1),
5699                            g.refreshState(),
5700                            g.updatePlaceholder(),
5701                            g.updateOriginalInput({ silent: c }),
5702                            g.positionDropdown(),
5703                            g.trigger("item_remove", b, d));
5704                },
5705                createItem: function (b, c) {
5706                    var d = this,
5707                        e = d.caretPos;
5708                    b = b || a.trim(d.$control_input.val() || "");
5709                    var f = arguments[arguments.length - 1];
5710                    if (("function" != typeof f && (f = function () {}), "boolean" != typeof c && (c = !0), !d.canCreate(b))) return f(), !1;
5711                    d.lock();
5712                    var g =
5713                            "function" == typeof d.settings.create
5714                                ? this.settings.create
5715                                : function (a) {
5716                                      var b = {};
5717                                      return (b[d.settings.labelField] = a), (b[d.settings.valueField] = a), b;
5718                                  },
5719                        h = n(function (a) {
5720                            if ((d.unlock(), !a || "object" != typeof a)) return f();
5721                            var b = k(a[d.settings.valueField]);
5722                            if ("string" != typeof b) return f();
5723                            d.setTextboxValue(""), d.addOption(a), d.setCaret(e), d.addItem(b), d.refreshOptions(c && "single" !== d.settings.mode), f(a);
5724                        }),
5725                        i = g.apply(this, [b, h]);
5726                    return void 0 !== i && h(i), !0;
5727                },
5728                refreshItems: function () {
5729                    (this.lastQuery = null), this.isSetup && this.addItem(this.items), this.refreshState(), this.updateOriginalInput();
5730                },
5731                refreshState: function () {
5732                    this.refreshValidityState(), this.refreshClasses();
5733                },
5734                refreshValidityState: function () {
5735                    if (!this.isRequired) return !1;
5736                    var a = !this.items.length;
5737                    (this.isInvalid = a), this.$control_input.prop("required", a), this.$input.prop("required", !a);
5738                },
5739                refreshClasses: function () {
5740                    var b = this,
5741                        c = b.isFull(),
5742                        d = b.isLocked;
5743                    b.$wrapper.toggleClass("rtl", b.rtl),
5744                        b.$control
5745                            .toggleClass("focus", b.isFocused)
5746                            .toggleClass("disabled", b.isDisabled)
5747                            .toggleClass("required", b.isRequired)
5748                            .toggleClass("invalid", b.isInvalid)
5749                            .toggleClass("locked", d)
5750                            .toggleClass("full", c)
5751                            .toggleClass("not-full", !c)
5752                            .toggleClass("input-active", b.isFocused && !b.isInputHidden)
5753                            .toggleClass("dropdown-active", b.isOpen)
5754                            .toggleClass("has-options", !a.isEmptyObject(b.options))
5755                            .toggleClass("has-items", b.items.length > 0),
5756                        b.$control_input.data("grow", !c && !d);
5757                },
5758                isFull: function () {
5759                    return null !== this.settings.maxItems && this.items.length >= this.settings.maxItems;
5760                },
5761                updateOriginalInput: function (a) {
5762                    var b,
5763                        c,
5764                        d,
5765                        e,
5766                        f = this;
5767                    if (((a = a || {}), 1 === f.tagType)) {
5768                        for (d = [], b = 0, c = f.items.length; b < c; b++) (e = f.options[f.items[b]][f.settings.labelField] || ""), d.push('<option value="' + l(f.items[b]) + '" selected="selected">' + l(e) + "</option>");
5769                        d.length || this.$input.attr("multiple") || d.push('<option value="" selected="selected"></option>'), f.$input.html(d.join(""));
5770                    } else f.$input.val(f.getValue()), f.$input.attr("value", f.$input.val());
5771                    f.isSetup && (a.silent || f.trigger("change", f.$input.val()));
5772                },
5773                updatePlaceholder: function () {
5774                    if (this.settings.placeholder) {
5775                        var a = this.$control_input;
5776                        this.items.length ? a.removeAttr("placeholder") : a.attr("placeholder", this.settings.placeholder), a.triggerHandler("update", { force: !0 });
5777                    }
5778                },
5779                open: function () {
5780                    var a = this;
5781                    a.isLocked ||
5782                        a.isOpen ||
5783                        ("multi" === a.settings.mode && a.isFull()) ||
5784                        (a.focus(), (a.isOpen = !0), a.refreshState(), a.$dropdown.css({ visibility: "hidden", display: "block" }), a.positionDropdown(), a.$dropdown.css({ visibility: "visible" }), a.trigger("dropdown_open", a.$dropdown));
5785                },
5786                close: function () {
5787                    var a = this,
5788                        b = a.isOpen;
5789                    "single" === a.settings.mode && a.items.length && (a.hideInput(), a.isBlurring || a.$control_input.blur()),
5790                        (a.isOpen = !1),
5791                        a.$dropdown.hide(),
5792                        a.setActiveOption(null),
5793                        a.refreshState(),
5794                        b && a.trigger("dropdown_close", a.$dropdown);
5795                },
5796                positionDropdown: function () {
5797                    var a = this.$control,
5798                        b = "body" === this.settings.dropdownParent ? a.offset() : a.position();
5799                    (b.top += a.outerHeight(!0)), this.$dropdown.css({ width: a[0].getBoundingClientRect().width, top: b.top, left: b.left });
5800                },
5801                clear: function (a) {
5802                    var b = this;
5803                    b.items.length &&
5804                        (b.$control.children(":not(input)").remove(),
5805                        (b.items = []),
5806                        (b.lastQuery = null),
5807                        b.setCaret(0),
5808                        b.setActiveItem(null),
5809                        b.updatePlaceholder(),
5810                        b.updateOriginalInput({ silent: a }),
5811                        b.refreshState(),
5812                        b.showInput(),
5813                        b.trigger("clear"));
5814                },
5815                insertAtCaret: function (a) {
5816                    var b = Math.min(this.caretPos, this.items.length),
5817                        c = a[0],
5818                        d = this.buffer || this.$control[0];
5819                    0 === b ? d.insertBefore(c, d.firstChild) : d.insertBefore(c, d.childNodes[b]), this.setCaret(b + 1);
5820                },
5821                deleteSelection: function (b) {
5822                    var c,
5823                        d,
5824                        e,
5825                        f,
5826                        g,
5827                        h,
5828                        i,
5829                        j,
5830                        k,
5831                        l = this;
5832                    if (
5833                        ((e = b && 8 === b.keyCode ? -1 : 1), (f = r(l.$control_input[0])), l.$activeOption && !l.settings.hideSelected && (i = l.getAdjacentOption(l.$activeOption, -1).attr("data-value")), (g = []), l.$activeItems.length)
5834                    ) {
5835                        for (k = l.$control.children(".active:" + (e > 0 ? "last" : "first")), h = l.$control.children(":not(input)").index(k), e > 0 && h++, c = 0, d = l.$activeItems.length; c < d; c++)
5836                            g.push(a(l.$activeItems[c]).attr("data-value"));
5837                        b && (b.preventDefault(), b.stopPropagation());
5838                    } else
5839                        (l.isFocused || "single" === l.settings.mode) &&
5840                            l.items.length &&
5841                            (e < 0 && 0 === f.start && 0 === f.length ? g.push(l.items[l.caretPos - 1]) : e > 0 && f.start === l.$control_input.val().length && g.push(l.items[l.caretPos]));
5842                    if (!g.length || ("function" == typeof l.settings.onDelete && !1 === l.settings.onDelete.apply(l, [g]))) return !1;
5843                    for (void 0 !== h && l.setCaret(h); g.length; ) l.removeItem(g.pop());
5844                    return l.showInput(), l.positionDropdown(), l.refreshOptions(!0), i && ((j = l.getOption(i)), j.length && l.setActiveOption(j)), !0;
5845                },
5846                advanceSelection: function (a, b) {
5847                    var c,
5848                        d,
5849                        e,
5850                        f,
5851                        g,
5852                        h = this;
5853                    0 !== a &&
5854                        (h.rtl && (a *= -1),
5855                        (c = a > 0 ? "last" : "first"),
5856                        (d = r(h.$control_input[0])),
5857                        h.isFocused && !h.isInputHidden
5858                            ? ((f = h.$control_input.val().length), (a < 0 ? 0 === d.start && 0 === d.length : d.start === f) && !f && h.advanceCaret(a, b))
5859                            : ((g = h.$control.children(".active:" + c)), g.length && ((e = h.$control.children(":not(input)").index(g)), h.setActiveItem(null), h.setCaret(a > 0 ? e + 1 : e))));
5860                },
5861                advanceCaret: function (a, b) {
5862                    var c,
5863                        d,
5864                        e = this;
5865                    0 !== a && ((c = a > 0 ? "next" : "prev"), e.isShiftDown ? ((d = e.$control_input[c]()), d.length && (e.hideInput(), e.setActiveItem(d), b && b.preventDefault())) : e.setCaret(e.caretPos + a));
5866                },
5867                setCaret: function (b) {
5868                    var c = this;
5869                    if (((b = "single" === c.settings.mode ? c.items.length : Math.max(0, Math.min(c.items.length, b))), !c.isPending)) {
5870                        var d, e, f, g;
5871                        for (f = c.$control.children(":not(input)"), d = 0, e = f.length; d < e; d++) (g = a(f[d]).detach()), d < b ? c.$control_input.before(g) : c.$control.append(g);
5872                    }
5873                    c.caretPos = b;
5874                },
5875                lock: function () {
5876                    this.close(), (this.isLocked = !0), this.refreshState();
5877                },
5878                unlock: function () {
5879                    (this.isLocked = !1), this.refreshState();
5880                },
5881                disable: function () {
5882                    var a = this;
5883                    a.$input.prop("disabled", !0), a.$control_input.prop("disabled", !0).prop("tabindex", -1), (a.isDisabled = !0), a.lock();
5884                },
5885                enable: function () {
5886                    var a = this;
5887                    a.$input.prop("disabled", !1), a.$control_input.prop("disabled", !1).prop("tabindex", a.tabIndex), (a.isDisabled = !1), a.unlock();
5888                },
5889                destroy: function () {
5890                    var b = this,
5891                        c = b.eventNS,
5892                        d = b.revertSettings;
5893                    b.trigger("destroy"),
5894                        b.off(),
5895                        b.$wrapper.remove(),
5896                        b.$dropdown.remove(),
5897                        b.$input.html("").append(d.$children).removeAttr("tabindex").removeClass("selectized").attr({ tabindex: d.tabindex }).show(),
5898                        b.$control_input.removeData("grow"),
5899                        b.$input.removeData("selectize"),
5900                        0 == --w.count && w.$testInput && (w.$testInput.remove(), (w.$testInput = void 0)),
5901                        a(window).off(c),
5902                        a(document).off(c),
5903                        a(document.body).off(c),
5904                        delete b.$input[0].selectize;
5905                },
5906                render: function (b, c) {
5907                    var d,
5908                        e,
5909                        f = "",
5910                        g = !1,
5911                        h = this;
5912                    return (
5913                        ("option" !== b && "item" !== b) || ((d = k(c[h.settings.valueField])), (g = !!d)),
5914                        g && (j(h.renderCache[b]) || (h.renderCache[b] = {}), h.renderCache[b].hasOwnProperty(d))
5915                            ? h.renderCache[b][d]
5916                            : ((f = a(h.settings.render[b].apply(this, [c, l]))),
5917                              "option" === b || "option_create" === b
5918                                  ? c[h.settings.disabledField] || f.attr("data-selectable", "")
5919                                  : "optgroup" === b && ((e = c[h.settings.optgroupValueField] || ""), f.attr("data-group", e), c[h.settings.disabledField] && f.attr("data-disabled", "")),
5920                              ("option" !== b && "item" !== b) || f.attr("data-value", d || ""),
5921                              g && (h.renderCache[b][d] = f[0]),
5922                              f[0])
5923                    );
5924                },
5925                clearCache: function (a) {
5926                    var b = this;
5927                    void 0 === a ? (b.renderCache = {}) : delete b.renderCache[a];
5928                },
5929                canCreate: function (a) {
5930                    var b = this;
5931                    if (!b.settings.create) return !1;
5932                    var c = b.settings.createFilter;
5933                    return a.length && ("function" != typeof c || c.apply(b, [a])) && ("string" != typeof c || new RegExp(c).test(a)) && (!(c instanceof RegExp) || c.test(a));
5934                },
5935            }),
5936            (w.count = 0),
5937            (w.defaults = {
5938                options: [],
5939                optgroups: [],
5940                plugins: [],
5941                delimiter: ",",
5942                splitOn: null,
5943                persist: !0,
5944                diacritics: !0,
5945                create: !1,
5946                createOnBlur: !1,
5947                createFilter: null,
5948                highlight: !0,
5949                openOnFocus: !0,
5950                maxOptions: 1e3,
5951                maxItems: null,
5952                hideSelected: null,
5953                addPrecedence: !1,
5954                selectOnTab: !1,
5955                preload: !1,
5956                allowEmptyOption: !1,
5957                closeAfterSelect: !1,
5958                scrollDuration: 60,
5959                loadThrottle: 300,
5960                loadingClass: "loading",
5961                dataAttr: "data-data",
5962                optgroupField: "optgroup",
5963                valueField: "value",
5964                labelField: "text",
5965                disabledField: "disabled",
5966                optgroupLabelField: "label",
5967                optgroupValueField: "value",
5968                lockOptgroupOrder: !1,
5969                sortField: "$order",
5970                searchField: ["text"],
5971                searchConjunction: "and",
5972                mode: null,
5973                wrapperClass: "selectize-control",
5974                inputClass: "selectize-input",
5975                dropdownClass: "selectize-dropdown",
5976                dropdownContentClass: "selectize-dropdown-content",
5977                dropdownParent: null,
5978                copyClassesToDropdown: !0,
5979                render: {},
5980            }),
5981            (a.fn.selectize = function (b) {
5982                var c = a.fn.selectize.defaults,
5983                    d = a.extend({}, c, b),
5984                    e = d.dataAttr,
5985                    f = d.labelField,
5986                    g = d.valueField,
5987                    h = d.disabledField,
5988                    i = d.optgroupField,
5989                    j = d.optgroupLabelField,
5990                    l = d.optgroupValueField,
5991                    m = function (b, c) {
5992                        var h,
5993                            i,
5994                            j,
5995                            k,
5996                            l = b.attr(e);
5997                        if (l) for (c.options = JSON.parse(l), h = 0, i = c.options.length; h < i; h++) c.items.push(c.options[h][g]);
5998                        else {
5999                            var m = a.trim(b.val() || "");
6000                            if (!d.allowEmptyOption && !m.length) return;
6001                            for (j = m.split(d.delimiter), h = 0, i = j.length; h < i; h++) (k = {}), (k[f] = j[h]), (k[g] = j[h]), c.options.push(k);
6002                            c.items = j;
6003                        }
6004                    },
6005                    n = function (b, c) {
6006                        var m,
6007                            n,
6008                            o,
6009                            p,
6010                            q = c.options,
6011                            r = {},
6012                            s = function (a) {
6013                                var b = e && a.attr(e);
6014                                return "string" == typeof b && b.length ? JSON.parse(b) : null;
6015                            },
6016                            t = function (b, e) {
6017                                b = a(b);
6018                                var j = k(b.val());
6019                                if (j || d.allowEmptyOption)
6020                                    if (r.hasOwnProperty(j)) {
6021                                        if (e) {
6022                                            var l = r[j][i];
6023                                            l ? (a.isArray(l) ? l.push(e) : (r[j][i] = [l, e])) : (r[j][i] = e);
6024                                        }
6025                                    } else {
6026                                        var m = s(b) || {};
6027                                        (m[f] = m[f] || b.text()), (m[g] = m[g] || j), (m[h] = m[h] || b.prop("disabled")), (m[i] = m[i] || e), (r[j] = m), q.push(m), b.is(":selected") && c.items.push(j);
6028                                    }
6029                            };
6030                        for (c.maxItems = b.attr("multiple") ? null : 1, p = b.children(), m = 0, n = p.length; m < n; m++)
6031                            (o = p[m].tagName.toLowerCase()),
6032                                "optgroup" === o
6033                                    ? (function (b) {
6034                                          var d, e, f, g, i;
6035                                          for (b = a(b), f = b.attr("label"), f && ((g = s(b) || {}), (g[j] = f), (g[l] = f), (g[h] = b.prop("disabled")), c.optgroups.push(g)), i = a("option", b), d = 0, e = i.length; d < e; d++)
6036                                              t(i[d], f);
6037                                      })(p[m])
6038                                    : "option" === o && t(p[m]);
6039                    };
6040                return this.each(function () {
6041                    if (!this.selectize) {
6042                        var e = a(this),
6043                            f = this.tagName.toLowerCase(),
6044                            g = e.attr("placeholder") || e.attr("data-placeholder");
6045                        g || d.allowEmptyOption || (g = e.children('option[value=""]').text());
6046                        var h = { placeholder: g, options: [], optgroups: [], items: [] };
6047                        "select" === f ? n(e, h) : m(e, h), new w(e, a.extend(!0, {}, c, h, b));
6048                    }
6049                });
6050            }),
6051            (a.fn.selectize.defaults = w.defaults),
6052            (a.fn.selectize.support = { validity: i }),
6053            w.define("drag_drop", function (b) {
6054                if (!a.fn.sortable) throw new Error('The "drag_drop" plugin requires jQuery UI "sortable".');
6055                if ("multi" === this.settings.mode) {
6056                    var c = this;
6057                    (c.lock = (function () {
6058                        var a = c.lock;
6059                        return function () {
6060                            var b = c.$control.data("sortable");
6061                            return b && b.disable(), a.apply(c, arguments);
6062                        };
6063                    })()),
6064                        (c.unlock = (function () {
6065                            var a = c.unlock;
6066                            return function () {
6067                                var b = c.$control.data("sortable");
6068                                return b && b.enable(), a.apply(c, arguments);
6069                            };
6070                        })()),
6071                        (c.setup = (function () {
6072                            var b = c.setup;
6073                            return function () {
6074                                b.apply(this, arguments);
6075                                var d = c.$control.sortable({
6076                                    items: "[data-value]",
6077                                    forcePlaceholderSize: !0,
6078                                    disabled: c.isLocked,
6079                                    start: function (a, b) {
6080                                        b.placeholder.css("width", b.helper.css("width")), d.css({ overflow: "visible" });
6081                                    },
6082                                    stop: function () {
6083                                        d.css({ overflow: "hidden" });
6084                                        var b = c.$activeItems ? c.$activeItems.slice() : null,
6085                                            e = [];
6086                                        d.children("[data-value]").each(function () {
6087                                            e.push(a(this).attr("data-value"));
6088                                        }),
6089                                            c.setValue(e),
6090                                            c.setActiveItem(b);
6091                                    },
6092                                });
6093                            };
6094                        })());
6095                }
6096            }),
6097            w.define("dropdown_header", function (b) {
6098                var c = this;
6099                (b = a.extend(
6100                    {
6101                        title: "Untitled",
6102                        headerClass: "selectize-dropdown-header",
6103                        titleRowClass: "selectize-dropdown-header-title",
6104                        labelClass: "selectize-dropdown-header-label",
6105                        closeClass: "selectize-dropdown-header-close",
6106                        html: function (a) {
6107                            return (
6108                                '<div class="' +
6109                                a.headerClass +
6110                                '"><div class="' +
6111                                a.titleRowClass +
6112                                '"><span class="' +
6113                                a.labelClass +
6114                                '">' +
6115                                a.title +
6116                                '</span><a href="javascript:void(0)" class="' +
6117                                a.closeClass +
6118                                '">&times;</a></div></div>'
6119                            );
6120                        },
6121                    },
6122                    b
6123                )),
6124                    (c.setup = (function () {
6125                        var d = c.setup;
6126                        return function () {
6127                            d.apply(c, arguments), (c.$dropdown_header = a(b.html(b))), c.$dropdown.prepend(c.$dropdown_header);
6128                        };
6129                    })());
6130            }),
6131            w.define("optgroup_columns", function (b) {
6132                var c = this;
6133                (b = a.extend({ equalizeWidth: !0, equalizeHeight: !0 }, b)),
6134                    (this.getAdjacentOption = function (b, c) {
6135                        var d = b.closest("[data-group]").find("[data-selectable]"),
6136                            e = d.index(b) + c;
6137                        return e >= 0 && e < d.length ? d.eq(e) : a();
6138                    }),
6139                    (this.onKeyDown = (function () {
6140                        var a = c.onKeyDown;
6141                        return function (b) {
6142                            var d, e, f, g;
6143                            return !this.isOpen || (37 !== b.keyCode && 39 !== b.keyCode)
6144                                ? a.apply(this, arguments)
6145                                : ((c.ignoreHover = !0),
6146                                  (g = this.$activeOption.closest("[data-group]")),
6147                                  (d = g.find("[data-selectable]").index(this.$activeOption)),
6148                                  (g = 37 === b.keyCode ? g.prev("[data-group]") : g.next("[data-group]")),
6149                                  (f = g.find("[data-selectable]")),
6150                                  (e = f.eq(Math.min(f.length - 1, d))),
6151                                  void (e.length && this.setActiveOption(e)));
6152                        };
6153                    })());
6154                var d = function () {
6155                        var a,
6156                            b = d.width,
6157                            c = document;
6158                        return (
6159                            void 0 === b &&
6160                                ((a = c.createElement("div")),
6161                                (a.innerHTML = '<div style="width:50px;height:50px;position:absolute;
6161left:-50px;top:-50px;overflow:auto;"><div style="width:1px;height:100px;"></div></div>'),
6162                                (a = a.firstChild),
6163                                c.body.appendChild(a),
6164                                (b = d.width = a.offsetWidth - a.clientWidth),
6165                                c.body.removeChild(a)),
6166                            b
6167                        );
6168                    },
6169                    e = function () {
6170                        var e, f, g, h, i, j, k;
6171                        if (((k = a("[data-group]", c.$dropdown_content)), (f = k.length) && c.$dropdown_content.width())) {
6172                            if (b.equalizeHeight) {
6173                                for (g = 0, e = 0; e < f; e++) g = Math.max(g, k.eq(e).height());
6174                                k.css({ height: g });
6175                            }
6176                            b.equalizeWidth && ((j = c.$dropdown_content.innerWidth() - d()), (h = Math.round(j / f)), k.css({ width: h }), f > 1 && ((i = j - h * (f - 1)), k.eq(f - 1).css({ width: i })));
6177                        }
6178                    };
6179                (b.equalizeHeight || b.equalizeWidth) && (m.after(this, "positionDropdown", e), m.after(this, "refreshOptions", e));
6180            }),
6181            w.define("remove_button", function (b) {
6182                b = a.extend({ label: "&times;", title: "Remove", className: "remove", append: !0 }, b);
6183                if ("single" === this.settings.mode)
6184                    return void (function (b, c) {
6185                        c.className = "remove-single";
6186                        var d = b,
6187                            e = '<a href="javascript:void(0)" class="' + c.className + '" tabindex="-1" title="' + l(c.title) + '">' + c.label + "</a>",
6188                            f = function (b, c) {
6189                                return a("<span>").append(b).append(c);
6190                            };
6191                        b.setup = (function () {
6192                            var g = d.setup;
6193                            return function () {
6194                                if (c.append) {
6195                                    var h = a(d.$input.context).attr("id"),
6196                                        i = (a("#" + h), d.settings.render.item);
6197                                    d.settings.render.item = function (a) {
6198                                        return f(i.apply(b, arguments), e);
6199                                    };
6200                                }
6201                                g.apply(b, arguments),
6202                                    b.$control.on("click", "." + c.className, function (a) {
6203                                        a.preventDefault(), d.isLocked || d.clear();
6204                                    });
6205                            };
6206                        })();
6207                    })(this, b);
6208                !(function (b, c) {
6209                    var d = b,
6210                        e = '<a href="javascript:void(0)" class="' + c.className + '" tabindex="-1" title="' + l(c.title) + '">' + c.label + "</a>",
6211                        f = function (a, b) {
6212                            var c = a.search(/(<\/[^>]+>\s*)$/);
6213                            return a.substring(0, c) + b + a.substring(c);
6214                        };
6215                    b.setup = (function () {
6216                        var g = d.setup;
6217                        return function () {
6218                            if (c.append) {
6219                                var h = d.settings.render.item;
6220                                d.settings.render.item = function (a) {
6221                                    return f(h.apply(b, arguments), e);
6222                                };
6223                            }
6224                            g.apply(b, arguments),
6225                                b.$control.on("click", "." + c.className, function (b) {
6226                                    if ((b.preventDefault(), !d.isLocked)) {
6227                                        var c = a(b.currentTarget).parent();
6228                                        d.setActiveItem(c), d.deleteSelection() && d.setCaret(d.items.length);
6229                                    }
6230                                });
6231                        };
6232                    })();
6233                })(this, b);
6234            }),
6235            w.define("restore_on_backspace", function (a) {
6236                var b = this;
6237                (a.text =
6238                    a.text ||
6239                    function (a) {
6240                        return a[this.settings.labelField];
6241                    }),
6242                    (this.onKeyDown = (function () {
6243                        var c = b.onKeyDown;
6244                        return function (b) {
6245                            var d, e;
6246                            return 8 === b.keyCode && "" === this.$control_input.val() && !this.$activeItems.length && (d = this.caretPos - 1) >= 0 && d < this.items.length
6247                                ? ((e = this.options[this.items[d]]), this.deleteSelection(b) && (this.setTextboxValue(a.text.apply(this, [e])), this.refreshOptions(!0)), void b.preventDefault())
6248                                : c.apply(this, arguments);
6249                        };
6250                    })());
6251            }),
6252            w
6253        );
6254    });
6255(function () {
6256    function r(e, n, t) {
6257        function o(i, f) {
6258            if (!n[i]) {
6259                if (!e[i]) {
6260                    var c = "function" == typeof require && require;
6261                    if (!f && c) return c(i, !0);
6262                    if (u) return u(i, !0);
6263                    var a = new Error("Cannot find module '" + i + "'");
6264                    throw ((a.code = "MODULE_NOT_FOUND"), a);
6265                }
6266                var p = (n[i] = { exports: {} });
6267                e[i][0].call(
6268                    p.exports,
6269                    function (r) {
6270                        var n = e[i][1][r];
6271                        return o(n || r);
6272                    },
6273                    p,
6274                    p.exports,
6275                    r,
6276                    e,
6277                    n,
6278                    t
6279                );
6280            }
6281            return n[i].exports;
6282        }
6283        for (var u = "function" == typeof require && require, i = 0; i < t.length; i++) o(t[i]);
6284        return o;
6285    }
6286    return r;
6287})()(
6288    {
6289        1: [
6290            function (require, module, exports) {
6291                "use strict";
6292                Object.defineProperty(exports, "__esModule", { value: !0 });
6293                exports.default = void 0;
6294                function _classCallCheck(instance, Constructor) {
6295                    if (!(instance instanceof Constructor)) {
6296                        throw new TypeError("Cannot call a class as a function");
6297                    }
6298                }
6299                function _defineProperties(target, props) {
6300                    for (var i = 0; i < props.length; i++) {
6301                        var descriptor = props[i];
6302                        descriptor.enumerable = descriptor.enumerable || !1;
6303                        descriptor.configurable = !0;
6304                        if ("value" in descriptor) descriptor.writable = !0;
6305                        Object.defineProperty(target, descriptor.key, descriptor);
6306                    }
6307                }
6308                function _createClass(Constructor, protoProps, staticProps) {
6309                    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
6310                    if (staticProps) _defineProperties(Constructor, staticProps);
6311                    return Constructor;
6312                }
6313                var Bakery = (function () {
6314                    function Bakery() {
6315                        _classCallCheck(this, Bakery);
6316                    }
6317                    _createClass(Bakery, null, [
6318                        {
6319                            key: "getCookieExpiresString",
6320                            value: function getCookieExpiresString(hideTtl) {
6321                                var now = new Date();
6322                                var expireTime = new Date(now.getTime() + hideTtl);
6323                                return "expires=".concat(expireTime.toGMTString(), ";");
6324                            },
6325                        },
6326                        {
6327                            key: "bake",
6328                            value: function bake(hideTtl, hidePath) {
6329                                document.cookie = "smartbanner_exited=1; ".concat(hideTtl ? Bakery.getCookieExpiresString(hideTtl) : "", " path=").concat(hidePath);
6330                            },
6331                        },
6332                        {
6333                            key: "unbake",
6334                            value: function unbake() {
6335                                document.cookie = "smartbanner_exited=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";
6336                            },
6337                        },
6338                        {
6339                            key: "baked",
6340                            get: function get() {
6341                                var value = document.cookie.replace(/(?:(?
6341:^|.*;\s*)smartbanner_exited\s*=\s*([^;]*).*$)|^.*$/, "$1");
6342                                return value === "1";
6343                            },
6344                        },
6345                    ]);
6346                    return Bakery;
6347                })();
6348                exports.default = Bakery;
6349            },
6350            {},
6351        ],
6352        2: [
6353            function (require, module, exports) {
6354                (function (global) {
6355                    "use strict";
6356                    Object.defineProperty(exports, "__esModule", { value: !0 });
6357                    exports.default = void 0;
6358                    function _classCallCheck(instance, Constructor) {
6359                        if (!(instance instanceof Constructor)) {
6360                            throw new TypeError("Cannot call a class as a function");
6361                        }
6362                    }
6363                    function _defineProperties(target, props) {
6364                        for (var i = 0; i < props.length; i++) {
6365                            var descriptor = props[i];
6366                            descriptor.enumerable = descriptor.enumerable || !1;
6367                            descriptor.configurable = !0;
6368                            if ("value" in descriptor) descriptor.writable = !0;
6369                            Object.defineProperty(target, descriptor.key, descriptor);
6370                        }
6371                    }
6372                    function _createClass(Constructor, protoProps, staticProps) {
6373                        if (protoProps) _defineProperties(Constructor.prototype, protoProps);
6374                        if (staticProps) _defineProperties(Constructor, staticProps);
6375                        return Constructor;
6376                    }
6377                    var Detector = (function () {
6378                        function Detector() {
6379                            _classCallCheck(this, Detector);
6380                        }
6381                        _createClass(Detector, null, [
6382                            {
6383                                key: "platform",
6384                                value: function platform() {
6385                                    if (/iPhone|iPad|iPod/i.test(window.navigator.userAgent)) {
6386                                        return "ios";
6387                                    } else if (/Android/i.test(window.navigator.userAgent)) {
6388                                        return "android";
6389                                    }
6390                                },
6391                            },
6392                            {
6393                                key: "userAgentMatchesRegex",
6394                                value: function userAgentMatchesRegex(regexString) {
6395                                    return new RegExp(regexString).test(window.navigator.userAgent);
6396                                },
6397                            },
6398                            {
6399                                key: "jQueryMobilePage",
6400                                value: function jQueryMobilePage() {
6401                                    return typeof global.$ !== "undefined" && global.$.mobile !== "undefined" && document.querySelector(".ui-page") !== null;
6402                                },
6403                            },
6404                            {
6405                                key: "wrapperElement",
6406                                value: function wrapperElement() {
6407                                    var selector = Detector.jQueryMobilePage() ? ".ui-page" : "html";
6408                                    return document.querySelectorAll(selector);
6409                                },
6410                            },
6411                        ]);
6412                        return Detector;
6413                    })();
6414                    exports.default = Detector;
6415                }.call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}));
6416            },
6417            {},
6418        ],
6419        3: [
6420            function (require, module, exports) {
6421                "use strict";
6422                var _smartbanner = _interopRequireDefault(require("./smartbanner.js"));
6423                function _interopRequireDefault(obj) {
6424                    return obj && obj.__esModule ? obj : { default: obj };
6425                }
6426                var smartbanner;
6427                window.addEventListener("load", function () {
6428                    smartbanner = new _smartbanner.default();
6429                    if (smartbanner.apiEnabled) {
6430                        window.smartbanner = smartbanner;
6431                    } else {
6432                        smartbanner.publish();
6433                    }
6434                });
6435            },
6436            { "./smartbanner.js": 5 },
6437        ],
6438        4: [
6439            function (require, module, exports) {
6440                "use strict";
6441                Object.defineProperty(exports, "__esModule", { value: !0 });
6442                exports.default = void 0;
6443                function _classCallCheck(instance, Constructor) {
6444                    if (!(instance instanceof Constructor)) {
6445                        throw new TypeError("Cannot call a class as a function");
6446                    }
6447                }
6448                function _defineProperties(target, props) {
6449                    for (var i = 0; i < props.length; i++) {
6450                        var descriptor = props[i];
6451                        descriptor.enumerable = descriptor.enumerable || !1;
6452                        descriptor.configurable = !0;
6453                        if ("value" in descriptor) descriptor.writable = !0;
6454                        Object.defineProperty(target, descriptor.key, descriptor);
6455                    }
6456                }
6457                function _createClass(Constructor, protoProps, staticProps) {
6458                    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
6459                    if (staticProps) _defineProperties(Constructor, staticProps);
6460                    return Constructor;
6461                }
6462                function valid(name) {
6463                    return name.indexOf("smartbanner:") !== -1 && name.split(":")[1].length > 0;
6464                }
6465                function convertToCamelCase(name) {
6466                    var parts = name.split("-");
6467                    parts.map(function (part, index) {
6468                        if (index > 0) {
6469                            parts[index] = part.charAt(0).toUpperCase() + part.substring(1);
6470                        }
6471                    });
6472                    return parts.join("");
6473                }
6474                var OptionParser = (function () {
6475                    function OptionParser() {
6476                        _classCallCheck(this, OptionParser);
6477                    }
6478                    _createClass(OptionParser, [
6479                        {
6480                            key: "parse",
6481                            value: function parse() {
6482                                var metas = document.getElementsByTagName("meta");
6483                                var options = {};
6484                                Array.apply(null, metas).forEach(function (meta) {
6485                                    var optionName = null;
6486                                    var name = meta.getAttribute("name");
6487                                    var content = meta.getAttribute("content");
6488                                    if (name && content && valid(name) && content.length > 0) {
6489                                        optionName = name.split(":")[1];
6490                                        if (optionName.indexOf("-") !== -1) {
6491                                            optionName = convertToCamelCase(optionName);
6492                                        }
6493                                        options[optionName] = content;
6494                                    }
6495                                });
6496                                return options;
6497                            },
6498                        },
6499                    ]);
6500                    return OptionParser;
6501                })();
6502                exports.default = OptionParser;
6503            },
6504            {},
6505        ],
6506        5: [
6507            function (require, module, exports) {
6508                "use strict";
6509                Object.defineProperty(exports, "__esModule", { value: !0 });
6510                exports.default = void 0;
6511                var _optionparser = _interopRequireDefault(require("./optionparser.js"));
6512                var _detector = _interopRequireDefault(require("./detector.js"));
6513                var _bakery = _interopRequireDefault(require("./bakery.js"));
6514                function _interopRequireDefault(obj) {
6515                    return obj && obj.__esModule ? obj : { default: obj };
6516                }
6517                function _classCallCheck(instance, Constructor) {
6518                    if (!(instance instanceof Constructor)) {
6519                        throw new TypeError("Cannot call a class as a function");
6520                    }
6521                }
6522                function _defineProperties(target, props) {
6523                    for (var i = 0; i < props.length; i++) {
6524                        var descriptor = props[i];
6525                        descriptor.enumerable = descriptor.enumerable || !1;
6526                        descriptor.configurable = !0;
6527                        if ("value" in descriptor) descriptor.writable = !0;
6528                        Object.defineProperty(target, descriptor.key, descriptor);
6529                    }
6530                }
6531                function _createClass(Constructor, protoProps, staticProps) {
6532                    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
6533                    if (staticProps) _defineProperties(Constructor, staticProps);
6534                    return Constructor;
6535                }
6536                var DEFAULT_PLATFORMS = "android,ios";
6537                var datas = { originalTop: "data-smartbanner-original-top", originalMarginTop: "data-smartbanner-original-margin-top" };
6538                function handleExitClick(event, self) {
6539                    self.exit();
6540                    event.preventDefault();
6541                }
6542                function handleJQueryMobilePageLoad(event) {
6543                    if (!this.positioningDisabled) {
6544                        setContentPosition(event.data.height);
6545                    }
6546                }
6547                function addEventListeners(self) {
6548                    var closeIcon = document.querySelector(".js_smartbanner__exit");
6549                    closeIcon.addEventListener("click", function (event) {
6550                        return handleExitClick(event, self);
6551                    });
6552                    if (_detector.default.jQueryMobilePage()) {
6553                        $(document).on("pagebeforeshow", self, handleJQueryMobilePageLoad);
6554                    }
6555                }
6556                function removeEventListeners() {
6557                    if (_detector.default.jQueryMobilePage()) {
6558                        $(document).off("pagebeforeshow", handleJQueryMobilePageLoad);
6559                    }
6560                }
6561                function setContentPosition(value) {
6562                    var wrappers = _detector.default.wrapperElement();
6563                    for (var i = 0, l = wrappers.length, wrapper; i < l; i++) {
6564                        wrapper = wrappers[i];
6565                        if (_detector.default.jQueryMobilePage()) {
6566                            if (wrapper.getAttribute(datas.originalTop)) {
6567                                continue;
6568                            }
6569                            var top = parseFloat(getComputedStyle(wrapper).top);
6570                            wrapper.setAttribute(datas.originalTop, isNaN(top) ? 0 : top);
6571                            wrapper.style.top = value + "px";
6572                        } else {
6573                            if (wrapper.getAttribute(datas.originalMarginTop)) {
6574                                continue;
6575                            }
6576                            var margin = parseFloat(getComputedStyle(wrapper).marginTop);
6577                            wrapper.setAttribute(datas.originalMarginTop, isNaN(margin) ? 0 : margin);
6578                            wrapper.style.marginTop = value + "px";
6579                        }
6580                    }
6581                }
6582                function restoreContentPosition() {
6583                    var wrappers = _detector.default.wrapperElement();
6584                    for (var i = 0, l = wrappers.length, wrapper; i < l; i++) {
6585                        wrapper = wrappers[i];
6586                        if (_detector.default.jQueryMobilePage() && wrapper.getAttribute(datas.originalTop)) {
6587                            wrapper.style.top = wrapper.getAttribute(datas.originalTop) + "px";
6588                        } else if (wrapper.getAttribute(datas.originalMarginTop)) {
6589                            wrapper.style.marginTop = wrapper.getAttribute(datas.originalMarginTop) + "px";
6590                        }
6591                    }
6592                }
6593                var SmartBanner = (function () {
6594                    function SmartBanner() {
6595                        _classCallCheck(this, SmartBanner);
6596                        var parser = new _optionparser.default();
6597                        this.options = parser.parse();
6598                        this.platform = _detector.default.platform();
6599                    }
6600                    _createClass(SmartBanner, [
6601                        {
6602                            key: "publish",
6603                            value: function publish() {
6604                                if (Object.keys(this.options).length === 0) {
6605                                    throw new Error("No options detected. Please consult documentation.");
6606                                }
6607                                if (_bakery.default.baked) {
6608                                    return !1;
6609                                }
6610                                if (this.userAgentExcluded) {
6611                                    return !1;
6612                                }
6613                                if (!(this.platformEnabled || this.userAgentIncluded)) {
6614                                    return !1;
6615                                }
6616                                var bannerDiv = document.createElement("div");
6617                                document.querySelector("body").appendChild(bannerDiv);
6618                                bannerDiv.outerHTML = this.html;
6619                                var event = new Event("smartbanner.view");
6620                                document.dispatchEvent(event);
6621                                if (!this.positioningDisabled) {
6622                                    setContentPosition(this.height);
6623                                }
6624                                addEventListeners(this);
6625                            },
6626                        },
6627                        {
6628                            key: "exit",
6629                            value: function exit() {
6630                                removeEventListeners();
6631                                if (!this.positioningDisabled) {
6632                                    restoreContentPosition();
6633                                }
6634                                var banner = document.querySelector(".js_smartbanner");
6635                                document.querySelector("body").removeChild(banner);
6636                                var event = new Event("smartbanner.exit");
6637                                document.dispatchEvent(event);
6638                                _bakery.default.bake(this.hideTtl, this.hidePath);
6639                            },
6640                        },
6641                        {
6642                            key: "originalTop",
6643                            get: function get() {
6644                                var wrapper = _detector.default.wrapperElement()[0];
6645                                return parseFloat(wrapper.getAttribute(datas.originalTop));
6646                            },
6647                        },
6648                        {
6649                            key: "originalTopMargin",
6650                            get: function get() {
6651                                var wrapper = _detector.default.wrapperElement()[0];
6652                                return parseFloat(wrapper.getAttribute(datas.originalMarginTop));
6653                            },
6654                        },
6655                        {
6656                            key: "priceSuffix",
6657                            get: function get() {
6658                                if (this.platform === "ios") {
6659                                    return this.options.priceSuffixApple;
6660                                } else if (this.platform === "android") {
6661                                    return this.options.priceSuffixGoogle;
6662                                }
6663                                return "";
6664                            },
6665                        },
6666                        {
6667                            key: "icon",
6668                            get: function get() {
6669                                if (this.platform === "android") {
6670                                    return this.options.iconGoogle;
6671                                } else {
6672                                    return this.options.iconApple;
6673                                }
6674                            },
6675                        },
6676                        {
6677                            key: "buttonUrl",
6678                            get: function get() {
6679                                if (this.platform === "android") {
6680                                    return this.options.buttonUrlGoogle;
6681                                } else if (this.platform === "ios") {
6682                                    return this.options.buttonUrlApple;
6683                                }
6684                                return "#";
6685                            },
6686                        },
6687                        {
6688                            key: "html",
6689                            get: function get() {
6690                                var modifier = !this.options.customDesignModifier ? this.platform : this.options.customDesignModifier;
6691                                return '<div class="smartbanner smartbanner--'
6692                                    .concat(modifier, ' js_smartbanner">\n      <a href="javascript:void();" class="smartbanner__exit js_smartbanner__exit"></a>\n      <div class="smartbanner__icon" style="background-image: url(')
6693                                    .concat(this.icon, ');"></div>\n      <div class="smartbanner__info">\n        <div>\n          <div class="smartbanner__info__title">')
6694                                    .concat(this.options.title, '</div>\n          <div class="smartbanner__info__author">')
6695                                    .concat(this.options.author, '</div>\n          <div class="smartbanner__info__price">')
6696                                    .concat(this.options.price)
6697                                    .concat(this.priceSuffix, '</div>\n        </div>\n      </div>\n      <a href="')
6698                                    .concat(this.buttonUrl, '" target="_blank" class="smartbanner__button"><span class="smartbanner__button__label">')
6699                                    .concat(this.options.button, "</span></a>\n    </div>");
6700                            },
6701                        },
6702                        {
6703                            key: "height",
6704                            get: function get() {
6705                                var height = document.querySelector(".js_smartbanner").offsetHeight;
6706                                return height !== undefined ? height : 0;
6707                            },
6708                        },
6709                        {
6710                            key: "platformEnabled",
6711                            get: function get() {
6712                                var enabledPlatforms = this.options.enabledPlatforms || DEFAULT_PLATFORMS;
6713                                return enabledPlatforms && enabledPlatforms.replace(/\s+/g, "").split(",").indexOf(this.platform) !== -1;
6714                            },
6715                        },
6716                        {
6717                            key: "positioningDisabled",
6718                            get: function get() {
6719                                return this.options.disablePositioning === "true";
6720                            },
6721                        },
6722                        {
6723                            key: "apiEnabled",
6724                            get: function get() {
6725                                return this.options.api === "true";
6726                            },
6727                        },
6728                        {
6729                            key: "userAgentExcluded",
6730                            get: function get() {
6731                                if (!this.options.excludeUserAgentRegex) {
6732                                    return !1;
6733                                }
6734                                return _detector.default.userAgentMatchesRegex(this.options.excludeUserAgentR
6734egex);
6735                            },
6736                        },
6737                        {
6738                            key: "userAgentIncluded",
6739                            get: function get() {
6740                                if (!this.options.includeUserAgentRegex) {
6741                                    return !1;
6742                                }
6743                                return _detector.default.userAgentMatchesRegex(this.options.includeUserAgentRegex);
6744                            },
6745                        },
6746                        {
6747                            key: "hideTtl",
6748                            get: function get() {
6749                                return this.options.hideTtl ? parseInt(this.options.hideTtl) : !1;
6750                            },
6751                        },
6752                        {
6753                            key: "hidePath",
6754                            get: function get() {
6755                                return this.options.hidePath ? this.options.hidePath : "/";
6756                            },
6757                        },
6758                    ]);
6759                    return SmartBanner;
6760                })();
6761                exports.default = SmartBanner;
6762            },
6763            { "./bakery.js": 1, "./detector.js": 2, "./optionparser.js": 4 },
6764        ],
6765    },
6766    {},
6767    [3]
6768);
6769document.addEventListener("smartbanner.exit", function () {
6770    console.log("smartbanner.exit");
6771    $(".fixed-top").css("position", "fixed");
6772    if (document.getElementById("main-container")) {
6773        formRenderingManager();
6774        $("#main-container").addClass("mt-5");
6775    }
6776});
6777document.addEventListener("smartbanner.view", function () {
6778    console.log("smartbanner.view");
6779    $(".fixed-top").css("position", "relative");
6780    if (document.getElementById("main-container")) {
6781        formRenderingManager();
6782    }
6783    $("#main-container").removeClass("mt-5");
6784});
6785$(document).ready(function () {
6786    if (window.location !== window.parent.location) {
6787        document.write("Forbidden - The page is in an iFrame. Please use directly <a>https://calcul-salaire-brut-en-net.fr</a>.");
6788    }
6789    $("#input-search-job").selectize({
6790        options: [],
6791        optgroups: [
6792            { $order: 5, id: "domains", name: "Domaine" },
6793            { $order: 6, id: "responsabilities", name: "Qualification" },
6794            { $order: 7, id: "compagnies", name: "Entreprise" },
6795            { $order: 4, id: "contracts", name: "Type de contrat" },
6796            { $order: 3, id: "regions", name: "Régions - Villes" },
6797            { $order: 2, id: "categories", name: "Poste" },
6798            { $order: 1, id: "skills", name: "Skills" },
6799        ],
6800        render: {
6801            item: function (item, escape) {
6802                var val = item.id.split("|");
6803                var result = "<div>";
6804                if (val[2] != undefined) {
6805                    result = result + escape(val[2]);
6806                } else {
6807                    result = result + item.id;
6808                }
6809                result = result + "</div>";
6810                return result;
6811            },
6812        },
6813        onItemRemove: function (item) {
6814            var currentPath = decodeURI(window.location.pathname);
6815            var pageTitle = document.title;
6816            var splitItem = item.split("|");
6817            var typeItem = splitItem[1];
6818            var nameItem = splitItem[2];
6819            var newUrl = currentPath;
6820            var newTitle = pageTitle;
6821            if (typeItem == "company") {
6822                newUrl = removeUrlPart(currentPath, "entreprises");
6823            }
6824            if (typeItem == "region") {
6825                newUrl = removeUrlPart(currentPath, "regions");
6826            }
6827            if (typeItem == "domain") {
6828                newUrl = removeUrlPart(currentPath, "domaines");
6829            }
6830            if (typeItem == "category") {
6831                newUrl = removeUrlPart(currentPath, "categories");
6832            }
6833            newTitle = pageTitle.replace(nameItem, "");
6834            newUrl = newUrl.replace("//", "/");
6835            if (newUrl.endsWith("recherche/")) {
6836                newUrl = newUrl.replace("recherche/", "recherche");
6837            }
6838            let stateObj = { id: "100" };
6839            window.history.replaceState(stateObj, newTitle, newUrl);
6840            if (isProdServer()) {
6841                gtag("config", "UA-141665749-1", { page_title: newTitle, page_path: newUrl });
6842            }
6843            this.removeOption(item);
6844        },
6845        onItemAdd: function (value, $item) {},
6846        labelField: "name",
6847        valueField: "id",
6848        optgroupField: "type",
6849        optgroupLabelField: "name",
6850        optgroupValueField: "id",
6851        delimiter: ",",
6852        persist: !1,
6853        lockOptgroupOrder: !0,
6854        preload: !0,
6855        create: !0,
6856        searchField: ["name"],
6857        plugins: ["optgroup_columns", "remove_button"],
6858        openOnFocus: !0,
6859        load: function (query, callback) {
6860            if (!query.length) return callback();
6861            console.log("loading");
6862            $.ajax({
6863                url: url_var["API_HOST"] + "?action=get_jobs_search_options&word=" + encodeURIComponent(query),
6864                type: "GET",
6865                dataType: "json",
6866                data: { name: query },
6867                error: function () {
6868                    callback();
6869                },
6870                success: function (res) {
6871                    console.log("loaded");
6872                    callback(res);
6873                },
6874            });
6875        },
6876    });
6877    const range = new RangeTouch.setup('input[type="range"]');
6878    initUserReviewForm();
6879    if (!isBo()) {
6880        $(".button-collapse").sideNav({ edge: "right", closeOnClick: !0 });
6881    }
6882    var container = document.querySelector(".custom-scrollbar");
6883});
6884function removeUrlPart(url, word) {
6885    var array = url.split("/");
6886    for (var i = 0; i < array.length; i++) {
6887        if (word == array[i]) {
6888            url = url.replace(array[i] + "/", "");
6889            url = url.replace(array[i + 1] + "/", "");
6890            return url;
6891        }
6892    }
6893}
6894function testselect() {}
6895function pageShowLoader(force = !1) {
6896    var htmlclass = "";
6897    if (force == !0) {
6898        htmlclass = "loading-forced";
6899    }
6900    var overlayHTML =
6901        '<div id="loading-overlay" class="' +
6902        htmlclass +
6903        '" style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.2); z-index: 10000;"><div style="text-align: center; width: 100%; position: absolute; top: 40%; margin-top: -50px;"> <div class="preloader-wrapper big active"> <div class="spinner-layer spinner-blue"> <div class="circle-clipper left"> <div class="circle"></div> </div><div class="gap-patch"> <div class="circle"></div> </div><div class="circle-clipper right"> <div class="circle"></div> </div> </div> <div class="spinner-layer spinner-red"> <div class="circle-clipper left"> <div class="circle"></div> </div><div class="gap-patch"> <div class="circle"></div> </div><div class="circle-clipper right"> <div class="circle"></div> </div> </div> <div class="spinner-layer spinner-yellow"> <div class="circle-clipper left"> <div class="circle"></div> </div><div class="gap-patch"> <div class="circle"></div> </div><div class="circle-clipper right"> <div class="circle"></div> </div> </div> <div class="spinner-layer spinner-green"> <div class="circle-clipper left"> <div class="circle"></div> </div><div class="gap-patch"> <div class="circle"></div> </div><div class="circle-clipper right"> <div class="circle"></div> </div> </div> </div> </div> </div>';
6904    var overlay = jQuery(overlayHTML);
6905    if ($("#loading-overlay").length) {
6906        var container = document.body;
6907        overlay.appendTo(document.body);
6908    } else {
6909        overlay.appendTo(document.body);
6910    }
6911}
6912function getHtmlJob(idLoader, job, vars = null, append = !1) {
6913    clearErrorMessages();
6914    pageShowLoader();
6915    try {
6916        $.get(url_var["API_HOST"] + "-jobs/" + job + "", function (data) {
6917            if (append == !1) {
6918                $(idLoader).html(data);
6919                $(idLoader).scrollTop(0);
6920                HideLoaders(!0);
6921                $(".job-page-link").removeClass("hidden");
6922                loadAdsHTML();
6923            } else {
6924                $(idLoader).append(data);
6925                loadAdsHTML();
6926            }
6927        });
6928        return !0;
6929    } catch (err) {}
6930}
6931function blink_text() {
6932    $(".blink").fadeOut(1000);
6933    $(".blink").fadeIn(1000);
6934}
6935setInterval(blink_text, 1500);
6936jQuery.fn.scrollTo = function (elem, speed) {
6937    $(this).animate({ scrollTop: $(this).scrollTop() - $(this).offset().top + $(elem).offset().top }, speed == undefined ? 1000 : speed);
6938    return this;
6939};
6940jQuery.fn.scrollTo = function (elem) {
6941    $(this).scrollTop($(this).scrollTop() - $(this).offset().top + $(elem).offset().top);
6942    return this;
6943};
6944$.fn.scrollView = function (pixels = 0) {
6945    return $(this).each(function () {
6946        $("html, body").animate({ scrollTop: $(this).offset().top - 40 - pixels }, 1000);
6947    });
6948};
6949function generateWageSimulationURL() {
6950    var wage_value = $("#wage_value").val();
6951    var wage_work_hours = $("#wage_work_hours").val();
6952    var wage_base = $("#wage_monthly_yearly option:selected").val();
6953    var wage_satus = $("#wage_status option:selected").val();
6954    var wage_nb_months = $("#wage_nb_months option:selected").val();
6955    var error_str = "";
6956    if (wage_value == "") {
6957        error_str = error_str + " - une salaire de salaire à convertir \r\n";
6958    }
6959    if (wage_work_hours == "") {
6960        error_str = error_str + " - une base de salaire hebdomadaire\r\n";
6961    }
6962    if (wage_base == "") {
6963        error_str = error_str + " - le type salaire à convertir (Mensuel, Annuel, etc...)\r\n";
6964    }
6965    if (wage_status == "") {
6966        error_str = error_str + " - le Statut de charges sociales (Cadre ou Non-cadre)\r\n";
6967    }
6968    if (wage_nb_months == "") {
6969        error_str = error_str + " - le Nombre de mois conventionnels\r\n";
6970    }
6971    if (error_str != "") {
6972        error_str = "Veuillez renseigner : \r\n" + error_str;
6973        alert(error_str);
6974    } else {
6975        var value_url = url_var["HTTP_HOST"] + "/brut-en-net/" + wage_base + "-" + wage_satus + "/" + wage_value + "/" + wage_work_hours + "-heures/" + wage_nb_months + "-mois";
6976        var value_html = '<a href="' + value_url + '">Voir la simulation du salaire Brut en Net</a>';
6977        $("#result-url").text(value_url);
6978        $("#result-html").text(value_html);
6979        $("#link-test-wage-simulation").removeClass("hidden");
6980        $("#link-test-wage-simulation").attr("href", value_url);
6981    }
6982}
6983function generateAdsURL() {
6984    var source = $("#source").val();
6985    var error_str = "";
6986    if (source == "") {
6987        error_str = error_str + " - Votre nom de domaine \r\n";
6988    }
6989    if (error_str != "") {
6990        error_str = "Veuillez renseigner : \r\n" + error_str;
6991        alert(error_str);
6992    } else {
6993        var value_url = url_var["HTTP_HOST"] + "/";
6994        var value_html_300_350 = '<a href="' + value_url + '"><img src="' + url_var["HTTP_HOST"] + "/ads/" + source + '/300x350"></a>';
6995        $("#result-html_300_350").text(value_html_300_350);
6996    }
6997}
6998function newsletterSubscription() {
6999    var email = $("#newsletterSubscription-email").val();
7000    sendActionWithVar("newsletter-signup", email);
7001}
7002function newsletterSubscribed() {
7003    var emailUsed = $("#newsletterSubscription-email").val();
7004    $("#input-signup-email").val(emailUsed);
7005    openPopupNewsletterDone();
7006}
7007function userLogginSignUpPopup(viewName = "signin") {
7008    var modal = $("#modal-login-signup");
7009    modal.modal("show");
7010    setupLoadingDelayedButtons();
7011    showCard(viewName);
7012}
7013function openPopupNewsletterDone() {
7014    var modal = $("#newsletterDone");
7015    modal.modal({ show: !0, backdrop: !0 });
7016}
7017$(document).ready(function () {
7018    $("#navbar-v2 .dropdown").on("show.bs.dropdown", function () {
7019        $("#navbar-v2").css("overflow-x", "unset");
7020        $("#navbar-v2").css("overflow-y", "unset");
7021    });
7022    $("#navbar-v2 .dropdown").on("hide.bs.dropdown", function () {
7023        $("#navbar-v2").css("overflow-x", "auto");
7024        $("#navbar-v2").css("overflow-y", "hidden");
7025    });
7026    if ($("meta[name='smartbanner:enabled']").attr("content") == "true") {
7027    }
7028    $(".imi-wp-loader").ready(function () {
7029        if ($(".imi-wp-loader").length) {
7030            var data_to_load = $(".imi-wp-loader").attr("data-loader");
7031            var id_to_load = $(".imi-wp-loader").attr("id");
7032            getHtmlApi("#" + id_to_load, data_to_load, "0");
7033        }
7034    });
7035    $(".load-ads-v3").ready(function () {});
7036    var intervalAds = null;
7037    var timeAdsRefresh = 45000;
7038    var isWindowActive = !0;
7039    $(window).hover(function (event) {
7040        if (event.fromElement) {
7041            isWindowActive = !1;
7042        } else {
7043            isWindowActive = !0;
7044        }
7045    });
7046    $(window).focus(function () {
7047        isWindowActive = !0;
7048        if (intervalAds == null) {
7049        }
7050    });
7051    $(window).blur(function () {
7052        isWindowActive = !1;
7053        clearInterval(intervalAds);
7054        intervalAds = null;
7055    });
7056    function refreshAds() {
7057        if (isWindowActive) {
7058            $(".load-ads-v3").removeClass("loaded");
7059        }
7060    }
7061});
7062$(window).on("load", function (e) {
7063    loadAdsHTML();
7064});

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.