vendor: 1,734 bytes, lines 1-59
1// src/components/carousel/autoplay-controller.ts 2var AutoplayController = class { 3 constructor(host, tickCallback) { 4 this.timerId = 0; 5 this.activeInteractions = 0; 6 this.paused = false; 7 this.stopped = true; 8 this.pause = () => { 9 if (!this.activeInteractions++) { 10 this.paused = true; 11 this.host.requestUpdate(); 12 } 13 }; 14 this.resume = () => { 15 if (!--this.activeInteractions) { 16 this.paused = false; 17 this.host.requestUpdate(); 18 } 19 }; 20 host.addController(this); 21 this.host = host; 22 this.tickCallback = tickCallback; 23 } 24 hostConnected() { 25 this.host.addEventListener("mouseenter", this.pause); 26 this.host.addEventListener("mouseleave", this.resume); 27 this.host.addEventListener("focusin", this.pause); 28 this.host.addEventListener("focusout", this.resume); 29 this.host.addEventListener("touchstart", this.pause, { passive: true }); 30 this.host.addEventListener("touchend", this.resume); 31 } 32 hostDisconnected() { 33 this.stop(); 34 this.host.removeEventListener("mouseenter", this.pause); 35 this.host.removeEventListener("mouseleave", this.resume); 36 this.host.removeEventListener("focusin", this.pause); 37 this.host.removeEventListener("focusout", this.resume); 38 this.host.removeEventListener("touchstart", this.pause); 39 this.host.removeEventListener("touchend", this.resume); 40 } 41 start(interval) { 42 this.stop(); 43 this.stopped = false; 44 this.timerId = window.setInterval(() => { 45 if (!this.paused) { 46 this.tickCallback(); 47 } 48 }, interval); 49 } 50 stop() { 51 clearInterval(this.timerId); 52 this.stopped = true; 53 this.host.requestUpdate(); 54 } 55}; 56 57export { 58 AutoplayController 59};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.