module.exports.makeCppFileTemplateIOS = data => {
  return "\n  #include \"crypto.hpp\"\n  #include <string>\n  #include \"encrypt.h\"\n\n  using namespace std;\n\n    Crypto::Crypto() {\n\n    }\n\n\n    std::string Crypto::getJniJsonStringyfyData(string key) {\n      std::string jsonStringyfyData= \"".concat(data, "\";\n        string hash;\n        int len=jsonStringyfyData.length();\n        char cahrtot[len+1];\n        strcpy(cahrtot,jsonStringyfyData.c_str());\n        hash=SHA256(cahrtot);\n        string halfString=hash.substr(hash.length()/2);\n        if(key==halfString)\n        {\n          return jsonStringyfyData;\n        }\n        else\n        {\n            return \"\";\n        }\n      \n    }\n  ");
};

module.exports.makeHppFileTemplateIOS = () => {
  return "\n  #ifndef crypto_hpp\n  #define crypto_hpp\n\n  #include <stdio.h>\n  #include <string>\n  using namespace std;\n\n  class Crypto {\n  public:Crypto();\n    string getJniJsonStringyfyData(string key);\n  };\n  #endif\n  \n  ";
};

module.exports.makeKeysPackageHTemplateIOS = () => {
  return "\n  #import <Foundation/Foundation.h>\n  #import <React/RCTBridgeModule.h>\n\n  NS_ASSUME_NONNULL_BEGIN\n\n  @interface Keys : NSObject <RCTBridgeModule>\n  + (NSString *)secureFor: (NSString *)key;\n\n  @end\n\n  NS_ASSUME_NONNULL_END\n\n  ";
};

module.exports.makeKeysPackageMMTemplateIOS = key => {
  return "\n  #import \"Keys.h\"\n  #import \"./crypto.cpp\"\n  #import \"./crypto.hpp\"\n  #import \"GeneratedDotEnv.m\"\n  @implementation Keys\n\n  RCT_EXPORT_MODULE();\n  string privateKey=\"".concat(key, "\";\n  + (NSString *)secureFor: (NSString *)key {\n      @try {\n          NSString* stringfyData = [NSString stringWithCString:Crypto().getJniJsonStringyfyData(privateKey).c_str() encoding:[NSString defaultCStringEncoding]];\n          NSLog(stringfyData);\n          NSData *data = [stringfyData dataUsingEncoding:NSUTF8StringEncoding];\n          NSMutableDictionary *s = [NSJSONSerialization JSONObjectWithData:data options:0 error:NULL];\n          NSString *value =[s objectForKey:key];\n          return value;\n      }\n      @catch (NSException *exception) {\n          return @\"\";\n      }\n  }\n\n  + (NSDictionary *)public_keys {\n    return (NSDictionary *)DOT_ENV;\n  }\n\n  + (NSString *)publicFor: (NSString *)key {\n      NSString *value = (NSString *)[self.public_keys objectForKey:key];\n      return value;\n  }\n\n  - (NSDictionary *)constantsToExport {\n    return (NSDictionary *)DOT_ENV;\n  }\n\n  RCT_EXPORT_METHOD(secureFor:(NSString *) key\n                  getBasicWithResolver:(RCTPromiseResolveBlock)resolve\n                  rejecter:(RCTPromiseRejectBlock)reject)\n  {\n      @try {\n          NSString* value = [Keys secureFor:key];\n          resolve(value);\n      }\n      @catch (NSException *exception) {\n          resolve(@\"\");\n      }\n      \n  }\n\n  @end\n  ");
};

module.exports.makeXcConfigFIlle = keys => {
  try {
    let env_keys = [];

    for (let [key, value] of Object.entries(keys)) {
      env_keys.push("".concat(key, "=").concat(value));
    }

    return env_keys.join('\n');
  } catch (error) {
    return '';
  }
};

module.exports.makeGeneratedDotEnvTemplateIOS = keys => {
  try {
    let env_keys = [];

    for (let [key, value] of Object.entries(keys)) {
      env_keys.push("@\"".concat(key, "\":@\"").concat(value, "\""));
    }

    const dotEnv = env_keys.join();
    return "#define DOT_ENV @{ ".concat(dotEnv, " };");
  } catch (error) {
    return "#define DOT_ENV @{};";
  }
};
//# sourceMappingURL=keysFilesTemplateIos.js.map