constdummyData= {'a': { id:'a', name:'user1', point:100, },'b': { id:'b', name:'user2', point:200, },'c': { id:'c', name:'user3', point:400, },'d': { id:'d', name:'user4', point:1000, },'e': { id:'e', name:'user5', point:2000, },'f': { id:'f', name:'user6', point:4000, },};functionopenWidget(p){//Check if player is mobile or notif (p.isMobile)//Set the widget's name, anchor position, width, and height.p.tag.widget =p.showWidget('widget.html','sidebar',350,480);elsep.tag.widget =p.showWidget('widget.html','middle',400,448);//Send data to widgetp.tag.widget.sendMessage({ data: dummyData, id:p.id, isMobile:p.isMobile, });//Register events for messages sent from widgetsp.tag.widget.onMessage.Add(function (sender, msg) {if (msg.type =="close") {if (sender.tag.widget) {sender.tag.widget.destroy();sender.tag.widget =null; } } });}//Event when a player joins the appApp.onJoinPlayer.Add(function(p) {//Reset the player's tag valuep.tag = {};});// Action when the player clicks the sidebar appApp.onSidebarTouched.Add(function(p) {openWidget(p);});