const EMBEDDED_RENDERER_REGISTRY_KEY = "__openMercatoEmbeddedPaymentGatewayRenderers__";
function getRegistry() {
  const globalState = globalThis;
  if (!globalState[EMBEDDED_RENDERER_REGISTRY_KEY]) {
    globalState[EMBEDDED_RENDERER_REGISTRY_KEY] = /* @__PURE__ */ new Map();
  }
  return globalState[EMBEDDED_RENDERER_REGISTRY_KEY];
}
function toRegistryKey(providerKey, rendererKey) {
  return `${providerKey}:${rendererKey}`;
}
function registerPaymentGatewayRenderer(registration) {
  const registry = getRegistry();
  const key = toRegistryKey(registration.providerKey, registration.rendererKey);
  registry.set(key, registration.Component);
  return () => {
    registry.delete(key);
  };
}
function getPaymentGatewayRenderer(providerKey, rendererKey) {
  return getRegistry().get(toRegistryKey(providerKey, rendererKey));
}
function clearPaymentGatewayRenderers() {
  getRegistry().clear();
}
const registerEmbeddedPaymentGatewayRenderer = registerPaymentGatewayRenderer;
const getEmbeddedPaymentGatewayRenderer = getPaymentGatewayRenderer;
const clearEmbeddedPaymentGatewayRenderers = clearPaymentGatewayRenderers;
export {
  clearEmbeddedPaymentGatewayRenderers,
  clearPaymentGatewayRenderers,
  getEmbeddedPaymentGatewayRenderer,
  getPaymentGatewayRenderer,
  registerEmbeddedPaymentGatewayRenderer,
  registerPaymentGatewayRenderer
};
//# sourceMappingURL=client.js.map
