1 line
48 KiB
JavaScript
1 line
48 KiB
JavaScript
|
|
var FBA=function(e){"use strict";const P=function(n){const r=[];let i=0;for(let t=0;t<n.length;t++){let e=n.charCodeAt(t);if(e<128){r[i++]=e}else if(e<2048){r[i++]=e>>6|192;r[i++]=e&63|128}else if((e&64512)===55296&&t+1<n.length&&(n.charCodeAt(t+1)&64512)===56320){e=65536+((e&1023)<<10)+(n.charCodeAt(++t)&1023);r[i++]=e>>18|240;r[i++]=e>>12&63|128;r[i++]=e>>6&63|128;r[i++]=e&63|128}else{r[i++]=e>>12|224;r[i++]=e>>6&63|128;r[i++]=e&63|128}}return r};const R=function(t){const n=[];let r=0,i=0;while(r<t.length){const a=t[r++];if(a<128){n[i++]=String.fromCharCode(a)}else if(a>191&&a<224){const s=t[r++];n[i++]=String.fromCharCode((a&31)<<6|s&63)}else if(a>239&&a<365){const s=t[r++];const o=t[r++];const c=t[r++];const e=((a&7)<<18|(s&63)<<12|(o&63)<<6|c&63)-65536;n[i++]=String.fromCharCode(55296+(e>>10));n[i++]=String.fromCharCode(56320+(e&1023))}else{const s=t[r++];const o=t[r++];n[i++]=String.fromCharCode((a&15)<<12|(s&63)<<6|o&63)}}return n.join("")};const H={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZ"+"abcdefghijklmnopqrstuvwxyz"+"0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob==="function",encodeByteArray(r,e){if(!Array.isArray(r)){throw Error("encodeByteArray takes an array as a parameter")}this.init_();const i=e?this.byteToCharMapWebSafe_:this.byteToCharMap_;const a=[];for(let n=0;n<r.length;n+=3){const s=r[n];const o=n+1<r.length;const c=o?r[n+1]:0;const l=n+2<r.length;const u=l?r[n+2]:0;const d=s>>2;const h=(s&3)<<4|c>>4;let e=(c&15)<<2|u>>6;let t=u&63;if(!l){t=64;if(!o){e=64}}a.push(i[d],i[h],i[e],i[t])}return a.join("")},encodeString(e,t){if(this.HAS_NATIVE_SUPPORT&&!t){return btoa(e)}return this.encodeByteArray(P(e),t)},decodeString(e,t){if(this.HAS_NATIVE_SUPPORT&&!t){return atob(e)}return R(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_;const r=[];for(let e=0;e<t.length;){const i=n[t.charAt(e++)];const a=e<t.length;const s=a?n[t.charAt(e)]:0;++e;const o=e<t.length;const c=o?n[t.charAt(e)]:64;++e;const l=e<t.length;const u=l?n[t.charAt(e)]:64;++e;if(i==null||s==null||c==null||u==null){throw new F}const d=i<<2|s>>4;r.push(d);if(c!==64){const h=s<<4&240|c>>2;r.push(h);if(u!==64){const f=c<<6&192|u;r.push(f)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={};this.charToByteMap_={};this.byteToCharMapWebSafe_={};this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++){this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e);this.charToByteMap_[this.byteToCharMap_[e]]=e;this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e);this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e;if(e>=this.ENCODED_VALS_BASE.length){this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e;this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e}}}}};class F extends Error{constructor(){super(...arguments);this.name="DecodeBase64StringError"}}const x=function(e){const t=P(e);return H.encodeByteArray(t,true)};const V=function(e){return x(e).replace(/\./g,"")};const z=function(e){try{return H.decodeString(e,true)}catch(e){console.error("base64Decode failed: ",e)}return null};function U(){if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw new Error("Unable to locate global object.")}const W=()=>U().__FIREBASE_DEFAULTS__;const q=()=>{if(typeof process==="undefined"||typeof process.env==="undefined"){return}const e=process.env.__FIREBASE_DEFAULTS__;if(e){return JSON.parse(e)}};const G=()=>{if(typeof document==="undefined"){return}let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(e){return}const t=e&&z(e[1]);return t&&JSON.parse(t)};const K=()=>{try{return W()||q()||G()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}};const J=()=>{var e;return(e=K())===null||e==
|