-
Notifications
You must be signed in to change notification settings - Fork 2
/
bundle.js
47 lines (44 loc) · 38.2 KB
/
bundle.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
"use strict";(()=>{var Rt=Object.defineProperty;var At=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ht=(e,t)=>{for(var r in t)Rt(e,r,{get:t[r],enumerable:!0})};var kt={};Ht(kt,{css:()=>xt});var xt,Tt=At(()=>{"use strict";xt=`.spinner{width:70px;text-align:center;position:absolute}.spinner .bounce1{-webkit-animation-delay:-.32s;animation-delay:-.32s}.spinner .bounce2{-webkit-animation-delay:-.16s;animation-delay:-.16s}.spinner>div{width:15px;height:15px;background-color:#fff;border-radius:100%;display:inline-block;-webkit-animation:sk-bouncedelay 1.4s infinite ease-in-out both;animation:sk-bouncedelay 1.4s infinite ease-in-out both}@-webkit-keyframes sk-bouncedelay{0%,80%,to{-webkit-transform:scale(0)}40%{-webkit-transform:scale(1)}}@keyframes sk-bouncedelay{0%,80%,to{-webkit-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);transform:scale(1)}}#chat-container{visibility:hidden;position:fixed;z-index:1;bottom:50px;width:280px;margin:0 20px 10px}#chat-list{max-height:500px;overflow-y:auto;overflow-x:hidden;position:relative;direction:rtl;text-align:left;background-color:#0006;border-radius:5px 5px 0 0}.chat-item{display:block;background:none;padding:5px 10px;direction:ltr;font-size:13px;line-height:1.5rem;word-break:break-word;box-shadow:none}.chat-link{text-decoration:underline;color:#1cb8ff}.chat-link:visited{color:#364963}#chat-input{background-color:#0006;color:#fff;border-radius:0 0 5px 5px;margin-top:2px;margin-bottom:8px;font-size:13px}#chat-input::placeholder{color:#dadada}button{background-color:#444;color:#1a1a1a;display:inline-block;padding:5px 10px;margin-top:10px;font-size:16px;border-radius:4px;border:none;box-shadow:2px 3px 8px #00000059;width:90px;text-align:center;cursor:pointer}button:hover{background-color:#6a6a6a}button.primary{background-color:#5490df}button.primary:hover{background-color:#94baeb}button.secondary{background-color:#8483f6}button.secondary:hover{background-color:#cbcafb}button.cancel{background-color:#f14d59}button.cancel:hover{background-color:#f7949b}.popupTitle{text-align:center;margin-bottom:10px;color:#fff}.joinPop{pointer-events:auto;border-radius:10px;background-color:#222227;padding:15px;text-align:left;position:absolute;top:40%;left:50%;transform:translate(-50%,-60%);color:#fff;width:372px}.joinInput{margin-top:5px;width:100%;font-size:20px;border-radius:4px;box-sizing:border-box;padding:5px}#joinPassword{width:100%;font-size:20px;border-radius:4px;box-sizing:border-box;padding:5px}.joinBtn{width:100%}#hotbar{grid-template-columns:45% 10% 45%}#playbar{grid-template-columns:repeat(auto-fit,minmax(10px,1fr))}#multiplayerIcon{font-size:25px}.warning{color:#f14d59!important}.button-row{display:flex;justify-content:center;gap:20px}.button-row>button{width:100%}.slider:before{transition:.2s}.vector3 input[type=text]{padding:4px;border-radius:4px;font-size:10px;background-color:#bbb}#epVersion{background:linear-gradient(45deg,#0d9fc7,#c500ff);background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;display:inline-block}#epVersion:hover{cursor:pointer}.menuShortTabNew{width:20%}
`;document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(xt))});var ho=typeof process<"u"&&process.release.name==="node";var O={EU:{ws:"wss://editor-plus.fly.dev",ping:"https://dynamodb.eu-west-1.amazonaws.com"}},Kt=20,q=1e3/Kt,yo=60*10,qt=32,Lt=new RegExp(String.raw`^\w+:[a-f\d]{${qt}}\$?$`),xe=new RegExp(String.raw`(?:https://krunker\.io/editor\.html\?room=)?(${Lt.source.slice(1,-1)})`);var J={[0]:5,[1]:10,[2]:20},ke=32,Te=16,we=200;var Ie=100;var Ce="#f1f1f1";var d={name:localStorage.getItem("krunker_username")||"",renderCoopOutlines:!0,playerOpacity:1,streamerMode:!1,autoChatScroll:!0,region:null};function je(){let e=GM_getValue("settings");e?Object.assign(d,JSON.parse(e)):KE.setSettings("degToRad",!0),Object.keys(O).includes(d.region)||T("region",Object.keys(O)[0])}function T(e,t){d[e]=t,GM_setValue("settings",JSON.stringify(d))}function x(e){return String(e).replace(/&/g,"&").replace(/'/g,"'").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function _(e){let t=document.createElement("span");return t.textContent=e,t.innerHTML}function De(e){e=_(e);let t=/(\bhttps?:\/\/[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|])/gi;e=e.replace(t,'<a class="chatLink" href="$1" target="_blank">$1</a>');let r=/\b(\w*)::(\d+)\b/gi;return e=e.replace(r,'<a class="chatLink" href="javascript:EP.selectObjectFromSID($2)">$1::$2</a>'),e.replace(/\n/g,"<br>")}function w(e){if(!e)return history.replaceState("","",location.pathname);d.streamerMode&&(e="*".repeat(e.length),GM_setValue("lastRoomId",e)),history.replaceState("","",`${location.pathname}?room=${e}`)}function I(e){if(e||=KE.objectSelected(!0),!e)return[];let t=KE.objGroups[e.uuid];return t?KE.objInsts.filter(r=>t.objects.includes(r.boundingMesh.uuid)):[]}function L(){let e=KE.objInsts;KE.objInsts=[];let{config:t}=KE.getMapExport(!0);return KE.objInsts=e,t||{}}var _e={clearMapOnDisconnect:!0,password:"",size:J[0]},W=class{constructor(t,r){this.id=t;this.settings=r}players=[];messages=[];lastSID=0;addChatMessage(t){this.messages.push(t),this.messages.length>Ie&&this.messages.shift()}get host(){return this.players[0]}findPlayer(t){return this.players.find(r=>r.id===t)}};var G,z,V,g;function zt(e){unsafeWindow.__webpack_require__=e,G=Y("parseGUIs"),z=Y("customGUIs"),V=Y("decodeStream"),g=Y("hitBoxMaterial"),G.removePrivateKeys=t=>t}Object.assign(unsafeWindow,{loadWebpackModules:zt});function Y(e){let t=Object.values(unsafeWindow.__webpack_require__.c).map(r=>r.exports).find(r=>(typeof r=="object"||typeof r=="function")&&r!==null&&e in r);return console.assert(t,`Module with exports ${e} not found`),t}var F=class{room;name;color;id;role;selectedSID;pos=[0,0,0];rot=[0,0,0];constructor(t){this.room=t.room,this.name=t.name,this.color=t.color??"#000000",this.id=t.id??-1,this.role=t.role??0,this.selectObject(t.selectedSID),this.move(t.pos,t.rot)}move(t=[0,0,0],r=[0,0,0]){this.pos=[...t],this.rot=[...r]}selectObject(t){this.selectedSID=t}get isHost(){return this.id===0}};var Ue,R=class{constructor(t,r,o){this.name=t;this.color=r;this.object=o}posTween;rotTween;static async create(t,r,o=[0,0,0],n=[0,0,0]){Ue||=new KE.THREE.OBJLoader;let i=await Ue.loadAsync("https://assets.krunker.io/models/spawn_0.obj"),a=new R(t,r,i);return a.createLabel(),a.updateMaterial(d.playerOpacity),a.move(o,n),KE.scene.add(i),a}updateMaterial(t){let r=this.object.children[0];for(let o of r.material)o.opacity=t,o.transparent=t<1,o.color.set(this.color),o.fog=!1;this.object.children[1].visible=t>0}delete(){KE.scene.remove(this.object)}move(t,r){let{Tween:o,Easing:n}=TWEEN;this.posTween?.stop(),this.rotTween?.stop();let i=this.object.position,a={x:i.x,y:i.y+10,z:i.z},s={x:0,y:this.object.rotation.y,z:0};this.posTween=new o(a).to(new KE.THREE.Vector3(...t),q*3).easing(n.Sinusoidal.Out).onUpdate(()=>this.object.position.set(a.x,a.y-10,a.z)).onComplete(()=>this.posTween=void 0).start(),this.rotTween=new o(s).to({x:0,y:r[1],z:0},q*3).easing(n.Sinusoidal.Out).onUpdate(()=>this.object.rotation.set(0,s.y,0)).onComplete(()=>this.rotTween=void 0).start()}createLabel(){let t=Vt(this.name,this.color,80);if(!t)return;let r=new KE.THREE.CanvasTexture(t);r.magFilter=KE.THREE.NearestFilter,r.wrapS=r.wrapS=KE.THREE.ClampToEdgeWrapping;let o=new KE.THREE.SpriteMaterial({map:r,depthTest:!1,fog:!1}),n=new KE.THREE.Sprite(o);n.position.copy(this.object.position),n.position.y+=12,this.object.add(n),n.onBeforeRender=()=>{let i=new KE.THREE.Vector3;KE.camera.getWorldPosition(i);let a=this.object.position.distanceTo(i)/20,s=Math.max(4,a);n.scale.x=t.width*.003*s,n.scale.y=t.height*.003*s}}};function Vt(e,t,r){let o=document.createElement("canvas").getContext("2d");if(!o)return;let n=`${r}px gamefont`,i=r+120;o.canvas.height=i,o.font=n;let s=o.measureText(e).width+50;return o.canvas.width=s,o.font=n,o.textBaseline="middle",o.textAlign="center",o.fillStyle="black",o.fillText(e,s/2+5,i/2+5),o.fillStyle=t,o.fillText(e,s/2,i/2),o.canvas}var X=class extends F{room;model;isYou=!1;outlineMesh;outlineMaterial;constructor(t){super(t),this.room=t.room,t.isYou&&(this.isYou=!0),this.outlineMaterial=new KE.THREE.MeshBasicMaterial({color:this.color,side:KE.THREE.BackSide,transparent:!0,opacity:.5})}move(t,r){super.move(t,r),this.model?.move(t,r)}async createModel(){return this.model=await R.create(this.name,this.color,this.pos,this.rot),this.model}selectObject(t){if(super.selectObject(t),this.isYou)return;t==null&&this.removeOutline();let r=t?this.room.getObject(t):void 0;r&&this.setOutline(r)}setOutline(t){this.outlineMesh&&this.removeOutline();let r=new KE.THREE.Mesh(t.defaultMesh.geometry,this.outlineMaterial);r.userData.owner=t,r.visible=!1,this.outlineMesh=r,t.outlines||=[],t.outlines.push(r),KE.scene.add(r)}removeOutline(){if(!this.outlineMesh)return;let t=this.outlineMesh.userData.owner;if(!t.outlines)return;let r=t.outlines.indexOf(this.outlineMesh);r!==-1&&t.outlines.splice(r,1),KE.scene.remove(this.outlineMesh),this.outlineMesh=void 0}};var c;function le(e){c=e}function Z(e,t){let r=new X({room:t,id:e[0],name:e[1],color:e[2],isYou:e[3],role:e[4],pos:e[5][0],rot:e[5][1]});return r.selectObject(e[6]),r.isYou?le(r):r.createModel(),t.players.push(r),r}var Ge={execute(e,t,r,o){e.room.findPlayer(t)?.move(r,o)}};var Re={execute(e,...t){t.forEach(r=>e.room.addChatMessage(r))}};var Bt=Object.getOwnPropertyNames,Nt=Object.getOwnPropertySymbols,$t=Object.prototype.hasOwnProperty;function Ae(e,t){return function(o,n,i){return e(o,n,i)&&t(o,n,i)}}function Q(e){return function(r,o,n){if(!r||!o||typeof r!="object"||typeof o!="object")return e(r,o,n);var i=n.cache,a=i.get(r),s=i.get(o);if(a&&s)return a===o&&s===r;i.set(r,o),i.set(o,r);var p=e(r,o,n);return i.delete(r),i.delete(o),p}}function He(e){return Bt(e).concat(Nt(e))}var Ne=Object.hasOwn||function(e,t){return $t.call(e,t)};function A(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var $e="_owner",Ke=Object.getOwnPropertyDescriptor,qe=Object.keys;function Jt(e,t,r){var o=e.length;if(t.length!==o)return!1;for(;o-- >0;)if(!r.equals(e[o],t[o],o,o,e,t,r))return!1;return!0}function Wt(e,t){return A(e.getTime(),t.getTime())}function Le(e,t,r){if(e.size!==t.size)return!1;for(var o={},n=e.entries(),i=0,a,s;(a=n.next())&&!a.done;){for(var p=t.entries(),f=!1,l=0;(s=p.next())&&!s.done;){var u=a.value,m=u[0],P=u[1],v=s.value,Oe=v[0],Gt=v[1];!f&&!o[l]&&(f=r.equals(m,Oe,i,l,e,t,r)&&r.equals(P,Gt,m,Oe,e,t,r))&&(o[l]=!0),l++}if(!f)return!1;i++}return!0}function Yt(e,t,r){var o=qe(e),n=o.length;if(qe(t).length!==n)return!1;for(var i;n-- >0;)if(i=o[n],i===$e&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!Ne(t,i)||!r.equals(e[i],t[i],i,i,e,t,r))return!1;return!0}function B(e,t,r){var o=He(e),n=o.length;if(He(t).length!==n)return!1;for(var i,a,s;n-- >0;)if(i=o[n],i===$e&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!Ne(t,i)||!r.equals(e[i],t[i],i,i,e,t,r)||(a=Ke(e,i),s=Ke(t,i),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function Ft(e,t){return A(e.valueOf(),t.valueOf())}function Xt(e,t){return e.source===t.source&&e.flags===t.flags}function ze(e,t,r){if(e.size!==t.size)return!1;for(var o={},n=e.values(),i,a;(i=n.next())&&!i.done;){for(var s=t.values(),p=!1,f=0;(a=s.next())&&!a.done;)!p&&!o[f]&&(p=r.equals(i.value,a.value,i.value,a.value,e,t,r))&&(o[f]=!0),f++;if(!p)return!1}return!0}function Zt(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}var Qt="[object Arguments]",er="[object Boolean]",tr="[object Date]",rr="[object Map]",or="[object Number]",nr="[object Object]",ir="[object RegExp]",ar="[object Set]",sr="[object String]",cr=Array.isArray,Ve=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,Be=Object.assign,lr=Object.prototype.toString.call.bind(Object.prototype.toString);function ur(e){var t=e.areArraysEqual,r=e.areDatesEqual,o=e.areMapsEqual,n=e.areObjectsEqual,i=e.arePrimitiveWrappersEqual,a=e.areRegExpsEqual,s=e.areSetsEqual,p=e.areTypedArraysEqual;return function(l,u,m){if(l===u)return!0;if(l==null||u==null||typeof l!="object"||typeof u!="object")return l!==l&&u!==u;var P=l.constructor;if(P!==u.constructor)return!1;if(P===Object)return n(l,u,m);if(cr(l))return t(l,u,m);if(Ve!=null&&Ve(l))return p(l,u,m);if(P===Date)return r(l,u,m);if(P===RegExp)return a(l,u,m);if(P===Map)return o(l,u,m);if(P===Set)return s(l,u,m);var v=lr(l);return v===tr?r(l,u,m):v===ir?a(l,u,m):v===rr?o(l,u,m):v===ar?s(l,u,m):v===nr?typeof l.then!="function"&&typeof u.then!="function"&&n(l,u,m):v===Qt?n(l,u,m):v===er||v===or||v===sr?i(l,u,m):!1}}function dr(e){var t=e.circular,r=e.createCustomConfig,o=e.strict,n={areArraysEqual:o?B:Jt,areDatesEqual:Wt,areMapsEqual:o?Ae(Le,B):Le,areObjectsEqual:o?B:Yt,arePrimitiveWrappersEqual:Ft,areRegExpsEqual:Xt,areSetsEqual:o?Ae(ze,B):ze,areTypedArraysEqual:o?B:Zt};if(r&&(n=Be({},n,r(n))),t){var i=Q(n.areArraysEqual),a=Q(n.areMapsEqual),s=Q(n.areObjectsEqual),p=Q(n.areSetsEqual);n=Be({},n,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:p})}return n}function pr(e){return function(t,r,o,n,i,a,s){return e(t,r,s)}}function mr(e){var t=e.circular,r=e.comparator,o=e.createState,n=e.equals,i=e.strict;if(o)return function(p,f){var l=o(),u=l.cache,m=u===void 0?t?new WeakMap:void 0:u,P=l.meta;return r(p,f,{cache:m,equals:n,meta:P,strict:i})};if(t)return function(p,f){return r(p,f,{cache:new WeakMap,equals:n,meta:void 0,strict:i})};var a={cache:void 0,equals:n,meta:void 0,strict:i};return function(p,f){return r(p,f,a)}}var U=C(),Vo=C({strict:!0}),Bo=C({circular:!0}),No=C({circular:!0,strict:!0}),ue=C({createInternalComparator:function(){return A}}),$o=C({strict:!0,createInternalComparator:function(){return A}}),Jo=C({circular:!0,createInternalComparator:function(){return A}}),Wo=C({circular:!0,createInternalComparator:function(){return A},strict:!0});function C(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,o=e.createInternalComparator,n=e.createState,i=e.strict,a=i===void 0?!1:i,s=dr(e),p=ur(s),f=o?o(p):pr(p);return mr({circular:r,comparator:p,createState:n,equals:f,strict:a})}function ee(e,t,r){let o=new Set([...Object.keys(e),...Object.keys(t)]),n={};for(let i of o){let a=e[i],s=t[i];U(a,s)||(n[i]=s,r&&U(s,r[i])&&(n[i]=void 0))}return n}function N(e,t,r){for(let[o,n]of Object.entries(t))n==null?r?e[o]=r[o]:delete e[o]:e[o]=n}var te={},re,j={},oe=[],K=[],H=[],me=[],$,de,fe=!1,pe=0;function ie(){j={},oe=[],K=[],H=[],me=[],te={},re=void 0,$=void 0,pe=0}function fr(){let e=KE.objectSelected()||void 0;if(e){let t=[e.userData.owner,...I(e)];We(t)}}function hr(){de=setInterval(()=>{Sr(),Or(),br()},250)}function yr(){de&&clearInterval(de)}function br(){let e=G.parseGUIs(z.customGUIs);$&&!U($,e)&&y(19,e),$=e}function gr(){let e=oe.map(t=>({...t.serialize(),sid:t.sid}));if(e.length){let r=KE.objectSelected()?.userData.owner.sid===e[e.length-1].sid;y(9,r,...e)}oe=[]}function Er(){if(!c)return;let e=KE.controls.getObject().position.toArray(),t=KE.controls.getRotation();t=[t[1],t[0],0];let r=!ue(e,c.pos),o=!ue(t,c.rot);(r||o)&&(y(17,r?e:null,o?t:null),c.move(e,t))}function vr(){if(!c)return;let e=KE.objectSelected()?.userData.owner.sid;c.selectedSID!=e&&(c.selectObject(e),(e==null||e>0)&&y(12,e))}function We(e){let t=[];for(let r of e){let o=j[r.uuid],n=r.serialize();if(!o){j[r.uuid]=n;continue}if(r.synced){let i=ee(o,n);Object.keys(i).length&&t.push({sid:r.sid,...i}),j[r.uuid]=n}}t.length&&y(11,...t)}function Sr(){let e=KE.objInsts.filter(t=>!t.partial).slice(0,200);We(e),e.forEach(t=>t.partial=!0),e.length||KE.objInsts.forEach(t=>t.partial=!1)}function Pr(){let e=[];for(let t=H.length-1;t>=0;t--){let{oldPlaceholder:r,placeholder:o}=H[t];if(!o.synced||r&&!r.synced)continue;if(!KE.objGroups[o.boundingMesh.uuid]){console.error("invalid created group",r,o),H.splice(t,1);continue}let n=I(o.boundingMesh);n.every(i=>i.synced)&&(e.push([r?.sid,o.sid,...n.map(i=>i.sid)]),H.splice(t,1))}e.length&&y(13,...e)}function Je(e,t){let r=[];for(let o=e.length-1;o>=0;o--){let n=e[o];n.synced&&(r.push(n.sid),e.splice(o,1))}r.length&&y(t,...r)}function Or(){let e={},t={};Object.keys(te).length&&(e=ee(te,KE.mapConfig,KE.defaultMapConfig));let r=L();re&&(t=ee(re,r)),(Object.keys(e).length||Object.keys(t).length)&&y(8,e,t),ye(),be(r)}function Ye(){fe=!0,ie(),hr()}function Fe(){fe=!1,ie(),yr()}function Xe(){!fe||Date.now()-pe<q||(Je(K,10),gr(),Je(me,14),Pr(),fr(),vr(),Er(),pe=Date.now())}function Ze(e){c&&(e.sid=c.room.nextSid(),oe.push(e))}function Qe(e){delete j[e.uuid],K.push(e)}function he(e,t){if(t){let r=K.indexOf(t);r!==-1&&K.splice(r,1)}H.push({oldPlaceholder:t,placeholder:e})}function et(e){me.push(e),delete j[e.uuid],I(e.boundingMesh).forEach(r=>delete j[r.uuid])}function tt(e){$=e}function rt(e,t){j[e]=t}function ye(){te={...KE.mapConfig}}function be(e){re=e??L()}function ot(e,t){let r=K.find(o=>o.sid===e);r&&(r.sid=t)}var nt={objectAdded:!0,objectRemoved:!0,allowHideTransform:!0,createGroup:!0,removeGroup:!0,clearMap:!0,importMap:!0},S={...nt},M=!1;function it(){xr(),kr(),_r(),Ur(),Gr(),jr(),Rr(),Mr(),Dr(),Cr(),wr(),Tr(),Ir()}function E(e,t){let r=S;S={...nt,...t},e(),S=r}function D(e){M=e}function xr(){function e(r,o){function n(i,a){if(typeof i=="string"){if(a==="attr")return x(i);if(a==="html")return _(i)}if(Array.isArray(i))return i.map(s=>n(s,a));if(typeof i=="object"&&i!==null&&typeof a!="string"&&a!==null)for(let s of Object.keys(a))i[s]=n(i[s],a[s]);return i}return new Proxy(r,{apply(i,a,s){return s=s.map((p,f)=>n(p,o[f])),Reflect.apply(i,a,s)}})}GUI._html.panelButtons=e(GUI._html.panelButtons,["html","html",null]),GUI._html.toolbar.root=e(GUI._html.toolbar.root,["html"]),GUI._html.toolbar.menu=e(GUI._html.toolbar.menu,["html"]),GUI._html.toolbar.option=e(GUI._html.toolbar.option,["attr","html"]),GUI._html.toolbar.textarea=e(GUI._html.toolbar.textarea,["html","attr"]),GUI._html.folder.standard=e(GUI._html.folder.standard,["attr",null,"attr"]),GUI._html.folder.small=e(GUI._html.folder.small,["attr",null,"attr"]),GUI._html.folder.smaller=e(GUI._html.folder.smaller,["attr",null,"attr"]),GUI._html.line.standard=e(GUI._html.line.standard,["html",null,null]),GUI._html.line.switch=e(GUI._html.line.switch,["html"]),GUI._html.line.nodiv=e(GUI._html.line.nodiv,["html",null,null]),GUI._html.line.wide=e(GUI._html.line.wide,["html",null]),GUI._html.input.resizable.button=e(GUI._html.input.resizable.button,["html","attr","html"]),GUI._html.input.resizable.dbutton=e(GUI._html.input.resizable.dbutton,["html","attr","html","html"]),GUI._html.input.resizable.key=e(GUI._html.input.resizable.key,["html","attr","html"]),GUI._html.input.resizable.text=e(GUI._html.input.resizable.text,["attr","attr","attr"]),GUI._html.input.resizable.number=e(GUI._html.input.resizable.number,["attr","attr","attr","attr","attr","attr"]),GUI._html.input.resizable.color=e(GUI._html.input.resizable.color,["attr","attr"]),GUI._html.input.resizable.switch=e(GUI._html.input.resizable.switch,[null,"attr"]),GUI._html.input.resizable.slider=e(GUI._html.input.resizable.slider,["attr","attr","attr","attr","attr"]),GUI._html.input.resizable.select=e(GUI._html.input.resizable.select,[null,"attr",{value:"attr",name:"html"}]),GUI._html.input.resizable.selectClick=e(GUI._html.input.resizable.selectClick,[null,"attr",{value:"attr",name:"html"},"attr","html"]),GUI._html.input.fixed.vector3=e(GUI._html.input.fixed.vector3,["html","attr","attr","attr","attr","attr"]);let{action:t}=GUI;GUI.action=function(r,o){return o instanceof HTMLInputElement&&o.type=="password"&&(o=new Proxy(o,{get(n,i){return i==="type"?"text":Reflect.get(n,i)}})),t.call(this,r,o)}}function kr(){g.hitBoxMaterial.color.set(4991687),g.prototype.partial=!1,Object.defineProperty(g.prototype,"synced",{get(){return this.sid>0}});let{serialize:e}=g.prototype;g.prototype.serialize=function(...r){let o=e.apply(this,r);return this.rot.some(n=>n)&&(o.r=this.rot.map(n=>n.round(4))),this.texOffX>0&&(o.tox=this.texOffX.round(4)),this.texOffY>0&&(o.toy=this.texOffY.round(4)),o};let{deserialize:t}=g;g.deserialize=r=>{let o=t(r);return o.sid=typeof r.sid=="number"?r.sid:0,o}}function Tr(){let e=KE.removeGroup.bind(KE);KE.removeGroup=t=>{M&&S.removeGroup&&(t||=KE.objectSelected(!0),t&&et(t.userData.owner)),E(()=>e(t),{objectRemoved:!1})}}function wr(){let e=KE.createGroup.bind(KE);KE.createGroup=(...t)=>{if(e(...t),M&&S.createGroup){let r=KE.objectSelected(!0)?.userData.owner,o=t[0]?.userData.owner;r&&he(r,o)}}}function Ir(){let e=KE.duplicateGroup.bind(KE);KE.duplicateGroup=t=>{if(E(()=>e(t),{createGroup:!1}),M&&S.createGroup){let r=KE.objectSelected(!0)?.userData.owner;r&&he(r)}}}function Cr(){let e=KE.updateGroups.bind(KE);KE.updateGroups=()=>{e(),Xe()}}function jr(){let e=KE.hideTransform.bind(KE);KE.hideTransform=()=>{if(!M||S.allowHideTransform)return e()}}function Dr(){KE.on("objectRemoved",e=>{e.outlines?.forEach(t=>KE.scene.remove(t)),M&&S.objectRemoved&&Qe(e),c?.room.deleteSID(e.sid)})}function Mr(){KE.on("objectAdded",e=>{M&&S.objectAdded&&KE.objInsts.includes(e)&&Ze(e),c?.room.setSID(e)})}function _r(){let e=KE.clearMap.bind(KE);KE.clearMap=()=>{S.clearMap&&e()}}function Ur(){let e=KE.importMap.bind(KE);KE.importMap=(...t)=>{let r=M;if(D(!1),e(...t),ie(),r&&S.importMap){KE.objInsts.forEach((n,i)=>n.sid=i+1);let o=ge();y(20,o)}D(r)}}function Gr(){let e=KE.testMap.bind(KE);KE.testMap=t=>{let r=KE.getMapExport.bind(KE);KE.getMapExport=()=>{let o=r();if(t)return c?x(o):o;let n=JSON.parse(o);return n.name=_(n.name),n.welMsg&&=_(n.welMsg),JSON.stringify(n)},e(t),KE.getMapExport=r}}function Rr(){let{update:e}=g.prototype;g.prototype.update=function(t){e.call(this,t),this.outlines?.forEach(r=>{if(r.visible=d.renderCoopOutlines,!d.renderCoopOutlines)return;let o=r.material;o.userData.t=(o.userData.t||0)+t/100,o.opacity=.7+.3*Math.sin(o.userData.t),r.geometry=this.defaultMesh.geometry,r.position.set(0,this.boundingMesh.scale.y/2,0),r.position.applyQuaternion(this.boundingMesh.quaternion),r.position.add(this.boundingMesh.position),r.quaternion.copy(this.boundingMesh.quaternion),r.rotation.copy(this.boundingMesh.rotation);let n=this.size.map(i=>1+1/i);r.scale.fromArray(n)})}}var at={execute(e,t,r){let o={objects:[]},n=Object.keys(t).length>0,i=Object.keys(r).length>0;if(n&&(N(KE.mapConfig,t,KE.defaultMapConfig),Object.assign(o,KE.mapConfig),ye()),i){o.config=L(),N(o.config,r),be(o.config);for(let a of Object.keys(KE.serverConfig))KE.serverConfig[a]={};GUI.panel.state.refresh("panel_left_essential")}E(()=>KE.importMap(JSON.stringify(o)),{clearMap:!1,importMap:!1})}};var st={execute(e,t){let{room:r}=e,o=r.findPlayer(t);o&&(r.removePlayer(o),windows[100].generatePlayers())}};var ct={execute(e,...t){t.forEach(r=>Ar(e,r))}};function Ar(e,t){let r=t.shift(),o=t.shift(),n=e.room.getObject(o);if(!n)return;let i=r?e.room.getObject(r):void 0,a=KE.objInsts.filter(s=>t.includes(s.sid));a.length!==t.length&&console.error("different group children length",t,a),i&&Kr(i),e.selectedSID!=null&&e.selectedSID===r&&KE.attachTransform(n),Hr(n,a),i&&e.room.players.filter(s=>i.sid===s.selectedSID).forEach(s=>s.selectObject(n.sid))}function Hr(e,t){KE.objGroups[e.boundingMesh.uuid]={owner:e.boundingMesh,pos:e.boundingMesh.position.clone(),scale:e.boundingMesh.scale.clone(),rotY:e.boundingMesh.rotation.y,objects:t.map(r=>r.boundingMesh.uuid)}}function Kr(e){E(()=>KE.removeObject(e,!0),{removeGroup:!1,objectRemoved:!1,allowHideTransform:!1})}var lt={execute(e,...t){let r=KE.objectSelected()?.userData.owner.sid;for(let o of t){let n=e.room.getObject(o);if(!n)continue;let i=I(n.boundingMesh),a=r===o||i.some(s=>s.sid===r);E(()=>KE.removeGroup(n.boundingMesh),{removeGroup:!1,objectRemoved:!1,allowHideTransform:a})}}};var ut={execute(e,t){z.customGUIs=G.parseGUIs(t,!0),tt(t),GUI.panel.state.refresh("panel_right_gui")}};var dt={execute(e,t){e.room.import(t)}};var pt={execute(e,...t){E(()=>t.forEach(qr),{objectAdded:!1})}};function qr(e){let t=g.deserialize(e);KE.addObject(t,!0,!1),t.uuid=t.boundingMesh.uuid=t.sid.toString()}var mt={execute(e,t,r){e.room.findPlayer(t)?.selectObject(r??void 0)}};var ft={execute(e,...t){let r=KE.objectSelected()?.userData.owner.sid;for(let o of t){let n=e.room.getObject(o);if(!n)continue;let i=r===o;E(()=>KE.removeObject(n,!i,!1),{objectRemoved:!1}),delete KE.objGroups[n.boundingMesh.uuid]}}};var ht={execute(e,...t){for(let r of t){let o=e.room.getObject(r.sid);o&&Vr(o,r)}}},Lr=["openEnded","team","texStretch","frameCount","bakeAcc","fullcone","faces","weaponId","poster","cmpSpwn","teamOnly","tilesX","tilesZ"],zr=["mSize","mYOff","mROff","itemID","assetID"];function Vr(e,t){delete t.sid,Nr(e,t),$r(e);let r=e.serialize();if(Object.keys(t).length){N(r,t);let n=g.deserialize({...r});for(let i of KE.configVal)try{e[i]=n[i]}catch{}Br(e,n)}KE.objectSelected()?.userData.owner.sid===e.sid&&KE.updateObjConfigGUI(),KE.settings.disableHistory||(KE.objHistory[e.uuid]=r),rt(e.uuid,r)}function Br(e,t){try{e.regen(!0)}catch{}try{Lr.some(r=>!U(e[r],t[r]))&&e.regen()}catch{}try{zr.some(r=>typeof t[r]=="number"&&e[r].round(4)!==t[r].round(4))&&e.regenM()}catch{}}function Nr(e,t){t.p&&(e.boundingMesh.position.fromArray(t.p),delete t.p),t.r&&(e.boundingMesh.rotation.fromArray(t.r),delete t.r),t.s&&(e.boundingMesh.scale.fromArray(t.s),delete t.s)}function $r(e){let t=e.boundingMesh,r=KE.objGroups[t.uuid];r&&(r.pos=t.position.clone(),r.scale=t.scale.clone(),r.rotY=t.rotation.clone().reorder("YXZ").y)}var yt={execute(e,...t){Z(t,e.room),windows[100].generatePlayers()}};var bt={execute(){D(!1),KE.clearMap()}};var ae=class extends W{sidHashmap={};constructor(t,r){super(t,r)}removePlayer(t){let r=this.players.indexOf(t);r!==-1&&this.players.splice(r,1),t.model?.delete(),t.removeOutline(),t.isYou?le(void 0):t.isHost&&alert("Host ended room")}clearPlayers(){for(let t=this.players.length-1;t>=0;t--)this.removePlayer(this.players[t])}import(t){this.sidHashmap={},t.map.objects.forEach(r=>r.meshUUID=r.sid?.toString()),E(()=>KE.importMap(JSON.stringify(t)),{importMap:!1})}addChatMessage(t){super.addChatMessage(t);let r=document.getElementById("chat-list"),o=r.scrollHeight-r.scrollTop-r.clientHeight,n=document.createElement("div");n.className="chat-item";for(let i of t){let a=document.createElement("span");a.innerHTML=De(i[0]),a.style.color=i[1]||Ce,n.appendChild(a)}r.appendChild(n),(o<100||d.autoChatScroll)&&n.scrollIntoView()}nextSid(){return--this.lastSID}getObject(t){return this.sidHashmap[t]}setSID(t,r){r!=null&&(t.sid=r),this.sidHashmap[t.sid]=t}deleteSID(t){delete this.sidHashmap[t]}};var gt={execute(e,t,r,o,n){let i=new ae(t,n);o&&i.import(o),KE.objInsts.forEach(a=>i.setSID(a)),r.forEach(a=>Z(a,i)),c&&(c.isHost?KE.copyToClipboard(`https://krunker.io/editor.html?room=${i.id}`):KE.controls.getObject().position.fromArray(i.host.pos),Jr(c),closeWindow(),Ye(),D(!0))}};function Jr(e){document.querySelector("#multiplayerIcon").setAttribute("style",`color: ${e.color} !important`),windows[100].generatePlayers(),w(e.room.id);let r=document.querySelector("#chat-container");r.style.visibility="visible";let o=document.querySelector("#chat-list");o.textContent=""}var Et={execute(e,t){alert(t)}};var vt={execute(e,t){let{room:r}=e,o=KE.objectSelected()?.userData.owner.sid;for(let n=0;n<t.length;n+=2){let[i,a]=[t[n],t[n+1]],s=r.getObject(i);if(!s){ot(i,a);continue}r.deleteSID(i),r.setSID(s,a),o===i&&e?.selectObject(a)}}};var St={execute(e,t,r){GM_setValue(t,r)}};var Ee=new Map([[3,gt],[6,yt],[17,Ge],[4,Re],[2,st],[7,Et],[5,vt],[9,pt],[10,ft],[11,ht],[12,mt],[13,ct],[14,lt],[8,at],[19,ut],[16,bt],[18,St],[20,dt]]);function Pt(e){try{let[t,...r]=V.decode(new Uint8Array(e)),o=Ee.get(t);o?o.execute(c,...r):console.error("received unregistered event",t)}catch(t){console.error("event handling error",t)}}var b;async function ve(e){if(b?.readyState===WebSocket.CONNECTING)throw new Error("already connecting");return document.querySelector(".spinner")?.setAttribute("style",""),b=Wr(O[e].ws),b.addEventListener("open",()=>console.debug("Connected")),b.addEventListener("error",()=>alert("Connection error")),b.addEventListener("close",Yr),b.addEventListener("message",({data:t})=>Pt(t)),new Promise((t,r)=>{Ee.set(15,{execute:()=>t()}),b.addEventListener("close",r)})}function se(){return new Promise(e=>{if(!b)return e();b.addEventListener("close",()=>e()),b.close()})}function y(e,...t){b?.readyState===WebSocket.OPEN&&b.send(V.encode([e,...t]))}function Wr(e){let t=GM_getValue("token",""),r=d.name,o=new URLSearchParams({version:"4.14.7"});return r&&o.set("name",r),t&&o.set("token",t),b=new WebSocket(`${e}?${o}`),b.binaryType="arraybuffer",b}function Yr(e){e.reason&&alert(e.reason),console.debug("Disconnected"),b=void 0,Fe(),D(!1),c&&w(),windows[100].generatePlayers(),document.querySelector("#multiplayerIcon")?.setAttribute("style",""),document.querySelector(".spinner")?.setAttribute("style","visibility: hidden");let t=document.querySelector("#chat-container");t.style.visibility="hidden",c&&(!c.isHost&&c.room.settings.clearMapOnDisconnect&&KE.clearMap(),c.room.clearPlayers())}var Se={shading:{name:"Toggle Shading",object:{val:"Shift + B"},keyCode:"B",key:"val",type:"key",action:()=>KE.toggleProp("ambient")},players:{name:"Open Player List",object:{val:"Tab"},keyCode:"Tab",key:"val",type:"key",action:()=>showWindow(101)},chat:{name:"Chat",object:{val:"Enter"},keyCode:"Enter",key:"val",type:"key",action:()=>document.querySelector("#chat-input")?.focus()}};function Ot(){addEventListener("keydown",e=>{if(KE.isTyping(e)||!KE.enabled||e.ctrlKey)return;let t=Object.values(Se).find(({keyCode:r})=>r===e.key);t&&(t.action(),e.preventDefault(),e.stopImmediatePropagation())})}var k;function wt(){document.body.oncontextmenu=null,KE.renderer.domElement.oncontextmenu=()=>!1,Promise.resolve().then(()=>Tt()),Zr(),Xr(),Fr(),ro(),to(),oo(),eo(),Qr()}function It(){document.title+="+";let e=document.querySelector('link[rel~="icon"]'),t=e.cloneNode(!0);e.href=t.href="https://i.imgur.com/WdYKPAE.png",document.head.appendChild(t)}function Fr(){k=document.createElement("div"),k.classList.add("joinPop"),document.querySelector("#popupHolder")?.appendChild(k);let e=unsafeWindow.resetPops;unsafeWindow.resetPops=()=>{e(),k.style.display="none"};let t=unsafeWindow.clearPops;unsafeWindow.clearPops=()=>{t(),k.style.display="none"}}function Ct(){unsafeWindow.resetPops(),k.style.display="block",k.innerHTML=`<div class='popupTitle'>Join Room</div>
<input id='roomId' class='joinInput' type='text' placeholder='Link or room ID' autofocus>
<button id='joinPopupBtn' class='primary joinBtn' onclick='clearPops()'>Join</button>`;let e=document.querySelector("#joinPopupBtn");e.onclick=()=>{let t=document.querySelector("#roomId").value;w(Pe(t)),location.reload()}}function jt(){unsafeWindow.resetPops(),k.style.display="block",k.innerHTML=`<div class='popupTitle'>Join Room</div>
<input id='joinPassword' class='joinInput' type='password' placeholder='Enter Password' autofocus>
<button id='joinPopupBtn' class='primary joinBtn' onclick='clearPops()'>Join</button>`;let e=document.querySelector("#joinPopupBtn");e.onclick=ce}function Xr(){let e=GUI._html.input.fixed.vector3.bind(GUI);GUI._html.input.fixed.vector3=(...t)=>e(...t).replace(/ type="number"/g,' type="text"'),GUI.update.number.change=t=>{let r=0;try{r=Function(`"use strict";return (${t.value})`)()}catch{}t.value=(Number.isFinite(r)?r:0).toString()},GUI._html.input.resizable.password=(t,r,o)=>`<input class="inlineInput" type="password" placeholder="${x(o)}" value="${x(t)}" oninput="${x(r)}" maxlength="${ke}" onchange="GUI.update.field(this)">`}function Zr(){document.querySelector("#playbar").innerHTML+=`<div class="playbarItemR" onclick="showWindow(100)" title="Multiplayer Editing">
<i id="multiplayerIcon" class="material-icons">group_add</i>
</div>`;let e=document.querySelector("#versionTxt");e.innerHTML=`<span id="epVersion" title="Click To Update Editor+
By Jakob#8686">Editor+ v4.14.7</span> | ${e.innerHTML}`,e.addEventListener("click",()=>{GM_setValue("lastModified",0),location.reload()})}function Qr(){windows[100]={header:"Player List",width:"600px",getPlayerCount(){return`[${c?.room.players.length||0}/${c?.room.settings.size||0}]`},generatePlayers(){if(!c)return"";let e=c.room.players.map(o=>`
<div class='section' style='font-size:25px'>
${o.isHost?'<i class="material-icons">stars</i>':""}
<span style='color:${o.color}'>${_(o.name)}</span>
${o.isYou?"":`
<div class='searchBtn' title='Teleport' style='float:right; width: initial; margin-top: 0px' onclick='closeWindow();EP.tpToPlayer(${o.id})'><i class='material-icons' style='color: #202020; font-size: 25px'>explore</i></div>
<div class='searchBtn' title='Select object' style='float:right; width: initial; margin-top: 0px' onclick='closeWindow();EP.selectObjectOfPlayer(${o.id})'><i class='material-icons' style='color: #202020; font-size: 25px'>view_in_ar</i></div>
`}
${c?.isHost&&!o.isYou?`
<div class='searchBtn' title='Kick' style='float:right; width: initial; margin-top: 0px' onclick='closeWindow();EP.punish(${o.id}, "kick")'><i class='material-icons' style='color: #202020; font-size: 25px'>person_remove</i></div>
<div class='searchBtn' title='Ban' style='float:right; width: initial; margin-top: 0px' onclick='closeWindow();EP.punish(${o.id}, "ban")'><i class='material-icons' style='color: #202020; font-size: 25px'>person_off</i></div>`:""}
</div>`).join(""),t=document.querySelector("#playerList");t&&(t.innerHTML=e);let r=document.querySelector("#playerCount");return r&&(r.textContent=this.getPlayerCount()),e},gen(){return`<div class='windowHeader'>
<div>Player List</div>
<div id='playerCount' style='float:right;'>${this.getPlayerCount()}</div>
</div>
<div class='windowBody'>
<span id='playerList'>${this.generatePlayers()}</span>
</div>`}}}function eo(){let e=document.createElement("div");e.id="chat-container",e.innerHTML=`<div id='chat-list'></div>
<input id='chat-input' class='inlineInput' type='text' placeholder='Enter Message' maxlength='${we}' autocomplete='off'>`,document.querySelector("#center")?.appendChild(e),document.querySelector("#chat-input").addEventListener("keydown",r=>{r.key==="Enter"&&Dt()})}function to(){windows[2].tabNames.push("Editor+"),GUI._window.settings["editor+"]={gen(){return GUI._window.settings["editor+"].blueprint={name:{name:"Multiplayer Name",object:d,key:"name",type:"text",onChange(e,t){T("name",t.slice(0,Te))}},autoChatScroll:{name:"Auto Chat Scroll",object:d,key:"autoChatScroll",type:"switch",onChange(e,t){T("autoChatScroll",t)}},renderCoopOutlines:{name:"Render Selected Object Outline",object:d,key:"renderCoopOutlines",type:"switch",onChange(e,t){T("renderCoopOutlines",t)}},streamerMode:{name:"Streamer Mode (hide room ID)",object:d,key:"streamerMode",type:"switch",onChange(e,t){T("streamerMode",t)}},playerOpacity:{name:"Player Opacity",object:d,key:"playerOpacity",type:"slider",args:[0,1,.1],onChange(e,t){T("playerOpacity",t.round(1)),c?.room.players.forEach(r=>r.model?.updateMaterial(t))}}},GUI._build(["_window","settings","editor+","blueprint"])}}}function ro(){windows[0].tabNames.push("Editor+"),GUI._window.controls["editor+"]={gen(){return GUI._window.controls["editor+"].blueprint=Se,GUI._build(["_window","controls","editor+","blueprint"])}}}function oo(){let t=GM_getValue("token")?1:null,r=J[t||0];GUI.roomSettings={settings:{..._e},gen(){return GUI.roomSettings.blueprint={rule:{type:"rule"},players:{name:"Players",object:this.settings,key:"size",type:"slider",args:[1,r,1]},password:{name:"Room Password",object:this.settings,key:"password",type:"password",args:["Enter Password"]},serverRegion:{name:"Server Region",object:d,key:"region",type:"select",args:[Object.keys(O).map(o=>({name:o,value:o}))],onChange(o,n){T("region",n)}},clearMapOnDisconnect:{name:"Clear map on disconnect",object:this.settings,key:"clearMapOnDisconnect",type:"switch"},rule2:{type:"rule"}},GUI._build(["roomSettings","blueprint"])}},windows[99]={header:"Multiplayer editing",width:"600px",gen:()=>`<div class="spinner" style="visibility: hidden">
<div class="bounce1"></div>
<div class="bounce2"></div>
<div class="bounce3"></div>
</div>
<div class="windowHeader" style="text-align: center;">
<div>Multiplayer Editing</div>
</div>
<div class="windowBody">
<div class="warning section">Only invite people you completely trust<br>
they have full control over the map and can steal it or mess it up</div>
${GUI.roomSettings.gen()}
<div class="section button-row">
<button id="inviteBtn" class="primary" onclick="EP.copyRoomURL() || EP.host()">Invite</button>
<button class="primary" onclick="EP.joinPrompt()">Join</button>
<button class="secondary" onclick="EP.disconnect()">Disconnect</button>
</div>
</div>`}}var no={disconnect:se,host:co,join:Mt,joinPrompt:so,copyRoomURL:io,punish:po,tpToPlayer:lo,selectObjectOfPlayer:uo,selectObjectFromSID:_t,quoteAttribute:x,settings:d};Object.assign(unsafeWindow,{EP:no});function io(){return c?(KE.copyToClipboard(`https://krunker.io/editor.html?room=${c.room.id}`),document.querySelector("#inviteBtn").textContent="Copied",!0):!1}function Pe(e){return e.match(xe)?.[1]}async function ao(){try{let e=await navigator.clipboard.readText();return Pe(e)}catch(e){console.error(e)}}async function so(){let e=await ao();if(e){w(e),location.reload();return}Ct()}async function Mt(e,t=""){let r=e.split(":")[0];await se(),await ve(r),y(1,e,t)}function ce(){let e=new URLSearchParams(location.search).get("room");if(e&&/^\*+$/.test(e)&&(e=GM_getValue("lastRoomId")),!e)return;let t=document.querySelector("#joinPassword")?.value;if(e.endsWith("$")&&!t)return jt();Mt(e,t)}async function co(){await se(),await ve(d.region||Object.keys(O)[0]),KE.objInsts.forEach((t,r)=>t.sid=r+1);let e=ge();y(0,e,GUI.roomSettings.settings)}function lo(e){let t=c?.room.findPlayer(e);t&&KE.controls.getObject().position.fromArray(t.pos)}function uo(e){let t=c?.room.findPlayer(e);t?.selectedSID!=null?_t(t.selectedSID):KE.hideTransform()}function _t(e){let t=c?.room.getObject(e);t&&KE.attachTransform(t)}function po(e,t){y(16,e,t)}function ge(){let e=KE.save(!0);for(let t of e.map.objects)delete t.meshUUID,delete t.objUUID;delete e.history,delete e.selected,e.groups={};for(let t of Object.keys(KE.objGroups)){let r=KE.objGroups[t].owner,o=I(r).map(n=>String(n.sid));e.groups[r.userData.owner.sid]={ids:o}}return e}function Dt(){let e=document.querySelector("#chat-input"),t=e.value,r=KE.objectSelected()?.userData.owner;if(r){let o=r.objType.toLowerCase();t=t.replace(/@obj/gim,`${o}::${r.sid}`)}t.length&&(y(4,t),e.value=""),e.blur()}addEventListener("editor-plus-init",e=>{let t=e.detail.replace(/\bwindow\.KE\s*=/,"loadWebpackModules(arguments[2]),window.KE=");new Function(t)()});function mo(){console.assert(unsafeWindow.__webpack_require__,"Webpack not found"),KE.connected||KE.initConnection(),je(),Ot(),it(),wt(),It(),ce(),console.log("Editor+ loaded")}var Ut;Object.defineProperty(unsafeWindow,"KE",{get:()=>Ut,set(e){Ut=e,mo()}});})();