handler-playable-sdk 0.1.8 → 0.1.9
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/{chunk-5XZYWKIQ.mjs → chunk-CK2F3FW4.mjs} +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/pixi/index.js +1 -1
- package/dist/pixi/index.mjs +1 -1
- package/dist/three/index.d.mts +81 -5
- package/dist/three/index.d.ts +81 -5
- package/dist/three/index.js +57 -54
- package/dist/three/index.mjs +56 -53
- package/package.json +1 -1
package/dist/three/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{b as ot}from"../chunk-5XZYWKIQ.mjs";import*as I from"three";async function $n(e,t={}){let n=()=>{let h=e.style.width||"",u=e.style.height||"",y=320,f=480,_=window.getComputedStyle(e),x=h||_.width,E=u||_.height;if(x&&x!=="auto"&&!x.includes("%")){let T=parseFloat(x);!isNaN(T)&&T>0&&isFinite(T)&&(y=T)}if(E&&E!=="auto"&&!E.includes("%")){let T=parseFloat(E);!isNaN(T)&&T>0&&isFinite(T)&&(f=T)}let S=e.clientWidth,w=e.clientHeight;if((y===320||y<=0||!isFinite(y))&&S&&S>0&&(y=S),(f===480||f<=0||!isFinite(f))&&w&&w>0&&(f=w),y<=0||f<=0||!isFinite(y)||!isFinite(f)){let T=e.getBoundingClientRect();T.width>0&&isFinite(T.width)&&(y=T.width),T.height>0&&isFinite(T.height)&&(f=T.height)}return(y<=0||!isFinite(y))&&(y=e.clientWidth||window.innerWidth||320),(f<=0||!isFinite(f))&&(f=e.clientHeight||window.innerHeight||480),console.log("[THREE-BASE] getSize result:",{width:y,height:f,styleWidth:h,styleHeight:u,effectiveWidth:x,effectiveHeight:E,computedWidth:_.width,computedHeight:_.height,clientWidth:S,clientHeight:w,boundingRect:e.getBoundingClientRect()}),{width:y,height:f}},i=e.style.width&&!e.style.width.includes("%"),a=e.style.height&&!e.style.height.includes("%");e.style.position=e.style.position||"relative",e.style.display=e.style.display||"flex",e.style.flexDirection=e.style.flexDirection||"column",e.style.alignItems=e.style.alignItems||"stretch",e.style.width=e.style.width||"100%",e.style.height=e.style.height||"100dvh",e.style.minHeight=e.style.minHeight||"100vh",e.style.maxWidth=e.style.maxWidth||"100%",e.style.maxHeight=e.style.maxHeight||"100%",e.style.boxSizing=e.style.boxSizing||"border-box",e.style.overflow=e.style.overflow||"hidden",t.background&&(e.style.background=t.background);let s=document.createElement("div");s.setAttribute("style",["position:relative","width:100%","height:100%","display:flex","align-items:center","justify-content:center",`background:${t.background||"transparent"}`,"color:var(--h-text, #f4f6ff)",'font-family:var(--h-font-main, "Inter", "Helvetica Neue", Arial, sans-serif)',"box-sizing:border-box"].join(";")),e.appendChild(s);let o=document.createElement("div");o.setAttribute("style",["position:absolute","inset:0","width:100%","height:100%","pointer-events:auto"].join(";")),s.appendChild(o);let l=new I.Scene,{width:d,height:m}=n(),r=new I.OrthographicCamera(-d/2,d/2,m/2,-m/2,.1,1e3);r.position.set(0,0,1),r.lookAt(0,0,0),r.updateMatrixWorld();let c=new I.WebGLRenderer({antialias:!0,alpha:!0,preserveDrawingBuffer:!0});c.setPixelRatio(window.devicePixelRatio||1),c.setSize(d,m),c.setClearColor(0,0),c.domElement.style.position="absolute",c.domElement.style.top="0",c.domElement.style.left="0",c.domElement.style.width="100%",c.domElement.style.height="100%",c.domElement.style.display="block",c.domElement.style.pointerEvents="auto",o.appendChild(c.domElement);let p=h=>{let u,y;if(typeof(h==null?void 0:h.width)=="number"&&h.width>0?u=h.width:u=n().width,typeof(h==null?void 0:h.height)=="number"&&h.height>0?y=h.height:y=n().height,u<=0||y<=0||!isFinite(u)||!isFinite(y)){console.warn("[THREE-BASE] Invalid size in applySize, using getSize fallback",{newWidth:u,newHeight:y,size:h});let f=n();u=f.width,y=f.height}console.log("[THREE-BASE] applySize:",{newWidth:u,newHeight:y,providedSize:h,containerSize:n()}),c.setSize(u,y),c.setPixelRatio(window.devicePixelRatio||1),r.left=-u/2,r.right=u/2,r.top=y/2,r.bottom=-y/2,r.updateProjectionMatrix()};requestAnimationFrame(()=>p());let g=!1;ot.on("pause",()=>{g=!0,document.querySelectorAll("audio").forEach(u=>u.pause())}),ot.on("resume",()=>{g=!1,document.querySelectorAll("audio").forEach(u=>{u.currentTime>0&&!u.ended&&u.play().catch(()=>{})})}),ot.on("resize",({payload:h})=>{p({width:h==null?void 0:h.width,height:h==null?void 0:h.height})}),window.addEventListener("resize",()=>p());let b=document.createElement("div");return b.setAttribute("style",["position:absolute","inset:0","display:flex","flex-direction:column","justify-content:flex-start","gap:12px","pointer-events:none","font-family:Arial,sans-serif","padding:20px 16px","padding-bottom:clamp(24px, 6vh, 96px)","box-sizing:border-box","z-index:2"].join(";")),s.appendChild(b),{scene:l,camera:r,renderer:c,overlay:b,applySize:p}}import*as v from"three";var rt=class{constructor(t){var n,i;this.position=(t==null?void 0:t.position)||{x:0,y:0},this.scale=(n=t==null?void 0:t.scale)!=null?n:1,this.rotation=(i=t==null?void 0:t.rotation)!=null?i:0}update(t){t.position!==void 0&&(this.position={...t.position}),t.scale!==void 0&&(this.scale=t.scale),t.rotation!==void 0&&(this.rotation=t.rotation)}syncToThree(t){let n=t.position.z,i=n===0||!isFinite(n)?.5:n;t.position.set(this.position.x,this.position.y,i),t.scale.set(this.scale,this.scale,this.scale),t.rotation.z=this.rotation}},lt=class{constructor(t){var n,i,a,s;this.z_index=(n=t==null?void 0:t.z_index)!=null?n:0,this.alpha=(i=t==null?void 0:t.alpha)!=null?i:1,this.visible=(a=t==null?void 0:t.visible)!=null?a:!0,this.tint=(s=t==null?void 0:t.tint)!=null?s:null}update(t){t.z_index!==void 0&&(this.z_index=t.z_index),t.alpha!==void 0&&(this.alpha=t.alpha),t.visible!==void 0&&(this.visible=t.visible),t.tint!==void 0&&(this.tint=t.tint)}syncToThree(t){if(t.renderOrder=this.z_index,t.visible=this.visible,t instanceof v.Mesh&&t.material&&(Array.isArray(t.material)?t.material.forEach(n=>{n instanceof v.Material&&(n.opacity=this.alpha,n.transparent=this.alpha<1)}):t.material instanceof v.Material&&(t.material.opacity=this.alpha,t.material.transparent=this.alpha<1)),this.tint!==null&&t instanceof v.Mesh&&t.material){let n=typeof this.tint=="string"?new v.Color(this.tint):new v.Color(this.tint);Array.isArray(t.material)?t.material.forEach(i=>{(i instanceof v.MeshBasicMaterial||i instanceof v.MeshStandardMaterial)&&i.color.copy(n)}):(t.material instanceof v.MeshBasicMaterial||t.material instanceof v.MeshStandardMaterial)&&t.material.color.copy(n)}}},ct=class{constructor(t,n,i,a){this.instanceId=t,this.objectConfig=n,this.threeObject=i,this._config=a,this.transform=new rt(a.transform),this.renderer=new lt(a.render),this.sync()}sync(){this.transform.syncToThree(this.threeObject),this.renderer.syncToThree(this.threeObject)}updateConfig(t){this._config=t,t.transform&&this.transform.update(t.transform),t.render&&this.renderer.update(t.render),this.sync()}getComponent(t){return this._config[t]}getPosition(){return{...this.transform.position}}setPosition(t,n){this.transform.position={x:t,y:n},this.transform.syncToThree(this.threeObject)}getAlpha(){return this.renderer.alpha}setAlpha(t){this.renderer.alpha=t,this.renderer.syncToThree(this.threeObject)}getVisible(){return this.renderer.visible}setVisible(t){this.renderer.visible=t,this.renderer.syncToThree(this.threeObject)}},Tt=class{constructor(t){this.objects=new Map;this.config=t}create(t,n){let i=this.config.objects.get(t);if(!i)throw new Error(`Object config not found: ${t}`);let a=new ct(t,i.object_config||t,n,i);return this.objects.set(t,a),a}get(t){return this.objects.get(t)}updateConfig(t){this.config=t;for(let[n,i]of this.objects.entries()){let a=t.objects.get(n);a&&i.updateConfig(a)}}getAll(){return Array.from(this.objects.values())}remove(t){this.objects.delete(t)}clear(){this.objects.clear()}};var pt={"brand.primary":{family:"Arial, sans-serif",weight:"400"},"brand.warning":{family:"Arial Black, Arial, sans-serif",weight:"900"},"brand.heading":{family:"Arial Black, Arial, sans-serif",weight:"800"},"brand.body":{family:"Arial, sans-serif",weight:"400"}};function N(e){let t=pt[e];return t?t.family:(console.warn(`Font ID "${e}" not found in registry, using fallback`),"Arial, sans-serif")}function G(e){var n;let t=pt[e];return t&&(n=t.weight)!=null?n:"400"}function An(e,t){pt[e]=t}function Ln(){return Object.keys(pt)}import*as U from"three";function Q(e){return{element:e,get alpha(){return parseFloat(e.style.opacity||"1")},set alpha(t){e.style.opacity=t.toString()},get visible(){return e.style.display!=="none"},set visible(t){e.style.display=t?"":"none"},position:{set(t,n){e.style.left=`${t}px`,e.style.top=`${n}px`},get x(){return parseFloat(e.style.left||"0")},get y(){return parseFloat(e.style.top||"0")}},scale:{set(t,n){e.style.transform=`scale(${t})`},get x(){let t=e.style.transform.match(/scale\(([^)]+)\)/);return t?parseFloat(t[1]):1}}}}function Dn(e,t,n){var Lt,Dt,Wt,kt,zt,Bt,Yt,Pt,Nt,Gt,Xt,qt,Vt,Zt,Jt,Kt,Qt,jt,Ot,It,Ut,te,ee,ne,ae,se,ie,oe,re,le,ce,pe,de,me,he,ue,ye,fe,ge,be,Te,xe,_e,Ee,we,Se,He,ve,Re,Ce,Me,Fe,$e,Ae,Le,De,We,ke,ze,Be,Ye,Pe;let i=e.objects.get("ui_endgame_1"),a=e.objects.get("ui_endgame_logo_1"),s=e.objects.get("ui_endgame_title_1"),o=e.objects.get("ui_endgame_subtitle_1"),l=e.objects.get("ui_endgame_footer_1"),d=e.objects.get("ui_endgame_cta_1"),m=e.objects.get("ui_endgame_cta_hint_1"),r=e.objects.get("ui_endgame_hand_1"),c=e.engine.runtime||{},p=((Lt=i==null?void 0:i.gameplay)==null?void 0:Lt.tuning)||{},g=(i==null?void 0:i.render)||{},b=(Dt=p.panel_width)!=null?Dt:320,h=(Wt=p.panel_height)!=null?Wt:400,u=(kt=p.panel_padding)!=null?kt:32,y=(zt=p.panel_radius)!=null?zt:24,f=g.background_color||p.panel_bg_color||"#1a0a0a",_=g.background_alpha!==void 0&&g.background_alpha!==null?g.background_alpha:(Bt=p.panel_bg_alpha)!=null?Bt:.98,x=g.border_color||p.panel_border_color||"#ffffff",E=(Yt=p.panel_border_width)!=null?Yt:2,S=(Pt=p.panel_border_alpha)!=null?Pt:.3,w=document.createElement("div");w.style.cssText=`
|
|
1
|
+
import{b as lt}from"../chunk-CK2F3FW4.mjs";import*as O from"three";var qe=(s=>(s[s.PHONE_TALL=0]="PHONE_TALL",s[s.TABLET=1]="TABLET",s[s.LANDSCAPE=2]="LANDSCAPE",s))(qe||{});function Et(e,t){let n=e/t;return n<=.62?0:n<=.85?1:2}var nt=class{constructor(t,n){this.root=t,this.stage=n,this.uiFrame=document.createElement("div"),this.uiFrame.style.position="absolute",this.uiFrame.style.top="0",this.uiFrame.style.bottom="0",this.uiFrame.style.left="50%",this.uiFrame.style.transform="translateX(-50%)",this.uiFrame.style.width="100%",this.uiFrame.style.maxWidth="420px",this.uiFrame.style.pointerEvents="none",this.stage.appendChild(this.uiFrame),this.uiContainer=document.createElement("div"),this.uiContainer.setAttribute("style",["position:absolute","inset:0","display:flex","flex-direction:column","justify-content:flex-start","gap:12px","pointer-events:none","padding:20px 16px","padding-bottom:clamp(24px, 6vh, 96px)","box-sizing:border-box","z-index:2"].join(";")),this.uiFrame.appendChild(this.uiContainer),this.updateLayout()}getUIFrame(){return this.uiFrame}getUIContainer(){return this.uiContainer}updateLayout(){let t=this.stage.getBoundingClientRect(),n=Et(t.width,t.height);n===0?this.uiFrame.style.maxWidth="420px":n===1?this.uiFrame.style.maxWidth="520px":this.uiFrame.style.maxWidth="640px"}getAspectClass(){let t=this.stage.getBoundingClientRect();return Et(t.width,t.height)}};async function Dn(e,t={}){let n=()=>{let p=e.style.width||"",f=e.style.height||"",h=320,g=480,E=window.getComputedStyle(e),x=p||E.width,_=f||E.height;if(x&&x!=="auto"&&!x.includes("%")){let T=parseFloat(x);!isNaN(T)&&T>0&&isFinite(T)&&(h=T)}if(_&&_!=="auto"&&!_.includes("%")){let T=parseFloat(_);!isNaN(T)&&T>0&&isFinite(T)&&(g=T)}let w=e.clientWidth,S=e.clientHeight;if((h===320||h<=0||!isFinite(h))&&w&&w>0&&(h=w),(g===480||g<=0||!isFinite(g))&&S&&S>0&&(g=S),h<=0||g<=0||!isFinite(h)||!isFinite(g)){let T=e.getBoundingClientRect();T.width>0&&isFinite(T.width)&&(h=T.width),T.height>0&&isFinite(T.height)&&(g=T.height)}return(h<=0||!isFinite(h))&&(h=e.clientWidth||window.innerWidth||320),(g<=0||!isFinite(g))&&(g=e.clientHeight||window.innerHeight||480),console.log("[THREE-BASE] getSize result:",{width:h,height:g,styleWidth:p,styleHeight:f,effectiveWidth:x,effectiveHeight:_,computedWidth:E.width,computedHeight:E.height,clientWidth:w,clientHeight:S,boundingRect:e.getBoundingClientRect()}),{width:h,height:g}},s=e.style.width&&!e.style.width.includes("%"),a=e.style.height&&!e.style.height.includes("%");e.style.position=e.style.position||"relative",e.style.display=e.style.display||"flex",e.style.flexDirection=e.style.flexDirection||"column",e.style.alignItems=e.style.alignItems||"stretch",e.style.width=e.style.width||"100%",e.style.height=e.style.height||"100dvh",e.style.minHeight=e.style.minHeight||"100vh",e.style.maxWidth=e.style.maxWidth||"100%",e.style.maxHeight=e.style.maxHeight||"100%",e.style.boxSizing=e.style.boxSizing||"border-box",e.style.overflow=e.style.overflow||"hidden",t.background&&(e.style.background=t.background);let i=document.createElement("div");i.setAttribute("style",["position:relative","width:100%","height:100%","display:flex","align-items:center","justify-content:center",`background:${t.background||"transparent"}`,"color:var(--h-text, #f4f6ff)",'font-family:var(--h-font-main, "Inter", "Helvetica Neue", Arial, sans-serif)',"box-sizing:border-box"].join(";")),e.appendChild(i);let o=document.createElement("div");o.setAttribute("style",["position:absolute","inset:0","width:100%","height:100%","pointer-events:auto"].join(";")),i.appendChild(o);let m=new O.Scene,{width:r,height:u}=n(),l=new O.PerspectiveCamera(55,r/u,.1,100);l.position.set(0,0,3.2),l.lookAt(0,0,0),l.updateMatrixWorld();let c=new O.WebGLRenderer({antialias:!0,alpha:!0,preserveDrawingBuffer:!0});c.setPixelRatio(window.devicePixelRatio||1),c.setSize(r,u),c.setClearColor(0,0),c.domElement.style.position="absolute",c.domElement.style.top="0",c.domElement.style.left="0",c.domElement.style.width="100%",c.domElement.style.height="100%",c.domElement.style.display="block",c.domElement.style.pointerEvents="auto",o.appendChild(c.domElement);let y=p=>{let f,h;if(typeof(p==null?void 0:p.width)=="number"&&p.width>0?f=p.width:f=n().width,typeof(p==null?void 0:p.height)=="number"&&p.height>0?h=p.height:h=n().height,f<=0||h<=0||!isFinite(f)||!isFinite(h)){console.warn("[THREE-BASE] Invalid size in applySize, using getSize fallback",{newWidth:f,newHeight:h,size:p});let g=n();f=g.width,h=g.height}console.log("[THREE-BASE] applySize:",{newWidth:f,newHeight:h,providedSize:p,containerSize:n()}),c.setSize(f,h),c.setPixelRatio(window.devicePixelRatio||1),l.aspect=f/h,l.updateProjectionMatrix()};requestAnimationFrame(()=>y());let d=!1;lt.on("pause",()=>{d=!0,document.querySelectorAll("audio").forEach(f=>f.pause())}),lt.on("resume",()=>{d=!1,document.querySelectorAll("audio").forEach(f=>{f.currentTime>0&&!f.ended&&f.play().catch(()=>{})})});let b=new nt(e,i);return lt.on("resize",({payload:p})=>{y({width:p==null?void 0:p.width,height:p==null?void 0:p.height}),b.updateLayout()}),window.addEventListener("resize",()=>{y(),b.updateLayout()}),{scene:m,camera:l,renderer:c,uiSystem:b,applySize:y}}import*as v from"three";var ct=class{constructor(t){var n,s;this.position=(t==null?void 0:t.position)||{x:0,y:0},this.scale=(n=t==null?void 0:t.scale)!=null?n:1,this.rotation=(s=t==null?void 0:t.rotation)!=null?s:0}update(t){t.position!==void 0&&(this.position={...t.position}),t.scale!==void 0&&(this.scale=t.scale),t.rotation!==void 0&&(this.rotation=t.rotation)}syncToThree(t){let n=t.position.z,s=n===0||!isFinite(n)?.5:n;t.position.set(this.position.x,this.position.y,s),t.scale.set(this.scale,this.scale,this.scale),t.rotation.z=this.rotation}},pt=class{constructor(t){var n,s,a,i;this.z_index=(n=t==null?void 0:t.z_index)!=null?n:0,this.alpha=(s=t==null?void 0:t.alpha)!=null?s:1,this.visible=(a=t==null?void 0:t.visible)!=null?a:!0,this.tint=(i=t==null?void 0:t.tint)!=null?i:null}update(t){t.z_index!==void 0&&(this.z_index=t.z_index),t.alpha!==void 0&&(this.alpha=t.alpha),t.visible!==void 0&&(this.visible=t.visible),t.tint!==void 0&&(this.tint=t.tint)}syncToThree(t){if(t.renderOrder=this.z_index,t.visible=this.visible,t instanceof v.Mesh&&t.material&&(Array.isArray(t.material)?t.material.forEach(n=>{n instanceof v.Material&&(n.opacity=this.alpha,n.transparent=this.alpha<1)}):t.material instanceof v.Material&&(t.material.opacity=this.alpha,t.material.transparent=this.alpha<1)),this.tint!==null&&t instanceof v.Mesh&&t.material){let n=typeof this.tint=="string"?new v.Color(this.tint):new v.Color(this.tint);Array.isArray(t.material)?t.material.forEach(s=>{(s instanceof v.MeshBasicMaterial||s instanceof v.MeshStandardMaterial)&&s.color.copy(n)}):(t.material instanceof v.MeshBasicMaterial||t.material instanceof v.MeshStandardMaterial)&&t.material.color.copy(n)}}},mt=class{constructor(t,n,s,a){this.instanceId=t,this.objectConfig=n,this.threeObject=s,this._config=a,this.transform=new ct(a.transform),this.renderer=new pt(a.render),this.sync()}sync(){this.transform.syncToThree(this.threeObject),this.renderer.syncToThree(this.threeObject)}updateConfig(t){this._config=t,t.transform&&this.transform.update(t.transform),t.render&&this.renderer.update(t.render),this.sync()}getComponent(t){return this._config[t]}getPosition(){return{...this.transform.position}}setPosition(t,n){this.transform.position={x:t,y:n},this.transform.syncToThree(this.threeObject)}getAlpha(){return this.renderer.alpha}setAlpha(t){this.renderer.alpha=t,this.renderer.syncToThree(this.threeObject)}getVisible(){return this.renderer.visible}setVisible(t){this.renderer.visible=t,this.renderer.syncToThree(this.threeObject)}},_t=class{constructor(t){this.objects=new Map;this.config=t}create(t,n){let s=this.config.objects.get(t);if(!s)throw new Error(`Object config not found: ${t}`);let a=new mt(t,s.object_config||t,n,s);return this.objects.set(t,a),a}get(t){return this.objects.get(t)}updateConfig(t){this.config=t;for(let[n,s]of this.objects.entries()){let a=t.objects.get(n);a&&s.updateConfig(a)}}getAll(){return Array.from(this.objects.values())}remove(t){this.objects.delete(t)}clear(){this.objects.clear()}};var dt={"brand.primary":{family:"Arial, sans-serif",weight:"400"},"brand.warning":{family:"Arial Black, Arial, sans-serif",weight:"900"},"brand.heading":{family:"Arial Black, Arial, sans-serif",weight:"800"},"brand.body":{family:"Arial, sans-serif",weight:"400"}};function Y(e){let t=dt[e];return t?t.family:(console.warn(`Font ID "${e}" not found in registry, using fallback`),"Arial, sans-serif")}function N(e){var n;let t=dt[e];return t&&(n=t.weight)!=null?n:"400"}function zn(e,t){dt[e]=t}function kn(){return Object.keys(dt)}import*as U from"three";function Q(e){return{element:e,get alpha(){return parseFloat(e.style.opacity||"1")},set alpha(t){e.style.opacity=t.toString()},get visible(){return e.style.display!=="none"},set visible(t){e.style.display=t?"":"none"},position:{set(t,n){e.style.left=`${t}px`,e.style.top=`${n}px`},get x(){return parseFloat(e.style.left||"0")},get y(){return parseFloat(e.style.top||"0")}},scale:{set(t,n){e.style.transform=`scale(${t})`},get x(){let t=e.style.transform.match(/scale\(([^)]+)\)/);return t?parseFloat(t[1]):1}}}}function Bn(e,t,n,s){var zt,kt,Bt,Pt,Yt,Nt,Gt,Xt,qt,Vt,Zt,Jt,Kt,Qt,jt,It,Ot,Ut,te,ee,ne,ae,se,ie,oe,re,le,ce,pe,me,de,ue,he,ye,fe,ge,Te,be,xe,Ee,_e,we,Se,He,ve,Ce,Re,Fe,Me,Ae,$e,Le,We,De,ze,ke,Be,Pe,Ye,Ne,Ge,Xe;let a=e.objects.get("ui_endgame_1"),i=e.objects.get("ui_endgame_logo_1"),o=e.objects.get("ui_endgame_title_1"),m=e.objects.get("ui_endgame_subtitle_1"),r=e.objects.get("ui_endgame_footer_1"),u=e.objects.get("ui_endgame_cta_1"),l=e.objects.get("ui_endgame_cta_hint_1"),c=e.objects.get("ui_endgame_hand_1"),y=e.engine.runtime||{},d=((zt=a==null?void 0:a.gameplay)==null?void 0:zt.tuning)||{},b=(a==null?void 0:a.render)||{},p=(kt=d.panel_width)!=null?kt:320,f=(Bt=d.panel_height)!=null?Bt:400,h=(Pt=d.panel_padding)!=null?Pt:32,g=(Yt=d.panel_radius)!=null?Yt:24,E=b.background_color||d.panel_bg_color||"#1a0a0a",x=b.background_alpha!==void 0&&b.background_alpha!==null?b.background_alpha:(Nt=d.panel_bg_alpha)!=null?Nt:.98,_=b.border_color||d.panel_border_color||"#ffffff",w=(Gt=d.panel_border_width)!=null?Gt:2,S=(Xt=d.panel_border_alpha)!=null?Xt:.3,T=document.createElement("div");T.style.cssText=`
|
|
2
2
|
position: absolute;
|
|
3
|
-
width: ${
|
|
4
|
-
height: ${
|
|
5
|
-
background: ${
|
|
6
|
-
opacity: ${
|
|
7
|
-
border: ${
|
|
3
|
+
width: ${p}px;
|
|
4
|
+
height: ${f}px;
|
|
5
|
+
background: ${E};
|
|
6
|
+
opacity: ${x};
|
|
7
|
+
border: ${w}px solid ${_};
|
|
8
8
|
border-opacity: ${S};
|
|
9
|
-
border-radius: ${
|
|
9
|
+
border-radius: ${g}px;
|
|
10
10
|
display: flex;
|
|
11
11
|
flex-direction: column;
|
|
12
12
|
align-items: center;
|
|
@@ -15,79 +15,82 @@ import{b as ot}from"../chunk-5XZYWKIQ.mjs";import*as I from"three";async functio
|
|
|
15
15
|
opacity: 0;
|
|
16
16
|
visibility: hidden;
|
|
17
17
|
pointer-events: auto;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
left: 50%;
|
|
19
|
+
top: 50%;
|
|
20
|
+
z-index: 1000;
|
|
21
|
+
`,s.appendChild(T);let z=Q(T);z.element=T;let C=((qt=i==null?void 0:i.gameplay)==null?void 0:qt.tuning)||{},D=(i==null?void 0:i.transform)||{},F=(Vt=C.logo_size)!=null?Vt:56,W=(Zt=D.scale)!=null?Zt:1,j=(Kt=(Jt=D.offset)==null?void 0:Jt.y)!=null?Kt:-130,X=(Qt=C.logo_alpha)!=null?Qt:1,G=new U.SpriteMaterial({map:n||void 0,transparent:!0,alphaTest:.1}),H=new U.Sprite(G);H.position.set(0,j,0),H.material.opacity=0;let q=0,at=0;if(n&&(q=((jt=n.image)==null?void 0:jt.width)||100,at=((It=n.image)==null?void 0:It.height)||100),q>0&&at>0){let I=q/at,bt,xt;I>1?(bt=F,xt=F/I):(xt=F,bt=F*I);let Ln=bt/q*W,Wn=xt/at*W;H.scale.set(Ln,Wn,1)}else{let I=F/100*W;H.scale.set(I,I,1)}H.targetAlpha=X,H.baseScaleX=H.scale.x,H.baseScaleY=H.scale.y;let M=o==null?void 0:o.ui,k=((Ot=o==null?void 0:o.gameplay)==null?void 0:Ot.tuning)||{},Je=(M==null?void 0:M.text)||"MISSION ACCOMPLISHED",wt=(M==null?void 0:M.font)||"brand.heading",Ke=(M==null?void 0:M.fontSize)||24,Qe=(Ut=M==null?void 0:M.letterSpacing)!=null?Ut:1,st=(te=o==null?void 0:o.render)==null?void 0:te.tint,je=typeof st=="string"?st:st?`#${st.toString(16).padStart(6,"0")}`:"#00FF88",Ie=p-h*2-30,Oe=k.font_weight_override?k.font_weight_override:N(wt),V=document.createElement("div");V.textContent=Je,V.style.cssText=`
|
|
22
|
+
font-family: ${Y(wt)};
|
|
23
|
+
font-size: ${Ke}px;
|
|
24
|
+
font-weight: ${Oe};
|
|
25
|
+
color: ${je};
|
|
23
26
|
text-align: center;
|
|
24
|
-
letter-spacing: ${
|
|
25
|
-
-webkit-text-stroke: ${(
|
|
26
|
-
text-shadow: ${(
|
|
27
|
+
letter-spacing: ${Qe}px;
|
|
28
|
+
-webkit-text-stroke: ${(ee=k.stroke_width)!=null?ee:2}px ${k.stroke_color||"#000000"};
|
|
29
|
+
text-shadow: ${(ne=k.shadow_distance)!=null?ne:4}px ${(ae=k.shadow_distance)!=null?ae:4}px ${(se=k.shadow_blur)!=null?se:8}px rgba(0,0,0,${(ie=k.shadow_alpha)!=null?ie:.9});
|
|
27
30
|
opacity: 0;
|
|
28
31
|
position: absolute;
|
|
29
32
|
transform: translate(-50%, -50%);
|
|
30
33
|
white-space: nowrap;
|
|
31
|
-
max-width: ${
|
|
32
|
-
`;let
|
|
33
|
-
font-family: ${
|
|
34
|
-
font-size: ${
|
|
35
|
-
font-weight: ${
|
|
36
|
-
color: ${
|
|
34
|
+
max-width: ${Ie}px;
|
|
35
|
+
`;let St=(oe=d.title_offset_y)!=null?oe:30,Ue=St+((re=k.animation_start_y_offset)!=null?re:-20);V.style.top=`${Ue}px`,V.style.left="50%";let Ht=Q(V);Ht.element=V,T.appendChild(V);let A=m==null?void 0:m.ui,vt=((le=m==null?void 0:m.gameplay)==null?void 0:le.tuning)||{},tn=(A==null?void 0:A.text)||"RESCUE COMPLETE",Ct=(A==null?void 0:A.font)||"brand.body",en=(A==null?void 0:A.fontSize)||11,nn=(ce=A==null?void 0:A.letterSpacing)!=null?ce:.5,it=(pe=m==null?void 0:m.render)==null?void 0:pe.tint,an=typeof it=="string"?it:it?`#${it.toString(16).padStart(6,"0")}`:"#B0B0B0",Z=document.createElement("div");Z.textContent=tn,Z.style.cssText=`
|
|
36
|
+
font-family: ${Y(Ct)};
|
|
37
|
+
font-size: ${en}px;
|
|
38
|
+
font-weight: ${N(Ct)};
|
|
39
|
+
color: ${an};
|
|
37
40
|
text-align: center;
|
|
38
|
-
letter-spacing: ${
|
|
41
|
+
letter-spacing: ${nn}px;
|
|
39
42
|
opacity: 0;
|
|
40
43
|
position: absolute;
|
|
41
44
|
transform: translate(-50%, -50%);
|
|
42
45
|
white-space: nowrap;
|
|
43
|
-
`;let
|
|
44
|
-
font-family: ${
|
|
45
|
-
font-size: ${
|
|
46
|
-
font-weight: ${
|
|
47
|
-
color: ${
|
|
46
|
+
`;let sn=St+20+((me=vt.animation_start_y_offset)!=null?me:-10);Z.style.top=`${sn}px`,Z.style.left="50%";let ht=Q(Z);ht.element=Z,ht.animationStartYOffset=(de=vt.animation_start_y_offset)!=null?de:-10,T.appendChild(Z);let B=r==null?void 0:r.ui,Rt=((ue=r==null?void 0:r.gameplay)==null?void 0:ue.tuning)||{},on=(B==null?void 0:B.text)||((he=y.ui)==null?void 0:he.cta_hint)||"Continue the adventure!",Ft=(B==null?void 0:B.font)||"brand.body",rn=(B==null?void 0:B.fontSize)||16,ot=(ye=r==null?void 0:r.render)==null?void 0:ye.tint,ln=typeof ot=="string"?ot:ot?`#${ot.toString(16).padStart(6,"0")}`:"#FFFFFF",cn=(fe=Rt.max_width)!=null?fe:p-h*2,pn=(ge=Rt.line_height)!=null?ge:1.4,J=document.createElement("div");J.textContent=on,J.style.cssText=`
|
|
47
|
+
font-family: ${Y(Ft)};
|
|
48
|
+
font-size: ${rn}px;
|
|
49
|
+
font-weight: ${N(Ft)};
|
|
50
|
+
color: ${ln};
|
|
48
51
|
text-align: center;
|
|
49
52
|
opacity: 0;
|
|
50
53
|
position: absolute;
|
|
51
54
|
transform: translate(-50%, -50%);
|
|
52
|
-
max-width: ${
|
|
53
|
-
line-height: ${
|
|
55
|
+
max-width: ${cn}px;
|
|
56
|
+
line-height: ${pn};
|
|
54
57
|
word-wrap: break-word;
|
|
55
|
-
`;let
|
|
56
|
-
width: ${
|
|
57
|
-
height: ${
|
|
58
|
-
background: ${
|
|
59
|
-
opacity: ${
|
|
60
|
-
border: ${
|
|
61
|
-
border-radius: ${
|
|
58
|
+
`;let mn=(Te=d.footer_offset_y)!=null?Te:120;J.style.top=`${mn}px`,J.style.left="50%";let yt=Q(J);yt.element=J;let dn=((be=r==null?void 0:r.render)==null?void 0:be.alpha)!==void 0&&((xe=r==null?void 0:r.render)==null?void 0:xe.alpha)!==null?r.render.alpha:1;yt.targetAlpha=dn,T.appendChild(J);let P=((Ee=u==null?void 0:u.gameplay)==null?void 0:Ee.tuning)||{},$=u==null?void 0:u.ui,un=(_e=P.button_width)!=null?_e:260,hn=(we=P.button_height)!=null?we:56,yn=(Se=P.button_radius)!=null?Se:16,fn=P.button_bg_color||((He=y.theme)==null?void 0:He.cta_background)||"#ffb43b",gn=(ve=P.button_bg_alpha)!=null?ve:1,Tn=P.button_border_color||"#ffffff",bn=(Ce=P.button_border_width)!=null?Ce:2,Un=(Re=P.button_border_alpha)!=null?Re:.2,ft=(Fe=d.cta_offset_y)!=null?Fe:160,R=document.createElement("button");R.style.cssText=`
|
|
59
|
+
width: ${un}px;
|
|
60
|
+
height: ${hn}px;
|
|
61
|
+
background: ${fn};
|
|
62
|
+
opacity: ${gn};
|
|
63
|
+
border: ${bn}px solid ${Tn};
|
|
64
|
+
border-radius: ${yn}px;
|
|
62
65
|
cursor: pointer;
|
|
63
66
|
opacity: 0;
|
|
64
67
|
position: absolute;
|
|
65
68
|
transform: translate(-50%, -50%);
|
|
66
69
|
box-shadow: inset 0 0 1px rgba(0,0,0,0.15);
|
|
67
|
-
`,
|
|
68
|
-
font-family: ${
|
|
69
|
-
font-size: ${
|
|
70
|
-
font-weight: ${
|
|
71
|
-
color: ${
|
|
70
|
+
`,R.style.top=`${ft}px`,R.style.left="50%";let Mt=Q(R);Mt.element=R,T.appendChild(R);let xn=($==null?void 0:$.text)||((Me=y.ui)==null?void 0:Me.cta_label_end)||"DOWNLOAD",At=($==null?void 0:$.font)||"brand.heading",En=($==null?void 0:$.fontSize)||20,_n=P.button_text_color||((Ae=y.theme)==null?void 0:Ae.cta_text)||"#1a0a0a";R.textContent=xn,R.style.fontFamily=Y(At),R.style.fontSize=`${En}px`,R.style.fontWeight=String(N(At)),R.style.color=_n,R.style.letterSpacing=`${($e=$==null?void 0:$.letterSpacing)!=null?$e:1}px`;let $t=Q(R);$t.element=R;let L=l==null?void 0:l.ui,Lt=((Le=l==null?void 0:l.gameplay)==null?void 0:Le.tuning)||{},wn=(L==null?void 0:L.text)||"Play the full game",Wt=(L==null?void 0:L.font)||"brand.body",Sn=(L==null?void 0:L.fontSize)||11,Hn=(We=L==null?void 0:L.letterSpacing)!=null?We:0,rt=(De=l==null?void 0:l.render)==null?void 0:De.tint,vn=typeof rt=="string"?rt:rt?`#${rt.toString(16).padStart(6,"0")}`:"#CCCCCC",K=document.createElement("div");K.textContent=wn,K.style.cssText=`
|
|
71
|
+
font-family: ${Y(Wt)};
|
|
72
|
+
font-size: ${Sn}px;
|
|
73
|
+
font-weight: ${N(Wt)};
|
|
74
|
+
color: ${vn};
|
|
72
75
|
text-align: center;
|
|
73
|
-
letter-spacing: ${
|
|
76
|
+
letter-spacing: ${Hn}px;
|
|
74
77
|
opacity: 0;
|
|
75
78
|
position: absolute;
|
|
76
79
|
transform: translate(-50%, -50%);
|
|
77
80
|
white-space: nowrap;
|
|
78
|
-
`;let
|
|
79
|
-
font-family: ${
|
|
80
|
-
font-size: ${
|
|
81
|
-
font-weight: ${
|
|
82
|
-
color: ${
|
|
83
|
-
text-align: ${
|
|
84
|
-
letter-spacing: ${
|
|
85
|
-
text-shadow: ${(
|
|
81
|
+
`;let Cn=ft+35+((ze=Lt.animation_start_y_offset)!=null?ze:5);K.style.top=`${Cn}px`,K.style.left="50%";let gt=Q(K);gt.element=K,gt.animationStartYOffset=(ke=Lt.animation_start_y_offset)!=null?ke:5,T.appendChild(K);let Tt=((Be=c==null?void 0:c.gameplay)==null?void 0:Be.tuning)||{},Rn=(Pe=Tt.hand_offset_x)!=null?Pe:50,Fn=(Ye=Tt.hand_offset_y)!=null?Ye:50,Mn=(Ge=(Ne=c==null?void 0:c.transform)==null?void 0:Ne.scale)!=null?Ge:.1875,An=(Xe=Tt.hand_scale_multiplier)!=null?Xe:2.5,$n=new U.SpriteMaterial({map:t||void 0,transparent:!0,alphaTest:.1}),et=new U.Sprite($n),Dt=Mn*An*100;return et.scale.set(Dt,Dt,1),et.position.set(Rn,ft+Fn,0),et.material.opacity=0,et.visible=!1,{panel:z,logo:H,title:Ht,subtitle:ht,footer:yt,ctaButton:Mt,ctaText:$t,ctaHint:gt,hand:et}}function Pn(e,t,n){var w,S,T,z,C,D,F,W;let s=t.objects.get("ui_endgame_1"),a=((w=s==null?void 0:s.gameplay)==null?void 0:w.tuning)||{},i=(S=a.animation_duration_ms)!=null?S:800,o=(T=a.fade_in_duration_ms)!=null?T:600,m=(z=a.scale_animation_intensity)!=null?z:.1,r=(C=a.logo_animation_delay_ms)!=null?C:100,u=(D=a.title_animation_delay_ms)!=null?D:200,l=(F=a.footer_animation_delay_ms)!=null?F:300,c=(W=a.cta_animation_delay_ms)!=null?W:400,{panel:y,logo:d,title:b,subtitle:p,footer:f,ctaButton:h,ctaText:g,ctaHint:E}=e;y.visible=!0,y.element.style.visibility="visible";let x=Date.now(),_=()=>{let j=Date.now()-x,X=Math.min(j/o,1),G=1-Math.pow(1-X,3);y.alpha=G,y.element.style.opacity=G.toString();let H=1+m*(1-G);y.element.style.transform=`translate(-50%, -50%) scale(${H})`,X<1?requestAnimationFrame(_):(setTimeout(()=>Yn(d,i,t),r),setTimeout(()=>{Nn(b,i),setTimeout(()=>Gn(p,i),50)},u),setTimeout(()=>Xn(f,i),l),setTimeout(()=>{qn(h,g,i),setTimeout(()=>Vn(E,i),50),n&&n()},c))};_()}function Yn(e,t,n){var y,d,b,p,f;let s=n==null?void 0:n.objects.get("ui_endgame_logo_1"),i=(d=(((y=s==null?void 0:s.gameplay)==null?void 0:y.tuning)||{}).animation_start_scale)!=null?d:1.2,o=Date.now(),m=e.material.opacity,r=(b=e.targetAlpha)!=null?b:1,u=(p=e.baseScaleX)!=null?p:e.scale.x,l=(f=e.baseScaleY)!=null?f:e.scale.y,c=()=>{let h=Date.now()-o,g=Math.min(h/t,1),E=1-Math.pow(1-g,2);e.material.opacity=m+(r-m)*E;let x=i+(1-i)*E;e.scale.set(u*x,l*x,1),g<1&&requestAnimationFrame(c)};c()}function Nn(e,t){let n=Date.now(),s=parseFloat(e.element.style.opacity||"0"),a=parseFloat(e.element.style.top||"0"),i=()=>{let o=Date.now()-n,m=Math.min(o/t,1),r=1-Math.pow(1-m,2);e.element.style.opacity=(s+(1-s)*r).toString(),e.element.style.top=`${a-20*(1-r)}px`,m<1&&requestAnimationFrame(i)};i()}function Gn(e,t){var m;let n=Date.now(),s=parseFloat(e.element.style.opacity||"0"),a=parseFloat(e.element.style.top||"0"),i=a-((m=e.animationStartYOffset)!=null?m:-10),o=()=>{let r=Date.now()-n,u=Math.min(r/t,1),l=1-Math.pow(1-u,2);e.element.style.opacity=(s+(1-s)*l).toString(),e.element.style.top=`${a+(i-a)*l}px`,u<1&&requestAnimationFrame(o)};o()}function Xn(e,t){var o;let n=Date.now(),s=parseFloat(e.element.style.opacity||"0"),a=(o=e.targetAlpha)!=null?o:1,i=()=>{let m=Date.now()-n,r=Math.min(m/t,1),u=1-Math.pow(1-r,2);e.element.style.opacity=(s+(a-s)*u).toString(),r<1&&requestAnimationFrame(i)};i()}function qn(e,t,n){let s=Date.now(),a=parseFloat(e.element.style.opacity||"0"),i=()=>{let o=Date.now()-s,m=Math.min(o/n,1),r=1-Math.pow(1-m,2);e.element.style.opacity=(a+(1-a)*r).toString(),t.element.style.opacity=(a+(1-a)*r).toString(),e.element.style.transform=`translate(-50%, -50%) scale(${1+.1*(1-r)})`,m<1&&requestAnimationFrame(i)};i()}function Vn(e,t){var m;let n=Date.now(),s=parseFloat(e.element.style.opacity||"0"),a=parseFloat(e.element.style.top||"0"),i=a-((m=e.animationStartYOffset)!=null?m:5),o=()=>{let r=Date.now()-n,u=Math.min(r/t,1),l=1-Math.pow(1-u,2);e.element.style.opacity=(s+(1-s)*l).toString(),e.element.style.top=`${a+(i-a)*l}px`,u<1&&requestAnimationFrame(o)};o()}function Zn(e,t,n,s){var l,c,y,d;let a=n.objects.get("ui_endgame_hand_1"),i=((l=a==null?void 0:a.gameplay)==null?void 0:l.tuning)||{},o=(c=i.click_animation_duration_ms)!=null?c:600,m=(y=i.click_delay_ms)!=null?y:2e3,r=(d=i.click_repeat_delay_ms)!=null?d:3e3,u=()=>{var S,T;e.visible=!0,e.material.opacity=1;let b=e.position.x,p=e.position.y,f=(S=i.hand_offset_x)!=null?S:50,h=(T=i.hand_offset_y)!=null?T:50,g=t.element.getBoundingClientRect(),E=f,x=h,_=Date.now(),w=()=>{var G,H,q;let z=Date.now()-_,C=Math.min(z/o,1),D=C<.5?2*C*C:1-Math.pow(-2*C+2,2)/2;e.position.set(b+(E-b)*D,p+(x-p)*D,0);let F=(H=(G=a==null?void 0:a.transform)==null?void 0:G.scale)!=null?H:.1875,W=(q=i.hand_scale_multiplier)!=null?q:2.5,j=F*W*100,X=j+j*.2*Math.sin(C*Math.PI);e.scale.set(X,X,1),C<1?requestAnimationFrame(w):(t.element.style.transform="translate(-50%, -50%) scale(0.95)",setTimeout(()=>{t.element.style.transform="translate(-50%, -50%) scale(1)",s()},100),setTimeout(()=>{e.material.opacity=0,setTimeout(()=>{e.position.set(b,p,0),u()},r)},500))};w()};setTimeout(u,m)}import*as ut from"three";function Jn(e,t,n){var c,y,d,b;let s=t.objects.get("hand_tutorial_1"),a=((c=s==null?void 0:s.gameplay)==null?void 0:c.tuning)||{},i=(s==null?void 0:s.render)||{},o=(s==null?void 0:s.transform)||{},m=new ut.SpriteMaterial({map:e||void 0,transparent:!0,alphaTest:.1}),r=new ut.Sprite(m);r.position.set(n.x,n.y,0),r.material.opacity=0;let u=(y=a.hand_scale_multiplier)!=null?y:2.5,l=(d=o.scale)!=null?d:.1875;return r.scale.set(l*u*100,l*u*100,1),r.renderOrder=(b=i.z_index)!=null?b:99999,r}function Kn(e){var b,p,f,h,g,E,x,_,w;let t=e.objects.get("ui_tutorial_1"),n=t==null?void 0:t.ui,s=(t==null?void 0:t.render)||{},a=((b=e.engine.runtime)==null?void 0:b.ui_styles)||{},i=((p=e.engine.runtime)==null?void 0:p.ui)||{},o=(n==null?void 0:n.text)||i.tutorial_label||i.label_text||"CLEAN!",m=(n==null?void 0:n.font)||"brand.warning",r=(n==null?void 0:n.fontSize)||a.label_font_size||52,u=(h=n==null?void 0:n.letterSpacing)!=null?h:(f=a.label_letter_spacing)!=null?f:-1,l=(n==null?void 0:n.align)||"center",c=s.tint,y=typeof c=="string"?c:c?`#${c.toString(16).padStart(6,"0")}`:a.label_fill||"#FFF1C1",d=document.createElement("div");return d.textContent=o,d.style.cssText=`
|
|
82
|
+
font-family: ${Y(m)};
|
|
83
|
+
font-size: ${r}px;
|
|
84
|
+
font-weight: ${N(m)};
|
|
85
|
+
color: ${y};
|
|
86
|
+
text-align: ${l};
|
|
87
|
+
letter-spacing: ${u}px;
|
|
88
|
+
text-shadow: ${(g=a.label_shadow_distance)!=null?g:2}px ${(E=a.label_shadow_distance)!=null?E:2}px ${(x=a.label_shadow_blur)!=null?x:4}px rgba(0,0,0,${(_=a.label_shadow_alpha)!=null?_:.8});
|
|
86
89
|
-webkit-text-stroke: ${a.label_stroke||"#8B0000"} 2px;
|
|
87
|
-
opacity: ${(
|
|
88
|
-
visibility: ${
|
|
90
|
+
opacity: ${(w=s.alpha)!=null?w:0};
|
|
91
|
+
visibility: ${s.visible!==!1?"visible":"hidden"};
|
|
89
92
|
pointer-events: none;
|
|
90
93
|
position: absolute;
|
|
91
94
|
transform: translate(-50%, -50%);
|
|
92
95
|
white-space: nowrap;
|
|
93
|
-
`,
|
|
96
|
+
`,d}function Qn(e,t,n,s,a){var r,u,l,c,y,d,b;let i=a.objects.get("hand_tutorial_1"),o=((r=i==null?void 0:i.gameplay)==null?void 0:r.tuning)||{},m=(i==null?void 0:i.transform)||{};if(!s){let p=(u=o.animation_duration)!=null?u:1.5,f=n%p/p,h=f<.5?2*f*f:-1+(4-2*f)*f,g=(l=o.x_offset)!=null?l:0,E=(c=o.y_offset)!=null?c:0,x=(y=o.animation_range)!=null?y:40,_=x*.7,w=x,S=t.x+g+_,T=t.y+E+w,z=S+_,C=T+w;e.position.set(S+(z-S)*h,T+(C-T)*h,0);let D=(d=m.scale)!=null?d:.1875,F=(b=o.hand_scale_multiplier)!=null?b:2.5,W=D*F*100;e.scale.set(W,W,1)}}import*as tt from"three";var Ve=new tt.TextureLoader;async function Ze(e,t,n=16777215,s=!1){try{let i=(globalThis.INLINE_ASSETS||{})[e];return await Ve.loadAsync(i||e)}catch{console.warn(`Asset missing: ${e}. Using placeholder.`);let i=document.createElement("canvas");i.width=64,i.height=64;let o=i.getContext("2d");return o&&(o.fillStyle=`#${n.toString(16).padStart(6,"0")}`,s?o.fillRect(0,0,30,60):(o.beginPath(),o.arc(32,32,30,0,Math.PI*2),o.fill(),o.fillRect(27,32,10,40))),new tt.CanvasTexture(i)}}async function jn(e,t,n){var b,p,f,h;let a=(globalThis.INLINE_ASSETS||{})[e]||e,i;try{i=await Ve.loadAsync(a),console.log("[character] loaded sheet",{path:e,sourceUsed:a})}catch(g){let _=((n.gameplay.character_sheet||{}).fallback_color||"#ff00ff").replace("#","");i=await Ze(e,t,parseInt(_,16),!0),console.warn("[character] fallback loadAsset used",{path:e,err:g})}if(!i)return[];let o=n.gameplay.character_sheet||{},m=(b=o.cols)!=null?b:3,r=(p=o.rows)!=null?p:2,u=((f=i.image)==null?void 0:f.width)||0,l=((h=i.image)==null?void 0:h.height)||0,c=u/m,y=l/r;if(!Number.isFinite(c)||!Number.isFinite(y)||c<=0||y<=0)return[i];let d=[];for(let g=0;g<r;g++)for(let E=0;E<m;E++){let x=document.createElement("canvas");x.width=c,x.height=y;let _=x.getContext("2d");_&&i.image&&_.drawImage(i.image,E*c,g*y,c,y,0,0,c,y),d.push(new tt.CanvasTexture(x))}return d.length>2&&d.push(...d.slice(1,-1).reverse()),console.log("[character] frames prepared",{count:d.length}),d}function In(e,t){var c,y,d,b;let n=t.gameplay.brush||{},s=t.theme.brush_color||"#ffffff",a=(c=n.radius)!=null?c:20,i=(y=n.inner_radius)!=null?y:15,o=(d=n.alpha)!=null?d:.8,m=(b=n.inner_alpha)!=null?b:.3,r=n.inner_color||"#ffffff",u=document.createElement("canvas");u.width=a*2,u.height=a*2;let l=u.getContext("2d");return l&&(l.clearRect(0,0,u.width,u.height),l.beginPath(),l.arc(a,a,a,0,Math.PI*2),l.fillStyle=s,l.globalAlpha=o,l.fill(),l.beginPath(),l.arc(a,a,i,0,Math.PI*2),l.fillStyle=r,l.globalAlpha=m,l.fill()),new tt.CanvasTexture(u)}export{qe as AspectClass,mt as GameObject,_t as GameObjectManager,pt as Renderer,nt as ResponsiveUISystem,ct as Transform,Zn as animateHandClick,Pn as animatePanelEntrance,In as createBrushTexture,Bn as createEndGamePanel,Jn as createHandTutorial,Dn as createThreeBase,Kn as createTutorialLabel,Et as getAspectClass,kn as getRegisteredFontIds,Ze as loadAsset,jn as loadCharacterFrames,zn as registerFont,Y as resolveFont,N as resolveFontWeight,Qn as updateHandAnimation};
|
package/package.json
CHANGED