"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e="3.7.8",t=e,r="function"==typeof Buffer,o="function"==typeof TextDecoder?new TextDecoder:void 0,n="function"==typeof TextEncoder?new TextEncoder:void 0,a=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),i=(e=>{let t={};return a.forEach(((e,r)=>t[e]=r)),t})(),s=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,c=String.fromCharCode.bind(String),f="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),u=e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_")),l=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),d=e=>{let t,r,o,n,i="";const s=e.length%3;for(let s=0;s<e.length;){if((r=e.charCodeAt(s++))>255||(o=e.charCodeAt(s++))>255||(n=e.charCodeAt(s++))>255)throw new TypeError("invalid character found");t=r<<16|o<<8|n,i+=a[t>>18&63]+a[t>>12&63]+a[t>>6&63]+a[63&t]}return s?i.slice(0,s-3)+"===".substring(s):i},p="function"==typeof btoa?e=>btoa(e):r?e=>Buffer.from(e,"binary").toString("base64"):d,h=r?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let r=0,o=e.length;r<o;r+=4096)t.push(c.apply(null,e.subarray(r,r+4096)));return p(t.join(""))},x=function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?u(h(e)):h(e)},A=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?c(192|t>>>6)+c(128|63&t):c(224|t>>>12&15)+c(128|t>>>6&63)+c(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return c(240|t>>>18&7)+c(128|t>>>12&63)+c(128|t>>>6&63)+c(128|63&t)},y=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,b=e=>e.replace(y,A),g=r?e=>Buffer.from(e,"utf8").toString("base64"):n?e=>h(n.encode(e)):e=>p(b(e)),B=function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?u(g(e)):g(e)},C=e=>B(e,!0),U=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,m=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return c(55296+(t>>>10))+c(56320+(1023&t));case 3:return c((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return c((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},F=e=>e.replace(U,m),S=e=>{if(e=e.replace(/\s+/g,""),!s.test(e))throw new TypeError("malformed base64.");let t,r,o;e+="==".slice(2-(3&e.length));let n=[];for(let a=0;a<e.length;)t=i[e.charAt(a++)]<<18|i[e.charAt(a++)]<<12|(r=i[e.charAt(a++)])<<6|(o=i[e.charAt(a++)]),64===r?n.push(c(t>>16&255)):64===o?n.push(c(t>>16&255,t>>8&255)):n.push(c(t>>16&255,t>>8&255,255&t));return n.join("")},v="function"==typeof atob?e=>atob(l(e)):r?e=>Buffer.from(e,"base64").toString("binary"):S,R=r?e=>f(Buffer.from(e,"base64")):e=>f(v(e).split("").map((e=>e.charCodeAt(0)))),w=e=>R(D(e)),E=r?e=>Buffer.from(e,"base64").toString("utf8"):o?e=>o.decode(R(e)):e=>F(v(e)),D=e=>l(e.replace(/[-_]/g,(e=>"-"==e?"+":"/"))),P=e=>E(D(e)),z=e=>{if("string"!=typeof e)return!1;const t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},I=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),T=function(){const e=(e,t)=>Object.defineProperty(String.prototype,e,I(t));e("fromBase64",(function(){return P(this)})),e("toBase64",(function(e){return B(this,e)})),e("toBase64URI",(function(){return B(this,!0)})),e("toBase64URL",(function(){return B(this,!0)})),e("toUint8Array",(function(){return w(this)}))},Z=function(){const e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,I(t));e("toBase64",(function(e){return x(this,e)})),e("toBase64URI",(function(){return x(this,!0)})),e("toBase64URL",(function(){return x(this,!0)}))},j=()=>{T(),Z()},O={version:e,VERSION:t,atob:v,atobPolyfill:S,btoa:p,btoaPolyfill:d,fromBase64:P,toBase64:B,encode:B,encodeURI:C,encodeURL:C,utob:b,btou:F,decode:P,isValid:z,fromUint8Array:x,toUint8Array:w,extendString:T,extendUint8Array:Z,extendBuiltins:j};exports.Base64=O,exports.VERSION=t,exports.atob=v,exports.atobPolyfill=S,exports.btoa=p,exports.btoaPolyfill=d,exports.btou=F,exports.decode=P,exports.encode=B,exports.encodeURI=C,exports.encodeURL=C,exports.extendBuiltins=j,exports.extendString=T,exports.extendUint8Array=Z,exports.fromBase64=P,exports.fromUint8Array=x,exports.isValid=z,exports.toBase64=B,exports.toUint8Array=w,exports.utob=b,exports.version=e;
//# sourceMappingURL=base64.mjs.js.map
