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E,cACR,uEAGDX,OAAOd,YACNpC,EACCP,SAASoE,cACR,uEAMHpE,SAASoE,cACR,oDAEA,CACD,IAAIW,EAAQ/E,SAASoE,cACpB,gCAGGL,EAAciB,MAAMC,KACvBF,EAAMX,cAAc,WAAWJ,WAAW7B,UACzC8B,QACDc,EAAMX,cAAc,YACnBW,EAAMG,mBAGRzB,OAAOd,YACNpC,EACCP,SAASoE,cACR,gCACCjC,SAAS4B,GAAamB,kBAExBnB,SAhEFN,OAAOd,YACNpC,EACCiD,EAAa/C,QAAQ,+BA+E3B0E","sources":["webpack://ctFrontend/./static/js/frontend/woocommerce/single-product-gallery.js"],"sourcesContent":["import $ from 'jquery'\nimport ctEvents from 'ct-events'\n\nfunction isTouchDevice() {\n\ttry {\n\t\tdocument.createEvent('TouchEvent')\n\t\treturn true\n\t} catch (e) {\n\t\treturn false\n\t}\n}\n\nexport const mount = (el, { event: mountEvent }) => {\n\tconst openPhotoswipeFor = (el, index = null) => {\n\t\tif (el.closest('.elementor-section-wrap')) {\n\t\t\treturn\n\t\t}\n\n\t\tvar pswpElement = $('.pswp')[0],\n\t\t\teventTarget = $(el),\n\t\t\tclicked = eventTarget\n\n\t\tconst items = [\n\t\t\t...el\n\t\t\t\t.closest('.woocommerce-product-gallery')\n\t\t\t\t.querySelectorAll(\n\t\t\t\t\t'.flexy-items .ct-image-container img:not(.zoomImg), .woocommerce-product-gallery > .ct-image-container img:not(.zoomImg), .flexy-items .ct-image-container video, .woocommerce-product-gallery > .ct-image-container video, .flexy-items .ct-image-container iframe, .woocommerce-product-gallery > .ct-image-container iframe'\n\t\t\t\t),\n\t\t].map((img) => {\n\t\t\tif (img.matches('video') || img.matches('iframe')) {\n\t\t\t\treturn {\n\t\t\t\t\thtml: `<div class=\"ct-lightbox-video-container\">${img.outerHTML}</div>`,\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\timg,\n\t\t\t\tsrc: img.closest('a') ? img.closest('a').href : img.src,\n\t\t\t\tw:\n\t\t\t\t\t(img.closest('a')\n\t\t\t\t\t\t? img.closest('a').dataset.width\n\t\t\t\t\t\t: img.width) || img.width,\n\t\t\t\th:\n\t\t\t\t\t(img.closest('a')\n\t\t\t\t\t\t? img.closest('a').dataset.height\n\t\t\t\t\t\t: img.width) || img.width,\n\t\t\t\ttitle: img.getAttribute('data-caption'),\n\t\t\t}\n\t\t})\n\n\t\tif (\n\t\t\titems.length === 1 &&\n\t\t\titems[0].img.closest('a') &&\n\t\t\t!items[0].img.closest('a').getAttribute('href')\n\t\t) {\n\t\t\treturn\n\t\t}\n\n\t\tvar options = $.extend(\n\t\t\t{\n\t\t\t\tindex: index === 0 ? 0 : index || $(clicked).index(),\n\t\t\t\taddCaptionHTMLFn: function (item, captionEl) {\n\t\t\t\t\tif (!item.title) {\n\t\t\t\t\t\tcaptionEl.children[0].textContent = ''\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t\tcaptionEl.children[0].textContent = item.title\n\t\t\t\t\treturn true\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tshareEl: false,\n\t\t\t\tcloseOnScroll: false,\n\t\t\t\thistory: false,\n\t\t\t\thideAnimationDuration: 0,\n\t\t\t\tshowAnimationDuration: 0,\n\t\t\t}\n\t\t)\n\n\t\t// Initializes and opens PhotoSwipe.\n\t\tvar photoswipe = new PhotoSwipe(\n\t\t\tpswpElement,\n\t\t\tPhotoSwipeUI_Default,\n\t\t\titems,\n\t\t\toptions\n\t\t)\n\n\t\tphotoswipe.init()\n\n\t\tdocument.body.classList.add('ct-photoswipe-open')\n\n\t\tphotoswipe.listen('close', () => {\n\t\t\tsetTimeout(() => {\n\t\t\t\tdocument.body.classList.remove('ct-photoswipe-open')\n\t\t\t\t;[\n\t\t\t\t\t...document.querySelectorAll(\n\t\t\t\t\t\t'.ct-lightbox-video-container'\n\t\t\t\t\t),\n\t\t\t\t].map((el) => el.remove())\n\t\t\t}, 300)\n\t\t})\n\t}\n\n\tconst renderPhotoswipe = ({ onlyZoom = false } = {}) => {\n\t\tlet maybeTrigger = [\n\t\t\t...document.querySelectorAll(\n\t\t\t\t'.woocommerce-product-gallery .woocommerce-product-gallery__trigger'\n\t\t\t),\n\t\t]\n\n\t\t;[\n\t\t\t...document.querySelectorAll(\n\t\t\t\t'.single-product .flexy-items .ct-image-container, .single-product .woocommerce-product-gallery > .ct-image-container'\n\t\t\t),\n\t\t].map((el) => {\n\t\t\tif (\n\t\t\t\t((window.wp &&\n\t\t\t\t\twp.customize &&\n\t\t\t\t\twp.customize('has_product_single_lightbox') &&\n\t\t\t\t\twp.customize('has_product_single_lightbox')() === 'yes') ||\n\t\t\t\t\t!window.wp ||\n\t\t\t\t\t!window.wp.customize) &&\n\t\t\t\t!onlyZoom\n\t\t\t) {\n\t\t\t\tif (!el.hasPhotoswipeListener) {\n\t\t\t\t\tel.hasPhotoswipeListener = true\n\t\t\t\t\tel.addEventListener('click', (e) => {\n\t\t\t\t\t\te.preventDefault()\n\n\t\t\t\t\t\tif (maybeTrigger.length > 0) {\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet activeIndex = 0\n\n\t\t\t\t\t\tactiveIndex = [\n\t\t\t\t\t\t\t...el.parentNode.querySelectorAll(\n\t\t\t\t\t\t\t\t'.ct-image-container'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t].indexOf(el)\n\n\t\t\t\t\t\tif (el.closest('.flexy-items')) {\n\t\t\t\t\t\t\tactiveIndex = [\n\t\t\t\t\t\t\t\t...el.closest('.flexy-items').children,\n\t\t\t\t\t\t\t].indexOf(el.parentNode)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\twindow.PhotoSwipe && openPhotoswipeFor(el, activeIndex)\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($.fn.zoom) {\n\t\t\t\tif (\n\t\t\t\t\t(window.wp &&\n\t\t\t\t\t\twp.customize &&\n\t\t\t\t\t\twp.customize('has_product_single_zoom') &&\n\t\t\t\t\t\twp.customize('has_product_single_zoom')() === 'yes') ||\n\t\t\t\t\t!window.wp ||\n\t\t\t\t\t!window.wp.customize\n\t\t\t\t) {\n\t\t\t\t\tconst rect = el.getBoundingClientRect()\n\n\t\t\t\t\tif (el.closest('.elementor-section-wrap')) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\tif (el.querySelector('iframe')) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\tif (el.querySelector('video')) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tparseFloat(el.getAttribute('data-width')) >\n\t\t\t\t\t\tel\n\t\t\t\t\t\t\t.closest('.woocommerce-product-gallery')\n\t\t\t\t\t\t\t.getBoundingClientRect().width\n\t\t\t\t\t) {\n\t\t\t\t\t\t$(el).zoom({\n\t\t\t\t\t\t\turl: el.href,\n\t\t\t\t\t\t\ttouch: false,\n\t\t\t\t\t\t\tduration: 50,\n\n\t\t\t\t\t\t\t...(rect.width > parseFloat(el.dataset.width) ||\n\t\t\t\t\t\t\trect.height > parseFloat(el.dataset.height)\n\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\tmagnify: 2,\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: {}),\n\n\t\t\t\t\t\t\t...(isTouchDevice()\n\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\ton: 'toggle',\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\tif ($.fn.zoom) {\n\t\t\tif (\n\t\t\t\t(window.wp &&\n\t\t\t\t\twp.customize &&\n\t\t\t\t\twp.customize('has_product_single_zoom') &&\n\t\t\t\t\twp.customize('has_product_single_zoom')() === 'yes') ||\n\t\t\t\t!window.wp ||\n\t\t\t\t!window.wp.customize\n\t\t\t) {\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tif (!mountEvent) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\tif (mountEvent.target.closest('.elementor-section-wrap')) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tmountEvent.target.closest('.flexy-items') ||\n\t\t\t\t\t\t(mountEvent.target.closest('.ct-image-container') &&\n\t\t\t\t\t\t\tmountEvent.target\n\t\t\t\t\t\t\t\t.closest('.ct-image-container')\n\t\t\t\t\t\t\t\t.parentNode.classList.contains(\n\t\t\t\t\t\t\t\t\t'woocommerce-product-gallery'\n\t\t\t\t\t\t\t\t))\n\t\t\t\t\t) {\n\t\t\t\t\t\t$(\n\t\t\t\t\t\t\tmountEvent.target.closest('.ct-image-container')\n\t\t\t\t\t\t).trigger(\n\t\t\t\t\t\t\tisTouchDevice() ? 'click.zoom' : 'mouseenter.zoom'\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t}, 150)\n\t\t\t}\n\t\t}\n\n\t\tmaybeTrigger.map((maybeTrigger) => {\n\t\t\tif (maybeTrigger.hasPhotoswipeListener) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tmaybeTrigger.hasPhotoswipeListener = true\n\n\t\t\tmaybeTrigger.addEventListener('click', (e) => {\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopPropagation()\n\n\t\t\t\tif (\n\t\t\t\t\tmaybeTrigger.closest('.ct-image-container') &&\n\t\t\t\t\t!maybeTrigger.closest('.flexy-items')\n\t\t\t\t) {\n\t\t\t\t\twindow.PhotoSwipe &&\n\t\t\t\t\t\topenPhotoswipeFor(\n\t\t\t\t\t\t\tmaybeTrigger.closest('.ct-image-container')\n\t\t\t\t\t\t)\n\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tmaybeTrigger.closest('.ct-image-container') &&\n\t\t\t\t\tmaybeTrigger.closest('.flexy-items') &&\n\t\t\t\t\tmaybeTrigger.closest('.ct-columns-top-gallery')\n\t\t\t\t) {\n\t\t\t\t\twindow.PhotoSwipe &&\n\t\t\t\t\t\topenPhotoswipeFor(\n\t\t\t\t\t\t\tmaybeTrigger.closest('.ct-image-container'),\n\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t...maybeTrigger.closest('.ct-image-container')\n\t\t\t\t\t\t\t\t\t.parentNode.parentNode.children,\n\t\t\t\t\t\t\t].indexOf(\n\t\t\t\t\t\t\t\tmaybeTrigger.closest('.ct-image-container')\n\t\t\t\t\t\t\t\t\t.parentNode\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tdocument.querySelector(\n\t\t\t\t\t\t'.single-product .woocommerce-product-gallery > .ct-image-container'\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\twindow.PhotoSwipe &&\n\t\t\t\t\t\topenPhotoswipeFor(\n\t\t\t\t\t\t\tdocument.querySelector(\n\t\t\t\t\t\t\t\t'.single-product .woocommerce-product-gallery > .ct-image-container'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tdocument.querySelector(\n\t\t\t\t\t\t'.single-product .flexy-items .ct-image-container'\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tlet pills = document.querySelector(\n\t\t\t\t\t\t'.single-product .flexy-pills'\n\t\t\t\t\t)\n\n\t\t\t\t\tlet activeIndex = Array.from(\n\t\t\t\t\t\tpills.querySelector('.active').parentNode.children\n\t\t\t\t\t).indexOf(\n\t\t\t\t\t\tpills.querySelector('.active') ||\n\t\t\t\t\t\t\tpills.firstElementChild\n\t\t\t\t\t)\n\n\t\t\t\t\twindow.PhotoSwipe &&\n\t\t\t\t\t\topenPhotoswipeFor(\n\t\t\t\t\t\t\tdocument.querySelector(\n\t\t\t\t\t\t\t\t'.single-product .flexy-items'\n\t\t\t\t\t\t\t).children[activeIndex].firstElementChild,\n\n\t\t\t\t\t\t\tactiveIndex\n\t\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t})\n\t\t})\n\t}\n\n\tif (mountEvent) {\n\t\tif (isTouchDevice() && mountEvent.type === 'click') {\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (mountEvent.target && mountEvent.target.click) {\n\t\t\t\t\tmountEvent.target.click()\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}\n\n\trenderPhotoswipe()\n}\n"],"names":["isTouchDevice","document","createEvent","e","mount","el","event","mountEvent","openPhotoswipeFor","index","closest","pswpElement","$","eventTarget","clicked","items","querySelectorAll","map","img","matches","html","outerHTML","src","href","w","dataset","width","h","height","title","getAttribute","length","options","addCaptionHTMLFn","item","captionEl","children","textContent","shareEl","closeOnScroll","history","hideAnimationDuration","showAnimationDuration","photoswipe","PhotoSwipe","PhotoSwipeUI_Default","init","body","classList","add","listen","setTimeout","remove","type","target","click","onlyZoom","maybeTrigger","window","wp","customize","hasPhotoswipeListener","addEventListener","preventDefault","activeIndex","parentNode","indexOf","rect","getBoundingClientRect","querySelector","parseFloat","zoom","url","touch","duration","magnify","on","contains","trigger","stopPropagation","pills","Array","from","firstElementChild","renderPhotoswipe"],"sourceRoot":""}