1var WPRecipeMaker; 2/******/ (() => { // webpackBootstrap 3/******/ var __webpack_modules__ = ({ 4 5/***/ 3524: 6/***/ (() => { 7 8window.WPRecipeMaker = typeof window.WPRecipeMaker === "undefined" ? {} : window.WPRecipeMaker; 9window.WPRecipeMaker.analytics = { 10 init: () => { 11 if (wprm_public.settings.analytics_enabled || wprm_public.settings.google_analytics_enabled) { 12 document.addEventListener('click', function (e) { 13 const target = e.target.closest ? e.target.closest('.wprm-recipe-jump, .wprm-recipe-jump-video, .wprm-recipe-pin, .wprm-recipe-facebook-share, .wprm-recipe-messenger-share, .wprm-recipe-twitter-share, .wprm-recipe-bluesky-share, .wprm-recipe-mastodon-share, .wprm-recipe-tumblr-share, .wprm-recipe-text-share, .wprm-recipe-whatsapp-share, .wprm-recipe-email-share, .wprm-recipe-favorite, .wprm-recipe-add-to-collection-recipe, .wprm-recipe-add-to-shopping-list, .wprm-recipe-cook-mode, .wprm-recipe-equipment a, .wprm-recipe-ingredient a, .wprm-recipe-instruction a') : false; 14 if (target) { 15 window.WPRecipeMaker.analytics.checkClick(target, e); 16 } 17 }, false); 18 } 19 }, 20 checkClick: (target, e) => { 21 if (target.matches('.wprm-recipe-jump')) { 22 const recipeId = target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe : false; 23 if (recipeId) { 24 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'jump-to-recipe'); 25 } 26 return true; 27 } else if (target.matches('.wprm-recipe-jump-video')) { 28 const recipeId = target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe : false; 29 if (recipeId) { 30 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'jump-to-video'); 31 } 32 return true; 33 } else if (target.matches('.wprm-recipe-pin')) { 34 const recipeId = target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe : false; 35 if (recipeId) { 36 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'pin-button'); 37 } 38 return true; 39 } else if (target.matches('.wprm-recipe-facebook-share')) { 40 const recipeId = target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe : false; 41 if (recipeId) { 42 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'facebook-share-button'); 43 } 44 return true; 45 } else if (target.matches('.wprm-recipe-messenger-share')) { 46 const recipeId = target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe : false; 47 if (recipeId) { 48 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'messenger-share-button'); 49 } 50 return true; 51 } else if (target.matches('.wprm-recipe-twitter-share')) { 52 const recipeId = target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe : false; 53 if (recipeId) { 54 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'twitter-share-button'); 55 } 56 return true; 57 } else if (target.matches('.wprm-recipe-bluesky-share')) { 58 const recipeId = target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe : false; 59 if (recipeId) { 60 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'bluesky-share-button'); 61 } 62 return true; 63 } else if (target.matches('.wprm-recipe-mastodon-share')) { 64 const recipeId = target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe : false; 65 if (recipeId) { 66 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'mastodon-share-button'); 67 } 68 return true; 69 } else if (target.matches('.wprm-recipe-tumblr-share')) { 70 const recipeId = target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe : false; 71 if (recipeId) { 72 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'tumblr-share-button'); 73 } 74 return true; 75 } else if (target.matches('.wprm-recipe-text-share')) { 76 const recipeId = target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe : false;
77 if (recipeId) { 78 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'text-share-button'); 79 } 80 return true; 81 } else if (target.matches('.wprm-recipe-whatsapp-share')) { 82 const recipeId = target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe : false; 83 if (recipeId) { 84 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'whatsapp-share-button'); 85 } 86 return true; 87 } else if (target.matches('.wprm-recipe-email-share')) { 88 const recipeId = target.dataset.hasOwnProperty('recipe') ? target.dataset.recipe : false; 89 if (recipeId) { 90 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'email-share-button'); 91 } 92 return true; 93 } else if (target.matches('.wprm-recipe-favorite')) { 94 const recipeId = target.dataset.hasOwnProperty('recipeId') ? target.dataset.recipeId : false; 95 if (recipeId) { 96 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'favorite-button', { 97 action: target.classList.contains('wprm-recipe-favorite-active') ? 'remove' : 'add' 98 }); 99 } 100 return true; 101 } else if (target.matches('.wprm-recipe-add-to-collection-recipe')) { 102 const recipeId = target.dataset.hasOwnProperty('recipe') ? target.dataset.recipeId : false; 103 if (recipeId) { 104 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'add-to-collections-button'); 105 } 106 return true; 107 } else if (target.matches('.wprm-recipe-add-to-shopping-list')) { 108 const recipeId = target.dataset.hasOwnProperty('recipe') ? target.dataset.recipeId : false; 109 if (recipeId) { 110 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'add-to-shopping-list-button'); 111 } 112 return true; 113 } else if (target.matches('.wprm-recipe-cook-mode')) { 114 const recipeId = target.dataset.hasOwnProperty('recipeId') ? target.dataset.recipeId : false; 115 if (recipeId) { 116 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'cook-mode-button'); 117 } 118 return true; 119 } else if (target.matches('.wprm-recipe-equipment a')) { 120 const container = target.closest('.wprm-recipe-equipment-container'); 121 if (container) { 122 const item = target.closest('.wprm-recipe-equipment-item'); 123 const type = item && item.classList.contains('wprm-recipe-equipment-item-has-image') ? 'image' : 'text'; 124 const name = item ? item.querySelector('.wprm-recipe-equipment-name') : target; 125 const recipeId = container.dataset.recipe; 126 if (recipeId) { 127 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'equipment-link', { 128 url: target.href, 129 type, 130 name: name ? name.innerText : 'unknown' 131 }); 132 } 133 } 134 return true; 135 } else if (target.matches('.wprm-recipe-ingredient a')) { 136 const container = target.closest('.wprm-recipe-ingredients-container'); 137 138 // Get ingredient name. 139 let name = false; 140 const parent = target.closest('.wprm-recipe-ingredient'); 141 if (parent) { 142 name = parent.querySelector('.wprm-recipe-ingredient-name'); 143 } 144 if (container) { 145 const recipeId = container.dataset.recipe; 146 if (recipeId) { 147 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'ingredient-link', { 148 url: target.href, 149 name: name ? name.innerText : 'unknown' 150 }); 151 } 152 } 153 return true; 154 } else if (target.matches('.wprm-recipe-instruction a')) { 155 const container = target.closest('.wprm-recipe-instructions-container'); 156 if (container) { 157 const recipeId = container.dataset.recipe; 158 if (recipeId) { 159 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'instruction-link', { 160 url: target.href 161 }); 162 } 163 } 164 return true; 165 } 166 return false;
167 }, 168 registerAction: (recipeId, postId, type, meta = {}) => { 169 window.WPRecipeMaker.analytics.registerActionLocal(recipeId, postId, type, meta); 170 window.WPRecipeMaker.analytics.registerActionGoogleAnalytics(recipeId, postId, type, meta); 171 }, 172 registerActionOnce: (recipeId, postId, type, meta = {}) => { 173 if (window.WPRecipeMaker.analytics.registeredActions.hasOwnProperty(`recipe-${recipeId}`) && window.WPRecipeMaker.analytics.registeredActions[`recipe-${recipeId}`].hasOwnProperty(type)) { 174 // Already tracked this action for this recipe on this pageload, ignore. 175 return; 176 } 177 178 // Track action as already registered for this recipe. 179 if (!window.WPRecipeMaker.analytics.registeredActions.hasOwnProperty(`recipe-${recipeId}`)) { 180 window.WPRecipeMaker.analytics.registeredActions[`recipe-${recipeId}`] = {}; 181 } 182 window.WPRecipeMaker.analytics.registeredActions[`recipe-${recipeId}`][type] = true; 183 184 // Hadn't been tracked yet, so do it now. 185 window.WPRecipeMaker.analytics.registerAction(recipeId, postId, type, meta); 186 }, 187 registerActionLocal: (recipeId, postId, type, meta = {}) => { 188 if (wprm_public.settings.analytics_enabled) { 189 // Ignore these for local tracking, tracked in PHP. 190 if ('comment-rating' === type || 'user-rating' === type) { 191 return; 192 } 193 let headers = { 194 'Accept': 'application/json', 195 'Content-Type': 'application/json' 196 }; 197 198 // Only require nonce when logged in to prevent caching problems for regular visitors. 199 if (0 < parseInt(wprm_public.user)) { 200 headers['X-WP-Nonce'] = wprm_public.api_nonce; 201 } 202 203 // Register action through API. 204 fetch(wprm_public.endpoints.analytics, { 205 method: 'POST', 206 headers, 207 credentials: 'same-origin', 208 body: JSON.stringify({ 209 recipeId, 210 postId, 211 type, 212 meta, 213 uid: getAnalyticsVisitorId(), 214 nonce: wprm_public.nonce 215 }) 216 }); 217 } 218 }, 219 registerActionGoogleAnalytics: (recipeId, postId, type, meta = {}) => { 220 if (wprm_public.settings.google_analytics_enabled && window.hasOwnProperty('gtag')) { 221 const event = 'wprm_' + type.replace(/-/g, '_'); 222 const label = type.replace(/-/g, ' '); 223 let eventData = { 224 event_category: 'wprecipemaker', 225 event_label: 'WPRM ' + label.charAt(0).toUpperCase() + label.slice(1), 226 wprm_recipe_id: '' + recipeId, 227 wprm_post_id: '' + postId 228 }; 229 230 // Check if recipe object is available. 231 const recipe = window.WPRecipeMaker.manager.getRecipeImmediately(recipeId); 232 if (recipe) { 233 if (recipe.data.hasOwnProperty('name')) { 234 eventData.wprm_recipe_name = recipe.data.name; 235 } 236 if (recipe.data.hasOwnProperty('slug')) { 237 eventData.wprm_recipe_slug = recipe.data.slug; 238 } 239 } 240 241 // Special case for ratings. 242 if (('comment-rating' === type || 'user-rating' === type) && meta.hasOwnProperty('rating')) { 243 eventData.value = meta.rating; 244 delete meta.rating; 245 } 246 247 // Pass along other meta. 248 if (meta && 'object' === typeof meta) { 249 Object.keys(meta).forEach(key => { 250 if ('' !== meta[key] && null !== meta[key] && typeof meta[key] !== 'undefined') { 251 eventData[`wprm_event_${key}`] = '' + meta[key]; 252 } 253 }); 254 } 255 window.gtag('event', event, eventData); 256 } 257 }, 258 registeredActions: {} 259}; 260ready(() => { 261 window.WPRecipeMaker.analytics.init(); 262}); 263function ready(fn) { 264 if (document.readyState != 'loading') { 265 fn(); 266 } else { 267 document.addEventListener('DOMContentLoaded', fn); 268 } 269} 270function getCookieValue(a) { 271 var b = document.cookie.match('(^|;)\\s*' + a + '\\s*=\\s*([^;]+)'); 272 return b ? b.pop() : ''; 273} 274function getAnalyticsVisitorId() { 275 let visitorId = getCookieValue('wprm_analytics_visitor'); 276 if (!visitorId) { 277 visitorId = generateAnalyticsVisitorId();
278 setCookieValue('wprm_analytics_visitor', visitorId); 279 } 280 return visitorId; 281} 282function generateAnalyticsVisitorId() { 283 if (window.crypto && window.crypto.getRandomValues) { 284 const values = new Uint32Array(2); 285 window.crypto.getRandomValues(values); 286 return Date.now().toString(36) + values[0].toString(36) + values[1].toString(36); 287 } 288 return Date.now().toString(36) + Math.random().toString(36).substring(2, 12); 289} 290function setCookieValue(name, value) { 291 let cookie = name + '=' + encodeURIComponent(value) + '; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/; SameSite=Lax'; 292 if ('https:' === window.location.protocol) { 293 cookie += '; Secure'; 294 } 295 document.cookie = cookie; 296} 297 298/***/ }), 299 300/***/ 8455: 301/***/ (() => { 302 303window.WPRecipeMaker = typeof window.WPRecipeMaker === "undefined" ? {} : window.WPRecipeMaker; 304window.WPRecipeMaker.manager = { 305 init: () => {}, 306 recipes: {}, 307 findRecipesOnPage: () => { 308 let recipes = []; 309 const potentialRecipes = document.querySelectorAll('*[data-recipe-id]'); 310 for (let potentialRecipe of potentialRecipes) { 311 const id = parseInt(potentialRecipe.dataset.recipeId); 312 if (id) { 313 recipes.push(id); 314 } 315 } 316 317 // Return unique IDs. 318 return [...new Set(recipes)]; 319 }, 320 resetRecipe: id => { 321 if (window.WPRecipeMaker.manager.recipes.hasOwnProperty(`recipe-${id}`)) { 322 delete window.WPRecipeMaker.manager.recipes[`recipe-${id}`]; 323 } 324 }, 325 getRecipe: (id, loadDifferentId = false) => { 326 id = 'preview' === id ? id : parseInt(id); 327 if (!window.WPRecipeMaker.manager.recipes.hasOwnProperty(`recipe-${id}`)) { 328 return window.WPRecipeMaker.manager.loadRecipe(id, loadDifferentId); 329 } 330 return Promise.resolve(window.WPRecipeMaker.manager.recipes[`recipe-${id}`]); 331 }, 332 getRecipeImmediately: id => { 333 id = 'preview' === id ? id : parseInt(id); 334 let recipe = window.WPRecipeMaker.manager.recipes.hasOwnProperty(`recipe-${id}`) ? window.WPRecipeMaker.manager.recipes[`recipe-${id}`] : false; 335 336 // Check if data does not need to be loaded through API. 337 if (!recipe) { 338 if (window.hasOwnProperty('wprm_recipes') && window.wprm_recipes.hasOwnProperty(`recipe-${id}`)) { 339 const recipeData = window.wprm_recipes[`recipe-${id}`]; 340 recipe = window.WPRecipeMaker.manager.loadRecipeObject(id, recipeData); 341 window.WPRecipeMaker.manager.recipes[`recipe-${id}`] = recipe; 342 } 343 } 344 return recipe; 345 }, 346 loadRecipe: (id, loadDifferentId = false) => { 347 return new Promise((resolveRecipe, rejectRecipe) => { 348 // Check for data added in PHP of try loading through API. 349 const getRecipeData = new Promise((resolveData, rejectData) => { 350 const idToGetDataFor = loadDifferentId ? loadDifferentId : id; 351 if (window.hasOwnProperty('wprm_recipes') && window.wprm_recipes.hasOwnProperty(`recipe-${idToGetDataFor}`)) { 352 resolveData(window.wprm_recipes[`recipe-${idToGetDataFor}`]); 353 } else { 354 window.WPRecipeMaker.manager.loadRecipeDataFromAPI(idToGetDataFor).then(result => { 355 resolveData(result); 356 }); 357 } 358 }); 359 getRecipeData.then(recipeData => { 360 // Create recipe object from recipe data. 361 let recipe = false; 362 if (recipeData) { 363 recipe = window.WPRecipeMaker.manager.loadRecipeObject(id, recipeData); 364 } 365 window.WPRecipeMaker.manager.recipes[`recipe-${id}`] = recipe; 366 resolveRecipe(recipe); 367 }); 368 }); 369 }, 370 loadRecipeDataFromAPI: id => { 371 let headers = { 372 'Accept': 'application/json', 373 'Content-Type': 'application/json' 374 }; 375 376 // Only require nonce when logged in to prevent caching problems for regular visitors. 377 if (0 < parseInt(wprm_public.user)) { 378 headers['X-WP-Nonce'] = wprm_public.api_nonce; 379 } 380 return new Promise((resolve, reject) => { 381 fetch(`${wprm_public.endpoints.manage}/recipe/${id}`, { 382 method: 'POST', 383 headers, 384 credentials: 'same-origin', 385 body: JSON.stringify({ 386 format: 'frontend' 387 }) 388 }).then(response => { 389 if (response.ok) { 390 return response.json(); 391 } 392 return false;
393 }).then(result => { 394 resolve(result); 395 }); 396 }); 397 }, 398 loadRecipeObject: (id, data) => { 399 let recipe = { 400 id, 401 data, 402 // Functions to be overwritten. Define here to prevent errors. 403 setServings: (...args) => {}, 404 setAdvancedServings: (...args) => {}, 405 setUnitSystem: (...args) => {}, 406 addRating: (...args) => {} 407 }; 408 409 // Check if premium is active and should add functionality. 410 if (window.WPRecipeMaker.hasOwnProperty('managerPremium')) { 411 recipe = window.WPRecipeMaker.managerPremium.loadRecipeObject(id, recipe); 412 } 413 return recipe; 414 }, 415 triggerChangeEvent: (id, type) => { 416 document.dispatchEvent(new CustomEvent('wprm-recipe-change', { 417 detail: { 418 id, 419 type 420 } 421 })); 422 }, 423 changeRecipeData: (id, data) => { 424 if (window.WPRecipeMaker.manager.recipes.hasOwnProperty(`recipe-${id}`)) { 425 window.WPRecipeMaker.manager.recipes[`recipe-${id}`].data = { 426 ...window.WPRecipeMaker.manager.recipes[`recipe-${id}`].data, 427 ...data 428 }; 429 430 // Raw data change event. 431 document.dispatchEvent(new CustomEvent('wprm-recipe-change-data', { 432 detail: { 433 id 434 } 435 })); 436 } 437 } 438}; 439ready(() => { 440 window.WPRecipeMaker.manager.init(); 441}); 442function ready(fn) { 443 if (document.readyState != 'loading') { 444 fn(); 445 } else { 446 document.addEventListener('DOMContentLoaded', fn); 447 } 448} 449 450/***/ }), 451 452/***/ 3579: 453/***/ (() => { 454 455window.WPRecipeMaker = typeof window.WPRecipeMaker === "undefined" ? {} : window.WPRecipeMaker; 456window.WPRecipeMaker.print = { 457 hasAccess: () => { 458 if (wprm_public.settings.hasOwnProperty('print_access_allowed')) { 459 return !!wprm_public.settings.print_access_allowed; 460 } 461 const access = wprm_public.settings.hasOwnProperty('print_access') ? wprm_public.settings.print_access : 'everyone'; 462 if ('disabled' === access) { 463 return false; 464 } 465 if ('logged_in' === access && 0 >= parseInt(wprm_public.user)) { 466 return false; 467 } 468 return true; 469 }, 470 init: () => { 471 document.addEventListener('click', function (e) { 472 const target = e.target.closest ? e.target.closest('.wprm-recipe-print, .wprm-print-recipe-shortcode') : false; 473 if (target) { 474 WPRecipeMaker.print.onClick(target, e); 475 } 476 }, false); 477 }, 478 onClick: (el, e) => { 479 if (!WPRecipeMaker.print.hasAccess()) { 480 e.preventDefault(); 481 return; 482 } 483 let recipeId = el.dataset.recipeId; 484 485 // Backwards compatibility. 486 if (!recipeId) { 487 const container = el.closest('.wprm-recipe-container'); 488 if (container) { 489 recipeId = container.dataset.recipeId; 490 } 491 } 492 493 // Still no recipe ID? Just follow the link. Override otherwise. 494 if (recipeId) { 495 e.preventDefault(); 496 recipeId = parseInt(recipeId); 497 498 // Optional template to print. 499 const template = el.dataset.hasOwnProperty('template') ? el.dataset.template : ''; 500 501 // Analytics. 502 let location = 'other'; 503 const parent = el.closest('.wprm-recipe'); 504 if (parent) { 505 if (parent.classList.contains('wprm-recipe-snippet')) { 506 location = 'snippet'; 507 } else if (parent.classList.contains('wprm-recipe-roundup-item')) { 508 location = 'roundup'; 509 } else { 510 location = 'recipe'; 511 } 512 } 513 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'print', { 514 location 515 }); 516 517 // Actually print. 518 WPRecipeMaker.print.recipeAsIs(recipeId, template); 519 } 520 }, 521 recipeAsIs: (id, template = '') => { 522 let servings = false, 523 system = 1, 524 advancedServings = false; 525 window.WPRecipeMaker.manager.getRecipe(id).then(recipe => { 526 if (recipe) { 527 // Unit System. 528 if (recipe.data.hasOwnProperty('currentSystem')) { 529 system = recipe.data.currentSystem; 530 } 531 532 // Only if servings changed. 533 if (recipe.data.currentServingsParsed !== recipe.data.originalServingsParsed) { 534 servings = recipe.data.currentServingsParsed; 535 } 536 537 // Advanced Servings. 538 advancedServings = recipe.data.currentAdvancedServings; 539 } 540 WPRecipeMaker.print.recipe(id, servings, system, advancedServings, template); 541 }); 542 }, 543 recipe: (id, servings = false, system = 1, advancedServings = false, template = '') => { 544 let slug = false;
545 if ('slug' === wprm_public.settings.print_recipe_identifier) { 546 const recipe = window.WPRecipeMaker.manager.getRecipeImmediately(id); 547 if (recipe && recipe.data.slug) { 548 slug = recipe.data.slug; 549 550 // Remove optional wprm- prefix. 551 if (slug.startsWith('wprm-')) { 552 slug = slug.substring(5); 553 } 554 } 555 } 556 557 // Use slug in print URL if set. 558 let urlArgs = slug ? slug : id; 559 if (template) { 560 urlArgs += `/${template}`; 561 } 562 const url = WPRecipeMaker.print.getUrl(urlArgs); 563 if (!url) { 564 return; 565 } 566 const target = wprm_public.settings.print_new_tab ? '_blank' : '_self'; 567 568 // Pass along data to print window before opening it. 569 const printArgs = { 570 id, 571 system, 572 servings, 573 advancedServings 574 }; 575 localStorage.setItem('wprmPrintArgs', JSON.stringify(printArgs)); 576 577 // Open print window. 578 const printWindow = window.open(url, target); 579 580 // Focus on print window when opening in new tab. 581 if ('_blank' === target) { 582 printWindow.onload = () => { 583 printWindow.focus(); 584 if (printWindow.hasOwnProperty('WPRMPrint')) { 585 printWindow.WPRMPrint.setArgs(printArgs); 586 } 587 }; 588 } 589 }, 590 getUrl: args => { 591 if (!WPRecipeMaker.print.hasAccess()) { 592 return false; 593 } 594 const urlParts = wprm_public.home_url.split(/\?(.+)/); 595 596 // Ensure base URL always has a trailing slash before appending the slug. 597 let printUrl = urlParts[0]; 598 if (!printUrl.endsWith('/')) { 599 printUrl += '/'; 600 } 601 if (wprm_public.permalinks) { 602 printUrl += wprm_public.print_slug + '/' + args; 603 if (urlParts[1]) { 604 printUrl += '?' + urlParts[1]; 605 } 606 } else { 607 printUrl += '?' + wprm_public.print_slug + '=' + args; 608 if (urlParts[1]) { 609 printUrl += '&' + urlParts[1]; 610 } 611 } 612 return printUrl; 613 } 614}; 615ready(() => { 616 window.WPRecipeMaker.print.init(); 617}); 618function ready(fn) { 619 if (document.readyState != 'loading') { 620 fn(); 621 } else { 622 document.addEventListener('DOMContentLoaded', fn); 623 } 624} 625 626/***/ }), 627 628/***/ 6563: 629/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { 630 631/* global __webpack_public_path__ */ 632 633const publicAssetsUrl = window.wprm_public && window.wprm_public.assets_url; 634if (publicAssetsUrl) { 635 __webpack_require__.p = publicAssetsUrl; 636} 637 638/***/ }), 639 640/***/ 1104: 641/***/ (() => { 642 643window.WPRecipeMaker = typeof window.WPRecipeMaker === "undefined" ? {} : window.WPRecipeMaker; 644window.WPRecipeMaker.recipe = { 645 init: () => { 646 window.addEventListener('wpupgInitReady', function (e) { 647 const grid = e.detail; 648 window.WPRecipeMaker.recipe.wpupgGridCompatibility(grid); 649 }); 650 }, 651 wpupgGridCompatibility: grid => { 652 if (grid) { 653 grid.on('itemsLoaded', () => { 654 window.WPRecipeMaker.recipe.initFeatures(); 655 }); 656 } 657 }, 658 initFeatures: (args = {}) => { 659 // If we're initting a specific recipe, reset it first. 660 if (args.hasOwnProperty('id')) { 661 window.WPRecipeMaker.manager.resetRecipe(args.id); 662 } 663 if (window.WPRecipeMaker) { 664 if (window.WPRecipeMaker.hasOwnProperty('advancedServings')) { 665 window.WPRecipeMaker.advancedServings.init(); 666 } 667 if (window.WPRecipeMaker.hasOwnProperty('quantities')) { 668 window.WPRecipeMaker.quantities.init(); 669 if (args.hasOwnProperty('id')) { 670 if (args.hasOwnProperty('servings')) { 671 const servings = parseInt(args.servings); 672 if (servings) { 673 setTimeout(() => { 674 window.WPRecipeMaker.quantities.setServings(args.id, servings); 675 }, 100); 676 } 677 } 678 } 679 } 680 if (window.WPRecipeMaker.hasOwnProperty('instacart')) { 681 window.WPRecipeMaker.instacart.init(); 682 } 683 if (window.WPRecipeMaker.hasOwnProperty('jumpToSection')) { 684 window.WPRecipeMaker.jumpToSection.init(); 685 } 686 if (window.WPRecipeMaker.hasOwnProperty('timer')) { 687 window.WPRecipeMaker.timer.init(); 688 } 689 if (window.WPRecipeMaker.hasOwnProperty('preventSleep')) { 690 window.WPRecipeMaker.preventSleep.init(); 691 } 692 if (window.WPRecipeMaker.hasOwnProperty('privateNotes')) { 693 window.WPRecipeMaker.privateNotes.init(); 694 } 695 if (window.WPRecipeMaker.hasOwnProperty('tooltip')) { 696 window.WPRecipeMaker.tooltip.init(); 697 } 698 if (window.WPRecipeMaker.hasOwnProperty('video')) { 699 if (wprm_public.settings.video_force_ratio) { 700 window.WPRecipeMaker.video.init(); 701 } 702 } 703 } 704 document.dispatchEvent(new CustomEvent('wprmRecipeInit', { 705 detail: args 706 })); 707 } 708}; 709 710// Don't wait for DOMContentLoaded. Listener needs to be added as soon as possible. 711window.WPRecipeMaker.recipe.init(); 712 713/***/ }), 714 715/***/ 9002: 716/***/ (() => { 717 718window.WPRecipeMaker = typeof window.WPRecipeMaker === "undefined" ? {} : window.WPRecipeMaker; 719window.WPRecipeMaker.temperature = { 720 getTemperatures() { 721 let temperatures = []; 722 const containers = document.querySelectorAll('.wprm-temperature-container');
vendor: 5,597 bytes, lines 723-920
723 for (let container of containers) { 724 temperatures.push(WPRecipeMaker.temperature.getData(container)); 725 } 726 return temperatures; 727 }, 728 getData(container) { 729 return { 730 container, 731 value: container.dataset.value, 732 unit: container.dataset.unit, 733 help: container.dataset.tooltip 734 }; 735 } 736}; 737 738/***/ }), 739 740/***/ 4181: 741/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 742 743"use strict"; 744 745// EXPORTS 746__webpack_require__.d(__webpack_exports__, { 747 Ay: () => (/* binding */ tippy_esm), 748 DX: () => (/* binding */ inlinePositioning) 749}); 750 751// UNUSED EXPORTS: animateFill, createSingleton, delegate, followCursor, hideAll, roundArrow, sticky 752 753;// ./node_modules/@popperjs/core/lib/dom-utils/getWindow.js 754function getWindow(node) { 755 if (node == null) { 756 return window; 757 } 758 759 if (node.toString() !== '[object Window]') { 760 var ownerDocument = node.ownerDocument; 761 return ownerDocument ? ownerDocument.defaultView || window : window; 762 } 763 764 return node; 765} 766;// ./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js 767 768 769function isElement(node) { 770 var OwnElement = getWindow(node).Element; 771 return node instanceof OwnElement || node instanceof Element; 772} 773 774function isHTMLElement(node) { 775 var OwnElement = getWindow(node).HTMLElement; 776 return node instanceof OwnElement || node instanceof HTMLElement; 777} 778 779function isShadowRoot(node) { 780 // IE 11 has no ShadowRoot 781 if (typeof ShadowRoot === 'undefined') { 782 return false; 783 } 784 785 var OwnElement = getWindow(node).ShadowRoot; 786 return node instanceof OwnElement || node instanceof ShadowRoot; 787} 788 789 790;// ./node_modules/@popperjs/core/lib/utils/math.js 791var math_max = Math.max; 792var math_min = Math.min; 793var round = Math.round; 794;// ./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js 795 796 797function getBoundingClientRect(element, includeScale) { 798 if (includeScale === void 0) { 799 includeScale = false; 800 } 801 802 var rect = element.getBoundingClientRect(); 803 var scaleX = 1; 804 var scaleY = 1; 805 806 if (isHTMLElement(element) && includeScale) { 807 var offsetHeight = element.offsetHeight; 808 var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale 809 // Fallback to 1 in case both values are `0` 810 811 if (offsetWidth > 0) { 812 scaleX = round(rect.width) / offsetWidth || 1; 813 } 814 815 if (offsetHeight > 0) { 816 scaleY = round(rect.height) / offsetHeight || 1; 817 } 818 } 819 820 return { 821 width: rect.width / scaleX, 822 height: rect.height / scaleY, 823 top: rect.top / scaleY, 824 right: rect.right / scaleX, 825 bottom: rect.bottom / scaleY, 826 left: rect.left / scaleX, 827 x: rect.left / scaleX, 828 y: rect.top / scaleY 829 }; 830} 831;// ./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js 832 833function getWindowScroll(node) { 834 var win = getWindow(node); 835 var scrollLeft = win.pageXOffset; 836 var scrollTop = win.pageYOffset; 837 return { 838 scrollLeft: scrollLeft, 839 scrollTop: scrollTop 840 }; 841} 842;// ./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js 843function getHTMLElementScroll(element) { 844 return { 845 scrollLeft: element.scrollLeft, 846 scrollTop: element.scrollTop 847 }; 848} 849;// ./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js 850 851 852 853 854function getNodeScroll(node) { 855 if (node === getWindow(node) || !isHTMLElement(node)) { 856 return getWindowScroll(node); 857 } else { 858 return getHTMLElementScroll(node); 859 } 860} 861;// ./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js 862function getNodeName(element) { 863 return element ? (element.nodeName || '').toLowerCase() : null; 864} 865;// ./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js 866 867function getDocumentElement(element) { 868 // $FlowFixMe[incompatible-return]: assume body is always available 869 return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing] 870 element.document) || window.document).documentElement; 871} 872;// ./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js 873 874 875 876function getWindowScrollBarX(element) { 877 // If <html> has a CSS width greater than the viewport, then this will be 878 // incorrect for RTL. 879 // Popper 1 is broken in this case and never had a bug report so let's assume 880 // it's not an issue. I don't think anyone ever specifies width on <html> 881 // anyway. 882 // Browsers where the left scrollbar doesn't cause an issue report `0` for 883 // this (e.g. Edge 2019, IE11, Safari) 884 return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft; 885} 886;// ./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js 887 888function getComputedStyle(element) { 889 return getWindow(element).getComputedStyle(element); 890} 891;// ./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js 892 893function isScrollParent(element) { 894 // Firefox wants us to check `-x` and `-y` variations as well 895 var _getComputedStyle = getComputedStyle(element), 896 overflow = _getComputedStyle.overflow, 897 overflowX = _getComputedStyle.overflowX, 898 overflowY = _getComputedStyle.overflowY; 899 900 return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX); 901} 902;// ./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js 903 904 905 906 907 908 909 910 911 912function isElementScaled(element) { 913 var rect = element.getBoundingClientRect(); 914 var scaleX = round(rect.width) / element.offsetWidth || 1; 915 var scaleY = round(rect.height) / element.offsetHeight || 1; 916 return scaleX !== 1 || scaleY !== 1; 917} // Returns the composite rect of an element relative to its offsetParent. 918// Composite means it takes into account transforms as well as layout. 919 920
vendor: 4,287 bytes, lines 921-1056
921function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) { 922 if (isFixed === void 0) { 923 isFixed = false; 924 } 925 926 var isOffsetParentAnElement = isHTMLElement(offsetParent); 927 var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent); 928 var documentElement = getDocumentElement(offsetParent); 929 var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled); 930 var scroll = { 931 scrollLeft: 0, 932 scrollTop: 0 933 }; 934 var offsets = { 935 x: 0, 936 y: 0 937 }; 938 939 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { 940 if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078 941 isScrollParent(documentElement)) { 942 scroll = getNodeScroll(offsetParent); 943 } 944 945 if (isHTMLElement(offsetParent)) { 946 offsets = getBoundingClientRect(offsetParent, true); 947 offsets.x += offsetParent.clientLeft; 948 offsets.y += offsetParent.clientTop; 949 } else if (documentElement) { 950 offsets.x = getWindowScrollBarX(documentElement); 951 } 952 } 953 954 return { 955 x: rect.left + scroll.scrollLeft - offsets.x, 956 y: rect.top + scroll.scrollTop - offsets.y, 957 width: rect.width, 958 height: rect.height 959 }; 960} 961;// ./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js 962 // Returns the layout rect of an element relative to its offsetParent. Layout 963// means it doesn't take into account transforms. 964 965function getLayoutRect(element) { 966 var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed. 967 // Fixes https://github.com/popperjs/popper-core/issues/1223 968 969 var width = element.offsetWidth; 970 var height = element.offsetHeight; 971 972 if (Math.abs(clientRect.width - width) <= 1) { 973 width = clientRect.width; 974 } 975 976 if (Math.abs(clientRect.height - height) <= 1) { 977 height = clientRect.height; 978 } 979 980 return { 981 x: element.offsetLeft, 982 y: element.offsetTop, 983 width: width, 984 height: height 985 }; 986} 987;// ./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js 988 989 990 991function getParentNode(element) { 992 if (getNodeName(element) === 'html') { 993 return element; 994 } 995 996 return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle 997 // $FlowFixMe[incompatible-return] 998 // $FlowFixMe[prop-missing] 999 element.assignedSlot || // step into the shadow DOM of the parent of a slotted node 1000 element.parentNode || ( // DOM Element detected 1001 isShadowRoot(element) ? element.host : null) || // ShadowRoot detected 1002 // $FlowFixMe[incompatible-call]: HTMLElement is a Node 1003 getDocumentElement(element) // fallback 1004 1005 ); 1006} 1007;// ./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js 1008 1009 1010 1011 1012function getScrollParent(node) { 1013 if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) { 1014 // $FlowFixMe[incompatible-return]: assume body is always available 1015 return node.ownerDocument.body; 1016 } 1017 1018 if (isHTMLElement(node) && isScrollParent(node)) { 1019 return node; 1020 } 1021 1022 return getScrollParent(getParentNode(node)); 1023} 1024;// ./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js 1025 1026 1027 1028 1029/* 1030given a DOM element, return the list of all scroll parents, up the list of ancesors 1031until we get to the top window object. This list is what we attach scroll listeners 1032to, because if any of these parent elements scroll, we'll need to re-calculate the 1033reference element's position. 1034*/ 1035 1036function listScrollParents(element, list) { 1037 var _element$ownerDocumen; 1038 1039 if (list === void 0) { 1040 list = []; 1041 } 1042 1043 var scrollParent = getScrollParent(element); 1044 var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body); 1045 var win = getWindow(scrollParent); 1046 var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent; 1047 var updatedList = list.concat(target); 1048 return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here 1049 updatedList.concat(listScrollParents(getParentNode(target))); 1050} 1051;// ./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js 1052 1053function isTableElement(element) { 1054 return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0; 1055} 1056;
vendor: 4,129 bytes, lines 1056-1170
1056// ./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js 1057 1058 1059 1060 1061 1062 1063 1064function getTrueOffsetParent(element) { 1065 if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837 1066 getComputedStyle(element).position === 'fixed') { 1067 return null; 1068 } 1069 1070 return element.offsetParent; 1071} // `.offsetParent` reports `null` for fixed elements, while absolute elements 1072// return the containing block 1073 1074 1075function getContainingBlock(element) { 1076 var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1; 1077 var isIE = navigator.userAgent.indexOf('Trident') !== -1; 1078 1079 if (isIE && isHTMLElement(element)) { 1080 // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport 1081 var elementCss = getComputedStyle(element); 1082 1083 if (elementCss.position === 'fixed') { 1084 return null; 1085 } 1086 } 1087 1088 var currentNode = getParentNode(element); 1089 1090 if (isShadowRoot(currentNode)) { 1091 currentNode = currentNode.host; 1092 } 1093 1094 while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) { 1095 var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that 1096 // create a containing block. 1097 // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block 1098 1099 if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') { 1100 return currentNode; 1101 } else { 1102 currentNode = currentNode.parentNode; 1103 } 1104 } 1105 1106 return null; 1107} // Gets the closest ancestor positioned element. Handles some edge cases, 1108// such as table ancestors and cross browser bugs. 1109 1110 1111function getOffsetParent(element) { 1112 var window = getWindow(element); 1113 var offsetParent = getTrueOffsetParent(element); 1114 1115 while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') { 1116 offsetParent = getTrueOffsetParent(offsetParent); 1117 } 1118 1119 if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) { 1120 return window; 1121 } 1122 1123 return offsetParent || getContainingBlock(element) || window; 1124} 1125;// ./node_modules/@popperjs/core/lib/enums.js 1126var enums_top = 'top'; 1127var bottom = 'bottom'; 1128var right = 'right'; 1129var left = 'left'; 1130var auto = 'auto'; 1131var basePlacements = [enums_top, bottom, right, left]; 1132var start = 'start'; 1133var end = 'end'; 1134var clippingParents = 'clippingParents'; 1135var viewport = 'viewport'; 1136var popper = 'popper'; 1137var reference = 'reference'; 1138var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) { 1139 return acc.concat([placement + "-" + start, placement + "-" + end]); 1140}, []); 1141var enums_placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) { 1142 return acc.concat([placement, placement + "-" + start, placement + "-" + end]); 1143}, []); // modifiers that need to read the DOM 1144 1145var beforeRead = 'beforeRead'; 1146var read = 'read'; 1147var afterRead = 'afterRead'; // pure-logic modifiers 1148 1149var beforeMain = 'beforeMain'; 1150var main = 'main'; 1151var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state) 1152 1153var beforeWrite = 'beforeWrite'; 1154var write = 'write'; 1155var afterWrite = 'afterWrite'; 1156var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite]; 1157;// ./node_modules/@popperjs/core/lib/utils/orderModifiers.js 1158 // source: https://stackoverflow.com/questions/49875255 1159 1160function order(modifiers) { 1161 var map = new Map(); 1162 var visited = new Set(); 1163 var result = []; 1164 modifiers.forEach(function (modifier) { 1165 map.set(modifier.name, modifier); 1166 }); // On visiting object, check for its dependencies and visit them recursively 1167 1168 function sort(modifier) { 1169 visited.add(modifier.name); 1170 var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
vendor: 1,630 bytes, lines 1171-1233
1171 requires.forEach(function (dep) { 1172 if (!visited.has(dep)) { 1173 var depModifier = map.get(dep); 1174 1175 if (depModifier) { 1176 sort(depModifier); 1177 } 1178 } 1179 }); 1180 result.push(modifier); 1181 } 1182 1183 modifiers.forEach(function (modifier) { 1184 if (!visited.has(modifier.name)) { 1185 // check for visited object 1186 sort(modifier); 1187 } 1188 }); 1189 return result; 1190} 1191 1192function orderModifiers(modifiers) { 1193 // order based on dependencies 1194 var orderedModifiers = order(modifiers); // order based on phase 1195 1196 return modifierPhases.reduce(function (acc, phase) { 1197 return acc.concat(orderedModifiers.filter(function (modifier) { 1198 return modifier.phase === phase; 1199 })); 1200 }, []); 1201} 1202;// ./node_modules/@popperjs/core/lib/utils/debounce.js 1203function debounce(fn) { 1204 var pending; 1205 return function () { 1206 if (!pending) { 1207 pending = new Promise(function (resolve) { 1208 Promise.resolve().then(function () { 1209 pending = undefined; 1210 resolve(fn()); 1211 }); 1212 }); 1213 } 1214 1215 return pending; 1216 }; 1217} 1218;// ./node_modules/@popperjs/core/lib/utils/mergeByName.js 1219function mergeByName(modifiers) { 1220 var merged = modifiers.reduce(function (merged, current) { 1221 var existing = merged[current.name]; 1222 merged[current.name] = existing ? Object.assign({}, existing, current, { 1223 options: Object.assign({}, existing.options, current.options), 1224 data: Object.assign({}, existing.data, current.data) 1225 }) : current; 1226 return merged; 1227 }, {}); // IE11 does not support Object.values 1228 1229 return Object.keys(merged).map(function (key) { 1230 return merged[key]; 1231 }); 1232} 1233;//
vendor: 7,575 bytes, lines 1233-1451
1233 ./node_modules/@popperjs/core/lib/createPopper.js 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248var INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.'; 1249var INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.'; 1250var DEFAULT_OPTIONS = { 1251 placement: 'bottom', 1252 modifiers: [], 1253 strategy: 'absolute' 1254}; 1255 1256function areValidElements() { 1257 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 1258 args[_key] = arguments[_key]; 1259 } 1260 1261 return !args.some(function (element) { 1262 return !(element && typeof element.getBoundingClientRect === 'function'); 1263 }); 1264} 1265 1266function popperGenerator(generatorOptions) { 1267 if (generatorOptions === void 0) { 1268 generatorOptions = {}; 1269 } 1270 1271 var _generatorOptions = generatorOptions, 1272 _generatorOptions$def = _generatorOptions.defaultModifiers, 1273 defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, 1274 _generatorOptions$def2 = _generatorOptions.defaultOptions, 1275 defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2; 1276 return function createPopper(reference, popper, options) { 1277 if (options === void 0) { 1278 options = defaultOptions; 1279 } 1280 1281 var state = { 1282 placement: 'bottom', 1283 orderedModifiers: [], 1284 options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions), 1285 modifiersData: {}, 1286 elements: { 1287 reference: reference, 1288 popper: popper 1289 }, 1290 attributes: {}, 1291 styles: {} 1292 }; 1293 var effectCleanupFns = []; 1294 var isDestroyed = false; 1295 var instance = { 1296 state: state, 1297 setOptions: function setOptions(setOptionsAction) { 1298 var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction; 1299 cleanupModifierEffects(); 1300 state.options = Object.assign({}, defaultOptions, state.options, options); 1301 state.scrollParents = { 1302 reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [], 1303 popper: listScrollParents(popper) 1304 }; // Orders the modifiers based on their dependencies and `phase` 1305 // properties 1306 1307 var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers 1308 1309 state.orderedModifiers = orderedModifiers.filter(function (m) { 1310 return m.enabled; 1311 }); // Validate the provided modifiers so that the consumer will get warned 1312 // if one of the modifiers is invalid for any reason 1313 1314 if (false) { var _getComputedStyle, marginTop, marginRight, marginBottom, marginLeft, flipModifier, modifiers; } 1315 1316 runModifierEffects(); 1317 return instance.update(); 1318 }, 1319 // Sync update â it will always be executed, even if not necessary. This 1320 // is useful for low frequency updates where sync behavior simplifies the 1321 // logic. 1322 // For high frequency updates (e.g. `resize` and `scroll` events), always 1323 // prefer the async Popper#update method 1324 forceUpdate: function forceUpdate() { 1325 if (isDestroyed) { 1326 return; 1327 } 1328 1329 var _state$elements = state.elements, 1330 reference = _state$elements.reference, 1331 popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements 1332 // anymore 1333 1334 if (!areValidElements(reference, popper)) { 1335 if (false) {} 1336 1337 return; 1338 } // Store the reference and popper rects to be read by modifiers 1339 1340 1341 state.rects = { 1342 reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'), 1343 popper: getLayoutRect(popper) 1344 }; // Modifiers have the ability to reset the current update cycle. The 1345 // most common use case for this is the `flip` modifier changing the 1346 // placement, which then needs to re-run all the modifiers, because the 1347 // logic was previously ran for the previous placement and is therefore 1348 // stale/incorrect 1349 1350 state.reset = false; 1351 state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier 1352 // is filled with the initial data specified by the modifier. This means 1353 // it doesn't persist and is fresh on each update. 1354 // To ensure persistent data, use `${name}#persistent` 1355 1356 state.orderedModifiers.forEach(function (modifier) { 1357 return state.modifiersData[modifier.name] = Object.assign({}, modifier.data); 1358 }); 1359 var __debug_loops__ = 0; 1360 1361 for (var index = 0; index < state.orderedModifiers.length; index++) { 1362 if (false) {} 1363 1364 if (state.reset === true) { 1365 state.reset = false; 1366 index = -1; 1367 continue; 1368 } 1369 1370 var _state$orderedModifie = state.orderedModifiers[index], 1371 fn = _state$orderedModifie.fn, 1372 _state$orderedModifie2 = _state$orderedModifie.options, 1373 _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, 1374 name = _state$orderedModifie.name; 1375 1376 if (typeof fn === 'function') { 1377 state = fn({ 1378 state: state, 1379 options: _options, 1380 name: name, 1381 instance: instance 1382 }) || state; 1383 } 1384 } 1385 }, 1386 // Async and optimistically optimized update â it will not be executed if 1387 // not necessary (debounced to run at most once-per-tick) 1388 update: debounce(function () { 1389 return new Promise(function (resolve) { 1390 instance.forceUpdate(); 1391 resolve(state); 1392 }); 1393 }), 1394 destroy: function destroy() { 1395 cleanupModifierEffects(); 1396 isDestroyed = true; 1397 } 1398 }; 1399 1400 if (!areValidElements(reference, popper)) { 1401 if (false) {} 1402 1403 return instance; 1404 } 1405 1406 instance.setOptions(options).then(function (state) { 1407 if (!isDestroyed && options.onFirstUpdate) { 1408 options.onFirstUpdate(state); 1409 } 1410 }); // Modifiers have the ability to execute arbitrary code before the first 1411 // update cycle runs. They will be executed in the same order as the update 1412 // cycle. This is useful when a modifier adds some persistent data that 1413 // other modifiers need to use, but the modifier is run after the dependent 1414 // one. 1415 1416 function runModifierEffects() { 1417 state.orderedModifiers.forEach(function (_ref3) { 1418 var name = _ref3.name, 1419 _ref3$options = _ref3.options, 1420 options = _ref3$options === void 0 ? {} : _ref3$options, 1421 effect = _ref3.effect; 1422 1423 if (typeof effect === 'function') { 1424 var cleanupFn = effect({ 1425 state: state, 1426 name: name, 1427 instance: instance, 1428 options: options 1429 }); 1430 1431 var noopFn = function noopFn() {}; 1432 1433 effectCleanupFns.push(cleanupFn || noopFn); 1434 } 1435 }); 1436 } 1437 1438 function cleanupModifierEffects() { 1439 effectCleanupFns.forEach(function (fn) { 1440 return fn(); 1441 }); 1442 effectCleanupFns = []; 1443 } 1444 1445 return instance; 1446 }; 1447} 1448var createPopper = /*#__PURE__*/(/* unused pure expression or super */ null && (popperGenerator())); // eslint-disable-next-line import/no-unused-modules 1449 1450 1451;//
vendor: 5,765 bytes, lines 1451-1677
1451./node_modules/@popperjs/core/lib/modifiers/eventListeners.js 1452 // eslint-disable-next-line import/no-unused-modules 1453 1454var passive = { 1455 passive: true 1456}; 1457 1458function effect(_ref) { 1459 var state = _ref.state, 1460 instance = _ref.instance, 1461 options = _ref.options; 1462 var _options$scroll = options.scroll, 1463 scroll = _options$scroll === void 0 ? true : _options$scroll, 1464 _options$resize = options.resize, 1465 resize = _options$resize === void 0 ? true : _options$resize; 1466 var window = getWindow(state.elements.popper); 1467 var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper); 1468 1469 if (scroll) { 1470 scrollParents.forEach(function (scrollParent) { 1471 scrollParent.addEventListener('scroll', instance.update, passive); 1472 }); 1473 } 1474 1475 if (resize) { 1476 window.addEventListener('resize', instance.update, passive); 1477 } 1478 1479 return function () { 1480 if (scroll) { 1481 scrollParents.forEach(function (scrollParent) { 1482 scrollParent.removeEventListener('scroll', instance.update, passive); 1483 }); 1484 } 1485 1486 if (resize) { 1487 window.removeEventListener('resize', instance.update, passive); 1488 } 1489 }; 1490} // eslint-disable-next-line import/no-unused-modules 1491 1492 1493/* harmony default export */ const eventListeners = ({ 1494 name: 'eventListeners', 1495 enabled: true, 1496 phase: 'write', 1497 fn: function fn() {}, 1498 effect: effect, 1499 data: {} 1500}); 1501;// ./node_modules/@popperjs/core/lib/utils/getBasePlacement.js 1502 1503function getBasePlacement(placement) { 1504 return placement.split('-')[0]; 1505} 1506;// ./node_modules/@popperjs/core/lib/utils/getVariation.js 1507function getVariation(placement) { 1508 return placement.split('-')[1]; 1509} 1510;// ./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js 1511function getMainAxisFromPlacement(placement) { 1512 return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y'; 1513} 1514;// ./node_modules/@popperjs/core/lib/utils/computeOffsets.js 1515 1516 1517 1518 1519function computeOffsets(_ref) { 1520 var reference = _ref.reference, 1521 element = _ref.element, 1522 placement = _ref.placement; 1523 var basePlacement = placement ? getBasePlacement(placement) : null; 1524 var variation = placement ? getVariation(placement) : null; 1525 var commonX = reference.x + reference.width / 2 - element.width / 2; 1526 var commonY = reference.y + reference.height / 2 - element.height / 2; 1527 var offsets; 1528 1529 switch (basePlacement) { 1530 case enums_top: 1531 offsets = { 1532 x: commonX, 1533 y: reference.y - element.height 1534 }; 1535 break; 1536 1537 case bottom: 1538 offsets = { 1539 x: commonX, 1540 y: reference.y + reference.height 1541 }; 1542 break; 1543 1544 case right: 1545 offsets = { 1546 x: reference.x + reference.width, 1547 y: commonY 1548 }; 1549 break; 1550 1551 case left: 1552 offsets = { 1553 x: reference.x - element.width, 1554 y: commonY 1555 }; 1556 break; 1557 1558 default: 1559 offsets = { 1560 x: reference.x, 1561 y: reference.y 1562 }; 1563 } 1564 1565 var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null; 1566 1567 if (mainAxis != null) { 1568 var len = mainAxis === 'y' ? 'height' : 'width'; 1569 1570 switch (variation) { 1571 case start: 1572 offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2); 1573 break; 1574 1575 case end: 1576 offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2); 1577 break; 1578 1579 default: 1580 } 1581 } 1582 1583 return offsets; 1584} 1585;// ./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js 1586 1587 1588function popperOffsets(_ref) { 1589 var state = _ref.state, 1590 name = _ref.name; 1591 // Offsets are the actual position the popper needs to have to be 1592 // properly positioned near its reference element 1593 // This is the most basic placement, and will be adjusted by 1594 // the modifiers in the next step 1595 state.modifiersData[name] = computeOffsets({ 1596 reference: state.rects.reference, 1597 element: state.rects.popper, 1598 strategy: 'absolute', 1599 placement: state.placement 1600 }); 1601} // eslint-disable-next-line import/no-unused-modules 1602 1603 1604/* harmony default export */ const modifiers_popperOffsets = ({ 1605 name: 'popperOffsets', 1606 enabled: true, 1607 phase: 'read', 1608 fn: popperOffsets, 1609 data: {} 1610}); 1611;// ./node_modules/@popperjs/core/lib/modifiers/computeStyles.js 1612 1613 1614 1615 1616 1617 1618 1619 // eslint-disable-next-line import/no-unused-modules 1620 1621var unsetSides = { 1622 top: 'auto', 1623 right: 'auto', 1624 bottom: 'auto', 1625 left: 'auto' 1626}; // Round the offsets to the nearest suitable subpixel based on the DPR. 1627// Zooming can change the DPR, but it seems to report a value that will 1628// cleanly divide the values into the appropriate subpixels. 1629 1630function roundOffsetsByDPR(_ref) { 1631 var x = _ref.x, 1632 y = _ref.y; 1633 var win = window; 1634 var dpr = win.devicePixelRatio || 1; 1635 return { 1636 x: round(x * dpr) / dpr || 0, 1637 y: round(y * dpr) / dpr || 0 1638 }; 1639} 1640 1641function mapToStyles(_ref2) { 1642 var _Object$assign2; 1643 1644 var popper = _ref2.popper, 1645 popperRect = _ref2.popperRect, 1646 placement = _ref2.placement, 1647 variation = _ref2.variation, 1648 offsets = _ref2.offsets, 1649 position = _ref2.position, 1650 gpuAcceleration = _ref2.gpuAcceleration, 1651 adaptive = _ref2.adaptive, 1652 roundOffsets = _ref2.roundOffsets, 1653 isFixed = _ref2.isFixed; 1654 var _offsets$x = offsets.x, 1655 x = _offsets$x === void 0 ? 0 : _offsets$x, 1656 _offsets$y = offsets.y, 1657 y = _offsets$y === void 0 ? 0 : _offsets$y; 1658 1659 var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({ 1660 x: x, 1661 y: y 1662 }) : { 1663 x: x, 1664 y: y 1665 }; 1666 1667 x = _ref3.x; 1668 y = _ref3.y; 1669 var hasX = offsets.hasOwnProperty('x'); 1670 var hasY = offsets.hasOwnProperty('y'); 1671 var sideX = left; 1672 var sideY = enums_top; 1673 var win = window; 1674 1675 if (adaptive) { 1676 var offsetParent = getOffsetParent(popper); 1677 var heightProp = 'clientHeight';
vendor: 4,074 bytes, lines 1678-1791
1678 var widthProp = 'clientWidth'; 1679 1680 if (offsetParent === getWindow(popper)) { 1681 offsetParent = getDocumentElement(popper); 1682 1683 if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') { 1684 heightProp = 'scrollHeight'; 1685 widthProp = 'scrollWidth'; 1686 } 1687 } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it 1688 1689 1690 offsetParent = offsetParent; 1691 1692 if (placement === enums_top || (placement === left || placement === right) && variation === end) { 1693 sideY = bottom; 1694 var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing] 1695 offsetParent[heightProp]; 1696 y -= offsetY - popperRect.height; 1697 y *= gpuAcceleration ? 1 : -1; 1698 } 1699 1700 if (placement === left || (placement === enums_top || placement === bottom) && variation === end) { 1701 sideX = right; 1702 var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing] 1703 offsetParent[widthProp]; 1704 x -= offsetX - popperRect.width; 1705 x *= gpuAcceleration ? 1 : -1; 1706 } 1707 } 1708 1709 var commonStyles = Object.assign({ 1710 position: position 1711 }, adaptive && unsetSides); 1712 1713 var _ref4 = roundOffsets === true ? roundOffsetsByDPR({ 1714 x: x, 1715 y: y 1716 }) : { 1717 x: x, 1718 y: y 1719 }; 1720 1721 x = _ref4.x; 1722 y = _ref4.y; 1723 1724 if (gpuAcceleration) { 1725 var _Object$assign; 1726 1727 return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign)); 1728 } 1729 1730 return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2)); 1731} 1732 1733function computeStyles(_ref5) { 1734 var state = _ref5.state, 1735 options = _ref5.options; 1736 var _options$gpuAccelerat = options.gpuAcceleration, 1737 gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, 1738 _options$adaptive = options.adaptive, 1739 adaptive = _options$adaptive === void 0 ? true : _options$adaptive, 1740 _options$roundOffsets = options.roundOffsets, 1741 roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets; 1742 1743 if (false) { var transitionProperty; } 1744 1745 var commonStyles = { 1746 placement: getBasePlacement(state.placement), 1747 variation: getVariation(state.placement), 1748 popper: state.elements.popper, 1749 popperRect: state.rects.popper, 1750 gpuAcceleration: gpuAcceleration, 1751 isFixed: state.options.strategy === 'fixed' 1752 }; 1753 1754 if (state.modifiersData.popperOffsets != null) { 1755 state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, { 1756 offsets: state.modifiersData.popperOffsets, 1757 position: state.options.strategy, 1758 adaptive: adaptive, 1759 roundOffsets: roundOffsets 1760 }))); 1761 } 1762 1763 if (state.modifiersData.arrow != null) { 1764 state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, { 1765 offsets: state.modifiersData.arrow, 1766 position: 'absolute', 1767 adaptive: false, 1768 roundOffsets: roundOffsets 1769 }))); 1770 } 1771 1772 state.attributes.popper = Object.assign({}, state.attributes.popper, { 1773 'data-popper-placement': state.placement 1774 }); 1775} // eslint-disable-next-line import/no-unused-modules 1776 1777 1778/* harmony default export */ const modifiers_computeStyles = ({ 1779 name: 'computeStyles', 1780 enabled: true, 1781 phase: 'beforeWrite', 1782 fn: computeStyles, 1783 data: {} 1784}); 1785;// ./node_modules/@popperjs/core/lib/modifiers/applyStyles.js 1786 1787 // This modifier takes the styles prepared by the `computeStyles` modifier 1788// and applies them to the HTMLElements such as popper and arrow 1789 1790function applyStyles(_ref) { 1791 var state = _ref.state;
vendor: 4,189 bytes, lines 1792-1937
1792 Object.keys(state.elements).forEach(function (name) { 1793 var style = state.styles[name] || {}; 1794 var attributes = state.attributes[name] || {}; 1795 var element = state.elements[name]; // arrow is optional + virtual elements 1796 1797 if (!isHTMLElement(element) || !getNodeName(element)) { 1798 return; 1799 } // Flow doesn't support to extend this property, but it's the most 1800 // effective way to apply styles to an HTMLElement 1801 // $FlowFixMe[cannot-write] 1802 1803 1804 Object.assign(element.style, style); 1805 Object.keys(attributes).forEach(function (name) { 1806 var value = attributes[name]; 1807 1808 if (value === false) { 1809 element.removeAttribute(name); 1810 } else { 1811 element.setAttribute(name, value === true ? '' : value); 1812 } 1813 }); 1814 }); 1815} 1816 1817function applyStyles_effect(_ref2) { 1818 var state = _ref2.state; 1819 var initialStyles = { 1820 popper: { 1821 position: state.options.strategy, 1822 left: '0', 1823 top: '0', 1824 margin: '0' 1825 }, 1826 arrow: { 1827 position: 'absolute' 1828 }, 1829 reference: {} 1830 }; 1831 Object.assign(state.elements.popper.style, initialStyles.popper); 1832 state.styles = initialStyles; 1833 1834 if (state.elements.arrow) { 1835 Object.assign(state.elements.arrow.style, initialStyles.arrow); 1836 } 1837 1838 return function () { 1839 Object.keys(state.elements).forEach(function (name) { 1840 var element = state.elements[name]; 1841 var attributes = state.attributes[name] || {}; 1842 var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them 1843 1844 var style = styleProperties.reduce(function (style, property) { 1845 style[property] = ''; 1846 return style; 1847 }, {}); // arrow is optional + virtual elements 1848 1849 if (!isHTMLElement(element) || !getNodeName(element)) { 1850 return; 1851 } 1852 1853 Object.assign(element.style, style); 1854 Object.keys(attributes).forEach(function (attribute) { 1855 element.removeAttribute(attribute); 1856 }); 1857 }); 1858 }; 1859} // eslint-disable-next-line import/no-unused-modules 1860 1861 1862/* harmony default export */ const modifiers_applyStyles = ({ 1863 name: 'applyStyles', 1864 enabled: true, 1865 phase: 'write', 1866 fn: applyStyles, 1867 effect: applyStyles_effect, 1868 requires: ['computeStyles'] 1869}); 1870;// ./node_modules/@popperjs/core/lib/modifiers/offset.js 1871 1872 // eslint-disable-next-line import/no-unused-modules 1873 1874function distanceAndSkiddingToXY(placement, rects, offset) { 1875 var basePlacement = getBasePlacement(placement); 1876 var invertDistance = [left, enums_top].indexOf(basePlacement) >= 0 ? -1 : 1; 1877 1878 var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, { 1879 placement: placement 1880 })) : offset, 1881 skidding = _ref[0], 1882 distance = _ref[1]; 1883 1884 skidding = skidding || 0; 1885 distance = (distance || 0) * invertDistance; 1886 return [left, right].indexOf(basePlacement) >= 0 ? { 1887 x: distance, 1888 y: skidding 1889 } : { 1890 x: skidding, 1891 y: distance 1892 }; 1893} 1894 1895function offset(_ref2) { 1896 var state = _ref2.state, 1897 options = _ref2.options, 1898 name = _ref2.name; 1899 var _options$offset = options.offset, 1900 offset = _options$offset === void 0 ? [0, 0] : _options$offset; 1901 var data = enums_placements.reduce(function (acc, placement) { 1902 acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset); 1903 return acc; 1904 }, {}); 1905 var _data$state$placement = data[state.placement], 1906 x = _data$state$placement.x, 1907 y = _data$state$placement.y; 1908 1909 if (state.modifiersData.popperOffsets != null) { 1910 state.modifiersData.popperOffsets.x += x; 1911 state.modifiersData.popperOffsets.y += y; 1912 } 1913 1914 state.modifiersData[name] = data; 1915} // eslint-disable-next-line import/no-unused-modules 1916 1917 1918/* harmony default export */ const modifiers_offset = ({ 1919 name: 'offset', 1920 enabled: true, 1921 phase: 'main', 1922 requires: ['popperOffsets'], 1923 fn: offset 1924}); 1925;// ./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js 1926var hash = { 1927 left: 'right', 1928 right: 'left', 1929 bottom: 'top', 1930 top: 'bottom' 1931}; 1932function getOppositePlacement(placement) { 1933 return placement.replace(/left|right|bottom|top/g, function (matched) { 1934 return hash[matched]; 1935 }); 1936} 1937;
1937// ./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js 1938var getOppositeVariationPlacement_hash = { 1939 start: 'end', 1940 end: 'start' 1941}; 1942function getOppositeVariationPlacement(placement) { 1943 return placement.replace(/start|end/g, function (matched) { 1944 return getOppositeVariationPlacement_hash[matched]; 1945 }); 1946} 1947;// ./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js 1948 1949 1950 1951function getViewportRect(element) { 1952 var win = getWindow(element); 1953 var html = getDocumentElement(element); 1954 var visualViewport = win.visualViewport; 1955 var width = html.clientWidth; 1956 var height = html.clientHeight; 1957 var x = 0; 1958 var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper 1959 // can be obscured underneath it. 1960 // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even 1961 // if it isn't open, so if this isn't available, the popper will be detected 1962 // to overflow the bottom of the screen too early. 1963 1964 if (visualViewport) { 1965 width = visualViewport.width;
vendor: 8,542 bytes, lines 1966-2197
1966 height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently) 1967 // In Chrome, it returns a value very close to 0 (+/-) but contains rounding 1968 // errors due to floating point numbers, so we need to check precision. 1969 // Safari returns a number <= 0, usually < -1 when pinch-zoomed 1970 // Feature detection fails in mobile emulation mode in Chrome. 1971 // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) < 1972 // 0.001 1973 // Fallback here: "Not Safari" userAgent 1974 1975 if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) { 1976 x = visualViewport.offsetLeft; 1977 y = visualViewport.offsetTop; 1978 } 1979 } 1980 1981 return { 1982 width: width, 1983 height: height, 1984 x: x + getWindowScrollBarX(element), 1985 y: y 1986 }; 1987} 1988;// ./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js 1989 1990 1991 1992 1993 // Gets the entire size of the scrollable document area, even extending outside 1994// of the `<html>` and `<body>` rect bounds if horizontally scrollable 1995 1996function getDocumentRect(element) { 1997 var _element$ownerDocumen; 1998 1999 var html = getDocumentElement(element); 2000 var winScroll = getWindowScroll(element); 2001 var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body; 2002 var width = math_max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0); 2003 var height = math_max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); 2004 var x = -winScroll.scrollLeft + getWindowScrollBarX(element); 2005 var y = -winScroll.scrollTop; 2006 2007 if (getComputedStyle(body || html).direction === 'rtl') { 2008 x += math_max(html.clientWidth, body ? body.clientWidth : 0) - width; 2009 } 2010 2011 return { 2012 width: width, 2013 height: height, 2014 x: x, 2015 y: y 2016 }; 2017} 2018;// ./node_modules/@popperjs/core/lib/dom-utils/contains.js 2019 2020function contains(parent, child) { 2021 var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method 2022 2023 if (parent.contains(child)) { 2024 return true; 2025 } // then fallback to custom implementation with Shadow DOM support 2026 else if (rootNode && isShadowRoot(rootNode)) { 2027 var next = child; 2028 2029 do { 2030 if (next && parent.isSameNode(next)) { 2031 return true; 2032 } // $FlowFixMe[prop-missing]: need a better way to handle this... 2033 2034 2035 next = next.parentNode || next.host; 2036 } while (next); 2037 } // Give up, the result is false 2038 2039 2040 return false; 2041} 2042;// ./node_modules/@popperjs/core/lib/utils/rectToClientRect.js 2043function rectToClientRect(rect) { 2044 return Object.assign({}, rect, { 2045 left: rect.x, 2046 top: rect.y, 2047 right: rect.x + rect.width, 2048 bottom: rect.y + rect.height 2049 }); 2050} 2051;// ./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067function getInnerBoundingClientRect(element) { 2068 var rect = getBoundingClientRect(element); 2069 rect.top = rect.top + element.clientTop; 2070 rect.left = rect.left + element.clientLeft; 2071 rect.bottom = rect.top + element.clientHeight; 2072 rect.right = rect.left + element.clientWidth; 2073 rect.width = element.clientWidth; 2074 rect.height = element.clientHeight; 2075 rect.x = rect.left; 2076 rect.y = rect.top; 2077 return rect; 2078} 2079 2080function getClientRectFromMixedType(element, clippingParent) { 2081 return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element))); 2082} // A "clipping parent" is an overflowable container with the characteristic of 2083// clipping (or hiding) overflowing elements with a position different from 2084// `initial` 2085 2086 2087function getClippingParents(element) { 2088 var clippingParents = listScrollParents(getParentNode(element)); 2089 var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0; 2090 var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element; 2091 2092 if (!isElement(clipperElement)) { 2093 return []; 2094 } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414 2095 2096 2097 return clippingParents.filter(function (clippingParent) { 2098 return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'; 2099 }); 2100} // Gets the maximum area that the element is visible in due to any number of 2101// clipping parents 2102 2103 2104function getClippingRect(element, boundary, rootBoundary) { 2105 var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary); 2106 var clippingParents = [].concat(mainClippingParents, [rootBoundary]); 2107 var firstClippingParent = clippingParents[0]; 2108 var clippingRect = clippingParents.reduce(function (accRect, clippingParent) { 2109 var rect = getClientRectFromMixedType(element, clippingParent); 2110 accRect.top = math_max(rect.top, accRect.top); 2111 accRect.right = math_min(rect.right, accRect.right); 2112 accRect.bottom = math_min(rect.bottom, accRect.bottom); 2113 accRect.left = math_max(rect.left, accRect.left); 2114 return accRect; 2115 }, getClientRectFromMixedType(element, firstClippingParent)); 2116 clippingRect.width = clippingRect.right - clippingRect.left; 2117 clippingRect.height = clippingRect.bottom - clippingRect.top; 2118 clippingRect.x = clippingRect.left; 2119 clippingRect.y = clippingRect.top; 2120 return clippingRect; 2121} 2122;// ./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js 2123function getFreshSideObject() { 2124 return { 2125 top: 0, 2126 right: 0, 2127 bottom: 0, 2128 left: 0 2129 }; 2130} 2131;// ./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js 2132 2133function mergePaddingObject(paddingObject) { 2134 return Object.assign({}, getFreshSideObject(), paddingObject); 2135} 2136;// ./node_modules/@popperjs/core/lib/utils/expandToHashMap.js 2137function expandToHashMap(value, keys) { 2138 return keys.reduce(function (hashMap, key) { 2139 hashMap[key] = value; 2140 return hashMap; 2141 }, {}); 2142} 2143;// ./node_modules/@popperjs/core/lib/utils/detectOverflow.js 2144 2145 2146 2147 2148 2149 2150 2151 2152 // eslint-disable-next-line import/no-unused-modules 2153 2154function detectOverflow(state, options) { 2155 if (options === void 0) { 2156 options = {}; 2157 } 2158 2159 var _options = options, 2160 _options$placement = _options.placement, 2161 placement = _options$placement === void 0 ? state.placement : _options$placement, 2162 _options$boundary = _options.boundary, 2163 boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, 2164 _options$rootBoundary = _options.rootBoundary, 2165 rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, 2166 _options$elementConte = _options.elementContext, 2167 elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, 2168 _options$altBoundary = _options.altBoundary, 2169 altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, 2170 _options$padding = _options.padding, 2171 padding = _options$padding === void 0 ? 0 : _options$padding; 2172 var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); 2173 var altContext = elementContext === popper ? reference : popper; 2174 var popperRect = state.rects.popper; 2175 var element = state.elements[altBoundary ? altContext : elementContext]; 2176 var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary); 2177 var referenceClientRect = getBoundingClientRect(state.elements.reference); 2178 var popperOffsets = computeOffsets({ 2179 reference: referenceClientRect, 2180 element: popperRect, 2181 strategy: 'absolute', 2182 placement: placement 2183 }); 2184 var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets)); 2185 var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect 2186 // 0 or negative = within the clipping rect 2187 2188 var overflowOffsets = { 2189 top: clippingClientRect.top - elementClientRect.top + paddingObject.top, 2190 bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom, 2191 left: clippingClientRect.left - elementClientRect.left + paddingObject.left, 2192 right: elementClientRect.right - clippingClientRect.right + paddingObject.right 2193 }; 2194 var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element 2195 2196 if (elementContext === popper && offsetData) { 2197 var offset = offsetData[placement];
vendor: 1,315 bytes, lines 2198-2236
2198 Object.keys(overflowOffsets).forEach(function (key) { 2199 var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1; 2200 var axis = [enums_top, bottom].indexOf(key) >= 0 ? 'y' : 'x'; 2201 overflowOffsets[key] += offset[axis] * multiply; 2202 }); 2203 } 2204 2205 return overflowOffsets; 2206} 2207;// ./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js 2208 2209 2210 2211 2212function computeAutoPlacement(state, options) { 2213 if (options === void 0) { 2214 options = {}; 2215 } 2216 2217 var _options = options, 2218 placement = _options.placement, 2219 boundary = _options.boundary, 2220 rootBoundary = _options.rootBoundary, 2221 padding = _options.padding, 2222 flipVariations = _options.flipVariations, 2223 _options$allowedAutoP = _options.allowedAutoPlacements, 2224 allowedAutoPlacements = _options$allowedAutoP === void 0 ? enums_placements : _options$allowedAutoP; 2225 var variation = getVariation(placement); 2226 var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) { 2227 return getVariation(placement) === variation; 2228 }) : basePlacements; 2229 var allowedPlacements = placements.filter(function (placement) { 2230 return allowedAutoPlacements.indexOf(placement) >= 0; 2231 }); 2232 2233 if (allowedPlacements.length === 0) { 2234 allowedPlacements = placements; 2235 2236 if (false) {}
vendor: 11,540 bytes, lines 2236-2565
2236 2237 } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions... 2238 2239 2240 var overflows = allowedPlacements.reduce(function (acc, placement) { 2241 acc[placement] = detectOverflow(state, { 2242 placement: placement, 2243 boundary: boundary, 2244 rootBoundary: rootBoundary, 2245 padding: padding 2246 })[getBasePlacement(placement)]; 2247 return acc; 2248 }, {}); 2249 return Object.keys(overflows).sort(function (a, b) { 2250 return overflows[a] - overflows[b]; 2251 }); 2252} 2253;// ./node_modules/@popperjs/core/lib/modifiers/flip.js 2254 2255 2256 2257 2258 2259 2260 // eslint-disable-next-line import/no-unused-modules 2261 2262function getExpandedFallbackPlacements(placement) { 2263 if (getBasePlacement(placement) === auto) { 2264 return []; 2265 } 2266 2267 var oppositePlacement = getOppositePlacement(placement); 2268 return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)]; 2269} 2270 2271function flip(_ref) { 2272 var state = _ref.state, 2273 options = _ref.options, 2274 name = _ref.name; 2275 2276 if (state.modifiersData[name]._skip) { 2277 return; 2278 } 2279 2280 var _options$mainAxis = options.mainAxis, 2281 checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, 2282 _options$altAxis = options.altAxis, 2283 checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, 2284 specifiedFallbackPlacements = options.fallbackPlacements, 2285 padding = options.padding, 2286 boundary = options.boundary, 2287 rootBoundary = options.rootBoundary, 2288 altBoundary = options.altBoundary, 2289 _options$flipVariatio = options.flipVariations, 2290 flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, 2291 allowedAutoPlacements = options.allowedAutoPlacements; 2292 var preferredPlacement = state.options.placement; 2293 var basePlacement = getBasePlacement(preferredPlacement); 2294 var isBasePlacement = basePlacement === preferredPlacement; 2295 var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement)); 2296 var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) { 2297 return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, { 2298 placement: placement, 2299 boundary: boundary, 2300 rootBoundary: rootBoundary, 2301 padding: padding, 2302 flipVariations: flipVariations, 2303 allowedAutoPlacements: allowedAutoPlacements 2304 }) : placement); 2305 }, []); 2306 var referenceRect = state.rects.reference; 2307 var popperRect = state.rects.popper; 2308 var checksMap = new Map(); 2309 var makeFallbackChecks = true; 2310 var firstFittingPlacement = placements[0]; 2311 2312 for (var i = 0; i < placements.length; i++) { 2313 var placement = placements[i]; 2314 2315 var _basePlacement = getBasePlacement(placement); 2316 2317 var isStartVariation = getVariation(placement) === start; 2318 var isVertical = [enums_top, bottom].indexOf(_basePlacement) >= 0; 2319 var len = isVertical ? 'width' : 'height'; 2320 var overflow = detectOverflow(state, { 2321 placement: placement, 2322 boundary: boundary, 2323 rootBoundary: rootBoundary, 2324 altBoundary: altBoundary, 2325 padding: padding 2326 }); 2327 var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : enums_top; 2328 2329 if (referenceRect[len] > popperRect[len]) { 2330 mainVariationSide = getOppositePlacement(mainVariationSide); 2331 } 2332 2333 var altVariationSide = getOppositePlacement(mainVariationSide); 2334 var checks = []; 2335 2336 if (checkMainAxis) { 2337 checks.push(overflow[_basePlacement] <= 0); 2338 } 2339 2340 if (checkAltAxis) { 2341 checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0); 2342 } 2343 2344 if (checks.every(function (check) { 2345 return check; 2346 })) { 2347 firstFittingPlacement = placement; 2348 makeFallbackChecks = false; 2349 break; 2350 } 2351 2352 checksMap.set(placement, checks); 2353 } 2354 2355 if (makeFallbackChecks) { 2356 // `2` may be desired in some cases â research later 2357 var numberOfChecks = flipVariations ? 3 : 1; 2358 2359 var _loop = function _loop(_i) { 2360 var fittingPlacement = placements.find(function (placement) { 2361 var checks = checksMap.get(placement); 2362 2363 if (checks) { 2364 return checks.slice(0, _i).every(function (check) { 2365 return check; 2366 }); 2367 } 2368 }); 2369 2370 if (fittingPlacement) { 2371 firstFittingPlacement = fittingPlacement; 2372 return "break"; 2373 } 2374 }; 2375 2376 for (var _i = numberOfChecks; _i > 0; _i--) { 2377 var _ret = _loop(_i); 2378 2379 if (_ret === "break") break; 2380 } 2381 } 2382 2383 if (state.placement !== firstFittingPlacement) { 2384 state.modifiersData[name]._skip = true; 2385 state.placement = firstFittingPlacement; 2386 state.reset = true; 2387 } 2388} // eslint-disable-next-line import/no-unused-modules 2389 2390 2391/* harmony default export */ const modifiers_flip = ({ 2392 name: 'flip', 2393 enabled: true, 2394 phase: 'main', 2395 fn: flip, 2396 requiresIfExists: ['offset'], 2397 data: { 2398 _skip: false 2399 } 2400}); 2401;// ./node_modules/@popperjs/core/lib/utils/getAltAxis.js 2402function getAltAxis(axis) { 2403 return axis === 'x' ? 'y' : 'x'; 2404} 2405;// ./node_modules/@popperjs/core/lib/utils/within.js 2406 2407function within(min, value, max) { 2408 return math_max(min, math_min(value, max)); 2409} 2410function withinMaxClamp(min, value, max) { 2411 var v = within(min, value, max); 2412 return v > max ? max : v; 2413} 2414;// ./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427function preventOverflow(_ref) { 2428 var state = _ref.state, 2429 options = _ref.options, 2430 name = _ref.name; 2431 var _options$mainAxis = options.mainAxis, 2432 checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, 2433 _options$altAxis = options.altAxis, 2434 checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, 2435 boundary = options.boundary, 2436 rootBoundary = options.rootBoundary, 2437 altBoundary = options.altBoundary, 2438 padding = options.padding, 2439 _options$tether = options.tether, 2440 tether = _options$tether === void 0 ? true : _options$tether, 2441 _options$tetherOffset = options.tetherOffset, 2442 tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset; 2443 var overflow = detectOverflow(state, { 2444 boundary: boundary, 2445 rootBoundary: rootBoundary, 2446 padding: padding, 2447 altBoundary: altBoundary 2448 }); 2449 var basePlacement = getBasePlacement(state.placement); 2450 var variation = getVariation(state.placement); 2451 var isBasePlacement = !variation; 2452 var mainAxis = getMainAxisFromPlacement(basePlacement); 2453 var altAxis = getAltAxis(mainAxis); 2454 var popperOffsets = state.modifiersData.popperOffsets; 2455 var referenceRect = state.rects.reference; 2456 var popperRect = state.rects.popper; 2457 var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, { 2458 placement: state.placement 2459 })) : tetherOffset; 2460 var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? { 2461 mainAxis: tetherOffsetValue, 2462 altAxis: tetherOffsetValue 2463 } : Object.assign({ 2464 mainAxis: 0, 2465 altAxis: 0 2466 }, tetherOffsetValue); 2467 var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null; 2468 var data = { 2469 x: 0, 2470 y: 0 2471 }; 2472 2473 if (!popperOffsets) { 2474 return; 2475 } 2476 2477 if (checkMainAxis) { 2478 var _offsetModifierState$; 2479 2480 var mainSide = mainAxis === 'y' ? enums_top : left; 2481 var altSide = mainAxis === 'y' ? bottom : right; 2482 var len = mainAxis === 'y' ? 'height' : 'width'; 2483 var offset = popperOffsets[mainAxis]; 2484 var min = offset + overflow[mainSide]; 2485 var max = offset - overflow[altSide]; 2486 var additive = tether ? -popperRect[len] / 2 : 0; 2487 var minLen = variation === start ? referenceRect[len] : popperRect[len]; 2488 var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go 2489 // outside the reference bounds 2490 2491 var arrowElement = state.elements.arrow; 2492 var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : { 2493 width: 0, 2494 height: 0 2495 }; 2496 var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject(); 2497 var arrowPaddingMin = arrowPaddingObject[mainSide]; 2498 var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want 2499 // to include its full size in the calculation. If the reference is small 2500 // and near the edge of a boundary, the popper can overflow even if the 2501 // reference is not overflowing as well (e.g. virtual elements with no 2502 // width or height) 2503 2504 var arrowLen = within(0, referenceRect[len], arrowRect[len]); 2505 var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis; 2506 var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis; 2507 var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow); 2508 var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0; 2509 var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0; 2510 var tetherMin = offset + minOffset - offsetModifierValue - clientOffset; 2511 var tetherMax = offset + maxOffset - offsetModifierValue; 2512 var preventedOffset = within(tether ? math_min(min, tetherMin) : min, offset, tether ? math_max(max, tetherMax) : max); 2513 popperOffsets[mainAxis] = preventedOffset; 2514 data[mainAxis] = preventedOffset - offset; 2515 } 2516 2517 if (checkAltAxis) { 2518 var _offsetModifierState$2; 2519 2520 var _mainSide = mainAxis === 'x' ? enums_top : left; 2521 2522 var _altSide = mainAxis === 'x' ? bottom : right; 2523 2524 var _offset = popperOffsets[altAxis]; 2525 2526 var _len = altAxis === 'y' ? 'height' : 'width'; 2527 2528 var _min = _offset + overflow[_mainSide]; 2529 2530 var _max = _offset - overflow[_altSide]; 2531 2532 var isOriginSide = [enums_top, left].indexOf(basePlacement) !== -1; 2533 2534 var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0; 2535 2536 var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis; 2537 2538 var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max; 2539 2540 var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max); 2541 2542 popperOffsets[altAxis] = _preventedOffset; 2543 data[altAxis] = _preventedOffset - _offset; 2544 } 2545 2546 state.modifiersData[name] = data; 2547} // eslint-disable-next-line import/no-unused-modules 2548 2549 2550/* harmony default export */ const modifiers_preventOverflow = ({ 2551 name: 'preventOverflow', 2552 enabled: true, 2553 phase: 'main', 2554 fn: preventOverflow, 2555 requiresIfExists: ['offset'] 2556}); 2557;// ./node_modules/@popperjs/core/lib/modifiers/arrow.js 2558 2559 2560 2561 2562 2563 2564 2565
2566 2567 // eslint-disable-next-line import/no-unused-modules 2568 2569var toPaddingObject = function toPaddingObject(padding, state) { 2570 padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, { 2571 placement: state.placement 2572 })) : padding; 2573 return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); 2574}; 2575 2576function arrow(_ref) { 2577 var _state$modifiersData$; 2578 2579 var state = _ref.state, 2580 name = _ref.name, 2581 options = _ref.options; 2582 var arrowElement = state.elements.arrow; 2583 var popperOffsets = state.modifiersData.popperOffsets; 2584 var basePlacement = getBasePlacement(state.placement); 2585 var axis = getMainAxisFromPlacement(basePlacement); 2586 var isVertical = [left, right].indexOf(basePlacement) >= 0; 2587 var len = isVertical ? 'height' : 'width'; 2588 2589 if (!arrowElement || !popperOffsets) { 2590 return; 2591 } 2592
vendor: 5,682 bytes, lines 2593-2772
2593 var paddingObject = toPaddingObject(options.padding, state); 2594 var arrowRect = getLayoutRect(arrowElement); 2595 var minProp = axis === 'y' ? enums_top : left; 2596 var maxProp = axis === 'y' ? bottom : right; 2597 var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len]; 2598 var startDiff = popperOffsets[axis] - state.rects.reference[axis]; 2599 var arrowOffsetParent = getOffsetParent(arrowElement); 2600 var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0; 2601 var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is 2602 // outside of the popper bounds 2603 2604 var min = paddingObject[minProp]; 2605 var max = clientSize - arrowRect[len] - paddingObject[maxProp]; 2606 var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference; 2607 var offset = within(min, center, max); // Prevents breaking syntax highlighting... 2608 2609 var axisProp = axis; 2610 state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$); 2611} 2612 2613function arrow_effect(_ref2) { 2614 var state = _ref2.state, 2615 options = _ref2.options; 2616 var _options$element = options.element, 2617 arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element; 2618 2619 if (arrowElement == null) { 2620 return; 2621 } // CSS selector 2622 2623 2624 if (typeof arrowElement === 'string') { 2625 arrowElement = state.elements.popper.querySelector(arrowElement); 2626 2627 if (!arrowElement) { 2628 return; 2629 } 2630 } 2631 2632 if (false) {} 2633 2634 if (!contains(state.elements.popper, arrowElement)) { 2635 if (false) {} 2636 2637 return; 2638 } 2639 2640 state.elements.arrow = arrowElement; 2641} // eslint-disable-next-line import/no-unused-modules 2642 2643 2644/* harmony default export */ const modifiers_arrow = ({ 2645 name: 'arrow', 2646 enabled: true, 2647 phase: 'main', 2648 fn: arrow, 2649 effect: arrow_effect, 2650 requires: ['popperOffsets'], 2651 requiresIfExists: ['preventOverflow'] 2652}); 2653;// ./node_modules/@popperjs/core/lib/modifiers/hide.js 2654 2655 2656 2657function getSideOffsets(overflow, rect, preventedOffsets) { 2658 if (preventedOffsets === void 0) { 2659 preventedOffsets = { 2660 x: 0, 2661 y: 0 2662 }; 2663 } 2664 2665 return { 2666 top: overflow.top - rect.height - preventedOffsets.y, 2667 right: overflow.right - rect.width + preventedOffsets.x, 2668 bottom: overflow.bottom - rect.height + preventedOffsets.y, 2669 left: overflow.left - rect.width - preventedOffsets.x 2670 }; 2671} 2672 2673function isAnySideFullyClipped(overflow) { 2674 return [enums_top, right, bottom, left].some(function (side) { 2675 return overflow[side] >= 0; 2676 }); 2677} 2678 2679function hide(_ref) { 2680 var state = _ref.state, 2681 name = _ref.name; 2682 var referenceRect = state.rects.reference; 2683 var popperRect = state.rects.popper; 2684 var preventedOffsets = state.modifiersData.preventOverflow; 2685 var referenceOverflow = detectOverflow(state, { 2686 elementContext: 'reference' 2687 }); 2688 var popperAltOverflow = detectOverflow(state, { 2689 altBoundary: true 2690 }); 2691 var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect); 2692 var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets); 2693 var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets); 2694 var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets); 2695 state.modifiersData[name] = { 2696 referenceClippingOffsets: referenceClippingOffsets, 2697 popperEscapeOffsets: popperEscapeOffsets, 2698 isReferenceHidden: isReferenceHidden, 2699 hasPopperEscaped: hasPopperEscaped 2700 }; 2701 state.attributes.popper = Object.assign({}, state.attributes.popper, { 2702 'data-popper-reference-hidden': isReferenceHidden, 2703 'data-popper-escaped': hasPopperEscaped 2704 }); 2705} // eslint-disable-next-line import/no-unused-modules 2706 2707 2708/* harmony default export */ const modifiers_hide = ({ 2709 name: 'hide', 2710 enabled: true, 2711 phase: 'main', 2712 requiresIfExists: ['preventOverflow'], 2713 fn: hide 2714}); 2715;// ./node_modules/@popperjs/core/lib/popper.js 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726var defaultModifiers = [eventListeners, modifiers_popperOffsets, modifiers_computeStyles, modifiers_applyStyles, modifiers_offset, modifiers_flip, modifiers_preventOverflow, modifiers_arrow, modifiers_hide]; 2727var popper_createPopper = /*#__PURE__*/popperGenerator({ 2728 defaultModifiers: defaultModifiers 2729}); // eslint-disable-next-line import/no-unused-modules 2730 2731 // eslint-disable-next-line import/no-unused-modules 2732 2733 // eslint-disable-next-line import/no-unused-modules 2734 2735 2736;// ./node_modules/tippy.js/dist/tippy.esm.js 2737/**! 2738* tippy.js v6.3.7 2739* (c) 2017-2021 atomiks 2740* MIT License 2741*/ 2742 2743 2744var ROUND_ARROW = '<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>'; 2745var BOX_CLASS = "tippy-box"; 2746var CONTENT_CLASS = "tippy-content"; 2747var BACKDROP_CLASS = "tippy-backdrop"; 2748var ARROW_CLASS = "tippy-arrow"; 2749var SVG_ARROW_CLASS = "tippy-svg-arrow"; 2750var TOUCH_OPTIONS = { 2751 passive: true, 2752 capture: true 2753}; 2754var TIPPY_DEFAULT_APPEND_TO = function TIPPY_DEFAULT_APPEND_TO() { 2755 return document.body; 2756}; 2757 2758function tippy_esm_hasOwnProperty(obj, key) { 2759 return {}.hasOwnProperty.call(obj, key); 2760} 2761function getValueAtIndexOrReturn(value, index, defaultValue) { 2762 if (Array.isArray(value)) { 2763 var v = value[index]; 2764 return v == null ? Array.isArray(defaultValue) ? defaultValue[index] : defaultValue : v; 2765 } 2766 2767 return value; 2768} 2769function isType(value, type) { 2770 var str = {}.toString.call(value); 2771 return str.indexOf('[object') === 0 && str.indexOf(type + "]") > -1; 2772}
vendor: 1,997 bytes, lines 2773-2861
2773function invokeWithArgsOrReturn(value, args) { 2774 return typeof value === 'function' ? value.apply(void 0, args) : value; 2775} 2776function tippy_esm_debounce(fn, ms) { 2777 // Avoid wrapping in `setTimeout` if ms is 0 anyway 2778 if (ms === 0) { 2779 return fn; 2780 } 2781 2782 var timeout; 2783 return function (arg) { 2784 clearTimeout(timeout); 2785 timeout = setTimeout(function () { 2786 fn(arg); 2787 }, ms); 2788 }; 2789} 2790function removeProperties(obj, keys) { 2791 var clone = Object.assign({}, obj); 2792 keys.forEach(function (key) { 2793 delete clone[key]; 2794 }); 2795 return clone; 2796} 2797function splitBySpaces(value) { 2798 return value.split(/\s+/).filter(Boolean); 2799} 2800function normalizeToArray(value) { 2801 return [].concat(value); 2802} 2803function pushIfUnique(arr, value) { 2804 if (arr.indexOf(value) === -1) { 2805 arr.push(value); 2806 } 2807} 2808function unique(arr) { 2809 return arr.filter(function (item, index) { 2810 return arr.indexOf(item) === index; 2811 }); 2812} 2813function tippy_esm_getBasePlacement(placement) { 2814 return placement.split('-')[0]; 2815} 2816function arrayFrom(value) { 2817 return [].slice.call(value); 2818} 2819function removeUndefinedProps(obj) { 2820 return Object.keys(obj).reduce(function (acc, key) { 2821 if (obj[key] !== undefined) { 2822 acc[key] = obj[key]; 2823 } 2824 2825 return acc; 2826 }, {}); 2827} 2828 2829function div() { 2830 return document.createElement('div'); 2831} 2832function tippy_esm_isElement(value) { 2833 return ['Element', 'Fragment'].some(function (type) { 2834 return isType(value, type); 2835 }); 2836} 2837function isNodeList(value) { 2838 return isType(value, 'NodeList'); 2839} 2840function isMouseEvent(value) { 2841 return isType(value, 'MouseEvent'); 2842} 2843function isReferenceElement(value) { 2844 return !!(value && value._tippy && value._tippy.reference === value); 2845} 2846function getArrayOfElements(value) { 2847 if (tippy_esm_isElement(value)) { 2848 return [value]; 2849 } 2850 2851 if (isNodeList(value)) { 2852 return arrayFrom(value); 2853 } 2854 2855 if (Array.isArray(value)) { 2856 return value; 2857 } 2858 2859 return arrayFrom(document.querySelectorAll(value)); 2860} 2861function setTransitionDuration(els, value) {
vendor: 4,523 bytes, lines 2862-3002
2862 els.forEach(function (el) { 2863 if (el) { 2864 el.style.transitionDuration = value + "ms"; 2865 } 2866 }); 2867} 2868function setVisibilityState(els, state) { 2869 els.forEach(function (el) { 2870 if (el) { 2871 el.setAttribute('data-state', state); 2872 } 2873 }); 2874} 2875function getOwnerDocument(elementOrElements) { 2876 var _element$ownerDocumen; 2877 2878 var _normalizeToArray = normalizeToArray(elementOrElements), 2879 element = _normalizeToArray[0]; // Elements created via a <template> have an ownerDocument with no reference to the body 2880 2881 2882 return element != null && (_element$ownerDocumen = element.ownerDocument) != null && _element$ownerDocumen.body ? element.ownerDocument : document; 2883} 2884function isCursorOutsideInteractiveBorder(popperTreeData, event) { 2885 var clientX = event.clientX, 2886 clientY = event.clientY; 2887 return popperTreeData.every(function (_ref) { 2888 var popperRect = _ref.popperRect, 2889 popperState = _ref.popperState, 2890 props = _ref.props; 2891 var interactiveBorder = props.interactiveBorder; 2892 var basePlacement = tippy_esm_getBasePlacement(popperState.placement); 2893 var offsetData = popperState.modifiersData.offset; 2894 2895 if (!offsetData) { 2896 return true; 2897 } 2898 2899 var topDistance = basePlacement === 'bottom' ? offsetData.top.y : 0; 2900 var bottomDistance = basePlacement === 'top' ? offsetData.bottom.y : 0; 2901 var leftDistance = basePlacement === 'right' ? offsetData.left.x : 0; 2902 var rightDistance = basePlacement === 'left' ? offsetData.right.x : 0; 2903 var exceedsTop = popperRect.top - clientY + topDistance > interactiveBorder; 2904 var exceedsBottom = clientY - popperRect.bottom - bottomDistance > interactiveBorder; 2905 var exceedsLeft = popperRect.left - clientX + leftDistance > interactiveBorder; 2906 var exceedsRight = clientX - popperRect.right - rightDistance > interactiveBorder; 2907 return exceedsTop || exceedsBottom || exceedsLeft || exceedsRight; 2908 }); 2909} 2910function updateTransitionEndListener(box, action, listener) { 2911 var method = action + "EventListener"; // some browsers apparently support `transition` (unprefixed) but only fire 2912 // `webkitTransitionEnd`... 2913 2914 ['transitionend', 'webkitTransitionEnd'].forEach(function (event) { 2915 box[method](event, listener); 2916 }); 2917} 2918/** 2919 * Compared to xxx.contains, this function works for dom structures with shadow 2920 * dom 2921 */ 2922 2923function actualContains(parent, child) { 2924 var target = child; 2925 2926 while (target) { 2927 var _target$getRootNode; 2928 2929 if (parent.contains(target)) { 2930 return true; 2931 } 2932 2933 target = target.getRootNode == null ? void 0 : (_target$getRootNode = target.getRootNode()) == null ? void 0 : _target$getRootNode.host; 2934 } 2935 2936 return false; 2937} 2938 2939var currentInput = { 2940 isTouch: false 2941}; 2942var lastMouseMoveTime = 0; 2943/** 2944 * When a `touchstart` event is fired, it's assumed the user is using touch 2945 * input. We'll bind a `mousemove` event listener to listen for mouse input in 2946 * the future. This way, the `isTouch` property is fully dynamic and will handle 2947 * hybrid devices that use a mix of touch + mouse input. 2948 */ 2949 2950function onDocumentTouchStart() { 2951 if (currentInput.isTouch) { 2952 return; 2953 } 2954 2955 currentInput.isTouch = true; 2956 2957 if (window.performance) { 2958 document.addEventListener('mousemove', onDocumentMouseMove); 2959 } 2960} 2961/** 2962 * When two `mousemove` event are fired consecutively within 20ms, it's assumed 2963 * the user is using mouse input again. `mousemove` can fire on touch devices as 2964 * well, but very rarely that quickly. 2965 */ 2966 2967function onDocumentMouseMove() { 2968 var now = performance.now(); 2969 2970 if (now - lastMouseMoveTime < 20) { 2971 currentInput.isTouch = false; 2972 document.removeEventListener('mousemove', onDocumentMouseMove); 2973 } 2974 2975 lastMouseMoveTime = now; 2976} 2977/** 2978 * When an element is in focus and has a tippy, leaving the tab/window and 2979 * returning causes it to show again. For mouse users this is unexpected, but 2980 * for keyboard use it makes sense. 2981 * TODO: find a better technique to solve this problem 2982 */ 2983 2984function onWindowBlur() { 2985 var activeElement = document.activeElement; 2986 2987 if (isReferenceElement(activeElement)) { 2988 var instance = activeElement._tippy; 2989 2990 if (activeElement.blur && !instance.state.isVisible) { 2991 activeElement.blur(); 2992 } 2993 } 2994} 2995function bindGlobalEventListeners() { 2996 document.addEventListener('touchstart', onDocumentTouchStart, TOUCH_OPTIONS); 2997 window.addEventListener('blur', onWindowBlur); 2998} 2999 3000var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined'; 3001var isIE11 = isBrowser ? // @ts-ignore 3002!!window.msCrypto : false;
vendor: 10,148 bytes, lines 3003-3334
3003 3004function createMemoryLeakWarning(method) { 3005 var txt = method === 'destroy' ? 'n already-' : ' '; 3006 return [method + "() was called on a" + txt + "destroyed instance. This is a no-op but", 'indicates a potential memory leak.'].join(' '); 3007} 3008function clean(value) { 3009 var spacesAndTabs = /[ \t]{2,}/g; 3010 var lineStartWithSpaces = /^[ \t]*/gm; 3011 return value.replace(spacesAndTabs, ' ').replace(lineStartWithSpaces, '').trim(); 3012} 3013 3014function getDevMessage(message) { 3015 return clean("\n %ctippy.js\n\n %c" + clean(message) + "\n\n %c\uD83D\uDC77\u200D This is a development-only message. It will be removed in production.\n "); 3016} 3017 3018function getFormattedMessage(message) { 3019 return [getDevMessage(message), // title 3020 'color: #00C584; font-size: 1.3em; font-weight: bold;', // message 3021 'line-height: 1.5', // footer 3022 'color: #a6a095;']; 3023} // Assume warnings and errors never have the same message 3024 3025var visitedMessages; 3026 3027if (false) {} 3028 3029function resetVisitedMessages() { 3030 visitedMessages = new Set(); 3031} 3032function warnWhen(condition, message) { 3033 if (condition && !visitedMessages.has(message)) { 3034 var _console; 3035 3036 visitedMessages.add(message); 3037 3038 (_console = console).warn.apply(_console, getFormattedMessage(message)); 3039 } 3040} 3041function errorWhen(condition, message) { 3042 if (condition && !visitedMessages.has(message)) { 3043 var _console2; 3044 3045 visitedMessages.add(message); 3046 3047 (_console2 = console).error.apply(_console2, getFormattedMessage(message)); 3048 } 3049} 3050function validateTargets(targets) { 3051 var didPassFalsyValue = !targets; 3052 var didPassPlainObject = Object.prototype.toString.call(targets) === '[object Object]' && !targets.addEventListener; 3053 errorWhen(didPassFalsyValue, ['tippy() was passed', '`' + String(targets) + '`', 'as its targets (first) argument. Valid types are: String, Element,', 'Element[], or NodeList.'].join(' ')); 3054 errorWhen(didPassPlainObject, ['tippy() was passed a plain object which is not supported as an argument', 'for virtual positioning. Use props.getReferenceClientRect instead.'].join(' ')); 3055} 3056 3057var pluginProps = { 3058 animateFill: false, 3059 followCursor: false, 3060 inlinePositioning: false, 3061 sticky: false 3062}; 3063var renderProps = { 3064 allowHTML: false, 3065 animation: 'fade', 3066 arrow: true, 3067 content: '', 3068 inertia: false, 3069 maxWidth: 350, 3070 role: 'tooltip', 3071 theme: '', 3072 zIndex: 9999 3073}; 3074var defaultProps = Object.assign({ 3075 appendTo: TIPPY_DEFAULT_APPEND_TO, 3076 aria: { 3077 content: 'auto', 3078 expanded: 'auto' 3079 }, 3080 delay: 0, 3081 duration: [300, 250], 3082 getReferenceClientRect: null, 3083 hideOnClick: true, 3084 ignoreAttributes: false, 3085 interactive: false, 3086 interactiveBorder: 2, 3087 interactiveDebounce: 0, 3088 moveTransition: '', 3089 offset: [0, 10], 3090 onAfterUpdate: function onAfterUpdate() {}, 3091 onBeforeUpdate: function onBeforeUpdate() {}, 3092 onCreate: function onCreate() {}, 3093 onDestroy: function onDestroy() {}, 3094 onHidden: function onHidden() {}, 3095 onHide: function onHide() {}, 3096 onMount: function onMount() {}, 3097 onShow: function onShow() {}, 3098 onShown: function onShown() {}, 3099 onTrigger: function onTrigger() {}, 3100 onUntrigger: function onUntrigger() {}, 3101 onClickOutside: function onClickOutside() {}, 3102 placement: 'top', 3103 plugins: [], 3104 popperOptions: {}, 3105 render: null, 3106 showOnCreate: false, 3107 touch: true, 3108 trigger: 'mouseenter focus', 3109 triggerTarget: null 3110}, pluginProps, renderProps); 3111var defaultKeys = Object.keys(defaultProps); 3112var setDefaultProps = function setDefaultProps(partialProps) { 3113 /* istanbul ignore else */ 3114 if (false) {} 3115 3116 var keys = Object.keys(partialProps); 3117 keys.forEach(function (key) { 3118 defaultProps[key] = partialProps[key]; 3119 }); 3120}; 3121function getExtendedPassedProps(passedProps) { 3122 var plugins = passedProps.plugins || []; 3123 var pluginProps = plugins.reduce(function (acc, plugin) { 3124 var name = plugin.name, 3125 defaultValue = plugin.defaultValue; 3126 3127 if (name) { 3128 var _name; 3129 3130 acc[name] = passedProps[name] !== undefined ? passedProps[name] : (_name = defaultProps[name]) != null ? _name : defaultValue; 3131 } 3132 3133 return acc; 3134 }, {}); 3135 return Object.assign({}, passedProps, pluginProps); 3136} 3137function getDataAttributeProps(reference, plugins) { 3138 var propKeys = plugins ? Object.keys(getExtendedPassedProps(Object.assign({}, defaultProps, { 3139 plugins: plugins 3140 }))) : defaultKeys; 3141 var props = propKeys.reduce(function (acc, key) { 3142 var valueAsString = (reference.getAttribute("data-tippy-" + key) || '').trim(); 3143 3144 if (!valueAsString) { 3145 return acc; 3146 } 3147 3148 if (key === 'content') { 3149 acc[key] = valueAsString; 3150 } else { 3151 try { 3152 acc[key] = JSON.parse(valueAsString); 3153 } catch (e) { 3154 acc[key] = valueAsString; 3155 } 3156 } 3157 3158 return acc; 3159 }, {}); 3160 return props; 3161} 3162function evaluateProps(reference, props) { 3163 var out = Object.assign({}, props, { 3164 content: invokeWithArgsOrReturn(props.content, [reference]) 3165 }, props.ignoreAttributes ? {} : getDataAttributeProps(reference, props.plugins)); 3166 out.aria = Object.assign({}, defaultProps.aria, out.aria); 3167 out.aria = { 3168 expanded: out.aria.expanded === 'auto' ? props.interactive : out.aria.expanded, 3169 content: out.aria.content === 'auto' ? props.interactive ? null : 'describedby' : out.aria.content 3170 }; 3171 return out; 3172} 3173function validateProps(partialProps, plugins) { 3174 if (partialProps === void 0) { 3175 partialProps = {}; 3176 } 3177 3178 if (plugins === void 0) { 3179 plugins = []; 3180 } 3181 3182 var keys = Object.keys(partialProps); 3183 keys.forEach(function (prop) { 3184 var nonPluginProps = removeProperties(defaultProps, Object.keys(pluginProps)); 3185 var didPassUnknownProp = !tippy_esm_hasOwnProperty(nonPluginProps, prop); // Check if the prop exists in `plugins` 3186 3187 if (didPassUnknownProp) { 3188 didPassUnknownProp = plugins.filter(function (plugin) { 3189 return plugin.name === prop; 3190 }).length === 0; 3191 } 3192 3193 warnWhen(didPassUnknownProp, ["`" + prop + "`", "is not a valid prop. You may have spelled it incorrectly, or if it's", 'a plugin, forgot to pass it in an array as props.plugins.', '\n\n', 'All props: https://atomiks.github.io/tippyjs/v6/all-props/\n', 'Plugins: https://atomiks.github.io/tippyjs/v6/plugins/'].join(' ')); 3194 }); 3195} 3196 3197var innerHTML = function innerHTML() { 3198 return 'innerHTML'; 3199}; 3200 3201function dangerouslySetInnerHTML(element, html) { 3202 element[innerHTML()] = html; 3203} 3204 3205function createArrowElement(value) { 3206 var arrow = div(); 3207 3208 if (value === true) { 3209 arrow.className = ARROW_CLASS; 3210 } else { 3211 arrow.className = SVG_ARROW_CLASS; 3212 3213 if (tippy_esm_isElement(value)) { 3214 arrow.appendChild(value); 3215 } else { 3216 dangerouslySetInnerHTML(arrow, value); 3217 } 3218 } 3219 3220 return arrow; 3221} 3222 3223function setContent(content, props) { 3224 if (tippy_esm_isElement(props.content)) { 3225 dangerouslySetInnerHTML(content, ''); 3226 content.appendChild(props.content); 3227 } else if (typeof props.content !== 'function') { 3228 if (props.allowHTML) { 3229 dangerouslySetInnerHTML(content, props.content); 3230 } else { 3231 content.textContent = props.content; 3232 } 3233 } 3234} 3235function getChildren(popper) { 3236 var box = popper.firstElementChild; 3237 var boxChildren = arrayFrom(box.children); 3238 return { 3239 box: box, 3240 content: boxChildren.find(function (node) { 3241 return node.classList.contains(CONTENT_CLASS); 3242 }), 3243 arrow: boxChildren.find(function (node) { 3244 return node.classList.contains(ARROW_CLASS) || node.classList.contains(SVG_ARROW_CLASS); 3245 }), 3246 backdrop: boxChildren.find(function (node) { 3247 return node.classList.contains(BACKDROP_CLASS); 3248 }) 3249 }; 3250} 3251function render(instance) { 3252 var popper = div(); 3253 var box = div(); 3254 box.className = BOX_CLASS; 3255 box.setAttribute('data-state', 'hidden'); 3256 box.setAttribute('tabindex', '-1'); 3257 var content = div(); 3258 content.className = CONTENT_CLASS; 3259 content.setAttribute('data-state', 'hidden'); 3260 setContent(content, instance.props); 3261 popper.appendChild(box); 3262 box.appendChild(content); 3263 onUpdate(instance.props, instance.props); 3264 3265 function onUpdate(prevProps, nextProps) { 3266 var _getChildren = getChildren(popper), 3267 box = _getChildren.box, 3268 content = _getChildren.content, 3269 arrow = _getChildren.arrow; 3270 3271 if (nextProps.theme) { 3272 box.setAttribute('data-theme', nextProps.theme); 3273 } else { 3274 box.removeAttribute('data-theme'); 3275 } 3276 3277 if (typeof nextProps.animation === 'string') { 3278 box.setAttribute('data-animation', nextProps.animation); 3279 } else { 3280 box.removeAttribute('data-animation'); 3281 } 3282 3283 if (nextProps.inertia) { 3284 box.setAttribute('data-inertia', ''); 3285 } else { 3286 box.removeAttribute('data-inertia'); 3287 } 3288 3289 box.style.maxWidth = typeof nextProps.maxWidth === 'number' ? nextProps.maxWidth + "px" : nextProps.maxWidth; 3290 3291 if (nextProps.role) { 3292 box.setAttribute('role', nextProps.role); 3293 } else { 3294 box.removeAttribute('role'); 3295 } 3296 3297 if (prevProps.content !== nextProps.content || prevProps.allowHTML !== nextProps.allowHTML) { 3298 setContent(content, instance.props); 3299 } 3300 3301 if (nextProps.arrow) { 3302 if (!arrow) { 3303 box.appendChild(createArrowElement(nextProps.arrow)); 3304 } else if (prevProps.arrow !== nextProps.arrow) { 3305 box.removeChild(arrow); 3306 box.appendChild(createArrowElement(nextProps.arrow)); 3307 } 3308 } else if (arrow) { 3309 box.removeChild(arrow); 3310 } 3311 } 3312 3313 return { 3314 popper: popper, 3315 onUpdate: onUpdate 3316 }; 3317} // Runtime check to identify if the render function is the default one; this 3318// way we can apply default CSS transitions logic and it can be tree-shaken away 3319 3320render.$$tippy = true; 3321 3322var idCounter = 1; 3323var mouseMoveListeners = []; // Used by `hideAll()` 3324 3325var mountedInstances = []; 3326function createTippy(reference, passedProps) { 3327 var props = evaluateProps(reference, Object.assign({}, defaultProps, getExtendedPassedProps(removeUndefinedProps(passedProps)))); // =========================================================================== 3328 // ð Private members 3329 // =========================================================================== 3330 3331 var showTimeout; 3332 var hideTimeout; 3333 var scheduleHideAnimationFrame; 3334 var isVisibleFromClick = false;
vendor: 1,638 bytes, lines 3335-3388
3335 var didHideDueToDocumentMouseDown = false; 3336 var didTouchMove = false; 3337 var ignoreOnFirstUpdate = false; 3338 var lastTriggerEvent; 3339 var currentTransitionEndListener; 3340 var onFirstUpdate; 3341 var listeners = []; 3342 var debouncedOnMouseMove = tippy_esm_debounce(onMouseMove, props.interactiveDebounce); 3343 var currentTarget; // =========================================================================== 3344 // ð Public members 3345 // =========================================================================== 3346 3347 var id = idCounter++; 3348 var popperInstance = null; 3349 var plugins = unique(props.plugins); 3350 var state = { 3351 // Is the instance currently enabled? 3352 isEnabled: true, 3353 // Is the tippy currently showing and not transitioning out? 3354 isVisible: false, 3355 // Has the instance been destroyed? 3356 isDestroyed: false, 3357 // Is the tippy currently mounted to the DOM? 3358 isMounted: false, 3359 // Has the tippy finished transitioning in? 3360 isShown: false 3361 }; 3362 var instance = { 3363 // properties 3364 id: id, 3365 reference: reference, 3366 popper: div(), 3367 popperInstance: popperInstance, 3368 props: props, 3369 state: state, 3370 plugins: plugins, 3371 // methods 3372 clearDelayTimeouts: clearDelayTimeouts, 3373 setProps: setProps, 3374 setContent: setContent, 3375 show: show, 3376 hide: hide, 3377 hideWithInteractivity: hideWithInteractivity, 3378 enable: enable, 3379 disable: disable, 3380 unmount: unmount, 3381 destroy: destroy 3382 }; // TODO: Investigate why this early return causes a TDZ error in the tests â 3383 // it doesn't seem to happen in the browser 3384 3385 /* istanbul ignore if */ 3386 3387 if (!props.render) { 3388 if (false) {}
vendor: 14,959 bytes, lines 3388-3897
3388 3389 3390 return instance; 3391 } // =========================================================================== 3392 // Initial mutations 3393 // =========================================================================== 3394 3395 3396 var _props$render = props.render(instance), 3397 popper = _props$render.popper, 3398 onUpdate = _props$render.onUpdate; 3399 3400 popper.setAttribute('data-tippy-root', ''); 3401 popper.id = "tippy-" + instance.id; 3402 instance.popper = popper; 3403 reference._tippy = instance; 3404 popper._tippy = instance; 3405 var pluginsHooks = plugins.map(function (plugin) { 3406 return plugin.fn(instance); 3407 }); 3408 var hasAriaExpanded = reference.hasAttribute('aria-expanded'); 3409 addListeners(); 3410 handleAriaExpandedAttribute(); 3411 handleStyles(); 3412 invokeHook('onCreate', [instance]); 3413 3414 if (props.showOnCreate) { 3415 scheduleShow(); 3416 } // Prevent a tippy with a delay from hiding if the cursor left then returned 3417 // before it started hiding 3418 3419 3420 popper.addEventListener('mouseenter', function () { 3421 if (instance.props.interactive && instance.state.isVisible) { 3422 instance.clearDelayTimeouts(); 3423 } 3424 }); 3425 popper.addEventListener('mouseleave', function () { 3426 if (instance.props.interactive && instance.props.trigger.indexOf('mouseenter') >= 0) { 3427 getDocument().addEventListener('mousemove', debouncedOnMouseMove); 3428 } 3429 }); 3430 return instance; // =========================================================================== 3431 // ð Private methods 3432 // =========================================================================== 3433 3434 function getNormalizedTouchSettings() { 3435 var touch = instance.props.touch; 3436 return Array.isArray(touch) ? touch : [touch, 0]; 3437 } 3438 3439 function getIsCustomTouchBehavior() { 3440 return getNormalizedTouchSettings()[0] === 'hold'; 3441 } 3442 3443 function getIsDefaultRenderFn() { 3444 var _instance$props$rende; 3445 3446 // @ts-ignore 3447 return !!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy); 3448 } 3449 3450 function getCurrentTarget() { 3451 return currentTarget || reference; 3452 } 3453 3454 function getDocument() { 3455 var parent = getCurrentTarget().parentNode; 3456 return parent ? getOwnerDocument(parent) : document; 3457 } 3458 3459 function getDefaultTemplateChildren() { 3460 return getChildren(popper); 3461 } 3462 3463 function getDelay(isShow) { 3464 // For touch or keyboard input, force `0` delay for UX reasons 3465 // Also if the instance is mounted but not visible (transitioning out), 3466 // ignore delay 3467 if (instance.state.isMounted && !instance.state.isVisible || currentInput.isTouch || lastTriggerEvent && lastTriggerEvent.type === 'focus') { 3468 return 0; 3469 } 3470 3471 return getValueAtIndexOrReturn(instance.props.delay, isShow ? 0 : 1, defaultProps.delay); 3472 } 3473 3474 function handleStyles(fromHide) { 3475 if (fromHide === void 0) { 3476 fromHide = false; 3477 } 3478 3479 popper.style.pointerEvents = instance.props.interactive && !fromHide ? '' : 'none'; 3480 popper.style.zIndex = "" + instance.props.zIndex; 3481 } 3482 3483 function invokeHook(hook, args, shouldInvokePropsHook) { 3484 if (shouldInvokePropsHook === void 0) { 3485 shouldInvokePropsHook = true; 3486 } 3487 3488 pluginsHooks.forEach(function (pluginHooks) { 3489 if (pluginHooks[hook]) { 3490 pluginHooks[hook].apply(pluginHooks, args); 3491 } 3492 }); 3493 3494 if (shouldInvokePropsHook) { 3495 var _instance$props; 3496 3497 (_instance$props = instance.props)[hook].apply(_instance$props, args); 3498 } 3499 } 3500 3501 function handleAriaContentAttribute() { 3502 var aria = instance.props.aria; 3503 3504 if (!aria.content) { 3505 return; 3506 } 3507 3508 var attr = "aria-" + aria.content; 3509 var id = popper.id; 3510 var nodes = normalizeToArray(instance.props.triggerTarget || reference); 3511 nodes.forEach(function (node) { 3512 var currentValue = node.getAttribute(attr); 3513 3514 if (instance.state.isVisible) { 3515 node.setAttribute(attr, currentValue ? currentValue + " " + id : id); 3516 } else { 3517 var nextValue = currentValue && currentValue.replace(id, '').trim(); 3518 3519 if (nextValue) { 3520 node.setAttribute(attr, nextValue); 3521 } else { 3522 node.removeAttribute(attr); 3523 } 3524 } 3525 }); 3526 } 3527 3528 function handleAriaExpandedAttribute() { 3529 if (hasAriaExpanded || !instance.props.aria.expanded) { 3530 return; 3531 } 3532 3533 var nodes = normalizeToArray(instance.props.triggerTarget || reference); 3534 nodes.forEach(function (node) { 3535 if (instance.props.interactive) { 3536 node.setAttribute('aria-expanded', instance.state.isVisible && node === getCurrentTarget() ? 'true' : 'false'); 3537 } else { 3538 node.removeAttribute('aria-expanded'); 3539 } 3540 }); 3541 } 3542 3543 function cleanupInteractiveMouseListeners() { 3544 getDocument().removeEventListener('mousemove', debouncedOnMouseMove); 3545 mouseMoveListeners = mouseMoveListeners.filter(function (listener) { 3546 return listener !== debouncedOnMouseMove; 3547 }); 3548 } 3549 3550 function onDocumentPress(event) { 3551 // Moved finger to scroll instead of an intentional tap outside 3552 if (currentInput.isTouch) { 3553 if (didTouchMove || event.type === 'mousedown') { 3554 return; 3555 } 3556 } 3557 3558 var actualTarget = event.composedPath && event.composedPath()[0] || event.target; // Clicked on interactive popper 3559 3560 if (instance.props.interactive && actualContains(popper, actualTarget)) { 3561 return; 3562 } // Clicked on the event listeners target 3563 3564 3565 if (normalizeToArray(instance.props.triggerTarget || reference).some(function (el) { 3566 return actualContains(el, actualTarget); 3567 })) { 3568 if (currentInput.isTouch) { 3569 return; 3570 } 3571 3572 if (instance.state.isVisible && instance.props.trigger.indexOf('click') >= 0) { 3573 return; 3574 } 3575 } else { 3576 invokeHook('onClickOutside', [instance, event]); 3577 } 3578 3579 if (instance.props.hideOnClick === true) { 3580 instance.clearDelayTimeouts(); 3581 instance.hide(); // `mousedown` event is fired right before `focus` if pressing the 3582 // currentTarget. This lets a tippy with `focus` trigger know that it 3583 // should not show 3584 3585 didHideDueToDocumentMouseDown = true; 3586 setTimeout(function () { 3587 didHideDueToDocumentMouseDown = false; 3588 }); // The listener gets added in `scheduleShow()`, but this may be hiding it 3589 // before it shows, and hide()'s early bail-out behavior can prevent it 3590 // from being cleaned up 3591 3592 if (!instance.state.isMounted) { 3593 removeDocumentPress(); 3594 } 3595 } 3596 } 3597 3598 function onTouchMove() { 3599 didTouchMove = true; 3600 } 3601 3602 function onTouchStart() { 3603 didTouchMove = false; 3604 } 3605 3606 function addDocumentPress() { 3607 var doc = getDocument(); 3608 doc.addEventListener('mousedown', onDocumentPress, true); 3609 doc.addEventListener('touchend', onDocumentPress, TOUCH_OPTIONS); 3610 doc.addEventListener('touchstart', onTouchStart, TOUCH_OPTIONS); 3611 doc.addEventListener('touchmove', onTouchMove, TOUCH_OPTIONS); 3612 } 3613 3614 function removeDocumentPress() { 3615 var doc = getDocument(); 3616 doc.removeEventListener('mousedown', onDocumentPress, true); 3617 doc.removeEventListener('touchend', onDocumentPress, TOUCH_OPTIONS); 3618 doc.removeEventListener('touchstart', onTouchStart, TOUCH_OPTIONS); 3619 doc.removeEventListener('touchmove', onTouchMove, TOUCH_OPTIONS); 3620 } 3621 3622 function onTransitionedOut(duration, callback) { 3623 onTransitionEnd(duration, function () { 3624 if (!instance.state.isVisible && popper.parentNode && popper.parentNode.contains(popper)) { 3625 callback(); 3626 } 3627 }); 3628 } 3629 3630 function onTransitionedIn(duration, callback) { 3631 onTransitionEnd(duration, callback); 3632 } 3633 3634 function onTransitionEnd(duration, callback) { 3635 var box = getDefaultTemplateChildren().box; 3636 3637 function listener(event) { 3638 if (event.target === box) { 3639 updateTransitionEndListener(box, 'remove', listener); 3640 callback(); 3641 } 3642 } // Make callback synchronous if duration is 0 3643 // `transitionend` won't fire otherwise 3644 3645 3646 if (duration === 0) { 3647 return callback(); 3648 } 3649 3650 updateTransitionEndListener(box, 'remove', currentTransitionEndListener); 3651 updateTransitionEndListener(box, 'add', listener); 3652 currentTransitionEndListener = listener; 3653 } 3654 3655 function on(eventType, handler, options) { 3656 if (options === void 0) { 3657 options = false; 3658 } 3659 3660 var nodes = normalizeToArray(instance.props.triggerTarget || reference); 3661 nodes.forEach(function (node) { 3662 node.addEventListener(eventType, handler, options); 3663 listeners.push({ 3664 node: node, 3665 eventType: eventType, 3666 handler: handler, 3667 options: options 3668 }); 3669 }); 3670 } 3671 3672 function addListeners() { 3673 if (getIsCustomTouchBehavior()) { 3674 on('touchstart', onTrigger, { 3675 passive: true 3676 }); 3677 on('touchend', onMouseLeave, { 3678 passive: true 3679 }); 3680 } 3681 3682 splitBySpaces(instance.props.trigger).forEach(function (eventType) { 3683 if (eventType === 'manual') { 3684 return; 3685 } 3686 3687 on(eventType, onTrigger); 3688 3689 switch (eventType) { 3690 case 'mouseenter': 3691 on('mouseleave', onMouseLeave); 3692 break; 3693 3694 case 'focus': 3695 on(isIE11 ? 'focusout' : 'blur', onBlurOrFocusOut); 3696 break; 3697 3698 case 'focusin': 3699 on('focusout', onBlurOrFocusOut); 3700 break; 3701 } 3702 }); 3703 } 3704 3705 function removeListeners() { 3706 listeners.forEach(function (_ref) { 3707 var node = _ref.node, 3708 eventType = _ref.eventType, 3709 handler = _ref.handler, 3710 options = _ref.options; 3711 node.removeEventListener(eventType, handler, options); 3712 }); 3713 listeners = []; 3714 } 3715 3716 function onTrigger(event) { 3717 var _lastTriggerEvent; 3718 3719 var shouldScheduleClickHide = false; 3720 3721 if (!instance.state.isEnabled || isEventListenerStopped(event) || didHideDueToDocumentMouseDown) { 3722 return; 3723 } 3724 3725 var wasFocused = ((_lastTriggerEvent = lastTriggerEvent) == null ? void 0 : _lastTriggerEvent.type) === 'focus'; 3726 lastTriggerEvent = event; 3727 currentTarget = event.currentTarget; 3728 handleAriaExpandedAttribute(); 3729 3730 if (!instance.state.isVisible && isMouseEvent(event)) { 3731 // If scrolling, `mouseenter` events can be fired if the cursor lands 3732 // over a new target, but `mousemove` events don't get fired. This 3733 // causes interactive tooltips to get stuck open until the cursor is 3734 // moved 3735 mouseMoveListeners.forEach(function (listener) { 3736 return listener(event); 3737 }); 3738 } // Toggle show/hide when clicking click-triggered tooltips 3739 3740 3741 if (event.type === 'click' && (instance.props.trigger.indexOf('mouseenter') < 0 || isVisibleFromClick) && instance.props.hideOnClick !== false && instance.state.isVisible) { 3742 shouldScheduleClickHide = true; 3743 } else { 3744 scheduleShow(event); 3745 } 3746 3747 if (event.type === 'click') { 3748 isVisibleFromClick = !shouldScheduleClickHide; 3749 } 3750 3751 if (shouldScheduleClickHide && !wasFocused) { 3752 scheduleHide(event); 3753 } 3754 } 3755 3756 function onMouseMove(event) { 3757 var target = event.target; 3758 var isCursorOverReferenceOrPopper = getCurrentTarget().contains(target) || popper.contains(target); 3759 3760 if (event.type === 'mousemove' && isCursorOverReferenceOrPopper) { 3761 return; 3762 } 3763 3764 var popperTreeData = getNestedPopperTree().concat(popper).map(function (popper) { 3765 var _instance$popperInsta; 3766 3767 var instance = popper._tippy; 3768 var state = (_instance$popperInsta = instance.popperInstance) == null ? void 0 : _instance$popperInsta.state; 3769 3770 if (state) { 3771 return { 3772 popperRect: popper.getBoundingClientRect(), 3773 popperState: state, 3774 props: props 3775 }; 3776 } 3777 3778 return null; 3779 }).filter(Boolean); 3780 3781 if (isCursorOutsideInteractiveBorder(popperTreeData, event)) { 3782 cleanupInteractiveMouseListeners(); 3783 scheduleHide(event); 3784 } 3785 } 3786 3787 function onMouseLeave(event) { 3788 var shouldBail = isEventListenerStopped(event) || instance.props.trigger.indexOf('click') >= 0 && isVisibleFromClick; 3789 3790 if (shouldBail) { 3791 return; 3792 } 3793 3794 if (instance.props.interactive) { 3795 instance.hideWithInteractivity(event); 3796 return; 3797 } 3798 3799 scheduleHide(event); 3800 } 3801 3802 function onBlurOrFocusOut(event) { 3803 if (instance.props.trigger.indexOf('focusin') < 0 && event.target !== getCurrentTarget()) { 3804 return; 3805 } // If focus was moved to within the popper 3806 3807 3808 if (instance.props.interactive && event.relatedTarget && popper.contains(event.relatedTarget)) { 3809 return; 3810 } 3811 3812 scheduleHide(event); 3813 } 3814 3815 function isEventListenerStopped(event) { 3816 return currentInput.isTouch ? getIsCustomTouchBehavior() !== event.type.indexOf('touch') >= 0 : false; 3817 } 3818 3819 function createPopperInstance() { 3820 destroyPopperInstance(); 3821 var _instance$props2 = instance.props, 3822 popperOptions = _instance$props2.popperOptions, 3823 placement = _instance$props2.placement, 3824 offset = _instance$props2.offset, 3825 getReferenceClientRect = _instance$props2.getReferenceClientRect, 3826 moveTransition = _instance$props2.moveTransition; 3827 var arrow = getIsDefaultRenderFn() ? getChildren(popper).arrow : null; 3828 var computedReference = getReferenceClientRect ? { 3829 getBoundingClientRect: getReferenceClientRect, 3830 contextElement: getReferenceClientRect.contextElement || getCurrentTarget() 3831 } : reference; 3832 var tippyModifier = { 3833 name: '$$tippy', 3834 enabled: true, 3835 phase: 'beforeWrite', 3836 requires: ['computeStyles'], 3837 fn: function fn(_ref2) { 3838 var state = _ref2.state; 3839 3840 if (getIsDefaultRenderFn()) { 3841 var _getDefaultTemplateCh = getDefaultTemplateChildren(), 3842 box = _getDefaultTemplateCh.box; 3843 3844 ['placement', 'reference-hidden', 'escaped'].forEach(function (attr) { 3845 if (attr === 'placement') { 3846 box.setAttribute('data-placement', state.placement); 3847 } else { 3848 if (state.attributes.popper["data-popper-" + attr]) { 3849 box.setAttribute("data-" + attr, ''); 3850 } else { 3851 box.removeAttribute("data-" + attr); 3852 } 3853 } 3854 }); 3855 state.attributes.popper = {}; 3856 } 3857 } 3858 }; 3859 var modifiers = [{ 3860 name: 'offset', 3861 options: { 3862 offset: offset 3863 } 3864 }, { 3865 name: 'preventOverflow', 3866 options: { 3867 padding: { 3868 top: 2, 3869 bottom: 2, 3870 left: 5, 3871 right: 5 3872 } 3873 } 3874 }, { 3875 name: 'flip', 3876 options: { 3877 padding: 5 3878 } 3879 }, { 3880 name: 'computeStyles', 3881 options: { 3882 adaptive: !moveTransition 3883 } 3884 }, tippyModifier]; 3885 3886 if (getIsDefaultRenderFn() && arrow) { 3887 modifiers.push({ 3888 name: 'arrow', 3889 options: { 3890 element: arrow, 3891 padding: 3 3892 } 3893 }); 3894 } 3895 3896 modifiers.push.apply(modifiers, (popperOptions == null ? void 0 : popperOptions.modifiers) || []); 3897 instance.popperInstance =
vendor: 3,654 bytes, lines 3897-4016
3897popper_createPopper(computedReference, popper, Object.assign({}, popperOptions, { 3898 placement: placement, 3899 onFirstUpdate: onFirstUpdate, 3900 modifiers: modifiers 3901 })); 3902 } 3903 3904 function destroyPopperInstance() { 3905 if (instance.popperInstance) { 3906 instance.popperInstance.destroy(); 3907 instance.popperInstance = null; 3908 } 3909 } 3910 3911 function mount() { 3912 var appendTo = instance.props.appendTo; 3913 var parentNode; // By default, we'll append the popper to the triggerTargets's parentNode so 3914 // it's directly after the reference element so the elements inside the 3915 // tippy can be tabbed to 3916 // If there are clipping issues, the user can specify a different appendTo 3917 // and ensure focus management is handled correctly manually 3918 3919 var node = getCurrentTarget(); 3920 3921 if (instance.props.interactive && appendTo === TIPPY_DEFAULT_APPEND_TO || appendTo === 'parent') { 3922 parentNode = node.parentNode; 3923 } else { 3924 parentNode = invokeWithArgsOrReturn(appendTo, [node]); 3925 } // The popper element needs to exist on the DOM before its position can be 3926 // updated as Popper needs to read its dimensions 3927 3928 3929 if (!parentNode.contains(popper)) { 3930 parentNode.appendChild(popper); 3931 } 3932 3933 instance.state.isMounted = true; 3934 createPopperInstance(); 3935 /* istanbul ignore else */ 3936 3937 if (false) {} 3938 } 3939 3940 function getNestedPopperTree() { 3941 return arrayFrom(popper.querySelectorAll('[data-tippy-root]')); 3942 } 3943 3944 function scheduleShow(event) { 3945 instance.clearDelayTimeouts(); 3946 3947 if (event) { 3948 invokeHook('onTrigger', [instance, event]); 3949 } 3950 3951 addDocumentPress(); 3952 var delay = getDelay(true); 3953 3954 var _getNormalizedTouchSe = getNormalizedTouchSettings(), 3955 touchValue = _getNormalizedTouchSe[0], 3956 touchDelay = _getNormalizedTouchSe[1]; 3957 3958 if (currentInput.isTouch && touchValue === 'hold' && touchDelay) { 3959 delay = touchDelay; 3960 } 3961 3962 if (delay) { 3963 showTimeout = setTimeout(function () { 3964 instance.show(); 3965 }, delay); 3966 } else { 3967 instance.show(); 3968 } 3969 } 3970 3971 function scheduleHide(event) { 3972 instance.clearDelayTimeouts(); 3973 invokeHook('onUntrigger', [instance, event]); 3974 3975 if (!instance.state.isVisible) { 3976 removeDocumentPress(); 3977 return; 3978 } // For interactive tippies, scheduleHide is added to a document.body handler 3979 // from onMouseLeave so must intercept scheduled hides from mousemove/leave 3980 // events when trigger contains mouseenter and click, and the tip is 3981 // currently shown as a result of a click. 3982 3983 3984 if (instance.props.trigger.indexOf('mouseenter') >= 0 && instance.props.trigger.indexOf('click') >= 0 && ['mouseleave', 'mousemove'].indexOf(event.type) >= 0 && isVisibleFromClick) { 3985 return; 3986 } 3987 3988 var delay = getDelay(false); 3989 3990 if (delay) { 3991 hideTimeout = setTimeout(function () { 3992 if (instance.state.isVisible) { 3993 instance.hide(); 3994 } 3995 }, delay); 3996 } else { 3997 // Fixes a `transitionend` problem when it fires 1 frame too 3998 // late sometimes, we don't want hide() to be called. 3999 scheduleHideAnimationFrame = requestAnimationFrame(function () { 4000 instance.hide(); 4001 }); 4002 } 4003 } // =========================================================================== 4004 // ð Public methods 4005 // =========================================================================== 4006 4007 4008 function enable() { 4009 instance.state.isEnabled = true; 4010 } 4011 4012 function disable() { 4013 // Disabling the instance should also hide it 4014 // https://github.com/atomiks/tippy.js-react/issues/106 4015 instance.hide(); 4016 instance.state.isEnabled = false;
vendor: 1,565 bytes, lines 4017-4066
4017 } 4018 4019 function clearDelayTimeouts() { 4020 clearTimeout(showTimeout); 4021 clearTimeout(hideTimeout); 4022 cancelAnimationFrame(scheduleHideAnimationFrame); 4023 } 4024 4025 function setProps(partialProps) { 4026 /* istanbul ignore else */ 4027 if (false) {} 4028 4029 if (instance.state.isDestroyed) { 4030 return; 4031 } 4032 4033 invokeHook('onBeforeUpdate', [instance, partialProps]); 4034 removeListeners(); 4035 var prevProps = instance.props; 4036 var nextProps = evaluateProps(reference, Object.assign({}, prevProps, removeUndefinedProps(partialProps), { 4037 ignoreAttributes: true 4038 })); 4039 instance.props = nextProps; 4040 addListeners(); 4041 4042 if (prevProps.interactiveDebounce !== nextProps.interactiveDebounce) { 4043 cleanupInteractiveMouseListeners(); 4044 debouncedOnMouseMove = tippy_esm_debounce(onMouseMove, nextProps.interactiveDebounce); 4045 } // Ensure stale aria-expanded attributes are removed 4046 4047 4048 if (prevProps.triggerTarget && !nextProps.triggerTarget) { 4049 normalizeToArray(prevProps.triggerTarget).forEach(function (node) { 4050 node.removeAttribute('aria-expanded'); 4051 }); 4052 } else if (nextProps.triggerTarget) { 4053 reference.removeAttribute('aria-expanded'); 4054 } 4055 4056 handleAriaExpandedAttribute(); 4057 handleStyles(); 4058 4059 if (onUpdate) { 4060 onUpdate(prevProps, nextProps); 4061 } 4062 4063 if (instance.popperInstance) { 4064 createPopperInstance(); // Fixes an issue with nested tippies if they are all getting re-rendered, 4065 // and the nested ones get re-rendered first. 4066 // https://github.com/atomiks/tippyjs-react/issues/177
vendor: 5,494 bytes, lines 4067-4256
4067 // TODO: find a cleaner / more efficient solution(!) 4068 4069 getNestedPopperTree().forEach(function (nestedPopper) { 4070 // React (and other UI libs likely) requires a rAF wrapper as it flushes 4071 // its work in one 4072 requestAnimationFrame(nestedPopper._tippy.popperInstance.forceUpdate); 4073 }); 4074 } 4075 4076 invokeHook('onAfterUpdate', [instance, partialProps]); 4077 } 4078 4079 function setContent(content) { 4080 instance.setProps({ 4081 content: content 4082 }); 4083 } 4084 4085 function show() { 4086 /* istanbul ignore else */ 4087 if (false) {} // Early bail-out 4088 4089 4090 var isAlreadyVisible = instance.state.isVisible; 4091 var isDestroyed = instance.state.isDestroyed; 4092 var isDisabled = !instance.state.isEnabled; 4093 var isTouchAndTouchDisabled = currentInput.isTouch && !instance.props.touch; 4094 var duration = getValueAtIndexOrReturn(instance.props.duration, 0, defaultProps.duration); 4095 4096 if (isAlreadyVisible || isDestroyed || isDisabled || isTouchAndTouchDisabled) { 4097 return; 4098 } // Normalize `disabled` behavior across browsers. 4099 // Firefox allows events on disabled elements, but Chrome doesn't. 4100 // Using a wrapper element (i.e. <span>) is recommended. 4101 4102 4103 if (getCurrentTarget().hasAttribute('disabled')) { 4104 return; 4105 } 4106 4107 invokeHook('onShow', [instance], false); 4108 4109 if (instance.props.onShow(instance) === false) { 4110 return; 4111 } 4112 4113 instance.state.isVisible = true; 4114 4115 if (getIsDefaultRenderFn()) { 4116 popper.style.visibility = 'visible'; 4117 } 4118 4119 handleStyles(); 4120 addDocumentPress(); 4121 4122 if (!instance.state.isMounted) { 4123 popper.style.transition = 'none'; 4124 } // If flipping to the opposite side after hiding at least once, the 4125 // animation will use the wrong placement without resetting the duration 4126 4127 4128 if (getIsDefaultRenderFn()) { 4129 var _getDefaultTemplateCh2 = getDefaultTemplateChildren(), 4130 box = _getDefaultTemplateCh2.box, 4131 content = _getDefaultTemplateCh2.content; 4132 4133 setTransitionDuration([box, content], 0); 4134 } 4135 4136 onFirstUpdate = function onFirstUpdate() { 4137 var _instance$popperInsta2; 4138 4139 if (!instance.state.isVisible || ignoreOnFirstUpdate) { 4140 return; 4141 } 4142 4143 ignoreOnFirstUpdate = true; // reflow 4144 4145 void popper.offsetHeight; 4146 popper.style.transition = instance.props.moveTransition; 4147 4148 if (getIsDefaultRenderFn() && instance.props.animation) { 4149 var _getDefaultTemplateCh3 = getDefaultTemplateChildren(), 4150 _box = _getDefaultTemplateCh3.box, 4151 _content = _getDefaultTemplateCh3.content; 4152 4153 setTransitionDuration([_box, _content], duration); 4154 setVisibilityState([_box, _content], 'visible'); 4155 } 4156 4157 handleAriaContentAttribute(); 4158 handleAriaExpandedAttribute(); 4159 pushIfUnique(mountedInstances, instance); // certain modifiers (e.g. `maxSize`) require a second update after the 4160 // popper has been positioned for the first time 4161 4162 (_instance$popperInsta2 = instance.popperInstance) == null ? void 0 : _instance$popperInsta2.forceUpdate(); 4163 invokeHook('onMount', [instance]); 4164 4165 if (instance.props.animation && getIsDefaultRenderFn()) { 4166 onTransitionedIn(duration, function () { 4167 instance.state.isShown = true; 4168 invokeHook('onShown', [instance]); 4169 }); 4170 } 4171 }; 4172 4173 mount(); 4174 } 4175 4176 function hide() { 4177 /* istanbul ignore else */ 4178 if (false) {} // Early bail-out 4179 4180 4181 var isAlreadyHidden = !instance.state.isVisible; 4182 var isDestroyed = instance.state.isDestroyed; 4183 var isDisabled = !instance.state.isEnabled; 4184 var duration = getValueAtIndexOrReturn(instance.props.duration, 1, defaultProps.duration); 4185 4186 if (isAlreadyHidden || isDestroyed || isDisabled) { 4187 return; 4188 } 4189 4190 invokeHook('onHide', [instance], false); 4191 4192 if (instance.props.onHide(instance) === false) { 4193 return; 4194 } 4195 4196 instance.state.isVisible = false; 4197 instance.state.isShown = false; 4198 ignoreOnFirstUpdate = false; 4199 isVisibleFromClick = false; 4200 4201 if (getIsDefaultRenderFn()) { 4202 popper.style.visibility = 'hidden'; 4203 } 4204 4205 cleanupInteractiveMouseListeners(); 4206 removeDocumentPress(); 4207 handleStyles(true); 4208 4209 if (getIsDefaultRenderFn()) { 4210 var _getDefaultTemplateCh4 = getDefaultTemplateChildren(), 4211 box = _getDefaultTemplateCh4.box, 4212 content = _getDefaultTemplateCh4.content; 4213 4214 if (instance.props.animation) { 4215 setTransitionDuration([box, content], duration); 4216 setVisibilityState([box, content], 'hidden'); 4217 } 4218 } 4219 4220 handleAriaContentAttribute(); 4221 handleAriaExpandedAttribute(); 4222 4223 if (instance.props.animation) { 4224 if (getIsDefaultRenderFn()) { 4225 onTransitionedOut(duration, instance.unmount); 4226 } 4227 } else { 4228 instance.unmount(); 4229 } 4230 } 4231 4232 function hideWithInteractivity(event) { 4233 /* istanbul ignore else */ 4234 if (false) {} 4235 4236 getDocument().addEventListener('mousemove', debouncedOnMouseMove); 4237 pushIfUnique(mouseMoveListeners, debouncedOnMouseMove); 4238 debouncedOnMouseMove(event); 4239 } 4240 4241 function unmount() { 4242 /* istanbul ignore else */ 4243 if (false) {} 4244 4245 if (instance.state.isVisible) { 4246 instance.hide(); 4247 } 4248 4249 if (!instance.state.isMounted) { 4250 return; 4251 } 4252 4253 destroyPopperInstance(); // If a popper is not interactive, it will be appended outside the popper 4254 // tree by default. This seems mainly for interactive tippies, but we should 4255 // find a workaround if possible 4256
vendor: 4,142 bytes, lines 4257-4413
4257 getNestedPopperTree().forEach(function (nestedPopper) { 4258 nestedPopper._tippy.unmount(); 4259 }); 4260 4261 if (popper.parentNode) { 4262 popper.parentNode.removeChild(popper); 4263 } 4264 4265 mountedInstances = mountedInstances.filter(function (i) { 4266 return i !== instance; 4267 }); 4268 instance.state.isMounted = false; 4269 invokeHook('onHidden', [instance]); 4270 } 4271 4272 function destroy() { 4273 /* istanbul ignore else */ 4274 if (false) {} 4275 4276 if (instance.state.isDestroyed) { 4277 return; 4278 } 4279 4280 instance.clearDelayTimeouts(); 4281 instance.unmount(); 4282 removeListeners(); 4283 delete reference._tippy; 4284 instance.state.isDestroyed = true; 4285 invokeHook('onDestroy', [instance]); 4286 } 4287} 4288 4289function tippy(targets, optionalProps) { 4290 if (optionalProps === void 0) { 4291 optionalProps = {}; 4292 } 4293 4294 var plugins = defaultProps.plugins.concat(optionalProps.plugins || []); 4295 /* istanbul ignore else */ 4296 4297 if (false) {} 4298 4299 bindGlobalEventListeners(); 4300 var passedProps = Object.assign({}, optionalProps, { 4301 plugins: plugins 4302 }); 4303 var elements = getArrayOfElements(targets); 4304 /* istanbul ignore else */ 4305 4306 if (false) { var isMoreThanOneReferenceElement, isSingleContentElement; } 4307 4308 var instances = elements.reduce(function (acc, reference) { 4309 var instance = reference && createTippy(reference, passedProps); 4310 4311 if (instance) { 4312 acc.push(instance); 4313 } 4314 4315 return acc; 4316 }, []); 4317 return tippy_esm_isElement(targets) ? instances[0] : instances; 4318} 4319 4320tippy.defaultProps = defaultProps; 4321tippy.setDefaultProps = setDefaultProps; 4322tippy.currentInput = currentInput; 4323var hideAll = function hideAll(_temp) { 4324 var _ref = _temp === void 0 ? {} : _temp, 4325 excludedReferenceOrInstance = _ref.exclude, 4326 duration = _ref.duration; 4327 4328 mountedInstances.forEach(function (instance) { 4329 var isExcluded = false; 4330 4331 if (excludedReferenceOrInstance) { 4332 isExcluded = isReferenceElement(excludedReferenceOrInstance) ? instance.reference === excludedReferenceOrInstance : instance.popper === excludedReferenceOrInstance.popper; 4333 } 4334 4335 if (!isExcluded) { 4336 var originalDuration = instance.props.duration; 4337 instance.setProps({ 4338 duration: duration 4339 }); 4340 instance.hide(); 4341 4342 if (!instance.state.isDestroyed) { 4343 instance.setProps({ 4344 duration: originalDuration 4345 }); 4346 } 4347 } 4348 }); 4349}; 4350 4351// every time the popper is destroyed (i.e. a new target), removing the styles 4352// and causing transitions to break for singletons when the console is open, but 4353// most notably for non-transform styles being used, `gpuAcceleration: false`. 4354 4355var applyStylesModifier = Object.assign({}, modifiers_applyStyles, { 4356 effect: function effect(_ref) { 4357 var state = _ref.state; 4358 var initialStyles = { 4359 popper: { 4360 position: state.options.strategy, 4361 left: '0', 4362 top: '0', 4363 margin: '0' 4364 }, 4365 arrow: { 4366 position: 'absolute' 4367 }, 4368 reference: {} 4369 }; 4370 Object.assign(state.elements.popper.style, initialStyles.popper); 4371 state.styles = initialStyles; 4372 4373 if (state.elements.arrow) { 4374 Object.assign(state.elements.arrow.style, initialStyles.arrow); 4375 } // intentionally return no cleanup function 4376 // return () => { ... } 4377 4378 } 4379}); 4380 4381var createSingleton = function createSingleton(tippyInstances, optionalProps) { 4382 var _optionalProps$popper; 4383 4384 if (optionalProps === void 0) { 4385 optionalProps = {}; 4386 } 4387 4388 /* istanbul ignore else */ 4389 if (false) {} 4390 4391 var individualInstances = tippyInstances; 4392 var references = []; 4393 var triggerTargets = []; 4394 var currentTarget; 4395 var overrides = optionalProps.overrides; 4396 var interceptSetPropsCleanups = []; 4397 var shownOnCreate = false; 4398 4399 function setTriggerTargets() { 4400 triggerTargets = individualInstances.map(function (instance) { 4401 return normalizeToArray(instance.props.triggerTarget || instance.reference); 4402 }).reduce(function (acc, item) { 4403 return acc.concat(item); 4404 }, []); 4405 } 4406 4407 function setReferences() { 4408 references = individualInstances.map(function (instance) { 4409 return instance.reference; 4410 }); 4411 } 4412 4413 function enableInstances(isEnabled) {
vendor: 4,960 bytes, lines 4414-4582
4414 individualInstances.forEach(function (instance) { 4415 if (isEnabled) { 4416 instance.enable(); 4417 } else { 4418 instance.disable(); 4419 } 4420 }); 4421 } 4422 4423 function interceptSetProps(singleton) { 4424 return individualInstances.map(function (instance) { 4425 var originalSetProps = instance.setProps; 4426 4427 instance.setProps = function (props) { 4428 originalSetProps(props); 4429 4430 if (instance.reference === currentTarget) { 4431 singleton.setProps(props); 4432 } 4433 }; 4434 4435 return function () { 4436 instance.setProps = originalSetProps; 4437 }; 4438 }); 4439 } // have to pass singleton, as it maybe undefined on first call 4440 4441 4442 function prepareInstance(singleton, target) { 4443 var index = triggerTargets.indexOf(target); // bail-out 4444 4445 if (target === currentTarget) { 4446 return; 4447 } 4448 4449 currentTarget = target; 4450 var overrideProps = (overrides || []).concat('content').reduce(function (acc, prop) { 4451 acc[prop] = individualInstances[index].props[prop]; 4452 return acc; 4453 }, {}); 4454 singleton.setProps(Object.assign({}, overrideProps, { 4455 getReferenceClientRect: typeof overrideProps.getReferenceClientRect === 'function' ? overrideProps.getReferenceClientRect : function () { 4456 var _references$index; 4457 4458 return (_references$index = references[index]) == null ? void 0 : _references$index.getBoundingClientRect(); 4459 } 4460 })); 4461 } 4462 4463 enableInstances(false); 4464 setReferences(); 4465 setTriggerTargets(); 4466 var plugin = { 4467 fn: function fn() { 4468 return { 4469 onDestroy: function onDestroy() { 4470 enableInstances(true); 4471 }, 4472 onHidden: function onHidden() { 4473 currentTarget = null; 4474 }, 4475 onClickOutside: function onClickOutside(instance) { 4476 if (instance.props.showOnCreate && !shownOnCreate) { 4477 shownOnCreate = true; 4478 currentTarget = null; 4479 } 4480 }, 4481 onShow: function onShow(instance) { 4482 if (instance.props.showOnCreate && !shownOnCreate) { 4483 shownOnCreate = true; 4484 prepareInstance(instance, references[0]); 4485 } 4486 }, 4487 onTrigger: function onTrigger(instance, event) { 4488 prepareInstance(instance, event.currentTarget); 4489 } 4490 }; 4491 } 4492 }; 4493 var singleton = tippy(div(), Object.assign({}, removeProperties(optionalProps, ['overrides']), { 4494 plugins: [plugin].concat(optionalProps.plugins || []), 4495 triggerTarget: triggerTargets, 4496 popperOptions: Object.assign({}, optionalProps.popperOptions, { 4497 modifiers: [].concat(((_optionalProps$popper = optionalProps.popperOptions) == null ? void 0 : _optionalProps$popper.modifiers) || [], [applyStylesModifier]) 4498 }) 4499 })); 4500 var originalShow = singleton.show; 4501 4502 singleton.show = function (target) { 4503 originalShow(); // first time, showOnCreate or programmatic call with no params 4504 // default to showing first instance 4505 4506 if (!currentTarget && target == null) { 4507 return prepareInstance(singleton, references[0]); 4508 } // triggered from event (do nothing as prepareInstance already called by onTrigger) 4509 // programmatic call with no params when already visible (do nothing again) 4510 4511 4512 if (currentTarget && target == null) { 4513 return; 4514 } // target is index of instance 4515 4516 4517 if (typeof target === 'number') { 4518 return references[target] && prepareInstance(singleton, references[target]); 4519 } // target is a child tippy instance 4520 4521 4522 if (individualInstances.indexOf(target) >= 0) { 4523 var ref = target.reference; 4524 return prepareInstance(singleton, ref); 4525 } // target is a ReferenceElement 4526 4527 4528 if (references.indexOf(target) >= 0) { 4529 return prepareInstance(singleton, target); 4530 } 4531 }; 4532 4533 singleton.showNext = function () { 4534 var first = references[0]; 4535 4536 if (!currentTarget) { 4537 return singleton.show(0); 4538 } 4539 4540 var index = references.indexOf(currentTarget); 4541 singleton.show(references[index + 1] || first); 4542 }; 4543 4544 singleton.showPrevious = function () { 4545 var last = references[references.length - 1]; 4546 4547 if (!currentTarget) { 4548 return singleton.show(last); 4549 } 4550 4551 var index = references.indexOf(currentTarget); 4552 var target = references[index - 1] || last; 4553 singleton.show(target); 4554 }; 4555 4556 var originalSetProps = singleton.setProps; 4557 4558 singleton.setProps = function (props) { 4559 overrides = props.overrides || overrides; 4560 originalSetProps(props); 4561 }; 4562 4563 singleton.setInstances = function (nextInstances) { 4564 enableInstances(true); 4565 interceptSetPropsCleanups.forEach(function (fn) { 4566 return fn(); 4567 }); 4568 individualInstances = nextInstances; 4569 enableInstances(false); 4570 setReferences(); 4571 setTriggerTargets(); 4572 interceptSetPropsCleanups = interceptSetProps(singleton); 4573 singleton.setProps({ 4574 triggerTarget: triggerTargets 4575 }); 4576 }; 4577 4578 interceptSetPropsCleanups = interceptSetProps(singleton); 4579 return singleton; 4580}; 4581 4582var BUBBLING_EVENTS_MAP = {
vendor: 3,908 bytes, lines 4583-4734
4583 mouseover: 'mouseenter', 4584 focusin: 'focus', 4585 click: 'click' 4586}; 4587/** 4588 * Creates a delegate instance that controls the creation of tippy instances 4589 * for child elements (`target` CSS selector). 4590 */ 4591 4592function delegate(targets, props) { 4593 /* istanbul ignore else */ 4594 if (false) {} 4595 4596 var listeners = []; 4597 var childTippyInstances = []; 4598 var disabled = false; 4599 var target = props.target; 4600 var nativeProps = removeProperties(props, ['target']); 4601 var parentProps = Object.assign({}, nativeProps, { 4602 trigger: 'manual', 4603 touch: false 4604 }); 4605 var childProps = Object.assign({ 4606 touch: defaultProps.touch 4607 }, nativeProps, { 4608 showOnCreate: true 4609 }); 4610 var returnValue = tippy(targets, parentProps); 4611 var normalizedReturnValue = normalizeToArray(returnValue); 4612 4613 function onTrigger(event) { 4614 if (!event.target || disabled) { 4615 return; 4616 } 4617 4618 var targetNode = event.target.closest(target); 4619 4620 if (!targetNode) { 4621 return; 4622 } // Get relevant trigger with fallbacks: 4623 // 1. Check `data-tippy-trigger` attribute on target node 4624 // 2. Fallback to `trigger` passed to `delegate()` 4625 // 3. Fallback to `defaultProps.trigger` 4626 4627 4628 var trigger = targetNode.getAttribute('data-tippy-trigger') || props.trigger || defaultProps.trigger; // @ts-ignore 4629 4630 if (targetNode._tippy) { 4631 return; 4632 } 4633 4634 if (event.type === 'touchstart' && typeof childProps.touch === 'boolean') { 4635 return; 4636 } 4637 4638 if (event.type !== 'touchstart' && trigger.indexOf(BUBBLING_EVENTS_MAP[event.type]) < 0) { 4639 return; 4640 } 4641 4642 var instance = tippy(targetNode, childProps); 4643 4644 if (instance) { 4645 childTippyInstances = childTippyInstances.concat(instance); 4646 } 4647 } 4648 4649 function on(node, eventType, handler, options) { 4650 if (options === void 0) { 4651 options = false; 4652 } 4653 4654 node.addEventListener(eventType, handler, options); 4655 listeners.push({ 4656 node: node, 4657 eventType: eventType, 4658 handler: handler, 4659 options: options 4660 }); 4661 } 4662 4663 function addEventListeners(instance) { 4664 var reference = instance.reference; 4665 on(reference, 'touchstart', onTrigger, TOUCH_OPTIONS); 4666 on(reference, 'mouseover', onTrigger); 4667 on(reference, 'focusin', onTrigger); 4668 on(reference, 'click', onTrigger); 4669 } 4670 4671 function removeEventListeners() { 4672 listeners.forEach(function (_ref) { 4673 var node = _ref.node, 4674 eventType = _ref.eventType, 4675 handler = _ref.handler, 4676 options = _ref.options; 4677 node.removeEventListener(eventType, handler, options); 4678 }); 4679 listeners = []; 4680 } 4681 4682 function applyMutations(instance) { 4683 var originalDestroy = instance.destroy; 4684 var originalEnable = instance.enable; 4685 var originalDisable = instance.disable; 4686 4687 instance.destroy = function (shouldDestroyChildInstances) { 4688 if (shouldDestroyChildInstances === void 0) { 4689 shouldDestroyChildInstances = true; 4690 } 4691 4692 if (shouldDestroyChildInstances) { 4693 childTippyInstances.forEach(function (instance) { 4694 instance.destroy(); 4695 }); 4696 } 4697 4698 childTippyInstances = []; 4699 removeEventListeners(); 4700 originalDestroy(); 4701 }; 4702 4703 instance.enable = function () { 4704 originalEnable(); 4705 childTippyInstances.forEach(function (instance) { 4706 return instance.enable(); 4707 }); 4708 disabled = false; 4709 }; 4710 4711 instance.disable = function () { 4712 originalDisable(); 4713 childTippyInstances.forEach(function (instance) { 4714 return instance.disable(); 4715 }); 4716 disabled = true; 4717 }; 4718 4719 addEventListeners(instance); 4720 } 4721 4722 normalizedReturnValue.forEach(applyMutations); 4723 return returnValue; 4724} 4725 4726var animateFill = { 4727 name: 'animateFill', 4728 defaultValue: false, 4729 fn: function fn(instance) { 4730 var _instance$props$rende; 4731 4732 // @ts-ignore 4733 if (!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy)) { 4734 if (false) {}
vendor: 8,113 bytes, lines 4734-5022
4734 4735 4736 return {}; 4737 } 4738 4739 var _getChildren = getChildren(instance.popper), 4740 box = _getChildren.box, 4741 content = _getChildren.content; 4742 4743 var backdrop = instance.props.animateFill ? createBackdropElement() : null; 4744 return { 4745 onCreate: function onCreate() { 4746 if (backdrop) { 4747 box.insertBefore(backdrop, box.firstElementChild); 4748 box.setAttribute('data-animatefill', ''); 4749 box.style.overflow = 'hidden'; 4750 instance.setProps({ 4751 arrow: false, 4752 animation: 'shift-away' 4753 }); 4754 } 4755 }, 4756 onMount: function onMount() { 4757 if (backdrop) { 4758 var transitionDuration = box.style.transitionDuration; 4759 var duration = Number(transitionDuration.replace('ms', '')); // The content should fade in after the backdrop has mostly filled the 4760 // tooltip element. `clip-path` is the other alternative but is not 4761 // well-supported and is buggy on some devices. 4762 4763 content.style.transitionDelay = Math.round(duration / 10) + "ms"; 4764 backdrop.style.transitionDuration = transitionDuration; 4765 setVisibilityState([backdrop], 'visible'); 4766 } 4767 }, 4768 onShow: function onShow() { 4769 if (backdrop) { 4770 backdrop.style.transitionDuration = '0ms'; 4771 } 4772 }, 4773 onHide: function onHide() { 4774 if (backdrop) { 4775 setVisibilityState([backdrop], 'hidden'); 4776 } 4777 } 4778 }; 4779 } 4780}; 4781 4782function createBackdropElement() { 4783 var backdrop = div(); 4784 backdrop.className = BACKDROP_CLASS; 4785 setVisibilityState([backdrop], 'hidden'); 4786 return backdrop; 4787} 4788 4789var mouseCoords = { 4790 clientX: 0, 4791 clientY: 0 4792}; 4793var activeInstances = []; 4794 4795function storeMouseCoords(_ref) { 4796 var clientX = _ref.clientX, 4797 clientY = _ref.clientY; 4798 mouseCoords = { 4799 clientX: clientX, 4800 clientY: clientY 4801 }; 4802} 4803 4804function addMouseCoordsListener(doc) { 4805 doc.addEventListener('mousemove', storeMouseCoords); 4806} 4807 4808function removeMouseCoordsListener(doc) { 4809 doc.removeEventListener('mousemove', storeMouseCoords); 4810} 4811 4812var followCursor = { 4813 name: 'followCursor', 4814 defaultValue: false, 4815 fn: function fn(instance) { 4816 var reference = instance.reference; 4817 var doc = getOwnerDocument(instance.props.triggerTarget || reference); 4818 var isInternalUpdate = false; 4819 var wasFocusEvent = false; 4820 var isUnmounted = true; 4821 var prevProps = instance.props; 4822 4823 function getIsInitialBehavior() { 4824 return instance.props.followCursor === 'initial' && instance.state.isVisible; 4825 } 4826 4827 function addListener() { 4828 doc.addEventListener('mousemove', onMouseMove); 4829 } 4830 4831 function removeListener() { 4832 doc.removeEventListener('mousemove', onMouseMove); 4833 } 4834 4835 function unsetGetReferenceClientRect() { 4836 isInternalUpdate = true; 4837 instance.setProps({ 4838 getReferenceClientRect: null 4839 }); 4840 isInternalUpdate = false; 4841 } 4842 4843 function onMouseMove(event) { 4844 // If the instance is interactive, avoid updating the position unless it's 4845 // over the reference element 4846 var isCursorOverReference = event.target ? reference.contains(event.target) : true; 4847 var followCursor = instance.props.followCursor; 4848 var clientX = event.clientX, 4849 clientY = event.clientY; 4850 var rect = reference.getBoundingClientRect(); 4851 var relativeX = clientX - rect.left; 4852 var relativeY = clientY - rect.top; 4853 4854 if (isCursorOverReference || !instance.props.interactive) { 4855 instance.setProps({ 4856 // @ts-ignore - unneeded DOMRect properties 4857 getReferenceClientRect: function getReferenceClientRect() { 4858 var rect = reference.getBoundingClientRect(); 4859 var x = clientX; 4860 var y = clientY; 4861 4862 if (followCursor === 'initial') { 4863 x = rect.left + relativeX; 4864 y = rect.top + relativeY; 4865 } 4866 4867 var top = followCursor === 'horizontal' ? rect.top : y; 4868 var right = followCursor === 'vertical' ? rect.right : x; 4869 var bottom = followCursor === 'horizontal' ? rect.bottom : y; 4870 var left = followCursor === 'vertical' ? rect.left : x; 4871 return { 4872 width: right - left, 4873 height: bottom - top, 4874 top: top, 4875 right: right, 4876 bottom: bottom, 4877 left: left 4878 }; 4879 } 4880 }); 4881 } 4882 } 4883 4884 function create() { 4885 if (instance.props.followCursor) { 4886 activeInstances.push({ 4887 instance: instance, 4888 doc: doc 4889 }); 4890 addMouseCoordsListener(doc); 4891 } 4892 } 4893 4894 function destroy() { 4895 activeInstances = activeInstances.filter(function (data) { 4896 return data.instance !== instance; 4897 }); 4898 4899 if (activeInstances.filter(function (data) { 4900 return data.doc === doc; 4901 }).length === 0) { 4902 removeMouseCoordsListener(doc); 4903 } 4904 } 4905 4906 return { 4907 onCreate: create, 4908 onDestroy: destroy, 4909 onBeforeUpdate: function onBeforeUpdate() { 4910 prevProps = instance.props; 4911 }, 4912 onAfterUpdate: function onAfterUpdate(_, _ref2) { 4913 var followCursor = _ref2.followCursor; 4914 4915 if (isInternalUpdate) { 4916 return; 4917 } 4918 4919 if (followCursor !== undefined && prevProps.followCursor !== followCursor) { 4920 destroy(); 4921 4922 if (followCursor) { 4923 create(); 4924 4925 if (instance.state.isMounted && !wasFocusEvent && !getIsInitialBehavior()) { 4926 addListener(); 4927 } 4928 } else { 4929 removeListener(); 4930 unsetGetReferenceClientRect(); 4931 } 4932 } 4933 }, 4934 onMount: function onMount() { 4935 if (instance.props.followCursor && !wasFocusEvent) { 4936 if (isUnmounted) { 4937 onMouseMove(mouseCoords); 4938 isUnmounted = false; 4939 } 4940 4941 if (!getIsInitialBehavior()) { 4942 addListener(); 4943 } 4944 } 4945 }, 4946 onTrigger: function onTrigger(_, event) { 4947 if (isMouseEvent(event)) { 4948 mouseCoords = { 4949 clientX: event.clientX, 4950 clientY: event.clientY 4951 }; 4952 } 4953 4954 wasFocusEvent = event.type === 'focus'; 4955 }, 4956 onHidden: function onHidden() { 4957 if (instance.props.followCursor) { 4958 unsetGetReferenceClientRect(); 4959 removeListener(); 4960 isUnmounted = true; 4961 } 4962 } 4963 }; 4964 } 4965}; 4966 4967function getProps(props, modifier) { 4968 var _props$popperOptions; 4969 4970 return { 4971 popperOptions: Object.assign({}, props.popperOptions, { 4972 modifiers: [].concat((((_props$popperOptions = props.popperOptions) == null ? void 0 : _props$popperOptions.modifiers) || []).filter(function (_ref) { 4973 var name = _ref.name; 4974 return name !== modifier.name; 4975 }), [modifier]) 4976 }) 4977 }; 4978} 4979 4980var inlinePositioning = { 4981 name: 'inlinePositioning', 4982 defaultValue: false, 4983 fn: function fn(instance) { 4984 var reference = instance.reference; 4985 4986 function isEnabled() { 4987 return !!instance.props.inlinePositioning; 4988 } 4989 4990 var placement; 4991 var cursorRectIndex = -1; 4992 var isInternalUpdate = false; 4993 var triedPlacements = []; 4994 var modifier = { 4995 name: 'tippyInlinePositioning', 4996 enabled: true, 4997 phase: 'afterWrite', 4998 fn: function fn(_ref2) { 4999 var state = _ref2.state; 5000 5001 if (isEnabled()) { 5002 if (triedPlacements.indexOf(state.placement) !== -1) { 5003 triedPlacements = []; 5004 } 5005 5006 if (placement !== state.placement && triedPlacements.indexOf(state.placement) === -1) { 5007 triedPlacements.push(state.placement); 5008 instance.setProps({ 5009 // @ts-ignore - unneeded DOMRect properties 5010 getReferenceClientRect: function getReferenceClientRect() { 5011 return _getReferenceClientRect(state.placement); 5012 } 5013 }); 5014 } 5015 5016 placement = state.placement; 5017 } 5018 } 5019 }; 5020 5021 function _getReferenceClientRect(placement) { 5022 return getInlineBoundingClientRect(
vendor: 4,089 bytes, lines 5022-5151
5022tippy_esm_getBasePlacement(placement), reference.getBoundingClientRect(), arrayFrom(reference.getClientRects()), cursorRectIndex); 5023 } 5024 5025 function setInternalProps(partialProps) { 5026 isInternalUpdate = true; 5027 instance.setProps(partialProps); 5028 isInternalUpdate = false; 5029 } 5030 5031 function addModifier() { 5032 if (!isInternalUpdate) { 5033 setInternalProps(getProps(instance.props, modifier)); 5034 } 5035 } 5036 5037 return { 5038 onCreate: addModifier, 5039 onAfterUpdate: addModifier, 5040 onTrigger: function onTrigger(_, event) { 5041 if (isMouseEvent(event)) { 5042 var rects = arrayFrom(instance.reference.getClientRects()); 5043 var cursorRect = rects.find(function (rect) { 5044 return rect.left - 2 <= event.clientX && rect.right + 2 >= event.clientX && rect.top - 2 <= event.clientY && rect.bottom + 2 >= event.clientY; 5045 }); 5046 var index = rects.indexOf(cursorRect); 5047 cursorRectIndex = index > -1 ? index : cursorRectIndex; 5048 } 5049 }, 5050 onHidden: function onHidden() { 5051 cursorRectIndex = -1; 5052 } 5053 }; 5054 } 5055}; 5056function getInlineBoundingClientRect(currentBasePlacement, boundingRect, clientRects, cursorRectIndex) { 5057 // Not an inline element, or placement is not yet known 5058 if (clientRects.length < 2 || currentBasePlacement === null) { 5059 return boundingRect; 5060 } // There are two rects and they are disjoined 5061 5062 5063 if (clientRects.length === 2 && cursorRectIndex >= 0 && clientRects[0].left > clientRects[1].right) { 5064 return clientRects[cursorRectIndex] || boundingRect; 5065 } 5066 5067 switch (currentBasePlacement) { 5068 case 'top': 5069 case 'bottom': 5070 { 5071 var firstRect = clientRects[0]; 5072 var lastRect = clientRects[clientRects.length - 1]; 5073 var isTop = currentBasePlacement === 'top'; 5074 var top = firstRect.top; 5075 var bottom = lastRect.bottom; 5076 var left = isTop ? firstRect.left : lastRect.left; 5077 var right = isTop ? firstRect.right : lastRect.right; 5078 var width = right - left; 5079 var height = bottom - top; 5080 return { 5081 top: top, 5082 bottom: bottom, 5083 left: left, 5084 right: right, 5085 width: width, 5086 height: height 5087 }; 5088 } 5089 5090 case 'left': 5091 case 'right': 5092 { 5093 var minLeft = Math.min.apply(Math, clientRects.map(function (rects) { 5094 return rects.left; 5095 })); 5096 var maxRight = Math.max.apply(Math, clientRects.map(function (rects) { 5097 return rects.right; 5098 })); 5099 var measureRects = clientRects.filter(function (rect) { 5100 return currentBasePlacement === 'left' ? rect.left === minLeft : rect.right === maxRight; 5101 }); 5102 var _top = measureRects[0].top; 5103 var _bottom = measureRects[measureRects.length - 1].bottom; 5104 var _left = minLeft; 5105 var _right = maxRight; 5106 5107 var _width = _right - _left; 5108 5109 var _height = _bottom - _top; 5110 5111 return { 5112 top: _top, 5113 bottom: _bottom, 5114 left: _left, 5115 right: _right, 5116 width: _width, 5117 height: _height 5118 }; 5119 } 5120 5121 default: 5122 { 5123 return boundingRect; 5124 } 5125 } 5126} 5127 5128var sticky = { 5129 name: 'sticky', 5130 defaultValue: false, 5131 fn: function fn(instance) { 5132 var reference = instance.reference, 5133 popper = instance.popper; 5134 5135 function getReference() { 5136 return instance.popperInstance ? instance.popperInstance.state.elements.reference : reference; 5137 } 5138 5139 function shouldCheck(value) { 5140 return instance.props.sticky === true || instance.props.sticky === value; 5141 } 5142 5143 var prevRefRect = null; 5144 var prevPopRect = null; 5145 5146 function updatePosition() { 5147 var currentRefRect = shouldCheck('reference') ? getReference().getBoundingClientRect() : null; 5148 var currentPopRect = shouldCheck('popper') ? popper.getBoundingClientRect() : null; 5149 5150 if (currentRefRect && areRectsDifferent(prevRefRect, currentRefRect) || currentPopRect && areRectsDifferent(prevPopRect, currentPopRect)) { 5151 if (instance.popperInstance) {
5152 instance.popperInstance.update(); 5153 } 5154 } 5155 5156 prevRefRect = currentRefRect; 5157 prevPopRect = currentPopRect; 5158 5159 if (instance.state.isMounted) { 5160 requestAnimationFrame(updatePosition); 5161 } 5162 } 5163 5164 return { 5165 onMount: function onMount() { 5166 if (instance.props.sticky) { 5167 updatePosition(); 5168 } 5169 } 5170 }; 5171 } 5172}; 5173 5174function areRectsDifferent(rectA, rectB) { 5175 if (rectA && rectB) { 5176 return rectA.top !== rectB.top || rectA.right !== rectB.right || rectA.bottom !== rectB.bottom || rectA.left !== rectB.left; 5177 } 5178 5179 return true; 5180} 5181 5182tippy.setDefaultProps({ 5183 render: render 5184}); 5185 5186/* harmony default export */ const tippy_esm = (tippy); 5187 5188 5189 5190/***/ }), 5191 5192/***/ 5266: 5193/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 5194 5195"use strict"; 5196/* harmony export */ __webpack_require__.d(__webpack_exports__, { 5197/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__) 5198/* harmony export */ }); 5199var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { 5200 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 5201 return new (P || (P = Promise))(function (resolve, reject) { 5202 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 5203 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 5204 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 5205 step((generator = generator.apply(thisArg, _arguments || [])).next()); 5206 }); 5207}; 5208// --------- HELPERS 5209function getElementOffset(el) { 5210 let top = 0; 5211 let left = 0; 5212 let element = el; 5213 // Loop through the DOM tree 5214 // and add it's parent's offset to get page offset 5215 do { 5216 top += element.offsetTop || 0; 5217 left += element.offsetLeft || 0; 5218 element = element.offsetParent; 5219 } while (element); 5220 return { 5221 top, 5222 left, 5223 }; 5224} 5225// --------- SCROLL INTERFACES 5226// ScrollDomElement and ScrollWindow have identical interfaces 5227class ScrollDomElement { 5228 constructor(element) { 5229 this.element = element; 5230 } 5231 getHorizontalScroll() { 5232 return this.element.scrollLeft; 5233 } 5234 getVerticalScroll() { 5235 return this.element.scrollTop; 5236 } 5237 getMaxHorizontalScroll() { 5238 return this.element.scrollWidth - this.element.clientWidth; 5239 } 5240 getMaxVerticalScroll() { 5241 return this.element.scrollHeight - this.element.clientHeight; 5242 } 5243 getHorizontalElementScrollOffset(elementToScrollTo, elementToScroll) { 5244 return (getElementOffset(elementToScrollTo).left - 5245 getElementOffset(elementToScroll).left); 5246 } 5247 getVerticalElementScrollOffset(elementToScrollTo, elementToScroll) { 5248 return (getElementOffset(elementToScrollTo).top - 5249 getElementOffset(elementToScroll).top); 5250 } 5251 scrollTo(x, y) { 5252 this.element.scrollLeft = x; 5253 this.element.scrollTop = y; 5254 } 5255} 5256class ScrollWindow { 5257 constructor() { 5258 this.element = window; 5259 } 5260 getHorizontalScroll() { 5261 return window.scrollX || document.documentElement.scrollLeft; 5262 } 5263 getVerticalScroll() { 5264 return window.scrollY || document.documentElement.scrollTop; 5265 } 5266 getMaxHorizontalScroll() { 5267 return (Math.max(document.body.scrollWidth, document.documentElement.scrollWidth, document.body.offsetWidth, document.documentElement.offsetWidth, document.body.clientWidth, document.documentElement.clientWidth) - window.innerWidth); 5268 } 5269 getMaxVerticalScroll() { 5270 return (Math.max(document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight) - window.innerHeight); 5271 } 5272 getHorizontalElementScrollOffset(elementToScrollTo) { 5273 const scrollLeft = window.scrollX || document.documentElement.scrollLeft; 5274 return scrollLeft + elementToScrollTo.getBoundingClientRect().left; 5275 } 5276 getVerticalElementScrollOffset(elementToScrollTo) { 5277 const scrollTop = window.scrollY || document.documentElement.scrollTop; 5278 return scrollTop + elementToScrollTo.getBoundingClientRect().top; 5279 } 5280 scrollTo(x, y) { 5281 window.scrollTo(x, y); 5282 } 5283} 5284const activeAnimations = { 5285 elements: [], 5286 cancelMethods: [], 5287 add: (element, cancelAnimation) => { 5288 activeAnimations.elements.push(element); 5289 activeAnimations.cancelMethods.push(cancelAnimation); 5290 }, 5291 remove: (element, shouldStop) => { 5292 const index = activeAnimations.elements.indexOf(element); 5293 if (index > -1) { 5294 // Stop animation 5295 if (shouldStop) { 5296 activeAnimations.cancelMethods[index](); 5297 } 5298 // Remove it 5299 activeAnimations.elements.splice(index, 1); 5300 activeAnimations.cancelMethods.splice(index, 1); 5301 } 5302 }, 5303}; 5304// --------- CHECK IF CODE IS RUNNING IN A BROWSER 5305const WINDOW_EXISTS = typeof window !== 'undefined';
5306// --------- ANIMATE SCROLL TO 5307const defaultOptions = { 5308 cancelOnUserAction: true, 5309 easing: (t) => --t * t * t + 1, 5310 elementToScroll: WINDOW_EXISTS ? window : null, 5311 horizontalOffset: 0, 5312 maxDuration: 3000, 5313 minDuration: 250, 5314 speed: 500, 5315 verticalOffset: 0, 5316}; 5317function animateScrollTo(numberOrCoordsOrElement, userOptions = {}) { 5318 return __awaiter(this, void 0, void 0, function* () { 5319 // Check for server rendering 5320 if (!WINDOW_EXISTS) { 5321 // @ts-ignore 5322 // If it still gets called on server, return Promise for API consistency 5323 return new Promise((resolve) => { 5324 resolve(false); // Returning false on server 5325 }); 5326 } 5327 else if (!window.Promise) { 5328 throw "Browser doesn't support Promises, and animated-scroll-to depends on it, please provide a polyfill."; 5329 } 5330 let x; 5331 let y; 5332 let scrollToElement; 5333 let options = Object.assign(Object.assign({}, defaultOptions), userOptions); 5334 const isWindow = options.elementToScroll === window; 5335 const isElement = !!options.elementToScroll.nodeName; 5336 if (!isWindow && !isElement) { 5337 throw 'Element to scroll needs to be either window or DOM element.'; 5338 } 5339 // Check for "scroll-behavior: smooth" as it can break the animation 5340 // https://github.com/Stanko/animated-scroll-to/issues/55 5341 const scrollBehaviorElement = isWindow 5342 ? document.documentElement 5343 : options.elementToScroll; 5344 const scrollBehavior = getComputedStyle(scrollBehaviorElement).getPropertyValue('scroll-behavior'); 5345 if (scrollBehavior === 'smooth') { 5346 console.warn(`${scrollBehaviorElement.tagName} has "scroll-behavior: smooth" which can mess up with animated-scroll-to's animations`); 5347 } 5348 // Select the correct scrolling interface 5349 const elementToScroll = isWindow 5350 ? new ScrollWindow() 5351 : new ScrollDomElement(options.elementToScroll); 5352 if (numberOrCoordsOrElement instanceof Element) { 5353 scrollToElement = numberOrCoordsOrElement; 5354 // If "elementToScroll" is not a parent of "scrollToElement" 5355 if (isElement && 5356 (!options.elementToScroll.contains(scrollToElement) || 5357 options.elementToScroll.isSameNode(scrollToElement))) { 5358 throw 'options.elementToScroll has to be a parent of scrollToElement'; 5359 } 5360 x = elementToScroll.getHorizontalElementScrollOffset(scrollToElement, options.elementToScroll); 5361 y = elementToScroll.getVerticalElementScrollOffset(scrollToElement, options.elementToScroll); 5362 } 5363 else if (typeof numberOrCoordsOrElement === 'number') { 5364 x = elementToScroll.getHorizontalScroll(); 5365 y = numberOrCoordsOrElement; 5366 } 5367 else if (Array.isArray(numberOrCoordsOrElement) && 5368 numberOrCoordsOrElement.length === 2) { 5369 x = 5370 numberOrCoordsOrElement[0] === null 5371 ? elementToScroll.getHorizontalScroll() 5372 : numberOrCoordsOrElement[0]; 5373 y = 5374 numberOrCoordsOrElement[1] === null 5375 ? elementToScroll.getVerticalScroll() 5376 : numberOrCoordsOrElement[1]; 5377 } 5378 else { 5379 // ERROR 5380 throw ('Wrong function signature. Check documentation.\n' + 5381 'Available method signatures are:\n' + 5382 ' animateScrollTo(y:number, options)\n' + 5383 ' animateScrollTo([x:number | null, y:number | null], options)\n' + 5384 ' animateScrollTo(scrollToElement:Element, options)'); 5385 } 5386 // Add offsets 5387 x += options.horizontalOffset; 5388 y += options.verticalOffset; 5389 // Horizontal scroll distance 5390 const maxHorizontalScroll = elementToScroll.getMaxHorizontalScroll(); 5391 const initialHorizontalScroll = elementToScroll.getHorizontalScroll(); 5392 // If user specified scroll position is greater than maximum available scroll 5393 if (x > maxHorizontalScroll) { 5394 x = maxHorizontalScroll; 5395 } 5396 // Calculate distance to scroll 5397 const horizontalDistanceToScroll = x - initialHorizontalScroll; 5398 // Vertical scroll distance distance 5399 const maxVerticalScroll = elementToScroll.getMaxVerticalScroll(); 5400 const initialVerticalScroll = elementToScroll.getVerticalScroll(); 5401 // If user specified scroll position is greater than maximum available scroll 5402 if (y > maxVerticalScroll) { 5403 y = maxVerticalScroll; 5404 } 5405 // Calculate distance to scroll 5406 const verticalDistanceToScroll = y - initialVerticalScroll; 5407 // Calculate duration of the scroll
5408 const horizontalDuration = Math.abs(Math.round((horizontalDistanceToScroll / 1000) * options.speed)); 5409 const verticalDuration = Math.abs(Math.round((verticalDistanceToScroll / 1000) * options.speed)); 5410 let duration = horizontalDuration > verticalDuration 5411 ? horizontalDuration 5412 : verticalDuration; 5413 // Set minimum and maximum duration 5414 if (duration < options.minDuration) { 5415 duration = options.minDuration; 5416 } 5417 else if (duration > options.maxDuration) { 5418 duration = options.maxDuration; 5419 } 5420 // @ts-ignore 5421 return new Promise((resolve, reject) => { 5422 // Scroll is already in place, nothing to do 5423 if (horizontalDistanceToScroll === 0 && verticalDistanceToScroll === 0) { 5424 // Resolve promise with a boolean hasScrolledToPosition set to true 5425 resolve(true); 5426 } 5427 // Cancel existing animation if it is already running on the same element 5428 activeAnimations.remove(elementToScroll.element, true); 5429 // To cancel animation we have to store request animation frame ID 5430 let requestID; 5431 // Cancel animation handler 5432 const cancelAnimation = () => { 5433 removeListeners(); 5434 cancelAnimationFrame(requestID); 5435 // Resolve promise with a boolean hasScrolledToPosition set to false 5436 resolve(false); 5437 }; 5438 // Registering animation so it can be canceled if function 5439 // gets called again on the same element 5440 activeAnimations.add(elementToScroll.element, cancelAnimation); 5441 // Prevent user actions handler 5442 const preventDefaultHandler = (e) => e.preventDefault(); 5443 const handler = options.cancelOnUserAction 5444 ? cancelAnimation 5445 : preventDefaultHandler; 5446 // If animation is not cancelable by the user, we can't use passive events 5447 const eventOptions = options.cancelOnUserAction 5448 ? { passive: true } 5449 : { passive: false }; 5450 const events = ['wheel', 'touchstart', 'keydown', 'mousedown']; 5451 // Function to remove listeners after animation is finished 5452 const removeListeners = () => { 5453 events.forEach((eventName) => { 5454 elementToScroll.element.removeEventListener(eventName, handler, eventOptions); 5455 }); 5456 }; 5457 // Add listeners 5458 events.forEach((eventName) => { 5459 elementToScroll.element.addEventListener(eventName, handler, eventOptions); 5460 }); 5461 // Animation 5462 const startingTime = Date.now(); 5463 const step = () => { 5464 var timeDiff = Date.now() - startingTime; 5465 var t = timeDiff / duration; 5466 const horizontalScrollPosition = Math.round(initialHorizontalScroll + 5467 horizontalDistanceToScroll * options.easing(t)); 5468 const verticalScrollPosition = Math.round(initialVerticalScroll + verticalDistanceToScroll * options.easing(t)); 5469 if (timeDiff < duration && 5470 (horizontalScrollPosition !== x || verticalScrollPosition !== y)) { 5471 // If scroll didn't reach desired position or time is not elapsed 5472 // Scroll to a new position 5473 elementToScroll.scrollTo(horizontalScrollPosition, verticalScrollPosition); 5474 // And request a new step 5475 requestID = requestAnimationFrame(step); 5476 } 5477 else { 5478 // If the time elapsed or we reached the desired offset 5479 // Set scroll to the desired offset (when rounding made it to be off a pixel or two) 5480 // Clear animation frame to be sure 5481 elementToScroll.scrollTo(x, y); 5482 cancelAnimationFrame(requestID); 5483 // Remove listeners 5484 removeListeners(); 5485 // Remove animation from the active animations coordinator 5486 activeAnimations.remove(elementToScroll.element, false); 5487 // Resolve promise with a boolean hasScrolledToPosition set to true 5488 resolve(true); 5489 } 5490 }; 5491 // Start animating scroll 5492 requestID = requestAnimationFrame(step); 5493 }); 5494 }); 5495} 5496/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (animateScrollTo); 5497 5498 5499/***/ }) 5500 5501/******/ }); 5502/************************************************************************/ 5503/******/ // The module cache 5504/******/ var __webpack_module_cache__ = {}; 5505/******/ 5506/******/ // The require function 5507/******/ function __webpack_require__(moduleId) { 5508/******/ // Check if module is in cache 5509/******/ var cachedModule = __webpack_module_cache__[moduleId]; 5510/******/ if (cachedModule !== undefined) { 5511/******/ return cachedModule.exports; 5512/******/ } 5513/******/ // Create a new module (and put it into the cache) 5514/******/ var module = __webpack_module_cache__[moduleId] = { 5515/******/ // no module.id needed 5516/******/ // no module.loaded needed 5517/******/ exports: {} 5518/******/ }; 5519/******/ 5520/******/ // Execute the module function 5521/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 5522/******/ 5523/******/ // Return the exports of the module 5524/******/ return module.exports; 5525/******/ } 5526/******/ 5527/******/ // expose the modules object (__webpack_modules__) 5528/******/ __webpack_require__.m = __webpack_modules__; 5529/******/ 5530/************************************************************************/ 5531/******/ /* webpack/runtime/chunk loaded */ 5532/******/ (() => { 5533/******/ var deferred = []; 5534/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { 5535/******/ if(chunkIds) { 5536/******/ priority = priority || 0; 5537/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; 5538/******/ deferred[i] = [chunkIds, fn, priority]; 5539/******/ return; 5540/******/ } 5541/******/ var notFulfilled = Infinity; 5542/******/ for (var i = 0; i < deferred.length; i++) { 5543/******/ var [chunkIds, fn, priority] = deferred[i]; 5544/******/ var fulfilled = true; 5545/******/ for (var j = 0; j < chunkIds.length; j++) { 5546/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { 5547/******/ chunkIds.splice(j--, 1); 5548/******/ } else { 5549/******/ fulfilled = false;
vendor: 4,114 bytes, lines 5550-5635
5550/******/ if(priority < notFulfilled) notFulfilled = priority; 5551/******/ } 5552/******/ } 5553/******/ if(fulfilled) { 5554/******/ deferred.splice(i--, 1) 5555/******/ var r = fn(); 5556/******/ if (r !== undefined) result = r; 5557/******/ } 5558/******/ } 5559/******/ return result; 5560/******/ }; 5561/******/ })(); 5562/******/ 5563/******/ /* webpack/runtime/compat get default export */ 5564/******/ (() => { 5565/******/ // getDefaultExport function for compatibility with non-harmony modules 5566/******/ __webpack_require__.n = (module) => { 5567/******/ var getter = module && module.__esModule ? 5568/******/ () => (module['default']) : 5569/******/ () => (module); 5570/******/ __webpack_require__.d(getter, { a: getter }); 5571/******/ return getter; 5572/******/ }; 5573/******/ })(); 5574/******/ 5575/******/ /* webpack/runtime/create fake namespace object */ 5576/******/ (() => { 5577/******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__); 5578/******/ var leafPrototypes; 5579/******/ // create a fake namespace object 5580/******/ // mode & 1: value is a module id, require it 5581/******/ // mode & 2: merge all properties of value into the ns 5582/******/ // mode & 4: return value when already ns object 5583/******/ // mode & 16: return value when it's Promise-like 5584/******/ // mode & 8|1: behave like require 5585/******/ __webpack_require__.t = function(value, mode) { 5586/******/ if(mode & 1) value = this(value); 5587/******/ if(mode & 8) return value; 5588/******/ if(typeof value === 'object' && value) { 5589/******/ if((mode & 4) && value.__esModule) return value; 5590/******/ if((mode & 16) && typeof value.then === 'function') return value; 5591/******/ } 5592/******/ var ns = Object.create(null); 5593/******/ __webpack_require__.r(ns); 5594/******/ var def = {}; 5595/******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; 5596/******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { 5597/******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key]))); 5598/******/ } 5599/******/ def['default'] = () => (value); 5600/******/ __webpack_require__.d(ns, def); 5601/******/ return ns; 5602/******/ }; 5603/******/ })(); 5604/******/ 5605/******/ /* webpack/runtime/define property getters */ 5606/******/ (() => { 5607/******/ // define getter functions for harmony exports 5608/******/ __webpack_require__.d = (exports, definition) => { 5609/******/ for(var key in definition) { 5610/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 5611/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 5612/******/ } 5613/******/ } 5614/******/ }; 5615/******/ })(); 5616/******/ 5617/******/ /* webpack/runtime/ensure chunk */ 5618/******/ (() => { 5619/******/ __webpack_require__.f = {}; 5620/******/ // This file contains only the entry chunk. 5621/******/ // The chunk loading function for additional chunks 5622/******/ __webpack_require__.e = (chunkId) => { 5623/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => { 5624/******/ __webpack_require__.f[key](chunkId, promises); 5625/******/ return promises; 5626/******/ }, [])); 5627/******/ }; 5628/******/ })(); 5629/******/ 5630/******/ /* webpack/runtime/get javascript chunk filename */ 5631/******/ (() => { 5632/******/ // This function allow to reference async chunks 5633/******/ __webpack_require__.u = (chunkId) => { 5634/******/ // return url for filenames based on template 5635/******/ return "" + {"1":"../../wp-recipe-maker-premium/dist/public-feature-add-to-collection","10":"../../wp-recipe-maker-premium/dist/public-feature-add-to-shopping-list","83":"../../wp-recipe-maker-premium/dist/public-feature-saved-collection","215":"public-feature-media-toggle","292":"../../wp-recipe-maker-premium/dist/public-feature-recipe-collections-jump-to-section","297":"public-feature-instacart","349":"../../wp-recipe-maker-premium/dist/public-feature-recipe-collections-app","576":"../../wp-recipe
vendor: 10,359 bytes, lines 5635-5840
5635-maker-premium/dist/public-feature-recipe-submission","582":"../../wp-recipe-maker-premium/dist/public-feature-product-modal","615":"public-feature-debug","631":"public-feature-my-shopping-help","765":"public-feature-cookpal","790":"public-feature-slickstream","794":"public-feature-jump-to-section","796":"public-feature-pinterest","830":"../../wp-recipe-maker-premium/dist/public-feature-shopping-list","864":"../../wp-recipe-maker-premium/dist/public-feature-unit-conversion","868":"../../wp-recipe-maker-premium/dist/public-feature-product-icon","911":"public-feature-grow","929":"../../wp-recipe-maker-premium/dist/public-feature-recipe-collections-print","939":"public-feature-video","990":"public-feature-expandable"}[chunkId] + "." + {"1":"e447db5d","10":"02365086","83":"150fbe56","215":"fe2362f2","292":"afe5226d","297":"ff223b1c","349":"ad3e2a15","576":"b4c0038e","582":"9c7fd14e","615":"259714f0","631":"65ac3c8e","765":"5d1b1889","790":"da098418","794":"84c91255","796":"e9036a90","830":"f8c127ab","864":"f58d1731","868":"d9b0e0c7","911":"a9d38223","929":"d4840b16","939":"167c84f7","990":"b6dd24a4"}[chunkId] + ".js"; 5636/******/ }; 5637/******/ })(); 5638/******/ 5639/******/ /* webpack/runtime/get mini-css chunk filename */ 5640/******/ (() => { 5641/******/ // This function allow to reference async chunks 5642/******/ __webpack_require__.miniCssF = (chunkId) => { 5643/******/ // return url for filenames based on template 5644/******/ return undefined; 5645/******/ }; 5646/******/ })(); 5647/******/ 5648/******/ /* webpack/runtime/global */ 5649/******/ (() => { 5650/******/ __webpack_require__.g = (function() { 5651/******/ if (typeof globalThis === 'object') return globalThis; 5652/******/ try { 5653/******/ return this || new Function('return this')(); 5654/******/ } catch (e) { 5655/******/ if (typeof window === 'object') return window; 5656/******/ } 5657/******/ })(); 5658/******/ })(); 5659/******/ 5660/******/ /* webpack/runtime/hasOwnProperty shorthand */ 5661/******/ (() => { 5662/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 5663/******/ })(); 5664/******/ 5665/******/ /* webpack/runtime/load script */ 5666/******/ (() => { 5667/******/ var inProgress = {}; 5668/******/ var dataWebpackPrefix = "WPRecipeMaker:"; 5669/******/ // loadScript function to load a script via script tag 5670/******/ __webpack_require__.l = (url, done, key, chunkId) => { 5671/******/ if(inProgress[url]) { inProgress[url].push(done); return; } 5672/******/ var script, needAttach; 5673/******/ if(key !== undefined) { 5674/******/ var scripts = document.getElementsByTagName("script"); 5675/******/ for(var i = 0; i < scripts.length; i++) { 5676/******/ var s = scripts[i]; 5677/******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; } 5678/******/ } 5679/******/ } 5680/******/ if(!script) { 5681/******/ needAttach = true; 5682/******/ script = document.createElement('script'); 5683/******/ 5684/******/ script.charset = 'utf-8'; 5685/******/ script.timeout = 120; 5686/******/ if (__webpack_require__.nc) { 5687/******/ script.setAttribute("nonce", __webpack_require__.nc); 5688/******/ } 5689/******/ script.setAttribute("data-webpack", dataWebpackPrefix + key); 5690/******/ 5691/******/ script.src = url; 5692/******/ } 5693/******/ inProgress[url] = [done]; 5694/******/ var onScriptComplete = (prev, event) => { 5695/******/ // avoid mem leaks in IE. 5696/******/ script.onerror = script.onload = null; 5697/******/ clearTimeout(timeout); 5698/******/ var doneFns = inProgress[url]; 5699/******/ delete inProgress[url]; 5700/******/ script.parentNode && script.parentNode.removeChild(script); 5701/******/ doneFns && doneFns.forEach((fn) => (fn(event))); 5702/******/ if(prev) return prev(event); 5703/******/ } 5704/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); 5705/******/ script.onerror = onScriptComplete.bind(null, script.onerror); 5706/******/ script.onload = onScriptComplete.bind(null, script.onload); 5707/******/ needAttach && document.head.appendChild(script); 5708/******/ }; 5709/******/ })(); 5710/******/ 5711/******/ /* webpack/runtime/make namespace object */ 5712/******/ (() => { 5713/******/ // define __esModule on exports 5714/******/ __webpack_require__.r = (exports) => { 5715/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 5716/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 5717/******/ } 5718/******/ Object.defineProperty(exports, '__esModule', { value: true }); 5719/******/ }; 5720/******/ })(); 5721/******/ 5722/******/ /* webpack/runtime/publicPath */ 5723/******/ (() => { 5724/******/ var scriptUrl; 5725/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; 5726/******/ var document = __webpack_require__.g.document; 5727/******/ if (!scriptUrl && document) { 5728/******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') 5729/******/ scriptUrl = document.currentScript.src; 5730/******/ if (!scriptUrl) { 5731/******/ var scripts = document.getElementsByTagName("script"); 5732/******/ if(scripts.length) { 5733/******/ var i = scripts.length - 1; 5734/******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; 5735/******/ } 5736/******/ } 5737/******/ } 5738/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration 5739/******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic. 5740/******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); 5741/******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); 5742/******/ __webpack_require__.p = scriptUrl; 5743/******/ })(); 5744/******/ 5745/******/ /* webpack/runtime/jsonp chunk loading */ 5746/******/ (() => { 5747/******/ // no baseURI 5748/******/ 5749/******/ // object to store loaded and loading chunks 5750/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched 5751/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded 5752/******/ var installedChunks = { 5753/******/ 607: 0 5754/******/ }; 5755/******/ 5756/******/ __webpack_require__.f.j = (chunkId, promises) => { 5757/******/ // JSONP chunk loading for javascript 5758/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; 5759/******/ if(installedChunkData !== 0) { // 0 means "already installed". 5760/******/ 5761/******/ // a Promise means "currently loading". 5762/******/ if(installedChunkData) { 5763/******/ promises.push(installedChunkData[2]); 5764/******/ } else { 5765/******/ if(true) { // all chunks have JS 5766/******/ // setup Promise in chunk cache 5767/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); 5768/******/ promises.push(installedChunkData[2] = promise); 5769/******/ 5770/******/ // start chunk loading 5771/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); 5772/******/ // create error before stack unwound to get useful stacktrace later 5773/******/ var error = new Error(); 5774/******/ var loadingEnded = (event) => { 5775/******/ if(__webpack_require__.o(installedChunks, chunkId)) { 5776/******/ installedChunkData = installedChunks[chunkId]; 5777/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; 5778/******/ if(installedChunkData) { 5779/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); 5780/******/ var realSrc = event && event.target && event.target.src; 5781/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; 5782/******/ error.name = 'ChunkLoadError'; 5783/******/ error.type = errorType; 5784/******/ error.request = realSrc; 5785/******/ installedChunkData[1](error); 5786/******/ } 5787/******/ } 5788/******/ }; 5789/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId); 5790/******/ } 5791/******/ } 5792/******/ } 5793/******/ }; 5794/******/ 5795/******/ // no prefetching 5796/******/ 5797/******/ // no preloaded 5798/******/ 5799/******/ // no HMR 5800/******/ 5801/******/ // no HMR manifest 5802/******/ 5803/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); 5804/******/ 5805/******/ // install a JSONP callback for chunk loading 5806/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { 5807/******/ var [chunkIds, moreModules, runtime] = data; 5808/******/ // add "moreModules" to the modules object, 5809/******/ // then flag all "chunkIds" as loaded and fire callback 5810/******/ var moduleId, chunkId, i = 0; 5811/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { 5812/******/ for(moduleId in moreModules) { 5813/******/ if(__webpack_require__.o(moreModules, moduleId)) { 5814/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; 5815/******/ } 5816/******/ } 5817/******/ if(runtime) var result = runtime(__webpack_require__); 5818/******/ } 5819/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); 5820/******/ for(;i < chunkIds.length; i++) { 5821/******/ chunkId = chunkIds[i]; 5822/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { 5823/******/ installedChunks[chunkId][0](); 5824/******/ } 5825/******/ installedChunks[chunkId] = 0; 5826/******/ } 5827/******/ return __webpack_require__.O(result); 5828/******/ } 5829/******/ 5830/******/ var chunkLoadingGlobal = self["webpackChunkWPRecipeMakerPublicSplit"] = self["webpackChunkWPRecipeMakerPublicSplit"] || []; 5831/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); 5832/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); 5833/******/ })(); 5834/******/ 5835/************************************************************************/ 5836var __webpack_exports__ = {}; 5837// This entry needs to be wrapped in an IIFE because it needs to be in strict mode. 5838(() => { 5839"use strict"; 5840
5841// EXTERNAL MODULE: ./wp-recipe-maker/assets/js/public/public-path.js 5842var public_path = __webpack_require__(6563); 5843// EXTERNAL MODULE: ./wp-recipe-maker/assets/js/public/analytics.js 5844var analytics = __webpack_require__(3524); 5845;// ./wp-recipe-maker/assets/js/public/comment-rating.js 5846 5847window.WPRecipeMaker = typeof window.WPRecipeMaker === "undefined" ? {} : window.WPRecipeMaker; 5848window.WPRecipeMaker.rating = { 5849 init() { 5850 const ratingFormElem = document.querySelector('.comment-form-wprm-rating'); 5851 if (ratingFormElem) { 5852 const recipes = document.querySelectorAll('.wprm-recipe-container'); 5853 const admin = document.querySelector('body.wp-admin'); 5854 if (recipes.length > 0 || admin) { 5855 ratingFormElem.style.display = ''; 5856 } else { 5857 // Hide when no recipe is found. 5858 ratingFormElem.style.display = 'none'; 5859 } 5860 } 5861 }, 5862 settings: { 5863 enabled: typeof window.wprm_public !== 'undefined' ? wprm_public.settings.features_comment_ratings : wprm_admin.settings.features_comment_ratings 5864 }, 5865 onClick(el) { 5866 const container = el.closest('.wprm-comment-ratings-container, .wprm-user-ratings-modal-stars'); 5867 const oldValue = container ? parseInt(container.dataset.currentRating) : 0; 5868 const newValue = parseInt(el.value); 5869 if (newValue === oldValue) { 5870 el.checked = false; 5871 document.querySelector('input[name="' + el.name + '"][value="0"]').checked = true; 5872 container.dataset.currentRating = 0; 5873 } else { 5874 container.dataset.currentRating = newValue; 5875 5876 // Maybe track via analytics. 5877 if (window.WPRecipeMaker.hasOwnProperty('analytics')) { 5878 let recipeId = 0; 5879 const recipe = document.querySelector('.wprm-recipe-container'); 5880 if (recipe && recipe.dataset.hasOwnProperty('recipeId')) { 5881 recipeId = parseInt(recipe.dataset.recipeId); 5882 } 5883 window.WPRecipeMaker.analytics.registerAction(recipeId, wprm_public.post_id, 'comment-rating', { 5884 rating: newValue 5885 }); 5886 } 5887 } 5888 5889 // Optionally update admin rating. 5890 if (window.WPRecipeMaker.hasOwnProperty('comments') && window.WPRecipeMaker.comments.hasOwnProperty('change')) { 5891 window.WPRecipeMaker.comments.change(container); 5892 } 5893 5894 // Trigger stars change event. 5895 document.dispatchEvent(new CustomEvent('wprm-comment-rating-change', { 5896 detail: { 5897 el, 5898 container, 5899 rating: newValue 5900 } 5901 })); 5902 } 5903}; 5904ready(() => { 5905 window.WPRecipeMaker.rating.init(); 5906}); 5907function ready(fn) { 5908 if (document.readyState != 'loading') { 5909 fn(); 5910 } else { 5911 document.addEventListener('DOMContentLoaded', fn); 5912 } 5913} 5914// EXTERNAL MODULE: ./wp-recipe-maker/assets/js/public/manager.js 5915var manager = __webpack_require__(8455); 5916;// ./node_modules/micromodal/dist/micromodal.es.js 5917function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function t(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}var n,i,a,r,s,l=(n=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'],i=function(){function o(e){var n=e.targetModal,i=e.triggers,a=void 0===i?[]:i,r=e.onShow,s=void 0===r?function(){}:r,l=e.onClose,c=void 0===l?function(){}:l,d=e.openTrigger,u=void 0===d?"data-micromodal-trigger":d,f=e.closeTrigger,h=void 0===f?"data-micromodal-close":f,v=e.openClass,g=void 0===v?"is-open":v,m=e.disableScroll,b=void 0!==m&&m,y=e.disableFocus,p=void 0!==y&&y,w=e.awaitCloseAnimation,E=void 0!==w&&w,k=e.awaitOpenAnimation,M=void 0!==k&&k,A=e.debugMode,C=void 0!==A&&A;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),this.modal=document.getElementById(n),this.config={debugMode:C,disableScroll:b,openTrigger:u,closeTrigger:h,openClass:g,onShow:s,onClose:c,awaitCloseAnimation:E,awaitOpenAnimation:M,disableFocus:p},a.length>0&&this.registerTriggers.apply(this,t(a)),this.onClick=this.onClick.bind(this),this.onKeydown=this.onKeydown.bind(this)}var i,a,r;return i=o,(a=[{key:"registerTriggers",value:function(){for(var e=this,t=arguments.length,o=new Array(t),n=0;n<t;n++)o[n]=arguments[n];
vendor: 4,620 bytes, lines 5917-5919
5917o.filter(Boolean).forEach((function(t){t.addEventListener("click",(function(t){return e.showModal(t)}))}))}},{key:"showModal",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.activeElement=document.activeElement,this.modal.setAttribute("aria-hidden","false"),this.modal.classList.add(this.config.openClass),this.scrollBehaviour("disable"),this.addEventListeners(),this.config.awaitOpenAnimation){var o=function t(){e.modal.removeEventListener("animationend",t,!1),e.setFocusToFirstNode()};this.modal.addEventListener("animationend",o,!1)}else this.setFocusToFirstNode();this.config.onShow(this.modal,this.activeElement,t)}},{key:"closeModal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this.modal;if(this.modal.setAttribute("aria-hidden","true"),this.removeEventListeners(),this.scrollBehaviour("enable"),this.activeElement&&this.activeElement.focus&&this.activeElement.focus(),this.config.onClose(this.modal,this.activeElement,e),this.config.awaitCloseAnimation){var o=this.config.openClass;this.modal.addEventListener("animationend",(function e(){t.classList.remove(o),t.removeEventListener("animationend",e,!1)}),!1)}else t.classList.remove(this.config.openClass)}},{key:"closeModalById",value:function(e){this.modal=document.getElementById(e),this.modal&&this.closeModal()}},{key:"scrollBehaviour",value:function(e){if(this.config.disableScroll){var t=document.querySelector("body");switch(e){case"enable":Object.assign(t.style,{overflow:""});break;case"disable":Object.assign(t.style,{overflow:"hidden"})}}}},{key:"addEventListeners",value:function(){this.modal.addEventListener("touchstart",this.onClick),this.modal.addEventListener("click",this.onClick),document.addEventListener("keydown",this.onKeydown)}},{key:"removeEventListeners",value:function(){this.modal.removeEventListener("touchstart",this.onClick),this.modal.removeEventListener("click",this.onClick),document.removeEventListener("keydown",this.onKeydown)}},{key:"onClick",value:function(e){(e.target.hasAttribute(this.config.closeTrigger)||e.target.parentNode.hasAttribute(this.config.closeTrigger))&&(e.preventDefault(),e.stopPropagation(),this.closeModal(e))}},{key:"onKeydown",value:function(e){27===e.keyCode&&this.closeModal(e),9===e.keyCode&&this.retainFocus(e)}},{key:"getFocusableNodes",value:function(){var e=this.modal.querySelectorAll(n);return Array.apply(void 0,t(e))}},{key:"setFocusToFirstNode",value:function(){var e=this;if(!this.config.disableFocus){var t=this.getFocusableNodes();if(0!==t.length){var o=t.filter((function(t){return!t.hasAttribute(e.config.closeTrigger)}));o.length>0&&o[0].focus(),0===o.length&&t[0].focus()}}}},{key:"retainFocus",value:function(e){var t=this.getFocusableNodes();if(0!==t.length)if(t=t.filter((function(e){return null!==e.offsetParent})),this.modal.contains(document.activeElement)){var o=t.indexOf(document.activeElement);e.shiftKey&&0===o&&(t[t.length-1].focus(),e.preventDefault()),!e.shiftKey&&t.length>0&&o===t.length-1&&(t[0].focus(),e.preventDefault())}else t[0].focus()}}])&&e(i.prototype,a),r&&e(i,r),o}(),a=null,r=function(e){if(!document.getElementById(e))return console.warn("MicroModal: âSeems like you have missed %c'".concat(e,"'"),"background-color: #f8f9fa;color: #50596c;font-weight: bold;","ID somewhere in your code. Refer example below to resolve it."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",'<div class="modal" id="'.concat(e,'"></div>')),!1},s=function(e,t){if(function(e){e.length<=0&&(console.warn("MicroModal: âPlease specify at least one %c'micromodal-trigger'","background-color: #f8f9fa;color: #50596c;font-weight: bold;","data attribute."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",'<a href="#" data-micromodal-trigger="my-modal"></a>'))}(e),!t)return!0;for(var o in t)r(o);return!0},{init:function(e){var o=Object.assign({},{openTrigger:"data-micromodal-trigger"},e),n=t(document.querySelectorAll("[".concat(o.openTrigger,"]"))),r=function(e,t){var o=[];return e.forEach((function(e){var n=e.attributes[t].value;void 0===o[n]&&(o[n]=[]),o[n].push(e)})),o}(n,o.openTrigger);if(!0!==o.debugMode||!1!==s(n,r))for(var l in r){var c=r[l];o.targetModal=l,o.triggers=t(c),a=new i(o)}},show:function(e,t){var o=t||{};o.targetModal=e,!0===o.debugMode&&!1===r(e)||(a&&a.removeEventListeners(),(a=new i(o)).showModal())},close:function(e){e?a.closeModalById(e):a.closeModal()}});"undefined"!=typeof window&&(window.MicroModal=l);/* harmony default export */ const micromodal_es = (l); 5918 5919;
5919// ./wp-recipe-maker/assets/js/public/modal.js 5920 5921 5922window.WPRecipeMaker = typeof window.WPRecipeMaker === "undefined" ? {} : window.WPRecipeMaker; 5923window.WPRecipeMaker.modal = { 5924 savedScrollPosition: 0, 5925 currentOpenUid: null, 5926 htmlMarginTopValue: null, 5927 getHtmlMarginTopValue() { 5928 if (null !== this.htmlMarginTopValue) { 5929 return this.htmlMarginTopValue; 5930 } 5931 5932 // Check if html has a margin-top (e.g., from WordPress admin bar). 5933 const htmlStyle = window.getComputedStyle(document.documentElement); 5934 const htmlMarginTop = htmlStyle.marginTop; 5935 const parsedMarginTop = htmlMarginTop && htmlMarginTop !== '0px' ? parseFloat(htmlMarginTop) : 0; 5936 this.htmlMarginTopValue = isNaN(parsedMarginTop) ? 0 : parsedMarginTop; 5937 return this.htmlMarginTopValue; 5938 }, 5939 resetHtmlMarginTopValue() { 5940 this.htmlMarginTopValue = null; 5941 }, 5942 open(uid, data = {}) { 5943 // Close currently open modal if there is one 5944 if (this.currentOpenUid && this.currentOpenUid !== uid) { 5945 this.close(this.currentOpenUid); 5946 } 5947 const modalId = `wprm-popup-modal-${uid}`; 5948 if (!document.getElementById(modalId)) { 5949 console.warn(`WPRM modal "${modalId}" could not be found in the DOM.`); 5950 return; 5951 } 5952 5953 // Prevent body scroll by fixing it in place 5954 this.savedScrollPosition = window.pageYOffset || document.documentElement.scrollTop; 5955 const htmlMarginTopValue = this.getHtmlMarginTopValue(); 5956 document.body.classList.add('wprm-popup-modal-open'); 5957 // Adjust body top position to account for html margin-top 5958 document.body.style.top = `-${this.savedScrollPosition - htmlMarginTopValue}px`; 5959 micromodal_es.show(modalId, { 5960 onShow: modal => { 5961 // Track this as the currently open modal 5962 this.currentOpenUid = uid; 5963 const type = modal.dataset.type; 5964 document.dispatchEvent(new CustomEvent('wprm-modal-open', { 5965 detail: { 5966 type, 5967 uid, 5968 modal, 5969 data 5970 } 5971 })); 5972 }, 5973 onClose: modal => { 5974 // Clear the currently open modal tracking 5975 if (this.currentOpenUid === uid) { 5976 this.currentOpenUid = null; 5977 } 5978 const type = modal.dataset.type; 5979 document.dispatchEvent(new CustomEvent('wprm-modal-close', { 5980 detail: { 5981 type, 5982 uid, 5983 modal, 5984 data 5985 } 5986 })); 5987 5988 // Re-enable body scroll and restore scroll position 5989 const scrollPosition = this.savedScrollPosition; 5990 document.body.classList.remove('wprm-popup-modal-open'); 5991 document.body.style.top = ''; 5992 this.savedScrollPosition = 0; 5993 5994 // Restore scroll position with instant behavior 5995 window.scrollTo({ 5996 top: scrollPosition, 5997 behavior: 'instant' 5998 }); 5999 }, 6000 awaitCloseAnimation: true 6001 }); 6002 }, 6003 close(uid) { 6004 // Ignore duplicate close requests for modals that are no longer open. 6005 if (`${this.currentOpenUid}` !== `${uid}`) { 6006 return; 6007 } 6008 micromodal_es.close('wprm-popup-modal-' + uid); 6009 // Clear the currently open modal tracking if this was the open one 6010 if (this.currentOpenUid === uid) { 6011 this.currentOpenUid = null; 6012 } 6013 } 6014}; 6015window.addEventListener('resize', () => window.WPRecipeMaker.modal.resetHtmlMarginTopValue()); 6016window.addEventListener('orientationchange', () => window.WPRecipeMaker.modal.resetHtmlMarginTopValue()); 6017// EXTERNAL MODULE: ./wp-recipe-maker/assets/js/public/print.js 6018var print = __webpack_require__(3579); 6019// EXTERNAL MODULE: ./wp-recipe-maker/assets/js/public/recipe.js 6020var recipe = __webpack_require__(1104); 6021// EXTERNAL MODULE: ./node_modules/animated-scroll-to/dist/esm/index.js 6022var esm = __webpack_require__(5266); 6023;// ./wp-recipe-maker/assets/js/public/smooth-scroll.js 6024 6025window.WPRecipeMaker = typeof window.WPRecipeMaker === "undefined" ? {} : window.WPRecipeMaker; 6026window.WPRecipeMaker.jump = { 6027 init: () => { 6028 document.addEventListener('click', function (e) { 6029 const target = e.target.closest ? e.target.closest('.wprm-recipe-jump, .wprm-recipe-jump-to-comments, .wprm-recipe-jump-video, .wprm-jump-smooth-scroll, .wprm-recipe-jump-to-section') : false;
6030 if (target) { 6031 WPRecipeMaker.jump.onClick(target, e); 6032 } 6033 }, false); 6034 }, 6035 onClick: (el, e) => { 6036 const target = el.getAttribute('href'); 6037 6038 // Maybe uses smooth scroll. 6039 if (el.matches('.wprm-jump-smooth-scroll')) { 6040 e.preventDefault(); 6041 let speed = parseInt(el.dataset.smoothScroll); 6042 if (speed < 0) { 6043 speed = 500; 6044 } 6045 (0,esm/* default */.A)(document.querySelector(target), { 6046 verticalOffset: -100, 6047 speed 6048 }); 6049 } else { 6050 // Check if hash should not be shown. 6051 if (!wprm_public.settings.jump_output_hash) { 6052 const elementToJumpTo = document.querySelector(target); 6053 if (elementToJumpTo) { 6054 e.preventDefault(); 6055 elementToJumpTo.scrollIntoView(); 6056 } 6057 } 6058 } 6059 } 6060}; 6061smooth_scroll_ready(() => { 6062 window.WPRecipeMaker.jump.init(); 6063}); 6064function smooth_scroll_ready(fn) { 6065 if (document.readyState != 'loading') { 6066 fn(); 6067 } else { 6068 document.addEventListener('DOMContentLoaded', fn); 6069 } 6070} 6071// EXTERNAL MODULE: ./wp-recipe-maker/assets/js/public/temperature.js 6072var temperature = __webpack_require__(9002); 6073// EXTERNAL MODULE: ./node_modules/tippy.js/dist/tippy.esm.js + 52 modules 6074var tippy_esm = __webpack_require__(4181); 6075;// ./wp-recipe-maker/assets/js/public/tooltip.js 6076 6077 6078 6079window.WPRecipeMaker = typeof window.WPRecipeMaker === "undefined" ? {} : window.WPRecipeMaker; 6080const fadedNotesSelector = ['.wprm-recipe-ingredient-notes-faded', '.wprm-recipe-ingredient-notes-smaller-faded', '.wprm-recipe-equipment-notes-faded', '.wprm-recipe-equipment-notes-smaller-faded'].join(', '); 6081window.WPRecipeMaker.tooltip = { 6082 init() { 6083 WPRecipeMaker.tooltip.addTooltips(); 6084 }, 6085 addTooltips(root = document) { 6086 let containers = []; 6087 if (root && root.classList && root.classList.contains('wprm-tooltip')) { 6088 containers.push(root); 6089 } 6090 if (root && 'function' === typeof root.querySelectorAll) { 6091 containers = containers.concat([...root.querySelectorAll('.wprm-tooltip')]); 6092 } 6093 for (let container of containers) { 6094 // Remove any existing tippy. 6095 const existingTippy = container._tippy; 6096 if (existingTippy) { 6097 existingTippy.destroy(); 6098 } 6099 6100 // Check for tooltip. 6101 const tooltip = container.dataset.hasOwnProperty('tooltip') ? c
6101ontainer.dataset.tooltip : false; 6102 if (tooltip) { 6103 // Preserve the native semantics of links and form controls. 6104 if (!container.matches('a[href], button, input, select, textarea, summary')) { 6105 container.role = "button"; 6106 } 6107 const hasHtml = container.dataset.hasOwnProperty('tooltipHtml') && '1' === container.dataset.tooltipHtml; 6108 const isInstructionImage = container.classList.contains('wprm-recipe-instruction-image-tooltip'); 6109 const instructionImage = isInstructionImage ? container.querySelector('img') : false; 6110 let content = tooltip; 6111 if (hasHtml) { 6112 // Strip HTML tags. 6113 content = content.replace(/<[^>]*>/g, ''); 6114 } 6115 6116 // Keep the tooltip outside faded notes so their opacity does not affect it. 6117 const fadedNotes = container.closest(fadedNotesSelector); 6118 (0,tippy_esm/* default */.Ay)(container, { 6119 theme: 'wprm', 6120 content, 6121 allowHTML: false, 6122 interactive: true, 6123 ...(instructionImage ? { 6124 arrow: false, 6125 placement: 'top', 6126 getReferenceClientRect: () => { 6127 const imageRect = instructionImage.getBoundingClientRect(); 6128 const x = imageRect.left + imageRect.width / 2; 6129 const y = imageRect.top + imageRect.height / 2; 6130 return { 6131 width: 0, 6132 height: 0, 6133 top: y, 6134 right: x, 6135 bottom: y, 6136 left: x 6137 }; 6138 }, 6139 offset: ({ 6140 popper 6141 }) => [0, -popper.height / 2] 6142 } : {}), 6143 ...(fadedNotes ? { 6144 appendTo: () => fadedNotes.parentElement || document.body 6145 } : {}), 6146 onCreate(instance) { 6147 // Prevents the tooltip from breaking ingredients into multiple lines. 6148 instance.popper.style.display = 'inline-block'; 6149 6150 // State of fetching. 6151 instance._isFetching = false; 6152 instance._fetchedContent = false; 6153 }, 6154 onShow(instance) { 6155 if (instance._isFetching || instance._fetchedContent) { 6156 return; 6157 } 6158 if (hasHtml) { 6159 instance._isFetching = true; 6160 fetch(`${wprm_public.endpoints.utilities}/sanitize`, { 6161 method: 'POST', 6162 headers: { 6163 'Accept': 'application/json', 6164 'Content-Type': 'application/json' 6165 }, 6166 credentials: 'same-origin', 6167 body: JSON.stringify({ 6168 text: tooltip 6169 }) 6170 }).then(response => { 6171 if (response.ok) { 6172 return response.json(); 6173 } else { 6174 return false; 6175 } 6176 }).then(html => { 6177 instance._isFetching = false; 6178 instance._fetchedContent = true; 6179 if (html) { 6180 instance.setContent(html); 6181 6182 // Change allowHTML to true to show HTML. 6183 instance.setProps({ 6184 allowHTML: true 6185 }); 6186 } 6187 }); 6188 } 6189 } 6190 }); 6191 } 6192 } 6193 } 6194}; 6195tooltip_ready(() => { 6196 window.WPRecipeMaker.tooltip.init(); 6197}); 6198function tooltip_ready(fn) { 6199 if (document.readyState != 'loading') { 6200 fn(); 6201 } else { 6202 document.addEventListener('DOMContentLoaded', fn); 6203 } 6204} 6205;// ./wp-recipe-maker/assets/js/public-modern-split.js 6206 6207window.WPRecipeMaker = typeof window.WPRecipeMaker === 'undefined' ? {} : window.WPRecipeMaker; 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217const featurePromises = {}; 6218const public_modern_split_ready = fn => { 6219 if (document.readyState !== 'loading') { 6220 fn(); 6221 } else { 6222 document.addEventListener('DOMContentLoaded', fn); 6223 } 6224}; 6225const hasElement = (selector, root = document) => { 6226 if (!root) { 6227 return false; 6228 } 6229 if (root !== document && root.matches && root.matches(selector)) { 6230 return true; 6231 } 6232 return !!(root.querySelector && root.querySelector(selector)); 6233}; 6234const loadFeature = (key, importer) => { 6235 if (!featurePromises[key]) { 6236 featurePromises[key] = importer().catch(error => { 6237 delete featurePromises[key]; 6238 console.error(`WP Recipe Maker could not load the ${key} feature.`, error); 6239 }); 6240 } 6241 return featurePromises[key]; 6242}; 6243const loaders = { 6244 commentRating: () => Promise.resolve(), 6245 cookpal: () => loadFeature('cookpal', () => __webpack_require__.e(/* import() | public-feature-cookpal */ 765).then(__webpack_require__.t.bind(__webpack_require__, 3621, 23))), 6246 debug: () => loadFeature('debug', () => __webpack_require__.e(/* import() | public-feature-debug */ 615).then(__webpack_require__.t.bind(__webpack_require__, 2811, 23))), 6247 expandable: () => loadFeature('expandable', () => __webpack_require__.e(/* import() | public-feature-expandable */ 990).then(__webpack_require__.t.bind(__webpack_require__, 2942, 23))), 6248 grow: () => loadFeature('grow', () => __webpack_require__.e(/* import() | public-feature-grow */ 911).then(__webpack_require__.t.bind(__webpack_require__, 385, 23))), 6249 instacart: () => loadFeature('instacart', () => __webpack_require__.e(/* import() | public-feature-instacart */ 297).then(__webpack_require__.t.bind(__webpack_require__, 1157, 23))), 6250 jump: () => Promise.resolve(), 6251 jumpToSection: () => loadFeature('jumpToSection', () => __webpack_require__.e(/* import() | public-feature-jump-to-section */ 794).then(__webpack_require__.t.bind(__webpack_require__, 68, 23))), 6252 media: () => loadFeature('media', () => __webpack_require__.e(/* import() | public-feature-media-toggle */ 215).then(__webpack_require__.t.bind(__webpack_require__, 7561, 23))), 6253 modal: () => Promise.resolve(), 6254 myShoppingHelp: () => loadFeature('myShoppingHelp', () => __webpack_require__.e(/* import() | public-feature-my-shopping-help */ 631).then(__webpack_require__.t.bind(__webpack_require__, 4253, 23))), 6255 pinterest: () => loadFeature('pinterest', () => __webpack_require__.e(/* import() | public-feature-pinterest */ 796).then(__webpack_require__.t.bind(__webpack_require__, 9854, 23))), 6256 print: () => Promise.resolve(), 6257 slickstream: () => loadFeature('slickstream', () => __webpack_require__.e(/* import() | public-feature-slickstream */ 790).then(__webpack_require__.t.bind(__webpack_require__, 6944, 23))), 6258 tooltip: () => Promise.resolve(), 6259 video: () => loadFeature('video', () => __webpack_require__.e(/* import() | public-feature-video */ 939).then(__webpack_require__.t.bind(__webpack_require__, 9047, 23))) 6260}; 6261const detectFeatures = (root = document) => { 6262 if (wprm_public.settings.features_comment_ratings || hasElement('.comment-form-wprm-rating, .wprm-comment-ratings-container, .wprm-user-ratings-modal-stars', root)) { 6263 loaders.commentRating(); 6264 } 6265 if (hasElement('#wp-admin-bar-wprm-debug, [id^="wp-admin-bar-wprm-debug-entry"]', root)) { 6266 loaders.debug(); 6267 } 6268 if (hasElement('.wprm-expandable-button', root)) { 6269 loaders.expandable(); 6270 } 6271 if (hasElement('.wprm-recipe-grow', root)) { 6272 loaders.grow(); 6273 } 6274 if (hasElement('.wprm-recipe-shop-instacart', root)) { 6275 loaders.instacart(); 6276 } 6277 if (hasElement('.wprm-recipe-jump, .wprm-recipe-jump-to-comments, .wprm-recipe-jump-video, .wprm-jump-smooth-scroll, .wprm-recipe-jump-to-section', root)) { 6278 loaders.jump(); 6279 } 6280 if (hasElement('.wprm-recipe-jump-to-section-container-scroll', root)) { 6281 loaders.jumpToSection(); 6282 } 6283 if (hasElement('.wprm-recipe-media-toggle, .wprm-media-toggle-checkbox', root)) { 6284 loaders.media(); 6285 } 6286 if (hasElement('.wprm-popup-modal, [data-modal-uid]', root)) { 6287 loaders.modal(); 6288 } 6289 if (hasElement('.wprm-recipe-my-shopping-help', root)) { 6290 loaders.myShoppingHelp(); 6291 } 6292 if (hasElement('.wprm-recipe-cookpal', root)) { 6293 loaders.cookpal(); 6294 } 6295 if (hasElement('.wprm-recipe-pin', root)) { 6296 loaders.pinterest(); 6297 } 6298 if (hasElement('.wprm-recipe-print, .wprm-print-recipe-shortcode', root)) { 6299 loaders.print(); 6300 } 6301 if (hasElement('.wprm-recipe-slickstream', root)) { 6302 loaders.slickstream(); 6303 } 6304 if (hasElement('.wprm-tooltip', root)) { 6305 loaders.tooltip(); 6306 } 6307 if (wprm_public.settings.video_force_ratio && hasElement('.wprm-recipe iframe, .wprm-recipe object, .wprm-recipe video, .wprm-recipe-video-container iframe, .wprm-recipe-video-container object, .wprm-recipe-video-container video', root)) { 6308 loaders.video(); 6309 } 6310}; 6311const pendingFeatureDetectionRoots = new Set(); 6312let detectScheduled = false;
6313const scheduleFeatureDetection = (root = document) => { 6314 pendingFeatureDetectionRoots.add(root || document); 6315 if (detectScheduled) { 6316 return; 6317 } 6318 detectScheduled = true; 6319 window.setTimeout(() => { 6320 detectScheduled = false; 6321 const roots = Array.from(pendingFeatureDetectionRoots); 6322 pendingFeatureDetectionRoots.clear(); 6323 for (const detectionRoot of roots) { 6324 detectFeatures(detectionRoot); 6325 } 6326 }, 0); 6327}; 6328const observeFeatureDom = () => { 6329 if (!window.MutationObserver || !document.body) { 6330 return; 6331 } 6332 const observer = new MutationObserver(mutations => { 6333 for (const mutation of mutations) { 6334 for (const node of mutation.addedNodes) { 6335 if (node.nodeType === 1) { 6336 scheduleFeatureDetection(mutation.target); 6337 break; 6338 } 6339 } 6340 } 6341 }); 6342 observer.observe(document.body, { 6343 childList: true, 6344 subtree: true 6345 }); 6346}; 6347window.WPRecipeMaker.publicLoader = { 6348 detect: scheduleFeatureDetection, 6349 has: hasElement, 6350 load: key => loaders[key] ? loaders[key]() : Promise.resolve() 6351}; 6352public_modern_split_ready(() => { 6353 detectFeatures(); 6354 observeFeatureDom(); 6355}); 6356document.addEventListener('wprmRecipeInit', () => { 6357 scheduleFeatureDetection(); 6358}); 6359})(); 6360 6361__webpack_exports__ = __webpack_require__.O(__webpack_exports__); 6362(WPRecipeMaker = typeof WPRecipeMaker === "undefined" ? {} : WPRecipeMaker)["public-modern-split"] = __webpack_exports__; 6363/******/ })() 6364;
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.