tweb/public/684.a0a965e6cfe303d2345a.chunk.js

2 lines
1.3 MiB
JavaScript
Raw Normal View History

2023-02-10 16:57:45 +01:00
(this.webpackChunktweb=this.webpackChunktweb||[]).push([[684],{5814:(e,t,i)=>{"use strict";i.d(t,{Z:()=>m});var s=i(5400),n=i(3512),a=i(4762),o=i(410),r=i(8487),d=i(3772),l=i(1655),c=i(7625),h=i(2586),u=i(3013),p=i(3035);const f=new class{constructor(){this.observer=new IntersectionObserver((e=>{for(const t of e){const e=t.target;for(const i in this.byGroups){if(this.intersectionLockedGroups[i])continue;const s=this.byGroups[i].find((t=>t.el===e));if(s){if(t.isIntersecting)this.visible.add(s),this.checkAnimation(s,!1);else{this.visible.delete(s),this.checkAnimation(s,!0);const e=s.animation;e instanceof d.Z&&e.clearCache()}break}}}})),this.visible=new Set,this.overrideIdleGroups=new Set,this.byGroups={},this.byPlayer=new Map,this.lockedGroups={},this.onlyOnePlayableGroup="",this.intersectionLockedGroups={},this.videosLocked=!1,u.Z.addEventListener("play",(({doc:e})=>{"round"===e.type&&(this.videosLocked=!0,this.checkAnimations2())})),u.Z.addEventListener("pause",(()=>{this.videosLocked&&(this.videosLocked=!1,this.checkAnimations2())})),h.Z.addEventListener("change",(e=>{this.checkAnimations2(e)}))}setOverrideIdleGroup(e,t){t?this.overrideIdleGroups.add(e):this.overrideIdleGroups.delete(e)}getAnimations(e){const t=[];for(const i in this.byGroups)for(const s of this.byGroups[i])s.el===e&&t.push(s);return t}removeAnimation(e){const{el:t,animation:i}=e;i instanceof HTMLVideoElement||i.remove(),i instanceof HTMLVideoElement&&a.IS_SAFARI&&setTimeout((()=>{i.src="",i.load()}),1e3);const s=this.byGroups[e.group];s&&((0,l.Z)(s,e),s.length||delete this.byGroups[e.group]),this.observer.unobserve(t),this.visible.delete(e),this.byPlayer.delete(i)}removeAnimationByPlayer(e){const t=this.byPlayer.get(e);t&&this.removeAnimation(t)}addAnimation(e,t="",i,a){var o,r,l,c;if("none"===t||this.byPlayer.has(e))return;i||(e instanceof d.Z?i=e.el[0]:e instanceof s.KZ?i=e.canvas:e instanceof s.LD?i=null!==(o=e.placeholder)&&void 0!==o?o:e:e instanceof HTMLElement&&(i=e));const h={el:i,animation:e,group:t,controlled:a};a&&"boolean"!=typeof a&&a.onClean((()=>{this.removeAnimationByPlayer(e)})),e instanceof d.Z&&!n.Z.settings.stickers.loop&&e.loop&&(e.loop=n.Z.settings.stickers.loop),(null!==(r=(l=this.byGroups)[c=t])&&void 0!==r?r:l[c]=[]).push(h),this.observer.observe(h.el),this.byPlayer.set(e,h)}checkAnimations(e,t,i,s){if(void 0!==t&&!this.byGroups[t])return;const n=void 0!==t?[t]:Object.keys(this.byGroups);for(const t of n){if(s&&this.intersectionLockedGroups[t])continue;const n=this.byGroups[t];(0,c.Z)(n,(t=>{this.checkAnimation(t,e,i)}))}}checkAnimations2(e){this.checkAnimations(e,void 0,void 0,!0)}checkAnimation(e,t,i){const{el:s,animation:n,group:a}=e;i||!this.lockedGroups[a]&&!(0,r.Z)(s)?e.controlled&&!i||this.removeAnimation(e):t||this.onlyOnePlayableGroup&&this.onlyOnePlayableGroup!==a||n instanceof HTMLVideoElement&&this.videosLocked?n.paused||n.pause():!(n.paused&&this.visible.has(e)&&n.autoplay)||this.onlyOnePlayableGroup&&this.onlyOnePlayableGroup!==a||h.Z.isIdle&&!this.overrideIdleGroups.has(e.group)||n.play()}getOnlyOnePlayableGroup(){return this.onlyOnePlayableGroup}setOnlyOnePlayableGroup(e=""){this.onlyOnePlayableGroup=e}lockGroup(e){this.lockedGroups[e]=!0}unlockGroup(e){delete this.lockedGroups[e],this.checkAnimations(void 0,e)}refreshGroup(e){const t=this.byGroups[e];(null==t?void 0:t.length)&&(t.forEach((e=>{this.observer.unobserve(e.el)})),(0,p.T2)((()=>{t.forEach((e=>{this.observer.observe(e.el)}))})))}lockIntersectionGroup(e){this.intersectionLockedGroups[e]=!0}unlockIntersectionGroup(e){delete this.intersectionLockedGroups[e],this.refreshGroup(e)}toggleIntersectionGroup(e,t){t?this.lockIntersectionGroup(e):this.unlockIntersectionGroup(e)}};o.GO&&(o.GO.animationIntersector=f);const m=f},3013:(e,t,i)=>{"use strict";i.d(t,{Z:()=>L});var s=i(3512),n=i(3725),a=i(4762),o=i(410),r=i(6669),d=i(5432),l=i(2325),c=i(3719),h=i(8479),u=i(6848),p=i(3699),f=i(7530),m=i(493),g=i(2312),v=i(925),b=i(3241),y=function(e,t,i,s){return new(i||(i=Promise))((function(n,a){function o(e){try{d(s.next(e))}catch(e){a(e)}}function r(e){try{d(s.throw
//# sourceMappingURL=684.a0a965e6cfe303d2345a.chunk.js.map