handler-playable-sdk 1.0.75 → 1.0.77

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/{chunk-FCISZ3OQ.js → chunk-HYNBTANV.js} +1 -1
  2. package/dist/cli/brand-dna.mjs +1 -1
  3. package/dist/cli/canva-import.mjs +1 -1
  4. package/dist/cli/cleanup-assets.mjs +1 -1
  5. package/dist/cli/fix-scales.mjs +1 -1
  6. package/dist/cli/index.js +1 -1
  7. package/dist/cli/screen-helper.mjs +1 -1
  8. package/dist/cli/setup-library.mjs +1 -1
  9. package/dist/cli/student-helper/add-logic.mjs +1 -1
  10. package/dist/cli/student-helper/add-object.mjs +1 -1
  11. package/dist/cli/student-helper/arg-parsing.mjs +1 -1
  12. package/dist/cli/student-helper/asset-registry.mjs +1 -1
  13. package/dist/cli/student-helper/bullet-system.mjs +1 -1
  14. package/dist/cli/student-helper/collectable-system.mjs +1 -1
  15. package/dist/cli/student-helper/constants.mjs +1 -1
  16. package/dist/cli/student-helper/drag-snap-couples.mjs +1 -1
  17. package/dist/cli/student-helper/endgame-screen.mjs +1 -1
  18. package/dist/cli/student-helper/fs-io.mjs +1 -1
  19. package/dist/cli/student-helper/logic-defaults.mjs +1 -1
  20. package/dist/cli/student-helper/print-help.mjs +1 -1
  21. package/dist/cli/student-helper/prompts.mjs +1 -1
  22. package/dist/cli/student-helper/scratch-card.mjs +1 -1
  23. package/dist/cli/student-helper/screen-utils.mjs +1 -1
  24. package/dist/cli/student-helper/snippets.mjs +1 -1
  25. package/dist/cli/student-helper/start-screen.mjs +1 -1
  26. package/dist/cli/student-helper/swerve-collect.mjs +1 -1
  27. package/dist/cli/student-helper/tap-destroy.mjs +1 -1
  28. package/dist/cli/student-helper/template-packs.mjs +1 -1
  29. package/dist/cli/student-helper.mjs +1 -1
  30. package/dist/cli/sync-screens.mjs +1 -1
  31. package/dist/cli/validate-assets.mjs +1 -1
  32. package/dist/cli/validate.mjs +1 -1
  33. package/dist/index.cjs +1 -1
  34. package/dist/index.js +1 -1
  35. package/dist/pixi/index.cjs +1 -1
  36. package/dist/pixi/index.js +1 -1
  37. package/dist/three/index.cjs +1 -1
  38. package/dist/three/index.js +1 -1
  39. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -43,7 +43,7 @@
43
43
  <button class="debug-btn primary" data-modal-apply>Apply</button>
44
44
  </div>
45
45
  </div>
