1import{b as _,L as q,N as x}from"./metrics.BdZzTj2pGOgsWHVv.js";import"./device.8A-RpS8VgPVhE1uS.js";import"./show-logs.CpFkXIjNhoePrKiL.js";import{i as M}from"./brands.jsaTI9KDqKVSpxI9.js";import"./secure-sections.DiGYiaWAqcyERGS9.js";import"./logger.BjoEyIxZ-05JAene.js";import"./urls.CkUxZC76s8NHrPNB.js";const S=t=>t.scrollWidth-t.clientWidth,A=t=>t.scrollWidth>t.clientWidth,N=t=>{const e=t.querySelectorAll(".custom_carousel_item");if(e.length){e.forEach((n,c)=>{n.setAttribute("data-index",c)});let r=[];e.length<4?r=[...e,...e,...e,...e,...e,...e,...e,...e,...e]:e.length<7?r=[...e,...e,...e,...e,...e]:e.length<10?r=[...e,...e,...e]:r=[...e,...e],[...r].map(n=>n.cloneNode(!0)).forEach(n=>{n.classList.add("clone"),t.appendChild(n)})}},k=t=>{const e=[];return t.forEach(r=>{e.push(r.scrollWidth)}),e},g=(t,e,r)=>{r&&r.preventDefault(),t.scrollBy({left:-e,top:0,behavior:r?"smooth":"instant"})},m=(t,e,r)=>{r&&r.preventDefault(),t.scrollBy({left:e,top:0,behavior:r?"instant":"smooth"})},D=(t,e,r)=>{r===0&&g(t,S(t)),m(t,e[r])},E=(t,e,r=!0,s)=>{let n;return s?r?n=t<2*e-1?t+1:0:n=t>0?t-1:2*e-1:r?n=t<e?t+1:t:n=t>0?t-1:t,n},R={autoPlay:2e3},{autoPlay:L}=R,V=class{constructor(t){this.el=t,this.autoScrollInterval=null,this.counter=0,this.maxCounter=99,this.container=t.querySelector("ul"),this.leftArrow=t.querySelector(".custom_carousel__nav-btn--prev"),this.rightArrow=t.querySelector(".custom_carousel__nav-btn--next"),this.items=t.querySelectorAll("ul > li")}},X=t=>{const e=t.parentElement.querySelectorAll("button")[1];Math.floor(t.scrollWidth-t.scrollLeft)<=t.offsetWidth?e.classList.remove("active"):e.classList.add("active")},w=t=>{const e=t.parentElement.querySelectorAll("button")[1];Math.floor(t.scrollWidth-t.scrollLeft)<=t.offsetWidth?e.setAttribute("disabled",""):e.removeAttribute("disabled",""),A(t)||e.setAttribute("disabled","")},b=t=>{const e=t.parentElement.querySelectorAll("button")[0];t.scrollLeft===0?e.setAttribute("disabled",""):e.removeAttribute("disabled",""),A(t)||e.setAttribute("disabled","")},p=(t,e,r,s,n,c,a)=>{let d;r==="left"?d=t.leftArrow:d=t.rightArrow;let i=!1;const u=document.querySelectorAll(".third-menu-wrapper");u.length>0&&u.forEach(o=>{!i&&o.contains(t.el)&&(i=!0)}),d.classList.contains("listening")||(d.classList.add("listening"),d.addEventListener("click",o=>{a&&clearInterval(t.autoScrollInterval);const l=e[t.counter]>=t.container.scrollWidth-t.container.clientWidth-t.container.scrollLeft-5,h=l&&r==="right"?t.container.scrollWidth-t.container.clientWidth-t.container.scrollLeft:r==="right"?e[t.counter]:e[t.counter-1];h>0&&(l&&r==="right"&&(t.maxCounter=t.counter+1),r==="left"&&(a?(clearInterval(t.autoScrollInterval),t.counter===0&&(m(t.container,s,o),t.counter=n),g(t.container,e[t.counter-1],o)):(t.counter-=1,g(t.container,h,o)),(!c||i)&&(t.counter<1?t.leftArrow.classList.remove("active"):t.leftArrow.classList.add("active"),t.rightArrow.classList.add("active"))),r==="right"&&(a?(t.counter===0&&g(t.container,S(t.container)),m(t.container,e[t.counter])):t.counter<t.maxCounter&&(t.counter+=1,m(t.container,h),(!c||i)&&(t.leftArrow.classList.add("active"),t.counter===t.maxCounter&&t.rightArrow.classList.remove("active")))),a&&(t.counter=E(t.counter,n,r!=="left",a),setTimeout(()=>{j({el:[t.el],obj:t})},L)))}))},j=t=>{if(!t.el||!t.el[0])throw new Error("Element is not defined");let e=!0,r=!1,s=!1,n=!1;const c=t.el[0];let{config:a}=c.dataset;const d=t.el[0].getAttribute("data-id-module");a&&(a=JSON.parse(a),{showArrows:e,disableArrows:r,loop:s,draggable:n}=a);let i;if(t.obj?i=t.obj:i=new V(c),d&&c&&c.querySelectorAll(".custom_carousel_container .custom_carousel_item").forEach((o,l)=>{o.addEventListener("click",()=>{_(d,x,l+1,q)})}),clearInterval(i.autoScrollInterval),c&&i.container&&i.items){if(n){let v=function(f){l=!0,o=f.pageX-i.container.offsetLeft,h=i.container.scrollLeft,i.container.classList.add("custom-carousel-dragging")},y=function(){l=!1,i.container.classList.remove("custom-carousel-dragging")},C=function(){l=!1,i.container.classList.remove("custom-carousel-dragging")},I=function(f){if(l){f.preventDefault();const W=(f.pageX-i.container.offsetLeft-o)*5;i.container.scrollLeft=h-W}},o,l,h;i.container.addEventListener("mousedown",f=>v(f)),i.container.addEventListener("mouseup",f=>y()),i.container.addEventListener("mouseleave",f=>C()),i.container.addEventListener("mousemove",f=>I(f))}const u=i.container.querySelector(".clone");
1if(s&&!u?N(i.container):i.items.length&&i.items.forEach((o,l)=>{o.setAttribute("data-index",l)}),r&&(w(i.container),b(i.container),i.container.addEventListener("scroll",()=>{w(i.container),b(i.container)})),A(i.container)){let o=k(i.items);const l=o.reduce((h,v)=>h+v);s&&L&&(o=[...o,...o],i.autoScrollInterval=setInterval(()=>{D(i.container,o,i.counter,i.items.length),i.counter=E(i.counter,i.items.length,!0,s)},L)),i.leftArrow&&i.rightArrow&&(i.rightArrow.classList.add("active"),p(i,o,"left",l,i.items.length,e,s),p(i,o,"right",l,i.items.length,e,s)),e||X(i.container,i.rightArrow)}else i.leftArrow&&i.rightArrow&&M&&(i.leftArrow.classList.remove("active"),i.rightArrow.classList.remove("active"))}};export{j as default};
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.