https://www.celes-perfume.com/wp-content/themes/shop-isle-pro/custom-js/custom.js?1790364034&ver=1.0
1document.addEventListener('DOMContentLoaded', function() { 2 if (window.location.href.indexOf('/checkout/') > -1) { 3 var textarea = document.getElementById('order_comments'); 4 var divWithClass = document.querySelector('.amazonpay-button-view1.amazonpay-button-view1-gold'); 5 textarea.addEventListener('input', function() { 6 var value = textarea.value; 7 localStorage.setItem('order_comments_value', value); 8 }); 9 10 var storedValue = localStorage.getItem('order_comments_value'); 11 if (storedValue) { 12 textarea.value = storedValue; 13 } 14 } 15 16 if (window.SGPBPopup && typeof SGPBPopup.JSONParse === "function") { 17 SGPBPopup.JSONParse = function(data) { 18 return JSON.parse(safeBase64Decode(data)); 19 }; 20 } 21}); 22 23window.onload = function() { 24 var textarea = document.getElementById('order_comments'); 25 var storedValue = localStorage.getItem('order_comments_value'); 26 if (textarea && storedValue) { 27 textarea.value = storedValue; 28 } 29}; 30 31function safeBase64Decode(b64) { 32 // Use TextDecoder if available (modern browsers) 33 if (typeof TextDecoder !== "undefined") { 34 try { 35 const binary = atob(b64); // Latin-1 string 36 const bytes = Uint8Array.from(binary, c => c.charCodeAt(0)); 37 return new TextDecoder("utf-8").decode(bytes); 38 } catch (e) { 39 console.warn("TextDecoder failed, fallback decode:", e); 40 } 41 } 42 43 // Fallback: map â %xx â decodeURIComponent 44 return decodeURIComponent( 45 atob(b64) 46 .split("") 47 .map(c => "%" + ("00" + c.charCodeAt(0).toString(16)).slice(-2)) 48 .join("") 49 ); 50} 51 52function showLoading(show) { 53 var spinner = document.getElementById('spinner'); 54 var backdrop = document.getElementById('backdrop'); 55 if (!spinner) { 56 backdrop = document.createElement('div'); 57 backdrop.id = 'backdrop'; 58 backdrop.style.cssText = 'position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); z-index: 9998; display: none; opacity: 1; visibility: visible; height: 100% !important;'; 59 document.body.appendChild(backdrop); 60 61 spinner = document.createElement('div'); 62 spinner.id = 'spinner'; 63 spinner.style.cssText = 'display: none; border: 5px solid #f3f3f3; border-top: 5px solid #21d4c8; border-radius: 50%; width: 40px; height: 40px !important; animation: spin 1s linear infinite; position: fixed; z-index: 9999; left: 50%; top: 50%; margin: -20px 0 0 -20px; opacity: 1; visibility: visible;'; 64 document.body.appendChild(spinner); 65 } 66 backdrop.style.display = show ? 'block' : 'none'; 67 spinner.style.display = show ? 'block' : 'none'; 68} 69 70function hideOtherDropdownMenu(element) { 71 var customMenus = document.querySelectorAll('#menu-primary-menu > .menu-item'); 72 var openDropdownMenuClassName = getOpenDropdownMenuClassName(); 73 customMenus.forEach(function(item) { 74 if (item.id !== element.id) { 75 item.classList.remove(openDropdownMenuClassName); 76 } 77 }); 78} 79 80function restoreTransformOtherDropdown() { 81 var dropdownmenuElement = document.querySelectorAll('#menu-primary-menu >.menu-item > .dropdownmenu'); 82 dropdownmenuElement.forEach(function(item) { 83 item.style.setProperty('transform', ''); 84 }); 85} 86 87function isMobileRender() { 88 return window.innerWidth <= 768; 89} 90function getOpenDropdownMenuClassName() { 91 if (isMobileRender()) { 92 return 'this-open'; 93 } else { 94 return 'open'; 95 } 96} 97 98function handleUpdateDropdownIcon(element) { 99 var openDropdownMenuClassName = getOpenDropdownMenuClassName(); 100 var isOpen = element.classList.contains(openDropdownMenuClassName); 101 var dropdownmenuElement = element.querySelector('.dropdownmenu'); 102 if (dropdownmenuElement) { 103 if (isOpen) { 104 dropdownmenuElement.style.setProperty('transform', 'rotate(180deg)', 'important'); 105 } else { 106 dropdownmenuElement.style.setProperty('transform', ''); 107 } 108 } 109} 110 111function toggleDropdownMenu(element) { 112 var openDropdownMenuClassName = getOpenDropdownMenuClassName(); 113 element.classList.toggle(openDropdownMenuClassName); 114 hideOtherDropdownMenu(element); 115} 116 117function handleAddEventClickMenuItem(element) { 118 if (!element.hasAttribute('data-clicked')) { 119 element.setAttribute('data-clicked', 'true'); 120 element.addEventListener('click', function(event) { 121 event.stopPropagation(); 122 toggleDropdownMenu(element); 123 }); 124 125 var itemLink = element.querySelector(':scope > a'); 126 itemLink.addEventListener('click', function(event) { 127 event.preventDefault(); 128 }); 129 } 130} 131 132function handlerAddEventClickDropdownIcon(element) { 133 if (!element.hasAttribute('data-clicked')) { 134 element.setAttribute('data-clicked', 'true'); 135 element.addEventListener('click', function(event) { 136 if (isMobileRender()) { 137 event.stopPropagation(); 138 } else { 139 event.stopImmediatePropagation(); 140 event.stopPropagation(); 141 var clickEvent = new Event('click'); 142 event.currentTarget.parentElement.dispatchEvent(clickEvent); 143 } 144 }); 145 } 146} 147 148function hideOtherZoomImgContainer(excludeElement) { 149 var zoomImgContainers = document.querySelectorAll('.product-option .zoom-img-container');
150 zoomImgContainers.forEach(zoomImgContainer => { 151 if (zoomImgContainer !== excludeElement) { 152 zoomImgContainer.classList.remove('show-zoom'); 153 } 154 }); 155} 156 157document.addEventListener('DOMContentLoaded', function() { 158 var customMenus = document.querySelectorAll('#menu-primary-menu > .menu-item'); 159 customMenus.forEach(function(menu) { 160 menu.addEventListener('mouseover', function(event) { 161 event.stopImmediatePropagation(); 162 }); 163 menu.addEventListener('mouseout', function(event) { 164 event.stopImmediatePropagation(); 165 }); 166 }); 167 168 var dropdownMenus = document.querySelectorAll('#menu-primary-menu > .menu-item.menu-item-has-children > .dropdownmenu'); 169 dropdownMenus.forEach(function(item) { 170 handlerAddEventClickDropdownIcon(item); 171 }); 172 173 var customClicks = document.querySelectorAll('#menu-primary-menu > .menu-item.menu-item-has-children'); 174 customClicks.forEach(function(item) { 175 handleAddEventClickMenuItem(item); 176 }); 177 178 var dropdownObserver = new MutationObserver(function(mutationsList, observer) { 179 mutationsList.forEach(function(mutation) { 180 var node = mutation.target; 181 var menuItemHasChildren = node.querySelector('.menu-item.menu-item-has-children') 182 if (menuItemHasChildren) { 183 handleAddEventClickMenuItem(menuItemHasChildren); 184 } 185 186 var dropdownmenuElement = node.querySelector('.dropdownmenu') 187 if (dropdownmenuElement) { 188 handlerAddEventClickDropdownIcon(dropdownmenuElement); 189 } 190 }); 191 }); 192 193 var menuPrimaryMenu = document.getElementById('menu-primary-menu'); 194 if (menuPrimaryMenu) { 195 dropdownObserver.observe(menuPrimaryMenu, { childList: true, subtree: true }); 196 } 197 198 var classChangeObserver = new MutationObserver(function(mutationsList, observer) { 199 mutationsList.forEach(function(mutation) { 200 if (mutation.type === 'attributes' && mutation.attributeName === 'class') { 201 var node = mutation.target; 202 handleUpdateDropdownIcon(node); 203 } 204 }); 205 }); 206 207 var menuItemHasChildrenElements = document.querySelectorAll('.menu-item-has-children'); 208 menuItemHasChildrenElements.forEach(function(targetElement) { 209 classChangeObserver.observe(targetElement, { attributes: true }); 210 }); 211 212}); 213 214document.addEventListener('DOMContentLoaded', function() { 215 document.querySelectorAll('.product-option').forEach(function(option) { 216 var imageContainer = option.querySelector('.image-container'); 217 var zoomImgContainer = option.querySelector('.zoom-img-container'); 218 219 imageContainer.addEventListener('click', function(event) { 220 event.stopPropagation(); 221 event.preventDefault(); 222 if (zoomImgContainer) { 223 zoomImgContainer.classList.toggle('show-zoom'); 224 } 225 var currentZoomImgContainer = event.target.closest('.product-option').querySelector('.zoom-img-container'); 226 hideOtherZoomImgContainer(currentZoomImgContainer); 227 }); 228 229 if (!isMobileRender()){ 230 imageContainer.addEventListener('mouseenter', function() { 231 if (zoomImgContainer) { 232 zoomImgContainer.classList.add('show-zoom'); 233 } 234 }); 235 236 imageContainer.addEventListener('mouseleave', function() { 237 if (zoomImgContainer) { 238 zoomImgContainer.classList.remove('show-zoom'); 239 } 240 }); 241 } 242 }); 243 document.addEventListener('click', function(event) { 244 var zoomImgContainers = document.querySelectorAll('.product-option .zoom-img-container'); 245 zoomImgContainers.forEach(zoomImgContainer => { 246 zoomImgContainer.classList.remove('show-zoom'); 247 }); 248 }); 249}); 250 251function convertToTrackArray(object) { 252 if (object.items && object.items.length > 0) { 253 var { items, ...rest } = object; 254 255 var result = items.map(item => { 256 var newItem = { ...rest }; 257 for (var key in item) { 258 if (item.hasOwnProperty(key)) { 259 if (key.startsWith('item_')) { 260 newItem[key] = item[key]; 261 } else { 262 newItem['item_' + key] = item[key]; 263 } 264 } 265 } 266 267 var categories = newItem.item_category.split('/'); 268 newItem.item_category = categories[0] || ''; 269 newItem.item_category2 = categories[1] || ''; 270 newItem.item_category3 = categories[2] || ''; 271 newItem.item_category4 = categories[3] || ''; 272 newItem.item_category5 = categories[4] || ''; 273 274 return newItem; 275 }); 276 277 return result; 278 } else { 279 return object; 280 } 281} 282 283function makeTrackEventChatbotJS(eventName, eventDetail) { 284 var IS_DEBUG = false; 285 var CHAT_BOT_API_HOST = 'https://www.celes-perfume.com'; 286 var SESSION_ID_ITEM_NAME = 'CelesSessionId'; 287 var API_KEY = "O0MtSPcIeSziCTpNTCyIeDKVygp0zXTU"; 288 289 var API_URL = `${CHAT_BOT_API_HOST}/track_event/`; 290 var sessionId = localStorage.getItem(SESSION_ID_ITEM_NAME); 291 var requestOptions = { 292 method: "POST", 293 headers: { 294 "Content-Type": "application/json", 295 "x-api-key": `${API_KEY}` 296 }, 297 body: JSON.stringify({ 298 session_id: sessionId, 299 event_name: eventName, 300 event_detail: eventDetail 301 }) 302 }; 303 304 fetch(API_URL, requestOptions) 305 .catch((error) => { 306 if (IS_DEBUG) { 307 console.error(error); 308 } 309 });
vendor: 3 bytes, line 310
310}
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.