{"version":3,"file":"static/js/main-0a037d97-30c147ee8a041fb8e37e.js","mappings":"qiBAAIA,ECAAC,EACAC,E,oCCCG,MAAMC,EAAsD,CACjE,OACA,WACA,SACA,OACA,OACA,WACA,Y,iCCTK,MAAMC,EAAsB,CACjCC,YACE,iKAEF,IAAK,CACHC,MAAO,iCACPC,YACE,gMACFC,QAAS,CACP,CACEF,MAAO,6CACPC,YAAa,gDAEf,CACED,MAAO,0BACPC,YACE,+EAKRE,SAAU,CACRC,WACE,wK,2DCnBC,MAAMC,EAET,CAACC,EAAQC,IAqDJ,IAAI,KAAS,IAAK,GApDT,CACdC,KAAM,CACJC,eAAgB,CACd,CACEC,GAAI,YACJC,KAAM,gBACNC,MAAO,qBACPC,MAAO,EACPC,QAAS,KACTC,UAAU,EACVP,KAAM,CACJ,CACEE,GAAI,+CACJM,KAAM,8BAER,CACEN,GAAI,cACJM,KAAM,iOAGVC,aAAa,GAEf,CACEP,GAAI,SACJQ,MAAM,EACNP,KAAM,OACNC,MAAO,2BACPC,MAAO,EACPM,OACE,0GACFL,QAAS,GACTM,QACE,4MACFC,UAAU,EACVN,UAAU,EACVE,aAAa,GAEf,CACEP,GAAI,eACJC,KAAM,SACNC,MAAO,gBACPC,MAAO,EACPC,QAAS,EACTM,QAAS,GACTC,UAAU,EACVN,UAAU,EACVE,aAAa,OCtBVK,EAAmB,KAGvB,QAAa,CAClBC,SAqCEC,KAAKC,KACH,8BACApB,EACA,CACEqB,OAAQ,MAoFZF,KAAKG,cAGLH,KAAKG,YAAY,yCACjBH,KAAKG,YAAY,iCACjBH,KAAKG,YAAY,4BACjBH,KAAKG,YAAY,6BACjBH,KAAKG,YAAY,kCACjBH,KAAKG,YAAY,uCACjBH,KAAKG,YAAY,+BACjBH,KAAKG,YAAY,mCACjBH,KAAKG,YAAY,+BACjBH,KAAKG,YAAY,gDACjBH,KAAKG,YAAY,kDACjBH,KAAKG,YACH,yE,+CC7KR,MAQA,EARwB,MACtB,IAAAC,YAAU,KACRC,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pack://leadsbridge/webpack/runtime/chunk loaded","webpack://leadsbridge/webpack/runtime/load script","webpack://leadsbridge/./src/@typings/Api/bridgeFieldsArrayTypes.ts","webpack://leadsbridge/./src/lang/LangFbAppStore.tsx","webpack://leadsbridge/./src/mockapi/integrations/postChooseIntegrationSettings.ts","webpack://leadsbridge/./src/mockapi/index.ts","webpack://leadsbridge/./src/pages/AppStore/Close.tsx","webpack://leadsbridge/./src/services/FbAppStoreService.tsx","webpack://leadsbridge/./src/pages/AppStore/components/PlatformAuthentication.tsx","webpack://leadsbridge/./src/utils/appStore/FbAppStoreStepper.tsx","webpack://leadsbridge/./src/pages/AppStore/components/PlatformConfiguration.tsx","webpack://leadsbridge/./src/pages/AppStore/components/SpreadSheetSelection.tsx","webpack://leadsbridge/./src/pages/AppStore/components/SyncData.tsx","webpack://leadsbridge/./src/pages/AppStore/partials/FbTopBar.tsx","webpack://leadsbridge/./src/pages/AppStore/partials/FbStepGroup.tsx","webpack://leadsbridge/./src/pages/AppStore/FbAppStore.tsx","webpack://leadsbridge/./src/store/actions/FbAppStoreActions.tsx","webpack://leadsbridge/./src/pages/AppStore/FbAppStoreTest.tsx","webpack://leadsbridge/./src/pages/BridgeByUrlCallback/useGenericBbuAuth.ts","webpack://leadsbridge/./src/pages/Fbe.tsx","webpack://leadsbridge/./src/pages/FbeCallback.tsx","webpack://leadsbridge/./src/pages/IncomingData/IncomingDataScreen.tsx","webpack://leadsbridge/./src/pages/IncomingData/IncomingDataScreenFields.tsx","webpack://leadsbridge/./src/pages/IncomingData/IncomingDataScreenSave.tsx","webpack://leadsbridge/./src/pages/Integration/IntegrationAuthCallback.tsx","webpack://leadsbridge/./src/pages/Integration/IntegrationAuthCallback2.tsx","webpack://leadsbridge/./src/pages/Integration/IntegrationAuthScreen.tsx","webpack://leadsbridge/./src/pages/Integration/IntegrationAuthScreenEdit.tsx","webpack://leadsbridge/./src/pages/Integration/IntegrationAuthVerifiedEmailScreenLegacy.tsx","webpack://leadsbridge/./src/pages/Integration/IntegrationHome.tsx","webpack://leadsbridge/./src/pages/LegacyRedirect.tsx","webpack://leadsbridge/./src/pages/Logout/clearPersistentData.ts","webpack://leadsbridge/./src/pages/Nbee/BridgeChooser.tsx","webpack://leadsbridge/./src/pages/Nbee/NbeeHome.tsx","webpack://leadsbridge/./src/pages/Nbee/Step1.tsx","webpack://leadsbridge/./src/pages/Nbee/Step1Edit.tsx","webpack://leadsbridge/./src/pages/Nbee/Step2.tsx","webpack://leadsbridge/./src/pages/Nbee/Step3.tsx","webpack://leadsbridge/./src/pages/Page404.tsx","webpack://leadsbridge/./src/pages/SamlRedirect.tsx","webpack://leadsbridge/./src/pages/TestComponents.tsx","webpack://leadsbridge/./src/routes/byFeature/nbee.ts","webpack://leadsbridge/./src/routes/byFeature/integration.ts","webpack://leadsbridge/./src/routes/byFeature/billing.ts","webpack://leadsbridge/./src/routes/byFeature/facebook.ts","webpack://leadsbridge/./src/utils/seralizeQueryString.ts","webpack://leadsbridge/./src/routes/byFeature/auth.ts","webpack://leadsbridge/./src/routes/byFeature/googleAdsAccount.ts","webpack://leadsbridge/./src/routes/byFeature/admin.ts","webpack://leadsbridge/./src/routes/index.ts","webpack://leadsbridge/./src/routes/byFeature/bbu.ts","webpack://leadsbridge/./src/services/ApplicationV1Bridge.tsx","webpack://leadsbridge/./src/services/AuthService.tsx","webpack://leadsbridge/./src/services/CognitoApiService.tsx","webpack://leadsbridge/./src/services/FacebookService.tsx","webpack://leadsbridge/./src/services/apiAuthClient/index.ts","webpack://leadsbridge/./src/services/apiPublicClient/index.ts","webpack://leadsbridge/./src/services/axiosInterceptor.tsx","webpack://leadsbridge/./src/store/actions/ApplicationConfigurationActions.tsx","webpack://leadsbridge/./src/store/actions/IntegrationListenerActions.tsx","webpack://leadsbridge/./src/store/actions/UserActions.tsx","webpack://leadsbridge/./src/store/hooks.tsx","webpack://leadsbridge/./src/store/reducers/ApplicationConfigurationReducer.tsx","webpack://leadsbridge/./src/store/reducers/FbAppStoreReducer.tsx","webpack://leadsbridge/./src/store/reducers/IntegrationListenerReducer.tsx","webpack://leadsbridge/./src/store/reducers/UserReducer.tsx","webpack://leadsbridge/./src/store/types/ApplicationConfigurationTypes.tsx","webpack://leadsbridge/./src/store/types/FbAppStoreTypes.tsx","webpack://leadsbridge/./src/store/types/IntegrationListenerTypes.tsx","webpack://leadsbridge/./src/store/types/UserTypes.tsx","webpack://leadsbridge/./src/styles/modules/SemanticOverwrites.styled.tsx","webpack://leadsbridge/./src/styles/modules/Utilities.styled.tsx","webpack://leadsbridge/./src/styles/modules/Animations.styled.tsx","webpack://leadsbridge/./src/styles/modules/CommonCss.styled.tsx","webpack://leadsbridge/./src/styles/GlobalAppStyle.tsx","webpack://leadsbridge/./src/styles/iframeUtils.ts","webpack://leadsbridge/./src/styles/theme/default.ts","webpack://leadsbridge/./src/utils/PostMessages.tsx","webpack://leadsbridge/./src/utils/base64.ts","webpack://leadsbridge/./src/utils/cognitoErrors.ts","webpack://leadsbridge/./src/utils/cookieUtils.ts","webpack://leadsbridge/./src/utils/envUtils.ts","webpack://leadsbridge/./src/utils/helpers.ts","webpack://leadsbridge/./src/utils/isInFrame.ts","webpack://leadsbridge/./src/utils/randomIdGenerator.tsx","webpack://leadsbridge/./src/utils/validators/RegExp.tsx","webpack://leadsbridge/./src/utils/validators/phoneNumber.ts","webpack://leadsbridge/./src/utils/validators/yupCustomValidators.ts","webpack://leadsbridge/webpack/bootstrap","webpack://leadsbridge/webpack/runtime/compat get default export","webpack://leadsbridge/webpack/runtime/define property getters","webpack://leadsbridge/webpack/runtime/ensure chunk","webpack://leadsbridge/webpack/runtime/get javascript chunk filename","webpack://leadsbridge/webpack/runtime/global","webpack://leadsbridge/webpack/runtime/harmony module decorator","webpack://leadsbridge/webpack/runtime/hasOwnProperty shorthand","webpack://leadsbridge/webpack/runtime/make namespace object","webpack://leadsbridge/webpack/runtime/node module decorator","webpack://leadsbridge/webpack/runtime/publicPath","webpack://leadsbridge/webpack/runtime/jsonp chunk loading","webpack://leadsbridge/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var inProgress = {};\nvar dataWebpackPrefix = \"leadsbridge:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t};\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","import { ApiBridgeFieldDefinitionType } from 'BackendApi'\n\nexport const apiBridgeFieldTypes: ApiBridgeFieldDefinitionType[] = [\n  'text',\n  'dropdown',\n  'number',\n  'date',\n  'time',\n  'datetime',\n  'boolean',\n]\n","export const LangFbAppStore: any = {\n  popupLocked:\n    'Your browser is blocking popups, please allow them to proceed: More info: https://support.mozilla.org/en-US/kb/pop-blocker-settings-exceptions-troubleshooting',\n\n  101: {\n    title: 'Initial configuration required',\n    description:\n      'The platform encountered an error retrieving information from Facebook. <br/> To be able to continue the configuration, you need to create an initial setting (on the Business Manager page).',\n    helpers: [\n      {\n        title: 'Manage access to external data in Facebook',\n        description: 'Control how Facebook imports data from apps.',\n      },\n      {\n        title: 'Manage data connections',\n        description:\n          'Determine whether apps can import data to Facebook on a continuous basis.',\n      },\n    ],\n  },\n\n  messages: {\n    tokenError:\n      'hey something happened and we are not able to properly connect to FB. Sometimes (only the 1st time) this happens and it’s normal, can you please Retry and enjoy?!',\n  },\n}\n","import { RouteHandler } from 'miragejs/server'\nimport { AnyFactories, AnyModels, Registry } from 'miragejs/-types'\nimport { Response } from 'miragejs'\n\nexport const postChooseIntegrationSettings: RouteHandler<\n  Registry<AnyModels, AnyFactories>\n> = (schema, request) => {\n  const payload = {\n    data: {\n      schemaSettings: [\n        {\n          id: 'segmentId',\n          type: 'google_picker',\n          label: 'Google Spreadsheet',\n          order: 1,\n          default: null,\n          required: true,\n          data: [\n            {\n              id: '17l4EILlMz64mPkbOk8Qni64Y2uVxOVS6o5pJlyJ8zc8',\n              text: 'June - LB Kw research 2024',\n            },\n            {\n              id: 'accessToken',\n              text: 'ya29.a0AXooCguvjKmab8Fe40IOaLVjtJYkglqN4lUyWHOOgswZFTrR_Qejj4XOALW-xTy0BCc100VViyF5fBaC-u0Gg9799Vw_mCQoWFAU8PrZEE8ZVV1-LIp6RwxpU9Jgt9LSrzIQfU71CFBJ-gPhR6-ILAxMU_A8NdYJFEMoCAaCgYKAZcSARASFQHGX2MieTMO6TzsgakUT0llNGgoiA0173',\n            },\n          ],\n          refreshable: true,\n        },\n        {\n          id: 'listId',\n          hide: true,\n          type: 'text',\n          label: 'OR Google Spreadsheet Id',\n          order: 2,\n          docUrl:\n            'https://community.activeprospect.com/posts/5090366-how-leadsbridge-counts-the-custom-audiences-contacts',\n          default: '',\n          tooltip:\n            'This value is optional and you could specify the sheet in the Bridge configuration but if you have more than 500 sheets in your Google Account, it is important to specify here otherwise leave it blank.',\n          hasChild: true,\n          required: false,\n          refreshable: false,\n        },\n        {\n          id: 'moreSettings',\n          type: 'toggle',\n          label: 'More Settings',\n          order: 4,\n          default: 0,\n          tooltip: '',\n          hasChild: true,\n          required: false,\n          refreshable: false,\n        },\n      ],\n    },\n  }\n\n  return new Response(200, {}, payload)\n}\n","import { createServer } from 'miragejs'\nimport { getMetaHandler } from '@app/mockapi/integrations/getMeta'\nimport { handleOauthUserHandler } from '@app/mockapi/auth/handleOauthUser'\nimport { postStoreAppSurveyHandler } from '@app/mockapi/fastAppSurvey/postStoreAppSurveyHandler'\nimport { getSurveyDataHandler } from '@app/mockapi/fastAppSurvey/getSurveyDataHandler'\nimport { endpoints } from '@app/api/config'\nimport { handleOauthHandler } from '@app/mockapi/auth/handleOauth'\nimport { setupBridgeHandler } from '@app/mockapi/bbu/setupBridge'\nimport { getBridgeFields } from '@app/mockapi/nbee/getBridgeFields'\nimport { getBridgeById } from '@app/mockapi/nbee/getBridge'\nimport { getModules } from '@app/mockapi/nbee/getModules'\nimport { getAppAuthSchema } from '@app/mockapi/nbee/getAppAuthSchema'\nimport {\n  genRedirectUri,\n  getIntegrationsByAppId,\n  getIntegrationsById,\n  postAuthGrantCode,\n} from '@app/mockapi/nbee/integrations'\nimport { getUserMe } from '@app/mockapi/user/getUser'\nimport { getPlans } from '@app/mockapi/billing/getPlans'\nimport { changePlanHandler } from '@app/mockapi/billing/changePlan'\nimport { checkAppCompatibility } from '@app/mockapi/nbee/checkAppCompatibility'\nimport { getCustomerGoogleAdsAccountBillingInfo } from '@app/mockapi/googleAdsAccount/getCustomerGoogleAdsAccountBillingInfo'\nimport { postCreateGoogleAdsAccount } from '@app/mockapi/googleAdsAccount/postCreateGoogleAdsAccount'\nimport { getCurrencies } from '@app/mockapi/utilities/getCurrencies'\nimport { getTimezones } from '@app/mockapi/utilities/getTimezones'\nimport { getUserGeolocation } from '@app/mockapi/utilities/getUserGeolocation'\nimport { getEmails } from '@app/mockapi/integrations/getEmails'\nimport { getIntegrationUsage } from '@app/mockapi/integrations/getIntegrationUsage'\nimport { postChooseIntegrationSettings } from '@app/mockapi/integrations/postChooseIntegrationSettings'\n\nexport const createServerInit = () => {\n  console.info('Starting mirage mock server')\n\n  return createServer({\n    routes() {\n      /* this.get(endpoints.integrationsMeta, getMetaHandler, { timing: 1000 })\n\n      this.post(endpoints.handleOauthNotLoggedUser, handleOauthUserHandler, {\n        timing: 1000,\n      })\n      this.post(endpoints.handleOauthLoggedUser, handleOauthHandler, {\n        timing: 1000,\n      })\n\n      this.get(endpoints.fastAppSurveyData, getSurveyDataHandler, {\n        timing: 500,\n      })\n\n      this.post(endpoints.storeAppSurvey, postStoreAppSurveyHandler, {\n        timing: 2000,\n      })\n\n      this.post(endpoints.setupBridge, setupBridgeHandler, {\n        timing: 2000,\n      }) */\n\n      // NBEE\n      /* this.get(endpoints.getUserModules, getModules, {\n        timing: 500,\n      }) */\n      /*  this.get(\n        endpoints.getBridgeFields({ bridgeId: '321' }),\n        getBridgeFields,\n        {\n          timing: 500,\n        }\n      ) */\n      /*  this.get(endpoints.getBridgeById({ bridgeId: '321' }), getBridgeById, {\n        timing: 500,\n      }) */\n\n      this.post(\n        endpoints.chooseIntegrationSettings,\n        postChooseIntegrationSettings,\n        {\n          timing: 1000,\n        }\n      )\n\n      /* this.post(\n        endpoints.getAppAuthSchemaByAppId({ appId: '*' }),\n        getAppAuthSchema,\n        {\n          timing: 2000,\n        }\n      ) */\n      /* this.get(endpoints.getIntegrationsByAppId, getIntegrationsByAppId, {\n        timing: 500,\n      }) */\n      /* this.get(\n        endpoints.getIntegrationById({ integrationId: '*' }),\n        getIntegrationsById,\n        {\n          timing: 500,\n        }\n      ) */\n\n      /* this.get(\n        endpoints.getIntegrationUsage({ integrationId: '*' }),\n        getIntegrationUsage,\n        {\n          timing: 500,\n        }\n      ) */\n\n      // this.get(`${endpoints.checkAppsCompatibility}`, checkAppCompatibility)\n\n      // User\n      // this.get(endpoints.getUser, getUserMe)\n\n      // billing\n      // this.get(endpoints.getPlans, getPlans)\n      // this.post(endpoints.changePlan, changePlanHandler, {\n      //   timing: 4000,\n      // })\n\n      // this.get(endpoints.getVerifiedEmails, getEmails)\n\n      /* this.post(endpoints.postAuthGrantCode, postAuthGrantCode, {\n        timing: 2000,\n      })\n\n      this.post(endpoints.postGenRedirectUri, genRedirectUri, {\n        timing: 2000,\n      }) */\n\n      // Google Ads Account\n      /*  this.get(\n        endpoints.getCustomerGoogleAdsAccountBillingInfo({\n          customerId: '6798222368',\n        }),\n        getCustomerGoogleAdsAccountBillingInfo,\n        {\n          timing: 500,\n        }\n      )\n\n      this.post(\n        endpoints.postCreateGoogleAdsAccount,\n        postCreateGoogleAdsAccount,\n        {\n          timing: 900,\n        }\n      ) */\n\n      // Utilities\n      /* this.get(endpoints.getCurrencies, getCurrencies, {\n        timing: 300,\n      }) */\n\n      /* this.get(endpoints.getTimezones, getTimezones, {\n        timing: 400,\n      }) */\n\n      /* this.get(endpoints.getUserGeolocation, getUserGeolocation, {\n        timing: 300,\n      }) */\n\n      // All other API requests on the current domain will still pass through\n      this.passthrough()\n\n      // adding domains to skip\n      this.passthrough('https://fg8vvsvnieiv3ej16jby.litix.io')\n      this.passthrough('http://pipedream.wistia.com/*')\n      this.passthrough('https://api.segment.io/*')\n      this.passthrough('https://cdn.segment.com/*')\n      this.passthrough(`${process.env.REACT_APP_V1_API}/**`)\n      this.passthrough(`${process.env.REACT_APP_LARAVEL_API}/**`)\n      this.passthrough('https://www.facebook.com/**')\n      this.passthrough('https://www.web.facebook.com/**')\n      this.passthrough('https://web.facebook.com/**')\n      this.passthrough('https://cognito-idp.us-west-2.amazonaws.com/')\n      this.passthrough('https://cognito-idp.us-west-2.amazonaws.com/**')\n      this.passthrough(\n        `${process.env.REACT_APP_COGNITO_URL}.amazoncognito.com/oauth2/token`\n      )\n    },\n  })\n}\n\nexport default createServerInit\n","import React, { useEffect } from 'react'\n\nconst Close: React.FC = () => {\n  useEffect(() => {\n    window.close()\n  }, [])\n\n  return <div></div>\n}\n\nexport default Close\n","import { AxiosInstance, AxiosResponse } from 'axios'\nimport * as React from 'react'\nimport { FacebookParameters } from 'LeadsBridgeApp'\nimport { axiosInterceptor } from './axiosInterceptor'\n\nexport default class FbAppStoreService {\n  // 25-may forse versione definitiva???\n  public static getSheetsUrl: string = '/fbAppStore/v2/getSpreedSheets'\n  public static getSpreedSheetTabsUrl: string =\n    '/fbAppStore/v2/getSpreedSheetTabs' // TODO getSpreedSheetTabs ? era sbagliata.\n\n  // TODO DA CONTROLLARE\n  public static getPlatformAuthUrl: string = '/fbAppStore/v2/getPlatformAuth'\n  public static doPlatformAuthUrl: string = '/fbAppStore/v2/doPlatformAuth'\n  public static generateExternalBusinessIdUrl: string =\n    '/fbAppStore/v2/generateExternalBusinessId'\n\n  public static saveSheetSelectionUrl: string =\n    '/fbAppStore/v2/doSpreedSheetConfig'\n\n  public static saveSegmentSelectionUrl: string =\n    '/fbAppStore/v2/doSegmentConfig'\n\n  public static getSegmentTypesUrl: string = '/fbAppStore/v2/getSegmentTypes'\n  public static segmentUrls: string = '/fbAppStore/v2/getSegments'\n\n  // platform configuraiton\n  public static getPlatformCapabilitiesUrl: string =\n    '/fbAppStore/v2/getPlatformCapabilities'\n\n  public static doPublishBridgesUrl: string = '/fbAppStore/v2/doPublishBridges'\n  public static getSyncDataLinksUrl: string = '/fbAppStore/v2/getSyncDataLinks'\n\n  // 25-may forse versione definitiva???\n  static getSheets = async (platformId: number): Promise<any> => {\n    return await axiosInterceptor().then((ax: AxiosInstance) => {\n      return ax\n        .get(\n          process.env.REACT_APP_V1_API +\n            FbAppStoreService.getSheetsUrl +\n            '?platformId=' +\n            platformId\n        )\n        .then((res: AxiosResponse) => {\n          return res.data\n        })\n    })\n  }\n\n  static getSpreadSheetTabs = async (\n    platformId: number,\n    selectedSheetId: string\n  ): Promise<any> => {\n    return await axiosInterceptor().then((ax: AxiosInstance) => {\n      return ax\n        .get(\n          process.env.REACT_APP_V1_API +\n            FbAppStoreService.getSpreedSheetTabsUrl +\n            '?platformId=' +\n            platformId +\n            '&sheetId=' +\n            selectedSheetId\n        )\n        .then((res: AxiosResponse) => {\n          return res.data\n        })\n    })\n  }\n\n  // TODO DA RICONTROLLARE\n\n  static getPlatformAuth = async (platformId: number): Promise<any> => {\n    // console.log('getPlatformAuth platformId', platformId);\n    const url =\n      process.env.REACT_APP_V1_API + FbAppStoreService.getPlatformAuthUrl\n    return await axiosInterceptor().then((ax: AxiosInstance) => {\n      return ax\n        .get(url + '?platformId=' + platformId)\n        .then((res: AxiosResponse) => {\n          return res.data\n        })\n    })\n  }\n\n  static doPlatformAuth = async (\n    fields: object,\n    platformId: number\n  ): Promise<any> => {\n    const url =\n      process.env.REACT_APP_V1_API + FbAppStoreService.doPlatformAuthUrl\n    return await axiosInterceptor().then((ax: AxiosInstance) => {\n      return ax\n        .post(url + '?platformId=' + platformId, {\n          fields,\n        })\n        .then((res: AxiosResponse) => {\n          return res.data\n        })\n    })\n  }\n\n  static generateExternalBusinessId = async (): Promise<FacebookParameters> => {\n    return await axiosInterceptor().then((ax: AxiosInstance) => {\n      return ax\n        .get(\n          process.env.REACT_APP_V1_API +\n            FbAppStoreService.generateExternalBusinessIdUrl,\n          {}\n        )\n        .then((res: AxiosResponse) => {\n          return res.data\n        })\n    })\n  }\n\n  static segmentTypes = async (platformId: number): Promise<any> => {\n    return await axiosInterceptor().then((ax: AxiosInstance) => {\n      return ax\n        .get(\n          process.env.REACT_APP_V1_API +\n            FbAppStoreService.getSegmentTypesUrl +\n            '?platformId=' +\n            platformId\n        )\n        .then((res: AxiosResponse) => {\n          return res.data\n        })\n    })\n  }\n\n  static getSegments = async (\n    platformId: number,\n    selectedSheetId: string\n  ): Promise<any> => {\n    return await axiosInterceptor().then((ax: AxiosInstance) => {\n      return ax\n        .get(\n          process.env.REACT_APP_V1_API +\n            FbAppStoreService.segmentUrls +\n            '?segmentType=' +\n            selectedSheetId +\n            '&platformId=' +\n            platformId\n        )\n        .then((res: AxiosResponse) => {\n          return res.data\n        })\n    })\n  }\n\n  static saveSegmentSelection = async (\n    platformId: number,\n    selectedSheetId: string,\n    selectedTabId: string\n  ): Promise<any> => {\n    return await axiosInterceptor().then((ax: AxiosInstance) => {\n      return ax\n        .post(\n          process.env.REACT_APP_V1_API +\n            FbAppStoreService.saveSegmentSelectionUrl,\n          {\n            segmentType: selectedSheetId,\n            segmentId: selectedTabId,\n            platformId: platformId,\n          }\n        )\n        .then((res: AxiosResponse) => {\n          return res.data\n        })\n    })\n  }\n\n  static saveSheetSelection = async (\n    platformId: number,\n    selectedSheetId: string,\n    selectedTabId: string\n  ): Promise<any> => {\n    return await axiosInterceptor().then((ax: AxiosInstance) => {\n      return ax\n        .post(\n          process.env.REACT_APP_V1_API +\n            FbAppStoreService.saveSheetSelectionUrl,\n          {\n            sheetId: selectedSheetId,\n            tabId: selectedTabId,\n          }\n        )\n        .then((res: AxiosResponse) => {\n          return res.data\n        })\n    })\n  }\n\n  // platform configuration\n  static getPlatformCapabilities = async (platformId: number): Promise<any> => {\n    return await axiosInterceptor().then((ax: AxiosInstance) => {\n      return ax\n        .get(\n          process.env.REACT_APP_V1_API +\n            FbAppStoreService.getPlatformCapabilitiesUrl +\n            '?platformId=' +\n            platformId\n        )\n        .then((res: AxiosResponse) => {\n          return res.data\n        })\n    })\n  }\n\n  static doPublishBridges = async (\n    platformId: number,\n    entities: string[],\n    limitedDataUse: boolean,\n    adsDeliveryOptimization: boolean\n  ): Promise<any> => {\n    return await axiosInterceptor().then((ax: AxiosInstance) => {\n      return ax\n        .post(\n          process.env.REACT_APP_V1_API + FbAppStoreService.doPublishBridgesUrl,\n          {\n            platformId: platformId,\n            entities: entities,\n            limitedDataUse: limitedDataUse,\n            adsDeliveryOptimization: adsDeliveryOptimization,\n          }\n        )\n        .then((res: AxiosResponse) => {\n          return res.data\n        })\n    })\n  }\n\n  static getSyncDataLinks = async (): Promise<any> => {\n    return await axiosInterceptor().then((ax: AxiosInstance) => {\n      return ax\n        .get(\n          process.env.REACT_APP_V1_API + FbAppStoreService.getSyncDataLinksUrl\n        )\n        .then((res: AxiosResponse) => {\n          return res.data\n        })\n    })\n  }\n}\n","import React, { useEffect, useState } from 'react'\nimport { useSelector } from 'react-redux'\nimport { RootState } from '../../../index'\nimport FbAppStoreService from '../../../services/FbAppStoreService'\nimport {\n  Button,\n  Dimmer,\n  Form,\n  Icon,\n  Label,\n  Loader,\n  Message,\n  Segment,\n} from 'semantic-ui-react'\nimport { LangFbAppStore } from '../../../lang/LangFbAppStore'\nimport { doPostMessage, Messages } from '../../../utils/PostMessages'\n\nconst PlatformAuthentication: React.FC<{ setOpen: any; setAPIresponse: any }> =\n  ({ setOpen, setAPIresponse }) => {\n    const platformId: number = useSelector(\n      (state: RootState) => state.appStore.platformId\n    )\n    const [loading, setLoading] = useState<boolean>(true)\n\n    const [fields, setFields] = useState<any>({})\n    const [helpUrl, setHelpUrl] = useState<string>('')\n    const [labels, setLabels] = useState<any>({})\n\n    const [formError, setFormError] = useState<string>('')\n\n    useEffect(() => {\n      let subscribed = true\n\n      // helpUrl: \"https://leadsbridge.com/documentation/google-sheets\"\n      // oauth2RedirectUrl: \"https://leadsbridge.com/fbAppStore/v1/doOauth2\"\n      if (platformId > 0) {\n        // setRedirectUrl(process.env.REACT_APP_V1_API + '/fbAppStore/v1/doOauth2');\n\n        doPostMessage(Messages.PlatformInvoked)\n        FbAppStoreService.getPlatformAuth(platformId)\n          .then((res) => {\n            if (subscribed && res.oauth2RedirectUrl) {\n              // setRedirectUrl(res.oauth2RedirectUrl);\n            } else {\n              setHelpUrl(res.helpUrl)\n              const newObj: any = {}\n              Object.keys(res.authFields).map((key: string) => {\n                newObj[key] = ''\n              })\n              setFields(newObj)\n              setLabels(res.authFields)\n            }\n          })\n          .catch((res) => {\n            switch (res.response.data.errorCode) {\n              case 101:\n                setAPIresponse(res.response.data)\n                setOpen(true)\n                break\n              default:\n                return null\n            }\n          })\n          .finally(() => {\n            setLoading(false)\n          })\n      }\n\n      return () => {\n        subscribed = false\n      }\n    }, [platformId])\n\n    const doOauth2 = () => {\n      const url =\n        process.env.REACT_APP_V1_API +\n        '/fbAppStore/v2/doOauth2?platformId=' +\n        platformId\n      const width = 1120\n      const left = window.screen.width / 2 - width / 2\n      const newWin = window.open(\n        url,\n        'ModalPopUp',\n        `toolbar=no,\n            scrollbars=no, location=no, statusbar=no, menubar=no,\n            resizable=0, width=${width}, height=720, left=${left}, top=234`\n      )\n      if (!newWin || newWin.closed || typeof newWin.closed === 'undefined') {\n        setFormError(LangFbAppStore.popupLocked)\n        setTimeout(() => setFormError(''), 5000)\n        doPostMessage(Messages.PlatformError)\n      } else {\n        doPostMessage(Messages.PlatformAuthorized)\n      }\n    }\n\n    const doAuth = () => {\n      let emptyField = false\n      Object.values(fields).forEach((value: any) => {\n        if (value === '') {\n          emptyField = true\n        }\n      })\n      if (emptyField) {\n        setFormError('All fields are required')\n        return\n      }\n      setLoading(true)\n      FbAppStoreService.doPlatformAuth(fields, platformId)\n        .then((r) => {\n          doPostMessage(Messages.PlatformAuthorized)\n        })\n        .catch((err) => {\n          doPostMessage(Messages.PlatformError)\n          setFormError(err.response?.data?.errorMessage ?? 'Error')\n        })\n        .finally(() => {\n          setLoading(false)\n        })\n    }\n\n    return (\n      <Segment style={{ border: 'none', boxShadow: 'none' }}>\n        <Dimmer\n          inverted\n          active={platformId === 0 || loading}\n          style={{\n            marginTop: '' + '' + '50px',\n          }}\n        >\n          <Loader>Loading</Loader>\n        </Dimmer>\n\n        {!loading && platformId !== 0 && (\n          <Form\n            style={{ paddingTop: '2em', paddingBottom: '2em' }}\n            method={'POST'}\n            error={formError !== ''}\n          >\n            <div style={{ textAlign: 'center' }}>\n              <img\n                alt={'Platform logo'}\n                src={`https://leadsbridge.com/wp-content/themes/leadsbridge/img/integration-logos/logo${platformId}.png`}\n              />\n            </div>\n            <br />\n\n            {!fields || Object.keys(fields).length === 0 ? (\n              <div style={{ textAlign: 'center' }}>\n                <Button\n                  style={{ marginTop: '1em' }}\n                  color='blue'\n                  size={'large'}\n                  fluid\n                  onClick={doOauth2}\n                >\n                  Authorize\n                </Button>\n              </div>\n            ) : (\n              <>\n                {Object.keys(fields).map((key: string, index: number) => {\n                  return (\n                    <Form.Input\n                      key={'field-' + index}\n                      label={labels[key] + ' *'}\n                      onChange={(e) => {\n                        const oldFields = { ...fields }\n                        oldFields[key] = e.target.value\n                        setFields(oldFields)\n                      }}\n                    />\n                  )\n                })}\n                <p style={{ opacity: 0.6 }}>\n                  <sup>*</sup> Fields mandatory\n                </p>\n\n                <a href={helpUrl} target={'_blank'} rel='noreferrer'>\n                  <Label>\n                    <Icon name={'external alternate'} /> What are those fields?\n                  </Label>\n                </a>\n                <div>\n                  <Button\n                    style={{ marginTop: '1em' }}\n                    color='blue'\n                    size={'large'}\n                    fluid\n                    className={loading ? 'loading' : ''}\n                    onClick={doAuth}\n                  >\n                    Authorize\n                  </Button>\n                </div>\n              </>\n            )}\n\n            {formError !== '' && (\n              <Message error header='Error' content={formError} />\n            )}\n          </Form>\n        )}\n      </Segment>\n    )\n  }\n\nexport default PlatformAuthentication\n","import { AppStoreStatus } from '../../enums/AppStoreStatus'\n\nexport const FbAppStoreStepper = {\n  googleSheet: [\n    {\n      index: 0,\n      values: [AppStoreStatus.PLATFORMAUTHENTICATION, AppStoreStatus.NONE],\n      name: 'Connect',\n    },\n    {\n      index: 1,\n      values: [AppStoreStatus.SPREADSHEETSELECTION],\n      name: 'Select document',\n    },\n    {\n      index: 2,\n      values: [AppStoreStatus.PLATFORMCONFIGURATION],\n      name: 'Review & confirm',\n    },\n    {\n      index: 3,\n      values: [AppStoreStatus.PUBLISH],\n      name: 'Sync data',\n    },\n  ],\n  newType: [\n    {\n      index: 0,\n      values: [AppStoreStatus.PLATFORMAUTHENTICATION, AppStoreStatus.NONE],\n      name: 'Connect',\n    },\n    {\n      index: 1,\n      values: [AppStoreStatus.STATUS_SEGMENTATION_SELECTION],\n      name: 'Select document',\n    },\n    {\n      index: 2,\n      values: [AppStoreStatus.PLATFORMCONFIGURATION],\n      name: 'Review & confirm',\n    },\n    {\n      index: 3,\n      values: [AppStoreStatus.PUBLISH],\n      name: 'Sync data',\n    },\n  ],\n  default: [\n    {\n      index: 0,\n      values: [AppStoreStatus.PLATFORMAUTHENTICATION, AppStoreStatus.NONE],\n      name: 'Connect',\n    },\n    {\n      index: 1,\n      values: [AppStoreStatus.PLATFORMCONFIGURATION],\n      name: 'Review & confirm',\n    },\n    {\n      index: 2,\n      values: [AppStoreStatus.PUBLISH],\n      name: 'Sync data',\n    },\n  ],\n}\n","import React, { Dispatch, forwardRef, useEffect, useState } from 'react'\nimport {\n  Button,\n  Checkbox,\n  Dimmer,\n  Form,\n  Header,\n  Label,\n  List,\n  Loader,\n  Message,\n  Radio,\n  Segment,\n} from 'semantic-ui-react'\nimport { FbAppStoreStep } from 'LeadsBridgeApp'\nimport { FbAppStoreStepper } from '../../../utils/appStore/FbAppStoreStepper'\nimport FbAppStoreService from '../../../services/FbAppStoreService'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { RootState } from '../../../index'\nimport { sendToast } from '../../../store/actions/ApplicationConfigurationActions'\nimport { doPostMessage, Messages } from '../../../utils/PostMessages'\n\nconst PlatformConfiguration = forwardRef(\n  (props: { steps: FbAppStoreStep[] }, ref) => {\n    const dispatch: Dispatch<any> = useDispatch()\n    const platformId: number = useSelector(\n      (state: RootState) => state.appStore.platformId\n    )\n    const [type, setType] = useState<string>('default')\n    const [platformName, setPlatformName] = useState('')\n    const [entities, setEntities] = useState<any[]>([])\n    const [checkedEntity, setCheckedEntity] = useState<string>('')\n    const [checkedEntities, setCheckedEntities] = useState<any[]>([])\n\n    const [privacy1, setPrivacy1] = useState<boolean>(false)\n    const [privacy2, setPrivacy2] = useState<boolean>(false)\n    const [saving, setSaving] = useState<boolean>(false)\n    const [loadingEntities, setLoadingEntities] = useState<boolean>(true)\n\n    useEffect(() => {\n      if (FbAppStoreStepper.googleSheet === props.steps) {\n        setType('google')\n      }\n      // do post getPlatformCapabilities passandogli come parametro platformId\n    }, [])\n\n    useEffect(() => {\n      if (platformId > 0) {\n        FbAppStoreService.getPlatformCapabilities(platformId)\n          .then((res) => {\n            setPlatformName(res.PlatformName || 'source')\n            setEntities(res.Entities)\n          })\n          .finally(() => setLoadingEntities(false))\n      }\n    }, [platformId])\n\n    const entityCheck = (value: any) => {\n      setCheckedEntity(value)\n    }\n\n    const saveConfiguration = () => {\n      const parsedEntities: string[] = (\n        type === 'google' ? [checkedEntity] : checkedEntities\n      ).filter(function (el) {\n        return el != null && el !== ''\n      })\n      if (parsedEntities.length === 0) {\n        dispatch(\n          sendToast({\n            title: 'Warning',\n            messages: ['Fields are required'],\n            color: 'warning',\n          })\n        )\n        return\n      }\n\n      setSaving(true)\n      doPostMessage(Messages.PlatformCompleted)\n      FbAppStoreService.doPublishBridges(\n        platformId,\n        parsedEntities,\n        privacy1,\n        privacy2\n      )\n        .then((res) => {})\n        .catch((e) => {\n          const error =\n            e.response?.data?.errorMessage ??\n            'An internal error occurred, please try again later.'\n          dispatch(\n            sendToast({\n              title: 'An error occurred',\n              messages: [error],\n              color: 'negative',\n            })\n          )\n        })\n        .finally(() => {\n          setSaving(false)\n        })\n    }\n\n    return (\n      <div>\n        <Header as={'h1'}>Review configuration</Header>\n\n        <Dimmer\n          inverted\n          active={platformId === 0 || loadingEntities}\n          style={{\n            marginTop: '' + '' + '50px',\n          }}\n        >\n          <Loader>Loading</Loader>\n        </Dimmer>\n\n        <p>\n          {type === 'google' ? 'Choose ' : 'Select '} the objects to sync and\n          check below some examples of the data that will be synced.\n          <br />\n          Continuing to the next step you authorize LeadsBridge sends these data\n          to Facebook.\n        </p>\n        <List divided relaxed>\n          {Object.keys(entities).map((key: any, index: number) => {\n            return (\n              <List.Item\n                style={{\n                  display: 'flex',\n                  alignItems: 'center',\n                  padding: '1em',\n                }}\n                onClick={(e) => {\n                  if (type === 'google') {\n                    entityCheck(key)\n                  } else {\n                    const newCheckedEntities = [...checkedEntities]\n                    const keyIndex = newCheckedEntities.indexOf(key)\n                    if (keyIndex >= 0) {\n                      newCheckedEntities.splice(keyIndex, 1)\n                    } else {\n                      newCheckedEntities.push(key)\n                    }\n                    setCheckedEntities(newCheckedEntities)\n                  }\n                }}\n                key={'entity-' + index}\n              >\n                {type === 'google' ? (\n                  <Radio checked={checkedEntity === key} />\n                ) : (\n                  <Checkbox checked={checkedEntities.indexOf(key) >= 0} />\n                )}\n                <List.Content style={{ marginLeft: '15px' }}>\n                  <List.Description as='a'>\n                    {entities[key].Label}\n                  </List.Description>\n                  <List.Description>\n                    {Object.keys(entities[key].SourceMappedFields).map(\n                      (k: any) => {\n                        return (\n                          <Label style={{ marginBottom: '3px' }}>\n                            {entities[key].SourceMappedFields[k]}\n                          </Label>\n                        )\n                      }\n                    )}\n                  </List.Description>\n                </List.Content>\n              </List.Item>\n            )\n          })}\n        </List>\n\n        <Message style={{ marginTop: '35px' }}>\n          <Message.Header>Changes in Service</Message.Header>\n          <p>\n            Decide what Facebook can do automatically with data from{' '}\n            {platformName}\n          </p>\n          <Form>\n            <Form.Field>\n              <Form.Checkbox\n                label={'Ads Delivery Optimization'}\n                onClick={() => setPrivacy1(!privacy1)}\n                checked={privacy1}\n              />\n              <p\n                style={{\n                  marginLeft: '1.85714em',\n                  marginTop: '-10px',\n                  marginBottom: '10px',\n                  opacity: 0.6,\n                }}\n              >\n                Allow Facebook to make subtle adjustements to your campaing to\n                maximize performance.\n              </p>\n            </Form.Field>\n            <Form.Field style={{ marginTop: '25px' }}>\n              <Form.Checkbox\n                label={'Limited Data Use'}\n                onClick={() => setPrivacy2(!privacy2)}\n                checked={privacy2}\n              />\n              <p\n                style={{\n                  marginLeft: '1.85714em',\n                  marginTop: '-10px',\n                  opacity: 0.6,\n                }}\n              >\n                {' '}\n                Communicate when customer in California have opted out of the\n                sale of data as defined by the CCPA.\n              </p>\n            </Form.Field>\n          </Form>\n        </Message>\n\n        <div style={{ textAlign: 'right' }}>\n          <Button\n            color={'blue'}\n            className={saving ? 'loading disabled' : ''}\n            disabled={saving}\n            onClick={() => saveConfiguration()}\n          >\n            Start sync\n          </Button>\n        </div>\n      </div>\n    )\n  }\n)\n\nexport default PlatformConfiguration\n","import React, {\n  createRef,\n  Dispatch,\n  forwardRef,\n  useEffect,\n  useState,\n} from 'react'\nimport {\n  Button,\n  Form,\n  Header,\n  Icon,\n  Message,\n  Search,\n  SearchProps,\n  SearchResultData,\n  Segment,\n} from 'semantic-ui-react'\nimport { filter, debounce, escapeRegExp } from 'lodash-es'\nimport { FbAppStoreStepper } from '../../../utils/appStore/FbAppStoreStepper'\nimport { FbAppStoreStep } from 'LeadsBridgeApp'\nimport FbAppStoreService from '../../../services/FbAppStoreService'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { RootState } from '../../../index'\nimport ReactDOM from 'react-dom'\nimport { sendToast } from '../../../store/actions/ApplicationConfigurationActions'\nimport styled from 'styled-components'\n\nconst SearchStyled = styled.div`\n  display: flex;\n  width: 100%;\n  .search {\n    width: 100%;\n  }\n  &#document-search .results {\n    // use searchResultHeight\n    max-height: 210px;\n    overflow-y: auto;\n  }\n  &#worksheet-search .results {\n    max-height: 150px;\n    overflow-y: auto;\n  }\n`\n\nconst SpreadSheetSelection = forwardRef(\n  (props: { steps: FbAppStoreStep[] }, ref) => {\n    const dispatch: Dispatch<any> = useDispatch()\n\n    const platformId: number = useSelector(\n      (state: RootState) => state.appStore.platformId\n    )\n    const [formError, setFormError] = useState<string>('')\n\n    const [sheetTemplateUrl, setSheetTemplateUrl] = useState<string>('')\n    const [documentationTemplateUrl, setDocumentationTemplateUrl] =\n      useState<string>('')\n\n    const [isFilteringSheets, setIsFilteringSheets] = useState<boolean>(true)\n    const [sheet, setSheet] = useState<string>('')\n    const [sheetId, setSheetId] = useState<string>('')\n\n    const [results, setResults] = useState<any[]>([])\n\n    const [isFilteringWorksheets, setIsFilteringWorksheets] =\n      useState<boolean>(false)\n    const [worksheet, setWorksheet] = useState<string>('')\n\n    const searchRef = createRef<any>()\n    const [worksheetId, setWorksheetId] = useState<string>('')\n    const [workResults, setWorkResults] = useState<any[]>([])\n\n    const search2Ref = createRef<any>()\n    const [sheets, setSheets] = useState<{ title: string; value: string }[]>([])\n    const [worksheets, setWorksheets] = useState<\n      { title: string; value: string }[]\n    >([])\n\n    const [refreshingList, setRefreshingList] = useState<boolean>(false)\n    const [type, setType] = useState<string>('')\n\n    const [nextStep, setNextStep] = useState<boolean>(false)\n\n    const handleSearchChange = (\n      e: React.MouseEvent<HTMLElement, MouseEvent>,\n      data: SearchProps\n    ) => {\n      setIsFilteringSheets(true)\n      const dataValue = data.value!.toString()\n      setSheet(dataValue)\n      setTimeout(() => {\n        const re = new RegExp(escapeRegExp(data.value), 'i')\n        const isMatch = (result: { title: string; value: string }) =>\n          re.test(result.title)\n        setIsFilteringSheets(false)\n        setResults(filter(sheets, isMatch))\n      }, 300)\n    }\n    const handleResultSelect = (e: any, value: SearchResultData) => {\n      const result: { title: string; value: string } = value.result\n      setWorksheet('')\n      setSheet(result.title)\n      setSheetId(result.value)\n    }\n\n    const handleSearchChangeWork = (\n      e: React.MouseEvent<HTMLElement, MouseEvent>,\n      data: SearchProps\n    ) => {\n      setIsFilteringWorksheets(true)\n      const dataValue = data.value!.toString()\n      setWorksheet(dataValue)\n      setTimeout(() => {\n        const re = new RegExp(escapeRegExp(data.value), 'i')\n        const isMatch = (result: { title: string; value: string }) =>\n          re.test(result.title)\n        setIsFilteringWorksheets(false)\n        const filteredResults = filter(worksheets, isMatch)\n        setWorkResults(filteredResults)\n      }, 300)\n    }\n    const handleResultSelectWork = (e: any, value: SearchResultData) => {\n      const result: { title: string; value: string } = value.result\n      setWorksheet(result.title)\n      setWorksheetId(result.value)\n    }\n\n    const refreshTheList = () => {\n      setRefreshingList(true)\n      // backend api\n      setTimeout(() => setRefreshingList(false), 1000)\n    }\n\n    useEffect(() => {\n      if (sheetId !== '' && type !== '') {\n        clickListener()\n        setIsFilteringWorksheets(true)\n        if (type === 'google') {\n          FbAppStoreService.getSpreadSheetTabs(platformId, sheetId)\n            .then((res) => {\n              //\n              setWorksheets(res.Tabs)\n            })\n            .catch((e) => {\n              const error =\n                e.response?.data?.errorMessage ??\n                'An internal error occurred, please try again later.'\n              dispatch(\n                sendToast({\n                  title: 'An error occurred',\n                  messages: [error],\n                  color: 'negative',\n                })\n              )\n            })\n            .finally(() => {\n              setIsFilteringWorksheets(false)\n            })\n        } else {\n          FbAppStoreService.getSegments(platformId, sheetId)\n            .then((res) => {\n              setWorksheets(res.segments)\n            })\n            .catch((e) => {\n              const error =\n                e.response?.data?.errorMessage ??\n                'An internal error occurred, please try again later.'\n              dispatch(\n                sendToast({\n                  title: 'An error occurred',\n                  messages: [error],\n                  color: 'negative',\n                })\n              )\n            })\n            .finally(() => {\n              setIsFilteringWorksheets(false)\n            })\n        }\n      }\n    }, [sheetId, type])\n\n    useEffect(() => {\n      if (worksheetId !== '') {\n        clickListener()\n      }\n    }, [worksheetId])\n\n    const next = () => {\n      if (worksheetId === '' || sheet === '') {\n        setFormError('All fields are required')\n        return\n      }\n      setNextStep(true)\n      if (type === 'google') {\n        FbAppStoreService.saveSheetSelection(platformId, sheetId, worksheetId)\n          .then(() => {})\n          .catch((e) => {\n            const error =\n              e.response?.data?.errorMessage ??\n              'An internal error occurred, please try again later.'\n            dispatch(\n              sendToast({\n                title: 'An error occurred',\n                messages: [],\n                color: 'negative',\n              })\n            )\n          })\n          .finally(() => {\n            setNextStep(false)\n          })\n      } else {\n        FbAppStoreService.saveSegmentSelection(platformId, sheetId, worksheetId)\n          .then(() => {})\n          .catch((e) => {\n            const error =\n              e.response?.data?.errorMessage ??\n              'An internal error occurred, please try again later.'\n            dispatch(\n              sendToast({\n                title: 'An error occurred',\n                messages: [],\n                color: 'negative',\n              })\n            )\n          })\n          .finally(() => {\n            setNextStep(false)\n          })\n      }\n    }\n\n    let onClickEVent: any = null\n\n    const clickListener = () => {\n      const res = document.getElementsByClassName('results')\n      for (let k = 0; k < res.length; k++) {\n        // @ts-ignore\n        res[k].style.display = 'none'\n      }\n      document.removeEventListener('click', clickListener)\n      onClickEVent = null\n    }\n\n    const eventClick = (e: any) => {\n      clickListener()\n      setFormError('')\n      if (sheet === '' && !isFilteringSheets) {\n        const element = ReactDOM.findDOMNode(searchRef.current) as Element\n        const res = element?.getElementsByClassName('results')\n        for (let k = 0; k < res.length; k++) {\n          // @ts-ignore\n          res[k].style.display = 'block'\n        }\n        setResults(sheets)\n        if (!onClickEVent) {\n          onClickEVent = document.addEventListener('click', clickListener)\n        }\n      }\n    }\n    const eventClickSearch2 = (e: any) => {\n      clickListener()\n      setFormError('')\n      if (worksheet === '' && !isFilteringWorksheets) {\n        const element = ReactDOM.findDOMNode(search2Ref.current) as Element\n        const res = element?.getElementsByClassName('results')\n        for (let k = 0; k < res.length; k++) {\n          // @ts-ignore\n          res[k].style.display = 'block'\n        }\n        setWorkResults(worksheets)\n\n        if (!onClickEVent) {\n          onClickEVent = document.addEventListener('click', clickListener)\n        }\n      }\n    }\n\n    useEffect(() => {\n      if (platformId > 0 && type !== '') {\n        if (type === 'google') {\n          FbAppStoreService.getSheets(platformId)\n            .then((res: any) => {\n              setSheetTemplateUrl(res.sheetTemplateUrl)\n              setDocumentationTemplateUrl(res.documentationTemplateUrl)\n              const shits = []\n              for (let k = 0; k < res.sheets.length; k++) {\n                const c = { ...res.sheets[k] }\n                c.key = c.sheetId\n                shits.push(c)\n              }\n              setSheets(shits)\n            })\n            .finally(() => {\n              setIsFilteringSheets(false)\n            })\n        } else {\n          FbAppStoreService.segmentTypes(platformId)\n            .then((res: any) => {\n              setSheets(res.segmentTypes)\n            })\n            .finally(() => {\n              setIsFilteringSheets(false)\n            })\n        }\n      }\n    }, [platformId, type])\n\n    useEffect(() => {\n      if (FbAppStoreStepper.newType === props.steps) {\n        setType('newType')\n      } else {\n        setType('google')\n      }\n    }, [])\n\n    return (\n      <>\n        {type === 'google' && (\n          <Segment>\n            <Header as={'h4'}>STEP 1</Header>\n            <p>\n              In order to enable our mapping configuration, please use our\n              google sheet template and place it in your Google Drive.\n            </p>\n            <p>Download our template and follow the instructions.</p>\n            <div style={{ display: 'flex' }}>\n              <Button\n                icon\n                labelPosition='left'\n                onClick={() => {\n                  window.open(sheetTemplateUrl, '_blank')\n                }}\n              >\n                <Icon name='download' /> Download the template\n              </Button>\n              <Button\n                icon\n                labelPosition='left'\n                onClick={() => {\n                  window.open(documentationTemplateUrl, '_blank')\n                }}\n              >\n                <Icon name='download' /> How to configure the document\n              </Button>\n            </div>\n          </Segment>\n        )}\n        <Segment>\n          <Header as={'h4'}>STEP {type === 'google' ? 2 : 1}</Header>\n          <p>\n            Select the {type === 'google' ? 'document' : 'segment'} where you\n            have the data to sync.\n          </p>\n\n          <SearchStyled id={'document-search'}>\n            <Search\n              style={{ flex: 1, marginRight: '15px' }}\n              fluid\n              loading={isFilteringSheets}\n              onResultSelect={handleResultSelect}\n              onSearchChange={debounce(handleSearchChange, 500, {\n                leading: true,\n              })}\n              onClick={(e: any) => {\n                eventClick(e)\n              }}\n              results={results}\n              placeholder={\n                type === 'google' ? 'Select Sheet' : 'Select Segment Type'\n              }\n              value={sheet}\n              ref={searchRef}\n            />\n            <Button\n              disabled={refreshingList}\n              onClick={refreshTheList}\n              icon={'sync'}\n              title={'Refresh the list'}\n              className={refreshingList ? 'loading' : ''}\n            />\n          </SearchStyled>\n\n          <SearchStyled id={'worksheet-search'}>\n            <Search\n              disabled={sheet === ''}\n              style={{ marginTop: '13px' }}\n              fluid\n              placeholder={\n                isFilteringSheets\n                  ? 'Loading'\n                  : type === 'google'\n                  ? 'Select Worksheet'\n                  : 'Select Segment'\n              }\n              loading={isFilteringWorksheets}\n              onResultSelect={handleResultSelectWork}\n              onClick={(e: any) => {\n                eventClickSearch2(e)\n              }}\n              onSearchChange={debounce(handleSearchChangeWork, 500, {\n                leading: true,\n              })}\n              results={workResults}\n              value={worksheet}\n              ref={search2Ref}\n            />\n          </SearchStyled>\n        </Segment>\n\n        <Segment>\n          <Header as={'h4'}>STEP {type === 'google' ? 3 : 2}</Header>\n          <Form error={formError !== ''}>\n            <Message error>{formError}</Message>\n            <div\n              style={{\n                display: 'flex',\n                alignItems: 'center',\n                justifyContent: 'space-between',\n              }}\n            >\n              <p style={{ margin: 0 }}>\n                All done. Click on the 'Next' button to start mapping.\n              </p>\n\n              <Button\n                color={'blue'}\n                disabled={nextStep}\n                className={nextStep ? 'loading disabled' : ''}\n                onClick={() => next()}\n              >\n                Next\n              </Button>\n            </div>\n          </Form>\n        </Segment>\n      </>\n    )\n  }\n)\n\nSpreadSheetSelection.displayName = 'SpreadSheetSelection'\n\nexport default SpreadSheetSelection\n","import React, { Dispatch, useEffect, useState } from 'react'\nimport {\n  Button,\n  Card,\n  Dimmer,\n  Header,\n  Icon,\n  Loader,\n  Segment,\n} from 'semantic-ui-react'\nimport FbAppStoreService from '../../../services/FbAppStoreService'\nimport { sendToast } from '../../../store/actions/ApplicationConfigurationActions'\nimport { useDispatch } from 'react-redux'\nimport Confetti from '../../../components/Confetti'\nimport styled from 'styled-components'\n\nconst IconSync = styled(Icon)`\n  font-size: 15px;\n  position: absolute;\n  bottom: 0;\n  right: -8px;\n  background: white;\n  border-radius: 100%;\n  //border: 2px solid #1877F2;\n  padding: 3px;\n`\nconst IconStepStyled = styled.div`\n  box-shadow: 0 1px 1px 0 rgb(66 66 66 / 8%), 0 1px 3px 1px rgb(66 66 66 / 16%);\n  position: relative;\n  display: flex;\n  margin: 5px auto 1em auto;\n  padding: 10px;\n  border-radius: 10px;\n  i {\n    margin-bottom: 0 !important;\n  }\n  .sync {\n    font-size: 25px !important;\n    bottom: 5px;\n    right: 5px;\n    color: #1877f2;\n    padding: 5px;\n  }\n`\nconst CardGroupStyled = styled(Segment)`\n  max-width: 640px;\n  margin: 2em auto !important;\n  background-color: #f3f4f5 !important;\n`\nconst SyncData: React.FC = () => {\n  const dispatch: Dispatch<any> = useDispatch()\n  const [contactsLink, setContactsLink] = useState<string>('')\n  const [eventsLink, setEventsLink] = useState<string>('')\n  const [link, setLink] = useState<string>('')\n  const [isLoading, setIsLoading] = useState<boolean>(true)\n\n  useEffect(() => {\n    FbAppStoreService.getSyncDataLinks()\n      .then((res) => {\n        setContactsLink(res.contactsLink)\n        setEventsLink(res.eventsLink)\n        setLink(res.leadsbridgeLink)\n      })\n      .catch((e) => {\n        const error = e.response?.data?.errorMessage\n          ? 'An internal error occurred, please try again later.'\n          : 'Unknown Error'\n        dispatch(\n          sendToast({\n            title: 'An error occurred',\n            messages: [error],\n            color: 'negative',\n          })\n        )\n      })\n      .finally(() => {\n        setIsLoading(false)\n      })\n  }, [])\n\n  return (\n    <div style={{ textAlign: 'center' }}>\n      {isLoading ? <></> : <Confetti />}\n      <Header as='h3' icon>\n        <IconStepStyled className={'fitContent'}>\n          <Icon name='envelope' style={{ color: '#EDBA71' }} />\n          <IconSync name='sync' loading />\n        </IconStepStyled>\n        We started syncing your data - You can proceed with the navigation.\n        <Header.Subheader style={{ marginTop: '10px' }}>\n          We will send you an email once the sync is completed.\n        </Header.Subheader>\n      </Header>\n      <Dimmer\n        inverted\n        active={isLoading}\n        style={{\n          marginTop: '' + '' + '50px',\n        }}\n      >\n        <Loader>Loading</Loader>\n      </Dimmer>\n\n      <p className={'text-secondary'}>\n        Please note that the process will take some time, based on the amount of\n        your data.\n      </p>\n      <CardGroupStyled>\n        <h5>\n          You can now return to Facebook - explore your data, as soon as the\n          sync is done.\n        </h5>\n        <div className={'my-1'}>\n          <a href={link} target='_blank' rel='noreferrer'>\n            Explore the LeadsBridge platform{' '}\n            <Icon style={{ marginLeft: 5 }} name={'external'} />\n          </a>\n        </div>\n      </CardGroupStyled>\n    </div>\n  )\n}\n\nexport default SyncData\n","import { Dispatch } from '@reduxjs/toolkit'\nimport React from 'react'\nimport { useDispatch } from 'react-redux'\nimport { toggleVerticalSidebar } from '../../../store/actions/ApplicationConfigurationActions'\nimport { Menu } from 'semantic-ui-react'\nimport styled from 'styled-components'\n\nconst MenuStyled = styled(Menu)`\n  justify-content: space-between;\n  .steps {\n    flex: 1;\n    margin-top: 0;\n    border: 0;\n    .step {\n      padding: 5px;\n    }\n  }\n  .item {\n    padding: 10px;\n    flex: 1 !important;\n  }\n`\n\nconst FbTopBar: React.FC = ({ children }) => {\n  const dispatch: Dispatch<any> = useDispatch()\n\n  return (\n    <MenuStyled pointing secondary>\n      <Menu.Item onClick={() => dispatch(toggleVerticalSidebar())}>\n        <img\n          src={\n            'https://leadsbridge.com/app/assets/img/logos/logo-ws4.svg?v=2.12.19'\n          }\n          style={{ width: '125px' }}\n          alt={'LeadsBridge'}\n        />\n      </Menu.Item>\n\n      {children}\n\n      {/*\n            <Menu.Menu position='right' style={{verticalAlign: 'right'}}>\n                <Menu.Item\n                    style={{height: '100%'}}\n                    onClick={() => {\n                        window.location.href = window.location.origin + \"/logout\";\n                        //history.push(\"/logout\");\n                    }}\n                    name='logout'\n                />\n            </Menu.Menu>\n            */}\n    </MenuStyled>\n  )\n}\n\nexport default FbTopBar\n","import { FbAppStoreStep } from 'LeadsBridgeApp'\nimport { Image, Step } from 'semantic-ui-react'\nimport React from 'react'\nimport { useSelector } from 'react-redux'\nimport { RootState } from '../../../index'\n\ninterface FbStepGroupProsp {\n  isLoading: boolean\n  status: any\n  steps: any\n}\nconst FbStepGroup: React.FC<FbStepGroupProsp> = ({\n  isLoading,\n  steps,\n  status,\n}) => {\n  const platformId: number = useSelector(\n    (state: RootState) => state.appStore.platformId\n  )\n  return (\n    <>\n      {!isLoading && (\n        <Step.Group size='mini' fluid>\n          {steps.length > 0 &&\n            steps.map((step: FbAppStoreStep) => {\n              const included = step.values.includes(status)\n              const exists = steps.find((s: FbAppStoreStep) =>\n                step.values.includes(status)\n              )\n              return (\n                <Step\n                  active={included}\n                  key={'stepper-' + step.index}\n                  disabled={exists ? step.index < exists.index : true}\n                >\n                  <Step.Content>\n                    <Step.Title>\n                      {step.index === 0 ? (\n                        <Image\n                          src={`https://leadsbridge.com/wp-content/themes/leadsbridge/img/integration-lg-logos/logo${platformId}.png`}\n                          style={{ borderRadius: 0 }}\n                          avatar\n                        />\n                      ) : (\n                        <></>\n                      )}\n                      {step.index === steps.length - 1 ? (\n                        <Image\n                          src={`https://leadsbridge.com/wp-content/themes/leadsbridge/img/integration-lg-logos/logo371.png`}\n                          style={{ borderRadius: 0 }}\n                          avatar\n                        />\n                      ) : (\n                        <></>\n                      )}\n                      {step.name}\n                    </Step.Title>\n                  </Step.Content>\n                </Step>\n              )\n            })}\n        </Step.Group>\n      )}\n    </>\n  )\n}\n\nexport default FbStepGroup\n","import React, { Dispatch, useEffect, useState } from 'react'\nimport * as QueryString from 'querystring'\nimport { AppStoreStatus } from '../../enums/AppStoreStatus'\nimport PlatformAuthentication from './components/PlatformAuthentication'\nimport PlatformConfiguration from './components/PlatformConfiguration'\nimport SpreadSheetSelection from './components/SpreadSheetSelection'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { RootState } from '../../index'\nimport {\n  setPlatformIdAction,\n  setStatusAction,\n} from '../../store/actions/FbAppStoreActions'\nimport { doPostMessage, Messages } from '../../utils/PostMessages'\nimport {\n  Button,\n  Container,\n  Dimmer,\n  Icon,\n  List,\n  Loader,\n  Message,\n  Modal,\n} from 'semantic-ui-react'\nimport { FbAppStoreStepper } from '../../utils/appStore/FbAppStoreStepper'\nimport {\n  FbAppStoreStep,\n  GraphQLResult,\n  FacebookParameters,\n} from 'LeadsBridgeApp'\nimport { onUpdateFbAppStoreStatus } from '../../graphql/subscriptions'\nimport { API, Auth, graphqlOperation } from 'aws-amplify'\nimport { listFbAppStoreStatuss } from '../../graphql/queries'\n\nimport { Observable } from 'zen-observable-ts'\nimport SyncData from './components/SyncData'\nimport LoginV1Service from '../../services/ApplicationV1Bridge'\n\nimport { createFbAppStoreStatus } from '../../graphql/mutations'\nimport { ParsedUrlQuery } from 'querystring'\nimport { LangFbAppStore } from '../../lang/LangFbAppStore'\nimport FbTopBar from './partials/FbTopBar'\nimport FbStepGroup from './partials/FbStepGroup'\n\nconst FbAppStore: React.FC = () => {\n  const dispatch: Dispatch<any> = useDispatch()\n  const [isLoading, setIsLoading] = useState<boolean>(true)\n  const [open, setOpen] = useState<boolean>(false)\n  const [APIresponse, setAPIresponse] = useState<any>({})\n\n  const platformId: number = useSelector(\n    (state: RootState) => state.appStore.platformId\n  )\n\n  const setPlatformId = React.useCallback(\n    (platformId: number) => dispatch(setPlatformIdAction(platformId)),\n    [dispatch]\n  )\n  // test\n  const status: AppStoreStatus = useSelector(\n    (state: RootState) => state.appStore.status\n  )\n  const setStatus = React.useCallback(\n    (status: AppStoreStatus) => dispatch(setStatusAction(status)),\n    [dispatch]\n  )\n  const [steps, setSteps] = useState<FbAppStoreStep[]>([])\n\n  const doFacebookRedirect = (redirectUrl: string) => {\n    LoginV1Service.facebookParameters(\n      'APP_STORE',\n      '',\n      window.location.href\n    ).then((res: FacebookParameters) => {\n      const urlObject = new URL(redirectUrl)\n      let qs: string = urlObject.search.slice(1)\n      const qsObject: ParsedUrlQuery = QueryString.parse(qs)\n      qsObject.extras = JSON.stringify(res.extras)\n      qs = QueryString.encode(qsObject)\n      const url: string =\n        urlObject.href.replace(urlObject.search, '') + '?' + qs\n      window.location.replace(url)\n    })\n  }\n\n  useEffect(() => {\n    // alert(platformId);\n\n    // import { hotjar } from \"react-hotjar\";\n    // TODO hotjar.initialize(2000196, 5);\n\n    let subscribed: boolean = true\n    const params = QueryString.parse(window.location.search.replace('?', ''))\n    const redirectUrl: string = params.redirect_uri as string\n    if (redirectUrl) {\n      doPostMessage(Messages.AppInvoked)\n      doPostMessage(Messages.UserLogged)\n      doFacebookRedirect(redirectUrl)\n    } else {\n      setIsLoading(false)\n    }\n    if (params.crm_id && parseInt(params.crm_id as string) > 0) {\n      setPlatformId(parseInt(params.crm_id as string))\n    }\n    if (params.crm_id && parseInt(params.crm_id as string) === 63) {\n      setSteps(FbAppStoreStepper.googleSheet)\n    } else if (params.crm_id && parseInt(params.crm_id as string) === 85) {\n      setSteps(FbAppStoreStepper.newType)\n    } else {\n      setSteps(FbAppStoreStepper.default)\n    }\n\n    // TODO\n    // me lo passava un response.data.alreadyPublished di backend\n    // 'You already connected this platform with Facebook through LeadsBridge. Click Continue to proceed with an additional integration or Exit to restart with Facebook.',\n\n    // modale popup       {action: 'redirect', url: 'https://business.facebook.com/business/app-store', text: 'Exit'} oppure continua\n\n    return () => {\n      subscribed = false\n    }\n  }, [])\n\n  const retrieveStatusAndSubscribe = async (\n    username: string\n  ): Promise<ZenObservable.Subscription> => {\n    const subClient = (await API.graphql(\n      graphqlOperation(onUpdateFbAppStoreStatus, {\n        owner: username,\n      })\n    )) as Observable<object>\n\n    return subClient.subscribe({\n      next: (data: any) => {\n        if (\n          data.value &&\n          data.value.data &&\n          data.value.data.onUpdateFbAppStoreStatus\n        ) {\n          const item = data.value.data.onUpdateFbAppStoreStatus\n          setStatus(item.status)\n        }\n      },\n      error: (error: any) => console.warn('subscription c1 error: ', error),\n    })\n  }\n\n  // [{userId: user.username}]\n  useEffect(() => {\n    let subscription: ZenObservable.Subscription | undefined\n\n    if (platformId > 0) {\n      Auth.currentAuthenticatedUser()\n        .then(async (user) => {\n          const {\n            data: {\n              listFbAppStoreStatuss: { items, nextToken },\n            },\n          } = (await API.graphql(\n            graphqlOperation(listFbAppStoreStatuss, {\n              owner: user.username,\n              filter: {\n                crmId: { eq: platformId.toString() },\n              },\n            })\n          )) as GraphQLResult\n\n          if (items.length === 0) {\n            await API.graphql(\n              graphqlOperation(createFbAppStoreStatus, {\n                input: {\n                  owner: user.username,\n                  crmId: platformId.toString(),\n                  status: AppStoreStatus.PLATFORMAUTHENTICATION,\n                },\n              })\n            )\n          } else {\n            // I just take the first. (A duplicate should not exists...)\n            let oldStatus = items[0].status\n            if (oldStatus === AppStoreStatus.PUBLISH) {\n              oldStatus = AppStoreStatus.PLATFORMAUTHENTICATION\n            }\n            setStatus(oldStatus)\n          }\n\n          subscription = await retrieveStatusAndSubscribe(user.username) //\n        })\n        .catch((err) => {\n          console.warn('Subscription error', err)\n        })\n    }\n\n    return () => {\n      if (subscription !== undefined) {\n        subscription.unsubscribe()\n      }\n    }\n  }, [platformId])\n\n  // NELLO SWITCH if (message == 'Complete-Oauth2') { inviare post message doPostMessage(Messages.PlatformAuthorized);\n  // oppure       doPostMessage(Messages.PlatformError); in caso di errore\n\n  const getPageComponent = () => {\n    switch (status) {\n      case AppStoreStatus.PLATFORMCONFIGURATION:\n        return <PlatformConfiguration steps={steps} />\n      case AppStoreStatus.SPREADSHEETSELECTION:\n        return <SpreadSheetSelection steps={steps} />\n      case AppStoreStatus.STATUS_SEGMENTATION_SELECTION:\n        return <SpreadSheetSelection steps={steps} />\n      case AppStoreStatus.PUBLISH:\n        return <SyncData />\n      case AppStoreStatus.NONE:\n      case AppStoreStatus.PLATFORMAUTHENTICATION:\n        return (\n          <PlatformAuthentication\n            setOpen={setOpen}\n            setAPIresponse={setAPIresponse}\n          />\n        )\n      default:\n        return (\n          <>\n            <div style={{ minHeight: '100vh' }}>\n              <Dimmer active={!open} inverted>\n                <Loader inverted>Loading</Loader>\n              </Dimmer>\n            </div>\n          </>\n        )\n    }\n  }\n\n  const errorObject: any = LangFbAppStore[APIresponse.errorCode]\n    ? LangFbAppStore[APIresponse.errorCode]\n    : { title: '', description: '', helpers: [] }\n\n  return (\n    <>\n      <FbTopBar>\n        <FbStepGroup isLoading={isLoading} status={status} steps={steps} />\n      </FbTopBar>\n      <Container>\n        <div style={{ maxWidth: '850px', margin: 'auto' }}>\n          <Modal open={open}>\n            <Modal.Header>{errorObject.title}</Modal.Header>\n            <Modal.Content>\n              <Modal.Description>\n                <div\n                  dangerouslySetInnerHTML={{ __html: errorObject.description }}\n                />\n                <br />\n                <Message warning>\n                  <Message.Header>\n                    <Icon name={'warning sign'} />\n                    You can update your settings to:\n                  </Message.Header>\n                  <List>\n                    {errorObject.helpers.map((item: any) => {\n                      return (\n                        <List.Item>\n                          <List.Content>\n                            <List.Header>{item.title}</List.Header>\n                            <List.Description>\n                              {item.description}\n                            </List.Description>\n                          </List.Content>\n                        </List.Item>\n                      )\n                    })}\n                  </List>\n                </Message>\n              </Modal.Description>\n            </Modal.Content>\n            <Modal.Actions>\n              <Button\n                primary\n                as={'a'}\n                href={APIresponse.errorLink}\n                target='_blank'\n              >\n                Go to Configuration Page\n              </Button>\n            </Modal.Actions>\n          </Modal>\n          {getPageComponent()}\n        </div>\n      </Container>\n    </>\n  )\n}\n\nexport default FbAppStore\n","import {\n  FbAppStoreTypes,\n  SET_PLATFORM_ID,\n  SET_STATUS,\n} from '../types/FbAppStoreTypes'\nimport { AppStoreStatus } from '../../enums/AppStoreStatus'\n\nexport const setStatusAction = (status: AppStoreStatus): FbAppStoreTypes => {\n  return {\n    type: SET_STATUS,\n    payload: status,\n  }\n}\n\nexport const setPlatformIdAction = (platformId: number): FbAppStoreTypes => {\n  return {\n    type: SET_PLATFORM_ID,\n    payload: platformId,\n  }\n}\n","import React from 'react'\n\n// 63\n// 491\nconst FbAppStoreTest: React.FC = () => {\n  return (\n    <div className={'mx-auto'}>\n      <iframe\n        src={'http://localhost:3000/fbAppStore?crm_id=491'}\n        height={650}\n        width={1500}\n      />\n    </div>\n  )\n}\n\nexport default FbAppStoreTest\n","import axios from 'axios'\nimport { Auth } from 'aws-amplify'\nimport { CognitoErrorResponse, PersistentBbuData } from 'LeadsBridgeApp'\nimport { getCustomErrorCognitoMessage } from '@app/utils/cognitoErrors'\nimport { useEffect, useRef, useState } from 'react'\nimport { AuthState, CognitoUserInterface } from '@aws-amplify/ui-components'\nimport { useAppDispatch, useAppSelector } from '@app/store/hooks'\nimport { endpoints, getApiErrorMessage } from '@app/api/config'\nimport { PersistentLocalStorageKeys } from '@app/enums/persistentLocalStorageKeys'\nimport { parseAuthUser } from '@app/features/auth/functions/parseAuthUser'\nimport {\n  setAuthStateAction,\n  setCurrentUserAction,\n} from '@app/store/actions/UserActions'\nimport { trackEvent } from '@app/dataTracking'\nimport { BbuPartnersName } from '@app/enums/bridgeByUrl'\n\ninterface HandleOauthUserResponse {\n  username: string\n  password: string\n  userStatus: string\n  Pricing?: {\n    cbPlanId: string\n    mrr: number\n  }\n}\n\ninterface UseGenericBbuAuthParms {\n  provider?: string\n  authCode?: string\n  requestUri?: string\n  bbuData?: PersistentBbuData | null\n}\n\nexport const useGenericBbuAuth = ({\n  provider,\n  authCode,\n  requestUri,\n  bbuData,\n}: UseGenericBbuAuthParms) => {\n  const dispatch = useAppDispatch()\n  const [apiError, setApiError] = useState('')\n  const isMountedRef = useRef(false)\n  const [userStatus, setUserStatus] = useState('')\n\n  const { authState } = useAppSelector((state) => state.user)\n\n  // we want to\n  const isNotSignedIn = authState === AuthState.SignIn\n  const canProceed = authCode && provider && requestUri\n  const canProceedWithNotLoggedInFlow = canProceed && isNotSignedIn\n\n  useEffect(() => {\n    isMountedRef.current = true\n    // in case user is already logged our component will be unmounted and re-mounted\n    // so let's handle this scenario in useEffect cleanup\n    const authCancelRequest = axios.CancelToken.source()\n    if (canProceedWithNotLoggedInFlow) {\n      console.log('STARTING NOT LOGGED IN FLOW')\n      axios\n        .post<HandleOauthUserResponse>(\n          endpoints.handleOauthNotLoggedUser,\n          {\n            provider,\n            authCode,\n            requestUri,\n          },\n          {\n            cancelToken: authCancelRequest.token,\n          }\n        )\n        .then((response) => {\n          const { username, password, userStatus, Pricing } = response.data\n\n          // we need to keep it persistent, because after login, component will be refreshed\n          // and we need this information to handle the show or not of the survey\n          // to consider if would be good to keep this info in cognito user attributes\n          localStorage.setItem(\n            PersistentLocalStorageKeys.bbuPersistentUserStatus,\n            userStatus\n          )\n          Auth.signIn({\n            username,\n            password,\n            validationData: [],\n          })\n            .then((res) => {\n              if (isMountedRef.current) {\n                const cognitoUser = parseAuthUser(res as CognitoUserInterface)\n                dispatch(setAuthStateAction(AuthState.SignedIn))\n                dispatch(setCurrentUserAction(cognitoUser))\n                setUserStatus(userStatus)\n\n                // User has just been registered and this is the first login\n                // we run the SignUp trackEvent here (and not at the previus response level) so we can also attach userId received after the login\n                // we also add some delay because we want to be sure user is added in redux store  and will be readed inside the trackEvent function\n                console.log('track!')\n                setTimeout(() => {\n                  trackEvent({\n                    eventName: 'SignUp',\n                    feature: 'Authentication',\n                    step: 'Signup',\n                    params: {\n                      custom: {\n                        planId: Pricing?.cbPlanId,\n                        mrr: (Pricing?.mrr || 0) / 100,\n                        channel:\n                          provider &&\n                          BbuPartnersName[\n                            provider as keyof typeof BbuPartnersName\n                          ], // eg: \"tt\" for tiktok\n                        sourceId: bbuData?.source?.id,\n                        sourceName: bbuData?.source.name,\n                        destinationId: bbuData?.destination?.id,\n                        destinationName: bbuData?.destination?.name,\n                      },\n                    },\n                    sendEventToIntercom: true,\n                  })\n                }, 500)\n              }\n            })\n            .catch((cognitoError: CognitoErrorResponse) => {\n              if (isMountedRef.current) {\n                setApiError(getCustomErrorCognitoMessage(cognitoError))\n              }\n            })\n        })\n        .catch((error) => {\n          setApiError(\n            getApiErrorMessage({\n              error,\n              fallbackMessage: 'We could not authenticate you',\n            })\n          )\n        })\n    }\n\n    return () => {\n      isMountedRef.current = false\n      authCancelRequest.cancel('Aborted since user is already logged')\n    }\n  }, [canProceedWithNotLoggedInFlow])\n\n  useEffect(() => {\n    if (apiError) {\n      trackEvent({\n        eventName: 'UnexpectedErrorThrown',\n        feature: 'Authentication',\n        step: 'Signup',\n        params: {\n          custom: {\n            errorDescription: apiError,\n          },\n        },\n        sendEventToIntercom: true,\n      })\n    }\n  }, [apiError])\n\n  return {\n    userStatus,\n    apiError,\n  }\n}\n","import React, { useEffect, useState } from 'react'\nimport QueryString from 'querystring'\nimport LoginV1Service from '../services/ApplicationV1Bridge'\nimport { FacebookParameters } from 'LeadsBridgeApp'\nimport { Button, Dimmer, Loader, Message } from 'semantic-ui-react'\nimport createPersistedState from 'use-persisted-state'\nimport { useSelector } from 'react-redux'\nimport { RootState } from '../index'\nimport { AuthState } from '@aws-amplify/ui-components'\n\nconst Fbe: React.FC = () => {\n  const [callInProgress, setCallInProgress] = useState<boolean>(true)\n  const [errorMessage, setErrorMessage] = useState<string>('')\n  const useRequestUriState = createPersistedState('requestUri')\n  const [persistentUri, setPersistentUri] = useRequestUriState('')\n  const usePersisteIsFlowForNbee = createPersistedState('isFlowForNbee')\n  const [persistentIsFlowForNbee, setPersistentIsFlowForNbee] =\n    usePersisteIsFlowForNbee(false)\n  const authState = useSelector((state: RootState) => state.user.authState)\n\n  useEffect(() => {\n    const urlObj = new URL(String(window.location.href))\n    const requestUri = urlObj.pathname\n    setPersistentUri(requestUri)\n\n    const url = process.env.REACT_APP_FACEBOOK_OAUTH\n    const params = QueryString.parse(window.location.search.slice(1))\n    const flowType: string = params.flowType as string\n    const instanceId: string = params.instanceId as string\n\n    // we need to persist this value, in order to read it in the fbe/callback (after redirect)\n      // Test Deploy\n    const nbee = params.nbee as string | undefined\n    setPersistentIsFlowForNbee(nbee === 'true')\n\n    const hasRequiredParams = flowType || requestUri\n    if (hasRequiredParams && authState === AuthState.SignedIn) {\n      LoginV1Service.facebookParameters(flowType, instanceId, requestUri)\n        .then((res: FacebookParameters) => {\n          const encodedExtras: string = encodeURIComponent(\n            JSON.stringify(res.extras)\n          )\n          const backendUrl: string = encodeURIComponent(\n            window.location.origin + '/fbe/callback'\n          )\n\n          let parameters = `&client_id=` + res.fbAppId\n          parameters += `&display=page`\n          parameters += `&redirect_uri=${backendUrl}`\n          parameters += `&response_type=code`\n          parameters += `&scope=` + res.scopes\n\n          const fb: string = `${url}?extras=${encodedExtras}` + parameters\n\n          window.location.replace(fb)\n        })\n        .catch((error) => {\n          // Found here https://stackoverflow.com/questions/2631001/test-for-existence-of-nested-javascript-object-key\n          const errorMessage = error.response?.data?.errorMessage\n            ? error.response.data.errorMessage\n            : '-'\n          setErrorMessage(errorMessage)\n        })\n        .finally(() => {\n          setCallInProgress(false)\n        })\n    } else if (hasRequiredParams && authState !== AuthState.SignedIn) {\n      // here we are not ready to do api request, since user is still logging in\n      // once `authState` will be updated they will be able to proceed as intended\n    } else if (!hasRequiredParams) {\n      setCallInProgress(false)\n      setErrorMessage('Invalid Flow Type or requestUri')\n    }\n  }, [authState])\n\n  return (\n    <>\n      <Dimmer active={callInProgress} inverted>\n        <Loader inverted>Loading</Loader>\n      </Dimmer>\n      {errorMessage !== '' && (\n        <Message negative>\n          <Message.Header>An error occurred!</Message.Header>\n          <p>{errorMessage}</p>\n          {/*\n           we can't rely on react router <Link />, since url/path is exaclty the same\n           and click action will be ignored, so let's just refresh the page\n           */}\n          {persistentUri && (\n            <Button primary onClick={() => window.location.reload()}>\n              Retry\n            </Button>\n          )}\n        </Message>\n      )}\n    </>\n  )\n}\n\nexport default Fbe\n","import React, { useEffect, useState } from 'react'\nimport LoginV1Service from '../services/ApplicationV1Bridge'\nimport { Button, Dimmer, Loader, Message } from 'semantic-ui-react'\nimport QueryString from 'querystring'\nimport createPersistedState from 'use-persisted-state'\nimport { LangFbAppStore } from '@app/lang/LangFbAppStore'\n\nconst FbeCallback: React.FC = () => {\n  const [callInProgress, setCallInProgress] = useState<boolean>(true)\n  const [errorMessage, setErrorMessage] = useState<string>('')\n  const [errorStyle, setErrorStyle] = useState<string>('')\n  const useRequestUriState = createPersistedState('requestUri')\n  const usePersisteIsFlowForNbee = createPersistedState('isFlowForNbee')\n  const [requestUri] = useRequestUriState('')\n\n  // this allow us to understand if `setupInstance` needs to return a v1 or v2 url\n  const [persistentIsFlowForNbee] = usePersisteIsFlowForNbee()\n\n  useEffect(() => {\n    const params = QueryString.parse(window.location.search.slice(1))\n    const error: string = params.lb_error as string\n    if (error) {\n      const errorCode: string = params.lb_error_code as string\n      const errorDescription: string = params.lb_error_description as string\n      LoginV1Service.fbeCancel({\n        error: error,\n        errorCode: errorCode,\n        errorDescription: errorDescription,\n      })\n        .catch((error) => {\n          console.log(error)\n        })\n        .finally(() => {\n          setCallInProgress(false)\n          window.location.replace(process.env.REACT_APP_V1_URL + '')\n        })\n    } else {\n      LoginV1Service.setupInstance({ nbee: !!persistentIsFlowForNbee })\n        .then((callback: { callbackPath: string }) => {\n          localStorage.removeItem('isFlowForNbee')\n          localStorage.removeItem('requestUri')\n          window.location.replace(callback.callbackPath)\n        })\n        .catch((error) => {\n          // Found here https://stackoverflow.com/questions/2631001/test-for-existence-of-nested-javascript-object-key\n          const errorMessage = error.response?.data?.errorMessage\n            ? error.response.data.errorMessage\n            : '-'\n          if (errorMessage.includes('systemUser.RetrieveAccessTokenError')) {\n            setErrorMessage(LangFbAppStore.messages.tokenError)\n          } else {\n            setErrorMessage(errorMessage)\n            setErrorStyle('negative')\n          }\n        })\n        .finally(() => {\n          setCallInProgress(false)\n        })\n    }\n  }, [])\n\n  return (\n    <>\n      <Dimmer active={callInProgress} inverted>\n        <Loader inverted>Loading</Loader>\n      </Dimmer>\n      {errorMessage !== '' && (\n        <Message className={errorStyle}>\n          {errorStyle === 'negative' && (\n            <Message.Header>An error occurred!</Message.Header>\n          )}\n          <p>{errorMessage}</p>\n          {requestUri && (\n            <Button\n              onClick={() => {\n                // `requestUri` comes from localStorage (stored as persistent state during previus step)\n                location.href = requestUri\n              }}\n            >\n              Retry\n            </Button>\n          )}\n        </Message>\n      )}\n    </>\n  )\n}\n\nexport default FbeCallback\n","import React, { useEffect } from 'react'\nimport { IncomingDataInitialStep } from '@features/nbee/IncomingDataContent/IncomingDataInitialStep'\nimport { useHistory, useParams } from 'react-router-dom'\nimport { appRoutes } from '@app/routes'\nimport { IntegrationCredentialEditParams } from 'LeadsBridgeApp'\nimport { useGetIntegrationListener } from '@app/api/getIntegrationListener'\nimport { Loader } from '@app/components/Basic/Loader'\nimport {\n  setIntegrationListenerAction,\n  setIntegrationListenerStatus,\n} from '@app/store/actions/IntegrationListenerActions'\nimport { useAppDispatch } from '@app/store/hooks'\nimport { parseApiError } from '@app/api/utils/error'\nimport { sendAlertMessage } from '@app/store/actions/ApplicationConfigurationActions'\nimport { useUpdateIntegrationListener } from '@app/api/updateIntegrationListener'\nimport { useGetAppById } from '@app/api/getAppById'\nimport { getListenerAppName } from '@features/nbee/IncomingDataContent/utils'\nimport { useRetrieveAppCredentials } from '@app/api/postRetrieveAppCredentials'\nimport {\n  makeIntegrationFormInitialValues,\n  transformIntegrationFormValuesToApiSaveRequestBody,\n} from '@features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm/utils'\nimport { IntegrationFormValues } from 'Nbee'\nimport { ApiIntegration } from 'BackendApi'\nimport { useUpdateIntegration } from '@app/api/updateIntegration'\nimport { FormikHelpers } from 'formik'\nimport { SubmitAction } from '@features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm'\nimport { useGetIntegrationById } from '@app/api/getIntegrationById'\n\nexport const IncomingDataScreen: React.FC = () => {\n  const dispatch = useAppDispatch()\n\n  const { appId, integrationId } = useParams<IntegrationCredentialEditParams>()\n  const appIdNumber = parseInt(appId, 10)\n\n  const history = useHistory()\n\n  const {\n    data: appAuthSchemaResponse,\n    mutate: retrieveAuthSchema,\n    isLoading: isLoadingAppAuthSchema,\n    error: errorApiAppAuthSchema,\n  } = useRetrieveAppCredentials()\n\n  // retrieving auth schema on mount\n  useEffect(() => {\n    retrieveAuthSchema({\n      appId: appIdNumber,\n      settings: [],\n    })\n  }, [appIdNumber])\n\n  const {\n    data: existingIntegration,\n    isLoading: isLoadingExistingIntegration,\n    error: errorApiGetIntegration,\n  } = useGetIntegrationById(integrationId)\n\n  const {\n    data: integrationListenerData,\n    isLoading: isGettingIntegrationListener,\n    error: errorGettingIntegrationListener,\n  } = useGetIntegrationListener(integrationId)\n\n  const {\n    data: updatedIntegrationData,\n    mutate: updateIntegrationListener,\n    isLoading: isUpdatingIntegrationListener,\n    error: errorUpdatingIntegrationListener,\n  } = useUpdateIntegrationListener()\n\n  const {\n    mutate: updateIntegration,\n    isLoading: isUpdatingIntegration,\n    error: integrationUpdateApiError,\n    data: updatedIntegrationCredentials,\n  } = useUpdateIntegration()\n\n  const {\n    data: appData,\n    isLoading: isLoadingApp,\n    error: errorApiGetApp,\n  } = useGetAppById(appId)\n\n  const isLoading =\n    isGettingIntegrationListener ||\n    isUpdatingIntegrationListener ||\n    isUpdatingIntegration ||\n    isLoadingAppAuthSchema ||\n    isLoadingExistingIntegration ||\n    isLoadingApp\n\n  const isError =\n    errorGettingIntegrationListener ||\n    errorUpdatingIntegrationListener ||\n    errorApiGetApp ||\n    integrationUpdateApiError ||\n    errorApiAppAuthSchema\n\n  // data just saved\n  const optimisticIntegrationData =\n    (updatedIntegrationData as unknown as ApiIntegration) ||\n    updatedIntegrationCredentials\n\n  // we build the full auth schema by merging existing data into the full app auth schema\n  const appAuthSchema = appAuthSchemaResponse?.data?.credentials.fields || []\n  const initialValues = appData\n    ? makeIntegrationFormInitialValues(\n        appAuthSchema,\n        appData.name,\n        optimisticIntegrationData || existingIntegration\n      )\n    : null\n\n  const handleContinue = (\n    formValues?: IntegrationFormValues,\n    formikHelpers?: FormikHelpers<IntegrationFormValues>,\n    action?: SubmitAction\n  ) => {\n    formikHelpers?.setSubmitting(true)\n\n    // If we already have fields, we can move to the table step\n    if (\n      integrationListenerData?.fields &&\n      integrationListenerData.fields.length > 0\n    ) {\n      history.push(\n        appRoutes.incomingDataScreenFields.makeUrl({\n          appId,\n          integrationId,\n        })\n      )\n    } else if (\n      initialValues &&\n      formValues &&\n      (formValues?.credentials.length || 0) > 0 &&\n      action === 'update'\n    ) {\n      // otherwise, if we also have credentials, we first update the integration credentials\n      updateIntegration(\n        {\n          integrationId: integrationId,\n          requestBody: transformIntegrationFormValuesToApiSaveRequestBody(\n            formValues,\n            appIdNumber\n          ),\n        },\n        {\n          onSuccess: () => {\n            // now we can update the integration listener status\n            updateIntegrationListener(\n              {\n                requestBody: {\n                  status: 1,\n                },\n                integrationId: `${integrationId}`,\n              },\n              {\n                onSuccess: () => {\n                  // finally, we move to the next step\n                  dispatch(setIntegrationListenerStatus(1))\n                  history.push(\n                    appRoutes.incomingDataScreenFields.makeUrl({\n                      appId,\n                      integrationId,\n                    })\n                  )\n                },\n              }\n            )\n          },\n        }\n      )\n    } else {\n      // if we don't have credentials, we just update the listener\n      updateIntegrationListener(\n        {\n          requestBody: {\n            status: 1,\n          },\n          integrationId: `${integrationId}`,\n        },\n        {\n          onSuccess: () => {\n            // finally, we move to the next step\n            dispatch(setIntegrationListenerStatus(1))\n            history.push(\n              appRoutes.incomingDataScreenFields.makeUrl({\n                appId,\n                integrationId,\n              })\n            )\n          },\n        }\n      )\n    }\n  }\n\n  // dispatch integration listener data to redux store\n  useEffect(() => {\n    if (integrationListenerData) {\n      dispatch(setIntegrationListenerAction({ data: integrationListenerData }))\n    }\n  }, [integrationListenerData, dispatch])\n\n  // In case of error when getting the integration listener or credentials, or updating them, we show an error message\n  useEffect(() => {\n    if (isError) {\n      const error = isError\n      const errorMessage = parseApiError(error!)\n\n      dispatch(\n        sendAlertMessage({\n          isDismissable: false,\n          message: errorMessage.message,\n          useTranslation: true,\n        })\n      )\n    }\n  }, [isError])\n\n  return (\n    <>\n      {isLoading ||\n      errorGettingIntegrationListener ||\n      isLoadingAppAuthSchema ? (\n        <Loader $active={isLoading} $dimmer />\n      ) : null}\n      {appData &&\n      initialValues &&\n      integrationListenerData &&\n      existingIntegration &&\n      appAuthSchemaResponse ? (\n        <>\n          <IncomingDataInitialStep\n            initialValues={initialValues}\n            appLogoUri={\n              appData?.logoUriSmall ||\n              'https://leadsbridge.com/wp-content/themes/leadsbridge/img/integration-lg-logos/logo168.png'\n            }\n            appId={Number(appId)}\n            appName={getListenerAppName(appData)}\n            onContinueRequest={handleContinue}\n            isLoading={isLoading}\n          />\n        </>\n      ) : null}\n    </>\n  )\n}\n","import React, { useEffect, useState } from 'react'\nimport { IncomingDataTableStep } from '@features/nbee/IncomingDataContent/IncomingDataTableStep'\nimport { useHistory, useParams } from 'react-router-dom'\nimport { IncomingDataParams } from 'LeadsBridgeApp'\nimport { useAppDispatch, useAppSelector } from '@app/store/hooks'\nimport { useUpdateIntegrationListener } from '@app/api/updateIntegrationListener'\nimport { ApiIntegrationListenerField } from '@app/@typings/Api/integration'\nimport {\n  setIntegrationListenerFields,\n  setIntegrationListenerStatus,\n} from '@app/store/actions/IntegrationListenerActions'\nimport { appRoutes } from '@app/routes'\nimport { usePusherChannel } from '@app/hooks/usePusherChannel'\nimport { Loader } from '@app/components/Basic/Loader'\nimport { parseApiError } from '@app/api/utils/error'\nimport { sendAlertMessage } from '@app/store/actions/ApplicationConfigurationActions'\nimport { useGetIntegrationUsage } from '@app/api/getIntegrationUsage'\nimport { useGetAppById } from '@app/api/getAppById'\nimport { getListenerAppName } from '@features/nbee/IncomingDataContent/utils'\nimport { useGetIntegrationFields } from '@app/api/getIntegrationListenerFields'\n\nexport const IncomingDataScreenFields: React.FC = () => {\n  const { appId, integrationId } = useParams<IncomingDataParams>()\n  const dispatch = useAppDispatch()\n  const history = useHistory()\n\n  // when isRecognizingFields is true, the loader is shown and the channel is subscribed\n  const [isRecognizingFields, setIsRecognizingFields] = useState<boolean>(true)\n\n  const [isConfirmingReload, setIsConfirmingReload] = useState(0)\n\n  const integrationListener = useAppSelector(\n    (state) => state.integrationListener\n  )\n\n  const { data: integrationUsage, isLoading: isGettingIntegrationUsage } =\n    useGetIntegrationUsage(integrationId)\n\n  const {\n    data: integrationFields,\n    isLoading: isLoadingIntegrationFields,\n    refetch: refetchIntegrationFields,\n  } = useGetIntegrationFields(integrationId)\n\n  const {\n    data: appData,\n    isLoading: isLoadingApp,\n    error: errorApiGetApp,\n  } = useGetAppById(appId)\n\n  const activeBridges = integrationUsage?.data.activeBridges ?? 0\n  const totalBridges = integrationUsage?.data.totalBridges ?? 0\n\n  const fields = integrationListener.data\n    ?.fields as ApiIntegrationListenerField[]\n\n  useEffect(() => {\n    if (integrationFields) {\n      dispatch(setIntegrationListenerFields(integrationFields))\n    }\n  }, [integrationFields])\n\n  const {\n    mutate: updateIntegrationListener,\n    isLoading: isUpdatingIntegrationListener,\n    error: errorUpdatingIntegrationListener,\n  } = useUpdateIntegrationListener()\n\n  useEffect(() => {\n    if (history.action === 'POP') {\n      history.push(\n        appRoutes.incomingDataScreen.makeUrl({ appId, integrationId })\n      )\n    }\n  }, [])\n\n  const handleReload = () => {\n    if (isConfirmingReload < 1 && totalBridges && activeBridges) {\n      setIsConfirmingReload((prevState) => prevState + 1)\n    } else {\n      updateIntegrationListener(\n        {\n          requestBody: { status: 1 },\n          integrationId: `${integrationId}`,\n        },\n        {\n          onSuccess: () => {\n            dispatch(setIntegrationListenerStatus(1))\n            setIsConfirmingReload(0)\n            setIsRecognizingFields(true)\n          },\n        }\n      )\n    }\n  }\n\n  const handleContinue = () => {\n    updateIntegrationListener(\n      {\n        requestBody:\n          fields?.length > 0 ? { status: 2, fields: fields } : { status: 3 },\n        integrationId: `${integrationId}`,\n      },\n      {\n        onSuccess: () => {\n          history.push(\n            appRoutes.incomingDataScreenSave.makeUrl({ appId, integrationId })\n          )\n        },\n      }\n    )\n  }\n\n  // Subscribe to the channel only when the integrationListener is new and when the status is loading\n  usePusherChannel(\n    integrationListener.data?.channel || 'test-channel',\n    'webhookdata.parsed',\n    integrationListener.data?.status === 1 && isRecognizingFields,\n    () =>\n      updateIntegrationListener(\n        {\n          integrationId: `${integrationId}`,\n          requestBody: fields?.length > 0 ? { status: 2 } : { status: 3 },\n        },\n        {\n          onSuccess: () => {\n            dispatch(setIntegrationListenerStatus(fields?.length > 0 ? 2 : 3))\n          },\n        }\n      ),\n    () => {\n      refetchIntegrationFields()\n    }\n  )\n\n  // When the fields are recognized, the loader is hidden\n  useEffect(() => {\n    if (Array.isArray(fields) && fields.length > 0) {\n      setIsRecognizingFields(false)\n    }\n  }, [fields])\n\n  // In case of error when updating the integration listener\n  useEffect(() => {\n    if (errorUpdatingIntegrationListener) {\n      setIsRecognizingFields(false)\n      const error = errorUpdatingIntegrationListener\n      const errorMessage = parseApiError(error!)\n\n      dispatch(\n        sendAlertMessage({\n          isDismissable: true,\n          message: errorMessage.message,\n          useTranslation: true,\n        })\n      )\n    }\n  }, [errorUpdatingIntegrationListener])\n\n  const isLoading =\n    isUpdatingIntegrationListener || isGettingIntegrationUsage || isLoadingApp\n\n  return (\n    <>\n      {isLoading ? <Loader $active $dimmer /> : null}\n      <IncomingDataTableStep\n        appLogoUri={\n          appData?.logoUriSmall ||\n          'https://leadsbridge.com/wp-content/themes/leadsbridge/img/integration-lg-logos/logo168.png'\n        }\n        onReload={handleReload}\n        onContinue={handleContinue}\n        isRecognizingFields={isRecognizingFields}\n        fields={fields || []}\n        isConfirmingReload={isConfirmingReload}\n        activeBridges={activeBridges}\n        totalBridges={totalBridges}\n        resetConfirmingReload={setIsConfirmingReload}\n        appName={getListenerAppName(appData)}\n        listenerType={integrationListener.data?.type || 'url'}\n        appId={appId}\n        integrationId={integrationId ?? ''}\n      />\n    </>\n  )\n}\n","import React, { useEffect, useState } from 'react'\nimport { IncomingDataFinalStep } from '@features/nbee/IncomingDataContent/IncomingDataFinalStep'\nimport { useUpdateIntegration } from '@app/api/updateIntegration'\nimport { useHistory, useParams } from 'react-router-dom'\nimport { IncomingDataParams } from 'LeadsBridgeApp'\nimport { Loader } from '@app/components/Basic/Loader'\nimport { parseApiError } from '@app/api/utils/error'\nimport { useAppDispatch } from '@app/store/hooks'\nimport { sendAlertMessage } from '@app/store/actions/ApplicationConfigurationActions'\nimport { appRoutes } from '@app/routes'\nimport { useGetIntegrationById } from '@app/api/getIntegrationById'\nimport { sendIntegrationDataToParentWindow } from '@app/features/nbee/IntegrationCredentialsContent/utils'\nimport { useGetAppById } from '@app/api/getAppById'\n\nexport const IncomingDataScreenSave: React.FC = () => {\n  const { appId, integrationId } = useParams<IncomingDataParams>()\n  const dispatch = useAppDispatch()\n  const history = useHistory()\n\n  const {\n    data: integrationData,\n    isLoading: isFetchingIntegrationData,\n    error: integrationDataApiError,\n  } = useGetIntegrationById(integrationId)\n\n  const {\n    mutate: updateIntegration,\n    isLoading: isUpdatingIntegration,\n    error: integrationUpdateApiError,\n  } = useUpdateIntegration()\n\n  const {\n    data: appData,\n    isLoading: isLoadingApp,\n    error: errorApiGetApp,\n  } = useGetAppById(appId)\n\n  const [integrationName, setIntegrationName] = useState(\n    (integrationData && integrationData.name) || \"Integration's name\"\n  )\n\n  useEffect(() => {\n    if (integrationData && integrationData.name) {\n      setIntegrationName(integrationData.name)\n    }\n  }, [integrationData])\n\n  const handleSave = () => {\n    updateIntegration(\n      {\n        requestBody: {\n          name: integrationName,\n          appId: parseInt(appId),\n          credentials: [],\n        },\n        integrationId: `${integrationId}`,\n      },\n      {\n        onSuccess: (newIntegration) => {\n          sendIntegrationDataToParentWindow(\n            (newIntegration && Number(newIntegration.id)) || 0,\n            (newIntegration && newIntegration.name) || ''\n          )\n        },\n      }\n    )\n  }\n\n  // TODO: decide if on cancel we just close the window or if we want to redirect the user back to step1 of incoming data screen\n  const handleCancel = () => {\n    // Alt.:\n    // window.close()\n    history.push(\n      appRoutes.incomingDataScreenEdit.makeUrl({ appId, integrationId })\n    )\n  }\n\n  // In case of error when updating the integration\n  useEffect(() => {\n    if (\n      integrationUpdateApiError ||\n      integrationDataApiError ||\n      errorApiGetApp\n    ) {\n      const error =\n        integrationUpdateApiError || integrationDataApiError || errorApiGetApp\n      const errorMessage = parseApiError(error!)\n\n      dispatch(\n        sendAlertMessage({\n          isDismissable: true,\n          message: errorMessage.message,\n          useTranslation: true,\n        })\n      )\n    }\n  }, [integrationUpdateApiError, integrationDataApiError, errorApiGetApp])\n\n  const isLoading =\n    isUpdatingIntegration || isFetchingIntegrationData || isLoadingApp\n  return (\n    <>\n      {isLoading ? <Loader $active $dimmer /> : null}\n      {integrationData ? (\n        <IncomingDataFinalStep\n          appName={appData?.name || ''}\n          integrationName={integrationName}\n          onEditIntegrationName={setIntegrationName}\n          onSave={handleSave}\n          onCancel={handleCancel}\n          isUpdatingIntegration={isUpdatingIntegration}\n        />\n      ) : null}\n    </>\n  )\n}\n","import React, { useEffect } from 'react'\nimport queryString from 'query-string'\nimport { useHistory, useLocation } from 'react-router-dom'\nimport { PersistentSessionStorageKeys } from '@app/enums/persistentLocalStorageKeys'\nimport { Loader } from '@components/Basic/Loader'\nimport { useGetIntegrationByLegacyId } from '@app/api/getIntegrationByLegacyId'\nimport { Message } from '@components/Basic/Message'\nimport { parseApiError } from '@app/api/utils/error'\nimport { appRoutes } from '@app/routes'\nimport { trackEvent } from '@app/dataTracking'\n\nexport const IntegrationAuthCallback: React.FC = () => {\n  const location = useLocation()\n  const history = useHistory()\n\n  // preparing data required to proceed\n  const legacyIntegrationId = queryString.parse(location.search)\n    .instanceId as string\n  const instanceType = queryString.parse(location.search).instanceType as string\n  const appId = sessionStorage.getItem(\n    PersistentSessionStorageKeys.integrationAuthFlowAppId\n  )\n  const legacyIntegrationError = queryString.parse(location.search).error\n\n  // getting integration id from legacyId params\n  const params =\n    appId && legacyIntegrationId && instanceType\n      ? {\n          appId: appId,\n          instanceId: legacyIntegrationId,\n          instanceType: instanceType,\n        }\n      : undefined\n  const { data: integrationData, error: getIntegrationApiError } =\n    useGetIntegrationByLegacyId(params)\n\n  useEffect(() => {\n    if (integrationData && integrationData.id && appId) {\n      trackEvent({\n        eventName: 'AuthorizeSuccess',\n        feature: 'NBEE',\n        step: 'Integration',\n        params: {\n          appId: parseInt(appId, 10),\n          integrationId: integrationData.id,\n          integrationName: integrationData.name,\n          oauth: true,\n        },\n      })\n\n      // redirect to IntegrationAuthScreen as edit integration and step 2 active (name selection)\n      history.push(\n        appRoutes.integrationAuthScreenEditStep2.makeUrl({\n          integrationId: `${integrationData.id}`,\n          appId: appId,\n        })\n      )\n    }\n  }, [integrationData])\n\n  useEffect(() => {\n    if (!appId || !legacyIntegrationId || getIntegrationApiError) {\n      const errorCode = getIntegrationApiError\n        ? parseApiError(getIntegrationApiError).code\n        : 'UI-Error'\n      const errorDescription = getIntegrationApiError\n        ? parseApiError(getIntegrationApiError).message\n        : 'Missing appId or legacyIntegrationId'\n\n      trackEvent({\n        eventName: 'AuthorizeFailure',\n        feature: 'NBEE',\n        step: 'Integration',\n        params: {\n          appId: appId ? parseInt(appId, 10) : undefined,\n          integrationId: integrationData?.id,\n          integrationName: integrationData?.name,\n          oauth: true,\n          custom: {\n            errorCode,\n            errorDescription,\n          },\n        },\n        sendEventToIntercom: true,\n      })\n    }\n  }, [appId, legacyIntegrationId, getIntegrationApiError])\n\n  if (!appId) {\n    return (\n      <Message $status={'error'}>\n        App ID not found. This probably means you have not started the\n        Authorization flow from a trusted source (eg. NBEE) or session storage\n        is empty.\n      </Message>\n    )\n  }\n\n  if (!legacyIntegrationId) {\n    return (\n      <Message $status={'error'}>\n        {legacyIntegrationError || 'We could not read instanceId from URL.'}\n      </Message>\n    )\n  }\n\n  return getIntegrationApiError ? (\n    <Message $status={'error'}>\n      {parseApiError(getIntegrationApiError).message}\n    </Message>\n  ) : (\n    <div\n      style={{\n        position: 'relative',\n        height: 200,\n      }}\n    >\n      <Loader $active $dimmer $size={'large'} />\n    </div>\n  )\n}\n","import React, { useEffect, useState } from 'react'\nimport queryString from 'query-string'\nimport { useHistory, useLocation } from 'react-router-dom'\nimport { PersistentSessionStorageKeys } from '@app/enums/persistentLocalStorageKeys'\nimport { Loader } from '@components/Basic/Loader'\nimport { Message } from '@components/Basic/Message'\nimport { parseApiError } from '@app/api/utils/error'\nimport { appRoutes } from '@app/routes'\nimport { trackEvent } from '@app/dataTracking'\nimport { useAuthFromGrantCode } from '@app/api/postAuthfromGrantCode'\nimport { retrieveStoredCredentials } from '@features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm/utils'\n\nexport const IntegrationAuthCallback2: React.FC = () => {\n  const location = useLocation()\n  const history = useHistory()\n\n  const {\n    mutate: postAuthGrantCode,\n    isLoading: isLoadingAuthGrantCode,\n    error: authGrantCodeApiError,\n    data: authGrantCodeData,\n  } = useAuthFromGrantCode()\n\n  // Preparing data required to proceed\n  const appId = sessionStorage.getItem(\n    PersistentSessionStorageKeys.integrationAuthFlowAppId\n  )\n  const integrationId = sessionStorage.getItem('instanceId')\n  // get the stored credentials from the session storage\n  const credentials = retrieveStoredCredentials() ?? []\n\n  const paramsFromUrl = new URLSearchParams(window.location.search)\n  const paramsObject = Object.fromEntries(paramsFromUrl)\n\n  const appIdInt = Number(appId)\n  const integrationIdInt = Number(integrationId)\n\n  const payloadArray = Object.keys(paramsObject).map((key) => ({\n    key: key,\n    value: paramsObject[key],\n  }))\n  const credentialsArray = Object.keys(credentials).map((key) => ({\n    key: key,\n    value: credentials[key],\n  }))\n\n  useEffect(() => {\n    postAuthGrantCode(\n      {\n        appId: appIdInt,\n        integrationId: integrationIdInt || undefined,\n        payload: payloadArray.concat(credentialsArray),\n      },\n      {\n        onSuccess: (data) => {\n          const integrationData = data?.data?.integration\n          if (integrationData && integrationData.id && appId) {\n            trackEvent({\n              eventName: 'AuthorizeSuccess',\n              feature: 'NBEE',\n              step: 'Integration',\n              params: {\n                appId: parseInt(appId, 10),\n                integrationId: integrationData.id,\n                integrationName: integrationData.name,\n                oauth: true,\n              },\n            })\n\n            history.push(\n              appRoutes.integrationAuthScreenEditStep2.makeUrl({\n                integrationId: `${integrationData.id}`,\n                appId: appId,\n              })\n            )\n          }\n        },\n      }\n    )\n  }, [])\n\n  useEffect(() => {\n    if (!appId || !integrationId || authGrantCodeApiError) {\n      const errorCode = authGrantCodeApiError\n        ? parseApiError(authGrantCodeApiError).code\n        : 'UI-Error'\n      const errorDescription = authGrantCodeApiError\n        ? parseApiError(authGrantCodeApiError).message\n        : 'Missing appId or legacyIntegrationId'\n\n      trackEvent({\n        eventName: 'AuthorizeFailure',\n        feature: 'NBEE',\n        step: 'Integration',\n        params: {\n          appId: appId ? parseInt(appId, 10) : undefined,\n          integrationId: authGrantCodeData?.data?.integration?.id,\n          integrationName: authGrantCodeData?.data?.integration?.name,\n          oauth: true,\n          custom: {\n            errorCode,\n            errorDescription,\n          },\n        },\n        sendEventToIntercom: true,\n      })\n    }\n  }, [appId, integrationId, authGrantCodeApiError])\n\n  if (!appId) {\n    return (\n      <Message $status={'error'}>\n        App ID not found. This probably means you have not started the\n        Authorization flow from a trusted source (eg. NBEE) or session storage\n        is empty.\n      </Message>\n    )\n  }\n\n  return authGrantCodeApiError ? (\n    <Message $status={'error'}>\n      {parseApiError(authGrantCodeApiError).message}\n    </Message>\n  ) : (\n    <div\n      style={{\n        position: 'relative',\n        height: 200,\n      }}\n    >\n      <Loader $active $dimmer $size={'large'} />\n    </div>\n  )\n}\n","import React, { useEffect, useState } from 'react'\nimport { IntegrationCredentialsContent } from '@features/nbee/IntegrationCredentialsContent'\nimport { useParams } from 'react-router-dom'\nimport { IntegrationCredentialParams } from 'LeadsBridgeApp'\nimport { usePostNewIntegration } from '@app/api/postNewIntegration'\nimport {\n  makeIntegrationFormInitialValues,\n  transformIntegrationFormValuesToApiSaveRequestBody,\n} from '@features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm/utils'\nimport { IntegrationFormValues } from 'Nbee'\nimport { ApiErrorResponse } from 'BackendApi'\nimport { FormikHelpers } from 'formik'\nimport { useAppDispatch } from '@app/store/hooks'\nimport { parseApiError } from '@app/api/utils/error'\nimport { sendToast } from '@app/store/actions/ApplicationConfigurationActions'\nimport { Loader } from '@components/Basic/Loader'\nimport { sendIntegrationDataToParentWindow } from '@features/nbee/IntegrationCredentialsContent/utils'\nimport { Message } from '@components/Basic/Message'\nimport { useGetAppById } from '@app/api/getAppById'\nimport { useRetrieveAppCredentials } from '@app/api/postRetrieveAppCredentials'\nimport { useTestIntegrationCredentialsById } from '@app/api/testIntegrationCredentialsById'\nimport { useTranslation } from 'react-i18next'\nimport { useUpdateIntegration } from '@app/api/updateIntegration'\nimport { trackEvent } from '@app/dataTracking'\n\n// This page is supposed to be always opened inside a popup window with reduced dimensions\n// In future we might add an additional check and prevent the component to render if `window.opener` is not set\n// this means that this component has not been mounted in a page generated from a parent window\nexport const IntegrationAuthScreen: React.FC = () => {\n  const { appId } = useParams<IntegrationCredentialParams>()\n  const { t } = useTranslation()\n  const [newIntegration, setNewIntegration] =\n    useState<{ id: number; name: string }>()\n  const appIdNumber = parseInt(appId, 10)\n  // this will be used to keep the loading spinner while sending data to parent and modal is about to be closed\n  const [isAboutToClosingModal, setIsAboutToClosingModal] = useState(false)\n\n  const dispatch = useAppDispatch()\n\n  const {\n    data: appData,\n    isLoading: isLoadingApp,\n    error: errorApiGetApp,\n  } = useGetAppById(appId)\n\n  const {\n    data: appAuthSchemaResponse,\n    mutate: retrieveAuthSchema,\n    isLoading: isLoadingAppAuthSchema,\n    error: errorApiAppAuthSchema,\n  } = useRetrieveAppCredentials()\n\n  const {\n    mutate: saveNewIntegration,\n    isLoading: isSavingNewIntegration,\n    error: integrationSaveApiError,\n    data: savedIntegration,\n  } = usePostNewIntegration()\n\n  const {\n    mutate: updateIntegration,\n    isLoading: isUpdatingIntegration,\n    error: integrationUpdateApiError,\n    data: updatedIntegrationData,\n  } = useUpdateIntegration()\n\n  // if error we notify the user\n  useEffect(() => {\n    const error = integrationUpdateApiError || integrationSaveApiError\n    if (error) {\n      const errorMessage = parseApiError(error).message\n      dispatch(\n        sendToast({\n          title: 'Error',\n          messages: [errorMessage],\n          color: 'negative',\n        })\n      )\n    }\n  }, [integrationUpdateApiError, integrationSaveApiError])\n\n  // retrieving auth schema on mount\n  useEffect(() => {\n    retrieveAuthSchema({\n      appId: appIdNumber,\n      settings: [],\n    })\n  }, [appIdNumber])\n\n  const {\n    data: testIntegrationResults,\n    error: integrationTestError,\n    isLoading: isCheckingValidIntegration,\n    isRefetching: isReCheckingValidIntegration,\n    refetch: reTestValidIntegration,\n  } = useTestIntegrationCredentialsById(newIntegration?.id)\n\n  // we build the full auth schema by merging existing data into the full app auth schema\n  // we also consider `optimisticIntegrationData` as data just saved, so in case of test error\n  // we fill initial state with the new saved data\n  const optimisticIntegrationData = savedIntegration?.data?.integration\n  const appAuthSchema = appAuthSchemaResponse?.data?.credentials.fields || []\n  const isOauthUri = appAuthSchemaResponse?.data?.credentials.type === 'oauth2'\n  const initialValues = appData\n    ? makeIntegrationFormInitialValues(\n        appAuthSchema,\n        appData.name,\n        optimisticIntegrationData\n      )\n    : null\n\n  // handle success save/updated\n  useEffect(() => {\n    const isSuccessResponse =\n      updatedIntegrationData || savedIntegration?.data?.integration\n    if (isSuccessResponse) {\n      const integrationId = isSuccessResponse.id\n      const integrationName = isSuccessResponse.name\n      if (newIntegration?.id) {\n        // in case `newIntegration` is already set the `useTestIntegrationCredentialsById` hook\n        // will not re-run, so re refetch data manually\n        reTestValidIntegration()\n      }\n      setNewIntegration({ id: integrationId, name: integrationName })\n    }\n  }, [updatedIntegrationData, savedIntegration])\n\n  // on mount events\n  const isReady = Boolean(appData && initialValues && appAuthSchemaResponse)\n  useEffect(() => {\n    if (isReady) {\n      trackEvent({\n        eventName: 'NewIntegrationShown',\n        feature: 'NBEE',\n        step: 'Integration',\n        params: {\n          appId: appData?.id,\n          appName: appData?.name,\n          oauth: isOauthUri,\n        },\n      })\n    }\n  }, [isReady])\n\n  const trackEventError = (\n    apiError: ApiErrorResponse,\n    formValues: IntegrationFormValues\n  ) => {\n    const parsedError = parseApiError(apiError)\n    trackEvent({\n      eventName: 'UnexpectedErrorThrown',\n      feature: 'NBEE',\n      step: 'Apps',\n      params: {\n        appId: parseInt(appId, 10),\n        appName: appData?.name,\n        integrationId: newIntegration?.id,\n        integrationName: formValues.name,\n        custom: {\n          errorCode: parsedError.code,\n          errorDescription: parsedError.message,\n        },\n      },\n      sendEventToIntercom: true,\n    })\n  }\n\n  const saveIntegration = (\n    formValues: IntegrationFormValues,\n    formikHelpers: FormikHelpers<IntegrationFormValues>\n  ) => {\n    formikHelpers.setSubmitting(true)\n\n    // in we already saved the integration and we received an error\n    // next action will be an updated and not a saved new\n    // we know this by checking newIntegration object\n    if (newIntegration?.id) {\n      updateIntegration(\n        {\n          integrationId: `${newIntegration.id}`,\n          requestBody: transformIntegrationFormValuesToApiSaveRequestBody(\n            formValues,\n            appIdNumber\n          ),\n        },\n        {\n          onError: (apiError) => {\n            formikHelpers.setSubmitting(false)\n            trackEventError(apiError, formValues)\n          },\n        }\n      )\n\n      return\n    }\n\n    saveNewIntegration(\n      {\n        requestBody: transformIntegrationFormValuesToApiSaveRequestBody(\n          formValues,\n          appIdNumber\n        ),\n      },\n      {\n        onError: (apiError) => {\n          formikHelpers.setSubmitting(false)\n          trackEventError(apiError, formValues)\n        },\n      }\n    )\n  }\n\n  // Proceeding when test is successful\n  useEffect(() => {\n    if (testIntegrationResults?.data?.result && newIntegration) {\n      setIsAboutToClosingModal(true)\n\n      if (!isOauthUri) {\n        // when test is OK and we are not in oauth flow, before sending the SaveClicked Event, we need to send\n        // the `AuthorizeSuccess` so we can simulate the same events order of the oauth integration\n        trackEvent({\n          eventName: 'AuthorizeSuccess',\n          feature: 'NBEE',\n          step: 'Integration',\n          params: {\n            appId: appData?.id,\n            appName: appData?.name,\n            integrationId: newIntegration.id,\n            integrationName: newIntegration.name,\n            oauth: false,\n          },\n        })\n      }\n\n      trackEvent({\n        eventName: 'SaveClicked',\n        feature: 'NBEE',\n        step: 'Integration',\n        params: {\n          appId: appData?.id,\n          appName: appData?.name,\n          integrationId: newIntegration.id,\n          integrationName: newIntegration.name,\n          oauth: isOauthUri,\n        },\n      })\n\n      sendIntegrationDataToParentWindow(newIntegration.id, newIntegration.name)\n    }\n  }, [testIntegrationResults])\n\n  // In case of test failure\n  useEffect(() => {\n    // in case test fails we send the `AuthorizeFailure` tracking event only if is not an oauth flow\n    // for oauth integrations we send this event during the oauth flow, insice IntegrationAuthCallback component\n    if (integrationTestError && !isOauthUri) {\n      const parsedTestError = parseApiError(integrationTestError)\n      trackEvent({\n        eventName: 'AuthorizeFailure',\n        feature: 'NBEE',\n        step: 'Integration',\n        params: {\n          appId: appData?.id,\n          appName: appData?.name,\n          integrationId: newIntegration?.id,\n          integrationName: newIntegration?.name,\n          oauth: false,\n          custom: {\n            errorCode: parsedTestError.code,\n            errorDescription: parsedTestError.message,\n          },\n        },\n        sendEventToIntercom: true,\n      })\n    }\n  }, [integrationTestError])\n\n  const isLoadingAll =\n    isLoadingApp ||\n    isLoadingAppAuthSchema ||\n    isCheckingValidIntegration ||\n    isReCheckingValidIntegration ||\n    !initialValues ||\n    isAboutToClosingModal\n  const apiError = errorApiAppAuthSchema || errorApiGetApp\n\n  if (!appId) {\n    return <div>Missing Parameter</div>\n  }\n\n  return isLoadingAll ? (\n    <div></div>\n  ) : appData && initialValues ? (\n    <IntegrationCredentialsContent\n      appId={appIdNumber}\n      appName={appData.name}\n      appLogoUri={appData.logoUriSmall}\n      isSavingApi={isUpdatingIntegration || isSavingNewIntegration}\n      onSubmit={saveIntegration}\n      isOauthUri={isOauthUri}\n      initialValues={initialValues}\n      isNotValidIntegrationErrorMessage={\n        integrationTestError\n          ? parseApiError(integrationTestError).message\n          : testIntegrationResults?.data?.result === false\n          ? testIntegrationResults.data.message ||\n            t('api.error.genericNoMessageReceived')\n          : undefined\n      }\n    />\n  ) : (\n    <Message $status={'error'}>\n      {apiError ? parseApiError(apiError).message : 'Missing data'}\n    </Message>\n  )\n}\n","import React, { useEffect, useState } from 'react'\nimport { IntegrationCredentialsContent } from '@features/nbee/IntegrationCredentialsContent'\nimport { matchPath, useLocation, useParams } from 'react-router-dom'\nimport { IntegrationCredentialEditParams } from 'LeadsBridgeApp'\nimport {\n  makeIntegrationFormInitialValues,\n  transformIntegrationFormValuesToApiSaveRequestBody,\n} from '@features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm/utils'\nimport { IntegrationFormValues } from 'Nbee'\nimport { ApiErrorResponse } from 'BackendApi'\nimport { FormikHelpers } from 'formik'\nimport { useAppDispatch } from '@app/store/hooks'\nimport { parseApiError } from '@app/api/utils/error'\nimport { sendToast } from '@app/store/actions/ApplicationConfigurationActions'\nimport { Loader } from '@components/Basic/Loader'\nimport { sendIntegrationDataToParentWindow } from '@features/nbee/IntegrationCredentialsContent/utils'\nimport { Message } from '@components/Basic/Message'\nimport { useGetIntegrationById } from '@app/api/getIntegrationById'\nimport { useUpdateIntegration } from '@app/api/updateIntegration'\nimport { useGetAppById } from '@app/api/getAppById'\nimport { appRoutes } from '@app/routes'\nimport { useRetrieveAppCredentials } from '@app/api/postRetrieveAppCredentials'\nimport { SubmitAction } from '@features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm'\nimport { usePostNewIntegration } from '@app/api/postNewIntegration'\nimport { useTestIntegrationCredentialsById } from '@app/api/testIntegrationCredentialsById'\nimport { useTranslation } from 'react-i18next'\nimport { trackEvent } from '@app/dataTracking'\n\n// This page is supposed to be always opened inside a popup window with reduced dimensions\n// In future we might add an additional check and prevent the component to render if `window.opener` is not set\n// this means that this component has not been mounted in a page generated from a parent window\nexport const IntegrationAuthScreenEdit: React.FC = () => {\n  const { t } = useTranslation()\n  const { appId, integrationId, bridgeId } =\n    useParams<IntegrationCredentialEditParams>()\n  const appIdNumber = parseInt(appId, 10)\n  const [newIntegration, setNewIntegration] =\n    useState<{ id: number; name: string }>()\n  // this will be used to keep the loading spinner while sending data to parent and modal is about to be closed\n  const [isAboutToClosingModal, setIsAboutToClosingModal] = useState(false)\n\n  const dispatch = useAppDispatch()\n  const location = useLocation()\n  const isSaveStep = matchPath(location.pathname, {\n    path: appRoutes.integrationAuthScreenEditStep2.path,\n    exact: true,\n    strict: true,\n  })\n\n  const {\n    data: appData,\n    isLoading: isLoadingApp,\n    error: errorApiGetApp,\n  } = useGetAppById(appId)\n\n  const {\n    data: appAuthSchemaResponse,\n    mutate: retrieveAuthSchema,\n    isLoading: isLoadingAppAuthSchema,\n    error: errorApiAppAuthSchema,\n  } = useRetrieveAppCredentials()\n\n  const {\n    data: existingIntegration,\n    isLoading: isLoadingExistingIntegration,\n    error: errorApiGetIntegration,\n  } = useGetIntegrationById(integrationId)\n\n  const {\n    mutate: updateIntegration,\n    isLoading: isUpdatingIntegration,\n    error: integrationUpdateApiError,\n    data: updatedIntegrationData,\n  } = useUpdateIntegration()\n\n  const {\n    mutate: saveNewIntegration,\n    isLoading: isSavingNewIntegration,\n    error: integrationSaveApiError,\n    data: savedIntegrationData,\n  } = usePostNewIntegration()\n\n  const {\n    data: testIntegrationResults,\n    error: integrationTestError,\n    isLoading: isCheckingValidIntegration,\n    isRefetching: isReCheckingValidIntegration,\n    refetch: reTestValidIntegration,\n  } = useTestIntegrationCredentialsById(newIntegration?.id)\n\n  const trackEventError = (\n    apiError: ApiErrorResponse,\n    formValues: IntegrationFormValues\n  ) => {\n    const parsedError = parseApiError(apiError)\n    trackEvent({\n      eventName: 'UnexpectedErrorThrown',\n      feature: 'NBEE',\n      step: 'Apps',\n      params: {\n        appId: appIdNumber,\n        appName: appData?.name,\n        integrationId: parseInt(integrationId, 10),\n        integrationName: formValues.name,\n        custom: {\n          errorCode: parsedError.code,\n          errorDescription: parsedError.message,\n        },\n      },\n      sendEventToIntercom: true,\n    })\n  }\n\n  // if error we notify the user\n  useEffect(() => {\n    const error = integrationUpdateApiError || integrationSaveApiError\n    if (error) {\n      const errorMessage = parseApiError(error).message\n      dispatch(\n        sendToast({\n          title: 'Error',\n          message: errorMessage,\n          color: 'negative',\n        })\n      )\n    }\n  }, [integrationUpdateApiError, integrationSaveApiError])\n\n  // retrieving auth schema on mount\n  useEffect(() => {\n    retrieveAuthSchema({\n      appId: appIdNumber,\n      settings: [],\n    })\n  }, [appIdNumber])\n\n  // data just saved\n  const optimisticIntegrationData =\n    updatedIntegrationData || savedIntegrationData?.data?.integration\n\n  // we build the full auth schema by merging existing data into the full app auth schema\n  const appAuthSchema = appAuthSchemaResponse?.data?.credentials.fields || []\n  const isOauthUri = appAuthSchemaResponse?.data?.credentials.type === 'oauth2'\n  const initialValues = appData\n    ? makeIntegrationFormInitialValues(\n        appAuthSchema,\n        appData.name,\n        optimisticIntegrationData || existingIntegration\n      )\n    : null\n\n  // on mount events\n  const isReady = Boolean(appData && initialValues && appAuthSchemaResponse)\n  useEffect(() => {\n    if (isReady && !isSaveStep) {\n      trackEvent({\n        eventName: 'EditIntegrationShown',\n        feature: 'NBEE',\n        step: 'Integration',\n        params: {\n          appId: appData?.id,\n          appName: appData?.name,\n          integrationId: parseInt(integrationId, 10),\n          integrationName: initialValues?.name,\n          oauth: isOauthUri,\n        },\n      })\n    }\n  }, [isReady])\n\n  const updateIntegrationHandler = (\n    formValues: IntegrationFormValues,\n    formikHelpers: FormikHelpers<IntegrationFormValues>,\n    action: SubmitAction\n  ) => {\n    formikHelpers.setSubmitting(true)\n\n    if (action === 'update') {\n      updateIntegration(\n        {\n          integrationId: integrationId,\n          requestBody: transformIntegrationFormValuesToApiSaveRequestBody(\n            formValues,\n            appIdNumber\n          ),\n        },\n        {\n          onError: (apiError) => {\n            formikHelpers.setSubmitting(false)\n            trackEventError(apiError, formValues)\n          },\n        }\n      )\n    }\n\n    if (action === 'save-new') {\n      saveNewIntegration(\n        {\n          requestBody: transformIntegrationFormValuesToApiSaveRequestBody(\n            formValues,\n            appIdNumber\n          ),\n        },\n        {\n          onError: (apiError) => {\n            formikHelpers.setSubmitting(false)\n            trackEventError(apiError, formValues)\n          },\n        }\n      )\n    }\n  }\n\n  // handle success save/updated\n  useEffect(() => {\n    const isSuccessResponse =\n      updatedIntegrationData || savedIntegrationData?.data?.integration\n    if (isSuccessResponse) {\n      const integrationId = isSuccessResponse.id\n      const integrationName = isSuccessResponse.name\n      if (newIntegration?.id) {\n        // in case `newIntegration` is already set the `useTestIntegrationCredentialsById` hook\n        // will not re-run, so re refetch data manually\n        reTestValidIntegration()\n      }\n      setNewIntegration({ id: integrationId, name: integrationName })\n    }\n  }, [updatedIntegrationData, savedIntegrationData])\n\n  // Proceeding when test is successful\n  useEffect(() => {\n    if (testIntegrationResults?.data?.result && newIntegration) {\n      setIsAboutToClosingModal(true)\n\n      if (!isOauthUri) {\n        // when test is OK and we are not in oauth flow, before sending the SaveClicked Event, we need to send\n        // the `AuthorizeSuccess` so we can simulate the same events order of the oauth integration\n        trackEvent({\n          eventName: 'AuthorizeSuccess',\n          feature: 'NBEE',\n          step: 'Integration',\n          params: {\n            appId: appData?.id,\n            appName: appData?.name,\n            integrationId: newIntegration.id,\n            integrationName: newIntegration.name,\n            oauth: false,\n          },\n        })\n      }\n\n      trackEvent({\n        eventName: 'SaveClicked',\n        feature: 'NBEE',\n        step: 'Integration',\n        params: {\n          appId: appData?.id,\n          appName: appData?.name,\n          integrationId: newIntegration.id,\n          integrationName: newIntegration.name,\n          oauth: isOauthUri,\n        },\n      })\n\n      sendIntegrationDataToParentWindow(newIntegration.id, newIntegration.name)\n    }\n  }, [testIntegrationResults])\n\n  // In case of test failure\n  useEffect(() => {\n    // in case test fails we send the `AuthorizeFailure` tracking event only if is not an oauth flow\n    // for oauth integrations we send this event during the oauth flow, insice IntegrationAuthCallback component\n    if (integrationTestError && !isOauthUri) {\n      const parsedTestError = parseApiError(integrationTestError)\n      trackEvent({\n        eventName: 'AuthorizeFailure',\n        feature: 'NBEE',\n        step: 'Integration',\n        params: {\n          appId: appData?.id,\n          appName: appData?.name,\n          integrationId: newIntegration?.id,\n          integrationName: newIntegration?.name,\n          oauth: false,\n          custom: {\n            errorCode: parsedTestError.code,\n            errorDescription: parsedTestError.message,\n          },\n        },\n        sendEventToIntercom: true,\n      })\n    }\n  }, [integrationTestError])\n\n  const isLoadingAll =\n    isLoadingAppAuthSchema ||\n    isLoadingApp ||\n    isLoadingExistingIntegration ||\n    isCheckingValidIntegration ||\n    isReCheckingValidIntegration ||\n    isAboutToClosingModal\n  const apiError =\n    errorApiAppAuthSchema || errorApiGetIntegration || errorApiGetApp\n\n  if (!appId) {\n    return <div>Missing Parameter</div>\n  }\n\n  return isLoadingAll ? (\n    <div\n      style={{\n        position: 'relative',\n        height: 200,\n      }}\n    >\n      <Loader $active $dimmer $size={'large'} />\n    </div>\n  ) : appData && initialValues ? (\n    <IntegrationCredentialsContent\n      appId={appIdNumber}\n      appName={appData.name}\n      appLogoUri={appData.logoUriSmall}\n      isSavingApi={isUpdatingIntegration || isSavingNewIntegration}\n      onSubmit={updateIntegrationHandler}\n      isOauthUri={isOauthUri}\n      initialValues={initialValues}\n      bridgeId={bridgeId ? parseInt(bridgeId, 10) : undefined}\n      skipParams={Boolean(isSaveStep && isSaveStep.isExact)}\n      integrationId={parseInt(integrationId, 10)}\n      isNotValidIntegrationErrorMessage={\n        integrationTestError\n          ? parseApiError(integrationTestError).message\n          : testIntegrationResults?.data?.result === false\n          ? testIntegrationResults.data.message ||\n            t('api.error.genericNoMessageReceived')\n          : undefined\n      }\n    />\n  ) : apiError ? (\n    <Message $status={'error'}>{parseApiError(apiError).message}</Message>\n  ) : null\n}\n","import React, { useEffect } from 'react'\nimport { useLocation } from 'react-router-dom'\nimport queryString from 'query-string'\nimport { useVerifyLink } from '@app/api/postVerifyLink'\nimport { Loader } from '@components/Basic/Loader'\nimport LbLogoSvg from '@assets/images/logo-lb-small.svg'\nimport { StyledAuthorizationPopup } from '@features/nbee/IntegrationCredentialsContent/styled'\nimport { useTranslation } from 'react-i18next'\n\nexport const IntegrationAuthVerifiedEmailScreenLegacy: React.VFC = () => {\n  const { Wrapper, Header, Body, Title, SubTitle } = StyledAuthorizationPopup\n  const { t } = useTranslation()\n  const location = useLocation()\n  const queryStringParam = queryString.parse(location.search) as {\n    code: string\n  }\n\n  const {\n    data: verifyLinkResponse,\n    mutate: verifyLink,\n    isLoading: verifyLinkLoading,\n    isError: verifyLinkError,\n  } = useVerifyLink()\n\n  useEffect(() => {\n    if (queryStringParam.code) {\n      verifyLink(queryStringParam)\n    }\n  }, [])\n\n  return (\n    <Wrapper>\n      <Header>\n        <img src={LbLogoSvg} width='40' alt={'leadsbridge-logo'} />\n      </Header>\n      <Body>\n        <Title>{t('emailValidationLegacyExperience.pageTitle')}</Title>\n        {verifyLinkLoading && (\n          <>\n            <SubTitle>\n              {t('emailValidationLegacyExperience.loadingMessage')}\n            </SubTitle>\n            <Loader $active $dimmer $size={'large'} />\n          </>\n        )}\n        {verifyLinkResponse && (\n          <SubTitle>\n            {t('emailValidationLegacyExperience.successMessage')}\n          </SubTitle>\n        )}\n        {verifyLinkError && (\n          <SubTitle>\n            {t('emailValidationLegacyExperience.errorMessage')}\n          </SubTitle>\n        )}\n      </Body>\n    </Wrapper>\n  )\n}\n","import React from 'react'\n\nexport const IntegrationHome: React.VFC = () => {\n  return null\n}\n","import React, { useEffect } from 'react'\nimport { useLocation } from 'react-router-dom'\nimport { Dimmer, Loader } from 'semantic-ui-react'\n\ninterface Props {}\n\nconst LegacyRedirect: React.FC<Props> = () => {\n  const location = useLocation()\n\n  useEffect(() => {\n    const redirectUrl =\n      process.env.REACT_APP_V1_URL! + location.pathname + location.search\n    // some time redirect from v1 to v2 is not stripping out the '/app' part\n    // that is already present in `process.env.REACT_APP_V1_URL`, causing\n    // the computation of an URL of type `https://leadsbridge.com/app/` + `/app/path/to/page/`\n    // This is something not related to v2 app, since some time it receives\n    // `/bridges/edit/` and some times `app/page-abc/`.\n    // We can fix this by replaceing `/app/app/` with a single `/app/` :D\n    const parsedRedirectUrl = redirectUrl.replace('/app/app/', '/app/')\n    window.location.href = parsedRedirectUrl\n  }, [])\n\n  return (\n    <div style={{ minHeight: '100vh' }}>\n      <Dimmer active inverted>\n        <Loader inverted>Loading</Loader>\n      </Dimmer>\n    </div>\n  )\n}\n\nexport default LegacyRedirect\n","import Cookies from 'universal-cookie'\nimport { PersistentCookiesKeys } from '@app/enums/persistentCookiesKeys'\nimport LoginV1Service from \"@app/services/ApplicationV1Bridge\";\n\nexport const clearPersistentData = async () => {\n  const cookies = new Cookies()\n\n  localStorage.clear()\n  sessionStorage.clear()\n  cookies.remove(PersistentCookiesKeys.XsrfToken, {\n    path: '/',\n    domain: process.env.REACT_APP_V1_COOKIE_DOMAIN,\n  })\n  await LoginV1Service.cancelSessionCookie(process.env.REACT_APP_V1_COOKIE_DOMAIN ?? \"\")\n  cookies.remove(PersistentCookiesKeys.LbImp, {\n    path: '/',\n    domain: process.env.REACT_APP_V1_COOKIE_DOMAIN,\n  })\n  cookies.remove(PersistentCookiesKeys.CognitoSession, {\n    path: '/',\n    domain: process.env.REACT_APP_V1_COOKIE_DOMAIN,\n  })\n  cookies.remove('fbm_939660826071336', {\n    path: '/',\n    domain: process.env.REACT_APP_V1_COOKIE_DOMAIN,\n  })\n  cookies.remove('fbsr_939660826071336', {\n    path: '/',\n    domain: process.env.REACT_APP_V1_COOKIE_DOMAIN,\n  })\n}\n","import React from 'react'\nimport { BridgeFormValues } from 'Nbee'\nimport { BridgeChooserForm } from '@features/nbee/BridgeChooserForm'\nimport { BridgeChooserRedirector } from '@features/nbee/BridgeChooserRedirector'\nimport { Route, Switch, useHistory } from 'react-router-dom'\nimport { appRoutes } from '@app/routes'\n\nconst emptyBridge: BridgeFormValues = {\n  name: `New bridge ${new Date().getTime()}`,\n  source: {\n    appId: undefined,\n    integrationId: undefined,\n    settings: [],\n  },\n  destination: {\n    appId: undefined,\n    integrationId: undefined,\n    settings: [],\n  },\n  settings: {\n    emailReceipt: {\n      active: false,\n    },\n  },\n}\n\nexport const BridgeChooser: React.FC = () => {\n  const initialValues = emptyBridge\n  const history = useHistory()\n\n  return (\n    <Switch>\n      {/* Step 1: App selections */}\n      <Route exact path={appRoutes.nbeeBridgeChooserStep1.path}>\n        <BridgeChooserForm\n          initialValues={initialValues}\n          onSubmit={(formValues) => {\n            // on submit we redirect to step 2\n            history.push(\n              appRoutes.nbeeBridgeChooserStep2.makeUrl({\n                sourceAppId: `${formValues.source.appId}`,\n                destinationAppId: `${formValues.destination.appId}`,\n              })\n            )\n          }}\n        />\n      </Route>\n      {/*\n      Step 2: Editor selection\n      > NB: For some combinations, there is no 'complex bridge'. Within this Route, we check compatibility and manage the automatic redirect!\n      */}\n\n      <Route\n        exact\n        path={appRoutes.nbeeBridgeChooserStep2.path}\n        component={BridgeChooserRedirector}\n      />\n    </Switch>\n  )\n}\n","import React from 'react'\nimport { useHistory } from 'react-router-dom'\nimport { appRoutes } from '@app/routes'\nimport { NbeeStepCompletedState } from '@app/pages/Nbee/Step3'\nimport { isDebug } from '@app/utils/envUtils'\n\nexport const NbeeHome: React.FC = () => {\n  const history = useHistory()\n\n  if (!isDebug) {\n    // prevent this page to appear in production :)\n    return null\n  }\n\n  return (\n    <div>\n      <h1>NBEE Home</h1>\n\n      <ul>\n        <li>\n          <button\n            onClick={() => {\n              history.push(appRoutes.nbeeBridgeChooserStep1.makeUrl())\n            }}\n          >\n            Bridge Chooser Step 1\n          </button>\n        </li>\n\n        <li>\n          <button\n            onClick={() => {\n              history.push(\n                appRoutes.nbeeBridgeChooserStep2.makeUrl({\n                  sourceAppId: '63',\n                  destinationAppId: '45',\n                })\n              )\n            }}\n          >\n            Bridge Chooser Step 2\n          </button>\n        </li>\n\n        <li>\n          <button\n            onClick={() => {\n              history.push(appRoutes.nbeeStep1New.makeUrl())\n            }}\n          >\n            New bridge empty\n          </button>\n        </li>\n\n        <li>\n          <button\n            onClick={() => {\n              history.push({\n                pathname: appRoutes.nbeeStep1New.makeUrl(),\n                search: 'sourceId=63',\n              })\n            }}\n          >\n            New bridge empty with sourceId selected\n          </button>\n        </li>\n\n        <li>\n          <button\n            onClick={() => {\n              // redirect to NBEE form with source and destination prefilled\n              history.push(\n                appRoutes.signupBbu.makeUrl({\n                  source: 'facebook-lead-ads',\n                  destination: 'google-sheets',\n                })\n              )\n            }}\n          >\n            New bridge form with BBU\n          </button>\n        </li>\n\n        <li>\n          <button\n            onClick={() => {\n              history.push(appRoutes.nbeeStep1Edit.makeUrl('321'))\n            }}\n          >\n            Edit bridge\n          </button>\n        </li>\n\n        <li>\n          <button\n            onClick={() => {\n              history.push(appRoutes.nbeeStep2.makeUrl('321'))\n            }}\n          >\n            Step2\n          </button>\n        </li>\n\n        <li>\n          <button\n            onClick={() => {\n              const step3State: NbeeStepCompletedState = { success: true }\n              history.push(appRoutes.nbeeStep3.makeUrl('321'), step3State)\n            }}\n          >\n            Step3\n          </button>\n        </li>\n\n        <li>\n          <button\n            onClick={() => {\n              history.push('/test-components')\n            }}\n          >\n            Test Components\n          </button>\n        </li>\n      </ul>\n    </div>\n  )\n}\n","import React, { useEffect, useState } from 'react'\nimport { SimpleBridgeBuilderForm } from '@features/nbee/SimpleBridgeBuilderForm'\nimport { useGetBridgeByTemplate } from '@app/api/getBridgeByTemplate'\nimport { BridgeFormValues } from 'Nbee'\nimport { transformBridgeFormValuesToApiSaveBridgeBody } from '@app/api/utils/bridge'\nimport { useCreateNewBridge } from '@app/api/createNewBridge'\nimport { matchPath, useHistory, useLocation } from 'react-router-dom'\nimport { appRoutes, bridgeByUrlPartnersPaths } from '@app/routes'\nimport { parseApiError } from '@app/api/utils/error'\nimport { useAppDispatch } from '@app/store/hooks'\nimport { sendToast } from '@app/store/actions/ApplicationConfigurationActions'\nimport { LoadingStep } from '@features/nbee/LoadingStep'\nimport { BbuRouteParams } from 'LeadsBridgeApp'\nimport { trackEvent } from '@app/dataTracking'\nimport { makeNbeeTrackingParams } from '@app/dataTracking/utils'\nimport { useSetupBridgeById } from '@app/api/postSetupBridge'\nimport { FormikHelpers } from 'formik'\nimport { useUpdateBridge } from '@app/api/updateBridge'\nimport queryString from 'query-string'\nimport { useGetUserModules } from '@app/api/getUserModules'\nimport { UserDefault } from 'BackendApi'\nimport { useGetUserInfo } from '@app/api/getUserInfo'\nimport { ModalTrialInfo } from '@features/nbee/ModalTrialInfo'\nimport { useTranslation } from 'react-i18next'\n\nconst makeEmptyBridge = (\n  sourceAppId?: number,\n  destinationAppId?: number,\n  emailReceiptDefaults?: UserDefault\n): BridgeFormValues => ({\n  name: `New bridge`,\n  source: {\n    appId: sourceAppId,\n    integrationId: undefined,\n    settings: [],\n  },\n  destination: {\n    appId: destinationAppId,\n    integrationId: undefined,\n    settings: [],\n  },\n  settings: {\n    emailReceipt: {\n      active: Boolean(emailReceiptDefaults?.active ?? false),\n      recipients: emailReceiptDefaults?.recipients ?? [],\n      subject: emailReceiptDefaults?.subject ?? '',\n    },\n  },\n})\n\nexport const Step1: React.FC = () => {\n  const { t } = useTranslation()\n  const history = useHistory()\n  const location = useLocation()\n  const dispatch = useAppDispatch()\n\n  const [isModalOpen, setIsModalOpen] = useState(false)\n  const handleOpenModal = () => setIsModalOpen(true)\n  const handleCloseModal = () => setIsModalOpen(false)\n\n  const {\n    data: user,\n    isLoading: isLoadingUser,\n    error: userError,\n  } = useGetUserInfo()\n\n  const loginParams = queryString.parse(window.location.search)\n  const showSurpriseMessage =\n    loginParams.currentPlan === 'freemium' ||\n    loginParams?.currentPlan?.includes('starter')\n  const lbfsgn = loginParams.lbfsgn === 'true'\n\n  const planName =\n    loginParams.currentPlan === 'freemium'\n      ? 'Free'\n      : loginParams?.currentPlan?.includes('starter')\n      ? 'Starter'\n      : ''\n\n  const isFirstLogin = user?.newUser || lbfsgn\n\n  useEffect(() => {\n    if (isFirstLogin) handleOpenModal()\n  }, [isFirstLogin])\n\n  const [bridgeFormikProps, setBridgeFormikProps] = useState<{\n    formValues: BridgeFormValues\n    formikHelpers: FormikHelpers<BridgeFormValues>\n  } | null>(null)\n\n  // if is bbu uri: `/bc/(app|lb)/facebook-lead-ads/google-sheets`\n  const bbuMatchUrl = matchPath<BbuRouteParams>(location.pathname, {\n    path: bridgeByUrlPartnersPaths,\n    exact: true,\n  })\n\n  const bbuUri = bbuMatchUrl\n    ? `${window.location.origin}${bbuMatchUrl.url}`\n    : undefined\n\n  const { data: bridgeTemplateValues, isLoading: isLoadingBridgeTemplate } =\n    useGetBridgeByTemplate(bbuUri)\n\n  const urlParsed = queryString.parse(location.search, {\n    parseNumbers: true,\n  })\n  const sourceAppIdFromQueryString =\n    urlParsed && urlParsed.sourceId\n      ? parseInt(`${urlParsed.sourceId}`, 10)\n      : undefined\n  const destinationAppIdFromQueryString =\n    urlParsed && urlParsed.destinationId\n      ? parseInt(`${urlParsed.destinationId}`, 10)\n      : undefined\n\n  const {\n    data: userModulesResponse,\n    isLoading: isLoadingUserModules,\n    error: apiUserModulesError,\n  } = useGetUserModules()\n  const userModules = userModulesResponse?.modules || []\n  const emailReceiptUserModule = userModules.find(\n    (m) => m.id === 'email-receipt'\n  )\n\n  // prepare initial values base on BBU data or empty bridge\n  // in case we have sourceId or destinationId in query string we prefill them\n  const initialValues =\n    bbuUri && bridgeTemplateValues\n      ? bridgeTemplateValues\n      : makeEmptyBridge(\n          sourceAppIdFromQueryString,\n          destinationAppIdFromQueryString,\n          emailReceiptUserModule?.userDefaults\n        )\n\n  // Save bridge\n  const {\n    mutate: createNewBridge,\n    data: createNewBridgeResponse,\n    error: createNewBridgeError,\n    isLoading: isCreatingNewBridge,\n  } = useCreateNewBridge()\n\n  // Update bridge\n  const {\n    mutate: updateBridge,\n    data: updateBridgeResponse,\n    error: updateBridgeError,\n    isLoading: isUpdatingBridge,\n  } = useUpdateBridge()\n\n  // Setup bridge\n  const {\n    mutate: setupBridge,\n    data: bridgeSetupResponse,\n    error: bridgeSetupApiError,\n    isLoading: isSettingUpBridge,\n  } = useSetupBridgeById()\n\n  const isSavingApi =\n    isCreatingNewBridge || isSettingUpBridge || isUpdatingBridge\n  const apiError =\n    createNewBridgeError || bridgeSetupApiError || updateBridgeError\n  const createdBridgeId = createNewBridgeResponse?.data?.bridge?.id // when is the first time user saves the bridge\n  const updatedBridgeId = updateBridgeResponse?.data?.bridge?.id // in case setup bridge fails, the second save bridge attemps needs to be done as update since we already have a bridge id\n\n  // when createNewBridgeResponse returns success we need to call the bridge setup endpoint\n  useEffect(() => {\n    const bridgeId = createdBridgeId || updatedBridgeId\n    if (bridgeId) {\n      setupBridge({ bridgeId })\n    }\n  }, [createdBridgeId, updatedBridgeId])\n\n  // when setup bridge is completed we can redirect the user to next step\n  useEffect(() => {\n    if (bridgeSetupResponse && createdBridgeId) {\n      history.push(appRoutes.nbeeStep2.makeUrl(createdBridgeId.toString()))\n    }\n  }, [bridgeSetupResponse])\n\n  // in case of error we notify the user\n  useEffect(() => {\n    if (apiError) {\n      const parsedError = parseApiError(apiError)\n      dispatch(\n        sendToast({\n          title: 'Error',\n          message: parsedError.message,\n          color: 'negative',\n        })\n      )\n\n      if (bridgeFormikProps) {\n        bridgeFormikProps.formikHelpers.setSubmitting(false)\n\n        trackEvent({\n          eventName: 'UnexpectedErrorThrown',\n          feature: 'NBEE',\n          step: 'Apps',\n          params: {\n            ...makeNbeeTrackingParams(bridgeFormikProps.formValues),\n            custom: {\n              errorCode: parsedError.code,\n              errorDescription: parsedError.message,\n            },\n          },\n          sendEventToIntercom: true,\n        })\n      }\n    }\n  }, [apiError])\n\n  return isLoadingBridgeTemplate || isLoadingUserModules ? (\n    <LoadingStep\n      activeStepIndex={0}\n      loadingText={t('nbee.bridgeBuilder.step1TemplateLoadingMessage')}\n    />\n  ) : (\n    <>\n      <ModalTrialInfo\n        isOpen={isModalOpen}\n        onCloseModal={handleCloseModal}\n        showSurpriseMessage={showSurpriseMessage}\n        planName={planName}\n      />\n      <SimpleBridgeBuilderForm\n        initialValues={initialValues}\n        isSavingApi={isSavingApi}\n        emailReceiptUserModule={emailReceiptUserModule}\n        templateSettings={bridgeTemplateValues?.source?.settings}\n        userData={user}\n        onSubmit={(formValues, formikHelpers) => {\n          const newBridgeData = transformBridgeFormValuesToApiSaveBridgeBody(\n            formValues,\n            { step: 1 }\n          )\n          // we store all formik handlers in order to access them in the component scope\n          setBridgeFormikProps({ formValues, formikHelpers })\n\n          // The first time we call the create (save) new bridge endpoint and in case of success the setup bridge will be called right after (check useEffect -> setupBridge)\n          // If setup bridge fails, the user will need to edit the bridge configuration and the second save attemp needs to be done by calling the update bridge endpoint\n          if (!createdBridgeId) {\n            createNewBridge(newBridgeData)\n          } else {\n            updateBridge({\n              bridgeData: newBridgeData,\n              bridgeId: `${createdBridgeId}`,\n            })\n          }\n        }}\n      />\n    </>\n  )\n}\n","import React, { useEffect, useState } from 'react'\nimport { SimpleBridgeBuilderForm } from '@features/nbee/SimpleBridgeBuilderForm'\nimport { useGetBridgeById } from '@app/api/getBridgeById'\nimport { useHistory, useParams } from 'react-router-dom'\nimport { useUpdateBridge } from '@app/api/updateBridge'\nimport { transformBridgeFormValuesToApiSaveBridgeBody } from '@app/api/utils/bridge'\nimport { appRoutes } from '@app/routes'\nimport { useAppDispatch } from '@app/store/hooks'\nimport { parseApiError } from '@app/api/utils/error'\nimport { sendToast } from '@app/store/actions/ApplicationConfigurationActions'\nimport { LoadingStep } from '@features/nbee/LoadingStep'\nimport { NbeeError } from '@features/nbee/NbeeError'\nimport { trackEvent } from '@app/dataTracking'\nimport { makeNbeeTrackingParams } from '@app/dataTracking/utils'\nimport { useSetupBridgeById } from '@app/api/postSetupBridge'\nimport { FormikHelpers } from 'formik'\nimport { BridgeFormValues } from 'Nbee'\nimport { useFetchAllApps } from '@app/api/getAllApps'\nimport { useGetUserInfo } from '@app/api/getUserInfo'\nimport { useGetUserModules } from '@app/api/getUserModules'\n\nexport const Step1Edit: React.FC = () => {\n  const { bridgeId }: { bridgeId: string } = useParams()\n  const history = useHistory()\n  const dispatch = useAppDispatch()\n  const [bridgeFormikProps, setBridgeFormikProps] = useState<{\n    formValues: BridgeFormValues\n    formikHelpers: FormikHelpers<BridgeFormValues>\n  } | null>(null)\n\n  const {\n    data: allApps,\n    isLoading: isLoadingApps,\n    error: allAppsApiError,\n  } = useFetchAllApps()\n\n  const {\n    data: bridgeFormValues,\n    isLoading: isLoadingBridge,\n    error: bridgeApiError,\n  } = useGetBridgeById(bridgeId)\n\n  const {\n    data: user,\n    isLoading: isLoadingUser,\n    error: userError,\n  } = useGetUserInfo()\n\n  const {\n    data: userModulesResponse,\n    isLoading: isLoadingUserModules,\n    error: apiUserModulesError,\n  } = useGetUserModules()\n  const userModules = userModulesResponse?.modules || []\n  const emailReceiptUserModule = userModules.find(\n    (m) => m.id === 'email-receipt'\n  )\n\n  const apiInitialDataError = allAppsApiError || bridgeApiError\n\n  // Update bridge\n  const {\n    mutate: updateBridge,\n    data: updateBridgeResponse,\n    error: updateBridgeError,\n    isLoading: isUpdatingBridge,\n  } = useUpdateBridge()\n\n  // Setup bridge\n  const {\n    mutate: setupBridge,\n    data: bridgeSetupResponse,\n    error: bridgeSetupApiError,\n    isLoading: isSettingUpBridge,\n  } = useSetupBridgeById()\n\n  const isSavingApi = isSettingUpBridge || isUpdatingBridge\n  const apiError = bridgeSetupApiError || updateBridgeError\n  const updatedBridgeId = updateBridgeResponse?.data?.bridge?.id\n\n  useEffect(() => {\n    if (updatedBridgeId) {\n      setupBridge({ bridgeId: updatedBridgeId })\n    }\n  }, [updatedBridgeId])\n\n  // when setup bridge is completed we can redirect the user to next step\n  useEffect(() => {\n    if (bridgeSetupResponse) {\n      history.push(appRoutes.nbeeStep2.makeUrl(bridgeId))\n    }\n  }, [bridgeSetupResponse])\n\n  // if error we notify the user\n  useEffect(() => {\n    if (apiError) {\n      const parsedError = parseApiError(apiError)\n      dispatch(\n        sendToast({\n          title: 'Error',\n          message: parsedError.message,\n          color: 'negative',\n        })\n      )\n\n      if (bridgeFormikProps) {\n        bridgeFormikProps.formikHelpers.setSubmitting(false)\n\n        trackEvent({\n          eventName: 'UnexpectedErrorThrown',\n          feature: 'NBEE',\n          step: 'Apps',\n          params: {\n            ...makeNbeeTrackingParams(bridgeFormikProps.formValues),\n            custom: {\n              errorCode: parsedError.code,\n              errorDescription: parsedError.message,\n            },\n          },\n          sendEventToIntercom: true,\n        })\n      }\n    }\n  }, [apiError])\n\n  return isLoadingBridge || isLoadingApps ? (\n    <LoadingStep activeStepIndex={0} />\n  ) : bridgeFormValues && allApps ? (\n    <SimpleBridgeBuilderForm\n      isSavingApi={isSavingApi}\n      initialValues={bridgeFormValues}\n      emailReceiptUserModule={emailReceiptUserModule}\n      userData={user}\n      onSubmit={(formValues, formikHelpers) => {\n        const updateBridgeData = transformBridgeFormValuesToApiSaveBridgeBody(\n          formValues,\n          { step: 1 }\n        )\n\n        // we store all formik handlers in order to access them in the component scope\n        setBridgeFormikProps({ formValues, formikHelpers })\n\n        updateBridge({\n          bridgeData: updateBridgeData,\n          bridgeId,\n        })\n      }}\n    />\n  ) : apiInitialDataError ? (\n    <NbeeError\n      activeStepIndex={0}\n      errorCode={parseApiError(apiInitialDataError).code}\n      statusCode={parseApiError(apiInitialDataError).status}\n      errorMessage={parseApiError(apiInitialDataError).message}\n    />\n  ) : null\n}\n","import React, { useEffect, useState } from 'react'\nimport { FieldsMappingForm } from '@features/nbee/FieldsMappingForm'\nimport { LoadingStep } from '@features/nbee/LoadingStep'\nimport { transformBridgeFormValuesToApiSaveBridgeBody } from '@app/api/utils/bridge'\nimport { NbeeError } from '@features/nbee/NbeeError'\nimport { parseApiError } from '@app/api/utils/error'\nimport { useGetBridgeById } from '@app/api/getBridgeById'\nimport { useUpdateBridge } from '@app/api/updateBridge'\nimport { useHistory, useParams } from 'react-router-dom'\nimport { useGetBridgeAllFields } from '@app/api/getBridgeAllFields'\nimport {\n  makeFieldsMappingInitialValuesAndListNotMatchingFields,\n  FieldMappingMatched,\n  useNotifyUserOfMissingMappedFields,\n} from '@features/nbee/FieldsMappingForm/initialStateUtils'\nimport { useAppDispatch } from '@app/store/hooks'\nimport { sendAlertMessage } from '@app/store/actions/ApplicationConfigurationActions'\nimport { appRoutes } from '@app/routes'\nimport { NbeeStepCompletedState } from '@app/pages/Nbee/Step3'\nimport { usePublishBridge } from '@app/api/publishBridge'\nimport { FormikHelpers } from 'formik'\nimport { BridgeFormValues } from 'Nbee'\nimport { Button } from '@components/Basic/Button'\nimport { useTranslation } from 'react-i18next'\nimport { trackEvent } from '@app/dataTracking'\nimport { makeNbeeTrackingParams } from '@app/dataTracking/utils'\nimport { useGetUserInfo } from '@app/api/getUserInfo'\nimport { useGetBridgeAvailablePermissionChecks } from '@app/api/getBridgeAvailablePermissionChecks'\nimport { useRunBridgePermissionChecks } from '@app/api/postRunBridgePermissionChecks'\nimport { ApiErrorResponse } from 'BackendApi'\nimport { calculateInitialShouldCheckPermissionsState } from '@app/features/nbee/utils'\n\nexport const Step2: React.FC = () => {\n  const params: { bridgeId: string } = useParams()\n  const bridgeId = parseInt(params.bridgeId, 10)\n\n  const dispatch = useAppDispatch()\n  const history = useHistory()\n  const { t } = useTranslation()\n\n  // Each of these hooks handles the fetching, loading state, and error state for each respective API call\n  const {\n    data: user,\n    isLoading: isLoadingUser,\n    error: userError,\n  } = useGetUserInfo()\n\n  const {\n    data: bridgeFormValues,\n    error: errorGettingBridge,\n    refetch: onRefetchBridgeFormValues,\n    isLoading: isLoadingBridge,\n    isRefetching: isReloadingBridge,\n  } = useGetBridgeById(`${bridgeId}`, true)\n\n  const {\n    data: availablePermissionChecks,\n    error: errorGettingAvailablePermissionChecks,\n    isLoading: isLoadingAvailablePermissionChecks,\n  } = useGetBridgeAvailablePermissionChecks(bridgeId)\n\n  const {\n    data: allBridgeFields,\n    error: allBridgeFieldsError,\n    isLoading: loadingAllBridgeFields,\n    isRefetching: isReloadingAllBridgeFields,\n  } = useGetBridgeAllFields(bridgeId)\n\n  // Each of these hooks handles the mutation, loading state, and error state for each respective API call\n  const {\n    mutate: updateBridge,\n    error: updateBridgeError,\n    isLoading: isUpdatingBridge,\n  } = useUpdateBridge()\n\n  const {\n    mutate: publishBridge,\n    data: publishBridgeResponse,\n    error: publishBridgeApiError,\n    isLoading: isPublishingBridge,\n  } = usePublishBridge()\n\n  const {\n    mutate: runPermissionChecks,\n    error: errorRunningPermissionChecks,\n    isLoading: isRunningPermissionChecks,\n  } = useRunBridgePermissionChecks()\n\n  // prepare data for UI\n  // we are not checking `isReloadingAllBridgeFields` here because we want to leave that loading state internal to the form\n  // in this way non saved mapping (form state) will not be lost\n  const isLoadingAll =\n    isLoadingBridge ||\n    isReloadingBridge ||\n    loadingAllBridgeFields ||\n    isLoadingAvailablePermissionChecks ||\n    isRunningPermissionChecks\n\n  const apiError =\n    errorGettingBridge ||\n    allBridgeFieldsError ||\n    errorGettingAvailablePermissionChecks\n\n  const allDataReady = Boolean(\n    bridgeFormValues && allBridgeFields && availablePermissionChecks\n  )\n\n  const showWelcomeMessage =\n    !!allBridgeFields?.data?.requiresTemplateBasedFieldsMapping\n\n  // we need to know if we should perform permission checks at form submission or not\n  const [shouldCheckPermissions, setShouldCheckPermissions] = useState<boolean>(\n    availablePermissionChecks?.shouldCheckPermissions || false\n  )\n\n  // we want to ensure that the data is ready before we calculate the initial state of shouldCheckPermissions\n  useEffect(() => {\n    setShouldCheckPermissions(\n      calculateInitialShouldCheckPermissionsState(\n        availablePermissionChecks || undefined\n      )\n    )\n  }, [availablePermissionChecks])\n\n  // every time we receive new bridgeFormValues or new allBridgeFields we create a new fieldMappingMatched state\n  const [fieldsMappingMatched, setFieldsMappingMatched] =\n    useState<FieldMappingMatched | null>(null)\n\n  useEffect(() => {\n    // we also need to be sure that when we have data ready there is not refetching in action or we will generate\n    // a new fieldMappingMatched state with non fresh data\n    if (\n      bridgeFormValues &&\n      allBridgeFields &&\n      availablePermissionChecks &&\n      !isReloadingBridge &&\n      !isReloadingAllBridgeFields\n    ) {\n      setFieldsMappingMatched(\n        makeFieldsMappingInitialValuesAndListNotMatchingFields(\n          bridgeFormValues,\n          allBridgeFields\n        )\n      )\n    }\n  }, [\n    availablePermissionChecks,\n    bridgeFormValues,\n    allBridgeFields,\n    isReloadingBridge,\n    isReloadingAllBridgeFields,\n  ])\n\n  // we want to pass down to FieldsMappingForm via props both the existing filter rules and the form initial values\n  const bridgeFilterRules = bridgeFormValues?.sourceFilters?.conditions || []\n\n  const initialValues = fieldsMappingMatched?.initialValues\n\n  // we notify users by displaying an alert message if `fieldsMappingMatched` contains not found fields\n  useNotifyUserOfMissingMappedFields(fieldsMappingMatched, bridgeId)\n\n  const handleApiError = (\n    error: ApiErrorResponse,\n    formikValues: BridgeFormValues,\n    formikHelpers: FormikHelpers<BridgeFormValues>\n  ) => {\n    formikHelpers.setSubmitting(false)\n    const parsedError = parseApiError(error)\n    trackEvent({\n      eventName: 'UnexpectedErrorThrown',\n      feature: 'NBEE',\n      step: 'Apps',\n      params: {\n        ...makeNbeeTrackingParams(formikValues),\n        custom: {\n          errorCode: parsedError.code,\n          errorDescription: parsedError.message,\n        },\n      },\n      sendEventToIntercom: true,\n    })\n  }\n\n  // whenever an error occurs, we want to notify the user on both update bridge, publish bridge and check permissions actions\n  useEffect(() => {\n    if (\n      updateBridgeError ||\n      publishBridgeApiError ||\n      errorRunningPermissionChecks\n    ) {\n      const error =\n        updateBridgeError ||\n        publishBridgeApiError ||\n        errorRunningPermissionChecks\n      const errorMessage = parseApiError(error!)\n\n      if (errorMessage.code === 'bridge-limit-reached' && bridgeFormValues) {\n        trackEvent({\n          eventName: 'UpgradeButtonShown',\n          step: 'Apps',\n          feature: 'NBEE',\n          params: {\n            ...makeNbeeTrackingParams(bridgeFormValues),\n          },\n        })\n      }\n\n      dispatch(\n        sendAlertMessage({\n          isDismissable: true,\n          message: errorMessage.message,\n          useTranslation: true,\n          persistent: true,\n          buttons:\n            errorMessage.code === 'bridge-limit-reached' ? (\n              <a\n                href={\n                  window.location.origin +\n                  appRoutes.pricing.makeUrl() +\n                  '?reason=bridge-exceeded'\n                }\n                target='_blank'\n                rel='noreferrer'\n              >\n                <Button $variant={'primary'}>\n                  {t('nbee.checkCompatibility.updatePlanCta')}\n                </Button>\n              </a>\n            ) : undefined,\n        })\n      )\n    }\n  }, [updateBridgeError, publishBridgeApiError, errorRunningPermissionChecks])\n\n  // once bridge is updated we can publish it  we need to setSubmitting(false)\n  // not only on error but also when success but result is false.\n  // useEffect below will handle the error displaying or the redirection in case of success\n  const handlePublishBridge = (\n    formikValues: BridgeFormValues,\n    formikHelpers: FormikHelpers<BridgeFormValues>\n  ) => {\n    publishBridge(\n      { bridgeId },\n      {\n        onError: (apiError) => {\n          formikHelpers.setSubmitting(false)\n          const parsedError = parseApiError(apiError)\n          trackEvent({\n            eventName: 'UnexpectedErrorThrown',\n            feature: 'NBEE',\n            step: 'Apps',\n            params: {\n              ...makeNbeeTrackingParams(formikValues),\n              custom: {\n                errorCode: parsedError.code,\n                errorDescription: parsedError.message,\n              },\n            },\n            sendEventToIntercom: true,\n          })\n        },\n        onSuccess: (response) => {\n          if (response.data?.result === false) {\n            formikHelpers.setSubmitting(false)\n          } else {\n            // track event on real publish success\n            trackEvent({\n              eventName: 'BridgePublished',\n              feature: 'NBEE',\n              step: 'Publish',\n              params: {\n                ...makeNbeeTrackingParams(formikValues),\n              },\n              sendEventToIntercom: Boolean(formikValues?.source.appId === 370), // only send to intercom if source is Facebook Lead Ads\n            })\n          }\n        },\n      }\n    )\n  }\n\n  const handleUpdateBridgeSuccess = (\n    formikValues: BridgeFormValues,\n    formikHelpers: FormikHelpers<BridgeFormValues>\n  ) => {\n    if (shouldCheckPermissions) {\n      runPermissionChecks(\n        {\n          bridgeId,\n          permissionChecklist:\n            availablePermissionChecks?.data.permissionChecklist || [],\n        },\n        {\n          // both onSuccess and onError, we want to not process the permission checks anymore during this session\n          onSuccess: () => {\n            // if all permission checks are ok, we can publish the bridge\n            setShouldCheckPermissions(false)\n            handlePublishBridge(formikValues, formikHelpers)\n          },\n          onError: (error) => {\n            // if one of the permission checks fails, we want to display the error to the user and stop the flow once\n            setShouldCheckPermissions(false)\n            handleApiError(error, formikValues, formikHelpers)\n          },\n        }\n      )\n    } else {\n      handlePublishBridge(formikValues, formikHelpers)\n    }\n  }\n\n  // when bridge is published we check the status and is 200\n  const publishedBridgeReponse = publishBridgeResponse?.data\n  const isUserPro = user?.pricing.cbPlanId.split('_')[0] === 'pro'\n\n  useEffect(() => {\n    if (publishedBridgeReponse && publishedBridgeReponse.result) {\n      // bridge has been published, we can redirect the user\n      const firstBridge = publishedBridgeReponse.firstBridge && isUserPro\n      const step3State: NbeeStepCompletedState = { success: true, firstBridge }\n      history.push(appRoutes.nbeeStep3.makeUrl(bridgeId.toString()), step3State)\n    }\n  }, [publishedBridgeReponse])\n\n  return apiError ? (\n    <NbeeError\n      activeStepIndex={1}\n      bridgeId={bridgeId}\n      errorCode={parseApiError(apiError).code}\n      statusCode={parseApiError(apiError).status}\n      errorMessage={parseApiError(apiError).message}\n    />\n  ) : isLoadingAll || !fieldsMappingMatched ? (\n    <LoadingStep\n      activeStepIndex={1}\n      bridgeId={bridgeId}\n      loadingText={\n        isRunningPermissionChecks\n          ? t('nbee.bridgeBuilder.permissionCheckLoadingMessage')\n          : t('nbee.bridgeBuilder.step2LoadingMessage')\n      }\n    />\n  ) : allDataReady && initialValues && allBridgeFields ? (\n    <FieldsMappingForm\n      showWelcomeMessage={showWelcomeMessage}\n      bridgeId={bridgeId}\n      key={`${initialValues.source.appId}-${initialValues.destination.appId}`}\n      isSavingApi={isUpdatingBridge || isPublishingBridge}\n      initialValues={initialValues}\n      allBridgeFields={allBridgeFields.data}\n      bridgeFilterRulesList={bridgeFilterRules}\n      onRefetchBridgeFormValues={onRefetchBridgeFormValues}\n      availablePermissionChecks={availablePermissionChecks}\n      onSubmit={(formValues, formikHelpers) => {\n        const updateBridgeData = transformBridgeFormValuesToApiSaveBridgeBody(\n          formValues,\n          { step: 2 }\n        )\n        updateBridge(\n          {\n            bridgeData: updateBridgeData,\n            bridgeId: `${bridgeId}`,\n          },\n          {\n            onSuccess: () =>\n              handleUpdateBridgeSuccess(formValues, formikHelpers),\n            onError: (error) =>\n              handleApiError(error, formValues, formikHelpers),\n          }\n        )\n      }}\n    />\n  ) : null\n}\n","import React, { useEffect, useState } from 'react'\nimport { StepCompleted } from '@features/nbee/StepCompleted'\nimport { useLocation, useParams } from 'react-router-dom'\nimport { useGetBridgeById } from '@app/api/getBridgeById'\nimport { LoadingStep } from '@features/nbee/LoadingStep'\nimport { NbeeError } from '@features/nbee/NbeeError'\nimport { parseApiError } from '@app/api/utils/error'\nimport { useFetchConnectedApps } from '@app/api/getConnectedApps'\nimport { useGetRedirectUriBySourceAndDestination } from '@app/api/getRedirectUriBySourceAndDestination'\nimport { handlePerformanceBoosterRedirectUri } from '@features/nbee/StepCompleted/handlePerformanceBoosterRedirectUri'\n\nexport type NbeeStepCompletedState = {\n  success: boolean\n  firstBridge?: boolean\n}\n\nexport const Step3: React.VFC = () => {\n  const { bridgeId }: { bridgeId: string } = useParams()\n  const { state } = useLocation<NbeeStepCompletedState>()\n\n  const {\n    data: bridgeFormValues,\n    isLoading: isLoadingBridge,\n    error: errorGettingBridge,\n  } = useGetBridgeById(bridgeId)\n\n  // we need for app full names\n  const { data: connectedApps, isLoading: isLoadingConnectedApps } =\n    useFetchConnectedApps()\n\n  // if (!state?.success) {\n  //   // we are not allowing user seeing this page without coming from a step2\n  //   // where set the location state `success` as true\n  //   return <Redirect to={appRoutes.nbeeStep2.makeUrl(bridgeId)} />\n  // }\n\n  const sourceId = bridgeFormValues?.source.appId\n  const destinationId = bridgeFormValues?.destination.appId\n  const sourceAppName = sourceId\n    ? (connectedApps || []).find(({ id }) => id === sourceId)?.name\n    : undefined\n  const destinationAppName = sourceId\n    ? (connectedApps || []).find(({ id }) => id === destinationId)?.name\n    : undefined\n\n  const {\n    performanceBoosterAvailable,\n    errorGettingPerformanceBooster,\n    existingPerformanceBoosterAvailable,\n    existingPbId,\n  } = handlePerformanceBoosterRedirectUri({\n    bridgeId,\n    destinationId,\n    sourceId,\n  })\n\n  const IsTestEnableProp = bridgeFormValues?.ui?.testEnabled\n\n  const { data: redirectUri, isLoading: isLoadingBridgeUri } =\n    useGetRedirectUriBySourceAndDestination(sourceId, destinationId)\n\n  const isLoadingAll =\n    isLoadingBridge || isLoadingConnectedApps || isLoadingBridgeUri\n\n  return isLoadingAll ? (\n    <LoadingStep activeStepIndex={2} />\n  ) : bridgeFormValues && connectedApps && redirectUri ? (\n    <StepCompleted\n      bridgeId={bridgeId}\n      bridgeName={bridgeFormValues.name}\n      sourceName={sourceAppName}\n      destinationName={destinationAppName}\n      redirectUri={redirectUri?.uri}\n      isTestEnabledProp={IsTestEnableProp}\n      performanceBoosterAvailable={performanceBoosterAvailable}\n      errorPerformanceBooster={errorGettingPerformanceBooster}\n      existingPerformanceBoosterAvailable={existingPerformanceBoosterAvailable}\n      existingPbId={existingPbId}\n    />\n  ) : errorGettingBridge ? (\n    <NbeeError\n      activeStepIndex={2}\n      errorCode={parseApiError(errorGettingBridge).code}\n      statusCode={parseApiError(errorGettingBridge).status}\n      errorMessage={parseApiError(errorGettingBridge).message}\n    />\n  ) : null\n}\n","import React from 'react'\n\nconst Page404: React.FC = () => {\n  return <div>404</div>\n}\n\nexport default Page404\n","import React, { useEffect, useState } from 'react'\nimport { Dimmer, Loader, Segment } from 'semantic-ui-react'\nimport QueryString from 'querystring'\nimport axios from 'axios'\nimport { Auth } from 'aws-amplify'\nimport AuthService from '../services/AuthService'\nimport { Link } from 'react-router-dom'\n\nconst SamlRedirect: React.FC = () => {\n  const [loading, setLoading] = useState(true)\n  const [loginError, setLoginError] = useState('')\n\n  useEffect(() => {\n    const handleSamlLogin = async () => {\n      const params = QueryString.parse(window.location.search.slice(1))\n      const samlProvider = sessionStorage.getItem('saml-provider')\n\n      if (!params.code || !samlProvider) {\n        setLoginError('Missing code or provider name')\n        return\n      }\n\n      const redirect_uri = `${process.env.REACT_APP_SAML_REDIRECT_URL}`\n      const body = new URLSearchParams()\n      body.append('grant_type', 'authorization_code')\n      body.append('client_id', process.env.REACT_APP_USER_POOL_WEB_CLIENT_ID!)\n      body.append('redirect_uri', redirect_uri)\n      body.append('code', params.code.toString())\n\n      try {\n        // checking if user exists in cognito\n        const responseCognito = await axios.post<{ access_token: string }>(\n          `${process.env.REACT_APP_COGNITO_URL}.amazoncognito.com/oauth2/token`,\n          body,\n          {\n            headers: {\n              'Content-Type': 'application/x-www-form-urlencoded',\n            },\n          }\n        )\n        const accessToken = responseCognito.data.access_token\n        if (!accessToken) {\n          setLoginError('Missing access token from cognito oauth2')\n          return\n        }\n\n        // login user in our backend\n        const responseHandleSamlUser = await axios.post<{\n          username: string\n          password: string\n        }>(\n          process.env.REACT_APP_V1_API + '/auth/v2/handleSamlUser',\n          {\n            provider: samlProvider,\n          },\n          {\n            headers: { access_token: accessToken },\n          }\n        )\n        const { username, password } = responseHandleSamlUser.data\n        if (!username || !password) {\n          setLoginError('We could not find your user in our system')\n          return\n        }\n\n        const signInResponse = await Auth.signIn({\n          username,\n          password,\n          validationData: [],\n        })\n\n        // setting cookies and other login stuff\n        if (signInResponse) {\n          AuthService.onLogin(false)\n          // we give some time to onLogin, before redirecting user to app\n          setTimeout(() => {\n            window.location.replace(process.env.REACT_APP_V1_URL || '/')\n          }, 500)\n        } else {\n          setLoginError(\n            'Login failed: we could validate your SAML session, but it seems we failed to create a valid session for your user'\n          )\n          return\n        }\n      } catch (err) {\n        if (axios.isAxiosError(err)) {\n          const message = err.response?.data?.message || err.message\n          setLoginError(message)\n        } else if (err instanceof Error) {\n          setLoginError(err.message)\n        }\n      }\n    }\n\n    handleSamlLogin()\n  }, [])\n\n  useEffect(() => {\n    if (loginError) {\n      setLoading(false)\n    }\n  }, [loginError])\n\n  return (\n    <div>\n      {loading ? (\n        <Segment style={{ minHeight: '100vh' }}>\n          <Dimmer active={true} inverted>\n            <Loader inverted>Loading</Loader>\n          </Dimmer>\n        </Segment>\n      ) : (\n        <div className={'ui negative message text-center'}>\n          {/* TODO: add valid UI */}\n          <i\n            className={'exclamation triangle large icon'}\n            style={{ marginBottom: '1rem' }}\n          />\n          <div className='header' style={{ marginBottom: '1rem' }}>\n            {loginError}\n          </div>\n          {/* <p className={'input-error'}>SAML authentication failed</p> */}\n          <Link to={'/saml'}>Login again</Link>\n        </div>\n      )}\n    </div>\n  )\n}\n\nexport default SamlRedirect\n// https://localhost/auth/redirect?code=35a1770f-3369-4af7-818e-4fc73628e54c\n","import React from 'react'\n\nexport const TestComponents: React.FC = () => {\n  // Check if the current hostname matches the production domain\n  const isProduction = window.location.hostname === 'app.leadsbridge.com'\n\n  if (isProduction) {\n    // Prevent this page from appearing in production :)\n    return null\n  }\n\n  return (\n    <div>\n      <iframe\n        width='1200'\n        height='800'\n        src='https://stage-app.leadsbridge.com/bc/tt/tiktok-lead-generation/zoho-crm'\n        title='leadsbridge'\n      />\n    </div>\n  )\n}\n","import { BbuRouteParams, BridgeChooserStep2RouteParams } from 'LeadsBridgeApp'\n\nconst nbeeBasePath = 'nbee'\n\nexport default {\n  nbee: {\n    path: `/${nbeeBasePath}`,\n    makeUrl: () => `/${nbeeBasePath}`,\n  },\n  nbeeBridgeChooserStep1: {\n    path: `/${nbeeBasePath}/bridge`,\n    makeUrl: () => `/${nbeeBasePath}/bridge`,\n  },\n  nbeeBridgeChooserStep2: {\n    path: `/${nbeeBasePath}/bridge/select-editor/:sourceAppId/:destinationAppId`,\n    makeUrl: ({\n      sourceAppId,\n      destinationAppId,\n    }: BridgeChooserStep2RouteParams) =>\n      `/${nbeeBasePath}/bridge/select-editor/${sourceAppId}/${destinationAppId}`,\n  },\n  nbeeStep1New: {\n    path: `/${nbeeBasePath}/bridge/new`,\n    makeUrl: () => `/${nbeeBasePath}/bridge/new`,\n  },\n  nbeeAppBbu: {\n    path: `/bc/app/:source/:destination`,\n    makeUrl: ({ source, destination }: BbuRouteParams) =>\n      `/bc/app/${source}/${destination}`,\n  },\n  nbeeStep1Edit: {\n    path: `/${nbeeBasePath}/bridge/edit/:bridgeId`,\n    makeUrl: (bridgeId: string) => `/${nbeeBasePath}/bridge/edit/${bridgeId}`,\n  },\n  nbeeStep2: {\n    path: `/${nbeeBasePath}/bridge/fields-mapping/:bridgeId`,\n    makeUrl: (bridgeId: string) =>\n      `/${nbeeBasePath}/bridge/fields-mapping/${bridgeId}`,\n  },\n  nbeeStep3: {\n    path: `/${nbeeBasePath}/bridge/status/:bridgeId`,\n    makeUrl: (bridgeId: string) => `/${nbeeBasePath}/bridge/status/${bridgeId}`,\n  },\n  nbeeInfoPage: {\n    path: `/${nbeeBasePath}/bridge/status/info`,\n    makeUrl: () => `/${nbeeBasePath}/bridge/status/info`,\n  },\n}\n","import {\n  IncomingDataParams,\n  IntegrationCredentialEditParams,\n  IntegrationCredentialParams,\n} from 'LeadsBridgeApp'\n\nconst integrationPath = 'integration'\n\nexport default {\n  integration: {\n    path: `/${integrationPath}`,\n    makeUrl: ({ appId }: IntegrationCredentialParams) =>\n      `/${integrationPath}/credentials/${appId}/new`,\n  },\n  integrationAuthScreen: {\n    path: `/${integrationPath}/credentials/:appId/new`,\n    makeUrl: ({ appId }: IntegrationCredentialParams) =>\n      `/${integrationPath}/credentials/${appId}/new`,\n  },\n  integrationAuthScreenEdit: {\n    path: `/${integrationPath}/credentials/:appId/edit/:integrationId`,\n    makeUrl: ({ integrationId, appId }: IntegrationCredentialEditParams) =>\n      `/${integrationPath}/credentials/${appId}/edit/${integrationId}`,\n  },\n  integrationAuthScreenEditWithBridgeId: {\n    path: `/${integrationPath}/credentials/:appId/edit/:integrationId/bridge/:bridgeId`,\n    makeUrl: ({\n      integrationId,\n      appId,\n      bridgeId,\n    }: IntegrationCredentialEditParams) =>\n      `/${integrationPath}/credentials/${appId}/edit/${integrationId}/bridge/${bridgeId}`,\n  },\n  integrationAuthScreenEditStep2: {\n    path: `/${integrationPath}/credentials/:appId/edit/:integrationId/save`,\n    makeUrl: ({ integrationId, appId }: IntegrationCredentialEditParams) =>\n      `/${integrationPath}/credentials/${appId}/edit/${integrationId}/save`,\n  },\n  integrationAuthScreenCallback: {\n    path: `/${integrationPath}/oauth/callback`,\n    makeUrl: () => `/${integrationPath}/oauth/callback`,\n  },\n\n  // NEW OAUTH ROUTE\n  integrationAuthScreenCallback2: {\n    path: `/${integrationPath}/oauth2/callback`,\n    makeUrl: () => `/${integrationPath}/oauth2/callback`,\n  },\n\n  // Incoming data routes\n  incomingData: {\n    path: `/${integrationPath}/incoming-data`,\n    makeUrl: () => `/${integrationPath}/incoming-data`,\n  },\n\n  incomingDataScreen: {\n    path: `/${integrationPath}/incoming-data/:appId/new/:integrationId`,\n    makeUrl: ({ appId, integrationId }: IncomingDataParams) =>\n      `/${integrationPath}/incoming-data/${appId}/new/${integrationId}`,\n  },\n  incomingDataScreenEdit: {\n    path: `/${integrationPath}/incoming-data/:appId/edit/:integrationId`,\n    makeUrl: ({ appId, integrationId }: IncomingDataParams) =>\n      `/${integrationPath}/incoming-data/${appId}/edit/${integrationId}`,\n  },\n  incomingDataScreenFields: {\n    path: `/${integrationPath}/incoming-data/:appId/fields/:integrationId?`,\n    makeUrl: ({ appId, integrationId }: IncomingDataParams) =>\n      `/${integrationPath}/incoming-data/${appId}/fields/${integrationId}?`,\n  },\n\n  incomingDataScreenSave: {\n    path: `/${integrationPath}/incoming-data/:appId/save/:integrationId?`,\n    makeUrl: ({ appId, integrationId }: IncomingDataParams) =>\n      `/${integrationPath}/incoming-data/${appId}/save/${integrationId}`,\n  },\n}\n","import { ThankYouPageState } from '@app/pages/ThankYouPage'\n\nexport default {\n  pricing: {\n    path: `/pricing`,\n    makeUrl: () => `/pricing`,\n    makeUrlWithState: (reasonId?: string, minimumPlanRequired?: number) => ({\n      pathname: '/pricing/',\n      search:\n        reasonId && minimumPlanRequired\n          ? `reason=${reasonId}&suggestPlan=${minimumPlanRequired}`\n          : '',\n    }),\n  },\n  checkout: {\n    path: `/checkout`,\n    makeUrl: (planId?: string) => `/checkout${planId ? `/?pid=${planId}` : ''}`,\n  },\n  checkoutThankYouPage: {\n    path: `/checkout/success`,\n    makeUrl: (state: ThankYouPageState) => ({\n      pathname: `/checkout/success`,\n      state: state,\n    }),\n  },\n}\n","export default {\n  fbe: {\n    path: `/fbe`,\n    makeUrl: () => `/fbe`,\n  },\n  fbeCallback: {\n    path: `/fbe/callback`,\n    makeUrl: () => `/fbe/callback`,\n  },\n  fbAppStore: {\n    path: `/fbAppStore`,\n    makeUrl: () => `/fbAppStore`,\n  },\n  fbAppStoreDone: {\n    path: `/fbAppStore/done`,\n    makeUrl: () => `/fbAppStore/done`,\n  },\n}\n","export const serializeQueryString = function ({\n  obj,\n  prefix,\n}: {\n  obj: Record<string, any>\n  prefix?: string\n}): string {\n  const str = []\n  let p\n  for (p in obj) {\n    // eslint-disable-next-line no-prototype-builtins\n    if (obj.hasOwnProperty(p)) {\n      const k = prefix ? prefix + '[' + p + ']' : p\n      const v = obj[p]\n      str.push(\n        v !== null && typeof v === 'object'\n          ? serializeQueryString({\n              obj: v,\n              prefix: k,\n            })\n          : encodeURIComponent(k) + '=' + encodeURIComponent(v)\n      )\n    }\n  }\n  return str.join('&')\n}\n","import { BbuRouteParams, LogoutRouteParams } from 'LeadsBridgeApp'\nimport { serializeQueryString } from '@app/utils/seralizeQueryString'\n\nexport const signinBasePath = 'signin'\n\nexport const makeQueryStringForLogout = ({\n  redirectTo,\n  toastMessage,\n}: LogoutRouteParams) => {\n  // prepare path, if `redirectTo` exists or we set empty object\n  const path = redirectTo ? { path: redirectTo } : {}\n\n  // prepare message object ore return empty one is toast is not passed\n  const message =\n    toastMessage && toastMessage.message\n      ? {\n          message: btoa(JSON.stringify(toastMessage)),\n        }\n      : {}\n\n  // we serialize our objects into a query string\n  const serializedQs = serializeQueryString({\n    obj: {\n      ...path,\n      ...message,\n    },\n  })\n  return serializedQs ? `?${serializedQs}` : ''\n}\n\nexport default {\n  signup: {\n    path: `/signup`,\n    makeUrl: () => `/signup`,\n  },\n  signupBbu: {\n    path: `/bc/lb/:source/:destination`,\n    makeUrl: ({\n      source,\n      destination,\n    }: {\n      source: string\n      destination: string\n    }) => `/bc/lb/${source}/${destination}`,\n  },\n  signupBbuFallbackSurvey: {\n    path: `/signup-survey/:partnerName/:source/:destination`,\n    makeUrl: ({ partnerName, source, destination }: BbuRouteParams) =>\n      `/signup-survey/${partnerName}/${source}/${destination}`,\n  },\n  signupPartner: {\n    path: `/deals/:partner/:couponCode?`,\n    makeUrl: () => `/deals/:partner/:couponCode`,\n  },\n  signin: {\n    path: `/${signinBasePath}`, // --> /signin\n    makeUrl: () => `/${signinBasePath}`,\n  },\n  forgotPassword: {\n    path: `/${signinBasePath}/forgotpassword`,\n    makeUrl: () => `/${signinBasePath}/forgotpassword`,\n  },\n  changePassword: {\n    path: `/changepassword`,\n    makUrl: () => `/changepassword`,\n  },\n  saml: {\n    path: `/${signinBasePath}/saml`,\n    makeUrl: () => `/${signinBasePath}/saml`,\n  },\n  samlRedirect: {\n    path: `/auth/redirect`,\n    makeUrl: () => `/auth/redirect`,\n  },\n  logout: {\n    path: `/logout`,\n    makeUrl: ({ redirectTo, toastMessage }: LogoutRouteParams) => {\n      const queryString = makeQueryStringForLogout({ redirectTo, toastMessage })\n      return `/logout${queryString ? `?${queryString}` : ''}`\n    },\n  },\n}\n","import {\n  GoogleAdsAccountRouteParams,\n  IntegrationCredentialEditParams,\n} from 'LeadsBridgeApp'\n\nexport default {\n  googleAdsAccountFormCreate: {\n    path: `/google-ads-account/create`,\n    makeUrl: () => `/google-ads-account/create`,\n  },\n\n  googleAdsAccountFormCreated: {\n    path: `/google-ads-account/create/:customerId`,\n    makeUrl: ({ customerId }: GoogleAdsAccountRouteParams) =>\n      `/google-ads-account/create/${customerId}`,\n  },\n  googleAdsAccountActivate: {\n    path: `/google-ads-account/activate`,\n    makeUrl: () => `/google-ads-account/activate`,\n  },\n  googleAdsAccountConnect: {\n    path: `/google-ads-account/connect`,\n    makeUrl: () => `/google-ads-account/connect`,\n  },\n}\n","const adminPath = 'admin-private'\n\nexport default {\n  adminPrivateRoot: {\n    path: `/${adminPath}`,\n    makeUrl: () => `/${adminPath}`,\n  },\n  adminPrivateValidateFbToken: {\n    path: `/${adminPath}/validate-facebook-token`,\n    makeUrl: () => `/${adminPath}/validate-facebook-token`,\n  },\n}\n","import nbeeRoutes from '@app/routes/byFeature/nbee'\nimport integrationRoutes from '@app/routes/byFeature/integration'\nimport billingRoutes from '@app/routes/byFeature/billing'\nimport bbuRoutes from '@app/routes/byFeature/bbu'\nimport facebookRoutes from '@app/routes/byFeature/facebook'\nimport authRoutes from '@app/routes/byFeature/auth'\nimport googleAdsAccountRoutes from '@app/routes/byFeature/googleAdsAccount'\nimport adminRoutes from '@app/routes/byFeature/admin'\n\n// How to use routes:\n// When patter matching is required (eg: react router <Route path='..'>) use appRoutes.<routeName>.path\n// When you need to render the url (eg: <Link to='..' >, then use the appRoutes.<routeName>.markeUrl()\nexport const appRoutes = {\n  ...authRoutes, // signin, signup, saml, etc...\n  ...bbuRoutes, // bbu and callbacks\n  ...facebookRoutes, // Fbe and AppStore\n  ...nbeeRoutes,\n  ...googleAdsAccountRoutes, // Google Ads Account Feature\n  ...integrationRoutes,\n  ...billingRoutes,\n  ...adminRoutes,\n}\n\nexport const bridgeBuilderStep1Paths = [\n  appRoutes.nbeeStep1New.path,\n  appRoutes.nbeeStep1Edit.path,\n  appRoutes.nbeeAppBbu.path,\n  appRoutes.signupBbu.path,\n]\n\n// this is meant to be used to match path for bbu parter only BBUs.\n// Example /bc/fb or /ebc/fc, but not to be used for /bc/lb/ since /lb/ is not a partner\nexport const bridgeByUrlPartnersPaths = [\n  appRoutes.bridgeByUrl.path,\n  appRoutes.bridgeByUrlEmbedded.path,\n]\n","import { BbuCallbackRouteParams, BbuRouteParams } from 'LeadsBridgeApp'\n\nexport default {\n  bridgeByUrl: {\n    path: '/bc/:partnerName/:source?/:destination?',\n    makeUrl: ({ partnerName, source, destination }: BbuRouteParams) =>\n      `/bc/${partnerName}/${source}/${destination}`,\n  },\n  bridgeByUrlEmbedded: {\n    path: '/ebc/:partnerName/:source?/:destination?',\n    makeUrl: ({ partnerName, source, destination }: BbuRouteParams) =>\n      `/ebc/${partnerName}/${source}/${destination}`,\n  },\n  bridgeByUrlCallback: {\n    path: '/auth/:partnerFullName/callback',\n    makeUrl: ({ partnerFullName }: BbuCallbackRouteParams) =>\n      `/auth/${partnerFullName}/callback`,\n  },\n}\n","import { axiosInterceptor } from './axiosInterceptor'\nimport axios, { AxiosInstance, AxiosResponse } from 'axios'\nimport { FacebookParameters } from 'LeadsBridgeApp'\n\nexport default class LoginV1Service {\n  public static authorizeUrl: string = '/auth/v2/initUser'\n  public static handleFbeParametersUrl: string = '/fbe/v2/handleFbeParameters'\n  public static setupInstanceUrl: string = '/fbe/v2/setupInstance'\n  public static fbeCancelUrl: string = '/fbe/v2/fbeCancel'\n  public static evoToken: string = '/auth/v2/evoToken'\n\n  static authorize = async (): Promise<{}> => {\n    return await axiosInterceptor().then((ax: AxiosInstance) => {\n      return ax\n        .post(process.env.REACT_APP_V1_API + LoginV1Service.authorizeUrl, {})\n        .then((res: AxiosResponse) => {\n          return res.data\n        })\n        .catch((error) => {\n          return null\n        })\n    })\n  }\n\n  static facebookParameters = async (\n    flowType: string,\n    instanceId: string,\n    url: string\n  ): Promise<FacebookParameters> => {\n    return await axiosInterceptor().then((ax: AxiosInstance) => {\n      return ax\n        .post(\n          process.env.REACT_APP_V1_API + LoginV1Service.handleFbeParametersUrl,\n          {\n            flowType: flowType,\n            instanceId: instanceId,\n            requestUri: url,\n          }\n        )\n        .then((res: AxiosResponse) => {\n          return res.data\n        })\n    })\n  }\n\n  // test deploy\n  static setupInstance = async (\n    data: Record<string, unknown>\n  ): Promise<{ callbackPath: string }> => {\n    return await axiosInterceptor().then((ax: AxiosInstance) => {\n      return ax\n        .post(\n          process.env.REACT_APP_V1_API + LoginV1Service.setupInstanceUrl,\n          data\n        )\n        .then((res: AxiosResponse) => {\n          return res.data\n        })\n    })\n  }\n\n  static fbeCancel = async (data: object): Promise<{}> => {\n    return await axiosInterceptor().then((ax: AxiosInstance) => {\n      return ax\n        .post(process.env.REACT_APP_V1_API + LoginV1Service.fbeCancelUrl, data)\n        .then((res: AxiosResponse) => {\n          return res.data\n        })\n    })\n  }\n\n  static setupSessionCookie = async (\n    jwt: string, domain: string\n  ): Promise<{ callbackPath: string }> => {\n      return await axios.post(process.env.REACT_APP_V1_API + LoginV1Service.evoToken,\n          {\n              token: jwt,\n              domain: domain\n          },\n          { withCredentials: true })\n          .then((res) => {\n              return res.data\n          }).catch((error) => {\n              return null\n          })\n  }\n\n  static cancelSessionCookie = async (domain: string): Promise<{ callbackPath: string }> => {\n      return await axios.delete(process.env.REACT_APP_V1_API + LoginV1Service.evoToken, { data: {domain: domain}, withCredentials: true })\n          .then((res) => {\n              return res.data\n          }).catch((error) => {\n              return null\n          })\n  }\n}\n","import * as React from 'react'\nimport { Hub } from '@aws-amplify/core'\nimport {\n  AUTH_STATE_CHANGE_EVENT,\n  AuthState,\n  UI_AUTH_CHANNEL,\n} from '@aws-amplify/ui-components'\nimport { doPostMessage, Messages } from '../utils/PostMessages'\nimport { Auth } from 'aws-amplify'\nimport Cookies from 'universal-cookie'\nimport { PersistentCookiesKeys } from '@app/enums/persistentCookiesKeys'\nimport LoginV1Service from '@app/services/ApplicationV1Bridge'\nimport { AppDispatch } from '@app/index'\nimport { setTrackSignIn } from '@app/store/actions/ApplicationConfigurationActions'\n\nimport { endpoints } from '@app/api/config'\nimport { apiAuthClient } from '@app/services/apiAuthClient'\nimport axios from 'axios'\n\nconst persistAuthExpiration = () => {\n  const date = new Date()\n  localStorage.setItem(\n    'auth-expiration',\n    String(date.setDate(date.getDate() + 1))\n  )\n}\n\nexport default class AuthService {\n  static setCsrfCookie = async (token: string) => {\n    await axios.post(\n      endpoints.csrf,\n      {},\n      {\n        headers: {\n          Authorization: `Bearer ${token}`,\n        },\n        withCredentials: true,\n      }\n    )\n  }\n\n  static setSessionCookie = async () => {\n    await Auth.currentSession().then(async (session: any) => {\n      const accessToken = session.getAccessToken()\n      const jwt = accessToken.getJwtToken()\n      // set now csrf cookie as well\n      await LoginV1Service.setupSessionCookie(\n        jwt,\n        process.env.REACT_APP_V1_COOKIE_DOMAIN ?? ''\n      )\n      await AuthService.setCsrfCookie(jwt)\n    })\n  }\n\n  static onLogin = async (keepMeLogged: boolean, dispatch?: AppDispatch) => {\n    const urlPath: string = window.location.pathname\n    await AuthService.setSessionCookie()\n    // to be safe, every time an user does a login we delete the LB_imp cookie (SB-522)\n    const cookies = new Cookies()\n    cookies.remove(PersistentCookiesKeys.LbImp, {\n      path: '/',\n      domain: process.env.REACT_APP_V1_COOKIE_DOMAIN,\n    })\n\n    if (!keepMeLogged) {\n      persistAuthExpiration()\n    }\n    if (urlPath.includes('/fbAppStore')) {\n      doPostMessage(Messages.AppInvoked)\n      doPostMessage(Messages.UserLogged)\n    }\n    Hub.dispatch(UI_AUTH_CHANNEL, {\n      event: AUTH_STATE_CHANGE_EVENT,\n      message: AuthState.SignedIn,\n      data: null,\n    })\n    if (dispatch) {\n      dispatch(setTrackSignIn(true))\n    }\n  }\n\n  static onLoginAsync = async (\n    keepMeLogged: boolean,\n    dispatch?: AppDispatch\n  ) => {\n    return await AuthService.setSessionCookie().then(() => {\n      if (!keepMeLogged) {\n        persistAuthExpiration()\n      }\n      Hub.dispatch(UI_AUTH_CHANNEL, {\n        event: AUTH_STATE_CHANGE_EVENT,\n        message: AuthState.SignedIn,\n        data: null,\n      })\n      if (dispatch) {\n        dispatch(setTrackSignIn(true))\n      }\n    })\n  }\n}\n","import axios, { AxiosResponse } from 'axios'\n\nexport type CognitoProvider = {\n  CreationDate: string\n  LastModifiedDate: string\n  ProviderName: string\n  ProviderType: string\n}\n\nexport default class CognitoApiService {\n  public static federatedToCognitoUrl: string =\n    '/federated/federatedToCognitoUser'\n\n  public static describeIdentityProviderUrl: string =\n    '/cognitoAPI/DescribeIdentityProvider'\n\n  public static listIdentityProvidersUrl: string =\n    '/cognitoAPI/ListIdentityProviders'\n\n  static listIdentityProviders = async (): Promise<{\n    Providers: CognitoProvider[]\n  }> => {\n    return await axios\n      .get(\n        process.env.REACT_APP_LAMBDA_GATEWAY_API +\n          CognitoApiService.listIdentityProvidersUrl\n      )\n      .then((res: AxiosResponse) => {\n        return res.data\n      })\n  }\n\n  static describeIdentityProvider = async (name: string): Promise<any[]> => {\n    return await axios\n      .post(\n        process.env.REACT_APP_LAMBDA_GATEWAY_API +\n          CognitoApiService.describeIdentityProviderUrl,\n        { name: name }\n      )\n      .then((res: AxiosResponse) => {\n        return res.data\n      })\n  }\n\n  static federatedToCognito = async (\n    token: string,\n    provider: 'FACEBOOK' | 'GOOGLE',\n    email: string,\n    requestUri: string\n  ): Promise<any> => {\n    return await axios\n      .post(\n        process.env.REACT_APP_LAMBDA_GATEWAY_API +\n          CognitoApiService.federatedToCognitoUrl,\n        {\n          id_token: token,\n          provider: provider,\n          email: email,\n          requestUri: requestUri,\n        }\n      )\n      .then((res: AxiosResponse) => {\n        return res.data\n      })\n  }\n}\n","import { Auth } from 'aws-amplify'\nimport CognitoApiService from './CognitoApiService'\nimport { sendToast } from '../store/actions/ApplicationConfigurationActions'\nimport AuthService from './AuthService'\n\nexport default class FacebookService {\n  static initFB = () => {\n    const fb = window.FB\n    // @ts-ignore\n    // console.log('FB SDK initialized');\n  }\n\n  static fbAsyncInit = () => {\n    // init the fb sdk client\n    const fb = window.FB\n    fb.init({\n      appId: '939660826071336',\n      cookie: true,\n      xfbml: true,\n      version: 'v2.11',\n    })\n  }\n\n  static createScriptFb = () => {\n    // load the sdk\n    // @ts-ignore\n    window.fbAsyncInit = FacebookService.fbAsyncInit\n    const script = document.createElement('script')\n    script.src = 'https://connect.facebook.net/en_US/sdk.js'\n    script.async = true\n    script.onload = FacebookService.initFB\n    document.body.appendChild(script)\n  }\n\n  // ASYNC\n  // static createScriptFbAsync = () =>\n  //   new Promise((resolve) => {\n  //     // load the sdk\n  //     const script = document.createElement('script')\n  //     script.src = 'https://connect.facebook.net/en_US/sdk.js'\n  //     script.async = true\n  //     script.onload = () => {\n  //       FacebookService.fbAsyncInit()\n  //       resolve(null)\n  //     }\n  //     document.body.appendChild(script)\n  //   })\n\n  // ASYNC\n  // static getAccessTokenAsync = (): Promise<string> =>\n  //   new Promise((resolve) => {\n  //     const fb = window.FB\n  //     fb.Event.subscribe('auth.authResponseChange', (response) => {\n  //       console.log('response')\n  //       const fbAccessToken = response.authResponse?.accessToken\n  //       if (fbAccessToken) {\n  //         // if `accessToken` exists we need to pass it to backend api\n  //         resolve(fbAccessToken)\n  //       }\n  //     })\n  //   })\n\n  static getAWSCredentials = async (\n    response: any,\n    location: any,\n    dispatch: any\n  ) => {\n    return new Promise((resolve, reject) => {\n      const { accessToken, expiresIn } = response\n      const date = new Date()\n      const expires_at = expiresIn * 1000 + date.getTime()\n      if (!accessToken) {\n        return\n      }\n      // @ts-ignore\n      const fb = window.FB\n      // todo account id\n      fb.api('/me', { fields: 'name,email' }, async (response: any) => {\n        const user = {\n          name: response.name,\n          email: response.email,\n        }\n\n        await CognitoApiService.federatedToCognito(\n          accessToken,\n          'FACEBOOK',\n          user.email,\n          window.location.href\n        )\n          .then((r: any) => {\n            const username = user.email\n            const password = r.password\n            Auth.signIn({\n              username,\n              password,\n              validationData: [],\n            }).then((user) => {\n              AuthService.onLogin(false, dispatch)\n            })\n          })\n          .catch((err) => {\n            // console.log('Err');\n            if (err.response.status === 400) {\n              dispatch(\n                sendToast({\n                  title: 'Cannot login',\n                  messages: [\n                    'You are registered without a social account. Log in with your account credentials.',\n                  ],\n                  color: 'warning',\n                })\n              )\n              reject()\n            } else {\n              dispatch(\n                sendToast({\n                  title: 'Error',\n                  messages: [\n                    err.response?.data ? err.response.data : 'Unknown error',\n                  ],\n                  color: 'negative',\n                })\n              )\n              reject()\n            }\n          })\n      })\n    })\n  }\n\n  static signInWithFacebook = async (location: any, dispatch: any) => {\n    return new Promise((resolve, reject) => {\n      // @ts-ignore\n      const fb = window.FB\n      fb.getLoginStatus(async (response: any) => {\n        if (response.status === 'connected') {\n          // console.log('response status === connected');\n          FacebookService.getAWSCredentials(\n            response.authResponse,\n            location,\n            dispatch\n          ).finally(() => resolve(true))\n        } else {\n          // console.log('response status:', response.status);\n          await fb.login(\n            async (response: any) => {\n              if (!response || !response.authResponse) {\n                reject()\n                return\n              }\n              // console.log('facebook auth response', response.authResponse);\n              FacebookService.getAWSCredentials(\n                response.authResponse,\n                location,\n                dispatch\n              ).finally(() => resolve(true))\n            },\n            {\n              // the authorized scopes\n              scope: 'public_profile,email',\n            }\n          )\n        }\n      })\n    })\n  }\n}\n","import axios from 'axios'\nimport {\n  getCognitoPersistentSession,\n  fetchAndPersistCognitoSession,\n} from '@app/services/apiAuthClient/utils'\nimport { appRoutes } from '@app/routes'\nimport { isDebug } from '@app/utils/envUtils'\nimport Cookies from 'universal-cookie'\nimport { PersistentCookiesKeys } from '@app/enums/persistentCookiesKeys'\nimport { matchPath } from 'react-router'\n\nexport const apiAuthClient = axios.create()\n\n// Sign outgoing requests\napiAuthClient.interceptors.request.use(async (config) => {\n  // getting cognito session from cache (cookie).\n  // If no cache is found, we call cognito sdk endpoints and cache it\n  const cognitoSessionData =\n    getCognitoPersistentSession() || (await fetchAndPersistCognitoSession())\n\n  if (!cognitoSessionData) {\n    // something is wrong with cognito session retrival, we can't enhance axios config\n    return config\n  }\n\n  // setting required axios headers\n  const { accessToken, deviceKey } = cognitoSessionData\n  config.headers.Authorization = `Bearer ${accessToken}`\n  config.headers['Content-Type'] = 'application/json'\n  config.headers['device-id'] = deviceKey\n  config.headers['mapping-version'] = '2'\n\n  // https://leadsbridge.atlassian.net/browse/SB-843\n  const match = matchPath<{ bridgeId?: string }>(window.location.pathname, {\n    path: [\n      appRoutes.nbeeStep1Edit.path,\n      appRoutes.nbeeStep2.path,\n      appRoutes.nbeeStep3.path,\n    ],\n    exact: true,\n    strict: false,\n  })\n  const bridgeId = match?.params?.bridgeId\n  if (bridgeId) {\n    config.headers['X-bridge-id'] = bridgeId\n  }\n\n  // user impersonification (SB-522)\n  const cookies = new Cookies()\n  const impValue = cookies.get(PersistentCookiesKeys.LbImp)\n  if (impValue) {\n    config.headers['X-logged-as-Id'] = impValue\n  }\n\n  return config\n})\n\n// Intercept incoming reponses\napiAuthClient.interceptors.response.use(undefined, (error) => {\n  // we might want to log user out from our app in case api returns 401 (unauthorized)\n  // I will keep this one disabled in development/debug\n  const currentPath = window.location.pathname\n  if (error.response?.status === 401) {\n    const logoutUrl = `${window.location.origin}${appRoutes.logout.makeUrl({\n      redirectTo: currentPath,\n      toastMessage: {\n        message: \"You've been logged out.\", // This is a placeholder message, it's handled by phrase in the logout page\n        type: 'positive',\n      },\n    })}`\n    window.location.assign(logoutUrl)\n  }\n\n  // return default axios error\n  return Promise.reject(error)\n})\n","import axios from 'axios'\n// import Cookies from 'universal-cookie'\n\nexport const apiPublicClient = axios.create()\n\napiPublicClient.interceptors.request.use(async (config) => {\n  config.headers['Content-Type'] = 'application/json'\n  // const cookies = new Cookies()\n  //\n  // const xsrfToken = cookies.get('XSRF-TOKEN')\n  // if (xsrfToken) {\n  //   config.headers['X-Xsrf-Token'] = xsrfToken\n  // }\n  return config\n})\n","import axios, { AxiosInstance, AxiosRequestConfig } from 'axios'\nimport { Auth } from 'aws-amplify'\nimport Cookies from 'universal-cookie'\nimport { PersistentCookiesKeys } from '@app/enums/persistentCookiesKeys'\n\nconst interceptor = axios.create({\n  baseURL: process.env.REACT_APP_V1_API,\n  timeout: 60000,\n})\n\nexport const axiosInterceptor = async (): Promise<AxiosInstance> => {\n  const { accessToken, expiration } = await Auth.currentSession().then(\n    (session) => {\n      const expiration = session.getIdToken().getExpiration()\n      const accessToken = session.getAccessToken()\n      const jwt = accessToken.getJwtToken()\n      return { accessToken: jwt, expiration: expiration }\n    }\n  )\n\n  const currentTimeSeconds = Math.round(+new Date() / 1000)\n  if (expiration < currentTimeSeconds) {\n    // console.log('token expired TODO REFRESH');\n  }\n\n  const exp: string | null = localStorage.getItem('auth-expiration')\n  if (exp) {\n    const date = new Date()\n    const date2 = Date.parse(exp)\n    if (date.getTime() >= date2) {\n      localStorage.clear()\n      await Auth.signOut()\n      return Promise.reject('Session Expired')\n    }\n  }\n\n  const user = await Auth.currentAuthenticatedUser().then((user) => {\n    return user\n  })\n  await user.getCachedDeviceKeyAndPassword()\n\n  interceptor.interceptors.request.use(\n    (config: AxiosRequestConfig) => {\n      config.headers.Authorization = `Bearer ${accessToken}`\n      config.headers['Content-Type'] = 'application/json'\n\n      // user impersonification (SB-522)\n      const cookies = new Cookies()\n      const impValue = cookies.get(PersistentCookiesKeys.LbImp)\n      if (impValue) {\n        config.headers['X-logged-as-Id'] = impValue\n      }\n\n      return config\n    },\n    (error) => {\n      return Promise.reject(error)\n    }\n  )\n\n  return interceptor\n}\n","import {\n  ApplicationConfigurationTypes,\n  CLOSE_ALERT_MESSAGE,\n  RESET_PATH,\n  SEND_ALERT_MESSAGE,\n  SEND_TOAST,\n  SET_LOGIN_LAYOUT,\n  TRIGGER_CONNECT_ACCOUNT_POPUP,\n  RESET_TRIGGER_CONNECT_ACCOUNT_POPUP,\n  SET_TRACK_SIGNIN,\n  SET_PATH,\n  TOGGLE_SIDEBAR,\n} from '../types/ApplicationConfigurationTypes'\nimport { Alert, Toast } from 'LeadsBridgeApp'\n\nexport const toggleVerticalSidebar = (): ApplicationConfigurationTypes => {\n  return {\n    type: TOGGLE_SIDEBAR,\n  }\n}\nexport function sendToast(toast: Toast): ApplicationConfigurationTypes {\n  return {\n    type: SEND_TOAST,\n    payload: toast,\n  }\n}\nexport function sendAlertMessage(\n  alertMessage: Alert\n): ApplicationConfigurationTypes {\n  return {\n    type: SEND_ALERT_MESSAGE,\n    payload: alertMessage,\n  }\n}\n\nexport const closeAlertMessage = (): ApplicationConfigurationTypes => {\n  return {\n    type: CLOSE_ALERT_MESSAGE,\n  }\n}\n\nexport const setLoginLayout = (\n  source: string\n): ApplicationConfigurationTypes => {\n  return {\n    type: SET_LOGIN_LAYOUT,\n    payload: source,\n  }\n}\n\nexport const setTrackSignIn = (\n  state: boolean\n): ApplicationConfigurationTypes => {\n  return {\n    type: SET_TRACK_SIGNIN,\n    payload: state,\n  }\n}\n\nexport const triggerConnectAccountPopup = (\n  integrationId: number\n): ApplicationConfigurationTypes => {\n  return {\n    type: TRIGGER_CONNECT_ACCOUNT_POPUP,\n    payload: integrationId,\n  }\n}\n\nexport const resetTriggerConnectAccountPopup =\n  (): ApplicationConfigurationTypes => {\n    return {\n      type: RESET_TRIGGER_CONNECT_ACCOUNT_POPUP,\n    }\n  }\n\nexport const setPath = (path: string): ApplicationConfigurationTypes => {\n  return {\n    type: SET_PATH,\n    payload: path,\n  }\n}\n\nexport const resetPath = (): ApplicationConfigurationTypes => {\n  return {\n    type: RESET_PATH,\n  }\n}\n","import { ApiIntegrationListenerStatus } from '@app/@typings/Api/integration'\nimport {\n  IntegrationListenerActionTypes,\n  IntegrationListenerState,\n  SET_INTEGRATION_LISTENER,\n  UNSET_INTEGRATION_LISTENER,\n} from '../types/IntegrationListenerTypes'\nimport { PusherEventData } from '@app/hooks/usePusherChannel'\n\nexport const setIntegrationListenerAction = (\n  integrationListener: IntegrationListenerState\n) => {\n  return {\n    type: SET_INTEGRATION_LISTENER,\n    payload: integrationListener.data,\n  }\n}\n\nexport const unsetIntegrationListenerAction = () => {\n  return {\n    type: UNSET_INTEGRATION_LISTENER,\n  }\n}\n\nexport const setIntegrationListenerFields = (\n  pusherEventData: PusherEventData\n) => {\n  return {\n    type: 'SET_INTEGRATION_LISTENER_FIELDS',\n    payload: pusherEventData,\n  }\n}\n\nexport const setIntegrationListenerStatus = (\n  status: ApiIntegrationListenerStatus\n): IntegrationListenerActionTypes => {\n  return {\n    type: 'SET_INTEGRATION_LISTENER_STATUS',\n    payload: status,\n  }\n}\n","import { AuthState, CognitoUserInterface } from '@aws-amplify/ui-components'\nimport {\n  SET_AUTH_STATE,\n  UNSET_AUTH_STATE,\n  SET_CURRENT_USER,\n  UNSET_CURRENT_USER,\n  UserTypes,\n} from '../types/UserTypes'\n\nexport const setCurrentUserAction = (user: CognitoUserInterface): UserTypes => {\n  return {\n    type: SET_CURRENT_USER,\n    payload: user,\n  }\n}\n\nexport const unsetCurrentUserAction = (): UserTypes => {\n  return {\n    type: UNSET_CURRENT_USER,\n  }\n}\n\nexport const setAuthStateAction = (authState: AuthState): UserTypes => {\n  return {\n    type: SET_AUTH_STATE,\n    payload: authState,\n  }\n}\n\nexport const unsetAuthStateAction = (): UserTypes => {\n  return {\n    type: UNSET_AUTH_STATE,\n  }\n}\n","import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux'\nimport { AppDispatch, RootState } from '../index'\n\n// Use throughout your app instead of plain `useDispatch` and `useSelector`\nexport const useAppDispatch = () => useDispatch<AppDispatch>()\nexport const useAppSelector: TypedUseSelectorHook<RootState> = useSelector\n","import { createReducer } from '@reduxjs/toolkit'\nimport {\n  ApplicationConfigurationState,\n  SEND_TOAST,\n  SEND_ALERT_MESSAGE,\n  TOGGLE_SIDEBAR,\n  SET_LOGIN_LAYOUT,\n  CLOSE_ALERT_MESSAGE,\n  SET_PATH,\n  RESET_PATH,\n  TRIGGER_CONNECT_ACCOUNT_POPUP,\n  RESET_TRIGGER_CONNECT_ACCOUNT_POPUP,\n  SET_TRACK_SIGNIN,\n} from '../types/ApplicationConfigurationTypes'\n\nconst initialState: ApplicationConfigurationState = {\n  displayVerticalSidebar: false,\n  toast: null,\n  alert: null,\n  user: undefined,\n  loginLayout: null,\n  path: null,\n  trackSignIn: false,\n  integrationId: null,\n}\n\nexport const ApplicationConfigurationReducer = createReducer(\n  initialState,\n  (builder) => {\n    builder\n      .addCase(\n        TOGGLE_SIDEBAR,\n        (state: ApplicationConfigurationState, action: any) => {\n          state.displayVerticalSidebar = !state.displayVerticalSidebar\n        }\n      )\n      .addCase(\n        SEND_TOAST,\n        (state: ApplicationConfigurationState, action: any) => {\n          state.toast = action.payload\n        }\n      )\n      .addCase(\n        SEND_ALERT_MESSAGE,\n        (state: ApplicationConfigurationState, action: any) => {\n          state.alert = action.payload\n        }\n      )\n      .addCase(\n        CLOSE_ALERT_MESSAGE,\n        (state: ApplicationConfigurationState, action: any) => {\n          if (state.alert && !state.alert.persistent) {\n            state.alert = null\n          }\n        }\n      )\n      .addCase(\n        SET_LOGIN_LAYOUT,\n        (state: ApplicationConfigurationState, action: any) => {\n          state.loginLayout = action.payload\n        }\n      )\n      .addCase(\n        SET_PATH,\n        (state: ApplicationConfigurationState, action: any) => {\n          state.path = action.payload\n        }\n      )\n      .addCase(\n        RESET_PATH,\n        (state: ApplicationConfigurationState, action: any) => {\n          state.path = null\n        }\n      )\n      .addCase(\n        SET_TRACK_SIGNIN,\n        (state: ApplicationConfigurationState, action: any) => {\n          state.trackSignIn = action.payload\n        }\n      )\n      .addCase(\n        TRIGGER_CONNECT_ACCOUNT_POPUP,\n        (state: ApplicationConfigurationState, action: any) => {\n          state.integrationId = action.payload\n        }\n      )\n      .addCase(\n        RESET_TRIGGER_CONNECT_ACCOUNT_POPUP,\n        (state: ApplicationConfigurationState, action: any) => {\n          state.integrationId = null\n        }\n      )\n  }\n)\n","import { createReducer } from '@reduxjs/toolkit'\nimport {\n  FbAppStoreState,\n  SET_PLATFORM_ID,\n  SET_STATUS,\n} from '../types/FbAppStoreTypes'\nimport { AppStoreStatus } from '../../enums/AppStoreStatus'\n\nconst initialState: FbAppStoreState = {\n  status: AppStoreStatus.NONE,\n  platformId: 0,\n}\n\nexport const FbAppStoreReducer = createReducer(initialState, (builder) => {\n  builder\n    .addCase(SET_STATUS, (state: FbAppStoreState, action: any) => {\n      state.status = action.payload\n    })\n    .addCase(SET_PLATFORM_ID, (state: FbAppStoreState, action: any) => {\n      state.platformId = action.payload\n    })\n})\n","import { createReducer } from '@reduxjs/toolkit'\nimport {\n  IntegrationListenerState,\n  UNSET_INTEGRATION_LISTENER,\n} from '../types/IntegrationListenerTypes'\n\nconst initialState: IntegrationListenerState = {\n  data: null,\n}\nexport const IntegrationListenerReducer = createReducer(\n  initialState,\n  (builder) => {\n    builder\n      .addCase(\n        'SET_INTEGRATION_LISTENER',\n        (state: IntegrationListenerState, action: any) => {\n          state.data = action.payload\n        }\n      )\n      .addCase(\n        'SET_INTEGRATION_LISTENER_FIELDS',\n        (state: IntegrationListenerState, action: any) => {\n          if (state.data && action.payload.data) {\n            state.data.fields = [...action.payload.data.recognizedFields]\n          }\n        }\n      )\n      .addCase(\n        'SET_INTEGRATION_LISTENER_STATUS',\n        (state: IntegrationListenerState, action: any) => {\n          if (state.data) {\n            state.data.status = action.payload\n          }\n        }\n      )\n      .addCase(UNSET_INTEGRATION_LISTENER, () => {\n        return initialState\n      })\n  }\n)\n","import { createReducer } from '@reduxjs/toolkit'\nimport {\n  SET_AUTH_STATE,\n  SET_CURRENT_USER,\n  UNSET_AUTH_STATE,\n  UNSET_CURRENT_USER,\n  UserState,\n} from '../types/UserTypes'\nimport { AuthState } from '@aws-amplify/ui-components'\n\nconst initialState: UserState = {\n  auth: undefined,\n  authState: undefined,\n}\n\nexport const UserReducer = createReducer(initialState, (builder) => {\n  builder\n    .addCase(SET_CURRENT_USER, (state: UserState, action: any) => {\n      state.auth = action.payload\n    })\n    .addCase(UNSET_CURRENT_USER, (state: UserState) => {\n      state.auth = undefined\n    })\n    .addCase(SET_AUTH_STATE, (state: UserState, action: any) => {\n      state.authState = action.payload\n    })\n    .addCase(UNSET_AUTH_STATE, (state: UserState) => {\n      state.authState = AuthState.SignIn\n    })\n})\n","import { Alert, Toast } from 'LeadsBridgeApp'\nimport { CognitoUserInterface } from '@aws-amplify/ui-components'\n\nexport const TOGGLE_SIDEBAR = 'TOGGLE_SIDEBAR'\nexport const SEND_TOAST = 'SEND_TOAST'\nexport const SEND_ALERT_MESSAGE = 'SEND_ALERT_MESSAGE'\nexport const CLOSE_ALERT_MESSAGE = 'CLOSE_ALERT_MESSAGE'\nexport const SET_LOGIN_LAYOUT = 'SET_LOGIN_LAYOUT'\nexport const SET_PATH = 'SET_PATH'\nexport const RESET_PATH = 'RESET_PATH'\nexport const SET_TRACK_SIGNIN = 'SET_TRACK_SIGNIN'\nexport const TRIGGER_CONNECT_ACCOUNT_POPUP = 'TRIGGER_CONNECT_ACCOUNT_POPUP'\nexport const RESET_TRIGGER_CONNECT_ACCOUNT_POPUP =\n  'RESET_TRIGGER_CONNECT_ACCOUNT_POPUP'\n\ntype LoginLayout = 'generic' | 'partner' | 'bridge-by-url'\n\nexport interface ApplicationConfigurationState {\n  displayVerticalSidebar: boolean\n  toast: Toast | null\n  alert: Alert | null\n  user: CognitoUserInterface | undefined\n  loginLayout: LoginLayout | null\n  trackSignIn: boolean\n  integrationId: number | null\n  path: string | null\n}\n\ninterface ToggleVerticalSidebar {\n  type: typeof TOGGLE_SIDEBAR\n}\n\ninterface SendToast {\n  type: typeof SEND_TOAST\n  payload: Toast\n}\ninterface SendAlertMessage {\n  type: typeof SEND_ALERT_MESSAGE\n  payload: Alert\n}\n\ninterface CloseAlertMessage {\n  type: typeof CLOSE_ALERT_MESSAGE\n}\ninterface SetLoginLayout {\n  type: typeof SET_LOGIN_LAYOUT\n  payload: string\n}\n\ninterface SetPath {\n  type: typeof SET_PATH\n  payload: string\n}\n\ninterface ResetPath {\n  type: typeof RESET_PATH\n}\n\ninterface SetTrackSignIn {\n  type: typeof SET_TRACK_SIGNIN\n  payload: boolean\n}\n\ninterface TriggerConnectAccountPopup {\n  type: typeof TRIGGER_CONNECT_ACCOUNT_POPUP\n  payload: number\n}\n\ninterface ResetTriggerConnectAccountPopup {\n  type: typeof RESET_TRIGGER_CONNECT_ACCOUNT_POPUP\n}\n\nexport type ApplicationConfigurationTypes =\n  | ToggleVerticalSidebar\n  | SendToast\n  | SendAlertMessage\n  | SetLoginLayout\n  | CloseAlertMessage\n  | SetPath\n  | ResetPath\n  | SetTrackSignIn\n  | TriggerConnectAccountPopup\n  | ResetTriggerConnectAccountPopup\n","import { AppStoreStatus } from '../../enums/AppStoreStatus'\n\nexport const SET_STATUS = 'SET_STATUS'\nexport const SET_PLATFORM_ID = 'SET_PLATFORM_ID'\n\nexport interface FbAppStoreState {\n  status: AppStoreStatus\n  platformId: number\n}\n\ninterface SetStatus {\n  type: typeof SET_STATUS\n  payload: AppStoreStatus\n}\n\ninterface SetPlatformId {\n  type: typeof SET_PLATFORM_ID\n  payload: number\n}\n\nexport type FbAppStoreTypes = SetStatus | SetPlatformId\n","import {\n  ApiIntegrationListener,\n  ApiIntegrationListenerField,\n} from '@app/@typings/Api/integration'\n\n// Action types\nexport const SET_INTEGRATION_LISTENER = 'SET_INTEGRATION_LISTENER'\nexport const SET_INTEGRATION_LISTENER_FIELDS = 'SET_INTEGRATION_LISTENER_FIELDS'\nexport const SET_INTEGRATION_LISTENER_STATUS = 'SET_INTEGRATION_LISTENER_STATUS'\nexport const UNSET_INTEGRATION_LISTENER = 'UNSET_INTEGRATION_LISTENER'\n\n// State\nexport type IntegrationListenerState = {\n  data: ApiIntegrationListener | null\n}\n\n// Actions\ninterface SetIntegrationListener {\n  type: typeof SET_INTEGRATION_LISTENER\n  payload: ApiIntegrationListener\n}\n\ninterface SetIntegrationListenerFields {\n  type: typeof SET_INTEGRATION_LISTENER_FIELDS\n  payload: ApiIntegrationListenerField[]\n}\n\ninterface SetIntegrationListenerStatus {\n  type: typeof SET_INTEGRATION_LISTENER_STATUS\n  payload: 0 | 1 | 2 | 3\n}\n\n// Combine them into an 'any' union type\nexport type IntegrationListenerActionTypes =\n  | SetIntegrationListener\n  | SetIntegrationListenerFields\n  | SetIntegrationListenerStatus\n","import { AuthState, CognitoUserInterface } from '@aws-amplify/ui-components'\n\nexport const SET_CURRENT_USER = 'SET_CURRENT_USER'\nexport const UNSET_CURRENT_USER = 'UNSET_CURRENT_USER'\nexport const SET_AUTH_STATE = 'SET_AUTH_STATE'\nexport const UNSET_AUTH_STATE = 'UNSET_AUTH_STATE'\n\nexport interface UserState {\n  auth: CognitoUserInterface | undefined\n  authState: AuthState | undefined\n}\n\ninterface SetCurrentUser {\n  type: typeof SET_CURRENT_USER\n  payload: CognitoUserInterface\n}\n\ninterface UnsetCurrentUser {\n  type: typeof UNSET_CURRENT_USER\n}\ninterface SetAuthState {\n  type: typeof SET_AUTH_STATE\n  payload: AuthState | undefined\n}\n\ninterface UnsetAuthState {\n  type: typeof UNSET_AUTH_STATE\n}\n\nexport type UserTypes =\n  | SetCurrentUser\n  | UnsetCurrentUser\n  | SetAuthState\n  | UnsetAuthState\n","import { createGlobalStyle } from 'styled-components'\n\n// !important everywhere!!! We know and we'll get rid of semantic at some point.\n// Until then, this is the only way\n\nexport const SemanticOverwrites = createGlobalStyle`\n  html, body {\n    font-family: 'Open Sans', sans-serif !important;\n  }\n  .ui.input.error > input {\n    background-color: #FEF5F4 !important;\n    border-color: #CC2029 !important;\n    color: #9f3a38 !important;\n    box-shadow: none !important;\n  }\n  \n  .ui.bulleted.list {\n    margin-left: 13px !important;\n  }\n  \n  .ui.bulleted.list .item::before {\n    color: #A1A4B1 !important;\n    font-size: 22px;\n    line-height: 0.36;\n    margin-left: -13px !important;\n  }\n\n  .ui.form .field .prompt.label{\n    padding-right: 0;\n    padding-left: 0;\n    border-color: white !important;\n    margin-top: 0;\n  }\n  .ui.form .field .prompt.label:before{\n    content: unset;\n  }\n`\n","import { css, createGlobalStyle } from 'styled-components'\n\nexport const sizing = [0, 1, 2, 3, 4, 5]\n\nexport const ClassNameUtils = createGlobalStyle`\n  .fitContent{\n    max-width: fit-content;\n    max-width: max-content;\n  }\n\n  .text-center{\n    text-align: center;\n  }\n\n  ${sizing.map(\n    (index) => css`\n\n      .m-${index} {\n        margin: ${index}rem;\n      }\n      \n      .mt-${index} {\n        margin-top: ${index}rem;\n      }\n\n      .mb-${index} {\n        margin-bottom: ${index}rem;\n      }\n\n      .ml-${index} {\n        margin-left: ${index}rem;\n      }\n\n      .mr-${index} {\n        margin-right: ${index}rem;\n      }\n\n      .my-${index} {\n        margin-top: ${index}rem;\n        margin-bottom: ${index}rem;\n      }\n\n      .mx-${index} {\n        margin-left: ${index}rem;\n        margin-right: ${index}rem;\n      }\n      \n      // Padding\n      \n      .p-${index} {\n        padding: : ${index}rem;\n      }\n      \n      .pt-${index} {\n        padding-top: ${index}rem;\n      }\n\n      .pb-${index} {\n        padding-bottom: ${index}rem;\n      }\n\n      .pl-${index} {\n        padding-left: ${index}rem;\n      }\n\n      .pr-${index} {\n        padding-right: ${index}rem;\n      }\n\n      .py-${index} {\n        padding-top: ${index}rem;\n        padding-bottom: ${index}rem;\n      }\n\n      .px-${index} {\n        padding-left: ${index}rem;\n        padding-right: ${index}rem;\n      }\n    `\n  )}\n  \n  \n  .divisor-label{\n    position: relative;\n  }\n  .divisor-label > * {\n    position: absolute;\n    left: 0;\n    right: 0;\n    text-align: center;\n    width: 100%;\n    padding: 0 10px;\n    background-color: white;\n  }\n\n  /* do we need this? */\n  .list {\n    &.unlisted{\n      list-style: none;\n      padding-left: 0 ;\n    }\n   \n    &.list-even li:nth-child(even),\n    &.list-odd li:nth-child(odd) {\n      background-color: whitesmoke\n    }\n  }\n  \n  [autocomplete=\"off\"]:-webkit-autofill {\n    display: none!important;\n  }\n\n  .flex-row-reverse {\n    flex-direction: row-reverse;\n  }\n  \n  .reactTooltipSmall {\n    max-width: 40rem;\n  }\n\n  .reactTooltipFilterIcons {\n    padding: 0 1rem !important;\n    font-size: .7rem !important;\n  }\n\n  .customTooltipIcon {\n    width: 15rem;\n    box-shadow: 0px 4px 10px 0px #808080;\n    border-radius: 5px;\n  }\n\n  .customTooltipInput {\n    max-width: 70%;\n    box-shadow: 0px 4px 10px 0px #808080;\n    border-radius: 5px;\n    word-break: break-all;\n  }\n  \n`\n","import { createGlobalStyle } from 'styled-components'\n\nexport const AnimationsUtils = createGlobalStyle`\n  @keyframes rotate360 {\n    from {\n      transform: rotate(0deg);\n      transform-origin: center;\n    }\n\n    to {\n      transform: rotate(360deg);\n      transform-origin: center;\n    }\n  }\n\n  @keyframes fillProgressBar {\n    from {width: 1%;}\n    to {width: 100%;}\n  }\n`\n","import { createGlobalStyle } from 'styled-components'\n\n// !important everywhere!!! We know and we'll get rid of semantic at some point.\n// Until then, this is the only way\n\nexport const CommonCss = createGlobalStyle`\n  html, body {\n    font-family: 'Open Sans', sans-serif !important;\n    font-size: 16px!important;\n    -webkit-font-smoothing: antialiased;\n    box-sizing: border-box;\n  }\n  \n  *, *:before, *:after {\n    box-sizing: inherit;\n  }\n  \n  h1, h2, h3, h4, h5 {\n    font-family: 'Open Sans', sans-serif !important;\n    font-weight: 600;\n  }\n  \n  /* Fix last pass plugin */\n  input[autocomplete=\"off\"]:-webkit-autofill{\n    display: block !important\n  }\n  img[id^=\"__lpform_\"]{\n    cursor: pointer !important;\n  }\n  .gtx-trans-icon{\n    display: none;\n  }\n`\n","import React from 'react'\nimport { SemanticOverwrites } from '@app/styles/modules/SemanticOverwrites.styled'\nimport { ClassNameUtils } from '@app/styles/modules/Utilities.styled'\nimport { AnimationsUtils } from '@app/styles/modules/Animations.styled'\nimport { CommonCss } from '@app/styles/modules/CommonCss.styled'\n\nexport const GlobalAppStyle: React.FC = () => {\n  return (\n    <>\n      <CommonCss />\n      <SemanticOverwrites />\n      <ClassNameUtils />\n      <AnimationsUtils />\n    </>\n  )\n}\n","import {\n  css,\n  DefaultTheme,\n  ThemeProps,\n  FlattenInterpolation,\n} from 'styled-components'\n\ntype CustomStyledCss = FlattenInterpolation<ThemeProps<DefaultTheme>>\n\n// we consider embeddable everything between this tuple\nconst iframeWidthRange: [number, number] = [768, 800]\n\nconst minWidth = `${iframeWidthRange[0]}px`\nconst maxWidth = `${iframeWidthRange[1]}px`\nconst maxWidthUp = `${iframeWidthRange[1] + 1}px` // 801\n\nexport const mediaIframeOnly = (customCss: CustomStyledCss) => css`\n  @media (min-width: ${minWidth}) and (max-width: ${maxWidth}) {\n    ${customCss}\n  }\n`\n\nexport const mediaIframeUp = (customCss: CustomStyledCss) => css`\n  @media (min-width: ${maxWidthUp}) {\n    ${customCss}\n  }\n`\n","export const defaultTheme = {\n  brand: {\n    primary: {\n      background: '#fd9645',\n      color: '#fff',\n      boxShadow: '1px 3px 6px 0 rgba(253, 150, 69, 0.3)',\n    },\n  },\n  chips: {\n    text: {\n      backgroundColor: 'rgba(128,128,128,0.90)',\n      closeIconColorHover: 'rgb(206,206,206)',\n      backgroundColorHover: 'rgba(128,128,128,1)',\n    },\n    formula: {\n      backgroundColor: 'rgba(40,59,84,0.90)',\n      closeIconColorHover: '#dbe7ff',\n      backgroundColorHover: 'rgba(40,59,84,1)',\n    },\n    custom: {\n      backgroundColor: 'rgba(65,131,196,0.90)',\n      closeIconColorHover: '#d1e8ff',\n      backgroundColorHover: 'rgba(65,131,196,1)',\n    },\n    source: {\n      backgroundColor: 'rgba(34,167,240,0.90)',\n      closeIconColorHover: '#c9e4fd',\n      backgroundColorHover: 'rgba(34,167,240,1)',\n    },\n  },\n  input: {\n    default: {\n      placeholder: '#808080',\n      backgroundColor: '#fff',\n      borderColor: 'rgba(34, 36, 38, 0.15)',\n      color: 'rgba(0, 0, 0, 0.87)',\n    },\n    disabled: {\n      background: 'rgba(34, 36, 38, 0.03)',\n      color: 'rgb(128 128 128)',\n    },\n    error: {\n      backgroundColor: '#fef5f4',\n      borderColor: '#cc2029',\n      color: 'rgba(0, 0, 0, 0.87)',\n    },\n    success: {\n      backgroundColor: 'rgba(46, 204, 113, 0.1)',\n      borderColor: '#0c783a',\n      color: 'rgba(0, 0, 0, 0.87)',\n    },\n  },\n  button: {\n    facebook: {\n      backgroundColor: '#3778ea',\n      backgroundColorHover: '#2f6edd',\n      color: '#fff',\n    },\n    tiktok: {\n      backgroundColor: '#fe2c55',\n      color: '#fff',\n    },\n    primary: {\n      backgroundColor: '#22a7f0',\n      backgroundColorHover: '#2987cd',\n      color: '#fff',\n    },\n    secondary: {\n      backgroundColor: '#121232',\n      backgroundColorHover: '#28304a',\n      color: '#fff',\n    },\n    link: {\n      backgroundColor: 'none',\n      color: '#3778EA',\n    },\n  },\n  container: {\n    medium: '768px',\n    large: '1080px',\n    extralarge: '1280px',\n  },\n  font: {\n    family: '\"Open Sans\", sans-serif',\n  },\n  color: {\n    primary: '#41a6dc',\n    action: '#fd9645',\n    link: '#4183c4',\n    green: '#2ecc71',\n    error: '#cc2029',\n  },\n  zIndex: {\n    modal: 1000,\n    panelFooter: 50,\n    dropdown: 60,\n    overallNotifications: 9999, // for toasts and alerts\n  },\n  utils: {\n    boxShadow:\n      'rgb(0 0 0 / 2%) 0px -4px 6px -1px, rgb(0 0 0 / 4%) 0px -2px 4px -1px',\n  },\n}\n\nexport type CustomDefaultTheme = typeof defaultTheme\n","export const Messages = {\n  AppInvoked: 'app_invoked',\n  UserCreated: 'account_created',\n  UserLogged: 'account_logged_in',\n  PlatformInvoked: 'platform_invoked',\n  PlatformError: 'platform_error',\n  PlatformAuthorized: 'platform_authorized',\n  PlatformCompleted: 'platform_completed',\n}\n\nexport const doPostMessage = (event: any) => {\n  const timestamp = Date.now()\n  const message = JSON.stringify({\n    timestamp: timestamp,\n    event: event,\n  })\n  window.parent.postMessage(message, '*')\n}\n","const arrayItemSeparator = ','\n\nexport const encodeToBase64 = (value: string | number | boolean | string[]) => {\n  const valueToEncode = Array.isArray(value)\n    ? value.join(arrayItemSeparator)\n    : value\n  return window.btoa(unescape(encodeURIComponent(valueToEncode)))\n}\n\n// if original encoded value was an array, we pass `parseArray` as tru\nexport const decodeFromBase64 = (\n  encodedValue: string,\n  parseArray?: boolean\n) => {\n  const decodedValue = decodeURIComponent(escape(window.atob(encodedValue)))\n  if (parseArray) {\n    // handling array and prevent to not create [''] from []\n    return decodedValue === '' ? [] : decodedValue.split(arrayItemSeparator)\n  }\n  return decodedValue\n}\n","import { CognitoErrorResponse } from 'LeadsBridgeApp'\nimport t from 'public/locales/en-US.json'\n\ntype CognitoErrorCodeI18n = keyof typeof t.cognitoErrors\n\n// Please keep it synched with -> https://leadsbridge.atlassian.net/wiki/spaces/LH/pages/885030923/Custom+mapping+of+Cognito+Responses\nexport const getCustomErrorCognitoMessage = (res: CognitoErrorResponse) => {\n  return (\n    t.cognitoErrors[res.code as CognitoErrorCodeI18n] ||\n    res.message ||\n    'Something is wrong, this is an unexpected error'\n  )\n}\n","import Cookies from 'universal-cookie'\n\nconst cookies = new Cookies()\n\nexport const setCookie = (\n  name: string,\n  value: string,\n  days: number = 1\n): void => {\n  const oneDay = 24 * 60 * 60\n  const maxAge = days ? days * oneDay : oneDay\n  cookies.set(name, value, {\n    path: '/',\n    domain: process.env.REACT_APP_V1_COOKIE_DOMAIN,\n    maxAge: maxAge,\n  })\n}\n\nexport const getCookie = (name: string): string | undefined => {\n  return cookies.get(name)\n}\n\nexport type AffiliateIdDataFromCookies = {\n  tapClickId: string | undefined\n  tapVisitorId: string | undefined\n}\n\n/**\n * Fetches the Tapfiliate IDs from cookies.\n * @returns An object containing tapClickId and tapVisitorId or undefined if not found.\n */\nexport const getAffiliateIdFromCookies = ():\n  | AffiliateIdDataFromCookies\n  | undefined => {\n  const tapId = getCookie('tap.id')\n  const tapVid = getCookie('tap.vid')\n\n  if (tapId && tapVid) {\n    return {\n      tapClickId: tapId,\n      tapVisitorId: tapVid,\n    }\n  }\n}\n","export const isDebug = process.env.WEBPACK_KEEP_CONSOLE_LOGS === 'true'\n","export const sleep = (timeMs: number) =>\n  new Promise((resolve) => setTimeout(resolve, timeMs))\n\nexport const openZendeskChat = (zE: any) => {\n  zE('webWidget', 'show')\n  zE('webWidget', 'open')\n  zE('webWidget:on', 'close', function () {\n    zE('webWidget', 'hide')\n  })\n}\n","export const isInIframe = () => {\n  try {\n    return window.self !== window.top\n  } catch (e) {\n    return true\n  }\n}\n","// generates random id;\nexport const generateRandomId = () => {\n  const labelId = () => {\n    return Math.floor((1 + Math.random()) * 0x10000)\n      .toString(16)\n      .substring(1)\n  }\n  // return id of format 'aaaaaaaa'-'aaaa'-'aaaa'-'aaaa'-'aaaaaaaaaaaa'\n  return (\n    // test deploy\n    labelId() +\n    labelId() +\n    '-' +\n    labelId() +\n    '-' +\n    labelId() +\n    '-' +\n    labelId() +\n    '-' +\n    labelId() +\n    labelId() +\n    labelId()\n  )\n}\n","export default class RegExpLibrary {\n  static email: RegExp = new RegExp(\n    /(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])/\n  )\n\n  static password: RegExp = new RegExp(\n    /^(?=.{9,}$)(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*\\W).*$/\n  )\n}\n\nexport const emailValidator = (email: string) => {\n  return /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.+[A-Z]{2,12}$/i.test(email)\n}\n","import * as yup from 'yup'\n\n// This is a simple and maybe poor optmized phone validation function\n// We might want to consider to implement a specific library in future in order to replace this\nexport const isValidPhoneNumber = (value: string) => {\n  if (!value) {\n    return false\n  }\n\n  // setup\n  const firstChar = value.charAt(0)\n  const onlyNumbersRegex = /^\\d+$/\n  const onlyNumbersAndSpacesRegex = /^(?=.*\\d)[\\d ]+$/\n  const minLenght = 4\n  const maxLengh = 20\n  const valueWithoutWhiteSpaces = value.replace(/ /g, '')\n\n  // checking conditions\n  const hasValidFirstCharacter =\n    firstChar === '+' || onlyNumbersRegex.test(firstChar)\n  const hasOnlyNumbersAndSpaces = onlyNumbersAndSpacesRegex.test(\n    value.substr(1)\n  )\n  const isCorrectLenght =\n    valueWithoutWhiteSpaces.length > minLenght &&\n    valueWithoutWhiteSpaces.length <= maxLengh\n\n  // we return true if all conditions are satified\n  return hasValidFirstCharacter && hasOnlyNumbersAndSpaces && isCorrectLenght\n}\n","import * as Yup from 'yup'\nimport { isValidPhoneNumber } from '@app/utils/validators/phoneNumber'\n\nexport const yupPhoneNumber = (\n  errorMessage = 'Please enter a valid phone number'\n) =>\n  Yup.string().test('is-valid-phone', errorMessage, (value) => {\n    if (!value) {\n      return true\n    }\n    return isValidPhoneNumber(value)\n  })\n\nexport const yupRequiredBoolean = (errorMessage?: string) =>\n  Yup.bool()\n    .required()\n    .oneOf([true], errorMessage || 'This field is required')\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"static/js/\" + chunkId + \".\" + {\"221\":\"3611571d8a1da4573139\",\"1125\":\"9ef4638075f4074ce9de\",\"1455\":\"b7cec7e5b241ba05fe27\",\"1852\":\"d65c60d3250de9e00381\",\"8346\":\"24f60f3d35143475e31c\",\"9985\":\"86edaa74e875d6985783\"}[chunkId] + \".chunk.js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.hmd = (module) => {\n\tmodule = Object.create(module);\n\tif (!module.children) module.children = [];\n\tObject.defineProperty(module, 'exports', {\n\t\tenumerable: true,\n\t\tset: () => {\n\t\t\tthrow new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);\n\t\t}\n\t});\n\treturn module;\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.p = \"/\";","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t2756: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkleadsbridge\"] = self[\"webpackChunkleadsbridge\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [4312,291,4065,1985,9715,1101,4592,1968,10,2626,4329,5348,6766,2823,9161,7621,4625,9366,6030,4201,556,9868,8901,8789,1868,8227,5973,7523,7638,1958,9862,4359,3771,3617,1245,4087,139,1043,9857,5687,9602,8763,2239,8829,1714,1153,5691,7548,8350,6241,9904,4673,7165,8094,2850,1791,2223,2332,3195,3744,225,7219,3061,6680,376], () => (__webpack_require__(12085)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","inProgress","dataWebpackPrefix","apiBridgeFieldTypes","LangFbAppStore","popupLocked","title","description","helpers","messages","tokenError","postChooseIntegrationSettings","schema","request","data","schemaSettings","id","type","label","order","default","required","text","refreshable","hide","docUrl","tooltip","hasChild","createServerInit","routes","this","post","timing","passthrough","useEffect","window","close","FbAppStoreService","getSheetsUrl","getSpreedSheetTabsUrl","getPlatformAuthUrl","doPlatformAuthUrl","generateExternalBusinessIdUrl","saveSheetSelectionUrl","saveSegmentSelectionUrl","getSegmentTypesUrl","segmentUrls","getPlatformCapabilitiesUrl","doPublishBridgesUrl","getSyncDataLinksUrl","getSheets","platformId","axiosInterceptor","then","ax","get","res","getSpreadSheetTabs","selectedSheetId","getPlatformAuth","url","doPlatformAuth","fields","generateExternalBusinessId","segmentTypes","getSegments","saveSegmentSelection","selectedTabId","segmentType","segmentId","saveSheetSelection","sheetId","tabId","getPlatformCapabilities","doPublishBridges","entities","limitedDataUse","adsDeliveryOptimization","getSyncDataLinks","setOpen","setAPIresponse","state","appStore","loading","setLoading","useState","setFields","helpUrl","setHelpUrl","labels","setLabels","formError","setFormError","subscribed","oauth2RedirectUrl","newObj","Object","keys","authFields","map","key","catch","response","errorCode","finally","Segment","style","border","boxShadow","Dimmer","inverted","active","marginTop","Loader","Form","paddingTop","paddingBottom","method","error","textAlign","alt","src","length","index","onChange","e","oldFields","target","value","opacity","href","rel","Label","Icon","name","Button","color","size","fluid","className","onClick","emptyField","values","forEach","r","err","errorMessage","left","screen","width","newWin","open","closed","setTimeout","Message","header","content","FbAppStoreStepper","googleSheet","AppStoreStatus","newType","PlatformConfiguration","forwardRef","props","ref","dispatch","setType","platformName","setPlatformName","setEntities","checkedEntity","setCheckedEntity","checkedEntities","setCheckedEntities","privacy1","setPrivacy1","privacy2","setPrivacy2","saving","setSaving","loadingEntities","setLoadingEntities","steps","PlatformName","Entities","Header","as","List","divided","relaxed","display","alignItems","padding","newCheckedEntities","keyIndex","indexOf","push","splice","Radio","checked","Checkbox","marginLeft","SourceMappedFields","k","marginBottom","disabled","parsedEntities","filter","el","saveConfiguration","SearchStyled","SpreadSheetSelection","sheetTemplateUrl","setSheetTemplateUrl","documentationTemplateUrl","setDocumentationTemplateUrl","isFilteringSheets","setIsFilteringSheets","sheet","setSheet","setSheetId","results","setResults","isFilteringWorksheets","setIsFilteringWorksheets","worksheet","setWorksheet","searchRef","createRef","worksheetId","setWorksheetId","workResults","setWorkResults","search2Ref","sheets","setSheets","worksheets","setWorksheets","refreshingList","setRefreshingList","nextStep","setNextStep","clickListener","Tabs","segments","onClickEVent","document","getElementsByClassName","removeEventListener","shits","c","icon","labelPosition","Search","flex","marginRight","onResultSelect","result","onSearchChange","debounce","dataValue","toString","re","RegExp","escapeRegExp","test","leading","element","current","addEventListener","eventClick","placeholder","eventClickSearch2","filteredResults","justifyContent","margin","displayName","IconSync","IconStepStyled","CardGroupStyled","contactsLink","setContactsLink","eventsLink","setEventsLink","link","setLink","isLoading","setIsLoading","leadsbridgeLink","Confetti","MenuStyled","Menu","children","pointing","secondary","status","Step","step","included","includes","exists","find","s","Image","borderRadius","avatar","APIresponse","setPlatformId","payload","setPlatformIdAction","setStatus","setStatusAction","setSteps","params","location","search","replace","redirectUrl","redirect_uri","urlObject","URL","qs","slice","qsObject","extras","JSON","stringify","doFacebookRedirect","crm_id","parseInt","subscription","Auth","user","listFbAppStoreStatuss","items","API","owner","username","crmId","eq","input","oldStatus","subscribe","next","onUpdateFbAppStoreStatus","undefined","unsubscribe","errorObject","Container","maxWidth","Modal","dangerouslySetInnerHTML","__html","warning","item","primary","errorLink","minHeight","getPageComponent","height","useGenericBbuAuth","provider","authCode","requestUri","bbuData","apiError","setApiError","isMountedRef","useRef","userStatus","setUserStatus","authState","canProceedWithNotLoggedInFlow","authCancelRequest","cancelToken","token","password","Pricing","localStorage","setItem","validationData","cognitoUser","eventName","feature","custom","planId","cbPlanId","mrr","channel","sourceId","source","sourceName","destinationId","destination","destinationName","sendEventToIntercom","cognitoError","fallbackMessage","cancel","errorDescription","callInProgress","setCallInProgress","setErrorMessage","useRequestUriState","persistentUri","setPersistentUri","usePersisteIsFlowForNbee","persistentIsFlowForNbee","setPersistentIsFlowForNbee","String","pathname","flowType","instanceId","nbee","hasRequiredParams","encodedExtras","encodeURIComponent","backendUrl","origin","parameters","fbAppId","scopes","negative","reload","errorStyle","setErrorStyle","lb_error","lb_error_code","lb_error_description","callback","removeItem","callbackPath","IncomingDataScreen","appId","integrationId","appIdNumber","history","appAuthSchemaResponse","mutate","retrieveAuthSchema","isLoadingAppAuthSchema","errorApiAppAuthSchema","settings","existingIntegration","isLoadingExistingIntegration","integrationListenerData","isGettingIntegrationListener","errorGettingIntegrationListener","updatedIntegrationData","updateIntegrationListener","isUpdatingIntegrationListener","errorUpdatingIntegrationListener","updateIntegration","isUpdatingIntegration","integrationUpdateApiError","updatedIntegrationCredentials","appData","isLoadingApp","errorApiGetApp","isError","appAuthSchema","credentials","initialValues","isDismissable","message","useTranslation","appLogoUri","logoUriSmall","Number","appName","onContinueRequest","formValues","formikHelpers","action","setSubmitting","requestBody","onSuccess","IncomingDataScreenFields","isRecognizingFields","setIsRecognizingFields","isConfirmingReload","setIsConfirmingReload","integrationListener","integrationUsage","isGettingIntegrationUsage","integrationFields","refetch","refetchIntegrationFields","activeBridges","totalBridges","Array","isArray","onReload","prevState","onContinue","resetConfirmingReload","listenerType","IncomingDataScreenSave","integrationData","isFetchingIntegrationData","integrationDataApiError","integrationName","setIntegrationName","onEditIntegrationName","onSave","newIntegration","onCancel","IntegrationAuthCallback","legacyIntegrationId","instanceType","sessionStorage","getItem","legacyIntegrationError","getIntegrationApiError","oauth","code","position","IntegrationAuthCallback2","postAuthGrantCode","authGrantCodeApiError","authGrantCodeData","paramsFromUrl","URLSearchParams","paramsObject","fromEntries","appIdInt","integrationIdInt","payloadArray","credentialsArray","concat","integration","IntegrationAuthScreen","t","setNewIntegration","isAboutToClosingModal","setIsAboutToClosingModal","saveNewIntegration","isSavingNewIntegration","integrationSaveApiError","savedIntegration","testIntegrationResults","integrationTestError","isCheckingValidIntegration","isRefetching","isReCheckingValidIntegration","reTestValidIntegration","optimisticIntegrationData","isOauthUri","isSuccessResponse","isReady","Boolean","trackEventError","parsedError","parsedTestError","isSavingApi","onSubmit","onError","isNotValidIntegrationErrorMessage","IntegrationAuthScreenEdit","bridgeId","isSaveStep","path","exact","strict","errorApiGetIntegration","savedIntegrationData","skipParams","isExact","IntegrationAuthVerifiedEmailScreenLegacy","Wrapper","Body","Title","SubTitle","queryStringParam","verifyLinkResponse","verifyLink","verifyLinkLoading","verifyLinkError","IntegrationHome","parsedRedirectUrl","clearPersistentData","cookies","clear","remove","domain","emptyBridge","Date","getTime","emailReceipt","BridgeChooser","sourceAppId","destinationAppId","component","NbeeHome","success","Step1","isModalOpen","setIsModalOpen","loginParams","showSurpriseMessage","currentPlan","lbfsgn","planName","isFirstLogin","newUser","bridgeFormikProps","setBridgeFormikProps","bbuMatchUrl","bbuUri","bridgeTemplateValues","isLoadingBridgeTemplate","urlParsed","parseNumbers","sourceAppIdFromQueryString","destinationAppIdFromQueryString","userModulesResponse","isLoadingUserModules","emailReceiptUserModule","modules","m","emailReceiptDefaults","recipients","subject","makeEmptyBridge","userDefaults","createNewBridge","createNewBridgeResponse","createNewBridgeError","isCreatingNewBridge","updateBridge","updateBridgeResponse","updateBridgeError","isUpdatingBridge","setupBridge","bridgeSetupResponse","bridgeSetupApiError","isSettingUpBridge","createdBridgeId","bridge","updatedBridgeId","activeStepIndex","loadingText","isOpen","onCloseModal","templateSettings","userData","newBridgeData","bridgeData","Step1Edit","allApps","isLoadingApps","allAppsApiError","bridgeFormValues","isLoadingBridge","bridgeApiError","apiInitialDataError","updateBridgeData","statusCode","Step2","errorGettingBridge","onRefetchBridgeFormValues","isReloadingBridge","availablePermissionChecks","errorGettingAvailablePermissionChecks","isLoadingAvailablePermissionChecks","allBridgeFields","allBridgeFieldsError","loadingAllBridgeFields","isReloadingAllBridgeFields","publishBridge","publishBridgeResponse","publishBridgeApiError","isPublishingBridge","runPermissionChecks","errorRunningPermissionChecks","isRunningPermissionChecks","u","isLoadingAll","allDataReady","showWelcomeMessage","requiresTemplateBasedFieldsMapping","shouldCheckPermissions","setShouldCheckPermissions","fieldsMappingMatched","setFieldsMappingMatched","bridgeFilterRules","sourceFilters","conditions","handleApiError","formikValues","persistent","buttons","handlePublishBridge","publishedBridgeReponse","isUserPro","pricing","split","step3State","firstBridge","F","bridgeFilterRulesList","permissionChecklist","handleUpdateBridgeSuccess","Step3","connectedApps","isLoadingConnectedApps","sourceAppName","destinationAppName","performanceBoosterAvailable","errorGettingPerformanceBooster","existingPerformanceBoosterAvailable","existingPbId","IsTestEnableProp","ui","testEnabled","redirectUri","isLoadingBridgeUri","S","bridgeName","uri","isTestEnabledProp","errorPerformanceBooster","loginError","setLoginError","samlProvider","body","append","accessToken","headers","access_token","responseHandleSamlUser","Error","to","TestComponents","hostname","makeUrl","nbeeBridgeChooserStep1","nbeeBridgeChooserStep2","nbeeStep1New","nbeeAppBbu","nbeeStep1Edit","nbeeStep2","nbeeStep3","nbeeInfoPage","integrationAuthScreen","integrationAuthScreenEdit","integrationAuthScreenEditWithBridgeId","integrationAuthScreenEditStep2","integrationAuthScreenCallback","integrationAuthScreenCallback2","incomingData","incomingDataScreen","incomingDataScreenEdit","incomingDataScreenFields","incomingDataScreenSave","makeUrlWithState","reasonId","minimumPlanRequired","checkout","checkoutThankYouPage","fbe","fbeCallback","fbAppStore","fbAppStoreDone","serializeQueryString","obj","prefix","str","p","hasOwnProperty","v","join","signup","signupBbu","signupBbuFallbackSurvey","partnerName","signupPartner","signin","forgotPassword","changePassword","makUrl","saml","samlRedirect","logout","redirectTo","toastMessage","queryString","btoa","serializedQs","makeQueryStringForLogout","googleAdsAccountFormCreate","googleAdsAccountFormCreated","customerId","googleAdsAccountActivate","googleAdsAccountConnect","adminPath","adminPrivateRoot","adminPrivateValidateFbToken","appRoutes","auth","bridgeByUrl","bridgeByUrlEmbedded","bridgeByUrlCallback","partnerFullName","facebook","googleAdsAccount","billing","admin","bridgeBuilderStep1Paths","bridgeByUrlPartnersPaths","LoginV1Service","authorizeUrl","handleFbeParametersUrl","setupInstanceUrl","fbeCancelUrl","evoToken","authorize","facebookParameters","setupInstance","fbeCancel","setupSessionCookie","jwt","withCredentials","cancelSessionCookie","persistAuthExpiration","date","setDate","getDate","AuthService","setCsrfCookie","Authorization","setSessionCookie","session","getAccessToken","getJwtToken","onLogin","keepMeLogged","urlPath","event","onLoginAsync","CognitoApiService","federatedToCognitoUrl","describeIdentityProviderUrl","listIdentityProvidersUrl","listIdentityProviders","describeIdentityProvider","federatedToCognito","email","id_token","FacebookService","initFB","fbAsyncInit","FB","init","cookie","xfbml","version","createScriptFb","script","createElement","async","onload","appendChild","getAWSCredentials","Promise","resolve","reject","expiresIn","api","signInWithFacebook","fb","getLoginStatus","authResponse","login","scope","apiAuthClient","interceptors","use","config","cognitoSessionData","deviceKey","match","impValue","currentPath","logoutUrl","assign","apiPublicClient","interceptor","baseURL","timeout","expiration","getIdToken","getExpiration","exp","Math","round","date2","parse","getCachedDeviceKeyAndPassword","toggleVerticalSidebar","sendToast","toast","sendAlertMessage","alertMessage","closeAlertMessage","setLoginLayout","setTrackSignIn","triggerConnectAccountPopup","setPath","resetPath","setIntegrationListenerAction","setIntegrationListenerFields","pusherEventData","setIntegrationListenerStatus","setCurrentUserAction","unsetCurrentUserAction","setAuthStateAction","unsetAuthStateAction","useAppDispatch","useAppSelector","ApplicationConfigurationReducer","displayVerticalSidebar","alert","loginLayout","trackSignIn","builder","addCase","FbAppStoreReducer","initialState","IntegrationListenerReducer","recognizedFields","UserReducer","TOGGLE_SIDEBAR","SEND_TOAST","SEND_ALERT_MESSAGE","CLOSE_ALERT_MESSAGE","SET_LOGIN_LAYOUT","SET_PATH","RESET_PATH","SET_TRACK_SIGNIN","TRIGGER_CONNECT_ACCOUNT_POPUP","RESET_TRIGGER_CONNECT_ACCOUNT_POPUP","SET_STATUS","SET_PLATFORM_ID","SET_INTEGRATION_LISTENER","UNSET_INTEGRATION_LISTENER","SET_CURRENT_USER","UNSET_CURRENT_USER","SET_AUTH_STATE","UNSET_AUTH_STATE","SemanticOverwrites","ClassNameUtils","AnimationsUtils","CommonCss","GlobalAppStyle","iframeWidthRange","minWidth","maxWidthUp","mediaIframeOnly","customCss","mediaIframeUp","defaultTheme","brand","background","chips","backgroundColor","closeIconColorHover","backgroundColorHover","formula","borderColor","button","tiktok","container","medium","large","extralarge","font","family","green","zIndex","modal","panelFooter","dropdown","overallNotifications","utils","Messages","AppInvoked","UserCreated","UserLogged","PlatformInvoked","PlatformError","PlatformAuthorized","PlatformCompleted","doPostMessage","timestamp","now","parent","postMessage","encodeToBase64","valueToEncode","unescape","getCustomErrorCognitoMessage","setCookie","days","set","maxAge","getCookie","getAffiliateIdFromCookies","tapId","tapVid","tapClickId","tapVisitorId","isDebug","WEBPACK_KEEP_CONSOLE_LOGS","sleep","timeMs","openZendeskChat","zE","isInIframe","self","top","generateRandomId","labelId","floor","random","substring","RegExpLibrary","emailValidator","yupPhoneNumber","firstChar","charAt","valueWithoutWhiteSpaces","hasValidFirstCharacter","hasOnlyNumbersAndSpaces","substr","isValidPhoneNumber","yupRequiredBoolean","oneOf","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","loaded","__webpack_modules__","call","O","chunkIds","fn","priority","notFulfilled","Infinity","i","fulfilled","j","every","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","f","chunkId","all","reduce","promises","g","globalThis","Function","hmd","create","prop","prototype","l","done","needAttach","scripts","getElementsByTagName","getAttribute","charset","nc","setAttribute","onScriptComplete","prev","onerror","clearTimeout","doneFns","parentNode","removeChild","bind","head","Symbol","toStringTag","nmd","paths","installedChunks","installedChunkData","promise","errorType","realSrc","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","chunkLoadingGlobal","__webpack_exports__"],"sourceRoot":""}