{"version":3,"file":"./modules/JobDetails.xxxxxxxx.js","mappings":"iGAIAA,EAAA,WAUI,SAAAA,EAAmBC,GAAAC,KAAAD,QAAAA,EACfC,KAAKC,4BACT,CAkCJ,OA7CWH,EAAAI,MAAP,SAAaC,QAAA,IAAAA,IAAAA,EAHM,8BAIfC,MAAMC,KAAKC,SAASC,iBAAiBJ,IAChCK,OAAO,SAACC,GAAsB,OAACA,EAAKC,QAAQC,iBAAd,GAC9BC,QAAQ,SAACb,GACN,IAAID,EAAWC,GACfA,EAAQW,QAAQC,kBAAoB,MACxC,EACR,EAMQb,EAAAe,UAAAZ,2BAAR,WACIa,QAAQC,IAAI,uCAEZ,IAAMC,EAAmBV,SAASW,cAAc,kBAC1CC,EAAoBZ,SAASW,cAAc,4CAGjD,GAAID,GAAoBE,IAAqB,EAAAC,EAAAC,MAAY,CAErD,IAAMC,EAAkBL,EAAiBM,WAAU,GAG7CC,EAAiBL,EAAkBD,cAAc,eAEnDM,GAEAL,EAAkBM,aAAaH,EAAiBE,GAGhDP,EAAiBS,MAAMC,QAAU,SAEjCR,EAAkBS,YAAYN,GAC9BL,EAAiBS,MAAMC,QAAU,OAEjCZ,QAAQC,IAAI,kEAEpB,MAAWC,KAAqB,EAAAG,EAAAC,QAE5BJ,EAAiBS,MAAMC,QAAU,GACjCZ,QAAQC,IAAI,wDAEpB,EACJjB,CAAA,CA9CA,aAgDAA,EAAWI","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":["JobDetails","element","this","adjustBrandsSliderPosition","setup","selector","Array","from","document","querySelectorAll","filter","node","dataset","moduleInitialized","forEach","prototype","console","log","topBrandsElement","querySelector","jobDetailsElement","_helpers_helperFunctions__WEBPACK_IMPORTED_MODULE_0__","Fr","clonedTopBrands","cloneNode","toolbarElement","insertBefore","style","display","appendChild"],"sourceRoot":""}