{"version":3,"file":"useEnvironmentURLs.ThFDWEO0.mjs","names":["useState","useCallback"],"sources":["https:/framerusercontent.com/modules/VcWf9viUxq6pXm4bBSD3/qgOvt4WPXVc5EkUANcdK/useEnvironmentURLs.js"],"sourcesContent":["/**\n * A shared hook used to get common full URLs required throughout framer based on the window's hostname.\n */import{useCallback,useEffect,useState}from\"react\";const ENVIRONMENT_URLS={production:{rocketLoans:\"https://rocketloans.com\",personalLoans:\"https://qa2.rockloans.com\",myRocketMortgage:\"https://rocket.com/mortgage/servicing\",myRocketMoney:\"https://app.rocketmoney.com/\",myRocketPersonalLoans:\"https://personal.rocketloans.com/secure/rocket-routing?src=myrocket\",myRocketToolsAndServices:\"https://rocket.com/mortgage/servicing/tools-and-services\",rocketAccountSignInSecurity:\"https://preferences.myrocket.com/profile/security\",legacyIndexRouting:\"https://www.rocketloans.com/inq/index.html#/\"},staging:{rocketLoans:\"https://qa2.rockloans.com\",personalLoans:\"https://sandbox1.personal.rockloans.com\",myRocketMortgage:\"https://beta.rocket.com/mortgage/servicing\",myRocketMoney:\"https://app.rocketmoney.dev/\",myRocketPersonalLoans:\"https://sandbox1.personal.rockloans.com/secure/rocket-routing?src=myRocket\",myRocketToolsAndServices:\"https://beta.rocket.com/mortgage/servicing/tools-and-services\",rocketAccountSignInSecurity:\"https://preferences.beta.myrocket.com/profile/security\",legacyIndexRouting:\"https://qa2.rockloans.com/inq/index.html#/\"}};export function useEnvironmentURLs(){const[didMount,setDidMount]=useState(false);useEffect(()=>{setDidMount(true);},[]);/**\n     * Get a list of production and staging environment URLs\n     */const getEnvironmentURLs=useCallback(()=>{if(typeof window===\"undefined\"||!didMount){return ENVIRONMENT_URLS.production;}const hostname=window.location.hostname;const isProduction=hostname.includes(\"www.rocketloans.com\");if(isProduction){return ENVIRONMENT_URLS.production;}return ENVIRONMENT_URLS.staging;},[didMount]);/**\n     * Generate a full URL given a platform, and a pathname\n     *\n     * @param platform The platform. EG: rocketLoans, or personalLoans\n     * @param pathname The URL path staring with a forward slash: EG: \"/apply\"\n     * @returns A full URL. eg: \"https://personal.rocketloans.com/apply\"\n     */const getEnvironmentURL=useCallback((platform,pathname=\"\")=>{const environmentURLs=getEnvironmentURLs();return`${environmentURLs[platform]}${pathname}`;},[getEnvironmentURLs]);return{getEnvironmentURL};}\nexport const __FramerMetadata__ = {\"exports\":{\"RocketLoansPlatformURLs\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useEnvironmentURLs\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./useEnvironmentURLs.map"],"mappings":"gIAEynC,SAAgB,GAAoB,CAAC,GAAK,CAAC,EAAS,GAAaA,EAAS,GAAM,CAAC,MAAc,CAAC,EAAY,GAAK,EAAG,EAAE,CAAC,CAEzuC,IAAM,EAAmBC,MAA2B,IAAS,QAAa,CAAC,GAA6D,EAAO,SAAS,SAAqC,SAAS,sBAAsB,CAAyB,EAAiB,WAAmB,EAAiB,QAAU,CAAC,EAAS,CAAC,CAM/I,MAAM,CAAC,kBAA/JA,GAAa,EAAS,EAAS,KAAuD,GAA3B,GAAoB,CAA0B,KAAY,IAAa,CAAC,EAAmB,CAAC,CAA0B,wBAR3J,CAAM,EAAiB,CAAC,WAAW,CAAC,YAAY,0BAA0B,cAAc,4BAA4B,iBAAiB,wCAAwC,cAAc,+BAA+B,sBAAsB,sEAAsE,yBAAyB,2DAA2D,4BAA4B,oDAAoD,mBAAmB,+CAA+C,CAAC,QAAQ,CAAC,YAAY,4BAA4B,cAAc,0CAA0C,iBAAiB,6CAA6C,cAAc,+BAA+B,sBAAsB,6EAA6E,yBAAyB,gEAAgE,4BAA4B,yDAAyD,mBAAmB,6CAA6C,CAAC"}