handler-playable-sdk 0.4.2 → 0.4.3
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-XGJ2QPBX.js → chunk-J2AONN5C.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 +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as Oi,d as le,e as Ii}from"./chunk-I5OOVR5U.js";import{i as zt}from"./chunk-LV4HGC5G.js";import{c as st,d as jt,e as lt,g as na,h as ji,j as Di,k as Dt,l as aa,m as ra,n as zi,o as oa}from"./chunk-ZLL42OOV.js";import{a as Yr}from"./chunk-JXBG6UFL.js";import{Application as $o}from"pixi.js";var Ce={};function Ht(a,e,t=!1){Ce[a]||(Ce[a]=[]),Ce[a].push({fn:e,once:t})}function Hi(a,e){if(Ce[a]){if(!e){delete Ce[a];return}Ce[a]=Ce[a].filter(t=>t.fn!==e)}}function $t(a,...e){let t=Ce[a];if(t)for(let i of[...t])i.fn(...e),i.once&&Hi(a,i.fn)}function ee(a,e){Ht(a,e,!0)}var G=null,ne=[],Ne=null;function ca(a){G=a,ne=[],Ne!==null&&(clearTimeout(Ne),Ne=null)}function da(){var a,e,t;return{endpoint:(G==null?void 0:G.endpoint)||"",transport:(G==null?void 0:G.transport)||"beacon",batchSize:(a=G==null?void 0:G.batchSize)!=null?a:10,flushIntervalMs:(e=G==null?void 0:G.flushIntervalMs)!=null?e:300,maxQueue:(t=G==null?void 0:G.maxQueue)!=null?t:200,debug:!!(G!=null&&G.debug)}}async function sa(a,e,t,i){let n=JSON.stringify(e);if(t==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let r=navigator.sendBeacon(a,new Blob([n],{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(a,{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(r){i&&console.warn("[handler.telemetry] fetch failed",r)}}function $i(a,e){let t=da();if(e&&t.endpoint){if(ne.push(a),ne.length>t.maxQueue&&(ne=ne.slice(ne.length-t.maxQueue)),ne.length>=t.batchSize){la();return}Ne===null&&(Ne=window.setTimeout(()=>{Ne=null,la()},t.flushIntervalMs))}}async function la(){let a=da();if(!a.endpoint||ne.length===0)return;let e=ne.splice(0,a.batchSize);await sa(a.endpoint,{events:e},a.transport,a.debug),ne.length>0&&await sa(a.endpoint,{events:ne.splice(0,a.batchSize)},a.transport,a.debug)}function pa(a){return Math.max(0,Math.min(1,a))}function Wr(a){let e=String(a!=null?a:"power2.out");if(e==="linear")return t=>t;if(e==="sine.inOut")return t=>.5-Math.cos(Math.PI*t)/2;if(e==="power2.out"||e==="easeOutQuad")return t=>1-(1-t)*(1-t);if(e.startsWith("back.out")){let t=e.match(/back\.out\(([\d.]+)\)/),i=t?Number(t[1]):1.8;return n=>1+(i+1)*Math.pow(n-1,3)+i*Math.pow(n-1,2)}return t=>1-(1-t)*(1-t)}function ct(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Kr(a,e){let t=a==null?void 0:a[e];return typeof t=="number"?t:0}function ua(a,e,t){try{a[e]=t}catch{}}function Xr(a){let e=a==null?void 0:a.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 ga(a,e){let t=a==null?void 0:a.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 ha(a,e){let t=Xr(a);if(!t)return{from:null,to:null};let i=null,n=null;return typeof e.scale=="number"?(i=e.scale,n=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(n=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(n=e.scaleY),i===null&&n===null?{from:null,to:null}:{from:{x:t.x,y:t.y},to:{x:i!=null?i:t.x,y:n!=null?n:t.y}}}function fa(){let a=new Set,e=new WeakMap,t=null,i=()=>{if(t!=null)return;t=requestAnimationFrame(()=>{t=null,s(),a.size>0&&i()})},n=d=>{var u;a.add(d);let p=(u=e.get(d.target))!=null?u:new Set;p.add(d),e.set(d.target,p),i()},r=d=>{a.delete(d);let p=e.get(d.target);p&&(p.delete(d),p.size===0&&e.delete(d.target))},o=d=>{d.killed||(d.killed=!0,r(d))},s=()=>{var p,u;let d=ct();for(let g of Array.from(a)){if(g.killed||g.paused)continue;let m=d-g.startMs-g.delayMs;if(m<0)continue;let h=g.durationMs>0?m/g.durationMs:1,f=pa(h),y=g.repeat>=0?g.repeat+1:1,b=g.repeat>0?Math.min(Math.floor(h),y-1):0;if(g.repeat>0&&h>=1){let w=h-b;f=pa(w)}let v=g.ease(f);g.yoyo&&b%2===1&&(v=1-v);for(let w of g.props)ua(g.target,w.key,w.from+(w.to-w.from)*v);g.scaleFrom&&g.scaleTo&&ga(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{(p=g.onUpdate)==null||p.call(g)}catch{}if(h>=y){o(g);try{(u=g.onComplete)==null||u.call(g)}catch{}}}},l=(d,p,u)=>{var w;let g=Math.max(0,(typeof p.duration=="number"?p.duration:.5)*1e3),m=Math.max(0,(typeof p.delay=="number"?p.delay:0)*1e3+((w=u==null?void 0:u.delayMsOverride)!=null?w:0)),h=Wr(p.ease),f=typeof p.repeat=="number"?Math.max(0,p.repeat|0):0,y=p.yoyo===!0,b=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),v=[];for(let E of Object.keys(p)){if(b.has(E))continue;let L=p[E];typeof L=="number"&&v.push({key:E,from:Kr(d,E),to:L})}let x=ha(d,p);return{target:d,startMs:ct(),delayMs:m,durationMs:g,ease:h,props:v,scaleFrom:x.from,scaleTo:x.to,repeat:f,yoyo:y,onUpdate:typeof p.onUpdate=="function"?p.onUpdate:void 0,onComplete:typeof p.onComplete=="function"?p.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},c={to(d,p){let u=l(d,p);return n(u),{kill:()=>o(u),pause:()=>{u.paused||(u.paused=!0,u.pauseAtMs=ct())},resume:()=>{var h;if(!u.paused)return;let g=(h=u.pauseAtMs)!=null?h:ct(),m=ct()-g;u.startMs+=m,u.paused=!1,u.pauseAtMs=null},isActive:()=>!u.killed&&!u.paused}},fromTo(d,p,u){return c.set(d,p),c.to(d,u)},set(d,p){if(!d||!p)return;for(let g of Object.keys(p)){let m=p[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof m=="number"&&ua(d,g,m)}let u=ha(d,p);u.to&&ga(d,u.to)},killTweensOf(d){let p=e.get(d);if(p)for(let u of Array.from(p))o(u)},timeline(d={}){let p=[],u=0,g=!1,m=[],h=b=>{if(typeof b=="number")return Math.max(0,b*1e3);let v=typeof b=="string"?b.trim():"";return v.startsWith("+=")?u+Math.max(0,Number(v.slice(2))*1e3||0):v?Math.max(0,Number(v)*1e3||0):u},f=b=>{p.push(b);let v=Math.max(0,(typeof b.vars.duration=="number"?b.vars.duration:.5)*1e3);u=Math.max(u,b.atMs+v)},y={to(b,v,x){return f({kind:"to",target:b,vars:v,atMs:h(x)}),y},fromTo(b,v,x,w){return f({kind:"fromTo",target:b,vars:x,from:v,atMs:h(w)}),y},play(){var b,v;if(g)return y;g=!0,m=[];for(let x of p)x.kind==="fromTo"&&c.set(x.target,(b=x.from)!=null?b:{}),m.push(c.to(x.target,{...x.vars,delay:x.atMs/1e3+((v=x.vars.delay)!=null?v:0)}));return y},pause(){for(let b of m)b.pause();return y},kill(){for(let b of m)b.kill();m=[],g=!1}};return d.paused||y.play(),y}};return c}function ma(){if(typeof window=="undefined")return;let a=window;if(!a.gsap)try{a.gsap=fa()}catch{}}var ba={name:"handler-playable-sdk",version:"0.4.2",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && chmod +x dist/cli/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var te=0,Zr=te++,ya=te++,va=te++,xa=te++,wa=te++,Ea=te++,Sa=te++,Aa=te++,Ca=te++,Ta=te++,La=te++,ka=te++,F=Zr;function Pa(){return F===ya}function Ma(){return F===va}function _a(){return F===xa}function Ra(){return F===wa}function Fe(){return F===Ea}function Ue(){return F===Sa}function Oa(){return F===Aa}function Ia(){return F===Ca}function ja(){return F===Ta}function Bi(){return F===La}function Ni(){return F===ka}function Da(){let a=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(a==="mraid")try{mraid.getState(),F=ya;return}catch{}else if(a==="dapi")try{dapi.isReady(),F=va;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(F=xa)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(F=wa)}catch{}else if(e==="mintegral")window.gameReady&&(F=Ea);else if(e==="tapjoy")window.TJ_API&&(F=Sa);else if(e==="tiktok")window.openAppStore&&(F=Aa);else if(e==="smadex")try{window.smxTracking&&(F=Ca)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(F=Ta)}catch{}else e==="vungle"?F=La:(a==="nucleo"||e==="nucleo")&&(F=ka)}import Fi from"lottie-web";var za=Fi;typeof window!="undefined"&&(window.lottie=Fi,window.__baseLottie=Fi);function q(a,e){let t=(n,r)=>r===0?n:t(r,n%r),i=t(a,e);return`${a/i}:${e/i}`}var Is=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:q(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:q(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:q(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:q(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:q(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:q(360,780)}],js=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:q(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:q(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:q(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:q(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:q(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:q(412,915)}],Ds=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:q(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:q(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:q(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:q(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:q(800,1280)}],Ui=[{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:q(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:q(768,1024),mraidScale:.7}];var Ha=[...Ui],$a=[{category:"playable",label:"Playable Ad",devices:Ui}],Gi=Ui[0];function Ge(a){return Ha.find(e=>e.id===a)||Gi}function zs(a){return Ha.filter(e=>e.category===a)}var Bt=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`
|
|
1
|
+
import{c as Oi,d as le,e as Ii}from"./chunk-I5OOVR5U.js";import{i as zt}from"./chunk-LV4HGC5G.js";import{c as st,d as jt,e as lt,g as na,h as ji,j as Di,k as Dt,l as aa,m as ra,n as zi,o as oa}from"./chunk-ZLL42OOV.js";import{a as Yr}from"./chunk-JXBG6UFL.js";import{Application as $o}from"pixi.js";var Ce={};function Ht(a,e,t=!1){Ce[a]||(Ce[a]=[]),Ce[a].push({fn:e,once:t})}function Hi(a,e){if(Ce[a]){if(!e){delete Ce[a];return}Ce[a]=Ce[a].filter(t=>t.fn!==e)}}function $t(a,...e){let t=Ce[a];if(t)for(let i of[...t])i.fn(...e),i.once&&Hi(a,i.fn)}function ee(a,e){Ht(a,e,!0)}var G=null,ne=[],Ne=null;function ca(a){G=a,ne=[],Ne!==null&&(clearTimeout(Ne),Ne=null)}function da(){var a,e,t;return{endpoint:(G==null?void 0:G.endpoint)||"",transport:(G==null?void 0:G.transport)||"beacon",batchSize:(a=G==null?void 0:G.batchSize)!=null?a:10,flushIntervalMs:(e=G==null?void 0:G.flushIntervalMs)!=null?e:300,maxQueue:(t=G==null?void 0:G.maxQueue)!=null?t:200,debug:!!(G!=null&&G.debug)}}async function sa(a,e,t,i){let n=JSON.stringify(e);if(t==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let r=navigator.sendBeacon(a,new Blob([n],{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(a,{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(r){i&&console.warn("[handler.telemetry] fetch failed",r)}}function $i(a,e){let t=da();if(e&&t.endpoint){if(ne.push(a),ne.length>t.maxQueue&&(ne=ne.slice(ne.length-t.maxQueue)),ne.length>=t.batchSize){la();return}Ne===null&&(Ne=window.setTimeout(()=>{Ne=null,la()},t.flushIntervalMs))}}async function la(){let a=da();if(!a.endpoint||ne.length===0)return;let e=ne.splice(0,a.batchSize);await sa(a.endpoint,{events:e},a.transport,a.debug),ne.length>0&&await sa(a.endpoint,{events:ne.splice(0,a.batchSize)},a.transport,a.debug)}function pa(a){return Math.max(0,Math.min(1,a))}function Wr(a){let e=String(a!=null?a:"power2.out");if(e==="linear")return t=>t;if(e==="sine.inOut")return t=>.5-Math.cos(Math.PI*t)/2;if(e==="power2.out"||e==="easeOutQuad")return t=>1-(1-t)*(1-t);if(e.startsWith("back.out")){let t=e.match(/back\.out\(([\d.]+)\)/),i=t?Number(t[1]):1.8;return n=>1+(i+1)*Math.pow(n-1,3)+i*Math.pow(n-1,2)}return t=>1-(1-t)*(1-t)}function ct(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Kr(a,e){let t=a==null?void 0:a[e];return typeof t=="number"?t:0}function ua(a,e,t){try{a[e]=t}catch{}}function Xr(a){let e=a==null?void 0:a.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 ga(a,e){let t=a==null?void 0:a.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 ha(a,e){let t=Xr(a);if(!t)return{from:null,to:null};let i=null,n=null;return typeof e.scale=="number"?(i=e.scale,n=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(n=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(n=e.scaleY),i===null&&n===null?{from:null,to:null}:{from:{x:t.x,y:t.y},to:{x:i!=null?i:t.x,y:n!=null?n:t.y}}}function fa(){let a=new Set,e=new WeakMap,t=null,i=()=>{if(t!=null)return;t=requestAnimationFrame(()=>{t=null,s(),a.size>0&&i()})},n=d=>{var u;a.add(d);let p=(u=e.get(d.target))!=null?u:new Set;p.add(d),e.set(d.target,p),i()},r=d=>{a.delete(d);let p=e.get(d.target);p&&(p.delete(d),p.size===0&&e.delete(d.target))},o=d=>{d.killed||(d.killed=!0,r(d))},s=()=>{var p,u;let d=ct();for(let g of Array.from(a)){if(g.killed||g.paused)continue;let m=d-g.startMs-g.delayMs;if(m<0)continue;let h=g.durationMs>0?m/g.durationMs:1,f=pa(h),y=g.repeat>=0?g.repeat+1:1,b=g.repeat>0?Math.min(Math.floor(h),y-1):0;if(g.repeat>0&&h>=1){let w=h-b;f=pa(w)}let v=g.ease(f);g.yoyo&&b%2===1&&(v=1-v);for(let w of g.props)ua(g.target,w.key,w.from+(w.to-w.from)*v);g.scaleFrom&&g.scaleTo&&ga(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{(p=g.onUpdate)==null||p.call(g)}catch{}if(h>=y){o(g);try{(u=g.onComplete)==null||u.call(g)}catch{}}}},l=(d,p,u)=>{var w;let g=Math.max(0,(typeof p.duration=="number"?p.duration:.5)*1e3),m=Math.max(0,(typeof p.delay=="number"?p.delay:0)*1e3+((w=u==null?void 0:u.delayMsOverride)!=null?w:0)),h=Wr(p.ease),f=typeof p.repeat=="number"?Math.max(0,p.repeat|0):0,y=p.yoyo===!0,b=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),v=[];for(let E of Object.keys(p)){if(b.has(E))continue;let L=p[E];typeof L=="number"&&v.push({key:E,from:Kr(d,E),to:L})}let x=ha(d,p);return{target:d,startMs:ct(),delayMs:m,durationMs:g,ease:h,props:v,scaleFrom:x.from,scaleTo:x.to,repeat:f,yoyo:y,onUpdate:typeof p.onUpdate=="function"?p.onUpdate:void 0,onComplete:typeof p.onComplete=="function"?p.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},c={to(d,p){let u=l(d,p);return n(u),{kill:()=>o(u),pause:()=>{u.paused||(u.paused=!0,u.pauseAtMs=ct())},resume:()=>{var h;if(!u.paused)return;let g=(h=u.pauseAtMs)!=null?h:ct(),m=ct()-g;u.startMs+=m,u.paused=!1,u.pauseAtMs=null},isActive:()=>!u.killed&&!u.paused}},fromTo(d,p,u){return c.set(d,p),c.to(d,u)},set(d,p){if(!d||!p)return;for(let g of Object.keys(p)){let m=p[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof m=="number"&&ua(d,g,m)}let u=ha(d,p);u.to&&ga(d,u.to)},killTweensOf(d){let p=e.get(d);if(p)for(let u of Array.from(p))o(u)},timeline(d={}){let p=[],u=0,g=!1,m=[],h=b=>{if(typeof b=="number")return Math.max(0,b*1e3);let v=typeof b=="string"?b.trim():"";return v.startsWith("+=")?u+Math.max(0,Number(v.slice(2))*1e3||0):v?Math.max(0,Number(v)*1e3||0):u},f=b=>{p.push(b);let v=Math.max(0,(typeof b.vars.duration=="number"?b.vars.duration:.5)*1e3);u=Math.max(u,b.atMs+v)},y={to(b,v,x){return f({kind:"to",target:b,vars:v,atMs:h(x)}),y},fromTo(b,v,x,w){return f({kind:"fromTo",target:b,vars:x,from:v,atMs:h(w)}),y},play(){var b,v;if(g)return y;g=!0,m=[];for(let x of p)x.kind==="fromTo"&&c.set(x.target,(b=x.from)!=null?b:{}),m.push(c.to(x.target,{...x.vars,delay:x.atMs/1e3+((v=x.vars.delay)!=null?v:0)}));return y},pause(){for(let b of m)b.pause();return y},kill(){for(let b of m)b.kill();m=[],g=!1}};return d.paused||y.play(),y}};return c}function ma(){if(typeof window=="undefined")return;let a=window;if(!a.gsap)try{a.gsap=fa()}catch{}}var ba={name:"handler-playable-sdk",version:"0.4.3",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && chmod +x dist/cli/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var te=0,Zr=te++,ya=te++,va=te++,xa=te++,wa=te++,Ea=te++,Sa=te++,Aa=te++,Ca=te++,Ta=te++,La=te++,ka=te++,F=Zr;function Pa(){return F===ya}function Ma(){return F===va}function _a(){return F===xa}function Ra(){return F===wa}function Fe(){return F===Ea}function Ue(){return F===Sa}function Oa(){return F===Aa}function Ia(){return F===Ca}function ja(){return F===Ta}function Bi(){return F===La}function Ni(){return F===ka}function Da(){let a=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(a==="mraid")try{mraid.getState(),F=ya;return}catch{}else if(a==="dapi")try{dapi.isReady(),F=va;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(F=xa)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(F=wa)}catch{}else if(e==="mintegral")window.gameReady&&(F=Ea);else if(e==="tapjoy")window.TJ_API&&(F=Sa);else if(e==="tiktok")window.openAppStore&&(F=Aa);else if(e==="smadex")try{window.smxTracking&&(F=Ca)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(F=Ta)}catch{}else e==="vungle"?F=La:(a==="nucleo"||e==="nucleo")&&(F=ka)}import Fi from"lottie-web";var za=Fi;typeof window!="undefined"&&(window.lottie=Fi,window.__baseLottie=Fi);function q(a,e){let t=(n,r)=>r===0?n:t(r,n%r),i=t(a,e);return`${a/i}:${e/i}`}var Is=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:q(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:q(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:q(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:q(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:q(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:q(360,780)}],js=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:q(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:q(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:q(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:q(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:q(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:q(412,915)}],Ds=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:q(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:q(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:q(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:q(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:q(800,1280)}],Ui=[{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:q(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:q(768,1024),mraidScale:.7}];var Ha=[...Ui],$a=[{category:"playable",label:"Playable Ad",devices:Ui}],Gi=Ui[0];function Ge(a){return Ha.find(e=>e.id===a)||Gi}function zs(a){return Ha.filter(e=>e.category===a)}var Bt=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`
|
|
2
2
|
<div class="scene-panel scene-objects panel-accent-teal" data-panel="scene-objects">
|
|
3
3
|
<div class="scene-panel-header" data-panel-handle>
|
|
4
4
|
<div class="panel-title">
|
|
@@ -1075,7 +1075,7 @@ This will DIRECTLY MODIFY your base configuration files WITHOUT creating a snaps
|
|
|
1075
1075
|
|
|
1076
1076
|
This cannot be undone unless you have git commits or backups.
|
|
1077
1077
|
|
|
1078
|
-
Are you absolutely sure?`))try{let t=Dt(),i={};for(let[r,o]of Object.entries(t.objects)){let s=o,l=r;/^(json\.|ui\.|effects\.|engine\.)/.test(l)||(l=`json.${r}`),s&&typeof s=="object"&&(s.identity||(s.identity={}),s.identity.id=l),i[`objects/${l}.json`]=s}t.engine&&(t.engine.runtime&&(i["engine/engine.runtime.json"]=t.engine.runtime),t.engine.assets&&(i["engine/engine.assets.json"]=t.engine.assets),t.engine.splash&&(i["engine/engine.splash.json"]=t.engine.splash),t.engine.loading&&(i["engine/engine.loading.json"]=t.engine.loading),t.engine.start&&(i["engine/engine.start.json"]=t.engine.start),t.engine.tutorial&&(i["engine/engine.tutorial.json"]=t.engine.tutorial),t.engine.endgame&&(i["engine/engine.endgame.json"]=t.engine.endgame),!t.engine.runtime&&!t.engine.assets&&(i["engine/engine.json"]=t.engine));for(let[r,o]of Object.entries(t.scenes)){let s=r.startsWith("scene.")?r:`scene.${r}`;i[`scenes/${s}.json`]=o}let n=await fetch("/api/apply-direct",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({configs:i,assets:{}})});if(!n.ok){let r=await n.json();throw new Error(r.error||"Direct apply failed")}lt(),this.showSuccessNotification(),this.refreshPanel()}catch(t){console.error("[ConfigPersistence] Direct apply failed:",t),alert(`\u274C Direct apply failed: ${t.message}`)}}};var hi=class{constructor(){this.debugOverlay=null;this.isDebugOpen=!1;this.selectedObjectId=null;this.configViewer=null;this.container=null;this.objectAutoApplyTimer=null;this.objectDebugRaf=null;this.objectBoundsGfx=null;this.objectAnchorGfx=null;this.highlightObject=!1;this.highlightAnchor=!1;this.activeTab="hierarchy";this.sceneObjectsPanel=new Bt;this.sceneToolsPanel=new Nt;this.nudgePanel=new Ft;this.inspectorPanel=new ei;this.libraryPanel=new dt;this.libraryPanelDocked=new dt;this.brandVisionPanel=new ni;this.customizeSettingsPanel=new ai;this.configPersistencePanel=new gi;this.loadingScreenPanel=new ri}applyAssetChange(e,t){return er(this,e,t)}resetAsset(e){return tr(this,e)}applySlotAsset(e,t,i){return ir(this,e,t,i)}resetSlotAsset(e,t,i){return nr(this,e,t,i)}startObjectVisuals(){return cr(this)}stopObjectVisuals(){return dr(this)}shouldRunObjectVisuals(){return si(this)}updateObjectVisuals(){return li(this)}getSelectedInstanceId(){return Ji(this)}getDisplayObjectById(e){return Zi(this,e)}getSelectedObjectConfig(){return gt(this)}getConfigAnchorWorldPoint(e){return Qi(this,e)}getScreenSize(){return en(this)}ensureBoundsGfx(){return tn(this)}ensureAnchorGfx(){return nn(this)}drawBounds(e){return an(this,e)}drawAnchor(e){return rn(this,e)}clearBounds(){return on(this)}clearAnchor(){return sn(this)}clearObjectVisuals(){return ut(this)}updateObjectInfo(e){return pt(this,e)}resetDebugConfig(){return di(this)}applyDebugConfig(){return gr(this)}exportDebugConfig(){return pi(this)}loadObjectConfig(e){return hr(this,e)}fillConfigViewer(e){return ci(this,e)}copyConfigValues(){return fr(this)}applyObjectConfig(e){return cn(this,e)}applyCustomizeSettings(e,t){return mr(this,e,t)}scheduleObjectAutoApply(){return br(this)}setupDebugEventListeners(){return yr(this)}setupDebugInputListeners(e){return hn(this,e)}setupPanelLayout(){return vr(this)}setupCollapsiblePanels(e){return fn(this,e)}setupRangeInput(e,t,i,n){return ae(this,e,t,i,n)}updateWorkbenchTabs(){return gn(this)}saveWorkbenchState(){return Oe(this)}loadWorkbenchState(){return ui(this)}initialize(e){var o;this.container=e,this.debugOverlay=e.querySelector(".debug-overlay"),this.configViewer=e.querySelector("#config-viewer");try{let s=localStorage.getItem("preview_workbench_state");if(s){let l=JSON.parse(s);l.activeTab&&(this.activeTab=l.activeTab)}}catch(s){console.warn("[PREVIEW] Failed to load workbench tab state",s)}this.sceneObjectsPanel.initialize(e,{onSelect:s=>this.handleObjectSelect(s)}),this.libraryPanel.initialize(e,{onApply:(s,l,c)=>this.applySlotAsset(s,l,c),onReset:(s,l,c)=>this.resetSlotAsset(s,l,c)});let t=e.querySelector("#dock-library-content");t&&(t.innerHTML=this.libraryPanelDocked.render(),this.libraryPanelDocked.initialize(
|
|
1078
|
+
Are you absolutely sure?`))try{let t=Dt(),i={};for(let[r,o]of Object.entries(t.objects)){let s=o,l=r;/^(json\.|ui\.|effects\.|engine\.)/.test(l)||(l=`json.${r}`),s&&typeof s=="object"&&(s.identity||(s.identity={}),s.identity.id=l),i[`objects/${l}.json`]=s}t.engine&&(t.engine.runtime&&(i["engine/engine.runtime.json"]=t.engine.runtime),t.engine.assets&&(i["engine/engine.assets.json"]=t.engine.assets),t.engine.splash&&(i["engine/engine.splash.json"]=t.engine.splash),t.engine.loading&&(i["engine/engine.loading.json"]=t.engine.loading),t.engine.start&&(i["engine/engine.start.json"]=t.engine.start),t.engine.tutorial&&(i["engine/engine.tutorial.json"]=t.engine.tutorial),t.engine.endgame&&(i["engine/engine.endgame.json"]=t.engine.endgame),!t.engine.runtime&&!t.engine.assets&&(i["engine/engine.json"]=t.engine));for(let[r,o]of Object.entries(t.scenes)){let s=r.startsWith("scene.")?r:`scene.${r}`;i[`scenes/${s}.json`]=o}let n=await fetch("/api/apply-direct",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({configs:i,assets:{}})});if(!n.ok){let r=await n.json();throw new Error(r.error||"Direct apply failed")}lt(),this.showSuccessNotification(),this.refreshPanel()}catch(t){console.error("[ConfigPersistence] Direct apply failed:",t),alert(`\u274C Direct apply failed: ${t.message}`)}}};var hi=class{constructor(){this.debugOverlay=null;this.isDebugOpen=!1;this.selectedObjectId=null;this.configViewer=null;this.container=null;this.objectAutoApplyTimer=null;this.objectDebugRaf=null;this.objectBoundsGfx=null;this.objectAnchorGfx=null;this.highlightObject=!1;this.highlightAnchor=!1;this.activeTab="hierarchy";this.sceneObjectsPanel=new Bt;this.sceneToolsPanel=new Nt;this.nudgePanel=new Ft;this.inspectorPanel=new ei;this.libraryPanel=new dt;this.libraryPanelDocked=new dt;this.brandVisionPanel=new ni;this.customizeSettingsPanel=new ai;this.configPersistencePanel=new gi;this.loadingScreenPanel=new ri}applyAssetChange(e,t){return er(this,e,t)}resetAsset(e){return tr(this,e)}applySlotAsset(e,t,i){return ir(this,e,t,i)}resetSlotAsset(e,t,i){return nr(this,e,t,i)}startObjectVisuals(){return cr(this)}stopObjectVisuals(){return dr(this)}shouldRunObjectVisuals(){return si(this)}updateObjectVisuals(){return li(this)}getSelectedInstanceId(){return Ji(this)}getDisplayObjectById(e){return Zi(this,e)}getSelectedObjectConfig(){return gt(this)}getConfigAnchorWorldPoint(e){return Qi(this,e)}getScreenSize(){return en(this)}ensureBoundsGfx(){return tn(this)}ensureAnchorGfx(){return nn(this)}drawBounds(e){return an(this,e)}drawAnchor(e){return rn(this,e)}clearBounds(){return on(this)}clearAnchor(){return sn(this)}clearObjectVisuals(){return ut(this)}updateObjectInfo(e){return pt(this,e)}resetDebugConfig(){return di(this)}applyDebugConfig(){return gr(this)}exportDebugConfig(){return pi(this)}loadObjectConfig(e){return hr(this,e)}fillConfigViewer(e){return ci(this,e)}copyConfigValues(){return fr(this)}applyObjectConfig(e){return cn(this,e)}applyCustomizeSettings(e,t){return mr(this,e,t)}scheduleObjectAutoApply(){return br(this)}setupDebugEventListeners(){return yr(this)}setupDebugInputListeners(e){return hn(this,e)}setupPanelLayout(){return vr(this)}setupCollapsiblePanels(e){return fn(this,e)}setupRangeInput(e,t,i,n){return ae(this,e,t,i,n)}updateWorkbenchTabs(){return gn(this)}saveWorkbenchState(){return Oe(this)}loadWorkbenchState(){return ui(this)}initialize(e){var o;this.container=e,this.debugOverlay=e.querySelector(".debug-overlay"),this.configViewer=e.querySelector("#config-viewer");try{let s=localStorage.getItem("preview_workbench_state");if(s){let l=JSON.parse(s);l.activeTab&&(this.activeTab=l.activeTab)}}catch(s){console.warn("[PREVIEW] Failed to load workbench tab state",s)}this.sceneObjectsPanel.initialize(e,{onSelect:s=>this.handleObjectSelect(s)}),this.libraryPanel.initialize(e,{onApply:(s,l,c)=>this.applySlotAsset(s,l,c),onReset:(s,l,c)=>this.resetSlotAsset(s,l,c)});let t=e.querySelector("#dock-library-content");t&&(t.innerHTML=this.libraryPanelDocked.render(),this.libraryPanelDocked.initialize(t,{onApply:(s,l,c)=>this.applySlotAsset(s,l,c),onReset:(s,l,c)=>this.resetSlotAsset(s,l,c)})),this.inspectorPanel.initialize(e,{onPropertyChange:(s,l,c)=>{console.log("[Inspector] Property changed:",s,l,c)}}),this.brandVisionPanel.initialize(e,()=>{this.toggleDebug(!1);let s="/dashboard";window.location.pathname!==s&&(window.location.href=s)}),this.customizeSettingsPanel.initialize(e,{onApply:(s,l)=>this.applyCustomizeSettings(s,l)});let i=e.querySelector("#scene-tools-container");i&&(i.innerHTML=this.sceneToolsPanel.render());let n=e.querySelector("#nudge-panel-container");n&&(n.innerHTML=this.nudgePanel.render()),this.sceneToolsPanel.initialize(i||e,{onHighlightObject:s=>{this.highlightObject=s,s?this.selectedObjectId&&this.startObjectVisuals():this.stopObjectVisuals()},onHighlightAnchor:s=>{this.highlightAnchor=s,s?this.selectedObjectId&&this.startObjectVisuals():this.stopObjectVisuals()},onNudge:(s,l)=>this.nudgeSelectedObject(s,l),onShowSplash:()=>{let s=window;typeof s.__previewShowSplash=="function"&&s.__previewShowSplash()},onUpdateSplash:s=>{let l=window;typeof l.applyEditableEngineConfig=="function"&&l.applyEditableEngineConfig({splash:s})}}),this.nudgePanel.initialize(n||e,{onNudge:async(s,l)=>{var h,f,y,b,v,x;if(!this.selectedObjectId)return;let c=this.getSelectedObjectConfig();if(!c)return;let d=(h=c.transform)==null?void 0:h.position,p=((f=d==null?void 0:d.x)!=null?f:0)+s,u=((y=d==null?void 0:d.y)!=null?y:0)+l,{applyConfigOverride:g}=await import("./ConfigOverride-JLWPHR4L.js");g({objectId:this.selectedObjectId,path:"transform.position",value:{x:p,y:u}},{silent:!0,emitEvent:!0});let m=window.applyEditableObjectConfig;if(typeof m=="function"){let w=window.__editableConfig,E=(x=(v=(b=w==null?void 0:w.objects)==null?void 0:b.get)==null?void 0:v.call(b,this.selectedObjectId))!=null?x:c;await m(this.selectedObjectId,E)}window.dispatchEvent(new CustomEvent("inspector:refresh"))},onScale:async s=>{var g,m,h,f,y;if(!this.selectedObjectId)return;let l=this.getSelectedObjectConfig();if(!l)return;let c=(m=(g=l.transform)==null?void 0:g.scale)!=null?m:1,d=Math.max(.1,c+s),{applyConfigOverride:p}=await import("./ConfigOverride-JLWPHR4L.js");p({objectId:this.selectedObjectId,path:"transform.scale",value:d},{silent:!0,emitEvent:!0});let u=window.applyEditableObjectConfig;if(typeof u=="function"){let b=window.__editableConfig,v=(y=(f=(h=b==null?void 0:b.objects)==null?void 0:h.get)==null?void 0:f.call(h,this.selectedObjectId))!=null?y:l;await u(this.selectedObjectId,v)}window.dispatchEvent(new CustomEvent("inspector:refresh"))}});let r=i==null?void 0:i.querySelector("#debug-nudge-enabled");r==null||r.addEventListener("change",()=>{r.checked?this.nudgePanel.show():this.nudgePanel.hide()}),this.configPersistencePanel.initialize(e),this.loadingScreenPanel.initialize(e,{onShowLoadingScreen:()=>{let s=window;typeof s.__previewShowLoading=="function"?s.__previewShowLoading():console.warn("[DEBUG] __previewShowLoading not available")},onHideLoadingScreen:()=>{let s=window;typeof s.__previewHideLoading=="function"?s.__previewHideLoading():console.warn("[DEBUG] __previewHideLoading not available")},onUpdateLoading:s=>{let l=window;typeof l.applyEditableEngineConfig=="function"&&l.applyEditableEngineConfig({loading:s}),typeof l.__previewUpdateLoading=="function"?l.__previewUpdateLoading(s):console.warn("[DEBUG] __previewUpdateLoading not available")}}),window.__openAiEditor=(s,l,c,d)=>{this.customizeSettingsPanel.openAiEditor(s,l,c,d)},this.setupPanelLayout(),this.updateWorkbenchTabs(),window.__debugContext=this,window.__updateWorkbenchTabs=()=>this.updateWorkbenchTabs(),this.isDebugOpen=!0,(o=this.debugOverlay)==null||o.classList.remove("hidden"),this.updateDebugBadge(),this.sceneObjectsPanel.refreshObjects(),window.__previewSelectObject=s=>this.selectObject(s),window.addEventListener("config:changed",s=>{var l,c;((l=s.detail)==null?void 0:l.action)!=="remove"&&((c=s.detail)==null?void 0:c.action)!=="clear_object"&&this.highlightChangesTab()}),window.applyAssetToSlot=(s,l,c)=>this.applySlotAsset(s,l,c),window.refreshAssetLibrary=()=>this.libraryPanel.refresh(),window.reRenderAssetLibrary=()=>this.libraryPanel.reRender(),window.getEngineSplashConfig=()=>{var l;let s=window.getActiveConfig;if(typeof s=="function"){let c=s();return((l=c==null?void 0:c.engine)==null?void 0:l.splash)||null}return null},window.addAssetToRegistry=(s,l)=>{let c=window.getEditableAssets;if(typeof c=="function"){let d=c();if(d!=null&&d.libraryAssets&&(d.libraryAssets[s]||(d.libraryAssets[s]=[]),!d.libraryAssets[s].some(u=>u.filename===l))){let u=l.replace(/\.(png|jpg|jpeg)$/i,"").replace(/_/g," ");d.libraryAssets[s].unshift({filename:l,displayName:u}),console.log(`[DEBUG] Added ${l} to registry category ${s}`)}}},window.__highlightLibrarySlot=(s,l)=>{this.libraryPanel.highlightSlot(s,l)}}selectObject(e){this.handleObjectSelect(e),this.activeTab!=="inspector"&&this.activeTab!=="ai"&&this.setActiveTab("inspector")}setActiveTab(e){this.activeTab=e,this.updateWorkbenchTabs(),this.saveWorkbenchState()}highlightChangesTab(){var t;let e=(t=this.container)==null?void 0:t.querySelector('[data-tab="changes"]');e&&e.classList.add("has-pending-changes")}getDebugOverlayHTML(){return`
|
|
1079
1079
|
<div class="debug-overlay hidden" id="debug-overlay">
|
|
1080
1080
|
<div class="debug-workbench" id="debug-workbench">
|
|
1081
1081
|
<div class="workbench-header" id="workbench-handle">
|