PageSourceSearch

https://www.loveisrespect.org/wp-content/themes/hotline-main/assets/scripts/app.js?ver=1781734489

js loveisrespect.org collected 2026-10-01 08:59:37 UTC 37,275 bytes, 1,089 lines download raw bytes

1window.lazySizesConfig = window.lazySizesConfig || {};
2window.lazySizesConfig.expand = 1500;
3
4if (typeof jQuery !== "undefined") $ = jQuery;
5
6/*!
7 * Manage device/os/helpers classnames v20190909.1935
8 * @requires browser.detection
9 */
10(function(){
11    var ua = navigator.userAgent.toLowerCase();
12    var up = navigator.platform.toLowerCase();
13    var standard = ['chrome', 'firefox', 'android', 'samsungbrowser'];
14    var ie = isIE();
15    var classes = [];
16
17    if(!ie){
18        if (isAndroidBrowser()){
19            classes.push('android', 'native');
20        } else {
21            for (var i = 0, max = standard.length; i < max; i++) if (ua.indexOf(standard[i]) != -1) classes.push(standard[i]);
22            if (ua.indexOf('safari') > -1 && ua.indexOf('chrome') == -1 && ua.indexOf('crios') == -1) classes.push('safari');
23            if (ua.indexOf('chrome') > -1 || ua.indexOf('crios') > -1) classes.push('chrome');
24            if(/(ipad|iphone|ipod)/g.test(ua)) classes.push('ios');
25        }
26    } else {
27        if(ua.indexOf('iemobile') === -1){
28            classes.push('ie'+ie, ua.indexOf('edge') > -1 ? 'edge' : 'ie');
29        }
30    }
31
32    if (up.indexOf('mac') > -1) classes.push('mac');
33    if (up.indexOf('win') > -1) classes.push('win');
34    if (ua.indexOf('iemobile') > -1) classes.push('mie');
35    if (ua.indexOf('iemobile/9.') > -1) classes.push('mie9');
36    if (ua.indexOf('iemobile/10.') > -1) classes.push('mie10');
37
38    document.documentElement.className += ' ' + classes.join(' ');
39    document.addEventListener('DOMContentLoaded', function(){ document.documentElement.setAttribute('ready', ''); });
40    window.addEventListener('load', function(){ document.documentElement.setAttribute('loaded', ''); });
41})();
42
43
44/*!
45 * Intent Attributes
46 * @requires ten1seven/what-input
47 */
48(function(namespace){
49    var update = function(type) {
50        if(type == 'pointer') type = 'mouse';
51        ['keyboard','mouse','touch'].forEach(function(value) {
52            if(type != value) document.documentElement.removeAttribute(value);
53        });
54        document.documentElement.setAttribute(type, '');
55    };
56    update(whatInput.ask('intent'));
57    whatInput.registerOnChange(update, 'intent');
58})('whatintent');
59
60
61/*!
62 * Open external links in a new tab
63 */
64(function(){
65    document.addEventListener('click', function(event){
66        var a = event.target.closest('a[rel*="external"]');
67        if (!a) return;
68        event.preventDefault();
69        window.open(a.getAttribute("href"));
70    });
71})();
72
73
74/*!
75 * Forms enhancements
76 */
77 (function(namespace){
78    var placeholderize = function(el) { el.classList.toggle('is-placeholder', (el.value === '' || el.value === null)); };
79    var autoresize = function(el) { el.style.height = 'auto'; el.style.height = (el.scrollHeight) + 'px'; };
80    var is_field = function(event) { return event.target && (event.target.matches('input') || event.target.matches('select') || event.target.matches('textarea')); };
81    var is_select = function(event) { return event.target && event.target.matches('select'); };
82    document.body.addEventListener('change', function(event){ if(is_select(event)){ placeholderize(event.target); if(event.target.matches('[data-link]')) window.location = event.target.value; } });
83    document.body.addEventListener('invalid', function(event){ if(is_field(event)) event.target.classList.add('-validated'); }, true);
84    document.body.addEventListener('focusout', function(event){ if(is_field(event)) event.target.checkValidity(); });
85    document.body.addEventListener('input', function(event){ if(event.target.matches('textarea[data-autoresize]')) autoresize(event.target); });
86    var init = function() {
87        each(document.querySelectorAll('select'), function(el) { placeholderize(el); });
88        each(document.querySelectorAll('textarea[data-autoresize]'), function(el) { autoresize(el); });
89    };
90    window.addEventListener('reinitialize', init);
91    init();
92})('forms');
93
94
95/*!
96 * Attach window events
97 * @requires v.window.utils
98 */
99(function(){
100    if(typeof window.utils !== 'undefined'){
101        window.utils.listeners.add('scroll', 'throttled', 'throttle', 100, {leading: false});
102        window.utils.listeners.add('scroll', 'debounced', 'debounce', 100);
103        window.utils.listeners.add('resize', 'throttled', 'throttle', 150, {leading: false});
104        window.utils.listeners.add('resize', 'debounced', 'debounce', 300);
105    }
106
107    window.addEventListener('resize/debounced', function(event) {
108        if(event.detail.width) window.dispatchEvent(new CustomEvent('recalculate'));
109    });
110})();
111
112
113/*!
114 * Update --vw/--vh on resize
115 * @requires v.window.utils
116 */
117(function(){
118    window.addEventListener('resize/throttled', function(event) {
119        if(event.detail.width){
120            document.documentElement.style.setProperty('--vw', document.documentElement.clientWidth * 0.01 + 'px');
121            document.documentElement.style.setProperty('--vh', window.innerHeight * 0.01 + 'px');
122        }
123        if(event.detail.height) document.documentElement.style.setProperty('--vha', window.innerHeight * 0.01 + 'px');
124    });
125})('vwh');
126
127
128/*!
129 * Trigger animations on scroll v20200721.1530
130 * @requires wilsonpage/fastdom
131 */
132(function(namespace){
133    var selector = '[reveal]:not([reveal*="+"])';
134    var margins = '0px 0px -15% 0px';
135
136    var reveal = function(el) {
137        fastdom.mutate(function(){
138            el.setAttribute('revealed', '');
139            el.getBoundingClientRect();
140            el.removeAttribute('reveal');
141            el.dispatchEvent(new CustomEvent('revealed'));
142        });
143    };
144
145    var init = function() {
146        if ('IntersectionObserver' in window && document.documentElement.matches('[m4n]')) {
147            var observer = new IntersectionObserver(function(entries, observer){
148                entries.forEach(function(entry) {
149                    if(entry.isIntersecting){
150                        var data = entry.target.getAttribute('reveal') || false;
151                        var delay = (data) ? (data + '').split('/')[1] : 0;
152                        if(delay && delay > 25){
153                            setTimeout(function(){ reveal(entry.target); }, delay);
154                        } else {
155                            reveal(entry.target);
156                        }
157                        observer.unobserve(entry.target);
158                    }
159                });
160            },{ rootMargin: margins });
161
162            eachOnce(selector, namespace, function(index, root) {
163                if(root.getBoundingClientRect().bottom < 0){
164                    reveal(root);
165                } else {
166                    observer.observe(root);
167                }
168            });
169        }  else {
170            eachOnce(selector, namespace, function(index, root) {
171                reveal(root);
172            });
173        }
174    };
175
176    window.addEventListener('reinitialize', init);
177    init();
178})('reveal');
179
180
181/*!
182 * (v) Reveal Delays Sequencer 20200727.1130
183 * Sequence elements in the same row and in groups
184 */
185(function(namespace){
186
187    var init = function(){
188        var els = document.querySelectorAll('[aligned]');
189        var data = {};
190
191        each(els,function(el) {
192            var offset = el.getBoundingClientRect();
193            var group = el.getAttribute('aligned') || 0;
194            var id = 't' + Math.ceil(offset.top);
195            if(!data.hasOwnProperty(group)) data[group] = {};
196            if(!data[group].hasOwnProperty(id)) data[group][id] = [];
197            data[group][id].push({el: el, left: Math.ceil(offset.left)});
198        });
199
200        for (var group in data) {
201            if (data.hasOwnProperty(group)) {
202                for (var key in data[group]) {
203                    if (data[group].hasOwnProperty(key)) {
204                        var set = data[group][key];
205                        set.sort(function(obj1, obj2) {
206                            return obj1.left - obj2.left;
207                        });
208                        set.forEach(function(item,index){
209                            item.el.style.setProperty('--rq', index);
210                        });
211                    }
212                }
213            }
214        }
215    };
216
217    window.addEventListener('reinitialize', init);
218    window.addEventListener('recalculate', init);
219    init();
220
221})('aligned');
222
223
224/*!
225 * (v) Height Watcher v20200804.0100
226 * @requires each
227 * @requires eachOnce
228 */
229(function(namespace){
230    var calculate = function(el) {
231        el.style.transitionDuration = '0s';
232        el.style.height = 'auto';
233        var height = el.scrollHeight;
234        el.style.setProperty('--height', height + 'px');
235        el.dispatchEvent(new CustomEvent('heightwatch', {bubbles: true, detail: { height: height } }));
236        el.style.transitionDuration = '';
237        el.style.height = '';
238    };
239
240    var update = function(event) {
241        calculate(event.target);
242    };
243
244    var init = function(){
245        eachOnce('[heightcatch]', namespace, function(index, root) {
246            root.addEventListener('heightwatch', function(event) {
247                event.stopPropagation();
248                root.style.setProperty('--height', event.detail.height + 'px');
249            });
250        });
251
252        each(document.querySelectorAll('[heightwatch]'), function(root, index) {
253            calculate(root);
254            if (!root.processed) {
255                root.addEventListener('update', update);
256                root.processed = true;
257            }
258        });
259    };
260
261    init();
262    setTimeout(init,750);
263    window.addEventListener('recalculate', init);
264})('heightwatch');
265
266
267/*!
268 * Autoclass
269 * Add classname onload with a delay
270 */
271(function(namespace){
272    var attr = 'data-autoclass';
273    eachOnce('[' + attr +']', namespace, function(index, root) {
274        var options = root.getAttribute(attr).split('/');
275        var classname = options[0] || '-active';
276        var delay = options[1] || 50;
277        setTimeout(function() {
278            root.classList.add(classname);
279        }, delay);
280    });
281})('autoclass');
282
283
284/*!
285 * Tooltips
286 * @requires popperjs
287 * @requires tippy
288 */
289(function(namespace){
290    if(typeof tippy != 'undefined'){
291        var init = function(){
292            tippy('[data-tooltip]', {
293                arrow: false,
294                allowHTML: true,
295                interactive: true,
296                offset: [0, 5],
297                maxWidth: 300,
298                animation: 'fade',
299                theme: 'site',
300                trigger: 'mouseenter focus click',
301                appendTo: function() {
302                    return document.body;
303                },
304                onCreate(instance) {
305                    var content;
306                    if (instance.reference.matches('[title]')){
307                        content = instance.reference.getAttribute('title');
308                        instance.reference.removeAttribute('title')
309                    } else if (instance.reference.matches('[href]')){
310                        if (instance.reference.hash){
311                            var el = document.querySelector(instance.reference.hash);
312                            content = el ? el.innerHTML : false
313                            instance.reference.removeAttribute('href');
314                        }
315                    } else {
316                        content = false
317                    }
318
319                    if (content) {
320                        instance.setContent(function() {
321                            return content;
322                        });
323                    } else {
324                        instance.destroy();
325                        return;
326                    }
327                }
328            });
329        };
330        window.addEventListener('reinitialize', init);
331        init();
332    }
333})('tooltips');
334
335
336/*!
337 * Search toggle
338 * focus on the field when opening search box
339 */
340(function(namespace){
341    window.addEventListener('toggler:after', function(event) {
342        if(event.detail.targets[0].matches('#search')){
343            setTimeout(function() {
344                var input = document.querySelector('#search input');
345                input.value = '';
346                input.classList.remove('-validated');
347                input.focus();
348            },50);
349        }
350    });
351})('search2');
352
353(function(namespace){
354    window.addEventListener('toggler:after', function(event) {
355		const body = document.body;
356        if (!body.classList.contains('is-nav-active') && window.innerWidth < 1024) {
357			document.getElementById('search').classList.remove('-active');
358		}
359		if (window.location.hash === '#search') {
360			// Check if the hash is '#search'
361			window.history.replaceState(null, document.title, window.location.pathname + window.location.search);
362			// Replace the current URL without the hash
363		}
364    });
365})('nav1');
366
367
368/*!
369 * Lightbox
370 * @requires electerious/basicLightbox
371 */
372(function(namespace){
373    if (typeof basicLightbox !== 'undefined'){
374        window.addEventListener('click', function() {
375            if(event.target.matches('[data-lightbox], [data-lightbox] *')){
376                event.preventDefault();
377                var el = event.target.closest('[data-lightbox]');
378                var target_selector = el.getAttribute('data-lightbox') || false;
379                if (!target_selector) return false;
380                var target_element = document.querySelector(target_selector);
381                if (!target_element) return false;
382                var template = target_element.innerHTML;
383                var close = document.createElement("i");
384                close.setAttribute('class','lightbox1-close icon-close');
385                close.setAttribute('data-close',true);
386
387                window.lightbox = basicLightbox.create(template, {
388                    className: 'lightbox1',
389                    onShow: function(instance) { instance.element().append(close); }
390                });
391                window.lightbox.show();
392            }
393            if(event.target.matches('.lightbox1-close, .lightbox1-close *')){
394                event.preventDefault();
395                window.lightbox.close();
396            }
397        });
398        window.addEventListener('keyup', function(event) {
399            if(event.key == "Escape" && typeof window.lightbox !== 'undefined'){
400                window.lightbox.close();
401            }
402        });
403    }
404})('lightbox');
405
406
407/*!
408 * Quickookie
409 * @requires alpinejs/alpine
410 */
411(function(namespace){
412    window[namespace] = function(days) {
413        return {
414            cookie_name: false,
415            set: function() {
416                if(days) {
417                    var d = new Date;
418                    d.setTime(d.getTime() + 24*60*60*1000*days);
419                    document.cookie = this.cookie_name + "=1;path=/;expires=" + d.toGMTString();
420                } else {
421                    // Session cookie
422                    document.cookie = this.cookie_name + "=1;path=/;";
423                }
424            }
425        };
426    };
427})('quickookie');
428
429
430/*!
431 * Emergency exit
432 * @requires alpinejs/alpine
433 */
434(function(namespace){
435    window[namespace] = function() {
436        return {
437            init: function() {
438                var that = this;
439                var armed = false;
440                var ato;
441                window.addEventListener('exit', function() { that.exit(); });
442                window.addEventListener('keyup', function() {
443                    if(event.key == 'Escape' || event.keyCode == 27){
444                        if (armed) {
445                            clearTimeout(ato);
446                            armed = false;
447                            that.exit();
448                        } else {
449                            armed = true;
450                            ato = setTimeout(function() { armed = false; },2500);
451
452                        }
453                    }
454                });
455            },
456            exit: function() {
457                document.body.classList.add('-exit');
458                window.location.replace("https://live-local-weather.com/");
459            }
460        };
461    };
462})('exit1');
463
464
465/*!
466 * (v) Load more v20200721.0100
467 * @requires alpinejs/alpine
468 */
469(function(namespace){
470    window[namespace] = function() {
471        return {
472            ended: false,
473            loading: false,
474            load : function() {
475                var that = this;
476                var root = this.$el;
477                var scroll = window.pageYOffset;
478                var group = root.getAttribute('loadmore') || false;
479                var entries = root.querySelector('[data-entries]');
480                var more = root.querySelector('[data-more]');
481
482                this.loading = true;
483                fetch(more.href).then(function (response) {
484                    return response.text();
485                }).then(function (html) {
486                    var parser = new DOMParser();
487                    var doc = parser.parseFromString(html, 'text/html');
488                    var doc_root = doc.querySelector('[data-loadmore' + (group ? '="' + group + '"' : '') + ']');
489                    var doc_entries = doc_root.querySelectorAll('[data-entry]');
490                    var doc_more = doc_root.querySelector('[data-more]');
491                    if(doc_entries){
492                        doc_entries.forEach(function(el) {
493                            entries.appendChild(el);
494                        });
495                    }
496                    if (doc_more) {
497                        more.href = doc_more.href;
498                    } else {
499                        that.ended = true;
500                    }
501                    that.loading = false;
502                    window.dispatchEvent(new CustomEvent('reinitialize'));
503                    window.scrollTo(0,scroll);
504                }).catch(function (err) {
505                    console.warn('Something went wrong.', err);
506                });
507            }
508        };
509    };
510})('loadmore1');
511
512/*!
513 * Loadmore2 for in-page resources
514 * @requires jquery
515 */
516(function(namespace){
517
518	if (typeof jQuery === "undefined") return false;
519
520    var init = function(){
521        $('[data-loadmore2]').each(function(index, el) {
522            var $root = $(this);
523            var $more = $root.find('[data-more]');
524            var group = $root.data('loadmore') || false;
525            var loading_class = 'is-loading';
526            var cur_post_id = $root.attr('data-loadmore2');
527            var $entries = $root.find('[data-entries]');
528
529
530            $more.on('click', function(event) {
531                event.preventDefault();
532
533                var topic_id = $(this).attr('data-topic');
534                var page = $(this).attr('data-page');
535
536                // load results
537                $.ajax({
538                    type : 'get',
539                    dataType : 'html',
540                    url : tmscripts.ajax_url,
541                    data : {
542                        action: 'tm_ajax_stream1',
543                        topic_id : topic_id,
544                        page : page,
545                        cur_post_id : cur_post_id
546                    },
547                    success: function(response) {
548
549                        $entries.append(response);
550
551                        var topic_id = $(response).filter('[data-topic]').attr('data-topic');
552                        var page = $(response).filter('[data-page]').attr('data-page');
553
554                        if(page){
555                            $more.attr('data-topic', topic_id);
556                            $more.attr('data-page', page);
557                        } else {
558                            $more.parent().addClass('-hide');
559                        }
560                        window.dispatchEvent(new CustomEvent('reinitialize'));
561                     }
562                })
563
564            });
565
566        });
567    };
568    $(window).on('reinitialize.' + namespace, init);
569    init();
570
571    $('[data-loadswitch').each(function(index, el) {
572        var $root = $(this);
573        var $stream = $root.next('[data-loadmore2]');
574        var $more = $stream.find('[data-more]');
575        var $entries = $stream.find('[data-entries]');
576        var cur_post_id = $root.attr('data-loadswitch');
577
578        $root.find('ul a').on('click', function(event) {
579            event.preventDefault();
580
581            var topic_id = $(this).attr('data-topic');
582            $more.parent().removeClass('-hide');
583
584            // Unhide replicated original topic
585            $(this).parent().siblings('.-hide').removeClass('-hide');
586            // Update select to current text
587            var text = $(this).text();
588            $root.find('.subnav1-select > span').text(text);
589
590            // load results.
591            $.ajax({
592                type : 'get',
593                dataType : 'html',
594                url : tmscripts.ajax_url,
595                data : {
596                    action: 'tm_ajax_stream1',
597                    topic_id : topic_id,
598                    cur_post_id : cur_post_id
599                },
600                success: function(response) {
601                    $entries.html(response);
602
603                    var topic_id = $(response).filter('[data-topic]').attr('data-topic');
604                    var page = $(response).filter('[data-page]').attr('data-page');
605
606                    if(page){
607                        $more.attr('data-topic', topic_id);
608                        $more.attr('data-page', page);
609                    } else {
610                        $more.parent().addClass('-hide');
611                    }
612                    window.dispatchEvent(new CustomEvent('reinitialize'));
613                 }
614            })
615        });
616    });
617
618})('loadmore2');
619
620
621/*!
622 * Search
623 * @requires alpinejs/alpine
624 */
625(function(namespace){
626    window[namespace] = function() {
627        return {
628            min: 3,
629            query: null,
630            items: [],
631            update: function() {
632                var that = this;
633                this.query = this.$refs.input.value;
634                if (this.query.length >= this.min) {
635                    fetch(this.endpoint.replace('{query}',encodeURIComponent(this.query)))
636                        .then(function(response){ return response.json() })
637                        .then(function(data){ that.items = data });
638                } else {
639                    this.clear();
640                }
641            },
642            clear: function() {
643                this.items = [];
644            },
645            init: function(endpoint) {
646                this.endpoint = endpoint;
647            }
648        };
649    };
650})('search1');
651
652
653/*!
654 * CTA show/hide
655 * @requires alpinejs/alpine
656 */
657(function(namespace){
658  window[namespace] = function() {
659
660    return {
661      active: false,
662      line: 100,
663      bp: 1080, // <— screens narrower than this are "mobile"
664
665      init: function() {
666        const that = this;
667
668        // Reactively toggle class when `active` changes
669        this.$watch('active', function(value) {
670          that.$el.classList.toggle('-active', value);
671        });
672
673        // Match "mobile" via breakpoint
674        const mq = window.matchMedia(`(max-width: ${this.bp - 1}px)`);
675
676        // Apply correct mode based on current viewport
677        const applyMode = function() {
678          if (mq.matches) {
679            // Mobile: always active, no scroll logic
680            that.active = true;
681          } else {
682            // Desktop: set initial state based on current scroll
683            that.active = window.pageYOffset >= that.line;
684          }
685        };
686
687        // Desktop-only scroll handler
688        const onScroll = function() {
689          if (mq.matches) return; // ignore on mobile
690          const shouldBeActive = window.pageYOffset >= that.line;
691          if (that.active !== shouldBeActive) {
692            that.active = shouldBeActive;
693          }
694        };
695
696        // Initial setup
697        applyMode();
698
699        // Keep your throttled scroll event for desktop behavior
700        window.addEventListener('scroll/throttled', onScroll);
701
702        // Re-evaluate when crossing the breakpoint
703        if (mq.addEventListener) {
704          mq.addEventListener('change', applyMode);
705        } else {
706          // Safari < 14 fallback
707          mq.addListener(applyMode);
708        }
709      }
710    };
711  };
712})('cta1');
713
714
715/*!
716 * (v) Unfold - animated height toggler v20200509.0000
717 * @requires alpinejs/alpine
718 */
719(function(namespace){
720    window[namespace] = function() {
721        return {
722            id: null,
723            active: null,
724            animating: null,
725            update : function(open) {
726                var that = this;
727                each(document.querySelectorAll('[unfolder="' + that.id + '"]'), function(el, index) {
728                    el.classList.toggle('-open', open);
729                });
730            },
731            open : function() {
732                var that = this;
733                if (this.active || this.animating) return false;
734                this.animating = true;
735                var height = this.$el.scrollHeight;
736                this.$el.style.setProperty('--height', height + 'px');
737                this.$el.classList.add('-open');
738                this.$el.addEventListener('transitionend', function(e) {
739                    that.$el.removeEventListener('transitionend', arguments.callee);
740                    that.$el.classList.add('-opened');
741                    that.animating = false;
742                    that.active = true;
743                });
744                that.update(true);
745            },
746            close : function() {
747                var that = this;
748                if (!this.active || this.animating) return false;
749                this.animating = true;
750                var height = this.$el.scrollHeight;
751                requestAnimationFrame(function() {
752                    that.$el.style.setProperty('--height', height + 'px');
753                    that.$el.classList.remove('-opened');
754                    requestAnimationFrame(function() {
755                        that.$el.classList.remove('-open');
756                        that.animating = false;
757                        that.active = false;
758                    });
759                });
760                that.update(false);
761            },
762            toggle: function() {
763                var that = this;
764                this[this.active ? 'close' : 'open']();
765            },
766            init: function(id) {
767                var that = this;
768                this.active = this.$el.matches('.-open');
769                this.$el.classList.toggle('-opened',this.active);
770                this.id = id;
771                this.$el.setAttribute('unfold', id);
772                this.$el.addEventListener('toggle', function() { that.toggle(); });
773                this.$el.addEventListener('open', function() { that.open(); });
774                this.$el.addEventListener('close', function() { that.close(); });
775            }
776        };
777    };
778
779    document.addEventListener('click', function(event) {
780        var unfolder = event.target.closest('[unfolder]');
781        if(unfolder){
782            event.preventDefault();
783            var id = unfolder.getAttribute('unfolder');
784            var flags = unfolder.hasAttribute('flags') ? unfolder.getAttribute('flags') : false;
785            var method = 'toggle';
786            if(flags && flags.search(/\+/) > -1) method = 'open';
787            if(flags && flags.search(/\-/) > -1) method = 'close';
788            if(flags && flags.search(/\~/) > -1 && id.search(/\//) > -1){
789                var group = id.split('/',1)[0]
790                each(document.querySelectorAll('[unfold^="' + group + '/"]'), function(el, index) {
791                    el.dispatchEvent(new CustomEvent(el.matches('[unfold="' + id + '"]') ? 'open' : 'close'));
792                });
793            } else {
794                each(document.querySelectorAll('[unfold="' + id + '"]'), function(el, index) {
795                    el.dispatchEvent(new CustomEvent(method))
796                });
797            }
798        }
799    });
800})('unfold1');
801
802
803/*!
804 * Alert Bar
805 * @requires jquery
806 */
807(function(namespace){
808	if (typeof jQuery === "undefined") return false;
809
810  var $body = $('body'),
811      str = window.location.search,
812      a_val = Cookies.get('alertbar'),
813      a_cur = $('#site-alertbar').data('id'),
814      initialized = (a_val == a_cur);
815
816    var init = function() {
817      if (!initialized) {
818        a_val = Cookies.get('alertbar');
819        // if (typeof Cookies.get('safety') !== 'undefined' && typeof Cookies.get('modal') !== 'undefined' && a_val != a_cur) {
820        if (typeof Cookies.get('modal') !== 'undefined' && a_val != a_cur) {
821          $('[data-alertbar]').each(function(index, el) {
822            var $root = $(this),
823                height = $root.innerHeight();
824            initialized = true;
825            setTimeout(function(){
826              $body.addClass('has-alertbar').css({'padding-top': height});
827            }, $root.data('alertbar') || '1500');
828          });
829        }
830      }
831    },
832    resize = function() {
833      if (initialized && $body.hasClass('has-alertbar')) {
834        $('[data-alertbar]').each(function(index, el) {
835          var $root = $(this),
836              height = $root.innerHeight();
837          $body.css({'padding-top': height});
838        });
839      }
840    }
841
842    if (!initialized || (str.indexOf("?popup") >= 0)) {
843      init();
844    }
845
846    $('#site-safety, #site-modal').on('click', 'a', function(e){
847      init();
848    });
849
850    window.addEventListener('recalculate', resize);
851})('alertbar');
852
853
854/*!
855 * Safety Exit Notice
856 * @requires jquery
857 */
858(function(namespace){
859	if (typeof jQuery === "undefined") return false;
860
861    var init = function(){
862        $('[data-safety]:not(.is-initialized-' + namespace + ')').each(function(index, el) {
863            var $root = $(this).addClass('is-initialized-' + namespace);
864            setTimeout(function(){
865                $root.addClass('-active');
866            },$root.data('safety') || '1500');
867        });
868    };
869
870    /* Only init if cookie is not set or ?popup is added to URL*/
871    var str = window.location.search;
872    var a_val = Cookies.get('safety');
873    var a_cur = $('#site-safety').data('id');
874    if ( (a_val != a_cur) || (str.indexOf("?popup") >= 0) ) {
875        init();
876    }
877})('safety');
878
879
880/*!
881 * Safety Alert Modal
882 * @requires jquery
883 */
884(function(namespace){
885	if (typeof jQuery === "undefined") return false;
886
887    var init = function(){
888        $('[data-modal]:not(.is-initialized-' + namespace + ')').each(function(index, el) {
889            var $root = $(this).addClass('is-initialized-' + namespace);
890            setTimeout(function(){
891                $root.addClass('-active');
892            },$root.data('modal') || '1500');
893        });
894    };
895
896    /* Only init if cookie is not set or ?popup is added to URL*/
897    var str = window.location.search;
898    var a_val = Cookies.get('modal');
899    var a_cur = $('#site-modal').data('id');
900    if ( (a_val != a_cur) || (str.indexOf("?popup") >= 0) ) {
901        init();
902    }
903})('modal');
904
905
906/*!
907 * Consent Banner
908 * @requires jquery
909 */
910(function(namespace){
911	if (typeof jQuery === "undefined") return false;
912    var init = function(){
913        $('[data-consent]:not(.is-initialized-' + namespace + ')').each(function(index, el) {
914            var $root = $(this).addClass('is-initialized-' + namespace);
915            setTimeout(function(){
916                $root.addClass('-active');
917            },$root.data('consent') || '100');
918        });
919    };
920
921    /* Only init if cookie is not set or ?popup is added to URL*/
922    var str = window.location.search;
923    var a_val = Cookies.get('ccpa');
924    var a_cur = $('#site-modal').data('id');
925    if ( (a_val != a_cur) || (str.indexOf("?popup") >= 0) ) {
926        init();
927    }
928})('consent');
929
930
931/*!
932 * Confirmation modal
933 */
934(function(namespace){
935	window.addEventListener('click', function(event) {
936		if(event.target.matches('[confirm], [confirm] *')){
937			event.preventDefault();
938			var el = event.target.closest('[confirm]');
939			document.querySelectorAll('[confirmed]').forEach(function(root, index) {
940				root.href = el.href;
941			});
942		}
943	});
944})('confirm');
945
946
947/**
948 * Resources Featured Component
949 */
950(function(namespace){
951    jQuery('.resources1-main-slider').slick({
952        infinite: false,
953        slidesToShow: 1,
954    });
955})('resources-featured');
956
957
958/**
959 * Testimonials Mobile Only Slider
960 */
961(function(namespace){
962
963    // jQuery('.testimonials-slider').slick({
964    //     infinite: false,
965    //     slidesToShow: 1,
966    // });
967
968  const $ = jQuery;
969  const $el = $('.testimonials');
970
971  if (!$el.length) return;
972
973  const slickOpts = {
974    mobileFirst: true,          // interpret breakpoints as min-width
975    infinite: false,
976    dots: false,
977    arrows: true,
978    slidesToShow: 1,
979    slidesToScroll: 1,
980    adaptiveHeight: true,
981    // At >=1080px, disable the slider and fall back to your static layout
982    responsive: [
983      { breakpoint: 1080, settings: 'unslick' }
984    ]
985  };
986
987  // Init once at load for current viewport
988  $el.slick(slickOpts);
989
990  // If the user resizes from desktop → mobile, re-init as needed
991  $(window).on('resize', function(){
992    // If we're below desktop and Slick is not active, re-init
993    if (window.innerWidth < 1080 && !$el.hasClass('slick-initialized')) {
994      $el.slick(slickOpts);
995    }
996    // If we're at/above desktop and Slick is active, just let responsive unslick handle it
997    // (Slick already destroyed itself at ≥1080 via the responsive rule)
998  });
999
1000})('testimonials-mobile-only');
1001
1002
1003
1004/**
1005 * Alert bar display (ET locked)
1006 * - Reads: data-days, data-start, data-end, data-tz (defaults to America/Ne
1006w_York)
1007 * - Supports windows that cross midnight
1008 * - Hides/shows once per minute
1009 */
1010(function () {
1011  function parseTime12(str) {
1012    const m = String(str).trim().match(/^(\d{1,2}):(\d{2})\s*([ap]m)$/i);
1013    if (!m) return null;
1014    let h = parseInt(m[1], 10);
1015    const min = parseInt(m[2], 10);
1016    const ampm = m[3].toLowerCase();
1017    if (ampm === 'pm' && h < 12) h += 12;
1018    if (ampm === 'am' && h === 12) h = 0;
1019    return h * 60 + min; // minutes since midnight
1020  }
1021
1022  function nowInTZ(tz) {
1023    const now = new Date();
1024    const fmt = new Intl.DateTimeFormat('en-US', {
1025      timeZone: tz,
1026      hour12: false,
1027      weekday: 'long',
1028      hour: '2-digit',
1029      minute: '2-digit'
1030    });
1031    const parts = fmt.formatToParts(now);
1032    const weekday = (parts.find(p => p.type === 'weekday')?.value || '').toLowerCase();
1033    const hour = parseInt(parts.find(p => p.type === 'hour')?.value || '0', 10);
1034    const minute = parseInt(parts.find(p => p.type === 'minute')?.value || '0', 10);
1035    return { weekday, minutes: hour * 60 + minute };
1036  }
1037
1038  function applyLogic(bar) {
1039    const days = (bar.getAttribute('data-days') || '')
1040      .split(',')
1041      .map(s => s.trim().toLowerCase())
1042      .filter(Boolean);
1043
1044    const startStr = (bar.getAttribute('data-start') || '').trim();
1045    const endStr   = (bar.getAttribute('data-end')   || '').trim();
1046    const tz       = (bar.getAttribute('data-tz')    || 'America/New_York').trim();
1047
1048    if (!startStr || !endStr || !days.length) return;
1049
1050    const startMin = parseTime12(startStr);
1051    const endMin   = parseTime12(endStr);
1052    if (startMin == null || endMin == null) return;
1053
1054    function inWindow(weekday, minutes) {
1055      if (days.length && !days.includes(weekday)) return false;
1056      if (startMin === endMin) return true; // all day on selected days
1057      if (startMin < endMin) {
1058        return minutes >= startMin && minutes < endMin; // end-exclusive at exactly end time
1059      } else {
1060        // crosses midnight
1061        return minutes >= startMin || minutes < endMin;
1062      }
1063    }
1064
1065    function tick() {
1066      const { weekday, minutes } = nowInTZ(tz);
1067      const show = inWindow(weekday, minutes);
1068      bar.hidden = !show;
1069      bar.setAttribute('aria-hidden', String(!show));
1070    }
1071
1072    tick();
1073    // Save interval id if you ever need to clear it later:
1074    const id = setInterval(tick, 60 * 1000);
1075    bar._alertIntervalId = id;
1076  }
1077
1078  function init() {
1079    const bars = document.querySelectorAll('[data-alert-bar]');
1080    if (!bars.length) return;
1081    bars.forEach(applyLogic);
1082  }
1083
1084  if (document.readyState === 'loading') {
1085    document.addEventListener('DOMContentLoaded', init);
1086  } else {
1087    init();
1088  }
1089})();

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.