@mml-io/3d-web-experience-client 0.24.2 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/build/Networked3dWebExperienceClient.d.ts +31 -39
  2. package/build/Networked3dWebExperienceClient.d.ts.map +1 -0
  3. package/build/avatar-selection-ui/AvatarSelectionUI.d.ts +1 -0
  4. package/build/avatar-selection-ui/AvatarSelectionUI.d.ts.map +1 -0
  5. package/build/avatar-selection-ui/AvatarType.d.ts +1 -0
  6. package/build/avatar-selection-ui/AvatarType.d.ts.map +1 -0
  7. package/build/avatar-selection-ui/components/AvatarPanel/AvatarSectionUIComponent.d.ts +1 -0
  8. package/build/avatar-selection-ui/components/AvatarPanel/AvatarSectionUIComponent.d.ts.map +1 -0
  9. package/build/avatar-selection-ui/index.d.ts +1 -0
  10. package/build/avatar-selection-ui/index.d.ts.map +1 -0
  11. package/build/chat-ui/TextChatUI.d.ts +1 -0
  12. package/build/chat-ui/TextChatUI.d.ts.map +1 -0
  13. package/build/chat-ui/components/ChatPanel/TextChatUIComponent.d.ts +1 -0
  14. package/build/chat-ui/components/ChatPanel/TextChatUIComponent.d.ts.map +1 -0
  15. package/build/chat-ui/components/Input/InputBox.d.ts +1 -0
  16. package/build/chat-ui/components/Input/InputBox.d.ts.map +1 -0
  17. package/build/chat-ui/components/Message/Message.d.ts +1 -0
  18. package/build/chat-ui/components/Message/Message.d.ts.map +1 -0
  19. package/build/chat-ui/components/Messages/Messages.d.ts +1 -0
  20. package/build/chat-ui/components/Messages/Messages.d.ts.map +1 -0
  21. package/build/chat-ui/helpers.d.ts +1 -0
  22. package/build/chat-ui/helpers.d.ts.map +1 -0
  23. package/build/chat-ui/index.d.ts +1 -0
  24. package/build/chat-ui/index.d.ts.map +1 -0
  25. package/build/index.css +104 -104
  26. package/build/index.css.map +1 -1
  27. package/build/index.d.ts +1 -0
  28. package/build/index.d.ts.map +1 -0
  29. package/build/index.js +225 -340
  30. package/build/index.js.map +3 -3
  31. package/package.json +7 -7
