(function() { let appId = 's4d-chatbot-app-' + Date.now(); let appHost = 'https://dev-chatbot-widget.science4data.com'; let chatToken = 'None'; let userOrgToken = 'None'; let userOrgEasyName = ''; let useUserOrgFiles = 'no'; let appMode = 'production'; let filePrefix = ( userOrgEasyName && useUserOrgFiles == 'yes' ? appMode + '-' + userOrgEasyName + '-' : '' ); let container = document.querySelector('#' + appId); if(!container) { container = document.createElement('div'); container.classList.add('s4d-chatbot'); container.setAttribute('id', appId); document.body.appendChild(container); } let app = container.querySelector('s4d-app'); if(!app) { app = document.createElement('div'); app.classList.add('s4d-app'); container.appendChild(app); } window.S4dChatBotConfig = { containerSelector: '#' + appId + ' .s4d-app', chatToken: chatToken, widgetMode: true, userOrgToken: userOrgToken } let head = document.getElementsByTagName('head')[0]; let style = document.createElement('link'); style.href = appHost + '/assets/' + filePrefix + 'index.css'; style.type = 'text/css' style.rel = 'stylesheet' head.appendChild(style); let script = document.createElement('script'); script.src = appHost + '/assets/' + filePrefix + 'index.js'; head.appendChild(script); })()