ff-request-dist/dist/ff-request.umd.cjs

2 lines
12 KiB
JavaScript
Raw Normal View History

2024-05-12 01:15:30 +08:00
(function(p,w){typeof exports=="object"&&typeof module<"u"?w(exports):typeof define=="function"&&define.amd?define(["exports"],w):(p=typeof globalThis<"u"?globalThis:p||self,w(p["ff-request"]={}))})(this,function(p){"use strict";var ye=Object.defineProperty;var be=(p,w,_)=>w in p?ye(p,w,{enumerable:!0,configurable:!0,writable:!0,value:_}):p[w]=_;var P=(p,w,_)=>(be(p,typeof w!="symbol"?w+"":w,_),_),le=(p,w,_)=>{if(!w.has(p))throw TypeError("Cannot "+_)};var f=(p,w,_)=>(le(p,w,"read from private field"),_?_.call(p):w.get(p)),C=(p,w,_)=>{if(w.has(p))throw TypeError("Cannot add the same private member more than once");w instanceof WeakSet?w.add(p):w.set(p,_)},q=(p,w,_,Y)=>(le(p,w,"write to private field"),Y?Y.call(p,_):w.set(p,_),_);var G,B,z,J,Q,W,L,X,Z,H,K,k,M,D;function w(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function _(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var i=0;i<t.length;i++){var h=t.charAt(i),y=h.charCodeAt(0);if(e[y]!==255)throw new TypeError(h+" is ambiguous");e[y]=i}var l=t.length,x=t.charAt(0),V=Math.log(l)/Math.log(256),F=Math.log(256)/Math.log(l);function j(s){if(s instanceof Uint8Array||(ArrayBuffer.isView(s)?s=new Uint8Array(s.buffer,s.byteOffset,s.byteLength):Array.isArray(s)&&(s=Uint8Array.from(s))),!(s instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(s.length===0)return"";for(var a=0,c=0,d=0,o=s.length;d!==o&&s[d]===0;)d++,a++;for(var u=(o-d)*F+1>>>0,g=new Uint8Array(u);d!==o;){for(var A=s[d],T=0,b=u-1;(A!==0||T<c)&&b!==-1;b--,T++)A+=256*g[b]>>>0,g[b]=A%l>>>0,A=A/l>>>0;if(A!==0)throw new Error("Non-zero carry");c=T,d++}for(var n=u-c;n!==u&&g[n]===0;)n++;for(var E=x.repeat(a);n<u;++n)E+=t.charAt(g[n]);return E}function U(s){if(typeof s!="string")throw new TypeError("Expected String");if(s.length===0)return new Uint8Array;for(var a=0,c=0,d=0;s[a]===x;)c++,a++;for(var o=(s.length-a)*V+1>>>0,u=new Uint8Array(o);s[a];){var g=e[s.charCodeAt(a)];if(g===255)return;for(var A=0,T=o-1;(g!==0||A<d)&&T!==-1;T--,A++)g+=l*u[T]>>>0,u[T]=g%256>>>0,g=g/256>>>0;if(g!==0)throw new Error("Non-zero carry");d=A,a++}for(var b=o-d;b!==o&&u[b]===0;)b++;for(var n=new Uint8Array(c+(o-b)),E=c;b!==o;)n[E++]=u[b++];return n}function v(s){var a=U(s);if(a)return a;throw new Error("Non-base"+l+" character")}return{encode:j,decodeUnsafe:U,decode:v}}var Y=_;const ce=w(Y);var ne={};(function(t){(function(e){e([],function(){var r=-1,i=-2,h=-3,y=-4,l=-5,x=function(a,c){c=c||{};var d=c.verbose||!1;d&&console.log("Normalize the JSON Object"),a=typeof a=="string"?this.JSON.parse(a):a,d&&console.log("Creating a empty dictionary");var o={strings:[],integers:[],floats:[]};d&&console.log("Creating the AST");var u=function b(n){d&&console.log("Calling recursiveAstBuilder with "+this.JSON.stringify(n));var E=typeof n;if(n===null)return{type:"null",index:h};if(typeof n>"u")return{type:"undefined",index:l};if(n instanceof Array){var m=["@"];for(var S in n)n.hasOwnProperty(S)&&m.push(b(n[S]));return m}if(E==="object"){var m=["$"];for(var I in n)n.hasOwnProperty(I)&&(m.push(b(I)),m.push(b(n[I])));return m}if(n==="")return{type:"empty",index:y};if(E==="string"){var N=s.call(o.strings,n);return N==-1&&(o.strings.push(F(n)),N=o.strings.length-1),{type:"strings",index:N}}if(E==="number"&&n%1===0){var N=s.call(o.integers,n);return N==-1&&(o.integers.push(U(n)),N=o.integers.length-1),{type:"integers",index:N}}if(E==="number"){var N=s.call(o.floats,n);return N==-1&&(o.floats.push(n),N=o.floats.length-1),{type:"floats",index:N}}if(E==="boolean")return{type:"boolean",index:n?r:i};throw new Error("Unexpected argument of type "+typeof n)}(a),g=o.strings.length,A=o.integers.length;o.floats.length,d&&console.log("Parsing the dictionary");var T=o.strings.join("|");return T+="^"+o.integers.join("|"),T+="^"+o.floats.join("|"),d&&console.log("Parsing the structure"),T+="^"+function b(n){if(d&&console.log("Calling a recursiveParser with "+this.JSON.stringify(n)),n instanceof Array){var E=n.shift();for(var m in n)n.hasOw