46
- `,this.modal=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(r=>{r.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.addEventListener("click",o=>{let c=o.target.dataset.tab;c&&this.switchTab(c)})});let i=this.modal.querySelector("[data-ai-generate]");i==null||i.addEventListener("click",()=>{this.openAiEditor("generate")});let n=this.modal.querySelector("[data-ai-edit]");n==null||n.addEventListener("click",()=>{this.openAiEditor("edit")});let a=this.modal.querySelector("[data-modal-apply]");a==null||a.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",r=>{r.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(n=>{n.classList.toggle("active",n.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(n=>{n.classList.toggle("active",n.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let t=window.__openAiEditor;if(typeof t!="function"){alert("AI Editor not available. Please check your setup.");return}let i="";e==="edit"&&this.currentAsset?i=`Edit this image: ${this.currentObjectId}`:i=`Create an image for: ${this.currentObjectId}`,t(this.currentObjectId||"unknown",i,this.currentAsset,{path:this.currentPath,onApply:n=>{this.onApplyCallback&&this.onApplyCallback(n),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var zl={};At(zl,{COLORS:()=>xe,ConfigWatcher:()=>Ke,DebugPanel:()=>Gt,DefaultReloadStrategy:()=>zt,Handler:()=>he,PlayableLoadingScreen:()=>gn,PreviewShell:()=>dn,STROKE_WIDTH:()=>Nr,THEME:()=>Hr,applyConfigOverride:()=>ae,applyConfigOverrides:()=>Oe,applyConfigsToDisk:()=>yi,applyDefaults:()=>Ye,baseLottie:()=>Ln,bootstrap:()=>Al,clearConfigOverrides:()=>ce,clearConfigOverridesForObject:()=>zs,configOverrideManager:()=>$s,createPreviewShell:()=>Ra,deepClone:()=>J,default:()=>Be,defaultPreset:()=>Ai,deviceGroups:()=>ta,devicePresets:()=>ea,diffConfigs:()=>Yn,exportConfigsAsJSON:()=>We,getConfigOverrides:()=>te,getConfigStateSummary:()=>Re,getOverrideMode:()=>jt,getPresetById:()=>Xe,getPresetsByCategory:()=>Qo,loadAllObjectConfigs:()=>xi,loadComponentSchemas:()=>wi,loadEngineConfig:()=>Si,loadGamePromptConfig:()=>qn,loadObjectCentricConfig:()=>ke,loadObjectConfig:()=>$e,loadSceneConfig:()=>Ei,redoLastConfigChange:()=>bi,rehydrateObject:()=>Kn,removeConfigOverride:()=>_t,resetToApplied:()=>Ot,resetToOriginal:()=>vi,setBootstrapDependencies:()=>El,setOverrideMode:()=>Bn,setupHotReload:()=>Zn,setupLiveEditBridge:()=>pn,toLegacyFormat:()=>Vn,trackObjectCreation:()=>Ds,trackObjectDeletion:()=>Ns,undoLastConfigChange:()=>fi,validateObjectConfig:()=>ct});module.exports=ro(zl);var je={};function ti(s,e,t=!1){je[s]||(je[s]=[]),je[s].push({fn:e,once:t})}function Sn(s,e){if(je[s]){if(!e){delete je[s];return}je[s]=je[s].filter(t=>t.fn!==e)}}function ii(s,...e){let t=je[s];if(t)for(let i of[...t])i.fn(...e),i.once&&Sn(s,i.fn)}function se(s,e){ti(s,e,!0)}var K=null,ue=[],nt=null;function Za(s){K=s,ue=[],nt!==null&&(clearTimeout(nt),nt=null)}function Qa(){var s,e,t;return{endpoint:(K==null?void 0:K.endpoint)||"",transport:(K==null?void 0:K.transport)||"beacon",batchSize:(s=K==null?void 0:K.batchSize)!=null?s:10,flushIntervalMs:(e=K==null?void 0:K.flushIntervalMs)!=null?e:300,maxQueue:(t=K==null?void 0:K.maxQueue)!=null?t:200,debug:!!(K!=null&&K.debug)}}async function Xa(s,e,t,i){let n=JSON.stringify(e);if(t==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let a=navigator.sendBeacon(s,new Blob([n],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",a,e);return}catch(a){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",a)}try{await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(a){i&&console.warn("[handler.telemetry] fetch failed",a)}}function En(s,e){let t=Qa();if(e&&t.endpoint){if(ue.push(s),ue.length>t.maxQueue&&(ue=ue.slice(ue.length-t.maxQueue)),ue.length>=t.batchSize){Ja();return}nt===null&&(nt=window.setTimeout(()=>{nt=null,Ja()},t.flushIntervalMs))}}async function Ja(){let s=Qa();if(!s.endpoint||ue.length===0)return;let e=ue.splice(0,s.batchSize);await Xa(s.endpoint,{events:e},s.transport,s.debug),ue.length>0&&await Xa(s.endpoint,{events:ue.splice(0,s.batchSize)},s.transport,s.debug)}function es(s){return Math.max(0,Math.min(1,s))}function oo(s){let e=String(s!=null?s:"power2.out");if(e==="linear")return t=>t;if(e==="sine.inOut")return t=>.5-Math.cos(Math.PI*t)/2;if(e==="power2.out"||e==="easeOutQuad")return t=>1-(1-t)*(1-t);if(e.startsWith("back.out")){let t=e.match(/back\.out\(([\d.]+)\)/),i=t?Number(t[1]):1.8;return n=>1+(i+1)*Math.pow(n-1,3)+i*Math.pow(n-1,2)}return t=>1-(1-t)*(1-t)}function Lt(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function lo(s,e){let t=s==null?void 0:s[e];return typeof t=="number"?t:0}function ts(s,e,t){try{s[e]=t}catch{}}function co(s){let e=s==null?void 0:s.scale;if(!e)return null;let t=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:t,y:i}}function is(s,e){let t=s==null?void 0:s.scale;if(t)try{typeof t.set=="function"?t.set(e.x,e.y):(typeof t.x=="number"&&(t.x=e.x),typeof t.y=="number"&&(t.y=e.y))}catch{}}function ns(s,e){let t=co(s);if(!t)return{from:null,to:null};let i=null,n=null;return typeof e.scale=="number"?(i=e.scale,n=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(n=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(n=e.scaleY),i===null&&n===null?{from:null,to:null}:{from:{x:t.x,y:t.y},to:{x:i!=null?i:t.x,y:n!=null?n:t.y}}}function as(){let s=new Set,e=new WeakMap,t=null,i=()=>{if(t!=null)return;t=requestAnimationFrame(()=>{t=null,o(),s.size>0&&i()})},n=d=>{var u;s.add(d);let p=(u=e.get(d.target))!=null?u:new Set;p.add(d),e.set(d.target,p),i()},a=d=>{s.delete(d);let p=e.get(d.target);p&&(p.delete(d),p.size===0&&e.delete(d.target))},r=d=>{d.killed||(d.killed=!0,a(d))},o=()=>{var p,u;let d=Lt();for(let h of Array.from(s)){if(h.killed||h.paused)continue;let g=d-h.startMs-h.delayMs;if(g<0)continue;let m=h.durationMs>0?g/h.durationMs:1,f=es(m),b=h.repeat>=0?h.repeat+1:1,y=h.repeat>0?Math.min(Math.floor(m),b-1):0;if(h.repeat>0&&m>=1){let C=m-y;f=es(C)}let v=h.ease(f);h.yoyo&&y%2===1&&(v=1-v);for(let C of h.props)ts(h.target,C.key,C.from+(C.to-C.from)*v);h.scaleFrom&&h.scaleTo&&is(h.target,{x:h.scaleFrom.x+(h.scaleTo.x-h.scaleFrom.x)*v,y:h.scaleFrom.y+(h.scaleTo.y-h.scaleFrom.y)*v});try{(p=h.onUpdate)==null||p.call(h)}catch{}if(m>=b){r(h);try{(u=h.onComplete)==null||u.call(h)}catch{}}}},l=(d,p,u)=>{var C;let h=Math.max(0,(typeof p.duration=="number"?p.duration:.5)*1e3),g=Math.max(0,(typeof p.delay=="number"?p.delay:0)*1e3+((C=u==null?void 0:u.delayMsOverride)!=null?C:0)),m=oo(p.ease),f=typeof p.repeat=="number"?Math.max(0,p.repeat|0):0,b=p.yoyo===!0,y=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),v=[];for(let M of Object.keys(p)){if(y.has(M))continue;let O=p[M];typeof O=="number"&&v.push({key:M,from:lo(d,M),to:O})}let E=ns(d,p);return{target:d,startMs:Lt(),delayMs:g,durationMs:h,ease:m,props:v,scaleFrom:E.from,scaleTo:E.to,repeat:f,yoyo:b,onUpdate:typeof p.onUpdate=="function"?p.onUpdate:void 0,onComplete:typeof p.onComplete=="function"?p.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},c={to(d,p){let u=l(d,p);return n(u),{kill:()=>r(u),pause:()=>{u.paused||(u.paused=!0,u.pauseAtMs=Lt())},resume:()=>{var m;if(!u.paused)return;let h=(m=u.pauseAtMs)!=null?m:Lt(),g=Lt()-h;u.startMs+=g,u.paused=!1,u.pauseAtMs=null},isActive:()=>!u.killed&&!u.paused}},fromTo(d,p,u){return c.set(d,p),c.to(d,u)},set(d,p){if(!d||!p)return;for(let h of Object.keys(p)){let g=p[h];h==="scale"||h==="scaleX"||h==="scaleY"||typeof g=="number"&&ts(d,h,g)}let u=ns(d,p);u.to&&is(d,u.to)},killTweensOf(d){let p=e.get(d);if(p)for(let u of Array.from(p))r(u)},timeline(d={}){let p=[],u=0,h=!1,g=[],m=y=>{if(typeof y=="number")return Math.max(0,y*1e3);let v=typeof y=="string"?y.trim():"";return v.startsWith("+=")?u+Math.max(0,Number(v.slice(2))*1e3||0):v?Math.max(0,Number(v)*1e3||0):u},f=y=>{p.push(y);let v=Math.max(0,(typeof y.vars.duration=="number"?y.vars.duration:.5)*1e3);u=Math.max(u,y.atMs+v)},b={to(y,v,E){return f({kind:"to",target:y,vars:v,atMs:m(E)}),b},fromTo(y,v,E,C){return f({kind:"fromTo",target:y,vars:E,from:v,atMs:m(C)}),b},play(){var y,v;if(h)return b;h=!0,g=[];for(let E of p)E.kind==="fromTo"&&c.set(E.target,(y=E.from)!=null?y:{}),g.push(c.to(E.target,{...E.vars,delay:E.atMs/1e3+((v=E.vars.delay)!=null?v:0)}));return b},pause(){for(let y of g)y.pause();return b},kill(){for(let y of g)y.kill();g=[],h=!1}};return d.paused||b.play(),b}};return c}function ss(){if(typeof window=="undefined")return;let s=window;if(!s.gsap)try{s.gsap=as()}catch{}}var rs={name:"handler-playable-sdk",version:"1.0.75",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && mkdir -p dist/cli/student-helper && cp src/cli/student-helper/*.mjs dist/cli/student-helper/ && chmod +x dist/cli/*.mjs dist/cli/student-helper/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs dist/cli/student-helper/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var re=0,uo=re++,os=re++,ls=re++,cs=re++,ds=re++,ps=re++,us=re++,gs=re++,hs=re++,ms=re++,fs=re++,bs=re++,V=uo;function ys(){return V===os}function vs(){return V===ls}function ws(){return V===cs}function xs(){return V===ds}function at(){return V===ps}function st(){return V===us}function Ss(){return V===gs}function Es(){return V===hs}function Cs(){return V===ms}function Cn(){return V===fs}function An(){return V===bs}function As(){let s=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(s==="mraid")try{mraid.getState(),V=os;return}catch{}else if(s==="dapi")try{dapi.isReady(),V=ls;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(V=cs)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(V=ds)}catch{}else if(e==="mintegral")window.gameReady&&(V=ps);else if(e==="tapjoy")window.TJ_API&&(V=us);else if(e==="tiktok")window.openAppStore&&(V=gs);else if(e==="smadex")try{window.smxTracking&&(V=hs)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(V=ms)}catch{}else e==="vungle"?V=fs:(s==="nucleo"||e==="nucleo")&&(V=bs)}var ni=it(require("lottie-web"),1),Ln=ni.default;typeof window!="undefined"&&(window.lottie=ni.default,window.__baseLottie=ni.default);var go=require("pixi.js");var Tn=require("pixi.js");var ho=null;function kn(s){ho=s}si();ai();var Tt=require("pixi.js");si();var wo=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",jn=wo;if(typeof window!="undefined")try{let s=new XMLHttpRequest;if(s.open("GET","./build-settings.json",!1),s.send(),s.status===200&&s.responseText){let e=JSON.parse(s.responseText);e!=null&&e.buildMode&&(jn=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${jn}`))}}catch{}function xo(s){var t,i,n,a,r;if(typeof window!="undefined"&&window.resolveAnchorVec2)return window.resolveAnchorVec2(s);let e={center:{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};if(Array.isArray(s))return{x:(t=s[0])!=null?t:.5,y:(i=s[1])!=null?i:.5};if(s&&typeof s=="object"&&"x"in s&&"y"in s)return{x:(n=s.x)!=null?n:.5,y:(a=s.y)!=null?a:.5};if(typeof s=="string"){let o=s.trim().toLowerCase();return(r=e[o])!=null?r:{x:.5,y:.5}}return null}var be=class{static async create(e,t,i){var l,c,d,p,u,h,g;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${jn}`);let n=(l=t==null?void 0:t.render)==null?void 0:l.asset;if(!n){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let m=new Tt.Container;return this.applyTransform(m,t==null?void 0:t.transform,t),m}let a=(c=t==null?void 0:t.identity)==null?void 0:c.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${a}, type: ${n.type}, path: ${n.path}`);let r=await Ue.load(e,n,i,a);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(d=r==null?void 0:r.constructor)==null?void 0:d.name}`);let o;if(n.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",r,"for object:",e),o=new Tt.Sprite(r),console.log("[ObjectFactory] Created object:",o,"type:",(p=o==null?void 0:o.constructor)==null?void 0:p.name),this.applyTransform(o,t==null?void 0:t.transform,t);else if(n.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(u=r==null?void 0:r.constructor)==null?void 0:u.name,r),r&&(((h=r.constructor)==null?void 0:h.name)==="Container"||r instanceof Tt.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let m=[n.path,`/assets/${n.path}`,`assets/${n.path}`,`../assets/${n.path}`],f=!1;for(let b of m)try{let y=await fetch(b);if(y.ok){o=await y.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",b,"type:",(g=o==null?void 0:o.constructor)==null?void 0:g.name),f=!0;break}}catch{continue}f||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=r)}else o=r;else o=r,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,t==null?void 0:t.transform,t);return o}static applyTransform(e,t,i){var n,a,r,o;if(!(!t||!e)&&(t.position&&("x"in e&&"y"in e?(e.x=(n=t.position.x)!=null?n:0,e.y=(a=t.position.y)!=null?a:0):"position"in e&&e.position&&e.position.set((r=t.position.x)!=null?r:0,(o=t.position.y)!=null?o:0)),t.scale!==void 0&&"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(t.scale):e.scale=t.scale),t.rotation!==void 0&&"rotation"in e&&(e.rotation=t.rotation),t.anchor&&"anchor"in e&&e.anchor)){let l=xo(t.anchor);l&&("set"in e.anchor?e.anchor.set(l.x,l.y):(e.anchor.x=l.x,e.anchor.y=l.y))}}};var kt=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 Co=it(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Co);rt();var ri=require("pixi.js");rt();var Rn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new kt}init(e,t){this.registry.init(e),this.app=t}updateConfig(e){this.registry.init(e),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let t=this.registry.getAllIds().filter(n=>!this.instanceCache.has(n));if(t.length===0)return;let i=async n=>{n.length&&(console.log("[Assets] Loading objects:",n),await Promise.all(n.map(async a=>{var o;let r=this.registry.get(a);if(!r){console.warn("[Assets] No config found for object:",a);return}try{let l=await be.create(a,r,this.app);this.instanceCache.set(a,l),console.log("[Assets] Loaded object:",a,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",a,l)}})))};return this.readyPromise=(async()=>{await i(t);let n=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));n.length>0&&(console.warn("[Assets] Retrying missing assets:",n),await i(n)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(e){let t=this.registry.get(e);if(t){let i=await be.create(e,t,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},Ao=new Rn,Lo=new Proxy(Ao,{get(s,e){if(e in s&&typeof s[e]=="function")return s[e].bind(s);if(s.get(e))return s.get(e)}});rt();var ko=require("pixi.js"),Ae={width:400,height:600,designWidth:400,scaleFactor:1},li={scale:1,position:1},$n=[];function Po(s,e,t,i,n,a,r){$n.push({element:s,originalScale:a,positionHelper:e,heightPercent:n}),e(s,t,i,n,a,r,!1)}function Io(){$n.forEach(({element:s,originalScale:e,positionHelper:t,heightPercent:i})=>{let n=e*Ae.scaleFactor;t(s,Ae.width,Ae.height,i,n,!0,!1)})}function zn(s,e){console.log(`[SCREEN] updateScreenState called: ${s}x${e}`),Ae.width=s,Ae.height=e,Ae.scaleFactor=Math.min(s/Ae.designWidth,1.15),li.scale=Ae.scaleFactor,li.position=1,console.log(`[SCREEN] Global multipliers - scale: ${li.scale.toFixed(3)}`),Io()}var It={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}};function Mo(s,e,t){let i=It[s];i&&i[e]!==void 0&&(i[e]=t,console.log(`Updated ${s}.${e} = ${t}`))}function jo(){return It}var _o={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 oi(s,e){return typeof s=="number"&&Number.isFinite(s)?s:e}function Ve(s,e={x:.5,y:.5}){var t;if(Array.isArray(s))return{x:oi(s[0],e.x),y:oi(s[1],e.y)};if(s&&typeof s=="object"){let i=s;return{x:oi(i.x,e.x),y:oi(i.y,e.y)}}if(typeof s=="string"){let i=s.trim().toLowerCase();return(t=_o[i])!=null?t:e}return e}function ot(s,e,t,i={}){var h,g,m,f,b,y;let n=Ve(t),a=(h=i.inset)!=null?h:{},r=(g=i.padding)!=null?g:{x:0,y:0},o=((m=a.left)!=null?m:0)+r.x,l=((f=a.right)!=null?f:0)+r.x,c=((b=a.top)!=null?b:0)+r.y,d=((y=a.bottom)!=null?y:0)+r.y,p=Math.max(0,s-o-l),u=Math.max(0,e-c-d);return{x:o+p*n.x,y:c+u*n.y}}function lt(s,e,t,i={}){var m,f,b,y,v,E;let n=(m=i.inset)!=null?m:{},a=(f=i.padding)!=null?f:{x:0,y:0},r=((b=n.left)!=null?b:0)+a.x,o=((y=n.right)!=null?y:0)+a.x,l=((v=n.top)!=null?v:0)+a.y,c=((E=n.bottom)!=null?E:0)+a.y,d=Math.max(0,s-r-o),p=Math.max(0,e-l-c),u=Ve(t,{x:.5,y:.5}),h=Math.min(Math.max(u.x,0),1),g=Math.min(Math.max(u.y,0),1);return{x:r+d*h,y:l+p*g}}if(typeof window!="undefined"){let s=window.innerWidth,e=window.innerHeight,t=()=>{let i=window.innerWidth,n=window.innerHeight;(i!==s||n!==e)&&(s=i,e=n,zn(i,n))};window.addEventListener("resize",t),window.addEventListener("orientationchange",()=>{setTimeout(t,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",t),window.mraid.addEventListener("sizeChange",t)),zn(window.innerWidth,window.innerHeight),window.updateDebugConfig=Mo,window.getDebugConfig=jo,window.copyConfig=Uo,window.applyConfig=Pt,window.applyConfigForRatio=qo,window.positionAtBottom=Ms,window.positionAtTop=zo,window.positionAtCenter=$o,window.positionAtLeft=Do,window.positionAtRight=No,window.positionAtBottomLeft=Ho,window.positionAtBottomRight=Fo,window.positionAtTopLeft=Bo,window.positionAtTopRight=Go,window.applyPositionContract=Ro,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 ci(s,e,t=0){return s*e+t}function di(s,e,t=0){return s*(1-e)+t}function pi(s,e,t=0){return s*e+t}function ui(s,e,t=0){return s*(1-e)+t}function le(s,e=0){return s/2+e}function Oo(s,e){return s*e}function Ro(s,e,t,i){var r,o,l,c,d,p,u,h,g,m,f,b,y,v,E,C,M,O,w,k;let n=0,a=0;switch(i.type){case"top":n=le(e,(o=(r=i.offset)==null?void 0:r.x)!=null?o:0),a=ci(t,i.percent,(c=(l=i.offset)==null?void 0:l.y)!=null?c:0);break;case"bottom":n=le(e,(p=(d=i.offset)==null?void 0:d.x)!=null?p:0),a=di(t,i.percent,(h=(u=i.offset)==null?void 0:u.y)!=null?h:0);break;case"left":n=pi(e,i.percent,(m=(g=i.offset)==null?void 0:g.x)!=null?m:0),a=le(t,(b=(f=i.offset)==null?void 0:f.y)!=null?b:0);break;case"right":n=ui(e,i.percent,(v=(y=i.offset)==null?void 0:y.x)!=null?v:0),a=le(t,(C=(E=i.offset)==null?void 0:E.y)!=null?C:0);break;case"center":n=le(e,(O=(M=i.offset)==null?void 0:M.x)!=null?O:0),a=le(t,(k=(w=i.offset)==null?void 0:w.y)!=null?k:0);break}s.position?s.position.set(n,a):(s.x=n,s.y=a),i.scale!==void 0&&i.scale!==1&&s.scale&&(typeof s.scale.set=="function"?s.scale.set(i.scale,i.scale):(s.scale.x=i.scale,s.scale.y=i.scale))}function Ms(s,e,t,i=.2,n=1,a=!0,r=!1){let o=Oo(t,i),l=di(t,i/2);Le(s,le(e),l);let c=a?n*Ae.scaleFactor:n;Te(s,c),r&&!$n.find(d=>d.element===s)&&Po(s,Ms,e,t,i,n,a)}function zo(s,e,t,i=.1,n=1){Le(s,le(e),ci(t,i)),Te(s,n)}function $o(s,e,t,i=0,n=0,a=1){Le(s,le(e,i),le(t,n)),Te(s,a)}function Do(s,e,t,i=.1,n=1){Le(s,pi(e,i),le(t)),Te(s,n)}function No(s,e,t,i=.1,n=1){Le(s,ui(e,i),le(t)),Te(s,n)}function Ho(s,e,t,i=.05,n=.05,a=1){Le(s,pi(e,n),di(t,i)),Te(s,a)}function Fo(s,e,t,i=.05,n=.05,a=1){Le(s,ui(e,n),di(t,i)),Te(s,a)}function Bo(s,e,t,i=.05,n=.05,a=1){Le(s,pi(e,n),ci(t,i)),Te(s,a)}function Go(s,e,t,i=.05,n=.05,a=1){Le(s,ui(e,n),ci(t,i)),Te(s,a)}function Le(s,e,t){s&&s.position?typeof s.position.set=="function"?s.position.set(e,t):(s.position.x=e,s.position.y=t):s&&(s.x=e,s.y=t)}function Te(s,e){e!==1&&s&&s.scale&&(typeof s.scale.set=="function"?s.scale.set(e,e):s.scale.x!==void 0&&s.scale.y!==void 0&&(s.scale.x=e,s.scale.y=e))}var qe={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}},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}},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}},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}}};function Uo(s){return s&&qe[s]?JSON.parse(JSON.stringify(qe[s])):JSON.parse(JSON.stringify(It))}function Pt(s){Object.keys(s).forEach(e=>{let t=e;It[t]&&s[t]&&Object.assign(It[t],s[t])}),console.log("Config applied:",s)}function qo(s,e){let t=s/e;t>1.6?(Pt(qe.wide),console.log("Applied WIDE config for ratio:",t)):t<.7?(Pt(qe.tall),console.log("Applied TALL config for ratio:",t)):t>.8&&t<1.2?(Pt(qe.square),console.log("Applied SQUARE config for ratio:",t)):(Pt(qe.default),console.log("Applied DEFAULT config for ratio:",t))}if(typeof window!="undefined"){let s=window;s.configPresets=qe,s.resolveAnchorVec2=s.resolveAnchorVec2||Ve,s.resolveScreenAnchorPoint=s.resolveScreenAnchorPoint||ot,s.resolveScreenRatioPoint=s.resolveScreenRatioPoint||lt}Ci();function X(s,e){let t=(n,a)=>a===0?n:t(a,n%a),i=t(s,e);return`${s/i}:${e/i}`}var pd=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:X(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:X(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:X(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:X(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:X(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:X(360,780)}],ud=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:X(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:X(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:X(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:X(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:X(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:X(412,915)}],gd=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:X(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:X(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:X(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:X(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:X(800,1280)}],Qn=[{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:X(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:X(768,1024),mraidScale:.7}];var ea=[...Qn],ta=[{category:"playable",label:"Playable Ad",devices:Qn}],Ai=Qn[0];function Xe(s){return ea.find(e=>e.id===s)||Ai}function Qo(s){return ea.filter(e=>e.category===s)}Z();var ve=class{async updateProperty(e,t,i,n={}){var l,c,d;console.log("[PropertyUpdateManager] Updating:",e,t,i);let a=window.getEditableObjectConfig;if(typeof a!="function"){console.error("[PropertyUpdateManager] getEditableObjectConfig not available");return}let r=a(e);if(!r){console.error("[PropertyUpdateManager] Config not found for:",e);return}if(ae({objectId:e,path:t,value:i},{persist:!0}),t==="transform"||t.startsWith("transform."))console.log("[DEBUG FALLBACK] PropertyUpdateManager SKIP applyEditableObjectConfig (transform path)",t,e),n.refreshInspector||requestAnimationFrame(()=>{window.dispatchEvent(new CustomEvent("config:changed",{detail:{objectId:e}}))});else{let p=window.applyEditableObjectConfig;if(typeof p=="function"){let u=window.__editableConfig,h=(d=(c=(l=u==null?void 0:u.objects)==null?void 0:l.get)==null?void 0:c.call(l,e))!=null?d:r;await p(e,h),console.log("[PropertyUpdateManager] Applied config successfully")}else console.warn("[PropertyUpdateManager] applyEditableObjectConfig not available")}this.triggerRefresh(e),n.refreshInspector&&window.dispatchEvent(new CustomEvent("inspector:refresh"))}getNestedProperty(e,t){let i=t.split("."),n=e;for(let a of i)if(n&&typeof n=="object"&&a in n)n=n[a];else return;return n}triggerRefresh(e){let t=window.__refreshHierarchy;typeof t=="function"&&t(),window.dispatchEvent(new CustomEvent("inspector:property-updated",{detail:{objectId:e}}))}};function ia(s){let e=document.createElement("input");e.type="file",e.accept="image/*",e.onchange=async t=>{var a;let i=(a=t.target.files)==null?void 0:a[0];if(!i)return;let n=new FileReader;n.onload=async()=>{let r=n.result,o=s.category||"misc",c=`${(s.objectId||"new_asset").replace(/^json\./,"").replace(/[^a-zA-Z0-9_-]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"")||"new_asset"}_uploaded`;try{let p=await(await fetch("/api/library/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({category:o,filename:`${c}.png`,data:r,overwrite:!0})})).json();if(!(p!=null&&p.success)){alert(`Upload failed: ${(p==null?void 0:p.error)||"Unknown error"}`);return}let u=window.addAssetToRegistry;typeof u=="function"&&u(o,`${c}.png`);try{await fetch("/api/setup-library",{method:"POST",headers:{"Content-Type":"application/json"}})}catch{}let h=window.refreshAssetLibrary;typeof h=="function"&&await h(),await s.onApply(p.path)}catch(d){console.error("[QuickActionsBar] Upload error:",d),alert("Upload failed. Check console.")}},n.readAsDataURL(i)},e.click()}var Li=class{constructor(){this.updateManager=new ve}async handleAction(e,t,i){console.log("[QuickActionsBar] Action:",e,t,i);let n=window.getEditableObjectConfig;if(typeof n!="function")return;let a=n(t);if(!a)return;let r=this.updateManager.getNestedProperty(a,i);if(e==="ai-convert"||e==="upload"||e==="library"){let o=i==="ui.text"||i==="render.asset.path",l=i==="render.asset.path";o&&(await this.prepareForImageConversion(t,a),e==="ai-convert"&&i!=="render.asset.path"&&(i="render.asset.path"))}switch(e){case"library":this.openLibrary(t,i,r);break;case"ai-edit":this.openAIEditor(t,i,r);break;case"upload":this.openUpload(t,i);break;case"reset":await this.resetToDefault(t,i);break;case"ai-convert":this.handleAiConvert(t,i,r);break;default:console.warn("[QuickActionsBar] Unknown action:",e)}}async prepareForImageConversion(e,t){var i,n;if(console.log("[QuickActionsBar] Preparing for image conversion:",e),t.render||(t.render={alpha:1,visible:!0}),(t.render.alpha===0||t.render.alpha===void 0)&&(t.render.alpha=1,await this.updateManager.updateProperty(e,"render.alpha",1)),(t.render.visible===!1||t.render.visible===void 0)&&(t.render.visible=!0,await this.updateManager.updateProperty(e,"render.visible",!0)),t.render.asset||(t.render.asset={type:"image",path:""}),t.render.asset.type!=="image"&&(t.render.asset.type="image",await this.updateManager.updateProperty(e,"render.asset",{type:"image",path:t.render.asset.path||""})),t.ui&&t.ui.renderMode!=="png"){await this.updateManager.updateProperty(e,"ui.renderMode","png",{refreshInspector:!0}),await this.updateManager.updateProperty(e,"render.tint","#ffffff");let r=((n=(i=t.transform)==null?void 0:i.scale)!=null?n:1)*.3;await this.updateManager.updateProperty(e,"transform.scale",r),console.log("[QuickActionsBar] Text to PNG conversion: set tint white, scale",r)}this.ensureSlotInRegistry(e,t)}ensureSlotInRegistry(e,t){var o,l,c;let i=window.getEditableAssets;if(typeof i!="function")return;let n=i();if(!n||!n.slots)return;let a=e.startsWith("json.")?e.replace("json.",""):e;if(!n.slots.some(d=>d.objectId===a||d.slotId===a)){let d=((o=t.identity)==null?void 0:o.category)||"ui";console.log("[QuickActionsBar] Adding new slot to registry for converted object:",a),n.slots.push({slotId:a,displayName:a.replace(/_/g," "),objectId:a,category:d,currentAsset:((c=(l=t.render)==null?void 0:l.asset)==null?void 0:c.path)||"",defaultAsset:"",libraryFolder:d,assetType:"image"}),n.categories&&!n.categories.includes(d)&&n.categories.push(d),n.libraryAssets&&!n.libraryAssets[d]&&(n.libraryAssets[d]=[]);let p=window.reRenderAssetLibrary;typeof p=="function"&&p()}}openLibrary(e,t,i){var a;let n=window.__debugContext;if(n){if(n.activeTab!=="library"){n.activeTab="library";let r=window.__updateWorkbenchTabs;typeof r=="function"&&r()}if(n.libraryPanel){let r=window.getEditableObjectConfig,o=r==null?void 0:r(e),l=(a=o==null?void 0:o.identity)==null?void 0:a.category;l||(l=t.split(".")[0]==="render"?"environment":"ui"),console.log("[QuickActionsBar] Highlighting library slot:",e,"category:",l),n.libraryPanel.highlightSlot(e,l)}}}openAIEditor(e,t,i){let n=window.__openAiEditor;if(typeof n=="function"){let a=t.split(".").pop()||t;n(a,`Edit ${a} for ${e}`,i,{objectId:e,path:t})}else console.warn("[QuickActionsBar] AI Editor not available")}openUpload(e,t){var r;let i=window.getEditableObjectConfig,n=i==null?void 0:i(e),a=((r=n==null?void 0:n.identity)==null?void 0:r.category)||(t.split(".")[0]==="render"?"environment":"ui");ia({objectId:e,category:a,onApply:async o=>{var h,g;let l=window.applyAssetToSlot,c=this.getFilenameFromPath(o),d=/render\.asset\.path/i.test(t)||/\.(png|jpg|jpeg|gif|webp)$/i.test(o);typeof l=="function"&&c&&d&&await l(e,c,a),await this.updateManager.updateProperty(e,t,o);let p=window.__debugContext;(g=(h=p==null?void 0:p.options)==null?void 0:h.onPropertyChange)==null||g.call(h,e,t,o);let u=window.__highlightLibrarySlot;typeof u=="function"&&setTimeout(()=>{u(e,a)},500),window.dispatchEvent(new CustomEvent("inspector:refresh"))}})}getFilenameFromPath(e){if(!e)return"";let t=e.split("?")[0].replace(/\\/g,"/");return t.split("/").pop()||t}async resetToDefault(e,t){console.log("[QuickActionsBar] Reset to default:",e,t);try{let i=await this.getDefaultValue(e,t);i!==void 0?(await this.updateManager.updateProperty(e,t,i),console.log("[QuickActionsBar] Reset to default value:",i)):alert("No default value found for this property.")}catch(i){console.error("[QuickActionsBar] Failed to reset to default:",i),alert("Failed to reset property. Check console for details.")}}async getDefaultValue(e,t){let i=t.split(".");if(i.length<2)return;let n=i[0],a=i.slice(1),r=window.__editableConfig;if(!(r!=null&&r.schemas))return;let o=null;if(r.schemas instanceof Map?o=r.schemas.get(n):typeof r.schemas=="object"&&(o=r.schemas[n]),!(o!=null&&o.defaults))return;let l=o.defaults;for(let c of a)if(l&&typeof l=="object")l=l[c];else return;return l}handleAiConvert(e,t,i){let n=window.__openAiEditor;if(typeof n=="function"){let r=`A single, high-quality, high-detail game UI icon/asset representing "${String(i||e.replace(/_/g," ").replace("json.",""))}". Modern stylized 3D rendered style, vibrant colors, soft lighting, isolated on solid magenta background, highly polished professional game art.`,o="render.asset.path";console.log("[QuickActionsBar] AI Convert for:",e,"from:",t,"to:",o),n(e,r,"",{objectId:e,path:o});let l=window.__debugContext;if(l){l.activeTab="ai";let c=window.__updateWorkbenchTabs;typeof c=="function"&&c()}}else console.warn("[QuickActionsBar] AI Editor not available")}};var el=[{value:"loading",label:"Loading"},{value:"start",label:"Start"},{value:"gameplay",label:"Gameplay"},{value:"tutorial",label:"Tutorial"},{value:"endgame",label:"Endgame"}],tl=["environment","ui","character","system","backgrounds"],il=["bg","world","ui"],qs={SwerveMove:{speed:5,sensitivity:1,directionMode:"dominantAxis",axis:"both",bounds:{left:-400,right:400,top:-300,bottom:300}},DragToWin:{targetId:"",successDistance:80},DragSnap:{snapTargetId:"",snapDistance:40},JoystickMove:{speed:6,bounds:{left:-400,right:400,top:-300,bottom:300}}},Ti=class{constructor(){this.modal=null;this.state=null}open(e){this.state=this.createInitialState(e),this.createModal(),document.body.appendChild(this.modal),this.attachEventListeners(),this.updateStepUI()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),window.__wizardAssetPicker=null,this.modal=null,this.state=null}createInitialState(e){return{step:1,objectType:"sprite",instanceId:"",displayName:"",category:"environment",screenId:e.screenId,layer:"world",positionMode:"static",anchorPreset:"center",anchorX:.5,anchorY:.5,positionX:0,positionY:0,offsetX:0,offsetY:0,scale:.2,rotation:0,zIndex:0,assetPath:"",tint:"",alpha:1,text:"",font:"brand.primary",fontSize:18,letterSpacing:0,align:"center",graphicsWidth:200,graphicsHeight:200,graphicsFill:"#FFFFFF",graphicsAlpha:1,interactionEnabled:!1,dragEnabled:!1,hoverEnabled:!1,clickEnabled:!1,logicId:"",logicPropsRaw:""}}createModal(){let e=document.createElement("div");e.className="wizard-modal",e.innerHTML=`
46
+ `,this.modal=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(r=>{r.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.addEventListener("click",o=>{let c=o.target.dataset.tab;c&&this.switchTab(c)})});let i=this.modal.querySelector("[data-ai-generate]");i==null||i.addEventListener("click",()=>{this.openAiEditor("generate")});let n=this.modal.querySelector("[data-ai-edit]");n==null||n.addEventListener("click",()=>{this.openAiEditor("edit")});let a=this.modal.querySelector("[data-modal-apply]");a==null||a.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",r=>{r.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(n=>{n.classList.toggle("active",n.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(n=>{n.classList.toggle("active",n.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let t=window.__openAiEditor;if(typeof t!="function"){alert("AI Editor not available. Please check your setup.");return}let i="";e==="edit"&&this.currentAsset?i=`Edit this image: ${this.currentObjectId}`:i=`Create an image for: ${this.currentObjectId}`,t(this.currentObjectId||"unknown",i,this.currentAsset,{path:this.currentPath,onApply:n=>{this.onApplyCallback&&this.onApplyCallback(n),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var zl={};At(zl,{COLORS:()=>xe,ConfigWatcher:()=>Ke,DebugPanel:()=>Gt,DefaultReloadStrategy:()=>zt,Handler:()=>he,PlayableLoadingScreen:()=>gn,PreviewShell:()=>dn,STROKE_WIDTH:()=>Nr,THEME:()=>Hr,applyConfigOverride:()=>ae,applyConfigOverrides:()=>Oe,applyConfigsToDisk:()=>yi,applyDefaults:()=>Ye,baseLottie:()=>Ln,bootstrap:()=>Al,clearConfigOverrides:()=>ce,clearConfigOverridesForObject:()=>zs,configOverrideManager:()=>$s,createPreviewShell:()=>Ra,deepClone:()=>J,default:()=>Be,defaultPreset:()=>Ai,deviceGroups:()=>ta,devicePresets:()=>ea,diffConfigs:()=>Yn,exportConfigsAsJSON:()=>We,getConfigOverrides:()=>te,getConfigStateSummary:()=>Re,getOverrideMode:()=>jt,getPresetById:()=>Xe,getPresetsByCategory:()=>Qo,loadAllObjectConfigs:()=>xi,loadComponentSchemas:()=>wi,loadEngineConfig:()=>Si,loadGamePromptConfig:()=>qn,loadObjectCentricConfig:()=>ke,loadObjectConfig:()=>$e,loadSceneConfig:()=>Ei,redoLastConfigChange:()=>bi,rehydrateObject:()=>Kn,removeConfigOverride:()=>_t,resetToApplied:()=>Ot,resetToOriginal:()=>vi,setBootstrapDependencies:()=>El,setOverrideMode:()=>Bn,setupHotReload:()=>Zn,setupLiveEditBridge:()=>pn,toLegacyFormat:()=>Vn,trackObjectCreation:()=>Ds,trackObjectDeletion:()=>Ns,undoLastConfigChange:()=>fi,validateObjectConfig:()=>ct});module.exports=ro(zl);var je={};function ti(s,e,t=!1){je[s]||(je[s]=[]),je[s].push({fn:e,once:t})}function Sn(s,e){if(je[s]){if(!e){delete je[s];return}je[s]=je[s].filter(t=>t.fn!==e)}}function ii(s,...e){let t=je[s];if(t)for(let i of[...t])i.fn(...e),i.once&&Sn(s,i.fn)}function se(s,e){ti(s,e,!0)}var K=null,ue=[],nt=null;function Za(s){K=s,ue=[],nt!==null&&(clearTimeout(nt),nt=null)}function Qa(){var s,e,t;return{endpoint:(K==null?void 0:K.endpoint)||"",transport:(K==null?void 0:K.transport)||"beacon",batchSize:(s=K==null?void 0:K.batchSize)!=null?s:10,flushIntervalMs:(e=K==null?void 0:K.flushIntervalMs)!=null?e:300,maxQueue:(t=K==null?void 0:K.maxQueue)!=null?t:200,debug:!!(K!=null&&K.debug)}}async function Xa(s,e,t,i){let n=JSON.stringify(e);if(t==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let a=navigator.sendBeacon(s,new Blob([n],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",a,e);return}catch(a){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",a)}try{await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(a){i&&console.warn("[handler.telemetry] fetch failed",a)}}function En(s,e){let t=Qa();if(e&&t.endpoint){if(ue.push(s),ue.length>t.maxQueue&&(ue=ue.slice(ue.length-t.maxQueue)),ue.length>=t.batchSize){Ja();return}nt===null&&(nt=window.setTimeout(()=>{nt=null,Ja()},t.flushIntervalMs))}}async function Ja(){let s=Qa();if(!s.endpoint||ue.length===0)return;let e=ue.splice(0,s.batchSize);await Xa(s.endpoint,{events:e},s.transport,s.debug),ue.length>0&&await Xa(s.endpoint,{events:ue.splice(0,s.batchSize)},s.transport,s.debug)}function es(s){return Math.max(0,Math.min(1,s))}function oo(s){let e=String(s!=null?s:"power2.out");if(e==="linear")return t=>t;if(e==="sine.inOut")return t=>.5-Math.cos(Math.PI*t)/2;if(e==="power2.out"||e==="easeOutQuad")return t=>1-(1-t)*(1-t);if(e.startsWith("back.out")){let t=e.match(/back\.out\(([\d.]+)\)/),i=t?Number(t[1]):1.8;return n=>1+(i+1)*Math.pow(n-1,3)+i*Math.pow(n-1,2)}return t=>1-(1-t)*(1-t)}function Lt(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function lo(s,e){let t=s==null?void 0:s[e];return typeof t=="number"?t:0}function ts(s,e,t){try{s[e]=t}catch{}}function co(s){let e=s==null?void 0:s.scale;if(!e)return null;let t=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:t,y:i}}function is(s,e){let t=s==null?void 0:s.scale;if(t)try{typeof t.set=="function"?t.set(e.x,e.y):(typeof t.x=="number"&&(t.x=e.x),typeof t.y=="number"&&(t.y=e.y))}catch{}}function ns(s,e){let t=co(s);if(!t)return{from:null,to:null};let i=null,n=null;return typeof e.scale=="number"?(i=e.scale,n=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(n=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(n=e.scaleY),i===null&&n===null?{from:null,to:null}:{from:{x:t.x,y:t.y},to:{x:i!=null?i:t.x,y:n!=null?n:t.y}}}function as(){let s=new Set,e=new WeakMap,t=null,i=()=>{if(t!=null)return;t=requestAnimationFrame(()=>{t=null,o(),s.size>0&&i()})},n=d=>{var u;s.add(d);let p=(u=e.get(d.target))!=null?u:new Set;p.add(d),e.set(d.target,p),i()},a=d=>{s.delete(d);let p=e.get(d.target);p&&(p.delete(d),p.size===0&&e.delete(d.target))},r=d=>{d.killed||(d.killed=!0,a(d))},o=()=>{var p,u;let d=Lt();for(let h of Array.from(s)){if(h.killed||h.paused)continue;let g=d-h.startMs-h.delayMs;if(g<0)continue;let m=h.durationMs>0?g/h.durationMs:1,f=es(m),b=h.repeat>=0?h.repeat+1:1,y=h.repeat>0?Math.min(Math.floor(m),b-1):0;if(h.repeat>0&&m>=1){let C=m-y;f=es(C)}let v=h.ease(f);h.yoyo&&y%2===1&&(v=1-v);for(let C of h.props)ts(h.target,C.key,C.from+(C.to-C.from)*v);h.scaleFrom&&h.scaleTo&&is(h.target,{x:h.scaleFrom.x+(h.scaleTo.x-h.scaleFrom.x)*v,y:h.scaleFrom.y+(h.scaleTo.y-h.scaleFrom.y)*v});try{(p=h.onUpdate)==null||p.call(h)}catch{}if(m>=b){r(h);try{(u=h.onComplete)==null||u.call(h)}catch{}}}},l=(d,p,u)=>{var C;let h=Math.max(0,(typeof p.duration=="number"?p.duration:.5)*1e3),g=Math.max(0,(typeof p.delay=="number"?p.delay:0)*1e3+((C=u==null?void 0:u.delayMsOverride)!=null?C:0)),m=oo(p.ease),f=typeof p.repeat=="number"?Math.max(0,p.repeat|0):0,b=p.yoyo===!0,y=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),v=[];for(let M of Object.keys(p)){if(y.has(M))continue;let O=p[M];typeof O=="number"&&v.push({key:M,from:lo(d,M),to:O})}let E=ns(d,p);return{target:d,startMs:Lt(),delayMs:g,durationMs:h,ease:m,props:v,scaleFrom:E.from,scaleTo:E.to,repeat:f,yoyo:b,onUpdate:typeof p.onUpdate=="function"?p.onUpdate:void 0,onComplete:typeof p.onComplete=="function"?p.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},c={to(d,p){let u=l(d,p);return n(u),{kill:()=>r(u),pause:()=>{u.paused||(u.paused=!0,u.pauseAtMs=Lt())},resume:()=>{var m;if(!u.paused)return;let h=(m=u.pauseAtMs)!=null?m:Lt(),g=Lt()-h;u.startMs+=g,u.paused=!1,u.pauseAtMs=null},isActive:()=>!u.killed&&!u.paused}},fromTo(d,p,u){return c.set(d,p),c.to(d,u)},set(d,p){if(!d||!p)return;for(let h of Object.keys(p)){let g=p[h];h==="scale"||h==="scaleX"||h==="scaleY"||typeof g=="number"&&ts(d,h,g)}let u=ns(d,p);u.to&&is(d,u.to)},killTweensOf(d){let p=e.get(d);if(p)for(let u of Array.from(p))r(u)},timeline(d={}){let p=[],u=0,h=!1,g=[],m=y=>{if(typeof y=="number")return Math.max(0,y*1e3);let v=typeof y=="string"?y.trim():"";return v.startsWith("+=")?u+Math.max(0,Number(v.slice(2))*1e3||0):v?Math.max(0,Number(v)*1e3||0):u},f=y=>{p.push(y);let v=Math.max(0,(typeof y.vars.duration=="number"?y.vars.duration:.5)*1e3);u=Math.max(u,y.atMs+v)},b={to(y,v,E){return f({kind:"to",target:y,vars:v,atMs:m(E)}),b},fromTo(y,v,E,C){return f({kind:"fromTo",target:y,vars:E,from:v,atMs:m(C)}),b},play(){var y,v;if(h)return b;h=!0,g=[];for(let E of p)E.kind==="fromTo"&&c.set(E.target,(y=E.from)!=null?y:{}),g.push(c.to(E.target,{...E.vars,delay:E.atMs/1e3+((v=E.vars.delay)!=null?v:0)}));return b},pause(){for(let y of g)y.pause();return b},kill(){for(let y of g)y.kill();g=[],h=!1}};return d.paused||b.play(),b}};return c}function ss(){if(typeof window=="undefined")return;let s=window;if(!s.gsap)try{s.gsap=as()}catch{}}var rs={name:"handler-playable-sdk",version:"1.0.77",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && mkdir -p dist/cli/student-helper && cp src/cli/student-helper/*.mjs dist/cli/student-helper/ && chmod +x dist/cli/*.mjs dist/cli/student-helper/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs dist/cli/student-helper/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var re=0,uo=re++,os=re++,ls=re++,cs=re++,ds=re++,ps=re++,us=re++,gs=re++,hs=re++,ms=re++,fs=re++,bs=re++,V=uo;function ys(){return V===os}function vs(){return V===ls}function ws(){return V===cs}function xs(){return V===ds}function at(){return V===ps}function st(){return V===us}function Ss(){return V===gs}function Es(){return V===hs}function Cs(){return V===ms}function Cn(){return V===fs}function An(){return V===bs}function As(){let s=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(s==="mraid")try{mraid.getState(),V=os;return}catch{}else if(s==="dapi")try{dapi.isReady(),V=ls;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(V=cs)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(V=ds)}catch{}else if(e==="mintegral")window.gameReady&&(V=ps);else if(e==="tapjoy")window.TJ_API&&(V=us);else if(e==="tiktok")window.openAppStore&&(V=gs);else if(e==="smadex")try{window.smxTracking&&(V=hs)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(V=ms)}catch{}else e==="vungle"?V=fs:(s==="nucleo"||e==="nucleo")&&(V=bs)}var ni=it(require("lottie-web"),1),Ln=ni.default;typeof window!="undefined"&&(window.lottie=ni.default,window.__baseLottie=ni.default);var go=require("pixi.js");var Tn=require("pixi.js");var ho=null;function kn(s){ho=s}si();ai();var Tt=require("pixi.js");si();var wo=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",jn=wo;if(typeof window!="undefined")try{let s=new XMLHttpRequest;if(s.open("GET","./build-settings.json",!1),s.send(),s.status===200&&s.responseText){let e=JSON.parse(s.responseText);e!=null&&e.buildMode&&(jn=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${jn}`))}}catch{}function xo(s){var t,i,n,a,r;if(typeof window!="undefined"&&window.resolveAnchorVec2)return window.resolveAnchorVec2(s);let e={center:{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};if(Array.isArray(s))return{x:(t=s[0])!=null?t:.5,y:(i=s[1])!=null?i:.5};if(s&&typeof s=="object"&&"x"in s&&"y"in s)return{x:(n=s.x)!=null?n:.5,y:(a=s.y)!=null?a:.5};if(typeof s=="string"){let o=s.trim().toLowerCase();return(r=e[o])!=null?r:{x:.5,y:.5}}return null}var be=class{static async create(e,t,i){var l,c,d,p,u,h,g;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${jn}`);let n=(l=t==null?void 0:t.render)==null?void 0:l.asset;if(!n){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let m=new Tt.Container;return this.applyTransform(m,t==null?void 0:t.transform,t),m}let a=(c=t==null?void 0:t.identity)==null?void 0:c.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${a}, type: ${n.type}, path: ${n.path}`);let r=await Ue.load(e,n,i,a);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(d=r==null?void 0:r.constructor)==null?void 0:d.name}`);let o;if(n.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",r,"for object:",e),o=new Tt.Sprite(r),console.log("[ObjectFactory] Created object:",o,"type:",(p=o==null?void 0:o.constructor)==null?void 0:p.name),this.applyTransform(o,t==null?void 0:t.transform,t);else if(n.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(u=r==null?void 0:r.constructor)==null?void 0:u.name,r),r&&(((h=r.constructor)==null?void 0:h.name)==="Container"||r instanceof Tt.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let m=[n.path,`/assets/${n.path}`,`assets/${n.path}`,`../assets/${n.path}`],f=!1;for(let b of m)try{let y=await fetch(b);if(y.ok){o=await y.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",b,"type:",(g=o==null?void 0:o.constructor)==null?void 0:g.name),f=!0;break}}catch{continue}f||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=r)}else o=r;else o=r,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,t==null?void 0:t.transform,t);return o}static applyTransform(e,t,i){var n,a,r,o;if(!(!t||!e)&&(t.position&&("x"in e&&"y"in e?(e.x=(n=t.position.x)!=null?n:0,e.y=(a=t.position.y)!=null?a:0):"position"in e&&e.position&&e.position.set((r=t.position.x)!=null?r:0,(o=t.position.y)!=null?o:0)),t.scale!==void 0&&"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(t.scale):e.scale=t.scale),t.rotation!==void 0&&"rotation"in e&&(e.rotation=t.rotation),t.anchor&&"anchor"in e&&e.anchor)){let l=xo(t.anchor);l&&("set"in e.anchor?e.anchor.set(l.x,l.y):(e.anchor.x=l.x,e.anchor.y=l.y))}}};var kt=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 Co=it(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Co);rt();var ri=require("pixi.js");rt();var Rn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new kt}init(e,t){this.registry.init(e),this.app=t}updateConfig(e){this.registry.init(e),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let t=this.registry.getAllIds().filter(n=>!this.instanceCache.has(n));if(t.length===0)return;let i=async n=>{n.length&&(console.log("[Assets] Loading objects:",n),await Promise.all(n.map(async a=>{var o;let r=this.registry.get(a);if(!r){console.warn("[Assets] No config found for object:",a);return}try{let l=await be.create(a,r,this.app);this.instanceCache.set(a,l),console.log("[Assets] Loaded object:",a,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",a,l)}})))};return this.readyPromise=(async()=>{await i(t);let n=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));n.length>0&&(console.warn("[Assets] Retrying missing assets:",n),await i(n)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(e){let t=this.registry.get(e);if(t){let i=await be.create(e,t,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},Ao=new Rn,Lo=new Proxy(Ao,{get(s,e){if(e in s&&typeof s[e]=="function")return s[e].bind(s);if(s.get(e))return s.get(e)}});rt();var ko=require("pixi.js"),Ae={width:400,height:600,designWidth:400,scaleFactor:1},li={scale:1,position:1},$n=[];function Po(s,e,t,i,n,a,r){$n.push({element:s,originalScale:a,positionHelper:e,heightPercent:n}),e(s,t,i,n,a,r,!1)}function Io(){$n.forEach(({element:s,originalScale:e,positionHelper:t,heightPercent:i})=>{let n=e*Ae.scaleFactor;t(s,Ae.width,Ae.height,i,n,!0,!1)})}function zn(s,e){console.log(`[SCREEN] updateScreenState called: ${s}x${e}`),Ae.width=s,Ae.height=e,Ae.scaleFactor=Math.min(s/Ae.designWidth,1.15),li.scale=Ae.scaleFactor,li.position=1,console.log(`[SCREEN] Global multipliers - scale: ${li.scale.toFixed(3)}`),Io()}var It={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}};function Mo(s,e,t){let i=It[s];i&&i[e]!==void 0&&(i[e]=t,console.log(`Updated ${s}.${e} = ${t}`))}function jo(){return It}var _o={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 oi(s,e){return typeof s=="number"&&Number.isFinite(s)?s:e}function Ve(s,e={x:.5,y:.5}){var t;if(Array.isArray(s))return{x:oi(s[0],e.x),y:oi(s[1],e.y)};if(s&&typeof s=="object"){let i=s;return{x:oi(i.x,e.x),y:oi(i.y,e.y)}}if(typeof s=="string"){let i=s.trim().toLowerCase();return(t=_o[i])!=null?t:e}return e}function ot(s,e,t,i={}){var h,g,m,f,b,y;let n=Ve(t),a=(h=i.inset)!=null?h:{},r=(g=i.padding)!=null?g:{x:0,y:0},o=((m=a.left)!=null?m:0)+r.x,l=((f=a.right)!=null?f:0)+r.x,c=((b=a.top)!=null?b:0)+r.y,d=((y=a.bottom)!=null?y:0)+r.y,p=Math.max(0,s-o-l),u=Math.max(0,e-c-d);return{x:o+p*n.x,y:c+u*n.y}}function lt(s,e,t,i={}){var m,f,b,y,v,E;let n=(m=i.inset)!=null?m:{},a=(f=i.padding)!=null?f:{x:0,y:0},r=((b=n.left)!=null?b:0)+a.x,o=((y=n.right)!=null?y:0)+a.x,l=((v=n.top)!=null?v:0)+a.y,c=((E=n.bottom)!=null?E:0)+a.y,d=Math.max(0,s-r-o),p=Math.max(0,e-l-c),u=Ve(t,{x:.5,y:.5}),h=Math.min(Math.max(u.x,0),1),g=Math.min(Math.max(u.y,0),1);return{x:r+d*h,y:l+p*g}}if(typeof window!="undefined"){let s=window.innerWidth,e=window.innerHeight,t=()=>{let i=window.innerWidth,n=window.innerHeight;(i!==s||n!==e)&&(s=i,e=n,zn(i,n))};window.addEventListener("resize",t),window.addEventListener("orientationchange",()=>{setTimeout(t,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",t),window.mraid.addEventListener("sizeChange",t)),zn(window.innerWidth,window.innerHeight),window.updateDebugConfig=Mo,window.getDebugConfig=jo,window.copyConfig=Uo,window.applyConfig=Pt,window.applyConfigForRatio=qo,window.positionAtBottom=Ms,window.positionAtTop=zo,window.positionAtCenter=$o,window.positionAtLeft=Do,window.positionAtRight=No,window.positionAtBottomLeft=Ho,window.positionAtBottomRight=Fo,window.positionAtTopLeft=Bo,window.positionAtTopRight=Go,window.applyPositionContract=Ro,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 ci(s,e,t=0){return s*e+t}function di(s,e,t=0){return s*(1-e)+t}function pi(s,e,t=0){return s*e+t}function ui(s,e,t=0){return s*(1-e)+t}function le(s,e=0){return s/2+e}function Oo(s,e){return s*e}function Ro(s,e,t,i){var r,o,l,c,d,p,u,h,g,m,f,b,y,v,E,C,M,O,w,k;let n=0,a=0;switch(i.type){case"top":n=le(e,(o=(r=i.offset)==null?void 0:r.x)!=null?o:0),a=ci(t,i.percent,(c=(l=i.offset)==null?void 0:l.y)!=null?c:0);break;case"bottom":n=le(e,(p=(d=i.offset)==null?void 0:d.x)!=null?p:0),a=di(t,i.percent,(h=(u=i.offset)==null?void 0:u.y)!=null?h:0);break;case"left":n=pi(e,i.percent,(m=(g=i.offset)==null?void 0:g.x)!=null?m:0),a=le(t,(b=(f=i.offset)==null?void 0:f.y)!=null?b:0);break;case"right":n=ui(e,i.percent,(v=(y=i.offset)==null?void 0:y.x)!=null?v:0),a=le(t,(C=(E=i.offset)==null?void 0:E.y)!=null?C:0);break;case"center":n=le(e,(O=(M=i.offset)==null?void 0:M.x)!=null?O:0),a=le(t,(k=(w=i.offset)==null?void 0:w.y)!=null?k:0);break}s.position?s.position.set(n,a):(s.x=n,s.y=a),i.scale!==void 0&&i.scale!==1&&s.scale&&(typeof s.scale.set=="function"?s.scale.set(i.scale,i.scale):(s.scale.x=i.scale,s.scale.y=i.scale))}function Ms(s,e,t,i=.2,n=1,a=!0,r=!1){let o=Oo(t,i),l=di(t,i/2);Le(s,le(e),l);let c=a?n*Ae.scaleFactor:n;Te(s,c),r&&!$n.find(d=>d.element===s)&&Po(s,Ms,e,t,i,n,a)}function zo(s,e,t,i=.1,n=1){Le(s,le(e),ci(t,i)),Te(s,n)}function $o(s,e,t,i=0,n=0,a=1){Le(s,le(e,i),le(t,n)),Te(s,a)}function Do(s,e,t,i=.1,n=1){Le(s,pi(e,i),le(t)),Te(s,n)}function No(s,e,t,i=.1,n=1){Le(s,ui(e,i),le(t)),Te(s,n)}function Ho(s,e,t,i=.05,n=.05,a=1){Le(s,pi(e,n),di(t,i)),Te(s,a)}function Fo(s,e,t,i=.05,n=.05,a=1){Le(s,ui(e,n),di(t,i)),Te(s,a)}function Bo(s,e,t,i=.05,n=.05,a=1){Le(s,pi(e,n),ci(t,i)),Te(s,a)}function Go(s,e,t,i=.05,n=.05,a=1){Le(s,ui(e,n),ci(t,i)),Te(s,a)}function Le(s,e,t){s&&s.position?typeof s.position.set=="function"?s.position.set(e,t):(s.position.x=e,s.position.y=t):s&&(s.x=e,s.y=t)}function Te(s,e){e!==1&&s&&s.scale&&(typeof s.scale.set=="function"?s.scale.set(e,e):s.scale.x!==void 0&&s.scale.y!==void 0&&(s.scale.x=e,s.scale.y=e))}var qe={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}},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}},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}},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}}};function Uo(s){return s&&qe[s]?JSON.parse(JSON.stringify(qe[s])):JSON.parse(JSON.stringify(It))}function Pt(s){Object.keys(s).forEach(e=>{let t=e;It[t]&&s[t]&&Object.assign(It[t],s[t])}),console.log("Config applied:",s)}function qo(s,e){let t=s/e;t>1.6?(Pt(qe.wide),console.log("Applied WIDE config for ratio:",t)):t<.7?(Pt(qe.tall),console.log("Applied TALL config for ratio:",t)):t>.8&&t<1.2?(Pt(qe.square),console.log("Applied SQUARE config for ratio:",t)):(Pt(qe.default),console.log("Applied DEFAULT config for ratio:",t))}if(typeof window!="undefined"){let s=window;s.configPresets=qe,s.resolveAnchorVec2=s.resolveAnchorVec2||Ve,s.resolveScreenAnchorPoint=s.resolveScreenAnchorPoint||ot,s.resolveScreenRatioPoint=s.resolveScreenRatioPoint||lt}Ci();function X(s,e){let t=(n,a)=>a===0?n:t(a,n%a),i=t(s,e);return`${s/i}:${e/i}`}var pd=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:X(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:X(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:X(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:X(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:X(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:X(360,780)}],ud=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:X(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:X(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:X(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:X(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:X(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:X(412,915)}],gd=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:X(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:X(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:X(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:X(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:X(800,1280)}],Qn=[{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:X(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:X(768,1024),mraidScale:.7}];var ea=[...Qn],ta=[{category:"playable",label:"Playable Ad",devices:Qn}],Ai=Qn[0];function Xe(s){return ea.find(e=>e.id===s)||Ai}function Qo(s){return ea.filter(e=>e.category===s)}Z();var ve=class{async updateProperty(e,t,i,n={}){var l,c,d;console.log("[PropertyUpdateManager] Updating:",e,t,i);let a=window.getEditableObjectConfig;if(typeof a!="function"){console.error("[PropertyUpdateManager] getEditableObjectConfig not available");return}let r=a(e);if(!r){console.error("[PropertyUpdateManager] Config not found for:",e);return}if(ae({objectId:e,path:t,value:i},{persist:!0}),t==="transform"||t.startsWith("transform."))console.log("[DEBUG FALLBACK] PropertyUpdateManager SKIP applyEditableObjectConfig (transform path)",t,e),n.refreshInspector||requestAnimationFrame(()=>{window.dispatchEvent(new CustomEvent("config:changed",{detail:{objectId:e}}))});else{let p=window.applyEditableObjectConfig;if(typeof p=="function"){let u=window.__editableConfig,h=(d=(c=(l=u==null?void 0:u.objects)==null?void 0:l.get)==null?void 0:c.call(l,e))!=null?d:r;await p(e,h),console.log("[PropertyUpdateManager] Applied config successfully")}else console.warn("[PropertyUpdateManager] applyEditableObjectConfig not available")}this.triggerRefresh(e),n.refreshInspector&&window.dispatchEvent(new CustomEvent("inspector:refresh"))}getNestedProperty(e,t){let i=t.split("."),n=e;for(let a of i)if(n&&typeof n=="object"&&a in n)n=n[a];else return;return n}triggerRefresh(e){let t=window.__refreshHierarchy;typeof t=="function"&&t(),window.dispatchEvent(new CustomEvent("inspector:property-updated",{detail:{objectId:e}}))}};function ia(s){let e=document.createElement("input");e.type="file",e.accept="image/*",e.onchange=async t=>{var a;let i=(a=t.target.files)==null?void 0:a[0];if(!i)return;let n=new FileReader;n.onload=async()=>{let r=n.result,o=s.category||"misc",c=`${(s.objectId||"new_asset").replace(/^json\./,"").replace(/[^a-zA-Z0-9_-]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"")||"new_asset"}_uploaded`;try{let p=await(await fetch("/api/library/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({category:o,filename:`${c}.png`,data:r,overwrite:!0})})).json();if(!(p!=null&&p.success)){alert(`Upload failed: ${(p==null?void 0:p.error)||"Unknown error"}`);return}let u=window.addAssetToRegistry;typeof u=="function"&&u(o,`${c}.png`);try{await fetch("/api/setup-library",{method:"POST",headers:{"Content-Type":"application/json"}})}catch{}let h=window.refreshAssetLibrary;typeof h=="function"&&await h(),await s.onApply(p.path)}catch(d){console.error("[QuickActionsBar] Upload error:",d),alert("Upload failed. Check console.")}},n.readAsDataURL(i)},e.click()}var Li=class{constructor(){this.updateManager=new ve}async handleAction(e,t,i){console.log("[QuickActionsBar] Action:",e,t,i);let n=window.getEditableObjectConfig;if(typeof n!="function")return;let a=n(t);if(!a)return;let r=this.updateManager.getNestedProperty(a,i);if(e==="ai-convert"||e==="upload"||e==="library"){let o=i==="ui.text"||i==="render.asset.path",l=i==="render.asset.path";o&&(await this.prepareForImageConversion(t,a),e==="ai-convert"&&i!=="render.asset.path"&&(i="render.asset.path"))}switch(e){case"library":this.openLibrary(t,i,r);break;case"ai-edit":this.openAIEditor(t,i,r);break;case"upload":this.openUpload(t,i);break;case"reset":await this.resetToDefault(t,i);break;case"ai-convert":this.handleAiConvert(t,i,r);break;default:console.warn("[QuickActionsBar] Unknown action:",e)}}async prepareForImageConversion(e,t){var i,n;if(console.log("[QuickActionsBar] Preparing for image conversion:",e),t.render||(t.render={alpha:1,visible:!0}),(t.render.alpha===0||t.render.alpha===void 0)&&(t.render.alpha=1,await this.updateManager.updateProperty(e,"render.alpha",1)),(t.render.visible===!1||t.render.visible===void 0)&&(t.render.visible=!0,await this.updateManager.updateProperty(e,"render.visible",!0)),t.render.asset||(t.render.asset={type:"image",path:""}),t.render.asset.type!=="image"&&(t.render.asset.type="image",await this.updateManager.updateProperty(e,"render.asset",{type:"image",path:t.render.asset.path||""})),t.ui&&t.ui.renderMode!=="png"){await this.updateManager.updateProperty(e,"ui.renderMode","png",{refreshInspector:!0}),await this.updateManager.updateProperty(e,"render.tint","#ffffff");let r=((n=(i=t.transform)==null?void 0:i.scale)!=null?n:1)*.3;await this.updateManager.updateProperty(e,"transform.scale",r),console.log("[QuickActionsBar] Text to PNG conversion: set tint white, scale",r)}this.ensureSlotInRegistry(e,t)}ensureSlotInRegistry(e,t){var o,l,c;let i=window.getEditableAssets;if(typeof i!="function")return;let n=i();if(!n||!n.slots)return;let a=e.startsWith("json.")?e.replace("json.",""):e;if(!n.slots.some(d=>d.objectId===a||d.slotId===a)){let d=((o=t.identity)==null?void 0:o.category)||"ui";console.log("[QuickActionsBar] Adding new slot to registry for converted object:",a),n.slots.push({slotId:a,displayName:a.replace(/_/g," "),objectId:a,category:d,currentAsset:((c=(l=t.render)==null?void 0:l.asset)==null?void 0:c.path)||"",defaultAsset:"",libraryFolder:d,assetType:"image"}),n.categories&&!n.categories.includes(d)&&n.categories.push(d),n.libraryAssets&&!n.libraryAssets[d]&&(n.libraryAssets[d]=[]);let p=window.reRenderAssetLibrary;typeof p=="function"&&p()}}openLibrary(e,t,i){var a;let n=window.__debugContext;if(n){if(n.activeTab!=="library"){n.activeTab="library";let r=window.__updateWorkbenchTabs;typeof r=="function"&&r()}if(n.libraryPanel){let r=window.getEditableObjectConfig,o=r==null?void 0:r(e),l=(a=o==null?void 0:o.identity)==null?void 0:a.category;l||(l=t.split(".")[0]==="render"?"environment":"ui"),console.log("[QuickActionsBar] Highlighting library slot:",e,"category:",l),n.libraryPanel.highlightSlot(e,l)}}}openAIEditor(e,t,i){let n=window.__openAiEditor;if(typeof n=="function"){let a=t.split(".").pop()||t;n(a,`Edit ${a} for ${e}`,i,{objectId:e,path:t})}else console.warn("[QuickActionsBar] AI Editor not available")}openUpload(e,t){var r;let i=window.getEditableObjectConfig,n=i==null?void 0:i(e),a=((r=n==null?void 0:n.identity)==null?void 0:r.category)||(t.split(".")[0]==="render"?"environment":"ui");ia({objectId:e,category:a,onApply:async o=>{var h,g;let l=window.applyAssetToSlot,c=this.getFilenameFromPath(o),d=/render\.asset\.path/i.test(t)||/\.(png|jpg|jpeg|gif|webp)$/i.test(o);typeof l=="function"&&c&&d&&await l(e,c,a),await this.updateManager.updateProperty(e,t,o);let p=window.__debugContext;(g=(h=p==null?void 0:p.options)==null?void 0:h.onPropertyChange)==null||g.call(h,e,t,o);let u=window.__highlightLibrarySlot;typeof u=="function"&&setTimeout(()=>{u(e,a)},500),window.dispatchEvent(new CustomEvent("inspector:refresh"))}})}getFilenameFromPath(e){if(!e)return"";let t=e.split("?")[0].replace(/\\/g,"/");return t.split("/").pop()||t}async resetToDefault(e,t){console.log("[QuickActionsBar] Reset to default:",e,t);try{let i=await this.getDefaultValue(e,t);i!==void 0?(await this.updateManager.updateProperty(e,t,i),console.log("[QuickActionsBar] Reset to default value:",i)):alert("No default value found for this property.")}catch(i){console.error("[QuickActionsBar] Failed to reset to default:",i),alert("Failed to reset property. Check console for details.")}}async getDefaultValue(e,t){let i=t.split(".");if(i.length<2)return;let n=i[0],a=i.slice(1),r=window.__editableConfig;if(!(r!=null&&r.schemas))return;let o=null;if(r.schemas instanceof Map?o=r.schemas.get(n):typeof r.schemas=="object"&&(o=r.schemas[n]),!(o!=null&&o.defaults))return;let l=o.defaults;for(let c of a)if(l&&typeof l=="object")l=l[c];else return;return l}handleAiConvert(e,t,i){let n=window.__openAiEditor;if(typeof n=="function"){let r=`A single, high-quality, high-detail game UI icon/asset representing "${String(i||e.replace(/_/g," ").replace("json.",""))}". Modern stylized 3D rendered style, vibrant colors, soft lighting, isolated on solid magenta background, highly polished professional game art.`,o="render.asset.path";console.log("[QuickActionsBar] AI Convert for:",e,"from:",t,"to:",o),n(e,r,"",{objectId:e,path:o});let l=window.__debugContext;if(l){l.activeTab="ai";let c=window.__updateWorkbenchTabs;typeof c=="function"&&c()}}else console.warn("[QuickActionsBar] AI Editor not available")}};var el=[{value:"loading",label:"Loading"},{value:"start",label:"Start"},{value:"gameplay",label:"Gameplay"},{value:"tutorial",label:"Tutorial"},{value:"endgame",label:"Endgame"}],tl=["environment","ui","character","system","backgrounds"],il=["bg","world","ui"],qs={SwerveMove:{speed:5,sensitivity:1,directionMode:"dominantAxis",axis:"both",bounds:{left:-400,right:400,top:-300,bottom:300}},DragToWin:{targetId:"",successDistance:80},DragSnap:{snapTargetId:"",snapDistance:40},JoystickMove:{speed:6,bounds:{left:-400,right:400,top:-300,bottom:300}}},Ti=class{constructor(){this.modal=null;this.state=null}open(e){this.state=this.createInitialState(e),this.createModal(),document.body.appendChild(this.modal),this.attachEventListeners(),this.updateStepUI()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),window.__wizardAssetPicker=null,this.modal=null,this.state=null}createInitialState(e){return{step:1,objectType:"sprite",instanceId:"",displayName:"",category:"environment",screenId:e.screenId,layer:"world",positionMode:"static",anchorPreset:"center",anchorX:.5,anchorY:.5,positionX:0,positionY:0,offsetX:0,offsetY:0,scale:.2,rotation:0,zIndex:0,assetPath:"",tint:"",alpha:1,text:"",font:"brand.primary",fontSize:18,letterSpacing:0,align:"center",graphicsWidth:200,graphicsHeight:200,graphicsFill:"#FFFFFF",graphicsAlpha:1,interactionEnabled:!1,dragEnabled:!1,hoverEnabled:!1,clickEnabled:!1,logicId:"",logicPropsRaw:""}}createModal(){let e=document.createElement("div");e.className="wizard-modal",e.innerHTML=`
47
47
  <div class="wizard-card">
48
48
  <div class="wizard-header">
49
49
  <div class="wizard-title">
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{E as J,F as K,G as L,H as M,I as N,J as O,K as P,L as Q,M as R,N as S,O as T,P as U,Q as V,R as W,S as X,T as Y,U as Z,a}from"./chunk-FCISZ3OQ.js";import"./chunk-I5OOVR5U.js";import{a as u,b as v,c as w,d as x,e as y,f as z,g as A,h as B,i as C,j as D,k as E,l as F,m as G,n as H,o as I}from"./chunk-PW2FGMCO.js";import{a as b,b as c,c as d,d as e,e as f,f as g,g as h,h as i,i as j,j as k,k as l,l as m,m as n,n as o,o as p,p as q,q as r,r as s,s as t}from"./chunk-HVKF2KYL.js";import"./chunk-E6WJCS24.js";import"./chunk-JXBG6UFL.js";export{U as COLORS,F as ConfigWatcher,O as DebugPanel,E as DefaultReloadStrategy,Y as Handler,X as PlayableLoadingScreen,P as PreviewShell,V as STROKE_WIDTH,W as THEME,d as applyConfigOverride,e as applyConfigOverrides,r as applyConfigsToDisk,B as applyDefaults,a as baseLottie,T as bootstrap,f as clearConfigOverrides,g as clearConfigOverridesForObject,j as configOverrideManager,Q as createPreviewShell,o as deepClone,Z as default,L as defaultPreset,K as deviceGroups,J as devicePresets,G as diffConfigs,p as exportConfigsAsJSON,i as getConfigOverrides,q as getConfigStateSummary,b as getOverrideMode,M as getPresetById,N as getPresetsByCategory,w as loadAllObjectConfigs,u as loadComponentSchemas,x as loadEngineConfig,y as loadGamePromptConfig,C as loadObjectCentricConfig,v as loadObjectConfig,z as loadSceneConfig,l as redoLastConfigChange,H as rehydrateObject,h as removeConfigOverride,s as resetToApplied,t as resetToOriginal,S as setBootstrapDependencies,c as setOverrideMode,I as setupHotReload,R as setupLiveEditBridge,D as toLegacyFormat,m as trackObjectCreation,n as trackObjectDeletion,k as undoLastConfigChange,A as validateObjectConfig};
1
+ import{E as J,F as K,G as L,H as M,I as N,J as O,K as P,L as Q,M as R,N as S,O as T,P as U,Q as V,R as W,S as X,T as Y,U as Z,a}from"./chunk-HYNBTANV.js";import"./chunk-I5OOVR5U.js";import{a as u,b as v,c as w,d as x,e as y,f as z,g as A,h as B,i as C,j as D,k as E,l as F,m as G,n as H,o as I}from"./chunk-PW2FGMCO.js";import{a as b,b as c,c as d,d as e,e as f,f as g,g as h,h as i,i as j,j as k,k as l,l as m,m as n,n as o,o as p,p as q,q as r,r as s,s as t}from"./chunk-HVKF2KYL.js";import"./chunk-E6WJCS24.js";import"./chunk-JXBG6UFL.js";export{U as COLORS,F as ConfigWatcher,O as DebugPanel,E as DefaultReloadStrategy,Y as Handler,X as PlayableLoadingScreen,P as PreviewShell,V as STROKE_WIDTH,W as THEME,d as applyConfigOverride,e as applyConfigOverrides,r as applyConfigsToDisk,B as applyDefaults,a as baseLottie,T as bootstrap,f as clearConfigOverrides,g as clearConfigOverridesForObject,j as configOverrideManager,Q as createPreviewShell,o as deepClone,Z as default,L as defaultPreset,K as deviceGroups,J as devicePresets,G as diffConfigs,p as exportConfigsAsJSON,i as getConfigOverrides,q as getConfigStateSummary,b as getOverrideMode,M as getPresetById,N as getPresetsByCategory,w as loadAllObjectConfigs,u as loadComponentSchemas,x as loadEngineConfig,y as loadGamePromptConfig,C as loadObjectCentricConfig,v as loadObjectConfig,z as loadSceneConfig,l as redoLastConfigChange,H as rehydrateObject,h as removeConfigOverride,s as resetToApplied,t as resetToOriginal,S as setBootstrapDependencies,c as setOverrideMode,I as setupHotReload,R as setupLiveEditBridge,D as toLegacyFormat,m as trackObjectCreation,n as trackObjectDeletion,k as undoLastConfigChange,A as validateObjectConfig};
@@ -43,7 +43,7 @@
43
43
  <button class="debug-btn primary" data-modal-apply>Apply</button>
44
44
  </div>
45
45
  </div>
46
- `,this.modal=n}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(r=>{r.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.addEventListener("click",o=>{let l=o.target.dataset.tab;l&&this.switchTab(l)})});let n=this.modal.querySelector("[data-ai-generate]");n==null||n.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let s=this.modal.querySelector("[data-modal-apply]");s==null||s.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",r=>{r.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let t=window.__openAiEditor;if(typeof t!="function"){alert("AI Editor not available. Please check your setup.");return}let n="";e==="edit"&&this.currentAsset?n=`Edit this image: ${this.currentObjectId}`:n=`Create an image for: ${this.currentObjectId}`,t(this.currentObjectId||"unknown",n,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var ur={};fn(ur,{AssetCache:()=>re,AssetLoader:()=>Pe,AssetSystem:()=>li,AssetTextures:()=>Ie,Assets:()=>Ha,BaseSystem:()=>rt,GameEngine:()=>oi,GameObject:()=>Ot,GameObjectManager:()=>at,ObjectFactory:()=>ye,Renderer:()=>_t,RuntimeObjectRegistry:()=>ot,Transform:()=>jt,applyScreenAnchor:()=>Ft,basePixi:()=>za,clearResponsiveElements:()=>ia,createPixiBase:()=>si,getRegisteredFontIds:()=>ja,globalResponsiveMultipliers:()=>St,initAssetTextures:()=>Zt,initAssets:()=>Fa,layout:()=>aa,playLottieOverlay:()=>Oa,registerFont:()=>Ma,registerType:()=>Xt,resolveAnchorVec2:()=>Te,resolveFont:()=>Pa,resolveFontWeight:()=>Ia,resolveScreenAnchorPoint:()=>De,resolveScreenRatioPoint:()=>Ne,runInitSequence:()=>Ba,setLottieInstance:()=>Qt,spawnSceneFromConfig:()=>Da,updateScreenState:()=>Ht});module.exports=Ya(ur);var ka=require("pixi.js");var Le={};function zt(i,e,t=!1){Le[i]||(Le[i]=[]),Le[i].push({fn:e,once:t})}function di(i,e){if(Le[i]){if(!e){delete Le[i];return}Le[i]=Le[i].filter(t=>t.fn!==e)}}function $t(i,...e){let t=Le[i];if(t)for(let n of[...t])n.fn(...e),n.once&&di(i,n.fn)}function ee(i,e){zt(i,e,!0)}var $=null,ae=[],We=null;function wn(i){$=i,ae=[],We!==null&&(clearTimeout(We),We=null)}function xn(){var i,e,t;return{endpoint:($==null?void 0:$.endpoint)||"",transport:($==null?void 0:$.transport)||"beacon",batchSize:(i=$==null?void 0:$.batchSize)!=null?i:10,flushIntervalMs:(e=$==null?void 0:$.flushIntervalMs)!=null?e:300,maxQueue:(t=$==null?void 0:$.maxQueue)!=null?t:200,debug:!!($!=null&&$.debug)}}async function yn(i,e,t,n){let a=JSON.stringify(e);if(t==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let s=navigator.sendBeacon(i,new Blob([a],{type:"application/json"}));n&&console.log("[handler.telemetry] beacon",s,e);return}catch(s){n&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",s)}try{await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),n&&console.log("[handler.telemetry] fetch",e)}catch(s){n&&console.warn("[handler.telemetry] fetch failed",s)}}function pi(i,e){let t=xn();if(e&&t.endpoint){if(ae.push(i),ae.length>t.maxQueue&&(ae=ae.slice(ae.length-t.maxQueue)),ae.length>=t.batchSize){vn();return}We===null&&(We=window.setTimeout(()=>{We=null,vn()},t.flushIntervalMs))}}async function vn(){let i=xn();if(!i.endpoint||ae.length===0)return;let e=ae.splice(0,i.batchSize);await yn(i.endpoint,{events:e},i.transport,i.debug),ae.length>0&&await yn(i.endpoint,{events:ae.splice(0,i.batchSize)},i.transport,i.debug)}function Sn(i){return Math.max(0,Math.min(1,i))}function Ka(i){let e=String(i!=null?i:"power2.out");if(e==="linear")return t=>t;if(e==="sine.inOut")return t=>.5-Math.cos(Math.PI*t)/2;if(e==="power2.out"||e==="easeOutQuad")return t=>1-(1-t)*(1-t);if(e.startsWith("back.out")){let t=e.match(/back\.out\(([\d.]+)\)/),n=t?Number(t[1]):1.8;return a=>1+(n+1)*Math.pow(a-1,3)+n*Math.pow(a-1,2)}return t=>1-(1-t)*(1-t)}function wt(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Xa(i,e){let t=i==null?void 0:i[e];return typeof t=="number"?t:0}function En(i,e,t){try{i[e]=t}catch{}}function Ja(i){let e=i==null?void 0:i.scale;if(!e)return null;let t=typeof e.x=="number"?e.x:1,n=typeof e.y=="number"?e.y:1;return{x:t,y:n}}function Cn(i,e){let t=i==null?void 0:i.scale;if(t)try{typeof t.set=="function"?t.set(e.x,e.y):(typeof t.x=="number"&&(t.x=e.x),typeof t.y=="number"&&(t.y=e.y))}catch{}}function An(i,e){let t=Ja(i);if(!t)return{from:null,to:null};let n=null,a=null;return typeof e.scale=="number"?(n=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(n=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(n=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),n===null&&a===null?{from:null,to:null}:{from:{x:t.x,y:t.y},to:{x:n!=null?n:t.x,y:a!=null?a:t.y}}}function Ln(){let i=new Set,e=new WeakMap,t=null,n=()=>{if(t!=null)return;t=requestAnimationFrame(()=>{t=null,o(),i.size>0&&n()})},a=u=>{var p;i.add(u);let d=(p=e.get(u.target))!=null?p:new Set;d.add(u),e.set(u.target,d),n()},s=u=>{i.delete(u);let d=e.get(u.target);d&&(d.delete(u),d.size===0&&e.delete(u.target))},r=u=>{u.killed||(u.killed=!0,s(u))},o=()=>{var d,p;let u=wt();for(let g of Array.from(i)){if(g.killed||g.paused)continue;let f=u-g.startMs-g.delayMs;if(f<0)continue;let m=g.durationMs>0?f/g.durationMs:1,C=Sn(m),b=g.repeat>=0?g.repeat+1:1,h=g.repeat>0?Math.min(Math.floor(m),b-1):0;if(g.repeat>0&&m>=1){let x=m-h;C=Sn(x)}let y=g.ease(C);g.yoyo&&h%2===1&&(y=1-y);for(let x of g.props)En(g.target,x.key,x.from+(x.to-x.from)*y);g.scaleFrom&&g.scaleTo&&Cn(g.target,{x:g.scaleFrom.x+(g.scaleTo.x-g.scaleFrom.x)*y,y:g.scaleFrom.y+(g.scaleTo.y-g.scaleFrom.y)*y});try{(d=g.onUpdate)==null||d.call(g)}catch{}if(m>=b){r(g);try{(p=g.onComplete)==null||p.call(g)}catch{}}}},c=(u,d,p)=>{var x;let g=Math.max(0,(typeof d.duration=="number"?d.duration:.5)*1e3),f=Math.max(0,(typeof d.delay=="number"?d.delay:0)*1e3+((x=p==null?void 0:p.delayMsOverride)!=null?x:0)),m=Ka(d.ease),C=typeof d.repeat=="number"?Math.max(0,d.repeat|0):0,b=d.yoyo===!0,h=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),y=[];for(let P of Object.keys(d)){if(h.has(P))continue;let L=d[P];typeof L=="number"&&y.push({key:P,from:Xa(u,P),to:L})}let w=An(u,d);return{target:u,startMs:wt(),delayMs:f,durationMs:g,ease:m,props:y,scaleFrom:w.from,scaleTo:w.to,repeat:C,yoyo:b,onUpdate:typeof d.onUpdate=="function"?d.onUpdate:void 0,onComplete:typeof d.onComplete=="function"?d.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},l={to(u,d){let p=c(u,d);return a(p),{kill:()=>r(p),pause:()=>{p.paused||(p.paused=!0,p.pauseAtMs=wt())},resume:()=>{var m;if(!p.paused)return;let g=(m=p.pauseAtMs)!=null?m:wt(),f=wt()-g;p.startMs+=f,p.paused=!1,p.pauseAtMs=null},isActive:()=>!p.killed&&!p.paused}},fromTo(u,d,p){return l.set(u,d),l.to(u,p)},set(u,d){if(!u||!d)return;for(let g of Object.keys(d)){let f=d[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof f=="number"&&En(u,g,f)}let p=An(u,d);p.to&&Cn(u,p.to)},killTweensOf(u){let d=e.get(u);if(d)for(let p of Array.from(d))r(p)},timeline(u={}){let d=[],p=0,g=!1,f=[],m=h=>{if(typeof h=="number")return Math.max(0,h*1e3);let y=typeof h=="string"?h.trim():"";return y.startsWith("+=")?p+Math.max(0,Number(y.slice(2))*1e3||0):y?Math.max(0,Number(y)*1e3||0):p},C=h=>{d.push(h);let y=Math.max(0,(typeof h.vars.duration=="number"?h.vars.duration:.5)*1e3);p=Math.max(p,h.atMs+y)},b={to(h,y,w){return C({kind:"to",target:h,vars:y,atMs:m(w)}),b},fromTo(h,y,w,x){return C({kind:"fromTo",target:h,vars:w,from:y,atMs:m(x)}),b},play(){var h,y;if(g)return b;g=!0,f=[];for(let w of d)w.kind==="fromTo"&&l.set(w.target,(h=w.from)!=null?h:{}),f.push(l.to(w.target,{...w.vars,delay:w.atMs/1e3+((y=w.vars.delay)!=null?y:0)}));return b},pause(){for(let h of f)h.pause();return b},kill(){for(let h of f)h.kill();f=[],g=!1}};return u.paused||b.play(),b}};return l}function Tn(){if(typeof window=="undefined")return;let i=window;if(!i.gsap)try{i.gsap=Ln()}catch{}}var kn={name:"handler-playable-sdk",version:"1.0.75",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && mkdir -p dist/cli/student-helper && cp src/cli/student-helper/*.mjs dist/cli/student-helper/ && chmod +x dist/cli/*.mjs dist/cli/student-helper/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs dist/cli/student-helper/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var te=0,Qa=te++,Pn=te++,In=te++,Mn=te++,jn=te++,_n=te++,On=te++,Rn=te++,zn=te++,$n=te++,Dn=te++,Nn=te++,j=Qa;function Hn(){return j===Pn}function Fn(){return j===In}function Bn(){return j===Mn}function Gn(){return j===jn}function Ye(){return j===_n}function Ke(){return j===On}function Un(){return j===Rn}function qn(){return j===zn}function Vn(){return j===$n}function ui(){return j===Dn}function gi(){return j===Nn}function Wn(){let i=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(i==="mraid")try{mraid.getState(),j=Pn;return}catch{}else if(i==="dapi")try{dapi.isReady(),j=In;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(j=Mn)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(j=jn)}catch{}else if(e==="mintegral")window.gameReady&&(j=_n);else if(e==="tapjoy")window.TJ_API&&(j=On);else if(e==="tiktok")window.openAppStore&&(j=Rn);else if(e==="smadex")try{window.smxTracking&&(j=zn)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(j=$n)}catch{}else e==="vungle"?j=Dn:(i==="nucleo"||e==="nucleo")&&(j=Nn)}var Dt=ci(require("lottie-web"),1),Yn=Dt.default;typeof window!="undefined"&&(window.lottie=Dt.default,window.__baseLottie=Dt.default);fi();function D(i,e){let t=(a,s)=>s===0?a:t(s,a%s),n=t(i,e);return`${i/n}:${e/n}`}var qr=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:D(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:D(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:D(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:D(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:D(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:D(360,780)}],Vr=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:D(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:D(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:D(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:D(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:D(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:D(412,915)}],Wr=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:D(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:D(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:D(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:D(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:D(800,1280)}],Zn=[{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:D(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:D(768,1024),mraidScale:.7}];var Yr=[...Zn];var os=Zn[0];ce();var ta=require("pixi.js"),me={width:400,height:600,designWidth:400,scaleFactor:1},St={scale:1,position:1},Bt=[];function ls(i,e,t,n,a,s,r){Bt.push({element:i,originalScale:s,positionHelper:e,heightPercent:a}),e(i,t,n,a,s,r,!1)}function cs(){Bt.forEach(({element:i,originalScale:e,positionHelper:t,heightPercent:n})=>{let a=e*me.scaleFactor;t(i,me.width,me.height,n,a,!0,!1)})}function ia(){Bt.length=0,console.log("[LAYOUT] Cleared all responsive elements")}function Ht(i,e){console.log(`[SCREEN] updateScreenState called: ${i}x${e}`),me.width=i,me.height=e,me.scaleFactor=Math.min(i/me.designWidth,1.15),St.scale=me.scaleFactor,St.position=1,console.log(`[SCREEN] Global multipliers - scale: ${St.scale.toFixed(3)}`),cs()}var _={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}};function ds(i,e,t){let n=_[i];n&&n[e]!==void 0&&(n[e]=t,console.log(`Updated ${i}.${e} = ${t}`))}function ps(){return _}var us={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 Nt(i,e){return typeof i=="number"&&Number.isFinite(i)?i:e}function Te(i,e={x:.5,y:.5}){var t;if(Array.isArray(i))return{x:Nt(i[0],e.x),y:Nt(i[1],e.y)};if(i&&typeof i=="object"){let n=i;return{x:Nt(n.x,e.x),y:Nt(n.y,e.y)}}if(typeof i=="string"){let n=i.trim().toLowerCase();return(t=us[n])!=null?t:e}return e}function De(i,e,t,n={}){var g,f,m,C,b,h;let a=Te(t),s=(g=n.inset)!=null?g:{},r=(f=n.padding)!=null?f:{x:0,y:0},o=((m=s.left)!=null?m:0)+r.x,c=((C=s.right)!=null?C:0)+r.x,l=((b=s.top)!=null?b:0)+r.y,u=((h=s.bottom)!=null?h:0)+r.y,d=Math.max(0,i-o-c),p=Math.max(0,e-l-u);return{x:o+d*a.x,y:l+p*a.y}}function Ne(i,e,t,n={}){var m,C,b,h,y,w;let a=(m=n.inset)!=null?m:{},s=(C=n.padding)!=null?C:{x:0,y:0},r=((b=a.left)!=null?b:0)+s.x,o=((h=a.right)!=null?h:0)+s.x,c=((y=a.top)!=null?y:0)+s.y,l=((w=a.bottom)!=null?w:0)+s.y,u=Math.max(0,i-r-o),d=Math.max(0,e-c-l),p=Te(t,{x:.5,y:.5}),g=Math.min(Math.max(p.x,0),1),f=Math.min(Math.max(p.y,0),1);return{x:r+u*g,y:c+d*f}}function Ft(i,e,t,n={}){var u,d,p;if(!i)return;let a=n.positionRatio?Ne(e,t,n.positionRatio,{inset:n.inset,padding:n.screenPadding}):De(e,t,n.anchor,{inset:n.inset,padding:n.screenPadding}),s=(u=n.offset)!=null?u:{x:0,y:0},r=a.x+s.x,o=a.y+s.y;i.anchor&&n.renderAnchor&&i.anchor.set(n.renderAnchor.x,n.renderAnchor.y),se(i,r,o);let c=(d=n.scale)!=null?d:1,l=(p=n.scaleMultiplier)!=null?p:1;(n.scale!==void 0||n.scaleMultiplier!==void 0)&&de(i,c*l)}if(typeof window!="undefined"){let i=window.innerWidth,e=window.innerHeight,t=()=>{let n=window.innerWidth,a=window.innerHeight;(n!==i||a!==e)&&(i=n,e=a,Ht(n,a))};window.addEventListener("resize",t),window.addEventListener("orientationchange",()=>{setTimeout(t,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",t),window.mraid.addEventListener("sizeChange",t)),Ht(window.innerWidth,window.innerHeight),window.updateDebugConfig=ds,window.getDebugConfig=ps,window.copyConfig=Es,window.applyConfig=xt,window.applyConfigForRatio=Cs,window.positionAtBottom=na,window.positionAtTop=ms,window.positionAtCenter=fs,window.positionAtLeft=bs,window.positionAtRight=ys,window.positionAtBottomLeft=vs,window.positionAtBottomRight=ws,window.positionAtTopLeft=xs,window.positionAtTopRight=Ss,window.applyPositionContract=hs,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 Gt(i,e,t=0){return i*e+t}function Ut(i,e,t=0){return i*(1-e)+t}function qt(i,e,t=0){return i*e+t}function Vt(i,e,t=0){return i*(1-e)+t}function ie(i,e=0){return i/2+e}function gs(i,e){return i*e}function hs(i,e,t,n){var r,o,c,l,u,d,p,g,f,m,C,b,h,y,w,x,P,L,B,R;let a=0,s=0;switch(n.type){case"top":a=ie(e,(o=(r=n.offset)==null?void 0:r.x)!=null?o:0),s=Gt(t,n.percent,(l=(c=n.offset)==null?void 0:c.y)!=null?l:0);break;case"bottom":a=ie(e,(d=(u=n.offset)==null?void 0:u.x)!=null?d:0),s=Ut(t,n.percent,(g=(p=n.offset)==null?void 0:p.y)!=null?g:0);break;case"left":a=qt(e,n.percent,(m=(f=n.offset)==null?void 0:f.x)!=null?m:0),s=ie(t,(b=(C=n.offset)==null?void 0:C.y)!=null?b:0);break;case"right":a=Vt(e,n.percent,(y=(h=n.offset)==null?void 0:h.x)!=null?y:0),s=ie(t,(x=(w=n.offset)==null?void 0:w.y)!=null?x:0);break;case"center":a=ie(e,(L=(P=n.offset)==null?void 0:P.x)!=null?L:0),s=ie(t,(R=(B=n.offset)==null?void 0:B.y)!=null?R:0);break}i.position?i.position.set(a,s):(i.x=a,i.y=s),n.scale!==void 0&&n.scale!==1&&i.scale&&(typeof i.scale.set=="function"?i.scale.set(n.scale,n.scale):(i.scale.x=n.scale,i.scale.y=n.scale))}function na(i,e,t,n=.2,a=1,s=!0,r=!1){let o=gs(t,n),c=Ut(t,n/2);se(i,ie(e),c);let l=s?a*me.scaleFactor:a;de(i,l),r&&!Bt.find(u=>u.element===i)&&ls(i,na,e,t,n,a,s)}function ms(i,e,t,n=.1,a=1){se(i,ie(e),Gt(t,n)),de(i,a)}function fs(i,e,t,n=0,a=0,s=1){se(i,ie(e,n),ie(t,a)),de(i,s)}function bs(i,e,t,n=.1,a=1){se(i,qt(e,n),ie(t)),de(i,a)}function ys(i,e,t,n=.1,a=1){se(i,Vt(e,n),ie(t)),de(i,a)}function vs(i,e,t,n=.05,a=.05,s=1){se(i,qt(e,a),Ut(t,n)),de(i,s)}function ws(i,e,t,n=.05,a=.05,s=1){se(i,Vt(e,a),Ut(t,n)),de(i,s)}function xs(i,e,t,n=.05,a=.05,s=1){se(i,qt(e,a),Gt(t,n)),de(i,s)}function Ss(i,e,t,n=.05,a=.05,s=1){se(i,Vt(e,a),Gt(t,n)),de(i,s)}function se(i,e,t){i&&i.position?typeof i.position.set=="function"?i.position.set(e,t):(i.position.x=e,i.position.y=t):i&&(i.x=e,i.y=t)}function de(i,e){e!==1&&i&&i.scale&&(typeof i.scale.set=="function"?i.scale.set(e,e):i.scale.x!==void 0&&i.scale.y!==void 0&&(i.scale.x=e,i.scale.y=e))}var $e={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}},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}},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}},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}}};function Es(i){return i&&$e[i]?JSON.parse(JSON.stringify($e[i])):JSON.parse(JSON.stringify(_))}function xt(i){Object.keys(i).forEach(e=>{let t=e;_[t]&&i[t]&&Object.assign(_[t],i[t])}),console.log("Config applied:",i)}function Cs(i,e){let t=i/e;t>1.6?(xt($e.wide),console.log("Applied WIDE config for ratio:",t)):t<.7?(xt($e.tall),console.log("Applied TALL config for ratio:",t)):t>.8&&t<1.2?(xt($e.square),console.log("Applied SQUARE config for ratio:",t)):(xt($e.default),console.log("Applied DEFAULT config for ratio:",t))}if(typeof window!="undefined"){let i=window;i.configPresets=$e,i.resolveAnchorVec2=i.resolveAnchorVec2||Te,i.resolveScreenAnchorPoint=i.resolveScreenAnchorPoint||De,i.resolveScreenRatioPoint=i.resolveScreenRatioPoint||Ne}var K=null,ea=new Map;function aa(i,e,t,n,a,s={}){var Se,Ee,Ce,Ae,W,_e,lt,ct,dt,pt,ut,gt,ht,mt,ft,bt,F,Z,U,Q,Ue,Oe,Bi,Gi,Ui,qi,Vi,Wi,Yi,Ki,Xi,Ji,Zi,Qi,en,tn,nn,an,sn,rn,on,ln,cn,dn,pn,un,gn,hn,mn;let r=(Se=s.enableDebugLogs)!=null?Se:!1;r&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] ===== STARTING LAYOUT CALCULATION ====="),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Screen dimensions:",{width:n.width,height:n.height}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Time:",t),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Options:",s));let{mainContainer:o,label:c,background:l,backgroundTexture:u,app:d}=i;if(!d||!d.renderer){r&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] \u274C No app or renderer, skipping layout");return}r&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] App renderer dimensions:",{width:d.renderer.width,height:d.renderer.height}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] App screen dimensions:",{width:d.screen.width,height:d.screen.height}));let p=n.width,g=n.height;r&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Base dimensions:",{baseWidth:p,baseHeight:g});let f=p*_.layout.screen_scale_x,m=g*_.layout.screen_scale_y,C=p/2,b=e.engine.runtime||{},h=b.layout||{};r&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] Debug config:",{screen_scale_x:_.layout.screen_scale_x,screen_scale_y:_.layout.screen_scale_y}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Calculated dimensions:",{width:f,height:m,midX:C}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Engine runtime:",b),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Layout config:",h));let y=m>f,w=(Ee=h.design_width_portrait)!=null?Ee:y?400:600,x=(Ce=h.design_height_portrait)!=null?Ce:y?600:400,P=Math.min(f/w,m/x);P=Math.min(P,1.15);let L=P*((Ae=_.engine.scale)!=null?Ae:1),B=(W=s.skipMainContainerTransform)!=null?W:!1;!B&&o&&o.scale&&(typeof o.scale.set=="function"?o.scale.set(L):(o.scale.x=L,o.scale.y=L));let R=(_e=h.main_container_anchor)!=null?_e:"center",H=(lt=h.main_container_position_ratio)!=null?lt:{x:.5,y:.5},z=(ct=h.main_container_offset)!=null?ct:{x:0,y:0},T=h.main_container_position_ratio?Ne(p,g,H):De(p,g,R),E=T.x+z.x+_.layout.position_offset.x,S=T.y+z.y+_.layout.position_offset.y;if(!B&&o&&o.position&&(typeof o.position.set=="function"?o.position.set(E,S):(o.position.x=E,o.position.y=S)),a&&(o!=null&&o.toLocal)){let G=g>p,Y=(dt=h.design_width_portrait)!=null?dt:G?320:480,N=(pt=h.design_height_portrait)!=null?pt:G?480:320;for(let[oe,le]of e.objects.entries()){let q=le==null?void 0:le.transform;if(!q||((ut=q.position_mode)!=null?ut:"static")!=="static")continue;let k=(gt=a.get)==null?void 0:gt.call(a,oe),yt=((ht=k==null?void 0:k.getDisplayObject)==null?void 0:ht.call(k))||(k==null?void 0:k.pixiObject)||k;if(!yt||yt.parent!==o)continue;let ge=(mt=q.anchor)!=null?mt:"bottom-left";ge==="bottom-left"&&q.anchor==null&&console.log("[DEBUG FALLBACK] LayoutManager transform.anchor \u2192 bottom-left");let qe=q.position_ratio!=null?Ne(Y,N,q.position_ratio):De(Y,N,ge),Ve=(ft=q.position)!=null?ft:{x:0,y:0},vt=qe.x-Y/2+Ve.x,Re=qe.y-N/2+Ve.y;typeof(k==null?void 0:k.setPosition)=="function"?k.setPosition(vt,Re):(se(yt,vt,Re),(bt=k==null?void 0:k.transform)!=null&&bt.position&&(k.transform.position.x=vt,k.transform.position.y=Re))}}let A=typeof window!="undefined"?window.__BUILD_SETTINGS__:null,J=((A==null?void 0:A.buildMode)||(typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"dev"))==="dev";if(_.layout.debug_rect_visible&&J){(!K||K.parent!==d.stage)&&(K==null||K.destroy(),K=new ta.Graphics,K.zIndex=9999,d.stage.addChild(K)),K.clear();let G=_.layout.debug_rect_scale_x,Y=_.layout.debug_rect_scale_y,N=(p-4)*G,oe=(g-4)*Y,le=(p-N)/2,q=(g-oe)/2;r&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] ===== DEBUG RECT POSITIONING ====="),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Debug rect calculations:",{baseWidth:p,baseHeight:g,rectW:N,rectH:oe,offsetX:le,offsetY:q}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Debug rect final position:",{x:2+le,y:2+q,width:N,height:oe})),K.rect(2+le,2+q,N,oe).stroke({width:_.layout.debug_rect_thickness,color:_.layout.debug_rect_color})}else K&&(K.destroy(),K=null);let O=((F=i.label)==null?void 0:F.config)||e.objects.get("label_1")||e.objects.get("ui_tutorial_1");if(c&&c.position&&O){let G=(U=(Z=O==null?void 0:O.transform)==null?void 0:Z.anchor)!=null?U:"center",Y=(Q=O==null?void 0:O.transform)==null?void 0:Q.position_ratio,N=((Ue=O==null?void 0:O.transform)==null?void 0:Ue.offset)||{x:0,y:0};Ft(c,p,g,{anchor:G,positionRatio:Y,offset:{x:N.x*L,y:N.y*L},renderAnchor:Te(G)})}if(c&&c.alpha>0){let G=1+Math.sin(t*_.engine.label_pulse_speed)*_.engine.label_pulse_intensity,Y=(Bi=(Oe=O==null?void 0:O.transform)==null?void 0:Oe.scale)!=null?Bi:1,N=G*L*Y;c.scale&&(typeof c.scale.set=="function"?c.scale.set(N):(c.scale.x=N,c.scale.y=N))}r&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] ===== BACKGROUND POSITIONING =====");let ne=l?e.objects.get("background_1"):null,je=!!ne&&(l==null?void 0:l.parent)===o;if(l&&!je){r&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background object exists:",!!l),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background type:",(Gi=l.constructor)==null?void 0:Gi.name)),l.alpha=((qi=(Ui=b.background)==null?void 0:Ui.alpha)!=null?qi:.98)*_.engine.background_alpha,r&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background alpha set to:",l.alpha),r&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background config:",ne);let G=(ne==null?void 0:ne.transform)||{};r&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background transform:",G);let Y=G.offset||{x:0,y:0},N=((Wi=(Vi=b.background)==null?void 0:Vi.offset_y)!=null?Wi:0)+_.engine.background_offset_y,oe=(Yi=G.anchor)!=null?Yi:"center",le=G.position_ratio;if(r&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background positioning params:",{bgOffset:Y,bgRuntimeOffsetY:N,bgScreenAnchor:oe,bgPositionRatio:le,baseWidth:p,baseHeight:g,finalScale:L}),Ft(l,p,g,{anchor:oe,positionRatio:le,offset:{x:Y.x*L,y:Y.y*L+N},renderAnchor:Te(oe)}),r&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background position after applyScreenAnchor:",{x:l.x,y:l.y,scaleX:(Ki=l.scale)==null?void 0:Ki.x,scaleY:(Xi=l.scale)==null?void 0:Xi.y,anchorX:(Ji=l.anchor)==null?void 0:Ji.x,anchorY:(Zi=l.anchor)==null?void 0:Zi.y,pivotX:(Qi=l.pivot)==null?void 0:Qi.x,pivotY:(en=l.pivot)==null?void 0:en.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 qe=Math.max(f/u.width,m/u.height),Ve=(nn=(tn=b.background)==null?void 0:tn.scale_multiplier)!=null?nn:1.05,vt=(an=G.scale)!=null?an:1,Re=qe*Ve*_.engine.background_scale*vt;l.scale&&(typeof l.scale.set=="function"?l.scale.set(Re):(l.scale.x=Re,l.scale.y=Re))}else l&&typeof l.clear=="function"&&(l.clear(),l.rect(-f/2,-m/2,f,m).fill({color:1444375}));let q=`${p}x${g}`,I=ea.get(q),k={x:Number((sn=l.x)!=null?sn:0),y:Number((rn=l.y)!=null?rn:0),scaleX:Number((ln=(on=l.scale)==null?void 0:on.x)!=null?ln:1),scaleY:Number((dn=(cn=l.scale)==null?void 0:cn.y)!=null?dn:1),rotation:Number.isFinite(l.rotation)?l.rotation:void 0,anchorX:Number.isFinite((pn=l.anchor)==null?void 0:pn.x)?l.anchor.x:void 0,anchorY:Number.isFinite((un=l.anchor)==null?void 0:un.y)?l.anchor.y:void 0,pivotX:Number.isFinite((gn=l.pivot)==null?void 0:gn.x)?l.pivot.x:void 0,pivotY:Number.isFinite((hn=l.pivot)==null?void 0:hn.y)?l.pivot.y:void 0},yt=Number.isFinite(k.x)&&Number.isFinite(k.y)&&Number.isFinite(k.scaleX)&&Number.isFinite(k.scaleY),ge=k;if(I){let qe=Math.hypot(k.x-I.x,k.y-I.y),Ve=Math.max(p,g)*.5;(!yt||qe>Ve)&&((mn=l.position)!=null&&mn.set?l.position.set(I.x,I.y):(l.x=I.x,l.y=I.y),l.scale&&(typeof l.scale.set=="function"?l.scale.set(I.scaleX,I.scaleY):(l.scale.x=I.scaleX,l.scale.y=I.scaleY)),Number.isFinite(I.rotation)&&typeof l.rotation=="number"&&(l.rotation=I.rotation),l.anchor&&Number.isFinite(I.anchorX)&&Number.isFinite(I.anchorY)&&l.anchor.set(I.anchorX,I.anchorY),l.pivot&&Number.isFinite(I.pivotX)&&Number.isFinite(I.pivotY)&&l.pivot.set(I.pivotX,I.pivotY),ge=I)}Number.isFinite(ge.x)&&Number.isFinite(ge.y)&&Number.isFinite(ge.scaleX)&&Number.isFinite(ge.scaleY)&&ea.set(q,ge)}}function As(i){return new Promise((e,t)=>{let n=new FileReader;n.onerror=()=>t(new Error("FileReader failed")),n.onload=()=>e(String(n.result||"")),n.readAsDataURL(i)})}function Ls(i){var a;let[e,t]=i.split(","),n=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:t!=null?t:"",mimeType:(a=n==null?void 0:n[1])!=null?a:"image/png"}}async function Ts(i){return await new Promise(e=>{let t=new Image;t.onload=()=>e({width:t.naturalWidth||t.width,height:t.naturalHeight||t.height}),t.onerror=()=>e(null),t.src=i})}async function yi(i){var e,t;try{console.log("[ImageUtils] Fetching image data from URL:",i);let n=await fetch(i);if(!n.ok)return console.warn("[ImageUtils] Fetch failed with status:",n.status,i),null;let a=await n.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let s=await As(a),r=await Ts(s),o=Ls(s);return console.log("[ImageUtils] Success resolution:",r==null?void 0:r.width,"x",r==null?void 0:r.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:s,width:(e=r==null?void 0:r.width)!=null?e:0,height:(t=r==null?void 0:r.height)!=null?t:0}}catch(n){return console.error("[ImageUtils] Error fetching image data:",n),null}}async function Wt(i,e=30){try{console.log("[ImageUtils] Removing background color...");let t=await new Promise((d,p)=>{let g=new Image;g.onload=()=>d(g),g.onerror=()=>p(new Error("Failed to load image")),g.src=i}),n=document.createElement("canvas");n.width=t.width,n.height=t.height;let a=n.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),i;a.drawImage(t,0,0);let s=a.getImageData(0,0,n.width,n.height),r=s.data,c=[{name:"top-left",offset:0},{name:"top-right",offset:(n.width-1)*4},{name:"bottom-left",offset:(n.height-1)*n.width*4},{name:"bottom-right",offset:((n.height-1)*n.width+(n.width-1))*4}].map(d=>({r:r[d.offset],g:r[d.offset+1],b:r[d.offset+2]})),l=0;for(let d=0;d<r.length;d+=4){let p=r[d],g=r[d+1],f=r[d+2],m=!1;for(let C of c)if(Math.sqrt(Math.pow(p-C.r,2)+Math.pow(g-C.g,2)+Math.pow(f-C.b,2))<e){m=!0;break}m&&(r[d+3]=0,l++)}return console.log(`[ImageUtils] Removed background from ${l} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(s,0,0),n.toDataURL("image/png")}catch(t){return console.error("[ImageUtils] Error removing background:",t),i}}var sa=require("@google/genai");async function vi(i,e,t=[],n={}){var a,s,r,o,c,l,u;try{if(!(i!=null&&i.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let b=0;b<t.length;b++){let h=t[b];if(!h.base64||!h.mimeType)throw new Error(`Image ${b+1} is missing required data`);if(h.base64.length<1e3&&console.warn(`Image ${b+1} data appears very small, may be corrupted`),!h.mimeType.startsWith("image/"))throw new Error(`Image ${b+1} has invalid MIME type: ${h.mimeType}`)}let d=new sa.GoogleGenAI({apiKey:i}),p="gemini-2.5-flash",g=[e];t.length>0&&t.forEach((b,h)=>{g.push({inlineData:{data:b.base64,mimeType:b.mimeType}}),console.log(`[Gemini] Added image ${h+1}: ${b.mimeType}, size: ${Math.round(b.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${t.length} images and prompt length: ${e.length}`);let f=await d.models.generateContent({model:p,contents:g}),m="",C=(r=(s=(a=f.candidates)==null?void 0:a[0])==null?void 0:s.content)==null?void 0:r.parts;if(C)for(let b of C)b.text&&(m+=b.text);if(!m.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${m.length}`),m}catch(d){throw console.error("[Gemini] API error:",d),(o=d.message)!=null&&o.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(c=d.message)!=null&&c.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(l=d.message)!=null&&l.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(u=d.message)!=null&&u.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):d}}var ra=require("@google/genai");async function Yt(i,e,t=[],n={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new ra.GoogleGenAI({apiKey:i}),s=[{text:e}];t.length>0&&t.forEach((o,c)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${c}`),s.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let r=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:s});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!r.candidates||!r.candidates[0]||!r.candidates[0].content||!r.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of r.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let c=o.inlineData.data,l=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${l};base64,${c}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(a){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(a,Object.getOwnPropertyNames(a),2)),a}}var _s=require("pixi.js");Et();Kt();ce();var ua=require("pixi.js");var Rs=require("pixi.js");ce();function qs(i){return new Promise((e,t)=>{let n=new FileReader;n.onerror=()=>t(new Error("FileReader failed")),n.onload=()=>e(String(n.result||"")),n.readAsDataURL(i)})}function Vs(i){var a;let[e,t]=i.split(","),n=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:t!=null?t:"",mimeType:(a=n==null?void 0:n[1])!=null?a:"image/png"}}function Ws(i){return`
46
+ `,this.modal=n}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(r=>{r.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.addEventListener("click",o=>{let l=o.target.dataset.tab;l&&this.switchTab(l)})});let n=this.modal.querySelector("[data-ai-generate]");n==null||n.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let s=this.modal.querySelector("[data-modal-apply]");s==null||s.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",r=>{r.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let t=window.__openAiEditor;if(typeof t!="function"){alert("AI Editor not available. Please check your setup.");return}let n="";e==="edit"&&this.currentAsset?n=`Edit this image: ${this.currentObjectId}`:n=`Create an image for: ${this.currentObjectId}`,t(this.currentObjectId||"unknown",n,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var ur={};fn(ur,{AssetCache:()=>re,AssetLoader:()=>Pe,AssetSystem:()=>li,AssetTextures:()=>Ie,Assets:()=>Ha,BaseSystem:()=>rt,GameEngine:()=>oi,GameObject:()=>Ot,GameObjectManager:()=>at,ObjectFactory:()=>ye,Renderer:()=>_t,RuntimeObjectRegistry:()=>ot,Transform:()=>jt,applyScreenAnchor:()=>Ft,basePixi:()=>za,clearResponsiveElements:()=>ia,createPixiBase:()=>si,getRegisteredFontIds:()=>ja,globalResponsiveMultipliers:()=>St,initAssetTextures:()=>Zt,initAssets:()=>Fa,layout:()=>aa,playLottieOverlay:()=>Oa,registerFont:()=>Ma,registerType:()=>Xt,resolveAnchorVec2:()=>Te,resolveFont:()=>Pa,resolveFontWeight:()=>Ia,resolveScreenAnchorPoint:()=>De,resolveScreenRatioPoint:()=>Ne,runInitSequence:()=>Ba,setLottieInstance:()=>Qt,spawnSceneFromConfig:()=>Da,updateScreenState:()=>Ht});module.exports=Ya(ur);var ka=require("pixi.js");var Le={};function zt(i,e,t=!1){Le[i]||(Le[i]=[]),Le[i].push({fn:e,once:t})}function di(i,e){if(Le[i]){if(!e){delete Le[i];return}Le[i]=Le[i].filter(t=>t.fn!==e)}}function $t(i,...e){let t=Le[i];if(t)for(let n of[...t])n.fn(...e),n.once&&di(i,n.fn)}function ee(i,e){zt(i,e,!0)}var $=null,ae=[],We=null;function wn(i){$=i,ae=[],We!==null&&(clearTimeout(We),We=null)}function xn(){var i,e,t;return{endpoint:($==null?void 0:$.endpoint)||"",transport:($==null?void 0:$.transport)||"beacon",batchSize:(i=$==null?void 0:$.batchSize)!=null?i:10,flushIntervalMs:(e=$==null?void 0:$.flushIntervalMs)!=null?e:300,maxQueue:(t=$==null?void 0:$.maxQueue)!=null?t:200,debug:!!($!=null&&$.debug)}}async function yn(i,e,t,n){let a=JSON.stringify(e);if(t==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let s=navigator.sendBeacon(i,new Blob([a],{type:"application/json"}));n&&console.log("[handler.telemetry] beacon",s,e);return}catch(s){n&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",s)}try{await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),n&&console.log("[handler.telemetry] fetch",e)}catch(s){n&&console.warn("[handler.telemetry] fetch failed",s)}}function pi(i,e){let t=xn();if(e&&t.endpoint){if(ae.push(i),ae.length>t.maxQueue&&(ae=ae.slice(ae.length-t.maxQueue)),ae.length>=t.batchSize){vn();return}We===null&&(We=window.setTimeout(()=>{We=null,vn()},t.flushIntervalMs))}}async function vn(){let i=xn();if(!i.endpoint||ae.length===0)return;let e=ae.splice(0,i.batchSize);await yn(i.endpoint,{events:e},i.transport,i.debug),ae.length>0&&await yn(i.endpoint,{events:ae.splice(0,i.batchSize)},i.transport,i.debug)}function Sn(i){return Math.max(0,Math.min(1,i))}function Ka(i){let e=String(i!=null?i:"power2.out");if(e==="linear")return t=>t;if(e==="sine.inOut")return t=>.5-Math.cos(Math.PI*t)/2;if(e==="power2.out"||e==="easeOutQuad")return t=>1-(1-t)*(1-t);if(e.startsWith("back.out")){let t=e.match(/back\.out\(([\d.]+)\)/),n=t?Number(t[1]):1.8;return a=>1+(n+1)*Math.pow(a-1,3)+n*Math.pow(a-1,2)}return t=>1-(1-t)*(1-t)}function wt(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Xa(i,e){let t=i==null?void 0:i[e];return typeof t=="number"?t:0}function En(i,e,t){try{i[e]=t}catch{}}function Ja(i){let e=i==null?void 0:i.scale;if(!e)return null;let t=typeof e.x=="number"?e.x:1,n=typeof e.y=="number"?e.y:1;return{x:t,y:n}}function Cn(i,e){let t=i==null?void 0:i.scale;if(t)try{typeof t.set=="function"?t.set(e.x,e.y):(typeof t.x=="number"&&(t.x=e.x),typeof t.y=="number"&&(t.y=e.y))}catch{}}function An(i,e){let t=Ja(i);if(!t)return{from:null,to:null};let n=null,a=null;return typeof e.scale=="number"?(n=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(n=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(n=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),n===null&&a===null?{from:null,to:null}:{from:{x:t.x,y:t.y},to:{x:n!=null?n:t.x,y:a!=null?a:t.y}}}function Ln(){let i=new Set,e=new WeakMap,t=null,n=()=>{if(t!=null)return;t=requestAnimationFrame(()=>{t=null,o(),i.size>0&&n()})},a=u=>{var p;i.add(u);let d=(p=e.get(u.target))!=null?p:new Set;d.add(u),e.set(u.target,d),n()},s=u=>{i.delete(u);let d=e.get(u.target);d&&(d.delete(u),d.size===0&&e.delete(u.target))},r=u=>{u.killed||(u.killed=!0,s(u))},o=()=>{var d,p;let u=wt();for(let g of Array.from(i)){if(g.killed||g.paused)continue;let f=u-g.startMs-g.delayMs;if(f<0)continue;let m=g.durationMs>0?f/g.durationMs:1,C=Sn(m),b=g.repeat>=0?g.repeat+1:1,h=g.repeat>0?Math.min(Math.floor(m),b-1):0;if(g.repeat>0&&m>=1){let x=m-h;C=Sn(x)}let y=g.ease(C);g.yoyo&&h%2===1&&(y=1-y);for(let x of g.props)En(g.target,x.key,x.from+(x.to-x.from)*y);g.scaleFrom&&g.scaleTo&&Cn(g.target,{x:g.scaleFrom.x+(g.scaleTo.x-g.scaleFrom.x)*y,y:g.scaleFrom.y+(g.scaleTo.y-g.scaleFrom.y)*y});try{(d=g.onUpdate)==null||d.call(g)}catch{}if(m>=b){r(g);try{(p=g.onComplete)==null||p.call(g)}catch{}}}},c=(u,d,p)=>{var x;let g=Math.max(0,(typeof d.duration=="number"?d.duration:.5)*1e3),f=Math.max(0,(typeof d.delay=="number"?d.delay:0)*1e3+((x=p==null?void 0:p.delayMsOverride)!=null?x:0)),m=Ka(d.ease),C=typeof d.repeat=="number"?Math.max(0,d.repeat|0):0,b=d.yoyo===!0,h=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),y=[];for(let P of Object.keys(d)){if(h.has(P))continue;let L=d[P];typeof L=="number"&&y.push({key:P,from:Xa(u,P),to:L})}let w=An(u,d);return{target:u,startMs:wt(),delayMs:f,durationMs:g,ease:m,props:y,scaleFrom:w.from,scaleTo:w.to,repeat:C,yoyo:b,onUpdate:typeof d.onUpdate=="function"?d.onUpdate:void 0,onComplete:typeof d.onComplete=="function"?d.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},l={to(u,d){let p=c(u,d);return a(p),{kill:()=>r(p),pause:()=>{p.paused||(p.paused=!0,p.pauseAtMs=wt())},resume:()=>{var m;if(!p.paused)return;let g=(m=p.pauseAtMs)!=null?m:wt(),f=wt()-g;p.startMs+=f,p.paused=!1,p.pauseAtMs=null},isActive:()=>!p.killed&&!p.paused}},fromTo(u,d,p){return l.set(u,d),l.to(u,p)},set(u,d){if(!u||!d)return;for(let g of Object.keys(d)){let f=d[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof f=="number"&&En(u,g,f)}let p=An(u,d);p.to&&Cn(u,p.to)},killTweensOf(u){let d=e.get(u);if(d)for(let p of Array.from(d))r(p)},timeline(u={}){let d=[],p=0,g=!1,f=[],m=h=>{if(typeof h=="number")return Math.max(0,h*1e3);let y=typeof h=="string"?h.trim():"";return y.startsWith("+=")?p+Math.max(0,Number(y.slice(2))*1e3||0):y?Math.max(0,Number(y)*1e3||0):p},C=h=>{d.push(h);let y=Math.max(0,(typeof h.vars.duration=="number"?h.vars.duration:.5)*1e3);p=Math.max(p,h.atMs+y)},b={to(h,y,w){return C({kind:"to",target:h,vars:y,atMs:m(w)}),b},fromTo(h,y,w,x){return C({kind:"fromTo",target:h,vars:w,from:y,atMs:m(x)}),b},play(){var h,y;if(g)return b;g=!0,f=[];for(let w of d)w.kind==="fromTo"&&l.set(w.target,(h=w.from)!=null?h:{}),f.push(l.to(w.target,{...w.vars,delay:w.atMs/1e3+((y=w.vars.delay)!=null?y:0)}));return b},pause(){for(let h of f)h.pause();return b},kill(){for(let h of f)h.kill();f=[],g=!1}};return u.paused||b.play(),b}};return l}function Tn(){if(typeof window=="undefined")return;let i=window;if(!i.gsap)try{i.gsap=Ln()}catch{}}var kn={name:"handler-playable-sdk",version:"1.0.77",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && mkdir -p dist/cli/student-helper && cp src/cli/student-helper/*.mjs dist/cli/student-helper/ && chmod +x dist/cli/*.mjs dist/cli/student-helper/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs dist/cli/student-helper/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var te=0,Qa=te++,Pn=te++,In=te++,Mn=te++,jn=te++,_n=te++,On=te++,Rn=te++,zn=te++,$n=te++,Dn=te++,Nn=te++,j=Qa;function Hn(){return j===Pn}function Fn(){return j===In}function Bn(){return j===Mn}function Gn(){return j===jn}function Ye(){return j===_n}function Ke(){return j===On}function Un(){return j===Rn}function qn(){return j===zn}function Vn(){return j===$n}function ui(){return j===Dn}function gi(){return j===Nn}function Wn(){let i=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(i==="mraid")try{mraid.getState(),j=Pn;return}catch{}else if(i==="dapi")try{dapi.isReady(),j=In;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(j=Mn)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(j=jn)}catch{}else if(e==="mintegral")window.gameReady&&(j=_n);else if(e==="tapjoy")window.TJ_API&&(j=On);else if(e==="tiktok")window.openAppStore&&(j=Rn);else if(e==="smadex")try{window.smxTracking&&(j=zn)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(j=$n)}catch{}else e==="vungle"?j=Dn:(i==="nucleo"||e==="nucleo")&&(j=Nn)}var Dt=ci(require("lottie-web"),1),Yn=Dt.default;typeof window!="undefined"&&(window.lottie=Dt.default,window.__baseLottie=Dt.default);fi();function D(i,e){let t=(a,s)=>s===0?a:t(s,a%s),n=t(i,e);return`${i/n}:${e/n}`}var qr=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:D(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:D(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:D(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:D(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:D(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:D(360,780)}],Vr=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:D(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:D(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:D(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:D(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:D(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:D(412,915)}],Wr=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:D(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:D(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:D(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:D(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:D(800,1280)}],Zn=[{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:D(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:D(768,1024),mraidScale:.7}];var Yr=[...Zn];var os=Zn[0];ce();var ta=require("pixi.js"),me={width:400,height:600,designWidth:400,scaleFactor:1},St={scale:1,position:1},Bt=[];function ls(i,e,t,n,a,s,r){Bt.push({element:i,originalScale:s,positionHelper:e,heightPercent:a}),e(i,t,n,a,s,r,!1)}function cs(){Bt.forEach(({element:i,originalScale:e,positionHelper:t,heightPercent:n})=>{let a=e*me.scaleFactor;t(i,me.width,me.height,n,a,!0,!1)})}function ia(){Bt.length=0,console.log("[LAYOUT] Cleared all responsive elements")}function Ht(i,e){console.log(`[SCREEN] updateScreenState called: ${i}x${e}`),me.width=i,me.height=e,me.scaleFactor=Math.min(i/me.designWidth,1.15),St.scale=me.scaleFactor,St.position=1,console.log(`[SCREEN] Global multipliers - scale: ${St.scale.toFixed(3)}`),cs()}var _={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}};function ds(i,e,t){let n=_[i];n&&n[e]!==void 0&&(n[e]=t,console.log(`Updated ${i}.${e} = ${t}`))}function ps(){return _}var us={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 Nt(i,e){return typeof i=="number"&&Number.isFinite(i)?i:e}function Te(i,e={x:.5,y:.5}){var t;if(Array.isArray(i))return{x:Nt(i[0],e.x),y:Nt(i[1],e.y)};if(i&&typeof i=="object"){let n=i;return{x:Nt(n.x,e.x),y:Nt(n.y,e.y)}}if(typeof i=="string"){let n=i.trim().toLowerCase();return(t=us[n])!=null?t:e}return e}function De(i,e,t,n={}){var g,f,m,C,b,h;let a=Te(t),s=(g=n.inset)!=null?g:{},r=(f=n.padding)!=null?f:{x:0,y:0},o=((m=s.left)!=null?m:0)+r.x,c=((C=s.right)!=null?C:0)+r.x,l=((b=s.top)!=null?b:0)+r.y,u=((h=s.bottom)!=null?h:0)+r.y,d=Math.max(0,i-o-c),p=Math.max(0,e-l-u);return{x:o+d*a.x,y:l+p*a.y}}function Ne(i,e,t,n={}){var m,C,b,h,y,w;let a=(m=n.inset)!=null?m:{},s=(C=n.padding)!=null?C:{x:0,y:0},r=((b=a.left)!=null?b:0)+s.x,o=((h=a.right)!=null?h:0)+s.x,c=((y=a.top)!=null?y:0)+s.y,l=((w=a.bottom)!=null?w:0)+s.y,u=Math.max(0,i-r-o),d=Math.max(0,e-c-l),p=Te(t,{x:.5,y:.5}),g=Math.min(Math.max(p.x,0),1),f=Math.min(Math.max(p.y,0),1);return{x:r+u*g,y:c+d*f}}function Ft(i,e,t,n={}){var u,d,p;if(!i)return;let a=n.positionRatio?Ne(e,t,n.positionRatio,{inset:n.inset,padding:n.screenPadding}):De(e,t,n.anchor,{inset:n.inset,padding:n.screenPadding}),s=(u=n.offset)!=null?u:{x:0,y:0},r=a.x+s.x,o=a.y+s.y;i.anchor&&n.renderAnchor&&i.anchor.set(n.renderAnchor.x,n.renderAnchor.y),se(i,r,o);let c=(d=n.scale)!=null?d:1,l=(p=n.scaleMultiplier)!=null?p:1;(n.scale!==void 0||n.scaleMultiplier!==void 0)&&de(i,c*l)}if(typeof window!="undefined"){let i=window.innerWidth,e=window.innerHeight,t=()=>{let n=window.innerWidth,a=window.innerHeight;(n!==i||a!==e)&&(i=n,e=a,Ht(n,a))};window.addEventListener("resize",t),window.addEventListener("orientationchange",()=>{setTimeout(t,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",t),window.mraid.addEventListener("sizeChange",t)),Ht(window.innerWidth,window.innerHeight),window.updateDebugConfig=ds,window.getDebugConfig=ps,window.copyConfig=Es,window.applyConfig=xt,window.applyConfigForRatio=Cs,window.positionAtBottom=na,window.positionAtTop=ms,window.positionAtCenter=fs,window.positionAtLeft=bs,window.positionAtRight=ys,window.positionAtBottomLeft=vs,window.positionAtBottomRight=ws,window.positionAtTopLeft=xs,window.positionAtTopRight=Ss,window.applyPositionContract=hs,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 Gt(i,e,t=0){return i*e+t}function Ut(i,e,t=0){return i*(1-e)+t}function qt(i,e,t=0){return i*e+t}function Vt(i,e,t=0){return i*(1-e)+t}function ie(i,e=0){return i/2+e}function gs(i,e){return i*e}function hs(i,e,t,n){var r,o,c,l,u,d,p,g,f,m,C,b,h,y,w,x,P,L,B,R;let a=0,s=0;switch(n.type){case"top":a=ie(e,(o=(r=n.offset)==null?void 0:r.x)!=null?o:0),s=Gt(t,n.percent,(l=(c=n.offset)==null?void 0:c.y)!=null?l:0);break;case"bottom":a=ie(e,(d=(u=n.offset)==null?void 0:u.x)!=null?d:0),s=Ut(t,n.percent,(g=(p=n.offset)==null?void 0:p.y)!=null?g:0);break;case"left":a=qt(e,n.percent,(m=(f=n.offset)==null?void 0:f.x)!=null?m:0),s=ie(t,(b=(C=n.offset)==null?void 0:C.y)!=null?b:0);break;case"right":a=Vt(e,n.percent,(y=(h=n.offset)==null?void 0:h.x)!=null?y:0),s=ie(t,(x=(w=n.offset)==null?void 0:w.y)!=null?x:0);break;case"center":a=ie(e,(L=(P=n.offset)==null?void 0:P.x)!=null?L:0),s=ie(t,(R=(B=n.offset)==null?void 0:B.y)!=null?R:0);break}i.position?i.position.set(a,s):(i.x=a,i.y=s),n.scale!==void 0&&n.scale!==1&&i.scale&&(typeof i.scale.set=="function"?i.scale.set(n.scale,n.scale):(i.scale.x=n.scale,i.scale.y=n.scale))}function na(i,e,t,n=.2,a=1,s=!0,r=!1){let o=gs(t,n),c=Ut(t,n/2);se(i,ie(e),c);let l=s?a*me.scaleFactor:a;de(i,l),r&&!Bt.find(u=>u.element===i)&&ls(i,na,e,t,n,a,s)}function ms(i,e,t,n=.1,a=1){se(i,ie(e),Gt(t,n)),de(i,a)}function fs(i,e,t,n=0,a=0,s=1){se(i,ie(e,n),ie(t,a)),de(i,s)}function bs(i,e,t,n=.1,a=1){se(i,qt(e,n),ie(t)),de(i,a)}function ys(i,e,t,n=.1,a=1){se(i,Vt(e,n),ie(t)),de(i,a)}function vs(i,e,t,n=.05,a=.05,s=1){se(i,qt(e,a),Ut(t,n)),de(i,s)}function ws(i,e,t,n=.05,a=.05,s=1){se(i,Vt(e,a),Ut(t,n)),de(i,s)}function xs(i,e,t,n=.05,a=.05,s=1){se(i,qt(e,a),Gt(t,n)),de(i,s)}function Ss(i,e,t,n=.05,a=.05,s=1){se(i,Vt(e,a),Gt(t,n)),de(i,s)}function se(i,e,t){i&&i.position?typeof i.position.set=="function"?i.position.set(e,t):(i.position.x=e,i.position.y=t):i&&(i.x=e,i.y=t)}function de(i,e){e!==1&&i&&i.scale&&(typeof i.scale.set=="function"?i.scale.set(e,e):i.scale.x!==void 0&&i.scale.y!==void 0&&(i.scale.x=e,i.scale.y=e))}var $e={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}},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}},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}},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}}};function Es(i){return i&&$e[i]?JSON.parse(JSON.stringify($e[i])):JSON.parse(JSON.stringify(_))}function xt(i){Object.keys(i).forEach(e=>{let t=e;_[t]&&i[t]&&Object.assign(_[t],i[t])}),console.log("Config applied:",i)}function Cs(i,e){let t=i/e;t>1.6?(xt($e.wide),console.log("Applied WIDE config for ratio:",t)):t<.7?(xt($e.tall),console.log("Applied TALL config for ratio:",t)):t>.8&&t<1.2?(xt($e.square),console.log("Applied SQUARE config for ratio:",t)):(xt($e.default),console.log("Applied DEFAULT config for ratio:",t))}if(typeof window!="undefined"){let i=window;i.configPresets=$e,i.resolveAnchorVec2=i.resolveAnchorVec2||Te,i.resolveScreenAnchorPoint=i.resolveScreenAnchorPoint||De,i.resolveScreenRatioPoint=i.resolveScreenRatioPoint||Ne}var K=null,ea=new Map;function aa(i,e,t,n,a,s={}){var Se,Ee,Ce,Ae,W,_e,lt,ct,dt,pt,ut,gt,ht,mt,ft,bt,F,Z,U,Q,Ue,Oe,Bi,Gi,Ui,qi,Vi,Wi,Yi,Ki,Xi,Ji,Zi,Qi,en,tn,nn,an,sn,rn,on,ln,cn,dn,pn,un,gn,hn,mn;let r=(Se=s.enableDebugLogs)!=null?Se:!1;r&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] ===== STARTING LAYOUT CALCULATION ====="),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Screen dimensions:",{width:n.width,height:n.height}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Time:",t),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Options:",s));let{mainContainer:o,label:c,background:l,backgroundTexture:u,app:d}=i;if(!d||!d.renderer){r&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] \u274C No app or renderer, skipping layout");return}r&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] App renderer dimensions:",{width:d.renderer.width,height:d.renderer.height}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] App screen dimensions:",{width:d.screen.width,height:d.screen.height}));let p=n.width,g=n.height;r&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Base dimensions:",{baseWidth:p,baseHeight:g});let f=p*_.layout.screen_scale_x,m=g*_.layout.screen_scale_y,C=p/2,b=e.engine.runtime||{},h=b.layout||{};r&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] Debug config:",{screen_scale_x:_.layout.screen_scale_x,screen_scale_y:_.layout.screen_scale_y}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Calculated dimensions:",{width:f,height:m,midX:C}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Engine runtime:",b),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Layout config:",h));let y=m>f,w=(Ee=h.design_width_portrait)!=null?Ee:y?400:600,x=(Ce=h.design_height_portrait)!=null?Ce:y?600:400,P=Math.min(f/w,m/x);P=Math.min(P,1.15);let L=P*((Ae=_.engine.scale)!=null?Ae:1),B=(W=s.skipMainContainerTransform)!=null?W:!1;!B&&o&&o.scale&&(typeof o.scale.set=="function"?o.scale.set(L):(o.scale.x=L,o.scale.y=L));let R=(_e=h.main_container_anchor)!=null?_e:"center",H=(lt=h.main_container_position_ratio)!=null?lt:{x:.5,y:.5},z=(ct=h.main_container_offset)!=null?ct:{x:0,y:0},T=h.main_container_position_ratio?Ne(p,g,H):De(p,g,R),E=T.x+z.x+_.layout.position_offset.x,S=T.y+z.y+_.layout.position_offset.y;if(!B&&o&&o.position&&(typeof o.position.set=="function"?o.position.set(E,S):(o.position.x=E,o.position.y=S)),a&&(o!=null&&o.toLocal)){let G=g>p,Y=(dt=h.design_width_portrait)!=null?dt:G?320:480,N=(pt=h.design_height_portrait)!=null?pt:G?480:320;for(let[oe,le]of e.objects.entries()){let q=le==null?void 0:le.transform;if(!q||((ut=q.position_mode)!=null?ut:"static")!=="static")continue;let k=(gt=a.get)==null?void 0:gt.call(a,oe),yt=((ht=k==null?void 0:k.getDisplayObject)==null?void 0:ht.call(k))||(k==null?void 0:k.pixiObject)||k;if(!yt||yt.parent!==o)continue;let ge=(mt=q.anchor)!=null?mt:"bottom-left";ge==="bottom-left"&&q.anchor==null&&console.log("[DEBUG FALLBACK] LayoutManager transform.anchor \u2192 bottom-left");let qe=q.position_ratio!=null?Ne(Y,N,q.position_ratio):De(Y,N,ge),Ve=(ft=q.position)!=null?ft:{x:0,y:0},vt=qe.x-Y/2+Ve.x,Re=qe.y-N/2+Ve.y;typeof(k==null?void 0:k.setPosition)=="function"?k.setPosition(vt,Re):(se(yt,vt,Re),(bt=k==null?void 0:k.transform)!=null&&bt.position&&(k.transform.position.x=vt,k.transform.position.y=Re))}}let A=typeof window!="undefined"?window.__BUILD_SETTINGS__:null,J=((A==null?void 0:A.buildMode)||(typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"dev"))==="dev";if(_.layout.debug_rect_visible&&J){(!K||K.parent!==d.stage)&&(K==null||K.destroy(),K=new ta.Graphics,K.zIndex=9999,d.stage.addChild(K)),K.clear();let G=_.layout.debug_rect_scale_x,Y=_.layout.debug_rect_scale_y,N=(p-4)*G,oe=(g-4)*Y,le=(p-N)/2,q=(g-oe)/2;r&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] ===== DEBUG RECT POSITIONING ====="),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Debug rect calculations:",{baseWidth:p,baseHeight:g,rectW:N,rectH:oe,offsetX:le,offsetY:q}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Debug rect final position:",{x:2+le,y:2+q,width:N,height:oe})),K.rect(2+le,2+q,N,oe).stroke({width:_.layout.debug_rect_thickness,color:_.layout.debug_rect_color})}else K&&(K.destroy(),K=null);let O=((F=i.label)==null?void 0:F.config)||e.objects.get("label_1")||e.objects.get("ui_tutorial_1");if(c&&c.position&&O){let G=(U=(Z=O==null?void 0:O.transform)==null?void 0:Z.anchor)!=null?U:"center",Y=(Q=O==null?void 0:O.transform)==null?void 0:Q.position_ratio,N=((Ue=O==null?void 0:O.transform)==null?void 0:Ue.offset)||{x:0,y:0};Ft(c,p,g,{anchor:G,positionRatio:Y,offset:{x:N.x*L,y:N.y*L},renderAnchor:Te(G)})}if(c&&c.alpha>0){let G=1+Math.sin(t*_.engine.label_pulse_speed)*_.engine.label_pulse_intensity,Y=(Bi=(Oe=O==null?void 0:O.transform)==null?void 0:Oe.scale)!=null?Bi:1,N=G*L*Y;c.scale&&(typeof c.scale.set=="function"?c.scale.set(N):(c.scale.x=N,c.scale.y=N))}r&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] ===== BACKGROUND POSITIONING =====");let ne=l?e.objects.get("background_1"):null,je=!!ne&&(l==null?void 0:l.parent)===o;if(l&&!je){r&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background object exists:",!!l),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background type:",(Gi=l.constructor)==null?void 0:Gi.name)),l.alpha=((qi=(Ui=b.background)==null?void 0:Ui.alpha)!=null?qi:.98)*_.engine.background_alpha,r&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background alpha set to:",l.alpha),r&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background config:",ne);let G=(ne==null?void 0:ne.transform)||{};r&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background transform:",G);let Y=G.offset||{x:0,y:0},N=((Wi=(Vi=b.background)==null?void 0:Vi.offset_y)!=null?Wi:0)+_.engine.background_offset_y,oe=(Yi=G.anchor)!=null?Yi:"center",le=G.position_ratio;if(r&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background positioning params:",{bgOffset:Y,bgRuntimeOffsetY:N,bgScreenAnchor:oe,bgPositionRatio:le,baseWidth:p,baseHeight:g,finalScale:L}),Ft(l,p,g,{anchor:oe,positionRatio:le,offset:{x:Y.x*L,y:Y.y*L+N},renderAnchor:Te(oe)}),r&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background position after applyScreenAnchor:",{x:l.x,y:l.y,scaleX:(Ki=l.scale)==null?void 0:Ki.x,scaleY:(Xi=l.scale)==null?void 0:Xi.y,anchorX:(Ji=l.anchor)==null?void 0:Ji.x,anchorY:(Zi=l.anchor)==null?void 0:Zi.y,pivotX:(Qi=l.pivot)==null?void 0:Qi.x,pivotY:(en=l.pivot)==null?void 0:en.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 qe=Math.max(f/u.width,m/u.height),Ve=(nn=(tn=b.background)==null?void 0:tn.scale_multiplier)!=null?nn:1.05,vt=(an=G.scale)!=null?an:1,Re=qe*Ve*_.engine.background_scale*vt;l.scale&&(typeof l.scale.set=="function"?l.scale.set(Re):(l.scale.x=Re,l.scale.y=Re))}else l&&typeof l.clear=="function"&&(l.clear(),l.rect(-f/2,-m/2,f,m).fill({color:1444375}));let q=`${p}x${g}`,I=ea.get(q),k={x:Number((sn=l.x)!=null?sn:0),y:Number((rn=l.y)!=null?rn:0),scaleX:Number((ln=(on=l.scale)==null?void 0:on.x)!=null?ln:1),scaleY:Number((dn=(cn=l.scale)==null?void 0:cn.y)!=null?dn:1),rotation:Number.isFinite(l.rotation)?l.rotation:void 0,anchorX:Number.isFinite((pn=l.anchor)==null?void 0:pn.x)?l.anchor.x:void 0,anchorY:Number.isFinite((un=l.anchor)==null?void 0:un.y)?l.anchor.y:void 0,pivotX:Number.isFinite((gn=l.pivot)==null?void 0:gn.x)?l.pivot.x:void 0,pivotY:Number.isFinite((hn=l.pivot)==null?void 0:hn.y)?l.pivot.y:void 0},yt=Number.isFinite(k.x)&&Number.isFinite(k.y)&&Number.isFinite(k.scaleX)&&Number.isFinite(k.scaleY),ge=k;if(I){let qe=Math.hypot(k.x-I.x,k.y-I.y),Ve=Math.max(p,g)*.5;(!yt||qe>Ve)&&((mn=l.position)!=null&&mn.set?l.position.set(I.x,I.y):(l.x=I.x,l.y=I.y),l.scale&&(typeof l.scale.set=="function"?l.scale.set(I.scaleX,I.scaleY):(l.scale.x=I.scaleX,l.scale.y=I.scaleY)),Number.isFinite(I.rotation)&&typeof l.rotation=="number"&&(l.rotation=I.rotation),l.anchor&&Number.isFinite(I.anchorX)&&Number.isFinite(I.anchorY)&&l.anchor.set(I.anchorX,I.anchorY),l.pivot&&Number.isFinite(I.pivotX)&&Number.isFinite(I.pivotY)&&l.pivot.set(I.pivotX,I.pivotY),ge=I)}Number.isFinite(ge.x)&&Number.isFinite(ge.y)&&Number.isFinite(ge.scaleX)&&Number.isFinite(ge.scaleY)&&ea.set(q,ge)}}function As(i){return new Promise((e,t)=>{let n=new FileReader;n.onerror=()=>t(new Error("FileReader failed")),n.onload=()=>e(String(n.result||"")),n.readAsDataURL(i)})}function Ls(i){var a;let[e,t]=i.split(","),n=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:t!=null?t:"",mimeType:(a=n==null?void 0:n[1])!=null?a:"image/png"}}async function Ts(i){return await new Promise(e=>{let t=new Image;t.onload=()=>e({width:t.naturalWidth||t.width,height:t.naturalHeight||t.height}),t.onerror=()=>e(null),t.src=i})}async function yi(i){var e,t;try{console.log("[ImageUtils] Fetching image data from URL:",i);let n=await fetch(i);if(!n.ok)return console.warn("[ImageUtils] Fetch failed with status:",n.status,i),null;let a=await n.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let s=await As(a),r=await Ts(s),o=Ls(s);return console.log("[ImageUtils] Success resolution:",r==null?void 0:r.width,"x",r==null?void 0:r.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:s,width:(e=r==null?void 0:r.width)!=null?e:0,height:(t=r==null?void 0:r.height)!=null?t:0}}catch(n){return console.error("[ImageUtils] Error fetching image data:",n),null}}async function Wt(i,e=30){try{console.log("[ImageUtils] Removing background color...");let t=await new Promise((d,p)=>{let g=new Image;g.onload=()=>d(g),g.onerror=()=>p(new Error("Failed to load image")),g.src=i}),n=document.createElement("canvas");n.width=t.width,n.height=t.height;let a=n.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),i;a.drawImage(t,0,0);let s=a.getImageData(0,0,n.width,n.height),r=s.data,c=[{name:"top-left",offset:0},{name:"top-right",offset:(n.width-1)*4},{name:"bottom-left",offset:(n.height-1)*n.width*4},{name:"bottom-right",offset:((n.height-1)*n.width+(n.width-1))*4}].map(d=>({r:r[d.offset],g:r[d.offset+1],b:r[d.offset+2]})),l=0;for(let d=0;d<r.length;d+=4){let p=r[d],g=r[d+1],f=r[d+2],m=!1;for(let C of c)if(Math.sqrt(Math.pow(p-C.r,2)+Math.pow(g-C.g,2)+Math.pow(f-C.b,2))<e){m=!0;break}m&&(r[d+3]=0,l++)}return console.log(`[ImageUtils] Removed background from ${l} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(s,0,0),n.toDataURL("image/png")}catch(t){return console.error("[ImageUtils] Error removing background:",t),i}}var sa=require("@google/genai");async function vi(i,e,t=[],n={}){var a,s,r,o,c,l,u;try{if(!(i!=null&&i.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let b=0;b<t.length;b++){let h=t[b];if(!h.base64||!h.mimeType)throw new Error(`Image ${b+1} is missing required data`);if(h.base64.length<1e3&&console.warn(`Image ${b+1} data appears very small, may be corrupted`),!h.mimeType.startsWith("image/"))throw new Error(`Image ${b+1} has invalid MIME type: ${h.mimeType}`)}let d=new sa.GoogleGenAI({apiKey:i}),p="gemini-2.5-flash",g=[e];t.length>0&&t.forEach((b,h)=>{g.push({inlineData:{data:b.base64,mimeType:b.mimeType}}),console.log(`[Gemini] Added image ${h+1}: ${b.mimeType}, size: ${Math.round(b.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${t.length} images and prompt length: ${e.length}`);let f=await d.models.generateContent({model:p,contents:g}),m="",C=(r=(s=(a=f.candidates)==null?void 0:a[0])==null?void 0:s.content)==null?void 0:r.parts;if(C)for(let b of C)b.text&&(m+=b.text);if(!m.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${m.length}`),m}catch(d){throw console.error("[Gemini] API error:",d),(o=d.message)!=null&&o.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(c=d.message)!=null&&c.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(l=d.message)!=null&&l.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(u=d.message)!=null&&u.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):d}}var ra=require("@google/genai");async function Yt(i,e,t=[],n={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new ra.GoogleGenAI({apiKey:i}),s=[{text:e}];t.length>0&&t.forEach((o,c)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${c}`),s.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let r=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:s});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!r.candidates||!r.candidates[0]||!r.candidates[0].content||!r.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of r.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let c=o.inlineData.data,l=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${l};base64,${c}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(a){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(a,Object.getOwnPropertyNames(a),2)),a}}var _s=require("pixi.js");Et();Kt();ce();var ua=require("pixi.js");var Rs=require("pixi.js");ce();function qs(i){return new Promise((e,t)=>{let n=new FileReader;n.onerror=()=>t(new Error("FileReader failed")),n.onload=()=>e(String(n.result||"")),n.readAsDataURL(i)})}function Vs(i){var a;let[e,t]=i.split(","),n=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:t!=null?t:"",mimeType:(a=n==null?void 0:n[1])!=null?a:"image/png"}}function Ws(i){return`
47
47
  Analyze these screenshots of a brand or game and extract its "Brand DNA".
48
48
 
49
49
  Provide a concise summary (2-3 sentences) covering:
@@ -1 +1 @@
1
- (function(_0x3532ad,_0x498a01){var a0_0x30ba85={_0x4d6531:0x8f,_0x2b8d14:0x84,_0x329107:'hify',_0x1daa35:0x7a,_0x54ac2e:0x26a,_0x526c7d:']05b',_0x44ddd0:0x271,_0x3dc1c0:0x273,_0x11f54a:'3hk#',_0x38187b:0x7d,_0x132095:0x75,_0x491021:'KMVA',_0x488c82:0x8b,_0x4969b5:0xa9,_0x2ab848:0xaf,_0xdec087:0xa9,_0x561bb4:0xa2,_0x2a35d4:0x91,_0x15bfa3:'^YUU',_0x14a399:0x9d,_0x5d14ad:0x77,_0x3277ef:0x78,_0x553035:0x86,_0x21a0be:0xa8,_0x37ab33:0xad,_0x45623a:'*n#M',_0x530b3c:0xb2,_0x33fba9:0xb8,_0x3d7001:0xab,_0x3a3c4a:'LTwR',_0x50534c:0x9d,_0x98133b:0x260,_0x20dedf:'feuE',_0x5f7f1c:0x268,_0x5e7d63:0x261,_0x14dc75:'[ky!',_0x32ad90:0x76,_0x2ab479:0x7d,_0x17a975:0x7b},a0_0x208eb8={_0xdd2fb3:0x16},a0_0x1bcecf={_0x5ab89c:0x9};function _0x3c5232(_0x285d57,_0x20e83d,_0x3c97a2,_0x588ddb,_0x560a64){return a0_0x17b7(_0x3c97a2-a0_0x1bcecf._0x5ab89c,_0x588ddb);}function _0x2cfca4(_0x31e1a2,_0x588e8a,_0x372936,_0x255206,_0x18f464){return a0_0x17b7(_0x255206-0x1d7,_0x588e8a);}var _0x1ed45d=_0x3532ad();function _0x205c64(_0x504e92,_0xa24184,_0xe2ca69,_0x44c461,_0x49871d){return a0_0x17b7(_0x49871d- -a0_0x208eb8._0xdd2fb3,_0x504e92);}while(!![]){try{var _0x16f4d2=-parseInt(_0x3c5232(a0_0x30ba85._0x4d6531,a0_0x30ba85._0x2b8d14,0x90,a0_0x30ba85._0x329107,0x85))/(0x11bf+-0x1b95+0x9d7)*(-parseInt(_0x205c64('TZQ6',0x87,0x75,0x81,a0_0x30ba85._0x1daa35))/(0x2*-0xeb9+0x851*0x3+0x481*0x1))+parseInt(_0x2cfca4(a0_0x30ba85._0x54ac2e,a0_0x30ba85._0x526c7d,0x27d,a0_0x30ba85._0x44ddd0,a0_0x30ba85._0x3dc1c0))/(-0x373*0x4+-0x66*-0xc+-0x907*-0x1)*(-parseInt(_0x205c64(a0_0x30ba85._0x11f54a,0x6b,a0_0x30ba85._0x38187b,0x71,a0_0x30ba85._0x132095))/(-0x184d+-0x798+0x1fe9))+-parseInt(_0x3c5232(0x82,0x89,0x92,a0_0x30ba85._0x491021,a0_0x30ba85._0x488c82))/(-0x47*0x3+0x44c*-0x3+0xdbe)*(parseInt(_0x3c5232(a0_0x30ba85._0x4969b5,a0_0x30ba85._0x2ab848,a0_0x30ba85._0xdec087,'dSre',a0_0x30ba85._0x561bb4))/(0x902+0x174c+-0x8*0x409))+-parseInt(_0x3c5232(0x8c,0x88,a0_0x30ba85._0x2a35d4,a0_0x30ba85._0x15bfa3,a0_0x30ba85._0x14a399))/(-0x36c+0x1194+-0xe21)+-parseInt(_0x205c64('3hk#',a0_0x30ba85._0x5d14ad,a0_0x30ba85._0x3277ef,0x7a,a0_0x30ba85._0x553035))/(-0x11*-0x29+0x1b7e+0x1e2f*-0x1)+parseInt(_0x3c5232(a0_0x30ba85._0x21a0be,a0_0x30ba85._0x37ab33,0xa2,a0_0x30ba85._0x45623a,a0_0x30ba85._0x530b3c))/(-0x11a7+0x1245*0x1+-0x95)*(parseInt(_0x3c5232(a0_0x30ba85._0x33fba9,0xac,a0_0x30ba85._0x3d7001,a0_0x30ba85._0x3a3c4a,a0_0x30ba85._0x50534c))/(0x485+-0x24cf+0x2054))+parseInt(_0x2cfca4(a0_0x30ba85._0x98133b,a0_0x30ba85._0x20dedf,a0_0x30ba85._0x5f7f1c,a0_0x30ba85._0x5e7d63,0x26b))/(-0x1e79+-0x1d30+0x2*0x1dda)*(parseInt(_0x205c64(a0_0x30ba85._0x14dc75,a0_0x30ba85._0x32ad90,a0_0x30ba85._0x2ab479,a0_0x30ba85._0x17a975,0x82))/(-0x18fb*-0x1+0x18ee+-0x31dd));if(_0x16f4d2===_0x498a01)break;else _0x1ed45d['push'](_0x1ed45d['shift']());}catch(_0x1cb558){_0x1ed45d['push'](_0x1ed45d['shift']());}}}(a0_0x4739,0x31*-0x46ba+-0x308f*-0xd+0x62641*0x3));function a0_0x4739(){var _0x1dc7fc=['u8odW7pdT8o2WQaye8kfWPRdOSknoG','W4FdGwBdTmk5W5rAdW','WQlcRSknWR3cIxLlx8kcW6qR','WQdcNHxcUtpcLmk9','lmoCjW','kSoajmoVW5SFW7qpWOhdGCk+lmoA','W4K/lmk9h8oxWOW','y8k8W5tdPSkHWOlcQmkoECodWOe','WRfnW5VcMSk7zGmMyCohWOjHua','lJ9ZWRy3WRNdKZCX','WQPqW4pcGCkO','cCkMWQxdN8oJW5ZcT2iaW4G','fSkbgCo+ua','qmkwW7RdS8oR','df1bjSoTkmoDkmkIB8knWRe3','WR7dHSkRWQ3dVq','WOfoW5ekymkkW7jcafyaWRa','W4JdGmkTW7xdISoUW6vBW4DSWO/cICos','dSoPze0lqhRdO8k3W6y','ymk8W5ddOmkHW5JdGmkvy8oYWQ9iqq','kSocjSoUW5uzW7azWRldLmkmdCo4','W7dcGqlcVay','WRNdHmkEqaq','ab14cSoTWOf1','DH7dVHZcQq','W6qIBmkeWO7cSGS','kZtdV8kxzSo+g2ZdH2ddJCke','W7/cGmoK','yCkYWPxcU8o9WOxcS8kq','W5nKFmoGDW','W6FdUCoQW7NdJG','WOKQnmk5pq'];a0_0x4739=function(){return _0x1dc7fc;};return a0_0x4739();}var a0_0x56342b=(function(){var _0x3cd321=!![];return function(_0x3d34b4,_0x5ef4b5){var _0x324cad=_0x3cd321?function(){if(_0x5ef4b5){var _0x1de984=_0x5ef4b5['apply'](_0x3d34b4,arguments);return _0x5ef4b5=null,_0x1de984;}}:function(){};return _0x3cd321=![],_0x324cad;};}()),a0_0x5cdd11=a0_0x56342b(this,function(){var a0_0x4b27ae={_0x33ed38:0x430,_0x4df419:0x426,_0xba01f5:'^L07',_0x35c3b1:0x43d,_0x37f76f:'N9#[',_0x4439b7:0x229,_0x360028:0x21f,_0x5562e0:0x222,_0x1d4342:'6^%g',_0x4b76f6:0x435,_0x3f62f2:0x433,_0x33f4dd:0x42f,_0x1f304a:0x42c,_0x45927c:'rViH',_0x107342:0x248,_0x33c97a:0x239,_0x314083:0x246,_0x167350:'A6H9',_0x13fe37:0x3b,_0x38cd97:0x4b,_0x3ca192:0x3f,_0x1c8968:0x42d,_0x1120ee:0x436,_0x5c3238:0x43c,_0x3a65ca:'*n#M',_0x29660d:0x235,_0x4e5686:0x223,_0x595754:0x22b,_0x203f53:'sZyr',_0x9e66e9:']05b',_0x38e33a:0x4c,_0x384029:0x42,_0x507dc6:0x444,_0x323133:0x444,_0x2dda94:0x446,_0x4007dc:0x437,_0x4bccbf:'CD[y',_0x15af78:0x22f,_0x117507:0x230,_0x426464:0x224,_0x695f79:'[$YX',_0x139fd7:0x23a,_0x5c0392:0x240,_0x5b70fb:0x23a,_0x532d02:0x435,_0x54b012:'[$YX'},a0_0x111151={_0x34b726:0x2c6},a0_0x4fbb1a={_0x337c13:0xce},_0x203b35={};_0x203b35[_0x2235a9(0x435,a0_0x4b27ae._0x33ed38,a0_0x4b27ae._0x4df419,0x43f,a0_0x4b27ae._0xba01f5)]=_0x2235a9(0x434,0x442,a0_0x4b27ae._0x35c3b1,0x44e,a0_0x4b27ae._0x37f76f)+')+)+)'+'+$';function _0x18a413(_0x1b9c57,_0x2cb866,_0x3e2d6e,_0x4d3c8f,_0x15e0a3){return a0_0x17b7(_0x15e0a3- -a0_0x4fbb1a._0x337c13,_0x1b9c57);}var _0x40ef39=_0x203b35;function _0x444449(_0x4d865a,_0xa6e5e2,_0x2a6519,_0x18841c,_0x1d299c){return a0_0x17b7(_0x2a6519- -a0_0x111151._0x34b726,_0x1d299c);}function _0x2235a9(_0x236b8d,_0x4fe01e,_0x49a90f,_0x51fd43,_0x2219ca){return a0_0x17b7(_0x4fe01e-0x3a1,_0x2219ca);}return a0_0x5cdd11[_0x444449(-a0_0x4b27ae._0x4439b7,-a0_0x4b27ae._0x360028,-a0_0x4b27ae._0x5562e0,-a0_0x4b27ae._0x5562e0,a0_0x4b27ae._0x1d4342)+_0x2235a9(a0_0x4b27ae._0x4b76f6,a0_0x4b27ae._0x3f62f2,a0_0x4b27ae._0x33f4dd,a0_0x4b27ae._0x1f304a,a0_0x4b27ae._0x45927c)]()[_0x444449(-a0_0x4b27ae._0x107342,-0x22b,-a0_0x4b27ae._0x33c97a,-a0_0x4b27ae._0x314083,a0_0x4b27ae._0x167350)+'h'](_0x40ef39[_0x18a413(a0_0x4b27ae._0xba01f5,-a0_0x4b27ae._0x13fe37,-0x49,-a0_0x4b27ae._0x38cd97,-a0_0x4b27ae._0x3ca192)])[_0x2235a9(a0_0x4b27ae._0x1c8968,a0_0x4b27ae._0x1120ee,a0_0x4b27ae._0x5c3238,0x442,a0_0x4b27ae._0x3a65ca)+_0x444449(-a0_0x4b27ae._0x29660d,-a0_0x4b27ae._0x4e5686,-a0_0x4b27ae._0x595754,-0x226,a0_0x4b27ae._0x203f53)]()[_0x18a413(a0_0x4b27ae._0x9e66e9,-a0_0x4b27ae._0x38e33a,-0x4e,-a0_0x4b27ae._0x384029,-a0_0x4b27ae._0x384029)+_0x2235a9(a0_0x4b27ae._0x507dc6,a0_0x4b27ae._0x323133,a0_0x4b27ae._0x2dda94,a0_0x4b27ae._0x4007dc,a0_0x4b27ae._0x4bccbf)+'r'](a0_0x5cdd11)[_0x444449(-0x232,-a0_0x4b27ae._0x15af78,-a0_0x4b27ae._0x117507,-a0_0x4b27ae._0x426464,a0_0x4b27ae._0x695f79)+'h'](_0x444449(-0x237,-a0_0x4b27ae._0x139fd7,-a0_0x4b27ae._0x5c0392,-a0_0x4b27ae._0x5b70fb,'rViH')+_0x2235a9(a0_0x4b27ae._0x3f62f2,a0_0x4b27ae._0x532d02,a0_0x4b27ae._0x5c3238,0x444,a0_0x4b27ae._0x54b012)+'+$');});a0_0x5cdd11();function a0_0x17b7(_0x19dd7e,_0x1175c7){_0x19dd7e=_0x19dd7e-(0xc57*-0x1+0x21*0x3f+0x4bd);var _0xbc07b8=a0_0x4739();var _0x4e235c=_0xbc07b8[_0x19dd7e];if(a0_0x17b7['uxRvsc']===undefined){var _0x48977a=function(_0x531c3c){var _0x1ed9bf='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x358642='',_0x3277d9='',_0x151b3c=_0x358642+_0x48977a;for(var _0x42863b=-0xfb5+-0xfef+0x1fa4,_0xec2465,_0x39902a,_0x11f37e=-0x5*0x135+0x2*0x50e+0x1*-0x413;_0x39902a=_0x531c3c['charAt'](_0x11f37e++);~_0x39902a&&(_0xec2465=_0x42863b%(0x160*0xc+0x1873+-0xda5*0x3)?_0xec2465*(0x1a11+-0x2539+0x28*0x49)+_0x39902a:_0x39902a,_0x42863b++%(-0x3*0x899+-0x212c+-0x1*-0x3afb))?_0x358642+=_0x151b3c['charCodeAt'](_0x11f37e+(0x1164+0xb78*0x1+0xd9*-0x22))-(0x427*-0x9+0x11*0x184+0xba5)!==0x586+0x11ec+-0x1772?String['fromCharCode'](-0x134+-0x2587+0x13dd*0x2&_0xec2465>>(-(0xbed+-0x1*0xc67+0x7c)*_0x42863b&0x739+0x257*0x2+0x1*-0xbe1)):_0x42863b:0x260c+0x47*-0xe+-0x222a){_0x39902a=_0x1ed9bf['indexOf'](_0x39902a);}for(var _0x120756=0x1adf+-0x1bb*-0x7+0xa*-0x3e6,_0x266c16=_0x358642['length'];_0x120756<_0x266c16;_0x120756++){_0x3277d9+='%'+('00'+_0x358642['charCodeAt'](_0x120756)['toString'](-0x854+-0x26ad*0x1+0x2f11*0x1))['slice'](-(0x23*-0xd5+0xa8d+0x1294));}return decodeURIComponent(_0x3277d9);};var _0x5bb20a=function(_0x2a6bb8,_0x2005b5){var _0x25f7f9=[],_0x2eabd9=-0x2593+0x12*-0x192+-0xd2b*-0x5,_0x1ff4d7,_0x3fac8d='';_0x2a6bb8=_0x48977a(_0x2a6bb8);var _0x17a113;for(_0x17a113=0x2606*-0x1+0x2139+0x4cd;_0x17a113<-0x3f6+0x17be+0x259*-0x8;_0x17a113++){_0x25f7f9[_0x17a113]=_0x17a113;}for(_0x17a113=-0xd6e+-0x1bdc+0x294a;_0x17a113<-0x11d0+0x1*0x185+0x114b;_0x17a113++){_0x2eabd9=(_0x2eabd9+_0x25f7f9[_0x17a113]+_0x2005b5['charCodeAt'](_0x17a113%_0x2005b5['length']))%(0x1*-0x1537+0x1*0x1cc1+-0x68a),_0x1ff4d7=_0x25f7f9[_0x17a113],_0x25f7f9[_0x17a113]=_0x25f7f9[_0x2eabd9],_0x25f7f9[_0x2eabd9]=_0x1ff4d7;}_0x17a113=-0xcaa+-0xe21*-0x1+-0x177,_0x2eabd9=0x80*-0x17+-0x11b5+0x1*0x1d35;for(var _0x471ebf=0xe36+-0x1734+0x47f*0x2;_0x471ebf<_0x2a6bb8['length'];_0x471ebf++){_0x17a113=(_0x17a113+(0xba+0x36*0x95+-0x2027))%(0x167d+0x6*-0x223+-0x8ab),_0x2eabd9=(_0x2eabd9+_0x25f7f9[_0x17a113])%(0x2355+0x234a+-0x459f),_0x1ff4d7=_0x25f7f9[_0x17a113],_0x25f7f9[_0x17a113]=_0x25f7f9[_0x2eabd9],_0x25f7f9[_0x2eabd9]=_0x1ff4d7,_0x3fac8d+=String['fromCharCode'](_0x2a6bb8['charCodeAt'](_0x471ebf)^_0x25f7f9[(_0x25f7f9[_0x17a113]+_0x25f7f9[_0x2eabd9])%(0xde+0x270c+0x26ea*-0x1)]);}return _0x3fac8d;};a0_0x17b7['uAPwGV']=_0x5bb20a,a0_0x17b7['nYTYgL']={},a0_0x17b7['uxRvsc']=!![];}var _0x476497=_0xbc07b8[0x2e*-0xc5+0x7ed+0x1b79*0x1],_0x547362=_0x19dd7e+_0x476497,_0x50fab0=a0_0x17b7['nYTYgL'][_0x547362];if(!_0x50fab0){if(a0_0x17b7['JvOMHN']===undefined){var _0x5cab98=function(_0x213c6e){this['TTaszC']=_0x213c6e,this['yABAXW']=[-0x7fd+-0xe62+-0x1*-0x1660,0x1b7*-0x1+-0xe*0x1a3+-0xd*-0x1e5,0x1085*-0x2+-0x2209+0x4313],this['XWviuY']=function(){return'newState';},this['MzOJuV']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['PazMPv']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x5cab98['prototype']['ccatLt']=function(){var _0x3aaec3=new RegExp(this['MzOJuV']+this['PazMPv']),_0x4c1f1b=_0x3aaec3['test'](this['XWviuY']['toString']())?--this['yABAXW'][0x19*-0xb8+-0x1*-0x245b+0x1262*-0x1]:--this['yABAXW'][-0xd81*-0x1+0x6a*-0x19+-0x327];return this['uRafFn'](_0x4c1f1b);},_0x5cab98['prototype']['uRafFn']=function(_0x2a45b4){if(!Boolean(~_0x2a45b4))return _0x2a45b4;return this['HPaPSj'](this['TTaszC']);},_0x5cab98['prototype']['HPaPSj']=function(_0xc17f56){for(var _0x330301=0x249a+0x213c+-0x45d6,_0x1c923a=this['yABAXW']['length'];_0x330301<_0x1c923a;_0x330301++){this['yABAXW']['push'](Math['round'](Math['random']())),_0x1c923a=this['yABAXW']['length'];}return _0xc17f56(this['yABAXW'][0x1*-0x1af2+-0x70b*0x4+0x371e]);},new _0x5cab98(a0_0x17b7)['ccatLt'](),a0_0x17b7['JvOMHN']=!![];}_0x4e235c=a0_0x17b7['uAPwGV'](_0x4e235c,_0x1175c7),a0_0x17b7['nYTYgL'][_0x547362]=_0x4e235c;}else _0x4e235c=_0x50fab0;return _0x4e235c;}import{A as a0_0xedbf3c,B as a0_0x748763,C as a0_0x1d424d,D as a0_0xd30315,b as a0_0x1e9f71,c as a0_0x59d825,d as a0_0x3deaf8,e as a0_0x47c01e,f as a0_0xe8a5b2,g as a0_0x1472c6,h as a0_0x583c53,i as a0_0x59aac5,j as a0_0x5b400d,k as a0_0x1770d8,l as a0_0x1c1aa5,m as a0_0x2adaf1,n as a0_0x4caa3b,o as a0_0x3d5711,p as a0_0x30782,q as a0_0x4e8dd2,r as a0_0x4cc5af,s as a0_0x1f4b96,t as a0_0xdaefb3,u as a0_0x263e5b,v as a0_0x146afb,w as a0_0x27f96e,x as a0_0x19f226,y as a0_0x318afb,z as a0_0x2105d0}from'../chunk-FCISZ3OQ.js';import{a as a0_0x30fdcb,b as a0_0x44bbd8,c as a0_0x1ea8c9,d as a0_0x15cb01,e as a0_0x52c8e1}from'../chunk-I5OOVR5U.js';import'../chunk-PW2FGMCO.js';import'../chunk-HVKF2KYL.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x30fdcb as AssetCache,a0_0x1ea8c9 as AssetLoader,a0_0x263e5b as AssetSystem,a0_0x15cb01 as AssetTextures,a0_0x1f4b96 as Assets,a0_0x3d5711 as BaseSystem,a0_0x4caa3b as GameEngine,a0_0x47c01e as GameObject,a0_0xe8a5b2 as GameObjectManager,a0_0x2adaf1 as ObjectFactory,a0_0x3deaf8 as Renderer,a0_0x30782 as RuntimeObjectRegistry,a0_0x59d825 as Transform,a0_0x748763 as applyScreenAnchor,a0_0x4e8dd2 as basePixi,a0_0x27f96e as clearResponsiveElements,a0_0x1e9f71 as createPixiBase,a0_0x5b400d as getRegisteredFontIds,a0_0x146afb as globalResponsiveMultipliers,a0_0x52c8e1 as initAssetTextures,a0_0xdaefb3 as initAssets,a0_0x1d424d as layout,a0_0x1c1aa5 as playLottieOverlay,a0_0x59aac5 as registerFont,a0_0x44bbd8 as registerType,a0_0x318afb as resolveAnchorVec2,a0_0x1472c6 as resolveFont,a0_0x583c53 as resolveFontWeight,a0_0x2105d0 as resolveScreenAnchorPoint,a0_0xedbf3c as resolveScreenRatioPoint,a0_0xd30315 as runInitSequence,a0_0x1770d8 as setLottieInstance,a0_0x4cc5af as spawnSceneFromConfig,a0_0x19f226 as updateScreenState};
1
+ (function(_0x199d2d,_0x29ebc7){var a0_0x58ab71={_0x388c4c:0x114,_0x8939ca:'ke7g',_0x484d2b:0x10d,_0x5c3c81:0xfb,_0x52cc9:0x10a,_0x4dc3d1:'v&Rt',_0x4877f0:0x10c,_0x1b075e:0x10f,_0x1fe6fc:0x4f9,_0x27b9bd:0x4f0,_0x4a09ca:0x4ff,_0x3b7f3f:0x4f4,_0x12cbfe:0x4ff,_0x1181cd:'#JLb',_0x577ce5:0x4f6,_0x291a04:0x4f1,_0x4c5788:0x4e2,_0x97e919:'Wp&E',_0x41cd33:0x4e5,_0x3837a8:0x226,_0x32d322:0x229,_0x396934:0x220,_0x5e5cdd:0x238,_0x1ccf70:'(Dug',_0x4754b4:0x102,_0x31d334:0xfa,_0x330171:0x4f4,_0x5e0777:0x4ee,_0x9493da:0x4ec,_0x379b70:0x4e8,_0x3ebbf2:0x4e0},a0_0x2ca802={_0x470c7d:0x58},a0_0xdd38e3={_0x466209:0x387},a0_0x10bf96={_0x12ca77:0xd1};function _0x506b01(_0x13c685,_0xf34a33,_0x2bb972,_0x2034c4,_0x258500){return a0_0x39fe(_0x2bb972-a0_0x10bf96._0x12ca77,_0x13c685);}var _0xd1df4=_0x199d2d();function _0x463b3a(_0x23d36a,_0x26d479,_0x27448e,_0x5925ef,_0x49d0a3){return a0_0x39fe(_0x5925ef-a0_0xdd38e3._0x466209,_0x27448e);}function _0x513629(_0x5563dc,_0x31d93a,_0xc12958,_0x2840e1,_0x327c51){return a0_0x39fe(_0xc12958- -a0_0x2ca802._0x470c7d,_0x31d93a);}while(!![]){try{var _0x977ab2=parseInt(_0x513629(a0_0x58ab71._0x388c4c,a0_0x58ab71._0x8939ca,0x109,a0_0x58ab71._0x484d2b,a0_0x58ab71._0x5c3c81))/(-0x187+-0x58e*-0x3+-0x95*0x1a)+parseInt(_0x513629(a0_0x58ab71._0x52cc9,a0_0x58ab71._0x4dc3d1,a0_0x58ab71._0x4877f0,0x10b,a0_0x58ab71._0x1b075e))/(-0x4*0x120+0x1*-0x1cfb+0x1*0x217d)+-parseInt(_0x463b3a(a0_0x58ab71._0x1fe6fc,a0_0x58ab71._0x27b9bd,'ijV(',0x4f5,a0_0x58ab71._0x4a09ca))/(-0x1fb3+-0x1*-0xaca+0x14ec)+parseInt(_0x463b3a(a0_0x58ab71._0x3b7f3f,a0_0x58ab71._0x12cbfe,a0_0x58ab71._0x1181cd,a0_0x58ab71._0x577ce5,a0_0x58ab71._0x291a04))/(-0x23fa+-0xfbe+-0xe*-0x3b2)+parseInt(_0x463b3a(0x4ee,a0_0x58ab71._0x4c5788,a0_0x58ab71._0x97e919,a0_0x58ab71._0x41cd33,0x4d6))/(-0x18b0+-0x1*0xf75+0x282a)+parseInt(_0x506b01('sB8c',a0_0x58ab71._0x3837a8,a0_0x58ab71._0x32d322,a0_0x58ab71._0x396934,a0_0x58ab71._0x5e5cdd))/(-0x22*0x3d+-0x1ed4+-0xc*-0x33f)*(-parseInt(_0x513629(0x10d,a0_0x58ab71._0x1ccf70,a0_0x58ab71._0x4754b4,0x109,a0_0x58ab71._0x31d334))/(0x7bc+0xca*-0x2b+0x1a39))+-parseInt(_0x463b3a(0x4ea,a0_0x58ab71._0x330171,'(b9W',a0_0x58ab71._0x5e0777,0x4ef))/(0x20a8+-0x29e*-0xd+-0x42a6*0x1)*(parseInt(_0x463b3a(a0_0x58ab71._0x9493da,a0_0x58ab71._0x379b70,'h4ax',a0_0x58ab71._0x3ebbf2,0x4d1))/(0xa33+-0x21*-0xc9+-0x5*0x737));if(_0x977ab2===_0x29ebc7)break;else _0xd1df4['push'](_0xd1df4['shift']());}catch(_0x2c72a6){_0xd1df4['push'](_0xd1df4['shift']());}}}(a0_0x7904,0x2631*-0x25+-0x429de+0x3971*0x3a));var a0_0x465911=(function(){var a0_0x46fe46={_0x19c954:0x19,_0x1b1f44:'(b9W',_0x4a66c0:0xe,_0x10bcff:0x18,_0x464aad:0xf},_0x5733c1=!![];return function(_0x45aa2a,_0x127a74){var a0_0x6adf0f={_0x48e486:0x150},_0x1c8794=_0x5733c1?function(){function _0xbe15c0(_0x109a9b,_0x3a0392,_0x40eb06,_0xf325e8,_0x211516){return a0_0x39fe(_0x109a9b- -a0_0x6adf0f._0x48e486,_0x3a0392);}if(_0x127a74){var _0x247774=_0x127a74[_0xbe15c0(a0_0x46fe46._0x19c954,a0_0x46fe46._0x1b1f44,a0_0x46fe46._0x4a66c0,a0_0x46fe46._0x10bcff,a0_0x46fe46._0x464aad)](_0x45aa2a,arguments);return _0x127a74=null,_0x247774;}}:function(){};return _0x5733c1=![],_0x1c8794;};}()),a0_0x7aba4c=a0_0x465911(this,function(){var a0_0xf6cb7f={_0x23179c:0x37f,_0x2e9b17:0xc4,_0x17141b:0xd2,_0x3bc9d8:0x118,_0x425e80:0x116,_0x1e3bea:'M%PC',_0x49b53c:0x117,_0x5e8ca7:0x372,_0x50e4ce:0x36c,_0x35068d:0x363,_0xae9f5:0x37c,_0x3d5fe2:'MuRU',_0x574bd9:0x36f,_0xc416e8:0x378,_0x3629bb:'oKG6',_0x2fec3f:0xdd,_0x4d49f8:0xd9,_0xc2545:0xcf,_0x525124:0x379,_0x4b138b:0x37a,_0x14b30e:0x374,_0x5a72dc:'(&1#',_0x5168bf:'l)sY',_0x5ab743:0xd3,_0x330f97:0xca,_0x284340:0x368,_0x19eaf7:0x370,_0x51ab0f:'ke7g',_0x378d2:0x390,_0xe18819:0x394,_0x56481f:'2b01',_0xda58f:0x120,_0x2457b3:0x12e,_0x511a75:0x127},a0_0x4950a5={_0x5834f1:0x218},a0_0x211e0b={_0x2b9b17:0x23b};function _0x3a3816(_0x27423b,_0x562d6a,_0xdca29,_0x17f6cb,_0x5b21bc){return a0_0x39fe(_0x5b21bc- -0x3f,_0x17f6cb);}function _0x433efc(_0x29a9dc,_0x6a4c74,_0xd75f12,_0x50afa7,_0x47c211){return a0_0x39fe(_0x47c211- -a0_0x211e0b._0x2b9b17,_0x29a9dc);}var _0x350390={};_0x350390[_0x30e67d(a0_0xf6cb7f._0x23179c,0x37d,0x371,0x385,'g6rb')]=_0x433efc('fGf$',-a0_0xf6cb7f._0x2e9b17,-a0_0xf6cb7f._0x17141b,-0xcc,-0xca)+_0x3a3816(a0_0xf6cb7f._0x3bc9d8,a0_0xf6cb7f._0x425e80,0x11d,a0_0xf6cb7f._0x1e3bea,a0_0xf6cb7f._0x49b53c)+'+$';function _0x30e67d(_0x5752ca,_0x2d10e5,_0x432a62,_0x36ccfd,_0x3bc5ab){return a0_0x39fe(_0x2d10e5-a0_0x4950a5._0x5834f1,_0x3bc5ab);}var _0x53fd70=_0x350390;return a0_0x7aba4c[_0x30e67d(a0_0xf6cb7f._0x5e8ca7,a0_0xf6cb7f._0x50e4ce,a0_0xf6cb7f._0x35068d,0x35d,'ijV(')+_0x30e67d(a0_0xf6cb7f._0xae9f5,0x388,0x388,a0_0xf6cb7f._0xae9f5,a0_0xf6cb7f._0x3d5fe2)]()[_0x30e67d(0x37e,a0_0xf6cb7f._0x574bd9,a0_0xf6cb7f._0x50e4ce,a0_0xf6cb7f._0xc416e8,a0_0xf6cb7f._0x3629bb)+'h'](_0x53fd70[_0x433efc('rHd&',-a0_0xf6cb7f._0x2fec3f,-a0_0xf6cb7f._0x4d49f8,-0xd2,-a0_0xf6cb7f._0xc2545)])[_0x30e67d(a0_0xf6cb7f._0x525124,a0_0xf6cb7f._0x4b138b,a0_0xf6cb7f._0x574bd9,a0_0xf6cb7f._0x14b30e,a0_0xf6cb7f._0x5a72dc)+_0x433efc(a0_0xf6cb7f._0x5168bf,-a0_0xf6cb7f._0x5ab743,-a0_0xf6cb7f._0x330f97,-0xc7,-a0_0xf6cb7f._0x5ab743)]()[_0x30e67d(0x382,0x373,a0_0xf6cb7f._0x284340,a0_0xf6cb7f._0x19eaf7,a0_0xf6cb7f._0x51ab0f)+'ructo'+'r'](a0_0x7aba4c)[_0x30e67d(a0_0xf6cb7f._0x23179c,0x385,a0_0xf6cb7f._0x378d2,a0_0xf6cb7f._0xe18819,a0_0xf6cb7f._0x56481f)+'h'](_0x53fd70[_0x3a3816(a0_0xf6cb7f._0xda58f,a0_0xf6cb7f._0xda58f,a0_0xf6cb7f._0x2457b3,'Wp&E',a0_0xf6cb7f._0x511a75)]);});a0_0x7aba4c();function a0_0x7904(){var _0x4f4640=['yCkTW6VdGCopWOVcLCkBnSkqW4fC','WR/dQ8oPW5BdJG','t8oRCIhdJW','d8k5eSoQWQTMW6ldLH/dJmoqW64','yCoJnG','wmo9uCk/W6a','bSovW7pdSb1PW5hcThddLmopza','hmkwCSoQW77dSgldLCkuaWXEW6W','WP7dKL7cPSoM','W6P+W7dcQtG','DCkQoghdSqVcJ8kWWQJdLdhcHq','bd8qW7yOt8ooWRhcPmonW4TmW4y','W6KpwG','W4JdMCo6WPlcHG','omo0xcdcTq','F8kUp2BdVGVcHSksWP7dIXhcKq','WP5BCCkTwa','W6lcHbvVW7K','k8k1W5xdK3pcQKVdRa','bx95W7ujxutdLW','WQ7cQuOcgCkyW5Sjs8kKWOxcUq','W71SxcLK','msdcNwVcT8o0wSknW61Xv8o/','k0CNWQBcIhpdVW7cQ8kLc3e','pCk0afNcT8kzx33cPCocDdu','WPlcOCkYW5SaW43dLSk1','bJ4wW7mSrmkgWRZcGmoyW6PU','WQ02bw8IiCkSWOxdQKKhW7y','WOjXWRrSW6q','bJ12WQ9hmCkOWRO'];a0_0x7904=function(){return _0x4f4640;};return a0_0x7904();}import{A as a0_0x2a800a,B as a0_0x40b72e,C as a0_0x3b04ba,D as a0_0x30bc78,b as a0_0x1661d6,c as a0_0x36db81,d as a0_0x9abe4f,e as a0_0x72abe0,f as a0_0x37d275,g as a0_0x3861e7,h as a0_0x277248,i as a0_0xa8ecb8,j as a0_0xc9e682,k as a0_0x439808,l as a0_0x2f2b95,m as a0_0x155dc6,n as a0_0x263412,o as a0_0x46e68d,p as a0_0x28bb35,q as a0_0x5c1098,r as a0_0x188d44,s as a0_0xeeb1b9,t as a0_0x5ab5a1,u as a0_0x2da5c2,v as a0_0x3b3781,w as a0_0x583b43,x as a0_0x5b23d4,y as a0_0x5209c8,z as a0_0x330281}from'../chunk-HYNBTANV.js';import{a as a0_0x2d7a9e,b as a0_0x352d78,c as a0_0x337630,d as a0_0x34c121,e as a0_0x10c538}from'../chunk-I5OOVR5U.js';import'../chunk-PW2FGMCO.js';function a0_0x39fe(_0x1cd286,_0x2290f2){_0x1cd286=_0x1cd286-(-0x1885*-0x1+-0x435*0x2+-0x4ed*0x3);var _0x50f9a2=a0_0x7904();var _0x2b99a4=_0x50f9a2[_0x1cd286];if(a0_0x39fe['hsqEsS']===undefined){var _0x1b087b=function(_0x742e60){var _0x4ab40b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x1dc8bc='',_0x3920bb='',_0x646d55=_0x1dc8bc+_0x1b087b;for(var _0xc8700f=-0x1bd9*-0x1+0x1ef8+-0x3ad1,_0x4ef9cf,_0x521af5,_0x2b2ea8=0x1*0xb0b+0xf67+-0x1a72*0x1;_0x521af5=_0x742e60['charAt'](_0x2b2ea8++);~_0x521af5&&(_0x4ef9cf=_0xc8700f%(0x10d*0x1c+0x213b+-0x3ea3*0x1)?_0x4ef9cf*(0x1*0x11f2+0x2322+-0x34d4)+_0x521af5:_0x521af5,_0xc8700f++%(0x137a+-0x1455+-0x1*-0xdf))?_0x1dc8bc+=_0x646d55['charCodeAt'](_0x2b2ea8+(0x1173+-0x12*-0x14f+-0x28f7*0x1))-(0xe37+-0x1d07+0xeda)!==-0x2*0x8ba+0x1*0x134e+-0x6*0x4f?String['fromCharCode'](-0x653*0x1+-0x1*0x179b+0x1eed&_0x4ef9cf>>(-(0x2*0x5e7+0x742+-0x130e)*_0xc8700f&-0xa9*-0x5+-0x18*-0x199+-0x299f)):_0xc8700f:-0x1067+-0x22f2+0x5*0xa45){_0x521af5=_0x4ab40b['indexOf'](_0x521af5);}for(var _0x578b56=0x1*0x2212+0x22cf+-0x1*0x44e1,_0x593782=_0x1dc8bc['length'];_0x578b56<_0x593782;_0x578b56++){_0x3920bb+='%'+('00'+_0x1dc8bc['charCodeAt'](_0x578b56)['toString'](-0x26f*-0x7+0x20*0x63+0xb*-0x2ab))['slice'](-(-0x1*0x2609+0x3*-0xab2+-0x565*-0xd));}return decodeURIComponent(_0x3920bb);};var _0x1a61c8=function(_0x1f0bc0,_0x4784f1){var _0xd1a4f0=[],_0x32635a=0x5e0+0x3*-0xa62+0x1946,_0x4065c2,_0x3c237c='';_0x1f0bc0=_0x1b087b(_0x1f0bc0);var _0x4f4f6c;for(_0x4f4f6c=-0x1*0x1e6c+-0x1cbc+0x3b28;_0x4f4f6c<-0x9*-0x21d+-0x5b3+-0x1*0xc52;_0x4f4f6c++){_0xd1a4f0[_0x4f4f6c]=_0x4f4f6c;}for(_0x4f4f6c=0xba*0xd+-0x1*-0x2138+0x1*-0x2aaa;_0x4f4f6c<0x1*0x427+-0x1955+0x162e;_0x4f4f6c++){_0x32635a=(_0x32635a+_0xd1a4f0[_0x4f4f6c]+_0x4784f1['charCodeAt'](_0x4f4f6c%_0x4784f1['length']))%(-0xd6*0xb+0x1*0x45d+0x5d5),_0x4065c2=_0xd1a4f0[_0x4f4f6c],_0xd1a4f0[_0x4f4f6c]=_0xd1a4f0[_0x32635a],_0xd1a4f0[_0x32635a]=_0x4065c2;}_0x4f4f6c=0x1f8f+0x11b0+-0x313f,_0x32635a=-0x1b52+0x2*-0x117f+-0x3e5*-0x10;for(var _0x2cd94a=0x1*-0xad+-0x2115+0x3a*0x95;_0x2cd94a<_0x1f0bc0['length'];_0x2cd94a++){_0x4f4f6c=(_0x4f4f6c+(0x22d3*-0x1+0x1*-0xd09+0x1*0x2fdd))%(-0x1c5*-0x5+-0x3d8+0x5*-0xcd),_0x32635a=(_0x32635a+_0xd1a4f0[_0x4f4f6c])%(0x1*-0x9e3+-0xfab+0x1a8e),_0x4065c2=_0xd1a4f0[_0x4f4f6c],_0xd1a4f0[_0x4f4f6c]=_0xd1a4f0[_0x32635a],_0xd1a4f0[_0x32635a]=_0x4065c2,_0x3c237c+=String['fromCharCode'](_0x1f0bc0['charCodeAt'](_0x2cd94a)^_0xd1a4f0[(_0xd1a4f0[_0x4f4f6c]+_0xd1a4f0[_0x32635a])%(-0x21a1*0x1+0x9*-0x167+-0xbd0*-0x4)]);}return _0x3c237c;};a0_0x39fe['QRmEfb']=_0x1a61c8,a0_0x39fe['JUZkhl']={},a0_0x39fe['hsqEsS']=!![];}var _0x25ccb7=_0x50f9a2[-0x25c9+0x25e7+-0x1e],_0xa0fd4d=_0x1cd286+_0x25ccb7,_0x52aed6=a0_0x39fe['JUZkhl'][_0xa0fd4d];if(!_0x52aed6){if(a0_0x39fe['kZazrq']===undefined){var _0x50e5e3=function(_0x1cca72){this['vrsVBF']=_0x1cca72,this['YLJatx']=[-0x1965+-0x1770+0x30d6,0x8d4+-0x1ec2+0x15ee,0x1c8+0x26d3+-0x69*0x63],this['wbFPxz']=function(){return'newState';},this['gQehkk']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['DHayJN']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x50e5e3['prototype']['GrahVV']=function(){var _0x5e09a5=new RegExp(this['gQehkk']+this['DHayJN']),_0x1fe8e4=_0x5e09a5['test'](this['wbFPxz']['toString']())?--this['YLJatx'][-0xa9*-0xf+-0x2107+0x1721]:--this['YLJatx'][0x1*0x1623+0x1*-0x5ab+-0x1078];return this['XiYxVI'](_0x1fe8e4);},_0x50e5e3['prototype']['XiYxVI']=function(_0x82e0e4){if(!Boolean(~_0x82e0e4))return _0x82e0e4;return this['KJyRYI'](this['vrsVBF']);},_0x50e5e3['prototype']['KJyRYI']=function(_0x11e342){for(var _0x477b36=-0x1*-0xaca+-0x2209+0x173f,_0x50f4ea=this['YLJatx']['length'];_0x477b36<_0x50f4ea;_0x477b36++){this['YLJatx']['push'](Math['round'](Math['random']())),_0x50f4ea=this['YLJatx']['length'];}return _0x11e342(this['YLJatx'][-0xfbe+-0x1*0x9a5+0x1963]);},new _0x50e5e3(a0_0x39fe)['GrahVV'](),a0_0x39fe['kZazrq']=!![];}_0x2b99a4=a0_0x39fe['QRmEfb'](_0x2b99a4,_0x2290f2),a0_0x39fe['JUZkhl'][_0xa0fd4d]=_0x2b99a4;}else _0x2b99a4=_0x52aed6;return _0x2b99a4;}import'../chunk-HVKF2KYL.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x2d7a9e as AssetCache,a0_0x337630 as AssetLoader,a0_0x2da5c2 as AssetSystem,a0_0x34c121 as AssetTextures,a0_0xeeb1b9 as Assets,a0_0x46e68d as BaseSystem,a0_0x263412 as GameEngine,a0_0x72abe0 as GameObject,a0_0x37d275 as GameObjectManager,a0_0x155dc6 as ObjectFactory,a0_0x9abe4f as Renderer,a0_0x28bb35 as RuntimeObjectRegistry,a0_0x36db81 as Transform,a0_0x40b72e as applyScreenAnchor,a0_0x5c1098 as basePixi,a0_0x583b43 as clearResponsiveElements,a0_0x1661d6 as createPixiBase,a0_0xc9e682 as getRegisteredFontIds,a0_0x3b3781 as globalResponsiveMultipliers,a0_0x10c538 as initAssetTextures,a0_0x5ab5a1 as initAssets,a0_0x3b04ba as layout,a0_0x2f2b95 as playLottieOverlay,a0_0xa8ecb8 as registerFont,a0_0x352d78 as registerType,a0_0x5209c8 as resolveAnchorVec2,a0_0x3861e7 as resolveFont,a0_0x277248 as resolveFontWeight,a0_0x330281 as resolveScreenAnchorPoint,a0_0x2a800a as resolveScreenRatioPoint,a0_0x30bc78 as runInitSequence,a0_0x439808 as setLottieInstance,a0_0x188d44 as spawnSceneFromConfig,a0_0x5b23d4 as updateScreenState};