// source --> https://kilaucreations.com/wp-content/plugins/marquee-addons-for-elementor/assets/js/marquee-track-fill.min.js?ver=3.9.80 
(function(t,e){"use strict";const n=50;const i=["deensimc-image-marquee"];const r=new Map;let o=null;let c=false;function a(){clearTimeout(o);o=setTimeout(q,100)}function s(t){return i.some(e=>t.classList.contains(e))}function u(e){if(!s(e)){return false}const n=t(e).find("img");let i=false;n.each((e,n)=>{const r=t(n);if(n.complete){return}i=true;const o="load.deensimcTrackFill error.deensimcTrackFill";r.off(".deensimcTrackFill").one(o,()=>{a()})});return i}function l(t,e){return e?t.scrollHeight:t.scrollWidth}function d(t){t.setAttribute("aria-hidden","true")}function f(t,e){return t.map(t=>{const n=t.cloneNode(true);if(e){d(n)}return n})}function m(t,e){return t.children(e).filter((t,e)=>e.getAttribute("aria-hidden")!=="true").toArray().map(t=>t.cloneNode(true))}function h(t,e){const n=e?t.outerHeight():t.outerWidth();const i=e?1440:2560;const r=t.hasClass("deensimc-marquee-on-scroll");const o=n*(r?2:1.1);return Number.isFinite(o)&&o>0?o:i}function g(e){const i=t(e);const r=i.hasClass("deensimc-marquee-vertical");const o=Number(i.data("track-target-horizontal"));const c=Number(i.data("track-target-vertical"));const a=h(i,r);const s=Number(i.data("track-vertical-base-size"))||a;const u=r?c>0?c/100*s:s:o||a;return{itemSelector:i.data("track-item-selector"),targetSize:u,maxDuplicationRounds:Number(i.data("track-max-duplication-rounds"))||n,isVertical:r}}function p(t){const e=t.eq(0);const n=t.eq(1);if(!e.length||!n.length){return}const i=e.children().toArray().map(t=>{const e=t.cloneNode(true);d(e);return e});n.empty().append(i)}function w(t,e){const n=t.get(0);const i=m(t,e.itemSelector);if(!n||!i.length){return}t.empty().append(f(i,false));const r=l(n,e.isVertical);if(!r||r<=0||!e.targetSize||e.targetSize<=0){return}let o=0;while(l(n,e.isVertical)<e.targetSize&&o<e.maxDuplicationRounds){t.append(f(i,true));o+=1}}function k(e){const n=g(e);const i=t(e);const r=t(e).find(".deensimc-marquee-track");const o=r.eq(0);if(!r.length||!n.itemSelector||i.hasClass("deensimc-marquee-stop")){return}if(u(e)){return}w(o,n);if(r.length>1){p(r)}if(typeof window.initTextLengthToggle==="function"){window.initTextLengthToggle(t(e))}}function q(){r.forEach((e,n)=>{if(!document.body.contains(n)){r.delete(n);return}k(n);if(typeof window.handleAnimationDuration==="function"){window.handleAnimationDuration(t(n))}})}function y(){if(c){return}t(window).on("resize",()=>{a()});c=true}function T(t){const e=t.filter('.deensimc-marquee-main-container[data-track-fill="yes"]').add(t.find('.deensimc-marquee-main-container[data-track-fill="yes"]'));if(!e.length){return}e.each((t,e)=>{r.set(e,true);k(e)});y()}window.autoRegisterTrackFillFromScope=T})(jQuery,window._);
// source --> https://kilaucreations.com/wp-content/plugins/marquee-addons-for-elementor/assets/js/handle-animation-duration.min.js?ver=3.9.80 
(function(e,n){"use strict";function t(n){if(typeof window.autoRegisterTrackFillFromScope==="function"){window.autoRegisterTrackFillFromScope(n)}const t=n.filter(".deensimc-marquee-main-container").add(n.find(".deensimc-marquee-main-container"));const i=n.filter(".deensimc-marquee-track").add(n.find(".deensimc-marquee-track"));const a=t.data("is-marquee-on")??true;const c=t.data("marquee-speed");const o=i.closest(".deensimc-marquee-vertical").length>0;if(a&&i.length){let n=0;i.each((e,t)=>{n+=o?t.scrollHeight:t.scrollWidth});const t=10;const a=c*t;const r=n/a;i.each((n,t)=>{e(t).css("animation-duration",`${r}s`)})}}window.handleAnimationDuration=t})(jQuery,window._);
// source --> https://kilaucreations.com/wp-content/plugins/marquee-addons-for-elementor/assets/js/initTextLengthToggle.min.js?ver=3.9.80 
(function(t,e){"use strict";function n(t){if(typeof t!=="string")return"";return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function a(t,e,n){return t.split(n?"":" ").slice(0,e).join(n?"":" ")+"..."}function i(t,e){const n=t.find(".deensimc-contents");const a=t.find(".deensimc-toggle").first();const i=t.attr("data-full-text");const c=t.attr("data-truncated-text");if(!i||!c||!a.length||!n.length){return}n.html(e?i:c);t.attr("data-is-expanded",e?"true":"false");a.find(".fold-text").toggle(!e);a.find(".unfold-text").toggle(e)}function c(e){const c=e.find(".contents-wrapper");if(c.length){c.each(function(){const e=t(this);const c=e.find(".deensimc-contents");const r=e.find(".deensimc-toggle").first();if(!c.length||!r.length){return}const s=parseInt(e.data("visible-length"),10);const d=e.data("limit-by")==="characters";const o=n(String(e.attr("data-full-text")||c.text()).trim());if(!s||!o){return}e.attr("data-full-text",o);e.attr("data-truncated-text",a(o,s,d));if(typeof e.attr("data-is-expanded")==="undefined"){e.attr("data-is-expanded","false")}i(e,e.attr("data-is-expanded")==="true");r.off("click.deensimcTextToggle").on("click.deensimcTextToggle",function(){const e=t(this).closest(".contents-wrapper");const n=e.attr("data-is-expanded")==="true";i(e,!n)})})}}window.initTextLengthToggle=c})(jQuery,window._);
// source --> https://kilaucreations.com/wp-content/plugins/sticky-header-effects-for-elementor/assets/js/she-header.js?ver=2.1.9 
var $j = jQuery.noConflict();

$j(document).ready(function () {
    "use strict";
    // She header
    sheHeader();

    $j(window).on('resize', function (e) {
        sheHeader(e);
    });
});


/* ==============================================
HEADER EFFECTS
============================================== */


function sheHeader(e) {
   
    var header = $j('.elementor-element.she-header-yes'),
        container = $j('.she-header-yes .elementor-container, .elementor-element.she-header-yes.e-con'),
        header_elementor = $j('.elementor-edit-mode .she-header-yes'),
        header_logo = $j('.she-header-yes .elementor-widget-theme-site-logo img:not(.elementor-widget-n-menu img), .she-header-yes .elementor-widget-image img:not(.elementor-widget-n-menu img)'),
        header_logo_div = $j('.she-header-yes .elementor-widget-theme-site-logo a::after, .she-header-yes .elementor-widget-image a::after');
    data_settings = header.data('settings');

    if (typeof data_settings != 'undefined') {
        var responsive_settings = data_settings["transparent_on"];
        var width = $j(window).width(),
            header_height = header.height(),
            logo_width = header_logo.width(),
            logo_height = header_logo.height();
    }

    // Check responsive is enabled
    if (typeof width != 'undefined' && width) {
        if (width >= 1025) {
            var enabled = "desktop";
        } else if (width > 767 && width < 1025) {
            var enabled = "tablet";
        } else if (width <= 767) {
            var enabled = "mobile";
        }
    }

    if ($j.inArray(enabled, responsive_settings) != '-1') {

        var scroll_distance = data_settings["scroll_distance"];
        var she_offset = data_settings["she_offset_top"];
        var she_padding = data_settings["she_padding"];
        var she_width = data_settings["she_width"];
        var transparent_header = data_settings["transparent_header_show"];
        var background = data_settings["background"];
        var bottom_border_color = data_settings["custom_bottom_border_color"],
            bottom_border_view = data_settings["bottom_border"],
            bottom_border_width = data_settings["custom_bottom_border_width"];

        var shrink_header = data_settings["shrink_header"],
            data_height = data_settings["custom_height_header"],
            data_height_tablet = data_settings["custom_height_header_tablet"],
            data_height_mobile = data_settings["custom_height_header_mobile"];

        var shrink_logo = data_settings["shrink_header_logo"],
            data_logo_height = data_settings["custom_height_header_logo"],
            data_logo_height_tablet = data_settings["custom_height_header_logo_tablet"],
            data_logo_height_mobile = data_settings["custom_height_header_logo_mobile"];

        var change_logo_color = data_settings["change_logo_color"];

        var blur_bg = data_settings["blur_bg"];

        var scroll_distance_hide_header = data_settings["scroll_distance_hide_header"];

        // offset
        if (width >= 1025) {
            she_offset = data_settings["she_offset_top"];
            she_padding = data_settings["she_padding"];
            she_width = data_settings["she_width"];
        } else if (width > 767 && width < 1025) {
            she_offset = data_settings["she_offset_top_tablet"];
            she_padding = data_settings["she_padding_tablet"];
            she_width = data_settings["she_width_tablet"];
        } else if (width <= 767) {
            she_offset = data_settings["she_offset_top_mobile"];
            she_padding = data_settings["she_padding_mobile"];
            she_width = data_settings["she_width_mobile"];
        }

        if (header.hasClass("she-header")) {
            if( e?.type === 'resize' ){
                header.css("width", she_width.size + she_width.unit);
                header.css("padding-top", she_padding.top + she_padding.unit);
                header.css("padding-bottom", she_padding.bottom + she_padding.unit);
                header.css("padding-left", she_padding.left + she_padding.unit);
                header.css("padding-right", she_padding.right + she_padding.unit);
            }
        }

        // add transparent class
        if (transparent_header == "yes") {
            header.addClass('she-header-transparent-yes');
        }

        // header height shrink
        if (typeof data_height != "undefined" && data_height) {
            if (width >= 1025) {
                var shrink_height = data_height["size"];
            } else if (width > 767 && width < 1025) {
                var shrink_height = data_height_tablet["size"];
                if (shrink_height == "") {
                    shrink_height = data_height["size"];
                }
            } else if (width <= 767) {
                var shrink_height = data_height_mobile["size"];
                if (shrink_height == "") {
                    shrink_height = data_height["size"];
                }
            }
        }

        // Logo height shrink
        if (
            typeof data_logo_height != "undefined" &&
            data_logo_height
        ) {
            if (width >= 1025) {
                var shrink_logo_height = data_logo_height["size"];
            } else if (width > 767 && width < 1025) {
                var shrink_logo_height =
                    data_logo_height_tablet["size"];
            } else if (width <= 767) {
                var shrink_logo_height =
                    data_logo_height_mobile["size"];
            }

            //Calc New width and height
            if (shrink_logo_height == "") {
                //Get logo shrink settings from desktop
                shrink_logo_height = data_logo_height["size"];

                if (shrink_logo_height == "") {
                    // Shrink same settings from height shrink option
                    shrink_logo_height = shrink_height;

                    var percent =
                        parseInt(shrink_logo_height) /
                        parseInt(header_height),
                        width_l = logo_width * percent,
                        height_l = logo_height * percent;
                } else {
                    var width_l =
                        (logo_width * shrink_logo_height) / 100,
                        height_l =
                            (logo_height * shrink_logo_height) / 100;
                }
            } else {
                //Get logo shrink settings from the responsive option
                var width_l = (logo_width * shrink_logo_height) / 100,
                    height_l = (logo_height * shrink_logo_height) / 100;
            }
        }

        // border bottom
        if (typeof bottom_border_width != 'undefined' && bottom_border_width) {
            var bottom_border = bottom_border_width["size"] + "px solid " + bottom_border_color;
        }

        // hide header on scroll
        if (
            typeof scroll_distance_hide_header != "undefined" &&
            scroll_distance_hide_header
        ) {
            var mywindow = $j(window),
                mypos = mywindow.scrollTop();

            mywindow.scroll(function () {
                var sd_hh_s = scroll_distance_hide_header["size"],
                    sd_hh_u = scroll_distance_hide_header["unit"],
                    sd_hh_tablet =
                        data_settings[
                        "scroll_distance_hide_header_tablet"
                        ],
                    sd_hh_tablet_s = sd_hh_tablet["size"],
                    sd_hh_tablet_u = sd_hh_tablet["unit"],
                    sd_hh_mobile =
                        data_settings[
                        "scroll_distance_hide_header_mobile"
                        ],
                    sd_hh_mobile_s = sd_hh_mobile["size"],
                    sd_hh_mobile_u = sd_hh_mobile["unit"];

                // get responsive view
                if (
                    typeof scroll_distance_hide_header != "undefined" &&
                    scroll_distance_hide_header
                ) {
                    if (width >= 1025) {
                        var sd_hh = sd_hh_s,
                            sd_hh_u = sd_hh_u;
                        // calc sise for vh unit
                        if (sd_hh_u == "vh") {
                            sd_hh = window.innerHeight * (sd_hh / 100);
                        }
                    } else if (width > 767 && width < 1025) {
                        var sd_hh = sd_hh_tablet_s,
                            sd_hh_u = sd_hh_tablet_u;

                        if (sd_hh == "") {
                            sd_hh = sd_hh_s;
                        }
                        // calc sise for vh unit
                        if (sd_hh_u == "vh") {
                            sd_hh = window.innerHeight * (sd_hh / 100);
                        }
                    } else if (width <= 767) {
                        var sd_hh = sd_hh_mobile_s,
                            sd_hh_u = sd_hh_mobile_u;

                        if (sd_hh == "") {
                            sd_hh = sd_hh_s;
                        }
                        // calc sise for vh unit
                        if (sd_hh_u == "vh") {
                            sd_hh = window.innerHeight * (sd_hh / 100);
                        }
                    }
                }

                // added option for vh unit
                //if(sd_hh_u == 'px'){
                //	sd_hh  = sd_hh_s;
                //} else {
                //	sd_hh  = (window.innerHeight)*(sd_hh_s/100);
                //}

                if (mypos > sd_hh) {
                    if (mywindow.scrollTop() > mypos) {
                        header.addClass("headerup");
                    } else {
                        header.removeClass("headerup");
                    }
                }
                mypos = mywindow.scrollTop();
            });
        }

        // scroll function
        $j(window).on("load scroll", function (e) {
            var scroll = $j(window).scrollTop();

            if (header_elementor) {
                header_elementor.css("position", "relative");
            }

            var sd_s = scroll_distance["size"],
                sd_u = scroll_distance["unit"],
                sd_tablet = data_settings["scroll_distance_tablet"],
                sd_tablet_s = sd_tablet["size"],
                sd_tablet_u = sd_tablet["unit"],
                sd_mobile = data_settings["scroll_distance_mobile"],
                sd_mobile_s = sd_mobile["size"],
                sd_mobile_u = sd_mobile["unit"];

            // get responsive view
            if (
                typeof scroll_distance != "undefined" &&
                scroll_distance
            ) {
                if (width >= 1025) {
                    var sd = sd_s,
                        sd_u = sd_u;
                    // calc sise for vh unit
                    if (sd_u == "vh") {
                        sd = window.innerHeight * (sd / 100);
                    }
                } else if (width > 767 && width < 1025) {
                    var sd = sd_tablet_s,
                        sd_u = sd_tablet_u;

                    if (sd == "") {
                        sd = sd_s;
                    }
                    // calc sise for vh unit
                    if (sd_u == "vh") {
                        sd = window.innerHeight * (sd / 100);
                    }
                } else if (width <= 767) {
                    var sd = sd_mobile_s,
                        sd_u = sd_mobile_u;

                    if (sd == "") {
                        sd = sd_s;
                    }
                    // calc sise for vh unit
                    if (sd_u == "vh") {
                        sd = window.innerHeight * (sd / 100);
                    }
                }
            }

            if (scroll >= scroll_distance["size"]) {
                header.removeClass('header').addClass("she-header");
                header.css("background-color", background);
                header.css("border-bottom", bottom_border);

                header.css("top", she_offset.size + she_offset.unit);

                if (width >= 768) {
                    if (document.body.classList.contains('admin-bar')) {
                        header.css("top", (32 + she_offset.size) + she_offset.unit);
                    }
                }

                header.css("padding-top", she_padding.top + she_padding.unit);
                header.css("padding-bottom", she_padding.bottom + she_padding.unit);
                header.css("padding-left", she_padding.left + she_padding.unit);
                header.css("padding-right", she_padding.right + she_padding.unit);
                header.css("width", she_width.size + she_width.unit);
                // header.attr("style", "width: " + she_width.size + she_width.unit + " !important;");
                // header.css("width", she_width.size + she_width.unit);

                header.removeClass('she-header-transparent-yes');

                if (shrink_header == "yes") {
                    header.css({ "padding-top": "0", "padding-bottom": "0", "margin-top": "0", "margin-bottom": "0" });
                    container.css({ "min-height": shrink_height, "transition": "all 0.4s ease-in-out", "-webkit-transition": "all 0.4s ease-in-out", "-moz-transition": "all 0.4s ease-in-out" });
                }

                if (change_logo_color == "yes") {
                    header_logo.addClass("change-logo-color");
                }

                // ---------------------------------- SHRINK LOGO
                if (shrink_logo == "yes") {
                    header_logo.css({
                        width: width_l,
                        transition: "all 0.4s ease-in-out",
                        "-webkit-transition": "all 0.4s ease-in-out",
                        "-moz-transition": "all 0.4s ease-in-out",
                    });
                }

            } else {
                header.removeClass("she-header").addClass('header');
                header.css("background-color", "");
                header.css("border-bottom", "");
                header.css("top", "");
                header.css("padding-top", "");
                header.css("padding-bottom", "");
                header.css("padding-left", "");
                header.css("padding-right", "");
                header.css("width", "");

                if (transparent_header == "yes") {
                    header.addClass('she-header-transparent-yes');
                }
                if (shrink_header == "yes") {
                    header.css({ "padding-top": "", "padding-bottom": "", "margin-top": "", "margin-bottom": "" });
                    container.css("min-height", "");
                }

                // ---------------------------------- SHRINK LOGO
                if (shrink_logo == "yes") {
                    header_logo.css({ height: "", width: "" });
                }

                if (change_logo_color == "yes") {
                    header_logo.removeClass("change-logo-color");

                }

            }


        });
    }

};
// source --> https://kilaucreations.com/wp-content/plugins/uicore-animate/assets/js/entrance-animation.js?ver=1 
document.addEventListener('DOMContentLoaded', () => {
  // Select all elements with the data-animation attribute
  const elementsToAnimate = document.querySelectorAll('[data-ui-animation]');

  // Create an Intersection Observer instance
  const observer = new IntersectionObserver((entries, observer) => {
    entries.forEach(entry => {
      if (!entry.isIntersecting) return;
      const el = entry.target;
      const animationName = el.getAttribute("data-ui-animation");
      const animationSpeed = el.getAttribute("data-ui-duration");

      // 1. Add animation speed class
      if (animationSpeed === "fast") {
        el.classList.add("animated", "animated-fast");
      } else if (animationSpeed === "slow") {
        el.classList.add("animated", "animated-slow");
      } else {
        el.classList.add("animated");
      }

      // 2. Add animation name class(es)
      if (animationName) {
        el.classList.add(...animationName.split(" "));
      }

      // 3. Remove hide ONLY when animation really starts
      const onStart = () => {
        el.classList.remove("uicore-animate-hide");
        el.removeEventListener("animationstart", onStart);
      };
      el.addEventListener("animationstart", onStart, {
        once: true
      });

      // 4. Safety fallback: if animation has NO delay, remove instantly next frame
      requestAnimationFrame(() => {
        if (getComputedStyle(el).animationDelay === "0s") {
          el.classList.remove("uicore-animate-hide");
        }
      });

      // 5. Stop observing after trigger
      observer.unobserve(el);
    });
  }, {
    rootMargin: '10px',
    // Adjust the root margin as needed
    threshold: 0 // Adjust threshold as needed to control when animation is triggered
  });

  // Observe each element that should be animated
  elementsToAnimate.forEach(element => {
    observer.observe(element);
  });
});