{"version":3,"sources":["webpack://wweebpack/./node_modules/@splidejs/splide-extension-auto-scroll/dist/js/splide-extension-auto-scroll.esm.js"],"names":["slice$1","arrayLike","start","end","Array","prototype","slice","call","apply$1","func","bind","apply","concat","arguments","raf","requestAnimationFrame","typeOf$1","type","subject","isArray$1","isArray","toArray$1","value","forEach$1","values","iteratee","forEach","ownKeys$1","Object","keys","forOwn$1","object","right","reverse","i","length","key","min$1","Math","min","EVENT_MOVE","EVENT_MOVED","EVENT_DRAG","EVENT_SCROLL","EVENT_SCROLLED","RequestInterval","interval","onInterval","onUpdate","limit","startTime","id","now","Date","rate","paused","count","update","pause","cancel","cancelAnimationFrame","resume","rewind","set","time","isPaused","typeOf","isObject","isNull","isUndefined","ownKeys","forOwn","assign","source","setAttribute","elms","attrs","value2","name","elm","attr","removeAttribute","String","max","floor","ceil","abs","DEFAULTS","speed","autoStart","pauseOnHover","pauseOnFocus","I18N","startScroll","pauseScroll","AutoScroll","Splide2","Components2","options","on","off","unbind","bus","event","document","createDocumentFragment","binder","listeners","forEachEvent","targets","events","target","events2","split","eventNS","fragment","callback","namespace","isEventTarget","remover","removeEventListener","addEventListener","push","filter","listener","dispatch","detail","e","CustomEvent","bubbles","createEvent","initCustomEvent","dispatchEvent","destroy","data","EventBinder","assign$1","join","emit","EventInterface","translate","getPosition","toIndex","getLimit","Move","setIndex","getIndex","Controller","orient","Direction","toggle","Elements","Live","root","throttledUpdateArrows","duration","Throttle","Arrows","stopped","hovered","focused","busy","currPosition","autoScrollOptions","mount","is","autoScroll","move","autoToggle","useToggleButton","play","readyState","window","disable","updateButton","stop","position","destination","number","x","y","minimum","maximum","clamp","computeDestination","index","Slides","Pagination","lazyLoad","LazyLoad","check","updateIndex","go","getEnd","add","classList","i18n","setup"],"mappings":";6SAUA,SAASA,EAAQC,EAAWC,EAAOC,GACjC,OAAOC,MAAMC,UAAUC,MAAMC,KAAKN,EAAWC,EAAOC,GAGtD,SAASK,EAAQC,GACf,OAAOA,EAAKC,KAA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A+NHuE,IA7Nd5H,EArCe,aAqCGoD,IACZA,GACFC,EAAIoH,UAAUD,EAAM,MAAQ,UAAUpH,MA4NxCJ,EAAa4E,EAAQ,aAAcpD,EAAQkG,KAAKhK,IAAQwD,EAAKxD,IAhOnE,IAAqB2C,EAAcmH,EAmOjC,SAASjI,KACP,OAAQnB,GAAYA,EAASmB,WAE/B,MAAO,CACLoI,MA1IF,WACE,MAAM,WAAE/B,GAAepE,EACvBiE,EAAoB3F,EAAO,GAAIe,EAAUpB,EAASmG,GAAcA,EAAa,KAyI7EF,QACA/B,UACAqC,OACAhH,QACAO","file":"vendors-node_modules_splidejs_splide-extension-auto-scroll_dist_js_splide-extension-auto-scro-397893.js","sourcesContent":["/*!\n * @splidejs/splide-extension-auto-scroll\n * Version : 0.5.3\n * License : MIT\n * Copyright: 2022 Naotoshi Fujita\n */\nfunction empty(array) {\n array.length = 0;\n}\n\nfunction slice$1(arrayLike, start, end) {\n return Array.prototype.slice.call(arrayLike, start, end);\n}\n\nfunction apply$1(func) {\n return func.bind.apply(func, [null].concat(slice$1(arguments, 1)));\n}\n\nfunction raf(func) {\n return requestAnimationFrame(func);\n}\n\nfunction typeOf$1(type, subject) {\n return typeof subject === type;\n}\n\nvar isArray$1 = Array.isArray;\napply$1(typeOf$1, \"function\");\napply$1(typeOf$1, \"string\");\napply$1(typeOf$1, \"undefined\");\n\nfunction toArray$1(value) {\n return isArray$1(value) ? value : [value];\n}\n\nfunction forEach$1(values, iteratee) {\n toArray$1(values).forEach(iteratee);\n}\n\nvar ownKeys$1 = Object.keys;\n\nfunction forOwn$1(object, iteratee, right) {\n if (object) {\n var keys = ownKeys$1(object);\n keys = right ? keys.reverse() : keys;\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== \"__proto__\") {\n if (iteratee(object[key], key) === false) {\n break;\n }\n }\n }\n }\n\n return object;\n}\n\nfunction assign$1(object) {\n slice$1(arguments, 1).forEach(function (source) {\n forOwn$1(source, function (value, key) {\n object[key] = source[key];\n });\n });\n return object;\n}\n\nvar min$1 = Math.min;\n\nfunction EventBinder() {\n var listeners = [];\n\n function bind(targets, events, callback, options) {\n forEachEvent(targets, events, function (target, event, namespace) {\n var isEventTarget = (\"addEventListener\" in target);\n var remover = isEventTarget ? target.removeEventListener.bind(target, event, callback, options) : target[\"removeListener\"].bind(target, callback);\n isEventTarget ? target.addEventListener(event, callback, options) : target[\"addListener\"](callback);\n listeners.push([target, event, namespace, callback, remover]);\n });\n }\n\n function unbind(targets, events, callback) {\n forEachEvent(targets, events, function (target, event, namespace) {\n listeners = listeners.filter(function (listener) {\n if (listener[0] === target && listener[1] === event && listener[2] === namespace && (!callback || listener[3] === callback)) {\n listener[4]();\n return false;\n }\n\n return true;\n });\n });\n }\n\n function dispatch(target, type, detail) {\n var e;\n var bubbles = true;\n\n if (typeof CustomEvent === \"function\") {\n e = new CustomEvent(type, {\n bubbles: bubbles,\n detail: detail\n });\n } else {\n e = document.createEvent(\"CustomEvent\");\n e.initCustomEvent(type, bubbles, false, detail);\n }\n\n target.dispatchEvent(e);\n return e;\n }\n\n function forEachEvent(targets, events, iteratee) {\n forEach$1(targets, function (target) {\n target && forEach$1(events, function (events2) {\n events2.split(\" \").forEach(function (eventNS) {\n var fragment = eventNS.split(\".\");\n iteratee(target, fragment[0], fragment[1]);\n });\n });\n });\n }\n\n function destroy() {\n listeners.forEach(function (data) {\n data[4]();\n });\n empty(listeners);\n }\n\n return {\n bind: bind,\n unbind: unbind,\n dispatch: dispatch,\n destroy: destroy\n };\n}\nvar EVENT_MOVE = \"move\";\nvar EVENT_MOVED = \"moved\";\nvar EVENT_UPDATED = \"updated\";\nvar EVENT_DRAG = \"drag\";\nvar EVENT_DRAGGED = \"dragged\";\nvar EVENT_SCROLL = \"scroll\";\nvar EVENT_SCROLLED = \"scrolled\";\nvar EVENT_DESTROY = \"destroy\";\n\nfunction EventInterface(Splide2) {\n var bus = Splide2 ? Splide2.event.bus : document.createDocumentFragment();\n var binder = EventBinder();\n\n function on(events, callback) {\n binder.bind(bus, toArray$1(events).join(\" \"), function (e) {\n callback.apply(callback, isArray$1(e.detail) ? e.detail : []);\n });\n }\n\n function emit(event) {\n binder.dispatch(bus, event, slice$1(arguments, 1));\n }\n\n if (Splide2) {\n Splide2.event.on(EVENT_DESTROY, binder.destroy);\n }\n\n return assign$1(binder, {\n bus: bus,\n on: on,\n off: apply$1(binder.unbind, bus),\n emit: emit\n });\n}\n\nfunction RequestInterval(interval, onInterval, onUpdate, limit) {\n var now = Date.now;\n var startTime;\n var rate = 0;\n var id;\n var paused = true;\n var count = 0;\n\n function update() {\n if (!paused) {\n rate = interval ? min$1((now() - startTime) / interval, 1) : 1;\n onUpdate && onUpdate(rate);\n\n if (rate >= 1) {\n onInterval();\n startTime = now();\n\n if (limit && ++count >= limit) {\n return pause();\n }\n }\n\n raf(update);\n }\n }\n\n function start(resume) {\n !resume && cancel();\n startTime = now() - (resume ? rate * interval : 0);\n paused = false;\n raf(update);\n }\n\n function pause() {\n paused = true;\n }\n\n function rewind() {\n startTime = now();\n rate = 0;\n\n if (onUpdate) {\n onUpdate(rate);\n }\n }\n\n function cancel() {\n id && cancelAnimationFrame(id);\n rate = 0;\n id = 0;\n paused = true;\n }\n\n function set(time) {\n interval = time;\n }\n\n function isPaused() {\n return paused;\n }\n\n return {\n start: start,\n rewind: rewind,\n pause: pause,\n cancel: cancel,\n set: set,\n isPaused: isPaused\n };\n}\n\nfunction Throttle(func, duration) {\n var interval;\n\n function throttled() {\n if (!interval) {\n interval = RequestInterval(duration || 0, function () {\n func();\n interval = null;\n }, null, 1);\n interval.start();\n }\n }\n\n return throttled;\n}\nvar CLASS_ACTIVE = \"is-active\";\n\nvar SLIDE = \"slide\";\nvar FADE = \"fade\";\n\nfunction slice(arrayLike, start, end) {\n return Array.prototype.slice.call(arrayLike, start, end);\n}\n\nfunction apply(func) {\n return func.bind(null, ...slice(arguments, 1));\n}\n\nfunction typeOf(type, subject) {\n return typeof subject === type;\n}\nfunction isObject(subject) {\n return !isNull(subject) && typeOf(\"object\", subject);\n}\nconst isArray = Array.isArray;\napply(typeOf, \"function\");\napply(typeOf, \"string\");\nconst isUndefined = apply(typeOf, \"undefined\");\nfunction isNull(subject) {\n return subject === null;\n}\n\nfunction toArray(value) {\n return isArray(value) ? value : [value];\n}\n\nfunction forEach(values, iteratee) {\n toArray(values).forEach(iteratee);\n}\n\nfunction toggleClass(elm, classes, add) {\n if (elm) {\n forEach(classes, (name) => {\n if (name) {\n elm.classList[add ? \"add\" : \"remove\"](name);\n }\n });\n }\n}\n\nconst ownKeys = Object.keys;\n\nfunction forOwn(object, iteratee, right) {\n if (object) {\n let keys = ownKeys(object);\n keys = right ? keys.reverse() : keys;\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (key !== \"__proto__\") {\n if (iteratee(object[key], key) === false) {\n break;\n }\n }\n }\n }\n return object;\n}\n\nfunction assign(object) {\n slice(arguments, 1).forEach((source) => {\n forOwn(source, (value, key) => {\n object[key] = source[key];\n });\n });\n return object;\n}\n\nfunction removeAttribute(elms, attrs) {\n forEach(elms, (elm) => {\n forEach(attrs, (attr) => {\n elm && elm.removeAttribute(attr);\n });\n });\n}\n\nfunction setAttribute(elms, attrs, value) {\n if (isObject(attrs)) {\n forOwn(attrs, (value2, name) => {\n setAttribute(elms, name, value2);\n });\n } else {\n forEach(elms, (elm) => {\n isNull(value) || value === \"\" ? removeAttribute(elm, attrs) : elm.setAttribute(attrs, String(value));\n });\n }\n}\n\nconst { min, max, floor, ceil, abs } = Math;\n\nfunction clamp(number, x, y) {\n const minimum = min(x, y);\n const maximum = max(x, y);\n return min(max(minimum, number), maximum);\n}\n\nconst DEFAULTS = {\n speed: 1,\n autoStart: true,\n pauseOnHover: true,\n pauseOnFocus: true\n};\n\nconst I18N = {\n startScroll: \"Start auto scroll\",\n pauseScroll: \"Pause auto scroll\"\n};\n\nfunction AutoScroll(Splide2, Components2, options) {\n const { on, off, bind, unbind } = EventInterface(Splide2);\n const { translate, getPosition, toIndex, getLimit } = Components2.Move;\n const { setIndex, getIndex } = Components2.Controller;\n const { orient } = Components2.Direction;\n const { toggle } = Components2.Elements;\n const { Live } = Components2;\n const { root } = Splide2;\n const throttledUpdateArrows = Throttle(Components2.Arrows.update, 500);\n let autoScrollOptions = {};\n let interval;\n let stopped;\n let hovered;\n let focused;\n let busy;\n let currPosition;\n function setup() {\n const { autoScroll } = options;\n autoScrollOptions = assign({}, DEFAULTS, isObject(autoScroll) ? autoScroll : {});\n }\n function mount() {\n if (!Splide2.is(FADE)) {\n if (!interval && options.autoScroll !== false) {\n interval = RequestInterval(0, move);\n listen();\n autoStart();\n }\n }\n }\n function destroy() {\n if (interval) {\n interval.cancel();\n interval = null;\n currPosition = void 0;\n off([EVENT_MOVE, EVENT_DRAG, EVENT_SCROLL, EVENT_MOVED, EVENT_SCROLLED]);\n unbind(root, \"mouseenter mouseleave focusin focusout\");\n unbind(toggle, \"click\");\n }\n }\n function listen() {\n if (autoScrollOptions.pauseOnHover) {\n bind(root, \"mouseenter mouseleave\", (e) => {\n hovered = e.type === \"mouseenter\";\n autoToggle();\n });\n }\n if (autoScrollOptions.pauseOnFocus) {\n bind(root, \"focusin focusout\", (e) => {\n focused = e.type === \"focusin\";\n autoToggle();\n });\n }\n if (autoScrollOptions.useToggleButton) {\n bind(toggle, \"click\", () => {\n stopped ? play() : pause();\n });\n }\n on(EVENT_UPDATED, update);\n on([EVENT_MOVE, EVENT_DRAG, EVENT_SCROLL], () => {\n busy = true;\n pause(false);\n });\n on([EVENT_MOVED, EVENT_DRAGGED, EVENT_SCROLLED], () => {\n busy = false;\n autoToggle();\n });\n }\n function update() {\n const { autoScroll } = options;\n if (autoScroll !== false) {\n autoScrollOptions = assign({}, autoScrollOptions, isObject(autoScroll) ? autoScroll : {});\n mount();\n } else {\n destroy();\n }\n if (interval && !isUndefined(currPosition)) {\n translate(currPosition);\n }\n }\n function autoStart() {\n if (autoScrollOptions.autoStart) {\n if (document.readyState === \"complete\") {\n play();\n } else {\n bind(window, \"load\", play);\n }\n }\n }\n function play() {\n if (isPaused()) {\n interval.start(true);\n Live.disable(true);\n focused = hovered = stopped = false;\n updateButton();\n }\n }\n function pause(stop = true) {\n if (!stopped) {\n stopped = stop;\n updateButton();\n if (!isPaused()) {\n interval.pause();\n Live.disable(false);\n }\n }\n }\n function autoToggle() {\n if (!stopped) {\n hovered || focused || busy ? pause(false) : play();\n }\n }\n function move() {\n const position = getPosition();\n const destination = computeDestination(position);\n if (position !== destination) {\n translate(destination);\n updateIndex(currPosition = getPosition());\n } else {\n pause(false);\n if (autoScrollOptions.rewind) {\n Splide2.go(autoScrollOptions.speed > 0 ? 0 : Components2.Controller.getEnd());\n }\n }\n throttledUpdateArrows();\n }\n function computeDestination(position) {\n const speed = autoScrollOptions.speed || 1;\n position += orient(speed);\n if (Splide2.is(SLIDE)) {\n position = clamp(position, getLimit(false), getLimit(true));\n }\n return position;\n }\n function updateIndex(position) {\n const { length } = Splide2;\n const index = (toIndex(position) + length) % length;\n if (index !== getIndex()) {\n setIndex(index);\n Components2.Slides.update();\n Components2.Pagination.update();\n options.lazyLoad === \"nearby\" && Components2.LazyLoad.check();\n }\n }\n function updateButton() {\n if (toggle) {\n const key = stopped ? \"startScroll\" : \"pauseScroll\";\n toggleClass(toggle, CLASS_ACTIVE, !stopped);\n setAttribute(toggle, \"aria-label\", options.i18n[key] || I18N[key]);\n }\n }\n function isPaused() {\n return !interval || interval.isPaused();\n }\n return {\n setup,\n mount,\n destroy,\n play,\n pause,\n isPaused\n };\n}\n\nexport { AutoScroll };\n"],"sourceRoot":""}