{"version":3,"sources":["webpack:///./widgets/videoBlock.js"],"names":["VideoBlock","$el","_classCallCheck","this","key","value","setVideoBlock","_this","wg","$","videoType","find","data","videoId","video","vimeoPlayer","img","imgWidth","outerWidth","imgHeight","outerHeight","css","width","height","on","e","addClass","utils","scrollToEl","isVimeoLink","append","Player","isYoutubeLink","embedLink","isYoukuLink","play","src","attr","wgWidth","videoWidth","videoHeight","WG","show","animate","setTimeout","removeClass"],"mappings":"m3BAMA,IASaA,EAAU,WAIrB,O,EAHD,SAAAA,EAAYC,I,4FAAKC,CAAA,KAAAF,GAEhBG,KAAKF,IAAMA,I,EACX,EAAAG,IAAA,OAAAC,MAED,WACCF,KAAKG,kBACL,CAAAF,IAAA,gBAAAC,MAED,WAAgB,IAAAE,EAAA,KACTC,EAAKC,EAAEN,KAAKF,KACZS,EAAYF,EAAGG,KAAK,qBAAqBC,KAAK,aAC9CC,EAAUL,EAAGG,KAAK,qBAAqBC,KAAK,WAC5CE,EAAQN,EAAGG,KAAK,qBAGlBI,EAAc,KAEZC,EAAMR,EAAGG,KAAK,mBACdM,EAAWD,EAAIE,aACfC,EAAYH,EAAII,cAEtBN,EAAMO,IAAI,CACTC,MAAOL,EACPM,OAAQJ,IAITX,EAAGG,KAAK,oBAAoBa,GAAG,SAAS,SAACC,GAgBxC,GAdAjB,EAAGkB,SAhBc,gBAkBjBC,IAAMC,WAAWpB,EAAG,IAKhBD,EAAKsB,YAAYnB,KACpBI,EAAMgB,OAAO,uBAAyBjB,EAAU,wBAChDE,EAAc,IAAIgB,IAAO,eAKtBxB,EAAKyB,cAActB,GAAY,CAClC,IAAMuB,EAAY,iCAAmCpB,EACrDC,EAAMgB,OAAO,gBAAkBG,EAAY,yBAK5C,GAAI1B,EAAK2B,YAAYxB,GAAY,CAChC,IAAMuB,EAAY,kCAAoCpB,EAC1CC,EAAMgB,OAAO,gBAAkBG,EAAY,yBAOxD,GAHkB,UAAdvB,GAAuBK,EAAYoB,OAGrB,YAAdzB,EAAyB,CAC5B,IAAM0B,EAAM3B,EAAE,SAAUK,GAAOuB,KAAK,OACpC5B,EAAE,SAAUK,GAAOuB,KAAK,MAAOD,EAAM,qBAItC,GAAkB,UAAd1B,EAAuB,CAC1B,IAAM0B,EAAM3B,EAAE,SAAUK,GAAOuB,KAAK,OACpC5B,EAAE,SAAUK,GAAOuB,KAAK,MAAOD,EAAM,gCAGtC,IAAME,EAAU9B,EAAGU,aACbqB,EAAaD,EACbE,EAAcF,EAAU,GAAK,EAGnC9B,EAAGG,KAAK8B,mBAAYpB,IAAI,SAAUmB,GAClC1B,EAAM4B,OAAOC,QAAQ,CACpBrB,MAAOiB,EACPhB,OAAQiB,GACN,IAAM,UACTI,YAAW,WACVpC,EAAGqC,YApEa,gBAqEhBrC,EAAGkB,SApEa,gBAqEd,UAEJ,CAAAtB,IAAA,cAAAC,MAED,SAAYK,GACX,MAAqB,UAAdA,IACP,CAAAN,IAAA,gBAAAC,MAED,SAAcK,GACb,MAAqB,YAAdA,IACP,CAAAN,IAAA,cAAAC,MAED,SAAYK,GACX,MAAqB,UAAdA,O,0FAlGc,I","file":"85.js","sourcesContent":["/* eslint-disable max-len */\nimport Player from '@vimeo/player';\nimport utils from '../utils';\n\n// CONSTANTS are all caps.\n// eslint-disable-next-line no-unused-vars\nconst NS = 'VideoBlock';\nconst CLS = 'videoBlock';\nconst WG = '.' + CLS + '-';\n\n// Import stuff here if you need to or even better to import them dynamically\n// for ex. of dynamic import check out src/scripts/loadWg/videoBlock.js using Webpack dynamic imports as chunks.\n// import $ from 'jquery'\n\n\nexport class VideoBlock {\n\tconstructor($el) {\n\t\t// $el is the widget node return by the loadVideoBlock function\n\t\tthis.$el = $el;\n\t}\n\n\tinit() {\n\t\tthis.setVideoBlock();\n\t}\n\n\tsetVideoBlock() {\n\t\tconst wg = $(this.$el);\n\t\tconst videoType = wg.find('.videoBlock-video').data('videoType');\n\t\tconst videoId = wg.find('.videoBlock-video').data('videoId');\n\t\tconst video = wg.find('.videoBlock-video');\n\t\tconst isPrepCls = 'is-preparing';\n\t\tconst isPlayCls = 'is-playing';\n\t\tlet vimeoPlayer = null;\n\n\t\tconst img = wg.find('.videoBlock-img');\n\t\tconst imgWidth = img.outerWidth();\n\t\tconst imgHeight = img.outerHeight();\n\n\t\tvideo.css({\n\t\t\twidth: imgWidth,\n\t\t\theight: imgHeight,\n\t\t});\n\n\t\t// Popup video after clicking Play button.\n\t\twg.find('.jumpNextSection').on('click', (e) => {\n\t\t\t// For hiding image and overlay.\n\t\t\twg.addClass(isPrepCls);\n\n\t\t\tutils.scrollToEl(wg[0]);\n\n\t\t\t// Is Vimeo video ?\n\t\t\t// Create a hidden Vimeo Player that will be popup later.\n\t\t\t// @ref https://github.com/vimeo/player.js\n\t\t\tif (this.isVimeoLink(videoType)) {\n\t\t\t\tvideo.append('
');\n\t\t\t\tvimeoPlayer = new Player('vimeoVideo');\n\t\t\t}\n\n\t\t\t// Is Youtube video ?\n\t\t\t// Append an Iframe\n\t\t\tif (this.isYoutubeLink(videoType)) {\n\t\t\t\tconst embedLink = 'https://www.youtube.com/embed/' + videoId;\n\t\t\t\tvideo.append('