{"version":3,"sources":["jsdelivr-header.js","/npm/temp_mail_otp_template@1.0.2/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OCNO,UAAW,eACX,WAAY,gBACV,UAAa,kBAEtB,IAAI,QAAU,GAEd,MAAM,WAAc,GAAQ,QAAU,EAEhC,WAAa,MAAO,EAAK,KAC3B,IAOI,aANuB,MAAM,IAAI,GAAG,mBAAoB,CACpD,QAAS,CACL,iBAAkB,EAClB,kBAAmB,MAGX,IAEpB,CAAE,MAAO,GACL,QAAQ,IAAI,EAChB,GAGE,cAAiB,GAEL,IADG,MAAM,KAAK,YAAc,MAAM,KAAK,YAC3B,gBAAgB,IAIxC,YAAc,MAAO,EAAO,EAAK,KACnC,IAOI,aANuB,MAAM,IAAI,GAAG,mBAAmB,QAAQ,MAAW,CACtE,QAAS,CACL,iBAAkB,EAClB,kBAAmB,MAGX,IACpB,CAAE,MAAO,GACL,QAAQ,IAAI,EAChB,GAGE,QAAW,GAAQ,OAAO,WAAW,OAAO,OAAO,GAAK,OAAO,qBAEtD,CAAE,sBAAY,gBAAS,wBAAa,sBAAY","file":"/npm/temp_mail_otp_template@1.0.2/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/temp_mail_otp_template@1.0.2/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import axios from \"axios\";\r\nimport crypto from 'crypto';\r\nimport { faker } from '@faker-js/faker'\r\n\r\nvar baseUrl = ''\r\n\r\nconst setBaseUrl = (url) => baseUrl = url\r\n\r\nconst getDomains = async (key, host) => {\r\n    try {\r\n        const response = await axios.get(`${baseUrl}/domains/`, {\r\n            headers: {\r\n                'X-RapidAPI-Key': key,\r\n                'X-RapidAPI-Host': host\r\n            }\r\n        })\r\n        return response.data\r\n\r\n    } catch (error) {\r\n        console.log(error)\r\n    }\r\n}\r\n\r\nconst generateEmail = (domain) => {\r\n    const fullName = faker.name.firstName() + faker.name.lastName()\r\n    const email = `${fullName.toLowerCase()}${domain}`\r\n    return email\r\n}\r\n\r\nconst getMessages = async (email, key, host) => {\r\n    try {\r\n        const response = await axios.get(`${baseUrl}/mail/id/${getHash(email)}/`, {\r\n            headers: {\r\n                'X-RapidAPI-Key': key,\r\n                'X-RapidAPI-Host': host\r\n            }\r\n        })\r\n        return response.data\r\n    } catch (e) {\r\n        console.log(e)\r\n    }\r\n}\r\n\r\nconst getHash = (str) => crypto.createHash('md5').update(str).digest('hex')\r\n\r\nexport default { getDomains, getHash, getMessages, setBaseUrl, generateEmail }"]}