: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
import Raven from '../lib/Raven';
import { domElements } from '../constants/selectors';
import ThickBoxModal from '../feedback/ThickBoxModal';
import { submitFeedbackForm } from '../feedback/feedbackFormApi';
getOrCreateBackgroundApp,
} from '../utils/backgroundAppUtils';
import { refreshToken } from '../constants/leadinConfig';
import { ProxyMessages } from '../iframe/integratedMessages';
function deactivatePlugin() {
const href = $(domElements.deactivatePluginButton).attr('href');
window.location.href = href;
function setLoadingState() {
$(domElements.deactivateFeedbackSubmit).addClass('loading');
function submitAndDeactivate(e: Event) {
const feedback = $(domElements.deactivateFeedbackForm)
.find(field => field.name === 'feedback');
submitFeedbackForm(domElements.deactivateFeedbackForm)
if (feedback && refreshToken) {
const embedder = getOrCreateBackgroundApp(refreshToken);
key: ProxyMessages.TrackPluginDeactivation,
type: feedback.value.trim().replace(/[\s']+/g, '_'),
Raven.captureException(err);
// eslint-disable-next-line no-new
domElements.deactivatePluginButton,
'leadin-feedback-container',
'leadin-feedback-window',
'leadin-feedback-content'
$(domElements.deactivateFeedbackForm)
.on('submit', submitAndDeactivate);
$(domElements.deactivateFeedbackSkip)
.on('click', deactivatePlugin);