SILENT KILLERPanel

Current Path: > home > transcarter > public_html > wp-content > plugins > leadin > > > > scripts > iframe


Operation   : Linux host59.registrar-servers.com 4.18.0-513.18.1.lve.2.el8.x86_64 #1 SMP Sat Mar 30 15:36:11 UTC 2024 x86_64
Software     : Apache
Server IP    : 198.54.126.42 | Your IP: 216.73.216.135
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: /home/transcarter/public_html/wp-content/plugins/leadin////scripts/iframe

NameTypeSizeLast ModifiedActions
integratedMessages Directory - -
IframeErrorPage.tsx File 1311 bytes July 17 2025 21:06:25.
constants.ts File 343 bytes July 17 2025 21:06:25.
messageMiddleware.ts File 5861 bytes July 17 2025 21:06:25.
renderIframeApp.tsx File 1606 bytes July 17 2025 21:06:25.
useAppEmbedder.ts File 5652 bytes July 17 2025 21:06:25.
useBackgroundApp.ts File 700 bytes July 17 2025 21:06:25.

Reading File: /home/transcarter/public_html/wp-content/plugins/leadin////scripts/iframe/messageMiddleware.ts

import { MessageType, PluginMessages } from './integratedMessages';
import {
  fetchDisableInternalTracking,
  trackConsent,
  disableInternalTracking,
  getBusinessUnitId,
  setBusinessUnitId,
  skipReview,
  refreshProxyMappingsCache,
  fetchProxyMappingsEnabled,
  toggleProxyMappingsEnabled,
} from '../api/wordpressApiClient';
import { removeQueryParamFromLocation } from '../utils/queryParams';
import { startActivation, startInstall } from '../utils/contentEmbedInstaller';

export type Message = { key: MessageType; payload?: any };

const messageMapper: Map<MessageType, Function> = new Map([
  [
    PluginMessages.TrackConsent,
    (message: Message) => {
      trackConsent(message.payload);
    },
  ],
  [
    PluginMessages.InternalTrackingChangeRequest,
    (message: Message, embedder: any) => {
      disableInternalTracking(message.payload)
        .then(() => {
          embedder.postMessage({
            key: PluginMessages.InternalTrackingFetchResponse,
            payload: message.payload,
          });
        })
        .catch(payload => {
          embedder.postMessage({
            key: PluginMessages.InternalTrackingChangeError,
            payload,
          });
        });
    },
  ],
  [
    PluginMessages.InternalTrackingFetchRequest,
    (__message: Message, embedder: any) => {
      fetchDisableInternalTracking()
        .then(({ message: payload }) => {
          embedder.postMessage({
            key: PluginMessages.InternalTrackingFetchResponse,
            payload,
          });
        })
        .catch(payload => {
          embedder.postMessage({
            key: PluginMessages.InternalTrackingFetchError,
            payload,
          });
        });
    },
  ],
  [
    PluginMessages.BusinessUnitFetchRequest,
    (__message: Message, embedder: any) => {
      getBusinessUnitId()
        .then(payload => {
          embedder.postMessage({
            key: PluginMessages.BusinessUnitFetchResponse,
            payload,
          });
        })
        .catch(payload => {
          embedder.postMessage({
            key: PluginMessages.BusinessUnitFetchError,
            payload,
          });
        });
    },
  ],
  [
    PluginMessages.BusinessUnitChangeRequest,
    (message: Message, embedder: any) => {
      setBusinessUnitId(message.payload)
        .then(payload => {
          embedder.postMessage({
            key: PluginMessages.BusinessUnitFetchResponse,
            payload,
          });
        })
        .catch(payload => {
          embedder.postMessage({
            key: PluginMessages.BusinessUnitChangeError,
            payload,
          });
        });
    },
  ],
  [
    PluginMessages.SkipReviewRequest,
    (__message: Message, embedder: any) => {
      skipReview()
        .then(payload => {
          embedder.postMessage({
            key: PluginMessages.SkipReviewResponse,
            payload,
          });
        })
        .catch(payload => {
          embedder.postMessage({
            key: PluginMessages.SkipReviewError,
            payload,
          });
        });
    },
  ],
  [
    PluginMessages.RemoveParentQueryParam,
    (message: Message) => {
      removeQueryParamFromLocation(message.payload);
    },
  ],
  [
    PluginMessages.ContentEmbedInstallRequest,
    (message: Message, embedder: any) => {
      startInstall(message.payload.nonce)
        .then(payload => {
          embedder.postMessage({
            key: PluginMessages.ContentEmbedInstallResponse,
            payload: payload,
          });
        })
        .catch(payload => {
          embedder.postMessage({
            key: PluginMessages.ContentEmbedInstallError,
            payload,
          });
        });
    },
  ],
  [
    PluginMessages.ContentEmbedActivationRequest,
    (message: Message, embedder: any) => {
      startActivation(message.payload.activateAjaxUrl)
        .then(payload => {
          embedder.postMessage({
            key: PluginMessages.ContentEmbedActivationResponse,
            payload: payload,
          });
        })
        .catch(payload => {
          embedder.postMessage({
            key: PluginMessages.ContentEmbedActivationError,
            payload,
          });
        });
    },
  ],
  [
    PluginMessages.RefreshProxyMappingsRequest,
    (__message: Message, embedder: any) => {
      refreshProxyMappingsCache()
        .then(() => {
          embedder.postMessage({
            key: PluginMessages.RefreshProxyMappingsResponse,
            payload: {},
          });
        })
        .catch(payload => {
          embedder.postMessage({
            key: PluginMessages.RefreshProxyMappingsError,
            payload,
          });
        });
    },
  ],
  [
    PluginMessages.ProxyMappingsEnabledRequest,
    (__message: Message, embedder: any) => {
      fetchProxyMappingsEnabled()
        .then(payload => {
          embedder.postMessage({
            key: PluginMessages.ProxyMappingsEnabledResponse,
            payload,
          });
        })
        .catch(payload => {
          embedder.postMessage({
            key: PluginMessages.ProxyMappingsEnabledError,
            payload,
          });
        });
    },
  ],
  [
    PluginMessages.ProxyMappingsEnabledChangeRequest,
    ({ payload }: Message, embedder: any) => {
      toggleProxyMappingsEnabled(payload)
        .then(() => {
          embedder.postMessage({
            key: PluginMessages.ProxyMappingsEnabledResponse,
            payload,
          });
        })
        .catch(payload => {
          embedder.postMessage({
            key: PluginMessages.ProxyMappingsEnabledChangeError,
            payload,
          });
        });
    },
  ],
]);

export const messageMiddleware = (embedder: any) => (message: Message) => {
  const next = messageMapper.get(message.key);
  if (next) {
    next(message, embedder);
  }
};

SILENT KILLER Tool