function base64ToBytes(base64) {
  const binString = atob(base64);
  return Uint8Array.from(binString, (m) => m.codePointAt(0));
}
function bytesToBase64(bytes) {
  const binString = Array.from(bytes, (byte) => String.fromCodePoint(byte)).join("");
  return btoa(binString);
}
function encodeUnicodeBase64(input) {
  return bytesToBase64(new TextEncoder().encode(input)).replaceAll(
    /[=+/]/g,
    (r) => ({ "=": ".", "/": "_", "+": "-" })[r]
  );
}
function decodeUnicodeBase64(input) {
  return new TextDecoder().decode(
    base64ToBytes(input.replaceAll(/[._-]/g, (r) => ({ ".": "=", _: "/", "-": "+" })[r]))
  );
}
export {
  decodeUnicodeBase64,
  encodeUnicodeBase64
};
//# sourceMappingURL=unicode-base64.js.map
