1import{_ as W}from"./BNjuuf4Z.js";import{d as Z,r as d,w as A,Z as G,h as _,c as a,C as I,o as r,a as $,F as v,y,E as b,av as O,k as i,v as C,x as B,b as D,s as N,t as J}from"./yousAIRp.js";import{e as K}from"./CAzG8Wyj.js";import{g as Q}from"./C9kFuMs6.js";import{_ as R}from"./DlAUqK2U.js";import"./B2LKNtdB.js";import"./DSvF91B5.js";const X=globalThis.setInterval,Y={key:0,class:"overflow-hidden"},ee={key:2,class:"py-5 px-8 flex flex-row justify-center items-center gap-5"},te={class:"flex gap-3 flex-wrap"},oe=["onClick"],le=Z({inheritAttrs:!1,__name:"Carousel",props:{items:{default:()=>[]},arrows:{type:Boolean,default:!1},pagination:{type:Boolean,default:!1},autoplay:{type:Boolean,default:!1},autoplayInterval:{default:3e3},pauseOnHover:{type:Boolean,default:!0},constrained:{type:Boolean,default:!0},ticker:{type:Boolean,default:!1},slidesPerView:{default:()=>({sm:1,md:2,lg:3,xl:4,"2xl":4})},options:{}},setup(p){const o=p;function T(e){if(!e)return;const{tickerDuration:s,breakpoints:n,...l}=e;return{...l,...n?{breakpoints:Object.fromEntries(Object.entries(n).map(([t,c])=>[t,T(c)]))}:{}}}const g=d({active:!0,axis:"x",loop:!0,align:"start",slidesToScroll:1,dragFree:!1,watchDrag:e=>e?.scrollSnapList().length>1,...T(o.options)}),[z,u]=K(g),f=d(!1),k=d(0),x=d([]),m=d(null),{width:L}=Q();function h(){m.value&&(clearInterval(m.value),m.value=null)}function w(){h(),!(!o.autoplay||!f.value)&&(m.value=X(()=>{u.value?.scrollNext()},o.autoplayInterval))}A(()=>u.value,e=>{if(!e)return;const s=t=>{requestAnimationFrame(()=>{g.value.active=t?.scrollSnapList().length>1,g.value.loop=t?.scrollSnapList().length>1,u.value?.scrollTo(0,!0)})},n=t=>{requestAnimationFrame(()=>{f.value=t?.scrollSnapList().length>0||!1,w()})},l=t=>{requestAnimationFrame(()=>{const c=t?.scrollSnapList().length,S=Math.ceil(c);x.value=Array.from({length:S},(se,U)=>U)})};e.on("init",t=>{s(t),n(t),l(t)}),e.on("reInit",t=>{s(t),n(t),l(t)}),e.on("resize",t=>{s(t),n(t),l(t)}),e.on("select",t=>{const c=t.selectedScrollSnap(),S=Number(t.internalEngine().options.slidesToScroll??1);k.value=Math.floor(c/S)})},{immediate:!0}),A(()=>[o.autoplay,o.autoplayInterval],()=>{w()}),G(()=>{h()});const M=_(()=>{const{slidesPerView:e}=o;return{"--slide-gap":"20px","--slide-sm":e.sm?`${100/e.sm}%`:"100%","--slide-md":e.md?`${100/e.md}%`:"100%","--slide-lg":e.lg?`${100/e.lg}%`:"100%","--slide-xl":e.xl?`${100/e.xl}%`:"100%","--slide-2xl":e["2xl"]?`${100/e["2xl"]}%`:"100%"}}),q=_(()=>{L.value;let e=o.options?.tickerDuration??o.autoplayInterval;for(const[s,n]of Object.entries(o.options?.breakpoints||{}))window.matchMedia(s).matches&&n?.tickerDuration&&(e=n.tickerDuration);return e}),E=_(()=>({"--ticker-duration":`${q.value}ms`}));function F(){const e=u.value;e&&e.scrollPrev()}function P(){const e=u.value;e&&e.scrollNext()}function V(e){const s=u.value;if(!s)return;const n=Number(s.internalEngine().options.slidesToScroll??1);s.scrollTo(e*n)}function j(){o.pauseOnHover&&h()}function H(){o.pauseOnHover&&w()}return(e,s)=>{const n=W;return o.items?.length>0?(r(),a("div",{key:0,class:N(["flex flex-col w-full",{"xl:max-w-(--breakpoint-xl) 2xl:max-w-(--breakpoint-2xl) mx-auto":o.constrained,"px-5":!o.ticker&&!i(f)}]),onMouseenter:j,onMouseleave:H},[o.ticker?(r(),a("div",Y,[$("div",O({style:i(E),class:"carousel__ticker-track"},e.$attrs),[(r(!0),a(v,null,y(p.items,(l,t)=>b(e.$slots,"default",{key:`ticker-primary-${t}`,item:l,index:t},void 0,!0)),128)),(r(!0),a(v,null,y(p.items,(l,t)=>b(e.$slots,"default",{key:`ticker-duplicate-${t}`,item:l,index:t},void 0,!0)),128))],16)])):(r(),a("div",{key:1,class:"overflow-hidden",ref_key:"element",ref:z},[$("div",O({style:i(M),class:"grid grid-flow-col touch-pan-y touch-pinch-zoom auto-cols-[100%] sm:auto-cols-(--slide-sm) md:auto-cols-(--slide-md) lg:auto-cols-(--slide-lg) xl:auto-cols-(--slide-xl) 2xl:auto-cols-(--slide-2xl) ml-5 *:mr-5"},e.$attrs),[(r(!0),a(v,null,y(p.items,(l,t)=>b(e.$slots,"default",{key:t,item:l,index:t},void 0,!0)),128))],16)],512)),!o.ticker&&i(f)&&i(x).length>1?(r(),a("div",ee,[C(D(n,{onClick:s[0]||(s[0]=l=>F()),label:"Prev",icon:"ic:baseline-keyboard-arrow-left",color:"neutral",variant:"outline",size:"md",square:""},null,512),[[B,o.arrows]]),C($("div",te,[(r(!0),a(v,null,y(i(x),l=>
1(r(),a("button",{class:N(["cursor-pointer touch-manipulation w-7 h-2 text-[0px] rounded-full",{"bg-primary":l===i(k),"bg-primary/20":l!==i(k)}]),onClick:t=>V(l)},J(l),11,oe))),256))],512),[[B,o.pagination]]),C(D(n,{onClick:s[1]||(s[1]=l=>P()),label:"Next",icon:"ic:baseline-keyboard-arrow-right",color:"neutral",variant:"outline",size:"md",square:""},null,512),[[B,o.arrows]])])):I("",!0)],34)):I("",!0)}}}),pe=Object.assign(R(le,[["__scopeId","data-v-cb72f5f8"]]),{__name:"AppCarousel"});export{pe 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.