PageSourceSearch

https://depechecode.io/wp-content/plugins/oxygen/plugin/elements/d…/interactions.umd.js?bd_ver=6.2.0-beta.9

js depechecode.io collected 2026-10-04 14:51:06 UTC 8,012 bytes, 1 lines download raw bytes

1(function(e){typeof define==`function`&&define.amd?define([],e):e()})(function(){function e(e){return e.replace(/\{random:(-?\d+),(-?\d+)}/g,(e,t,n)=>{let r=parseInt(t),i=parseInt(n),a=Math.min(r,i),o=Math.max(r,i);return Math.floor(Math.random()*(o-a+1)+a).toString()})}function t(e,t){if(e)return e.replace(/\{(\w+)(?:\s+([^\}]+))?\}/g,(e,n,r)=>{let i=t[n];return typeof i==`function`?`${i(r)}`:i||e})}function n(){let e=parseInt(getComputedStyle(document.documentElement).getPropertyValue(`--wp-admin--admin-bar--height`));return isNaN(e)?0:e}function r(e){if(!e.dataset.interactions)return[];try{let t=JSON.parse(e.dataset.interactions);if(Array.isArray(t))return t}catch(e){console.error(`Error parsing interactions:`,e)}return[]}function i(e){return Array.from(e.parentElement?.children||[]).indexOf(e)+1}function a(e,n,r,a){let o=t(a,{index:`${i(n)}`,parent_index:e=>{let t=e?n.closest(e):n.parentElement;return t?i(t):``}});return o?Array.from((()=>{switch(r){case`limit_to_this_element`:return e.querySelectorAll(o);case`closest_parent`:{let e=a?n.closest(a):null;return e?[e]:[]}case`children_of_target`:return n.querySelectorAll(o);case`everywhere`:default:return document.querySelectorAll(o)}})()):[]}function o(e,t,n,r,i){return n===`custom`?a(e,t,i,r):n===`target`?[t]:[e]}function s(e,t){return e===t||e.contains(t)}function c(e){if(!e.name)return!0;let t=e.advanced?.disable_at||[];if(!t?.length)return!1;let{getCurrentBreakpoint:n}=window.BreakdanceFrontend.utils,r=n().id;return t.includes(r)}function l(e){return e.startsWith(`.`)?e.slice(1).trim():e.trim()}function u(){}let d=`data-interaction-classes`;var f=new WeakMap,p=null;function m(){return!!document.getElementById(`breakdance_canvas`)}function h(e){let t=f.get(e);t&&(t.added.forEach(t=>{e.classList.contains(t)||e.classList.add(t)}),t.removed.forEach(t=>{e.classList.contains(t)&&e.classList.remove(t)}))}function g(e,t){m()&&(t.added.size?e.setAttribute(d,Array.from(t.added).join(` `)):e.removeAttribute(d))}function _(e){p||=new MutationObserver(e=>{e.forEach(e=>h(e.target))}),p.observe(e,{attributes:!0,attributeFilter:[`class`]})}function v(e){let t=f.get(e);return t||(t={added:new Set,removed:new Set},f.set(e,t),m()&&_(e)),t}function y(e,t){let n=v(e);n.removed.has(t)?n.removed.delete(t):e.classList.contains(t)||n.added.add(t),e.classList.add(t),g(e,n)}function b(e,t){let n=v(e);n.added.has(t)?n.added.delete(t):e.classList.contains(t)&&n.removed.add(t),e.classList.remove(t),g(e,n)}function x(e,t){e.classList.contains(t)?b(e,t):y(e,t)}function S(e,t,n){n?.css_class&&y(t,l(n.css_class))}function C(e,t,n){n?.css_class&&b(t,l(n.css_class))}function w(e,t,n){n?.css_class&&x(t,l(n.css_class))}function T(e,t,n){t.style.display=`none`}function E(e,t,n){t.style.display===`none`&&(t.style.display=``),getComputedStyle(t).display===`none`&&(t.style.display=n?.display||`block`)}function D(t,n,r){let i=r?.variable_name?.replace(`--`,``);if(r?.variable_value===void 0||r?.variable_value===null){n.style.removeProperty(`--${i}`);return}let a=e(r.variable_value);n.style.setProperty(`--${i}`,a)}function O(t,n,r){if(!r?.attribute_name)return;let i=e(r.attribute_value||``);n.setAttribute(r.attribute_name,i)}function k(e,t,n){n?.attribute_name&&t.removeAttribute(n.attribute_name)}function A(e,t,r){let i=r?.scroll_offset||0,a=r?.scroll_delay||{number:0,style:`0`,unit:`ms`},o=n(),s=a.number||0,c=a.unit===`s`?s*1e3:s;setTimeout(()=>{let e=t.getBoundingClientRect().top+window.scrollY;window.scrollTo({top:e-i-o,behavior:`smooth`})},c)}function j(e,t,n){if(!n?.js_function_name)return;let r=window[n.js_function_name];if(!r){console.log(`[INTERACTIONS] Function ${n.js_function_name} not found.`);return}r(e,t,n)}function M(e,t,n){t.focus()}function N(e,t,n){t.blur()}var P=class{constructor(){this.actionMap=new Map([[`add_class`,S],[`remove_class`,C],[`toggle_class`,w],[`hide_element`,T],[`show_element`,E],[`set_variable`,D],[`set_attribute`,O],[`remove_attribute`,k],[`scroll_to`,A],[`focus`,M],[`blur`,N],[`javascript_function`,j]])}getActionByName(e){let t=this.actionMap.get(e);return t?t.bind(this):(console.error(`Action ${e} not found.`),null)}runAction(e,t,n,r){if(c(r))return;let i=this.getActionByName(r.name);
1i&&o(n,t,r.target,r.css_selector,r.match).forEach(t=>{console.debug(`Running action:`,r.name,`on element "${t.classList[0]}"`,r),i(e,t,r)})}},F=new class{constructor(){this.actions=new P,this.listeners=new Map([]),this.triggerMap=new Map([[`click`,this.handleClick],[`mouse_enter`,this.handleMouseEnter],[`mouse_leave`,this.handleMouseLeave],[`scroll_into_view`,this.handleScrollIntoView],[`scroll_out_of_view`,this.handleScrollOutOfView],[`page_loaded`,this.handlePageLoaded],[`page_scrolled`,this.handlePageScrolled],[`key_down`,this.handleKeyDown],[`key_up`,this.handleKeyUp]]),[`click`,`mouseenter`,`mouseleave`,`scroll`,`keydown`,`keyup`].forEach(e=>this.listen(e))}getTriggerByName(e){let t=this.triggerMap.get(e);return t?t.bind(this):(console.error(`Trigger ${e} not found.`),null)}on(e,t){let n=this.listeners.get(e)||[];n.push(t),this.listeners.set(e,n)}off(e,t){let n=this.listeners.get(e)||[];this.listeners.set(e,n.filter(e=>e.fn!==t.fn))}listen(e){let t=[`scroll`].includes(e);document.addEventListener(e,n=>{let r=this.listeners.get(e)||[];r.length&&r.forEach(({node:e,fn:r})=>{!t&&!s(e,n.target)||r(n)})},{capture:!0})}handleClick(e,t,n){let r=!1,i=i=>{e?.advanced?.run_only_once&&r||(this.actions.runAction(i,n,t,e),r=!0)};return this.on(`click`,{node:n,fn:i}),()=>{this.off(`click`,{node:n,fn:i})}}handleMouseEnter(e,t,n){let r=!1,i=i=>{i.target===n&&(e?.advanced?.run_only_once&&r||(this.actions.runAction(i,n,t,e),r=!0))};return this.on(`mouseenter`,{node:n,fn:i}),()=>{this.off(`mouseenter`,{node:n,fn:i})}}handleMouseLeave(e,t,n){let r=!1,i=i=>{i.target===n&&(e?.advanced?.run_only_once&&r||(this.actions.runAction(i,n,t,e),r=!0))};return this.on(`mouseleave`,{node:n,fn:i}),()=>{this.off(`mouseleave`,{node:n,fn:i})}}handleScrollIntoView(e,t,n){let r=!1,i={threshold:e.threshold||.5},a=new IntersectionObserver(i=>{i.forEach(i=>{i.isIntersecting&&(this.actions.runAction(i,n,t,e),r=!0),e?.advanced?.run_only_once&&r&&a.disconnect()})},i);return a.observe(n),()=>{a.disconnect()}}handleScrollOutOfView(e,t,n){let r=!1,i={threshold:e.threshold||.5},a=new IntersectionObserver(i=>{i.forEach(i=>{i.isIntersecting||(this.actions.runAction(i,n,t,e),r=!0),e?.advanced?.run_only_once&&r&&a.disconnect()})},i);return a.observe(n),()=>{a.disconnect()}}handlePageLoaded(e,t,n){return this.actions.runAction(void 0,t,t,e),()=>{}}handlePageScrolled(e,t,n){let r=0,i=!1,a=a=>{e?.advanced?.run_only_once&&i||(window.scrollY>r&&(this.actions.runAction(a,n,t,e),i=!0),r=window.scrollY)};return this.on(`scroll`,{node:n,fn:a}),()=>{this.off(`scroll`,{node:n,fn:a})}}handleKeyDown(e,t,n,r){let i=!1,a=r.shift_key,o=r.ctrl_key,s=s=>{let c=s.key.toLowerCase()===r.key?.toLowerCase();a&&!s.shiftKey||o&&!s.ctrlKey||e?.advanced?.run_only_once&&i||(!r.key||c)&&(this.actions.runAction(s,n,t,e),i=!0)};return this.on(`keydown`,{node:n,fn:s}),()=>{this.off(`keydown`,{node:n,fn:s})}}handleKeyUp(e,t,n,r){let i=!1,a=r.shift_key,o=r.ctrl_key,s=s=>{let c=s.key.toLowerCase()===r.key?.toLowerCase();a&&!s.shiftKey||o&&!s.ctrlKey||e?.advanced?.run_only_once&&i||(!r.key||c)&&(this.actions.runAction(s,n,t,e),i=!0)};return this.on(`keyup`,{node:n,fn:s}),()=>{this.off(`keyup`,{node:n,fn:s})}}},I=new Map;function L(e){return F.getTriggerByName(e)||window[e]||u}function R(e){let t=e.target;I.has(t)&&(I.get(t)?.filter(Boolean)?.forEach(e=>e()),I.delete(t)),B(t)}function z(e,t){let{trigger:n,target:r,css_selector:i,match:a,actions:s}=t;if(!n)return;let c=o(e,e,r,i,a),l=L(n);c.forEach(n=>{let r=[...I.get(e)||[]];s?.forEach(i=>{let a=l(i,e,n,t);r.push(a)}),I.set(e,r)})}function B(e){r(e).forEach(t=>z(e,t))}function V(){Array.from(document.querySelectorAll(`[data-interactions]`)).forEac
1h(e=>B(e))}addEventListener(`breakdance_refresh_interactions`,R),document.addEventListener(`DOMContentLoaded`,()=>V())});

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.