PageSourceSearch

https://potatocongress.org/wp-content/plugins/ecwid-shopping-cart/js/static-page.js?ver=1786269272

js potatocongress.org collected 2026-09-25 04:35:17 UTC 28,255 bytes, 703 lines download raw bytes

1(function () {
2    var isTouchDevice = false;
3    var staticId = null;
4    var staticContentClass = 'static-content';
5    var dynamicId = null;
6    var ecwidPageOpened = false;
7    var autoSwitchStaticToDynamicWhenReady = false;
8    var autoSwitchStaticToDynamicWhenReadyDefault = false;
9    var invisibleDynamicContainerStyle = "display: block !important; height: 0 !important; max-height: 0 !important; min-height: 0 !important; overflow-y: auto !important; margin: 0 !important; padding: 0 !important;";
10    var mainCategoryId = 0;
11    var initialCategoryOffset = 0;
12    var pageAlreadyLoaded = false;
13
14    function find(selector) {
15        return document.querySelector(selector);
16    }
17
18    function isDynamicMode() {
19        function isVisible(elem) {
20            return !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length);
21        }
22
23        var staticHtml = find('#' + staticId);
24        return !staticHtml || !isVisible(staticHtml);
25    }
26
27    function isRootCategory() {
28        var urlHash = window.location.hash;
29        return urlHash === '' || (urlHash.indexOf("#!/c/0/") === -1 && urlHash.indexOf("#!//c/0/") === -1);
30    }
31
32    function isHashbangPage() {
33        var urlHash = window.location.hash;
34        return urlHash !== '' && urlHash.indexOf("#!/") >= 0
35    }
36
37    function loadScriptJs(onScriptJsLoadedCallback) {
38        var scriptJs = document.createElement('script');
39        scriptJs.src = ec.storefront.staticPages.lazyLoading.scriptJsLink;
40        if (scriptJs.readyState) {
41            scriptJs.onreadystatechange = function () {
42                if (scriptJs.readyState === 'loaded' || scriptJs.readyState === 'complete') {
43                    onScriptJsLoadedCallback();
44                }
45            };
46        } else {
47            scriptJs.onload = onScriptJsLoadedCallback;
48        }
49        var dynamicEl = find("#" + ec.storefront.staticPages.dynamicContainerID);
50        dynamicEl.appendChild(scriptJs);
51    };
52
53    function processStaticHomePage() {
54
55        window.ec = window.ec || {};
56        window.ec.storefront = window.ec.storefront || {};
57        window.ec.storefront.staticPages = window.ec.storefront.staticPages || {};
58
59        window.ec.storefront.staticPages.switchStaticToDynamic = switchToDynamicMode;
60
61        function onDocumentReady(fn) {
62            if (document.attachEvent ? document.readyState === "complete" : document.readyState !== "loading") {
63                fn();
64            } else {
65                document.addEventListener('DOMContentLoaded', fn);
66            }
67        }
68
69        onDocumentReady(function () {
70            var staticStorefrontEnabled = window.ec.storefront.staticPages.staticStorefrontEnabled || false;
71
72            if (staticStorefrontEnabled !== true) {
73                return;
74            }
75
76            staticId = ec.storefront.staticPages.staticContainerID;
77            dynamicId = ec.storefront.staticPages.dynamicContainerID;
78            if (!staticId || !document.querySelector("#" + staticId)) {
79                if (!!console) {
80                    console.warn("Static storefront is enabled, but no staticContainerID is provided or container is not present");
81                }
82                return;
83            }
84            if (!dynamicId || !document.querySelector("#" + dynamicId)) {
85                if (!!console) {
86                    console.warn("Static storefront is enabled, but no dynamicContainerID is provided or container is not present");
87                }
88                return;
89            }
90
91            if (window.location.hash.indexOf("#!/c/0") !== -1) {
92                var element = document.querySelector("#" + staticId);
93                element.scrollIntoView(true);
94            }
95
96            if (!!('ontouchstart' in window)) {
97                isTouchDevice = true;
98                document.body.classList.add('touchable');
99            }
100
101            var needDisableLazyLoading = false;
102            if (ecwidLoaded() || isHashbangPage()) {
103                needDisableLazyLoading = true;
104            }
105
106            if (needDisableLazyLoading && typeof ec.storefront.staticPages.lazyLoading !== "undefined") {
107                var onScriptJsLoadedCallback = function () {
108                    xProductBrowser.apply(this, ec.storefront.staticPages.lazyLoading.xProductBrowserArguments);
109                }
110
111                loadScriptJs(onScriptJsLoadedCallback);
112            }
113
114            if (!needDisableLazyLoading && typeof ec.storefront.staticPages.lazyLoading !== "undefined") {
115                if (typeof ec.storefront.staticPages.lazyLoading.scriptJsLink === "undefined") {
116                    if (!!console) {
117                        console.warn("Storefront lazy loading is enabled, but no scriptJsLink is provided");
118                    }
119                    return;
120                }
121                if (typeof ec.storefront.staticPages.lazyLoading.xProductBrowserArguments === "undefined") {
122                    if (!!console) {
123                        console.warn("Storefront lazy loading is enabled, but no xProductBrowser arguments are provided");
124                    }
125                    return;
126                }
127
128                toggleLazyLoadingEvents(true);
129
130                var lazyLoading = true;
131
132                function lazyLoadingEventHandler() {
133                    if (typeof lazyLoading === 'undefined') {
134                        if (!!console) {
135                            console.warn("Unable to fetch script.js outside of lazy loading mode");
136                        }
137                    } else {
138                        toggleLazyLoadingEvents(false);
139                        loadScriptJs(lazyInitDynamic);
140                    }
141                }
142
143                var lazyInitDynamic = function () {
144                    xProductBrowser.apply(this, ec.storefront.staticPages.lazyLoading.xProductBrowserArguments);
145
146                    setupEcwidWhenLoaded();
147                }
148
149                function toggleLazyLoadingEvents(add) {
150                    var staticDivEventsForLazyLoading = ['mousedown', 'mouseup', 'mousemove', 'contextmenu', 'keydown', 'ke
150yup'];
151                    var staticDivTouchEventsForLazyLoading = ['touchstart', 'touchend', 'touchcancel', 'touchmove'];
152
153                    var toggleEvent = function (el, add, event) {
154                        if (add) {
155                            el.addEventListener(event, lazyLoadingEventHandler, { passive: true });
156                        } else {
157                            el.removeEventListener(event, lazyLoadingEventHandler);
158                        }
159                    }
160
161                    //var staticEl = find('#' + staticId);
162                    if (isTouchDevice) {
163                        staticDivTouchEventsForLazyLoading.forEach(
164                            function applyEvent(event) {
165                                toggleEvent(document, add, event);
166                            }
167                        );
168                    } else {
169                        staticDivEventsForLazyLoading.forEach(
170                            function applyEvent(event) {
171                                toggleEvent(document, add, event);
172                            }
173                        );
174                    }
175                }
176            }
177
178            var mainCategoryIdFromConfig = ec.storefront.staticPages.mainCategoryId;
179            if (mainCategoryIdFromConfig) {
180                mainCategoryId = mainCategoryIdFromConfig;
181            }
182
183
184            var autoSwitchStaticToDynamicWhenReadyFromConfig = ec.storefront.staticPages.autoSwitchStaticToDynamicWhenReady;
185            if (autoSwitchStaticToDynamicWhenReadyFromConfig) {
186                autoSwitchStaticToDynamicWhenReady = autoSwitchStaticToDynamicWhenReadyFromConfig;
187            } else {
188                autoSwitchStaticToDynamicWhenReady = autoSwitchStaticToDynamicWhenReadyDefault;
189            }
190
191            if (ec.storefront.staticPages.initialCategoryOffset) {
192                initialCategoryOffset = ec.storefront.staticPages.initialCategoryOffset;
193            }
194
195            hideStorefront();
196            showStaticHtml();
197
198            window.ec.config = window.ec.config || {};
199
200            if (!isRootCategory()) {
201                hideStorefront();
202                switchToDynamicMode();
203                return;
204            }
205
206            if (!autoSwitchStaticToDynamicWhenReady) {
207                addStaticPageHandlers();
208            }
209
210            function setupAfterEcwidLoaded() {
211
212                const event = document.createEvent('Event');
213                event.initEvent('setupAfterEcwidLoaded', true, false);
214                document.dispatchEvent(event);
215
216                var cartWidgets = document.getElementsByClassName('ec-cart-widget');
217                if (cartWidgets.length > 0) {
218                    Ecwid.init();
219                }
220
221                // if a store is opened for a client, then the storeClosed won't be true
222                // if a store is opened for a client and we've uploaded a closed banner, then we check it in dynamic
223                Ecwid.OnAPILoaded.add(function () {
224                    if (isDynamicMode()) {
225                        // if we've already switched to dynamic, we don't need to dispatch this event anymore
226                        return;
227                    }
228                    var storeClosed = window.ecwid_initial_data !== undefined
229                        ? window.ecwid_initial_data.data.storeClosed // Storefront v2
230                        : false; // Storefront v3
231                    var storeClosedWrapper = document.querySelectorAll('.ecwid-maintenance-wrapper');
232                    var storeNotClosedAndWrapperExists = !storeClosed && storeClosedWrapper.length > 0;
233
234                    if (storeClosed
235                        || storeNotClosedAndWrapperExists
236                        || hasEcwidMessages()
237                    ) {
238                        switchToDynamicMode();
239                    }
240                });
241
242                Ecwid.OnPageLoad.add(function (openedPage) {
243                    if (isDynamicMode()) {
244                        // if we've already switched to dynamic, we don't need to dispatch this event anymore
245                        return;
246                    }
247                    if (openedPage.type === "CART"
248                        || openedPage.type === "ORDERS"
249                        || openedPage.type === "FAVORITES"
250                        || openedPage.type === "SIGN_IN"
251                        || openedPage.type === "RESET_PASSWORD"
252                        || hasEcwidMessages()
253                    ) {
254                        // static links from bottom of the page should be processed before page load event finishes,
255                        // so self pre-opening scroll didn't make the page jump
256                        switchToDynamicMode();
257                    }
258                });
259
260                addOnPageLoadedCallback(function (openedPage) {
261                    if (isDynamicMode()) {
262                        // if we've already switched to dynamic, we don't need to dispatch this event anymore
263                        return;
264                    }
265
266                    if (autoSwitchStaticToDynamicWhenReady) {
267                        switchToDynamicWhenReadyWithRetries(10);
268                        return;
269                    }
270
271                    if (!hasEcwidMessages()
272                        && !ecwidPageOpened
273                        && openedPage.type === "CATEGORY"
274                        && openedPage.categoryId === mainCategoryId
275                        && openedPage.offset === initialCategoryOffset) {
276
277                        // we don't need to dispatch root category loading,
278                        // since our static contents covers it for the first time
279                        return;
280                    }
281                    // other than self we must show opened page in dynamic view,
282                    // because static view contains only root category page
283                    switchToDynamicMode();
284                }, 0);
285            }
286
287            function switchToDynamicWhenReadyWithRetries(retry) {
288                if (retry <= 0) {
289                    switchToDynamicMode();
290                    return;
291                }
292
293                var allImagesLoaded = allImagesLoadedInDynamicMarkup();
294                if (!allImagesLoaded) {
295                    setTimeout(function () {
296                        switchToDynamicWhenReadyWithRetries(retry - 1);
297                    }, 100);
298                    return
299                }
300
301                switchToDynamicMode();
302            }
303
304            function allImagesLoadedInDynamicMarkup() {
305                if (!dynamicId) {
306                    return true;
307                }
308
309                try {
310                    var firstNotLoadedCategory = document.querySelector('#' + dynamicId + ' .grid-category--loading');
311                    if (firstNotLoadedCategory != null) {
312                        return false;
313                    }
314
315                    var firstNotLoadedProduct = document.querySelector('#' + dynamicId + ' .grid-product--loading');
316                    if (firstNotLoadedProduct != null) {
317                        return false;
318                    }
319                } catch (e) {
320                }
321
322                return true;
323            }
324
325            function ecwidLoaded() {
326                return typeof Ecwid !== "undefined" && !!Ecwid.OnAPILoaded && !!Ecwid.OnAPILoaded.add;
327            }
328
329            function hasEcwidMessages() {
330                // If the merchant has at least one custom label, then switch to dynamics regardless of the page type or click
331                return !!window.ecwidMessages && Object.keys(window.ecwidMessages).length > 0;
332            }
333
334            var setupEcwidWhenLoaded = function () {
335                if (ecwidLoaded()) {
336                    setupAfterEcwidLoaded();
337                } else {
338                    var setupIntervalId = setInterval(function () {
339                        if (ecwidLoaded()) {
340                            setupAfterEcwidLoaded();
341                            clearInterval(setupIntervalId);
342                        }
343                    }, 100);
344                }
345            };
346
347            if (typeof lazyLoading === 'undefined') {
348                // Follow legacy dynamic store initialization flow
349                setupEcwidWhenLoaded();
350            }
351        });
352    }
353
354    function addStaticPageHandlers() {
355        function addClickHandlers(selector, elementProcessor) {
356            var elements = document.querySelectorAll(selector);
357            for (var i = 0; i < elements.length; i++) {
358                elementProcessor(elements[i]);
359            }
360        }
361
362        addClickHandlers('#' + staticId + ' .breadcrumbs__link', function (element) {
363            var categoryId = element.getAttribute('data-category-id');
364            if (categoryId !== mainCategoryId) {
365                addStaticClickEvent(element, openEcwidPage('category', { 'id': categoryId }));
366            }
367        });
368
369        var orderByOptions = document.querySelector('#' + staticId + ' .grid__sort select');
370        if (!!orderByOptions) {
371            orderByOptions.addEventListener('change', function (event) {
372                openEcwidPage('category', {
373                    'id': mainCategoryId,
374                    'sort': orderByOptions.value
375                })(event);
376            });
377        }
378
379        addClickHandlers('#' + staticId + ' .grid__sort .grid-sort__item--filter', function (element) {
380            addStaticClickEvent(element, function () {
381                addOnPageLoadedCallback(function () {
382                    if (isDynamicMode()) {
383                        return;
384                    }
385                    switchToDynamicMode();
386                    Ecwid.showProductFilters();
387                }, 0);
388            });
389        });
390
391        addClickHandlers('#' + staticId + ' .grid-category__card a', function (element) {
392            var categoryId = element.getAttribute('data-category-id');
393            addStaticClickEvent(element, openEcwidPage('category', { 'id': categoryId }));
394        });
395
396        addClickHandlers('#' + staticId + ' .grid-product:not(.grid-product--view-all) a:not(.open-external-url)', function (element) {
397            var productId = element.getAttribute('data-product-id');
398            addStaticClickEvent(element, openEcwidPage('product', { 'id': productId }));
399        });
400
401        addClickHandlers('#' + staticId + ' .grid-product:not(.grid-product--view-all) .grid-product__wrap[data-product-id]', function (element) {
402            var productId = element.getAttribute('data-product-id');
403            addStaticClickEvent(element, openEcwidPage('product', { 'id': productId }));
404        });
405
406        addClickHandlers('#' + staticId + ' .grid-product--view-all a', function (element) {
407            var categoryId = element.getAttribute('data-category-id');
408            addStaticClickEvent(element, openEcwidPage('category', { 'id': categoryId }));
409        })
410
411        addClickHandlers('#' + staticId + ' .grid-product__buy-now .form-control', function (element) {
412            const productId = element.getAttribute('data-product-id');
413            const isGermanStore = element.getAttribute('data-country-code') 
413=== 'DE';
414            const updatedBuyButtonsFeature = element.getAttribute('data-updated-buy-buttons') != null;
415            const params = { 'id': productId };
416            if (updatedBuyButtonsFeature && !isGermanStore) {
417                params['buyNow'] = '';
418            }
419            addStaticClickEvent(element, openEcwidPage('product', params, true));
420        });
421
422        addClickHandlers('#' + staticId + ' .footer__link--gift-card', function (element) {
423            var productId = element.getAttribute('data-product-id');
424            addStaticClickEvent(element, openEcwidPage('product', { 'id': productId }));
425        });
426
427        addClickHandlers('#' + staticId + ' .footer__link--all-products', function (element) {
428            addStaticClickEvent(element, openEcwidPage('search'));
429        });
430
431        addClickHandlers('#' + staticId + ' .footer__link--track-order', function (element) {
432            addStaticClickEvent(element, openEcwidPage('account/orders'));
433        });
434
435        addClickHandlers('#' + staticId + ' .footer__link--shopping-favorites', function (element) {
436            addStaticClickEvent(element, openEcwidPage('account/favorites'));
437        });
438
439        addClickHandlers('#' + staticId + ' .footer__link--shopping-cart', function (element) {
440            addStaticClickEvent(element, openEcwidPage('cart'));
441        });
442
443        addClickHandlers('#' + staticId + ' .footer__link--sigin-in', function (element) {
444            addStaticClickEvent(element, openEcwidPage('signin'));
445        });
446
447        addClickHandlers('#' + staticId + ' .footer__link--my-account', function (element) {
448            addStaticClickEvent(element, openEcwidPage('account/settings'));
449        });
450
451        addClickHandlers('#' + staticId + ' .pager__button', function (element) {
452            var pageNumber = element.getAttribute('data-page-number') || 2;
453            addStaticClickEvent(element, openEcwidPage('category', {
454                'id': mainCategoryId,
455                'page': pageNumber
456            }));
457        });
458
459        addClickHandlers('#' + staticId + ' .pager__number', function (element) {
460            var pageNumber = element.getAttribute('data-page-number');
461            addStaticClickEvent(element, openEcwidPage('category', {
462                'id': mainCategoryId,
463                'page': pageNumber
464            }));
465        });
466
467        addClickHandlers('#' + staticId + ' .open-external-url', function (element) {
468            addStaticClickEvent(element, function (e) {
469                e.stopPropagation();
470            });
471        });
472    }
473
474    function addStaticClickEvent(el, callback) {
475        var x = 0,
476            y = 0,
477            dx = 0,
478            dy = 0,
479            isTap = false;
480
481        if (isTouchDevice) {
482            el.addEventListener('touchstart', function (e) {
483                isTap = true;
484                x = e.touches[0].clientX;
485                y = e.touches[0].clientY;
486                dx = 0;
487                dy = 0;
488            }, { passive: true });
489            el.addEventListener('touchmove', function (e) {
490                dx = e.changedTouches[0].clientX - x;
491                dy = e.changedTouches[0].clientY - y;
492            }, { passive: true });
493            el.addEventListener('touchend', function (e) {
494                if (isTap && Math.abs(dx) < 10 && Math.abs(dy) < 10) {
495                    callback(e);
496                }
497            });
498        }
499
500        el.addEventListener('click', function (e) {
501            if (!isTap) {
502                callback(e);
503            } else {
504                isTap = false;
505            }
506        });
507    }
508
509    function openEcwidPage(page, params, stopPropagation = false) {
510        return function (e) {
511            if (stopPropagation) {
512                e.stopPropagation();
513            }
514            if (isCtrlClickOnProductEvent(page, e)) {
515                // In case product element in grid was clicked with ctrl/meta key, do not invoke e.preventDefault()
516                // and do nothing. Event will be handled and processed by default ctrl/meta + click handler on
517                // underlying <a> element. New background tab with product page will be opened.
518                return;
519            }
520
521            e.preventDefault();
522            // we must wait for Ecwid first page to be ready before changing it
523            addOnPageLoadedCallback(function () {
524                if (isDynamicMode() && ecwidPageOpened) {
525                    // if we've already switched to dynamic, we don't need to dispatch this event anymore
526                    return;
527                }
528                var onClickCallback = window.ec.storefront.staticPages.onClickCallback;
529                if (!autoSwitchStaticToDynamicWhenReady && onClickCallback) {
530                    onClickCallback();
531                }
532                ecwidPageOpened = true;
533                var element = find('#' + staticId + " .ec-wrapper");
534                if (!!element) {
535                    elementsClassListAction([element], function (list) {
536                        list.add("ec-wrapper--transition");
537                    });
538                }
539                Ecwid.openPage(page, params);
540            }, 0);
541        }
542    }
543
544    function isCtrlClickOnProductEvent(page, event) {
545        return page === 'product' && (event.ctrlKey || event.metaKey)
546    }
547
548    function addOnPageLoadedCallback(callback, attempt) {
549        const isModernStorefront = window.Ecwid && window.Ecwid.isStorefrontV3 && window.Ecwid.isStorefrontV3();
550        if (isModernStorefront && pageAlreadyLoaded) {
551            callback();
552            return;
553        }
554
555        // let's wait for the Ecwid environment to be loaded for up to 2000 milliseconds
556        if (attempt >= 40) {
557            if (!!console) {
558                console.warn("failed to add Ecwid.OnPageLoaded callback");
559            }
560            return;
561        }
562
563        if (typeof (Ecwid) == 'object' && typeof (Ecwid.OnPageLoaded) == 'object') {
564            Ecwid.OnPageLoaded.add(function (page) {
565                pageAlreadyLoaded = true;
566                callback(page);
567            });
568        } else {
569            setTimeout(function () {
570                addOnPageLoadedCallback(callback, attempt + 1);
571            }, 50);
572        }
573    }
574
575    function hideStorefront() {
576        var dynamicEl = find('#' + dynamicId);
577        var currentStyleAttribute = dynamicEl.getAttribute("style") || "";
578
579        dynamicEl.setAttribute("style", currentStyleAttribute + invisibleDynamicContainerStyle);
580    }
581
582    function showStorefront() {
583        var dynamicEl = find('#' + dynamicId);
584        // disable zero-height trick to show the storefront
585        dynamicEl.style.height = "";
586        dynamicEl.style.maxHeight = "";
587        dynamicEl.style.minHeight = "";
588        dynamicEl.style.overflowY = "";
589        dynamicEl.style.margin = "";
590        dynamicEl.style.padding = "";
591        dynamicEl.style.display = "block";
592    }
593
594    function hideStaticHtml() {
595        var staticEl = find('#' + staticId);
596        if (!!staticEl) {
597            staticEl.style.opacity = 0;
598            staticEl.style.display = 'none';
599        }
600    }
601
602    function showStaticHtml() {
603        var element = find('#' + staticId + " ." + staticContentClass);
604        if (!!element) {
605            element.style.opacity = 1;
606        }
607    }
608
609    function switchToDynamicMode() {
610        requestAnimationFrame(function () {
611            removeClassAnimationForAutoSwitchToDynamic();
612            showStorefront();
613            hideStaticHtml();
614
615            var staticEl = find('#' + staticId);
616            if (staticEl && staticEl.parentNode) {
617                staticEl.parentNode.removeChild(staticEl);
618            }
619            var switchToDynamicCallback = window.ec.storefront.staticPages.switchToDynamicCallback;
620
621            var element = find('#' + staticId + " .ec-wrapper");
622            if (!!element) {
623                elementsClassListAction([element], function (list) {
624                    list.remove("ec-wrapper--transition");
625                });
626            }
627            if (!autoSwitchStaticToDynamicWhenReady && switchToDynamicCallback) {
628                switchToDynamicCallback();
629            }
630        });
631    }
632
633    function removeClassAnimationForAutoSwitchToDynamic() {
634        if (!autoSwitchStaticToDynamicWhenReady) {
635            return;
636        }
637        var wrapers = document.querySelectorAll('.ec-wrapper--animated-transitions');
638        var arrWrapers = Array.prototype.slice.call(wrapers);
639        elementsClassListAction(arrWrapers, function (list) {
640            list.remove('ec-wrapper--animated-transitions');
641        });
642    }
643
644    function elementsClassListAction(elements, callback) {
645        if (!(Array.isArray(elements))) {
646            return;
647        }
648        for (var key in elements) {
649            var list = elements[key].classList;
650            if (typeof list != 'undefined') {
651                callback(list);
652            }
653        }
654    }
655
656    processStaticHomePage();
657
658    function forceDynamicLoadingIfRequired() {
659        if (typeof ec.storefront.staticPages.lazyLoading === "undefined") {
660            if (!!console) {
661                console.warn("Storefront lazy loading is not enabled to switch in dynamic mode");
662            }
663            return;
664        }
665        if (typeof ec.storefront.staticPages.lazyLoading.scriptJsLink === "undefined") {
666            if (!!console) {
667                console.warn("No scriptJsLink is provided to switch in dynamic mode");
668            }
669            return;
670        }
671        if (typeof ec.storefront.staticPages.lazyLoading.xProductBrowserArguments === "undefined") {
672            if (!!console) {
673                console.warn("No xProductBrowser arguments are provided to switch in dynamic mode");
674            }
675            return;
676        }
677
678        var staticContainer = document.getElementById(ec.storefront.staticPages.staticContainerID);
679
680        var rootCategory = isRootCategory();
681        if (!rootCategory) {
682            while (staticContainer.lastChild) {
683                staticContainer.lastChild.remove();
684            }
685
686            var onScriptJsLoadedCallback = function () {
687                xProductBrowser.apply(this, ec.storefront.staticPages.lazyLoading.xProductBrowserArguments);
688            }
689
690            loadScriptJs(onScriptJsLoadedCallback);
691        } else {
692            staticContainer.style.height = "";
693            staticContainer.style.maxHeight = "";
694            staticContainer.style.minHeight = "";
695            staticContainer.style.overflowY = "";
696        }
697    }
698
699    window.ec = window.ec || {};
700    window.ec.storefront = window.ec.storefront || {};
701    window.ec.storefront.staticPages = window.ec.storefront.staticPages || {};
702    window.ec.storefront.staticPages.forceDynamicLoadingIfRequired = forceDynamicLoadingIfRequired;
703})();

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.