@tomorrowevening/hermes 0.0.4 → 0.0.5

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.
@@ -1,4 +1,4 @@
1
- (function(O,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("three"),require("@theatre/core"),require("tweakpane"),require("@tweakpane/plugin-essentials"),require("react"),require("framer-motion"),require("@theatre/studio")):typeof define=="function"&&define.amd?define(["exports","three","@theatre/core","tweakpane","@tweakpane/plugin-essentials","react","framer-motion","@theatre/studio"],d):(O=typeof globalThis<"u"?globalThis:O||self,d(O.Hermes={},O.Three,O["Theatre Core"],O.tweakpane,O["tweakpane-plugin-essentials"],O.React,O["framer-motion"],O["Theatre Studio"]))})(this,function(O,d,pe,Ht,Wt,I,wt,_e){"use strict";var Vn=Object.defineProperty;var Gn=(O,d,pe)=>d in O?Vn(O,d,{enumerable:!0,configurable:!0,writable:!0,value:pe}):O[d]=pe;var z=(O,d,pe)=>(Gn(O,typeof d!="symbol"?d+"":d,pe),pe);function Kt(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const e=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(n,i,e.get?e:{enumerable:!0,get:()=>t[i]})}}return n.default=t,Object.freeze(n)}const Xt=Kt(Wt);class Zt{constructor(n,i,e){z(this,"channel");z(this,"components",new Map);z(this,"_mode","app");this.editor=i&&document.location.hash.search(e)>-1,i&&(this.channel=new BroadcastChannel(n))}addComponent(n,i){this.components.set(n,i)}dispose(){this.components.forEach(n=>{n.dispose()}),this.components.clear()}send(n){this.channel!==void 0&&this._mode!==n.target&&this.channel.postMessage(n)}listen(n){this.channel!==void 0&&(this.channel.onmessage=i=>{n(i.data)})}get mode(){return this._mode}get editor(){return this._mode==="editor"}set editor(n){n&&(this._mode="editor",document.title+=" - Editor")}}const L=new d.EventDispatcher,U={CUSTOM:"ToolEvents::custom",SELECT_DROPDOWN:"ToolEvents::selectDropdown",DRAG_UPDATE:"ToolEvents::dragUpdate",GET_SCENE:"ToolEvents::getScene",SET_SCENE:"ToolEvents::setScene",GET_OBJECT:"ToolEvents::getObject",SET_OBJECT:"ToolEvents::setObject",UPDATE_OBJECT:"ToolEvents::updateObject",CREATE_TEXTURE:"ToolEvents::createTexture",REQUEST_METHOD:"ToolEvents::requestMethod"};class Ae{constructor(n){z(this,"app");this.app=n}dispose(){}}class Jt extends Ae{selectDropdown(n,i){this.app.send({event:"selectComponent",target:"app",data:{dropdown:n,value:i}})}updateDropdown(n,i){this.app.send({event:"draggableListUpdate",target:"app",data:{dropdown:n,value:i}})}}function Qt(){return Math.round(Math.random()*1e6).toString()}function qt(t){return t.r!==void 0&&t.g!==void 0&&t.b!==void 0}function $t(t){const n=Math.round(t.r*255),i=Math.round(t.g*255),e=Math.round(t.b*255),r=c=>{const h=c.toString(16);return h.length===1?"0"+h:h},l=r(n),m=r(i),s=r(e);return"#"+l+m+s}const Ct=()=>{};class en extends Ae{constructor(i,e,r){super(i);z(this,"project");z(this,"sheets");z(this,"sheetObjects");z(this,"sheetObjectCBs");z(this,"sheetObjectUnsubscribe");this.project=pe.getProject(e,r),this.sheets=new Map,this.sheetObjects=new Map,this.sheetObjectCBs=new Map,this.sheetObjectUnsubscribe=new Map}dispose(){this.project=void 0,this.sheets=new Map,this.sheetObjects=new Map,this.sheetObjectCBs=new Map,this.sheetObjectUnsubscribe=new Map}sheet(i){var r;if(this.project===void 0){console.error("Theatre Project hasn't been created yet.");return}let e=this.sheets.get(i);return e!==void 0||(e=(r=this.project)==null?void 0:r.sheet(i),this.sheets.set(i,e)),e}sheetObject(i,e,r,l){if(this.project===void 0){console.error("Theatre Project hasn't been created yet.");return}const m=this.sheets.get(i);if(m===void 0)return;const s=`${i}_${e}`;let c=this.sheetObjects.get(s);if(c!==void 0)return c=m.object(e,{...r,...c.value},{reconfigure:!0}),c;c=m.object(e,r),this.sheetObjects.set(s,c),this.sheetObjectCBs.set(s,l!==void 0?l:Ct);const h=c.onValuesChange(p=>{if(this.app.editor){for(const g in p){const w=p[g];typeof w=="object"&&qt(w)&&(p[g]={r:w.r,g:w.g,b:w.b,a:w.a})}this.app.send({event:"updateSheetObject",target:"app",data:{sheetObject:s,values:p}})}else{const g=this.sheetObjectCBs.get(s);g!==void 0&&g(p)}});return this.sheetObjectUnsubscribe.set(s,h),c}unsubscribe(i){if(this.project===void 0){console.error("Theatre Project hasn't been created yet.");return}const e=`${i.address.sheetId}_${i.address.objectKey}`,r=this.sheetObjectUnsubscribe.get(e);r!==void 0&&r()}}function tn(t){if(t.name==="cameras")return"camera";if(t.name==="interactive")return"interactive";if(t.name==="lights")return"light";if(t.name==="ui")return"ui";if(t.name==="utils")return"utils";const n=t.type;return n.search("Helper")>-1?"icon_utils":n.search("Camera")>-1?"camera":n.search("Light")>-1?"light":"obj3D"}function St(t){const n={name:t.name,type:t.type,uuid:t.uuid,children:[]};return t.children.forEach(i=>{n.children.push(St(i))}),n}function nn(t){const n={};for(const i in t){const e=t[i].value;n[i]={value:e},e===null?n[i].value={src:""}:e.isTexture&&(n[i].value={src:e.image.src})}return n}function an(t){switch(t){case"blendSrcAlpha":case"blendDstAlpha":case"blendEquationAlpha":case"clippingPlanes":case"shadowSide":case"precision":return!0}return!1}function Ot(t){const n={};for(const i in t){if(i.substring(0,1)==="_"||i.substring(0,2)==="is"||an(i))continue;const e=typeof t[i],r=t[i];switch(e){case"boolean":case"number":case"string":n[i]=r;break;case"object":if(r!==null)if(n[i]=r,r.isTexture)if(r instanceof d.Texture){const l=r.source.toJSON();n[i]={src:l.url}}else r instanceof d.CubeTexture&&(console.log("env map"),console.log(r.source.data),console.log(r.source.toJSON()),n[i]={src:""});else i==="uniforms"&&(n[i]=nn(n[i]));else n[i]={src:""};break}}return n}function rn(t){t.updateMatrix();const n={name:t.name,type:t.type,uuid:t.uuid,visible:t.visible,matrix:t.matrix.elements};if(t instanceof d.Mesh){const i=t;if(Array.isArray(i.material)){const e=[];i.material.forEach(r=>{e.push(Ot(r))}),n.material=e}else n.material=Ot(i.material)}else t instanceof d.Camera?t instanceof d.PerspectiveCamera?n.perspectiveCameraInfo={fov:t.fov,zoom:t.zoom,near:t.near,far:t.far,focus:t.focus,aspect:t.aspect,filmGauge:t.filmGauge,filmOffset:t.filmOffset}:t instanceof d.OrthographicCamera&&(n.orthographicCameraInfo={zoom:t.zoom,near:t.near,far:t.far,left:t.left,right:t.right,top:t.top,bottom:t.bottom}):t instanceof d.Light&&(n.lightInfo={color:t.color,intensity:t.intensity,decay:t.decay,distance:t.distance,angle:t.angle,penumbra:t.penumbra,groundColor:t.groundColor});return n}function $(t,n,i){const e=n.split(".");switch(e.length){case 1:t[e[0]]=i;break;case 2:t[e[0]][e[1]]=i;break;case 3:t[e[0]][e[1]][e[2]]=i;break;case 4:t[e[0]][e[1]][e[2]][e[3]]=i;break;case 5:t[e[0]][e[1]][e[2]][e[3]][e[4]]=i;break}}function lt(t){return new Promise((n,i)=>{const e=new Image;e.onload=()=>{const r=new d.Texture(e);r.wrapS=d.RepeatWrapping,r.wrapT=d.RepeatWrapping,r.needsUpdate=!0,n(r)},e.onerror=i,e.src=t})}class on extends Ae{constructor(){super(...arguments);z(this,"scene")}getObject(i){this.app.send({event:"getObject",target:"app",data:i})}setObject(i){const e=rn(i);this.app.send({event:"setObject",target:"editor",data:e})}requestMethod(i,e,r){this.app.send({event:"requestMethod",target:"app",data:{uuid:i,key:e,value:r}})}updateObject(i,e,r){this.app.send({event:"updateObject",target:"app",data:{uuid:i,key:e,value:r}})}createTexture(i,e,r){this.app.send({event:"createTexture",target:"app",data:{uuid:i,key:e,value:r}})}getScene(){this.app.send({event:"getScene",target:"app"})}setScene(i){this.scene=i;const e=St(i);this.app.send({event:"setScene",target:"editor",data:e})}}class sn extends Ae{constructor(i){super(i);z(this,"bindCBs");z(this,"buttonCBs");z(this,"pane");z(this,"appCallbacks",0);z(this,"editorCallbacks",0);z(this,"inspectorFolder");this.bindCBs=new Map,this.buttonCBs=new Map,i.editor&&this.createGUI()}createGUI(){this.pane=new Ht.Pane({title:"GUI"}),this.pane.registerPlugin(Xt)}dispose(){var i;this.bindCBs.clear(),this.buttonCBs.clear(),this.appCallbacks=0,this.editorCallbacks=0,this.app.editor&&((i=this.pane)==null||i.dispose(),this.pane=void 0)}addFolder(i,e=void 0,r=void 0){if(this.app.editor)return this.pane===void 0&&this.createGUI(),(r!==void 0?r:this.pane).addFolder({title:i,...e});this.app.send({event:"addFolder",target:"app",data:{name:i,params:e,parent:r}})}get bindID(){return`debug_${Math.max(this.appCallbacks,this.editorCallbacks)}`}bind(i,e,r,l=void 0){const m=this.bindID,s=r.onChange!==void 0?r.onChange:Ct;this.bindCBs.set(m,s),this.app.editor?(this.pane===void 0&&this.createGUI(),(l!==void 0?l:this.pane).addBinding(i,e,r).on("change",h=>{this.app.send({event:"updateBind",target:"app",data:{id:m,value:h.value}})}),this.editorCallbacks++):(this.app.send({event:"bindObject",target:"app",data:{id:m,name:e,params:r,parent:l}}),this.appCallbacks++)}triggerBind(i,e){const r=this.bindCBs.get(i);r!==void 0?r(e):console.warn(`No callback for: ${i}`,e)}button(i,e,r=void 0){const l=this.bindID;this.buttonCBs.set(l,e),this.app.editor?(this.pane===void 0&&this.createGUI(),(r!==void 0?r:this.pane).addButton({title:i}).on("click",()=>{this.app.send({event:"clickButton",target:"app",data:{id:l}})}),this.editorCallbacks++):(this.app.send({event:"addButton",target:"app",data:{id:l,name:i,callback:e,parent:r}}),this.appCallbacks++)}triggerButton(i){const e=this.buttonCBs.get(i);e!==void 0&&e()}createInspector(){this.inspectorFolder=this.addFolder("Inspector",this.pane)}clearInspector(){const i=this.inspectorFolder.children.length-1;for(let e=i;e>-1;--e)this.inspectorFolder.remove(this.inspectorFolder.children[e])}}var ut={exports:{}},Ie={};/**
1
+ (function(S,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("three"),require("@theatre/core"),require("tweakpane"),require("@tweakpane/plugin-essentials"),require("react"),require("framer-motion"),require("@theatre/studio")):typeof define=="function"&&define.amd?define(["exports","three","@theatre/core","tweakpane","@tweakpane/plugin-essentials","react","framer-motion","@theatre/studio"],f):(S=typeof globalThis<"u"?globalThis:S||self,f(S.Hermes={},S.Three,S["Theatre Core"],S.tweakpane,S["tweakpane-plugin-essentials"],S.React,S["framer-motion"],S["Theatre Studio"]))})(this,function(S,f,pe,Jt,Qt,A,Ct,_e){"use strict";var Hn=Object.defineProperty;var Wn=(S,f,pe)=>f in S?Hn(S,f,{enumerable:!0,configurable:!0,writable:!0,value:pe}):S[f]=pe;var z=(S,f,pe)=>(Wn(S,typeof f!="symbol"?f+"":f,pe),pe);function qt(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const e=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(n,i,e.get?e:{enumerable:!0,get:()=>t[i]})}}return n.default=t,Object.freeze(n)}const $t=qt(Qt);function en(t,n,i){return Math.min(n,Math.max(t,i))}function tn(t,n){const i=t-n;return Math.sqrt(i*i)}function St(){return Math.round(Math.random()*1e6).toString()}function Ot(t){return t.r!==void 0&&t.g!==void 0&&t.b!==void 0}function Tt(t){const n=Math.round(t.r*255),i=Math.round(t.g*255),e=Math.round(t.b*255),r=u=>{const m=u.toString(16);return m.length===1?"0"+m:m},l=r(n),c=r(i),s=r(e);return"#"+l+c+s}let xt=0;const lt=t=>{if(!t)return;let n=t.name.replace(" ","");n.length===0&&(n=`obj_${xt}`),t.parent!==null&&(n=`${t.parent.uuid}.${n}`),t.uuid=n,xt++,t.children.forEach(i=>{lt(i)})};class nn{constructor(n,i,e){z(this,"channel");z(this,"components",new Map);z(this,"_mode","app");this.editor=i&&document.location.hash.search(e)>-1,i&&(this.channel=new BroadcastChannel(n))}addComponent(n,i){this.components.set(n,i)}dispose(){this.components.forEach(n=>{n.dispose()}),this.components.clear()}send(n){this.channel!==void 0&&this._mode!==n.target&&this.channel.postMessage(n)}listen(n){this.channel!==void 0&&(this.channel.onmessage=i=>{n(i.data)})}get mode(){return this._mode}get editor(){return this._mode==="editor"}set editor(n){n&&(this._mode="editor",document.title+=" - Editor")}}const L=new f.EventDispatcher,U={CUSTOM:"ToolEvents::custom",SELECT_DROPDOWN:"ToolEvents::selectDropdown",DRAG_UPDATE:"ToolEvents::dragUpdate",GET_SCENE:"ToolEvents::getScene",SET_SCENE:"ToolEvents::setScene",GET_OBJECT:"ToolEvents::getObject",SET_OBJECT:"ToolEvents::setObject",UPDATE_OBJECT:"ToolEvents::updateObject",CREATE_TEXTURE:"ToolEvents::createTexture",REQUEST_METHOD:"ToolEvents::requestMethod"};class Ae{constructor(n){z(this,"app");this.app=n}dispose(){}}class an extends Ae{selectDropdown(n,i){this.app.send({event:"selectComponent",target:"app",data:{dropdown:n,value:i}})}updateDropdown(n,i){this.app.send({event:"draggableListUpdate",target:"app",data:{dropdown:n,value:i}})}}const Rt=()=>{};class rn extends Ae{constructor(i,e,r){super(i);z(this,"project");z(this,"sheets");z(this,"sheetObjects");z(this,"sheetObjectCBs");z(this,"sheetObjectUnsubscribe");this.project=pe.getProject(e,r),this.sheets=new Map,this.sheetObjects=new Map,this.sheetObjectCBs=new Map,this.sheetObjectUnsubscribe=new Map}dispose(){this.project=void 0,this.sheets=new Map,this.sheetObjects=new Map,this.sheetObjectCBs=new Map,this.sheetObjectUnsubscribe=new Map}sheet(i){var r;if(this.project===void 0){console.error("Theatre Project hasn't been created yet.");return}let e=this.sheets.get(i);return e!==void 0||(e=(r=this.project)==null?void 0:r.sheet(i),this.sheets.set(i,e)),e}sheetObject(i,e,r,l){if(this.project===void 0){console.error("Theatre Project hasn't been created yet.");return}const c=this.sheets.get(i);if(c===void 0)return;const s=`${i}_${e}`;let u=this.sheetObjects.get(s);if(u!==void 0)return u=c.object(e,{...r,...u.value},{reconfigure:!0}),u;u=c.object(e,r),this.sheetObjects.set(s,u),this.sheetObjectCBs.set(s,l!==void 0?l:Rt);const m=u.onValuesChange(p=>{if(this.app.editor){for(const v in p){const w=p[v];typeof w=="object"&&Ot(w)&&(p[v]={r:w.r,g:w.g,b:w.b,a:w.a})}this.app.send({event:"updateSheetObject",target:"app",data:{sheetObject:s,values:p}})}else{const v=this.sheetObjectCBs.get(s);v!==void 0&&v(p)}});return this.sheetObjectUnsubscribe.set(s,m),u}unsubscribe(i){if(this.project===void 0){console.error("Theatre Project hasn't been created yet.");return}const e=`${i.address.sheetId}_${i.address.objectKey}`,r=this.sheetObjectUnsubscribe.get(e);r!==void 0&&r()}}function on(t){if(t.name==="cameras")return"camera";if(t.name==="interactive")return"interactive";if(t.name==="lights")return"light";if(t.name==="ui")return"ui";if(t.name==="utils")return"utils";const n=t.type;return n.search("Helper")>-1?"icon_utils":n.search("Camera")>-1?"camera":n.search("Light")>-1?"light":"obj3D"}function Pt(t){const n={name:t.name,type:t.type,uuid:t.uuid,children:[]};return t.children.forEach(i=>{n.children.push(Pt(i))}),n}function sn(t){const n={};for(const i in t){const e=t[i].value;n[i]={value:e},e===null?n[i].value={src:""}:e.isTexture&&(n[i].value={src:e.image.src})}return n}function cn(t){switch(t){case"blendSrcAlpha":case"blendDstAlpha":case"blendEquationAlpha":case"clippingPlanes":case"shadowSide":case"precision":return!0}return!1}function jt(t){const n={};for(const i in t){if(i.substring(0,1)==="_"||i.substring(0,2)==="is"||cn(i))continue;const e=typeof t[i],r=t[i];switch(e){case"boolean":case"number":case"string":n[i]=r;break;case"object":if(r!==null)if(n[i]=r,r.isTexture)if(r instanceof f.Texture){const l=r.source.toJSON();n[i]={src:l.url}}else r instanceof f.CubeTexture&&(console.log("env map"),console.log(r.source.data),console.log(r.source.toJSON()),n[i]={src:""});else i==="uniforms"&&(n[i]=sn(n[i]));else n[i]={src:""};break}}return n}function ln(t){t.updateMatrix();const n={name:t.name,type:t.type,uuid:t.uuid,visible:t.visible,matrix:t.matrix.elements};if(t instanceof f.Mesh){const i=t;if(Array.isArray(i.material)){const e=[];i.material.forEach(r=>{e.push(jt(r))}),n.material=e}else n.material=jt(i.material)}else t instanceof f.Camera?t instanceof f.PerspectiveCamera?n.perspectiveCameraInfo={fov:t.fov,zoom:t.zoom,near:t.near,far:t.far,focus:t.focus,aspect:t.aspect,filmGauge:t.filmGauge,filmOffset:t.filmOffset}:t instanceof f.OrthographicCamera&&(n.orthographicCameraInfo={zoom:t.zoom,near:t.near,far:t.far,left:t.left,right:t.right,top:t.top,bottom:t.bottom}):t instanceof f.Light&&(n.lightInfo={color:t.color,intensity:t.intensity,decay:t.decay,distance:t.distance,angle:t.angle,penumbra:t.penumbra,groundColor:t.groundColor});return n}function $(t,n,i){const e=n.split(".");switch(e.length){case 1:t[e[0]]=i;break;case 2:t[e[0]][e[1]]=i;break;case 3:t[e[0]][e[1]][e[2]]=i;break;case 4:t[e[0]][e[1]][e[2]][e[3]]=i;break;case 5:t[e[0]][e[1]][e[2]][e[3]][e[4]]=i;break}}function ut(t){return new Promise((n,i)=>{const e=new Image;e.onload=()=>{const r=new f.Texture(e);r.wrapS=f.RepeatWrapping,r.wrapT=f.RepeatWrapping,r.needsUpdate=!0,n(r)},e.onerror=i,e.src=t})}class un extends Ae{constructor(){super(...arguments);z(this,"scene")}getObject(i){this.app.send({event:"getObject",target:"app",data:i})}setObject(i){const e=ln(i);this.app.send({event:"setObject",target:"editor",data:e})}requestMethod(i,e,r){this.app.send({event:"requestMethod",target:"app",data:{uuid:i,key:e,value:r}})}updateObject(i,e,r){this.app.send({event:"updateObject",target:"app",data:{uuid:i,key:e,value:r}})}createTexture(i,e,r){this.app.send({event:"createTexture",target:"app",data:{uuid:i,key:e,value:r}})}getScene(){this.app.send({event:"getScene",target:"app"})}setScene(i){this.scene=i,lt(i);const e=Pt(i);this.app.send({event:"setScene",target:"editor",data:e})}}class dn extends Ae{constructor(i){super(i);z(this,"bindCBs");z(this,"buttonCBs");z(this,"pane");z(this,"appCallbacks",0);z(this,"editorCallbacks",0);z(this,"inspectorFolder");this.bindCBs=new Map,this.buttonCBs=new Map,i.editor&&this.createGUI()}createGUI(){this.pane=new Jt.Pane({title:"GUI"}),this.pane.registerPlugin($t)}dispose(){var i;this.bindCBs.clear(),this.buttonCBs.clear(),this.appCallbacks=0,this.editorCallbacks=0,this.app.editor&&((i=this.pane)==null||i.dispose(),this.pane=void 0)}addFolder(i,e=void 0,r=void 0){if(this.app.editor)return this.pane===void 0&&this.createGUI(),(r!==void 0?r:this.pane).addFolder({title:i,...e});this.app.send({event:"addFolder",target:"app",data:{name:i,params:e,parent:r}})}get bindID(){return`debug_${Math.max(this.appCallbacks,this.editorCallbacks)}`}bind(i,e,r,l=void 0){const c=this.bindID,s=r.onChange!==void 0?r.onChange:Rt;this.bindCBs.set(c,s),this.app.editor?(this.pane===void 0&&this.createGUI(),(l!==void 0?l:this.pane).addBinding(i,e,r).on("change",m=>{this.app.send({event:"updateBind",target:"app",data:{id:c,value:m.value}})}),this.editorCallbacks++):(this.app.send({event:"bindObject",target:"app",data:{id:c,name:e,params:r,parent:l}}),this.appCallbacks++)}triggerBind(i,e){const r=this.bindCBs.get(i);r!==void 0?r(e):console.warn(`No callback for: ${i}`,e)}button(i,e,r=void 0){const l=this.bindID;this.buttonCBs.set(l,e),this.app.editor?(this.pane===void 0&&this.createGUI(),(r!==void 0?r:this.pane).addButton({title:i}).on("click",()=>{this.app.send({event:"clickButton",target:"app",data:{id:l}})}),this.editorCallbacks++):(this.app.send({event:"addButton",target:"app",data:{id:l,name:i,callback:e,parent:r}}),this.appCallbacks++)}triggerButton(i){const e=this.buttonCBs.get(i);e!==void 0&&e()}createInspector(){this.inspectorFolder=this.addFolder("Inspector",this.pane)}clearInspector(){const i=this.inspectorFolder.children.length-1;for(let e=i;e>-1;--e)this.inspectorFolder.remove(this.inspectorFolder.children[e])}}var dt={exports:{}},Ie={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var xt;function cn(){if(xt)return Ie;xt=1;var t=I,n=Symbol.for("react.element"),i=Symbol.for("react.fragment"),e=Object.prototype.hasOwnProperty,r=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function m(s,c,h){var p,g={},w=null,x=null;h!==void 0&&(w=""+h),c.key!==void 0&&(w=""+c.key),c.ref!==void 0&&(x=c.ref);for(p in c)e.call(c,p)&&!l.hasOwnProperty(p)&&(g[p]=c[p]);if(s&&s.defaultProps)for(p in c=s.defaultProps,c)g[p]===void 0&&(g[p]=c[p]);return{$$typeof:n,type:s,key:w,ref:x,props:g,_owner:r.current}}return Ie.Fragment=i,Ie.jsx=m,Ie.jsxs=m,Ie}var Ne={};/**
9
+ */var Mt;function fn(){if(Mt)return Ie;Mt=1;var t=A,n=Symbol.for("react.element"),i=Symbol.for("react.fragment"),e=Object.prototype.hasOwnProperty,r=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(s,u,m){var p,v={},w=null,T=null;m!==void 0&&(w=""+m),u.key!==void 0&&(w=""+u.key),u.ref!==void 0&&(T=u.ref);for(p in u)e.call(u,p)&&!l.hasOwnProperty(p)&&(v[p]=u[p]);if(s&&s.defaultProps)for(p in u=s.defaultProps,u)v[p]===void 0&&(v[p]=u[p]);return{$$typeof:n,type:s,key:w,ref:T,props:v,_owner:r.current}}return Ie.Fragment=i,Ie.jsx=c,Ie.jsxs=c,Ie}var Ne={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,20 +14,20 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Tt;function ln(){return Tt||(Tt=1,process.env.NODE_ENV!=="production"&&function(){var t=I,n=Symbol.for("react.element"),i=Symbol.for("react.portal"),e=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),R=Symbol.iterator,_="@@iterator";function E(a){if(a===null||typeof a!="object")return null;var f=R&&a[R]||a[_];return typeof f=="function"?f:null}var b=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function y(a){{for(var f=arguments.length,v=new Array(f>1?f-1:0),S=1;S<f;S++)v[S-1]=arguments[S];P("error",a,v)}}function P(a,f,v){{var S=b.ReactDebugCurrentFrame,A=S.getStackAddendum();A!==""&&(f+="%s",v=v.concat([A]));var N=v.map(function(M){return String(M)});N.unshift("Warning: "+f),Function.prototype.apply.call(console[a],console,N)}}var k=!1,K=!1,ne=!1,j=!1,le=!1,Re;Re=Symbol.for("react.module.reference");function se(a){return!!(typeof a=="string"||typeof a=="function"||a===e||a===l||le||a===r||a===h||a===p||j||a===x||k||K||ne||typeof a=="object"&&a!==null&&(a.$$typeof===w||a.$$typeof===g||a.$$typeof===m||a.$$typeof===s||a.$$typeof===c||a.$$typeof===Re||a.getModuleId!==void 0))}function D(a,f,v){var S=a.displayName;if(S)return S;var A=f.displayName||f.name||"";return A!==""?v+"("+A+")":v}function F(a){return a.displayName||"Context"}function B(a){if(a==null)return null;if(typeof a.tag=="number"&&y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case e:return"Fragment";case i:return"Portal";case l:return"Profiler";case r:return"StrictMode";case h:return"Suspense";case p:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case s:var f=a;return F(f)+".Consumer";case m:var v=a;return F(v._context)+".Provider";case c:return D(a,a.render,"ForwardRef");case g:var S=a.displayName||null;return S!==null?S:B(a.type)||"Memo";case w:{var A=a,N=A._payload,M=A._init;try{return B(M(N))}catch{return null}}}return null}var ee=Object.assign,ae=0,Pe,Ue,Fe,je,Be,qe,Ve;function $e(){}$e.__reactDisabledLog=!0;function gt(){{if(ae===0){Pe=console.log,Ue=console.info,Fe=console.warn,je=console.error,Be=console.group,qe=console.groupCollapsed,Ve=console.groupEnd;var a={configurable:!0,enumerable:!0,value:$e,writable:!0};Object.defineProperties(console,{info:a,log:a,warn:a,error:a,group:a,groupCollapsed:a,groupEnd:a})}ae++}}function vt(){{if(ae--,ae===0){var a={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ee({},a,{value:Pe}),info:ee({},a,{value:Ue}),warn:ee({},a,{value:Fe}),error:ee({},a,{value:je}),group:ee({},a,{value:Be}),groupCollapsed:ee({},a,{value:qe}),groupEnd:ee({},a,{value:Ve})})}ae<0&&y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ge=b.ReactCurrentDispatcher,Ye;function ye(a,f,v){{if(Ye===void 0)try{throw Error()}catch(A){var S=A.stack.trim().match(/\n( *(at )?)/);Ye=S&&S[1]||""}return`
18
- `+Ye+a}}var Me=!1,Ee;{var bt=typeof WeakMap=="function"?WeakMap:Map;Ee=new bt}function et(a,f){if(!a||Me)return"";{var v=Ee.get(a);if(v!==void 0)return v}var S;Me=!0;var A=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var N;N=Ge.current,Ge.current=null,gt();try{if(f){var M=function(){throw Error()};if(Object.defineProperty(M.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(M,[])}catch(ce){S=ce}Reflect.construct(a,[],M)}else{try{M.call()}catch(ce){S=ce}a.call(M.prototype)}}else{try{throw Error()}catch(ce){S=ce}a()}}catch(ce){if(ce&&S&&typeof ce.stack=="string"){for(var T=ce.stack.split(`
19
- `),q=S.stack.split(`
20
- `),Y=T.length-1,W=q.length-1;Y>=1&&W>=0&&T[Y]!==q[W];)W--;for(;Y>=1&&W>=0;Y--,W--)if(T[Y]!==q[W]){if(Y!==1||W!==1)do if(Y--,W--,W<0||T[Y]!==q[W]){var ie=`
21
- `+T[Y].replace(" at new "," at ");return a.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",a.displayName)),typeof a=="function"&&Ee.set(a,ie),ie}while(Y>=1&&W>=0);break}}}finally{Me=!1,Ge.current=N,vt(),Error.prepareStackTrace=A}var De=a?a.displayName||a.name:"",zt=De?ye(De):"";return typeof a=="function"&&Ee.set(a,zt),zt}function tt(a,f,v){return et(a,!1)}function nt(a){var f=a.prototype;return!!(f&&f.isReactComponent)}function we(a,f,v){if(a==null)return"";if(typeof a=="function")return et(a,nt(a));if(typeof a=="string")return ye(a);switch(a){case h:return ye("Suspense");case p:return ye("SuspenseList")}if(typeof a=="object")switch(a.$$typeof){case c:return tt(a.render);case g:return we(a.type,f,v);case w:{var S=a,A=S._payload,N=S._init;try{return we(N(A),f,v)}catch{}}}return""}var ke=Object.prototype.hasOwnProperty,at={},ze=b.ReactDebugCurrentFrame;function ue(a){if(a){var f=a._owner,v=we(a.type,a._source,f?f.type:null);ze.setExtraStackFrame(v)}else ze.setExtraStackFrame(null)}function Ce(a,f,v,S,A){{var N=Function.call.bind(ke);for(var M in a)if(N(a,M)){var T=void 0;try{if(typeof a[M]!="function"){var q=Error((S||"React class")+": "+v+" type `"+M+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[M]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw q.name="Invariant Violation",q}T=a[M](f,M,S,v,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Y){T=Y}T&&!(T instanceof Error)&&(ue(A),y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",S||"React class",v,M,typeof T),ue(null)),T instanceof Error&&!(T.message in at)&&(at[T.message]=!0,ue(A),y("Failed %s type: %s",v,T.message),ue(null))}}}var yt=Array.isArray;function He(a){return yt(a)}function it(a){{var f=typeof Symbol=="function"&&Symbol.toStringTag,v=f&&a[Symbol.toStringTag]||a.constructor.name||"Object";return v}}function We(a){try{return rt(a),!1}catch{return!0}}function rt(a){return""+a}function ot(a){if(We(a))return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",it(a)),rt(a)}var de=b.ReactCurrentOwner,Et={key:!0,ref:!0,__self:!0,__source:!0},st,Ke,Se;Se={};function o(a){if(ke.call(a,"ref")){var f=Object.getOwnPropertyDescriptor(a,"ref").get;if(f&&f.isReactWarning)return!1}return a.ref!==void 0}function C(a){if(ke.call(a,"key")){var f=Object.getOwnPropertyDescriptor(a,"key").get;if(f&&f.isReactWarning)return!1}return a.key!==void 0}function V(a,f){if(typeof a.ref=="string"&&de.current&&f&&de.current.stateNode!==f){var v=B(de.current.type);Se[v]||(y('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',B(de.current.type),a.ref),Se[v]=!0)}}function G(a,f){{var v=function(){st||(st=!0,y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",f))};v.isReactWarning=!0,Object.defineProperty(a,"key",{get:v,configurable:!0})}}function Q(a,f){{var v=function(){Ke||(Ke=!0,y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",f))};v.isReactWarning=!0,Object.defineProperty(a,"ref",{get:v,configurable:!0})}}var fe=function(a,f,v,S,A,N,M){var T={$$typeof:n,type:a,key:f,ref:v,props:M,_owner:N};return T._store={},Object.defineProperty(T._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(T,"_self",{configurable:!1,enumerable:!1,writable:!1,value:S}),Object.defineProperty(T,"_source",{configurable:!1,enumerable:!1,writable:!1,value:A}),Object.freeze&&(Object.freeze(T.props),Object.freeze(T)),T};function re(a,f,v,S,A){{var N,M={},T=null,q=null;v!==void 0&&(ot(v),T=""+v),C(f)&&(ot(f.key),T=""+f.key),o(f)&&(q=f.ref,V(f,A));for(N in f)ke.call(f,N)&&!Et.hasOwnProperty(N)&&(M[N]=f[N]);if(a&&a.defaultProps){var Y=a.defaultProps;for(N in Y)M[N]===void 0&&(M[N]=Y[N])}if(T||q){var W=typeof a=="function"?a.displayName||a.name||"Unknown":a;T&&G(M,W),q&&Q(M,W)}return fe(a,T,q,A,S,de.current,M)}}var ct=b.ReactCurrentOwner,Xe=b.ReactDebugCurrentFrame;function Z(a){if(a){var f=a._owner,v=we(a.type,a._source,f?f.type:null);Xe.setExtraStackFrame(v)}else Xe.setExtraStackFrame(null)}var te;te=!1;function he(a){return typeof a=="object"&&a!==null&&a.$$typeof===n}function me(){{if(ct.current){var a=B(ct.current.type);if(a)return`
17
+ */var kt;function hn(){return kt||(kt=1,process.env.NODE_ENV!=="production"&&function(){var t=A,n=Symbol.for("react.element"),i=Symbol.for("react.portal"),e=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),s=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),v=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),T=Symbol.for("react.offscreen"),M=Symbol.iterator,I="@@iterator";function E(a){if(a===null||typeof a!="object")return null;var h=M&&a[M]||a[I];return typeof h=="function"?h:null}var y=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(a){{for(var h=arguments.length,g=new Array(h>1?h-1:0),O=1;O<h;O++)g[O-1]=arguments[O];R("error",a,g)}}function R(a,h,g){{var O=y.ReactDebugCurrentFrame,_=O.getStackAddendum();_!==""&&(h+="%s",g=g.concat([_]));var N=g.map(function(j){return String(j)});N.unshift("Warning: "+h),Function.prototype.apply.call(console[a],console,N)}}var k=!1,K=!1,ne=!1,P=!1,le=!1,Re;Re=Symbol.for("react.module.reference");function se(a){return!!(typeof a=="string"||typeof a=="function"||a===e||a===l||le||a===r||a===m||a===p||P||a===T||k||K||ne||typeof a=="object"&&a!==null&&(a.$$typeof===w||a.$$typeof===v||a.$$typeof===c||a.$$typeof===s||a.$$typeof===u||a.$$typeof===Re||a.getModuleId!==void 0))}function D(a,h,g){var O=a.displayName;if(O)return O;var _=h.displayName||h.name||"";return _!==""?g+"("+_+")":g}function F(a){return a.displayName||"Context"}function B(a){if(a==null)return null;if(typeof a.tag=="number"&&b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case e:return"Fragment";case i:return"Portal";case l:return"Profiler";case r:return"StrictMode";case m:return"Suspense";case p:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case s:var h=a;return F(h)+".Consumer";case c:var g=a;return F(g._context)+".Provider";case u:return D(a,a.render,"ForwardRef");case v:var O=a.displayName||null;return O!==null?O:B(a.type)||"Memo";case w:{var _=a,N=_._payload,j=_._init;try{return B(j(N))}catch{return null}}}return null}var ee=Object.assign,ae=0,Pe,Ue,Fe,je,Be,qe,Ve;function $e(){}$e.__reactDisabledLog=!0;function vt(){{if(ae===0){Pe=console.log,Ue=console.info,Fe=console.warn,je=console.error,Be=console.group,qe=console.groupCollapsed,Ve=console.groupEnd;var a={configurable:!0,enumerable:!0,value:$e,writable:!0};Object.defineProperties(console,{info:a,log:a,warn:a,error:a,group:a,groupCollapsed:a,groupEnd:a})}ae++}}function bt(){{if(ae--,ae===0){var a={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ee({},a,{value:Pe}),info:ee({},a,{value:Ue}),warn:ee({},a,{value:Fe}),error:ee({},a,{value:je}),group:ee({},a,{value:Be}),groupCollapsed:ee({},a,{value:qe}),groupEnd:ee({},a,{value:Ve})})}ae<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ge=y.ReactCurrentDispatcher,Ye;function ye(a,h,g){{if(Ye===void 0)try{throw Error()}catch(_){var O=_.stack.trim().match(/\n( *(at )?)/);Ye=O&&O[1]||""}return`
18
+ `+Ye+a}}var Me=!1,Ee;{var yt=typeof WeakMap=="function"?WeakMap:Map;Ee=new yt}function et(a,h){if(!a||Me)return"";{var g=Ee.get(a);if(g!==void 0)return g}var O;Me=!0;var _=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var N;N=Ge.current,Ge.current=null,vt();try{if(h){var j=function(){throw Error()};if(Object.defineProperty(j.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(j,[])}catch(ce){O=ce}Reflect.construct(a,[],j)}else{try{j.call()}catch(ce){O=ce}a.call(j.prototype)}}else{try{throw Error()}catch(ce){O=ce}a()}}catch(ce){if(ce&&O&&typeof ce.stack=="string"){for(var x=ce.stack.split(`
19
+ `),q=O.stack.split(`
20
+ `),Y=x.length-1,W=q.length-1;Y>=1&&W>=0&&x[Y]!==q[W];)W--;for(;Y>=1&&W>=0;Y--,W--)if(x[Y]!==q[W]){if(Y!==1||W!==1)do if(Y--,W--,W<0||x[Y]!==q[W]){var ie=`
21
+ `+x[Y].replace(" at new "," at ");return a.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",a.displayName)),typeof a=="function"&&Ee.set(a,ie),ie}while(Y>=1&&W>=0);break}}}finally{Me=!1,Ge.current=N,bt(),Error.prepareStackTrace=_}var De=a?a.displayName||a.name:"",Zt=De?ye(De):"";return typeof a=="function"&&Ee.set(a,Zt),Zt}function tt(a,h,g){return et(a,!1)}function nt(a){var h=a.prototype;return!!(h&&h.isReactComponent)}function we(a,h,g){if(a==null)return"";if(typeof a=="function")return et(a,nt(a));if(typeof a=="string")return ye(a);switch(a){case m:return ye("Suspense");case p:return ye("SuspenseList")}if(typeof a=="object")switch(a.$$typeof){case u:return tt(a.render);case v:return we(a.type,h,g);case w:{var O=a,_=O._payload,N=O._init;try{return we(N(_),h,g)}catch{}}}return""}var ke=Object.prototype.hasOwnProperty,at={},ze=y.ReactDebugCurrentFrame;function ue(a){if(a){var h=a._owner,g=we(a.type,a._source,h?h.type:null);ze.setExtraStackFrame(g)}else ze.setExtraStackFrame(null)}function Ce(a,h,g,O,_){{var N=Function.call.bind(ke);for(var j in a)if(N(a,j)){var x=void 0;try{if(typeof a[j]!="function"){var q=Error((O||"React class")+": "+g+" type `"+j+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[j]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw q.name="Invariant Violation",q}x=a[j](h,j,O,g,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Y){x=Y}x&&!(x instanceof Error)&&(ue(_),b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",O||"React class",g,j,typeof x),ue(null)),x instanceof Error&&!(x.message in at)&&(at[x.message]=!0,ue(_),b("Failed %s type: %s",g,x.message),ue(null))}}}var Et=Array.isArray;function He(a){return Et(a)}function it(a){{var h=typeof Symbol=="function"&&Symbol.toStringTag,g=h&&a[Symbol.toStringTag]||a.constructor.name||"Object";return g}}function We(a){try{return rt(a),!1}catch{return!0}}function rt(a){return""+a}function ot(a){if(We(a))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",it(a)),rt(a)}var de=y.ReactCurrentOwner,wt={key:!0,ref:!0,__self:!0,__source:!0},st,Ke,Se;Se={};function o(a){if(ke.call(a,"ref")){var h=Object.getOwnPropertyDescriptor(a,"ref").get;if(h&&h.isReactWarning)return!1}return a.ref!==void 0}function C(a){if(ke.call(a,"key")){var h=Object.getOwnPropertyDescriptor(a,"key").get;if(h&&h.isReactWarning)return!1}return a.key!==void 0}function V(a,h){if(typeof a.ref=="string"&&de.current&&h&&de.current.stateNode!==h){var g=B(de.current.type);Se[g]||(b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',B(de.current.type),a.ref),Se[g]=!0)}}function G(a,h){{var g=function(){st||(st=!0,b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",h))};g.isReactWarning=!0,Object.defineProperty(a,"key",{get:g,configurable:!0})}}function Q(a,h){{var g=function(){Ke||(Ke=!0,b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",h))};g.isReactWarning=!0,Object.defineProperty(a,"ref",{get:g,configurable:!0})}}var fe=function(a,h,g,O,_,N,j){var x={$$typeof:n,type:a,key:h,ref:g,props:j,_owner:N};return x._store={},Object.defineProperty(x._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(x,"_self",{configurable:!1,enumerable:!1,writable:!1,value:O}),Object.defineProperty(x,"_source",{configurable:!1,enumerable:!1,writable:!1,value:_}),Object.freeze&&(Object.freeze(x.props),Object.freeze(x)),x};function re(a,h,g,O,_){{var N,j={},x=null,q=null;g!==void 0&&(ot(g),x=""+g),C(h)&&(ot(h.key),x=""+h.key),o(h)&&(q=h.ref,V(h,_));for(N in h)ke.call(h,N)&&!wt.hasOwnProperty(N)&&(j[N]=h[N]);if(a&&a.defaultProps){var Y=a.defaultProps;for(N in Y)j[N]===void 0&&(j[N]=Y[N])}if(x||q){var W=typeof a=="function"?a.displayName||a.name||"Unknown":a;x&&G(j,W),q&&Q(j,W)}return fe(a,x,q,_,O,de.current,j)}}var ct=y.ReactCurrentOwner,Xe=y.ReactDebugCurrentFrame;function Z(a){if(a){var h=a._owner,g=we(a.type,a._source,h?h.type:null);Xe.setExtraStackFrame(g)}else Xe.setExtraStackFrame(null)}var te;te=!1;function he(a){return typeof a=="object"&&a!==null&&a.$$typeof===n}function me(){{if(ct.current){var a=B(ct.current.type);if(a)return`
22
22
 
23
- Check the render method of \``+a+"`."}return""}}function Oe(a){{if(a!==void 0){var f=a.fileName.replace(/^.*[\\\/]/,""),v=a.lineNumber;return`
23
+ Check the render method of \``+a+"`."}return""}}function Oe(a){{if(a!==void 0){var h=a.fileName.replace(/^.*[\\\/]/,""),g=a.lineNumber;return`
24
24
 
25
- Check your code at `+f+":"+v+"."}return""}}var xe={};function An(a){{var f=me();if(!f){var v=typeof a=="string"?a:a.displayName||a.name;v&&(f=`
25
+ Check your code at `+h+":"+g+"."}return""}}var Te={};function Un(a){{var h=me();if(!h){var g=typeof a=="string"?a:a.displayName||a.name;g&&(h=`
26
26
 
27
- Check the top-level render call using <`+v+">.")}return f}}function Vt(a,f){{if(!a._store||a._store.validated||a.key!=null)return;a._store.validated=!0;var v=An(f);if(xe[v])return;xe[v]=!0;var S="";a&&a._owner&&a._owner!==ct.current&&(S=" It was passed a child from "+B(a._owner.type)+"."),Z(a),y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',v,S),Z(null)}}function Gt(a,f){{if(typeof a!="object")return;if(He(a))for(var v=0;v<a.length;v++){var S=a[v];he(S)&&Vt(S,f)}else if(he(a))a._store&&(a._store.validated=!0);else if(a){var A=E(a);if(typeof A=="function"&&A!==a.entries)for(var N=A.call(a),M;!(M=N.next()).done;)he(M.value)&&Vt(M.value,f)}}}function In(a){{var f=a.type;if(f==null||typeof f=="string")return;var v;if(typeof f=="function")v=f.propTypes;else if(typeof f=="object"&&(f.$$typeof===c||f.$$typeof===g))v=f.propTypes;else return;if(v){var S=B(f);Ce(v,a.props,"prop",S,a)}else if(f.PropTypes!==void 0&&!te){te=!0;var A=B(f);y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",A||"Unknown")}typeof f.getDefaultProps=="function"&&!f.getDefaultProps.isReactClassApproved&&y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Nn(a){{for(var f=Object.keys(a.props),v=0;v<f.length;v++){var S=f[v];if(S!=="children"&&S!=="key"){Z(a),y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",S),Z(null);break}}a.ref!==null&&(Z(a),y("Invalid attribute `ref` supplied to `React.Fragment`."),Z(null))}}function Yt(a,f,v,S,A,N){{var M=se(a);if(!M){var T="";(a===void 0||typeof a=="object"&&a!==null&&Object.keys(a).length===0)&&(T+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var q=Oe(A);q?T+=q:T+=me();var Y;a===null?Y="null":He(a)?Y="array":a!==void 0&&a.$$typeof===n?(Y="<"+(B(a.type)||"Unknown")+" />",T=" Did you accidentally export a JSX literal instead of a component?"):Y=typeof a,y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Y,T)}var W=re(a,f,v,A,N);if(W==null)return W;if(M){var ie=f.children;if(ie!==void 0)if(S)if(He(ie)){for(var De=0;De<ie.length;De++)Gt(ie[De],a);Object.freeze&&Object.freeze(ie)}else y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Gt(ie,a)}return a===e?Nn(W):In(W),W}}function Ln(a,f,v){return Yt(a,f,v,!0)}function Un(a,f,v){return Yt(a,f,v,!1)}var Fn=Un,Bn=Ln;Ne.Fragment=e,Ne.jsx=Fn,Ne.jsxs=Bn}()),Ne}process.env.NODE_ENV==="production"?ut.exports=cn():ut.exports=ln();var u=ut.exports;function dt(t){return t.title.search("<")>-1?u.jsx("button",{className:"svg",dangerouslySetInnerHTML:{__html:t.title}}):u.jsx("button",{children:t.title})}const un=u.jsxs("svg",{className:"closeIcon",width:"14",height:"14",fill:"none",stroke:"#666666",strokeMiterlimit:"10",children:[u.jsx("circle",{cx:"7",cy:"7",r:"6"}),u.jsx("line",{x1:"4",y1:"4",x2:"10",y2:"10"}),u.jsx("line",{x1:"4",y1:"10",x2:"10",y2:"4"})]}),dn=u.jsx("svg",{className:"dragIcon",width:"14",height:"14",fill:"#666666",stroke:"none",children:u.jsx("path",{d:`M10.43,4H3.57C3.26,4,3,4.22,3,4.5v1C3,5.78,3.26,6,3.57,6h6.86C10.74,6,11,5.78,11,5.5v-1
27
+ Check the top-level render call using <`+g+">.")}return h}}function Wt(a,h){{if(!a._store||a._store.validated||a.key!=null)return;a._store.validated=!0;var g=Un(h);if(Te[g])return;Te[g]=!0;var O="";a&&a._owner&&a._owner!==ct.current&&(O=" It was passed a child from "+B(a._owner.type)+"."),Z(a),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',g,O),Z(null)}}function Kt(a,h){{if(typeof a!="object")return;if(He(a))for(var g=0;g<a.length;g++){var O=a[g];he(O)&&Wt(O,h)}else if(he(a))a._store&&(a._store.validated=!0);else if(a){var _=E(a);if(typeof _=="function"&&_!==a.entries)for(var N=_.call(a),j;!(j=N.next()).done;)he(j.value)&&Wt(j.value,h)}}}function Fn(a){{var h=a.type;if(h==null||typeof h=="string")return;var g;if(typeof h=="function")g=h.propTypes;else if(typeof h=="object"&&(h.$$typeof===u||h.$$typeof===v))g=h.propTypes;else return;if(g){var O=B(h);Ce(g,a.props,"prop",O,a)}else if(h.PropTypes!==void 0&&!te){te=!0;var _=B(h);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",_||"Unknown")}typeof h.getDefaultProps=="function"&&!h.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Bn(a){{for(var h=Object.keys(a.props),g=0;g<h.length;g++){var O=h[g];if(O!=="children"&&O!=="key"){Z(a),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",O),Z(null);break}}a.ref!==null&&(Z(a),b("Invalid attribute `ref` supplied to `React.Fragment`."),Z(null))}}function Xt(a,h,g,O,_,N){{var j=se(a);if(!j){var x="";(a===void 0||typeof a=="object"&&a!==null&&Object.keys(a).length===0)&&(x+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var q=Oe(_);q?x+=q:x+=me();var Y;a===null?Y="null":He(a)?Y="array":a!==void 0&&a.$$typeof===n?(Y="<"+(B(a.type)||"Unknown")+" />",x=" Did you accidentally export a JSX literal instead of a component?"):Y=typeof a,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Y,x)}var W=re(a,h,g,_,N);if(W==null)return W;if(j){var ie=h.children;if(ie!==void 0)if(O)if(He(ie)){for(var De=0;De<ie.length;De++)Kt(ie[De],a);Object.freeze&&Object.freeze(ie)}else b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Kt(ie,a)}return a===e?Bn(W):Fn(W),W}}function Vn(a,h,g){return Xt(a,h,g,!0)}function Gn(a,h,g){return Xt(a,h,g,!1)}var Yn=Gn,zn=Vn;Ne.Fragment=e,Ne.jsx=Yn,Ne.jsxs=zn}()),Ne}process.env.NODE_ENV==="production"?dt.exports=fn():dt.exports=hn();var d=dt.exports;function ft(t){return t.title.search("<")>-1?d.jsx("button",{className:"svg",dangerouslySetInnerHTML:{__html:t.title}}):d.jsx("button",{children:t.title})}const mn=d.jsxs("svg",{className:"closeIcon",width:"14",height:"14",fill:"none",stroke:"#666666",strokeMiterlimit:"10",children:[d.jsx("circle",{cx:"7",cy:"7",r:"6"}),d.jsx("line",{x1:"4",y1:"4",x2:"10",y2:"10"}),d.jsx("line",{x1:"4",y1:"10",x2:"10",y2:"4"})]}),pn=d.jsx("svg",{className:"dragIcon",width:"14",height:"14",fill:"#666666",stroke:"none",children:d.jsx("path",{d:`M10.43,4H3.57C3.26,4,3,4.22,3,4.5v1C3,5.78,3.26,6,3.57,6h6.86C10.74,6,11,5.78,11,5.5v-1
28
28
  C11,4.22,10.74,4,10.43,4z M10.43,8H3.57C3.26,8,3,8.22,3,8.5v1C3,9.78,3.26,10,3.57,10h6.86C10.74,10,11,9.78,11,9.5v-1
29
- C11,8.22,10.74,8,10.43,8z`})});function Rt(t){return u.jsx(wt.Reorder.Item,{value:t.title,children:u.jsxs("div",{children:[dn,u.jsx("span",{children:t.title}),u.jsx("button",{className:"closeIcon",onClick:()=>{t.onDelete(t.index)},children:un})]})},t.title)}function Pt(t){const[n,i]=I.useState(!1),[e,r]=I.useState(t.options),l=h=>{t.onDragComplete(h),r(h)},m=h=>{const p=[...e];p.splice(h,1),l(p)},s=[];e.forEach((h,p)=>{s.push(u.jsx(Rt,{index:p,title:h,onDelete:m},h))});let c="dropdown draggable";return t.subdropdown&&(c+=" subdropdown"),u.jsxs("div",{className:c,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:[u.jsx(dt,{title:t.title}),u.jsx(wt.Reorder.Group,{axis:"y",values:e,onReorder:l,style:{visibility:n?"visible":"hidden"},children:s})]})}function jt(t){const[n,i]=I.useState(!1),e=[];t.options.map((l,m)=>{t.onSelect!==void 0&&(l.onSelect=t.onSelect),e.push(u.jsx(Mt,{option:l},m))});let r="dropdown";return t.subdropdown&&(r+=" subdropdown"),u.jsxs("div",{className:r,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:[u.jsx(dt,{title:t.title}),u.jsx("ul",{style:{visibility:n?"visible":"hidden"},children:e})]})}function Mt(t){const{option:n}=t,[i,e]=I.useState("");let r;switch(n.type){case"draggable":r=u.jsx(Pt,{title:n.title,options:n.value,onDragComplete:l=>{n.onDragComplete!==void 0&&n.onDragComplete(l)},subdropdown:!0});break;case"dropdown":r=u.jsx(jt,{title:n.title,options:n.value,onSelect:n.onSelect,subdropdown:!0});break;case"option":r=u.jsx("button",{onClick:()=>{n.onSelect!==void 0&&n.onSelect(n.value),n.selectable&&(i!==n.title?e(n.title):e(""))},children:n.title});break}return u.jsx("li",{className:i===n.title?"selected":"",children:r},Qt())}function fn(t){let n;const i=t.editor?"editor":"app";function e(s){var h,p,g,w,x,R,_,E,b;let c;switch(s.event){case"custom":L.dispatchEvent({type:U.CUSTOM,value:s.data});break;case"selectComponent":L.dispatchEvent({type:U.SELECT_DROPDOWN,value:s.data});break;case"draggableListUpdate":L.dispatchEvent({type:U.DRAG_UPDATE,value:s.data});break;case"addFolder":(h=t.components.get("debug"))==null||h.addFolder(s.data.name,s.data.params,s.data.parent);break;case"bindObject":(p=t.components.get("debug"))==null||p.bind(s.data.name,s.data.params,s.data.parent);break;case"updateBind":(g=t.components.get("debug"))==null||g.triggerBind(s.data.id,s.data.value);break;case"addButton":(w=t.components.get("debug"))==null||w.button(s.data.name,s.data.callback,s.data.parent);break;case"clickButton":(x=t.components.get("debug"))==null||x.triggerButton(s.data.id);break;case"setSheet":c=(R=t.components.get("theatre"))==null?void 0:R.sheets.get(s.data.sheet),c!==void 0&&(n=c,_e.setSelection([c]));break;case"setSheetObject":c=(_=t.components.get("theatre"))==null?void 0:_.sheetObjects.get(`${s.data.sheet}_${s.data.key}`),c!==void 0&&_e.setSelection([c]);break;case"updateSheetObject":c=(E=t.components.get("theatre"))==null?void 0:E.sheetObjectCBs.get(s.data.sheetObject),c!==void 0&&c(s.data.values);break;case"updateTimeline":n=(b=t.components.get("theatre"))==null?void 0:b.sheets.get(s.data.sheet),n!==void 0&&(n.sequence.position=s.data.position);break;case"getScene":L.dispatchEvent({type:U.GET_SCENE});break;case"getObject":L.dispatchEvent({type:U.GET_OBJECT,value:s.data});break;case"updateObject":L.dispatchEvent({type:U.UPDATE_OBJECT,value:s.data});break;case"createTexture":L.dispatchEvent({type:U.CREATE_TEXTURE,value:s.data});break;case"requestMethod":L.dispatchEvent({type:U.REQUEST_METHOD,value:s.data});break}}function r(s){switch(s.event){case"custom":L.dispatchEvent({type:U.CUSTOM,value:s.data});break;case"setObject":L.dispatchEvent({type:U.SET_OBJECT,value:s.data});break;case"setScene":L.dispatchEvent({type:U.SET_SCENE,value:s.data});break}}function l(){_e.ui.hide()}function m(){_e.ui.restore(),_e.onSelectionChange(p=>{p.length<1||p.forEach(g=>{var _;let w=g.address.sheetId,x="setSheet",R={};switch(g.type){case"Theatre_Sheet_PublicAPI":x="setSheet",R={sheet:g.address.sheetId},n=(_=t.components.get("theatre"))==null?void 0:_.sheets.get(g.address.sheetId);break;case"Theatre_SheetObject_PublicAPI":x="setSheetObject",w+=`_${g.address.objectKey}`,R={id:w,sheet:g.address.sheetId,key:g.address.objectKey};break}t.send({event:x,target:"app",data:R})})});let s=0;const c=()=>{if(n!==void 0&&s!==n.sequence.position){s=n.sequence.position;const p=n;t.send({event:"updateTimeline",target:"app",data:{position:s,sheet:p.address.sheetId}})}},h=()=>{c(),requestAnimationFrame(h)};c(),h()}t.listen(s=>{i==="app"?e(s):r(s)}),t.editor?m():l()}const Yn="";function Ze(t){const[n,i]=I.useState(t.open!==void 0?t.open:!0),e=!n||t.children===void 0;return u.jsxs("div",{className:`accordion ${e?"hide":""}`,children:[u.jsxs("button",{className:"toggle",onClick:()=>{const r=!n;t.onToggle!==void 0&&t.onToggle(r),i(r)},children:[u.jsx("p",{className:`status ${n?"open":""}`,children:"Toggle"}),u.jsx("p",{className:"label",children:t.label})]}),t.button,u.jsx("div",{className:n?"open":"",children:u.jsx("div",{children:t.children})})]})}function ft(t){const[n,i]=I.useState(t.child.children.length>0),e=t.child.children.length>0,r=[];return t.child.children.length>0&&t.child.children.map(l=>{r.push(u.jsx(ft,{child:l,three:t.three},Math.random()))}),u.jsxs("div",{className:"childObject",children:[u.jsxs("div",{className:"child",children:[e?u.jsx("button",{className:"status",style:{backgroundPositionX:n?"-14px":"2px"},onClick:()=>{i(!n)}}):null,u.jsx("button",{className:"name",style:{left:e?"20px":"5px"},onClick:()=>{t.three.getObject(t.child.uuid)},children:t.child.name.length>0?`${t.child.name} (${t.child.type})`:`${t.child.type}::${t.child.uuid}`}),u.jsx("div",{className:`icon ${tn(t.child)}`})]}),u.jsx("div",{className:n?"open":"",children:u.jsx("div",{className:"container",children:r})})]},Math.random())}function kt(t){const n=[];return t.child.children.map(i=>{n.push(u.jsx(ft,{child:i,three:t.three},Math.random()))}),u.jsx("div",{className:`scene ${t.class!==void 0?t.class:""}`,children:n})}const zn="",hn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA5klEQVRoge2Y0Q6EIAwE6cX//+X6cCFpSMEKVTdk501OpRNKiyelFC0b8Ps6gCwoggZF0KAIGhRBgyJoUAQNiqCxjciR9SLV//eZiAyvK3U8i/QVaQO2YyLSFVvlkdTKDjJCukh2ykR5ZEW+kHmlatl90RaBtDkK/w7CYhuRUEO0ee3l+J3m55Vm+17vtwjTnV1V3QA8qfbeUXCzRWDpiLLS+OyzvRW7IzW9R+okvclsqR09743bo0yUpc1+lSJvNsa002+Euk9GKzV7SmZDRIMiaFAEDYqgQRE0KIIGRdCgCBoUQeMEMERadX7YUz8AAAAASUVORK5CYII=";function mn(t){return"items"in t}function Te(t){function n(e,r){console.log("onChange:",e,r)}const i=[];return t.items.forEach(e=>{mn(e)?i.push(u.jsx(Te,{title:e.title,items:e.items},Math.random())):i.push(u.jsx(Le,{title:e.title,prop:e.prop,value:e.value,type:e.type,min:e.min,max:e.max,step:e.step,disabled:e.disabled,onChange:(r,l)=>{e.onChange!==void 0?e.onChange(r,l):n(r,l)}},Math.random()))}),u.jsx(Ze,{label:t.title,open:!1,children:i})}function pn(t){return!(t==="alphaHash"||t==="alphaToCoverage"||t==="attenuationDistance"||t==="colorWrite"||t==="combine"||t==="defaultAttributeValues"||t==="depthFunc"||t==="forceSinglePass"||t==="glslVersion"||t==="linewidth"||t==="normalMapType"||t==="precision"||t==="premultipliedAlpha"||t==="shadowSide"||t==="side"||t==="toneMapped"||t==="uniformsGroups"||t==="uniformsNeedUpdate"||t==="userData"||t==="vertexColors"||t==="version"||t==="wireframeLinecap"||t==="wireframeLinejoin"||t==="wireframeLinewidth"||t.slice(0,5)==="blend"||t.slice(0,4)==="clip"||t.slice(0,7)==="polygon"||t.slice(0,7)==="stencil"||t.slice(0,2)==="is")}function ge(t){switch(t){case"alphaMap":return"Alpha Map";case"anisotropyRotation":return"Anisotropy Rotation";case"aoMap":return"AO Map";case"aoMapIntensity":return"AO Map Intensity";case"attenuationColor":return"Attenuation Color";case"bumpMap":return"Bump Map";case"bumpScale":return"Bump Scale";case"clearcoatNormalScale":return"Clearcoat Normal Scale";case"clearcoatRoughness":return"Clearcoat Roughness";case"color":return"Color";case"defines":return"Defines";case"depthTest":return"Depth Test";case"depthWrite":return"Depth Write";case"displacementBias":return"Displacement Bias";case"displacementMap":return"Displacement Map";case"displacementScale":return"Displacement Scale";case"dithering":return"Dithering";case"emissive":return"Emissive";case"emissiveIntensity":return"Emissive Intensity";case"envMap":return"Environment Map";case"envMapIntensity":return"Environment Map Intensity";case"extensions":return"Extensions";case"flatShading":return"Flat Shading";case"fragmentShader":return"Fragment Shader";case"fog":return"Fog";case"gradientMap":return"Gradient Map";case"ior":return"IOR";case"iridescenceIOR":return"Iridescence IOR";case"iridescenceThicknessRange":return"Iridescence Thickness Range";case"lights":return"Lights";case"lightMap":return"Light Map";case"lightMapIntensity":return"Light Map Intensity";case"map":return"Map";case"matcap":return"Matcap";case"metalness":return"Metalness";case"name":return"Name";case"normalMap":return"Normal Map";case"normalScale":return"Normal Scale";case"opacity":return"Opacity";case"reflectivity":return"Reflectivity";case"refractionRatio":return"Refraction Ratio";case"roughness":return"Roughness";case"sheenColor":return"Sheen Color";case"sheenRoughness":return"Sheen Roughness";case"shininess":return"Shininess";case"specular":return"Specular";case"specularColor":return"Specular Color";case"specularIntensity":return"Specular Intensity";case"thickness":return"Thickness";case"transparent":return"Transparent";case"type":return"Type";case"uuid":return"UUID";case"uniforms":return"Uniforms";case"vertexShader":return"Vertex Shader";case"visible":return"Visible";case"wireframe":return"Wireframe"}return t}function gn(t){return t.toLowerCase().search("intensity")>-1||t==="anisotropyRotation"||t==="bumpScale"||t==="clearcoatRoughness"||t==="displacementBias"||t==="displacementScale"||t==="metalness"||t==="opacity"||t==="reflectivity"||t==="refractionRatio"||t==="roughness"||t==="sheenRoughness"||t==="thickness"}function vn(){const t=document.createElement("input");return t.type="file",new Promise((n,i)=>{t.addEventListener("change",function(){if(t.files===null)i();else{const e=t.files[0],r=new FileReader;r.onload=function(l){n(l.target.result)},r.readAsDataURL(e)}}),t.click()})}function Dt(t,n,i){const e=[];for(const r in t){if(!pn(r))continue;const l=typeof t[r],m=t[r];if(l==="boolean"||l==="number"||l==="string"){const s={title:ge(r),prop:r,type:l,value:m,min:void 0,max:void 0,onChange:(c,h)=>{var g;i.updateObject(n.uuid,`material.${c}`,h),l==="boolean"&&i.updateObject(n.uuid,"material.needsUpdate",!0);const p=(g=i.scene)==null?void 0:g.getObjectByProperty("uuid",n.uuid);p!==void 0&&$(p,`material.${c}`,h)}};gn(r)&&(s.value=Number(m),s.type="range",s.min=0,s.max=1,s.step=.01),e.push(s)}else if(l==="object")if(m.isColor)e.push({title:ge(r),prop:r,type:"color",value:m,onChange:(s,c)=>{var g;const h=new d.Color(c);i.updateObject(n.uuid,`material.${s}`,h);const p=(g=i.scene)==null?void 0:g.getObjectByProperty("uuid",n.uuid);p!==void 0&&$(p,`material.${s}`,h)}});else if(Array.isArray(m)){const s=[];for(const c in m)s.push({title:`${c}`,type:`${typeof m[c]}`,value:m[c],onChange:(h,p)=>{var w;i.updateObject(n.uuid,`material.${r}`,p);const g=(w=i.scene)==null?void 0:w.getObjectByProperty("uuid",n.uuid);g!==void 0&&$(g,`material.${r}`,p)}});e.push({title:ge(r),items:s})}else{const s=[];for(const c in m){const h=m[c];switch(typeof h){case"boolean":case"number":case"string":c==="src"?e.push({title:ge(r),type:"image",value:h,onChange:(g,w)=>{var R;i.createTexture(n.uuid,`material.${r}`,w);const x=(R=i.scene)==null?void 0:R.getObjectByProperty("uuid",n.uuid);x!==void 0&&lt(w).then(_=>{$(x,`material.${r}`,_),$(x,"material.needsUpdate",!0)})}}):s.push({title:`${ge(c)}`,prop:`material.${r}.${c}`,type:`${typeof t[r][c]}`,value:m[c],onChange:(g,w)=>{var R;i.updateObject(n.uuid,`material.${r}.${c}`,w);const x=(R=i.scene)==null?void 0:R.getObjectByProperty("uuid",n.uuid);x!==void 0&&$(x,`material.${r}.${c}`,w)}});break;case"object":h.value!==void 0&&h.value.src!==void 0?s.push({title:ge(c),type:"image",value:h.value.src,onChange:(g,w)=>{var R;i.createTexture(n.uuid,`material.${r}.${c}.value`,w);const x=(R=i.scene)==null?void 0:R.getObjectByProperty("uuid",n.uuid);x!==void 0&&lt(w).then(_=>{$(x,`material.${r}.${c}.value`,_)})}}):s.push({title:c,type:`${typeof h.value}`,value:h.value,onChange:(g,w)=>{var R;i.updateObject(n.uuid,`material.${r}.${c}.value`,w);const x=(R=i.scene)==null?void 0:R.getObjectByProperty("uuid",n.uuid);x!==void 0&&$(x,`material.${r}.${c}.value`,w)}});break}}s.length>0&&e.push({title:ge(r),items:s})}else m!==void 0&&console.log("other:",r,l,m)}return e.sort((r,l)=>r.title<l.title?-1:r.title>l.title?1:0),e.push({title:"Update Material",type:"button",onChange:()=>{i.updateObject(n.uuid,"material.needsUpdate",!0)}}),e}function bn(t,n){const i=t.material;if(Array.isArray(i)){const e=[],r=i.length;for(let l=0;l<r;l++)e.push(u.jsx(Te,{title:`Material ${l}`,items:Dt(i[l],t,n)}));return u.jsx(u.Fragment,{children:e})}else return u.jsx(Te,{title:"Material",items:Dt(i,t,n)})}function Le(t){let n=t.value;n!==void 0&&n.isColor!==void 0&&(n=$t(t.value));const[i,e]=I.useState(n),r=I.useRef(null),l=I.useRef(null),m=I.useRef(null);I.useEffect(()=>{var P;let p=!1,g=-1,w=0,x=Number(i);const R=k=>{p=!0,w=x,g=k.clientX},_=k=>{if(!p)return;const K=t.step!==void 0?t.step:1,ne=(k.clientX-g)*K;x=Number((w+ne).toFixed(4)),l.current!==null&&(l.current.value=x.toString()),t.onChange!==void 0&&t.onChange(t.prop!==void 0?t.prop:t.title,x)},E=()=>{p=!1},b=()=>{p=!1},y=t.type==="number";return y&&((P=r.current)==null||P.addEventListener("mousedown",R,!1),document.addEventListener("mouseup",E,!1),document.addEventListener("mousemove",_,!1),document.addEventListener("contextmenu",b,!1)),()=>{var k;y&&((k=r.current)==null||k.removeEventListener("mousedown",R),document.removeEventListener("mouseup",E),document.removeEventListener("mousemove",_),document.removeEventListener("contextmenu",b))}},[i]);const s=t.type==="string"&&(i.length>100||i.search(`
30
- `)>-1),c=s||t.type==="image",h=p=>{let g=p.target.value;t.type==="boolean"&&(g=p.target.checked),e(g),t.onChange!==void 0&&t.onChange(t.prop!==void 0?t.prop:t.title,g)};return u.jsxs("div",{className:`field ${c?"block":""}`,children:[t.type!=="button"&&u.jsx("label",{ref:r,children:t.title},"fieldLabel"),t.type==="string"&&!s&&u.jsx("input",{type:"text",disabled:t.disabled,onChange:h,value:i}),t.type==="string"&&s&&u.jsx("textarea",{cols:50,rows:10,disabled:!0,onChange:h,value:i}),t.type==="boolean"&&u.jsx("input",{type:"checkbox",disabled:t.disabled,onChange:h,checked:i}),t.type==="number"&&u.jsx("input",{ref:l,type:"number",value:i,min:t.min,max:t.max,step:t.step,onChange:h}),t.type==="range"&&u.jsxs(u.Fragment,{children:[u.jsx("input",{type:"text",value:i.toString(),onChange:h,className:"min"}),u.jsx("input",{disabled:t.disabled,type:"range",value:i,min:t.min,max:t.max,step:t.step,onChange:h})]}),t.type==="color"&&u.jsxs(u.Fragment,{children:[u.jsx("input",{type:"text",value:i.toString(),onChange:h,className:"color"}),u.jsx("input",{type:"color",value:i,onChange:h})]}),t.type==="button"&&u.jsx("button",{onClick:()=>{t.onChange!==void 0&&t.onChange(t.prop!==void 0?t.prop:t.title,!0)},children:t.title}),t.type==="image"&&u.jsx("img",{ref:m,onClick:()=>{vn().then(p=>{m.current.src=p,t.onChange!==void 0&&t.onChange(t.prop!==void 0?t.prop:t.title,p)})},src:i.length>0?i:hn})]})}function _t(t){switch(t){case"fov":return"FOV";case"zoom":return"Zoom";case"near":return"Near";case"far":return"Far";case"focus":return"Focus";case"aspect":return"Aspect";case"filmGauge":return"Film Gauge";case"filmOffset":return"Film Offset";case"left":return"Left";case"right":return"Right";case"top":return"Top";case"bottom":return"Bottom"}return t}function yn(t,n){const i=[];if(t.perspectiveCameraInfo!==void 0)for(const e in t.perspectiveCameraInfo)i.push({title:_t(e),prop:e,type:"number",step:.01,value:t.perspectiveCameraInfo[e],onChange:(r,l)=>{var s;n.updateObject(t.uuid,r,l),n.requestMethod(t.uuid,"updateProjectionMatrix");const m=(s=n.scene)==null?void 0:s.getObjectByProperty("uuid",t.uuid);m!==void 0&&($(m,r,l),m.updateProjectionMatrix())}});else if(t.orthographicCameraInfo!==void 0)for(const e in t.orthographicCameraInfo)i.push({title:_t(e),prop:e,type:"number",step:.01,value:t.perspectiveCameraInfo[e],onChange:(r,l)=>{var s;n.updateObject(t.uuid,r,l),n.requestMethod(t.uuid,"updateProjectionMatrix");const m=(s=n.scene)==null?void 0:s.getObjectByProperty("uuid",t.uuid);m!==void 0&&($(m,r,l),m.updateProjectionMatrix())}});return u.jsx(Te,{title:"Camera",items:i})}function En(t,n){const i=new d.Matrix4;i.elements=t.matrix;const e=new d.Vector3,r=new d.Euler,l=new d.Vector3;t.uuid.length>0&&(e.setFromMatrixPosition(i),r.setFromRotationMatrix(i),l.setFromMatrixScale(i));const m=(c,h)=>{var g;n.updateObject(t.uuid,c,h);const p=(g=n.scene)==null?void 0:g.getObjectByProperty("uuid",t.uuid);p!==void 0&&$(p,c,h)},s=[{title:"Position",items:[{title:"X",prop:"position.x",type:"number",value:e.x,onChange:m},{title:"Y",prop:"position.y",type:"number",value:e.y,onChange:m},{title:"Z",prop:"position.z",type:"number",value:e.z,onChange:m}]},{title:"Rotation",items:[{title:"X",prop:"rotation.x",type:"number",value:r.x,min:-Math.PI,max:Math.PI,step:.01,onChange:m},{title:"Y",prop:"rotation.y",type:"number",value:r.y,min:-Math.PI,max:Math.PI,step:.01,onChange:m},{title:"Z",prop:"rotation.z",type:"number",value:r.z,min:-Math.PI,max:Math.PI,step:.01,onChange:m}]},{title:"Scale",items:[{title:"X",prop:"scale.x",type:"number",value:l.x,step:.01,onChange:m},{title:"Y",prop:"scale.y",type:"number",value:l.y,step:.01,onChange:m},{title:"Z",prop:"scale.z",type:"number",value:l.z,step:.01,onChange:m}]}];return u.jsx(Te,{title:"Transform",items:s})}function At(t){switch(t){case"color":return"Color";case"intensity":return"Intensity";case"decay":return"Decay";case"distance":return"Distance";case"angle":return"Angle";case"penumbra":return"Penumbra";case"groundColor":return"Ground Color"}return t}function wn(t,n){const i=[];if(t.lightInfo!==void 0)for(const e in t.lightInfo){const r=t.lightInfo[e];r!==void 0&&(r.isColor!==void 0?i.push({title:At(e),prop:e,type:"color",value:r,onChange:(l,m)=>{var h;const s=new d.Color(m);n.updateObject(t.uuid,l,s);const c=(h=n.scene)==null?void 0:h.getObjectByProperty("uuid",t.uuid);c!==void 0&&$(c,l,s)}}):i.push({title:At(e),prop:e,type:typeof r,value:r,step:typeof r=="number"?.01:void 0,onChange:(l,m)=>{var c;n.updateObject(t.uuid,l,m);const s=(c=n.scene)==null?void 0:c.getObjectByProperty("uuid",t.uuid);s!==void 0&&$(s,l,m)}}))}return u.jsx(Te,{title:"Light",items:i})}function It(t){const[n,i]=I.useState(-1),[e,r]=I.useState({name:"",uuid:"",type:"",visible:!1,matrix:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]});return I.useEffect(()=>{function l(m){const s=m.value;r(s),i(Date.now())}return L.addEventListener(U.SET_OBJECT,l),()=>{L.removeEventListener(U.SET_OBJECT,l)}},[]),u.jsx("div",{id:"Inspector",className:t.class,children:e.uuid.length>0&&u.jsxs(u.Fragment,{children:[u.jsx(Le,{type:"string",title:"Name",prop:"name",value:e.name,disabled:!0}),u.jsx(Le,{type:"string",title:"Type",prop:"type",value:e.type,disabled:!0}),u.jsx(Le,{type:"string",title:"UUID",prop:"uuid",value:e.uuid,disabled:!0}),u.jsx(Le,{type:"boolean",title:"Visible",prop:"visible",value:e.visible,onChange:(l,m)=>{t.three.updateObject(e.uuid,l,m)}}),En(e,t.three),e.type.search("Camera")>-1?yn(e,t.three):null,e.type.search("Light")>-1?wn(e,t.three):null,e.material!==void 0?bn(e,t.three):null]})},n)}class Cn extends I.Component{constructor(i){super(i);z(this,"three");z(this,"onRefresh",()=>{this.three.getScene()});z(this,"setScene",i=>{this.setState(()=>({scene:i.value}))});this.state={scene:i.scene!==void 0?i.scene:null},this.three=i.three,L.addEventListener(U.SET_SCENE,this.setScene)}componentDidMount(){this.onRefresh()}componentWillUnmount(){L.removeEventListener(U.SET_SCENE,this.setScene)}render(){var r;const i=this.componentState.scene!==null,e="Hierarchy"+(i?`: ${(r=this.componentState.scene)==null?void 0:r.name}`:"");return u.jsx("div",{id:"SceneHierarchy",children:u.jsxs(u.Fragment,{children:[i&&u.jsx(Ze,{label:e,button:u.jsx("button",{className:"icon refresh hideText",onClick:this.onRefresh,children:"Refresh"}),open:!0,children:u.jsx(kt,{child:this.componentState.scene,three:this.three})}),u.jsx(Ze,{label:"Inspector",children:u.jsx(It,{three:this.three},"Inspector")})]})},"SceneHierarchy")}get componentState(){return this.state}}function Sn(t){const n=s=>{const c=t.scene.getObjectByProperty("uuid",s.value);c!==void 0&&t.three.setObject(c)},i=(s,c,h)=>{const p=t.scene.getObjectByProperty("uuid",s);p!==void 0&&$(p,c,h)},e=s=>{const c=s.value,{key:h,value:p,uuid:g}=c;i(g,h,p)},r=s=>{const c=s.value;lt(c.value).then(h=>{i(c.uuid,c.key,h),i(c.uuid,"material.needsUpdate",!0)})},l=()=>{t.three.setScene(t.scene)},m=s=>{const{key:c,uuid:h,value:p}=s.value,g=t.scene.getObjectByProperty("uuid",h);if(g!==void 0)try{g[c](p)}catch(w){console.log("Error requesting method:"),console.log(w),console.log(c),console.log(p)}};return I.useEffect(()=>(L.addEventListener(U.GET_OBJECT,n),L.addEventListener(U.GET_SCENE,l),L.addEventListener(U.UPDATE_OBJECT,e),L.addEventListener(U.CREATE_TEXTURE,r),L.addEventListener(U.REQUEST_METHOD,m),()=>{L.removeEventListener(U.GET_OBJECT,n),L.removeEventListener(U.GET_SCENE,l),L.removeEventListener(U.UPDATE_OBJECT,e),L.removeEventListener(U.CREATE_TEXTURE,r),L.removeEventListener(U.REQUEST_METHOD,m)}),[]),null}const Nt={type:"change"},ht={type:"start"},Lt={type:"end"},Je=new d.Ray,Ut=new d.Plane,On=Math.cos(70*d.MathUtils.DEG2RAD);class xn extends d.EventDispatcher{constructor(n,i){super(),this.object=n,this.domElement=i,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new d.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:d.MOUSE.ROTATE,MIDDLE:d.MOUSE.DOLLY,RIGHT:d.MOUSE.PAN},this.touches={ONE:d.TOUCH.ROTATE,TWO:d.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return s.phi},this.getAzimuthalAngle=function(){return s.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(o){o.addEventListener("keydown",We),this._domElementKeyEvents=o},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",We),this._domElementKeyEvents=null},this.saveState=function(){e.target0.copy(e.target),e.position0.copy(e.object.position),e.zoom0=e.object.zoom},this.reset=function(){e.target.copy(e.target0),e.object.position.copy(e.position0),e.object.zoom=e.zoom0,e.object.updateProjectionMatrix(),e.dispatchEvent(Nt),e.update(),l=r.NONE},this.update=function(){const o=new d.Vector3,C=new d.Quaternion().setFromUnitVectors(n.up,new d.Vector3(0,1,0)),V=C.clone().invert(),G=new d.Vector3,Q=new d.Quaternion,fe=new d.Vector3,re=2*Math.PI;return function(){const Xe=e.object.position;o.copy(Xe).sub(e.target),o.applyQuaternion(C),s.setFromVector3(o),e.autoRotate&&l===r.NONE&&D(Re()),e.enableDamping?(s.theta+=c.theta*e.dampingFactor,s.phi+=c.phi*e.dampingFactor):(s.theta+=c.theta,s.phi+=c.phi);let Z=e.minAzimuthAngle,te=e.maxAzimuthAngle;isFinite(Z)&&isFinite(te)&&(Z<-Math.PI?Z+=re:Z>Math.PI&&(Z-=re),te<-Math.PI?te+=re:te>Math.PI&&(te-=re),Z<=te?s.theta=Math.max(Z,Math.min(te,s.theta)):s.theta=s.theta>(Z+te)/2?Math.max(Z,s.theta):Math.min(te,s.theta)),s.phi=Math.max(e.minPolarAngle,Math.min(e.maxPolarAngle,s.phi)),s.makeSafe(),e.enableDamping===!0?e.target.addScaledVector(p,e.dampingFactor):e.target.add(p),e.zoomToCursor&&ne||e.object.isOrthographicCamera?s.radius=je(s.radius):s.radius=je(s.radius*h),o.setFromSpherical(s),o.applyQuaternion(V),Xe.copy(e.target).add(o),e.object.lookAt(e.target),e.enableDamping===!0?(c.theta*=1-e.dampingFactor,c.phi*=1-e.dampingFactor,p.multiplyScalar(1-e.dampingFactor)):(c.set(0,0,0),p.set(0,0,0));let he=!1;if(e.zoomToCursor&&ne){let me=null;if(e.object.isPerspectiveCamera){const Oe=o.length();me=je(Oe*h);const xe=Oe-me;e.object.position.addScaledVector(k,xe),e.object.updateMatrixWorld()}else if(e.object.isOrthographicCamera){const Oe=new d.Vector3(K.x,K.y,0);Oe.unproject(e.object),e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/h)),e.object.updateProjectionMatrix(),he=!0;const xe=new d.Vector3(K.x,K.y,0);xe.unproject(e.object),e.object.position.sub(xe).add(Oe),e.object.updateMatrixWorld(),me=o.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),e.zoomToCursor=!1;me!==null&&(this.screenSpacePanning?e.target.set(0,0,-1).transformDirection(e.object.matrix).multiplyScalar(me).add(e.object.position):(Je.origin.copy(e.object.position),Je.direction.set(0,0,-1).transformDirection(e.object.matrix),Math.abs(e.object.up.dot(Je.direction))<On?n.lookAt(e.target):(Ut.setFromNormalAndCoplanarPoint(e.object.up,e.target),Je.intersectPlane(Ut,e.target))))}else e.object.isOrthographicCamera&&(e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/h)),e.object.updateProjectionMatrix(),he=!0);return h=1,ne=!1,he||G.distanceToSquared(e.object.position)>m||8*(1-Q.dot(e.object.quaternion))>m||fe.distanceToSquared(e.target)>0?(e.dispatchEvent(Nt),G.copy(e.object.position),Q.copy(e.object.quaternion),fe.copy(e.target),he=!1,!0):!1}}(),this.dispose=function(){e.domElement.removeEventListener("contextmenu",de),e.domElement.removeEventListener("pointerdown",ze),e.domElement.removeEventListener("pointercancel",Ce),e.domElement.removeEventListener("wheel",it),e.domElement.removeEventListener("pointermove",ue),e.domElement.removeEventListener("pointerup",Ce),e._domElementKeyEvents!==null&&(e._domElementKeyEvents.removeEventListener("keydown",We),e._domElementKeyEvents=null)};const e=this,r={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=r.NONE;const m=1e-6,s=new d.Spherical,c=new d.Spherical;let h=1;const p=new d.Vector3,g=new d.Vector2,w=new d.Vector2,x=new d.Vector2,R=new d.Vector2,_=new d.Vector2,E=new d.Vector2,b=new d.Vector2,y=new d.Vector2,P=new d.Vector2,k=new d.Vector3,K=new d.Vector2;let ne=!1;const j=[],le={};function Re(){return 2*Math.PI/60/60*e.autoRotateSpeed}function se(){return Math.pow(.95,e.zoomSpeed)}function D(o){c.theta-=o}function F(o){c.phi-=o}const B=function(){const o=new d.Vector3;return function(V,G){o.setFromMatrixColumn(G,0),o.multiplyScalar(-V),p.add(o)}}(),ee=function(){const o=new d.Vector3;return function(V,G){e.screenSpacePanning===!0?o.setFromMatrixColumn(G,1):(o.setFromMatrixColumn(G,0),o.crossVectors(e.object.up,o)),o.multiplyScalar(V),p.add(o)}}(),ae=function(){const o=new d.Vector3;return function(V,G){const Q=e.domElement;if(e.object.isPerspectiveCamera){const fe=e.object.position;o.copy(fe).sub(e.target);let re=o.length();re*=Math.tan(e.object.fov/2*Math.PI/180),B(2*V*re/Q.clientHeight,e.object.matrix),ee(2*G*re/Q.clientHeight,e.object.matrix)}else e.object.isOrthographicCamera?(B(V*(e.object.right-e.object.left)/e.object.zoom/Q.clientWidth,e.object.matrix),ee(G*(e.object.top-e.object.bottom)/e.object.zoom/Q.clientHeight,e.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),e.enablePan=!1)}}();function Pe(o){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?h/=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function Ue(o){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?h*=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function Fe(o){if(!e.zoomToCursor)return;ne=!0;const C=e.domElement.getBoundingClientRect(),V=o.clientX-C.left,G=o.clientY-C.top,Q=C.width,fe=C.height;K.x=V/Q*2-1,K.y=-(G/fe)*2+1,k.set(K.x,K.y,1).unproject(n).sub(n.position).normalize()}function je(o){return Math.max(e.minDistance,Math.min(e.maxDistance,o))}function Be(o){g.set(o.clientX,o.clientY)}function qe(o){Fe(o),b.set(o.clientX,o.clientY)}function Ve(o){R.set(o.clientX,o.clientY)}function $e(o){w.set(o.clientX,o.clientY),x.subVectors(w,g).multiplyScalar(e.rotateSpeed);const C=e.domElement;D(2*Math.PI*x.x/C.clientHeight),F(2*Math.PI*x.y/C.clientHeight),g.copy(w),e.update()}function gt(o){y.set(o.clientX,o.clientY),P.subVectors(y,b),P.y>0?Pe(se()):P.y<0&&Ue(se()),b.copy(y),e.update()}function vt(o){_.set(o.clientX,o.clientY),E.subVectors(_,R).multiplyScalar(e.panSpeed),ae(E.x,E.y),R.copy(_),e.update()}function Ge(o){Fe(o),o.deltaY<0?Ue(se()):o.deltaY>0&&Pe(se()),e.update()}function Ye(o){let C=!1;switch(o.code){case e.keys.UP:o.ctrlKey||o.metaKey||o.shiftKey?F(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):ae(0,e.keyPanSpeed),C=!0;break;case e.keys.BOTTOM:o.ctrlKey||o.metaKey||o.shiftKey?F(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):ae(0,-e.keyPanSpeed),C=!0;break;case e.keys.LEFT:o.ctrlKey||o.metaKey||o.shiftKey?D(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):ae(e.keyPanSpeed,0),C=!0;break;case e.keys.RIGHT:o.ctrlKey||o.metaKey||o.shiftKey?D(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):ae(-e.keyPanSpeed,0),C=!0;break}C&&(o.preventDefault(),e.update())}function ye(){if(j.length===1)g.set(j[0].pageX,j[0].pageY);else{const o=.5*(j[0].pageX+j[1].pageX),C=.5*(j[0].pageY+j[1].pageY);g.set(o,C)}}function Me(){if(j.length===1)R.set(j[0].pageX,j[0].pageY);else{const o=.5*(j[0].pageX+j[1].pageX),C=.5*(j[0].pageY+j[1].pageY);R.set(o,C)}}function Ee(){const o=j[0].pageX-j[1].pageX,C=j[0].pageY-j[1].pageY,V=Math.sqrt(o*o+C*C);b.set(0,V)}function bt(){e.enableZoom&&Ee(),e.enablePan&&Me()}function et(){e.enableZoom&&Ee(),e.enableRotate&&ye()}function tt(o){if(j.length==1)w.set(o.pageX,o.pageY);else{const V=Se(o),G=.5*(o.pageX+V.x),Q=.5*(o.pageY+V.y);w.set(G,Q)}x.subVectors(w,g).multiplyScalar(e.rotateSpeed);const C=e.domElement;D(2*Math.PI*x.x/C.clientHeight),F(2*Math.PI*x.y/C.clientHeight),g.copy(w)}function nt(o){if(j.length===1)_.set(o.pageX,o.pageY);else{const C=Se(o),V=.5*(o.pageX+C.x),G=.5*(o.pageY+C.y);_.set(V,G)}E.subVectors(_,R).multiplyScalar(e.panSpeed),ae(E.x,E.y),R.copy(_)}function we(o){const C=Se(o),V=o.pageX-C.x,G=o.pageY-C.y,Q=Math.sqrt(V*V+G*G);y.set(0,Q),P.set(0,Math.pow(y.y/b.y,e.zoomSpeed)),Pe(P.y),b.copy(y)}function ke(o){e.enableZoom&&we(o),e.enablePan&&nt(o)}function at(o){e.enableZoom&&we(o),e.enableRotate&&tt(o)}function ze(o){e.enabled!==!1&&(j.length===0&&(e.domElement.setPointerCapture(o.pointerId),e.domElement.addEventListener("pointermove",ue),e.domElement.addEventListener("pointerup",Ce)),Et(o),o.pointerType==="touch"?rt(o):yt(o))}function ue(o){e.enabled!==!1&&(o.pointerType==="touch"?ot(o):He(o))}function Ce(o){st(o),j.length===0&&(e.domElement.releasePointerCapture(o.pointerId),e.domElement.removeEventListener("pointermove",ue),e.domElement.removeEventListener("pointerup",Ce)),e.dispatchEvent(Lt),l=r.NONE}function yt(o){let C;switch(o.button){case 0:C=e.mouseButtons.LEFT;break;case 1:C=e.mouseButtons.MIDDLE;break;case 2:C=e.mouseButtons.RIGHT;break;default:C=-1}switch(C){case d.MOUSE.DOLLY:if(e.enableZoom===!1)return;qe(o),l=r.DOLLY;break;case d.MOUSE.ROTATE:if(o.ctrlKey||o.metaKey||o.shiftKey){if(e.enablePan===!1)return;Ve(o),l=r.PAN}else{if(e.enableRotate===!1)return;Be(o),l=r.ROTATE}break;case d.MOUSE.PAN:if(o.ctrlKey||o.metaKey||o.shiftKey){if(e.enableRotate===!1)return;Be(o),l=r.ROTATE}else{if(e.enablePan===!1)return;Ve(o),l=r.PAN}break;default:l=r.NONE}l!==r.NONE&&e.dispatchEvent(ht)}function He(o){switch(l){case r.ROTATE:if(e.enableRotate===!1)return;$e(o);break;case r.DOLLY:if(e.enableZoom===!1)return;gt(o);break;case r.PAN:if(e.enablePan===!1)return;vt(o);break}}function it(o){e.enabled===!1||e.enableZoom===!1||l!==r.NONE||(o.preventDefault(),e.dispatchEvent(ht),Ge(o),e.dispatchEvent(Lt))}function We(o){e.enabled===!1||e.enablePan===!1||Ye(o)}function rt(o){switch(Ke(o),j.length){case 1:switch(e.touches.ONE){case d.TOUCH.ROTATE:if(e.enableRotate===!1)return;ye(),l=r.TOUCH_ROTATE;break;case d.TOUCH.PAN:if(e.enablePan===!1)return;Me(),l=r.TOUCH_PAN;break;default:l=r.NONE}break;case 2:switch(e.touches.TWO){case d.TOUCH.DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;bt(),l=r.TOUCH_DOLLY_PAN;break;case d.TOUCH.DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;et(),l=r.TOUCH_DOLLY_ROTATE;break;default:l=r.NONE}break;default:l=r.NONE}l!==r.NONE&&e.dispatchEvent(ht)}function ot(o){switch(Ke(o),l){case r.TOUCH_ROTATE:if(e.enableRotate===!1)return;tt(o),e.update();break;case r.TOUCH_PAN:if(e.enablePan===!1)return;nt(o),e.update();break;case r.TOUCH_DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;ke(o),e.update();break;case r.TOUCH_DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;at(o),e.update();break;default:l=r.NONE}}function de(o){e.enabled!==!1&&o.preventDefault()}function Et(o){j.push(o)}function st(o){delete le[o.pointerId];for(let C=0;C<j.length;C++)if(j[C].pointerId==o.pointerId){j.splice(C,1);return}}function Ke(o){let C=le[o.pointerId];C===void 0&&(C=new d.Vector2,le[o.pointerId]=C),C.set(o.pageX,o.pageY)}function Se(o){const C=o.pointerId===j[0].pointerId?j[1]:j[0];return le[C.pointerId]}e.domElement.addEventListener("contextmenu",de),e.domElement.addEventListener("pointerdown",ze),e.domElement.addEventListener("pointercancel",Ce),e.domElement.addEventListener("wheel",it,{passive:!1}),this.update()}}const mt=t=>{const[n,i]=I.useState(!1),[e,r]=I.useState(t.options[t.index]),l=()=>{i(!n)},m=s=>{s!==e&&(t.onSelect(s),r(s)),i(!1)};return u.jsxs("div",{className:`dropdown ${t.up===!0?"up":""}`,children:[u.jsx("div",{className:"dropdown-toggle",onClick:l,children:e}),n&&u.jsx("ul",{className:"dropdown-menu",children:t.options.map(s=>u.jsx("li",{onClick:()=>m(s),children:s},s))})]})},ve=I.forwardRef(function(n,i){const e=n.options.indexOf(n.camera.name);return u.jsxs("div",{className:"CameraWindow",children:[u.jsx("div",{ref:i,className:"clickable"}),u.jsx(mt,{index:e,options:n.options,onSelect:n.onSelect,up:!0})]})}),Tn=`out vec3 worldPosition;
29
+ C11,8.22,10.74,8,10.43,8z`})});function Dt(t){return d.jsx(Ct.Reorder.Item,{value:t.title,children:d.jsxs("div",{children:[pn,d.jsx("span",{children:t.title}),d.jsx("button",{className:"closeIcon",onClick:()=>{t.onDelete(t.index)},children:mn})]})},t.title)}function _t(t){const[n,i]=A.useState(!1),[e,r]=A.useState(t.options),l=m=>{t.onDragComplete(m),r(m)},c=m=>{const p=[...e];p.splice(m,1),l(p)},s=[];e.forEach((m,p)=>{s.push(d.jsx(Dt,{index:p,title:m,onDelete:c},m))});let u="dropdown draggable";return t.subdropdown&&(u+=" subdropdown"),d.jsxs("div",{className:u,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:[d.jsx(ft,{title:t.title}),d.jsx(Ct.Reorder.Group,{axis:"y",values:e,onReorder:l,style:{visibility:n?"visible":"hidden"},children:s})]})}function At(t){const[n,i]=A.useState(!1),e=[];t.options.map((l,c)=>{t.onSelect!==void 0&&(l.onSelect=t.onSelect),e.push(d.jsx(It,{option:l},c))});let r="dropdown";return t.subdropdown&&(r+=" subdropdown"),d.jsxs("div",{className:r,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:[d.jsx(ft,{title:t.title}),d.jsx("ul",{style:{visibility:n?"visible":"hidden"},children:e})]})}function It(t){const{option:n}=t,[i,e]=A.useState("");let r;switch(n.type){case"draggable":r=d.jsx(_t,{title:n.title,options:n.value,onDragComplete:l=>{n.onDragComplete!==void 0&&n.onDragComplete(l)},subdropdown:!0});break;case"dropdown":r=d.jsx(At,{title:n.title,options:n.value,onSelect:n.onSelect,subdropdown:!0});break;case"option":r=d.jsx("button",{onClick:()=>{n.onSelect!==void 0&&n.onSelect(n.value),n.selectable&&(i!==n.title?e(n.title):e(""))},children:n.title});break}return d.jsx("li",{className:i===n.title?"selected":"",children:r},St())}function gn(t){let n;function i(c){var u,m,p,v,w,T,M,I,E;let s;switch(c.event){case"custom":L.dispatchEvent({type:U.CUSTOM,value:c.data});break;case"selectComponent":L.dispatchEvent({type:U.SELECT_DROPDOWN,value:c.data});break;case"draggableListUpdate":L.dispatchEvent({type:U.DRAG_UPDATE,value:c.data});break;case"addFolder":(u=t.components.get("debug"))==null||u.addFolder(c.data.name,c.data.params,c.data.parent);break;case"bindObject":(m=t.components.get("debug"))==null||m.bind(c.data.name,c.data.params,c.data.parent);break;case"updateBind":(p=t.components.get("debug"))==null||p.triggerBind(c.data.id,c.data.value);break;case"addButton":(v=t.components.get("debug"))==null||v.button(c.data.name,c.data.callback,c.data.parent);break;case"clickButton":(w=t.components.get("debug"))==null||w.triggerButton(c.data.id);break;case"setSheet":s=(T=t.components.get("theatre"))==null?void 0:T.sheets.get(c.data.sheet),s!==void 0&&(n=s,_e.setSelection([s]));break;case"setSheetObject":s=(M=t.components.get("theatre"))==null?void 0:M.sheetObjects.get(`${c.data.sheet}_${c.data.key}`),s!==void 0&&_e.setSelection([s]);break;case"updateSheetObject":s=(I=t.components.get("theatre"))==null?void 0:I.sheetObjectCBs.get(c.data.sheetObject),s!==void 0&&s(c.data.values);break;case"updateTimeline":n=(E=t.components.get("theatre"))==null?void 0:E.sheets.get(c.data.sheet),n!==void 0&&(n.sequence.position=c.data.position);break;case"getScene":L.dispatchEvent({type:U.GET_SCENE});break;case"getObject":L.dispatchEvent({type:U.GET_OBJECT,value:c.data});break;case"updateObject":L.dispatchEvent({type:U.UPDATE_OBJECT,value:c.data});break;case"createTexture":L.dispatchEvent({type:U.CREATE_TEXTURE,value:c.data});break;case"requestMethod":L.dispatchEvent({type:U.REQUEST_METHOD,value:c.data});break}}function e(c){switch(c.event){case"custom":L.dispatchEvent({type:U.CUSTOM,value:c.data});break;case"setObject":L.dispatchEvent({type:U.SET_OBJECT,value:c.data});break;case"setScene":L.dispatchEvent({type:U.SET_SCENE,value:c.data});break}}function r(){_e.ui.hide()}function l(){_e.ui.restore(),_e.onSelectionChange(m=>{m.length<1||m.forEach(p=>{var M;let v=p.address.sheetId,w="setSheet",T={};switch(p.type){case"Theatre_Sheet_PublicAPI":w="setSheet",T={sheet:p.address.sheetId},n=(M=t.components.get("theatre"))==null?void 0:M.sheets.get(p.address.sheetId);break;case"Theatre_SheetObject_PublicAPI":w="setSheetObject",v+=`_${p.address.objectKey}`,T={id:v,sheet:p.address.sheetId,key:p.address.objectKey};break}t.send({event:w,target:"app",data:T})})});let c=0;const s=()=>{if(n!==void 0&&c!==n.sequence.position){c=n.sequence.position;const m=n;t.send({event:"updateTimeline",target:"app",data:{position:c,sheet:m.address.sheetId}})}},u=()=>{s(),requestAnimationFrame(u)};s(),u()}t.listen(c=>{t.editor?e(c):i(c)}),t.editor?l():r()}const Kn="";function Ze(t){const[n,i]=A.useState(t.open!==void 0?t.open:!0),e=!n||t.children===void 0;return d.jsxs("div",{className:`accordion ${e?"hide":""}`,children:[d.jsxs("button",{className:"toggle",onClick:()=>{const r=!n;t.onToggle!==void 0&&t.onToggle(r),i(r)},children:[d.jsx("p",{className:`status ${n?"open":""}`,children:"Toggle"}),d.jsx("p",{className:"label",children:t.label})]}),t.button,d.jsx("div",{className:n?"open":"",children:d.jsx("div",{children:t.children})})]})}function ht(t){const[n,i]=A.useState(t.child.children.length>0),e=t.child.children.length>0,r=[];return t.child.children.length>0&&t.child.children.map(l=>{r.push(d.jsx(ht,{child:l,three:t.three},Math.random()))}),d.jsxs("div",{className:"childObject",children:[d.jsxs("div",{className:"child",children:[e?d.jsx("button",{className:"status",style:{backgroundPositionX:n?"-14px":"2px"},onClick:()=>{i(!n)}}):null,d.jsx("button",{className:"name",style:{left:e?"20px":"5px"},onClick:()=>{t.three.getObject(t.child.uuid)},children:t.child.name.length>0?`${t.child.name} (${t.child.type})`:`${t.child.type}::${t.child.uuid}`}),d.jsx("div",{className:`icon ${on(t.child)}`})]}),d.jsx("div",{className:n?"open":"",children:d.jsx("div",{className:"container",children:r})})]},Math.random())}function Nt(t){const n=[];return t.child.children.map(i=>{n.push(d.jsx(ht,{child:i,three:t.three},Math.random()))}),d.jsx("div",{className:`scene ${t.class!==void 0?t.class:""}`,children:n})}const Xn="",vn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA5klEQVRoge2Y0Q6EIAwE6cX//+X6cCFpSMEKVTdk501OpRNKiyelFC0b8Ps6gCwoggZF0KAIGhRBgyJoUAQNiqCxjciR9SLV//eZiAyvK3U8i/QVaQO2YyLSFVvlkdTKDjJCukh2ykR5ZEW+kHmlatl90RaBtDkK/w7CYhuRUEO0ee3l+J3m55Vm+17vtwjTnV1V3QA8qfbeUXCzRWDpiLLS+OyzvRW7IzW9R+okvclsqR09743bo0yUpc1+lSJvNsa002+Euk9GKzV7SmZDRIMiaFAEDYqgQRE0KIIGRdCgCBoUQeMEMERadX7YUz8AAAAASUVORK5CYII=";function bn(t){return"items"in t}function xe(t){function n(e,r){console.log("onChange:",e,r)}const i=[];return t.items.forEach(e=>{bn(e)?i.push(d.jsx(xe,{title:e.title,items:e.items},Math.random())):i.push(d.jsx(Le,{title:e.title,prop:e.prop,value:e.value,type:e.type,min:e.min,max:e.max,step:e.step,disabled:e.disabled,onChange:(r,l)=>{e.onChange!==void 0?e.onChange(r,l):n(r,l)}},Math.random()))}),d.jsx(Ze,{label:t.title,open:!1,children:i})}function yn(t){return!(t==="alphaHash"||t==="alphaToCoverage"||t==="attenuationDistance"||t==="colorWrite"||t==="combine"||t==="defaultAttributeValues"||t==="depthFunc"||t==="forceSinglePass"||t==="glslVersion"||t==="linewidth"||t==="normalMapType"||t==="precision"||t==="premultipliedAlpha"||t==="shadowSide"||t==="side"||t==="toneMapped"||t==="uniformsGroups"||t==="uniformsNeedUpdate"||t==="userData"||t==="vertexColors"||t==="version"||t==="wireframeLinecap"||t==="wireframeLinejoin"||t==="wireframeLinewidth"||t.slice(0,5)==="blend"||t.slice(0,4)==="clip"||t.slice(0,7)==="polygon"||t.slice(0,7)==="stencil"||t.slice(0,2)==="is")}function ge(t){switch(t){case"alphaMap":return"Alpha Map";case"anisotropyRotation":return"Anisotropy Rotation";case"aoMap":return"AO Map";case"aoMapIntensity":return"AO Map Intensity";case"attenuationColor":return"Attenuation Color";case"bumpMap":return"Bump Map";case"bumpScale":return"Bump Scale";case"clearcoatNormalScale":return"Clearcoat Normal Scale";case"clearcoatRoughness":return"Clearcoat Roughness";case"color":return"Color";case"defines":return"Defines";case"depthTest":return"Depth Test";case"depthWrite":return"Depth Write";case"displacementBias":return"Displacement Bias";case"displacementMap":return"Displacement Map";case"displacementScale":return"Displacement Scale";case"dithering":return"Dithering";case"emissive":return"Emissive";case"emissiveIntensity":return"Emissive Intensity";case"envMap":return"Environment Map";case"envMapIntensity":return"Environment Map Intensity";case"extensions":return"Extensions";case"flatShading":return"Flat Shading";case"fragmentShader":return"Fragment Shader";case"fog":return"Fog";case"gradientMap":return"Gradient Map";case"ior":return"IOR";case"iridescenceIOR":return"Iridescence IOR";case"iridescenceThicknessRange":return"Iridescence Thickness Range";case"lights":return"Lights";case"lightMap":return"Light Map";case"lightMapIntensity":return"Light Map Intensity";case"map":return"Map";case"matcap":return"Matcap";case"metalness":return"Metalness";case"name":return"Name";case"normalMap":return"Normal Map";case"normalScale":return"Normal Scale";case"opacity":return"Opacity";case"reflectivity":return"Reflectivity";case"refractionRatio":return"Refraction Ratio";case"roughness":return"Roughness";case"sheenColor":return"Sheen Color";case"sheenRoughness":return"Sheen Roughness";case"shininess":return"Shininess";case"specular":return"Specular";case"specularColor":return"Specular Color";case"specularIntensity":return"Specular Intensity";case"thickness":return"Thickness";case"transparent":return"Transparent";case"type":return"Type";case"uuid":return"UUID";case"uniforms":return"Uniforms";case"vertexShader":return"Vertex Shader";case"visible":return"Visible";case"wireframe":return"Wireframe"}return t}function En(t){return t.toLowerCase().search("intensity")>-1||t==="anisotropyRotation"||t==="bumpScale"||t==="clearcoatRoughness"||t==="displacementBias"||t==="displacementScale"||t==="metalness"||t==="opacity"||t==="reflectivity"||t==="refractionRatio"||t==="roughness"||t==="sheenRoughness"||t==="thickness"}function wn(){const t=document.createElement("input");return t.type="file",new Promise((n,i)=>{t.addEventListener("change",function(){if(t.files===null)i();else{const e=t.files[0],r=new FileReader;r.onload=function(l){n(l.target.result)},r.readAsDataURL(e)}}),t.click()})}function Lt(t,n,i){const e=[];for(const r in t){if(!yn(r))continue;const l=typeof t[r],c=t[r];if(l==="boolean"||l==="number"||l==="string"){const s={title:ge(r),prop:r,type:l,value:c,min:void 0,max:void 0,onChange:(u,m)=>{var v;i.updateObject(n.uuid,`material.${u}`,m),l==="boolean"&&i.updateObject(n.uuid,"material.needsUpdate",!0);const p=(v=i.scene)==null?void 0:v.getObjectByProperty("uuid",n.uuid);p!==void 0&&$(p,`material.${u}`,m)}};En(r)&&(s.value=Number(c),s.type="range",s.min=0,s.max=1,s.step=.01),e.push(s)}else if(l==="object")if(c.isColor)e.push({title:ge(r),prop:r,type:"color",value:c,onChange:(s,u)=>{var v;const m=new f.Color(u);i.updateObject(n.uuid,`material.${s}`,m);const p=(v=i.scene)==null?void 0:v.getObjectByProperty("uuid",n.uuid);p!==void 0&&$(p,`material.${s}`,m)}});else if(Array.isArray(c)){const s=[];for(const u in c)s.push({title:`${u}`,type:`${typeof c[u]}`,value:c[u],onChange:(m,p)=>{var w;i.updateObject(n.uuid,`material.${r}`,p);const v=(w=i.scene)==null?void 0:w.getObjectByProperty("uuid",n.uuid);v!==void 0&&$(v,`material.${r}`,p)}});e.push({title:ge(r),items:s})}else{const s=[];for(const u in c){const m=c[u];switch(typeof m){case"boolean":case"number":case"string":u==="src"?e.push({title:ge(r),type:"image",value:m,onChange:(v,w)=>{var M;i.createTexture(n.uuid,`material.${r}`,w);const T=(M=i.scene)==null?void 0:M.getObjectByProperty("uuid",n.uuid);T!==void 0&&ut(w).then(I=>{$(T,`material.${r}`,I),$(T,"material.needsUpdate",!0)})}}):s.push({title:`${ge(u)}`,prop:`material.${r}.${u}`,type:`${typeof t[r][u]}`,value:c[u],onChange:(v,w)=>{var M;i.updateObject(n.uuid,`material.${r}.${u}`,w);const T=(M=i.scene)==null?void 0:M.getObjectByProperty("uuid",n.uuid);T!==void 0&&$(T,`material.${r}.${u}`,w)}});break;case"object":m.value!==void 0&&m.value.src!==void 0?s.push({title:ge(u),type:"image",value:m.value.src,onChange:(v,w)=>{var M;i.createTexture(n.uuid,`material.${r}.${u}.value`,w);const T=(M=i.scene)==null?void 0:M.getObjectByProperty("uuid",n.uuid);T!==void 0&&ut(w).then(I=>{$(T,`material.${r}.${u}.value`,I)})}}):s.push({title:u,type:`${typeof m.value}`,value:m.value,onChange:(v,w)=>{var M;i.updateObject(n.uuid,`material.${r}.${u}.value`,w);const T=(M=i.scene)==null?void 0:M.getObjectByProperty("uuid",n.uuid);T!==void 0&&$(T,`material.${r}.${u}.value`,w)}});break}}s.length>0&&e.push({title:ge(r),items:s})}else c!==void 0&&console.log("other:",r,l,c)}return e.sort((r,l)=>r.title<l.title?-1:r.title>l.title?1:0),e.push({title:"Update Material",type:"button",onChange:()=>{i.updateObject(n.uuid,"material.needsUpdate",!0)}}),e}function Cn(t,n){const i=t.material;if(Array.isArray(i)){const e=[],r=i.length;for(let l=0;l<r;l++)e.push(d.jsx(xe,{title:`Material ${l}`,items:Lt(i[l],t,n)}));return d.jsx(d.Fragment,{children:e})}else return d.jsx(xe,{title:"Material",items:Lt(i,t,n)})}function Le(t){let n=t.value;n!==void 0&&n.isColor!==void 0&&(n=Tt(t.value));const[i,e]=A.useState(n),r=A.useRef(null),l=A.useRef(null),c=A.useRef(null);A.useEffect(()=>{var R;let p=!1,v=-1,w=0,T=Number(i);const M=k=>{p=!0,w=T,v=k.clientX},I=k=>{if(!p)return;const K=t.step!==void 0?t.step:1,ne=(k.clientX-v)*K;T=Number((w+ne).toFixed(4)),l.current!==null&&(l.current.value=T.toString()),t.onChange!==void 0&&t.onChange(t.prop!==void 0?t.prop:t.title,T)},E=()=>{p=!1},y=()=>{p=!1},b=t.type==="number";return b&&((R=r.current)==null||R.addEventListener("mousedown",M,!1),document.addEventListener("mouseup",E,!1),document.addEventListener("mousemove",I,!1),document.addEventListener("contextmenu",y,!1)),()=>{var k;b&&((k=r.current)==null||k.removeEventListener("mousedown",M),document.removeEventListener("mouseup",E),document.removeEventListener("mousemove",I),document.removeEventListener("contextmenu",y))}},[i]);const s=t.type==="string"&&(i.length>100||i.search(`
30
+ `)>-1),u=s||t.type==="image",m=p=>{let v=p.target.value;t.type==="boolean"&&(v=p.target.checked),e(v),t.onChange!==void 0&&t.onChange(t.prop!==void 0?t.prop:t.title,v)};return d.jsxs("div",{className:`field ${u?"block":""}`,children:[t.type!=="button"&&d.jsx("label",{ref:r,children:t.title},"fieldLabel"),t.type==="string"&&!s&&d.jsx("input",{type:"text",disabled:t.disabled,onChange:m,value:i}),t.type==="string"&&s&&d.jsx("textarea",{cols:50,rows:10,disabled:!0,onChange:m,value:i}),t.type==="boolean"&&d.jsx("input",{type:"checkbox",disabled:t.disabled,onChange:m,checked:i}),t.type==="number"&&d.jsx("input",{ref:l,type:"number",value:i,min:t.min,max:t.max,step:t.step,onChange:m}),t.type==="range"&&d.jsxs(d.Fragment,{children:[d.jsx("input",{type:"text",value:i.toString(),onChange:m,className:"min"}),d.jsx("input",{disabled:t.disabled,type:"range",value:i,min:t.min,max:t.max,step:t.step,onChange:m})]}),t.type==="color"&&d.jsxs(d.Fragment,{children:[d.jsx("input",{type:"text",value:i.toString(),onChange:m,className:"color"}),d.jsx("input",{type:"color",value:i,onChange:m})]}),t.type==="button"&&d.jsx("button",{onClick:()=>{t.onChange!==void 0&&t.onChange(t.prop!==void 0?t.prop:t.title,!0)},children:t.title}),t.type==="image"&&d.jsx("img",{ref:c,onClick:()=>{wn().then(p=>{c.current.src=p,t.onChange!==void 0&&t.onChange(t.prop!==void 0?t.prop:t.title,p)})},src:i.length>0?i:vn})]})}function Ut(t){switch(t){case"fov":return"FOV";case"zoom":return"Zoom";case"near":return"Near";case"far":return"Far";case"focus":return"Focus";case"aspect":return"Aspect";case"filmGauge":return"Film Gauge";case"filmOffset":return"Film Offset";case"left":return"Left";case"right":return"Right";case"top":return"Top";case"bottom":return"Bottom"}return t}function Sn(t,n){const i=[];if(t.perspectiveCameraInfo!==void 0)for(const e in t.perspectiveCameraInfo)i.push({title:Ut(e),prop:e,type:"number",step:.01,value:t.perspectiveCameraInfo[e],onChange:(r,l)=>{var s;n.updateObject(t.uuid,r,l),n.requestMethod(t.uuid,"updateProjectionMatrix");const c=(s=n.scene)==null?void 0:s.getObjectByProperty("uuid",t.uuid);c!==void 0&&($(c,r,l),c.updateProjectionMatrix())}});else if(t.orthographicCameraInfo!==void 0)for(const e in t.orthographicCameraInfo)i.push({title:Ut(e),prop:e,type:"number",step:.01,value:t.perspectiveCameraInfo[e],onChange:(r,l)=>{var s;n.updateObject(t.uuid,r,l),n.requestMethod(t.uuid,"updateProjectionMatrix");const c=(s=n.scene)==null?void 0:s.getObjectByProperty("uuid",t.uuid);c!==void 0&&($(c,r,l),c.updateProjectionMatrix())}});return d.jsx(xe,{title:"Camera",items:i})}function On(t,n){const i=new f.Matrix4;i.elements=t.matrix;const e=new f.Vector3,r=new f.Euler,l=new f.Vector3;t.uuid.length>0&&(e.setFromMatrixPosition(i),r.setFromRotationMatrix(i),l.setFromMatrixScale(i));const c=(u,m)=>{var v;n.updateObject(t.uuid,u,m);const p=(v=n.scene)==null?void 0:v.getObjectByProperty("uuid",t.uuid);p!==void 0&&$(p,u,m)},s=[{title:"Position",items:[{title:"X",prop:"position.x",type:"number",value:e.x,onChange:c},{title:"Y",prop:"position.y",type:"number",value:e.y,onChange:c},{title:"Z",prop:"position.z",type:"number",value:e.z,onChange:c}]},{title:"Rotation",items:[{title:"X",prop:"rotation.x",type:"number",value:r.x,min:-Math.PI,max:Math.PI,step:.01,onChange:c},{title:"Y",prop:"rotation.y",type:"number",value:r.y,min:-Math.PI,max:Math.PI,step:.01,onChange:c},{title:"Z",prop:"rotation.z",type:"number",value:r.z,min:-Math.PI,max:Math.PI,step:.01,onChange:c}]},{title:"Scale",items:[{title:"X",prop:"scale.x",type:"number",value:l.x,step:.01,onChange:c},{title:"Y",prop:"scale.y",type:"number",value:l.y,step:.01,onChange:c},{title:"Z",prop:"scale.z",type:"number",value:l.z,step:.01,onChange:c}]}];return d.jsx(xe,{title:"Transform",items:s})}function Ft(t){switch(t){case"color":return"Color";case"intensity":return"Intensity";case"decay":return"Decay";case"distance":return"Distance";case"angle":return"Angle";case"penumbra":return"Penumbra";case"groundColor":return"Ground Color"}return t}function Tn(t,n){const i=[];if(t.lightInfo!==void 0)for(const e in t.lightInfo){const r=t.lightInfo[e];r!==void 0&&(r.isColor!==void 0?i.push({title:Ft(e),prop:e,type:"color",value:r,onChange:(l,c)=>{var m;const s=new f.Color(c);n.updateObject(t.uuid,l,s);const u=(m=n.scene)==null?void 0:m.getObjectByProperty("uuid",t.uuid);u!==void 0&&$(u,l,s)}}):i.push({title:Ft(e),prop:e,type:typeof r,value:r,step:typeof r=="number"?.01:void 0,onChange:(l,c)=>{var u;n.updateObject(t.uuid,l,c);const s=(u=n.scene)==null?void 0:u.getObjectByProperty("uuid",t.uuid);s!==void 0&&$(s,l,c)}}))}return d.jsx(xe,{title:"Light",items:i})}function Bt(t){const[n,i]=A.useState(-1),[e,r]=A.useState({name:"",uuid:"",type:"",visible:!1,matrix:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]});return A.useEffect(()=>{function l(c){const s=c.value;r(s),i(Date.now())}return L.addEventListener(U.SET_OBJECT,l),()=>{L.removeEventListener(U.SET_OBJECT,l)}},[]),d.jsx("div",{id:"Inspector",className:t.class,children:e.uuid.length>0&&d.jsxs(d.Fragment,{children:[d.jsx(Le,{type:"string",title:"Name",prop:"name",value:e.name,disabled:!0}),d.jsx(Le,{type:"string",title:"Type",prop:"type",value:e.type,disabled:!0}),d.jsx(Le,{type:"string",title:"UUID",prop:"uuid",value:e.uuid,disabled:!0}),d.jsx(Le,{type:"boolean",title:"Visible",prop:"visible",value:e.visible,onChange:(l,c)=>{t.three.updateObject(e.uuid,l,c)}}),On(e,t.three),e.type.search("Camera")>-1?Sn(e,t.three):null,e.type.search("Light")>-1?Tn(e,t.three):null,e.material!==void 0?Cn(e,t.three):null]})},n)}class xn extends A.Component{constructor(i){super(i);z(this,"three");z(this,"onRefresh",()=>{this.three.getScene()});z(this,"setScene",i=>{this.setState(()=>({scene:i.value}))});this.state={scene:i.scene!==void 0?i.scene:null},this.three=i.three,L.addEventListener(U.SET_SCENE,this.setScene)}componentDidMount(){this.onRefresh()}componentWillUnmount(){L.removeEventListener(U.SET_SCENE,this.setScene)}render(){var r;const i=this.componentState.scene!==null,e="Hierarchy"+(i?`: ${(r=this.componentState.scene)==null?void 0:r.name}`:"");return d.jsx("div",{id:"SceneHierarchy",children:d.jsxs(d.Fragment,{children:[i&&d.jsx(Ze,{label:e,button:d.jsx("button",{className:"icon refresh hideText",onClick:this.onRefresh,children:"Refresh"}),open:!0,children:d.jsx(Nt,{child:this.componentState.scene,three:this.three})}),d.jsx(Ze,{label:"Inspector",children:d.jsx(Bt,{three:this.three},"Inspector")})]})},"SceneHierarchy")}get componentState(){return this.state}}function Rn(t){const n=s=>{const u=t.scene.getObjectByProperty("uuid",s.value);u!==void 0&&t.three.setObject(u)},i=(s,u,m)=>{const p=t.scene.getObjectByProperty("uuid",s);p!==void 0&&$(p,u,m)},e=s=>{const u=s.value,{key:m,value:p,uuid:v}=u;i(v,m,p)},r=s=>{const u=s.value;ut(u.value).then(m=>{i(u.uuid,u.key,m),i(u.uuid,"material.needsUpdate",!0)})},l=()=>{t.three.setScene(t.scene)},c=s=>{const{key:u,uuid:m,value:p}=s.value,v=t.scene.getObjectByProperty("uuid",m);if(v!==void 0)try{v[u](p)}catch(w){console.log("Error requesting method:"),console.log(w),console.log(u),console.log(p)}};return A.useEffect(()=>(L.addEventListener(U.GET_OBJECT,n),L.addEventListener(U.GET_SCENE,l),L.addEventListener(U.UPDATE_OBJECT,e),L.addEventListener(U.CREATE_TEXTURE,r),L.addEventListener(U.REQUEST_METHOD,c),()=>{L.removeEventListener(U.GET_OBJECT,n),L.removeEventListener(U.GET_SCENE,l),L.removeEventListener(U.UPDATE_OBJECT,e),L.removeEventListener(U.CREATE_TEXTURE,r),L.removeEventListener(U.REQUEST_METHOD,c)}),[]),null}const Vt={type:"change"},mt={type:"start"},Gt={type:"end"},Je=new f.Ray,Yt=new f.Plane,Pn=Math.cos(70*f.MathUtils.DEG2RAD);class jn extends f.EventDispatcher{constructor(n,i){super(),this.object=n,this.domElement=i,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new f.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:f.MOUSE.ROTATE,MIDDLE:f.MOUSE.DOLLY,RIGHT:f.MOUSE.PAN},this.touches={ONE:f.TOUCH.ROTATE,TWO:f.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return s.phi},this.getAzimuthalAngle=function(){return s.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(o){o.addEventListener("keydown",We),this._domElementKeyEvents=o},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",We),this._domElementKeyEvents=null},this.saveState=function(){e.target0.copy(e.target),e.position0.copy(e.object.position),e.zoom0=e.object.zoom},this.reset=function(){e.target.copy(e.target0),e.object.position.copy(e.position0),e.object.zoom=e.zoom0,e.object.updateProjectionMatrix(),e.dispatchEvent(Vt),e.update(),l=r.NONE},this.update=function(){const o=new f.Vector3,C=new f.Quaternion().setFromUnitVectors(n.up,new f.Vector3(0,1,0)),V=C.clone().invert(),G=new f.Vector3,Q=new f.Quaternion,fe=new f.Vector3,re=2*Math.PI;return function(){const Xe=e.object.position;o.copy(Xe).sub(e.target),o.applyQuaternion(C),s.setFromVector3(o),e.autoRotate&&l===r.NONE&&D(Re()),e.enableDamping?(s.theta+=u.theta*e.dampingFactor,s.phi+=u.phi*e.dampingFactor):(s.theta+=u.theta,s.phi+=u.phi);let Z=e.minAzimuthAngle,te=e.maxAzimuthAngle;isFinite(Z)&&isFinite(te)&&(Z<-Math.PI?Z+=re:Z>Math.PI&&(Z-=re),te<-Math.PI?te+=re:te>Math.PI&&(te-=re),Z<=te?s.theta=Math.max(Z,Math.min(te,s.theta)):s.theta=s.theta>(Z+te)/2?Math.max(Z,s.theta):Math.min(te,s.theta)),s.phi=Math.max(e.minPolarAngle,Math.min(e.maxPolarAngle,s.phi)),s.makeSafe(),e.enableDamping===!0?e.target.addScaledVector(p,e.dampingFactor):e.target.add(p),e.zoomToCursor&&ne||e.object.isOrthographicCamera?s.radius=je(s.radius):s.radius=je(s.radius*m),o.setFromSpherical(s),o.applyQuaternion(V),Xe.copy(e.target).add(o),e.object.lookAt(e.target),e.enableDamping===!0?(u.theta*=1-e.dampingFactor,u.phi*=1-e.dampingFactor,p.multiplyScalar(1-e.dampingFactor)):(u.set(0,0,0),p.set(0,0,0));let he=!1;if(e.zoomToCursor&&ne){let me=null;if(e.object.isPerspectiveCamera){const Oe=o.length();me=je(Oe*m);const Te=Oe-me;e.object.position.addScaledVector(k,Te),e.object.updateMatrixWorld()}else if(e.object.isOrthographicCamera){const Oe=new f.Vector3(K.x,K.y,0);Oe.unproject(e.object),e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/m)),e.object.updateProjectionMatrix(),he=!0;const Te=new f.Vector3(K.x,K.y,0);Te.unproject(e.object),e.object.position.sub(Te).add(Oe),e.object.updateMatrixWorld(),me=o.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),e.zoomToCursor=!1;me!==null&&(this.screenSpacePanning?e.target.set(0,0,-1).transformDirection(e.object.matrix).multiplyScalar(me).add(e.object.position):(Je.origin.copy(e.object.position),Je.direction.set(0,0,-1).transformDirection(e.object.matrix),Math.abs(e.object.up.dot(Je.direction))<Pn?n.lookAt(e.target):(Yt.setFromNormalAndCoplanarPoint(e.object.up,e.target),Je.intersectPlane(Yt,e.target))))}else e.object.isOrthographicCamera&&(e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/m)),e.object.updateProjectionMatrix(),he=!0);return m=1,ne=!1,he||G.distanceToSquared(e.object.position)>c||8*(1-Q.dot(e.object.quaternion))>c||fe.distanceToSquared(e.target)>0?(e.dispatchEvent(Vt),G.copy(e.object.position),Q.copy(e.object.quaternion),fe.copy(e.target),he=!1,!0):!1}}(),this.dispose=function(){e.domElement.removeEventListener("contextmenu",de),e.domElement.removeEventListener("pointerdown",ze),e.domElement.removeEventListener("pointercancel",Ce),e.domElement.removeEventListener("wheel",it),e.domElement.removeEventListener("pointermove",ue),e.domElement.removeEventListener("pointerup",Ce),e._domElementKeyEvents!==null&&(e._domElementKeyEvents.removeEventListener("keydown",We),e._domElementKeyEvents=null)};const e=this,r={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=r.NONE;const c=1e-6,s=new f.Spherical,u=new f.Spherical;let m=1;const p=new f.Vector3,v=new f.Vector2,w=new f.Vector2,T=new f.Vector2,M=new f.Vector2,I=new f.Vector2,E=new f.Vector2,y=new f.Vector2,b=new f.Vector2,R=new f.Vector2,k=new f.Vector3,K=new f.Vector2;let ne=!1;const P=[],le={};function Re(){return 2*Math.PI/60/60*e.autoRotateSpeed}function se(){return Math.pow(.95,e.zoomSpeed)}function D(o){u.theta-=o}function F(o){u.phi-=o}const B=function(){const o=new f.Vector3;return function(V,G){o.setFromMatrixColumn(G,0),o.multiplyScalar(-V),p.add(o)}}(),ee=function(){const o=new f.Vector3;return function(V,G){e.screenSpacePanning===!0?o.setFromMatrixColumn(G,1):(o.setFromMatrixColumn(G,0),o.crossVectors(e.object.up,o)),o.multiplyScalar(V),p.add(o)}}(),ae=function(){const o=new f.Vector3;return function(V,G){const Q=e.domElement;if(e.object.isPerspectiveCamera){const fe=e.object.position;o.copy(fe).sub(e.target);let re=o.length();re*=Math.tan(e.object.fov/2*Math.PI/180),B(2*V*re/Q.clientHeight,e.object.matrix),ee(2*G*re/Q.clientHeight,e.object.matrix)}else e.object.isOrthographicCamera?(B(V*(e.object.right-e.object.left)/e.object.zoom/Q.clientWidth,e.object.matrix),ee(G*(e.object.top-e.object.bottom)/e.object.zoom/Q.clientHeight,e.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),e.enablePan=!1)}}();function Pe(o){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?m/=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function Ue(o){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?m*=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function Fe(o){if(!e.zoomToCursor)return;ne=!0;const C=e.domElement.getBoundingClientRect(),V=o.clientX-C.left,G=o.clientY-C.top,Q=C.width,fe=C.height;K.x=V/Q*2-1,K.y=-(G/fe)*2+1,k.set(K.x,K.y,1).unproject(n).sub(n.position).normalize()}function je(o){return Math.max(e.minDistance,Math.min(e.maxDistance,o))}function Be(o){v.set(o.clientX,o.clientY)}function qe(o){Fe(o),y.set(o.clientX,o.clientY)}function Ve(o){M.set(o.clientX,o.clientY)}function $e(o){w.set(o.clientX,o.clientY),T.subVectors(w,v).multiplyScalar(e.rotateSpeed);const C=e.domElement;D(2*Math.PI*T.x/C.clientHeight),F(2*Math.PI*T.y/C.clientHeight),v.copy(w),e.update()}function vt(o){b.set(o.clientX,o.clientY),R.subVectors(b,y),R.y>0?Pe(se()):R.y<0&&Ue(se()),y.copy(b),e.update()}function bt(o){I.set(o.clientX,o.clientY),E.subVectors(I,M).multiplyScalar(e.panSpeed),ae(E.x,E.y),M.copy(I),e.update()}function Ge(o){Fe(o),o.deltaY<0?Ue(se()):o.deltaY>0&&Pe(se()),e.update()}function Ye(o){let C=!1;switch(o.code){case e.keys.UP:o.ctrlKey||o.metaKey||o.shiftKey?F(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):ae(0,e.keyPanSpeed),C=!0;break;case e.keys.BOTTOM:o.ctrlKey||o.metaKey||o.shiftKey?F(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):ae(0,-e.keyPanSpeed),C=!0;break;case e.keys.LEFT:o.ctrlKey||o.metaKey||o.shiftKey?D(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):ae(e.keyPanSpeed,0),C=!0;break;case e.keys.RIGHT:o.ctrlKey||o.metaKey||o.shiftKey?D(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):ae(-e.keyPanSpeed,0),C=!0;break}C&&(o.preventDefault(),e.update())}function ye(){if(P.length===1)v.set(P[0].pageX,P[0].pageY);else{const o=.5*(P[0].pageX+P[1].pageX),C=.5*(P[0].pageY+P[1].pageY);v.set(o,C)}}function Me(){if(P.length===1)M.set(P[0].pageX,P[0].pageY);else{const o=.5*(P[0].pageX+P[1].pageX),C=.5*(P[0].pageY+P[1].pageY);M.set(o,C)}}function Ee(){const o=P[0].pageX-P[1].pageX,C=P[0].pageY-P[1].pageY,V=Math.sqrt(o*o+C*C);y.set(0,V)}function yt(){e.enableZoom&&Ee(),e.enablePan&&Me()}function et(){e.enableZoom&&Ee(),e.enableRotate&&ye()}function tt(o){if(P.length==1)w.set(o.pageX,o.pageY);else{const V=Se(o),G=.5*(o.pageX+V.x),Q=.5*(o.pageY+V.y);w.set(G,Q)}T.subVectors(w,v).multiplyScalar(e.rotateSpeed);const C=e.domElement;D(2*Math.PI*T.x/C.clientHeight),F(2*Math.PI*T.y/C.clientHeight),v.copy(w)}function nt(o){if(P.length===1)I.set(o.pageX,o.pageY);else{const C=Se(o),V=.5*(o.pageX+C.x),G=.5*(o.pageY+C.y);I.set(V,G)}E.subVectors(I,M).multiplyScalar(e.panSpeed),ae(E.x,E.y),M.copy(I)}function we(o){const C=Se(o),V=o.pageX-C.x,G=o.pageY-C.y,Q=Math.sqrt(V*V+G*G);b.set(0,Q),R.set(0,Math.pow(b.y/y.y,e.zoomSpeed)),Pe(R.y),y.copy(b)}function ke(o){e.enableZoom&&we(o),e.enablePan&&nt(o)}function at(o){e.enableZoom&&we(o),e.enableRotate&&tt(o)}function ze(o){e.enabled!==!1&&(P.length===0&&(e.domElement.setPointerCapture(o.pointerId),e.domElement.addEventListener("pointermove",ue),e.domElement.addEventListener("pointerup",Ce)),wt(o),o.pointerType==="touch"?rt(o):Et(o))}function ue(o){e.enabled!==!1&&(o.pointerType==="touch"?ot(o):He(o))}function Ce(o){st(o),P.length===0&&(e.domElement.releasePointerCapture(o.pointerId),e.domElement.removeEventListener("pointermove",ue),e.domElement.removeEventListener("pointerup",Ce)),e.dispatchEvent(Gt),l=r.NONE}function Et(o){let C;switch(o.button){case 0:C=e.mouseButtons.LEFT;break;case 1:C=e.mouseButtons.MIDDLE;break;case 2:C=e.mouseButtons.RIGHT;break;default:C=-1}switch(C){case f.MOUSE.DOLLY:if(e.enableZoom===!1)return;qe(o),l=r.DOLLY;break;case f.MOUSE.ROTATE:if(o.ctrlKey||o.metaKey||o.shiftKey){if(e.enablePan===!1)return;Ve(o),l=r.PAN}else{if(e.enableRotate===!1)return;Be(o),l=r.ROTATE}break;case f.MOUSE.PAN:if(o.ctrlKey||o.metaKey||o.shiftKey){if(e.enableRotate===!1)return;Be(o),l=r.ROTATE}else{if(e.enablePan===!1)return;Ve(o),l=r.PAN}break;default:l=r.NONE}l!==r.NONE&&e.dispatchEvent(mt)}function He(o){switch(l){case r.ROTATE:if(e.enableRotate===!1)return;$e(o);break;case r.DOLLY:if(e.enableZoom===!1)return;vt(o);break;case r.PAN:if(e.enablePan===!1)return;bt(o);break}}function it(o){e.enabled===!1||e.enableZoom===!1||l!==r.NONE||(o.preventDefault(),e.dispatchEvent(mt),Ge(o),e.dispatchEvent(Gt))}function We(o){e.enabled===!1||e.enablePan===!1||Ye(o)}function rt(o){switch(Ke(o),P.length){case 1:switch(e.touches.ONE){case f.TOUCH.ROTATE:if(e.enableRotate===!1)return;ye(),l=r.TOUCH_ROTATE;break;case f.TOUCH.PAN:if(e.enablePan===!1)return;Me(),l=r.TOUCH_PAN;break;default:l=r.NONE}break;case 2:switch(e.touches.TWO){case f.TOUCH.DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;yt(),l=r.TOUCH_DOLLY_PAN;break;case f.TOUCH.DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;et(),l=r.TOUCH_DOLLY_ROTATE;break;default:l=r.NONE}break;default:l=r.NONE}l!==r.NONE&&e.dispatchEvent(mt)}function ot(o){switch(Ke(o),l){case r.TOUCH_ROTATE:if(e.enableRotate===!1)return;tt(o),e.update();break;case r.TOUCH_PAN:if(e.enablePan===!1)return;nt(o),e.update();break;case r.TOUCH_DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;ke(o),e.update();break;case r.TOUCH_DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;at(o),e.update();break;default:l=r.NONE}}function de(o){e.enabled!==!1&&o.preventDefault()}function wt(o){P.push(o)}function st(o){delete le[o.pointerId];for(let C=0;C<P.length;C++)if(P[C].pointerId==o.pointerId){P.splice(C,1);return}}function Ke(o){let C=le[o.pointerId];C===void 0&&(C=new f.Vector2,le[o.pointerId]=C),C.set(o.pageX,o.pageY)}function Se(o){const C=o.pointerId===P[0].pointerId?P[1]:P[0];return le[C.pointerId]}e.domElement.addEventListener("contextmenu",de),e.domElement.addEventListener("pointerdown",ze),e.domElement.addEventListener("pointercancel",Ce),e.domElement.addEventListener("wheel",it,{passive:!1}),this.update()}}const pt=t=>{const[n,i]=A.useState(!1),[e,r]=A.useState(t.options[t.index]),l=()=>{i(!n)},c=s=>{s!==e&&(t.onSelect(s),r(s)),i(!1)};return d.jsxs("div",{className:`dropdown ${t.up===!0?"up":""}`,children:[d.jsx("div",{className:"dropdown-toggle",onClick:l,children:e}),n&&d.jsx("ul",{className:"dropdown-menu",children:t.options.map(s=>d.jsx("li",{onClick:()=>c(s),children:s},s))})]})},ve=A.forwardRef(function(n,i){const e=n.options.indexOf(n.camera.name);return d.jsxs("div",{className:"CameraWindow",children:[d.jsx("div",{ref:i,className:"clickable"}),d.jsx(pt,{index:e,options:n.options,onSelect:n.onSelect,up:!0})]})}),Mn=`out vec3 worldPosition;
31
31
  uniform float uDistance;
32
32
 
33
33
  void main() {
@@ -36,7 +36,7 @@ void main() {
36
36
  worldPosition.xz += cameraPosition.xz;
37
37
 
38
38
  gl_Position = projectionMatrix * modelViewMatrix * vec4(worldPosition, 1.0);
39
- }`,Rn=`out vec4 fragColor;
39
+ }`,kn=`out vec4 fragColor;
40
40
  in vec3 worldPosition;
41
41
 
42
42
  uniform float uDivisions;
@@ -103,4 +103,4 @@ void main() {
103
103
  fragColor.a = mix(fragColor.a, baseOpacity * uGridOpacity, nextGrid);
104
104
 
105
105
  if (fragColor.a <= 0.0) discard;
106
- }`;class Pn extends d.ShaderMaterial{constructor(n){super({extensions:{derivatives:!0},glslVersion:d.GLSL3,side:d.DoubleSide,transparent:!0,uniforms:{uScale:{value:(n==null?void 0:n.scale)!==void 0?n==null?void 0:n.scale:.1},uDivisions:{value:(n==null?void 0:n.divisions)!==void 0?n==null?void 0:n.divisions:10},uColor:{value:(n==null?void 0:n.color)!==void 0?n==null?void 0:n.color:new d.Color(16777215)},uDistance:{value:(n==null?void 0:n.distance)!==void 0?n==null?void 0:n.distance:1e4},uSubgridOpacity:{value:(n==null?void 0:n.subgridOpacity)!==void 0?n==null?void 0:n.subgridOpacity:.15},uGridOpacity:{value:(n==null?void 0:n.gridOpacity)!==void 0?n==null?void 0:n.gridOpacity:.25}},vertexShader:Tn,fragmentShader:Rn,name:"InfiniteGrid",depthWrite:!1})}}class Ft extends d.Mesh{constructor(){const i=new Pn;super(new d.PlaneGeometry(2,2),i);z(this,"gridMaterial");this.gridMaterial=i,this.frustumCulled=!1,this.name="InfiniteGridHelper",this.position.y=.1}update(){this.gridMaterial.needsUpdate=!0}}const Hn="",Bt=["Single","Side by Side","Stacked","Quad"],J=new Map,X=new Map,oe=new Map;function be(t,n){const i=new d.OrthographicCamera(-100,100,100,-100,50,3e3);return i.name=t,i.position.copy(n),i.lookAt(0,0,0),J.set(t,i),i}be("Top",new d.Vector3(0,1e3,0)),be("Bottom",new d.Vector3(0,-1e3,0)),be("Left",new d.Vector3(-1e3,0,0)),be("Right",new d.Vector3(1e3,0,0)),be("Front",new d.Vector3(0,0,1e3)),be("Back",new d.Vector3(0,0,-1e3)),be("Orthographic",new d.Vector3(1e3,1e3,1e3));const Qe=new d.PerspectiveCamera(60,1,50,3e3);Qe.name="Debug",Qe.position.set(500,500,500),Qe.lookAt(0,0,0),J.set("Debug",Qe);let pt="Default";const jn=["Default","Normals","Wireframe"],Mn=new d.MeshNormalMaterial,kn=new d.MeshBasicMaterial({opacity:.33,transparent:!0,wireframe:!0}),H=new d.Scene;function Dn(t){const[n,i]=I.useState(t.mode!==void 0?t.mode:"Quad"),e=I.useRef(null),r=I.useRef(null),l=I.useRef(null),m=I.useRef(null);let s=J.get("Debug"),c=J.get("Orthographic"),h=J.get("Front"),p=J.get("Top");const g=(E,b)=>{const y=X.get(E.name);y!==void 0&&y.dispose(),X.delete(E.name);const P=oe.get(E.name);P!==void 0&&(H.remove(P),P.dispose()),oe.delete(E.name);const k=new xn(E,b);switch(E.name){case"Top":case"Bottom":case"Left":case"Right":case"Front":case"Back":k.enableRotate=!1;break}if(X.set(E.name,k),E instanceof d.PerspectiveCamera){const K=new d.CameraHelper(E);oe.set(E.name,K),H.add(K)}},w=E=>{const b=oe.get(E.name);b!==void 0&&(H.remove(b),b.dispose(),oe.delete(E.name));const y=X.get(E.name);y!==void 0&&(y.dispose(),X.delete(E.name))},x=()=>{X.forEach((E,b)=>{E.dispose();const y=oe.get(b);y!==void 0&&(H.remove(y),y.dispose()),oe.delete(b),X.delete(b)}),X.clear(),oe.clear()},R=()=>{switch(n){case"Single":g(s,e.current);break;case"Side by Side":case"Stacked":g(s,e.current),g(c,r.current);break;case"Quad":g(s,e.current),g(c,r.current),g(h,l.current),g(p,m.current);break}};I.useEffect(()=>{H.name="Debug Scene",H.add(t.scene);const E=new Ft;H.add(E);const b=new d.AxesHelper(500);b.name="axisHelper",H.add(b)},[]),I.useEffect(()=>{const E=t.renderer.getSize(new d.Vector2);let b=E.x,y=E.y,P=Math.floor(b/2),k=Math.floor(y/2),K=-1;const ne=()=>{b=window.innerWidth-300,y=window.innerHeight,P=Math.floor(b/2),k=Math.floor(y/2);let D=b,F=y;switch(n){case"Side by Side":D=P,F=y;break;case"Stacked":D=b,F=k;break;case"Quad":D=P,F=k;break}J.forEach(B=>{var ee;B instanceof d.OrthographicCamera?(B.left=D/-2,B.right=D/2,B.top=F/2,B.bottom=F/-2,B.updateProjectionMatrix()):B instanceof d.PerspectiveCamera&&(B.aspect=D/F,B.updateProjectionMatrix(),(ee=oe.get(B.name))==null||ee.update())})},j=()=>{t.renderer.setViewport(0,0,b,y),t.renderer.setScissor(0,0,b,y),t.renderer.render(H,s)},le=()=>{if(n==="Side by Side")t.renderer.setViewport(0,0,P,y),t.renderer.setScissor(0,0,P,y),t.renderer.render(H,s),t.renderer.setViewport(P,0,P,y),t.renderer.setScissor(P,0,P,y),t.renderer.render(H,c);else{const D=y-k;t.renderer.setViewport(0,D,b,k),t.renderer.setScissor(0,D,b,k),t.renderer.render(H,s),t.renderer.setViewport(0,0,b,k),t.renderer.setScissor(0,0,b,k),t.renderer.render(H,c)}},Re=()=>{let D=0,F=0;F=y-k,D=0,t.renderer.setViewport(D,F,P,k),t.renderer.setScissor(D,F,P,k),t.renderer.render(H,s),D=P,t.renderer.setViewport(D,F,P,k),t.renderer.setScissor(D,F,P,k),t.renderer.render(H,c),F=0,D=0,t.renderer.setViewport(D,F,P,k),t.renderer.setScissor(D,F,P,k),t.renderer.render(H,h),D=P,t.renderer.setViewport(D,F,P,k),t.renderer.setScissor(D,F,P,k),t.renderer.render(H,p)},se=()=>{switch(X.forEach(D=>{D.update()}),t.scene.update(),t.renderer.clear(),n){case"Single":j();break;case"Side by Side":case"Stacked":le();break;case"Quad":Re();break}K=requestAnimationFrame(se)};return R(),window.addEventListener("resize",ne),ne(),se(),()=>{window.removeEventListener("resize",ne),cancelAnimationFrame(K),K=-1}},[n]);const _=["Top","Bottom","Left","Right","Front","Back","Orthographic","Debug"];return t.cameras.forEach(E=>{J.set(E.name,E),_.push(E.name)}),u.jsxs("div",{className:"multiview",children:[u.jsxs("div",{className:`cameras ${n==="Single"||n==="Stacked"?"single":""}`,children:[n==="Single"&&u.jsx(u.Fragment,{children:u.jsx(ve,{camera:s,options:_,ref:e,onSelect:E=>{var y;(y=X.get(s.name))==null||y.dispose();const b=J.get(E);b!==void 0&&(w(s),s=b,g(b,e.current))}})}),(n==="Side by Side"||n==="Stacked")&&u.jsxs(u.Fragment,{children:[u.jsx(ve,{camera:s,options:_,ref:e,onSelect:E=>{var y;(y=X.get(s.name))==null||y.dispose();const b=J.get(E);b!==void 0&&(w(s),s=b,g(b,e.current))}}),u.jsx(ve,{camera:c,options:_,ref:r,onSelect:E=>{var y;(y=X.get(c.name))==null||y.dispose();const b=J.get(E);b!==void 0&&(w(c),c=b,g(b,r.current))}})]}),n==="Quad"&&u.jsxs(u.Fragment,{children:[u.jsx(ve,{camera:s,options:_,ref:e,onSelect:E=>{var y;(y=X.get(s.name))==null||y.dispose();const b=J.get(E);b!==void 0&&(w(s),s=b,g(b,e.current))}}),u.jsx(ve,{camera:c,options:_,ref:r,onSelect:E=>{var y;(y=X.get(c.name))==null||y.dispose();const b=J.get(E);b!==void 0&&(w(c),c=b,g(b,r.current))}}),u.jsx(ve,{camera:h,options:_,ref:l,onSelect:E=>{var y;(y=X.get(h.name))==null||y.dispose();const b=J.get(E);b!==void 0&&(w(h),h=b,g(b,l.current))}}),u.jsx(ve,{camera:p,options:_,ref:m,onSelect:E=>{var y;(y=X.get(p.name))==null||y.dispose();const b=J.get(E);b!==void 0&&(w(p),p=b,g(b,m.current))}})]})]}),u.jsxs("div",{className:"settings",children:[u.jsx(mt,{index:Bt.indexOf(n),options:Bt,onSelect:E=>{E!==n&&(x(),i(E))}}),u.jsx(mt,{index:0,options:jn,onSelect:E=>{if(E!==pt)switch(pt=E,pt){case"Default":H.overrideMaterial=null;break;case"Normals":H.overrideMaterial=Mn;break;case"Wireframe":H.overrideMaterial=kn;break}}})]})]})}const Wn="";function _n(t){return u.jsxs("div",{className:"editor",ref:t.ref,style:t.style,children:[u.jsx("header",{children:t.header}),t.children,u.jsx("footer",{children:t.footer})]})}O.Accordion=Ze,O.Application=Zt,O.BaseRemote=Ae,O.ChildObject=ft,O.ContainerObject=kt,O.Draggable=Pt,O.DraggableItem=Rt,O.Dropdown=jt,O.DropdownItem=Mt,O.Editor=_n,O.InfiniteGridHelper=Ft,O.Inspector=It,O.MultiView=Dn,O.NavButton=dt,O.RemoteComponents=Jt,O.RemoteController=fn,O.RemoteTheatre=en,O.RemoteThree=on,O.RemoteTweakpane=sn,O.SceneHierarchy=Cn,O.SceneInspector=Sn,O.ToolEvents=U,O.debugDispatcher=L,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});
106
+ }`;class Dn extends f.ShaderMaterial{constructor(n){super({extensions:{derivatives:!0},glslVersion:f.GLSL3,side:f.DoubleSide,transparent:!0,uniforms:{uScale:{value:(n==null?void 0:n.scale)!==void 0?n==null?void 0:n.scale:.1},uDivisions:{value:(n==null?void 0:n.divisions)!==void 0?n==null?void 0:n.divisions:10},uColor:{value:(n==null?void 0:n.color)!==void 0?n==null?void 0:n.color:new f.Color(16777215)},uDistance:{value:(n==null?void 0:n.distance)!==void 0?n==null?void 0:n.distance:1e4},uSubgridOpacity:{value:(n==null?void 0:n.subgridOpacity)!==void 0?n==null?void 0:n.subgridOpacity:.15},uGridOpacity:{value:(n==null?void 0:n.gridOpacity)!==void 0?n==null?void 0:n.gridOpacity:.25}},vertexShader:Mn,fragmentShader:kn,name:"InfiniteGrid",depthWrite:!1})}}class zt extends f.Mesh{constructor(){const i=new Dn;super(new f.PlaneGeometry(2,2),i);z(this,"gridMaterial");this.gridMaterial=i,this.frustumCulled=!1,this.name="InfiniteGridHelper",this.position.y=.1}update(){this.gridMaterial.needsUpdate=!0}}const Zn="",Ht=["Single","Side by Side","Stacked","Quad"],J=new Map,X=new Map,oe=new Map;function be(t,n){const i=new f.OrthographicCamera(-100,100,100,-100,50,3e3);return i.name=t,i.position.copy(n),i.lookAt(0,0,0),J.set(t,i),i}be("Top",new f.Vector3(0,1e3,0)),be("Bottom",new f.Vector3(0,-1e3,0)),be("Left",new f.Vector3(-1e3,0,0)),be("Right",new f.Vector3(1e3,0,0)),be("Front",new f.Vector3(0,0,1e3)),be("Back",new f.Vector3(0,0,-1e3)),be("Orthographic",new f.Vector3(1e3,1e3,1e3));const Qe=new f.PerspectiveCamera(60,1,50,3e3);Qe.name="Debug",Qe.position.set(500,500,500),Qe.lookAt(0,0,0),J.set("Debug",Qe);let gt="Default";const _n=["Default","Normals","Wireframe"],An=new f.MeshNormalMaterial,In=new f.MeshBasicMaterial({opacity:.33,transparent:!0,wireframe:!0}),H=new f.Scene;function Nn(t){const[n,i]=A.useState(t.mode!==void 0?t.mode:"Quad"),e=A.useRef(null),r=A.useRef(null),l=A.useRef(null),c=A.useRef(null);let s=J.get("Debug"),u=J.get("Orthographic"),m=J.get("Front"),p=J.get("Top");const v=(E,y)=>{const b=X.get(E.name);b!==void 0&&b.dispose(),X.delete(E.name);const R=oe.get(E.name);R!==void 0&&(H.remove(R),R.dispose()),oe.delete(E.name);const k=new jn(E,y);switch(E.name){case"Top":case"Bottom":case"Left":case"Right":case"Front":case"Back":k.enableRotate=!1;break}if(X.set(E.name,k),E instanceof f.PerspectiveCamera){const K=new f.CameraHelper(E);oe.set(E.name,K),H.add(K)}},w=E=>{const y=oe.get(E.name);y!==void 0&&(H.remove(y),y.dispose(),oe.delete(E.name));const b=X.get(E.name);b!==void 0&&(b.dispose(),X.delete(E.name))},T=()=>{X.forEach((E,y)=>{E.dispose();const b=oe.get(y);b!==void 0&&(H.remove(b),b.dispose()),oe.delete(y),X.delete(y)}),X.clear(),oe.clear()},M=()=>{switch(n){case"Single":v(s,e.current);break;case"Side by Side":case"Stacked":v(s,e.current),v(u,r.current);break;case"Quad":v(s,e.current),v(u,r.current),v(m,l.current),v(p,c.current);break}};A.useEffect(()=>{H.name="Debug Scene",H.add(t.scene);const E=new zt;H.add(E);const y=new f.AxesHelper(500);y.name="axisHelper",H.add(y)},[]),A.useEffect(()=>{const E=t.renderer.getSize(new f.Vector2);let y=E.x,b=E.y,R=Math.floor(y/2),k=Math.floor(b/2),K=-1;const ne=()=>{y=window.innerWidth-300,b=window.innerHeight,R=Math.floor(y/2),k=Math.floor(b/2);let D=y,F=b;switch(n){case"Side by Side":D=R,F=b;break;case"Stacked":D=y,F=k;break;case"Quad":D=R,F=k;break}J.forEach(B=>{var ee;B instanceof f.OrthographicCamera?(B.left=D/-2,B.right=D/2,B.top=F/2,B.bottom=F/-2,B.updateProjectionMatrix()):B instanceof f.PerspectiveCamera&&(B.aspect=D/F,B.updateProjectionMatrix(),(ee=oe.get(B.name))==null||ee.update())})},P=()=>{t.renderer.setViewport(0,0,y,b),t.renderer.setScissor(0,0,y,b),t.renderer.render(H,s)},le=()=>{if(n==="Side by Side")t.renderer.setViewport(0,0,R,b),t.renderer.setScissor(0,0,R,b),t.renderer.render(H,s),t.renderer.setViewport(R,0,R,b),t.renderer.setScissor(R,0,R,b),t.renderer.render(H,u);else{const D=b-k;t.renderer.setViewport(0,D,y,k),t.renderer.setScissor(0,D,y,k),t.renderer.render(H,s),t.renderer.setViewport(0,0,y,k),t.renderer.setScissor(0,0,y,k),t.renderer.render(H,u)}},Re=()=>{let D=0,F=0;F=b-k,D=0,t.renderer.setViewport(D,F,R,k),t.renderer.setScissor(D,F,R,k),t.renderer.render(H,s),D=R,t.renderer.setViewport(D,F,R,k),t.renderer.setScissor(D,F,R,k),t.renderer.render(H,u),F=0,D=0,t.renderer.setViewport(D,F,R,k),t.renderer.setScissor(D,F,R,k),t.renderer.render(H,m),D=R,t.renderer.setViewport(D,F,R,k),t.renderer.setScissor(D,F,R,k),t.renderer.render(H,p)},se=()=>{switch(X.forEach(D=>{D.update()}),t.scene.update(),t.renderer.clear(),n){case"Single":P();break;case"Side by Side":case"Stacked":le();break;case"Quad":Re();break}K=requestAnimationFrame(se)};return M(),window.addEventListener("resize",ne),ne(),se(),()=>{window.removeEventListener("resize",ne),cancelAnimationFrame(K),K=-1}},[n]);const I=["Top","Bottom","Left","Right","Front","Back","Orthographic","Debug"];return t.cameras.forEach(E=>{J.set(E.name,E),I.push(E.name)}),d.jsxs("div",{className:"multiview",children:[d.jsxs("div",{className:`cameras ${n==="Single"||n==="Stacked"?"single":""}`,children:[n==="Single"&&d.jsx(d.Fragment,{children:d.jsx(ve,{camera:s,options:I,ref:e,onSelect:E=>{var b;(b=X.get(s.name))==null||b.dispose();const y=J.get(E);y!==void 0&&(w(s),s=y,v(y,e.current))}})}),(n==="Side by Side"||n==="Stacked")&&d.jsxs(d.Fragment,{children:[d.jsx(ve,{camera:s,options:I,ref:e,onSelect:E=>{var b;(b=X.get(s.name))==null||b.dispose();const y=J.get(E);y!==void 0&&(w(s),s=y,v(y,e.current))}}),d.jsx(ve,{camera:u,options:I,ref:r,onSelect:E=>{var b;(b=X.get(u.name))==null||b.dispose();const y=J.get(E);y!==void 0&&(w(u),u=y,v(y,r.current))}})]}),n==="Quad"&&d.jsxs(d.Fragment,{children:[d.jsx(ve,{camera:s,options:I,ref:e,onSelect:E=>{var b;(b=X.get(s.name))==null||b.dispose();const y=J.get(E);y!==void 0&&(w(s),s=y,v(y,e.current))}}),d.jsx(ve,{camera:u,options:I,ref:r,onSelect:E=>{var b;(b=X.get(u.name))==null||b.dispose();const y=J.get(E);y!==void 0&&(w(u),u=y,v(y,r.current))}}),d.jsx(ve,{camera:m,options:I,ref:l,onSelect:E=>{var b;(b=X.get(m.name))==null||b.dispose();const y=J.get(E);y!==void 0&&(w(m),m=y,v(y,l.current))}}),d.jsx(ve,{camera:p,options:I,ref:c,onSelect:E=>{var b;(b=X.get(p.name))==null||b.dispose();const y=J.get(E);y!==void 0&&(w(p),p=y,v(y,c.current))}})]})]}),d.jsxs("div",{className:"settings",children:[d.jsx(pt,{index:Ht.indexOf(n),options:Ht,onSelect:E=>{E!==n&&(T(),i(E))}}),d.jsx(pt,{index:0,options:_n,onSelect:E=>{if(E!==gt)switch(gt=E,gt){case"Default":H.overrideMaterial=null;break;case"Normals":H.overrideMaterial=An;break;case"Wireframe":H.overrideMaterial=In;break}}})]})]})}const Jn="";function Ln(t){return d.jsxs("div",{className:"editor",ref:t.ref,style:t.style,children:[d.jsx("header",{children:t.header}),t.children,d.jsx("footer",{children:t.footer})]})}S.Accordion=Ze,S.Application=nn,S.BaseRemote=Ae,S.ChildObject=ht,S.ContainerObject=Nt,S.Draggable=_t,S.DraggableItem=Dt,S.Dropdown=At,S.DropdownItem=It,S.Editor=Ln,S.InfiniteGridHelper=zt,S.Inspector=Bt,S.MultiView=Nn,S.NavButton=ft,S.RemoteComponents=an,S.RemoteController=gn,S.RemoteTheatre=rn,S.RemoteThree=un,S.RemoteTweakpane=dn,S.SceneHierarchy=xn,S.SceneInspector=Rn,S.ToolEvents=U,S.clamp=en,S.colorToHex=Tt,S.debugDispatcher=L,S.distance=tn,S.hierarchyUUID=lt,S.isColor=Ot,S.randomID=St,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "module": "./dist/hermes.js",
8
8
  "types": "./types/index.d.ts",
9
9
  "type": "module",
10
- "version": "0.0.4",
10
+ "version": "0.0.5",
11
11
  "homepage": "https://github.com/tomorrowevening/hermes#readme",
12
12
  "bugs": {
13
13
  "url": "https://github.com/tomorrowevening/hermes/issues"
@@ -21,10 +21,9 @@
21
21
  ],
22
22
  "files": [
23
23
  "src",
24
- "src/**/*.css",
25
- "src/**/*.scss",
26
- "dist",
27
- "dist/**/*.css",
24
+ "dist/hermes.js",
25
+ "dist/hermes.umd.cjs",
26
+ "dist/style.css",
28
27
  "types/**/*.d.ts"
29
28
  ],
30
29
  "exports": {
@@ -52,7 +51,6 @@
52
51
  "framer-motion": "^10.16.0",
53
52
  "react": "^18.2.0",
54
53
  "react-dom": "^18.2.0",
55
- "stats-gl": "^1.0.7",
56
54
  "three": "^0.160.0",
57
55
  "tweakpane": "^4.0.0"
58
56
  },
@@ -8,7 +8,6 @@ import type { BroadcastData, EditorEvent } from './types';
8
8
 
9
9
  export default function RemoteController(app: Application) {
10
10
  let activeSheet: ISheet | undefined = undefined;
11
- const mode = app.editor ? 'editor' : 'app';
12
11
 
13
12
  // Handlers
14
13
 
@@ -174,10 +173,10 @@ export default function RemoteController(app: Application) {
174
173
  // Begin app
175
174
 
176
175
  app.listen((msg: BroadcastData) => {
177
- if (mode === 'app') {
178
- handleAppBroadcast(msg);
179
- } else {
176
+ if (app.editor) {
180
177
  handleEditorBroadcast(msg);
178
+ } else {
179
+ handleAppBroadcast(msg);
181
180
  }
182
181
  });
183
182
 
@@ -1,6 +1,7 @@
1
1
  import { Scene } from 'three';
2
2
  import BaseRemote from './BaseRemote';
3
3
  import { stripObject, stripScene } from '@/editor/sceneHierarchy/utils';
4
+ import { hierarchyUUID } from '@/editor/utils';
4
5
 
5
6
  export default class RemoteThree extends BaseRemote {
6
7
  scene?: Scene = undefined;
@@ -67,6 +68,7 @@ export default class RemoteThree extends BaseRemote {
67
68
 
68
69
  setScene(value: Scene) {
69
70
  this.scene = value;
71
+ hierarchyUUID(value);
70
72
  const stripped = stripScene(value);
71
73
  this.app.send({
72
74
  event: 'setScene',
package/src/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  // Core
2
+ export * from './editor/utils';
2
3
  export { default as Application } from './core/Application';
3
4
  export { debugDispatcher, ToolEvents } from './editor/global';
4
5
  export { default as BaseRemote } from './core/remote/BaseRemote';
package/types/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './editor/utils';
1
2
  export { default as Application } from './core/Application';
2
3
  export { debugDispatcher, ToolEvents } from './editor/global';
3
4
  export { default as BaseRemote } from './core/remote/BaseRemote';
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1 +0,0 @@
1
- {"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
Binary file