1import O from"./Cp_jpKAq.js";import{N as W,a6 as j,a7 as F,a8 as x,aa as P,ak as z,a9 as K,aW as T,P as r,W as q,a3 as G,bc as H,a5 as J,bd as Q}from"./D_VuolGt.js";import{_ as U}from"./DlAUqK2U.js";const X={class:"flex items-center"},Y=["disabled","aria-label"],Z={class:"sr-only","aria-live":"polite"},ee=["disabled","aria-label"],te=W({__name:"SliderControls",props:{canScrollPrev:{type:Boolean},canScrollNext:{type:Boolean},selectedIndex:{},slideCount:{},positionLabel:{}},emits:["prev","next"],setup(m){return(t,a)=>{const i=O;return F(),j("div",X,[x("button",{onClick:a[0]||(a[0]=S=>t.$emit("prev")),disabled:!t.canScrollPrev,class:z([t.canScrollPrev?"text-theme-primary-2":"text-ink-neutral-tertiary","controls controls--prev"]),"aria-label":t.$t("actions.prev")},[P(i,{name:"custom-icon:slider-arrow",class:"arrow rotate-180"})],10,Y),x("span",Z,K(t.positionLabel||t.$t("slider.position",{current:t.selectedIndex+1,total:t.slideCount})),1),x("button",{onClick:a[1]||(a[1]=S=>t.$emit("next")),disabled:!t.canScrollNext,class:z([t.canScrollNext?"text-theme-primary-2":"text-ink-neutral-tertiary","controls"]),"aria-label":t.$t("actions.next")},[P(i,{name:"custom-icon:slider-arrow",class:"arrow"})],10,ee)])}}}),le=Object.assign(U(te,[["__scopeId","data-v-2e9ec0aa"]]),{__name:"ModulesSliderControls"});function oe(m){const{api:t,statusKey:a="slider"}=m,{t:i}=T(),S=Q(),_=r(0),g=r(0),y=r(!1),b=r(!1),l=r(new Set([0])),f=r(!1),I=r
1(null);let w=!1;const E=()=>{const e=t.value;if(!e)return!1;try{return e.internalEngine().options.active!==!1}catch{return!1}},B=e=>{const n=t.value,s=S.value;if(!n||!s)return;const c=n.slideNodes().findIndex(u=>u.contains(s));if(c===-1||e.has(c))return;const v=n.internalEngine().slideRegistry.findIndex(u=>u.includes(c));v!==-1&&n.scrollTo(v,!0)},p=()=>{const e=t.value;if(!e)return;if(f.value=E(),!f.value){l.value=new Set;return}let n=new Set(e.slidesInView());if(n.size===0){const s=e.internalEngine().slideRegistry[e.selectedScrollSnap()];s&&(n=new Set(s))}B(n),l.value=n,w||h()},o=()=>{const e=t.value;e&&(_.value=e.selectedScrollSnap(),g.value=e.scrollSnapList().length,y.value=e.canScrollPrev(),b.value=e.canScrollNext(),p())},h=()=>{if(l.value.size===0){I.value=null;return}const e=[...l.value];I.value={first:Math.min(...e),last:Math.max(...e)}},d=()=>{w=!1,p(),h()},N=()=>{w=!0},R=()=>{var e;return(e=t.value)==null?void 0:e.scrollPrev()},A=()=>{var e;return(e=t.value)==null?void 0:e.scrollNext()},L=e=>l.value.size>0&&!l.value.has(e),D=q(()=>{const e=J(m.count),n=I.value;if(!n)return i(`${a}.position`,{current:_.value+1,total:g.value||e});const s={first:n.first+1,last:n.last+1,total:e};return n.first===n.last?i(`${a}.visibleSingle`,s):i(`${a}.visibleRange`,s)}),$=()=>{f.value=!1,l.value=new Set},M=e=>{e.on("select",o),e.on("reInit",o),e.on("resize",o),e.on("slidesInView",p),e.on("reInit",d),e.on("settle",d),e.on("scroll",N),e.on("destroy",$),o(),d()};let C=!1;return G(t,e=>{!e||C||(C=!0,M(e))},{immediate:!0,flush:"post"}),H(()=>{var e,n,s,c,v,u,V,k;(e=t.value)==null||e.off("select",o),(n=t.value)==null||n.off("reInit",o),(s=t.value)==null||s.off("resize",o),(c=t.value)==null||c.off("slidesInView",p),(v=t.value)==null||v.off("reInit",d),(u=t.value)==null||u.off("settle",d),(V=t.value)==null||V.off("scroll",N),(k=t.value)==null||k.off("destroy",$)}),{selectedIndex:_,slideCount:g,canScrollPrev:y,canScrollNext:b,scrollPrev:R,scrollNext:A,slidesInView:l,isActive:f,isSlideInert:L,statusLabel:D}}export{le as _,oe as u};
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.