UNPKG

swivelmeta-dcl-sdk

Version:
2 lines (1 loc) 20.8 kB
define("swivelmeta-dcl-sdk",["exports","@dcl/ui-scene-utils","@dcl/ecs-scene-utils","@decentraland/Identity","@decentraland/EnvironmentAPI","@decentraland/ParcelIdentity"],(function(t,e,n,i,o,r){"use strict";function a(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var c=a(e),s=a(n),u=function(t){void 0===t&&(t=!0),this.bEnable=t};function l(t,e){return[0,0,e,0,e,t,0,t,e,0,0,0,0,t,e,t]}var d=function(t,e){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},d(t,e)};function h(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}d(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function f(t,e,n,i){return new(n||(n=Promise))((function(o,r){function a(t){try{s(i.next(t))}catch(t){r(t)}}function c(t){try{s(i.throw(t))}catch(t){r(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}s((i=i.apply(t,e||[])).next())}))}function p(t,e){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function c(r){return function(c){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=e.call(t,a)}catch(t){r=[6,t],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,c])}}}function v(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,o,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(t){o={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function g(t,e,n){if(n||2===arguments.length)for(var i,o=0,r=e.length;o<r;o++)!i&&o in e||(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))}var y=function(t){function e(e,n,i,o){var r=t.call(this)||this;return r.material=new Material,engine.addEntity(r),r.name=o,r.shape=n,r.shape.withCollisions=!0,r.shape.isPointerBlocker=!0,r.addComponent(n),r.addComponent(i),r.shape instanceof PlaneShape&&(r.shape.uvs=l(1,1)),e instanceof VideoClip?(r.video=e,r.texture=new VideoTexture(r.video),r.texture.loop=!0,r.texture.volume=.5,r.texture.play(),r.mediaType="video",r.addPausePlayVideo(r.mediaType),r.shape instanceof PlaneShape&&(r.shape.uvs=l(-1,1))):e instanceof Texture&&(r.mediaType="image",r.texture=e),r.material.albedoTexture=r.texture,r.material.roughness=1,r.material.specularIntensity=0,r.material.metallic=0,r.material.transparencyMode=1,r.material.emissiveTexture=r.texture,r.material.emissiveColor=Color3.White(),r.material.emissiveIntensity=.5,r.addComponent(r.material),r}return h(e,t),e.prototype.initialize=function(){},e.prototype.updateMedia=function(t){t instanceof VideoClip?(this.texture instanceof VideoTexture&&(this.texture.playing=!1,this.texture=void 0),this.video=t,this.texture=new VideoTexture(this.video),this.texture.loop=!0,this.texture.volume=.5,this.texture.play(),this.mediaType="video",this.addPausePlayVideo(this.mediaType),this.material.albedoTexture=this.texture,this.material.emissiveTexture=this.texture,this.shape instanceof PlaneShape&&(this.shape.uvs=l(-1,1))):t instanceof Texture&&(this.texture instanceof VideoTexture&&(this.texture.playing=!1,this.texture=void 0,this.removeComponent(OnPointerDown)),this.shape instanceof PlaneShape&&(this.shape.uvs=l(1,1)),this.mediaType="image",this.texture=t,this.material.albedoTexture=this.texture,this.material.emissiveTexture=this.texture)},e.prototype.addPausePlayVideo=function(t){var e=this;"video"===t&&this.addComponentOrReplace(new OnPointerDown((function(){e.texture instanceof VideoTexture&&(e.texture.playing=!e.texture.playing)}),{button:ActionButton.PRIMARY,hoverText:"Play/Pause Video",distance:7}))},e.prototype.addUIPanel=function(t,e,n){var i=new b(t,e,n);this.addComponentOrReplace(i),this.addComponentOrReplace(new OnPointerDown((function(){i.openUI()}),{button:ActionButton.PRIMARY,hoverText:"Open Info Panel",distance:7}))},e}(Entity),b=function(t){function e(e,n,i){var o=t.call(this)||this;return o.uiPanel=new c.CustomPrompt,o.info=e,o.image=n,o.imageSize=i,o}return h(e,t),e.prototype.openUI=function(){var t=this;this.uiPanel.show();var e=this.uiPanel.addText(this.info.title,-240,190,Color4.Black(),20);e.text.hTextAlign="left",e.text.font=c.SFFont,e.text.outlineColor=Color4.Black(),e.text.outlineWidth=.2,this.uiPanel.addText("OWNER",30,140,Color4.Gray(),13).text.hTextAlign="left";var i=this.uiPanel.addText("".concat(this.info.owner),30,120,Color4.Black(),13);i.text.hTextAlign="left",i.text.font=c.SFFont,i.text.outlineColor=Color4.Black(),i.text.outlineWidth=.05;var o=this.imageSize.Width,r=this.imageSize.Height,a=n.clamp(o,0,250),s=n.clamp(r,0,250);o>r?s*=r/o:a*=o/r,this.uiPanel.addIcon(this.image.src,35,0,a,s,{sourceWidth:o,sourceHeight:r}).image.hAlign="left",this.uiPanel.addText("DESCRIPTION",30,80,Color4.Gray(),13).text.hTextAlign="left";var u=this.uiPanel.addText(this.info.description,30,60,Color4.Black(),13);u.text.hTextAlign="left",u.text.vTextAlign="top",u.text.paddingLeft=200,u.text.width=500,u.text.textWrapping=!0,u.text.paddingTop=35,u.text.font=c.SFFont,u.text.outlineColor=Color4.Black(),u.text.outlineWidth=.05,this.info.description.slice(0,20);var l=this.info.link,d=this.info.linkText,h=this.uiPanel.addButton("".concat(d),200,-170,(function(){t.uiPanel.hide(),openExternalURL("https://".concat(l))}),c.ButtonStyles.RED);h.label.fontSize=13,h.label.font=c.SFHeavyFont;var f=this.uiPanel.addButton("CANCEL",0,-170,(function(){t.uiPanel.hide()}),c.ButtonStyles.ROUNDBLACK);f.label.fontSize=13,f.label.font=c.SFHeavyFont},e}(ObservableComponent),m="https://discord.com/api/webhooks/969637646303379456/AJFBuiVxj-l4ZesqY3vYIaUizncO2Vlf6hdyJMHf06YE_sRNfs1KnY7pfRSOJHzy2NQ8",x=function(t){function e(e,n,i,o){void 0===n&&(n=!1),void 0===i&&(i=!1),void 0===o&&(o=!1);var r=t.call(this)||this;return r.discordHookURL=m,r.componentObjectPairs=[],r.once=!0,r.projectId=e,r.debug=n,r.bInitializeDiscord=i,r.bLoadOnEnter=o,r.startTime=new Date,r.apiURL="https://prod-swivelmeta.com/core2/query",r.InitializeSwivelMetaServices(e),r.InitializeVisitorData(),r}return h(e,t),e.prototype.InitializeSwivelMetaServices=function(t){return f(this,void 0,void 0,(function(){var e,n;return p(this,(function(o){switch(o.label){case 0:return e=this,[4,i.getUserData()];case 1:if(e.userData=o.sent(),!this.bInitializeDiscord)return log("InitializeSwivelMetaServices :: \nbInitDiscord is false, skipping discord initialization!"),[2];o.label=2;case 2:return o.trys.push([2,4,,5]),[4,this.getDiscordCallbackUrl(t)];case 3:return o.sent()&&(this.debugLog("Discord Hook URL ::",this.discordHookURL),this.addUserActivitiesListener()),[3,5];case 4:throw n=o.sent(),this.debugLog("InitializeSwivelMetaServices :: Failed to reach URL ::\n",n),new Error("InitializeSwivelMetaServices :: Failed to get discord hook URL ::\n \n".concat(n));case 5:return[2]}}))}))},e.prototype.InitializeVisitorData=function(){return f(this,void 0,void 0,(function(){var t,e,n,i;return p(this,(function(o){switch(o.label){case 0:return(t=this.userData)&&t.userId?[4,this.getVisitorDataBody()]:[3,3];case 1:return e=o.sent(),n=this.assembleVisitorData(e),[4,this.submitFetch(n)];case 2:i=o.sent(),this.debugLog("onEnterSceneObservable :: assembleVisitorData ::",n),i||this.debugLog("🚀 -- InitializeVisitorData -- Ln 145 -- response",i),o.label=3;case 3:return[2]}}))}))},e.prototype.getDiscordCallbackUrl=function(t){var e=this;return new Promise((function(n){return f(e,void 0,void 0,(function(){var e,i=this;return p(this,(function(o){switch(o.label){case 0:return e='{\n getProjectByUrlName(urlName: "'.concat(t,'") {\n discord_callback_url\n }\n }'),this.debugLog("getDiscordCallbackUrl :: queryBody :: ",e),[4,this.fetchQuery(e).then((function(t){return t.json()})).then((function(t){var e=t.data.getProjectByUrlName.discord_callback_url;if(""===e)return i.discordHookURL=m,n(i.discordHookURL);i.discordHookURL=e,i.debugLog("getDiscordCallbackUrl :: discordHookUrl ::",i.discordHookURL),n(i.discordHookURL)})).catch((function(t){throw i.debugLog("getDiscordCallbackUrl :: Error ::",t),i.discordHookURL=m,new Error("Couldn't initialize discord callback! Setting discordHookURL to a fallback value.")}))];case 1:return o.sent(),[2]}}))}))}))},e.prototype.fetchQuery=function(t){return f(this,void 0,void 0,(function(){return p(this,(function(e){return[2,fetch(this.apiURL,{method:"POST",headers:{Accept:"application/json, text/plain, image/*, */*",Origin:"https://play.decentraland.org"},body:t.toString()})]}))}))},e.prototype.submitFetch=function(t){return f(this,void 0,void 0,(function(){var e,n=this;return p(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,fetch(this.apiURL,{method:"POST",headers:{Accept:"application/json, text/plain, image/*, */*"},body:t.toString()}).then((function(t){return t.json()})).then((function(t){return n.debugLog(t),!0})).catch((function(t){return n.debugLog(t),!1}))];case 1:return[2,i.sent()];case 2:e=i.sent(),this.debugLog("submitSignedFetch :: Error :: ".concat(e));try{throw new Error("submitSignedFetch :: Error :: ".concat(e))}catch(t){log(t)}return[2,!1];case 3:return[2]}}))}))},e.prototype.sendDiscordNotification=function(t){var e=this;return new Promise((function(n){return f(e,void 0,void 0,(function(){var e,i,o;return p(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),e={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)},[4,fetch(this.discordHookURL,e)];case 1:return i=r.sent(),this.debugLog("sendDiscordNotification :: response ::",i),n("sent"),[3,3];case 2:o=r.sent(),this.debugLog("sendDiscordNotification :: Failed to reach URL ::",o);try{throw new Error("sendDiscordNotification :: Failed to reach URL :: ".concat(o))}catch(t){log(t)}return[3,3];case 3:return[2]}}))}))}))},e.prototype.transferringTipNotificationDiscord=function(t,e){var n={content:"".concat(this.getCurrentUtcEpochTime(),"Tip of ").concat(t," MANA transferring to ").concat(e)};this.sendDiscordNotification(n)},e.prototype.transferTipCompletionNotificationDiscord=function(t){var e={content:"".concat(this.getCurrentUtcEpochTime(),"Tip successfully transferred to ").concat(t)};this.sendDiscordNotification(e)},e.prototype.generalNotificationDiscord=function(t){var e={content:t=this.getCurrentUtcEpochTime().concat(t)};this.sendDiscordNotification(e)},e.prototype.getCurrentUtcEpochTime=function(){var t=Math.round(Date.now()/1e3);return"<t:".concat(t,":D><t:").concat(t,":T> \n")},e.prototype.sendUserDetailsNotification=function(t,e){return f(this,void 0,void 0,(function(){var n,i;return p(this,(function(o){return(n=this.userData)&&n.userId===e&&(i="DisplayName: ".concat(n.displayName,"\n"),n.publicKey&&(i=i.concat("Address: (".concat(n.publicKey,") \n"))),(i=i.concat("Message: \n".concat(t)))&&this.generalNotificationDiscord(i)),[2]}))}))},e.prototype.addUserActivitiesListener=function(){var t=this;this.debug&&log("ActivitiesListener initialized"),onEnterSceneObservable.add((function(e){return f(t,void 0,void 0,(function(){var t,n,i,o,r;return p(this,(function(a){switch(a.label){case 0:return(t=this.userData)&&t.userId===e.userId?[4,this.getVisitorDataBody()]:[3,2];case 1:n=a.sent(),i=n.room_id.split(" | "),o=i[0],r=i[1].split(","),this.sendUserDetailsNotification("\n Entered into scene | ".concat(n.room_id," | \n \n https://play.decentraland.org/?position=").concat(r[0],"%2C").concat(r[0],"&realm=").concat(o,"\n "),e.userId),this.debugLog("Entered into scene",e.userId),a.label=2;case 2:return[2]}}))}))})),onLeaveSceneObservable.add((function(e){return f(t,void 0,void 0,(function(){return p(this,(function(t){return this.sendUserDetailsNotification("Left scene",e.userId),this.debugLog("Left scene",e.userId),[2]}))}))})),onPlayerConnectedObservable.add((function(e){t.debugLog("new avatar connected :: ",e.userId)})),onPlayerDisconnectedObservable.add((function(e){t.sendUserDetailsNotification("Disconnected",e.userId)}))},e.prototype.getVisitorDataBody=function(){return f(this,void 0,void 0,(function(){var t,e,n,i,a,c;return p(this,(function(s){switch(s.label){case 0:return t=this.userData,[4,o.getCurrentRealm()];case 1:return e=s.sent(),[4,r.getParcel()];case 2:return n=s.sent(),i=n.land.sceneJsonData.scene.base,[4,o.getPlatform()];case 3:return a=s.sent(),c={display_name:t.displayName,wallet_address:null!==t.publicKey?t.publicKey:"",room_id:"".concat(null==e?void 0:e.displayName," | ").concat(i),scene_id:this.projectId,device:{type:a,device_address:"",device_detail:""}},this.debugLog("visitorData :: ",c),[2,c]}}))}))},e.prototype.assembleVisitorData=function(t){var e,n,i;return'mutation {\n createVisitor(visitor:{\n \n display_name: "'.concat(t.display_name,'",\n email: "",\n wallet_address: "').concat(t.wallet_address,'",\n room_id: "').concat(t.room_id,'",\n scene_id: "').concat(t.scene_id,'",\n space_time: null,\n device: {\n type: "').concat(null===(e=t.device)||void 0===e?void 0:e.type,'",\n device_address: "').concat(null===(n=t.device)||void 0===n?void 0:n.device_address,'",\n device_detail: "').concat(null===(i=t.device)||void 0===i?void 0:i.device_detail,'",\n }\n\n })\n {\n visitor_id\n }\n }')},e.prototype.getConfigData=function(t){return f(this,void 0,void 0,(function(){var e,n=this;return p(this,(function(i){return e='{\n getProjectByUrlName(urlName: "'.concat(t,'") {\n config\n active_config\n asset_config{\n definition_config\n base_asset_pack_config\n asset_pack_config\n }\n }\n }'),[2,this.fetchQuery(e).then((function(t){return t.json()})).then((function(t){return n.debugLog("getConfigData :: res ::",t),t.data?t.data:t})).catch((function(t){log(t);try{throw new Error("getConfigData :: Error :: ".concat(t))}catch(t){log(t)}}))]}))}))},e.prototype.parseConfigData=function(){return f(this,void 0,void 0,(function(){var t=this;return p(this,(function(e){return[2,new Promise((function(e,n){return f(t,void 0,void 0,(function(){var t,i,o;return p(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getConfigData(this.projectId).then((function(t){return JSON.parse(t.getProjectByUrlName.active_config)})).then((function(t){if(t)return t}))];case 1:if(t=r.sent(),this.debugLog("Swivel Meta Config Data: ",t),void 0===(i=t.components))throw n("Swivel Meta Config Data is undefined"),new Error("Swivel Meta Config Data is undefined");return this.debugLog("Swivel Meta Components Data :: ",i),e(i),[3,3];case 2:return o=r.sent(),n(o),[3,3];case 3:return[2]}}))}))}))]}))}))},e.prototype.updateMediaOnSceneLoad=function(t,e){return f(this,void 0,void 0,(function(){var e,n,i,o,r,a,c,s,l;return p(this,(function(d){switch(d.label){case 0:return this.componentObjectPairs=t,this.debug,[4,this.parseConfigData()];case 1:e=d.sent(),this.debugLog("updateMediaOnSceneLoad :: Components :: ",e),n=function(t){var n=e[t.component],r=n.parameters[0].value,a=t.object;if(i.debugLog("updateMediaOnSceneLoad :: currentMedia :: ",r),i.debugLog("updateMediaOnSceneLoad :: currentEntity.name :: ",a.name),i.debugLog("updateMediaOnSceneLoad :: element.component :: ",n),""===r)return"continue";if(a instanceof Entity)if("dynamic-media"===n.component_type){if(a instanceof y){var c=!!(r.endsWith(".mp4")||r.endsWith(".webm")||r.endsWith(".ogg")||r.endsWith(".m3u8"));void 0!==a.video?a.video:a.video=new VideoClip("");var s=a.texture instanceof Texture?a.texture.src.split("/"):[""],l=r.split("/");if(!i.bLoadOnEnter&&a.video.url===r||!i.bLoadOnEnter&&a.texture instanceof Texture&&s[s.length-1]===l[l.length-1])return"continue";c&&i.debugLog("------------ BEFORE UPDATE ------------\n",a.name,"\n currentMedia: ",r,"\n currentEntity.video.url: ",a.video.url),a.texture instanceof Texture&&i.debugLog("------------ BEFORE UPDATE ------------\n",a.name,"\n currentMedia: ",l[l.length-1],"\n currentEntity.texture.src: ",s[s.length-1]),c?a.updateMedia(new VideoClip(r)):a.updateMedia(new Texture(r)),c&&i.debugLog("------------ AFTER UPDATE ------------\n",a.name,"\n currentMedia: ",r,"\n currentEntity.video.url: ",a.video.url),a.texture instanceof Texture&&i.debugLog("------------ AFTER UPDATE ------------\n",a.name,"\n currentMedia: ",l[l.length-1],"\n currentEntity.texture.src: ",s[s.length-1])}}else"dynamic-link"===n.component_type&&null!==a.getComponentOrNull(OnPointerDown)&&(-1!==r.search("decentraland")?(o=r.split("/?")[1].split("&")[0].split("=")[1].split("%2C"))&&(a.getComponent(OnPointerDown).callback=function(){teleportTo("".concat(o[0],",").concat(o[1]))},a.getComponent(OnPointerDown).hoverText="TeleportTo: ".concat(o[0],", ").concat(o[1])):r.startsWith("https://")||r.startsWith("http://")?(a.getComponent(OnPointerDown).callback=function(){openExternalURL(r)},a.getComponent(OnPointerDown).hoverText=r.split("/")[r.split("/").length-1]):isNaN(r.split(",")[0])&&(o=r.split(","),a.getComponent(OnPointerDown).callback=function(){teleportTo("".concat(o[0],",").concat(o[1]))},a.getComponent(OnPointerDown).hoverText="TeleportTo: ".concat(o[0],", ").concat(o[1])));else if("string"===(typeof r).toString()){var d="true"===r.toLowerCase()||"t"===r.toLowerCase()||"1"==r.toLowerCase()||"false"!==r.toLowerCase()&&"f"!==r.toLowerCase()&&"0"!=r.toLowerCase();(n.name.startsWith("Enable")||d)&&a instanceof u&&(a.bEnable=d,i.debugLog("currentEntity: ",a))}else i.debugLog("updateMediaOnSceneLoad :: default :: ",r,n.name)},i=this;try{for(r=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),a=r.next();!a.done;a=r.next())c=a.value,n(c)}catch(t){s={error:t}}finally{try{a&&!a.done&&(l=r.return)&&l.call(r)}finally{if(s)throw s.error}}return[2]}}))}))},e.prototype.updateMediaOnSceneEnter=function(t){return f(this,void 0,void 0,(function(){var e,n=this;return p(this,(function(i){return e=0,onEnterSceneObservable.add((function(){return f(n,void 0,void 0,(function(){return p(this,(function(n){switch(n.label){case 0:return e>0?(this.debugLog("updateMediaOnSceneEnter :: bSceneUpdateOnParcelEnter :: UPDATE ENTITIES ON SCENE ENTER"),[4,this.updateMediaOnSceneLoad(t,this.debug)]):[3,2];case 1:n.sent(),n.label=2;case 2:return this.debugLog("updateMediaOnSceneEnter :: bSceneUpdateOnParcelEnterCount :: ",e),e++,[2]}}))}))})),[2]}))}))},e.prototype.debugLog=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];this.debug&&log.apply(void 0,g([t],v(e),!1))},e}(Entity);t.DynamicMedia=y,t.EnableDisable=u,t.SwivelMetaServices=x,t.debugMessage=function(t){new c.OkPrompt(t,(function(){log("continue")}),"Continue",!0).show()},t.setBoxUVs=function(t,e){return[0,0,e,0,e,t,0,t,e,0,0,0,0,t,e,t,0,0,e,0,e,t,0,t,e,0,0,0,0,t,e,t,e,0,0,0,0,t,e,t,0,0,e,0,e,t,0,t]},t.setCustomUVs=function(t,e,n,i){return void 0===n&&(n=0),void 0===i&&(i=0),[0+n,0+i,e+n,0+i,e+n,t+i,0+n,t+i,e+n,0+i,0+n,0+i,0+n,t+i,e+n,t+i]},t.setTimeout=function(t,e){var n=new Entity;n.addComponent(new s.Delay(t,(function(){e(),engine.removeEntity(n)})))},t.setUVsBasic=l,Object.defineProperty(t,"__esModule",{value:!0})}));