{"version":3,"sources":["webpack://app.[name]/./source/App/tabs.js"],"names":["Object","defineProperty","exports","value","load","callback","_Tabs","_analytics","_functions","render","config","store","elem","analyticsUtil","Analytics","then","renderComponent","default","loadComponents","_len","arguments","length","args","Array","_key","apply","moduleConfig","moduleDiv","moduleComponents","initialiseTabGroup","tabOperations","schema","getState","data","map","comp","id","get","renderingId","Map","componentLabels","childNode","querySelector","concat","children","innerHTML","initScript","dataset","init","set","dispatch","size","_len2","_key2","schemaName","sourceIdentifier","customTabsWrapperClass","customCssClass","tabsWrapperNode","document","getElementsByClassName","classList","add","state"],"mappings":"yIAEAA,OAAOC,eAAeC,EAAS,aAAc,CAC3CC,OAAO,IAETD,EAAQE,UAAO,EAEf,EAAQ,IAER,EAAQ,KAER,EAAQ,IAER,EAAQ,IAER,EAAQ,IAER,EAAQ,IAER,IAeiDC,EAf7CC,EAAQ,EAAQ,KAEhBC,EAAa,EAAQ,KAErBC,EAAa,EAAQ,IAIrBC,EAAS,SAAgBC,EAAQC,EAAOC,GAC1C,IAAIC,EAAgB,IAAIN,EAAWO,UACnC,iEAA2CC,MAAK,SAAUb,IACxD,EAAIM,EAAWQ,iBAAiBd,EAAQe,QAASN,EAAOD,EAAQE,EAAMC,OAsCtEK,GAlC6Cb,EAkCX,WACpC,IAAK,IAAIc,EAAOC,UAAUC,OAAQC,EAAO,IAAIC,MAAMJ,GAAOK,EAAO,EAAGA,EAAOL,EAAMK,IAC/EF,EAAKE,GAAQJ,UAAUI,GAGzBf,EAAOgB,WAhDG,EAgDUH,IAtCb,SAAUA,GACf,IAAII,EAAeJ,EAAKI,aACpBC,EAAYL,EAAKV,KACjBD,EAAQW,EAAKX,MACbiB,EAAmBN,EAAKM,iBAE5B,GAAKD,EAAL,CAIA,IAAIE,EAAqBvB,EAAMwB,cAAcD,mBAEzCE,EADQpB,EAAMqB,WACCD,OACfE,EAAOL,EAAiBM,KAAI,SAAUC,GACxC,IAAIC,EAAKD,EAAKE,IAAI,kBACdC,EAAcH,EAAKE,IAAI,eAE3B,IAAKD,EACH,OAAO,IAAIG,IAGb,IAAIC,EAAkBT,EAAOM,IAAID,GAC7BK,EAAYd,EAAUe,cAAc,mBAAoBC,OAAOL,EAAa,OAC5EM,EAAWH,GAAaA,EAAUI,UAClCC,EAAaL,EAAUC,cAAc,gBAAkBD,EAAUC,cAAc,eAAeK,QAAQC,KAE1G,OADab,EAAKc,IAAI,KAAMb,GAAIa,IAAI,SAAUvB,GAAcuB,IAAI,QAAST,GAAiBS,IAAI,WAAYL,GAAUK,IAAI,aAAcH,MAGxInC,EAAMuC,SAASrB,EAAmBI,EAAKkB,OACvC9C,EAAS4B,EAAMtB,EAAOgB,MAyCtBvB,EA5BK,WACL,IAAK,IAAIgD,EAAQhC,UAAUC,OAAQC,EAAO,IAAIC,MAAM6B,GAAQC,EAAQ,EAAGA,EAAQD,EAAOC,IACpF/B,EAAK+B,GAASjC,UAAUiC,GAG1B,IAAI1C,EAAQW,EAAK,GACbgC,EAAahC,EAAK,GAClBV,EAAOU,EAAK,GACZiC,EAAmBjC,EAAK,GACxBM,EAAmBN,EAAK,GAExBkC,EAAyB5C,GAAQA,EAAKmC,SAAWnC,EAAKmC,QAAQU,eAC9DC,EAAkBC,SAASC,uBAAuB,gBACtDJ,GAA0BE,EAAgBrC,OAAS,GAAKqC,EAAgB,GAAGG,UAAUC,IAAIN,GAEzF,IAAIO,EAAQpD,EAAMqB,WACdD,EAASgC,EAAMhC,OACfL,EAAe6B,EAAmBxB,EAAOM,IAAIkB,GAAoB,IAAIhB,IACzErB,EAAe,CACbQ,aAAcA,EACd4B,WAAYA,EACZ1C,KAAMA,EACND,MAAOA,EACPiB,iBAAkBA,KAMxB1B,EAAQE,KAAOA,I","file":"scripts/tabs.bundle.js","sourcesContent":["\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.load = void 0;\n\nrequire(\"core-js/modules/es6.array.map.js\");\n\nrequire(\"core-js/modules/es6.map.js\");\n\nrequire(\"core-js/modules/es6.string.iterator.js\");\n\nrequire(\"core-js/modules/es6.object.to-string.js\");\n\nrequire(\"core-js/modules/es6.array.iterator.js\");\n\nrequire(\"core-js/modules/web.dom.iterable.js\");\n\nvar _Tabs = require(\"./State/Ducks/Tabs/\");\n\nvar _analytics = require(\"./Utils/analytics\");\n\nvar _functions = require(\"./Utils/functions\");\n\nvar _this = void 0;\n\nvar render = function render(config, store, elem) {\n  var analyticsUtil = new _analytics.Analytics();\n  import('./Views/Containers/TabsContainer').then(function (exports) {\n    (0, _functions.renderComponent)(exports.default, store, config, elem, analyticsUtil);\n  });\n};\n\nvar loaderComponents = function loaderComponents(callback) {\n  return function (args) {\n    var moduleConfig = args.moduleConfig,\n        moduleDiv = args.elem,\n        store = args.store,\n        moduleComponents = args.moduleComponents;\n\n    if (!moduleDiv) {\n      return;\n    }\n\n    var initialiseTabGroup = _Tabs.tabOperations.initialiseTabGroup;\n    var state = store.getState();\n    var schema = state.schema;\n    var data = moduleComponents.map(function (comp) {\n      var id = comp.get('sourceIdentity');\n      var renderingId = comp.get('renderingId');\n\n      if (!id) {\n        return new Map();\n      }\n\n      var componentLabels = schema.get(id);\n      var childNode = moduleDiv.querySelector(\"[data-react-id=\\\"\".concat(renderingId, \"\\\"]\"));\n      var children = childNode && childNode.innerHTML;\n      var initScript = childNode.querySelector(\"[data-init]\") && childNode.querySelector(\"[data-init]\").dataset.init;\n      var config = comp.set('id', id).set('config', moduleConfig).set('label', componentLabels).set('children', children).set('initScript', initScript);\n      return config;\n    });\n    store.dispatch(initialiseTabGroup(data.size));\n    callback(data, store, moduleDiv);\n  };\n};\n\nvar loadComponents = loaderComponents(function () {\n  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n    args[_key] = arguments[_key];\n  }\n\n  render.apply(_this, args);\n});\n\nvar bootstrap = function bootstrap() {\n  return function () {\n    for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n      args[_key2] = arguments[_key2];\n    }\n\n    var store = args[0],\n        schemaName = args[1],\n        elem = args[2],\n        sourceIdentifier = args[3],\n        moduleComponents = args[4]; //TO BE REMOVED! MPS AB testing custom styling on Tab wrapper\n\n    var customTabsWrapperClass = elem && elem.dataset && elem.dataset.customCssClass;\n    var tabsWrapperNode = document.getElementsByClassName('tabs-wrapper');\n    customTabsWrapperClass && tabsWrapperNode.length > 0 && tabsWrapperNode[0].classList.add(customTabsWrapperClass); //END\n\n    var state = store.getState();\n    var schema = state.schema;\n    var moduleConfig = sourceIdentifier ? schema.get(sourceIdentifier) : new Map();\n    loadComponents({\n      moduleConfig: moduleConfig,\n      schemaName: schemaName,\n      elem: elem,\n      store: store,\n      moduleComponents: moduleComponents\n    });\n  };\n};\n\nvar load = bootstrap();\nexports.load = load;"],"sourceRoot":""}