package/build/index.js CHANGED
@@ -1,25 +1,23 @@
1
- globalThis['__css-content-15dcb6aa9b86b42829d2c24500b3f199__']=".AvatarSelectionUIComponent-module__menuButton_VjZ7cq__0242{z-index:102;user-select:none;width:70px;min-height:70px;position:absolute;top:0;right:0}.AvatarSelectionUIComponent-module__input_VjZ7cq__0242{color:#fff;backdrop-filter:blur(10px);background-color:#0006;border:1px solid #fff3;border-radius:8px;outline:none;flex:1;margin-right:6px;padding:6px 8px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;font-weight:400;transition:all .2s ease-in-out}.AvatarSelectionUIComponent-module__input_VjZ7cq__0242:focus{background-color:#0009;border-color:#fff6;box-shadow:0 0 0 3px #ffffff26}.AvatarSelectionUIComponent-module__input_VjZ7cq__0242::placeholder{color:#ffffff80}.AvatarSelectionUIComponent-module__closeButton_VjZ7cq__0242{backdrop-filter:blur(10px);color:#fffc;cursor:pointer;user-select:none;background:#0009;border:1px solid #fff3;border-radius:50%;justify-content:center;align-items:center;width:44px;height:44px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:16px;font-weight:500;transition:all .2s ease-in-out;display:flex;position:absolute;top:8px;right:8px}.AvatarSelectionUIComponent-module__closeButton_VjZ7cq__0242:hover{color:#ffffffe6;background:#000c;transform:scale(1.05)}.AvatarSelectionUIComponent-module__closeButton_VjZ7cq__0242:active{transform:scale(.95)}.AvatarSelectionUIComponent-module__openTab_VjZ7cq__0242{backdrop-filter:blur(10px);cursor:pointer;user-select:none;background:#0009;border:1px solid #fff3;border-radius:50%;justify-content:center;align-items:center;width:44px;height:44px;transition:all .2s ease-in-out;display:flex;position:absolute;top:8px;right:8px}.AvatarSelectionUIComponent-module__openTab_VjZ7cq__0242:hover{background:#000c;transform:scale(1.05)}.AvatarSelectionUIComponent-module__openTab_VjZ7cq__0242:active{transform:scale(.95)}.AvatarSelectionUIComponent-module__openTab_VjZ7cq__0242 img{filter:invert(80%);width:24px;height:24px;transition:all .2s ease-in-out}.AvatarSelectionUIComponent-module__avatarSelectionContainer_VjZ7cq__0242{backdrop-filter:blur(20px);z-index:103;user-select:none;background:#000000bf;border:1px solid #fff3;border-radius:16px;width:400px;max-width:78vw;max-height:calc(100vh - 24px);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;position:absolute;top:8px;right:60px;overflow:hidden auto;box-shadow:0 8px 32px #0006,0 0 0 1px #ffffff1a}.AvatarSelectionUIComponent-module__avatarSelectionContainer_VjZ7cq__0242::-webkit-scrollbar{width:8px}.AvatarSelectionUIComponent-module__avatarSelectionContainer_VjZ7cq__0242::-webkit-scrollbar-track{background:none}.AvatarSelectionUIComponent-module__avatarSelectionContainer_VjZ7cq__0242::-webkit-scrollbar-thumb{background:#fff3;border:1px solid #ffffff1a;border-radius:4px}.AvatarSelectionUIComponent-module__avatarSelectionContainer_VjZ7cq__0242::-webkit-scrollbar-thumb:hover{background:#ffffff4d}.AvatarSelectionUIComponent-module__avatarSelectionSection_VjZ7cq__0242{border-bottom:1px solid #ffffff26;padding:10px}.AvatarSelectionUIComponent-module__avatarSelectionSection_VjZ7cq__0242:last-child{border-bottom:none}.AvatarSelectionUIComponent-module__avatarSelectionUi_VjZ7cq__0242{background:#0000004d;border:1px solid #ffffff26;border-radius:12px;grid-template-columns:repeat(auto-fill,minmax(85px,1fr));gap:8px;max-height:320px;padding:10px;display:grid;overflow:hidden auto}.AvatarSelectionUIComponent-module__avatarSelectionUi_VjZ7cq__0242::-webkit-scrollbar{width:6px}.AvatarSelectionUIComponent-module__avatarSelectionUi_VjZ7cq__0242::-webkit-scrollbar-track{background:none}.AvatarSelectionUIComponent-module__avatarSelectionUi_VjZ7cq__0242::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:3px}.AvatarSelectionUIComponent-module__avatarSelectionUiHeader_VjZ7cq__0242{color:#ffffffe6;text-align:center;font-weight:600;position:relative}.AvatarSelectionUIComponent-module__avatarSelectionUiCloseButton_VjZ7cq__0242{position:absolute;top:20px;right:20px}.AvatarSelectionUIComponent-module__avatarSelectionUiAvatar_VjZ7cq__0242{color:#ffffffe6;text-align:center;cursor:pointer;border-radius:8px;padding:4px;transition:all .2s ease-in-out}.AvatarSelectionUIComponent-module__avatarSelectionUiAvatar_VjZ7cq__0242:hover{background:#0000004d;transform:translateY(-2px)}.AvatarSelectionUIComponent-module__avatarSelectionUiAvatarImgContainer_VjZ7cq__0242{border-radius:8px;position:relative;overflow:hidden}.AvatarSelectionUIComponent-module__avatarSelectionNoImage_VjZ7cq__0242{aspect-ratio:1;box-sizing:border-box;background:#0003;border:1px solid #ffffff26;border-radius:8px;justify-content:center;align-items:center;width:100%;display:flex}.AvatarSelectionUIComponent-module__avatarSelectionNoImage_VjZ7cq__0242 img{filter:invert(70%);opacity:.7;width:40%}.AvatarSelectionUIComponent-module__avatarSelectionUiAvatar_VjZ7cq__0242 p{text-overflow:ellipsis;white-space:nowrap;color:#fffc;margin:4px 0 0;font-size:12px;font-weight:500;position:relative;overflow:hidden}.AvatarSelectionUIComponent-module__tooltipText_VjZ7cq__0242{pointer-events:none;z-index:1000;color:#ffffffe6;backdrop-filter:blur(10px);opacity:0;visibility:hidden;white-space:nowrap;background:#000c;border-radius:8px;margin-bottom:4px;padding:4px 6px;font-size:12px;font-weight:500;transition:opacity .2s ease-in-out;position:absolute;bottom:100%;left:50%;transform:translate(-50%)}.AvatarSelectionUIComponent-module__avatarSelectionUiAvatar_VjZ7cq__0242 p:hover+.AvatarSelectionUIComponent-module__tooltipText_VjZ7cq__0242{opacity:1;visibility:visible;transition-delay:.5s}.AvatarSelectionUIComponent-module__avatarSelectionUiAvatarImgContainer_VjZ7cq__0242 .AvatarSelectionUIComponent-module__avatarSelectionUiAvatarImage_VjZ7cq__0242{aspect-ratio:1;border-radius:8px;width:100%;transition:all .2s ease-in-out}.AvatarSelectionUIComponent-module__selectedPill_VjZ7cq__0242{color:#fff;backdrop-filter:blur(10px);background:linear-gradient(135deg,#22c55e,#16a34a);border:1px solid #fff3;border-radius:6px;padding:2px 4px;font-size:11px;font-weight:600;box-shadow:0 2px 4px #0003}.AvatarSelectionUIComponent-module__avatarSelectionUiAvatarImgContainer_VjZ7cq__0242 .AvatarSelectionUIComponent-module__selectedPill_VjZ7cq__0242{z-index:2;position:absolute;top:4px;right:4px}.AvatarSelectionUIComponent-module__avatarSelectionUiAvatar_VjZ7cq__0242 img:hover{opacity:.8;transform:scale(1.05)}.AvatarSelectionUIComponent-module__customAvatarSection_VjZ7cq__0242{color:#ffffffe6;border-bottom:1px solid #ffffff26;padding:10px;position:relative}.AvatarSelectionUIComponent-module__customAvatarSection_VjZ7cq__0242:last-child{border-bottom:none}.AvatarSelectionUIComponent-module__customAvatarSection_VjZ7cq__0242 .AvatarSelectionUIComponent-module__radioGroup_VjZ7cq__0242{flex-wrap:wrap;align-items:center;gap:4px;margin-bottom:8px;display:flex}.AvatarSelectionUIComponent-module__customAvatarSection_VjZ7cq__0242 .AvatarSelectionUIComponent-module__radioItem_VjZ7cq__0242{white-space:nowrap;align-items:center;gap:3px;margin-right:6px;display:flex}.AvatarSelectionUIComponent-module__customAvatarSection_VjZ7cq__0242 label{color:#fffc;cursor:pointer;margin:0;font-size:14px;font-weight:500;transition:color .2s ease-in-out}.AvatarSelectionUIComponent-module__customAvatarSection_VjZ7cq__0242 label:hover{color:#fff}.AvatarSelectionUIComponent-module__customAvatarSection_VjZ7cq__0242 input[type=radio]{appearance:none;cursor:pointer;background:none;border:2px solid #ffffff4d;border-radius:50%;outline:none;width:18px;height:18px;transition:all .2s ease-in-out;position:relative}.AvatarSelectionUIComponent-module__customAvatarSection_VjZ7cq__0242 input[type=radio]:hover{border-color:#ffffff80}.AvatarSelectionUIComponent-module__customAvatarSection_VjZ7cq__0242 input[type=radio]:focus{box-shadow:0 0 0 3px #ffffff1a}.AvatarSelectionUIComponent-module__customAvatarSection_VjZ7cq__0242 input[type=radio]:checked{background:#ffffff1a;border-color:#fffc}.AvatarSelectionUIComponent-module__customAvatarSection_VjZ7cq__0242 input[type=radio]:checked:after{content:\"\";background:#ffffffe6;border-radius:50%;width:8px;height:8px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.AvatarSelectionUIComponent-module__customAvatarSection_VjZ7cq__0242 input[type=radio][disabled]{opacity:.4;cursor:not-allowed}.AvatarSelectionUIComponent-module__customAvatarInputSection_VjZ7cq__0242{align-items:stretch;display:flex}.AvatarSelectionUIComponent-module__setButton_VjZ7cq__0242{color:#ffffffe6;backdrop-filter:blur(10px);cursor:pointer;background:linear-gradient(135deg,#0009,#0006);border:1px solid #fff3;border-radius:8px;justify-content:center;align-items:center;height:44px;padding-left:16px;padding-right:16px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;font-weight:500;transition:all .2s ease-in-out;display:flex}.AvatarSelectionUIComponent-module__setButton_VjZ7cq__0242:hover:not(:disabled){background:linear-gradient(135deg,#000c,#0009);border-color:#ffffff4d;transform:translateY(-1px);box-shadow:0 4px 8px #0000004d}.AvatarSelectionUIComponent-module__setButton_VjZ7cq__0242:active:not(:disabled){transform:translateY(0);box-shadow:0 2px 4px #0003}.AvatarSelectionUIComponent-module__setButton_VjZ7cq__0242:disabled{opacity:.5;cursor:not-allowed;transform:none}.AvatarSelectionUIComponent-module__sectionHeading_VjZ7cq__0242{color:#ffffffe6;letter-spacing:-.01em;margin-bottom:8px;font-size:18px;font-weight:600}.AvatarSelectionUIComponent-module__customAvatarSection_VjZ7cq__0242 .AvatarSelectionUIComponent-module__selectedPill_VjZ7cq__0242{margin-left:8px;position:relative;top:-2px}.AvatarSelectionUIComponent-module__displayNameSection_VjZ7cq__0242{color:#ffffffe6;border-bottom:1px solid #ffffff26;padding:10px;position:relative}.AvatarSelectionUIComponent-module__displayNameInputSection_VjZ7cq__0242{align-items:stretch;display:flex}.InputBox-module__inputWrapper_adOgOW__0242{pointer-events:all;align-items:stretch;gap:6px;display:flex}.InputBox-module__chatInput_adOgOW__0242{color:#fff;backdrop-filter:blur(10px);box-sizing:border-box;background:#0006;border:1px solid #fff3;border-radius:8px;outline:none;flex:1;height:36px;padding:0 8px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;font-weight:400;transition:all .2s ease-in-out}.InputBox-module__chatInput_adOgOW__0242:focus{background:#0009;border-color:#fff6;box-shadow:0 0 0 3px #ffffff26}.InputBox-module__chatInput_adOgOW__0242::placeholder{color:#ffffff80}.InputBox-module__sendButton_adOgOW__0242{color:#ffffffe6;backdrop-filter:blur(10px);cursor:pointer;background:linear-gradient(135deg,#0009,#0006);border:1px solid #fff3;border-radius:8px;outline:none;justify-content:center;align-items:center;width:36px;height:36px;transition:all .2s ease-in-out;display:flex}.InputBox-module__sendButton_adOgOW__0242:hover{background:linear-gradient(135deg,#000c,#0009);border-color:#ffffff4d;transform:translateY(-1px);box-shadow:0 4px 8px #0000004d}.InputBox-module__sendButton_adOgOW__0242:active{transform:translateY(0);box-shadow:0 2px 4px #0003}.InputBox-module__sendButton_adOgOW__0242 .InputBox-module__svgIcon_adOgOW__0242 img{filter:invert(80%);width:18px;height:18px;transition:all .2s ease-in-out}.InputBox-module__sendButton_adOgOW__0242:hover .InputBox-module__svgIcon_adOgOW__0242 img{filter:invert(90%)}.Message-module__messageContainer_ikOQiq__0242{backdrop-filter:blur(8px);word-break:break-word;color:#ffffffe6;direction:ltr;background:#0000004d;border:1px solid #fff3;border-radius:8px;width:fit-content;margin:6px auto 6px 2px;padding:4px 8px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;transition:all .2s ease-in-out;overflow-x:hidden}.Message-module__messageContainer_ikOQiq__0242:hover{background:#0006;border-color:#ffffff4d}.Message-module__userName_ikOQiq__0242{color:#ffffffe6;margin-right:4px;font-weight:600}.Messages-module__messagesContainer_LXaUUW__0242{z-index:1000;max-height:inherit;scrollbar-width:thin;scrollbar-color:#fff3 transparent;pointer-events:fill;direction:rtl;position:relative;bottom:0;left:-1px;overflow-y:auto}.Messages-module__messagesContainer_LXaUUW__0242::-webkit-scrollbar{width:6px}.Messages-module__messagesContainer_LXaUUW__0242::-webkit-scrollbar-track{background:none}.Messages-module__messagesContainer_LXaUUW__0242::-webkit-scrollbar-thumb{background:#fff3;border:1px solid #ffffff1a;border-radius:3px}.Messages-module__messagesContainer_LXaUUW__0242::-webkit-scrollbar-thumb:hover{background:#ffffff4d}.Messages-module__newMessagesButton_LXaUUW__0242{-webkit-backdrop-filter:blur(10px);color:#fff;cursor:pointer;z-index:1001;direction:ltr;background:#000000bf;border:1px solid #fff3;border-radius:20px;padding:8px 16px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:14px;font-weight:500;transition:all .2s;position:absolute;bottom:50px;left:50%;transform:translate(-50%);box-shadow:0 4px 12px #0000004d}.Messages-module__newMessagesButton_LXaUUW__0242:hover{background:#000000d9;border-color:#ffffff4d;transform:translate(-50%)translateY(-2px);box-shadow:0 6px 16px #0006}.Messages-module__newMessagesButton_LXaUUW__0242:active{transform:translate(-50%)translateY(0);box-shadow:0 2px 8px #0000004d}.TextChatUIComponent-module__uiHover_gFDdcW__0242{z-index:102;pointer-events:all;width:58px;min-height:58px;position:absolute;bottom:0;left:0}.TextChatUIComponent-module__textChatUi_gFDdcW__0242{flex-direction:row;align-items:flex-end;width:100%;max-width:500px;height:0;display:flex;position:absolute;bottom:0;left:0}.TextChatUIComponent-module__textChat_gFDdcW__0242{z-index:-1;color:#fff;user-select:none;opacity:0;flex-direction:column;justify-content:space-between;width:100%;max-height:500px;margin-bottom:8px;margin-left:60px;padding:5px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;transition:opacity .25s ease-in-out,transform .2s ease-in-out;display:flex;transform:translate(-100%)}.TextChatUIComponent-module__fadeIn_gFDdcW__0242{opacity:1;transform:translate(0)}.TextChatUIComponent-module__fadeOut_gFDdcW__0242{opacity:.6;transform:translate(calc(-100% - 72px))}.TextChatUIComponent-module__controls_gFDdcW__0242{position:absolute;top:2px;right:0}.TextChatUIComponent-module__openTab_gFDdcW__0242{backdrop-filter:blur(10px);cursor:pointer;z-index:102;user-select:none;background:#0009;border:1px solid #fff3;border-radius:50%;justify-content:center;align-items:center;width:44px;height:44px;transition:all .2s ease-in-out;display:flex;position:absolute;bottom:8px;left:8px}.TextChatUIComponent-module__openTab_gFDdcW__0242:hover{background:#000c;border-color:#ffffff4d;transform:scale(1.05)}.TextChatUIComponent-module__openTab_gFDdcW__0242:active{transform:scale(.95)}.TextChatUIComponent-module__openTab_gFDdcW__0242 img{filter:invert(80%);width:24px;height:24px;transition:all .2s ease-in-out}.TextChatUIComponent-module__stickyButton_gFDdcW__0242{z-index:103;backdrop-filter:blur(10px);cursor:pointer;user-select:none;opacity:1;background:#0009;border:1px solid #fff3;border-radius:50%;justify-content:center;align-items:center;width:24px;height:24px;transition:all .2s ease-in-out;display:flex;position:absolute;bottom:38px;left:38px}.TextChatUIComponent-module__stickyButton_gFDdcW__0242:hover{background:#000c;border-color:#ffffff4d;transform:scale(1.05)}.TextChatUIComponent-module__stickyButtonFadeOut_gFDdcW__0242{z-index:103;backdrop-filter:blur(10px);cursor:pointer;user-select:none;opacity:0;pointer-events:none;background:#0009;border:1px solid #fff3;border-radius:50%;justify-content:center;align-items:center;width:24px;height:24px;transition:all .2s ease-in-out;display:flex;position:absolute;bottom:42px;left:42px}.TextChatUIComponent-module__stickyButtonEnabled_gFDdcW__0242{z-index:103;backdrop-filter:blur(10px);cursor:pointer;user-select:none;background:#000c;border:1px solid #22c55e99;border-radius:50%;justify-content:center;align-items:center;width:24px;height:24px;transition:all .2s ease-in-out;display:flex;position:absolute;bottom:42px;left:42px;box-shadow:0 0 8px #22c55e4d}.TextChatUIComponent-module__stickyButtonEnabled_gFDdcW__0242:hover{border-color:#22c55ecc;transform:scale(1.05);box-shadow:0 0 12px #22c55e66}.TextChatUIComponent-module__stickyButton_gFDdcW__0242 img,.TextChatUIComponent-module__stickyButtonFadeOut_gFDdcW__0242 img,.TextChatUIComponent-module__stickyButtonEnabled_gFDdcW__0242 img{filter:invert(70%);width:12px;height:12px;transition:all .2s ease-in-out}.TextChatUIComponent-module__stickyButton_gFDdcW__0242:hover img,.TextChatUIComponent-module__stickyButtonEnabled_gFDdcW__0242:hover img{filter:invert(90%)}.TextChatUIComponent-module__controls_gFDdcW__0242 .TextChatUIComponent-module__closeButton_gFDdcW__0242{color:#fffc;backdrop-filter:blur(10px);cursor:pointer;background:#0009;border:1px solid #fff3;border-radius:50%;justify-content:center;align-items:center;width:28px;height:28px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;font-weight:500;transition:all .2s ease-in-out;display:flex;position:absolute;top:3px;right:3px}.TextChatUIComponent-module__closeButton_gFDdcW__0242:hover{color:#ffffffe6;background:#000c;border-color:#ffffff4d;transform:scale(1.05)}.TextChatUIComponent-module__closeButton_gFDdcW__0242:active{transform:scale(.95)}.TextChatUIComponent-module__messagesWrapper_gFDdcW__0242{direction:rtl;width:fit-content;max-height:450px;margin-bottom:8px;position:relative}.Networked3dWebExperience-module__respawnButton_7g9l0W__0242{z-index:102;color:#ffffffe6;backdrop-filter:blur(10px);cursor:pointer;user-select:none;background:linear-gradient(135deg,#0009,#0006);border:1px solid #fff3;border-radius:8px;justify-content:center;align-items:center;padding:12px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;font-weight:500;transition:all .2s ease-in-out;display:flex;position:absolute;top:8px;left:8px}.Networked3dWebExperience-module__respawnButton_7g9l0W__0242:hover{background:linear-gradient(135deg,#000c,#0009);border-color:#ffffff4d;transform:translateY(-1px)}.Networked3dWebExperience-module__respawnButton_7g9l0W__0242:active{transform:translateY(0)}\n";globalThis['__css-digest-15dcb6aa9b86b42829d2c24500b3f199__']="15dcb6aa9b86b42829d2c24500b3f199";
1
+ globalThis['__css-content-f6c39ca8d32b92c0b3e90804c6ccc949__']=".AvatarSelectionUIComponent-module__menuButton_VjZ7cq__0260{z-index:102;user-select:none;width:70px;min-height:70px;position:absolute;top:0;right:0}.AvatarSelectionUIComponent-module__input_VjZ7cq__0260{color:#fff;backdrop-filter:blur(10px);background-color:#0006;border:1px solid #fff3;border-radius:8px;outline:none;flex:1;margin-right:6px;padding:6px 8px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;font-weight:400;transition:all .2s ease-in-out}.AvatarSelectionUIComponent-module__input_VjZ7cq__0260:focus{background-color:#0009;border-color:#fff6;box-shadow:0 0 0 3px #ffffff26}.AvatarSelectionUIComponent-module__input_VjZ7cq__0260::placeholder{color:#ffffff80}.AvatarSelectionUIComponent-module__closeButton_VjZ7cq__0260{backdrop-filter:blur(10px);color:#fffc;cursor:pointer;user-select:none;background:#0009;border:1px solid #fff3;border-radius:50%;justify-content:center;align-items:center;width:44px;height:44px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:16px;font-weight:500;transition:all .2s ease-in-out;display:flex;position:absolute;top:8px;right:8px}.AvatarSelectionUIComponent-module__closeButton_VjZ7cq__0260:hover{color:#ffffffe6;background:#000c;transform:scale(1.05)}.AvatarSelectionUIComponent-module__closeButton_VjZ7cq__0260:active{transform:scale(.95)}.AvatarSelectionUIComponent-module__openTab_VjZ7cq__0260{backdrop-filter:blur(10px);cursor:pointer;user-select:none;background:#0009;border:1px solid #fff3;border-radius:50%;justify-content:center;align-items:center;width:44px;height:44px;transition:all .2s ease-in-out;display:flex;position:absolute;top:8px;right:8px}.AvatarSelectionUIComponent-module__openTab_VjZ7cq__0260:hover{background:#000c;transform:scale(1.05)}.AvatarSelectionUIComponent-module__openTab_VjZ7cq__0260:active{transform:scale(.95)}.AvatarSelectionUIComponent-module__openTab_VjZ7cq__0260 img{filter:invert(80%);width:24px;height:24px;transition:all .2s ease-in-out}.AvatarSelectionUIComponent-module__avatarSelectionContainer_VjZ7cq__0260{backdrop-filter:blur(20px);z-index:103;user-select:none;background:#000000bf;border:1px solid #fff3;border-radius:16px;width:400px;max-width:78vw;max-height:calc(100vh - 24px);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;position:absolute;top:8px;right:60px;overflow:hidden auto;box-shadow:0 8px 32px #0006,0 0 0 1px #ffffff1a}.AvatarSelectionUIComponent-module__avatarSelectionContainer_VjZ7cq__0260::-webkit-scrollbar{width:8px}.AvatarSelectionUIComponent-module__avatarSelectionContainer_VjZ7cq__0260::-webkit-scrollbar-track{background:none}.AvatarSelectionUIComponent-module__avatarSelectionContainer_VjZ7cq__0260::-webkit-scrollbar-thumb{background:#fff3;border:1px solid #ffffff1a;border-radius:4px}.AvatarSelectionUIComponent-module__avatarSelectionContainer_VjZ7cq__0260::-webkit-scrollbar-thumb:hover{background:#ffffff4d}.AvatarSelectionUIComponent-module__avatarSelectionSection_VjZ7cq__0260{border-bottom:1px solid #ffffff26;padding:10px}.AvatarSelectionUIComponent-module__avatarSelectionSection_VjZ7cq__0260:last-child{border-bottom:none}.AvatarSelectionUIComponent-module__avatarSelectionUi_VjZ7cq__0260{background:#0000004d;border:1px solid #ffffff26;border-radius:12px;grid-template-columns:repeat(auto-fill,minmax(85px,1fr));gap:8px;max-height:320px;padding:10px;display:grid;overflow:hidden auto}.AvatarSelectionUIComponent-module__avatarSelectionUi_VjZ7cq__0260::-webkit-scrollbar{width:6px}.AvatarSelectionUIComponent-module__avatarSelectionUi_VjZ7cq__0260::-webkit-scrollbar-track{background:none}.AvatarSelectionUIComponent-module__avatarSelectionUi_VjZ7cq__0260::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:3px}.AvatarSelectionUIComponent-module__avatarSelectionUiHeader_VjZ7cq__0260{color:#ffffffe6;text-align:center;font-weight:600;position:relative}.AvatarSelectionUIComponent-module__avatarSelectionUiCloseButton_VjZ7cq__0260{position:absolute;top:20px;right:20px}.AvatarSelectionUIComponent-module__avatarSelectionUiAvatar_VjZ7cq__0260{color:#ffffffe6;text-align:center;cursor:pointer;border-radius:8px;padding:4px;transition:all .2s ease-in-out}.AvatarSelectionUIComponent-module__avatarSelectionUiAvatar_VjZ7cq__0260:hover{background:#0000004d;transform:translateY(-2px)}.AvatarSelectionUIComponent-module__avatarSelectionUiAvatarImgContainer_VjZ7cq__0260{border-radius:8px;position:relative;overflow:hidden}.AvatarSelectionUIComponent-module__avatarSelectionNoImage_VjZ7cq__0260{aspect-ratio:1;box-sizing:border-box;background:#0003;border:1px solid #ffffff26;border-radius:8px;justify-content:center;align-items:center;width:100%;display:flex}.AvatarSelectionUIComponent-module__avatarSelectionNoImage_VjZ7cq__0260 img{filter:invert(70%);opacity:.7;width:40%}.AvatarSelectionUIComponent-module__avatarSelectionUiAvatar_VjZ7cq__0260 p{text-overflow:ellipsis;white-space:nowrap;color:#fffc;margin:4px 0 0;font-size:12px;font-weight:500;position:relative;overflow:hidden}.AvatarSelectionUIComponent-module__tooltipText_VjZ7cq__0260{pointer-events:none;z-index:1000;color:#ffffffe6;backdrop-filter:blur(10px);opacity:0;visibility:hidden;white-space:nowrap;background:#000c;border-radius:8px;margin-bottom:4px;padding:4px 6px;font-size:12px;font-weight:500;transition:opacity .2s ease-in-out;position:absolute;bottom:100%;left:50%;transform:translate(-50%)}.AvatarSelectionUIComponent-module__avatarSelectionUiAvatar_VjZ7cq__0260 p:hover+.AvatarSelectionUIComponent-module__tooltipText_VjZ7cq__0260{opacity:1;visibility:visible;transition-delay:.5s}.AvatarSelectionUIComponent-module__avatarSelectionUiAvatarImgContainer_VjZ7cq__0260 .AvatarSelectionUIComponent-module__avatarSelectionUiAvatarImage_VjZ7cq__0260{aspect-ratio:1;border-radius:8px;width:100%;transition:all .2s ease-in-out}.AvatarSelectionUIComponent-module__selectedPill_VjZ7cq__0260{color:#fff;backdrop-filter:blur(10px);background:linear-gradient(135deg,#22c55e,#16a34a);border:1px solid #fff3;border-radius:6px;padding:2px 4px;font-size:11px;font-weight:600;box-shadow:0 2px 4px #0003}.AvatarSelectionUIComponent-module__avatarSelectionUiAvatarImgContainer_VjZ7cq__0260 .AvatarSelectionUIComponent-module__selectedPill_VjZ7cq__0260{z-index:2;position:absolute;top:4px;right:4px}.AvatarSelectionUIComponent-module__avatarSelectionUiAvatar_VjZ7cq__0260 img:hover{opacity:.8;transform:scale(1.05)}.AvatarSelectionUIComponent-module__customAvatarSection_VjZ7cq__0260{color:#ffffffe6;border-bottom:1px solid #ffffff26;padding:10px;position:relative}.AvatarSelectionUIComponent-module__customAvatarSection_VjZ7cq__0260:last-child{border-bottom:none}.AvatarSelectionUIComponent-module__customAvatarSection_VjZ7cq__0260 .AvatarSelectionUIComponent-module__radioGroup_VjZ7cq__0260{flex-wrap:wrap;align-items:center;gap:4px;margin-bottom:8px;display:flex}.AvatarSelectionUIComponent-module__customAvatarSection_VjZ7cq__0260 .AvatarSelectionUIComponent-module__radioItem_VjZ7cq__0260{white-space:nowrap;align-items:center;gap:3px;margin-right:6px;display:flex}.AvatarSelectionUIComponent-module__customAvatarSection_VjZ7cq__0260 label{color:#fffc;cursor:pointer;margin:0;font-size:14px;font-weight:500;transition:color .2s ease-in-out}.AvatarSelectionUIComponent-module__customAvatarSection_VjZ7cq__0260 label:hover{color:#fff}.AvatarSelectionUIComponent-module__customAvatarSection_VjZ7cq__0260 input[type=radio]{appearance:none;cursor:pointer;background:none;border:2px solid #ffffff4d;border-radius:50%;outline:none;width:18px;height:18px;transition:all .2s ease-in-out;position:relative}.AvatarSelectionUIComponent-module__customAvatarSection_VjZ7cq__0260 input[type=radio]:hover{border-color:#ffffff80}.AvatarSelectionUIComponent-module__customAvatarSection_VjZ7cq__0260 input[type=radio]:focus{box-shadow:0 0 0 3px #ffffff1a}.AvatarSelectionUIComponent-module__customAvatarSection_VjZ7cq__0260 input[type=radio]:checked{background:#ffffff1a;border-color:#fffc}.AvatarSelectionUIComponent-module__customAvatarSection_VjZ7cq__0260 input[type=radio]:checked:after{content:\"\";background:#ffffffe6;border-radius:50%;width:8px;height:8px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.AvatarSelectionUIComponent-module__customAvatarSection_VjZ7cq__0260 input[type=radio][disabled]{opacity:.4;cursor:not-allowed}.AvatarSelectionUIComponent-module__customAvatarInputSection_VjZ7cq__0260{align-items:stretch;display:flex}.AvatarSelectionUIComponent-module__setButton_VjZ7cq__0260{color:#ffffffe6;backdrop-filter:blur(10px);cursor:pointer;background:linear-gradient(135deg,#0009,#0006);border:1px solid #fff3;border-radius:8px;justify-content:center;align-items:center;height:44px;padding-left:16px;padding-right:16px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;font-weight:500;transition:all .2s ease-in-out;display:flex}.AvatarSelectionUIComponent-module__setButton_VjZ7cq__0260:hover:not(:disabled){background:linear-gradient(135deg,#000c,#0009);border-color:#ffffff4d;transform:translateY(-1px);box-shadow:0 4px 8px #0000004d}.AvatarSelectionUIComponent-module__setButton_VjZ7cq__0260:active:not(:disabled){transform:translateY(0);box-shadow:0 2px 4px #0003}.AvatarSelectionUIComponent-module__setButton_VjZ7cq__0260:disabled{opacity:.5;cursor:not-allowed;transform:none}.AvatarSelectionUIComponent-module__sectionHeading_VjZ7cq__0260{color:#ffffffe6;letter-spacing:-.01em;margin-bottom:8px;font-size:18px;font-weight:600}.AvatarSelectionUIComponent-module__customAvatarSection_VjZ7cq__0260 .AvatarSelectionUIComponent-module__selectedPill_VjZ7cq__0260{margin-left:8px;position:relative;top:-2px}.AvatarSelectionUIComponent-module__displayNameSection_VjZ7cq__0260{color:#ffffffe6;border-bottom:1px solid #ffffff26;padding:10px;position:relative}.AvatarSelectionUIComponent-module__displayNameInputSection_VjZ7cq__0260{align-items:stretch;display:flex}.InputBox-module__inputWrapper_adOgOW__0260{pointer-events:all;align-items:stretch;gap:6px;display:flex}.InputBox-module__chatInput_adOgOW__0260{color:#fff;backdrop-filter:blur(10px);box-sizing:border-box;background:#0006;border:1px solid #fff3;border-radius:8px;outline:none;flex:1;height:36px;padding:0 8px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;font-weight:400;transition:all .2s ease-in-out}.InputBox-module__chatInput_adOgOW__0260:focus{background:#0009;border-color:#fff6;box-shadow:0 0 0 3px #ffffff26}.InputBox-module__chatInput_adOgOW__0260::placeholder{color:#ffffff80}.InputBox-module__sendButton_adOgOW__0260{color:#ffffffe6;backdrop-filter:blur(10px);cursor:pointer;background:linear-gradient(135deg,#0009,#0006);border:1px solid #fff3;border-radius:8px;outline:none;justify-content:center;align-items:center;width:36px;height:36px;transition:all .2s ease-in-out;display:flex}.InputBox-module__sendButton_adOgOW__0260:hover{background:linear-gradient(135deg,#000c,#0009);border-color:#ffffff4d;transform:translateY(-1px);box-shadow:0 4px 8px #0000004d}.InputBox-module__sendButton_adOgOW__0260:active{transform:translateY(0);box-shadow:0 2px 4px #0003}.InputBox-module__sendButton_adOgOW__0260 .InputBox-module__svgIcon_adOgOW__0260 img{filter:invert(80%);width:18px;height:18px;transition:all .2s ease-in-out}.InputBox-module__sendButton_adOgOW__0260:hover .InputBox-module__svgIcon_adOgOW__0260 img{filter:invert(90%)}.Message-module__messageContainer_ikOQiq__0260{backdrop-filter:blur(8px);word-break:break-word;color:#ffffffe6;direction:ltr;background:#0000004d;border:1px solid #fff3;border-radius:8px;width:fit-content;margin:6px auto 6px 2px;padding:4px 8px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;transition:all .2s ease-in-out;overflow-x:hidden}.Message-module__messageContainer_ikOQiq__0260:hover{background:#0006;border-color:#ffffff4d}.Message-module__userName_ikOQiq__0260{color:#ffffffe6;margin-right:4px;font-weight:600}.Messages-module__messagesContainer_LXaUUW__0260{z-index:1000;max-height:inherit;scrollbar-width:thin;scrollbar-color:#fff3 transparent;pointer-events:fill;direction:rtl;position:relative;bottom:0;left:-1px;overflow-y:auto}.Messages-module__messagesContainer_LXaUUW__0260::-webkit-scrollbar{width:6px}.Messages-module__messagesContainer_LXaUUW__0260::-webkit-scrollbar-track{background:none}.Messages-module__messagesContainer_LXaUUW__0260::-webkit-scrollbar-thumb{background:#fff3;border:1px solid #ffffff1a;border-radius:3px}.Messages-module__messagesContainer_LXaUUW__0260::-webkit-scrollbar-thumb:hover{background:#ffffff4d}.Messages-module__newMessagesButton_LXaUUW__0260{-webkit-backdrop-filter:blur(10px);color:#fff;cursor:pointer;z-index:1001;direction:ltr;background:#000000bf;border:1px solid #fff3;border-radius:20px;padding:8px 16px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:14px;font-weight:500;transition:all .2s;position:absolute;bottom:50px;left:50%;transform:translate(-50%);box-shadow:0 4px 12px #0000004d}.Messages-module__newMessagesButton_LXaUUW__0260:hover{background:#000000d9;border-color:#ffffff4d;transform:translate(-50%)translateY(-2px);box-shadow:0 6px 16px #0006}.Messages-module__newMessagesButton_LXaUUW__0260:active{transform:translate(-50%)translateY(0);box-shadow:0 2px 8px #0000004d}.TextChatUIComponent-module__uiHover_gFDdcW__0260{z-index:102;pointer-events:all;width:58px;min-height:58px;position:absolute;bottom:0;left:0}.TextChatUIComponent-module__textChatUi_gFDdcW__0260{flex-direction:row;align-items:flex-end;width:100%;max-width:500px;height:0;display:flex;position:absolute;bottom:0;left:0}.TextChatUIComponent-module__textChat_gFDdcW__0260{z-index:-1;color:#fff;user-select:none;opacity:0;flex-direction:column;justify-content:space-between;width:100%;max-height:500px;margin-bottom:8px;margin-left:60px;padding:5px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;transition:opacity .25s ease-in-out,transform .2s ease-in-out;display:flex;transform:translate(-100%)}.TextChatUIComponent-module__fadeIn_gFDdcW__0260{opacity:1;transform:translate(0)}.TextChatUIComponent-module__fadeOut_gFDdcW__0260{opacity:.6;transform:translate(calc(-100% - 72px))}.TextChatUIComponent-module__controls_gFDdcW__0260{position:absolute;top:2px;right:0}.TextChatUIComponent-module__openTab_gFDdcW__0260{backdrop-filter:blur(10px);cursor:pointer;z-index:102;user-select:none;background:#0009;border:1px solid #fff3;border-radius:50%;justify-content:center;align-items:center;width:44px;height:44px;transition:all .2s ease-in-out;display:flex;position:absolute;bottom:8px;left:8px}.TextChatUIComponent-module__openTab_gFDdcW__0260:hover{background:#000c;border-color:#ffffff4d;transform:scale(1.05)}.TextChatUIComponent-module__openTab_gFDdcW__0260:active{transform:scale(.95)}.TextChatUIComponent-module__openTab_gFDdcW__0260 img{filter:invert(80%);width:24px;height:24px;transition:all .2s ease-in-out}.TextChatUIComponent-module__stickyButton_gFDdcW__0260{z-index:103;backdrop-filter:blur(10px);cursor:pointer;user-select:none;opacity:1;background:#0009;border:1px solid #fff3;border-radius:50%;justify-content:center;align-items:center;width:24px;height:24px;transition:all .2s ease-in-out;display:flex;position:absolute;bottom:38px;left:38px}.TextChatUIComponent-module__stickyButton_gFDdcW__0260:hover{background:#000c;border-color:#ffffff4d;transform:scale(1.05)}.TextChatUIComponent-module__stickyButtonFadeOut_gFDdcW__0260{z-index:103;backdrop-filter:blur(10px);cursor:pointer;user-select:none;opacity:0;pointer-events:none;background:#0009;border:1px solid #fff3;border-radius:50%;justify-content:center;align-items:center;width:24px;height:24px;transition:all .2s ease-in-out;display:flex;position:absolute;bottom:42px;left:42px}.TextChatUIComponent-module__stickyButtonEnabled_gFDdcW__0260{z-index:103;backdrop-filter:blur(10px);cursor:pointer;user-select:none;background:#000c;border:1px solid #22c55e99;border-radius:50%;justify-content:center;align-items:center;width:24px;height:24px;transition:all .2s ease-in-out;display:flex;position:absolute;bottom:42px;left:42px;box-shadow:0 0 8px #22c55e4d}.TextChatUIComponent-module__stickyButtonEnabled_gFDdcW__0260:hover{border-color:#22c55ecc;transform:scale(1.05);box-shadow:0 0 12px #22c55e66}.TextChatUIComponent-module__stickyButton_gFDdcW__0260 img,.TextChatUIComponent-module__stickyButtonFadeOut_gFDdcW__0260 img,.TextChatUIComponent-module__stickyButtonEnabled_gFDdcW__0260 img{filter:invert(70%);width:12px;height:12px;transition:all .2s ease-in-out}.TextChatUIComponent-module__stickyButton_gFDdcW__0260:hover img,.TextChatUIComponent-module__stickyButtonEnabled_gFDdcW__0260:hover img{filter:invert(90%)}.TextChatUIComponent-module__controls_gFDdcW__0260 .TextChatUIComponent-module__closeButton_gFDdcW__0260{color:#fffc;backdrop-filter:blur(10px);cursor:pointer;background:#0009;border:1px solid #fff3;border-radius:50%;justify-content:center;align-items:center;width:28px;height:28px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;font-weight:500;transition:all .2s ease-in-out;display:flex;position:absolute;top:3px;right:3px}.TextChatUIComponent-module__closeButton_gFDdcW__0260:hover{color:#ffffffe6;background:#000c;border-color:#ffffff4d;transform:scale(1.05)}.TextChatUIComponent-module__closeButton_gFDdcW__0260:active{transform:scale(.95)}.TextChatUIComponent-module__messagesWrapper_gFDdcW__0260{direction:rtl;width:fit-content;max-height:450px;margin-bottom:8px;position:relative}.Networked3dWebExperience-module__respawnButton_7g9l0W__0260{z-index:102;color:#ffffffe6;backdrop-filter:blur(10px);cursor:pointer;user-select:none;background:linear-gradient(135deg,#0009,#0006);border:1px solid #fff3;border-radius:8px;justify-content:center;align-items:center;padding:12px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;font-weight:500;transition:all .2s ease-in-out;display:flex;position:absolute;top:8px;left:8px}.Networked3dWebExperience-module__respawnButton_7g9l0W__0260:hover{background:linear-gradient(135deg,#000c,#0009);border-color:#ffffff4d;transform:translateY(-1px)}.Networked3dWebExperience-module__respawnButton_7g9l0W__0260:active{transform:translateY(0)}\n";globalThis['__css-digest-f6c39ca8d32b92c0b3e90804c6ccc949__']="f6c39ca8d32b92c0b3e90804c6ccc949";
2
2
  // src/Networked3dWebExperienceClient.ts
