{"version":3,"sources":["webpack://@verndale/toolkit/./node_modules/@motionone/dom/dist/gestures/in-view.es.js","webpack://@verndale/toolkit/./src/js/modules/scrollSection.ts"],"names":["thresholds","inView","elementOrSelector","onStart","root","rootMargin","amount","elements","activeIntersections","onIntersectionChange","entries","entry","onEnd","newOnEnd","observer","element","ScrollSection","Component","el","sequence","timeline"],"mappings":"kKAGA,MAAMA,EAAa,CACf,IAAK,EACL,IAAK,CACT,EACA,SAASC,EAAOC,EAAmBC,EAAS,CAAE,KAAAC,EAAM,OAAQC,EAAY,OAAAC,EAAS,KAAM,EAAI,CAAC,EAAG,CAO3F,GAAI,OAAO,qBAAyB,IAChC,MAAO,IAAM,CAAE,EAEnB,MAAMC,G,EAAW,KAAgBL,CAAiB,EAC5CM,EAAsB,IAAI,QAC1BC,EAAwBC,GAAY,CACtCA,EAAQ,QAASC,GAAU,CACvB,MAAMC,EAAQJ,EAAoB,IAAIG,EAAM,MAAM,EAKlD,GAAIA,EAAM,iBAAmB,QAAQC,CAAK,EAE1C,GAAID,EAAM,eAAgB,CACtB,MAAME,EAAWV,EAAQQ,CAAK,G,EAC1B,KAAWE,CAAQ,EACnBL,EAAoB,IAAIG,EAAM,OAAQE,CAAQ,EAG9CC,EAAS,UAAUH,EAAM,MAAM,CAEvC,MACSC,IACLA,EAAMD,CAAK,EACXH,EAAoB,OAAOG,EAAM,MAAM,EAE/C,CAAC,CACL,EACMG,EAAW,IAAI,qBAAqBL,EAAsB,CAC5D,KAAAL,EACA,WAAAC,EACA,UAAW,OAAOC,GAAW,SAAWA,EAASN,EAAWM,EAChE,CAAC,EACD,OAAAC,EAAS,QAASQ,GAAYD,EAAS,QAAQC,CAAO,CAAC,EAChD,IAAMD,EAAS,WAAW,CACrC,C,8FC9CA,MAAME,UAAsBC,WAAU,CACpC,YAAYC,EAAiB,CAC3B,MAAMA,CAAE,EACR,KAAK,UAAU,CACjB,CAEA,eAAgB,CACd,KAAK,IAAM,CACT,mBAAoB,KAAK,GAAG,cAC1B,gCACF,CACF,CACF,CAEA,WAAY,CACV,MAAMC,EAA+B,CAAC,EACtCA,EAAS,KAAK,CACZ,KAAK,IAAI,mBACT,CAAE,QAAS,CAAC,EAAG,CAAC,CAAE,EAClB,CAAE,SAAU,GAAK,GAAI,GAAK,OAAQ,SAAU,CAC9C,CAAC,G,EAEDlB,KAAO,iCAAkC,IAAM,E,EAC7CmB,KAASD,CAAQ,CACnB,CAAC,CACH,CACF,CAEA,QAAeH,C","file":"scripts/1862.5b6e401bff4ae9a89500.js","sourcesContent":["import { resolveElements } from '../utils/resolve-elements.es.js';\nimport { isFunction } from '@motionone/utils';\n\nconst thresholds = {\n    any: 0,\n    all: 1,\n};\nfunction inView(elementOrSelector, onStart, { root, margin: rootMargin, amount = \"any\" } = {}) {\n    /**\n     * If this browser doesn't support IntersectionObserver, return a dummy stop function.\n     * Default triggering of onStart is tricky - it could be used for starting/stopping\n     * videos, lazy loading content etc. We could provide an option to enable a fallback, or\n     * provide a fallback callback option.\n     */\n    if (typeof IntersectionObserver === \"undefined\") {\n        return () => { };\n    }\n    const elements = resolveElements(elementOrSelector);\n    const activeIntersections = new WeakMap();\n    const onIntersectionChange = (entries) => {\n        entries.forEach((entry) => {\n            const onEnd = activeIntersections.get(entry.target);\n            /**\n             * If there's no change to the intersection, we don't need to\n             * do anything here.\n             */\n            if (entry.isIntersecting === Boolean(onEnd))\n                return;\n            if (entry.isIntersecting) {\n                const newOnEnd = onStart(entry);\n                if (isFunction(newOnEnd)) {\n                    activeIntersections.set(entry.target, newOnEnd);\n                }\n                else {\n                    observer.unobserve(entry.target);\n                }\n            }\n            else if (onEnd) {\n                onEnd(entry);\n                activeIntersections.delete(entry.target);\n            }\n        });\n    };\n    const observer = new IntersectionObserver(onIntersectionChange, {\n        root,\n        rootMargin,\n        threshold: typeof amount === \"number\" ? amount : thresholds[amount],\n    });\n    elements.forEach((element) => observer.observe(element));\n    return () => observer.disconnect();\n}\n\nexport { inView };\n","import { Component } from '@verndale/core';\nimport { inView, timeline } from 'motion';\nimport { TimelineDefinition } from '@motionone/dom/types/timeline/types';\n\nclass ScrollSection extends Component {\n  constructor(el: HTMLElement) {\n    super(el);\n    this.animateIn();\n  }\n\n  setupDefaults() {\n    this.dom = {\n      scrollSectionLabel: this.el.querySelector<HTMLElement>(\n        '.scroll-section__content-label'\n      )\n    };\n  }\n\n  animateIn() {\n    const sequence: TimelineDefinition = [];\n    sequence.push([\n      this.dom.scrollSectionLabel as HTMLHeadingElement,\n      { opacity: [0, 1] },\n      { duration: 0.8, at: 0.2, easing: 'ease-in' }\n    ]);\n\n    inView('.scroll-section__content-label', () => {\n      timeline(sequence);\n    });\n  }\n}\n\nexport default ScrollSection;\n"],"sourceRoot":""}