PageSourceSearch

https://readitquik.com/_static/??-eJyVjUEOwjAMBD+EayhChQPiLW2Spo4S…7fjX3swC0V7sMwqmlNTXul5GR7na9/fh1v4AATjXmI=

js readitquik.com collected 2026-10-03 22:10:29 UTC 31,535 bytes, 573 lines download raw bytes

1(function ($) {
2    "use strict";
3
4    // Function to handle "rs-lettering-text"
5    const letteringTextHandler = function () {
6        if ($(".rs-lettering-text").length) {
7            $(".rs-lettering-text").each(function () {
8                const sentence = $(this).text().trim();
9                let wrappedSentence = "";
10                const useEm = !$(this).hasClass("style2");
11
12                for (let i = 0; i < sentence.length; i++) {
13                    wrappedSentence += useEm
14                        ? `<span><em>${sentence[i]}</em></span>`
15                        : `<span class="char${[i]}">${sentence[i]}</span>`;
16                }
17                $(this).html(wrappedSentence);
18            });
19        }
20    };
21
22    const AI_chat_handler = function ($scope, $) {
23        const thread_dom = $scope[0].querySelector(".chat_thread");
24        const input_bar = $scope[0].querySelector(".message_input");
25        const submit_btn = $scope[0].querySelector(".submit");
26        const main_con = $scope[0].querySelector(".fpg_ai_chat_widget");
27        const loader = $scope[0].querySelector(".chat_loading");
28        const footer = $scope[0].querySelector(".chat_footer");
29        const config = JSON.parse(main_con.dataset.config);
30        //remove config from dom
31        main_con.removeAttribute("data-config");
32        console.log(config);
33        const state = {
34            messages: [],
35            input_val: "",
36            loading: false,
37        };
38
39        async function fetch_message() {
40            try {
41                let res = await $.ajax({
42                    type: "POST",
43                    url: config.ajax,
44                    data: {
45                        action: "rs_chat_message",
46                        nonce: config.nonce,
47                        req_hash: config.req_hash,
48                        messages: JSON.stringify(state.messages),
49                    },
50                });
51                if (res.status_code == 200 && res.data.choices.length) {
52                    let result = res.data.choices[0].message;
53                    return {status: "success", data: result};
54                }
55            } catch (error) {
56                console.log(error);
57                return {status: "fail", data: error.responseJSON};
58            }
59        }
60
61        function add_message_dom(message) {
62            let direction = message.role == "user" ? "right" : "left";
63            let markup = `<div class="${direction}"> <p class="message">${message.content}</p> </div>`;
64            thread_dom.insertAdjacentHTML("beforeend", markup);
65        }
66
67        async function handle_submit_btn() {
68            //if no input value then dont submit the form
69            if (!state.input_val || state.loading) return null;
70            //start loading state
71            state.loading = true;
72            //remove previous error message
73            footer.querySelector(".error")?.remove();
74
75            //add message to state
76            let message = {role: "user", content: state.input_val};
77            //render message
78            add_message_dom(message);
79            state.messages.push(message);
80            //enable loader
81            thread_dom.classList.add("loading");
82            loader.scrollIntoView({block: "end", behavior: "smooth"});
83
84            //clear state input
85            input_bar.value = "";
86            state.input_val = "";
87            //disable submit btn
88            let res = await fetch_message();
89            if (res.status === "success") {
90                message = {role: res.data.role, content: res.data.content};
91                state.messages.push(message);
92                thread_dom.classList.remove("loading");
93                add_message_dom(message);
94            } else {
95                //error
96                thread_dom.classList.remove("loading");
97                footer.insertAdjacentHTML(
98                    "beforeend",
99                    `<p class="error"> ${res.data.message} </p>`,
100                );
101                console.log(res);
102            }
103
104            state.loading = false;
105        }
106
107        function handle_message_input(eve) {
108            let val = eve.target.value;
109            state.input_val = val;
110        }
111
112        submit_btn.addEventListener("click", handle_submit_btn);
113        input_bar.addEventListener("input", handle_message_input);
114        input_bar.addEventListener("keydown", (eve) => {
115            if (eve.key == "Enter") {
116                handle_submit_btn();
117            }
118        });
119    };
120
121    // Animate on Scroll
122    function initAOS() {
123        if (typeof AOS === "undefined") return;
124        AOS.init();
125    }
126
127    // Table of content
128    function RsTocWidget($scope) {
129        $("document").ready(function () {
130            var $toc = $scope.find(".rs-table-of-content");
131            if (!$toc.length) return;
132
133            // Get container selector - fallback to body if not found
134            var containerSelector = $toc.data("container") || "body";
135            var container = $(containerSelector);
136
137            // Get heading selectors
138            var selectors = $toc
139                .data("headings")
140                .split(",")
141                .map(function (s) {
142                    return s.trim();
143                })
144                .join(",");
145
146            var excludeSelectors = $toc.data("exclude");
147            var scrollOffset = parseInt($toc.data("offset")) || 100;
148            var $list = $toc.find(".toc-list");
149
150            // Parse exclude selectors into parent containers and specific elements
151            var excludeParents = [];
152            var excludeSpecific = [];
153
154            if (excludeSelectors && typeof excludeSelectors === "string") {
155                excludeSelectors.split(",").forEach(function (selector) {
156                    selector = selector.trim();
157                    if (selector) {
158                        if (/\bh[1-6]\b/i.test(selector)) {
159                            excludeSpecific.push(selector);
160                        } else {
161                            excludeParents.push(selector);
162                        }
163                    }
164                });
165            }
166
167            // Find all headings in the container
168            var $headings = container.find(selectors).filter(function () {
169                var $el = $(this);
170
171                if (!$el.text().trim().length) return false;
172
173                if ($toc.find($el).length) return false;
174
175                for (var i = 0; i < excludeParents.length; i++) {
176                    if ($el.closest(excludeParents[i]).length) {
177                        return false;
178                    }
179                }
180
181                for (var j = 0; j < excludeSpecific.length; j++) {
182                    if ($el.is(excludeSpecific[j])) {
183                        return false;
184                    }
185                }
186
187                return true;
188            });
189
190            // Return early if no heading found
191            if (!$headings.length) {
192                return;
193            }
194
195            // Build nested list structure
196            var currentLevel = 0;
197            var listStack = [$list];
198            var minLevel = 999;
199            var usedTocIds = {};
200
201            $headings.each(function () {
202                var $el = $(this);
203                var tocId = $el.attr("data-toc-link-id");
204
205                if (!tocId) {
206                    var baseId = $el
207                        .text()
208                        .toLowerCase()
209                        .replace(/\s+/g, "-")
210                        .replace(/[^\w-]+/g, "")
211                        .substring(0, 50);
212
213                    tocId = baseId;
214                    var counter = 1;
215
216                    while (usedTocIds[tocId]) {
217                        tocId = baseId + "-" + counter;
218                        counter++;
219                    }
220
221                    $el.attr("data-toc-link-id", tocId);
222                }
223
224                usedTocIds[tocId] = true;
225
226                var level = parseInt(this.nodeName.replace("H", ""), 10);
227                if (level < minLevel) minLevel = level;
228
229                var $li = $("<li>", {class: "toc-item toc-level-" + level});
230                var $link = $("<a>", {
231                    href: "#" + tocId,
232                    text: $el.text(),
233                    class: "toc-link",
234                    "data-target": tocId,
235                });
236
237                $link.on("click", function (e) {
238                    e.preventDefault();
239                    var $target = $('[data-toc-link-id="' + tocId + '"]');
240
241                    if ($target.length) {
242                        var targetOffset = $target.offset().top - scrollOffset;
243
244                        $("html, body").scrollTop(targetOffset);
245
246                        // Update URL hash without jumping
247                        if (history.pushState) {
248                            history.pushState(null, null, "#" + tocId);
249                        } else {
250                            window.location.hash = tocId;
251                        }
252                    }
253                });
254
255                $li.append($link);
256
257                // Nesting logic
258                if (currentLevel === 0) {
259                    listStack[listStack.length - 1].append($li);
260                    currentLevel = level;
261                } else if (level > currentLevel) {
262                    var $newUl = $("<ul>", {
263                        class: "toc-sublist toc-level-group toc-level-" + level,
264                    }).append($li);
265                    listStack[listStack.length - 1].children("li:last").append($newUl);
266                    listStack.push($newUl);
267                    currentLevel = level;
268                } else if (level === currentLevel) {
269                    listStack[listStack.length - 1].append($li);
270                } else {
271                    while (listStack.length > 1 && currentLevel > level) {
272                        listStack.pop();
273                        currentLevel--;
274                    }
275                    listStack[listStack.length - 1].append($li);
276                    currentLevel = level;
277                }
278            });
279
280            // Handle initial page load with hash
281            if (window.location.hash) {
282                var hash = window.location.hash.substring(1);
283                var $target = $("#" + hash);
284
285                if (!$target.length) {
286                    $target = $('[data-toc-link-id="' + hash + '"]');
287                }
288
289                if ($target.length) {
290                    setTimeout(function () {
291                        var targetOffset = $target.offset().top - scrollOffset;
292
293                        $("html, body").scrollTop(targetOffset);
294                    }, 100);
295                }
296            }
297
298            // Handle Collapse
299            var $tocHeader = $toc.find(".toc-header");
300            var $tocBody = $toc.find(".toc-body");
301
302            if ($tocHeader.hasClass("has-collapse")) {
303                $tocHeader.on("click", function (e) {
304                    $tocHeader.toggleClass("toc-active");
305                    $tocBody.slideToggle(350);
306                });
307            }
308        });
309    }
310
311    // Elementor hooks for frontend and editor
312    $(window).on("elementor/frontend/init", () => {
313        const isEditMode = elementorFrontend.isEditMode();
314        const moduleHandler = elementorModules.frontend.handlers.Base;
315
316        elementorFrontend.hooks.addAction(
317            "frontend/element_ready/fpg-table-of-content.default",
318            RsTocWidget,
319        );
320        elementorFrontend.hooks.addAction(
321            "frontend/element_ready/fpg-button-rotating.default",
322            letteringTextHandler,
323        );
324        elementorFrontend.hooks.addAction(
325            "frontend/element_ready/fpg-ai-chat.default",
326            AI_chat_handler,
327        );
328
329        if (isEditMode) {
330            // Custom CSS for Elementor
331            elementor.hooks.addFilter(
332                "editor/style/styleText",
333                function (css, context) {
334                    if (!context) {
335                        return;
336                    }
337                    var model = context.model,
338                        customCSS = model.get("settings").get("fpg_exten_custom_css");
339                    var selector =
340                        ".elementor-element.elementor-element-" + model.get("id");
341                    if ("document" === model.get("elType")) {
342                        selector = elementor.config.document.settings.cssWrapperSelector;
343                    }
344                    if (customCSS) {
345                        css += customCSS.replace(/selector/g, selector);
346                    }
347
348                    return css;
349                },
350            );
351
352            // Aos Animation
353            elementorFrontend.hooks.addAction("frontend/element_ready/global", () => {
354                $(document).ready(function () {
355                    initAOS();
356                });
357            });
358            if (typeof AOS !== "undefined") {
359                const aosAnimation = moduleHandler.extend({
360                    bindEvents: function bindEvents() {
361                        this.run();
362                    },
363                    run: function run() {
364                        const $element = this.$element;
365                        const aosName = this.getElementSettings("aos_animation_g");
366                        const aosDuration =
367                            this.getElementSettings("aos_animation_g_duration") || "";
368                        const aosDelay =
369                            this.getElementSettings("aos_animation_g_delay") || "";
370                        const aosNoRepeat =
371                            this.getElementSettings("aos_animation_g_repeat") === "yes"
372                                ? "false"
373                                : "true";
374                        if (aosName && aosName !== "none") {
375                            $element.attr("data-aos", aosName);
376                            if (aosDuration) {
377                                $element.attr("data-aos-duration", aosDuration);
378                            }
379                            if (aosDelay) {
380                                $element.attr("data-aos-delay", aosDelay);
381                            }
382                            $element.attr("data-aos-once", aosNoRepeat);
383                        } else if (aosName === "none") {
384                            $element.removeAttr(
385                                "data-aos data-aos-duration data-aos-delay data-aos-once",
386                            );
387                        }
388                    },
389                });
390
391                elementorFrontend.hooks.addAction(
392                    "frontend/element_ready/widget",
393                    function ($scope) {
394                        elementorFrontend.elementsHandler.addHandler(aosAnimation, {
395                            $element: $scope,
396                        });
397                    },
398                );
399            }
400        } else {
401            $(document).ready(function () {
402                initAOS();
403            });
404        }
405    });
406})(jQuery);
407;
408!function(){"use strict";var e,n={n:function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},d:function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},o:function(e,n){return Object.prototype.hasOwnProperty.call(e,n)}},t=jQuery,o=n.n(t),s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,n="sub-menu-open",t="show-sub-menu",s="show-panel",a="panel-open",i=function(e,s){s&&e.find("".concat(s," .sub-menu-icon")).on("click",function(e){e.preventDefault(),e.stopPropagation();var s=o()(this),a=s.closest(".menu-item"),i=s.parent().next(".sub-menu, .mega-menu");s.hasClass(n)?(i.stop(!0).slideUp(450).removeClass(t),s.removeClass(n)):(a.siblings(".menu-item-has-children, .menu-item-has-mega-menu").find(".sub-menu, .mega-menu").stop(!0).slideUp(450).removeClass(t),a.siblings().find(".sub-menu-icon").removeClass(n),i.stop(!0).slideDown(450).addClass(t),s.addClass(n))})},r=function(e){var n=e.find(".mobile-panel-wrapper.panel-classic");if(n.length){var t=o()("body").width(),s=n.parent().offset().left;n.css({left:"".concat(-s,"px"),width:"".concat(t,"px")})}},l=function(e){var n=o()("body").width();e.find(".primary-menu .mega-menu").each(function(){var t=o()(this),s=t.parent().offset().left;t.parents().hasClass("menu-item-has-children")||e.hasClass("nav-vertical")||(t.hasClass("mega-menu-width-full")||t.hasClass("mega-menu-width-container"))&&t.css({left:"".concat(-s,"px"),width:"".concat(n,"px")})})},c=function(){var e=0,n=o()(".rstb-header .rstb-sticky");n.length&&(e+=n.outerHeight()||0);var t=o()("#wpadminbar");return t.length&&t.is(":visible")&&(e+=t.outerHeight()||0),e},u=function(e,n){e.find(".primary-menu .menu-item, .mobile-menu .menu-item").removeClass("current-menu-item current-menu-parent");var t=e.find('.primary-menu a[href$="'.concat(n,'"]')).first();if(t.length){var o=t.closest(".menu-item"),s=o.closest(".sub-menu, .mega-menu").closest(".menu-item");o.addClass("current-menu-item"),s.length&&s.addClass("current-menu-parent")}var a=e.find('.mobile-menu a[href$="'.concat(n,'"]')).first();if(a.length){var i=a.closest(".menu-item"),r=i.closest(".sub-menu, .mega-menu").closest(".menu-item");i.addClass("current-menu-item"),r.length&&r.addClass("current-menu-parent")}},f=function(e){var n=c(),t=o()(window).scrollTop()+n+10,s=e.find('.primary-menu a[href*="#"], .mobile-menu a[href*="#"]'),a=null,i=1/0;if(s.each(function(){var e=o()(this).attr("href");if(e&&"#"!==e&&-1!==e.indexOf("#")){var n=e.includes("#")?e.substring(e.indexOf("#")):"";if(n&&"#"!==n){var s=o()(n);if(s.length){var r=s.offset().top,l=r+s.outerHeight();if(t>=r&&t<l){var c=Math.abs(t-r);c<i&&(i=c,a=n)}}}}}),a){var r=e.find('.primary-menu a[href$="'.concat(a,'"]')).first(),l=e.find('.mobile-menu a[href$="'.concat(a,'"]')).first();(!r.closest(".menu-item").hasClass("current-menu-item")||!l.closest(".menu-item").hasClass("current-menu-item"))&&u(e,a)}},m=function(e){var n=e.find(".menu-toggler"),t=e.find(".mobile-panel-wrapper.panel-classic"),i=e.find(".mobile-panel-wrapper.panel-offcanvas");t.length&&t.is(":visible")&&t.slideUp(350),i.length&&i.hasClass(s)&&i.removeClass(s),n.removeClass(a),o()("html").removeAttr("data-nav-menu").css({scrollbarGutter:""}),o()("html, body").css({overflow:""})},d=o()(e).find(".rstb-nav-menu");d.length&&d.each(function(){var e,n=o()(this);(function(e){var n=e.find(".menu-toggler"),t=e.find(".mobile-panel-wrapper.panel-classic"),i=e.find(".mobile-panel-wrapper.panel-offcanvas"),r=e.find(".mobile-panel-overly"),l=e.find(".mobile-panel-close"),c=function(){o()("html").removeAttr("data-nav-menu").css({scrollbarGutter:""}),o()("html, body").css({overflow:""})},u=function(){"open"===o()("html").attr("data-nav-menu")?c():(o()("html").attr("data-nav-menu","open").css({scrollbarGutter:"stable"}),o()("html, body").css({overflow:"hidden"}))};n.on("click",function(){o()(this).toggleClass(a),t.length&&t.slideToggle(350),i.length&&i.toggleClass(s),u()}),r.length&&r.on("click",function(){i.removeClass(s),n.removeClass(a),c()}),l.length&&l.on("click",function(){i.removeClass(s),n.removeClass(a),c()}),o()(document).on("click",function(e){var o=t.find(".mobile-panel-content");!t.is(":visible")||o.is(e.target)||0!==o.has(e.target).length||n.is(e.target)||0!==n.has(e.target).length||(t.slideUp(350),n.removeClass(a),u())}),o()(document).on("keydown",function(e){"Escape"===e.key&&(t.slideUp(350),i.removeClass(s),n.removeClass(a),c())})})(n),i(n,".mobile-menu"),r(n),l(n),(e=n).hasClass("nav-vertical")&&i(e,".primary-menu"),function(e){var n=e.find('.primary-menu a[href*="#"]'),t=e.find('.mobile-menu a[href*="#"]');n.add(t).on("click",function(n){var t=o()(this).attr("href");if(t&&"#"!==t&&-1!==t.indexOf("#")){var s=t.includes("#")?t.substring(t.indexOf("#")):"";if(s&&"#"!==s){var a=o()(s);if(a.length){n.preventDefault(),o()("html").css({scrollBehavior:"auto"});var i=c();o()("html, body").animate({scrollTop:a.offset().top-i},800,function(){o()("html").css({scrollBehavior:""})}),m(e),history.pushState?history.pushState(null,null,s):window.location.hash=s,u(e,s)}}}});var s=0,a=!1;o()(window).on("scroll",function(){a||(window.requestAnimationFrame(function(){var n=Date.now();n-s>
408=300&&(f(e),s=n),a=!1}),a=!0)}),f(e)}(n),o()(window).on("resize",function(){r(n),l(n)})})},a=function(e,n){e.find(".rstb-offcanvas-wrap").each(function(e,t){var o=n(t),s=o.find(".offcanvas-toggle"),a=o.find(".offcanvas-overly"),i=o.find(".offcanvas-close"),r=o.find(".rstb-offcanvas-panel"),l="show-offcanvas",c=function(){r.removeClass(l),n("html").css({scrollbarGutter:""}),n("html, body").css({overflow:""})};s.on("click",function(e){e.preventDefault(),r.hasClass(l)?c():(r.addClass(l),n("html").css({scrollbarGutter:"stable"}),n("html, body").css({overflow:"hidden"}))}),a.on("click",c),i.on("click",c),n(document).on("keydown",function(e){"Escape"===e.key&&c()})})},i=function(e,n){e.find(".rstb-mini-search").each(function(){var e=n(this),t=e.find(".search-btn"),o=e.find(".search-form-area"),s="search-open";t.on("click",function(e){t.toggleClass(s),o.toggleClass(s)}),n(document).on("keydown",function(e){27===e.keyCode&&(t.removeClass(s),o.removeClass(s))}),n(document).on("click",function(e){!o.is(":visible")||o.is(e.target)||0!==o.has(e.target).length||t.is(e.target)||0!==t.has(e.target).length||(t.removeClass(s),o.removeClass(s))})})},r=function(e,n){e.find(".rstb-mini-cart").each(function(){var e=n(this),t=e.data("panel"),o=e.find(".rstb-cart-url"),s=e.find(".rstb-cart-panel"),a=e.find(".cart-panel-close"),i=e.find(".cart-panel-overly"),r=e.find(".rstb-cart-count"),l=e.data("auto-open"),c="show-panel";if(t&&(o.on("click",function(e){e.preventDefault(),s.toggleClass(c)}),i.on("click",function(e){s.removeClass(c)}),a.on("click",function(e){s.removeClass(c)}),n(document).on("keydown",function(e){27===e.keyCode&&s.removeClass(c)}),l)){var u=parseInt(r.text(),10)||0;n(document.body).on("wc_fragments_refreshed wc_fragments_loaded",function(){var n=parseInt(e.find(".rstb-cart-count").text(),10)||0;n>u&&s.addClass(c),u=n})}})};(e=jQuery)(function(){(function(){var e=o()(".rstb-template-popup");if(e.length){var n=o()("body");n.hasClass("single-rstb_templates")||n.hasClass("elementor-editor-active")||e.each(function(){var e=o()(this),n=e.data("settings");if(n){var t=n.id,s=n.reset_on_update?n.modified:"v1",a="rstb_popup_".concat(t,"_").concat(s),i=n.show_frequency||"every-time",r=parseInt(n.limit_display||0,10),l=parseInt(n.repeat_interval||0,10),c=!!function(e){var n="; ".concat(document.cookie).split("; ".concat(e,"="));if(2===n.length)return n.pop().split(";").shift()}(a),u="".concat(a,"_count"),f=parseInt(localStorage.getItem(u)||"0",10);if(!(r>0&&f>=r)){var m=!0;if("per-session"===i?sessionStorage.getItem(a)&&(m=!1):"x-hours"===i&&c&&(m=!1),m){var d=function(){e.addClass("show-popup"),o()("body").css("overflow","hidden"),"per-session"===i?sessionStorage.setItem(a,"1"):"x-hours"===i&&l>0&&function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o="";if(t>0){var s=new Date;s.setTime(s.getTime()+60*t*60*1e3),o="; expires="+s.toUTCString()}document.cookie="".concat(e,"=").concat(n||"").concat(o,"; path=/")}(a,"1",l),r>0&&localStorage.setItem(u,f+1)},h=function(){e.hasClass("always-on")||(e.removeClass("show-popup"),o()("body").css("overflow",""))};e.find(".popup-close, .popup-overly").on("click",h);var v=n.trigger||{};if(v.on_load){var p=1e3*(v.load_delay||0);setTimeout(d,p)}if(v.on_scroll){var g=(v.scroll_amount||50)/100*(o()(document).height()-o()(window).height());o()(window).on("scroll.popupScroll",function(){o()(window).scrollTop()>=g&&(o()(window).off("scroll.popupScroll"),d())})}if(v.on_element&&v.element_selector){var b=o()(v.element_selector);if(b.length){var w=new IntersectionObserver(function(e){e.forEach(function(e){e.isIntersecting&&(d(),w.disconnect())})});w.observe(b[0])}}v.on_click&&v.click_selector&&o()(document).on("click",v.click_selector,function(e){e.preventDefault(),d()}),o()(document).on("keydown",function(e){"Escape"===e.key&&h()})}}}})}})(),s(),function(){var e=o()(".rstb-header .e-con, .rstb-header .elementor-section");if(e.length){var n=0;o()(window).on("scroll",function(){var t=o()(window).scrollTop();e.each(function(e,s){var a=o()(s),i=a.outerHeight()+20;a.hasClass("rstb-sticky")&&(t>i?a.addClass("is-sticky"):a.removeClass("is-sticky")),a.hasClass("rstb-sticky-up")&&(t<=n&&t>i?a.addClass("is-sticky"):a.removeClass("is-sticky"))}),n=t})}}()}),e(window).on("elementor/frontend/init",function(){var n={"rstb-mini-search.default":i,"rstb-offcanvas.default":a,"rstb-mini-cart.default":r};e.each(n,function(e,n){elementorFrontend.hooks.addAction("frontend/element_ready/"+e,n)})}),e(window).on("elementor/frontend/init",function(){elementorFrontend.hooks.addAction("frontend/element_ready/rstb-nav-menu.default",function(e){window.elementorFrontend.isEditMode()&&s(e)})})}();;
409!function(){"use strict";var e={487:function(){var e,o;(e=jQuery)(window).on("load",function(){var o=e(".nerio-preloader");o.length&&o.delay(10).fadeOut(300)}),function(){var o=e(window),t=e(document),r=e("#rs-scroll-to-top");if(r.length){var n=!1;o.on("scroll",function(){n||(window.requestAnimationFrame(s),n=!0)}),o.on("load resize",s),r.on("click",function(o){o.preventDefault(),"scrollBehavior"in document.documentElement.style?window.scrollTo({top:0,behavior:"smooth"}):e("html, body").animate({scrollTop:0},500)}),s()}function s(){var e=o.scrollTop(),s=t.height()-o.height(),a=s>0?e/s:0,i=parseFloat(r.data("max"))||100,l=r.data("unit")||"%",c=a*i;"true"===String(r.data("reverse"))&&(c=i-c),c=Math.max(0,Math.min(c,i)),r[0].style.setProperty("--rs-page-scroll-progress",c+l),e>150?r.is(":visible")||r.fadeIn(200):r.is(":visible")&&r.fadeOut(200),n=!1}}(),(o=e("#rs_scheme_toggler")).length&&o.on("click",function(){var o=e("body");o.hasClass("scheme-dark")?o.removeClass("scheme-dark").addClass("scheme-light"):o.removeClass("scheme-light").addClass("scheme-dark"),o.addClass("scheme-switching"),setTimeout(function(){o.removeClass("scheme-switching")},300)})},560:function(e,o,t){t.r(o)},715:function(e,o,t){t.r(o)}},o={};function t(r){var n=o[r];if(void 0!==n)return n.exports;var s=o[r]={exports:{}};return e[r](s,s.exports,t),s.exports}t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}
409),Object.defineProperty(e,"__esModule",{value:!0})},t(715),t(560),t(487)}();;
410/**
411 * Nerio Child - Custom JavaScript
412 *
413 * Enqueued via nerio_child_enqueue_styles() in functions.php.
414 * Add custom front-end behaviour for the Nerio Child theme below.
415 */
416( function () {
417	'use strict';
418
419	document.addEventListener( 'DOMContentLoaded', function () {
420		initWhitepaperForm();
421		initExternalArchiveLinks();
422	} );
423
424	/**
425	 * `unbounce-page` campaign cards can be rendered by more than one Fancy
426	 * Post Grid Pro widget (the Site Builder "Archive Posts" widget, the
427	 * classic "Post Grid" widget's card-style.php template, etc.) - all of
428	 * them just call get_permalink()/the_permalink(), which now always
429	 * resolves `unbounce-page` posts to an external campaign.readitquik.com
430	 * URL (see Website_Functionality\Module\UnbouncePageDisplay::unbounce_permalink).
431	 * Rather than chase every widget's markup (which is paid-plugin code -
432	 * a hardcoded fix there would vanish on the next plugin update), this
433	 * targets that known destination domain directly, so it keeps working
434	 * regardless of which widget/template renders the card.
435	 */
436	function initExternalArchiveLinks() {
437		var links = document.querySelectorAll( 'a[href*="campaign.readitquik.com"]' );
438
439		Array.prototype.forEach.call( links, function ( link ) {
440			if ( 'campaign.readitquik.com' === link.hostname ) {
441				link.setAttribute( 'target', '_blank' );
442				link.setAttribute( 'rel', 'noopener noreferrer' );
443			}
444		} );
445	}
446
447	/**
448	 * Wires up the AJAX submission for the `[whitepaper_form]` shortcode
449	 * (see themes/nerio-child/whitepaper-form.php and
450	 * Website_Functionality\Module\WhitepaperFormHandler). The markup's
451	 * `onsubmit="return false;"` blocks the native submit and its inline
452	 * `checkFields()` script already disables #whitepapersubmitBtn until
453	 * every required field is filled and the opt-in box is checked; this
454	 * only needs to perform the actual request once that gate is open.
455	 *
456	 * WhitepaperFormHandler::handle() reads every value (including `id`)
457	 * via `filter_input( INPUT_GET, ... )`, so the request must be a GET
458	 * with the data in the query string rather than a POST body.
459	 */
460	function initWhitepaperForm() {
461		var form = document.getElementById( 'whitepaper-form' );
462
463		if ( ! form ) {
464			return;
465		}
466
467		form.addEventListener( 'submit', function ( event ) {
468			event.preventDefault();
469			submitWhitepaperForm( form );
470		} );
471	}
472
473	function submitWhitepaperForm( form ) {
474		var submitBtn = document.getElementById( 'whitepapersubmitBtn' );
475		var output    = form.querySelector( '.form__output' );
476
477		if ( 'true' === form.dataset.submitted ) {
478			return;
479		}
480
481		form.dataset.submitted = 'true';
482
483		if ( submitBtn ) {
484			submitBtn.disabled = true;
485		}
486
487		if ( output ) {
488			output.textContent = '';
489			output.classList.remove( 'error', 'success' );
490		}
491
492		var params = new URLSearchParams();
493
494		Array.prototype.forEach.call( form.querySelectorAll( 'input[name]' ), function ( input ) {
495			if ( 'checkbox' === input.type ) {
496				if ( input.checked ) {
497					params.append( input.name, input.value || '1' );
498				}
499			} else {
500				params.append( input.name, input.value );
501			}
502		} );
503
504		params.append( 'id', form.getAttribute( 'data-whitepaper-id' ) || '' );
505
506		var requestUrl = form.getAttribute( 'action' );
507		requestUrl += ( -1 === requestUrl.indexOf( '?' ) ? '?' : '&' ) + params.toString();
508
509		fetch( requestUrl, { credentials: 'same-origin' } )
510			.then( function ( response ) {
511				return response.json();
512			} )
513			.then( function ( response ) {
514				handleWhitepaperFormResponse( form, response );
515			} )
516			.catch( function () {
517				resetWhitepaperFormAfterFailure( form );
518
519				if ( output ) {
520					output.textContent = 'Something went wrong. Please, check all fields and try again';
521					output.classList.add( 'error' );
522				}
523			} );
524	}
525
526	function handleWhitepaperFormResponse( form, response ) {
527		var output = form.querySelector( '.form__output' );
528
529		if ( response && response.success ) {
530			if ( response.data.url ) {
531				window.open( response.data.url );
532			}
533
534			if ( output ) {
535				output.textContent = response.data.thankYouMessage || '';
536				output.classList.add( 'success' );
537			}
538
539			var fieldset = form.querySelector( 'fieldset' );
540			var button   = form.querySelector( 'button' );
541
542			if ( fieldset ) {
543				fieldset.style.display = 'none';
544			}
545
546			if ( button ) {
547				button.style.display = 'none';
548			}
549
550			if ( response.data.redirectURL ) {
551				window.location = response.data.redirectURL;
552			}
553		} else {
554			resetWhitepaperFormAfterFailure( form );
555
556			if ( output ) {
557				output.textContent = 'Something went wrong. Please, check all fields and try again';
558				output.classList.add( 'error' );
559			}
560		}
561	}
562
563	function resetWhitepaperFormAfterFailure( form ) {
564		var submitBtn = document.getElementById( 'whitepapersubmitBtn' );
565
566		form.dataset.submitted = 'false';
567
568		if ( submitBtn ) {
569			submitBtn.disabled = false;
570		}
571	}
572} )();
573;

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.