@dappworks/urpc
Advanced tools
Comparing version 0.0.10 to 0.0.11
@@ -22,2 +22,3 @@ // Generated by dts-bundle-generator v9.5.1 | ||
export interface URPC_Function<T extends Object = {}, R = any> { | ||
uid?: string; | ||
type?: "func"; | ||
@@ -33,2 +34,3 @@ name?: string; | ||
export interface URPC_Variable<T extends () => any = () => any, R = any> { | ||
uid?: string; | ||
type?: "var"; | ||
@@ -48,2 +50,3 @@ name?: string; | ||
falttenSchema: URPC_Schema; | ||
uidSchemas: URPC_Schema; | ||
static Var<T extends () => any, R = any>(args: URPC_Variable<T, R>): URPC_Variable<T, R>; | ||
@@ -53,2 +56,3 @@ static Func<T extends Object = {}, R = any>(args: URPC_Function<T, R>): URPC_Function<T, R>; | ||
loadFull(): ({ | ||
uid: string | undefined; | ||
type: "func"; | ||
@@ -61,2 +65,3 @@ name: string | undefined; | ||
} | { | ||
uid: string | undefined; | ||
type: "var" | undefined; | ||
@@ -71,2 +76,3 @@ name: string | undefined; | ||
name: string; | ||
uid?: undefined; | ||
input?: undefined; | ||
@@ -116,2 +122,3 @@ uiConfig?: undefined; | ||
loadFull(): Promise<({ | ||
uid: string | undefined; | ||
type: "func"; | ||
@@ -124,2 +131,3 @@ name: string | undefined; | ||
} | { | ||
uid: string | undefined; | ||
type: "var" | undefined; | ||
@@ -134,2 +142,3 @@ name: string | undefined; | ||
name: string; | ||
uid?: undefined; | ||
input?: undefined; | ||
@@ -136,0 +145,0 @@ uiConfig?: undefined; |
@@ -1,1 +0,1 @@ | ||
var YR=Object.create;var{defineProperty:d,getPrototypeOf:wR,getOwnPropertyNames:qR}=Object;var KR=Object.prototype.hasOwnProperty;var g=(R,U,P)=>{P=R!=null?YR(wR(R)):{};const T=U||!R||!R.__esModule?d(P,"default",{value:R,enumerable:!0}):P;for(let _ of qR(R))if(!KR.call(T,_))d(T,_,{get:()=>R[_],enumerable:!0});return T};var p=(R,U)=>()=>(U||R((U={exports:{}}).exports,U),U.exports);var t=p((wP,l)=>{var nR=function(R,U){return R==null?void 0:R[U]},IR=function(R){var U=!1;if(R!=null&&typeof R.toString!="function")try{U=!!(R+"")}catch(P){}return U},$=function(R){var U=-1,P=R?R.length:0;this.clear();while(++U<P){var T=R[U];this.set(T[0],T[1])}},kR=function(){this.__data__=Y?Y(null):{}},bR=function(R){return this.has(R)&&delete this.__data__[R]},hR=function(R){var U=this.__data__;if(Y){var P=U[R];return P===h?void 0:P}return f.call(U,R)?U[R]:void 0},yR=function(R){var U=this.__data__;return Y?U[R]!==void 0:f.call(U,R)},cR=function(R,U){var P=this.__data__;return P[R]=Y&&U===void 0?h:U,this},X=function(R){var U=-1,P=R?R.length:0;this.clear();while(++U<P){var T=R[U];this.set(T[0],T[1])}},oR=function(){this.__data__=[]},rR=function(R){var U=this.__data__,P=E(U,R);if(P<0)return!1;var T=U.length-1;if(P==T)U.pop();else jR.call(U,P,1);return!0},sR=function(R){var U=this.__data__,P=E(U,R);return P<0?void 0:U[P][1]},vR=function(R){return E(this.__data__,R)>-1},uR=function(R,U){var P=this.__data__,T=E(P,R);if(T<0)P.push([R,U]);else P[T][1]=U;return this},B=function(R){var U=-1,P=R?R.length:0;this.clear();while(++U<P){var T=R[U];this.set(T[0],T[1])}},lR=function(){this.__data__={hash:new $,map:new(iR||X),string:new $}},tR=function(R){return A(this,R).delete(R)},aR=function(R){return A(this,R).get(R)},eR=function(R){return A(this,R).has(R)},RU=function(R,U){return A(this,R).set(R,U),this},UU=function(R,U,P){var T=R[U];if(!(f.call(R,U)&&v(T,P))||P===void 0&&!(U in R))R[U]=P},E=function(R,U){var P=R.length;while(P--)if(v(R[P][0],U))return P;return-1},PU=function(R){if(!G(R)||QU(R))return!1;var U=VU(R)||IR(R)?pR:DR;return U.test(XU(R))},TU=function(R,U,P,T){if(!G(R))return R;U=$U(U,R)?[U]:FU(U);var _=-1,F=U.length,Z=F-1,W=R;while(W!=null&&++_<F){var q=WU(U[_]),K=P;if(_!=Z){var z=W[q];if(K=T?T(z,q,W):void 0,K===void 0)K=G(z)?z:ZU(U[_+1])?[]:{}}UU(W,q,K),W=W[q]}return R},_U=function(R){if(typeof R=="string")return R;if(D(R))return b?b.call(R):"";var U=R+"";return U=="0"&&1/R==-y?"-0":U},FU=function(R){return u(R)?R:JU(R)},A=function(R,U){var P=R.__data__;return BU(U)?P[typeof U=="string"?"string":"hash"]:P.map},s=function(R,U){var P=nR(R,U);return PU(P)?P:void 0},ZU=function(R,U){return U=U==null?fR:U,!!U&&(typeof R=="number"||HR.test(R))&&(R>-1&&R%1==0&&R<U)},$U=function(R,U){if(u(R))return!1;var P=typeof R;if(P=="number"||P=="symbol"||P=="boolean"||R==null||D(R))return!0;return SR.test(R)||!OR.test(R)||U!=null&&R in Object(U)},BU=function(R){var U=typeof R;return U=="string"||U=="number"||U=="symbol"||U=="boolean"?R!=="__proto__":R===null},QU=function(R){return!!j&&j in R},WU=function(R){if(typeof R=="string"||D(R))return R;var U=R+"";return U=="0"&&1/R==-y?"-0":U},XU=function(R){if(R!=null){try{return o.call(R)}catch(U){}try{return R+""}catch(U){}}return""},M=function(R,U){if(typeof R!="function"||U&&typeof U!="function")throw new TypeError(GR);var P=function(){var T=arguments,_=U?U.apply(this,T):T[0],F=P.cache;if(F.has(_))return F.get(_);var Z=R.apply(this,T);return P.cache=F.set(_,Z),Z};return P.cache=new(M.Cache||B),P},v=function(R,U){return R===U||R!==R&&U!==U},VU=function(R){var U=G(R)?r.call(R):"";return U==ER||U==AR},G=function(R){var U=typeof R;return!!R&&(U=="object"||U=="function")},YU=function(R){return!!R&&typeof R=="object"},D=function(R){return typeof R=="symbol"||YU(R)&&r.call(R)==LR},wU=function(R){return R==null?"":_U(R)},qU=function(R,U,P){return R==null?R:TU(R,U,P)},GR="Expected a function",h="__lodash_hash_undefined__",y=Infinity,fR=9007199254740991,ER="[object Function]",AR="[object GeneratorFunction]",LR="[object Symbol]",OR=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,SR=/^\w*$/,zR=/^\./,CR=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,NR=/[\\^$.*+?()[\]{}|]/g,MR=/\\(\\)?/g,DR=/^\[object .+?Constructor\]$/,HR=/^(?:0|[1-9]\d*)$/,xR=typeof global=="object"&&global&&global.Object===Object&&global,mR=typeof self=="object"&&self&&self.Object===Object&&self,N=xR||mR||Function("return this")(),dR=Array.prototype,gR=Function.prototype,c=Object.prototype,C=N["__core-js_shared__"],j=function(){var R=/[^.]+$/.exec(C&&C.keys&&C.keys.IE_PROTO||"");return R?"Symbol(src)_1."+R:""}(),o=gR.toString,f=c.hasOwnProperty,r=c.toString,pR=RegExp("^"+o.call(f).replace(NR,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),i=N.Symbol,jR=dR.splice,iR=s(N,"Map"),Y=s(Object,"create"),k=i?i.prototype:void 0,b=k?k.toString:void 0;$.prototype.clear=kR;$.prototype.delete=bR;$.prototype.get=hR;$.prototype.has=yR;$.prototype.set=cR;X.prototype.clear=oR;X.prototype.delete=rR;X.prototype.get=sR;X.prototype.has=vR;X.prototype.set=uR;B.prototype.clear=lR;B.prototype.delete=tR;B.prototype.get=aR;B.prototype.has=eR;B.prototype.set=RU;var JU=M(function(R){R=wU(R);var U=[];if(zR.test(R))U.push("");return R.replace(CR,function(P,T,_,F){U.push(_?F.replace(MR,"$1"):T||P)}),U});M.Cache=B;var u=Array.isArray;l.exports=qU});var XR=p((fP,WR)=>{var xU=function(R,U){return R==null?void 0:R[U]},mU=function(R){var U=!1;if(R!=null&&typeof R.toString!="function")try{U=!!(R+"")}catch(P){}return U},Q=function(R){var U=-1,P=R?R.length:0;this.clear();while(++U<P){var T=R[U];this.set(T[0],T[1])}},jU=function(){this.__data__=w?w(null):{}},iU=function(R){return this.has(R)&&delete this.__data__[R]},kU=function(R){var U=this.__data__;if(w){var P=U[R];return P===TR?void 0:P}return m.call(U,R)?U[R]:void 0},bU=function(R){var U=this.__data__;return w?U[R]!==void 0:m.call(U,R)},hU=function(R,U){var P=this.__data__;return P[R]=w&&U===void 0?TR:U,this},V=function(R){var U=-1,P=R?R.length:0;this.clear();while(++U<P){var T=R[U];this.set(T[0],T[1])}},yU=function(){this.__data__=[]},cU=function(R){var U=this.__data__,P=O(U,R);if(P<0)return!1;var T=U.length-1;if(P==T)U.pop();else gU.call(U,P,1);return!0},oU=function(R){var U=this.__data__,P=O(U,R);return P<0?void 0:U[P][1]},rU=function(R){return O(this.__data__,R)>-1},sU=function(R,U){var P=this.__data__,T=O(P,R);if(T<0)P.push([R,U]);else P[T][1]=U;return this},J=function(R){var U=-1,P=R?R.length:0;this.clear();while(++U<P){var T=R[U];this.set(T[0],T[1])}},vU=function(){this.__data__={hash:new Q,map:new(pU||V),string:new Q}},uU=function(R){return S(this,R).delete(R)},lU=function(R){return S(this,R).get(R)},tU=function(R){return S(this,R).has(R)},aU=function(R,U){return S(this,R).set(R,U),this},O=function(R,U){var P=R.length;while(P--)if(QP(R[P][0],U))return P;return-1},eU=function(R,U){U=TP(U,R)?[U]:PP(U);var P=0,T=U.length;while(R!=null&&P<T)R=R[$P(U[P++])];return P&&P==T?R:void 0},RP=function(R){if(!JR(R)||FP(R))return!1;var U=JP(R)||mU(R)?dU:MU;return U.test(BP(R))},UP=function(R){if(typeof R=="string")return R;if(I(R))return PR?PR.call(R):"";var U=R+"";return U=="0"&&1/R==-_R?"-0":U},PP=function(R){return QR(R)?R:ZP(R)},S=function(R,U){var P=R.__data__;return _P(U)?P[typeof U=="string"?"string":"hash"]:P.map},BR=function(R,U){var P=xU(R,U);return RP(P)?P:void 0},TP=function(R,U){if(QR(R))return!1;var P=typeof R;if(P=="number"||P=="symbol"||P=="boolean"||R==null||I(R))return!0;return OU.test(R)||!LU.test(R)||U!=null&&R in Object(U)},_P=function(R){var U=typeof R;return U=="string"||U=="number"||U=="symbol"||U=="boolean"?R!=="__proto__":R===null},FP=function(R){return!!e&&e in R},$P=function(R){if(typeof R=="string"||I(R))return R;var U=R+"";return U=="0"&&1/R==-_R?"-0":U},BP=function(R){if(R!=null){try{return ZR.call(R)}catch(U){}try{return R+""}catch(U){}}return""},n=function(R,U){if(typeof R!="function"||U&&typeof U!="function")throw new TypeError(GU);var P=function(){var T=arguments,_=U?U.apply(this,T):T[0],F=P.cache;if(F.has(_))return F.get(_);var Z=R.apply(this,T);return P.cache=F.set(_,Z),Z};return P.cache=new(n.Cache||J),P},QP=function(R,U){return R===U||R!==R&&U!==U},JP=function(R){var U=JR(R)?$R.call(R):"";return U==fU||U==EU},JR=function(R){var U=typeof R;return!!R&&(U=="object"||U=="function")},WP=function(R){return!!R&&typeof R=="object"},I=function(R){return typeof R=="symbol"||WP(R)&&$R.call(R)==AU},XP=function(R){return R==null?"":UP(R)},VP=function(R,U,P){var T=R==null?void 0:eU(R,U);return T===void 0?P:T},GU="Expected a function",TR="__lodash_hash_undefined__",_R=Infinity,fU="[object Function]",EU="[object GeneratorFunction]",AU="[object Symbol]",LU=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,OU=/^\w*$/,SU=/^\./,zU=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,CU=/[\\^$.*+?()[\]{}|]/g,NU=/\\(\\)?/g,MU=/^\[object .+?Constructor\]$/,DU=typeof global=="object"&&global&&global.Object===Object&&global,HU=typeof self=="object"&&self&&self.Object===Object&&self,x=DU||HU||Function("return this")(),nU=Array.prototype,IU=Function.prototype,FR=Object.prototype,H=x["__core-js_shared__"],e=function(){var R=/[^.]+$/.exec(H&&H.keys&&H.keys.IE_PROTO||"");return R?"Symbol(src)_1."+R:""}(),ZR=IU.toString,m=FR.hasOwnProperty,$R=FR.toString,dU=RegExp("^"+ZR.call(m).replace(CU,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),RR=x.Symbol,gU=nU.splice,pU=BR(x,"Map"),w=BR(Object,"create"),UR=RR?RR.prototype:void 0,PR=UR?UR.toString:void 0;Q.prototype.clear=jU;Q.prototype.delete=iU;Q.prototype.get=kU;Q.prototype.has=bU;Q.prototype.set=hU;V.prototype.clear=yU;V.prototype.delete=cU;V.prototype.get=oU;V.prototype.has=rU;V.prototype.set=sU;J.prototype.clear=vU;J.prototype.delete=uU;J.prototype.get=lU;J.prototype.has=tU;J.prototype.set=aU;var ZP=n(function(R){R=XP(R);var U=[];if(SU.test(R))U.push("");return R.replace(zU,function(P,T,_,F){U.push(_?F.replace(NU,"$1"):T||P)}),U});n.Cache=J;var QR=Array.isArray;WR.exports=VP});var a=g(t(),1),L={isNamespace:(R)=>R&&!R.type,flattenSchema(R,U){return Object.entries(R).reduce((P,[T,_])=>{if(L.isNamespace(_))P={...P,...L.flattenSchema(_,T)};else{const F=U?`${U}.${T}`:T;Object.assign(_,{name:F}),P[F]=_}return P},{})},wrapSchema(R){return Object.values(R).reduce((U,P)=>{return a.default(U,P.path,P),U},{})}};class KU{schemas;falttenSchema;static Var(R){return{...R,type:"var"}}static Func(R){return{...R,type:"func"}}constructor(R={}){Object.assign(this,R),this.falttenSchema=L.flattenSchema(this.schemas)}loadFull(){return Object.entries(this.falttenSchema).map(([R,U])=>{if(U.type=="func"){const{type:P,input:T,name:_,uiConfig:F}=U;return{type:P,name:_,input:T,uiConfig:F?F():null}}if(U.type=="var"){const{type:P,get:T,set:_,name:F,uiConfig:Z}=U;return{type:P,name:F,value:T(),uiConfig:Z?Z():null,set:!!_}}return{type:"unknown",name:R}})}loadVars(){return Object.entries(this.falttenSchema).filter(([R,U])=>U.type=="var").map(([R,U])=>{const{get:P,name:T}=U;return{name:T,value:P()}})}}var VR=g(XR(),1),EP=(R)=>{return{schema:{async loadFull(){return fetch(`${R.url}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"schema.loadFull"})}).then((U)=>U.json())},async loadVars(){return fetch(`${R.url}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"schema.loadVars"})}).then((U)=>U.json())}},func:{async call(U){return fetch(`${R.url}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"func.call",params:U})}).then((P)=>P.json())}},var:{async set(U){return fetch(`${R.url}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"var.set",params:U})}).then((P)=>P.json())},async patch(U){return fetch(`${R.url}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"var.patch",params:U})}).then((P)=>P.json())}}}},AP=({urpc:R})=>{const U={urpc:R,handle({name:P,params:T}){const _=VR.default(U,P);if(!_)throw new Error("invalid name");return _(T)},schema:{async loadFull(){return R.loadFull()},async loadVars(){return R.loadVars()}},func:{async call(P){const T=R.falttenSchema[P.method];if(!T)throw new Error("invalid func name");return T.func({input:P.input})}},var:{async set(P){const T=R.falttenSchema[P.name];if(!T)throw new Error("invalid var name");if(!T.set)throw new Error("variable can't be set");return T.set(P.value)},async patch(P){throw new Error("TBD")}}};return U};export{L as utils,EP as createSimpleHttpClient,AP as createServerClient,KU as URPC}; | ||
var R$=Object.create;var{defineProperty:uU,getPrototypeOf:J$,getOwnPropertyNames:B$}=Object;var X$=Object.prototype.hasOwnProperty;var PU=(U,Z,$)=>{$=U!=null?R$(J$(U)):{};const Q=Z||!U||!U.__esModule?uU($,"default",{value:U,enumerable:!0}):$;for(let R of B$(U))if(!X$.call(Q,R))uU(Q,R,{get:()=>U[R],enumerable:!0});return Q};var EU=(U,Z)=>()=>(Z||U((Z={exports:{}}).exports,Z),Z.exports);var BZ=EU((U1,JZ)=>{var z$=function(U,Z){return U==null?void 0:U[Z]},D$=function(U){var Z=!1;if(U!=null&&typeof U.toString!="function")try{Z=!!(U+"")}catch($){}return Z},I=function(U){var Z=-1,$=U?U.length:0;this.clear();while(++Z<$){var Q=U[Z];this.set(Q[0],Q[1])}},C$=function(){this.__data__=y?y(null):{}},f$=function(U){return this.has(U)&&delete this.__data__[U]},T$=function(U){var Z=this.__data__;if(y){var $=Z[U];return $===tU?void 0:$}return s.call(Z,U)?Z[U]:void 0},m$=function(U){var Z=this.__data__;return y?Z[U]!==void 0:s.call(Z,U)},d$=function(U,Z){var $=this.__data__;return $[U]=y&&Z===void 0?tU:Z,this},m=function(U){var Z=-1,$=U?U.length:0;this.clear();while(++Z<$){var Q=U[Z];this.set(Q[0],Q[1])}},p$=function(){this.__data__=[]},g$=function(U){var Z=this.__data__,$=l(Z,U);if($<0)return!1;var Q=Z.length-1;if($==Q)Z.pop();else x$.call(Z,$,1);return!0},j$=function(U){var Z=this.__data__,$=l(Z,U);return $<0?void 0:Z[$][1]},n$=function(U){return l(this.__data__,U)>-1},k$=function(U,Z){var $=this.__data__,Q=l($,U);if(Q<0)$.push([U,Z]);else $[Q][1]=Z;return this},x=function(U){var Z=-1,$=U?U.length:0;this.clear();while(++Z<$){var Q=U[Z];this.set(Q[0],Q[1])}},y$=function(){this.__data__={hash:new I,map:new(A$||m),string:new I}},h$=function(U){return o(this,U).delete(U)},b$=function(U){return o(this,U).get(U)},v$=function(U){return o(this,U).has(U)},i$=function(U,Z){return o(this,U).set(U,Z),this},c$=function(U,Z,$){var Q=U[Z];if(!(s.call(U,Z)&&QZ(Q,$))||$===void 0&&!(Z in U))U[Z]=$},l=function(U,Z){var $=U.length;while($--)if(QZ(U[$][0],Z))return $;return-1},u$=function(U){if(!u(U)||e$(U))return!1;var Z=QQ(U)||D$(U)?I$:L$;return Z.test($Q(U))},s$=function(U,Z,$,Q){if(!u(U))return U;Z=t$(Z,U)?[Z]:o$(Z);var R=-1,J=Z.length,B=J-1,X=U;while(X!=null&&++R<J){var Y=ZQ(Z[R]),K=$;if(R!=B){var _=X[Y];if(K=Q?Q(_,Y,X):void 0,K===void 0)K=u(_)?_:r$(Z[R+1])?[]:{}}c$(X,Y,K),X=X[Y]}return U},l$=function(U){if(typeof U=="string")return U;if(MU(U))return rU?rU.call(U):"";var Z=U+"";return Z=="0"&&1/U==-aU?"-0":Z},o$=function(U){return RZ(U)?U:UQ(U)},o=function(U,Z){var $=U.__data__;return a$(Z)?$[typeof Z=="string"?"string":"hash"]:$.map},$Z=function(U,Z){var $=z$(U,Z);return u$($)?$:void 0},r$=function(U,Z){return Z=Z==null?W$:Z,!!Z&&(typeof U=="number"||O$.test(U))&&(U>-1&&U%1==0&&U<Z)},t$=function(U,Z){if(RZ(U))return!1;var $=typeof U;if($=="number"||$=="symbol"||$=="boolean"||U==null||MU(U))return!0;return q$.test(U)||!w$.test(U)||Z!=null&&U in Object(Z)},a$=function(U){var Z=typeof U;return Z=="string"||Z=="number"||Z=="symbol"||Z=="boolean"?U!=="__proto__":U===null},e$=function(U){return!!sU&&sU in U},ZQ=function(U){if(typeof U=="string"||MU(U))return U;var Z=U+"";return Z=="0"&&1/U==-aU?"-0":Z},$Q=function(U){if(U!=null){try{return UZ.call(U)}catch(Z){}try{return U+""}catch(Z){}}return""},HU=function(U,Z){if(typeof U!="function"||Z&&typeof Z!="function")throw new TypeError(Y$);var $=function(){var Q=arguments,R=Z?Z.apply(this,Q):Q[0],J=$.cache;if(J.has(R))return J.get(R);var B=U.apply(this,Q);return $.cache=J.set(R,B),B};return $.cache=new(HU.Cache||x),$},QZ=function(U,Z){return U===Z||U!==U&&Z!==Z},QQ=function(U){var Z=u(U)?ZZ.call(U):"";return Z==K$||Z==_$},u=function(U){var Z=typeof U;return!!U&&(Z=="object"||Z=="function")},RQ=function(U){return!!U&&typeof U=="object"},MU=function(U){return typeof U=="symbol"||RQ(U)&&ZZ.call(U)==G$},JQ=function(U){return U==null?"":l$(U)},BQ=function(U,Z,$){return U==null?U:s$(U,Z,$)},Y$="Expected a function",tU="__lodash_hash_undefined__",aU=Infinity,W$=9007199254740991,K$="[object Function]",_$="[object GeneratorFunction]",G$="[object Symbol]",w$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,q$=/^\w*$/,F$=/^\./,N$=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,P$=/[\\^$.*+?()[\]{}|]/g,E$=/\\(\\)?/g,L$=/^\[object .+?Constructor\]$/,O$=/^(?:0|[1-9]\d*)$/,H$=typeof global=="object"&&global&&global.Object===Object&&global,M$=typeof self=="object"&&self&&self.Object===Object&&self,OU=H$||M$||Function("return this")(),S$=Array.prototype,V$=Function.prototype,eU=Object.prototype,LU=OU["__core-js_shared__"],sU=function(){var U=/[^.]+$/.exec(LU&&LU.keys&&LU.keys.IE_PROTO||"");return U?"Symbol(src)_1."+U:""}(),UZ=V$.toString,s=eU.hasOwnProperty,ZZ=eU.toString,I$=RegExp("^"+UZ.call(s).replace(P$,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),lU=OU.Symbol,x$=S$.splice,A$=$Z(OU,"Map"),y=$Z(Object,"create"),oU=lU?lU.prototype:void 0,rU=oU?oU.toString:void 0;I.prototype.clear=C$;I.prototype.delete=f$;I.prototype.get=T$;I.prototype.has=m$;I.prototype.set=d$;m.prototype.clear=p$;m.prototype.delete=g$;m.prototype.get=j$;m.prototype.has=n$;m.prototype.set=k$;x.prototype.clear=y$;x.prototype.delete=h$;x.prototype.get=b$;x.prototype.has=v$;x.prototype.set=i$;var UQ=HU(function(U){U=JQ(U);var Z=[];if(F$.test(U))Z.push("");return U.replace(N$,function($,Q,R,J){Z.push(R?J.replace(E$,"$1"):Q||$)}),Z});HU.Cache=x;var RZ=Array.isArray;JZ.exports=BQ});var hZ=EU((e,p)=>{var TQ=function(U,Z,$,Q){var R=-1,J=U?U.length:0;while(++R<J){var B=U[R];Z(Q,B,$(B),U)}return Q},mQ=function(U,Z){var $=-1,Q=U?U.length:0;while(++$<Q)if(Z(U[$],$,U))return!0;return!1},dQ=function(U){return function(Z){return Z==null?void 0:Z[U]}},pQ=function(U,Z){var $=-1,Q=Array(U);while(++$<U)Q[$]=Z($);return Q},gQ=function(U){return function(Z){return U(Z)}},jQ=function(U,Z){return U==null?void 0:U[Z]},AU=function(U){var Z=!1;if(U!=null&&typeof U.toString!="function")try{Z=!!(U+"")}catch($){}return Z},nQ=function(U){var Z=-1,$=Array(U.size);return U.forEach(function(Q,R){$[++Z]=[R,Q]}),$},kQ=function(U,Z){return function($){return U(Z($))}},yQ=function(U){var Z=-1,$=Array(U.size);return U.forEach(function(Q){$[++Z]=Q}),$},A=function(U){var Z=-1,$=U?U.length:0;this.clear();while(++Z<$){var Q=U[Z];this.set(Q[0],Q[1])}},aQ=function(){this.__data__=b?b(null):{}},eQ=function(U){return this.has(U)&&delete this.__data__[U]},UR=function(U){var Z=this.__data__;if(b){var $=Z[U];return $===dU?void 0:$}return L.call(Z,U)?Z[U]:void 0},ZR=function(U){var Z=this.__data__;return b?Z[U]!==void 0:L.call(Z,U)},$R=function(U,Z){var $=this.__data__;return $[U]=b&&Z===void 0?dU:Z,this},O=function(U){var Z=-1,$=U?U.length:0;this.clear();while(++Z<$){var Q=U[Z];this.set(Q[0],Q[1])}},QR=function(){this.__data__=[]},RR=function(U){var Z=this.__data__,$=WU(Z,U);if($<0)return!1;var Q=Z.length-1;if($==Q)Z.pop();else cQ.call(Z,$,1);return!0},JR=function(U){var Z=this.__data__,$=WU(Z,U);return $<0?void 0:Z[$][1]},BR=function(U){return WU(this.__data__,U)>-1},XR=function(U,Z){var $=this.__data__,Q=WU($,U);if(Q<0)$.push([U,Z]);else $[Q][1]=Z;return this},H=function(U){var Z=-1,$=U?U.length:0;this.clear();while(++Z<$){var Q=U[Z];this.set(Q[0],Q[1])}},YR=function(){this.__data__={hash:new A,map:new(h||O),string:new A}},WR=function(U){return KU(this,U).delete(U)},KR=function(U){return KU(this,U).get(U)},_R=function(U){return KU(this,U).has(U)},GR=function(U,Z){return KU(this,U).set(U,Z),this},JU=function(U){var Z=-1,$=U?U.length:0;this.__data__=new H;while(++Z<$)this.add(U[Z])},wR=function(U){return this.__data__.set(U,dU),this},qR=function(U){return this.__data__.has(U)},E=function(U){this.__data__=new O(U)},FR=function(){this.__data__=new O},NR=function(U){return this.__data__.delete(U)},PR=function(U){return this.__data__.get(U)},ER=function(U){return this.__data__.has(U)},LR=function(U,Z){var $=this.__data__;if($ instanceof O){var Q=$.__data__;if(!h||Q.length<KQ-1)return Q.push([U,Z]),this;$=this.__data__=new H(Q)}return $.set(U,Z),this},OR=function(U,Z){var $=D(U)||kZ(U)?pQ(U.length,String):[],Q=$.length,R=!!Q;for(var J in U)if((Z||L.call(U,J))&&!(R&&(J=="length"||pZ(J,Q))))$.push(J);return $},WU=function(U,Z){var $=U.length;while($--)if(nZ(U[$][0],Z))return $;return-1},HR=function(U,Z,$,Q){return MR(U,function(R,J,B){Z(Q,R,$(R),B)}),Q},DR=function(U,Z){return U&&zR(U,Z,BU)},TZ=function(U,Z){Z=_U(Z,U)?[Z]:mZ(Z);var $=0,Q=Z.length;while(U!=null&&$<Q)U=U[GU(Z[$++])];return $&&$==Q?U:void 0},SR=function(U){return j.call(U)},VR=function(U,Z){return U!=null&&Z in Object(U)},pU=function(U,Z,$,Q,R){if(U===Z)return!0;if(U==null||Z==null||!wU(U)&&!qU(Z))return U!==U&&Z!==Z;return IR(U,Z,pU,$,Q,R)},IR=function(U,Z,$,Q,R,J){var B=D(U),X=D(Z),Y=IU,K=IU;if(!B)Y=z(U),Y=Y==UU?d:Y;if(!X)K=z(Z),K=K==UU?d:K;var _=Y==d&&!AU(U),q=K==d&&!AU(Z),G=Y==K;if(G&&!_)return J||(J=new E),B||rR(U)?dZ(U,Z,$,Q,R,J):yR(U,Z,Y,$,Q,R,J);if(!(R&g)){var F=_&&L.call(U,"__wrapped__"),N=q&&L.call(Z,"__wrapped__");if(F||N){var M=F?U.value():U,P=N?Z.value():Z;return J||(J=new E),$(M,P,Q,R,J)}}if(!G)return!1;return J||(J=new E),hR(U,Z,$,Q,R,J)},xR=function(U,Z,$,Q){var R=$.length,J=R,B=!Q;if(U==null)return!J;U=Object(U);while(R--){var X=$[R];if(B&&X[2]?X[1]!==U[X[0]]:!(X[0]in U))return!1}while(++R<J){X=$[R];var Y=X[0],K=U[Y],_=X[1];if(B&&X[2]){if(K===void 0&&!(Y in U))return!1}else{var q=new E;if(Q)var G=Q(K,_,Y,U,Z,q);if(!(G===void 0?pU(_,K,Q,XU|g,q):G))return!1}}return!0},AR=function(U){if(!wU(U)||cR(U))return!1;var Z=yZ(U)||AU(U)?vQ:xQ;return Z.test(C(U))},CR=function(U){return qU(U)&&nU(U.length)&&!!W[j.call(U)]},fR=function(U){if(typeof U=="function")return U;if(U==null)return U8;if(typeof U=="object")return D(U)?dR(U[0],U[1]):mR(U);return Z8(U)},TR=function(U){if(!uR(U))return uQ(U);var Z=[];for(var $ in Object(U))if(L.call(U,$)&&$!="constructor")Z.push($);return Z},mR=function(U){var Z=bR(U);if(Z.length==1&&Z[0][2])return jZ(Z[0][0],Z[0][1]);return function($){return $===U||xR($,U,Z)}},dR=function(U,Z){if(_U(U)&&gZ(Z))return jZ(GU(U),Z);return function($){var Q=aR($,U);return Q===void 0&&Q===Z?eR($,U):pU(Z,Q,void 0,XU|g)}},pR=function(U){return function(Z){return TZ(Z,U)}},gR=function(U){if(typeof U=="string")return U;if(kU(U))return PZ?PZ.call(U):"";var Z=U+"";return Z=="0"&&1/U==-EZ?"-0":Z},mZ=function(U){return D(U)?U:sR(U)},jR=function(U,Z){return function($,Q){var R=D($)?TQ:HR,J=Z?Z():{};return R($,U,fR(Q,2),J)}},nR=function(U,Z){return function($,Q){if($==null)return $;if(!jU($))return U($,Q);var R=$.length,J=Z?R:-1,B=Object($);while(Z?J--:++J<R)if(Q(B[J],J,B)===!1)break;return $}},kR=function(U){return function(Z,$,Q){var R=-1,J=Object(Z),B=Q(Z),X=B.length;while(X--){var Y=B[U?X:++R];if($(J[Y],Y,J)===!1)break}return Z}},dZ=function(U,Z,$,Q,R,J){var B=R&g,X=U.length,Y=Z.length;if(X!=Y&&!(B&&Y>X))return!1;var K=J.get(U);if(K&&J.get(Z))return K==Z;var _=-1,q=!0,G=R&XU?new JU:void 0;J.set(U,Z),J.set(Z,U);while(++_<X){var F=U[_],N=Z[_];if(Q)var M=B?Q(N,F,_,Z,U,J):Q(F,N,_,U,Z,J);if(M!==void 0){if(M)continue;q=!1;break}if(G){if(!mQ(Z,function(P,V){if(!G.has(V)&&(F===P||$(F,P,Q,R,J)))return G.add(V)})){q=!1;break}}else if(!(F===N||$(F,N,Q,R,J))){q=!1;break}}return J.delete(U),J.delete(Z),q},yR=function(U,Z,$,Q,R,J,B){switch($){case QU:if(U.byteLength!=Z.byteLength||U.byteOffset!=Z.byteOffset)return!1;U=U.buffer,Z=Z.buffer;case xZ:if(U.byteLength!=Z.byteLength||!Q(new NZ(U),new NZ(Z)))return!1;return!0;case OZ:case HZ:case DZ:return nZ(+U,+Z);case MZ:return U.name==Z.name&&U.message==Z.message;case SZ:case VZ:return U==Z+"";case ZU:var X=nQ;case $U:var Y=J&g;if(X||(X=yQ),U.size!=Z.size&&!Y)return!1;var K=B.get(U);if(K)return K==Z;J|=XU,B.set(U,Z);var _=dZ(X(U),X(Z),Q,R,J,B);return B.delete(U),_;case IZ:if(VU)return VU.call(U)==VU.call(Z)}return!1},hR=function(U,Z,$,Q,R,J){var B=R&g,X=BU(U),Y=X.length,K=BU(Z),_=K.length;if(Y!=_&&!B)return!1;var q=Y;while(q--){var G=X[q];if(!(B?G in Z:L.call(Z,G)))return!1}var F=J.get(U);if(F&&J.get(Z))return F==Z;var N=!0;J.set(U,Z),J.set(Z,U);var M=B;while(++q<Y){G=X[q];var P=U[G],V=Z[G];if(Q)var cU=B?Q(V,P,G,Z,U,J):Q(P,V,G,U,Z,J);if(!(cU===void 0?P===V||$(P,V,Q,R,J):cU)){N=!1;break}M||(M=G=="constructor")}if(N&&!M){var i=U.constructor,c=Z.constructor;if(i!=c&&(("constructor"in U)&&("constructor"in Z))&&!(typeof i=="function"&&i instanceof i&&typeof c=="function"&&c instanceof c))N=!1}return J.delete(U),J.delete(Z),N},KU=function(U,Z){var $=U.__data__;return iR(Z)?$[typeof Z=="string"?"string":"hash"]:$.map},bR=function(U){var Z=BU(U),$=Z.length;while($--){var Q=Z[$],R=U[Q];Z[$]=[Q,R,gZ(R)]}return Z},n=function(U,Z){var $=jQ(U,Z);return AR($)?$:void 0},vR=function(U,Z,$){Z=_U(Z,U)?[Z]:mZ(Z);var Q,R=-1,B=Z.length;while(++R<B){var J=GU(Z[R]);if(!(Q=U!=null&&$(U,J)))break;U=U[J]}if(Q)return Q;var B=U?U.length:0;return!!B&&nU(B)&&pZ(J,B)&&(D(U)||kZ(U))},pZ=function(U,Z){return Z=Z==null?LZ:Z,!!Z&&(typeof U=="number"||AQ.test(U))&&(U>-1&&U%1==0&&U<Z)},_U=function(U,Z){if(D(U))return!1;var $=typeof U;if($=="number"||$=="symbol"||$=="boolean"||U==null||kU(U))return!0;return zQ.test(U)||!MQ.test(U)||Z!=null&&U in Object(Z)},iR=function(U){var Z=typeof U;return Z=="string"||Z=="number"||Z=="symbol"||Z=="boolean"?U!=="__proto__":U===null},cR=function(U){return!!qZ&&qZ in U},uR=function(U){var Z=U&&U.constructor,$=typeof Z=="function"&&Z.prototype||YU;return U===$},gZ=function(U){return U===U&&!wU(U)},jZ=function(U,Z){return function($){if($==null)return!1;return $[U]===Z&&(Z!==void 0||(U in Object($)))}},GU=function(U){if(typeof U=="string"||kU(U))return U;var Z=U+"";return Z=="0"&&1/U==-EZ?"-0":Z},C=function(U){if(U!=null){try{return fZ.call(U)}catch(Z){}try{return U+""}catch(Z){}}return""},gU=function(U,Z){if(typeof U!="function"||Z&&typeof Z!="function")throw new TypeError(_Q);var $=function(){var Q=arguments,R=Z?Z.apply(this,Q):Q[0],J=$.cache;if(J.has(R))return J.get(R);var B=U.apply(this,Q);return $.cache=J.set(R,B),B};return $.cache=new(gU.Cache||H),$},nZ=function(U,Z){return U===Z||U!==U&&Z!==Z},kZ=function(U){return oR(U)&&L.call(U,"callee")&&(!iQ.call(U,"callee")||j.call(U)==UU)},jU=function(U){return U!=null&&nU(U.length)&&!yZ(U)},oR=function(U){return qU(U)&&jU(U)},yZ=function(U){var Z=wU(U)?j.call(U):"";return Z==zZ||Z==GQ},nU=function(U){return typeof U=="number"&&U>-1&&U%1==0&&U<=LZ},wU=function(U){var Z=typeof U;return!!U&&(Z=="object"||Z=="function")},qU=function(U){return!!U&&typeof U=="object"},kU=function(U){return typeof U=="symbol"||qU(U)&&j.call(U)==IZ},tR=function(U){return U==null?"":gR(U)},aR=function(U,Z,$){var Q=U==null?void 0:TZ(U,Z);return Q===void 0?$:Q},eR=function(U,Z){return U!=null&&vR(U,Z,VR)},BU=function(U){return jU(U)?OR(U):TR(U)},U8=function(U){return U},Z8=function(U){return _U(U)?dQ(GU(U)):pR(U)},KQ=200,_Q="Expected a function",dU="__lodash_hash_undefined__",XU=1,g=2,EZ=Infinity,LZ=9007199254740991,UU="[object Arguments]",IU="[object Array]",OZ="[object Boolean]",HZ="[object Date]",MZ="[object Error]",zZ="[object Function]",GQ="[object GeneratorFunction]",ZU="[object Map]",DZ="[object Number]",d="[object Object]",WZ="[object Promise]",SZ="[object RegExp]",$U="[object Set]",VZ="[object String]",IZ="[object Symbol]",xU="[object WeakMap]",xZ="[object ArrayBuffer]",QU="[object DataView]",wQ="[object Float32Array]",qQ="[object Float64Array]",FQ="[object Int8Array]",NQ="[object Int16Array]",PQ="[object Int32Array]",EQ="[object Uint8Array]",LQ="[object Uint8ClampedArray]",OQ="[object Uint16Array]",HQ="[object Uint32Array]",MQ=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,zQ=/^\w*$/,DQ=/^\./,SQ=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,VQ=/[\\^$.*+?()[\]{}|]/g,IQ=/\\(\\)?/g,xQ=/^\[object .+?Constructor\]$/,AQ=/^(?:0|[1-9]\d*)$/,W={};W[wQ]=W[qQ]=W[FQ]=W[NQ]=W[PQ]=W[EQ]=W[LQ]=W[OQ]=W[HQ]=!0;W[UU]=W[IU]=W[xZ]=W[OZ]=W[QU]=W[HZ]=W[MZ]=W[zZ]=W[ZU]=W[DZ]=W[d]=W[SZ]=W[$U]=W[VZ]=W[xU]=!1;var AZ=typeof global=="object"&&global&&global.Object===Object&&global,CQ=typeof self=="object"&&self&&self.Object===Object&&self,S=AZ||CQ||Function("return this")(),CZ=typeof e=="object"&&e&&!e.nodeType&&e,KZ=CZ&&typeof p=="object"&&p&&!p.nodeType&&p,fQ=KZ&&KZ.exports===CZ,_Z=fQ&&AZ.process,GZ=function(){try{return _Z&&_Z.binding("util")}catch(U){}}(),wZ=GZ&&GZ.isTypedArray,hQ=Array.prototype,bQ=Function.prototype,YU=Object.prototype,SU=S["__core-js_shared__"],qZ=function(){var U=/[^.]+$/.exec(SU&&SU.keys&&SU.keys.IE_PROTO||"");return U?"Symbol(src)_1."+U:""}(),fZ=bQ.toString,L=YU.hasOwnProperty,j=YU.toString,vQ=RegExp("^"+fZ.call(L).replace(VQ,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),FZ=S.Symbol,NZ=S.Uint8Array,iQ=YU.propertyIsEnumerable,cQ=hQ.splice,uQ=kQ(Object.keys,Object),CU=n(S,"DataView"),h=n(S,"Map"),fU=n(S,"Promise"),TU=n(S,"Set"),mU=n(S,"WeakMap"),b=n(Object,"create"),sQ=C(CU),lQ=C(h),oQ=C(fU),rQ=C(TU),tQ=C(mU),RU=FZ?FZ.prototype:void 0,VU=RU?RU.valueOf:void 0,PZ=RU?RU.toString:void 0;A.prototype.clear=aQ;A.prototype.delete=eQ;A.prototype.get=UR;A.prototype.has=ZR;A.prototype.set=$R;O.prototype.clear=QR;O.prototype.delete=RR;O.prototype.get=JR;O.prototype.has=BR;O.prototype.set=XR;H.prototype.clear=YR;H.prototype.delete=WR;H.prototype.get=KR;H.prototype.has=_R;H.prototype.set=GR;JU.prototype.add=JU.prototype.push=wR;JU.prototype.has=qR;E.prototype.clear=FR;E.prototype.delete=NR;E.prototype.get=PR;E.prototype.has=ER;E.prototype.set=LR;var MR=nR(DR),zR=kR(),z=SR;if(CU&&z(new CU(new ArrayBuffer(1)))!=QU||h&&z(new h)!=ZU||fU&&z(fU.resolve())!=WZ||TU&&z(new TU)!=$U||mU&&z(new mU)!=xU)z=function(U){var Z=j.call(U),$=Z==d?U.constructor:void 0,Q=$?C($):void 0;if(Q)switch(Q){case sQ:return QU;case lQ:return ZU;case oQ:return WZ;case rQ:return $U;case tQ:return xU}return Z};var sR=gU(function(U){U=tR(U);var Z=[];if(DQ.test(U))Z.push("");return U.replace(SQ,function($,Q,R,J){Z.push(R?J.replace(IQ,"$1"):Q||$)}),Z}),lR=jR(function(U,Z,$){U[$]=Z});gU.Cache=H;var D=Array.isArray,rR=wZ?gQ(wZ):CR;p.exports=lR});var $$=EU((F1,Z$)=>{var N8=function(U,Z){return U==null?void 0:U[Z]},P8=function(U){var Z=!1;if(U!=null&&typeof U.toString!="function")try{Z=!!(U+"")}catch($){}return Z},f=function(U){var Z=-1,$=U?U.length:0;this.clear();while(++Z<$){var Q=U[Z];this.set(Q[0],Q[1])}},z8=function(){this.__data__=v?v(null):{}},D8=function(U){return this.has(U)&&delete this.__data__[U]},S8=function(U){var Z=this.__data__;if(v){var $=Z[U];return $===sZ?void 0:$}return bU.call(Z,U)?Z[U]:void 0},V8=function(U){var Z=this.__data__;return v?Z[U]!==void 0:bU.call(Z,U)},I8=function(U,Z){var $=this.__data__;return $[U]=v&&Z===void 0?sZ:Z,this},k=function(U){var Z=-1,$=U?U.length:0;this.clear();while(++Z<$){var Q=U[Z];this.set(Q[0],Q[1])}},x8=function(){this.__data__=[]},A8=function(U){var Z=this.__data__,$=FU(Z,U);if($<0)return!1;var Q=Z.length-1;if($==Q)Z.pop();else H8.call(Z,$,1);return!0},C8=function(U){var Z=this.__data__,$=FU(Z,U);return $<0?void 0:Z[$][1]},f8=function(U){return FU(this.__data__,U)>-1},T8=function(U,Z){var $=this.__data__,Q=FU($,U);if(Q<0)$.push([U,Z]);else $[Q][1]=Z;return this},T=function(U){var Z=-1,$=U?U.length:0;this.clear();while(++Z<$){var Q=U[Z];this.set(Q[0],Q[1])}},m8=function(){this.__data__={hash:new f,map:new(M8||k),string:new f}},d8=function(U){return NU(this,U).delete(U)},p8=function(U){return NU(this,U).get(U)},g8=function(U){return NU(this,U).has(U)},j8=function(U,Z){return NU(this,U).set(U,Z),this},FU=function(U,Z){var $=U.length;while($--)if(l8(U[$][0],Z))return $;return-1},n8=function(U,Z){Z=b8(Z,U)?[Z]:h8(Z);var $=0,Q=Z.length;while(U!=null&&$<Q)U=U[u8(Z[$++])];return $&&$==Q?U:void 0},k8=function(U){if(!U$(U)||i8(U))return!1;var Z=o8(U)||P8(U)?O8:w8;return Z.test(s8(U))},y8=function(U){if(typeof U=="string")return U;if(iU(U))return uZ?uZ.call(U):"";var Z=U+"";return Z=="0"&&1/U==-lZ?"-0":Z},h8=function(U){return eZ(U)?U:c8(U)},NU=function(U,Z){var $=U.__data__;return v8(Z)?$[typeof Z=="string"?"string":"hash"]:$.map},aZ=function(U,Z){var $=N8(U,Z);return k8($)?$:void 0},b8=function(U,Z){if(eZ(U))return!1;var $=typeof U;if($=="number"||$=="symbol"||$=="boolean"||U==null||iU(U))return!0;return Y8.test(U)||!X8.test(U)||Z!=null&&U in Object(Z)},v8=function(U){var Z=typeof U;return Z=="string"||Z=="number"||Z=="symbol"||Z=="boolean"?U!=="__proto__":U===null},i8=function(U){return!!vZ&&vZ in U},u8=function(U){if(typeof U=="string"||iU(U))return U;var Z=U+"";return Z=="0"&&1/U==-lZ?"-0":Z},s8=function(U){if(U!=null){try{return rZ.call(U)}catch(Z){}try{return U+""}catch(Z){}}return""},vU=function(U,Z){if(typeof U!="function"||Z&&typeof Z!="function")throw new TypeError(Q8);var $=function(){var Q=arguments,R=Z?Z.apply(this,Q):Q[0],J=$.cache;if(J.has(R))return J.get(R);var B=U.apply(this,Q);return $.cache=J.set(R,B),B};return $.cache=new(vU.Cache||T),$},l8=function(U,Z){return U===Z||U!==U&&Z!==Z},o8=function(U){var Z=U$(U)?tZ.call(U):"";return Z==R8||Z==J8},U$=function(U){var Z=typeof U;return!!U&&(Z=="object"||Z=="function")},r8=function(U){return!!U&&typeof U=="object"},iU=function(U){return typeof U=="symbol"||r8(U)&&tZ.call(U)==B8},t8=function(U){return U==null?"":y8(U)},a8=function(U,Z,$){var Q=U==null?void 0:n8(U,Z);return Q===void 0?$:Q},Q8="Expected a function",sZ="__lodash_hash_undefined__",lZ=Infinity,R8="[object Function]",J8="[object GeneratorFunction]",B8="[object Symbol]",X8=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Y8=/^\w*$/,W8=/^\./,K8=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_8=/[\\^$.*+?()[\]{}|]/g,G8=/\\(\\)?/g,w8=/^\[object .+?Constructor\]$/,q8=typeof global=="object"&&global&&global.Object===Object&&global,F8=typeof self=="object"&&self&&self.Object===Object&&self,hU=q8||F8||Function("return this")(),E8=Array.prototype,L8=Function.prototype,oZ=Object.prototype,yU=hU["__core-js_shared__"],vZ=function(){var U=/[^.]+$/.exec(yU&&yU.keys&&yU.keys.IE_PROTO||"");return U?"Symbol(src)_1."+U:""}(),rZ=L8.toString,bU=oZ.hasOwnProperty,tZ=oZ.toString,O8=RegExp("^"+rZ.call(bU).replace(_8,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),iZ=hU.Symbol,H8=E8.splice,M8=aZ(hU,"Map"),v=aZ(Object,"create"),cZ=iZ?iZ.prototype:void 0,uZ=cZ?cZ.toString:void 0;f.prototype.clear=z8;f.prototype.delete=D8;f.prototype.get=S8;f.prototype.has=V8;f.prototype.set=I8;k.prototype.clear=x8;k.prototype.delete=A8;k.prototype.get=C8;k.prototype.has=f8;k.prototype.set=T8;T.prototype.clear=m8;T.prototype.delete=d8;T.prototype.get=p8;T.prototype.has=g8;T.prototype.set=j8;var c8=vU(function(U){U=t8(U);var Z=[];if(W8.test(U))Z.push("");return U.replace(K8,function($,Q,R,J){Z.push(R?J.replace(G8,"$1"):Q||$)}),Z});vU.Cache=T;var eZ=Array.isArray;Z$.exports=a8});var XZ=PU(BZ(),1),r={isNamespace:(U)=>U&&!U.type,flattenSchema(U,Z){return Object.entries(U).reduce(($,[Q,R])=>{const J=Z?`${Z}.${Q}`:Q;if(r.isNamespace(R))$={...$,...r.flattenSchema(R,J)};else Object.assign(R,{name:J}),$[R.uid]=R;return $},{})},wrapSchema(U){return Object.values(U).reduce((Z,$)=>{return XZ.default(Z,$.path,$),Z},{})}};var t,XQ=new Uint8Array(16);function zU(){if(!t){if(t=typeof crypto!=="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!t)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")}return t(XQ)}function YZ(U,Z=0){return w[U[Z+0]]+w[U[Z+1]]+w[U[Z+2]]+w[U[Z+3]]+"-"+w[U[Z+4]]+w[U[Z+5]]+"-"+w[U[Z+6]]+w[U[Z+7]]+"-"+w[U[Z+8]]+w[U[Z+9]]+"-"+w[U[Z+10]]+w[U[Z+11]]+w[U[Z+12]]+w[U[Z+13]]+w[U[Z+14]]+w[U[Z+15]]}var w=[];for(let U=0;U<256;++U)w.push((U+256).toString(16).slice(1));var YQ=typeof crypto!=="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),DU={randomUUID:YQ};var WQ=function(U,Z,$){if(DU.randomUUID&&!Z&&!U)return DU.randomUUID();U=U||{};const Q=U.random||(U.rng||zU)();if(Q[6]=Q[6]&15|64,Q[8]=Q[8]&63|128,Z){$=$||0;for(let R=0;R<16;++R)Z[$+R]=Q[R];return Z}return YZ(Q)},a=WQ;var bZ=PU(hZ(),1);class $8{schemas;falttenSchema;uidSchemas;static Var(U){return{...U,type:"var",uid:a()}}static Func(U){return{...U,type:"func",uid:a()}}constructor(U={}){Object.assign(this,U),this.falttenSchema=r.flattenSchema(this.schemas),this.uidSchemas=bZ.default(this.schemas,"uid")}loadFull(){return Object.entries(this.falttenSchema).map(([U,Z])=>{if(Z.type=="func"){const{uid:$,type:Q,input:R,name:J,uiConfig:B}=Z;return{uid:$,type:Q,name:J,input:R,uiConfig:B?B():null}}if(Z.type=="var"){const{uid:$,type:Q,get:R,set:J,name:B,uiConfig:X}=Z;return{uid:$,type:Q,name:B,value:R(),uiConfig:X?X():null,set:!!J}}return{type:"unknown",name:U}})}loadVars(){return Object.entries(this.falttenSchema).filter(([U,Z])=>Z.type=="var").map(([U,Z])=>{const{get:$,name:Q}=Z;return{name:Q,value:$()}})}}var Q$=PU($$(),1),N1=(U)=>{return{schema:{async loadFull(){return fetch(`${U.url}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"schema.loadFull"})}).then((Z)=>Z.json())},async loadVars(){return fetch(`${U.url}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"schema.loadVars"})}).then((Z)=>Z.json())}},func:{async call(Z){return fetch(`${U.url}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"func.call",params:Z})}).then(($)=>$.json())}},var:{async set(Z){return fetch(`${U.url}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"var.set",params:Z})}).then(($)=>$.json())},async patch(Z){return fetch(`${U.url}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"var.patch",params:Z})}).then(($)=>$.json())}}}},P1=({urpc:U})=>{const Z={urpc:U,handle({name:$,params:Q}){const R=Q$.default(Z,$);if(!R)throw new Error("invalid name");return R(Q)},schema:{async loadFull(){return U.loadFull()},async loadVars(){return U.loadVars()}},func:{async call($){const Q=U.uidSchemas[$.method]||U.falttenSchema[$.method];if(!Q)throw new Error("invalid func name");return Q.func({input:$.input})}},var:{async set($){const Q=U.uidSchemas[$.name]||U.falttenSchema[$.name];if(!Q)throw new Error("invalid var name");if(!Q.set)throw new Error("variable can't be set");return Q.set($.value)},async patch($){throw new Error("TBD")}}};return Z};export{r as utils,N1 as createSimpleHttpClient,P1 as createServerClient,$8 as URPC}; |
{ | ||
"name": "@dappworks/urpc", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"module": "index.ts", | ||
@@ -20,2 +20,3 @@ "main": "dist/index.js", | ||
"@types/lodash.get": "^4.4.9", | ||
"@types/uuid": "^9.0.8", | ||
"bun-plugin-dts": "^0.2.3", | ||
@@ -41,4 +42,6 @@ "hono": "^4.2.6" | ||
"lodash.get": "^4.4.2", | ||
"lodash.set": "^4.3.2" | ||
"lodash.keyby": "^4.6.0", | ||
"lodash.set": "^4.3.2", | ||
"uuid": "^9.0.1" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32164
261
6
7
+ Addedlodash.keyby@^4.6.0
+ Addeduuid@^9.0.1
+ Addedlodash.keyby@4.6.0(transitive)
+ Addeduuid@9.0.1(transitive)