{"version":3,"file":"main-55a4be74.min.js","sources":["../src/js/main/PhotoSwiper.js","../src/js/unishop.js","../src/js/main/HttpService.js","../src/js/main/AdminService.js","../src/js/main/ClientEnvInfo.js","../src/js/main/ObjectUtils.js","../src/js/main/GlobalErrorHandler.js","../src/js/main/AsyncSemaphore.js","../src/js/main/SessionStorageService.js","../src/js/main/Cookies.js","../src/js/main/ModalPopup.js","../src/js/main/FormValidator.js","../src/js/main/LoginRegistration.js","../src/js/business/WarrantyForm.js","../src/js/business/SubmitMeasurementsForm.js","../src/js/business/LinkBusinessMdlService.js","../src/js/business/RetailerSearch.js","../src/js/designer-app/StatusMonitor.js","../src/js/designer-app/DesignerAppLauncher.js","../src/js/designer-app/BrowserEnvironment.js","../src/js/designer-app/DesignerTelemetrySession.js","../src/js/designer-app/DesignerAppService.js","../src/js/designer-app/StartDesignerProcessSteps.js","../src/js/main/WindowResizeMonitor.js","../src/js/designer-app/JQueryPopupDialog.js","../src/js/designer-app/StartDesignerProcess.js","../src/js/designer-app/StartDesignerViewModel.js","../src/js/main.js"],"sourcesContent":["/* global PhotoSwipe, PhotoSwipeUI_Default */\r\n\r\n/**\r\n * The code in the PhotoSwiper class is adapted from https://photoswipe.com/documentation/getting-started.html,\r\n * below the \"How to build an array of slides from a list of links\" heading.\r\n */\r\n\r\n/**\r\n * The swiper will add click event handlers to all gallery selector and fullscreen capable elements\r\n * in the DOM. The event handlers will display the associated image(s) in a fullscreen viewer and\r\n * allow browsing the images.\r\n */\r\nexport class PhotoSwiper {\r\n constructor(galleriesSelector, fullScreenCapableSelector, photoSwipeLoadPromise) {\r\n this.galleriesSelector = galleriesSelector;\r\n this.fullScreenCapableSelector = fullScreenCapableSelector;\r\n /* This is a script load promise which allows us to wait for the script (containing the\r\n * PhotoSwipe library) to load before we're using it. */\r\n this.photoSwipeLoadPromise = photoSwipeLoadPromise;\r\n this.galleryIdAttr = 'data-pswp-uid';\r\n this.galleryHistoryAttr = 'data-history'; // on the element containing the galleriesSelector\r\n this.pswpBgAttr = 'data-pswp-bg';\r\n\r\n this.pswp__bg = document.querySelector('.pswp__bg');\r\n this.galleries = [];\r\n this.fullScreenCapables = [];\r\n this.refresh();\r\n }\r\n\r\n elementExists(element, allElements) {\r\n for (var i = 0, l = allElements.length; i < l; i++) {\r\n if (element === allElements[i])\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * This method allows users to refresh the galleries if the DOM is modified after the initial\r\n * creation of this swiper. */\r\n refresh() {\r\n let galleryIndex = this.galleries.length; // 1-based\r\n const galleries = document.querySelectorAll(this.galleriesSelector);\r\n for (let i = 0, l = galleries.length; i < l; i++) {\r\n if (!this.elementExists(galleries[i], this.galleries)) {\r\n galleries[i].setAttribute(this.galleryIdAttr, galleryIndex + 1);\r\n galleries[i].onclick = event => this.handleGalleryClick(event);\r\n this.galleries.push(galleries[i]);\r\n galleryIndex++;\r\n }\r\n }\r\n\r\n const fullScreenCapables = document.querySelectorAll(this.fullScreenCapableSelector);\r\n for (let i = 0, l = fullScreenCapables.length; i < l; i++) {\r\n if (!this.elementExists(fullScreenCapables[i], this.fullScreenCapables)) {\r\n fullScreenCapables[i].setAttribute(this.galleryIdAttr, galleryIndex + 1);\r\n let clickTarget = null;\r\n if (this.hasClass(fullScreenCapables[i], 'custom-zoom-target')) {\r\n /* We're going to handle clicks associated with the element which has a 'zoom-target' class.\r\n * Since we assume fullScreenCapables[i] is an img, the zoom target cannot be child of fullScreenCapables[i].\r\n * Let's use the next sibling instead (if present). */\r\n clickTarget = fullScreenCapables[i].nextElementSibling;\r\n } else {\r\n clickTarget = fullScreenCapables[i];\r\n }\r\n if (clickTarget) {\r\n clickTarget.onclick = event => this.handleFullScreenCapableClick(event);\r\n } else {\r\n console.log('Custom zoom target not found');\r\n }\r\n this.fullScreenCapables.push(galleries[i]);\r\n galleryIndex++;\r\n }\r\n }\r\n\r\n if (this.galleries.length > 0 || fullScreenCapables.length > 0) {\r\n // Parse URL and open photo swiper if it contains #&pid=3&gid=1\r\n const hashData = this.parseUrlHashValue();\r\n if (hashData.pid && (typeof hashData.gid != 'undefined')) {\r\n /* TODO: This code will break if the swiper was updated after the initial creation because\r\n * there might be galleries after the fullScreenCapables. */\r\n const gid = hashData.gid - 1;\r\n const isGallery = gid < this.galleries.length;\r\n const element = isGallery ? this.galleries[gid] : fullScreenCapables[gid - this.galleries.length];\r\n /*await*/ this.openPhotoSwipe(hashData.pid, element, true, true, isGallery);\r\n }\r\n }\r\n }\r\n\r\n // Helper: find the nearest parent element of el\r\n closest(el, fn) {\r\n return el && (fn(el) ? el : this.closest(el.parentNode, fn));\r\n }\r\n\r\n // Helper: returns true if cls is defined on the class attribute of element\r\n hasClass(element, cls) {\r\n return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1;\r\n }\r\n\r\n // Helper: parse picture index and gallery index from the URL's hash value (#&pid=1&gid=2)\r\n parseUrlHashValue() {\r\n const hash = window.location.hash.substring(1);\r\n const params = {};\r\n if (hash.length < 5) {\r\n return params;\r\n }\r\n const vars = hash.split('&');\r\n for (let i = 0; i < vars.length; i++) {\r\n if (vars[i]) {\r\n var pair = vars[i].split('=');\r\n if (pair.length >= 2) {\r\n params[pair[0]] = pair[1];\r\n }\r\n }\r\n }\r\n if (params.gid) {\r\n params.gid = parseInt(params.gid, 10);\r\n }\r\n return params;\r\n }\r\n\r\n /**\r\n * If isGallery is true, then galleryParentElement should be the immediate parent of the list of\r\n * elements containing the 'gallery-item' class.\r\n * If isGallery is false, then galleryParentElement should be the img element to display fullscreen.\r\n */\r\n createItemObjects(galleryParentElement, isGallery) {\r\n const galleryItems = isGallery\r\n ? $(galleryParentElement).find('.gallery-item:not(.isotope-hidden)').get()\r\n : [galleryParentElement];\r\n const itemObjects = [];\r\n for (let i = 0; i < galleryItems.length; i++) {\r\n const galleryItem = galleryItems[i]; //