handler-playable-sdk 0.2.7 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";var nt=Object.defineProperty;var ai=Object.getOwnPropertyDescriptor;var ii=Object.getOwnPropertyNames;var si=Object.prototype.hasOwnProperty;var oi=(t,e)=>{for(var n in e)nt(t,n,{get:e[n],enumerable:!0})},ri=(t,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of ii(e))!si.call(t,s)&&s!==n&&nt(t,s,{get:()=>e[s],enumerable:!(a=ai(e,s))||a.enumerable});return t};var li=t=>ri(nt({},"__esModule",{value:!0}),t);var Pi={};oi(Pi,{AssetCache:()=>X,AssetLoader:()=>we,GameObject:()=>De,GameObjectManager:()=>Xe,ObjectFactory:()=>Qe,Renderer:()=>Me,Transform:()=>Le,animateHandClick:()=>fa,animatePanelEntrance:()=>pa,createEndGamePanel:()=>ua,createHandTutorial:()=>ha,createPixiBase:()=>la,createTutorialLabel:()=>ma,getRegisteredFontIds:()=>da,playLottieOverlay:()=>_a,registerFont:()=>ca,registerType:()=>je,resolveFont:()=>V,resolveFontWeight:()=>q,setLottieInstance:()=>ga,updateHandAnimation:()=>ya});module.exports=li(Pi);var ra=require("pixi.js");var ne={};function ze(t,e,n=!1){ne[t]||(ne[t]=[]),ne[t].push({fn:e,once:n})}function at(t,e){if(ne[t]){if(!e){delete ne[t];return}ne[t]=ne[t].filter(n=>n.fn!==e)}}function He(t,...e){let n=ne[t];if(n)for(let a of[...n])a.fn(...e),a.once&&at(t,a.fn)}function z(t,e){ze(t,e,!0)}var We={name:"handler-playable-sdk",version:"0.2.7",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.mjs",require:"./dist/index.js"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.mjs",require:"./dist/pixi/index.js"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.mjs",require:"./dist/three/index.js"}},scripts:{build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts --format cjs,esm --dts --clean --minify --external lottie-web && npm run obfuscate","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts --format cjs,esm --dts --clean --external lottie-web",obfuscate:"javascript-obfuscator dist/index.js dist/index.mjs dist/pixi/index.js dist/pixi/index.mjs dist/three/index.js dist/three/index.mjs --output dist --options-preset high-obfuscation --compact true --self-defending true",lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.js patch","publish:update:minor":"node scripts/publish-and-update.js minor","publish:update:major":"node scripts/publish-and-update.js major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.160.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.160.0",eslint:"^8.57.1","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.160.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2"}};var H=0,di=H++,kn=H++,Fn=H++,In=H++,Rn=H++,Nn=H++,Bn=H++,$n=H++,zn=H++,Hn=H++,Wn=H++,Yn=H++,_=di;function Gn(){return _===kn}function Jn(){return _===Fn}function Vn(){return _===In}function qn(){return _===Rn}function ue(){return _===Nn}function pe(){return _===Bn}function Xn(){return _===$n}function Un(){return _===zn}function Kn(){return _===Hn}function it(){return _===Wn}function st(){return _===Yn}function jn(){let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(t==="mraid")try{mraid.getState(),_=kn;return}catch{}else if(t==="dapi")try{dapi.isReady(),_=Fn;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(_=In)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(_=Rn)}catch{}else if(e==="mintegral")window.gameReady&&(_=Nn);else if(e==="tapjoy")window.TJ_API&&(_=Bn);else if(e==="tiktok")window.openAppStore&&(_=$n);else if(e==="smadex")try{window.smxTracking&&(_=zn)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(_=Hn)}catch{}else e==="vungle"?_=Wn:(t==="nucleo"||e==="nucleo")&&(_=Yn)}var aa={mechanic_id:"TODO_mechanic_id",variant_id:"TODO_variant_id",deployment_id:"TODO_deployment_id",export_id:"TODO_export_id",profile_id:"TODO_profile_id",instance_id:"default"},ui=Math.random().toString(36).slice(2),fe=null,Se={...aa},ia="web_embed",pi={},ot=!1,xe=!1,Ae=!1,sa=!1,dt=1,lt=0,Ve=!1,Q=!1,Je="",he=Math.floor(window.innerWidth),me=Math.floor(window.innerHeight),ct=he>me,Z=!1,Te=!1,Qn=!1,Zn=!1,rt=!1,Ye=null;function ea(){if(fe)return fe;let t=document.createElement("div");return t.id="handler-root",t.setAttribute("data-handler-root","true"),document.body.appendChild(t),fe=t,t}function Ge(t){switch(t){case"interaction":return"engagement";case"finish":return"complete";case"install":return"cta_click";default:return t}}function oa(t,e){return{event_name:t,ts:Date.now(),session_id:ui,deployment_id:Se.deployment_id,variant_id:Se.variant_id,export_profile_id:Se.profile_id,instance_id:Se.instance_id||"default",env:ia==="mraid"?"mraid":"web",payload:e}}function y(t,e){let n=Ge(t),a=oa(n,e);He(n,a),n!==t&&He(t,a)}function ve(){Ye&&(Ye(he,me),Ye=null)}function ye(t){dt=t,y("volume",t)}function ge(t){t&&(sa=!0),!Ae&&(Ae=!0,y("pause"),ye(0))}function Ee(t){!t&&sa||Ae&&(Ae=!1,y("resume"),ye(dt))}function ie(t,e){he=Math.floor(t||window.innerWidth),me=Math.floor(e||window.innerHeight),ct=he>me,y("resize",{width:he,height:me})}function fi(){if(Gn())try{let t=mraid.getMaxSize();ie(t.width,t.height);let e=()=>{mraid.isViewable()&&mraid.getState()!=="hidden"?Ee():ge()};if(mraid.addEventListener("viewableChange",e),mraid.addEventListener("stateChange",e),mraid.addEventListener("sizeChange",()=>{let n=mraid.getMaxSize();ie(n.width,n.height)}),mraid.getAudioVolume){let n=mraid.getAudioVolume();ye(n?1:0)}if(mraid.addEventListener("audioVolumeChange",n=>{n!==null&&ye(n>0?1:0)}),mraid.addEventListener("error",(n,a)=>{console.warn("mraid error:",n,"action:",a)}),Ve=!0,mraid.isViewable()&&mraid.getState()!=="hidden")Z=!0,y("boot"),y("view"),y("ready"),Q=!0,ve();else{let n=()=>{Z=!0,y("boot"),y("view"),y("ready"),Q=!0,ve()};mraid.addEventListener("ready",n)}}catch(t){console.warn("MRAID hook skipped",t)}}function hi(){if(Jn())try{let t=dapi.getScreenSize();ie(t.width,t.height),dapi.addEventListener("viewableChange",n=>{n.isViewable?Ee():ge()}),dapi.addEventListener("adResized",n=>{let a=dapi.getScreenSize();ie(n.width||a.width,n.height||a.height)});let e=dapi.getAudioVolume();if(ye(e?1:0),dapi.addEventListener("audioVolumeChange",n=>ye(n?1:0)),Ve=!0,dapi.isViewable())Z=!0,y("boot"),y("view"),y("ready"),Q=!0,ve();else{let n=()=>{Z=!0,y("boot"),y("view"),y("ready"),Q=!0,ve()};dapi.addEventListener("ready",n)}}catch(t){console.warn("DAPI hook skipped",t)}}function ta(){let t=()=>{Z||document.visibilityState==="visible"&&(document.readyState==="complete"||document.readyState==="interactive")&&(Z=!0,y("boot"),y("view"),y("ready"),Q=!0,ve(),Te&&(Te=!1,ae.start()))};window.addEventListener("resize",()=>ie()),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"?(Ee(),t()):ge()}),document.readyState==="complete"||document.readyState==="interactive"?t():window.addEventListener("load",t),Ve=!0}function mi(){let t=e=>{typeof TouchEvent!="undefined"&&e instanceof TouchEvent&&(Qn=!0),!(Qn&&e instanceof MouseEvent)&&(lt+=1,y("interaction",lt))};document.addEventListener("mousedown",t),document.addEventListener("touchstart",t)}function yi(t){var a,s,i,o,r,c,l,p,f,u,d,m;let e=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none";if((typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed")==="google")try{(a=window.ExitApi)==null||a.exit();return}catch{}if(e==="mraid"&&typeof mraid!="undefined")mraid.open(t||"");else if(e==="dapi"&&typeof dapi!="undefined")dapi.openStoreUrl();else if(pe())(i=(s=window.TJ_API)==null?void 0:s.click)==null||i.call(s);else if(Vn())(r=(o=window.FbPlayableAd)==null?void 0:o.onCTAClick)==null||r.call(o);else if(Kn())(l=(c=window.ScPlayableAd)==null?void 0:c.onCTAClick)==null||l.call(c);else if(Un())try{(f=(p=window.smxTracking)==null?void 0:p.redirect)==null||f.call(p)}catch(h){console.warn("Smadex redirect failed",h)}else if(qn()){let h=window.ExitApi;h&&typeof h.exit=="function"?h.exit(t||Je||""):t&&window.open(t)}else ue()?(u=window.install)==null||u.call(window):Xn()?(d=window.openAppStore)==null||d.call(window):it()?(m=parent==null?void 0:parent.postMessage)==null||m.call(parent,"download","*"):t&&window.open(t)}function gi(){let t=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed",e=n=>{if(!n)return;let a=new Image;a.src=n};if(t==="bigabid"){let n=window.BIGABID_BIDTIMEMACROS;if(!n)return;z("view",()=>e(n.mraid_viewable)),z("start",()=>e(n.game_viewable)),z("engagement",()=>e(n.engagement));let a=()=>e(n.complete);z("complete",a),ze("engagement",s=>{var i;((i=s==null?void 0:s.payload)==null?void 0:i.count)>3&&a()}),z("cta_click",()=>e(n.click))}else if(t==="inmobi"){let n=window.INMOBI_DSPMACROS;if(!n)return;z("view",()=>e(n.Ad_Load_Start)),z("start",()=>e(n.Ad_Viewable)),z("engagement",()=>e(n.First_Engagement)),z("complete",()=>e(n.Gameplay_Complete)),z("cta_click",()=>e(n.DSP_Click)),z("start",()=>{[5,10,15,20,25,30].forEach(a=>setTimeout(()=>e(n[`Spent_${a}_Seconds`]),a*1e3))})}}function _i(){if(!pe())return;let t=window.TJ_API;t&&t.setPlayableAPI&&t.setPlayableAPI({skipAd:()=>{try{ae.finish()}catch(e){console.warn("Tapjoy skip failed",e)}}})}function na(){var e,n,a;let t=window.TJ_API;(e=t==null?void 0:t.objectiveComplete)==null||e.call(t),(n=t==null?void 0:t.playableFinished)==null||n.call(t),(a=t==null?void 0:t.gameplayFinished)==null||a.call(t)}function wi(){ue()&&(window.mintGameStart=()=>{Ee(!0),ie()},window.mintGameClose=()=>{ge(!0)})}function bi(){if(!st())return;let t=window.NUC;!t||!t.trigger||(ae.on("cta_click",()=>{var e,n;return(n=(e=t.trigger).convert)==null?void 0:n.call(e,Je)}),ae.on("complete",()=>{var e,n;return(n=(e=t.trigger).tryAgain)==null?void 0:n.call(e)}))}var ae={init(t={},e){if(ia=t.profile||"web_embed",pi=t.consent||{},Se={...aa,...t.ids||{}},fe=t.rootEl||fe,Je=t.destinationUrl||(/android/i.test(navigator.userAgent)?"https://play.google.com/store":"https://www.apple.com/app-store/"),e&&(Ye=e),y("init"),document.body.oncontextmenu=()=>!1,ea(),xi(fe),jn(),fi(),hi(),!Ve){if(document.readyState==="complete")ta();else if(!Zn){Zn=!0;let n=()=>{ta(),window.removeEventListener("load",n),document.removeEventListener("DOMContentLoaded",n)};window.addEventListener("load",n),document.addEventListener("DOMContentLoaded",n)}}mi(),gi(),_i(),wi(),bi(),console.log(`%c @handler/playable-sdk %c v${We.version||"0.0.0"} `,"background: #007acc; color: #fff; font-size: 14px; padding: 4px 8px; border-top-left-radius: 4px; border-bottom-left-radius: 4px;","background: #e1e4e8; color: #333; font-size: 14px; padding: 4px 8px; border-top-right-radius: 4px; border-bottom-right-radius: 4px;"),Z&&!Q&&(y("boot"),y("view"),y("ready"),Te&&(Te=!1,ae.start()),Q=!0),Q=Z},getRoot(){return ea()},get version(){return We.version||"0.0.0"},get maxWidth(){return he},get maxHeight(){return me},get isLandscape(){return ct},get isReady(){return Q},get isStarted(){return ot},get isPaused(){return Ae},get isFinished(){return xe},get volume(){return dt},get interactions(){return lt},on(t,e){ze(Ge(t),e)},off(t,e){at(Ge(t),e)},start(){var t,e;if(!ot){if(!Z){Te=!0;return}if(ot=!0,y("start"),ie(),ue())ge(),(t=window.gameReady)==null||t.call(window);else if(pe()){let n=window.TJ_API;(e=n==null?void 0:n.setPlayableBuild)==null||e.call(n,{orientation:ct?"landscape":"portrait",buildID:We.version||"dev"})}}},finish(){var t,e;xe||(xe=!0,y("complete"),ue()?(t=window.gameEnd)==null||t.call(window):it()?(e=parent==null?void 0:parent.postMessage)==null||e.call(parent,"complete","*"):pe()&&na())},install(t){if(!xe){xe=!0,pe()?(na(),setTimeout(()=>ae.install(t),300)):(y("complete"),setTimeout(()=>ae.install(t),0));return}rt||(rt=!0,setTimeout(()=>rt=!1,500),y("cta_click"),y("conversion"),yi(t||Je))},emit(t,e){let n=Ge(t);if(!["view","boot","start","engagement","complete","cta_click","conversion","retry","pause","resume","resize","volume","error"].includes(n)&&!n.startsWith("custom."))throw new Error(`Event ${t} must be canonical or namespaced as custom.<mechanic_id>.<event>`);let a=oa(n,e);He(n,a)},retry(){var t,e,n;if(ue())(t=window.gameRetry)==null||t.call(window);else if(st()){let a=window.NUC;(n=(e=a==null?void 0:a.trigger)==null?void 0:e.tryAgain)==null||n.call(e)}y("engagement",{action:"retry"})},pause(){ge(!0)},resume(){Ee(!0)},resize(t,e){ie(t,e)}},qe=ae;function xi(t){let e=document.createElement("script");e.type="text/javascript",e.textContent=`
1
+ "use strict";var gs=Object.create;var Ut=Object.defineProperty;var hs=Object.getOwnPropertyDescriptor;var fs=Object.getOwnPropertyNames;var bs=Object.getPrototypeOf,ms=Object.prototype.hasOwnProperty;var ut=(t,e)=>()=>(t&&(e=t(t=0)),e);var ys=(t,e)=>{for(var n in e)Ut(t,n,{get:e[n],enumerable:!0})},ea=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of fs(e))!ms.call(t,a)&&a!==n&&Ut(t,a,{get:()=>e[a],enumerable:!(i=hs(e,a))||i.enumerable});return t};var Ln=(t,e,n)=>(n=t!=null?gs(bs(t)):{},ea(e||!t||!t.__esModule?Ut(n,"default",{value:t,enumerable:!0}):n,t)),vs=t=>ea(Ut({},"__esModule",{value:!0}),t);var Xt=ut(()=>{"use strict"});var wa,De,ko,kn=ut(()=>{"use strict";Xt();wa=null,De="dev";if(typeof window!="undefined"){let t=window.__BUILD_SETTINGS__;if(t!=null&&t.buildMode)wa=t,De=t.buildMode,console.log("[CONFIG] Loaded inline build settings:",t,"buildMode:",De);else try{let e=new XMLHttpRequest;if(e.open("GET","./build-settings.json",!1),e.send(),e.status===200&&e.responseText){let n=JSON.parse(e.responseText);wa=n,De=n.buildMode||"dev",console.log("[CONFIG] Loaded build settings:",n,"buildMode:",De)}else console.log("[CONFIG] No build-settings.json found, using default buildMode:",De)}catch(e){console.log("[CONFIG] Failed to load build-settings.json:",e instanceof Error?e.message:String(e))}}console.log("[CONFIG] Final buildMode:",De);ko=De==="dev"||typeof window!="undefined"&&window.location.search.includes("hot-reload")});var In=ut(()=>{"use strict"});var Ea=ut(()=>{"use strict";In();kn()});var On=ut(()=>{"use strict";kn();In();Ea()});var So={};ys(So,{AssetCache:()=>ge,AssetLoader:()=>Ze,AssetSystem:()=>cn,Assets:()=>_e,BaseSystem:()=>et,GameEngine:()=>rn,GameObject:()=>wt,GameObjectManager:()=>Je,ObjectFactory:()=>Fe,Renderer:()=>xt,RuntimeObjectRegistry:()=>tt,SplashScreen:()=>Qe,Transform:()=>vt,animateHandClick:()=>Fa,animatePanelEntrance:()=>za,applyScreenAnchor:()=>pn,basePixi:()=>Xa,clearResponsiveElements:()=>Ja,createEndGamePanel:()=>Da,createHandTutorial:()=>Na,createPixiBase:()=>nn,createTutorialLabel:()=>$a,getRegisteredFontIds:()=>Ba,globalResponsiveMultipliers:()=>Lt,initAssets:()=>ln,layout:()=>Za,playLottieOverlay:()=>qa,registerFont:()=>Ha,registerType:()=>on,resolveAnchorVec2:()=>fn,resolveFont:()=>oe,resolveFontWeight:()=>re,resolveScreenAnchorPoint:()=>bn,resolveScreenRatioPoint:()=>mn,runInitSequence:()=>es,setLottieInstance:()=>Jt,updateHandAnimation:()=>Ga,updateScreenState:()=>un});module.exports=vs(So);var ja=require("pixi.js");var Le={};function Yt(t,e,n=!1){Le[t]||(Le[t]=[]),Le[t].push({fn:e,once:n})}function An(t,e){if(Le[t]){if(!e){delete Le[t];return}Le[t]=Le[t].filter(n=>n.fn!==e)}}function Wt(t,...e){let n=Le[t];if(n)for(let i of[...n])i.fn(...e),i.once&&An(t,i.fn)}function ae(t,e){Yt(t,e,!0)}var se=0,xs=se++,ta=se++,na=se++,ia=se++,aa=se++,sa=se++,oa=se++,ra=se++,la=se++,ca=se++,da=se++,ua=se++,P=xs;function pa(){return P===ta}function ga(){return P===na}function ha(){return P===ia}function fa(){return P===aa}function qe(){return P===sa}function Ue(){return P===oa}function ba(){return P===ra}function ma(){return P===la}function ya(){return P===ca}function Tn(){return P===da}function Mn(){return P===ua}function va(){let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(t==="mraid")try{mraid.getState(),P=ta;return}catch{}else if(t==="dapi")try{dapi.isReady(),P=na;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(P=ia)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(P=aa)}catch{}else if(e==="mintegral")window.gameReady&&(P=sa);else if(e==="tapjoy")window.TJ_API&&(P=oa);else if(e==="tiktok")window.openAppStore&&(P=ra);else if(e==="smadex")try{window.smxTracking&&(P=la)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(P=ca)}catch{}else e==="vungle"?P=da:(t==="nucleo"||e==="nucleo")&&(P=ua)}var Vt=Ln(require("lottie-web")),xa=Vt.default;typeof window!="undefined"&&(window.lottie=Vt.default,window.__baseLottie=Vt.default);On();function z(t,e){let n=(a,s)=>s===0?a:n(s,a%s),i=n(t,e);return`${t/i}:${e/i}`}var Ko=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:z(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:z(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:z(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:z(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:z(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:z(360,780)}],Jo=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:z(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:z(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:z(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:z(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:z(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:z(412,915)}],Qo=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:z(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:z(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:z(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:z(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:z(800,1280)}],_a=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:z(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:z(768,1024),mraidScale:.7}];var Zo=[..._a];var As=_a[0];var Kt=require("pixi.js");Xt();var Ca=Ln(require("lottie-web"));Jt(xa);typeof window!="undefined"&&!window.lottie&&(window.lottie=Ca.default);On();Xt();var Pn="0.3.1",Ia={mechanic_id:"TODO_mechanic_id",variant_id:"TODO_variant_id",deployment_id:"TODO_deployment_id",export_id:"TODO_export_id",profile_id:"TODO_profile_id",instance_id:"default"},Rs=Math.random().toString(36).slice(2),Ye=null,ht={...Ia},Oa="web_embed",js={},Rn=!1,gt=!1,bt=!1,Pa=!1,Dn=1,Hn=0,tn=!1,xe=!1,en="",We=Math.floor(window.innerWidth),Ve=Math.floor(window.innerHeight),Bn=We>Ve,we=!1,ft=!1,La=!1,Aa=!1,jn=!1,Qt=null;function Ta(){if(Ye)return Ye;let t=document.createElement("div");return t.id="handler-root",t.setAttribute("data-handler-root","true"),document.body.appendChild(t),Ye=t,t}function Zt(t){switch(t){case"interaction":return"engagement";case"finish":return"complete";case"install":return"cta_click";default:return t}}function Ra(t,e){return{event_name:t,ts:Date.now(),session_id:Rs,deployment_id:ht.deployment_id,variant_id:ht.variant_id,export_profile_id:ht.profile_id,instance_id:ht.instance_id||"default",env:Oa==="mraid"?"mraid":"web",payload:e}}function S(t,e){let n=Zt(t),i=Ra(n,e);Wt(n,i),n!==t&&Wt(t,i)}function mt(){Qt&&(Qt(We,Ve),Qt=null)}function Xe(t){Dn=t,S("volume",t)}function Ke(t){t&&(Pa=!0),!bt&&(bt=!0,S("pause"),Xe(0))}function yt(t){!t&&Pa||bt&&(bt=!1,S("resume"),Xe(Dn))}function Te(t,e){We=Math.floor(t||window.innerWidth),Ve=Math.floor(e||window.innerHeight),Bn=We>Ve,S("resize",{width:We,height:Ve})}function Hs(){if(pa())try{let t=mraid.getMaxSize();Te(t.width,t.height);let e=()=>{mraid.isViewable()&&mraid.getState()!=="hidden"?yt():Ke()};if(mraid.addEventListener("viewableChange",e),mraid.addEventListener("stateChange",e),mraid.addEventListener("sizeChange",()=>{let n=mraid.getMaxSize();Te(n.width,n.height)}),mraid.getAudioVolume){let n=mraid.getAudioVolume();Xe(n?1:0)}if(mraid.addEventListener("audioVolumeChange",n=>{n!==null&&Xe(n>0?1:0)}),mraid.addEventListener("error",(n,i)=>{console.warn("mraid error:",n,"action:",i)}),tn=!0,mraid.isViewable()&&mraid.getState()!=="hidden")we=!0,S("boot"),S("view"),S("ready"),xe=!0,mt();else{let n=()=>{we=!0,S("boot"),S("view"),S("ready"),xe=!0,mt()};mraid.addEventListener("ready",n)}}catch(t){console.warn("MRAID hook skipped",t)}}function Bs(){if(ga())try{let t=dapi.getScreenSize();Te(t.width,t.height),dapi.addEventListener("viewableChange",n=>{n.isViewable?yt():Ke()}),dapi.addEventListener("adResized",n=>{let i=dapi.getScreenSize();Te(n.width||i.width,n.height||i.height)});let e=dapi.getAudioVolume();if(Xe(e?1:0),dapi.addEventListener("audioVolumeChange",n=>Xe(n?1:0)),tn=!0,dapi.isViewable())we=!0,S("boot"),S("view"),S("ready"),xe=!0,mt();else{let n=()=>{we=!0,S("boot"),S("view"),S("ready"),xe=!0,mt()};dapi.addEventListener("ready",n)}}catch(t){console.warn("DAPI hook skipped",t)}}function Ma(){let t=()=>{we||document.visibilityState==="visible"&&(document.readyState==="complete"||document.readyState==="interactive")&&(we=!0,S("boot"),S("view"),S("ready"),xe=!0,mt(),ft&&(ft=!1,Ae.start()))};window.addEventListener("resize",()=>Te()),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"?(yt(),t()):Ke()}),document.readyState==="complete"||document.readyState==="interactive"?t():window.addEventListener("load",t),tn=!0}function Ds(){let t=e=>{typeof TouchEvent!="undefined"&&e instanceof TouchEvent&&(La=!0),!(La&&e instanceof MouseEvent)&&(Hn+=1,S("interaction",Hn))};document.addEventListener("mousedown",t),document.addEventListener("touchstart",t)}function zs(t){var i,a,s,o,r,c,l,u,g,p,d,f;let e=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none";if((typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed")==="google")try{(i=window.ExitApi)==null||i.exit();return}catch{}if(e==="mraid"&&typeof mraid!="undefined")mraid.open(t||"");else if(e==="dapi"&&typeof dapi!="undefined")dapi.openStoreUrl();else if(Ue())(s=(a=window.TJ_API)==null?void 0:a.click)==null||s.call(a);else if(ha())(r=(o=window.FbPlayableAd)==null?void 0:o.onCTAClick)==null||r.call(o);else if(ya())(l=(c=window.ScPlayableAd)==null?void 0:c.onCTAClick)==null||l.call(c);else if(ma())try{(g=(u=window.smxTracking)==null?void 0:u.redirect)==null||g.call(u)}catch(h){console.warn("Smadex redirect failed",h)}else if(fa()){let h=window.ExitApi;h&&typeof h.exit=="function"?h.exit(t||en||""):t&&window.open(t)}else qe()?(p=window.install)==null||p.call(window):ba()?(d=window.openAppStore)==null||d.call(window):Tn()?(f=parent==null?void 0:parent.postMessage)==null||f.call(parent,"download","*"):t&&window.open(t)}function Fs(){let t=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed",e=n=>{if(!n)return;let i=new Image;i.src=n};if(t==="bigabid"){let n=window.BIGABID_BIDTIMEMACROS;if(!n)return;ae("view",()=>e(n.mraid_viewable)),ae("start",()=>e(n.game_viewable)),ae("engagement",()=>e(n.engagement));let i=()=>e(n.complete);ae("complete",i),Yt("engagement",a=>{var s;((s=a==null?void 0:a.payload)==null?void 0:s.count)>3&&i()}),ae("cta_click",()=>e(n.click))}else if(t==="inmobi"){let n=window.INMOBI_DSPMACROS;if(!n)return;ae("view",()=>e(n.Ad_Load_Start)),ae("start",()=>e(n.Ad_Viewable)),ae("engagement",()=>e(n.First_Engagement)),ae("complete",()=>e(n.Gameplay_Complete)),ae("cta_click",()=>e(n.DSP_Click)),ae("start",()=>{[5,10,15,20,25,30].forEach(i=>setTimeout(()=>e(n[`Spent_${i}_Seconds`]),i*1e3))})}}function Ns(){if(!Ue())return;let t=window.TJ_API;t&&t.setPlayableAPI&&t.setPlayableAPI({skipAd:()=>{try{Ae.finish()}catch(e){console.warn("Tapjoy skip failed",e)}}})}function ka(){var e,n,i;let t=window.TJ_API;(e=t==null?void 0:t.objectiveComplete)==null||e.call(t),(n=t==null?void 0:t.playableFinished)==null||n.call(t),(i=t==null?void 0:t.gameplayFinished)==null||i.call(t)}function $s(){qe()&&(window.mintGameStart=()=>{yt(!0),Te()},window.mintGameClose=()=>{Ke(!0)})}function Gs(){if(!Mn())return;let t=window.NUC;!t||!t.trigger||(Ae.on("cta_click",()=>{var e,n;return(n=(e=t.trigger).convert)==null?void 0:n.call(e,en)}),Ae.on("complete",()=>{var e,n;return(n=(e=t.trigger).tryAgain)==null?void 0:n.call(e)}))}var Ae={init(t={},e){if(Oa=t.profile||"web_embed",js=t.consent||{},ht={...Ia,...t.ids||{}},Ye=t.rootEl||Ye,en=t.destinationUrl||(/android/i.test(navigator.userAgent)?"https://play.google.com/store":"https://www.apple.com/app-store/"),e&&(Qt=e),S("init"),document.body.oncontextmenu=()=>!1,Ta(),qs(Ye),va(),Hs(),Bs(),!tn){if(document.readyState==="complete")Ma();else if(!Aa){Aa=!0;let n=()=>{Ma(),window.removeEventListener("load",n),document.removeEventListener("DOMContentLoaded",n)};window.addEventListener("load",n),document.addEventListener("DOMContentLoaded",n)}}Ds(),Fs(),Ns(),$s(),Gs(),console.log(`%c @handler/playable-sdk %c v${Pn} `,"background: #007acc; color: #fff; font-size: 14px; padding: 4px 8px; border-top-left-radius: 4px; border-bottom-left-radius: 4px;","background: #e1e4e8; color: #333; font-size: 14px; padding: 4px 8px; border-top-right-radius: 4px; border-bottom-right-radius: 4px;"),we&&!xe&&(S("boot"),S("view"),S("ready"),ft&&(ft=!1,Ae.start()),xe=!0),xe=we},getRoot(){return Ta()},get version(){return Pn},get maxWidth(){return We},get maxHeight(){return Ve},get isLandscape(){return Bn},get isReady(){return xe},get isStarted(){return Rn},get isPaused(){return bt},get isFinished(){return gt},get volume(){return Dn},get interactions(){return Hn},on(t,e){Yt(Zt(t),e)},off(t,e){An(Zt(t),e)},start(){var t,e;if(!Rn){if(!we){ft=!0;return}if(Rn=!0,S("start"),Te(),qe())Ke(),(t=window.gameReady)==null||t.call(window);else if(Ue()){let n=window.TJ_API;(e=n==null?void 0:n.setPlayableBuild)==null||e.call(n,{orientation:Bn?"landscape":"portrait",buildID:Pn})}}},finish(){var t,e;gt||(gt=!0,S("complete"),qe()?(t=window.gameEnd)==null||t.call(window):Tn()?(e=parent==null?void 0:parent.postMessage)==null||e.call(parent,"complete","*"):Ue()&&ka())},install(t){if(!gt){gt=!0,Ue()?(ka(),setTimeout(()=>Ae.install(t),300)):(S("complete"),setTimeout(()=>Ae.install(t),0));return}jn||(jn=!0,setTimeout(()=>jn=!1,500),S("cta_click"),S("conversion"),zs(t||en))},emit(t,e){let n=Zt(t);if(!["view","boot","start","engagement","complete","cta_click","conversion","retry","pause","resume","resize","volume","error"].includes(n)&&!n.startsWith("custom."))throw new Error(`Event ${t} must be canonical or namespaced as custom.<mechanic_id>.<event>`);let i=Ra(n,e);Wt(n,i)},retry(){var t,e,n;if(qe())(t=window.gameRetry)==null||t.call(window);else if(Mn()){let i=window.NUC;(n=(e=i==null?void 0:i.trigger)==null?void 0:e.tryAgain)==null||n.call(e)}S("engagement",{action:"retry"})},pause(){Ke(!0)},resume(){yt(!0)},resize(t,e){Te(t,e)}},pt=Ae;function qs(t){let e=document.createElement("script");e.type="text/javascript",e.textContent=`
2
2
  (function(){
3
3
  var events = ['touchstart','touchend','mousedown','keydown'];
4
4
  function unlock(){
@@ -14,14 +14,14 @@
14
14
  }
15
15
  events.forEach(function(e){ document.addEventListener(e, unlock, false); });
16
16
  })();
17
- `,t.appendChild(e)}async function la(t,e={}){let n=new ra.Application;await n.init({resizeTo:t,autoDensity:!0,resolution:window.devicePixelRatio||1,antialias:!0,backgroundAlpha:0});let a=i=>{var c,l,p,f,u,d;let o=(p=(l=(c=i==null?void 0:i.width)!=null?c:t.clientWidth)!=null?l:window.innerWidth)!=null?p:320,r=(d=(u=(f=i==null?void 0:i.height)!=null?f:t.clientHeight)!=null?u:window.innerHeight)!=null?d:480;n.renderer.resize(o,r)};t.innerHTML="",t.style.position="relative",t.style.display="flex",t.style.flexDirection="column",t.style.alignItems="stretch",t.style.width="100%",t.style.height="100dvh",t.style.minHeight="100vh",t.style.maxWidth="100%",t.style.maxHeight="100%",t.style.boxSizing="border-box",t.style.overflow="hidden",e.background&&(t.style.background=e.background),t.appendChild(n.canvas);let s=document.createElement("div");return s.setAttribute("style",["position:absolute","inset:0","display:flex","flex-direction:column","align-items:center","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(";")),t.appendChild(s),qe.on("pause",()=>{n.ticker.stop(),document.querySelectorAll("audio").forEach(o=>o.pause())}),qe.on("resume",()=>{n.ticker.start(),document.querySelectorAll("audio").forEach(o=>{o.currentTime>0&&!o.ended&&o.play().catch(()=>{})})}),qe.on("resize",({payload:i})=>{a({width:i==null?void 0:i.width,height:i==null?void 0:i.height})}),window.addEventListener("resize",()=>a()),requestAnimationFrame(()=>a()),{app:n,stage:n.stage,overlay:s,applySize:a}}var Le=class{constructor(e){var n,a;this.position=(e==null?void 0:e.position)||{x:0,y:0},this.scale=(n=e==null?void 0:e.scale)!=null?n:1,this.rotation=(a=e==null?void 0:e.rotation)!=null?a:0}update(e){e.position!==void 0&&(this.position={...e.position}),e.scale!==void 0&&(this.scale=e.scale),e.rotation!==void 0&&(this.rotation=e.rotation)}syncToPixi(e){e.position.set(this.position.x,this.position.y),e.scale.set(this.scale),e.rotation=this.rotation}},Me=class{constructor(e){var n,a,s,i;this.z_index=(n=e==null?void 0:e.z_index)!=null?n:0,this.alpha=(a=e==null?void 0:e.alpha)!=null?a:1,this.visible=(s=e==null?void 0:e.visible)!=null?s:!0,this.tint=(i=e==null?void 0:e.tint)!=null?i:null}update(e){e.z_index!==void 0&&(this.z_index=e.z_index),e.alpha!==void 0&&(this.alpha=e.alpha),e.visible!==void 0&&(this.visible=e.visible),e.tint!==void 0&&(this.tint=e.tint)}syncToPixi(e){e.zIndex=this.z_index,e.alpha=this.alpha,e.visible=this.visible,this.tint!==null&&"tint"in e&&(e.tint=this.tint)}},De=class{constructor(e,n,a,s){this.instanceId=e,this.objectConfig=n,this.pixiObject=a,this._config=s,this.transform=new Le(s.transform),this.renderer=new Me(s.render),this.sync()}sync(){this.transform.syncToPixi(this.pixiObject),this.renderer.syncToPixi(this.pixiObject)}updateConfig(e){this._config=e,e.transform&&this.transform.update(e.transform),e.render&&this.renderer.update(e.render),this.sync()}getComponent(e){return this._config[e]}getPosition(){return{...this.transform.position}}setPosition(e,n){this.transform.position={x:e,y:n},this.transform.syncToPixi(this.pixiObject)}getAlpha(){return this.renderer.alpha}setAlpha(e){this.renderer.alpha=e,this.renderer.syncToPixi(this.pixiObject)}getVisible(){return this.renderer.visible}setVisible(e){this.renderer.visible=e,this.renderer.syncToPixi(this.pixiObject)}},Xe=class{constructor(e){this.objects=new Map;this.config=e}create(e,n){let a=this.config.objects.get(e);if(!a)throw new Error(`Object config not found: ${e}`);let s=new De(e,a.object_config||e,n,a);return this.objects.set(e,s),s}get(e){return this.objects.get(e)}updateConfig(e){this.config=e;for(let[n,a]of this.objects.entries()){let s=e.objects.get(n);s&&a.updateConfig(s)}}getAll(){return Array.from(this.objects.values())}remove(e){this.objects.delete(e)}clear(){this.objects.clear()}};var Ue={"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 V(t){let e=Ue[t];return e?e.family:(console.warn(`Font ID "${t}" not found in registry, using fallback`),"Arial, sans-serif")}function q(t){var n;let e=Ue[t];return e&&(n=e.weight)!=null?n:"400"}function ca(t,e){Ue[t]=e}function da(){return Object.keys(Ue)}var x=require("pixi.js");function ua(t,e,n){var At,vt,Et,Lt,Mt,Dt,Ot,Ct,Pt,kt,Ft,It,Rt,Nt,Bt,$t,zt,Ht,Wt,Yt,Gt,Jt,Vt,qt,Xt,Ut,Kt,jt,Qt,Zt,en,tn,nn,an,sn,on,rn,ln,cn,dn,un,pn,fn,hn,mn,yn,gn,_n,wn,bn,xn,Sn,Tn,An,vn,En,Ln,Mn,Dn,On;let a=t.objects.get("ui_endgame_1"),s=t.objects.get("ui_endgame_logo_1"),i=t.objects.get("ui_endgame_title_1"),o=t.objects.get("ui_endgame_subtitle_1"),r=t.objects.get("ui_endgame_footer_1"),c=t.objects.get("ui_endgame_cta_1"),l=t.objects.get("ui_endgame_cta_hint_1"),p=t.objects.get("ui_endgame_hand_1"),f=t.engine.runtime||{},u=new x.Container;u.alpha=0,u.visible=!1;let d=((At=a==null?void 0:a.gameplay)==null?void 0:At.tuning)||{},m=(a==null?void 0:a.render)||{},h=(vt=d.panel_width)!=null?vt:320,g=(Et=d.panel_height)!=null?Et:400,b=(Lt=d.panel_padding)!=null?Lt:32,w=(Mt=d.panel_radius)!=null?Mt:24,S=m.background_color||d.panel_bg_color||"#1a0a0a",T=m.background_alpha!==void 0&&m.background_alpha!==null?m.background_alpha:(Dt=d.panel_bg_alpha)!=null?Dt:.98,E=m.border_color||d.panel_border_color||"#ffffff",L=(Ot=d.panel_border_width)!=null?Ot:2,A=(Ct=d.panel_border_alpha)!=null?Ct:.3,v=new x.Graphics;v.roundRect(-h/2,-g/2,h,g,w);let M=S.replace("#","");v.fill({color:parseInt(M,16),alpha:T});let k=E.replace("#","");v.stroke({color:parseInt(k,16),width:L,alpha:A});let D=new x.Graphics;D.roundRect(-h/2+2,-g/2+2,h-4,g-4,w-2),D.stroke({color:16777215,width:1,alpha:.1}),v.addChild(D),u.addChild(v);let F=((Pt=s==null?void 0:s.gameplay)==null?void 0:Pt.tuning)||{},W=(s==null?void 0:s.transform)||{},O=(kt=F.logo_size)!=null?kt:56,I=(Ft=W.scale)!=null?Ft:1,Y=(Rt=(It=W.offset)==null?void 0:It.y)!=null?Rt:-130,Pe=(Nt=F.logo_alpha)!=null?Nt:1,C=new x.Sprite(n||x.Texture.EMPTY);C.anchor.set(.5);let oe=0,re=0;if(n&&n!==x.Texture.EMPTY){let P=n.frame,j=n.baseTexture;P&&P.width&&P.height?(oe=P.width,re=P.height):j&&j.width&&j.height?(oe=j.width,re=j.height):n.width&&n.height&&(oe=n.width,re=n.height)}if(oe>0&&re>0){let P=oe/re,j,tt;P>1?(j=O,tt=O/P):(tt=O,j=O*P);let Cn=j/oe,Pn=tt/re;Cn*=I,Pn*=I,C.scale.set(Cn,Pn)}else{let P=O/100*I;C.scale.set(P)}C.position.set(0,Y),C.alpha=0,C.visible=!0,C.targetAlpha=Pe,C.baseScaleX=C.scale.x,C.baseScaleY=C.scale.y,u.addChild(C);let R=i==null?void 0:i.ui,G=((Bt=i==null?void 0:i.gameplay)==null?void 0:Bt.tuning)||{},ba=(R==null?void 0:R.text)||"MISSION ACCOMPLISHED",ft=(R==null?void 0:R.font)||"brand.heading",xa=(R==null?void 0:R.fontSize)||24,Sa=($t=R==null?void 0:R.letterSpacing)!=null?$t:1,ke=(zt=i==null?void 0:i.render)==null?void 0:zt.tint,Ta=typeof ke=="string"?ke:ke?`#${ke.toString(16).padStart(6,"0")}`:"#00FF88",ht=h-b*2-30,Aa=G.font_weight_override?G.font_weight_override:q(ft),te=new x.Text({text:ba,style:{fontFamily:V(ft),fontSize:xa,fontWeight:Aa,fill:Ta,align:"center",letterSpacing:Sa,wordWrap:!1,stroke:{color:G.stroke_color||"#000000",width:(Ht=G.stroke_width)!=null?Ht:2},dropShadow:{color:G.shadow_color||"#000000",alpha:(Wt=G.shadow_alpha)!=null?Wt:.9,angle:(Yt=G.shadow_angle)!=null?Yt:0,blur:(Gt=G.shadow_blur)!=null?Gt:8,distance:(Jt=G.shadow_distance)!=null?Jt:4}}});if(te.width>ht){let P=ht/te.width;te.scale.set(P)}te.anchor.set(.5);let mt=(Vt=d.title_offset_y)!=null?Vt:30,va=mt+((qt=G.animation_start_y_offset)!=null?qt:-20);te.position.set(0,va),te.alpha=0,u.addChild(te);let N=o==null?void 0:o.ui,yt=((Xt=o==null?void 0:o.gameplay)==null?void 0:Xt.tuning)||{},Ea=(N==null?void 0:N.text)||"RESCUE COMPLETE",gt=(N==null?void 0:N.font)||"brand.body",La=(N==null?void 0:N.fontSize)||11,Ma=(Ut=N==null?void 0:N.letterSpacing)!=null?Ut:.5,Fe=(Kt=o==null?void 0:o.render)==null?void 0:Kt.tint,Da=typeof Fe=="string"?Fe:Fe?`#${Fe.toString(16).padStart(6,"0")}`:"#B0B0B0",le=new x.Text({text:Ea,style:{fontFamily:V(gt),fontSize:La,fontWeight:q(gt),fill:Da,align:"center",letterSpacing:Ma}});le.anchor.set(.5);let Oa=mt+20+((jt=yt.animation_start_y_offset)!=null?jt:-10);le.position.set(0,Oa),le.alpha=0,le.animationStartYOffset=(Qt=yt.animation_start_y_offset)!=null?Qt:-10,u.addChild(le);let U=r==null?void 0:r.ui,_t=((Zt=r==null?void 0:r.gameplay)==null?void 0:Zt.tuning)||{},Ca=(U==null?void 0:U.text)||((en=f.ui)==null?void 0:en.cta_hint)||"Continue the adventure!",wt=(U==null?void 0:U.font)||"brand.body",Pa=(U==null?void 0:U.fontSize)||16,Ie=(tn=r==null?void 0:r.render)==null?void 0:tn.tint,ka=typeof Ie=="string"?Ie:Ie?`#${Ie.toString(16).padStart(6,"0")}`:"#FFFFFF",Fa=(nn=_t.max_width)!=null?nn:h-b*2,Ia=(an=_t.line_height)!=null?an:1.4,ce=new x.Text({text:Ca,style:{fontFamily:V(wt),fontSize:Pa,fontWeight:q(wt),fill:ka,align:"center",wordWrap:!0,wordWrapWidth:Fa,lineHeight:Ia}});ce.anchor.set(.5);let Ra=(sn=d.footer_offset_y)!=null?sn:120;ce.position.set(0,Ra);let Na=((on=r==null?void 0:r.render)==null?void 0:on.alpha)!==void 0&&((rn=r==null?void 0:r.render)==null?void 0:rn.alpha)!==null?r.render.alpha:1;ce.alpha=0,ce.targetAlpha=Na,u.addChild(ce);let K=((ln=c==null?void 0:c.gameplay)==null?void 0:ln.tuning)||{},B=c==null?void 0:c.ui,Re=(cn=K.button_width)!=null?cn:260,Ne=(dn=K.button_height)!=null?dn:56,bt=(un=K.button_radius)!=null?un:16,Ba=K.button_bg_color||((pn=f.theme)==null?void 0:pn.cta_background)||"#ffb43b",$a=(fn=K.button_bg_alpha)!=null?fn:1,za=K.button_border_color||"#ffffff",Ha=(hn=K.button_border_width)!=null?hn:2,Wa=(mn=K.button_border_alpha)!=null?mn:.2,Be=(yn=d.cta_offset_y)!=null?yn:160,J=new x.Graphics;J.roundRect(-Re/2,-Ne/2,Re,Ne,bt);let Ya=Ba.replace("#","");J.fill({color:parseInt(Ya,16),alpha:$a});let Ga=za.replace("#","");J.stroke({color:parseInt(Ga,16),width:Ha,alpha:Wa});let Ze=new x.Graphics;Ze.roundRect(-Re/2+2,-Ne/2+2,Re-4,Ne-4,bt-2),Ze.stroke({color:0,width:1,alpha:.15}),J.addChild(Ze),J.position.set(0,Be),J.alpha=0,J.eventMode="static",J.cursor="pointer",u.addChild(J);let Ja=(B==null?void 0:B.text)||((gn=f.ui)==null?void 0:gn.cta_label_end)||"DOWNLOAD",xt=(B==null?void 0:B.font)||"brand.heading",Va=(B==null?void 0:B.fontSize)||20,qa=K.button_text_color||((_n=f.theme)==null?void 0:_n.cta_text)||"#1a0a0a",be=new x.Text({text:Ja,style:{fontFamily:V(xt),fontSize:Va,fontWeight:q(xt),fill:qa,align:"center",letterSpacing:(wn=B==null?void 0:B.letterSpacing)!=null?wn:1}});be.anchor.set(.5),be.position.set(0,Be),be.alpha=0,u.addChild(be);let $=l==null?void 0:l.ui,St=((bn=l==null?void 0:l.gameplay)==null?void 0:bn.tuning)||{},Xa=($==null?void 0:$.text)||"Play the full game",Tt=($==null?void 0:$.font)||"brand.body",Ua=($==null?void 0:$.fontSize)||11,Ka=(xn=$==null?void 0:$.letterSpacing)!=null?xn:0,$e=(Sn=l==null?void 0:l.render)==null?void 0:Sn.tint,ja=typeof $e=="string"?$e:$e?`#${$e.toString(16).padStart(6,"0")}`:"#CCCCCC",de=new x.Text({text:Xa,style:{fontFamily:V(Tt),fontSize:Ua,fontWeight:q(Tt),fill:ja,align:"center",letterSpacing:Ka}});de.anchor.set(.5);let Qa=Be+35+((Tn=St.animation_start_y_offset)!=null?Tn:5);de.position.set(0,Qa),de.alpha=0,de.animationStartYOffset=(An=St.animation_start_y_offset)!=null?An:5,u.addChild(de);let et=((vn=p==null?void 0:p.gameplay)==null?void 0:vn.tuning)||{},Za=(En=et.hand_offset_x)!=null?En:50,ei=(Ln=et.hand_offset_y)!=null?Ln:50,ti=(Dn=(Mn=p==null?void 0:p.transform)==null?void 0:Mn.scale)!=null?Dn:.1875,ni=(On=et.hand_scale_multiplier)!=null?On:2.5,se=new x.Sprite(e||x.Texture.EMPTY);return se.anchor.set(.5),se.scale.set(ti*ni),se.position.set(Za,Be+ei),se.alpha=0,se.visible=!1,u.addChild(se),{panel:u,logo:C,title:te,subtitle:le,footer:ce,ctaButton:J,ctaText:be,ctaHint:de,hand:se}}function pa(t,e,n){var L,A,v,M,k,D,F,W;let a=e.objects.get("ui_endgame_1"),s=((L=a==null?void 0:a.gameplay)==null?void 0:L.tuning)||{},i=(A=s.animation_duration_ms)!=null?A:800,o=(v=s.fade_in_duration_ms)!=null?v:600,r=(M=s.scale_animation_intensity)!=null?M:.1,c=(k=s.logo_animation_delay_ms)!=null?k:100,l=(D=s.title_animation_delay_ms)!=null?D:200,p=(F=s.footer_animation_delay_ms)!=null?F:300,f=(W=s.cta_animation_delay_ms)!=null?W:400,{panel:u,logo:d,title:m,subtitle:h,footer:g,ctaButton:b,ctaText:w,ctaHint:S}=t;u.visible=!0;let T=Date.now(),E=()=>{let O=Date.now()-T,I=Math.min(O/o,1),Y=1-Math.pow(1-I,3);u.alpha=Y,u.scale.set(1+r*(1-Y)),I<1?requestAnimationFrame(E):(setTimeout(()=>Si(d,i,e),c),setTimeout(()=>{Ti(m,i),setTimeout(()=>Ai(h,i),50)},l),setTimeout(()=>vi(g,i),p),setTimeout(()=>{Ei(b,w,i),setTimeout(()=>Li(S,i),50),n&&n()},f))};E()}function Si(t,e,n){var u,d,m,h,g;let a=n==null?void 0:n.objects.get("ui_endgame_logo_1"),i=(d=(((u=a==null?void 0:a.gameplay)==null?void 0:u.tuning)||{}).animation_start_scale)!=null?d:1.2,o=Date.now(),r=t.alpha,c=(m=t.targetAlpha)!=null?m:1,l=(h=t.baseScaleX)!=null?h:t.scale.x,p=(g=t.baseScaleY)!=null?g:t.scale.y,f=()=>{let b=Date.now()-o,w=Math.min(b/e,1),S=1-Math.pow(1-w,2);t.alpha=r+(c-r)*S;let T=i+(1-i)*S;t.scale.set(l*T,p*T),w<1&&requestAnimationFrame(f)};f()}function Ti(t,e){let n=Date.now(),a=t.alpha,s=t.y,i=()=>{let o=Date.now()-n,r=Math.min(o/e,1),c=1-Math.pow(1-r,2);t.alpha=a+(1-a)*c,t.y=s-20*(1-c),r<1&&requestAnimationFrame(i)};i()}function Ai(t,e){var r;let n=Date.now(),a=t.alpha,s=t.position.y,i=s-((r=t.animationStartYOffset)!=null?r:-10),o=()=>{let c=Date.now()-n,l=Math.min(c/e,1),p=1-Math.pow(1-l,2);t.alpha=a+(1-a)*p,t.position.y=s+(i-s)*p,l<1&&requestAnimationFrame(o)};o()}function vi(t,e){var o;let n=Date.now(),a=t.alpha,s=(o=t.targetAlpha)!=null?o:1,i=()=>{let r=Date.now()-n,c=Math.min(r/e,1),l=1-Math.pow(1-c,2);t.alpha=a+(s-a)*l,c<1&&requestAnimationFrame(i)};i()}function Ei(t,e,n){let a=Date.now(),s=t.alpha,i=()=>{let o=Date.now()-a,r=Math.min(o/n,1),c=1-Math.pow(1-r,2);t.alpha=s+(1-s)*c,e.alpha=s+(1-s)*c,t.scale.set(1+.1*(1-c)),r<1&&requestAnimationFrame(i)};i()}function Li(t,e){var r;let n=Date.now(),a=t.alpha,s=t.position.y,i=s-((r=t.animationStartYOffset)!=null?r:5),o=()=>{let c=Date.now()-n,l=Math.min(c/e,1),p=1-Math.pow(1-l,2);t.alpha=a+(1-a)*p,t.position.y=s+(i-s)*p,l<1&&requestAnimationFrame(o)};o()}function fa(t,e,n,a){var p,f,u,d;let s=n.objects.get("ui_endgame_hand_1"),i=((p=s==null?void 0:s.gameplay)==null?void 0:p.tuning)||{},o=(f=i.click_animation_duration_ms)!=null?f:600,r=(u=i.click_delay_ms)!=null?u:2e3,c=(d=i.click_repeat_delay_ms)!=null?d:3e3,l=()=>{var L,A;t.visible=!0,t.alpha=1;let m=t.x,h=t.y,g=(L=i.hand_offset_x)!=null?L:50,b=(A=i.hand_offset_y)!=null?A:50,w=e.x+g,S=e.y+b,T=Date.now(),E=()=>{var O,I,Y;let v=Date.now()-T,M=Math.min(v/o,1),k=M<.5?2*M*M:1-Math.pow(-2*M+2,2)/2;t.x=m+(w-m)*k,t.y=h+(S-h)*k;let D=(I=(O=s==null?void 0:s.transform)==null?void 0:O.scale)!=null?I:.1875,F=(Y=i.hand_scale_multiplier)!=null?Y:2.5,W=D*F;t.scale.set(W+W*.2*Math.sin(M*Math.PI)),M<1?requestAnimationFrame(E):(e.scale.set(.95),setTimeout(()=>{e.scale.set(1),a()},100),setTimeout(()=>{t.alpha=0,setTimeout(()=>{t.x=m,t.y=h,l()},c)},500))};E()};setTimeout(l,r)}var Ke=require("pixi.js");function ha(t,e,n){var p,f,u,d;let a=e.objects.get("hand_tutorial_1"),s=((p=a==null?void 0:a.gameplay)==null?void 0:p.tuning)||{},i=(a==null?void 0:a.render)||{},o=(a==null?void 0:a.transform)||{},r=new Ke.Sprite(t);r.anchor.set(.5),r.alpha=0;let c=(f=s.hand_scale_multiplier)!=null?f:2.5,l=(u=o.scale)!=null?u:.1875;return r.scale.set(l*c),r.zIndex=(d=i.z_index)!=null?d:99999,r}function ma(t){var m,h,g,b,w,S,T,E,L,A;let e=t.objects.get("ui_tutorial_1"),n=e==null?void 0:e.ui,a=(e==null?void 0:e.render)||{},s=((m=t.engine.runtime)==null?void 0:m.ui_styles)||{},i=((h=t.engine.runtime)==null?void 0:h.ui)||{},o=(n==null?void 0:n.text)||i.tutorial_label||i.label_text||"CLEAN!",r=(n==null?void 0:n.font)||"brand.warning",c=(n==null?void 0:n.fontSize)||s.label_font_size||52,l=(b=n==null?void 0:n.letterSpacing)!=null?b:(g=s.label_letter_spacing)!=null?g:-1,p=(n==null?void 0:n.align)||"center",f=a.tint,u=typeof f=="string"?f:f?`#${f.toString(16).padStart(6,"0")}`:s.label_fill||"#FFF1C1",d=new Ke.Text({text:o,style:{fontFamily:V(r),fontSize:c,fontWeight:q(r),fill:u,align:p,letterSpacing:l,stroke:{color:s.label_stroke||"#8B0000",width:2},dropShadow:{color:s.label_shadow_color||"#000000",alpha:(w=s.label_shadow_alpha)!=null?w:.8,angle:(S=s.label_shadow_angle)!=null?S:0,blur:(T=s.label_shadow_blur)!=null?T:4,distance:(E=s.label_shadow_distance)!=null?E:2}}});return d.anchor.set(.5,0),d.alpha=(L=a.alpha)!=null?L:0,d.visible=(A=a.visible)!=null?A:!0,d}function ya(t,e,n,a,s){var c,l,p,f,u,d,m;let i=s.objects.get("hand_tutorial_1"),o=((c=i==null?void 0:i.gameplay)==null?void 0:c.tuning)||{},r=(i==null?void 0:i.transform)||{};if(!a){let h=(l=o.animation_duration)!=null?l:1.5,g=n%h/h,b=g<.5?2*g*g:-1+(4-2*g)*g,w=(p=o.x_offset)!=null?p:0,S=(f=o.y_offset)!=null?f:0,T=(u=o.animation_range)!=null?u:40,E=T*.7,L=T,A=e.x+w+E,v=e.y+S+L,M=A+E,k=v+L;t.x=A+(M-A)*b,t.y=v+(k-v)*b;let D=(d=r.scale)!=null?d:.1875,F=(m=o.hand_scale_multiplier)!=null?m:2.5;t.scale.set(D*F)}}var Oe=null;function Mi(){return Oe||(typeof window!="undefined"&&window.lottie?Oe=window.lottie:(console.warn("[LottieOverlay] lottie-web is not available globally. Make sure it is loaded before using Lottie animations."),Oe=null)),Oe}function ga(t){Oe=t}function _a(t,e,n,a){var E,L,A,v,M,k,D,F,W,O,I,Y,Pe;let s=n.objects.get(t);if(!s)return console.warn(`[LottieOverlay] Object config not found: ${t}`),null;let i=((E=s.effects)==null?void 0:E.lottie)||{},o=s.transform||{},r=s.render||{};if(i.enabled===!1||r.visible===!1)return null;let c=a[t];if(!c||typeof c!="object")return console.warn(`[LottieOverlay] Asset data not found or invalid for: ${t}`),null;let l=Mi();if(!l)return console.warn(`[LottieOverlay] lottie-web is not available. Cannot play animation: ${t}`),null;let p=(L=i.width)!=null?L:300,f=(A=i.height)!=null?A:300,u=(v=o.scale)!=null?v:1,d=(k=(M=o.position)==null?void 0:M.x)!=null?k:0,m=(F=(D=o.position)==null?void 0:D.y)!=null?F:0,h=(W=o.rotation)!=null?W:0,g=(O=r.z_index)!=null?O:100,b=(I=r.alpha)!=null?I:1,w=document.createElement("div");w.style.cssText=`
17
+ `,t.appendChild(e)}async function nn(t,e={}){let n=new ja.Application;await n.init({resizeTo:t,autoDensity:!0,resolution:window.devicePixelRatio||1,antialias:!0,backgroundAlpha:0});let i=s=>{var c,l,u,g,p,d;if(!n.renderer)return;let o=(u=(l=(c=s==null?void 0:s.width)!=null?c:t.clientWidth)!=null?l:window.innerWidth)!=null?u:320,r=(d=(p=(g=s==null?void 0:s.height)!=null?g:t.clientHeight)!=null?p:window.innerHeight)!=null?d:480;n.renderer.resize(o,r)};t.innerHTML="",t.style.position="relative",t.style.display="flex",t.style.flexDirection="column",t.style.alignItems="stretch",t.style.width="100%",t.style.height="100dvh",t.style.minHeight="100vh",t.style.maxWidth="100%",t.style.maxHeight="100%",t.style.boxSizing="border-box",t.style.overflow="hidden",e.background&&(t.style.background=e.background),t.appendChild(n.canvas);let a=document.createElement("div");return a.setAttribute("style",["position:absolute","inset:0","display:flex","flex-direction:column","align-items:center","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(";")),t.appendChild(a),pt.on("pause",()=>{n.ticker.stop(),document.querySelectorAll("audio").forEach(o=>o.pause())}),pt.on("resume",()=>{n.ticker.start(),document.querySelectorAll("audio").forEach(o=>{o.currentTime>0&&!o.ended&&o.play().catch(()=>{})})}),pt.on("resize",({payload:s})=>{i({width:s==null?void 0:s.width,height:s==null?void 0:s.height})}),window.addEventListener("resize",()=>i()),requestAnimationFrame(()=>i()),{app:n,stage:n.stage,overlay:a,applySize:i}}var vt=class{constructor(e){var n,i;this.position=(e==null?void 0:e.position)||{x:0,y:0},this.scale=(n=e==null?void 0:e.scale)!=null?n:1,this.rotation=(i=e==null?void 0:e.rotation)!=null?i:0}update(e){e.position!==void 0&&(this.position={...e.position}),e.scale!==void 0&&(this.scale=e.scale),e.rotation!==void 0&&(this.rotation=e.rotation)}syncToPixi(e){e.position.set(this.position.x,this.position.y),e.scale.set(this.scale),e.rotation=this.rotation}},xt=class{constructor(e){var n,i,a,s;this.z_index=(n=e==null?void 0:e.z_index)!=null?n:0,this.alpha=(i=e==null?void 0:e.alpha)!=null?i:1,this.visible=(a=e==null?void 0:e.visible)!=null?a:!0,this.tint=(s=e==null?void 0:e.tint)!=null?s:null}update(e){e.z_index!==void 0&&(this.z_index=e.z_index),e.alpha!==void 0&&(this.alpha=e.alpha),e.visible!==void 0&&(this.visible=e.visible),e.tint!==void 0&&(this.tint=e.tint)}syncToPixi(e){e.zIndex=this.z_index,e.alpha=this.alpha,e.visible=this.visible,this.tint!==null&&"tint"in e&&(e.tint=this.tint)}},wt=class{constructor(e,n,i,a){this.instanceId=e,this.objectConfig=n,this.pixiObject=i,this._config=a,this.transform=new vt(a.transform),this.renderer=new xt(a.render),this.sync()}sync(){this.transform.syncToPixi(this.pixiObject),this.renderer.syncToPixi(this.pixiObject),this.applyAnchor(),this.applyEffectsScale()}updateConfig(e){this._config=e,e.transform&&this.transform.update(e.transform),e.render&&this.renderer.update(e.render),this.sync()}applyAnchor(){var a,s,o,r;if(!this.pixiObject||!("anchor"in this.pixiObject)||!this.pixiObject.anchor)return;let e=(s=(a=this._config)==null?void 0:a.render)==null?void 0:s.anchor,n=(r=(o=this._config)==null?void 0:o.transform)==null?void 0:r.anchor,i=e&&typeof e=="object"?e:n&&typeof n=="object"?n:null;i&&typeof i.x=="number"&&typeof i.y=="number"&&this.pixiObject.anchor.set(i.x,i.y)}applyEffectsScale(){var s,o,r;if(!((s=this.pixiObject)!=null&&s.scale))return;let e=(o=this._config)==null?void 0:o.effects,n=typeof(e==null?void 0:e.scale_x)=="number"?e.scale_x:1,i=typeof(e==null?void 0:e.scale_y)=="number"?e.scale_y:1;if(n===1&&i===1)return;let a=(r=this.transform.scale)!=null?r:1;typeof this.pixiObject.scale.set=="function"?this.pixiObject.scale.set(a*n,a*i):(this.pixiObject.scale.x=a*n,this.pixiObject.scale.y=a*i)}getComponent(e){return this._config[e]}getPosition(){return{...this.transform.position}}setPosition(e,n){this.transform.position={x:e,y:n},this.transform.syncToPixi(this.pixiObject)}getAlpha(){return this.renderer.alpha}setAlpha(e){this.renderer.alpha=e,this.renderer.syncToPixi(this.pixiObject)}getVisible(){return this.renderer.visible}setVisible(e){this.renderer.visible=e,this.renderer.syncToPixi(this.pixiObject)}},Je=class{constructor(e){this.objects=new Map;this.config=e}create(e,n){let i=this.config.objects.get(e);if(!i)throw new Error(`Object config not found: ${e}`);let a=new wt(e,i.object_config||e,n,i);return this.objects.set(e,a),a}get(e){return this.objects.get(e)}updateConfig(e){this.config=e;for(let[n,i]of this.objects.entries()){let a=e.objects.get(n);a&&i.updateConfig(a)}}getAll(){return Array.from(this.objects.values())}remove(e){this.objects.delete(e)}clear(){this.objects.clear()}};var an={"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 oe(t){let e=an[t];return e?e.family:(console.warn(`Font ID "${t}" not found in registry, using fallback`),"Arial, sans-serif")}function re(t){var n;let e=an[t];return e&&(n=e.weight)!=null?n:"400"}function Ha(t,e){an[t]=e}function Ba(){return Object.keys(an)}var B=require("pixi.js");function Da(t,e,n){var Yn,Wn,Vn,Xn,Kn,Jn,Qn,Zn,ei,ti,ni,ii,ai,si,oi,ri,li,ci,di,ui,pi,gi,hi,fi,bi,mi,yi,vi,xi,wi,Si,Ei,_i,Ci,Li,Ai,Ti,Mi,ki,Ii,Oi,Pi,Ri,ji,Hi,Bi,Di,zi,Fi,Ni,$i,Gi,qi,Ui,Yi,Wi,Vi,Xi,Ki,Ji;let i=t.objects.get("ui_endgame_1"),a=t.objects.get("ui_endgame_logo_1"),s=t.objects.get("ui_endgame_title_1"),o=t.objects.get("ui_endgame_subtitle_1"),r=t.objects.get("ui_endgame_footer_1"),c=t.objects.get("ui_endgame_cta_1"),l=t.objects.get("ui_endgame_cta_hint_1"),u=t.objects.get("ui_endgame_hand_1"),g=t.engine.runtime||{},p=new B.Container;p.alpha=0,p.visible=!1;let d=((Yn=i==null?void 0:i.gameplay)==null?void 0:Yn.tuning)||{},f=(i==null?void 0:i.render)||{},h=(Wn=d.panel_width)!=null?Wn:320,b=(Vn=d.panel_height)!=null?Vn:400,m=(Xn=d.panel_padding)!=null?Xn:32,y=(Kn=d.panel_radius)!=null?Kn:24,_=f.background_color||d.panel_bg_color||"#1a0a0a",C=f.background_alpha!==void 0&&f.background_alpha!==null?f.background_alpha:(Jn=d.panel_bg_alpha)!=null?Jn:.98,v=f.border_color||d.panel_border_color||"#ffffff",I=(Qn=d.panel_border_width)!=null?Qn:2,R=(Zn=d.panel_border_alpha)!=null?Zn:.3,M=new B.Graphics;M.roundRect(-h/2,-b/2,h,b,y);let w=_.replace("#","");M.fill({color:parseInt(w,16),alpha:C});let L=v.replace("#","");M.stroke({color:parseInt(L,16),width:I,alpha:R});let G=new B.Graphics;G.roundRect(-h/2+2,-b/2+2,h-4,b-4,y-2),G.stroke({color:16777215,width:1,alpha:.1}),M.addChild(G),p.addChild(M);let E=((ei=a==null?void 0:a.gameplay)==null?void 0:ei.tuning)||{},j=(a==null?void 0:a.transform)||{},N=(ti=E.logo_size)!=null?ti:56,H=(ni=j.scale)!=null?ni:1,q=(ai=(ii=j.offset)==null?void 0:ii.y)!=null?ai:-130,pe=(si=E.logo_alpha)!=null?si:1,D=new B.Sprite(n||B.Texture.EMPTY);D.anchor.set(.5);let K=0,J=0;if(n&&n!==B.Texture.EMPTY){let Q=n.frame,ve=n.baseTexture;Q&&Q.width&&Q.height?(K=Q.width,J=Q.height):ve&&ve.width&&ve.height?(K=ve.width,J=ve.height):n.width&&n.height&&(K=n.width,J=n.height)}if(K>0&&J>0){let Q=K/J,ve,Cn;Q>1?(ve=N,Cn=N/Q):(Cn=N,ve=N*Q);let Qi=ve/K,Zi=Cn/J;Qi*=H,Zi*=H,D.scale.set(Qi,Zi)}else{let Q=N/100*H;D.scale.set(Q)}D.position.set(0,q),D.alpha=0,D.visible=!0,D.targetAlpha=pe,D.baseScaleX=D.scale.x,D.baseScaleY=D.scale.y,p.addChild(D);let $=s==null?void 0:s.ui,Y=((oi=s==null?void 0:s.gameplay)==null?void 0:oi.tuning)||{},$e=($==null?void 0:$.text)||"MISSION ACCOMPLISHED",ke=($==null?void 0:$.font)||"brand.heading",At=($==null?void 0:$.fontSize)||24,Tt=(ri=$==null?void 0:$.letterSpacing)!=null?ri:1,Ie=(li=s==null?void 0:s.render)==null?void 0:li.tint,Mt=typeof Ie=="string"?Ie:Ie?`#${Ie.toString(16).padStart(6,"0")}`:"#00FF88",it=h-m*2-30,kt=Y.font_weight_override?Y.font_weight_override:re(ke),ce=new B.Text({text:$e,style:{fontFamily:oe(ke),fontSize:At,fontWeight:kt,fill:Mt,align:"center",letterSpacing:Tt,wordWrap:!1,stroke:{color:Y.stroke_color||"#000000",width:(ci=Y.stroke_width)!=null?ci:2},dropShadow:{color:Y.shadow_color||"#000000",alpha:(di=Y.shadow_alpha)!=null?di:.9,angle:(ui=Y.shadow_angle)!=null?ui:0,blur:(pi=Y.shadow_blur)!=null?pi:8,distance:(gi=Y.shadow_distance)!=null?gi:4}}});if(ce.width>it){let Q=it/ce.width;ce.scale.set(Q)}ce.anchor.set(.5);let at=(hi=d.title_offset_y)!=null?hi:30,It=at+((fi=Y.animation_start_y_offset)!=null?fi:-20);ce.position.set(0,It),ce.alpha=0,p.addChild(ce);let W=o==null?void 0:o.ui,st=((bi=o==null?void 0:o.gameplay)==null?void 0:bi.tuning)||{},Ot=(W==null?void 0:W.text)||"RESCUE COMPLETE",ot=(W==null?void 0:W.font)||"brand.body",Pt=(W==null?void 0:W.fontSize)||11,Rt=(mi=W==null?void 0:W.letterSpacing)!=null?mi:.5,Oe=(yi=o==null?void 0:o.render)==null?void 0:yi.tint,jt=typeof Oe=="string"?Oe:Oe?`#${Oe.toString(16).padStart(6,"0")}`:"#B0B0B0",be=new B.Text({text:Ot,style:{fontFamily:oe(ot),fontSize:Pt,fontWeight:re(ot),fill:jt,align:"center",letterSpacing:Rt}});be.anchor.set(.5);let Ht=at+20+((vi=st.animation_start_y_offset)!=null?vi:-10);be.position.set(0,Ht),be.alpha=0,be.animationStartYOffset=(xi=st.animation_start_y_offset)!=null?xi:-10,p.addChild(be);let ee=r==null?void 0:r.ui,rt=((wi=r==null?void 0:r.gameplay)==null?void 0:wi.tuning)||{},Bt=(ee==null?void 0:ee.text)||((Si=g.ui)==null?void 0:Si.cta_hint)||"Continue the adventure!",lt=(ee==null?void 0:ee.font)||"brand.body",Dt=(ee==null?void 0:ee.fontSize)||16,Pe=(Ei=r==null?void 0:r.render)==null?void 0:Ei.tint,zt=typeof Pe=="string"?Pe:Pe?`#${Pe.toString(16).padStart(6,"0")}`:"#FFFFFF",Ft=(_i=rt.max_width)!=null?_i:h-m*2,Nt=(Ci=rt.line_height)!=null?Ci:1.4,me=new B.Text({text:Bt,style:{fontFamily:oe(lt),fontSize:Dt,fontWeight:re(lt),fill:zt,align:"center",wordWrap:!0,wordWrapWidth:Ft,lineHeight:Nt}});me.anchor.set(.5);let $t=(Li=d.footer_offset_y)!=null?Li:120;me.position.set(0,$t);let Gt=((Ai=r==null?void 0:r.render)==null?void 0:Ai.alpha)!==void 0&&((Ti=r==null?void 0:r.render)==null?void 0:Ti.alpha)!==null?r.render.alpha:1;me.alpha=0,me.targetAlpha=Gt,p.addChild(me);let te=((Mi=c==null?void 0:c.gameplay)==null?void 0:Mi.tuning)||{},V=c==null?void 0:c.ui,Re=(ki=te.button_width)!=null?ki:260,A=(Ii=te.button_height)!=null?Ii:56,F=(Oi=te.button_radius)!=null?Oi:16,O=te.button_bg_color||((Pi=g.theme)==null?void 0:Pi.cta_background)||"#ffb43b",x=(Ri=te.button_bg_alpha)!=null?Ri:1,ne=te.button_border_color||"#ffffff",de=(ji=te.button_border_width)!=null?ji:2,je=(Hi=te.button_border_alpha)!=null?Hi:.2,ye=(Bi=d.cta_offset_y)!=null?Bi:160,U=new B.Graphics;U.roundRect(-Re/2,-A/2,Re,A,F);let He=O.replace("#","");U.fill({color:parseInt(He,16),alpha:x});let ct=ne.replace("#","");U.stroke({color:parseInt(ct,16),width:de,alpha:je});let En=new B.Graphics;En.roundRect(-Re/2+2,-A/2+2,Re-4,A-4,F-2),En.stroke({color:0,width:1,alpha:.15}),U.addChild(En),U.position.set(0,ye),U.alpha=0,U.eventMode="static",U.cursor="pointer",p.addChild(U);let ts=(V==null?void 0:V.text)||((Di=g.ui)==null?void 0:Di.cta_label_end)||"DOWNLOAD",Gn=(V==null?void 0:V.font)||"brand.heading",ns=(V==null?void 0:V.fontSize)||20,is=te.button_text_color||((zi=g.theme)==null?void 0:zi.cta_text)||"#1a0a0a",dt=new B.Text({text:ts,style:{fontFamily:oe(Gn),fontSize:ns,fontWeight:re(Gn),fill:is,align:"center",letterSpacing:(Fi=V==null?void 0:V.letterSpacing)!=null?Fi:1}});dt.anchor.set(.5),dt.position.set(0,ye),dt.alpha=0,p.addChild(dt);let ie=l==null?void 0:l.ui,qn=((Ni=l==null?void 0:l.gameplay)==null?void 0:Ni.tuning)||{},as=(ie==null?void 0:ie.text)||"Play the full game",Un=(ie==null?void 0:ie.font)||"brand.body",ss=(ie==null?void 0:ie.fontSize)||11,os=($i=ie==null?void 0:ie.letterSpacing)!=null?$i:0,qt=(Gi=l==null?void 0:l.render)==null?void 0:Gi.tint,rs=typeof qt=="string"?qt:qt?`#${qt.toString(16).padStart(6,"0")}`:"#CCCCCC",Ge=new B.Text({text:as,style:{fontFamily:oe(Un),fontSize:ss,fontWeight:re(Un),fill:rs,align:"center",letterSpacing:os}});Ge.anchor.set(.5);let ls=ye+35+((qi=qn.animation_start_y_offset)!=null?qi:5);Ge.position.set(0,ls),Ge.alpha=0,Ge.animationStartYOffset=(Ui=qn.animation_start_y_offset)!=null?Ui:5,p.addChild(Ge);let _n=((Yi=u==null?void 0:u.gameplay)==null?void 0:Yi.tuning)||{},cs=(Wi=_n.hand_offset_x)!=null?Wi:50,ds=(Vi=_n.hand_offset_y)!=null?Vi:50,us=(Ki=(Xi=u==null?void 0:u.transform)==null?void 0:Xi.scale)!=null?Ki:.1875,ps=(Ji=_n.hand_scale_multiplier)!=null?Ji:2.5,Be=new B.Sprite(e||B.Texture.EMPTY);return Be.anchor.set(.5),Be.scale.set(us*ps),Be.position.set(cs,ye+ds),Be.alpha=0,Be.visible=!1,p.addChild(Be),{panel:p,logo:D,title:ce,subtitle:be,footer:me,ctaButton:U,ctaText:dt,ctaHint:Ge,hand:Be}}function za(t,e,n){var I,R,M,w,L,G,E,j;let i=e.objects.get("ui_endgame_1"),a=((I=i==null?void 0:i.gameplay)==null?void 0:I.tuning)||{},s=(R=a.animation_duration_ms)!=null?R:800,o=(M=a.fade_in_duration_ms)!=null?M:600,r=(w=a.scale_animation_intensity)!=null?w:.1,c=(L=a.logo_animation_delay_ms)!=null?L:100,l=(G=a.title_animation_delay_ms)!=null?G:200,u=(E=a.footer_animation_delay_ms)!=null?E:300,g=(j=a.cta_animation_delay_ms)!=null?j:400,{panel:p,logo:d,title:f,subtitle:h,footer:b,ctaButton:m,ctaText:y,ctaHint:_}=t;p.visible=!0;let C=Date.now(),v=()=>{let N=Date.now()-C,H=Math.min(N/o,1),q=1-Math.pow(1-H,3);p.alpha=q,p.scale.set(1+r*(1-q)),H<1?requestAnimationFrame(v):(setTimeout(()=>Us(d,s,e),c),setTimeout(()=>{Ys(f,s),setTimeout(()=>Ws(h,s),50)},l),setTimeout(()=>Vs(b,s),u),setTimeout(()=>{Xs(m,y,s),setTimeout(()=>Ks(_,s),50),n&&n()},g))};v()}function Us(t,e,n){var p,d,f,h,b;let i=n==null?void 0:n.objects.get("ui_endgame_logo_1"),s=(d=(((p=i==null?void 0:i.gameplay)==null?void 0:p.tuning)||{}).animation_start_scale)!=null?d:1.2,o=Date.now(),r=t.alpha,c=(f=t.targetAlpha)!=null?f:1,l=(h=t.baseScaleX)!=null?h:t.scale.x,u=(b=t.baseScaleY)!=null?b:t.scale.y,g=()=>{let m=Date.now()-o,y=Math.min(m/e,1),_=1-Math.pow(1-y,2);t.alpha=r+(c-r)*_;let C=s+(1-s)*_;t.scale.set(l*C,u*C),y<1&&requestAnimationFrame(g)};g()}function Ys(t,e){let n=Date.now(),i=t.alpha,a=t.y,s=()=>{let o=Date.now()-n,r=Math.min(o/e,1),c=1-Math.pow(1-r,2);t.alpha=i+(1-i)*c,t.y=a-20*(1-c),r<1&&requestAnimationFrame(s)};s()}function Ws(t,e){var r;let n=Date.now(),i=t.alpha,a=t.position.y,s=a-((r=t.animationStartYOffset)!=null?r:-10),o=()=>{let c=Date.now()-n,l=Math.min(c/e,1),u=1-Math.pow(1-l,2);t.alpha=i+(1-i)*u,t.position.y=a+(s-a)*u,l<1&&requestAnimationFrame(o)};o()}function Vs(t,e){var o;let n=Date.now(),i=t.alpha,a=(o=t.targetAlpha)!=null?o:1,s=()=>{let r=Date.now()-n,c=Math.min(r/e,1),l=1-Math.pow(1-c,2);t.alpha=i+(a-i)*l,c<1&&requestAnimationFrame(s)};s()}function Xs(t,e,n){let i=Date.now(),a=t.alpha,s=()=>{let o=Date.now()-i,r=Math.min(o/n,1),c=1-Math.pow(1-r,2);t.alpha=a+(1-a)*c,e.alpha=a+(1-a)*c,t.scale.set(1+.1*(1-c)),r<1&&requestAnimationFrame(s)};s()}function Ks(t,e){var r;let n=Date.now(),i=t.alpha,a=t.position.y,s=a-((r=t.animationStartYOffset)!=null?r:5),o=()=>{let c=Date.now()-n,l=Math.min(c/e,1),u=1-Math.pow(1-l,2);t.alpha=i+(1-i)*u,t.position.y=a+(s-a)*u,l<1&&requestAnimationFrame(o)};o()}function Fa(t,e,n,i){var u,g,p,d;let a=n.objects.get("ui_endgame_hand_1"),s=((u=a==null?void 0:a.gameplay)==null?void 0:u.tuning)||{},o=(g=s.click_animation_duration_ms)!=null?g:600,r=(p=s.click_delay_ms)!=null?p:2e3,c=(d=s.click_repeat_delay_ms)!=null?d:3e3,l=()=>{var I,R;t.visible=!0,t.alpha=1;let f=t.x,h=t.y,b=(I=s.hand_offset_x)!=null?I:50,m=(R=s.hand_offset_y)!=null?R:50,y=e.x+b,_=e.y+m,C=Date.now(),v=()=>{var N,H,q;let M=Date.now()-C,w=Math.min(M/o,1),L=w<.5?2*w*w:1-Math.pow(-2*w+2,2)/2;t.x=f+(y-f)*L,t.y=h+(_-h)*L;let G=(H=(N=a==null?void 0:a.transform)==null?void 0:N.scale)!=null?H:.1875,E=(q=s.hand_scale_multiplier)!=null?q:2.5,j=G*E;t.scale.set(j+j*.2*Math.sin(w*Math.PI)),w<1?requestAnimationFrame(v):(e.scale.set(.95),setTimeout(()=>{e.scale.set(1),i()},100),setTimeout(()=>{t.alpha=0,setTimeout(()=>{t.x=f,t.y=h,l()},c)},500))};v()};setTimeout(l,r)}var X=require("pixi.js");var St={enabled:!0,show_on_start:!1,background_color:"#120b14",background_alpha:.8,title:"Rope Rescue",subtitle:"Drag the key to save the hero.",button_label:"Start",title_color:"#FFFFFF",subtitle_color:"#D6C9E0",button_bg:"#FFB43B",button_text:"#1A0A0A",button_width:180,button_height:48,button_radius:14,loading_blur:!0,loading_blur_strength:8,loading_overlay_alpha:.35,font_family:"Arial, sans-serif",title_size:28,subtitle_size:14,loading_text:"Y\xFCkleniyor...",loading_text_scale:.6},Qe=class{constructor(e,n,i){this.loadingTime=0;this.tickLoadingHandler=null;var a,s,o;this.app=e,this.stage=n,this.activeConfig=i,this.splashConfig={...St,...(s=(a=i.engine)==null?void 0:a.splash)!=null?s:{}},this.splashEnabled=this.splashConfig.enabled!==!1,this.loadingBlurEnabled=this.splashConfig.loading_blur!==!1,this.loadingBlurStrength=typeof this.splashConfig.loading_blur_strength=="number"?this.splashConfig.loading_blur_strength:8,this.loadingOverlayAlpha=typeof this.splashConfig.loading_overlay_alpha=="number"?this.splashConfig.loading_overlay_alpha:.35,this.splashLayer=new X.Container,this.splashLayer.visible=!1,this.splashLayer.zIndex=1e4,this.splashLayer.eventMode="static",this.splashLayer.cursor="default",this.splashBg=new X.Graphics,this.splashBg.eventMode="static",this.splashTitle=new X.Text(this.splashConfig.title,{fontFamily:this.splashConfig.font_family,fontSize:this.splashConfig.title_size,fill:this.splashConfig.title_color,align:"center"}),this.splashTitle.anchor.set(.5),this.splashSubtitle=new X.Text(this.splashConfig.subtitle,{fontFamily:this.splashConfig.font_family,fontSize:this.splashConfig.subtitle_size,fill:this.splashConfig.subtitle_color,align:"center"}),this.splashSubtitle.anchor.set(.5),this.splashButton=new X.Graphics,this.splashButton.eventMode="static",this.splashButton.cursor="pointer",this.splashButtonText=new X.Text(this.splashConfig.button_label,{fontFamily:this.splashConfig.font_family,fontSize:Math.round(this.splashConfig.subtitle_size+2),fill:this.splashConfig.button_text,align:"center"}),this.splashButtonText.anchor.set(.5),this.splashButton.addChild(this.splashButtonText),this.splashLayer.addChild(this.splashBg,this.splashTitle,this.splashSubtitle,this.splashButton),this.stage.addChild(this.splashLayer),this.loadingLayer=new X.Container,this.loadingLayer.zIndex=10001,this.loadingLayer.eventMode="static",this.loadingBg=new X.Graphics,this.loadingText=new X.Text((o=this.splashConfig.loading_text)!=null?o:St.loading_text,this.resolveLoadingTextStyle(this.splashConfig)),this.loadingText.anchor.set(.5),this.loadingLayer.addChild(this.loadingBg,this.loadingText),this.stage.addChild(this.loadingLayer),this.syncConfig(),this.updateLoadingLayout(),this.setupWindowGlobals(),this.startLoadingAnimation()}resolveLoadingTextStyle(e){var g,p,d,f,h,b,m;let n=this.activeConfig.objects.get("label_1"),i=(g=n==null?void 0:n.ui)!=null?g:{},a=(p=n==null?void 0:n.render)!=null?p:{},s=(d=i.font)!=null?d:"brand.warning",o=(f=i.fontSize)!=null?f:50,r=(h=i.letterSpacing)!=null?h:0,c=(b=a.tint)!=null?b:"#FFF1C1",l=typeof c=="string"?c:`#${c.toString(16).padStart(6,"0")}`,u=typeof e.loading_text_scale=="number"?e.loading_text_scale:St.loading_text_scale;return{fontFamily:oe(s),fontSize:Math.round(o*u),fontWeight:re(s),fill:l,align:(m=i.align)!=null?m:"center",letterSpacing:r}}syncConfig(e){var i,a,s;let n={...St,...(a=e!=null?e:(i=this.activeConfig.engine)==null?void 0:i.splash)!=null?a:{}};if(this.splashConfig=n,this.splashEnabled=n.enabled!==!1,this.loadingBlurEnabled=n.loading_blur!==!1,this.loadingBlurStrength=typeof n.loading_blur_strength=="number"?n.loading_blur_strength:8,this.loadingOverlayAlpha=typeof n.loading_overlay_alpha=="number"?n.loading_overlay_alpha:.35,this.splashTitle.text=n.title,this.splashTitle.style.fontFamily=n.font_family,this.splashTitle.style.fontSize=n.title_size,this.splashTitle.style.fill=n.title_color,this.splashSubtitle.text=n.subtitle,this.splashSubtitle.style.fontFamily=n.font_family,this.splashSubtitle.style.fontSize=n.subtitle_size,this.splashSubtitle.style.fill=n.subtitle_color,this.splashButtonText.text=n.button_label,this.splashButtonText.style.fontFamily=n.font_family,this.splashButtonText.style.fontSize=Math.round(n.subtitle_size+2),this.splashButtonText.style.fill=n.button_text,this.loadingText){let o=this.resolveLoadingTextStyle(n);this.loadingText.text=(s=n.loading_text)!=null?s:St.loading_text,this.loadingText.style.fontFamily=o.fontFamily,this.loadingText.style.fontSize=o.fontSize,this.loadingText.style.fontWeight=o.fontWeight,this.loadingText.style.fill=o.fill,this.loadingText.style.align=o.align,this.loadingText.style.letterSpacing=o.letterSpacing}}updateLayout(e,n){this.updateSplashLayout(e,n),this.loadingBg&&this.updateLoadingLayout()}updateSplashLayout(e,n){this.splashBg.clear().rect(0,0,e,n).fill({color:Number.parseInt(this.splashConfig.background_color.replace("#",""),16),alpha:this.splashConfig.background_alpha});let i=e/2,a=n/2;this.splashTitle.position.set(i,a-48),this.splashSubtitle.position.set(i,a-16);let s=this.splashConfig.button_width,o=this.splashConfig.button_height,r=this.splashConfig.button_radius;this.splashButton.clear().roundRect(-s/2,-o/2,s,o,r).fill({color:Number.parseInt(this.splashConfig.button_bg.replace("#",""),16),alpha:1}),this.splashButton.position.set(i,a+32),this.splashButtonText.position.set(0,0)}updateLoadingLayout(){var i,a;let{width:e,height:n}=this.app.renderer;(i=this.loadingBg)==null||i.clear().rect(0,0,e,n).fill({color:0,alpha:this.loadingOverlayAlpha}),(a=this.loadingText)==null||a.position.set(e/2,n/2)}show(){this.syncConfig(),this.splashEnabled&&(this.updateSplashLayout(this.app.renderer.width,this.app.renderer.height),this.splashLayer.visible=!0)}hide(){this.splashLayer.visible=!1}startLoadingAnimation(){this.tickLoadingHandler=e=>{let n=e.deltaTime;this.loadingTime+=n,this.loadingText&&(this.loadingText.alpha=.6+Math.sin(this.loadingTime*.08)*.4)},this.app.ticker.add(this.tickLoadingHandler)}stopLoadingAnimation(){this.tickLoadingHandler&&(this.app.ticker.remove(this.tickLoadingHandler),this.tickLoadingHandler=null)}destroyLoadingLayer(){this.stopLoadingAnimation(),this.loadingLayer.destroy({children:!0}),this.loadingText=null,this.loadingBg=null}applyLoadingBlur(e){var n;if(this.loadingBlurEnabled&&e){let i=new X.BlurFilter(this.loadingBlurStrength),a=(n=e.filters)!=null?n:null;return e.filters=[...a!=null?a:[],i],a}return null}removeLoadingBlur(e,n){e&&(n?e.filters=n:e.filters=null)}setupWindowGlobals(){if(typeof window=="undefined")return;let e=window;if(e.__updateSplashLayout=(n,i)=>{this.loadingBg&&this.updateLoadingLayout(),this.updateSplashLayout(n,i)},e.__previewShowSplash=()=>this.show(),e.__previewHideSplash=()=>this.hide(),e.__previewUpdateSplash=()=>{this.syncConfig(),this.loadingBg&&this.updateLoadingLayout(),this.updateSplashLayout(this.app.renderer.width,this.app.renderer.height),this.splashEnabled||(this.splashLayer.visible=!1)},!e.__splashScreenListener){let n=i=>{var r;let{width:a,height:s}=(r=i==null?void 0:i.detail)!=null?r:{};if(typeof a!="number"||typeof s!="number")return;let o=window.__updateSplashLayout;typeof o=="function"&&o(a,s)};e.__splashScreenListener=n,window.addEventListener("handler-preview:screen",n)}}getSplashButton(){return this.splashButton}shouldShowOnStart(){return this.splashEnabled&&this.splashConfig.show_on_start}destroy(){this.stopLoadingAnimation(),this.loadingLayer.destroy({children:!0}),this.splashLayer.destroy({children:!0})}};var sn=require("pixi.js");function Na(t,e,n){var g,p,d,f;let i=e.objects.get("hand_tutorial_1")||e.objects.get("hand_1")||Array.from(e.objects.values()).find(h=>{var b;return((b=h==null?void 0:h.identity)==null?void 0:b.id)==="hand.tutorial"}),a=((g=i==null?void 0:i.gameplay)==null?void 0:g.tuning)||{},s=(i==null?void 0:i.render)||{},o=(i==null?void 0:i.transform)||{},r=new sn.Sprite(t),c=s==null?void 0:s.anchor;c&&typeof c.x=="number"&&typeof c.y=="number"?r.anchor.set(c.x,c.y):r.anchor.set(.5),r.alpha=0;let l=(p=a.hand_scale_multiplier)!=null?p:2.5,u=(d=o.scale)!=null?d:.1875;return r.scale.set(u*l),r.zIndex=(f=s.z_index)!=null?f:99999,r}function $a(t){var h,b,m,y,_,C,v,I,R,M;let e=t.objects.get("ui_tutorial_1")||t.objects.get("label_1")||Array.from(t.objects.values()).find(w=>{var L;return["ui.tutorial","label.warning"].includes((L=w==null?void 0:w.identity)==null?void 0:L.id)}),n=e==null?void 0:e.ui,i=(e==null?void 0:e.render)||{},a=((h=t.engine.runtime)==null?void 0:h.ui_styles)||{},s=((b=t.engine.runtime)==null?void 0:b.ui)||{},o=(n==null?void 0:n.text)||s.tutorial_label||s.label_text||"CLEAN!",r=(n==null?void 0:n.font)||"brand.warning",c=(n==null?void 0:n.fontSize)||a.label_font_size||52,l=(y=n==null?void 0:n.letterSpacing)!=null?y:(m=a.label_letter_spacing)!=null?m:-1,u=(n==null?void 0:n.align)||"center",g=i.tint,p=typeof g=="string"?g:g?`#${g.toString(16).padStart(6,"0")}`:a.label_fill||"#FFF1C1",d=new sn.Text({text:o,style:{fontFamily:oe(r),fontSize:c,fontWeight:re(r),fill:p,align:u,letterSpacing:l,stroke:{color:a.label_stroke||"#8B0000",width:2},dropShadow:{color:a.label_shadow_color||"#000000",alpha:(_=a.label_shadow_alpha)!=null?_:.8,angle:(C=a.label_shadow_angle)!=null?C:0,blur:(v=a.label_shadow_blur)!=null?v:4,distance:(I=a.label_shadow_distance)!=null?I:2}}}),f=i==null?void 0:i.anchor;return f&&typeof f.x=="number"&&typeof f.y=="number"?d.anchor.set(f.x,f.y):d.anchor.set(.5,.5),d.alpha=(R=i.alpha)!=null?R:0,d.visible=(M=i.visible)!=null?M:!0,d}function Ga(t,e,n,i,a){var c,l,u,g,p,d,f,h,b,m,y,_,C,v,I,R,M;let s=a.objects.get("hand_tutorial_1")||a.objects.get("hand_1")||Array.from(a.objects.values()).find(w=>{var L;return((L=w==null?void 0:w.identity)==null?void 0:L.id)==="hand.tutorial"}),o=((c=s==null?void 0:s.gameplay)==null?void 0:c.tuning)||{},r=(s==null?void 0:s.transform)||{};if(!i){let w=(l=o.animation_duration)!=null?l:1.5,L=n%w/w,G=L<.5?2*L*L:-1+(4-2*L)*L,E=(f=(d=(p=(u=r.position)==null?void 0:u.x)!=null?p:(g=r.offset)==null?void 0:g.x)!=null?d:o.start_x_offset)!=null?f:0,j=(_=(y=(m=(h=r.position)==null?void 0:h.y)!=null?m:(b=r.offset)==null?void 0:b.y)!=null?y:o.start_y_offset)!=null?_:0,N=(C=o.x_offset)!=null?C:0,H=(v=o.y_offset)!=null?v:0,q=(I=o.animation_range)!=null?I:40,pe=q*.7,D=q,K=e.x+E+N+pe,J=e.y+j+H+D,$=K+pe,Y=J+D;t.x=K+($-K)*G,t.y=J+(Y-J)*G;let $e=(R=r.scale)!=null?R:.1875,ke=(M=o.hand_scale_multiplier)!=null?M:2.5;t.scale.set($e*ke)}}var Et=null;function Js(){return Et||(typeof window!="undefined"&&window.lottie?Et=window.lottie:(console.warn("[LottieOverlay] lottie-web is not available globally. Make sure it is loaded before using Lottie animations."),Et=null)),Et}function Jt(t){Et=t}function qa(t,e,n,i){var v,I,R,M,w,L,G,E,j,N,H,q,pe;let a=n.objects.get(t);if(!a)return console.warn(`[LottieOverlay] Object config not found: ${t}`),null;let s=((v=a.effects)==null?void 0:v.lottie)||{},o=a.transform||{},r=a.render||{};if(s.enabled===!1||r.visible===!1)return null;let c=i[t];if(!c||typeof c!="object")return console.warn(`[LottieOverlay] Asset data not found or invalid for: ${t}`),null;let l=Js();if(!l)return console.warn(`[LottieOverlay] lottie-web is not available. Cannot play animation: ${t}`),null;let u=(I=s.width)!=null?I:300,g=(R=s.height)!=null?R:300,p=(M=o.scale)!=null?M:1,d=(L=(w=o.position)==null?void 0:w.x)!=null?L:0,f=(E=(G=o.position)==null?void 0:G.y)!=null?E:0,h=(j=o.rotation)!=null?j:0,b=(N=r.z_index)!=null?N:100,m=(H=r.alpha)!=null?H:1,y=document.createElement("div");y.style.cssText=`
18
18
  position: absolute;
19
- top: calc(50% + ${m}px);
19
+ top: calc(50% + ${f}px);
20
20
  left: calc(50% + ${d}px);
21
- transform: translate(-50%, -50%) scale(${u}) rotate(${h}deg);
22
- width: ${p}px;
23
- height: ${f}px;
21
+ transform: translate(-50%, -50%) scale(${p}) rotate(${h}deg);
22
+ width: ${u}px;
23
+ height: ${g}px;
24
24
  pointer-events: none;
25
- z-index: ${g};
26
- opacity: ${b};
27
- `,e.appendChild(w);let S=l.loadAnimation({container:w,renderer:i.renderer||"svg",loop:(Y=i.loop)!=null?Y:!1,autoplay:(Pe=i.autoplay)!=null?Pe:!0,animationData:c});i.speed!==void 0&&S.setSpeed(i.speed);let T=()=>{S.destroy(),w.parentNode&&w.parentNode.removeChild(w)};return i.loop||S.addEventListener("complete",T),{animation:S,cleanup:T}}var ee=require("pixi.js");var X=class{static get(e){var n;return(n=this.store.get(e))==null?void 0:n.data}static set(e,n){this.store.set(e,{data:n})}static has(e){return this.store.has(e)}static clear(){this.store.clear()}};X.store=new Map;var Di=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined";console.log(`[AssetLoader] MODULE LOADED - __BUILD_MODE__: ${Di}`);var _e={},ut=null;async function Oi(){if(console.log(`[AssetLoader] getInlineAssets() called - __BUILD_MODE__: ${typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined"}`),Object.keys(_e).length>0)return console.log("[AssetLoader] Returning cached inline assets:",Object.keys(_e)),_e;if(!ut){let e=typeof window!="undefined"?new URL("inline-assets.js",window.location.href).href:"./inline-assets.js";console.log("[AssetLoader] Loading inline assets from:",e),ut=(async()=>{try{try{let i=await import(e+"?t="+Date.now());if(i.INLINE_ASSETS)return console.log("[AssetLoader] Loaded INLINE_ASSETS via ES module:",Object.keys(i.INLINE_ASSETS)),i.INLINE_ASSETS}catch(i){console.warn("[AssetLoader] ES module import failed, trying text parse:",i)}let n=await fetch(e);if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);let a=await n.text();console.log("[AssetLoader] Received JS code, length:",a.length);let s=a.match(/export\s+const\s+INLINE_ASSETS\s*=\s*({[\s\S]*?});?\s*$/m);if(s)try{let i=s[1];console.log("[AssetLoader] Found INLINE_ASSETS export, parsing...");let o=new Function("return "+i)();return console.log("[AssetLoader] Parsed inline assets:",Object.keys(o)),o}catch(i){return console.warn("[AssetLoader] Failed to parse inline assets:",i),{}}else return console.warn("[AssetLoader] INLINE_ASSETS export not found in response"),console.log("[AssetLoader] JS code preview:",a.substring(0,500)),{}}catch(n){return console.warn("[AssetLoader] Failed to load inline assets:",n),{}}})()}return _e=await ut,console.log("[AssetLoader] Final inline assets cache:",Object.keys(_e)),_e}var wa=new Map;function pt(t){return t===null||typeof t!="object"||(Object.freeze(t),Object.values(t).forEach(e=>pt(e))),t}function Ci(t=64,e=64,n=16711680){let a=document.createElement("canvas");a.width=t,a.height=e;let s=a.getContext("2d");return s.fillStyle=`#${n.toString(16).padStart(6,"0")}`,s.fillRect(0,0,t,e),s.strokeStyle="#000",s.strokeRect(0,0,t,e),s.fillStyle="#fff",s.font="10px sans-serif",s.textAlign="center",s.fillText("MISSING",t/2,e/2),ee.Texture.from(a)}function je(t,e){wa.set(t,e)}var we=class{static async load(e,n,a){let s=X.get(e);if(s!==void 0)return s;let i=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined";console.log(`[AssetLoader] Loading asset: ${e}, type: ${n.type}, __BUILD_MODE__: ${i}`);let r=(await Oi())[e];if(console.log("[AssetLoader] Inline data for",e,":",r?"FOUND":"NOT FOUND"),i==="publish"&&(console.log("[AssetLoader] \u26A0\uFE0F PUBLISH MODE DETECTED - inline assets are MANDATORY"),!r))throw new Error(`[AssetLoader] PUBLISH MODE: Inline asset required but NOT FOUND for object: ${e}, path: ${n.path}`);let c=wa.get(n.type);if(c)try{let l=await c(n.path,r,e,a);return X.set(e,l),l}catch(l){return this.handleFailure(e,n.type,l)}try{let l;switch(n.type){case"image":l=await this.loadImage(n.path,r);break;case"json":l=await this.loadJSON(n.path,r),l=pt(l);break;default:throw new Error(`Unknown asset type: ${n.type}`)}return X.set(e,l),l}catch(l){return this.handleFailure(e,n.type,l)}}static async loadImage(e,n){let a=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",s=a==="publish";if(console.log(`[AssetLoader] loadImage - __BUILD_MODE__: ${a}, isPublishMode: ${s}, inlineData: ${n?"EXISTS":"MISSING"}`),s){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!n)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for object. Path: ${e}`);if(!n.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI, got: ${n.substring(0,50)}...`);try{return await ee.Assets.load(n)}catch(i){throw console.error("[AssetLoader] Failed to load texture from data URI:",i),i}}if(n&&n.startsWith("data:"))try{return await ee.Assets.load(n)}catch(i){return console.error("[AssetLoader] Failed to load texture from data URI, falling back to path:",i),await ee.Assets.load(e)}return await ee.Assets.load(e)}static async loadJSON(e,n){let a=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",s=a==="publish";if(console.log(`[AssetLoader] loadJSON - __BUILD_MODE__: ${a}, isPublishMode: ${s}, inlineData: ${n?"EXISTS":"MISSING"}`),s){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!n)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${e}`);if(n.startsWith("data:")){let o=atob(n.split(",")[1]);return JSON.parse(o)}return JSON.parse(n)}if(n){if(n.startsWith("data:")){let o=atob(n.split(",")[1]);return JSON.parse(o)}return JSON.parse(n)}let i=await fetch(e);if(!i.ok)throw new Error(`JSON fetch failed: ${e}`);return i.json()}static handleFailure(e,n,a){if(typeof __BUILD_MODE__!="undefined"&&__BUILD_MODE__==="dev"){let i=n==="image"?Ci():pt({__placeholder:!0,type:n});return X.set(e,i),i}throw a}};je("image",async(t,e)=>{let n=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",a=n==="publish";if(console.log(`[AssetLoader] registerType('image') - __BUILD_MODE__: ${n}, isPublishMode: ${a}, inlineData: ${e?"EXISTS":"MISSING"}`),a){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!e)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${t}`);if(!e.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI, got: ${e.substring(0,50)}...`);return ee.Assets.load(e)}return ee.Assets.load(e||t)});je("json",async(t,e)=>{let n=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",a=n==="publish";if(console.log(`[AssetLoader] registerType('json') - __BUILD_MODE__: ${n}, isPublishMode: ${a}, inlineData: ${e?"EXISTS":"MISSING"}`),a){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!e)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${t}`);return e.startsWith("data:")?JSON.parse(atob(e.split(",")[1])):JSON.parse(e)}if(e)return e.startsWith("data:")?JSON.parse(atob(e.split(",")[1])):JSON.parse(e);let s=await fetch(t);if(!s.ok)throw new Error(`JSON fetch failed: ${t}`);return s.json()});var Ce=require("pixi.js");var Qe=class{static async create(e,n,a){var c,l,p,f,u,d;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined"}`);let i=(c=n==null?void 0:n.render)==null?void 0:c.asset;if(!i){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let m=new Ce.Container;return this.applyTransform(m,n==null?void 0:n.transform),m}console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, type: ${i.type}, path: ${i.path}`);let o=await we.load(e,i,a);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(l=o==null?void 0:o.constructor)==null?void 0:l.name}`);let r;if(i.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",o,"for object:",e),r=new Ce.Sprite(o),console.log("[ObjectFactory] Created object:",r,"type:",(p=r==null?void 0:r.constructor)==null?void 0:p.name),this.applyTransform(r,n==null?void 0:n.transform);else if(i.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(f=o==null?void 0:o.constructor)==null?void 0:f.name,o),o&&(((u=o.constructor)==null?void 0:u.name)==="Container"||o instanceof Ce.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let m=[i.path,`/assets/${i.path}`,`assets/${i.path}`,`../assets/${i.path}`],h=!1;for(let g of m)try{let b=await fetch(g);if(b.ok){r=await b.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",g,"type:",(d=r==null?void 0:r.constructor)==null?void 0:d.name),h=!0;break}}catch{continue}h||(console.error("[ObjectFactory] Failed to reload JSON from any path"),r=o)}else r=o;else r=o,r&&typeof r=="object"&&("x"in r||"position"in r)&&this.applyTransform(r,n==null?void 0:n.transform);return r}static applyTransform(e,n){var a,s,i,o;!n||!e||(n.position&&("x"in e&&"y"in e?(e.x=(a=n.position.x)!=null?a:0,e.y=(s=n.position.y)!=null?s:0):"position"in e&&e.position&&e.position.set((i=n.position.x)!=null?i:0,(o=n.position.y)!=null?o:0)),n.scale!==void 0&&"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(n.scale):e.scale=n.scale),n.rotation!==void 0&&"rotation"in e&&(e.rotation=n.rotation),n.anchor&&"anchor"in e&&e.anchor&&Array.isArray(n.anchor)&&("set"in e.anchor?e.anchor.set(n.anchor[0],n.anchor[1]):(e.anchor.x=n.anchor[0],e.anchor.y=n.anchor[1])))}};0&&(module.exports={AssetCache,AssetLoader,GameObject,GameObjectManager,ObjectFactory,Renderer,Transform,animateHandClick,animatePanelEntrance,createEndGamePanel,createHandTutorial,createPixiBase,createTutorialLabel,getRegisteredFontIds,playLottieOverlay,registerFont,registerType,resolveFont,resolveFontWeight,setLottieInstance,updateHandAnimation});
25
+ z-index: ${b};
26
+ opacity: ${m};
27
+ `,e.appendChild(y);let _=l.loadAnimation({container:y,renderer:s.renderer||"svg",loop:(q=s.loop)!=null?q:!1,autoplay:(pe=s.autoplay)!=null?pe:!0,animationData:c});s.speed!==void 0&&_.setSpeed(s.speed);let C=()=>{_.destroy(),y.parentNode&&y.parentNode.removeChild(y)};return s.loop||_.addEventListener("complete",C),{animation:_,cleanup:C}}var Ee=require("pixi.js");var ge=class{static get(e){var n;return(n=this.store.get(e))==null?void 0:n.data}static set(e,n){this.store.set(e,{data:n})}static has(e){return this.store.has(e)}static clear(){this.store.clear()}};ge.store=new Map;function Qs(){var t,e;try{let n=typeof window!="undefined"&&(document.querySelector('script[src*="inline-assets.js"]')||((e=(t=document.querySelector("script"))==null?void 0:t.textContent)==null?void 0:e.includes("inline-assets.js"))||window.INLINE_ASSETS),i=typeof window!="undefined"&&document.querySelector('link[href*="assets/"], script[src*="assets/"]');return!!(n&&!i)}catch{return!1}}async function Zs(){try{if(typeof window!="undefined"){let t=await fetch("./build-settings.json");if(t.ok){let e=await t.json();return console.log("[AssetLoader] Loaded build settings:",e),e}}}catch{}return null}function eo(){try{if(typeof window!="undefined"){let t=new XMLHttpRequest;if(t.open("GET","./build-settings.json",!1),t.send(),t.status===200&&t.responseText){let e=JSON.parse(t.responseText);return console.log("[AssetLoader] Loaded build settings (sync):",e),e}}}catch{}return null}var Ua=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",Ya=Qs(),ze=typeof window!="undefined"?window.__BUILD_SETTINGS__:null,k=Ya?"publish":Ua,he=ze==null?void 0:ze.assetsInlined;ze!=null&&ze.buildMode&&(k=ze.buildMode,console.log(`[AssetLoader] Build mode overridden by inline settings: ${k}`));var Me=eo();Me!=null&&Me.buildMode&&(k=Me.buildMode,console.log(`[AssetLoader] Build mode overridden by sync settings: ${k}`));(Me==null?void 0:Me.assetsInlined)!==void 0&&(he=Me.assetsInlined);Zs().then(t=>{t!=null&&t.buildMode&&t.buildMode!==k&&(k=t.buildMode,console.log(`[AssetLoader] Build mode overridden by settings: ${k}`)),(t==null?void 0:t.assetsInlined)!==void 0&&(he=t.assetsInlined)}).catch(()=>{});console.log(`[AssetLoader] MODULE LOADED - Compile: ${Ua}, Runtime: ${Ya?"publish":"dev"}, Effective: ${k}`);var Se={},zn=null;async function to(){if(console.log(`[AssetLoader] getInlineAssets() called - Effective mode: ${k}`),Object.keys(Se).length>0)return console.log("[AssetLoader] Returning cached inline assets:",Object.keys(Se)),Se;if(typeof window!="undefined"&&window.INLINE_ASSETS)return console.log("[AssetLoader] Using pre-loaded INLINE_ASSETS from window:",Object.keys(window.INLINE_ASSETS)),Se={...window.INLINE_ASSETS},Se;if(!(k==="publish"&&he!==!1))return console.log("[AssetLoader] Inline assets disabled for this build mode."),Se;if(!zn){let e=typeof window!="undefined"?new URL("inline-assets.js",window.location.href).href:"./inline-assets.js";console.log("[AssetLoader] Loading inline assets from:",e),zn=(async()=>{try{try{let s=await import(e+"?t="+Date.now());if(s.INLINE_ASSETS)return console.log("[AssetLoader] Loaded INLINE_ASSETS via ES module:",Object.keys(s.INLINE_ASSETS)),s.INLINE_ASSETS}catch(s){console.warn("[AssetLoader] ES module import failed, trying text parse:",s)}let n=await fetch(e);if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);let i=await n.text();console.log("[AssetLoader] Received JS code, length:",i.length);let a=i.match(/export\s+const\s+INLINE_ASSETS\s*=\s*({[\s\S]*?});?\s*$/m);if(a)try{let s=a[1];console.log("[AssetLoader] Found INLINE_ASSETS export, parsing...");let o=new Function("return "+s)();return console.log("[AssetLoader] Parsed inline assets:",Object.keys(o)),o}catch(s){return console.warn("[AssetLoader] Failed to parse inline assets:",s),{}}else return console.warn("[AssetLoader] INLINE_ASSETS export not found in response"),console.log("[AssetLoader] JS code preview:",i.substring(0,500)),{}}catch(n){return console.warn("[AssetLoader] Failed to load inline assets:",n),{}}})()}return Se=await zn,console.log("[AssetLoader] Final inline assets cache:",Object.keys(Se)),Se}var Wa=new Map;function Fn(t){return t===null||typeof t!="object"||(Object.freeze(t),Object.values(t).forEach(e=>Fn(e))),t}function no(t=64,e=64,n=16711680){let i=document.createElement("canvas");i.width=t,i.height=e;let a=i.getContext("2d");return a.fillStyle=`#${n.toString(16).padStart(6,"0")}`,a.fillRect(0,0,t,e),a.strokeStyle="#000",a.strokeRect(0,0,t,e),a.fillStyle="#fff",a.font="10px sans-serif",a.textAlign="center",a.fillText("MISSING",t/2,e/2),Ee.Texture.from(i)}function on(t,e){Wa.set(t,e)}var Ze=class{static async load(e,n,i){let a=ge.get(e);if(a!==void 0)return a;console.log(`[AssetLoader] Loading asset: ${e}, type: ${n.type}, Effective mode: ${k}`),console.log(`[AssetLoader] Window defined: ${typeof window!="undefined"}, INLINE_ASSETS exists: ${!!(typeof window!="undefined"&&window.INLINE_ASSETS)}, keys: ${typeof window!="undefined"&&window.INLINE_ASSETS?Object.keys(window.INLINE_ASSETS).length:"N/A"}`);let s=await to(),o=s[e];if(!o&&n.path){let l=n.path.split("/");if(l.length>=2){let u=l[l.length-1].split(".")[0],g=l[0],p=[`${u}.layer`,`${u}.player`,`${u}.tutorial`,`effects.${u}`,`ui.endgame.${u}`,u];for(let d of p)if(s[d]){o=s[d],console.log(`[AssetLoader] Found inline data for ${e} using derived key: ${d}`);break}}}if(console.log("[AssetLoader] Inline data for",e,":",o?"FOUND":"NOT FOUND"),k==="publish"&&he!==!1&&(console.log("[AssetLoader] \u26A0\uFE0F PUBLISH MODE DETECTED - inline assets are MANDATORY"),!o))throw new Error(`[AssetLoader] PUBLISH MODE: Inline asset required but NOT FOUND for object: ${e}, path: ${n.path}`);let c=Wa.get(n.type);if(c)try{let l=await c(n.path,o,e,i);return ge.set(e,l),l}catch(l){return this.handleFailure(e,n.type,l)}try{let l;switch(n.type){case"image":l=await this.loadImage(n.path,o);break;case"json":l=await this.loadJSON(n.path,o),l=Fn(l);break;default:throw new Error(`Unknown asset type: ${n.type}`)}return ge.set(e,l),l}catch(l){return this.handleFailure(e,n.type,l)}}static async loadImage(e,n){let i=k==="publish",a=i&&he!==!1;if(console.log(`[AssetLoader] loadImage - Effective mode: ${k}, isPublishMode: ${i}, inlineData: ${n?"EXISTS":"MISSING"}`),a){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!n)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for object. Path: ${e}`);if(!n.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI, got: ${n.substring(0,50)}...`);try{return await Ee.Assets.load(n)}catch(s){throw console.error("[AssetLoader] Failed to load texture from data URI:",s),s}}if(n&&n.startsWith("data:"))try{return await Ee.Assets.load(n)}catch(s){return console.error("[AssetLoader] Failed to load texture from data URI, falling back to path:",s),await Ee.Assets.load(e)}return await Ee.Assets.load(e)}static async loadJSON(e,n){let i=k==="publish",a=i&&he!==!1;if(console.log(`[AssetLoader] loadJSON - Effective mode: ${k}, isPublishMode: ${i}, inlineData: ${n?"EXISTS":"MISSING"}`),a){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!n)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${e}`);if(n.startsWith("data:")){let o=atob(n.split(",")[1]);return JSON.parse(o)}return JSON.parse(n)}if(n){if(n.startsWith("data:")){let o=atob(n.split(",")[1]);return JSON.parse(o)}return JSON.parse(n)}let s=await fetch(e);if(!s.ok)throw new Error(`JSON fetch failed: ${e}`);return s.json()}static handleFailure(e,n,i){if(k==="dev"){let s=n==="image"?no():Fn({__placeholder:!0,type:n});return ge.set(e,s),s}throw i}};on("image",async(t,e)=>{let n=k==="publish",i=n&&he!==!1,a=k==="brand",s=n&&he===!1;if(console.log(`[AssetLoader] registerType('image') - Effective mode: ${k}, isPublishMode: ${n}, isBrandMode: ${a}, inlineData: ${e?"EXISTS":"MISSING"}`),i){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!e)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${t}`);if(!e.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI, got: ${e.substring(0,50)}...`);return Ee.Assets.load(e)}let o=t;return(a||s)&&t&&!t.startsWith("assets/")&&(typeof window!="undefined"&&!document.querySelector('link[href*="assets/"], script[src*="assets/"]')&&!document.querySelector('link[href*="configs/"], script[src*="configs/"]')?(o=t,console.log(`[AssetLoader] BRAND MODE: flattened build, using path "${t}" as-is`)):(o=`assets/${t}`,console.log(`[AssetLoader] BRAND MODE: transformed path "${t}" -> "${o}"`))),Ee.Assets.load(e||o)});on("json",async(t,e)=>{let n=k==="publish",i=n&&he!==!1,a=k==="brand",s=n&&he===!1;if(console.log(`[AssetLoader] registerType('json') - Effective mode: ${k}, isPublishMode: ${n}, isBrandMode: ${a}, inlineData: ${e?"EXISTS":"MISSING"}`),i){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!e)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${t}`);return e.startsWith("data:")?JSON.parse(atob(e.split(",")[1])):JSON.parse(e)}let o=t;if((a||s)&&t&&!t.startsWith("assets/")&&(typeof window!="undefined"&&!document.querySelector('link[href*="assets/"], script[src*="assets/"]')&&!document.querySelector('link[href*="configs/"], script[src*="configs/"]')?(o=t,console.log(`[AssetLoader] BRAND MODE: flattened build, using path "${t}" as-is`)):(o=`assets/${t}`,console.log(`[AssetLoader] BRAND MODE: transformed path "${t}" -> "${o}"`))),e)return e.startsWith("data:")?JSON.parse(atob(e.split(",")[1])):JSON.parse(e);let r=await fetch(o);if(!r.ok)throw new Error(`JSON fetch failed: ${t}`);return r.json()});var _t=require("pixi.js");var io=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",Nn=io;if(typeof window!="undefined")try{let t=new XMLHttpRequest;if(t.open("GET","./build-settings.json",!1),t.send(),t.status===200&&t.responseText){let e=JSON.parse(t.responseText);e!=null&&e.buildMode&&(Nn=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${Nn}`))}}catch{}var Fe=class{static async create(e,n,i){var r,c,l,u,g,p;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${Nn}`);let a=(r=n==null?void 0:n.render)==null?void 0:r.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let d=new _t.Container;return this.applyTransform(d,n==null?void 0:n.transform),d}console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, type: ${a.type}, path: ${a.path}`);let s=await Ze.load(e,a,i);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(c=s==null?void 0:s.constructor)==null?void 0:c.name}`);let o;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",s,"for object:",e),o=new _t.Sprite(s),console.log("[ObjectFactory] Created object:",o,"type:",(l=o==null?void 0:o.constructor)==null?void 0:l.name),this.applyTransform(o,n==null?void 0:n.transform);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(u=s==null?void 0:s.constructor)==null?void 0:u.name,s),s&&(((g=s.constructor)==null?void 0:g.name)==="Container"||s instanceof _t.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let d=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],f=!1;for(let h of d)try{let b=await fetch(h);if(b.ok){o=await b.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",h,"type:",(p=o==null?void 0:o.constructor)==null?void 0:p.name),f=!0;break}}catch{continue}f||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=s)}else o=s;else o=s,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,n==null?void 0:n.transform);return o}static applyTransform(e,n){var i,a,s,o;!n||!e||(n.position&&("x"in e&&"y"in e?(e.x=(i=n.position.x)!=null?i:0,e.y=(a=n.position.y)!=null?a:0):"position"in e&&e.position&&e.position.set((s=n.position.x)!=null?s:0,(o=n.position.y)!=null?o:0)),n.scale!==void 0&&"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(n.scale):e.scale=n.scale),n.rotation!==void 0&&"rotation"in e&&(e.rotation=n.rotation),n.anchor&&"anchor"in e&&e.anchor&&Array.isArray(n.anchor)&&("set"in e.anchor?e.anchor.set(n.anchor[0],n.anchor[1]):(e.anchor.x=n.anchor[0],e.anchor.y=n.anchor[1])))}};var rn=class{constructor(e,n,i){this.systems=[];this.totalTime=0;this.root=e,this.config=n,this.destinationUrl=i}async init(e){let{app:n,stage:i}=await nn(this.root,{background:e.background_color,text:e.text_color,primary:e.cta_background,cta_text:e.cta_text});this.app=n,this.stage=i,this.gameObjectManager=new Je(this.config),this.stage.eventMode="passive",this.stage.interactive=!1,this.stage.interactiveChildren=!0,this.stage.sortableChildren=!0;let a={app:this.app,stage:this.stage,config:this.config,gameObjectManager:this.gameObjectManager,destinationUrl:this.destinationUrl,root:this.root,engine:this};for(let s of this.systems)s.setContext(a),s.init&&await s.init();return{app:this.app,gameObjectManager:this.gameObjectManager}}registerSystems(e){this.systems.push(...e)}async start(){for(let e of this.systems)e.onStart&&await e.onStart();this.app.ticker.add(this.update.bind(this)),window.addEventListener("handler-preview:screen",e=>{let{width:n,height:i}=e.detail;this.resize(n,i)})}update(e){let n=e.deltaTime/60;this.totalTime+=n;for(let i of this.systems)i.update&&i.update(n,this.totalTime)}resize(e,n){for(let i of this.systems)i.onResize&&i.onResize(e,n)}updateConfig(e){this.config=e;for(let n of this.systems)n.context.config=e,n.onConfigUpdate&&n.onConfigUpdate(e)}destroy(){for(let e of this.systems)e.onDestroy&&e.onDestroy();this.app.ticker.remove(this.update.bind(this)),this.app.destroy(!0,{children:!0,texture:!1})}getApp(){return this.app}getGameObjectManager(){return this.gameObjectManager}getTotalTime(){return this.totalTime}getSystem(e){let n=this.systems.find(i=>i instanceof e);if(!n)throw new Error(`System ${e.name} not found!`);return n}};var et=class{setContext(e){this.context=e}};var tt=class{constructor(){this.config=null}init(e){this.config=e}get(e){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return this.config.objects.get(e)}getAllIds(){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return Array.from(this.config.objects.keys())}has(e){return this.config?this.config.objects.has(e):!1}};var Va=Ln(require("pixi.js")),Xa=Va;typeof window!="undefined"&&(window.__basePixi=Va);var $n=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new tt}init(e,n){this.registry.init(e),this.app=n}updateConfig(e){this.registry.init(e),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let n=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));if(n.length===0)return;let i=async a=>{a.length&&(console.log("[Assets] Loading objects:",a),await Promise.all(a.map(async s=>{var r;let o=this.registry.get(s);if(!o){console.warn("[Assets] No config found for object:",s);return}try{let c=await Fe.create(s,o,this.app);this.instanceCache.set(s,c),console.log("[Assets] Loaded object:",s,(r=c==null?void 0:c.constructor)==null?void 0:r.name)}catch(c){console.error("[Assets] Failed to load object:",s,c)}})))};return this.readyPromise=(async()=>{await i(n);let a=this.registry.getAllIds().filter(s=>!this.instanceCache.has(s));a.length>0&&(console.warn("[Assets] Retrying missing assets:",a),await i(a)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(e){let n=this.registry.get(e);if(n){let i=await Fe.create(e,n,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},Ka=new $n,_e=new Proxy(Ka,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});function ln(t,e){Ka.init(t,e)}var nt=require("pixi.js");var cn=class extends et{constructor(){super(...arguments);this.splashScreen=null}async init(){ln(this.context.config,this.context.app),this.splashScreen=new Qe(this.context.app,this.context.stage,this.context.config),this.splashScreen.getSplashButton().on("pointerdown",()=>this.splashScreen.hide());let n=null;try{await _e.reloadObject("background_1");let i=_e.background_1;i&&(i instanceof nt.Sprite||i instanceof nt.Graphics)&&(i.parent||this.context.stage.addChildAt(i,0),n=this.splashScreen.applyLoadingBlur(i))}catch(i){console.warn("[AssetSystem] Background preload failed:",i)}if(await _e.ready(),this.splashScreen){this.splashScreen.stopLoadingAnimation(),this.splashScreen.destroyLoadingLayer();let i=_e.background_1;i&&(i instanceof nt.Sprite||i instanceof nt.Graphics)&&this.splashScreen.removeLoadingBlur(i,n)}console.log("[AssetSystem] All assets preloaded and ready")}async onStart(){this.splashScreen&&this.splashScreen.shouldShowOnStart()&&this.splashScreen.show()}onConfigUpdate(){typeof _e.updateConfig=="function"&&_e.updateConfig(this.context.config)}};var gn=require("pixi.js"),Ce={width:400,height:600,designWidth:400,scaleFactor:1},Lt={scale:1,position:1},hn=[];function ao(t,e,n,i,a,s,o){hn.push({element:t,originalScale:s,positionHelper:e,heightPercent:a}),e(t,n,i,a,s,o,!1)}function so(){hn.forEach(({element:t,originalScale:e,positionHelper:n,heightPercent:i})=>{let a=e*Ce.scaleFactor;n(t,Ce.width,Ce.height,i,a,!0,!1)})}function Ja(){hn.length=0,console.log("[LAYOUT] Cleared all responsive elements")}function un(t,e){console.log(`[SCREEN] updateScreenState called: ${t}x${e}`),Ce.width=t,Ce.height=e,Ce.scaleFactor=Math.min(t/Ce.designWidth,1.15),Lt.scale=Ce.scaleFactor,Lt.position=1,console.log(`[SCREEN] Global multipliers - scale: ${Lt.scale.toFixed(3)}`),so()}var T={layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03},physics:{rope_length:420,gravity:9.8,friction:.1}};function oo(t,e,n){let i=T[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function ro(){return T}var lo={center:{x:.5,y:.5},"center-center":{x:.5,y:.5},middle:{x:.5,y:.5},"middle-center":{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},"left-center":{x:0,y:.5},"right-center":{x:1,y:.5},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};function dn(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function fn(t,e={x:.5,y:.5}){var n;if(Array.isArray(t))return{x:dn(t[0],e.x),y:dn(t[1],e.y)};if(t&&typeof t=="object"){let i=t;return{x:dn(i.x,e.x),y:dn(i.y,e.y)}}if(typeof t=="string"){let i=t.trim().toLowerCase();return(n=lo[i])!=null?n:e}return e}function bn(t,e,n,i={}){var d,f,h,b,m,y;let a=fn(n),s=(d=i.inset)!=null?d:{},o=(f=i.padding)!=null?f:{x:0,y:0},r=((h=s.left)!=null?h:0)+o.x,c=((b=s.right)!=null?b:0)+o.x,l=((m=s.top)!=null?m:0)+o.y,u=((y=s.bottom)!=null?y:0)+o.y,g=Math.max(0,t-r-c),p=Math.max(0,e-l-u);return{x:r+g*a.x,y:l+p*a.y}}function mn(t,e,n,i={}){var h,b,m,y,_,C;let a=(h=i.inset)!=null?h:{},s=(b=i.padding)!=null?b:{x:0,y:0},o=((m=a.left)!=null?m:0)+s.x,r=((y=a.right)!=null?y:0)+s.x,c=((_=a.top)!=null?_:0)+s.y,l=((C=a.bottom)!=null?C:0)+s.y,u=Math.max(0,t-o-r),g=Math.max(0,e-c-l),p=fn(n,{x:.5,y:.5}),d=Math.min(Math.max(p.x,0),1),f=Math.min(Math.max(p.y,0),1);return{x:o+u*d,y:c+g*f}}function pn(t,e,n,i={}){var u,g,p;if(!t)return;let a=i.positionRatio?mn(e,n,i.positionRatio,{inset:i.inset,padding:i.screenPadding}):bn(e,n,i.anchor,{inset:i.inset,padding:i.screenPadding}),s=(u=i.offset)!=null?u:{x:0,y:0},o=a.x+s.x,r=a.y+s.y;t.anchor&&i.renderAnchor&&t.anchor.set(i.renderAnchor.x,i.renderAnchor.y),ue(t,o,r);let c=(g=i.scale)!=null?g:1,l=(p=i.scaleMultiplier)!=null?p:1;(i.scale!==void 0||i.scaleMultiplier!==void 0)&&fe(t,c*l)}if(typeof window!="undefined"){let t=window.innerWidth,e=window.innerHeight,n=()=>{let i=window.innerWidth,a=window.innerHeight;(i!==t||a!==e)&&(t=i,e=a,un(i,a))};window.addEventListener("resize",n),window.addEventListener("orientationchange",()=>{setTimeout(n,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",n),window.mraid.addEventListener("sizeChange",n)),un(window.innerWidth,window.innerHeight),window.updateDebugConfig=oo,window.getDebugConfig=ro,window.copyConfig=xo,window.applyConfig=Ct,window.applyConfigForRatio=wo,window.positionAtBottom=Qa,window.positionAtTop=po,window.positionAtCenter=go,window.positionAtLeft=ho,window.positionAtRight=fo,window.positionAtBottomLeft=bo,window.positionAtBottomRight=mo,window.positionAtTopLeft=yo,window.positionAtTopRight=vo,window.applyPositionContract=uo,console.log("\u{1F3AE} Debug Config Functions Available:"),console.log("\u2022 updateDebugConfig(category, key, value)"),console.log("\u2022 getDebugConfig()"),console.log("\u2022 copyConfig(presetName)"),console.log("\u2022 applyConfig(config)"),console.log("\u2022 applyConfigForRatio(width, height)"),console.log("\u{1F4CD} Positioning Helpers Available (with scale):"),console.log("\u2022 positionAtBottom(element, w, h, percent, scale)"),console.log("\u2022 positionAtTop(element, w, h, percent, scale)"),console.log("\u2022 positionAtCenter(element, w, h, offsetX, offsetY, scale)"),console.log("\u2022 positionAtLeft/Right(element, w, h, percent, scale)"),console.log("\u2022 Corner positions: BottomLeft/Right, TopLeft/Right (all with scale)"),console.log("\u2022 applyPositionContract(element, w, h, contract)"),console.log("Example: positionAtCenter(mySprite, 400, 600, 0, -50, 1.2)")}function yn(t,e,n=0){return t*e+n}function vn(t,e,n=0){return t*(1-e)+n}function xn(t,e,n=0){return t*e+n}function wn(t,e,n=0){return t*(1-e)+n}function le(t,e=0){return t/2+e}function co(t,e){return t*e}function uo(t,e,n,i){var o,r,c,l,u,g,p,d,f,h,b,m,y,_,C,v,I,R,M,w;let a=0,s=0;switch(i.type){case"top":a=le(e,(r=(o=i.offset)==null?void 0:o.x)!=null?r:0),s=yn(n,i.percent,(l=(c=i.offset)==null?void 0:c.y)!=null?l:0);break;case"bottom":a=le(e,(g=(u=i.offset)==null?void 0:u.x)!=null?g:0),s=vn(n,i.percent,(d=(p=i.offset)==null?void 0:p.y)!=null?d:0);break;case"left":a=xn(e,i.percent,(h=(f=i.offset)==null?void 0:f.x)!=null?h:0),s=le(n,(m=(b=i.offset)==null?void 0:b.y)!=null?m:0);break;case"right":a=wn(e,i.percent,(_=(y=i.offset)==null?void 0:y.x)!=null?_:0),s=le(n,(v=(C=i.offset)==null?void 0:C.y)!=null?v:0);break;case"center":a=le(e,(R=(I=i.offset)==null?void 0:I.x)!=null?R:0),s=le(n,(w=(M=i.offset)==null?void 0:M.y)!=null?w:0);break}t.position?t.position.set(a,s):(t.x=a,t.y=s),i.scale!==void 0&&i.scale!==1&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(i.scale,i.scale):(t.scale.x=i.scale,t.scale.y=i.scale))}function Qa(t,e,n,i=.2,a=1,s=!0,o=!1){let r=co(n,i),c=vn(n,i/2);ue(t,le(e),c);let l=s?a*Ce.scaleFactor:a;fe(t,l),o&&!hn.find(u=>u.element===t)&&ao(t,Qa,e,n,i,a,s)}function po(t,e,n,i=.1,a=1){ue(t,le(e),yn(n,i)),fe(t,a)}function go(t,e,n,i=0,a=0,s=1){ue(t,le(e,i),le(n,a)),fe(t,s)}function ho(t,e,n,i=.1,a=1){ue(t,xn(e,i),le(n)),fe(t,a)}function fo(t,e,n,i=.1,a=1){ue(t,wn(e,i),le(n)),fe(t,a)}function bo(t,e,n,i=.05,a=.05,s=1){ue(t,xn(e,a),vn(n,i)),fe(t,s)}function mo(t,e,n,i=.05,a=.05,s=1){ue(t,wn(e,a),vn(n,i)),fe(t,s)}function yo(t,e,n,i=.05,a=.05,s=1){ue(t,xn(e,a),yn(n,i)),fe(t,s)}function vo(t,e,n,i=.05,a=.05,s=1){ue(t,wn(e,a),yn(n,i)),fe(t,s)}function ue(t,e,n){t&&t.position?typeof t.position.set=="function"?t.position.set(e,n):(t.position.x=e,t.position.y=n):t&&(t.x=e,t.y=n)}function fe(t,e){e!==1&&t&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(e,e):t.scale.x!==void 0&&t.scale.y!==void 0&&(t.scale.x=e,t.scale.y=e))}var Ne={default:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03},physics:{rope_length:420,gravity:9.8,friction:.1}},wide:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.9,screen_scale_y:1.1},engine:{scale:1,background_scale:1.1,background_offset_y:0,background_alpha:.95,label_pulse_speed:3,label_pulse_intensity:.03},physics:{rope_length:420,gravity:9.8,friction:.1}},square:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.85,screen_scale_y:.85},engine:{scale:1,background_scale:1,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03},physics:{rope_length:380,gravity:9.8,friction:.1}},tall:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1.1,screen_scale_y:.9},engine:{scale:1,background_scale:.95,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03},physics:{rope_length:450,gravity:9.8,friction:.1}}};function xo(t){return t&&Ne[t]?JSON.parse(JSON.stringify(Ne[t])):JSON.parse(JSON.stringify(T))}function Ct(t){Object.keys(t).forEach(e=>{let n=e;T[n]&&t[n]&&Object.assign(T[n],t[n])}),console.log("Config applied:",t)}function wo(t,e){let n=t/e;n>1.6?(Ct(Ne.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(Ct(Ne.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(Ct(Ne.square),console.log("Applied SQUARE config for ratio:",n)):(Ct(Ne.default),console.log("Applied DEFAULT config for ratio:",n))}typeof window!="undefined"&&(window.configPresets=Ne);var Z=null;function Za(t,e,n,i,a,s={}){var q,pe,D,K,J,$,Y,$e,ke,At,Tt,Ie,Mt,it,kt,ce,at,It,W,st,Ot,ot,Pt,Rt,Oe,jt,be,Sn,Ht,ee,rt,Bt,lt,Dt,Pe,zt,Ft,Nt,me,$t,Gt,te,V,Re;let o=(q=s.enableDebugLogs)!=null?q:!1;o&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] ===== STARTING LAYOUT CALCULATION ====="),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Screen dimensions:",{width:i.width,height:i.height}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Time:",n),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Options:",s));let{mainContainer:r,label:c,background:l,backgroundTexture:u,app:g}=t;if(!g||!g.renderer){o&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] \u274C No app or renderer, skipping layout");return}o&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] App renderer dimensions:",{width:g.renderer.width,height:g.renderer.height}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] App screen dimensions:",{width:g.screen.width,height:g.screen.height}));let p=i.width,d=i.height;o&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Base dimensions:",{baseWidth:p,baseHeight:d});let f=p*T.layout.screen_scale_x,h=d*T.layout.screen_scale_y,b=p/2,m=e.engine.runtime||{},y=m.layout||{};o&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] Debug config:",{screen_scale_x:T.layout.screen_scale_x,screen_scale_y:T.layout.screen_scale_y}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Calculated dimensions:",{width:f,height:h,midX:b}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Engine runtime:",m),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Layout config:",y));let _=y.design_width_portrait||400,C=f/_;C=Math.min(C,1.15);let v=C*((pe=T.engine.scale)!=null?pe:1),I=(D=s.skipMainContainerTransform)!=null?D:!1;!I&&r&&r.scale&&(typeof r.scale.set=="function"?r.scale.set(v):(r.scale.x=v,r.scale.y=v));let M=((K=T.physics.rope_length)!=null?K:420)*v,w=p/d>.6,L;w?L=h*.65:L=M+h*.1,!I&&r&&r.position&&(typeof r.position.set=="function"?r.position.set(b+T.layout.position_offset.x,L+T.layout.position_offset.y):(r.position.x=b+T.layout.position_offset.x,r.position.y=L+T.layout.position_offset.y));let G=new Set((J=s.skipInstanceIds)!=null?J:[]);if(a&&(r!=null&&r.toLocal))for(let[A,F]of e.objects.entries()){let O=F==null?void 0:F.transform;if(!O||G.has(A))continue;let x=($=a.get)==null?void 0:$.call(a,A),ne=((Y=x==null?void 0:x.getDisplayObject)==null?void 0:Y.call(x))||(x==null?void 0:x.pixiObject)||x;if(!ne||ne.parent!==r)continue;let de=O.position_ratio!=null?mn(p,d,O.position_ratio):bn(p,d,($e=O.anchor)!=null?$e:"center"),je=r.toLocal(new gn.Point(de.x,de.y)),ye=(ke=O.position)!=null?ke:{x:0,y:0},U=je.x+ye.x,He=je.y+ye.y;typeof(x==null?void 0:x.setPosition)=="function"?x.setPosition(U,He):(ue(ne,U,He),(At=x==null?void 0:x.transform)!=null&&At.position&&(x.transform.position.x=U,x.transform.position.y=He))}if(T.layout.debug_rect_visible){(!Z||Z.parent!==g.stage)&&(Z==null||Z.destroy(),Z=new gn.Graphics,Z.zIndex=9999,g.stage.addChild(Z)),Z.clear();let A=T.layout.debug_rect_scale_x,F=T.layout.debug_rect_scale_y,O=(p-4)*A,x=(d-4)*F,ne=(p-O)/2,de=(d-x)/2;o&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] ===== DEBUG RECT POSITIONING ====="),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Debug rect calculations:",{baseWidth:p,baseHeight:d,rectW:O,rectH:x,offsetX:ne,offsetY:de}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Debug rect final position:",{x:2+ne,y:2+de,width:O,height:x})),Z.rect(2+ne,2+de,O,x).stroke({width:T.layout.debug_rect_thickness,color:T.layout.debug_rect_color})}else Z&&(Z.destroy(),Z=null);let E=e.objects.get("label_1")||e.objects.get("ui_tutorial_1"),j=e.objects.get("hazard_1"),N=(ce=(kt=(Ie=(Tt=j==null?void 0:j.gameplay)==null?void 0:Tt.rules)==null?void 0:Ie.hazard_height)!=null?kt:(it=(Mt=j==null?void 0:j.gameplay)==null?void 0:Mt.tuning)==null?void 0:it.hazard_height)!=null?ce:0;if(c&&c.position){let A=(at=E==null?void 0:E.render)==null?void 0:at.anchor,F=(W=(It=E==null?void 0:E.transform)==null?void 0:It.anchor)!=null?W:"center",O=(st=E==null?void 0:E.transform)==null?void 0:st.position_ratio,x=((Ot=E==null?void 0:E.transform)==null?void 0:Ot.offset)||{x:0,y:0};pn(c,p,d,{anchor:F,positionRatio:O,offset:{x:x.x*v,y:x.y*v},inset:{bottom:N},renderAnchor:A})}if(c&&c.alpha>0){let A=1+Math.sin(n*T.engine.label_pulse_speed)*T.engine.label_pulse_intensity,F=(Pt=(ot=E==null?void 0:E.transform)==null?void 0:ot.scale)!=null?Pt:1,O=A*v*F;c.scale&&(typeof c.scale.set=="function"?c.scale.set(O):(c.scale.x=O,c.scale.y=O))}if(o&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] ===== BACKGROUND POSITIONING ====="),l){o&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background object exists:",!!l),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background type:",(Rt=l.constructor)==null?void 0:Rt.name)),l.alpha=((jt=(Oe=m.background)==null?void 0:Oe.alpha)!=null?jt:.98)*T.engine.background_alpha,o&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background alpha set to:",l.alpha);let A=e.objects.get("background_1");o&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background config:",A);let F=(A==null?void 0:A.transform)||{};o&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background transform:",F);let O=F.offset||{x:0,y:0},x=((Sn=(be=m.background)==null?void 0:be.offset_y)!=null?Sn:0)+T.engine.background_offset_y,ne=(ee=(Ht=A==null?void 0:A.render)==null?void 0:Ht.anchor)!=null?ee:{x:.5,y:.5},de=(rt=F.anchor)!=null?rt:"center",je=F.position_ratio;if(o&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background positioning params:",{bgOffset:O,bgRuntimeOffsetY:x,bgRenderAnchor:ne,bgScreenAnchor:de,bgPositionRatio:je,baseWidth:p,baseHeight:d,finalScale:v}),pn(l,p,d,{anchor:de,positionRatio:je,offset:{x:O.x*v,y:O.y*v+x},renderAnchor:ne}),o&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background position after applyScreenAnchor:",{x:l.x,y:l.y,scaleX:(Bt=l.scale)==null?void 0:Bt.x,scaleY:(lt=l.scale)==null?void 0:lt.y,anchorX:(Dt=l.anchor)==null?void 0:Dt.x,anchorY:(Pe=l.anchor)==null?void 0:Pe.y,pivotX:(zt=l.pivot)==null?void 0:zt.x,pivotY:(Ft=l.pivot)==null?void 0:Ft.y,width:l.width,height:l.height}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background texture dimensions:",{textureWidth:u==null?void 0:u.width,textureHeight:u==null?void 0:u.height})),u){let ye=Math.max(f/u.width,h/u.height),U=(me=(Nt=m.background)==null?void 0:Nt.scale_multiplier)!=null?me:1.05,He=($t=F.scale)!=null?$t:1,ct=ye*U*T.engine.background_scale*He;l.scale&&(typeof l.scale.set=="function"?l.scale.set(ct):(l.scale.x=ct,l.scale.y=ct))}else l&&typeof l.clear=="function"&&(l.clear(),l.rect(-f/2,-h/2,f,h).fill({color:1444375}))}let H=(Gt=window.gameObjectManager)==null?void 0:Gt.get("character_1");if(H){let A=((te=H.getDisplayObject)==null?void 0:te.call(H))||H;A&&A.scale&&(console.log(`[CHARACTER] After layout - Adjusted scale - x: ${((V=A.scale.x)!=null?V:1).toFixed(3)}, y: ${((Re=A.scale.y)!=null?Re:1).toFixed(3)}`),console.log(`[CHARACTER] Layout finalScale: ${v.toFixed(3)}`))}}function es(t){var r,c,l;let{setState:e,updateLabelAlpha:n,updateHandAlpha:i,config:a,states:s}=t,o=((c=(r=a.engine)==null?void 0:r.runtime)==null?void 0:c.timeline)||{};e(s.showHook),setTimeout(()=>{n(1),i(1),e(s.waitInput),console.log("[GAME] \u23F3 Game ready for user input - tutorial shown")},(l=o.tutorial_delay_ms)!=null?l:1500)}0&&(module.exports={AssetCache,AssetLoader,AssetSystem,Assets,BaseSystem,GameEngine,GameObject,GameObjectManager,ObjectFactory,Renderer,RuntimeObjectRegistry,SplashScreen,Transform,animateHandClick,animatePanelEntrance,applyScreenAnchor,basePixi,clearResponsiveElements,createEndGamePanel,createHandTutorial,createPixiBase,createTutorialLabel,getRegisteredFontIds,globalResponsiveMultipliers,initAssets,layout,playLottieOverlay,registerFont,registerType,resolveAnchorVec2,resolveFont,resolveFontWeight,resolveScreenAnchorPoint,resolveScreenRatioPoint,runInitSequence,setLottieInstance,updateHandAnimation,updateScreenState});
@@ -1,11 +1 @@
1
- import{b as ft}from"../chunk-UVBNGLP3.mjs";import{Application as Bn}from"pixi.js";async function Nn(n,t={}){let e=new Bn;await e.init({resizeTo:n,autoDensity:!0,resolution:window.devicePixelRatio||1,antialias:!0,backgroundAlpha:0});let o=a=>{var c,l,u,h,p,d;let r=(u=(l=(c=a==null?void 0:a.width)!=null?c:n.clientWidth)!=null?l:window.innerWidth)!=null?u:320,i=(d=(p=(h=a==null?void 0:a.height)!=null?h:n.clientHeight)!=null?p:window.innerHeight)!=null?d:480;e.renderer.resize(r,i)};n.innerHTML="",n.style.position="relative",n.style.display="flex",n.style.flexDirection="column",n.style.alignItems="stretch",n.style.width="100%",n.style.height="100dvh",n.style.minHeight="100vh",n.style.maxWidth="100%",n.style.maxHeight="100%",n.style.boxSizing="border-box",n.style.overflow="hidden",t.background&&(n.style.background=t.background),n.appendChild(e.canvas);let s=document.createElement("div");return s.setAttribute("style",["position:absolute","inset:0","display:flex","flex-direction:column","align-items:center","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(";")),n.appendChild(s),ft.on("pause",()=>{e.ticker.stop(),document.querySelectorAll("audio").forEach(r=>r.pause())}),ft.on("resume",()=>{e.ticker.start(),document.querySelectorAll("audio").forEach(r=>{r.currentTime>0&&!r.ended&&r.play().catch(()=>{})})}),ft.on("resize",({payload:a})=>{o({width:a==null?void 0:a.width,height:a==null?void 0:a.height})}),window.addEventListener("resize",()=>o()),requestAnimationFrame(()=>o()),{app:e,stage:e.stage,overlay:s,applySize:o}}var yt=class{constructor(t){var e,o;this.position=(t==null?void 0:t.position)||{x:0,y:0},this.scale=(e=t==null?void 0:t.scale)!=null?e:1,this.rotation=(o=t==null?void 0:t.rotation)!=null?o: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)}syncToPixi(t){t.position.set(this.position.x,this.position.y),t.scale.set(this.scale),t.rotation=this.rotation}},mt=class{constructor(t){var e,o,s,a;this.z_index=(e=t==null?void 0:t.z_index)!=null?e:0,this.alpha=(o=t==null?void 0:t.alpha)!=null?o:1,this.visible=(s=t==null?void 0:t.visible)!=null?s:!0,this.tint=(a=t==null?void 0:t.tint)!=null?a: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)}syncToPixi(t){t.zIndex=this.z_index,t.alpha=this.alpha,t.visible=this.visible,this.tint!==null&&"tint"in t&&(t.tint=this.tint)}},_t=class{constructor(t,e,o,s){this.instanceId=t,this.objectConfig=e,this.pixiObject=o,this._config=s,this.transform=new yt(s.transform),this.renderer=new mt(s.render),this.sync()}sync(){this.transform.syncToPixi(this.pixiObject),this.renderer.syncToPixi(this.pixiObject)}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,e){this.transform.position={x:t,y:e},this.transform.syncToPixi(this.pixiObject)}getAlpha(){return this.renderer.alpha}setAlpha(t){this.renderer.alpha=t,this.renderer.syncToPixi(this.pixiObject)}getVisible(){return this.renderer.visible}setVisible(t){this.renderer.visible=t,this.renderer.syncToPixi(this.pixiObject)}},Tt=class{constructor(t){this.objects=new Map;this.config=t}create(t,e){let o=this.config.objects.get(t);if(!o)throw new Error(`Object config not found: ${t}`);let s=new _t(t,o.object_config||t,e,o);return this.objects.set(t,s),s}get(t){return this.objects.get(t)}updateConfig(t){this.config=t;for(let[e,o]of this.objects.entries()){let s=t.objects.get(e);s&&o.updateConfig(s)}}getAll(){return Array.from(this.objects.values())}remove(t){this.objects.delete(t)}clear(){this.objects.clear()}};var gt={"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 J(n){let t=gt[n];return t?t.family:(console.warn(`Font ID "${n}" not found in registry, using fallback`),"Arial, sans-serif")}function G(n){var e;let t=gt[n];return t&&(e=t.weight)!=null?e:"400"}function kn(n,t){gt[n]=t}function Rn(){return Object.keys(gt)}import{Container as In,Graphics as xt,Text as at,Sprite as Ve,Texture as At}from"pixi.js";function Yn(n,t,e){var Yt,zt,Ht,Wt,Jt,Gt,Xt,qt,Vt,Ut,Kt,Qt,Zt,jt,te,ee,ne,ae,se,oe,ie,re,le,ce,de,pe,ue,he,fe,ye,me,_e,ge,xe,be,we,Se,Te,Ae,Le,Ee,Me,ve,De,Ce,Oe,Fe,Pe,$e,Be,Ne,ke,Re,Ie,Ye,ze,He,We,Je,Ge;let o=n.objects.get("ui_endgame_1"),s=n.objects.get("ui_endgame_logo_1"),a=n.objects.get("ui_endgame_title_1"),r=n.objects.get("ui_endgame_subtitle_1"),i=n.objects.get("ui_endgame_footer_1"),c=n.objects.get("ui_endgame_cta_1"),l=n.objects.get("ui_endgame_cta_hint_1"),u=n.objects.get("ui_endgame_hand_1"),h=n.engine.runtime||{},p=new In;p.alpha=0,p.visible=!1;let d=((Yt=o==null?void 0:o.gameplay)==null?void 0:Yt.tuning)||{},f=(o==null?void 0:o.render)||{},y=(zt=d.panel_width)!=null?zt:320,m=(Ht=d.panel_height)!=null?Ht:400,g=(Wt=d.panel_padding)!=null?Wt:32,_=(Jt=d.panel_radius)!=null?Jt:24,x=f.background_color||d.panel_bg_color||"#1a0a0a",b=f.background_alpha!==void 0&&f.background_alpha!==null?f.background_alpha:(Gt=d.panel_bg_alpha)!=null?Gt:.98,T=f.border_color||d.panel_border_color||"#ffffff",A=(Xt=d.panel_border_width)!=null?Xt:2,w=(qt=d.panel_border_alpha)!=null?qt:.3,S=new xt;S.roundRect(-y/2,-m/2,y,m,_);let L=x.replace("#","");S.fill({color:parseInt(L,16),alpha:b});let C=T.replace("#","");S.stroke({color:parseInt(C,16),width:A,alpha:w});let E=new xt;E.roundRect(-y/2+2,-m/2+2,y-4,m-4,_-2),E.stroke({color:16777215,width:1,alpha:.1}),S.addChild(E),p.addChild(S);let O=((Vt=s==null?void 0:s.gameplay)==null?void 0:Vt.tuning)||{},k=(s==null?void 0:s.transform)||{},M=(Ut=O.logo_size)!=null?Ut:56,F=(Kt=k.scale)!=null?Kt:1,R=(Zt=(Qt=k.offset)==null?void 0:Qt.y)!=null?Zt:-130,it=(jt=O.logo_alpha)!=null?jt:1,v=new Ve(e||At.EMPTY);v.anchor.set(.5);let U=0,K=0;if(e&&e!==At.EMPTY){let D=e.frame,W=e.baseTexture;D&&D.width&&D.height?(U=D.width,K=D.height):W&&W.width&&W.height?(U=W.width,K=W.height):e.width&&e.height&&(U=e.width,K=e.height)}if(U>0&&K>0){let D=U/K,W,St;D>1?(W=M,St=M/D):(St=M,W=M*D);let Xe=W/U,qe=St/K;Xe*=F,qe*=F,v.scale.set(Xe,qe)}else{let D=M/100*F;v.scale.set(D)}v.position.set(0,R),v.alpha=0,v.visible=!0,v.targetAlpha=it,v.baseScaleX=v.scale.x,v.baseScaleY=v.scale.y,p.addChild(v);let P=a==null?void 0:a.ui,I=((te=a==null?void 0:a.gameplay)==null?void 0:te.tuning)||{},Qe=(P==null?void 0:P.text)||"MISSION ACCOMPLISHED",Dt=(P==null?void 0:P.font)||"brand.heading",Ze=(P==null?void 0:P.fontSize)||24,je=(ee=P==null?void 0:P.letterSpacing)!=null?ee:1,rt=(ne=a==null?void 0:a.render)==null?void 0:ne.tint,tn=typeof rt=="string"?rt:rt?`#${rt.toString(16).padStart(6,"0")}`:"#00FF88",Ct=y-g*2-30,en=I.font_weight_override?I.font_weight_override:G(Dt),q=new at({text:Qe,style:{fontFamily:J(Dt),fontSize:Ze,fontWeight:en,fill:tn,align:"center",letterSpacing:je,wordWrap:!1,stroke:{color:I.stroke_color||"#000000",width:(ae=I.stroke_width)!=null?ae:2},dropShadow:{color:I.shadow_color||"#000000",alpha:(se=I.shadow_alpha)!=null?se:.9,angle:(oe=I.shadow_angle)!=null?oe:0,blur:(ie=I.shadow_blur)!=null?ie:8,distance:(re=I.shadow_distance)!=null?re:4}}});if(q.width>Ct){let D=Ct/q.width;q.scale.set(D)}q.anchor.set(.5);let Ot=(le=d.title_offset_y)!=null?le:30,nn=Ot+((ce=I.animation_start_y_offset)!=null?ce:-20);q.position.set(0,nn),q.alpha=0,p.addChild(q);let $=r==null?void 0:r.ui,Ft=((de=r==null?void 0:r.gameplay)==null?void 0:de.tuning)||{},an=($==null?void 0:$.text)||"RESCUE COMPLETE",Pt=($==null?void 0:$.font)||"brand.body",sn=($==null?void 0:$.fontSize)||11,on=(pe=$==null?void 0:$.letterSpacing)!=null?pe:.5,lt=(ue=r==null?void 0:r.render)==null?void 0:ue.tint,rn=typeof lt=="string"?lt:lt?`#${lt.toString(16).padStart(6,"0")}`:"#B0B0B0",Q=new at({text:an,style:{fontFamily:J(Pt),fontSize:sn,fontWeight:G(Pt),fill:rn,align:"center",letterSpacing:on}});Q.anchor.set(.5);let ln=Ot+20+((he=Ft.animation_start_y_offset)!=null?he:-10);Q.position.set(0,ln),Q.alpha=0,Q.animationStartYOffset=(fe=Ft.animation_start_y_offset)!=null?fe:-10,p.addChild(Q);let z=i==null?void 0:i.ui,$t=((ye=i==null?void 0:i.gameplay)==null?void 0:ye.tuning)||{},cn=(z==null?void 0:z.text)||((me=h.ui)==null?void 0:me.cta_hint)||"Continue the adventure!",Bt=(z==null?void 0:z.font)||"brand.body",dn=(z==null?void 0:z.fontSize)||16,ct=(_e=i==null?void 0:i.render)==null?void 0:_e.tint,pn=typeof ct=="string"?ct:ct?`#${ct.toString(16).padStart(6,"0")}`:"#FFFFFF",un=(ge=$t.max_width)!=null?ge:y-g*2,hn=(xe=$t.line_height)!=null?xe:1.4,Z=new at({text:cn,style:{fontFamily:J(Bt),fontSize:dn,fontWeight:G(Bt),fill:pn,align:"center",wordWrap:!0,wordWrapWidth:un,lineHeight:hn}});Z.anchor.set(.5);let fn=(be=d.footer_offset_y)!=null?be:120;Z.position.set(0,fn);let yn=((we=i==null?void 0:i.render)==null?void 0:we.alpha)!==void 0&&((Se=i==null?void 0:i.render)==null?void 0:Se.alpha)!==null?i.render.alpha:1;Z.alpha=0,Z.targetAlpha=yn,p.addChild(Z);let H=((Te=c==null?void 0:c.gameplay)==null?void 0:Te.tuning)||{},B=c==null?void 0:c.ui,dt=(Ae=H.button_width)!=null?Ae:260,pt=(Le=H.button_height)!=null?Le:56,Nt=(Ee=H.button_radius)!=null?Ee:16,mn=H.button_bg_color||((Me=h.theme)==null?void 0:Me.cta_background)||"#ffb43b",_n=(ve=H.button_bg_alpha)!=null?ve:1,gn=H.button_border_color||"#ffffff",xn=(De=H.button_border_width)!=null?De:2,bn=(Ce=H.button_border_alpha)!=null?Ce:.2,ut=(Oe=d.cta_offset_y)!=null?Oe:160,Y=new xt;Y.roundRect(-dt/2,-pt/2,dt,pt,Nt);let wn=mn.replace("#","");Y.fill({color:parseInt(wn,16),alpha:_n});let Sn=gn.replace("#","");Y.stroke({color:parseInt(Sn,16),width:xn,alpha:bn});let bt=new xt;bt.roundRect(-dt/2+2,-pt/2+2,dt-4,pt-4,Nt-2),bt.stroke({color:0,width:1,alpha:.15}),Y.addChild(bt),Y.position.set(0,ut),Y.alpha=0,Y.eventMode="static",Y.cursor="pointer",p.addChild(Y);let Tn=(B==null?void 0:B.text)||((Fe=h.ui)==null?void 0:Fe.cta_label_end)||"DOWNLOAD",kt=(B==null?void 0:B.font)||"brand.heading",An=(B==null?void 0:B.fontSize)||20,Ln=H.button_text_color||((Pe=h.theme)==null?void 0:Pe.cta_text)||"#1a0a0a",nt=new at({text:Tn,style:{fontFamily:J(kt),fontSize:An,fontWeight:G(kt),fill:Ln,align:"center",letterSpacing:($e=B==null?void 0:B.letterSpacing)!=null?$e:1}});nt.anchor.set(.5),nt.position.set(0,ut),nt.alpha=0,p.addChild(nt);let N=l==null?void 0:l.ui,Rt=((Be=l==null?void 0:l.gameplay)==null?void 0:Be.tuning)||{},En=(N==null?void 0:N.text)||"Play the full game",It=(N==null?void 0:N.font)||"brand.body",Mn=(N==null?void 0:N.fontSize)||11,vn=(Ne=N==null?void 0:N.letterSpacing)!=null?Ne:0,ht=(ke=l==null?void 0:l.render)==null?void 0:ke.tint,Dn=typeof ht=="string"?ht:ht?`#${ht.toString(16).padStart(6,"0")}`:"#CCCCCC",j=new at({text:En,style:{fontFamily:J(It),fontSize:Mn,fontWeight:G(It),fill:Dn,align:"center",letterSpacing:vn}});j.anchor.set(.5);let Cn=ut+35+((Re=Rt.animation_start_y_offset)!=null?Re:5);j.position.set(0,Cn),j.alpha=0,j.animationStartYOffset=(Ie=Rt.animation_start_y_offset)!=null?Ie:5,p.addChild(j);let wt=((Ye=u==null?void 0:u.gameplay)==null?void 0:Ye.tuning)||{},On=(ze=wt.hand_offset_x)!=null?ze:50,Fn=(He=wt.hand_offset_y)!=null?He:50,Pn=(Je=(We=u==null?void 0:u.transform)==null?void 0:We.scale)!=null?Je:.1875,$n=(Ge=wt.hand_scale_multiplier)!=null?Ge:2.5,V=new Ve(t||At.EMPTY);return V.anchor.set(.5),V.scale.set(Pn*$n),V.position.set(On,ut+Fn),V.alpha=0,V.visible=!1,p.addChild(V),{panel:p,logo:v,title:q,subtitle:Q,footer:Z,ctaButton:Y,ctaText:nt,ctaHint:j,hand:V}}function zn(n,t,e){var A,w,S,L,C,E,O,k;let o=t.objects.get("ui_endgame_1"),s=((A=o==null?void 0:o.gameplay)==null?void 0:A.tuning)||{},a=(w=s.animation_duration_ms)!=null?w:800,r=(S=s.fade_in_duration_ms)!=null?S:600,i=(L=s.scale_animation_intensity)!=null?L:.1,c=(C=s.logo_animation_delay_ms)!=null?C:100,l=(E=s.title_animation_delay_ms)!=null?E:200,u=(O=s.footer_animation_delay_ms)!=null?O:300,h=(k=s.cta_animation_delay_ms)!=null?k:400,{panel:p,logo:d,title:f,subtitle:y,footer:m,ctaButton:g,ctaText:_,ctaHint:x}=n;p.visible=!0;let b=Date.now(),T=()=>{let M=Date.now()-b,F=Math.min(M/r,1),R=1-Math.pow(1-F,3);p.alpha=R,p.scale.set(1+i*(1-R)),F<1?requestAnimationFrame(T):(setTimeout(()=>Hn(d,a,t),c),setTimeout(()=>{Wn(f,a),setTimeout(()=>Jn(y,a),50)},l),setTimeout(()=>Gn(m,a),u),setTimeout(()=>{Xn(g,_,a),setTimeout(()=>qn(x,a),50),e&&e()},h))};T()}function Hn(n,t,e){var p,d,f,y,m;let o=e==null?void 0:e.objects.get("ui_endgame_logo_1"),a=(d=(((p=o==null?void 0:o.gameplay)==null?void 0:p.tuning)||{}).animation_start_scale)!=null?d:1.2,r=Date.now(),i=n.alpha,c=(f=n.targetAlpha)!=null?f:1,l=(y=n.baseScaleX)!=null?y:n.scale.x,u=(m=n.baseScaleY)!=null?m:n.scale.y,h=()=>{let g=Date.now()-r,_=Math.min(g/t,1),x=1-Math.pow(1-_,2);n.alpha=i+(c-i)*x;let b=a+(1-a)*x;n.scale.set(l*b,u*b),_<1&&requestAnimationFrame(h)};h()}function Wn(n,t){let e=Date.now(),o=n.alpha,s=n.y,a=()=>{let r=Date.now()-e,i=Math.min(r/t,1),c=1-Math.pow(1-i,2);n.alpha=o+(1-o)*c,n.y=s-20*(1-c),i<1&&requestAnimationFrame(a)};a()}function Jn(n,t){var i;let e=Date.now(),o=n.alpha,s=n.position.y,a=s-((i=n.animationStartYOffset)!=null?i:-10),r=()=>{let c=Date.now()-e,l=Math.min(c/t,1),u=1-Math.pow(1-l,2);n.alpha=o+(1-o)*u,n.position.y=s+(a-s)*u,l<1&&requestAnimationFrame(r)};r()}function Gn(n,t){var r;let e=Date.now(),o=n.alpha,s=(r=n.targetAlpha)!=null?r:1,a=()=>{let i=Date.now()-e,c=Math.min(i/t,1),l=1-Math.pow(1-c,2);n.alpha=o+(s-o)*l,c<1&&requestAnimationFrame(a)};a()}function Xn(n,t,e){let o=Date.now(),s=n.alpha,a=()=>{let r=Date.now()-o,i=Math.min(r/e,1),c=1-Math.pow(1-i,2);n.alpha=s+(1-s)*c,t.alpha=s+(1-s)*c,n.scale.set(1+.1*(1-c)),i<1&&requestAnimationFrame(a)};a()}function qn(n,t){var i;let e=Date.now(),o=n.alpha,s=n.position.y,a=s-((i=n.animationStartYOffset)!=null?i:5),r=()=>{let c=Date.now()-e,l=Math.min(c/t,1),u=1-Math.pow(1-l,2);n.alpha=o+(1-o)*u,n.position.y=s+(a-s)*u,l<1&&requestAnimationFrame(r)};r()}function Vn(n,t,e,o){var u,h,p,d;let s=e.objects.get("ui_endgame_hand_1"),a=((u=s==null?void 0:s.gameplay)==null?void 0:u.tuning)||{},r=(h=a.click_animation_duration_ms)!=null?h:600,i=(p=a.click_delay_ms)!=null?p:2e3,c=(d=a.click_repeat_delay_ms)!=null?d:3e3,l=()=>{var A,w;n.visible=!0,n.alpha=1;let f=n.x,y=n.y,m=(A=a.hand_offset_x)!=null?A:50,g=(w=a.hand_offset_y)!=null?w:50,_=t.x+m,x=t.y+g,b=Date.now(),T=()=>{var M,F,R;let S=Date.now()-b,L=Math.min(S/r,1),C=L<.5?2*L*L:1-Math.pow(-2*L+2,2)/2;n.x=f+(_-f)*C,n.y=y+(x-y)*C;let E=(F=(M=s==null?void 0:s.transform)==null?void 0:M.scale)!=null?F:.1875,O=(R=a.hand_scale_multiplier)!=null?R:2.5,k=E*O;n.scale.set(k+k*.2*Math.sin(L*Math.PI)),L<1?requestAnimationFrame(T):(t.scale.set(.95),setTimeout(()=>{t.scale.set(1),o()},100),setTimeout(()=>{n.alpha=0,setTimeout(()=>{n.x=f,n.y=y,l()},c)},500))};T()};setTimeout(l,i)}import{Sprite as Un,Text as Kn}from"pixi.js";function Qn(n,t,e){var u,h,p,d;let o=t.objects.get("hand_tutorial_1"),s=((u=o==null?void 0:o.gameplay)==null?void 0:u.tuning)||{},a=(o==null?void 0:o.render)||{},r=(o==null?void 0:o.transform)||{},i=new Un(n);i.anchor.set(.5),i.alpha=0;let c=(h=s.hand_scale_multiplier)!=null?h:2.5,l=(p=r.scale)!=null?p:.1875;return i.scale.set(l*c),i.zIndex=(d=a.z_index)!=null?d:99999,i}function Zn(n){var f,y,m,g,_,x,b,T,A,w;let t=n.objects.get("ui_tutorial_1"),e=t==null?void 0:t.ui,o=(t==null?void 0:t.render)||{},s=((f=n.engine.runtime)==null?void 0:f.ui_styles)||{},a=((y=n.engine.runtime)==null?void 0:y.ui)||{},r=(e==null?void 0:e.text)||a.tutorial_label||a.label_text||"CLEAN!",i=(e==null?void 0:e.font)||"brand.warning",c=(e==null?void 0:e.fontSize)||s.label_font_size||52,l=(g=e==null?void 0:e.letterSpacing)!=null?g:(m=s.label_letter_spacing)!=null?m:-1,u=(e==null?void 0:e.align)||"center",h=o.tint,p=typeof h=="string"?h:h?`#${h.toString(16).padStart(6,"0")}`:s.label_fill||"#FFF1C1",d=new Kn({text:r,style:{fontFamily:J(i),fontSize:c,fontWeight:G(i),fill:p,align:u,letterSpacing:l,stroke:{color:s.label_stroke||"#8B0000",width:2},dropShadow:{color:s.label_shadow_color||"#000000",alpha:(_=s.label_shadow_alpha)!=null?_:.8,angle:(x=s.label_shadow_angle)!=null?x:0,blur:(b=s.label_shadow_blur)!=null?b:4,distance:(T=s.label_shadow_distance)!=null?T:2}}});return d.anchor.set(.5,0),d.alpha=(A=o.alpha)!=null?A:0,d.visible=(w=o.visible)!=null?w:!0,d}function jn(n,t,e,o,s){var c,l,u,h,p,d,f;let a=s.objects.get("hand_tutorial_1"),r=((c=a==null?void 0:a.gameplay)==null?void 0:c.tuning)||{},i=(a==null?void 0:a.transform)||{};if(!o){let y=(l=r.animation_duration)!=null?l:1.5,m=e%y/y,g=m<.5?2*m*m:-1+(4-2*m)*m,_=(u=r.x_offset)!=null?u:0,x=(h=r.y_offset)!=null?h:0,b=(p=r.animation_range)!=null?p:40,T=b*.7,A=b,w=t.x+_+T,S=t.y+x+A,L=w+T,C=S+A;n.x=w+(L-w)*g,n.y=S+(C-S)*g;let E=(d=i.scale)!=null?d:.1875,O=(f=r.hand_scale_multiplier)!=null?f:2.5;n.scale.set(E*O)}}var st=null;function ta(){return st||(typeof window!="undefined"&&window.lottie?st=window.lottie:(console.warn("[LottieOverlay] lottie-web is not available globally. Make sure it is loaded before using Lottie animations."),st=null)),st}function ea(n){st=n}function na(n,t,e,o){var T,A,w,S,L,C,E,O,k,M,F,R,it;let s=e.objects.get(n);if(!s)return console.warn(`[LottieOverlay] Object config not found: ${n}`),null;let a=((T=s.effects)==null?void 0:T.lottie)||{},r=s.transform||{},i=s.render||{};if(a.enabled===!1||i.visible===!1)return null;let c=o[n];if(!c||typeof c!="object")return console.warn(`[LottieOverlay] Asset data not found or invalid for: ${n}`),null;let l=ta();if(!l)return console.warn(`[LottieOverlay] lottie-web is not available. Cannot play animation: ${n}`),null;let u=(A=a.width)!=null?A:300,h=(w=a.height)!=null?w:300,p=(S=r.scale)!=null?S:1,d=(C=(L=r.position)==null?void 0:L.x)!=null?C:0,f=(O=(E=r.position)==null?void 0:E.y)!=null?O:0,y=(k=r.rotation)!=null?k:0,m=(M=i.z_index)!=null?M:100,g=(F=i.alpha)!=null?F:1,_=document.createElement("div");_.style.cssText=`
2
- position: absolute;
3
- top: calc(50% + ${f}px);
4
- left: calc(50% + ${d}px);
5
- transform: translate(-50%, -50%) scale(${p}) rotate(${y}deg);
6
- width: ${u}px;
7
- height: ${h}px;
8
- pointer-events: none;
9
- z-index: ${m};
10
- opacity: ${g};
11
- `,t.appendChild(_);let x=l.loadAnimation({container:_,renderer:a.renderer||"svg",loop:(R=a.loop)!=null?R:!1,autoplay:(it=a.autoplay)!=null?it:!0,animationData:c});a.speed!==void 0&&x.setSpeed(a.speed);let b=()=>{x.destroy(),_.parentNode&&_.parentNode.removeChild(_)};return a.loop||x.addEventListener("complete",b),{animation:x,cleanup:b}}import{Assets as et,Texture as aa}from"pixi.js";var X=class{static get(t){var e;return(e=this.store.get(t))==null?void 0:e.data}static set(t,e){this.store.set(t,{data:e})}static has(t){return this.store.has(t)}static clear(){this.store.clear()}};X.store=new Map;var sa=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined";console.log(`[AssetLoader] MODULE LOADED - __BUILD_MODE__: ${sa}`);var tt={},Lt=null;async function oa(){if(console.log(`[AssetLoader] getInlineAssets() called - __BUILD_MODE__: ${typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined"}`),Object.keys(tt).length>0)return console.log("[AssetLoader] Returning cached inline assets:",Object.keys(tt)),tt;if(!Lt){let t=typeof window!="undefined"?new URL("inline-assets.js",window.location.href).href:"./inline-assets.js";console.log("[AssetLoader] Loading inline assets from:",t),Lt=(async()=>{try{try{let a=await import(t+"?t="+Date.now());if(a.INLINE_ASSETS)return console.log("[AssetLoader] Loaded INLINE_ASSETS via ES module:",Object.keys(a.INLINE_ASSETS)),a.INLINE_ASSETS}catch(a){console.warn("[AssetLoader] ES module import failed, trying text parse:",a)}let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}: ${e.statusText}`);let o=await e.text();console.log("[AssetLoader] Received JS code, length:",o.length);let s=o.match(/export\s+const\s+INLINE_ASSETS\s*=\s*({[\s\S]*?});?\s*$/m);if(s)try{let a=s[1];console.log("[AssetLoader] Found INLINE_ASSETS export, parsing...");let r=new Function("return "+a)();return console.log("[AssetLoader] Parsed inline assets:",Object.keys(r)),r}catch(a){return console.warn("[AssetLoader] Failed to parse inline assets:",a),{}}else return console.warn("[AssetLoader] INLINE_ASSETS export not found in response"),console.log("[AssetLoader] JS code preview:",o.substring(0,500)),{}}catch(e){return console.warn("[AssetLoader] Failed to load inline assets:",e),{}}})()}return tt=await Lt,console.log("[AssetLoader] Final inline assets cache:",Object.keys(tt)),tt}var Ue=new Map;function Et(n){return n===null||typeof n!="object"||(Object.freeze(n),Object.values(n).forEach(t=>Et(t))),n}function ia(n=64,t=64,e=16711680){let o=document.createElement("canvas");o.width=n,o.height=t;let s=o.getContext("2d");return s.fillStyle=`#${e.toString(16).padStart(6,"0")}`,s.fillRect(0,0,n,t),s.strokeStyle="#000",s.strokeRect(0,0,n,t),s.fillStyle="#fff",s.font="10px sans-serif",s.textAlign="center",s.fillText("MISSING",n/2,t/2),aa.from(o)}function Mt(n,t){Ue.set(n,t)}var ot=class{static async load(t,e,o){let s=X.get(t);if(s!==void 0)return s;let a=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined";console.log(`[AssetLoader] Loading asset: ${t}, type: ${e.type}, __BUILD_MODE__: ${a}`);let i=(await oa())[t];if(console.log("[AssetLoader] Inline data for",t,":",i?"FOUND":"NOT FOUND"),a==="publish"&&(console.log("[AssetLoader] \u26A0\uFE0F PUBLISH MODE DETECTED - inline assets are MANDATORY"),!i))throw new Error(`[AssetLoader] PUBLISH MODE: Inline asset required but NOT FOUND for object: ${t}, path: ${e.path}`);let c=Ue.get(e.type);if(c)try{let l=await c(e.path,i,t,o);return X.set(t,l),l}catch(l){return this.handleFailure(t,e.type,l)}try{let l;switch(e.type){case"image":l=await this.loadImage(e.path,i);break;case"json":l=await this.loadJSON(e.path,i),l=Et(l);break;default:throw new Error(`Unknown asset type: ${e.type}`)}return X.set(t,l),l}catch(l){return this.handleFailure(t,e.type,l)}}static async loadImage(t,e){let o=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",s=o==="publish";if(console.log(`[AssetLoader] loadImage - __BUILD_MODE__: ${o}, isPublishMode: ${s}, inlineData: ${e?"EXISTS":"MISSING"}`),s){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!e)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for object. Path: ${t}`);if(!e.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI, got: ${e.substring(0,50)}...`);try{return await et.load(e)}catch(a){throw console.error("[AssetLoader] Failed to load texture from data URI:",a),a}}if(e&&e.startsWith("data:"))try{return await et.load(e)}catch(a){return console.error("[AssetLoader] Failed to load texture from data URI, falling back to path:",a),await et.load(t)}return await et.load(t)}static async loadJSON(t,e){let o=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",s=o==="publish";if(console.log(`[AssetLoader] loadJSON - __BUILD_MODE__: ${o}, isPublishMode: ${s}, inlineData: ${e?"EXISTS":"MISSING"}`),s){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!e)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${t}`);if(e.startsWith("data:")){let r=atob(e.split(",")[1]);return JSON.parse(r)}return JSON.parse(e)}if(e){if(e.startsWith("data:")){let r=atob(e.split(",")[1]);return JSON.parse(r)}return JSON.parse(e)}let a=await fetch(t);if(!a.ok)throw new Error(`JSON fetch failed: ${t}`);return a.json()}static handleFailure(t,e,o){if(typeof __BUILD_MODE__!="undefined"&&__BUILD_MODE__==="dev"){let a=e==="image"?ia():Et({__placeholder:!0,type:e});return X.set(t,a),a}throw o}};Mt("image",async(n,t)=>{let e=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",o=e==="publish";if(console.log(`[AssetLoader] registerType('image') - __BUILD_MODE__: ${e}, isPublishMode: ${o}, inlineData: ${t?"EXISTS":"MISSING"}`),o){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!t)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${n}`);if(!t.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI, got: ${t.substring(0,50)}...`);return et.load(t)}return et.load(t||n)});Mt("json",async(n,t)=>{let e=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",o=e==="publish";if(console.log(`[AssetLoader] registerType('json') - __BUILD_MODE__: ${e}, isPublishMode: ${o}, inlineData: ${t?"EXISTS":"MISSING"}`),o){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!t)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${n}`);return t.startsWith("data:")?JSON.parse(atob(t.split(",")[1])):JSON.parse(t)}if(t)return t.startsWith("data:")?JSON.parse(atob(t.split(",")[1])):JSON.parse(t);let s=await fetch(n);if(!s.ok)throw new Error(`JSON fetch failed: ${n}`);return s.json()});import{Sprite as ra,Container as Ke}from"pixi.js";var vt=class{static async create(t,e,o){var c,l,u,h,p,d;console.log(`[ObjectFactory] create() called for: ${t}, __BUILD_MODE__: ${typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined"}`);let a=(c=e==null?void 0:e.render)==null?void 0:c.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${t}, returning empty container`);let f=new Ke;return this.applyTransform(f,e==null?void 0:e.transform),f}console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${t}, type: ${a.type}, path: ${a.path}`);let r=await ot.load(t,a,o);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${t}, rawAsset type: ${(l=r==null?void 0:r.constructor)==null?void 0:l.name}`);let i;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",r,"for object:",t),i=new ra(r),console.log("[ObjectFactory] Created object:",i,"type:",(u=i==null?void 0:i.constructor)==null?void 0:u.name),this.applyTransform(i,e==null?void 0:e.transform);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",t,"rawAsset type:",(h=r==null?void 0:r.constructor)==null?void 0:h.name,r),r&&(((p=r.constructor)==null?void 0:p.name)==="Container"||r instanceof Ke)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let f=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],y=!1;for(let m of f)try{let g=await fetch(m);if(g.ok){i=await g.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",m,"type:",(d=i==null?void 0:i.constructor)==null?void 0:d.name),y=!0;break}}catch{continue}y||(console.error("[ObjectFactory] Failed to reload JSON from any path"),i=r)}else i=r;else i=r,i&&typeof i=="object"&&("x"in i||"position"in i)&&this.applyTransform(i,e==null?void 0:e.transform);return i}static applyTransform(t,e){var o,s,a,r;!e||!t||(e.position&&("x"in t&&"y"in t?(t.x=(o=e.position.x)!=null?o:0,t.y=(s=e.position.y)!=null?s:0):"position"in t&&t.position&&t.position.set((a=e.position.x)!=null?a:0,(r=e.position.y)!=null?r:0)),e.scale!==void 0&&"scale"in t&&t.scale&&(typeof t.scale=="object"&&"set"in t.scale?t.scale.set(e.scale):t.scale=e.scale),e.rotation!==void 0&&"rotation"in t&&(t.rotation=e.rotation),e.anchor&&"anchor"in t&&t.anchor&&Array.isArray(e.anchor)&&("set"in t.anchor?t.anchor.set(e.anchor[0],e.anchor[1]):(t.anchor.x=e.anchor[0],t.anchor.y=e.anchor[1])))}};export{X as AssetCache,ot as AssetLoader,_t as GameObject,Tt as GameObjectManager,vt as ObjectFactory,mt as Renderer,yt as Transform,Vn as animateHandClick,zn as animatePanelEntrance,Yn as createEndGamePanel,Qn as createHandTutorial,Nn as createPixiBase,Zn as createTutorialLabel,Rn as getRegisteredFontIds,na as playLottieOverlay,kn as registerFont,Mt as registerType,J as resolveFont,G as resolveFontWeight,ea as setLottieInstance,jn as updateHandAnimation};
1
+ import{A as z,B as A,C as B,D as C,E as D,F as E,G as F,H as G,I as H,J as I,K as J,L as K,M as L,b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s,u as t,v as u,w as v,x as w,y as x,z as y}from"../chunk-GYW3GFXA.mjs";import"../chunk-BDZGKN5O.mjs";import"../chunk-HN7I4BLB.mjs";export{s as AssetCache,u as AssetLoader,C as AssetSystem,A as Assets,x as BaseSystem,w as GameEngine,d as GameObject,e as GameObjectManager,v as ObjectFactory,c as Renderer,y as RuntimeObjectRegistry,m as SplashScreen,b as Transform,l as animateHandClick,k as animatePanelEntrance,J as applyScreenAnchor,z as basePixi,E as clearResponsiveElements,j as createEndGamePanel,n as createHandTutorial,a as createPixiBase,o as createTutorialLabel,i as getRegisteredFontIds,D as globalResponsiveMultipliers,B as initAssets,K as layout,r as playLottieOverlay,h as registerFont,t as registerType,G as resolveAnchorVec2,f as resolveFont,g as resolveFontWeight,H as resolveScreenAnchorPoint,I as resolveScreenRatioPoint,L as runInitSequence,q as setLottieInstance,p as updateHandAnimation,F as updateScreenState};
@@ -0,0 +1 @@
1
+ :root{--ui-bg: #0f1218;--ui-bg-2: #101520;--ui-surface: #171c25;--ui-surface-2: #1f2530;--ui-border: #2b3544;--ui-text: #e8edf3;--ui-muted: #9aa7b4;--ui-accent: #3dd6c6;--ui-accent-2: #ff9f43;--ui-accent-3: #6f8cff;--ui-danger: #ff5c70;--ui-shadow: 0 18px 40px rgba(5, 10, 18, .45)}.preview-shell{height:100vh;width:100vw;background:radial-gradient(circle at top left,#182033 0%,var(--ui-bg) 45%,#0c1018 100%);color:var(--ui-text);font-family:Avenir Next,Avenir,Futura,Gill Sans,Trebuchet MS,sans-serif;display:flex;flex-direction:column;box-sizing:border-box}.preview-stage{height:100%;display:flex;flex-direction:column}.preview-toolbar{height:54px;background:linear-gradient(135deg,var(--ui-bg-2),#121926 50%,#141b28 100%);border-bottom:1px solid var(--ui-border);display:flex;align-items:center;justify-content:flex-start;padding:0 12px;z-index:10;gap:10px;width:100%;box-sizing:border-box;overflow:hidden;flex-shrink:0}.zoom-controls{display:flex;align-items:center;gap:2px;margin-left:auto;flex-shrink:0}.device-dropdown{flex-shrink:1;min-width:0;max-width:100%}.preview-btn{flex-shrink:0;white-space:nowrap}@media(max-width:768px){.preview-toolbar{padding:0 4px;height:50px;gap:4px}.device-dropdown{font-size:11px;padding:2px 4px;min-width:100px}.preview-btn{padding:3px 6px;font-size:11px}.zoom-label{font-size:11px;min-width:30px}@media(max-width:480px){#refresh-btn,#debug-toggle,#console-toggle{display:none}}}.device-frame{box-shadow:0 0 0 1px #ffffff14,0 18px 40px #0000008c;border-radius:14px;background-color:#000;transition:width .3s ease,height .3s ease;overflow:hidden;position:relative}.console-panel{position:absolute;bottom:0;left:0;right:0;height:200px;background:#10141cf5;border-top:1px solid var(--ui-border);display:flex;flex-direction:column;transition:opacity .3s ease,visibility .3s ease;z-index:100}.console-panel.closed{opacity:0;visibility:hidden;pointer-events:none}.console-msg{font-family:Consolas,Monaco,monospace;font-size:12px;padding:4px 8px;border-bottom:1px solid #333}.console-msg.type-warn{color:#feca57}.preview-toolbar-left{display:flex;align-items:center}.preview-logo{font-weight:700;font-size:13px;color:var(--ui-text);letter-spacing:1.2px;text-transform:uppercase}.preview-toolbar-center,.preview-toolbar-right{display:flex;align-items:center;gap:8px}.view-toggle{display:flex;align-items:center;gap:6px;padding:2px;background:#121826;border:1px solid var(--ui-border);border-radius:999px}.view-toggle-btn{border:none;background:transparent;color:var(--ui-muted);font-size:11px;padding:6px 12px;border-radius:999px;cursor:pointer;transition:all .2s ease}.view-toggle-btn.active{color:var(--ui-text);background:#263146;box-shadow:inset 0 0 0 1px #6f8cff66}.device-selector-wrapper{position:relative}.device-dropdown{background-color:#1d2430;color:var(--ui-text);border:1px solid var(--ui-border);border-radius:8px;padding:6px 10px;font-size:12px;min-width:150px;max-width:100%;cursor:pointer;overflow:hidden;text-overflow:ellipsis}.device-dropdown:focus{outline:none;border-color:var(--ui-accent-3)}.preview-btn{background-color:#202836;color:var(--ui-text);border:1px solid var(--ui-border);border-radius:8px;padding:6px 10px;font-size:12px;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;gap:6px}.preview-btn:hover{background-color:#2a3446;border-color:#3b475c}.preview-btn:active{background-color:#343f55}.preview-btn:disabled,.device-dropdown:disabled{opacity:.5;cursor:not-allowed}.icon-btn{padding:6px;width:30px;height:30px;justify-content:center}@media(max-width:768px){.icon-btn{padding:3px;width:24px;height:24px}.icon-btn svg{width:12px;height:12px}}.icon-btn svg{width:16px;height:16px}.toolbar-divider{width:1px;height:20px;background-color:#555;margin:0 4px}.zoom-label{font-size:12px;color:var(--ui-muted);min-width:35px;text-align:center}.console-toggle{position:relative}.console-badge{background-color:#ff6b6b;color:#fff;font-size:10px;padding:2px 4px;border-radius:8px;margin-left:4px;display:none}.console-badge.has-errors{display:inline-block}.preview-main{flex:1;position:relative;overflow:hidden;background:radial-gradient(circle at 30% 20%,rgba(61,214,198,.1),transparent 45%),radial-gradient(circle at 70% 80%,rgba(111,140,255,.14),transparent 50%),#0e1118}.preview-container{width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:16px;box-sizing:border-box}.frame-wrapper{display:flex;justify-content:center;align-items:center;transform-origin:center center;transition:transform .2s cubic-bezier(.25,.46,.45,.94);filter:drop-shadow(0 12px 24px rgba(0,0,0,.45))}.game-container{width:100%;height:100%;position:relative}.console-header{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;border-bottom:1px solid var(--ui-border);background-color:#141a24}.console-title{font-weight:600;font-size:14px;color:var(--ui-text)}.console-actions{display:flex;gap:8px}.console-action-btn{background-color:transparent;color:var(--ui-muted);border:1px solid var(--ui-border);border-radius:3px;padding:4px 8px;font-size:11px;cursor:pointer;transition:all .2s ease}.console-action-btn:hover{background-color:#243041;color:var(--ui-text)}.console-messages{flex:1;overflow-y:auto;padding:4px 0}.console-msg{font-family:Consolas,Monaco,monospace;font-size:12px;padding:4px 12px;border-bottom:1px solid #333;word-wrap:break-word}.console-msg .time{color:#888;margin-right:8px;font-size:11px}.console-msg.type-log{color:#fff}.console-msg.type-info{color:#74c0fc}.console-msg.type-error{color:#ff6b6b;background:#ff00001a}.console-msg.type-warn{color:#feca57;background:#ffc1071a}.debug-overlay{position:absolute;inset:0;z-index:200;pointer-events:none}.debug-overlay.hidden{display:none}.scene-panel{position:absolute;width:320px;max-height:78vh;background:#12161ef5;border:1px solid var(--ui-border);border-radius:14px;box-shadow:var(--ui-shadow);pointer-events:auto;overflow:hidden;box-sizing:border-box}.scene-panel.scene-objects{width:300px}.scene-panel.scene-tools{max-height:46vh}.scene-panel.scene-tools .scene-panel-body{max-height:calc(46vh - 44px)}.customize-panel{width:320px}.customize-list{display:flex;flex-direction:column;gap:8px}.customize-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.customize-row{display:flex;align-items:center;gap:8px;background:#141a24b3;border:1px solid rgba(255,255,255,.05);border-radius:8px;padding:6px 8px}.customize-key{flex:0 0 120px;font-size:11px;color:var(--ui-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.customize-input{flex:1;background-color:#1d2430;color:var(--ui-text);border:1px solid var(--ui-border);border-radius:6px;padding:4px 6px;font-size:11px;font-family:JetBrains Mono,SF Mono,Consolas,Monaco,monospace}.customize-actions{display:flex;align-items:center;gap:6px}.customize-icon-btn{width:28px;height:28px;border-radius:8px;border:1px solid rgba(111,140,255,.4);background:#19202ccc;color:var(--ui-text);display:inline-flex;align-items:center;justify-content:center;cursor:pointer}.customize-icon-btn svg{width:14px;height:14px;fill:currentColor}.customize-icon-btn.ai{font-size:10px;font-weight:700;letter-spacing:.05em;padding:4px 6px}.customize-file{display:none}.customize-color-field{display:flex;flex-direction:column;gap:6px;padding:8px;border-radius:8px;background:#141a24b3;border:1px solid rgba(255,255,255,.05);font-size:11px;color:var(--ui-muted)}.customize-color-field input[type=color]{width:100%;height:28px;padding:0;border:none;background:transparent}.customize-color-text{background-color:#1d2430;color:var(--ui-text);border:1px solid var(--ui-border);border-radius:6px;padding:4px 6px;font-size:11px;font-family:JetBrains Mono,SF Mono,Consolas,Monaco,monospace}.customize-help{margin-top:6px;font-size:10px;color:var(--ui-muted)}.customize-empty{font-size:11px;color:var(--ui-muted);padding:6px 0}.batch-ai-label{font-size:11px;color:var(--ui-muted)}.batch-ai-input,.batch-ai-textarea,.batch-ai-select{width:100%;padding:6px 8px;border-radius:8px;border:1px solid rgba(255,255,255,.08);background:#0a0e14d9;color:var(--ui-text);font-size:12px}.batch-ai-textarea{min-height:70px;resize:vertical}.batch-ai-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.batch-ai-actions{margin-top:6px}.batch-ai-btn{border:1px solid var(--ui-border);background:#19202ccc;color:var(--ui-text);border-radius:8px;padding:4px 10px;font-size:11px;cursor:pointer}.batch-ai-btn.primary{border-color:#bf7eff99;background:#bf7eff33}.batch-ai-file{display:none}.batch-ai-file-name,.batch-ai-status{font-size:11px;color:var(--ui-muted)}.batch-ai-dna{margin-top:8px;padding:8px;border-radius:10px;border:1px solid rgba(255,255,255,.06);background:#10141c99}.batch-ai-palette{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}.batch-ai-swatch{width:22px;height:22px;border-radius:6px;border:1px solid rgba(255,255,255,.2)}.batch-ai-muted{font-size:11px;color:var(--ui-muted)}.batch-ai-asset-list{margin-top:10px;display:flex;flex-direction:column;gap:10px}.batch-ai-item{border-radius:10px;border:1px solid rgba(255,255,255,.06);background:#0c1016b3;padding:8px;display:flex;flex-direction:column;gap:8px}.batch-ai-item-header{display:flex;align-items:center;justify-content:space-between;gap:8px}.batch-ai-toggle{display:inline-flex;align-items:center;gap:6px;font-size:11px;color:var(--ui-text)}.batch-ai-item-body{display:flex;flex-direction:column;gap:8px}.batch-ai-thumb{width:100%;max-height:140px;object-fit:contain;border-radius:8px;border:1px solid rgba(255,255,255,.08);background:#080a0e99}.batch-ai-thumb.hidden{display:none}.batch-ai-item-status{font-size:11px;color:var(--ui-muted)}.batch-ai-item-actions{display:flex;gap:8px;flex-wrap:wrap}.batch-ai-empty{font-size:11px;color:var(--ui-muted);padding:6px 0}.brand-dna-label{font-size:11px;color:var(--ui-muted)}.brand-dna-input,.brand-dna-textarea,.brand-dna-select{width:100%;padding:6px 8px;border-radius:8px;border:1px solid rgba(255,255,255,.08);background:#0a0e14d9;color:var(--ui-text);font-size:12px}.brand-dna-textarea{min-height:70px;resize:vertical}.brand-dna-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.brand-dna-btn{border:1px solid var(--ui-border);background:#19202ccc;color:var(--ui-text);border-radius:8px;padding:4px 10px;font-size:11px;cursor:pointer}.brand-dna-btn.primary{border-color:#6f8cff99;background:#6f8cff33}.brand-dna-file{display:none}.brand-dna-file-name,.brand-dna-status{font-size:11px;color:var(--ui-muted)}.brand-dna-meta{margin-top:8px}.brand-dna-prompt{margin:6px 0 0;padding:8px;border-radius:10px;border:1px solid rgba(255,255,255,.06);background:#0c1016b3;color:var(--ui-text);font-size:11px;white-space:pre-wrap}.brand-dna-output{margin-top:8px;padding:8px;border-radius:10px;border:1px solid rgba(255,255,255,.06);background:#10141c99}.brand-dna-palette{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}.brand-dna-swatch{width:22px;height:22px;border-radius:6px;border:1px solid rgba(255,255,255,.2)}.brand-dna-muted{font-size:11px;color:var(--ui-muted)}.brand-dna-object-list{margin-top:10px;display:flex;flex-direction:column;gap:10px}.brand-dna-object{border-radius:10px;border:1px solid rgba(255,255,255,.06);background:#0c1016b3;padding:8px;display:flex;flex-direction:column;gap:8px}.brand-dna-object-header{display:flex;align-items:center;justify-content:space-between;gap:8px}.brand-dna-object-title{font-size:11px;color:var(--ui-text);word-break:break-all}.brand-dna-object-status{font-size:11px;color:var(--ui-muted)}.brand-dna-empty{font-size:11px;color:var(--ui-muted);padding:6px 0}.ai-panel{display:flex;flex-direction:column;gap:10px;padding:8px;border-radius:10px;border:1px solid rgba(255,255,255,.06);background:#10141c99}.ai-modal{position:fixed;inset:0;background:#060a10d1;display:flex;align-items:center;justify-content:center;z-index:10080}.ai-modal-card{width:min(760px,92vw);max-height:90vh;overflow:auto;background:#10141cfa;border:1px solid var(--ui-border);border-radius:16px;box-shadow:0 20px 50px #00000073}.ai-modal-header{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:1px solid rgba(255,255,255,.06)}.ai-modal-actions{display:inline-flex;align-items:center;gap:8px}.ai-modal-title{font-size:14px;font-weight:700;color:var(--ui-text)}.ai-modal-subtitle{font-size:11px;color:var(--ui-muted);margin-top:3px}.ai-modal-close,.ai-modal-gallery{border:1px solid var(--ui-border);background:#19202ccc;color:var(--ui-text);border-radius:8px;padding:4px 12px;font-size:11px;cursor:pointer}.ai-loading{display:none;align-items:center;gap:12px;padding:10px 12px;border-radius:10px;background:linear-gradient(120deg,#58a3ff1a,#ff639424);border:1px solid rgba(88,163,255,.25)}.ai-loading.active{display:flex}.ai-loading-ring{width:26px;height:26px;border-radius:50%;border:3px solid rgba(255,255,255,.15);border-top-color:#58a3ffe6;animation:ai-spin .9s linear infinite}.ai-loading-bar{flex:1;height:8px;border-radius:999px;background:linear-gradient(90deg,#58a3ff33,#ff6394b3,#58a3ff33);background-size:200% 100%;animation:ai-bar 1.4s ease infinite}.ai-loading-text{font-size:11px;color:var(--ui-text)}@keyframes ai-spin{to{transform:rotate(360deg)}}@keyframes ai-bar{0%{background-position:0% 50%}to{background-position:100% 50%}}.ai-label{font-size:11px;color:var(--ui-muted)}.ai-input,.ai-select,.ai-textarea{width:100%;padding:6px 8px;border-radius:8px;border:1px solid rgba(255,255,255,.08);background:#0a0e14d9;color:var(--ui-text);font-size:12px}.ai-textarea{min-height:70px;resize:vertical}.ai-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.ai-strength{gap:10px}.ai-strength input[type=range]{flex:1;min-width:160px}.ai-strength-value{font-size:11px;color:var(--ui-text);min-width:20px;text-align:right}.ai-gallery{border-radius:10px;border:1px solid rgba(255,255,255,.06);background:#0c1016a6;padding:8px}.ai-gallery.hidden{display:none}.ai-gallery-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(90px,1fr));gap:8px}.ai-gallery-item{border:1px solid rgba(255,255,255,.08);background:#080a0eb3;border-radius:10px;padding:6px;display:flex;flex-direction:column;gap:6px;cursor:pointer;text-align:left}.ai-gallery-item.active{border-color:#6f8cff99;box-shadow:0 0 0 1px #6f8cff40}.ai-gallery-thumb{width:100%;height:70px;object-fit:contain;border-radius:6px;background:#06080cb3;border:1px solid rgba(255,255,255,.08)}.ai-gallery-label{font-size:10px;color:var(--ui-text);word-break:break-all}.ai-gallery-empty{font-size:11px;color:var(--ui-muted)}.ai-btn{border:1px solid var(--ui-border);background:#19202ccc;color:var(--ui-text);border-radius:8px;padding:4px 10px;font-size:11px;cursor:pointer}.ai-file{display:none}.ai-file-name{font-size:11px;color:var(--ui-muted)}.ai-toggles label{font-size:11px;color:var(--ui-text);display:inline-flex;align-items:center;gap:6px}.ai-actions .debug-btn{flex:1}.ai-status{font-size:11px;color:var(--ui-muted)}.ai-preview{width:100%;border-radius:10px;border:1px solid rgba(255,255,255,.08);background:#080a0e99;padding:8px;display:flex;justify-content:center;align-items:center;min-height:140px}.ai-preview img{max-width:100%;max-height:220px;object-fit:contain}.asset-preview-modal{position:fixed;inset:0;background:#080a0eb8;display:flex;align-items:center;justify-content:center;z-index:10050}.asset-preview-card{width:min(720px,92vw);max-height:82vh;background:#10141cfa;border:1px solid var(--ui-border);border-radius:14px;box-shadow:var(--ui-shadow);display:flex;flex-direction:column}.asset-preview-header{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:1px solid rgba(255,255,255,.06);color:var(--ui-text)}.asset-preview-title{font-size:12px;font-weight:600;word-break:break-all}.asset-preview-close{border:1px solid var(--ui-border);background:#19202ccc;color:var(--ui-text);border-radius:8px;padding:4px 10px;font-size:11px;cursor:pointer}.asset-preview-meta{padding:0 14px 10px;color:var(--ui-muted);font-size:11px;word-break:break-all;border-bottom:1px solid rgba(255,255,255,.06)}.asset-preview-actions{display:flex;align-items:center;gap:8px}.asset-preview-change,.asset-preview-ai{border:1px solid var(--ui-border);background:#19202ccc;color:var(--ui-text);border-radius:8px;padding:4px 10px;font-size:11px;cursor:pointer}.asset-preview-body{padding:12px;overflow:auto;display:flex;align-items:center;justify-content:center}.asset-preview-ai-output{border-top:1px solid rgba(255,255,255,.06);padding:10px 12px 14px}.asset-preview-ai-output.hidden{display:none}.asset-preview-ai-label{font-size:11px;color:var(--ui-muted);margin-bottom:6px}.asset-preview-ai-image{width:100%;max-height:200px;object-fit:contain;border-radius:10px;border:1px solid rgba(255,255,255,.08);background:#080a0e99}.asset-preview-body img{max-width:100%;max-height:60vh;object-fit:contain}.asset-preview-body audio{width:100%}.asset-preview-body pre{width:100%;white-space:pre-wrap;color:var(--ui-text);font-family:JetBrains Mono,SF Mono,Consolas,Monaco,monospace;font-size:12px}.asset-crop-modal{position:fixed;inset:0;background:#080a0ec7;display:flex;align-items:center;justify-content:center;z-index:10060}.asset-crop-card{width:min(860px,96vw);background:#10141cfa;border:1px solid var(--ui-border);border-radius:14px;box-shadow:var(--ui-shadow);display:flex;flex-direction:column}.asset-crop-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 16px;border-bottom:1px solid rgba(255,255,255,.06);color:var(--ui-text)}.asset-crop-title{font-size:13px;font-weight:600}.asset-crop-subtitle{font-size:11px;color:var(--ui-muted);margin-top:2px}.asset-crop-close{border:1px solid var(--ui-border);background:#19202ccc;color:var(--ui-text);border-radius:8px;padding:4px 10px;font-size:11px;cursor:pointer}.asset-crop-body{padding:16px;display:flex;justify-content:center;gap:16px;flex-wrap:nowrap;align-items:flex-start}.asset-crop-column{display:flex;flex-direction:column;gap:8px;align-items:center;min-width:0}.asset-crop-label{font-size:11px;color:var(--ui-muted);text-transform:uppercase;letter-spacing:.08em}.asset-crop-canvas{border-radius:12px;border:1px solid rgba(255,255,255,.08);background:#080a0e8c;cursor:grab}.asset-crop-preview{border-radius:12px;border:1px solid rgba(255,255,255,.08);background:#080a0e8c}.asset-crop-canvas:active{cursor:grabbing}.asset-crop-controls{display:flex;align-items:center;gap:12px;padding:0 16px 12px;color:var(--ui-text);font-size:12px}.asset-crop-controls label{min-width:42px}.asset-crop-zoom{flex:1}.asset-crop-zoom-value{min-width:50px;text-align:right;color:var(--ui-muted)}.asset-crop-reset{border:1px solid var(--ui-border);background:#19202ccc;color:var(--ui-text);border-radius:8px;padding:4px 10px;font-size:11px;cursor:pointer}.asset-crop-actions{display:flex;justify-content:flex-end;gap:10px;padding:0 16px 16px}.asset-crop-actions button{border-radius:10px;padding:6px 14px;font-size:12px;border:1px solid var(--ui-border);background:#1c2432d9;color:var(--ui-text);cursor:pointer}.asset-crop-apply{background:var(--ui-accent);border-color:transparent;color:#10151f;font-weight:600}@media(max-width:720px){.customize-grid{grid-template-columns:1fr}}.scene-panel-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 14px;background-color:#181c26f2;color:var(--ui-text);font-size:12px;user-select:none;cursor:move;border-bottom:1px solid rgba(255,255,255,.05)}.scene-panel-actions{display:flex;align-items:center;gap:8px}.scene-panel-action{border:1px solid var(--ui-border);border-radius:6px;background:#1f2633;color:var(--ui-muted);font-size:11px;padding:4px 8px;cursor:pointer}.scene-panel-action:hover{border-color:#ff9f4399;color:var(--ui-text)}.scene-panel-toggle{border:none;background:transparent;color:var(--ui-muted);font-size:14px;cursor:pointer;transition:transform .2s ease}.panel-title{display:flex;align-items:center;gap:8px}.panel-pill{padding:2px 8px;border-radius:999px;background:#3dd6c61f;color:var(--ui-accent);font-size:10px;text-transform:uppercase;letter-spacing:.6px}.panel-accent-blue .panel-pill{background:#6f8cff24;color:var(--ui-accent-3)}.panel-accent-amber .panel-pill{background:#ff9f4329;color:var(--ui-accent-2)}.panel-accent-violet .panel-pill{background:#bf7eff2e;color:#d6b7ff}.panel-title-text{font-weight:700;font-size:12px;letter-spacing:.4px}.panel-accent-teal{border-color:#3dd6c659}.panel-accent-blue{border-color:#6f8cff59}.panel-accent-amber{border-color:#ff9f4366}.panel-accent-violet{border-color:#bf7eff59}.scene-panel-body{padding:12px 14px 16px;overflow-y:auto;max-height:calc(78vh - 44px)}.scene-panel.collapsed .scene-panel-body{display:none}.scene-panel.collapsed .scene-panel-toggle{transform:rotate(-90deg)}.scene-panel-search input{width:100%;background-color:#1d2430;color:var(--ui-text);border:1px solid var(--ui-border);border-radius:6px;padding:6px 8px;font-size:12px}.scene-panel-search input:focus{outline:none;border-color:var(--ui-accent);box-shadow:0 0 0 2px #3dd6c633}.scene-panel-filters{display:flex;gap:6px;margin-top:10px}.filter-chip{border:1px solid rgba(111,140,255,.3);background:#131822b3;color:var(--ui-muted);font-size:11px;border-radius:999px;padding:4px 10px;cursor:pointer;transition:all .2s ease}.filter-chip.active{color:var(--ui-text);border-color:#3dd6c680;background:#3dd6c626}.scene-object-list{margin-top:12px;display:flex;flex-direction:column;gap:12px}.scene-object-group-title{font-size:11px;color:var(--ui-muted);text-transform:uppercase;letter-spacing:.6px;margin-bottom:6px}.scene-object-count{margin-left:6px;padding:2px 6px;border-radius:999px;background:#ffffff14;color:var(--ui-text);font-size:10px}.scene-object-group-items{display:flex;flex-direction:column;gap:6px}.scene-object-item{width:100%;text-align:left;border:1px solid rgba(255,255,255,.06);border-radius:6px;background-color:#191e28e6;color:var(--ui-text);font-size:12px;padding:6px 8px;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:8px}.scene-object-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.scene-object-badge{font-size:10px;padding:2px 6px;border-radius:999px;text-transform:uppercase;letter-spacing:.4px;border:1px solid rgba(255,255,255,.1)}.scene-object-badge.ui{background:#3dd6c61f;color:var(--ui-accent)}.scene-object-badge.scene{background:#6f8cff1f;color:var(--ui-accent-3)}.scene-object-item:hover{border-color:#3dd6c680;color:var(--ui-text)}.scene-object-item.selected{border-color:#3dd6c6b3;color:var(--ui-text);box-shadow:inset 0 0 0 1px #3dd6c666}.scene-edit-selected{font-size:12px;color:var(--ui-muted);margin-bottom:10px}.debug-header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid #444;background-color:#252525;border-radius:8px 8px 0 0;cursor:move;user-select:none}.debug-tabs{display:flex;gap:6px;padding:8px 12px;border-bottom:1px solid #333;background-color:#1f1f1f}.debug-tab{flex:1;border:1px solid #444;border-radius:6px;background-color:#262626;color:#bfc3c7;font-size:12px;padding:6px 10px;cursor:pointer;transition:all .2s ease}.debug-tab.active{background-color:#323232;color:#fff;border-color:#ffb43b;box-shadow:inset 0 0 0 1px #ffb43b59}.debug-hint{font-size:11px;color:#9aa0a6;margin-bottom:10px}.debug-tab-panel{display:none}.debug-tab-panel.active{display:block}.debug-collapsible{border:1px solid rgba(255,255,255,.08);border-radius:10px;background-color:#151a24d9;overflow:hidden;margin-bottom:12px}.debug-collapsible-header{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;background-color:#181e2ae6;border:none;color:var(--ui-text);font-size:12px;cursor:pointer}.debug-collapsible-body{padding:10px 12px}.debug-collapsible-icon{transition:transform .2s ease}.debug-collapsible.collapsed .debug-collapsible-body{display:none}.debug-collapsible.collapsed .debug-collapsible-icon{transform:rotate(-90deg)}.debug-nudge.hidden{display:none}.debug-arrow-pad{display:grid;grid-template-columns:repeat(3,36px);grid-auto-rows:32px;gap:6px;justify-content:center;margin-top:8px}.debug-arrow-btn{border:1px solid #444;border-radius:6px;background-color:#2b2b2b;color:#e7e7e7;font-size:14px;cursor:pointer;transition:all .15s ease}.debug-arrow-btn:hover{border-color:#ffb43b;color:#fff}.debug-arrow-btn:active{transform:translateY(1px)}.debug-arrow-btn[data-nudge=up]{grid-column:2}.debug-arrow-btn[data-nudge=left]{grid-column:1}.debug-arrow-btn[data-nudge=down]{grid-column:2}.debug-arrow-btn[data-nudge=right]{grid-column:3}.debug-info-grid{display:flex;flex-direction:column;gap:8px;padding:8px;border-radius:6px;background-color:#191e28cc;border:1px solid rgba(255,255,255,.08)}.debug-info-row{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:11px}.debug-info-label{color:#9aa0a6}.debug-info-value{color:#f1f3f5;font-weight:600}.debug-title{font-weight:600;font-size:14px;color:#fff}.debug-actions{display:flex;gap:8px}.debug-action-btn{background-color:transparent;color:#ccc;border:1px solid #555;border-radius:3px;padding:4px 8px;font-size:11px;cursor:pointer;transition:all .2s ease}.debug-action-btn:hover{background-color:#444;color:#fff}.debug-content{flex:1;overflow-y:auto;padding:12px 16px}.debug-section{margin-bottom:20px}.panel-section{margin-bottom:16px;padding-bottom:12px;border-bottom:1px solid rgba(255,255,255,.06)}.panel-section:last-child{border-bottom:none;margin-bottom:0;padding-bottom:0}.panel-section-title{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.6px;color:var(--ui-muted);margin-bottom:8px}.field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}@media(max-width:520px){.field-grid{grid-template-columns:1fr}}.debug-section-title{font-size:12px;font-weight:600;color:var(--ui-muted);text-transform:uppercase;letter-spacing:.5px;margin-bottom:8px;border-bottom:1px solid rgba(255,255,255,.08);padding-bottom:4px}.debug-field{margin-bottom:12px}.debug-field label{display:block;font-size:11px;color:#aaa;margin-bottom:4px;font-weight:500}.debug-field input,.debug-field select{width:100%;background-color:#1d2430;color:var(--ui-text);border:1px solid var(--ui-border);border-radius:4px;padding:6px 8px;font-size:12px;font-family:JetBrains Mono,SF Mono,Consolas,Monaco,monospace;transition:border-color .2s ease}.debug-field input:focus,.debug-field select:focus{outline:none;border-color:var(--ui-accent-3);box-shadow:0 0 0 2px #6f8cff33}.debug-field input[type=range]{-webkit-appearance:none;appearance:none;height:6px;background:#555;border-radius:3px;outline:none}.debug-field input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:16px;height:16px;border-radius:50%;background:var(--ui-accent-3);cursor:pointer}.debug-field input[type=range]::-moz-range-thumb{width:16px;height:16px;border-radius:50%;background:var(--ui-accent-3);cursor:pointer;border:none}.debug-field input[type=checkbox]{width:auto;margin-right:8px}.debug-field.checkbox-field{display:flex;align-items:center;gap:8px}.debug-field.checkbox-field label{margin-bottom:0;flex:1}.debug-value-display{display:inline-block;margin-left:8px;font-size:11px;color:var(--ui-muted);font-family:JetBrains Mono,SF Mono,Consolas,Monaco,monospace}.debug-btn-group{display:flex;gap:6px;margin-top:8px}.debug-btn{flex:1;background-color:#444;color:#fff;border:1px solid #666;border-radius:4px;padding:6px 8px;font-size:11px;cursor:pointer;transition:all .2s ease}.debug-btn:hover{background-color:#555;border-color:#888}.debug-btn.primary{background-color:#2a5bd7;border-color:#2a5bd7}.debug-btn.primary:hover{background-color:#2147a7;border-color:#2147a7}.debug-btn.danger{background-color:#dc3545;border-color:#dc3545}.debug-btn.danger:hover{background-color:#c82333;border-color:#c82333}.debug-btn.secondary{background-color:#3dd6c61a;border-color:#3dd6c64d;color:#3dd6c6}.debug-btn.secondary:hover{background-color:#3dd6c633;border-color:#3dd6c666}.config-editor{border:1px solid rgba(255,255,255,.08);border-radius:10px;padding:12px;margin-top:8px;background-color:#191e28d9}.debug-select{width:100%;background-color:#1d2430;color:var(--ui-text);border:1px solid var(--ui-border);border-radius:4px;padding:6px 8px;font-size:11px}.debug-select:focus{outline:none;border-color:var(--ui-accent-3);box-shadow:0 0 0 2px #6f8cff33}.debug-select option{background-color:#333;color:#fff}.json-modal{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#000c;z-index:10000;display:flex;align-items:center;justify-content:center}.json-modal-content{background-color:#1e1e1e;border:1px solid #555;border-radius:8px;width:80%;max-width:800px;max-height:80%;display:flex;flex-direction:column}.json-modal-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #444}.json-modal-header h3{margin:0;color:#fff;font-size:16px;font-weight:600}.json-modal-body{flex:1;padding:16px 20px;overflow-y:auto}.json-modal-body pre{margin:0;color:#fff;font-family:Consolas,Monaco,monospace;font-size:12px;line-height:1.4;white-space:pre-wrap;word-wrap:break-word}.debug-toggle{position:relative}.debug-toggle-badge{background-color:#28a745;color:#fff;font-size:10px;padding:2px 4px;border-radius:8px;margin-left:4px;display:none}.debug-toggle-badge.active{display:inline-block}.preview-stage{width:100%;height:100%;display:flex;align-items:center;justify-content:center;position:relative}.preview-stage.hidden{display:none}.compare-grid{width:100%;height:100%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;padding:8px;box-sizing:border-box}.compare-viewport{display:flex;flex-direction:column;background:#141820e6;border:1px solid rgba(111,140,255,.2);border-radius:14px;box-shadow:var(--ui-shadow);overflow:hidden;position:relative}.compare-viewport.is-active{border-color:#3dd6c699;box-shadow:0 0 0 1px #3dd6c666,var(--ui-shadow)}.compare-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;background:#121720e6;border-bottom:1px solid rgba(255,255,255,.06);color:var(--ui-text)}.compare-title{display:flex;flex-direction:column;gap:2px}.compare-title-text{font-size:12px;font-weight:700;letter-spacing:.6px;text-transform:uppercase}.compare-meta{font-size:11px;color:var(--ui-muted)}.compare-focus{border:1px solid rgba(111,140,255,.5);background:#1e2638b3;color:var(--ui-text);border-radius:999px;padding:4px 10px;font-size:11px;cursor:pointer}.compare-viewport.is-active .compare-focus{border-color:#3dd6c699;background:#3dd6c62e;color:#e9fff9}.compare-body{position:relative;flex:1;display:flex;align-items:center;justify-content:center;padding:10px;box-sizing:border-box}.compare-slot,.compare-ghost{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}.compare-ghost.hidden{display:none}.compare-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:11px;color:var(--ui-muted);background:#0a0d1259;opacity:0;transition:opacity .2s ease;pointer-events:none}.compare-viewport:not(.is-active) .compare-overlay{opacity:1}.snapshot-canvas{width:100%;height:100%;display:block;background:#000}@media(max-width:1100px){.compare-grid{grid-template-columns:1fr;grid-auto-rows:minmax(0,1fr)}}@media(max-width:720px){.scene-panel.scene-tools{width:calc(100% - 32px);left:16px!important;right:auto}}.panel-resize-handle{position:absolute;top:0;right:0;width:10px;height:100%;cursor:ew-resize}.panel-resize-handle:after{content:"";position:absolute;top:30%;right:3px;width:2px;height:40%;border-radius:2px;background:#ffffff1f}.debug-workbench{position:absolute;width:350px;height:600px;min-width:250px;min-height:200px;background:#12161ef5;border:1px solid var(--ui-border);border-radius:14px;box-shadow:var(--ui-shadow);pointer-events:auto;display:flex;flex-direction:column;overflow:hidden;z-index:1000}.workbench-header{display:flex;align-items:center;justify-content:space-between;padding:8px 14px;background-color:#181c26f2;border-bottom:1px solid rgba(255,255,255,.05);cursor:move;flex-shrink:0}.workbench-tabs{display:flex;background:#0c1018e6;padding:4px;gap:4px;border-bottom:1px solid var(--ui-border);flex-shrink:0;overflow-x:auto}.workbench-tab{flex:1;padding:6px 10px;font-size:11px;font-weight:600;color:var(--ui-muted);background:transparent;border:1px solid transparent;border-radius:6px;cursor:pointer;white-space:nowrap;transition:all .2s ease;text-align:center}.workbench-tab:hover{background:#ffffff0d;color:var(--ui-text)}.workbench-tab.active{background:#3dd6c61f;color:var(--ui-accent);border-color:#3dd6c64d}.workbench-content{flex:1;overflow-y:auto;padding:0}.workbench-tab-panel{display:none}.workbench-tab-panel.active{display:block}.workbench-resize-handle{position:absolute;bottom:0;right:0;width:16px;height:16px;cursor:nwse-resize;background:linear-gradient(135deg,transparent 50%,var(--ui-border) 50%,var(--ui-border) 75%,transparent 75%,transparent 85%,var(--ui-border) 85%);z-index:10}.workbench-content .scene-panel{position:static;width:100%!important;max-height:none!important;border:none;background:transparent;box-shadow:none;border-radius:0}.workbench-content .scene-panel-header{display:none}.workbench-content .scene-panel-body{max-height:none;padding:12px}.library-panel{border-color:#3dd6c659}.library-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(80px,1fr));gap:8px;margin-top:12px}.library-item{display:flex;flex-direction:column;align-items:center;gap:4px;padding:8px;border:2px solid transparent;border-radius:8px;cursor:pointer;transition:all .2s ease;background:#191e28cc}.library-item:hover{border-color:#3dd6c680;background:#3dd6c61a}.library-item.selected{border-color:#3dd6c6cc;background:#3dd6c626;box-shadow:0 0 0 1px #3dd6c666}.library-thumbnail{width:60px;height:40px;object-fit:cover;border-radius:4px;border:1px solid rgba(255,255,255,.1)}.library-label{font-size:11px;color:var(--ui-muted);text-align:center;word-break:break-all}.library-selected{font-size:12px;color:var(--ui-text);margin:12px 0;padding:8px;background:#191e28cc;border-radius:6px;border:1px solid rgba(255,255,255,.08)}.library-empty{font-size:11px;color:var(--ui-muted);padding:20px;text-align:center;grid-column:1 / -1}.library-category-tabs{display:flex;background:#0c1018e6;padding:4px;gap:2px;border-bottom:1px solid var(--ui-border);margin-bottom:12px}.library-category-tab{flex:1;padding:6px 8px;font-size:11px;font-weight:600;color:var(--ui-muted);background:transparent;border:1px solid transparent;border-radius:6px;cursor:pointer;white-space:nowrap;text-align:center;transition:all .2s ease}.library-category-tab:hover{background:#ffffff0d;color:var(--ui-text)}.library-category-tab.active{background:#3dd6c61f;color:var(--ui-accent);border-color:#3dd6c64d}