!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).SplitType=e()}(this,function(){"use strict";function t(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,i=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{},n=c(e);return void 0!==n.types?t=n.types:void 0!==n.split&&(t=n.split),void 0!==t&&(n.types=(h(t)||d(t)?String(t):"").split(",").map(function(t){return String(t).trim()}).filter(function(t){return/((line)|(word)|(char))/i.test(t)})),(n.absolute||n.position)&&(n.absolute=n.absolute||/absolute/.test(e.position)),n}function p(t){var e=h(t)||d(t)?String(t):"";return{none:!e,lines:/line/i.test(e),words:/word/i.test(e),chars:/char/i.test(e)}}function f(t){return null!==t&&"object"==typeof t}function y(t){return f(t)&&/^(1|3|11)$/.test(t.nodeType)}function m(t){return d(t)?t:null==t?[]:function(t){return f(t)&&function(t){return"number"==typeof t&&t>-1&&t%1==0}(t.length)}(t)?Array.prototype.slice.call(t):[t]}function g(t){var e=t;return h(t)&&(e=/^(#[a-z]\w+)$/.test(t.trim())?document.getElementById(t.trim().slice(1)):document.querySelectorAll(t)),m(e).reduce(function(t,e){return[].concat(s(t),s(m(e).filter(y)))},[])}!function(){function t(){for(var t=arguments.length,e=0;e1&&void 0!==arguments[1]?arguments[1]:" ";return(t?String(t):"").trim().replace(/\s+/g," ").split(e)}(r).reduce(function(t,n,r,c){var d,u;return i.chars&&(u=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(t=function(t){return null==t?"":String(t)}(t))&&h(t)&&!e&&z(t)?function(t){return z(t)?function(t){return t.match(B)||[]}(t):function(t){return t.split("")}(t)}(t):t.split(e)}(n).map(function(t){var n=F(o,{class:"".concat(e.splitClass," ").concat(e.charClass),style:"display: inline-block;",children:t});return E(n,"isChar",!0),l=[].concat(s(l),[n]),n})),i.words||i.lines?(E(d=F(o,{class:"".concat(e.wordClass," ").concat(e.splitClass),style:"display: inline-block; ".concat(i.words&&e.absolute?"position: relative;":""),children:i.chars?u:n}),{isWord:!0,isWordStart:!0,isWordEnd:!0}),a.appendChild(d)):u.forEach(function(t){a.appendChild(t)}),r=O)&&(u=p,h.push(d=[])),d.push(i)),e.absolute&&E(i,{top:p,left:f,width:l,height:c}))}),y&&y.removeChild(t),a.lines&&(f=h.map(function(t){var n=F(l,{class:"".concat(e.splitClass," ").concat(e.lineClass),style:"display: block; text-align: ".concat(b,"; width: 100%;")});E(n,"isLine",!0);var i={height:0,top:1e4};return w.appendChild(n),t.forEach(function(t,e,o){var r=S(t),s=r.isWordEnd,a=r.top,l=r.height,c=o[e+1];i.height=Math.max(i.height,l),i.top=Math.min(i.top,a),n.appendChild(t),s&&S(c).isWordStart&&n.append(" ")}),e.absolute&&E(n,{height:i.height,top:i.top}),n}),a.words||J(w),t.replaceChildren(w)),e.absolute&&(t.style.width="".concat(t.style.width||o,"px"),t.style.height="".concat(i,"px"),m(c).forEach(function(t){var e=S(t),n=e.isLine,i=e.top,o=e.left,r=e.width,a=e.height,l=S(t.parentElement),c=!n&&l.isLine;t.style.top="".concat(c?i-l.top:i,"px"),t.style.left="".concat(n?s.left:o-(c?s.left:0),"px"),t.style.height="".concat(a,"px"),t.style.width="".concat(n?s.width:r,"px"),t.style.position="absolute"})),y&&(g?y.insertBefore(t,g):y.appendChild(t)),f}(t,e.settings,n);e.lines=[].concat(s(e.lines),s(o))}}),this.isSplit=!0,window.scrollTo(n[0],n[1]),w(b).forEach(function(t){var e=r(t,2),n=e[0],i=e[1],o=i.isRoot,s=i.isSplit;o&&s||(b[n]=null,delete b[n])}))}},{key:"revert",value:function(){this.isSplit&&(this.lines=null,this.words=null,this.chars=null,this.isSplit=!1),t.revert(this.elements)}}]),t}()}),function(t){"use strict";function e(t){this.$el=t,this.$markers=this.$el.find(".nectar-text-inline-images__marker"),this.animationNodes=[],this.animationType="none",this.splitTypeInstance=null,this.isScrolling=!1,this.viewportHeight=window.innerHeight||document.documentElement.clientHeight,this.containerHeight=this.$el.height(),this.containerRect=this.$el[0].getBoundingClientRect(),this.disableOnMobile=!1,this.rafID=null,this.positionImages(),this.init(),this.events()}e.prototype.init=function(){this.$el.hasClass("nectar-text-inline-images--animation_scroll_fade")?this.animationType="scroll_fade":this.$el.hasClass("nectar-text-inline-images--animation_circle_reveal")?this.animationType="circle_reveal":this.$el.hasClass("nectar-text-inline-images--animation_circle_fade_in")?this.animationType="circle_fade_in":this.animationType="none",this.$el.hasClass("nectar-text-inline-images--rm-mobile-animation")&&navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)&&(this.disableOnMobile=!0),this.animationSetup(),"scroll_fade"===this.animationType&&this.scrollFadeAnimation()},e.prototype.destroy=function(){if(this.stopAnimationLoop(),this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.waypoints&&(Array.isArray(this.waypoints)?this.waypoints.forEach(function(t){t&&"function"==typeof t.destroy&&t.destroy()}):"function"==typeof this.waypoints.destroy&&this.waypoints.destroy(),this.waypoints=null),this.splitTypeInstance&&(this.splitTypeInstance.revert(),this.splitTypeInstance=null),this.resizeHandler)if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)){window.matchMedia("(orientation: portrait)").removeEventListener("change",this.resizeHandler)}else t(window).off("resize",this.resizeHandler);this.waypointHandler&&t(window).off("nectar-waypoints-reinit",this.waypointHandler),this.delayedJsHandler&&t(window).off("salient-delayed-js-loaded",this.delayedJsHandler),this.animationNodes=[]},e.prototype.animationSetup=function(){const e=this.$el[0].querySelector(".nectar-text-inline-images__inner");let n=e;if("scroll_fade"===this.animationType){var i=this.$el.find("h1, h2, h3, h4, h5, h6");if(i.length>0){const t=i[0];let o=e.innerHTML;o=o.replace(/<\/?h[1-6][^>]*>/gi,""),e.innerHTML=`<${t.tagName}>${o}`,n=e.querySelector(t.tagName)}this.disableOnMobile||(this.splitTypeInstance=new SplitType(n,{types:"lines, words"}),this.animationNodes=Array.from(n.querySelectorAll(".word, .nectar-text-inline-images__marker")),this.$markers=this.$el.find(".nectar-text-inline-images__marker"),e.querySelectorAll("[data-calculated-width]").forEach(function(t){t.classList.add("no-transition"),t.style.width=0}),setTimeout(function(){e.querySelectorAll(".no-transition").forEach(function(t){t.classList.remove("no-transition")})},50)),t(window).trigger("salient-lazyloading-image-reinit")}},e.prototype.scrollFadeAnimation=function(){this.intersectionObserver=new IntersectionObserver(([t])=>{t.isIntersecting&&!this.disableOnMobile?(this.updateMeasurements(),this.initialElementTop=this.containerRect.top,this.initialScrollY=window.scrollY||document.documentElement.scrollTop,this.startAnimationLoop()):this.stopAnimationLoop()},{threshold:0,rootMargin:"400px 0px 400px 0px"}),this.intersectionObserver.observe(this.$el[0])},e.prototype.startAnimationLoop=function(){this.rafID||(this.rafID=requestAnimationFrame(this.onScroll.bind(this)))},e.prototype.stopAnimationLoop=function(){this.rafID&&(cancelAnimationFrame(this.rafID),this.rafID=null)},e.prototype.onScroll=function(){if(window.nectarState&&window.nectarState.materialOffCanvasOpen)return void requestAnimationFrame(()=>this.onScroll());const t=this.containerRect.height,e=this.viewportHeight,n=window.scrollY||document.documentElement.scrollTop,i=n-(this.initialScrollY||0),o=this.initialElementTop-i,r=0===n;let s=r?0:(e-o-(r?0:.2*e))/((e+t-.9*e)*(r?1.5:1));s=Math.min(Math.max(s,0),1),this.animationNodes.forEach((t,e)=>{const n=(e+1)/this.animationNodes.length;s>=n?t.classList.contains("visible")||(t.classList.contains("nectar-text-inline-images__marker")&&(t.style.width=t.getAttribute("data-calculated-width")),t.classList.add("visible")):t.classList.contains("visible")&&(t.classList.remove("visible"),t.classList.contains("nectar-text-inline-images__marker")&&(t.classList.remove("no-transition"),t.style.width=0))}),this.rafID=requestAnimationFrame(this.onScroll.bind(this))},e.prototype.positionImages=function(){this.splitTypeInstance&&this.splitTypeInstance.revert(),this.$markers=this.$el.find(".nectar-text-inline-images__marker"),this.$markers.each(function(e){var n=t(this).find("img").length>0?"img":"video";if("video"==n){var i=t(this).height();t(this).find(n).css({width:1.7*i+"px"})}var o=t(this).find(n);if(o.length>0){var r=o[0].getBoundingClientRect();t(this)[0].setAttribute("data-calculated-width",r.width+"px"),t(this)[0].style.width=r.width+"px"}}),this.$el.addClass("nectar-text-inline-images--calculated")},e.prototype.events=function(){if(this.resizeHandler=this.resizeCallback.bind(this),this.waypointHandler=this.waypoint.bind(this),this.delayedJsHandler=this.waypoint.bind(this),navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)){window.matchMedia("(orientation: portrait)").addEventListener("change",this.resizeHandler)}else t(window).on("resize",this.resizeHandler);"scroll_fade"===this.animationType&&this.$el.offset().top>window.scrollY+window.innerHeight&&setTimeout(()=>{this.resizeCallback.bind(this)},200),t(window).on("nectar-waypoints-reinit",this.waypointHandler),window.Waypoint?this.waypoint():t(window).on("salient-delayed-js-loaded",this.delayedJsHandler)},e.prototype.updateMeasurements=function(){this.viewportHeight=window.innerHeight||document.documentElement.clientHeight,this.containerHeight=this.$el.height(),this.containerRect=this.$el[0].getBoundingClientRect()},e.prototype.resizeCallback=function(){this.positionImages(),this.animationSetup(),this.rafID&&(this.updateMeasurements(),this.initialElementTop=this.containerRect.top,this.initialScrollY=window.scrollY||document.documentElement.scrollTop)},e.prototype.waypoint=function(){this.waypoints&&(Array.isArray(this.waypoints)?this.waypoints.forEach(function(t){t&&"function"==typeof t.destroy&&t.destroy()}):"function"==typeof this.waypoints.destroy&&this.waypoints.destroy());var e=[],n=this;this.$el.hasClass("nectar-text-inline-images--stagger-animation")?e=new Waypoint({element:n.$el[0],handler:function(){n.$markers.each(function(e){var n=t(this);setTimeout(function(){n.addClass("animated-in")},150*e)}),e.destroy()},offset:"bottom-in-view"}):this.$markers.each(function(n){var i=t(this);e[n]=new Waypoint({element:t(this)[0],handler:function(){i.addClass("animated-in"),e[n].destroy()},offset:"bottom-in-view"})}),this.waypoints=e};var n,i=[],o=[];function r(){i.length>0&&i.forEach(function(t){t&&"function"==typeof t.destroy&&t.destroy()}),o.length>0&&o.forEach(function(t){t&&"function"==typeof t.disconnect&&t.disconnect()}),i=[],o=[];var n=void 0!==window.vc_iframe;t(".nectar-text-inline-images").each(function(r){var s,a,l;0==n&&"IntersectionObserver"in window?(s=t(this),a=r,(l=new IntersectionObserver(function(t){t.forEach(function(t){t.isIntersecting&&(i[a]=new e(s),l.unobserve(t.target))})},{rootMargin:"300px 0px 300px 0px",threshold:0})).observe(s[0]),o[a]=l):i[r]=new e(t(this))})}r(),t(window).on("vc_reload",function(){n&&clearTimeout(n),n=setTimeout(function(){r(),n=null},500)})}(jQuery);