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

embla-carousel-svelte

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

embla-carousel-svelte - npm Package Compare versions

Comparing version 8.0.0-rc17 to 8.0.0-rc18

1

cjs/index.d.ts

@@ -1,3 +0,2 @@

export { EmblaOptionsType, EmblaEventType, EmblaPluginType, EmblaCarouselType } from 'embla-carousel/index';
export { EmblaCarouselSvelteType } from './components/emblaCarouselSvelte';
export { default } from './components/emblaCarouselSvelte';

120

cjs/package.json
{
"name": "embla-carousel-svelte",
"version": "8.0.0-rc17",
"author": "David Jerleke",
"description": "A lightweight carousel library with fluid motion and great swipe precision",
"repository": {
"type": "git",
"url": "git+https://github.com/davidjerleke/embla-carousel"
},
"bugs": {
"url": "https://github.com/davidjerleke/embla-carousel/issues"
},
"homepage": "https://www.embla-carousel.com",
"license": "MIT",
"keywords": [
"slider",
"carousel",
"slideshow",
"gallery",
"lightweight",
"touch",
"javascript",
"typescript",
"react",
"vue",
"svelte"
],
"main": "embla-carousel-svelte.umd.js",
"unpkg": "embla-carousel-svelte.umd.js",
"module": "embla-carousel-svelte.esm.js",
"types": "index.d.ts",
"sideEffects": false,
"files": [
"embla-carousel-svelte*",
"components/**/*",
"index.d.ts"
],
"devDependencies": {
"@types/jest": "^29.5.6",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@typescript-eslint/parser": "^6.9.0",
"eslint": "^8.52.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^4.0.0",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"prettier": "2.8.8",
"rollup": "^4.1.5",
"svelte": "^3.49.0",
"ts-jest": "^29.1.1",
"typescript": "^5.2.2"
},
"dependencies": {
"embla-carousel": "8.0.0-rc17",
"embla-carousel-reactive-utils": "8.0.0-rc17"
},
"peerDependencies": {
"svelte": "^3.49.0 || ^4.0.0"
},
"type": "commonjs"
}
"name": "embla-carousel-svelte",
"version": "8.0.0-rc18",
"author": "David Jerleke",
"description": "A lightweight carousel library with fluid motion and great swipe precision",
"repository": {
"type": "git",
"url": "git+https://github.com/davidjerleke/embla-carousel"
},
"bugs": {
"url": "https://github.com/davidjerleke/embla-carousel/issues"
},
"homepage": "https://www.embla-carousel.com",
"license": "MIT",
"keywords": [
"slider",
"carousel",
"slideshow",
"gallery",
"lightweight",
"touch",
"javascript",
"typescript",
"react",
"vue",
"svelte"
],
"main": "embla-carousel-svelte.umd.js",
"unpkg": "embla-carousel-svelte.umd.js",
"module": "embla-carousel-svelte.esm.js",
"types": "index.d.ts",
"sideEffects": false,
"files": [
"embla-carousel-svelte*",
"components/**/*",
"index.d.ts"
],
"devDependencies": {
"@types/jest": "^29.5.6",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@typescript-eslint/parser": "^6.9.0",
"eslint": "^8.52.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^4.0.0",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"prettier": "2.8.8",
"rollup": "^4.1.5",
"svelte": "^3.49.0",
"ts-jest": "^29.1.1",
"typescript": "^5.2.2"
},
"dependencies": {
"embla-carousel": "8.0.0-rc18",
"embla-carousel-reactive-utils": "8.0.0-rc18"
},
"peerDependencies": {
"svelte": "^3.49.0 || ^4.0.0"
},
"type": "commonjs"
}

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

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

@@ -1,3 +0,2 @@

