handler-playable-sdk 0.3.33 → 0.3.34

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
@@ -44,7 +44,7 @@
44
44
  <button class="debug-btn primary" data-modal-apply>Apply</button>
45
45
  </div>
46
46
  </div>
47
- `,this.modal=n}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(s=>{s.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(s=>{s.addEventListener("click",o=>{let c=o.target.dataset.tab;c&&this.switchTab(c)})});let n=this.modal.querySelector("[data-ai-generate]");n==null||n.addEventListener("click",()=>{this.openAiEditor("generate")});let r=this.modal.querySelector("[data-ai-edit]");r==null||r.addEventListener("click",()=>{this.openAiEditor("edit")});let a=this.modal.querySelector("[data-modal-apply]");a==null||a.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",s=>{s.target===this.modal&&this.close()})}switchTab(t){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-tab")===t)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-tab-panel")===t)})}openAiEditor(t){let i=window.__openAiEditor;if(typeof i!="function"){alert("AI Editor not available. Please check your setup.");return}let n="";t==="edit"&&this.currentAsset?n=`Edit this image: ${this.currentObjectId}`:n=`Create an image for: ${this.currentObjectId}`,i(this.currentObjectId||"unknown",n,this.currentAsset,{path:this.currentPath,onApply:r=>{this.onApplyCallback&&this.onApplyCallback(r),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 l0={};an(l0,{COLORS:()=>We,ConfigWatcher:()=>Ht,DebugPanel:()=>rr,DefaultReloadStrategy:()=>bn,Handler:()=>Pe,PlayableLoadingScreen:()=>ss,PreviewShell:()=>ns,STROKE_WIDTH:()=>jg,THEME:()=>Dg,applyConfigOverride:()=>bt,applyConfigOverrides:()=>yt,applyConfigsToDisk:()=>hn,applyDefaults:()=>$t,baseLottie:()=>ws,bootstrap:()=>Zw,clearConfigOverrides:()=>vt,clearConfigOverridesForObject:()=>Ed,configOverrideManager:()=>Sd,createPreviewShell:()=>hc,deepClone:()=>ne,default:()=>zt,defaultPreset:()=>Nr,deviceGroups:()=>Vs,devicePresets:()=>Ws,diffConfigs:()=>Fs,exportConfigsAsJSON:()=>fn,getConfigOverrides:()=>de,getConfigStateSummary:()=>Or,getOverrideMode:()=>pn,getPresetById:()=>Ut,getPresetsByCategory:()=>Xm,loadAllObjectConfigs:()=>Rr,loadComponentSchemas:()=>Pr,loadEngineConfig:()=>jr,loadGamePromptConfig:()=>zs,loadObjectCentricConfig:()=>et,loadObjectConfig:()=>xt,loadSceneConfig:()=>Dr,rehydrateObject:()=>$s,removeConfigOverride:()=>Lr,resetToApplied:()=>gn,resetToOriginal:()=>Ir,setBootstrapDependencies:()=>Kw,setOverrideMode:()=>Rs,setupHotReload:()=>qs,setupLiveEditBridge:()=>rs,toLegacyFormat:()=>Ns,validateObjectConfig:()=>gi});module.exports=nm(l0);var ht={};function gr(e,t,i=!1){ht[e]||(ht[e]=[]),ht[e].push({fn:t,once:i})}function bs(e,t){if(ht[e]){if(!t){delete ht[e];return}ht[e]=ht[e].filter(i=>i.fn!==t)}}function mr(e,...t){let i=ht[e];if(i)for(let n of[...i])n.fn(...t),n.once&&bs(e,n.fn)}function be(e,t){gr(e,t,!0)}var ee=null,Ce=[],ui=null;function Pc(e){ee=e,Ce=[],ui!==null&&(clearTimeout(ui),ui=null)}function Rc(){var e,t,i;return{endpoint:(ee==null?void 0:ee.endpoint)||"",transport:(ee==null?void 0:ee.transport)||"beacon",batchSize:(e=ee==null?void 0:ee.batchSize)!=null?e:10,flushIntervalMs:(t=ee==null?void 0:ee.flushIntervalMs)!=null?t:300,maxQueue:(i=ee==null?void 0:ee.maxQueue)!=null?i:200,debug:!!(ee!=null&&ee.debug)}}async function Ic(e,t,i,n){let r=JSON.stringify(t);if(i==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let a=navigator.sendBeacon(e,new Blob([r],{type:"application/json"}));n&&console.log("[handler.telemetry] beacon",a,t);return}catch(a){n&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",a)}try{await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:r,keepalive:!0}),n&&console.log("[handler.telemetry] fetch",t)}catch(a){n&&console.warn("[handler.telemetry] fetch failed",a)}}function ys(e,t){let i=Rc();if(t&&i.endpoint){if(Ce.push(e),Ce.length>i.maxQueue&&(Ce=Ce.slice(Ce.length-i.maxQueue)),Ce.length>=i.batchSize){Mc();return}ui===null&&(ui=window.setTimeout(()=>{ui=null,Mc()},i.flushIntervalMs))}}async function Mc(){let e=Rc();if(!e.endpoint||Ce.length===0)return;let t=Ce.splice(0,e.batchSize);await Ic(e.endpoint,{events:t},e.transport,e.debug),Ce.length>0&&await Ic(e.endpoint,{events:Ce.splice(0,e.batchSize)},e.transport,e.debug)}function jc(e){return Math.max(0,Math.min(1,e))}function rm(e){let t=String(e!=null?e:"power2.out");if(t==="linear")return i=>i;if(t==="sine.inOut")return i=>.5-Math.cos(Math.PI*i)/2;if(t==="power2.out"||t==="easeOutQuad")return i=>1-(1-i)*(1-i);if(t.startsWith("back.out")){let i=t.match(/back\.out\(([\d.]+)\)/),n=i?Number(i[1]):1.8;return r=>1+(n+1)*Math.pow(r-1,3)+n*Math.pow(r-1,2)}return i=>1-(1-i)*(1-i)}function sn(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function am(e,t){let i=e==null?void 0:e[t];return typeof i=="number"?i:0}function Dc(e,t,i){try{e[t]=i}catch{}}function sm(e){let t=e==null?void 0:e.scale;if(!t)return null;let i=typeof t.x=="number"?t.x:1,n=typeof t.y=="number"?t.y:1;return{x:i,y:n}}function zc(e,t){let i=e==null?void 0:e.scale;if(i)try{typeof i.set=="function"?i.set(t.x,t.y):(typeof i.x=="number"&&(i.x=t.x),typeof i.y=="number"&&(i.y=t.y))}catch{}}function Nc(e,t){let i=sm(e);if(!i)return{from:null,to:null};let n=null,r=null;return typeof t.scale=="number"?(n=t.scale,r=t.scale):t.scale&&typeof t.scale=="object"&&(typeof t.scale.x=="number"&&(n=t.scale.x),typeof t.scale.y=="number"&&(r=t.scale.y)),typeof t.scaleX=="number"&&(n=t.scaleX),typeof t.scaleY=="number"&&(r=t.scaleY),n===null&&r===null?{from:null,to:null}:{from:{x:i.x,y:i.y},to:{x:n!=null?n:i.x,y:r!=null?r:i.y}}}function Bc(){let e=new Set,t=new WeakMap,i=null,n=()=>{if(i!=null)return;i=requestAnimationFrame(()=>{i=null,o(),e.size>0&&n()})},r=d=>{var p;e.add(d);let u=(p=t.get(d.target))!=null?p:new Set;u.add(d),t.set(d.target,u),n()},a=d=>{e.delete(d);let u=t.get(d.target);u&&(u.delete(d),u.size===0&&t.delete(d.target))},s=d=>{d.killed||(d.killed=!0,a(d))},o=()=>{var u,p;let d=sn();for(let f of Array.from(e)){if(f.killed||f.paused)continue;let g=d-f.startMs-f.delayMs;if(g<0)continue;let h=f.durationMs>0?g/f.durationMs:1,m=jc(h),b=f.repeat>=0?f.repeat+1:1,y=f.repeat>0?Math.min(Math.floor(h),b-1):0;if(f.repeat>0&&h>=1){let w=h-y;m=jc(w)}let v=f.ease(m);f.yoyo&&y%2===1&&(v=1-v);for(let w of f.props)Dc(f.target,w.key,w.from+(w.to-w.from)*v);f.scaleFrom&&f.scaleTo&&zc(f.target,{x:f.scaleFrom.x+(f.scaleTo.x-f.scaleFrom.x)*v,y:f.scaleFrom.y+(f.scaleTo.y-f.scaleFrom.y)*v});try{(u=f.onUpdate)==null||u.call(f)}catch{}if(h>=b){s(f);try{(p=f.onComplete)==null||p.call(f)}catch{}}}},l=(d,u,p)=>{var w;let f=Math.max(0,(typeof u.duration=="number"?u.duration:.5)*1e3),g=Math.max(0,(typeof u.delay=="number"?u.delay:0)*1e3+((w=p==null?void 0:p.delayMsOverride)!=null?w:0)),h=rm(u.ease),m=typeof u.repeat=="number"?Math.max(0,u.repeat|0):0,b=u.yoyo===!0,y=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),v=[];for(let E of Object.keys(u)){if(y.has(E))continue;let A=u[E];typeof A=="number"&&v.push({key:E,from:am(d,E),to:A})}let x=Nc(d,u);return{target:d,startMs:sn(),delayMs:g,durationMs:f,ease:h,props:v,scaleFrom:x.from,scaleTo:x.to,repeat:m,yoyo:b,onUpdate:typeof u.onUpdate=="function"?u.onUpdate:void 0,onComplete:typeof u.onComplete=="function"?u.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},c={to(d,u){let p=l(d,u);return r(p),{kill:()=>s(p),pause:()=>{p.paused||(p.paused=!0,p.pauseAtMs=sn())},resume:()=>{var h;if(!p.paused)return;let f=(h=p.pauseAtMs)!=null?h:sn(),g=sn()-f;p.startMs+=g,p.paused=!1,p.pauseAtMs=null},isActive:()=>!p.killed&&!p.paused}},fromTo(d,u,p){return c.set(d,u),c.to(d,p)},set(d,u){if(!d||!u)return;for(let f of Object.keys(u)){let g=u[f];f==="scale"||f==="scaleX"||f==="scaleY"||typeof g=="number"&&Dc(d,f,g)}let p=Nc(d,u);p.to&&zc(d,p.to)},killTweensOf(d){let u=t.get(d);if(u)for(let p of Array.from(u))s(p)},timeline(d={}){let u=[],p=0,f=!1,g=[],h=y=>{if(typeof y=="number")return Math.max(0,y*1e3);let v=typeof y=="string"?y.trim():"";return v.startsWith("+=")?p+Math.max(0,Number(v.slice(2))*1e3||0):v?Math.max(0,Number(v)*1e3||0):p},m=y=>{u.push(y);let v=Math.max(0,(typeof y.vars.duration=="number"?y.vars.duration:.5)*1e3);p=Math.max(p,y.atMs+v)},b={to(y,v,x){return m({kind:"to",target:y,vars:v,atMs:h(x)}),b},fromTo(y,v,x,w){return m({kind:"fromTo",target:y,vars:x,from:v,atMs:h(w)}),b},play(){var y,v;if(f)return b;f=!0,g=[];for(let x of u)x.kind==="fromTo"&&c.set(x.target,(y=x.from)!=null?y:{}),g.push(c.to(x.target,{...x.vars,delay:x.atMs/1e3+((v=x.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=[],f=!1}};return d.paused||b.play(),b}};return c}function Fc(){if(typeof window=="undefined")return;let e=window;if(!e.gsap)try{e.gsap=Bc()}catch{}}var $c={name:"handler-playable-sdk",version:"0.3.33",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",sharp:"^0.34.5"}};var ye=0,lm=ye++,Hc=ye++,Uc=ye++,qc=ye++,Gc=ye++,Wc=ye++,Vc=ye++,Yc=ye++,Kc=ye++,Xc=ye++,Zc=ye++,Jc=ye++,K=lm;function Qc(){return K===Hc}function ed(){return K===Uc}function td(){return K===qc}function id(){return K===Gc}function pi(){return K===Wc}function fi(){return K===Vc}function nd(){return K===Yc}function rd(){return K===Kc}function ad(){return K===Xc}function vs(){return K===Zc}function xs(){return K===Jc}function sd(){let e=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",t=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(e==="mraid")try{mraid.getState(),K=Hc;return}catch{}else if(e==="dapi")try{dapi.isReady(),K=Uc;return}catch{}if(t==="facebook")try{typeof FbPlayableAd!="undefined"&&(K=qc)}catch{}else if(t==="google")try{typeof ExitApi!="undefined"&&(K=Gc)}catch{}else if(t==="mintegral")window.gameReady&&(K=Wc);else if(t==="tapjoy")window.TJ_API&&(K=Vc);else if(t==="tiktok")window.openAppStore&&(K=Yc);else if(t==="smadex")try{window.smxTracking&&(K=Kc)}catch{}else if(t==="snapchat")try{window.ScPlayableAd&&(K=Xc)}catch{}else t==="vungle"?K=Zc:(e==="nucleo"||t==="nucleo")&&(K=Jc)}var br=di(require("lottie-web"),1),ws=br.default;typeof window!="undefined"&&(window.lottie=br.default,window.__baseLottie=br.default);var cm=require("pixi.js");var _s=require("pixi.js");var dm=null;function Es(e){dm=e}yr();Ss();var on=require("pixi.js");yr();var mm=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",ks=mm;if(typeof window!="undefined")try{let e=new XMLHttpRequest;if(e.open("GET","./build-settings.json",!1),e.send(),e.status===200&&e.responseText){let t=JSON.parse(e.responseText);t!=null&&t.buildMode&&(ks=t.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${ks}`))}}catch{}var mt=class{static async create(t,i,n){var l,c,d,u,p,f,g;console.log(`[ObjectFactory] create() called for: ${t}, __BUILD_MODE__: ${ks}`);let r=(l=i==null?void 0:i.render)==null?void 0:l.asset;if(!r){console.log(`[ObjectFactory] No asset definition for: ${t}, returning empty container`);let h=new on.Container;return this.applyTransform(h,i==null?void 0:i.transform),h}let a=(c=i==null?void 0:i.identity)==null?void 0:c.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${t}, configId: ${a}, type: ${r.type}, path: ${r.path}`);let s=await Bt.load(t,r,n,a);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${t}, rawAsset type: ${(d=s==null?void 0:s.constructor)==null?void 0:d.name}`);let o;if(r.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",s,"for object:",t),o=new on.Sprite(s),console.log("[ObjectFactory] Created object:",o,"type:",(u=o==null?void 0:o.constructor)==null?void 0:u.name),this.applyTransform(o,i==null?void 0:i.transform);else if(r.type==="json")if(console.log("[ObjectFactory] JSON asset for",t,"rawAsset type:",(p=s==null?void 0:s.constructor)==null?void 0:p.name,s),s&&(((f=s.constructor)==null?void 0:f.name)==="Container"||s instanceof on.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let h=[r.path,`/assets/${r.path}`,`assets/${r.path}`,`../assets/${r.path}`],m=!1;for(let b of h)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=s)}else o=s;else o=s,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,i==null?void 0:i.transform);return o}static applyTransform(t,i){var n,r,a,s;!i||!t||(i.position&&("x"in t&&"y"in t?(t.x=(n=i.position.x)!=null?n:0,t.y=(r=i.position.y)!=null?r:0):"position"in t&&t.position&&t.position.set((a=i.position.x)!=null?a:0,(s=i.position.y)!=null?s:0)),i.scale!==void 0&&"scale"in t&&t.scale&&(typeof t.scale=="object"&&"set"in t.scale?t.scale.set(i.scale):t.scale=i.scale),i.rotation!==void 0&&"rotation"in t&&(t.rotation=i.rotation),i.anchor&&"anchor"in t&&t.anchor&&Array.isArray(i.anchor)&&("set"in t.anchor?t.anchor.set(i.anchor[0],i.anchor[1]):(t.anchor.x=i.anchor[0],t.anchor.y=i.anchor[1])))}};var ln=class{constructor(){this.config=null}init(t){this.config=t}get(t){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return this.config.objects.get(t)}getAllIds(){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return Array.from(this.config.objects.keys())}has(t){return this.config?this.config.objects.has(t):!1}};var vm=di(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=vm);hi();var vr=require("pixi.js");hi();var Is=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new ln}init(t,i){this.registry.init(t),this.app=i}updateConfig(t){this.registry.init(t),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let i=this.registry.getAllIds().filter(r=>!this.instanceCache.has(r));if(i.length===0)return;let n=async r=>{r.length&&(console.log("[Assets] Loading objects:",r),await Promise.all(r.map(async a=>{var o;let s=this.registry.get(a);if(!s){console.warn("[Assets] No config found for object:",a);return}try{let l=await mt.create(a,s,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 n(i);let r=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));r.length>0&&(console.warn("[Assets] Retrying missing assets:",r),await n(r)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(t){let i=this.registry.get(t);if(i){let n=await mt.create(t,i,this.app);this.instanceCache.set(t,n)}}get(t){return this.instanceCache.get(t)}},xm=new Is,wm=new Proxy(xm,{get(e,t){if(t in e&&typeof e[t]=="function")return e[t].bind(e);if(e.get(t))return e.get(t)}});hi();var pd=require("pixi.js"),Ze={width:400,height:600,designWidth:400,scaleFactor:1},wr={scale:1,position:1},Ps=[];function Em(e,t,i,n,r,a,s){Ps.push({element:e,originalScale:a,positionHelper:t,heightPercent:r}),t(e,i,n,r,a,s,!1)}function Sm(){Ps.forEach(({element:e,originalScale:t,positionHelper:i,heightPercent:n})=>{let r=t*Ze.scaleFactor;i(e,Ze.width,Ze.height,n,r,!0,!1)})}function Ms(e,t){console.log(`[SCREEN] updateScreenState called: ${e}x${t}`),Ze.width=e,Ze.height=t,Ze.scaleFactor=Math.min(e/Ze.designWidth,1.15),wr.scale=Ze.scaleFactor,wr.position=1,console.log(`[SCREEN] Global multipliers - scale: ${wr.scale.toFixed(3)}`),Sm()}var dn={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 Am(e,t,i){let n=dn[e];n&&n[t]!==void 0&&(n[t]=i,console.log(`Updated ${e}.${t} = ${i}`))}function Cm(){return dn}var Tm={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 xr(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}function _r(e,t={x:.5,y:.5}){var i;if(Array.isArray(e))return{x:xr(e[0],t.x),y:xr(e[1],t.y)};if(e&&typeof e=="object"){let n=e;return{x:xr(n.x,t.x),y:xr(n.y,t.y)}}if(typeof e=="string"){let n=e.trim().toLowerCase();return(i=Tm[n])!=null?i:t}return t}function fd(e,t,i,n={}){var f,g,h,m,b,y;let r=_r(i),a=(f=n.inset)!=null?f:{},s=(g=n.padding)!=null?g:{x:0,y:0},o=((h=a.left)!=null?h:0)+s.x,l=((m=a.right)!=null?m:0)+s.x,c=((b=a.top)!=null?b:0)+s.y,d=((y=a.bottom)!=null?y:0)+s.y,u=Math.max(0,e-o-l),p=Math.max(0,t-c-d);return{x:o+u*r.x,y:c+p*r.y}}function hd(e,t,i,n={}){var h,m,b,y,v,x;let r=(h=n.inset)!=null?h:{},a=(m=n.padding)!=null?m:{x:0,y:0},s=((b=r.left)!=null?b:0)+a.x,o=((y=r.right)!=null?y:0)+a.x,l=((v=r.top)!=null?v:0)+a.y,c=((x=r.bottom)!=null?x:0)+a.y,d=Math.max(0,e-s-o),u=Math.max(0,t-l-c),p=_r(i,{x:.5,y:.5}),f=Math.min(Math.max(p.x,0),1),g=Math.min(Math.max(p.y,0),1);return{x:s+d*f,y:l+u*g}}if(typeof window!="undefined"){let e=window.innerWidth,t=window.innerHeight,i=()=>{let n=window.innerWidth,r=window.innerHeight;(n!==e||r!==t)&&(e=n,t=r,Ms(n,r))};window.addEventListener("resize",i),window.addEventListener("orientationchange",()=>{setTimeout(i,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",i),window.mraid.addEventListener("sizeChange",i)),Ms(window.innerWidth,window.innerHeight),window.updateDebugConfig=Am,window.getDebugConfig=Cm,window.copyConfig=Nm,window.applyConfig=cn,window.applyConfigForRatio=Bm,window.positionAtBottom=gd,window.positionAtTop=Om,window.positionAtCenter=Im,window.positionAtLeft=Mm,window.positionAtRight=Pm,window.positionAtBottomLeft=Rm,window.positionAtBottomRight=jm,window.positionAtTopLeft=Dm,window.positionAtTopRight=zm,window.applyPositionContract=Lm,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 Er(e,t,i=0){return e*t+i}function Sr(e,t,i=0){return e*(1-t)+i}function Ar(e,t,i=0){return e*t+i}function Cr(e,t,i=0){return e*(1-t)+i}function ve(e,t=0){return e/2+t}function km(e,t){return e*t}function Lm(e,t,i,n){var s,o,l,c,d,u,p,f,g,h,m,b,y,v,x,w,E,A,_,T;let r=0,a=0;switch(n.type){case"top":r=ve(t,(o=(s=n.offset)==null?void 0:s.x)!=null?o:0),a=Er(i,n.percent,(c=(l=n.offset)==null?void 0:l.y)!=null?c:0);break;case"bottom":r=ve(t,(u=(d=n.offset)==null?void 0:d.x)!=null?u:0),a=Sr(i,n.percent,(f=(p=n.offset)==null?void 0:p.y)!=null?f:0);break;case"left":r=Ar(t,n.percent,(h=(g=n.offset)==null?void 0:g.x)!=null?h:0),a=ve(i,(b=(m=n.offset)==null?void 0:m.y)!=null?b:0);break;case"right":r=Cr(t,n.percent,(v=(y=n.offset)==null?void 0:y.x)!=null?v:0),a=ve(i,(w=(x=n.offset)==null?void 0:x.y)!=null?w:0);break;case"center":r=ve(t,(A=(E=n.offset)==null?void 0:E.x)!=null?A:0),a=ve(i,(T=(_=n.offset)==null?void 0:_.y)!=null?T:0);break}e.position?e.position.set(r,a):(e.x=r,e.y=a),n.scale!==void 0&&n.scale!==1&&e.scale&&(typeof e.scale.set=="function"?e.scale.set(n.scale,n.scale):(e.scale.x=n.scale,e.scale.y=n.scale))}function gd(e,t,i,n=.2,r=1,a=!0,s=!1){let o=km(i,n),l=Sr(i,n/2);Je(e,ve(t),l);let c=a?r*Ze.scaleFactor:r;Qe(e,c),s&&!Ps.find(d=>d.element===e)&&Em(e,gd,t,i,n,r,a)}function Om(e,t,i,n=.1,r=1){Je(e,ve(t),Er(i,n)),Qe(e,r)}function Im(e,t,i,n=0,r=0,a=1){Je(e,ve(t,n),ve(i,r)),Qe(e,a)}function Mm(e,t,i,n=.1,r=1){Je(e,Ar(t,n),ve(i)),Qe(e,r)}function Pm(e,t,i,n=.1,r=1){Je(e,Cr(t,n),ve(i)),Qe(e,r)}function Rm(e,t,i,n=.05,r=.05,a=1){Je(e,Ar(t,r),Sr(i,n)),Qe(e,a)}function jm(e,t,i,n=.05,r=.05,a=1){Je(e,Cr(t,r),Sr(i,n)),Qe(e,a)}function Dm(e,t,i,n=.05,r=.05,a=1){Je(e,Ar(t,r),Er(i,n)),Qe(e,a)}function zm(e,t,i,n=.05,r=.05,a=1){Je(e,Cr(t,r),Er(i,n)),Qe(e,a)}function Je(e,t,i){e&&e.position?typeof e.position.set=="function"?e.position.set(t,i):(e.position.x=t,e.position.y=i):e&&(e.x=t,e.y=i)}function Qe(e,t){t!==1&&e&&e.scale&&(typeof e.scale.set=="function"?e.scale.set(t,t):e.scale.x!==void 0&&e.scale.y!==void 0&&(e.scale.x=t,e.scale.y=t))}var Ft={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 Nm(e){return e&&Ft[e]?JSON.parse(JSON.stringify(Ft[e])):JSON.parse(JSON.stringify(dn))}function cn(e){Object.keys(e).forEach(t=>{let i=t;dn[i]&&e[i]&&Object.assign(dn[i],e[i])}),console.log("Config applied:",e)}function Bm(e,t){let i=e/t;i>1.6?(cn(Ft.wide),console.log("Applied WIDE config for ratio:",i)):i<.7?(cn(Ft.tall),console.log("Applied TALL config for ratio:",i)):i>.8&&i<1.2?(cn(Ft.square),console.log("Applied SQUARE config for ratio:",i)):(cn(Ft.default),console.log("Applied DEFAULT config for ratio:",i))}if(typeof window!="undefined"){let e=window;e.configPresets=Ft,e.resolveAnchorVec2=e.resolveAnchorVec2||_r,e.resolveScreenAnchorPoint=e.resolveScreenAnchorPoint||fd,e.resolveScreenRatioPoint=e.resolveScreenRatioPoint||hd}zr();function te(e,t){let i=(r,a)=>a===0?r:i(a,r%a),n=i(e,t);return`${e/n}:${t/n}`}var D_=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:te(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:te(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:te(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:te(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:te(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:te(360,780)}],z_=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:te(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:te(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:te(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:te(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:te(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:te(412,915)}],N_=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:te(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:te(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:te(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:te(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:te(800,1280)}],Gs=[{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:te(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:te(768,1024),mraidScale:.7}];var Ws=[...Gs],Vs=[{category:"playable",label:"Playable Ad",devices:Gs}],Nr=Gs[0];function Ut(e){return Ws.find(t=>t.id===e)||Nr}function Xm(e){return Ws.filter(t=>t.category===e)}var Br=class{constructor(){this.root=null;this.listContainer=null;this.searchInput=null;this.selectedId=null;this.options=null;this.retryTimer=null;this.screenFilter="all"}getScreenFilterStorageKey(){return`handler_preview_screen_filter::${typeof window!="undefined"&&window.__HANDLER_PROJECT_ID||"default"}`}render(){return`
47
+ `,this.modal=n}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(s=>{s.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(s=>{s.addEventListener("click",o=>{let c=o.target.dataset.tab;c&&this.switchTab(c)})});let n=this.modal.querySelector("[data-ai-generate]");n==null||n.addEventListener("click",()=>{this.openAiEditor("generate")});let r=this.modal.querySelector("[data-ai-edit]");r==null||r.addEventListener("click",()=>{this.openAiEditor("edit")});let a=this.modal.querySelector("[data-modal-apply]");a==null||a.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",s=>{s.target===this.modal&&this.close()})}switchTab(t){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-tab")===t)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-tab-panel")===t)})}openAiEditor(t){let i=window.__openAiEditor;if(typeof i!="function"){alert("AI Editor not available. Please check your setup.");return}let n="";t==="edit"&&this.currentAsset?n=`Edit this image: ${this.currentObjectId}`:n=`Create an image for: ${this.currentObjectId}`,i(this.currentObjectId||"unknown",n,this.currentAsset,{path:this.currentPath,onApply:r=>{this.onApplyCallback&&this.onApplyCallback(r),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 l0={};an(l0,{COLORS:()=>We,ConfigWatcher:()=>Ht,DebugPanel:()=>rr,DefaultReloadStrategy:()=>bn,Handler:()=>Pe,PlayableLoadingScreen:()=>ss,PreviewShell:()=>ns,STROKE_WIDTH:()=>jg,THEME:()=>Dg,applyConfigOverride:()=>bt,applyConfigOverrides:()=>yt,applyConfigsToDisk:()=>hn,applyDefaults:()=>$t,baseLottie:()=>ws,bootstrap:()=>Zw,clearConfigOverrides:()=>vt,clearConfigOverridesForObject:()=>Ed,configOverrideManager:()=>Sd,createPreviewShell:()=>hc,deepClone:()=>ne,default:()=>zt,defaultPreset:()=>Nr,deviceGroups:()=>Vs,devicePresets:()=>Ws,diffConfigs:()=>Fs,exportConfigsAsJSON:()=>fn,getConfigOverrides:()=>de,getConfigStateSummary:()=>Or,getOverrideMode:()=>pn,getPresetById:()=>Ut,getPresetsByCategory:()=>Xm,loadAllObjectConfigs:()=>Rr,loadComponentSchemas:()=>Pr,loadEngineConfig:()=>jr,loadGamePromptConfig:()=>zs,loadObjectCentricConfig:()=>et,loadObjectConfig:()=>xt,loadSceneConfig:()=>Dr,rehydrateObject:()=>$s,removeConfigOverride:()=>Lr,resetToApplied:()=>gn,resetToOriginal:()=>Ir,setBootstrapDependencies:()=>Kw,setOverrideMode:()=>Rs,setupHotReload:()=>qs,setupLiveEditBridge:()=>rs,toLegacyFormat:()=>Ns,validateObjectConfig:()=>gi});module.exports=nm(l0);var ht={};function gr(e,t,i=!1){ht[e]||(ht[e]=[]),ht[e].push({fn:t,once:i})}function bs(e,t){if(ht[e]){if(!t){delete ht[e];return}ht[e]=ht[e].filter(i=>i.fn!==t)}}function mr(e,...t){let i=ht[e];if(i)for(let n of[...i])n.fn(...t),n.once&&bs(e,n.fn)}function be(e,t){gr(e,t,!0)}var ee=null,Ce=[],ui=null;function Pc(e){ee=e,Ce=[],ui!==null&&(clearTimeout(ui),ui=null)}function Rc(){var e,t,i;return{endpoint:(ee==null?void 0:ee.endpoint)||"",transport:(ee==null?void 0:ee.transport)||"beacon",batchSize:(e=ee==null?void 0:ee.batchSize)!=null?e:10,flushIntervalMs:(t=ee==null?void 0:ee.flushIntervalMs)!=null?t:300,maxQueue:(i=ee==null?void 0:ee.maxQueue)!=null?i:200,debug:!!(ee!=null&&ee.debug)}}async function Ic(e,t,i,n){let r=JSON.stringify(t);if(i==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let a=navigator.sendBeacon(e,new Blob([r],{type:"application/json"}));n&&console.log("[handler.telemetry] beacon",a,t);return}catch(a){n&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",a)}try{await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:r,keepalive:!0}),n&&console.log("[handler.telemetry] fetch",t)}catch(a){n&&console.warn("[handler.telemetry] fetch failed",a)}}function ys(e,t){let i=Rc();if(t&&i.endpoint){if(Ce.push(e),Ce.length>i.maxQueue&&(Ce=Ce.slice(Ce.length-i.maxQueue)),Ce.length>=i.batchSize){Mc();return}ui===null&&(ui=window.setTimeout(()=>{ui=null,Mc()},i.flushIntervalMs))}}async function Mc(){let e=Rc();if(!e.endpoint||Ce.length===0)return;let t=Ce.splice(0,e.batchSize);await Ic(e.endpoint,{events:t},e.transport,e.debug),Ce.length>0&&await Ic(e.endpoint,{events:Ce.splice(0,e.batchSize)},e.transport,e.debug)}function jc(e){return Math.max(0,Math.min(1,e))}function rm(e){let t=String(e!=null?e:"power2.out");if(t==="linear")return i=>i;if(t==="sine.inOut")return i=>.5-Math.cos(Math.PI*i)/2;if(t==="power2.out"||t==="easeOutQuad")return i=>1-(1-i)*(1-i);if(t.startsWith("back.out")){let i=t.match(/back\.out\(([\d.]+)\)/),n=i?Number(i[1]):1.8;return r=>1+(n+1)*Math.pow(r-1,3)+n*Math.pow(r-1,2)}return i=>1-(1-i)*(1-i)}function sn(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function am(e,t){let i=e==null?void 0:e[t];return typeof i=="number"?i:0}function Dc(e,t,i){try{e[t]=i}catch{}}function sm(e){let t=e==null?void 0:e.scale;if(!t)return null;let i=typeof t.x=="number"?t.x:1,n=typeof t.y=="number"?t.y:1;return{x:i,y:n}}function zc(e,t){let i=e==null?void 0:e.scale;if(i)try{typeof i.set=="function"?i.set(t.x,t.y):(typeof i.x=="number"&&(i.x=t.x),typeof i.y=="number"&&(i.y=t.y))}catch{}}function Nc(e,t){let i=sm(e);if(!i)return{from:null,to:null};let n=null,r=null;return typeof t.scale=="number"?(n=t.scale,r=t.scale):t.scale&&typeof t.scale=="object"&&(typeof t.scale.x=="number"&&(n=t.scale.x),typeof t.scale.y=="number"&&(r=t.scale.y)),typeof t.scaleX=="number"&&(n=t.scaleX),typeof t.scaleY=="number"&&(r=t.scaleY),n===null&&r===null?{from:null,to:null}:{from:{x:i.x,y:i.y},to:{x:n!=null?n:i.x,y:r!=null?r:i.y}}}function Bc(){let e=new Set,t=new WeakMap,i=null,n=()=>{if(i!=null)return;i=requestAnimationFrame(()=>{i=null,o(),e.size>0&&n()})},r=d=>{var p;e.add(d);let u=(p=t.get(d.target))!=null?p:new Set;u.add(d),t.set(d.target,u),n()},a=d=>{e.delete(d);let u=t.get(d.target);u&&(u.delete(d),u.size===0&&t.delete(d.target))},s=d=>{d.killed||(d.killed=!0,a(d))},o=()=>{var u,p;let d=sn();for(let f of Array.from(e)){if(f.killed||f.paused)continue;let g=d-f.startMs-f.delayMs;if(g<0)continue;let h=f.durationMs>0?g/f.durationMs:1,m=jc(h),b=f.repeat>=0?f.repeat+1:1,y=f.repeat>0?Math.min(Math.floor(h),b-1):0;if(f.repeat>0&&h>=1){let w=h-y;m=jc(w)}let v=f.ease(m);f.yoyo&&y%2===1&&(v=1-v);for(let w of f.props)Dc(f.target,w.key,w.from+(w.to-w.from)*v);f.scaleFrom&&f.scaleTo&&zc(f.target,{x:f.scaleFrom.x+(f.scaleTo.x-f.scaleFrom.x)*v,y:f.scaleFrom.y+(f.scaleTo.y-f.scaleFrom.y)*v});try{(u=f.onUpdate)==null||u.call(f)}catch{}if(h>=b){s(f);try{(p=f.onComplete)==null||p.call(f)}catch{}}}},l=(d,u,p)=>{var w;let f=Math.max(0,(typeof u.duration=="number"?u.duration:.5)*1e3),g=Math.max(0,(typeof u.delay=="number"?u.delay:0)*1e3+((w=p==null?void 0:p.delayMsOverride)!=null?w:0)),h=rm(u.ease),m=typeof u.repeat=="number"?Math.max(0,u.repeat|0):0,b=u.yoyo===!0,y=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),v=[];for(let E of Object.keys(u)){if(y.has(E))continue;let A=u[E];typeof A=="number"&&v.push({key:E,from:am(d,E),to:A})}let x=Nc(d,u);return{target:d,startMs:sn(),delayMs:g,durationMs:f,ease:h,props:v,scaleFrom:x.from,scaleTo:x.to,repeat:m,yoyo:b,onUpdate:typeof u.onUpdate=="function"?u.onUpdate:void 0,onComplete:typeof u.onComplete=="function"?u.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},c={to(d,u){let p=l(d,u);return r(p),{kill:()=>s(p),pause:()=>{p.paused||(p.paused=!0,p.pauseAtMs=sn())},resume:()=>{var h;if(!p.paused)return;let f=(h=p.pauseAtMs)!=null?h:sn(),g=sn()-f;p.startMs+=g,p.paused=!1,p.pauseAtMs=null},isActive:()=>!p.killed&&!p.paused}},fromTo(d,u,p){return c.set(d,u),c.to(d,p)},set(d,u){if(!d||!u)return;for(let f of Object.keys(u)){let g=u[f];f==="scale"||f==="scaleX"||f==="scaleY"||typeof g=="number"&&Dc(d,f,g)}let p=Nc(d,u);p.to&&zc(d,p.to)},killTweensOf(d){let u=t.get(d);if(u)for(let p of Array.from(u))s(p)},timeline(d={}){let u=[],p=0,f=!1,g=[],h=y=>{if(typeof y=="number")return Math.max(0,y*1e3);let v=typeof y=="string"?y.trim():"";return v.startsWith("+=")?p+Math.max(0,Number(v.slice(2))*1e3||0):v?Math.max(0,Number(v)*1e3||0):p},m=y=>{u.push(y);let v=Math.max(0,(typeof y.vars.duration=="number"?y.vars.duration:.5)*1e3);p=Math.max(p,y.atMs+v)},b={to(y,v,x){return m({kind:"to",target:y,vars:v,atMs:h(x)}),b},fromTo(y,v,x,w){return m({kind:"fromTo",target:y,vars:x,from:v,atMs:h(w)}),b},play(){var y,v;if(f)return b;f=!0,g=[];for(let x of u)x.kind==="fromTo"&&c.set(x.target,(y=x.from)!=null?y:{}),g.push(c.to(x.target,{...x.vars,delay:x.atMs/1e3+((v=x.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=[],f=!1}};return d.paused||b.play(),b}};return c}function Fc(){if(typeof window=="undefined")return;let e=window;if(!e.gsap)try{e.gsap=Bc()}catch{}}var $c={name:"handler-playable-sdk",version:"0.3.34",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",sharp:"^0.34.5"}};var ye=0,lm=ye++,Hc=ye++,Uc=ye++,qc=ye++,Gc=ye++,Wc=ye++,Vc=ye++,Yc=ye++,Kc=ye++,Xc=ye++,Zc=ye++,Jc=ye++,K=lm;function Qc(){return K===Hc}function ed(){return K===Uc}function td(){return K===qc}function id(){return K===Gc}function pi(){return K===Wc}function fi(){return K===Vc}function nd(){return K===Yc}function rd(){return K===Kc}function ad(){return K===Xc}function vs(){return K===Zc}function xs(){return K===Jc}function sd(){let e=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",t=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(e==="mraid")try{mraid.getState(),K=Hc;return}catch{}else if(e==="dapi")try{dapi.isReady(),K=Uc;return}catch{}if(t==="facebook")try{typeof FbPlayableAd!="undefined"&&(K=qc)}catch{}else if(t==="google")try{typeof ExitApi!="undefined"&&(K=Gc)}catch{}else if(t==="mintegral")window.gameReady&&(K=Wc);else if(t==="tapjoy")window.TJ_API&&(K=Vc);else if(t==="tiktok")window.openAppStore&&(K=Yc);else if(t==="smadex")try{window.smxTracking&&(K=Kc)}catch{}else if(t==="snapchat")try{window.ScPlayableAd&&(K=Xc)}catch{}else t==="vungle"?K=Zc:(e==="nucleo"||t==="nucleo")&&(K=Jc)}var br=di(require("lottie-web"),1),ws=br.default;typeof window!="undefined"&&(window.lottie=br.default,window.__baseLottie=br.default);var cm=require("pixi.js");var _s=require("pixi.js");var dm=null;function Es(e){dm=e}yr();Ss();var on=require("pixi.js");yr();var mm=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",ks=mm;if(typeof window!="undefined")try{let e=new XMLHttpRequest;if(e.open("GET","./build-settings.json",!1),e.send(),e.status===200&&e.responseText){let t=JSON.parse(e.responseText);t!=null&&t.buildMode&&(ks=t.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${ks}`))}}catch{}var mt=class{static async create(t,i,n){var l,c,d,u,p,f,g;console.log(`[ObjectFactory] create() called for: ${t}, __BUILD_MODE__: ${ks}`);let r=(l=i==null?void 0:i.render)==null?void 0:l.asset;if(!r){console.log(`[ObjectFactory] No asset definition for: ${t}, returning empty container`);let h=new on.Container;return this.applyTransform(h,i==null?void 0:i.transform),h}let a=(c=i==null?void 0:i.identity)==null?void 0:c.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${t}, configId: ${a}, type: ${r.type}, path: ${r.path}`);let s=await Bt.load(t,r,n,a);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${t}, rawAsset type: ${(d=s==null?void 0:s.constructor)==null?void 0:d.name}`);let o;if(r.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",s,"for object:",t),o=new on.Sprite(s),console.log("[ObjectFactory] Created object:",o,"type:",(u=o==null?void 0:o.constructor)==null?void 0:u.name),this.applyTransform(o,i==null?void 0:i.transform);else if(r.type==="json")if(console.log("[ObjectFactory] JSON asset for",t,"rawAsset type:",(p=s==null?void 0:s.constructor)==null?void 0:p.name,s),s&&(((f=s.constructor)==null?void 0:f.name)==="Container"||s instanceof on.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let h=[r.path,`/assets/${r.path}`,`assets/${r.path}`,`../assets/${r.path}`],m=!1;for(let b of h)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=s)}else o=s;else o=s,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,i==null?void 0:i.transform);return o}static applyTransform(t,i){var n,r,a,s;!i||!t||(i.position&&("x"in t&&"y"in t?(t.x=(n=i.position.x)!=null?n:0,t.y=(r=i.position.y)!=null?r:0):"position"in t&&t.position&&t.position.set((a=i.position.x)!=null?a:0,(s=i.position.y)!=null?s:0)),i.scale!==void 0&&"scale"in t&&t.scale&&(typeof t.scale=="object"&&"set"in t.scale?t.scale.set(i.scale):t.scale=i.scale),i.rotation!==void 0&&"rotation"in t&&(t.rotation=i.rotation),i.anchor&&"anchor"in t&&t.anchor&&Array.isArray(i.anchor)&&("set"in t.anchor?t.anchor.set(i.anchor[0],i.anchor[1]):(t.anchor.x=i.anchor[0],t.anchor.y=i.anchor[1])))}};var ln=class{constructor(){this.config=null}init(t){this.config=t}get(t){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return this.config.objects.get(t)}getAllIds(){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return Array.from(this.config.objects.keys())}has(t){return this.config?this.config.objects.has(t):!1}};var vm=di(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=vm);hi();var vr=require("pixi.js");hi();var Is=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new ln}init(t,i){this.registry.init(t),this.app=i}updateConfig(t){this.registry.init(t),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let i=this.registry.getAllIds().filter(r=>!this.instanceCache.has(r));if(i.length===0)return;let n=async r=>{r.length&&(console.log("[Assets] Loading objects:",r),await Promise.all(r.map(async a=>{var o;let s=this.registry.get(a);if(!s){console.warn("[Assets] No config found for object:",a);return}try{let l=await mt.create(a,s,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 n(i);let r=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));r.length>0&&(console.warn("[Assets] Retrying missing assets:",r),await n(r)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(t){let i=this.registry.get(t);if(i){let n=await mt.create(t,i,this.app);this.instanceCache.set(t,n)}}get(t){return this.instanceCache.get(t)}},xm=new Is,wm=new Proxy(xm,{get(e,t){if(t in e&&typeof e[t]=="function")return e[t].bind(e);if(e.get(t))return e.get(t)}});hi();var pd=require("pixi.js"),Ze={width:400,height:600,designWidth:400,scaleFactor:1},wr={scale:1,position:1},Ps=[];function Em(e,t,i,n,r,a,s){Ps.push({element:e,originalScale:a,positionHelper:t,heightPercent:r}),t(e,i,n,r,a,s,!1)}function Sm(){Ps.forEach(({element:e,originalScale:t,positionHelper:i,heightPercent:n})=>{let r=t*Ze.scaleFactor;i(e,Ze.width,Ze.height,n,r,!0,!1)})}function Ms(e,t){console.log(`[SCREEN] updateScreenState called: ${e}x${t}`),Ze.width=e,Ze.height=t,Ze.scaleFactor=Math.min(e/Ze.designWidth,1.15),wr.scale=Ze.scaleFactor,wr.position=1,console.log(`[SCREEN] Global multipliers - scale: ${wr.scale.toFixed(3)}`),Sm()}var dn={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 Am(e,t,i){let n=dn[e];n&&n[t]!==void 0&&(n[t]=i,console.log(`Updated ${e}.${t} = ${i}`))}function Cm(){return dn}var Tm={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 xr(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}function _r(e,t={x:.5,y:.5}){var i;if(Array.isArray(e))return{x:xr(e[0],t.x),y:xr(e[1],t.y)};if(e&&typeof e=="object"){let n=e;return{x:xr(n.x,t.x),y:xr(n.y,t.y)}}if(typeof e=="string"){let n=e.trim().toLowerCase();return(i=Tm[n])!=null?i:t}return t}function fd(e,t,i,n={}){var f,g,h,m,b,y;let r=_r(i),a=(f=n.inset)!=null?f:{},s=(g=n.padding)!=null?g:{x:0,y:0},o=((h=a.left)!=null?h:0)+s.x,l=((m=a.right)!=null?m:0)+s.x,c=((b=a.top)!=null?b:0)+s.y,d=((y=a.bottom)!=null?y:0)+s.y,u=Math.max(0,e-o-l),p=Math.max(0,t-c-d);return{x:o+u*r.x,y:c+p*r.y}}function hd(e,t,i,n={}){var h,m,b,y,v,x;let r=(h=n.inset)!=null?h:{},a=(m=n.padding)!=null?m:{x:0,y:0},s=((b=r.left)!=null?b:0)+a.x,o=((y=r.right)!=null?y:0)+a.x,l=((v=r.top)!=null?v:0)+a.y,c=((x=r.bottom)!=null?x:0)+a.y,d=Math.max(0,e-s-o),u=Math.max(0,t-l-c),p=_r(i,{x:.5,y:.5}),f=Math.min(Math.max(p.x,0),1),g=Math.min(Math.max(p.y,0),1);return{x:s+d*f,y:l+u*g}}if(typeof window!="undefined"){let e=window.innerWidth,t=window.innerHeight,i=()=>{let n=window.innerWidth,r=window.innerHeight;(n!==e||r!==t)&&(e=n,t=r,Ms(n,r))};window.addEventListener("resize",i),window.addEventListener("orientationchange",()=>{setTimeout(i,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",i),window.mraid.addEventListener("sizeChange",i)),Ms(window.innerWidth,window.innerHeight),window.updateDebugConfig=Am,window.getDebugConfig=Cm,window.copyConfig=Nm,window.applyConfig=cn,window.applyConfigForRatio=Bm,window.positionAtBottom=gd,window.positionAtTop=Om,window.positionAtCenter=Im,window.positionAtLeft=Mm,window.positionAtRight=Pm,window.positionAtBottomLeft=Rm,window.positionAtBottomRight=jm,window.positionAtTopLeft=Dm,window.positionAtTopRight=zm,window.applyPositionContract=Lm,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 Er(e,t,i=0){return e*t+i}function Sr(e,t,i=0){return e*(1-t)+i}function Ar(e,t,i=0){return e*t+i}function Cr(e,t,i=0){return e*(1-t)+i}function ve(e,t=0){return e/2+t}function km(e,t){return e*t}function Lm(e,t,i,n){var s,o,l,c,d,u,p,f,g,h,m,b,y,v,x,w,E,A,_,T;let r=0,a=0;switch(n.type){case"top":r=ve(t,(o=(s=n.offset)==null?void 0:s.x)!=null?o:0),a=Er(i,n.percent,(c=(l=n.offset)==null?void 0:l.y)!=null?c:0);break;case"bottom":r=ve(t,(u=(d=n.offset)==null?void 0:d.x)!=null?u:0),a=Sr(i,n.percent,(f=(p=n.offset)==null?void 0:p.y)!=null?f:0);break;case"left":r=Ar(t,n.percent,(h=(g=n.offset)==null?void 0:g.x)!=null?h:0),a=ve(i,(b=(m=n.offset)==null?void 0:m.y)!=null?b:0);break;case"right":r=Cr(t,n.percent,(v=(y=n.offset)==null?void 0:y.x)!=null?v:0),a=ve(i,(w=(x=n.offset)==null?void 0:x.y)!=null?w:0);break;case"center":r=ve(t,(A=(E=n.offset)==null?void 0:E.x)!=null?A:0),a=ve(i,(T=(_=n.offset)==null?void 0:_.y)!=null?T:0);break}e.position?e.position.set(r,a):(e.x=r,e.y=a),n.scale!==void 0&&n.scale!==1&&e.scale&&(typeof e.scale.set=="function"?e.scale.set(n.scale,n.scale):(e.scale.x=n.scale,e.scale.y=n.scale))}function gd(e,t,i,n=.2,r=1,a=!0,s=!1){let o=km(i,n),l=Sr(i,n/2);Je(e,ve(t),l);let c=a?r*Ze.scaleFactor:r;Qe(e,c),s&&!Ps.find(d=>d.element===e)&&Em(e,gd,t,i,n,r,a)}function Om(e,t,i,n=.1,r=1){Je(e,ve(t),Er(i,n)),Qe(e,r)}function Im(e,t,i,n=0,r=0,a=1){Je(e,ve(t,n),ve(i,r)),Qe(e,a)}function Mm(e,t,i,n=.1,r=1){Je(e,Ar(t,n),ve(i)),Qe(e,r)}function Pm(e,t,i,n=.1,r=1){Je(e,Cr(t,n),ve(i)),Qe(e,r)}function Rm(e,t,i,n=.05,r=.05,a=1){Je(e,Ar(t,r),Sr(i,n)),Qe(e,a)}function jm(e,t,i,n=.05,r=.05,a=1){Je(e,Cr(t,r),Sr(i,n)),Qe(e,a)}function Dm(e,t,i,n=.05,r=.05,a=1){Je(e,Ar(t,r),Er(i,n)),Qe(e,a)}function zm(e,t,i,n=.05,r=.05,a=1){Je(e,Cr(t,r),Er(i,n)),Qe(e,a)}function Je(e,t,i){e&&e.position?typeof e.position.set=="function"?e.position.set(t,i):(e.position.x=t,e.position.y=i):e&&(e.x=t,e.y=i)}function Qe(e,t){t!==1&&e&&e.scale&&(typeof e.scale.set=="function"?e.scale.set(t,t):e.scale.x!==void 0&&e.scale.y!==void 0&&(e.scale.x=t,e.scale.y=t))}var Ft={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 Nm(e){return e&&Ft[e]?JSON.parse(JSON.stringify(Ft[e])):JSON.parse(JSON.stringify(dn))}function cn(e){Object.keys(e).forEach(t=>{let i=t;dn[i]&&e[i]&&Object.assign(dn[i],e[i])}),console.log("Config applied:",e)}function Bm(e,t){let i=e/t;i>1.6?(cn(Ft.wide),console.log("Applied WIDE config for ratio:",i)):i<.7?(cn(Ft.tall),console.log("Applied TALL config for ratio:",i)):i>.8&&i<1.2?(cn(Ft.square),console.log("Applied SQUARE config for ratio:",i)):(cn(Ft.default),console.log("Applied DEFAULT config for ratio:",i))}if(typeof window!="undefined"){let e=window;e.configPresets=Ft,e.resolveAnchorVec2=e.resolveAnchorVec2||_r,e.resolveScreenAnchorPoint=e.resolveScreenAnchorPoint||fd,e.resolveScreenRatioPoint=e.resolveScreenRatioPoint||hd}zr();function te(e,t){let i=(r,a)=>a===0?r:i(a,r%a),n=i(e,t);return`${e/n}:${t/n}`}var D_=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:te(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:te(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:te(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:te(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:te(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:te(360,780)}],z_=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:te(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:te(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:te(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:te(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:te(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:te(412,915)}],N_=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:te(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:te(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:te(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:te(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:te(800,1280)}],Gs=[{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:te(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:te(768,1024),mraidScale:.7}];var Ws=[...Gs],Vs=[{category:"playable",label:"Playable Ad",devices:Gs}],Nr=Gs[0];function Ut(e){return Ws.find(t=>t.id===e)||Nr}function Xm(e){return Ws.filter(t=>t.category===e)}var Br=class{constructor(){this.root=null;this.listContainer=null;this.searchInput=null;this.selectedId=null;this.options=null;this.retryTimer=null;this.screenFilter="all"}getScreenFilterStorageKey(){return`handler_preview_screen_filter::${typeof window!="undefined"&&window.__HANDLER_PROJECT_ID||"default"}`}render(){return`
48
48
  <div class="scene-panel scene-objects panel-accent-teal" data-panel="scene-objects" style="left:16px; top:72px;">
49
49
  <div class="scene-panel-header" data-panel-handle>
50
50
  <div class="panel-title">
package/dist/index.css CHANGED
@@ -3384,6 +3384,128 @@
3384
3384
  filter: grayscale(1);
3385
3385
  opacity: 0.5;
3386
3386
  }
3387
+ /* Version Management Section */
3388
+ .version-management-section {
3389
+ margin-top: 16px;
3390
+ padding: 12px;
3391
+ background: rgba(30, 35, 45, 0.5);
3392
+ border: 1px solid var(--ui-border);
3393
+ border-radius: 10px;
3394
+ }
3395
+
3396
+ .version-header {
3397
+ margin-bottom: 12px;
3398
+ }
3399
+
3400
+ .version-label {
3401
+ font-size: 11px;
3402
+ font-weight: 700;
3403
+ text-transform: uppercase;
3404
+ letter-spacing: 0.05em;
3405
+ color: var(--ui-accent);
3406
+ }
3407
+
3408
+ .version-controls {
3409
+ display: flex;
3410
+ flex-direction: column;
3411
+ gap: 12px;
3412
+ }
3413
+
3414
+ .version-current {
3415
+ display: flex;
3416
+ align-items: center;
3417
+ gap: 8px;
3418
+ }
3419
+
3420
+ .version-current label {
3421
+ font-size: 12px;
3422
+ color: var(--ui-text);
3423
+ min-width: 110px;
3424
+ font-weight: 600;
3425
+ }
3426
+
3427
+ .version-dropdown {
3428
+ flex: 1;
3429
+ padding: 8px 10px;
3430
+ border: 1px solid var(--ui-border);
3431
+ border-radius: 6px;
3432
+ background: var(--ui-surface);
3433
+ color: var(--ui-text);
3434
+ font-size: 12px;
3435
+ cursor: pointer;
3436
+ transition: border-color var(--ui-duration-fast);
3437
+ }
3438
+
3439
+ .version-dropdown:hover {
3440
+ border-color: var(--ui-accent);
3441
+ }
3442
+
3443
+ .version-dropdown:focus {
3444
+ outline: none;
3445
+ border-color: var(--ui-accent);
3446
+ box-shadow: 0 0 0 2px rgba(61, 214, 198, 0.2);
3447
+ }
3448
+
3449
+ .persistence-btn {
3450
+ padding: 10px 16px;
3451
+ background: var(--ui-surface);
3452
+ color: var(--ui-text);
3453
+ border: 1px solid var(--ui-border);
3454
+ border-radius: 8px;
3455
+ font-size: 11px;
3456
+ font-weight: 700;
3457
+ cursor: pointer;
3458
+ transition: all var(--ui-duration-fast);
3459
+ }
3460
+
3461
+ .persistence-btn:hover:not(:disabled) {
3462
+ background: rgba(61, 214, 198, 0.1);
3463
+ border-color: var(--ui-accent);
3464
+ }
3465
+
3466
+ .persistence-btn:disabled {
3467
+ opacity: 0.5;
3468
+ cursor: not-allowed;
3469
+ }
3470
+
3471
+ /* Developer-Only Section */
3472
+ .dev-only-section {
3473
+ margin-top: 16px;
3474
+ padding: 12px;
3475
+ background: rgba(255, 165, 0, 0.08);
3476
+ border: 1px solid rgba(255, 165, 0, 0.3);
3477
+ border-radius: 8px;
3478
+ }
3479
+
3480
+ .dev-warning {
3481
+ font-size: 11px;
3482
+ color: #ff8c00;
3483
+ font-weight: 700;
3484
+ margin-bottom: 8px;
3485
+ text-transform: uppercase;
3486
+ letter-spacing: 0.05em;
3487
+ }
3488
+
3489
+ .persistence-btn.danger-action {
3490
+ background: #dc3545;
3491
+ border-color: #dc3545;
3492
+ color: white;
3493
+ width: 100%;
3494
+ }
3495
+
3496
+ .persistence-btn.danger-action:hover:not(:disabled) {
3497
+ background: #c82333;
3498
+ border-color: #c82333;
3499
+ box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
3500
+ }
3501
+
3502
+ .dev-hint {
3503
+ margin-top: 8px;
3504
+ font-size: 10px;
3505
+ color: var(--ui-muted);
3506
+ font-style: italic;
3507
+ line-height: 1.4;
3508
+ }
3387
3509
 
3388
3510
 
3389
3511
  /* ========== 08-inspector.css ========== */
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{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,T as U,U as V,a}from"./chunk-JCCU6XJF.js";import"./chunk-I5OOVR5U.js";import{a as q,b as r,c as s,d as t,e as u,f as v,g as w,h as x,i as y,j as z,k as A,l as B,m as C,n as D,o as E}from"./chunk-LV4HGC5G.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}from"./chunk-ZLL42OOV.js";import"./chunk-E6WJCS24.js";import"./chunk-Q7FPWOA3.js";export{Q as COLORS,B as ConfigWatcher,K as DebugPanel,A as DefaultReloadStrategy,U as Handler,T as PlayableLoadingScreen,L as PreviewShell,R as STROKE_WIDTH,S as THEME,d as applyConfigOverride,e as applyConfigOverrides,n as applyConfigsToDisk,x as applyDefaults,a as baseLottie,P as bootstrap,f as clearConfigOverrides,g as clearConfigOverridesForObject,j as configOverrideManager,M as createPreviewShell,k as deepClone,V as default,H as defaultPreset,G as deviceGroups,F as devicePresets,C as diffConfigs,l as exportConfigsAsJSON,i as getConfigOverrides,m as getConfigStateSummary,b as getOverrideMode,I as getPresetById,J as getPresetsByCategory,s as loadAllObjectConfigs,q as loadComponentSchemas,t as loadEngineConfig,u as loadGamePromptConfig,y as loadObjectCentricConfig,r as loadObjectConfig,v as loadSceneConfig,D as rehydrateObject,h as removeConfigOverride,o as resetToApplied,p as resetToOriginal,O as setBootstrapDependencies,c as setOverrideMode,E as setupHotReload,N as setupLiveEditBridge,z as toLegacyFormat,w as validateObjectConfig};
1
+ import{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,T as U,U as V,a}from"./chunk-PHSE57CN.js";import"./chunk-I5OOVR5U.js";import{a as q,b as r,c as s,d as t,e as u,f as v,g as w,h as x,i as y,j as z,k as A,l as B,m as C,n as D,o as E}from"./chunk-LV4HGC5G.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}from"./chunk-ZLL42OOV.js";import"./chunk-E6WJCS24.js";import"./chunk-Q7FPWOA3.js";export{Q as COLORS,B as ConfigWatcher,K as DebugPanel,A as DefaultReloadStrategy,U as Handler,T as PlayableLoadingScreen,L as PreviewShell,R as STROKE_WIDTH,S as THEME,d as applyConfigOverride,e as applyConfigOverrides,n as applyConfigsToDisk,x as applyDefaults,a as baseLottie,P as bootstrap,f as clearConfigOverrides,g as clearConfigOverridesForObject,j as configOverrideManager,M as createPreviewShell,k as deepClone,V as default,H as defaultPreset,G as deviceGroups,F as devicePresets,C as diffConfigs,l as exportConfigsAsJSON,i as getConfigOverrides,m as getConfigStateSummary,b as getOverrideMode,I as getPresetById,J as getPresetsByCategory,s as loadAllObjectConfigs,q as loadComponentSchemas,t as loadEngineConfig,u as loadGamePromptConfig,y as loadObjectCentricConfig,r as loadObjectConfig,v as loadSceneConfig,D as rehydrateObject,h as removeConfigOverride,o as resetToApplied,p as resetToOriginal,O as setBootstrapDependencies,c as setOverrideMode,E as setupHotReload,N as setupLiveEditBridge,z as toLegacyFormat,w as validateObjectConfig};
@@ -44,7 +44,7 @@
44
44
  <button class="debug-btn primary" data-modal-apply>Apply</button>
45
45
  </div>
46
46
  </div>
47
- `,this.modal=n}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(s=>{s.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(s=>{s.addEventListener("click",o=>{let l=o.target.dataset.tab;l&&this.switchTab(l)})});let n=this.modal.querySelector("[data-ai-generate]");n==null||n.addEventListener("click",()=>{this.openAiEditor("generate")});let r=this.modal.querySelector("[data-ai-edit]");r==null||r.addEventListener("click",()=>{this.openAiEditor("edit")});let a=this.modal.querySelector("[data-modal-apply]");a==null||a.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",s=>{s.target===this.modal&&this.close()})}switchTab(t){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-tab")===t)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-tab-panel")===t)})}openAiEditor(t){let i=window.__openAiEditor;if(typeof i!="function"){alert("AI Editor not available. Please check your setup.");return}let n="";t==="edit"&&this.currentAsset?n=`Edit this image: ${this.currentObjectId}`:n=`Create an image for: ${this.currentObjectId}`,i(this.currentObjectId||"unknown",n,this.currentAsset,{path:this.currentPath,onApply:r=>{this.onApplyCallback&&this.onApplyCallback(r),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 $v={};rl($v,{AssetCache:()=>Be,AssetLoader:()=>xt,AssetSystem:()=>Qr,AssetTextures:()=>wt,Assets:()=>jf,BaseSystem:()=>Oi,GameEngine:()=>Jr,GameObject:()=>Dn,GameObjectManager:()=>ki,ObjectFactory:()=>_t,Renderer:()=>jn,RuntimeObjectRegistry:()=>Ii,Transform:()=>Rn,applyScreenAnchor:()=>ia,basePixi:()=>If,clearResponsiveElements:()=>zf,createPixiBase:()=>Xr,getRegisteredFontIds:()=>Tf,globalResponsiveMultipliers:()=>Nn,initAssetTextures:()=>Ur,initAssets:()=>Df,layout:()=>Bf,playLottieOverlay:()=>Lf,registerFont:()=>Cf,registerType:()=>$r,resolveAnchorVec2:()=>Bn,resolveFont:()=>Sf,resolveFontWeight:()=>Af,resolveScreenAnchorPoint:()=>Mi,resolveScreenRatioPoint:()=>Pi,runInitSequence:()=>Ff,setLottieInstance:()=>qr,spawnSceneFromConfig:()=>Pf,updateScreenState:()=>ta});module.exports=Wf($v);var Ef=require("pixi.js");var st={};function Gn(e,t,i=!1){st[e]||(st[e]=[]),st[e].push({fn:t,once:i})}function ca(e,t){if(st[e]){if(!t){delete st[e];return}st[e]=st[e].filter(i=>i.fn!==t)}}function Wn(e,...t){let i=st[e];if(i)for(let n of[...i])n.fn(...t),n.once&&ca(e,n.fn)}function ge(e,t){Gn(e,t,!0)}var X=null,Ee=[],qt=null;function ll(e){X=e,Ee=[],qt!==null&&(clearTimeout(qt),qt=null)}function cl(){var e,t,i;return{endpoint:(X==null?void 0:X.endpoint)||"",transport:(X==null?void 0:X.transport)||"beacon",batchSize:(e=X==null?void 0:X.batchSize)!=null?e:10,flushIntervalMs:(t=X==null?void 0:X.flushIntervalMs)!=null?t:300,maxQueue:(i=X==null?void 0:X.maxQueue)!=null?i:200,debug:!!(X!=null&&X.debug)}}async function sl(e,t,i,n){let r=JSON.stringify(t);if(i==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let a=navigator.sendBeacon(e,new Blob([r],{type:"application/json"}));n&&console.log("[handler.telemetry] beacon",a,t);return}catch(a){n&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",a)}try{await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:r,keepalive:!0}),n&&console.log("[handler.telemetry] fetch",t)}catch(a){n&&console.warn("[handler.telemetry] fetch failed",a)}}function da(e,t){let i=cl();if(t&&i.endpoint){if(Ee.push(e),Ee.length>i.maxQueue&&(Ee=Ee.slice(Ee.length-i.maxQueue)),Ee.length>=i.batchSize){ol();return}qt===null&&(qt=window.setTimeout(()=>{qt=null,ol()},i.flushIntervalMs))}}async function ol(){let e=cl();if(!e.endpoint||Ee.length===0)return;let t=Ee.splice(0,e.batchSize);await sl(e.endpoint,{events:t},e.transport,e.debug),Ee.length>0&&await sl(e.endpoint,{events:Ee.splice(0,e.batchSize)},e.transport,e.debug)}function dl(e){return Math.max(0,Math.min(1,e))}function Vf(e){let t=String(e!=null?e:"power2.out");if(t==="linear")return i=>i;if(t==="sine.inOut")return i=>.5-Math.cos(Math.PI*i)/2;if(t==="power2.out"||t==="easeOutQuad")return i=>1-(1-i)*(1-i);if(t.startsWith("back.out")){let i=t.match(/back\.out\(([\d.]+)\)/),n=i?Number(i[1]):1.8;return r=>1+(n+1)*Math.pow(r-1,3)+n*Math.pow(r-1,2)}return i=>1-(1-i)*(1-i)}function Hi(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Yf(e,t){let i=e==null?void 0:e[t];return typeof i=="number"?i:0}function ul(e,t,i){try{e[t]=i}catch{}}function Kf(e){let t=e==null?void 0:e.scale;if(!t)return null;let i=typeof t.x=="number"?t.x:1,n=typeof t.y=="number"?t.y:1;return{x:i,y:n}}function pl(e,t){let i=e==null?void 0:e.scale;if(i)try{typeof i.set=="function"?i.set(t.x,t.y):(typeof i.x=="number"&&(i.x=t.x),typeof i.y=="number"&&(i.y=t.y))}catch{}}function fl(e,t){let i=Kf(e);if(!i)return{from:null,to:null};let n=null,r=null;return typeof t.scale=="number"?(n=t.scale,r=t.scale):t.scale&&typeof t.scale=="object"&&(typeof t.scale.x=="number"&&(n=t.scale.x),typeof t.scale.y=="number"&&(r=t.scale.y)),typeof t.scaleX=="number"&&(n=t.scaleX),typeof t.scaleY=="number"&&(r=t.scaleY),n===null&&r===null?{from:null,to:null}:{from:{x:i.x,y:i.y},to:{x:n!=null?n:i.x,y:r!=null?r:i.y}}}function hl(){let e=new Set,t=new WeakMap,i=null,n=()=>{if(i!=null)return;i=requestAnimationFrame(()=>{i=null,o(),e.size>0&&n()})},r=c=>{var u;e.add(c);let f=(u=t.get(c.target))!=null?u:new Set;f.add(c),t.set(c.target,f),n()},a=c=>{e.delete(c);let f=t.get(c.target);f&&(f.delete(c),f.size===0&&t.delete(c.target))},s=c=>{c.killed||(c.killed=!0,a(c))},o=()=>{var f,u;let c=Hi();for(let p of Array.from(e)){if(p.killed||p.paused)continue;let v=c-p.startMs-p.delayMs;if(v<0)continue;let m=p.durationMs>0?v/p.durationMs:1,w=dl(m),g=p.repeat>=0?p.repeat+1:1,h=p.repeat>0?Math.min(Math.floor(m),g-1):0;if(p.repeat>0&&m>=1){let b=m-h;w=dl(b)}let x=p.ease(w);p.yoyo&&h%2===1&&(x=1-x);for(let b of p.props)ul(p.target,b.key,b.from+(b.to-b.from)*x);p.scaleFrom&&p.scaleTo&&pl(p.target,{x:p.scaleFrom.x+(p.scaleTo.x-p.scaleFrom.x)*x,y:p.scaleFrom.y+(p.scaleTo.y-p.scaleFrom.y)*x});try{(f=p.onUpdate)==null||f.call(p)}catch{}if(m>=g){s(p);try{(u=p.onComplete)==null||u.call(p)}catch{}}}},d=(c,f,u)=>{var b;let p=Math.max(0,(typeof f.duration=="number"?f.duration:.5)*1e3),v=Math.max(0,(typeof f.delay=="number"?f.delay:0)*1e3+((b=u==null?void 0:u.delayMsOverride)!=null?b:0)),m=Vf(f.ease),w=typeof f.repeat=="number"?Math.max(0,f.repeat|0):0,g=f.yoyo===!0,h=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),x=[];for(let C of Object.keys(f)){if(h.has(C))continue;let S=f[C];typeof S=="number"&&x.push({key:C,from:Yf(c,C),to:S})}let y=fl(c,f);return{target:c,startMs:Hi(),delayMs:v,durationMs:p,ease:m,props:x,scaleFrom:y.from,scaleTo:y.to,repeat:w,yoyo:g,onUpdate:typeof f.onUpdate=="function"?f.onUpdate:void 0,onComplete:typeof f.onComplete=="function"?f.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},l={to(c,f){let u=d(c,f);return r(u),{kill:()=>s(u),pause:()=>{u.paused||(u.paused=!0,u.pauseAtMs=Hi())},resume:()=>{var m;if(!u.paused)return;let p=(m=u.pauseAtMs)!=null?m:Hi(),v=Hi()-p;u.startMs+=v,u.paused=!1,u.pauseAtMs=null},isActive:()=>!u.killed&&!u.paused}},fromTo(c,f,u){return l.set(c,f),l.to(c,u)},set(c,f){if(!c||!f)return;for(let p of Object.keys(f)){let v=f[p];p==="scale"||p==="scaleX"||p==="scaleY"||typeof v=="number"&&ul(c,p,v)}let u=fl(c,f);u.to&&pl(c,u.to)},killTweensOf(c){let f=t.get(c);if(f)for(let u of Array.from(f))s(u)},timeline(c={}){let f=[],u=0,p=!1,v=[],m=h=>{if(typeof h=="number")return Math.max(0,h*1e3);let x=typeof h=="string"?h.trim():"";return x.startsWith("+=")?u+Math.max(0,Number(x.slice(2))*1e3||0):x?Math.max(0,Number(x)*1e3||0):u},w=h=>{f.push(h);let x=Math.max(0,(typeof h.vars.duration=="number"?h.vars.duration:.5)*1e3);u=Math.max(u,h.atMs+x)},g={to(h,x,y){return w({kind:"to",target:h,vars:x,atMs:m(y)}),g},fromTo(h,x,y,b){return w({kind:"fromTo",target:h,vars:y,from:x,atMs:m(b)}),g},play(){var h,x;if(p)return g;p=!0,v=[];for(let y of f)y.kind==="fromTo"&&l.set(y.target,(h=y.from)!=null?h:{}),v.push(l.to(y.target,{...y.vars,delay:y.atMs/1e3+((x=y.vars.delay)!=null?x:0)}));return g},pause(){for(let h of v)h.pause();return g},kill(){for(let h of v)h.kill();v=[],p=!1}};return c.paused||g.play(),g}};return l}function gl(){if(typeof window=="undefined")return;let e=window;if(!e.gsap)try{e.gsap=hl()}catch{}}var ml={name:"handler-playable-sdk",version:"0.3.33",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",sharp:"^0.34.5"}};var me=0,Zf=me++,bl=me++,yl=me++,vl=me++,xl=me++,wl=me++,_l=me++,El=me++,Sl=me++,Al=me++,Cl=me++,Tl=me++,q=Zf;function kl(){return q===bl}function Ll(){return q===yl}function Ol(){return q===vl}function Il(){return q===xl}function Gt(){return q===wl}function Wt(){return q===_l}function Ml(){return q===El}function Pl(){return q===Sl}function Rl(){return q===Al}function ua(){return q===Cl}function pa(){return q===Tl}function jl(){let e=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",t=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(e==="mraid")try{mraid.getState(),q=bl;return}catch{}else if(e==="dapi")try{dapi.isReady(),q=yl;return}catch{}if(t==="facebook")try{typeof FbPlayableAd!="undefined"&&(q=vl)}catch{}else if(t==="google")try{typeof ExitApi!="undefined"&&(q=xl)}catch{}else if(t==="mintegral")window.gameReady&&(q=wl);else if(t==="tapjoy")window.TJ_API&&(q=_l);else if(t==="tiktok")window.openAppStore&&(q=El);else if(t==="smadex")try{window.smxTracking&&(q=Sl)}catch{}else if(t==="snapchat")try{window.ScPlayableAd&&(q=Al)}catch{}else t==="vungle"?q=Cl:(e==="nucleo"||t==="nucleo")&&(q=Tl)}var Vn=qn(require("lottie-web"),1),Dl=Vn.default;typeof window!="undefined"&&(window.lottie=Vn.default,window.__baseLottie=Vn.default);ga();function Z(e,t){let i=(r,a)=>a===0?r:i(a,r%a),n=i(e,t);return`${e/n}:${t/n}`}var xx=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:Z(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:Z(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:Z(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:Z(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:Z(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:Z(360,780)}],wx=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:Z(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:Z(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:Z(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:Z(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:Z(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:Z(412,915)}],_x=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:Z(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:Z(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:Z(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:Z(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:Z(800,1280)}],Fl=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:Z(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:Z(768,1024),mraidScale:.7}];var Ex=[...Fl];var ah=Fl[0];ot();var qy=qn(Jp(),1);function $y(e){return new Promise((t,i)=>{let n=new FileReader;n.onerror=()=>i(new Error("FileReader failed")),n.onload=()=>t(String(n.result||"")),n.readAsDataURL(e)})}function Hy(e){var r;let[t,i]=e.split(","),n=t==null?void 0:t.match(/data:(.*?);base64/);return{base64:i!=null?i:"",mimeType:(r=n==null?void 0:n[1])!=null?r:"image/png"}}async function Uy(e){return await new Promise(t=>{let i=new Image;i.onload=()=>t({width:i.naturalWidth||i.width,height:i.naturalHeight||i.height}),i.onerror=()=>t(null),i.src=e})}async function ao(e){var t,i;try{console.log("[ImageUtils] Fetching image data from URL:",e);let n=await fetch(e);if(!n.ok)return console.warn("[ImageUtils] Fetch failed with status:",n.status,e),null;let r=await n.blob();console.log("[ImageUtils] Blob received, size:",r.size,"type:",r.type);let a=await $y(r),s=await Uy(a),o=Hy(a);return console.log("[ImageUtils] Success resolution:",s==null?void 0:s.width,"x",s==null?void 0:s.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:a,width:(t=s==null?void 0:s.width)!=null?t:0,height:(i=s==null?void 0:s.height)!=null?i:0}}catch(n){return console.error("[ImageUtils] Error fetching image data:",n),null}}async function Br(e,t=30){try{console.log("[ImageUtils] Removing background color...");let i=await new Promise((f,u)=>{let p=new Image;p.onload=()=>f(p),p.onerror=()=>u(new Error("Failed to load image")),p.src=e}),n=document.createElement("canvas");n.width=i.width,n.height=i.height;let r=n.getContext("2d");if(!r)return console.error("[ImageUtils] Failed to get canvas context"),e;r.drawImage(i,0,0);let a=r.getImageData(0,0,n.width,n.height),s=a.data,d=[{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(f=>({r:s[f.offset],g:s[f.offset+1],b:s[f.offset+2]})),l=0;for(let f=0;f<s.length;f+=4){let u=s[f],p=s[f+1],v=s[f+2],m=!1;for(let w of d)if(Math.sqrt(Math.pow(u-w.r,2)+Math.pow(p-w.g,2)+Math.pow(v-w.b,2))<t){m=!0;break}m&&(s[f+3]=0,l++)}return console.log(`[ImageUtils] Removed background from ${l} pixels (4-corner sampling, tolerance: ${t})`),r.putImageData(a,0,0),n.toDataURL("image/png")}catch(i){return console.error("[ImageUtils] Error removing background:",i),e}}var Qp=require("@google/genai");async function so(e,t,i=[],n={}){var r,a,s,o,d,l,c;try{if(!(e!=null&&e.trim()))throw new Error("Gemini API key is required");if(!(t!=null&&t.trim()))throw new Error("Prompt is required");for(let g=0;g<i.length;g++){let h=i[g];if(!h.base64||!h.mimeType)throw new Error(`Image ${g+1} is missing required data`);if(h.base64.length<1e3&&console.warn(`Image ${g+1} data appears very small, may be corrupted`),!h.mimeType.startsWith("image/"))throw new Error(`Image ${g+1} has invalid MIME type: ${h.mimeType}`)}let f=new Qp.GoogleGenAI({apiKey:e}),u="gemini-2.5-flash",p=[t];i.length>0&&i.forEach((g,h)=>{p.push({inlineData:{data:g.base64,mimeType:g.mimeType}}),console.log(`[Gemini] Added image ${h+1}: ${g.mimeType}, size: ${Math.round(g.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${i.length} images and prompt length: ${t.length}`);let v=await f.models.generateContent({model:u,contents:p}),m="",w=(s=(a=(r=v.candidates)==null?void 0:r[0])==null?void 0:a.content)==null?void 0:s.parts;if(w)for(let g of w)g.text&&(m+=g.text);if(!m.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${m.length}`),m}catch(f){throw console.error("[Gemini] API error:",f),(o=f.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."):(d=f.message)!=null&&d.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(l=f.message)!=null&&l.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(c=f.message)!=null&&c.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):f}}var ef=require("@google/genai");async function Fr(e,t,i=[],n={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let r=new ef.GoogleGenAI({apiKey:e}),a=[{text:t}];i.length>0&&i.forEach((o,d)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${d}`),a.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let s=await r.models.generateContent({model:"gemini-2.5-flash-image",contents:a});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!s.candidates||!s.candidates[0]||!s.candidates[0].content||!s.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of s.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let d=o.inlineData.data,l=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${l};base64,${d}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(r){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(r,Object.getOwnPropertyNames(r),2)),r}}var Xy=require("pixi.js");An();ot();var of=require("pixi.js");var Zy=require("pixi.js");ot();function rv(e){return new Promise((t,i)=>{let n=new FileReader;n.onerror=()=>i(new Error("FileReader failed")),n.onload=()=>t(String(n.result||"")),n.readAsDataURL(e)})}function av(e){var r;let[t,i]=e.split(","),n=t==null?void 0:t.match(/data:(.*?);base64/);return{base64:i!=null?i:"",mimeType:(r=n==null?void 0:n[1])!=null?r:"image/png"}}function sv(e){return`
47
+ `,this.modal=n}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(s=>{s.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(s=>{s.addEventListener("click",o=>{let l=o.target.dataset.tab;l&&this.switchTab(l)})});let n=this.modal.querySelector("[data-ai-generate]");n==null||n.addEventListener("click",()=>{this.openAiEditor("generate")});let r=this.modal.querySelector("[data-ai-edit]");r==null||r.addEventListener("click",()=>{this.openAiEditor("edit")});let a=this.modal.querySelector("[data-modal-apply]");a==null||a.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",s=>{s.target===this.modal&&this.close()})}switchTab(t){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-tab")===t)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(r=>{r.classList.toggle("active",r.getAttribute("data-tab-panel")===t)})}openAiEditor(t){let i=window.__openAiEditor;if(typeof i!="function"){alert("AI Editor not available. Please check your setup.");return}let n="";t==="edit"&&this.currentAsset?n=`Edit this image: ${this.currentObjectId}`:n=`Create an image for: ${this.currentObjectId}`,i(this.currentObjectId||"unknown",n,this.currentAsset,{path:this.currentPath,onApply:r=>{this.onApplyCallback&&this.onApplyCallback(r),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 $v={};rl($v,{AssetCache:()=>Be,AssetLoader:()=>xt,AssetSystem:()=>Qr,AssetTextures:()=>wt,Assets:()=>jf,BaseSystem:()=>Oi,GameEngine:()=>Jr,GameObject:()=>Dn,GameObjectManager:()=>ki,ObjectFactory:()=>_t,Renderer:()=>jn,RuntimeObjectRegistry:()=>Ii,Transform:()=>Rn,applyScreenAnchor:()=>ia,basePixi:()=>If,clearResponsiveElements:()=>zf,createPixiBase:()=>Xr,getRegisteredFontIds:()=>Tf,globalResponsiveMultipliers:()=>Nn,initAssetTextures:()=>Ur,initAssets:()=>Df,layout:()=>Bf,playLottieOverlay:()=>Lf,registerFont:()=>Cf,registerType:()=>$r,resolveAnchorVec2:()=>Bn,resolveFont:()=>Sf,resolveFontWeight:()=>Af,resolveScreenAnchorPoint:()=>Mi,resolveScreenRatioPoint:()=>Pi,runInitSequence:()=>Ff,setLottieInstance:()=>qr,spawnSceneFromConfig:()=>Pf,updateScreenState:()=>ta});module.exports=Wf($v);var Ef=require("pixi.js");var st={};function Gn(e,t,i=!1){st[e]||(st[e]=[]),st[e].push({fn:t,once:i})}function ca(e,t){if(st[e]){if(!t){delete st[e];return}st[e]=st[e].filter(i=>i.fn!==t)}}function Wn(e,...t){let i=st[e];if(i)for(let n of[...i])n.fn(...t),n.once&&ca(e,n.fn)}function ge(e,t){Gn(e,t,!0)}var X=null,Ee=[],qt=null;function ll(e){X=e,Ee=[],qt!==null&&(clearTimeout(qt),qt=null)}function cl(){var e,t,i;return{endpoint:(X==null?void 0:X.endpoint)||"",transport:(X==null?void 0:X.transport)||"beacon",batchSize:(e=X==null?void 0:X.batchSize)!=null?e:10,flushIntervalMs:(t=X==null?void 0:X.flushIntervalMs)!=null?t:300,maxQueue:(i=X==null?void 0:X.maxQueue)!=null?i:200,debug:!!(X!=null&&X.debug)}}async function sl(e,t,i,n){let r=JSON.stringify(t);if(i==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let a=navigator.sendBeacon(e,new Blob([r],{type:"application/json"}));n&&console.log("[handler.telemetry] beacon",a,t);return}catch(a){n&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",a)}try{await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:r,keepalive:!0}),n&&console.log("[handler.telemetry] fetch",t)}catch(a){n&&console.warn("[handler.telemetry] fetch failed",a)}}function da(e,t){let i=cl();if(t&&i.endpoint){if(Ee.push(e),Ee.length>i.maxQueue&&(Ee=Ee.slice(Ee.length-i.maxQueue)),Ee.length>=i.batchSize){ol();return}qt===null&&(qt=window.setTimeout(()=>{qt=null,ol()},i.flushIntervalMs))}}async function ol(){let e=cl();if(!e.endpoint||Ee.length===0)return;let t=Ee.splice(0,e.batchSize);await sl(e.endpoint,{events:t},e.transport,e.debug),Ee.length>0&&await sl(e.endpoint,{events:Ee.splice(0,e.batchSize)},e.transport,e.debug)}function dl(e){return Math.max(0,Math.min(1,e))}function Vf(e){let t=String(e!=null?e:"power2.out");if(t==="linear")return i=>i;if(t==="sine.inOut")return i=>.5-Math.cos(Math.PI*i)/2;if(t==="power2.out"||t==="easeOutQuad")return i=>1-(1-i)*(1-i);if(t.startsWith("back.out")){let i=t.match(/back\.out\(([\d.]+)\)/),n=i?Number(i[1]):1.8;return r=>1+(n+1)*Math.pow(r-1,3)+n*Math.pow(r-1,2)}return i=>1-(1-i)*(1-i)}function Hi(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Yf(e,t){let i=e==null?void 0:e[t];return typeof i=="number"?i:0}function ul(e,t,i){try{e[t]=i}catch{}}function Kf(e){let t=e==null?void 0:e.scale;if(!t)return null;let i=typeof t.x=="number"?t.x:1,n=typeof t.y=="number"?t.y:1;return{x:i,y:n}}function pl(e,t){let i=e==null?void 0:e.scale;if(i)try{typeof i.set=="function"?i.set(t.x,t.y):(typeof i.x=="number"&&(i.x=t.x),typeof i.y=="number"&&(i.y=t.y))}catch{}}function fl(e,t){let i=Kf(e);if(!i)return{from:null,to:null};let n=null,r=null;return typeof t.scale=="number"?(n=t.scale,r=t.scale):t.scale&&typeof t.scale=="object"&&(typeof t.scale.x=="number"&&(n=t.scale.x),typeof t.scale.y=="number"&&(r=t.scale.y)),typeof t.scaleX=="number"&&(n=t.scaleX),typeof t.scaleY=="number"&&(r=t.scaleY),n===null&&r===null?{from:null,to:null}:{from:{x:i.x,y:i.y},to:{x:n!=null?n:i.x,y:r!=null?r:i.y}}}function hl(){let e=new Set,t=new WeakMap,i=null,n=()=>{if(i!=null)return;i=requestAnimationFrame(()=>{i=null,o(),e.size>0&&n()})},r=c=>{var u;e.add(c);let f=(u=t.get(c.target))!=null?u:new Set;f.add(c),t.set(c.target,f),n()},a=c=>{e.delete(c);let f=t.get(c.target);f&&(f.delete(c),f.size===0&&t.delete(c.target))},s=c=>{c.killed||(c.killed=!0,a(c))},o=()=>{var f,u;let c=Hi();for(let p of Array.from(e)){if(p.killed||p.paused)continue;let v=c-p.startMs-p.delayMs;if(v<0)continue;let m=p.durationMs>0?v/p.durationMs:1,w=dl(m),g=p.repeat>=0?p.repeat+1:1,h=p.repeat>0?Math.min(Math.floor(m),g-1):0;if(p.repeat>0&&m>=1){let b=m-h;w=dl(b)}let x=p.ease(w);p.yoyo&&h%2===1&&(x=1-x);for(let b of p.props)ul(p.target,b.key,b.from+(b.to-b.from)*x);p.scaleFrom&&p.scaleTo&&pl(p.target,{x:p.scaleFrom.x+(p.scaleTo.x-p.scaleFrom.x)*x,y:p.scaleFrom.y+(p.scaleTo.y-p.scaleFrom.y)*x});try{(f=p.onUpdate)==null||f.call(p)}catch{}if(m>=g){s(p);try{(u=p.onComplete)==null||u.call(p)}catch{}}}},d=(c,f,u)=>{var b;let p=Math.max(0,(typeof f.duration=="number"?f.duration:.5)*1e3),v=Math.max(0,(typeof f.delay=="number"?f.delay:0)*1e3+((b=u==null?void 0:u.delayMsOverride)!=null?b:0)),m=Vf(f.ease),w=typeof f.repeat=="number"?Math.max(0,f.repeat|0):0,g=f.yoyo===!0,h=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),x=[];for(let C of Object.keys(f)){if(h.has(C))continue;let S=f[C];typeof S=="number"&&x.push({key:C,from:Yf(c,C),to:S})}let y=fl(c,f);return{target:c,startMs:Hi(),delayMs:v,durationMs:p,ease:m,props:x,scaleFrom:y.from,scaleTo:y.to,repeat:w,yoyo:g,onUpdate:typeof f.onUpdate=="function"?f.onUpdate:void 0,onComplete:typeof f.onComplete=="function"?f.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},l={to(c,f){let u=d(c,f);return r(u),{kill:()=>s(u),pause:()=>{u.paused||(u.paused=!0,u.pauseAtMs=Hi())},resume:()=>{var m;if(!u.paused)return;let p=(m=u.pauseAtMs)!=null?m:Hi(),v=Hi()-p;u.startMs+=v,u.paused=!1,u.pauseAtMs=null},isActive:()=>!u.killed&&!u.paused}},fromTo(c,f,u){return l.set(c,f),l.to(c,u)},set(c,f){if(!c||!f)return;for(let p of Object.keys(f)){let v=f[p];p==="scale"||p==="scaleX"||p==="scaleY"||typeof v=="number"&&ul(c,p,v)}let u=fl(c,f);u.to&&pl(c,u.to)},killTweensOf(c){let f=t.get(c);if(f)for(let u of Array.from(f))s(u)},timeline(c={}){let f=[],u=0,p=!1,v=[],m=h=>{if(typeof h=="number")return Math.max(0,h*1e3);let x=typeof h=="string"?h.trim():"";return x.startsWith("+=")?u+Math.max(0,Number(x.slice(2))*1e3||0):x?Math.max(0,Number(x)*1e3||0):u},w=h=>{f.push(h);let x=Math.max(0,(typeof h.vars.duration=="number"?h.vars.duration:.5)*1e3);u=Math.max(u,h.atMs+x)},g={to(h,x,y){return w({kind:"to",target:h,vars:x,atMs:m(y)}),g},fromTo(h,x,y,b){return w({kind:"fromTo",target:h,vars:y,from:x,atMs:m(b)}),g},play(){var h,x;if(p)return g;p=!0,v=[];for(let y of f)y.kind==="fromTo"&&l.set(y.target,(h=y.from)!=null?h:{}),v.push(l.to(y.target,{...y.vars,delay:y.atMs/1e3+((x=y.vars.delay)!=null?x:0)}));return g},pause(){for(let h of v)h.pause();return g},kill(){for(let h of v)h.kill();v=[],p=!1}};return c.paused||g.play(),g}};return l}function gl(){if(typeof window=="undefined")return;let e=window;if(!e.gsap)try{e.gsap=hl()}catch{}}var ml={name:"handler-playable-sdk",version:"0.3.34",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",sharp:"^0.34.5"}};var me=0,Zf=me++,bl=me++,yl=me++,vl=me++,xl=me++,wl=me++,_l=me++,El=me++,Sl=me++,Al=me++,Cl=me++,Tl=me++,q=Zf;function kl(){return q===bl}function Ll(){return q===yl}function Ol(){return q===vl}function Il(){return q===xl}function Gt(){return q===wl}function Wt(){return q===_l}function Ml(){return q===El}function Pl(){return q===Sl}function Rl(){return q===Al}function ua(){return q===Cl}function pa(){return q===Tl}function jl(){let e=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",t=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(e==="mraid")try{mraid.getState(),q=bl;return}catch{}else if(e==="dapi")try{dapi.isReady(),q=yl;return}catch{}if(t==="facebook")try{typeof FbPlayableAd!="undefined"&&(q=vl)}catch{}else if(t==="google")try{typeof ExitApi!="undefined"&&(q=xl)}catch{}else if(t==="mintegral")window.gameReady&&(q=wl);else if(t==="tapjoy")window.TJ_API&&(q=_l);else if(t==="tiktok")window.openAppStore&&(q=El);else if(t==="smadex")try{window.smxTracking&&(q=Sl)}catch{}else if(t==="snapchat")try{window.ScPlayableAd&&(q=Al)}catch{}else t==="vungle"?q=Cl:(e==="nucleo"||t==="nucleo")&&(q=Tl)}var Vn=qn(require("lottie-web"),1),Dl=Vn.default;typeof window!="undefined"&&(window.lottie=Vn.default,window.__baseLottie=Vn.default);ga();function Z(e,t){let i=(r,a)=>a===0?r:i(a,r%a),n=i(e,t);return`${e/n}:${t/n}`}var xx=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:Z(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:Z(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:Z(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:Z(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:Z(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:Z(360,780)}],wx=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:Z(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:Z(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:Z(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:Z(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:Z(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:Z(412,915)}],_x=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:Z(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:Z(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:Z(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:Z(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:Z(800,1280)}],Fl=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:Z(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:Z(768,1024),mraidScale:.7}];var Ex=[...Fl];var ah=Fl[0];ot();var qy=qn(Jp(),1);function $y(e){return new Promise((t,i)=>{let n=new FileReader;n.onerror=()=>i(new Error("FileReader failed")),n.onload=()=>t(String(n.result||"")),n.readAsDataURL(e)})}function Hy(e){var r;let[t,i]=e.split(","),n=t==null?void 0:t.match(/data:(.*?);base64/);return{base64:i!=null?i:"",mimeType:(r=n==null?void 0:n[1])!=null?r:"image/png"}}async function Uy(e){return await new Promise(t=>{let i=new Image;i.onload=()=>t({width:i.naturalWidth||i.width,height:i.naturalHeight||i.height}),i.onerror=()=>t(null),i.src=e})}async function ao(e){var t,i;try{console.log("[ImageUtils] Fetching image data from URL:",e);let n=await fetch(e);if(!n.ok)return console.warn("[ImageUtils] Fetch failed with status:",n.status,e),null;let r=await n.blob();console.log("[ImageUtils] Blob received, size:",r.size,"type:",r.type);let a=await $y(r),s=await Uy(a),o=Hy(a);return console.log("[ImageUtils] Success resolution:",s==null?void 0:s.width,"x",s==null?void 0:s.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:a,width:(t=s==null?void 0:s.width)!=null?t:0,height:(i=s==null?void 0:s.height)!=null?i:0}}catch(n){return console.error("[ImageUtils] Error fetching image data:",n),null}}async function Br(e,t=30){try{console.log("[ImageUtils] Removing background color...");let i=await new Promise((f,u)=>{let p=new Image;p.onload=()=>f(p),p.onerror=()=>u(new Error("Failed to load image")),p.src=e}),n=document.createElement("canvas");n.width=i.width,n.height=i.height;let r=n.getContext("2d");if(!r)return console.error("[ImageUtils] Failed to get canvas context"),e;r.drawImage(i,0,0);let a=r.getImageData(0,0,n.width,n.height),s=a.data,d=[{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(f=>({r:s[f.offset],g:s[f.offset+1],b:s[f.offset+2]})),l=0;for(let f=0;f<s.length;f+=4){let u=s[f],p=s[f+1],v=s[f+2],m=!1;for(let w of d)if(Math.sqrt(Math.pow(u-w.r,2)+Math.pow(p-w.g,2)+Math.pow(v-w.b,2))<t){m=!0;break}m&&(s[f+3]=0,l++)}return console.log(`[ImageUtils] Removed background from ${l} pixels (4-corner sampling, tolerance: ${t})`),r.putImageData(a,0,0),n.toDataURL("image/png")}catch(i){return console.error("[ImageUtils] Error removing background:",i),e}}var Qp=require("@google/genai");async function so(e,t,i=[],n={}){var r,a,s,o,d,l,c;try{if(!(e!=null&&e.trim()))throw new Error("Gemini API key is required");if(!(t!=null&&t.trim()))throw new Error("Prompt is required");for(let g=0;g<i.length;g++){let h=i[g];if(!h.base64||!h.mimeType)throw new Error(`Image ${g+1} is missing required data`);if(h.base64.length<1e3&&console.warn(`Image ${g+1} data appears very small, may be corrupted`),!h.mimeType.startsWith("image/"))throw new Error(`Image ${g+1} has invalid MIME type: ${h.mimeType}`)}let f=new Qp.GoogleGenAI({apiKey:e}),u="gemini-2.5-flash",p=[t];i.length>0&&i.forEach((g,h)=>{p.push({inlineData:{data:g.base64,mimeType:g.mimeType}}),console.log(`[Gemini] Added image ${h+1}: ${g.mimeType}, size: ${Math.round(g.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${i.length} images and prompt length: ${t.length}`);let v=await f.models.generateContent({model:u,contents:p}),m="",w=(s=(a=(r=v.candidates)==null?void 0:r[0])==null?void 0:a.content)==null?void 0:s.parts;if(w)for(let g of w)g.text&&(m+=g.text);if(!m.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${m.length}`),m}catch(f){throw console.error("[Gemini] API error:",f),(o=f.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."):(d=f.message)!=null&&d.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(l=f.message)!=null&&l.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(c=f.message)!=null&&c.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):f}}var ef=require("@google/genai");async function Fr(e,t,i=[],n={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let r=new ef.GoogleGenAI({apiKey:e}),a=[{text:t}];i.length>0&&i.forEach((o,d)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${d}`),a.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let s=await r.models.generateContent({model:"gemini-2.5-flash-image",contents:a});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!s.candidates||!s.candidates[0]||!s.candidates[0].content||!s.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of s.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let d=o.inlineData.data,l=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${l};base64,${d}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(r){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(r,Object.getOwnPropertyNames(r),2)),r}}var Xy=require("pixi.js");An();ot();var of=require("pixi.js");var Zy=require("pixi.js");ot();function rv(e){return new Promise((t,i)=>{let n=new FileReader;n.onerror=()=>i(new Error("FileReader failed")),n.onload=()=>t(String(n.result||"")),n.readAsDataURL(e)})}function av(e){var r;let[t,i]=e.split(","),n=t==null?void 0:t.match(/data:(.*?);base64/);return{base64:i!=null?i:"",mimeType:(r=n==null?void 0:n[1])!=null?r:"image/png"}}function sv(e){return`
48
48
  Analyze these screenshots of a brand or game and extract its "Brand DNA".
49
49
 
50
50
  Provide a concise summary (2-3 sentences) covering:
@@ -3384,6 +3384,128 @@
3384
3384
  filter: grayscale(1);
3385
3385
  opacity: 0.5;
3386
3386
  }
3387
+ /* Version Management Section */
3388
+ .version-management-section {
3389
+ margin-top: 16px;
3390
+ padding: 12px;
3391
+ background: rgba(30, 35, 45, 0.5);
3392
+ border: 1px solid var(--ui-border);
3393
+ border-radius: 10px;
3394
+ }
3395
+
3396
+ .version-header {
3397
+ margin-bottom: 12px;
3398
+ }
3399
+
3400
+ .version-label {
3401
+ font-size: 11px;
3402
+ font-weight: 700;
3403
+ text-transform: uppercase;
3404
+ letter-spacing: 0.05em;
3405
+ color: var(--ui-accent);
3406
+ }
3407
+
3408
+ .version-controls {
3409
+ display: flex;
3410
+ flex-direction: column;
3411
+ gap: 12px;
3412
+ }
3413
+
3414
+ .version-current {
3415
+ display: flex;
3416
+ align-items: center;
3417
+ gap: 8px;
3418
+ }
3419
+
3420
+ .version-current label {
3421
+ font-size: 12px;
3422
+ color: var(--ui-text);
3423
+ min-width: 110px;
3424
+ font-weight: 600;
3425
+ }
3426
+
3427
+ .version-dropdown {
3428
+ flex: 1;
3429
+ padding: 8px 10px;
3430
+ border: 1px solid var(--ui-border);
3431
+ border-radius: 6px;
3432
+ background: var(--ui-surface);
3433
+ color: var(--ui-text);
3434
+ font-size: 12px;
3435
+ cursor: pointer;
3436
+ transition: border-color var(--ui-duration-fast);
3437
+ }
3438
+
3439
+ .version-dropdown:hover {
3440
+ border-color: var(--ui-accent);
3441
+ }
3442
+
3443
+ .version-dropdown:focus {
3444
+ outline: none;
3445
+ border-color: var(--ui-accent);
3446
+ box-shadow: 0 0 0 2px rgba(61, 214, 198, 0.2);
3447
+ }
3448
+
3449
+ .persistence-btn {
3450
+ padding: 10px 16px;
3451
+ background: var(--ui-surface);
3452
+ color: var(--ui-text);
3453
+ border: 1px solid var(--ui-border);
3454
+ border-radius: 8px;
3455
+ font-size: 11px;
3456
+ font-weight: 700;
3457
+ cursor: pointer;
3458
+ transition: all var(--ui-duration-fast);
3459
+ }
3460
+
3461
+ .persistence-btn:hover:not(:disabled) {
3462
+ background: rgba(61, 214, 198, 0.1);
3463
+ border-color: var(--ui-accent);
3464
+ }
3465
+
3466
+ .persistence-btn:disabled {
3467
+ opacity: 0.5;
3468
+ cursor: not-allowed;
3469
+ }
3470
+
3471
+ /* Developer-Only Section */
3472
+ .dev-only-section {
3473
+ margin-top: 16px;
3474
+ padding: 12px;
3475
+ background: rgba(255, 165, 0, 0.08);
3476
+ border: 1px solid rgba(255, 165, 0, 0.3);
3477
+ border-radius: 8px;
3478
+ }
3479
+
3480
+ .dev-warning {
3481
+ font-size: 11px;
3482
+ color: #ff8c00;
3483
+ font-weight: 700;
3484
+ margin-bottom: 8px;
3485
+ text-transform: uppercase;
3486
+ letter-spacing: 0.05em;
3487
+ }
3488
+
3489
+ .persistence-btn.danger-action {
3490
+ background: #dc3545;
3491
+ border-color: #dc3545;
3492
+ color: white;
3493
+ width: 100%;
3494
+ }
3495
+
3496
+ .persistence-btn.danger-action:hover:not(:disabled) {
3497
+ background: #c82333;
3498
+ border-color: #c82333;
3499
+ box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
3500
+ }
3501
+
3502
+ .dev-hint {
3503
+ margin-top: 8px;
3504
+ font-size: 10px;
3505
+ color: var(--ui-muted);
3506
+ font-style: italic;
3507
+ line-height: 1.4;
3508
+ }
3387
3509
 
3388
3510
 
3389
3511
  /* ========== 08-inspector.css ========== */
@@ -1 +1 @@
1
- (function(_0x1e6602,_0x41de7b){var a0_0x44e277={_0x1fa3dc:0x65,_0x1c13ed:0x75,_0x5bfee9:'H&*N',_0x475c23:0x73,_0x523ffe:0x6f,_0x3e375d:0x5a,_0x452835:'H]5d',_0x489660:0x4f,_0x2107ba:0x5f,_0x18e3e7:'uNm8',_0x5db868:0x291,_0x1531d5:0x290,_0x5c4ca0:0x28e,_0x96db46:0x279,_0x545504:'REMM',_0x596972:0x26e,_0x13abec:0x26a,_0x376dfe:'2Ucj',_0x217a23:0x1f2,_0x764c59:0x1f6,_0x1dd2fc:0x1e7,_0x104570:'^2F@',_0x2a9143:0x283,_0x339619:0x26c,_0xa6c1d7:'%vQq',_0x3c89e5:0x1d8,_0x411832:0x1d9,_0xd4bd24:0x1cd,_0x38d50a:0x1dd,_0x2b4701:'AEk5',_0x22ad82:0x1de,_0x2f1635:0x1ea,_0x543055:0x52,_0x296393:'8*qW',_0x296fb8:'sf63',_0x31fe97:0x282,_0x4ecc41:0x292,_0x33239d:0x297,_0x52d8dd:0x1e0,_0x2c3221:0x1d5},a0_0x1116f7={_0x4abd87:0x2b5},a0_0x527238={_0x2411b7:0x34f},a0_0x84d09={_0x2374ea:0x7a};function _0xf7f7f2(_0x5bef8a,_0x58d8a7,_0x168a76,_0x3a6970,_0x20f173){return a0_0x2f0e(_0x5bef8a- -a0_0x84d09._0x2374ea,_0x168a76);}function _0x5d48c8(_0x45cace,_0x3d104d,_0x49d255,_0x5c9ab7,_0x34ad9b){return a0_0x2f0e(_0x45cace- -a0_0x527238._0x2411b7,_0x3d104d);}function _0x12b60c(_0x46eb2c,_0x53750c,_0xf9d2e0,_0x105f26,_0x35562b){return a0_0x2f0e(_0x53750c- -a0_0x1116f7._0x4abd87,_0x46eb2c);}var _0x4cefd5=_0x1e6602();while(!![]){try{var _0x302290=parseInt(_0xf7f7f2(a0_0x44e277._0x1fa3dc,a0_0x44e277._0x1c13ed,a0_0x44e277._0x5bfee9,a0_0x44e277._0x475c23,a0_0x44e277._0x523ffe))/(0x108f+-0xf02+-0x18c)*(-parseInt(_0xf7f7f2(a0_0x44e277._0x3e375d,0x4c,a0_0x44e277._0x452835,a0_0x44e277._0x489660,a0_0x44e277._0x2107ba))/(-0x211d+0x54d+0x3*0x946))+parseInt(_0x5d48c8(-0x28d,a0_0x44e277._0x18e3e7,-a0_0x44e277._0x5db868,-a0_0x44e277._0x1531d5,-a0_0x44e277._0x5c4ca0))/(0xe9c+-0xb71*-0x1+-0x1a0a)*(parseInt(_0x5d48c8(-a0_0x44e277._0x96db46,a0_0x44e277._0x545504,-a0_0x44e277._0x596972,-a0_0x44e277._0x13abec,-0x280))/(-0x23c*-0x6+-0xd*0x117+0xc7))+-parseInt(_0x12b60c(a0_0x44e277._0x376dfe,-a0_0x44e277._0x217a23,-a0_0x44e277._0x217a23,-a0_0x44e277._0x764c59,-a0_0x44e277._0x1dd2fc))/(-0x499*0x2+0xb7d+-0x246*0x1)*(-parseInt(_0x5d48c8(-0x27c,a0_0x44e277._0x104570,-0x285,-a0_0x44e277._0x2a9143,-a0_0x44e277._0x339619))/(-0xf5f+-0x16c3*-0x1+-0x75e))+parseInt(_0x12b60c(a0_0x44e277._0xa6c1d7,-a0_0x44e277._0x3c89e5,-a0_0x44e277._0x411832,-a0_0x44e277._0xd4bd24,-a0_0x44e277._0x38d50a))/(-0x523*-0x2+-0x1*-0x3cb+-0x6*0x257)+parseInt(_0x12b60c(a0_0x44e277._0x2b4701,-0x1dd,-a0_0x44e277._0x22ad82,-0x1d6,-a0_0x44e277._0x2f1635))/(0x10b2*-0x2+0x123f+0x1*0xf2d)+-parseInt(_0xf7f7f2(a0_0x44e277._0x543055,0x5b,a0_0x44e277._0x296393,0x59,0x50))/(-0x2*0x659+0x1*-0x2ef+0xfaa)*(parseInt(_0x5d48c8(-0x28f,a0_0x44e277._0x296fb8,-a0_0x44e277._0x31fe97,-a0_0x44e277._0x4ecc41,-a0_0x44e277._0x33239d))/(0x5*0x16f+-0x2*-0x981+-0x1a23))+-parseInt(_0x12b60c('Bn!C',-a0_0x44e277._0x52d8dd,-0x1d0,-a0_0x44e277._0x2f1635,-a0_0x44e277._0x2c3221))/(-0x12b*-0x20+0x7a+0x1*-0x25cf);if(_0x302290===_0x41de7b)break;else _0x4cefd5['push'](_0x4cefd5['shift']());}catch(_0x2c951a){_0x4cefd5['push'](_0x4cefd5['shift']());}}}(a0_0x31c6,-0x9dbc4+0x3*0x17d93+0x121d1e));var a0_0x18d26a=(function(){var _0x57c018=!![];return function(_0x483d4d,_0x5726b6){var a0_0x35c86a={_0x2ff4aa:0x28b,_0x3e2bff:0x294,_0x3d3a32:0x279,_0x3064b5:'REMM',_0x39c7d4:0x287},_0x24a12e=_0x57c018?function(){function _0x554ce4(_0x1e995b,_0x10b012,_0x29b701,_0x19f028,_0x4876e2){return a0_0x2f0e(_0x4876e2- -0x354,_0x19f028);}if(_0x5726b6){var _0x5eb658=_0x5726b6[_0x554ce4(-a0_0x35c86a._0x2ff4aa,-a0_0x35c86a._0x3e2bff,-a0_0x35c86a._0x3d3a32,a0_0x35c86a._0x3064b5,-a0_0x35c86a._0x39c7d4)](_0x483d4d,arguments);return _0x5726b6=null,_0x5eb658;}}:function(){};return _0x57c018=![],_0x24a12e;};}()),a0_0x1c16aa=a0_0x18d26a(this,function(){var a0_0x557dfa={_0x3ff3d6:0xd3,_0x589546:0xd1,_0x59de76:0xce,_0x3d8081:0xd8,_0x2dd513:0xe6,_0x27cc91:0x244,_0x3b2482:0x242,_0x474fa5:0x252,_0x39ffdb:'$4sW',_0x5977ca:0x24a,_0x4423a0:0x283,_0x1eb8a4:0x277,_0x6929de:0x275,_0x24ecfd:0x26c,_0x4b64d5:0x26a,_0x4a565f:0x268,_0x542b7d:0xd7,_0x5761ca:0xdd,_0x2d03a3:0xeb,_0x53d4db:0xe3,_0x40e6be:'KrJ*',_0x486d3e:0x23e,_0x475522:0x245,_0x43d072:'qDT@',_0x1e4c11:0x26e,_0x4abc2f:0x26d,_0x594dd3:0x234,_0x97f90c:'o$4p',_0x33ea05:0x249,_0x64faf6:0x23a,_0x3cc399:0x239,_0x1c59a5:0x23d,_0x17e913:0x237,_0x5636cc:'B5kc',_0x530e77:0x261,_0x5922ce:0x270,_0x31fe5e:0x278,_0x26da9f:'1$vk',_0x3b20ff:0x274,_0x1ccc96:0x267},a0_0x4c2b3f={_0x232bc9:0x17e},a0_0x1a875a={_0x4aeffe:0x1};function _0x3f2bb4(_0x2c699f,_0x1b30d7,_0x210fdc,_0xc3af37,_0x3a6e6d){return a0_0x2f0e(_0x210fdc- -a0_0x1a875a._0x4aeffe,_0x2c699f);}var _0x48afc4={};_0x48afc4[_0x3f2bb4('sf63',a0_0x557dfa._0x3ff3d6,0xda,a0_0x557dfa._0x589546,0xe1)]=_0x3f2bb4('b&3q',a0_0x557dfa._0x59de76,a0_0x557dfa._0x3d8081,a0_0x557dfa._0x3d8081,a0_0x557dfa._0x2dd513)+_0x499e2e(a0_0x557dfa._0x27cc91,'3PlH',0x251,a0_0x557dfa._0x3b2482,0x234)+'+$';function _0x4f8f02(_0x37385e,_0x3f6044,_0x407ae7,_0x249828,_0x42490c){return a0_0x2f0e(_0x249828- -0x33c,_0x37385e);}var _0x12e07e=_0x48afc4;function _0x499e2e(_0x296ef0,_0x53459a,_0x32b85b,_0x33448a,_0x1215b0){return a0_0x2f0e(_0x33448a-a0_0x4c2b3f._0x232bc9,_0x53459a);}return a0_0x1c16aa[_0x499e2e(a0_0x557dfa._0x474fa5,a0_0x557dfa._0x39ffdb,0x254,0x24c,a0_0x557dfa._0x5977ca)+_0x4f8f02('B5kc',-0x285,-a0_0x557dfa._0x4423a0,-a0_0x557dfa._0x1eb8a4,-0x283)]()[_0x4f8f02('pGk(',-a0_0x557dfa._0x6929de,-a0_0x557dfa._0x24ecfd,-a0_0x557dfa._0x4b64d5,-a0_0x557dfa._0x4a565f)+'h'](_0x12e07e[_0x3f2bb4('Vw4#',a0_0x557dfa._0x542b7d,a0_0x557dfa._0x5761ca,a0_0x557dfa._0x2d03a3,a0_0x557dfa._0x53d4db)])[_0x499e2e(0x236,a0_0x557dfa._0x40e6be,a0_0x557dfa._0x486d3e,a0_0x557dfa._0x475522,0x24b)+_0x4f8f02(a0_0x557dfa._0x43d072,-0x26c,-a0_0x557dfa._0x1e4c11,-a0_0x557dfa._0x4abc2f,-a0_0x557dfa._0x4abc2f)]()[_0x499e2e(a0_0x557dfa._0x594dd3,a0_0x557dfa._0x97f90c,a0_0x557dfa._0x33ea05,0x23f,a0_0x557dfa._0x64faf6)+_0x499e2e(a0_0x557dfa._0x3cc399,'2Ucj',0x23f,a0_0x557dfa._0x1c59a5,a0_0x557dfa._0x17e913)+'r'](a0_0x1c16aa)[_0x4f8f02(a0_0x557dfa._0x5636cc,-a0_0x557dfa._0x530e77,-a0_0x557dfa._0x5922ce,-a0_0x557dfa._0x24ecfd,-a0_0x557dfa._0x31fe5e)+'h']('(((.+'+_0x4f8f02(a0_0x557dfa._0x26da9f,-0x281,-0x278,-a0_0x557dfa._0x3b20ff,-a0_0x557dfa._0x1ccc96)+'+$');});function a0_0x2f0e(_0x41855c,_0x3da781){_0x41855c=_0x41855c-(-0x30*-0xb9+0xe3d+-0x1*0x302e);var _0x1a540b=a0_0x31c6();var _0x3162f6=_0x1a540b[_0x41855c];if(a0_0x2f0e['KhuwqH']===undefined){var _0x5f2377=function(_0x74d3be){var _0x3c6372='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x20ffee='',_0x1dd818='',_0x247794=_0x20ffee+_0x5f2377;for(var _0x3db653=-0x1f12+0x1*0x73+-0x1*-0x1e9f,_0x397352,_0x94a125,_0x1fdb7b=0x2*-0x35f+0x1f6e+0x8*-0x316;_0x94a125=_0x74d3be['charAt'](_0x1fdb7b++);~_0x94a125&&(_0x397352=_0x3db653%(0xb*-0x56+-0x165d+-0x1bd*-0xf)?_0x397352*(0x114+-0x277+0x1a3)+_0x94a125:_0x94a125,_0x3db653++%(0x4ac+0x20fd*0x1+-0x25a5))?_0x20ffee+=_0x247794['charCodeAt'](_0x1fdb7b+(0x12b1+0x1c0e+0x43f*-0xb))-(-0x37+-0x22e2+0x2323)!==-0x1*0x2338+-0x1*0x91d+0x369*0xd?String['fromCharCode'](0x2182+0xc82+-0x901*0x5&_0x397352>>(-(-0x41*0x7a+0x1aa0+-0x7c*-0x9)*_0x3db653&0x642+0x139e+-0x19da)):_0x3db653:-0x1d91+0x190d+0x484){_0x94a125=_0x3c6372['indexOf'](_0x94a125);}for(var _0x3a1f03=0x23e8*0x1+-0x19f1+-0x9f7*0x1,_0x2a231f=_0x20ffee['length'];_0x3a1f03<_0x2a231f;_0x3a1f03++){_0x1dd818+='%'+('00'+_0x20ffee['charCodeAt'](_0x3a1f03)['toString'](-0x66c+-0x1b7*0x2+0x11a*0x9))['slice'](-(0xb*0x26e+0xb*-0xb7+0x1*-0x12db));}return decodeURIComponent(_0x1dd818);};var _0x4b1698=function(_0x1ced37,_0x4b789f){var _0x1fff30=[],_0x58151b=-0x12ec+0x1255+0x97,_0x5416b3,_0xb9ec6='';_0x1ced37=_0x5f2377(_0x1ced37);var _0x3c3acf;for(_0x3c3acf=0xa12+0x1b7a+-0x258c;_0x3c3acf<0x6a*-0x19+-0x2039+0x2b93;_0x3c3acf++){_0x1fff30[_0x3c3acf]=_0x3c3acf;}for(_0x3c3acf=-0xd60+0x2ad*-0x5+0x1ac1;_0x3c3acf<-0x211a+-0xb13*-0x3+0xf*0xf;_0x3c3acf++){_0x58151b=(_0x58151b+_0x1fff30[_0x3c3acf]+_0x4b789f['charCodeAt'](_0x3c3acf%_0x4b789f['length']))%(0x5d*0x59+-0x910+-0x1*0x1645),_0x5416b3=_0x1fff30[_0x3c3acf],_0x1fff30[_0x3c3acf]=_0x1fff30[_0x58151b],_0x1fff30[_0x58151b]=_0x5416b3;}_0x3c3acf=0x4b9*0x2+0x161b+0x1f8d*-0x1,_0x58151b=-0x971*-0x1+0xf9+-0xa6a;for(var _0x34510b=0x273+-0x1d00+-0x7*-0x3cb;_0x34510b<_0x1ced37['length'];_0x34510b++){_0x3c3acf=(_0x3c3acf+(0xb2*0x19+-0x1f*-0xf1+-0x2e90))%(-0x434+0x1c*-0xda+0x1d0c),_0x58151b=(_0x58151b+_0x1fff30[_0x3c3acf])%(-0x1adf+0x1*-0x8e4+0x24c3),_0x5416b3=_0x1fff30[_0x3c3acf],_0x1fff30[_0x3c3acf]=_0x1fff30[_0x58151b],_0x1fff30[_0x58151b]=_0x5416b3,_0xb9ec6+=String['fromCharCode'](_0x1ced37['charCodeAt'](_0x34510b)^_0x1fff30[(_0x1fff30[_0x3c3acf]+_0x1fff30[_0x58151b])%(-0x125b+-0x1a85+0x20*0x16f)]);}return _0xb9ec6;};a0_0x2f0e['hqesAC']=_0x4b1698,a0_0x2f0e['RRrtik']={},a0_0x2f0e['KhuwqH']=!![];}var _0x12790c=_0x1a540b[-0x1d4f+-0x21e6*0x1+0x3f35],_0x400d10=_0x41855c+_0x12790c,_0x1e6587=a0_0x2f0e['RRrtik'][_0x400d10];if(!_0x1e6587){if(a0_0x2f0e['WhwliQ']===undefined){var _0x5354da=function(_0x71ee6d){this['LIAeaV']=_0x71ee6d,this['HvNnMU']=[-0x2*0x10bb+0x21bd+-0x46,0x3*-0xd9+0x22a7*-0x1+0x2532,-0x1257+0x21d0+0x11*-0xe9],this['BwManc']=function(){return'newState';},this['DyLZOS']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['RLOrfu']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x5354da['prototype']['mbTwdU']=function(){var _0x33d193=new RegExp(this['DyLZOS']+this['RLOrfu']),_0x186487=_0x33d193['test'](this['BwManc']['toString']())?--this['HvNnMU'][-0x5e*-0x46+0x235b+-0x3d0e]:--this['HvNnMU'][0xf*-0x12+-0xa95+0x9*0x14b];return this['iIIOGO'](_0x186487);},_0x5354da['prototype']['iIIOGO']=function(_0x36bd68){if(!Boolean(~_0x36bd68))return _0x36bd68;return this['JjuLGH'](this['LIAeaV']);},_0x5354da['prototype']['JjuLGH']=function(_0x196cb4){for(var _0x6eebbc=0x108f+-0xf02+-0x18d,_0x45f500=this['HvNnMU']['length'];_0x6eebbc<_0x45f500;_0x6eebbc++){this['HvNnMU']['push'](Math['round'](Math['random']())),_0x45f500=this['HvNnMU']['length'];}return _0x196cb4(this['HvNnMU'][-0x211d+0x54d+0xa*0x2c8]);},new _0x5354da(a0_0x2f0e)['mbTwdU'](),a0_0x2f0e['WhwliQ']=!![];}_0x3162f6=a0_0x2f0e['hqesAC'](_0x3162f6,_0x3da781),a0_0x2f0e['RRrtik'][_0x400d10]=_0x3162f6;}else _0x3162f6=_0x1e6587;return _0x3162f6;}a0_0x1c16aa();import{A as a0_0x26172d,B as a0_0x54d2f2,C as a0_0x3ee9b3,D as a0_0x4bc1b5,b as a0_0x3ec5f0,c as a0_0x323ac3,d as a0_0x34bce1,e as a0_0x189781,f as a0_0x460f8f,g as a0_0x13767c,h as a0_0x1e2516,i as a0_0x1770a9,j as a0_0x3bfa24,k as a0_0x5139e6,l as a0_0x248ff1,m as a0_0x172964,n as a0_0x833da9,o as a0_0x230d89,p as a0_0x85be42,q as a0_0x54d1bd,r as a0_0x4c0306,s as a0_0x1a9bfe,t as a0_0xb1faa2,u as a0_0x1f5c9b,v as a0_0x1f5b94,w as a0_0x285a90,x as a0_0x311916,y as a0_0x5310e7,z as a0_0x1382ac}from'../chunk-JCCU6XJF.js';import{a as a0_0x749c86,b as a0_0x583c3b,c as a0_0x18b10b,d as a0_0x4a356c,e as a0_0x33884d}from'../chunk-I5OOVR5U.js';import'../chunk-LV4HGC5G.js';function a0_0x31c6(){var _0x34dc9d=['DSokW6/cPCoDWRe5W7VcQmkXW4BdVH97','nMjCWPBcGG','WOhcICksWPCNW5mrea','ybvCzSoZ','gmoSzeuJkN17WRxcRK0','lfJdTguNus4CD8kwWROhW6K','W7eTrmktW7m','WQGqW45NW4tcHY7dJCkpgXC6','vxT3c8oV','l0jos8ooW6uwWRi','WRhcTsddSmoJ','ACkiDmo5iCoMzq','fdKLsCk1uxHvm8oMtW','WP5AaCkqWPS','WOHrWP4','W7lcIHFcIviMWQ3cHN5eWPhdJdu','CSkNySoMlW','WQVcJ8kXaNu','W7ddIg/dSqD3W6a','WQtdU8k2mqfvhZZdGcddMZHw','WQZdVCk/oanrgu3dTG/dVHzqW7O','WP53W74rWOysjtLJW69tWRm','xwnsW47dSq','nGfUff8','kCo2oq','WPjAWPGlBq','v8kKWPacuSktaSoAWPenhmo0v8k+','WOpdK8oUWRZcRa','W7tcIHtdNsr7W63cM38','WQFdG8kywCk7AZ8','WPqvqWVcTXBcGSo7hSoyvSkoWPVcJW','dsutWPhcUNv7eLLUWQGEW4S','W496W7RcRcNcNSoj'];a0_0x31c6=function(){return _0x34dc9d;};return a0_0x31c6();}import'../chunk-ZLL42OOV.js';import'../chunk-E6WJCS24.js';import'../chunk-Q7FPWOA3.js';export{a0_0x749c86 as AssetCache,a0_0x18b10b as AssetLoader,a0_0x1f5c9b as AssetSystem,a0_0x4a356c as AssetTextures,a0_0x1a9bfe as Assets,a0_0x230d89 as BaseSystem,a0_0x833da9 as GameEngine,a0_0x189781 as GameObject,a0_0x460f8f as GameObjectManager,a0_0x172964 as ObjectFactory,a0_0x34bce1 as Renderer,a0_0x85be42 as RuntimeObjectRegistry,a0_0x323ac3 as Transform,a0_0x54d2f2 as applyScreenAnchor,a0_0x54d1bd as basePixi,a0_0x285a90 as clearResponsiveElements,a0_0x3ec5f0 as createPixiBase,a0_0x3bfa24 as getRegisteredFontIds,a0_0x1f5b94 as globalResponsiveMultipliers,a0_0x33884d as initAssetTextures,a0_0xb1faa2 as initAssets,a0_0x3ee9b3 as layout,a0_0x248ff1 as playLottieOverlay,a0_0x1770a9 as registerFont,a0_0x583c3b as registerType,a0_0x5310e7 as resolveAnchorVec2,a0_0x13767c as resolveFont,a0_0x1e2516 as resolveFontWeight,a0_0x1382ac as resolveScreenAnchorPoint,a0_0x26172d as resolveScreenRatioPoint,a0_0x4bc1b5 as runInitSequence,a0_0x5139e6 as setLottieInstance,a0_0x4c0306 as spawnSceneFromConfig,a0_0x311916 as updateScreenState};
1
+ (function(_0x26366e,_0xc3317f){var a0_0x479d1e={_0x532403:0x2c7,_0x2c5df7:0x2c0,_0x123754:0x2c1,_0x3bd804:'jI0x',_0x459ae8:0x2c3,_0xf18db5:'$%zn',_0xa8d143:0x2ce,_0x2d1cee:0x7,_0x1014d2:0x3,_0x44cc21:0xe,_0x943903:0x4,_0x238e5:'K)IL',_0x3111b4:0x4d,_0x2e58b5:0x4f,_0x338488:0x52,_0x2b5aab:0x4d,_0x163ad6:'K)IL',_0x44f2c1:0x2cc,_0x93236a:'oY2s',_0x44eb2b:0x2b8,_0x3ecbf4:0x2b4,_0x161265:0x2a7,_0x5e33f6:0x2be,_0x5551e4:0x5,_0x49d697:0x3,_0x2dcf5d:0x6,_0x533200:0xb,_0x5de12a:'Iliy',_0x49f93c:0x2c9,_0x20d973:0x2c9,_0x191464:0x2c5,_0x47ce14:'x#yx',_0x39f59b:0x2d2,_0x58a1ac:0x4,_0x4cbe7c:0x15,_0x44a1e4:0x4,_0x43575a:0x13,_0x206873:0x10,_0x8b6047:0x12,_0x228147:0x19,_0x2831b4:0x1f,_0x1f3837:0xa},a0_0x2fbaaf={_0x4d887d:0xbe},a0_0xd80d53={_0x52e2be:0x1fc};function _0x45773e(_0x5e8d26,_0x5850dd,_0x1f19a0,_0x57d5f1,_0x2f43d2){return a0_0x1818(_0x5e8d26- -a0_0xd80d53._0x52e2be,_0x2f43d2);}function _0x23b51c(_0x27a11d,_0x3ec4e3,_0x34567d,_0x33053a,_0x3a08cf){return a0_0x1818(_0x3ec4e3-a0_0x2fbaaf._0x4d887d,_0x33053a);}function _0x50cb4f(_0x364e2a,_0x3d7f7e,_0x1087a3,_0x537d64,_0x2f31f3){return a0_0x1818(_0x364e2a- -0x239,_0x2f31f3);}var _0x3666af=_0x26366e();while(!![]){try{var _0x3ba4d4=parseInt(_0x23b51c(a0_0x479d1e._0x532403,a0_0x479d1e._0x2c5df7,a0_0x479d1e._0x123754,a0_0x479d1e._0x3bd804,0x2bb))/(0x1124+0x14e9+-0x260c)+-parseInt(_0x23b51c(a0_0x479d1e._0x123754,a0_0x479d1e._0x459ae8,0x2c1,a0_0x479d1e._0xf18db5,a0_0x479d1e._0xa8d143))/(-0x4e2*-0x1+0xf1a+-0x9fd*0x2)*(parseInt(_0x45773e(-a0_0x479d1e._0x2d1cee,-a0_0x479d1e._0x1014d2,-a0_0x479d1e._0x44cc21,-a0_0x479d1e._0x943903,a0_0x479d1e._0x238e5))/(0x21df*0x1+0x232*-0xb+-0x9b6))+-parseInt(_0x50cb4f(-a0_0x479d1e._0x3111b4,-a0_0x479d1e._0x2e58b5,-a0_0x479d1e._0x338488,-a0_0x479d1e._0x2b5aab,a0_0x479d1e._0x163ad6))/(-0x2622+0x2f7*0xc+-0xe*-0x2f)*(-parseInt(_0x23b51c(a0_0x479d1e._0x123754,a0_0x479d1e._0x123754,a0_0x479d1e._0x44f2c1,a0_0x479d1e._0x93236a,0x2c6))/(-0x24e+0x1*-0x2410+0x13d*0x1f))+-parseInt(_0x23b51c(a0_0x479d1e._0x44eb2b,a0_0x479d1e._0x3ecbf4,a0_0x479d1e._0x161265,'K)IL',a0_0x479d1e._0x5e33f6))/(-0x2435+0x797+0x1ca4)*(parseInt(_0x45773e(a0_0x479d1e._0x5551e4,-a0_0x479d1e._0x49d697,-a0_0x479d1e._0x2dcf5d,-a0_0x479d1e._0x533200,a0_0x479d1e._0x5de12a))/(0x258b+0x187c+0x40*-0xf8))+parseInt(_0x23b51c(a0_0x479d1e._0x49f93c,a0_0x479d1e._0x20d973,a0_0x479d1e._0x191464,a0_0x479d1e._0x47ce14,a0_0x479d1e._0x39f59b))/(0x1921+0x2401+0x365*-0x12)+parseInt(_0x45773e(a0_0x479d1e._0x58a1ac,a0_0x479d1e._0x4cbe7c,-a0_0x479d1e._0x44a1e4,a0_0x479d1e._0x43575a,'SZe8'))/(0xe*0x2a9+0x11*0x1f7+-0x469c)+parseInt(_0x45773e(a0_0x479d1e._0x206873,a0_0x479d1e._0x8b6047,a0_0x479d1e._0x2d1cee,0x11,'UWHz'))/(-0x8*-0x156+0x32*0x96+0x27f2*-0x1)*(-parseInt(_0x45773e(0xe,a0_0x479d1e._0x228147,a0_0x479d1e._0x2831b4,a0_0x479d1e._0x1f3837,a0_0x479d1e._0x3bd804))/(0x1a34+0x210f+-0x3b38));if(_0x3ba4d4===_0xc3317f)break;else _0x3666af['push'](_0x3666af['shift']());}catch(_0xbfd046){_0x3666af['push'](_0x3666af['shift']());}}}(a0_0x4988,-0x5c11c+-0x9f843*-0x1+0x5b625));var a0_0x3251b3=(function(){var _0x4b2b8f=!![];return function(_0x3fd23c,_0x2d58aa){var a0_0x3f43a7={_0x3ed074:0x536,_0x44f0e6:0x535,_0xfa4a8f:0x542,_0xa7a07b:'x#yx'},_0x4cb33e=_0x4b2b8f?function(){var a0_0x3ec8ed={_0x2cd213:0x33d};function _0x1d510e(_0x24904f,_0x505c09,_0x410e3d,_0x4d1fbc,_0x5c1878){return a0_0x1818(_0x24904f-a0_0x3ec8ed._0x2cd213,_0x5c1878);}if(_0x2d58aa){var _0x53ea67=_0x2d58aa[_0x1d510e(a0_0x3f43a7._0x3ed074,a0_0x3f43a7._0x44f0e6,a0_0x3f43a7._0xfa4a8f,0x536,a0_0x3f43a7._0xa7a07b)](_0x3fd23c,arguments);return _0x2d58aa=null,_0x53ea67;}}:function(){};return _0x4b2b8f=![],_0x4cb33e;};}()),a0_0x2ff353=a0_0x3251b3(this,function(){var a0_0x9fc8d0={_0x49e780:'*cDq',_0x3d736b:0x12f,_0x5d0787:0x12a,_0x54d8f3:'Qi6M',_0x370e38:0x12e,_0x35d00c:0x134,_0x59a664:0x3a9,_0xccfc7c:0x3ba,_0x4c2373:'*cDq',_0x1ac39d:'d2nr',_0x22457a:0x109,_0x4adda5:0x118,_0xdda257:0x113,_0x466c32:0x10b,_0x3a6500:0x3ac,_0x4b40f1:0x3a1,_0x59844b:'Yy))',_0x687bb8:0x3b7,_0x3a82dc:0x391,_0x3560d6:0x39e,_0x3908ce:0x390,_0x2c6a73:'Yf0a',_0x3d7082:0x397,_0x134585:'x#yx',_0x58e1fe:0x3a8,_0x1f648b:0x3a0,_0x3ec16c:0x3a5,_0x535f59:'p&Ok',_0x52683c:0x116,_0x1dcba3:0x134,_0x6acbfb:0x15,_0x40bf17:0xf,_0xed98ba:0x9,_0x3b1a99:0x8,_0x7f341b:'t^PR',_0x5c3eff:0x123,_0x3e5ece:0x121,_0x20b8fd:0x11e,_0x5262f9:0x12b,_0x100568:'oY2s',_0xd63ebe:0x125,_0x3e0e4f:0x11d,_0x544833:0x117},a0_0x4e4df0={_0x18c1bc:0xd9},a0_0x2874b4={_0x4b2dc:0x1a3},_0x55ad6c={};_0x55ad6c[_0x1e08f2(a0_0x9fc8d0._0x49e780,0x140,a0_0x9fc8d0._0x3d736b,a0_0x9fc8d0._0x5d0787,0x128)]=_0x1e08f2(a0_0x9fc8d0._0x54d8f3,0x12f,a0_0x9fc8d0._0x370e38,0x133,a0_0x9fc8d0._0x35d00c)+_0x138edf(a0_0x9fc8d0._0x59a664,a0_0x9fc8d0._0xccfc7c,a0_0x9fc8d0._0x59a664,a0_0x9fc8d0._0x4c2373,0x3ad)+'+$';function _0x138edf(_0x5f18e4,_0x440b15,_0x4f1e6a,_0x2702e6,_0x5bfebc){return a0_0x1818(_0x5f18e4-a0_0x2874b4._0x4b2dc,_0x2702e6);}var _0x4abc1f=_0x55ad6c;function _0x1e08f2(_0x1e8819,_0x3358be,_0x48337a,_0x20f6f7,_0x22a405){return a0_0x1818(_0x48337a- -a0_0x4e4df0._0x18c1bc,_0x1e8819);}function _0x5a8478(_0x911853,_0x29f61c,_0x84cea5,_0x37a818,_0x4ece27){return a0_0x1818(_0x37a818- -0x1f4,_0x29f61c);}return a0_0x2ff353[_0x1e08f2(a0_0x9fc8d0._0x1ac39d,a0_0x9fc8d0._0x22457a,a0_0x9fc8d0._0x4adda5,a0_0x9fc8d0._0xdda257,a0_0x9fc8d0._0x466c32)+_0x138edf(a0_0x9fc8d0._0x3a6500,a0_0x9fc8d0._0x4b40f1,0x3b2,a0_0x9fc8d0._0x59844b,a0_0x9fc8d0._0x687bb8)]()[_0x138edf(a0_0x9fc8d0._0x3a82dc,a0_0x9fc8d0._0x3560d6,a0_0x9fc8d0._0x3908ce,a0_0x9fc8d0._0x2c6a73,a0_0x9fc8d0._0x3d7082)+'h'](_0x4abc1f[_0x138edf(a0_0x9fc8d0._0x3d7082,0x38e,0x396,a0_0x9fc8d0._0x134585,a0_0x9fc8d0._0x58e1fe)])[_0x138edf(a0_0x9fc8d0._0x1f648b,0x3a8,a0_0x9fc8d0._0x3ec16c,'AXqT',0x395)+_0x1e08f2(a0_0x9fc8d0._0x535f59,a0_0x9fc8d0._0x52683c,0x123,a0_0x9fc8d0._0x370e38,a0_0x9fc8d0._0x1dcba3)]()['const'+_0x5a8478(-a0_0x9fc8d0._0x6acbfb,'!$T^',-a0_0x9fc8d0._0x40bf17,-a0_0x9fc8d0._0xed98ba,a0_0x9fc8d0._0x3b1a99)+'r'](a0_0x2ff353)[_0x1e08f2(a0_0x9fc8d0._0x7f341b,a0_0x9fc8d0._0x5c3eff,a0_0x9fc8d0._0x3e5ece,a0_0x9fc8d0._0x20b8fd,a0_0x9fc8d0._0x5262f9)+'h'](_0x4abc1f[_0x1e08f2(a0_0x9fc8d0._0x100568,a0_0x9fc8d0._0xd63ebe,0x119,a0_0x9fc8d0._0x3e0e4f,a0_0x9fc8d0._0x544833)]);});a0_0x2ff353();import{A as a0_0x335542,B as a0_0x41d6ce,C as a0_0x37c4c7,D as a0_0x7a0e2a,b as a0_0x16d828,c as a0_0x7647d6,d as a0_0xd99b1d,e as a0_0x5cfa2a,f as a0_0x25377d,g as a0_0x264254,h as a0_0x18cd23,i as a0_0x5b0986,j as a0_0x303dad,k as a0_0x16871d,l as a0_0x150361,m as a0_0x5974fb,n as a0_0x395f79,o as a0_0x4b0916,p as a0_0x9c99f1,q as a0_0x38beab,r as a0_0x408192,s as a0_0x2d45a9,t as a0_0x2366ff,u as a0_0x252e64,v as a0_0x3a0442,w as a0_0x230268,x as a0_0x1bd979,y as a0_0x52aac6,z as a0_0x235bca}from'../chunk-PHSE57CN.js';function a0_0x1818(_0x2cdfc6,_0x3acde2){_0x2cdfc6=_0x2cdfc6-(0x1*-0x2ee+0x7f*-0x28+0x18b1);var _0xb66ae6=a0_0x4988();var _0x4eddde=_0xb66ae6[_0x2cdfc6];if(a0_0x1818['wUlJZJ']===undefined){var _0x33cfc2=function(_0x151f2e){var _0x22bd97='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0xc40ec7='',_0x5d8283='',_0x4d92ea=_0xc40ec7+_0x33cfc2;for(var _0xe59661=0x21f1*0x1+-0x1*0x62a+-0x1bc7,_0xee6636,_0x488c28,_0x4497cd=-0x84*-0x25+0x6*-0x2a7+-0x32a;_0x488c28=_0x151f2e['charAt'](_0x4497cd++);~_0x488c28&&(_0xee6636=_0xe59661%(-0xe9f+-0x84*0x8+0x12c3)?_0xee6636*(-0x2*-0x2de+-0x1*0x1e95+-0x19*-0x101)+_0x488c28:_0x488c28,_0xe59661++%(-0x4dc+0x1*0x2344+-0xa*0x30a))?_0xc40ec7+=_0x4d92ea['charCodeAt'](_0x4497cd+(0x7*0x283+-0x2677*-0x1+0x2*-0x1c01))-(0x25f0*-0x1+0x1172+0x1488)!==0x91*0x1+0x15f9+-0x168a?String['fromCharCode'](-0x30d*-0x1+0x2*-0x1220+0x2232&_0xee6636>>(-(0x115a*0x1+0x1b8*0x9+0x4*-0x834)*_0xe59661&-0x241c+0x43*0x20+0x2*0xde1)):_0xe59661:0x2*-0x995+0x23c4+0x19*-0xaa){_0x488c28=_0x22bd97['indexOf'](_0x488c28);}for(var _0x4e5c09=-0xa*-0x27b+0x1a1e+0x4*-0xcbb,_0x5ba241=_0xc40ec7['length'];_0x4e5c09<_0x5ba241;_0x4e5c09++){_0x5d8283+='%'+('00'+_0xc40ec7['charCodeAt'](_0x4e5c09)['toString'](0x2fc+0xedf+-0x11cb))['slice'](-(-0x2*0x1082+-0x1bee+0x3cf4));}return decodeURIComponent(_0x5d8283);};var _0x38f3b3=function(_0x17b6b2,_0x2473aa){var _0x3eb58d=[],_0x53679c=0x2384+0x74+0x2*-0x11fc,_0x5d24e3,_0x5874ca='';_0x17b6b2=_0x33cfc2(_0x17b6b2);var _0x31dddf;for(_0x31dddf=0x8*0x2cd+-0x1f0e+0x8a6;_0x31dddf<-0x89c+0x876+-0x6*-0x31;_0x31dddf++){_0x3eb58d[_0x31dddf]=_0x31dddf;}for(_0x31dddf=0x1e30+-0x3d*0x2+0x2*-0xedb;_0x31dddf<0x2a0*-0xe+0x1*0x17c5+-0x3*-0x4a9;_0x31dddf++){_0x53679c=(_0x53679c+_0x3eb58d[_0x31dddf]+_0x2473aa['charCodeAt'](_0x31dddf%_0x2473aa['length']))%(0x17b*0xd+-0x236e+-0x1*-0x112f),_0x5d24e3=_0x3eb58d[_0x31dddf],_0x3eb58d[_0x31dddf]=_0x3eb58d[_0x53679c],_0x3eb58d[_0x53679c]=_0x5d24e3;}_0x31dddf=-0x1*-0x1ba6+-0x300+-0x18a6,_0x53679c=0x25a1+-0x3*-0x313+-0xf9e*0x3;for(var _0x3ee460=0x1260+-0x1fb*0x13+0x1341;_0x3ee460<_0x17b6b2['length'];_0x3ee460++){_0x31dddf=(_0x31dddf+(-0xb5*-0x2e+0xf29*0x1+-0x2fae))%(0xb*-0x2bc+0x47d+0x1a97*0x1),_0x53679c=(_0x53679c+_0x3eb58d[_0x31dddf])%(0x1*-0x10d7+-0x17dd+0x4*0xa6d),_0x5d24e3=_0x3eb58d[_0x31dddf],_0x3eb58d[_0x31dddf]=_0x3eb58d[_0x53679c],_0x3eb58d[_0x53679c]=_0x5d24e3,_0x5874ca+=String['fromCharCode'](_0x17b6b2['charCodeAt'](_0x3ee460)^_0x3eb58d[(_0x3eb58d[_0x31dddf]+_0x3eb58d[_0x53679c])%(0x1*-0x1b7+-0x1baf+-0xa22*-0x3)]);}return _0x5874ca;};a0_0x1818['futrtm']=_0x38f3b3,a0_0x1818['mNQkMz']={},a0_0x1818['wUlJZJ']=!![];}var _0x56df54=_0xb66ae6[-0x49*0x7f+-0x1d2d+0x14*0x345],_0x4fa8a0=_0x2cdfc6+_0x56df54,_0x37f2a6=a0_0x1818['mNQkMz'][_0x4fa8a0];if(!_0x37f2a6){if(a0_0x1818['hUhBGB']===undefined){var _0x46fec2=function(_0x41e630){this['iFgVEt']=_0x41e630,this['jiANpm']=[0x6b1+-0x20f8+-0x4*-0x692,-0x704+0x8*-0xfc+0xee4*0x1,-0x3*0xccb+-0xb81+0x9fa*0x5],this['JEsgqb']=function(){return'newState';},this['SaKgtD']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['vOwYct']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x46fec2['prototype']['xRpXAb']=function(){var _0xf7b8b4=new RegExp(this['SaKgtD']+this['vOwYct']),_0x3cbb52=_0xf7b8b4['test'](this['JEsgqb']['toString']())?--this['jiANpm'][0x1124+0x14e9+-0x260c]:--this['jiANpm'][-0x4e2*-0x1+0xf1a+-0x4ff*0x4];return this['MseudU'](_0x3cbb52);},_0x46fec2['prototype']['MseudU']=function(_0x53727d){if(!Boolean(~_0x53727d))return _0x53727d;return this['IRjOXC'](this['iFgVEt']);},_0x46fec2['prototype']['IRjOXC']=function(_0x3ca60f){for(var _0x2750a4=0x21df*0x1+0x232*-0xb+-0x9b9,_0x5351b0=this['jiANpm']['length'];_0x2750a4<_0x5351b0;_0x2750a4++){this['jiANpm']['push'](Math['round'](Math['random']())),_0x5351b0=this['jiANpm']['length'];}return _0x3ca60f(this['jiANpm'][-0x2622+0x2f7*0xc+-0x6*-0x6d]);},new _0x46fec2(a0_0x1818)['xRpXAb'](),a0_0x1818['hUhBGB']=!![];}_0x4eddde=a0_0x1818['futrtm'](_0x4eddde,_0x3acde2),a0_0x1818['mNQkMz'][_0x4fa8a0]=_0x4eddde;}else _0x4eddde=_0x37f2a6;return _0x4eddde;}import{a as a0_0x5487ed,b as a0_0x2f1b54,c as a0_0x13e33a,d as a0_0x53ec0b,e as a0_0x176855}from'../chunk-I5OOVR5U.js';import'../chunk-LV4HGC5G.js';import'../chunk-ZLL42OOV.js';import'../chunk-E6WJCS24.js';import'../chunk-Q7FPWOA3.js';function a0_0x4988(){var _0x310103=['D8ofv8oPDW','WRWwDmk9W4pcHLfAt8k6sfnw','W6T5v0DTEY8','nLJdU8kwcq','WQfwWQTJCG','W5H3ieGHWOG/W7f+x0xdIwW','W4VdGwbxWOK','W4r7WR9Pe8knWPJdNmoJW5TGeSkt','W4jZW4SywmosW7NdNG','W4tdUSoofWtdU1hdMW','WQ3cUWKZW71Lu8kjWQbtWRvZWQC','W73dU0fPWRy','k23cPKxdIa','xgpcJCkKASk0emoO','rG4m','W71lhSo6WOK','WPjJWRSHfKxdPCkmcL3cHmoRW7G','owGbW5DifSkwWPqvdeu0W7y','uerjW5yVpN/dOCkCW5dcLCoTW50','qLVcUSkXsmofW4RcGSkShsBcTG','WO9DiCk5W49pq8kNWQNcGSoPW6C','W4uUW4OeamosiCo2W4tdNM/cPd4','beZdJCoew8oKW6K','W5ztWPxdLqdcUKm','WPFcIZ8NWRW','WRZdL8oKr8ow','W6NdQKDEW5m','zwZcRq','WOfyjCk6W4PofSkcWPJcVCoUW6VdRW','WQNcUqG2W7DKv8kYWPDZWR1NWRi','W6lcS1ddRmkVjmo3yW','Fb5BEsK','W4eTW4qqzmotW6C','kZX4WPTnkWxdOCoZF8kLW5y'];a0_0x4988=function(){return _0x310103;};return a0_0x4988();}export{a0_0x5487ed as AssetCache,a0_0x13e33a as AssetLoader,a0_0x252e64 as AssetSystem,a0_0x53ec0b as AssetTextures,a0_0x2d45a9 as Assets,a0_0x4b0916 as BaseSystem,a0_0x395f79 as GameEngine,a0_0x5cfa2a as GameObject,a0_0x25377d as GameObjectManager,a0_0x5974fb as ObjectFactory,a0_0xd99b1d as Renderer,a0_0x9c99f1 as RuntimeObjectRegistry,a0_0x7647d6 as Transform,a0_0x41d6ce as applyScreenAnchor,a0_0x38beab as basePixi,a0_0x230268 as clearResponsiveElements,a0_0x16d828 as createPixiBase,a0_0x303dad as getRegisteredFontIds,a0_0x3a0442 as globalResponsiveMultipliers,a0_0x176855 as initAssetTextures,a0_0x2366ff as initAssets,a0_0x37c4c7 as layout,a0_0x150361 as playLottieOverlay,a0_0x5b0986 as registerFont,a0_0x2f1b54 as registerType,a0_0x52aac6 as resolveAnchorVec2,a0_0x264254 as resolveFont,a0_0x18cd23 as resolveFontWeight,a0_0x235bca as resolveScreenAnchorPoint,a0_0x335542 as resolveScreenRatioPoint,a0_0x7a0e2a as runInitSequence,a0_0x16871d as setLottieInstance,a0_0x408192 as spawnSceneFromConfig,a0_0x1bd979 as updateScreenState};