3
3
  import {
4
4
  CameraManager,
5
- CharacterManager,
6
- CharacterModelLoader,
7
5
  CollisionsManager,
8
- Composer,
9
6
  ErrorScreen,
10
- GroundPlane,
7
+ EulXYZ,
11
8
  Key,
12
9
  KeyInputManager,
13
10
  LoadingScreen,
14
- MMLCompositionScene,
15
- TimeManager,
16
- TweakPane,
17
11
  Vect3,
18
12
  VirtualJoystick,
19
- Character,
20
13
  Quat,
21
- getSpawnData
14
+ getSpawnData,
15
+ CharacterManager,
16
+ TweakPane,
17
+ createDefaultCharacterControllerValues,
18
+ createDefaultCameraValues
22
19
  } from "@mml-io/3d-web-client-core";
20
+ import { ThreeJSWorldRenderer } from "@mml-io/3d-web-threejs";
23
21
  import {
24
22
  FROM_SERVER_CHAT_MESSAGE_TYPE,
25
23
  FROM_CLIENT_CHAT_MESSAGE_TYPE,
@@ -30,14 +28,7 @@ import {
30
28
  SERVER_BROADCAST_MESSAGE_TYPE,
31
29
  parseServerBroadcastMessage
32
30
  } from "@mml-io/3d-web-user-networking";
33
- import {
34
- LoadingProgressManager,
35
- MMLNetworkSource,
36
- registerCustomElementsToWindow,
37
- setGlobalDocumentTimeManager,
38
- setGlobalMMLScene
39
- } from "@mml-io/mml-web";
40
- import { Scene, AudioListener, Vector3 } from "three";
31
+ import { LoadingProgressManager, registerCustomElementsToWindow } from "@mml-io/mml-web";
41
32
 
42
33
  // src/avatar-selection-ui/AvatarSelectionUI.tsx
43
34
  import { forwardRef } from "react";
@@ -54,8 +45,8 @@ import {
54
45
  var Avatar_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512l388.6 0c16.4 0 29.7-13.3 29.7-29.7C448 383.8 368.2 304 269.7 304l-91.4 0z"/></svg>\n';
55
46
 
56
47
  // esbuild-css-modules-plugin-ns-js::src/avatar-selection-ui/components/AvatarPanel/AvatarSelectionUIComponent.module.css:injector.js
57
- var content = globalThis['__css-content-15dcb6aa9b86b42829d2c24500b3f199__'];
58
- var digest = globalThis['__css-digest-15dcb6aa9b86b42829d2c24500b3f199__'];
48
+ var content = globalThis['__css-content-f6c39ca8d32b92c0b3e90804c6ccc949__'];
49
+ var digest = globalThis['__css-digest-f6c39ca8d32b92c0b3e90804c6ccc949__'];
59
50
  var inject = () => {
60
51
  setTimeout(() => {
61
52
  if (!globalThis.document) {
@@ -81,29 +72,29 @@ var inject = () => {
81
72
 
82
73
  // src/avatar-selection-ui/components/AvatarPanel/AvatarSelectionUIComponent.module.css
83
74
  var AvatarSelectionUIComponent_default = new Proxy({
84
- "avatarSelectionContainer": "AvatarSelectionUIComponent-module__avatarSelectionContainer_VjZ7cq__0242",
85
- "avatarSelectionNoImage": "AvatarSelectionUIComponent-module__avatarSelectionNoImage_VjZ7cq__0242",
86
- "avatarSelectionSection": "AvatarSelectionUIComponent-module__avatarSelectionSection_VjZ7cq__0242",
87
- "avatarSelectionUi": "AvatarSelectionUIComponent-module__avatarSelectionUi_VjZ7cq__0242",
88
- "avatarSelectionUiAvatar": "AvatarSelectionUIComponent-module__avatarSelectionUiAvatar_VjZ7cq__0242",
89
- "avatarSelectionUiAvatarImage": "AvatarSelectionUIComponent-module__avatarSelectionUiAvatarImage_VjZ7cq__0242",
90
- "avatarSelectionUiAvatarImgContainer": "AvatarSelectionUIComponent-module__avatarSelectionUiAvatarImgContainer_VjZ7cq__0242",
91
- "avatarSelectionUiCloseButton": "AvatarSelectionUIComponent-module__avatarSelectionUiCloseButton_VjZ7cq__0242",
92
- "avatarSelectionUiHeader": "AvatarSelectionUIComponent-module__avatarSelectionUiHeader_VjZ7cq__0242",
93
- "closeButton": "AvatarSelectionUIComponent-module__closeButton_VjZ7cq__0242",
94
- "customAvatarInputSection": "AvatarSelectionUIComponent-module__customAvatarInputSection_VjZ7cq__0242",
95
- "customAvatarSection": "AvatarSelectionUIComponent-module__customAvatarSection_VjZ7cq__0242",
96
- "displayNameInputSection": "AvatarSelectionUIComponent-module__displayNameInputSection_VjZ7cq__0242",
97
- "displayNameSection": "AvatarSelectionUIComponent-module__displayNameSection_VjZ7cq__0242",
98
- "input": "AvatarSelectionUIComponent-module__input_VjZ7cq__0242",
99
- "menuButton": "AvatarSelectionUIComponent-module__menuButton_VjZ7cq__0242",
100
- "openTab": "AvatarSelectionUIComponent-module__openTab_VjZ7cq__0242",
101
- "radioGroup": "AvatarSelectionUIComponent-module__radioGroup_VjZ7cq__0242",
102
- "radioItem": "AvatarSelectionUIComponent-module__radioItem_VjZ7cq__0242",
103
- "sectionHeading": "AvatarSelectionUIComponent-module__sectionHeading_VjZ7cq__0242",
104
- "selectedPill": "AvatarSelectionUIComponent-module__selectedPill_VjZ7cq__0242",
105
- "setButton": "AvatarSelectionUIComponent-module__setButton_VjZ7cq__0242",
106
- "tooltipText": "AvatarSelectionUIComponent-module__tooltipText_VjZ7cq__0242"
75
+ "avatarSelectionContainer": "AvatarSelectionUIComponent-module__avatarSelectionContainer_VjZ7cq__0260",
76
+ "avatarSelectionNoImage": "AvatarSelectionUIComponent-module__avatarSelectionNoImage_VjZ7cq__0260",
77
+ "avatarSelectionSection": "AvatarSelectionUIComponent-module__avatarSelectionSection_VjZ7cq__0260",
78
+ "avatarSelectionUi": "AvatarSelectionUIComponent-module__avatarSelectionUi_VjZ7cq__0260",
79
+ "avatarSelectionUiAvatar": "AvatarSelectionUIComponent-module__avatarSelectionUiAvatar_VjZ7cq__0260",
80
+ "avatarSelectionUiAvatarImage": "AvatarSelectionUIComponent-module__avatarSelectionUiAvatarImage_VjZ7cq__0260",
81
+ "avatarSelectionUiAvatarImgContainer": "AvatarSelectionUIComponent-module__avatarSelectionUiAvatarImgContainer_VjZ7cq__0260",
82
+ "avatarSelectionUiCloseButton": "AvatarSelectionUIComponent-module__avatarSelectionUiCloseButton_VjZ7cq__0260",
83
+ "avatarSelectionUiHeader": "AvatarSelectionUIComponent-module__avatarSelectionUiHeader_VjZ7cq__0260",
84
+ "closeButton": "AvatarSelectionUIComponent-module__closeButton_VjZ7cq__0260",
85
+ "customAvatarInputSection": "AvatarSelectionUIComponent-module__customAvatarInputSection_VjZ7cq__0260",
86
+ "customAvatarSection": "AvatarSelectionUIComponent-module__customAvatarSection_VjZ7cq__0260",
87
+ "displayNameInputSection": "AvatarSelectionUIComponent-module__displayNameInputSection_VjZ7cq__0260",
88
+ "displayNameSection": "AvatarSelectionUIComponent-module__displayNameSection_VjZ7cq__0260",
89
+ "input": "AvatarSelectionUIComponent-module__input_VjZ7cq__0260",
90
+ "menuButton": "AvatarSelectionUIComponent-module__menuButton_VjZ7cq__0260",
91
+ "openTab": "AvatarSelectionUIComponent-module__openTab_VjZ7cq__0260",
92
+ "radioGroup": "AvatarSelectionUIComponent-module__radioGroup_VjZ7cq__0260",
93
+ "radioItem": "AvatarSelectionUIComponent-module__radioItem_VjZ7cq__0260",
94
+ "sectionHeading": "AvatarSelectionUIComponent-module__sectionHeading_VjZ7cq__0260",
95
+ "selectedPill": "AvatarSelectionUIComponent-module__selectedPill_VjZ7cq__0260",
96
+ "setButton": "AvatarSelectionUIComponent-module__setButton_VjZ7cq__0260",
97
+ "tooltipText": "AvatarSelectionUIComponent-module__tooltipText_VjZ7cq__0260"
107
98
  }, {
108
99
  get: function(source, key) {
109
100
  inject();
@@ -464,8 +455,8 @@ import { forwardRef as forwardRef2, useImperativeHandle, useRef as useRef3, useS
464
455
  var PaperPlane_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M498.1 5.6c10.1 7 15.4 19.1 13.5 31.2l-64 416c-1.5 9.7-7.4 18.2-16 23s-18.9 5.4-28 1.6L284 427.7l-68.5 74.1c-8.9 9.7-22.9 12.9-35.2 8.1S160 493.2 160 480V396.4c0-4 1.5-7.8 4.2-10.7L331.8 202.8c5.8-6.3 5.6-16-.4-22s-15.7-6.4-22-.7L106 360.8 17.7 316.6C7.1 311.3 .3 300.7 0 288.9s5.9-22.8 16.1-28.7l448-256c10.7-6.1 23.9-5.5 34 1.4z"/></svg>';
465
456
 
466
457
  // esbuild-css-modules-plugin-ns-js::src/chat-ui/components/Input/InputBox.module.css:injector.js
467
- var content2 = globalThis['__css-content-15dcb6aa9b86b42829d2c24500b3f199__'];
468
- var digest2 = globalThis['__css-digest-15dcb6aa9b86b42829d2c24500b3f199__'];
458
+ var content2 = globalThis['__css-content-f6c39ca8d32b92c0b3e90804c6ccc949__'];
459
+ var digest2 = globalThis['__css-digest-f6c39ca8d32b92c0b3e90804c6ccc949__'];
469
460
  var inject2 = () => {
470
461
  setTimeout(() => {
471
462
  if (!globalThis.document) {
@@ -491,10 +482,10 @@ var inject2 = () => {
491
482
 
492
483
  // src/chat-ui/components/Input/InputBox.module.css
493
484
  var InputBox_default = new Proxy({
494
- "chatInput": "InputBox-module__chatInput_adOgOW__0242",
495
- "inputWrapper": "InputBox-module__inputWrapper_adOgOW__0242",
496
- "sendButton": "InputBox-module__sendButton_adOgOW__0242",
497
- "svgIcon": "InputBox-module__svgIcon_adOgOW__0242"
485
+ "chatInput": "InputBox-module__chatInput_adOgOW__0260",
486
+ "inputWrapper": "InputBox-module__inputWrapper_adOgOW__0260",
487
+ "sendButton": "InputBox-module__sendButton_adOgOW__0260",
488
+ "svgIcon": "InputBox-module__svgIcon_adOgOW__0260"
498
489
  }, {
499
490
  get: function(source, key) {
500
491
  inject2();
@@ -562,8 +553,8 @@ import { useEffect as useEffect3, useRef as useRef4, useState as useState4 } fro
562
553
  import { useState as useState3, useEffect as useEffect2, useCallback } from "react";
563
554
 
564
555
  // esbuild-css-modules-plugin-ns-js::src/chat-ui/components/Message/Message.module.css:injector.js
565
- var content3 = globalThis['__css-content-15dcb6aa9b86b42829d2c24500b3f199__'];
566
- var digest3 = globalThis['__css-digest-15dcb6aa9b86b42829d2c24500b3f199__'];
556
+ var content3 = globalThis['__css-content-f6c39ca8d32b92c0b3e90804c6ccc949__'];
557
+ var digest3 = globalThis['__css-digest-f6c39ca8d32b92c0b3e90804c6ccc949__'];
567
558
  var inject3 = () => {
568
559
  setTimeout(() => {
569
560
  if (!globalThis.document) {
@@ -589,8 +580,8 @@ var inject3 = () => {
589
580
 
590
581
  // src/chat-ui/components/Message/Message.module.css
591
582
  var Message_default = new Proxy({
592
- "messageContainer": "Message-module__messageContainer_ikOQiq__0242",
593
- "userName": "Message-module__userName_ikOQiq__0242"
583
+ "messageContainer": "Message-module__messageContainer_ikOQiq__0260",
584
+ "userName": "Message-module__userName_ikOQiq__0260"
594
585
  }, {
595
586
  get: function(source, key) {
596
587
  inject3();
@@ -646,8 +637,8 @@ var Message = ({ username, message, stringToHslOptions }) => {
646
637
  var Message_default2 = Message;
647
638
 
648
639
  // esbuild-css-modules-plugin-ns-js::src/chat-ui/components/Messages/Messages.module.css:injector.js
649
- var content4 = globalThis['__css-content-15dcb6aa9b86b42829d2c24500b3f199__'];
650
- var digest4 = globalThis['__css-digest-15dcb6aa9b86b42829d2c24500b3f199__'];
640
+ var content4 = globalThis['__css-content-f6c39ca8d32b92c0b3e90804c6ccc949__'];
641
+ var digest4 = globalThis['__css-digest-f6c39ca8d32b92c0b3e90804c6ccc949__'];
651
642
  var inject4 = () => {
652
643
  setTimeout(() => {
653
644
  if (!globalThis.document) {
@@ -673,8 +664,8 @@ var inject4 = () => {
673
664
 
674
665
  // src/chat-ui/components/Messages/Messages.module.css
675
666
  var Messages_default = new Proxy({
676
- "messagesContainer": "Messages-module__messagesContainer_LXaUUW__0242",
677
- "newMessagesButton": "Messages-module__newMessagesButton_LXaUUW__0242"
667
+ "messagesContainer": "Messages-module__messagesContainer_LXaUUW__0260",
668
+ "newMessagesButton": "Messages-module__newMessagesButton_LXaUUW__0260"
678
669
  }, {
679
670
  get: function(source, key) {
680
671
  inject4();
@@ -753,8 +744,8 @@ var Messages = ({ messages, stringToHslOptions, shouldAutoScroll }) => {
753
744
  };
754
745
 
755
746
  // esbuild-css-modules-plugin-ns-js::src/chat-ui/components/ChatPanel/TextChatUIComponent.module.css:injector.js
756
- var content5 = globalThis['__css-content-15dcb6aa9b86b42829d2c24500b3f199__'];
757
- var digest5 = globalThis['__css-digest-15dcb6aa9b86b42829d2c24500b3f199__'];
747
+ var content5 = globalThis['__css-content-f6c39ca8d32b92c0b3e90804c6ccc949__'];
748
+ var digest5 = globalThis['__css-digest-f6c39ca8d32b92c0b3e90804c6ccc949__'];
758
749
  var inject5 = () => {
759
750
  setTimeout(() => {
760
751
  if (!globalThis.document) {
@@ -780,18 +771,18 @@ var inject5 = () => {
780
771
 
781
772
  // src/chat-ui/components/ChatPanel/TextChatUIComponent.module.css
782
773
  var TextChatUIComponent_default = new Proxy({
783
- "closeButton": "TextChatUIComponent-module__closeButton_gFDdcW__0242",
784
- "controls": "TextChatUIComponent-module__controls_gFDdcW__0242",
785
- "fadeIn": "TextChatUIComponent-module__fadeIn_gFDdcW__0242",
786
- "fadeOut": "TextChatUIComponent-module__fadeOut_gFDdcW__0242",
787
- "messagesWrapper": "TextChatUIComponent-module__messagesWrapper_gFDdcW__0242",
788
- "openTab": "TextChatUIComponent-module__openTab_gFDdcW__0242",
789
- "stickyButton": "TextChatUIComponent-module__stickyButton_gFDdcW__0242",
790
- "stickyButtonEnabled": "TextChatUIComponent-module__stickyButtonEnabled_gFDdcW__0242",
791
- "stickyButtonFadeOut": "TextChatUIComponent-module__stickyButtonFadeOut_gFDdcW__0242",
792
- "textChat": "TextChatUIComponent-module__textChat_gFDdcW__0242",
793
- "textChatUi": "TextChatUIComponent-module__textChatUi_gFDdcW__0242",
794
- "uiHover": "TextChatUIComponent-module__uiHover_gFDdcW__0242"
774
+ "closeButton": "TextChatUIComponent-module__closeButton_gFDdcW__0260",
775
+ "controls": "TextChatUIComponent-module__controls_gFDdcW__0260",
776
+ "fadeIn": "TextChatUIComponent-module__fadeIn_gFDdcW__0260",
777
+ "fadeOut": "TextChatUIComponent-module__fadeOut_gFDdcW__0260",
778
+ "messagesWrapper": "TextChatUIComponent-module__messagesWrapper_gFDdcW__0260",
779
+ "openTab": "TextChatUIComponent-module__openTab_gFDdcW__0260",
780
+ "stickyButton": "TextChatUIComponent-module__stickyButton_gFDdcW__0260",
781
+ "stickyButtonEnabled": "TextChatUIComponent-module__stickyButtonEnabled_gFDdcW__0260",
782
+ "stickyButtonFadeOut": "TextChatUIComponent-module__stickyButtonFadeOut_gFDdcW__0260",
783
+ "textChat": "TextChatUIComponent-module__textChat_gFDdcW__0260",
784
+ "textChatUi": "TextChatUIComponent-module__textChatUi_gFDdcW__0260",
785
+ "uiHover": "TextChatUIComponent-module__uiHover_gFDdcW__0260"
795
786
  }, {
796
787
  get: function(source, key) {
797
788
  inject5();
@@ -1009,8 +1000,8 @@ var TextChatUI = class {
1009
1000
  };
1010
1001
 
1011
1002
  // esbuild-css-modules-plugin-ns-js::src/Networked3dWebExperience.module.css:injector.js
1012
- var content6 = globalThis['__css-content-15dcb6aa9b86b42829d2c24500b3f199__'];
1013
- var digest6 = globalThis['__css-digest-15dcb6aa9b86b42829d2c24500b3f199__'];
1003
+ var content6 = globalThis['__css-content-f6c39ca8d32b92c0b3e90804c6ccc949__'];
1004
+ var digest6 = globalThis['__css-digest-f6c39ca8d32b92c0b3e90804c6ccc949__'];
1014
1005
  var inject6 = () => {
1015
1006
  setTimeout(() => {
1016
1007
  if (!globalThis.document) {
@@ -1036,7 +1027,7 @@ var inject6 = () => {
1036
1027
 
1037
1028
  // src/Networked3dWebExperience.module.css
1038
1029
  var Networked3dWebExperience_default = new Proxy({
1039
- "respawnButton": "Networked3dWebExperience-module__respawnButton_7g9l0W__0242"
1030
+ "respawnButton": "Networked3dWebExperience-module__respawnButton_7g9l0W__0260"
1040
1031
  }, {
1041
1032
  get: function(source, key) {
1042
1033
  inject6();
@@ -1074,46 +1065,31 @@ var Networked3dWebExperienceClient = class {
1074
1065
  constructor(holderElement, config) {
1075
1066
  this.holderElement = holderElement;
1076
1067
  this.config = config;
1077
- var _a;
1078
1068
  this.element = document.createElement("div");
1079
1069
  this.element.style.position = "absolute";
1080
1070
  this.element.style.width = "100%";
1081
1071
  this.element.style.height = "100%";
1082
1072
  this.holderElement.appendChild(this.element);
1083
- document.addEventListener("mousedown", () => {
1084
- if (this.audioListener.context.state === "suspended") {
1085
- this.audioListener.context.resume();
1086
- }
1087
- });
1088
1073
  this.canvasHolder = document.createElement("div");
1089
1074
  this.canvasHolder.style.position = "absolute";
1090
1075
  this.canvasHolder.style.width = "100%";
1091
1076
  this.canvasHolder.style.height = "100%";
1092
1077
  this.element.appendChild(this.canvasHolder);
1093
- this.collisionsManager = new CollisionsManager(this.scene);
1078
+ this.collisionsManager = new CollisionsManager();
1094
1079
  this.cameraManager = new CameraManager(this.canvasHolder, this.collisionsManager);
1095
- this.scene.add(this.audioListener);
1096
- this.characterModelLoader = new CharacterModelLoader();
1097
1080
  this.virtualJoystick = new VirtualJoystick(this.element, {
1098
1081
  radius: 70,
1099
1082
  innerRadius: 20,
1100
1083
  mouseSupport: false
1101
1084
  });
1102
- this.composer = new Composer({
1103
- scene: this.scene,
1104
- cameraManager: this.cameraManager,
1105
- spawnSun: true,
1106
- environmentConfiguration: this.config.environmentConfiguration,
1107
- postProcessingEnabled: this.config.postProcessingEnabled
1108
- });
1109
- this.canvasHolder.appendChild(this.composer.renderer.domElement);
1110
- if (this.config.enableTweakPane !== false) {
1111
- this.setupTweakPane();
1112
- }
1113
- const resizeObserver = new ResizeObserver(() => {
1114
- this.composer.fitContainer();
1115
- });
1116
- resizeObserver.observe(this.element);
1085
+ this.tweakPane = new TweakPane(
1086
+ this.canvasHolder,
1087
+ {
1088
+ cameraValues: this.cameraValues,
1089
+ characterControllerValues: this.characterControllerValues
1090
+ },
1091
+ config.enableTweakPane ?? false
1092
+ );
1117
1093
  this.spawnConfiguration = normalizeSpawnConfiguration(this.config.spawnConfiguration);
1118
1094
  const spawnData = getSpawnData(this.spawnConfiguration, true);
1119
1095
  const spawnRotation = new Quat().setFromEulerXYZ(spawnData.spawnRotation);
@@ -1135,6 +1111,7 @@ var Networked3dWebExperienceClient = class {
1135
1111
  assignedIdentity: (clientId) => {
1136
1112
  console.log(`Assigned ID: ${clientId}`);
1137
1113
  this.clientId = clientId;
1114
+ this.characterManager.setLocalClientId(clientId);
1138
1115
  if (this.initialLoadCompleted) {
1139
1116
  const spawnData2 = getSpawnData(this.spawnConfiguration, true);
1140
1117
  this.spawnCharacter(spawnData2);
@@ -1162,13 +1139,13 @@ var Networked3dWebExperienceClient = class {
1162
1139
  }
1163
1140
  },
1164
1141
  onCustomMessage: (customType, contents) => {
1165
- var _a2, _b;
1142
+ var _a, _b;
1166
1143
  if (customType === SERVER_BROADCAST_MESSAGE_TYPE) {
1167
1144
  const serverBroadcastMessage = parseServerBroadcastMessage(contents);
1168
1145
  if (serverBroadcastMessage instanceof Error) {
1169
1146
  console.error(`Invalid server broadcast message: ${contents}`);
1170
1147
  } else {
1171
- (_b = (_a2 = this.config).onServerBroadcast) == null ? void 0 : _b.call(_a2, serverBroadcastMessage);
1148
+ (_b = (_a = this.config).onServerBroadcast) == null ? void 0 : _b.call(_a, serverBroadcastMessage);
1172
1149
  }
1173
1150
  } else if (customType === FROM_SERVER_CHAT_MESSAGE_TYPE) {
1174
1151
  const serverChatMessage = parseServerChatMessage(contents);
@@ -1200,44 +1177,33 @@ var Networked3dWebExperienceClient = class {
1200
1177
  this.keyInputManager.createKeyBinding(Key.C, () => {
1201
1178
  if (document.activeElement === document.body) {
1202
1179
  this.cameraManager.toggleFlyCamera();
1203
- this.composer.fitContainer();
1180
+ this.renderer.fitContainer();
1204
1181
  }
1205
1182
  });
1206
1183
  }
1207
- const animationsPromise = Character.loadAnimations(
1208
- this.characterModelLoader,
1209
- this.config.animationConfig
1210
- );
1211
1184
  this.characterManager = new CharacterManager({
1212
- composer: this.composer,
1213
- characterModelLoader: this.characterModelLoader,
1214
1185
  collisionsManager: this.collisionsManager,
1215
1186
  cameraManager: this.cameraManager,
1216
- timeManager: this.timeManager,
1217
1187
  keyInputManager: this.keyInputManager,
1218
1188
  virtualJoystick: this.virtualJoystick,
1219
1189
  remoteUserStates: this.remoteUserStates,
1220
1190
  sendUpdate: (characterState) => {
1221
- this.latestCharacterObject.characterState = characterState;
1222
1191
  this.networkClient.sendUpdate(characterState);
1223
1192
  },
1224
1193
  sendLocalCharacterColors: (colors) => {
1225
1194
  this.networkClient.updateColors(colors);
1226
1195
  },
1227
- animationsPromise,
1228
1196
  spawnConfiguration: this.spawnConfiguration,
1229
- characterResolve: (characterId) => {
1230
- return this.resolveCharacterData(characterId);
1197
+ characterControllerValues: this.characterControllerValues,
1198
+ characterResolve: (clientId) => {
1199
+ return this.resolveCharacterData(clientId);
1231
1200
  },
1232
1201
  updateURLLocation: this.config.updateURLLocation !== false
1233
1202
  });
1234
- this.scene.add(this.characterManager.group);
1235
1203
  if (this.spawnConfiguration.enableRespawnButton) {
1236
1204
  this.respawnButton = this.createRespawnButton();
1237
1205
  this.element.appendChild(this.respawnButton);
1238
1206
  }
1239
- this.setGroundPlaneEnabled(((_a = this.config.environmentConfiguration) == null ? void 0 : _a.groundPlane) ?? true);
1240
- this.setupMMLScene();
1241
1207
  this.loadingScreen = new LoadingScreen(this.loadingProgressManager, this.config.loadingScreen);
1242
1208
  this.element.append(this.loadingScreen.element);
1243
1209
  this.loadingProgressManager.addProgressCallback(() => {
@@ -1249,60 +1215,111 @@ var Networked3dWebExperienceClient = class {
1249
1215
  this.spawnCharacter(spawnData);
1250
1216
  }
1251
1217
  });
1252
- this.loadingProgressManager.setInitialLoad(true);
1218
+ registerCustomElementsToWindow(window);
1219
+ this.rendererConfig = {
1220
+ animationConfig: config.animationConfig,
1221
+ environmentConfiguration: config.environmentConfiguration,
1222
+ postProcessingEnabled: config.postProcessingEnabled,
1223
+ spawnSun: true,
1224
+ enableTweakPane: config.enableTweakPane
1225
+ };
1226
+ if (this.config.createRenderer) {
1227
+ this.renderer = this.config.createRenderer({
1228
+ targetElement: this.canvasHolder,
1229
+ coreCameraManager: this.cameraManager,
1230
+ collisionsManager: this.collisionsManager,
1231
+ config: this.rendererConfig,
1232
+ tweakPane: this.tweakPane,
1233
+ mmlTargetWindow: window,
1234
+ mmlTargetElement: document.body,
1235
+ loadingProgressManager: this.loadingProgressManager,
1236
+ mmlDocuments: this.config.mmlDocuments ?? {},
1237
+ mmlAuthToken: this.config.authToken ?? null,
1238
+ onInitialized: () => {
1239
+ this.loadingProgressManager.setInitialLoad(true);
1240
+ }
1241
+ });
1242
+ } else {
1243
+ this.renderer = new ThreeJSWorldRenderer({
1244
+ targetElement: this.canvasHolder,
1245
+ coreCameraManager: this.cameraManager,
1246
+ collisionsManager: this.collisionsManager,
1247
+ config: this.rendererConfig,
1248
+ tweakPane: this.tweakPane,
1249
+ mmlTargetWindow: window,
1250
+ mmlTargetElement: document.body,
1251
+ loadingProgressManager: this.loadingProgressManager,
1252
+ mmlDocuments: this.config.mmlDocuments ?? {},
1253
+ mmlAuthToken: this.config.authToken ?? null
1254
+ });
1255
+ this.loadingProgressManager.setInitialLoad(true);
1256
+ }
1257
+ if (this.characterManager.localController) {
1258
+ this.characterManager.setupTweakPane(this.tweakPane);
1259
+ }
1260
+ const resizeObserver = new ResizeObserver(() => {
1261
+ this.renderer.fitContainer();
1262
+ });
1263
+ resizeObserver.observe(this.element);
1253
1264
  }
1254
1265
  element;
1255
1266
  canvasHolder;
1256
- scene = new Scene();
1257
- composer;
1258
- tweakPane = null;
1259
- audioListener = new AudioListener();
1267
+ renderer;
1268
+ rendererConfig;
1260
1269
  cameraManager;
1261
1270
  collisionsManager;
1262
- characterModelLoader;
1263
1271
  characterManager;
1264
- timeManager = new TimeManager();
1265
1272
  keyInputManager = new KeyInputManager();
1266
1273
  virtualJoystick;
1267
- mmlCompositionScene;
1268
- mmlDocumentStates = {};
1269
1274
  clientId = null;
1270
1275
  networkClient;
1271
1276
  remoteUserStates = /* @__PURE__ */ new Map();
1272
1277
  userProfiles = /* @__PURE__ */ new Map();
1273
1278
  textChatUI = null;
1274
1279
  avatarSelectionUI = null;
1275
- latestCharacterObject = {
1276
- characterState: null
1277
- };
1278
- characterControllerPaneSet = false;
1280
+ tweakPane;
1279
1281
  spawnConfiguration;
1282
+ cameraValues = createDefaultCameraValues();
1283
+ characterControllerValues = createDefaultCharacterControllerValues();
1280
1284
  initialLoadCompleted = false;
1281
1285
  loadingProgressManager = new LoadingProgressManager();
1282
1286
  loadingScreen;
1283
1287
  errorScreen;
1284
- groundPlane = null;
1285
1288
  respawnButton = null;
1289
+ // Frame timing
1286
1290
  currentRequestAnimationFrame = null;
1287
- setGroundPlaneEnabled(enabled) {
1288
- if (enabled && this.groundPlane === null) {
1289
- this.groundPlane = new GroundPlane();
1290
- this.collisionsManager.addMeshesGroup(this.groundPlane);
1291
- this.scene.add(this.groundPlane);
1292
- } else if (!enabled && this.groundPlane !== null) {
1293
- this.collisionsManager.removeMeshesGroup(this.groundPlane);
1294
- this.scene.remove(this.groundPlane);
1295
- this.groundPlane = null;
1296
- }
1297
- }
1291
+ lastUpdateTimeMs = 0;
1292
+ frameCounter = 0;
1293
+ targetFPS = 60;
1294
+ frameInterval = 1e3 / this.targetFPS;
1295
+ epochFramesRendered = 0;
1296
+ epochStartTimeMs = 0;
1297
+ cachedCameraTransform = {
1298
+ position: new Vect3(),
1299
+ rotation: { x: 0, y: 0, z: 0 },
1300
+ fov: 0
1301
+ };
1298
1302
  updateConfig(config) {
1299
1303
  this.config = {
1300
1304
  ...this.config,
1301
1305
  ...config
1302
1306
  };
1303
- if (config.environmentConfiguration) {
1304
- this.composer.updateEnvironmentConfiguration(config.environmentConfiguration);
1305
- this.setGroundPlaneEnabled(config.environmentConfiguration.groundPlane ?? true);
1307
+ const rendererConfigUpdate = {};
1308
+ if (config.environmentConfiguration !== void 0) {
1309
+ rendererConfigUpdate.environmentConfiguration = config.environmentConfiguration;
1310
+ }
1311
+ if (config.postProcessingEnabled !== void 0) {
1312
+ rendererConfigUpdate.postProcessingEnabled = config.postProcessingEnabled;
1313
+ }
1314
+ if (config.enableTweakPane !== void 0) {
1315
+ rendererConfigUpdate.enableTweakPane = config.enableTweakPane;
1316
+ }
1317
+ if (Object.keys(rendererConfigUpdate).length > 0) {
1318
+ this.rendererConfig = {
1319
+ ...this.rendererConfig,
1320
+ ...rendererConfigUpdate
1321
+ };
1322
+ this.renderer.updateConfig(rendererConfigUpdate);
1306
1323
  }
1307
1324
  if (this.avatarSelectionUI) {
1308
1325
  if (config.avatarConfiguration) {
@@ -1310,22 +1327,6 @@ var Networked3dWebExperienceClient = class {
1310
1327
  }
1311
1328
  this.avatarSelectionUI.updateAllowCustomDisplayName(config.allowCustomDisplayName || false);
1312
1329
  }
1313
- if (config.enableTweakPane !== void 0) {
1314
- if (config.enableTweakPane === false && this.tweakPane !== null) {
1315
- this.tweakPane.dispose();
1316
- this.tweakPane = null;
1317
- } else if (config.enableTweakPane === true && this.tweakPane === null) {
1318
- this.setupTweakPane();
1319
- }
1320
- }
1321
- if (this.config.postProcessingEnabled !== void 0) {
1322
- this.composer.togglePostProcessing(this.config.postProcessingEnabled);
1323
- if (this.tweakPane) {
1324
- this.tweakPane.dispose();
1325
- this.tweakPane = null;
1326
- this.setupTweakPane();
1327
- }
1328
- }
1329
1330
  if (config.allowOrbitalCamera !== void 0) {
1330
1331
  if (config.allowOrbitalCamera === false) {
1331
1332
  this.keyInputManager.removeKeyBinding(Key.C);
@@ -1336,7 +1337,7 @@ var Networked3dWebExperienceClient = class {
1336
1337
  this.keyInputManager.createKeyBinding(Key.C, () => {
1337
1338
  if (document.activeElement === document.body) {
1338
1339
  this.cameraManager.toggleFlyCamera();
1339
- this.composer.fitContainer();
1340
+ this.renderer.fitContainer();
1340
1341
  }
1341
1342
  });
1342
1343
  }
@@ -1360,8 +1361,8 @@ var Networked3dWebExperienceClient = class {
1360
1361
  this.respawnButton.remove();
1361
1362
  this.respawnButton = null;
1362
1363
  }
1363
- if (config.mmlDocuments) {
1364
- this.setMMLDocuments(config.mmlDocuments);
1364
+ if (config.mmlDocuments !== void 0) {
1365
+ this.renderer.setMMLConfiguration(config.mmlDocuments, this.config.authToken ?? null);
1365
1366
  }
1366
1367
  }
1367
1368
  static createFullscreenHolder() {
@@ -1430,20 +1431,6 @@ var Networked3dWebExperienceClient = class {
1430
1431
  this.networkClient.updateUsername(displayName);
1431
1432
  this.networkClient.updateCharacterDescription(characterDescription);
1432
1433
  }
1433
- setupTweakPane() {
1434
- if (this.tweakPane) {
1435
- return;
1436
- }
1437
- this.tweakPane = new TweakPane(
1438
- this.element,
1439
- this.composer.renderer,
1440
- this.scene,
1441
- this.composer,
1442
- this.config.postProcessingEnabled
1443
- );
1444
- this.cameraManager.setupTweakPane(this.tweakPane);
1445
- this.composer.setupTweakPane(this.tweakPane);
1446
- }
1447
1434
  handleChatMessage(fromUserId, message) {
1448
1435
  if (this.textChatUI === null) {
1449
1436
  return;
@@ -1458,7 +1445,7 @@ var Networked3dWebExperienceClient = class {
1458
1445
  }
1459
1446
  const username = user.username ?? `Unknown User ${fromUserId}`;
1460
1447
  this.textChatUI.addTextMessage(username, message);
1461
- this.characterManager.addChatBubble(fromUserId, message);
1448
+ this.renderer.addChatBubble(fromUserId, message);
1462
1449
  }
1463
1450
  }
1464
1451
  connectToTextChat() {
@@ -1473,8 +1460,7 @@ var Networked3dWebExperienceClient = class {
1473
1460
  const textChatUISettings = {
1474
1461
  holderElement: this.canvasHolder,
1475
1462
  sendMessageToServerMethod: (message) => {
1476
- this.characterManager.addSelfChatBubble(message);
1477
- this.mmlCompositionScene.onChatMessage(message);
1463
+ this.renderer.onChatMessage(message);
1478
1464
  this.networkClient.sendCustomMessage(
1479
1465
  FROM_CLIENT_CHAT_MESSAGE_TYPE,
1480
1466
  JSON.stringify({ message })
@@ -1511,44 +1497,60 @@ var Networked3dWebExperienceClient = class {
1511
1497
  this.avatarSelectionUI.init();
1512
1498
  }
1513
1499
  update() {
1514
- var _a, _b, _c;
1515
- this.timeManager.update();
1516
- this.characterManager.update();
1517
- this.cameraManager.update();
1518
- this.updateAudioListenerPosition();
1519
- const characterPosition = (_a = this.characterManager.localCharacter) == null ? void 0 : _a.getPosition();
1520
- (_b = this.composer.sun) == null ? void 0 : _b.updateCharacterPosition(
1521
- new Vector3((characterPosition == null ? void 0 : characterPosition.x) || 0, (characterPosition == null ? void 0 : characterPosition.y) || 0, (characterPosition == null ? void 0 : characterPosition.z) || 0)
1522
- );
1523
- this.composer.render(this.timeManager);
1524
- if ((_c = this.tweakPane) == null ? void 0 : _c.guiVisible) {
1525
- this.tweakPane.updateStats(this.timeManager);
1526
- this.tweakPane.updateCameraData(this.cameraManager);
1527
- if (this.characterManager.localCharacter && this.characterManager.localController) {
1528
- if (!this.characterControllerPaneSet) {
1529
- this.characterControllerPaneSet = true;
1530
- this.characterManager.setupTweakPane(this.tweakPane);
1531
- } else {
1532
- this.tweakPane.updateCharacterData(this.characterManager.localController);
1533
- }
1534
- }
1500
+ const currentTimeMs = performance.now();
1501
+ const elapsedMs = currentTimeMs - this.lastUpdateTimeMs;
1502
+ let deltaTimeSeconds = elapsedMs / 1e3;
1503
+ if (deltaTimeSeconds > 0.1) {
1504
+ deltaTimeSeconds = 0.1;
1535
1505
  }
1536
1506
  this.currentRequestAnimationFrame = requestAnimationFrame(() => {
1537
1507
  this.update();
1538
1508
  });
1539
- }
1540
- updateAudioListenerPosition() {
1541
- const localCharacter = this.characterManager.localCharacter;
1542
- const headWorldPosition = localCharacter == null ? void 0 : localCharacter.getHeadWorldPosition();
1543
- if (headWorldPosition) {
1544
- this.audioListener.position.copy(headWorldPosition);
1545
- this.audioListener.rotation.copy(this.cameraManager.camera.rotation);
1546
- this.audioListener.updateMatrixWorld();
1547
- } else {
1548
- this.audioListener.position.copy(this.cameraManager.camera.position);
1549
- this.audioListener.rotation.copy(this.cameraManager.camera.rotation);
1550
- this.audioListener.updateMatrixWorld();
1509
+ if (this.epochStartTimeMs === 0) {
1510
+ this.epochStartTimeMs = currentTimeMs;
1511
+ }
1512
+ const timeSinceEpochStartMs = currentTimeMs - this.epochStartTimeMs;
1513
+ const idealFramesRendered = timeSinceEpochStartMs / this.frameInterval;
1514
+ const deltaFrames = this.epochFramesRendered - idealFramesRendered;
1515
+ if (deltaFrames > 0) {
1516
+ return;
1517
+ }
1518
+ if (timeSinceEpochStartMs > 1e3) {
1519
+ this.epochStartTimeMs = currentTimeMs;
1520
+ this.epochFramesRendered = 0;
1551
1521
  }
1522
+ this.epochFramesRendered++;
1523
+ this.lastUpdateTimeMs = currentTimeMs;
1524
+ this.frameCounter++;
1525
+ const { updatedCharacterDescriptions, removedUserIds } = this.characterManager.update(
1526
+ deltaTimeSeconds,
1527
+ this.frameCounter
1528
+ );
1529
+ this.cameraManager.update();
1530
+ if (this.tweakPane.guiVisible && this.characterManager.localController) {
1531
+ this.tweakPane.updateCharacterData(this.characterManager.localController);
1532
+ }
1533
+ const allCharacterStates = this.characterManager.getAllCharacterStates();
1534
+ const cameraState = this.cameraManager.getCameraState();
1535
+ const cameraRotation = new EulXYZ().setFromQuaternion(cameraState.rotation);
1536
+ this.cachedCameraTransform.position.set(
1537
+ cameraState.position.x,
1538
+ cameraState.position.y,
1539
+ cameraState.position.z
1540
+ );
1541
+ this.cachedCameraTransform.rotation.x = cameraRotation.x;
1542
+ this.cachedCameraTransform.rotation.y = cameraRotation.y;
1543
+ this.cachedCameraTransform.rotation.z = cameraRotation.z;
1544
+ this.cachedCameraTransform.fov = cameraState.fov;
1545
+ const renderState = {
1546
+ characters: allCharacterStates,
1547
+ updatedCharacterDescriptions,
1548
+ removedUserIds,
1549
+ cameraTransform: this.cachedCameraTransform,
1550
+ localCharacterId: this.characterManager.getLocalClientId(),
1551
+ deltaTimeSeconds
1552
+ };
1553
+ this.renderer.render(renderState);
1552
1554
  }
1553
1555
  spawnCharacter({
1554
1556
  spawnPosition,
@@ -1562,19 +1564,14 @@ var Networked3dWebExperienceClient = class {
1562
1564
  if (!ownIdentity) {
1563
1565
  throw new Error("Own identity not found");
1564
1566
  }
1565
- this.characterManager.spawnLocalCharacter(
1566
- this.clientId,
1567
- ownIdentity.username ?? `Unknown User ${this.clientId}`,
1568
- ownIdentity.characterDescription,
1569
- spawnPosition,
1570
- spawnRotation
1571
- );
1567
+ this.characterManager.spawnLocalCharacter(this.clientId, spawnPosition, spawnRotation);
1568
+ this.characterManager.setupTweakPane(this.tweakPane);
1572
1569
  if (cameraPosition !== null) {
1573
- this.cameraManager.camera.position.set(cameraPosition.x, cameraPosition.y, cameraPosition.z);
1574
- this.cameraManager.setTarget(
1575
- new Vect3().add(spawnPosition).add(CharacterManager.headTargetOffset)
1576
- );
1577
- this.cameraManager.reverseUpdateFromPositions();
1570
+ const cameraState = this.cameraManager.getMainCameraState();
1571
+ cameraState.position.set(cameraPosition.x, cameraPosition.y, cameraPosition.z);
1572
+ const target = new Vect3().add(spawnPosition).add(CharacterManager.headTargetOffset);
1573
+ this.cameraManager.setTarget(target);
1574
+ this.cameraManager.reverseUpdateFromPositions(cameraState.position, cameraState.rotation);
1578
1575
  }
1579
1576
  }
1580
1577
  disposeWithError(message) {
@@ -1583,131 +1580,19 @@ var Networked3dWebExperienceClient = class {
1583
1580
  this.element.append(this.errorScreen.element);
1584
1581
  }
1585
1582
  dispose() {
1586
- var _a, _b, _c;
1583
+ var _a, _b;
1587
1584
  this.characterManager.dispose();
1588
1585
  this.networkClient.stop();
1589
- for (const mmlDocumentState of Object.values(this.mmlDocumentStates)) {
1590
- mmlDocumentState.dispose();
1591
- }
1592
- this.mmlDocumentStates = {};
1593
1586
  (_a = this.textChatUI) == null ? void 0 : _a.dispose();
1594
- this.mmlCompositionScene.dispose();
1595
- this.composer.dispose();
1596
- (_b = this.tweakPane) == null ? void 0 : _b.dispose();
1587
+ this.tweakPane.dispose();
1588
+ this.renderer.dispose();
1597
1589
  if (this.currentRequestAnimationFrame !== null) {
1598
1590
  cancelAnimationFrame(this.currentRequestAnimationFrame);
1599
1591
  this.currentRequestAnimationFrame = null;
1600
1592
  }
1601
1593
  this.cameraManager.dispose();
1602
1594
  this.loadingScreen.dispose();
1603
- (_c = this.errorScreen) == null ? void 0 : _c.dispose();
1604
- }
1605
- setupMMLScene() {
1606
- registerCustomElementsToWindow(window);
1607
- this.mmlCompositionScene = new MMLCompositionScene({
1608
- targetElement: this.element,
1609
- renderer: this.composer.renderer,
1610
- scene: this.scene,
1611
- camera: this.cameraManager.camera,
1612
- audioListener: this.audioListener,
1613
- collisionsManager: this.collisionsManager,
1614
- getUserPositionAndRotation: () => {
1615
- return this.characterManager.getLocalCharacterPositionAndRotation();
1616
- }
1617
- });
1618
- this.scene.add(this.mmlCompositionScene.group);
1619
- setGlobalMMLScene(this.mmlCompositionScene.mmlScene);
1620
- setGlobalDocumentTimeManager(this.mmlCompositionScene.documentTimeManager);
1621
- this.setMMLDocuments(this.config.mmlDocuments ?? {});
1622
- const mmlProgressManager = this.mmlCompositionScene.mmlScene.getLoadingProgressManager();
1623
- this.loadingProgressManager.addLoadingDocument(mmlProgressManager, "mml", mmlProgressManager);
1624
- mmlProgressManager.addProgressCallback(() => {
1625
- this.loadingProgressManager.updateDocumentProgress(mmlProgressManager);
1626
- });
1627
- mmlProgressManager.setInitialLoad(true);
1628
- }
1629
- createMMLDocument(mmlDocConfig) {
1630
- const mmlScene = this.mmlCompositionScene.mmlScene;
1631
- const loadingProgressManager = new LoadingProgressManager();
1632
- const docRef = {};
1633
- const mmlNetworkSource = MMLNetworkSource.create({
1634
- url: MMLNetworkSource.resolveRelativeUrl(window.location.host, mmlDocConfig.url),
1635
- connectionToken: mmlDocConfig.passAuthToken ? this.config.authToken ?? null : null,
1636
- mmlScene,
1637
- statusUpdated: (status) => {
1638
- },
1639
- windowTarget: window,
1640
- targetForWrappers: document.body
1641
- });
1642
- this.updateMMLDocumentAttributes(mmlNetworkSource, mmlDocConfig);
1643
- return {
1644
- docRef,
1645
- loadingProgressManager,
1646
- config: mmlDocConfig,
1647
- source: mmlNetworkSource,
1648
- dispose: () => {
1649
- mmlNetworkSource.dispose();
1650
- }
1651
- };
1652
- }
1653
- updateMMLDocumentAttributes(mmlNetworkSource, mmlDocument) {
1654
- var _a, _b, _c;
1655
- const remoteDocument = mmlNetworkSource.remoteDocumentWrapper.remoteDocument;
1656
- if (mmlDocument.position) {
1657
- remoteDocument.setAttribute("x", mmlDocument.position.x.toString());
1658
- remoteDocument.setAttribute("y", mmlDocument.position.y.toString());
1659
- remoteDocument.setAttribute("z", mmlDocument.position.z.toString());
1660
- } else {
1661
- remoteDocument.setAttribute("x", "0");
1662
- remoteDocument.setAttribute("y", "0");
1663
- remoteDocument.setAttribute("z", "0");
1664
- }
1665
- if (mmlDocument.rotation) {
1666
- remoteDocument.setAttribute("rx", mmlDocument.rotation.x.toString());
1667
- remoteDocument.setAttribute("ry", mmlDocument.rotation.y.toString());
1668
- remoteDocument.setAttribute("rz", mmlDocument.rotation.z.toString());
1669
- } else {
1670
- remoteDocument.setAttribute("rx", "0");
1671
- remoteDocument.setAttribute("ry", "0");
1672
- remoteDocument.setAttribute("rz", "0");
1673
- }
1674
- if (((_a = mmlDocument.scale) == null ? void 0 : _a.x) !== void 0) {
1675
- remoteDocument.setAttribute("sx", mmlDocument.scale.x.toString());
1676
- } else {
1677
- remoteDocument.setAttribute("sx", "1");
1678
- }
1679
- if (((_b = mmlDocument.scale) == null ? void 0 : _b.y) !== void 0) {
1680
- remoteDocument.setAttribute("sy", mmlDocument.scale.y.toString());
1681
- } else {
1682
- remoteDocument.setAttribute("sy", "1");
1683
- }
1684
- if (((_c = mmlDocument.scale) == null ? void 0 : _c.z) !== void 0) {
1685
- remoteDocument.setAttribute("sz", mmlDocument.scale.z.toString());
1686
- } else {
1687
- remoteDocument.setAttribute("sz", "1");
1688
- }
1689
- return mmlNetworkSource;
1690
- }
1691
- setMMLDocuments(mmlDocuments) {
1692
- const newMMLDocuments = {};
1693
- for (const [key, mmlDocConfig] of Object.entries(mmlDocuments)) {
1694
- let existing = this.mmlDocumentStates[key];
1695
- if (existing && (existing.config.url !== mmlDocConfig.url || existing.config.passAuthToken !== mmlDocConfig.passAuthToken)) {
1696
- existing.dispose();
1697
- existing = void 0;
1698
- }
1699
- if (!existing) {
1700
- newMMLDocuments[key] = this.createMMLDocument(mmlDocConfig);
1701
- } else {
1702
- delete this.mmlDocumentStates[key];
1703
- this.updateMMLDocumentAttributes(existing.source, mmlDocConfig);
1704
- newMMLDocuments[key] = existing;
1705
- }
1706
- }
1707
- for (const element of Object.values(this.mmlDocumentStates)) {
1708
- element.dispose();
1709
- }
1710
- this.mmlDocumentStates = newMMLDocuments;
1595
+ (_b = this.errorScreen) == null ? void 0 : _b.dispose();
1711
1596
  }
1712
1597
  };
1713
1598
  export {