{"version":3,"sources":["webpack:///./widgets/tabbedPartnerContainerBlock.js"],"names":["CLS","WG","TabbedPartnerContainerBlock","$el","_classCallCheck","this","key","value","setTabbedPartnerContainerBlock","renderDropdown","setDropdownMobile","setId","This","$wg","$","tabsBtns","find","length","addClass","concat","on","showPartner","data","tabs","dropdownItem","_","forEach","tab","index","idx","utils","generateRandomId","attr","id","$selectedTabTitle","$selectedTab","$selectedDropdownItem","$dropdownBtn","removeClass","html","hide","fadeIn","$tabTite","$dropdownItem","$this","$tabTitle","itemTmpl","item","innerHTML","tmpl","prepend"],"mappings":"44BAIA,IACMA,EAAM,8BACNC,EAAK,IAAMD,EAAM,IAQVE,EAA2B,WAItC,O,EAHD,SAAAA,EAAYC,I,4FAAKC,CAAA,KAAAF,GAEhBG,KAAKF,IAAMA,I,EACX,EAAAG,IAAA,OAAAC,MAED,WACCF,KAAKG,iCACLH,KAAKI,iBACLJ,KAAKK,oBACLL,KAAKM,UACL,CAAAL,IAAA,iCAAAC,MAED,WACC,IAAMK,EAAOP,KACPQ,EAAMC,EAAET,KAAKF,KACfY,EAAWF,EAAIG,KAAK,cAEpBD,EAASE,OAAS,GACrBJ,EAAIK,SAAS,GAADC,OAAInB,EAAG,UAAAmB,OAASJ,EAASE,SAGtCF,EAASK,GAAG,SAAS,WACpBR,EAAKS,YAAYP,EAAET,MAAMiB,KAAK,YAE/B,CAAAhB,IAAA,QAAAC,MAED,WACC,IAAMM,EAAMC,EAAET,KAAKF,KACfoB,EAAOV,EAAIG,KAAK,qBAChBD,EAAWF,EAAIG,KAAK,cACpBQ,EAAeX,EAAIG,KAAKf,EAAK,2BAEjCwB,IAAEC,QAAQH,GAAM,SAASI,EAAKC,GAC7B,IAAIC,EAAM7B,EAAM,YAAc8B,IAAMC,mBACpCjB,EAAEa,GAAKK,KAAK,UAAWH,GACvBf,EAAEC,EAASa,IAAQI,KAAK,UAAWH,GACnCf,EAAEU,EAAaI,IAAQI,KAAK,UAAWH,QAExC,CAAAvB,IAAA,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,cAG5F,IAAIC,EAAO,qBAAH9B,OACMnB,EAAG,kJAAAmB,OAGb2B,EAAQ,8BAIZjC,EAAIG,KAAK,GAADG,OAAIlB,EAAE,gBAAeiD,QAAQD,Q,0FApGC,I","file":"81.js","sourcesContent":["/* eslint-disable no-invalid-this */\n/* eslint-disable no-unused-vars */\n/* eslint-disable max-len */\n// CONSTANTS are all caps.\nconst NS = 'TabbedPartnerContainerBlock';\nconst CLS = 'tabbedPartnerContainerBlock';\nconst WG = '.' + CLS + '-';\nconst CLS_IS_ACTIVE = 'is-active';\nconst CLS_HIDE = 'd-none';\n\nimport _ from 'lodash';\nimport utils from '../utils';\n\n\nexport class TabbedPartnerContainerBlock {\n\tconstructor($el) {\n\t\t// $el is the widget node return by the loadTabbedPartnerContainerBlock function\n\t\tthis.$el = $el;\n\t}\n\n\tinit() {\n\t\tthis.setTabbedPartnerContainerBlock();\n\t\tthis.renderDropdown();\n\t\tthis.setDropdownMobile();\n\t\tthis.setId();\n\t}\n\n\tsetTabbedPartnerContainerBlock() {\n\t\tconst This = this;\n\t\tconst $wg = $(this.$el);\n\t\tlet tabsBtns = $wg.find('.tab-title');\n\n\t\tif (tabsBtns.length > 2) {\n\t\t\t$wg.addClass(`${CLS}--tabs${tabsBtns.length}`);\n\t\t}\n\n\t\ttabsBtns.on('click', function() {\n\t\t\tThis.showPartner($(this).data('id'));\n\t\t});\n\t}\n\n\tsetId() {\n\t\tconst $wg = $(this.$el);\n\t\tlet tabs = $wg.find('.partnerItemBlock');\n\t\tlet tabsBtns = $wg.find('.tab-title');\n\t\tlet dropdownItem = $wg.find(WG + 'dropdown .dropdown-item');\n\n\t\t_.forEach(tabs, function(tab, index) {\n\t\t\tlet idx = CLS + '-trigger-' + utils.generateRandomId();\n\t\t\t$(tab).attr('data-id', idx);\n\t\t\t$(tabsBtns[index]).attr('data-id', idx);\n\t\t\t$(dropdownItem[index]).attr('data-id', idx);\n\t\t});\n\t}\n\n\tshowPartner(id) {\n\t\tconst $wg = $(this.$el);\n\t\tlet $selectedTabTitle = $wg.find('.tab-title[data-id=\"' + id + '\"]');\n\t\tlet $selectedTab = $wg.find('.partnerItemBlock[data-id=\"' + id + '\"]');\n\t\tlet $selectedDropdownItem = $wg.find(WG + 'dropdown .dropdown-item[data-id=\"' + id + '\"]');\n\t\tlet $dropdownBtn = $wg.find(WG + 'dropdown .dropdown-toggle');\n\n\t\t$wg.find('.tab-title').removeClass(CLS_IS_ACTIVE);\n\t\t$selectedTabTitle.addClass(CLS_IS_ACTIVE);\n\n\t\t$wg.find(WG + 'dropdown .dropdown-item').removeClass(CLS_IS_ACTIVE);\n\t\t$selectedDropdownItem.addClass(CLS_IS_ACTIVE);\n\t\t$dropdownBtn.html($selectedDropdownItem.html());\n\n\t\t$wg.find('.partnerItemBlock').addClass(CLS_HIDE).hide(0);\n\t\t$selectedTab.fadeIn('fast').removeClass(CLS_HIDE);\n\t}\n\n\tsetDropdownMobile() {\n\t\tconst This = this;\n\t\tconst $wg = $(this.$el);\n\t\tlet $tabTite = $wg.find(`${WG}tabsHeaders .tab-title`);\n\n\t\t// AM-177: check if only 1 tab, don't need dropdown on mobile\n\t\tif ($tabTite.length === 1) {\n\t\t\t$wg.find(WG + 'dropdown').addClass(CLS_HIDE);\n\t\t\t$tabTite.addClass('d-inline-block');\n\t\t\treturn;\n\t\t}\n\n\t\tlet $dropdownBtn = $wg.find(WG + 'dropdown .dropdown-toggle');\n\t\tlet $dropdownItem = $wg.find(WG + 'dropdown .dropdown-item');\n\t\tlet $selectedDropdownItem = $wg.find(WG + 'dropdown .dropdown-item.is-active');\n\n\t\t$dropdownBtn.html($selectedDropdownItem.html());\n\n\t\t$dropdownItem.on('click', function() {\n\t\t\tlet $this = $(this);\n\t\t\tThis.showPartner($this.data('id'));\n\t\t});\n\t}\n\n\trenderDropdown() {\n\t\tconst $wg = $(this.$el);\n\t\tlet $tabTitle = $wg.find('.tab-title');\n\t\tlet itemTmpl = '';\n\n\t\t_.forEach($tabTitle, function(item, index) {\n\t\t\titemTmpl += `${item.innerHTML}`;\n\t\t});\n\n\t\tlet tmpl = `\n\t\t