{"version":3,"sources":["webpack:///./widgets/tabContainer.js"],"names":["CLS","WG","TabContainer","$el","_classCallCheck","this","key","value","setTabContainer","initTopPosition","timer","This","$wg","$","tabsTitles","find","TI","TIB","header","tabItems","length","hasHash","window","location","hash","setTimeout","$activeTitle","filter","concat","substring","toLowerCase","trigger","text","append","each","i","tabTitle","title","id","generateId","titleHtml","tabItemId","data","attr","first","addClass","fadeIn","slick","on","$this","removeClass","wrap","offset","top","$activeTab","closest","scrollTop","outerHeight","utils","isElementOutViewport","css","e","stopPropagation","parentItem","hashValue","not","hide","hasClass","animate","isBelowMd","onresize","clearTimeout","Math","floor","random","innerWidth"],"mappings":"42BAIA,IACMA,EAAM,eACNC,EAAK,IAAMD,EAAM,IAOVE,EAAY,WAIvB,O,EAHD,SAAAA,EAAYC,I,4FAAKC,CAAA,KAAAF,GAEhBG,KAAKF,IAAMA,I,EACX,EAAAG,IAAA,OAAAC,MAED,WACCF,KAAKG,oBACL,CAAAF,IAAA,kBAAAC,MAED,WAEC,IAMIE,EA2KAC,EAjLEC,EAAON,KACTO,EAAMC,EAAER,KAAKF,KACbW,EAAaF,EAAIG,KAAKd,EAAK,oBACzBe,EAAK,YACLC,EAAM,sBACNC,EAASL,EAAE,eAIbM,EAAWP,EAAIG,KAAKE,GACxB,GAAIE,GAAYA,EAASC,OAAS,EAAG,CACpC,IAAMC,EAAUC,OAAOC,SAASC,KAC5BH,GAEHI,YAAW,WACV,IACMC,EADcP,EAASQ,OAAO,aAADC,OAAcP,EAAQQ,UAAU,GAAGC,cAAa,OAClDf,KAAK,GAADa,OAAIZ,EAAE,aAC3CU,EAAcK,QAAQ,SACtBnB,EAAIG,KAAK,oBAAoBiB,KAAKN,EAAaM,UAC7C,MASJlB,EAAWC,KAAK,cAAckB,OANL,sOAQzBd,EAASe,MAAK,SAASC,GACtB,IAAIC,EAAWvB,EAAER,MAAMU,KAAK,GAADa,OAAIZ,EAAE,aAC7BqB,EAAQD,EAASJ,OACjBM,EAAK3B,EAAK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C1CjC,EAAIG,KAAKd,EAAK,cAAcgE,IAAI,IAADrC,OAAKU,IAAMY,YAAY,aACtDtC,EAAIG,KAAK,IAADa,OAAKU,IAAMO,SAAS,aAG5B1B,EAASyC,IAAI,CACZ,cAAe,GACf,iBAAkB,QAKpBhD,EAAIoC,GAAG,QAAS,GAAFpB,OAAK3B,EAAE,eAAc,WAClC,IAAIY,EAAER,MAAM8D,SAAS,aAArB,CAGA,IAAI7B,EAAKzB,EAAER,MAAMsC,KAAK,MACtBxB,EAASJ,KAAK,YAADa,OAAaU,EAAE,MAAKP,QAAQ,aAG1ClB,EAAES,QAAQ0B,GAAG,iBAAiB,WACxBlC,EAAWqD,SAAS,eACxB1D,EAAkBK,EAAWsC,SAASC,QAKxC/B,OAAOgD,SAAW,WACjBC,aAAa7D,GACbA,EAAQe,YAAW,WAClBhB,EAAkBK,EAAWsC,SAASC,IACtCxC,EAAES,QAAQS,QAAQ,YAChB,MAIJN,YAAW,WACVZ,EAAES,QAAQS,QAAQ,YAChB,OACH,CAAAzB,IAAA,aAAAC,MAED,WACC,OAAOiE,KAAKC,MAAM,IAAyB,IAAhBD,KAAKE,YAChC,CAAApE,IAAA,YAAAC,MAED,WACC,OAAOe,OAAOqD,WAAa,S,0FAjNJ,I","file":"80.js","sourcesContent":["/* eslint-disable no-unused-vars */\n/* eslint-disable no-invalid-this */\n/* eslint-disable max-len */\n// CONSTANTS are all caps.\nconst NS = 'TabContainer';\nconst CLS = 'tabContainer';\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/tabContainer.js using Webpack dynamic imports as chunks.\n// import $ from 'jquery'\nimport utils from '../utils';\n\nexport class TabContainer {\n\tconstructor($el) {\n\t\t// $el is the widget node return by the loadTabContainer function\n\t\tthis.$el = $el;\n\t}\n\n\tinit() {\n\t\tthis.setTabContainer();\n\t}\n\n\tsetTabContainer() {\n\t\t// Add Some logic here\n\t\tconst This = this;\n\t\tlet $wg = $(this.$el);\n\t\tlet tabsTitles = $wg.find(WG + 'tabTitlesWrapper');\n\t\tconst TI = '.tabItem-';\n\t\tconst TIB = '[data-wg=\"TabItem\"]';\n\t\tconst header = $('.siteHeader');\n\t\tlet initTopPosition;\n\n\t\t// loop through tabItems and create tab triggers outside the tab container\n\t\tlet tabItems = $wg.find(TIB);\n\t\tif (tabItems && tabItems.length > 0) {\n\t\t\tconst hasHash = window.location.hash;\n\t\t\tif (hasHash) {\n\t\t\t\t// it needs to wait untill the heroBanner animation completes\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tconst $activeHash = tabItems.filter(`[data-id=\"${hasHash.substring(1).toLowerCase()}\"]`);\n\t\t\t\t\tconst $activeTitle = $activeHash.find(`${TI}tabTitle`);\n\t\t\t\t\t$activeTitle .trigger('click');\n\t\t\t\t\t$wg.find('.dropdown-toggle').text($activeTitle.text());\n\t\t\t\t}, 3500);\n\t\t\t}\n\t\t\t// generate mobile dropdown\n\t\t\tlet mobileDropdownHtml = `\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t`;\n\t\t\ttabsTitles.find('.container').append(mobileDropdownHtml);\n\n\t\t\ttabItems.each(function(i) {\n\t\t\t\tlet tabTitle = $(this).find(`${TI}tabTitle`);\n\t\t\t\tlet title = tabTitle.text();\n\t\t\t\tlet id = This.generateId() + '-tabTrigger';\n\t\t\t\tlet titleHtml = `${title}`;\n\t\t\t\tconst tabItemId = $(this).data('id').toLowerCase();\n\t\t\t\tif (tabItemId) {\n\t\t\t\t\t$(this).attr('data-id', tabItemId);\n\t\t\t\t}\n\t\t\t\ttabTitle.attr('data-id', id);\n\t\t\t\ttabsTitles.find('.container').append(titleHtml);\n\t\t\t\t// append to mobile menu\n\t\t\t\ttabsTitles.find('.dropdown-menu').append(`\n\t\t\t\t\t${title}\n\t\t\t\t`);\n\t\t\t\t// first tab is active by default\n\t\t\t\tif (i == 0) {\n\t\t\t\t\ttabItems.first().find(`${TI}tabTitle`).addClass('is-active');\n\t\t\t\t\ttabsTitles.find(WG + 'tabTrigger').first().addClass('is-active');\n\t\t\t\t\ttabItems.first().find(`${TI}tabContent`).fadeIn('fast', function() {\n\t\t\t\t\t\t$(window).trigger('resize');\n\t\t\t\t\t\t// setPosition\n\t\t\t\t\t\ttabItems.first().find('.slick-initialized').slick('setPosition');\n\t\t\t\t\t});\n\t\t\t\t\t// put the initial mobile dropdown button text\n\t\t\t\t\ttabsTitles.find('.dropdown-toggle').text(title);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t$wg.on('click', '.dropdown-item', function() {\n\t\t\t\tlet $this = $(this);\n\t\t\t\tlet id = $this.data('id');\n\t\t\t\t$wg.find('.dropdown-item').removeClass('active');\n\t\t\t\t$this.addClass('active');\n\t\t\t\t$wg.find('.dropdown-toggle').text($this.text());\n\t\t\t\ttabItems.find(`[data-id=${id}]`).trigger('click');\n\t\t\t});\n\n\t\t\t$wg.find('.tabItem-tabContent').wrap('
');\n\n\t\t\tinitTopPosition = tabsTitles.offset().top;\n\n\t\t\t// scroll stuff\n\t\t\t$(window).on('scroll', function() {\n\t\t\t\tlet $activeTab = $wg.find('.tabItem-tabTitle.is-active').closest('.tabItem');\n\t\t\t\tlet tabsTitlesReachedScroll = $(window).scrollTop() + ((header.length > 0) ? header.outerHeight() : 0) > initTopPosition;\n\n\t\t\t\tif (tabsTitlesReachedScroll && !utils.isElementOutViewport($wg)) {\n\t\t\t\t\t$('body').css({\n\t\t\t\t\t\t'overflow-x': 'visible',\n\t\t\t\t\t});\n\n\t\t\t\t\ttabsTitles.addClass('is-sticky');\n\n\t\t\t\t\ttabsTitles.css({\n\t\t\t\t\t\t'top': ((header.length > 0) ? header.outerHeight() : 0),\n\t\t\t\t\t});\n\n\t\t\t\t\t$activeTab.css({\n\t\t\t\t\t\t'padding-top': tabsTitles.outerHeight(),\n\t\t\t\t\t\t'padding-bottom': ((header.length > 0) ? header.outerHeight() : 0),\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\t$('body').css({\n\t\t\t\t\t\t'overflow-x': '',\n\t\t\t\t\t});\n\n\t\t\t\t\ttabsTitles.removeClass('is-sticky');\n\n\t\t\t\t\ttabsTitles.css({\n\t\t\t\t\t\t'top': '',\n\t\t\t\t\t});\n\n\t\t\t\t\t// remove all top paddings\n\t\t\t\t\ttabItems.css({\n\t\t\t\t\t\t'padding-top': '',\n\t\t\t\t\t\t'padding-bottom': '',\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t$(window).trigger('scroll');\n\t\t}\n\n\t\t// get clicks on titles [below the breakpoint]\n\t\ttabItems.on('click', `${TI}tabTitle`, function(e) {\n\t\t\te.stopPropagation();\n\n\t\t\tlet parentItem = $(this).closest(`${TIB}`);\n\t\t\tlet hashValue = parentItem.data('id').toLowerCase();\n\t\t\twindow.location.hash = hashValue;\n\t\t\tlet id = $(this).attr('data-id');\n\n\t\t\t// if ($(this).hasClass('is-active')) {\n\t\t\t// \tparentItem.find(`${TI}tabContent`).hide(0);\n\t\t\t// \tparentItem.find(`${TI}tabTitle`).removeClass('is-active');\n\t\t\t// \t$wg.find(`#${id}`).removeClass('is-active');\n\t\t\t// \treturn;\n\t\t\t// }\n\n\t\t\ttabItems.not(parentItem).find(`${TI}tabContent`).hide(0);\n\t\t\ttabItems.not(parentItem).find(`${TI}tabTitle`).removeClass('is-active');\n\t\t\t// show current item\n\t\t\tparentItem.find(`${TI}tabContent`).fadeIn('fast', function() {\n\t\t\t\t$(window).trigger('resize');\n\t\t\t\tif (tabsTitles.hasClass('is-sticky')) {\n\t\t\t\t\t$('html, body').animate({\n\t\t\t\t\t\tscrollTop: $wg.offset().top + $wg.find(WG + 'title').outerHeight() + (This.isBelowMd() ? 5 : 42),\n\t\t\t\t\t}, 500, function() {\n\t\t\t\t\t\t$(window).trigger('scroll');\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\t$('html, body').animate({\n\t\t\t\t\t\tscrollTop: $wg.offset().top,\n\t\t\t\t\t}, 500, function() {\n\t\t\t\t\t\t$(window).trigger('scroll');\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t// setPosition\n\t\t\t\tparentItem.find('.slick-initialized').slick('setPosition');\n\t\t\t});\n\t\t\tparentItem.find(`${TI}tabTitle`).addClass('is-active');\n\t\t\t$wg.find(WG + 'tabTrigger').not(`#${id}`).removeClass('is-active');\n\t\t\t$wg.find(`#${id}`).addClass('is-active');\n\n\t\t\t// remove all top paddings\n\t\t\ttabItems.css({\n\t\t\t\t'padding-top': '',\n\t\t\t\t'padding-bottom': '',\n\t\t\t});\n\t\t});\n\n\t\t// get clicks on title [above the breakpoint]\n\t\t$wg.on('click', `${WG}tabTrigger`, function() {\n\t\t\tif ($(this).hasClass('is-active')) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet id = $(this).attr('id');\n\t\t\ttabItems.find(`[data-id=${id}]`).trigger('click');\n\t\t});\n\n\t\t$(window).on('scroll resize', function() {\n\t\t\tif (!tabsTitles.hasClass('is-sticky')) {\n\t\t\t\tinitTopPosition = tabsTitles.offset().top;\n\t\t\t}\n\t\t});\n\n\t\tlet timer;\n\t\twindow.onresize = function() {\n\t\t\tclearTimeout(timer);\n\t\t\ttimer = setTimeout(function() {\n\t\t\t\tinitTopPosition = tabsTitles.offset().top;\n\t\t\t\t$(window).trigger('scroll');\n\t\t\t}, 100);\n\t\t};\n\n\t\t// reinit sliders trial\n\t\tsetTimeout(() => {\n\t\t\t$(window).trigger('resize');\n\t\t}, 500);\n\t}\n\n\tgenerateId() {\n\t\treturn Math.floor(100000 + Math.random() * 900000);\n\t}\n\n\tisBelowMd() {\n\t\treturn window.innerWidth < 768;\n\t}\n\n\t// Add more functions like on above here\n}\n"],"sourceRoot":""}