{"version":3,"sources":["webpack://frontendplaceholder/./Src/Scripts/controllers/event-page.js"],"names":["constructor","elem","heroElms","querySelectorAll","discountLinkElm","discountsSlideInModalElm","querySelector","discountsSlideInModal","importSlideInModalPromise","forEach","link","addEventListener","le","preventDefault","key","getAttribute","open","then","importResult","default","SlideInModal","SplitType","startVideos","x","style","display","heroVideo","heroImg","play","gsap","to","duration","opacity","tl","timeline","onComplete","fromTo","y","addLabel","animateIn"],"mappings":"wMAAA,I,EAAA,UACA,G,EAAA,U,qCAEe,MACXA,YAAYC,GACR,MAAMC,EAAWD,EAAKE,iBAAiB,2BACjCC,EAAkBH,EAAKE,iBAAiB,oCACxCE,EAA2BJ,EAAKK,cAAc,+CACpD,IAAIC,EAAwB,KACxBC,EAA4B,KAW5BJ,IACAA,WAAiBK,SAAQC,IACrBA,EAAKC,iBAAiB,SAASC,IAC3BA,EAAGC,iBACH,MACMC,EADQT,EAAyBC,cAAc,uCACnCS,aAAa,qCAC3BR,EACAA,EAAsBS,KAAKF,GACpBT,IAjBdG,IACDA,EAA4B,+BACvBS,MAAKC,GACKA,EAAaC,WAGzBX,GAaUS,MAAKG,IACFb,EAAwB,IAAIa,EAAaf,GACzCE,EAAsBS,KAAKF,aAOnD,IAAIO,UAAU,mBACd,MAAMC,EAAc,WAChBpB,EAASO,SAAQc,IACb,GAAwB,SAApBA,EAAEC,MAAMC,QACR,OAGJ,MAAMC,EAAYH,EAAEjB,cAAc,4BAClC,GAAIoB,EAAW,CACX,MAAMC,EAAUJ,EAAEjB,cAAc,4BAChCoB,EAAUE,OACVC,OAAKC,GAAGH,EAAS,CAAEI,SAAU,EAAGC,QAAS,IACzCH,OAAKC,GAAGJ,EAAW,CAAEK,SAAU,EAAGC,QAAS,UAIrC,WACd,MAAMC,EAAKJ,OAAKK,SAAS,CACrBC,WAAYb,IAEhBW,EAAGG,OAAOnC,EAAKK,cAAc,8BAA+B,CAAE0B,QAAS,EAAGK,EAAG,GAAK,CAAEN,SAAU,EAAGC,QAAS,EAAGK,EAAG,IAChHJ,EAAGG,OAAOnC,EAAKK,cAAc,yBAA0B,CAAE0B,QAAS,EAAGK,EAAG,GAAK,CAAEN,SAAU,EAAGC,QAAS,EAAGK,EAAG,IAC3GJ,EAAGK,SAAS,aACZL,EAAGG,OAAOnC,EAAKE,iBAAiB,+CAAgD,CAAE6B,QAAS,EAAGK,EAAG,IAAM,CAAEN,SAAU,EAAGC,QAAS,EAAGK,EAAG,GAAK,kBAE9IE","file":"5972.2ca899da6b0a65e0ce9a.js","sourcesContent":["import { gsap } from 'gsap';\nimport SplitType from 'split-type';\n\nexport default class EventPage {\n constructor(elem) {\n const heroElms = elem.querySelectorAll('[data-event-page__hero]');\n const discountLinkElm = elem.querySelectorAll('[data-event-page__discount-link]');\n const discountsSlideInModalElm = elem.querySelector('[data-event-page__discounts-slide-in-modal]');\n let discountsSlideInModal = null;\n let importSlideInModalPromise = null;\n const importSlideInModal = function () {\n if (!importSlideInModalPromise) {\n importSlideInModalPromise = import('../components/slide-in-modal')\n .then(importResult => {\n return importResult.default;\n });\n }\n return importSlideInModalPromise;\n };\n\n if (discountLinkElm) {\n discountLinkElm?.forEach(link => {\n link.addEventListener('click', le => {\n le.preventDefault();\n const first = discountsSlideInModalElm.querySelector('[data-slide-in-modal__section-link]');\n const key = first.getAttribute('data-slide-in-modal__section-link');\n if (discountsSlideInModal) {\n discountsSlideInModal.open(key);\n } else if (discountsSlideInModalElm) {\n importSlideInModal()\n .then(SlideInModal => {\n discountsSlideInModal = new SlideInModal(discountsSlideInModalElm);\n discountsSlideInModal.open(key);\n });\n }\n });\n });\n }\n\n new SplitType('.text-animation');\n const startVideos = function () {\n heroElms.forEach(x => {\n if (x.style.display === 'none') {\n return;\n }\n\n const heroVideo = x.querySelector('.event-page__hero__video');\n if (heroVideo) {\n const heroImg = x.querySelector('.event-page__hero__image');\n heroVideo.play();\n gsap.to(heroImg, { duration: 2, opacity: 0 });\n gsap.to(heroVideo, { duration: 2, opacity: 1 });\n }\n });\n };\n const animateIn = function () {\n const tl = gsap.timeline({\n onComplete: startVideos,\n });\n tl.fromTo(elem.querySelector('.event-page__title-section'), { opacity: 0, y: 0 }, { duration: 1, opacity: 1, y: 0 });\n tl.fromTo(elem.querySelector('.event-page__page-nav'), { opacity: 0, y: 0 }, { duration: 1, opacity: 1, y: 0 });\n tl.addLabel('after-nav');\n tl.fromTo(elem.querySelectorAll('.event-page__sidebar, .event-page__nav-back'), { opacity: 0, y: 20 }, { duration: 1, opacity: 1, y: 0 }, 'after-nav-=1.7');\n };\n animateIn();\n }\n}\n"],"sourceRoot":""}