PageSourceSearch

https://www.fit1job.ch/wp-content/themes/workscout/js/custom.min.js?ver=1791134551

js fit1job.ch collected 2026-10-04 21:16:38 UTC 80,666 bytes, 2,074 lines download raw bytes

1/* ----------------- Start Document ----------------- */
2(function($){
3    "use strict";
4
5    $(document).ready(function(){
6      /*--------------------------------------------------*/
7      /*  Mobile Menu
8	/*--------------------------------------------------*/
9      $(".mmenu-trigger, .menu-icon-toggle").on("click", function (e) {
10        $("body").toggleClass("mobile-nav-open");
11        e.preventDefault();
12      });
13
14      $("#mobile-nav .sub-menu").prepend(
15        '<div class="sub-menu-back-btn">' + ws.menu_back + "</div>"
16      );
17      $(function () {
18        $("#mobile-nav .menu-item-has-children > a").on("click", function (ea) {
19          ea.preventDefault();
20        });
21
22        var rwdMenu = $("#mobile-nav"),
23          topMenu = $("#mobile-nav > li > a"),
24          subMenu = $("#mobile-nav > li li > a"),
25          parentLi = $("#mobile-nav > li"),
26          parentSubLi = $("#mobile-nav > li li"),
27          backBtn = $(".sub-menu-back-btn");
28
29        topMenu.on("click", function (e) {
30          var thisTopMenu = $(this).parent(); // current $this
31
32          rwdMenu.addClass("rwd-menu-view");
33          thisTopMenu.addClass("open-submenu");
34        });
35
36        subMenu.on("click", function (e) {
37          var thisSubMenu = $(this).parent(); // current $this
38          thisSubMenu.addClass("open-submenu");
39        });
40
41        backBtn.click(function () {
42          var thisBackBtn = $(this);
43          $(this).parent().closest(".open-submenu").removeClass("open-submenu");
44          rwdMenu.removeClass("rwd-menu-view");
45        });
46
47        $(".menu-item-has-children a").on("click", function () {
48          var newHeight = $(this).parent().find(".sub-menu").height();
49          $(".mobile-navigation-list").animate({ height: newHeight }, 400);
50          console.log("Child height " + newHeight);
51        });
52        $(".sub-menu-back-btn").on("click", function () {
53          var newHeighta = $(this).closest("li").parent().height();
54          console.log("Parent height " + newHeighta);
55          $(".mobile-navigation-list").animate({ height: newHeighta }, 400);
56        });
57      });
58
59      $(":checkbox").attr("autocomplete", "off");
60
61      $("#login-tabs a").click(function (e) {
62        e.preventDefault();
63
64        // add class to tab
65        $("#login-tabs li").removeClass("active");
66        $(this).parent().addClass("active");
67        // show the right tab
68        $(".tab-content").hide();
69        $($(this).attr("href")).show();
70        return false;
71      });
72
73      if ($("body").hasClass("tax-job_listing_tag")) {
74        $(".job_listings.job-list").addClass("new-layout");
75      }
76      $(".cart-in-header").hoverIntent({
77        sensitivity: 3,
78        interval: 60,
79        over: function () {
80          $(".cart-list", this).fadeIn(200);
81          $(".cart-btn a.button", this).addClass("hovered");
82        },
83        timeout: 220,
84        out: function () {
85          $(".cart-list", this).fadeOut(100);
86          $(".cart-btn a.button", this).removeClass("hovered");
87        },
88      });
89
90      $(".search_keywords #search_keywords").change(function () {
91        $(".sidebar #search_keywords").val($(this).val());
92      });
93
94      /*----------------------------------------------------*/
95      /*  Elementor Smooth Loading
96    /*----------------------------------------------------*/
97      $(document).ready(function () {
98        $(".intro-banner").after(
99          '<div class="search-banner-placeholder"><div class="search-banner-placeholder-loader"></div></div>'
100        );
101        setTimeout(function () {
102          $("body").addClass("theme-loaded");
103          $(".search-banner-placeholder").fadeOut();
104        }, 1100);
105      });
106
107      $(window).on("load", function () {
108        $("body").addClass("theme-loaded");
109        $(".search-banner-placeholder").fadeOut();
110      });
111
112      /*----------------------------------------------------*/
113      /*  Navigation
114    /*----------------------------------------------------*/
115      if ($("header#main-header").hasClass("full-width")) {
116        $("header#main-header").attr("data-full", "yes");
117      }
118      if ($("header#main-header").hasClass("alternative")) {
119        $("header#main-header").attr("data-alt", "yes");
120      }
121      function menumobile() {
122        var winWidth = $(window).width();
123
124        if (winWidth < 973) {
125          $("#navigation").removeClass("menu");
126          $("#navigation li").removeClass("dropdown");
127          $("header#main-header").removeClass("full-width");
128          $("#navigation").superfish("destroy");
129        } else {
130          $("#navigation").addClass("menu");
131          if ($("header#main-header").data("full") === "yes") {
132            $("header#main-header").addClass("full-width");
133          }
134          $("#navigation").superfish({
135            delay: 300, // one second delay on mouseout
136            animation: { opacity: "show" }, // fade-in and slide-down animation
137            speed: 200, // animation speed
138            speedOut: 50, // out animation speed
139          });
140        }
141        if (winWidth < ws.header_breakpoint) {
142          $("header#main-header")
143            .addClass("alternative")
144            .removeClass("full-width");
145        } else {
146          if ($("header#main-header").data("alt") === "yes") {
147          } else {
148            $("header#main-header").removeClass("alternative");
149          }
150        }
151      }
152
153      // $(window).resize(function (){
154      //     menumobile();
155      // });
156      // menumobile();
157
158      $(window).load(function () {
159        var $mascontainer = $(
160          ".recent-blog-posts.masonry, .woo_pricing_tables"
161        );
162        $mascontainer.isotope({
163          itemSelector: ".recent-blog, .plan",
164          layoutMode: "fitRows",
165        });
166      });
167
168      $(".workscout-signup-popup .modal-register-link").on(
169        "click",
170        function (e) {
171          e.preventDefault();
172          var magnificPopup = $.magnificPopup.instance;
173          if (magnificPopup) {
174            magnificPopup.close();
175          }
176          window.setTimeout(function () {
177            $(".register-btn").trigger("click");
178          }, 500);
179        }
180      );
181
182      $(".my-account.static-login-page .modal-register-link").on(
183        "click",
184        function (e) {
185          e.preventDefault();
186          $(".tabs-nav.login-tabs li:last-child a").trigger("click");
187        }
188      );
189
190      $(".workscout_form").on("click", ".modal-login-link", function (e) {
191        e.preventDefault();
192        var magnificPopup = $.magnificPopup.instance;
193        if (magnificPopup) {
194          magnificPopup.close();
195        }
196        window.setTimeout(function () {
197          $(".login-btn").trigger("click");
198        }, 500);
199      });
200
201      /*----------------------------------------------------*/
202      /* Panel Dropdown
203  /*----------------------------------------------------*/
204      function close_panel_dropdown() {
205        $(".panel-dropdown").removeClass("active");
206        $(".fs-inner-container.content").removeClass("faded-out");
207      }
208
209      $(".panel-dropdown a").on("click", function (e) {
210        if ($(this).parent().is(".active")) {
211          close_panel_dropdown();
212        } else {
213          close_panel_dropdown();
214          $(this).parent().addClass("active");
215          $(".fs-inner-container.content").addClass("faded-out");
216        }
217
218        e.preventDefault();
219      });
220
221      // Apply / Close buttons
222      $(".panel-buttons button,.panel-buttons span.panel-cancel").on(
223        "click",
224        function (e) {
225          $(".panel-dropdown").removeClass("active");
226          $(".fs-inner-container.content").removeClass("faded-out");
227        }
228      );
229
230      // Closes dropdown on click outside the conatainer
231      var mouse_is_inside = false;
232
233      $(".panel-dropdown").hover(
234        function () {
235          mouse_is_inside = true;
236        },
237        function () {
238          mouse_is_inside = false;
239        }
240      );
241
242      $("body").mouseup(function () {
243        if (!mouse_is_inside) close_panel_dropdown();
244      });
245      //   /*  User Menu */
246      //   $('.user-menu').on('click', function(){
247      //   $(this).toggleClass('active');
248      // });
249
250      //   var jPanelMenu = $.jPanelMenu({
251      //     menu: '#responsive',
252      //     animated: false,
253      //     duration: 200,
254      //     keyboardShortcuts: false,
255      //     closeOnContentClick: true
256      //   });
257
258      // // desktop devices
259      //   $('.menu-trigger').on('click',function(){
260      //     var jpm = $(this);
261
262      //     if( jpm.hasClass('active') )
263      //     {
264      //       jPanelMenu.off();
265      //       jpm.removeClass('active');
266      //     }
267      //     else
268      //     {
269      //       jPanelMenu.on();
270      //       jPanelMenu.open();
271      //       jpm.addClass('active');
272      //     }
273      //     return false;
274      //   });
275
276      //   // Removes SuperFish Styles
277      //   $('#jPanelMenu-menu').removeClass('sf-menu');
278      //   $('#jPanelMenu-menu li ul').removeAttr('style');
279
280      //   $(window).resize(function (){
281      //     var winWidth = $(window).width();
282      //     var jpmactive = $('.menu-trigger');
283      //     if(winWidth>990) {
284      //       jPanelMenu.off();
285      //       jpmactive.removeClass('active');
286      //     }
287      //   });
288
289      var pixelRatio = !!window.devicePixelRatio ? window.devicePixelRatio : 1;
290      $(window).on("load", function () {
291        if (pixelRatio > 1) {
292          if (ws.retinalogo) {
293            $("header:not(.transparent) #logo img").attr("src", ws.retinalogo);
294          }
295          if (ws.transparentretinalogo) {
296            $("header.transparent:not(.cloned) #logo img").attr(
297              "src",
298              ws.transparentretinalogo
299            );
300            $(
301              "#wrapper:not(.wrapper-with-transparent-header) #header:not(.cloned) #logo img"
302            ).attr("src", ws.retinalogo);
303          }
304        } else {
305          $("header:not(.transparent) #logo img").attr("src", ws.logo);
306          $("header.transparent:not(.cloned) #logo img").attr(
307            "src",
308            ws.transparentlogo
309          );
310          $(
311            "#wrapper.wrapper-with-transparent-header #header:not(.cloned) #logo img"
312          ).attr("src", ws.transparentlogo);
313          $(
314            "#wrapper:not(.wrapper-with-transparent-header) #header:not(.cloned) #logo img"
315          ).attr("src", ws.logo);
316        }
317      });
318
319      $(window).bind("load resize", function () {
320        var winWidth = $(window).width();
321        if (winWidth < 1290) {
322          $(".sticky-header.cloned").remove();
323        }
324      });
325
326      /*----------------------------------------------------*/
327      /*  Stacktable / Responsive Tables Plug-in
328    /*----------------------------------------------------*/
329      $(".shop_table,.responsive-table").stacktable();
330
331      $(".small-only input.input-text.qty.text").on("change", function () {
332        var value = $(this).val();
333        var name = $(this).attr("name");
334        $(".large-only")
335          .find(".quantity.buttons_added .qty[name*='" + name + "']")
336          .val(value);
337      });
338
339      /*----------------------------------------------------*/
340      /*  Back to Top
341    /*----------------------------------------------------*/
342      var pxShow = 400; // height on which the button will show
343      var fadeInTime = 400; // how slow / fast you want the button to show
344      var fadeOutTime = 400; // how slow / fast you want the button to hide
345      var scrollSpeed = 400; // how slow / fast you want the button to scroll to top.
346
347      $(window).scroll(function () {
348        if ($(window).scrollTop() >= pxShow) {
349          $("#backtotop").fadeIn(fadeInTime);
350        } else {
351          $("#backtotop").fadeOut(fadeOutTime);
352        }
353      });
354
355      $("#backtotop a").on("click", function () {
356        $("html, body").animate({ scrollTop: 0 }, scrollSpeed);
357        return false;
358      });
359
360      /*----------------------------------------------------*/
361      /*  Showbiz Carousel
362    // /*----------------------------------------------------*/
363
364      $(".job-spotlight-car").slick({
365        infinite: true,
366        speed: 500,
367        centerPadding: "20px",
368        //slidesToShow: 2,
369        adaptiveHeight: true,
370      });
371
372      $(".related-job-spotlight-car").slick({
373        centerPadding: "20px",
374        slidesToShow: 2,
375        responsive: [
376          {
377            breakpoint: 1367,
378            settings: {
379              centerPadding: "15%",
380            },
381          },
382          {
383            breakpoint: 1025,
384            settings: {
385              centerPadding: "0",
386            },
387          },
388          {
389            breakpoint: 767,
390            settings: {
391              centerPadding: "0",
392              slidesToShow: 1,
393            },
394          },
395        ],
396      });
397
398      $("#our-clients").slick({
399        slidesToShow: 6,
400        slidesToScroll: 4,
401      });
402
403      /*----------------------------------------------------*/
404      /*  Flexslider
405    /*----------------------------------------------------*/
406      $(".testimonials-slider").flexslider({
407        animation: "fade",
408        controlsContainer: $(".custom-controls-container"),
409        customDirectionNav: $(".custom-navigation a"),
410      });
411
412      /*----------------------------------------------------*/
413      /*  Counters
414    /*----------------------------------------------------*/
415
416      $(".counter").counterUp({
417        delay: 10,
418        time: 800,
419      });
420
421      /*----------------------------------------------------*/
422      /*  Magnific Popup
423    /*----------------------------------------------------*/
424
425      $("body").magnificPopup({
426        type: "image",
427        delegate: "a.mfp-gallery",
428
429        fixedContentPos: true,
430        fixedBgPos: true,
431
432        overflowY: "auto",
433
434        closeBtnInside: true,
435        preloader: true,
436
437        removalDelay: 0,
438        mainClass: "mfp-fade",
439
440        gallery: { enabled: true },
441
442        callbacks: {
443          buildControls: function () {
444            this.contentContainer.append(this.arrowLeft.add(this.arrowRight));
445          },
446        },
447      });
448
449      $(document).on(
450        "submit",
451        ".small-dialog-content.woo-reg-box form.login, .small-dialog-content.woo-reg-box form.register",
452        function (e) {
453          var form = $(this);
454          var error = false;
455
456          var base = $(this).serialize();
457          var button = $(this).find("input[type=submit]");
458
459          $(button).css("backgroundColor", "#ddd");
460          var data = base + "&" + button.attr("name") + "=" + button.val();
461
462          var $response = $("#ajax-response");
463
464          var request = $.ajax({
465            url: ws.woo_account_page,
466            data: data,
467            type: "POST",
468            cache: false,
469            async: false,
470            success: function (response) {
471              form.find($(".woocommerce-error")).remove();
472
473              var $response = $("#ajax_response");
474              var html = $.parseHTML(response);
475
476              $response.append(html);
477              error = $response.find($(".woocommerce-error"));
478
479              $(button).css("backgroundColor", ws.theme_color);
480              if (error.length > 0) {
481                form.prepend(error.clone());
482                $response.html("");
483                e.preventDefault();
484              } else {
485                if (form.hasClass("register")) {
486                  window.location.href = ws.woo_account_page;
487                  e.preventDefault();
488                  return false;
489                } else {
490                  document.location.href = ws.woo_account_page;
491                }
492              }
493            },
494          });
495        }
496      );
497
498      $(".popup-with-zoom-anim").magnificPopup({
499        type: "inline",
500
501        fixedContentPos: false,
502        fixedBgPos: true,
503
504        overflowY: "auto",
505
506        closeBtnInside: true,
507        preloader: false,
508
509        midClick: true,
510        removalDelay: 300,
511        mainClass: "my-mfp-zoom-in",
512
513        prependTo: "#wrapper",
514
515        callbacks: {
516          open: function() {
517            var $popup = $(this.content);
518            if ($popup.find("#milestone-percentage").length) {
519              $popup.find("#milestone-percentage").bootstrapSlider({
520                formatter: function (value) {
521                  return value + "%";
522                },
523              });
524              var projectValue = parseFloat(
525                $("#milestone-form").data("project-budget")
526              );
527              var amount = (projectValue * 5) / 100;
528              $("#amount-preview").text(amount);
529            }
530            if ($popup.find("#edit-milestone-percentage").length) {
531              $popup.find("#edit-milestone-percentage").bootstrapSlider({
532                formatter: function (value) {
533                  return value + "%";
534                },
535              });
536              var projectValue = parseFloat(
537                $("#milestone-form").data("project-budget")
538              );
539              var amount = (projectValue * 5) / 100;
540              $("#amount-preview").text(amount);
541            }
542
543            // Destroy existing tippy instances in the popup
544            const popupContent = this.content[0];
545            const existingTippyElements = popupContent.querySelectorAll(
546              "[data-tippy-placement]"
547            );
548            existingTippyElements.forEach((element) => {
549              if (element._tippy) {
550                element._tippy.destroy();
551              }
552            });
553
554            tippy("[data-tippy-placement]", {
555              // Your tippy configuration options
556              placement: "top",
557              arrow: true,
558              animation: "fade",
559              appendTo: document.body, // This ensures tooltips aren't confined to popup
560              zIndex: 11000, // Set higher than Magnific Popup's z-index (10001)
561            });
562          }
563        }
564      });
565
566      $(".full-page-job-container").magnificPopup({
567        type: "inline",
568        delegate: "a.popup-with-zoom-anim",
569        fixedContentPos: false,
570        fixedBgPos: true,
571
572        overflowY: "auto",
573
574        closeBtnInside: true,
575        preloader: false,
576        midClick: true,
577        removalDelay: 300,
578        mainClass: "my-mfp-zoom-in",
579
580        prependTo: "#wrapper",
581      });
582
583      $(".mfp-image").magnificPopup({
584        type: "image",
585        closeOnContentClick: true,
586        mainClass: "mfp-fade",
587        image: {
588          verticalFit: true,
589        },
590      });
591
592      $(".popup-youtube, .popup-vimeo, .popup-gmaps").magnificPopup({
593        disableOn: 700,
594        type: "iframe",
595        mainClass: "mfp-fade",
596        removalDelay: 160,
597        preloader: false,
598
599        fixedContentPos: false,
600      });
601
602      var hash = window.location.hash;
603      console.log(hash);
604      if (hash == "#apply-dialog") {
605        $(".small-dialog.popup-with-zoom-anim.apply-dialog-button").trigger(
606          "click"
607        );
608      }
609
610      var listing_gallery_grid_popup;
611      $("#single-listing-grid-gallery-popup").on("click", function (e) {
612        e.preventDefault();
613
614        // Get the JSON-encoded data from the data attribute
615        var imageData = $(this).data("gallery");
616
617        // Create an array to hold the gallery items
618        var items = [];
619
620        // Loop through the JSON data and create Magnific Popup items
621        $.each(imageData, function (index, image) {
622          console.log(image);
623          items.push({
624            src: image,
625            //title: image.title,
626          });
627        });
628
629        // Open Magnific Popup with the gallery items
630        $.magnificPopup.open({
631          items: items,
632          type: "image", // Specify the type of content (image, iframe, inline, etc.)
633          fixedContentPos: true,
634          fixedBgPos: true,
635
636          overflowY: "auto",
637
638          closeBtnInside: false,
639          preloader: true,
640
641          removalDelay: 0,
642          mainClass: "mfp-fade",
643
644          gallery: { enabled: true, tCounter: "" },
645        });
646        listing_gallery_grid_popup = $.magnificPopup.instance;
647      });
648
649      $("a.slg-gallery-img").on("click", function (e) {
650        e.preventDefault();
651        $("#single-listing-grid-gallery-popup").trigger("click");
652        var index = $(this).data("grid-start-index");
653        listing_gallery_grid_popup.goTo(index);
654      });
655
656      /*---------------------------------------------------*/
657      /*  Contact Form
658    /*---------------------------------------------------*/
659
660      //reset previously set border colors and hide all comment on .keyup()
661      $("#contactform input, #contactform textarea").keyup(function () {
662        $("#contactform input, #contactform textarea").removeClass("error");
663        $("#result").slideUp();
664      });
665
666      /*----------------------------------------------------*/
667      /*  Accordions
668    /*----------------------------------------------------*/
669
670      var $accor = $(".accordion");
671
672      $accor.each(function () {
673        $(this).find("div").hide().first().show();
674        $(this).find("h3").first().addClass("active-acc");
675      });
676
677      var $trigger = $accor.find("h3");
678
679      $trigger.on("click", function (e) {
680        var location = $(this).parent();
681
682        if ($(this).next().is(":hidden")) {
683          var $triggerloc = $("h3", location);
684          $triggerloc.removeClass("active-acc").next().slideUp(300);
685          $(this).addClass("active-acc").next().slideDown(300);
686        }
687        e.preventDefault();
688      });
689
690      /*----------------------------------------------------*/
691      /*  Application Tabs
692    /*----------------------------------------------------*/
693      // Get all the links.
694      var link = $(".app-link");
695      $(".close-tab").hide();
696
697      $(".app-tabs div.app-tab-content").hide();
698      // On clicking of the links do something.
699      link.on("click", function (e) {
700        e.preventDefault();
701        $(this).parents("div.application").find(".close-tab").fadeOut();
702        if ($(this).hasClass("opened")) {
703          $(this)
704            .parents("div.application")
705            .find(".app-tabs div.app-tab-content")
706            .slideUp("fast");
707          $(this).parents("div.application").find(".close-tab").fadeOut(10);
708          $(this).removeClass("opened");
709        } else {
710          $(this)
711            .parents("div.application")
712            .find(".app-link")
713            .removeClass("opened");
714          $(this).addClass("opened");
715          var a = $(this).attr("href");
716          $(this)
717            .parents("div.application")
718            .find(a)
719            .slideDown("fast")
720            .removeClass("closed")
721            .addClass("opened");
722          $(this).parents("div.application").find(".close-tab").fadeIn(10);
723        }
724
725        $(this)
726          .parents("div.application")
727          .find(".app-tabs div.app-tab-content")
728          .not(a)
729          .slideUp("fast")
730          .addClass("closed")
731          .removeClass("opened");
732      });
733
734      $(".close-tab").on("click", function (e) {
735        $(this).fadeOut();
736        e.preventDefault();
737        $(this)
738          .parents("div.application")
739          .find(".app-link")
740          .removeClass("opened");
741        $(this)
742          .parents("div.application")
743          .find(".app-tabs div.app-tab-content")
744          .slideUp("fast")
745          .addClass("closed")
746          .removeClass("opened");
747      });
748
749      /*----------------------------------------------------*/
750      /*  Add Resume 
751    /*----------------------------------------------------*/
752      $(".box-to-clone").hide();
753      $(".add-box").on("click", function (e) {
754        e.preventDefault();
755        var newElem = $(this).parent().find(".box-to-clone:first").clone();
756        newElem.find("input").val("");
757        newElem.prependTo($(this).parent()).show();
758        var height = $(this).prev(".box-to-clone").outerHeight(true);
759
760        $("html, body")
761          .stop()
762          .animate({ scrollTop: $(this).offset().top - height }, 600);
763      });
764
765      $("body").on("click", ".remove-box", function (e) {
766        e.preventDefault();
767        $(this).parent().remove();
768      });
769
770      $(".stars a")
771        .on("click", function () {
772          $(".stars a").removeClass("prevactive");
773          $(this).prevAll().addClass("prevactive");
774        })
775        .hover(
776          function () {
777            $(".stars a").removeClass("prevactive");
778            $(this).addClass("prevactive").prevAll().addClass("prevactive");
779          },
780          function () {
781            $(".stars a").removeClass("prevactive");
782            $(".stars a.active").prevAll().addClass("prevactive");
783          }
784        );
785
786      /*----------------------------------------------------*/
787      /*  Tabs
788    /*----------------------------------------------------*/
789      var $tabsNav = $(".tabs-nav,.vc_tta-tabs-list"),
790        $tabsNavLis = $tabsNav.children("li");
791      // $tabContent = $('.tab-content');
792
793      $tabsNav.each(function () {
794        var $this = $(this);
795
796        $this
797          .next()
798          .children(".tab-content")
799          .stop(true, true)
800          .hide()
801          .first()
802          .show();
803
804        $this.children("li").first().addClass("active").stop(true, true).show();
805      });
806
807      $tabsNavLis.on("click", function (e) {
808        var $this = $(this);
809
810        $this.siblings().removeClass("active").end().addClass("active");
811
812        $this
813          .parent()
814          .next()
815          .children(".tab-content")
816          .stop(true, true)
817          .hide()
818          .siblings($this.find("a").attr("href"))
819          .fadeIn();
820
821        e.preventDefault();
822      });
823
824      var hash = window.location.hash;
825      console.log(hash);
826      var anchor = $('.tabs-nav a[href="' + hash + '"]');
827      if (anchor.length === 0) {
828      } else {
829        $(".tab-content").hide();
830        anchor.trigger("click");
831        $(hash + ".tab-content").show();
832      }
833
834      $("#login-tabs a").click(function (e) {
835        e.preventDefault();
836        // add class to tab
837        $("#login-tabs li").removeClass("active");
838        $(this).parent().addClass("active");
839        // show the right tab
840        $(" .tab-content").hide();
841        $($(this).attr("href")).show();
842        return false;
843      });
844
845      /*remove empty tags*/
846      $("p").each(function () {
847        var $this = $(this);
848        if ($this.html().replace(/\s|&nbsp;/g, "").length === 0)
849          $this.addClass("pfix").html("");
850      });
851
852      $(".ws-file-upload").change(function () {
853        var filename = [];
854        $.each($(this).prop("files"), function (k, v) {
855          filename.push(
856            '<span class="job-manager-uploaded-file-name">' +
857              v["name"] +
858              "</span> "
859          );
860        });
861
862        $(this).prev(".job-manager-uploaded-files").html(filename);
863      });
864
865      /*----------------------------------------------------*/
866      /*  Sliding In-Out Content
867    /*----------------------------------------------------*/
868
869      $(window).bind("load resize scroll", function (e) {
870        var headerElem = $(".parallax .search-container");
871
872        // flying out and fading for header content
873        $(headerElem).css({
874          transform: "translateY(" + $(window).scrollTop() / -9 + "px)",
875        });
876        // $(headerElem).css({ 'opacity': 1 - $(window).scrollTop() / 600 });
877      });
878
879      /*----------------------------------------------------*/
880      /*  Parallax
881    /*----------------------------------------------------*/
882      /* detect touch */
883      if ("ontouchstart" in window) {
884        document.documentElement.className =
885          document.documentElement.className + " touch";
886      }
887      if (!$("html").hasClass("touch")) {
888        /* background fix */
889        $(".parallax").css("background-attachment", "fixed");
890      }
891
892      /* fix vertical when not overflow
893    call fullscreenFix() if .fullscreen content changes */
894      function fullscreenFix() {
895        var h = $("body").height();
896        // set .fullscreen height
897        $(".parallax-content").each(function (i) {
898          if ($(this).innerHeight() > h) {
899            $(this).closest(".fullscreen").addClass("overflow");
900          }
901        });
902      }
903      $(window).resize(fullscreenFix);
904      fullscreenFix();
905
906      /* resize background images */
907      function backgroundResize() {
908        var windowH = $(window).height();
909        var winWidth = $(window).width();
910        var userAgent = navigator.userAgent || navigator.vendor || window.opera;
911        var ios = false;
912
913        if (
914          userAgent.match(/iPad/i) ||
915          userAgent.match(/iPhone/i) ||
916          userAgent.match(/iPod/i)
917        ) {
918          ios = true;
919        }
920        if (ios == true) {
921          $(".background").each(function (i) {
922            $(this).addClass("mobilebg");
923          });
924          console.log("are we here IOS?");
925        } else if (winWidth > 1023) {
926          $(".background").each(function (i) {
927            var path = $(this);
928            $(this).removeClass("mobilebg");
929            // variables
930            var contW = path.width();
931            var contH = path.height();
932            var imgW = path.attr("data-img-width");
933            var imgH = path.attr("data-img-height");
934            var ratio = imgW / imgH;
935            // overflowing difference
936            var diff = parseFloat(path.attr("data-diff"));
937            diff = diff ? diff : 0;
938            // remaining height to have fullscreen image only on parallax
939            var remainingH = 0;
940            if (path.hasClass("parallax") && !$("html").hasClass("touch")) {
941              var maxH = contH > windowH ? contH : windowH;
942              remainingH = windowH - contH;
943            }
944            // set img values depending on cont
945            imgH = contH + remainingH + diff;
946            imgW = imgH * ratio;
947            // fix when too large
948            if (contW > imgW) {
949              imgW = contW;
950              imgH = imgW / ratio;
951            }
952            //
953            path.data("resized-imgW", imgW);
954            path.data("resized-imgH", imgH);
955            path.css("background-size", imgW + "px " + imgH + "px");
956          });
957        }
958      }
959      $(window).resize(backgroundResize);
960      $(window).focus(backgroundResize);
961      backgroundResize();
962
963      /* set parallax background-position */
964      function parallaxPosition(e) {
965        var winWidth = $(window).width();
966        var userAgent = navigator.userAgent || navigator.vendor || window.opera;
967        var ios = false;
968        if (
969          userAgent.match(/iPad/i) ||
970          userAgent.match(/iPhone/i) ||
971          userAgent.match(/iPod/i)
972        ) {
973          ios = true;
974        }
975        if (winWidth > 1023 || ios == false) {
976          var heightWindow = $(window).height();
977          var topWindow = $(window).scrollTop();
978          var bottomWindow = topWindow + heightWindow;
979          var currentWindow = (topWindow + bottomWindow) / 2;
980          $(".parallax").each(function (i) {
981            var path = $(this);
982            var height = path.height();
983            var top = path.offset().top;
984            var bottom = top + height;
985            // only when in range
986            if (bottomWindow > top && topWindow < bottom) {
987              var imgW = path.data("resized-imgW");
988              var imgH = path.data("resized-imgH");
989              // min when image touch top of window
990              var min = 0;
991              // max when image touch bottom of window
992              var max = -imgH + heightWindow;
993              // overflow changes parallax
994              var overflowH =
995                height < heightWindow ? imgH - height : imgH - heightWindow; // fix height on overflow
996              top = top - overflowH;
997              bottom = bottom + overflowH;
998              // value with linear interpolation
999              var value =
1000                -100 +
1001                min +
1002                ((max - min) * (currentWindow - top)) / (bottom - top);
1003              // set background-position
1004              var orizontalPosition = path.attr("data-oriz-pos");
1005              orizontalPosition = orizontalPosition ? orizontalPosition : "50%";
1006              $(this).css(
1007                "background-position",
1008                orizontalPosition + " " + value + "px"
1009              );
1010            }
1011          });
1012        }
1013      }
1014      if (!$("html").hasClass("touch")) {
1015        $(window).resize(parallaxPosition);
1016        //$(window).focus(parallaxPosition);
1017        $(window).scroll(parallaxPosition);
1018        parallaxPosition();
1019      }
1020
1021      /*----------------------------------------------------*/
1022      /*  Sticky Header 
1023    /*----------------------------------------------------*/
1024      if ($("header#main-header").hasClass("sticky-header")) {
1025        $(".sticky-header")
1026          .clone(true)
1027          .addClass("cloned")
1028          .insertAfter(".sticky-header");
1029
1030        $(".sticky-header.cloned.transparent #logo a img").attr("src", ws.logo);
1031        $(".sticky_new.cloned #logo a img").attr("src", ws.logo);
1032        $(".sticky-header.cloned.alternative").removeClass("alternative");
1033        $(".sticky-header.cloned .popup-with-zoom-anim").magnificPopup({
1034          type: "inline",
1035
1036          fixedContentPos: false,
1037          fixedBgPos: true,
1038
1039          overflowY: "auto",
1040
1041          closeBtnInside: true,
1042          preloader: false,
1043
1044          midClick: true,
1045          removalDelay: 300,
1046          mainClass: "my-mfp-zoom-in",
1047        });
1048
1049        var stickyHeader = document.querySelector(".sticky-header.cloned");
1050
1051        var headroom = new Headroom(stickyHeader, {
1052          offset: $(".sticky-header").height(),
1053          tolerance: 0,
1054        });
1055        $(".sticky-header.cloned").find("#signup-dialog").remove();
1056        $(".sticky-header.cloned").find("#login-dialog").remove();
1057
1058        // disabling on mobile
1059        $(window).bind("load resize", function (e) {
1060          $(".sticky-header.cloned").removeClass("transparent alternative");
1061
1062          var winWidth = $(window).width();
1063
1064          if (winWidth > ws.header_breakpoint) {
1065            headroom.init();
1066          } else if (winWidth < ws.header_breakpoint) {
1067            headroom.destroy();
1068          }
1069        });
1070      }
1071
1072      $(".small-only #coupon_code").on("change", function () {
1073        var value = $(this).val();
1074        var name = $(this).attr("name");
1075        $(".large-only")
1076          .find("input[name*='" + name + "']")
1077          .val(value);
1078      });
1079
1080      $(".large-only #coupon_code").on("change", function () {
1081        var value = $(this).val();
1082        var name = $(this).attr("name");
1083        $(".small-only")
1084          .find("input[name*='" + name + "']")
1085          .val(value);
1086      });
1087
1088      /* move related jobs after job details*/
1089      var winWidth = $(window).width();
1090      if (winWidth < 768) {
1091        $("#related-job-container").detach().appendTo("#job-details");
1092      }
1093
1094      // v1.5
1095
1096      /*----------------------------------------------------*/
1097      /*  Slick Carousel
1098    /*----------------------------------------------------*/
1099      $(".testimonial-carousel").slick({
1100        centerMode: true,
1101        centerPadding: "34%",
1102        slidesToShow: 1,
1103
1104        dots: false,
1105        arrows: false,
1106        responsive: [
1107          {
1108            breakpoint: 1025,
1109            settings: {
1110              centerPadding: "10px",
1111              slidesToShow: 2,
1112            },
1113          },
1114          {
1115            breakpoint: 767,
1116            settings: {
1117              centerPadding: "10px",
1118              slidesToShow: 1,
1119            },
1120          },
1121        ],
1122      });
1123
1124      /*----------------------------------------------------*/
1125      /*  Flip Banner
1126    /*----------------------------------------------------*/
1127      function flipBanner() {
1128        $(".flip-banner").prepend('<div class="flip-banner-overlay"></div>');
1129
1130        $(".flip-banner").each(function () {
1131          var attrImage = $(this).attr("data-background");
1132          var attrColor = $(this).attr("data-color");
1133          var attrOpacity = $(this).attr("data-color-opacity");
1134
1135          if (attrImage !== undefined) {
1136            $(this).css("background-image", "url(" + attrImage + ")");
1137          }
1138
1139          if (attrColor !== undefined) {
1140            $(this)
1141              .find(".flip-banner-overlay")
1142              .css("background-color", "" + attrColor + "");
1143          }
1144
1145          if (attrOpacity !== undefined) {
1146            $(this)
1147              .find(".flip-banner-overlay")
1148              .css("opacity", "" + attrOpacity + "");
1149          }
1150        });
1151      }
1152      flipBanner();
1153
1154      /*----------------------------------------------------*/
1155      /*  Image Box
1156    /*----------------------------------------------------*/
1157      $(".img-box").each(function () {
1158        $(this).append('<div class="img-box-background"></div>');
1159        $(this)
1160          .children(".img-box-background")
1161          .css({
1162            "background-image":
1163              "url(" + $(this).attr("data-background-image") + ")",
1164          });
1165      });
1166
1167      /*----------------------------------------------------*/
1168      /*  Auto Header Padding
1169    /*----------------------------------------------------*/
1170      $(window).on("load resize", function () {
1171        var headerHeight = $(".dashboard-header").height();
1172        $("#dashboard").css("padding-top", headerHeight);
1173      });
1174
1175      $(window).on("load resize", function () {
1176        var headerHeightTwo = $("#header").height();
1177        $(".page-template-template-tasks-fullpage #wrapper").css(
1178          "padding-top",
1179          headerHeightTwo
1180        );
1181      });
1182
1183      /*----------------------------------------------------*/
1184      /*  Counters
1185    /*----------------------------------------------------*/
1186      // $(window).on('load', function() {
1187      //     $('.dashboard-stat-content h4').counterUp({
1188      //         delay: 100,
1189      //         time: 800
1190      //     });
1191      // });
1192
1193      /*----------------------------------------------------*/
1194      /* Dashboard Scripts
1195    /*----------------------------------------------------*/
1196
1197      // Dashboard Nav Submenus
1198      $(".dashboard-nav ul li a").on("click", function (e) {
1199        if ($(this).closest("li").children("ul").length) {
1200          if ($(this).closest("li").is(".active-submenu")) {
1201            $(".dashboard-nav ul li").removeClass("active-submenu");
1202          } else {
1203            $(".dashboard-nav ul li").removeClass("active-submenu");
1204            $(this).parent("li").addClass("active-submenu");
1205          }
1206          e.preventDefault();
1207        }
1208      });
1209
1210      // Dashbaord Nav Scrolling
1211      $(window).on("load resize", function () {
1212        var wrapperHeight = window.innerHeight;
1213        var headerHeight = $("#header-container").height();
1214        var winWidth = $(window).width();
1215
1216        if (winWidth > 992) {
1217          $(".dashboard-nav-inner").css(
1218            "max-height",
1219            wrapperHeight - headerHeight
1220          );
1221        } else {
1222          $(".dashboard-nav-inner").css("max-height", "");
1223        }
1224      });
1225
1226      // Responsive Nav Trigger
1227      $(".dashboard-responsive-nav-trigger").on("click", function (e) {
1228        e.preventDefault();
1229        $(this).toggleClass("active");
1230
1231        var dashboardNavContainer = $("body").find(".dashboard-nav");
1232
1233        if ($(this).hasClass("active")) {
1234          $(dashboardNavContainer).addClass("active");
1235        } else {
1236          $(dashboardNavContainer).removeClass("active");
1237        }
1238      });
1239
1240      /*----------------------------------------------------*/
1241      /* V2 Update
1242    /*----------------------------------------------------*/
1243
1244      /*--------------------------------------------------*/
1245      /*  Sticky Header
1246    /*--------------------------------------------------*/
1247      function stickyHeaderOther() {
1248        if ($("#header-container").hasClass("sticky_new")) {
1249          $(window).on("scroll load", function () {
1250            if ($(window).width() < "1099") {
1251              $("#header-container").removeClass("cloned");
1252            }
1253
1254            if ($(window).width() > "1099") {
1255              // CSS adjustment
1256              $("#header-container").css({
1257                position: "fixed",
1258              });
1259
1260              var headerOffset = $("#header-container").height();
1261
1262              if ($(window).scrollTop() >= headerOffset) {
1263                $("#header-container").addClass("cloned");
1264                $(".wrapper-with-transparent-header #header-container")
1265                  .addClass("cloned")
1266                  .removeClass("transparent-header unsticky");
1267              } else {
1268                $("#header-container").removeClass("cloned");
1269                $(".wrapper-with-transparent-header #header-container")
1270                  .addClass("transparent-header unsticky")
1271                  .removeClass("cloned");
1272              }
1273
1274              if (
1275                $(
1276                  ".wrapper-with-transparent-header #header-container"
1277                ).hasClass("cloned")
1278              ) {
1279                $("#header-container.cloned #logo_nh img").attr("src", ws.logo);
1280              }
1281
1282              if (
1283                $(
1284                  ".wrapper-with-transparent-header #header-container"
1285                ).hasClass("transparent-header")
1286              ) {
1287                $("#header-container #logo_nh img").attr(
1288                  "src",
1289                  ws.transparentlogo
1290                );
1291              }
1292
1293              $(window).on("load resize", function () {
1294                var headerOffset = $("#header-container").height();
1295                $("#wrapper").css({ "padding-top": headerOffset });
1296              });
1297            }
1298          });
1299        }
1300      }
1301
1302      // Sticky Header Init
1303      stickyHeaderOther();
1304
1305      /*--------------------------------------------------*/
1306      /*  Transparent Header Spacer Adjustment
1307    /*--------------------------------------------------*/
1308      $(window).on("load resize", function () {
1309        var transparentHeaderHeight = $(".transparent-header").outerHeight();
1310        $(".transparent-header-spacer").css({
1311          height: transparentHeaderHeight,
1312        });
1313      });
1314
1315      /*--------------------------------------------------*/
1316      /*  Ripple Effect
1317    /*--------------------------------------------------*/
1318      $("body").on(
1319        "click",
1320        ".ripple-effect, .ripple-effect-dark",
1321        function (e) {
1322          //$(".ripple-effect, .ripple-effect-dark").on("click", function (e) {
1323          var rippleDiv = $('<span class="ripple-overlay">'),
1324            rippleOffset = $(this).offset(),
1325            rippleY = e.pageY - rippleOffset.top,
1326            rippleX = e.pageX - rippleOffset.left;
1327
1328          rippleDiv
1329            .css({
1330              top: rippleY - rippleDiv.height() / 2,
1331              left: rippleX - rippleDiv.width() / 2,
1332              // background: $(this).data("ripple-color");
1333            })
1334            .appendTo($(this));
1335
1336          window.setTimeout(function () {
1337            rippleDiv.remove();
1338          }, 800);
1339        }
1340      );
1341
1342      /*--------------------------------------------------*/
1343      /*  Header User Dropdown
1344    /*--------------------------------------------------*/
1345      window.header_menu = function () {
1346        $(".header-notifications").each(function () {
1347          var userMenu = $(this);
1348          var userMenuTrigger = $(this).find(".header-notifications-trigger a");
1349
1350          $(userMenuTrigger).on("click", function (event) {
1351            event.preventDefault();
1352
1353            if ($(this).closest(".header-notifications").is(".active")) {
1354              close_user_dropdown();
1355            } else {
1356              close_user_dropdown();
1357              userMenu.addClass("active");
1358            }
1359          });
1360        });
1361      };
1362      header_menu();
1363
1364      // Closing function
1365      function close_user_dropdown() {
1366        $(".header-notifications").removeClass("active");
1367      }
1368
1369      // Closes notification dropdown on click outside the conatainer
1370      var mouse_is_inside = false;
1371
1372      $(".header-notifications").on("mouseenter", function () {
1373        mouse_is_inside = true;
1374      });
1375      $(".header-notifications").on("mouseleave", function () {
1376        mouse_is_inside = false;
1377      });
1378
1379      $("body").mouseup(function () {
1380        if (!mouse_is_inside) close_user_dropdown();
1381      });
1382
1383      // Close with ESC
1384      $(document).keyup(function (e) {
1385        if (e.keyCode == 27) {
1386          close_user_dropdown();
1387        }
1388      });
1389
1390      /*----------------------------------------------------*/
1391      /*  Inline CSS replacement for backgrounds
1392    /*----------------------------------------------------*/
1393      function inlineBG() {
1394        // Common Inline CSS
1395        $(".single-page-header, .intro-banner").each(function () {
1396          var attrImageBG = $(this).attr("data-background-image");
1397
1398          if (attrImageBG !== undefined) {
1399            $(this).append('<div class="background-image-container"></div>');
1400            $(".background-image-container").css(
1401              "background-image",
1402              "url(" + attrImageBG + ")"
1403            );
1404          }
1405        });
1406      }
1407      inlineBG();
1408
1409      // Fix for intro banner with label
1410      $(".intro-search-field").each(function () {
1411        var bannerLabel = $(this).children("label").length;
1412        if (bannerLabel > 0) {
1413          $(this).addClass("with-label");
1414        }
1415      });
1416
1417      /*--------------------------------------------------*/
1418      /*  Full Screen Page Scripts
1419    /*--------------------------------------------------*/
1420      // Enabling Scrollbar
1421      function fullPageScrollbar() {
1422        $(".full-page-sidebar-inner, .dashboard-sidebar-inner").each(
1423          function () {
1424            var headerHeight = $("#header-container").outerHeight();
1425            var windowHeight = $(window).outerHeight() - headerHeight;
1426            var sidebarContainerHeight = $(this)
1427              .find(".sidebar-container, .dashboard-nav-container")
1428              .outerHeight();
1429
1430            // Enables scrollbar if sidebar is higher than wrapper
1431            if (sidebarContainerHeight > windowHeight) {
1432              $(this).css({ height: windowHeight });
1433            } else {
1434              $(this).find(".simplebar-track").hide();
1435            }
1436          }
1437        );
1438      }
1439
1440      // Init
1441      $(window).on("load resize", function () {
1442        wrapperHeight();
1443        fullPageScrollbar();
1444      });
1445      wrapperHeight();
1446      fullPageScrollbar();
1447
1448      // Wrapper Height (window height - header height)
1449      function wrapperHeight() {
1450        var headerHeight = $("#header-container").outerHeight();
1451        var windowHeight = $(window).outerHeight() - headerHeight;
1452        $(
1453          ".full-page-content-container-v2, .full-page-sidebar-v2, .full-page-content-container, .dashboard-content-container, .dashboard-sidebar-inner, .dashboard-container, .full-page-container"
1454        ).css({ height: windowHeight });
1455        $(".dashboard-content-inner").css({ "min-height": windowHeight });
1456      }
1457
1458      // Init
1459      $(window).on("load resize", function () {
1460        wrapperHeight();
1461        fullPageScrollbar();
1462      });
1463      wrapperHeight();
1464      fullPageScrollbar();
1465
1466      var rangeAttr = $("#search_radius").attr("data-slider-currency");
1467      $("#search_radius").bootstrapSlider({
1468        formatter: function (value) {
1469          return value + " " + rangeAttr;
1470        },
1471      });
1472
1473      // formatter: function (value) {
1474      //   return ThousandSeparator(parseInt(value)) + rangeAttr;
1475      // },
1476
1477      // $("#radius-range").slider({
1478      //   value: workscout_core.radius_default,
1479      //   min: 1,
1480      //   max: 800,
1481      //   step: 1,
1482      //   slide: function (event, ui) {
1483      //     $("input#radius_amount").val(ui.value);
1484      //     $(".radius_amount span").text(ui.value);
1485      //     // if(job_manager_ajax_filters.currency_postion === 'before') {
1486      //     //   $( ".salary_amount .from" ).text(job_manager_ajax_filters.currency+ui.values[ 0 ]);
1487      //     //   $( ".salary_amount .to" ).text(job_manager_ajax_filters.currency+ui.values[ 1 ]);
1488      //     // } else {
1489      //     //   $( ".salary_amount .from" ).text(ui.values[ 0 ]+job_manager_ajax_filters.currency);
1490      //     //   $( ".salary_amount .to" ).text(ui.values[ 1 ]+job_manager_ajax_filters.currency);
1491      //     // }
1492      //   },
1493      //   stop: function (event, ui) {
1494      //     var target = $("div.job_listings,div.resumes");
1495      //     target.triggerHandler("update_results", [1, false]);
1496      //   },
1497      // });
1498
1499      // Single Select
1500      $(".select2-single").select2({
1501        minimumResultsForSearch: 20,
1502        width: "100%",
1503        allowClear: true,
1504      });
1505
1506      // Multiple Select
1507      $(".select2-multiple").each(function () {
1508        $(this).select2({
1509          width: "100%",
1510          placeholder: $(this).attr("placeholder"),
1511        });
1512      });
1513
1514      // Select on Home Search Bar
1515      $(".select-on-home").select2({
1516        dropdownParent: $(".intro-banner"),
1517        minimumResultsForSearch: 20,
1518        width: "100%",
1519      });
1520      $(".select-on-basichome").select2({
1521        dropdownParent: $(".sc-jobs"),
1522        minimumResultsForSearch: 20,
1523        width: "100%",
1524      });
1525
1526      // Dashboard Wrapper Height
1527      $(window).on("load resize", function () {
1528        $("#dashboard").css(
1529          "min-height",
1530          $(window).height() - $(".new-header #header-container").height()
1531        );
1532      });
1533
1534      /*--------------------------------------------------*/
1535      /*  Full Page Jobs Scripts
1536  /*--------------------------------------------------*/
1537      // Sliding Sidebar
1538      $(".enable-filters-button").on("click", function () {
1539        $(".full-page-sidebar").toggleClass("enabled-sidebar");
1540        $(".enable-filters-button").toggleClass("active");
1541        $(".filter-button-tooltip").removeClass("tooltip-visible");
1542      });
1543
1544      // Sticky Filter
1545      $(".full-page-content-container").scroll(function () {
1546        if ($(this).scrollTop() >= 240) {
1547          $(".sticky-filter-button").addClass("btn-visible");
1548        } else {
1549          $(".sticky-filter-button").removeClass("btn-visible");
1550        }
1551      });
1552
1553      //  Enable Filters Button Tooltip
1554      $(window).on("load", function () {
1555        $(".filter-button-tooltip")
1556          .css({
1557            left: $(".enable-filters-button").outerWidth() + 60,
1558          })
1559          .addClass("tooltip-visible");
1560      });
1561
1562      //   $.post(
1563      //     workscout_core.ajaxurl,
1564      //     {
1565      //         'action': 'foobar',
1566      //         'foobar_id':   123
1567      //     },
1568      //     function(response) {
1569      //         console.log('The server responded: ', response);
1570      //     }
1571      // );
1572
1573      $(window).on("load", function () {
1574        var winWidth = $(window).width();
1575
1576        if (winWidth > 992) {
1577          $(
1578            ".full-page-job-listings-container .job_listings li:first-child a"
1579          ).trigger("click");
1580        }
1581      });
1582
1583      if ($("#media-uploader.gallery").length > 0) {
1584        var gallery_limit = $("#media-uploader.gallery").data("maxfiles");
1585        if (!gallery_limit) {
1586          gallery_limit = workscout_core.maxFiles;
1587        }
1588
1589        console.log("gallery_limit" + gallery_limit);
1590        /* Upload using dropzone */
1591        Dropzone.autoDiscover = false;
1592
1593        var galleryDropzone = new Dropzone("#media-uploader.gallery", {
1594          url: workscout_core.upload,
1595          timeout: 999999,
1596          maxFiles: gallery_limit,
1597          acceptedFiles: "image/*",
1598          maxFilesize: workscout_core.maxFilesize,
1599          dictMaxFilesExceeded: workscout_core.dictMaxFilesExceeded,
1600          dictDefaultMessage: workscout_core.dictDefaultMessage,
1601          dictFallbackMessage: workscout_core.dictFallbackMessage,
1602          dictFallbackText: workscout_core.dictFallbackText,
1603          dictFileTooBig: workscout_core.dictFileTooBig,
1604          dictInvalidFileType: workscout_core.dictInvalidFileType,
1605          dictResponseError: workscout_core.dictResponseError,
1606          dictCancelUpload: workscout_core.dictCancelUpload,
1607          dictCancelUploadConfirmation:
1608            workscout_core.dictCancelUploadConfirmation,
1609          dictRemoveFile: workscout_core.dictRemoveFile,
1610          init: function () {
1611            this.on("sending", function (file, xhr, formData) {
1612              var id = $("input[name=property_id]").val();
1613              formData.append("data", id);
1614              formData.append("nonce", workscout_core.nonce);
1615            });
1616            this.on("addedfile", function (file) {
1617              /* Set active thumb class to preview that is used as thumbnail*/
1618
1619              if (
1620                file["attachment_id"] === parseInt($("#_thumbnail_id").val())
1621              ) {
1622                file.previewElement.className +=
1623                  " active-thumb gallery" + file["attachment_id"];
1624              } else {
1625                file.previewElement.className +=
1626                  " gallery" + parseInt(file["attachment_id"]);
1627              }
1628              file.previewElement.addEventListener("click", function () {
1629                $(".dz-preview").removeClass("active-thumb");
1630                $(this).addClass("active-thumb");
1631
1632                var id = file["attachment_id"];
1633                $("#_thumbnail_id").val(id);
1634              });
1635            }),
1636              this.on("complete", function (file) {
1637                file.previewElement.className +=
1638                  " gallery" + file.attachment_id;
1639              });
1640            this.on("queuecomplete", function (file) {
1641              $(".dz-image-preview:first").trigger("click"); //file.previewElement.click();
1642            });
1643          },
1644          success: function (file, response) {
1645            file.previewElement.classList.add("dz-success");
1646            response = response.replace(/(\r\n|\n|\r)/gm, "");
1647            file["attachment_id"] = response; // push the id for future reference
1648
1649            $("#media-uploader-ids").append(
1650              '<input id="gallery' +
1651                file["attachment_id"] +
1652                '" type="hidden" name="gallery[' +
1653                file["attachment_id"] +
1654                ']"  value="' +
1655                file["name"] +
1656                '">'
1657            );
1658          },
1659          error: function (file, response) {
1660            file.previewElement.classList.add("dz-error");
1661            $(file.previewElement).find(".dz-error-message").text(response);
1662          },
1663          // update the following section is for removing image from library
1664          addRemoveLinks: true,
1665          removedfile: function (file) {
1666            var attachment_id = file["attachment_id"];
1667            $("input#gallery" + attachment_id).remove();
1668            /*remove thumbnail if the image was set as it*/
1669            if ($("#_thumbnail_id").val() == attachment_id) {
1670              $("#_thumbnail_id").val("");
1671            }
1672            $.ajax({
1673              type: "POST",
1674              url: workscout_core.delete,
1675              data: {
1676                media_id: attachment_id,
1677                nonce: workscout_core.nonce,
1678              },
1679              success: function (result) {
1680                console.log(result);
1681              },
1682              error: function () {
1683                console.log("delete error");
1684              },
1685            });
1686            var _ref;
1687            return (_ref = file.previewElement) != null
1688              ? _ref.parentNode.removeChild(file.previewElement)
1689              : void 0;
1690          },
1691        });
1692
1693        if (typeof images !== typeof undefined && images !== false) {
1694          var uploaded_media = jQuery.parseJSON(images);
1695          for (var i = 0; i < uploaded_media.length; ++i) {
1696            var mockFile = {
1697              name: uploaded_media[i].name,
1698              size: uploaded_media[i].size,
1699              attachment_id: uploaded_media[i].attachment_id,
1700            };
1701            galleryDropzone.emit("addedfile", mockFile);
1702            galleryDropzone.emit(
1703              "thumbnail",
1704              mockFile,
1705              uploaded_media[i].thumb
1706            );
1707            galleryDropzone.emit("complete", mockFile);
1708            galleryDropzone.files.push(mockFile);
1709            // If you use the maxFiles option, make sure you adjust it to the
1710            // correct amount:
1711            var existingFileCount = 1; // The number of files already uploaded
1712            galleryDropzone.options.maxFiles =
1713              galleryDropzone.options.maxFiles - existingFileCount;
1714          }
1715        }
1716
1717        $(".dropzone")
1718          .sortable({
1719            items: ".dz-preview",
1720            cursor: "move",
1721            opacity: 0.5,
1722            containment: ".dropzone",
1723            distance: 20,
1724            tolerance: "pointer",
1725            update: sortinputs,
1726          })
1727          .disableSelection();
1728
1729        function sortinputs() {
1730          $(".dropzone .dz-preview").each(function (i, el) {
1731            var p = $(el).attr("class").match(/\d+/g);
1732
1733            $("#media-uploader-ids input#gallery" + p)
1734              .remove()
1735              .appendTo($("#media-uploader-ids"));
1736          });
1737        }
1738      }
1739
1740      //attachments dropzone
1741
1742      if ($("#media-uploader.task_file").length > 0) {
1743        var gallery_limit = $("#media-uploader.task_file").data("maxfiles");
1744        if (!gallery_limit) {
1745          gallery_limit = workscout_core.maxFiles;
1746        }
1747
1748        /* Upload using dropzone */
1749        Dropzone.autoDiscover = false;
1750
1751        var galleryDropzone = new Dropzone("#media-uploader.task_file", {
1752          url: workscout_core.upload,
1753          timeout: 999999,
1754          maxFiles: gallery_limit,
1755          // acceptedFiles: "image/*",
1756          maxFilesize: workscout_core.maxFilesize,
1757          dictMaxFilesExceeded: workscout_core.dictMaxFilesExceeded,
1758          dictDefaultMessage: workscout_core.dictDefaultMessage,
1759          dictFallbackMessage: workscout_core.dictFallbackMessage,
1760          dictFallbackText: workscout_core.dictFallbackText,
1761          dictFileTooBig: workscout_core.dictFileTooBig,
1762          dictInvalidFileType: workscout_core.dictInvalidFileType,
1763          dictResponseError: workscout_core.dictResponseError,
1764          dictCancelUpload: workscout_core.dictCancelUpload,
1765          dictCancelUploadConfirmation:
1766            workscout_core.dictCancelUploadConfirmation,
1767          dictRemoveFile: workscout_core.dictRemoveFile,
1768          init: function () {
1769            this.on("sending", function (file, xhr, formData) {
1770              var id = $("input[name=property_id]").val();
1771              formData.append("data", id);
1772              formData.append("nonce", workscout_core.nonce);
1773            });
1774            this.on("addedfile", function (file) {
1775              /* Set active thumb class to preview that is used as thumbnail*/
1776            }),
1777              this.on("complete", function (file) {
1778                file.previewElement.className +=
1779                  " task_file" + file.attachment_id;
1780              });
1781          },
1782          success: function (file, response) {
1783            file.previewElement.classList.add("dz-success");
1784            response = response.replace(/(\r\n|\n|\r)/gm, "");
1785            file["attachment_id"] = response; // push the id for future reference
1786
1787            $("#attachment-uploader-ids").append(
1788              '<input id="task_file' +
1789                file["attachment_id"] +
1790                '" type="hidden" name="task_file[' +
1791                file["attachment_id"] +
1792                ']"  value="' +
1793                file["name"] +
1794                '">'
1795            );
1796          },
1797          error: function (file, response) {
1798            file.previewElement.classList.add("dz-error");
1799            $(file.previewElement).find(".dz-error-message").text(response);
1800          },
1801          // update the following section is for removing image from library
1802          addRemoveLinks: true,
1803          removedfile: function (file) {
1804            var attachment_id = file["attachment_id"];
1805            $("input#gallery" + attachment_id).remove();
1806            /*remove thumbnail if the image was set as it*/
1807
1808            $.ajax({
1809              type: "POST",
1810              url: workscout_core.delete,
1811              data: {
1812                media_id: attachment_id,
1813                nonce: workscout_core.nonce,
1814              },
1815              success: function (result) {
1816                console.log(result);
1817              },
1818              error: function () {
1819                console.log("delete error");
1820              },
1821            });
1822            var _ref;
1823            return (_ref = file.previewElement) != null
1824              ? _ref.parentNode.removeChild(file.previewElement)
1825              : void 0;
1826          },
1827        });
1828
1829        if (typeof images !== typeof undefined && images !== false) {
1830          var uploaded_media = jQuery.parseJSON(images);
1831          for (var i = 0; i < uploaded_media.length; ++i) {
1832            var mockFile = {
1833              name: uploaded_media[i].name,
1834              size: uploaded_media[i].size,
1835              attachment_id: uploaded_media[i].attachment_id,
1836            };
1837            galleryDropzone.emit("addedfile", mockFile);
1838            // check if uploaded_media[i] has thumb,
1839            if ("thumb" in uploaded_media[i]) {
1840              galleryDropzone.emit(
1841                "thumbnail",
1842                mockFile,
1843                uploaded_media[i].thumb
1844              );
1845            }
1846            galleryDropzone.emit("complete", mockFile);
1847            galleryDropzone.files.push(mockFile);
1848            // If you use the maxFiles option, make sure you adjust it to the
1849            // correct amount:
1850            var existingFileCount = 1; // The number of files already uploaded
1851            galleryDropzone.options.maxFiles =
1852              galleryDropzone.options.maxFiles - existingFileCount;
1853          }
1854        }
1855
1856        $(".dropzone")
1857          .sortable({
1858            items: ".dz-preview",
1859            cursor: "move",
1860            opacity: 0.5,
1861            containment: ".dropzone",
1862            distance: 20,
1863            tolerance: "pointer",
1864            update: sortinputs,
1865          })
1866          .disableSelection();
1867
1868        function sortinputs() {
1869          $(".dropzone .dz-preview").each(function (i, el) {
1870            var p = $(el).attr("class").match(/\d+/g);
1871
1872            $("#media-uploader-ids input#gallery" + p)
1873              .remove()
1874              .appendTo($("#media-uploader-ids"));
1875          });
1876        }
1877      }
1878
1879      $("document").ready(function () {
1880        $(".tab-slider--body").hide();
1881        $(".tab-slider--body:first").show();
1882      });
1883
1884      $(".tab-slider--nav li").click(function () {
1885        $(".tab-slider--body").hide();
1886        var activeTab = $(this).attr("rel");
1887        $("#" + activeTab).fadeIn();
1888        if ($(this).attr("rel") == "tab2") {
1889          $(".tab-slider--tabs").addClass("slide");
1890        } else {
1891          $(".tab-slider--tabs").removeClass("slide");
1892        }
1893        $(".tab-slider--nav li").removeClass("active");
1894        $(this).addClass("active");
1895      });
1896
1897      /*----------------------------------------------------*/
1898      /*  Share URL and Buttons
1899	/*----------------------------------------------------*/
1900      /* global ClipboardJS */
1901      $(".copy-url input").val(window.location.href);
1902      new ClipboardJS(".copy-url-button");
1903
1904      $(".share-buttons-icons a").each(function () {
1905        var buttonBG = $(this).attr("data-button-color");
1906        if (buttonBG !== undefined) {
1907          $(this).css("background-color", buttonBG);
1908        }
1909      });
1910
1911      $(".full-page-job-listings-container").on(
1912        "click",
1913        ".job_listings a:not(.load_more_jobs)",
1914        function (e) {
1915          var winWidth = $(window).width();
1916          if (winWidth > 992) {
1917            e.preventDefault();
1918            var el = $(this);
1919            $(".full-page-job-container").addClass("loading");
1920            $(this).parent().addClass("loading");
1921            var job_id = $(this).parent().data("job_id");
1922
1923            var ajax_data = {
1924              action: "workscout_load_job_view",
1925              job_id: job_id,
1926            };
1927
1928            $.ajax({
1929              type: "POST",
1930              dataType: "json",
1931              url: ws.ajaxurl,
1932              data: ajax_data,
1933              success: function (data) {
1934                // display loader class
1935                console.log(data);
1936                $(".full-page-job-container")
1937                  .html(data.data)
1938                  .removeClass("loading");
1939                $(".full-page-job-container").triggerHandler("load_job_view");
1940              },
1941            });
1942          }
1943        }
1944      );
1945
1946      // ------------------ End Document ------------------ //
1947    });
1948
1949})(this.jQuery);
1950
1951  
1952  /**
1953 * hoverIntent is similar to jQuery's built-in "hover" method except that
1954 * instead of firing the handlerIn function immediately, hoverIntent checks
1955 * to see if the user's mouse has slowed down (beneath the sensitivity
1956 * threshold) before firing the event. The handlerOut function is only
1957 * called after a matching handlerIn.
1958 *
1959 * hoverIntent r7 // 2013.03.11 // jQuery 1.9.1+
1960 * http://cherne.net/brian/resources/jquery.hoverIntent.html
1961 *
1962 * You may use hoverIntent under the terms of the MIT license. Basically that
1963 * means you are free to use hoverIntent as long as this header is left intact.
1964 * Copyright 2007, 2013 Brian Cherne
1965 *
1966 * // basic usage ... just like .hover()
1967 * .hoverIntent( handlerIn, handlerOut )
1968 * .hoverIntent( handlerInOut )
1969 *
1970 * // basic usage ... with event delegation!
1971 * .hoverIntent( handlerIn, handlerOut, selector )
1972 * .hoverIntent( handlerInOut, selector )
1973 *
1974 * // using a basic configuration object
1975 * .hoverIntent( config )
1976 *
1977 * @param  handlerIn   function OR configuration object
1978 * @param  handlerOut  function OR selector for delegation OR undefined
1979 * @param  selector    selector OR undefined
1980 * @author Brian Cherne <brian(at)cherne(dot)net>
1981 **/
1982(function($) {
1983    $.fn.hoverIntent = function(handlerIn,handlerOut,selector) {
1984
1985        // default configuration values
1986        var cfg = {
1987            interval: 50,
1988            sensitivity: 7,
1989            timeout: 0
1990        };
1991
vendor: 3,506 bytes, lines 1992-2067
1992        if ( typeof handlerIn === "object" ) {
1993            cfg = $.extend(cfg, handlerIn );
1994        } else if ($.isFunction(handlerOut)) {
1995            cfg = $.extend(cfg, { over: handlerIn, out: handlerOut, selector: selector } );
1996        } else {
1997            cfg = $.extend(cfg, { over: handlerIn, out: handlerIn, selector: handlerOut } );
1998        }
1999
2000        // instantiate variables
2001        // cX, cY = current X and Y position of mouse, updated by mousemove event
2002        // pX, pY = previous X and Y position of mouse, set by mouseover and polling interval
2003        var cX, cY, pX, pY;
2004
2005        // A private function for getting mouse position
2006        var track = function(ev) {
2007            cX = ev.pageX;
2008            cY = ev.pageY;
2009        };
2010
2011        // A private function for comparing current and previous mouse position
2012        var compare = function(ev,ob) {
2013            ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
2014            // compare mouse positions to see if they've crossed the threshold
2015            if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) {
2016                $(ob).off("mousemove.hoverIntent",track);
2017                // set hoverIntent state to true (so mouseOut can be called)
2018                ob.hoverIntent_s = 1;
2019                return cfg.over.apply(ob,[ev]);
2020            } else {
2021                // set previous coordinates for next time
2022                pX = cX; pY = cY;
2023                // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
2024                ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval );
2025            }
2026        };
2027
2028        // A private function for delaying the mouseOut function
2029        var delay = function(ev,ob) {
2030            ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
2031            ob.hoverIntent_s = 0;
2032            return cfg.out.apply(ob,[ev]);
2033        };
2034
2035        // A private function for handling mouse 'hovering'
2036        var handleHover = function(e) {
2037            // copy objects to be passed into t (required for event object to be passed in IE)
2038            var ev = jQuery.extend({},e);
2039            var ob = this;
2040
2041            // cancel hoverIntent timer if it exists
2042            if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); }
2043
2044            // if e.type == "mouseenter"
2045            if (e.type == "mouseenter") {
2046                // set "previous" X and Y position based on initial entry point
2047                pX = ev.pageX; pY = ev.pageY;
2048                // update "current" X and Y position based on mousemove
2049                $(ob).on("mousemove.hoverIntent",track);
2050                // start polling interval (self-calling timeout) to compare mouse coordinates over time
2051                if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );}
2052
2053                // else e.type == "mouseleave"
2054            } else {
2055                // unbind expensive mousemove event
2056                $(ob).off("mousemove.hoverIntent",track);
2057                // if hoverIntent state is true, then call the mouseOut function after the specified delay
2058                if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );}
2059            }
2060        };
2061
2062        // listen for mouseenter and mouseleave
2063        return this.on({'mouseenter.hoverIntent':handleHover,'mouseleave.hoverIntent':handleHover}, cfg.selector);
2064    };
2065})(jQuery);
2066
2067
vendor: 10,662 bytes, lines 2068-2074
2068/*!
2069 * clipboard.js v2.0.0
2070 * https://zenorocha.github.io/clipboard.js
2071 * 
2072 * Licensed MIT © Zeno Rocha
2073 */
2074!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=3)}([function(t,e,n){var o,r,i;!function(a,c){r=[t,n(7)],o=c,void 0!==(i="function"==typeof o?o.apply(e,r):o)&&(t.exports=i)}(0,function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(t){return t&&t.__esModule?t:{default:t}}(e),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),a=function(){function t(e){n(this,t),this.resolveOptions(e),this.initSelection()}return i(t,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,o.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,o.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":r(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),t}();t.exports=a})},function(t,e,n){function o(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!c.string(e))throw new TypeError("Second argument must be a String");if(!c.fn(n))throw new TypeError("Third argument must be a Function");if(c.node(t))return r(t,e,n);if(c.nodeList(t))return i(t,e,n);if(c.string(t))return a(t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function r(t,e,n){return t.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}function i(t,e,n){return Array.prototype.forEach.call(t,function(t){t.addEventListener(e,n)}),{destroy:function(){Array.prototype.forEach.call(t,function(t){t.removeEventListener(e,n)})}}}function a(t,e,n){return u(document.body,t,e,n)}var c=n(6),u=n(5);t.exports=o},function(t,e){function n(){}n.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){function o(){r.off(t,o),e.apply(n,arguments)}var r=this;return o._=e,this.on(t,o,n)},emit:function(t){var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,r=n.length;for(o;o<r;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],r=[];if(o&&e)for(var i=0,a=o.length;i<a;i++)o[i].fn!==e&&o[i].fn._!==e&&r.push(o[i]);return r.length?n[t]=r:delete n[t],this}},t.exports=n},function(t,e,n){var o,r,i;!function(a,c){r=[t,n(0),n(2),n(1)],o=c,void 0!==(i="function"==typeof o?o.apply(e,r):o)&&(t.exports=i)}(0,function(t,e,n,o){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function u(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}var l=r(e),s=r(n),f=r(o),d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),p=function(t){function e(t,n){i(this,e);var o=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return o.resolveOptions(n),o.listenClick(t),o}return c(e,t),h(e,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===d(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=(0,f.default)(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new l.default({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return u("action",t)}},{key:"defaultTarget",value:function(t){var e=u("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return u("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach(function(t){n=n&&!!document.queryCommandSupported(t)}),n}}]),e}(s.default);t.exports=p})},function(t,e){function n(t,e){for(;t&&t.nodeType!==o;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}var o=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var r=Element.prototype;r.matches=r.matchesSelector||r.mozMatchesSelector||r.msMatchesSelector||r.oMatchesSelector||r.webkitMatchesSelector}t.exports=n},function(t,e,n){function o(t,e,n,o,r){var a=i.apply(this,arguments);return t.addEventListener(n,a,r),{destroy:function(){t.removeEventListener(n,a,r)}}}function r(t,e,n,r,i){return"function"==typeof t.addEventListener?o.apply(null,arguments):"function"==typeof n?o.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return o(t,e,n,r,i)}))}function i(t,e,n,o){return function(n){n.delegateTarget=a(n.target,e),n.delegateTarget&&o.call(t,n)}}var a=n(4);t.exports=r},function(t,e){e.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},e.nodeList=function(t){var n=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in t&&(0===t.length||e.node(t[0]))},e.string=function(t){return"string"==typeof t||t instanceof String},e.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},function(t,e){function n(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var o=window.getSelection(),r=document.createRange();r.selectNodeContents(t),o.removeAllRanges(),o.addRange(r),e=o.toString()}return e}t.exports=n}])});

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.