Skip to main content
Intermediary
EN
Search
Close
Mobile menu open
Mobile menu close
'); // This final block of code is responsible for dispatching the 'ksys-app-embed-added' event, which will in turn load up the passive attestation. var passiveElement = document.querySelector('[data-ksys-app-template-id="ksys-app-attestation"][data-input-mode="passive"]'); // CTI special functionality hide/show investor dropdown and after chosen US country trigger redirect var observerGlobal; $('[data-ksys-app-template-id="ksys-app-attestation"][data-input-mode="passive"]').on('ksys-app-embed-added', function () { // hide investor selector when global chosen var configGlobal = { subtree: true, characterData: true }; observerGlobal = new MutationObserver(globalFunctionality); // wait for application to render properly waitForElement(function () { return passiveElement.querySelector('[data-selector="selectionField-wrapper"]:nth-of-type(' + countryHelperSelectorOrder + ') [data-selector="iconDropdown-buttonLabel"] span'); }, 3000, function () { var countrySelect = passiveElement.querySelector('[data-selector="selectionField-wrapper"]:nth-of-type(' + countryHelperSelectorOrder + ') [data-selector="iconDropdown-buttonLabel"] span'); if (typeof countrySelect !== 'undefined' && countrySelect !== null) { // trigger observation and look for the country dropdown changes observerGlobal.observe(countrySelect, configGlobal); // first render - decide if investor dropdown should be visible on not if (countrySelect.innerText === 'global') { countrySelect.closest('[data-ksys-app-template-id="ksys-app-attestation"]').querySelector(' [data-selector="selectionField-wrapper"]:nth-of-type(' + investorSelectorOrder + ')').style.display = 'none'; } } }); }); if (passiveElement) { const eventName = 'ksys-app-embed-added'; window.ksysTriggerEvent(eventName, passiveElement); } }, 300); });});function globalFunctionality(mutationsList, observer) { mutationsList.forEach(function (mutation) { var targetElement = mutation.target.parentNode; var isTargetExist = typeof mutation.target !== 'undefined' && mutation.target !== null; var investorSelector = targetElement.closest('[data-ksys-app-template-id="ksys-app-attestation"]').querySelector(' [data-selector="selectionField-wrapper"]:nth-of-type(' + investorSelectorOrder + ')'); if (isTargetExist && mutation.target.parentNode.innerText === 'global') { if (investorSelector) investorSelector.style.display = 'none'; } else if (isTargetExist && mutation.target.parentNode.innerText === 'us') { if (investorSelector) investorSelector.style.display = 'none'; } else { if (investorSelector) investorSelector.style.display = ''; } });};/* element - function which return element if exist if not return null ms - how long function should be waiting for element callback - action that will happen when element will be accessible*/function waitForElement(element, ms, callback) { if (element() === null && ms / 100 > 0) { setTimeout(function () { waitForElement(element, ms - 100, callback); }, 100); } else if (element() !== null) { callback(); } else { return false; }}