Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

embla-carousel-solid

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

embla-carousel-solid - npm Package Compare versions

Comparing version 8.0.0-rc22 to 8.0.0-rc23

6

cjs/package.json
{
"name": "embla-carousel-solid",
"version": "8.0.0-rc21",
"version": "8.0.0-rc23",
"author": "Liam Martens",

@@ -52,4 +52,4 @@ "description": "A lightweight carousel library with fluid motion and great swipe precision",

"dependencies": {
"embla-carousel": "8.0.0-rc21",
"embla-carousel-reactive-utils": "8.0.0-rc21"
"embla-carousel": "8.0.0-rc23",
"embla-carousel-reactive-utils": "8.0.0-rc23"
},

@@ -56,0 +56,0 @@ "peerDependencies": {

@@ -1,1 +0,1 @@

!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("solid-js")):"function"==typeof define&&define.amd?define(["solid-js"],t):(n="undefined"!=typeof globalThis?globalThis:n||self).EmblaCarouselSolid=t(n.solidJs)}(this,(function(n){"use strict";function t(n){return"number"==typeof n}function e(n){return"string"==typeof n}function r(n){return"boolean"==typeof n}function o(n){return"[object Object]"===Object.prototype.toString.call(n)}function i(n){return Math.abs(n)}function c(n){return Math.sign(n)}function u(n,t){return i(n-t)}function s(n){return p(n).map(Number)}function a(n){return n[l(n)]}function l(n){return Math.max(0,n.length-1)}function d(n,t){return t===l(n)}function f(n,t=0){return Array.from(Array(n),((n,e)=>t+e))}function p(n){return Object.keys(n)}function g(n,t){return[n,t].reduce(((n,t)=>(p(t).forEach((e=>{const r=n[e],i=t[e],c=o(r)&&o(i);n[e]=c?g(r,i):i})),n)),{})}function m(n,t){return void 0!==t.MouseEvent&&n instanceof t.MouseEvent}function h(){let n=[];const t={add:function(e,r,o,i={passive:!0}){let c;if("addEventListener"in e)e.addEventListener(r,o,i),c=()=>e.removeEventListener(r,o,i);else{const n=e;n.addListener(o),c=()=>n.removeListener(o)}return n.push(c),t},clear:function(){n=n.filter((n=>n()))}};return t}function y(n,t,e,r){const o=h(),c=1e3/60;let u=null,s=0,a=0;function l(n){u||(u=n);const o=n-u;for(u=n,s+=o;s>=c;)e(),s-=c;const d=i(s/c);r(d),a&&t.requestAnimationFrame(l)}function d(){t.cancelAnimationFrame(a),u=null,s=0,a=0}return{init:function(){o.add(n,"visibilitychange",(()=>{n.hidden&&(u=null,s=0)}))},destroy:function(){d(),o.clear()},start:function(){a||(a=t.requestAnimationFrame(l))},stop:d,update:e,render:r}}function x(n=0,t=0){const e=i(n-t);function r(t){return t<n}function o(n){return n>t}function c(n){return r(n)||o(n)}return{length:e,max:t,min:n,constrain:function(e){return c(e)?r(e)?n:t:e},reachedAny:c,reachedMax:o,reachedMin:r,removeOffset:function(n){return e?n-e*Math.ceil((n-t)/e):n}}}function b(n,t,e){const{constrain:r}=x(0,n),o=n+1;let c=u(t);function u(n){return e?i((o+n)%o):r(n)}function s(){return c}function a(){return b(n,s(),e)}const l={get:s,set:function(n){return c=u(n),l},add:function(n){return a().set(s()+n)},clone:a};return l}function v(n,t,e,o,s,a,l,d,f,p,g,y,b,v,S,w,E,O,L,D){const{cross:I}=n,A=["INPUT","SELECT","TEXTAREA"],M={passive:!1},T=h(),k=h(),F=x(50,225).constrain(S.measure(20)),P={mouse:300,touch:400},j={mouse:500,touch:600},z=w?43:25;let H=!1,V=0,N=0,B=!1,C=!1,R=!1,q=!1;function G(n){const e=l.readPoint(n),r=l.readPoint(n,I),o=u(e,V),i=u(r,N);if(!C&&!q){if(!n.cancelable)return $(n);if(C=o>i,!C)return $(n)}const c=l.pointerMove(n);o>E&&(R=!0),g.useFriction(.3).useDuration(1),f.start(),a.add(t.apply(c)),n.preventDefault()}function $(n){const e=y.byDistance(0,!1).index!==b.get(),r=l.pointerUp(n)*(w?j:P)[q?"mouse":"touch"],o=function(n,t){const e=b.add(-1*c(n)),r=y.byDistance(n,!w).distance;return w||i(n)<F?r:O&&t?.5*r:y.byIndex(e.get(),0).distance}(t.apply(r),e),s=function(n,t){if(0===n||0===t)return 0;if(i(n)<=i(t))return 0;const e=u(i(n),i(t));return i(e/n)}(r,o),a=z-10*s,d=L+s/50;C=!1,B=!1,k.clear(),g.useDuration(a).useFriction(d),p.distance(o,!w),q=!1,v.emit("pointerUp")}function U(n){R&&(n.stopPropagation(),n.preventDefault())}return{init:function(n){if(!D)return;function t(t){(r(D)||D(n,t))&&function(n){const t=m(n,s);if(q=t,t&&0!==n.button)return;if(function(n){const t=n.nodeName||"";return A.includes(t)}(n.target))return;R=w&&t&&!n.buttons&&H,H=u(a.get(),d.get())>=2,B=!0,l.pointerDown(n),g.useFriction(0).useDuration(0),a.set(d),function(){const n=q?o:e;k.add(n,"touchmove",G,M).add(n,"touchend",$).add(n,"mousemove",G,M).add(n,"mouseup",$)}(),V=l.readPoint(n),N=l.readPoint(n,I),v.emit("pointerDown")}(t)}const i=e;T.add(i,"dragstart",(n=>n.preventDefault()),M).add(i,"touchmove",(()=>{}),M).add(i,"touchend",(()=>{})).add(i,"touchstart",t).add(i,"mousedown",t).add(i,"touchcancel",$).add(i,"contextmenu",$).add(i,"click",U,!0)},pointerDown:function(){return B},destroy:function(){T.clear(),k.clear()}}}function S(n,t){let e,r;function o(n){return n.timeStamp}function c(e,r){const o="client"+("x"===(r||n.scroll)?"X":"Y");return(m(e,t)?e:e.touches[0])[o]}return{pointerDown:function(n){return e=n,r=n,c(n)},pointerMove:function(n){const t=c(n)-c(r),i=o(n)-o(e)>170;return r=n,i&&(e=n),t},pointerUp:function(n){if(!e||!r)return 0;const t=c(r)-c(e),u=o(n)-o(e),s=o(n)-o(r)>170,a=t/u;return u&&!s&&i(a)>.1?a:0},readPoint:c}}function w(n,t,e,o,c,u,s){let a,l,d=[],f=!1;function p(n){return c.measureSize(s.measure(n))}return{init:function(c){if(!u)return;l=p(n),d=o.map(p),a=new ResizeObserver((s=>{f||(r(u)||u(c,s))&&function(r){for(const u of r){const r=u.target===n,s=o.indexOf(u.target),a=r?l:d[s];if(i(p(r?n:o[s])-a)>=.5){e.requestAnimationFrame((()=>{c.reInit(),t.emit("resize")}));break}}}(s)})),[n].concat(o).forEach((n=>a.observe(n)))},destroy:function(){a&&a.disconnect(),f=!0}}}function E(n,t,e,r,o){const c=o.measure(10),u=o.measure(50),s=x(.1,.99);let a=!1;return{constrain:function(o){if(a||!n.reachedAny(e.get())||!n.reachedAny(t.get()))return;const l=n.reachedMin(t.get())?"min":"max",d=i(n[l]-t.get()),f=e.get()-t.get(),p=s.constrain(d/u);e.subtract(f*p),!o&&i(f)<c&&(e.set(n.constrain(e.get())),r.useDuration(25).useBaseFriction())},toggleActive:function(n){a=!n}}}function O(n,t,e,r){const o=t.min+.1,i=t.max+.1,{reachedMin:c,reachedMax:u}=x(o,i);return{loop:function(t){if(!function(n){return 1===n?u(e.get()):-1===n&&c(e.get())}(t))return;const o=n*(-1*t);r.forEach((n=>n.add(o)))}}}function L(n,t,e,r,o){const{reachedAny:u,removeOffset:s,constrain:l}=r;function d(n){return n.concat().sort(((n,t)=>i(n)-i(t)))[0]}function f(t,r){const o=[t,t+e,t-e];if(!n)return o[0];if(!r)return d(o);const i=o.filter((n=>c(n)===r));return i.length?d(i):a(o)-e}return{byDistance:function(e,r){const c=o.get()+e,{index:a,distance:d}=function(e){const r=n?s(e):l(e),o=t.map((n=>n-r)).map((n=>f(n,0))).map(((n,t)=>({diff:n,index:t}))).sort(((n,t)=>i(n.diff)-i(t.diff))),{index:c}=o[0];return{index:c,distance:r}}(c),p=!n&&u(c);return!r||p?{index:a,distance:e}:{index:a,distance:e+f(t[a]-d,0)}},byIndex:function(n,e){return{index:n,distance:f(t[n]-o.get(),e)}},shortcut:f}}function D(n){let e=n;function r(n){return t(n)?n:n.get()}return{get:function(){return e},set:function(n){e=r(n)},add:function(n){e+=r(n)},subtract:function(n){e-=r(n)}}}function I(n,t,e){const r="x"===n.scroll?function(n){return`translate3d(${n}px,0px,0px)`}:function(n){return`translate3d(0px,${n}px,0px)`},o=e.style;let i=!1;return{clear:function(){i||(o.transform="",e.getAttribute("style")||e.removeAttribute("style"))},to:function(n){i||(o.transform=r(t.apply(n)))},toggleActive:function(n){i=!n}}}function A(n,t,e,r,o,i,c,u,a,l){const d=.5,f=s(i),p=s(i).reverse(),g=function(){const n=u[0];return y(h(p,n),r,!1)}().concat(function(){const n=e-u[0]-1;return y(h(f,n),-r,!0)}());function m(n,t){return n.reduce(((n,t)=>n-i[t]),t)}function h(n,t){return n.reduce(((n,e)=>m(n,t)>0?n.concat([e]):n),[])}function y(i,u,s){const f=function(n){return c.map(((t,r)=>({start:t-o[r]+d+n,end:t+e-d+n})))}(u);return i.map((e=>{const o=s?0:-r,i=s?r:0,c=s?"end":"start",u=f[e][c];return{index:e,loopPoint:u,slideLocation:D(-1),translate:I(n,t,l[e]),target:()=>a.get()>u?o:i}}))}return{canLoop:function(){return g.every((({index:n})=>m(f.filter((t=>t!==n)),e)<=.1))},clear:function(){g.forEach((n=>n.translate.clear()))},loop:function(){g.forEach((n=>{const{target:t,translate:e,slideLocation:r}=n,o=t();o!==r.get()&&(e.to(o),r.set(o))}))},loopPoints:g}}function M(n,t,e){let o,i=!1;return{init:function(c){e&&(o=new MutationObserver((n=>{i||(r(e)||e(c,n))&&function(n){for(const e of n)if("childList"===e.type){c.reInit(),t.emit("slidesChanged");break}}(n)})),o.observe(n,{childList:!0}))},destroy:function(){o&&o.disconnect(),i=!0}}}function T(n,t,e,r){const o={};let i,c=null,u=null,s=!1;return{init:function(){i=new IntersectionObserver((n=>{s||(n.forEach((n=>{const e=t.indexOf(n.target);o[e]=n})),c=null,u=null,e.emit("slidesInView"))}),{root:n.parentElement,threshold:r}),t.forEach((n=>i.observe(n)))},destroy:function(){i&&i.disconnect(),s=!0},get:function(n=!0){if(n&&c)return c;if(!n&&u)return u;const t=function(n){return p(o).reduce(((t,e)=>{const r=parseInt(e),{isIntersecting:i}=o[r];return(n&&i||!n&&!i)&&t.push(r),t}),[])}(n);return n&&(c=t),n||(u=t),t}}}function k(n,e,r,o,c,u,d,f,p,g){const{startEdge:m,endEdge:h}=n,y=t(o);return{groupSlides:function(n){return y?function(n,t){return s(n).filter((n=>n%t==0)).map((e=>n.slice(e,e+t)))}(n,o):function(n){return n.length?s(n).reduce(((t,o)=>{const s=a(t)||0,y=0===s,x=o===l(n),b=u[m]-d[s][m],v=u[m]-d[o][h],S=!c&&y?e.apply(f):0;return i(v-(!c&&x?e.apply(p):0)-(b+S))>r+g&&t.push(o),x&&t.push(n.length),t}),[]).map(((t,e,r)=>{const o=Math.max(r[e-1]||0);return n.slice(o,t)})):[]}(n)}}}function F(n,r,o,p,g,m,F){const{align:P,axis:j,direction:z,startIndex:H,loop:V,duration:N,dragFree:B,dragThreshold:C,inViewThreshold:R,slidesToScroll:q,skipSnaps:G,containScroll:$,watchResize:U,watchSlides:W,watchDrag:J}=m,Q={measure:function(n){const{offsetTop:t,offsetLeft:e,offsetWidth:r,offsetHeight:o}=n;return{top:t,right:e+r,bottom:t+o,left:e,width:r,height:o}}},X=Q.measure(r),Y=o.map(Q.measure),K=function(n){const t="rtl"===n?-1:1;return{apply:function(n){return n*t}}}(z),Z=function(n,t){const e="y"===n?"y":"x";return{scroll:e,cross:"y"===n?"x":"y",startEdge:"y"===e?"top":"rtl"===t?"right":"left",endEdge:"y"===e?"bottom":"rtl"===t?"left":"right",measureSize:function(n){const{width:t,height:r}=n;return"x"===e?t:r}}}(j,z),_=Z.measureSize(X),nn=function(n){return{measure:function(t){return n*(t/100)}}}(_),tn=function(n,t){const r={start:function(){return 0},center:function(n){return o(n)/2},end:o};function o(n){return t-n}return{measure:function(o,i){return e(n)?r[n](o):n(t,o,i)}}}(P,_),en=!V&&!!$,rn=V||!!$,{slideSizes:on,slideSizesWithGaps:cn,startGap:un,endGap:sn}=function(n,t,e,r,o,c){const{measureSize:u,startEdge:s,endEdge:l}=n,f=e[0]&&o,p=function(){if(!f)return 0;const n=e[0];return i(t[s]-n[s])}(),g=function(){if(!f)return 0;const n=c.getComputedStyle(a(r));return parseFloat(n.getPropertyValue(`margin-${l}`))}(),m=e.map(u),h=e.map(((n,t,e)=>{const r=!t,o=d(e,t);return r?m[t]+p:o?m[t]+g:e[t+1][s]-n[s]})).map(i);return{slideSizes:m,slideSizesWithGaps:h,startGap:p,endGap:g}}(Z,X,Y,o,rn,g),an=k(Z,K,_,q,V,X,Y,un,sn,2),{snaps:ln,snapsAligned:dn}=function(n,t,e,r,o){const{startEdge:c,endEdge:u}=n,{groupSlides:s}=o,l=s(r).map((n=>a(n)[u]-n[0][c])).map(i).map(t.measure),d=r.map((n=>e[c]-n[c])).map((n=>-i(n))),f=s(d).map((n=>n[0])).map(((n,t)=>n+l[t]));return{snaps:d,snapsAligned:f}}(Z,tn,X,Y,an),fn=-a(ln)+a(cn),{snapsContained:pn,scrollContainLimit:gn}=function(n,t,e,r,o){const i=x(-t+n,0),c=e.map(((n,t)=>{const{min:r,max:o}=i,c=i.constrain(n),u=!t,s=d(e,t);return u?o:s||l(r,c)?r:l(o,c)?o:c})).map((n=>parseFloat(n.toFixed(3)))),s=function(){const n=c[0],t=a(c);return x(c.lastIndexOf(n),c.indexOf(t)+1)}();function l(n,t){return u(n,t)<1}return{snapsContained:function(){if(t<=n+o)return[i.max];if("keepSnaps"===r)return c;const{min:e,max:u}=s;return c.slice(e,u)}(),scrollContainLimit:s}}(_,fn,dn,$,2),mn=en?pn:dn,{limit:hn}=function(n,t,e){const r=t[0];return{limit:x(e?r-n:a(t),r)}}(fn,mn,V),yn=b(l(mn),H,V),xn=yn.clone(),bn=s(o),vn=y(p,g,(()=>(({dragHandler:n,scrollBody:t,scrollBounds:e,options:{loop:r}})=>{r||e.constrain(n.pointerDown()),t.seek()})(Pn)),(n=>(({scrollBody:n,translate:t,location:e,offsetLocation:r,scrollLooper:o,slideLooper:i,dragHandler:c,animation:u,eventHandler:s,options:{loop:a}},l)=>{const d=n.velocity(),f=n.settled();f&&!c.pointerDown()&&(u.stop(),s.emit("settle")),f||s.emit("scroll"),r.set(e.get()-d+d*l),a&&(o.loop(n.direction()),i.loop()),t.to(r.get())})(Pn,n))),Sn=mn[yn.get()],wn=D(Sn),En=D(Sn),On=D(Sn),Ln=function(n,t,e,r,o){let u=0,s=0,a=r,l=o,d=n.get(),f=0;function p(n){return a=n,m}function g(n){return l=n,m}const m={direction:function(){return s},duration:function(){return a},velocity:function(){return u},seek:function(){const t=e.get()-n.get();let r=0;return a?(u+=t/a,u*=l,d+=u,n.add(u),r=d-f):(u=0,n.set(e),r=t),s=c(r),f=d,m},settled:function(){return i(e.get()-t.get())<.001},useBaseFriction:function(){return g(o)},useBaseDuration:function(){return p(r)},useFriction:g,useDuration:p};return m}(wn,En,On,N,.68),Dn=L(V,mn,fn,hn,On),In=function(n,t,e,r,o,i,c){function u(o){const u=o.distance,s=o.index!==t.get();i.add(u),u&&(r.duration()?n.start():(n.update(),n.render(1),n.update())),s&&(e.set(t.get()),t.set(o.index),c.emit("select"))}return{distance:function(n,t){u(o.byDistance(n,t))},index:function(n,e){const r=t.clone().set(n);u(o.byIndex(r.get(),e))}}}(vn,yn,xn,Ln,Dn,On,F),An=function(n){const{max:t,length:e}=n;return{get:function(n){return e?(n-t)/-e:0}}}(hn),Mn=h(),Tn=T(r,o,F,R),{slideRegistry:kn}=function(n,t,e,r,o,i){const{groupSlides:c}=o,{min:u,max:s}=r;return{slideRegistry:function(){const r=c(i),o=!n||"keepSnaps"===t;return 1===e.length?[i]:o?r:r.slice(u,s).map(((n,t,e)=>{const r=!t,o=d(e,t);return r?f(a(e[0])+1):o?f(l(i)-a(e)[0]+1,a(e)[0]):n}))}()}}(en,$,mn,gn,an,bn),Fn=function(n,e,r,o,i,c){let u=0;function s(n){"Tab"===n.code&&(u=(new Date).getTime())}function a(s){c.add(s,"focus",(()=>{if((new Date).getTime()-u>10)return;n.scrollLeft=0;const c=e.indexOf(s),a=r.findIndex((n=>n.includes(c)));t(a)&&(i.useDuration(0),o.index(a,0))}),{passive:!0,capture:!0})}return{init:function(){c.add(document,"keydown",s,!1),e.forEach(a)}}}(n,o,kn,In,Ln,Mn),Pn={ownerDocument:p,ownerWindow:g,eventHandler:F,containerRect:X,slideRects:Y,animation:vn,axis:Z,direction:K,dragHandler:v(Z,K,n,p,g,On,S(Z,g),wn,vn,In,Ln,Dn,yn,F,nn,B,C,G,.68,J),eventStore:Mn,percentOfView:nn,index:yn,indexPrevious:xn,limit:hn,location:wn,offsetLocation:En,options:m,resizeHandler:w(r,F,g,o,Z,U,Q),scrollBody:Ln,scrollBounds:E(hn,wn,On,Ln,nn),scrollLooper:O(fn,hn,En,[wn,En,On]),scrollProgress:An,scrollSnapList:mn.map(An.get),scrollSnaps:mn,scrollTarget:Dn,scrollTo:In,slideLooper:A(Z,K,_,fn,on,cn,ln,mn,En,o),slideFocus:Fn,slidesHandler:M(r,F,W),slidesInView:Tn,slideIndexes:bn,slideRegistry:kn,slidesToScroll:an,target:On,translate:I(Z,K,r)};return Pn}const P={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0};function j(n){function t(n,t){return g(n,t||{})}const e={mergeOptions:t,optionsAtMedia:function(e){const r=e.breakpoints||{},o=p(r).filter((t=>n.matchMedia(t).matches)).map((n=>r[n])).reduce(((n,e)=>t(n,e)),{});return t(e,o)},optionsMediaQueries:function(t){return t.map((n=>p(n.breakpoints||{}))).reduce(((n,t)=>n.concat(t)),[]).map(n.matchMedia)}};return e}function z(n,t,r){const o=n.ownerDocument,i=o.defaultView,c=j(i),u=function(n){let t=[];return{init:function(e,r){return t=r.filter((({options:t})=>!1!==n.optionsAtMedia(t).active)),t.forEach((t=>t.init(e,n))),r.reduce(((n,t)=>Object.assign(n,{[t.name]:t})),{})},destroy:function(){t=t.filter((n=>n.destroy()))}}}(c),s=h(),a=function(){const n={};let t;function e(t){return n[t]||[]}const r={init:function(n){t=n},emit:function(n){return e(n).forEach((e=>e(t,n))),r},off:function(t,o){return n[t]=e(t).filter((n=>n!==o)),r},on:function(t,o){return n[t]=e(t).concat([o]),r}};return r}(),{mergeOptions:l,optionsAtMedia:d,optionsMediaQueries:f}=c,{on:p,off:g,emit:m}=a,y=A;let x,b,v,S,w=!1,E=l(P,z.globalOptions),O=l(E),L=[];function D(t){const e=F(n,v,S,o,i,t,a);if(t.loop&&!e.slideLooper.canLoop()){return D(Object.assign({},t,{loop:!1}))}return e}function I(t,r){w||(E=l(E,t),O=d(E),L=r||L,function(){const{container:t,slides:r}=O,o=e(t)?n.querySelector(t):t;v=o||n.children[0];const i=e(r)?v.querySelectorAll(r):r;S=[].slice.call(i||v.children)}(),x=D(O),f([E,...L.map((({options:n})=>n))]).forEach((n=>s.add(n,"change",A))),O.active&&(x.translate.to(x.location.get()),x.animation.init(),x.slidesInView.init(),x.slideFocus.init(),x.eventHandler.init(H),x.resizeHandler.init(H),x.slidesHandler.init(H),x.options.loop&&x.slideLooper.loop(),v.offsetParent&&S.length&&x.dragHandler.init(H),b=u.init(H,L)))}function A(n,t){const e=k();M(),I(l({startIndex:e},n),t),a.emit("reInit")}function M(){x.dragHandler.destroy(),x.eventStore.clear(),x.translate.clear(),x.slideLooper.clear(),x.resizeHandler.destroy(),x.slidesHandler.destroy(),x.slidesInView.destroy(),x.animation.destroy(),u.destroy(),s.clear()}function T(n,t,e){O.active&&!w&&(x.scrollBody.useBaseFriction().useDuration(!0===t?0:O.duration),x.scrollTo.index(n,e||0))}function k(){return x.index.get()}const H={canScrollNext:function(){return x.index.add(1).get()!==k()},canScrollPrev:function(){return x.index.add(-1).get()!==k()},containerNode:function(){return v},internalEngine:function(){return x},destroy:function(){w||(w=!0,s.clear(),M(),a.emit("destroy"))},off:g,on:p,emit:m,plugins:function(){return b},previousScrollSnap:function(){return x.indexPrevious.get()},reInit:y,rootNode:function(){return n},scrollNext:function(n){T(x.index.add(1).get(),n,-1)},scrollPrev:function(n){T(x.index.add(-1).get(),n,1)},scrollProgress:function(){return x.scrollProgress.get(x.location.get())},scrollSnapList:function(){return x.scrollSnapList},scrollTo:T,selectedScrollSnap:k,slideNodes:function(){return S},slidesInView:function(){return x.slidesInView.get()},slidesNotInView:function(){return x.slidesInView.get(!1)}};return I(t,r),setTimeout((()=>a.emit("init")),0),H}function H(n){return function(n){return"[object Object]"===Object.prototype.toString.call(n)}(n)||Array.isArray(n)}function V(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}function N(n,t){const e=Object.keys(n),r=Object.keys(t);if(e.length!==r.length)return!1;return JSON.stringify(Object.keys(n.breakpoints||{}))===JSON.stringify(Object.keys(t.breakpoints||{}))&&e.every((e=>{const r=n[e],o=t[e];return"function"==typeof r?`${r}`==`${o}`:H(r)&&H(o)?N(r,o):r===o}))}function B(n){return n.concat().sort(((n,t)=>n.name>t.name?1:-1)).map((n=>n.options))}function C(t,e){let r=t?t():{},o=e?e():[];const[i,c]=n.createSignal(),[u,s]=n.createSignal();function a(){const n=i();n&&n.reInit(r,o)}return n.createEffect(n.on(u,(t=>{if(V()&&t){z.globalOptions=C.globalOptions;const e=z(t,r,o);c(e),n.onCleanup((()=>e.destroy()))}else c(void 0)}))),n.createEffect((()=>{if(!V())return;const n=t?t():{};N(r,n)||(r=n,a())})),n.createEffect((()=>{if(!V())return;const n=e?e():[];(function(n,t){if(n.length!==t.length)return!1;const e=B(n),r=B(t);return e.every(((n,t)=>N(n,r[t])))})(o,n)||(o=n,a())})),[s,i]}return z.globalOptions=void 0,C.globalOptions=void 0,C}));
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("solid-js")):"function"==typeof define&&define.amd?define(["solid-js"],t):(n="undefined"!=typeof globalThis?globalThis:n||self).EmblaCarouselSolid=t(n.solidJs)}(this,(function(n){"use strict";function t(n){return"number"==typeof n}function e(n){return"string"==typeof n}function r(n){return"boolean"==typeof n}function o(n){return"[object Object]"===Object.prototype.toString.call(n)}function i(n){return Math.abs(n)}function c(n){return Math.sign(n)}function u(n,t){return i(n-t)}function s(n){return p(n).map(Number)}function a(n){return n[l(n)]}function l(n){return Math.max(0,n.length-1)}function f(n,t){return t===l(n)}function d(n,t=0){return Array.from(Array(n),((n,e)=>t+e))}function p(n){return Object.keys(n)}function g(n,t){return[n,t].reduce(((n,t)=>(p(t).forEach((e=>{const r=n[e],i=t[e],c=o(r)&&o(i);n[e]=c?g(r,i):i})),n)),{})}function m(n,t){return void 0!==t.MouseEvent&&n instanceof t.MouseEvent}function h(){let n=[];const t={add:function(e,r,o,i={passive:!0}){let c;if("addEventListener"in e)e.addEventListener(r,o,i),c=()=>e.removeEventListener(r,o,i);else{const n=e;n.addListener(o),c=()=>n.removeListener(o)}return n.push(c),t},clear:function(){n=n.filter((n=>n()))}};return t}function y(n,t,e,r){const o=h(),c=1e3/60;let u=null,s=0,a=0;function l(n){if(!a)return;u||(u=n);const o=n-u;for(u=n,s+=o;s>=c;)e(),s-=c;const f=i(s/c);r(f),a&&t.requestAnimationFrame(l)}function f(){t.cancelAnimationFrame(a),u=null,s=0,a=0}return{init:function(){o.add(n,"visibilitychange",(()=>{n.hidden&&(u=null,s=0)}))},destroy:function(){f(),o.clear()},start:function(){a||(a=t.requestAnimationFrame(l))},stop:f,update:e,render:r}}function x(n=0,t=0){const e=i(n-t);function r(t){return t<n}function o(n){return n>t}function c(n){return r(n)||o(n)}return{length:e,max:t,min:n,constrain:function(e){return c(e)?r(e)?n:t:e},reachedAny:c,reachedMax:o,reachedMin:r,removeOffset:function(n){return e?n-e*Math.ceil((n-t)/e):n}}}function b(n,t,e){const{constrain:r}=x(0,n),o=n+1;let c=u(t);function u(n){return e?i((o+n)%o):r(n)}function s(){return c}function a(){return b(n,s(),e)}const l={get:s,set:function(n){return c=u(n),l},add:function(n){return a().set(s()+n)},clone:a};return l}function v(n,t,e,o,s,a,l,f,d,p,g,y,b,v,S,w,E,O,L,D){const{cross:I}=n,A=["INPUT","SELECT","TEXTAREA"],M={passive:!1},T=h(),k=h(),F=x(50,225).constrain(S.measure(20)),P={mouse:300,touch:400},j={mouse:500,touch:600},z=w?43:25;let H=!1,V=0,N=0,B=!1,C=!1,R=!1,q=!1;function G(n){const e=l.readPoint(n),r=l.readPoint(n,I),o=u(e,V),i=u(r,N);if(!C&&!q){if(!n.cancelable)return $(n);if(C=o>i,!C)return $(n)}const c=l.pointerMove(n);o>E&&(R=!0),g.useFriction(.3).useDuration(1),d.start(),a.add(t.apply(c)),n.preventDefault()}function $(n){const e=y.byDistance(0,!1).index!==b.get(),r=l.pointerUp(n)*(w?j:P)[q?"mouse":"touch"],o=function(n,t){const e=b.add(-1*c(n)),r=y.byDistance(n,!w).distance;return w||i(n)<F?r:O&&t?.5*r:y.byIndex(e.get(),0).distance}(t.apply(r),e),s=function(n,t){if(0===n||0===t)return 0;if(i(n)<=i(t))return 0;const e=u(i(n),i(t));return i(e/n)}(r,o),a=z-10*s,f=L+s/50;C=!1,B=!1,k.clear(),g.useDuration(a).useFriction(f),p.distance(o,!w),q=!1,v.emit("pointerUp")}function U(n){R&&(n.stopPropagation(),n.preventDefault())}return{init:function(n){if(!D)return;function t(t){(r(D)||D(n,t))&&function(n){const t=m(n,s);if(q=t,t&&0!==n.button)return;if(function(n){const t=n.nodeName||"";return A.includes(t)}(n.target))return;R=w&&t&&!n.buttons&&H,H=u(a.get(),f.get())>=2,B=!0,l.pointerDown(n),g.useFriction(0).useDuration(0),a.set(f),function(){const n=q?o:e;k.add(n,"touchmove",G,M).add(n,"touchend",$).add(n,"mousemove",G,M).add(n,"mouseup",$)}(),V=l.readPoint(n),N=l.readPoint(n,I),v.emit("pointerDown")}(t)}const i=e;T.add(i,"dragstart",(n=>n.preventDefault()),M).add(i,"touchmove",(()=>{}),M).add(i,"touchend",(()=>{})).add(i,"touchstart",t).add(i,"mousedown",t).add(i,"touchcancel",$).add(i,"contextmenu",$).add(i,"click",U,!0)},pointerDown:function(){return B},destroy:function(){T.clear(),k.clear()}}}function S(n,t){let e,r;function o(n){return n.timeStamp}function c(e,r){const o="client"+("x"===(r||n.scroll)?"X":"Y");return(m(e,t)?e:e.touches[0])[o]}return{pointerDown:function(n){return e=n,r=n,c(n)},pointerMove:function(n){const t=c(n)-c(r),i=o(n)-o(e)>170;return r=n,i&&(e=n),t},pointerUp:function(n){if(!e||!r)return 0;const t=c(r)-c(e),u=o(n)-o(e),s=o(n)-o(r)>170,a=t/u;return u&&!s&&i(a)>.1?a:0},readPoint:c}}function w(n,t,e,o,c,u,s){let a,l,f=[],d=!1;function p(n){return c.measureSize(s.measure(n))}return{init:function(c){if(!u)return;l=p(n),f=o.map(p),a=new ResizeObserver((s=>{d||(r(u)||u(c,s))&&function(r){for(const u of r){const r=u.target===n,s=o.indexOf(u.target),a=r?l:f[s];if(i(p(r?n:o[s])-a)>=.5){e.requestAnimationFrame((()=>{c.reInit(),t.emit("resize")}));break}}}(s)})),[n].concat(o).forEach((n=>a.observe(n)))},destroy:function(){a&&a.disconnect(),d=!0}}}function E(n,t,e,r,o){const c=o.measure(10),u=o.measure(50),s=x(.1,.99);let a=!1;return{constrain:function(o){if(a||!n.reachedAny(e.get())||!n.reachedAny(t.get()))return;const l=n.reachedMin(t.get())?"min":"max",f=i(n[l]-t.get()),d=e.get()-t.get(),p=s.constrain(f/u);e.subtract(d*p),!o&&i(d)<c&&(e.set(n.constrain(e.get())),r.useDuration(25).useBaseFriction())},toggleActive:function(n){a=!n}}}function O(n,t,e,r){const o=t.min+.1,i=t.max+.1,{reachedMin:c,reachedMax:u}=x(o,i);return{loop:function(t){if(!function(n){return 1===n?u(e.get()):-1===n&&c(e.get())}(t))return;const o=n*(-1*t);r.forEach((n=>n.add(o)))}}}function L(n,t,e,r,o){const{reachedAny:u,removeOffset:s,constrain:l}=r;function f(n){return n.concat().sort(((n,t)=>i(n)-i(t)))[0]}function d(t,r){const o=[t,t+e,t-e];if(!n)return o[0];if(!r)return f(o);const i=o.filter((n=>c(n)===r));return i.length?f(i):a(o)-e}return{byDistance:function(e,r){const c=o.get()+e,{index:a,distance:f}=function(e){const r=n?s(e):l(e),o=t.map((n=>n-r)).map((n=>d(n,0))).map(((n,t)=>({diff:n,index:t}))).sort(((n,t)=>i(n.diff)-i(t.diff))),{index:c}=o[0];return{index:c,distance:r}}(c),p=!n&&u(c);return!r||p?{index:a,distance:e}:{index:a,distance:e+d(t[a]-f,0)}},byIndex:function(n,e){return{index:n,distance:d(t[n]-o.get(),e)}},shortcut:d}}function D(n){let e=n;function r(n){return t(n)?n:n.get()}return{get:function(){return e},set:function(n){e=r(n)},add:function(n){e+=r(n)},subtract:function(n){e-=r(n)}}}function I(n,t,e){const r="x"===n.scroll?function(n){return`translate3d(${n}px,0px,0px)`}:function(n){return`translate3d(0px,${n}px,0px)`},o=e.style;let i=!1;return{clear:function(){i||(o.transform="",e.getAttribute("style")||e.removeAttribute("style"))},to:function(n){i||(o.transform=r(t.apply(n)))},toggleActive:function(n){i=!n}}}function A(n,t,e,r,o,i,c,u,a,l){const f=.5,d=s(i),p=s(i).reverse(),g=function(){const n=u[0];return y(h(p,n),r,!1)}().concat(function(){const n=e-u[0]-1;return y(h(d,n),-r,!0)}());function m(n,t){return n.reduce(((n,t)=>n-i[t]),t)}function h(n,t){return n.reduce(((n,e)=>m(n,t)>0?n.concat([e]):n),[])}function y(i,u,s){const d=function(n){return c.map(((t,r)=>({start:t-o[r]+f+n,end:t+e-f+n})))}(u);return i.map((e=>{const o=s?0:-r,i=s?r:0,c=s?"end":"start",u=d[e][c];return{index:e,loopPoint:u,slideLocation:D(-1),translate:I(n,t,l[e]),target:()=>a.get()>u?o:i}}))}return{canLoop:function(){return g.every((({index:n})=>m(d.filter((t=>t!==n)),e)<=.1))},clear:function(){g.forEach((n=>n.translate.clear()))},loop:function(){g.forEach((n=>{const{target:t,translate:e,slideLocation:r}=n,o=t();o!==r.get()&&(e.to(o),r.set(o))}))},loopPoints:g}}function M(n,t,e){let o,i=!1;return{init:function(c){e&&(o=new MutationObserver((n=>{i||(r(e)||e(c,n))&&function(n){for(const e of n)if("childList"===e.type){c.reInit(),t.emit("slidesChanged");break}}(n)})),o.observe(n,{childList:!0}))},destroy:function(){o&&o.disconnect(),i=!0}}}function T(n,t,e,r){const o={};let i,c=null,u=null,s=!1;return{init:function(){i=new IntersectionObserver((n=>{s||(n.forEach((n=>{const e=t.indexOf(n.target);o[e]=n})),c=null,u=null,e.emit("slidesInView"))}),{root:n.parentElement,threshold:r}),t.forEach((n=>i.observe(n)))},destroy:function(){i&&i.disconnect(),s=!0},get:function(n=!0){if(n&&c)return c;if(!n&&u)return u;const t=function(n){return p(o).reduce(((t,e)=>{const r=parseInt(e),{isIntersecting:i}=o[r];return(n&&i||!n&&!i)&&t.push(r),t}),[])}(n);return n&&(c=t),n||(u=t),t}}}function k(n,e,r,o,c,u,f,d,p,g){const{startEdge:m,endEdge:h}=n,y=t(o);return{groupSlides:function(n){return y?function(n,t){return s(n).filter((n=>n%t==0)).map((e=>n.slice(e,e+t)))}(n,o):function(n){return n.length?s(n).reduce(((t,o)=>{const s=a(t)||0,y=0===s,x=o===l(n),b=u[m]-f[s][m],v=u[m]-f[o][h],S=!c&&y?e.apply(d):0;return i(v-(!c&&x?e.apply(p):0)-(b+S))>r+g&&t.push(o),x&&t.push(n.length),t}),[]).map(((t,e,r)=>{const o=Math.max(r[e-1]||0);return n.slice(o,t)})):[]}(n)}}}function F(n,r,o,p,g,m,F){const{align:P,axis:j,direction:z,startIndex:H,loop:V,duration:N,dragFree:B,dragThreshold:C,inViewThreshold:R,slidesToScroll:q,skipSnaps:G,containScroll:$,watchResize:U,watchSlides:W,watchDrag:J}=m,Q={measure:function(n){const{offsetTop:t,offsetLeft:e,offsetWidth:r,offsetHeight:o}=n;return{top:t,right:e+r,bottom:t+o,left:e,width:r,height:o}}},X=Q.measure(r),Y=o.map(Q.measure),K=function(n){const t="rtl"===n?-1:1;return{apply:function(n){return n*t}}}(z),Z=function(n,t){const e="y"===n?"y":"x";return{scroll:e,cross:"y"===n?"x":"y",startEdge:"y"===e?"top":"rtl"===t?"right":"left",endEdge:"y"===e?"bottom":"rtl"===t?"left":"right",measureSize:function(n){const{width:t,height:r}=n;return"x"===e?t:r}}}(j,z),_=Z.measureSize(X),nn=function(n){return{measure:function(t){return n*(t/100)}}}(_),tn=function(n,t){const r={start:function(){return 0},center:function(n){return o(n)/2},end:o};function o(n){return t-n}return{measure:function(o,i){return e(n)?r[n](o):n(t,o,i)}}}(P,_),en=!V&&!!$,rn=V||!!$,{slideSizes:on,slideSizesWithGaps:cn,startGap:un,endGap:sn}=function(n,t,e,r,o,c){const{measureSize:u,startEdge:s,endEdge:l}=n,d=e[0]&&o,p=function(){if(!d)return 0;const n=e[0];return i(t[s]-n[s])}(),g=function(){if(!d)return 0;const n=c.getComputedStyle(a(r));return parseFloat(n.getPropertyValue(`margin-${l}`))}(),m=e.map(u),h=e.map(((n,t,e)=>{const r=!t,o=f(e,t);return r?m[t]+p:o?m[t]+g:e[t+1][s]-n[s]})).map(i);return{slideSizes:m,slideSizesWithGaps:h,startGap:p,endGap:g}}(Z,X,Y,o,rn,g),an=k(Z,K,_,q,V,X,Y,un,sn,2),{snaps:ln,snapsAligned:fn}=function(n,t,e,r,o){const{startEdge:c,endEdge:u}=n,{groupSlides:s}=o,l=s(r).map((n=>a(n)[u]-n[0][c])).map(i).map(t.measure),f=r.map((n=>e[c]-n[c])).map((n=>-i(n))),d=s(f).map((n=>n[0])).map(((n,t)=>n+l[t]));return{snaps:f,snapsAligned:d}}(Z,tn,X,Y,an),dn=-a(ln)+a(cn),{snapsContained:pn,scrollContainLimit:gn}=function(n,t,e,r,o){const i=x(-t+n,0),c=e.map(((n,t)=>{const{min:r,max:o}=i,c=i.constrain(n),u=!t,s=f(e,t);return u?o:s||l(r,c)?r:l(o,c)?o:c})).map((n=>parseFloat(n.toFixed(3)))),s=function(){const n=c[0],t=a(c);return x(c.lastIndexOf(n),c.indexOf(t)+1)}();function l(n,t){return u(n,t)<1}return{snapsContained:function(){if(t<=n+o)return[i.max];if("keepSnaps"===r)return c;const{min:e,max:u}=s;return c.slice(e,u)}(),scrollContainLimit:s}}(_,dn,fn,$,2),mn=en?pn:fn,{limit:hn}=function(n,t,e){const r=t[0];return{limit:x(e?r-n:a(t),r)}}(dn,mn,V),yn=b(l(mn),H,V),xn=yn.clone(),bn=s(o),vn=y(p,g,(()=>(({dragHandler:n,scrollBody:t,scrollBounds:e,options:{loop:r}})=>{r||e.constrain(n.pointerDown()),t.seek()})(Pn)),(n=>(({scrollBody:n,translate:t,location:e,offsetLocation:r,scrollLooper:o,slideLooper:i,dragHandler:c,animation:u,eventHandler:s,options:{loop:a}},l)=>{const f=n.velocity(),d=n.settled();d&&!c.pointerDown()&&(u.stop(),s.emit("settle")),d||s.emit("scroll"),r.set(e.get()-f+f*l),a&&(o.loop(n.direction()),i.loop()),t.to(r.get())})(Pn,n))),Sn=mn[yn.get()],wn=D(Sn),En=D(Sn),On=D(Sn),Ln=function(n,t,e,r,o){let u=0,s=0,a=r,l=o,f=n.get(),d=0;function p(n){return a=n,m}function g(n){return l=n,m}const m={direction:function(){return s},duration:function(){return a},velocity:function(){return u},seek:function(){const t=e.get()-n.get();let r=0;return a?(u+=t/a,u*=l,f+=u,n.add(u),r=f-d):(u=0,n.set(e),r=t),s=c(r),d=f,m},settled:function(){return i(e.get()-t.get())<.001},useBaseFriction:function(){return g(o)},useBaseDuration:function(){return p(r)},useFriction:g,useDuration:p};return m}(wn,En,On,N,.68),Dn=L(V,mn,dn,hn,On),In=function(n,t,e,r,o,i,c){function u(o){const u=o.distance,s=o.index!==t.get();i.add(u),u&&(r.duration()?n.start():(n.update(),n.render(1),n.update())),s&&(e.set(t.get()),t.set(o.index),c.emit("select"))}return{distance:function(n,t){u(o.byDistance(n,t))},index:function(n,e){const r=t.clone().set(n);u(o.byIndex(r.get(),e))}}}(vn,yn,xn,Ln,Dn,On,F),An=function(n){const{max:t,length:e}=n;return{get:function(n){return e?(n-t)/-e:0}}}(hn),Mn=h(),Tn=T(r,o,F,R),{slideRegistry:kn}=function(n,t,e,r,o,i){const{groupSlides:c}=o,{min:u,max:s}=r;return{slideRegistry:function(){const r=c(i),o=!n||"keepSnaps"===t;return 1===e.length?[i]:o?r:r.slice(u,s).map(((n,t,e)=>{const r=!t,o=f(e,t);return r?d(a(e[0])+1):o?d(l(i)-a(e)[0]+1,a(e)[0]):n}))}()}}(en,$,mn,gn,an,bn),Fn=function(n,e,r,o,i,c){let u=0;function s(n){"Tab"===n.code&&(u=(new Date).getTime())}function a(s){c.add(s,"focus",(()=>{if((new Date).getTime()-u>10)return;n.scrollLeft=0;const c=e.indexOf(s),a=r.findIndex((n=>n.includes(c)));t(a)&&(i.useDuration(0),o.index(a,0))}),{passive:!0,capture:!0})}return{init:function(){c.add(document,"keydown",s,!1),e.forEach(a)}}}(n,o,kn,In,Ln,Mn),Pn={ownerDocument:p,ownerWindow:g,eventHandler:F,containerRect:X,slideRects:Y,animation:vn,axis:Z,direction:K,dragHandler:v(Z,K,n,p,g,On,S(Z,g),wn,vn,In,Ln,Dn,yn,F,nn,B,C,G,.68,J),eventStore:Mn,percentOfView:nn,index:yn,indexPrevious:xn,limit:hn,location:wn,offsetLocation:En,options:m,resizeHandler:w(r,F,g,o,Z,U,Q),scrollBody:Ln,scrollBounds:E(hn,wn,On,Ln,nn),scrollLooper:O(dn,hn,En,[wn,En,On]),scrollProgress:An,scrollSnapList:mn.map(An.get),scrollSnaps:mn,scrollTarget:Dn,scrollTo:In,slideLooper:A(Z,K,_,dn,on,cn,ln,mn,En,o),slideFocus:Fn,slidesHandler:M(r,F,W),slidesInView:Tn,slideIndexes:bn,slideRegistry:kn,slidesToScroll:an,target:On,translate:I(Z,K,r)};return Pn}const P={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0};function j(n){function t(n,t){return g(n,t||{})}const e={mergeOptions:t,optionsAtMedia:function(e){const r=e.breakpoints||{},o=p(r).filter((t=>n.matchMedia(t).matches)).map((n=>r[n])).reduce(((n,e)=>t(n,e)),{});return t(e,o)},optionsMediaQueries:function(t){return t.map((n=>p(n.breakpoints||{}))).reduce(((n,t)=>n.concat(t)),[]).map(n.matchMedia)}};return e}function z(n,t,r){const o=n.ownerDocument,i=o.defaultView,c=j(i),u=function(n){let t=[];return{init:function(e,r){return t=r.filter((({options:t})=>!1!==n.optionsAtMedia(t).active)),t.forEach((t=>t.init(e,n))),r.reduce(((n,t)=>Object.assign(n,{[t.name]:t})),{})},destroy:function(){t=t.filter((n=>n.destroy()))}}}(c),s=h(),a=function(){const n={};let t;function e(t){return n[t]||[]}const r={init:function(n){t=n},emit:function(n){return e(n).forEach((e=>e(t,n))),r},off:function(t,o){return n[t]=e(t).filter((n=>n!==o)),r},on:function(t,o){return n[t]=e(t).concat([o]),r}};return r}(),{mergeOptions:l,optionsAtMedia:f,optionsMediaQueries:d}=c,{on:p,off:g,emit:m}=a,y=A;let x,b,v,S,w=!1,E=l(P,z.globalOptions),O=l(E),L=[];function D(t){const e=F(n,v,S,o,i,t,a);if(t.loop&&!e.slideLooper.canLoop()){return D(Object.assign({},t,{loop:!1}))}return e}function I(t,r){w||(E=l(E,t),O=f(E),L=r||L,function(){const{container:t,slides:r}=O,o=e(t)?n.querySelector(t):t;v=o||n.children[0];const i=e(r)?v.querySelectorAll(r):r;S=[].slice.call(i||v.children)}(),x=D(O),d([E,...L.map((({options:n})=>n))]).forEach((n=>s.add(n,"change",A))),O.active&&(x.translate.to(x.location.get()),x.animation.init(),x.slidesInView.init(),x.slideFocus.init(),x.eventHandler.init(H),x.resizeHandler.init(H),x.slidesHandler.init(H),x.options.loop&&x.slideLooper.loop(),v.offsetParent&&S.length&&x.dragHandler.init(H),b=u.init(H,L)))}function A(n,t){const e=k();M(),I(l({startIndex:e},n),t),a.emit("reInit")}function M(){x.dragHandler.destroy(),x.eventStore.clear(),x.translate.clear(),x.slideLooper.clear(),x.resizeHandler.destroy(),x.slidesHandler.destroy(),x.slidesInView.destroy(),x.animation.destroy(),u.destroy(),s.clear()}function T(n,t,e){O.active&&!w&&(x.scrollBody.useBaseFriction().useDuration(!0===t?0:O.duration),x.scrollTo.index(n,e||0))}function k(){return x.index.get()}const H={canScrollNext:function(){return x.index.add(1).get()!==k()},canScrollPrev:function(){return x.index.add(-1).get()!==k()},containerNode:function(){return v},internalEngine:function(){return x},destroy:function(){w||(w=!0,s.clear(),M(),a.emit("destroy"))},off:g,on:p,emit:m,plugins:function(){return b},previousScrollSnap:function(){return x.indexPrevious.get()},reInit:y,rootNode:function(){return n},scrollNext:function(n){T(x.index.add(1).get(),n,-1)},scrollPrev:function(n){T(x.index.add(-1).get(),n,1)},scrollProgress:function(){return x.scrollProgress.get(x.location.get())},scrollSnapList:function(){return x.scrollSnapList},scrollTo:T,selectedScrollSnap:k,slideNodes:function(){return S},slidesInView:function(){return x.slidesInView.get()},slidesNotInView:function(){return x.slidesInView.get(!1)}};return I(t,r),setTimeout((()=>a.emit("init")),0),H}function H(n){return function(n){return"[object Object]"===Object.prototype.toString.call(n)}(n)||Array.isArray(n)}function V(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}function N(n,t){const e=Object.keys(n),r=Object.keys(t);if(e.length!==r.length)return!1;return JSON.stringify(Object.keys(n.breakpoints||{}))===JSON.stringify(Object.keys(t.breakpoints||{}))&&e.every((e=>{const r=n[e],o=t[e];return"function"==typeof r?`${r}`==`${o}`:H(r)&&H(o)?N(r,o):r===o}))}function B(n){return n.concat().sort(((n,t)=>n.name>t.name?1:-1)).map((n=>n.options))}function C(t,e){let r=t?t():{},o=e?e():[];const[i,c]=n.createSignal(),[u,s]=n.createSignal();function a(){const n=i();n&&n.reInit(r,o)}return n.createEffect(n.on(u,(t=>{if(V()&&t){z.globalOptions=C.globalOptions;const e=z(t,r,o);c(e),n.onCleanup((()=>e.destroy()))}else c(void 0)}))),n.createEffect((()=>{if(!V())return;const n=t?t():{};N(r,n)||(r=n,a())})),n.createEffect((()=>{if(!V())return;const n=e?e():[];(function(n,t){if(n.length!==t.length)return!1;const e=B(n),r=B(t);return e.every(((n,t)=>N(n,r[t])))})(o,n)||(o=n,a())})),[s,i]}return z.globalOptions=void 0,C.globalOptions=void 0,C}));
{
"name": "embla-carousel-solid",
"version": "8.0.0-rc21",
"version": "8.0.0-rc23",
"author": "Liam Martens",

@@ -52,4 +52,4 @@ "description": "A lightweight carousel library with fluid motion and great swipe precision",

"dependencies": {
"embla-carousel": "8.0.0-rc21",
"embla-carousel-reactive-utils": "8.0.0-rc21"
"embla-carousel": "8.0.0-rc23",
"embla-carousel-reactive-utils": "8.0.0-rc23"
},

@@ -56,0 +56,0 @@ "peerDependencies": {

{
"name": "embla-carousel-solid",
"version": "8.0.0-rc22",
"version": "8.0.0-rc23",
"author": "Liam Martens",

@@ -63,4 +63,4 @@ "description": "A lightweight carousel library with fluid motion and great swipe precision",

"dependencies": {
"embla-carousel": "8.0.0-rc22",
"embla-carousel-reactive-utils": "8.0.0-rc22"
"embla-carousel": "8.0.0-rc23",
"embla-carousel-reactive-utils": "8.0.0-rc23"
},

@@ -83,2 +83,2 @@ "peerDependencies": {

}
}
}

@@ -122,2 +122,4 @@ <br />

<img src="https://avatars2.githubusercontent.com/u/9107610?s=120&v=4" title="ruijdacd" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/ranno-lauri">
<img src="https://avatars2.githubusercontent.com/u/87007115?s=120&v=4" title="ranno-lauri" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/pipisasa">

@@ -145,4 +147,2 @@ <img src="https://avatars2.githubusercontent.com/u/54534600?s=120&v=4" title="pipisasa" width="50" height="50" style="max-width: 100%" />

<img src="https://avatars2.githubusercontent.com/u/14075940?s=120&v=4" title="sedlukha" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/allen-garvey">
<img src="https://avatars2.githubusercontent.com/u/9314727?s=120&v=4" title="allen-garvey" width="50" height="50" style="max-width: 100%" />
</a>

@@ -149,0 +149,0 @@ </p>

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc