{"version":3,"file":"./modules/JobDetails.xxxxxxxx.js","mappings":"kIAIA,aAUI,WAAmBA,GAAA,KAAAA,QAAAA,EACfC,KAAKC,4BACT,CAkCJ,OA7CW,EAAAC,MAAP,SAAaC,QAAA,IAAAA,IAAAA,EAHM,8BAIfC,MAAMC,KAAKC,SAASC,iBAAiBJ,IAChCK,OAAO,SAACC,GAAsB,OAACA,EAAKC,QAAQC,iBAAd,GAC9BC,QAAQ,SAACb,GACN,IAAIc,EAAWd,GACfA,EAAQW,QAAQC,kBAAoB,MACxC,EACR,EAMQ,YAAAV,2BAAR,WACIa,QAAQC,IAAI,uCAEZ,IAAMC,EAAmBV,SAASW,cAAc,kBAC1CC,EAAoBZ,SAASW,cAAc,4CAGjD,GAAID,GAAoBE,IAAqB,UAAY,CAErD,IAAMC,EAAkBH,EAAiBI,WAAU,GAG7CC,EAAiBH,EAAkBD,cAAc,eAEnDI,GAEAH,EAAkBI,aAAaH,EAAiBE,GAGhDL,EAAiBO,MAAMC,QAAU,SAEjCN,EAAkBO,YAAYN,GAC9BH,EAAiBO,MAAMC,QAAU,OAEjCV,QAAQC,IAAI,kEAEpB,MAAWC,KAAqB,YAE5BA,EAAiBO,MAAMC,QAAU,GACjCV,QAAQC,IAAI,wDAEpB,EACJ,EA9CA,G,UAgDAF,EAAWX,O","sources":["webpack:///./modules/JobDetails.ts"],"sourcesContent":["import { isMobile } from '../helpers/helperFunctions';\r\n\r\nconst moduleSelector = '[data-module=\"JobDetails\"]';\r\n\r\nexport default class JobDetails {\r\n static setup(selector: string = moduleSelector): void {\r\n Array.from(document.querySelectorAll(selector))\r\n .filter((node: HTMLElement) => !node.dataset.moduleInitialized)\r\n .forEach((element: HTMLElement) => {\r\n new JobDetails(element);\r\n element.dataset.moduleInitialized = 'true';\r\n });\r\n }\r\n\r\n constructor(public element: HTMLElement) {\r\n this.adjustBrandsSliderPosition();\r\n }\r\n\r\n private adjustBrandsSliderPosition() {\r\n console.log(\"Adjusting Brands Slider Position...\");\r\n\r\n const topBrandsElement = document.querySelector('.cw-top-brands') as HTMLElement;\r\n const jobDetailsElement = document.querySelector('[data-module=\"JobDetails\"] .cw-container') as HTMLElement;\r\n\r\n // Check if both elements exist\r\n if (topBrandsElement && jobDetailsElement && isMobile()) {\r\n // Clone the .cw-top-brands element\r\n const clonedTopBrands = topBrandsElement.cloneNode(true) as HTMLElement;\r\n\r\n // Find the element with the class \"cw-toolbar\" within jobDetailsElement\r\n const toolbarElement = jobDetailsElement.querySelector('.cw-toolbar');\r\n\r\n if (toolbarElement) {\r\n // Insert the cloned element before the .cw-toolbar element\r\n jobDetailsElement.insertBefore(clonedTopBrands, toolbarElement);\r\n\r\n // Hide the original topBrandsElement for mobile\r\n topBrandsElement.style.display = 'none';\r\n } else {\r\n jobDetailsElement.appendChild(clonedTopBrands);\r\n topBrandsElement.style.display = 'none';\r\n\r\n console.log('Cloned .cw-top-brands appended and original hidden for mobile.');\r\n }\r\n } else if (topBrandsElement && !isMobile()) {\r\n // Ensure the original element remains visible for desktop\r\n topBrandsElement.style.display = '';\r\n console.log('Original .cw-top-brands remains visible for desktop.');\r\n }\r\n }\r\n}\r\n\r\nJobDetails.setup();\r\n"],"names":["element","this","adjustBrandsSliderPosition","setup","selector","Array","from","document","querySelectorAll","filter","node","dataset","moduleInitialized","forEach","JobDetails","console","log","topBrandsElement","querySelector","jobDetailsElement","clonedTopBrands","cloneNode","toolbarElement","insertBefore","style","display","appendChild"],"sourceRoot":""}