export { EmblaOptionsType, EmblaEventType, EmblaPluginType, EmblaCarouselType } from 'embla-carousel/index.ts';
export { EmblaCarouselSvelteType } from './components/emblaCarouselSvelte.ts';
export { default } from './components/emblaCarouselSvelte.ts';
{
"name": "embla-carousel-svelte",
"version": "8.0.0-rc17",
"author": "David Jerleke",
"description": "A lightweight carousel library with fluid motion and great swipe precision",
"repository": {
"type": "git",
"url": "git+https://github.com/davidjerleke/embla-carousel"
},
"bugs": {
"url": "https://github.com/davidjerleke/embla-carousel/issues"
},
"homepage": "https://www.embla-carousel.com",
"license": "MIT",
"keywords": [
"slider",
"carousel",
"slideshow",
"gallery",
"lightweight",
"touch",
"javascript",
"typescript",
"react",
"vue",
"svelte"
],
"main": "embla-carousel-svelte.umd.js",
"unpkg": "embla-carousel-svelte.umd.js",
"module": "embla-carousel-svelte.esm.js",
"types": "index.d.ts",
"sideEffects": false,
"files": [
"embla-carousel-svelte*",
"components/**/*",
"index.d.ts"
],
"devDependencies": {
"@types/jest": "^29.5.6",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@typescript-eslint/parser": "^6.9.0",
"eslint": "^8.52.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^4.0.0",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"prettier": "2.8.8",
"rollup": "^4.1.5",
"svelte": "^3.49.0",
"ts-jest": "^29.1.1",
"typescript": "^5.2.2"
},
"dependencies": {
"embla-carousel": "8.0.0-rc17",
"embla-carousel-reactive-utils": "8.0.0-rc17"
},
"peerDependencies": {
"svelte": "^3.49.0 || ^4.0.0"
},
"type": "module"
}
"name": "embla-carousel-svelte",
"version": "8.0.0-rc18",
"author": "David Jerleke",
"description": "A lightweight carousel library with fluid motion and great swipe precision",
"repository": {
"type": "git",
"url": "git+https://github.com/davidjerleke/embla-carousel"
},
"bugs": {
"url": "https://github.com/davidjerleke/embla-carousel/issues"
},
"homepage": "https://www.embla-carousel.com",
"license": "MIT",
"keywords": [
"slider",
"carousel",
"slideshow",
"gallery",
"lightweight",
"touch",
"javascript",
"typescript",
"react",
"vue",
"svelte"
],
"main": "embla-carousel-svelte.umd.js",
"unpkg": "embla-carousel-svelte.umd.js",
"module": "embla-carousel-svelte.esm.js",
"types": "index.d.ts",
"sideEffects": false,
"files": [
"embla-carousel-svelte*",
"components/**/*",
"index.d.ts"
],
"devDependencies": {
"@types/jest": "^29.5.6",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@typescript-eslint/parser": "^6.9.0",
"eslint": "^8.52.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^4.0.0",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"prettier": "2.8.8",
"rollup": "^4.1.5",
"svelte": "^3.49.0",
"ts-jest": "^29.1.1",
"typescript": "^5.2.2"
},
"dependencies": {
"embla-carousel": "8.0.0-rc18",
"embla-carousel-reactive-utils": "8.0.0-rc18"
},
"peerDependencies": {
"svelte": "^3.49.0 || ^4.0.0"
},
"type": "module"
}

@@ -1,3 +0,2 @@

export { EmblaOptionsType, EmblaEventType, EmblaPluginType, EmblaCarouselType } from 'embla-carousel/index';
export { EmblaCarouselSvelteType } from './components/emblaCarouselSvelte';
export { default } from './components/emblaCarouselSvelte';
{
"name": "embla-carousel-svelte",
"version": "8.0.0-rc17",
"version": "8.0.0-rc18",
"author": "David Jerleke",

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

"build": "rollup --bundleConfigAsCjs -c",
"start": "rollup --bundleConfigAsCjs -c --watch",
"start": "rollup --bundleConfigAsCjs -c --watch --environment BUILD:development",
"eslint:report": "eslint \"src/**/*.{js,tsx,ts}\""

@@ -63,4 +63,4 @@ },

"dependencies": {
"embla-carousel": "8.0.0-rc17",
"embla-carousel-reactive-utils": "8.0.0-rc17"
"embla-carousel": "8.0.0-rc18",
"embla-carousel-reactive-utils": "8.0.0-rc18"
},

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

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

<img src="https://avatars2.githubusercontent.com/u/91487491?s=120&v=4" title="hamidrezahanafi" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/zaaakher">
<img src="https://avatars2.githubusercontent.com/u/46135573?s=120&v=4" title="zaaakher" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/wopian">

@@ -98,0 +100,0 @@ <img src="https://avatars2.githubusercontent.com/u/3440094?s=120&v=4" title="wopian" width="50" height="50" style="max-width: 100%" />

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