handler-playable-sdk 0.3.59 → 0.3.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-UI3PRTL6.js → chunk-2YFOCUIT.js} +2 -2
- package/dist/cli/brand-dna.mjs +1 -1
- package/dist/cli/canva-import.mjs +1 -1
- package/dist/cli/cleanup-assets.mjs +1 -1
- package/dist/cli/fix-scales.mjs +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/screen-helper.mjs +1 -1
- package/dist/cli/setup-library.mjs +1 -1
- package/dist/cli/student-helper.mjs +1 -1
- package/dist/cli/sync-screens.mjs +1 -1
- package/dist/cli/validate-assets.mjs +1 -1
- package/dist/cli/validate.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/dist/pixi/index.cjs +1 -1
- package/dist/pixi/index.js +1 -1
- package/dist/three/index.cjs +1 -1
- package/dist/three/index.js +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
<button class="debug-btn primary" data-modal-apply>Apply</button>
|
|
44
44
|
</div>
|
|
45
45
|
</div>
|
|
46
|
-
`,this.modal=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 a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let r=this.modal.querySelector("[data-modal-apply]");r==null||r.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",s=>{s.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let t=window.__openAiEditor;if(typeof t!="function"){alert("AI Editor not available. Please check your setup.");return}let n="";e==="edit"&&this.currentAsset?n=`Edit this image: ${this.currentObjectId}`:n=`Create an image for: ${this.currentObjectId}`,t(this.currentObjectId||"unknown",n,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var pl={};ft(pl,{COLORS:()=>ce,ConfigWatcher:()=>ze,DebugPanel:()=>kt,DefaultReloadStrategy:()=>St,Handler:()=>ne,PlayableLoadingScreen:()=>Un,PreviewShell:()=>Hn,STROKE_WIDTH:()=>hs,THEME:()=>ms,applyConfigOverride:()=>Se,applyConfigOverrides:()=>Ce,applyConfigsToDisk:()=>an,applyDefaults:()=>$e,baseLottie:()=>ai,bootstrap:()=>el,clearConfigOverrides:()=>oe,clearConfigOverridesForObject:()=>br,configOverrideManager:()=>yr,createPreviewShell:()=>la,deepClone:()=>G,default:()=>Oe,defaultPreset:()=>pn,deviceGroups:()=>ki,devicePresets:()=>Pi,diffConfigs:()=>Ai,exportConfigsAsJSON:()=>De,getConfigOverrides:()=>Y,getConfigStateSummary:()=>nn,getOverrideMode:()=>wt,getPresetById:()=>Ne,getPresetsByCategory:()=>Oo,loadAllObjectConfigs:()=>on,loadComponentSchemas:()=>sn,loadEngineConfig:()=>ln,loadGamePromptConfig:()=>xi,loadObjectCentricConfig:()=>be,loadObjectConfig:()=>Le,loadSceneConfig:()=>cn,rehydrateObject:()=>Si,removeConfigOverride:()=>tn,resetToApplied:()=>Et,resetToOriginal:()=>rn,setBootstrapDependencies:()=>Zo,setOverrideMode:()=>bi,setupHotReload:()=>Ti,setupLiveEditBridge:()=>Bn,toLegacyFormat:()=>wi,validateObjectConfig:()=>Ze});module.exports=$s(pl);var we={};function Bt(i,e,t=!1){we[i]||(we[i]=[]),we[i].push({fn:e,once:t})}function ei(i,e){if(we[i]){if(!e){delete we[i];return}we[i]=we[i].filter(t=>t.fn!==e)}}function Ft(i,...e){let t=we[i];if(t)for(let n of[...t])n.fn(...e),n.once&&ei(i,n.fn)}function X(i,e){Bt(i,e,!0)}var F=null,ee=[],We=null;function Ta(i){F=i,ee=[],We!==null&&(clearTimeout(We),We=null)}function _a(){var i,e,t;return{endpoint:(F==null?void 0:F.endpoint)||"",transport:(F==null?void 0:F.transport)||"beacon",batchSize:(i=F==null?void 0:F.batchSize)!=null?i:10,flushIntervalMs:(e=F==null?void 0:F.flushIntervalMs)!=null?e:300,maxQueue:(t=F==null?void 0:F.maxQueue)!=null?t:200,debug:!!(F!=null&&F.debug)}}async function Ca(i,e,t,n){let a=JSON.stringify(e);if(t==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let r=navigator.sendBeacon(i,new Blob([a],{type:"application/json"}));n&&console.log("[handler.telemetry] beacon",r,e);return}catch(r){n&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",r)}try{await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),n&&console.log("[handler.telemetry] fetch",e)}catch(r){n&&console.warn("[handler.telemetry] fetch failed",r)}}function ti(i,e){let t=_a();if(e&&t.endpoint){if(ee.push(i),ee.length>t.maxQueue&&(ee=ee.slice(ee.length-t.maxQueue)),ee.length>=t.batchSize){La();return}We===null&&(We=window.setTimeout(()=>{We=null,La()},t.flushIntervalMs))}}async function La(){let i=_a();if(!i.endpoint||ee.length===0)return;let e=ee.splice(0,i.batchSize);await Ca(i.endpoint,{events:e},i.transport,i.debug),ee.length>0&&await Ca(i.endpoint,{events:ee.splice(0,i.batchSize)},i.transport,i.debug)}function Pa(i){return Math.max(0,Math.min(1,i))}function zs(i){let e=String(i!=null?i:"power2.out");if(e==="linear")return t=>t;if(e==="sine.inOut")return t=>.5-Math.cos(Math.PI*t)/2;if(e==="power2.out"||e==="easeOutQuad")return t=>1-(1-t)*(1-t);if(e.startsWith("back.out")){let t=e.match(/back\.out\(([\d.]+)\)/),n=t?Number(t[1]):1.8;return a=>1+(n+1)*Math.pow(a-1,3)+n*Math.pow(a-1,2)}return t=>1-(1-t)*(1-t)}function ht(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Ns(i,e){let t=i==null?void 0:i[e];return typeof t=="number"?t:0}function ka(i,e,t){try{i[e]=t}catch{}}function Hs(i){let e=i==null?void 0:i.scale;if(!e)return null;let t=typeof e.x=="number"?e.x:1,n=typeof e.y=="number"?e.y:1;return{x:t,y:n}}function Ma(i,e){let t=i==null?void 0:i.scale;if(t)try{typeof t.set=="function"?t.set(e.x,e.y):(typeof t.x=="number"&&(t.x=e.x),typeof t.y=="number"&&(t.y=e.y))}catch{}}function Oa(i,e){let t=Hs(i);if(!t)return{from:null,to:null};let n=null,a=null;return typeof e.scale=="number"?(n=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(n=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(n=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),n===null&&a===null?{from:null,to:null}:{from:{x:t.x,y:t.y},to:{x:n!=null?n:t.x,y:a!=null?a:t.y}}}function Ia(){let i=new Set,e=new WeakMap,t=null,n=()=>{if(t!=null)return;t=requestAnimationFrame(()=>{t=null,o(),i.size>0&&n()})},a=p=>{var u;i.add(p);let d=(u=e.get(p.target))!=null?u:new Set;d.add(p),e.set(p.target,d),n()},r=p=>{i.delete(p);let d=e.get(p.target);d&&(d.delete(p),d.size===0&&e.delete(p.target))},s=p=>{p.killed||(p.killed=!0,r(p))},o=()=>{var d,u;let p=ht();for(let g of Array.from(i)){if(g.killed||g.paused)continue;let h=p-g.startMs-g.delayMs;if(h<0)continue;let f=g.durationMs>0?h/g.durationMs:1,m=Pa(f),b=g.repeat>=0?g.repeat+1:1,y=g.repeat>0?Math.min(Math.floor(f),b-1):0;if(g.repeat>0&&f>=1){let w=f-y;m=Pa(w)}let v=g.ease(m);g.yoyo&&y%2===1&&(v=1-v);for(let w of g.props)ka(g.target,w.key,w.from+(w.to-w.from)*v);g.scaleFrom&&g.scaleTo&&Ma(g.target,{x:g.scaleFrom.x+(g.scaleTo.x-g.scaleFrom.x)*v,y:g.scaleFrom.y+(g.scaleTo.y-g.scaleFrom.y)*v});try{(d=g.onUpdate)==null||d.call(g)}catch{}if(f>=b){s(g);try{(u=g.onComplete)==null||u.call(g)}catch{}}}},l=(p,d,u)=>{var w;let g=Math.max(0,(typeof d.duration=="number"?d.duration:.5)*1e3),h=Math.max(0,(typeof d.delay=="number"?d.delay:0)*1e3+((w=u==null?void 0:u.delayMsOverride)!=null?w:0)),f=zs(d.ease),m=typeof d.repeat=="number"?Math.max(0,d.repeat|0):0,b=d.yoyo===!0,y=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),v=[];for(let E of Object.keys(d)){if(y.has(E))continue;let C=d[E];typeof C=="number"&&v.push({key:E,from:Ns(p,E),to:C})}let x=Oa(p,d);return{target:p,startMs:ht(),delayMs:h,durationMs:g,ease:f,props:v,scaleFrom:x.from,scaleTo:x.to,repeat:m,yoyo:b,onUpdate:typeof d.onUpdate=="function"?d.onUpdate:void 0,onComplete:typeof d.onComplete=="function"?d.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},c={to(p,d){let u=l(p,d);return a(u),{kill:()=>s(u),pause:()=>{u.paused||(u.paused=!0,u.pauseAtMs=ht())},resume:()=>{var f;if(!u.paused)return;let g=(f=u.pauseAtMs)!=null?f:ht(),h=ht()-g;u.startMs+=h,u.paused=!1,u.pauseAtMs=null},isActive:()=>!u.killed&&!u.paused}},fromTo(p,d,u){return c.set(p,d),c.to(p,u)},set(p,d){if(!p||!d)return;for(let g of Object.keys(d)){let h=d[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof h=="number"&&ka(p,g,h)}let u=Oa(p,d);u.to&&Ma(p,u.to)},killTweensOf(p){let d=e.get(p);if(d)for(let u of Array.from(d))s(u)},timeline(p={}){let d=[],u=0,g=!1,h=[],f=y=>{if(typeof y=="number")return Math.max(0,y*1e3);let v=typeof y=="string"?y.trim():"";return v.startsWith("+=")?u+Math.max(0,Number(v.slice(2))*1e3||0):v?Math.max(0,Number(v)*1e3||0):u},m=y=>{d.push(y);let v=Math.max(0,(typeof y.vars.duration=="number"?y.vars.duration:.5)*1e3);u=Math.max(u,y.atMs+v)},b={to(y,v,x){return m({kind:"to",target:y,vars:v,atMs:f(x)}),b},fromTo(y,v,x,w){return m({kind:"fromTo",target:y,vars:x,from:v,atMs:f(w)}),b},play(){var y,v;if(g)return b;g=!0,h=[];for(let x of d)x.kind==="fromTo"&&c.set(x.target,(y=x.from)!=null?y:{}),h.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 h)y.pause();return b},kill(){for(let y of h)y.kill();h=[],g=!1}};return p.paused||b.play(),b}};return c}function ja(){if(typeof window=="undefined")return;let i=window;if(!i.gsap)try{i.gsap=Ia()}catch{}}var Ra={name:"handler-playable-sdk",version:"0.3.59",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && chmod +x dist/cli/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var J=0,Fs=J++,Da=J++,$a=J++,za=J++,Na=J++,Ha=J++,Ba=J++,Fa=J++,Ua=J++,Ga=J++,qa=J++,Va=J++,H=Fs;function Wa(){return H===Da}function Ya(){return H===$a}function Ka(){return H===za}function Xa(){return H===Na}function Ye(){return H===Ha}function Ke(){return H===Ba}function Ja(){return H===Fa}function Za(){return H===Ua}function Qa(){return H===Ga}function ni(){return H===qa}function ii(){return H===Va}function er(){let i=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(i==="mraid")try{mraid.getState(),H=Da;return}catch{}else if(i==="dapi")try{dapi.isReady(),H=$a;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(H=za)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(H=Na)}catch{}else if(e==="mintegral")window.gameReady&&(H=Ha);else if(e==="tapjoy")window.TJ_API&&(H=Ba);else if(e==="tiktok")window.openAppStore&&(H=Fa);else if(e==="smadex")try{window.smxTracking&&(H=Ua)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(H=Ga)}catch{}else e==="vungle"?H=qa:(i==="nucleo"||e==="nucleo")&&(H=Va)}var Ut=Ve(require("lottie-web"),1),ai=Ut.default;typeof window!="undefined"&&(window.lottie=Ut.default,window.__baseLottie=Ut.default);var Us=require("pixi.js");var ri=require("pixi.js");var Gs=null;function si(i){Gs=i}Gt();oi();var mt=require("pixi.js");Gt();var Xs=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",pi=Xs;if(typeof window!="undefined")try{let i=new XMLHttpRequest;if(i.open("GET","./build-settings.json",!1),i.send(),i.status===200&&i.responseText){let e=JSON.parse(i.responseText);e!=null&&e.buildMode&&(pi=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${pi}`))}}catch{}function Js(i){var t,n,a,r,s;if(typeof window!="undefined"&&window.resolveAnchorVec2)return window.resolveAnchorVec2(i);let e={center:{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};if(Array.isArray(i))return{x:(t=i[0])!=null?t:.5,y:(n=i[1])!=null?n:.5};if(i&&typeof i=="object"&&"x"in i&&"y"in i)return{x:(a=i.x)!=null?a:.5,y:(r=i.y)!=null?r:.5};if(typeof i=="string"){let o=i.trim().toLowerCase();return(s=e[o])!=null?s:{x:.5,y:.5}}return null}var Ae=class{static async create(e,t,n){var l,c,p,d,u,g,h;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${pi}`);let a=(l=t==null?void 0:t.render)==null?void 0:l.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let f=new mt.Container;return this.applyTransform(f,t==null?void 0:t.transform,t),f}let r=(c=t==null?void 0:t.identity)==null?void 0:c.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${r}, type: ${a.type}, path: ${a.path}`);let s=await je.load(e,a,n,r);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(p=s==null?void 0:s.constructor)==null?void 0:p.name}`);let o;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",s,"for object:",e),o=new mt.Sprite(s),console.log("[ObjectFactory] Created object:",o,"type:",(d=o==null?void 0:o.constructor)==null?void 0:d.name),this.applyTransform(o,t==null?void 0:t.transform,t);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(u=s==null?void 0:s.constructor)==null?void 0:u.name,s),s&&(((g=s.constructor)==null?void 0:g.name)==="Container"||s instanceof mt.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let f=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],m=!1;for(let b of f)try{let y=await fetch(b);if(y.ok){o=await y.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",b,"type:",(h=o==null?void 0:o.constructor)==null?void 0:h.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,t==null?void 0:t.transform,t);return o}static applyTransform(e,t,n){var a,r,s,o;if(!(!t||!e)&&(t.position&&("x"in e&&"y"in e?(e.x=(a=t.position.x)!=null?a:0,e.y=(r=t.position.y)!=null?r:0):"position"in e&&e.position&&e.position.set((s=t.position.x)!=null?s:0,(o=t.position.y)!=null?o:0)),t.scale!==void 0&&"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(t.scale):e.scale=t.scale),t.rotation!==void 0&&"rotation"in e&&(e.rotation=t.rotation),t.anchor&&"anchor"in e&&e.anchor)){let l=Js(t.anchor);l&&("set"in e.anchor?e.anchor.set(l.x,l.y):(e.anchor.x=l.x,e.anchor.y=l.y))}}};var bt=class{constructor(){this.config=null}init(e){this.config=e}get(e){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return this.config.objects.get(e)}getAllIds(){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return Array.from(this.config.objects.keys())}has(e){return this.config?this.config.objects.has(e):!1}};var eo=Ve(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=eo);Xe();var qt=require("pixi.js");Xe();var fi=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new bt}init(e,t){this.registry.init(e),this.app=t}updateConfig(e){this.registry.init(e),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let t=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));if(t.length===0)return;let n=async a=>{a.length&&(console.log("[Assets] Loading objects:",a),await Promise.all(a.map(async r=>{var o;let s=this.registry.get(r);if(!s){console.warn("[Assets] No config found for object:",r);return}try{let l=await Ae.create(r,s,this.app);this.instanceCache.set(r,l),console.log("[Assets] Loaded object:",r,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",r,l)}})))};return this.readyPromise=(async()=>{await n(t);let a=this.registry.getAllIds().filter(r=>!this.instanceCache.has(r));a.length>0&&(console.warn("[Assets] Retrying missing assets:",a),await n(a)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(e){let t=this.registry.get(e);if(t){let n=await Ae.create(e,t,this.app);this.instanceCache.set(e,n)}}get(e){return this.instanceCache.get(e)}},to=new fi,no=new Proxy(to,{get(i,e){if(e in i&&typeof i[e]=="function")return i[e].bind(i);if(i.get(e))return i.get(e)}});Xe();var sr=require("pixi.js"),fe={width:400,height:600,designWidth:400,scaleFactor:1},Wt={scale:1,position:1},mi=[];function ao(i,e,t,n,a,r,s){mi.push({element:i,originalScale:r,positionHelper:e,heightPercent:a}),e(i,t,n,a,r,s,!1)}function ro(){mi.forEach(({element:i,originalScale:e,positionHelper:t,heightPercent:n})=>{let a=e*fe.scaleFactor;t(i,fe.width,fe.height,n,a,!0,!1)})}function hi(i,e){console.log(`[SCREEN] updateScreenState called: ${i}x${e}`),fe.width=i,fe.height=e,fe.scaleFactor=Math.min(i/fe.designWidth,1.15),Wt.scale=fe.scaleFactor,Wt.position=1,console.log(`[SCREEN] Global multipliers - scale: ${Wt.scale.toFixed(3)}`),ro()}var vt={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 so(i,e,t){let n=vt[i];n&&n[e]!==void 0&&(n[e]=t,console.log(`Updated ${i}.${e} = ${t}`))}function oo(){return vt}var lo={center:{x:.5,y:.5},"center-center":{x:.5,y:.5},middle:{x:.5,y:.5},"middle-center":{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},"left-center":{x:0,y:.5},"right-center":{x:1,y:.5},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};function Vt(i,e){return typeof i=="number"&&Number.isFinite(i)?i:e}function Yt(i,e={x:.5,y:.5}){var t;if(Array.isArray(i))return{x:Vt(i[0],e.x),y:Vt(i[1],e.y)};if(i&&typeof i=="object"){let n=i;return{x:Vt(n.x,e.x),y:Vt(n.y,e.y)}}if(typeof i=="string"){let n=i.trim().toLowerCase();return(t=lo[n])!=null?t:e}return e}function or(i,e,t,n={}){var g,h,f,m,b,y;let a=Yt(t),r=(g=n.inset)!=null?g:{},s=(h=n.padding)!=null?h:{x:0,y:0},o=((f=r.left)!=null?f:0)+s.x,l=((m=r.right)!=null?m:0)+s.x,c=((b=r.top)!=null?b:0)+s.y,p=((y=r.bottom)!=null?y:0)+s.y,d=Math.max(0,i-o-l),u=Math.max(0,e-c-p);return{x:o+d*a.x,y:c+u*a.y}}function lr(i,e,t,n={}){var f,m,b,y,v,x;let a=(f=n.inset)!=null?f:{},r=(m=n.padding)!=null?m:{x:0,y:0},s=((b=a.left)!=null?b:0)+r.x,o=((y=a.right)!=null?y:0)+r.x,l=((v=a.top)!=null?v:0)+r.y,c=((x=a.bottom)!=null?x:0)+r.y,p=Math.max(0,i-s-o),d=Math.max(0,e-l-c),u=Yt(t,{x:.5,y:.5}),g=Math.min(Math.max(u.x,0),1),h=Math.min(Math.max(u.y,0),1);return{x:s+p*g,y:l+d*h}}if(typeof window!="undefined"){let i=window.innerWidth,e=window.innerHeight,t=()=>{let n=window.innerWidth,a=window.innerHeight;(n!==i||a!==e)&&(i=n,e=a,hi(n,a))};window.addEventListener("resize",t),window.addEventListener("orientationchange",()=>{setTimeout(t,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",t),window.mraid.addEventListener("sizeChange",t)),hi(window.innerWidth,window.innerHeight),window.updateDebugConfig=so,window.getDebugConfig=oo,window.copyConfig=xo,window.applyConfig=yt,window.applyConfigForRatio=wo,window.positionAtBottom=cr,window.positionAtTop=uo,window.positionAtCenter=go,window.positionAtLeft=fo,window.positionAtRight=ho,window.positionAtBottomLeft=mo,window.positionAtBottomRight=bo,window.positionAtTopLeft=yo,window.positionAtTopRight=vo,window.applyPositionContract=po,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 Kt(i,e,t=0){return i*e+t}function Xt(i,e,t=0){return i*(1-e)+t}function Jt(i,e,t=0){return i*e+t}function Zt(i,e,t=0){return i*(1-e)+t}function Z(i,e=0){return i/2+e}function co(i,e){return i*e}function po(i,e,t,n){var s,o,l,c,p,d,u,g,h,f,m,b,y,v,x,w,E,C,S,O;let a=0,r=0;switch(n.type){case"top":a=Z(e,(o=(s=n.offset)==null?void 0:s.x)!=null?o:0),r=Kt(t,n.percent,(c=(l=n.offset)==null?void 0:l.y)!=null?c:0);break;case"bottom":a=Z(e,(d=(p=n.offset)==null?void 0:p.x)!=null?d:0),r=Xt(t,n.percent,(g=(u=n.offset)==null?void 0:u.y)!=null?g:0);break;case"left":a=Jt(e,n.percent,(f=(h=n.offset)==null?void 0:h.x)!=null?f:0),r=Z(t,(b=(m=n.offset)==null?void 0:m.y)!=null?b:0);break;case"right":a=Zt(e,n.percent,(v=(y=n.offset)==null?void 0:y.x)!=null?v:0),r=Z(t,(w=(x=n.offset)==null?void 0:x.y)!=null?w:0);break;case"center":a=Z(e,(C=(E=n.offset)==null?void 0:E.x)!=null?C:0),r=Z(t,(O=(S=n.offset)==null?void 0:S.y)!=null?O:0);break}i.position?i.position.set(a,r):(i.x=a,i.y=r),n.scale!==void 0&&n.scale!==1&&i.scale&&(typeof i.scale.set=="function"?i.scale.set(n.scale,n.scale):(i.scale.x=n.scale,i.scale.y=n.scale))}function cr(i,e,t,n=.2,a=1,r=!0,s=!1){let o=co(t,n),l=Xt(t,n/2);he(i,Z(e),l);let c=r?a*fe.scaleFactor:a;me(i,c),s&&!mi.find(p=>p.element===i)&&ao(i,cr,e,t,n,a,r)}function uo(i,e,t,n=.1,a=1){he(i,Z(e),Kt(t,n)),me(i,a)}function go(i,e,t,n=0,a=0,r=1){he(i,Z(e,n),Z(t,a)),me(i,r)}function fo(i,e,t,n=.1,a=1){he(i,Jt(e,n),Z(t)),me(i,a)}function ho(i,e,t,n=.1,a=1){he(i,Zt(e,n),Z(t)),me(i,a)}function mo(i,e,t,n=.05,a=.05,r=1){he(i,Jt(e,a),Xt(t,n)),me(i,r)}function bo(i,e,t,n=.05,a=.05,r=1){he(i,Zt(e,a),Xt(t,n)),me(i,r)}function yo(i,e,t,n=.05,a=.05,r=1){he(i,Jt(e,a),Kt(t,n)),me(i,r)}function vo(i,e,t,n=.05,a=.05,r=1){he(i,Zt(e,a),Kt(t,n)),me(i,r)}function he(i,e,t){i&&i.position?typeof i.position.set=="function"?i.position.set(e,t):(i.position.x=e,i.position.y=t):i&&(i.x=e,i.y=t)}function me(i,e){e!==1&&i&&i.scale&&(typeof i.scale.set=="function"?i.scale.set(e,e):i.scale.x!==void 0&&i.scale.y!==void 0&&(i.scale.x=e,i.scale.y=e))}var Re={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 xo(i){return i&&Re[i]?JSON.parse(JSON.stringify(Re[i])):JSON.parse(JSON.stringify(vt))}function yt(i){Object.keys(i).forEach(e=>{let t=e;vt[t]&&i[t]&&Object.assign(vt[t],i[t])}),console.log("Config applied:",i)}function wo(i,e){let t=i/e;t>1.6?(yt(Re.wide),console.log("Applied WIDE config for ratio:",t)):t<.7?(yt(Re.tall),console.log("Applied TALL config for ratio:",t)):t>.8&&t<1.2?(yt(Re.square),console.log("Applied SQUARE config for ratio:",t)):(yt(Re.default),console.log("Applied DEFAULT config for ratio:",t))}if(typeof window!="undefined"){let i=window;i.configPresets=Re,i.resolveAnchorVec2=i.resolveAnchorVec2||Yt,i.resolveScreenAnchorPoint=i.resolveScreenAnchorPoint||or,i.resolveScreenRatioPoint=i.resolveScreenRatioPoint||lr}dn();function U(i,e){let t=(a,r)=>r===0?a:t(r,a%r),n=t(i,e);return`${i/n}:${e/n}`}var Nc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:U(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:U(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:U(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:U(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:U(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:U(360,780)}],Hc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:U(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:U(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:U(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:U(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:U(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:U(412,915)}],Bc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:U(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:U(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:U(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:U(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:U(800,1280)}],_i=[{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:U(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:U(768,1024),mraidScale:.7}];var Pi=[..._i],ki=[{category:"playable",label:"Playable Ad",devices:_i}],pn=_i[0];function Ne(i){return Pi.find(e=>e.id===i)||pn}function Oo(i){return Pi.filter(e=>e.category===i)}var un=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`
|
|
46
|
+
`,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 a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let r=this.modal.querySelector("[data-modal-apply]");r==null||r.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",s=>{s.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let t=window.__openAiEditor;if(typeof t!="function"){alert("AI Editor not available. Please check your setup.");return}let n="";e==="edit"&&this.currentAsset?n=`Edit this image: ${this.currentObjectId}`:n=`Create an image for: ${this.currentObjectId}`,t(this.currentObjectId||"unknown",n,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var pl={};ft(pl,{COLORS:()=>ce,ConfigWatcher:()=>ze,DebugPanel:()=>kt,DefaultReloadStrategy:()=>St,Handler:()=>ne,PlayableLoadingScreen:()=>Un,PreviewShell:()=>Hn,STROKE_WIDTH:()=>hs,THEME:()=>ms,applyConfigOverride:()=>Se,applyConfigOverrides:()=>Ce,applyConfigsToDisk:()=>an,applyDefaults:()=>$e,baseLottie:()=>ai,bootstrap:()=>el,clearConfigOverrides:()=>oe,clearConfigOverridesForObject:()=>br,configOverrideManager:()=>yr,createPreviewShell:()=>la,deepClone:()=>G,default:()=>Oe,defaultPreset:()=>pn,deviceGroups:()=>ki,devicePresets:()=>Pi,diffConfigs:()=>Ai,exportConfigsAsJSON:()=>De,getConfigOverrides:()=>Y,getConfigStateSummary:()=>nn,getOverrideMode:()=>wt,getPresetById:()=>Ne,getPresetsByCategory:()=>Oo,loadAllObjectConfigs:()=>on,loadComponentSchemas:()=>sn,loadEngineConfig:()=>ln,loadGamePromptConfig:()=>xi,loadObjectCentricConfig:()=>be,loadObjectConfig:()=>Le,loadSceneConfig:()=>cn,rehydrateObject:()=>Si,removeConfigOverride:()=>tn,resetToApplied:()=>Et,resetToOriginal:()=>rn,setBootstrapDependencies:()=>Zo,setOverrideMode:()=>bi,setupHotReload:()=>Ti,setupLiveEditBridge:()=>Bn,toLegacyFormat:()=>wi,validateObjectConfig:()=>Ze});module.exports=$s(pl);var we={};function Bt(i,e,t=!1){we[i]||(we[i]=[]),we[i].push({fn:e,once:t})}function ei(i,e){if(we[i]){if(!e){delete we[i];return}we[i]=we[i].filter(t=>t.fn!==e)}}function Ft(i,...e){let t=we[i];if(t)for(let n of[...t])n.fn(...e),n.once&&ei(i,n.fn)}function X(i,e){Bt(i,e,!0)}var F=null,ee=[],We=null;function Ta(i){F=i,ee=[],We!==null&&(clearTimeout(We),We=null)}function _a(){var i,e,t;return{endpoint:(F==null?void 0:F.endpoint)||"",transport:(F==null?void 0:F.transport)||"beacon",batchSize:(i=F==null?void 0:F.batchSize)!=null?i:10,flushIntervalMs:(e=F==null?void 0:F.flushIntervalMs)!=null?e:300,maxQueue:(t=F==null?void 0:F.maxQueue)!=null?t:200,debug:!!(F!=null&&F.debug)}}async function Ca(i,e,t,n){let a=JSON.stringify(e);if(t==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let r=navigator.sendBeacon(i,new Blob([a],{type:"application/json"}));n&&console.log("[handler.telemetry] beacon",r,e);return}catch(r){n&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",r)}try{await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),n&&console.log("[handler.telemetry] fetch",e)}catch(r){n&&console.warn("[handler.telemetry] fetch failed",r)}}function ti(i,e){let t=_a();if(e&&t.endpoint){if(ee.push(i),ee.length>t.maxQueue&&(ee=ee.slice(ee.length-t.maxQueue)),ee.length>=t.batchSize){La();return}We===null&&(We=window.setTimeout(()=>{We=null,La()},t.flushIntervalMs))}}async function La(){let i=_a();if(!i.endpoint||ee.length===0)return;let e=ee.splice(0,i.batchSize);await Ca(i.endpoint,{events:e},i.transport,i.debug),ee.length>0&&await Ca(i.endpoint,{events:ee.splice(0,i.batchSize)},i.transport,i.debug)}function Pa(i){return Math.max(0,Math.min(1,i))}function zs(i){let e=String(i!=null?i:"power2.out");if(e==="linear")return t=>t;if(e==="sine.inOut")return t=>.5-Math.cos(Math.PI*t)/2;if(e==="power2.out"||e==="easeOutQuad")return t=>1-(1-t)*(1-t);if(e.startsWith("back.out")){let t=e.match(/back\.out\(([\d.]+)\)/),n=t?Number(t[1]):1.8;return a=>1+(n+1)*Math.pow(a-1,3)+n*Math.pow(a-1,2)}return t=>1-(1-t)*(1-t)}function ht(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Ns(i,e){let t=i==null?void 0:i[e];return typeof t=="number"?t:0}function ka(i,e,t){try{i[e]=t}catch{}}function Hs(i){let e=i==null?void 0:i.scale;if(!e)return null;let t=typeof e.x=="number"?e.x:1,n=typeof e.y=="number"?e.y:1;return{x:t,y:n}}function Ma(i,e){let t=i==null?void 0:i.scale;if(t)try{typeof t.set=="function"?t.set(e.x,e.y):(typeof t.x=="number"&&(t.x=e.x),typeof t.y=="number"&&(t.y=e.y))}catch{}}function Oa(i,e){let t=Hs(i);if(!t)return{from:null,to:null};let n=null,a=null;return typeof e.scale=="number"?(n=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(n=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(n=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),n===null&&a===null?{from:null,to:null}:{from:{x:t.x,y:t.y},to:{x:n!=null?n:t.x,y:a!=null?a:t.y}}}function Ia(){let i=new Set,e=new WeakMap,t=null,n=()=>{if(t!=null)return;t=requestAnimationFrame(()=>{t=null,o(),i.size>0&&n()})},a=p=>{var u;i.add(p);let d=(u=e.get(p.target))!=null?u:new Set;d.add(p),e.set(p.target,d),n()},r=p=>{i.delete(p);let d=e.get(p.target);d&&(d.delete(p),d.size===0&&e.delete(p.target))},s=p=>{p.killed||(p.killed=!0,r(p))},o=()=>{var d,u;let p=ht();for(let g of Array.from(i)){if(g.killed||g.paused)continue;let h=p-g.startMs-g.delayMs;if(h<0)continue;let f=g.durationMs>0?h/g.durationMs:1,m=Pa(f),b=g.repeat>=0?g.repeat+1:1,y=g.repeat>0?Math.min(Math.floor(f),b-1):0;if(g.repeat>0&&f>=1){let w=f-y;m=Pa(w)}let v=g.ease(m);g.yoyo&&y%2===1&&(v=1-v);for(let w of g.props)ka(g.target,w.key,w.from+(w.to-w.from)*v);g.scaleFrom&&g.scaleTo&&Ma(g.target,{x:g.scaleFrom.x+(g.scaleTo.x-g.scaleFrom.x)*v,y:g.scaleFrom.y+(g.scaleTo.y-g.scaleFrom.y)*v});try{(d=g.onUpdate)==null||d.call(g)}catch{}if(f>=b){s(g);try{(u=g.onComplete)==null||u.call(g)}catch{}}}},l=(p,d,u)=>{var w;let g=Math.max(0,(typeof d.duration=="number"?d.duration:.5)*1e3),h=Math.max(0,(typeof d.delay=="number"?d.delay:0)*1e3+((w=u==null?void 0:u.delayMsOverride)!=null?w:0)),f=zs(d.ease),m=typeof d.repeat=="number"?Math.max(0,d.repeat|0):0,b=d.yoyo===!0,y=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),v=[];for(let E of Object.keys(d)){if(y.has(E))continue;let C=d[E];typeof C=="number"&&v.push({key:E,from:Ns(p,E),to:C})}let x=Oa(p,d);return{target:p,startMs:ht(),delayMs:h,durationMs:g,ease:f,props:v,scaleFrom:x.from,scaleTo:x.to,repeat:m,yoyo:b,onUpdate:typeof d.onUpdate=="function"?d.onUpdate:void 0,onComplete:typeof d.onComplete=="function"?d.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},c={to(p,d){let u=l(p,d);return a(u),{kill:()=>s(u),pause:()=>{u.paused||(u.paused=!0,u.pauseAtMs=ht())},resume:()=>{var f;if(!u.paused)return;let g=(f=u.pauseAtMs)!=null?f:ht(),h=ht()-g;u.startMs+=h,u.paused=!1,u.pauseAtMs=null},isActive:()=>!u.killed&&!u.paused}},fromTo(p,d,u){return c.set(p,d),c.to(p,u)},set(p,d){if(!p||!d)return;for(let g of Object.keys(d)){let h=d[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof h=="number"&&ka(p,g,h)}let u=Oa(p,d);u.to&&Ma(p,u.to)},killTweensOf(p){let d=e.get(p);if(d)for(let u of Array.from(d))s(u)},timeline(p={}){let d=[],u=0,g=!1,h=[],f=y=>{if(typeof y=="number")return Math.max(0,y*1e3);let v=typeof y=="string"?y.trim():"";return v.startsWith("+=")?u+Math.max(0,Number(v.slice(2))*1e3||0):v?Math.max(0,Number(v)*1e3||0):u},m=y=>{d.push(y);let v=Math.max(0,(typeof y.vars.duration=="number"?y.vars.duration:.5)*1e3);u=Math.max(u,y.atMs+v)},b={to(y,v,x){return m({kind:"to",target:y,vars:v,atMs:f(x)}),b},fromTo(y,v,x,w){return m({kind:"fromTo",target:y,vars:x,from:v,atMs:f(w)}),b},play(){var y,v;if(g)return b;g=!0,h=[];for(let x of d)x.kind==="fromTo"&&c.set(x.target,(y=x.from)!=null?y:{}),h.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 h)y.pause();return b},kill(){for(let y of h)y.kill();h=[],g=!1}};return p.paused||b.play(),b}};return c}function ja(){if(typeof window=="undefined")return;let i=window;if(!i.gsap)try{i.gsap=Ia()}catch{}}var Ra={name:"handler-playable-sdk",version:"0.3.61",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && chmod +x dist/cli/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var J=0,Fs=J++,Da=J++,$a=J++,za=J++,Na=J++,Ha=J++,Ba=J++,Fa=J++,Ua=J++,Ga=J++,qa=J++,Va=J++,H=Fs;function Wa(){return H===Da}function Ya(){return H===$a}function Ka(){return H===za}function Xa(){return H===Na}function Ye(){return H===Ha}function Ke(){return H===Ba}function Ja(){return H===Fa}function Za(){return H===Ua}function Qa(){return H===Ga}function ni(){return H===qa}function ii(){return H===Va}function er(){let i=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(i==="mraid")try{mraid.getState(),H=Da;return}catch{}else if(i==="dapi")try{dapi.isReady(),H=$a;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(H=za)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(H=Na)}catch{}else if(e==="mintegral")window.gameReady&&(H=Ha);else if(e==="tapjoy")window.TJ_API&&(H=Ba);else if(e==="tiktok")window.openAppStore&&(H=Fa);else if(e==="smadex")try{window.smxTracking&&(H=Ua)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(H=Ga)}catch{}else e==="vungle"?H=qa:(i==="nucleo"||e==="nucleo")&&(H=Va)}var Ut=Ve(require("lottie-web"),1),ai=Ut.default;typeof window!="undefined"&&(window.lottie=Ut.default,window.__baseLottie=Ut.default);var Us=require("pixi.js");var ri=require("pixi.js");var Gs=null;function si(i){Gs=i}Gt();oi();var mt=require("pixi.js");Gt();var Xs=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",pi=Xs;if(typeof window!="undefined")try{let i=new XMLHttpRequest;if(i.open("GET","./build-settings.json",!1),i.send(),i.status===200&&i.responseText){let e=JSON.parse(i.responseText);e!=null&&e.buildMode&&(pi=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${pi}`))}}catch{}function Js(i){var t,n,a,r,s;if(typeof window!="undefined"&&window.resolveAnchorVec2)return window.resolveAnchorVec2(i);let e={center:{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};if(Array.isArray(i))return{x:(t=i[0])!=null?t:.5,y:(n=i[1])!=null?n:.5};if(i&&typeof i=="object"&&"x"in i&&"y"in i)return{x:(a=i.x)!=null?a:.5,y:(r=i.y)!=null?r:.5};if(typeof i=="string"){let o=i.trim().toLowerCase();return(s=e[o])!=null?s:{x:.5,y:.5}}return null}var Ae=class{static async create(e,t,n){var l,c,p,d,u,g,h;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${pi}`);let a=(l=t==null?void 0:t.render)==null?void 0:l.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let f=new mt.Container;return this.applyTransform(f,t==null?void 0:t.transform,t),f}let r=(c=t==null?void 0:t.identity)==null?void 0:c.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${r}, type: ${a.type}, path: ${a.path}`);let s=await je.load(e,a,n,r);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(p=s==null?void 0:s.constructor)==null?void 0:p.name}`);let o;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",s,"for object:",e),o=new mt.Sprite(s),console.log("[ObjectFactory] Created object:",o,"type:",(d=o==null?void 0:o.constructor)==null?void 0:d.name),this.applyTransform(o,t==null?void 0:t.transform,t);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(u=s==null?void 0:s.constructor)==null?void 0:u.name,s),s&&(((g=s.constructor)==null?void 0:g.name)==="Container"||s instanceof mt.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let f=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],m=!1;for(let b of f)try{let y=await fetch(b);if(y.ok){o=await y.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",b,"type:",(h=o==null?void 0:o.constructor)==null?void 0:h.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,t==null?void 0:t.transform,t);return o}static applyTransform(e,t,n){var a,r,s,o;if(!(!t||!e)&&(t.position&&("x"in e&&"y"in e?(e.x=(a=t.position.x)!=null?a:0,e.y=(r=t.position.y)!=null?r:0):"position"in e&&e.position&&e.position.set((s=t.position.x)!=null?s:0,(o=t.position.y)!=null?o:0)),t.scale!==void 0&&"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(t.scale):e.scale=t.scale),t.rotation!==void 0&&"rotation"in e&&(e.rotation=t.rotation),t.anchor&&"anchor"in e&&e.anchor)){let l=Js(t.anchor);l&&("set"in e.anchor?e.anchor.set(l.x,l.y):(e.anchor.x=l.x,e.anchor.y=l.y))}}};var bt=class{constructor(){this.config=null}init(e){this.config=e}get(e){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return this.config.objects.get(e)}getAllIds(){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return Array.from(this.config.objects.keys())}has(e){return this.config?this.config.objects.has(e):!1}};var eo=Ve(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=eo);Xe();var qt=require("pixi.js");Xe();var fi=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new bt}init(e,t){this.registry.init(e),this.app=t}updateConfig(e){this.registry.init(e),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let t=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));if(t.length===0)return;let n=async a=>{a.length&&(console.log("[Assets] Loading objects:",a),await Promise.all(a.map(async r=>{var o;let s=this.registry.get(r);if(!s){console.warn("[Assets] No config found for object:",r);return}try{let l=await Ae.create(r,s,this.app);this.instanceCache.set(r,l),console.log("[Assets] Loaded object:",r,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",r,l)}})))};return this.readyPromise=(async()=>{await n(t);let a=this.registry.getAllIds().filter(r=>!this.instanceCache.has(r));a.length>0&&(console.warn("[Assets] Retrying missing assets:",a),await n(a)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(e){let t=this.registry.get(e);if(t){let n=await Ae.create(e,t,this.app);this.instanceCache.set(e,n)}}get(e){return this.instanceCache.get(e)}},to=new fi,no=new Proxy(to,{get(i,e){if(e in i&&typeof i[e]=="function")return i[e].bind(i);if(i.get(e))return i.get(e)}});Xe();var sr=require("pixi.js"),fe={width:400,height:600,designWidth:400,scaleFactor:1},Wt={scale:1,position:1},mi=[];function ao(i,e,t,n,a,r,s){mi.push({element:i,originalScale:r,positionHelper:e,heightPercent:a}),e(i,t,n,a,r,s,!1)}function ro(){mi.forEach(({element:i,originalScale:e,positionHelper:t,heightPercent:n})=>{let a=e*fe.scaleFactor;t(i,fe.width,fe.height,n,a,!0,!1)})}function hi(i,e){console.log(`[SCREEN] updateScreenState called: ${i}x${e}`),fe.width=i,fe.height=e,fe.scaleFactor=Math.min(i/fe.designWidth,1.15),Wt.scale=fe.scaleFactor,Wt.position=1,console.log(`[SCREEN] Global multipliers - scale: ${Wt.scale.toFixed(3)}`),ro()}var vt={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 so(i,e,t){let n=vt[i];n&&n[e]!==void 0&&(n[e]=t,console.log(`Updated ${i}.${e} = ${t}`))}function oo(){return vt}var lo={center:{x:.5,y:.5},"center-center":{x:.5,y:.5},middle:{x:.5,y:.5},"middle-center":{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},"left-center":{x:0,y:.5},"right-center":{x:1,y:.5},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};function Vt(i,e){return typeof i=="number"&&Number.isFinite(i)?i:e}function Yt(i,e={x:.5,y:.5}){var t;if(Array.isArray(i))return{x:Vt(i[0],e.x),y:Vt(i[1],e.y)};if(i&&typeof i=="object"){let n=i;return{x:Vt(n.x,e.x),y:Vt(n.y,e.y)}}if(typeof i=="string"){let n=i.trim().toLowerCase();return(t=lo[n])!=null?t:e}return e}function or(i,e,t,n={}){var g,h,f,m,b,y;let a=Yt(t),r=(g=n.inset)!=null?g:{},s=(h=n.padding)!=null?h:{x:0,y:0},o=((f=r.left)!=null?f:0)+s.x,l=((m=r.right)!=null?m:0)+s.x,c=((b=r.top)!=null?b:0)+s.y,p=((y=r.bottom)!=null?y:0)+s.y,d=Math.max(0,i-o-l),u=Math.max(0,e-c-p);return{x:o+d*a.x,y:c+u*a.y}}function lr(i,e,t,n={}){var f,m,b,y,v,x;let a=(f=n.inset)!=null?f:{},r=(m=n.padding)!=null?m:{x:0,y:0},s=((b=a.left)!=null?b:0)+r.x,o=((y=a.right)!=null?y:0)+r.x,l=((v=a.top)!=null?v:0)+r.y,c=((x=a.bottom)!=null?x:0)+r.y,p=Math.max(0,i-s-o),d=Math.max(0,e-l-c),u=Yt(t,{x:.5,y:.5}),g=Math.min(Math.max(u.x,0),1),h=Math.min(Math.max(u.y,0),1);return{x:s+p*g,y:l+d*h}}if(typeof window!="undefined"){let i=window.innerWidth,e=window.innerHeight,t=()=>{let n=window.innerWidth,a=window.innerHeight;(n!==i||a!==e)&&(i=n,e=a,hi(n,a))};window.addEventListener("resize",t),window.addEventListener("orientationchange",()=>{setTimeout(t,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",t),window.mraid.addEventListener("sizeChange",t)),hi(window.innerWidth,window.innerHeight),window.updateDebugConfig=so,window.getDebugConfig=oo,window.copyConfig=xo,window.applyConfig=yt,window.applyConfigForRatio=wo,window.positionAtBottom=cr,window.positionAtTop=uo,window.positionAtCenter=go,window.positionAtLeft=fo,window.positionAtRight=ho,window.positionAtBottomLeft=mo,window.positionAtBottomRight=bo,window.positionAtTopLeft=yo,window.positionAtTopRight=vo,window.applyPositionContract=po,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 Kt(i,e,t=0){return i*e+t}function Xt(i,e,t=0){return i*(1-e)+t}function Jt(i,e,t=0){return i*e+t}function Zt(i,e,t=0){return i*(1-e)+t}function Z(i,e=0){return i/2+e}function co(i,e){return i*e}function po(i,e,t,n){var s,o,l,c,p,d,u,g,h,f,m,b,y,v,x,w,E,C,S,O;let a=0,r=0;switch(n.type){case"top":a=Z(e,(o=(s=n.offset)==null?void 0:s.x)!=null?o:0),r=Kt(t,n.percent,(c=(l=n.offset)==null?void 0:l.y)!=null?c:0);break;case"bottom":a=Z(e,(d=(p=n.offset)==null?void 0:p.x)!=null?d:0),r=Xt(t,n.percent,(g=(u=n.offset)==null?void 0:u.y)!=null?g:0);break;case"left":a=Jt(e,n.percent,(f=(h=n.offset)==null?void 0:h.x)!=null?f:0),r=Z(t,(b=(m=n.offset)==null?void 0:m.y)!=null?b:0);break;case"right":a=Zt(e,n.percent,(v=(y=n.offset)==null?void 0:y.x)!=null?v:0),r=Z(t,(w=(x=n.offset)==null?void 0:x.y)!=null?w:0);break;case"center":a=Z(e,(C=(E=n.offset)==null?void 0:E.x)!=null?C:0),r=Z(t,(O=(S=n.offset)==null?void 0:S.y)!=null?O:0);break}i.position?i.position.set(a,r):(i.x=a,i.y=r),n.scale!==void 0&&n.scale!==1&&i.scale&&(typeof i.scale.set=="function"?i.scale.set(n.scale,n.scale):(i.scale.x=n.scale,i.scale.y=n.scale))}function cr(i,e,t,n=.2,a=1,r=!0,s=!1){let o=co(t,n),l=Xt(t,n/2);he(i,Z(e),l);let c=r?a*fe.scaleFactor:a;me(i,c),s&&!mi.find(p=>p.element===i)&&ao(i,cr,e,t,n,a,r)}function uo(i,e,t,n=.1,a=1){he(i,Z(e),Kt(t,n)),me(i,a)}function go(i,e,t,n=0,a=0,r=1){he(i,Z(e,n),Z(t,a)),me(i,r)}function fo(i,e,t,n=.1,a=1){he(i,Jt(e,n),Z(t)),me(i,a)}function ho(i,e,t,n=.1,a=1){he(i,Zt(e,n),Z(t)),me(i,a)}function mo(i,e,t,n=.05,a=.05,r=1){he(i,Jt(e,a),Xt(t,n)),me(i,r)}function bo(i,e,t,n=.05,a=.05,r=1){he(i,Zt(e,a),Xt(t,n)),me(i,r)}function yo(i,e,t,n=.05,a=.05,r=1){he(i,Jt(e,a),Kt(t,n)),me(i,r)}function vo(i,e,t,n=.05,a=.05,r=1){he(i,Zt(e,a),Kt(t,n)),me(i,r)}function he(i,e,t){i&&i.position?typeof i.position.set=="function"?i.position.set(e,t):(i.position.x=e,i.position.y=t):i&&(i.x=e,i.y=t)}function me(i,e){e!==1&&i&&i.scale&&(typeof i.scale.set=="function"?i.scale.set(e,e):i.scale.x!==void 0&&i.scale.y!==void 0&&(i.scale.x=e,i.scale.y=e))}var Re={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 xo(i){return i&&Re[i]?JSON.parse(JSON.stringify(Re[i])):JSON.parse(JSON.stringify(vt))}function yt(i){Object.keys(i).forEach(e=>{let t=e;vt[t]&&i[t]&&Object.assign(vt[t],i[t])}),console.log("Config applied:",i)}function wo(i,e){let t=i/e;t>1.6?(yt(Re.wide),console.log("Applied WIDE config for ratio:",t)):t<.7?(yt(Re.tall),console.log("Applied TALL config for ratio:",t)):t>.8&&t<1.2?(yt(Re.square),console.log("Applied SQUARE config for ratio:",t)):(yt(Re.default),console.log("Applied DEFAULT config for ratio:",t))}if(typeof window!="undefined"){let i=window;i.configPresets=Re,i.resolveAnchorVec2=i.resolveAnchorVec2||Yt,i.resolveScreenAnchorPoint=i.resolveScreenAnchorPoint||or,i.resolveScreenRatioPoint=i.resolveScreenRatioPoint||lr}dn();function U(i,e){let t=(a,r)=>r===0?a:t(r,a%r),n=t(i,e);return`${i/n}:${e/n}`}var Nc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:U(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:U(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:U(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:U(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:U(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:U(360,780)}],Hc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:U(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:U(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:U(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:U(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:U(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:U(412,915)}],Bc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:U(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:U(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:U(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:U(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:U(800,1280)}],_i=[{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:U(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:U(768,1024),mraidScale:.7}];var Pi=[..._i],ki=[{category:"playable",label:"Playable Ad",devices:_i}],pn=_i[0];function Ne(i){return Pi.find(e=>e.id===i)||pn}function Oo(i){return Pi.filter(e=>e.category===i)}var un=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
47
|
<div class="scene-panel scene-objects panel-accent-teal" data-panel="scene-objects" style="left:16px; top:72px;">
|
|
48
48
|
<div class="scene-panel-header" data-panel-handle>
|
|
49
49
|
<div class="panel-title">
|
|
@@ -369,7 +369,7 @@
|
|
|
369
369
|
</select>
|
|
370
370
|
</div>
|
|
371
371
|
</div>
|
|
372
|
-
`}formatLabel(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}};var Cn=class{constructor(){this.typeDetector=new mn,this.imageRenderer=new bn,this.colorRenderer=new yn,this.numberRenderer=new vn,this.textRenderer=new xn,this.booleanRenderer=new wn,this.arrayRenderer=new En,this.objectRenderer=new An(this),this.selectRenderer=new Sn}getObjectIds(){try{let e=window,t=e==null?void 0:e.__editableConfig;if(!(t!=null&&t.objects))return[];let n=[];if(t.objects instanceof Map)for(let a of t.objects.keys())n.push(a);else typeof t.objects=="object"&&n.push(...Object.keys(t.objects));return n.sort()}catch{return[]}}getEnumOptionsFromSchemas(e){var t;try{let n=window,a=n==null?void 0:n.__editableConfig,r=a==null?void 0:a.schemas;if(!r)return null;let s=String(e||"").split(".").filter(Boolean);if(s.length<2)return null;let o=s[0],l=s.slice(1).join("."),c=r instanceof Map?r.get(o):r==null?void 0:r[o];if(!c)return null;let p=(t=c==null?void 0:c.types)==null?void 0:t[l];if(typeof p!="string"||!p.startsWith("enum:"))return null;let u=p.slice(5).split("|").map(g=>g.trim()).filter(Boolean);return u.length?u:null}catch{return null}}getLogicOptions(){try{let e=window,t=Array.isArray(e==null?void 0:e.__HANDLER_LOGIC_OPTIONS)?e.__HANDLER_LOGIC_OPTIONS:[],a=[...["DragToWin","SwerveMove","DragSnap","JoystickMove"],...t].map(r=>String(r)).filter(r=>r.trim().length>0);return Array.from(new Set(a)).sort((r,s)=>r.localeCompare(s))}catch{return[]}}renderProperty(e,t,n,a){let r=t.toLowerCase(),s=r==="logic"||r==="logic_id"||r==="logicid",o=r==="id"&&a.toLowerCase().includes("logic");if((s||o)&&typeof n=="string"){let u=this.getLogicOptions();return this.selectRenderer.render(e,t,n,a,u)}let c={zone:["bottom-left","bottom-center","bottom-right","top-left","top-center","top-right"],directionMode:["dominantAxis","free"],axis:["both","x","y"],ease:["power2.out","linear","sine.inOut","back.out(1.8)"],direction:["any","horizontal","vertical"]}[t];if(c&&a.includes("logic.props"))return this.selectRenderer.render(e,t,n,a,c);if((t==="targetId"||t==="inputId")&&typeof n=="string"){let u=this.getObjectIds();return this.selectRenderer.render(e,t,n,a,["",...u])}let p=this.getEnumOptionsFromSchemas(a);if(p)return this.selectRenderer.render(e,t,n,a,p);switch(this.typeDetector.detectType(t,n)){case"image":return this.imageRenderer.render(e,t,n,a);case"color":return this.colorRenderer.render(e,t,n,a);case"number":return this.numberRenderer.render(e,t,n,a);case"boolean":return this.booleanRenderer.render(e,t,n,a);case"array":return this.arrayRenderer.render(e,t,n,a);case"object":return this.objectRenderer.render(e,t,n,a);case"select":return this.selectRenderer.render(e,t,n,a,[]);default:return this.textRenderer.render(e,t,n,a)}}getTypeDetector(){return this.typeDetector}};K();var Qe=class{async updateProperty(e,t,n,a={}){var l,c,p;console.log("[PropertyUpdateManager] Updating:",e,t,n);let r=window.getEditableObjectConfig;if(typeof r!="function"){console.error("[PropertyUpdateManager] getEditableObjectConfig not available");return}let s=r(e);if(!s){console.error("[PropertyUpdateManager] Config not found for:",e);return}Se({objectId:e,path:t,value:n},{persist:!0});let o=window.applyEditableObjectConfig;if(typeof o=="function"){let d=window.__editableConfig,u=(p=(c=(l=d==null?void 0:d.objects)==null?void 0:l.get)==null?void 0:c.call(l,e))!=null?p:s;await o(e,u),console.log("[PropertyUpdateManager] Applied config successfully")}else console.warn("[PropertyUpdateManager] applyEditableObjectConfig not available");this.triggerRefresh(e),a.refreshInspector&&window.dispatchEvent(new CustomEvent("inspector:refresh"))}getNestedProperty(e,t){let n=t.split("."),a=e;for(let r of n)if(a&&typeof a=="object"&&r in a)a=a[r];else return;return a}triggerRefresh(e){let t=window.__refreshHierarchy;typeof t=="function"&&t(),window.dispatchEvent(new CustomEvent("inspector:property-updated",{detail:{objectId:e}}))}};var Ln=class{constructor(){this.updateManager=new Qe}async handleAction(e,t,n){console.log("[QuickActionsBar] Action:",e,t,n);let a=window.getEditableObjectConfig;if(typeof a!="function")return;let r=a(t);if(!r)return;let s=this.updateManager.getNestedProperty(r,n);if(e==="ai-convert"||e==="upload"||e==="library"){let o=n==="ui.text"||n==="render.asset.path",l=n==="render.asset.path";o&&(await this.prepareForImageConversion(t,r),e==="ai-convert"&&n!=="render.asset.path"&&(n="render.asset.path"))}switch(e){case"library":this.openLibrary(t,n,s);break;case"ai-edit":this.openAIEditor(t,n,s);break;case"upload":this.openUpload(t,n);break;case"reset":await this.resetToDefault(t,n);break;case"ai-convert":this.handleAiConvert(t,n,s);break;default:console.warn("[QuickActionsBar] Unknown action:",e)}}async prepareForImageConversion(e,t){var n,a;if(console.log("[QuickActionsBar] Preparing for image conversion:",e),t.render||(t.render={alpha:1,visible:!0}),(t.render.alpha===0||t.render.alpha===void 0)&&(t.render.alpha=1,await this.updateManager.updateProperty(e,"render.alpha",1)),(t.render.visible===!1||t.render.visible===void 0)&&(t.render.visible=!0,await this.updateManager.updateProperty(e,"render.visible",!0)),t.render.asset||(t.render.asset={type:"image",path:""}),t.render.asset.type!=="image"&&(t.render.asset.type="image",await this.updateManager.updateProperty(e,"render.asset",{type:"image",path:t.render.asset.path||""})),t.ui&&t.ui.renderMode!=="png"){await this.updateManager.updateProperty(e,"ui.renderMode","png",{refreshInspector:!0}),await this.updateManager.updateProperty(e,"render.tint","#ffffff");let s=((a=(n=t.transform)==null?void 0:n.scale)!=null?a:1)*.3;await this.updateManager.updateProperty(e,"transform.scale",s),console.log("[QuickActionsBar] Text to PNG conversion: set tint white, scale",s)}this.ensureSlotInRegistry(e,t)}ensureSlotInRegistry(e,t){var o,l,c;let n=window.getEditableAssets;if(typeof n!="function")return;let a=n();if(!a||!a.slots)return;let r=e.startsWith("json.")?e.replace("json.",""):e;if(!a.slots.some(p=>p.objectId===r||p.slotId===r)){let p=((o=t.identity)==null?void 0:o.category)||"ui";console.log("[QuickActionsBar] Adding new slot to registry for converted object:",r),a.slots.push({slotId:r,displayName:r.replace(/_/g," "),objectId:r,category:p,currentAsset:((c=(l=t.render)==null?void 0:l.asset)==null?void 0:c.path)||"",defaultAsset:"",libraryFolder:p,assetType:"image"}),a.categories&&!a.categories.includes(p)&&a.categories.push(p),a.libraryAssets&&!a.libraryAssets[p]&&(a.libraryAssets[p]=[]);let d=window.reRenderAssetLibrary;typeof d=="function"&&d()}}openLibrary(e,t,n){var r;let a=window.__debugContext;if(a){if(a.activeTab!=="library"){a.activeTab="library";let s=window.__updateWorkbenchTabs;typeof s=="function"&&s()}if(a.libraryPanel){let s=window.getEditableObjectConfig,o=s==null?void 0:s(e),l=(r=o==null?void 0:o.identity)==null?void 0:r.category;l||(l=t.split(".")[0]==="render"?"environment":"ui"),console.log("[QuickActionsBar] Highlighting library slot:",e,"category:",l),a.libraryPanel.highlightSlot(e,l)}}}openAIEditor(e,t,n){let a=window.__openAiEditor;if(typeof a=="function"){let r=t.split(".").pop()||t;a(r,`Edit ${r} for ${e}`,n,{objectId:e,path:t})}else console.warn("[QuickActionsBar] AI Editor not available")}openUpload(e,t){let n=document.createElement("input");n.type="file",n.accept="image/*",n.onchange=async a=>{var o;let r=(o=a.target.files)==null?void 0:o[0];if(!r)return;console.log("[QuickActionsBar] Preparing upload for:",r.name);let s=new FileReader;s.onload=async()=>{var c,p,d;let l=s.result;try{let u=window.getEditableObjectConfig,g=u==null?void 0:u(e),h=((c=g==null?void 0:g.identity)==null?void 0:c.category)||(t.split(".")[0]==="render"?"environment":"ui"),m=`${e.replace(/^json\./,"").replace(/[^a-zA-Z0-9_-]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"")}_uploaded`;console.log("[QuickActionsBar] Saving uploaded file:",m,"to category:",h);let y=await(await fetch("/api/library/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({category:h,filename:`${m}.png`,data:l,overwrite:!0})})).json();if(y.success){console.log("[QuickActionsBar] \u2705 Uploaded and saved:",y.path);let v=window.addAssetToRegistry;typeof v=="function"&&v(h,`${m}.png`);try{await fetch("/api/setup-library",{method:"POST",headers:{"Content-Type":"application/json"}}),console.log("[QuickActionsBar] \u2705 Library setup completed")}catch(C){console.warn("[QuickActionsBar] Setup-library not available:",C)}let x=window.refreshAssetLibrary;typeof x=="function"&&await x(),await this.updateManager.updateProperty(e,t,y.path);let w=window.__debugContext;(d=(p=w==null?void 0:w.options)==null?void 0:p.onPropertyChange)==null||d.call(p,e,t,y.path);let E=window.__highlightLibrarySlot;typeof E=="function"&&setTimeout(()=>{E(e,h)},500),window.dispatchEvent(new CustomEvent("inspector:refresh")),console.log("[QuickActionsBar] \u2705 Upload complete and applied")}else console.error("[QuickActionsBar] \u274C Upload failed:",y.error),alert(`Upload failed: ${y.error}`)}catch(u){console.error("[QuickActionsBar] \u274C Upload error:",u),alert("Upload failed. Check console.")}},s.readAsDataURL(r)},n.click()}async resetToDefault(e,t){console.log("[QuickActionsBar] Reset to default:",e,t);try{let n=await this.getDefaultValue(e,t);n!==void 0?(await this.updateManager.updateProperty(e,t,n),console.log("[QuickActionsBar] Reset to default value:",n)):alert("No default value found for this property.")}catch(n){console.error("[QuickActionsBar] Failed to reset to default:",n),alert("Failed to reset property. Check console for details.")}}async getDefaultValue(e,t){let n=t.split(".");if(n.length<2)return;let a=n[0],r=n.slice(1),s=window.__editableConfig;if(!(s!=null&&s.schemas))return;let o=null;if(s.schemas instanceof Map?o=s.schemas.get(a):typeof s.schemas=="object"&&(o=s.schemas[a]),!(o!=null&&o.defaults))return;let l=o.defaults;for(let c of r)if(l&&typeof l=="object")l=l[c];else return;return l}handleAiConvert(e,t,n){let a=window.__openAiEditor;if(typeof a=="function"){let s=`A single, high-quality, high-detail game UI icon/asset representing "${String(n||e.replace(/_/g," ").replace("json.",""))}". Modern stylized 3D rendered style, vibrant colors, soft lighting, isolated on solid magenta background, highly polished professional game art.`,o="render.asset.path";console.log("[QuickActionsBar] AI Convert for:",e,"from:",t,"to:",o),a(e,s,"",{objectId:e,path:o});let l=window.__debugContext;if(l){l.activeTab="ai";let c=window.__updateWorkbenchTabs;typeof c=="function"&&c()}}else console.warn("[QuickActionsBar] AI Editor not available")}};function Io(i,e){let t;return function(...a){let r=()=>{clearTimeout(t),i(...a)};clearTimeout(t),t=setTimeout(r,e)}}var Tn=class{constructor(){this.root=null;this.contentContainer=null;this.selectedObjectId=null;this.options=null;this.showAdvanced=!1;this.rendererRegistry=new Cn,this.updateManager=new Qe,this.quickActions=new Ln,window.addEventListener("inspector:refresh",()=>{this.selectedObjectId&&this.loadObject(this.selectedObjectId)}),window.addEventListener("config:changed",()=>{})}render(){return`
|
|
372
|
+
`}formatLabel(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}};var Cn=class{constructor(){this.typeDetector=new mn,this.imageRenderer=new bn,this.colorRenderer=new yn,this.numberRenderer=new vn,this.textRenderer=new xn,this.booleanRenderer=new wn,this.arrayRenderer=new En,this.objectRenderer=new An(this),this.selectRenderer=new Sn}getObjectIds(){try{let e=window,t=e==null?void 0:e.__editableConfig;if(!(t!=null&&t.objects))return[];let n=[];if(t.objects instanceof Map)for(let a of t.objects.keys())n.push(a);else typeof t.objects=="object"&&n.push(...Object.keys(t.objects));return n.sort()}catch{return[]}}getEnumOptionsFromSchemas(e){var t;try{let n=window,a=n==null?void 0:n.__editableConfig,r=a==null?void 0:a.schemas;if(!r)return null;let s=String(e||"").split(".").filter(Boolean);if(s.length<2)return null;let o=s[0],l=s.slice(1).join("."),c=r instanceof Map?r.get(o):r==null?void 0:r[o];if(!c)return null;let p=(t=c==null?void 0:c.types)==null?void 0:t[l];if(typeof p!="string"||!p.startsWith("enum:"))return null;let u=p.slice(5).split("|").map(g=>g.trim()).filter(Boolean);return u.length?u:null}catch{return null}}getLogicOptions(){try{let e=window,t=Array.isArray(e==null?void 0:e.__HANDLER_LOGIC_OPTIONS)?e.__HANDLER_LOGIC_OPTIONS:[],a=[...["DragToWin","SwerveMove","DragSnap","JoystickMove"],...t].map(r=>String(r)).filter(r=>r.trim().length>0);return Array.from(new Set(a)).sort((r,s)=>r.localeCompare(s))}catch{return[]}}renderProperty(e,t,n,a){let r=t.toLowerCase(),s=r==="logic"||r==="logic_id"||r==="logicid",o=r==="id"&&a.toLowerCase().includes("logic");if((s||o)&&typeof n=="string"){let u=this.getLogicOptions();return this.selectRenderer.render(e,t,n,a,u)}let c={zone:["bottom-left","bottom-center","bottom-right","top-left","top-center","top-right"],directionMode:["dominantAxis","free"],axis:["both","x","y"],ease:["power2.out","linear","sine.inOut","back.out(1.8)"],direction:["any","horizontal","vertical"],particleEffect:["","sparkle","gem","fire","heart","stars","smoke","magic","coin"],collectSound:["","click_4.wav","click_6.wav","success_4.wav"]}[t];if(c&&a.includes("logic.props"))return this.selectRenderer.render(e,t,n,a,c);if((t==="targetId"||t==="inputId")&&typeof n=="string"){let u=this.getObjectIds();return this.selectRenderer.render(e,t,n,a,["",...u])}let p=this.getEnumOptionsFromSchemas(a);if(p)return this.selectRenderer.render(e,t,n,a,p);switch(this.typeDetector.detectType(t,n)){case"image":return this.imageRenderer.render(e,t,n,a);case"color":return this.colorRenderer.render(e,t,n,a);case"number":return this.numberRenderer.render(e,t,n,a);case"boolean":return this.booleanRenderer.render(e,t,n,a);case"array":return this.arrayRenderer.render(e,t,n,a);case"object":return this.objectRenderer.render(e,t,n,a);case"select":return this.selectRenderer.render(e,t,n,a,[]);default:return this.textRenderer.render(e,t,n,a)}}getTypeDetector(){return this.typeDetector}};K();var Qe=class{async updateProperty(e,t,n,a={}){var l,c,p;console.log("[PropertyUpdateManager] Updating:",e,t,n);let r=window.getEditableObjectConfig;if(typeof r!="function"){console.error("[PropertyUpdateManager] getEditableObjectConfig not available");return}let s=r(e);if(!s){console.error("[PropertyUpdateManager] Config not found for:",e);return}Se({objectId:e,path:t,value:n},{persist:!0});let o=window.applyEditableObjectConfig;if(typeof o=="function"){let d=window.__editableConfig,u=(p=(c=(l=d==null?void 0:d.objects)==null?void 0:l.get)==null?void 0:c.call(l,e))!=null?p:s;await o(e,u),console.log("[PropertyUpdateManager] Applied config successfully")}else console.warn("[PropertyUpdateManager] applyEditableObjectConfig not available");this.triggerRefresh(e),a.refreshInspector&&window.dispatchEvent(new CustomEvent("inspector:refresh"))}getNestedProperty(e,t){let n=t.split("."),a=e;for(let r of n)if(a&&typeof a=="object"&&r in a)a=a[r];else return;return a}triggerRefresh(e){let t=window.__refreshHierarchy;typeof t=="function"&&t(),window.dispatchEvent(new CustomEvent("inspector:property-updated",{detail:{objectId:e}}))}};var Ln=class{constructor(){this.updateManager=new Qe}async handleAction(e,t,n){console.log("[QuickActionsBar] Action:",e,t,n);let a=window.getEditableObjectConfig;if(typeof a!="function")return;let r=a(t);if(!r)return;let s=this.updateManager.getNestedProperty(r,n);if(e==="ai-convert"||e==="upload"||e==="library"){let o=n==="ui.text"||n==="render.asset.path",l=n==="render.asset.path";o&&(await this.prepareForImageConversion(t,r),e==="ai-convert"&&n!=="render.asset.path"&&(n="render.asset.path"))}switch(e){case"library":this.openLibrary(t,n,s);break;case"ai-edit":this.openAIEditor(t,n,s);break;case"upload":this.openUpload(t,n);break;case"reset":await this.resetToDefault(t,n);break;case"ai-convert":this.handleAiConvert(t,n,s);break;default:console.warn("[QuickActionsBar] Unknown action:",e)}}async prepareForImageConversion(e,t){var n,a;if(console.log("[QuickActionsBar] Preparing for image conversion:",e),t.render||(t.render={alpha:1,visible:!0}),(t.render.alpha===0||t.render.alpha===void 0)&&(t.render.alpha=1,await this.updateManager.updateProperty(e,"render.alpha",1)),(t.render.visible===!1||t.render.visible===void 0)&&(t.render.visible=!0,await this.updateManager.updateProperty(e,"render.visible",!0)),t.render.asset||(t.render.asset={type:"image",path:""}),t.render.asset.type!=="image"&&(t.render.asset.type="image",await this.updateManager.updateProperty(e,"render.asset",{type:"image",path:t.render.asset.path||""})),t.ui&&t.ui.renderMode!=="png"){await this.updateManager.updateProperty(e,"ui.renderMode","png",{refreshInspector:!0}),await this.updateManager.updateProperty(e,"render.tint","#ffffff");let s=((a=(n=t.transform)==null?void 0:n.scale)!=null?a:1)*.3;await this.updateManager.updateProperty(e,"transform.scale",s),console.log("[QuickActionsBar] Text to PNG conversion: set tint white, scale",s)}this.ensureSlotInRegistry(e,t)}ensureSlotInRegistry(e,t){var o,l,c;let n=window.getEditableAssets;if(typeof n!="function")return;let a=n();if(!a||!a.slots)return;let r=e.startsWith("json.")?e.replace("json.",""):e;if(!a.slots.some(p=>p.objectId===r||p.slotId===r)){let p=((o=t.identity)==null?void 0:o.category)||"ui";console.log("[QuickActionsBar] Adding new slot to registry for converted object:",r),a.slots.push({slotId:r,displayName:r.replace(/_/g," "),objectId:r,category:p,currentAsset:((c=(l=t.render)==null?void 0:l.asset)==null?void 0:c.path)||"",defaultAsset:"",libraryFolder:p,assetType:"image"}),a.categories&&!a.categories.includes(p)&&a.categories.push(p),a.libraryAssets&&!a.libraryAssets[p]&&(a.libraryAssets[p]=[]);let d=window.reRenderAssetLibrary;typeof d=="function"&&d()}}openLibrary(e,t,n){var r;let a=window.__debugContext;if(a){if(a.activeTab!=="library"){a.activeTab="library";let s=window.__updateWorkbenchTabs;typeof s=="function"&&s()}if(a.libraryPanel){let s=window.getEditableObjectConfig,o=s==null?void 0:s(e),l=(r=o==null?void 0:o.identity)==null?void 0:r.category;l||(l=t.split(".")[0]==="render"?"environment":"ui"),console.log("[QuickActionsBar] Highlighting library slot:",e,"category:",l),a.libraryPanel.highlightSlot(e,l)}}}openAIEditor(e,t,n){let a=window.__openAiEditor;if(typeof a=="function"){let r=t.split(".").pop()||t;a(r,`Edit ${r} for ${e}`,n,{objectId:e,path:t})}else console.warn("[QuickActionsBar] AI Editor not available")}openUpload(e,t){let n=document.createElement("input");n.type="file",n.accept="image/*",n.onchange=async a=>{var o;let r=(o=a.target.files)==null?void 0:o[0];if(!r)return;console.log("[QuickActionsBar] Preparing upload for:",r.name);let s=new FileReader;s.onload=async()=>{var c,p,d;let l=s.result;try{let u=window.getEditableObjectConfig,g=u==null?void 0:u(e),h=((c=g==null?void 0:g.identity)==null?void 0:c.category)||(t.split(".")[0]==="render"?"environment":"ui"),m=`${e.replace(/^json\./,"").replace(/[^a-zA-Z0-9_-]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"")}_uploaded`;console.log("[QuickActionsBar] Saving uploaded file:",m,"to category:",h);let y=await(await fetch("/api/library/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({category:h,filename:`${m}.png`,data:l,overwrite:!0})})).json();if(y.success){console.log("[QuickActionsBar] \u2705 Uploaded and saved:",y.path);let v=window.addAssetToRegistry;typeof v=="function"&&v(h,`${m}.png`);try{await fetch("/api/setup-library",{method:"POST",headers:{"Content-Type":"application/json"}}),console.log("[QuickActionsBar] \u2705 Library setup completed")}catch(C){console.warn("[QuickActionsBar] Setup-library not available:",C)}let x=window.refreshAssetLibrary;typeof x=="function"&&await x(),await this.updateManager.updateProperty(e,t,y.path);let w=window.__debugContext;(d=(p=w==null?void 0:w.options)==null?void 0:p.onPropertyChange)==null||d.call(p,e,t,y.path);let E=window.__highlightLibrarySlot;typeof E=="function"&&setTimeout(()=>{E(e,h)},500),window.dispatchEvent(new CustomEvent("inspector:refresh")),console.log("[QuickActionsBar] \u2705 Upload complete and applied")}else console.error("[QuickActionsBar] \u274C Upload failed:",y.error),alert(`Upload failed: ${y.error}`)}catch(u){console.error("[QuickActionsBar] \u274C Upload error:",u),alert("Upload failed. Check console.")}},s.readAsDataURL(r)},n.click()}async resetToDefault(e,t){console.log("[QuickActionsBar] Reset to default:",e,t);try{let n=await this.getDefaultValue(e,t);n!==void 0?(await this.updateManager.updateProperty(e,t,n),console.log("[QuickActionsBar] Reset to default value:",n)):alert("No default value found for this property.")}catch(n){console.error("[QuickActionsBar] Failed to reset to default:",n),alert("Failed to reset property. Check console for details.")}}async getDefaultValue(e,t){let n=t.split(".");if(n.length<2)return;let a=n[0],r=n.slice(1),s=window.__editableConfig;if(!(s!=null&&s.schemas))return;let o=null;if(s.schemas instanceof Map?o=s.schemas.get(a):typeof s.schemas=="object"&&(o=s.schemas[a]),!(o!=null&&o.defaults))return;let l=o.defaults;for(let c of r)if(l&&typeof l=="object")l=l[c];else return;return l}handleAiConvert(e,t,n){let a=window.__openAiEditor;if(typeof a=="function"){let s=`A single, high-quality, high-detail game UI icon/asset representing "${String(n||e.replace(/_/g," ").replace("json.",""))}". Modern stylized 3D rendered style, vibrant colors, soft lighting, isolated on solid magenta background, highly polished professional game art.`,o="render.asset.path";console.log("[QuickActionsBar] AI Convert for:",e,"from:",t,"to:",o),a(e,s,"",{objectId:e,path:o});let l=window.__debugContext;if(l){l.activeTab="ai";let c=window.__updateWorkbenchTabs;typeof c=="function"&&c()}}else console.warn("[QuickActionsBar] AI Editor not available")}};function Io(i,e){let t;return function(...a){let r=()=>{clearTimeout(t),i(...a)};clearTimeout(t),t=setTimeout(r,e)}}var Tn=class{constructor(){this.root=null;this.contentContainer=null;this.selectedObjectId=null;this.options=null;this.showAdvanced=!1;this.rendererRegistry=new Cn,this.updateManager=new Qe,this.quickActions=new Ln,window.addEventListener("inspector:refresh",()=>{this.selectedObjectId&&this.loadObject(this.selectedObjectId)}),window.addEventListener("config:changed",()=>{})}render(){return`
|
|
373
373
|
<div class="scene-panel inspector-panel panel-accent-violet" data-panel="inspector" style="right:16px; top:72px;">
|
|
374
374
|
<div class="scene-panel-header" data-panel-handle>
|
|
375
375
|
<div class="panel-title">
|
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-
|
|
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-2YFOCUIT.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-JXBG6UFL.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};
|
package/dist/pixi/index.cjs
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
<button class="debug-btn primary" data-modal-apply>Apply</button>
|
|
44
44
|
</div>
|
|
45
45
|
</div>
|
|
46
|
-
`,this.modal=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(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 i=this.modal.querySelector("[data-ai-generate]");i==null||i.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let r=this.modal.querySelector("[data-modal-apply]");r==null||r.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",s=>{s.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let t=window.__openAiEditor;if(typeof t!="function"){alert("AI Editor not available. Please check your setup.");return}let i="";e==="edit"&&this.currentAsset?i=`Edit this image: ${this.currentObjectId}`:i=`Create an image for: ${this.currentObjectId}`,t(this.currentObjectId||"unknown",i,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var Nr={};Wn(Nr,{AssetCache:()=>Q,AssetLoader:()=>fe,AssetSystem:()=>It,AssetTextures:()=>he,Assets:()=>pa,BaseSystem:()=>Ne,GameEngine:()=>Ot,GameObject:()=>ot,GameObjectManager:()=>$e,ObjectFactory:()=>me,Renderer:()=>st,RuntimeObjectRegistry:()=>He,Transform:()=>rt,applyScreenAnchor:()=>Dt,basePixi:()=>oa,clearResponsiveElements:()=>ga,createPixiBase:()=>kt,getRegisteredFontIds:()=>ia,globalResponsiveMultipliers:()=>ct,initAssetTextures:()=>At,initAssets:()=>ua,layout:()=>ha,playLottieOverlay:()=>ra,registerFont:()=>na,registerType:()=>wt,resolveAnchorVec2:()=>Ce,resolveFont:()=>ea,resolveFontWeight:()=>ta,resolveScreenAnchorPoint:()=>Be,resolveScreenRatioPoint:()=>Fe,runInitSequence:()=>ma,setLottieInstance:()=>St,spawnSceneFromConfig:()=>ca,updateScreenState:()=>Rt});module.exports=Ea(Nr);var Qi=require("pixi.js");var pe={};function mt(n,e,t=!1){pe[n]||(pe[n]=[]),pe[n].push({fn:e,once:t})}function Gt(n,e){if(pe[n]){if(!e){delete pe[n];return}pe[n]=pe[n].filter(t=>t.fn!==e)}}function bt(n,...e){let t=pe[n];if(t)for(let i of[...t])i.fn(...e),i.once&&Gt(n,i.fn)}function q(n,e){mt(n,e,!0)}var D=null,Y=[],Le=null;function Jn(n){D=n,Y=[],Le!==null&&(clearTimeout(Le),Le=null)}function Zn(){var n,e,t;return{endpoint:(D==null?void 0:D.endpoint)||"",transport:(D==null?void 0:D.transport)||"beacon",batchSize:(n=D==null?void 0:D.batchSize)!=null?n:10,flushIntervalMs:(e=D==null?void 0:D.flushIntervalMs)!=null?e:300,maxQueue:(t=D==null?void 0:D.maxQueue)!=null?t:200,debug:!!(D!=null&&D.debug)}}async function Kn(n,e,t,i){let a=JSON.stringify(e);if(t==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let r=navigator.sendBeacon(n,new Blob([a],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",r,e);return}catch(r){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",r)}try{await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(r){i&&console.warn("[handler.telemetry] fetch failed",r)}}function qt(n,e){let t=Zn();if(e&&t.endpoint){if(Y.push(n),Y.length>t.maxQueue&&(Y=Y.slice(Y.length-t.maxQueue)),Y.length>=t.batchSize){Xn();return}Le===null&&(Le=window.setTimeout(()=>{Le=null,Xn()},t.flushIntervalMs))}}async function Xn(){let n=Zn();if(!n.endpoint||Y.length===0)return;let e=Y.splice(0,n.batchSize);await Kn(n.endpoint,{events:e},n.transport,n.debug),Y.length>0&&await Kn(n.endpoint,{events:Y.splice(0,n.batchSize)},n.transport,n.debug)}function Qn(n){return Math.max(0,Math.min(1,n))}function Aa(n){let e=String(n!=null?n:"power2.out");if(e==="linear")return t=>t;if(e==="sine.inOut")return t=>.5-Math.cos(Math.PI*t)/2;if(e==="power2.out"||e==="easeOutQuad")return t=>1-(1-t)*(1-t);if(e.startsWith("back.out")){let t=e.match(/back\.out\(([\d.]+)\)/),i=t?Number(t[1]):1.8;return a=>1+(i+1)*Math.pow(a-1,3)+i*Math.pow(a-1,2)}return t=>1-(1-t)*(1-t)}function Ke(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Sa(n,e){let t=n==null?void 0:n[e];return typeof t=="number"?t:0}function ei(n,e,t){try{n[e]=t}catch{}}function Ca(n){let e=n==null?void 0:n.scale;if(!e)return null;let t=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:t,y:i}}function ti(n,e){let t=n==null?void 0:n.scale;if(t)try{typeof t.set=="function"?t.set(e.x,e.y):(typeof t.x=="number"&&(t.x=e.x),typeof t.y=="number"&&(t.y=e.y))}catch{}}function ni(n,e){let t=Ca(n);if(!t)return{from:null,to:null};let i=null,a=null;return typeof e.scale=="number"?(i=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),i===null&&a===null?{from:null,to:null}:{from:{x:t.x,y:t.y},to:{x:i!=null?i:t.x,y:a!=null?a:t.y}}}function ii(){let n=new Set,e=new WeakMap,t=null,i=()=>{if(t!=null)return;t=requestAnimationFrame(()=>{t=null,o(),n.size>0&&i()})},a=u=>{var p;n.add(u);let l=(p=e.get(u.target))!=null?p:new Set;l.add(u),e.set(u.target,l),i()},r=u=>{n.delete(u);let l=e.get(u.target);l&&(l.delete(u),l.size===0&&e.delete(u.target))},s=u=>{u.killed||(u.killed=!0,r(u))},o=()=>{var l,p;let u=Ke();for(let g of Array.from(n)){if(g.killed||g.paused)continue;let m=u-g.startMs-g.delayMs;if(m<0)continue;let h=g.durationMs>0?m/g.durationMs:1,A=Qn(h),b=g.repeat>=0?g.repeat+1:1,f=g.repeat>0?Math.min(Math.floor(h),b-1):0;if(g.repeat>0&&h>=1){let y=h-f;A=Qn(y)}let x=g.ease(A);g.yoyo&&f%2===1&&(x=1-x);for(let y of g.props)ei(g.target,y.key,y.from+(y.to-y.from)*x);g.scaleFrom&&g.scaleTo&&ti(g.target,{x:g.scaleFrom.x+(g.scaleTo.x-g.scaleFrom.x)*x,y:g.scaleFrom.y+(g.scaleTo.y-g.scaleFrom.y)*x});try{(l=g.onUpdate)==null||l.call(g)}catch{}if(h>=b){s(g);try{(p=g.onComplete)==null||p.call(g)}catch{}}}},d=(u,l,p)=>{var y;let g=Math.max(0,(typeof l.duration=="number"?l.duration:.5)*1e3),m=Math.max(0,(typeof l.delay=="number"?l.delay:0)*1e3+((y=p==null?void 0:p.delayMsOverride)!=null?y:0)),h=Aa(l.ease),A=typeof l.repeat=="number"?Math.max(0,l.repeat|0):0,b=l.yoyo===!0,f=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),x=[];for(let I of Object.keys(l)){if(f.has(I))continue;let R=l[I];typeof R=="number"&&x.push({key:I,from:Sa(u,I),to:R})}let w=ni(u,l);return{target:u,startMs:Ke(),delayMs:m,durationMs:g,ease:h,props:x,scaleFrom:w.from,scaleTo:w.to,repeat:A,yoyo:b,onUpdate:typeof l.onUpdate=="function"?l.onUpdate:void 0,onComplete:typeof l.onComplete=="function"?l.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},c={to(u,l){let p=d(u,l);return a(p),{kill:()=>s(p),pause:()=>{p.paused||(p.paused=!0,p.pauseAtMs=Ke())},resume:()=>{var h;if(!p.paused)return;let g=(h=p.pauseAtMs)!=null?h:Ke(),m=Ke()-g;p.startMs+=m,p.paused=!1,p.pauseAtMs=null},isActive:()=>!p.killed&&!p.paused}},fromTo(u,l,p){return c.set(u,l),c.to(u,p)},set(u,l){if(!u||!l)return;for(let g of Object.keys(l)){let m=l[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof m=="number"&&ei(u,g,m)}let p=ni(u,l);p.to&&ti(u,p.to)},killTweensOf(u){let l=e.get(u);if(l)for(let p of Array.from(l))s(p)},timeline(u={}){let l=[],p=0,g=!1,m=[],h=f=>{if(typeof f=="number")return Math.max(0,f*1e3);let x=typeof f=="string"?f.trim():"";return x.startsWith("+=")?p+Math.max(0,Number(x.slice(2))*1e3||0):x?Math.max(0,Number(x)*1e3||0):p},A=f=>{l.push(f);let x=Math.max(0,(typeof f.vars.duration=="number"?f.vars.duration:.5)*1e3);p=Math.max(p,f.atMs+x)},b={to(f,x,w){return A({kind:"to",target:f,vars:x,atMs:h(w)}),b},fromTo(f,x,w,y){return A({kind:"fromTo",target:f,vars:w,from:x,atMs:h(y)}),b},play(){var f,x;if(g)return b;g=!0,m=[];for(let w of l)w.kind==="fromTo"&&c.set(w.target,(f=w.from)!=null?f:{}),m.push(c.to(w.target,{...w.vars,delay:w.atMs/1e3+((x=w.vars.delay)!=null?x:0)}));return b},pause(){for(let f of m)f.pause();return b},kill(){for(let f of m)f.kill();m=[],g=!1}};return u.paused||b.play(),b}};return c}function ai(){if(typeof window=="undefined")return;let n=window;if(!n.gsap)try{n.gsap=ii()}catch{}}var ri={name:"handler-playable-sdk",version:"0.3.59",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && chmod +x dist/cli/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var V=0,Ta=V++,si=V++,oi=V++,li=V++,ci=V++,di=V++,pi=V++,ui=V++,gi=V++,fi=V++,hi=V++,mi=V++,M=Ta;function bi(){return M===si}function yi(){return M===oi}function vi(){return M===li}function xi(){return M===ci}function Te(){return M===di}function _e(){return M===pi}function wi(){return M===ui}function Ei(){return M===gi}function Ai(){return M===fi}function Vt(){return M===hi}function Wt(){return M===mi}function Si(){let n=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(n==="mraid")try{mraid.getState(),M=si;return}catch{}else if(n==="dapi")try{dapi.isReady(),M=oi;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(M=li)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(M=ci)}catch{}else if(e==="mintegral")window.gameReady&&(M=di);else if(e==="tapjoy")window.TJ_API&&(M=pi);else if(e==="tiktok")window.openAppStore&&(M=ui);else if(e==="smadex")try{window.smxTracking&&(M=gi)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(M=fi)}catch{}else e==="vungle"?M=hi:(n==="nucleo"||e==="nucleo")&&(M=mi)}var yt=ht(require("lottie-web"),1),Ci=yt.default;typeof window!="undefined"&&(window.lottie=yt.default,window.__baseLottie=yt.default);Xt();function $(n,e){let t=(a,r)=>r===0?a:t(r,a%r),i=t(n,e);return`${n/i}:${e/i}`}var ys=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:$(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:$(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:$(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:$(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:$(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:$(360,780)}],vs=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:$(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:$(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:$(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:$(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:$(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:$(412,915)}],xs=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:$(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:$(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:$(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:$(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:$(800,1280)}],Pi=[{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:$(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:$(768,1024),mraidScale:.7}];var ws=[...Pi];var Ra=Pi[0];ue();var Ba=ht(require("jszip"),1);function za(n){return new Promise((e,t)=>{let i=new FileReader;i.onerror=()=>t(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(n)})}function Na(n){var a;let[e,t]=n.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:t!=null?t:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}async function Ha(n){return await new Promise(e=>{let t=new Image;t.onload=()=>e({width:t.naturalWidth||t.width,height:t.naturalHeight||t.height}),t.onerror=()=>e(null),t.src=n})}async function Jt(n){var e,t;try{console.log("[ImageUtils] Fetching image data from URL:",n);let i=await fetch(n);if(!i.ok)return console.warn("[ImageUtils] Fetch failed with status:",i.status,n),null;let a=await i.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let r=await za(a),s=await Ha(r),o=Na(r);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:r,width:(e=s==null?void 0:s.width)!=null?e:0,height:(t=s==null?void 0:s.height)!=null?t:0}}catch(i){return console.error("[ImageUtils] Error fetching image data:",i),null}}async function vt(n,e=30){try{console.log("[ImageUtils] Removing background color...");let t=await new Promise((l,p)=>{let g=new Image;g.onload=()=>l(g),g.onerror=()=>p(new Error("Failed to load image")),g.src=n}),i=document.createElement("canvas");i.width=t.width,i.height=t.height;let a=i.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),n;a.drawImage(t,0,0);let r=a.getImageData(0,0,i.width,i.height),s=r.data,d=[{name:"top-left",offset:0},{name:"top-right",offset:(i.width-1)*4},{name:"bottom-left",offset:(i.height-1)*i.width*4},{name:"bottom-right",offset:((i.height-1)*i.width+(i.width-1))*4}].map(l=>({r:s[l.offset],g:s[l.offset+1],b:s[l.offset+2]})),c=0;for(let l=0;l<s.length;l+=4){let p=s[l],g=s[l+1],m=s[l+2],h=!1;for(let A of d)if(Math.sqrt(Math.pow(p-A.r,2)+Math.pow(g-A.g,2)+Math.pow(m-A.b,2))<e){h=!0;break}h&&(s[l+3]=0,c++)}return console.log(`[ImageUtils] Removed background from ${c} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(r,0,0),i.toDataURL("image/png")}catch(t){return console.error("[ImageUtils] Error removing background:",t),n}}var ki=require("@google/genai");async function Zt(n,e,t=[],i={}){var a,r,s,o,d,c,u;try{if(!(n!=null&&n.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let b=0;b<t.length;b++){let f=t[b];if(!f.base64||!f.mimeType)throw new Error(`Image ${b+1} is missing required data`);if(f.base64.length<1e3&&console.warn(`Image ${b+1} data appears very small, may be corrupted`),!f.mimeType.startsWith("image/"))throw new Error(`Image ${b+1} has invalid MIME type: ${f.mimeType}`)}let l=new ki.GoogleGenAI({apiKey:n}),p="gemini-2.5-flash",g=[e];t.length>0&&t.forEach((b,f)=>{g.push({inlineData:{data:b.base64,mimeType:b.mimeType}}),console.log(`[Gemini] Added image ${f+1}: ${b.mimeType}, size: ${Math.round(b.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${t.length} images and prompt length: ${e.length}`);let m=await l.models.generateContent({model:p,contents:g}),h="",A=(s=(r=(a=m.candidates)==null?void 0:a[0])==null?void 0:r.content)==null?void 0:s.parts;if(A)for(let b of A)b.text&&(h+=b.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(l){throw console.error("[Gemini] API error:",l),(o=l.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=l.message)!=null&&d.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(c=l.message)!=null&&c.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(u=l.message)!=null&&u.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):l}}var Mi=require("@google/genai");async function xt(n,e,t=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Mi.GoogleGenAI({apiKey:n}),r=[{text:e}];t.length>0&&t.forEach((o,d)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${d}`),r.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 a.models.generateContent({model:"gemini-2.5-flash-image",contents:r});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,c=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${c};base64,${d}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(a){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(a,Object.getOwnPropertyNames(a),2)),a}}var Wa=require("pixi.js");Xe();ue();var $i=require("pixi.js");var Ya=require("pixi.js");ue();function tr(n){return new Promise((e,t)=>{let i=new FileReader;i.onerror=()=>t(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(n)})}function nr(n){var a;let[e,t]=n.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:t!=null?t:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}function ir(n){return`
|
|
46
|
+
`,this.modal=i}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 i=this.modal.querySelector("[data-ai-generate]");i==null||i.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let r=this.modal.querySelector("[data-modal-apply]");r==null||r.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",s=>{s.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let t=window.__openAiEditor;if(typeof t!="function"){alert("AI Editor not available. Please check your setup.");return}let i="";e==="edit"&&this.currentAsset?i=`Edit this image: ${this.currentObjectId}`:i=`Create an image for: ${this.currentObjectId}`,t(this.currentObjectId||"unknown",i,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var Nr={};Wn(Nr,{AssetCache:()=>Q,AssetLoader:()=>fe,AssetSystem:()=>It,AssetTextures:()=>he,Assets:()=>pa,BaseSystem:()=>Ne,GameEngine:()=>Ot,GameObject:()=>ot,GameObjectManager:()=>$e,ObjectFactory:()=>me,Renderer:()=>st,RuntimeObjectRegistry:()=>He,Transform:()=>rt,applyScreenAnchor:()=>Dt,basePixi:()=>oa,clearResponsiveElements:()=>ga,createPixiBase:()=>kt,getRegisteredFontIds:()=>ia,globalResponsiveMultipliers:()=>ct,initAssetTextures:()=>At,initAssets:()=>ua,layout:()=>ha,playLottieOverlay:()=>ra,registerFont:()=>na,registerType:()=>wt,resolveAnchorVec2:()=>Ce,resolveFont:()=>ea,resolveFontWeight:()=>ta,resolveScreenAnchorPoint:()=>Be,resolveScreenRatioPoint:()=>Fe,runInitSequence:()=>ma,setLottieInstance:()=>St,spawnSceneFromConfig:()=>ca,updateScreenState:()=>Rt});module.exports=Ea(Nr);var Qi=require("pixi.js");var pe={};function mt(n,e,t=!1){pe[n]||(pe[n]=[]),pe[n].push({fn:e,once:t})}function Gt(n,e){if(pe[n]){if(!e){delete pe[n];return}pe[n]=pe[n].filter(t=>t.fn!==e)}}function bt(n,...e){let t=pe[n];if(t)for(let i of[...t])i.fn(...e),i.once&&Gt(n,i.fn)}function q(n,e){mt(n,e,!0)}var D=null,Y=[],Le=null;function Jn(n){D=n,Y=[],Le!==null&&(clearTimeout(Le),Le=null)}function Zn(){var n,e,t;return{endpoint:(D==null?void 0:D.endpoint)||"",transport:(D==null?void 0:D.transport)||"beacon",batchSize:(n=D==null?void 0:D.batchSize)!=null?n:10,flushIntervalMs:(e=D==null?void 0:D.flushIntervalMs)!=null?e:300,maxQueue:(t=D==null?void 0:D.maxQueue)!=null?t:200,debug:!!(D!=null&&D.debug)}}async function Kn(n,e,t,i){let a=JSON.stringify(e);if(t==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let r=navigator.sendBeacon(n,new Blob([a],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",r,e);return}catch(r){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",r)}try{await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(r){i&&console.warn("[handler.telemetry] fetch failed",r)}}function qt(n,e){let t=Zn();if(e&&t.endpoint){if(Y.push(n),Y.length>t.maxQueue&&(Y=Y.slice(Y.length-t.maxQueue)),Y.length>=t.batchSize){Xn();return}Le===null&&(Le=window.setTimeout(()=>{Le=null,Xn()},t.flushIntervalMs))}}async function Xn(){let n=Zn();if(!n.endpoint||Y.length===0)return;let e=Y.splice(0,n.batchSize);await Kn(n.endpoint,{events:e},n.transport,n.debug),Y.length>0&&await Kn(n.endpoint,{events:Y.splice(0,n.batchSize)},n.transport,n.debug)}function Qn(n){return Math.max(0,Math.min(1,n))}function Aa(n){let e=String(n!=null?n:"power2.out");if(e==="linear")return t=>t;if(e==="sine.inOut")return t=>.5-Math.cos(Math.PI*t)/2;if(e==="power2.out"||e==="easeOutQuad")return t=>1-(1-t)*(1-t);if(e.startsWith("back.out")){let t=e.match(/back\.out\(([\d.]+)\)/),i=t?Number(t[1]):1.8;return a=>1+(i+1)*Math.pow(a-1,3)+i*Math.pow(a-1,2)}return t=>1-(1-t)*(1-t)}function Ke(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Sa(n,e){let t=n==null?void 0:n[e];return typeof t=="number"?t:0}function ei(n,e,t){try{n[e]=t}catch{}}function Ca(n){let e=n==null?void 0:n.scale;if(!e)return null;let t=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:t,y:i}}function ti(n,e){let t=n==null?void 0:n.scale;if(t)try{typeof t.set=="function"?t.set(e.x,e.y):(typeof t.x=="number"&&(t.x=e.x),typeof t.y=="number"&&(t.y=e.y))}catch{}}function ni(n,e){let t=Ca(n);if(!t)return{from:null,to:null};let i=null,a=null;return typeof e.scale=="number"?(i=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),i===null&&a===null?{from:null,to:null}:{from:{x:t.x,y:t.y},to:{x:i!=null?i:t.x,y:a!=null?a:t.y}}}function ii(){let n=new Set,e=new WeakMap,t=null,i=()=>{if(t!=null)return;t=requestAnimationFrame(()=>{t=null,o(),n.size>0&&i()})},a=u=>{var p;n.add(u);let l=(p=e.get(u.target))!=null?p:new Set;l.add(u),e.set(u.target,l),i()},r=u=>{n.delete(u);let l=e.get(u.target);l&&(l.delete(u),l.size===0&&e.delete(u.target))},s=u=>{u.killed||(u.killed=!0,r(u))},o=()=>{var l,p;let u=Ke();for(let g of Array.from(n)){if(g.killed||g.paused)continue;let m=u-g.startMs-g.delayMs;if(m<0)continue;let h=g.durationMs>0?m/g.durationMs:1,A=Qn(h),b=g.repeat>=0?g.repeat+1:1,f=g.repeat>0?Math.min(Math.floor(h),b-1):0;if(g.repeat>0&&h>=1){let y=h-f;A=Qn(y)}let x=g.ease(A);g.yoyo&&f%2===1&&(x=1-x);for(let y of g.props)ei(g.target,y.key,y.from+(y.to-y.from)*x);g.scaleFrom&&g.scaleTo&&ti(g.target,{x:g.scaleFrom.x+(g.scaleTo.x-g.scaleFrom.x)*x,y:g.scaleFrom.y+(g.scaleTo.y-g.scaleFrom.y)*x});try{(l=g.onUpdate)==null||l.call(g)}catch{}if(h>=b){s(g);try{(p=g.onComplete)==null||p.call(g)}catch{}}}},d=(u,l,p)=>{var y;let g=Math.max(0,(typeof l.duration=="number"?l.duration:.5)*1e3),m=Math.max(0,(typeof l.delay=="number"?l.delay:0)*1e3+((y=p==null?void 0:p.delayMsOverride)!=null?y:0)),h=Aa(l.ease),A=typeof l.repeat=="number"?Math.max(0,l.repeat|0):0,b=l.yoyo===!0,f=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),x=[];for(let I of Object.keys(l)){if(f.has(I))continue;let R=l[I];typeof R=="number"&&x.push({key:I,from:Sa(u,I),to:R})}let w=ni(u,l);return{target:u,startMs:Ke(),delayMs:m,durationMs:g,ease:h,props:x,scaleFrom:w.from,scaleTo:w.to,repeat:A,yoyo:b,onUpdate:typeof l.onUpdate=="function"?l.onUpdate:void 0,onComplete:typeof l.onComplete=="function"?l.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},c={to(u,l){let p=d(u,l);return a(p),{kill:()=>s(p),pause:()=>{p.paused||(p.paused=!0,p.pauseAtMs=Ke())},resume:()=>{var h;if(!p.paused)return;let g=(h=p.pauseAtMs)!=null?h:Ke(),m=Ke()-g;p.startMs+=m,p.paused=!1,p.pauseAtMs=null},isActive:()=>!p.killed&&!p.paused}},fromTo(u,l,p){return c.set(u,l),c.to(u,p)},set(u,l){if(!u||!l)return;for(let g of Object.keys(l)){let m=l[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof m=="number"&&ei(u,g,m)}let p=ni(u,l);p.to&&ti(u,p.to)},killTweensOf(u){let l=e.get(u);if(l)for(let p of Array.from(l))s(p)},timeline(u={}){let l=[],p=0,g=!1,m=[],h=f=>{if(typeof f=="number")return Math.max(0,f*1e3);let x=typeof f=="string"?f.trim():"";return x.startsWith("+=")?p+Math.max(0,Number(x.slice(2))*1e3||0):x?Math.max(0,Number(x)*1e3||0):p},A=f=>{l.push(f);let x=Math.max(0,(typeof f.vars.duration=="number"?f.vars.duration:.5)*1e3);p=Math.max(p,f.atMs+x)},b={to(f,x,w){return A({kind:"to",target:f,vars:x,atMs:h(w)}),b},fromTo(f,x,w,y){return A({kind:"fromTo",target:f,vars:w,from:x,atMs:h(y)}),b},play(){var f,x;if(g)return b;g=!0,m=[];for(let w of l)w.kind==="fromTo"&&c.set(w.target,(f=w.from)!=null?f:{}),m.push(c.to(w.target,{...w.vars,delay:w.atMs/1e3+((x=w.vars.delay)!=null?x:0)}));return b},pause(){for(let f of m)f.pause();return b},kill(){for(let f of m)f.kill();m=[],g=!1}};return u.paused||b.play(),b}};return c}function ai(){if(typeof window=="undefined")return;let n=window;if(!n.gsap)try{n.gsap=ii()}catch{}}var ri={name:"handler-playable-sdk",version:"0.3.61",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && chmod +x dist/cli/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var V=0,Ta=V++,si=V++,oi=V++,li=V++,ci=V++,di=V++,pi=V++,ui=V++,gi=V++,fi=V++,hi=V++,mi=V++,M=Ta;function bi(){return M===si}function yi(){return M===oi}function vi(){return M===li}function xi(){return M===ci}function Te(){return M===di}function _e(){return M===pi}function wi(){return M===ui}function Ei(){return M===gi}function Ai(){return M===fi}function Vt(){return M===hi}function Wt(){return M===mi}function Si(){let n=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(n==="mraid")try{mraid.getState(),M=si;return}catch{}else if(n==="dapi")try{dapi.isReady(),M=oi;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(M=li)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(M=ci)}catch{}else if(e==="mintegral")window.gameReady&&(M=di);else if(e==="tapjoy")window.TJ_API&&(M=pi);else if(e==="tiktok")window.openAppStore&&(M=ui);else if(e==="smadex")try{window.smxTracking&&(M=gi)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(M=fi)}catch{}else e==="vungle"?M=hi:(n==="nucleo"||e==="nucleo")&&(M=mi)}var yt=ht(require("lottie-web"),1),Ci=yt.default;typeof window!="undefined"&&(window.lottie=yt.default,window.__baseLottie=yt.default);Xt();function $(n,e){let t=(a,r)=>r===0?a:t(r,a%r),i=t(n,e);return`${n/i}:${e/i}`}var ys=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:$(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:$(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:$(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:$(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:$(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:$(360,780)}],vs=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:$(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:$(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:$(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:$(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:$(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:$(412,915)}],xs=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:$(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:$(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:$(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:$(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:$(800,1280)}],Pi=[{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:$(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:$(768,1024),mraidScale:.7}];var ws=[...Pi];var Ra=Pi[0];ue();var Ba=ht(require("jszip"),1);function za(n){return new Promise((e,t)=>{let i=new FileReader;i.onerror=()=>t(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(n)})}function Na(n){var a;let[e,t]=n.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:t!=null?t:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}async function Ha(n){return await new Promise(e=>{let t=new Image;t.onload=()=>e({width:t.naturalWidth||t.width,height:t.naturalHeight||t.height}),t.onerror=()=>e(null),t.src=n})}async function Jt(n){var e,t;try{console.log("[ImageUtils] Fetching image data from URL:",n);let i=await fetch(n);if(!i.ok)return console.warn("[ImageUtils] Fetch failed with status:",i.status,n),null;let a=await i.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let r=await za(a),s=await Ha(r),o=Na(r);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:r,width:(e=s==null?void 0:s.width)!=null?e:0,height:(t=s==null?void 0:s.height)!=null?t:0}}catch(i){return console.error("[ImageUtils] Error fetching image data:",i),null}}async function vt(n,e=30){try{console.log("[ImageUtils] Removing background color...");let t=await new Promise((l,p)=>{let g=new Image;g.onload=()=>l(g),g.onerror=()=>p(new Error("Failed to load image")),g.src=n}),i=document.createElement("canvas");i.width=t.width,i.height=t.height;let a=i.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),n;a.drawImage(t,0,0);let r=a.getImageData(0,0,i.width,i.height),s=r.data,d=[{name:"top-left",offset:0},{name:"top-right",offset:(i.width-1)*4},{name:"bottom-left",offset:(i.height-1)*i.width*4},{name:"bottom-right",offset:((i.height-1)*i.width+(i.width-1))*4}].map(l=>({r:s[l.offset],g:s[l.offset+1],b:s[l.offset+2]})),c=0;for(let l=0;l<s.length;l+=4){let p=s[l],g=s[l+1],m=s[l+2],h=!1;for(let A of d)if(Math.sqrt(Math.pow(p-A.r,2)+Math.pow(g-A.g,2)+Math.pow(m-A.b,2))<e){h=!0;break}h&&(s[l+3]=0,c++)}return console.log(`[ImageUtils] Removed background from ${c} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(r,0,0),i.toDataURL("image/png")}catch(t){return console.error("[ImageUtils] Error removing background:",t),n}}var ki=require("@google/genai");async function Zt(n,e,t=[],i={}){var a,r,s,o,d,c,u;try{if(!(n!=null&&n.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let b=0;b<t.length;b++){let f=t[b];if(!f.base64||!f.mimeType)throw new Error(`Image ${b+1} is missing required data`);if(f.base64.length<1e3&&console.warn(`Image ${b+1} data appears very small, may be corrupted`),!f.mimeType.startsWith("image/"))throw new Error(`Image ${b+1} has invalid MIME type: ${f.mimeType}`)}let l=new ki.GoogleGenAI({apiKey:n}),p="gemini-2.5-flash",g=[e];t.length>0&&t.forEach((b,f)=>{g.push({inlineData:{data:b.base64,mimeType:b.mimeType}}),console.log(`[Gemini] Added image ${f+1}: ${b.mimeType}, size: ${Math.round(b.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${t.length} images and prompt length: ${e.length}`);let m=await l.models.generateContent({model:p,contents:g}),h="",A=(s=(r=(a=m.candidates)==null?void 0:a[0])==null?void 0:r.content)==null?void 0:s.parts;if(A)for(let b of A)b.text&&(h+=b.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(l){throw console.error("[Gemini] API error:",l),(o=l.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=l.message)!=null&&d.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(c=l.message)!=null&&c.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(u=l.message)!=null&&u.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):l}}var Mi=require("@google/genai");async function xt(n,e,t=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Mi.GoogleGenAI({apiKey:n}),r=[{text:e}];t.length>0&&t.forEach((o,d)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${d}`),r.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 a.models.generateContent({model:"gemini-2.5-flash-image",contents:r});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,c=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${c};base64,${d}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(a){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(a,Object.getOwnPropertyNames(a),2)),a}}var Wa=require("pixi.js");Xe();ue();var $i=require("pixi.js");var Ya=require("pixi.js");ue();function tr(n){return new Promise((e,t)=>{let i=new FileReader;i.onerror=()=>t(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(n)})}function nr(n){var a;let[e,t]=n.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:t!=null?t:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}function ir(n){return`
|
|
47
47
|
Analyze these screenshots of a brand or game and extract its "Brand DNA".
|
|
48
48
|
|
|
49
49
|
Provide a concise summary (2-3 sentences) covering:
|
package/dist/pixi/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x28dd6c,_0x4ba32b){var a0_0x56819f={_0x1ea731:0x2a3,_0x1bcd81:'KIlz',_0x514ee7:0x29f,_0x412607:0x2a7,_0x15c7ba:'fVl^',_0x4c0c6d:0x293,_0x342a14:0x294,_0x599fee:0x265,_0x282425:0x26d,_0x538b97:'#XGD',_0x26c96c:0x278,_0x31ccbd:0x273,_0x4869ca:0x285,_0x2bd388:0x2a5,_0x4234a0:0x2ae,_0x295c61:0x2aa,_0x2609c3:0x29b,_0x76983b:0x313,_0x48d7da:0x308,_0x45e125:'r34v',_0x1af2ad:0x2ac,_0xd1a715:'0o@z',_0x981d33:0x2ad,_0x7abbb3:0x2b2,_0x51a11c:0x2a9,_0x161c69:0x317,_0x544081:0x31e,_0x15dce5:0x30f,_0x5f1acf:'Y&ie',_0xb86a9c:'72Yp',_0x38eed4:'Q%#S',_0x5e1db4:0x29b},a0_0x5f2761={_0x435e41:0x1c2};function _0x4ed930(_0x57eb94,_0x414679,_0x40248c,_0x50a87c,_0x571c6d){return a0_0x300a(_0x57eb94-a0_0x5f2761._0x435e41,_0x571c6d);}function _0x27a3c8(_0x30a1fa,_0x424240,_0x26bb94,_0x492317,_0xbff44a){return a0_0x300a(_0x424240- -0x3c3,_0x30a1fa);}var _0xe1db4f=_0x28dd6c();function _0xaed719(_0xda96cf,_0x4d86b6,_0x77d76,_0x497b0a,_0x2cb904){return a0_0x300a(_0xda96cf-0x14b,_0x4d86b6);}while(!![]){try{var _0x12c824=parseInt(_0xaed719(a0_0x56819f._0x1ea731,a0_0x56819f._0x1bcd81,a0_0x56819f._0x514ee7,a0_0x56819f._0x412607,a0_0x56819f._0x1ea731))/(-0x2164+-0x23d4+0x1713*0x3)+parseInt(_0xaed719(0x29f,a0_0x56819f._0x15c7ba,a0_0x56819f._0x4c0c6d,a0_0x56819f._0x342a14,0x296))/(0x4ea+0x995+0x1*-0xe7d)*(parseInt(_0x27a3c8('$Pa&',-0x26a,-a0_0x56819f._0x599fee,-a0_0x56819f._0x282425,-0x264))/(-0x2219+0x1363+0xeb9))+-parseInt(_0x27a3c8(a0_0x56819f._0x538b97,-a0_0x56819f._0x26c96c,-a0_0x56819f._0x31ccbd,-a0_0x56819f._0x4869ca,-0x26c))/(-0xb8a+-0x17e9+0x2377)+-parseInt(_0xaed719(a0_0x56819f._0x2bd388,a0_0x56819f._0x1bcd81,a0_0x56819f._0x4234a0,a0_0x56819f._0x295c61,a0_0x56819f._0x2609c3))/(-0xf*0x2d+0x16*0x12e+-0x174c)+parseInt(_0x4ed930(a0_0x56819f._0x76983b,0x309,a0_0x56819f._0x48d7da,0x30f,a0_0x56819f._0x45e125))/(-0x17c1+0x4b3+0x1314)+parseInt(_0xaed719(a0_0x56819f._0x1af2ad,a0_0x56819f._0xd1a715,a0_0x56819f._0x981d33,a0_0x56819f._0x7abbb3,a0_0x56819f._0x51a11c))/(-0x759+-0x3*-0x903+-0x13a9)*(-parseInt(_0x4ed930(a0_0x56819f._0x161c69,a0_0x56819f._0x544081,0x31d,a0_0x56819f._0x15dce5,a0_0x56819f._0x5f1acf))/(0x1781+0x16ff+-0x2*0x173c))+parseInt(_0xaed719(0x2a7,a0_0x56819f._0xb86a9c,0x2a1,a0_0x56819f._0x2bd388,a0_0x56819f._0x295c61))/(0x15d3+0x5*0x6a3+0x1253*-0x3)*(-parseInt(_0xaed719(0x29b,a0_0x56819f._0x38eed4,0x29c,a0_0x56819f._0x5e1db4,0x29e))/(-0x859+0x120e*-0x2+-0x2c7f*-0x1));if(_0x12c824===_0x4ba32b)break;else _0xe1db4f['push'](_0xe1db4f['shift']());}catch(_0x15c324){_0xe1db4f['push'](_0xe1db4f['shift']());}}}(a0_0x2486,0x11*0x6cd+-0x17df*-0xad+0x1*-0x459d5));var a0_0x5e6d28=(function(){var _0x3b6ccc=!![];return function(_0x41c802,_0x1a2124){var _0x476118=_0x3b6ccc?function(){if(_0x1a2124){var _0x38bae7=_0x1a2124['apply'](_0x41c802,arguments);return _0x1a2124=null,_0x38bae7;}}:function(){};return _0x3b6ccc=![],_0x476118;};}()),a0_0x80a6cf=a0_0x5e6d28(this,function(){var a0_0x4c3c56={_0x16d69d:0x34f,_0xa787e2:0x359,_0x90dae5:0x34c,_0x2d28fe:0x34c,_0x160df6:0x1b7,_0x13fb8d:0x1af,_0x157140:'*hCv',_0x4ddfee:0x1b3,_0x23d38e:0x15a,_0x433366:'%e&)',_0x3432e7:0x165,_0x130f9d:0x154,_0x5536d4:0x152,_0xd34688:0x155,_0x41940b:0x1a5,_0x858607:0x1b5,_0x79082:'V3oG',_0x522e4d:0x1a5,_0x511eb0:0x1b4,_0x11ddad:0x1ad,_0x38d7b4:'ZE##',_0x17c81f:0x1aa,_0x5116d0:0x1a5,_0x2ae8dd:0x1a7,_0x27262f:0x1b0,_0x1383e9:'sHYV',_0x35b995:0x1a3,_0x1371be:0x340,_0x2a831b:0x340,_0x3fa0e1:0x345,_0x594b28:0x352,_0x5ade31:'ygtT'},a0_0x1ba153={_0xd1ac4e:0x1ea},a0_0x175800={_0x11e067:0x57},a0_0x398ef7={_0x37cc99:0x2a6};function _0x16b42a(_0x572e73,_0x40cbaf,_0x6579ea,_0x80015c,_0x579303){return a0_0x300a(_0x572e73- -a0_0x398ef7._0x37cc99,_0x80015c);}function _0x45b8ff(_0x5e528b,_0x26c648,_0x54966d,_0x44f6ba,_0x543207){return a0_0x300a(_0x5e528b-a0_0x175800._0x11e067,_0x44f6ba);}function _0x345620(_0x2a328d,_0x6c78ba,_0x1dfd67,_0x2cb8d0,_0x567efd){return a0_0x300a(_0x1dfd67-a0_0x1ba153._0xd1ac4e,_0x567efd);}var _0x239861={};_0x239861[_0x345620(a0_0x4c3c56._0x16d69d,a0_0x4c3c56._0xa787e2,a0_0x4c3c56._0x90dae5,a0_0x4c3c56._0x2d28fe,'T&u3')]='(((.+'+_0x45b8ff(a0_0x4c3c56._0x160df6,a0_0x4c3c56._0x13fb8d,0x1b9,a0_0x4c3c56._0x157140,a0_0x4c3c56._0x4ddfee)+'+$';var _0xc68536=_0x239861;return a0_0x80a6cf[_0x16b42a(-0x159,-a0_0x4c3c56._0x23d38e,-0x160,a0_0x4c3c56._0x433366,-a0_0x4c3c56._0x3432e7)+_0x16b42a(-a0_0x4c3c56._0x130f9d,-a0_0x4c3c56._0x5536d4,-a0_0x4c3c56._0xd34688,'f)Ip',-a0_0x4c3c56._0x130f9d)]()[_0x45b8ff(0x1aa,a0_0x4c3c56._0x41940b,a0_0x4c3c56._0x858607,a0_0x4c3c56._0x79082,a0_0x4c3c56._0x522e4d)+'h'](_0xc68536['FLkzF'])['toStr'+_0x45b8ff(a0_0x4c3c56._0x511eb0,a0_0x4c3c56._0x160df6,a0_0x4c3c56._0x11ddad,a0_0x4c3c56._0x38d7b4,a0_0x4c3c56._0x17c81f)]()[_0x45b8ff(a0_0x4c3c56._0x5116d0,a0_0x4c3c56._0x2ae8dd,a0_0x4c3c56._0x27262f,a0_0x4c3c56._0x1383e9,a0_0x4c3c56._0x35b995)+_0x345620(a0_0x4c3c56._0x1371be,a0_0x4c3c56._0x2a831b,a0_0x4c3c56._0x3fa0e1,a0_0x4c3c56._0x594b28,a0_0x4c3c56._0x5ade31)+'r'](a0_0x80a6cf)['searc'+'h'](_0xc68536['FLkzF']);});a0_0x80a6cf();import{A as a0_0x1cdd2f,B as a0_0x40b402,C as a0_0xfe1ec4,D as a0_0x48b228,b as a0_0x4b78d3,c as a0_0x318a64,d as a0_0x19614e,e as a0_0x35a2de,f as a0_0x3be3bd,g as a0_0x4fa6c6,h as a0_0x1b60f2,i as a0_0x3227ee,j as a0_0x5877e7,k as a0_0x2eedd1,l as a0_0x50889f,m as a0_0x25e849,n as a0_0x118ce0,o as a0_0x2cb35d,p as a0_0xa9e326,q as a0_0x31d188,r as a0_0x4bb131,s as a0_0x25be19,t as a0_0x548ed8,u as a0_0x2b8cb4,v as a0_0x87c32d,w as a0_0x5b2c17,x as a0_0x52b111,y as a0_0xc8cac8,z as a0_0x56ad41}from'../chunk-UI3PRTL6.js';function a0_0x300a(_0x15d04d,_0xd8c271){_0x15d04d=_0x15d04d-(-0xa59*-0x1+-0x8*0x477+0xd*0x20d);var _0x2c7876=a0_0x2486();var _0x4f5d1e=_0x2c7876[_0x15d04d];if(a0_0x300a['gNEROh']===undefined){var _0x599a01=function(_0x12b2b6){var _0x356bfc='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0xffb097='',_0x60cc3c='',_0x19127e=_0xffb097+_0x599a01;for(var _0x26b89e=-0x90*0x3d+-0x2*-0xc7e+-0xc*-0xc7,_0x50afc9,_0x17df64,_0x3cffbc=-0xfaa*0x2+0x4ff+0x1a55;_0x17df64=_0x12b2b6['charAt'](_0x3cffbc++);~_0x17df64&&(_0x50afc9=_0x26b89e%(0x1d7b+-0xf76+-0xe01)?_0x50afc9*(-0x92a+0x917+-0x1*-0x53)+_0x17df64:_0x17df64,_0x26b89e++%(-0x1206+0xf4d+0x2bd))?_0xffb097+=_0x19127e['charCodeAt'](_0x3cffbc+(-0x12ba*-0x2+0x788+0x1*-0x2cf2))-(-0x1299+-0x1ed5*-0x1+-0xc32)!==0xd*-0x42+0x1*-0x1180+0x14da?String['fromCharCode'](-0x16dd*-0x1+-0xb23+-0xabb&_0x50afc9>>(-(0xf34+-0x22fb+-0x5*-0x3f5)*_0x26b89e&0x2*-0x110+0x2491+0x1*-0x226b)):_0x26b89e:0x254c+-0x4*0x503+-0x10*0x114){_0x17df64=_0x356bfc['indexOf'](_0x17df64);}for(var _0x251584=-0x6f1*0x2+-0x1*0xd2d+0x1b0f,_0xebf631=_0xffb097['length'];_0x251584<_0xebf631;_0x251584++){_0x60cc3c+='%'+('00'+_0xffb097['charCodeAt'](_0x251584)['toString'](0xbe9+0x1*-0x96d+-0x3e*0xa))['slice'](-(0x10*-0xb+0x87e*0x1+-0x7cc));}return decodeURIComponent(_0x60cc3c);};var _0x121168=function(_0x4c5fd7,_0x4bc205){var _0x17f038=[],_0x1661d8=0x53*0x2b+-0x7*0x3b9+0xb*0x11a,_0x4a6869,_0x2484c9='';_0x4c5fd7=_0x599a01(_0x4c5fd7);var _0x4a539a;for(_0x4a539a=0xd18*0x2+-0x10a4+-0x98c*0x1;_0x4a539a<-0x262c+0x21*-0x13+0x299f;_0x4a539a++){_0x17f038[_0x4a539a]=_0x4a539a;}for(_0x4a539a=0x1e35+0x7c*-0x7+-0x1ad1;_0x4a539a<0x8d*0x3a+-0xc*0x2+0x16*-0x167;_0x4a539a++){_0x1661d8=(_0x1661d8+_0x17f038[_0x4a539a]+_0x4bc205['charCodeAt'](_0x4a539a%_0x4bc205['length']))%(-0x11*0x10a+0x1369+0xbf*-0x1),_0x4a6869=_0x17f038[_0x4a539a],_0x17f038[_0x4a539a]=_0x17f038[_0x1661d8],_0x17f038[_0x1661d8]=_0x4a6869;}_0x4a539a=0x870+-0x1*0xf9+-0x777,_0x1661d8=0x8ec+0x176c+-0x2058;for(var _0x583062=0x19*0x7+-0x82*-0x1a+-0xde3;_0x583062<_0x4c5fd7['length'];_0x583062++){_0x4a539a=(_0x4a539a+(0x3f9*0x7+0x6*0x419+-0x3464))%(-0x991*-0x1+0xc9f*-0x3+0x1d4c),_0x1661d8=(_0x1661d8+_0x17f038[_0x4a539a])%(-0x23a*-0x10+-0x1*-0xd1f+-0x11*0x2cf),_0x4a6869=_0x17f038[_0x4a539a],_0x17f038[_0x4a539a]=_0x17f038[_0x1661d8],_0x17f038[_0x1661d8]=_0x4a6869,_0x2484c9+=String['fromCharCode'](_0x4c5fd7['charCodeAt'](_0x583062)^_0x17f038[(_0x17f038[_0x4a539a]+_0x17f038[_0x1661d8])%(-0x2454+-0x2174+-0x11b2*-0x4)]);}return _0x2484c9;};a0_0x300a['fontTO']=_0x121168,a0_0x300a['QpSgeG']={},a0_0x300a['gNEROh']=!![];}var _0x1fc0dd=_0x2c7876[0x2*0x657+-0xd38+0x8a],_0x5c0909=_0x15d04d+_0x1fc0dd,_0x4191d8=a0_0x300a['QpSgeG'][_0x5c0909];if(!_0x4191d8){if(a0_0x300a['HKCLrk']===undefined){var _0x15aaf3=function(_0x411eb6){this['DRAGCu']=_0x411eb6,this['RllFKs']=[-0x1726*0x1+-0x11c3+0x28ea,-0xa*-0x1c5+-0x304+-0xeae,0x6*0x2a2+0x8e0+-0x18ac],this['XGYnYY']=function(){return'newState';},this['JsnWWh']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['hJXNIT']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x15aaf3['prototype']['HImHBG']=function(){var _0x442230=new RegExp(this['JsnWWh']+this['hJXNIT']),_0x50b3c4=_0x442230['test'](this['XGYnYY']['toString']())?--this['RllFKs'][-0x2*-0x4c7+0x1032+-0x19bf]:--this['RllFKs'][-0x23d4+0x5b*-0x2+0x2*0x1245];return this['JvMjiO'](_0x50b3c4);},_0x15aaf3['prototype']['JvMjiO']=function(_0x4c61d7){if(!Boolean(~_0x4c61d7))return _0x4c61d7;return this['mtpTVn'](this['DRAGCu']);},_0x15aaf3['prototype']['mtpTVn']=function(_0x257fdd){for(var _0x39d5d4=0x6*-0x146+-0x1d00+-0x14f*-0x1c,_0xc69747=this['RllFKs']['length'];_0x39d5d4<_0xc69747;_0x39d5d4++){this['RllFKs']['push'](Math['round'](Math['random']())),_0xc69747=this['RllFKs']['length'];}return _0x257fdd(this['RllFKs'][-0x100f+-0x3e3+0x13f2]);},new _0x15aaf3(a0_0x300a)['HImHBG'](),a0_0x300a['HKCLrk']=!![];}_0x4f5d1e=a0_0x300a['fontTO'](_0x4f5d1e,_0xd8c271),a0_0x300a['QpSgeG'][_0x5c0909]=_0x4f5d1e;}else _0x4f5d1e=_0x4191d8;return _0x4f5d1e;}function a0_0x2486(){var _0x394c62=['W43dJ1DCWQZdQmouDmkBW7pdUmkLW4q','D8kxumkvt8oyWQ7dKrhdM8k3W60','o8kUFg5cDuDadSogW5uUW48','W57cUCkmWOhcHSoHWOq','o8kMCg9jEKn+b8ojW7ezW5e','W6BcJwxdT8km','W7dcJMvbu8o8mh7cSKlcGG','h8kpW5m','i8ogCxvQWPCkWRZcIKtcSgm','W4yYjCokD8o2W6q','ntVcQNW+','W6ddPMJcMWFcQSkW','cNpdSIdcHq','ff52W7dcVvxcRxldKHRcGCkj','W6ngW47cIHJdKCkUzCo6W4/dMq','WOahmhZcKSoZhhNdNZK+W5a','W4raCCkHgSk2WO1CD8oJcYHz','WQ4zWQxdH1S','W7DUbWH9','ffn2W7BcVLBdKuZdLJJcGSkJW54','mubUrCkxzmkTDhvl','W5BdRCo7cxiAW7D/WQddL8o1b8oM','W7PcfG','vG4UWRFdRG','W6DbWOhcTMxcHXVcN3dcN2dcTa','cmomW4GlWRldSmk7q3z5DJS'];a0_0x2486=function(){return _0x394c62;};return a0_0x2486();}import{a as a0_0x2f9337,b as a0_0x3c3fa8,c as a0_0x4c373e,d as a0_0x437ed8,e as a0_0xac86df}from'../chunk-I5OOVR5U.js';import'../chunk-LV4HGC5G.js';import'../chunk-ZLL42OOV.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x2f9337 as AssetCache,a0_0x4c373e as AssetLoader,a0_0x2b8cb4 as AssetSystem,a0_0x437ed8 as AssetTextures,a0_0x25be19 as Assets,a0_0x2cb35d as BaseSystem,a0_0x118ce0 as GameEngine,a0_0x35a2de as GameObject,a0_0x3be3bd as GameObjectManager,a0_0x25e849 as ObjectFactory,a0_0x19614e as Renderer,a0_0xa9e326 as RuntimeObjectRegistry,a0_0x318a64 as Transform,a0_0x40b402 as applyScreenAnchor,a0_0x31d188 as basePixi,a0_0x5b2c17 as clearResponsiveElements,a0_0x4b78d3 as createPixiBase,a0_0x5877e7 as getRegisteredFontIds,a0_0x87c32d as globalResponsiveMultipliers,a0_0xac86df as initAssetTextures,a0_0x548ed8 as initAssets,a0_0xfe1ec4 as layout,a0_0x50889f as playLottieOverlay,a0_0x3227ee as registerFont,a0_0x3c3fa8 as registerType,a0_0xc8cac8 as resolveAnchorVec2,a0_0x4fa6c6 as resolveFont,a0_0x1b60f2 as resolveFontWeight,a0_0x56ad41 as resolveScreenAnchorPoint,a0_0x1cdd2f as resolveScreenRatioPoint,a0_0x48b228 as runInitSequence,a0_0x2eedd1 as setLottieInstance,a0_0x4bb131 as spawnSceneFromConfig,a0_0x52b111 as updateScreenState};
|
|
1
|
+
(function(_0x1930d0,_0x41b455){var a0_0xd2cb9c={_0x16491d:0x29f,_0xc3fc31:0x2ab,_0x5bdb6d:0x2a3,_0x47ad03:'F@y*',_0x49a114:0x290,_0xcec3a0:0x293,_0x55b9cf:0x299,_0x2d836b:0x291,_0xf9e3f1:0x29c,_0x59e2ec:0x295,_0x233978:0xc8,_0x13b708:0xcb,_0x461113:0xd3,_0x425d02:'yGCJ',_0x5848cd:0x28a,_0x10f3e0:0x298,_0x510301:0x27f,_0x16db07:0x285,_0x1ff08f:0xc5,_0x5b9f6e:0xd4,_0x3ed068:0x2aa,_0x2c165b:0x29e,_0xf3ca90:'pMUo',_0x36c2d0:0x2a1,_0x1eb0da:0x28e,_0x20f333:0x281,_0x4af12c:'XCio',_0x5ef4f0:0x28c,_0x13dd71:0xf1,_0x4a584a:0xe8,_0x38de3d:0xd5,_0x3a3394:0xec,_0x3553ac:0xe3,_0x30b3f7:0xe9},a0_0x2c1304={_0x71b8f5:0x314},a0_0x1e5f34={_0x5d138e:0x5a},a0_0x5048ae={_0x4aea76:0x15d};function _0x5cb6f8(_0x5e87ed,_0x5d22a8,_0x1a14c6,_0xbc24a6,_0x13eaf8){return a0_0x1741(_0xbc24a6- -a0_0x5048ae._0x4aea76,_0x5e87ed);}var _0x27a22c=_0x1930d0();function _0x11d607(_0x23ce57,_0x143425,_0x215d3a,_0x3c134c,_0x35baf4){return a0_0x1741(_0x215d3a-a0_0x1e5f34._0x5d138e,_0x35baf4);}function _0x34e688(_0x2ca250,_0x7f6352,_0x587c2a,_0x298206,_0x254780){return a0_0x1741(_0x2ca250- -a0_0x2c1304._0x71b8f5,_0x298206);}while(!![]){try{var _0x432f2c=parseInt(_0x34e688(-a0_0xd2cb9c._0x16491d,-a0_0xd2cb9c._0xc3fc31,-a0_0xd2cb9c._0x5bdb6d,a0_0xd2cb9c._0x47ad03,-a0_0xd2cb9c._0x49a114))/(-0x930+-0x3c7+-0x28*-0x53)+-parseInt(_0x34e688(-a0_0xd2cb9c._0xcec3a0,-a0_0xd2cb9c._0x55b9cf,-a0_0xd2cb9c._0x2d836b,'4NN]',-a0_0xd2cb9c._0xf9e3f1))/(-0x229d+-0x2fe+-0x259d*-0x1)*(-parseInt(_0x34e688(-0x28c,-0x295,-0x297,'%uoU',-a0_0xd2cb9c._0x59e2ec))/(-0x1b7*0x11+0x1ced+0x3d))+parseInt(_0x11d607(0xd2,a0_0xd2cb9c._0x233978,a0_0xd2cb9c._0x13b708,a0_0xd2cb9c._0x461113,a0_0xd2cb9c._0x425d02))/(-0x2e9*0xd+0x2438+-0x8b*-0x3)+-parseInt(_0x34e688(-a0_0xd2cb9c._0x5848cd,-a0_0xd2cb9c._0x10f3e0,-a0_0xd2cb9c._0x510301,'8GKv',-a0_0xd2cb9c._0x16db07))/(-0x1*0x577+0x32b*-0x2+0xbd2)*(parseInt(_0x5cb6f8('M&WH',-a0_0xd2cb9c._0x1ff08f,-0xd9,-a0_0xd2cb9c._0x5b9f6e,-a0_0xd2cb9c._0x5b9f6e))/(-0x2272+-0xf84+0x31fc))+-parseInt(_0x34e688(-0x2a2,-a0_0xd2cb9c._0x3ed068,-a0_0xd2cb9c._0x2c165b,a0_0xd2cb9c._0xf3ca90,-a0_0xd2cb9c._0x36c2d0))/(-0x1343*-0x1+-0x3de+0x1*-0xf5e)*(-parseInt(_0x34e688(-a0_0xd2cb9c._0x1eb0da,-0x29a,-a0_0xd2cb9c._0x20f333,a0_0xd2cb9c._0x4af12c,-a0_0xd2cb9c._0x5ef4f0))/(-0x2a9*0xa+-0x1dd3*0x1+0x3875))+-parseInt(_0x5cb6f8('PTXe',-0xf9,-0xed,-0xed,-a0_0xd2cb9c._0x13dd71))/(0x913+-0x74a+0x10*-0x1c)+-parseInt(_0x11d607(a0_0xd2cb9c._0x4a584a,a0_0xd2cb9c._0x38de3d,0xda,0xe1,'m)QS'))/(-0x6cd+0x3*-0xa4d+-0x2*-0x12df)*(-parseInt(_0x5cb6f8('1)hy',-a0_0xd2cb9c._0x3a3394,-a0_0xd2cb9c._0x3553ac,-a0_0xd2cb9c._0x30b3f7,-0xda))/(-0xefc+-0x13f7+0x22fe));if(_0x432f2c===_0x41b455)break;else _0x27a22c['push'](_0x27a22c['shift']());}catch(_0x284b72){_0x27a22c['push'](_0x27a22c['shift']());}}}(a0_0x854c,0x78a75+-0x99c0a*-0x2+-0xf11e5));var a0_0x4bc827=(function(){var a0_0x57be92={_0x396b0e:'pMUo',_0x57e290:0x445,_0xc686f5:0x444},_0x577549=!![];return function(_0x3a42c8,_0xbf50bb){var a0_0x3ccf42={_0x4d4540:0x3c1},_0x67c9e9=_0x577549?function(){function _0x127712(_0x539b95,_0x5ebbdf,_0x5c3cea,_0x58103e,_0x221a6f){return a0_0x1741(_0x5c3cea-a0_0x3ccf42._0x4d4540,_0x539b95);}if(_0xbf50bb){var _0x485092=_0xbf50bb[_0x127712(a0_0x57be92._0x396b0e,a0_0x57be92._0x57e290,a0_0x57be92._0xc686f5,0x451,0x43a)](_0x3a42c8,arguments);return _0xbf50bb=null,_0x485092;}}:function(){};return _0x577549=![],_0x67c9e9;};}()),a0_0x6cfb46=a0_0x4bc827(this,function(){var a0_0xc5fdbd={_0x2b1a70:0xba,_0x51525f:0xad,_0xa63a9e:0xac,_0x2926bc:'%uoU',_0x5bb682:0x15,_0x569dce:0x8,_0x4e2565:0x4,_0x2940e5:'m)QS',_0x294667:0xa,_0x29e203:0xb6,_0xbb3f1f:0xa3,_0x366e16:0x35d,_0xa9dbcb:0x350,_0x5aefdd:0x362,_0xd0a970:0x363,_0x18a45c:'jZ$(',_0x347d9e:0x366,_0x32257b:0x367,_0x3debd2:0x35c,_0x255bde:'nhc9',_0x45d389:0x35f,_0x3fd7e5:'10jj',_0x59183d:0xbd,_0x5dbc5d:0xb1,_0x2acdc1:0xb8,_0x286e19:0xc0,_0x1a05bf:0xb8,_0x313737:0x375,_0xb7a4d3:0x381},a0_0x5769e9={_0x594540:0x3e8},a0_0x3d303c={_0x473382:0x88},a0_0x317408={_0x463bae:0x36},_0x5493f9={};function _0x40564b(_0x5919be,_0x1adb28,_0x6652a,_0x3194c6,_0x5cb5ba){return a0_0x1741(_0x5919be-a0_0x317408._0x463bae,_0x5cb5ba);}function _0x3a2973(_0x22d541,_0x20e010,_0x5e790a,_0x5431ac,_0x424d61){return a0_0x1741(_0x22d541- -a0_0x3d303c._0x473382,_0x20e010);}_0x5493f9[_0x40564b(a0_0xc5fdbd._0x2b1a70,a0_0xc5fdbd._0x51525f,0xba,a0_0xc5fdbd._0xa63a9e,a0_0xc5fdbd._0x2926bc)]=_0x3a2973(-0xa,'1Ti7',-0x7,-a0_0xc5fdbd._0x5bb682,-a0_0xc5fdbd._0x569dce)+_0x3a2973(a0_0xc5fdbd._0x4e2565,a0_0xc5fdbd._0x2940e5,0x10,0xd,a0_0xc5fdbd._0x294667)+'+$';function _0x2c2198(_0x478aac,_0x349157,_0x3cb2d0,_0x3ab2b4,_0x3f2abd){return a0_0x1741(_0x478aac- -a0_0x5769e9._0x594540,_0x3f2abd);}var _0x19f182=_0x5493f9;return a0_0x6cfb46[_0x40564b(0xad,a0_0xc5fdbd._0x29e203,a0_0xc5fdbd._0xbb3f1f,0x9f,'ySx4')+'ing']()[_0x2c2198(-a0_0xc5fdbd._0x366e16,-a0_0xc5fdbd._0xa9dbcb,-a0_0xc5fdbd._0x5aefdd,-a0_0xc5fdbd._0xd0a970,a0_0xc5fdbd._0x18a45c)+'h'](_0x19f182[_0x2c2198(-a0_0xc5fdbd._0x347d9e,-a0_0xc5fdbd._0x32257b,-a0_0xc5fdbd._0x3debd2,-0x357,a0_0xc5fdbd._0x255bde)])[_0x2c2198(-a0_0xc5fdbd._0xd0a970,-a0_0xc5fdbd._0x45d389,-0x365,-a0_0xc5fdbd._0x45d389,a0_0xc5fdbd._0x3fd7e5)+_0x40564b(a0_0xc5fdbd._0x59183d,a0_0xc5fdbd._0x5dbc5d,a0_0xc5fdbd._0x2acdc1,a0_0xc5fdbd._0x286e19,'vbQN')]()['const'+_0x40564b(0xb3,0xba,a0_0xc5fdbd._0x1a05bf,a0_0xc5fdbd._0x51525f,'F@y*')+'r'](a0_0x6cfb46)['searc'+'h'](_0x19f182[_0x2c2198(-a0_0xc5fdbd._0x313737,-a0_0xc5fdbd._0xb7a4d3,-0x37a,-0x372,'^n)[')]);});a0_0x6cfb46();function a0_0x854c(){var _0x22c285=['W7jIWRq3n2ycW7VcQ8oxWOve','W5VcQqqMnCklqJGfWPj7WOi','W75Wguu1','o8oarZ3dRSkxvMKAWQ4TW4xcSG','W7GyW4jiCr8z','W5nrxtNcJCkOW4HiW48YW6ZdLW','W4vUW70qWOmCWPW','h0WmW6tdMmo8A8kMBvpcOL1G','WRGIW65YAW','W7HIoH0v','WQBcG8ofC8kfkLDDWR1rxmopWRtdSq','dSkWmSkXW5ZdQ0GmW40','WQxdVmk5cmojus4','W7viW6XkWRq','buxcH8otW4C','DtpcGCkycG','F8o4r0vd','fvxcM10pWOX3','k2eT','j0JdRSoGCmo9nN5oW4rgfa','WRddM1bgESkKbmkcqSkxW7lcRCoi','p8kSaKNcG8onmq','jxeEWQ4G','fCkOk8opWOu','pZtdLmkCW6VcRKRcJ8kjpCopW7ldHci','W7ldNmobp2BcPM3dI8kKzt4QWRO','vqhdGSkoWOPRWONdH8ojEsO1fW','fYNdLmkBW7W','tSkEW6ldRtZcQmktW5TsWR/dQJq'];a0_0x854c=function(){return _0x22c285;};return a0_0x854c();}import{A as a0_0x2c78dd,B as a0_0x4e91c8,C as a0_0x364360,D as a0_0xe41b25,b as a0_0x50e64c,c as a0_0xedf974,d as a0_0x221032,e as a0_0x49a66e,f as a0_0x50c4c3,g as a0_0x51d7d7,h as a0_0x425b68,i as a0_0x3bb5cc,j as a0_0x1a664a,k as a0_0x15abb9,l as a0_0x328f0b,m as a0_0x54b35d,n as a0_0x42e9f3,o as a0_0x4a46fb,p as a0_0x39dbb4,q as a0_0x46150a,r as a0_0xf0865c,s as a0_0xaec2d8,t as a0_0x1d1423,u as a0_0x38ad62,v as a0_0x3d558c,w as a0_0x5e4402,x as a0_0x49a125,y as a0_0x21cb54,z as a0_0x543e94}from'../chunk-2YFOCUIT.js';import{a as a0_0x49ed68,b as a0_0x5a66fb,c as a0_0x1e804a,d as a0_0xb5e43a,e as a0_0x340f82}from'../chunk-I5OOVR5U.js';function a0_0x1741(_0xda8ec3,_0x98d328){_0xda8ec3=_0xda8ec3-(0x163a+-0x1569+-0x61*0x1);var _0x3b522f=a0_0x854c();var _0x159211=_0x3b522f[_0xda8ec3];if(a0_0x1741['zVOrbT']===undefined){var _0x29045a=function(_0x4a8c05){var _0x5f235c='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x5a64e7='',_0x1cbfc7='',_0x1b9a62=_0x5a64e7+_0x29045a;for(var _0x156dea=0x29*-0x7d+-0x16a0+-0x1*-0x2aa5,_0xe9ac22,_0x473330,_0x2af798=-0x694*0x2+-0x750+-0x51e*-0x4;_0x473330=_0x4a8c05['charAt'](_0x2af798++);~_0x473330&&(_0xe9ac22=_0x156dea%(0x6a3+-0x59*0x4e+0x147f)?_0xe9ac22*(-0x3*-0x49e+0x8f1+-0x1*0x168b)+_0x473330:_0x473330,_0x156dea++%(0x2662+0x563*-0x4+0x869*-0x2))?_0x5a64e7+=_0x1b9a62['charCodeAt'](_0x2af798+(-0x1fdb+-0x2*-0x1387+-0x729))-(-0xe3*-0x1c+-0x205*-0x7+-0x26ed)!==-0x6fc*-0x1+0x2e*-0x85+-0x10ea*-0x1?String['fromCharCode'](-0x27d*0xe+0x5fb+0x1dda&_0xe9ac22>>(-(-0xcbb*-0x1+-0x1*-0xac7+-0x1780)*_0x156dea&0x17fc+0x3*-0x1+-0x17f3)):_0x156dea:0x188b*0x1+0x4d1+-0xeae*0x2){_0x473330=_0x5f235c['indexOf'](_0x473330);}for(var _0x4334af=-0x223d+0x1fe5*0x1+0x2*0x12c,_0x13705c=_0x5a64e7['length'];_0x4334af<_0x13705c;_0x4334af++){_0x1cbfc7+='%'+('00'+_0x5a64e7['charCodeAt'](_0x4334af)['toString'](-0x853*0x1+0x1a9a+0x1*-0x1237))['slice'](-(-0x1b64+0x1b36+0xc*0x4));}return decodeURIComponent(_0x1cbfc7);};var _0x398254=function(_0x1093cc,_0x3711c9){var _0x33091b=[],_0xf38c77=-0x24*-0xc7+0xf4c+0x8a8*-0x5,_0xb4a286,_0x30b649='';_0x1093cc=_0x29045a(_0x1093cc);var _0xf70cf4;for(_0xf70cf4=0x38*0x48+0x15c9+-0x2589;_0xf70cf4<0xf3f*-0x1+-0xd*-0x91+0x17b*0x6;_0xf70cf4++){_0x33091b[_0xf70cf4]=_0xf70cf4;}for(_0xf70cf4=0x22ff+0x2d1*-0x5+-0xa75*0x2;_0xf70cf4<-0x3a*0x95+0x409*0x5+0xe95*0x1;_0xf70cf4++){_0xf38c77=(_0xf38c77+_0x33091b[_0xf70cf4]+_0x3711c9['charCodeAt'](_0xf70cf4%_0x3711c9['length']))%(-0x1657+0x549+-0x1*-0x120e),_0xb4a286=_0x33091b[_0xf70cf4],_0x33091b[_0xf70cf4]=_0x33091b[_0xf38c77],_0x33091b[_0xf38c77]=_0xb4a286;}_0xf70cf4=-0x2510+-0x1ded*-0x1+0x723,_0xf38c77=0x682*0x1+-0xa01+0x37f;for(var _0x4b22e0=0x3df*0x3+-0x2*0x17d+0x21*-0x43;_0x4b22e0<_0x1093cc['length'];_0x4b22e0++){_0xf70cf4=(_0xf70cf4+(0x1*-0x1f67+0x1*0x219b+0x233*-0x1))%(-0x23ef+0xdc6*-0x1+0x32b5),_0xf38c77=(_0xf38c77+_0x33091b[_0xf70cf4])%(0x61b+0xc09*0x3+-0x83e*0x5),_0xb4a286=_0x33091b[_0xf70cf4],_0x33091b[_0xf70cf4]=_0x33091b[_0xf38c77],_0x33091b[_0xf38c77]=_0xb4a286,_0x30b649+=String['fromCharCode'](_0x1093cc['charCodeAt'](_0x4b22e0)^_0x33091b[(_0x33091b[_0xf70cf4]+_0x33091b[_0xf38c77])%(0x1b3e+-0xd5f+-0xcdf)]);}return _0x30b649;};a0_0x1741['IuDuqJ']=_0x398254,a0_0x1741['OYduaa']={},a0_0x1741['zVOrbT']=!![];}var _0x27f472=_0x3b522f[0x26b8+0x1bd+0x2875*-0x1],_0x3d5405=_0xda8ec3+_0x27f472,_0x2798fa=a0_0x1741['OYduaa'][_0x3d5405];if(!_0x2798fa){if(a0_0x1741['DhohQE']===undefined){var _0x2c95ec=function(_0x18b4bb){this['niHwUb']=_0x18b4bb,this['nscLwV']=[-0x3d4+-0x15*0x1b+0x60c,-0x5*-0x757+-0x32*-0x99+-0xd51*0x5,0x4*-0x93a+-0x1*0x1b1+0x2699],this['mNZTjT']=function(){return'newState';},this['GXPGTf']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['cZxZeq']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x2c95ec['prototype']['egDQrY']=function(){var _0x3ac33b=new RegExp(this['GXPGTf']+this['cZxZeq']),_0x26ca4c=_0x3ac33b['test'](this['mNZTjT']['toString']())?--this['nscLwV'][-0x567+-0x930+0xe98]:--this['nscLwV'][0x250e+-0x119a+-0x1374];return this['PhFAtL'](_0x26ca4c);},_0x2c95ec['prototype']['PhFAtL']=function(_0x1d0d33){if(!Boolean(~_0x1d0d33))return _0x1d0d33;return this['ThdIqD'](this['niHwUb']);},_0x2c95ec['prototype']['ThdIqD']=function(_0x56b32e){for(var _0x394875=-0x1e9c+0x1b2b+0x371*0x1,_0x46c07d=this['nscLwV']['length'];_0x394875<_0x46c07d;_0x394875++){this['nscLwV']['push'](Math['round'](Math['random']())),_0x46c07d=this['nscLwV']['length'];}return _0x56b32e(this['nscLwV'][-0x198c+-0x6a1+0x1*0x202d]);},new _0x2c95ec(a0_0x1741)['egDQrY'](),a0_0x1741['DhohQE']=!![];}_0x159211=a0_0x1741['IuDuqJ'](_0x159211,_0x98d328),a0_0x1741['OYduaa'][_0x3d5405]=_0x159211;}else _0x159211=_0x2798fa;return _0x159211;}import'../chunk-LV4HGC5G.js';import'../chunk-ZLL42OOV.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x49ed68 as AssetCache,a0_0x1e804a as AssetLoader,a0_0x38ad62 as AssetSystem,a0_0xb5e43a as AssetTextures,a0_0xaec2d8 as Assets,a0_0x4a46fb as BaseSystem,a0_0x42e9f3 as GameEngine,a0_0x49a66e as GameObject,a0_0x50c4c3 as GameObjectManager,a0_0x54b35d as ObjectFactory,a0_0x221032 as Renderer,a0_0x39dbb4 as RuntimeObjectRegistry,a0_0xedf974 as Transform,a0_0x4e91c8 as applyScreenAnchor,a0_0x46150a as basePixi,a0_0x5e4402 as clearResponsiveElements,a0_0x50e64c as createPixiBase,a0_0x1a664a as getRegisteredFontIds,a0_0x3d558c as globalResponsiveMultipliers,a0_0x340f82 as initAssetTextures,a0_0x1d1423 as initAssets,a0_0x364360 as layout,a0_0x328f0b as playLottieOverlay,a0_0x3bb5cc as registerFont,a0_0x5a66fb as registerType,a0_0x21cb54 as resolveAnchorVec2,a0_0x51d7d7 as resolveFont,a0_0x425b68 as resolveFontWeight,a0_0x543e94 as resolveScreenAnchorPoint,a0_0x2c78dd as resolveScreenRatioPoint,a0_0xe41b25 as runInitSequence,a0_0x15abb9 as setLottieInstance,a0_0xf0865c as spawnSceneFromConfig,a0_0x49a125 as updateScreenState};
|