@tomorrowevening/hermes 0.0.126 → 0.0.127
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.
- package/dist/hermes.cjs.js +1 -1
- package/dist/hermes.es.js +1 -0
- package/package.json +1 -1
- package/types/utils/three.d.ts +2 -1
package/dist/hermes.cjs.js
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);
|
16
16
|
gl_FragColor = enc;
|
17
17
|
}
|
18
|
-
`,f=c.createShader(35633),g=c.createShader(35632),w=c.createProgram();if(!(g&&f&&w))return;c.shaderSource(f,u),c.shaderSource(g,m),c.compileShader(f),c.compileShader(g),c.attachShader(w,f),c.attachShader(w,g),c.linkProgram(w),c.detachShader(w,f),c.detachShader(w,g),c.deleteShader(f),c.deleteShader(g),c.useProgram(w);const C=c.createBuffer();c.bindBuffer(34962,C),c.bufferData(34962,new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),35044);const A=c.getAttribLocation(w,"aPosition");c.vertexAttribPointer(A,3,5126,!1,0,0),c.enableVertexAttribArray(A),c.clearColor(1,1,1,1),c.clear(16384),c.viewport(0,0,1,1),c.drawArrays(4,0,3);const _=new Uint8Array(4);return c.readPixels(0,0,1,1,6408,5121,_),c.deleteProgram(w),c.deleteBuffer(C),_.join("")}(s),n="801621810",a="8016218135",r="80162181161",l=Me?.isIpad?[["a7",r,12],["a8",a,15],["a8x",a,15],["a9",a,15],["a9x",a,15],["a10",a,15],["a10x",a,15],["a12",n,15],["a12x",n,15],["a12z",n,15],["a14",n,15],["a15",n,15],["m1",n,15],["m2",n,15]]:[["a7",r,12],["a8",a,12],["a9",a,15],["a10",a,15],["a11",n,15],["a12",n,15],["a13",n,15],["a14",n,15],["a15",n,15],["a16",n,15],["a17",n,15]];let h;return i==="80162181255"?h=l.filter(([,,c])=>c>=14):(h=l.filter(([,c])=>c===i),h.length||(h=l)),h.map(([c])=>`apple ${c} gpu`)}class Fi extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}const Kt=[],Hi=[];function an(s,e){if(s===e)return 0;const t=s;s.length>e.length&&(s=e,e=t);let i=s.length,n=e.length;for(;i>0&&s.charCodeAt(~-i)===e.charCodeAt(~-n);)i--,n--;let a,r=0;for(;r<i&&s.charCodeAt(r)===e.charCodeAt(r);)r++;if(i-=r,n-=r,i===0)return n;let l,h,c=0,u=0,m=0;for(;u<i;)Hi[u]=s.charCodeAt(r+u),Kt[u]=++u;for(;m<n;)for(a=e.charCodeAt(r+m),l=m++,c=m,u=0;u<i;u++)h=a===Hi[u]?l:l+1,l=Kt[u],c=Kt[u]=l>c?h>c?c+1:h:h>l?l+1:h;return c}function on(s){return s!=null}const ln=({mobileTiers:s=[0,15,30,60],desktopTiers:e=[0,15,30,60],override:t={},glContext:i,failIfMajorPerformanceCaveat:n=!1,benchmarksURL:a="https://unpkg.com/detect-gpu@5.0.57/dist/benchmarks"}={})=>qt(void 0,void 0,void 0,function*(){const r={};if(_s)return{tier:0,type:"SSR"};const{isIpad:l=!!Me?.isIpad,isMobile:h=!!Me?.isMobile,screenSize:c=window.screen,loadBenchmarks:u=O=>qt(void 0,void 0,void 0,function*(){const T=yield fetch(`${a}/${O}`).then(L=>L.json());if(parseInt(T.shift().split(".")[0],10)<4)throw new Fi("Detect GPU benchmark data is out of date. Please update to version 4x");return T})}=t;let{renderer:m}=t;const f=(O,T,L,j,D)=>({device:D,fps:j,gpu:L,isMobile:h,tier:O,type:T});let g,w="";if(m)m=Ni(m),g=[m];else{const O=i||function(L,j=!1){const D={alpha:!1,antialias:!1,depth:!1,failIfMajorPerformanceCaveat:j,powerPreference:"high-performance",stencil:!1};L&&delete D.powerPreference;const B=window.document.createElement("canvas"),_e=B.getContext("webgl",D)||B.getContext("experimental-webgl",D);return _e??void 0}(Me?.isSafari12,n);if(!O)return f(0,"WEBGL_UNSUPPORTED");const T=Me?.isFirefox?null:O.getExtension("WEBGL_debug_renderer_info");if(m=T?O.getParameter(T.UNMASKED_RENDERER_WEBGL):O.getParameter(O.RENDERER),!m)return f(1,"FALLBACK");w=m,m=Ni(m),g=function(L,j,D){return j==="apple gpu"?rn(L,j,D):[j]}(O,m,h)}const C=(yield Promise.all(g.map(function(O){var T;return qt(this,void 0,void 0,function*(){const L=(G=>{const ae=h?["adreno","apple","mali-t","mali","nvidia","powervr","samsung"]:["intel","apple","amd","radeon","nvidia","geforce","adreno"];for(const Ee of ae)if(G.includes(Ee))return Ee})(O);if(!L)return;const j=`${h?"m":"d"}-${L}${l?"-ipad":""}.json`,D=r[j]=(T=r[j])!==null&&T!==void 0?T:u(j);let B;try{B=yield D}catch(G){if(G instanceof Fi)throw G;return}const _e=function(G){var ae;const Ee=(G=G.replace(/\([^)]+\)/,"")).match(/\d+/)||G.match(/(\W|^)([A-Za-z]{1,3})(\W|$)/g);return(ae=Ee?.join("").replace(/\W|amd/g,""))!==null&&ae!==void 0?ae:""}(O);let pe=B.filter(([,G])=>G===_e);pe.length||(pe=B.filter(([G])=>G.includes(O)));const ne=pe.length;if(ne===0)return;const q=O.split(/[.,()\[\]/\s]/g).sort().filter((G,ae,Ee)=>ae===0||G!==Ee[ae-1]).join(" ");let X,[Pe,,,,ce]=ne>1?pe.map(G=>[G,an(q,G[2])]).sort(([,G],[,ae])=>G-ae)[0][0]:pe[0],ge=Number.MAX_VALUE;const{devicePixelRatio:te}=window,Re=c.width*te*c.height*te;for(const G of ce){const[ae,Ee]=G,it=ae*Ee,Ye=Math.abs(Re-it);Ye<ge&&(ge=Ye,X=G)}if(!X)return;const[,,De,Ie]=X;return[ge,De,Pe,Ie]})}))).filter(on).sort(([O=Number.MAX_VALUE,T],[L=Number.MAX_VALUE,j])=>O===L?T-j:O-L);if(!C.length){const O=nn.find(T=>m.includes(T));return O?f(0,"BLOCKLISTED",O):f(1,"FALLBACK",`${m} (${w})`)}const[,A,_,y]=C[0];if(A===-1)return f(0,"BLOCKLISTED",_,A,y);const x=h?s:e;let S=0;for(let O=0;O<x.length;O++)A>=x[O]&&(S=O);return f(S,"BENCHMARK",_,A,y)});var vs=(s=>(s[s.High=0]="High",s[s.Medium=1]="Medium",s[s.Low=2]="Low",s))(vs||{});function cn(s){return new Promise(e=>{ln().then(t=>{let i=!1;const n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);if(i="transferControlToOffscreen"in s,n){const r=navigator.userAgent.match(/version\/(\d+)/i);i=(r?parseInt(r[1]):0)>=17}const a={dpr:devicePixelRatio,fps:t.fps!==void 0?t.fps:30,width:innerWidth,height:innerHeight,mobile:t.isMobile!==void 0?t.isMobile:!1,supportOffScreenCanvas:i,quality:2};t.tier===3?a.quality=0:t.tier===2&&(a.quality=1),e(a)})})}function je(s,e,t){return Math.min(e,Math.max(s,t))}function ui(s,e,t){return(t-s)/(e-s)}function Nt(s,e,t){return s*(1-t)+e*t}function hn(s,e){const t=s-e;return Math.sqrt(t*t)}function Ce(s,e=1){return Number(s.toFixed(e))}const dn=s=>{s?.dispose()},ys=s=>{s&&(Array.isArray(s)?s.forEach(e=>e.dispose()):s.dispose())},Ae=s=>{if(s){for(;s.children.length>0;){const e=s.children[0];e.type==="Audio"?(e.pause(),e.parent&&e.parent.remove(e)):Ae(e)}if(s.parent&&s.parent.remove(s),s.isMesh){const e=s;e.geometry?.dispose(),ys(e.material)}s.dispose!==void 0&&s.dispose()}};exports.totalThreeObjects=0;const pi=()=>{exports.totalThreeObjects=0},Ft=s=>{if(!s)return;let e=s.name.replaceAll(" ","").replaceAll("/",".");if(e.length===0&&(e=`obj_${exports.totalThreeObjects}`,exports.totalThreeObjects++),s.parent!==null&&s.parent.uuid.length>0&&(e=`${s.parent.uuid}.${e}`),s.uuid=e,s.isMesh!==void 0){const t=s;if(Array.isArray(t.material))t.material.forEach((i,n)=>{i.uuid=`${e}.material.${n}`});else{const i=t.material;i.uuid=`${e}.material`}}s.children.forEach(t=>Ft(t))};class vt{static renderer;static canvas;static context=null;static scene=null;static camera=null;static material=null;static inited=!1;static width=100;static height=100;static init(){this.inited||(this.canvas=document.createElement("canvas"),this.canvas.width=this.width,this.canvas.height=this.height,this.context=this.canvas.getContext("2d"),this.inited=!0)}static renderToBlob(e){this.init();const t=e.repeat.clone(),i=e.offset.clone();if(e.repeat.set(1,1),e.offset.set(0,0),this.context!==null){this.context.clearRect(0,0,this.width,this.height);const n=e.image;if(n!=null&&n.width>0){this.canvas.title=e.sourceFile;const a=this.canvas.width/n.width,r=this.renderToCanvas(e);this.context.drawImage(r,0,0,n.width*a,n.height*a)}}return e.repeat.copy(t),e.offset.copy(i),this.canvas.toDataURL("image/png")}static renderToCanvas(e){if(this.material===null){this.camera=new o.OrthographicCamera(-.5,.5,.5,-.5,0,100),this.scene=new o.Scene,this.material=new o.MeshBasicMaterial;const t=new o.BufferGeometry;t.setAttribute("position",new o.Float32BufferAttribute([-.5,-.5,0,1.5,-.5,0,-.5,1.5,0],3)),t.setAttribute("normal",new o.Float32BufferAttribute([0,0,1,0,0,1],3)),t.setAttribute("uv",new o.Float32BufferAttribute([0,0,2,0,0,2],2));const i=new o.Mesh(t,this.material);this.scene.add(i)}if(e.isRenderTargetTexture)this.material.map=e,this.renderer.render(this.scene,this.camera);else{const t=this.renderer.outputColorSpace,i=e.colorSpace;this.renderer.outputColorSpace=o.LinearSRGBColorSpace,e.colorSpace=o.LinearSRGBColorSpace,this.material.map=e,this.renderer.render(this.scene,this.camera),this.renderer.outputColorSpace=t,e.colorSpace=i}return this.renderer.domElement}}function un(s){return new Promise(e=>{const t=new o.ObjectLoader;t.parseAsync(s.scene).then(i=>{const n=new o.AnimationMixer(i);if(s.animations.length>0){const r=s.animations.map(h=>o.AnimationClip.parse(h));n.clipAction(r[0]).play()}const a=[];s.cameras&&s.cameras.length>0&&s.cameras.forEach(r=>{const l=t.parse(r);a.push(l)}),e({model:i,mixer:n,cameras:a})})})}const We=Ci(["ctrlKey","metaKey","shiftKey","button","pointerId","pointerType","clientX","clientY","pageX","pageY"]),pn=Ci(["clientX","clientY","deltaX","deltaY","deltaMode"]),mn=Ci(["ctrlKey","metaKey","shiftKey","keyCode"]);function fn(s,e){s.preventDefault(),pn(s,e)}function gn(s){s.preventDefault()}function _n(s,e,t){for(const i of e)t[i]=s[i]}function Ci(s){return function(t,i){const n={type:t.type};_n(t,s,n),i(n)}}function $t(s,e){const t=[],i={type:s.type,touches:t};for(let n=0;n<s.touches.length;++n){const a=s.touches[n];t.push({pageX:a.pageX,pageY:a.pageY})}e(i)}const vn={37:!0,38:!0,39:!0,40:!0};function yn(s,e){const{keyCode:t}=s;vn[t]&&(s.preventDefault(),mn(s,e))}const Cn={contextmenu:gn,mousedown:We,mousemove:We,mouseup:We,pointerdown:We,pointermove:We,pointerup:We,touchstart:$t,touchmove:$t,touchend:$t,wheel:fn,keydown:yn};let bn=0;class En{id;worker;constructor(e,t,i){this.id=bn++,this.worker=t;const n=r=>{this.worker.postMessage({type:"event",id:this.id,data:r})};t.postMessage({type:"makeProxy",id:this.id});for(const[r,l]of Object.entries(i))e.addEventListener(r,h=>{l(h,n)});function a(){n({type:"resize",left:0,top:0,width:innerWidth,height:innerHeight})}window.addEventListener("resize",a),a()}}class Cs extends o.EventDispatcher{style={};left=0;top=0;width=0;height=0;ownerDocument=void 0;constructor(){super(),this.ownerDocument=this}get clientWidth(){return this.width}set clientWidth(e){this.width=e}get clientHeight(){return this.height}set clientHeight(e){this.height=e}setPointerCapture(){}releasePointerCapture(){}getBoundingClientRect(){return{x:this.left,y:this.top,left:this.left,top:this.top,width:this.width,height:this.height,right:this.left+this.width,bottom:this.top+this.height,toJSON:()=>({})}}handleEvent(e){if(e.type==="size"){this.left=e.left,this.top=e.top,this.width=e.width,this.height=e.height;return}e.preventDefault=yt,e.stopPropagation=yt,this.dispatchEvent(e)}focus(){}getRootNode(){return this}}class Sn{targets={};constructor(){this.handleEvent=this.handleEvent.bind(this)}makeProxy(e){const{id:t}=e,i=new Cs;this.targets[t]=i}getProxy(e){return this.targets[e]}handleEvent(e){this.targets[e.id]?.handleEvent(e.data)}}class wn{components=new Map;listen;_appID="";_debugEnabled;_broadcastChannel=void 0;_webSocket=void 0;_mode="app";_connected=!1;_useBC=!1;constructor(e,t,i=!0){this._appID=e,this._debugEnabled=t,t&&(this._useBC=i,i?(this._broadcastChannel=new BroadcastChannel(e),this._broadcastChannel.addEventListener("message",this.messageHandler)):(this._webSocket=new WebSocket(e),this._webSocket.addEventListener("open",this.openHandler),this._webSocket.addEventListener("close",this.closeHandler),this._webSocket.addEventListener("message",this.messageHandler)))}addComponent(e,t){this.components.set(e,t)}dispose(){this._broadcastChannel!==void 0&&this._broadcastChannel.removeEventListener("message",this.messageHandler),this._webSocket!==void 0&&(this._webSocket.removeEventListener("open",this.openHandler),this._webSocket.removeEventListener("close",this.closeHandler),this._webSocket.removeEventListener("message",this.messageHandler)),this.components.forEach(e=>{e.dispose()}),this.components.clear()}send(e){this._mode!==e.target&&(this._useBC?this._broadcastChannel?.postMessage(e):this._connected&&this._webSocket?.send(JSON.stringify(e)))}messageHandler=e=>{this.listen!==void 0&&(this._useBC?this.listen(e.data):this.listen(JSON.parse(e.data)))};openHandler=()=>{this._connected=!0};closeHandler=()=>{this._connected=!1};get appID(){return this._appID}get connected(){return this._connected}get debugEnabled(){return this._debugEnabled}get mode(){return this._mode}get isApp(){return this._mode==="app"}get editor(){return this._mode==="editor"}set editor(e){e&&(this._mode="editor")}}var P=(s=>(s.CUSTOM="ToolEvents::custom",s.SELECT_DROPDOWN="ToolEvents::selectDropdown",s.DRAG_UPDATE="ToolEvents::dragUpdate",s.ADD_SCENE="ToolEvents::addScene",s.REFRESH_SCENE="ToolEvents::refreshScene",s.REMOVE_SCENE="ToolEvents::removeScene",s.SET_SCENE="ToolEvents::setScene",s.GET_OBJECT="ToolEvents::getObject",s.SET_OBJECT="ToolEvents::setObject",s.UPDATE_OBJECT="ToolEvents::updateObject",s.CREATE_TEXTURE="ToolEvents::createTexture",s.REQUEST_METHOD="ToolEvents::requestMethod",s.ADD_CAMERA="ToolEvents::addCamera",s.REMOVE_CAMERA="ToolEvents::removeCamera",s.ADD_GROUP="ToolEvents::addGroup",s.REMOVE_GROUP="ToolEvents::removeGroup",s.ADD_SPLINE="ToolEvents::addSpline",s.ADD_RENDERER="ToolEvents::addRenderer",s.UPDATE_RENDERER="ToolEvents::updateRenderer",s))(P||{});const R=new o.EventDispatcher;class zt{app;constructor(e){this.app=e}dispose(){}handleApp(e,t,i){}handleEditor(e,t,i){}}class xn extends zt{selectDropdown(e,t){this.app.send({event:"selectComponent",target:"app",data:{dropdown:e,value:t}})}updateDropdown(e,t){this.app.send({event:"draggableListUpdate",target:"app",data:{dropdown:e,value:t}})}handleApp(e,t,i){switch(i.event){case"selectComponent":R.dispatchEvent({type:P.SELECT_DROPDOWN,value:i.data});break;case"draggableListUpdate":R.dispatchEvent({type:P.DRAG_UPDATE,value:i.data});break}}}function On(s,e,t){if(s.editor){t.ui.restore(),t.onSelectionChange(r=>{r.length<1||r.forEach(l=>{let h=l.address.sheetId,c="setSheet",u={};switch(l.type){case"Theatre_Sheet_PublicAPI":c="setSheet",u={sheet:l.address.sheetId},e.activeSheet=e.sheets.get(l.address.sheetId);break;case"Theatre_SheetObject_PublicAPI":c="setSheetObject",h+=`_${l.address.objectKey}`,u={id:h,sheet:l.address.sheetId,key:l.address.objectKey},e.activeSheet=e.sheets.get(l.address.sheetId);break}s.send({event:c,target:"app",data:u})})});let i=-1;const n=()=>{if(e.activeSheet!==void 0&&i!==e.activeSheet.sequence.position){i=e.activeSheet.sequence.position;const r=e.activeSheet;s.send({event:"updateTimeline",target:"app",data:{position:i,sheet:r.address.sheetId}})}},a=()=>{n(),requestAnimationFrame(a)};n(),a()}else t.ui.hide()}function Mn(){setTimeout(()=>{const s=document.getElementById("theatrejs-studio-root");if(s===null||s.shadowRoot===null)return;const e=s.shadowRoot.getElementById("pointer-root");if(e===null)return;const t=e.children[0];if(t===null)return;const i=t.children[1];i.style.justifyContent="left";try{const n=i.children[1];for(n.style.transform="translateX(10px)";n.children.length>1;)n.removeChild(n.children[0])}catch{}try{const n=t.children[3];n.style.top="0",n.style.right="300px"}catch{}},1e3)}class Tn extends zt{project;sheets=new Map;sheetObjects=new Map;sheetObjectCBs=new Map;sheetObjectUnsubscribe=new Map;activeSheet;studio=void 0;dispose(){this.project=void 0,this.sheets=new Map,this.sheetObjects=new Map,this.sheetObjectCBs=new Map,this.sheetObjectUnsubscribe=new Map}getSheetInstance(e,t){return t!==void 0?`${e}-${t}`:e}sheet(e,t){if(this.project===void 0){console.error("Theatre Project hasn't been created yet.");return}const i=this.getSheetInstance(e,t);let n=this.sheets.get(i);return n!==void 0||(n=this.project?.sheet(e,t),this.sheets.set(i,n)),n}playSheet(e,t,i){return new Promise(n=>{const a=t!==void 0?{...t}:{};this.sheet(e,i)?.sequence.play(a).then(r=>n(r)),this.app.send({event:"playSheet",target:"editor",data:{sheet:e,instance:i,value:t}})})}pauseSheet(e,t){this.sheet(e,t)?.sequence.pause(),this.app.send({event:"pauseSheet",target:"editor",data:{sheet:e,instance:t}})}clearSheetObjects(e){this.sheetObjects.forEach((t,i)=>{i.search(`${e}_`)>-1&&this.unsubscribe(t)})}sheetObject(e,t,i,n,a){if(this.project===void 0){console.error("Theatre Project hasn't been created yet.");return}const r=this.sheet(e,a);if(r===void 0)return;const h=`${this.getSheetInstance(e,a)}_${t}`;let c=this.sheetObjects.get(h);c!==void 0?c=r.object(t,{...i,...c.value},{reconfigure:!0}):c=r.object(t,i),this.sheetObjects.set(h,c),this.sheetObjectCBs.set(h,n!==void 0?n:yt);const u=c.onValuesChange(m=>{if(this.app.editor){for(const g in m){const w=m[g];typeof w=="object"&&gs(w)&&(m[g]={r:w.r,g:w.g,b:w.b,a:w.a})}this.app.send({event:"updateSheetObject",target:"app",data:{sheet:e,sheetObject:h,values:m}})}const f=this.sheetObjectCBs.get(h);f!==void 0&&f(m)});return this.sheetObjectUnsubscribe.set(h,u),c}unsubscribe(e){if(this.project===void 0){console.error("Theatre Project hasn't been created yet.");return}const t=e.address.sheetId,i=e.address.objectKey;this.sheets.get(t)?.detachObject(i);const a=`${t}_${i}`,r=this.sheetObjectUnsubscribe.get(a);r!==void 0&&(this.sheetObjects.delete(a),this.sheetObjectCBs.delete(a),this.sheetObjectUnsubscribe.delete(a),r())}handleApp(e,t,i){const n=t;let a;switch(i.event){case"setSheet":a=n.sheets.get(i.data.sheet),a!==void 0&&(n.activeSheet=a,this.studio?.setSelection([a]));break;case"setSheetObject":a=n.sheetObjects.get(`${i.data.sheet}_${i.data.key}`),a!==void 0&&this.studio?.setSelection([a]);break;case"updateSheetObject":a=n.sheets.get(i.data.sheet),a!==void 0&&a.sequence.pause(),a=n.sheetObjectCBs.get(i.data.sheetObject),a!==void 0&&a(i.data.values);break;case"updateTimeline":a=n.sheets.get(i.data.sheet),n.activeSheet!==void 0&&(n.activeSheet.sequence.position=i.data.position);break}}handleEditor(e,t,i){if(e.editor){const n=t;switch(i.event){case"playSheet":n.sheet(i.data.sheet,i.data.instance)?.sequence.play(i.data.value);break;case"pauseSheet":n.sheet(i.data.sheet,i.data.instance)?.sequence.pause();break}}}handleEditorApp(e,t){if(e.editor){this.studio?.ui.restore(),this.studio?.onSelectionChange(r=>{r.length<1||r.forEach(l=>{let h=l.address.sheetId,c="setSheet",u={};switch(l.type){case"Theatre_Sheet_PublicAPI":c="setSheet",u={sheet:l.address.sheetId},t.activeSheet=t.sheets.get(l.address.sheetId);break;case"Theatre_SheetObject_PublicAPI":c="setSheetObject",h+=`_${l.address.objectKey}`,u={id:h,sheet:l.address.sheetId,key:l.address.objectKey},t.activeSheet=t.sheets.get(l.address.sheetId);break}e.send({event:c,target:"app",data:u})})});let i=-1;const n=()=>{if(t.activeSheet!==void 0&&i!==t.activeSheet.sequence.position){i=t.activeSheet.sequence.position;const r=t.activeSheet;e.send({event:"updateTimeline",target:"app",data:{position:i,sheet:r.address.sheetId}})}},a=()=>{n(),requestAnimationFrame(a)};n(),a()}else this.studio?.ui.hide()}}function An(s){if(s.name==="cameras")return"camera";if(s.name==="interactive")return"interactive";if(s.name==="lights")return"light";if(s.name==="ui")return"ui";if(s.name==="utils")return"utils";const e=s.type;return e.search("Helper")>-1?"icon_utils":e.search("Camera")>-1?"camera":e.search("Light")>-1?"light":"obj3D"}function tt(s){const e={name:s.name,type:s.type,uuid:s.uuid,children:[]};return s.children.forEach(t=>{e.children.push(tt(t))}),e}function Pn(s){const e={};for(const t in s){const i=s[t].value;e[t]={value:i},i===null?e[t].value={src:"",offset:[0,0],repeat:[1,1]}:i!==void 0&&i.isTexture&&(e[t].value={src:i.image.src,offset:[i.offset.x,i.offset.y],repeat:[i.repeat.x,i.repeat.y]})}return e}function Rn(s){switch(s){case"blendSrcAlpha":case"blendDstAlpha":case"blendEquationAlpha":case"clippingPlanes":case"shadowSide":case"precision":return!0}return!1}function Xe(s){const e={};for(const t in s){if(t.substring(0,1)==="_"||t.substring(0,2)==="is"||Rn(t))continue;const i=typeof s[t],n=s[t];switch(i){case"boolean":case"number":case"string":e[t]=n;break;case"object":n!==null?(e[t]=n,n.isTexture?e[t]={src:vt.renderToBlob(n),offset:[n.offset.x,n.offset.y],repeat:[n.repeat.x,n.repeat.y]}:t==="uniforms"&&(e[t]=Pn(e[t]))):t==="glslVersion"?e[t]="":e[t]={src:"",offset:[0,0],repeat:[1,1]};break}}return s.anisotropy!==void 0&&(e.anisotropy=s.anisotropy),s.clearcoat!==void 0&&(e.clearcoat=s.clearcoat),s.iridescence!==void 0&&(e.iridescence=s.iridescence),s.dispersion!==void 0&&(e.dispersion=s.dispersion),s.sheen!==void 0&&(e.sheen=s.sheen),s.transmission!==void 0&&(e.transmission=s.transmission),s.transmission!==void 0&&(e.transmission=s.transmission),e}function Jt(s){s.updateMatrix();const e={name:s.name,type:s.type,uuid:s.uuid,visible:s.visible,matrix:s.matrix.elements,animations:[],material:void 0,perspectiveCameraInfo:void 0,orthographicCameraInfo:void 0,lightInfo:void 0,children:[]};s.animations.forEach(i=>{e.animations.push({name:i.name,duration:i.duration,blendMode:i.blendMode})});const t=s.type.toLowerCase();if(t.search("mesh")>-1){const i=s;if(Array.isArray(i.material)){const n=[];i.material.forEach(a=>{n.push(Xe(a))}),e.material=n}else e.material=Xe(i.material)}else if(t.search("points")>-1){const i=s;if(Array.isArray(i.material)){const n=[];i.material.forEach(a=>{n.push(Xe(a))}),e.material=n}else e.material=Xe(i.material)}else if(t.search("line")>-1){const i=s;if(Array.isArray(i.material)){const n=[];i.material.forEach(a=>{n.push(Xe(a))}),e.material=n}else e.material=Xe(i.material)}else t.search("camera")>-1?s.type==="PerspectiveCamera"?e.perspectiveCameraInfo={fov:s.fov,zoom:s.zoom,near:s.near,far:s.far,focus:s.focus,aspect:s.aspect,filmGauge:s.filmGauge,filmOffset:s.filmOffset}:s.type==="OrthographicCamera"&&(e.orthographicCameraInfo={zoom:s.zoom,near:s.near,far:s.far,left:s.left,right:s.right,top:s.top,bottom:s.bottom}):t.search("light")>-1&&(e.lightInfo={color:s.color,intensity:s.intensity,decay:s.decay,distance:s.distance,angle:s.angle,penumbra:s.penumbra,groundColor:s.groundColor,width:s.width,height:s.height});return e}function Dn(s,e){const t=e.split(".");switch(t.length){case 1:return s[t[0]];case 2:return s[t[0]][t[1]];case 3:return s[t[0]][t[1]][t[2]];case 4:return s[t[0]][t[1]][t[2]][t[3]];case 5:return s[t[0]][t[1]][t[2]][t[3]][t[4]];case 6:return s[t[0]][t[1]][t[2]][t[3]][t[4]][t[5]]}}function In(s,e){for(const t in e)s[t]=e[t]}function ee(s,e,t){if(s===void 0)return;const i=e.split("."),n=i.length;if(typeof t!="object")switch(n){case 1:s[i[0]]=t;break;case 2:s[i[0]][i[1]]=t;break;case 3:s[i[0]][i[1]][i[2]]=t;break;case 4:s[i[0]][i[1]][i[2]][i[3]]=t;break;case 5:s[i[0]][i[1]][i[2]][i[3]][i[4]]=t;break}else{let r;switch(n){case 1:r=s[i[0]];break;case 2:r=s[i[0]][i[1]];break;case 3:r=s[i[0]][i[1]][i[2]];break;case 4:r=s[i[0]][i[1]][i[2]][i[3]];break;case 5:r=s[i[0]][i[1]][i[2]][i[3]][i[4]];break}r!=null&&In(r,t)}}function bs(s){return new Promise((e,t)=>{const i=new Image;i.onload=()=>{const n=new o.Texture(i);n.wrapS=o.RepeatWrapping,n.wrapT=o.RepeatWrapping,n.needsUpdate=!0,e(n)},i.onerror=t,i.src=s})}class Ln extends zt{canvas=null;inputElement=null;scene=void 0;scenes=new Map;renderer=void 0;renderTargets=new Map;groups=new Map;dispose(){this.scenes.forEach(e=>{Ae(e)}),this.scenes.clear(),this.scene&&Ae(this.scene),this.renderTargets.forEach(e=>{e.dispose()}),this.renderTargets.clear(),this.renderer?.dispose()}getObject(e){this.app.debugEnabled&&(this.renderer!==void 0&&(vt.renderer=this.renderer),this.app.send({event:"getObject",target:"app",data:e}))}setObject(e){this.renderer!==void 0&&(vt.renderer=this.renderer);const t=Jt(e);this.app.send({event:"setObject",target:"editor",data:t})}requestMethod(e,t,i,n){this.app.send({event:"requestMethod",target:"app",data:{uuid:e,key:t,value:i,subitem:n}})}updateObject(e,t,i){this.app.send({event:"updateObject",target:"app",data:{uuid:e,key:t,value:i}})}createTexture(e,t,i){this.app.send({event:"createTexture",target:"app",data:{uuid:e,key:t,value:i}})}addGroup(e){this.groups.get(e.title)===void 0&&(this.groups.set(e.title,{title:e.title,onUpdate:e.onUpdate}),this.app.send({event:"addGroup",target:"editor",data:JSON.stringify(e)}))}removeGroup(e){this.groups.get(e)!==void 0&&(this.groups.delete(e),this.app.send({event:"removeGroup",target:"editor",data:e}))}updateGroup(e,t,i){this.app.send({event:"updateGroup",target:"app",data:JSON.stringify({group:e,prop:t,value:i})})}removeAllGroups(){this.groups.forEach(e=>{const t=e.title;this.groups.delete(t),this.app.send({event:"removeGroup",target:"editor",data:t})}),this.groups.clear()}addSpline(e){setTimeout(()=>{this.app.send({event:"addSpline",target:"editor",data:JSON.stringify(e.toJSON())})},1)}setRenderer(e,t=null){if(this.renderer=e,this.canvas=e.domElement,this.inputElement=t!==null?t:this.canvas,!this.app.debugEnabled)return;const i=`#${e.getClearColor(new o.Color).getHexString()}`;this.app.send({event:"addRenderer",target:"editor",data:{autoClear:e.autoClear,autoClearColor:e.autoClearColor,autoClearDepth:e.autoClearDepth,autoClearStencil:e.autoClearStencil,outputColorSpace:e.outputColorSpace,localClippingEnabled:e.localClippingEnabled,clearColor:i,clearAlpha:e.getClearAlpha(),colorManagement:o.ColorManagement.enabled,toneMapping:e.toneMapping,toneMappingExposure:e.toneMappingExposure}})}updateRenderer(e){this.app.send({event:"updateRenderer",target:"app",data:e})}addScene(e){if(e===void 0||(this.scenes.set(e.name,e),!this.app.debugEnabled))return;pi(),Ft(e);const t=tt(e);this.app.send({event:"addScene",target:"editor",data:t})}refreshScene(e){if(!this.app.debugEnabled)return;const t=this.scenes.get(e);if(t!==void 0){const i=tt(t);this.app.send({event:"refreshScene",target:"app",data:i})}}removeScene(e){if(e===void 0||(this.scenes.delete(e.name),!this.app.debugEnabled))return;const t=tt(e);this.app.send({event:"removeScene",target:"editor",data:t})}removeAllScenes(){this.scenes.forEach(e=>this.removeScene(e))}getScene(e){let t=null;return this.scenes.forEach((i,n)=>{e.search(n)>-1&&(t=i)}),t}setScene(e){if(e===void 0||(this.scene=e,!this.app.debugEnabled))return;this.renderer!==void 0&&(vt.renderer=this.renderer),pi(),Ft(e);const t=tt(e);this.app.send({event:"setScene",target:"editor",data:t})}addCamera(e){if(!this.app.debugEnabled)return;const t=Jt(e);this.app.send({event:"addCamera",target:"editor",data:t})}removeCamera(e){if(!this.app.debugEnabled)return;const t=Jt(e);this.app.send({event:"removeCamera",target:"editor",data:t})}handleApp(e,t,i){const n=t;switch(i.event){case"getObject":R.dispatchEvent({type:P.GET_OBJECT,value:i.data});break;case"updateObject":R.dispatchEvent({type:P.UPDATE_OBJECT,value:i.data});break;case"createTexture":R.dispatchEvent({type:P.CREATE_TEXTURE,value:i.data});break;case"requestMethod":R.dispatchEvent({type:P.REQUEST_METHOD,value:i.data});break;case"refreshScene":e.send({event:"refreshScene",target:"editor",data:tt(n.scenes.get(i.data.name))});break;case"updateRenderer":n.renderer&&(n.renderer.autoClear=i.data.autoClear,n.renderer.autoClearColor=i.data.autoClearColor,n.renderer.autoClearDepth=i.data.autoClearDepth,n.renderer.autoClearStencil=i.data.autoClearStencil,n.renderer.outputColorSpace=i.data.outputColorSpace,n.renderer.localClippingEnabled=i.data.localClippingEnabled,n.renderer.setClearColor(i.data.clearColor,i.data.clearAlpha),n.renderer.toneMapping=i.data.toneMapping,n.renderer.toneMappingExposure=i.data.toneMappingExposure,o.ColorManagement.enabled=i.data.colorManagement);break}if(i.event==="updateGroup"){const a=JSON.parse(i.data);n.groups.get(a.group)?.onUpdate(a.prop,a.value)}}handleEditor(e,t,i){switch(i.event){case"setObject":R.dispatchEvent({type:P.SET_OBJECT,value:i.data});break;case"addScene":R.dispatchEvent({type:P.ADD_SCENE,value:i.data});break;case"refreshScene":R.dispatchEvent({type:P.REFRESH_SCENE,value:i.data});break;case"removeScene":R.dispatchEvent({type:P.REMOVE_SCENE,value:i.data});break;case"setScene":R.dispatchEvent({type:P.SET_SCENE,value:i.data});break;case"addCamera":R.dispatchEvent({type:P.ADD_CAMERA,value:i.data});break;case"removeCamera":R.dispatchEvent({type:P.REMOVE_CAMERA,value:i.data});break;case"addGroup":R.dispatchEvent({type:P.ADD_GROUP,value:i.data});break;case"removeGroup":R.dispatchEvent({type:P.REMOVE_GROUP,value:i.data});break;case"addSpline":R.dispatchEvent({type:P.ADD_SPLINE,value:i.data});break;case"addRenderer":R.dispatchEvent({type:P.ADD_RENDERER,value:i.data})}}addRT(e,t){const i=new o.WebGLRenderTarget(32,32,t);i.texture.name=e,this.renderTargets.set(e,i)}resize(e,t){const i=this.dpr;this.renderTargets.forEach(a=>{a.setSize(e*i,t*i)});const n=!(this.renderer?.domElement instanceof OffscreenCanvas);this.renderer?.setSize(e,t,n)}set dpr(e){this.renderer?.setPixelRatio(je(1,2,e))}get dpr(){return this.renderer!==void 0?this.renderer?.getPixelRatio():1}get width(){return this.renderer!==void 0?this.renderer.domElement.width/this.dpr:0}get height(){return this.renderer!==void 0?this.renderer.domElement.height/this.dpr:0}}var mi={exports:{}},nt={};/**
|
18
|
+
`,f=c.createShader(35633),g=c.createShader(35632),w=c.createProgram();if(!(g&&f&&w))return;c.shaderSource(f,u),c.shaderSource(g,m),c.compileShader(f),c.compileShader(g),c.attachShader(w,f),c.attachShader(w,g),c.linkProgram(w),c.detachShader(w,f),c.detachShader(w,g),c.deleteShader(f),c.deleteShader(g),c.useProgram(w);const C=c.createBuffer();c.bindBuffer(34962,C),c.bufferData(34962,new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),35044);const A=c.getAttribLocation(w,"aPosition");c.vertexAttribPointer(A,3,5126,!1,0,0),c.enableVertexAttribArray(A),c.clearColor(1,1,1,1),c.clear(16384),c.viewport(0,0,1,1),c.drawArrays(4,0,3);const _=new Uint8Array(4);return c.readPixels(0,0,1,1,6408,5121,_),c.deleteProgram(w),c.deleteBuffer(C),_.join("")}(s),n="801621810",a="8016218135",r="80162181161",l=Me?.isIpad?[["a7",r,12],["a8",a,15],["a8x",a,15],["a9",a,15],["a9x",a,15],["a10",a,15],["a10x",a,15],["a12",n,15],["a12x",n,15],["a12z",n,15],["a14",n,15],["a15",n,15],["m1",n,15],["m2",n,15]]:[["a7",r,12],["a8",a,12],["a9",a,15],["a10",a,15],["a11",n,15],["a12",n,15],["a13",n,15],["a14",n,15],["a15",n,15],["a16",n,15],["a17",n,15]];let h;return i==="80162181255"?h=l.filter(([,,c])=>c>=14):(h=l.filter(([,c])=>c===i),h.length||(h=l)),h.map(([c])=>`apple ${c} gpu`)}class Fi extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}const Kt=[],Hi=[];function an(s,e){if(s===e)return 0;const t=s;s.length>e.length&&(s=e,e=t);let i=s.length,n=e.length;for(;i>0&&s.charCodeAt(~-i)===e.charCodeAt(~-n);)i--,n--;let a,r=0;for(;r<i&&s.charCodeAt(r)===e.charCodeAt(r);)r++;if(i-=r,n-=r,i===0)return n;let l,h,c=0,u=0,m=0;for(;u<i;)Hi[u]=s.charCodeAt(r+u),Kt[u]=++u;for(;m<n;)for(a=e.charCodeAt(r+m),l=m++,c=m,u=0;u<i;u++)h=a===Hi[u]?l:l+1,l=Kt[u],c=Kt[u]=l>c?h>c?c+1:h:h>l?l+1:h;return c}function on(s){return s!=null}const ln=({mobileTiers:s=[0,15,30,60],desktopTiers:e=[0,15,30,60],override:t={},glContext:i,failIfMajorPerformanceCaveat:n=!1,benchmarksURL:a="https://unpkg.com/detect-gpu@5.0.57/dist/benchmarks"}={})=>qt(void 0,void 0,void 0,function*(){const r={};if(_s)return{tier:0,type:"SSR"};const{isIpad:l=!!Me?.isIpad,isMobile:h=!!Me?.isMobile,screenSize:c=window.screen,loadBenchmarks:u=O=>qt(void 0,void 0,void 0,function*(){const T=yield fetch(`${a}/${O}`).then(L=>L.json());if(parseInt(T.shift().split(".")[0],10)<4)throw new Fi("Detect GPU benchmark data is out of date. Please update to version 4x");return T})}=t;let{renderer:m}=t;const f=(O,T,L,j,D)=>({device:D,fps:j,gpu:L,isMobile:h,tier:O,type:T});let g,w="";if(m)m=Ni(m),g=[m];else{const O=i||function(L,j=!1){const D={alpha:!1,antialias:!1,depth:!1,failIfMajorPerformanceCaveat:j,powerPreference:"high-performance",stencil:!1};L&&delete D.powerPreference;const B=window.document.createElement("canvas"),_e=B.getContext("webgl",D)||B.getContext("experimental-webgl",D);return _e??void 0}(Me?.isSafari12,n);if(!O)return f(0,"WEBGL_UNSUPPORTED");const T=Me?.isFirefox?null:O.getExtension("WEBGL_debug_renderer_info");if(m=T?O.getParameter(T.UNMASKED_RENDERER_WEBGL):O.getParameter(O.RENDERER),!m)return f(1,"FALLBACK");w=m,m=Ni(m),g=function(L,j,D){return j==="apple gpu"?rn(L,j,D):[j]}(O,m,h)}const C=(yield Promise.all(g.map(function(O){var T;return qt(this,void 0,void 0,function*(){const L=(G=>{const ae=h?["adreno","apple","mali-t","mali","nvidia","powervr","samsung"]:["intel","apple","amd","radeon","nvidia","geforce","adreno"];for(const Ee of ae)if(G.includes(Ee))return Ee})(O);if(!L)return;const j=`${h?"m":"d"}-${L}${l?"-ipad":""}.json`,D=r[j]=(T=r[j])!==null&&T!==void 0?T:u(j);let B;try{B=yield D}catch(G){if(G instanceof Fi)throw G;return}const _e=function(G){var ae;const Ee=(G=G.replace(/\([^)]+\)/,"")).match(/\d+/)||G.match(/(\W|^)([A-Za-z]{1,3})(\W|$)/g);return(ae=Ee?.join("").replace(/\W|amd/g,""))!==null&&ae!==void 0?ae:""}(O);let pe=B.filter(([,G])=>G===_e);pe.length||(pe=B.filter(([G])=>G.includes(O)));const ne=pe.length;if(ne===0)return;const q=O.split(/[.,()\[\]/\s]/g).sort().filter((G,ae,Ee)=>ae===0||G!==Ee[ae-1]).join(" ");let X,[Pe,,,,ce]=ne>1?pe.map(G=>[G,an(q,G[2])]).sort(([,G],[,ae])=>G-ae)[0][0]:pe[0],ge=Number.MAX_VALUE;const{devicePixelRatio:te}=window,Re=c.width*te*c.height*te;for(const G of ce){const[ae,Ee]=G,it=ae*Ee,Ye=Math.abs(Re-it);Ye<ge&&(ge=Ye,X=G)}if(!X)return;const[,,De,Ie]=X;return[ge,De,Pe,Ie]})}))).filter(on).sort(([O=Number.MAX_VALUE,T],[L=Number.MAX_VALUE,j])=>O===L?T-j:O-L);if(!C.length){const O=nn.find(T=>m.includes(T));return O?f(0,"BLOCKLISTED",O):f(1,"FALLBACK",`${m} (${w})`)}const[,A,_,y]=C[0];if(A===-1)return f(0,"BLOCKLISTED",_,A,y);const x=h?s:e;let S=0;for(let O=0;O<x.length;O++)A>=x[O]&&(S=O);return f(S,"BENCHMARK",_,A,y)});var vs=(s=>(s[s.High=0]="High",s[s.Medium=1]="Medium",s[s.Low=2]="Low",s))(vs||{});function cn(s){return new Promise(e=>{ln().then(t=>{let i=!1;const n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);if(i="transferControlToOffscreen"in s,n){const r=navigator.userAgent.match(/version\/(\d+)/i);i=(r?parseInt(r[1]):0)>=17}const a={dpr:devicePixelRatio,fps:t.fps!==void 0?t.fps:30,width:innerWidth,height:innerHeight,mobile:t.isMobile!==void 0?t.isMobile:!1,supportOffScreenCanvas:i,quality:2};t.tier===3?a.quality=0:t.tier===2&&(a.quality=1),e(a)})})}function je(s,e,t){return Math.min(e,Math.max(s,t))}function ui(s,e,t){return(t-s)/(e-s)}function Nt(s,e,t){return s*(1-t)+e*t}function hn(s,e){const t=s-e;return Math.sqrt(t*t)}function Ce(s,e=1){return Number(s.toFixed(e))}const dn=s=>{s?.dispose()},ys=s=>{s&&(Array.isArray(s)?s.forEach(e=>e.dispose()):s.dispose())},Ae=s=>{if(s){for(;s.children.length>0;){const e=s.children[0];e.type==="Audio"?(e.pause(),e.parent&&e.parent.remove(e)):Ae(e)}if(s.parent&&s.parent.remove(s),s.isMesh){const e=s;e.geometry?.dispose(),ys(e.material)}s.dispose!==void 0&&s.dispose()}};exports.totalThreeObjects=0;const pi=()=>{exports.totalThreeObjects=0},Ft=s=>{if(!s)return;let e=s.name.replaceAll(" ","").replaceAll("/",".");if(e.length===0&&(e=`obj_${exports.totalThreeObjects}`,exports.totalThreeObjects++),s.parent!==null&&s.parent.uuid.length>0&&(e=`${s.parent.uuid}.${e}`),s.uuid=e,s.isMesh!==void 0){const t=s;if(Array.isArray(t.material))t.material.forEach((i,n)=>{i.uuid=`${e}.material.${n}`});else{const i=t.material;i.uuid=`${e}.material`}}s.children.forEach(t=>Ft(t))};class vt{static renderer;static canvas;static context=null;static scene=null;static camera=null;static material=null;static inited=!1;static width=100;static height=100;static init(){this.inited||(this.canvas=document.createElement("canvas"),this.canvas.width=this.width,this.canvas.height=this.height,this.context=this.canvas.getContext("2d"),this.inited=!0)}static renderToBlob(e){this.init();const t=e.repeat.clone(),i=e.offset.clone();if(e.repeat.set(1,1),e.offset.set(0,0),this.context!==null){this.context.clearRect(0,0,this.width,this.height);const n=e.image;if(n!=null&&n.width>0){this.canvas.title=e.sourceFile;const a=this.canvas.width/n.width,r=this.renderToCanvas(e);this.context.drawImage(r,0,0,n.width*a,n.height*a)}}return e.repeat.copy(t),e.offset.copy(i),this.canvas.toDataURL("image/png")}static renderToCanvas(e){if(this.material===null){this.camera=new o.OrthographicCamera(-.5,.5,.5,-.5,0,100),this.scene=new o.Scene,this.material=new o.MeshBasicMaterial;const t=new o.BufferGeometry;t.setAttribute("position",new o.Float32BufferAttribute([-.5,-.5,0,1.5,-.5,0,-.5,1.5,0],3)),t.setAttribute("normal",new o.Float32BufferAttribute([0,0,1,0,0,1],3)),t.setAttribute("uv",new o.Float32BufferAttribute([0,0,2,0,0,2],2));const i=new o.Mesh(t,this.material);this.scene.add(i)}if(e.isRenderTargetTexture)this.material.map=e,this.renderer.render(this.scene,this.camera);else{const t=this.renderer.outputColorSpace,i=e.colorSpace;this.renderer.outputColorSpace=o.LinearSRGBColorSpace,e.colorSpace=o.LinearSRGBColorSpace,this.material.map=e,this.renderer.render(this.scene,this.camera),this.renderer.outputColorSpace=t,e.colorSpace=i}return this.renderer.domElement}}function un(s){return new Promise(e=>{const t=new o.ObjectLoader;t.parseAsync(s.scene).then(i=>{const n=new o.AnimationMixer(i);if(s.animations.length>0){const r=s.animations.map(h=>o.AnimationClip.parse(h));n.clipAction(r[0]).play()}const a=[];s.cameras&&s.cameras.length>0&&s.cameras.forEach(r=>{const l=t.parse(r);a.push(l)}),e({animations:s.animations,model:i,mixer:n,cameras:a})})})}const We=Ci(["ctrlKey","metaKey","shiftKey","button","pointerId","pointerType","clientX","clientY","pageX","pageY"]),pn=Ci(["clientX","clientY","deltaX","deltaY","deltaMode"]),mn=Ci(["ctrlKey","metaKey","shiftKey","keyCode"]);function fn(s,e){s.preventDefault(),pn(s,e)}function gn(s){s.preventDefault()}function _n(s,e,t){for(const i of e)t[i]=s[i]}function Ci(s){return function(t,i){const n={type:t.type};_n(t,s,n),i(n)}}function $t(s,e){const t=[],i={type:s.type,touches:t};for(let n=0;n<s.touches.length;++n){const a=s.touches[n];t.push({pageX:a.pageX,pageY:a.pageY})}e(i)}const vn={37:!0,38:!0,39:!0,40:!0};function yn(s,e){const{keyCode:t}=s;vn[t]&&(s.preventDefault(),mn(s,e))}const Cn={contextmenu:gn,mousedown:We,mousemove:We,mouseup:We,pointerdown:We,pointermove:We,pointerup:We,touchstart:$t,touchmove:$t,touchend:$t,wheel:fn,keydown:yn};let bn=0;class En{id;worker;constructor(e,t,i){this.id=bn++,this.worker=t;const n=r=>{this.worker.postMessage({type:"event",id:this.id,data:r})};t.postMessage({type:"makeProxy",id:this.id});for(const[r,l]of Object.entries(i))e.addEventListener(r,h=>{l(h,n)});function a(){n({type:"resize",left:0,top:0,width:innerWidth,height:innerHeight})}window.addEventListener("resize",a),a()}}class Cs extends o.EventDispatcher{style={};left=0;top=0;width=0;height=0;ownerDocument=void 0;constructor(){super(),this.ownerDocument=this}get clientWidth(){return this.width}set clientWidth(e){this.width=e}get clientHeight(){return this.height}set clientHeight(e){this.height=e}setPointerCapture(){}releasePointerCapture(){}getBoundingClientRect(){return{x:this.left,y:this.top,left:this.left,top:this.top,width:this.width,height:this.height,right:this.left+this.width,bottom:this.top+this.height,toJSON:()=>({})}}handleEvent(e){if(e.type==="size"){this.left=e.left,this.top=e.top,this.width=e.width,this.height=e.height;return}e.preventDefault=yt,e.stopPropagation=yt,this.dispatchEvent(e)}focus(){}getRootNode(){return this}}class Sn{targets={};constructor(){this.handleEvent=this.handleEvent.bind(this)}makeProxy(e){const{id:t}=e,i=new Cs;this.targets[t]=i}getProxy(e){return this.targets[e]}handleEvent(e){this.targets[e.id]?.handleEvent(e.data)}}class wn{components=new Map;listen;_appID="";_debugEnabled;_broadcastChannel=void 0;_webSocket=void 0;_mode="app";_connected=!1;_useBC=!1;constructor(e,t,i=!0){this._appID=e,this._debugEnabled=t,t&&(this._useBC=i,i?(this._broadcastChannel=new BroadcastChannel(e),this._broadcastChannel.addEventListener("message",this.messageHandler)):(this._webSocket=new WebSocket(e),this._webSocket.addEventListener("open",this.openHandler),this._webSocket.addEventListener("close",this.closeHandler),this._webSocket.addEventListener("message",this.messageHandler)))}addComponent(e,t){this.components.set(e,t)}dispose(){this._broadcastChannel!==void 0&&this._broadcastChannel.removeEventListener("message",this.messageHandler),this._webSocket!==void 0&&(this._webSocket.removeEventListener("open",this.openHandler),this._webSocket.removeEventListener("close",this.closeHandler),this._webSocket.removeEventListener("message",this.messageHandler)),this.components.forEach(e=>{e.dispose()}),this.components.clear()}send(e){this._mode!==e.target&&(this._useBC?this._broadcastChannel?.postMessage(e):this._connected&&this._webSocket?.send(JSON.stringify(e)))}messageHandler=e=>{this.listen!==void 0&&(this._useBC?this.listen(e.data):this.listen(JSON.parse(e.data)))};openHandler=()=>{this._connected=!0};closeHandler=()=>{this._connected=!1};get appID(){return this._appID}get connected(){return this._connected}get debugEnabled(){return this._debugEnabled}get mode(){return this._mode}get isApp(){return this._mode==="app"}get editor(){return this._mode==="editor"}set editor(e){e&&(this._mode="editor")}}var P=(s=>(s.CUSTOM="ToolEvents::custom",s.SELECT_DROPDOWN="ToolEvents::selectDropdown",s.DRAG_UPDATE="ToolEvents::dragUpdate",s.ADD_SCENE="ToolEvents::addScene",s.REFRESH_SCENE="ToolEvents::refreshScene",s.REMOVE_SCENE="ToolEvents::removeScene",s.SET_SCENE="ToolEvents::setScene",s.GET_OBJECT="ToolEvents::getObject",s.SET_OBJECT="ToolEvents::setObject",s.UPDATE_OBJECT="ToolEvents::updateObject",s.CREATE_TEXTURE="ToolEvents::createTexture",s.REQUEST_METHOD="ToolEvents::requestMethod",s.ADD_CAMERA="ToolEvents::addCamera",s.REMOVE_CAMERA="ToolEvents::removeCamera",s.ADD_GROUP="ToolEvents::addGroup",s.REMOVE_GROUP="ToolEvents::removeGroup",s.ADD_SPLINE="ToolEvents::addSpline",s.ADD_RENDERER="ToolEvents::addRenderer",s.UPDATE_RENDERER="ToolEvents::updateRenderer",s))(P||{});const R=new o.EventDispatcher;class zt{app;constructor(e){this.app=e}dispose(){}handleApp(e,t,i){}handleEditor(e,t,i){}}class xn extends zt{selectDropdown(e,t){this.app.send({event:"selectComponent",target:"app",data:{dropdown:e,value:t}})}updateDropdown(e,t){this.app.send({event:"draggableListUpdate",target:"app",data:{dropdown:e,value:t}})}handleApp(e,t,i){switch(i.event){case"selectComponent":R.dispatchEvent({type:P.SELECT_DROPDOWN,value:i.data});break;case"draggableListUpdate":R.dispatchEvent({type:P.DRAG_UPDATE,value:i.data});break}}}function On(s,e,t){if(s.editor){t.ui.restore(),t.onSelectionChange(r=>{r.length<1||r.forEach(l=>{let h=l.address.sheetId,c="setSheet",u={};switch(l.type){case"Theatre_Sheet_PublicAPI":c="setSheet",u={sheet:l.address.sheetId},e.activeSheet=e.sheets.get(l.address.sheetId);break;case"Theatre_SheetObject_PublicAPI":c="setSheetObject",h+=`_${l.address.objectKey}`,u={id:h,sheet:l.address.sheetId,key:l.address.objectKey},e.activeSheet=e.sheets.get(l.address.sheetId);break}s.send({event:c,target:"app",data:u})})});let i=-1;const n=()=>{if(e.activeSheet!==void 0&&i!==e.activeSheet.sequence.position){i=e.activeSheet.sequence.position;const r=e.activeSheet;s.send({event:"updateTimeline",target:"app",data:{position:i,sheet:r.address.sheetId}})}},a=()=>{n(),requestAnimationFrame(a)};n(),a()}else t.ui.hide()}function Mn(){setTimeout(()=>{const s=document.getElementById("theatrejs-studio-root");if(s===null||s.shadowRoot===null)return;const e=s.shadowRoot.getElementById("pointer-root");if(e===null)return;const t=e.children[0];if(t===null)return;const i=t.children[1];i.style.justifyContent="left";try{const n=i.children[1];for(n.style.transform="translateX(10px)";n.children.length>1;)n.removeChild(n.children[0])}catch{}try{const n=t.children[3];n.style.top="0",n.style.right="300px"}catch{}},1e3)}class Tn extends zt{project;sheets=new Map;sheetObjects=new Map;sheetObjectCBs=new Map;sheetObjectUnsubscribe=new Map;activeSheet;studio=void 0;dispose(){this.project=void 0,this.sheets=new Map,this.sheetObjects=new Map,this.sheetObjectCBs=new Map,this.sheetObjectUnsubscribe=new Map}getSheetInstance(e,t){return t!==void 0?`${e}-${t}`:e}sheet(e,t){if(this.project===void 0){console.error("Theatre Project hasn't been created yet.");return}const i=this.getSheetInstance(e,t);let n=this.sheets.get(i);return n!==void 0||(n=this.project?.sheet(e,t),this.sheets.set(i,n)),n}playSheet(e,t,i){return new Promise(n=>{const a=t!==void 0?{...t}:{};this.sheet(e,i)?.sequence.play(a).then(r=>n(r)),this.app.send({event:"playSheet",target:"editor",data:{sheet:e,instance:i,value:t}})})}pauseSheet(e,t){this.sheet(e,t)?.sequence.pause(),this.app.send({event:"pauseSheet",target:"editor",data:{sheet:e,instance:t}})}clearSheetObjects(e){this.sheetObjects.forEach((t,i)=>{i.search(`${e}_`)>-1&&this.unsubscribe(t)})}sheetObject(e,t,i,n,a){if(this.project===void 0){console.error("Theatre Project hasn't been created yet.");return}const r=this.sheet(e,a);if(r===void 0)return;const h=`${this.getSheetInstance(e,a)}_${t}`;let c=this.sheetObjects.get(h);c!==void 0?c=r.object(t,{...i,...c.value},{reconfigure:!0}):c=r.object(t,i),this.sheetObjects.set(h,c),this.sheetObjectCBs.set(h,n!==void 0?n:yt);const u=c.onValuesChange(m=>{if(this.app.editor){for(const g in m){const w=m[g];typeof w=="object"&&gs(w)&&(m[g]={r:w.r,g:w.g,b:w.b,a:w.a})}this.app.send({event:"updateSheetObject",target:"app",data:{sheet:e,sheetObject:h,values:m}})}const f=this.sheetObjectCBs.get(h);f!==void 0&&f(m)});return this.sheetObjectUnsubscribe.set(h,u),c}unsubscribe(e){if(this.project===void 0){console.error("Theatre Project hasn't been created yet.");return}const t=e.address.sheetId,i=e.address.objectKey;this.sheets.get(t)?.detachObject(i);const a=`${t}_${i}`,r=this.sheetObjectUnsubscribe.get(a);r!==void 0&&(this.sheetObjects.delete(a),this.sheetObjectCBs.delete(a),this.sheetObjectUnsubscribe.delete(a),r())}handleApp(e,t,i){const n=t;let a;switch(i.event){case"setSheet":a=n.sheets.get(i.data.sheet),a!==void 0&&(n.activeSheet=a,this.studio?.setSelection([a]));break;case"setSheetObject":a=n.sheetObjects.get(`${i.data.sheet}_${i.data.key}`),a!==void 0&&this.studio?.setSelection([a]);break;case"updateSheetObject":a=n.sheets.get(i.data.sheet),a!==void 0&&a.sequence.pause(),a=n.sheetObjectCBs.get(i.data.sheetObject),a!==void 0&&a(i.data.values);break;case"updateTimeline":a=n.sheets.get(i.data.sheet),n.activeSheet!==void 0&&(n.activeSheet.sequence.position=i.data.position);break}}handleEditor(e,t,i){if(e.editor){const n=t;switch(i.event){case"playSheet":n.sheet(i.data.sheet,i.data.instance)?.sequence.play(i.data.value);break;case"pauseSheet":n.sheet(i.data.sheet,i.data.instance)?.sequence.pause();break}}}handleEditorApp(e,t){if(e.editor){this.studio?.ui.restore(),this.studio?.onSelectionChange(r=>{r.length<1||r.forEach(l=>{let h=l.address.sheetId,c="setSheet",u={};switch(l.type){case"Theatre_Sheet_PublicAPI":c="setSheet",u={sheet:l.address.sheetId},t.activeSheet=t.sheets.get(l.address.sheetId);break;case"Theatre_SheetObject_PublicAPI":c="setSheetObject",h+=`_${l.address.objectKey}`,u={id:h,sheet:l.address.sheetId,key:l.address.objectKey},t.activeSheet=t.sheets.get(l.address.sheetId);break}e.send({event:c,target:"app",data:u})})});let i=-1;const n=()=>{if(t.activeSheet!==void 0&&i!==t.activeSheet.sequence.position){i=t.activeSheet.sequence.position;const r=t.activeSheet;e.send({event:"updateTimeline",target:"app",data:{position:i,sheet:r.address.sheetId}})}},a=()=>{n(),requestAnimationFrame(a)};n(),a()}else this.studio?.ui.hide()}}function An(s){if(s.name==="cameras")return"camera";if(s.name==="interactive")return"interactive";if(s.name==="lights")return"light";if(s.name==="ui")return"ui";if(s.name==="utils")return"utils";const e=s.type;return e.search("Helper")>-1?"icon_utils":e.search("Camera")>-1?"camera":e.search("Light")>-1?"light":"obj3D"}function tt(s){const e={name:s.name,type:s.type,uuid:s.uuid,children:[]};return s.children.forEach(t=>{e.children.push(tt(t))}),e}function Pn(s){const e={};for(const t in s){const i=s[t].value;e[t]={value:i},i===null?e[t].value={src:"",offset:[0,0],repeat:[1,1]}:i!==void 0&&i.isTexture&&(e[t].value={src:i.image.src,offset:[i.offset.x,i.offset.y],repeat:[i.repeat.x,i.repeat.y]})}return e}function Rn(s){switch(s){case"blendSrcAlpha":case"blendDstAlpha":case"blendEquationAlpha":case"clippingPlanes":case"shadowSide":case"precision":return!0}return!1}function Xe(s){const e={};for(const t in s){if(t.substring(0,1)==="_"||t.substring(0,2)==="is"||Rn(t))continue;const i=typeof s[t],n=s[t];switch(i){case"boolean":case"number":case"string":e[t]=n;break;case"object":n!==null?(e[t]=n,n.isTexture?e[t]={src:vt.renderToBlob(n),offset:[n.offset.x,n.offset.y],repeat:[n.repeat.x,n.repeat.y]}:t==="uniforms"&&(e[t]=Pn(e[t]))):t==="glslVersion"?e[t]="":e[t]={src:"",offset:[0,0],repeat:[1,1]};break}}return s.anisotropy!==void 0&&(e.anisotropy=s.anisotropy),s.clearcoat!==void 0&&(e.clearcoat=s.clearcoat),s.iridescence!==void 0&&(e.iridescence=s.iridescence),s.dispersion!==void 0&&(e.dispersion=s.dispersion),s.sheen!==void 0&&(e.sheen=s.sheen),s.transmission!==void 0&&(e.transmission=s.transmission),s.transmission!==void 0&&(e.transmission=s.transmission),e}function Jt(s){s.updateMatrix();const e={name:s.name,type:s.type,uuid:s.uuid,visible:s.visible,matrix:s.matrix.elements,animations:[],material:void 0,perspectiveCameraInfo:void 0,orthographicCameraInfo:void 0,lightInfo:void 0,children:[]};s.animations.forEach(i=>{e.animations.push({name:i.name,duration:i.duration,blendMode:i.blendMode})});const t=s.type.toLowerCase();if(t.search("mesh")>-1){const i=s;if(Array.isArray(i.material)){const n=[];i.material.forEach(a=>{n.push(Xe(a))}),e.material=n}else e.material=Xe(i.material)}else if(t.search("points")>-1){const i=s;if(Array.isArray(i.material)){const n=[];i.material.forEach(a=>{n.push(Xe(a))}),e.material=n}else e.material=Xe(i.material)}else if(t.search("line")>-1){const i=s;if(Array.isArray(i.material)){const n=[];i.material.forEach(a=>{n.push(Xe(a))}),e.material=n}else e.material=Xe(i.material)}else t.search("camera")>-1?s.type==="PerspectiveCamera"?e.perspectiveCameraInfo={fov:s.fov,zoom:s.zoom,near:s.near,far:s.far,focus:s.focus,aspect:s.aspect,filmGauge:s.filmGauge,filmOffset:s.filmOffset}:s.type==="OrthographicCamera"&&(e.orthographicCameraInfo={zoom:s.zoom,near:s.near,far:s.far,left:s.left,right:s.right,top:s.top,bottom:s.bottom}):t.search("light")>-1&&(e.lightInfo={color:s.color,intensity:s.intensity,decay:s.decay,distance:s.distance,angle:s.angle,penumbra:s.penumbra,groundColor:s.groundColor,width:s.width,height:s.height});return e}function Dn(s,e){const t=e.split(".");switch(t.length){case 1:return s[t[0]];case 2:return s[t[0]][t[1]];case 3:return s[t[0]][t[1]][t[2]];case 4:return s[t[0]][t[1]][t[2]][t[3]];case 5:return s[t[0]][t[1]][t[2]][t[3]][t[4]];case 6:return s[t[0]][t[1]][t[2]][t[3]][t[4]][t[5]]}}function In(s,e){for(const t in e)s[t]=e[t]}function ee(s,e,t){if(s===void 0)return;const i=e.split("."),n=i.length;if(typeof t!="object")switch(n){case 1:s[i[0]]=t;break;case 2:s[i[0]][i[1]]=t;break;case 3:s[i[0]][i[1]][i[2]]=t;break;case 4:s[i[0]][i[1]][i[2]][i[3]]=t;break;case 5:s[i[0]][i[1]][i[2]][i[3]][i[4]]=t;break}else{let r;switch(n){case 1:r=s[i[0]];break;case 2:r=s[i[0]][i[1]];break;case 3:r=s[i[0]][i[1]][i[2]];break;case 4:r=s[i[0]][i[1]][i[2]][i[3]];break;case 5:r=s[i[0]][i[1]][i[2]][i[3]][i[4]];break}r!=null&&In(r,t)}}function bs(s){return new Promise((e,t)=>{const i=new Image;i.onload=()=>{const n=new o.Texture(i);n.wrapS=o.RepeatWrapping,n.wrapT=o.RepeatWrapping,n.needsUpdate=!0,e(n)},i.onerror=t,i.src=s})}class Ln extends zt{canvas=null;inputElement=null;scene=void 0;scenes=new Map;renderer=void 0;renderTargets=new Map;groups=new Map;dispose(){this.scenes.forEach(e=>{Ae(e)}),this.scenes.clear(),this.scene&&Ae(this.scene),this.renderTargets.forEach(e=>{e.dispose()}),this.renderTargets.clear(),this.renderer?.dispose()}getObject(e){this.app.debugEnabled&&(this.renderer!==void 0&&(vt.renderer=this.renderer),this.app.send({event:"getObject",target:"app",data:e}))}setObject(e){this.renderer!==void 0&&(vt.renderer=this.renderer);const t=Jt(e);this.app.send({event:"setObject",target:"editor",data:t})}requestMethod(e,t,i,n){this.app.send({event:"requestMethod",target:"app",data:{uuid:e,key:t,value:i,subitem:n}})}updateObject(e,t,i){this.app.send({event:"updateObject",target:"app",data:{uuid:e,key:t,value:i}})}createTexture(e,t,i){this.app.send({event:"createTexture",target:"app",data:{uuid:e,key:t,value:i}})}addGroup(e){this.groups.get(e.title)===void 0&&(this.groups.set(e.title,{title:e.title,onUpdate:e.onUpdate}),this.app.send({event:"addGroup",target:"editor",data:JSON.stringify(e)}))}removeGroup(e){this.groups.get(e)!==void 0&&(this.groups.delete(e),this.app.send({event:"removeGroup",target:"editor",data:e}))}updateGroup(e,t,i){this.app.send({event:"updateGroup",target:"app",data:JSON.stringify({group:e,prop:t,value:i})})}removeAllGroups(){this.groups.forEach(e=>{const t=e.title;this.groups.delete(t),this.app.send({event:"removeGroup",target:"editor",data:t})}),this.groups.clear()}addSpline(e){setTimeout(()=>{this.app.send({event:"addSpline",target:"editor",data:JSON.stringify(e.toJSON())})},1)}setRenderer(e,t=null){if(this.renderer=e,this.canvas=e.domElement,this.inputElement=t!==null?t:this.canvas,!this.app.debugEnabled)return;const i=`#${e.getClearColor(new o.Color).getHexString()}`;this.app.send({event:"addRenderer",target:"editor",data:{autoClear:e.autoClear,autoClearColor:e.autoClearColor,autoClearDepth:e.autoClearDepth,autoClearStencil:e.autoClearStencil,outputColorSpace:e.outputColorSpace,localClippingEnabled:e.localClippingEnabled,clearColor:i,clearAlpha:e.getClearAlpha(),colorManagement:o.ColorManagement.enabled,toneMapping:e.toneMapping,toneMappingExposure:e.toneMappingExposure}})}updateRenderer(e){this.app.send({event:"updateRenderer",target:"app",data:e})}addScene(e){if(e===void 0||(this.scenes.set(e.name,e),!this.app.debugEnabled))return;pi(),Ft(e);const t=tt(e);this.app.send({event:"addScene",target:"editor",data:t})}refreshScene(e){if(!this.app.debugEnabled)return;const t=this.scenes.get(e);if(t!==void 0){const i=tt(t);this.app.send({event:"refreshScene",target:"app",data:i})}}removeScene(e){if(e===void 0||(this.scenes.delete(e.name),!this.app.debugEnabled))return;const t=tt(e);this.app.send({event:"removeScene",target:"editor",data:t})}removeAllScenes(){this.scenes.forEach(e=>this.removeScene(e))}getScene(e){let t=null;return this.scenes.forEach((i,n)=>{e.search(n)>-1&&(t=i)}),t}setScene(e){if(e===void 0||(this.scene=e,!this.app.debugEnabled))return;this.renderer!==void 0&&(vt.renderer=this.renderer),pi(),Ft(e);const t=tt(e);this.app.send({event:"setScene",target:"editor",data:t})}addCamera(e){if(!this.app.debugEnabled)return;const t=Jt(e);this.app.send({event:"addCamera",target:"editor",data:t})}removeCamera(e){if(!this.app.debugEnabled)return;const t=Jt(e);this.app.send({event:"removeCamera",target:"editor",data:t})}handleApp(e,t,i){const n=t;switch(i.event){case"getObject":R.dispatchEvent({type:P.GET_OBJECT,value:i.data});break;case"updateObject":R.dispatchEvent({type:P.UPDATE_OBJECT,value:i.data});break;case"createTexture":R.dispatchEvent({type:P.CREATE_TEXTURE,value:i.data});break;case"requestMethod":R.dispatchEvent({type:P.REQUEST_METHOD,value:i.data});break;case"refreshScene":e.send({event:"refreshScene",target:"editor",data:tt(n.scenes.get(i.data.name))});break;case"updateRenderer":n.renderer&&(n.renderer.autoClear=i.data.autoClear,n.renderer.autoClearColor=i.data.autoClearColor,n.renderer.autoClearDepth=i.data.autoClearDepth,n.renderer.autoClearStencil=i.data.autoClearStencil,n.renderer.outputColorSpace=i.data.outputColorSpace,n.renderer.localClippingEnabled=i.data.localClippingEnabled,n.renderer.setClearColor(i.data.clearColor,i.data.clearAlpha),n.renderer.toneMapping=i.data.toneMapping,n.renderer.toneMappingExposure=i.data.toneMappingExposure,o.ColorManagement.enabled=i.data.colorManagement);break}if(i.event==="updateGroup"){const a=JSON.parse(i.data);n.groups.get(a.group)?.onUpdate(a.prop,a.value)}}handleEditor(e,t,i){switch(i.event){case"setObject":R.dispatchEvent({type:P.SET_OBJECT,value:i.data});break;case"addScene":R.dispatchEvent({type:P.ADD_SCENE,value:i.data});break;case"refreshScene":R.dispatchEvent({type:P.REFRESH_SCENE,value:i.data});break;case"removeScene":R.dispatchEvent({type:P.REMOVE_SCENE,value:i.data});break;case"setScene":R.dispatchEvent({type:P.SET_SCENE,value:i.data});break;case"addCamera":R.dispatchEvent({type:P.ADD_CAMERA,value:i.data});break;case"removeCamera":R.dispatchEvent({type:P.REMOVE_CAMERA,value:i.data});break;case"addGroup":R.dispatchEvent({type:P.ADD_GROUP,value:i.data});break;case"removeGroup":R.dispatchEvent({type:P.REMOVE_GROUP,value:i.data});break;case"addSpline":R.dispatchEvent({type:P.ADD_SPLINE,value:i.data});break;case"addRenderer":R.dispatchEvent({type:P.ADD_RENDERER,value:i.data})}}addRT(e,t){const i=new o.WebGLRenderTarget(32,32,t);i.texture.name=e,this.renderTargets.set(e,i)}resize(e,t){const i=this.dpr;this.renderTargets.forEach(a=>{a.setSize(e*i,t*i)});const n=!(this.renderer?.domElement instanceof OffscreenCanvas);this.renderer?.setSize(e,t,n)}set dpr(e){this.renderer?.setPixelRatio(je(1,2,e))}get dpr(){return this.renderer!==void 0?this.renderer?.getPixelRatio():1}get width(){return this.renderer!==void 0?this.renderer.domElement.width/this.dpr:0}get height(){return this.renderer!==void 0?this.renderer.domElement.height/this.dpr:0}}var mi={exports:{}},nt={};/**
|
19
19
|
* @license React
|
20
20
|
* react-jsx-runtime.production.min.js
|
21
21
|
*
|
package/dist/hermes.es.js
CHANGED
package/package.json
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
"module": "./dist/hermes.esm.js",
|
8
8
|
"types": "./types/index.d.ts",
|
9
9
|
"type": "module",
|
10
|
-
"version": "0.0.
|
10
|
+
"version": "0.0.127",
|
11
11
|
"homepage": "https://github.com/tomorrowevening/hermes#readme",
|
12
12
|
"bugs": {
|
13
13
|
"url": "https://github.com/tomorrowevening/hermes/issues"
|
package/types/utils/three.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { AnimationMixer, Material, Object3D, Object3DEventMap, Texture, WebGLRenderer } from 'three';
|
1
|
+
import { AnimationClip, AnimationMixer, Material, Object3D, Object3DEventMap, Texture, WebGLRenderer } from 'three';
|
2
2
|
import { ModelLite } from '../webworkers/types';
|
3
3
|
export declare const disposeTexture: (texture?: Texture) => void;
|
4
4
|
export declare const disposeMaterial: (material?: Material | Material[]) => void;
|
@@ -21,6 +21,7 @@ export declare class ExportTexture {
|
|
21
21
|
private static renderToCanvas;
|
22
22
|
}
|
23
23
|
export type ParsedModel = {
|
24
|
+
animations: AnimationClip[];
|
24
25
|
cameras: Object3D[];
|
25
26
|
model: Object3D<Object3DEventMap>;
|
26
27
|
mixer: AnimationMixer;
|