function animateFarmerCard(e){const t=e.querySelector("img"),a=e.querySelector("object"),i=e.querySelector("p");anime({targets:t,scale:[{value:1.05,duration:300},{value:.9,duration:300}],opacity:[1,.8],filter:["grayscale(0%)","grayscale(20%)"],easing:"easeInOutSine"}),anime({targets:a,rotate:"+=360",duration:1500,easing:"easeInOutElastic(1, .5)",scale:[1,1.1,1]}),anime({targets:i,translateY:[10,0,10],opacity:[.8,1,.8],duration:1e3,easing:"easeInOutSine"})}function startRandomEmpowermentAnimation(){const e=document.querySelectorAll(".empowerment-images");!function t(){animateFarmerCard(e[Math.floor(Math.random()*e.length)]);const a=Math.floor(1200*Math.random())+800;setTimeout(t,a)}()}async function typeText(e,t,a=50){const i=document.querySelector(e);i.innerHTML="",t.split("").forEach((e=>{const t=document.createElement("span");t.textContent=e,t.style.opacity=0,i.appendChild(t)})),await anime({targets:i.querySelectorAll("span"),opacity:[0,1],delay:anime.stagger(a),duration:100,easing:"easeInOutQuad"}).finished}function sleep(e){return new Promise((t=>setTimeout(t,e)))}async function loopTyping(){for(let e=0;e<50;e++)await typeText("#tagline-text","#Connecting Local Farmers With Global Markets"),await sleep(100),await typeText("#subtagline-text","Packed With Love From North-East India"),await sleep(2e3)}document.addEventListener("DOMContentLoaded",(function(){function e(e){const t=document.querySelector(e),a=t.querySelector("svg.left"),i=t.querySelector("svg.right"),n=t.querySelectorAll(".image-slider-dash"),s=t.querySelectorAll(".image-content img");let o,r=0;function c(){n.forEach((e=>e.classList.remove("active"))),s.forEach(((e,t)=>{e.classList.add("hidden"),e.style.opacity=0,e.style.transition="opacity 1s ease-in-out"})),s[r].classList.remove("hidden"),s[r].style.opacity=1,n[r].classList.add("active")}function l(){o=setInterval((()=>{r=(r+1)%n.length,c()}),2e3)}function d(){clearInterval(o),l()}a.addEventListener("click",(function(){r=0===r?n.length-1:r-1,c(),d()})),i.addEventListener("click",(function(){r=r===n.length-1?0:r+1,c(),d()})),n.forEach(((e,t)=>{e.addEventListener("click",(function(){r=t,c(),d()}))})),c(),l()}e(".hero-two"),e(".empowerment")})),document.addEventListener("DOMContentLoaded",startRandomEmpowermentAnimation),document.addEventListener("DOMContentLoaded",loopTyping);const features=document.querySelectorAll(".feature");function setRandomFloatingFeatures(){features.forEach((e=>{e.classList.contains("floating")&&(e.classList.add("fading-out"),setTimeout((()=>{e.classList.remove("floating","fading-out")}),500))})),setTimeout((()=>{const e=[];for(;e.length<2;){const t=Math.floor(Math.random()*features.length);e.includes(t)||e.push(t)}e.forEach((e=>{features[e].classList.add("floating")}))}),500)}function updateMapProductShowcase(e){const t={Assam:{title:"ASSAM",description:"Assam produces a wide variety of seasonal fruits rich in flavor and nutrients.",image:"../image/home/map_image/kajinemu.png",alt:"Fruits from Assam"},Arunachal:{title:"ARUNACHAL PRADESH",description:"Arunachal Pradesh is known for unique fruits like kiwi, oranges, and apples grown in its cool climate.",image:"../image/home/map_image/kiwi-new.png",alt:"Fruits from Arunachal Pradesh"},Manipur:{title:"MANIPUR",description:"Manipur offers exotic fruits like pineapples and passion fruits cultivated in its rich, fertile soil.",image:"../image/home/map_image/black-rice.png",alt:"Fruits from Manipur"},Meghalaya:{title:"MEGHALAYA",description:"Meghalaya is famous for its juicy oranges and other citrus fruits grown in the hills.",image:"../image/home/map_image/turmeric.png",alt:"Fruits from Meghalaya"},Mizoram:{title:"MIZORAM",description:"Mizoram produces delicious fruits like bananas, grapes, and plums across its highland areas.",image:"../image/home/map_image/ginger.png",alt:"Fruits from Mizoram"},Nagaland:{title:"NAGALAND",description:"Nagaland is home to rare and indigenous fruits like wild apples and pears.",image:"../image/home/map_image/king-chili.png",alt:"Fruits from Nagaland"},Tripura:{title:"TRIPURA",description:"Tripura is rich in fruit production including jackfruit, pineapple, and litchi.",image:"../image/home/map_image/pineapple.webp",alt:"Fruits from Tripura"}}[e];if(!t)return;const a=document.querySelector(".map-product-container .left-content"),i=a.querySelector("h2"),n=a.querySelector("p"),s=a.querySelector(".product-images");i.classList.add("fade-out"),n.classList.add("fade-out"),s.classList.add("fade-out"),setTimeout((()=>{i.textContent=t.title,n.textContent=t.description,s.src=t.image,s.alt=t.alt||t.title,i.classList.remove("fade-out"),n.classList.remove("fade-out"),s.onload=()=>{s.classList.remove("fade-out")},s.complete&&s.onload()}),500)}setRandomFloatingFeatures(),setInterval(setRandomFloatingFeatures,6e3),document.addEventListener("DOMContentLoaded",(()=>{const e=document.querySelectorAll(".category-card");e.forEach((t=>{t.addEventListener("mouseover",(()=>{e.forEach((e=>e.classList.remove("active"))),t.classList.add("active")})),t.addEventListener("mouseout",(()=>{t.classList.remove("active")}))}))})),document.addEventListener("DOMContentLoaded",(function(){const e=document.getElementById("carousel");e.children[0].classList.add("first"),setInterval((function(){const t=e.children[0];t.classList.add("fade-out"),e.style.transition="transform 0.8s ease-in-out",e.style.transform="translateX(-220px)",setTimeout((()=>{e.style.transition="none",e.style.transform="translateX(0)";const a=t.cloneNode(!0);a.classList.remove("fade-out","first"),requestAnimationFrame((()=>{a.classList.add("fade-in"),setTimeout((()=>{a.classList.remove("fade-in")}),800)})),e.removeChild(t),e.appendChild(a),requestAnimationFrame((()=>{e.children[0].classList.add("first")}))}),800)}),3e3)})),document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".navigation-plus-icon").forEach(((e,t)=>{e.addEventListener("click",(()=>{const t=e.parentElement.nextElementSibling;if(!t||!t.classList.contains("submenu"))return;const a=t.classList.contains("show");document.querySelectorAll(".dropdown.submenu").forEach((e=>{e.classList.remove("show")})),document.querySelectorAll(".navigation-plus-icon").forEach((e=>{e.classList.remove("rotate")})),a||(t.classList.add("show"),e.classList.add("rotate"))}))}))}));