handler-playable-sdk 0.5.552 → 0.5.553

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/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 _l={};Et(_l,{COLORS:()=>he,ConfigWatcher:()=>Ve,DebugPanel:()=>Ut,DefaultReloadStrategy:()=>Rt,Handler:()=>le,PlayableLoadingScreen:()=>pn,PreviewShell:()=>ln,STROKE_WIDTH:()=>$r,THEME:()=>Dr,applyConfigOverride:()=>ne,applyConfigOverrides:()=>Ie,applyConfigsToDisk:()=>mi,applyDefaults:()=>qe,baseLottie:()=>Cn,bootstrap:()=>Sl,clearConfigOverrides:()=>ae,clearConfigOverridesForObject:()=>zs,configOverrideManager:()=>$s,createPreviewShell:()=>_a,deepClone:()=>Y,default:()=>He,defaultPreset:()=>Ei,deviceGroups:()=>ea,devicePresets:()=>Qn,diffConfigs:()=>Wn,exportConfigsAsJSON:()=>Ue,getConfigOverrides:()=>Z,getConfigStateSummary:()=>Me,getOverrideMode:()=>Mt,getPresetById:()=>We,getPresetsByCategory:()=>Xo,loadAllObjectConfigs:()=>vi,loadComponentSchemas:()=>yi,loadEngineConfig:()=>wi,loadGamePromptConfig:()=>Gn,loadObjectCentricConfig:()=>Ce,loadObjectConfig:()=>je,loadSceneConfig:()=>xi,redoLastConfigChange:()=>fi,rehydrateObject:()=>Yn,removeConfigOverride:()=>jt,resetToApplied:()=>_t,resetToOriginal:()=>bi,setBootstrapDependencies:()=>wl,setOverrideMode:()=>Fn,setupHotReload:()=>Jn,setupLiveEditBridge:()=>cn,toLegacyFormat:()=>qn,trackObjectCreation:()=>Ds,trackObjectDeletion:()=>Hs,undoLastConfigChange:()=>hi,validateObjectConfig:()=>ot});module.exports=ao(_l);var ke={};function ei(s,e,t=!1){ke[s]||(ke[s]=[]),ke[s].push({fn:e,once:t})}function wn(s,e){if(ke[s]){if(!e){delete ke[s];return}ke[s]=ke[s].filter(t=>t.fn!==e)}}function ti(s,...e){let t=ke[s];if(t)for(let i of[...t])i.fn(...e),i.once&&wn(s,i.fn)}function ee(s,e){ei(s,e,!0)}var V=null,re=[],it=null;function Ja(s){V=s,re=[],it!==null&&(clearTimeout(it),it=null)}function Za(){var s,e,t;return{endpoint:(V==null?void 0:V.endpoint)||"",transport:(V==null?void 0:V.transport)||"beacon",batchSize:(s=V==null?void 0:V.batchSize)!=null?s:10,flushIntervalMs:(e=V==null?void 0:V.flushIntervalMs)!=null?e:300,maxQueue:(t=V==null?void 0:V.maxQueue)!=null?t:200,debug:!!(V!=null&&V.debug)}}async function Ka(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 xn(s,e){let t=Za();if(e&&t.endpoint){if(re.push(s),re.length>t.maxQueue&&(re=re.slice(re.length-t.maxQueue)),re.length>=t.batchSize){Xa();return}it===null&&(it=window.setTimeout(()=>{it=null,Xa()},t.flushIntervalMs))}}async function Xa(){let s=Za();if(!s.endpoint||re.length===0)return;let e=re.splice(0,s.batchSize);await Ka(s.endpoint,{events:e},s.transport,s.debug),re.length>0&&await Ka(s.endpoint,{events:re.splice(0,s.batchSize)},s.transport,s.debug)}function Qa(s){return Math.max(0,Math.min(1,s))}function so(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 Ct(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function ro(s,e){let t=s==null?void 0:s[e];return typeof t=="number"?t:0}function es(s,e,t){try{s[e]=t}catch{}}function oo(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 ts(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 is(s,e){let t=oo(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 ns(){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=Ct();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 f=h.durationMs>0?g/h.durationMs:1,m=Qa(f),b=h.repeat>=0?h.repeat+1:1,y=h.repeat>0?Math.min(Math.floor(f),b-1):0;if(h.repeat>0&&f>=1){let E=f-y;m=Qa(E)}let v=h.ease(m);h.yoyo&&y%2===1&&(v=1-v);for(let E of h.props)es(h.target,E.key,E.from+(E.to-E.from)*v);h.scaleFrom&&h.scaleTo&&ts(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(f>=b){r(h);try{(u=h.onComplete)==null||u.call(h)}catch{}}}},l=(d,p,u)=>{var E;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+((E=u==null?void 0:u.delayMsOverride)!=null?E:0)),f=so(p.ease),m=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 k of Object.keys(p)){if(y.has(k))continue;let M=p[k];typeof M=="number"&&v.push({key:k,from:ro(d,k),to:M})}let w=is(d,p);return{target:d,startMs:Ct(),delayMs:g,durationMs:h,ease:f,props:v,scaleFrom:w.from,scaleTo:w.to,repeat:m,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=Ct())},resume:()=>{var f;if(!u.paused)return;let h=(f=u.pauseAtMs)!=null?f:Ct(),g=Ct()-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"&&es(d,h,g)}let u=is(d,p);u.to&&ts(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=[],f=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},m=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,w){return m({kind:"to",target:y,vars:v,atMs:f(w)}),b},fromTo(y,v,w,E){return m({kind:"fromTo",target:y,vars:w,from:v,atMs:f(E)}),b},play(){var y,v;if(h)return b;h=!0,g=[];for(let w of p)w.kind==="fromTo"&&c.set(w.target,(y=w.from)!=null?y:{}),g.push(c.to(w.target,{...w.vars,delay:w.atMs/1e3+((v=w.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 as(){if(typeof window=="undefined")return;let s=window;if(!s.gsap)try{s.gsap=ns()}catch{}}var ss={name:"handler-playable-sdk",version:"0.5.552",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 && 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/ && chmod +x dist/cli/*.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 && 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; 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,co=te++,rs=te++,os=te++,ls=te++,cs=te++,ds=te++,ps=te++,us=te++,gs=te++,hs=te++,fs=te++,ms=te++,G=co;function bs(){return G===rs}function ys(){return G===os}function vs(){return G===ls}function ws(){return G===cs}function nt(){return G===ds}function at(){return G===ps}function xs(){return G===us}function Ss(){return G===gs}function Es(){return G===hs}function Sn(){return G===fs}function En(){return G===ms}function Cs(){let s=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(s==="mraid")try{mraid.getState(),G=rs;return}catch{}else if(s==="dapi")try{dapi.isReady(),G=os;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(G=ls)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(G=cs)}catch{}else if(e==="mintegral")window.gameReady&&(G=ds);else if(e==="tapjoy")window.TJ_API&&(G=ps);else if(e==="tiktok")window.openAppStore&&(G=us);else if(e==="smadex")try{window.smxTracking&&(G=gs)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(G=hs)}catch{}else e==="vungle"?G=fs:(s==="nucleo"||e==="nucleo")&&(G=ms)}var ii=tt(require("lottie-web"),1),Cn=ii.default;typeof window!="undefined"&&(window.lottie=ii.default,window.__baseLottie=ii.default);var po=require("pixi.js");var An=require("pixi.js");var uo=null;function Tn(s){uo=s}ni();Ln();var At=require("pixi.js");ni();var yo=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",Mn=yo;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&&(Mn=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${Mn}`))}}catch{}function vo(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 de=class{static async create(e,t,i){var l,c,d,p,u,h,g;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${Mn}`);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 f=new At.Container;return this.applyTransform(f,t==null?void 0:t.transform,t),f}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 Fe.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 At.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 At.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let f=[n.path,`/assets/${n.path}`,`assets/${n.path}`,`../assets/${n.path}`],m=!1;for(let b of f)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),m=!0;break}}catch{continue}m||(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=vo(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 Tt=class{constructor(){this.config=null}init(e){this.config=e}get(e){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return this.config.objects.get(e)}getAllIds(){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return Array.from(this.config.objects.keys())}has(e){return this.config?this.config.objects.has(e):!1}};var So=tt(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=So);st();var ai=require("pixi.js");st();var On=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Tt}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 de.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 de.create(e,t,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},Eo=new On,Co=new Proxy(Eo,{get(s,e){if(e in s&&typeof s[e]=="function")return s[e].bind(s);if(s.get(e))return s.get(e)}});st();var Is=require("pixi.js"),xe={width:400,height:600,designWidth:400,scaleFactor:1},ri={scale:1,position:1},zn=[];function To(s,e,t,i,n,a,r){zn.push({element:s,originalScale:a,positionHelper:e,heightPercent:n}),e(s,t,i,n,a,r,!1)}function Lo(){zn.forEach(({element:s,originalScale:e,positionHelper:t,heightPercent:i})=>{let n=e*xe.scaleFactor;t(s,xe.width,xe.height,i,n,!0,!1)})}function Rn(s,e){console.log(`[SCREEN] updateScreenState called: ${s}x${e}`),xe.width=s,xe.height=e,xe.scaleFactor=Math.min(s/xe.designWidth,1.15),ri.scale=xe.scaleFactor,ri.position=1,console.log(`[SCREEN] Global multipliers - scale: ${ri.scale.toFixed(3)}`),Lo()}var ue={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 ko(s,e,t){let i=ue[s];i&&i[e]!==void 0&&(i[e]=t,console.log(`Updated ${s}.${e} = ${t}`))}function Po(){return ue}var Io={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 si(s,e){return typeof s=="number"&&Number.isFinite(s)?s:e}function rt(s,e={x:.5,y:.5}){var t;if(Array.isArray(s))return{x:si(s[0],e.x),y:si(s[1],e.y)};if(s&&typeof s=="object"){let i=s;return{x:si(i.x,e.x),y:si(i.y,e.y)}}if(typeof s=="string"){let i=s.trim().toLowerCase();return(t=Io[i])!=null?t:e}return e}function kt(s,e,t,i={}){var h,g,f,m,b,y;let n=rt(t),a=(h=i.inset)!=null?h:{},r=(g=i.padding)!=null?g:{x:0,y:0},o=((f=a.left)!=null?f:0)+r.x,l=((m=a.right)!=null?m: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 Pt(s,e,t,i={}){var f,m,b,y,v,w;let n=(f=i.inset)!=null?f:{},a=(m=i.padding)!=null?m:{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=((w=n.bottom)!=null?w:0)+a.y,d=Math.max(0,s-r-o),p=Math.max(0,e-l-c),u=rt(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,Rn(i,n))};window.addEventListener("resize",t),window.addEventListener("orientationchange",()=>{setTimeout(t,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",t),window.mraid.addEventListener("sizeChange",t)),Rn(window.innerWidth,window.innerHeight),window.updateDebugConfig=ko,window.getDebugConfig=Po,window.copyConfig=Fo,window.applyConfig=Lt,window.applyConfigForRatio=Bo,window.positionAtBottom=Ms,window.positionAtTop=_o,window.positionAtCenter=Oo,window.positionAtLeft=Ro,window.positionAtRight=zo,window.positionAtBottomLeft=$o,window.positionAtBottomRight=Do,window.positionAtTopLeft=Ho,window.positionAtTopRight=No,window.applyPositionContract=jo,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 oi(s,e,t=0){return s*e+t}function li(s,e,t=0){return s*(1-e)+t}function ci(s,e,t=0){return s*e+t}function di(s,e,t=0){return s*(1-e)+t}function ie(s,e=0){return s/2+e}function Mo(s,e){return s*e}function jo(s,e,t,i){var r,o,l,c,d,p,u,h,g,f,m,b,y,v,w,E,k,M,x,j;let n=0,a=0;switch(i.type){case"top":n=ie(e,(o=(r=i.offset)==null?void 0:r.x)!=null?o:0),a=oi(t,i.percent,(c=(l=i.offset)==null?void 0:l.y)!=null?c:0);break;case"bottom":n=ie(e,(p=(d=i.offset)==null?void 0:d.x)!=null?p:0),a=li(t,i.percent,(h=(u=i.offset)==null?void 0:u.y)!=null?h:0);break;case"left":n=ci(e,i.percent,(f=(g=i.offset)==null?void 0:g.x)!=null?f:0),a=ie(t,(b=(m=i.offset)==null?void 0:m.y)!=null?b:0);break;case"right":n=di(e,i.percent,(v=(y=i.offset)==null?void 0:y.x)!=null?v:0),a=ie(t,(E=(w=i.offset)==null?void 0:w.y)!=null?E:0);break;case"center":n=ie(e,(M=(k=i.offset)==null?void 0:k.x)!=null?M:0),a=ie(t,(j=(x=i.offset)==null?void 0:x.y)!=null?j: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=Mo(t,i),l=li(t,i/2);Se(s,ie(e),l);let c=a?n*xe.scaleFactor:n;Ee(s,c),r&&!zn.find(d=>d.element===s)&&To(s,Ms,e,t,i,n,a)}function _o(s,e,t,i=.1,n=1){Se(s,ie(e),oi(t,i)),Ee(s,n)}function Oo(s,e,t,i=0,n=0,a=1){Se(s,ie(e,i),ie(t,n)),Ee(s,a)}function Ro(s,e,t,i=.1,n=1){Se(s,ci(e,i),ie(t)),Ee(s,n)}function zo(s,e,t,i=.1,n=1){Se(s,di(e,i),ie(t)),Ee(s,n)}function $o(s,e,t,i=.05,n=.05,a=1){Se(s,ci(e,n),li(t,i)),Ee(s,a)}function Do(s,e,t,i=.05,n=.05,a=1){Se(s,di(e,n),li(t,i)),Ee(s,a)}function Ho(s,e,t,i=.05,n=.05,a=1){Se(s,ci(e,n),oi(t,i)),Ee(s,a)}function No(s,e,t,i=.05,n=.05,a=1){Se(s,di(e,n),oi(t,i)),Ee(s,a)}function Se(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 Ee(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 Be={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 Fo(s){return s&&Be[s]?JSON.parse(JSON.stringify(Be[s])):JSON.parse(JSON.stringify(ue))}function Lt(s){Object.keys(s).forEach(e=>{let t=e;ue[t]&&s[t]&&Object.assign(ue[t],s[t])}),console.log("Config applied:",s)}function Bo(s,e){let t=s/e;t>1.6?(Lt(Be.wide),console.log("Applied WIDE config for ratio:",t)):t<.7?(Lt(Be.tall),console.log("Applied TALL config for ratio:",t)):t>.8&&t<1.2?(Lt(Be.square),console.log("Applied SQUARE config for ratio:",t)):(Lt(Be.default),console.log("Applied DEFAULT config for ratio:",t))}if(typeof window!="undefined"){let s=window;s.configPresets=Be,s.resolveAnchorVec2=s.resolveAnchorVec2||rt,s.resolveScreenAnchorPoint=s.resolveScreenAnchorPoint||kt,s.resolveScreenRatioPoint=s.resolveScreenRatioPoint||Pt}Si();function W(s,e){let t=(n,a)=>a===0?n:t(a,n%a),i=t(s,e);return`${s/i}:${e/i}`}var od=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:W(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:W(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:W(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:W(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:W(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:W(360,780)}],ld=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:W(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:W(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:W(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:W(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:W(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:W(412,915)}],cd=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:W(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:W(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:W(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:W(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:W(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:W(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:W(768,1024),mraidScale:.7}];var Qn=[...Zn],ea=[{category:"playable",label:"Playable Ad",devices:Zn}],Ei=Zn[0];function We(s){return Qn.find(e=>e.id===s)||Ei}function Xo(s){return Qn.filter(e=>e.category===s)}K();var _e=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}ne({objectId:e,path:t,value:i},{persist:!0});let o=window.applyEditableObjectConfig;if(typeof o=="function"){let p=window.__editableConfig,u=(d=(c=(l=p==null?void 0:p.objects)==null?void 0:l.get)==null?void 0:c.call(l,e))!=null?d:r;await o(e,u),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 ta(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 Ci=class{constructor(){this.updateManager=new _e}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");ta({objectId:e,category:a,onApply:async o=>{var d,p;await this.updateManager.updateProperty(e,t,o);let l=window.__debugContext;(p=(d=l==null?void 0:l.options)==null?void 0:d.onPropertyChange)==null||p.call(d,e,t,o);let c=window.__highlightLibrarySlot;typeof c=="function"&&setTimeout(()=>{c(e,a)},500),window.dispatchEvent(new CustomEvent("inspector:refresh"))}})}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 Jo=[{value:"loading",label:"Loading"},{value:"start",label:"Start"},{value:"gameplay",label:"Gameplay"},{value:"tutorial",label:"Tutorial"},{value:"endgame",label:"Endgame"}],Zo=["environment","ui","character","system","backgrounds"],Qo=["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}}},Ai=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 _l={};Et(_l,{COLORS:()=>he,ConfigWatcher:()=>Ve,DebugPanel:()=>Ut,DefaultReloadStrategy:()=>Rt,Handler:()=>le,PlayableLoadingScreen:()=>pn,PreviewShell:()=>ln,STROKE_WIDTH:()=>$r,THEME:()=>Dr,applyConfigOverride:()=>ne,applyConfigOverrides:()=>Ie,applyConfigsToDisk:()=>mi,applyDefaults:()=>qe,baseLottie:()=>Cn,bootstrap:()=>Sl,clearConfigOverrides:()=>ae,clearConfigOverridesForObject:()=>zs,configOverrideManager:()=>$s,createPreviewShell:()=>_a,deepClone:()=>Y,default:()=>He,defaultPreset:()=>Ei,deviceGroups:()=>ea,devicePresets:()=>Qn,diffConfigs:()=>Wn,exportConfigsAsJSON:()=>Ue,getConfigOverrides:()=>Z,getConfigStateSummary:()=>Me,getOverrideMode:()=>Mt,getPresetById:()=>We,getPresetsByCategory:()=>Xo,loadAllObjectConfigs:()=>vi,loadComponentSchemas:()=>yi,loadEngineConfig:()=>wi,loadGamePromptConfig:()=>Gn,loadObjectCentricConfig:()=>Ce,loadObjectConfig:()=>je,loadSceneConfig:()=>xi,redoLastConfigChange:()=>fi,rehydrateObject:()=>Yn,removeConfigOverride:()=>jt,resetToApplied:()=>_t,resetToOriginal:()=>bi,setBootstrapDependencies:()=>wl,setOverrideMode:()=>Fn,setupHotReload:()=>Jn,setupLiveEditBridge:()=>cn,toLegacyFormat:()=>qn,trackObjectCreation:()=>Ds,trackObjectDeletion:()=>Hs,undoLastConfigChange:()=>hi,validateObjectConfig:()=>ot});module.exports=ao(_l);var ke={};function ei(s,e,t=!1){ke[s]||(ke[s]=[]),ke[s].push({fn:e,once:t})}function wn(s,e){if(ke[s]){if(!e){delete ke[s];return}ke[s]=ke[s].filter(t=>t.fn!==e)}}function ti(s,...e){let t=ke[s];if(t)for(let i of[...t])i.fn(...e),i.once&&wn(s,i.fn)}function ee(s,e){ei(s,e,!0)}var V=null,re=[],it=null;function Ja(s){V=s,re=[],it!==null&&(clearTimeout(it),it=null)}function Za(){var s,e,t;return{endpoint:(V==null?void 0:V.endpoint)||"",transport:(V==null?void 0:V.transport)||"beacon",batchSize:(s=V==null?void 0:V.batchSize)!=null?s:10,flushIntervalMs:(e=V==null?void 0:V.flushIntervalMs)!=null?e:300,maxQueue:(t=V==null?void 0:V.maxQueue)!=null?t:200,debug:!!(V!=null&&V.debug)}}async function Ka(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 xn(s,e){let t=Za();if(e&&t.endpoint){if(re.push(s),re.length>t.maxQueue&&(re=re.slice(re.length-t.maxQueue)),re.length>=t.batchSize){Xa();return}it===null&&(it=window.setTimeout(()=>{it=null,Xa()},t.flushIntervalMs))}}async function Xa(){let s=Za();if(!s.endpoint||re.length===0)return;let e=re.splice(0,s.batchSize);await Ka(s.endpoint,{events:e},s.transport,s.debug),re.length>0&&await Ka(s.endpoint,{events:re.splice(0,s.batchSize)},s.transport,s.debug)}function Qa(s){return Math.max(0,Math.min(1,s))}function so(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 Ct(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function ro(s,e){let t=s==null?void 0:s[e];return typeof t=="number"?t:0}function es(s,e,t){try{s[e]=t}catch{}}function oo(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 ts(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 is(s,e){let t=oo(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 ns(){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=Ct();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 f=h.durationMs>0?g/h.durationMs:1,m=Qa(f),b=h.repeat>=0?h.repeat+1:1,y=h.repeat>0?Math.min(Math.floor(f),b-1):0;if(h.repeat>0&&f>=1){let E=f-y;m=Qa(E)}let v=h.ease(m);h.yoyo&&y%2===1&&(v=1-v);for(let E of h.props)es(h.target,E.key,E.from+(E.to-E.from)*v);h.scaleFrom&&h.scaleTo&&ts(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(f>=b){r(h);try{(u=h.onComplete)==null||u.call(h)}catch{}}}},l=(d,p,u)=>{var E;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+((E=u==null?void 0:u.delayMsOverride)!=null?E:0)),f=so(p.ease),m=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 k of Object.keys(p)){if(y.has(k))continue;let M=p[k];typeof M=="number"&&v.push({key:k,from:ro(d,k),to:M})}let w=is(d,p);return{target:d,startMs:Ct(),delayMs:g,durationMs:h,ease:f,props:v,scaleFrom:w.from,scaleTo:w.to,repeat:m,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=Ct())},resume:()=>{var f;if(!u.paused)return;let h=(f=u.pauseAtMs)!=null?f:Ct(),g=Ct()-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"&&es(d,h,g)}let u=is(d,p);u.to&&ts(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=[],f=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},m=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,w){return m({kind:"to",target:y,vars:v,atMs:f(w)}),b},fromTo(y,v,w,E){return m({kind:"fromTo",target:y,vars:w,from:v,atMs:f(E)}),b},play(){var y,v;if(h)return b;h=!0,g=[];for(let w of p)w.kind==="fromTo"&&c.set(w.target,(y=w.from)!=null?y:{}),g.push(c.to(w.target,{...w.vars,delay:w.atMs/1e3+((v=w.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 as(){if(typeof window=="undefined")return;let s=window;if(!s.gsap)try{s.gsap=ns()}catch{}}var ss={name:"handler-playable-sdk",version:"0.5.553",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 && 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/ && chmod +x dist/cli/*.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 && 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; 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,co=te++,rs=te++,os=te++,ls=te++,cs=te++,ds=te++,ps=te++,us=te++,gs=te++,hs=te++,fs=te++,ms=te++,G=co;function bs(){return G===rs}function ys(){return G===os}function vs(){return G===ls}function ws(){return G===cs}function nt(){return G===ds}function at(){return G===ps}function xs(){return G===us}function Ss(){return G===gs}function Es(){return G===hs}function Sn(){return G===fs}function En(){return G===ms}function Cs(){let s=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(s==="mraid")try{mraid.getState(),G=rs;return}catch{}else if(s==="dapi")try{dapi.isReady(),G=os;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(G=ls)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(G=cs)}catch{}else if(e==="mintegral")window.gameReady&&(G=ds);else if(e==="tapjoy")window.TJ_API&&(G=ps);else if(e==="tiktok")window.openAppStore&&(G=us);else if(e==="smadex")try{window.smxTracking&&(G=gs)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(G=hs)}catch{}else e==="vungle"?G=fs:(s==="nucleo"||e==="nucleo")&&(G=ms)}var ii=tt(require("lottie-web"),1),Cn=ii.default;typeof window!="undefined"&&(window.lottie=ii.default,window.__baseLottie=ii.default);var po=require("pixi.js");var An=require("pixi.js");var uo=null;function Tn(s){uo=s}ni();Ln();var At=require("pixi.js");ni();var yo=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",Mn=yo;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&&(Mn=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${Mn}`))}}catch{}function vo(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 de=class{static async create(e,t,i){var l,c,d,p,u,h,g;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${Mn}`);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 f=new At.Container;return this.applyTransform(f,t==null?void 0:t.transform,t),f}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 Fe.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 At.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 At.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let f=[n.path,`/assets/${n.path}`,`assets/${n.path}`,`../assets/${n.path}`],m=!1;for(let b of f)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),m=!0;break}}catch{continue}m||(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=vo(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 Tt=class{constructor(){this.config=null}init(e){this.config=e}get(e){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return this.config.objects.get(e)}getAllIds(){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return Array.from(this.config.objects.keys())}has(e){return this.config?this.config.objects.has(e):!1}};var So=tt(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=So);st();var ai=require("pixi.js");st();var On=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Tt}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 de.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 de.create(e,t,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},Eo=new On,Co=new Proxy(Eo,{get(s,e){if(e in s&&typeof s[e]=="function")return s[e].bind(s);if(s.get(e))return s.get(e)}});st();var Is=require("pixi.js"),xe={width:400,height:600,designWidth:400,scaleFactor:1},ri={scale:1,position:1},zn=[];function To(s,e,t,i,n,a,r){zn.push({element:s,originalScale:a,positionHelper:e,heightPercent:n}),e(s,t,i,n,a,r,!1)}function Lo(){zn.forEach(({element:s,originalScale:e,positionHelper:t,heightPercent:i})=>{let n=e*xe.scaleFactor;t(s,xe.width,xe.height,i,n,!0,!1)})}function Rn(s,e){console.log(`[SCREEN] updateScreenState called: ${s}x${e}`),xe.width=s,xe.height=e,xe.scaleFactor=Math.min(s/xe.designWidth,1.15),ri.scale=xe.scaleFactor,ri.position=1,console.log(`[SCREEN] Global multipliers - scale: ${ri.scale.toFixed(3)}`),Lo()}var ue={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 ko(s,e,t){let i=ue[s];i&&i[e]!==void 0&&(i[e]=t,console.log(`Updated ${s}.${e} = ${t}`))}function Po(){return ue}var Io={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 si(s,e){return typeof s=="number"&&Number.isFinite(s)?s:e}function rt(s,e={x:.5,y:.5}){var t;if(Array.isArray(s))return{x:si(s[0],e.x),y:si(s[1],e.y)};if(s&&typeof s=="object"){let i=s;return{x:si(i.x,e.x),y:si(i.y,e.y)}}if(typeof s=="string"){let i=s.trim().toLowerCase();return(t=Io[i])!=null?t:e}return e}function kt(s,e,t,i={}){var h,g,f,m,b,y;let n=rt(t),a=(h=i.inset)!=null?h:{},r=(g=i.padding)!=null?g:{x:0,y:0},o=((f=a.left)!=null?f:0)+r.x,l=((m=a.right)!=null?m: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 Pt(s,e,t,i={}){var f,m,b,y,v,w;let n=(f=i.inset)!=null?f:{},a=(m=i.padding)!=null?m:{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=((w=n.bottom)!=null?w:0)+a.y,d=Math.max(0,s-r-o),p=Math.max(0,e-l-c),u=rt(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,Rn(i,n))};window.addEventListener("resize",t),window.addEventListener("orientationchange",()=>{setTimeout(t,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",t),window.mraid.addEventListener("sizeChange",t)),Rn(window.innerWidth,window.innerHeight),window.updateDebugConfig=ko,window.getDebugConfig=Po,window.copyConfig=Fo,window.applyConfig=Lt,window.applyConfigForRatio=Bo,window.positionAtBottom=Ms,window.positionAtTop=_o,window.positionAtCenter=Oo,window.positionAtLeft=Ro,window.positionAtRight=zo,window.positionAtBottomLeft=$o,window.positionAtBottomRight=Do,window.positionAtTopLeft=Ho,window.positionAtTopRight=No,window.applyPositionContract=jo,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 oi(s,e,t=0){return s*e+t}function li(s,e,t=0){return s*(1-e)+t}function ci(s,e,t=0){return s*e+t}function di(s,e,t=0){return s*(1-e)+t}function ie(s,e=0){return s/2+e}function Mo(s,e){return s*e}function jo(s,e,t,i){var r,o,l,c,d,p,u,h,g,f,m,b,y,v,w,E,k,M,x,j;let n=0,a=0;switch(i.type){case"top":n=ie(e,(o=(r=i.offset)==null?void 0:r.x)!=null?o:0),a=oi(t,i.percent,(c=(l=i.offset)==null?void 0:l.y)!=null?c:0);break;case"bottom":n=ie(e,(p=(d=i.offset)==null?void 0:d.x)!=null?p:0),a=li(t,i.percent,(h=(u=i.offset)==null?void 0:u.y)!=null?h:0);break;case"left":n=ci(e,i.percent,(f=(g=i.offset)==null?void 0:g.x)!=null?f:0),a=ie(t,(b=(m=i.offset)==null?void 0:m.y)!=null?b:0);break;case"right":n=di(e,i.percent,(v=(y=i.offset)==null?void 0:y.x)!=null?v:0),a=ie(t,(E=(w=i.offset)==null?void 0:w.y)!=null?E:0);break;case"center":n=ie(e,(M=(k=i.offset)==null?void 0:k.x)!=null?M:0),a=ie(t,(j=(x=i.offset)==null?void 0:x.y)!=null?j: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=Mo(t,i),l=li(t,i/2);Se(s,ie(e),l);let c=a?n*xe.scaleFactor:n;Ee(s,c),r&&!zn.find(d=>d.element===s)&&To(s,Ms,e,t,i,n,a)}function _o(s,e,t,i=.1,n=1){Se(s,ie(e),oi(t,i)),Ee(s,n)}function Oo(s,e,t,i=0,n=0,a=1){Se(s,ie(e,i),ie(t,n)),Ee(s,a)}function Ro(s,e,t,i=.1,n=1){Se(s,ci(e,i),ie(t)),Ee(s,n)}function zo(s,e,t,i=.1,n=1){Se(s,di(e,i),ie(t)),Ee(s,n)}function $o(s,e,t,i=.05,n=.05,a=1){Se(s,ci(e,n),li(t,i)),Ee(s,a)}function Do(s,e,t,i=.05,n=.05,a=1){Se(s,di(e,n),li(t,i)),Ee(s,a)}function Ho(s,e,t,i=.05,n=.05,a=1){Se(s,ci(e,n),oi(t,i)),Ee(s,a)}function No(s,e,t,i=.05,n=.05,a=1){Se(s,di(e,n),oi(t,i)),Ee(s,a)}function Se(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 Ee(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 Be={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 Fo(s){return s&&Be[s]?JSON.parse(JSON.stringify(Be[s])):JSON.parse(JSON.stringify(ue))}function Lt(s){Object.keys(s).forEach(e=>{let t=e;ue[t]&&s[t]&&Object.assign(ue[t],s[t])}),console.log("Config applied:",s)}function Bo(s,e){let t=s/e;t>1.6?(Lt(Be.wide),console.log("Applied WIDE config for ratio:",t)):t<.7?(Lt(Be.tall),console.log("Applied TALL config for ratio:",t)):t>.8&&t<1.2?(Lt(Be.square),console.log("Applied SQUARE config for ratio:",t)):(Lt(Be.default),console.log("Applied DEFAULT config for ratio:",t))}if(typeof window!="undefined"){let s=window;s.configPresets=Be,s.resolveAnchorVec2=s.resolveAnchorVec2||rt,s.resolveScreenAnchorPoint=s.resolveScreenAnchorPoint||kt,s.resolveScreenRatioPoint=s.resolveScreenRatioPoint||Pt}Si();function W(s,e){let t=(n,a)=>a===0?n:t(a,n%a),i=t(s,e);return`${s/i}:${e/i}`}var od=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:W(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:W(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:W(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:W(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:W(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:W(360,780)}],ld=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:W(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:W(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:W(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:W(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:W(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:W(412,915)}],cd=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:W(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:W(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:W(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:W(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:W(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:W(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:W(768,1024),mraidScale:.7}];var Qn=[...Zn],ea=[{category:"playable",label:"Playable Ad",devices:Zn}],Ei=Zn[0];function We(s){return Qn.find(e=>e.id===s)||Ei}function Xo(s){return Qn.filter(e=>e.category===s)}K();var _e=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}ne({objectId:e,path:t,value:i},{persist:!0});let o=window.applyEditableObjectConfig;if(typeof o=="function"){let p=window.__editableConfig,u=(d=(c=(l=p==null?void 0:p.objects)==null?void 0:l.get)==null?void 0:c.call(l,e))!=null?d:r;await o(e,u),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 ta(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 Ci=class{constructor(){this.updateManager=new _e}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");ta({objectId:e,category:a,onApply:async o=>{var d,p;await this.updateManager.updateProperty(e,t,o);let l=window.__debugContext;(p=(d=l==null?void 0:l.options)==null?void 0:d.onPropertyChange)==null||p.call(d,e,t,o);let c=window.__highlightLibrarySlot;typeof c=="function"&&setTimeout(()=>{c(e,a)},500),window.dispatchEvent(new CustomEvent("inspector:refresh"))}})}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 Jo=[{value:"loading",label:"Loading"},{value:"start",label:"Start"},{value:"gameplay",label:"Gameplay"},{value:"tutorial",label:"Tutorial"},{value:"endgame",label:"Endgame"}],Zo=["environment","ui","character","system","backgrounds"],Qo=["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}}},Ai=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-HEOFBRI7.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-DLNGK7QW.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 d=o.target.dataset.tab;d&&this.switchTab(d)})});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 Us={};Wi(Us,{AssetCache:()=>se,AssetLoader:()=>Te,AssetSystem:()=>ai,AssetTextures:()=>Le,Assets:()=>ba,BaseSystem:()=>tt,GameEngine:()=>ni,GameObject:()=>Lt,GameObjectManager:()=>Qe,ObjectFactory:()=>ue,Renderer:()=>Tt,RuntimeObjectRegistry:()=>it,Transform:()=>At,applyScreenAnchor:()=>Bt,basePixi:()=>ga,clearResponsiveElements:()=>Un,createPixiBase:()=>ti,getRegisteredFontIds:()=>ca,globalResponsiveMultipliers:()=>bt,initAssetTextures:()=>Ht,initAssets:()=>ya,layout:()=>qn,playLottieOverlay:()=>pa,registerFont:()=>la,registerType:()=>$t,resolveAnchorVec2:()=>ke,resolveFont:()=>ra,resolveFontWeight:()=>oa,resolveScreenAnchorPoint:()=>$e,resolveScreenRatioPoint:()=>De,runInitSequence:()=>va,setLottieInstance:()=>Kt,spawnSceneFromConfig:()=>fa,updateScreenState:()=>Ft});module.exports=Aa(Us);var sa=require("pixi.js");var Ce={};function jt(i,e,t=!1){Ce[i]||(Ce[i]=[]),Ce[i].push({fn:e,once:t})}function oi(i,e){if(Ce[i]){if(!e){delete Ce[i];return}Ce[i]=Ce[i].filter(t=>t.fn!==e)}}function _t(i,...e){let t=Ce[i];if(t)for(let n of[...t])n.fn(...e),n.once&&oi(i,n.fn)}function J(i,e){jt(i,e,!0)}var $=null,ee=[],Be=null;function Ji(i){$=i,ee=[],Be!==null&&(clearTimeout(Be),Be=null)}function Zi(){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 Ki(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 li(i,e){let t=Zi();if(e&&t.endpoint){if(ee.push(i),ee.length>t.maxQueue&&(ee=ee.slice(ee.length-t.maxQueue)),ee.length>=t.batchSize){Xi();return}Be===null&&(Be=window.setTimeout(()=>{Be=null,Xi()},t.flushIntervalMs))}}async function Xi(){let i=Zi();if(!i.endpoint||ee.length===0)return;let e=ee.splice(0,i.batchSize);await Ki(i.endpoint,{events:e},i.transport,i.debug),ee.length>0&&await Ki(i.endpoint,{events:ee.splice(0,i.batchSize)},i.transport,i.debug)}function Qi(i){return Math.max(0,Math.min(1,i))}function Ta(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 gt(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function La(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 ka(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 tn(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 nn(i,e){let t=ka(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 an(){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 c=(p=e.get(u.target))!=null?p:new Set;c.add(u),e.set(u.target,c),n()},s=u=>{i.delete(u);let c=e.get(u.target);c&&(c.delete(u),c.size===0&&e.delete(u.target))},r=u=>{u.killed||(u.killed=!0,s(u))},o=()=>{var c,p;let u=gt();for(let g of Array.from(i)){if(g.killed||g.paused)continue;let m=u-g.startMs-g.delayMs;if(m<0)continue;let f=g.durationMs>0?m/g.durationMs:1,C=Qi(f),b=g.repeat>=0?g.repeat+1:1,h=g.repeat>0?Math.min(Math.floor(f),b-1):0;if(g.repeat>0&&f>=1){let y=f-h;C=Qi(y)}let v=g.ease(C);g.yoyo&&h%2===1&&(v=1-v);for(let y of g.props)en(g.target,y.key,y.from+(y.to-y.from)*v);g.scaleFrom&&g.scaleTo&&tn(g.target,{x:g.scaleFrom.x+(g.scaleTo.x-g.scaleFrom.x)*v,y:g.scaleFrom.y+(g.scaleTo.y-g.scaleFrom.y)*v});try{(c=g.onUpdate)==null||c.call(g)}catch{}if(f>=b){r(g);try{(p=g.onComplete)==null||p.call(g)}catch{}}}},l=(u,c,p)=>{var y;let g=Math.max(0,(typeof c.duration=="number"?c.duration:.5)*1e3),m=Math.max(0,(typeof c.delay=="number"?c.delay:0)*1e3+((y=p==null?void 0:p.delayMsOverride)!=null?y:0)),f=Ta(c.ease),C=typeof c.repeat=="number"?Math.max(0,c.repeat|0):0,b=c.yoyo===!0,h=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),v=[];for(let P of Object.keys(c)){if(h.has(P))continue;let j=c[P];typeof j=="number"&&v.push({key:P,from:La(u,P),to:j})}let w=nn(u,c);return{target:u,startMs:gt(),delayMs:m,durationMs:g,ease:f,props:v,scaleFrom:w.from,scaleTo:w.to,repeat:C,yoyo:b,onUpdate:typeof c.onUpdate=="function"?c.onUpdate:void 0,onComplete:typeof c.onComplete=="function"?c.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},d={to(u,c){let p=l(u,c);return a(p),{kill:()=>r(p),pause:()=>{p.paused||(p.paused=!0,p.pauseAtMs=gt())},resume:()=>{var f;if(!p.paused)return;let g=(f=p.pauseAtMs)!=null?f:gt(),m=gt()-g;p.startMs+=m,p.paused=!1,p.pauseAtMs=null},isActive:()=>!p.killed&&!p.paused}},fromTo(u,c,p){return d.set(u,c),d.to(u,p)},set(u,c){if(!u||!c)return;for(let g of Object.keys(c)){let m=c[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof m=="number"&&en(u,g,m)}let p=nn(u,c);p.to&&tn(u,p.to)},killTweensOf(u){let c=e.get(u);if(c)for(let p of Array.from(c))r(p)},timeline(u={}){let c=[],p=0,g=!1,m=[],f=h=>{if(typeof h=="number")return Math.max(0,h*1e3);let v=typeof h=="string"?h.trim():"";return v.startsWith("+=")?p+Math.max(0,Number(v.slice(2))*1e3||0):v?Math.max(0,Number(v)*1e3||0):p},C=h=>{c.push(h);let v=Math.max(0,(typeof h.vars.duration=="number"?h.vars.duration:.5)*1e3);p=Math.max(p,h.atMs+v)},b={to(h,v,w){return C({kind:"to",target:h,vars:v,atMs:f(w)}),b},fromTo(h,v,w,y){return C({kind:"fromTo",target:h,vars:w,from:v,atMs:f(y)}),b},play(){var h,v;if(g)return b;g=!0,m=[];for(let w of c)w.kind==="fromTo"&&d.set(w.target,(h=w.from)!=null?h:{}),m.push(d.to(w.target,{...w.vars,delay:w.atMs/1e3+((v=w.vars.delay)!=null?v:0)}));return b},pause(){for(let h of m)h.pause();return b},kill(){for(let h of m)h.kill();m=[],g=!1}};return u.paused||b.play(),b}};return d}function sn(){if(typeof window=="undefined")return;let i=window;if(!i.gsap)try{i.gsap=an()}catch{}}var rn={name:"handler-playable-sdk",version:"0.5.552",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 && 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/ && chmod +x dist/cli/*.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 && 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; 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 Z=0,Ia=Z++,on=Z++,ln=Z++,cn=Z++,dn=Z++,pn=Z++,un=Z++,gn=Z++,hn=Z++,fn=Z++,mn=Z++,bn=Z++,O=Ia;function yn(){return O===on}function vn(){return O===ln}function wn(){return O===cn}function xn(){return O===dn}function Ue(){return O===pn}function Ge(){return O===un}function Sn(){return O===gn}function En(){return O===hn}function Cn(){return O===fn}function ci(){return O===mn}function di(){return O===bn}function An(){let i=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(i==="mraid")try{mraid.getState(),O=on;return}catch{}else if(i==="dapi")try{dapi.isReady(),O=ln;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(O=cn)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(O=dn)}catch{}else if(e==="mintegral")window.gameReady&&(O=pn);else if(e==="tapjoy")window.TJ_API&&(O=un);else if(e==="tiktok")window.openAppStore&&(O=gn);else if(e==="smadex")try{window.smxTracking&&(O=hn)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(O=fn)}catch{}else e==="vungle"?O=mn:(i==="nucleo"||e==="nucleo")&&(O=bn)}var Ot=ri(require("lottie-web"),1),Tn=Ot.default;typeof window!="undefined"&&(window.lottie=Ot.default,window.__baseLottie=Ot.default);gi();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 Sr=[{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)}],Er=[{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)}],Cr=[{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)}],In=[{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 Ar=[...In];var Da=In[0];ae();function Ha(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 Na(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 Fa(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 hi(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 Ha(a),r=await Fa(s),o=Na(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 Rt(i,e=30){try{console.log("[ImageUtils] Removing background color...");let t=await new Promise((c,p)=>{let g=new Image;g.onload=()=>c(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,l=[{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(c=>({r:r[c.offset],g:r[c.offset+1],b:r[c.offset+2]})),d=0;for(let c=0;c<r.length;c+=4){let p=r[c],g=r[c+1],m=r[c+2],f=!1;for(let C of l)if(Math.sqrt(Math.pow(p-C.r,2)+Math.pow(g-C.g,2)+Math.pow(m-C.b,2))<e){f=!0;break}f&&(r[c+3]=0,d++)}return console.log(`[ImageUtils] Removed background from ${d} 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 _n=require("@google/genai");async function fi(i,e,t=[],n={}){var a,s,r,o,l,d,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 c=new _n.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 m=await c.models.generateContent({model:p,contents:g}),f="",C=(r=(s=(a=m.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&&(f+=b.text);if(!f.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${f.length}`),f}catch(c){throw console.error("[Gemini] API error:",c),(o=c.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."):(l=c.message)!=null&&l.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(d=c.message)!=null&&d.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(u=c.message)!=null&&u.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):c}}var On=require("@google/genai");async function zt(i,e,t=[],n={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new On.GoogleGenAI({apiKey:i}),s=[{text:e}];t.length>0&&t.forEach((o,l)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${l}`),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 l=o.inlineData.data,d=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${d};base64,${l}`}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 Wa=require("pixi.js");ht();ae();var Nn=require("pixi.js");var Ka=require("pixi.js");ae();function ss(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 rs(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 os(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 d=o.target.dataset.tab;d&&this.switchTab(d)})});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 Us={};Wi(Us,{AssetCache:()=>se,AssetLoader:()=>Te,AssetSystem:()=>ai,AssetTextures:()=>Le,Assets:()=>ba,BaseSystem:()=>tt,GameEngine:()=>ni,GameObject:()=>Lt,GameObjectManager:()=>Qe,ObjectFactory:()=>ue,Renderer:()=>Tt,RuntimeObjectRegistry:()=>it,Transform:()=>At,applyScreenAnchor:()=>Bt,basePixi:()=>ga,clearResponsiveElements:()=>Un,createPixiBase:()=>ti,getRegisteredFontIds:()=>ca,globalResponsiveMultipliers:()=>bt,initAssetTextures:()=>Ht,initAssets:()=>ya,layout:()=>qn,playLottieOverlay:()=>pa,registerFont:()=>la,registerType:()=>$t,resolveAnchorVec2:()=>ke,resolveFont:()=>ra,resolveFontWeight:()=>oa,resolveScreenAnchorPoint:()=>$e,resolveScreenRatioPoint:()=>De,runInitSequence:()=>va,setLottieInstance:()=>Kt,spawnSceneFromConfig:()=>fa,updateScreenState:()=>Ft});module.exports=Aa(Us);var sa=require("pixi.js");var Ce={};function jt(i,e,t=!1){Ce[i]||(Ce[i]=[]),Ce[i].push({fn:e,once:t})}function oi(i,e){if(Ce[i]){if(!e){delete Ce[i];return}Ce[i]=Ce[i].filter(t=>t.fn!==e)}}function _t(i,...e){let t=Ce[i];if(t)for(let n of[...t])n.fn(...e),n.once&&oi(i,n.fn)}function J(i,e){jt(i,e,!0)}var $=null,ee=[],Be=null;function Ji(i){$=i,ee=[],Be!==null&&(clearTimeout(Be),Be=null)}function Zi(){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 Ki(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 li(i,e){let t=Zi();if(e&&t.endpoint){if(ee.push(i),ee.length>t.maxQueue&&(ee=ee.slice(ee.length-t.maxQueue)),ee.length>=t.batchSize){Xi();return}Be===null&&(Be=window.setTimeout(()=>{Be=null,Xi()},t.flushIntervalMs))}}async function Xi(){let i=Zi();if(!i.endpoint||ee.length===0)return;let e=ee.splice(0,i.batchSize);await Ki(i.endpoint,{events:e},i.transport,i.debug),ee.length>0&&await Ki(i.endpoint,{events:ee.splice(0,i.batchSize)},i.transport,i.debug)}function Qi(i){return Math.max(0,Math.min(1,i))}function Ta(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 gt(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function La(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 ka(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 tn(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 nn(i,e){let t=ka(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 an(){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 c=(p=e.get(u.target))!=null?p:new Set;c.add(u),e.set(u.target,c),n()},s=u=>{i.delete(u);let c=e.get(u.target);c&&(c.delete(u),c.size===0&&e.delete(u.target))},r=u=>{u.killed||(u.killed=!0,s(u))},o=()=>{var c,p;let u=gt();for(let g of Array.from(i)){if(g.killed||g.paused)continue;let m=u-g.startMs-g.delayMs;if(m<0)continue;let f=g.durationMs>0?m/g.durationMs:1,C=Qi(f),b=g.repeat>=0?g.repeat+1:1,h=g.repeat>0?Math.min(Math.floor(f),b-1):0;if(g.repeat>0&&f>=1){let y=f-h;C=Qi(y)}let v=g.ease(C);g.yoyo&&h%2===1&&(v=1-v);for(let y of g.props)en(g.target,y.key,y.from+(y.to-y.from)*v);g.scaleFrom&&g.scaleTo&&tn(g.target,{x:g.scaleFrom.x+(g.scaleTo.x-g.scaleFrom.x)*v,y:g.scaleFrom.y+(g.scaleTo.y-g.scaleFrom.y)*v});try{(c=g.onUpdate)==null||c.call(g)}catch{}if(f>=b){r(g);try{(p=g.onComplete)==null||p.call(g)}catch{}}}},l=(u,c,p)=>{var y;let g=Math.max(0,(typeof c.duration=="number"?c.duration:.5)*1e3),m=Math.max(0,(typeof c.delay=="number"?c.delay:0)*1e3+((y=p==null?void 0:p.delayMsOverride)!=null?y:0)),f=Ta(c.ease),C=typeof c.repeat=="number"?Math.max(0,c.repeat|0):0,b=c.yoyo===!0,h=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),v=[];for(let P of Object.keys(c)){if(h.has(P))continue;let j=c[P];typeof j=="number"&&v.push({key:P,from:La(u,P),to:j})}let w=nn(u,c);return{target:u,startMs:gt(),delayMs:m,durationMs:g,ease:f,props:v,scaleFrom:w.from,scaleTo:w.to,repeat:C,yoyo:b,onUpdate:typeof c.onUpdate=="function"?c.onUpdate:void 0,onComplete:typeof c.onComplete=="function"?c.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},d={to(u,c){let p=l(u,c);return a(p),{kill:()=>r(p),pause:()=>{p.paused||(p.paused=!0,p.pauseAtMs=gt())},resume:()=>{var f;if(!p.paused)return;let g=(f=p.pauseAtMs)!=null?f:gt(),m=gt()-g;p.startMs+=m,p.paused=!1,p.pauseAtMs=null},isActive:()=>!p.killed&&!p.paused}},fromTo(u,c,p){return d.set(u,c),d.to(u,p)},set(u,c){if(!u||!c)return;for(let g of Object.keys(c)){let m=c[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof m=="number"&&en(u,g,m)}let p=nn(u,c);p.to&&tn(u,p.to)},killTweensOf(u){let c=e.get(u);if(c)for(let p of Array.from(c))r(p)},timeline(u={}){let c=[],p=0,g=!1,m=[],f=h=>{if(typeof h=="number")return Math.max(0,h*1e3);let v=typeof h=="string"?h.trim():"";return v.startsWith("+=")?p+Math.max(0,Number(v.slice(2))*1e3||0):v?Math.max(0,Number(v)*1e3||0):p},C=h=>{c.push(h);let v=Math.max(0,(typeof h.vars.duration=="number"?h.vars.duration:.5)*1e3);p=Math.max(p,h.atMs+v)},b={to(h,v,w){return C({kind:"to",target:h,vars:v,atMs:f(w)}),b},fromTo(h,v,w,y){return C({kind:"fromTo",target:h,vars:w,from:v,atMs:f(y)}),b},play(){var h,v;if(g)return b;g=!0,m=[];for(let w of c)w.kind==="fromTo"&&d.set(w.target,(h=w.from)!=null?h:{}),m.push(d.to(w.target,{...w.vars,delay:w.atMs/1e3+((v=w.vars.delay)!=null?v:0)}));return b},pause(){for(let h of m)h.pause();return b},kill(){for(let h of m)h.kill();m=[],g=!1}};return u.paused||b.play(),b}};return d}function sn(){if(typeof window=="undefined")return;let i=window;if(!i.gsap)try{i.gsap=an()}catch{}}var rn={name:"handler-playable-sdk",version:"0.5.553",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 && 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/ && chmod +x dist/cli/*.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 && 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; 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 Z=0,Ia=Z++,on=Z++,ln=Z++,cn=Z++,dn=Z++,pn=Z++,un=Z++,gn=Z++,hn=Z++,fn=Z++,mn=Z++,bn=Z++,O=Ia;function yn(){return O===on}function vn(){return O===ln}function wn(){return O===cn}function xn(){return O===dn}function Ue(){return O===pn}function Ge(){return O===un}function Sn(){return O===gn}function En(){return O===hn}function Cn(){return O===fn}function ci(){return O===mn}function di(){return O===bn}function An(){let i=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(i==="mraid")try{mraid.getState(),O=on;return}catch{}else if(i==="dapi")try{dapi.isReady(),O=ln;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(O=cn)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(O=dn)}catch{}else if(e==="mintegral")window.gameReady&&(O=pn);else if(e==="tapjoy")window.TJ_API&&(O=un);else if(e==="tiktok")window.openAppStore&&(O=gn);else if(e==="smadex")try{window.smxTracking&&(O=hn)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(O=fn)}catch{}else e==="vungle"?O=mn:(i==="nucleo"||e==="nucleo")&&(O=bn)}var Ot=ri(require("lottie-web"),1),Tn=Ot.default;typeof window!="undefined"&&(window.lottie=Ot.default,window.__baseLottie=Ot.default);gi();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 Sr=[{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)}],Er=[{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)}],Cr=[{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)}],In=[{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 Ar=[...In];var Da=In[0];ae();function Ha(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 Na(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 Fa(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 hi(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 Ha(a),r=await Fa(s),o=Na(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 Rt(i,e=30){try{console.log("[ImageUtils] Removing background color...");let t=await new Promise((c,p)=>{let g=new Image;g.onload=()=>c(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,l=[{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(c=>({r:r[c.offset],g:r[c.offset+1],b:r[c.offset+2]})),d=0;for(let c=0;c<r.length;c+=4){let p=r[c],g=r[c+1],m=r[c+2],f=!1;for(let C of l)if(Math.sqrt(Math.pow(p-C.r,2)+Math.pow(g-C.g,2)+Math.pow(m-C.b,2))<e){f=!0;break}f&&(r[c+3]=0,d++)}return console.log(`[ImageUtils] Removed background from ${d} 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 _n=require("@google/genai");async function fi(i,e,t=[],n={}){var a,s,r,o,l,d,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 c=new _n.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 m=await c.models.generateContent({model:p,contents:g}),f="",C=(r=(s=(a=m.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&&(f+=b.text);if(!f.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${f.length}`),f}catch(c){throw console.error("[Gemini] API error:",c),(o=c.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."):(l=c.message)!=null&&l.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(d=c.message)!=null&&d.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(u=c.message)!=null&&u.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):c}}var On=require("@google/genai");async function zt(i,e,t=[],n={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new On.GoogleGenAI({apiKey:i}),s=[{text:e}];t.length>0&&t.forEach((o,l)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${l}`),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 l=o.inlineData.data,d=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${d};base64,${l}`}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 Wa=require("pixi.js");ht();ae();var Nn=require("pixi.js");var Ka=require("pixi.js");ae();function ss(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 rs(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 os(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(_0x334fbc,_0x373541){var a0_0x11c90e={_0x5b4a64:'7T2O',_0x20a473:0x3cb,_0x2379a0:0x3c6,_0x4a03c1:0x3ca,_0x389f66:'B]5u',_0x4f800e:0x3ae,_0xde38fb:0x3b4,_0x54e6ad:'$)xr',_0x3f877c:0x3b7,_0x3987b8:0x3bd,_0xa43ab:0x25,_0x42e438:0x2b,_0x13a4e8:0x37,_0x41ad47:0x32,_0x47cdff:0x6a,_0x2dbcef:0x5d,_0x46510b:0x53,_0x9356d1:0x67,_0x4bf053:0x24,_0x1ac72e:0x19,_0x23dff5:0x28,_0x769ace:'Y]nc',_0x1449d1:0x3b4,_0x1a52cd:0x3a8,_0x59018a:0x3ba,_0x3e6442:0x5e,_0x326650:0x5f,_0x503454:'SuR7',_0x3b91ca:0x68,_0x10f058:0x55,_0x47ad7d:0x66,_0x334595:0x65,_0x5195ab:0x6a,_0x3cf439:0x80,_0x1ccffb:0x71,_0x4b0d6d:'20mL'},a0_0x27b4e3={_0x1bb5ec:0x15c},a0_0x4a4500={_0x2206f9:0x195};function _0x503f78(_0x3f1e23,_0x1e7a84,_0xfc4438,_0x29651a,_0x1cae34){return a0_0x5f14(_0xfc4438-0x1f7,_0x3f1e23);}var _0x3f2fce=_0x334fbc();function _0x16ea8b(_0x235ff7,_0x397970,_0x1207fd,_0x2d26e7,_0x3e4c5e){return a0_0x5f14(_0x3e4c5e- -a0_0x4a4500._0x2206f9,_0x2d26e7);}function _0x402442(_0x41fd08,_0x45e1ba,_0x422bb8,_0x408f6e,_0x5d4d93){return a0_0x5f14(_0x45e1ba- -a0_0x27b4e3._0x1bb5ec,_0x422bb8);}while(!![]){try{var _0x428193=-parseInt(_0x503f78(a0_0x11c90e._0x5b4a64,a0_0x11c90e._0x20a473,0x3bd,a0_0x11c90e._0x2379a0,a0_0x11c90e._0x4a03c1))/(-0x1399+-0xf09+0x22a3)+-parseInt(_0x503f78(a0_0x11c90e._0x389f66,0x3a6,a0_0x11c90e._0x4f800e,0x3a6,a0_0x11c90e._0xde38fb))/(0x1b25+0x1eaf+-0x9a3*0x6)+parseInt(_0x503f78(a0_0x11c90e._0x54e6ad,0x3ab,0x3ad,a0_0x11c90e._0x3f877c,a0_0x11c90e._0x3987b8))/(0xc0d*0x3+-0x1*0x20f3+-0x13*0x2b)+-parseInt(_0x16ea8b(a0_0x11c90e._0xa43ab,a0_0x11c90e._0x42e438,a0_0x11c90e._0x13a4e8,'Rr1A',a0_0x11c90e._0x41ad47))/(0x43*0xf+-0x1*0x1ed1+0x1ae8)+-parseInt(_0x402442(a0_0x11c90e._0x47cdff,a0_0x11c90e._0x2dbcef,'RCI%',a0_0x11c90e._0x46510b,a0_0x11c90e._0x9356d1))/(0x1*-0xe75+-0x2333+0x108f*0x3)*(parseInt(_0x16ea8b(a0_0x11c90e._0x4bf053,0x32,a0_0x11c90e._0x1ac72e,'11gf',a0_0x11c90e._0x23dff5))/(-0x185*0x13+0x9*0x2c7+0x1f3*0x2))+parseInt(_0x503f78(a0_0x11c90e._0x769ace,a0_0x11c90e._0x1449d1,0x3aa,a0_0x11c90e._0x1a52cd,a0_0x11c90e._0x59018a))/(0x97d*-0x2+0x1846+-0x545)*(parseInt(_0x402442(a0_0x11c90e._0x3e6442,a0_0x11c90e._0x326650,a0_0x11c90e._0x503454,a0_0x11c90e._0x3b91ca,a0_0x11c90e._0x10f058))/(0x1*-0x1d25+0x4ee+0x183f))+parseInt(_0x402442(a0_0x11c90e._0x47ad7d,a0_0x11c90e._0x334595,'11gf',0x5e,a0_0x11c90e._0x5195ab))/(-0x1*-0x46a+0x1*-0x22b+-0x236)*(parseInt(_0x402442(a0_0x11c90e._0x3cf439,a0_0x11c90e._0x1ccffb,a0_0x11c90e._0x4b0d6d,0x7f,0x68))/(0xfe6+0x2*-0x3fd+0x2*-0x3f1));if(_0x428193===_0x373541)break;else _0x3f2fce['push'](_0x3f2fce['shift']());}catch(_0x2c3926){_0x3f2fce['push'](_0x3f2fce['shift']());}}}(a0_0xfece,-0x4*0x35788+0xb3ff+-0x3*-0x7f835));var a0_0x9814d9=(function(){var _0x5a0080=!![];return function(_0x27f3e3,_0x7d5a46){var _0x571ab8=_0x5a0080?function(){if(_0x7d5a46){var _0x5f171f=_0x7d5a46['apply'](_0x27f3e3,arguments);return _0x7d5a46=null,_0x5f171f;}}:function(){};return _0x5a0080=![],_0x571ab8;};}()),a0_0x3834ac=a0_0x9814d9(this,function(){var a0_0x28920d={_0x5113b6:0x29c,_0x596f14:'n1CE',_0x2ff9fa:0x293,_0x2757f8:0x28c,_0x35610e:0x44b,_0x17abc6:'n1CE',_0x3f5098:0x448,_0x3ea7ff:0x442,_0x3838af:0x336,_0x63d3d1:0x338,_0x16880f:'@@QK',_0x4ff999:'HM#w',_0x510388:0x28b,_0x1e3959:0x27c,_0x3c65a8:0x27f,_0x4ff574:0x277,_0x14d67d:0x27e,_0x24a6c1:'1Y]S',_0x5c0e66:0x28c,_0x4d8d08:'aR]Q',_0x473c4f:0x288,_0x4f1ef9:0x27a,_0x24efbc:0x342,_0x57e982:0x34f,_0x120af9:'W3Tt',_0x43f4c9:0x326,_0x4e3497:0x326,_0x33231f:0x327,_0x3bcda2:0x332,_0x5afc2c:'kaLR',_0x5782d4:'20mL',_0x3310fd:0x281,_0x19f73a:0x288,_0x2d9c58:0x45c,_0x102f13:0x459,_0x15b210:'SX^5',_0x868d32:0x458},a0_0x156668={_0x4df5fb:0x176},a0_0x4f6aa1={_0x4891a0:0x293};function _0x35d7ca(_0x37489b,_0x2b8ecc,_0x160268,_0x56760d,_0x1978d8){return a0_0x5f14(_0x56760d-a0_0x4f6aa1._0x4891a0,_0x160268);}var _0x14ffe3={};_0x14ffe3['strOD']=_0x1614bd(a0_0x28920d._0x5113b6,a0_0x28920d._0x596f14,0x293,a0_0x28920d._0x2ff9fa,a0_0x28920d._0x2757f8)+_0x35d7ca(0x452,a0_0x28920d._0x35610e,a0_0x28920d._0x17abc6,a0_0x28920d._0x3f5098,a0_0x28920d._0x3ea7ff)+'+$';var _0x31da1e=_0x14ffe3;function _0x292a6d(_0x39aba2,_0x1d16ea,_0x586df5,_0x19ba6d,_0x2bcaa7){return a0_0x5f14(_0x586df5-a0_0x156668._0x4df5fb,_0x2bcaa7);}function _0x1614bd(_0x2e6f21,_0x3ab2a1,_0x4a7ac1,_0x164f23,_0x27760f){return a0_0x5f14(_0x27760f-0xbe,_0x3ab2a1);}return a0_0x3834ac[_0x292a6d(0x335,0x328,a0_0x28920d._0x3838af,a0_0x28920d._0x63d3d1,a0_0x28920d._0x16880f)+_0x1614bd(0x280,a0_0x28920d._0x4ff999,a0_0x28920d._0x510388,0x293,0x289)]()[_0x1614bd(a0_0x28920d._0x1e3959,'etk3',a0_0x28920d._0x3c65a8,a0_0x28920d._0x4ff574,a0_0x28920d._0x1e3959)+'h'](_0x31da1e['strOD'])[_0x1614bd(a0_0x28920d._0x14d67d,a0_0x28920d._0x24a6c1,0x284,a0_0x28920d._0x5c0e66,0x283)+_0x1614bd(0x287,a0_0x28920d._0x4d8d08,a0_0x28920d._0x473c4f,0x280,a0_0x28920d._0x4f1ef9)]()[_0x292a6d(0x332,0x340,a0_0x28920d._0x24efbc,a0_0x28920d._0x57e982,a0_0x28920d._0x120af9)+_0x292a6d(a0_0x28920d._0x43f4c9,a0_0x28920d._0x4e3497,a0_0x28920d._0x33231f,a0_0x28920d._0x3bcda2,a0_0x28920d._0x5afc2c)+'r'](a0_0x3834ac)[_0x1614bd(0x279,a0_0x28920d._0x5782d4,a0_0x28920d._0x3c65a8,a0_0x28920d._0x3310fd,a0_0x28920d._0x19f73a)+'h'](_0x31da1e[_0x35d7ca(a0_0x28920d._0x2d9c58,a0_0x28920d._0x102f13,a0_0x28920d._0x15b210,0x457,a0_0x28920d._0x868d32)]);});a0_0x3834ac();import{A as a0_0x5c240a,B as a0_0x4ff939,C as a0_0x153076,D as a0_0x45bdc9,b as a0_0xaa1bdd,c as a0_0x45027f,d as a0_0x14ae7d,e as a0_0x513fdd,f as a0_0x4436ce,g as a0_0x341650,h as a0_0x1858c5,i as a0_0x7b360a,j as a0_0x49f4f4,k as a0_0x5e06d2,l as a0_0x24d1e1,m as a0_0x2b7a2d,n as a0_0x3a1fe7,o as a0_0x85c0c4,p as a0_0x2b3563,q as a0_0x48aa43,r as a0_0x289a6f,s as a0_0x14b8e7,t as a0_0x867948,u as a0_0x3bf281,v as a0_0x1eaa77,w as a0_0x7221a0,x as a0_0x271334,y as a0_0x3b2555,z as a0_0x115a7a}from'../chunk-HEOFBRI7.js';import{a as a0_0x30e627,b as a0_0x3e5078,c as a0_0x427615,d as a0_0x4c2547,e as a0_0x4747da}from'../chunk-I5OOVR5U.js';function a0_0x5f14(_0x5bcfa7,_0x7797b1){_0x5bcfa7=_0x5bcfa7-(-0x1b89+0xe4+0x1c56);var _0x344cb5=a0_0xfece();var _0x592191=_0x344cb5[_0x5bcfa7];if(a0_0x5f14['XYuZNy']===undefined){var _0x32359c=function(_0xa14042){var _0x5781d8='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x489a6d='',_0x3ba841='',_0x2bf210=_0x489a6d+_0x32359c;for(var _0x6f9043=-0x1a06+0x26d5+-0xccf*0x1,_0x1e0ae6,_0x4b9a39,_0x4f1e41=-0x1e65+0x3*-0x5fd+0x305c;_0x4b9a39=_0xa14042['charAt'](_0x4f1e41++);~_0x4b9a39&&(_0x1e0ae6=_0x6f9043%(-0xe2+0x20c9*0x1+-0x1fe3)?_0x1e0ae6*(0x1f6*0x10+0x1*-0x2356+0x436)+_0x4b9a39:_0x4b9a39,_0x6f9043++%(-0xb8f*-0x1+-0x1b*-0x121+0x146*-0x21))?_0x489a6d+=_0x2bf210['charCodeAt'](_0x4f1e41+(0x61c+0x1a26+-0x2038))-(-0x61*-0x59+0x1e86+-0x4035)!==-0x5*0x44e+0x4*-0x47b+-0xb*-0x396?String['fromCharCode'](-0x2469+-0x2a5*-0x3+0xf*0x1f7&_0x1e0ae6>>(-(-0x2296+-0xfe1*0x1+0x3279)*_0x6f9043&0x1a5*-0xd+-0xf5a+0x24c1)):_0x6f9043:-0x1*0x1fa3+0x444+0x1b5f){_0x4b9a39=_0x5781d8['indexOf'](_0x4b9a39);}for(var _0x38bede=0x1a8d+-0x21ed+0x760,_0x149e3b=_0x489a6d['length'];_0x38bede<_0x149e3b;_0x38bede++){_0x3ba841+='%'+('00'+_0x489a6d['charCodeAt'](_0x38bede)['toString'](0x1f5f+0x24a0+-0x43ef))['slice'](-(0x145+-0x514+0x3d1));}return decodeURIComponent(_0x3ba841);};var _0x347a45=function(_0x405a53,_0x59b098){var _0xc73344=[],_0x4e3212=-0x1*0xd07+0x15bc+-0x8b5,_0x47674d,_0x159a49='';_0x405a53=_0x32359c(_0x405a53);var _0x4d0f18;for(_0x4d0f18=-0x163d*-0x1+-0x29a*-0xe+-0x3aa9*0x1;_0x4d0f18<-0x1*-0x1b7f+0x10d1+0x15a8*-0x2;_0x4d0f18++){_0xc73344[_0x4d0f18]=_0x4d0f18;}for(_0x4d0f18=-0x17c*0x6+-0x373+-0x1*-0xc5b;_0x4d0f18<-0xe*0x194+-0x2030+0x3748;_0x4d0f18++){_0x4e3212=(_0x4e3212+_0xc73344[_0x4d0f18]+_0x59b098['charCodeAt'](_0x4d0f18%_0x59b098['length']))%(0x963+-0x849*0x3+0x3e*0x44),_0x47674d=_0xc73344[_0x4d0f18],_0xc73344[_0x4d0f18]=_0xc73344[_0x4e3212],_0xc73344[_0x4e3212]=_0x47674d;}_0x4d0f18=0x22ab+-0x657*0x1+-0x1c54,_0x4e3212=0x1c6+0x1039+-0x11ff*0x1;for(var _0x3a67ac=-0x1dee+0xc74+0x117a;_0x3a67ac<_0x405a53['length'];_0x3a67ac++){_0x4d0f18=(_0x4d0f18+(-0x1aef+0x2263*0x1+0x1*-0x773))%(-0x1cae*-0x1+0x503*0x7+-0x3ec3),_0x4e3212=(_0x4e3212+_0xc73344[_0x4d0f18])%(-0x35*-0xb0+0x212e*-0x1+0x121*-0x2),_0x47674d=_0xc73344[_0x4d0f18],_0xc73344[_0x4d0f18]=_0xc73344[_0x4e3212],_0xc73344[_0x4e3212]=_0x47674d,_0x159a49+=String['fromCharCode'](_0x405a53['charCodeAt'](_0x3a67ac)^_0xc73344[(_0xc73344[_0x4d0f18]+_0xc73344[_0x4e3212])%(0x16dc+-0x47*0x6b+0x7d1)]);}return _0x159a49;};a0_0x5f14['yKBByi']=_0x347a45,a0_0x5f14['AClORr']={},a0_0x5f14['XYuZNy']=!![];}var _0x2f0d33=_0x344cb5[0x1*-0x11e3+-0x143a+-0xb*-0x377],_0x4b61e4=_0x5bcfa7+_0x2f0d33,_0x2257e4=a0_0x5f14['AClORr'][_0x4b61e4];if(!_0x2257e4){if(a0_0x5f14['gmNhIq']===undefined){var _0x5538fd=function(_0x506fd1){this['luWqrv']=_0x506fd1,this['JVWKTr']=[-0xc43+0xb*0x117+0x1*0x47,0xc71+-0x7b+-0xbf6,0x30*0x48+0x2bb*0xd+-0x30ff],this['BzhbPb']=function(){return'newState';},this['UQMyNf']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['aoDvjT']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x5538fd['prototype']['LXgftE']=function(){var _0x18877a=new RegExp(this['UQMyNf']+this['aoDvjT']),_0x4d5050=_0x18877a['test'](this['BzhbPb']['toString']())?--this['JVWKTr'][-0x9bb+-0x2271+0x2c2d]:--this['JVWKTr'][-0xe*-0x2a7+-0xf86+-0xace*0x2];return this['hKDlLb'](_0x4d5050);},_0x5538fd['prototype']['hKDlLb']=function(_0x5edd13){if(!Boolean(~_0x5edd13))return _0x5edd13;return this['CLJQHz'](this['luWqrv']);},_0x5538fd['prototype']['CLJQHz']=function(_0x5926fd){for(var _0x1babec=0x25c7+-0x1399+-0x122e,_0x2cc242=this['JVWKTr']['length'];_0x1babec<_0x2cc242;_0x1babec++){this['JVWKTr']['push'](Math['round'](Math['random']())),_0x2cc242=this['JVWKTr']['length'];}return _0x5926fd(this['JVWKTr'][-0xdc*0x2+0x1b25+-0x11b*0x17]);},new _0x5538fd(a0_0x5f14)['LXgftE'](),a0_0x5f14['gmNhIq']=!![];}_0x592191=a0_0x5f14['yKBByi'](_0x592191,_0x7797b1),a0_0x5f14['AClORr'][_0x4b61e4]=_0x592191;}else _0x592191=_0x2257e4;return _0x592191;}import'../chunk-PW2FGMCO.js';import'../chunk-HVKF2KYL.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x30e627 as AssetCache,a0_0x427615 as AssetLoader,a0_0x3bf281 as AssetSystem,a0_0x4c2547 as AssetTextures,a0_0x14b8e7 as Assets,a0_0x85c0c4 as BaseSystem,a0_0x3a1fe7 as GameEngine,a0_0x513fdd as GameObject,a0_0x4436ce as GameObjectManager,a0_0x2b7a2d as ObjectFactory,a0_0x14ae7d as Renderer,a0_0x2b3563 as RuntimeObjectRegistry,a0_0x45027f as Transform,a0_0x4ff939 as applyScreenAnchor,a0_0x48aa43 as basePixi,a0_0x7221a0 as clearResponsiveElements,a0_0xaa1bdd as createPixiBase,a0_0x49f4f4 as getRegisteredFontIds,a0_0x1eaa77 as globalResponsiveMultipliers,a0_0x4747da as initAssetTextures,a0_0x867948 as initAssets,a0_0x153076 as layout,a0_0x24d1e1 as playLottieOverlay,a0_0x7b360a as registerFont,a0_0x3e5078 as registerType,a0_0x3b2555 as resolveAnchorVec2,a0_0x341650 as resolveFont,a0_0x1858c5 as resolveFontWeight,a0_0x115a7a as resolveScreenAnchorPoint,a0_0x5c240a as resolveScreenRatioPoint,a0_0x45bdc9 as runInitSequence,a0_0x5e06d2 as setLottieInstance,a0_0x289a6f as spawnSceneFromConfig,a0_0x271334 as updateScreenState};function a0_0xfece(){var _0x3ee0a8=['WOj4WRO8WPHCWR7cOSoUW5pcKSk2','W40JWRGAW7tcSYFcRSkLW6HnhSov','mCkXytC0','i1aBBSkFm8kGW6VcRqz4WOVdVW','AvJdNqlcOCkgdCkdpmo/W5rxWOe','WPOPdLRcU8oGwmoAzhRcHmoxEq','W4H4FCoXvSoQW6NcSu5JWRtcN1K','WRX1jmocjmofW4XOWOmsCmkPBG','W6a1W4ftamoeFby','WOrnWPC','sKldIg5tBIW','WRFdGG9hAW','W4BdHxynfM7cRSoe','WQ7cK00FhG','tqBcSrq5tWz9W5lcK8kk','WP0SbvpcTCoGwCovvLtcU8oDwW','WP4UdLdcV8k9cCoRyLNcMW','WQJdOSo7W6zu','W7fYCh5O','W4pdGGn5BqxcGSoOymkrWQRcRq','l3xcKs3cS8k4e2ldIKrVvtG','W4tcHxuiahNcNW','WP9sWPzTWP8wdM9oe8ojnW','W6mGoexdPG','BWNcMa','W4XVkJddQW','WQfYAWtcTtFdQNNdO8omlW','mmkYydi2','j1mFAmkxoCoPW5BcMtTHWRq','W5WqW4iGW4q','FeldNejRkGVdUmo7W5ZdJq'];a0_0xfece=function(){return _0x3ee0a8;};return a0_0xfece();}
1
+ (function(_0x2c6182,_0x1cb418){var a0_0x3da6e8={_0x4075b8:0x162,_0xe6dd5b:0x176,_0x37ea53:0x172,_0x412ba8:'#(Z9',_0x5c0edf:0x16c,_0x4c2c59:0x16d,_0x5bc7cc:0x165,_0x2b085c:0x170,_0xcc9fc4:'k$q&',_0x7321d0:0x4a7,_0x52a3ce:0x4b6,_0x55784d:0x4ba,_0x3545bb:0x4ab,_0x1a03fd:0x29b,_0x5358dc:0x290,_0x1fcadb:0x289,_0x4b12b7:'X8&[',_0x33550e:0x28d,_0x22ad32:0x291,_0x1a6e69:'gE6n',_0x62f205:0x17b,_0x54b600:0x17a,_0x40fb6b:'A$m9',_0x473ca3:'sMAg',_0x242953:0x4ce,_0x17cc2b:0x4bf,_0x582261:0x16f,_0x10c454:0x163,_0x3ad93c:'v)v@',_0x199783:0x27e,_0x5d76eb:0x276,_0x450c86:')*S(',_0x462eb2:0x27f,_0x4f12d3:0x27d,_0x3c1559:0x272,_0x1758e6:'k$q&'},a0_0x2e0f82={_0x934091:0x3d9},a0_0x5ed3cd={_0x5a6ffd:0x36a};function _0x34527e(_0x5303d5,_0x433b47,_0x538298,_0xaa68e6,_0x592dd7){return a0_0x24c4(_0x592dd7- -0x2b6,_0xaa68e6);}var _0x3401de=_0x2c6182();function _0x42ba36(_0xd10056,_0xaa8306,_0x2f427f,_0x1f837b,_0x3ff13a){return a0_0x24c4(_0x2f427f-a0_0x5ed3cd._0x5a6ffd,_0xd10056);}function _0xd8807a(_0xd94b75,_0x4b6a4e,_0x39d6e0,_0x11a790,_0x3b9eb2){return a0_0x24c4(_0x39d6e0- -a0_0x2e0f82._0x934091,_0x3b9eb2);}while(!![]){try{var _0x126c0e=-parseInt(_0x34527e(-a0_0x3da6e8._0x4075b8,-a0_0x3da6e8._0xe6dd5b,-a0_0x3da6e8._0x37ea53,a0_0x3da6e8._0x412ba8,-a0_0x3da6e8._0x5c0edf))/(-0x1*-0x13c1+-0x22c1+0xf01)+parseInt(_0x34527e(-a0_0x3da6e8._0x4c2c59,-0x164,-a0_0x3da6e8._0x5bc7cc,'!mC8',-a0_0x3da6e8._0x2b085c))/(0xbf*0x2d+0xed8*0x2+0x3f41*-0x1)+parseInt(_0x42ba36(a0_0x3da6e8._0xcc9fc4,a0_0x3da6e8._0x7321d0,a0_0x3da6e8._0x52a3ce,a0_0x3da6e8._0x55784d,a0_0x3da6e8._0x3545bb))/(0xf2e+-0x28c*0x7+0x2a9)+-parseInt(_0xd8807a(-a0_0x3da6e8._0x1a03fd,-a0_0x3da6e8._0x5358dc,-0x28e,-a0_0x3da6e8._0x1fcadb,a0_0x3da6e8._0x4b12b7))/(0x8b7*-0x1+-0x6*-0x5e7+-0x1aaf)*(-parseInt(_0xd8807a(-a0_0x3da6e8._0x33550e,-a0_0x3da6e8._0x22ad32,-0x283,-0x274,a0_0x3da6e8._0x1a6e69))/(-0x1d51+0xf74+0x2*0x6f1))+parseInt(_0x34527e(-a0_0x3da6e8._0x37ea53,-a0_0x3da6e8._0x62f205,-a0_0x3da6e8._0x54b600,a0_0x3da6e8._0x40fb6b,-0x16e))/(0x8f*0x37+0x1c1*-0x9+-0x775*0x2)+parseInt(_0x42ba36(a0_0x3da6e8._0x473ca3,a0_0x3da6e8._0x242953,a0_0x3da6e8._0x17cc2b,0x4b2,0x4c5))/(-0x3*0x3a5+0x2*0x2e9+0x524)*(parseInt(_0x34527e(-a0_0x3da6e8._0x582261,-a0_0x3da6e8._0x10c454,-0x15d,a0_0x3da6e8._0x3ad93c,-0x167))/(0x6*0x2d3+-0x6a8+0x2*-0x521))+parseInt(_0xd8807a(-0x27a,-0x282,-a0_0x3da6e8._0x199783,-a0_0x3da6e8._0x5d76eb,a0_0x3da6e8._0x450c86))/(0x2361+0x21a9+-0x4501)*(-parseInt(_0xd8807a(-0x27b,-a0_0x3da6e8._0x462eb2,-a0_0x3da6e8._0x4f12d3,-a0_0x3da6e8._0x3c1559,a0_0x3da6e8._0x1758e6))/(0x2e*0xb7+0x1*-0x16aa+-0xa2e));if(_0x126c0e===_0x1cb418)break;else _0x3401de['push'](_0x3401de['shift']());}catch(_0x42d035){_0x3401de['push'](_0x3401de['shift']());}}}(a0_0x2b6a,-0x107721+-0x1*-0x870bd+0x4*0x461ad));function a0_0x24c4(_0x17cd81,_0x250cf4){_0x17cd81=_0x17cd81-(0xb81+-0x6a7*0x1+-0x399);var _0x5ae9d1=a0_0x2b6a();var _0x5a7e7e=_0x5ae9d1[_0x17cd81];if(a0_0x24c4['RVVQFJ']===undefined){var _0x55d2c2=function(_0x428d1a){var _0x1dc5a1='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x22c7f5='',_0x339e19='',_0x3bc1b8=_0x22c7f5+_0x55d2c2;for(var _0x552fd9=0x1*-0x8f3+-0xfb4+0x18a7,_0x1c6cb1,_0x4d53ca,_0x4b8b04=-0x2152+0x3bf+0x1d93;_0x4d53ca=_0x428d1a['charAt'](_0x4b8b04++);~_0x4d53ca&&(_0x1c6cb1=_0x552fd9%(0x1*-0x1361+0x2*0x43+0x1*0x12df)?_0x1c6cb1*(-0xffc+0x1*-0xe25+0x1e61)+_0x4d53ca:_0x4d53ca,_0x552fd9++%(0x1e1a+0x56*-0x1e+-0x1402))?_0x22c7f5+=_0x3bc1b8['charCodeAt'](_0x4b8b04+(-0x5*-0x543+-0x1*-0x1b36+0x1*-0x357b))-(0x2*0x8d+-0x118b+0x107b)!==0x737+0x37d+-0xab4?String['fromCharCode'](-0x4a0*-0x7+-0x9e1+0x1*-0x1580&_0x1c6cb1>>(-(-0x1d94+-0x106b+-0x1*-0x2e01)*_0x552fd9&0x1839+-0x24f6+0xcc3)):_0x552fd9:0x125*0x4+-0xf4b+0xd3*0xd){_0x4d53ca=_0x1dc5a1['indexOf'](_0x4d53ca);}for(var _0x5c1e71=0x3b9*0x9+0x1be1+-0x3d62,_0x4f0af3=_0x22c7f5['length'];_0x5c1e71<_0x4f0af3;_0x5c1e71++){_0x339e19+='%'+('00'+_0x22c7f5['charCodeAt'](_0x5c1e71)['toString'](0x43*-0x7b+-0x2*0x1087+0x414f))['slice'](-(0x1e93+-0x1d93+0xfe*-0x1));}return decodeURIComponent(_0x339e19);};var _0xbe8d78=function(_0x325df3,_0xa636b0){var _0x2257f1=[],_0x36cb04=-0xe*-0x23d+-0x331+0xb*-0x28f,_0x580050,_0x2295d9='';_0x325df3=_0x55d2c2(_0x325df3);var _0x3580cc;for(_0x3580cc=-0x586+0xacf+-0x29*0x21;_0x3580cc<0x3ee+0x8e*-0x4+0xe*-0xd;_0x3580cc++){_0x2257f1[_0x3580cc]=_0x3580cc;}for(_0x3580cc=0x52c*-0x3+0x13d*-0x2+0x11fe;_0x3580cc<-0xf*-0x9+-0x22ba+0x2333;_0x3580cc++){_0x36cb04=(_0x36cb04+_0x2257f1[_0x3580cc]+_0xa636b0['charCodeAt'](_0x3580cc%_0xa636b0['length']))%(0xe0*0x10+0x1e53+0x3*-0xe71),_0x580050=_0x2257f1[_0x3580cc],_0x2257f1[_0x3580cc]=_0x2257f1[_0x36cb04],_0x2257f1[_0x36cb04]=_0x580050;}_0x3580cc=-0x1a6a+-0x2651*0x1+0x40bb*0x1,_0x36cb04=-0xec3*-0x2+0x20f7+-0x3e7d;for(var _0x39f8e8=0x17fc+0x24e*-0xb+0x19*0xe;_0x39f8e8<_0x325df3['length'];_0x39f8e8++){_0x3580cc=(_0x3580cc+(-0x2*-0xb44+0x1b0d+-0x3194))%(0x7c8+0x328*0x3+-0x1040),_0x36cb04=(_0x36cb04+_0x2257f1[_0x3580cc])%(-0x1*0xa77+0x315*0xb+-0x2*0xb38),_0x580050=_0x2257f1[_0x3580cc],_0x2257f1[_0x3580cc]=_0x2257f1[_0x36cb04],_0x2257f1[_0x36cb04]=_0x580050,_0x2295d9+=String['fromCharCode'](_0x325df3['charCodeAt'](_0x39f8e8)^_0x2257f1[(_0x2257f1[_0x3580cc]+_0x2257f1[_0x36cb04])%(-0x166*0x5+0x961+-0x163)]);}return _0x2295d9;};a0_0x24c4['PnetEe']=_0xbe8d78,a0_0x24c4['yeWSCh']={},a0_0x24c4['RVVQFJ']=!![];}var _0x325beb=_0x5ae9d1[-0x12d7+0x1*0x21f8+0x1*-0xf21],_0x1bf223=_0x17cd81+_0x325beb,_0x26e896=a0_0x24c4['yeWSCh'][_0x1bf223];if(!_0x26e896){if(a0_0x24c4['AZnwjh']===undefined){var _0x18e433=function(_0x445ec4){this['BEOVpK']=_0x445ec4,this['TPPxSI']=[-0x19fd*-0x1+-0x19a7+-0x55,-0x1a3*-0x2+-0x2*-0x1101+-0x952*0x4,-0x1d4e+0x21b9+-0x46b],this['yegIHt']=function(){return'newState';},this['OaUvaa']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['rnFrrT']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x18e433['prototype']['gkLzQR']=function(){var _0x2790fe=new RegExp(this['OaUvaa']+this['rnFrrT']),_0x5018a1=_0x2790fe['test'](this['yegIHt']['toString']())?--this['TPPxSI'][0x1e4c+-0x2a+0x359*-0x9]:--this['TPPxSI'][-0x93e*0x3+-0x2*-0x3a4+0x1472];return this['kHxRqq'](_0x5018a1);},_0x18e433['prototype']['kHxRqq']=function(_0x3de3cb){if(!Boolean(~_0x3de3cb))return _0x3de3cb;return this['uFyNAH'](this['BEOVpK']);},_0x18e433['prototype']['uFyNAH']=function(_0x1a60a5){for(var _0x59b529=0x7bd*-0x1+0x6b7*0x5+0x19d6*-0x1,_0x397861=this['TPPxSI']['length'];_0x59b529<_0x397861;_0x59b529++){this['TPPxSI']['push'](Math['round'](Math['random']())),_0x397861=this['TPPxSI']['length'];}return _0x1a60a5(this['TPPxSI'][0x233c+0xf2e+-0x59a*0x9]);},new _0x18e433(a0_0x24c4)['gkLzQR'](),a0_0x24c4['AZnwjh']=!![];}_0x5a7e7e=a0_0x24c4['PnetEe'](_0x5a7e7e,_0x250cf4),a0_0x24c4['yeWSCh'][_0x1bf223]=_0x5a7e7e;}else _0x5a7e7e=_0x26e896;return _0x5a7e7e;}var a0_0x9c56bf=(function(){var _0x4faea5=!![];return function(_0x10ac9c,_0x4c0ae1){var a0_0x30cb88={_0x287007:0x508,_0x3a9a47:0x50b,_0x149717:0x502,_0x42724d:0x50c},a0_0x5ad993={_0x4a9187:0x3bb},_0x453740=_0x4faea5?function(){function _0x4c4949(_0x1ea3f5,_0x4b4365,_0x3a880a,_0x48acc8,_0x16b53a){return a0_0x24c4(_0x48acc8-a0_0x5ad993._0x4a9187,_0x4b4365);}if(_0x4c0ae1){var _0xf72d21=_0x4c0ae1[_0x4c4949(a0_0x30cb88._0x287007,'sMAg',a0_0x30cb88._0x3a9a47,a0_0x30cb88._0x149717,a0_0x30cb88._0x42724d)](_0x10ac9c,arguments);return _0x4c0ae1=null,_0xf72d21;}}:function(){};return _0x4faea5=![],_0x453740;};}()),a0_0x526fcd=a0_0x9c56bf(this,function(){var a0_0x53312e={_0x267217:'k$q&',_0x5fe7ac:0x1f0,_0x1873d9:0x1e5,_0x5c254f:0x1ea,_0x59592b:0x110,_0x135241:0x10f,_0x25a9d5:0x119,_0x5c914b:0x135,_0x346ced:0x13c,_0xeeab77:0x13d,_0x5afe26:0x13a,_0x4984ae:'#Ve(',_0x5035e8:0x112,_0x30d847:0x11f,_0x1a4164:0x108,_0x5e64c2:0x12e,_0x1ec555:0x12e,_0x47529c:0x128,_0x3d1a8d:0x12d,_0x5be5a2:0x12a,_0x5a73b7:0x11a,_0x3abd99:'RVPe',_0x2b28fe:0x1e5,_0x14e184:'gA^b',_0x54aab9:0x1d8,_0x447e97:0x1d4,_0x208a07:0x1e3,_0x166e00:0x119,_0x1ccdeb:0x10c,_0x109511:0x110,_0x48f743:'vpxc',_0x5ae9ab:0x1e2,_0x5d4858:'I2z3',_0x4d876a:0x121,_0x56aae1:0x123,_0x3533ba:'zg@X',_0x1a8d57:0x201,_0x4b0164:0x1f1,_0x4b5d7e:0x1f9,_0x724d1d:0x1f7},a0_0x4cd5db={_0x45f698:0x276},a0_0x4ba4e7={_0x1f2c87:0x33},a0_0x5ecb94={_0x418db0:0x33b};function _0x38de88(_0xd47cf,_0x32cbc9,_0x5d5909,_0x5d955f,_0x54eae9){return a0_0x24c4(_0x54eae9- -a0_0x5ecb94._0x418db0,_0x32cbc9);}function _0x55c29b(_0x2c858b,_0x3588e0,_0x20c3ec,_0x966ad4,_0x5098b3){return a0_0x24c4(_0x2c858b- -a0_0x4ba4e7._0x1f2c87,_0x20c3ec);}var _0xebfdb={};_0xebfdb[_0x38de88(-0x1ee,a0_0x53312e._0x267217,-a0_0x53312e._0x5fe7ac,-a0_0x53312e._0x1873d9,-a0_0x53312e._0x5c254f)]=_0x55c29b(a0_0x53312e._0x59592b,0x107,')R*y',a0_0x53312e._0x135241,a0_0x53312e._0x25a9d5)+_0x30a3fe(-a0_0x53312e._0x5c914b,-a0_0x53312e._0x346ced,-a0_0x53312e._0xeeab77,-a0_0x53312e._0x5afe26,a0_0x53312e._0x4984ae)+'+$';function _0x30a3fe(_0x529c62,_0x3b705c,_0x266d24,_0x4af4fe,_0x37bbc8){return a0_0x24c4(_0x529c62- -a0_0x4cd5db._0x45f698,_0x37bbc8);}var _0xf1a20c=_0xebfdb;return a0_0x526fcd[_0x55c29b(a0_0x53312e._0x5035e8,a0_0x53312e._0x30d847,'GmVk',a0_0x53312e._0x1a4164,a0_0x53312e._0x1a4164)+_0x30a3fe(-0x129,-a0_0x53312e._0x5e64c2,-0x124,-0x125,'k$q&')]()[_0x55c29b(0x11f,a0_0x53312e._0x1ec555,'iIU^',0x113,0x118)+'h'](_0xf1a20c[_0x30a3fe(-a0_0x53312e._0x47529c,-a0_0x53312e._0x3d1a8d,-a0_0x53312e._0x5be5a2,-a0_0x53312e._0x5a73b7,a0_0x53312e._0x3abd99)])[_0x38de88(-a0_0x53312e._0x2b28fe,a0_0x53312e._0x14e184,-a0_0x53312e._0x54aab9,-a0_0x53312e._0x447e97,-a0_0x53312e._0x208a07)+_0x30a3fe(-a0_0x53312e._0x166e00,-a0_0x53312e._0x1ccdeb,-0x110,-a0_0x53312e._0x109511,a0_0x53312e._0x48f743)]()[_0x38de88(-a0_0x53312e._0x5ae9ab,a0_0x53312e._0x5d4858,-0x1ef,-a0_0x53312e._0x1873d9,-a0_0x53312e._0x5ae9ab)+'ructo'+'r'](a0_0x526fcd)['searc'+'h'](_0x55c29b(a0_0x53312e._0x4d876a,a0_0x53312e._0x56aae1,a0_0x53312e._0x3533ba,0x12f,a0_0x53312e._0x56aae1)+_0x38de88(-a0_0x53312e._0x1a8d57,'lh[l',-a0_0x53312e._0x4b0164,-a0_0x53312e._0x4b5d7e,-a0_0x53312e._0x724d1d)+'+$');});a0_0x526fcd();import{A as a0_0x4c6df2,B as a0_0x1ea034,C as a0_0x22eb1e,D as a0_0x31b7f1,b as a0_0x3e918e,c as a0_0x28f309,d as a0_0x3ce1cf,e as a0_0xdecbd9,f as a0_0x3fef42,g as a0_0x4093f5,h as a0_0x15104d,i as a0_0x347c28,j as a0_0x2cfb44,k as a0_0x6987c1,l as a0_0x3a4134,m as a0_0x4e1548,n as a0_0x356277,o as a0_0x48bb7c,p as a0_0x1cc032,q as a0_0x2caa40,r as a0_0x3cc00e,s as a0_0x55c707,t as a0_0x31083e,u as a0_0x4cd799,v as a0_0x25e04b,w as a0_0x305518,x as a0_0x54d54b,y as a0_0x492b81,z as a0_0x134467}from'../chunk-DLNGK7QW.js';import{a as a0_0x6e6e49,b as a0_0x18ea5e,c as a0_0x40c726,d as a0_0x54b37b,e as a0_0x3e7b02}from'../chunk-I5OOVR5U.js';import'../chunk-PW2FGMCO.js';import'../chunk-HVKF2KYL.js';function a0_0x2b6a(){var _0x6381b7=['W53dNSkyF8oBWRRdOeRdO8onCW','yYFcUdVcTI9CW7z0rG','W5bJW6i','W7ldKmoBWOuPW4X6W70','W7jutuyC','oSozW7BdUSkdW4K1WRBdPI/dLLXe','W5lcMSo4W6TT','W6VcH8oKn8o9','WOzxWRtdMrK','jmkox8k8DeyNodX6rKa','WPFcRmkTW6vr','WRZdLxLzB8ozgu12WP3cMvFcLa','WONcV8oiW5BcTmkTWOGTW4FdSNdcUW','W7hdLmkpW7TQWQ0GW5xcRmkzzdCh','oCoeWRJdJJXLWQCGWR7cS8oilG','AsFcSZ/dSh0LW41lw8k9tLi','m3RdRa','W7HCW7jHW6u','tCkcpmkSqGzTW44','Bs3cUJNdTN1rW75MqSksEa','pwtdRK/cNW','urRdHCoUCq','WP8AWQZcRCoUWQtcPL/dGrm9gmkp','iSkOieJdOa','W4FdQ8oUWR4BpCk1tKBcTJBcNcq','wfe5WONdLMH9nW','D8k9a37dO8k5zCkuWPRdSaO','acJcUmobWOm','B8o/W7/cHmk5','nMCHnXyfyCo3W69ZW6ldVai'];a0_0x2b6a=function(){return _0x6381b7;};return a0_0x2b6a();}import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x6e6e49 as AssetCache,a0_0x40c726 as AssetLoader,a0_0x4cd799 as AssetSystem,a0_0x54b37b as AssetTextures,a0_0x55c707 as Assets,a0_0x48bb7c as BaseSystem,a0_0x356277 as GameEngine,a0_0xdecbd9 as GameObject,a0_0x3fef42 as GameObjectManager,a0_0x4e1548 as ObjectFactory,a0_0x3ce1cf as Renderer,a0_0x1cc032 as RuntimeObjectRegistry,a0_0x28f309 as Transform,a0_0x1ea034 as applyScreenAnchor,a0_0x2caa40 as basePixi,a0_0x305518 as clearResponsiveElements,a0_0x3e918e as createPixiBase,a0_0x2cfb44 as getRegisteredFontIds,a0_0x25e04b as globalResponsiveMultipliers,a0_0x3e7b02 as initAssetTextures,a0_0x31083e as initAssets,a0_0x22eb1e as layout,a0_0x3a4134 as playLottieOverlay,a0_0x347c28 as registerFont,a0_0x18ea5e as registerType,a0_0x492b81 as resolveAnchorVec2,a0_0x4093f5 as resolveFont,a0_0x15104d as resolveFontWeight,a0_0x134467 as resolveScreenAnchorPoint,a0_0x4c6df2 as resolveScreenRatioPoint,a0_0x31b7f1 as runInitSequence,a0_0x6987c1 as setLottieInstance,a0_0x3cc00e as spawnSceneFromConfig,a0_0x54d54b as updateScreenState};