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AA8B3B,SAASW,cAAc,sFAKrDc,GAAYE,IACdA,SAAkFA,EAA4BC,SAIhH,IAAIC,EAAwB7B,SAASC,iBAAiB,sFAAsF6B,OAAS,EAInJ9B,SAASW,cAAc,wBAAwBoB,MAAMC,QAHlDH,EAG4D,OAFA,MAInE,CACF,IAKSI,QAAQnB,EAJJ,CACXoB,WAAW,EACXC,SAAS,GAGb,C","sources":["webpack://oticon_us/./custom-components/PEP/pep.js"],"sourcesContent":["var _customLinkComponent$;\n// loads the PEP guide for oticon.com\nimport PepAppWrapper from '@demant/product-experience-page/lib/visual-oticon/index';\nPepAppWrapper();\n\n/** Customization code below for US Market */\n\n/**\n * add read more links to all items passed in\n * @param products\n */\nvar addReadMoreLink = function addReadMoreLink(products) {\n if (products) {\n document.querySelectorAll('.product-pep__text:not(.modified)').forEach(function (elem) {\n elem.classList.add('modified');\n var node = document.createElement('div');\n node.classList.add('product-pep__custom-product-link');\n node.innerHTML = \"\\n Learn more\\n \\n \";\n elem.appendChild(node);\n });\n }\n};\nvar addBeginOrderLink = function addBeginOrderLink(container) {\n if (container) {\n container.classList.add('modified');\n var node = document.createElement('div');\n node.classList.add('custom-shop-link');\n node.innerHTML = '

Are you a hearing care professional? Place an order on MyOticon.

';\n container.appendChild(node);\n }\n};\n\n/**\n * grab our custom links to be appended to the filter list section and save them for future use. Remove original rich text element so user doesn't see it.\n * @type {Element}\n */\nvar customLinkComponent = document.querySelector('.rich-text.pep-custom-links');\nvar customLinks = (_customLinkComponent$ = customLinkComponent === null || customLinkComponent === void 0 ? void 0 : customLinkComponent.querySelector('.component-content').innerHTML) !== null && _customLinkComponent$ !== void 0 ? _customLinkComponent$ : '';\ncustomLinkComponent === null || customLinkComponent === void 0 || customLinkComponent.remove();\n\n// select one of our three possible component class names [.pep-product-list, .pep-accessories-list, .pep-product-details]\nvar pepNode = document.querySelector('.pep-product-details') || document.querySelector('.pep-product-list') || document.querySelector('.pep-accessories-list');\nif (pepNode) {\n // use a mutationObserver to check if our target has been added or changed. Need to do this as we don't know when the component is fully built.\n var observer = new MutationObserver(function (mutations, observer) {\n // Add learn more link to items in products list\n var products = document.querySelector('.pep-product-list .products');\n addReadMoreLink(products);\n\n // Add learn more link to items in related products list\n var relatedProducts = document.querySelector('.pep-product-list .related-products');\n addReadMoreLink(relatedProducts);\n\n // Add custom link to shop home\n var detailsPage = document.querySelector('.product-details .details:not(.modified)');\n addBeginOrderLink(detailsPage);\n\n // grab our filter container section and append our custom links (if any)\n var filtersContainer = document.querySelector('.filters-container .filters:not(.modified)');\n if (filtersContainer) {\n filtersContainer.classList.add('modified');\n var linkContainer = document.createElement('div');\n linkContainer.classList.add('custom-link-container');\n linkContainer.innerHTML = customLinks;\n filtersContainer.append(linkContainer);\n }\n\n // removes download icon from product detail page\n var downloadsIcon = document.querySelector('.details-tab-section .tabs-container a[data-content=marketingMaterials]');\n if (downloadsIcon) {\n var isActive = downloadsIcon.classList.contains('active');\n var firstPopulatedIconContainer = document.querySelector('.details-tab-section .slick-slide > div > a:not([data-content=marketingMaterials])');\n\n /**\n * if our downloads icon is active and content is visible to the user, hide it and set the first available icon with content to active.\n */\n if (isActive && firstPopulatedIconContainer) {\n firstPopulatedIconContainer === null || firstPopulatedIconContainer === void 0 || firstPopulatedIconContainer.click();\n }\n\n // check if all icons have content, if not lets hide the section completely (accessories page only shows downloads)\n var showDetailsTabSection = document.querySelectorAll('.details-tab-section .slick-slide > div > a:not([data-content=marketingMaterials])').length > 0;\n if (!showDetailsTabSection) {\n document.querySelector('.details-tab-section').style.display = 'none';\n } else {\n document.querySelector('.details-tab-section').style.display = 'flex';\n }\n }\n });\n var config = {\n childList: true,\n subtree: true\n };\n observer.observe(pepNode, config);\n}"],"names":["_customLinkComponent$","addReadMoreLink","products","document","querySelectorAll","forEach","elem","classList","add","node","createElement","innerHTML","appendChild","customLinkComponent","querySelector","customLinks","remove","pepNode","MutationObserver","mutations","observer","relatedProducts","container","addBeginOrderLink","filtersContainer","linkContainer","append","downloadsIcon","isActive","contains","firstPopulatedIconContainer","click","showDetailsTabSection","length","style","display","observe","childList","subtree"],"sourceRoot":""}