From a4e3eae4156db33656131e9f2515323dd1210561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Dietrich?= Date: Mon, 22 Jan 2024 11:46:16 +0100 Subject: [PATCH] automatic update --- docs/{index.6798d06d.js => index.656e23e7.js} | 2 +- docs/{index.4458cf5d.js => index.c526ff14.js} | 2 +- docs/index.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename docs/{index.6798d06d.js => index.656e23e7.js} (99%) rename docs/{index.4458cf5d.js => index.c526ff14.js} (99%) diff --git a/docs/index.6798d06d.js b/docs/index.656e23e7.js similarity index 99% rename from docs/index.6798d06d.js rename to docs/index.656e23e7.js index 5f9c57c..0add58f 100644 --- a/docs/index.6798d06d.js +++ b/docs/index.656e23e7.js @@ -4659,7 +4659,7 @@ e=e|0;t=t|0;var n=0,i=0,o=0,a=0,l=0,s=0,u=0,c=0,d=0,f=0,p=0,h=0,m=0,g=0;o=r[t+32 // A binary string is expected to only contain char codes < 256. var i=function(e,t,n,r,i,o){var a=void 0,l=o%4,s=(i+l)%4,u=i-s;switch(l){case 0:t[o]=e.charCodeAt(r+3);case 1:t[o+1-(l<<1)|0]=e.charCodeAt(r+2);case 2:t[o+2-(l<<1)|0]=e.charCodeAt(r+1);case 3:t[o+3-(l<<1)|0]=e.charCodeAt(r)}if(!(i>2]=e.charCodeAt(r+a)<<24|e.charCodeAt(r+a+1)<<16|e.charCodeAt(r+a+2)<<8|e.charCodeAt(r+a+3);switch(s){case 3:t[o+u+1|0]=e.charCodeAt(r+u+2);case 2:t[o+u+2|0]=e.charCodeAt(r+u+1);case 1:t[o+u+3|0]=e.charCodeAt(r+u)}}},o=function(e,t,n,r,i,o){var a=void 0,l=o%4,s=(i+l)%4,u=i-s;switch(l){case 0:t[o]=e[r+3];case 1:t[o+1-(l<<1)|0]=e[r+2];case 2:t[o+2-(l<<1)|0]=e[r+1];case 3:t[o+3-(l<<1)|0]=e[r]}if(!(i>2|0]=e[r+a]<<24|e[r+a+1]<<16|e[r+a+2]<<8|e[r+a+3];switch(s){case 3:t[o+u+1|0]=e[r+u+2];case 2:t[o+u+2|0]=e[r+u+1];case 1:t[o+u+3|0]=e[r+u]}}},a=function(e,t,n,i,o,a){var l=void 0,s=a%4,u=(o+s)%4,c=o-u,d=new Uint8Array(r.readAsArrayBuffer(e.slice(i,i+o)));switch(s){case 0:t[a]=d[3];case 1:t[a+1-(s<<1)|0]=d[2];case 2:t[a+2-(s<<1)|0]=d[1];case 3:t[a+3-(s<<1)|0]=d[0]}if(!(o>2|0]=d[l]<<24|d[l+1]<<16|d[l+2]<<8|d[l+3];switch(u){case 3:t[a+c+1|0]=d[c+2];case 2:t[a+c+2|0]=d[c+1];case 1:t[a+c+3|0]=d[c]}}};e.exports=function(e,t,r,l,s,u){if("string"==typeof e)return i(e,t,r,l,s,u);if(e instanceof Array||n&&n.Buffer&&n.Buffer.isBuffer(e))return o(e,t,r,l,s,u);if(e instanceof ArrayBuffer)return o(new Uint8Array(e),t,r,l,s,u);if(e.buffer instanceof ArrayBuffer)return o(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),t,r,l,s,u);if(e instanceof Blob)return a(e,t,r,l,s,u);throw Error("Unsupported data type.")};/***/},/* 7 *//***/function(e,t,n){var r=function(){function e(e,t){for(var n=0;n cb ,n.onmessage=function(e){let t=e.data.id,n=i[t];delete i[t],null!=e.data.error?n(Error("Rusha worker error: "+e.data.error)):n(null,e.data.hash)}),i[r]=t,n.postMessage({id:r,data:e}),r+=1}}),d.register("fN8HE",function(e,t){r(e.exports,"default",function(){return a});var n=d("74PtA");let i="Lobby",o="Station";class a{init(e,t=0){this.userSettings.role=e,this.userID.startsWith(o)&&(this.isStation=!0),this.initUser(),this.initRooms(t),this.heartbeatID&&clearInterval(this.heartbeatID);let n=this;this.heartbeatID=setInterval(()=>{n.heartBeat()},1e4)}initUser(){this.userSettings.displayName=this.userID,this.userSettings.room=this.isStation?this.userID:i,this.userSettings.dateJoined=Date.now(),this.userSettings.timestamp=Date.now(),this.userSettings.tombstone=!1,this.doc.users[this.userID]=this.userSettings}// basic initialize rooms configuration -initRooms(e){for(let t=1;t<=e;t++)this.addRoom(!1,"Room "+t);this.addRoom(!1,i),this.isStation&&this.addRoom(!0,this.userID)}toJSON(e){return e||(e=this.doc),{rooms:this.filterTombstones((0,n.clone)(e.rooms)),users:this.filterTombstones((0,n.clone)(e.users))}}filterTombstones(e){let t={};for(let n in e)e[n].tombstone||(t[n]=e[n],delete t[n].tombstone,delete t[n].timestamp);return this.check("filterTombstones"),t}getUsers(){return this.filterTombstones(this.doc.users)}getUsersInRoom(e){let t=this.doc.getMap("users").toJSON(),n=[];for(let r in t)t[r].room===e&&n.push(r);return n}addRoom(e,t){if(t)this.doc.rooms[t]={studentPublicState:"",teacherPublicState:"",teacherPrivateState:"",timestamp:e?Date.now():0,tombstone:!1},this.update(e),this.check("addRoom");else{let e=Object.keys(this.doc.rooms).filter(e=>e.match(/Room/)).map(e=>e.split(" ")[1]).map(e=>parseInt(e)).sort(),t=1;for(let n of e){if(n!==t)break;t++}return this.addRoom(!0,"Room "+t)}}gotoRoom(e){this.isRoomAlive(e)?this.userSettings.room=e:this.userSettings.room=i,this.userSettings.timestamp=Date.now(),this.userSettings.tombstone=!1,this.doc.users[this.userID]=this.userSettings,this.update(!0),this.check("gotoRoom")}isRoomAlive(e){return this.doc.rooms[e]&&!this.doc.rooms[e].tombstone}isUserAlive(e){return this.doc.users[e]&&!this.doc.users[e].tombstone}encode(){let e=(0,n.clone)(this.doc);return this.check("encode"),e}update(e=!0){this.callback&&this.callback(e)}merge(e){let t=this.doc.rooms,r=this.doc.users;for(let n in e.rooms)t[n]?t[n].timestampe.match(/Room/)).map(e=>e.split(" ")[1]).map(e=>parseInt(e)).sort(),t=1;for(let n of e){if(n!==t)break;t++}return this.addRoom(!0,"Room "+t)}}gotoRoom(e){this.isRoomAlive(e)?this.userSettings.room=e:this.userSettings.room=i,this.userSettings.timestamp=Date.now(),this.userSettings.tombstone=!1,this.doc.users[this.userID]=this.userSettings,this.update(!0),this.check("gotoRoom")}isRoomAlive(e){return this.doc.rooms[e]&&!this.doc.rooms[e].tombstone}isUserAlive(e){return this.doc.users[e]&&!this.doc.users[e].tombstone}encode(){let e=(0,n.clone)(this.doc);return this.check("encode"),e}update(e=!0){this.callback&&this.callback(e)}merge(e){let t=this.doc.rooms,r=this.doc.users;for(let n in e.rooms)t[n]?t[n].timestamp>2]=e.charCodeAt(r+a)<<24|e.charCodeAt(r+a+1)<<16|e.charCodeAt(r+a+2)<<8|e.charCodeAt(r+a+3);switch(u){case 3:t[o+s+1|0]=e.charCodeAt(r+s+2);case 2:t[o+s+2|0]=e.charCodeAt(r+s+1);case 1:t[o+s+3|0]=e.charCodeAt(r+s)}}},o=function(e,t,n,r,i,o){var a=void 0,l=o%4,u=(i+l)%4,s=i-u;switch(l){case 0:t[o]=e[r+3];case 1:t[o+1-(l<<1)|0]=e[r+2];case 2:t[o+2-(l<<1)|0]=e[r+1];case 3:t[o+3-(l<<1)|0]=e[r]}if(!(i>2|0]=e[r+a]<<24|e[r+a+1]<<16|e[r+a+2]<<8|e[r+a+3];switch(u){case 3:t[o+s+1|0]=e[r+s+2];case 2:t[o+s+2|0]=e[r+s+1];case 1:t[o+s+3|0]=e[r+s]}}},a=function(e,t,n,i,o,a){var l=void 0,u=a%4,s=(o+u)%4,c=o-s,d=new Uint8Array(r.readAsArrayBuffer(e.slice(i,i+o)));switch(u){case 0:t[a]=d[3];case 1:t[a+1-(u<<1)|0]=d[2];case 2:t[a+2-(u<<1)|0]=d[1];case 3:t[a+3-(u<<1)|0]=d[0]}if(!(o>2|0]=d[l]<<24|d[l+1]<<16|d[l+2]<<8|d[l+3];switch(s){case 3:t[a+c+1|0]=d[c+2];case 2:t[a+c+2|0]=d[c+1];case 1:t[a+c+3|0]=d[c]}}};e.exports=function(e,t,r,l,u,s){if("string"==typeof e)return i(e,t,r,l,u,s);if(e instanceof Array||n&&n.Buffer&&n.Buffer.isBuffer(e))return o(e,t,r,l,u,s);if(e instanceof ArrayBuffer)return o(new Uint8Array(e),t,r,l,u,s);if(e.buffer instanceof ArrayBuffer)return o(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),t,r,l,u,s);if(e instanceof Blob)return a(e,t,r,l,u,s);throw Error("Unsupported data type.")};/***/},/* 7 *//***/function(e,t,n){var r,i=function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")},o=(r=function(e,t){for(var n=0;n cb ,n.onmessage=function(e){var t=e.data.id,n=i[t];delete i[t],null!=e.data.error?n(Error("Rusha worker error: "+e.data.error)):n(null,e.data.hash)}),i[r]=t,n.postMessage({id:r,data:e}),r+=1}}),f.register("hn8D3",function(e,n){t(e.exports,"default",function(){return u});var r=f("disEZ"),i=f("fJNo6"),o=f("9BzA6"),a="Lobby",l="Station",u=/*#__PURE__*/function(){function e(t){(0,r._)(this,e),this.doc={users:{},rooms:{}},this.userID="",this.isStation=!1,this.userSettings={displayName:"",room:a,role:"student",dateJoined:Date.now(),handRaised:!1,connections:[{id:"",target:{}}],timestamp:Date.now(),tombstone:!1},this.userID=t,this.initUser(),this.initRooms(0)}return(0,i._)(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.userSettings.role=e,this.userID.startsWith(l)&&(this.isStation=!0),this.initUser(),this.initRooms(t),this.heartbeatID&&clearInterval(this.heartbeatID);var n=this;this.heartbeatID=setInterval(function(){n.heartBeat()},1e4)}},{key:"initUser",value:function(){this.userSettings.displayName=this.userID,this.userSettings.room=this.isStation?this.userID:a,this.userSettings.dateJoined=Date.now(),this.userSettings.timestamp=Date.now(),this.userSettings.tombstone=!1,this.doc.users[this.userID]=this.userSettings}},{// basic initialize rooms configuration -key:"initRooms",value:function(e){for(var t=1;t<=e;t++)this.addRoom(!1,"Room "+t);this.addRoom(!1,a),this.isStation&&this.addRoom(!0,this.userID)}},{key:"toJSON",value:function(e){return e||(e=this.doc),{rooms:this.filterTombstones((0,o.clone)(e.rooms)),users:this.filterTombstones((0,o.clone)(e.users))}}},{key:"filterTombstones",value:function(e){var t={};for(var n in e)e[n].tombstone||(t[n]=e[n],delete t[n].tombstone,delete t[n].timestamp);return this.check("filterTombstones"),t}},{key:"getUsers",value:function(){return this.filterTombstones(this.doc.users)}},{key:"getUsersInRoom",value:function(e){var t=this.doc.getMap("users").toJSON(),n=[];for(var r in t)t[r].room===e&&n.push(r);return n}},{key:"addRoom",value:function(e,t){if(t)this.doc.rooms[t]={studentPublicState:"",teacherPublicState:"",teacherPrivateState:"",timestamp:e?Date.now():0,tombstone:!1},this.update(e),this.check("addRoom");else{var n=Object.keys(this.doc.rooms).filter(function(e){return e.match(/Room/)}).map(function(e){return e.split(" ")[1]}).map(function(e){return parseInt(e)}).sort(),r=1,i=!0,o=!1,a=void 0;try{for(var l,u=n[Symbol.iterator]();!(i=(l=u.next()).done)&&l.value===r;i=!0)r++}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}return this.addRoom(!0,"Room "+r)}}},{key:"gotoRoom",value:function(e){this.isRoomAlive(e)?this.userSettings.room=e:this.userSettings.room=a,this.userSettings.timestamp=Date.now(),this.userSettings.tombstone=!1,this.doc.users[this.userID]=this.userSettings,this.update(!0),this.check("gotoRoom")}},{key:"isRoomAlive",value:function(e){return this.doc.rooms[e]&&!this.doc.rooms[e].tombstone}},{key:"isUserAlive",value:function(e){return this.doc.users[e]&&!this.doc.users[e].tombstone}},{key:"encode",value:function(){var e=(0,o.clone)(this.doc);return this.check("encode"),e}},{key:"update",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];this.callback&&this.callback(e)}},{key:"merge",value:function(e){var t,n=this.doc.rooms,r=this.doc.users;for(var i in e.rooms)n[i]?n[i].timestamp1&&void 0!==arguments[1]&&arguments[1];this.doc.users[e].tombstone=!0,this.doc.users[e].timestamp=Date.now(),e.startsWith(l)&&this.isRoomAlive(e)&&this.removeRoom(e),t&&this.update(!0),this.check("removeUser")}},{key:"removeRoom",value:function(e){for(var t in this.doc.rooms[e].tombstone=!0,this.doc.rooms[e].timestamp=Date.now(),e.startsWith(l)&&this.isUserAlive(e)&&this.removeUser(e),this.doc.users)this.isUserAlive(t)&&this.doc.users[t].room===e&&(this.doc.users[t].room=a,this.doc.users[t].timestamp=Date.now());this.check("removeRoom")}},{key:"check",value:function(e){for(var t in this.doc.users)this.isUserAlive(t)&&0===(this.doc.users[t].timestamp||0)&&console.warn("check",e,t)}},{key:"heartBeat",value:function(){var e=Date.now();this.userSettings.timestamp=e,this.userSettings.tombstone=!1,this.doc.users[this.userID]=this.userSettings;var t=[];for(var n in this.doc.users)this.isUserAlive(n)&&(console.warn("HEARTBEAT",n,this.doc.users[n].timestamp||0),(this.doc.users[n].timestamp||0)+36e50)||void 0===arguments[0]||arguments[0];this.callback&&this.callback(e)}},{key:"merge",value:function(e){var t,n=this.doc.rooms,r=this.doc.users;for(var i in e.rooms)n[i]?n[i].timestamp1&&void 0!==arguments[1]&&arguments[1];this.doc.users[e].tombstone=!0,this.doc.users[e].timestamp=Date.now(),e.startsWith(l)&&this.isRoomAlive(e)&&this.removeRoom(e),t&&this.update(!0),this.check("removeUser")}},{key:"removeRoom",value:function(e){for(var t in this.doc.rooms[e].tombstone=!0,this.doc.rooms[e].timestamp=Date.now(),e.startsWith(l)&&this.isUserAlive(e)&&this.removeUser(e),this.doc.users)this.isUserAlive(t)&&this.doc.users[t].room===e&&(this.doc.users[t].room=a,this.doc.users[t].timestamp=Date.now());this.check("removeRoom")}},{key:"check",value:function(e){for(var t in this.doc.users)this.isUserAlive(t)&&0===(this.doc.users[t].timestamp||0)&&console.warn("check",e,t)}},{key:"heartBeat",value:function(){var e=Date.now();this.userSettings.timestamp=e,this.userSettings.tombstone=!1,this.doc.users[this.userID]=this.userSettings;var t=[];for(var n in this.doc.users)this.isUserAlive(n)&&(console.warn("HEARTBEAT",n,this.doc.users[n].timestamp||0),(this.doc.users[n].timestamp||0)+36e5Edrys - Lite \ No newline at end of file +Edrys - Lite \ No newline at end of file