holosphere 1.1.13 → 1.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/holosphere-bundle.esm.js +2 -2
- package/holosphere-bundle.js +11 -2
- package/holosphere-bundle.min.js +2 -1
- package/package.json +2 -2
package/holosphere-bundle.esm.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* HoloSphere ESM Bundle v1.1.
|
|
2
|
+
* HoloSphere ESM Bundle v1.1.14
|
|
3
3
|
* ES6 Module version with all dependencies bundled
|
|
4
4
|
*
|
|
5
5
|
* Usage:
|
|
6
|
-
* import HoloSphere from 'https://unpkg.com/holosphere@1.1.
|
|
6
|
+
* import HoloSphere from 'https://unpkg.com/holosphere@1.1.14/holosphere-bundle.esm.js';
|
|
7
7
|
* const hs = new HoloSphere('myapp');
|
|
8
8
|
*/
|
|
9
9
|
var __create = Object.create;
|
package/holosphere-bundle.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* HoloSphere Bundle v1.1.
|
|
2
|
+
* HoloSphere Bundle v1.1.14
|
|
3
3
|
* Holonic Geospatial Communication Infrastructure
|
|
4
4
|
*
|
|
5
5
|
* Includes:
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* - Ajv (JSON schema validation)
|
|
10
10
|
*
|
|
11
11
|
* Usage:
|
|
12
|
-
* <script src="https://unpkg.com/holosphere@1.1.
|
|
12
|
+
* <script src="https://unpkg.com/holosphere@1.1.14/holosphere-bundle.js"></script>
|
|
13
13
|
* <script>
|
|
14
14
|
* const hs = new HoloSphere('myapp');
|
|
15
15
|
* </script>
|
|
@@ -33204,3 +33204,12 @@ ${str(snapshot)}`);
|
|
|
33204
33204
|
* @author Roberto Valenti
|
|
33205
33205
|
* @license GPL-3.0-or-later
|
|
33206
33206
|
*/
|
|
33207
|
+
|
|
33208
|
+
// Ensure HoloSphere is properly exposed as global constructor
|
|
33209
|
+
if (typeof window !== 'undefined') {
|
|
33210
|
+
window.HoloSphere = HoloSphere.default || HoloSphere;
|
|
33211
|
+
}
|
|
33212
|
+
if (typeof global !== 'undefined') {
|
|
33213
|
+
global.HoloSphere = HoloSphere.default || HoloSphere;
|
|
33214
|
+
}
|
|
33215
|
+
|
package/holosphere-bundle.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* HoloSphere Bundle v1.1.
|
|
1
|
+
/* HoloSphere Bundle v1.1.14 - Holonic Geospatial Communication Infrastructure */
|
|
2
2
|
var HoloSphere=(()=>{var f1=Object.create;var As=Object.defineProperty;var c1=Object.getOwnPropertyDescriptor;var d1=Object.getOwnPropertyNames;var h1=Object.getPrototypeOf,p1=Object.prototype.hasOwnProperty;var zf=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,i)=>(typeof require<"u"?require:e)[i]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var pe=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),m1=(n,e)=>{for(var i in e)As(n,i,{get:e[i],enumerable:!0})},Jf=(n,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of d1(e))!p1.call(n,u)&&u!==i&&As(n,u,{get:()=>e[u],enumerable:!(s=c1(e,u))||s.enumerable});return n};var Ka=(n,e,i)=>(i=n!=null?f1(h1(n)):{},Jf(e||!n||!n.__esModule?As(i,"default",{value:n,enumerable:!0}):i,n)),g1=n=>Jf(As({},"__esModule",{value:!0}),n);var Xc=pe((oC,Q0)=>{(function(){function n(i,s){return s?zf(i):i.slice?n[u(i)]:function(d,m){i(d={exports:{}}),n[u(m)]=d.exports};function u(d){return d.split("/").slice(-1).toString().replace(".js","")}}if(typeof Q0<"u")var e=Q0;n(function(i){String.random=function(u,d){var m="";for(u=u||24,d=d||"0123456789ABCDEFGHIJKLMNOPQRSTUVWXZabcdefghijklmnopqrstuvwxyz";u-- >0;)m+=d.charAt(Math.floor(Math.random()*d.length));return m},String.match=function(u,d){var m,y;return typeof u!="string"?!1:(typeof d=="string"&&(d={"=":d}),d=d||{},m=d["="]||d["*"]||d[">"]||d["<"],u===m?!0:y!==d["="]?!1:(m=d["*"]||d[">"],u.slice(0,(m||"").length)===m?!0:y!==d["*"]?!1:y!==d[">"]&&y!==d["<"]?u>=d[">"]&&u<=d["<"]:y!==d[">"]&&u>=d[">"]||y!==d["<"]&&u<=d["<"]))},String.hash=function(u,d){if(typeof u=="string"){if(d=d||0,!u.length)return d;for(var m=0,y=u.length,E;m<y;++m)E=u.charCodeAt(m),d=(d<<5)-d+E,d|=0;return d}};var s=Object.prototype.hasOwnProperty;Object.plain=function(u){return u?u instanceof Object&&u.constructor===Object||Object.prototype.toString.call(u).match(/^\[object (\w+)\]$/)[1]==="Object":!1},Object.empty=function(u,d){for(var m in u)if(s.call(u,m)&&(!d||d.indexOf(m)==-1))return!1;return!0},Object.keys=Object.keys||function(u){var d=[];for(var m in u)s.call(u,m)&&d.push(m);return d},function(){var u,d=setTimeout,m=0,y=0,E=typeof setImmediate!=""+u&&setImmediate||function(w,_){return typeof MessageChannel==""+u?d:((w=new MessageChannel).port1.onmessage=function($){$.data==""&&_()},function($){_=$,w.port2.postMessage("")})}(),b=d.check=d.check||typeof performance!=""+u&&performance||{now:function(){return+new Date}};d.hold=d.hold||9,d.poll=d.poll||function(w){if(d.hold>=b.now()-m&&y++<3333){w();return}E(function(){m=b.now(),w()},y=0)}}(),function(){var u=setTimeout,d=u.turn=u.turn||function(_){m.push(_)==1&&y(w)},m=d.s=[],y=u.poll,E=0,b,w=function(){(b=m[E++])&&b(),(E==m.length||E==99)&&(m=d.s=m.slice(E),E=0),m.length&&y(w)}}(),function(){var u,d=setTimeout,m=d.turn;(d.each=d.each||function(y,E,b,w){w=w||9,function _($,C,x){if(C=($=(y||[]).splice(0,w)).length){for(var k=0;k<C&&u===(x=E($[k]));k++);if(u===x){m(_);return}}b&&b(x)}()})()}()})(n,"./shim"),n(function(i){i.exports=function s(b,d,m){if(!b)return{to:s};var y,E=typeof d=="function",b=(this.tag||(this.tag={}))[b]||E&&(this.tag[b]={tag:b,to:s._={next:function(_){var $;($=this.to)&&$.next(_)}}});if(E){var w={off:s.off||(s.off=function(){if(this.next===s._.next)return!0;this===this.the.last&&(this.the.last=this.back),this.to.back=this.back,this.next=s._.next,this.back.to=this.to,this.the.last===this.the&&delete this.on.tag[this.the.tag]}),to:s._,next:d,the:b,on:this,as:m};return(w.back=b.last||b).to=w,b.last=w}return(b=b.to)&&y!==d&&b.next(d),b}})(n,"./onto"),n(function(i){i.exports=function(s){return s===null||typeof s=="string"||typeof s=="boolean"||typeof s=="number"&&s!=1/0&&s!=-1/0&&s===s||!!s&&typeof s["#"]=="string"&&Object.keys(s).length===1&&s["#"]}})(n,"./valid"),n(function(i){n("./shim");function s(){var b=+new Date;return y<b?(d=0,y=b+s.drift):y=b+(d+=1)/m+s.drift}s.drift=0;var u=-1/0,d=0,m=999,y=u,E;s.is=function(b,w,_){var $=w&&b&&b._&&b._[">"]||_;if($)return typeof($=$[w])=="number"?$:u},s.ify=function(b,w,_,$,C){(b=b||{})._=b._||{},C&&(b._["#"]=C);var x=b._[">"]||(b._[">"]={});return E!==w&&w!=="_"&&(typeof _=="number"&&(x[w]=_),E!==$&&(b[w]=$)),b},i.exports=s})(n,"./state"),n(function(i){n("./shim");function s(u){var d={s:{}},m=d.s;u=u||{max:999,age:1e3*9},d.check=function(E){return m[E]?y(E):!1};var y=d.track=function(E){var b=m[E]||(m[E]={});return b.was=d.now=+new Date,d.to||(d.to=setTimeout(d.drop,u.age+9)),y.ed&&y.ed(E),b};return d.drop=function(E){d.to=null,d.now=+new Date;var b=Object.keys(m);console.STAT&&console.STAT(d.now,+new Date-d.now,"dup drop keys"),setTimeout.each(b,function(w){var _=m[w];_&&(E||u.age)>d.now-_.was||delete m[w]},0,99)},d}i.exports=s})(n,"./dup"),n(function(i){n("./onto"),i.exports=function(d,m){if(this.on){var y=(this.opt||{}).lack||9e3;if(typeof d!="function"){if(!d)return;var b=d["#"]||d,E=(this.tag||"")[b];return E?(m&&(E=this.on(b,m),clearTimeout(E.err),E.err=setTimeout(function(){E.off()},y)),!0):void 0}var b=m&&m["#"]||s(9);if(!d)return b;var w=this.on(b,d,m);return w.err=w.err||setTimeout(function(){w.off(),w.next({err:"Error: No ACK yet.",lack:!0})},y),b}};var s=String.random||function(){return Math.random().toString(36).slice(2)}})(n,"./ask"),n(function(i){function s(C){return C instanceof s?(this._={$:this}).$:this instanceof s?s.create(this._={$:this,opt:C}):new s(C)}s.is=function(C){return C instanceof s||C&&C._&&C===C._.$||!1},s.version=.202,s.chain=s.prototype,s.chain.toJSON=function(){},n("./shim"),s.valid=n("./valid"),s.state=n("./state"),s.on=n("./onto"),s.dup=n("./dup"),s.ask=n("./ask"),function(){s.create=function(R){R.root=R.root||R,R.graph=R.graph||{},R.on=R.on||s.on,R.ask=R.ask||s.ask,R.dup=R.dup||s.dup();var M=R.$.opt(R.opt);return R.once||(R.on("in",C,R),R.on("out",C,R),R.on("put",B,R),s.on("create",R),R.on("create",R)),R.once=1,M};function C(R){if(R){if(R.out===C){this.to.next(R);return}var M=this,Q=M.as,X=Q.at||Q,ne=X.$,Ae=X.dup,te,de=R.DBG;if((te=R["#"])||(te=R["#"]=d(9)),!Ae.check(te)){if(Ae.track(te),te=R._,R._=typeof te=="function"?te:function(){},R.$&&R.$===(R.$._||"").$||(R.$=ne),R["@"]&&!R.put&&I(R),!X.ask(R["@"],R))if(de&&(de.u=+new Date),R.put){x(R);return}else R.get&&s.on.get(R,ne);de&&(de.uc=+new Date),M.to.next(R),de&&(de.ua=+new Date),!(R.nts||R.NTS)&&(R.out=C,X.on("out",R),de&&(de.ue=+new Date))}}}function x(R){if(R){var M=R._||"",Q=M.root=((M.$=R.$||"")._||"").root;if(R["@"]&&M.faith&&!M.miss){R.out=C,Q.on("out",R);return}M.latch=Q.hatch,M.match=Q.hatch=[];var X=R.put,ne=M.DBG=R.DBG,Ae=+new Date;if(le=le||Ae,!(X["#"]&&X["."])){ne&&(ne.p=Ae),M["#"]=R["#"],M.msg=R,M.all=0,M.stun=1;var te=Object.keys(X);console.STAT&&console.STAT(Ae,((ne||M).pk=+new Date)-Ae,"put sort");var de=0,me,ve,De,At,Ke,ze,gt;(function JA(CA){if(me!=de){if(me=de,!(De=te[de])){console.STAT&&console.STAT(Ae,((ne||M).pd=+new Date)-Ae,"put"),O(M);return}(At=X[De])?(gt=At._)?De!==gt["#"]?ze=q+V(De)+"soul not same.":(Ke=gt[">"])||(ze=q+V(De)+"no state."):ze=q+V(De)+"no meta.":ze=q+V(De)+"no node.",ve=Object.keys(At||{})}if(ze){R.err=M.err=ze,O(M);return}var sA=0,aA;for(CA=CA||0;CA++<9&&(aA=ve[sA++]);)if(aA!=="_"){var SA=At[aA],DA=Ke[aA];if(w===DA){ze=q+V(aA)+"on"+V(De)+"no state.";break}if(!y(SA)){ze=q+V(aA)+"on"+V(De)+"bad "+typeof SA+V(SA);break}k(SA,aA,De,DA,R),++J}if((ve=ve.slice(sA)).length){m(JA);return}++de,ve=null,JA(CA)})()}}}s.on.put=x;function k(R,M,Q,X,ne){var Ae=ne._||"",te=Ae.root,de=te.graph,me,ve,De=de[Q]||_,At=E(De,M,1),Ke=De[M],ze=Ae.DBG;(ve=console.STAT)&&(!de[Q]||!Ke)&&(ve.has=(ve.has||0)+1);var gt=L(),JA;if(X>gt){setTimeout(function(){k(R,M,Q,X,ne)},(ve=X-gt)>re?re:ve),console.STAT&&console.STAT((ze||Ae).Hf=+new Date,ve,"future");return}if(!(X<At)&&!(!Ae.faith&&X===At&&(R===Ke||z(R)<=z(Ke))&&!Ae.miss)){Ae.stun++;var CA=ne["#"]+Ae.all++,sA={toString:function(){return CA},_:Ae};sA.toJSON=sA.toString,te.dup.track(sA)["#"]=ne["#"],ze&&(ze.ph=ze.ph||+new Date),te.on("put",{"#":sA,"@":ne["@"],put:{"#":Q,".":M,":":R,">":X},ok:ne.ok,_:Ae})}}function B(R){var M;(M=(R._||"").DBG)&&(M.pa=+new Date,M.pm=M.pm||+new Date);var Q=this,X=Q.as,ne=X.graph,Ae=R._,te=R.put,de=te["#"],me=te["."],ve=te[":"],De=te[">"],At=R["#"],Ke;(Ke=Ae.msg)&&(Ke=Ke.put)&&(Ke=Ke[de])&&b(Ke,me,De,ve,de),ne[de]=b(ne[de],me,De,ve,de),(Ke=(X.next||"")[de])&&Ke.on("in",R),O(Ae),Q.to.next(R)}function O(R,M){var Q;if(!R.stop&&!(!R.err&&0<--R.stun)&&(R.stop=1,!!(Q=R.root))){var X=R.match;X.end=1,X===Q.hatch&&(!(X=R.latch)||X.end?delete Q.hatch:Q.hatch=X),R.hatch&&R.hatch(),setTimeout.each(R.match,function(ne){ne&&ne()}),!(!(M=R.msg)||R.err||M.err)&&(M.out=C,R.root.on("out",M),ae())}}function I(R){var M=R["@"]||"",Q,X,ne;if(!(Q=M._)){var Ae=(Ae=R.$)&&(Ae=Ae._)&&(Ae=Ae.root)&&(Ae=Ae.dup);if(!(Ae=Ae.check(M)))return;R["@"]=Ae["#"]||R["@"];return}Q.acks=(Q.acks||0)+1,(Q.err=R.err)&&(R["@"]=Q["#"],O(Q)),Q.ok=R.ok||Q.ok,!Q.stop&&!Q.crack&&(Q.crack=Q.match&&Q.match.push(function(){U(Q)})),U(Q)}function U(R){!R||!R.root||R.stun||R.acks!==R.all||R.root.on("in",{"@":R["#"],err:R.err,ok:R.err?w:R.ok||{"":1}})}var q="Error: Invalid graph!",V=function(R){return" '"+(""+R).slice(0,9)+"...' "},z=JSON.stringify,re=2147483647,L=s.state,J=0,le,ae=function(){J>999&&J/-(le-(le=+new Date))>1&&(s.window&&console.log("Warning: You're syncing 1K+ records a second, faster than DOM can update - consider limiting query."),ae=function(){J=0})}}(),function(){s.on.get=function(x,k){var B=k._,O=x.get,I=O["#"],U=B.graph[I],q=O["."],V=B.next||(B.next={}),z=V[I],re=x._||{},L=re.DBG=x.DBG;if(L&&(L.g=+new Date),!U)return B.on("get",x);if(q){if((typeof q!="string"||w===U[q])&&!((z||"").next||"")[q]){B.on("get",x);return}U=b({},q,E(U,q),U[q],I)}U&&C(x,U),B.on("get",x)};function C(x,k){var B=+new Date,O=x._||{},I=O.DBG=x.DBG,U=x["#"],q=d(9),V=Object.keys(k||"").sort(),z=((k||"")._||"")["#"],re=V.length,L=0,J=x.$._.root,le=k===J.graph[z];console.STAT&&console.STAT(B,((I||O).gk=+new Date)-B,"got keys"),k&&function ae(){B=+new Date;for(var R=0,M,Q={},X;R<9&&(M=V[R++]);)b(Q,M,E(k,M),k[M],z);V=V.slice(R),(X={})[z]=Q,Q=X;var ne;le&&(ne=function(){},ne.ram=ne.faith=!0),X=V.length,console.STAT&&console.STAT(B,-(B-(B=+new Date)),"got copied some"),I&&(I.ga=+new Date),J.on("in",{"@":U,"#":q,put:Q,"%":X?q=d(9):w,$:J.$,_:ne,DBG:I,FOO:1}),console.STAT&&console.STAT(B,+new Date-B,"got in"),X&&setTimeout.turn(ae)}(),k||J.on("in",{"@":x["#"]})}s.on.get.ack=C}(),function(){s.chain.opt=function(C){C=C||{};var x=this,k=x._,B=C.peers||C;return Object.plain(C)||(C={}),Object.plain(k.opt)||(k.opt=C),typeof B=="string"&&(B=[B]),Object.plain(k.opt.peers)||(k.opt.peers={}),B instanceof Array&&(C.peers={},B.forEach(function(O){var I={};I.id=I.url=O,C.peers[O]=k.opt.peers[O]=k.opt.peers[O]||I})),u(C,function O(I){var U=this[I];if(this&&this.hasOwnProperty(I)||typeof U=="string"||Object.empty(U)){this[I]=U;return}U&&U.constructor!==Object&&!(U instanceof Array)||u(U,O)}),k.opt.from=C,s.on("opt",k),k.opt.uuid=k.opt.uuid||function(I){return s.state().toString(36).replace(".","")+String.random(I||12)},x}}();var u=function(C,x){Object.keys(C).forEach(x,C)},d=String.random,m=setTimeout.turn,y=s.valid,E=s.state.is,b=s.state.ify,w,_={},$;s.log=function(){return!s.log.off&&$.log.apply($,arguments),[].slice.call(arguments).join(" ")},s.log.once=function(C,x,k){return(k=s.log.once)[C]=k[C]||0,k[C]++||s.log(x)},typeof window<"u"&&((window.GUN=window.Gun=s).window=window);try{typeof e<"u"&&(e.exports=s)}catch{}i.exports=s,(s.window||{}).console=(s.window||{}).console||{log:function(){}},($=console).only=function(C,x){return $.only.i&&C===$.only.i&&$.only.i++&&($.log.apply($,arguments)||x)},s.log.once("welcome","Hello wonderful person! :) Thanks for using GUN, please ask for help on http://chat.gun.eco if anything takes you longer than 5min to figure out!")})(n,"./root"),n(function(i){var s=n("./root");s.chain.back=function(m,y){var E;if(m=m||1,m===-1||m===1/0)return this._.root.$;if(m===1)return(this._.back||this._).$;var b=this,w=b._;if(typeof m=="string"&&(m=m.split(".")),m instanceof Array){var _=0,$=m.length,E=w;for(_;_<$;_++)E=(E||u)[m[_]];return d!==E?y?b:E:(E=w.back)?E.$.back(m,y):void 0}if(typeof m=="function"){for(var C,E={back:w};(E=E.back)&&d===(C=m(E,y)););return C}return typeof m=="number"?(w.back||w).$.back(m-1):this};var u={},d})(n,"./back"),n(function(i){var s=n("./root");s.chain.chain=function(O){var I=this,U=I._,q=new(O||I).constructor(I),V=q._,z;return V.root=z=U.root,V.id=++z.once,V.back=I._,V.on=s.on,V.on("in",s.on.in,V),V.on("out",s.on.out,V),q};function u(O){var I,U,q=this.as,V=q.back,z=q.root,re;if(O.$||(O.$=q.$),this.to.next(O),q.err){q.on("in",{put:q.put=w,$:q.$});return}if(U=O.get){if(z.pass&&(z.pass[q.id]=q),q.lex&&Object.keys(q.lex).forEach(function(L){re[L]=q.lex[L]},re=O.get=O.get||{}),U["#"]||q.soul){if(U["#"]=U["#"]||q.soul,O["#"]||(O["#"]=_(9)),V=z.$.get(U["#"])._,U=U["."]){if(C(V.put,U)&&(re=V.ask&&V.ask[U],(V.ask||(V.ask={}))[U]=V.$.get(U)._,V.on("in",{get:U,put:{"#":V.soul,".":U,":":V.put[U],">":k(z.graph[V.soul],U)}}),re))return}else{if(re=V.ask&&V.ask[""],(V.ask||(V.ask={}))[""]=V,w!==V.put&&(V.on("in",V),re))return;O.$=V.$}return z.ask(E,O),z.on("in",O)}if(U["."])return q.get?(O={get:{".":q.get},$:q.$},(V.ask||(V.ask={}))[q.get]=O.$._,V.on("out",O)):(O={get:q.lex?O.get:{},$:q.$},V.on("out",O));if((q.ask||(q.ask={}))[""]=q,q.get)return U["."]=q.get,(V.ask||(V.ask={}))[q.get]=O.$._,V.on("out",O)}return V.on("out",O)}s.on.out=u;function d(O,I){I=I||this.as;var U=I.root,q=O.$||(O.$=I.$),V=(q||"")._||b,z=O.put||"",re=z["#"],L=z["."],J=w!==z["="]?z["="]:z[":"],le=z[">"]||-1/0,ae;if(w!==O.put&&(w===z["#"]||w===z["."]||w===z[":"]&&w===z["="]||w===z[">"])){if(!$(z)){if(!(re=((z||"")._||"")["#"])){console.log("chain not yet supported for",z,"...",O,I);return}return q=I.root.$.get(re),setTimeout.each(Object.keys(z).sort(),function(R){R=="_"||w===(le=k(z,R))||I.on("in",{$:q,put:{"#":re,".":R,"=":z[R],">":le},VIA:O})})}I.on("in",{$:V.back.$,put:{"#":re=V.back.soul,".":L=V.has||V.get,"=":z,">":k(V.back.put,L)},via:O});return}(O.seen||"")[I.id]||((O.seen||(O.seen=function(){}))[I.id]=I,I!==V&&(Object.keys(O).forEach(function(R){z[R]=O[R]},z={}),z.get=I.get||z.get,!I.soul&&!I.has?z.$$$=z.$$$||I.$:V.soul&&(z.$=I.$,z.$$=z.$$||V.$),O=z),y(O,I),(I.soul||O.$$)&&le>=k(U.graph[re],L)&&((z=U.$.get(re)._).put=B(z.put,L,le,J,re)),!V.soul&&le>=k(U.graph[re],L)&&(ae=(U.$.get(re)._.next||"")[L])&&(ae.put=J,typeof(z=$(J))=="string"&&(ae.put=U.$.get(z)._.put||J)),this.to&&this.to.next(O),I.any&&setTimeout.each(Object.keys(I.any),function(R){(R=I.any[R])&&R(O)},0,99),I.echo&&setTimeout.each(Object.keys(I.echo),function(R){(R=I.echo[R])&&R.on("in",O)},0,99),((O.$$||"")._||V).soul&&(ae=I.next)&&(ae=ae[L])&&(z={},Object.keys(O).forEach(function(R){z[R]=O[R]}),z.$=(O.$$||O.$).get(z.get=L),delete z.$$,delete z.$$$,ae.on("in",z)),m(O,I))}s.on.in=d;function m(O,I){if(I=I||this.as||O.$._,!(O.$$&&this!==s.on)&&!(!O.put||I.soul)){var U=O.put||"",q=U["="]||U[":"],L,V=I.root,z=V.$.get(U["#"]).get(U["."])._;if(typeof(q=$(q))!="string"){this===s.on&&((z.echo||(z.echo={}))[I.id]=I);return}if(!((z.echo||(z.echo={}))[I.id]&&!(V.pass||"")[I.id])){if(L=V.pass){if(L[q+I.id])return;L[q+I.id]=1}(z.echo||(z.echo={}))[I.id]=I,I.has&&(I.link=q);var re=V.$.get(z.link=q)._;(re.echo||(re.echo={}))[z.id]=z;var L=I.ask||"";(L[""]||I.lex)&&re.on("out",{get:{"#":q}}),setTimeout.each(Object.keys(L),function(J,le){!J||!(le=L[J])||le.on("out",{get:{"#":q,".":J}})},0,99)}}}s.on.link=m;function y(O,I){var U=O.put||"",q=w!==U["="]?U["="]:U[":"],V=I.root,z,re;if(w===q){if(I.soul&&w!==I.put||(re=(O.$$||O.$||"")._||"",O["@"]&&(w!==re.put||w!==I.put)))return;(z=I.link||O.linked)&&delete(V.$.get(z)._.echo||"")[I.id],I.has&&(I.link=null),I.put=w,setTimeout.each(Object.keys(I.next||""),function(L,J){(J=I.next[L])&&(z&&delete(V.$.get(z).get(L)._.echo||"")[J.id],J.on("in",{get:L,put:w,$:J.$}))},0,99);return}I.soul||O.$$||(z=$(q),re=O.$._||"",!((z===re.link||I.has&&!re.link)&&!((V.pass||"")[I.id]&&typeof z!="string"))&&(delete(re.echo||"")[I.id],y({get:I.get,put:w,$:O.$,linked:O.linked=O.linked||re.link},I)))}s.on.unlink=y;function E(O,I){var U=this.as,q=U.$._,V=q.root,z=U.get||"",re=(O.put||"")[z["#"]]||"";if(!O.put||typeof z["."]=="string"&&w===re[z["."]]){if(w!==q.put||!q.soul&&!q.has)return;q.ack=(q.ack||0)+1,q.on("in",{get:q.get,put:q.put=w,$:q.$,"@":O["@"]});return}(O._||{}).miss=1,s.on.put(O)}var b={},w,_=String.random,$=s.valid,C=function(O,I){return O&&Object.prototype.hasOwnProperty.call(O,I)},x=s.state,k=x.is,B=x.ify})(n,"./chain"),n(function(i){var s=n("./root");s.chain.get=function(w,_,$){var C,x;if(typeof w=="string"){if(w.length==0)return(C=this.chain())._.err={err:s.log("0 length key!",w)},_&&_.call(C,C._.err),C;var k=this,B=k._,O=B.next||y;(C=O[w])||(C=w&&u(w,k)),C=C&&C.$}else if(typeof w=="function"){let L=function(J,le,ae){if(!L.stun&&!((te=U.pass)&&!te[q])){var R=J.$._,M=(J.$$||"")._,Q=(M||R).put,X=!R.has&&!R.soul,ne={},Ae,te;if((X||b===Q)&&(Q=b===((te=J.put)||"")["="]?b===(te||"")[":"]?te:te[":"]:te["="]),(Ae=typeof(te=s.valid(Q))=="string")&&(Q=b===(te=U.$.get(te)._.put)?I.not?b:Q:te),!(I.not&&b===Q)){if(b===I.stun){if((te=U.stun)&&te.on&&(B.$.back(function(de){if(te.on(""+de.id,ne={}),(ne.run||0)<L.id)return ne}),!ne.run&&te.on(""+R.id,ne={}),!ne.run&&M&&te.on(""+M.id,ne={}),L.id>ne.run&&((!ne.stun||ne.stun.end)&&(ne.stun=te.on("stun"),ne.stun=ne.stun&&ne.stun.last),ne.stun&&!ne.stun.end))){(ne.stun.add||(ne.stun.add={}))[q]=function(){L(J,le,1)};return}if(b===Q&&(ae=0),(te=U.hatch)&&!te.end&&b===I.hatch&&!ae){if(V[R.$._.id])return;V[R.$._.id]=1,te.push(function(){L(J,le,1)});return}V={}}if(U.pass){if(U.pass[q+R.id])return;U.pass[q+R.id]=1}if(I.on){I.ok.call(R.$,Q,R.get,J,le||L);return}if(I.v2020){I.ok(J,le||L);return}Object.keys(J).forEach(function(de){te[de]=J[de]},te={}),J=te,J.put=Q,I.ok.call(I.as,J,le||L)}}};var z=L;if(_===!0)return d(this,w,_,$),this;C=this;var B=C._,I=_||{},U=B.root,q;I.at=B,I.ok=w;var V={};return L.at=B,(B.any||(B.any={}))[q=String.random(7)]=L,L.off=function(){L.stun=1,B.any&&delete B.any[q]},L.rid=m,L.id=I.run||++U.once,x=U.pass,(U.pass={})[q]=1,I.out=I.out||{get:{}},B.on("out",I.out),U.pass=x,C}else{if(typeof w=="number")return this.get(""+w,_,$);if(typeof(x=E(w))=="string")return this.get(x,_,$);(x=this.get.next)&&(C=x(this,w))}return C?(_&&typeof _=="function"&&C.get(_,$),C):((C=this.chain())._.err={err:s.log("Invalid get request!",w)},_&&_.call(C,C._.err),C)};function u(w,_){var $=_._,C=$.next,x=_.chain(),k=x._;return C||(C=$.next={}),C[k.get=w]=k,_===$.root.$?k.soul=w:($.soul||$.has)&&(k.has=w),k}function d(w,_,$,C){var x=w._,k=0,B;return(B=x.soul||x.link)?_(B,C,x):x.jam?x.jam.push([_,C]):(x.jam=[[_,C]],w.get(function(I,U){if(!(b===I.put&&!x.root.opt.super&&(B=Object.keys(x.root.opt.peers).length)&&++k<=B)){U.rid(I);var q=(q=I.$)&&q._||{},V=0,z;for(B=x.jam,delete x.jam;z=B[V++];){var re=z[0],L;z=z[1],re&&re(L=q.link||q.soul||s.valid(I.put)||((I.put||{})._||{})["#"],z,I,U)}}},{out:{get:{".":!0}}}),w)}function m(w){var _=this.at||this.on;if(!w||_.soul||_.has)return this.off();if(w=(w=(w=w.$||w)._||w).id){var $=_.map,C,x;if(C=(x=this.seen||(this.seen={}))[w])return!0;x[w]=!0}}var y={},E=s.valid,b})(n,"./get"),n(function(i){var s=n("./root");s.chain.put=function(k,B,O){var I=this,U=I._,q=U.root;O=O||{},O.root=U.root,O.run||(O.run=q.once),u(O,U.id),O.ack=O.ack||B,O.via=O.via||I,O.data=O.data||k,O.soul||(O.soul=U.soul||typeof B=="string"&&B);var V=O.state=O.state||s.state();return typeof k=="function"?(k(function(z){O.data=z,I.put(E,E,O)}),I):O.soul?(O.$=q.$.get(O.soul),O.todo=[{it:O.data,ref:O.$}],O.turn=O.turn||_,O.ran=O.ran||d,function z(){var re=O.todo,L=re.pop(),J=L.it,le=L.ref&&L.ref._.id,ae,R,M,Q,X;if(u(O,L.ref),(Q=L.todo)&&(R=Q.pop(),J=J[R],Q.length&&re.push(L)),R&&(re.path||(re.path=[])).push(R),!(ae=$(J))&&!(X=s.is(J))){if(!Object.plain(J)){d.err(O,"Invalid data: "+y(J)+" at "+(O.via.back(function(me){me.get&&Q.push(me.get)},Q=[])||Q.join("."))+"."+(re.path||[]).join("."));return}for(var ne=O.seen||(O.seen=[]),Ae=ne.length;Ae--;)if(J===(Q=ne[Ae]).it){ae=J=Q.link;break}}if(R&&ae)L.node=C(L.node,R,V,J);else{let me=function(ve,De){var At=M.link["#"];De&&(De.off(),De.rid(ve));var Ke=At||ve.soul||(Q=(ve.$$||ve.$)._||"").soul||Q.link||((Q=Q.put||"")._||"")["#"]||Q["#"]||((Q=ve.put||"")&&ve.$$?Q["#"]:(Q["="]||Q[":"]||"")["#"]);if(!At&&u(O,ve.$),!Ke&&!L.link["#"]){(L.wait||(L.wait=[])).push(function(){me(ve,De)});return}Ke||(Ke=[],(ve.$$||ve.$).back(function(ze){if(Q=ze.soul||ze.link)return Ke.push(Q);Ke.push(ze.get)}),Ke=Ke.reverse().join("/")),M.link["#"]=Ke,!X&&(((O.graph||(O.graph={}))[Ke]=M.node||(M.node={_:{}}))._["#"]=Ke),delete O.wait[te],M.wait&&setTimeout.each(M.wait,function(ze){ze&&ze()}),O.ran(O)};var de=me;if(!O.seen){d.err(O,"Data at root of graph must be a node (an object).");return}O.seen.push(M={it:J,link:{},todo:X?[]:Object.keys(J).sort().reverse(),path:(re.path||[]).slice(),up:L}),L.node=C(L.node,R,V,M.link),!X&&M.todo.length&&re.push(M);var te=O.seen.length;(O.wait||(O.wait={}))[te]="",Q=(M.ref=X?J:R?L.ref.get(R):L.ref)._,(Q=J&&(J._||"")["#"]||Q.soul||Q.link)?me({soul:Q}):M.ref.get(me,{run:O.run,v2020:1,out:{get:{".":" "}}})}if(!re.length)return O.ran(O);O.turn(z)}(),I):(m(O),I)};function u(k,B){if(B){B=(B._||"").id||B;var O=k.root.stun||(k.root.stun={on:s.on}),I={},U;k.stun||(k.stun=O.on("stun",function(){})),(U=O.on(""+B))&&U.the.last.next(I),!(I.run>=k.run)&&O.on(""+B,function(q){if(k.stun.end){this.off(),this.to.next(q);return}q.run=q.run||k.run,q.stun=q.stun||k.stun})}}function d(k){if(k.err){d.end(k.stun,k.root);return}if(!(k.todo.length||k.end||!Object.empty(k.wait))){k.end=1;var B=k.$.back(-1)._,O=B.root,I=B.ask(function(z){O.on("ack",z),z.err&&!z.lack&&s.log(z),++U>(k.acks||0)&&this.off(),k.ack&&k.ack(z,this)},k.opt),U=0,q=k.stun,V;(V=function(){q&&(d.end(q,O),setTimeout.each(Object.keys(q=q.add||""),function(z){(z=q[z])&&z()}))}).hatch=V,k.ack&&!k.ok&&(k.ok=k.acks||9),k.via._.on("out",{put:k.out=k.graph,ok:k.ok&&{"@":k.ok+1},opt:k.opt,"#":I,_:V})}}d.end=function(k,B){k.end=w,k.the.to===k&&k===k.the.last&&delete B.stun,k.off()},d.err=function(k,B){(k.ack||w).call(k,k.out={err:k.err=s.log(B)}),k.ran(k)};function m(k){var B=k.via._,O;k.via=k.via.back(function(I){if(I.soul||!I.get)return I.$;O=k.data,(k.data={})[I.get]=O}),(!k.via||!k.via._.soul)&&(k.via=B.root.$.get(((k.data||"")._||"")["#"]||B.$.back("opt.uuid")())),k.via.put(k.data,k.ack,k)}function y(k,B){return k&&(B=k.constructor)&&B.name||typeof k}var E,b={},w=function(){},_=setTimeout.turn,$=s.valid,C=s.state.ify,x=function(k,B){k.call(B||b)}})(n,"./put"),n(function(i){var s=n("./root");n("./chain"),n("./back"),n("./put"),n("./get"),i.exports=s})(n,"./index"),n(function(i){var s=n("./index");s.chain.on=function(E,b,w,_){var $=this,C=$._,x=C.root,k,B,O,I;if(typeof E=="string")return b?(k=C.on(E,b,w||C,_),w&&w.$&&(w.subs||(w.subs=[])).push(k),$):C.on(E);var U=b;(U=U===!0?{change:!0}:U||{}).not=1,U.on=1;var q={};return $.get(E,U),$},s.chain.once=function(E,b){if(b=b||{},!E)return u(this,b);var w=this,_=w._,$=_.root,C=_.put,x=String.random(7),k,B;return w.get(function(O,I,U,q){var V=this,z=V._,re=z.one||(z.one={});if(q.stun||re[x]==="")return;if((B=s.valid(O))===!0){L();return}if(typeof B=="string")return;clearTimeout((_.one||"")[x]),clearTimeout(re[x]),re[x]=setTimeout(L,b.wait||99);function L(J){if(!z.has&&!z.soul&&(z={put:O,get:I}),y===(B=z.put)&&(B=((U.$$||"")._||"").put),typeof s.valid(B)=="string"&&(B=$.$.get(B)._.put,B===y&&!J)){re[x]=setTimeout(function(){L(1)},b.wait||99);return}q.stun||re[x]!==""&&(re[x]="",(_.soul||_.has)&&q.off(),E.call(V,B,z.get),clearTimeout(re[x]))}},{on:1}),w};function u(E,b,w){return s.log.once("valonce","Chainable val is experimental, its behavior and API may change moving forward. Please play with it and report bugs and ideas on how to improve it."),(w=E.chain())._.nix=E.once(function(_,$){w._.on("in",this._)}),w._.lex=E._.lex,w}s.chain.off=function(){var E=this,b=E._,w,_=b.back;if(_)return b.ack=0,(w=_.next)&&w[b.get]&&delete w[b.get],(w=_.any)&&(delete _.any,_.any={}),(w=_.ask)&&delete w[b.get],(w=_.put)&&delete w[b.get],(w=b.soul)&&delete _.root.graph[w],(w=b.map)&&Object.keys(w).forEach(function($,C){C=w[$],C.link&&_.root.$.get(C.link).off()}),(w=b.next)&&Object.keys(w).forEach(function($,C){C=w[$],C.$.off()}),b.on("off",{}),E};var d={},m=function(){},y})(n,"./on"),n(function(i){var s=n("./index"),u=s.chain.get.next;s.chain.get.next=function(b,w){var _;return Object.plain(w)?(_=((_=w["#"])||"")["="]||_)?b.get(_):((_=b.chain()._).lex=w,b.on("in",function($){String.match($.get||($.put||"")["."],w["."]||w["#"]||w)&&_.on("in",$),this.to.next($)}),_.$):(u||m)(b,w)},s.chain.map=function(b,w,_){var $=this,C=$._,x,k;return Object.plain(b)&&(x=b["."]?b:{".":b},b=E),b?(s.log.once("mapfn","Map functions are experimental, their behavior and API may change moving forward. Please play with it and report bugs and ideas on how to improve it."),k=$.chain(),$.map().on(function(B,O,I,U){var q=(b||m).call(this,B,O,I,U);if(E!==q){if(B===q)return k._.on("in",I);if(s.is(q))return k._.on("in",q._);var V={};Object.keys(I.put).forEach(function(z){V[z]=I.put[z]},V),V["="]=q,k._.on("in",{get:O,put:V})}}),k):((k=C.each)||((C.each=k=$.chain())._.lex=x||k._.lex||C.lex,k._.nix=$.back("nix"),$.on("in",d,k._)),k)};function d(b){this.to.next(b);var w=this.as,_=b.$,$=_._,C=b.put,x;!$.soul&&!b.$$||(x=w.lex)&&!String.match(b.get||(C||"")["."],x["."]||x["#"]||x)||s.on.link(b,w)}var m=function(){},y={stun:m,off:m},E})(n,"./map"),n(function(i){var s=n("./index");s.chain.set=function(u,d,m){var y=this,E=y.back(-1),b,w;return d=d||function(){},m=m||{},m.item=m.item||u,(b=((u||"")._||"")["#"])&&((u={})["#"]=b),typeof(w=s.valid(u))=="string"?y.get(b=w).put(u,d,m):s.is(u)?(y.put(function(_){u.get(function($,C,x){if(!$)return d.call(y,{err:s.log('Only a node can be linked! Not "'+x.put+'"!')});(w={})[$]={"#":$},_(w)},!0)}),u):(Object.plain(u)&&(u=E.get(b=y.back("opt.uuid")()).put(u)),y.get(b||E.back("opt.uuid")(7)).put(u,d,m))}})(n,"./set"),n(function(i){n("./shim");var s=function(){},u=JSON.parseAsync||function(w,_,$){var C,x=+new Date;try{_(C,JSON.parse(w,$),d.sucks(+new Date-x))}catch(k){_(k)}},d=JSON.stringifyAsync||function(w,_,$,C){var x,k=+new Date;try{_(x,JSON.stringify(w,$,C),d.sucks(+new Date-k))}catch(B){_(B)}};d.sucks=function(w){w>99&&(console.log("Warning: JSON blocking CPU detected. Add `gun/lib/yson.js` to fix."),d.sucks=s)};function m(w){var _=function(){},$=w.opt||{};$.log=$.log||console.log,$.gap=$.gap||$.wait||0,$.max=$.max||($.memory?$.memory*999*999:3e8)*.3,$.pack=$.pack||$.max*.01*.01,$.puff=$.puff||9;var C=setTimeout.turn||setTimeout,x=w.dup,k=x.check,B=x.track,O=+new Date,I=O,U=_.hear=function(L,J){if(L){if($.max<=L.length)return _.say({dam:"!",err:"Message too big!"},J);_===this&&(U.d+=L.length||0,++U.c);var le=J.SH=+new Date,ae=L[0],R;if(ae==="["){u(L,function(M,Q){if(M||!Q)return _.say({dam:"!",err:"DAM JSON parse error."},J);console.STAT&&console.STAT(+new Date,Q.length,"# on hear batch");var X=$.puff;(function ne(){for(var Ae=+new Date,te=0,de;te<X&&(de=Q[te++]);)_.hear(de,J);Q=Q.slice(te),console.STAT&&console.STAT(Ae,+new Date-Ae,"hear loop"),V(J),Q.length&&C(ne,0)})()}),L="";return}if(ae==="{"||(L["#"]||Object.plain(L))&&(R=L)){if(R)return U.one(R,J,le);u(L,function(M,Q){if(M||!Q)return _.say({dam:"!",err:"DAM JSON parse error."},J);U.one(Q,J,le)});return}}};U.one=function(L,J,ne){var ae,R,M,Q,X;if(L.DBG&&(L.DBG=X={DBG:L.DBG}),X&&(X.h=ne),X&&(X.hp=+new Date),(ae=L["#"])||(ae=L["#"]=String.random(9)),!(M=k(ae))&&(R=L["##"],!(R&&(M=L["@"]||L.get&&ae)&&x.check(Q=M+R)))){if((L._=function(){}).via=_.leap=J,(M=L["><"])&&typeof M=="string"&&M.slice(0,99).split(",").forEach(function(Ae){this[Ae]=1},L._.yo={}),M=L.dam){(M=_.hear[M])&&M(L,J,w),B(ae);return}(M=L.ok)&&(L._.near=M["/"]);var ne=+new Date;X&&(X.is=ne),J.SI=ae,B.ed=function(Ae){ae===Ae&&(B.ed=0,(Ae=x.s[ae])&&(Ae.via=J,L.get&&(Ae.it=L)))},w.on("in",_.last=L),X&&(X.hd=+new Date),console.STAT&&console.STAT(ne,+new Date-ne,L.get?"msg get":L.put?"msg put":"msg"),B(ae),Q&&B(Q),_.leap=_.last=null}};var q=function(L,J,le){le(L,!0)};U.c=U.d=0,function(){var L=0,J;_.hash=function(M,Q){var X,ne,Ae,te=+new Date;d(M.put,function de(me,ve){var De=(ne||(ne=Ae=ve||"")).slice(0,32768);if(X=String.hash(De,X),ne=ne.slice(32768),ne){C(de,0);return}console.STAT&&console.STAT(te,+new Date-te,"say json+hash"),M._.$put=Ae,M["##"]=X,_.say(M,Q),delete M._.$put},le)};function le(M,Q){var X;return Q instanceof Object?(Object.keys(Q).sort().forEach(ae,{to:X={},on:Q}),X):Q}function ae(M){this.to[M]=this.on[M]}var R=_.say=function(M,Q){var X;if((X=this)&&(X=X.to)&&X.next&&X.next(M),!M)return!1;var ne,Ae,te,de=M["@"],me=M._||(M._=function(){}),ve=M.DBG,De=+new Date;if(me.y=me.y||De,Q||ve&&(ve.y=De),(ne=M["#"])||(ne=M["#"]=String.random(9)),!J&&B(ne),!(Ae=M["##"])&&b!==M.put&&!me.via&&de){_.hash(M,Q);return}if(!Q&&de&&(Q=(X=x.s[de])&&(X.via||(X=X.it)&&(X=X._)&&X.via)||(X=_.last)&&de===X["#"]&&_.leap),!Q&&de)return x.s[de]?void 0:(console.STAT&&console.STAT(+new Date,++L,"total no peer to ack to"),!1);if(de&&!M.put&&!Ae&&((x.s[de]||"").it||"")["##"])return!1;if(!Q&&_.way)return _.way(M);if(ve&&(ve.yh=+new Date),!(te=me.raw)){_.raw(M,Q);return}if(ve&&(ve.yr=+new Date),!Q||!Q.id){if(!Object.plain(Q||$.peers))return!1;var De=+new Date,At=$.puff,Ke=$.peers,ze=Object.keys(Q||$.peers||{});console.STAT&&console.STAT(De,+new Date-De,"peer keys"),function CA(){var sA=+new Date;J=1;var aA=me.raw;me.raw=te;for(var SA=0,DA;SA<9&&(DA=(ze||"")[SA++]);)(DA=Ke[DA]||(Q||"")[DA])&&_.say(M,DA);me.raw=aA,J=0,ze=ze.slice(SA),console.STAT&&console.STAT(sA,+new Date-sA,"say loop"),ze.length&&(C(CA,0),de&&B(de))}();return}if(!Q.wire&&_.wire&&_.wire(Q),ne!==Q.last){if(Q.last=ne,Q===me.via||(X=me.yo)&&(X[Q.url]||X[Q.pid]||X[Q.id]))return!1;if(console.STAT&&console.STAT(De,((ve||me).yp=+new Date)-(me.y||De),"say prep"),!J&&de&&B(de),Q.batch){if(Q.tail=(X=Q.tail||0)+te.length,Q.tail<=$.pack){Q.batch+=(X?",":"")+te;return}V(Q)}Q.batch="[";var gt=+new Date;setTimeout(function(){console.STAT&&console.STAT(gt,+new Date-gt,"0ms TO"),V(Q)},$.gap),z(te,Q),console.STAT&&de===Q.SI&&console.STAT(De,+new Date-Q.SH,"say ack")}};_.say.c=_.say.d=0,_.raw=function(M,Q){if(!M)return"";var X=M._||{},ne,Ae;if(Ae=X.raw)return Ae;if(typeof M=="string")return M;var te=M["##"],de=M["@"];if(te&&de){if(!X.via&&k(de+te))return!1;if(Ae=(x.s[de]||"").it){if(te===Ae["##"])return!1;Ae["##"]||(Ae["##"]=te)}}if(!M.dam&&!M["@"]){var me=0,ve=[];Ae=$.peers;for(var De in Ae){var At=Ae[De];if(ve.push(At.url||At.pid||At.id),++me>6)break}me>1&&(M["><"]=ve.join())}if(M.put&&(Ae=M.ok)&&(M.ok={"@":(Ae["@"]||1)-1,"/":Ae["/"]==M._.near?_.near:Ae["/"]}),ne=X.$put){Ae={},Object.keys(M).forEach(function(ze){Ae[ze]=M[ze]}),Ae.put=":])([:",d(Ae,function(ze,gt){if(!ze){var JA=+new Date;Ae=gt.indexOf('"put":":])([:"'),Ke(b,gt=gt.slice(0,Ae+6)+ne+gt.slice(Ae+14)),console.STAT&&console.STAT(JA,+new Date-JA,"say slice")}});return}d(M,Ke);function Ke(ze,gt){ze||(X.raw=gt,_.say(M,Q))}}}();function V(L){var J=L.batch,le=typeof J=="string",ae;if(le&&(J+="]"),L.batch=L.tail=null,!!J&&!(le?3>J.length:!J.length)){if(!le)try{J=J.length===1?J[0]:JSON.stringify(J)}catch(R){return $.log("DAM JSON stringify error",R)}J&&z(J,L)}}function z(L,J){try{var le=J.wire;J.say?J.say(L):le.send&&le.send(L),_.say.d+=L.length||0,++_.say.c}catch{(J.queue=J.queue||[]).push(L)}}_.near=0,_.hi=function(L){var J=L.wire,le;if(!J){_.wire(L.length&&{url:L,id:L}||L);return}L.id?$.peers[L.url||L.id]=L:(le=L.id=L.id||L.url||String.random(9),_.say({dam:"?",pid:w.opt.pid},$.peers[le]=L),delete x.s[L.last]),L.met||(_.near++,L.met=+new Date,w.on("hi",L)),le=L.queue,L.queue=[],setTimeout.each(le||[],function(ae){z(ae,L)},0,9)},_.bye=function(L){L.met&&--_.near,delete L.met,w.on("bye",L);var J=+new Date;J=J-(L.met||J),_.bye.time=((_.bye.time||J)+J)/2},_.hear["!"]=function(L,J){$.log("Error:",L.err)},_.hear["?"]=function(L,J){L.pid&&(J.pid||(J.pid=L.pid),L["@"])||(_.say({dam:"?",pid:$.pid,"@":L["#"]},J),delete x.s[J.last])},_.hear.mob=function(L,J){if(L.peers){var le=Object.keys(L.peers),ae=le[Math.random()*le.length>>0];ae&&(_.bye(J),_.hi(ae))}},w.on("create",function(L){L.opt.pid=L.opt.pid||String.random(9),this.to.next(L),L.on("out",_.say)}),w.on("bye",function(L,J){L=$.peers[L.id||L]||L,this.to.next(L),L.bye?L.bye():(J=L.wire)&&J.close&&J.close(),delete $.peers[L.id],L.wire=null});var re={};return w.on("bye",function(L,J){this.to.next(L),(J=console.STAT)&&(J.peers=_.near),(J=L.url)&&(re[J]=!0,setTimeout(function(){delete re[J]},$.lack||9e3))}),w.on("hi",function(L,J){if(this.to.next(L),(J=console.STAT)&&(J.peers=_.near),!$.super){var le=Object.keys(w.next||"");le.length>9999&&!console.SUBS&&console.log(console.SUBS="Warning: You have more than 10K live GETs, which might use more bandwidth than your screen can show - consider `.off()`."),setTimeout.each(le,function(ae){var R=w.next[ae];if($.super||(R.ask||"")[""]){_.say({get:{"#":ae}},L);return}setTimeout.each(Object.keys(R.ask||""),function(M){M&&_.say({"##":String.hash((w.graph[ae]||"")[M]),get:{"#":ae,".":M}},L)})})}}),_}var y={},E=!0,b;try{i.exports=m}catch{}})(n,"./mesh"),n(function(i){var s=n("./index");s.Mesh=n("./mesh"),s.on("opt",function(m){if(this.to.next(m),m.once)return;var y=m.opt;if(y.WebSocket===!1)return;var E=s.window||{},b=y.WebSocket||E.WebSocket||E.webkitWebSocket||E.mozWebSocket;if(!b)return;y.WebSocket=b;var w=y.mesh=y.mesh||s.Mesh(m),_=w.wire||y.wire;w.wire=y.wire=$;function $(B){try{if(!B||!B.url)return I&&I(B);var O=B.url.replace(/^http/,"ws"),I=B.wire=new y.WebSocket(O);return I.onclose=function(){x(B),y.mesh.bye(B)},I.onerror=function(U){x(B)},I.onopen=function(){y.mesh.hi(B)},I.onmessage=function(U){U&&y.mesh.hear(U.data||U,B)},I}catch{y.mesh.bye(B)}}setTimeout(function(){!y.super&&m.on("out",{dam:"hi"})},1);var C=2*999;function x(B){clearTimeout(B.defer),y.peers[B.url]&&(k&&B.retry<=0||(B.retry=(B.retry||y.retry+1||60)-(-B.tried+(B.tried=+new Date)<C*4?1:0),B.defer=setTimeout(function O(){if(k&&k.hidden)return setTimeout(O,C);$(B)},C)))}var k=""+d!=typeof document&&document});var u=function(){},d})(n,"./websocket"),n(function(i){if(!(typeof Gun>"u")){var s=function(){},u,d;try{u=(Gun.window||s).localStorage}catch{}u||(Gun.log("Warning: No localStorage exists to persist data to!"),u={setItem:function(E,b){this[E]=b},removeItem:function(E){delete this[E]},getItem:function(E){return this[E]}});var m=JSON.parseAsync||function(E,b,w){var _;try{b(_,JSON.parse(E,w))}catch($){b($)}},y=JSON.stringifyAsync||function(E,b,w,_){var $;try{b($,JSON.stringify(E,w,_))}catch(C){b(C)}};Gun.on("create",function E(b){this.to.next(b);var w=b.opt,_=b.graph,$=[],C,x,k,B;if(w.localStorage===!1)return;w.prefix=w.file||"gun/";try{C=E[w.prefix]=E[w.prefix]||JSON.parse(k=u.getItem(w.prefix))||{}}catch{C=E[w.prefix]={}}k=(k||"").length,b.on("get",function(I){this.to.next(I);var U=I.get,q,V,z,re;!U||!(q=U["#"])||(V=C[q]||re,V&&(z=U["."])&&!Object.plain(z)&&(V=Gun.state.ify({},z,Gun.state.is(V,z),V[z],q)),Gun.on.get.ack(I,V))}),b.on("put",function(I){this.to.next(I);var U=I.put,q=U["#"],V=U["."],z=I["#"],re=I.ok||"",L;if(C[q]=Gun.state.ify(C[q],V,U[">"],U[":"],q),B&&k>4999880){b.on("in",{"@":z,err:"localStorage max!"});return}!I["@"]&&(!I._.via||Math.random()<re["@"]/re["/"])&&$.push(z),!x&&(x=setTimeout(O,9+k/333))});function O(){if(!$.length&&((setTimeout.turn||"").s||"").length){setTimeout(O,99);return}var I,U=$;clearTimeout(x),x=!1,$=[],y(C,function(q,V){try{!q&&u.setItem(w.prefix,V)}catch(z){q=B=z||"localStorage failure"}q&&(Gun.log(q+" Consider using GUN's IndexedDB plugin for RAD for more storage space, https://gun.eco/docs/RAD#install"),b.on("localStorage:error",{err:q,get:w.prefix,put:C})),k=V.length,setTimeout.each(U,function(z){b.on("in",{"@":z,err:q,ok:0})},0,99)})}})}})(n,"./localStorage")})();(function(){var ae;if(""+ae!=typeof Gun){var n=function(R){console.warn("Warning! Deprecated internal utility will break in next version:",R)},e=Gun;e.fn=e.fn||{is:function(R){return n("fn"),!!R&&typeof R=="function"}},e.bi=e.bi||{is:function(R){return n("bi"),R instanceof Boolean||typeof R=="boolean"}},e.num=e.num||{is:function(R){return n("num"),!i(R)&&(R-parseFloat(R)+1>=0||R===1/0||R===-1/0)}},e.text=e.text||{is:function(R){return n("text"),typeof R=="string"}},e.text.ify=e.text.ify||function(R){return n("text.ify"),e.text.is(R)?R:typeof JSON<"u"?JSON.stringify(R):R&&R.toString?R.toString():R},e.text.random=e.text.random||function(R,M){n("text.random");var Q="";for(R=R||24,M=M||"0123456789ABCDEFGHIJKLMNOPQRSTUVWXZabcdefghijklmnopqrstuvwxyz";R>0;)Q+=M.charAt(Math.floor(Math.random()*M.length)),R--;return Q},e.text.match=e.text.match||function(R,M){var Q,X;return n("text.match"),typeof R!="string"?!1:(typeof M=="string"&&(M={"=":M}),M=M||{},Q=M["="]||M["*"]||M[">"]||M["<"],R===Q?!0:X!==M["="]?!1:(Q=M["*"]||M[">"]||M["<"],R.slice(0,(Q||"").length)===Q?!0:X!==M["*"]?!1:X!==M[">"]&&X!==M["<"]?R>=M[">"]&&R<=M["<"]:X!==M[">"]&&R>=M[">"]||X!==M["<"]&&R<=M["<"]))},e.text.hash=e.text.hash||function(R,M){if(n("text.hash"),typeof R=="string"){if(M=M||0,!R.length)return M;for(var Q=0,X=R.length,ne;Q<X;++Q)ne=R.charCodeAt(Q),M=(M<<5)-M+ne,M|=0;return M}},e.list=e.list||{is:function(R){return n("list"),R instanceof Array}},e.list.slit=e.list.slit||Array.prototype.slice,e.list.sort=e.list.sort||function(R){return n("list.sort"),function(M,Q){return!M||!Q?0:(M=M[R],Q=Q[R],M<Q?-1:M>Q?1:0)}},e.list.map=e.list.map||function(R,M,Q){return n("list.map"),J(R,M,Q)},e.list.index=1,e.obj=e.boj||{is:function(R){return n("obj"),R?R instanceof Object&&R.constructor===Object||Object.prototype.toString.call(R).match(/^\[object (\w+)\]$/)[1]==="Object":!1}},e.obj.put=e.obj.put||function(R,M,Q){return n("obj.put"),(R||{})[M]=Q,R},e.obj.has=e.obj.has||function(R,M){return n("obj.has"),R&&Object.prototype.hasOwnProperty.call(R,M)},e.obj.del=e.obj.del||function(R,M){if(n("obj.del"),!!R)return R[M]=null,delete R[M],R},e.obj.as=e.obj.as||function(R,M,Q,X){return n("obj.as"),R[M]=R[M]||(X===Q?{}:Q)},e.obj.ify=e.obj.ify||function(R){if(n("obj.ify"),q(R))return R;try{R=JSON.parse(R)}catch{R={}}return R},function(){var R;function M(Q,X){z(this,X)&&R!==this[X]||(this[X]=Q)}e.obj.to=e.obj.to||function(Q,X){return n("obj.to"),X=X||{},J(Q,M,X),X}}(),e.obj.copy=e.obj.copy||function(R){return n("obj.copy"),R&&JSON.parse(JSON.stringify(R))},function(){function R(M,Q){var X=this.n,ne;if(!(X&&(Q===X||q(X)&&z(X,Q)))&&ne!==Q)return!0}e.obj.empty=e.obj.empty||function(M,Q){return n("obj.empty"),M?!J(M,R,{n:Q}):!0}}(),function(){function R(ne,Ae){if(arguments.length===2){R.r=R.r||{},R.r[ne]=Ae;return}R.r=R.r||[],R.r.push(ne)}var M=Object.keys,Q,X;Object.keys=Object.keys||function(ne){return Q(ne,function(Ae,te,de){de(te)})},e.obj.map=Q=e.obj.map||function(ne,Ae,te){n("obj.map");var de,me=0,ve,De,At,Ke,ze=typeof Ae=="function";if(R.r=de,M&&q(ne)&&(At=M(ne),Ke=!0),te=te||{},i(ne)||At)for(ve=(At||ne).length;me<ve;me++){var gt=me+e.list.index;if(ze){if(De=Ke?Ae.call(te,ne[At[me]],At[me],R):Ae.call(te,ne[me],gt,R),De!==de)return De}else if(Ae===ne[Ke?At[me]:me])return At?At[me]:gt}else for(me in ne)if(ze){if(z(ne,me)&&(De=te?Ae.call(te,ne[me],me,R):Ae(ne[me],me,R),De!==de))return De}else if(Ae===ne[me])return me;return ze?R.r:e.list.index?0:-1}}(),e.time=e.time||{},e.time.is=e.time.is||function(R){return n("time"),R?R instanceof Date:+new Date().getTime()};var I=e.fn.is,i=e.list.is,U=e.obj,q=U.is,z=U.has,J=U.map,s={};s.is=function(R){return n("val.is"),R===ae?!1:R===null?!0:R===1/0?!1:m(R)||d(R)||x(R)?!0:s.link.is(R)||!1},s.link=s.rel={_:"#"},function(){s.link.is=function(M){if(n("val.link.is"),M&&M[u]&&!M._&&q(M)){var Q={};if(J(M,R,Q),Q.id)return Q.id}return!1};function R(M,Q){var X=this;if(X.id)return X.id=!1;if(Q==u&&m(M))X.id=M;else return X.id=!1}}(),s.link.ify=function(R){return n("val.link.ify"),L({},u,R)},e.obj.has._=".";var u=s.link._,ae,d=e.bi.is,x=e.num.is,m=e.text.is,U=e.obj,q=U.is,L=U.put,J=U.map;e.val=e.val||s;var y={_:"_"};y.soul=function(R,M){return n("node.soul"),R&&R._&&R._[M||w]},y.soul.ify=function(R,M){return n("node.soul.ify"),M=typeof M=="string"?{soul:M}:M||{},R=R||{},R._=R._||{},R._[w]=M.soul||R._[w]||b(),R},y.soul._=s.link._,function(){y.is=function(M,Q,X){n("node.is");var ne;return q(M)&&(ne=y.soul(M))?!J(M,R,{as:X,cb:Q,s:ne,n:M}):!1};function R(M,Q){if(Q!==y._){if(!s.is(M))return!0;this.cb&&this.cb.call(this.as,M,Q,this.n,this.s)}}}(),function(){y.ify=function(M,Q,X){return n("node.ify"),Q?typeof Q=="string"?Q={soul:Q}:typeof Q=="function"&&(Q={map:Q}):Q={},Q.map&&(Q.node=Q.map.call(X,M,ae,Q.node||{})),(Q.node=y.soul.ify(Q.node||{},Q))&&J(M,R,{o:Q,as:X}),Q.node};function R(M,Q){var X=this.o,ne,Ae;if(X.map){ne=X.map.call(this.as,M,""+Q,X.node),Ae===ne?V(X.node,Q):X.node&&(X.node[Q]=ne);return}s.is(M)&&(X.node[Q]=M)}}();var U=e.obj,q=U.is,V=U.del,J=U.map,E=e.text,b=E.random,w=y.soul._,ae;e.node=e.node||y;var _=e.state;_.lex=function(){return n("state.lex"),_().toString(36).replace(".","")},_.to=function(R,M,Q){n("state.to");var X=(R||{})[M];return q(X)&&(X=le(X)),_.ify(Q,M,_.is(R,M),X,y.soul(R))},function(){_.map=function(M,Q,X){n("state.map");var ne,Ae=q(Ae=M||Q)?Ae:null;return M=I(M=M||Q)?M:null,Ae&&!M?(Q=x(Q)?Q:_(),Ae[B]=Ae[B]||{},J(Ae,R,{o:Ae,s:Q}),Ae):(X=X||q(Q)?Q:ne,Q=x(Q)?Q:_(),function(te,de,me,ve){if(!M)return R.call({o:me,s:Q},te,de),te;M.call(X||this||{},te,de,me,ve),!(z(me,de)&&ne===me[de])&&R.call({o:me,s:Q},te,de)})};function R(M,Q){B!==Q&&_.ify(this.o,Q,this.s)}}();var U=e.obj,$=U.as,z=U.has,q=U.is,J=U.map,le=U.copy,C=e.num,x=C.is,k=e.fn,I=k.is,B=y._,ae,O={};(function(){O.is=function(Q,X,ne,Ae){return n("graph.is"),!Q||!q(Q)||re(Q)?!1:!J(Q,R,{cb:X,fn:ne,as:Ae})};function R(Q,X){if(!Q||X!==y.soul(Q)||!y.is(Q,this.fn,this.as))return!0;this.cb&&(M.n=Q,M.as=this.as,this.cb.call(M.as,Q,X,M))}function M(Q){Q&&y.is(M.n,Q,M.as)}})(),function(){O.ify=function(Ae,te,de){n("graph.ify");var me={path:[],obj:Ae};return te?typeof te=="string"?te={soul:te}:typeof te=="function"&&(te.map=te):te={},typeof de=="string"&&(te.soul=te.soul||de,de=ae),te.soul&&(me.link=s.link.ify(te.soul)),te.shell=(de||{}).shell,te.graph=te.graph||{},te.seen=te.seen||[],te.as=te.as||de,R(te,me),te.root=me.node,te.graph};function R(Ae,te){var de;return(de=ne(Ae,te))?de:(te.env=Ae,te.soul=Q,y.ify(te.obj,M,te)&&(te.link=te.link||s.link.ify(y.soul(te.node)),te.obj!==Ae.shell&&(Ae.graph[s.link.is(te.link)]=te.node)),te)}function M(Ae,te,de){var me=this,ve=me.env,De,At;if(y._===te&&z(Ae,s.link._))return de._;if(De=X(Ae,te,de,me,ve)){if(te||(me.node=me.node||de||{},z(Ae,y._)&&y.soul(Ae)&&(me.node._=le(Ae._)),me.node=y.soul.ify(me.node,s.link.is(me.link)),me.link=me.link||s.link.ify(y.soul(me.node))),(At=ve.map)&&(At.call(ve.as||{},Ae,te,de,me),z(de,te))){if(Ae=de[te],ae===Ae){V(de,te);return}if(!(De=X(Ae,te,de,me,ve)))return}if(!te)return me.node;if(De===!0)return Ae;if(At=R(ve,{obj:Ae,path:me.path.concat(te)}),!!At.node)return At.link}}function Q(Ae){var te=this,de=s.link.is(te.link),me=te.env.graph;te.link=te.link||s.link.ify(Ae),te.link[s.link._]=Ae,te.node&&te.node[y._]&&(te.node[y._][s.link._]=Ae),z(me,de)&&(me[Ae]=me[de],V(me,de))}function X(Ae,te,de,me,ve){var De;if(s.is(Ae))return!0;if(q(Ae))return 1;if(De=ve.invalid)return Ae=De.call(ve.as||{},Ae,te,de),X(Ae,te,de,me,ve);ve.err="Invalid value at '"+me.path.concat(te).join(".")+"'!",e.list.is(Ae)&&(ve.err+=" Use `.set(item)` instead of an Array.")}function ne(Ae,te){for(var de=Ae.seen,me=de.length,ve;me--;)if(ve=de[me],te.obj===ve.obj)return ve;de.push(te)}}(),O.node=function(R){n("graph.node");var M=y.soul(R);if(M)return L({},M,R)},function(){O.to=function(M,Q,X){if(n("graph.to"),!!M){var ne={};return X=X||{seen:{}},J(M[Q],R,{obj:ne,graph:M,opt:X}),ne}};function R(M,Q){var X,ne;if(y._===Q){if(re(M,s.link._))return;this.obj[Q]=le(M);return}if(!(X=s.link.is(M))){this.obj[Q]=M;return}if(ne=this.opt.seen[X]){this.obj[Q]=ne;return}this.obj[Q]=this.opt.seen[X]=O.to(this.graph,X,this.opt)}}();var I=e.fn.is,U=e.obj,q=U.is,V=U.del,z=U.has,re=U.empty,L=U.put,J=U.map,le=U.copy,ae;e.graph=e.graph||O}})()});var ed=pe((aC,Zc)=>{Zc.exports=Xc()});var yo=pe(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.regexpCode=nt.getEsmExportName=nt.getProperty=nt.safeStringify=nt.stringify=nt.strConcat=nt.addCodeArg=nt.str=nt._=nt.nil=nt._Code=nt.Name=nt.IDENTIFIER=nt._CodeOrName=void 0;var mo=class{};nt._CodeOrName=mo;nt.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var _n=class extends mo{constructor(e){if(super(),!nt.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};nt.Name=_n;var hA=class extends mo{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((i,s)=>`${i}${s}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((i,s)=>(s instanceof _n&&(i[s.str]=(i[s.str]||0)+1),i),{})}};nt._Code=hA;nt.nil=new hA("");function td(n,...e){let i=[n[0]],s=0;for(;s<e.length;)q0(i,e[s]),i.push(n[++s]);return new hA(i)}nt._=td;var L0=new hA("+");function Ad(n,...e){let i=[go(n[0])],s=0;for(;s<e.length;)i.push(L0),q0(i,e[s]),i.push(L0,go(n[++s]));return fw(i),new hA(i)}nt.str=Ad;function q0(n,e){e instanceof hA?n.push(...e._items):e instanceof _n?n.push(e):n.push(hw(e))}nt.addCodeArg=q0;function fw(n){let e=1;for(;e<n.length-1;){if(n[e]===L0){let i=cw(n[e-1],n[e+1]);if(i!==void 0){n.splice(e-1,3,i);continue}n[e++]="+"}e++}}function cw(n,e){if(e==='""')return n;if(n==='""')return e;if(typeof n=="string")return e instanceof _n||n[n.length-1]!=='"'?void 0:typeof e!="string"?`${n.slice(0,-1)}${e}"`:e[0]==='"'?n.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(n instanceof _n))return`"${n}${e.slice(1)}`}function dw(n,e){return e.emptyStr()?n:n.emptyStr()?e:Ad`${n}${e}`}nt.strConcat=dw;function hw(n){return typeof n=="number"||typeof n=="boolean"||n===null?n:go(Array.isArray(n)?n.join(","):n)}function pw(n){return new hA(go(n))}nt.stringify=pw;function go(n){return JSON.stringify(n).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}nt.safeStringify=go;function mw(n){return typeof n=="string"&&nt.IDENTIFIER.test(n)?new hA(`.${n}`):td`[${n}]`}nt.getProperty=mw;function gw(n){if(typeof n=="string"&&nt.IDENTIFIER.test(n))return new hA(`${n}`);throw new Error(`CodeGen: invalid export name: ${n}, use explicit $id name mapping`)}nt.getEsmExportName=gw;function yw(n){return new hA(n.toString())}nt.regexpCode=yw});var H0=pe(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.ValueScope=Zt.ValueScopeName=Zt.Scope=Zt.varKinds=Zt.UsedValueState=void 0;var Xt=yo(),U0=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Is;(function(n){n[n.Started=0]="Started",n[n.Completed=1]="Completed"})(Is||(Zt.UsedValueState=Is={}));Zt.varKinds={const:new Xt.Name("const"),let:new Xt.Name("let"),var:new Xt.Name("var")};var Bs=class{constructor({prefixes:e,parent:i}={}){this._names={},this._prefixes=e,this._parent=i}toName(e){return e instanceof Xt.Name?e:this.name(e)}name(e){return new Xt.Name(this._newName(e))}_newName(e){let i=this._names[e]||this._nameGroup(e);return`${e}${i.index++}`}_nameGroup(e){var i,s;if(!((s=(i=this._parent)===null||i===void 0?void 0:i._prefixes)===null||s===void 0)&&s.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Zt.Scope=Bs;var Ms=class extends Xt.Name{constructor(e,i){super(i),this.prefix=e}setValue(e,{property:i,itemIndex:s}){this.value=e,this.scopePath=(0,Xt._)`.${new Xt.Name(i)}[${s}]`}};Zt.ValueScopeName=Ms;var ww=(0,Xt._)`\n`,G0=class extends Bs{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?ww:Xt.nil}}get(){return this._scope}name(e){return new Ms(e,this._newName(e))}value(e,i){var s;if(i.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let u=this.toName(e),{prefix:d}=u,m=(s=i.key)!==null&&s!==void 0?s:i.ref,y=this._values[d];if(y){let w=y.get(m);if(w)return w}else y=this._values[d]=new Map;y.set(m,u);let E=this._scope[d]||(this._scope[d]=[]),b=E.length;return E[b]=i.ref,u.setValue(i,{property:d,itemIndex:b}),u}getValue(e,i){let s=this._values[e];if(s)return s.get(i)}scopeRefs(e,i=this._values){return this._reduceValues(i,s=>{if(s.scopePath===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return(0,Xt._)`${e}${s.scopePath}`})}scopeCode(e=this._values,i,s){return this._reduceValues(e,u=>{if(u.value===void 0)throw new Error(`CodeGen: name "${u}" has no value`);return u.value.code},i,s)}_reduceValues(e,i,s={},u){let d=Xt.nil;for(let m in e){let y=e[m];if(!y)continue;let E=s[m]=s[m]||new Map;y.forEach(b=>{if(E.has(b))return;E.set(b,Is.Started);let w=i(b);if(w){let _=this.opts.es5?Zt.varKinds.var:Zt.varKinds.const;d=(0,Xt._)`${d}${_} ${b} = ${w};${this.opts._n}`}else if(w=u?.(b))d=(0,Xt._)`${d}${w}${this.opts._n}`;else throw new U0(b);E.set(b,Is.Completed)})}return d}};Zt.ValueScope=G0});var Ge=pe(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.or=Je.and=Je.not=Je.CodeGen=Je.operators=Je.varKinds=Je.ValueScopeName=Je.ValueScope=Je.Scope=Je.Name=Je.regexpCode=Je.stringify=Je.getProperty=Je.nil=Je.strConcat=Je.str=Je._=void 0;var Ze=yo(),EA=H0(),Ir=yo();Object.defineProperty(Je,"_",{enumerable:!0,get:function(){return Ir._}});Object.defineProperty(Je,"str",{enumerable:!0,get:function(){return Ir.str}});Object.defineProperty(Je,"strConcat",{enumerable:!0,get:function(){return Ir.strConcat}});Object.defineProperty(Je,"nil",{enumerable:!0,get:function(){return Ir.nil}});Object.defineProperty(Je,"getProperty",{enumerable:!0,get:function(){return Ir.getProperty}});Object.defineProperty(Je,"stringify",{enumerable:!0,get:function(){return Ir.stringify}});Object.defineProperty(Je,"regexpCode",{enumerable:!0,get:function(){return Ir.regexpCode}});Object.defineProperty(Je,"Name",{enumerable:!0,get:function(){return Ir.Name}});var Qs=H0();Object.defineProperty(Je,"Scope",{enumerable:!0,get:function(){return Qs.Scope}});Object.defineProperty(Je,"ValueScope",{enumerable:!0,get:function(){return Qs.ValueScope}});Object.defineProperty(Je,"ValueScopeName",{enumerable:!0,get:function(){return Qs.ValueScopeName}});Object.defineProperty(Je,"varKinds",{enumerable:!0,get:function(){return Qs.varKinds}});Je.operators={GT:new Ze._Code(">"),GTE:new Ze._Code(">="),LT:new Ze._Code("<"),LTE:new Ze._Code("<="),EQ:new Ze._Code("==="),NEQ:new Ze._Code("!=="),NOT:new Ze._Code("!"),OR:new Ze._Code("||"),AND:new Ze._Code("&&"),ADD:new Ze._Code("+")};var or=class{optimizeNodes(){return this}optimizeNames(e,i){return this}},V0=class extends or{constructor(e,i,s){super(),this.varKind=e,this.name=i,this.rhs=s}render({es5:e,_n:i}){let s=e?EA.varKinds.var:this.varKind,u=this.rhs===void 0?"":` = ${this.rhs}`;return`${s} ${this.name}${u};`+i}optimizeNames(e,i){if(e[this.name.str])return this.rhs&&(this.rhs=_i(this.rhs,e,i)),this}get names(){return this.rhs instanceof Ze._CodeOrName?this.rhs.names:{}}},js=class extends or{constructor(e,i,s){super(),this.lhs=e,this.rhs=i,this.sideEffects=s}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,i){if(!(this.lhs instanceof Ze.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=_i(this.rhs,e,i),this}get names(){let e=this.lhs instanceof Ze.Name?{}:{...this.lhs.names};return Fs(e,this.rhs)}},z0=class extends js{constructor(e,i,s,u){super(e,s,u),this.op=i}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},J0=class extends or{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},K0=class extends or{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},W0=class extends or{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Y0=class extends or{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,i){return this.code=_i(this.code,e,i),this}get names(){return this.code instanceof Ze._CodeOrName?this.code.names:{}}},wo=class extends or{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((i,s)=>i+s.render(e),"")}optimizeNodes(){let{nodes:e}=this,i=e.length;for(;i--;){let s=e[i].optimizeNodes();Array.isArray(s)?e.splice(i,1,...s):s?e[i]=s:e.splice(i,1)}return e.length>0?this:void 0}optimizeNames(e,i){let{nodes:s}=this,u=s.length;for(;u--;){let d=s[u];d.optimizeNames(e,i)||(_w(e,d.names),s.splice(u,1))}return s.length>0?this:void 0}get names(){return this.nodes.reduce((e,i)=>En(e,i.names),{})}},sr=class extends wo{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},X0=class extends wo{},wi=class extends sr{};wi.kind="else";var vn=class n extends sr{constructor(e,i){super(i),this.condition=e}render(e){let i=`if(${this.condition})`+super.render(e);return this.else&&(i+="else "+this.else.render(e)),i}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let i=this.else;if(i){let s=i.optimizeNodes();i=this.else=Array.isArray(s)?new wi(s):s}if(i)return e===!1?i instanceof n?i:i.nodes:this.nodes.length?this:new n(rd(e),i instanceof n?[i]:i.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,i){var s;if(this.else=(s=this.else)===null||s===void 0?void 0:s.optimizeNames(e,i),!!(super.optimizeNames(e,i)||this.else))return this.condition=_i(this.condition,e,i),this}get names(){let e=super.names;return Fs(e,this.condition),this.else&&En(e,this.else.names),e}};vn.kind="if";var bn=class extends sr{};bn.kind="for";var Z0=class extends bn{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,i){if(super.optimizeNames(e,i))return this.iteration=_i(this.iteration,e,i),this}get names(){return En(super.names,this.iteration.names)}},el=class extends bn{constructor(e,i,s,u){super(),this.varKind=e,this.name=i,this.from=s,this.to=u}render(e){let i=e.es5?EA.varKinds.var:this.varKind,{name:s,from:u,to:d}=this;return`for(${i} ${s}=${u}; ${s}<${d}; ${s}++)`+super.render(e)}get names(){let e=Fs(super.names,this.from);return Fs(e,this.to)}},Ns=class extends bn{constructor(e,i,s,u){super(),this.loop=e,this.varKind=i,this.name=s,this.iterable=u}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,i){if(super.optimizeNames(e,i))return this.iterable=_i(this.iterable,e,i),this}get names(){return En(super.names,this.iterable.names)}},_o=class extends sr{constructor(e,i,s){super(),this.name=e,this.args=i,this.async=s}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};_o.kind="func";var vo=class extends wo{render(e){return"return "+super.render(e)}};vo.kind="return";var tl=class extends sr{render(e){let i="try"+super.render(e);return this.catch&&(i+=this.catch.render(e)),this.finally&&(i+=this.finally.render(e)),i}optimizeNodes(){var e,i;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(i=this.finally)===null||i===void 0||i.optimizeNodes(),this}optimizeNames(e,i){var s,u;return super.optimizeNames(e,i),(s=this.catch)===null||s===void 0||s.optimizeNames(e,i),(u=this.finally)===null||u===void 0||u.optimizeNames(e,i),this}get names(){let e=super.names;return this.catch&&En(e,this.catch.names),this.finally&&En(e,this.finally.names),e}},bo=class extends sr{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};bo.kind="catch";var Eo=class extends sr{render(e){return"finally"+super.render(e)}};Eo.kind="finally";var Al=class{constructor(e,i={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...i,_n:i.lines?`
|
|
3
3
|
`:""},this._extScope=e,this._scope=new EA.Scope({parent:e}),this._nodes=[new X0]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,i){let s=this._extScope.value(e,i);return(this._values[s.prefix]||(this._values[s.prefix]=new Set)).add(s),s}getScopeValue(e,i){return this._extScope.getValue(e,i)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,i,s,u){let d=this._scope.toName(i);return s!==void 0&&u&&(this._constants[d.str]=s),this._leafNode(new V0(e,d,s)),d}const(e,i,s){return this._def(EA.varKinds.const,e,i,s)}let(e,i,s){return this._def(EA.varKinds.let,e,i,s)}var(e,i,s){return this._def(EA.varKinds.var,e,i,s)}assign(e,i,s){return this._leafNode(new js(e,i,s))}add(e,i){return this._leafNode(new z0(e,Je.operators.ADD,i))}code(e){return typeof e=="function"?e():e!==Ze.nil&&this._leafNode(new Y0(e)),this}object(...e){let i=["{"];for(let[s,u]of e)i.length>1&&i.push(","),i.push(s),(s!==u||this.opts.es5)&&(i.push(":"),(0,Ze.addCodeArg)(i,u));return i.push("}"),new Ze._Code(i)}if(e,i,s){if(this._blockNode(new vn(e)),i&&s)this.code(i).else().code(s).endIf();else if(i)this.code(i).endIf();else if(s)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new vn(e))}else(){return this._elseNode(new wi)}endIf(){return this._endBlockNode(vn,wi)}_for(e,i){return this._blockNode(e),i&&this.code(i).endFor(),this}for(e,i){return this._for(new Z0(e),i)}forRange(e,i,s,u,d=this.opts.es5?EA.varKinds.var:EA.varKinds.let){let m=this._scope.toName(e);return this._for(new el(d,m,i,s),()=>u(m))}forOf(e,i,s,u=EA.varKinds.const){let d=this._scope.toName(e);if(this.opts.es5){let m=i instanceof Ze.Name?i:this.var("_arr",i);return this.forRange("_i",0,(0,Ze._)`${m}.length`,y=>{this.var(d,(0,Ze._)`${m}[${y}]`),s(d)})}return this._for(new Ns("of",u,d,i),()=>s(d))}forIn(e,i,s,u=this.opts.es5?EA.varKinds.var:EA.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Ze._)`Object.keys(${i})`,s);let d=this._scope.toName(e);return this._for(new Ns("in",u,d,i),()=>s(d))}endFor(){return this._endBlockNode(bn)}label(e){return this._leafNode(new J0(e))}break(e){return this._leafNode(new K0(e))}return(e){let i=new vo;if(this._blockNode(i),this.code(e),i.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(vo)}try(e,i,s){if(!i&&!s)throw new Error('CodeGen: "try" without "catch" and "finally"');let u=new tl;if(this._blockNode(u),this.code(e),i){let d=this.name("e");this._currNode=u.catch=new bo(d),i(d)}return s&&(this._currNode=u.finally=new Eo,this.code(s)),this._endBlockNode(bo,Eo)}throw(e){return this._leafNode(new W0(e))}block(e,i){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(i),this}endBlock(e){let i=this._blockStarts.pop();if(i===void 0)throw new Error("CodeGen: not in self-balancing block");let s=this._nodes.length-i;if(s<0||e!==void 0&&s!==e)throw new Error(`CodeGen: wrong number of nodes: ${s} vs ${e} expected`);return this._nodes.length=i,this}func(e,i=Ze.nil,s,u){return this._blockNode(new _o(e,i,s)),u&&this.code(u).endFunc(),this}endFunc(){return this._endBlockNode(_o)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,i){let s=this._currNode;if(s instanceof e||i&&s instanceof i)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${i?`${e.kind}/${i.kind}`:e.kind}"`)}_elseNode(e){let i=this._currNode;if(!(i instanceof vn))throw new Error('CodeGen: "else" without "if"');return this._currNode=i.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let i=this._nodes;i[i.length-1]=e}};Je.CodeGen=Al;function En(n,e){for(let i in e)n[i]=(n[i]||0)+(e[i]||0);return n}function Fs(n,e){return e instanceof Ze._CodeOrName?En(n,e.names):n}function _i(n,e,i){if(n instanceof Ze.Name)return s(n);if(!u(n))return n;return new Ze._Code(n._items.reduce((d,m)=>(m instanceof Ze.Name&&(m=s(m)),m instanceof Ze._Code?d.push(...m._items):d.push(m),d),[]));function s(d){let m=i[d.str];return m===void 0||e[d.str]!==1?d:(delete e[d.str],m)}function u(d){return d instanceof Ze._Code&&d._items.some(m=>m instanceof Ze.Name&&e[m.str]===1&&i[m.str]!==void 0)}}function _w(n,e){for(let i in e)n[i]=(n[i]||0)-(e[i]||0)}function rd(n){return typeof n=="boolean"||typeof n=="number"||n===null?!n:(0,Ze._)`!${rl(n)}`}Je.not=rd;var vw=nd(Je.operators.AND);function bw(...n){return n.reduce(vw)}Je.and=bw;var Ew=nd(Je.operators.OR);function $w(...n){return n.reduce(Ew)}Je.or=$w;function nd(n){return(e,i)=>e===Ze.nil?i:i===Ze.nil?e:(0,Ze._)`${rl(e)} ${n} ${rl(i)}`}function rl(n){return n instanceof Ze.Name?n:(0,Ze._)`(${n})`}});var Ye=pe(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.checkStrictMode=We.getErrorPath=We.Type=We.useFunc=We.setEvaluated=We.evaluatedPropsToName=We.mergeEvaluated=We.eachItem=We.unescapeJsonPointer=We.escapeJsonPointer=We.escapeFragment=We.unescapeFragment=We.schemaRefOrVal=We.schemaHasRulesButRef=We.schemaHasRules=We.checkUnknownRules=We.alwaysValidSchema=We.toHash=void 0;var dt=Ge(),Pw=yo();function kw(n){let e={};for(let i of n)e[i]=!0;return e}We.toHash=kw;function Cw(n,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(sd(n,e),!ad(e,n.self.RULES.all))}We.alwaysValidSchema=Cw;function sd(n,e=n.schema){let{opts:i,self:s}=n;if(!i.strictSchema||typeof e=="boolean")return;let u=s.RULES.keywords;for(let d in e)u[d]||fd(n,`unknown keyword: "${d}"`)}We.checkUnknownRules=sd;function ad(n,e){if(typeof n=="boolean")return!n;for(let i in n)if(e[i])return!0;return!1}We.schemaHasRules=ad;function Sw(n,e){if(typeof n=="boolean")return!n;for(let i in n)if(i!=="$ref"&&e.all[i])return!0;return!1}We.schemaHasRulesButRef=Sw;function Dw({topSchemaRef:n,schemaPath:e},i,s,u){if(!u){if(typeof i=="number"||typeof i=="boolean")return i;if(typeof i=="string")return(0,dt._)`${i}`}return(0,dt._)`${n}${e}${(0,dt.getProperty)(s)}`}We.schemaRefOrVal=Dw;function xw(n){return ld(decodeURIComponent(n))}We.unescapeFragment=xw;function Rw(n){return encodeURIComponent(il(n))}We.escapeFragment=Rw;function il(n){return typeof n=="number"?`${n}`:n.replace(/~/g,"~0").replace(/\//g,"~1")}We.escapeJsonPointer=il;function ld(n){return n.replace(/~1/g,"/").replace(/~0/g,"~")}We.unescapeJsonPointer=ld;function Tw(n,e){if(Array.isArray(n))for(let i of n)e(i);else e(n)}We.eachItem=Tw;function id({mergeNames:n,mergeToName:e,mergeValues:i,resultToName:s}){return(u,d,m,y)=>{let E=m===void 0?d:m instanceof dt.Name?(d instanceof dt.Name?n(u,d,m):e(u,d,m),m):d instanceof dt.Name?(e(u,m,d),d):i(d,m);return y===dt.Name&&!(E instanceof dt.Name)?s(u,E):E}}We.mergeEvaluated={props:id({mergeNames:(n,e,i)=>n.if((0,dt._)`${i} !== true && ${e} !== undefined`,()=>{n.if((0,dt._)`${e} === true`,()=>n.assign(i,!0),()=>n.assign(i,(0,dt._)`${i} || {}`).code((0,dt._)`Object.assign(${i}, ${e})`))}),mergeToName:(n,e,i)=>n.if((0,dt._)`${i} !== true`,()=>{e===!0?n.assign(i,!0):(n.assign(i,(0,dt._)`${i} || {}`),ol(n,i,e))}),mergeValues:(n,e)=>n===!0?!0:{...n,...e},resultToName:ud}),items:id({mergeNames:(n,e,i)=>n.if((0,dt._)`${i} !== true && ${e} !== undefined`,()=>n.assign(i,(0,dt._)`${e} === true ? true : ${i} > ${e} ? ${i} : ${e}`)),mergeToName:(n,e,i)=>n.if((0,dt._)`${i} !== true`,()=>n.assign(i,e===!0?!0:(0,dt._)`${i} > ${e} ? ${i} : ${e}`)),mergeValues:(n,e)=>n===!0?!0:Math.max(n,e),resultToName:(n,e)=>n.var("items",e)})};function ud(n,e){if(e===!0)return n.var("props",!0);let i=n.var("props",(0,dt._)`{}`);return e!==void 0&&ol(n,i,e),i}We.evaluatedPropsToName=ud;function ol(n,e,i){Object.keys(i).forEach(s=>n.assign((0,dt._)`${e}${(0,dt.getProperty)(s)}`,!0))}We.setEvaluated=ol;var od={};function Ow(n,e){return n.scopeValue("func",{ref:e,code:od[e.code]||(od[e.code]=new Pw._Code(e.code))})}We.useFunc=Ow;var nl;(function(n){n[n.Num=0]="Num",n[n.Str=1]="Str"})(nl||(We.Type=nl={}));function Iw(n,e,i){if(n instanceof dt.Name){let s=e===nl.Num;return i?s?(0,dt._)`"[" + ${n} + "]"`:(0,dt._)`"['" + ${n} + "']"`:s?(0,dt._)`"/" + ${n}`:(0,dt._)`"/" + ${n}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return i?(0,dt.getProperty)(n).toString():"/"+il(n)}We.getErrorPath=Iw;function fd(n,e,i=n.opts.strictSchema){if(i){if(e=`strict mode: ${e}`,i===!0)throw new Error(e);n.self.logger.warn(e)}}We.checkStrictMode=fd});var pA=pe(sl=>{"use strict";Object.defineProperty(sl,"__esModule",{value:!0});var qt=Ge(),Bw={data:new qt.Name("data"),valCxt:new qt.Name("valCxt"),instancePath:new qt.Name("instancePath"),parentData:new qt.Name("parentData"),parentDataProperty:new qt.Name("parentDataProperty"),rootData:new qt.Name("rootData"),dynamicAnchors:new qt.Name("dynamicAnchors"),vErrors:new qt.Name("vErrors"),errors:new qt.Name("errors"),this:new qt.Name("this"),self:new qt.Name("self"),scope:new qt.Name("scope"),json:new qt.Name("json"),jsonPos:new qt.Name("jsonPos"),jsonLen:new qt.Name("jsonLen"),jsonPart:new qt.Name("jsonPart")};sl.default=Bw});var $o=pe(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.extendErrors=Ut.resetErrorsCount=Ut.reportExtraError=Ut.reportError=Ut.keyword$DataError=Ut.keywordError=void 0;var tt=Ge(),Ls=Ye(),zt=pA();Ut.keywordError={message:({keyword:n})=>(0,tt.str)`must pass "${n}" keyword validation`};Ut.keyword$DataError={message:({keyword:n,schemaType:e})=>e?(0,tt.str)`"${n}" keyword must be ${e} ($data)`:(0,tt.str)`"${n}" keyword is invalid ($data)`};function Mw(n,e=Ut.keywordError,i,s){let{it:u}=n,{gen:d,compositeRule:m,allErrors:y}=u,E=hd(n,e,i);s??(m||y)?cd(d,E):dd(u,(0,tt._)`[${E}]`)}Ut.reportError=Mw;function jw(n,e=Ut.keywordError,i){let{it:s}=n,{gen:u,compositeRule:d,allErrors:m}=s,y=hd(n,e,i);cd(u,y),d||m||dd(s,zt.default.vErrors)}Ut.reportExtraError=jw;function Nw(n,e){n.assign(zt.default.errors,e),n.if((0,tt._)`${zt.default.vErrors} !== null`,()=>n.if(e,()=>n.assign((0,tt._)`${zt.default.vErrors}.length`,e),()=>n.assign(zt.default.vErrors,null)))}Ut.resetErrorsCount=Nw;function Fw({gen:n,keyword:e,schemaValue:i,data:s,errsCount:u,it:d}){if(u===void 0)throw new Error("ajv implementation error");let m=n.name("err");n.forRange("i",u,zt.default.errors,y=>{n.const(m,(0,tt._)`${zt.default.vErrors}[${y}]`),n.if((0,tt._)`${m}.instancePath === undefined`,()=>n.assign((0,tt._)`${m}.instancePath`,(0,tt.strConcat)(zt.default.instancePath,d.errorPath))),n.assign((0,tt._)`${m}.schemaPath`,(0,tt.str)`${d.errSchemaPath}/${e}`),d.opts.verbose&&(n.assign((0,tt._)`${m}.schema`,i),n.assign((0,tt._)`${m}.data`,s))})}Ut.extendErrors=Fw;function cd(n,e){let i=n.const("err",e);n.if((0,tt._)`${zt.default.vErrors} === null`,()=>n.assign(zt.default.vErrors,(0,tt._)`[${i}]`),(0,tt._)`${zt.default.vErrors}.push(${i})`),n.code((0,tt._)`${zt.default.errors}++`)}function dd(n,e){let{gen:i,validateName:s,schemaEnv:u}=n;u.$async?i.throw((0,tt._)`new ${n.ValidationError}(${e})`):(i.assign((0,tt._)`${s}.errors`,e),i.return(!1))}var $n={keyword:new tt.Name("keyword"),schemaPath:new tt.Name("schemaPath"),params:new tt.Name("params"),propertyName:new tt.Name("propertyName"),message:new tt.Name("message"),schema:new tt.Name("schema"),parentSchema:new tt.Name("parentSchema")};function hd(n,e,i){let{createErrors:s}=n.it;return s===!1?(0,tt._)`{}`:Qw(n,e,i)}function Qw(n,e,i={}){let{gen:s,it:u}=n,d=[Lw(u,i),qw(n,i)];return Uw(n,e,d),s.object(...d)}function Lw({errorPath:n},{instancePath:e}){let i=e?(0,tt.str)`${n}${(0,Ls.getErrorPath)(e,Ls.Type.Str)}`:n;return[zt.default.instancePath,(0,tt.strConcat)(zt.default.instancePath,i)]}function qw({keyword:n,it:{errSchemaPath:e}},{schemaPath:i,parentSchema:s}){let u=s?e:(0,tt.str)`${e}/${n}`;return i&&(u=(0,tt.str)`${u}${(0,Ls.getErrorPath)(i,Ls.Type.Str)}`),[$n.schemaPath,u]}function Uw(n,{params:e,message:i},s){let{keyword:u,data:d,schemaValue:m,it:y}=n,{opts:E,propertyName:b,topSchemaRef:w,schemaPath:_}=y;s.push([$n.keyword,u],[$n.params,typeof e=="function"?e(n):e||(0,tt._)`{}`]),E.messages&&s.push([$n.message,typeof i=="function"?i(n):i]),E.verbose&&s.push([$n.schema,m],[$n.parentSchema,(0,tt._)`${w}${_}`],[zt.default.data,d]),b&&s.push([$n.propertyName,b])}});var md=pe(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.boolOrEmptySchema=vi.topBoolOrEmptySchema=void 0;var Gw=$o(),Hw=Ge(),Vw=pA(),zw={message:"boolean schema is false"};function Jw(n){let{gen:e,schema:i,validateName:s}=n;i===!1?pd(n,!1):typeof i=="object"&&i.$async===!0?e.return(Vw.default.data):(e.assign((0,Hw._)`${s}.errors`,null),e.return(!0))}vi.topBoolOrEmptySchema=Jw;function Kw(n,e){let{gen:i,schema:s}=n;s===!1?(i.var(e,!1),pd(n)):i.var(e,!0)}vi.boolOrEmptySchema=Kw;function pd(n,e){let{gen:i,data:s}=n,u={gen:i,keyword:"false schema",data:s,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:n};(0,Gw.reportError)(u,zw,void 0,e)}});var al=pe(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.getRules=bi.isJSONType=void 0;var Ww=["string","number","integer","boolean","null","object","array"],Yw=new Set(Ww);function Xw(n){return typeof n=="string"&&Yw.has(n)}bi.isJSONType=Xw;function Zw(){let n={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...n,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},n.number,n.string,n.array,n.object],post:{rules:[]},all:{},keywords:{}}}bi.getRules=Zw});var ll=pe(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});Br.shouldUseRule=Br.shouldUseGroup=Br.schemaHasRulesForType=void 0;function e_({schema:n,self:e},i){let s=e.RULES.types[i];return s&&s!==!0&&gd(n,s)}Br.schemaHasRulesForType=e_;function gd(n,e){return e.rules.some(i=>yd(n,i))}Br.shouldUseGroup=gd;function yd(n,e){var i;return n[e.keyword]!==void 0||((i=e.definition.implements)===null||i===void 0?void 0:i.some(s=>n[s]!==void 0))}Br.shouldUseRule=yd});var Po=pe(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.reportTypeError=Gt.checkDataTypes=Gt.checkDataType=Gt.coerceAndCheckDataType=Gt.getJSONTypes=Gt.getSchemaTypes=Gt.DataType=void 0;var t_=al(),A_=ll(),r_=$o(),He=Ge(),wd=Ye(),Ei;(function(n){n[n.Correct=0]="Correct",n[n.Wrong=1]="Wrong"})(Ei||(Gt.DataType=Ei={}));function n_(n){let e=_d(n.type);if(e.includes("null")){if(n.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&n.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');n.nullable===!0&&e.push("null")}return e}Gt.getSchemaTypes=n_;function _d(n){let e=Array.isArray(n)?n:n?[n]:[];if(e.every(t_.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}Gt.getJSONTypes=_d;function i_(n,e){let{gen:i,data:s,opts:u}=n,d=o_(e,u.coerceTypes),m=e.length>0&&!(d.length===0&&e.length===1&&(0,A_.schemaHasRulesForType)(n,e[0]));if(m){let y=fl(e,s,u.strictNumbers,Ei.Wrong);i.if(y,()=>{d.length?s_(n,e,d):cl(n)})}return m}Gt.coerceAndCheckDataType=i_;var vd=new Set(["string","number","integer","boolean","null"]);function o_(n,e){return e?n.filter(i=>vd.has(i)||e==="array"&&i==="array"):[]}function s_(n,e,i){let{gen:s,data:u,opts:d}=n,m=s.let("dataType",(0,He._)`typeof ${u}`),y=s.let("coerced",(0,He._)`undefined`);d.coerceTypes==="array"&&s.if((0,He._)`${m} == 'object' && Array.isArray(${u}) && ${u}.length == 1`,()=>s.assign(u,(0,He._)`${u}[0]`).assign(m,(0,He._)`typeof ${u}`).if(fl(e,u,d.strictNumbers),()=>s.assign(y,u))),s.if((0,He._)`${y} !== undefined`);for(let b of i)(vd.has(b)||b==="array"&&d.coerceTypes==="array")&&E(b);s.else(),cl(n),s.endIf(),s.if((0,He._)`${y} !== undefined`,()=>{s.assign(u,y),a_(n,y)});function E(b){switch(b){case"string":s.elseIf((0,He._)`${m} == "number" || ${m} == "boolean"`).assign(y,(0,He._)`"" + ${u}`).elseIf((0,He._)`${u} === null`).assign(y,(0,He._)`""`);return;case"number":s.elseIf((0,He._)`${m} == "boolean" || ${u} === null
|
|
4
4
|
|| (${m} == "string" && ${u} && ${u} == +${u})`).assign(y,(0,He._)`+${u}`);return;case"integer":s.elseIf((0,He._)`${m} === "boolean" || ${u} === null
|
|
@@ -36,3 +36,4 @@ https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
|
|
|
36
36
|
* @author Roberto Valenti
|
|
37
37
|
* @license GPL-3.0-or-later
|
|
38
38
|
*/
|
|
39
|
+
if (typeof window !== 'undefined') { window.HoloSphere = HoloSphere.default || HoloSphere; } if (typeof global !== 'undefined') { global.HoloSphere = HoloSphere.default || HoloSphere; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "holosphere",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.14",
|
|
4
4
|
"description": "Holonic Geospatial Communication Infrastructure",
|
|
5
5
|
"main": "holosphere.js",
|
|
6
6
|
"types": "holosphere.d.ts",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"prepare": "npm run build",
|
|
12
12
|
"build:browser": "node build.js",
|
|
13
13
|
"build:bundle": "node build.js",
|
|
14
|
-
"prepublishOnly
|
|
14
|
+
"prepublishOnly": "npm run build",
|
|
15
15
|
"publish:cdn": "npm publish && echo 'Package published to npm and will be available on CDNs within minutes'",
|
|
16
16
|
"publish:force": "npm publish --force && echo 'Package force published to npm and will be available on CDNs within minutes'",
|
|
17
17
|
"prepublish:skip-tests": "npm run build"
|