{"version":3,"sources":["LASModuleWrapper.js","utils.js","Provider.js","LegacyPageWrapper.js","App.js","index.js"],"names":["redirectToLoginPortal","response","console","log","window","location","LASModuleWrapper","_ref","_config$urls","config","lasModRef","useRef","isReady","header","configSettings","configAPIURL","urls","uuid","dt","Date","getTime","replace","c","crypto","msCrypto","array","Uint32Array","r","getRandomValues","Math","floor","toString","generateUUID","_onAuthSuccess","_asyncToGenerator","_regeneratorRuntime","mark","_callee","wrap","_context","prev","next","stop","apply","arguments","headers","_objectSpread","transmitconfigapi","redirectUrls","LOGIN_PORTAL","displayFields","COMPANY_ID","ACCOUNT_TYPE_DROPDOWN","REMEMBER_ME","LOGIN_HELP","ENROLLMENT_LINK","FORGOT_ID","RESET_PWD","FORGOT_PASSWORD_FIELDS","BACK_BUTTON","transmitConfigs","URL","transmitUrl","BASE_API_URL","APP_ID","appId","policyIds","POLICY","RESET_PASSWORD","policyParams","ap","authProvider","constants","USER_SUFFIX","userSuffix","appDynamicsKey","appdynamicsAppKey","_jsx","_Fragment","children","AppLoader","elementRef","id","isDomainPrefixedToManifestPath","manifestPath","loginHelpWidgetURL","namespace","appProps","configApiHeaders","onAuthorizationSuccess","_x","onAuthorizationFailure","appNameForSiteCat","uxNameForSiteCat","clientNameForSiteCat","isOLB","isUMDFormat","isAppDEnabled","isReportingEnabled","isIovationEnabled","isJSLoggerEnabled","configApiURL","appDKey","idShieldQuestion","isTux","isHeaderRequired","isFooterRequired","showResetPwdPage","style","margin","width","textAlign","padding","Context","createContext","axios","defaults","common","Provider","props","_useState","useState","_useState2","_slicedToArray","setConfig","_useState3","_useState4","authData","getConfiguration","request","data","get","sent","t0","getCCSmessage","_ref3","_callee3","customerId","url","_context3","concat","abrupt","useEffect","value","LegacyPageWrapper","useContext","isConfigReady","App","LASModule","ReactDOM","render","React","StrictMode","document","getElementById"],"mappings":"oQAKO,SAASA,EAAsBC,GACpCC,QAAQC,IAAI,gCACZC,OAAOC,SAAW,2BACpB,CAEA,IA+HeC,EA/H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AQ,CAACyB,MAAO,CAAEtI,SAAQ6H,gBAAeP,YAAWhD,SAC1DwC,EAAMxC,UAGb,ECnDaiE,EAAoB,WAC/B,IAAQvI,EAAWwI,qBAAWhC,GAAtBxG,OAEFyI,EAAgBzI,GAAUA,EAAOoC,QACvC,OAEKgC,cAAA,OAAAE,SACCmE,GACCrE,cAACvE,EAAgB,CAACG,OAAQA,KAKnC,ECPe0I,MARf,WACE,OACEtE,cAACyC,EAAQ,CAAAvC,SACPF,cAACuE,EAAS,KAGhB,E,OCFAC,IAASC,OACPzE,cAAC0E,IAAMC,WAAU,CAAAzE,SACfF,cAACsE,EAAG,MAENM,SAASC,eAAe,a","file":"static/js/main.6849c237.chunk.js","sourcesContent":["import React, { useRef } from \"react\";\r\nimport AppLoader from \"@usb-ui-tools/micro-app-loader\";\r\n\r\nimport { generateUUID } from \"./utils\";\r\n\r\nexport function redirectToLoginPortal(response) {\r\n console.log(\"Page Redirected Successfully\");\r\n window.location = \"/spt_mobile_web/sbb/logon\";\r\n}\r\n\r\nconst LASModuleWrapper = ({ config }) => { \r\n const lasModRef = useRef(null); \r\n \r\n let isReady = false;\r\n let header = {};\r\n let configSettings = {};\r\n let configAPIURL = \"\";\r\n\r\n const urls = config?.urls ? config.urls : {};\r\n const uuid = generateUUID();\r\n\r\n if (config?.headers) {\r\n header = { ...config.headers, \"Correlation-ID\": uuid };\r\n configAPIURL = urls.transmitconfigapi;\r\n configSettings = {\r\n urls: {\r\n redirectUrls: {\r\n LOGIN_PORTAL: \"/spt_mobile_web/sbb/logon\"\r\n }},\r\n displayFields: {\r\n COMPANY_ID: \"show\",\r\n ACCOUNT_TYPE_DROPDOWN: \"hide\",\r\n REMEMBER_ME: \"hide\",\r\n LOGIN_HELP: \"show\",\r\n ENROLLMENT_LINK: \"hide\",\r\n FORGOT_ID: \"hide\",\r\n RESET_PWD: \"show\",\r\n FORGOT_PASSWORD_FIELDS: [\"CompanyId\", \"Username\"],\r\n BACK_BUTTON: \"hide\",\r\n },\r\n //Transmit configurations\r\n transmitConfigs: {\r\n URL: config.transmitUrl,\r\n BASE_API_URL: \"https://it5-onlinebanking.usbank.com\",\r\n APP_ID: config.appId,\r\n policyIds: {\r\n POLICY: \"login\",\r\n RESET_PASSWORD: \"forgot_pwd\",\r\n },\r\n policyParams: {\r\n appId: config.appId,\r\n ap: config.authProvider,\r\n },\r\n },\r\n constants: {\r\n USER_SUFFIX: config.userSuffix,\r\n },\r\n };\r\n\r\n isReady = true;\r\n }\r\n function onAuthFailure(response) {\r\n console.log(\"Failure :( Auth failed. Display your message\");\r\n return false;\r\n }\r\n\r\n async function onAuthSuccess(response) {\r\n console.log(\"success\");\r\n //Audit call TODO\r\n\r\n // let resetPwdSuccessInput = {\r\n // token: response.token,\r\n // };\r\n // const data = await resetPwdSuccess(resetPwdSuccessInput);\r\n // if (data && data === true) {\r\n // console.log(\"Audit call Successfull\");\r\n // } else if (data === false) {\r\n // console.log(\"Audit call Failed\");\r\n // } else if (data.error) {\r\n // console.log(data.error);\r\n // }\r\n }\r\n \r\n let appNameForSiteCat = 'NPM';\r\n let uxNameForSiteCat = 'desktop';\r\n let clientNameForSiteCat = 'SPT';\r\n let appDynamicsKey = config.appdynamicsAppKey;\r\n \r\n return (\r\n <>\r\n {isReady ? (\r\n \r\n ) : (\r\n \r\n {\"Please wait.....\"}\r\n \r\n )}\r\n \r\n );\r\n};\r\n\r\nexport default LASModuleWrapper;\r\n","export const generateUUID = () => {\r\n var dt = new Date().getTime();\r\n var uuid = \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (\r\n c\r\n ) {\r\n const crypto = window.crypto || window.msCrypto;\r\n var array = new Uint32Array(1);\r\n var r = (dt + crypto.getRandomValues(array) * 16) % 16 | 0;\r\n dt = Math.floor(dt / 16);\r\n return (c === \"x\" ? r : (r & 0x3) | 0x8).toString(16);\r\n });\r\n return uuid;\r\n};\r\n\r\nexport function getParameterByName(name, url = window.location.href) {\r\n name = name.replace(/[\\[\\]]/g, '\\\\$&');\r\n var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),\r\n results = regex.exec(url);\r\n if (!results) return null;\r\n if (!results[2]) return '';\r\n return decodeURIComponent(results[2].replace(/\\+/g, ' '));\r\n}\r\n","import React, { createContext, useState, useEffect } from \"react\";\r\nimport axios from \"axios\";\r\n\r\nconst Context = createContext(null);\r\n\r\n// Set default header to prevent caching\r\naxios.defaults.headers.common[\"Pragma\"] = \"no-cache\";\r\naxios.defaults.headers.common[\"Cache-Control\"] = 'no-cache, no-store, must-revalidate';\r\naxios.defaults.headers.common[\"Expires\"] = 0;\r\nconst Provider = (props) => {\r\n const [config, setConfig] = useState({});\r\n const [authData, setAuthData] = useState({});\r\n\r\n const getConfiguration = async () => {\r\n // local url - https://spt-local.us.bank-dns.com:8889\r\n const getConfigurationUrl = `/spt_mobile_web/logon/pubapi/v1/pub/sptmainui/configuration`;\r\n try {\r\n const request = await axios.get(getConfigurationUrl);\r\n const data = await request.data;\r\n setConfig(data);\r\n } catch (err) {\r\n console.log(\"data.error\", err);\r\n }\r\n };\r\n\r\n const getUserDetails = async () => {\r\n // local url - https://spt-local.us.bank-dns.com:8889\r\n const getUserDetailsUrl = `/spt_mobile_web/api/v1/authorizations`;\r\n try {\r\n const request = await axios.get(getUserDetailsUrl);\r\n const data = await request.data;\r\n setAuthData(data);\r\n } catch (err) {\r\n console.log(\"data.error\", err);\r\n }\r\n };\r\n\r\n const getCCSmessage = async (customerId) => {\r\n const url = `/spt_mobile_web/api/v1/pub/sptmainui/${customerId}/ccsinfo`;\r\n try {\r\n const request = await axios.get(url);\r\n return await request.data;\r\n } catch (err) {\r\n console.log(\"data.error\", err);\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n getConfiguration();\r\n //getUserDetails();\r\n }, []);\r\n\r\n return (\r\n \r\n {props.children}\r\n \r\n );\r\n};\r\n\r\nexport { Context, Provider };\r\n","import React, { useContext } from \"react\";\r\n\r\nimport LASModuleWrapper from \"./LASModuleWrapper\";\r\nimport { Context } from \"./Provider\";\r\n\r\n\r\nexport const LegacyPageWrapper = () => {\r\n const { config } = useContext(Context); \r\n\r\n const isConfigReady = config && config.headers;\r\n return ( \r\n \r\n
\r\n {isConfigReady && ( \r\n \r\n )}\r\n
\r\n \r\n );\r\n};\r\n","import React from \"react\";\r\nimport { LegacyPageWrapper as LASModule } from \"./LegacyPageWrapper\";\r\nimport { Provider } from \"./Provider\";\r\n\r\nfunction App() {\r\n return (\r\n \r\n \r\n \r\n );\r\n}\r\n\r\nexport default App;\r\n","import \"react-app-polyfill/ie11\";\r\nimport \"react-app-polyfill/stable\";\r\n\r\nimport React from \"react\";\r\nimport ReactDOM from \"react-dom\";\r\nimport App from \"./App\";\r\nimport \"./index.css\";\r\n\r\nReactDOM.render(\r\n \r\n \r\n ,\r\n document.getElementById(\"reactRoot\")\r\n);\r\n"],"sourceRoot":""}