ops.NowjsMemberModel=function(k){varl={},h={},e=k.getNowObject();this.getMemberDetailsAndUpdates=function(b,g){vara=b.split("___")[0],f=l[a],d=h[a]||[],c;h[a]=d;runtime.assert(void0!==g,"missing callback");for(c=0;c<d.length&&(d[c].subscriber!==g||d[c].memberId!==b);c+=1);c<d.length?runtime.log("double subscription request for "+b+" in NowjsMemberModel::getMemberDetailsAndUpdates"):(d.push({memberId:b,subscriber:g}),1===d.length&&e.subscribeUserDetailsUpdates(a));f&&g(b,f)};this.unsubscribeMemberDetailsUpdates=
function(b,g){vara,f=b.split("___")[0],d=h[f];runtime.assert(void0!==g,"missing subscriber parameter or null");runtime.assert(d,"tried to unsubscribe when no one is subscribed ('"+b+"')");if(d){for(a=0;a<d.length&&(d[a].subscriber!==g||d[a].memberId!==b);a+=1);runtime.assert(a<d.length,"tried to unsubscribe when not subscribed for memberId '"+b+"'");d.splice(a,1);0===d.length&&(runtime.log("no more subscribers for: "+b),deleteh[f],deletel[f],e.unsubscribeUserDetailsUpdates(f))}};e.updateUserDetails=
function(b,e){vara=e?{userid:e.uid,fullname:e.fullname,imageurl:"/user/"+e.avatarId+"/avatar.png",color:e.color}:null,f,d;if(f=h[b])for(l[b]=a,d=0;d<f.length;d+=1)f[d].subscriber(f[d].memberId,a)};runtime.assert("ready"===e.networkStatus,"network not ready")};
function(b,g){vara,f=b.split("___")[0],d=h[f];runtime.assert(void0!==g,"missing subscriber parameter or null");runtime.assert(d,"tried to unsubscribe when no one is subscribed ('"+b+"')");if(d){for(a=0;a<d.length&&(d[a].subscriber!==g||d[a].memberId!==b);a+=1);runtime.assert(a<d.length,"tried to unsubscribe when not subscribed for memberId '"+b+"'");d.splice(a,1);0===d.length&&(runtime.log("no more subscribers for: "+b),deleteh[f],deletel[f],e.unsubscribeUserDetailsUpdates(f))}};this.shutdown=
function(){};e.updateUserDetails=function(b,e){vara=e?{userid:e.uid,fullname:e.fullname,imageurl:"/user/"+e.avatarId+"/avatar.png",color:e.color}:null,f,d;if(f=h[b])for(l[b]=a,d=0;d<f.length;d+=1)f[d].subscriber(f[d].memberId,a)};runtime.assert("ready"===e.networkStatus,"network not ready")};
ops.PullBoxMemberModel=function(k,l){functionh(){vara,d=Object.keys(g);runtime.log("member-list request for : "+d.join(","));l.call({command:"query_memberdata_list",args:{es_id:k,member_ids:d}},function(c){vard=runtime.fromJson(c),e;runtime.log("member-list reply: "+c);if(d.hasOwnProperty("memberdata_list"))for(c=d.memberdata_list,a=0;a<c.length;a+=1){if(d={memberid:c[a].member_id,fullname:c[a].display_name,imageurl:c[a].avatar_url,color:c[a].color},e=b.hasOwnProperty(d.memberid)?b[d.memberid]:
null,!e||e.fullname!==d.fullname||e.imageurl!==d.imageurl||e.color!==d.color){varh=e=void0;if(e=g[d.memberid])for(b[d.memberid]=d,h=0;h<e.length;h+=1)e[h](d.memberid,d)}}elseruntime.log("Meh, memberdata list broken: "+c)})}functione(){a&&(h(),runtime.setTimeout(e,2E4))}varb={},g={},a=!1;this.getMemberDetailsAndUpdates=function(f,d){varc=b[f],k=g[f]||[],l;g[f]=k;runtime.assert(void0!==d,"missing callback");for(l=0;l<k.length&&k[l]!==d;l+=1);l<k.length?runtime.log("double subscription request for "+
f+" in PullBoxMemberModel::getMemberDetailsAndUpdates"):(k.push(d),1===k.length&&h());c&&d(f,c);a||(a=!0,runtime.setTimeout(e,2E4))};this.unsubscribeMemberDetailsUpdates=function(f,d){varc,e=g[f];runtime.assert(void0!==d,"missing subscriber parameter or null");runtime.assert(e,"tried to unsubscribe when no one is subscribed ('"+f+"')");if(e){for(c=0;c<e.length&&e[c]!==d;c+=1);runtime.assert(c<e.length,"tried to unsubscribe when not subscribed for memberId '"+f+"'");e.splice(c,1);if(0===e.length){runtime.log("no more subscribers for: "+
f);deleteg[f];deleteb[f];a:{varh;if(a){for(hing)if(g.hasOwnProperty(h))breaka;a=!1}}}}};runtime.assert("ready"===l.networkStatus(),"network not ready")};
f);deleteg[f];deleteb[f];a:{varh;if(a){for(hing)if(g.hasOwnProperty(h))breaka;a=!1}}}}};this.shutdown=function(){};runtime.assert("ready"===l.networkStatus(),"network not ready")};
// Input 72
/*
@ -1997,7 +1997,7 @@ f);delete g[f];delete b[f];a:{var h;if(a){for(h in g)if(g.hasOwnProperty(h))brea
ops.NowjsOperationRouter=function(k,l,h){functione(a){vare;e=b.create(a);runtime.log(" op in: "+runtime.toJson(a));if(null!==e)if(a=Number(a.server_seq),runtime.assert(!isNaN(a),"server seq is not a number"),a===f+1)for(g(e),f=a,c=0,e=f+1;d.hasOwnProperty(e);e+=1)g(d[e]),deleted[e],runtime.log("op with server seq "+a+" taken from hold (reordered)");elseruntime.assert(a!==f+1,"received incorrect order from server"),runtime.assert(!d.hasOwnProperty(a),"reorder_queue has incoming op"),runtime.log("op with server seq "+
a+" put on hold"),d[a]=e;elseruntime.log("ignoring invalid incoming opspec: "+a)}varb,g,a=h.getNowObject(),f=-1,d={},c=0,t=1E3;this.setOperationFactory=function(a){b=a};this.setPlaybackFunction=function(a){g=a};a.ping=function(a){null!==l&&a(l)};a.receiveOp=function(a,b){a===k&&e(b)};this.push=function(b){b=b.spec();runtime.assert(null!==l,"Router sequence N/A without memberid");t+=1;b.client_nonce="C:"+l+":"+t;b.parent_op=f+"+"+c;c+=1;runtime.log("op out: "+runtime.toJson(b));a.deliverOp(k,b)};
b.active);m=null;b.active&&a()},8E3)}functiond(){vara;p||r||(p=!0,a=u,u=[],h.call({command:"sync_ops",args:{es_id:k,member_id:l,seq_head:String(w),client_ops:a}},function(f){varh=!1,k=runtime.fromJson(f);runtime.log("sync-ops reply: "+f);"new_ops"===k.result?0<k.ops.length&&(0===u.length?(f=e(k.ops),y=y.concat(f)):(runtime.log("meh, have new ops locally meanwhile, have to do transformations."),r=!g(e(k.ops))),w=k.head_seq):"added"===k.result?(runtime.log("All added to server"),w=k.head_seq):"conflict"===
k.result?(u=a.concat(u),runtime.log("meh, server has new ops meanwhile, have to do transformations."),r=!g(e(k.ops)),w=k.head_seq,r||(h=!0)):runtime.assert(!1,"Unexpected result on sync-ops call: "+k.result);p=!1;r?runtime.assert(!1,"Sorry to tell:\nwe hit a pair of operations in a state which yet need to be supported for transformation against each other.\nClient disconnected from session, no further editing accepted.\n\nPlease reconnect manually for now."):(h?d():(runtime.log("Preparing next: "+