{"version":3,"sources":["webpack:///./js/components/init-success-stories.ts"],"names":["whenDomReady","then","elements","Array","from","document","querySelectorAll","forEach","element","controls","querySelector","track","progress","items","slider","tns","autoplay","autoplayButtonOutput","autoplayHoverPause","center","container","controlsContainer","loop","nav","touch","slideBy","speed","responsive","768","1024","sliderInfo","getInfo","progressWidth","length","setAttribute","events","on","event","index","slideCount"],"mappings":"2FAAA,4BA6CAA,cAAeC,MA3Cf,WACI,IAAMC,EAAWC,MAAMC,KAAKC,SAASC,iBAAiB,wBACjDJ,GAGLA,EAASK,SAAQ,SAAAC,GACb,IAAMC,EAAWD,EAAQE,cAAc,gCACjCC,EAAQH,EAAQE,cAAc,6BAC9BE,EAAWJ,EAAQE,cAAc,oBACjCG,EAAQL,EAAQF,iBAAiB,0BACjCQ,EAASC,YAAI,CACfC,UAAU,EACVC,sBAAsB,EACtBC,oBAAoB,EACpBC,QAAQ,EACRC,UAAWT,EACXU,kBAAmBZ,EACnBa,MAAM,EACNC,KAAK,EACLC,OAAO,EACPX,MAAO,EACPY,QAAS,EACTC,MAAO,KACPC,WAAY,CACRC,IAAK,CACDf,MAAO,EACPY,QAAS,GAEbI,KAAM,CACFhB,MAAO,EACPY,QAAS,MAIfK,EAAahB,EAAOiB,UACtBC,EAAiBF,EAAWL,QAAUZ,EAAMoB,OAAU,IAC1DrB,WAAUsB,aAAa,QAAvB,4BAAqDF,EAArD,MACAlB,EAAOqB,OAAOC,GAAG,gBAAgB,SAAAC,GAC7BL,GAAkBK,EAAMC,MAAQR,EAAWL,SAAWY,EAAME,WAAc,IAC1E3B,WAAUsB,aAAa,QAAvB,4BAAqDF,EAArD","file":"28-079e3dd974483b11eb42.js","sourcesContent":["import { tns } from 'tiny-slider/src/tiny-slider';\r\nimport whenDomReady from 'when-dom-ready';\r\nfunction initialise() {\r\n const elements = Array.from(document.querySelectorAll('.js-success-stories'));\r\n if (!elements) {\r\n return;\r\n }\r\n elements.forEach(element => {\r\n const controls = element.querySelector('.js-success-stories-controls');\r\n const track = element.querySelector('.js-success-stories-track');\r\n const progress = element.querySelector('.js-progress-bar');\r\n const items = element.querySelectorAll('.js-success-story-item');\r\n const slider = tns({\r\n autoplay: false,\r\n autoplayButtonOutput: false,\r\n autoplayHoverPause: true,\r\n center: false,\r\n container: track,\r\n controlsContainer: controls,\r\n loop: false,\r\n nav: false,\r\n touch: true,\r\n items: 1,\r\n slideBy: 1,\r\n speed: 1500,\r\n responsive: {\r\n 768: {\r\n items: 2,\r\n slideBy: 2,\r\n },\r\n 1024: {\r\n items: 3,\r\n slideBy: 3,\r\n },\r\n },\r\n });\r\n const sliderInfo = slider.getInfo();\r\n let progressWidth = (sliderInfo.slideBy / items.length) * 100;\r\n progress?.setAttribute('style', `--progress-width: ${progressWidth}%`);\r\n slider.events.on('indexChanged', event => {\r\n progressWidth = ((event.index + sliderInfo.slideBy) / event.slideCount) * 100;\r\n progress?.setAttribute('style', `--progress-width: ${progressWidth}%`);\r\n });\r\n });\r\n}\r\nwhenDomReady().then(initialise);\r\n"],"sourceRoot":""}