diff --git a/.all-contributorsrc b/.all-contributorsrc new file mode 100644 index 0000000..7660b4c --- /dev/null +++ b/.all-contributorsrc @@ -0,0 +1,62 @@ +{ + "projectName": "THNK", + "projectOwner": "arthuro555", + "repoType": "github", + "repoHost": "https://github.com", + "files": [ + "README.md" + ], + "imageSize": 100, + "commitConvention": "none", + "contributors": [ + { + "name": "Ko-fi contributors", + "avatar_url": "https://storage.ko-fi.com/cdn/brandasset/kofi_s_logo_nolabel.png", + "profile": "https://ko-fi.com/arthuro555", + "contributions": [ + "financial" + ] + }, + { + "login": "arthuro555", + "name": "Arthur Pacaud", + "avatar_url": "https://avatars.githubusercontent.com/u/19349038?v=4", + "profile": "https://github.com/arthuro555", + "contributions": [ + "maintenance", + "code", + "doc", + "blog" + ] + }, + { + "login": "MyNameIsRinax", + "name": "Rinax", + "avatar_url": "https://avatars.githubusercontent.com/u/40387061?v=4", + "profile": "https://github.com/MyNameIsRinax", + "contributions": [ + "bug" + ] + }, + { + "login": "Midhil457", + "name": "Leo_Red", + "avatar_url": "https://avatars.githubusercontent.com/u/73597906?v=4", + "profile": "https://github.com/Midhil457", + "contributions": [ + "design" + ] + }, + { + "login": "Entr0py404", + "name": "Tim", + "avatar_url": "https://avatars.githubusercontent.com/u/75917656?v=4", + "profile": "https://github.com/Entr0py404", + "contributions": [ + "doc" + ] + } + ], + "contributorsPerLine": 7, + "linkToUsage": false +} \ No newline at end of file diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 69c4ebf..9555d8d 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1 +1,2 @@ ko_fi: arthuro555 +github: arthuro555 diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..fb899ad --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "[mdx]": { + "editor.wordWrap": "on" + } +} \ No newline at end of file diff --git a/README.md b/README.md index 60ab0a6..91ec102 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,57 @@ # π€ THNK + + An authoritative multiplayer games framework for the FLOSS engine GDevelop. ## Links +- [π Website](https://thnk.cloud/) - [π° Introduction blog post](https://bit.ly/thnk-introduction) - [π Roadmap](https://bit.ly/thnk-roadmap) - [π Support the project](https://ko-fi.com/arthuro555) +- [π Documentation](https://thnk.cloud/docs/getting-started/) + +## Contributors + +Thanks to all the contributors to THNK! Here is the full list of all contributors of all kinds to the project: + + +[](#contributors-) + + + + + +
![]() Ko-fi contributors π΅ |
+ Arthur Pacaud π§ π» π π |
+ Rinax π |
+ Leo_Red π¨ |
+ Tim π |
+
+
{let r,i=-1,a,n=e[0*2+1],o=0,p=7,l=4;for(n===0&&(p=138,l=3),r=0;r<=s;r++)if(a=n,n=e[(r+1)*2+1],!(++o {let e;for(ai(t,t.dyn_ltree,t.l_desc.max_code),ai(t,t.dyn_dtree,t.d_desc.max_code),Os(t,t.bl_desc),e=zs-1;e>=3&&t.bl_tree[gr[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},bn=(t,e,s,r)=>{let i;for(rt(t,e-257,5),rt(t,s-1,5),rt(t,r-4,4),i=0;i it&&A(c),o.offset=c;let p=pn(f.subarray(e,c),s.idsToInsert);return s=null,p}return S&yn?(f.start=e,f.end=c,f):f.subarray(e,c)}finally{if(a){I<10&&I++;let p=a.sharedLength||h;if(a.length>p&&(a.length=p),x>1e4)a.transitions=null,I=0,x=0,U.length>0&&(U=[]);else if(U.length>0&&!b){for(let g=0,y=U.length;g >8,f[c++]=p&255):(f[c++]=223,H.setUint32(c,p),c+=4);for(let[y,R]of u)k(y),k(R)}else{for(let y=0,R=Si.length;y {f[c++]=222;let p=c-e;c+=2;let g=0;for(let y in u)(S||u.hasOwnProperty(y))&&(k(y),k(u[y]),g++);f[p+++e]=g>>8,f[p+e]=g&255}:t.progressiveRecords&&!w?(u,S)=>{let p,g=a.transitions||(a.transitions=Object.create(null)),y=c++-e,R;for(let T in u)if(S||u.hasOwnProperty(T)){if(p=g[T],p)g=p;else{let C=Object.keys(u),L=g;g=a.transitions;let E=0;for(let at=0,Et=C.length;at=0&&this.vtable[e]==0;e--);let s=e+1;for(;e>=0;e--)this.addInt16(this.vtable[e]!=0?t-this.vtable[e]:0);let r=2;this.addInt16(t-this.object_start);let i=(s+r)*2;this.addInt16(i);let a=0,n=this.space;t:for(e=0;e65535&&(p-=65536,r.push(p>>>10&1023|55296),p=56320|p&1023),r.push(p)}else r.push(i);r.length>=4096&&(e+=W.apply(String,r),r.length=0)}return r.length>0&&(e+=W.apply(String,r)),e}function Gs(t){let e=new Array(t);for(let s=0;s{let s=e.getString?t.createSharedString(e.getString()):null;S.startObjState(t),S.addX(t,e.getX()),S.addY(t,e.getY()),S.addHeight(t,e.getHeight()),S.addWidth(t,e.getWidth()),S.addAngle(t,e.getAngle()),e.getX()===0&&S.addSetXTo0(t,!0),e.getY()===0&&S.addSetYTo0(t,!0),e.getHeight()===0&&S.addSetHeightTo0(t,!0),e.getWidth()===0&&S.addSetWidthTo0(t,!0),e.getWidth()===0&&S.addSetAngleTo0(t,!0),e.getZOrder()<=65535?S.addZOrder(t,e.getZOrder()+1):S.addBigZOrder(t,e.getZOrder()+1),S.addVisible(t,e.isHidden()?1:2),e.isFlippedX&&S.addFlippedX(t,e.isFlippedX()?1:2),e.isFlippedY&&S.addFlippedY(t,e.isFlippedY()?1:2),e.getOpacity&&(e.getOpacity()!==0?S.addOpacity(t,e.getOpacity()):S.addSetOpacityTo0(t,!0)),e.getAnimation&&S.addAnimation(t,e.getAnimation()+1),s&&S.addText(t,s);let r=S.endObjState(t),{stateVariable:i}=e,a=i.getChildrenCount()!==0?J.createPackedVariablesVector(t,Ts(i)):null,n=t.createSharedString(e.getName());return J.startGameObject(t),J.addId(t,e.thnkID),J.addName(t,n),J.addObjState(t,r),a&&J.addPackedVariables(t,a),J.endGameObject(t)},Ca=(t,e)=>{let s=null;if(e.getX()!==e.prevX||e.getY()!==e.prevY||e.getHeight()!==e.prevHeight||e.getWidth()!==e.prevWidth||e.getAngle()!==e.prevAngle||e.getZOrder()!==e.prevZOrder||e.isHidden()!==e.prevVisibility||e.isFlippedX&&e.isFlippedX()!==e.prevFlippedX||e.isFlippedY&&e.isFlippedY()!==e.prevFlippedY||e.getOpacity&&e.getOpacity()!==e.prevOpacity||e.getAnimation&&e.getAnimation()!==e.prevAnimation||e.getString&&e.getString()!==e.prevText){let a=e.getString&&e.getString()!==e.prevText?t.createSharedString(e.getString()):null;S.startObjState(t),e.getX()!==e.prevX&&(e.prevX=e.getX(),e.getX()!==0?S.addX(t,e.getX()):S.addSetXTo0(t,!0)),e.getY()!==e.prevY&&(e.prevY=e.getY(),e.getY()!==0?S.addY(t,e.getY()):S.addSetYTo0(t,!0)),e.getHeight()!==e.prevHeight&&(e.prevHeight=e.getHeight(),e.getHeight()!==0?S.addHeight(t,e.getHeight()):S.addSetHeightTo0(t,!0)),e.getWidth()!==e.prevWidth&&(e.prevWidth=e.getWidth(),e.getWidth()!==0?S.addWidth(t,e.getWidth()):S.addSetWidthTo0(t,!0)),e.getAngle()!==e.prevAngle&&(e.prevAngle=e.getAngle(),e.getAngle()!==0?S.addAngle(t,e.getAngle()):S.addSetAngleTo0(t,!0)),e.getZOrder()!==e.prevZOrder&&(e.prevZOrder=e.getZOrder(),e.getZOrder()<=65535?S.addZOrder(t,e.getZOrder()+1):S.addBigZOrder(t,e.getZOrder()+1)),e.isHidden()!==e.prevVisibility&&(e.prevVisibility=e.isHidden(),S.addVisible(t,e.isHidden()?1:2)),e.isFlippedX&&e.isFlippedX()!==e.prevFlippedX&&(e.prevFlippedX=e.isFlippedX(),S.addFlippedX(t,e.isFlippedX()?1:2)),e.isFlippedY&&e.isFlippedY()!==e.prevFlippedY&&(e.prevFlippedY=e.isFlippedY(),S.addFlippedY(t,e.isFlippedY()?1:2)),e.getOpacity&&e.getOpacity()!==e.prevOpacity&&(e.prevOpacity=e.getOpacity(),e.getOpacity()!==0?S.addOpacity(t,e.getOpacity()):S.addSetOpacityTo0(t,!0)),e.getAnimation&&e.getAnimation()!==e.prevAnimation&&(e.prevAnimation=e.getAnimation(),S.addAnimation(t,e.getAnimation()+1)),e.getString&&a&&(e.prevText=e.getString(),S.addText(t,a)),s=S.endObjState(t)}let{stateVariable:r}=e,i=r.isDirty()?r.serialize(t):null;return!s&&!i?null:(J.startGameObject(t),J.addId(t,e.thnkID),s&&J.addObjState(t,s),i&&J.addVariables(t,i),J.endGameObject(t))},Ra=new gdjs.Logger(\"THNK - Objects replication\"),Ma=class{constructor(){this.recycledIDs=[],this.currentNewID=1,this.generateNewID=()=>{let t=this.recycledIDs.pop()??this.currentNewID++;return t>65535?(Ra.error(\"Maximum amount of simultaneously replicated objects reached! Weird stuff is going to happen...\"),t%65535):t},this.registeredObjects=new Map,this.createdObjects=new Map,this.deletedObjects=new Set}registerObject(t){t.thnkID=this.generateNewID(),this.registeredObjects.set(t.thnkID,t),this.createdObjects.set(t.thnkID,t.getName()),t.stateVariable=ot.setupSyncedVariable(t.getVariables())}unregisterObject(t){this.recycledIDs.push(t.thnkID),this.registeredObjects.delete(t.thnkID),this.deletedObjects.add(t.thnkID),this.createdObjects.delete(t.thnkID)}diffObjects(t){let e=[];for(let s of this.registeredObjects.values()){let r=Ca(t,s);r&&e.push(r)}return e}createObjectsSnapshot(t){let e=[];for(let s of this.registeredObjects.values())e.push(Ta(t,s));return e}getCreatedObjects(){let t=[...this.createdObjects.entries()];return this.createdObjects.clear(),t}getDeletedObjects(){let t=Uint16Array.from(this.deletedObjects.values());return this.deletedObjects.clear(),t}},za=class{constructor(t,e){this.objectsRegistery=new Ma,this.playerManager=new Fa,this.runServerCode=!0,this.adapter=t,this.syncedVariable=e}},nr=(t,e)=>{let s=ot.setupSyncedVariable(t.getVariables());t.thnkServer=new za(e,s),ar()||t.thnkServer.playerManager._onConnect(e.getServerID())},Ss=new gdjs.Logger(\"THNK - Server\"),es=0,Va=t=>{if(!t.thnkServer)return;let{adapter:e}=t.thnkServer;for(let[r,i]of e.getUsersPendingMessages()){for(let a of i)switch(a.contentType()){case 1:pa(r,e,t),t.thnkServer.playerManager._onConnect(r);continue;case 2:let n=a.content(new yt),o=n.name();if(!o)continue;let p=n.contentArray();Sa(r,o,p);continue;default:Ss.error(`Received message with unknown type '${a.contentType()}'`);continue}i.length=0}for(let r of e.getDisconnectedUsers())t.thnkServer.playerManager._onDisconnect(r);e.getDisconnectedUsers().length=0;let s=t.getTimeManager();es+=s.getElapsedTime()/s.getTimeScale(),es>1e3/rr()&&(es=0,t.thnkServer.runServerCode=!0)},Ea=t=>{!t.thnkServer||!t.thnkServer.runServerCode||(t.thnkServer.runServerCode=!1,ga(t.thnkServer.adapter,t))},$t=null,or=(t,e)=>{if(t.thnkServer){let{adapter:s}=t.thnkServer;$t={adapter:s,isPause:e},e&&(t.thnkServer.previouslyConnectedUsers=new Set(s.getConnectedUsers()))}},Ba=t=>{if($t){let{adapter:e,isPause:s}=$t;nr(t,e);for(let r of e.getConnectedUsers())t.thnkServer.playerManager._onConnect(r);wa(e,t.getName(),s),$t=null}},Na=t=>{if($t)if(t.thnkServer){let{adapter:e,previouslyConnectedUsers:s}=t.thnkServer;if(s){let r=[],i=[];for(let a of e.getConnectedUsers())s.has(a)?i.push(a):r.push(a);ts(r,e,t),ts(i,e)}else Ss.warn(\"List of previously connected players not found! A full snapshot will be sent to all players. This is likely a bug, please open an issue on the THNK GitHub page!\"),ts([...e.getConnectedUsers()],e,t)}else Ss.warn(\"Resumed a scene that is not a server, shutting the server down. This is likely a bug, please open an issue on the THNK GitHub page!\"),$t.adapter.close()};gdjs.registerRuntimeScenePreEventsCallback(Va);gdjs.registerRuntimeScenePostEventsCallback(Ea);gdjs.registerRuntimeSceneUnloadedCallback(t=>or(t,!1));gdjs.registerRuntimeScenePausedCallback(t=>or(t,!0));gdjs.registerRuntimeSceneLoadedCallback(Ba);gdjs.registerRuntimeSceneResumedCallback(Na);var Da=new gdjs.Logger(\"THNK - Server\"),Za=async(t,e,s)=>{try{await t.prepare(e)}catch(i){Da.error(\"Adapter crashed while starting server! Error: \",i);return}let r=s?e.getGame().getSceneStack().replace(s,!0):e;nr(r,t)},Pa={popMessage:Oa,addRawMessageToTheQueue:ka,popConnection:Ia,popDisconnection:Aa},lr={};Xe(lr,{getConnectionState:()=>Xa,messages:()=>$a,startClient:()=>Qa});var Le=(t,e)=>{switch(e.type()){case 1:return t.setString(e.text()),t;case 2:return t.setNumber(e.number()),t;case 3:return t.setBoolean(e.boolean()),t}if(e.type()===4){t.castTo(\"structure\");for(let s=e.operationsLength(),r=0,i=e.operations(0);r{let s=t.objState();if(s){let a=s.x();a!==null&&e.setX(a);let n=s.y();n!==null&&e.setY(n);let o=s.height();o!==null&&e.setHeight(o);let p=s.width();p!==null&&e.setWidth(p);let l=s.angle();l!==null&&e.setAngle(l),s.setXTo0()&&e.setX(0),s.setYTo0()&&e.setY(0),s.setHeightTo0()&&e.setHeight(0),s.setWidthTo0()&&e.setWidth(0),s.setAngleTo0()&&e.setAngle(0);{let T=s.visible();T!==null&&e.hide(T===1);let F=s.flippedX();F!==null&&e.flipX&&e.flipX(F===1);let j=s.flippedY();j!==null&&e.flipY&&e.flipY(j===1)}let d=s.zOrder()??s.bigZOrder();d!==null&&e.setZOrder(d-1);let I=s.opacity();e.setOpacity&&(I!==null&&e.setOpacity(I),s.setOpacityTo0()&&e.setOpacity(0));let w=s.animation();w!==null&&e.setAnimation&&e.setAnimation(w-1);let _=s.text();_!==null&&e.setString&&e.setString(_)}let r=e.getVariables().get(\"State\"),i=t.variables();if(i)Le(r,i);else{let a=t.packedVariablesArray();a&&Cs(r,a)}},hr=(t,e)=>{if(!e.thnkClient)return;let{objectsRegistery:s}=e.thnkClient,r=t.variablesArray();if(r&&Cs(e.getVariables().get(\"State\"),r),s.clear(),t.objectsLength()!==0)for(let i=t.objectsLength(),a=0,n=t.objects(0);a{if(!e.thnkClient)return;let{objectsRegistery:s}=e.thnkClient,r=t.variables();r&&Le(e.getVariables().get(\"State\"),r);let i=t.deletedObjectsArray();if(i)for(let a of i)s.deleteObject(a);if(t.createdObjectsLength()!==0)for(let a=t.createdObjectsLength(),n=0,o=t.createdObjects(0);n{if(!t.thnkClient)return;let{adapter:e}=t.thnkClient;for(let s of e.getPendingMessages())switch(s.contentType()){case 1:ei.warn(\"A second ConnectionStartMessage was received from the server. This is likely a bug, please open an issue on the THNK GitHub!\");continue;case 2:let r=s.content(new Nt).newState();r&&La(r,t);continue;case 3:let i=s.content(new ht),a=i.sceneName();if(!a){console.error(\"Server requested scene switch, but no scene name was sent! This is likely a bug, please open an issue on the THNK GitHub!\");continue}let n=i.isPause()?t.getGame().getSceneStack().push(a):t.getGame().getSceneStack().replace(a,!0);n.thnkClient=t.thnkClient,t=n;continue;case 4:let o=s.content(new dt),p=o.name(),l=null;try{l=p?t.getGame().getSceneStack().replace(p,!0):t.getGame().getSceneStack().pop()}catch{console.info(\"Error spotted!\")}if(!l)continue;let d=o.snapshot();d&&hr(d,l),l.thnkClient=t.thnkClient,t=l;continue;default:ei.error(`Received message with unknown type '${s.contentType()}'`)}e.markPendingMessagesAsRead()};gdjs.registerRuntimeScenePreEventsCallback(Ha);var Ga=(t,e)=>{let s=new Xt(32),r=e?s.createString(e):null;Ut.startConnectionRequestMessage(s),r&&Ut.addToken(s,r);let i=Ut.endConnectionRequestMessage(s);t.sendClientMessage(s,vt.createClientMessage(s,1,i))},Ya=(t,e,s)=>{let r=new Xt(256),i=r.createString(e),a=yt.createContentVector(r,Ts(s)),n=yt.createClientInputMessage(r,i,a);t.sendClientMessage(r,vt.createClientMessage(r,2,n))},cr=\"disconnected\",de=t=>cr=t,Xa=()=>cr,Wa=class{constructor(t){this.objectsRegistery=new Map,this.runtimeScene=t}registerObject(t,e){e.thnkID=t,this.objectsRegistery.set(t,e)}getObject(t){return this.objectsRegistery.get(t)}deleteObject(t){let e=this.objectsRegistery.get(t);!e||(e.deleteFromScene(this.runtimeScene),this.objectsRegistery.delete(t))}clear(){this.objectsRegistery.forEach(t=>t.deleteFromScene(this.runtimeScene)),this.objectsRegistery.clear()}},qa=class{constructor(t,e){this.adapter=t,this.objectsRegistery=new Wa(e)}},Ka=new gdjs.Logger(\"THNK - Client\"),si=t=>{de(\"failed\"),Ka.error(\"Connection failed: \"+t)},Qa=async(t,e)=>{de(\"connecting\");let s=t.getGame().getSceneStack();try{await e.prepare(t)}catch{si(\"Adapter crashed while starting server!\");return}de(\"loading\"),Ga(e);let r=setInterval(()=>{let i=e.getPendingMessages().shift();if(!!i&&i.contentType()===1){clearInterval(r);let a=i.content(new Dt),n=a.sceneName(),o=a.sceneSnapshot();if(!n||!o){si(\"Server Connection Start Message was invalid, couldn't finish setting up the connection.\");return}let p=s.replace(n,!0);p.thnkClient=new qa(e,p),hr(o,p),de(\"connected\")}},200)},$a={sendClientMessage:Ya};function ee(t){let e=t.length;for(;--e>=0;)t[e]=0}var Ja=0,br=1,tn=2,en=3,sn=258,Ms=29,Oe=256,fe=Oe+1+Ms,Jt=30,zs=19,ur=2*fe+1,Zt=15,ss=16,rn=7,Vs=256,_r=16,fr=17,pr=18,ks=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Ee=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),an=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),gr=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),nn=512,St=new Array((fe+2)*2);ee(St);var he=new Array(Jt*2);ee(he);var pe=new Array(nn);ee(pe);var ge=new Array(sn-en+1);ee(ge);var Es=new Array(Ms);ee(Es);var He=new Array(Jt);ee(He);function is(t,e,s,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=s,this.elems=r,this.max_length=i,this.has_stree=t&&t.length}var wr,mr,yr;function rs(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}var vr=t=>t<256?pe[t]:pe[256+(t>>>7)],we=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},rt=(t,e,s)=>{t.bi_valid>ss-s?(t.bi_buf|=e<4){a[i++]=65533,r+=o-1;continue}for(n&=o===2?31:o===3?15:7;o>1&&r1){a[i++]=65533;continue}n<65536?a[i++]=n:(n-=65536,a[i++]=55296|n>>10&1023,a[i++]=56320|n&1023)}return Oo(a,i)},Ao=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let s=e-1;for(;s>=0&&(t[s]&192)===128;)s--;return s<0||s===0?e:s+ye[t[s]]>e?s:e},ve={string2buf:ko,buf2string:Io,utf8border:Ao};function xo(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0}var Cr=xo,Rr=Object.prototype.toString,{Z_NO_FLUSH:jo,Z_SYNC_FLUSH:Uo,Z_FULL_FLUSH:Fo,Z_FINISH:To,Z_OK:Ge,Z_STREAM_END:Co,Z_DEFAULT_COMPRESSION:Ro,Z_DEFAULT_STRATEGY:Mo,Z_DEFLATED:zo}=se;function Ae(t){this.options=Qe.assign({level:Ro,method:zo,chunkSize:16384,windowBits:15,memLevel:8,strategy:Mo},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new Cr,this.strm.avail_out=0;let s=ce.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(s!==Ge)throw new Error(Lt[s]);if(e.header&&ce.deflateSetHeader(this.strm,e.header),e.dictionary){let r;if(typeof e.dictionary==\"string\"?r=ve.string2buf(e.dictionary):Rr.call(e.dictionary)===\"[object ArrayBuffer]\"?r=new Uint8Array(e.dictionary):r=e.dictionary,s=ce.deflateSetDictionary(this.strm,r),s!==Ge)throw new Error(Lt[s]);this._dict_set=!0}}Ae.prototype.push=function(t,e){let s=this.strm,r=this.options.chunkSize,i,a;if(this.ended)return!1;for(e===~~e?a=e:a=e===!0?To:jo,typeof t==\"string\"?s.input=ve.string2buf(t):Rr.call(t)===\"[object ArrayBuffer]\"?s.input=new Uint8Array(t):s.input=t,s.next_in=0,s.avail_in=s.input.length;;){if(s.avail_out===0&&(s.output=new Uint8Array(r),s.next_out=0,s.avail_out=r),(a===Uo||a===Fo)&&s.avail_out<=6){this.onData(s.output.subarray(0,s.next_out)),s.avail_out=0;continue}if(i=ce.deflate(s,a),i===Co)return s.next_out>0&&this.onData(s.output.subarray(0,s.next_out)),i=ce.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Ge;if(s.avail_out===0){this.onData(s.output);continue}if(a>0&&s.next_out>0){this.onData(s.output.subarray(0,s.next_out)),s.avail_out=0;continue}if(s.avail_in===0)break}return!0};Ae.prototype.onData=function(t){this.chunks.push(t)};Ae.prototype.onEnd=function(t){t===Ge&&(this.result=Qe.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Bs(t,e){let s=new Ae(e);if(s.push(t,!0),s.err)throw s.msg||Lt[s.err];return s.result}function Vo(t,e){return e=e||{},e.raw=!0,Bs(t,e)}function Eo(t,e){return e=e||{},e.gzip=!0,Bs(t,e)}var Bo=Ae,No=Bs,Do=Vo,Zo=Eo,Po=se,Lo={Deflate:Bo,deflate:No,deflateRaw:Do,gzip:Zo,constants:Po},Ce=30,Ho=12,Go=function(t,e){let s,r,i,a,n,o,p,l,d,I,w,_,T,F,j,x,O,y,A,Z,R,b,k,f,g=t.state;s=t.next_in,k=t.input,r=s+(t.avail_in-5),i=t.next_out,f=t.output,a=i-(e-t.avail_out),n=i+(t.avail_out-257),o=g.dmax,p=g.wsize,l=g.whave,d=g.wnext,I=g.window,w=g.hold,_=g.bits,T=g.lencode,F=g.distcode,j=(1<=32&&(s.highByte=i-32>>5))}t.sharedLength=t.length;for(let i in e||[])if(i>=0){let a=t[i],s=e[i];s&&(a&&((t.restoreStructures||(t.restoreStructures=[]))[i]=a),t[i]=s)}return this.structures=t}decode(t,e){return this.unpack(t,e)}};function Ve(){try{if(!nt.trusted&&!ee){let e=M.sharedLength||0;e{var i=X();let a=t;e!==void 0&&(t=t<32?-((e<<5)+t):(e<<5)+t,i.highByte=e);let s=M[t];return s&&s.isShared&&((M.restoreStructures||(M.restoreStructures=[]))[t]=s),M[t]=i,i.read=Ti(i,a),i.read()};ot[0]=()=>{};ot[0].noBuffer=!0;ot[101]=()=>{let t=X();return(globalThis[t[0]]||Error)(t[1])};ot[105]=t=>{let e=z.getUint32(d-4);It||(It=new Map);let i=v[d],a;i>=144&&i<160||i==220||i==221?a=[]:a={};let s={target:a};It.set(e,s);let n=X();return s.used?Object.assign(a,n):(s.target=n,n)};ot[112]=t=>{let e=z.getUint32(d-4),i=It.get(e);return i.used=!0,i.target};ot[115]=()=>new Set(X());var qs=[\"Int8\",\"Uint8\",\"Uint8Clamped\",\"Int16\",\"Uint16\",\"Int32\",\"Uint32\",\"Float32\",\"Float64\",\"BigInt64\",\"BigUint64\"].map(t=>t+\"Array\");ot[116]=t=>{let e=t[0],i=qs[e];if(!i)throw new Error(\"Could not find typed array for code \"+e);return new globalThis[i](Uint8Array.prototype.slice.call(t,1).buffer)};ot[120]=()=>{let t=X();return new RegExp(t[0],t[1])};var dn=[];ot[98]=t=>{let e=(t[0]<<24)+(t[1]<<16)+(t[2]<<8)+t[3],i=d;return d+=e-t.length,J=dn,J=[Ki(),Ki()],J.position0=0,J.position1=0,J.postBundlePosition=d,d=i,X()};ot[255]=t=>t.length==4?new Date((t[0]*16777216+(t[1]<<16)+(t[2]<<8)+t[3])*1e3):t.length==8?new Date(((t[0]<<22)+(t[1]<<14)+(t[2]<<6)+(t[3]>>2))/1e6+((t[3]&3)*4294967296+t[4]*16777216+(t[5]<<16)+(t[6]<<8)+t[7])*1e3):t.length==12?new Date(((t[0]<<24)+(t[1]<<16)+(t[2]<<8)+t[3])/1e6+((t[4]&128?-281474976710656:0)+t[6]*1099511627776+t[7]*4294967296+t[8]*16777216+(t[9]<<16)+(t[10]<<8)+t[11])*1e3):new Date(\"invalid\");function $s(t){let e=At,i=d,a=lt,s=pt,n=Ft,r=It,o=J,b=new Uint8Array(v.slice(0,At)),l=M,h=M.slice(0,M.length),O=nt,w=ee,_=t();return At=e,d=i,lt=a,pt=s,Ft=n,It=r,J=o,v=b,ee=w,M=l,M.splice(0,M.length,...h),nt=O,z=new DataView(v.buffer,v.byteOffset,v.byteLength),_}function vi(){v=null,It=null,M=null}var Fi=new Array(147);for(let t=0;t<256;t++)Fi[t]=+(\"1e\"+Math.floor(45.15-t*.30103));var Qs=new He({useRecords:!1}),cn=Qs.unpack,Be;try{Be=new TextEncoder}catch{}var Si,Js,qe=typeof Buffer<\"u\",Fe=qe?function(t){return Buffer.allocUnsafeSlow(t)}:Uint8Array,ta=qe?Buffer:Uint8Array,Qi=qe?4294967296:2144337920,f,oe,H,c=0,it,K=null,bn=61440,un=/[\\u0080-\\uFFFF]/,qt=Symbol(\"record-id\"),fn=class extends He{constructor(t){super(t),this.offset=0;let e,i,a,s,n=0,r=ta.prototype.utf8Write?function(u,S){return f.utf8Write(u,S,4294967295)}:Be&&Be.encodeInto?function(u,S){return Be.encodeInto(u,f.subarray(S)).written}:!1,o=this;t||(t={});let b=t&&t.sequential,l=t.structures||t.saveStructures,h=t.maxSharedStructures;if(h==null&&(h=l?32:0),h>8160)throw new Error(\"Maximum maxSharedStructure is 8160\");t.structuredClone&&t.moreTypes==null&&(t.moreTypes=!0);let O=t.maxOwnStructures;O==null&&(O=l?32:64),!this.structures&&t.useRecords!=!1&&(this.structures=[]);let w=h>32||O+h>64,_=h+64,V=h+O+64;if(V>8256)throw new Error(\"Maximum maxSharedStructure + maxOwnStructure is 8192\");let U=[],x=0,I=0;this.pack=this.encode=function(u,S){if(f||(f=new Fe(8192),H=new DataView(f.buffer,0,8192),c=0),it=f.length-10,it-c<2048?(f=new Fe(f.length),H=new DataView(f.buffer,0,f.length),it=f.length-10,c=0):c=c+7&2147483640,e=c,s=o.structuredClone?new Map:null,o.bundleStrings&&typeof u!=\"string\"?(K=[],K.size=1/0):K=null,a=o.structures,a){a.uninitialized&&(a=o._mergeStructures(o.getStructures()));let p=a.sharedLength||0;if(p>h)throw new Error(\"Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to \"+a.sharedLength);if(!a.transitions){a.transitions=Object.create(null);for(let g=0;g=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;ke[254]=ke[254]=1;var jo=t=>{if(typeof TextEncoder==\"function\"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,i,a,s,n,r=t.length,o=0;for(s=0;s{\"use strict\";var Nt=require(\"os\"),Xe=require(\"tty\"),b=je(),{env:L}=process,q;b(\"no-color\")||b(\"no-colors\")||b(\"color=false\")||b(\"color=never\")?q=0:(b(\"color\")||b(\"colors\")||b(\"color=true\")||b(\"color=always\"))&&(q=1);\"FORCE_COLOR\"in L&&(L.FORCE_COLOR===\"true\"?q=1:L.FORCE_COLOR===\"false\"?q=0:q=L.FORCE_COLOR.length===0?1:Math.min(parseInt(L.FORCE_COLOR,10),3));function Le(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function Re(r,e){if(q===0)return 0;if(b(\"color=16m\")||b(\"color=full\")||b(\"color=truecolor\"))return 3;if(b(\"color=256\"))return 2;if(r&&!e&&q===void 0)return 0;let t=q||0;if(L.TERM===\"dumb\")return t;if(process.platform===\"win32\"){let i=Nt.release().split(\".\");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if(\"CI\"in L)return[\"TRAVIS\",\"CIRCLECI\",\"APPVEYOR\",\"GITLAB_CI\",\"GITHUB_ACTIONS\",\"BUILDKITE\"].some(i=>i in L)||L.CI_NAME===\"codeship\"?1:t;if(\"TEAMCITY_VERSION\"in L)return/^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(L.TEAMCITY_VERSION)?1:0;if(L.COLORTERM===\"truecolor\")return 3;if(\"TERM_PROGRAM\"in L){let i=parseInt((L.TERM_PROGRAM_VERSION||\"\").split(\".\")[0],10);switch(L.TERM_PROGRAM){case\"iTerm.app\":return i>=3?3:2;case\"Apple_Terminal\":return 2}}return/-256(color)?$/i.test(L.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(L.TERM)||\"COLORTERM\"in L?1:t}function bt(r){let e=Re(r,r&&r.isTTY);return Le(e)}$e.exports={supportsColor:bt,stdout:Le(Re(!0,Xe.isatty(1))),stderr:Le(Re(!0,Xe.isatty(2)))}});var Ve=T((R,he)=>{var xt=require(\"tty\"),ae=require(\"util\");R.init=At;R.log=zt;R.formatArgs=Ut;R.save=Bt;R.load=Pt;R.useColors=Tt;R.destroy=ae.deprecate(()=>{},\"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.\");R.colors=[6,2,3,4,5,1];try{let r=We();r&&(r.stderr||r).level>=2&&(R.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}R.inspectOpts=Object.keys(process.env).filter(r=>/^debug_/i.test(r)).reduce((r,e)=>{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(s,c)=>c.toUpperCase()),i=process.env[e];return/^(yes|on|true|enabled)$/i.test(i)?i=!0:/^(no|off|false|disabled)$/i.test(i)?i=!1:i===\"null\"?i=null:i=Number(i),r[t]=i,r},{});function Tt(){return\"colors\"in R.inspectOpts?Boolean(R.inspectOpts.colors):xt.isatty(process.stderr.fd)}function Ut(r){let{namespace:e,useColors:t}=this;if(t){let i=this.color,s=\"\\x1B[3\"+(i<8?i:\"8;5;\"+i),c=` ${s};1m${e} \\x1B[0m`;r[0]=c+r[0].split(`\n`).join(`\n`+c),r.push(s+\"m+\"+he.exports.humanize(this.diff)+\"\\x1B[0m\")}else r[0]=Mt()+e+\" \"+r[0]}function Mt(){return R.inspectOpts.hideDate?\"\":new Date().toISOString()+\" \"}function zt(...r){return process.stderr.write(ae.format(...r)+`\n`)}function Bt(r){r?process.env.DEBUG=r:delete process.env.DEBUG}function Pt(){return process.env.DEBUG}function At(r){r.inspectOpts={};let e=Object.keys(R.inspectOpts);for(let t=0;t{\"use strict\";var Ot=require(\"os\"),Xe=require(\"tty\"),T=je(),{env:I}=process,H;T(\"no-color\")||T(\"no-colors\")||T(\"color=false\")||T(\"color=never\")?H=0:(T(\"color\")||T(\"colors\")||T(\"color=true\")||T(\"color=always\"))&&(H=1);\"FORCE_COLOR\"in I&&(I.FORCE_COLOR===\"true\"?H=1:I.FORCE_COLOR===\"false\"?H=0:H=I.FORCE_COLOR.length===0?1:Math.min(parseInt(I.FORCE_COLOR,10),3));function Ie(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function Le(r,e){if(H===0)return 0;if(T(\"color=16m\")||T(\"color=full\")||T(\"color=truecolor\"))return 3;if(T(\"color=256\"))return 2;if(r&&!e&&H===void 0)return 0;let t=H||0;if(I.TERM===\"dumb\")return t;if(process.platform===\"win32\"){let i=Ot.release().split(\".\");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if(\"CI\"in I)return[\"TRAVIS\",\"CIRCLECI\",\"APPVEYOR\",\"GITLAB_CI\",\"GITHUB_ACTIONS\",\"BUILDKITE\"].some(i=>i in I)||I.CI_NAME===\"codeship\"?1:t;if(\"TEAMCITY_VERSION\"in I)return/^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(I.TEAMCITY_VERSION)?1:0;if(I.COLORTERM===\"truecolor\")return 3;if(\"TERM_PROGRAM\"in I){let i=parseInt((I.TERM_PROGRAM_VERSION||\"\").split(\".\")[0],10);switch(I.TERM_PROGRAM){case\"iTerm.app\":return i>=3?3:2;case\"Apple_Terminal\":return 2}}return/-256(color)?$/i.test(I.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(I.TERM)||\"COLORTERM\"in I?1:t}function St(r){let e=Le(r,r&&r.isTTY);return Ie(e)}$e.exports={supportsColor:St,stdout:Ie(Le(!0,Xe.isatty(1))),stderr:Ie(Le(!0,Xe.isatty(2)))}});var Ve=U((L,fe)=>{var Nt=require(\"tty\"),ue=require(\"util\");L.init=zt;L.log=Ut;L.formatArgs=Tt;L.save=Mt;L.load=Pt;L.useColors=bt;L.destroy=ue.deprecate(()=>{},\"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.\");L.colors=[6,2,3,4,5,1];try{let r=We();r&&(r.stderr||r).level>=2&&(L.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}L.inspectOpts=Object.keys(process.env).filter(r=>/^debug_/i.test(r)).reduce((r,e)=>{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(s,c)=>c.toUpperCase()),i=process.env[e];return/^(yes|on|true|enabled)$/i.test(i)?i=!0:/^(no|off|false|disabled)$/i.test(i)?i=!1:i===\"null\"?i=null:i=Number(i),r[t]=i,r},{});function bt(){return\"colors\"in L.inspectOpts?Boolean(L.inspectOpts.colors):Nt.isatty(process.stderr.fd)}function Tt(r){let{namespace:e,useColors:t}=this;if(t){let i=this.color,s=\"\\x1B[3\"+(i<8?i:\"8;5;\"+i),c=` ${s};1m${e} \\x1B[0m`;r[0]=c+r[0].split(`",
+ "`).join(`",
+ "`+c),r.push(s+\"m+\"+fe.exports.humanize(this.diff)+\"\\x1B[0m\")}else r[0]=xt()+e+\" \"+r[0]}function xt(){return L.inspectOpts.hideDate?\"\":new Date().toISOString()+\" \"}function Ut(...r){return process.stderr.write(ue.format(...r)+`",
+ "`)}function Mt(r){r?process.env.DEBUG=r:delete process.env.DEBUG}function Pt(){return process.env.DEBUG}function zt(r){r.inspectOpts={};let e=Object.keys(L.inspectOpts);for(let t=0;t